@golemui/gui-shared 1.0.1 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 1.0.2 (2026-06-26)
2
+
3
+ This was a version bump only for gui-shared to align it with other projects, there were no code changes.
4
+
5
+ ## 1.0.1 (2026-06-15)
6
+
7
+ This was a version bump only for gui-shared to align it with other projects, there were no code changes.
8
+
1
9
  # 1.0.0 (2026-06-14)
2
10
 
3
11
  ### 🚀 Features
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as d, a as y, b as g, c, d as h, e as _, f as B, g as U, h as m, i as k, j as f, k as w, l as I, m as x, n as D, o as C, p as b, q as A, r as R, s as P, t as T, u as L, v as M, w as $, x as F, y as v, z, A as G, B as j, C as O, D as E, E as H, F as N, G as V, H as q, I as W, J as K, K as Q, L as S, M as X, N as Y, O as Z, P as J, Q as ss, R as as, S as ts, T as rs, U as is, V as es, W as ns, X as us, Y as ls, Z as ps, $ as os, a0 as ds, a1 as ys, a2 as gs, a3 as cs, a4 as hs, a5 as _s, a6 as Bs, a7 as Us, a8 as ms, a9 as ks, aa as fs, ab as ws, ac as Is, ad as xs, ae as Ds, af as Cs, ag as bs, ah as As, ai as Rs, aj as Ps, ak as Ts, al as Ls, am as Ms, an as $s, ao as Fs, ap as vs, aq as zs, ar as Gs, as as js, at as Os, au as Es, av as Hs, aw as Ns, ax as Vs, ay as qs, az as Ws, aA as Ks, aB as Qs, aC as Ss, aD as Xs, aE as Ys } from "./register-BxVKv9Qh.js";
1
+ import { _ as d, a as y, b as g, c, d as h, e as _, f as B, g as U, h as m, i as k, j as f, k as w, l as I, m as x, n as D, o as C, p as b, q as A, r as R, s as P, t as T, u as L, v as M, w as $, x as F, y as v, z, A as G, B as j, C as O, D as E, E as H, F as N, G as V, H as q, I as W, J as K, K as Q, L as S, M as X, N as Y, O as Z, P as J, Q as ss, R as as, S as ts, T as rs, U as is, V as es, W as ns, X as us, Y as ls, Z as ps, $ as os, a0 as ds, a1 as ys, a2 as gs, a3 as cs, a4 as hs, a5 as _s, a6 as Bs, a7 as Us, a8 as ms, a9 as ks, aa as fs, ab as ws, ac as Is, ad as xs, ae as Ds, af as Cs, ag as bs, ah as As, ai as Rs, aj as Ps, ak as Ts, al as Ls, am as Ms, an as $s, ao as Fs, ap as vs, aq as zs, ar as Gs, as as js, at as Os, au as Es, av as Hs, aw as Ns, ax as Vs, ay as qs, az as Ws, aA as Ks, aB as Qs, aC as Ss, aD as Xs, aE as Ys } from "./register-BaJnbpMX.js";
2
2
  import "@golemui/core";
