@cratis/stage.runtime 4.227.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/src/index.js CHANGED
@@ -3,33 +3,33 @@ import { t as e } from "../stageDarkSelector-DAwb43-P.js";
3
3
  import { ArcContext as t, useContributeApplicationContext as n } from "@cratis/arc.react";
4
4
  import { NotesButton as r, NotesProvider as i } from "@cratis/showrunner.notes.react";
5
5
  import "@cratis/showrunner.notes.react/styles";
6
- import { createContext as a, createElement as o, useCallback as s, useContext as c, useEffect as l, useId as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m } from "react";
7
- import { BindingSourceKind as h, ColorScheme as g, DestinationKind as _, FormGenerationMode as v, FormWidthUnit as y, GuardOperator as b, InteractionActionKind as x, InteractionTriggerKind as S, LogoKind as C, PackageKind as w, componentIconLibrary as T } from "@cratis/scene.model";
8
- import { InteractionStop as E, ShellDiagnosticCode as D, ShellOrigin as O, commandResponseContext as k, createBindingResolver as ee, hostProfilePackages as A, resolveArgumentSource as te, resolveBehaviors as j, resolveStringsInElement as ne, resolveStringsValue as re, resolveSubjectReference as M, runActions as N, runBindings as ie, validateBindingExpression as ae, validateResponseBindings as oe } from "@cratis/scene.engine";
9
- import { CoreSliceDialog as se, CoreToolbarItem as P, IconAdapterProvider as ce, InteractionScope as le, SceneElementView as ue, SceneNavigationContextInternal as de, SliceCommandFieldsProvider as fe, SliceDialogView as pe, SliceInvokerProvider as me, attachmentFor as he, componentRegistryKey as ge, coreComponents as _e, createBrowserDispatcher as ve, createBrowserSceneHistory as ye, createHashSceneHistory as be, createIconAdapterRegistry as xe, sliceDialogParameters as Se, useInteractionScope as Ce, useOptionalSceneNavigation as we, useSceneNavigation as Te, useSceneOutlets as Ee, useSceneTheme as De } from "@cratis/scene.react";
10
- import { ApplicationHost as Oe, ColorScheme as F, ComponentName as I, KanbanBoard as ke, LayoutThemeProvider as Ae, SlotName as L, blueprintPackageCatalog as je, composeApplicationScreen as Me, defaultBlueprintComponents as Ne, defaultBlueprintName as Pe, defaultBlueprintThemes as Fe, effectiveShellOf as Ie, externalComponent as R, galleryScreenTemplates as Le, layoutModes as Re, menuThemes as ze, navigationElement as Be, previewComponents as Ve, previewProfile as He, useLayoutConfig as Ue } from "@cratis/scene.blueprint.default";
6
+ import { createContext as a, createElement as o, useCallback as s, useContext as c, useEffect as l, useId as u, useLayoutEffect as d, useMemo as f, useRef as p, useState as m, useSyncExternalStore as h } from "react";
7
+ import { BindingSourceKind as g, ColorScheme as _, DestinationKind as v, FormGenerationMode as y, FormWidthUnit as b, GuardOperator as x, InteractionActionKind as S, InteractionTriggerKind as C, LogoKind as w, Opens as T, OutletItemKind as E, OutletKind as D, PackageKind as O, ScreenFit as k, SlotRole as A, componentIconLibrary as ee } from "@cratis/scene.model";
8
+ import { InputSourceKind as te, InteractionStop as j, ShellDiagnosticCode as M, ShellOrigin as N, commandResponseContext as P, createBindingResolver as ne, hostProfilePackages as re, outletChainOf as ie, placementSlotsOf as F, resolveArgumentSource as ae, resolveBehaviors as oe, resolveStringsInElement as se, resolveStringsValue as ce, resolveSubjectReference as le, runActions as ue, runBindings as de, sliceRouteSegment as fe, validateBindingExpression as pe, validateResponseBindings as me } from "@cratis/scene.engine";
9
+ import { CoreOutletItems as he, CoreSliceDialog as ge, IconAdapterProvider as _e, InteractionScope as ve, OutletView as ye, SceneElementView as be, SceneNavigationContextInternal as xe, SceneOutletsProvider as Se, SceneRouterProvider as Ce, SceneSlotRouteContext as we, SliceCommandFieldsProvider as Te, SliceDialogView as Ee, SliceInvokerProvider as De, attachmentFor as Oe, componentRegistryKey as ke, coreComponents as Ae, coreSlotShape as je, createBrowserDispatcher as Me, createIconAdapterRegistry as Ne, emptySceneRouteState as Pe, outletOfElement as Fe, parseRoutedSlotPath as Ie, routedSlotPath as Le, sliceDialogParameters as Re, useInteractionScope as ze, useOptionalSceneNavigation as Be, useOptionalSceneRouter as Ve, useSceneNavigation as He, useSceneOutlets as Ue, useSceneQueryParameters as We, useSceneSlots as Ge, useSceneTheme as Ke, withQueryParameter as qe, withSlotClosed as Je, withSlotOpened as Ye, withTabSelected as Xe } from "@cratis/scene.react";
10
+ import { ApplicationHost as Ze, ColorScheme as I, ComponentName as L, KanbanBoard as Qe, LayoutThemeProvider as $e, SlotName as R, blueprintPackageCatalog as et, composeApplicationScreen as tt, defaultBlueprintComponents as nt, defaultBlueprintName as rt, defaultBlueprintThemes as it, effectiveShellOf as at, externalComponent as z, galleryScreenTemplates as ot, layoutModes as st, menuThemes as ct, navigationElement as lt, previewComponents as ut, previewProfile as dt, useLayoutConfig as ft } from "@cratis/scene.blueprint.default";
11
11
  import "@cratis/components/tokens";
12
12
  import "@cratis/components/CommandForm/styles";
13
13
  import "@cratis/components/Dropdown/styles";
14
14
  import "@cratis/components/Common/styles";
15
15
  import "@cratis/components/Display/styles";
16
16
  import "@cratis/scene.blueprint.default/styles.css";
17
- import { ObservableQueryFor as We, Paging as Ge, QueryFor as Ke } from "@cratis/arc/queries";
18
- import { resolveCommand as qe, resolveExactQuery as Je } from "@cratis/scene.components";
19
- import { Command as Ye } from "@cratis/arc/commands";
20
- import { DateOnly as Xe, Guid as Ze } from "@cratis/fundamentals";
21
- import { Fragment as Qe, jsx as z, jsxs as B } from "react/jsx-runtime";
22
- import { Button as V } from "@cratis/components/Common";
23
- import { Dialog as $e } from "@cratis/components/Dialogs";
24
- import { Message as et } from "@cratis/components/Display";
25
- import { Slice as tt } from "@cratis/arc.react/slices";
26
- import { createPortal as nt } from "react-dom";
27
- import { CommandForm as rt, asCommandFormField as it, withCommandFormFieldBinding as at } from "@cratis/arc.react/commands";
28
- import { CalendarField as ot, CheckboxField as st, DropdownField as ct, InputTextField as lt, NumberField as ut } from "@cratis/components/CommandForm";
29
- import { cratisComponents as dt, cratisComponentsPackageManifest as ft } from "@cratis/scene.components/runtime";
30
- import { dynamicIconImports as pt } from "lucide-react/dynamic";
17
+ import { ObservableQueryFor as pt, Paging as mt, QueryFor as ht } from "@cratis/arc/queries";
18
+ import { resolveCommand as gt, resolveExactQuery as _t } from "@cratis/scene.components";
19
+ import { Command as vt } from "@cratis/arc/commands";
20
+ import { DateOnly as yt, Guid as bt } from "@cratis/fundamentals";
21
+ import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
22
+ import { Button as U } from "@cratis/components/Common";
23
+ import { Dialog as xt } from "@cratis/components/Dialogs";
24
+ import { Message as St } from "@cratis/components/Display";
25
+ import { Slice as Ct } from "@cratis/arc.react/slices";
26
+ import { createPortal as wt } from "react-dom";
27
+ import { CommandForm as Tt, asCommandFormField as Et, withCommandFormFieldBinding as Dt } from "@cratis/arc.react/commands";
28
+ import { CalendarField as Ot, CheckboxField as kt, DropdownField as At, InputTextField as jt, NumberField as Mt } from "@cratis/components/CommandForm";
29
+ import { cratisComponents as Nt, cratisComponentsPackageManifest as Pt } from "@cratis/scene.components/runtime";
30
+ import { dynamicIconImports as Ft } from "lucide-react/dynamic";
31
31
  // src/stageSource.ts
32
- function mt(e) {
32
+ function It(e) {
33
33
  return {
34
34
  scene: async () => e.scene,
35
35
  routes: async () => e.routes,
@@ -37,24 +37,24 @@ function mt(e) {
37
37
  strings: async (t) => e.strings[t] ?? {}
38
38
  };
39
39
  }
40
- var ht = {
40
+ var Lt = {
41
41
  scene: "stage/scene",
42
42
  routes: "stage/routes",
43
43
  locales: "stage/locales",
44
44
  modelReferences: "stage/model-references",
45
45
  strings: (e) => `stage/strings/${encodeURIComponent(e)}`
46
- }, gt = a(void 0);
47
- function _t({ source: e, children: t }) {
48
- return o(gt.Provider, { value: e }, t);
46
+ }, Rt = a(void 0);
47
+ function zt({ source: e, children: t }) {
48
+ return o(Rt.Provider, { value: e }, t);
49
49
  }
50
- function vt() {
51
- let e = c(gt);
50
+ function Bt() {
51
+ let e = c(Rt);
52
52
  if (!e) throw Error("A StageSourceProvider is required to render a Stage application.");
53
53
  return e;
54
54
  }
55
- ht.routes;
56
- function yt() {
57
- let e = vt(), [t, n] = m({
55
+ Lt.routes;
56
+ function Vt() {
57
+ let e = Bt(), [t, n] = m({
58
58
  routes: void 0,
59
59
  ready: !1
60
60
  });
@@ -74,24 +74,24 @@ function yt() {
74
74
  }, [e]), t;
75
75
  }
76
76
  // src/applyQueryChangeSet.ts
77
- function bt(e) {
77
+ function Ht(e) {
78
78
  return typeof e == "object" && e && "id" in e ? e.id : void 0;
79
79
  }
80
- function xt(e) {
80
+ function Ut(e) {
81
81
  if (typeof e != "object" || !e) return e;
82
82
  let t = e.toString();
83
83
  return t === "[object Object]" ? JSON.stringify(e) : t;
84
84
  }
85
- function St(e, t) {
86
- 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) : xt(e) === xt(t);
85
+ function Wt(e, t) {
86
+ 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) : Ut(e) === Ut(t);
87
87
  }
88
- function Ct(e, t) {
89
- if (t.removed.length > 0 ? bt(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => St(bt(e), bt(t)))).map((e) => t.replaced.find((t) => St(bt(t), bt(e))) ?? e), ...t.added];
88
+ function Gt(e, t) {
89
+ if (t.removed.length > 0 ? Ht(t.removed[0]) !== void 0 : t.replaced.length > 0) return [...e.filter((e) => !t.removed.some((t) => Wt(Ht(e), Ht(t)))).map((e) => t.replaced.find((t) => Wt(Ht(t), Ht(e))) ?? e), ...t.added];
90
90
  let n = new Set(t.removed.map((e) => JSON.stringify(e)));
91
91
  return [...e.filter((e) => !n.has(JSON.stringify(e))), ...t.added];
92
92
  }
93
93
  // src/hostedBasePath.ts
94
- function wt() {
94
+ function Kt() {
95
95
  let e = globalThis.document?.baseURI ?? globalThis.location?.href;
96
96
  if (!e) return "";
97
97
  try {
@@ -100,51 +100,51 @@ function wt() {
100
100
  return "";
101
101
  }
102
102
  }
103
- function Tt(e) {
104
- return e || wt();
103
+ function qt(e) {
104
+ return e || Kt();
105
105
  }
106
106
  // src/queryExecutor.ts
107
- var Et;
108
- function Dt(e) {
109
- Et = e;
107
+ var Jt;
108
+ function Yt(e) {
109
+ Jt = e;
110
110
  }
111
- function Ot(e, t) {
112
- let n = Je(e);
113
- return n === "ambiguous" && t && (n = Je(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), kt(n) ? n : t ? Et?.(t) : void 0;
111
+ function Xt(e, t) {
112
+ let n = _t(e);
113
+ return n === "ambiguous" && t && (n = _t(`${e}:${t.replace(/^\//, "").split("?")[0]}`)), Zt(n) ? n : t ? Jt?.(t) : void 0;
114
114
  }
115
- function kt(e) {
116
- return typeof e == "function" && (e.prototype instanceof Ke || e.prototype instanceof We);
115
+ function Zt(e) {
116
+ return typeof e == "function" && (e.prototype instanceof ht || e.prototype instanceof pt);
117
117
  }
118
- function At(e, t) {
119
- e.setMicroservice(t.microservice), e.setApiBasePath(Tt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = Ge.noPaging;
118
+ function Qt(e, t) {
119
+ e.setMicroservice(t.microservice), e.setApiBasePath(qt(t.apiBasePath)), e.setOrigin(t.origin ?? ""), e.setHttpHeadersCallback(t.httpHeadersCallback ?? (() => ({}))), e.paging = mt.noPaging;
120
120
  }
121
- function jt(e, t, n) {
121
+ function $t(e, t, n) {
122
122
  let r = new e();
123
- return At(r, n), r.perform(t);
123
+ return Qt(r, n), r.perform(t);
124
124
  }
125
- function Mt(e, t, n, r) {
125
+ function en(e, t, n, r) {
126
126
  let i = new e();
127
- if (i instanceof We) return At(i, n), i.subscribe(r, t);
127
+ if (i instanceof pt) return Qt(i, n), i.subscribe(r, t);
128
128
  }
129
129
  // src/stageSession.ts
130
- var Nt = "stage.session.";
131
- function Pt(e) {
130
+ var tn = "stage.session.";
131
+ function nn(e) {
132
132
  try {
133
133
  return globalThis.localStorage?.getItem(`stage.session.${e}`) || void 0;
134
134
  } catch {
135
135
  return;
136
136
  }
137
137
  }
138
- function Ft(e) {
139
- let t = Pt(e);
138
+ function rn(e) {
139
+ let t = nn(e);
140
140
  if (t) return t;
141
141
  let n = globalThis.crypto.randomUUID();
142
142
  try {
143
- globalThis.localStorage?.setItem(`${Nt}${e}`, n);
143
+ globalThis.localStorage?.setItem(`${tn}${e}`, n);
144
144
  } catch {}
145
145
  return n;
146
146
  }
147
- function It() {
147
+ function an() {
148
148
  let e = {};
149
149
  try {
150
150
  let t = globalThis.localStorage;
@@ -158,36 +158,36 @@ function It() {
158
158
  return e;
159
159
  }
160
160
  // src/commandExecutor.ts
161
- function H(e, t, n) {
161
+ function on(e, t, n) {
162
162
  for (let r of [
163
163
  t,
164
164
  n?.replace(/^\//, ""),
165
165
  e
166
166
  ]) {
167
167
  if (!r) continue;
168
- let t = qe(r);
169
- if (Lt(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
168
+ let t = gt(r);
169
+ if (sn(t) && !(r === e && n && new t().route.replace(/^\//, "") !== n.replace(/^\//, ""))) return t;
170
170
  }
171
171
  }
172
- function Lt(e) {
173
- return typeof e == "function" && e.prototype instanceof Ye;
172
+ function sn(e) {
173
+ return typeof e == "function" && e.prototype instanceof vt;
174
174
  }
175
- function Rt(e, t) {
176
- return e.setApiBasePath(Tt(t)), e;
175
+ function cn(e, t) {
176
+ return e.setApiBasePath(qt(t)), e;
177
177
  }
178
- async function zt(e, t, n) {
179
- let r = H(e);
178
+ async function ln(e, t, n) {
179
+ let r = on(e);
180
180
  if (!r) return {
181
181
  isSuccess: !1,
182
182
  validationErrors: [],
183
183
  messages: [`The modeled command “${e}” is not registered by this Stage.`]
184
184
  };
185
185
  let i = new r();
186
- i.setMicroservice(n.microservice), i.setApiBasePath(Tt(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
186
+ i.setMicroservice(n.microservice), i.setApiBasePath(qt(n.apiBasePath)), i.setOrigin(n.origin ?? ""), i.setHttpHeadersCallback(n.httpHeadersCallback ?? (() => ({})));
187
187
  for (let e of i.propertyDescriptors) Object.prototype.hasOwnProperty.call(t, e.name) && Reflect.set(i, e.name, t[e.name]);
188
- return Bt(e, await i.execute());
188
+ return un(e, await i.execute());
189
189
  }
190
- function Bt(e, t) {
190
+ function un(e, t) {
191
191
  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) => ({
192
192
  member: t,
193
193
  message: e.message
@@ -203,93 +203,93 @@ function Bt(e, t) {
203
203
  messages: n || i.length > 0 ? i : [`“${e}” was not accepted.`]
204
204
  };
205
205
  }
206
- function Vt() {
206
+ function dn() {
207
207
  let e = c(t);
208
- return s((t, n) => zt(t, n, e), [e]);
208
+ return s((t, n) => ln(t, n, e), [e]);
209
209
  }
210
210
  // src/stageNavigation.ts
211
- function Ht(e, t = {}) {
211
+ function fn(e, t = {}) {
212
212
  let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
213
213
  return n ? `#/${encodeURIComponent(e)}?${n}` : `#/${encodeURIComponent(e)}`;
214
214
  }
215
- function U(e, t = {}) {
215
+ function pn(e, t = {}) {
216
216
  if (!globalThis.location) return;
217
- if (Ut === "path") {
218
- let n = Gt(e, t);
217
+ if (mn === "path") {
218
+ let n = gn(e, t);
219
219
  if (`${globalThis.location.pathname}${globalThis.location.search}` === n) return;
220
220
  globalThis.history.pushState(null, "", n), globalThis.dispatchEvent(new PopStateEvent("popstate"));
221
221
  return;
222
222
  }
223
- let n = Ht(e, t);
223
+ let n = fn(e, t);
224
224
  globalThis.location.hash !== n && (globalThis.location.hash = n);
225
225
  }
226
- var Ut = "hash";
227
- function Wt(e) {
228
- Ut = e;
226
+ var mn = "hash";
227
+ function hn(e) {
228
+ mn = e;
229
229
  }
230
- function Gt(e, t = {}) {
230
+ function gn(e, t = {}) {
231
231
  let n = new URLSearchParams(Object.entries(t).filter(([, e]) => e !== "")).toString();
232
232
  return n ? `/${encodeURIComponent(e)}?${n}` : `/${encodeURIComponent(e)}`;
233
233
  }
234
- function Kt(e) {
235
- return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof Ze)).map(([e, t]) => [e, String(t)]));
234
+ function _n(e) {
235
+ return Object.fromEntries(Object.entries(e ?? {}).filter(([, e]) => e != null && e !== "" && (typeof e != "object" || e instanceof bt)).map(([e, t]) => [e, String(t)]));
236
236
  }
237
237
  // src/screenplayGuard.ts
238
- function qt(...[e, t, n]) {
238
+ function vn(...[e, t, n]) {
239
239
  let r = n.subject?.() ?? n.resolve({ path: "item" });
240
- return ie(e.map((e) => ({
240
+ return de(e.map((e) => ({
241
241
  ...e,
242
- binding: Xt(e.binding, r)
242
+ binding: xn(e.binding, r)
243
243
  })), t, n);
244
244
  }
245
- function Jt(e, t) {
246
- return Qt(e) ? e.kind === "logical" ? {
245
+ function yn(e, t) {
246
+ return Cn(e) ? e.kind === "logical" ? {
247
247
  ...e,
248
- left: Jt(e.left, t),
249
- right: Jt(e.right, t)
250
- } : e.kind !== "comparison" || e.operator !== b.Contains || typeof Zt(e.left, t) == "string" && typeof e.right == "string" ? e : {
248
+ left: yn(e.left, t),
249
+ right: yn(e.right, t)
250
+ } : e.kind !== "comparison" || e.operator !== x.Contains || typeof Sn(e.left, t) == "string" && typeof e.right == "string" ? e : {
251
251
  ...e,
252
252
  left: { subject: "" }
253
253
  } : e;
254
254
  }
255
- function Yt(e, t) {
256
- return Array.isArray(e) ? e.map((e) => Qt(e) ? {
255
+ function bn(e, t) {
256
+ return Array.isArray(e) ? e.map((e) => Cn(e) ? {
257
257
  ...e,
258
- condition: Jt(e.condition, t)
258
+ condition: yn(e.condition, t)
259
259
  } : e) : e;
260
260
  }
261
- function Xt(e, t) {
261
+ function xn(e, t) {
262
262
  return {
263
263
  ...e,
264
- alternatives: Yt(e.alternatives, t)
264
+ alternatives: bn(e.alternatives, t)
265
265
  };
266
266
  }
267
- function Zt(e, t) {
268
- return Qt(e) && typeof e.subject == "string" ? M({ subject: e.subject }, t) : void 0;
267
+ function Sn(e, t) {
268
+ return Cn(e) && typeof e.subject == "string" ? le({ subject: e.subject }, t) : void 0;
269
269
  }
270
- function Qt(e) {
270
+ function Cn(e) {
271
271
  return typeof e == "object" && !!e && !Array.isArray(e);
272
272
  }
273
273
  // src/stageData.tsx
274
- var $t = "cratis.stage.data-changed", en = a(() => () => void 0), tn = _e["core:guarded-action"];
275
- function nn(e) {
274
+ var wn = "cratis.stage.data-changed", Tn = a(() => () => void 0), En = Ae["core:guarded-action"];
275
+ function Dn(e) {
276
276
  return e.componentName === "core:guarded-action" || e.componentName === "core:action" && Array.isArray(e.properties.alternatives);
277
277
  }
278
- function rn(e) {
279
- let { dispatcher: t, attachments: n } = an(), { item: r, refused: i, error: a } = on(e.element);
280
- if (i) return /* @__PURE__ */ B("span", {
278
+ function On(e) {
279
+ let { dispatcher: t, attachments: n } = kn(), { item: r, refused: i, error: a } = An(e.element);
280
+ if (i) return /* @__PURE__ */ H("span", {
281
281
  role: "alert",
282
282
  children: ["STAGE-SCENE-ACTION-001: The action's data subject or command scope is unavailable.", a]
283
283
  });
284
284
  let o = {
285
- kind: h.Literal,
285
+ kind: g.Literal,
286
286
  path: "",
287
287
  value: r
288
288
  };
289
- return /* @__PURE__ */ z(le, {
289
+ return /* @__PURE__ */ V(ve, {
290
290
  dispatcher: t,
291
291
  attachments: n,
292
- children: /* @__PURE__ */ z(tn, {
292
+ children: /* @__PURE__ */ V(En, {
293
293
  ...e,
294
294
  slots: e.slots ?? {},
295
295
  element: {
@@ -297,16 +297,16 @@ function rn(e) {
297
297
  properties: {
298
298
  ...e.element.properties,
299
299
  item: o,
300
- alternatives: Xt({ alternatives: e.element.properties.alternatives }, r).alternatives
300
+ alternatives: xn({ alternatives: e.element.properties.alternatives }, r).alternatives
301
301
  }
302
302
  }
303
303
  })
304
304
  });
305
305
  }
306
- function an() {
307
- let e = W(), t = Ce(), n = Vt();
306
+ function kn() {
307
+ let e = W(), t = ze(), n = dn();
308
308
  return {
309
- dispatcher: t?.dispatcher ?? ve({
309
+ dispatcher: t?.dispatcher ?? Me({
310
310
  executeCommand: async (t, r) => {
311
311
  let i = await n(t, r);
312
312
  return i.isSuccess && e.refreshAfterCommand(), {
@@ -316,43 +316,43 @@ function an() {
316
316
  exceptionMessages: i.messages
317
317
  };
318
318
  },
319
- navigate: (e, t) => U(e, Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)])))
319
+ navigate: (e, t) => pn(e, Object.fromEntries(Object.entries(t).map(([e, t]) => [e, String(t)])))
320
320
  }),
321
321
  attachments: t?.attachments ?? []
322
322
  };
323
323
  }
324
- function on(e) {
325
- let t = W(), n = sn(e, t), r = G(n), i = e.properties.itemSelection === !0, a = i ? Object.values(t.selections).filter((e) => e !== void 0) : r.rows;
324
+ function An(e) {
325
+ let t = W(), n = jn(e, t), r = G(n), i = e.properties.itemSelection === !0, a = i ? Object.values(t.selections).filter((e) => e !== void 0) : r.rows;
326
326
  return {
327
327
  item: a.length === 1 ? a[0] : void 0,
328
- refused: !dn(n) && !i || !!r.error,
328
+ refused: !Fn(n) && !i || !!r.error,
329
329
  error: r.error
330
330
  };
331
331
  }
332
- function sn(e, t) {
333
- let n = e.properties, r = cn(n.itemQuery), i = t.routes?.queries?.[r ?? ""] ?? cn(n.itemRoute), a = q(n.itemArguments) ? n.itemArguments : {}, o = Object.fromEntries(Object.entries(a).map(([e, n]) => [e, ln(n, t.resolveBinding)]));
332
+ function jn(e, t) {
333
+ let n = e.properties, r = Mn(n.itemQuery), i = t.routes?.queries?.[r ?? ""] ?? Mn(n.itemRoute), a = q(n.itemArguments) ? n.itemArguments : {}, o = Object.fromEntries(Object.entries(a).map(([e, n]) => [e, Nn(n, t.resolveBinding)]));
334
334
  return {
335
335
  scope: `${e.id}:item`,
336
336
  name: r,
337
337
  route: i,
338
338
  arguments: o,
339
- ready: n.itemSelection !== !0 && Object.values(o).every(un),
339
+ ready: n.itemSelection !== !0 && Object.values(o).every(Pn),
340
340
  publish: !1
341
341
  };
342
342
  }
343
- function cn(e) {
343
+ function Mn(e) {
344
344
  return typeof e == "string" ? e : void 0;
345
345
  }
346
- function ln(e, t) {
346
+ function Nn(e, t) {
347
347
  return q(e) && typeof e.path == "string" ? t({ path: e.path }) : e;
348
348
  }
349
- function un(e) {
349
+ function Pn(e) {
350
350
  return e != null && e !== "";
351
351
  }
352
- function dn(e) {
352
+ function Fn(e) {
353
353
  return !!(e.name || e.route);
354
354
  }
355
- var fn = a({
355
+ var In = a({
356
356
  locale: "",
357
357
  locales: [],
358
358
  screen: "",
@@ -377,16 +377,16 @@ var fn = a({
377
377
  resolveArgument: () => void 0,
378
378
  registerQueryResult: () => void 0,
379
379
  refreshVersion: 0
380
- }), pn = [
380
+ }), Ln = [
381
381
  500,
382
382
  1500,
383
383
  3e3,
384
384
  6e3,
385
385
  1e4,
386
386
  15e3
387
- ], mn = {};
388
- function hn({ routes: e, routesReady: t = !0, parameters: n = mn, locale: r, locales: i, screen: a, children: o }) {
389
- let [c, u] = m({}), [d, p] = m(0), [h, g] = m({}), [_, v] = m(), [y, b] = m({}), [x, S] = m({}), [C, w] = m({}), [T, E] = m({ version: 0 }), D = f(() => Tn(C), [C]), O = s((e, t) => {
387
+ ], Rn = {};
388
+ function zn({ routes: e, routesReady: t = !0, parameters: n = Rn, locale: r, locales: i, screen: a, children: o }) {
389
+ let [c, u] = m({}), [d, p] = m(0), [h, g] = m({}), [_, v] = m(), [y, b] = m({}), [x, S] = m({}), [C, w] = m({}), [T, E] = m({ version: 0 }), D = f(() => Yn(C), [C]), O = s((e, t) => {
390
390
  u((n) => {
391
391
  if (!t) {
392
392
  let { [e]: t, ...r } = n;
@@ -397,7 +397,7 @@ function hn({ routes: e, routesReady: t = !0, parameters: n = mn, locale: r, loc
397
397
  [e]: t
398
398
  };
399
399
  });
400
- }, []), k = n, A = f(() => It(), [d]), j = f(() => ({
400
+ }, []), k = n, A = f(() => an(), [d]), ee = f(() => ({
401
401
  name: a,
402
402
  keys: {
403
403
  ...A,
@@ -407,12 +407,12 @@ function hn({ routes: e, routesReady: t = !0, parameters: n = mn, locale: r, loc
407
407
  n,
408
408
  a,
409
409
  A
410
- ]), ne = s((e, t) => {
410
+ ]), te = s((e, t) => {
411
411
  g((n) => ({
412
412
  ...n,
413
413
  [e]: t
414
414
  })), v(t ? e : (t) => t === e ? void 0 : t);
415
- }, []), re = s((e) => {
415
+ }, []), j = s((e) => {
416
416
  g((t) => ({
417
417
  ...t,
418
418
  [e]: void 0
@@ -422,30 +422,30 @@ function hn({ routes: e, routesReady: t = !0, parameters: n = mn, locale: r, loc
422
422
  let i = q(r[e]) ? r[e] : {};
423
423
  return {
424
424
  ...r,
425
- [e]: wn(i, t.split(".").filter(Boolean), n)
425
+ [e]: Jn(i, t.split(".").filter(Boolean), n)
426
426
  };
427
427
  });
428
428
  }, []), N = s((e) => E((t) => ({
429
429
  query: e,
430
430
  version: t.version + 1
431
- })), []), { settling: ie, refreshAfterCommand: oe, registerAwaitingQuery: se } = gn(N, p);
431
+ })), []), { settling: P, refreshAfterCommand: re, registerAwaitingQuery: ie } = Bn(N, p);
432
432
  l(() => {
433
433
  let e = () => N(), t = (e) => N(e.detail?.query);
434
- return globalThis.addEventListener($t, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
435
- globalThis.removeEventListener($t, e), globalThis.removeEventListener("cratis.scene.refresh", t);
434
+ return globalThis.addEventListener(wn, e), globalThis.addEventListener("cratis.scene.refresh", t), () => {
435
+ globalThis.removeEventListener(wn, e), globalThis.removeEventListener("cratis.scene.refresh", t);
436
436
  };
437
437
  }, [N]);
438
- let P = _ ? h[_] : void 0, ce = s((e) => {
438
+ let F = _ ? h[_] : void 0, oe = s((e) => {
439
439
  if (e === void 0) return;
440
- if (typeof e == "string") return En(e, P, h, c, y, k, j, r, i);
441
- let t = xn(P, c, y, {
440
+ if (typeof e == "string") return Xn(e, F, h, c, y, k, ee, r, i);
441
+ let t = Gn(F, c, y, {
442
442
  ...D,
443
443
  ...x
444
444
  }, h);
445
- if (!e.kind && e.path.startsWith("component.")) return te(e.path, t);
446
- if (!e.kind) return En(e.path, P, h, c, y, k, j, r, i);
447
- let n = ae(e, t);
448
- return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), ee(t)(e);
445
+ if (!e.kind && e.path.startsWith("component.")) return ae(e.path, t);
446
+ if (!e.kind) return Xn(e.path, F, h, c, y, k, ee, r, i);
447
+ let n = pe(e, t);
448
+ return n.length > 0 && console.warn(`Scene binding could not be resolved: ${n.map((e) => `${e.code}:${e.message}`).join("; ")}`), ne(t)(e);
449
449
  }, [
450
450
  x,
451
451
  r,
@@ -454,10 +454,10 @@ function hn({ routes: e, routesReady: t = !0, parameters: n = mn, locale: r, loc
454
454
  k,
455
455
  D,
456
456
  c,
457
- j,
458
- P,
457
+ ee,
458
+ F,
459
459
  h
460
- ]), le = s((e) => e ? te(e, xn(P, c, y, {
460
+ ]), se = s((e) => e ? ae(e, Gn(F, c, y, {
461
461
  ...D,
462
462
  ...x
463
463
  }, h)) : void 0, [
@@ -465,16 +465,16 @@ function hn({ routes: e, routesReady: t = !0, parameters: n = mn, locale: r, loc
465
465
  y,
466
466
  D,
467
467
  c,
468
- P,
468
+ F,
469
469
  h
470
- ]), ue = s((e, t) => w((n) => ({
470
+ ]), ce = s((e, t) => w((n) => ({
471
471
  ...n,
472
472
  [e]: t
473
- })), []), de = s((e) => w((t) => {
473
+ })), []), le = s((e) => w((t) => {
474
474
  if (!Object.prototype.hasOwnProperty.call(t, e)) return t;
475
475
  let n = { ...t };
476
476
  return delete n[e], n;
477
- }), []), fe = f(() => xn(void 0, c, {}, {}, {}).queryResults, [c]), pe = f(() => ({
477
+ }), []), ue = f(() => Gn(void 0, c, {}, {}, {}).queryResults, [c]), de = f(() => ({
478
478
  locale: r,
479
479
  locales: i,
480
480
  screen: a,
@@ -483,62 +483,62 @@ function hn({ routes: e, routesReady: t = !0, parameters: n = mn, locale: r, loc
483
483
  parameters: k,
484
484
  session: A,
485
485
  queries: c,
486
- selected: P,
486
+ selected: F,
487
487
  selections: h,
488
- selectRow: ne,
489
- clearSelection: re,
490
- setState: (e, t) => b((n) => wn(n, e.split(".").filter(Boolean), t)),
488
+ selectRow: te,
489
+ clearSelection: j,
490
+ setState: (e, t) => b((n) => Jn(n, e.split(".").filter(Boolean), t)),
491
491
  setComponentOutput: M,
492
- publishComponentOutputs: ue,
493
- withdrawComponentOutputs: de,
494
- queryResults: fe,
492
+ publishComponentOutputs: ce,
493
+ withdrawComponentOutputs: le,
494
+ queryResults: ue,
495
495
  refreshQuery: N,
496
- refreshAfterCommand: oe,
497
- settling: ie,
498
- resolveBinding: ce,
499
- resolveArgument: le,
496
+ refreshAfterCommand: re,
497
+ settling: P,
498
+ resolveBinding: oe,
499
+ resolveArgument: se,
500
500
  registerQueryResult: O,
501
501
  refreshVersion: T.version,
502
502
  refreshQueryName: T.query
503
503
  }), [
504
- re,
504
+ j,
505
505
  r,
506
506
  i,
507
507
  c,
508
- oe,
509
- ie,
508
+ re,
509
+ P,
510
510
  N,
511
511
  T.query,
512
512
  T.version,
513
513
  O,
514
- ue,
515
- de,
516
- fe,
517
- le,
518
514
  ce,
515
+ le,
516
+ ue,
517
+ se,
518
+ oe,
519
519
  e,
520
520
  t,
521
521
  k,
522
522
  A,
523
523
  a,
524
- ne,
525
- P,
524
+ te,
525
+ F,
526
526
  h,
527
527
  M
528
528
  ]);
529
- return /* @__PURE__ */ z(fn.Provider, {
530
- value: pe,
531
- children: /* @__PURE__ */ z(en.Provider, {
532
- value: se,
529
+ return /* @__PURE__ */ V(In.Provider, {
530
+ value: de,
531
+ children: /* @__PURE__ */ V(Tn.Provider, {
532
+ value: ie,
533
533
  children: o
534
534
  })
535
535
  });
536
536
  }
537
- function gn(e, t) {
537
+ function Bn(e, t) {
538
538
  let n = p([]), r = p(0), i = p(0), a = p(/* @__PURE__ */ new Set()), [o, c] = m(!1), u = s(() => (i.current += 1, () => {
539
539
  --i.current, i.current === 0 && a.current.forEach((e) => e());
540
540
  }), []), d = s(() => {
541
- t((e) => e + 1), e(), r.current += 1, c(!0), n.current.push(..._n(e, a.current, () => {
541
+ t((e) => e + 1), e(), r.current += 1, c(!0), n.current.push(...Vn(e, a.current, () => {
542
542
  --r.current, r.current === 0 && c(!1);
543
543
  }, () => i.current > 0));
544
544
  }, [e, t]);
@@ -548,20 +548,20 @@ function gn(e, t) {
548
548
  registerAwaitingQuery: u
549
549
  };
550
550
  }
551
- function _n(e, t, n, r) {
551
+ function Vn(e, t, n, r) {
552
552
  let i = [], a = () => {
553
553
  i.forEach(clearTimeout), t.delete(a), n();
554
- }, o = pn[pn.length - 1];
555
- for (let n of pn) i.push(setTimeout(() => {
554
+ }, o = Ln[Ln.length - 1];
555
+ for (let n of Ln) i.push(setTimeout(() => {
556
556
  e(), n === 3e3 && (t.add(a), r() || a()), n === o && a();
557
557
  }, n));
558
558
  return i;
559
559
  }
560
- var W = () => c(fn);
560
+ var W = () => c(In);
561
561
  function G(e) {
562
562
  let { refreshQueryName: n, refreshVersion: r, registerQueryResult: i, settling: a } = W(), o = c(t), u = e.publish !== !1, d = s((e, t) => {
563
563
  u && i(e, t);
564
- }, [u, i]), f = e.ready ?? !0, h = dn(e) && f, [g, _] = m([]), [v, y] = m(""), [b, x] = m(h), [S, C] = m(0), w = p(0), T = p(!1), E = JSON.stringify(e.arguments ?? {});
564
+ }, [u, i]), f = e.ready ?? !0, h = Fn(e) && f, [g, _] = m([]), [v, y] = m(""), [b, x] = m(h), [S, C] = m(0), w = p(0), T = p(!1), E = JSON.stringify(e.arguments ?? {});
565
565
  return l(() => {
566
566
  if (!h) {
567
567
  w.current += 1, _([]), y(""), x(!1), d(e.scope, void 0);
@@ -569,17 +569,17 @@ function G(e) {
569
569
  }
570
570
  let t = w.current + 1;
571
571
  w.current = t;
572
- let n = new AbortController(), r = JSON.parse(E), i = Ot(e.name ?? "", e.route);
572
+ let n = new AbortController(), r = JSON.parse(E), i = Xt(e.name ?? "", e.route);
573
573
  x(!0), y("");
574
574
  let a = (e) => {
575
575
  w.current !== t || n.signal.aborted || (T.current = !1, _([]), y(e instanceof Error ? e.message : String(e)), x(!1));
576
576
  }, s = [], c = (e) => {
577
577
  if (w.current !== t || n.signal.aborted) return;
578
- let r = kn(e);
579
- r ? a(Error(r)) : e.isReady !== !1 && (s = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(s) ? Ct(s, e.changeSet) : e.data, _(An(s)), y(""), x(!1));
578
+ let r = $n(e);
579
+ r ? a(Error(r)) : e.isReady !== !1 && (s = e.changeSet && Array.isArray(e.data) && e.data.length === 0 && Array.isArray(s) ? Gt(s, e.changeSet) : e.data, _(er(s)), y(""), x(!1));
580
580
  };
581
581
  if (!i) return a(/* @__PURE__ */ Error(`The modeled query “${e.name}” is not registered by this Stage.`)), () => n.abort();
582
- let l = i.prototype instanceof We, u = () => Promise.resolve().then(() => jt(i, l ? {
582
+ let l = i.prototype instanceof pt, u = () => Promise.resolve().then(() => $t(i, l ? {
583
583
  ...r,
584
584
  waitForFirstResult: !0
585
585
  } : r, o)).then(c).catch(a);
@@ -589,7 +589,7 @@ function G(e) {
589
589
  w.current !== t || n.signal.aborted || (T.current = !1, f?.unsubscribe(), f = void 0, u());
590
590
  }, 15e3);
591
591
  try {
592
- f = Mt(i, r, o, (e) => {
592
+ f = en(i, r, o, (e) => {
593
593
  e.isReady !== !1 && globalThis.clearTimeout(p), c(e);
594
594
  });
595
595
  } catch {
@@ -640,47 +640,47 @@ function G(e) {
640
640
  ]), {
641
641
  rows: g,
642
642
  loading: b,
643
- awaitingCommand: vn(h, g, v, a),
643
+ awaitingCommand: Hn(h, g, v, a),
644
644
  error: v,
645
645
  refresh: () => {
646
646
  T.current || C((e) => e + 1);
647
647
  }
648
648
  };
649
649
  }
650
- function vn(e, t, n, r) {
650
+ function Hn(e, t, n, r) {
651
651
  let i = p(!1);
652
652
  t.length > 0 && (i.current = !0);
653
- let a = c(en), o = yn(e, t, n, r) && !i.current;
653
+ let a = c(Tn), o = Un(e, t, n, r) && !i.current;
654
654
  return l(() => {
655
655
  if (o) return a();
656
656
  }, [o, a]), o;
657
657
  }
658
- function yn(e, t, n, r) {
658
+ function Un(e, t, n, r) {
659
659
  return !(!e || !r || n || t.length !== 0);
660
660
  }
661
- function bn() {
662
- globalThis.dispatchEvent(new CustomEvent($t));
661
+ function Wn() {
662
+ globalThis.dispatchEvent(new CustomEvent(wn));
663
663
  }
664
- function xn(e, t, n, r, i) {
664
+ function Gn(e, t, n, r, i) {
665
665
  let a = Object.entries(t).sort(([, e], [, t]) => Number(e.list === !0) - Number(t.list === !0));
666
666
  return {
667
667
  dataContext: e,
668
668
  queryResults: Object.fromEntries(a.flatMap(([e, t]) => {
669
- let n = t.list ? t.rows : Sn(t.rows);
669
+ let n = t.list ? t.rows : Kn(t.rows);
670
670
  return [
671
671
  [e, n],
672
672
  ...t.name ? [[t.name, n]] : [],
673
673
  ...t.alias ? [[t.alias, n]] : []
674
674
  ];
675
675
  })),
676
- componentOutputs: Cn(r, i),
676
+ componentOutputs: qn(r, i),
677
677
  state: n
678
678
  };
679
679
  }
680
- function Sn(e) {
680
+ function Kn(e) {
681
681
  return e.length === 1 ? e[0] : e;
682
682
  }
683
- function Cn(e, t) {
683
+ function qn(e, t) {
684
684
  let n = { ...e };
685
685
  for (let [e, r] of Object.entries(t)) r && (n[e] = {
686
686
  ...r,
@@ -688,17 +688,17 @@ function Cn(e, t) {
688
688
  });
689
689
  return n;
690
690
  }
691
- function wn(e, t, n) {
691
+ function Jn(e, t, n) {
692
692
  let [r, ...i] = t;
693
693
  return r ? i.length === 0 ? {
694
694
  ...e,
695
695
  [r]: n
696
696
  } : {
697
697
  ...e,
698
- [r]: wn(q(e[r]) ? e[r] : {}, i, n)
698
+ [r]: Jn(q(e[r]) ? e[r] : {}, i, n)
699
699
  } : e;
700
700
  }
701
- function Tn(e) {
701
+ function Yn(e) {
702
702
  let t = {};
703
703
  for (let n of Object.values(e)) for (let [e, r] of Object.entries(n)) t[e] = {
704
704
  ...t[e],
@@ -706,7 +706,7 @@ function Tn(e) {
706
706
  };
707
707
  return t;
708
708
  }
709
- function En(e, t, n, r, i, a, o, s, c) {
709
+ function Xn(e, t, n, r, i, a, o, s, c) {
710
710
  if (!e) return;
711
711
  let l = e.replace(/^\$\.?/, "").split(".").filter(Boolean);
712
712
  if (l.length !== 0) {
@@ -715,20 +715,20 @@ function En(e, t, n, r, i, a, o, s, c) {
715
715
  let e = K(o, l.slice(1));
716
716
  return e === void 0 && l[1] === "keys" && l.length === 3 ? K(t, [l[2]]) : e;
717
717
  }
718
- return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? On(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Dn(l.slice(1).join("."), t, n) : l[0] === "state" ? K(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : K(t, l) ?? On(r, void 0, l.join(".")) ?? K(i, l);
718
+ return l[0] === "locale" ? s : l[0] === "locales" ? c : l[0] === "query" ? Qn(r, l[1], l.slice(2).join(".")) : l[0] === "data" || l[0] === "selected" || l[0] === "current" ? Zn(l.slice(1).join("."), t, n) : l[0] === "state" ? K(i, l.slice(1)) : l[0] === "parameters" ? l.length === 1 ? a : a[l[1]] : K(t, l) ?? Qn(r, void 0, l.join(".")) ?? K(i, l);
719
719
  }
720
720
  }
721
- function Dn(e, t, n) {
721
+ function Zn(e, t, n) {
722
722
  let r = e?.split(".").filter(Boolean) ?? [];
723
723
  return r.length > 0 && Object.hasOwn(n, r[0]) ? K(n[r[0]], r.slice(1)) : r.length === 0 ? t : K(t, r);
724
724
  }
725
- function On(e, t, n) {
725
+ function Qn(e, t, n) {
726
726
  let r = Object.entries(e).filter(([e, n]) => t ? n.name === t || e === t : !n.list).map(([, e]) => e.rows);
727
727
  if (r.length === 0) return;
728
728
  let i = r.flat(), a = n?.split(".").filter(Boolean) ?? [];
729
729
  return a.length === 0 ? i : i.length === 1 ? K(i[0], a) : i.map((e) => K(e, a));
730
730
  }
731
- function kn(e) {
731
+ function $n(e) {
732
732
  if (!q(e)) return "";
733
733
  if (e.isAuthorized === !1) return "The query answered 403.";
734
734
  if (e.isValid === !1 || e.hasExceptions === !0 || e.isSuccess === !1) {
@@ -737,7 +737,7 @@ function kn(e) {
737
737
  }
738
738
  return "";
739
739
  }
740
- function An(e) {
740
+ function er(e) {
741
741
  return Array.isArray(e) ? e.filter(q) : q(e) ? [e] : [];
742
742
  }
743
743
  function K(e, t) {
@@ -752,7 +752,7 @@ function q(e) {
752
752
  return typeof e == "object" && !!e && !Array.isArray(e);
753
753
  }
754
754
  // src/stageComponentOutputs.ts
755
- function jn() {
755
+ function tr() {
756
756
  let e = u(), { publishComponentOutputs: t, withdrawComponentOutputs: n, selectRow: r, clearSelection: i } = W(), a = p({});
757
757
  l(() => () => {
758
758
  n(e), Object.keys(a.current).forEach((t) => i(`${e}:${t}`));
@@ -763,7 +763,7 @@ function jn() {
763
763
  ]);
764
764
  let o = s((n) => {
765
765
  t(e, n);
766
- let i = Mn(n), o = /* @__PURE__ */ new Set([...Object.keys(a.current), ...Object.keys(i)]);
766
+ let i = nr(n), o = /* @__PURE__ */ new Set([...Object.keys(a.current), ...Object.keys(i)]);
767
767
  for (let t of o) a.current[t] !== i[t] && r(`${e}:${t}`, i[t]);
768
768
  a.current = i;
769
769
  }, [
@@ -773,24 +773,24 @@ function jn() {
773
773
  ]);
774
774
  return Object.assign(o, { scope: e });
775
775
  }
776
- function Mn(e) {
776
+ function nr(e) {
777
777
  let t = {};
778
778
  for (let [n, r] of Object.entries(e)) {
779
779
  let e = r.selectedItem;
780
- Nn(e) && (t[n] = e);
780
+ rr(e) && (t[n] = e);
781
781
  }
782
782
  return t;
783
783
  }
784
- function Nn(e) {
784
+ function rr(e) {
785
785
  return typeof e == "object" && !!e && !Array.isArray(e);
786
786
  }
787
787
  // src/stageBoardSelection.ts
788
- var Pn = /* @__PURE__ */ new Set(["kanbanBoard", "Cratis.Blueprint.Default:kanbanBoard"]);
789
- function Fn(e) {
790
- return Pn.has(e);
788
+ var ir = /* @__PURE__ */ new Set(["kanbanBoard", "Cratis.Blueprint.Default:kanbanBoard"]);
789
+ function ar(e) {
790
+ return ir.has(e);
791
791
  }
792
- function In(e) {
793
- let t = e, n = Object.fromEntries(Object.entries(t.slots ?? {}).map(([e, t]) => [e, t.map(In)])), r = Fn(t.componentName) ? {
792
+ function or(e) {
793
+ let t = e, n = Object.fromEntries(Object.entries(t.slots ?? {}).map(([e, t]) => [e, t.map(or)])), r = ar(t.componentName) ? {
794
794
  ...t.properties,
795
795
  selectionMode: "single"
796
796
  } : t.properties;
@@ -801,39 +801,39 @@ function In(e) {
801
801
  };
802
802
  }
803
803
  // src/modelReferences.ts
804
- async function Ln(e, t = fetch) {
805
- let n = await t(ht.modelReferences, { signal: e });
804
+ async function sr(e, t = fetch) {
805
+ let n = await t(Lt.modelReferences, { signal: e });
806
806
  return n.ok ? await n.json() : void 0;
807
807
  }
808
- function Rn(e, t, n) {
808
+ function cr(e, t, n) {
809
809
  return e?.references.find((e) => e.kind === t && e.name === n)?.id;
810
810
  }
811
- function zn(e) {
811
+ function lr(e) {
812
812
  let t = {};
813
813
  for (let n of e?.references ?? []) n.name in t || (t[n.name] = n.id);
814
814
  return t;
815
815
  }
816
816
  // src/stageNotes.ts
817
- var Bn = {
817
+ var ur = {
818
818
  enabled: !1,
819
819
  modelReferences: {}
820
820
  };
821
- async function Vn(e, t = fetch) {
822
- let n = await Ln(e, t).catch(() => void 0);
821
+ async function dr(e, t = fetch) {
822
+ let n = await sr(e, t).catch(() => void 0);
823
823
  return n ? {
824
824
  enabled: n.notesEnabled === !0,
825
- modelReferences: zn(n)
826
- } : Bn;
825
+ modelReferences: lr(n)
826
+ } : ur;
827
827
  }
828
- function Hn() {
829
- let e = vt(), [t, n] = m(Bn);
828
+ function fr() {
829
+ let e = Bt(), [t, n] = m(ur);
830
830
  return l(() => {
831
831
  if (!e.notes) return;
832
832
  let t = new AbortController();
833
833
  return e.notes(t.signal).then(n).catch(() => void 0), () => t.abort();
834
834
  }, [e]), t;
835
835
  }
836
- function* Un(e, t, n) {
836
+ function* pr(e, t, n) {
837
837
  for (let r of t) {
838
838
  let t = [...n, r.name];
839
839
  for (let n of r.slices) yield {
@@ -847,44 +847,44 @@ function* Un(e, t, n) {
847
847
  n.name
848
848
  ].join(".")
849
849
  };
850
- yield* Un(e, r.features, t);
850
+ yield* pr(e, r.features, t);
851
851
  }
852
852
  }
853
- function Wn(e) {
853
+ function mr(e) {
854
854
  return (e?.modules ?? []).flatMap((e) => [...(e.slices ?? []).map((t) => ({
855
855
  module: e.name,
856
856
  feature: "",
857
857
  slice: t.name,
858
858
  command: t.command,
859
859
  qualified: `${e.name}.${t.name}`
860
- })), ...Un(e.name, e.features, [])]);
860
+ })), ...pr(e.name, e.features, [])]);
861
861
  }
862
- function Gn(e) {
863
- return Wn(e).map(({ module: e, feature: t, slice: n }) => ({
862
+ function hr(e) {
863
+ return mr(e).map(({ module: e, feature: t, slice: n }) => ({
864
864
  module: e,
865
865
  feature: t,
866
866
  slice: n
867
867
  }));
868
868
  }
869
- function Kn(e, t) {
869
+ function gr(e, t) {
870
870
  if (!t) return;
871
- let n = Wn(e).find((e) => e.qualified === t) ?? Wn(e).find((e) => e.command === t);
871
+ let n = mr(e).find((e) => e.qualified === t) ?? mr(e).find((e) => e.command === t);
872
872
  return n ? {
873
873
  module: n.module,
874
874
  feature: n.feature,
875
875
  slice: n.slice
876
876
  } : void 0;
877
877
  }
878
- function qn(e, t) {
878
+ function _r(e, t) {
879
879
  if (!t) return;
880
880
  let [n = "", ...r] = t.path ?? [], i = r.join(".");
881
881
  return {
882
882
  module: n,
883
883
  feature: i,
884
- slice: Wn(e).find((e) => e.module === n && e.feature === i && e.slice === t.name)?.slice ?? t.name
884
+ slice: mr(e).find((e) => e.module === n && e.feature === i && e.slice === t.name)?.slice ?? t.name
885
885
  };
886
886
  }
887
- function Jn(e) {
887
+ function vr(e) {
888
888
  return e ? {
889
889
  id: e.name,
890
890
  name: e.name,
@@ -892,9 +892,9 @@ function Jn(e) {
892
892
  } : void 0;
893
893
  }
894
894
  // src/stageStructure.tsx
895
- var Yn = a({ screens: [] });
896
- function Xn({ structure: e, screens: t, children: n }) {
897
- return /* @__PURE__ */ z(Yn.Provider, {
895
+ var yr = a({ screens: [] });
896
+ function br({ structure: e, screens: t, children: n }) {
897
+ return /* @__PURE__ */ V(yr.Provider, {
898
898
  value: {
899
899
  structure: e,
900
900
  screens: t
@@ -902,42 +902,42 @@ function Xn({ structure: e, screens: t, children: n }) {
902
902
  children: n
903
903
  });
904
904
  }
905
- function Zn({ screen: e, children: t }) {
906
- let { structure: n, screens: r } = c(Yn), i = qn(n, r.find((t) => t.name === e));
907
- return i ? /* @__PURE__ */ z(tt, {
905
+ function xr({ screen: e, children: t }) {
906
+ let { structure: n, screens: r } = c(yr), i = _r(n, r.find((t) => t.name === e));
907
+ return i ? /* @__PURE__ */ V(Ct, {
908
908
  module: i.module,
909
909
  feature: i.feature,
910
910
  slice: i.slice,
911
911
  children: t
912
- }) : /* @__PURE__ */ z(Qe, { children: t });
912
+ }) : /* @__PURE__ */ V(B, { children: t });
913
913
  }
914
- function Qn({ slice: e, children: t }) {
915
- let { structure: n } = c(Yn), r = Kn(n, e);
916
- return r ? /* @__PURE__ */ z(tt, {
914
+ function Sr({ slice: e, children: t }) {
915
+ let { structure: n } = c(yr), r = gr(n, e);
916
+ return r ? /* @__PURE__ */ V(Ct, {
917
917
  module: r.module,
918
918
  feature: r.feature,
919
919
  slice: r.slice,
920
920
  children: t
921
- }) : /* @__PURE__ */ z(Qe, { children: t });
921
+ }) : /* @__PURE__ */ V(B, { children: t });
922
922
  }
923
923
  // src/humanize.ts
924
- var $n = /[A-Z]+(?![a-z])|[A-Z]?[a-z]+\d*|\d+/g, er = /* @__PURE__ */ new Set([
924
+ var Cr = /[A-Z]+(?![a-z])|[A-Z]?[a-z]+\d*|\d+/g, wr = /* @__PURE__ */ new Set([
925
925
  "Screen",
926
926
  "Page",
927
927
  "Dialog"
928
928
  ]);
929
- function tr(e) {
929
+ function Tr(e) {
930
930
  return e.map((e, t) => e.length > 1 && e === e.toUpperCase() && /[A-Z]/.test(e) ? e : t === 0 ? e.charAt(0).toUpperCase() + e.slice(1) : e.toLowerCase()).join(" ");
931
931
  }
932
932
  function J(e) {
933
- let t = e.match($n);
934
- return t ? tr(t) : e;
933
+ let t = e.match(Cr);
934
+ return t ? Tr(t) : e;
935
935
  }
936
- function nr(e) {
937
- let t = e.match($n);
938
- return t ? tr(t.length > 1 && er.has(t[t.length - 1]) ? t.slice(0, -1) : t) : e;
936
+ function Er(e) {
937
+ let t = e.match(Cr);
938
+ return t ? Tr(t.length > 1 && wr.has(t[t.length - 1]) ? t.slice(0, -1) : t) : e;
939
939
  }
940
- function rr(e, t) {
940
+ function Dr(e, t) {
941
941
  switch (e.toLowerCase()) {
942
942
  case "primary": return "solid";
943
943
  case "secondary": return "outline";
@@ -946,12 +946,12 @@ function rr(e, t) {
946
946
  }
947
947
  }
948
948
  // src/stageFormSchema.ts
949
- var ir = 8;
950
- function ar(e) {
949
+ var Or = 8;
950
+ function kr(e) {
951
951
  if (!e) return !1;
952
952
  try {
953
953
  let t = JSON.parse(e);
954
- return hr(t) && t["x-creates"] === !0;
954
+ return zr(t) && t["x-creates"] === !0;
955
955
  } catch {
956
956
  return !1;
957
957
  }
@@ -959,28 +959,28 @@ function ar(e) {
959
959
  function Y(e) {
960
960
  if (!e) return [];
961
961
  try {
962
- return or(JSON.parse(e), 0);
962
+ return Ar(JSON.parse(e), 0);
963
963
  } catch {
964
964
  return [];
965
965
  }
966
966
  }
967
- function or(e, t) {
968
- 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 = hr(e.properties) ? e.properties : {};
969
- return Object.entries(i).map(([e, i]) => sr(e, i, !n || r.has(e), t));
967
+ function Ar(e, t) {
968
+ 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 = zr(e.properties) ? e.properties : {};
969
+ return Object.entries(i).map(([e, i]) => jr(e, i, !n || r.has(e), t));
970
970
  }
971
- function sr(e, t, n, r) {
972
- let i = cr(t?.["x-reference"]);
971
+ function jr(e, t, n, r) {
972
+ let i = Mr(t?.["x-reference"]);
973
973
  return {
974
974
  name: e,
975
975
  identifier: (t?.format === "uuid" || i) && typeof t?.["x-concept"] == "string" ? t["x-concept"] : void 0,
976
976
  ...i ? { reference: i } : {},
977
977
  ...t?.["x-identity"] === !0 ? { identity: !0 } : {},
978
978
  required: n,
979
- ...lr(t, r)
979
+ ...Nr(t, r)
980
980
  };
981
981
  }
982
- function cr(e) {
983
- if (!hr(e)) return;
982
+ function Mr(e) {
983
+ if (!zr(e)) return;
984
984
  let { query: t, value: n, label: r } = e;
985
985
  return typeof t == "string" && t.length > 0 && typeof n == "string" && n.length > 0 && typeof r == "string" && r.length > 0 ? {
986
986
  query: t,
@@ -988,11 +988,11 @@ function cr(e) {
988
988
  label: r
989
989
  } : void 0;
990
990
  }
991
- function lr(e, t) {
991
+ function Nr(e, t) {
992
992
  let n = e?.type;
993
993
  if (Array.isArray(n)) {
994
994
  let r = n.filter((e) => e !== "null");
995
- return r.length === 1 ? lr({
995
+ return r.length === 1 ? Nr({
996
996
  ...e,
997
997
  type: r[0]
998
998
  }, t) : { unsupportedReason: `union type ${JSON.stringify(n)}` };
@@ -1003,8 +1003,8 @@ function lr(e, t) {
1003
1003
  type: "date",
1004
1004
  withTime: e.format === "date-time"
1005
1005
  };
1006
- if (n === "array") return ur(e, t);
1007
- if (n === "object") return dr(e, t);
1006
+ if (n === "array") return Pr(e, t);
1007
+ if (n === "object") return Fr(e, t);
1008
1008
  if (n === void 0 || n === "string") {
1009
1009
  let t = Array.isArray(e?.enum) ? e.enum.filter((e) => typeof e == "string") : [];
1010
1010
  return t.length > 0 ? {
@@ -1014,78 +1014,78 @@ function lr(e, t) {
1014
1014
  }
1015
1015
  return { unsupportedReason: `type ${String(n)}` };
1016
1016
  }
1017
- function ur(e, t) {
1017
+ function Pr(e, t) {
1018
1018
  let n = { unsupportedReason: "array fields are not supported by the native Stage command form" };
1019
- if (t >= ir || e?.items === void 0) return n;
1020
- let r = sr("", e.items, !0, t + 1);
1019
+ if (t >= Or || e?.items === void 0) return n;
1020
+ let r = jr("", e.items, !0, t + 1);
1021
1021
  return r.unsupportedReason || r.item ? n : { item: r };
1022
1022
  }
1023
- function dr(e, t) {
1023
+ function Fr(e, t) {
1024
1024
  let n = { unsupportedReason: "object fields are not supported by the native Stage command form" };
1025
- if (t >= ir || !hr(e?.properties) || Object.keys(e.properties).length === 0) return n;
1026
- let r = or(e, t + 1), i = r.find((e) => e.unsupportedReason);
1025
+ if (t >= Or || !zr(e?.properties) || Object.keys(e.properties).length === 0) return n;
1026
+ let r = Ar(e, t + 1), i = r.find((e) => e.unsupportedReason);
1027
1027
  return i ? { unsupportedReason: `its member “${i.name}” is not supported: ${i.unsupportedReason}` } : { members: r };
1028
1028
  }
1029
- function fr(e, t, n) {
1029
+ function Ir(e, t, n) {
1030
1030
  if (t != null) {
1031
- if (e.members && hr(t)) for (let r of e.members) {
1031
+ if (e.members && zr(t)) for (let r of e.members) {
1032
1032
  let e = t[r.name], i = J(r.name);
1033
- if (pr(e)) {
1033
+ if (Lr(e)) {
1034
1034
  if (r.required) return `${n}: ${i} is required`;
1035
1035
  continue;
1036
1036
  }
1037
- let a = fr(r, e, `${n} ${i.toLowerCase()}`);
1037
+ let a = Ir(r, e, `${n} ${i.toLowerCase()}`);
1038
1038
  if (a) return a;
1039
1039
  }
1040
1040
  if (e.item && Array.isArray(t)) for (let [r, i] of t.entries()) {
1041
- let t = pr(i) ? `${n} ${r + 1} is required` : fr(e.item, i, `${n} ${r + 1}`);
1041
+ let t = Lr(i) ? `${n} ${r + 1} is required` : Ir(e.item, i, `${n} ${r + 1}`);
1042
1042
  if (t) return t;
1043
1043
  }
1044
1044
  }
1045
1045
  }
1046
- function pr(e) {
1046
+ function Lr(e) {
1047
1047
  return e == null || e === "";
1048
1048
  }
1049
- function mr(e, t) {
1050
- 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 && hr(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
1049
+ function Rr(e, t) {
1050
+ 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 && zr(t) ? Object.fromEntries(Object.entries(t).map(([t, n]) => {
1051
1051
  let r = e.members?.find((e) => e.name === t);
1052
- return [t, r ? mr(r, n) : n];
1053
- })) : e.item && Array.isArray(t) ? t.map((t) => mr(e.item, t)) : t;
1052
+ return [t, r ? Rr(r, n) : n];
1053
+ })) : e.item && Array.isArray(t) ? t.map((t) => Rr(e.item, t)) : t;
1054
1054
  }
1055
- function hr(e) {
1055
+ function zr(e) {
1056
1056
  return typeof e == "object" && !!e && !Array.isArray(e);
1057
1057
  }
1058
1058
  // src/stageActionSubject.ts
1059
- var gr = /^item\.(.+)$/, _r = [
1059
+ var Br = /^item\.(.+)$/, Vr = [
1060
1060
  void 0,
1061
1061
  null,
1062
1062
  ""
1063
1063
  ];
1064
- function vr(e) {
1064
+ function Hr(e) {
1065
1065
  let t = e.properties.actionSubject;
1066
1066
  return t === "item" || t === "screen" ? t : void 0;
1067
1067
  }
1068
- function yr(e, t) {
1069
- return vr(e) === void 0 && (t ? ar(t) : e.properties.createsEntity === !0);
1068
+ function Ur(e, t) {
1069
+ return Hr(e) === void 0 && (t ? kr(t) : e.properties.createsEntity === !0);
1070
1070
  }
1071
- function br(e, t) {
1071
+ function Wr(e, t) {
1072
1072
  return e === "item" && t.length === 1 ? t[0] : void 0;
1073
1073
  }
1074
- function xr(e, t) {
1074
+ function Gr(e, t) {
1075
1075
  return e === "item" && !t;
1076
1076
  }
1077
- function Sr(e, t) {
1078
- let n = vr(e), r = e.properties.subjectValues;
1077
+ function Kr(e, t) {
1078
+ let n = Hr(e), r = e.properties.subjectValues;
1079
1079
  return {
1080
1080
  ...n === "screen" ? {
1081
1081
  selectableRows: [],
1082
1082
  selectedRows: []
1083
1083
  } : t,
1084
1084
  rowAction: e.properties.rowAction === !0 || n === "item",
1085
- subjectValues: jr(r) ? r : {}
1085
+ subjectValues: ti(r) ? r : {}
1086
1086
  };
1087
1087
  }
1088
- function Cr(e, t) {
1088
+ function qr(e, t) {
1089
1089
  return {
1090
1090
  ...t === "screen" ? {} : { rowAction: !0 },
1091
1091
  ...t === void 0 ? {} : {
@@ -1094,12 +1094,12 @@ function Cr(e, t) {
1094
1094
  }
1095
1095
  };
1096
1096
  }
1097
- function wr(e, t) {
1098
- let n = Object.entries(Or(e)).map(([e, n]) => [e, Ar(t, n)]);
1099
- return Object.fromEntries(n.filter(([, e]) => !_r.includes(e)));
1097
+ function Jr(e, t) {
1098
+ let n = Object.entries(Qr(e)).map(([e, n]) => [e, ei(t, n)]);
1099
+ return Object.fromEntries(n.filter(([, e]) => !Vr.includes(e)));
1100
1100
  }
1101
- function Tr(e, t, n) {
1102
- let r = new Set(Object.keys(Or(e))), i = t.filter((e) => e.identifier !== void 0 && e.required && Object.hasOwn(n, e.name)).map((e) => e.name), a = /* @__PURE__ */ new Set([...r, ...i]), o = Er(e, t).filter((e) => !a.has(Dr(e))), s = t.length > 0 || Array.isArray(e.properties.fields) ? {
1101
+ function Yr(e, t, n) {
1102
+ let r = new Set(Object.keys(Qr(e))), i = t.filter((e) => e.identifier !== void 0 && e.required && Object.hasOwn(n, e.name)).map((e) => e.name), a = /* @__PURE__ */ new Set([...r, ...i]), o = Xr(e, t).filter((e) => !a.has(Zr(e))), s = t.length > 0 || Array.isArray(e.properties.fields) ? {
1103
1103
  fields: o,
1104
1104
  generationMode: "manual"
1105
1105
  } : {}, c = Object.fromEntries(i.map((e) => [e, n[e]]));
@@ -1110,39 +1110,39 @@ function Tr(e, t, n) {
1110
1110
  rowAction: !0,
1111
1111
  subjectValues: {
1112
1112
  ...c,
1113
- ...wr(e, n)
1113
+ ...Jr(e, n)
1114
1114
  },
1115
1115
  ...s
1116
1116
  }
1117
1117
  };
1118
1118
  }
1119
- function Er(e, t) {
1119
+ function Xr(e, t) {
1120
1120
  let n = e.properties.fields;
1121
1121
  return Array.isArray(n) ? n : t.map((e) => ({
1122
1122
  name: e.name,
1123
1123
  label: J(e.name)
1124
1124
  }));
1125
1125
  }
1126
- function Dr(e) {
1126
+ function Zr(e) {
1127
1127
  let t = e.sourceProperty || e.name;
1128
1128
  return typeof t == "string" ? t : "";
1129
1129
  }
1130
- function Or(e) {
1131
- let t = e.properties.subjectInputs, n = (jr(t) ? Object.entries(t) : []).map(([e, t]) => [e, kr(t)]);
1130
+ function Qr(e) {
1131
+ let t = e.properties.subjectInputs, n = (ti(t) ? Object.entries(t) : []).map(([e, t]) => [e, $r(t)]);
1132
1132
  return Object.fromEntries(n.filter((e) => e[1] !== void 0));
1133
1133
  }
1134
- function kr(e) {
1135
- let t = jr(e) ? e.subject : void 0;
1136
- return typeof t == "string" ? gr.exec(t)?.[1] : void 0;
1134
+ function $r(e) {
1135
+ let t = ti(e) ? e.subject : void 0;
1136
+ return typeof t == "string" ? Br.exec(t)?.[1] : void 0;
1137
1137
  }
1138
- function Ar(e, t) {
1139
- return t.split(".").reduce((e, t) => jr(e) ? e[t] : void 0, e);
1138
+ function ei(e, t) {
1139
+ return t.split(".").reduce((e, t) => ti(e) ? e[t] : void 0, e);
1140
1140
  }
1141
- function jr(e) {
1141
+ function ti(e) {
1142
1142
  return typeof e == "object" && !!e && !Array.isArray(e);
1143
1143
  }
1144
1144
  // src/StageValueFields.tsx
1145
- var Mr = it((e) => /* @__PURE__ */ z(Nr, {
1145
+ var ni = Et((e) => /* @__PURE__ */ V(ri, {
1146
1146
  descriptor: e.descriptor,
1147
1147
  label: e.title ?? J(e.descriptor.name),
1148
1148
  value: e.value,
@@ -1150,22 +1150,22 @@ var Mr = it((e) => /* @__PURE__ */ z(Nr, {
1150
1150
  onBlur: e.onBlur,
1151
1151
  invalid: e.invalid
1152
1152
  }), { defaultValue: void 0 });
1153
- function Nr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1154
- return e.members ? /* @__PURE__ */ z(Pr, {
1153
+ function ri({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1154
+ return e.members ? /* @__PURE__ */ V(ii, {
1155
1155
  descriptor: e,
1156
1156
  label: t,
1157
1157
  value: n,
1158
1158
  onChange: r,
1159
1159
  onBlur: i,
1160
1160
  invalid: a
1161
- }) : e.item ? /* @__PURE__ */ z(Fr, {
1161
+ }) : e.item ? /* @__PURE__ */ V(ai, {
1162
1162
  descriptor: e,
1163
1163
  label: t,
1164
1164
  value: n,
1165
1165
  onChange: r,
1166
1166
  onBlur: i,
1167
1167
  invalid: a
1168
- }) : /* @__PURE__ */ z(Ir, {
1168
+ }) : /* @__PURE__ */ V(oi, {
1169
1169
  descriptor: e,
1170
1170
  label: t,
1171
1171
  value: n,
@@ -1174,12 +1174,12 @@ function Nr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1174
1174
  invalid: a
1175
1175
  });
1176
1176
  }
1177
- function Pr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1178
- let o = zr(n) ? n : {};
1179
- return /* @__PURE__ */ B("fieldset", {
1177
+ function ii({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1178
+ let o = li(n) ? n : {};
1179
+ return /* @__PURE__ */ H("fieldset", {
1180
1180
  className: "stage-record-field",
1181
1181
  "data-invalid": a ? "true" : void 0,
1182
- children: [/* @__PURE__ */ z("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ z(Nr, {
1182
+ children: [/* @__PURE__ */ V("legend", { children: t }), (e.members ?? []).map((e) => /* @__PURE__ */ V(ri, {
1183
1183
  descriptor: e,
1184
1184
  label: J(e.name),
1185
1185
  value: o[e.name],
@@ -1191,74 +1191,74 @@ function Pr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1191
1191
  }, e.name))]
1192
1192
  });
1193
1193
  }
1194
- function Fr({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1194
+ function ai({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1195
1195
  let o = e.item, s = Array.isArray(n) ? n : [], c = (e) => r(e);
1196
- return /* @__PURE__ */ B("fieldset", {
1196
+ return /* @__PURE__ */ H("fieldset", {
1197
1197
  className: "stage-list-field",
1198
1198
  "data-invalid": a ? "true" : void 0,
1199
1199
  children: [
1200
- /* @__PURE__ */ z("legend", { children: t }),
1201
- s.length === 0 && /* @__PURE__ */ z("p", {
1200
+ /* @__PURE__ */ V("legend", { children: t }),
1201
+ s.length === 0 && /* @__PURE__ */ V("p", {
1202
1202
  className: "stage-note",
1203
1203
  children: "Nothing added yet."
1204
1204
  }),
1205
- s.map((e, n) => /* @__PURE__ */ B("div", {
1205
+ s.map((e, n) => /* @__PURE__ */ H("div", {
1206
1206
  className: "stage-list-field__row",
1207
- children: [/* @__PURE__ */ z(Nr, {
1207
+ children: [/* @__PURE__ */ V(ri, {
1208
1208
  descriptor: o,
1209
1209
  label: `${t} ${n + 1}`,
1210
1210
  value: e,
1211
1211
  onBlur: i,
1212
1212
  onChange: (e) => c(s.map((t, r) => r === n ? e : t))
1213
- }), /* @__PURE__ */ z("button", {
1213
+ }), /* @__PURE__ */ V("button", {
1214
1214
  type: "button",
1215
1215
  "aria-label": `Remove ${t} ${n + 1}`,
1216
1216
  onClick: () => c(s.filter((e, t) => t !== n)),
1217
1217
  children: "Remove"
1218
1218
  })]
1219
1219
  }, n)),
1220
- /* @__PURE__ */ z("button", {
1220
+ /* @__PURE__ */ V("button", {
1221
1221
  type: "button",
1222
1222
  "aria-label": `Add ${t}`,
1223
- onClick: () => c([...s, Lr(o)]),
1223
+ onClick: () => c([...s, si(o)]),
1224
1224
  children: "Add"
1225
1225
  })
1226
1226
  ]
1227
1227
  });
1228
1228
  }
1229
- function Ir({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1229
+ function oi({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid: a }) {
1230
1230
  let o = {
1231
1231
  "aria-invalid": a ? !0 : void 0,
1232
1232
  onBlur: i
1233
1233
  };
1234
- if (e.options) return /* @__PURE__ */ B("label", {
1234
+ if (e.options) return /* @__PURE__ */ H("label", {
1235
1235
  className: "stage-value-field",
1236
- children: [/* @__PURE__ */ z("span", { children: t }), /* @__PURE__ */ B("select", {
1236
+ children: [/* @__PURE__ */ V("span", { children: t }), /* @__PURE__ */ H("select", {
1237
1237
  ...o,
1238
1238
  value: typeof n == "string" ? n : "",
1239
1239
  onChange: (e) => r(e.target.value === "" ? void 0 : e.target.value),
1240
- children: [/* @__PURE__ */ z("option", {
1240
+ children: [/* @__PURE__ */ V("option", {
1241
1241
  value: "",
1242
1242
  children: ""
1243
- }), e.options.map((e) => /* @__PURE__ */ z("option", {
1243
+ }), e.options.map((e) => /* @__PURE__ */ V("option", {
1244
1244
  value: e,
1245
1245
  children: J(e)
1246
1246
  }, e))]
1247
1247
  })]
1248
1248
  });
1249
1249
  switch (e.type) {
1250
- case "boolean": return /* @__PURE__ */ B("label", {
1250
+ case "boolean": return /* @__PURE__ */ H("label", {
1251
1251
  className: "stage-value-field stage-value-field--check",
1252
- children: [/* @__PURE__ */ z("input", {
1252
+ children: [/* @__PURE__ */ V("input", {
1253
1253
  ...o,
1254
1254
  type: "checkbox",
1255
1255
  checked: n === !0,
1256
1256
  onChange: (e) => r(e.target.checked)
1257
- }), /* @__PURE__ */ z("span", { children: t })]
1257
+ }), /* @__PURE__ */ V("span", { children: t })]
1258
1258
  });
1259
- case "number": return /* @__PURE__ */ B("label", {
1259
+ case "number": return /* @__PURE__ */ H("label", {
1260
1260
  className: "stage-value-field",
1261
- children: [/* @__PURE__ */ z("span", { children: t }), /* @__PURE__ */ z("input", {
1261
+ children: [/* @__PURE__ */ V("span", { children: t }), /* @__PURE__ */ V("input", {
1262
1262
  ...o,
1263
1263
  type: "number",
1264
1264
  step: "any",
@@ -1266,18 +1266,18 @@ function Ir({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1266
1266
  onChange: (e) => r(e.target.value === "" ? void 0 : Number(e.target.value))
1267
1267
  })]
1268
1268
  });
1269
- case "date": return /* @__PURE__ */ B("label", {
1269
+ case "date": return /* @__PURE__ */ H("label", {
1270
1270
  className: "stage-value-field",
1271
- children: [/* @__PURE__ */ z("span", { children: t }), /* @__PURE__ */ z("input", {
1271
+ children: [/* @__PURE__ */ V("span", { children: t }), /* @__PURE__ */ V("input", {
1272
1272
  ...o,
1273
1273
  type: e.withTime ? "datetime-local" : "date",
1274
1274
  value: typeof n == "string" ? n.slice(0, e.withTime ? 16 : 10) : "",
1275
- onChange: (t) => r(t.target.value === "" ? void 0 : Rr(t.target.value, e.withTime === !0))
1275
+ onChange: (t) => r(t.target.value === "" ? void 0 : ci(t.target.value, e.withTime === !0))
1276
1276
  })]
1277
1277
  });
1278
- default: return /* @__PURE__ */ B("label", {
1278
+ default: return /* @__PURE__ */ H("label", {
1279
1279
  className: "stage-value-field",
1280
- children: [/* @__PURE__ */ z("span", { children: t }), /* @__PURE__ */ z("input", {
1280
+ children: [/* @__PURE__ */ V("span", { children: t }), /* @__PURE__ */ V("input", {
1281
1281
  ...o,
1282
1282
  type: "text",
1283
1283
  value: typeof n == "string" ? n : "",
@@ -1286,55 +1286,55 @@ function Ir({ descriptor: e, label: t, value: n, onChange: r, onBlur: i, invalid
1286
1286
  });
1287
1287
  }
1288
1288
  }
1289
- function Lr(e) {
1289
+ function si(e) {
1290
1290
  return e.members ? {} : void 0;
1291
1291
  }
1292
- function Rr(e, t) {
1292
+ function ci(e, t) {
1293
1293
  if (!t) return e;
1294
1294
  let n = new Date(e);
1295
1295
  return Number.isNaN(n.getTime()) ? e : n.toISOString();
1296
1296
  }
1297
- function zr(e) {
1297
+ function li(e) {
1298
1298
  return typeof e == "object" && !!e && !Array.isArray(e);
1299
1299
  }
1300
1300
  // src/stageScreenTables.tsx
1301
- function Br(e) {
1301
+ function ui(e) {
1302
1302
  let t = /* @__PURE__ */ new Set(), n = (e) => {
1303
1303
  let r = e;
1304
- if (r.componentName !== "core:outlet") {
1305
- Vr(r).forEach((e) => t.add(e));
1304
+ if (r.componentName !== "core:slot") {
1305
+ di(r).forEach((e) => t.add(e));
1306
1306
  for (let e of Object.values(r.slots ?? {})) e.forEach(n);
1307
1307
  }
1308
1308
  };
1309
1309
  return n(e), [...t];
1310
1310
  }
1311
- function Vr(e) {
1311
+ function di(e) {
1312
1312
  if (e.componentName === "core:table") return [e.id];
1313
- if (!Fn(e.componentName)) return [];
1313
+ if (!ar(e.componentName)) return [];
1314
1314
  let t = e.properties.cards, n = t?.kind === "queryResult" && typeof t.query == "string" ? [`binding:${t.query}`] : [];
1315
1315
  return [e.id, ...n];
1316
1316
  }
1317
- var Hr = a(void 0);
1318
- function Ur({ element: e, outputScope: t, children: n }) {
1319
- let r = f(() => new Set(Br(e).flatMap((e) => t ? [e, `${t}:${e}`] : [e])), [e, t]);
1320
- return /* @__PURE__ */ z(Hr.Provider, {
1317
+ var fi = a(void 0);
1318
+ function pi({ element: e, outputScope: t, children: n }) {
1319
+ let r = f(() => new Set(ui(e).flatMap((e) => t ? [e, `${t}:${e}`] : [e])), [e, t]);
1320
+ return /* @__PURE__ */ V(fi.Provider, {
1321
1321
  value: r,
1322
1322
  children: n
1323
1323
  });
1324
1324
  }
1325
- function Wr({ children: e }) {
1326
- return /* @__PURE__ */ z(Hr.Provider, {
1325
+ function mi({ children: e }) {
1326
+ return /* @__PURE__ */ V(fi.Provider, {
1327
1327
  value: void 0,
1328
1328
  children: e
1329
1329
  });
1330
1330
  }
1331
- function Gr() {
1332
- let e = c(Hr), { queries: t, selections: n } = W();
1331
+ function hi() {
1332
+ let e = c(fi), { queries: t, selections: n } = W();
1333
1333
  return f(() => {
1334
1334
  let r = e ? Object.fromEntries(Object.entries(t).filter(([t]) => e.has(t))) : t, i = e ? Object.fromEntries(Object.entries(n).filter(([t]) => e.has(t))) : n;
1335
1335
  return {
1336
- selectableRows: Ti(r),
1337
- selectedRows: Ei(i, r)
1336
+ selectableRows: Yi(r),
1337
+ selectedRows: Xi(i, r)
1338
1338
  };
1339
1339
  }, [
1340
1340
  t,
@@ -1343,7 +1343,7 @@ function Gr() {
1343
1343
  ]);
1344
1344
  }
1345
1345
  // src/StageReferenceField.tsx
1346
- function Kr(e) {
1346
+ function gi(e) {
1347
1347
  let t = u(), { routes: n, routesReady: r } = W(), i = n?.queries?.[e.reference.query], a = r && !!i, o = G({
1348
1348
  scope: t,
1349
1349
  name: e.reference.query,
@@ -1351,7 +1351,7 @@ function Kr(e) {
1351
1351
  ready: a,
1352
1352
  publish: !1
1353
1353
  }), s = typeof e.value == "string" ? e.value : "";
1354
- return !a || o.error ? /* @__PURE__ */ B(Qe, { children: [/* @__PURE__ */ z("input", {
1354
+ return !a || o.error ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("input", {
1355
1355
  id: e.id,
1356
1356
  "aria-label": e.title,
1357
1357
  "aria-invalid": e.invalid,
@@ -1360,17 +1360,17 @@ function Kr(e) {
1360
1360
  onBlur: e.onBlur,
1361
1361
  required: e.required,
1362
1362
  disabled: e.disabled
1363
- }), o.error && /* @__PURE__ */ z("span", {
1363
+ }), o.error && /* @__PURE__ */ V("span", {
1364
1364
  role: "alert",
1365
1365
  children: o.error
1366
- })] }) : /* @__PURE__ */ z(Jr, {
1366
+ })] }) : /* @__PURE__ */ V(vi, {
1367
1367
  ...e,
1368
1368
  selected: s,
1369
- choices: qr(o.rows, e.reference),
1369
+ choices: _i(o.rows, e.reference),
1370
1370
  loading: o.loading
1371
1371
  });
1372
1372
  }
1373
- function qr(e, t) {
1373
+ function _i(e, t) {
1374
1374
  return e.flatMap((e) => {
1375
1375
  let n = e[t.value];
1376
1376
  return typeof n == "string" ? [{
@@ -1379,19 +1379,19 @@ function qr(e, t) {
1379
1379
  }] : [];
1380
1380
  });
1381
1381
  }
1382
- function Jr({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a, disabled: o, selected: s, choices: c, loading: l }) {
1382
+ function vi({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a, disabled: o, selected: s, choices: c, loading: l }) {
1383
1383
  let [u, d] = m(""), f = c.filter((e) => e.key === s || e.label.toLocaleLowerCase().includes(u.toLocaleLowerCase())), p = s !== "" && !c.some((e) => e.key === s);
1384
- return /* @__PURE__ */ B("div", {
1384
+ return /* @__PURE__ */ H("div", {
1385
1385
  className: "stage-reference-field",
1386
1386
  children: [
1387
- /* @__PURE__ */ z("input", {
1387
+ /* @__PURE__ */ V("input", {
1388
1388
  type: "search",
1389
1389
  "aria-label": `Filter ${i}`,
1390
1390
  value: u,
1391
1391
  onChange: (e) => d(e.target.value),
1392
1392
  disabled: o || l
1393
1393
  }),
1394
- /* @__PURE__ */ B("select", {
1394
+ /* @__PURE__ */ H("select", {
1395
1395
  id: e,
1396
1396
  "aria-label": i,
1397
1397
  "aria-invalid": r,
@@ -1401,48 +1401,48 @@ function Jr({ id: e, onChange: t, onBlur: n, invalid: r, title: i, required: a,
1401
1401
  required: a,
1402
1402
  disabled: o || l,
1403
1403
  children: [
1404
- /* @__PURE__ */ B("option", {
1404
+ /* @__PURE__ */ H("option", {
1405
1405
  value: "",
1406
1406
  children: ["Choose ", i]
1407
1407
  }),
1408
- p && /* @__PURE__ */ z("option", {
1408
+ p && /* @__PURE__ */ V("option", {
1409
1409
  value: s,
1410
1410
  children: s
1411
1411
  }),
1412
- f.map((e) => /* @__PURE__ */ z("option", {
1412
+ f.map((e) => /* @__PURE__ */ V("option", {
1413
1413
  value: e.key,
1414
1414
  children: e.label
1415
1415
  }, e.key))
1416
1416
  ]
1417
1417
  }),
1418
- /* @__PURE__ */ z(Yr, {
1418
+ /* @__PURE__ */ V(yi, {
1419
1419
  loading: l,
1420
1420
  empty: c.length === 0
1421
1421
  })
1422
1422
  ]
1423
1423
  });
1424
1424
  }
1425
- function Yr({ loading: e, empty: t }) {
1426
- return e ? /* @__PURE__ */ z("span", {
1425
+ function yi({ loading: e, empty: t }) {
1426
+ return e ? /* @__PURE__ */ V("span", {
1427
1427
  role: "status",
1428
1428
  children: "Loading choices…"
1429
- }) : t ? /* @__PURE__ */ z("span", { children: "No choices available" }) : null;
1429
+ }) : t ? /* @__PURE__ */ V("span", { children: "No choices available" }) : null;
1430
1430
  }
1431
- function Xr(e, t, n) {
1432
- return e?.reference ? /* @__PURE__ */ z(Zr, {
1431
+ function bi(e, t, n) {
1432
+ return e?.reference ? /* @__PURE__ */ V(xi, {
1433
1433
  ...t,
1434
1434
  reference: e.reference
1435
1435
  }) : n;
1436
1436
  }
1437
- var Zr = it(Kr, { defaultValue: "" }), Qr = {
1437
+ var xi = Et(gi, { defaultValue: "" }), Si = {
1438
1438
  messages: [],
1439
1439
  complete: async (e, t) => t([], !1)
1440
1440
  };
1441
- function $r(e, t, n) {
1441
+ function Ci(e, t, n) {
1442
1442
  let r = e.properties.onSubmit;
1443
- if (!r?.length) return Qr;
1443
+ if (!r?.length) return Si;
1444
1444
  if (!n) return {
1445
- ...Qr,
1445
+ ...Si,
1446
1446
  messages: ["The form submit continuation requires an interaction scope."]
1447
1447
  };
1448
1448
  let i = t?.command ?? "", a = n.context.responseContracts ?? {
@@ -1450,29 +1450,29 @@ function $r(e, t, n) {
1450
1450
  targetType: () => void 0
1451
1451
  };
1452
1452
  return {
1453
- messages: oe({
1453
+ messages: me({
1454
1454
  kind: "form",
1455
1455
  command: i,
1456
1456
  onSubmit: r
1457
1457
  }, a).map((e) => e.message),
1458
1458
  complete: async (e, t) => {
1459
- let a = k(n.context, i, e), o = await N(r, n.dispatcher, a);
1460
- o.findings.length && n.onFindings?.(o.findings), t(o.findings.map((e) => e.detail), o.stop === E.Navigated);
1459
+ let a = P(n.context, i, e), o = await ue(r, n.dispatcher, a);
1460
+ o.findings.length && n.onFindings?.(o.findings), t(o.findings.map((e) => e.detail), o.stop === j.Navigated);
1461
1461
  }
1462
1462
  };
1463
1463
  }
1464
1464
  // src/StageCommandForm.tsx
1465
- var ei = a(void 0), ti = a(null);
1466
- function ni(e, t, n) {
1467
- return yr(e, n) ? {
1468
- ...Sr(e, {
1465
+ var wi = a(void 0), Ti = a(null);
1466
+ function Ei(e, t, n) {
1467
+ return Ur(e, n) ? {
1468
+ ...Kr(e, {
1469
1469
  selectableRows: [],
1470
1470
  selectedRows: []
1471
1471
  }),
1472
1472
  rowAction: !1
1473
- } : Sr(e, t);
1473
+ } : Kr(e, t);
1474
1474
  }
1475
- function ri(e, t) {
1475
+ function Di(e, t) {
1476
1476
  let n = X(e, "schema") || t?.commandSchemas?.[X(e, "command")];
1477
1477
  return {
1478
1478
  schemaText: n,
@@ -1480,18 +1480,18 @@ function ri(e, t) {
1480
1480
  hasSchemaMetadata: typeof n == "string"
1481
1481
  };
1482
1482
  }
1483
- function ii({ element: e, cancellable: n }) {
1484
- let r = W(), i = c(t), a = c(ei), o = c(ti), s = p(null), l = f(() => li(e), [e]), u = $r(e, l, Ce()), { schemaText: d, schema: h, hasSchemaMetadata: g } = ri(e, r.routes), _ = f(() => l ? ui(l, h) : [], [l, h]), v = l ? H(l.command, X(e, "typeName"), X(e, "route")) : void 0, y = ai(e, l), b = ji(e, _, r.resolveArgument), x = ki(e, h, r), S = JSON.stringify(x ?? null), C = f(() => x, [S]), { selectableRows: w, selectedRows: T, rowAction: E, subjectValues: D } = ni(e, Gr(), d), O = f(() => _i(h, r.parameters, T, D), [
1483
+ function Oi({ element: e, cancellable: n }) {
1484
+ let r = W(), i = c(t), a = c(wi), o = c(Ti), s = p(null), l = f(() => Ni(e), [e]), u = Ci(e, l, ze()), { schemaText: d, schema: h, hasSchemaMetadata: g } = Di(e, r.routes), _ = f(() => l ? Pi(l, h) : [], [l, h]), v = l ? on(l.command, X(e, "typeName"), X(e, "route")) : void 0, y = ki(e, l), b = ta(e, _, r.resolveArgument), x = $i(e, h, r), S = JSON.stringify(x ?? null), C = f(() => x, [S]), { selectableRows: w, selectedRows: T, rowAction: E, subjectValues: D } = Ei(e, hi(), d), O = f(() => Vi(h, r.parameters, T, D), [
1485
1485
  h,
1486
1486
  T,
1487
1487
  r.parameters,
1488
1488
  D
1489
- ]), k = f(() => vi(_, O), [_, O]), ee = f(() => ({
1489
+ ]), k = f(() => Hi(_, O), [_, O]), A = f(() => ({
1490
1490
  ...C,
1491
- ...gi(_, h, r.parameters, T, w, E),
1491
+ ...Bi(_, h, r.parameters, T, w, E),
1492
1492
  ...O,
1493
1493
  ...D,
1494
- ...hi(_, r.parameters)
1494
+ ...zi(_, r.parameters)
1495
1495
  }), [
1496
1496
  C,
1497
1497
  _,
@@ -1502,55 +1502,55 @@ function ii({ element: e, cancellable: n }) {
1502
1502
  E,
1503
1503
  O,
1504
1504
  D
1505
- ]), A = f(() => ({
1506
- ...Object.fromEntries(Object.keys(O).map((e) => [e, ee[e]])),
1505
+ ]), ee = f(() => ({
1506
+ ...Object.fromEntries(Object.keys(O).map((e) => [e, A[e]])),
1507
1507
  ...b
1508
1508
  }), [
1509
1509
  O,
1510
- ee,
1510
+ A,
1511
1511
  b
1512
- ]), te = f(() => l ? di(l, k, h) : void 0, [
1512
+ ]), te = f(() => l ? Fi(l, k, h) : void 0, [
1513
1513
  l,
1514
1514
  k,
1515
1515
  h
1516
- ]), j = f(() => l ? Hi(_, h) : [], [
1516
+ ]), j = f(() => l ? fa(_, h) : [], [
1517
1517
  l,
1518
1518
  _,
1519
1519
  h
1520
- ]), ne = f(() => l ? Ui(l.layout, _) : [], [l, _]), [re, M] = m([]);
1521
- return l ? !v && !r.routesReady ? /* @__PURE__ */ B("p", {
1520
+ ]), M = f(() => l ? pa(l.layout, _) : [], [l, _]), [N, P] = m([]);
1521
+ return l ? !v && !r.routesReady ? /* @__PURE__ */ H("p", {
1522
1522
  className: "stage-note",
1523
1523
  children: [
1524
1524
  "The modeled command “",
1525
1525
  l.command,
1526
1526
  "” is waiting for Stage routes."
1527
1527
  ]
1528
- }) : v ? _.length === 0 && !g && e.properties.parameterless !== !0 ? /* @__PURE__ */ z(ci, {
1528
+ }) : v ? _.length === 0 && !g && e.properties.parameterless !== !0 ? /* @__PURE__ */ V(Mi, {
1529
1529
  form: l,
1530
1530
  messages: [`The modeled command “${l.command}” has no form fields or schema metadata, so Stage will not submit an empty command body.`]
1531
- }) : j.length + u.messages.length > 0 ? /* @__PURE__ */ z(ci, {
1531
+ }) : j.length + u.messages.length > 0 ? /* @__PURE__ */ V(Mi, {
1532
1532
  form: l,
1533
1533
  messages: [...j, ...u.messages]
1534
- }) : /* @__PURE__ */ z("section", {
1534
+ }) : /* @__PURE__ */ V("section", {
1535
1535
  ref: s,
1536
1536
  className: "stage-command-form",
1537
1537
  "data-command": l.command,
1538
1538
  "data-generation-mode": l.generationMode,
1539
- children: /* @__PURE__ */ B(rt, {
1539
+ children: /* @__PURE__ */ H(Tt, {
1540
1540
  command: v,
1541
- initialValues: ee,
1542
- currentValues: A,
1541
+ initialValues: A,
1542
+ currentValues: ee,
1543
1543
  validateOn: "both",
1544
1544
  validateAllFieldsOnChange: !0,
1545
- onBeforeExecute: (e) => Rt(e, i.apiBasePath),
1546
- onFieldValidate: (e, t, n, r) => Vi(_, h, t, r),
1547
- onValidationFailure: (e) => M(Bi(_, e)),
1548
- onException: (e) => M(e),
1549
- onFailed: (e) => M(Bt(l.command, e).messages),
1545
+ onBeforeExecute: (e) => cn(e, i.apiBasePath),
1546
+ onFieldValidate: (e, t, n, r) => da(_, h, t, r),
1547
+ onValidationFailure: (e) => P(ua(_, e)),
1548
+ onException: (e) => P(e),
1549
+ onFailed: (e) => P(un(l.command, e).messages),
1550
1550
  onSuccess: async (t) => {
1551
1551
  r.refreshAfterCommand();
1552
1552
  let n = (t, n) => {
1553
- M(t), t.length || si(e, n, a);
1553
+ P(t), t.length || ji(e, n, a);
1554
1554
  };
1555
1555
  try {
1556
1556
  await u.complete(t, n);
@@ -1559,51 +1559,51 @@ function ii({ element: e, cancellable: n }) {
1559
1559
  }
1560
1560
  },
1561
1561
  children: [
1562
- ne.map((e) => /* @__PURE__ */ z("p", {
1562
+ M.map((e) => /* @__PURE__ */ V("p", {
1563
1563
  role: "alert",
1564
1564
  className: "stage-form-error",
1565
1565
  children: e
1566
1566
  }, e)),
1567
1567
  te,
1568
- re.map((e) => /* @__PURE__ */ z("p", {
1568
+ N.map((e) => /* @__PURE__ */ V("p", {
1569
1569
  role: "alert",
1570
1570
  className: "stage-form-error",
1571
1571
  children: e
1572
1572
  }, e)),
1573
- o ? nt(/* @__PURE__ */ z(V, {
1573
+ o ? wt(/* @__PURE__ */ V(U, {
1574
1574
  type: "button",
1575
1575
  className: "scene-slice-dialog-submit",
1576
1576
  onClick: () => s.current?.querySelector("form")?.requestSubmit(),
1577
1577
  children: y
1578
- }), o) : /* @__PURE__ */ z(oi, {
1578
+ }), o) : /* @__PURE__ */ V(Ai, {
1579
1579
  submitLabel: y,
1580
1580
  cancellable: n
1581
1581
  })
1582
1582
  ]
1583
1583
  }, S)
1584
- }) : /* @__PURE__ */ B("p", {
1584
+ }) : /* @__PURE__ */ H("p", {
1585
1585
  className: "stage-note",
1586
1586
  children: [
1587
1587
  "The modeled command “",
1588
1588
  l.command,
1589
1589
  "” is not registered by this Stage."
1590
1590
  ]
1591
- }) : /* @__PURE__ */ z("p", {
1591
+ }) : /* @__PURE__ */ V("p", {
1592
1592
  className: "stage-note",
1593
1593
  children: "This form is missing its command metadata."
1594
1594
  });
1595
1595
  }
1596
- function ai(e, t) {
1596
+ function ki(e, t) {
1597
1597
  return X(e, "submitLabel") || t?.label || "Submit";
1598
1598
  }
1599
- function oi({ submitLabel: e, cancellable: t }) {
1600
- let n = c(ei);
1601
- return /* @__PURE__ */ B("div", {
1599
+ function Ai({ submitLabel: e, cancellable: t }) {
1600
+ let n = c(wi);
1601
+ return /* @__PURE__ */ H("div", {
1602
1602
  className: "stage-command-form__actions",
1603
- children: [/* @__PURE__ */ z(V, {
1603
+ children: [/* @__PURE__ */ V(U, {
1604
1604
  type: "submit",
1605
1605
  children: e
1606
- }), t && n && /* @__PURE__ */ z(V, {
1606
+ }), t && n && /* @__PURE__ */ V(U, {
1607
1607
  type: "button",
1608
1608
  variant: "outline",
1609
1609
  onClick: n,
@@ -1611,23 +1611,23 @@ function oi({ submitLabel: e, cancellable: t }) {
1611
1611
  })]
1612
1612
  });
1613
1613
  }
1614
- function si(e, t, n) {
1614
+ function ji(e, t, n) {
1615
1615
  let r = X(e, "navigateToScreen");
1616
- r && !t && U(r, {}), n?.();
1616
+ r && !t && pn(r, {}), n?.();
1617
1617
  }
1618
- function ci({ form: e, messages: t }) {
1619
- return /* @__PURE__ */ z("section", {
1618
+ function Mi({ form: e, messages: t }) {
1619
+ return /* @__PURE__ */ V("section", {
1620
1620
  className: "stage-command-form",
1621
1621
  "data-command": e.command,
1622
1622
  "data-generation-mode": e.generationMode,
1623
- children: t.map((e) => /* @__PURE__ */ z("p", {
1623
+ children: t.map((e) => /* @__PURE__ */ V("p", {
1624
1624
  role: "alert",
1625
1625
  className: "stage-form-error",
1626
1626
  children: e
1627
1627
  }, e))
1628
1628
  });
1629
1629
  }
1630
- function li(e) {
1630
+ function Ni(e) {
1631
1631
  let t = X(e, "command");
1632
1632
  if (!t) return;
1633
1633
  let n = Array.isArray(e.properties.fields) ? e.properties.fields.filter(Z) : [];
@@ -1635,35 +1635,35 @@ function li(e) {
1635
1635
  command: t,
1636
1636
  label: X(e, "label") || J(t),
1637
1637
  fields: n,
1638
- generationMode: Ni(e.properties.generationMode),
1639
- layout: Pi(e.properties.layout)
1638
+ generationMode: ra(e.properties.generationMode),
1639
+ layout: ia(e.properties.layout)
1640
1640
  };
1641
1641
  }
1642
- function ui(e, t) {
1643
- return e.generationMode === v.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
1642
+ function Pi(e, t) {
1643
+ return e.generationMode === y.Manual || e.fields.length > 0 ? e.fields : t.filter((e) => !e.unsupportedReason).map((e) => ({
1644
1644
  name: e.name,
1645
1645
  label: J(e.name)
1646
1646
  }));
1647
1647
  }
1648
- function di(e, t, n) {
1649
- let r = e.layout, i = r ? Fi(r, t) : [];
1650
- if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => fi(e, n));
1651
- let a = new Map(t.map((e) => [e.name, e])), o = Ii(r, i), s = {
1652
- gridTemplateColumns: Array.from({ length: o }, (e, t) => Li(t + 1, r.columns)).join(" "),
1653
- columnGap: zi(r.columnGap),
1654
- rowGap: zi(r.rowGap)
1648
+ function Fi(e, t, n) {
1649
+ let r = e.layout, i = r ? aa(r, t) : [];
1650
+ if (!r || r.columns.length === 0 && i.length === 0) return t.map((e) => Ii(e, n));
1651
+ let a = new Map(t.map((e) => [e.name, e])), o = oa(r, i), s = {
1652
+ gridTemplateColumns: Array.from({ length: o }, (e, t) => sa(t + 1, r.columns)).join(" "),
1653
+ columnGap: la(r.columnGap),
1654
+ rowGap: la(r.rowGap)
1655
1655
  }, c = /* @__PURE__ */ new Set();
1656
- return /* @__PURE__ */ B("div", {
1656
+ return /* @__PURE__ */ H("div", {
1657
1657
  className: "stage-command-form__layout",
1658
1658
  style: s,
1659
1659
  children: [i.map((e) => {
1660
1660
  let t = a.get(e.field);
1661
- return t ? (c.add(t.name), fi(t, n, e)) : null;
1662
- }), t.filter((e) => !c.has(e.name)).map((e) => fi(e, n))]
1661
+ return t ? (c.add(t.name), Ii(t, n, e)) : null;
1662
+ }), t.filter((e) => !c.has(e.name)).map((e) => Ii(e, n))]
1663
1663
  });
1664
1664
  }
1665
- function fi(e, t, n) {
1666
- 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 = Xr(i, {
1665
+ function Ii(e, t, n) {
1666
+ 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 = bi(i, {
1667
1667
  value: o,
1668
1668
  fieldName: r,
1669
1669
  title: a,
@@ -1674,7 +1674,7 @@ function fi(e, t, n) {
1674
1674
  value: e,
1675
1675
  label: J(e)
1676
1676
  }));
1677
- return /* @__PURE__ */ z(ct, {
1677
+ return /* @__PURE__ */ V(At, {
1678
1678
  value: o,
1679
1679
  fieldName: r,
1680
1680
  title: a,
@@ -1684,7 +1684,7 @@ function fi(e, t, n) {
1684
1684
  optionLabel: "label"
1685
1685
  });
1686
1686
  }
1687
- if (i?.members || i?.item) return /* @__PURE__ */ z(Mr, {
1687
+ if (i?.members || i?.item) return /* @__PURE__ */ V(ni, {
1688
1688
  value: o,
1689
1689
  fieldName: r,
1690
1690
  title: a,
@@ -1692,19 +1692,19 @@ function fi(e, t, n) {
1692
1692
  descriptor: i
1693
1693
  });
1694
1694
  switch (i?.type ?? "text") {
1695
- case "number": return /* @__PURE__ */ z(ut, {
1695
+ case "number": return /* @__PURE__ */ V(Mt, {
1696
1696
  value: o,
1697
1697
  fieldName: r,
1698
1698
  title: a,
1699
1699
  required: s
1700
1700
  });
1701
- case "boolean": return /* @__PURE__ */ z(st, {
1701
+ case "boolean": return /* @__PURE__ */ V(kt, {
1702
1702
  value: o,
1703
1703
  fieldName: r,
1704
1704
  label: a,
1705
1705
  required: s
1706
1706
  });
1707
- case "date": return /* @__PURE__ */ z(pi, {
1707
+ case "date": return /* @__PURE__ */ V(Li, {
1708
1708
  value: o,
1709
1709
  fieldName: r,
1710
1710
  title: a,
@@ -1713,15 +1713,15 @@ function fi(e, t, n) {
1713
1713
  isNonModal: !0,
1714
1714
  showTime: i?.withTime
1715
1715
  });
1716
- default: return /* @__PURE__ */ z(lt, {
1716
+ default: return /* @__PURE__ */ V(jt, {
1717
1717
  value: o,
1718
1718
  fieldName: r,
1719
1719
  title: a,
1720
1720
  required: s
1721
1721
  });
1722
1722
  }
1723
- })()), l = Ri(n);
1724
- return /* @__PURE__ */ z("span", {
1723
+ })()), l = ca(n);
1724
+ return /* @__PURE__ */ V("span", {
1725
1725
  className: "stage-command-form__field",
1726
1726
  "data-field": e.name,
1727
1727
  "data-row": n?.row,
@@ -1731,21 +1731,21 @@ function fi(e, t, n) {
1731
1731
  children: c
1732
1732
  }, e.name);
1733
1733
  }
1734
- var pi = at((e) => /* @__PURE__ */ z(ot, {
1734
+ var Li = Dt((e) => /* @__PURE__ */ V(Ot, {
1735
1735
  ...e,
1736
- currentValue: e.showTime ? e.currentValue : mi(e.currentValue),
1737
- onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? Xe.fromDate(t) : t)
1736
+ currentValue: e.showTime ? e.currentValue : Ri(e.currentValue),
1737
+ onValueChange: (t) => e.onValueChange?.(!e.showTime && t instanceof Date && !Number.isNaN(t.getTime()) ? yt.fromDate(t) : t)
1738
1738
  }));
1739
- function mi(e) {
1740
- if (e instanceof Xe) return e.toDate();
1739
+ function Ri(e) {
1740
+ if (e instanceof yt) return e.toDate();
1741
1741
  if (typeof e != "string") return e;
1742
1742
  try {
1743
- return Xe.parse(e).toDate();
1743
+ return yt.parse(e).toDate();
1744
1744
  } catch {
1745
1745
  return null;
1746
1746
  }
1747
1747
  }
1748
- function hi(e, t) {
1748
+ function zi(e, t) {
1749
1749
  let n = {};
1750
1750
  for (let r of e) {
1751
1751
  let e = r.sourceProperty ?? r.name, i = t[e];
@@ -1753,47 +1753,47 @@ function hi(e, t) {
1753
1753
  }
1754
1754
  return n;
1755
1755
  }
1756
- function gi(e, t, n, r = [], i = [], a = !1) {
1756
+ function Bi(e, t, n, r = [], i = [], a = !1) {
1757
1757
  let o = new Set(e.map((e) => e.sourceProperty ?? e.name)), s = t.some((e) => e.identity), c = {};
1758
1758
  for (let e of t) {
1759
1759
  if (!e.identifier || !e.required || o.has(e.name)) continue;
1760
- if (a && Si(e, i)) {
1761
- let t = n[e.name] || xi(e, r);
1760
+ if (a && Ki(e, i)) {
1761
+ let t = n[e.name] || Gi(e, r);
1762
1762
  t && (c[e.name] = t);
1763
1763
  continue;
1764
1764
  }
1765
- let t = n[e.name] || xi(e, r) || Pt(e.identifier) || (e.identity || !s && !Si(e, i) ? Ft(e.identifier) : void 0);
1765
+ let t = n[e.name] || Gi(e, r) || nn(e.identifier) || (e.identity || !s && !Ki(e, i) ? rn(e.identifier) : void 0);
1766
1766
  t !== void 0 && (c[e.name] = t);
1767
1767
  }
1768
1768
  return c;
1769
1769
  }
1770
- function _i(e, t, n, r) {
1770
+ function Vi(e, t, n, r) {
1771
1771
  return Object.fromEntries(e.filter((e) => e.reference).flatMap((e) => {
1772
- let i = t[e.name] || r[e.name] || xi(e, n) || (yi({
1772
+ let i = t[e.name] || r[e.name] || Gi(e, n) || (Ui({
1773
1773
  ...e,
1774
1774
  required: !0
1775
- }, t) ? bi(e, t) : void 0);
1775
+ }, t) ? Wi(e, t) : void 0);
1776
1776
  return i === void 0 ? [] : [[e.name, i]];
1777
1777
  }));
1778
1778
  }
1779
- function vi(e, t) {
1779
+ function Hi(e, t) {
1780
1780
  return e.filter((e) => !Object.hasOwn(t, e.sourceProperty ?? e.name));
1781
1781
  }
1782
- function yi(e, t) {
1783
- return !e.identifier || !e.required ? !1 : e.identity === !0 || bi(e, t) !== void 0;
1782
+ function Ui(e, t) {
1783
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || Wi(e, t) !== void 0;
1784
1784
  }
1785
- function bi(e, t) {
1786
- if (e.identifier) return t[e.name] || Pt(e.identifier);
1785
+ function Wi(e, t) {
1786
+ if (e.identifier) return t[e.name] || nn(e.identifier);
1787
1787
  }
1788
- function xi(e, t) {
1788
+ function Gi(e, t) {
1789
1789
  if (!e.identifier) return;
1790
1790
  let n = new Set(t.map((t) => t[e.name]).filter((e) => typeof e == "string" && e !== ""));
1791
1791
  return n.size === 1 ? [...n][0] : void 0;
1792
1792
  }
1793
- function Si(e, t) {
1793
+ function Ki(e, t) {
1794
1794
  return t.some((t) => Object.hasOwn(t, e.name));
1795
1795
  }
1796
- function Ci(e, t) {
1796
+ function qi(e, t) {
1797
1797
  let n = e.id;
1798
1798
  if (typeof n != "string" || n === "") return e;
1799
1799
  let r = `${t.alias ?? ""} ${t.name ?? ""}`.match(/[A-Z][a-z0-9]+/g) ?? [], i = Object.fromEntries(r.map((e) => `${e.charAt(0).toLowerCase()}${e.slice(1)}Id`).filter((t) => !Object.hasOwn(e, t)).map((e) => [e, n]));
@@ -1802,25 +1802,25 @@ function Ci(e, t) {
1802
1802
  ...e
1803
1803
  };
1804
1804
  }
1805
- function wi(e) {
1806
- return Object.values(e).flatMap((e) => e.rows.map((t) => [t, Ci(t, e)]));
1805
+ function Ji(e) {
1806
+ return Object.values(e).flatMap((e) => e.rows.map((t) => [t, qi(t, e)]));
1807
1807
  }
1808
- function Ti(e) {
1809
- return wi(e).map(([, e]) => e);
1808
+ function Yi(e) {
1809
+ return Ji(e).map(([, e]) => e);
1810
1810
  }
1811
- function Ei(e, t) {
1812
- let n = new Map(wi(t));
1811
+ function Xi(e, t) {
1812
+ let n = new Map(Ji(t));
1813
1813
  return Object.values(e).filter((e) => e !== void 0).map((e) => n.get(e) ?? e);
1814
1814
  }
1815
- function Di(e, t, n, r) {
1816
- return e.filter((e) => e.identifier && e.required && Si(e, r)).filter((e) => !t[e.name] && xi(e, n) === void 0).map((e) => e.name);
1815
+ function Zi(e, t, n, r) {
1816
+ return e.filter((e) => e.identifier && e.required && Ki(e, r)).filter((e) => !t[e.name] && Gi(e, n) === void 0).map((e) => e.name);
1817
1817
  }
1818
- function Oi(e) {
1818
+ function Qi(e) {
1819
1819
  let t = e.properties.populateSource;
1820
1820
  return Z(t) ? t : void 0;
1821
1821
  }
1822
- function ki(e, t, n) {
1823
- let r = Oi(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, Ai(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), s = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), c = G({
1822
+ function $i(e, t, n) {
1823
+ let r = Qi(e), i = r?.queryName, a = Object.entries(r?.parameterBindings ?? {}).map(([e, r]) => [e, ea(e, r?.path ?? e, t, n)]), o = Object.fromEntries(a.filter(([, e]) => e !== void 0 && e !== "")), s = !!i && n.routesReady && a.every(([, e]) => e !== void 0 && e !== ""), c = G({
1824
1824
  scope: `populate:${X(e, "command")}`,
1825
1825
  name: i,
1826
1826
  route: i ? n.routes?.queries?.[i] : void 0,
@@ -1833,132 +1833,132 @@ function ki(e, t, n) {
1833
1833
  let e = {};
1834
1834
  for (let n of t) {
1835
1835
  let t = u[n.name] ?? u[n.name.charAt(0).toLowerCase() + n.name.slice(1)];
1836
- t != null && (e[n.name] = mr(n, t));
1836
+ t != null && (e[n.name] = Rr(n, t));
1837
1837
  }
1838
1838
  return Object.keys(e).length > 0 ? e : void 0;
1839
1839
  }, [u, t]);
1840
1840
  }
1841
- function Ai(e, t, n, r) {
1841
+ function ea(e, t, n, r) {
1842
1842
  let i = r.parameters[t] ?? r.parameters[e];
1843
1843
  if (i) return i;
1844
1844
  let a = n.find((n) => n.name === t || n.name === e)?.identifier;
1845
- if (a) return Ft(a);
1845
+ if (a) return rn(a);
1846
1846
  let o = r.resolveBinding({ path: t });
1847
1847
  return typeof o == "string" || typeof o == "number" ? o : void 0;
1848
1848
  }
1849
- function ji(e, t, n) {
1850
- let r = f(() => Mi(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1849
+ function ta(e, t, n) {
1850
+ let r = f(() => na(e, t), [e, t]), i = r.map((e) => n(e.source)), a = JSON.stringify(i);
1851
1851
  return f(() => {
1852
1852
  let e = Object.fromEntries(r.map((e, t) => [e.name, i[t]]).filter(([, e]) => e != null && e !== ""));
1853
1853
  return Object.keys(e).length > 0 ? e : void 0;
1854
1854
  }, [r, a]);
1855
1855
  }
1856
- function Mi(e, t) {
1856
+ function na(e, t) {
1857
1857
  let n = e.properties.arguments;
1858
1858
  if (!Array.isArray(n)) return [];
1859
1859
  let r = new Set(t.map((e) => e.sourceProperty ?? e.name));
1860
1860
  return n.filter((e) => typeof e == "object" && !!e && typeof e.name == "string" && typeof e.source == "string" && r.has(e.name));
1861
1861
  }
1862
- function Ni(e) {
1863
- return e === v.Manual ? v.Manual : v.Auto;
1862
+ function ra(e) {
1863
+ return e === y.Manual ? y.Manual : y.Auto;
1864
1864
  }
1865
- function Pi(e) {
1865
+ function ia(e) {
1866
1866
  if (!Z(e)) return;
1867
1867
  let t = e;
1868
1868
  return {
1869
- columns: Array.isArray(t.columns) ? t.columns.filter(Wi) : [],
1870
- placements: Array.isArray(t.placements) ? t.placements.filter(Gi) : [],
1871
- columnGap: Ki(t.columnGap) ? t.columnGap : void 0,
1872
- rowGap: Ki(t.rowGap) ? t.rowGap : void 0
1869
+ columns: Array.isArray(t.columns) ? t.columns.filter(ma) : [],
1870
+ placements: Array.isArray(t.placements) ? t.placements.filter(ha) : [],
1871
+ columnGap: ga(t.columnGap) ? t.columnGap : void 0,
1872
+ rowGap: ga(t.rowGap) ? t.rowGap : void 0
1873
1873
  };
1874
1874
  }
1875
- function Fi(e, t) {
1875
+ function aa(e, t) {
1876
1876
  let n = new Map(e.placements.map((e) => [e.field, e]));
1877
- for (let e of t) !n.has(e.name) && Gi(e.placement) && n.set(e.name, e.placement);
1877
+ for (let e of t) !n.has(e.name) && ha(e.placement) && n.set(e.name, e.placement);
1878
1878
  return [...n.values()].sort((e, t) => e.row - t.row || e.column - t.column || e.field.localeCompare(t.field));
1879
1879
  }
1880
- function Ii(e, t) {
1880
+ function oa(e, t) {
1881
1881
  return Math.max(1, ...e.columns.map((e) => e.index), ...t.map((e) => e.column + (e.columnSpan ?? 1) - 1));
1882
1882
  }
1883
- function Li(e, t) {
1884
- let n = t.find((t) => t.index === e), r = zi(n?.width), i = zi(n?.minWidth), a = zi(n?.maxWidth);
1885
- return n?.width?.unit === y.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
1883
+ function sa(e, t) {
1884
+ let n = t.find((t) => t.index === e), r = la(n?.width), i = la(n?.minWidth), a = la(n?.maxWidth);
1885
+ return n?.width?.unit === b.Fraction && a ? `minmax(${i ?? "0"}, ${r ?? "1fr"})` : i || a ? `minmax(${i ?? "0"}, ${a && r ? `min(${r}, ${a})` : a ?? r ?? "1fr"})` : r ?? "1fr";
1886
1886
  }
1887
- function Ri(e) {
1887
+ function ca(e) {
1888
1888
  if (e) return {
1889
1889
  gridColumn: `${e.column} / span ${e.columnSpan ?? 1}`,
1890
1890
  gridRow: `${e.row} / span ${e.rowSpan ?? 1}`,
1891
- width: e.width?.unit === y.Fraction ? void 0 : zi(e.width)
1891
+ width: e.width?.unit === b.Fraction ? void 0 : la(e.width)
1892
1892
  };
1893
1893
  }
1894
- function zi(e) {
1894
+ function la(e) {
1895
1895
  if (e) switch (e.unit) {
1896
- case y.Fraction: return `${e.value ?? 1}fr`;
1897
- case y.Pixels: return `${e.value ?? 0}px`;
1898
- case y.Percent: return `${e.value ?? 100}%`;
1899
- case y.Auto: return "auto";
1896
+ case b.Fraction: return `${e.value ?? 1}fr`;
1897
+ case b.Pixels: return `${e.value ?? 0}px`;
1898
+ case b.Percent: return `${e.value ?? 100}%`;
1899
+ case b.Auto: return "auto";
1900
1900
  }
1901
1901
  }
1902
- function Bi(e, t) {
1902
+ function ua(e, t) {
1903
1903
  let n = (e, t) => !!e.members?.some((e) => e === t || e.startsWith(`${t}.`)), r = new Set(e.map((e) => t.find((t) => n(t, e.sourceProperty ?? e.name))).filter((e) => e !== void 0));
1904
1904
  return [...new Set(t.filter((e) => !r.has(e)).map((e) => e.message))];
1905
1905
  }
1906
- function Vi(e, t, n, r) {
1906
+ function da(e, t, n, r) {
1907
1907
  let i = e.find((e) => (e.sourceProperty ?? e.name) === n), a = t.find((e) => e.name === n);
1908
- if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? fr(a, r, i?.label ?? n) : void 0;
1908
+ if (a?.required ?? !0) return r == null || r === "" ? `${i?.label ?? n} is required` : a ? Ir(a, r, i?.label ?? n) : void 0;
1909
1909
  }
1910
- function Hi(e, t) {
1910
+ function fa(e, t) {
1911
1911
  let n = new Map(t.map((e) => [e.name, e]));
1912
1912
  return e.flatMap((e) => {
1913
1913
  let t = n.get(e.sourceProperty ?? e.name);
1914
1914
  return t?.unsupportedReason ? [`The field “${e.label ?? e.name}” uses unsupported schema metadata: ${t.unsupportedReason}.`] : [];
1915
1915
  });
1916
1916
  }
1917
- function Ui(e, t) {
1917
+ function pa(e, t) {
1918
1918
  if (!e) return [];
1919
- let n = Fi(e, t).filter((e) => e.width?.unit === y.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 === y.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.`);
1919
+ let n = aa(e, t).filter((e) => e.width?.unit === b.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 === b.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.`);
1920
1920
  return [...n, ...r];
1921
1921
  }
1922
1922
  function X(e, t, n = "") {
1923
1923
  let r = e.properties[t];
1924
1924
  return typeof r == "string" ? r : n;
1925
1925
  }
1926
- function Wi(e) {
1926
+ function ma(e) {
1927
1927
  return Z(e) && typeof e.index == "number" && Number.isInteger(e.index) && e.index > 0;
1928
1928
  }
1929
- function Gi(e) {
1929
+ function ha(e) {
1930
1930
  return Z(e) && typeof e.field == "string" && typeof e.row == "number" && typeof e.column == "number" && e.row > 0 && e.column > 0;
1931
1931
  }
1932
- function Ki(e) {
1933
- return Z(e) && Object.values(y).includes(e.unit);
1932
+ function ga(e) {
1933
+ return Z(e) && Object.values(b).includes(e.unit);
1934
1934
  }
1935
1935
  function Z(e) {
1936
1936
  return typeof e == "object" && !!e && !Array.isArray(e);
1937
1937
  }
1938
1938
  // src/readableValue.ts
1939
- var qi = /^(\d{4})-(\d{2})-(\d{2})$/, Ji = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/;
1940
- function Yi(e) {
1939
+ var _a = /^(\d{4})-(\d{2})-(\d{2})$/, va = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2}(?:\.\d+)?)?(?:Z|[+-]\d{2}:?\d{2})?$/;
1940
+ function ya(e) {
1941
1941
  if (typeof e == "boolean") return e ? "Yes" : "No";
1942
- if (typeof e == "string") return Xi(e) ?? Zi(e);
1942
+ if (typeof e == "string") return ba(e) ?? xa(e);
1943
1943
  }
1944
- function Xi(e) {
1945
- let t = qi.exec(e);
1944
+ function ba(e) {
1945
+ let t = _a.exec(e);
1946
1946
  if (!t) return;
1947
1947
  let n = new Date(2e3, Number(t[2]) - 1, Number(t[3]));
1948
1948
  return n.setFullYear(Number(t[1])), Number.isNaN(n.getTime()) || n.getMonth() !== Number(t[2]) - 1 ? void 0 : n.toLocaleDateString();
1949
1949
  }
1950
- function Zi(e) {
1951
- if (!Ji.test(e)) return;
1950
+ function xa(e) {
1951
+ if (!va.test(e)) return;
1952
1952
  let t = new Date(e);
1953
1953
  return Number.isNaN(t.getTime()) ? void 0 : t.toLocaleString();
1954
1954
  }
1955
- function Qi(e) {
1956
- let t = Ce(), n = p(void 0), r = f(() => j(he(e.id, e.behaviors), S.DoubleClick), [e.behaviors, e.id]);
1955
+ function Sa(e) {
1956
+ let t = ze(), n = p(void 0), r = f(() => oe(Oe(e.id, e.behaviors), C.DoubleClick), [e.behaviors, e.id]);
1957
1957
  l(() => () => clearTimeout(n.current), []);
1958
1958
  let i = s((e) => {
1959
1959
  if (clearTimeout(n.current), n.current = void 0, !t) return;
1960
- let i = (n) => n.path?.startsWith("item.") ? M({ subject: n.path }, e) : t.context.resolve(n);
1961
- qt(r, t.dispatcher, {
1960
+ let i = (n) => n.path?.startsWith("item.") ? le({ subject: n.path }, e) : t.context.resolve(n);
1961
+ vn(r, t.dispatcher, {
1962
1962
  ...t.context,
1963
1963
  subject: () => e,
1964
1964
  resolve: i
@@ -1975,13 +1975,188 @@ function Qi(e) {
1975
1975
  doubleClick: r.length > 0 ? i : void 0
1976
1976
  };
1977
1977
  }
1978
+ // src/stageSceneRouting.ts
1979
+ var Ca = {
1980
+ routedSlots: {},
1981
+ tabSlots: {},
1982
+ filters: {},
1983
+ pageRouted: !1,
1984
+ segmentScreens: {},
1985
+ slotDefaults: {}
1986
+ };
1987
+ function wa(e) {
1988
+ let t = [...(e.layouts ?? []).flatMap((e) => e.slots ?? []), ...(e.screenTemplates ?? []).flatMap((e) => e.slots ?? [])], n = {};
1989
+ for (let e of t) e.role !== A.Panel && (e.routed || (e.routedBy?.length ?? 0) > 0) && (n[e.name] = e.routedBy ?? []);
1990
+ let r = [
1991
+ ...(e.layouts ?? []).flatMap((e) => e.outlets ?? []),
1992
+ ...(e.screenTemplates ?? []).flatMap((e) => e.outlets ?? []),
1993
+ ...(e.outletLevels ?? []).flatMap((e) => e.outlets ?? [])
1994
+ ], i = {};
1995
+ for (let e of r) e.kind === D.Tabs && e.slot && n[e.slot] && (i[e.name] = e.slot);
1996
+ let a = [
1997
+ ...r.flatMap((e) => e.defaults ?? []),
1998
+ ...(e.outletLevels ?? []).flatMap((e) => [...(e.refinements ?? []).flatMap((e) => e.items ?? []), ...(e.contributions ?? []).flatMap((e) => e.items ?? [])]),
1999
+ ...(e.screens ?? []).flatMap((e) => (e.outletContributions ?? []).flatMap((e) => e.items ?? []))
2000
+ ], o = {};
2001
+ for (let e of Ta(a)) e.kind === E.Filter && (o[e.sets?.parameter ?? e.id] = e.sets?.query);
2002
+ let s = {}, c = {};
2003
+ for (let t of e.screens ?? []) {
2004
+ s[fe(t.name)] = t.name;
2005
+ for (let e of Object.values(t.slotContent ?? {}).flat().flatMap(Ea)) {
2006
+ let t = e.properties ?? {};
2007
+ e.componentName === "core:slot" && typeof t.shows == "string" && typeof t.name == "string" && (c[t.name] = t.shows);
2008
+ }
2009
+ }
2010
+ return {
2011
+ routedSlots: n,
2012
+ tabSlots: i,
2013
+ filters: o,
2014
+ pageRouted: t.some((e) => e.role === A.Page && (e.routed === !0 || (e.routedBy?.length ?? 0) > 0)),
2015
+ segmentScreens: s,
2016
+ slotDefaults: c
2017
+ };
2018
+ }
2019
+ function Ta(e) {
2020
+ return e.flatMap((e) => e.kind === E.Group ? [e, ...Ta(e.items ?? [])] : [e]);
2021
+ }
2022
+ function Ea(e) {
2023
+ let t = e.slots ?? {};
2024
+ return [e, ...Object.values(t).flat().flatMap(Ea)];
2025
+ }
2026
+ var Da = "@";
2027
+ function Oa(e, t) {
2028
+ let n = e.indexOf("?"), r = n < 0 ? e : e.slice(0, n), i = n < 0 ? "" : e.slice(n + 1), a = r.split("/").filter((e) => e.length > 0), o = a.findIndex((e) => e.startsWith(Da)), s = (o < 0 ? a : a.slice(0, o)).join("/"), c = {}, l = {};
2029
+ for (let e = o; e >= 0 && e < a.length;) {
2030
+ let n = e + 1;
2031
+ for (; n < a.length && !a[n].startsWith(Da);) n++;
2032
+ let r = decodeURIComponent(a[e].slice(1)), i = a.slice(e + 1, n).join("/"), o = r.indexOf(".");
2033
+ if (o > 0) i && (l[r.slice(o + 1)] = decodeURIComponent(i));
2034
+ else if (t.routedSlots[r]) {
2035
+ let e = Ie(i, t.routedSlots[r]), n = (e.segment ? t.segmentScreens[e.segment] : void 0) ?? t.slotDefaults[r];
2036
+ c[r] = n ? {
2037
+ ...e,
2038
+ screen: n
2039
+ } : e;
2040
+ }
2041
+ e = n;
2042
+ }
2043
+ let u = new URLSearchParams(), d = {};
2044
+ for (let [e, n] of new URLSearchParams(i)) t.pageRouted && e in t.filters ? n !== "" && (d[e] = n) : u.append(e, n);
2045
+ let f = u.toString();
2046
+ return {
2047
+ scene: s ? f ? `${s}?${f}` : s : void 0,
2048
+ route: {
2049
+ slots: c,
2050
+ tabs: l,
2051
+ query: d
2052
+ }
2053
+ };
2054
+ }
2055
+ function ka(e, t, n) {
2056
+ let r = e ?? "", i = r.indexOf("?"), a = i < 0 ? r : r.slice(0, i), o = i < 0 ? "" : r.slice(i + 1), s = a.split("/").filter((e) => e.length > 0).map(Aa);
2057
+ for (let [e, r] of Object.entries(n.routedSlots)) {
2058
+ let i = t.slots[e];
2059
+ i && s.push(`${Da}${encodeURIComponent(e)}`, ...Le(i, r).split("/").filter((e) => e.length > 0).map(Aa));
2060
+ for (let [r, i] of Object.entries(n.tabSlots)) {
2061
+ let n = t.tabs[r];
2062
+ i === e && n && s.push(`${Da}${encodeURIComponent(e)}.${encodeURIComponent(r)}`, Aa(encodeURIComponent(n)));
2063
+ }
2064
+ }
2065
+ let c = new URLSearchParams(o);
2066
+ if (n.pageRouted) for (let [e, n] of Object.entries(t.query)) n !== "" && c.set(e, n);
2067
+ let l = c.toString();
2068
+ return l ? `${s.join("/")}?${l}` : s.join("/");
2069
+ }
2070
+ function Aa(e) {
2071
+ return e.startsWith(Da) ? `%40${e.slice(1)}` : e;
2072
+ }
2073
+ var ja = "sceneNavigation";
2074
+ function Ma(e, t, n) {
2075
+ let r = () => t === "hash" ? e.location.hash.replace(/^#\/?/, "") : `${e.location.pathname}${e.location.search}`.replace(/^\//, ""), i = (n) => t === "hash" ? `${e.location.pathname}${e.location.search}#/${n}` : `/${n}`, a = () => e.history.state?.[ja], o = (e) => e === void 0 ? void 0 : Oa(e, n).scene, s = Oa(r(), n).route, c, l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = () => l.forEach((e) => e()), f = (t, r, a) => {
2076
+ let o = a ? { [ja]: a } : e.history.state, c = i(ka(r, s, n));
2077
+ t === "push" ? e.history.pushState(o, "", c) : e.history.replaceState(o, "", c);
2078
+ }, p = (e, t) => {
2079
+ e !== s && (s = e, d(), t && f(t, o(r())));
2080
+ }, m = () => {
2081
+ c = void 0;
2082
+ let e = Oa(r(), n), t = Na(s, e.route, n);
2083
+ Pa(t, s) || (s = t, d()), u.forEach((t) => t(e.scene, a()));
2084
+ }, h = !1, g = () => {
2085
+ h || (h = !0, e.addEventListener("popstate", m), t === "hash" && e.addEventListener("hashchange", m));
2086
+ }, _ = () => {
2087
+ !h || l.size > 0 || u.size > 0 || (h = !1, e.removeEventListener("popstate", m), t === "hash" && e.removeEventListener("hashchange", m));
2088
+ };
2089
+ return {
2090
+ history: {
2091
+ location: () => o(r()),
2092
+ state: a,
2093
+ push: (e) => {
2094
+ o(e.url) === o(r()) ? (e.dialog && !a()?.dialog && (c = a()), f("replace", e.url, e)) : (c = void 0, s = Pe, d(), f("push", e.url, e));
2095
+ },
2096
+ replace: (e) => f("replace", e.url, e),
2097
+ back: () => {
2098
+ let t = c;
2099
+ t ? (c = void 0, f("replace", t.url, t), u.forEach((e) => e(o(t.url), t))) : e.history.back();
2100
+ },
2101
+ listen: (e) => (u.add(e), g(), () => {
2102
+ u.delete(e), _();
2103
+ })
2104
+ },
2105
+ getState: () => s,
2106
+ subscribe: (e) => (l.add(e), g(), () => {
2107
+ l.delete(e), _();
2108
+ }),
2109
+ openInSlot: (e, t) => p(Ye(s, e, t), n.routedSlots[e] ? "push" : void 0),
2110
+ closeSlot: (e) => p(s.slots[e] ? Je(s, e) : s, n.routedSlots[e] ? "push" : void 0),
2111
+ selectTab: (e, t) => p(s.tabs[e] === t ? s : Xe(s, e, t), n.tabSlots[e] ? "push" : void 0),
2112
+ setQueryParameter: (e, t) => p((s.query[e] ?? "") === (t ?? "") ? s : qe(s, e, t), n.pageRouted ? "replace" : void 0),
2113
+ dispose: () => {
2114
+ l.clear(), u.clear(), _();
2115
+ }
2116
+ };
2117
+ }
2118
+ function Na(e, t, n) {
2119
+ let r = Object.fromEntries(Object.entries(e.slots).filter(([e]) => !n.routedSlots[e])), i = Object.fromEntries(Object.entries(e.tabs).filter(([e]) => !n.tabSlots[e]));
2120
+ return {
2121
+ slots: {
2122
+ ...r,
2123
+ ...t.slots
2124
+ },
2125
+ tabs: {
2126
+ ...i,
2127
+ ...t.tabs
2128
+ },
2129
+ query: n.pageRouted ? t.query : e.query
2130
+ };
2131
+ }
2132
+ function Pa(e, t) {
2133
+ return JSON.stringify(e) === JSON.stringify(t);
2134
+ }
2135
+ function Fa(e) {
2136
+ let t = h(e.subscribe, e.getState, e.getState);
2137
+ return f(() => ({
2138
+ state: t,
2139
+ openInSlot: e.openInSlot,
2140
+ closeSlot: e.closeSlot,
2141
+ selectTab: e.selectTab,
2142
+ setQueryParameter: e.setQueryParameter
2143
+ }), [e, t]);
2144
+ }
2145
+ var Ia = a(Ca);
2146
+ function La(e, t, n) {
2147
+ return Object.fromEntries(Object.entries(t).filter(([t, r]) => r !== "" && t in e.filters && (e.filters[t] === void 0 || e.filters[t] === n)));
2148
+ }
2149
+ function Ra(e) {
2150
+ let t = c(Ia), n = We(), r = JSON.stringify(La(t, n, e));
2151
+ return f(() => JSON.parse(r), [r]);
2152
+ }
1978
2153
  // src/stageDialogScreens.ts
1979
- var $i = "Stage:confirmDialog", ea = "ConfirmDialog";
1980
- function ta(e, t) {
2154
+ var za = "Stage:confirmDialog", Ba = "ConfirmDialog";
2155
+ function Va(e, t) {
1981
2156
  let n = new Set(t.map((e) => e.name));
1982
2157
  return e.map((t) => {
1983
- if (t.screenTemplate !== ea || n.has(ea)) return t;
1984
- let r = na(t), i = e.find((e) => e.name !== t.name)?.name, a = R(`confirm-dialog-${t.name}`, $i, {
2158
+ if (t.screenTemplate !== Ba || n.has(Ba)) return t;
2159
+ let r = Ha(t), i = e.find((e) => e.name !== t.name)?.name, a = z(`confirm-dialog-${t.name}`, za, {
1985
2160
  title: t.name,
1986
2161
  decisions: r,
1987
2162
  home: i
@@ -1994,105 +2169,105 @@ function ta(e, t) {
1994
2169
  };
1995
2170
  });
1996
2171
  }
1997
- function na(e) {
2172
+ function Ha(e) {
1998
2173
  let t = [];
1999
- for (let n of ra(Object.values(e.slotContent).flat())) {
2000
- let r = ia(n.properties.command);
2174
+ for (let n of Ua(Object.values(e.slotContent).flat())) {
2175
+ let r = Wa(n.properties.command);
2001
2176
  r && !t.some((e) => e.command === r) && t.push({
2002
2177
  command: r,
2003
- label: ia(n.properties.label),
2004
- navigateToScreen: ia(n.properties.navigateToScreen),
2005
- typeName: ia(n.properties.typeName),
2006
- route: ia(n.properties.route),
2178
+ label: Wa(n.properties.label),
2179
+ navigateToScreen: Wa(n.properties.navigateToScreen),
2180
+ typeName: Wa(n.properties.typeName),
2181
+ route: Wa(n.properties.route),
2007
2182
  form: e.forms.find((e) => e.forCommand === r)
2008
2183
  });
2009
2184
  }
2010
2185
  return t;
2011
2186
  }
2012
- function ra(e) {
2187
+ function Ua(e) {
2013
2188
  return e.flatMap((e) => {
2014
2189
  let t = e;
2015
- return t.componentName === "core:action" ? [t] : ra(Object.values(t.slots ?? {}).flat());
2190
+ return t.componentName === "core:action" ? [t] : Ua(Object.values(t.slots ?? {}).flat());
2016
2191
  });
2017
2192
  }
2018
- function ia(e) {
2193
+ function Wa(e) {
2019
2194
  return typeof e == "string" && e !== "" ? e : void 0;
2020
2195
  }
2021
2196
  // src/StageConfirmDialog.tsx
2022
- function aa({ element: e }) {
2023
- let { routes: t, parameters: n, queries: r, selections: i } = W(), [a, o] = m(), s = p(null), c = typeof e.properties.title == "string" ? e.properties.title : "", u = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], d = typeof e.properties.home == "string" ? e.properties.home : void 0, f = u.find((e) => e.command === a), h = Ei(i, r);
2024
- return l(() => s.current?.focus(), []), /* @__PURE__ */ B("section", {
2197
+ function Ga({ element: e }) {
2198
+ let { routes: t, parameters: n, queries: r, selections: i } = W(), [a, o] = m(), s = p(null), c = typeof e.properties.title == "string" ? e.properties.title : "", u = Array.isArray(e.properties.decisions) ? e.properties.decisions : [], d = typeof e.properties.home == "string" ? e.properties.home : void 0, f = u.find((e) => e.command === a), h = Xi(i, r);
2199
+ return l(() => s.current?.focus(), []), /* @__PURE__ */ H("section", {
2025
2200
  className: "scene-slice-dialog stage-confirm-dialog",
2026
2201
  role: "dialog",
2027
2202
  "aria-label": J(c),
2028
- "data-stage-component": $i,
2203
+ "data-stage-component": za,
2029
2204
  children: [
2030
- /* @__PURE__ */ z("header", {
2205
+ /* @__PURE__ */ V("header", {
2031
2206
  className: "scene-slice-dialog-header",
2032
- children: /* @__PURE__ */ z("h2", {
2207
+ children: /* @__PURE__ */ V("h2", {
2033
2208
  className: "scene-slice-dialog-title",
2034
2209
  children: J(c)
2035
2210
  })
2036
2211
  }),
2037
- /* @__PURE__ */ z("div", {
2212
+ /* @__PURE__ */ V("div", {
2038
2213
  className: "stage-confirm-dialog__decisions",
2039
- children: u.map((e, t) => /* @__PURE__ */ z("button", {
2214
+ children: u.map((e, t) => /* @__PURE__ */ V("button", {
2040
2215
  ref: t === 0 ? s : void 0,
2041
2216
  type: "button",
2042
2217
  className: t === 0 ? "scene-slice-dialog-submit stage-confirm-dialog__decision" : "scene-slice-dialog-cancel stage-confirm-dialog__decision",
2043
2218
  "data-emphasis": t === 0 ? "primary" : "secondary",
2044
2219
  "aria-pressed": e.command === a,
2045
2220
  onClick: () => o(e.command),
2046
- children: sa(e)
2221
+ children: qa(e)
2047
2222
  }, e.command))
2048
2223
  }),
2049
- f && /* @__PURE__ */ z(Wr, { children: /* @__PURE__ */ z(ii, { element: ua(f, t?.commandSchemas?.[f.command] ?? "", n, h) }, f.command) }),
2050
- /* @__PURE__ */ z("footer", {
2224
+ f && /* @__PURE__ */ V(mi, { children: /* @__PURE__ */ V(Oi, { element: Xa(f, t?.commandSchemas?.[f.command] ?? "", n, h) }, f.command) }),
2225
+ /* @__PURE__ */ V("footer", {
2051
2226
  className: "scene-slice-dialog-footer",
2052
- children: /* @__PURE__ */ z("button", {
2227
+ children: /* @__PURE__ */ V("button", {
2053
2228
  type: "button",
2054
2229
  className: "scene-slice-dialog-cancel stage-confirm-dialog__cancel",
2055
- onClick: () => oa(u, d),
2230
+ onClick: () => Ka(u, d),
2056
2231
  children: "Cancel"
2057
2232
  })
2058
2233
  })
2059
2234
  ]
2060
2235
  });
2061
2236
  }
2062
- function oa(e, t) {
2237
+ function Ka(e, t) {
2063
2238
  let n = new Set(e.map((e) => e.navigateToScreen).filter((e) => !!e)), r = n.size === 1 ? [...n][0] : t;
2064
- r && U(r, {});
2239
+ r && pn(r, {});
2065
2240
  }
2066
- function sa(e) {
2241
+ function qa(e) {
2067
2242
  return e.label ?? J(e.command);
2068
2243
  }
2069
- function ca(e, t, n) {
2070
- return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || xi(e, n) !== void 0;
2244
+ function Ja(e, t, n) {
2245
+ return !e.identifier || !e.required ? !1 : e.identity === !0 || !!t[e.name] || Gi(e, n) !== void 0;
2071
2246
  }
2072
- function la(e, t, n, r) {
2247
+ function Ya(e, t, n, r) {
2073
2248
  let i = e.form?.fields ?? [], a = i.length > 0 ? i : t.filter((e) => !e.unsupportedReason).map((e) => ({
2074
2249
  name: e.name,
2075
2250
  label: e.name
2076
- })), o = new Set(t.filter((e) => ca(e, n, r)).map((e) => e.name)), s = a.filter((e) => !o.has(e.sourceProperty ?? e.name)), c = new Set(s.map((e) => e.sourceProperty ?? e.name)), l = t.filter((e) => e.identifier && e.required && !o.has(e.name) && !c.has(e.name));
2251
+ })), o = new Set(t.filter((e) => Ja(e, n, r)).map((e) => e.name)), s = a.filter((e) => !o.has(e.sourceProperty ?? e.name)), c = new Set(s.map((e) => e.sourceProperty ?? e.name)), l = t.filter((e) => e.identifier && e.required && !o.has(e.name) && !c.has(e.name));
2077
2252
  return [...s, ...l.map((e) => ({
2078
2253
  name: e.name,
2079
2254
  label: J(e.name)
2080
2255
  }))];
2081
2256
  }
2082
- function ua(e, t, n, r) {
2083
- let i = la(e, Y(t), n, r);
2257
+ function Xa(e, t, n, r) {
2258
+ let i = Ya(e, Y(t), n, r);
2084
2259
  return {
2085
2260
  id: `confirm-${e.command}`,
2086
- componentName: $i,
2261
+ componentName: za,
2087
2262
  properties: {
2088
2263
  command: e.command,
2089
- label: sa(e),
2264
+ label: qa(e),
2090
2265
  submitLabel: "Confirm",
2091
2266
  typeName: e.typeName,
2092
2267
  route: e.route,
2093
2268
  navigateToScreen: e.navigateToScreen,
2094
2269
  schema: t || void 0,
2095
- generationMode: i.length === 0 ? v.Manual : e.form?.generationMode,
2270
+ generationMode: i.length === 0 ? y.Manual : e.form?.generationMode,
2096
2271
  layout: e.form?.layout,
2097
2272
  populateSource: e.form?.populateSource,
2098
2273
  fields: i
@@ -2100,13 +2275,13 @@ function ua(e, t, n, r) {
2100
2275
  slots: {}
2101
2276
  };
2102
2277
  }
2103
- function da(e) {
2278
+ function Za(e) {
2104
2279
  return typeof e == "object" && !!e && !Array.isArray(e);
2105
2280
  }
2106
- function fa(e, t) {
2281
+ function Qa(e, t) {
2107
2282
  if (!Array.isArray(e) || !Array.isArray(t)) return;
2108
- let n = new Map(e.filter(da).map((e) => [JSON.stringify(e.id), e.column]));
2109
- for (let e of t.filter(da)) {
2283
+ let n = new Map(e.filter(Za).map((e) => [JSON.stringify(e.id), e.column]));
2284
+ for (let e of t.filter(Za)) {
2110
2285
  let t = JSON.stringify(e.id);
2111
2286
  if (n.has(t) && n.get(t) !== e.column) return {
2112
2287
  item: {
@@ -2117,9 +2292,9 @@ function fa(e, t) {
2117
2292
  };
2118
2293
  }
2119
2294
  }
2120
- function pa(e, t, n, r) {
2295
+ function $a(e, t, n, r) {
2121
2296
  if (!Array.isArray(e)) return;
2122
- let i = e.filter(da).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
2297
+ let i = e.filter(Za).find((e) => JSON.stringify(e[n]) === JSON.stringify(t.item.id));
2123
2298
  if (i !== void 0) return {
2124
2299
  item: {
2125
2300
  ...i,
@@ -2129,12 +2304,12 @@ function pa(e, t, n, r) {
2129
2304
  previous: t.previous
2130
2305
  };
2131
2306
  }
2132
- function ma(e, t) {
2133
- let n = ee({ dataContext: { item: e.item } });
2307
+ function eo(e, t) {
2308
+ let n = ne({ dataContext: { item: e.item } });
2134
2309
  return (r) => r.path === "value" ? e.value : r.path === "previous" ? e.previous : r.path === "item" || r.path?.startsWith("item.") ? n(r) : t(r);
2135
2310
  }
2136
- function ha(e, t) {
2137
- let n = Ce(), r = W(), { element: i, rowsProperty: a, idField: o, valueField: c } = e, l = f(() => j(he(i.id, i.behaviors), S.Change), [i.behaviors, i.id]), u = p(void 0), d = p(!1), [h, g] = m(0), _ = p({
2311
+ function to(e, t) {
2312
+ let n = ze(), r = W(), { element: i, rowsProperty: a, idField: o, valueField: c } = e, l = f(() => oe(Oe(i.id, i.behaviors), C.Change), [i.behaviors, i.id]), u = p(void 0), d = p(!1), [h, g] = m(0), _ = p({
2138
2313
  scope: n,
2139
2314
  data: r,
2140
2315
  element: i,
@@ -2147,16 +2322,16 @@ function ha(e, t) {
2147
2322
  bindings: l
2148
2323
  };
2149
2324
  let v = s((e, t) => {
2150
- let { scope: n, data: r, element: i, bindings: s } = _.current, l = fa(e, t);
2325
+ let { scope: n, data: r, element: i, bindings: s } = _.current, l = Qa(e, t);
2151
2326
  if (!n || s.length === 0 || l === void 0) return;
2152
- let u = pa(i.properties[a], l, o, c);
2327
+ let u = $a(i.properties[a], l, o, c);
2153
2328
  if (u === void 0) return;
2154
2329
  let d = {
2155
2330
  ...n.context,
2156
2331
  subject: () => u.item,
2157
- resolve: ma(u, n.context.resolve)
2332
+ resolve: eo(u, n.context.resolve)
2158
2333
  }, f = !1, p = !1;
2159
- qt(s, {
2334
+ vn(s, {
2160
2335
  ...n.dispatcher,
2161
2336
  executeCommand: async (e, t) => {
2162
2337
  let r = await n.dispatcher.executeCommand(e, t);
@@ -2186,24 +2361,24 @@ function ha(e, t) {
2186
2361
  revision: h
2187
2362
  };
2188
2363
  }
2189
- function ga(e) {
2190
- let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = ha({
2364
+ function no(e) {
2365
+ let t = e.element, n = typeof t.properties.cardColumn == "string" ? t.properties.cardColumn : "column", r = to({
2191
2366
  element: t,
2192
2367
  rowsProperty: "cards",
2193
2368
  idField: typeof t.properties.cardId == "string" ? t.properties.cardId : "id",
2194
2369
  valueField: n
2195
- }, e.bindingOutputs), i = ke;
2196
- return r.declared ? /* @__PURE__ */ z(i, {
2370
+ }, e.bindingOutputs), i = Qe;
2371
+ return r.declared ? /* @__PURE__ */ V(i, {
2197
2372
  ...e,
2198
2373
  interactions: {
2199
2374
  ...e.interactions,
2200
2375
  onChange: r.onChange
2201
2376
  },
2202
2377
  bindingOutputs: r.outputs
2203
- }, r.revision) : /* @__PURE__ */ z(i, { ...e });
2378
+ }, r.revision) : /* @__PURE__ */ V(i, { ...e });
2204
2379
  }
2205
- var _a = ge(Pe, I.KanbanBoard), va = "Stage:commandForm";
2206
- function ya(e, t, n = {}) {
2380
+ var ro = ke(rt, L.KanbanBoard), io = "Stage:commandForm";
2381
+ function ao(e, t, n = {}) {
2207
2382
  return {
2208
2383
  id: e,
2209
2384
  componentName: "",
@@ -2215,19 +2390,19 @@ function Q(e, t, n = "") {
2215
2390
  let r = e.properties[t];
2216
2391
  return typeof r == "string" ? r : n;
2217
2392
  }
2218
- function ba(e, t, n) {
2393
+ function oo(e, t, n) {
2219
2394
  let r = typeof e == "number" && Number.isInteger(e) ? n && n.length === t?.length ? t?.[n.indexOf(e)] : t?.[e] : e;
2220
- return typeof r == "string" && t?.includes(r) ? J(r) : Yi(e) ?? String(e ?? "");
2395
+ return typeof r == "string" && t?.includes(r) ? J(r) : ya(e) ?? String(e ?? "");
2221
2396
  }
2222
- function xa(e, t) {
2397
+ function so(e, t) {
2223
2398
  let n = e.properties.queryArguments;
2224
- if (!Da(n)) return {
2399
+ if (!mo(n)) return {
2225
2400
  values: {},
2226
2401
  ready: !0
2227
2402
  };
2228
2403
  let r = {}, i = !0;
2229
2404
  for (let [e, a] of Object.entries(n)) {
2230
- let n = Ea(a) ? t.resolveBinding(a) : a;
2405
+ let n = po(a) ? t.resolveBinding(a) : a;
2231
2406
  r[e] = n, (n == null || n === "") && (i = !1);
2232
2407
  }
2233
2408
  return {
@@ -2235,7 +2410,7 @@ function xa(e, t) {
2235
2410
  ready: i
2236
2411
  };
2237
2412
  }
2238
- function Sa(e, t) {
2413
+ function co(e, t) {
2239
2414
  let n = (e.slots.columns ?? []).map((e) => {
2240
2415
  let t = e.properties;
2241
2416
  return {
@@ -2250,60 +2425,73 @@ function Sa(e, t) {
2250
2425
  }));
2251
2426
  return n.length > 0 ? n : r;
2252
2427
  }
2253
- function Ca(e, t) {
2428
+ function lo(e, t) {
2254
2429
  return e[t] ?? e.id ?? e.key;
2255
2430
  }
2256
- function wa({ element: e, slots: t }) {
2257
- let n = W(), r = Q(e, "query", Q(e, "typeName", e.id)), i = (Q(e, "query") ? n.routes?.queries?.[Q(e, "query")] : void 0) ?? Q(e, "route"), a = f(() => xa(e, n), [n, e]), { rows: o, error: s, loading: c, awaitingCommand: u } = G({
2431
+ function uo({ element: e, slots: t }) {
2432
+ let n = W(), r = Q(e, "query", Q(e, "typeName", e.id)), i = (Q(e, "query") ? n.routes?.queries?.[Q(e, "query")] : void 0) ?? Q(e, "route"), a = Ra(Q(e, "query") || void 0), o = f(() => {
2433
+ let t = so(e, n);
2434
+ return {
2435
+ ...t,
2436
+ values: {
2437
+ ...a,
2438
+ ...t.values
2439
+ }
2440
+ };
2441
+ }, [
2442
+ n,
2443
+ e,
2444
+ a
2445
+ ]), { rows: s, error: c, loading: u, awaitingCommand: d } = G({
2258
2446
  scope: e.id,
2259
2447
  name: r,
2260
2448
  route: i || void 0,
2261
- arguments: a.values,
2262
- ready: a.ready
2263
- }), d = Sa(e, o), p = Q(e, "navigateOnRowClickToScreen"), m = Q(e, "navigateOnRowClickByParameter"), h = Q(e, "dataKey") || m || "id", g = n.selections[e.id], _ = m ? n.parameters[m] : void 0, v = Qi(e);
2449
+ arguments: o.values,
2450
+ ready: o.ready
2451
+ }), p = co(e, s), m = Q(e, "navigateOnRowClickToScreen"), h = Q(e, "navigateOnRowClickByParameter"), g = Q(e, "dataKey") || h || "id", _ = n.selections[e.id], v = h ? n.parameters[h] : void 0, y = Sa(e);
2264
2452
  l(() => {
2265
- if (!g) return;
2266
- let t = Ca(g, h), r = t === void 0 ? void 0 : o.find((e) => Ca(e, h) === t);
2267
- r && r !== g ? n.selectRow(e.id, r) : !r && t !== void 0 && !c && n.clearSelection(e.id);
2453
+ if (!_) return;
2454
+ let t = lo(_, g), r = t === void 0 ? void 0 : s.find((e) => lo(e, g) === t);
2455
+ r && r !== _ ? n.selectRow(e.id, r) : !r && t !== void 0 && !u && n.clearSelection(e.id);
2268
2456
  }, [
2269
2457
  n,
2270
- h,
2458
+ g,
2271
2459
  e.id,
2272
- c,
2273
- o,
2274
- g
2460
+ u,
2461
+ s,
2462
+ _
2275
2463
  ]), l(() => {
2276
- if (!m) return;
2277
- if (_ === void 0) {
2278
- g && n.clearSelection(e.id);
2464
+ if (!h) return;
2465
+ if (v === void 0) {
2466
+ _ && n.clearSelection(e.id);
2279
2467
  return;
2280
2468
  }
2281
- if (g && String(Ca(g, h)) === _) return;
2282
- let t = o.find((e) => String(Ca(e, h)) === _);
2469
+ if (_ && String(lo(_, g)) === v) return;
2470
+ let t = s.find((e) => String(lo(e, g)) === v);
2283
2471
  t && n.selectRow(e.id, t);
2284
2472
  }, [
2285
2473
  n,
2286
- h,
2474
+ g,
2287
2475
  e.id,
2288
- _,
2289
- m,
2290
- o,
2291
- g
2476
+ v,
2477
+ h,
2478
+ s,
2479
+ _
2292
2480
  ]);
2293
- let y = (t) => {
2294
- let r = Ca(t, h);
2295
- if (m && r != null) {
2481
+ let b = (t) => {
2482
+ let r = lo(t, g);
2483
+ if (h && r != null) {
2296
2484
  let i = {
2297
- ...p && p !== n.screen ? {} : n.parameters,
2298
- [m]: String(r)
2485
+ ...m && m !== n.screen ? {} : n.parameters,
2486
+ [h]: String(r)
2299
2487
  };
2300
- p && p !== n.screen || n.selectRow(e.id, t), U(p || n.screen, i);
2488
+ m && m !== n.screen || n.selectRow(e.id, t), pn(m || n.screen, i);
2301
2489
  } else n.selectRow(e.id, t);
2302
2490
  };
2303
- return !Q(e, "query") && !i && !Ot(r) ? /* @__PURE__ */ B("section", {
2491
+ return !Q(e, "query") && !i && !Xt(r) ? /* @__PURE__ */ H("section", {
2304
2492
  className: "stage-table",
2305
2493
  "data-scene-id": e.id,
2306
- children: [/* @__PURE__ */ B("p", {
2494
+ children: [/* @__PURE__ */ H("p", {
2307
2495
  className: "stage-note",
2308
2496
  children: [
2309
2497
  "No query is exposed for ",
@@ -2311,76 +2499,76 @@ function wa({ element: e, slots: t }) {
2311
2499
  " yet."
2312
2500
  ]
2313
2501
  }), t.columns]
2314
- }) : /* @__PURE__ */ B("section", {
2502
+ }) : /* @__PURE__ */ H("section", {
2315
2503
  className: "stage-table",
2316
2504
  "data-scene-id": e.id,
2317
2505
  children: [
2318
- (c || u) && /* @__PURE__ */ z(et, {
2506
+ (u || d) && /* @__PURE__ */ V(St, {
2319
2507
  severity: "info",
2320
2508
  text: "Loading…"
2321
2509
  }),
2322
- s && /* @__PURE__ */ z(et, {
2510
+ c && /* @__PURE__ */ V(St, {
2323
2511
  severity: "error",
2324
- text: s
2512
+ text: c
2325
2513
  }),
2326
- g && /* @__PURE__ */ z(V, {
2514
+ _ && /* @__PURE__ */ V(U, {
2327
2515
  type: "button",
2328
2516
  size: "small",
2329
2517
  onClick: () => {
2330
- if (n.clearSelection(e.id), !m || n.parameters[m] === void 0) return;
2331
- let { [m]: t, ...r } = n.parameters;
2332
- U(n.screen, r);
2518
+ if (n.clearSelection(e.id), !h || n.parameters[h] === void 0) return;
2519
+ let { [h]: t, ...r } = n.parameters;
2520
+ pn(n.screen, r);
2333
2521
  },
2334
2522
  children: "Clear selection"
2335
2523
  }),
2336
- /* @__PURE__ */ B("table", {
2524
+ /* @__PURE__ */ H("table", {
2337
2525
  "aria-label": Q(e, "label", Q(e, "typeName", "Results")),
2338
- children: [/* @__PURE__ */ z("thead", { children: /* @__PURE__ */ z("tr", { children: d.map((e) => /* @__PURE__ */ z("th", {
2526
+ children: [/* @__PURE__ */ V("thead", { children: /* @__PURE__ */ V("tr", { children: p.map((e) => /* @__PURE__ */ V("th", {
2339
2527
  scope: "col",
2340
2528
  children: e.label
2341
- }, e.property)) }) }), /* @__PURE__ */ B("tbody", { children: [o.map((e, t) => /* @__PURE__ */ z("tr", {
2342
- "aria-selected": g === e,
2529
+ }, e.property)) }) }), /* @__PURE__ */ H("tbody", { children: [s.map((e, t) => /* @__PURE__ */ V("tr", {
2530
+ "aria-selected": _ === e,
2343
2531
  tabIndex: 0,
2344
- onClick: () => v.click(e, () => y(e)),
2345
- onDoubleClick: v.doubleClick ? () => v.doubleClick?.(e) : void 0,
2532
+ onClick: () => y.click(e, () => b(e)),
2533
+ onDoubleClick: y.doubleClick ? () => y.doubleClick?.(e) : void 0,
2346
2534
  onKeyDown: (t) => {
2347
- (t.key === "Enter" || t.key === " ") && (t.preventDefault(), y(e));
2535
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), b(e));
2348
2536
  },
2349
- children: d.map((t) => /* @__PURE__ */ z("td", { children: ba(e[t.property], t.options, t.optionValues) }, t.property))
2350
- }, String(Ca(e, h) ?? t))), /* @__PURE__ */ z(Ta, {
2351
- rowCount: o.length,
2352
- columnCount: d.length,
2353
- loading: c,
2354
- awaitingCommand: u
2537
+ children: p.map((t) => /* @__PURE__ */ V("td", { children: oo(e[t.property], t.options, t.optionValues) }, t.property))
2538
+ }, String(lo(e, g) ?? t))), /* @__PURE__ */ V(fo, {
2539
+ rowCount: s.length,
2540
+ columnCount: p.length,
2541
+ loading: u,
2542
+ awaitingCommand: d
2355
2543
  })] })]
2356
2544
  })
2357
2545
  ]
2358
2546
  });
2359
2547
  }
2360
- function Ta({ rowCount: e, columnCount: t, loading: n, awaitingCommand: r }) {
2361
- return e !== 0 || n || r ? null : /* @__PURE__ */ z("tr", { children: /* @__PURE__ */ z("td", {
2548
+ function fo({ rowCount: e, columnCount: t, loading: n, awaitingCommand: r }) {
2549
+ return e !== 0 || n || r ? null : /* @__PURE__ */ V("tr", { children: /* @__PURE__ */ V("td", {
2362
2550
  colSpan: Math.max(t, 1),
2363
2551
  children: "No records found"
2364
2552
  }) });
2365
2553
  }
2366
- function Ea(e) {
2367
- return Da(e) && (typeof e.path == "string" || typeof e.kind == "string");
2554
+ function po(e) {
2555
+ return mo(e) && (typeof e.path == "string" || typeof e.kind == "string");
2368
2556
  }
2369
- function Da(e) {
2557
+ function mo(e) {
2370
2558
  return typeof e == "object" && !!e && !Array.isArray(e);
2371
2559
  }
2372
- function Oa({ element: e, interactions: t, slots: n }) {
2373
- return nn(e) ? /* @__PURE__ */ z(rn, {
2560
+ function ho({ element: e, interactions: t, slots: n }) {
2561
+ return Dn(e) ? /* @__PURE__ */ V(On, {
2374
2562
  element: e,
2375
2563
  interactions: t
2376
- }) : /* @__PURE__ */ z(Ma, {
2564
+ }) : /* @__PURE__ */ V(yo, {
2377
2565
  element: e,
2378
2566
  interactions: t,
2379
2567
  slots: n
2380
2568
  });
2381
2569
  }
2382
- function ka(e) {
2383
- let { routes: t, parameters: n } = W(), r = Q(e, "schema") || t?.commandSchemas?.[Q(e, "command")], i = f(() => Y(r ?? ""), [r]), a = vr(e), o = yr(e, r), { selectableRows: s, selectedRows: c } = Gr(), l = Q(e, "generationMode").toLowerCase() !== "manual", u = Aa(e, a, o, l), d = l ? ja(e, r, i, n, a, o ? [] : s) : {};
2570
+ function go(e) {
2571
+ let { routes: t, parameters: n } = W(), r = Q(e, "schema") || t?.commandSchemas?.[Q(e, "command")], i = f(() => Y(r ?? ""), [r]), a = Hr(e), o = Ur(e, r), { selectableRows: s, selectedRows: c } = hi(), l = Q(e, "generationMode").toLowerCase() !== "manual", u = _o(e, a, o, l), d = l ? vo(e, r, i, n, a, o ? [] : s) : {};
2384
2572
  return {
2385
2573
  element: {
2386
2574
  ...e,
@@ -2397,32 +2585,32 @@ function ka(e) {
2397
2585
  selectedRows: c
2398
2586
  };
2399
2587
  }
2400
- function Aa(e, t, n, r) {
2588
+ function _o(e, t, n, r) {
2401
2589
  return n || t !== void 0 ? !1 : r || e.properties.rowAction === !0;
2402
2590
  }
2403
- function ja(e, t, n, r, i, a) {
2591
+ function vo(e, t, n, r, i, a) {
2404
2592
  let o = e.properties.fields;
2405
- if (!Array.isArray(o) || o.length === 0) return Wa(t, n, r, i, a);
2593
+ if (!Array.isArray(o) || o.length === 0) return Io(t, n, r, i, a);
2406
2594
  if (a.length === 0 || i === "screen" || i === void 0 && e.properties.rowAction !== !0 && n.filter((e) => e.identifier).length > 1) return {};
2407
- let s = new Set(n.filter((e) => Ha(e, i, a)).map((e) => e.name));
2595
+ let s = new Set(n.filter((e) => Po(e, i, a)).map((e) => e.name));
2408
2596
  return {
2409
- fields: o.filter((e) => !s.has(Fa(e))),
2597
+ fields: o.filter((e) => !s.has(So(e))),
2410
2598
  generationMode: "manual"
2411
2599
  };
2412
2600
  }
2413
- function Ma({ element: e, interactions: t }) {
2414
- let { element: n, subject: r, properties: i, selectedRows: a } = ka(e), o = Q(n, "label") || J(Q(n, "command")), s = H(Q(n, "command"), Q(n, "typeName"), Q(n, "route")), c = Na(n, r), l = br(r, a);
2415
- return s ? c.length > 0 || xr(r, l) ? /* @__PURE__ */ z(V, {
2601
+ function yo({ element: e, interactions: t }) {
2602
+ let { element: n, subject: r, properties: i, selectedRows: a } = go(e), o = Q(n, "label") || J(Q(n, "command")), s = on(Q(n, "command"), Q(n, "typeName"), Q(n, "route")), c = bo(n, r), l = Wr(r, a);
2603
+ return s ? c.length > 0 || Gr(r, l) ? /* @__PURE__ */ V(U, {
2416
2604
  type: "button",
2417
2605
  "data-scene-id": n.id,
2418
2606
  disabled: !0,
2419
2607
  title: "Select a row first",
2420
2608
  ...t,
2421
2609
  children: o
2422
- }) : /* @__PURE__ */ z(La, {
2423
- element: l ? Tr(n, i, l) : n,
2610
+ }) : /* @__PURE__ */ V(wo, {
2611
+ element: l ? Yr(n, i, l) : n,
2424
2612
  label: o
2425
- }) : /* @__PURE__ */ z(V, {
2613
+ }) : /* @__PURE__ */ V(U, {
2426
2614
  type: "button",
2427
2615
  "data-scene-id": n.id,
2428
2616
  disabled: !0,
@@ -2431,42 +2619,42 @@ function Ma({ element: e, interactions: t }) {
2431
2619
  children: o
2432
2620
  });
2433
2621
  }
2434
- function Na(e, t) {
2435
- let { parameters: n } = W(), r = Q(e, "schema"), i = e.properties.fields, a = f(() => Y(r), [r]), { selectableRows: o, selectedRows: s } = Gr(), c = Array.isArray(i) ? i : [], l = Pa(e, c) ? new Set(c.map(Fa).filter((e) => e !== "")) : void 0;
2436
- return !l || t !== void 0 || yr(e, r) ? [] : Di(a.filter((e) => !l.has(e.name)), n, s, o);
2622
+ function bo(e, t) {
2623
+ let { parameters: n } = W(), r = Q(e, "schema"), i = e.properties.fields, a = f(() => Y(r), [r]), { selectableRows: o, selectedRows: s } = hi(), c = Array.isArray(i) ? i : [], l = xo(e, c) ? new Set(c.map(So).filter((e) => e !== "")) : void 0;
2624
+ return !l || t !== void 0 || Ur(e, r) ? [] : Zi(a.filter((e) => !l.has(e.name)), n, s, o);
2437
2625
  }
2438
- function Pa(e, t) {
2626
+ function xo(e, t) {
2439
2627
  return t.length > 0 || e.properties.rowAction === !0 || Q(e, "generationMode").toLowerCase() === "manual";
2440
2628
  }
2441
- function Fa(e) {
2442
- return Da(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
2629
+ function So(e) {
2630
+ return mo(e) ? typeof e.sourceProperty == "string" && e.sourceProperty !== "" ? e.sourceProperty : typeof e.name == "string" ? e.name : "" : "";
2443
2631
  }
2444
- function Ia(e) {
2632
+ function Co(e) {
2445
2633
  let t = (e?.parentElement?.classList.contains("stage-toolbar-action") ? e.parentElement : e)?.previousElementSibling;
2446
2634
  return t?.classList.contains("stage-action") === !0 || t?.classList.contains("stage-toolbar-action") === !0;
2447
2635
  }
2448
- function La({ element: e, label: t }) {
2636
+ function wo({ element: e, label: t }) {
2449
2637
  let [n, r] = m(0), [i, a] = m(!1), [o, c] = m(!1), l = p(null);
2450
- d(() => c(Ia(l.current)));
2638
+ d(() => c(Co(l.current)));
2451
2639
  let u = s(() => {
2452
2640
  a(!1), r((e) => e + 1);
2453
- }, []), f = /* @__PURE__ */ z(ei.Provider, {
2641
+ }, []), f = /* @__PURE__ */ V(wi.Provider, {
2454
2642
  value: u,
2455
- children: /* @__PURE__ */ z(ii, {
2643
+ children: /* @__PURE__ */ V(Oi, {
2456
2644
  element: e,
2457
2645
  cancellable: !0
2458
2646
  }, n)
2459
2647
  });
2460
- return /* @__PURE__ */ B("div", {
2648
+ return /* @__PURE__ */ H("div", {
2461
2649
  className: "stage-action",
2462
2650
  "data-scene-id": e.id,
2463
2651
  ref: l,
2464
- children: [/* @__PURE__ */ z(V, {
2652
+ children: [/* @__PURE__ */ V(U, {
2465
2653
  type: "button",
2466
- variant: rr(Q(e, "emphasis"), o),
2654
+ variant: Dr(Q(e, "emphasis"), o),
2467
2655
  onClick: () => a(!0),
2468
2656
  children: t
2469
- }), /* @__PURE__ */ z($e, {
2657
+ }), /* @__PURE__ */ V(xt, {
2470
2658
  title: t,
2471
2659
  visible: i,
2472
2660
  onClose: () => a(!1),
@@ -2477,20 +2665,20 @@ function La({ element: e, label: t }) {
2477
2665
  })]
2478
2666
  });
2479
2667
  }
2480
- function Ra(e) {
2481
- let t = e.element ?? ya("slice-dialog", {}), n = we(), r = Se(n?.currentDialogParameters);
2482
- return /* @__PURE__ */ z(Qn, {
2668
+ function To(e) {
2669
+ let t = e.element ?? ao("slice-dialog", {}), n = Be(), r = Re(n?.currentDialogParameters);
2670
+ return /* @__PURE__ */ V(Sr, {
2483
2671
  slice: Q(t, "slice") || r?.slice || Q(t, "command") || r?.command,
2484
- children: /* @__PURE__ */ z(za, { ...e })
2672
+ children: /* @__PURE__ */ V(Eo, { ...e })
2485
2673
  });
2486
2674
  }
2487
- function za(e) {
2488
- let t = e.element ?? ya("slice-dialog", {}), n = we(), { routes: r, parameters: i } = W(), a = Se(n?.currentDialogParameters), o = Q(t, "command") || a?.command || Q(t, "slice") || "", c = Q(t, "title") || a?.title || J(o), l = r?.commandSchemas?.[o], u = f(() => Y(l ?? ""), [l]), { selectableRows: d, selectedRows: p } = Gr(), h = s(() => n?.closeDialog(), [n]), [g, _] = m(null), v = (e) => e.identifier && e.required && Si(e, d) && xi(e, p) !== void 0;
2489
- if (!l || !(u.some((e) => e.options || e.members || e.item) || u.some(v))) return e.element ? /* @__PURE__ */ z(se, {
2675
+ function Eo(e) {
2676
+ let t = e.element ?? ao("slice-dialog", {}), n = Be(), { routes: r, parameters: i } = W(), a = Re(n?.currentDialogParameters), o = Q(t, "command") || a?.command || Q(t, "slice") || "", c = Q(t, "title") || a?.title || J(o), l = r?.commandSchemas?.[o], u = f(() => Y(l ?? ""), [l]), { selectableRows: d, selectedRows: p } = hi(), h = s(() => n?.closeDialog(), [n]), [g, _] = m(null), v = (e) => e.identifier && e.required && Ki(e, d) && Gi(e, p) !== void 0;
2677
+ if (!l || !(u.some((e) => e.options || e.members || e.item) || u.some(v))) return e.element ? /* @__PURE__ */ V(ge, {
2490
2678
  element: e.element,
2491
2679
  slots: e.slots ?? {}
2492
- }) : /* @__PURE__ */ z(pe, {});
2493
- let y = u.filter((e) => !yi(e, i) && !v(e)), b = ya(`slice-dialog-${o}`, {
2680
+ }) : /* @__PURE__ */ V(Ee, {});
2681
+ let y = u.filter((e) => !Ui(e, i) && !v(e)), b = ao(`slice-dialog-${o}`, {
2494
2682
  command: o,
2495
2683
  label: c,
2496
2684
  schema: l,
@@ -2500,29 +2688,29 @@ function za(e) {
2500
2688
  })),
2501
2689
  generationMode: "manual"
2502
2690
  });
2503
- return /* @__PURE__ */ B("section", {
2691
+ return /* @__PURE__ */ H("section", {
2504
2692
  className: "scene-slice-dialog",
2505
2693
  "data-scene-slice-dialog": Q(t, "slice") || a?.slice,
2506
2694
  "data-scene-command": o,
2507
2695
  children: [
2508
- /* @__PURE__ */ z("header", {
2696
+ /* @__PURE__ */ V("header", {
2509
2697
  className: "scene-slice-dialog-header",
2510
- children: /* @__PURE__ */ z("h2", {
2698
+ children: /* @__PURE__ */ V("h2", {
2511
2699
  className: "scene-slice-dialog-title",
2512
2700
  children: c
2513
2701
  })
2514
2702
  }),
2515
- /* @__PURE__ */ z(ei.Provider, {
2703
+ /* @__PURE__ */ V(wi.Provider, {
2516
2704
  value: h,
2517
- children: /* @__PURE__ */ z(ti.Provider, {
2705
+ children: /* @__PURE__ */ V(Ti.Provider, {
2518
2706
  value: g,
2519
- children: /* @__PURE__ */ z(ii, { element: b })
2707
+ children: /* @__PURE__ */ V(Oi, { element: b })
2520
2708
  })
2521
2709
  }),
2522
- /* @__PURE__ */ z("footer", {
2710
+ /* @__PURE__ */ V("footer", {
2523
2711
  ref: _,
2524
2712
  className: "scene-slice-dialog-footer",
2525
- children: /* @__PURE__ */ z("button", {
2713
+ children: /* @__PURE__ */ V("button", {
2526
2714
  type: "button",
2527
2715
  className: "scene-slice-dialog-cancel",
2528
2716
  onClick: h,
@@ -2532,18 +2720,101 @@ function za(e) {
2532
2720
  ]
2533
2721
  });
2534
2722
  }
2535
- function Ba(e) {
2723
+ var Do = "core:toolbarItem";
2724
+ function Oo({ element: e }) {
2725
+ let t = {
2726
+ kind: "button",
2727
+ id: Q(e, "name", e.id),
2728
+ title: Q(e, "label", Q(e, "name", e.id)),
2729
+ ...Q(e, "slice") ? { slice: Q(e, "slice") } : {},
2730
+ ...Q(e, "icon") ? { icon: Q(e, "icon") } : {}
2731
+ }, n = Fe(e.id, {
2732
+ name: e.id,
2733
+ kind: D.Actions,
2734
+ items: [t]
2735
+ }, void 0);
2736
+ return n ? /* @__PURE__ */ V(ye, {
2737
+ outlet: n,
2738
+ elementId: e.id
2739
+ }) : null;
2740
+ }
2741
+ function ko(e) {
2742
+ let { element: t } = e, n = Ue(), r = f(() => Fe(t.id, t.properties, n), [
2743
+ n,
2744
+ t.id,
2745
+ t.properties
2746
+ ]);
2747
+ return !r || r.kind !== D.Actions || !r.items.some((e) => jo(t.id, e.item)) ? /* @__PURE__ */ V(he, { ...e }) : /* @__PURE__ */ V("div", {
2748
+ className: "stage-toolbar",
2749
+ role: "toolbar",
2750
+ "aria-label": r.name,
2751
+ "data-scene-id": t.id,
2752
+ "data-scene-outlet": r.name,
2753
+ children: Ao(r.items, (e) => jo(t.id, e.item)).map((n) => {
2754
+ let i = (e) => /* @__PURE__ */ V(ye, {
2755
+ outlet: {
2756
+ ...r,
2757
+ name: "",
2758
+ items: e
2759
+ },
2760
+ item: t.properties.item,
2761
+ elementId: `${t.id}.${e[0].item.id}`
2762
+ }, e[0].item.id);
2763
+ return n.stage ? /* @__PURE__ */ V(Mo, {
2764
+ element: n.stage,
2765
+ slots: {},
2766
+ interactions: e.interactions,
2767
+ fallback: i(n.entries)
2768
+ }, n.entries[0].item.id) : i(n.entries);
2769
+ })
2770
+ });
2771
+ }
2772
+ function Ao(e, t) {
2773
+ let n = [];
2774
+ for (let r of e) {
2775
+ let e = t(r), i = n.at(-1);
2776
+ e ? n.push({
2777
+ entries: [r],
2778
+ stage: e
2779
+ }) : i && !i.stage ? i.entries.push(r) : n.push({ entries: [r] });
2780
+ }
2781
+ return n;
2782
+ }
2783
+ function jo(e, t) {
2784
+ if (t.kind !== "button") return;
2785
+ let n = t;
2786
+ if (!(n.navigateTo || n.builtIn !== void 0 || !n.slice && !n.command) && n.opens !== T.None && n.opens !== T.Drawer && n.opens !== T.Slot) return {
2787
+ id: `${e}.${n.id}`,
2788
+ componentName: Do,
2789
+ properties: {
2790
+ name: n.id,
2791
+ kind: "Action",
2792
+ label: n.title,
2793
+ ...n.slice ? { slice: n.slice } : {},
2794
+ ...n.command ? {
2795
+ target: n.command,
2796
+ command: n.command
2797
+ } : {},
2798
+ ...n.emphasis ? { emphasis: n.emphasis } : {},
2799
+ ...n.icon ? { icon: n.icon } : {},
2800
+ ...n.confirm ? { confirm: n.confirm } : {},
2801
+ ...n.subject ? { actionSubject: n.subject } : {}
2802
+ },
2803
+ slots: {}
2804
+ };
2805
+ }
2806
+ function Mo(e) {
2536
2807
  let { element: t } = e;
2537
- return Q(t, "slice") === "" ? Q(t, "kind").toLowerCase() === "action" ? /* @__PURE__ */ z(Ua, { ...e }) : /* @__PURE__ */ z(P, { ...e }) : /* @__PURE__ */ z(Va, { ...e });
2808
+ return Q(t, "slice") === "" ? /* @__PURE__ */ V(Fo, { ...e }) : /* @__PURE__ */ V(No, { ...e });
2538
2809
  }
2539
- function Va(e) {
2540
- let { element: t } = e, { routes: n, parameters: r } = W(), i = Q(t, "slice"), a = Q(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], s = f(() => Y(o ?? ""), [o]), { selectableRows: c, selectedRows: l } = Gr();
2541
- if ((ar(o ?? "") ? [] : Di(s, r, l, c)).length === 0) return /* @__PURE__ */ z(P, { ...e });
2810
+ function No(e) {
2811
+ let { element: t } = e, { routes: n, parameters: r } = W(), i = Q(t, "slice"), a = Q(t, "command") || i.split(".").at(-1) || "", o = n?.commandSchemas?.[a], s = f(() => Y(o ?? ""), [o]), { selectableRows: c, selectedRows: l } = hi();
2812
+ if ((kr(o ?? "") ? [] : Zi(s, r, l, c)).length === 0) return /* @__PURE__ */ V(B, { children: e.fallback ?? /* @__PURE__ */ V(Oo, { element: t }) });
2542
2813
  let u = Q(t, "label", Q(t, "name", t.id));
2543
- return /* @__PURE__ */ z("span", {
2814
+ return /* @__PURE__ */ V("span", {
2544
2815
  className: "stage-toolbar-action",
2545
2816
  "data-scene-toolbar-item": Q(t, "name", t.id),
2546
- children: /* @__PURE__ */ z(V, {
2817
+ children: /* @__PURE__ */ V(U, {
2547
2818
  type: "button",
2548
2819
  "data-scene-id": t.id,
2549
2820
  disabled: !0,
@@ -2553,11 +2824,11 @@ function Va(e) {
2553
2824
  })
2554
2825
  });
2555
2826
  }
2556
- function Ha(e, t, n) {
2557
- return t !== "screen" && !!e.identifier && e.required && Si(e, n);
2827
+ function Po(e, t, n) {
2828
+ return t !== "screen" && !!e.identifier && e.required && Ki(e, n);
2558
2829
  }
2559
- function Ua(e) {
2560
- let { element: t } = e, { routes: n, parameters: r } = W(), i = Q(t, "name", t.id), a = Q(t, "target"), o = Q(t, "label", i), s = n?.commandSchemas?.[a], c = f(() => Y(s ?? ""), [s]), l = vr(t), u = f(() => l === void 0 && ar(s ?? ""), [s, l]), { selectableRows: d, selectedRows: p } = Gr(), m = u ? [] : d, h = l === void 0 && !u ? Di(c, r, p, m) : [], g = Wa(s, c, r, l, m), _ = u ? { createsEntity: !0 } : Cr(t, l), v = {
2830
+ function Fo(e) {
2831
+ let { element: t } = e, { routes: n, parameters: r } = W(), i = Q(t, "name", t.id), a = Q(t, "target"), o = Q(t, "label", i), s = n?.commandSchemas?.[a], c = f(() => Y(s ?? ""), [s]), l = Hr(t), u = f(() => l === void 0 && kr(s ?? ""), [s, l]), { selectableRows: d, selectedRows: p } = hi(), m = u ? [] : d, h = l === void 0 && !u ? Zi(c, r, p, m) : [], g = Io(s, c, r, l, m), _ = u ? { createsEntity: !0 } : qr(t, l), v = {
2561
2832
  ...t,
2562
2833
  componentName: "core:action",
2563
2834
  properties: {
@@ -2568,47 +2839,48 @@ function Ua(e) {
2568
2839
  ..._
2569
2840
  }
2570
2841
  };
2571
- return /* @__PURE__ */ z("span", {
2842
+ return /* @__PURE__ */ V("span", {
2572
2843
  className: "stage-toolbar-action",
2573
2844
  "data-scene-toolbar-item": i,
2574
- children: h.length > 0 ? /* @__PURE__ */ z(V, {
2845
+ children: h.length > 0 ? /* @__PURE__ */ V(U, {
2575
2846
  type: "button",
2576
2847
  "data-scene-id": t.id,
2577
2848
  disabled: !0,
2578
2849
  title: "Select a row first",
2579
2850
  ...e.interactions,
2580
2851
  children: o
2581
- }) : /* @__PURE__ */ z(Oa, {
2852
+ }) : /* @__PURE__ */ V(ho, {
2582
2853
  element: v,
2583
2854
  interactions: e.interactions,
2584
2855
  slots: e.slots
2585
2856
  })
2586
2857
  });
2587
2858
  }
2588
- function Wa(e, t, n, r, i) {
2859
+ function Io(e, t, n, r, i) {
2589
2860
  return e ? {
2590
2861
  schema: e,
2591
- fields: t.filter((e) => !yi(e, n) && !Ha(e, r, i)).map((e) => ({
2862
+ fields: t.filter((e) => !Ui(e, n) && !Po(e, r, i)).map((e) => ({
2592
2863
  name: e.name,
2593
2864
  label: J(e.name)
2594
2865
  })),
2595
2866
  generationMode: "manual"
2596
2867
  } : {};
2597
2868
  }
2598
- var Ga = {
2599
- ..._e,
2600
- "core:table": wa,
2601
- "core:action": Oa,
2602
- "core:guarded-action": rn,
2603
- "core:toolbarItem": Ba,
2604
- "core:sliceDialog": Ra,
2605
- [va]: ii,
2606
- [$i]: aa,
2607
- [_a]: ga
2869
+ var Lo = {
2870
+ ...Ae,
2871
+ "core:table": uo,
2872
+ "core:action": ho,
2873
+ "core:guarded-action": On,
2874
+ "core:outletItems": ko,
2875
+ [Do]: Mo,
2876
+ "core:sliceDialog": To,
2877
+ [io]: Oi,
2878
+ [za]: Ga,
2879
+ [ro]: no
2608
2880
  };
2609
2881
  // src/useStrings.ts
2610
- function Ka() {
2611
- let e = vt(), [t, n] = m([]), [r, i] = m(""), [a, o] = m({});
2882
+ function Ro() {
2883
+ let e = Bt(), [t, n] = m([]), [r, i] = m(""), [a, o] = m({});
2612
2884
  return l(() => {
2613
2885
  let t = new AbortController();
2614
2886
  return e.locales(t.signal).then((e) => {
@@ -2629,11 +2901,11 @@ function Ka() {
2629
2901
  dictionary: a
2630
2902
  };
2631
2903
  }
2632
- var qa = /* @__PURE__ */ new Set(["core:table"]);
2633
- function Ja(e) {
2634
- return Ya(e, /* @__PURE__ */ new Map(), void 0);
2904
+ var zo = /* @__PURE__ */ new Set(["core:table"]);
2905
+ function Bo(e) {
2906
+ return Vo(e, /* @__PURE__ */ new Map(), void 0);
2635
2907
  }
2636
- function Ya(e, t, n) {
2908
+ function Vo(e, t, n) {
2637
2909
  let r = e;
2638
2910
  if (!r.slots) return e;
2639
2911
  let i = !1, a = {};
@@ -2642,7 +2914,7 @@ function Ya(e, t, n) {
2642
2914
  a[e] = o.map((e) => {
2643
2915
  let t = e, n = $(t, "typeName");
2644
2916
  t.componentName === "core:data" && n && (r.set(n, t), s = t);
2645
- let a = Ya(Za(Xa(t, r), s), r, s);
2917
+ let a = Vo(Uo(Ho(t, r), s), r, s);
2646
2918
  return a !== e && (i = !0), a;
2647
2919
  });
2648
2920
  }
@@ -2651,8 +2923,8 @@ function Ya(e, t, n) {
2651
2923
  slots: a
2652
2924
  } : e;
2653
2925
  }
2654
- function Xa(e, t) {
2655
- if (!qa.has(e.componentName)) return e;
2926
+ function Ho(e, t) {
2927
+ if (!zo.has(e.componentName)) return e;
2656
2928
  let n = $(e, "typeName"), r = n ? t.get(n) : void 0;
2657
2929
  if (!r || e.properties.queryArguments !== void 0) return e;
2658
2930
  let i = $(r, "by"), a = { ...e.properties }, o = $(r, "query");
@@ -2661,7 +2933,7 @@ function Xa(e, t) {
2661
2933
  properties: a
2662
2934
  };
2663
2935
  }
2664
- function Za(e, t) {
2936
+ function Uo(e, t) {
2665
2937
  if (!["core:guarded-action", "core:action"].includes(e.componentName) || !Array.isArray(e.properties?.alternatives) || !t || e.properties.itemQuery !== void 0) return e;
2666
2938
  let n = { ...e.properties };
2667
2939
  if (t.properties?.isCollection === !0) return n.itemSelection = !0, {
@@ -2679,7 +2951,7 @@ function $(e, t) {
2679
2951
  return typeof n == "string" && n.length > 0 ? n : void 0;
2680
2952
  }
2681
2953
  // src/stageQueryBindings.tsx
2682
- function Qa(e) {
2954
+ function Wo(e) {
2683
2955
  let t = /* @__PURE__ */ new Set(), n = (e) => {
2684
2956
  if (Array.isArray(e)) {
2685
2957
  e.forEach(n);
@@ -2695,7 +2967,7 @@ function Qa(e) {
2695
2967
  };
2696
2968
  return r(e), [...t];
2697
2969
  }
2698
- function $a(e) {
2970
+ function Go(e) {
2699
2971
  let t = /* @__PURE__ */ new Map(), n = (e, t) => {
2700
2972
  let n = e.properties?.[t];
2701
2973
  return typeof n == "string" && n.length > 0 ? n : void 0;
@@ -2714,12 +2986,16 @@ function $a(e) {
2714
2986
  };
2715
2987
  return r(e), [...t.values()];
2716
2988
  }
2717
- function eo({ source: e }) {
2718
- let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = e.by ? r[e.by] || i[e.by] : void 0, o = f(() => e.by ? a ? { [e.by]: a } : {} : {
2719
- ...i,
2720
- ...r
2721
- }, [
2989
+ function Ko({ source: e }) {
2990
+ let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = e.by ? r[e.by] || i[e.by] : void 0, o = Ra(e.query), s = f(() => ({
2991
+ ...o,
2992
+ ...e.by ? a ? { [e.by]: a } : {} : {
2993
+ ...i,
2994
+ ...r
2995
+ }
2996
+ }), [
2722
2997
  a,
2998
+ o,
2723
2999
  r,
2724
3000
  i,
2725
3001
  e.by
@@ -2729,78 +3005,83 @@ function eo({ source: e }) {
2729
3005
  name: e.query,
2730
3006
  alias: e.typeName,
2731
3007
  route: t?.queries?.[e.query] ?? e.route,
2732
- arguments: o,
3008
+ arguments: s,
2733
3009
  ready: n && (!e.by || !!a),
2734
3010
  list: !0
2735
3011
  }), null;
2736
3012
  }
2737
- function to({ name: e }) {
2738
- let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = f(() => ({
3013
+ function qo({ name: e }) {
3014
+ let { routes: t, routesReady: n, parameters: r, session: i } = W(), a = Ra(e), o = f(() => ({
3015
+ ...a,
2739
3016
  ...i,
2740
3017
  ...r
2741
- }), [r, i]);
3018
+ }), [
3019
+ a,
3020
+ r,
3021
+ i
3022
+ ]);
2742
3023
  return G({
2743
3024
  scope: `binding:${e}`,
2744
3025
  name: e,
2745
3026
  route: t?.queries?.[e],
2746
- arguments: a,
3027
+ arguments: o,
2747
3028
  ready: n,
2748
3029
  list: !0
2749
3030
  }), null;
2750
3031
  }
2751
- function no({ element: e }) {
2752
- let t = f(() => Qa(e), [e]), n = f(() => $a(e), [e]);
2753
- return /* @__PURE__ */ B(Qe, { children: [t.map((e) => /* @__PURE__ */ z(to, { name: e }, e)), n.map((e) => /* @__PURE__ */ z(eo, { source: e }, e.typeName))] });
3032
+ function Jo({ element: e }) {
3033
+ let t = f(() => Wo(e), [e]), n = f(() => Go(e), [e]);
3034
+ return /* @__PURE__ */ H(B, { children: [t.map((e) => /* @__PURE__ */ V(qo, { name: e }, e)), n.map((e) => /* @__PURE__ */ V(Ko, { source: e }, e.typeName))] });
2754
3035
  }
2755
3036
  // src/stageThemeChoice.ts
2756
- var ro = "cratis.stage.theme";
2757
- function io() {
3037
+ var Yo = "cratis.stage.theme";
3038
+ function Xo() {
2758
3039
  try {
2759
3040
  return globalThis.localStorage ?? null;
2760
3041
  } catch {
2761
3042
  return null;
2762
3043
  }
2763
3044
  }
2764
- function ao() {
3045
+ function Zo() {
2765
3046
  try {
2766
- return io()?.getItem("cratis.stage.theme") || void 0;
3047
+ return Xo()?.getItem("cratis.stage.theme") || void 0;
2767
3048
  } catch {
2768
3049
  return;
2769
3050
  }
2770
3051
  }
2771
- function oo(e) {
3052
+ function Qo(e) {
2772
3053
  try {
2773
- io()?.setItem(ro, e);
3054
+ Xo()?.setItem(Yo, e);
2774
3055
  } catch {}
2775
3056
  }
2776
3057
  // src/screenTitle.ts
2777
- var so = "core:title", co = ["content", "main"];
2778
- function lo(e) {
3058
+ var $o = "core:title", es = ["content", "main"];
3059
+ function ts(e) {
2779
3060
  let t = e;
2780
- if (t.componentName !== so) return;
3061
+ if (t.componentName !== $o) return;
2781
3062
  let n = t.properties?.text;
2782
3063
  return typeof n == "string" && n.trim().length > 0 ? n : void 0;
2783
3064
  }
2784
- function uo(e) {
3065
+ function ns(e) {
2785
3066
  for (let t of e ?? []) {
2786
- let e = lo(t);
3067
+ let e = ts(t);
2787
3068
  if (e !== void 0) return e;
2788
3069
  }
2789
3070
  }
2790
- function fo(e) {
2791
- let t = e.slotContent ?? {}, n = [...co, ...Object.keys(t).filter((e) => !co.includes(e))];
3071
+ function rs(e) {
3072
+ let t = e.slotContent ?? {}, n = [...es, ...Object.keys(t).filter((e) => !es.includes(e))];
2792
3073
  for (let e of n) {
2793
- let n = uo(t[e]);
3074
+ let n = ns(t[e]);
2794
3075
  if (n !== void 0) return n;
2795
3076
  }
2796
- return nr(e.name);
3077
+ return Er(e.name);
2797
3078
  }
2798
- function po(e) {
3079
+ function is(e) {
2799
3080
  let t = /* @__PURE__ */ new Set(), n = [];
2800
3081
  for (let r of e.flatMap((e) => e.contributions ?? [])) {
2801
- let e = ho(r);
3082
+ let e = os(r);
2802
3083
  if (!e) continue;
2803
- let i = _o(e);
3084
+ let i = cs(e);
2804
3085
  t.has(i) || (t.add(i), n.push(e));
2805
3086
  }
2806
3087
  return n.map((e, t) => ({
@@ -2808,47 +3089,47 @@ function po(e) {
2808
3089
  index: t
2809
3090
  })).sort((e, t) => (e.entry.order ?? 2 ** 53 - 1) - (t.entry.order ?? 2 ** 53 - 1) || e.index - t.index).map(({ entry: e }) => e);
2810
3091
  }
2811
- function mo(e) {
3092
+ function as(e) {
2812
3093
  let t = {
2813
3094
  label: "",
2814
3095
  children: []
2815
3096
  };
2816
3097
  for (let n of e) {
2817
- let e = n.hierarchy.reduce((e, t) => vo(e, t, !1), t);
2818
- (n.group ? vo(e, n.group, !0) : e).children.push(yo(n));
3098
+ let e = n.hierarchy.reduce((e, t) => ls(e, t, !1), t);
3099
+ (n.group ? ls(e, n.group, !0) : e).children.push(us(n));
2819
3100
  }
2820
3101
  return t.children;
2821
3102
  }
2822
- function ho(e) {
3103
+ function os(e) {
2823
3104
  if (e.contributionPointName !== "Navigation") return;
2824
3105
  let t = e.content?.properties ?? {}, n = t.label, r = t.targetScreen;
2825
3106
  if (typeof n != "string" || typeof r != "string") return;
2826
- let i = go(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
3107
+ let i = ss(t), a = e.order ?? (typeof t.order == "number" ? t.order : void 0), o = t.destination;
2827
3108
  return {
2828
3109
  label: n,
2829
3110
  targetScreen: r,
2830
3111
  hierarchy: i,
2831
3112
  order: a,
2832
- ...xo({
2833
- id: bo(t.id),
2834
- group: bo(t.group),
2835
- icon: bo(t.icon),
2836
- presentation: bo(t.presentation),
2837
- destination: Co(o) && wo(o) ? o : void 0
3113
+ ...fs({
3114
+ id: ds(t.id),
3115
+ group: ds(t.group),
3116
+ icon: ds(t.icon),
3117
+ presentation: ds(t.presentation),
3118
+ destination: ms(o) && hs(o) ? o : void 0
2838
3119
  })
2839
3120
  };
2840
3121
  }
2841
- function go(e) {
3122
+ function ss(e) {
2842
3123
  return Array.isArray(e.hierarchy) ? e.hierarchy.filter((e) => typeof e == "string") : [];
2843
3124
  }
2844
- function _o(e) {
3125
+ function cs(e) {
2845
3126
  return e.id === void 0 ? JSON.stringify([
2846
3127
  e.hierarchy,
2847
3128
  e.targetScreen,
2848
3129
  e.label
2849
3130
  ]) : JSON.stringify(["id", e.id]);
2850
3131
  }
2851
- function vo(e, t, n) {
3132
+ function ls(e, t, n) {
2852
3133
  let r = e.children.find((e) => e.screen === void 0 && e.section === !0 === n && e.label === t);
2853
3134
  if (r) return r;
2854
3135
  let i = n ? {
@@ -2861,12 +3142,12 @@ function vo(e, t, n) {
2861
3142
  };
2862
3143
  return e.children.push(i), i;
2863
3144
  }
2864
- function yo(e) {
3145
+ function us(e) {
2865
3146
  return {
2866
3147
  label: e.label,
2867
- ...xo({ id: e.id || void 0 }),
3148
+ ...fs({ id: e.id || void 0 }),
2868
3149
  screen: e.targetScreen,
2869
- ...xo({
3150
+ ...fs({
2870
3151
  icon: e.icon || void 0,
2871
3152
  presentation: e.presentation || void 0,
2872
3153
  destination: e.destination
@@ -2874,82 +3155,82 @@ function yo(e) {
2874
3155
  children: []
2875
3156
  };
2876
3157
  }
2877
- function bo(e) {
3158
+ function ds(e) {
2878
3159
  return typeof e == "string" ? e : void 0;
2879
3160
  }
2880
- function xo(e) {
3161
+ function fs(e) {
2881
3162
  return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0));
2882
3163
  }
2883
- function So(e, t) {
3164
+ function ps(e, t) {
2884
3165
  for (let n of e) {
2885
3166
  if (n.screen === t) return [n.label];
2886
- let e = So(n.children, t);
3167
+ let e = ps(n.children, t);
2887
3168
  if (e.length > 0) return n.section ? e : [n.label, ...e];
2888
3169
  }
2889
3170
  return [];
2890
3171
  }
2891
- function Co(e) {
3172
+ function ms(e) {
2892
3173
  return typeof e == "object" && !!e && !Array.isArray(e);
2893
3174
  }
2894
- function wo(e) {
2895
- return e.outlet !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
3175
+ function hs(e) {
3176
+ return e.slot !== void 0 || e.dialog !== void 0 || e.kind === "external" || e.kind === "dialog";
2896
3177
  }
2897
- function To(e, t, n) {
3178
+ function gs(e, t, n) {
2898
3179
  return e.filter((e) => !t.has(e.name)).map((e) => ({
2899
- label: fo(e),
3180
+ label: rs(e),
2900
3181
  targetScreen: e.name,
2901
3182
  hierarchy: e.path && e.path.length > 0 ? [...e.path] : [n]
2902
3183
  }));
2903
3184
  }
2904
3185
  // src/blueprint.ts
2905
- var Eo = "Stage:locale", Do = "Stage:themeToggle", Oo = "Stage:notes", ko = "Cratis.Components", Ao = "PrimeReact", jo = /* @__PURE__ */ new Map();
2906
- function Mo(e) {
2907
- return He(e).packages.includes(Ao);
3186
+ var _s = "Stage:locale", vs = "Stage:themeToggle", ys = "Stage:notes", bs = "Cratis.Components", xs = "PrimeReact", Ss = /* @__PURE__ */ new Map();
3187
+ function Cs(e) {
3188
+ return dt(e).packages.includes(xs);
2908
3189
  }
2909
- function No(e, t) {
2910
- jo.set(e, t);
3190
+ function ws(e, t) {
3191
+ Ss.set(e, t);
2911
3192
  }
2912
- function Po(e) {
2913
- let t = He(e);
3193
+ function Ts(e) {
3194
+ let t = dt(e);
2914
3195
  return {
2915
3196
  ...t,
2916
3197
  name: e?.length ? t.name : "Stage",
2917
- packages: A(t.packages, {
2918
- baseline: ko,
2919
- catalog: { [Pe]: w.Blueprint }
3198
+ packages: re(t.packages, {
3199
+ baseline: bs,
3200
+ catalog: { [rt]: O.Blueprint }
2920
3201
  })
2921
3202
  };
2922
3203
  }
2923
- var Fo = {
2924
- ...je,
2925
- [ko]: ft.components
3204
+ var Es = {
3205
+ ...et,
3206
+ [bs]: Pt.components
2926
3207
  };
2927
- function Io(e) {
2928
- let t = [...jo.values()].reduce((e, t) => ({
3208
+ function Ds(e) {
3209
+ let t = [...Ss.values()].reduce((e, t) => ({
2929
3210
  ...e,
2930
3211
  ...t.components
2931
3212
  }), {});
2932
3213
  return {
2933
- ..._e,
2934
- ...dt,
3214
+ ...Ae,
3215
+ ...Nt,
2935
3216
  ...t,
2936
- ...Ne,
2937
- ...Ve,
3217
+ ...nt,
3218
+ ...ut,
2938
3219
  ...e
2939
3220
  };
2940
3221
  }
2941
- function Lo(e) {
2942
- let t = Object.fromEntries([...jo].map(([e, t]) => [e, t.declared]));
3222
+ function Os(e) {
3223
+ let t = Object.fromEntries([...Ss].map(([e, t]) => [e, t.declared]));
2943
3224
  return {
2944
3225
  ...e,
2945
- ...Fo,
3226
+ ...Es,
2946
3227
  ...t
2947
3228
  };
2948
3229
  }
2949
- var Ro = "Stage:navigationTree";
2950
- function zo(e, t, n) {
3230
+ var ks = "Stage:navigationTree";
3231
+ function As(e, t, n) {
2951
3232
  let r = t?.title ?? "Cratis Stage";
2952
- return R(e, I.Logo, {
3233
+ return z(e, L.Logo, {
2953
3234
  label: r,
2954
3235
  initials: r.slice(0, 1).toUpperCase() || "S",
2955
3236
  targetScreen: n,
@@ -2958,42 +3239,42 @@ function zo(e, t, n) {
2958
3239
  ...t?.showName === void 0 ? {} : { showName: t.showName }
2959
3240
  });
2960
3241
  }
2961
- function Bo(e, t, n) {
3242
+ function js(e, t, n) {
2962
3243
  let r = [];
2963
- return e.length > 1 && r.push(R("topbar-locale", Eo, {
3244
+ return e.length > 1 && r.push(z("topbar-locale", _s, {
2964
3245
  locales: e,
2965
3246
  locale: t
2966
- })), n && r.push(R("topbar-theme", Do, {})), r;
3247
+ })), n && r.push(z("topbar-theme", vs, {})), r;
2967
3248
  }
2968
- function Vo(e, t, n, r, i, a = {}) {
2969
- let { regions: o = !1, showFooter: s = !0, showThemeSwitcher: c = !0 } = a, l = e[0]?.name ?? "", u = i?.title ?? "Cratis Stage", d = po(e), f = To(e, new Set(d.map((e) => e.targetScreen)), "Other screens"), p = mo([...d, ...d.length > 0 ? f : []]), m = e.map((e, n) => Be({
2970
- label: fo(e),
3249
+ function Ms(e, t, n, r, i, a = {}) {
3250
+ let { regions: o = !1, showFooter: s = !0, showThemeSwitcher: c = !0 } = a, l = e[0]?.name ?? "", u = i?.title ?? "Cratis Stage", d = is(e), f = gs(e, new Set(d.map((e) => e.targetScreen)), "Other screens"), p = as([...d, ...d.length > 0 ? f : []]), m = e.map((e, n) => lt({
3251
+ label: rs(e),
2971
3252
  targetScreen: e.name,
2972
3253
  icon: "pi pi-table",
2973
3254
  group: "Screens",
2974
3255
  order: n
2975
- }, t)), h = e.find((e) => e.name === t), g = h ? fo(h) : nr(t), _ = So(mo(d), t), v = e.find((e) => e.name === t)?.path?.length ? So(p, t) : [], y = _.length > 0 ? _ : v, b = d.length > 0 ? R("menu-hierarchy", Ro, {
3256
+ }, t)), h = e.find((e) => e.name === t), g = h ? rs(h) : Er(t), _ = ps(as(d), t), v = e.find((e) => e.name === t)?.path?.length ? ps(p, t) : [], y = _.length > 0 ? _ : v, b = d.length > 0 ? z("menu-hierarchy", ks, {
2976
3257
  nodes: p,
2977
3258
  activeScreen: t
2978
- }) : R("menu-screens", I.Menu, {
3259
+ }) : z("menu-screens", L.Menu, {
2979
3260
  title: "Screens",
2980
3261
  label: "Screens"
2981
- }, { items: m }), x = [R("topbar-notes", Oo, {}), ...Bo(n, r, c)], S = { regionNavigation: o };
3262
+ }, { items: m }), x = [z("topbar-notes", ys, {}), ...js(n, r, c)], S = { regionNavigation: o };
2982
3263
  return {
2983
- [L.Topbar]: [R("topbar", I.Topbar, S, {
2984
- logo: [zo("topbar-logo", i, l)],
3264
+ [R.Topbar]: [z("topbar", L.Topbar, S, {
3265
+ logo: [As("topbar-logo", i, l)],
2985
3266
  end: x
2986
3267
  })],
2987
- [L.Sidebar]: [R("sidebar", I.Sidebar, S, { logo: [zo("sidebar-logo", i, l)] })],
2988
- ...o ? {} : { [L.Menu]: [b] },
2989
- [L.Breadcrumb]: [R("breadcrumb", I.Breadcrumb, {
3268
+ [R.Sidebar]: [z("sidebar", L.Sidebar, S, { logo: [As("sidebar-logo", i, l)] })],
3269
+ ...o ? {} : { [R.Menu]: [b] },
3270
+ [R.Breadcrumb]: [z("breadcrumb", L.Breadcrumb, {
2990
3271
  homeTargetScreen: l,
2991
3272
  items: (y.length > 0 ? y : [g]).map((e) => ({ label: e }))
2992
3273
  })],
2993
- ...s ? { [L.Footer]: [R("footer", I.Footer, { text: u })] } : {},
2994
- [L.ConfigPanel]: [R(I.ConfigPanel, I.ConfigPanel, {
3274
+ ...s ? { [R.Footer]: [z("footer", L.Footer, { text: u })] } : {},
3275
+ [R.ConfigPanel]: [z(L.ConfigPanel, L.ConfigPanel, {
2995
3276
  title: "Settings",
2996
- themes: Fe.map((e) => ({
3277
+ themes: it.map((e) => ({
2997
3278
  name: e.name,
2998
3279
  label: e.name,
2999
3280
  isDark: e.isDark ?? !1
@@ -3001,11 +3282,11 @@ function Vo(e, t, n, r, i, a = {}) {
3001
3282
  })]
3002
3283
  };
3003
3284
  }
3004
- function Ho(e) {
3285
+ function Ns(e) {
3005
3286
  return `#/${encodeURIComponent(e)}`;
3006
3287
  }
3007
3288
  // src/externalRouteHref.ts
3008
- function Uo(e) {
3289
+ function Ps(e) {
3009
3290
  try {
3010
3291
  let t = new URL(e ?? "");
3011
3292
  return t.protocol === "http:" || t.protocol === "https:" ? e : void 0;
@@ -3013,53 +3294,151 @@ function Uo(e) {
3013
3294
  return;
3014
3295
  }
3015
3296
  }
3297
+ // src/stageSlot.tsx
3298
+ function Fs(e) {
3299
+ return typeof e == "string" && e.length > 0 ? e : void 0;
3300
+ }
3301
+ function Is({ element: e }) {
3302
+ let t = je(e.properties), n = c(xe), r = Ve(), i = Ge(), a = W(), o = Fs(e.properties.shows), s = Fs(e.properties.showsBy), u = Fs(e.properties.showsFromElement) ?? Fs(e.properties.showsFrom), d = t.routed || o ? r?.state.slots[t.name] : void 0, f = u ? a.selections[u] : void 0, p = f && s ? f[s] : void 0, m = p == null || p === "" ? void 0 : String(p);
3303
+ l(() => {
3304
+ if (!r || !o || !s || m === void 0) return;
3305
+ let e = r.state.slots[t.name];
3306
+ (e?.screen !== o || e.parameters[s] !== m) && r.openInSlot(t.name, {
3307
+ screen: o,
3308
+ parameters: { [s]: m }
3309
+ });
3310
+ }, [
3311
+ m,
3312
+ o,
3313
+ s,
3314
+ t.name
3315
+ ]);
3316
+ let h = d ? d.screen ?? o : n?.slots[t.name], g = h && i ? i.screens[h] : void 0;
3317
+ if (t.optional && !h) return null;
3318
+ let _ = t.closable || t.optional && (t.role === A.Pane || t.role === A.Panel), v = () => d ? r?.closeSlot(t.name) : n?.closeSlot(t.name), y = {
3319
+ "data-scene-slot": t.name,
3320
+ "data-scene-slot-screen": h,
3321
+ "data-scene-slot-role": t.role,
3322
+ "data-scene-slot-routed": t.routed ? "true" : void 0,
3323
+ "data-scene-slot-route": d ? Le(d, t.routedBy) : void 0
3324
+ }, b = /* @__PURE__ */ H(B, { children: [_ && h && /* @__PURE__ */ V("div", {
3325
+ className: "scene-slot-bar",
3326
+ children: /* @__PURE__ */ V("button", {
3327
+ type: "button",
3328
+ className: "scene-slot-close",
3329
+ "aria-label": "Close",
3330
+ onClick: v,
3331
+ children: "Close"
3332
+ })
3333
+ }), g && i && h && (d ? /* @__PURE__ */ V(Ls, {
3334
+ name: h,
3335
+ screen: g,
3336
+ registry: i.registry,
3337
+ values: d.parameters
3338
+ }) : /* @__PURE__ */ V(xr, {
3339
+ screen: h,
3340
+ children: /* @__PURE__ */ V(pi, {
3341
+ element: g,
3342
+ children: /* @__PURE__ */ V(be, {
3343
+ element: g,
3344
+ registry: i.registry,
3345
+ resolveBinding: a.resolveBinding
3346
+ })
3347
+ })
3348
+ }))] });
3349
+ return t.role === A.Panel ? /* @__PURE__ */ V("aside", {
3350
+ "aria-label": t.name,
3351
+ ...y,
3352
+ children: b
3353
+ }) : /* @__PURE__ */ V("div", {
3354
+ ...y,
3355
+ children: b
3356
+ });
3357
+ }
3358
+ function Ls({ name: e, screen: t, registry: n, values: r }) {
3359
+ let i = W(), a = JSON.stringify({
3360
+ ...i.parameters,
3361
+ ...r
3362
+ }), o = f(() => JSON.parse(a), [a]);
3363
+ return /* @__PURE__ */ V(we.Provider, {
3364
+ value: r,
3365
+ children: /* @__PURE__ */ V(zn, {
3366
+ routes: i.routes,
3367
+ routesReady: i.routesReady,
3368
+ parameters: o,
3369
+ locale: i.locale,
3370
+ locales: i.locales,
3371
+ screen: e,
3372
+ children: /* @__PURE__ */ V(Rs, {
3373
+ name: e,
3374
+ screen: t,
3375
+ registry: n
3376
+ })
3377
+ })
3378
+ });
3379
+ }
3380
+ function Rs({ name: e, screen: t, registry: n }) {
3381
+ let r = W();
3382
+ return /* @__PURE__ */ V(xr, {
3383
+ screen: e,
3384
+ children: /* @__PURE__ */ H(pi, {
3385
+ element: t,
3386
+ children: [/* @__PURE__ */ V(Jo, { element: t }), /* @__PURE__ */ V(be, {
3387
+ element: t,
3388
+ registry: n,
3389
+ resolveBinding: r.resolveBinding,
3390
+ queryResults: r.queryResults
3391
+ })]
3392
+ })
3393
+ });
3394
+ }
3016
3395
  // src/StageChrome.tsx
3017
- var Wo = a({
3396
+ var zs = a({
3018
3397
  locales: [],
3019
3398
  locale: "",
3020
3399
  setLocale: () => void 0,
3021
3400
  activity: ""
3022
3401
  });
3023
- function Go({ state: e, children: t }) {
3024
- return /* @__PURE__ */ z(Wo.Provider, {
3402
+ function Bs({ state: e, children: t }) {
3403
+ return /* @__PURE__ */ V(zs.Provider, {
3025
3404
  value: e,
3026
3405
  children: t
3027
3406
  });
3028
3407
  }
3029
- var Ko = "Stage:activity";
3030
- function qo() {
3031
- let { notesEnabled: e } = c(Wo);
3032
- return e ? /* @__PURE__ */ z(r, { size: "small" }) : null;
3408
+ var Vs = "Stage:activity";
3409
+ function Hs() {
3410
+ let { notesEnabled: e } = c(zs);
3411
+ return e ? /* @__PURE__ */ V(r, { size: "small" }) : null;
3033
3412
  }
3034
- function Jo() {
3035
- let { locales: e, locale: t, setLocale: n } = c(Wo);
3036
- return e.length < 2 ? null : /* @__PURE__ */ z("select", {
3413
+ function Us() {
3414
+ let { locales: e, locale: t, setLocale: n } = c(zs);
3415
+ return e.length < 2 ? null : /* @__PURE__ */ V("select", {
3037
3416
  className: "stage-locale",
3038
3417
  "aria-label": "Locale",
3039
3418
  value: t,
3040
3419
  onChange: (e) => n(e.target.value),
3041
- children: e.map((e) => /* @__PURE__ */ z("option", {
3420
+ children: e.map((e) => /* @__PURE__ */ V("option", {
3042
3421
  value: e,
3043
3422
  children: e
3044
3423
  }, e))
3045
3424
  });
3046
3425
  }
3047
- function Yo({ element: e }) {
3048
- let { config: t, setThemeName: n, setColorScheme: r } = Ue(), i = Fe.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === F.Dark, a = Fe.find((e) => (e.isDark ?? !1) !== i);
3426
+ function Ws({ element: e }) {
3427
+ let { config: t, setThemeName: n, setColorScheme: r } = ft(), i = it.find((e) => e.name === t.themeName)?.isDark ?? t.colorScheme === I.Dark, a = it.find((e) => (e.isDark ?? !1) !== i);
3049
3428
  if (!a) return null;
3050
3429
  let o = i ? "Switch to a light theme" : "Switch to a dark theme";
3051
- return /* @__PURE__ */ z("div", {
3430
+ return /* @__PURE__ */ V("div", {
3052
3431
  className: "stage-theme-toggle",
3053
3432
  "data-scene-id": e.id,
3054
- children: /* @__PURE__ */ z("button", {
3433
+ children: /* @__PURE__ */ V("button", {
3055
3434
  type: "button",
3056
3435
  className: "stage-theme-toggle__button",
3057
3436
  "aria-label": o,
3058
3437
  title: o,
3059
3438
  onClick: () => {
3060
- oo(a.name), n(a.name), r(a.isDark ? F.Dark : F.Light);
3439
+ Qo(a.name), n(a.name), r(a.isDark ? I.Dark : I.Light);
3061
3440
  },
3062
- children: /* @__PURE__ */ z("svg", {
3441
+ children: /* @__PURE__ */ V("svg", {
3063
3442
  width: "18",
3064
3443
  height: "18",
3065
3444
  viewBox: "0 0 24 24",
@@ -3069,43 +3448,43 @@ function Yo({ element: e }) {
3069
3448
  strokeLinecap: "round",
3070
3449
  strokeLinejoin: "round",
3071
3450
  "aria-hidden": "true",
3072
- children: i ? /* @__PURE__ */ B(Qe, { children: [/* @__PURE__ */ z("circle", {
3451
+ children: i ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V("circle", {
3073
3452
  cx: "12",
3074
3453
  cy: "12",
3075
3454
  r: "4"
3076
- }), /* @__PURE__ */ z("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" })] }) : /* @__PURE__ */ z("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
3455
+ }), /* @__PURE__ */ V("path", { d: "M12 2v2M12 20v2M4.93 4.93l1.41 1.41M17.66 17.66l1.41 1.41M2 12h2M20 12h2M4.93 19.07l1.41-1.41M17.66 6.34l1.41-1.41" })] }) : /* @__PURE__ */ V("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" })
3077
3456
  })
3078
3457
  })
3079
3458
  });
3080
3459
  }
3081
- function Xo({ element: e }) {
3460
+ function Gs({ element: e }) {
3082
3461
  let t = e.properties ?? {};
3083
- return /* @__PURE__ */ z("nav", {
3462
+ return /* @__PURE__ */ V("nav", {
3084
3463
  className: "stage-navigation-tree",
3085
3464
  "aria-label": "Navigation",
3086
3465
  "data-scene-id": e.id,
3087
- children: /* @__PURE__ */ z(Zo, {
3466
+ children: /* @__PURE__ */ V(Ks, {
3088
3467
  nodes: t.nodes ?? [],
3089
3468
  activeScreen: t.activeScreen
3090
3469
  })
3091
3470
  });
3092
3471
  }
3093
- function Zo({ nodes: e, activeScreen: t }) {
3094
- return /* @__PURE__ */ z("ul", {
3472
+ function Ks({ nodes: e, activeScreen: t }) {
3473
+ return /* @__PURE__ */ V("ul", {
3095
3474
  role: "tree",
3096
- children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ B("li", {
3475
+ children: e.map((e) => e.screen === void 0 ? /* @__PURE__ */ H("li", {
3097
3476
  role: "treeitem",
3098
3477
  "aria-expanded": "true",
3099
- children: [/* @__PURE__ */ z("span", {
3478
+ children: [/* @__PURE__ */ V("span", {
3100
3479
  className: "stage-navigation-group",
3101
3480
  children: e.label
3102
- }), /* @__PURE__ */ z(Zo, {
3481
+ }), /* @__PURE__ */ V(Ks, {
3103
3482
  nodes: e.children,
3104
3483
  activeScreen: t
3105
3484
  })]
3106
- }, e.label) : /* @__PURE__ */ z("li", {
3485
+ }, e.label) : /* @__PURE__ */ V("li", {
3107
3486
  role: "treeitem",
3108
- children: /* @__PURE__ */ z(Qo, {
3487
+ children: /* @__PURE__ */ V(qs, {
3109
3488
  node: e,
3110
3489
  screen: e.screen,
3111
3490
  activeScreen: t
@@ -3113,11 +3492,11 @@ function Zo({ nodes: e, activeScreen: t }) {
3113
3492
  }, `${e.screen}:${e.label}`))
3114
3493
  });
3115
3494
  }
3116
- function Qo({ node: e, screen: t, activeScreen: n }) {
3117
- let r = c(de), i = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", a = e.destination, o = a?.kind === "external", s = a && r && !o && wo(a) ? (e) => {
3495
+ function qs({ node: e, screen: t, activeScreen: n }) {
3496
+ let r = c(xe), i = e.presentation === "icon" || e.presentation === "text" ? e.presentation : "both", a = e.destination, o = a?.kind === "external", s = a && r && !o && hs(a) ? (e) => {
3118
3497
  e.preventDefault(), r.navigate(a);
3119
- } : void 0, l = o ? Uo(a.route) : Ho(t), u = o && l === void 0;
3120
- return /* @__PURE__ */ B("a", {
3498
+ } : void 0, l = o ? Ps(a.route) : Ns(t), u = o && l === void 0;
3499
+ return /* @__PURE__ */ H("a", {
3121
3500
  href: l,
3122
3501
  rel: o && !u ? "noreferrer" : void 0,
3123
3502
  "aria-disabled": u ? "true" : void 0,
@@ -3126,50 +3505,23 @@ function Qo({ node: e, screen: t, activeScreen: n }) {
3126
3505
  "data-presentation": e.presentation,
3127
3506
  "data-icon": e.icon,
3128
3507
  onClick: s,
3129
- children: [i !== "text" && e.icon && /* @__PURE__ */ z("span", {
3508
+ children: [i !== "text" && e.icon && /* @__PURE__ */ V("span", {
3130
3509
  className: "stage-navigation-icon",
3131
3510
  "aria-hidden": "true",
3132
3511
  "data-icon-name": e.icon
3133
3512
  }), i !== "icon" && e.label]
3134
3513
  });
3135
3514
  }
3136
- function $o({ element: e }) {
3137
- let t = typeof e.properties.name == "string" ? e.properties.name : "", n = c(de), r = Ee(), i = W(), a = n?.outlets[t], o = a && r ? r.screens[a] : void 0, s = e.properties.closable === !0;
3138
- return /* @__PURE__ */ B("div", {
3139
- "data-scene-outlet": t,
3140
- "data-scene-outlet-screen": a,
3141
- children: [s && a && /* @__PURE__ */ z("div", {
3142
- className: "scene-outlet-bar",
3143
- children: /* @__PURE__ */ z("button", {
3144
- type: "button",
3145
- className: "scene-outlet-close",
3146
- "aria-label": "Close",
3147
- onClick: () => n?.closeOutlet(t),
3148
- children: "Close"
3149
- })
3150
- }), o && r && /* @__PURE__ */ z(Zn, {
3151
- screen: a,
3152
- children: /* @__PURE__ */ z(Ur, {
3153
- element: o,
3154
- children: /* @__PURE__ */ z(ue, {
3155
- element: o,
3156
- registry: r.registry,
3157
- resolveBinding: i.resolveBinding
3158
- })
3159
- })
3160
- })]
3161
- });
3162
- }
3163
- function es() {
3164
- let { activity: e } = c(Wo);
3165
- return e ? /* @__PURE__ */ z("p", {
3515
+ function Js() {
3516
+ let { activity: e } = c(zs);
3517
+ return e ? /* @__PURE__ */ V("p", {
3166
3518
  className: "stage-activity",
3167
3519
  role: "status",
3168
3520
  children: e
3169
3521
  }) : null;
3170
3522
  }
3171
- function ts() {
3172
- let e = De(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
3523
+ function Ys() {
3524
+ let e = Ke(), t = e?.tokens?.["surface.background"], n = e?.tokens?.["text.color"];
3173
3525
  return l(() => {
3174
3526
  let r = e?.isDark ? "dark" : "light";
3175
3527
  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 ?? "";
@@ -3179,40 +3531,40 @@ function ts() {
3179
3531
  n
3180
3532
  ]), null;
3181
3533
  }
3182
- var ns = {
3183
- [Oo]: qo,
3184
- [Eo]: Jo,
3185
- [Do]: Yo,
3186
- [Ro]: Xo,
3187
- [Ko]: es,
3188
- "core:outlet": $o
3534
+ var Xs = {
3535
+ [ys]: Hs,
3536
+ [_s]: Us,
3537
+ [vs]: Ws,
3538
+ [ks]: Gs,
3539
+ [Vs]: Js,
3540
+ "core:slot": Is
3189
3541
  };
3190
3542
  // src/stageResponseContracts.ts
3191
- function rs(e) {
3543
+ function Zs(e) {
3192
3544
  return {
3193
3545
  commandResponse: (t) => e?.commands[t] ?? void 0,
3194
- targetType: (t, n) => is(e, t, n)
3546
+ targetType: (t, n) => Qs(e, t, n)
3195
3547
  };
3196
3548
  }
3197
- function is(e, t, n) {
3549
+ function Qs(e, t, n) {
3198
3550
  if (n.kind === "message") return { kind: "string" };
3199
- if (n.kind === "argument") return as(e, t, n.name);
3551
+ if (n.kind === "argument") return $s(e, t, n.name);
3200
3552
  }
3201
- function as(e, t, n) {
3553
+ function $s(e, t, n) {
3202
3554
  switch (t.kind) {
3203
- case x.ExecuteCommand: return e?.commandInputs[t.command]?.[n] ?? void 0;
3204
- case x.Navigate: return e?.screenInputs[t.screen]?.[n] ?? void 0;
3555
+ case S.ExecuteCommand: return e?.commandInputs[t.command]?.[n] ?? void 0;
3556
+ case S.Navigate: return e?.screenInputs[t.screen]?.[n] ?? void 0;
3205
3557
  default: return;
3206
3558
  }
3207
3559
  }
3208
3560
  // src/stageShell.ts
3209
- var os = [
3561
+ var ec = [
3210
3562
  "navigationMode",
3211
3563
  "menuTheme",
3212
3564
  "showFooter",
3213
3565
  "showThemeSwitcher"
3214
- ], ss = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
3215
- function cs(e, t, n = !1) {
3566
+ ], tc = /^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i;
3567
+ function nc(e, t, n = !1) {
3216
3568
  let r = [], i = {
3217
3569
  showFooter: !0,
3218
3570
  showThemeSwitcher: !0,
@@ -3220,54 +3572,54 @@ function cs(e, t, n = !1) {
3220
3572
  problems: r
3221
3573
  };
3222
3574
  for (let [e, n] of Object.entries(t.options ?? {})) {
3223
- let a = ls(i, t.name, e, n);
3575
+ let a = rc(i, t.name, e, n);
3224
3576
  a && r.push(a);
3225
3577
  }
3226
- return ds(i, e?.appearance, n), i;
3578
+ return ac(i, e?.appearance, n), i;
3227
3579
  }
3228
- function ls(e, t, n, r) {
3229
- if (!os.includes(n)) return `The shell '${t}' has no option '${n}'; the options it understands are ${os.join(", ")}.`;
3230
- if (n === "navigationMode") return us(n, r, Re, (t) => {
3580
+ function rc(e, t, n, r) {
3581
+ if (!ec.includes(n)) return `The shell '${t}' has no option '${n}'; the options it understands are ${ec.join(", ")}.`;
3582
+ if (n === "navigationMode") return ic(n, r, st, (t) => {
3231
3583
  e.mode = t;
3232
3584
  });
3233
- if (n === "menuTheme") return us(n, r, ze, (t) => {
3585
+ if (n === "menuTheme") return ic(n, r, ct, (t) => {
3234
3586
  e.menuTheme = t;
3235
3587
  });
3236
3588
  if (typeof r != "boolean") return `Option '${n}' is '${String(r)}'; expected true or false.`;
3237
3589
  n === "showFooter" ? e.showFooter = r : e.showThemeSwitcher = r;
3238
3590
  }
3239
- function us(e, t, n, r) {
3591
+ function ic(e, t, n, r) {
3240
3592
  let i = n.find((e) => e === t);
3241
3593
  if (!i) return `Option '${e}' is '${String(t)}'; expected one of ${n.join(", ")}.`;
3242
3594
  r(i);
3243
3595
  }
3244
- function ds(e, t, n) {
3596
+ function ac(e, t, n) {
3245
3597
  if (t?.colorScheme !== void 0) {
3246
- e.followsSystem = t.colorScheme === g.System;
3247
- let r = e.followsSystem ? n : t.colorScheme === g.Dark;
3248
- e.colorScheme = r ? F.Dark : F.Light, e.themeName = Fe.find((e) => (e.isDark ?? !1) === r)?.name, e.followsSystem || (e.showThemeSwitcher = !1);
3598
+ e.followsSystem = t.colorScheme === _.System;
3599
+ let r = e.followsSystem ? n : t.colorScheme === _.Dark;
3600
+ e.colorScheme = r ? I.Dark : I.Light, e.themeName = it.find((e) => (e.isDark ?? !1) === r)?.name, e.followsSystem || (e.showThemeSwitcher = !1);
3249
3601
  }
3250
- t?.accent !== void 0 && (ss.test(t.accent) ? e.accent = t.accent : e.problems.push(`The accent '${t.accent}' is not a colour written as #rgb or #rrggbb.`));
3602
+ t?.accent !== void 0 && (tc.test(t.accent) ? e.accent = t.accent : e.problems.push(`The accent '${t.accent}' is not a colour written as #rgb or #rrggbb.`));
3251
3603
  }
3252
- function fs(e) {
3604
+ function oc(e) {
3253
3605
  return {
3254
3606
  showFooter: e?.showFooter ?? !0,
3255
3607
  showThemeSwitcher: e?.showThemeSwitcher ?? !0
3256
3608
  };
3257
3609
  }
3258
- function ps(e, t) {
3610
+ function sc(e, t) {
3259
3611
  if (e?.root === void 0) return [];
3260
3612
  let n = /* @__PURE__ */ new Set([
3261
- D.RootTemplateUnknown,
3262
- D.RootTemplateVersionNotSatisfied,
3263
- D.RootTemplateNotApplicable,
3264
- D.RootTemplateMissingContentSlot,
3265
- D.RootTemplateCycle,
3266
- D.RootTemplateBlueprintNotInstalled
3613
+ M.RootTemplateUnknown,
3614
+ M.RootTemplateVersionNotSatisfied,
3615
+ M.RootTemplateNotApplicable,
3616
+ M.RootTemplateMissingContentSlot,
3617
+ M.RootTemplateCycle,
3618
+ M.RootTemplateBlueprintNotInstalled
3267
3619
  ]), r = t.diagnostics.filter((e) => n.has(e.code)).map((e) => e.message);
3268
- return r.length === 0 && t.origin !== O.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;
3620
+ return r.length === 0 && t.origin !== N.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;
3269
3621
  }
3270
- function ms(e) {
3622
+ function cc(e) {
3271
3623
  let t = e.length === 4 ? [...e.slice(1)].map((e) => e + e).join("") : e.slice(1), [n, r, i] = [
3272
3624
  0,
3273
3625
  2,
@@ -3275,7 +3627,7 @@ function ms(e) {
3275
3627
  ].map((e) => parseInt(t.slice(e, e + 2), 16));
3276
3628
  return (n * 299 + r * 587 + i * 114) / 1e3 >= 150 ? "#111827" : "#ffffff";
3277
3629
  }
3278
- function hs(e, t) {
3630
+ function lc(e, t) {
3279
3631
  if (t === void 0) return e;
3280
3632
  let n = t.length === 4 ? [...t.slice(1)].map((e) => e + e).join("") : t.slice(1), [r, i, a] = [
3281
3633
  0,
@@ -3287,25 +3639,25 @@ function hs(e, t) {
3287
3639
  tokens: {
3288
3640
  ...e.tokens,
3289
3641
  "primary.color": t,
3290
- "primary.contrastColor": ms(t),
3642
+ "primary.contrastColor": cc(t),
3291
3643
  "focus.ring": `0 0 0 2px rgb(${r} ${i} ${a} / 0.4)`
3292
3644
  }
3293
3645
  }));
3294
3646
  }
3295
3647
  // src/StageShellSettings.tsx
3296
- var gs = "(prefers-color-scheme: dark)";
3297
- function _s() {
3648
+ var uc = "(prefers-color-scheme: dark)";
3649
+ function dc() {
3298
3650
  return globalThis.matchMedia?.("(prefers-color-scheme: dark)").matches ?? !1;
3299
3651
  }
3300
- function vs({ settings: e, onSystemSchemeChange: t }) {
3301
- let n = p(Ue());
3302
- n.current = Ue();
3652
+ function fc({ settings: e, onSystemSchemeChange: t }) {
3653
+ let n = p(ft());
3654
+ n.current = ft();
3303
3655
  let { mode: r, menuTheme: i, colorScheme: a, themeName: o } = e;
3304
3656
  return l(() => {
3305
3657
  let { setMode: e, setMenuTheme: t, setColorScheme: s, setThemeName: c } = n.current;
3306
3658
  r !== void 0 && e(r), i !== void 0 && t(i);
3307
- let l = Fe.find((e) => e.name === ao());
3308
- l ? (c(l.name), s(l.isDark ? F.Dark : F.Light)) : (a !== void 0 && s(a), o !== void 0 && c(o));
3659
+ let l = it.find((e) => e.name === Zo());
3660
+ l ? (c(l.name), s(l.isDark ? I.Dark : I.Light)) : (a !== void 0 && s(a), o !== void 0 && c(o));
3309
3661
  }, [
3310
3662
  r,
3311
3663
  i,
@@ -3313,67 +3665,70 @@ function vs({ settings: e, onSystemSchemeChange: t }) {
3313
3665
  o
3314
3666
  ]), l(() => {
3315
3667
  if (!e.followsSystem || !globalThis.matchMedia || !t) return;
3316
- let n = globalThis.matchMedia(gs), r = (e) => t(e.matches);
3668
+ let n = globalThis.matchMedia(uc), r = (e) => t(e.matches);
3317
3669
  return n.addEventListener("change", r), () => n.removeEventListener("change", r);
3318
3670
  }, [e.followsSystem, t]), null;
3319
3671
  }
3320
3672
  // src/stageNavigationModel.ts
3321
- function ys(e) {
3322
- return (e?.application.regions.length ?? 0) > 0 || (e?.modules.length ?? 0) > 0;
3673
+ function pc(e) {
3674
+ return (e?.application.outlets.some((e) => e.defaults.length > 0) ?? !1) || (e?.modules.length ?? 0) > 0;
3323
3675
  }
3324
- function bs(e) {
3325
- let t = /* @__PURE__ */ new Map();
3326
- for (let n of e) {
3327
- let e = (n.path ?? []).join(".");
3328
- e.length > 0 && !t.has(e) && t.set(e, n.name);
3676
+ function mc(e) {
3677
+ let t = e.filter(hc), n = /* @__PURE__ */ new Map();
3678
+ for (let e of t) {
3679
+ let t = (e.path ?? []).join(".");
3680
+ t.length > 0 && !n.has(t) && n.set(t, e.name);
3329
3681
  }
3330
- return (n) => {
3331
- let r = n.target?.resolvedFeature;
3682
+ return (e) => {
3683
+ let r = e.target?.resolvedFeature;
3332
3684
  if (r === void 0) return;
3333
- let i = e.find((e) => (e.path ?? []).join(".").startsWith(`${r}.`))?.name;
3334
- return t.get(r) ?? i ?? (e.some((e) => e.name === r) ? r : void 0);
3685
+ let i = t.find((e) => (e.path ?? []).join(".").startsWith(`${r}.`))?.name;
3686
+ return n.get(r) ?? i ?? (t.some((e) => e.name === r) ? r : void 0);
3335
3687
  };
3336
3688
  }
3337
- function xs(e) {
3689
+ function hc(e) {
3690
+ return e.fits === void 0 || e.fits.length === 0 || e.fits.includes(k.Page);
3691
+ }
3692
+ function gc(e) {
3338
3693
  return (t) => e.find((e) => e.name === t)?.path?.[0];
3339
3694
  }
3340
- function Ss(e, t, n) {
3695
+ function _c(e, t, n) {
3341
3696
  let r = e.navigation ?? {
3342
- application: { regions: [] },
3697
+ application: { outlets: [] },
3343
3698
  modules: []
3344
3699
  };
3345
3700
  return {
3346
3701
  structure: e.structure ?? { modules: [] },
3347
- navigation: n ? Cs(r, n) : r,
3348
- screenFor: bs(e.screens),
3349
- moduleOf: xs(e.screens),
3702
+ navigation: n ? vc(r, n) : r,
3703
+ screenFor: mc(e.screens),
3704
+ moduleOf: gc(e.screens),
3350
3705
  ...t ? { isVisible: t } : {}
3351
3706
  };
3352
3707
  }
3353
- function Cs(e, t) {
3354
- return typeof e == "string" ? re(e, t) : Array.isArray(e) ? e.map((e) => Cs(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, Cs(n, t)])) : e;
3708
+ function vc(e, t) {
3709
+ return typeof e == "string" ? ce(e, t) : Array.isArray(e) ? e.map((e) => vc(e, t)) : typeof e == "object" && e ? Object.fromEntries(Object.entries(e).map(([e, n]) => [e, vc(n, t)])) : e;
3355
3710
  }
3356
3711
  // src/stageSlices.ts
3357
- function ws(e) {
3712
+ function yc(e) {
3358
3713
  return (t) => Y(e?.[t] ?? "").filter((e) => e.unsupportedReason === void 0 && !e.members && !e.item).map((e) => ({
3359
3714
  name: e.name,
3360
3715
  type: e.type === "text" || e.type === void 0 ? "string" : e.type,
3361
- label: Ts(e.name),
3716
+ label: bc(e.name),
3362
3717
  required: e.required
3363
3718
  }));
3364
3719
  }
3365
- function Ts(e) {
3720
+ function bc(e) {
3366
3721
  return e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/^./, (e) => e.toUpperCase());
3367
3722
  }
3368
- function Es(e, t, n) {
3723
+ function xc(e, t, n) {
3369
3724
  return { invoke: async (r, i, a) => {
3370
3725
  let o = a ?? r.slice(r.lastIndexOf(".") + 1);
3371
- if (!H(o)) return {
3726
+ if (!on(o)) return {
3372
3727
  succeeded: !1,
3373
3728
  message: t ? `The modeled command “${o}” is not registered by this Stage.` : `The modeled command “${o}” is waiting for Stage routes.`
3374
3729
  };
3375
3730
  let s = await e(o, i);
3376
- return s.isSuccess && n(), {
3731
+ return s.isSuccess && (n(), Wn()), {
3377
3732
  succeeded: s.isSuccess,
3378
3733
  ...s.validationErrors.length > 0 ? { validationErrors: s.validationErrors.map((e) => ({
3379
3734
  field: e.member || void 0,
@@ -3385,7 +3740,7 @@ function Es(e, t, n) {
3385
3740
  } };
3386
3741
  }
3387
3742
  // src/withoutSeededSlots.ts
3388
- function Ds(e, t) {
3743
+ function Sc(e, t) {
3389
3744
  let n = /* @__PURE__ */ new Map();
3390
3745
  for (let e of t) n.has(e.name) || n.set(e.name, e.slots.map((e) => e.name));
3391
3746
  return e.map((e) => {
@@ -3401,8 +3756,53 @@ function Ds(e, t) {
3401
3756
  };
3402
3757
  });
3403
3758
  }
3759
+ // src/stageOutlets.tsx
3760
+ function Cc(e) {
3761
+ let t = new Map(e.screens.map((e) => [e.name, e]));
3762
+ return wc(e.structure).map((n) => {
3763
+ let r = t.get(n.name), i = n.command ? Y(e.commandSchemas?.[n.command] ?? "").map((e) => e.identity ? {
3764
+ name: e.name,
3765
+ source: te.DataContext
3766
+ } : { name: e.name }) : [];
3767
+ return {
3768
+ id: n.id,
3769
+ ...n.command ? { command: n.command } : {},
3770
+ ...r ? { screen: r.name } : {},
3771
+ ...r?.fits ? { fits: r.fits } : {},
3772
+ inputs: i
3773
+ };
3774
+ });
3775
+ }
3776
+ function wc(e) {
3777
+ let t = (e) => e.flatMap((e) => [...e.slices, ...t(e.features ?? [])]);
3778
+ return (e?.modules ?? []).flatMap((e) => [...e.slices ?? [], ...t(e.features ?? [])]);
3779
+ }
3780
+ function Tc(e, t) {
3781
+ let n = e.screens.find((e) => e.name === t);
3782
+ if (!n) return { chain: [] };
3783
+ let { chain: r, contributors: i } = ie({
3784
+ layouts: e.layouts,
3785
+ screenTemplates: e.screenTemplates,
3786
+ screens: e.screens,
3787
+ navigation: e.navigation,
3788
+ levels: e.outletLevels
3789
+ }, n.name), a = e.screenTemplates.find((e) => e.name === n.screenTemplate), o = e.layouts.find((e) => e.name === n.layout), s = Object.entries(n.slotContent ?? {}).filter(([, e]) => e.some((e) => e.componentName !== "core:slot")).map(([e]) => e), c = F([...o?.slots ?? [], ...a?.slots ?? []], s);
3790
+ return {
3791
+ chain: r,
3792
+ contributors: i,
3793
+ slices: Cc(e),
3794
+ slots: c
3795
+ };
3796
+ }
3797
+ function Ec({ source: e, screen: t, children: n }) {
3798
+ let r = f(() => Tc(e, t), [e, t]);
3799
+ return /* @__PURE__ */ V(Se, {
3800
+ value: r,
3801
+ children: n
3802
+ });
3803
+ }
3404
3804
  // src/stageIcons.ts
3405
- var Os = /* @__PURE__ */ new Map([
3805
+ var Dc = /* @__PURE__ */ new Map([
3406
3806
  ["chart", "chart-column"],
3407
3807
  ["add", "plus"],
3408
3808
  ["dollar", "dollar-sign"],
@@ -3410,23 +3810,23 @@ var Os = /* @__PURE__ */ new Map([
3410
3810
  ["refresh", "refresh-cw"],
3411
3811
  ["invoice", "receipt-text"],
3412
3812
  ["batch", "layers"]
3413
- ]), ks = (e) => e.trim().replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])([0-9]+)/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), As = xe([{
3414
- library: T,
3813
+ ]), Oc = (e) => e.trim().replace(/([A-Z]+)([A-Z][a-z])/g, "$1-$2").replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])([0-9]+)/g, "$1-$2").replace(/[\s_]+/g, "-").toLowerCase(), kc = Ne([{
3814
+ library: ee,
3415
3815
  loadGlyph: async ({ key: e }) => {
3416
- let t = ks(e), n = Os.get(t) ?? t;
3417
- if (Object.hasOwn(pt, n)) return (await pt[n]())?.default;
3816
+ let t = Oc(e), n = Dc.get(t) ?? t;
3817
+ if (Object.hasOwn(Ft, n)) return (await Ft[n]())?.default;
3418
3818
  }
3419
3819
  }]);
3420
3820
  // src/App.tsx
3421
- function js(e = {}) {
3422
- return Io({
3821
+ function Ac(e = {}) {
3822
+ return Ds({
3423
3823
  ...e,
3424
- ...Ga,
3425
- ...ns
3824
+ ...Lo,
3825
+ ...Xs
3426
3826
  });
3427
3827
  }
3428
- function Ms(e, t) {
3429
- return R(`form-${e}-${t.name}`, va, {
3828
+ function jc(e, t) {
3829
+ return z(`form-${e}-${t.name}`, io, {
3430
3830
  command: t.forCommand,
3431
3831
  label: t.name,
3432
3832
  generationMode: t.generationMode,
@@ -3435,71 +3835,71 @@ function Ms(e, t) {
3435
3835
  onSubmit: t.onSubmit
3436
3836
  });
3437
3837
  }
3438
- function Ns(e, t) {
3838
+ function Mc(e, t) {
3439
3839
  let n = e.screens[0];
3440
- return Ie(e, n, {
3441
- profile: Po(e.uiProfiles),
3442
- blueprintTemplates: t?.length ? [...Le, ...t] : Le
3840
+ return at(e, n, {
3841
+ profile: Ts(e.uiProfiles),
3842
+ blueprintTemplates: t?.length ? [...ot, ...t] : ot
3443
3843
  });
3444
3844
  }
3445
- function Ps(e, t) {
3845
+ function Nc(e, t) {
3446
3846
  return t ? e.map((e) => ({
3447
3847
  ...e,
3448
- slotContent: Object.fromEntries(Object.entries(e.slotContent ?? {}).map(([e, n]) => [e, n.map((e) => ne(e, t))]))
3848
+ slotContent: Object.fromEntries(Object.entries(e.slotContent ?? {}).map(([e, n]) => [e, n.map((e) => se(e, t))]))
3449
3849
  })) : e;
3450
3850
  }
3451
- function Fs(e, t, n, r, i, a, o = !0, s = !0) {
3851
+ function Pc(e, t, n, r, i, a, o = !0, s = !0) {
3452
3852
  let c = {
3453
- regions: ys(e.navigation),
3853
+ regions: pc(e.navigation),
3454
3854
  showFooter: o,
3455
3855
  showThemeSwitcher: s
3456
- }, l = Ps(e.screens, i), u = Is(e);
3856
+ }, l = Nc(e.screens, i), u = Fc(e);
3457
3857
  return {
3458
- profile: Po(e.uiProfiles),
3459
- catalog: Lo(r),
3460
- blueprintTemplates: a?.length ? [...Le, ...a] : Le,
3858
+ profile: Ts(e.uiProfiles),
3859
+ catalog: Os(r),
3860
+ blueprintTemplates: a?.length ? [...ot, ...a] : ot,
3461
3861
  namedTemplateOnly: !0,
3462
- chrome: (e, r) => r === I.FullPageShell ? { [L.ConfigPanel]: Vo(l, e.name, t, n, u, c)[L.ConfigPanel] } : Vo(l, e.name, t, n, u, c),
3463
- form: Ms,
3464
- trailing: [R("activity", Ko)],
3862
+ chrome: (e, r) => r === L.FullPageShell ? { [R.ConfigPanel]: Ms(l, e.name, t, n, u, c)[R.ConfigPanel] } : Ms(l, e.name, t, n, u, c),
3863
+ form: jc,
3864
+ trailing: [z("activity", Vs)],
3465
3865
  decorate: (e) => {
3466
- let t = Ja(In(e));
3467
- return i ? ne(t, i) : t;
3866
+ let t = Bo(or(e));
3867
+ return i ? se(t, i) : t;
3468
3868
  }
3469
3869
  };
3470
3870
  }
3471
- function Is(e) {
3871
+ function Fc(e) {
3472
3872
  let t = e.navigation?.application.logo;
3473
3873
  if (t) return {
3474
3874
  title: t.title,
3475
3875
  image: t.image || void 0
3476
3876
  };
3477
- let n = Po(e.uiProfiles).identity;
3877
+ let n = Ts(e.uiProfiles).identity;
3478
3878
  if (!n?.name) return;
3479
3879
  let r = n.logo;
3480
3880
  return {
3481
3881
  title: n.name,
3482
- image: r?.kind === C.Image && r.image || void 0,
3483
- icon: r?.kind === C.Icon ? r.icon : void 0,
3882
+ image: r?.kind === w.Image && r.image || void 0,
3883
+ icon: r?.kind === w.Icon ? r.icon : void 0,
3484
3884
  showName: n.showName
3485
3885
  };
3486
3886
  }
3487
- function Ls(e, t, n, r, i, a) {
3488
- let [o] = ta([t], Rs(e));
3489
- return Me(e, o, Fs(e, n, r, i, void 0, a)).element;
3887
+ function Ic(e, t, n, r, i, a) {
3888
+ let [o] = Va([t], Lc(e));
3889
+ return tt(e, o, Pc(e, n, r, i, void 0, a)).element;
3490
3890
  }
3491
- function Rs(e) {
3891
+ function Lc(e) {
3492
3892
  return [...e.screenTemplates ?? [], ...e.dialogTemplates ?? []];
3493
3893
  }
3494
- function zs() {
3894
+ function Rc() {
3495
3895
  try {
3496
3896
  return globalThis.localStorage ?? null;
3497
3897
  } catch {
3498
3898
  return null;
3499
3899
  }
3500
3900
  }
3501
- function Bs({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: a = "hash" } = {}) {
3502
- let o = vt(), [s, c] = m(), [u, d] = m(""), p = f(() => js(e), [e, s]), h = yt(), g = Ka();
3901
+ function zc({ components: e, packageCatalog: t, screenTemplates: n, dialogTemplates: r, isVisible: i, routing: a = "hash" } = {}) {
3902
+ let o = Bt(), [s, c] = m(), [u, d] = m(""), p = f(() => Ac(e), [e, s]), h = Vt(), g = Ro();
3503
3903
  return l(() => {
3504
3904
  let e = new AbortController();
3505
3905
  return o.scene(e.signal).then((e) => c(r?.length ? {
@@ -3508,10 +3908,10 @@ function Bs({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
3508
3908
  } : e)).catch((t) => {
3509
3909
  e.signal.aborted || d(t instanceof Error ? t.message : String(t));
3510
3910
  }), () => e.abort();
3511
- }, [o, r]), u ? /* @__PURE__ */ B("main", {
3911
+ }, [o, r]), u ? /* @__PURE__ */ H("main", {
3512
3912
  className: "stage-message",
3513
- children: [/* @__PURE__ */ z("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ z("p", { children: u })]
3514
- }) : s ? /* @__PURE__ */ z(Vs, {
3913
+ children: [/* @__PURE__ */ V("h1", { children: "Unable to render this Stage" }), /* @__PURE__ */ V("p", { children: u })]
3914
+ }) : s ? /* @__PURE__ */ V(Bc, {
3515
3915
  scene: s,
3516
3916
  registry: p,
3517
3917
  routing: a,
@@ -3520,100 +3920,110 @@ function Bs({ components: e, packageCatalog: t, screenTemplates: n, dialogTempla
3520
3920
  packageCatalog: t,
3521
3921
  screenTemplates: n,
3522
3922
  isVisible: i
3523
- }) : /* @__PURE__ */ z("main", {
3923
+ }) : /* @__PURE__ */ V("main", {
3524
3924
  className: "stage-message",
3525
- children: /* @__PURE__ */ z("h1", { children: "Preparing the Stage" })
3925
+ children: /* @__PURE__ */ V("h1", { children: "Preparing the Stage" })
3526
3926
  });
3527
3927
  }
3528
- function Vs({ scene: e, registry: t, routing: n, routeState: r, strings: a, packageCatalog: o, screenTemplates: c, isVisible: l }) {
3529
- let u = f(() => {
3530
- if (Wt(n), n === "hash") return be();
3531
- let e = /^#\/(.+)$/.exec(globalThis.location.hash);
3532
- return e && globalThis.history.replaceState(null, "", `/${e[1]}`), ye(window, "/");
3533
- }, [n]), [d, p] = m(_s), h = Hn(), g = e.screens[0]?.name ?? "", _ = f(() => Po(e.uiProfiles), [e]), v = f(() => g ? Ns(e, c) : void 0, [
3928
+ function Bc({ scene: e, registry: t, routing: n, routeState: r, strings: a, packageCatalog: o, screenTemplates: c, isVisible: u }) {
3929
+ let d = f(() => wa(e), [e]), p = f(() => {
3930
+ if (hn(n), n === "path") {
3931
+ let e = /^#\/(.+)$/.exec(globalThis.location.hash);
3932
+ e && globalThis.history.replaceState(null, "", `/${e[1]}`);
3933
+ }
3934
+ return Ma(window, n, d);
3935
+ }, [n, d]);
3936
+ l(() => () => p.dispose(), [p]);
3937
+ let h = Fa(p), g = p.history, [_, v] = m(dc), y = fr(), b = e.screens[0]?.name ?? "", x = f(() => Ts(e.uiProfiles), [e]), S = f(() => b ? Mc(e, c) : void 0, [
3534
3938
  e,
3535
3939
  c,
3536
- g
3537
- ]), y = f(() => v ? ps(_, v) : [], [_, v]), b = f(() => v ? cs(_, v, d) : void 0, [
3538
- _,
3539
- v,
3540
- d
3541
- ]), x = f(() => hs(Fe, b?.accent), [b?.accent]), { showFooter: S, showThemeSwitcher: C } = fs(b), w = f(() => Fs(e, a.locales, a.locale, o, a.dictionary, c, S, C), [
3940
+ b
3941
+ ]), C = f(() => S ? sc(x, S) : [], [x, S]), w = f(() => S ? nc(x, S, _) : void 0, [
3942
+ x,
3943
+ S,
3944
+ _
3945
+ ]), T = f(() => lc(it, w?.accent), [w?.accent]), { showFooter: E, showThemeSwitcher: D } = oc(w), O = f(() => Pc(e, a.locales, a.locale, o, a.dictionary, c, E, D), [
3542
3946
  e,
3543
3947
  a.locales,
3544
3948
  a.locale,
3545
3949
  a.dictionary,
3546
3950
  o,
3547
3951
  c,
3548
- S,
3549
- C
3550
- ]), T = s((e) => p(e), []), E = f(() => Ss(e, l, a.dictionary), [
3952
+ E,
3953
+ D
3954
+ ]), k = s((e) => v(e), []), A = f(() => _c(e, u, a.dictionary), [
3551
3955
  e,
3552
- l,
3956
+ u,
3553
3957
  a.dictionary
3554
- ]), D = f(() => ({
3958
+ ]), ee = f(() => ({
3555
3959
  ...e,
3556
- screens: ta(Ds(e.screens, [
3960
+ screens: Va(Sc(e.screens, [
3557
3961
  ...e.screenTemplates,
3558
3962
  ...e.dialogTemplates ?? [],
3559
- ...Le,
3963
+ ...ot,
3560
3964
  ...c ?? []
3561
- ]), Rs(e))
3965
+ ]), Lc(e))
3562
3966
  }), [e, c]);
3563
- if (!g) return /* @__PURE__ */ B("main", {
3967
+ if (!b) return /* @__PURE__ */ H("main", {
3564
3968
  className: "stage-message",
3565
- children: [/* @__PURE__ */ z("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ z("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
3969
+ children: [/* @__PURE__ */ V("h1", { children: "Nothing to show yet" }), /* @__PURE__ */ V("p", { children: "This model has no slice carrying a command or a read model, so there is no screen to render." })]
3566
3970
  });
3567
- if (y.length > 0) return /* @__PURE__ */ B("main", {
3971
+ if (C.length > 0) return /* @__PURE__ */ H("main", {
3568
3972
  className: "stage-message",
3569
3973
  role: "alert",
3570
3974
  "data-stage-startup-problem": "root-template",
3571
3975
  children: [
3572
- /* @__PURE__ */ z("h1", { children: "Unable to start this Stage" }),
3573
- /* @__PURE__ */ z("p", { children: "The ui profile's root template cannot be the application's shell." }),
3574
- /* @__PURE__ */ z("ul", { children: y.map((e) => /* @__PURE__ */ z("li", { children: e }, e)) })
3976
+ /* @__PURE__ */ V("h1", { children: "Unable to start this Stage" }),
3977
+ /* @__PURE__ */ V("p", { children: "The ui profile's root template cannot be the application's shell." }),
3978
+ /* @__PURE__ */ V("ul", { children: C.map((e) => /* @__PURE__ */ V("li", { children: e }, e)) })
3575
3979
  ]
3576
3980
  });
3577
- let O = /* @__PURE__ */ z(Oe, {
3578
- application: D,
3579
- composition: w,
3580
- navigationModel: E,
3981
+ let te = /* @__PURE__ */ V(Ze, {
3982
+ application: ee,
3983
+ composition: O,
3984
+ navigationModel: A,
3581
3985
  registry: t,
3582
- initialScreen: g,
3583
- history: u,
3584
- layoutConfigStorage: zs(),
3585
- scope: (t, n) => /* @__PURE__ */ z(Hs, {
3986
+ initialScreen: b,
3987
+ history: g,
3988
+ layoutConfigStorage: Rc(),
3989
+ scope: (t, n) => /* @__PURE__ */ V(Vc, {
3586
3990
  scene: e,
3587
- notes: h,
3991
+ notes: y,
3588
3992
  routeState: r,
3589
3993
  strings: a,
3590
3994
  navigation: t,
3591
- themes: x,
3592
- shellSettings: b,
3593
- onSystemSchemeChange: T,
3995
+ themes: T,
3996
+ shellSettings: w,
3997
+ onSystemSchemeChange: k,
3594
3998
  children: n
3595
3999
  }),
3596
- renderScreen: (e, n) => /* @__PURE__ */ z(Gs, {
4000
+ renderScreen: (e, n) => /* @__PURE__ */ V(Wc, {
3597
4001
  element: e,
3598
4002
  configuration: n,
3599
4003
  registry: t
3600
4004
  }),
3601
- renderDialog: () => /* @__PURE__ */ z(Ra, {}),
3602
- renderDialogTemplate: (e, n, r) => /* @__PURE__ */ z(Ks, {
4005
+ renderDialog: () => /* @__PURE__ */ V(To, {}),
4006
+ renderDialogTemplate: (e, n, r) => /* @__PURE__ */ V(Gc, {
3603
4007
  template: e,
3604
4008
  content: n,
3605
4009
  registry: t,
3606
4010
  strings: a,
3607
4011
  close: () => r.closeDialog()
3608
4012
  })
4013
+ }), j = /* @__PURE__ */ V(Ia.Provider, {
4014
+ value: d,
4015
+ children: /* @__PURE__ */ V(Ce, {
4016
+ router: h,
4017
+ children: te
4018
+ })
3609
4019
  });
3610
- return h.enabled ? /* @__PURE__ */ z(i, {
4020
+ return y.enabled ? /* @__PURE__ */ V(i, {
3611
4021
  enabled: !0,
3612
- knownSlices: Gn(e.structure),
3613
- children: O
3614
- }) : O;
4022
+ knownSlices: hr(e.structure),
4023
+ children: j
4024
+ }) : j;
3615
4025
  }
3616
- function Hs({ scene: e, notes: t, routeState: n, strings: r, navigation: i, themes: a, shellSettings: o, onSystemSchemeChange: s, children: c }) {
4026
+ function Vc({ scene: e, notes: t, routeState: n, strings: r, navigation: i, themes: a, shellSettings: o, onSystemSchemeChange: s, children: c }) {
3617
4027
  let [u, d] = m(""), { navigate: f } = i;
3618
4028
  return l(() => d(""), [i.currentScreen, i.currentDialog]), l(() => {
3619
4029
  let e = (e) => {
@@ -3624,45 +4034,49 @@ function Hs({ scene: e, notes: t, routeState: n, strings: r, navigation: i, them
3624
4034
  }, []), l(() => {
3625
4035
  let t = (t) => {
3626
4036
  let n = t.detail, r = n.destination ?? (n.dialog ? {
3627
- kind: _.Dialog,
4037
+ kind: v.Dialog,
3628
4038
  dialog: n.dialog
3629
4039
  } : n.targetScreen ? { screen: n.targetScreen } : void 0);
3630
4040
  r && (r.dialog === void 0 ? r.screen !== void 0 && !e.screens.some((e) => e.name === r.screen) ? d(`The modeled screen “${r.screen}” is not available.`) : f(r) : e.dialogTemplates?.some((e) => e.name === r.dialog) ? f(r) : d(`The modeled dialog “${r.dialog}” is not available in this Stage runtime.`));
3631
4041
  };
3632
4042
  return globalThis.addEventListener("cratis.scene.navigate", t), () => globalThis.removeEventListener("cratis.scene.navigate", t);
3633
- }, [f, e]), /* @__PURE__ */ z(ce, {
3634
- registry: As,
3635
- children: /* @__PURE__ */ B(Ae, {
4043
+ }, [f, e]), /* @__PURE__ */ V(_e, {
4044
+ registry: kc,
4045
+ children: /* @__PURE__ */ H($e, {
3636
4046
  themes: a,
3637
4047
  children: [
3638
- o && /* @__PURE__ */ z(vs, {
4048
+ o && /* @__PURE__ */ V(fc, {
3639
4049
  settings: o,
3640
4050
  onSystemSchemeChange: s
3641
4051
  }),
3642
- /* @__PURE__ */ z(ts, {}),
3643
- /* @__PURE__ */ z(Ws, {
4052
+ /* @__PURE__ */ V(Ys, {}),
4053
+ /* @__PURE__ */ V(Uc, {
3644
4054
  scene: e,
3645
4055
  screen: i.primaryScreen,
3646
4056
  notes: t
3647
4057
  }),
3648
- /* @__PURE__ */ z(hn, {
4058
+ /* @__PURE__ */ V(zn, {
3649
4059
  routes: n.routes,
3650
4060
  routesReady: n.ready,
3651
4061
  parameters: i.currentParameters,
3652
4062
  locale: r.locale,
3653
4063
  locales: r.locales,
3654
4064
  screen: i.primaryScreen ?? e.screens[0]?.name ?? "",
3655
- children: /* @__PURE__ */ z(Us, {
4065
+ children: /* @__PURE__ */ V(Hc, {
3656
4066
  activity: u,
3657
4067
  notesEnabled: t.enabled,
3658
4068
  routesReady: n.ready,
3659
4069
  scene: e,
3660
4070
  setActivity: d,
3661
4071
  strings: r,
3662
- children: /* @__PURE__ */ z(Xn, {
4072
+ children: /* @__PURE__ */ V(br, {
3663
4073
  structure: e.structure,
3664
4074
  screens: e.screens,
3665
- children: c
4075
+ children: /* @__PURE__ */ V(Ec, {
4076
+ source: e,
4077
+ screen: i.primaryScreen,
4078
+ children: c
4079
+ })
3666
4080
  })
3667
4081
  })
3668
4082
  })
@@ -3670,14 +4084,14 @@ function Hs({ scene: e, notes: t, routeState: n, strings: r, navigation: i, them
3670
4084
  })
3671
4085
  });
3672
4086
  }
3673
- function Us({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivity: i, strings: a, children: o }) {
3674
- let s = W(), c = Te(), l = Vt(), u = f(() => Es(l, n, s.refreshAfterCommand), [
4087
+ function Hc({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivity: i, strings: a, children: o }) {
4088
+ let s = W(), c = He(), l = dn(), u = f(() => xc(l, n, s.refreshAfterCommand), [
3675
4089
  l,
3676
4090
  n,
3677
4091
  s.refreshAfterCommand
3678
- ]), d = f(() => ws(r.commandSchemas), [r.commandSchemas]), p = ve({
4092
+ ]), d = f(() => yc(r.commandSchemas), [r.commandSchemas]), p = Me({
3679
4093
  executeCommand: async (e, t) => {
3680
- let r = H(e);
4094
+ let r = on(e);
3681
4095
  if (!r && !n) return i(`The modeled command “${e}” is waiting for Stage routes.`), {
3682
4096
  isSuccess: !1,
3683
4097
  validationErrors: []
@@ -3694,13 +4108,13 @@ function Us({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivit
3694
4108
  };
3695
4109
  },
3696
4110
  navigate: (e, t) => {
3697
- r.screens.some((t) => t.name === e) ? U(e, Kt(t)) : i(`The modeled screen “${e}” is not available.`);
4111
+ r.screens.some((t) => t.name === e) ? pn(e, _n(t)) : i(`The modeled screen “${e}” is not available.`);
3698
4112
  },
3699
4113
  navigateBack: () => globalThis.history?.back(),
3700
4114
  openDialog: async (e) => {
3701
4115
  let t = r.dialogTemplates?.find((t) => t.name === e);
3702
4116
  return t ? (c.navigate({
3703
- kind: _.Dialog,
4117
+ kind: v.Dialog,
3704
4118
  dialog: t.name
3705
4119
  }), { isConfirmed: !0 }) : (i(`The modeled dialog “${e}” is not available in this Stage runtime.`), { isConfirmed: !1 });
3706
4120
  },
@@ -3711,7 +4125,7 @@ function Us({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivit
3711
4125
  refreshQuery: async (e) => s.refreshQuery(e),
3712
4126
  raise: async (e) => i(`The modeled trigger “${e}” is not available in this Stage runtime.`)
3713
4127
  });
3714
- return /* @__PURE__ */ z(Go, {
4128
+ return /* @__PURE__ */ V(Bs, {
3715
4129
  state: {
3716
4130
  locales: a.locales,
3717
4131
  locale: a.locale,
@@ -3719,16 +4133,16 @@ function Us({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivit
3719
4133
  activity: e,
3720
4134
  notesEnabled: t
3721
4135
  },
3722
- children: /* @__PURE__ */ z(me, {
4136
+ children: /* @__PURE__ */ V(De, {
3723
4137
  invoker: u,
3724
- children: /* @__PURE__ */ z(fe, {
4138
+ children: /* @__PURE__ */ V(Te, {
3725
4139
  fieldsFor: d,
3726
- children: /* @__PURE__ */ z(le, {
4140
+ children: /* @__PURE__ */ V(ve, {
3727
4141
  dispatcher: p,
3728
4142
  context: {
3729
4143
  resolve: s.resolveBinding,
3730
4144
  localize: (e) => a.dictionary[e] ?? e,
3731
- responseContracts: rs(r.responseContracts)
4145
+ responseContracts: Zs(r.responseContracts)
3732
4146
  },
3733
4147
  attachments: [],
3734
4148
  onFindings: (e) => i(e.map((e) => e.detail).join(" ")),
@@ -3738,20 +4152,20 @@ function Us({ activity: e, notesEnabled: t, routesReady: n, scene: r, setActivit
3738
4152
  })
3739
4153
  });
3740
4154
  }
3741
- function Ws({ scene: e, screen: t, notes: r }) {
4155
+ function Uc({ scene: e, screen: t, notes: r }) {
3742
4156
  return n({
3743
- screen: Jn(e.screens.find((e) => e.name === t)),
4157
+ screen: vr(e.screens.find((e) => e.name === t)),
3744
4158
  values: { modelReferences: r.modelReferences }
3745
4159
  }), null;
3746
4160
  }
3747
- function Gs({ element: e, configuration: t, registry: n }) {
3748
- let r = W(), i = jn(), a = we();
3749
- return /* @__PURE__ */ z(Zn, {
4161
+ function Wc({ element: e, configuration: t, registry: n }) {
4162
+ let r = W(), i = tr(), a = Be();
4163
+ return /* @__PURE__ */ V(xr, {
3750
4164
  screen: a?.primaryScreen,
3751
- children: /* @__PURE__ */ B(Ur, {
4165
+ children: /* @__PURE__ */ H(pi, {
3752
4166
  element: e,
3753
4167
  outputScope: i.scope,
3754
- children: [/* @__PURE__ */ z(no, { element: e }), /* @__PURE__ */ z(ue, {
4168
+ children: [/* @__PURE__ */ V(Jo, { element: e }), /* @__PURE__ */ V(be, {
3755
4169
  element: e,
3756
4170
  registry: n,
3757
4171
  resolveBinding: r.resolveBinding,
@@ -3762,27 +4176,27 @@ function Gs({ element: e, configuration: t, registry: n }) {
3762
4176
  })
3763
4177
  });
3764
4178
  }
3765
- function Ks({ template: e, content: t, registry: n, strings: r, close: i }) {
3766
- let a = W(), o = jn(), s = ne(t, r.dictionary);
4179
+ function Gc({ template: e, content: t, registry: n, strings: r, close: i }) {
4180
+ let a = W(), o = tr(), s = se(t, r.dictionary);
3767
4181
  return l(() => {
3768
4182
  let e = (e) => {
3769
4183
  e.key === "Escape" && i();
3770
4184
  };
3771
4185
  return globalThis.addEventListener("keydown", e), () => globalThis.removeEventListener("keydown", e);
3772
- }, [i]), /* @__PURE__ */ z("div", {
4186
+ }, [i]), /* @__PURE__ */ V("div", {
3773
4187
  className: "stage-dialog-backdrop",
3774
- children: /* @__PURE__ */ B("section", {
4188
+ children: /* @__PURE__ */ H("section", {
3775
4189
  role: "dialog",
3776
4190
  "aria-modal": "true",
3777
4191
  "aria-label": e.displayName ?? e.name,
3778
4192
  className: "stage-dialog",
3779
- children: [/* @__PURE__ */ z("button", {
4193
+ children: [/* @__PURE__ */ V("button", {
3780
4194
  type: "button",
3781
4195
  onClick: i,
3782
4196
  children: "Close"
3783
- }), /* @__PURE__ */ z(Ur, {
4197
+ }), /* @__PURE__ */ V(pi, {
3784
4198
  element: s,
3785
- children: /* @__PURE__ */ z(ue, {
4199
+ children: /* @__PURE__ */ V(be, {
3786
4200
  element: s,
3787
4201
  registry: n,
3788
4202
  resolveBinding: a.resolveBinding,
@@ -3793,4 +4207,4 @@ function Ks({ template: e, content: t, registry: n, strings: r, close: i }) {
3793
4207
  })
3794
4208
  });
3795
4209
  }
3796
- export { Bs as App, Bs as StageApplication, ii as StageCommandForm, hn as StageDataProvider, rn as StageGuardedAction, _t as StageSourceProvider, Ls as composeStageScreen, Es as createStageSliceInvoker, bn as dataChanged, zt as executeRegisteredCommand, Ln as fetchModelReferences, wt as hostedBasePath, Mo as listsPrimeReact, Rn as modelReferenceFor, zn as modelReferenceMap, jt as performQuery, Vn as readStageNotes, Dt as registerQueryRouteResolver, No as registerStageLibrary, H as registeredCommand, Ot as registeredQuery, ws as sliceFieldsFrom, js as stageApplicationRegistry, Fs as stageComposition, e as stageDarkSelector, ht as stageEndpoints, Ns as stageShellOf, mt as staticStageSource, Mt as subscribeQuery, Vt as useStageCommandExecutor, W as useStageData, G as useStageQuery, vt as useStageSource };
4210
+ export { zc as App, zc as StageApplication, Oi as StageCommandForm, zn as StageDataProvider, On as StageGuardedAction, zt as StageSourceProvider, Ic as composeStageScreen, xc as createStageSliceInvoker, Wn as dataChanged, ln as executeRegisteredCommand, sr as fetchModelReferences, Kt as hostedBasePath, Cs as listsPrimeReact, cr as modelReferenceFor, lr as modelReferenceMap, $t as performQuery, dr as readStageNotes, Yt as registerQueryRouteResolver, ws as registerStageLibrary, on as registeredCommand, Xt as registeredQuery, yc as sliceFieldsFrom, Ac as stageApplicationRegistry, Pc as stageComposition, e as stageDarkSelector, Lt as stageEndpoints, Mc as stageShellOf, It as staticStageSource, en as subscribeQuery, dn as useStageCommandExecutor, W as useStageData, G as useStageQuery, Bt as useStageSource };