3
3
  class e {
4
4
  constructor(s) {
package/index.umd.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./register-dBzdQbWZ.cjs");require("@golemui/core");class a{constructor(t){this.conditions=t}static root(){return new a([])}tag(t){return new a([...this.conditions,{kind:"tagsAnd",tags:[t]}])}state(t){return new a([...this.conditions,{kind:"state",name:t}])}tagsAnd(t){return new a([...this.conditions,{kind:"tagsAnd",tags:t}])}tagsOr(t){return new a([...this.conditions,{kind:"tagsOr",tags:t}])}apply(t){if(this.conditions.length===0)return t;const r=this.conditions.find(n=>n.kind==="state"),i=this.conditions.filter(n=>n.kind!=="state"),u=t.matcher;return{...t,matcher:n=>{if(!u(n))return!1;for(const l of i){const d=n.tags??[];if(l.kind==="tagsAnd"){for(const o of l.tags)if(!d.includes(o))return!1}else{if(l.tags.length===0)continue;if(!l.tags.some(o=>d.includes(o)))return!1}}return!0},...r?{targetState:r.name}:{}}}inputs(t){return this.apply(s._gslInputs(t))}inputByUid(t,r){return this.apply(s._gslInputByUid(t,r))}textInputs(t){return this.apply(s._gslTextInputs(t))}numberInputs(t){return this.apply(s._gslNumberInputs(t))}booleanInputs(t){return this.apply(s._gslBooleanInputs(t))}selects(t){return this.apply(s._gslSelects(t))}selectByUid(t,r){return this.apply(s._gslSelectByUid(t,r))}dropdowns(t){return this.apply(s._gslDropdowns(t))}dropdownByUid(t,r){return this.apply(s._gslDropdownByUid(t,r))}radiogroups(t){return this.apply(s._gslRadiogroups(t))}radiogroupByUid(t,r){return this.apply(s._gslRadiogroupByUid(t,r))}checkboxes(t){return this.apply(s._gslCheckboxes(t))}checkboxByUid(t,r){return this.apply(s._gslCheckboxByUid(t,r))}textareas(t){return this.apply(s._gslTextareas(t))}textareaByUid(t,r){return this.apply(s._gslTextareaByUid(t,r))}passwords(t){return this.apply(s._gslPasswords(t))}passwordByUid(t,r){return this.apply(s._gslPasswordByUid(t,r))}currencies(t){return this.apply(s._gslCurrencies(t))}currencyByUid(t,r){return this.apply(s._gslCurrencyByUid(t,r))}markdowns(t){return this.apply(s._gslMarkdowns(t))}markdownByUid(t,r){return this.apply(s._gslMarkdownByUid(t,r))}lists(t){return this.apply(s._gslLists(t))}listByUid(t,r){return this.apply(s._gslListByUid(t,r))}calendars(t){return this.apply(s._gslCalendars(t))}calendarByUid(t,r){return this.apply(s._gslCalendarByUid(t,r))}dateInputs(t){return this.apply(s._gslDateInputs(t))}dateInputByUid(t,r){return this.apply(s._gslDateInputByUid(t,r))}datePickers(t){return this.apply(s._gslDatePickers(t))}datePickerByUid(t,r){return this.apply(s._gslDatePickerByUid(t,r))}rangeCalendars(t){return this.apply(s._gslRangeCalendars(t))}rangeCalendarByUid(t,r){return this.apply(s._gslRangeCalendarByUid(t,r))}rangeDateInputs(t){return this.apply(s._gslRangeDateInputs(t))}rangeDateInputByUid(t,r){return this.apply(s._gslRangeDateInputByUid(t,r))}rangeDatePickers(t){return this.apply(s._gslRangeDatePickers(t))}rangeDatePickerByUid(t,r){return this.apply(s._gslRangeDatePickerByUid(t,r))}repeaters(t){return this.apply(s._gslRepeaters(t))}repeaterByUid(t,r){return this.apply(s._gslRepeaterByUid(t,r))}actions(t){return this.apply(s._gslActions(t))}actionByUid(t,r){return this.apply(s._gslActionByUid(t,r))}layouts(t){return this.apply(s._gslLayouts(t))}layoutByUid(t,r){return this.apply(s._gslLayoutByUid(t,r))}displays(t){return this.apply(s._gslDisplays(t))}displayByUid(t,r){return this.apply(s._gslDisplayByUid(t,r))}alerts(t){return this.apply(s._gslAlerts(t))}alertByUid(t,r){return this.apply(s._gslAlertByUid(t,r))}markdownTexts(t){return this.apply(s._gslMarkdownTexts(t))}markdownTextByUid(t,r){return this.apply(s._gslMarkdownTextByUid(t,r))}tabs(t){return this.apply(s._gslTabs(t))}tabsByUid(t,r){return this.apply(s._gslTabsByUid(t,r))}accordions(t){return this.apply(s._gslAccordions(t))}accordionByUid(t,r){return this.apply(s._gslAccordionByUid(t,r))}customInputs(t){return this.apply(s._gslCustomInputs(t))}customInputByUid(t,r){return this.apply(s._gslCustomInputByUid(t,r))}customActions(t){return this.apply(s._gslCustomActions(t))}customActionByUid(t,r){return this.apply(s._gslCustomActionByUid(t,r))}customDisplays(t){return this.apply(s._gslCustomDisplays(t))}customDisplayByUid(t,r){return this.apply(s._gslCustomDisplayByUid(t,r))}customLayouts(t){return this.apply(s._gslCustomLayouts(t))}customLayoutByUid(t,r){return this.apply(s._gslCustomLayoutByUid(t,r))}}const y={inputs:{textInput:s._guiTextInput,numberInput:s._guiNumberInput,booleanInput:s._guiBooleanInput,select:s._guiSelect,dropdown:s._guiDropdown,radiogroup:s._guiRadiogroup,checkbox:s._guiCheckbox,textarea:s._guiTextarea,password:s._guiPassword,currency:s._guiCurrency,markdown:s._guiMarkdown,list:s._guiList,calendar:s._guiCalendar,dateInput:s._guiDateInput,datePicker:s._guiDatePicker,rangeCalendar:s._guiRangeCalendar,rangeDateInput:s._guiRangeDateInput,rangeDatePicker:s._guiRangeDatePicker,repeater:s._guiRepeater,tags:s._guiTags,custom:s._guiCustomInput},actions:{button:s._guiButton,custom:s._guiCustomAction},displays:{display:s._guiDisplay,alert:s._guiAlert,markdownText:s._guiMarkdownText,custom:s._guiCustomDisplay},layouts:{flex:s._guiFlex,horizontalFlex:s._guiHorizontalFlex,verticalFlex:s._guiVerticalFlex,grid:s._guiGrid,horizontalGrid:s._guiHorizontalGrid,verticalGrid:s._guiVerticalGrid,tabs:s._guiTabs,accordion:s._guiAccordion,custom:s._guiCustomLayout},selectors:a.root()};function g(e){return typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&Object.keys(e).length===1}async function c(e,t){const r=new URL(e,t).href,i=await fetch(r);if(!i.ok)throw new Error(`Failed to load form chunk ${r}: ${i.status}`);const{$schema:u,...n}=await i.json();return p(n,r)}async function p(e,t){if(g(e))return c(e.$ref,t);const r=e;if(Array.isArray(r.children)){const i=await Promise.all(r.children.map(u=>p(u,t)));return{...r,children:i}}return e}async function h(e,t){const r=await Promise.all(e.form.map(i=>p(i,t)));return{...e,form:r}}exports.gui=y;exports.resolveChunkRefs=h;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./register-BHpCnzXI.cjs");require("@golemui/core");class a{constructor(t){this.conditions=t}static root(){return new a([])}tag(t){return new a([...this.conditions,{kind:"tagsAnd",tags:[t]}])}state(t){return new a([...this.conditions,{kind:"state",name:t}])}tagsAnd(t){return new a([...this.conditions,{kind:"tagsAnd",tags:t}])}tagsOr(t){return new a([...this.conditions,{kind:"tagsOr",tags:t}])}apply(t){if(this.conditions.length===0)return t;const r=this.conditions.find(n=>n.kind==="state"),i=this.conditions.filter(n=>n.kind!=="state"),u=t.matcher;return{...t,matcher:n=>{if(!u(n))return!1;for(const l of i){const d=n.tags??[];if(l.kind==="tagsAnd"){for(const o of l.tags)if(!d.includes(o))return!1}else{if(l.tags.length===0)continue;if(!l.tags.some(o=>d.includes(o)))return!1}}return!0},...r?{targetState:r.name}:{}}}inputs(t){return this.apply(s._gslInputs(t))}inputByUid(t,r){return this.apply(s._gslInputByUid(t,r))}textInputs(t){return this.apply(s._gslTextInputs(t))}numberInputs(t){return this.apply(s._gslNumberInputs(t))}booleanInputs(t){return this.apply(s._gslBooleanInputs(t))}selects(t){return this.apply(s._gslSelects(t))}selectByUid(t,r){return this.apply(s._gslSelectByUid(t,r))}dropdowns(t){return this.apply(s._gslDropdowns(t))}dropdownByUid(t,r){return this.apply(s._gslDropdownByUid(t,r))}radiogroups(t){return this.apply(s._gslRadiogroups(t))}radiogroupByUid(t,r){return this.apply(s._gslRadiogroupByUid(t,r))}checkboxes(t){return this.apply(s._gslCheckboxes(t))}checkboxByUid(t,r){return this.apply(s._gslCheckboxByUid(t,r))}textareas(t){return this.apply(s._gslTextareas(t))}textareaByUid(t,r){return this.apply(s._gslTextareaByUid(t,r))}passwords(t){return this.apply(s._gslPasswords(t))}passwordByUid(t,r){return this.apply(s._gslPasswordByUid(t,r))}currencies(t){return this.apply(s._gslCurrencies(t))}currencyByUid(t,r){return this.apply(s._gslCurrencyByUid(t,r))}markdowns(t){return this.apply(s._gslMarkdowns(t))}markdownByUid(t,r){return this.apply(s._gslMarkdownByUid(t,r))}lists(t){return this.apply(s._gslLists(t))}listByUid(t,r){return this.apply(s._gslListByUid(t,r))}calendars(t){return this.apply(s._gslCalendars(t))}calendarByUid(t,r){return this.apply(s._gslCalendarByUid(t,r))}dateInputs(t){return this.apply(s._gslDateInputs(t))}dateInputByUid(t,r){return this.apply(s._gslDateInputByUid(t,r))}datePickers(t){return this.apply(s._gslDatePickers(t))}datePickerByUid(t,r){return this.apply(s._gslDatePickerByUid(t,r))}rangeCalendars(t){return this.apply(s._gslRangeCalendars(t))}rangeCalendarByUid(t,r){return this.apply(s._gslRangeCalendarByUid(t,r))}rangeDateInputs(t){return this.apply(s._gslRangeDateInputs(t))}rangeDateInputByUid(t,r){return this.apply(s._gslRangeDateInputByUid(t,r))}rangeDatePickers(t){return this.apply(s._gslRangeDatePickers(t))}rangeDatePickerByUid(t,r){return this.apply(s._gslRangeDatePickerByUid(t,r))}repeaters(t){return this.apply(s._gslRepeaters(t))}repeaterByUid(t,r){return this.apply(s._gslRepeaterByUid(t,r))}actions(t){return this.apply(s._gslActions(t))}actionByUid(t,r){return this.apply(s._gslActionByUid(t,r))}layouts(t){return this.apply(s._gslLayouts(t))}layoutByUid(t,r){return this.apply(s._gslLayoutByUid(t,r))}displays(t){return this.apply(s._gslDisplays(t))}displayByUid(t,r){return this.apply(s._gslDisplayByUid(t,r))}alerts(t){return this.apply(s._gslAlerts(t))}alertByUid(t,r){return this.apply(s._gslAlertByUid(t,r))}markdownTexts(t){return this.apply(s._gslMarkdownTexts(t))}markdownTextByUid(t,r){return this.apply(s._gslMarkdownTextByUid(t,r))}tabs(t){return this.apply(s._gslTabs(t))}tabsByUid(t,r){return this.apply(s._gslTabsByUid(t,r))}accordions(t){return this.apply(s._gslAccordions(t))}accordionByUid(t,r){return this.apply(s._gslAccordionByUid(t,r))}customInputs(t){return this.apply(s._gslCustomInputs(t))}customInputByUid(t,r){return this.apply(s._gslCustomInputByUid(t,r))}customActions(t){return this.apply(s._gslCustomActions(t))}customActionByUid(t,r){return this.apply(s._gslCustomActionByUid(t,r))}customDisplays(t){return this.apply(s._gslCustomDisplays(t))}customDisplayByUid(t,r){return this.apply(s._gslCustomDisplayByUid(t,r))}customLayouts(t){return this.apply(s._gslCustomLayouts(t))}customLayoutByUid(t,r){return this.apply(s._gslCustomLayoutByUid(t,r))}}const y={inputs:{textInput:s._guiTextInput,numberInput:s._guiNumberInput,booleanInput:s._guiBooleanInput,select:s._guiSelect,dropdown:s._guiDropdown,radiogroup:s._guiRadiogroup,checkbox:s._guiCheckbox,textarea:s._guiTextarea,password:s._guiPassword,currency:s._guiCurrency,markdown:s._guiMarkdown,list:s._guiList,calendar:s._guiCalendar,dateInput:s._guiDateInput,datePicker:s._guiDatePicker,rangeCalendar:s._guiRangeCalendar,rangeDateInput:s._guiRangeDateInput,rangeDatePicker:s._guiRangeDatePicker,repeater:s._guiRepeater,tags:s._guiTags,custom:s._guiCustomInput},actions:{button:s._guiButton,custom:s._guiCustomAction},displays:{display:s._guiDisplay,alert:s._guiAlert,markdownText:s._guiMarkdownText,custom:s._guiCustomDisplay},layouts:{flex:s._guiFlex,horizontalFlex:s._guiHorizontalFlex,verticalFlex:s._guiVerticalFlex,grid:s._guiGrid,horizontalGrid:s._guiHorizontalGrid,verticalGrid:s._guiVerticalGrid,tabs:s._guiTabs,accordion:s._guiAccordion,custom:s._guiCustomLayout},selectors:a.root()};function g(e){return typeof e=="object"&&e!==null&&"$ref"in e&&typeof e.$ref=="string"&&Object.keys(e).length===1}async function c(e,t){const r=new URL(e,t).href,i=await fetch(r);if(!i.ok)throw new Error(`Failed to load form chunk ${r}: ${i.status}`);const{$schema:u,...n}=await i.json();return p(n,r)}async function p(e,t){if(g(e))return c(e.$ref,t);const r=e;if(Array.isArray(r.children)){const i=await Promise.all(r.children.map(u=>p(u,t)));return{...r,children:i}}return e}async function h(e,t){const r=await Promise.all(e.form.map(i=>p(i,t)));return{...e,form:r}}exports.gui=y;exports.resolveChunkRefs=h;
package/internals.js CHANGED
@@ -1,14 +1,14 @@
1
- import { aF as I, aG as m, aH as M, ah as B, aI as j, aJ as L } from "./register-BxVKv9Qh.js";
2
- import { X as me, W as he, L as Se, K as be, R as Te, Q as De, d as Ae, x as Oe, w as Ue, l as Ie, k as Ee, q as Re, r as we, a0 as ve, $ as xe, a2 as Ce, a1 as ke, Z as Me, Y as Be, a4 as je, a3 as Le, z as Pe, y as Ne, B as Fe, A as We, P as ze, O as Ge, h as $e, g as Ke, a as Ye, _ as Ve, N as He, M as Xe, v as qe, u as Je, t as Qe, T as Ze, S as et, s as tt, c as st, p as at, o as nt, j as rt, i as ot, D as it, C as lt, F as ct, E as ut, H as pt, G as dt, J as ft, I as gt, f as yt, e as _t, U as mt, V as ht, aK as St, aL as bt, b as Tt, n as Dt, m as At, a6 as Ot, ag as Ut, aC as It, aj as Et, as as Rt, ay as wt, av as vt, ai as xt, ae as Ct, ak as kt, a5 as Mt, ar as Bt, aq as jt, aA as Lt, ad as Pt, aa as Nt, ac as Ft, a9 as Wt, at as zt, au as Gt, af as $t, aD as Kt, aw as Yt, az as Vt, ap as Ht, ao as Xt, an as qt, am as Jt, aB as Qt, a7 as Zt, al as es, aE as ts, ax as ss, ab as as, a8 as ns, aM as rs, aN as os, aO as is, aP as ls, aQ as cs } from "./register-BxVKv9Qh.js";
1
+ import { aF as I, aG as m, aH as M, aI as B, ah as j, aJ as L, aK as F } from "./register-BaJnbpMX.js";
2
+ import { X as he, W as Se, L as be, K as Te, R as De, Q as Ae, d as Oe, x as Ue, w as Ie, l as Ee, k as Re, q as we, r as ve, a0 as xe, $ as Ce, a2 as ke, a1 as Me, Z as Be, Y as je, a4 as Le, a3 as Fe, z as Ne, y as Pe, B as We, A as ze, P as Ge, O as $e, h as Ke, g as Ye, a as Ve, _ as He, N as Xe, M as qe, v as Je, u as Qe, t as Ze, T as et, S as tt, s as st, c as at, p as nt, o as rt, j as ot, i as it, D as lt, C as ct, F as ut, E as pt, H as dt, G as ft, J as gt, I as yt, f as _t, e as mt, U as ht, V as St, aL as bt, aM as Tt, b as Dt, n as At, m as Ot, a6 as Ut, ag as It, aC as Et, aj as Rt, as as wt, ay as vt, av as xt, ai as Ct, ae as kt, ak as Mt, a5 as Bt, ar as jt, aq as Lt, aA as Ft, ad as Nt, aa as Pt, ac as Wt, a9 as zt, at as Gt, au as $t, af as Kt, aD as Yt, aw as Vt, az as Ht, ap as Xt, ao as qt, an as Jt, am as Qt, aB as Zt, a7 as es, al as ts, aE as ss, ax as as, ab as ns, a8 as rs, aN as os, aO as is, aP as ls, aQ as cs, aR as us } from "./register-BaJnbpMX.js";
3
3
  import "@golemui/core";
4
4
  import "@golemui/gui-validators";
5
- function ce(o, ...e) {
5
+ function ue(o, ...e) {
6
6
  return e.map((t) => ({
7
7
  ...t,
8
8
  targetState: o
9
9
  }));
10
10
  }
11
- function ue(o, ...e) {
11
+ function pe(o, ...e) {
12
12
  return {
13
13
  kind: "aggregated",
14
14
  matcher: (t) => t.tags?.includes(o) ?? !1,
@@ -41,11 +41,11 @@ const E = {
41
41
  DISPLAYS: /* @__PURE__ */ new Set(["DISPLAYS", "ALERTS", "MARKDOWN_TEXTS", "CUSTOM_DISPLAY"]),
42
42
  LAYOUTS: /* @__PURE__ */ new Set(["LAYOUTS", "TABS", "ACCORDION", "CUSTOM_LAYOUT"])
43
43
  };
44
- function P(o, e) {
44
+ function N(o, e) {
45
45
  const t = E[o];
46
46
  return t ? t.has(e) : o === e;
47
47
  }
48
- class N {
48
+ class P {
49
49
  resolve(e, t) {
50
50
  const a = [];
51
51
  for (const n of t)
@@ -62,7 +62,7 @@ class N {
62
62
  this.collectFromLeaf(s, t, a);
63
63
  }
64
64
  collectFromLeaf(e, t, a) {
65
- P(e.selectorType, t.itemType ?? "") && e.matcher(t) && a.push(e);
65
+ N(e.selectorType, t.itemType ?? "") && e.matcher(t) && a.push(e);
66
66
  }
67
67
  rollUpSensibleDefaults(e) {
68
68
  const t = /* @__PURE__ */ new Map(), a = (n, r) => {
@@ -82,8 +82,8 @@ class N {
82
82
  return s;
83
83
  }
84
84
  }
85
- const F = new N();
86
- class W {
85
+ const W = new P();
86
+ class z {
87
87
  /**
88
88
  * Deep merges two objects, with right taking precedence over left when properties conflict.
89
89
  * Arrays are replaced, not merged.
@@ -102,8 +102,8 @@ class W {
102
102
  return a;
103
103
  }
104
104
  }
105
- const z = new W();
106
- class G {
105
+ const G = new z();
106
+ class $ {
107
107
  constructor(e) {
108
108
  this.objectUtils = e;
109
109
  }
@@ -184,8 +184,8 @@ class G {
184
184
  };
185
185
  }
186
186
  }
187
- const $ = new G(z);
188
- class K {
187
+ const K = new $(G);
188
+ class Y {
189
189
  mapToWidget(e, t) {
190
190
  if (e.kind === "dynamic") {
191
191
  const a = e.fn;
@@ -208,8 +208,8 @@ class K {
208
208
  return t.size != null && (e.size = t.size), t.defaultValue != null && e.kind === "input" && (e.defaultValue = t.defaultValue), t.on != null && (e.on = t.on), t.include != null && (e.include = t.include), t.exclude != null && (e.exclude = t.exclude), e;
209
209
  }
210
210
  }
211
- const Y = new K();
212
- class V {
211
+ const V = new Y();
212
+ class H {
213
213
  /**
214
214
  * Ensures the output is always a uniform GslSelector[] of aggregated selectors.
215
215
  *
@@ -234,7 +234,7 @@ class V {
234
234
  };
235
235
  }
236
236
  }
237
- const H = new V(), X = {
237
+ const X = new H(), q = {
238
238
  input: /* @__PURE__ */ new Set(["disabled", "readonly", "label", "validator", "size"]),
239
239
  action: /* @__PURE__ */ new Set(["disabled", "label", "size"]),
240
240
  layout: /* @__PURE__ */ new Set(["size"]),
@@ -245,7 +245,7 @@ const H = new V(), X = {
245
245
  onFilter: "filter",
246
246
  onClick: "click"
247
247
  };
248
- class q {
248
+ class J {
249
249
  /**
250
250
  * Extracts `states` from a merge result, combining with state-targeted
251
251
  * GSL leaf selectors from `_gslStates`.
@@ -295,7 +295,7 @@ class q {
295
295
  const { stateOverrides: n } = t;
296
296
  if (Object.keys(n).length === 0)
297
297
  return e;
298
- const r = { ...e }, i = e.kind, l = X[i] || /* @__PURE__ */ new Set();
298
+ const r = { ...e }, i = e.kind, l = q[i] || /* @__PURE__ */ new Set();
299
299
  e.props && (r.props = { ...e.props }), e.on && (r.on = { ...e.on });
300
300
  for (const [c, u] of Object.entries(n))
301
301
  for (const [p, f] of Object.entries(u))
@@ -329,17 +329,17 @@ class q {
329
329
  } else typeof s == "string" && (e.on[`${i}.${t}`] = s);
330
330
  }
331
331
  }
332
- const J = new q();
333
- function Q() {
332
+ const Q = new J();
333
+ function Z() {
334
334
  let o = 0;
335
335
  return { next: () => `event_${o++}` };
336
336
  }
337
- class Z {
337
+ class ee {
338
338
  constructor(e, t, a, s, n) {
339
339
  this.resolver = e, this.merger = t, this.mapper = a, this.eventWiring = s, this.stateExpansion = n;
340
340
  }
341
341
  walkAndMap(e, t, a) {
342
- const s = /* @__PURE__ */ new Map(), n = Q(), r = { value: 0 }, i = /* @__PURE__ */ new Set();
342
+ const s = /* @__PURE__ */ new Map(), n = Z(), r = { value: 0 }, i = /* @__PURE__ */ new Set();
343
343
  return { widgets: this.walkItems(
344
344
  e,
345
345
  t,
@@ -450,7 +450,7 @@ class Z {
450
450
  buildBaseDef(e) {
451
451
  const t = e.baseDef;
452
452
  return typeof t == "function" ? (a) => {
453
- const n = t(a ?? {});
453
+ const s = B(a), n = t(s);
454
454
  return e.path != null ? { ...n, path: e.path } : n;
455
455
  } : e.path != null ? { ...t, path: e.path } : t;
456
456
  }
@@ -461,7 +461,7 @@ class Z {
461
461
  return { itemType: t, tags: s, uid: n, type: r };
462
462
  }
463
463
  }
464
- class ee {
464
+ class te {
465
465
  constructor(e, t) {
466
466
  this.selectorNormalizer = e, this.walker = t;
467
467
  }
@@ -489,7 +489,7 @@ class ee {
489
489
  */
490
490
  prepareForm(e, t, a) {
491
491
  const n = (Array.isArray(e) ? [...e] : [e]).map(
492
- (l) => typeof l == "function" ? B(l) : l
492
+ (l) => typeof l == "function" ? j(l) : l
493
493
  ), r = this.selectorNormalizer.normalizeSelectors(t), i = {
494
494
  ...this.selectorNormalizer.extractFormConfig(),
495
495
  ...a
@@ -500,7 +500,7 @@ class ee {
500
500
  children: n
501
501
  };
502
502
  return {
503
- defs: [{ type: "ITEMS", itemType: j.LAYOUTS, items: [l], tags: [] }],
503
+ defs: [{ type: "ITEMS", itemType: L.LAYOUTS, items: [l], tags: [] }],
504
504
  gslSelectors: r,
505
505
  formConfig: i
506
506
  };
@@ -546,13 +546,13 @@ class ee {
546
546
  }), a.dependencies && (s.dependencies = a.dependencies), a.widgetLoaders && (s.widgetLoaders = a.widgetLoaders), a.validateOn && (s.validateOn = a.validateOn), a.itemRenderers && (s.itemRenderers = a.itemRenderers), s;
547
547
  }
548
548
  }
549
- const te = new Z(
549
+ const se = new ee(
550
+ W,
551
+ K,
552
+ V,
550
553
  F,
551
- $,
552
- Y,
553
- L,
554
- J
555
- ), se = new ee(H, te);
554
+ Q
555
+ ), ae = new te(X, se);
556
556
  function R(o) {
557
557
  return typeof o == "function" ? !0 : Array.isArray(o) ? o.length === 0 || o.every(A) : A(o);
558
558
  }
@@ -562,7 +562,7 @@ function A(o) {
562
562
  const e = o;
563
563
  return e.type === "ITEMS" && typeof e.itemType == "string";
564
564
  }
565
- function ae(o) {
565
+ function ne(o) {
566
566
  if (!o || typeof o != "object" || Array.isArray(o))
567
567
  return;
568
568
  const e = o.form;
@@ -571,21 +571,21 @@ function ae(o) {
571
571
  "[GolemUI] The gui.* form definition was wrapped in an extra `{ form: ... }` object, so its fields were never resolved. Pass the gui.* array DIRECTLY as formDef (`config={{ formDef: form }}`) and put any named `states` in `formConfig`: `config={{ formDef: form, formConfig: { states } }}`. Do NOT wrap them as a `{ form: [...] }` object."
572
572
  );
573
573
  }
574
- const O = Object.freeze({}), ne = Object.freeze({}), U = /* @__PURE__ */ new WeakMap();
574
+ const O = Object.freeze({}), re = Object.freeze({}), U = /* @__PURE__ */ new WeakMap();
575
575
  function b(o, e) {
576
576
  return o == null ? e : typeof o == "object" ? o : {};
577
577
  }
578
- function pe(o, e, t) {
578
+ function de(o, e, t) {
579
579
  if (!R(o))
580
- return ae(o), { formDef: o };
581
- const a = b(o, O), s = b(e, O), n = b(t, ne);
580
+ return ne(o), { formDef: o };
581
+ const a = b(o, O), s = b(e, O), n = b(t, re);
582
582
  let r = U.get(a);
583
583
  r || (r = /* @__PURE__ */ new WeakMap(), U.set(a, r));
584
584
  let i = r.get(s);
585
585
  i || (i = /* @__PURE__ */ new WeakMap(), r.set(s, i));
586
586
  const l = i.get(n);
587
587
  if (l) return l;
588
- const c = se.processDxFacade(
588
+ const c = ae.processDxFacade(
589
589
  o,
590
590
  e,
591
591
  t
@@ -599,7 +599,7 @@ function pe(o, e, t) {
599
599
  };
600
600
  return i.set(n, u), u;
601
601
  }
602
- class re {
602
+ class oe {
603
603
  create(e) {
604
604
  return {
605
605
  states: e.states,
@@ -612,11 +612,11 @@ class re {
612
612
  };
613
613
  }
614
614
  }
615
- function de() {
616
- return new re();
615
+ function fe() {
616
+ return new oe();
617
617
  }
618
- const fe = (o) => o !== null && typeof o == "object" && Object.prototype.hasOwnProperty.call(o, "label") && Object.prototype.hasOwnProperty.call(o, "value");
619
- function ge(o, e) {
618
+ const ge = (o) => o !== null && typeof o == "object" && Object.prototype.hasOwnProperty.call(o, "label") && Object.prototype.hasOwnProperty.call(o, "value");
619
+ function ye(o, e) {
620
620
  if (o != null && typeof o == "object" && "__rid" in o)
621
621
  return o.__rid;
622
622
  const t = e();
@@ -627,114 +627,114 @@ function ge(o, e) {
627
627
  }), t;
628
628
  }
629
629
  export {
630
- me as _gslAccordionByUid,
631
- he as _gslAccordions,
632
- Se as _gslActionByUid,
633
- be as _gslActions,
634
- Te as _gslAlertByUid,
635
- De as _gslAlerts,
636
- Ae as _gslBooleanInputs,
637
- Oe as _gslCalendarByUid,
638
- Ue as _gslCalendars,
639
- Ie as _gslCheckboxByUid,
640
- Ee as _gslCheckboxes,
641
- Re as _gslCurrencies,
642
- we as _gslCurrencyByUid,
643
- ve as _gslCustomActionByUid,
644
- xe as _gslCustomActions,
645
- Ce as _gslCustomDisplayByUid,
646
- ke as _gslCustomDisplays,
647
- Me as _gslCustomInputByUid,
648
- Be as _gslCustomInputs,
649
- je as _gslCustomLayoutByUid,
650
- Le as _gslCustomLayouts,
651
- Pe as _gslDateInputByUid,
652
- Ne as _gslDateInputs,
653
- Fe as _gslDatePickerByUid,
654
- We as _gslDatePickers,
655
- ze as _gslDisplayByUid,
656
- Ge as _gslDisplays,
657
- $e as _gslDropdownByUid,
658
- Ke as _gslDropdowns,
659
- Ye as _gslInputByUid,
660
- Ve as _gslInputs,
661
- He as _gslLayoutByUid,
662
- Xe as _gslLayouts,
663
- qe as _gslListByUid,
664
- Je as _gslLists,
665
- Qe as _gslMarkdownByUid,
666
- Ze as _gslMarkdownTextByUid,
667
- et as _gslMarkdownTexts,
668
- tt as _gslMarkdowns,
669
- st as _gslNumberInputs,
670
- at as _gslPasswordByUid,
671
- nt as _gslPasswords,
672
- rt as _gslRadiogroupByUid,
673
- ot as _gslRadiogroups,
674
- it as _gslRangeCalendarByUid,
675
- lt as _gslRangeCalendars,
676
- ct as _gslRangeDateInputByUid,
677
- ut as _gslRangeDateInputs,
678
- pt as _gslRangeDatePickerByUid,
679
- dt as _gslRangeDatePickers,
680
- ft as _gslRepeaterByUid,
681
- gt as _gslRepeaters,
682
- yt as _gslSelectByUid,
683
- _t as _gslSelects,
684
- ce as _gslStates,
685
- mt as _gslTabs,
686
- ht as _gslTabsByUid,
687
- ue as _gslTag,
688
- St as _gslTags,
689
- bt as _gslTagsByUid,
690
- Tt as _gslTextInputs,
691
- Dt as _gslTextareaByUid,
692
- At as _gslTextareas,
693
- Ot as _guiAccordion,
694
- Ut as _guiAlert,
695
- It as _guiBooleanInput,
696
- Et as _guiButton,
697
- Rt as _guiCalendar,
698
- wt as _guiCheckbox,
699
- vt as _guiCurrency,
700
- xt as _guiCustomAction,
701
- Ct as _guiCustomDisplay,
702
- kt as _guiCustomInput,
703
- Mt as _guiCustomLayout,
704
- Bt as _guiDateInput,
705
- jt as _guiDatePicker,
706
- B as _guiDisplay,
707
- Lt as _guiDropdown,
708
- Pt as _guiFlex,
709
- Nt as _guiGrid,
710
- Ft as _guiHorizontalFlex,
711
- Wt as _guiHorizontalGrid,
712
- zt as _guiList,
713
- Gt as _guiMarkdown,
714
- $t as _guiMarkdownText,
715
- Kt as _guiNumberInput,
716
- Yt as _guiPassword,
717
- Vt as _guiRadiogroup,
718
- Ht as _guiRangeCalendar,
719
- Xt as _guiRangeDateInput,
720
- qt as _guiRangeDatePicker,
721
- Jt as _guiRepeater,
722
- Qt as _guiSelect,
723
- Zt as _guiTabs,
724
- es as _guiTags,
725
- ts as _guiTextInput,
726
- ss as _guiTextarea,
727
- as as _guiVerticalFlex,
728
- ns as _guiVerticalGrid,
729
- rs as createGslSelector,
730
- os as defineShortcutType,
731
- is as extractWidgetProps,
732
- se as formDefs,
733
- ge as getItemKey,
734
- de as golemForm,
630
+ he as _gslAccordionByUid,
631
+ Se as _gslAccordions,
632
+ be as _gslActionByUid,
633
+ Te as _gslActions,
634
+ De as _gslAlertByUid,
635
+ Ae as _gslAlerts,
636
+ Oe as _gslBooleanInputs,
637
+ Ue as _gslCalendarByUid,
638
+ Ie as _gslCalendars,
639
+ Ee as _gslCheckboxByUid,
640
+ Re as _gslCheckboxes,
641
+ we as _gslCurrencies,
642
+ ve as _gslCurrencyByUid,
643
+ xe as _gslCustomActionByUid,
644
+ Ce as _gslCustomActions,
645
+ ke as _gslCustomDisplayByUid,
646
+ Me as _gslCustomDisplays,
647
+ Be as _gslCustomInputByUid,
648
+ je as _gslCustomInputs,
649
+ Le as _gslCustomLayoutByUid,
650
+ Fe as _gslCustomLayouts,
651
+ Ne as _gslDateInputByUid,
652
+ Pe as _gslDateInputs,
653
+ We as _gslDatePickerByUid,
654
+ ze as _gslDatePickers,
655
+ Ge as _gslDisplayByUid,
656
+ $e as _gslDisplays,
657
+ Ke as _gslDropdownByUid,
658
+ Ye as _gslDropdowns,
659
+ Ve as _gslInputByUid,
660
+ He as _gslInputs,
661
+ Xe as _gslLayoutByUid,
662
+ qe as _gslLayouts,
663
+ Je as _gslListByUid,
664
+ Qe as _gslLists,
665
+ Ze as _gslMarkdownByUid,
666
+ et as _gslMarkdownTextByUid,
667
+ tt as _gslMarkdownTexts,
668
+ st as _gslMarkdowns,
669
+ at as _gslNumberInputs,
670
+ nt as _gslPasswordByUid,
671
+ rt as _gslPasswords,
672
+ ot as _gslRadiogroupByUid,
673
+ it as _gslRadiogroups,
674
+ lt as _gslRangeCalendarByUid,
675
+ ct as _gslRangeCalendars,
676
+ ut as _gslRangeDateInputByUid,
677
+ pt as _gslRangeDateInputs,
678
+ dt as _gslRangeDatePickerByUid,
679
+ ft as _gslRangeDatePickers,
680
+ gt as _gslRepeaterByUid,
681
+ yt as _gslRepeaters,
682
+ _t as _gslSelectByUid,
683
+ mt as _gslSelects,
684
+ ue as _gslStates,
685
+ ht as _gslTabs,
686
+ St as _gslTabsByUid,
687
+ pe as _gslTag,
688
+ bt as _gslTags,
689
+ Tt as _gslTagsByUid,
690
+ Dt as _gslTextInputs,
691
+ At as _gslTextareaByUid,
692
+ Ot as _gslTextareas,
693
+ Ut as _guiAccordion,
694
+ It as _guiAlert,
695
+ Et as _guiBooleanInput,
696
+ Rt as _guiButton,
697
+ wt as _guiCalendar,
698
+ vt as _guiCheckbox,
699
+ xt as _guiCurrency,
700
+ Ct as _guiCustomAction,
701
+ kt as _guiCustomDisplay,
702
+ Mt as _guiCustomInput,
703
+ Bt as _guiCustomLayout,
704
+ jt as _guiDateInput,
705
+ Lt as _guiDatePicker,
706
+ j as _guiDisplay,
707
+ Ft as _guiDropdown,
708
+ Nt as _guiFlex,
709
+ Pt as _guiGrid,
710
+ Wt as _guiHorizontalFlex,
711
+ zt as _guiHorizontalGrid,
712
+ Gt as _guiList,
713
+ $t as _guiMarkdown,
714
+ Kt as _guiMarkdownText,
715
+ Yt as _guiNumberInput,
716
+ Vt as _guiPassword,
717
+ Ht as _guiRadiogroup,
718
+ Xt as _guiRangeCalendar,
719
+ qt as _guiRangeDateInput,
720
+ Jt as _guiRangeDatePicker,
721
+ Qt as _guiRepeater,
722
+ Zt as _guiSelect,
723
+ es as _guiTabs,
724
+ ts as _guiTags,
725
+ ss as _guiTextInput,
726
+ as as _guiTextarea,
727
+ ns as _guiVerticalFlex,
728
+ rs as _guiVerticalGrid,
729
+ os as createGslSelector,
730
+ is as defineShortcutType,
731
+ ls as extractWidgetProps,
732
+ ae as formDefs,
733
+ ye as getItemKey,
734
+ fe as golemForm,
735
735
  R as isDxDefinitions,
736
- fe as isOption,
737
- ls as processAutoLabel,
738
- cs as processAutoPlaceholder,
739
- pe as resolveFormInput
736
+ ge as isOption,
737
+ cs as processAutoLabel,
738
+ us as processAutoPlaceholder,
739
+ de as resolveFormInput
740
740
  };
package/internals.umd.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./register-dBzdQbWZ.cjs");require("@golemui/core");require("@golemui/gui-validators");function v(l,...e){return e.map(t=>({...t,targetState:l}))}function M(l,...e){return{kind:"aggregated",matcher:t=>t.tags?.includes(l)??!1,children:e}}const B={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_PICKER","CURRENCY","MARKDOWN","LIST","CUSTOM_INPUT","REPEATER","TAGS"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","MARKDOWN_TEXTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function P(l,e){const t=B[l];return t?t.has(e):l===e}class L{resolve(e,t){const r=[];for(const i of t)i.kind==="aggregated"?this.collectFromAggregated(i,e,r):this.collectFromLeaf(i,e,r);const n=this.rollUpSensibleDefaults(r);return{leafSelectors:r,sensibleDefaults:n}}collectFromAggregated(e,t,r){if(e.matcher(t))for(const n of e.children)this.collectFromLeaf(n,t,r)}collectFromLeaf(e,t,r){P(e.selectorType,t.itemType??"")&&e.matcher(t)&&r.push(e)}rollUpSensibleDefaults(e){const t=new Map,r=(i,o)=>{const a=t.get(i)??[];a.push(o),t.set(i,a)};for(const i of e){const o=B[i.selectorType];if(o)for(const a of o)r(a,i);else r(i.selectorType,i)}const n={};for(const[i,o]of t)s.hasItemTypeHandler(i)&&(n[i]=s.getItemTypeHandler(i).rollUpSensibleDefaults(o));return n}}const F=new L;class j{deepMerge(e,t){if(t==null)return e;if(e==null||typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t))return t;const r={...e};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(typeof t[n]=="object"&&!Array.isArray(t[n])&&t[n]!==null&&typeof e[n]=="object"&&!Array.isArray(e[n])&&e[n]!==null?r[n]=this.deepMerge(e[n],t[n]):r[n]=t[n]);return r}}const N=new j;class W{constructor(e){this.objectUtils=e}merge(e,t,r){let n={},i=null;typeof e=="function"&&(i=e);const o=this.collectDecorators(r);for(const c of o){if(i!=null){i=this.composeRuntimeFunctions(i,c);continue}if(typeof c=="function"){const g=c({...n,...typeof e=="function"?{}:e});if(typeof g=="function"){i=this.createPromotedFunction(n,e,g,t,r);continue}n=this.objectUtils.deepMerge(n,g)}else n=this.objectUtils.deepMerge(n,c)}if(i!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(i,n,t,r)};const a=this.objectUtils.deepMerge(e,n);return{kind:"static",def:this.applySensibleDefaults({...a},t,r)}}collectDecorators(e){const t=[];for(const r of e.leafSelectors){const n=r.config;n.override!=null&&t.push(n.override)}return t}applySensibleDefaults(e,t,r){if(!s.hasItemTypeHandler(t))return e;const n=r.sensibleDefaults[t]??{};return s.getItemTypeHandler(t).applySensibleDefaults(e,n)}createPromotedFunction(e,t,r,n,i){return o=>{const a=r(o);let u=this.objectUtils.deepMerge(e,a);return u=this.objectUtils.deepMerge(u,t),this.applySensibleDefaults(u,n,i)}}wrapWithSensibleDefaults(e,t,r,n){return i=>{let o=e(i);return Object.keys(t).length>0&&(o=this.objectUtils.deepMerge(t,o)),this.applySensibleDefaults(o,r,n)}}composeRuntimeFunctions(e,t){return typeof t=="function"?r=>{const n=e(r),i=t(n);return typeof i=="function"?i(r):this.objectUtils.deepMerge(i,n)}:r=>{const n=e(r);return this.objectUtils.deepMerge(n,t)}}}const z=new W(N);class G{mapToWidget(e,t){if(e.kind==="dynamic"){const r=e.fn;return(n=>{const i=r(n);return this.mapStaticDef(i,t)})}return this.mapStaticDef(e.def,t)}mapStaticDef(e,t){const r=s.getItemTypeHandler(t).mapToWidget(e);return this.applyBaseWidgetFields(r,e)}applyBaseWidgetFields(e,t){return t.size!=null&&(e.size=t.size),t.defaultValue!=null&&e.kind==="input"&&(e.defaultValue=t.defaultValue),t.on!=null&&(e.on=t.on),t.include!=null&&(e.include=t.include),t.exclude!=null&&(e.exclude=t.exclude),e}}const $=new G;class H{normalizeSelectors(e){const t=Array.isArray(e)?e:[e],r=[],n=[];for(const i of t)i.kind==="leaf"?n.push(i):r.push(i);return n.length>0&&r.unshift({kind:"aggregated",matcher:()=>!0,children:n}),r}extractFormConfig(){return{suppressAutomaticStack:!1}}}const K=new H,V={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},T={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class Y{extractFromMergeResult(e,t){const r={};for(const a of t){const u=a.targetState,c=a.config,g=c.override&&typeof c.override!="function"?c.override:c;r[u]={...r[u]||{},...g}}if(e.kind==="dynamic"){const a=e.fn;return{cleanedResult:{kind:"dynamic",fn:c=>{const g=a(c),{states:d,..._}=g;return _}},stateData:{stateOverrides:r}}}const{states:n,...i}=e.def,o={};for(const[a,u]of Object.entries(r))o[a]={...u};if(n)for(const[a,u]of Object.entries(n))o[a]={...o[a]||{},...u};return{cleanedResult:{kind:"static",def:i},stateData:{stateOverrides:o}}}applyToWidget(e,t,r,n){const{stateOverrides:i}=t;if(Object.keys(i).length===0)return e;const o={...e},a=e.kind,u=V[a]||new Set;e.props&&(o.props={...e.props}),e.on&&(o.on={...e.on});for(const[c,g]of Object.entries(i))for(const[d,_]of Object.entries(g))d==="visible"?this.applyVisibility(o,c,_):T[d]?this.applyStateEvent(o,c,d,_,r,n):u.has(d)?o[`${d}.${c}`]=_:(o.props||(o.props={}),o.props[`${d}.${c}`]=_);return o}hasStateData(e){return Object.keys(e.stateOverrides).length>0}applyVisibility(e,t,r){if(r){const n=e.include?.in||[];e.include={...e.include||{},in:[...n,t]}}else{const n=e.exclude?.from||[];e.exclude={...e.exclude||{},from:[...n,t]}}}applyStateEvent(e,t,r,n,i,o){const a=T[r];if(e.on||(e.on={}),typeof n=="function"){const u=s.probeForHostEventName(n);if(u!=null)e.on[`${a}.${t}`]=u;else{const c=o.next();i.set(c,n),e.on[`${a}.${t}`]=c}}else typeof n=="string"&&(e.on[`${a}.${t}`]=n)}}const X=new Y;function q(){let l=0;return{next:()=>`event_${l++}`}}class J{constructor(e,t,r,n,i){this.resolver=e,this.merger=t,this.mapper=r,this.eventWiring=n,this.stateExpansion=i}walkAndMap(e,t,r){const n=new Map,i=q(),o={value:0},a=new Set;return{widgets:this.walkItems(e,t,n,r,i,o,a),eventRegistry:n}}walkItems(e,t,r,n,i,o,a){return e.flatMap(u=>{if(u.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return u.items.map(c=>this.processItem(c,u.itemType,u.tags,t,r,n,i,o,a))})}processItem(e,t,r,n,i,o,a,u,c){const g=t,d=s.getItemTypeHandler(t),_=d.parseEntry(e),m=this.buildBaseDef(_),x=this.buildDecoratorForMatching(m,g,r),h=this.resolver.resolve(x,n),w=h.leafSelectors.filter(p=>p.targetState!=null),k={leafSelectors:h.leafSelectors.filter(p=>p.targetState==null),sensibleDefaults:h.sensibleDefaults};let y=this.merger.merge(m,g,k);d.afterMerge&&(y=d.afterMerge(y,{eventRegistry:i,formConfig:o,eventIdGenerator:a})),y=this.eventWiring.wireInputLayoutEvents(y,i,a);const{cleanedResult:U,stateData:S}=this.stateExpansion.extractFromMergeResult(y,w);let f;if(d.buildCustomWidget){const p=this.buildCustomWidgetContext(_.children,n,i,o,a,u,c);f=this.buildCustomWidget(d,U,p)}else f=this.mapper.mapToWidget(U,g);if(typeof f!="function"){const p=f;p.uid||(p.path&&!c.has(p.path)?(p.uid=p.path,c.add(p.path)):p.uid=`dx_${u.value++}`)}if(this.stateExpansion.hasStateData(S))if(typeof f=="function"){const p=f;f=(O=>{const E=p(O);return this.stateExpansion.applyToWidget(E,S,i,a)})}else f=this.stateExpansion.applyToWidget(f,S,i,a);return f}buildCustomWidgetContext(e,t,r,n,i,o,a){return{children:e,mapStaticDef:(u,c)=>this.mapper.mapStaticDef(u,c),walkChildren:u=>this.walkItems(u,t,r,n,i,o,a)}}buildCustomWidget(e,t,r){return e.buildCustomWidget(t,r)}buildBaseDef(e){const t=e.baseDef;return typeof t=="function"?r=>{const i=t(r??{});return e.path!=null?{...i,path:e.path}:i}:e.path!=null?{...t,path:e.path}:t}buildDecoratorForMatching(e,t,r){if(typeof e=="function")return{itemType:t,tags:[...r]};const n=[...r,..."tags"in e&&e.tags?e.tags:[]],i="uid"in e?e.uid:void 0,o="type"in e?e.type:void 0;return{itemType:t,tags:n,uid:i,type:o}}}class Q{constructor(e,t){this.selectorNormalizer=e,this.walker=t}processDxFacade(e,t=[],r){const{defs:n,gslSelectors:i,formConfig:o}=this.prepareForm(e,t,r),{widgets:a,eventRegistry:u}=this.walker.walkAndMap(n,i,o),c=a[0];return this.buildResult({form:c},u,o)}prepareForm(e,t,r){const i=(Array.isArray(e)?[...e]:[e]).map(u=>typeof u=="function"?s._guiDisplay(u):u),o=this.selectorNormalizer.normalizeSelectors(t),a={...this.selectorNormalizer.extractFormConfig(),...r};if(!a.suppressAutomaticStack){const u={def:{uid:"#root",direction:"column",widgetName:"flex"},children:i};return{defs:[{type:"ITEMS",itemType:s.GuiItemTypes.LAYOUTS,items:[u],tags:[]}],gslSelectors:o,formConfig:a}}return{defs:i,gslSelectors:o,formConfig:a}}convertStateNames(e){const t={};for(const[r,n]of Object.entries(e))t[r.replace(/\$/g,":")]=n;return t}buildResult(e,t,r){r.states&&Object.keys(r.states).length>0&&(e={...e,states:this.convertStateNames(r.states)});const n={form:e};return t.size>0&&(n.events=i=>{const o=t.get(i.name);if(o){const a=c=>{if(c&&typeof c=="object"&&"path"in c&&!("type"in c)){const{path:g,...d}=c;for(const[_,m]of Object.entries(d))i.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:g,prop:_,value:m}})}else i.callback(c)},u={...i,callback:a,update:a};o(u)}}),r.dependencies&&(n.dependencies=r.dependencies),r.widgetLoaders&&(n.widgetLoaders=r.widgetLoaders),r.validateOn&&(n.validateOn=r.validateOn),r.itemRenderers&&(n.itemRenderers=r.itemRenderers),n}}const Z=new J(F,z,$,s.eventWiringService,X),R=new Q(K,Z);function D(l){return typeof l=="function"?!0:Array.isArray(l)?l.length===0||l.every(I):I(l)}function I(l){if(typeof l=="function")return!0;if(l===null||typeof l!="object")return!1;const e=l;return e.type==="ITEMS"&&typeof e.itemType=="string"}function ee(l){if(!l||typeof l!="object"||Array.isArray(l))return;const e=l.form;if(D(e))throw new Error("[GolemUI] The gui.* form definition was wrapped in an extra `{ form: ... }` object, so its fields were never resolved. Pass the gui.* array DIRECTLY as formDef (`config={{ formDef: form }}`) and put any named `states` in `formConfig`: `config={{ formDef: form, formConfig: { states } }}`. Do NOT wrap them as a `{ form: [...] }` object.")}const A=Object.freeze({}),te=Object.freeze({}),C=new WeakMap;function b(l,e){return l==null?e:typeof l=="object"?l:{}}function se(l,e,t){if(!D(l))return ee(l),{formDef:l};const r=b(l,A),n=b(e,A),i=b(t,te);let o=C.get(r);o||(o=new WeakMap,C.set(r,o));let a=o.get(n);a||(a=new WeakMap,o.set(n,a));const u=a.get(i);if(u)return u;const c=R.processDxFacade(l,e,t),g={formDef:c.form,formEvent:c.events,dependencies:c.dependencies,widgetLoaders:c.widgetLoaders,validateOn:c.validateOn,itemRenderers:c.itemRenderers};return a.set(i,g),g}class ne{create(e){return{states:e.states,form:{uid:"gui-root-uid",type:"flex",kind:"layout",children:e.form}}}}function re(){return new ne}const ie=l=>l!==null&&typeof l=="object"&&Object.prototype.hasOwnProperty.call(l,"label")&&Object.prototype.hasOwnProperty.call(l,"value");function oe(l,e){if(l!=null&&typeof l=="object"&&"__rid"in l)return l.__rid;const t=e();return Object.defineProperty(l,"__rid",{value:t,enumerable:!1,configurable:!1}),t}exports._gslAccordionByUid=s._gslAccordionByUid;exports._gslAccordions=s._gslAccordions;exports._gslActionByUid=s._gslActionByUid;exports._gslActions=s._gslActions;exports._gslAlertByUid=s._gslAlertByUid;exports._gslAlerts=s._gslAlerts;exports._gslBooleanInputs=s._gslBooleanInputs;exports._gslCalendarByUid=s._gslCalendarByUid;exports._gslCalendars=s._gslCalendars;exports._gslCheckboxByUid=s._gslCheckboxByUid;exports._gslCheckboxes=s._gslCheckboxes;exports._gslCurrencies=s._gslCurrencies;exports._gslCurrencyByUid=s._gslCurrencyByUid;exports._gslCustomActionByUid=s._gslCustomActionByUid;exports._gslCustomActions=s._gslCustomActions;exports._gslCustomDisplayByUid=s._gslCustomDisplayByUid;exports._gslCustomDisplays=s._gslCustomDisplays;exports._gslCustomInputByUid=s._gslCustomInputByUid;exports._gslCustomInputs=s._gslCustomInputs;exports._gslCustomLayoutByUid=s._gslCustomLayoutByUid;exports._gslCustomLayouts=s._gslCustomLayouts;exports._gslDateInputByUid=s._gslDateInputByUid;exports._gslDateInputs=s._gslDateInputs;exports._gslDatePickerByUid=s._gslDatePickerByUid;exports._gslDatePickers=s._gslDatePickers;exports._gslDisplayByUid=s._gslDisplayByUid;exports._gslDisplays=s._gslDisplays;exports._gslDropdownByUid=s._gslDropdownByUid;exports._gslDropdowns=s._gslDropdowns;exports._gslInputByUid=s._gslInputByUid;exports._gslInputs=s._gslInputs;exports._gslLayoutByUid=s._gslLayoutByUid;exports._gslLayouts=s._gslLayouts;exports._gslListByUid=s._gslListByUid;exports._gslLists=s._gslLists;exports._gslMarkdownByUid=s._gslMarkdownByUid;exports._gslMarkdownTextByUid=s._gslMarkdownTextByUid;exports._gslMarkdownTexts=s._gslMarkdownTexts;exports._gslMarkdowns=s._gslMarkdowns;exports._gslNumberInputs=s._gslNumberInputs;exports._gslPasswordByUid=s._gslPasswordByUid;exports._gslPasswords=s._gslPasswords;exports._gslRadiogroupByUid=s._gslRadiogroupByUid;exports._gslRadiogroups=s._gslRadiogroups;exports._gslRangeCalendarByUid=s._gslRangeCalendarByUid;exports._gslRangeCalendars=s._gslRangeCalendars;exports._gslRangeDateInputByUid=s._gslRangeDateInputByUid;exports._gslRangeDateInputs=s._gslRangeDateInputs;exports._gslRangeDatePickerByUid=s._gslRangeDatePickerByUid;exports._gslRangeDatePickers=s._gslRangeDatePickers;exports._gslRepeaterByUid=s._gslRepeaterByUid;exports._gslRepeaters=s._gslRepeaters;exports._gslSelectByUid=s._gslSelectByUid;exports._gslSelects=s._gslSelects;exports._gslTabs=s._gslTabs;exports._gslTabsByUid=s._gslTabsByUid;exports._gslTags=s._gslTags;exports._gslTagsByUid=s._gslTagsByUid;exports._gslTextInputs=s._gslTextInputs;exports._gslTextareaByUid=s._gslTextareaByUid;exports._gslTextareas=s._gslTextareas;exports._guiAccordion=s._guiAccordion;exports._guiAlert=s._guiAlert;exports._guiBooleanInput=s._guiBooleanInput;exports._guiButton=s._guiButton;exports._guiCalendar=s._guiCalendar;exports._guiCheckbox=s._guiCheckbox;exports._guiCurrency=s._guiCurrency;exports._guiCustomAction=s._guiCustomAction;exports._guiCustomDisplay=s._guiCustomDisplay;exports._guiCustomInput=s._guiCustomInput;exports._guiCustomLayout=s._guiCustomLayout;exports._guiDateInput=s._guiDateInput;exports._guiDatePicker=s._guiDatePicker;exports._guiDisplay=s._guiDisplay;exports._guiDropdown=s._guiDropdown;exports._guiFlex=s._guiFlex;exports._guiGrid=s._guiGrid;exports._guiHorizontalFlex=s._guiHorizontalFlex;exports._guiHorizontalGrid=s._guiHorizontalGrid;exports._guiList=s._guiList;exports._guiMarkdown=s._guiMarkdown;exports._guiMarkdownText=s._guiMarkdownText;exports._guiNumberInput=s._guiNumberInput;exports._guiPassword=s._guiPassword;exports._guiRadiogroup=s._guiRadiogroup;exports._guiRangeCalendar=s._guiRangeCalendar;exports._guiRangeDateInput=s._guiRangeDateInput;exports._guiRangeDatePicker=s._guiRangeDatePicker;exports._guiRepeater=s._guiRepeater;exports._guiSelect=s._guiSelect;exports._guiTabs=s._guiTabs;exports._guiTags=s._guiTags;exports._guiTextInput=s._guiTextInput;exports._guiTextarea=s._guiTextarea;exports._guiVerticalFlex=s._guiVerticalFlex;exports._guiVerticalGrid=s._guiVerticalGrid;exports.createGslSelector=s.createGslSelector;exports.defineShortcutType=s.defineShortcutType;exports.extractWidgetProps=s.extractWidgetProps;exports.processAutoLabel=s.processAutoLabel;exports.processAutoPlaceholder=s.processAutoPlaceholder;exports._gslStates=v;exports._gslTag=M;exports.formDefs=R;exports.getItemKey=oe;exports.golemForm=re;exports.isDxDefinitions=D;exports.isOption=ie;exports.resolveFormInput=se;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./register-BHpCnzXI.cjs");require("@golemui/core");require("@golemui/gui-validators");function v(l,...e){return e.map(t=>({...t,targetState:l}))}function M(l,...e){return{kind:"aggregated",matcher:t=>t.tags?.includes(l)??!1,children:e}}const B={INPUTS:new Set(["INPUTS","TEXTAREA","PASSWORD","SELECT","DROPDOWN","RADIOGROUP","CHECKBOX","CALENDAR","DATE_INPUT","DATE_PICKER","RANGE_CALENDAR","RANGE_DATE_INPUT","RANGE_DATE_PICKER","CURRENCY","MARKDOWN","LIST","CUSTOM_INPUT","REPEATER","TAGS"]),ACTIONS:new Set(["ACTIONS","CUSTOM_ACTION"]),DISPLAYS:new Set(["DISPLAYS","ALERTS","MARKDOWN_TEXTS","CUSTOM_DISPLAY"]),LAYOUTS:new Set(["LAYOUTS","TABS","ACCORDION","CUSTOM_LAYOUT"])};function P(l,e){const t=B[l];return t?t.has(e):l===e}class L{resolve(e,t){const r=[];for(const i of t)i.kind==="aggregated"?this.collectFromAggregated(i,e,r):this.collectFromLeaf(i,e,r);const n=this.rollUpSensibleDefaults(r);return{leafSelectors:r,sensibleDefaults:n}}collectFromAggregated(e,t,r){if(e.matcher(t))for(const n of e.children)this.collectFromLeaf(n,t,r)}collectFromLeaf(e,t,r){P(e.selectorType,t.itemType??"")&&e.matcher(t)&&r.push(e)}rollUpSensibleDefaults(e){const t=new Map,r=(i,o)=>{const a=t.get(i)??[];a.push(o),t.set(i,a)};for(const i of e){const o=B[i.selectorType];if(o)for(const a of o)r(a,i);else r(i.selectorType,i)}const n={};for(const[i,o]of t)s.hasItemTypeHandler(i)&&(n[i]=s.getItemTypeHandler(i).rollUpSensibleDefaults(o));return n}}const F=new L;class j{deepMerge(e,t){if(t==null)return e;if(e==null||typeof e!="object"||typeof t!="object"||Array.isArray(e)||Array.isArray(t))return t;const r={...e};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(typeof t[n]=="object"&&!Array.isArray(t[n])&&t[n]!==null&&typeof e[n]=="object"&&!Array.isArray(e[n])&&e[n]!==null?r[n]=this.deepMerge(e[n],t[n]):r[n]=t[n]);return r}}const N=new j;class W{constructor(e){this.objectUtils=e}merge(e,t,r){let n={},i=null;typeof e=="function"&&(i=e);const o=this.collectDecorators(r);for(const c of o){if(i!=null){i=this.composeRuntimeFunctions(i,c);continue}if(typeof c=="function"){const g=c({...n,...typeof e=="function"?{}:e});if(typeof g=="function"){i=this.createPromotedFunction(n,e,g,t,r);continue}n=this.objectUtils.deepMerge(n,g)}else n=this.objectUtils.deepMerge(n,c)}if(i!=null)return{kind:"dynamic",fn:this.wrapWithSensibleDefaults(i,n,t,r)};const a=this.objectUtils.deepMerge(e,n);return{kind:"static",def:this.applySensibleDefaults({...a},t,r)}}collectDecorators(e){const t=[];for(const r of e.leafSelectors){const n=r.config;n.override!=null&&t.push(n.override)}return t}applySensibleDefaults(e,t,r){if(!s.hasItemTypeHandler(t))return e;const n=r.sensibleDefaults[t]??{};return s.getItemTypeHandler(t).applySensibleDefaults(e,n)}createPromotedFunction(e,t,r,n,i){return o=>{const a=r(o);let u=this.objectUtils.deepMerge(e,a);return u=this.objectUtils.deepMerge(u,t),this.applySensibleDefaults(u,n,i)}}wrapWithSensibleDefaults(e,t,r,n){return i=>{let o=e(i);return Object.keys(t).length>0&&(o=this.objectUtils.deepMerge(t,o)),this.applySensibleDefaults(o,r,n)}}composeRuntimeFunctions(e,t){return typeof t=="function"?r=>{const n=e(r),i=t(n);return typeof i=="function"?i(r):this.objectUtils.deepMerge(i,n)}:r=>{const n=e(r);return this.objectUtils.deepMerge(n,t)}}}const z=new W(N);class G{mapToWidget(e,t){if(e.kind==="dynamic"){const r=e.fn;return(n=>{const i=r(n);return this.mapStaticDef(i,t)})}return this.mapStaticDef(e.def,t)}mapStaticDef(e,t){const r=s.getItemTypeHandler(t).mapToWidget(e);return this.applyBaseWidgetFields(r,e)}applyBaseWidgetFields(e,t){return t.size!=null&&(e.size=t.size),t.defaultValue!=null&&e.kind==="input"&&(e.defaultValue=t.defaultValue),t.on!=null&&(e.on=t.on),t.include!=null&&(e.include=t.include),t.exclude!=null&&(e.exclude=t.exclude),e}}const $=new G;class H{normalizeSelectors(e){const t=Array.isArray(e)?e:[e],r=[],n=[];for(const i of t)i.kind==="leaf"?n.push(i):r.push(i);return n.length>0&&r.unshift({kind:"aggregated",matcher:()=>!0,children:n}),r}extractFormConfig(){return{suppressAutomaticStack:!1}}}const K=new H,V={input:new Set(["disabled","readonly","label","validator","size"]),action:new Set(["disabled","label","size"]),layout:new Set(["size"]),display:new Set([])},T={onChange:"change",onLoad:"load",onFilter:"filter",onClick:"click"};class Y{extractFromMergeResult(e,t){const r={};for(const a of t){const u=a.targetState,c=a.config,g=c.override&&typeof c.override!="function"?c.override:c;r[u]={...r[u]||{},...g}}if(e.kind==="dynamic"){const a=e.fn;return{cleanedResult:{kind:"dynamic",fn:c=>{const g=a(c),{states:d,..._}=g;return _}},stateData:{stateOverrides:r}}}const{states:n,...i}=e.def,o={};for(const[a,u]of Object.entries(r))o[a]={...u};if(n)for(const[a,u]of Object.entries(n))o[a]={...o[a]||{},...u};return{cleanedResult:{kind:"static",def:i},stateData:{stateOverrides:o}}}applyToWidget(e,t,r,n){const{stateOverrides:i}=t;if(Object.keys(i).length===0)return e;const o={...e},a=e.kind,u=V[a]||new Set;e.props&&(o.props={...e.props}),e.on&&(o.on={...e.on});for(const[c,g]of Object.entries(i))for(const[d,_]of Object.entries(g))d==="visible"?this.applyVisibility(o,c,_):T[d]?this.applyStateEvent(o,c,d,_,r,n):u.has(d)?o[`${d}.${c}`]=_:(o.props||(o.props={}),o.props[`${d}.${c}`]=_);return o}hasStateData(e){return Object.keys(e.stateOverrides).length>0}applyVisibility(e,t,r){if(r){const n=e.include?.in||[];e.include={...e.include||{},in:[...n,t]}}else{const n=e.exclude?.from||[];e.exclude={...e.exclude||{},from:[...n,t]}}}applyStateEvent(e,t,r,n,i,o){const a=T[r];if(e.on||(e.on={}),typeof n=="function"){const u=s.probeForHostEventName(n);if(u!=null)e.on[`${a}.${t}`]=u;else{const c=o.next();i.set(c,n),e.on[`${a}.${t}`]=c}}else typeof n=="string"&&(e.on[`${a}.${t}`]=n)}}const X=new Y;function q(){let l=0;return{next:()=>`event_${l++}`}}class J{constructor(e,t,r,n,i){this.resolver=e,this.merger=t,this.mapper=r,this.eventWiring=n,this.stateExpansion=i}walkAndMap(e,t,r){const n=new Map,i=q(),o={value:0},a=new Set;return{widgets:this.walkItems(e,t,n,r,i,o,a),eventRegistry:n}}walkItems(e,t,r,n,i,o,a){return e.flatMap(u=>{if(u.type!=="ITEMS")throw new Error("Unexpected gui shortcut type");return u.items.map(c=>this.processItem(c,u.itemType,u.tags,t,r,n,i,o,a))})}processItem(e,t,r,n,i,o,a,u,c){const g=t,d=s.getItemTypeHandler(t),_=d.parseEntry(e),m=this.buildBaseDef(_),w=this.buildDecoratorForMatching(m,g,r),h=this.resolver.resolve(w,n),x=h.leafSelectors.filter(p=>p.targetState!=null),k={leafSelectors:h.leafSelectors.filter(p=>p.targetState==null),sensibleDefaults:h.sensibleDefaults};let y=this.merger.merge(m,g,k);d.afterMerge&&(y=d.afterMerge(y,{eventRegistry:i,formConfig:o,eventIdGenerator:a})),y=this.eventWiring.wireInputLayoutEvents(y,i,a);const{cleanedResult:U,stateData:S}=this.stateExpansion.extractFromMergeResult(y,x);let f;if(d.buildCustomWidget){const p=this.buildCustomWidgetContext(_.children,n,i,o,a,u,c);f=this.buildCustomWidget(d,U,p)}else f=this.mapper.mapToWidget(U,g);if(typeof f!="function"){const p=f;p.uid||(p.path&&!c.has(p.path)?(p.uid=p.path,c.add(p.path)):p.uid=`dx_${u.value++}`)}if(this.stateExpansion.hasStateData(S))if(typeof f=="function"){const p=f;f=(O=>{const E=p(O);return this.stateExpansion.applyToWidget(E,S,i,a)})}else f=this.stateExpansion.applyToWidget(f,S,i,a);return f}buildCustomWidgetContext(e,t,r,n,i,o,a){return{children:e,mapStaticDef:(u,c)=>this.mapper.mapStaticDef(u,c),walkChildren:u=>this.walkItems(u,t,r,n,i,o,a)}}buildCustomWidget(e,t,r){return e.buildCustomWidget(t,r)}buildBaseDef(e){const t=e.baseDef;return typeof t=="function"?r=>{const n=s.withForm(r),i=t(n);return e.path!=null?{...i,path:e.path}:i}:e.path!=null?{...t,path:e.path}:t}buildDecoratorForMatching(e,t,r){if(typeof e=="function")return{itemType:t,tags:[...r]};const n=[...r,..."tags"in e&&e.tags?e.tags:[]],i="uid"in e?e.uid:void 0,o="type"in e?e.type:void 0;return{itemType:t,tags:n,uid:i,type:o}}}class Q{constructor(e,t){this.selectorNormalizer=e,this.walker=t}processDxFacade(e,t=[],r){const{defs:n,gslSelectors:i,formConfig:o}=this.prepareForm(e,t,r),{widgets:a,eventRegistry:u}=this.walker.walkAndMap(n,i,o),c=a[0];return this.buildResult({form:c},u,o)}prepareForm(e,t,r){const i=(Array.isArray(e)?[...e]:[e]).map(u=>typeof u=="function"?s._guiDisplay(u):u),o=this.selectorNormalizer.normalizeSelectors(t),a={...this.selectorNormalizer.extractFormConfig(),...r};if(!a.suppressAutomaticStack){const u={def:{uid:"#root",direction:"column",widgetName:"flex"},children:i};return{defs:[{type:"ITEMS",itemType:s.GuiItemTypes.LAYOUTS,items:[u],tags:[]}],gslSelectors:o,formConfig:a}}return{defs:i,gslSelectors:o,formConfig:a}}convertStateNames(e){const t={};for(const[r,n]of Object.entries(e))t[r.replace(/\$/g,":")]=n;return t}buildResult(e,t,r){r.states&&Object.keys(r.states).length>0&&(e={...e,states:this.convertStateNames(r.states)});const n={form:e};return t.size>0&&(n.events=i=>{const o=t.get(i.name);if(o){const a=c=>{if(c&&typeof c=="object"&&"path"in c&&!("type"in c)){const{path:g,...d}=c;for(const[_,m]of Object.entries(d))i.callback({type:"OVERRIDE_WIDGET_PROP",payload:{path:g,prop:_,value:m}})}else i.callback(c)},u={...i,callback:a,update:a};o(u)}}),r.dependencies&&(n.dependencies=r.dependencies),r.widgetLoaders&&(n.widgetLoaders=r.widgetLoaders),r.validateOn&&(n.validateOn=r.validateOn),r.itemRenderers&&(n.itemRenderers=r.itemRenderers),n}}const Z=new J(F,z,$,s.eventWiringService,X),R=new Q(K,Z);function D(l){return typeof l=="function"?!0:Array.isArray(l)?l.length===0||l.every(I):I(l)}function I(l){if(typeof l=="function")return!0;if(l===null||typeof l!="object")return!1;const e=l;return e.type==="ITEMS"&&typeof e.itemType=="string"}function ee(l){if(!l||typeof l!="object"||Array.isArray(l))return;const e=l.form;if(D(e))throw new Error("[GolemUI] The gui.* form definition was wrapped in an extra `{ form: ... }` object, so its fields were never resolved. Pass the gui.* array DIRECTLY as formDef (`config={{ formDef: form }}`) and put any named `states` in `formConfig`: `config={{ formDef: form, formConfig: { states } }}`. Do NOT wrap them as a `{ form: [...] }` object.")}const A=Object.freeze({}),te=Object.freeze({}),C=new WeakMap;function b(l,e){return l==null?e:typeof l=="object"?l:{}}function se(l,e,t){if(!D(l))return ee(l),{formDef:l};const r=b(l,A),n=b(e,A),i=b(t,te);let o=C.get(r);o||(o=new WeakMap,C.set(r,o));let a=o.get(n);a||(a=new WeakMap,o.set(n,a));const u=a.get(i);if(u)return u;const c=R.processDxFacade(l,e,t),g={formDef:c.form,formEvent:c.events,dependencies:c.dependencies,widgetLoaders:c.widgetLoaders,validateOn:c.validateOn,itemRenderers:c.itemRenderers};return a.set(i,g),g}class ne{create(e){return{states:e.states,form:{uid:"gui-root-uid",type:"flex",kind:"layout",children:e.form}}}}function re(){return new ne}const ie=l=>l!==null&&typeof l=="object"&&Object.prototype.hasOwnProperty.call(l,"label")&&Object.prototype.hasOwnProperty.call(l,"value");function oe(l,e){if(l!=null&&typeof l=="object"&&"__rid"in l)return l.__rid;const t=e();return Object.defineProperty(l,"__rid",{value:t,enumerable:!1,configurable:!1}),t}exports._gslAccordionByUid=s._gslAccordionByUid;exports._gslAccordions=s._gslAccordions;exports._gslActionByUid=s._gslActionByUid;exports._gslActions=s._gslActions;exports._gslAlertByUid=s._gslAlertByUid;exports._gslAlerts=s._gslAlerts;exports._gslBooleanInputs=s._gslBooleanInputs;exports._gslCalendarByUid=s._gslCalendarByUid;exports._gslCalendars=s._gslCalendars;exports._gslCheckboxByUid=s._gslCheckboxByUid;exports._gslCheckboxes=s._gslCheckboxes;exports._gslCurrencies=s._gslCurrencies;exports._gslCurrencyByUid=s._gslCurrencyByUid;exports._gslCustomActionByUid=s._gslCustomActionByUid;exports._gslCustomActions=s._gslCustomActions;exports._gslCustomDisplayByUid=s._gslCustomDisplayByUid;exports._gslCustomDisplays=s._gslCustomDisplays;exports._gslCustomInputByUid=s._gslCustomInputByUid;exports._gslCustomInputs=s._gslCustomInputs;exports._gslCustomLayoutByUid=s._gslCustomLayoutByUid;exports._gslCustomLayouts=s._gslCustomLayouts;exports._gslDateInputByUid=s._gslDateInputByUid;exports._gslDateInputs=s._gslDateInputs;exports._gslDatePickerByUid=s._gslDatePickerByUid;exports._gslDatePickers=s._gslDatePickers;exports._gslDisplayByUid=s._gslDisplayByUid;exports._gslDisplays=s._gslDisplays;exports._gslDropdownByUid=s._gslDropdownByUid;exports._gslDropdowns=s._gslDropdowns;exports._gslInputByUid=s._gslInputByUid;exports._gslInputs=s._gslInputs;exports._gslLayoutByUid=s._gslLayoutByUid;exports._gslLayouts=s._gslLayouts;exports._gslListByUid=s._gslListByUid;exports._gslLists=s._gslLists;exports._gslMarkdownByUid=s._gslMarkdownByUid;exports._gslMarkdownTextByUid=s._gslMarkdownTextByUid;exports._gslMarkdownTexts=s._gslMarkdownTexts;exports._gslMarkdowns=s._gslMarkdowns;exports._gslNumberInputs=s._gslNumberInputs;exports._gslPasswordByUid=s._gslPasswordByUid;exports._gslPasswords=s._gslPasswords;exports._gslRadiogroupByUid=s._gslRadiogroupByUid;exports._gslRadiogroups=s._gslRadiogroups;exports._gslRangeCalendarByUid=s._gslRangeCalendarByUid;exports._gslRangeCalendars=s._gslRangeCalendars;exports._gslRangeDateInputByUid=s._gslRangeDateInputByUid;exports._gslRangeDateInputs=s._gslRangeDateInputs;exports._gslRangeDatePickerByUid=s._gslRangeDatePickerByUid;exports._gslRangeDatePickers=s._gslRangeDatePickers;exports._gslRepeaterByUid=s._gslRepeaterByUid;exports._gslRepeaters=s._gslRepeaters;exports._gslSelectByUid=s._gslSelectByUid;exports._gslSelects=s._gslSelects;exports._gslTabs=s._gslTabs;exports._gslTabsByUid=s._gslTabsByUid;exports._gslTags=s._gslTags;exports._gslTagsByUid=s._gslTagsByUid;exports._gslTextInputs=s._gslTextInputs;exports._gslTextareaByUid=s._gslTextareaByUid;exports._gslTextareas=s._gslTextareas;exports._guiAccordion=s._guiAccordion;exports._guiAlert=s._guiAlert;exports._guiBooleanInput=s._guiBooleanInput;exports._guiButton=s._guiButton;exports._guiCalendar=s._guiCalendar;exports._guiCheckbox=s._guiCheckbox;exports._guiCurrency=s._guiCurrency;exports._guiCustomAction=s._guiCustomAction;exports._guiCustomDisplay=s._guiCustomDisplay;exports._guiCustomInput=s._guiCustomInput;exports._guiCustomLayout=s._guiCustomLayout;exports._guiDateInput=s._guiDateInput;exports._guiDatePicker=s._guiDatePicker;exports._guiDisplay=s._guiDisplay;exports._guiDropdown=s._guiDropdown;exports._guiFlex=s._guiFlex;exports._guiGrid=s._guiGrid;exports._guiHorizontalFlex=s._guiHorizontalFlex;exports._guiHorizontalGrid=s._guiHorizontalGrid;exports._guiList=s._guiList;exports._guiMarkdown=s._guiMarkdown;exports._guiMarkdownText=s._guiMarkdownText;exports._guiNumberInput=s._guiNumberInput;exports._guiPassword=s._guiPassword;exports._guiRadiogroup=s._guiRadiogroup;exports._guiRangeCalendar=s._guiRangeCalendar;exports._guiRangeDateInput=s._guiRangeDateInput;exports._guiRangeDatePicker=s._guiRangeDatePicker;exports._guiRepeater=s._guiRepeater;exports._guiSelect=s._guiSelect;exports._guiTabs=s._guiTabs;exports._guiTags=s._guiTags;exports._guiTextInput=s._guiTextInput;exports._guiTextarea=s._guiTextarea;exports._guiVerticalFlex=s._guiVerticalFlex;exports._guiVerticalGrid=s._guiVerticalGrid;exports.createGslSelector=s.createGslSelector;exports.defineShortcutType=s.defineShortcutType;exports.extractWidgetProps=s.extractWidgetProps;exports.processAutoLabel=s.processAutoLabel;exports.processAutoPlaceholder=s.processAutoPlaceholder;exports._gslStates=v;exports._gslTag=M;exports.formDefs=R;exports.getItemKey=oe;exports.golemForm=re;exports.isDxDefinitions=D;exports.isOption=ie;exports.resolveFormInput=se;
@@ -0,0 +1,8 @@
1
+ import { FunctionWidgetParams } from '@golemui/core';
2
+ /**
3
+ * Runtime functions can run during the build walk / decode probe before form
4
+ * data exists; the FunctionWidgetParams contract guarantees `$form` is an
5
+ * object, so normalize it to at least `{}` — a callback reading
6
+ * `params.$form.field` must get `undefined`, not crash.
7
+ */
8
+ export declare function withForm(params?: FunctionWidgetParams<any>): FunctionWidgetParams<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@golemui/gui-shared",
3
- "version": "1.0.1",
3
+ "version": "1.0.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./index.umd.cjs",
@@ -31,8 +31,8 @@
31
31
  "*.md"
32
32
  ],
33
33
  "dependencies": {
34
- "@golemui/core": "1.0.1",
35
- "@golemui/gui-validators": "1.0.1"
34
+ "@golemui/core": "1.0.3",
35
+ "@golemui/gui-validators": "1.0.3"
36
36
  },
37
37
  "repository": {
38
38
  "type": "git",
@@ -1 +1 @@
1
- "use strict";require("@golemui/core");const m={INPUTS:"INPUTS",ACTIONS:"ACTIONS",LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function U(e){return function(t,s=()=>!0){return{kind:"leaf",selectorType:e,matcher:s,config:t}}}function y(e,t){return typeof e=="function"?e:{type:t,...e??{}}}function N(e,t,s){if(typeof t=="function"){const n=t;return{items:[{key:e,def:o=>({type:"text",...n(o)})}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}const i={type:"text",...t};return{items:[{key:e,def:i}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}function W(e,t,s){if(typeof t=="function"){const n=t;return{items:[{key:e,def:o=>({type:"number",...n(o)})}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}const i={type:"number",...t};return{items:[{key:e,def:i}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}function x(e,t,s){if(typeof t=="function"){const n=t;return{items:[{key:e,def:o=>({type:"boolean",...n(o)})}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}const i={type:"boolean",...t};return{items:[{key:e,def:i}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}function O(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"SELECT",items:[{key:e,def:a=>({type:"select",...l(a)})}],tags:s??[]}}const i={type:"select",...t};return{type:"ITEMS",itemType:"SELECT",items:[{key:e,def:i}],tags:s??[]}}function Y(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:e,def:a=>({type:"dropdown",...l(a)})}],tags:s??[]}}const i={type:"dropdown",...t};return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:e,def:i}],tags:s??[]}}function $(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:e,def:a=>({type:"radiogroup",...l(a)})}],tags:s??[]}}const i={type:"radiogroup",...t};return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:e,def:i}],tags:s??[]}}function G(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:e,def:a=>({type:"checkbox",...l(a)})}],tags:s??[]}}const i={type:"checkbox",...t};return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:e,def:i}],tags:s??[]}}function F(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:e,def:a=>({type:"textarea",...l(a)})}],tags:s??[]}}const i={type:"textarea",...t};return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:e,def:i}],tags:s??[]}}function K(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"PASSWORD",items:[{key:e,def:a=>({type:"password",...l(a)})}],tags:s??[]}}const i={type:"password",...t};return{type:"ITEMS",itemType:"PASSWORD",items:[{key:e,def:i}],tags:s??[]}}function z(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CURRENCY",items:[{key:e,def:a=>({type:"currency",...l(a)})}],tags:s??[]}}const i={type:"currency",...t};return{type:"ITEMS",itemType:"CURRENCY",items:[{key:e,def:i}],tags:s??[]}}function H(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:e,def:a=>({type:"markdown",...l(a)})}],tags:s??[]}}const i={type:"markdown",...t};return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:e,def:i}],tags:s??[]}}function V(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"LIST",items:[{key:e,def:a=>({type:"list",...l(a)})}],tags:s??[]}}const i={type:"list",...t};return{type:"ITEMS",itemType:"LIST",items:[{key:e,def:i}],tags:s??[]}}function X(e,t,s){if(typeof t=="function"){const n=t;return{items:[o=>({type:"calendar",path:e,...n(o)})],type:"ITEMS",itemType:"CALENDAR",tags:s??[]}}return{items:[{type:"calendar",path:e,...t}],type:"ITEMS",itemType:"CALENDAR",tags:s??[]}}function j(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:e,def:a=>({type:"dateInput",...l(a)})}],tags:s??[]}}const i={type:"dateInput",...t};return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:e,def:i}],tags:s??[]}}function q(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:e,def:a=>({type:"datePicker",...l(a)})}],tags:s??[]}}const i={type:"datePicker",...t};return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:e,def:i}],tags:s??[]}}function Z(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:e,def:a=>({type:"rangeCalendar",...l(a)})}],tags:s??[]}}const i={type:"rangeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:e,def:i}],tags:s??[]}}function J(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:e,def:a=>({type:"rangeDateInput",...l(a)})}],tags:s??[]}}const i={type:"rangeDateInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:e,def:i}],tags:s??[]}}function Q(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:e,def:a=>({type:"rangeDatePicker",...l(a)})}],tags:s??[]}}const i={type:"rangeDatePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:e,def:i}],tags:s??[]}}function ee(e,t,s,i){if(typeof s=="function"){const o=s;return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:p=>({customType:e,...o(p)})}],tags:i??[]}}const n={customType:e,...s};return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:n}],tags:i??[]}}function te(e,t){return{items:[e],type:"ITEMS",itemType:m.ACTIONS,tags:t??[]}}function se(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[r=>({customType:e,...l(r)})],tags:s??[]}}return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[{customType:e,...t}],tags:s??[]}}const ie=(e,t)=>({type:"ITEMS",itemType:m.DISPLAYS,items:[{render:e}],tags:t??[]});function ne(e,t){return{type:"ITEMS",itemType:"ALERTS",items:[e],tags:t??[]}}function le(e,t){return{type:"ITEMS",itemType:"MARKDOWN_TEXTS",items:[e],tags:t??[]}}function ae(e,t,s){if(typeof t=="function"){const r=t;return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[p=>({customType:e,...r(p)})],tags:s??[]}}const{uid:i,...n}=t??{};return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[{customType:e,...i!=null?{uid:i}:{},props:Object.keys(n).length>0?n:void 0}],tags:s??[]}}const E=(e,t,s)=>({type:"ITEMS",itemType:m.LAYOUTS,items:[{def:{widgetName:"flex",...t??{}},children:e}],tags:s??[]}),oe=(e,t,s)=>E(e,{direction:"row",...t??{}},s),re=(e,t,s)=>E(e,{direction:"column",...t??{}},s),f=(e,t,s)=>({type:"ITEMS",itemType:m.LAYOUTS,items:[{def:{widgetName:"grid",direction:"row",autoFit:!0,...t??{}},children:e}],tags:s??[]}),ue=(e,t,s)=>f(e,{direction:"row",...t??{}},s),pe=(e,t,s)=>f(e,{direction:"column",...t??{}},s);function C(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function de(e,t,s){const i=e.map(o=>({label:o.label,uid:o.uid??C(o.label)})),n=e.map(o=>({type:"ITEMS",itemType:m.LAYOUTS,items:[{def:{uid:o.uid??C(o.label),direction:"column",widgetName:"flex"},children:o.children}],tags:[]}));return{type:"ITEMS",itemType:"TABS",items:[{def:{tabs:i,...t},children:n}],tags:s??[]}}function P(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function ce(e,t,s){const i=e.map(o=>({label:o.label,uid:o.uid??P(o.label)})),n=e.map(o=>({type:"ITEMS",itemType:m.LAYOUTS,items:[{def:{uid:o.uid??P(o.label),direction:"column",widgetName:"flex"},children:o.children}],tags:[]}));return{type:"ITEMS",itemType:"ACCORDION",items:[{def:{sections:i,...t},children:n}],tags:s??[]}}function ye(e,t,s,i){if(typeof s=="function"){const o=s;return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:p=>({customType:e,...o(p)}),children:t}],tags:i??[]}}return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:{customType:e,...s},children:t}],tags:i??[]}}function me(e,t,s){const{template:i,...n}=t;return{type:"ITEMS",itemType:"REPEATER",items:[{key:e,def:n,children:i}],tags:s??[]}}function ge(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"TAGS",items:[{key:e,def:a=>({type:"tags",...l(a)})}],tags:s??[]}}const i={type:"tags",...t};return{type:"ITEMS",itemType:"TAGS",items:[{key:e,def:i}],tags:s??[]}}const A=new Map;function L(e,t){if(A.has(e))throw new Error(`Item type "${e}" is already registered.`);A.set(e,t)}function Te(e){const t=A.get(e);if(!t)throw new Error(`No handler registered for item type "${e}". Did you forget to import the registration module?`);return t}function be(e){return A.has(e)}function u(e){const t=r=>{if(!e.sensibleDefaults)return{};let a={...e.sensibleDefaults.base};for(const p of r){const g=p.config;for(const b of e.sensibleDefaults.fields){const _=b;g[_]!=null&&(a={...a,[_]:g[_]})}}return a},s=(r,a)=>e.sensibleDefaults?e.sensibleDefaults.apply(r,a):r,i=r=>{switch(e.entryShape){case"bare":return{baseDef:r};case"keyed":{const a=r;return{baseDef:a.def,path:a.key}}case"compound":{const a=r;return{baseDef:a.def,children:a.children}}}},n={rollUpSensibleDefaults:t,applySensibleDefaults:s,mapToWidget:e.mapToWidget,parseEntry:i,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};L(e.itemType,n);const l=U(e.itemType);return{gsl:l,gslByUid:(r,a)=>l(a,(p=>p.uid===r))}}function d(e){const{uid:t,path:s,label:i,disabled:n,readonly:l,defaultValue:o,tags:r,type:a,size:p,onLoad:g,onChange:b,onFilter:_,on:I,states:h,include:Zt,exclude:Jt,validator:Qt,...R}=e;return R}function _e(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()):""}function c(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:_e(e.path)}}function T(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function he(e){switch(e.type){case"text":return Se(e);case"number":return Ie(e);case"boolean":return Ae(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Ae(e){const t=d(e);return{uid:e.uid??"",kind:"input",type:"toggle",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"boolean")}:{},props:t}}function Se(e){const t=d(e);return{uid:e.uid??"",kind:"input",type:"textinput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:y(e.validator,"string")}}function Ie(e){const t=d(e);return{uid:e.uid??"",kind:"input",type:"number",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:y(e.validator,"number")}}const{gsl:S,gslByUid:ke}=u({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let s=c(e,t);return s=T(s,t),s}},mapToWidget:he}),Ue=e=>S(e,t=>t.type==="text"),Ee=e=>S(e,t=>t.type==="number"),fe=e=>S(e,t=>t.type==="boolean"),{gsl:De,gslByUid:Ce}=u({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"select",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:d(e)})}),{gsl:Pe,gslByUid:Be}=u({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dropdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:d(e)})}),{gsl:Le,gslByUid:Me}=u({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"radiogroup",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:d(e)})}),{gsl:ve,gslByUid:we}=u({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"checkbox",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"boolean")}:{},props:d(e)})}),{gsl:Re,gslByUid:Ne}=u({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"textarea",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:We,gslByUid:xe}=u({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"password",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:Oe,gslByUid:Ye}=u({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"currency",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"number")}:{},props:d(e)})}),{gsl:$e,gslByUid:Ge}=u({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"markdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:Fe,gslByUid:Ke}=u({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"list",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:d(e)})}),{gsl:ze,gslByUid:He}=u({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"calendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:Ve,gslByUid:Xe}=u({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:je,gslByUid:qe}=u({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"datePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:Ze,gslByUid:Je}=u({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"array")}:{},props:d(e)})}),{gsl:Qe,gslByUid:et}=u({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"array")}:{},props:d(e)})}),{gsl:tt,gslByUid:st}=u({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDatePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"array")}:{},props:d(e)})});function it(e){const t={};return e.addLabel!=null&&(t.addLabel=e.addLabel),e.removeLabel!=null&&(t.removeLabel=e.removeLabel),e.limit!=null&&(t.limit=e.limit),e.title!=null&&(t.title=e.title),e.addButtonIcon!=null&&(t.addButtonIcon=e.addButtonIcon),e.removeButtonIcon!=null&&(t.removeButtonIcon=e.removeButtonIcon),t}function nt(e){return{uid:e.uid??"",kind:"input",type:"repeater",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"array")}:{},props:{...it(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function k(e,t){for(const s of e){if(typeof s=="function")continue;const i=s;typeof i.path=="string"&&i.path&&!i.path.startsWith(t)&&(i.path=t+i.path),"children"in i&&Array.isArray(i.children)&&k(i.children,t);const n=i.props;n?.template?.children&&Array.isArray(n.template.children)&&k(n.template.children,t)}}function lt(e,t){const s=t.walkChildren(t.children??[]),i=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";i&&k(s,i+".items.");const n={kind:"layout",type:"flex",uid:"",children:s,props:{direction:"column"}};if(e.kind==="static"){const o=t.mapStaticDef(e.def,"REPEATER");return{...o,props:{...o.props,template:n}}}const l=e.fn;return(o=>{const r=l(o),a=t.mapStaticDef(r,"REPEATER");return{...a,props:{...a.props,template:n}}})}function at(e){return{baseDef:e.def,path:e.key,children:e.children}}function ot(e){return e.children}const rt={parseEntry:at,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:nt,buildCustomWidget:lt,getChildren:ot};L("REPEATER",rt);const M=U("REPEATER"),ut=(e,t)=>M(t,(s=>s.uid===e)),v={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},pt=Object.keys(v);function w(e){if(e.length>0)return null;try{const t=e();return typeof t=="string"?t:null}catch{return null}}class dt{extractOnClickFromMergeResult(t,s,i){if(t.kind==="dynamic"){const o=t.fn;return{kind:"dynamic",fn:a=>{const p=o(a);return this.wireOnClick(p,s,i)}}}const n=t.def;return{kind:"static",def:this.wireOnClick(n,s,i)}}wireOnClick(t,s,i){const n=i.next(),l=t.onClick;if(typeof l=="function"){const{onClick:o,...r}=t,a=l(void 0);return typeof a=="string"?{...r,uid:n,on:{click:a}}:(s.set(n,p=>l(p.data)),{...r,uid:n,on:{click:n}})}return{...t,uid:n}}wireInputLayoutEvents(t,s,i){if(t.kind==="dynamic"){const l=t.fn;return{kind:"dynamic",fn:r=>{const a=l(r);return this.wireEventProperties(a,s,i)}}}return{kind:"static",def:this.wireEventProperties(t.def,s,i)}}wireEventProperties(t,s,i){const n={...t.on||{}};let l=!1;const o={...t};for(const r of pt){const a=t[r];if(a==null)continue;const p=v[r];if(typeof a=="function"){const g=w(a);if(g!=null)n[p]=g;else{const b=i.next();s.set(b,a),n[p]=b}l=!0}else typeof a=="string"&&(n[p]=a,l=!0);delete o[r]}return l&&(o.on=n),o}}const D=new dt;function ct(e){const{uid:t,label:s,actionType:i,disabled:n,on:l,onClick:o,data:r,type:a,tags:p,size:g,include:b,exclude:_,states:I,...h}=e;return{uid:t??"",kind:"action",type:"button",disabled:n,actionType:i,label:s,...l!=null?{on:l}:{},props:h}}const{gsl:yt,gslByUid:mt}=u({itemType:"ACTIONS",entryShape:"bare",mapToWidget:ct,afterMerge:(e,t)=>D.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function gt(e){const{uid:t,widgetName:s,tags:i,size:n,onChange:l,include:o,exclude:r,...a}=e,{on:p,...g}=a;return{uid:t??"",kind:"layout",type:s??"flex",props:{direction:g.direction??"column",...g},children:[]}}function Tt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:s};const i=e.fn;return(n=>{const l=i(n);return{...t.mapStaticDef(l,"LAYOUTS"),children:s}})}function bt(e){return e.children}const{gsl:_t,gslByUid:ht}=u({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:gt,buildCustomWidget:Tt,getChildren:bt});function B(e){return{errors:void 0,touched:void 0,translate:void 0,...e??{},$form:e?.$form??{}}}function At(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function St(e,t){if(e.kind==="static"){const i=e.def;return(n=>({uid:"",kind:"display",type:"renderer",...i.include!=null?{include:i.include}:{},...i.exclude!=null?{exclude:i.exclude}:{},props:{render:i.render(B(n))}}))}const s=e.fn;return(i=>{const n=s(i);return{uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(B(i))}}})}const{gsl:It,gslByUid:kt}=u({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:At,buildCustomWidget:St}),{gsl:Ut,gslByUid:Et}=u({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),{gsl:ft,gslByUid:Dt}=u({itemType:"MARKDOWN_TEXTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"markdownText",props:{md:e.md}})});function Ct(e){return{uid:e.uid??"",kind:"layout",type:"tabs",props:{tabs:e.tabs,renderMode:e.renderMode??"all",...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function Pt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:s};const i=e.fn;return(n=>{const l=i(n);return{...t.mapStaticDef(l,"TABS"),children:s}})}function Bt(e){return e.children}const{gsl:Lt,gslByUid:Mt}=u({itemType:"TABS",entryShape:"compound",mapToWidget:Ct,buildCustomWidget:Pt,getChildren:Bt});function vt(e){return{uid:e.uid??"",kind:"layout",type:"accordion",props:{sections:e.sections,renderMode:e.renderMode??"all",...e.singleOpen!=null?{singleOpen:e.singleOpen}:{},...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function wt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:s};const i=e.fn;return(n=>{const l=i(n);return{...t.mapStaticDef(l,"ACCORDION"),children:s}})}function Rt(e){return e.children}const{gsl:Nt,gslByUid:Wt}=u({itemType:"ACCORDION",entryShape:"compound",mapToWidget:vt,buildCustomWidget:wt,getChildren:Rt}),{gsl:xt,gslByUid:Ot}=u({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:e.customType,path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.validator!=null?{validator:e.validator}:{},props:e.props??{}})}),{gsl:Yt,gslByUid:$t}=u({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:s,disabled:i,on:n,onClick:l,data:o,customType:r,tags:a,size:p,include:g,exclude:b,states:_,props:I,...h}=e;return{uid:t??"",kind:"action",type:e.customType,label:s,disabled:i,...n!=null?{on:n}:{},props:{...I,...h}}},afterMerge:(e,t)=>D.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),{gsl:Gt,gslByUid:Ft}=u({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})});function Kt(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function zt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:s};const i=e.fn;return(n=>{const l=i(n);return{...t.mapStaticDef(l,"CUSTOM_LAYOUT"),children:s}})}function Ht(e){return e.children}const{gsl:Vt,gslByUid:Xt}=u({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:Kt,buildCustomWidget:zt,getChildren:Ht}),{gsl:jt,gslByUid:qt}=u({itemType:"TAGS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"tags",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"array")}:{},props:d(e)})});exports.GuiItemTypes=m;exports._gslAccordionByUid=Wt;exports._gslAccordions=Nt;exports._gslActionByUid=mt;exports._gslActions=yt;exports._gslAlertByUid=Et;exports._gslAlerts=Ut;exports._gslBooleanInputs=fe;exports._gslCalendarByUid=He;exports._gslCalendars=ze;exports._gslCheckboxByUid=we;exports._gslCheckboxes=ve;exports._gslCurrencies=Oe;exports._gslCurrencyByUid=Ye;exports._gslCustomActionByUid=$t;exports._gslCustomActions=Yt;exports._gslCustomDisplayByUid=Ft;exports._gslCustomDisplays=Gt;exports._gslCustomInputByUid=Ot;exports._gslCustomInputs=xt;exports._gslCustomLayoutByUid=Xt;exports._gslCustomLayouts=Vt;exports._gslDateInputByUid=Xe;exports._gslDateInputs=Ve;exports._gslDatePickerByUid=qe;exports._gslDatePickers=je;exports._gslDisplayByUid=kt;exports._gslDisplays=It;exports._gslDropdownByUid=Be;exports._gslDropdowns=Pe;exports._gslInputByUid=ke;exports._gslInputs=S;exports._gslLayoutByUid=ht;exports._gslLayouts=_t;exports._gslListByUid=Ke;exports._gslLists=Fe;exports._gslMarkdownByUid=Ge;exports._gslMarkdownTextByUid=Dt;exports._gslMarkdownTexts=ft;exports._gslMarkdowns=$e;exports._gslNumberInputs=Ee;exports._gslPasswordByUid=xe;exports._gslPasswords=We;exports._gslRadiogroupByUid=Me;exports._gslRadiogroups=Le;exports._gslRangeCalendarByUid=Je;exports._gslRangeCalendars=Ze;exports._gslRangeDateInputByUid=et;exports._gslRangeDateInputs=Qe;exports._gslRangeDatePickerByUid=st;exports._gslRangeDatePickers=tt;exports._gslRepeaterByUid=ut;exports._gslRepeaters=M;exports._gslSelectByUid=Ce;exports._gslSelects=De;exports._gslTabs=Lt;exports._gslTabsByUid=Mt;exports._gslTags=jt;exports._gslTagsByUid=qt;exports._gslTextInputs=Ue;exports._gslTextareaByUid=Ne;exports._gslTextareas=Re;exports._guiAccordion=ce;exports._guiAlert=ne;exports._guiBooleanInput=x;exports._guiButton=te;exports._guiCalendar=X;exports._guiCheckbox=G;exports._guiCurrency=z;exports._guiCustomAction=se;exports._guiCustomDisplay=ae;exports._guiCustomInput=ee;exports._guiCustomLayout=ye;exports._guiDateInput=j;exports._guiDatePicker=q;exports._guiDisplay=ie;exports._guiDropdown=Y;exports._guiFlex=E;exports._guiGrid=f;exports._guiHorizontalFlex=oe;exports._guiHorizontalGrid=ue;exports._guiList=V;exports._guiMarkdown=H;exports._guiMarkdownText=le;exports._guiNumberInput=W;exports._guiPassword=K;exports._guiRadiogroup=$;exports._guiRangeCalendar=Z;exports._guiRangeDateInput=J;exports._guiRangeDatePicker=Q;exports._guiRepeater=me;exports._guiSelect=O;exports._guiTabs=de;exports._guiTags=ge;exports._guiTextInput=N;exports._guiTextarea=F;exports._guiVerticalFlex=re;exports._guiVerticalGrid=pe;exports.createGslSelector=U;exports.defineShortcutType=u;exports.eventWiringService=D;exports.extractWidgetProps=d;exports.getItemTypeHandler=Te;exports.hasItemTypeHandler=be;exports.probeForHostEventName=w;exports.processAutoLabel=c;exports.processAutoPlaceholder=T;
1
+ "use strict";require("@golemui/core");const m={INPUTS:"INPUTS",ACTIONS:"ACTIONS",LAYOUTS:"LAYOUTS",DISPLAYS:"DISPLAYS"};function E(e){return function(t,s=()=>!0){return{kind:"leaf",selectorType:e,matcher:s,config:t}}}function y(e,t){return typeof e=="function"?e:{type:t,...e??{}}}function N(e,t,s){if(typeof t=="function"){const n=t;return{items:[{key:e,def:o=>({type:"text",...n(o)})}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}const i={type:"text",...t};return{items:[{key:e,def:i}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}function W(e,t,s){if(typeof t=="function"){const n=t;return{items:[{key:e,def:o=>({type:"number",...n(o)})}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}const i={type:"number",...t};return{items:[{key:e,def:i}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}function x(e,t,s){if(typeof t=="function"){const n=t;return{items:[{key:e,def:o=>({type:"boolean",...n(o)})}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}const i={type:"boolean",...t};return{items:[{key:e,def:i}],type:"ITEMS",itemType:m.INPUTS,tags:s??[]}}function O(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"SELECT",items:[{key:e,def:a=>({type:"select",...l(a)})}],tags:s??[]}}const i={type:"select",...t};return{type:"ITEMS",itemType:"SELECT",items:[{key:e,def:i}],tags:s??[]}}function Y(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:e,def:a=>({type:"dropdown",...l(a)})}],tags:s??[]}}const i={type:"dropdown",...t};return{type:"ITEMS",itemType:"DROPDOWN",items:[{key:e,def:i}],tags:s??[]}}function $(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:e,def:a=>({type:"radiogroup",...l(a)})}],tags:s??[]}}const i={type:"radiogroup",...t};return{type:"ITEMS",itemType:"RADIOGROUP",items:[{key:e,def:i}],tags:s??[]}}function G(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:e,def:a=>({type:"checkbox",...l(a)})}],tags:s??[]}}const i={type:"checkbox",...t};return{type:"ITEMS",itemType:"CHECKBOX",items:[{key:e,def:i}],tags:s??[]}}function F(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:e,def:a=>({type:"textarea",...l(a)})}],tags:s??[]}}const i={type:"textarea",...t};return{type:"ITEMS",itemType:"TEXTAREA",items:[{key:e,def:i}],tags:s??[]}}function K(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"PASSWORD",items:[{key:e,def:a=>({type:"password",...l(a)})}],tags:s??[]}}const i={type:"password",...t};return{type:"ITEMS",itemType:"PASSWORD",items:[{key:e,def:i}],tags:s??[]}}function z(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CURRENCY",items:[{key:e,def:a=>({type:"currency",...l(a)})}],tags:s??[]}}const i={type:"currency",...t};return{type:"ITEMS",itemType:"CURRENCY",items:[{key:e,def:i}],tags:s??[]}}function H(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:e,def:a=>({type:"markdown",...l(a)})}],tags:s??[]}}const i={type:"markdown",...t};return{type:"ITEMS",itemType:"MARKDOWN",items:[{key:e,def:i}],tags:s??[]}}function V(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"LIST",items:[{key:e,def:a=>({type:"list",...l(a)})}],tags:s??[]}}const i={type:"list",...t};return{type:"ITEMS",itemType:"LIST",items:[{key:e,def:i}],tags:s??[]}}function X(e,t,s){if(typeof t=="function"){const n=t;return{items:[o=>({type:"calendar",path:e,...n(o)})],type:"ITEMS",itemType:"CALENDAR",tags:s??[]}}return{items:[{type:"calendar",path:e,...t}],type:"ITEMS",itemType:"CALENDAR",tags:s??[]}}function j(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:e,def:a=>({type:"dateInput",...l(a)})}],tags:s??[]}}const i={type:"dateInput",...t};return{type:"ITEMS",itemType:"DATE_INPUT",items:[{key:e,def:i}],tags:s??[]}}function q(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:e,def:a=>({type:"datePicker",...l(a)})}],tags:s??[]}}const i={type:"datePicker",...t};return{type:"ITEMS",itemType:"DATE_PICKER",items:[{key:e,def:i}],tags:s??[]}}function Z(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:e,def:a=>({type:"rangeCalendar",...l(a)})}],tags:s??[]}}const i={type:"rangeCalendar",...t};return{type:"ITEMS",itemType:"RANGE_CALENDAR",items:[{key:e,def:i}],tags:s??[]}}function J(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:e,def:a=>({type:"rangeDateInput",...l(a)})}],tags:s??[]}}const i={type:"rangeDateInput",...t};return{type:"ITEMS",itemType:"RANGE_DATE_INPUT",items:[{key:e,def:i}],tags:s??[]}}function Q(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:e,def:a=>({type:"rangeDatePicker",...l(a)})}],tags:s??[]}}const i={type:"rangeDatePicker",...t};return{type:"ITEMS",itemType:"RANGE_DATE_PICKER",items:[{key:e,def:i}],tags:s??[]}}function ee(e,t,s,i){if(typeof s=="function"){const o=s;return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:p=>({customType:e,...o(p)})}],tags:i??[]}}const n={customType:e,...s};return{type:"ITEMS",itemType:"CUSTOM_INPUT",items:[{key:t,def:n}],tags:i??[]}}function te(e,t){return{items:[e],type:"ITEMS",itemType:m.ACTIONS,tags:t??[]}}function se(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[r=>({customType:e,...l(r)})],tags:s??[]}}return{type:"ITEMS",itemType:"CUSTOM_ACTION",items:[{customType:e,...t}],tags:s??[]}}const ie=(e,t)=>({type:"ITEMS",itemType:m.DISPLAYS,items:[{render:e}],tags:t??[]});function ne(e,t){return{type:"ITEMS",itemType:"ALERTS",items:[e],tags:t??[]}}function le(e,t){return{type:"ITEMS",itemType:"MARKDOWN_TEXTS",items:[e],tags:t??[]}}function ae(e,t,s){if(typeof t=="function"){const r=t;return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[p=>({customType:e,...r(p)})],tags:s??[]}}const{uid:i,...n}=t??{};return{type:"ITEMS",itemType:"CUSTOM_DISPLAY",items:[{customType:e,...i!=null?{uid:i}:{},props:Object.keys(n).length>0?n:void 0}],tags:s??[]}}const f=(e,t,s)=>({type:"ITEMS",itemType:m.LAYOUTS,items:[{def:{widgetName:"flex",...t??{}},children:e}],tags:s??[]}),oe=(e,t,s)=>f(e,{direction:"row",...t??{}},s),re=(e,t,s)=>f(e,{direction:"column",...t??{}},s),D=(e,t,s)=>({type:"ITEMS",itemType:m.LAYOUTS,items:[{def:{widgetName:"grid",direction:"row",autoFit:!0,...t??{}},children:e}],tags:s??[]}),ue=(e,t,s)=>D(e,{direction:"row",...t??{}},s),pe=(e,t,s)=>D(e,{direction:"column",...t??{}},s);function P(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function de(e,t,s){const i=e.map(o=>({label:o.label,uid:o.uid??P(o.label)})),n=e.map(o=>({type:"ITEMS",itemType:m.LAYOUTS,items:[{def:{uid:o.uid??P(o.label),direction:"column",widgetName:"flex"},children:o.children}],tags:[]}));return{type:"ITEMS",itemType:"TABS",items:[{def:{tabs:i,...t},children:n}],tags:s??[]}}function B(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"")}function ce(e,t,s){const i=e.map(o=>({label:o.label,uid:o.uid??B(o.label)})),n=e.map(o=>({type:"ITEMS",itemType:m.LAYOUTS,items:[{def:{uid:o.uid??B(o.label),direction:"column",widgetName:"flex"},children:o.children}],tags:[]}));return{type:"ITEMS",itemType:"ACCORDION",items:[{def:{sections:i,...t},children:n}],tags:s??[]}}function ye(e,t,s,i){if(typeof s=="function"){const o=s;return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:p=>({customType:e,...o(p)}),children:t}],tags:i??[]}}return{type:"ITEMS",itemType:"CUSTOM_LAYOUT",items:[{def:{customType:e,...s},children:t}],tags:i??[]}}function me(e,t,s){const{template:i,...n}=t;return{type:"ITEMS",itemType:"REPEATER",items:[{key:e,def:n,children:i}],tags:s??[]}}function ge(e,t,s){if(typeof t=="function"){const l=t;return{type:"ITEMS",itemType:"TAGS",items:[{key:e,def:a=>({type:"tags",...l(a)})}],tags:s??[]}}const i={type:"tags",...t};return{type:"ITEMS",itemType:"TAGS",items:[{key:e,def:i}],tags:s??[]}}const A=new Map;function L(e,t){if(A.has(e))throw new Error(`Item type "${e}" is already registered.`);A.set(e,t)}function Te(e){const t=A.get(e);if(!t)throw new Error(`No handler registered for item type "${e}". Did you forget to import the registration module?`);return t}function be(e){return A.has(e)}function u(e){const t=r=>{if(!e.sensibleDefaults)return{};let a={...e.sensibleDefaults.base};for(const p of r){const g=p.config;for(const b of e.sensibleDefaults.fields){const _=b;g[_]!=null&&(a={...a,[_]:g[_]})}}return a},s=(r,a)=>e.sensibleDefaults?e.sensibleDefaults.apply(r,a):r,i=r=>{switch(e.entryShape){case"bare":return{baseDef:r};case"keyed":{const a=r;return{baseDef:a.def,path:a.key}}case"compound":{const a=r;return{baseDef:a.def,children:a.children}}}},n={rollUpSensibleDefaults:t,applySensibleDefaults:s,mapToWidget:e.mapToWidget,parseEntry:i,...e.afterMerge?{afterMerge:e.afterMerge}:{},...e.buildCustomWidget?{buildCustomWidget:e.buildCustomWidget}:{},...e.getChildren?{getChildren:e.getChildren}:{}};L(e.itemType,n);const l=E(e.itemType);return{gsl:l,gslByUid:(r,a)=>l(a,(p=>p.uid===r))}}function d(e){const{uid:t,path:s,label:i,disabled:n,readonly:l,defaultValue:o,tags:r,type:a,size:p,onLoad:g,onChange:b,onFilter:_,on:I,states:h,include:Zt,exclude:Jt,validator:Qt,...R}=e;return R}function _e(e){return e?e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s+/g," ").trim().replace(/\b\w/g,t=>t.toUpperCase()):""}function c(e,t){return e.label!=null||t.suppressAutomaticLabels||!e.path?e:{...e,label:_e(e.path)}}function T(e,t){return e.placeholder!=null||t.suppressAutomaticPlaceholders||!e.path?e:{...e,placeholder:e.path}}function he(e){switch(e.type){case"text":return Se(e);case"number":return Ie(e);case"boolean":return Ae(e);default:throw new Error(`Unsupported field type "${e.type}"`)}}function Ae(e){const t=d(e);return{uid:e.uid??"",kind:"input",type:"toggle",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"boolean")}:{},props:t}}function Se(e){const t=d(e);return{uid:e.uid??"",kind:"input",type:"textinput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:y(e.validator,"string")}}function Ie(e){const t=d(e);return{uid:e.uid??"",kind:"input",type:"number",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},props:{placeholder:t.placeholder??"",...t},validator:y(e.validator,"number")}}const{gsl:S,gslByUid:ke}=u({itemType:"INPUTS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>{let s=c(e,t);return s=T(s,t),s}},mapToWidget:he}),Ue=e=>S(e,t=>t.type==="text"),Ee=e=>S(e,t=>t.type==="number"),fe=e=>S(e,t=>t.type==="boolean"),{gsl:De,gslByUid:Ce}=u({itemType:"SELECT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"select",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:d(e)})}),{gsl:Pe,gslByUid:Be}=u({itemType:"DROPDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dropdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:d(e)})}),{gsl:Le,gslByUid:Me}=u({itemType:"RADIOGROUP",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"radiogroup",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:d(e)})}),{gsl:ve,gslByUid:we}=u({itemType:"CHECKBOX",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"checkbox",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"boolean")}:{},props:d(e)})}),{gsl:Re,gslByUid:Ne}=u({itemType:"TEXTAREA",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"textarea",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:We,gslByUid:xe}=u({itemType:"PASSWORD",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"password",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:Oe,gslByUid:Ye}=u({itemType:"CURRENCY",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"currency",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"number")}:{},props:d(e)})}),{gsl:$e,gslByUid:Ge}=u({itemType:"MARKDOWN",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"markdown",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:Fe,gslByUid:Ke}=u({itemType:"LIST",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"list",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:e.validator}:{},props:d(e)})}),{gsl:ze,gslByUid:He}=u({itemType:"CALENDAR",entryShape:"bare",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"calendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:Ve,gslByUid:Xe}=u({itemType:"DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"dateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:je,gslByUid:qe}=u({itemType:"DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"datePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"string")}:{},props:d(e)})}),{gsl:Ze,gslByUid:Je}=u({itemType:"RANGE_CALENDAR",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeCalendar",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"array")}:{},props:d(e)})}),{gsl:Qe,gslByUid:et}=u({itemType:"RANGE_DATE_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDateInput",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"array")}:{},props:d(e)})}),{gsl:tt,gslByUid:st}=u({itemType:"RANGE_DATE_PICKER",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"rangeDatePicker",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"array")}:{},props:d(e)})});function it(e){const t={};return e.addLabel!=null&&(t.addLabel=e.addLabel),e.removeLabel!=null&&(t.removeLabel=e.removeLabel),e.limit!=null&&(t.limit=e.limit),e.title!=null&&(t.title=e.title),e.addButtonIcon!=null&&(t.addButtonIcon=e.addButtonIcon),e.removeButtonIcon!=null&&(t.removeButtonIcon=e.removeButtonIcon),t}function nt(e){return{uid:e.uid??"",kind:"input",type:"repeater",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"array")}:{},props:{...it(e),template:{kind:"layout",type:"flex",children:[],props:{direction:"column"}}}}}function k(e,t){for(const s of e){if(typeof s=="function")continue;const i=s;typeof i.path=="string"&&i.path&&!i.path.startsWith(t)&&(i.path=t+i.path),"children"in i&&Array.isArray(i.children)&&k(i.children,t);const n=i.props;n?.template?.children&&Array.isArray(n.template.children)&&k(n.template.children,t)}}function lt(e,t){const s=t.walkChildren(t.children??[]),i=e.kind==="static"?e.def.path??"":e.fn({})?.path??"";i&&k(s,i+".items.");const n={kind:"layout",type:"flex",uid:"",children:s,props:{direction:"column"}};if(e.kind==="static"){const o=t.mapStaticDef(e.def,"REPEATER");return{...o,props:{...o.props,template:n}}}const l=e.fn;return(o=>{const r=l(o),a=t.mapStaticDef(r,"REPEATER");return{...a,props:{...a.props,template:n}}})}function at(e){return{baseDef:e.def,path:e.key,children:e.children}}function ot(e){return e.children}const rt={parseEntry:at,rollUpSensibleDefaults:()=>({}),applySensibleDefaults:e=>e,mapToWidget:nt,buildCustomWidget:lt,getChildren:ot};L("REPEATER",rt);const M=E("REPEATER"),ut=(e,t)=>M(t,(s=>s.uid===e)),v={onLoad:"load",onChange:"change",onFilter:"filter",onBlur:"blur"},pt=Object.keys(v);function w(e){if(e.length>0)return null;try{const t=e();return typeof t=="string"?t:null}catch{return null}}class dt{extractOnClickFromMergeResult(t,s,i){if(t.kind==="dynamic"){const o=t.fn;return{kind:"dynamic",fn:a=>{const p=o(a);return this.wireOnClick(p,s,i)}}}const n=t.def;return{kind:"static",def:this.wireOnClick(n,s,i)}}wireOnClick(t,s,i){const n=i.next(),l=t.onClick;if(typeof l=="function"){const{onClick:o,...r}=t,a=l(void 0);return typeof a=="string"?{...r,uid:n,on:{click:a}}:(s.set(n,p=>l(p.data)),{...r,uid:n,on:{click:n}})}return{...t,uid:n}}wireInputLayoutEvents(t,s,i){if(t.kind==="dynamic"){const l=t.fn;return{kind:"dynamic",fn:r=>{const a=l(r);return this.wireEventProperties(a,s,i)}}}return{kind:"static",def:this.wireEventProperties(t.def,s,i)}}wireEventProperties(t,s,i){const n={...t.on||{}};let l=!1;const o={...t};for(const r of pt){const a=t[r];if(a==null)continue;const p=v[r];if(typeof a=="function"){const g=w(a);if(g!=null)n[p]=g;else{const b=i.next();s.set(b,a),n[p]=b}l=!0}else typeof a=="string"&&(n[p]=a,l=!0);delete o[r]}return l&&(o.on=n),o}}const C=new dt;function ct(e){const{uid:t,label:s,actionType:i,disabled:n,on:l,onClick:o,data:r,type:a,tags:p,size:g,include:b,exclude:_,states:I,...h}=e;return{uid:t??"",kind:"action",type:"button",disabled:n,actionType:i,label:s,...l!=null?{on:l}:{},props:h}}const{gsl:yt,gslByUid:mt}=u({itemType:"ACTIONS",entryShape:"bare",mapToWidget:ct,afterMerge:(e,t)=>C.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)});function gt(e){const{uid:t,widgetName:s,tags:i,size:n,onChange:l,include:o,exclude:r,...a}=e,{on:p,...g}=a;return{uid:t??"",kind:"layout",type:s??"flex",props:{direction:g.direction??"column",...g},children:[]}}function Tt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"LAYOUTS"),children:s};const i=e.fn;return(n=>{const l=i(n);return{...t.mapStaticDef(l,"LAYOUTS"),children:s}})}function bt(e){return e.children}const{gsl:_t,gslByUid:ht}=u({itemType:"LAYOUTS",entryShape:"compound",mapToWidget:gt,buildCustomWidget:Tt,getChildren:bt});function U(e){return{errors:void 0,touched:void 0,translate:void 0,...e??{},$form:e?.$form??{}}}function At(e){return{uid:"",kind:"display",type:"renderer",props:{render:e.render}}}function St(e,t){if(e.kind==="static"){const i=e.def;return(n=>({uid:"",kind:"display",type:"renderer",...i.include!=null?{include:i.include}:{},...i.exclude!=null?{exclude:i.exclude}:{},props:{render:i.render(U(n))}}))}const s=e.fn;return(i=>{const n=s(i);return{uid:"",kind:"display",type:"renderer",...n.include!=null?{include:n.include}:{},...n.exclude!=null?{exclude:n.exclude}:{},props:{render:n.render(U(i))}}})}const{gsl:It,gslByUid:kt}=u({itemType:"DISPLAYS",entryShape:"bare",mapToWidget:At,buildCustomWidget:St}),{gsl:Ut,gslByUid:Et}=u({itemType:"ALERTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"alert",props:{text:e.text,...e.level!=null?{level:e.level}:{}}})}),{gsl:ft,gslByUid:Dt}=u({itemType:"MARKDOWN_TEXTS",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:"markdownText",props:{md:e.md}})});function Ct(e){return{uid:e.uid??"",kind:"layout",type:"tabs",props:{tabs:e.tabs,renderMode:e.renderMode??"all",...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function Pt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"TABS"),children:s};const i=e.fn;return(n=>{const l=i(n);return{...t.mapStaticDef(l,"TABS"),children:s}})}function Bt(e){return e.children}const{gsl:Lt,gslByUid:Mt}=u({itemType:"TABS",entryShape:"compound",mapToWidget:Ct,buildCustomWidget:Pt,getChildren:Bt});function vt(e){return{uid:e.uid??"",kind:"layout",type:"accordion",props:{sections:e.sections,renderMode:e.renderMode??"all",...e.singleOpen!=null?{singleOpen:e.singleOpen}:{},...e.defaultOpen!=null?{defaultOpen:e.defaultOpen}:{}},children:[]}}function wt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"ACCORDION"),children:s};const i=e.fn;return(n=>{const l=i(n);return{...t.mapStaticDef(l,"ACCORDION"),children:s}})}function Rt(e){return e.children}const{gsl:Nt,gslByUid:Wt}=u({itemType:"ACCORDION",entryShape:"compound",mapToWidget:vt,buildCustomWidget:wt,getChildren:Rt}),{gsl:xt,gslByUid:Ot}=u({itemType:"CUSTOM_INPUT",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1},fields:["suppressAutomaticLabels"],apply:(e,t)=>c(e,t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:e.customType,path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.defaultValue!=null?{defaultValue:e.defaultValue}:{},...e.validator!=null?{validator:e.validator}:{},props:e.props??{}})}),{gsl:Yt,gslByUid:$t}=u({itemType:"CUSTOM_ACTION",entryShape:"bare",mapToWidget:e=>{const{uid:t,label:s,disabled:i,on:n,onClick:l,data:o,customType:r,tags:a,size:p,include:g,exclude:b,states:_,props:I,...h}=e;return{uid:t??"",kind:"action",type:e.customType,label:s,disabled:i,...n!=null?{on:n}:{},props:{...I,...h}}},afterMerge:(e,t)=>C.extractOnClickFromMergeResult(e,t.eventRegistry,t.eventIdGenerator)}),{gsl:Gt,gslByUid:Ft}=u({itemType:"CUSTOM_DISPLAY",entryShape:"bare",mapToWidget:e=>({uid:e.uid??"",kind:"display",type:e.customType,props:e.props??{}})});function Kt(e){return{uid:e.uid??"",kind:"layout",type:e.customType,props:e.props??{},children:[]}}function zt(e,t){const s=t.walkChildren(t.children??[]);if(e.kind==="static")return{...t.mapStaticDef(e.def,"CUSTOM_LAYOUT"),children:s};const i=e.fn;return(n=>{const l=i(n);return{...t.mapStaticDef(l,"CUSTOM_LAYOUT"),children:s}})}function Ht(e){return e.children}const{gsl:Vt,gslByUid:Xt}=u({itemType:"CUSTOM_LAYOUT",entryShape:"compound",mapToWidget:Kt,buildCustomWidget:zt,getChildren:Ht}),{gsl:jt,gslByUid:qt}=u({itemType:"TAGS",entryShape:"keyed",sensibleDefaults:{base:{suppressAutomaticLabels:!1,suppressAutomaticPlaceholders:!1},fields:["suppressAutomaticLabels","suppressAutomaticPlaceholders"],apply:(e,t)=>T(c(e,t),t)},mapToWidget:e=>({uid:e.uid??"",kind:"input",type:"tags",path:e.path??"",...e.label!=null?{label:e.label}:{},...e.disabled!=null?{disabled:e.disabled}:{},...e.readonly!=null?{readonly:e.readonly}:{},...e.validator!=null?{validator:y(e.validator,"array")}:{},props:d(e)})});exports.GuiItemTypes=m;exports._gslAccordionByUid=Wt;exports._gslAccordions=Nt;exports._gslActionByUid=mt;exports._gslActions=yt;exports._gslAlertByUid=Et;exports._gslAlerts=Ut;exports._gslBooleanInputs=fe;exports._gslCalendarByUid=He;exports._gslCalendars=ze;exports._gslCheckboxByUid=we;exports._gslCheckboxes=ve;exports._gslCurrencies=Oe;exports._gslCurrencyByUid=Ye;exports._gslCustomActionByUid=$t;exports._gslCustomActions=Yt;exports._gslCustomDisplayByUid=Ft;exports._gslCustomDisplays=Gt;exports._gslCustomInputByUid=Ot;exports._gslCustomInputs=xt;exports._gslCustomLayoutByUid=Xt;exports._gslCustomLayouts=Vt;exports._gslDateInputByUid=Xe;exports._gslDateInputs=Ve;exports._gslDatePickerByUid=qe;exports._gslDatePickers=je;exports._gslDisplayByUid=kt;exports._gslDisplays=It;exports._gslDropdownByUid=Be;exports._gslDropdowns=Pe;exports._gslInputByUid=ke;exports._gslInputs=S;exports._gslLayoutByUid=ht;exports._gslLayouts=_t;exports._gslListByUid=Ke;exports._gslLists=Fe;exports._gslMarkdownByUid=Ge;exports._gslMarkdownTextByUid=Dt;exports._gslMarkdownTexts=ft;exports._gslMarkdowns=$e;exports._gslNumberInputs=Ee;exports._gslPasswordByUid=xe;exports._gslPasswords=We;exports._gslRadiogroupByUid=Me;exports._gslRadiogroups=Le;exports._gslRangeCalendarByUid=Je;exports._gslRangeCalendars=Ze;exports._gslRangeDateInputByUid=et;exports._gslRangeDateInputs=Qe;exports._gslRangeDatePickerByUid=st;exports._gslRangeDatePickers=tt;exports._gslRepeaterByUid=ut;exports._gslRepeaters=M;exports._gslSelectByUid=Ce;exports._gslSelects=De;exports._gslTabs=Lt;exports._gslTabsByUid=Mt;exports._gslTags=jt;exports._gslTagsByUid=qt;exports._gslTextInputs=Ue;exports._gslTextareaByUid=Ne;exports._gslTextareas=Re;exports._guiAccordion=ce;exports._guiAlert=ne;exports._guiBooleanInput=x;exports._guiButton=te;exports._guiCalendar=X;exports._guiCheckbox=G;exports._guiCurrency=z;exports._guiCustomAction=se;exports._guiCustomDisplay=ae;exports._guiCustomInput=ee;exports._guiCustomLayout=ye;exports._guiDateInput=j;exports._guiDatePicker=q;exports._guiDisplay=ie;exports._guiDropdown=Y;exports._guiFlex=f;exports._guiGrid=D;exports._guiHorizontalFlex=oe;exports._guiHorizontalGrid=ue;exports._guiList=V;exports._guiMarkdown=H;exports._guiMarkdownText=le;exports._guiNumberInput=W;exports._guiPassword=K;exports._guiRadiogroup=$;exports._guiRangeCalendar=Z;exports._guiRangeDateInput=J;exports._guiRangeDatePicker=Q;exports._guiRepeater=me;exports._guiSelect=O;exports._guiTabs=de;exports._guiTags=ge;exports._guiTextInput=N;exports._guiTextarea=F;exports._guiVerticalFlex=re;exports._guiVerticalGrid=pe;exports.createGslSelector=E;exports.defineShortcutType=u;exports.eventWiringService=C;exports.extractWidgetProps=d;exports.getItemTypeHandler=Te;exports.hasItemTypeHandler=be;exports.probeForHostEventName=w;exports.processAutoLabel=c;exports.processAutoPlaceholder=T;exports.withForm=U;
@@ -1362,15 +1362,16 @@ export {
1362
1362
  je as aF,
1363
1363
  Xe as aG,
1364
1364
  V as aH,
1365
- m as aI,
1366
- v as aJ,
1367
- Zt as aK,
1368
- es as aL,
1369
- P as aM,
1370
- u as aN,
1371
- d as aO,
1372
- c as aP,
1373
- g as aQ,
1365
+ U as aI,
1366
+ m as aJ,
1367
+ v as aK,
1368
+ Zt as aL,
1369
+ es as aM,
1370
+ P as aN,
1371
+ u as aO,
1372
+ d as aP,
1373
+ c as aQ,
1374
+ g as aR,
1374
1375
  D as aa,
1375
1376
  Ye as ab,
1376
1377
  xe as ac,