@golemui/core 1.5.0 → 1.5.1-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -1,274 +1,86 @@
1
- import { BehaviorSubject as hr, distinctUntilChanged as Le, Subject as it, pipe as mr, map as Ct } from "rxjs";
1
+ import { BehaviorSubject as dr, distinctUntilChanged as Ne, Subject as nt, pipe as ur, map as At } from "rxjs";
2
+ import { Decoder as he, err as K, ok as Ve, object as q, array as Re, string as E, oneOf as z, boolean as lr, optional as y, succeed as L, number as me, literal as H, lazy as Et, discriminatedUnion as ar, record as fr, formatIssuePath as pr } from "ts.data.json";
2
3
  import "@standard-schema/spec";
3
- function gr(e, t) {
4
+ function hr(e, t) {
4
5
  const r = e["~standard"].validate(t);
5
6
  if (r instanceof Promise)
6
7
  throw new TypeError("Schema validation must be synchronous");
7
8
  return r;
8
9
  }
9
- function yr(e) {
10
+ function mr(e) {
10
11
  return e.issues === void 0;
11
12
  }
12
- var vr = class {
13
- value;
14
- constructor(e) {
15
- this.value = e;
16
- }
17
- map(e) {
18
- return k(e(this.value));
19
- }
20
- isOk() {
21
- return !0;
22
- }
23
- }, $r = class It {
24
- issues;
25
- constructor(t) {
26
- this.issues = t;
27
- }
28
- map(t) {
29
- return new It(this.issues);
30
- }
31
- isOk() {
32
- return !1;
33
- }
34
- };
35
- function k(e) {
36
- return new vr(e);
37
- }
38
- function E(e) {
39
- return new $r(e);
40
- }
41
- function kt(e) {
42
- return e.reduce((t, r) => typeof r == "number" ? `${t}[${r}]` : t.length === 0 ? String(r) : `${t}.${r}`, "");
43
- }
44
- function ut(e) {
45
- return e.map((t) => t.path.length === 0 ? t.message : `${kt(t.path)}: ${t.message}`).join("; ");
46
- }
47
- var C = class Pe {
48
- decodeFn;
49
- constructor(t) {
50
- this.decodeFn = t;
51
- }
52
- parse(t) {
53
- let r = this.decode(t);
54
- if (r.isOk()) return r.value;
55
- {
56
- let n = r;
57
- throw Error(ut(n.issues), { cause: n.issues });
58
- }
59
- }
60
- decode(t) {
61
- return this.decodeFn(t);
62
- }
63
- "~standard" = {
64
- version: 1,
65
- vendor: "ts.data.json",
66
- validate: (t) => {
67
- let r = this.decode(t);
68
- return r.isOk() ? { value: r.value } : { issues: r.issues.map((n) => ({
69
- message: n.message,
70
- path: n.path.length > 0 ? n.path.map((o) => ({ key: o })) : void 0
71
- })) };
72
- }
73
- };
74
- decodePromise(t) {
75
- return new Promise((r, n) => {
76
- let o = this.decode(t);
77
- if (o.isOk()) return r(o.value);
78
- {
79
- let s = o;
80
- return n(Error(ut(s.issues), { cause: s.issues }));
81
- }
82
- });
83
- }
84
- map(t) {
85
- return new Pe((r) => {
86
- let n = this.decodeFn(r);
87
- return n.isOk() ? k(t(n.value)) : E(n.issues);
88
- });
89
- }
90
- flatMap(t) {
91
- return new Pe((r) => {
92
- let n = this.decodeFn(r);
93
- return n.isOk() ? t(n.value).decode(r) : E(n.issues);
94
- });
95
- }
96
- }, b = (e, t) => [{
97
- message: `${JSON.stringify(e)} is not a valid ${t}`,
98
- path: []
99
- }], Me = (e, t) => e.map((r) => ({
100
- ...r,
101
- path: [t, ...r.path]
102
- }));
103
- function _e(e) {
104
- return new C((t) => {
105
- if (t instanceof Array) {
106
- let r = [], n = [];
107
- for (let o = 0; o < t.length; o++) {
108
- let s = e.decode(t[o]);
109
- s.isOk() ? r.push(s.value) : n.push(...Me(s.issues, o));
110
- }
111
- return n.length > 0 ? E(n) : k(r);
112
- } else return E(b(t, "array"));
113
- });
114
- }
115
- function Sr() {
116
- return new C((e) => typeof e == "boolean" ? k(e) : E(b(e, "boolean")));
117
- }
118
- function Ar(e, t) {
119
- return new C((r) => {
120
- if (typeof r != "object" || !r) return E(b(r, "object"));
121
- let n = r[e];
122
- return Object.prototype.hasOwnProperty.call(t, n) ? t[n].decode(r) : E([{
123
- message: `"${e}" must be one of ${Object.keys(t).map((o) => JSON.stringify(o)).join(", ")}, but got ${JSON.stringify(n)}`,
124
- path: [e]
125
- }]);
126
- });
127
- }
128
- function jt(e) {
129
- return new C((t) => e().decode(t));
130
- }
131
- function G(e) {
132
- return new C((t) => t === e ? k(e) : E([{
133
- message: `${JSON.stringify(t)} is not exactly ${JSON.stringify(e)}`,
134
- path: []
135
- }]));
136
- }
137
- function ye() {
138
- return new C((e) => typeof e == "number" ? k(e) : E(b(e, "number")));
139
- }
140
- function Y(e) {
141
- return new C((t) => {
142
- if (typeof t == "object" && t) {
143
- let r = {}, n = [];
144
- for (let o in e) if (Object.prototype.hasOwnProperty.call(e, o)) {
145
- let s, i = e[o];
146
- s = i instanceof C ? i.decode(t[o]) : i.decoder.decode(t[i.fromKey]), s.isOk() ? r[o] = s.value : n.push(...Me(s.issues, o));
147
- }
148
- return n.length > 0 ? E(n) : k(r);
149
- } else return E(b(t, "object"));
150
- });
151
- }
152
- function K(e) {
153
- return new C((t) => {
154
- let r = [];
155
- for (let n = 0; n < e.length; n++) {
156
- let o = e[n].decode(t);
157
- if (o.isOk()) return o;
158
- r.push(o.issues);
159
- }
160
- return E([{
161
- message: `no alternative matched (tried ${e.length})`,
162
- path: []
163
- }, ...Er(r)]);
164
- });
165
- }
166
- function Er(e) {
167
- let t = /* @__PURE__ */ new Map();
168
- for (let r of e) for (let n of r) {
169
- let o = JSON.stringify(n.path), s = t.get(o);
170
- s ? s.messages.includes(n.message) || s.messages.push(n.message) : t.set(o, {
171
- path: n.path,
172
- messages: [n.message]
173
- });
174
- }
175
- return Array.from(t.values()).map(({ path: r, messages: n }) => ({
176
- message: n.join(" or "),
177
- path: r
178
- }));
179
- }
180
- function y(e) {
181
- return new C((t) => t === void 0 ? k(void 0) : e.decode(t));
182
- }
183
- function wr(e) {
184
- return new C((t) => {
185
- if (typeof t == "object" && t) {
186
- let r = {}, n = [];
187
- for (let o in t) if (Object.prototype.hasOwnProperty.call(t, o)) {
188
- let s = e.decode(t[o]);
189
- s.isOk() ? r[o] = s.value : n.push(...Me(s.issues, o));
190
- }
191
- return n.length > 0 ? E(n) : k(r);
192
- } else return E(b(t, "object"));
193
- });
194
- }
195
- function w() {
196
- return new C((e) => typeof e == "string" ? k(e) : E(b(e, "string")));
197
- }
198
- function U() {
199
- return new C((e) => k(e));
200
- }
201
- function ee(e) {
202
- return new C((t) => {
13
+ function J(e) {
14
+ return new he((t) => {
203
15
  if (typeof t != "object" || t === null)
204
- return E([{ message: `Expected object literal, got "${typeof t}"`, path: [] }]);
16
+ return K([{ message: `Expected object literal, got "${typeof t}"`, path: [] }]);
205
17
  const r = {};
206
18
  for (const [n, o] of Object.entries(e)) {
207
- const s = o.decoder.decode(t[n]);
208
- if (!s.isOk())
209
- return E(
210
- s.issues.map((i) => ({
211
- message: i.message,
212
- path: [n, ...i.path]
19
+ const i = o.decoder.decode(t[n]);
20
+ if (!i.isOk())
21
+ return K(
22
+ i.issues.map((s) => ({
23
+ message: s.message,
24
+ path: [n, ...s.path]
213
25
  }))
214
26
  );
215
- if (r[n] = s.value, o.suffixed) {
216
- for (const [i, u] of Object.entries(t))
217
- if (i.startsWith(n + ".")) {
218
- const d = o.decoder.decode(u);
219
- if (!d.isOk())
220
- return E(
221
- d.issues.map((l) => ({
27
+ if (r[n] = i.value, o.suffixed) {
28
+ for (const [s, c] of Object.entries(t))
29
+ if (s.startsWith(n + ".")) {
30
+ const u = o.decoder.decode(c);
31
+ if (!u.isOk())
32
+ return K(
33
+ u.issues.map((l) => ({
222
34
  message: l.message,
223
- path: [i, ...l.path]
35
+ path: [s, ...l.path]
224
36
  }))
225
37
  );
226
- r[i] = d.value;
38
+ r[s] = u.value;
227
39
  }
228
40
  }
229
41
  }
230
- return k(r);
42
+ return Ve(r);
231
43
  });
232
44
  }
233
- const Or = (e) => typeof e != "function" && e.kind === "display", ue = (e) => typeof e != "function" && e.kind === "action", j = (e) => typeof e != "function" && e.kind === "input", H = (e) => typeof e != "function" && e.kind === "layout", T = (e) => typeof e == "function", Cr = Y({ in: _e(w()) }), Ue = Y({ when: w() }), ve = K([Cr, Ue]), Ir = Y({ from: _e(w()) }), $e = K([Ir, Ue]), Fe = K([Sr(), Ue]), kr = new C((e) => {
45
+ const gr = (e) => typeof e != "function" && e.kind === "display", oe = (e) => typeof e != "function" && e.kind === "action", I = (e) => typeof e != "function" && e.kind === "input", _ = (e) => typeof e != "function" && e.kind === "layout", P = (e) => typeof e == "function", yr = q({ in: Re(E()) }), Le = q({ when: E() }), ge = z([yr, Le]), vr = q({ from: Re(E()) }), ye = z([vr, Le]), ke = z([lr(), Le]), $r = new he((e) => {
234
46
  const t = typeof e;
235
- return t === "function" ? k(e) : E([{ message: `Expected a function, got '${t}'`, path: [] }]);
236
- }), N = (e) => K([e, kr]), He = ee({
237
- load: { suffixed: !0, decoder: N(y(w())) },
238
- click: { suffixed: !0, decoder: N(y(w())) },
239
- change: { suffixed: !0, decoder: N(y(w())) },
240
- filter: { suffixed: !0, decoder: N(y(w())) },
241
- blur: { suffixed: !0, decoder: N(y(w())) }
242
- }), jr = Y({
243
- key: w(),
244
- default: y(w()),
245
- params: y(U())
246
- }), Pt = K([w(), jr]), be = y(w()), Pr = ee({
247
- kind: { decoder: G("display") },
248
- uid: { decoder: be },
249
- type: { decoder: w() },
250
- size: { suffixed: !0, decoder: y(ye()) },
251
- include: { decoder: y(ve) },
252
- exclude: { decoder: y($e) },
253
- props: { decoder: y(U()) }
254
- }), Fr = ee({
255
- kind: { decoder: G("action") },
256
- uid: { decoder: be },
257
- type: { decoder: w() },
47
+ return t === "function" ? Ve(e) : K([{ message: `Expected a function, got '${t}'`, path: [] }]);
48
+ }), D = (e) => z([e, $r]), _e = J({
49
+ load: { suffixed: !0, decoder: D(y(E())) },
50
+ click: { suffixed: !0, decoder: D(y(E())) },
51
+ change: { suffixed: !0, decoder: D(y(E())) },
52
+ filter: { suffixed: !0, decoder: D(y(E())) },
53
+ blur: { suffixed: !0, decoder: D(y(E())) }
54
+ }), Sr = q({
55
+ key: E(),
56
+ default: y(E()),
57
+ params: y(L())
58
+ }), Ct = z([E(), Sr]), Me = y(E()), Ar = J({
59
+ kind: { decoder: H("display") },
60
+ uid: { decoder: Me },
61
+ type: { decoder: E() },
62
+ size: { suffixed: !0, decoder: y(me()) },
63
+ include: { decoder: y(ge) },
64
+ exclude: { decoder: y(ye) },
65
+ props: { decoder: y(L()) }
66
+ }), Er = J({
67
+ kind: { decoder: H("action") },
68
+ uid: { decoder: Me },
69
+ type: { decoder: E() },
258
70
  actionType: {
259
- decoder: y(K([G("button"), G("submit")]))
71
+ decoder: y(z([H("button"), H("submit")]))
260
72
  },
261
- size: { suffixed: !0, decoder: y(ye()) },
262
- include: { decoder: y(ve) },
263
- exclude: { decoder: y($e) },
73
+ size: { suffixed: !0, decoder: y(me()) },
74
+ include: { decoder: y(ge) },
75
+ exclude: { decoder: y(ye) },
264
76
  label: {
265
77
  suffixed: !0,
266
- decoder: N(y(Pt))
78
+ decoder: D(y(Ct))
267
79
  },
268
- disabled: { suffixed: !0, decoder: y(Fe) },
269
- on: { decoder: y(He) },
270
- props: { decoder: y(U()) }
271
- }), Wr = new C((e) => {
80
+ disabled: { suffixed: !0, decoder: y(ke) },
81
+ on: { decoder: y(_e) },
82
+ props: { decoder: y(L()) }
83
+ }), Cr = new he((e) => {
272
84
  const t = typeof e;
273
85
  if (t === "function") {
274
86
  const r = e, n = r({
@@ -277,58 +89,58 @@ const Or = (e) => typeof e != "function" && e.kind === "display", ue = (e) => ty
277
89
  touched: void 0,
278
90
  translate: void 0
279
91
  });
280
- return r.uid = r.uid || n.uid, r.type = n.type, r.path = n.path, k(r);
92
+ return r.uid = r.uid || n.uid, r.type = n.type, r.path = n.path, Ve(r);
281
93
  } else
282
- return E([{ message: `Expected a function, got '${t}'`, path: [] }]);
283
- }), Dr = ee({
284
- kind: { decoder: G("input") },
285
- uid: { decoder: y(w()) },
286
- type: { decoder: w() },
287
- size: { suffixed: !0, decoder: y(ye()) },
288
- include: { decoder: y(ve) },
289
- exclude: { decoder: y($e) },
290
- disabled: { suffixed: !0, decoder: y(Fe) },
291
- readonly: { suffixed: !0, decoder: y(Fe) },
292
- on: { decoder: y(He) },
293
- props: { decoder: y(U()) },
94
+ return K([{ message: `Expected a function, got '${t}'`, path: [] }]);
95
+ }), wr = J({
96
+ kind: { decoder: H("input") },
97
+ uid: { decoder: y(E()) },
98
+ type: { decoder: E() },
99
+ size: { suffixed: !0, decoder: y(me()) },
100
+ include: { decoder: y(ge) },
101
+ exclude: { decoder: y(ye) },
102
+ disabled: { suffixed: !0, decoder: y(ke) },
103
+ readonly: { suffixed: !0, decoder: y(ke) },
104
+ on: { decoder: y(_e) },
105
+ props: { decoder: y(L()) },
294
106
  label: {
295
107
  suffixed: !0,
296
- decoder: N(y(Pt))
108
+ decoder: D(y(Ct))
297
109
  },
298
- path: { decoder: w() },
299
- defaultValue: { decoder: y(U()) },
110
+ path: { decoder: E() },
111
+ defaultValue: { decoder: y(L()) },
300
112
  validator: {
301
113
  suffixed: !0,
302
- decoder: N(y(U()))
114
+ decoder: D(y(L()))
303
115
  }
304
116
  }).map((e) => {
305
117
  const t = { ...e };
306
118
  if (e.uid || (t.uid = `${e.path}-${e.type}`), e.type === "repeater") {
307
119
  const r = e.props;
308
- t.props = { ...r, template: ze.parse(r.template) };
120
+ t.props = { ...r, template: Ue.parse(r.template) };
309
121
  }
310
122
  return t;
311
- }), Tr = jt(() => {
312
- const e = Ar("kind", {
313
- input: Dr,
314
- layout: ze,
315
- display: Pr,
316
- action: Fr
123
+ }), Ir = Et(() => {
124
+ const e = ar("kind", {
125
+ input: wr,
126
+ layout: Ue,
127
+ display: Ar,
128
+ action: Er
317
129
  });
318
- return new C(
319
- (t) => typeof t == "function" ? Wr.decode(t) : e.decode(t)
130
+ return new he(
131
+ (t) => typeof t == "function" ? Cr.decode(t) : e.decode(t)
320
132
  );
321
- }), ze = ee({
322
- kind: { decoder: G("layout") },
323
- uid: { decoder: be },
324
- type: { decoder: w() },
325
- size: { suffixed: !0, decoder: y(ye()) },
326
- include: { decoder: y(ve) },
327
- exclude: { decoder: y($e) },
328
- props: { decoder: y(U()) },
329
- on: { decoder: y(He) },
330
- children: { decoder: _e(Tr) }
331
- }), D = class D {
133
+ }), Ue = J({
134
+ kind: { decoder: H("layout") },
135
+ uid: { decoder: Me },
136
+ type: { decoder: E() },
137
+ size: { suffixed: !0, decoder: y(me()) },
138
+ include: { decoder: y(ge) },
139
+ exclude: { decoder: y(ye) },
140
+ props: { decoder: y(L()) },
141
+ on: { decoder: y(_e) },
142
+ children: { decoder: Re(Ir) }
143
+ }), W = class W {
332
144
  constructor() {
333
145
  this.widgetLoaders = {}, this._ready = !1;
334
146
  }
@@ -343,11 +155,11 @@ const Or = (e) => typeof e != "function" && e.kind === "display", ue = (e) => ty
343
155
  }
344
156
  async loadWidget(t) {
345
157
  const r = this.widgetLoaders[t];
346
- if (!D.sharedCache.has(r)) {
347
- const n = r().catch((o) => (D.sharedCache.delete(r), Promise.reject(o)));
348
- D.sharedCache.set(r, n);
158
+ if (!W.sharedCache.has(r)) {
159
+ const n = r().catch((o) => (W.sharedCache.delete(r), Promise.reject(o)));
160
+ W.sharedCache.set(r, n);
349
161
  }
350
- return D.sharedCache.get(r);
162
+ return W.sharedCache.get(r);
351
163
  }
352
164
  /**
353
165
  * Loads the given widget types (default: every configured type) and stores each
@@ -359,7 +171,7 @@ const Or = (e) => typeof e != "function" && e.kind === "display", ue = (e) => ty
359
171
  await Promise.all(
360
172
  r.map(async (n) => {
361
173
  const o = await this.loadWidget(n);
362
- D.resolvedCache.set(this.widgetLoaders[n], o);
174
+ W.resolvedCache.set(this.widgetLoaders[n], o);
363
175
  })
364
176
  );
365
177
  }
@@ -370,31 +182,31 @@ const Or = (e) => typeof e != "function" && e.kind === "display", ue = (e) => ty
370
182
  getIfLoaded(t) {
371
183
  const r = this.widgetLoaders[t];
372
184
  if (r)
373
- return D.resolvedCache.get(r);
185
+ return W.resolvedCache.get(r);
374
186
  }
375
187
  };
376
- D.sharedCache = /* @__PURE__ */ new Map(), D.resolvedCache = /* @__PURE__ */ new Map();
377
- let ce = D;
378
- async function is(e) {
379
- const t = new ce();
188
+ W.sharedCache = /* @__PURE__ */ new Map(), W.resolvedCache = /* @__PURE__ */ new Map();
189
+ let ie = W;
190
+ async function Yo(e) {
191
+ const t = new ie();
380
192
  t.setWidgetLoaders(e.widgetLoaders), await t.preloadWidgets();
381
193
  }
382
- function Nr(e) {
383
- We(e, "#0");
194
+ function Or(e) {
195
+ je(e, "#0");
384
196
  }
385
- function We(e, t) {
386
- if (T(e)) {
197
+ function je(e, t) {
198
+ if (P(e)) {
387
199
  e.uid || (e.uid = `${t}.f`);
388
200
  return;
389
201
  }
390
- if (e.uid || (e.uid = t), H(e) && e.children.forEach((r, n) => {
391
- We(r, `${t}.${n}`);
392
- }), j(e) && e.type === "repeater") {
202
+ if (e.uid || (e.uid = t), _(e) && e.children.forEach((r, n) => {
203
+ je(r, `${t}.${n}`);
204
+ }), I(e) && e.type === "repeater") {
393
205
  const r = e.props?.template;
394
- r && We(r, `${t}.t`);
206
+ r && je(r, `${t}.t`);
395
207
  }
396
208
  }
397
- function us(e) {
209
+ function ei(e) {
398
210
  return {
399
211
  ...e,
400
212
  form: {
@@ -405,12 +217,12 @@ function us(e) {
405
217
  }
406
218
  };
407
219
  }
408
- const Ft = Y({
409
- states: y(wr(w())),
410
- form: jt(() => ze)
411
- }).map((e) => (Nr(e.form), e)), Wt = (e) => ({
220
+ const wt = q({
221
+ states: y(fr(E())),
222
+ form: Et(() => Ue)
223
+ }).map((e) => (Or(e.form), e)), It = (e) => ({
412
224
  formName: "",
413
- formDef: Ft.parse({
225
+ formDef: wt.parse({
414
226
  form: {
415
227
  kind: "layout",
416
228
  type: "flex",
@@ -434,16 +246,16 @@ const Ft = Y({
434
246
  touched: !1,
435
247
  allControlsValidated: !1,
436
248
  lang: e
437
- }), cs = {
249
+ }), ti = {
438
250
  submit: "formSubmit",
439
251
  health: "formHealth",
440
252
  event: "formEvent"
441
- }, Vr = (e) => !(typeof e != "object" || e === null || typeof e.key != "string");
442
- function ds(e) {
253
+ }, kr = (e) => !(typeof e != "object" || e === null || typeof e.key != "string");
254
+ function ri(e) {
443
255
  const t = new Intl.Locale(e).maximize().script;
444
256
  return ["Arab", "Hebr", "Thaa", "Syrc", "Tfng", "Adlm", "Rohg"].includes(t || "") ? "rtl" : "ltr";
445
257
  }
446
- const Rr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
258
+ const jr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
447
259
  const t = /* @__PURE__ */ new Set();
448
260
  return {
449
261
  get lang() {
@@ -461,7 +273,7 @@ const Rr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
461
273
  e = n, t.forEach((o) => o(e));
462
274
  }
463
275
  };
464
- }, F = {
276
+ }, k = {
465
277
  calculateCurrentStateError: 10,
466
278
  calculateWidgetFlagsError: 11,
467
279
  calculateWidgetPropsError: 12,
@@ -471,13 +283,13 @@ const Rr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
471
283
  initializeMalformedFormShapeError: 23,
472
284
  widgetCouldNotBeLoaded: 30,
473
285
  resolveStringInterpolationError: 40
474
- }, Lr = (e) => {
286
+ }, Wr = (e) => {
475
287
  throw new Error(`Unhandled case: ${JSON.stringify(e)}`);
476
- }, M = (e, t) => {
288
+ }, V = (e, t) => {
477
289
  if (e === void 0)
478
290
  throw new Error("obj is undefined");
479
291
  return t.split(".").reduce((r, n) => r === void 0 || n === "" ? r : Array.isArray(r) ? r[parseInt(n, 10)] : r[n], e);
480
- }, Mr = (e, t) => {
292
+ }, Pr = (e, t) => {
481
293
  if (t === "")
482
294
  return !1;
483
295
  let r = e;
@@ -496,7 +308,7 @@ const Rr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
496
308
  }
497
309
  }
498
310
  return !0;
499
- }, De = (e, t, r) => {
311
+ }, We = (e, t, r) => {
500
312
  if (e === null)
501
313
  throw new Error("object is null");
502
314
  if (e === void 0)
@@ -505,161 +317,161 @@ const Rr = (e = typeof navigator < "u" && navigator.language || "en-US") => {
505
317
  throw new Error("path cannot be empty");
506
318
  const n = t.split(".");
507
319
  let o = e;
508
- for (let i = 0; i < n.length - 1; i++) {
509
- const u = n[i], d = n[i + 1];
510
- (o[u] == null || typeof o[u] != "object") && (o[u] = Tt(d) ? [] : {}), o = o[u];
320
+ for (let s = 0; s < n.length - 1; s++) {
321
+ const c = n[s], u = n[s + 1];
322
+ (o[c] == null || typeof o[c] != "object") && (o[c] = kt(u) ? [] : {}), o = o[c];
511
323
  }
512
- const s = n[n.length - 1];
513
- return o[s] = r, e;
514
- }, Dt = (e, t, r) => {
324
+ const i = n[n.length - 1];
325
+ return o[i] = r, e;
326
+ }, Ot = (e, t, r) => {
515
327
  if (e === null)
516
328
  throw new Error("object is null");
517
329
  if (e === void 0)
518
330
  throw new Error("object is undefined");
519
331
  if (t === "")
520
332
  throw new Error("path cannot be empty");
521
- const n = t.split("."), o = ct(e);
522
- let s = o;
523
- for (let i = 0; i < n.length - 1; i++) {
524
- const u = n[i], d = n[i + 1];
525
- s[u] == null || typeof s[u] != "object" ? s[u] = Tt(d) ? [] : {} : s[u] = ct(s[u]), s = s[u];
526
- }
527
- return s[n[n.length - 1]] = r, o;
528
- }, ct = (e) => Array.isArray(e) ? e.slice() : { ...e }, _r = (e, t) => {
333
+ const n = t.split("."), o = ot(e);
334
+ let i = o;
335
+ for (let s = 0; s < n.length - 1; s++) {
336
+ const c = n[s], u = n[s + 1];
337
+ i[c] == null || typeof i[c] != "object" ? i[c] = kt(u) ? [] : {} : i[c] = ot(i[c]), i = i[c];
338
+ }
339
+ return i[n[n.length - 1]] = r, o;
340
+ }, ot = (e) => Array.isArray(e) ? e.slice() : { ...e }, Dr = (e, t) => {
529
341
  if (t === "")
530
342
  return e;
531
343
  const r = t.split("."), n = [e];
532
- for (let i = 0; i < r.length - 1; i++) {
533
- const u = n[i];
534
- if (u == null || typeof u != "object")
344
+ for (let s = 0; s < r.length - 1; s++) {
345
+ const c = n[s];
346
+ if (c == null || typeof c != "object")
535
347
  return e;
536
- const d = r[i], l = Array.isArray(u) ? u[parseInt(d, 10)] : u[d];
348
+ const u = r[s], l = Array.isArray(c) ? c[parseInt(u, 10)] : c[u];
537
349
  if (l == null || typeof l != "object")
538
350
  return e;
539
351
  n.push(l);
540
352
  }
541
- const o = n[n.length - 1], s = r[r.length - 1];
542
- Array.isArray(o) ? o.splice(parseInt(s, 10), 1) : delete o[s];
543
- for (let i = n.length - 1; i >= 1; i--) {
544
- const u = n[i];
545
- if (Array.isArray(u) || !Ur(u))
353
+ const o = n[n.length - 1], i = r[r.length - 1];
354
+ Array.isArray(o) ? o.splice(parseInt(i, 10), 1) : delete o[i];
355
+ for (let s = n.length - 1; s >= 1; s--) {
356
+ const c = n[s];
357
+ if (Array.isArray(c) || !Fr(c))
546
358
  break;
547
- const d = n[i - 1], l = r[i - 1];
548
- if (Array.isArray(d))
359
+ const u = n[s - 1], l = r[s - 1];
360
+ if (Array.isArray(u))
549
361
  break;
550
- delete d[l];
362
+ delete u[l];
551
363
  }
552
364
  return e;
553
365
  };
554
- function Tt(e) {
366
+ function kt(e) {
555
367
  const t = Number(e);
556
368
  return Number.isInteger(t) && t >= 0 && t.toString() === e;
557
369
  }
558
- function Ur(e) {
370
+ function Fr(e) {
559
371
  return e != null && typeof e == "object" && !Array.isArray(e) && Object.keys(e).length === 0;
560
372
  }
561
- function de(e) {
373
+ function se(e) {
562
374
  if (e === null || typeof e != "object")
563
375
  return e;
564
376
  if (Array.isArray(e))
565
- return e.map((r) => de(r));
377
+ return e.map((r) => se(r));
566
378
  const t = {};
567
379
  for (const r of Object.keys(e))
568
- t[r] = de(e[r]);
380
+ t[r] = se(e[r]);
569
381
  return t;
570
382
  }
571
- function Be(e) {
383
+ function He(e) {
572
384
  return e.flatMap((t) => [
573
385
  t,
574
- ...H(t) ? Be(t.children) : []
386
+ ..._(t) ? He(t.children) : []
575
387
  ]);
576
388
  }
577
- function Se(e) {
389
+ function ve(e) {
578
390
  return Object.entries(e.validations).sort(
579
391
  ([n], [o]) => n.split(".").length - o.split(".").length
580
392
  ).reduce(
581
- (n, [o, s]) => (s !== null && (n.$formIsInvalid = !0, De(n.$errors, o, [...s])), n),
393
+ (n, [o, i]) => (i !== null && (n.$formIsInvalid = !0, We(n.$errors, o, [...i])), n),
582
394
  { $formIsInvalid: !1, $errors: {} }
583
395
  );
584
396
  }
585
- function R(e) {
397
+ function T(e) {
586
398
  if (e !== void 0)
587
- return j(e) || T(e) ? e.path : void 0;
399
+ return I(e) || P(e) ? e.path : void 0;
588
400
  }
589
- function Ie(e) {
590
- const t = de(e.data);
401
+ function we(e) {
402
+ const t = se(e.data);
591
403
  for (const [r, n] of Object.entries(e.widgetFlags))
592
404
  if (n.hidden === !0) {
593
- const o = R(e.resolvedSources[r]);
594
- o !== void 0 && _r(t, o);
405
+ const o = T(e.resolvedSources[r]);
406
+ o !== void 0 && Dr(t, o);
595
407
  }
596
408
  return t;
597
409
  }
598
- const Ae = (e) => !T(e) && e.type === "repeater", te = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((t) => parseInt(t[1], 10));
599
- function Te(e, t) {
410
+ const $e = (e) => !P(e) && e.type === "repeater", Z = (e) => [...e.matchAll(/\[(\d+)\]/g)].map((t) => parseInt(t[1], 10));
411
+ function Pe(e, t) {
600
412
  const r = { resolvedSources: {}, repeaterItemScopes: {} };
601
413
  for (const n of Object.values(e))
602
- r.resolvedSources[n.uid] = n, Ae(n) && Nt(n, [], t, r);
414
+ r.resolvedSources[n.uid] = n, $e(n) && jt(n, [], t, r);
603
415
  return r;
604
416
  }
605
- function Nt(e, t, r, n) {
606
- const o = M(r, e.path);
417
+ function jt(e, t, r, n) {
418
+ const o = V(r, e.path);
607
419
  if (!Array.isArray(o))
608
420
  return;
609
- const s = Be([e.props.template]);
610
- o.forEach((i, u) => {
611
- const d = [...t, u], l = {
612
- itemPath: `${e.path}.${u}`,
613
- index: u
421
+ const i = He([e.props.template]);
422
+ o.forEach((s, c) => {
423
+ const u = [...t, c], l = {
424
+ itemPath: `${e.path}.${c}`,
425
+ index: c
614
426
  };
615
- for (const a of s) {
616
- const p = Vt(a, d);
427
+ for (const a of i) {
428
+ const p = Wt(a, u);
617
429
  n.resolvedSources[p.uid] = p, n.repeaterItemScopes[p.uid] = l;
618
- const g = Hr(a, p, d, r, i, u);
619
- g && Nt(g, d, r, n);
430
+ const g = Tr(a, p, u, r, s, c);
431
+ g && jt(g, u, r, n);
620
432
  }
621
433
  });
622
434
  }
623
- function Hr(e, t, r, n, o, s) {
624
- if (Ae(t))
435
+ function Tr(e, t, r, n, o, i) {
436
+ if ($e(t))
625
437
  return t;
626
- if (!T(e))
438
+ if (!P(e))
627
439
  return;
628
- const i = e({
440
+ const s = e({
629
441
  $form: n,
630
442
  $item: o,
631
- $index: s,
443
+ $index: i,
632
444
  errors: void 0,
633
445
  touched: void 0,
634
446
  translate: void 0
635
447
  });
636
- if (i.type !== "repeater")
448
+ if (s.type !== "repeater")
637
449
  return;
638
- const u = { ...i, uid: e.uid };
639
- return Vt(u, r);
450
+ const c = { ...s, uid: e.uid };
451
+ return Wt(c, r);
640
452
  }
641
- function Vt(e, t) {
642
- const r = Ge(e.uid, t);
643
- if (T(e)) {
453
+ function Wt(e, t) {
454
+ const r = ze(e.uid, t);
455
+ if (P(e)) {
644
456
  const n = (o) => e(o);
645
- return n.uid = r, n.type = e.type, e.path !== void 0 && (n.path = dt(e.path, t)), n;
457
+ return n.uid = r, n.type = e.type, e.path !== void 0 && (n.path = it(e.path, t)), n;
646
458
  }
647
- return j(e) ? {
459
+ return I(e) ? {
648
460
  ...e,
649
461
  uid: r,
650
- path: dt(e.path, t)
462
+ path: it(e.path, t)
651
463
  } : {
652
464
  ...e,
653
465
  uid: r
654
466
  };
655
467
  }
656
- function Ge(e, t) {
468
+ function ze(e, t) {
657
469
  if (t.length === 0)
658
470
  throw new Error("Repeater indexes cannot be an empty array");
659
471
  const r = t.reduce((n, o) => `${n}[${o}]`, "");
660
472
  return `${e}${r}`;
661
473
  }
662
- function dt(e, t) {
474
+ function it(e, t) {
663
475
  if (t.length === 0)
664
476
  throw new Error("Repeater indexes cannot be an empty array");
665
477
  const r = "items", n = e.split(`.${r}`), o = n.length - 1;
@@ -667,125 +479,125 @@ function dt(e, t) {
667
479
  throw new Error(
668
480
  `Path contains ${o} '${r}' occurrences, but ${t.length} indexes were provided.`
669
481
  );
670
- return n.reduce((s, i, u) => u === 0 ? i : `${s}.${t[u - 1]}${i}`);
482
+ return n.reduce((i, s, c) => c === 0 ? s : `${i}.${t[c - 1]}${s}`);
671
483
  }
672
- function br(e, t) {
484
+ function Nr(e, t) {
673
485
  let r = 0;
674
486
  return e.replace(/\.items(\??)\./g, (n, o) => {
675
- const s = t[r++];
676
- return s === void 0 ? n : `.${s}${o}.`;
487
+ const i = t[r++];
488
+ return i === void 0 ? n : `.${i}${o}.`;
677
489
  });
678
490
  }
679
- const lt = ["include", "exclude", "disabled", "readonly"];
680
- function zr(e, t) {
681
- if (!lt.some(
682
- (o) => at(e[o])
491
+ const st = ["include", "exclude", "disabled", "readonly"];
492
+ function Vr(e, t) {
493
+ if (!st.some(
494
+ (o) => ct(e[o])
683
495
  ))
684
496
  return e;
685
497
  const n = { ...e };
686
- for (const o of lt) {
687
- const s = n[o];
688
- at(s) && (n[o] = {
689
- ...s,
690
- when: br(s.when, t)
498
+ for (const o of st) {
499
+ const i = n[o];
500
+ ct(i) && (n[o] = {
501
+ ...i,
502
+ when: Nr(i.when, t)
691
503
  });
692
504
  }
693
505
  return n;
694
506
  }
695
- function at(e) {
507
+ function ct(e) {
696
508
  return e !== null && typeof e == "object" && "when" in e && typeof e.when == "string";
697
509
  }
698
- const Br = 50, Gr = (e) => {
699
- let t = e.data, r = Te(e.flatForm, t);
700
- for (let n = 0; n < Br; n++) {
510
+ const Rr = 50, Lr = (e) => {
511
+ let t = e.data, r = Pe(e.flatForm, t);
512
+ for (let n = 0; n < Rr; n++) {
701
513
  let o = !1;
702
- for (const s of Object.values(r.resolvedSources))
703
- !j(s) || Mr(t, s.path) || (t = Dt(t, s.path, de(s.defaultValue)), s.defaultValue !== void 0 && (o = !0));
514
+ for (const i of Object.values(r.resolvedSources))
515
+ !I(i) || Pr(t, i.path) || (t = Ot(t, i.path, se(i.defaultValue)), i.defaultValue !== void 0 && (o = !0));
704
516
  if (!o)
705
517
  break;
706
- r = Te(e.flatForm, t);
518
+ r = Pe(e.flatForm, t);
707
519
  }
708
520
  return { ...e, data: t, ...r };
709
- }, Ke = 32;
710
- let Ne, h, m, v = (e) => (h = 0, m = e, v.newline = !1, e = S(), m[h] ? z() : e || ""), z = (e = "Unexpected token", t = h, r = m.slice(0, t).split(`
711
- `), n = r.pop(), o = m.slice(Math.max(0, t - 40), t), s = "̭", i = (m[t] || " ") + s, u = m.slice(t + 1, t + 20)) => {
521
+ }, be = 32;
522
+ let De, h, m, v = (e) => (h = 0, m = e, v.newline = !1, e = S(), m[h] ? M() : e || ""), M = (e = "Unexpected token", t = h, r = m.slice(0, t).split(`
523
+ `), n = r.pop(), o = m.slice(Math.max(0, t - 40), t), i = "̭", s = (m[t] || " ") + i, c = m.slice(t + 1, t + 20)) => {
712
524
  throw SyntaxError(`${e} at ${r.length + 1}:${n.length + 1}
713
525
  ${m[t - 41] !== `
714
- `, "" + o}${i}${u}`);
715
- }, Rt = (e, t = h) => (Array.isArray(e) && (e.loc = t), e), x = (e, t = h, r) => {
526
+ `, "" + o}${s}${c}`);
527
+ }, Pt = (e, t = h) => (Array.isArray(e) && (e.loc = t), e), b = (e, t = h, r) => {
716
528
  for (; r = e(m.charCodeAt(h)); ) h += r;
717
529
  return m.slice(t, h);
718
- }, O = (e = 1) => m[h += e], Ve = (e) => h = e, S = (e = 0, t) => {
719
- let r, n, o, s, i;
720
- for (t && v.asi && (v.newline = !1); (r = v.space()) && (i = v.newline, 1) && r !== t && (o = // ASI before [ on new line (access handler would consume it; lineBreak distinguishes real \n from synthetic } flag)
721
- (n && r === 91 && Ne && v.asi?.(n, e, S) || null) ?? ((s = W[r]) && s(n, e)) ?? (n && i && v.asi?.(n, e, S)) ?? (!n && x(v.id))); ) n = o;
722
- return t && (r == t ? (h++, t === 125 && v.asi && (v.newline = !0)) : z("Unclosed " + String.fromCharCode(t - (t > 42 ? 2 : 1)))), n;
723
- }, L = (e, t = h) => {
724
- for (Ne = !1; (e = m.charCodeAt(h)) <= Ke; )
725
- v.asi && e === 10 && (v.newline = Ne = !0), h++;
530
+ }, C = (e = 1) => m[h += e], Fe = (e) => h = e, S = (e = 0, t) => {
531
+ let r, n, o, i, s;
532
+ for (t && v.asi && (v.newline = !1); (r = v.space()) && (s = v.newline, 1) && r !== t && (o = // ASI before [ on new line (access handler would consume it; lineBreak distinguishes real \n from synthetic } flag)
533
+ (n && r === 91 && De && v.asi?.(n, e, S) || null) ?? ((i = j[r]) && i(n, e)) ?? (n && s && v.asi?.(n, e, S)) ?? (!n && b(v.id))); ) n = o;
534
+ return t && (r == t ? (h++, t === 125 && v.asi && (v.newline = !0)) : M("Unclosed " + String.fromCharCode(t - (t > 42 ? 2 : 1)))), n;
535
+ }, N = (e, t = h) => {
536
+ for (De = !1; (e = m.charCodeAt(h)) <= be; )
537
+ v.asi && e === 10 && (v.newline = De = !0), h++;
726
538
  return e;
727
- }, Kr = (e = h) => {
728
- for (; m.charCodeAt(e) <= Ke; ) e++;
539
+ }, _r = (e = h) => {
540
+ for (; m.charCodeAt(e) <= be; ) e++;
729
541
  return m.charCodeAt(e);
730
542
  };
731
543
  v.id = (e) => e >= 48 && e <= 57 || e >= 65 && e <= 90 || e >= 97 && e <= 122 || e == 36 || e == 95 || e >= 192 && e != 215 && e != 247;
732
- let xr = (e, t = e.length) => m.substr(h, t) === e && !v.id(m.charCodeAt(h + t)), W = [], ft = {}, P = (e, t = Ke, r, n = e.charCodeAt(0), o = e.length, s = W[n], i = e.toUpperCase() !== e, u, d) => (t = ft[e] = !s && ft[e] || t, W[n] = (l, a, p, g = h) => (u = p, (p ? e == p : (o < 2 || e.charCodeAt(1) === m.charCodeAt(h + 1) && (o < 3 || m.substr(h, o) == e)) && (!i || !v.id(m.charCodeAt(h + o))) && (u = p = e)) && a < t && (h += o, (d = r(l)) ? Rt(d, g) : (h = g, u = 0, !i && !s && !l && z()), d) || s?.(l, a, u))), $ = (e, t, r = !1) => P(e, t, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(S(t - (r ? 0.5 : 0)))), _ = (e, t, r) => P(e, t, (n) => !n && (n = S(t - 0.5)) && [e, n]), re = (e, t) => P(e, 200, (r) => !r && [, t]), Lt = (e, t, r) => P(
544
+ let Mr = (e, t = e.length) => m.substr(h, t) === e && !v.id(m.charCodeAt(h + t)), j = [], dt = {}, O = (e, t = be, r, n = e.charCodeAt(0), o = e.length, i = j[n], s = e.toUpperCase() !== e, c, u) => (t = dt[e] = !i && dt[e] || t, j[n] = (l, a, p, g = h) => (c = p, (p ? e == p : (o < 2 || e.charCodeAt(1) === m.charCodeAt(h + 1) && (o < 3 || m.substr(h, o) == e)) && (!s || !v.id(m.charCodeAt(h + o))) && (c = p = e)) && a < t && (h += o, (u = r(l)) ? Pt(u, g) : (h = g, c = 0, !s && !i && !l && M()), u) || i?.(l, a, c))), $ = (e, t, r = !1) => O(e, t, (n) => n && /* @__PURE__ */ ((o) => o && [e, n, o])(S(t - (r ? 0.5 : 0)))), R = (e, t, r) => O(e, t, (n) => !n && (n = S(t - 0.5)) && [e, n]), Y = (e, t) => O(e, 200, (r) => !r && [, t]), Dt = (e, t, r) => O(
733
545
  e,
734
546
  t,
735
547
  (n, o) => (o = S(t - (r ? 0.5 : 0)), n?.[0] !== e && (n = [e, n || null]), o?.[0] === e ? n.push(...o.slice(1)) : n.push(o || null), n)
736
- ), xe = (e, t) => P(e[0], t, (r) => !r && [e, S(0, e.charCodeAt(1)) || null]), Mt = (e, t) => P(e[0], t, (r) => r && [e, r, S(0, e.charCodeAt(1)) || null]), ne = (e, t, r, n = e.charCodeAt(0), o = e.length, s = W[n], i) => W[n] = (u, d, l, a = h) => !u && (l ? e == l : (o < 2 || m.substr(h, o) == e) && (l = e)) && d < t && !v.id(m.charCodeAt(h + o)) && (!v.prop || v.prop(h + o)) && (Ve(h + o), (i = r()) ? Rt(i, a) : Ve(a), i) || s?.(u, d, l);
548
+ ), Be = (e, t) => O(e[0], t, (r) => !r && [e, S(0, e.charCodeAt(1)) || null]), Ft = (e, t) => O(e[0], t, (r) => r && [e, r, S(0, e.charCodeAt(1)) || null]), ee = (e, t, r, n = e.charCodeAt(0), o = e.length, i = j[n], s) => j[n] = (c, u, l, a = h) => !c && (l ? e == l : (o < 2 || m.substr(h, o) == e) && (l = e)) && u < t && !v.id(m.charCodeAt(h + o)) && (!v.prop || v.prop(h + o)) && (Fe(h + o), (s = r()) ? Pt(s, a) : Fe(a), s) || i?.(c, u, l);
737
549
  Object.defineProperty(v, "space", {
738
550
  configurable: !0,
739
551
  enumerable: !0,
740
- get: () => L,
741
- set: (e) => L = e
552
+ get: () => N,
553
+ set: (e) => N = e
742
554
  });
743
- const Re = {}, f = (e, t, r = Re[e]) => Re[e] = (...n) => t(...n) || r?.(...n), c = (e) => Array.isArray(e) ? e[0] == null ? /* @__PURE__ */ ((t) => () => t)(e[1]) : (
555
+ const Te = {}, f = (e, t, r = Te[e]) => Te[e] = (...n) => t(...n) || r?.(...n), d = (e) => Array.isArray(e) ? e[0] == null ? /* @__PURE__ */ ((t) => () => t)(e[1]) : (
744
556
  // == catches both undefined and null
745
- Re[e[0]]?.(...e.slice(1)) ?? z(`Unknown operator: ${e[0]}`, e?.loc)
557
+ Te[e[0]]?.(...e.slice(1)) ?? M(`Unknown operator: ${e[0]}`, e?.loc)
746
558
  ) : e === void 0 ? () => {
747
- } : (t) => t?.[e], le = 46, Q = 48, ae = 57, Xr = 69, Jr = 101, Qr = 43, qr = 45, ie = 95, _t = 110, Zr = 97, Yr = 102, en = 65, tn = 70, Ut = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), Xe = (e) => {
748
- let t = Ut(x(
559
+ } : (t) => t?.[e], ce = 46, X = 48, de = 57, Ur = 69, Hr = 101, zr = 43, br = 45, ne = 95, Tt = 110, Br = 97, Gr = 102, Kr = 65, Xr = 70, Nt = (e) => e.indexOf("_") < 0 ? e : e.replaceAll("_", ""), Ge = (e) => {
560
+ let t = Nt(b(
749
561
  (r) => (
750
562
  // . is decimal only if NOT followed by another . (range operator)
751
- r === le && m.charCodeAt(h + 1) !== le || r >= Q && r <= ae || r === ie || ((r === Xr || r === Jr) && ((r = m.charCodeAt(h + 1)) >= Q && r <= ae || r === Qr || r === qr) ? 2 : 0)
563
+ r === ce && m.charCodeAt(h + 1) !== ce || r >= X && r <= de || r === ne || ((r === Ur || r === Hr) && ((r = m.charCodeAt(h + 1)) >= X && r <= de || r === zr || r === br) ? 2 : 0)
752
564
  )
753
565
  ));
754
- return m.charCodeAt(h) === _t ? (O(), [, BigInt(t)]) : (e = +t) != e ? z() : [, e];
755
- }, rn = {
756
- 2: (e) => e === 48 || e === 49 || e === ie,
757
- 8: (e) => e >= 48 && e <= 55 || e === ie,
758
- 16: (e) => e >= Q && e <= ae || e >= Zr && e <= Yr || e >= en && e <= tn || e === ie
566
+ return m.charCodeAt(h) === Tt ? (C(), [, BigInt(t)]) : (e = +t) != e ? M() : [, e];
567
+ }, xr = {
568
+ 2: (e) => e === 48 || e === 49 || e === ne,
569
+ 8: (e) => e >= 48 && e <= 55 || e === ne,
570
+ 16: (e) => e >= X && e <= de || e >= Br && e <= Gr || e >= Kr && e <= Xr || e === ne
759
571
  };
760
572
  v.number = null;
761
- W[le] = (e) => !e && m.charCodeAt(h + 1) !== le && Xe();
762
- for (let e = Q; e <= ae; e++) W[e] = (t) => t ? void 0 : Xe();
763
- W[Q] = (e) => {
573
+ j[ce] = (e) => !e && m.charCodeAt(h + 1) !== ce && Ge();
574
+ for (let e = X; e <= de; e++) j[e] = (t) => t ? void 0 : Ge();
575
+ j[X] = (e) => {
764
576
  if (e) return;
765
577
  const t = v.number;
766
578
  if (t) {
767
579
  for (const [r, n] of Object.entries(t))
768
580
  if (r[0] === "0" && m[h + 1]?.toLowerCase() === r[1]) {
769
- O(2);
770
- const o = Ut(x(rn[n]));
771
- return m.charCodeAt(h) === _t ? (O(), [, BigInt("0" + r[1] + o)]) : [, parseInt(o, n)];
581
+ C(2);
582
+ const o = Nt(b(xr[n]));
583
+ return m.charCodeAt(h) === Tt ? (C(), [, BigInt("0" + r[1] + o)]) : [, parseInt(o, n)];
772
584
  }
773
585
  }
774
- return Xe();
586
+ return Ge();
775
587
  };
776
- const nn = 92, pt = 34, ht = 39, on = { n: `
777
- `, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, Ht = (e) => (t, r, n = "") => {
588
+ const Qr = 92, ut = 34, lt = 39, qr = { n: `
589
+ `, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, Vt = (e) => (t, r, n = "") => {
778
590
  if (!(t || !v.string?.[String.fromCharCode(e)]))
779
- return O(), x((o) => o - e && (o === nn ? (n += on[m[h + 1]] || m[h + 1], 2) : (n += m[h], 1))), m[h] === String.fromCharCode(e) ? O() : z("Bad string"), [, n];
591
+ return C(), b((o) => o - e && (o === Qr ? (n += qr[m[h + 1]] || m[h + 1], 2) : (n += m[h], 1))), m[h] === String.fromCharCode(e) ? C() : M("Bad string"), [, n];
780
592
  };
781
- W[pt] = Ht(pt);
782
- W[ht] = Ht(ht);
593
+ j[ut] = Vt(ut);
594
+ j[lt] = Vt(lt);
783
595
  v.string = { '"': !0 };
784
- const sn = 20;
785
- "= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => $(e, sn, !0));
786
- const bt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = c(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "[]" && e.length === 3 ? (r = c(e[1]), n = c(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "()" && e.length === 2 ? bt(e[1], t) : (() => {
596
+ const Jr = 20;
597
+ "= += -= *= /= %= |= &= ^= >>= <<=".split(" ").map((e) => $(e, Jr, !0));
598
+ const Rt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = d(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "[]" && e.length === 3 ? (r = d(e[1]), n = d(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "()" && e.length === 2 ? Rt(e[1], t) : (() => {
787
599
  throw Error("Invalid assignment target");
788
- })(), mt = {
600
+ })(), at = {
789
601
  "=": (e, t, r) => e[t] = r,
790
602
  "+=": (e, t, r) => e[t] += r,
791
603
  "-=": (e, t, r) => e[t] -= r,
@@ -798,450 +610,450 @@ const bt = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e, o) : e[0] === "
798
610
  ">>=": (e, t, r) => e[t] >>= r,
799
611
  "<<=": (e, t, r) => e[t] <<= r
800
612
  };
801
- for (const e in mt) f(e, (t, r) => (r = c(r), bt(t, (n, o, s) => mt[e](n, o, r(s)))));
802
- const un = 30, cn = 40, dn = 140;
803
- _("!", dn);
804
- $("||", un);
805
- $("&&", cn);
806
- f("!", (e) => (e = c(e), (t) => !e(t)));
807
- f("||", (e, t) => (e = c(e), t = c(t), (r) => e(r) || t(r)));
808
- f("&&", (e, t) => (e = c(e), t = c(t), (r) => e(r) && t(r)));
809
- const ln = 50, an = 60, fn = 70, zt = 100, pn = 140;
810
- $("|", ln);
811
- $("&", fn);
812
- $("^", an);
813
- $(">>", zt);
814
- $("<<", zt);
815
- _("~", pn);
816
- f("~", (e) => (e = c(e), (t) => ~e(t)));
817
- f("|", (e, t) => (e = c(e), t = c(t), (r) => e(r) | t(r)));
818
- f("&", (e, t) => (e = c(e), t = c(t), (r) => e(r) & t(r)));
819
- f("^", (e, t) => (e = c(e), t = c(t), (r) => e(r) ^ t(r)));
820
- f(">>", (e, t) => (e = c(e), t = c(t), (r) => e(r) >> t(r)));
821
- f("<<", (e, t) => (e = c(e), t = c(t), (r) => e(r) << t(r)));
822
- const Ee = 90;
823
- $("<", Ee);
824
- $(">", Ee);
825
- $("<=", Ee);
826
- $(">=", Ee);
827
- f(">", (e, t) => (e = c(e), t = c(t), (r) => e(r) > t(r)));
828
- f("<", (e, t) => (e = c(e), t = c(t), (r) => e(r) < t(r)));
829
- f(">=", (e, t) => (e = c(e), t = c(t), (r) => e(r) >= t(r)));
830
- f("<=", (e, t) => (e = c(e), t = c(t), (r) => e(r) <= t(r)));
831
- const Bt = 80;
832
- $("==", Bt);
833
- $("!=", Bt);
834
- f("==", (e, t) => (e = c(e), t = c(t), (r) => e(r) == t(r)));
835
- f("!=", (e, t) => (e = c(e), t = c(t), (r) => e(r) != t(r)));
836
- const Gt = 110, Je = 120, Kt = 140;
837
- $("+", Gt);
838
- $("-", Gt);
839
- $("*", Je);
840
- $("/", Je);
841
- $("%", Je);
842
- _("+", Kt);
843
- _("-", Kt);
844
- f("+", (e, t) => t !== void 0 ? (e = c(e), t = c(t), (r) => e(r) + t(r)) : (e = c(e), (r) => +e(r)));
845
- f("-", (e, t) => t !== void 0 ? (e = c(e), t = c(t), (r) => e(r) - t(r)) : (e = c(e), (r) => -e(r)));
846
- f("*", (e, t) => (e = c(e), t = c(t), (r) => e(r) * t(r)));
847
- f("/", (e, t) => (e = c(e), t = c(t), (r) => e(r) / t(r)));
848
- f("%", (e, t) => (e = c(e), t = c(t), (r) => e(r) % t(r)));
849
- const fe = 150;
850
- P("++", fe, (e) => e ? ["++", e, null] : ["++", S(fe - 1)]);
851
- P("--", fe, (e) => e ? ["--", e, null] : ["--", S(fe - 1)]);
852
- const Qe = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e) : e[0] === "." ? (r = c(e[1]), n = e[2], (o) => t(r(o), n)) : e[0] === "[]" && e.length === 3 ? (r = c(e[1]), n = c(e[2]), (o) => t(r(o), n(o))) : e[0] === "()" && e.length === 2 ? Qe(e[1], t) : (
613
+ for (const e in at) f(e, (t, r) => (r = d(r), Rt(t, (n, o, i) => at[e](n, o, r(i)))));
614
+ const Zr = 30, Yr = 40, en = 140;
615
+ R("!", en);
616
+ $("||", Zr);
617
+ $("&&", Yr);
618
+ f("!", (e) => (e = d(e), (t) => !e(t)));
619
+ f("||", (e, t) => (e = d(e), t = d(t), (r) => e(r) || t(r)));
620
+ f("&&", (e, t) => (e = d(e), t = d(t), (r) => e(r) && t(r)));
621
+ const tn = 50, rn = 60, nn = 70, Lt = 100, on = 140;
622
+ $("|", tn);
623
+ $("&", nn);
624
+ $("^", rn);
625
+ $(">>", Lt);
626
+ $("<<", Lt);
627
+ R("~", on);
628
+ f("~", (e) => (e = d(e), (t) => ~e(t)));
629
+ f("|", (e, t) => (e = d(e), t = d(t), (r) => e(r) | t(r)));
630
+ f("&", (e, t) => (e = d(e), t = d(t), (r) => e(r) & t(r)));
631
+ f("^", (e, t) => (e = d(e), t = d(t), (r) => e(r) ^ t(r)));
632
+ f(">>", (e, t) => (e = d(e), t = d(t), (r) => e(r) >> t(r)));
633
+ f("<<", (e, t) => (e = d(e), t = d(t), (r) => e(r) << t(r)));
634
+ const Se = 90;
635
+ $("<", Se);
636
+ $(">", Se);
637
+ $("<=", Se);
638
+ $(">=", Se);
639
+ f(">", (e, t) => (e = d(e), t = d(t), (r) => e(r) > t(r)));
640
+ f("<", (e, t) => (e = d(e), t = d(t), (r) => e(r) < t(r)));
641
+ f(">=", (e, t) => (e = d(e), t = d(t), (r) => e(r) >= t(r)));
642
+ f("<=", (e, t) => (e = d(e), t = d(t), (r) => e(r) <= t(r)));
643
+ const _t = 80;
644
+ $("==", _t);
645
+ $("!=", _t);
646
+ f("==", (e, t) => (e = d(e), t = d(t), (r) => e(r) == t(r)));
647
+ f("!=", (e, t) => (e = d(e), t = d(t), (r) => e(r) != t(r)));
648
+ const Mt = 110, Ke = 120, Ut = 140;
649
+ $("+", Mt);
650
+ $("-", Mt);
651
+ $("*", Ke);
652
+ $("/", Ke);
653
+ $("%", Ke);
654
+ R("+", Ut);
655
+ R("-", Ut);
656
+ f("+", (e, t) => t !== void 0 ? (e = d(e), t = d(t), (r) => e(r) + t(r)) : (e = d(e), (r) => +e(r)));
657
+ f("-", (e, t) => t !== void 0 ? (e = d(e), t = d(t), (r) => e(r) - t(r)) : (e = d(e), (r) => -e(r)));
658
+ f("*", (e, t) => (e = d(e), t = d(t), (r) => e(r) * t(r)));
659
+ f("/", (e, t) => (e = d(e), t = d(t), (r) => e(r) / t(r)));
660
+ f("%", (e, t) => (e = d(e), t = d(t), (r) => e(r) % t(r)));
661
+ const ue = 150;
662
+ O("++", ue, (e) => e ? ["++", e, null] : ["++", S(ue - 1)]);
663
+ O("--", ue, (e) => e ? ["--", e, null] : ["--", S(ue - 1)]);
664
+ const Xe = (e, t, r, n) => typeof e == "string" ? (o) => t(o, e) : e[0] === "." ? (r = d(e[1]), n = e[2], (o) => t(r(o), n)) : e[0] === "[]" && e.length === 3 ? (r = d(e[1]), n = d(e[2]), (o) => t(r(o), n(o))) : e[0] === "()" && e.length === 2 ? Xe(e[1], t) : (
853
665
  // unwrap parens: (x)++
854
666
  (() => {
855
667
  throw Error("Invalid increment target");
856
668
  })()
857
669
  );
858
- f("++", (e, t) => Qe(e, t === null ? (r, n) => r[n]++ : (r, n) => ++r[n]));
859
- f("--", (e, t) => Qe(e, t === null ? (r, n) => r[n]-- : (r, n) => --r[n]));
860
- const hn = 5, mn = 10;
861
- Lt(",", mn);
862
- Lt(";", hn, !0);
863
- const xt = (...e) => (e = e.map(c), (t) => {
670
+ f("++", (e, t) => Xe(e, t === null ? (r, n) => r[n]++ : (r, n) => ++r[n]));
671
+ f("--", (e, t) => Xe(e, t === null ? (r, n) => r[n]-- : (r, n) => --r[n]));
672
+ const sn = 5, cn = 10;
673
+ Dt(",", cn);
674
+ Dt(";", sn, !0);
675
+ const Ht = (...e) => (e = e.map(d), (t) => {
864
676
  let r;
865
677
  for (const n of e) r = n(t);
866
678
  return r;
867
679
  });
868
- f(",", xt);
869
- f(";", xt);
870
- const gn = 170;
871
- xe("()", gn);
872
- const V = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", qe = 170;
873
- Mt("[]", qe);
874
- $(".", qe);
875
- Mt("()", qe);
876
- const pe = (e) => {
680
+ f(",", Ht);
681
+ f(";", Ht);
682
+ const dn = 170;
683
+ Be("()", dn);
684
+ const F = (e) => e?.[0] === "_" && e[1] === "_" || e === "constructor" || e === "prototype", xe = 170;
685
+ Ft("[]", xe);
686
+ $(".", xe);
687
+ Ft("()", xe);
688
+ const le = (e) => {
877
689
  throw Error(e);
878
690
  };
879
691
  f("[]", (e, t) => t === void 0 ? (e = e ? e[0] === "," ? e.slice(1) : [e] : [], e = e.map((r) => r == null ? (() => {
880
- }) : r[0] === "..." ? (r = c(r[1]), (n) => r(n)) : (r = c(r), (n) => [r(n)])), (r) => e.flatMap((n) => n(r))) : (t == null && pe("Missing index"), e = c(e), t = c(t), (r) => {
692
+ }) : r[0] === "..." ? (r = d(r[1]), (n) => r(n)) : (r = d(r), (n) => [r(n)])), (r) => e.flatMap((n) => n(r))) : (t == null && le("Missing index"), e = d(e), t = d(t), (r) => {
881
693
  const n = t(r);
882
- return V(n) ? void 0 : e(r)[n];
694
+ return F(n) ? void 0 : e(r)[n];
883
695
  }));
884
- f(".", (e, t) => (e = c(e), t = t[0] ? t : t[1], V(t) ? () => {
696
+ f(".", (e, t) => (e = d(e), t = t[0] ? t : t[1], F(t) ? () => {
885
697
  } : (r) => e(r)[t]));
886
698
  f("()", (e, t) => {
887
- if (t === void 0) return e == null ? pe("Empty ()") : c(e);
888
- const r = (o) => o?.[0] === "," && o.slice(1).some((s) => s == null || r(s));
889
- r(t) && pe("Empty argument");
890
- const n = t ? t[0] === "," ? (t = t.slice(1).map(c), (o) => t.map((s) => s(o))) : (t = c(t), (o) => [t(o)]) : () => [];
891
- return Ze(e, (o, s, i) => o[s](...n(i)));
699
+ if (t === void 0) return e == null ? le("Empty ()") : d(e);
700
+ const r = (o) => o?.[0] === "," && o.slice(1).some((i) => i == null || r(i));
701
+ r(t) && le("Empty argument");
702
+ const n = t ? t[0] === "," ? (t = t.slice(1).map(d), (o) => t.map((i) => i(o))) : (t = d(t), (o) => [t(o)]) : () => [];
703
+ return Qe(e, (o, i, s) => o[i](...n(s)));
892
704
  });
893
- const B = (e) => typeof e == "string" || Array.isArray(e) && (e[0] === "." || e[0] === "?." || e[0] === "[]" && e.length === 3 || e[0] === "?.[]" || e[0] === "()" && e.length === 2 && B(e[1]) || e[0] === "{}"), Ze = (e, t, r, n) => e == null ? pe("Empty ()") : e[0] === "()" && e.length == 2 ? Ze(e[1], t) : typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = c(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "?." ? (r = c(e[1]), n = e[2], (o) => {
894
- const s = r(o);
895
- return s == null ? void 0 : t(s, n, o);
896
- }) : e[0] === "[]" && e.length === 3 ? (r = c(e[1]), n = c(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "?.[]" ? (r = c(e[1]), n = c(e[2]), (o) => {
897
- const s = r(o);
898
- return s == null ? void 0 : t(s, n(o), o);
899
- }) : (e = c(e), (o) => t([e(o)], 0, o)), X = Ze, yn = 32, vn = v.space;
705
+ const U = (e) => typeof e == "string" || Array.isArray(e) && (e[0] === "." || e[0] === "?." || e[0] === "[]" && e.length === 3 || e[0] === "?.[]" || e[0] === "()" && e.length === 2 && U(e[1]) || e[0] === "{}"), Qe = (e, t, r, n) => e == null ? le("Empty ()") : e[0] === "()" && e.length == 2 ? Qe(e[1], t) : typeof e == "string" ? (o) => t(o, e, o) : e[0] === "." ? (r = d(e[1]), n = e[2], (o) => t(r(o), n, o)) : e[0] === "?." ? (r = d(e[1]), n = e[2], (o) => {
706
+ const i = r(o);
707
+ return i == null ? void 0 : t(i, n, o);
708
+ }) : e[0] === "[]" && e.length === 3 ? (r = d(e[1]), n = d(e[2]), (o) => t(r(o), n(o), o)) : e[0] === "?.[]" ? (r = d(e[1]), n = d(e[2]), (o) => {
709
+ const i = r(o);
710
+ return i == null ? void 0 : t(i, n(o), o);
711
+ }) : (e = d(e), (o) => t([e(o)], 0, o)), B = Qe, un = 32, ln = v.space;
900
712
  v.comment ??= { "//": `
901
713
  `, "/*": "*/" };
902
- let ke;
714
+ let Ie;
903
715
  v.space = () => {
904
- ke || (ke = Object.entries(v.comment).map(([o, s]) => [o, s, o.charCodeAt(0)]));
905
- for (var e; e = vn(); ) {
906
- for (var t = 0, r; r = ke[t++]; )
716
+ Ie || (Ie = Object.entries(v.comment).map(([o, i]) => [o, i, o.charCodeAt(0)]));
717
+ for (var e; e = ln(); ) {
718
+ for (var t = 0, r; r = Ie[t++]; )
907
719
  if (e === r[2] && m.substr(h, r[0].length) === r[0]) {
908
720
  var n = h + r[0].length;
909
721
  if (r[1] === `
910
- `) for (; m.charCodeAt(n) >= yn; ) n++;
722
+ `) for (; m.charCodeAt(n) >= un; ) n++;
911
723
  else {
912
724
  for (; m[n] && m.substr(n, r[1].length) !== r[1]; ) n++;
913
725
  m[n] && (n += r[1].length);
914
726
  }
915
- Ve(n), e = 0;
727
+ Fe(n), e = 0;
916
728
  break;
917
729
  }
918
730
  if (e) return e;
919
731
  }
920
732
  return e;
921
733
  };
922
- const Xt = 80;
923
- $("===", Xt);
924
- $("!==", Xt);
925
- f("===", (e, t) => (e = c(e), t = c(t), (r) => e(r) === t(r)));
926
- f("!==", (e, t) => (e = c(e), t = c(t), (r) => e(r) !== t(r)));
927
- const $n = 30;
928
- $("??", $n);
929
- f("??", (e, t) => (e = c(e), t = c(t), (r) => e(r) ?? t(r)));
930
- const Sn = 130, An = 20;
931
- $("**", Sn, !0);
932
- $("**=", An, !0);
933
- f("**", (e, t) => (e = c(e), t = c(t), (r) => e(r) ** t(r)));
934
- const En = (e) => {
734
+ const zt = 80;
735
+ $("===", zt);
736
+ $("!==", zt);
737
+ f("===", (e, t) => (e = d(e), t = d(t), (r) => e(r) === t(r)));
738
+ f("!==", (e, t) => (e = d(e), t = d(t), (r) => e(r) !== t(r)));
739
+ const an = 30;
740
+ $("??", an);
741
+ f("??", (e, t) => (e = d(e), t = d(t), (r) => e(r) ?? t(r)));
742
+ const fn = 130, pn = 20;
743
+ $("**", fn, !0);
744
+ $("**=", pn, !0);
745
+ f("**", (e, t) => (e = d(e), t = d(t), (r) => e(r) ** t(r)));
746
+ const hn = (e) => {
935
747
  throw Error(e);
936
748
  };
937
- f("**=", (e, t) => (B(e) || En("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] **= t(o))));
938
- const Jt = 90;
939
- $("in", Jt);
940
- $("of", Jt);
941
- f("in", (e, t) => (e = c(e), t = c(t), (r) => e(r) in t(r)));
942
- const wn = 20, On = 100, Cn = (e) => {
749
+ f("**=", (e, t) => (U(e) || hn("Invalid assignment target"), t = d(t), B(e, (r, n, o) => r[n] **= t(o))));
750
+ const bt = 90;
751
+ $("in", bt);
752
+ $("of", bt);
753
+ f("in", (e, t) => (e = d(e), t = d(t), (r) => e(r) in t(r)));
754
+ const mn = 20, gn = 100, yn = (e) => {
943
755
  throw Error(e);
944
756
  };
945
- $(">>>", On);
946
- $(">>>=", wn, !0);
947
- f(">>>", (e, t) => (e = c(e), t = c(t), (r) => e(r) >>> t(r)));
948
- f(">>>=", (e, t) => (B(e) || Cn("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] >>>= t(o))));
949
- const Ye = 5, In = 10, kn = 20, jn = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, he = (e, t, r) => {
757
+ $(">>>", gn);
758
+ $(">>>=", mn, !0);
759
+ f(">>>", (e, t) => (e = d(e), t = d(t), (r) => e(r) >>> t(r)));
760
+ f(">>>=", (e, t) => (U(e) || yn("Invalid assignment target"), t = d(t), B(e, (r, n, o) => r[n] >>>= t(o))));
761
+ const qe = 5, vn = 10, $n = 20, Sn = (e) => e[0]?.[0] === "," ? e[0].slice(1) : e, ae = (e, t, r) => {
950
762
  if (typeof e == "string") {
951
763
  r[e] = t;
952
764
  return;
953
765
  }
954
- const [n, ...o] = e, s = jn(o);
766
+ const [n, ...o] = e, i = Sn(o);
955
767
  if (n === "{}") {
956
- const i = [];
957
- for (const u of s) {
958
- if (Array.isArray(u) && u[0] === "...") {
768
+ const s = [];
769
+ for (const c of i) {
770
+ if (Array.isArray(c) && c[0] === "...") {
959
771
  const g = {};
960
- for (const I in t) i.includes(I) || (g[I] = t[I]);
961
- r[u[1]] = g;
772
+ for (const w in t) s.includes(w) || (g[w] = t[w]);
773
+ r[c[1]] = g;
962
774
  break;
963
775
  }
964
- let d, l, a;
965
- typeof u == "string" ? d = l = u : u[0] === "=" ? (typeof u[1] == "string" ? d = l = u[1] : [, d, l] = u[1], a = u[2]) : [, d, l] = u, i.push(d);
966
- let p = t[d];
967
- p === void 0 && a && (p = c(a)(r)), he(l, p, r);
776
+ let u, l, a;
777
+ typeof c == "string" ? u = l = c : c[0] === "=" ? (typeof c[1] == "string" ? u = l = c[1] : [, u, l] = c[1], a = c[2]) : [, u, l] = c, s.push(u);
778
+ let p = t[u];
779
+ p === void 0 && a && (p = d(a)(r)), ae(l, p, r);
968
780
  }
969
781
  } else if (n === "[]") {
970
- let i = 0;
971
- for (const u of s) {
972
- if (u === null) {
973
- i++;
782
+ let s = 0;
783
+ for (const c of i) {
784
+ if (c === null) {
785
+ s++;
974
786
  continue;
975
787
  }
976
- if (Array.isArray(u) && u[0] === "...") {
977
- r[u[1]] = t.slice(i);
788
+ if (Array.isArray(c) && c[0] === "...") {
789
+ r[c[1]] = t.slice(s);
978
790
  break;
979
791
  }
980
- let d = u, l;
981
- Array.isArray(u) && u[0] === "=" && ([, d, l] = u);
982
- let a = t[i++];
983
- a === void 0 && l && (a = c(l)(r)), he(d, a, r);
792
+ let u = c, l;
793
+ Array.isArray(c) && c[0] === "=" && ([, u, l] = c);
794
+ let a = t[s++];
795
+ a === void 0 && l && (a = d(l)(r)), ae(u, a, r);
984
796
  }
985
797
  }
986
- }, Qt = (e) => {
987
- let t = S(In - 1);
798
+ }, Bt = (e) => {
799
+ let t = S(vn - 1);
988
800
  return t?.[0] === "in" || t?.[0] === "of" ? [t[0], [e, t[1]], t[2]] : t?.[0] === "," ? [e, ...t.slice(1)] : [e, t];
989
801
  };
990
- ne("let", Ye + 1, () => Qt("let"));
991
- ne("const", Ye + 1, () => Qt("const"));
992
- ne("var", Ye, () => (L(), ["var", S(kn)]));
993
- const qt = (...e) => (e = e.map((t) => {
802
+ ee("let", qe + 1, () => Bt("let"));
803
+ ee("const", qe + 1, () => Bt("const"));
804
+ ee("var", qe, () => (N(), ["var", S($n)]));
805
+ const Gt = (...e) => (e = e.map((t) => {
994
806
  if (typeof t == "string") return (r) => {
995
807
  r[t] = void 0;
996
808
  };
997
809
  if (t[0] === "=") {
998
- const [, r, n] = t, o = c(n);
999
- return typeof r == "string" ? (s) => {
1000
- s[r] = o(s);
1001
- } : (s) => he(r, o(s), s);
810
+ const [, r, n] = t, o = d(n);
811
+ return typeof r == "string" ? (i) => {
812
+ i[r] = o(i);
813
+ } : (i) => ae(r, o(i), i);
1002
814
  }
1003
- return c(t);
815
+ return d(t);
1004
816
  }), (t) => {
1005
817
  for (const r of e) r(t);
1006
818
  });
1007
- f("let", qt);
1008
- f("const", qt);
819
+ f("let", Gt);
820
+ f("const", Gt);
1009
821
  f("var", (e) => typeof e == "string" ? (t) => {
1010
822
  t[e] = void 0;
1011
823
  } : () => {
1012
824
  });
1013
- const et = 20, we = (e) => {
825
+ const Je = 20, Ae = (e) => {
1014
826
  throw Error(e);
1015
827
  };
1016
- $("||=", et, !0);
1017
- $("&&=", et, !0);
1018
- $("??=", et, !0);
828
+ $("||=", Je, !0);
829
+ $("&&=", Je, !0);
830
+ $("??=", Je, !0);
1019
831
  f("=", (e, t) => {
1020
832
  if (Array.isArray(e) && (e[0] === "let" || e[0] === "const" || e[0] === "var")) {
1021
833
  const r = e[1];
1022
- return t = c(t), typeof r == "string" ? (n) => {
834
+ return t = d(t), typeof r == "string" ? (n) => {
1023
835
  n[r] = t(n);
1024
- } : (n) => he(r, t(n), n);
836
+ } : (n) => ae(r, t(n), n);
1025
837
  }
1026
- return B(e) || we("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] = t(o));
838
+ return U(e) || Ae("Invalid assignment target"), t = d(t), B(e, (r, n, o) => r[n] = t(o));
1027
839
  });
1028
- f("||=", (e, t) => (B(e) || we("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] ||= t(o))));
1029
- f("&&=", (e, t) => (B(e) || we("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] &&= t(o))));
1030
- f("??=", (e, t) => (B(e) || we("Invalid assignment target"), t = c(t), X(e, (r, n, o) => r[n] ??= t(o))));
1031
- re("true", !0);
1032
- re("false", !1);
1033
- re("null", null);
1034
- ne("undefined", 200, () => []);
1035
- re("NaN", NaN);
1036
- re("Infinity", 1 / 0);
1037
- const je = 20;
1038
- P("?", je, (e, t, r) => e && (t = S(je - 1)) && x((n) => n === 58) && (r = S(je - 1), ["?", e, t, r]));
1039
- f("?", (e, t, r) => (e = c(e), t = c(t), r = c(r), (n) => e(n) ? t(n) : r(n)));
1040
- const Pn = [], Fn = 20;
1041
- $("=>", Fn, !0);
840
+ f("||=", (e, t) => (U(e) || Ae("Invalid assignment target"), t = d(t), B(e, (r, n, o) => r[n] ||= t(o))));
841
+ f("&&=", (e, t) => (U(e) || Ae("Invalid assignment target"), t = d(t), B(e, (r, n, o) => r[n] &&= t(o))));
842
+ f("??=", (e, t) => (U(e) || Ae("Invalid assignment target"), t = d(t), B(e, (r, n, o) => r[n] ??= t(o))));
843
+ Y("true", !0);
844
+ Y("false", !1);
845
+ Y("null", null);
846
+ ee("undefined", 200, () => []);
847
+ Y("NaN", NaN);
848
+ Y("Infinity", 1 / 0);
849
+ const Oe = 20;
850
+ O("?", Oe, (e, t, r) => e && (t = S(Oe - 1)) && b((n) => n === 58) && (r = S(Oe - 1), ["?", e, t, r]));
851
+ f("?", (e, t, r) => (e = d(e), t = d(t), r = d(r), (n) => e(n) ? t(n) : r(n)));
852
+ const An = [], En = 20;
853
+ $("=>", En, !0);
1042
854
  f("=>", (e, t) => {
1043
855
  e = e?.[0] === "()" ? e[1] : e;
1044
856
  const r = e ? e[0] === "," ? e.slice(1) : [e] : [];
1045
857
  let n = -1, o = null;
1046
- const s = r[r.length - 1];
1047
- Array.isArray(s) && s[0] === "..." && (n = r.length - 1, o = s[1], r.length--);
1048
- const i = t?.[0] === "{}";
1049
- return t = c(i ? ["{", t[1]] : t), (u) => (...d) => {
858
+ const i = r[r.length - 1];
859
+ Array.isArray(i) && i[0] === "..." && (n = r.length - 1, o = i[1], r.length--);
860
+ const s = t?.[0] === "{}";
861
+ return t = d(s ? ["{", t[1]] : t), (c) => (...u) => {
1050
862
  const l = {};
1051
- r.forEach((p, g) => l[p] = d[g]), o && (l[o] = d.slice(n));
863
+ r.forEach((p, g) => l[p] = u[g]), o && (l[o] = u.slice(n));
1052
864
  const a = new Proxy(l, {
1053
- get: (p, g) => g in p ? p[g] : u?.[g],
1054
- set: (p, g, I) => ((g in p ? p : u)[g] = I, !0),
1055
- has: (p, g) => g in p || (u ? g in u : !1)
865
+ get: (p, g) => g in p ? p[g] : c?.[g],
866
+ set: (p, g, w) => ((g in p ? p : c)[g] = w, !0),
867
+ has: (p, g) => g in p || (c ? g in c : !1)
1056
868
  });
1057
869
  try {
1058
870
  const p = t(a);
1059
- return i ? void 0 : p;
871
+ return s ? void 0 : p;
1060
872
  } catch (p) {
1061
- if (p === Pn) return p[0];
873
+ if (p === An) return p[0];
1062
874
  throw p;
1063
875
  }
1064
876
  };
1065
877
  });
1066
- const Wn = 140;
1067
- _("...", Wn);
1068
- f("...", (e) => (e = c(e), (t) => Object.entries(e(t))));
1069
- const gt = 170;
1070
- P("?.", gt, (e, t) => {
878
+ const Cn = 140;
879
+ R("...", Cn);
880
+ f("...", (e) => (e = d(e), (t) => Object.entries(e(t))));
881
+ const ft = 170;
882
+ O("?.", ft, (e, t) => {
1071
883
  if (!e) return;
1072
- const r = L();
1073
- return r === 40 ? (O(), ["?.()", e, S(0, 41) || null]) : r === 91 ? (O(), ["?.[]", e, S(0, 93)]) : (t = S(gt), t ? ["?.", e, t] : void 0);
884
+ const r = N();
885
+ return r === 40 ? (C(), ["?.()", e, S(0, 41) || null]) : r === 91 ? (C(), ["?.[]", e, S(0, 93)]) : (t = S(ft), t ? ["?.", e, t] : void 0);
1074
886
  });
1075
- f("?.", (e, t) => (e = c(e), V(t) ? () => {
887
+ f("?.", (e, t) => (e = d(e), F(t) ? () => {
1076
888
  } : (r) => e(r)?.[t]));
1077
- f("?.[]", (e, t) => (e = c(e), t = c(t), (r) => {
889
+ f("?.[]", (e, t) => (e = d(e), t = d(t), (r) => {
1078
890
  const n = t(r);
1079
- return V(n) ? void 0 : e(r)?.[n];
891
+ return F(n) ? void 0 : e(r)?.[n];
1080
892
  }));
1081
893
  f("?.()", (e, t) => {
1082
- const r = t ? t[0] === "," ? (t = t.slice(1).map(c), (o) => t.map((s) => s(o))) : (t = c(t), (o) => [t(o)]) : () => [];
894
+ const r = t ? t[0] === "," ? (t = t.slice(1).map(d), (o) => t.map((i) => i(o))) : (t = d(t), (o) => [t(o)]) : () => [];
1083
895
  if (e[0] === "?.") {
1084
- const o = c(e[1]), s = e[2];
1085
- return V(s) ? () => {
1086
- } : (i) => o(i)?.[s]?.(...r(i));
896
+ const o = d(e[1]), i = e[2];
897
+ return F(i) ? () => {
898
+ } : (s) => o(s)?.[i]?.(...r(s));
1087
899
  }
1088
900
  if (e[0] === "?.[]") {
1089
- const o = c(e[1]), s = c(e[2]);
1090
- return (i) => {
1091
- const u = o(i), d = s(i);
1092
- return V(d) ? void 0 : u?.[d]?.(...r(i));
901
+ const o = d(e[1]), i = d(e[2]);
902
+ return (s) => {
903
+ const c = o(s), u = i(s);
904
+ return F(u) ? void 0 : c?.[u]?.(...r(s));
1093
905
  };
1094
906
  }
1095
907
  if (e[0] === ".") {
1096
- const o = c(e[1]), s = e[2];
1097
- return V(s) ? () => {
1098
- } : (i) => o(i)?.[s]?.(...r(i));
908
+ const o = d(e[1]), i = e[2];
909
+ return F(i) ? () => {
910
+ } : (s) => o(s)?.[i]?.(...r(s));
1099
911
  }
1100
912
  if (e[0] === "[]" && e.length === 3) {
1101
- const o = c(e[1]), s = c(e[2]);
1102
- return (i) => {
1103
- const u = o(i), d = s(i);
1104
- return V(d) ? void 0 : u?.[d]?.(...r(i));
913
+ const o = d(e[1]), i = d(e[2]);
914
+ return (s) => {
915
+ const c = o(s), u = i(s);
916
+ return F(u) ? void 0 : c?.[u]?.(...r(s));
1105
917
  };
1106
918
  }
1107
- const n = c(e);
919
+ const n = d(e);
1108
920
  return (o) => n(o)?.(...r(o));
1109
921
  });
1110
- const q = 140;
1111
- _("typeof", q);
1112
- _("void", q);
1113
- _("delete", q);
1114
- ne(
922
+ const x = 140;
923
+ R("typeof", x);
924
+ R("void", x);
925
+ R("delete", x);
926
+ ee(
1115
927
  "new",
1116
- q,
1117
- () => xr(".target") ? (O(7), ["new.target"]) : ["new", S(q)]
928
+ x,
929
+ () => Mr(".target") ? (C(7), ["new.target"]) : ["new", S(x)]
1118
930
  );
1119
- f("typeof", (e) => (e = c(e), (t) => typeof e(t)));
1120
- f("void", (e) => (e = c(e), (t) => (e(t), void 0)));
931
+ f("typeof", (e) => (e = d(e), (t) => typeof e(t)));
932
+ f("void", (e) => (e = d(e), (t) => (e(t), void 0)));
1121
933
  f("delete", (e) => {
1122
934
  if (e[0] === ".") {
1123
- const t = c(e[1]), r = e[2];
935
+ const t = d(e[1]), r = e[2];
1124
936
  return (n) => delete t(n)[r];
1125
937
  }
1126
938
  if (e[0] === "[]") {
1127
- const t = c(e[1]), r = c(e[2]);
939
+ const t = d(e[1]), r = d(e[2]);
1128
940
  return (n) => delete t(n)[r(n)];
1129
941
  }
1130
942
  return () => !0;
1131
943
  });
1132
944
  f("new", (e) => {
1133
- const t = c(e?.[0] === "()" ? e[1] : e), r = e?.[0] === "()" ? e[2] : null, n = r ? r[0] === "," ? /* @__PURE__ */ ((o) => (s) => o.map((i) => i(s)))(r.slice(1).map(c)) : /* @__PURE__ */ ((o) => (s) => [o(s)])(c(r)) : () => [];
945
+ const t = d(e?.[0] === "()" ? e[1] : e), r = e?.[0] === "()" ? e[2] : null, n = r ? r[0] === "," ? /* @__PURE__ */ ((o) => (i) => o.map((s) => s(i)))(r.slice(1).map(d)) : /* @__PURE__ */ ((o) => (i) => [o(i)])(d(r)) : () => [];
1134
946
  return (o) => new (t(o))(...n(o));
1135
947
  });
1136
- const tt = /* @__PURE__ */ Symbol("accessor"), rt = 20, Dn = 40, Zt = 41, Yt = 123, er = 125, tr = (e) => (t) => {
948
+ const Ze = /* @__PURE__ */ Symbol("accessor"), Ye = 20, wn = 40, Kt = 41, Xt = 123, xt = 125, Qt = (e) => (t) => {
1137
949
  if (t) return;
1138
- L();
1139
- const r = x(v.id);
1140
- if (!r || (L(), m.charCodeAt(h) !== Dn)) return !1;
1141
- O();
1142
- const n = S(0, Zt);
1143
- return L(), m.charCodeAt(h) !== Yt ? !1 : (O(), [e, r, n, S(0, er)]);
950
+ N();
951
+ const r = b(v.id);
952
+ if (!r || (N(), m.charCodeAt(h) !== wn)) return !1;
953
+ C();
954
+ const n = S(0, Kt);
955
+ return N(), m.charCodeAt(h) !== Xt ? !1 : (C(), [e, r, n, S(0, xt)]);
1144
956
  };
1145
- P("get", rt - 1, tr("get"));
1146
- P("set", rt - 1, tr("set"));
1147
- P("(", rt - 1, (e) => {
957
+ O("get", Ye - 1, Qt("get"));
958
+ O("set", Ye - 1, Qt("set"));
959
+ O("(", Ye - 1, (e) => {
1148
960
  if (!e || typeof e != "string") return;
1149
- const t = S(0, Zt) || null;
1150
- if (L(), m.charCodeAt(h) === Yt)
1151
- return O(), [":", e, ["=>", ["()", t], S(0, er) || null]];
961
+ const t = S(0, Kt) || null;
962
+ if (N(), m.charCodeAt(h) === Xt)
963
+ return C(), [":", e, ["=>", ["()", t], S(0, xt) || null]];
1152
964
  });
1153
- f("get", (e, t) => (t = t ? c(t) : () => {
1154
- }, (r) => [[tt, e, {
965
+ f("get", (e, t) => (t = t ? d(t) : () => {
966
+ }, (r) => [[Ze, e, {
1155
967
  get: function() {
1156
968
  const n = Object.create(r || {});
1157
969
  return n.this = this, t(n);
1158
970
  }
1159
971
  }]]));
1160
- f("set", (e, t, r) => (r = r ? c(r) : () => {
1161
- }, (n) => [[tt, e, {
972
+ f("set", (e, t, r) => (r = r ? d(r) : () => {
973
+ }, (n) => [[Ze, e, {
1162
974
  set: function(o) {
1163
- const s = Object.create(n || {});
1164
- s.this = this, s[t] = o, r(s);
975
+ const i = Object.create(n || {});
976
+ i.this = this, i[t] = o, r(i);
1165
977
  }
1166
978
  }]]));
1167
- const Tn = 20, rr = 200;
1168
- v.prop = (e) => Kr(e) !== 58;
1169
- const Nn = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
1170
- xe("[]", rr);
1171
- xe("{}", rr);
1172
- $(":", Tn - 1, !0);
979
+ const In = 20, qt = 200;
980
+ v.prop = (e) => _r(e) !== 58;
981
+ const On = (e) => e == null || typeof e == "string" || [":", ",", "...", "get", "set"].includes(e[0]);
982
+ Be("[]", qt);
983
+ Be("{}", qt);
984
+ $(":", In - 1, !0);
1173
985
  f("{}", (e, t) => {
1174
986
  if (t !== void 0) return;
1175
- if (!Nn(e)) return c(["{", e]);
987
+ if (!On(e)) return d(["{", e]);
1176
988
  e = e ? e[0] !== "," ? [e] : e.slice(1) : [];
1177
- const r = e.map((n) => c(typeof n == "string" ? [":", n, n] : n));
989
+ const r = e.map((n) => d(typeof n == "string" ? [":", n, n] : n));
1178
990
  return (n) => {
1179
- const o = {}, s = {};
1180
- for (const i of r.flatMap((u) => u(n)))
1181
- if (i[0] === tt) {
1182
- const [, u, d] = i;
1183
- s[u] = { ...s[u], ...d, configurable: !0, enumerable: !0 };
1184
- } else o[i[0]] = i[1];
1185
- for (const i in s) Object.defineProperty(o, i, s[i]);
991
+ const o = {}, i = {};
992
+ for (const s of r.flatMap((c) => c(n)))
993
+ if (s[0] === Ze) {
994
+ const [, c, u] = s;
995
+ i[c] = { ...i[c], ...u, configurable: !0, enumerable: !0 };
996
+ } else o[s[0]] = s[1];
997
+ for (const s in i) Object.defineProperty(o, s, i[s]);
1186
998
  return o;
1187
999
  };
1188
1000
  });
1189
- f("{", (e) => (e = e ? c(e) : () => {
1001
+ f("{", (e) => (e = e ? d(e) : () => {
1190
1002
  }, (t) => e(Object.create(t))));
1191
- f(":", (e, t) => (t = c(t), Array.isArray(e) ? (e = c(e), (r) => [[e(r), t(r)]]) : (r) => [[e, t(r)]]));
1192
- const Vn = 170, me = 96, Rn = 36, Ln = 123, Mn = 92, _n = { n: `
1193
- `, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, yt = () => {
1003
+ f(":", (e, t) => (t = d(t), Array.isArray(e) ? (e = d(e), (r) => [[e(r), t(r)]]) : (r) => [[e, t(r)]]));
1004
+ const kn = 170, fe = 96, jn = 36, Wn = 123, Pn = 92, Dn = { n: `
1005
+ `, r: "\r", t: " ", b: "\b", f: "\f", v: "\v" }, pt = () => {
1194
1006
  const e = [];
1195
- for (let t = "", r; (r = m.charCodeAt(h)) !== me; )
1196
- r ? r === Mn ? (O(), t += _n[m[h]] || m[h], O()) : r === Rn && m.charCodeAt(h + 1) === Ln ? (t && e.push([, t]), t = "", O(2), e.push(S(0, 125))) : (t += m[h], O(), r = m.charCodeAt(h), r === me && t && e.push([, t])) : z("Unterminated template");
1197
- return O(), e;
1198
- }, Un = W[me];
1199
- W[me] = (e, t) => e && t < Vn ? v.asi && v.newline ? void 0 : (O(), ["``", e, ...yt()]) : (
1007
+ for (let t = "", r; (r = m.charCodeAt(h)) !== fe; )
1008
+ r ? r === Pn ? (C(), t += Dn[m[h]] || m[h], C()) : r === jn && m.charCodeAt(h + 1) === Wn ? (t && e.push([, t]), t = "", C(2), e.push(S(0, 125))) : (t += m[h], C(), r = m.charCodeAt(h), r === fe && t && e.push([, t])) : M("Unterminated template");
1009
+ return C(), e;
1010
+ }, Fn = j[fe];
1011
+ j[fe] = (e, t) => e && t < kn ? v.asi && v.newline ? void 0 : (C(), ["``", e, ...pt()]) : (
1200
1012
  // tagged
1201
1013
  e ? (
1202
1014
  // plain
1203
- Un?.(e, t)
1204
- ) : (O(), ((r) => r.length < 2 && r[0]?.[0] === void 0 ? r[0] || [, ""] : ["`", ...r])(yt()))
1015
+ Fn?.(e, t)
1016
+ ) : (C(), ((r) => r.length < 2 && r[0]?.[0] === void 0 ? r[0] || [, ""] : ["`", ...r])(pt()))
1205
1017
  );
1206
- f("`", (...e) => (e = e.map(c), (t) => e.map((r) => r(t)).join("")));
1018
+ f("`", (...e) => (e = e.map(d), (t) => e.map((r) => r(t)).join("")));
1207
1019
  f("``", (e, ...t) => {
1208
- e = c(e);
1020
+ e = d(e);
1209
1021
  const r = [], n = [];
1210
- for (const s of t)
1211
- Array.isArray(s) && s[0] === void 0 ? r.push(s[1]) : n.push(c(s));
1022
+ for (const i of t)
1023
+ Array.isArray(i) && i[0] === void 0 ? r.push(i[1]) : n.push(d(i));
1212
1024
  const o = Object.assign([...r], { raw: r });
1213
- return (s) => e(s)(o, ...n.map((i) => i(s)));
1025
+ return (i) => e(i)(o, ...n.map((s) => s(i)));
1214
1026
  });
1215
1027
  v.string["'"] = !0;
1216
1028
  v.number = { "0x": 16, "0b": 2, "0o": 8 };
1217
- const Hn = {
1029
+ const Tn = {
1218
1030
  log: (e, t) => (t ? console.log(t, e) : console.log(e), e)
1219
- }, bn = 2e3, oe = /* @__PURE__ */ new Map();
1220
- function nt(e) {
1221
- const t = oe.get(e);
1031
+ }, Nn = 2e3, te = /* @__PURE__ */ new Map();
1032
+ function et(e) {
1033
+ const t = te.get(e);
1222
1034
  if (t !== void 0)
1223
1035
  return t;
1224
- const r = c(v(zn(e)));
1225
- return oe.size >= bn && oe.clear(), oe.set(e, r), r;
1036
+ const r = d(v(Vn(e)));
1037
+ return te.size >= Nn && te.clear(), te.set(e, r), r;
1226
1038
  }
1227
- function J(e, t, r, n, o, s) {
1228
- return nt(e)({
1039
+ function G(e, t, r, n, o, i) {
1040
+ return et(e)({
1229
1041
  $form: t,
1230
1042
  $meta: r,
1231
1043
  $errors: n,
1232
1044
  $formIsInvalid: o,
1233
- $log: Hn.log,
1045
+ $log: Tn.log,
1234
1046
  $fn: {},
1235
- ...s
1047
+ ...i
1236
1048
  }) === !0;
1237
1049
  }
1238
- function zn(e) {
1050
+ function Vn(e) {
1239
1051
  return e.replace(
1240
1052
  /(\?\.|\.)(\d+)/g,
1241
- (t, r, n, o) => r === "." && Bn(e, o) ? t : r === "?." ? `?.[${n}]` : `[${n}]`
1053
+ (t, r, n, o) => r === "." && Rn(e, o) ? t : r === "?." ? `?.[${n}]` : `[${n}]`
1242
1054
  );
1243
1055
  }
1244
- function Bn(e, t) {
1056
+ function Rn(e, t) {
1245
1057
  let r = t - 1, n = !1;
1246
1058
  for (; r >= 0 && e[r] >= "0" && e[r] <= "9"; )
1247
1059
  n = !0, r--;
@@ -1250,289 +1062,289 @@ function Bn(e, t) {
1250
1062
  const o = e[r];
1251
1063
  return n ? !/[\w$.\]]/.test(o) : !/[\w$)\]]/.test(o);
1252
1064
  }
1253
- const Gn = (e) => (t, r) => {
1065
+ const Ln = (e) => (t, r) => {
1254
1066
  let n = t.formDef.states;
1255
1067
  if (!n || Object.keys(n).length === 0 || t.formHealth.status === "errored")
1256
1068
  return t;
1257
- const { $formIsInvalid: o, $errors: s } = r ?? Se(t);
1258
- n = Kn(n);
1259
- let i = [], u = { status: "ok" };
1069
+ const { $formIsInvalid: o, $errors: i } = r ?? ve(t);
1070
+ n = _n(n);
1071
+ let s = [], c = { status: "ok" };
1260
1072
  try {
1261
- i = Object.keys(n).map((d) => {
1262
- const l = n[d];
1073
+ s = Object.keys(n).map((u) => {
1074
+ const l = n[u];
1263
1075
  let a;
1264
1076
  try {
1265
- a = J(l, t.data, t.meta, s, o, {
1077
+ a = G(l, t.data, t.meta, i, o, {
1266
1078
  $fn: e
1267
1079
  });
1268
1080
  } catch {
1269
1081
  a = !1;
1270
1082
  }
1271
- return a === !0 ? d : void 0;
1272
- }).filter((d) => d !== void 0);
1273
- } catch (d) {
1274
- const l = d, a = F.calculateCurrentStateError;
1275
- u = {
1083
+ return a === !0 ? u : void 0;
1084
+ }).filter((u) => u !== void 0);
1085
+ } catch (u) {
1086
+ const l = u, a = k.calculateCurrentStateError;
1087
+ c = {
1276
1088
  status: "errored",
1277
1089
  message: `[${a}] ${l.message}`,
1278
1090
  code: a
1279
1091
  };
1280
1092
  }
1281
- return { ...t, currentStates: i, formHealth: u };
1093
+ return { ...t, currentStates: s, formHealth: c };
1282
1094
  };
1283
- function Kn(e) {
1095
+ function _n(e) {
1284
1096
  const t = {};
1285
1097
  function r(n) {
1286
- const o = n.split(":"), s = [];
1287
- for (let i = 0; i < o.length; i++)
1288
- s.push(o.slice(0, i + 1).join(":"));
1289
- return s;
1098
+ const o = n.split(":"), i = [];
1099
+ for (let s = 0; s < o.length; s++)
1100
+ i.push(o.slice(0, s + 1).join(":"));
1101
+ return i;
1290
1102
  }
1291
1103
  for (const [n, o] of Object.entries(e)) {
1292
- const s = r(n), i = [];
1293
- for (const u of s)
1294
- e[u] && i.push(`(${e[u]})`);
1295
- t[n] = i.join(" && ");
1104
+ const i = r(n), s = [];
1105
+ for (const c of i)
1106
+ e[c] && s.push(`(${e[c]})`);
1107
+ t[n] = s.join(" && ");
1296
1108
  }
1297
1109
  return t;
1298
1110
  }
1299
- const Z = (e) => e !== void 0 && typeof e == "object" && e !== null && "when" in e;
1300
- function vt(e) {
1111
+ const Q = (e) => e !== void 0 && typeof e == "object" && e !== null && "when" in e;
1112
+ function ht(e) {
1301
1113
  if (typeof e != "object" || e === null)
1302
1114
  return !1;
1303
1115
  const t = Object.getPrototypeOf(e);
1304
1116
  return t === Object.prototype || t === null;
1305
1117
  }
1306
- function ge(e, t) {
1118
+ function pe(e, t) {
1307
1119
  if (e === t)
1308
1120
  return !0;
1309
1121
  if (Array.isArray(e) && Array.isArray(t))
1310
- return e.length === t.length && e.every((r, n) => ge(r, t[n]));
1311
- if (vt(e) && vt(t)) {
1122
+ return e.length === t.length && e.every((r, n) => pe(r, t[n]));
1123
+ if (ht(e) && ht(t)) {
1312
1124
  const r = Object.keys(e);
1313
- return r.length !== Object.keys(t).length ? !1 : r.every((n) => n in t && ge(e[n], t[n]));
1125
+ return r.length !== Object.keys(t).length ? !1 : r.every((n) => n in t && pe(e[n], t[n]));
1314
1126
  }
1315
1127
  return !1;
1316
1128
  }
1317
- const xn = (e) => (t, r) => {
1318
- const { $formIsInvalid: n, $errors: o } = r ?? Se(t);
1129
+ const Mn = (e) => (t, r) => {
1130
+ const { $formIsInvalid: n, $errors: o } = r ?? ve(t);
1319
1131
  return {
1320
1132
  ...t,
1321
- widgetFlags: Xn(t, o, n, e)
1133
+ widgetFlags: Un(t, o, n, e)
1322
1134
  };
1323
1135
  };
1324
- function Xn(e, t, r, n) {
1136
+ function Un(e, t, r, n) {
1325
1137
  const o = [];
1326
- for (const [i, u] of Object.entries(e.resolvedSources))
1327
- if (T(u)) {
1328
- const d = At(i, u, e);
1329
- $t(d) && o.push(d);
1330
- } else $t(u) && o.push(At(i, u, e));
1331
- const s = o.reduce(
1332
- (i, u) => {
1333
- i[u.uid] = i[u.uid] || {};
1334
- const d = e.repeaterItemScopes[u.uid], l = d ? { $item: M(e.data, d.itemPath), $index: d.index, $fn: n } : { $fn: n };
1335
- return u.include && "in" in u.include ? i[u.uid].hidden = !u.include.in.some(
1138
+ for (const [s, c] of Object.entries(e.resolvedSources))
1139
+ if (P(c)) {
1140
+ const u = yt(s, c, e);
1141
+ mt(u) && o.push(u);
1142
+ } else mt(c) && o.push(yt(s, c, e));
1143
+ const i = o.reduce(
1144
+ (s, c) => {
1145
+ s[c.uid] = s[c.uid] || {};
1146
+ const u = e.repeaterItemScopes[c.uid], l = u ? { $item: V(e.data, u.itemPath), $index: u.index, $fn: n } : { $fn: n };
1147
+ return c.include && "in" in c.include ? s[c.uid].hidden = !c.include.in.some(
1336
1148
  (a) => e.currentStates.includes(a)
1337
- ) : u.include && "when" in u.include && (i[u.uid].hidden = !J(
1338
- u.include.when,
1149
+ ) : c.include && "when" in c.include && (s[c.uid].hidden = !G(
1150
+ c.include.when,
1339
1151
  e.data,
1340
1152
  e.meta,
1341
1153
  t,
1342
1154
  r,
1343
1155
  l
1344
- )), u.exclude && "from" in u.exclude ? i[u.uid].hidden = u.exclude.from.some(
1156
+ )), c.exclude && "from" in c.exclude ? s[c.uid].hidden = c.exclude.from.some(
1345
1157
  (a) => e.currentStates.includes(a)
1346
- ) : u.exclude && "when" in u.exclude && (i[u.uid].hidden = J(
1347
- u.exclude.when,
1158
+ ) : c.exclude && "when" in c.exclude && (s[c.uid].hidden = G(
1159
+ c.exclude.when,
1348
1160
  e.data,
1349
1161
  e.meta,
1350
1162
  t,
1351
1163
  r,
1352
1164
  l
1353
- )), (j(u) || ue(u)) && Z(u.disabled) && (i[u.uid].disabled = J(
1354
- u.disabled.when,
1165
+ )), (I(c) || oe(c)) && Q(c.disabled) && (s[c.uid].disabled = G(
1166
+ c.disabled.when,
1355
1167
  e.data,
1356
1168
  e.meta,
1357
1169
  t,
1358
1170
  r,
1359
1171
  l
1360
- )), j(u) && Z(u.readonly) && (i[u.uid].readonly = J(
1361
- u.readonly.when,
1172
+ )), I(c) && Q(c.readonly) && (s[c.uid].readonly = G(
1173
+ c.readonly.when,
1362
1174
  e.data,
1363
1175
  e.meta,
1364
1176
  t,
1365
1177
  r,
1366
1178
  l
1367
- )), i;
1179
+ )), s;
1368
1180
  },
1369
1181
  {}
1370
1182
  );
1371
- return Jn(e, s), s;
1183
+ return Hn(e, i), i;
1372
1184
  }
1373
- function $t(e) {
1374
- return !!(e.include && ("in" in e.include || "when" in e.include) || e.exclude && ("from" in e.exclude || "when" in e.exclude) || (j(e) || ue(e)) && Z(e.disabled) || j(e) && Z(e.readonly));
1185
+ function mt(e) {
1186
+ return !!(e.include && ("in" in e.include || "when" in e.include) || e.exclude && ("from" in e.exclude || "when" in e.exclude) || (I(e) || oe(e)) && Q(e.disabled) || I(e) && Q(e.readonly));
1375
1187
  }
1376
- function Jn(e, t) {
1188
+ function Hn(e, t) {
1377
1189
  const r = Object.keys(t).filter((n) => t[n].hidden === !0);
1378
1190
  for (const n of r)
1379
- nr(n, e, t);
1191
+ Jt(n, e, t);
1380
1192
  }
1381
- function nr(e, t, r) {
1193
+ function Jt(e, t, r) {
1382
1194
  const n = t.resolvedSources[e];
1383
1195
  if (n !== void 0) {
1384
- if (Ae(n) || T(n) && n.path !== void 0) {
1196
+ if ($e(n) || P(n) && n.path !== void 0) {
1385
1197
  const o = `${n.path}.`;
1386
- for (const [s, i] of Object.entries(t.repeaterItemScopes))
1387
- i.itemPath.startsWith(o) && St(s, r);
1198
+ for (const [i, s] of Object.entries(t.repeaterItemScopes))
1199
+ s.itemPath.startsWith(o) && gt(i, r);
1388
1200
  }
1389
- if (H(n)) {
1390
- const o = te(e);
1391
- for (const s of n.children) {
1392
- const i = o.length > 0 ? Ge(s.uid, o) : s.uid;
1393
- if (t.resolvedSources[i] === void 0)
1201
+ if (_(n)) {
1202
+ const o = Z(e);
1203
+ for (const i of n.children) {
1204
+ const s = o.length > 0 ? ze(i.uid, o) : i.uid;
1205
+ if (t.resolvedSources[s] === void 0)
1394
1206
  continue;
1395
- const u = r[i]?.hidden === !0;
1396
- St(i, r), u || nr(i, t, r);
1207
+ const c = r[s]?.hidden === !0;
1208
+ gt(s, r), c || Jt(s, t, r);
1397
1209
  }
1398
1210
  }
1399
1211
  }
1400
1212
  }
1401
- function St(e, t) {
1213
+ function gt(e, t) {
1402
1214
  t[e] = t[e] || {}, t[e].hidden = !0;
1403
1215
  }
1404
- function At(e, t, r) {
1216
+ function yt(e, t, r) {
1405
1217
  const n = r.repeaterItemScopes[e];
1406
1218
  let o;
1407
- T(t) ? (o = {
1219
+ P(t) ? (o = {
1408
1220
  ...t({
1409
1221
  $form: r.data,
1410
- $item: n ? M(r.data, n.itemPath) : void 0,
1222
+ $item: n ? V(r.data, n.itemPath) : void 0,
1411
1223
  $index: n?.index,
1412
1224
  errors: void 0,
1413
1225
  touched: void 0,
1414
1226
  translate: void 0
1415
1227
  })
1416
1228
  }, o.uid = e) : o = t;
1417
- const s = te(e);
1418
- return s.length > 0 && (o = zr(o, s)), o;
1229
+ const i = Z(e);
1230
+ return i.length > 0 && (o = Vr(o, i)), o;
1419
1231
  }
1420
- const or = (e, t) => (r, n) => {
1232
+ const Zt = (e, t) => (r, n) => {
1421
1233
  try {
1422
- const o = n ?? Se(r);
1234
+ const o = n ?? ve(r);
1423
1235
  return {
1424
1236
  ...r,
1425
- calculatedWidgets: Qn(r, e, t, o)
1237
+ calculatedWidgets: zn(r, e, t, o)
1426
1238
  };
1427
1239
  } catch (o) {
1428
- const s = o, i = s.code ?? F.calculateWidgetPropsError;
1240
+ const i = o, s = i.code ?? k.calculateWidgetPropsError;
1429
1241
  return {
1430
1242
  ...r,
1431
1243
  formHealth: {
1432
1244
  status: "errored",
1433
- message: `[${i}] ${s.message}`,
1434
- code: i
1245
+ message: `[${s}] ${i.message}`,
1246
+ code: s
1435
1247
  }
1436
1248
  };
1437
1249
  }
1438
1250
  };
1439
- function Qn(e, t, r, { $formIsInvalid: n, $errors: o }) {
1440
- const s = go(e, t, n, o, r), i = {};
1441
- for (const u of Object.keys(e.calculatedWidgets)) {
1442
- if (e.widgetFlags[u]?.hidden)
1251
+ function zn(e, t, r, { $formIsInvalid: n, $errors: o }) {
1252
+ const i = co(e, t, n, o, r), s = {};
1253
+ for (const c of Object.keys(e.calculatedWidgets)) {
1254
+ if (e.widgetFlags[c]?.hidden)
1443
1255
  continue;
1444
- const d = e.calculatedWidgets[u], l = d.source, a = e.repeaterItemScopes[u];
1445
- if (T(l)) {
1446
- i[u] = qn(d, u, l, e, t, a);
1256
+ const u = e.calculatedWidgets[c], l = u.source, a = e.repeaterItemScopes[c];
1257
+ if (P(l)) {
1258
+ s[c] = bn(u, c, l, e, t, a);
1447
1259
  continue;
1448
1260
  }
1449
- const p = a ? { ...s, $item: M(s.$form, a.itemPath), $index: a.index } : s;
1450
- i[u] = Zn(
1451
- d,
1261
+ const p = a ? { ...i, $item: V(i.$form, a.itemPath), $index: a.index } : i;
1262
+ s[c] = Bn(
1263
+ u,
1452
1264
  l,
1453
1265
  e,
1454
1266
  p
1455
1267
  );
1456
1268
  }
1457
- return i;
1269
+ return s;
1458
1270
  }
1459
- function qn(e, t, r, n, o, s) {
1460
- const i = {
1271
+ function bn(e, t, r, n, o, i) {
1272
+ const s = {
1461
1273
  ...r({
1462
1274
  $form: n.data,
1463
1275
  errors: r.path ? n.validations[r.path] : void 0,
1464
1276
  touched: r.path ? n.touchedControls[r.path] : void 0,
1465
1277
  translate: o.translate,
1466
- $item: s ? M(n.data, s.itemPath) : void 0,
1467
- $index: s?.index
1278
+ $item: i ? V(n.data, i.itemPath) : void 0,
1279
+ $index: i?.index
1468
1280
  })
1469
1281
  };
1470
- i.uid = t, r.path !== void 0 && (i.path = r.path);
1471
- const u = n.widgetPropOverrides[t];
1472
- return u !== void 0 && (i.props = { ...i.props, ...u }), e.current && ge(e.current, i) ? e : { source: r, current: i };
1282
+ s.uid = t, r.path !== void 0 && (s.path = r.path);
1283
+ const c = n.widgetPropOverrides[t];
1284
+ return c !== void 0 && (s.props = { ...s.props, ...c }), e.current && pe(e.current, s) ? e : { source: r, current: s };
1473
1285
  }
1474
- function Zn(e, t, r, n) {
1475
- const o = new mo(t, e.current);
1476
- return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind), Or(t) ? Yn(o, n) : ue(t) ? eo(o, n) : j(t) ? to(o, n) : H(t) && ro(o, n), no(t, o, n, r), (ue(t) || j(t)) && oo(t, o, n), H(t) && so(t, o, r), o.changed ? { source: e.source, current: o.current } : e;
1286
+ function Bn(e, t, r, n) {
1287
+ const o = new so(t, e.current);
1288
+ return o.write("uid", t.uid), o.write("type", t.type), o.write("kind", t.kind), gr(t) ? Gn(o, n) : oe(t) ? Kn(o, n) : I(t) ? Xn(o, n) : _(t) && xn(o, n), Qn(t, o, n, r), (oe(t) || I(t)) && qn(t, o, n), _(t) && Jn(t, o, r), o.changed ? { source: e.source, current: o.current } : e;
1477
1289
  }
1478
- function Yn(e, t) {
1290
+ function Gn(e, t) {
1479
1291
  A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude");
1480
1292
  }
1481
- function eo(e, t) {
1293
+ function Kn(e, t) {
1482
1294
  A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude"), A(e, t, "label"), A(e, t, "disabled"), A(e, t, "actionType");
1483
1295
  }
1484
- function to(e, t) {
1296
+ function Xn(e, t) {
1485
1297
  A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude"), A(e, t, "label"), A(e, t, "disabled"), A(e, t, "readonly"), A(e, t, "validator"), A(e, t, "path"), A(e, t, "defaultValue");
1486
1298
  }
1487
- function ro(e, t) {
1299
+ function xn(e, t) {
1488
1300
  A(e, t, "size"), A(e, t, "include"), A(e, t, "exclude");
1489
1301
  }
1490
- function no(e, t, r, n) {
1491
- const o = n.widgetPropOverrides[e.uid] ?? {}, s = { ...e.props ?? {}, ...o };
1492
- for (const i of ur(Object.keys(s)))
1493
- io(t, r, i);
1302
+ function Qn(e, t, r, n) {
1303
+ const o = n.widgetPropOverrides[e.uid] ?? {}, i = { ...e.props ?? {}, ...o };
1304
+ for (const s of tr(Object.keys(i)))
1305
+ Zn(t, r, s);
1494
1306
  }
1495
- function oo(e, t, r) {
1307
+ function qn(e, t, r) {
1496
1308
  const n = e.on ?? {};
1497
- for (const o of ur(Object.keys(n)))
1498
- uo(t, r, o);
1309
+ for (const o of tr(Object.keys(n)))
1310
+ Yn(t, r, o);
1499
1311
  }
1500
- function so(e, t, r) {
1501
- const n = te(e.uid), o = vo(e.children, n, r.widgetFlags);
1312
+ function Jn(e, t, r) {
1313
+ const n = Z(e.uid), o = lo(e.children, n, r.widgetFlags);
1502
1314
  t.current.children = o;
1503
- const s = t.previous.children ?? [];
1504
- s.length === o.length && o.every((u, d) => s[d] && s[d].uid === o[d].uid) || t.markChanged();
1315
+ const i = t.previous.children ?? [];
1316
+ i.length === o.length && o.every((c, u) => i[u] && i[u].uid === o[u].uid) || t.markChanged();
1505
1317
  }
1506
1318
  function A(e, t, r) {
1507
1319
  const n = e.source;
1508
- if (!yo(n, r))
1320
+ if (!uo(n, r))
1509
1321
  return;
1510
- const o = st(n, r, t.sortedStates);
1511
- let s;
1322
+ const o = rt(n, r, t.sortedStates);
1323
+ let i;
1512
1324
  switch (r) {
1513
1325
  case "disabled":
1514
1326
  case "readonly":
1515
- s = ao(o, t, e.source.uid, r);
1327
+ i = ro(o, t, e.source.uid, r);
1516
1328
  break;
1517
1329
  case "defaultValue":
1518
- s = o;
1330
+ i = o;
1519
1331
  break;
1520
1332
  default:
1521
- s = ir(o, t);
1333
+ i = er(o, t);
1522
1334
  }
1523
- e.write(r, s);
1335
+ e.write(r, i);
1524
1336
  }
1525
- function io(e, t, r) {
1526
- const n = e.source.props, o = st(n, r, t.sortedStates);
1527
- let s = ir(o, t);
1528
- const i = t.widgetPropOverrides[e.source.uid]?.[r];
1529
- i !== void 0 && (s = i), e.write(`props.${r}`, s);
1337
+ function Zn(e, t, r) {
1338
+ const n = e.source.props, o = rt(n, r, t.sortedStates);
1339
+ let i = er(o, t);
1340
+ const s = t.widgetPropOverrides[e.source.uid]?.[r];
1341
+ s !== void 0 && (i = s), e.write(`props.${r}`, i);
1530
1342
  }
1531
- function uo(e, t, r) {
1532
- const n = e.source.on, o = st(n, r, t.sortedStates);
1533
- e.write(`on.${r}`, fo(o, t));
1343
+ function Yn(e, t, r) {
1344
+ const n = e.source.on, o = rt(n, r, t.sortedStates);
1345
+ e.write(`on.${r}`, no(o, t));
1534
1346
  }
1535
- function ot(e, t) {
1347
+ function tt(e, t) {
1536
1348
  return e({
1537
1349
  $form: t.$form,
1538
1350
  translate: t.localization.translate,
@@ -1540,14 +1352,14 @@ function ot(e, t) {
1540
1352
  $index: t.$index
1541
1353
  });
1542
1354
  }
1543
- function co(e, t) {
1544
- return t.localization.translate(e.key, ho(e.params, t), e.default);
1355
+ function eo(e, t) {
1356
+ return t.localization.translate(e.key, io(e.params, t), e.default);
1545
1357
  }
1546
- const lo = /\{\{([^}]+)\}\}/g;
1547
- function sr(e, t) {
1548
- return e.includes("{{") ? e.replace(lo, (r, n) => {
1358
+ const to = /\{\{([^}]+)\}\}/g;
1359
+ function Yt(e, t) {
1360
+ return e.includes("{{") ? e.replace(to, (r, n) => {
1549
1361
  try {
1550
- const o = nt(n.trim())({
1362
+ const o = et(n.trim())({
1551
1363
  $form: t.$form,
1552
1364
  $meta: t.$meta,
1553
1365
  $errors: t.$errors,
@@ -1558,21 +1370,21 @@ function sr(e, t) {
1558
1370
  });
1559
1371
  return o == null ? "" : String(o);
1560
1372
  } catch (o) {
1561
- const s = o instanceof Error ? o.message : String(o);
1562
- throw new cr(`Failed to evaluate '{{${n.trim()}}}': ${s}`);
1373
+ const i = o instanceof Error ? o.message : String(o);
1374
+ throw new rr(`Failed to evaluate '{{${n.trim()}}}': ${i}`);
1563
1375
  }
1564
1376
  }) : e;
1565
1377
  }
1566
- function ir(e, t) {
1567
- return typeof e == "function" ? ot(e, t) : Vr(e) ? co(e, t) : typeof e == "string" ? sr(e, t) : e;
1378
+ function er(e, t) {
1379
+ return typeof e == "function" ? tt(e, t) : kr(e) ? eo(e, t) : typeof e == "string" ? Yt(e, t) : e;
1568
1380
  }
1569
- function ao(e, t, r, n) {
1570
- return typeof e == "function" ? ot(e, t) : Z(e) ? t.widgetFlags[r]?.[n] : typeof e == "string" ? sr(e, t) : e;
1381
+ function ro(e, t, r, n) {
1382
+ return typeof e == "function" ? tt(e, t) : Q(e) ? t.widgetFlags[r]?.[n] : typeof e == "string" ? Yt(e, t) : e;
1571
1383
  }
1572
- function fo(e, t) {
1573
- return typeof e == "function" ? ot(e, t) : e;
1384
+ function no(e, t) {
1385
+ return typeof e == "function" ? tt(e, t) : e;
1574
1386
  }
1575
- function st(e, t, r) {
1387
+ function rt(e, t, r) {
1576
1388
  if (e) {
1577
1389
  for (const n of r) {
1578
1390
  const o = e[`${t}.${n}`];
@@ -1582,15 +1394,15 @@ function st(e, t, r) {
1582
1394
  return e[t];
1583
1395
  }
1584
1396
  }
1585
- function po(e) {
1397
+ function oo(e) {
1586
1398
  return e.startsWith("$form") || e.startsWith("$meta") || e.startsWith("$errors") || e.startsWith("$item") || e.startsWith("$index") || e.startsWith("$fn") || e === "$formIsInvalid";
1587
1399
  }
1588
- function ho(e, t) {
1400
+ function io(e, t) {
1589
1401
  return e && Object.keys(e).reduce((r, n) => {
1590
1402
  const o = String(e[n]);
1591
- if (po(o))
1403
+ if (oo(o))
1592
1404
  try {
1593
- const s = nt(o)({
1405
+ const i = et(o)({
1594
1406
  $form: t.$form,
1595
1407
  $meta: t.$meta,
1596
1408
  $errors: t.$errors,
@@ -1599,17 +1411,17 @@ function ho(e, t) {
1599
1411
  $index: t.$index,
1600
1412
  $fn: t.$fn
1601
1413
  });
1602
- r[n] = s ?? o;
1603
- } catch (s) {
1604
- const i = s instanceof Error ? s.message : String(s);
1605
- throw new cr(`Failed to evaluate i18n param '${o}': ${i}`);
1414
+ r[n] = i ?? o;
1415
+ } catch (i) {
1416
+ const s = i instanceof Error ? i.message : String(i);
1417
+ throw new rr(`Failed to evaluate i18n param '${o}': ${s}`);
1606
1418
  }
1607
1419
  else
1608
1420
  r[n] = o;
1609
1421
  return r;
1610
1422
  }, {});
1611
1423
  }
1612
- class mo {
1424
+ class so {
1613
1425
  constructor(t, r) {
1614
1426
  this._changed = !1, this.source = t, this.previous = r, this.current = {};
1615
1427
  }
@@ -1620,17 +1432,17 @@ class mo {
1620
1432
  this._changed = !0;
1621
1433
  }
1622
1434
  write(t, r) {
1623
- const n = M(this.previous, t);
1624
- if (ge(n, r)) {
1625
- De(this.current, t, n);
1435
+ const n = V(this.previous, t);
1436
+ if (pe(n, r)) {
1437
+ We(this.current, t, n);
1626
1438
  return;
1627
1439
  }
1628
- De(this.current, t, r), this._changed = !0;
1440
+ We(this.current, t, r), this._changed = !0;
1629
1441
  }
1630
1442
  }
1631
- function go(e, t, r, n, o) {
1443
+ function co(e, t, r, n, o) {
1632
1444
  return {
1633
- sortedStates: [...e.currentStates].sort((s, i) => i.length - s.length),
1445
+ sortedStates: [...e.currentStates].sort((i, s) => s.length - i.length),
1634
1446
  widgetPropOverrides: e.widgetPropOverrides,
1635
1447
  widgetFlags: e.widgetFlags,
1636
1448
  $form: e.data,
@@ -1641,46 +1453,46 @@ function go(e, t, r, n, o) {
1641
1453
  $fn: o
1642
1454
  };
1643
1455
  }
1644
- function yo(e, t) {
1456
+ function uo(e, t) {
1645
1457
  if (t in e)
1646
1458
  return !0;
1647
1459
  const r = `${t}.`;
1648
1460
  return Object.keys(e).some((n) => n.startsWith(r));
1649
1461
  }
1650
- function ur(e) {
1462
+ function tr(e) {
1651
1463
  return Array.from(new Set(e.map((t) => t.split(".")[0])));
1652
1464
  }
1653
- function vo(e, t, r) {
1465
+ function lo(e, t, r) {
1654
1466
  const n = t.map((o) => `[${o}]`).join("");
1655
1467
  return e.filter((o) => {
1656
- const s = o.uid + n, i = r[s];
1657
- return !i || i.hidden !== !0;
1468
+ const i = o.uid + n, s = r[i];
1469
+ return !s || s.hidden !== !0;
1658
1470
  });
1659
1471
  }
1660
- class cr extends Error {
1472
+ class rr extends Error {
1661
1473
  constructor() {
1662
- super(...arguments), this.code = F.resolveStringInterpolationError, this.name = "StringInterpolationError";
1474
+ super(...arguments), this.code = k.resolveStringInterpolationError, this.name = "StringInterpolationError";
1663
1475
  }
1664
1476
  }
1665
- const $o = (e) => {
1666
- const t = So(e.resolvedSources), r = se(
1477
+ const ao = (e) => {
1478
+ const t = fo(e.resolvedSources), r = re(
1667
1479
  e.widgetPropOverrides,
1668
- (i) => i in e.resolvedSources
1669
- ), n = se(e.touchedControls, (i) => t.has(i)), o = se(e.validations, (i) => t.has(i)), s = se(
1480
+ (s) => s in e.resolvedSources
1481
+ ), n = re(e.touchedControls, (s) => t.has(s)), o = re(e.validations, (s) => t.has(s)), i = re(
1670
1482
  e.injectedValidations,
1671
- (i) => t.has(i)
1483
+ (s) => t.has(s)
1672
1484
  );
1673
- return r === e.widgetPropOverrides && n === e.touchedControls && o === e.validations && s === e.injectedValidations ? e : { ...e, widgetPropOverrides: r, touchedControls: n, validations: o, injectedValidations: s };
1485
+ return r === e.widgetPropOverrides && n === e.touchedControls && o === e.validations && i === e.injectedValidations ? e : { ...e, widgetPropOverrides: r, touchedControls: n, validations: o, injectedValidations: i };
1674
1486
  };
1675
- function So(e) {
1487
+ function fo(e) {
1676
1488
  const t = /* @__PURE__ */ new Set();
1677
1489
  for (const r of Object.values(e)) {
1678
- const n = R(r);
1490
+ const n = T(r);
1679
1491
  n !== void 0 && t.add(n);
1680
1492
  }
1681
1493
  return t;
1682
1494
  }
1683
- function se(e, t) {
1495
+ function re(e, t) {
1684
1496
  const r = Object.keys(e).filter(t);
1685
1497
  if (r.length === Object.keys(e).length)
1686
1498
  return e;
@@ -1689,20 +1501,20 @@ function se(e, t) {
1689
1501
  n[o] = e[o];
1690
1502
  return n;
1691
1503
  }
1692
- const Ao = (e) => {
1504
+ const po = (e) => {
1693
1505
  const t = Object.keys(e.resolvedSources), r = {};
1694
1506
  let n = t.length !== Object.keys(e.calculatedWidgets).length;
1695
1507
  for (const o of t) {
1696
- const s = e.calculatedWidgets[o];
1697
- s ? r[o] = s : (r[o] = {
1508
+ const i = e.calculatedWidgets[o];
1509
+ i ? r[o] = i : (r[o] = {
1698
1510
  source: e.resolvedSources[o],
1699
1511
  current: {}
1700
1512
  }, n = !0);
1701
1513
  }
1702
1514
  return n ? { ...e, calculatedWidgets: r } : e;
1703
- }, Eo = ({ lang: e }, t) => {
1515
+ }, ho = ({ lang: e }, t) => {
1704
1516
  const r = {
1705
- ...Wt(e),
1517
+ ...It(e),
1706
1518
  formName: t.payload.formName
1707
1519
  };
1708
1520
  let n = t.payload.formDef, o = { status: "ok" };
@@ -1710,7 +1522,7 @@ const Ao = (e) => {
1710
1522
  try {
1711
1523
  n = JSON.parse(n);
1712
1524
  } catch (a) {
1713
- const p = a, g = F.initializeParseError;
1525
+ const p = a, g = k.initializeParseError;
1714
1526
  o = {
1715
1527
  status: "errored",
1716
1528
  message: `[${g}] ${p.message}`,
@@ -1720,10 +1532,10 @@ const Ao = (e) => {
1720
1532
  if (o.status === "errored")
1721
1533
  return { ...r, formHealth: o };
1722
1534
  }
1723
- let s = n;
1535
+ let i = n;
1724
1536
  if (Array.isArray(n.form)) {
1725
1537
  const a = n.form;
1726
- s = {
1538
+ i = {
1727
1539
  ...n,
1728
1540
  form: {
1729
1541
  uid: "",
@@ -1733,83 +1545,83 @@ const Ao = (e) => {
1733
1545
  }
1734
1546
  };
1735
1547
  }
1736
- const i = Ft.decode(s);
1737
- if (i.isOk()) {
1548
+ const s = wt.decode(i);
1549
+ if (s.isOk()) {
1738
1550
  o = { status: "ok" };
1739
1551
  let a = {};
1740
1552
  try {
1741
- a = Be([i.value.form]).reduce(
1553
+ a = He([s.value.form]).reduce(
1742
1554
  (p, g) => {
1743
- const I = g.uid;
1744
- if (p[I])
1745
- throw { existingWidget: p[I], newWidget: g };
1746
- return p[I] = g, p;
1555
+ const w = g.uid;
1556
+ if (p[w])
1557
+ throw { existingWidget: p[w], newWidget: g };
1558
+ return p[w] = g, p;
1747
1559
  },
1748
1560
  {}
1749
1561
  );
1750
1562
  } catch (p) {
1751
- o = Co(p.existingWidget, p.newWidget), a = {};
1563
+ o = yo(p.existingWidget, p.newWidget), a = {};
1752
1564
  }
1753
- return Io(a, i.value.states), {
1565
+ return vo(a, s.value.states), {
1754
1566
  ...r,
1755
- formDef: i.value,
1567
+ formDef: s.value,
1756
1568
  flatForm: a,
1757
- ...Te(a, {}),
1569
+ ...Pe(a, {}),
1758
1570
  formHealth: o
1759
1571
  };
1760
1572
  }
1761
- const u = Oo(n);
1762
- if (u)
1763
- return { ...r, formHealth: u };
1764
- const d = F.initializeUnknownError, l = i.issues.map((a) => `${a.path.length > 0 ? kt(a.path) : "root"}: ${a.message}`).join("; ");
1573
+ const c = go(n);
1574
+ if (c)
1575
+ return { ...r, formHealth: c };
1576
+ const u = k.initializeUnknownError, l = s.issues.map((a) => `${a.path.length > 0 ? pr(a.path) : "root"}: ${a.message}`).join("; ");
1765
1577
  return {
1766
1578
  ...r,
1767
1579
  formHealth: {
1768
1580
  status: "errored",
1769
- message: `[${d}] ${l}`,
1770
- code: d
1581
+ message: `[${u}] ${l}`,
1582
+ code: u
1771
1583
  }
1772
1584
  };
1773
1585
  };
1774
- function dr(e, t) {
1586
+ function nr(e, t) {
1775
1587
  return { status: "errored", code: e, message: `[${e}] ${t}` };
1776
1588
  }
1777
- function wo() {
1589
+ function mo() {
1778
1590
  return "Malformed form definition. Pass it directly as formDef - `config={{ formDef: { states, form: [...] } }}`. Do NOT wrap it in an extra `{ form: ... }`.";
1779
1591
  }
1780
- function Oo(e) {
1592
+ function go(e) {
1781
1593
  if (!e || typeof e != "object" || Array.isArray(e))
1782
1594
  return null;
1783
1595
  const t = e.form;
1784
- return t && typeof t == "object" && !Array.isArray(t) && !H(t) ? dr(F.initializeMalformedFormShapeError, wo()) : null;
1596
+ return t && typeof t == "object" && !Array.isArray(t) && !_(t) ? nr(k.initializeMalformedFormShapeError, mo()) : null;
1785
1597
  }
1786
- function Co(e, t) {
1787
- const r = (o) => j(o) ? ` at "${o.path}"` : "", n = `Duplicate UID "${t.uid}": Assigned to widget "${e.type}"${r(e)} and "${t.type}"${r(t)}.`;
1788
- return dr(F.initializeUidCollisionError, n);
1598
+ function yo(e, t) {
1599
+ const r = (o) => I(o) ? ` at "${o.path}"` : "", n = `Duplicate UID "${t.uid}": Assigned to widget "${e.type}"${r(e)} and "${t.type}"${r(t)}.`;
1600
+ return nr(k.initializeUidCollisionError, n);
1789
1601
  }
1790
- function Io(e, t) {
1602
+ function vo(e, t) {
1791
1603
  const r = new Set(Object.keys(t ?? {})), n = /* @__PURE__ */ new Map();
1792
- for (const s of Object.values(e)) {
1793
- const i = [], u = s.include;
1794
- u && Array.isArray(u.in) && i.push(...u.in);
1795
- const d = s.exclude;
1796
- d && Array.isArray(d.from) && i.push(...d.from);
1797
- for (const l of i) {
1604
+ for (const i of Object.values(e)) {
1605
+ const s = [], c = i.include;
1606
+ c && Array.isArray(c.in) && s.push(...c.in);
1607
+ const u = i.exclude;
1608
+ u && Array.isArray(u.from) && s.push(...u.from);
1609
+ for (const l of s) {
1798
1610
  if (r.has(l))
1799
1611
  continue;
1800
1612
  const a = n.get(l) ?? [];
1801
- a.push(s.uid || "(unknown)"), n.set(l, a);
1613
+ a.push(i.uid || "(unknown)"), n.set(l, a);
1802
1614
  }
1803
1615
  }
1804
1616
  if (n.size === 0)
1805
1617
  return;
1806
1618
  const o = r.size ? [...r].join(", ") : "(none declared)";
1807
- for (const [s, i] of n)
1619
+ for (const [i, s] of n)
1808
1620
  console.error(
1809
- `[GolemUI] include/exclude references undefined state "${s}" (on ${i.join(", ")}); these widgets will stay hidden. Declared states: ${o}. Fix: declare "${s}" in formConfig.states, or correct the name.`
1621
+ `[GolemUI] include/exclude references undefined state "${i}" (on ${s.join(", ")}); these widgets will stay hidden. Declared states: ${o}. Fix: declare "${i}" in formConfig.states, or correct the name.`
1810
1622
  );
1811
1623
  }
1812
- function ko(e, t) {
1624
+ function $o(e, t) {
1813
1625
  const { path: r, issues: n } = t.payload, o = n?.length ? {
1814
1626
  touched: !0,
1815
1627
  touchedControls: { ...e.touchedControls, [r]: !0 }
@@ -1823,8 +1635,8 @@ function ko(e, t) {
1823
1635
  }
1824
1636
  };
1825
1637
  }
1826
- const jo = (e, { payload: t }) => {
1827
- const r = "path" in t ? Fo(e, t.path) : Po(e, t.uid);
1638
+ const So = (e, { payload: t }) => {
1639
+ const r = "path" in t ? Eo(e, t.path) : Ao(e, t.uid);
1828
1640
  if (r === void 0)
1829
1641
  return e;
1830
1642
  const n = e.widgetPropOverrides[r] || {};
@@ -1836,53 +1648,53 @@ const jo = (e, { payload: t }) => {
1836
1648
  }
1837
1649
  };
1838
1650
  };
1839
- function Po(e, t) {
1651
+ function Ao(e, t) {
1840
1652
  if (t in e.resolvedSources)
1841
1653
  return t;
1842
1654
  console.warn(`Widget with uid "${t}" not found`);
1843
1655
  }
1844
- function Fo(e, t) {
1656
+ function Eo(e, t) {
1845
1657
  const r = Object.values(e.calculatedWidgets).find(
1846
- ({ source: o, current: s }) => (R(s) ?? R(o)) === t
1658
+ ({ source: o, current: i }) => (T(i) ?? T(o)) === t
1847
1659
  );
1848
1660
  if (r)
1849
1661
  return r.source.uid;
1850
1662
  const n = Object.keys(e.resolvedSources).find(
1851
- (o) => R(e.resolvedSources[o]) === t
1663
+ (o) => T(e.resolvedSources[o]) === t
1852
1664
  );
1853
1665
  if (n !== void 0)
1854
1666
  return n;
1855
1667
  console.warn(`Input with path "${t}" not found`);
1856
1668
  }
1857
- const Wo = (e, t) => ({
1669
+ const Co = (e, t) => ({
1858
1670
  ...e,
1859
1671
  data: { ...t.payload.data }
1860
- }), Do = (e, t) => ({
1672
+ }), wo = (e, t) => ({
1861
1673
  ...e,
1862
1674
  formHealth: t.payload.formHealth
1863
- }), To = (e, t) => ({
1675
+ }), Io = (e, t) => ({
1864
1676
  ...e,
1865
1677
  lang: t.payload.lang
1866
- }), No = (e, t) => ({
1678
+ }), Oo = (e, t) => ({
1867
1679
  ...e,
1868
1680
  meta: { ...t.payload.meta }
1869
- }), Vo = (e, t) => ({
1681
+ }), ko = (e, t) => ({
1870
1682
  ...e,
1871
- data: Dt(e.data, t.payload.path, t.payload.data)
1872
- }), lr = /* @__PURE__ */ Symbol("filterMap.skip");
1873
- function Ro(e, t) {
1683
+ data: Ot(e.data, t.payload.path, t.payload.data)
1684
+ }), or = /* @__PURE__ */ Symbol("filterMap.skip");
1685
+ function jo(e, t) {
1874
1686
  const r = [];
1875
1687
  for (let n = 0; n < e.length; n++) {
1876
1688
  const o = t(e[n], n, e);
1877
- o !== lr && r.push(o);
1689
+ o !== or && r.push(o);
1878
1690
  }
1879
1691
  return r;
1880
1692
  }
1881
- function ls(e, t, r) {
1693
+ function ni(e, t, r) {
1882
1694
  for (let n = 0; n < e.length; n++)
1883
1695
  t(e[n], n, e) && r(e[n], n, e);
1884
1696
  }
1885
- function Lo(e, t, r) {
1697
+ function Wo(e, t, r) {
1886
1698
  if (e.length !== t.length)
1887
1699
  return !1;
1888
1700
  for (let n = 0; n < e.length; n++)
@@ -1890,140 +1702,140 @@ function Lo(e, t, r) {
1890
1702
  return !1;
1891
1703
  return !0;
1892
1704
  }
1893
- const Mo = (e, t) => (r) => {
1894
- const n = Ro(
1705
+ const Po = (e, t) => (r) => {
1706
+ const n = jo(
1895
1707
  Object.values(r.calculatedWidgets),
1896
- ({ current: s }) => j(s) ? s : lr
1708
+ ({ current: i }) => I(i) ? i : or
1897
1709
  ), o = r.validations;
1898
1710
  return {
1899
1711
  ...r,
1900
1712
  validations: n.reduce(
1901
- (s, i) => {
1902
- if (s[i.path] = null, i.validator) {
1903
- const u = e(i.validator, t), d = M(r.data, i.path), l = gr(
1904
- u,
1905
- d
1713
+ (i, s) => {
1714
+ if (i[s.path] = null, s.validator) {
1715
+ const c = e(s.validator, t), u = V(r.data, s.path), l = hr(
1716
+ c,
1717
+ u
1906
1718
  );
1907
- s[i.path] = yr(l) ? null : l.issues.map((a) => a.message);
1719
+ i[s.path] = mr(l) ? null : l.issues.map((a) => a.message);
1908
1720
  }
1909
- return Array.isArray(s[i.path]) && Array.isArray(o[i.path]) && Lo(
1910
- s[i.path],
1911
- o[i.path],
1912
- (u, d) => u === d
1913
- ) && (s[i.path] = o[i.path]), s;
1721
+ return Array.isArray(i[s.path]) && Array.isArray(o[s.path]) && Wo(
1722
+ i[s.path],
1723
+ o[s.path],
1724
+ (c, u) => c === u
1725
+ ) && (i[s.path] = o[s.path]), i;
1914
1726
  },
1915
1727
  {}
1916
1728
  )
1917
1729
  };
1918
- }, _o = ({
1730
+ }, Do = ({
1919
1731
  validators: e,
1920
1732
  validateOn: t,
1921
1733
  localization: r,
1922
1734
  functions: n
1923
1735
  }) => {
1924
- const o = bo(r, n), s = Mo(e, r), i = or(r, n), u = (l) => Et(l, o, s, !1), d = (l) => Et(l, o, s, !0);
1736
+ const o = No(r, n), i = Po(e, r), s = Zt(r, n), c = (l) => vt(l, o, i, !1), u = (l) => vt(l, o, i, !0);
1925
1737
  return (l, a) => {
1926
1738
  switch (a.type) {
1927
1739
  case "INITIALIZE":
1928
- return Eo(l, a);
1740
+ return ho(l, a);
1929
1741
  case "SET_DATA":
1930
- return u(Wo(l, a));
1742
+ return c(Co(l, a));
1931
1743
  case "SET_META":
1932
- return u(No(l, a));
1744
+ return c(Oo(l, a));
1933
1745
  case "SET_WIDGET_DATA":
1934
- return u(Vo(l, a));
1746
+ return c(ko(l, a));
1935
1747
  case "SET_LANGUAGE":
1936
- return i(To(l, a));
1748
+ return s(Io(l, a));
1937
1749
  case "OVERRIDE_WIDGET_PROP": {
1938
- const p = jo(l, a);
1750
+ const p = So(l, a);
1939
1751
  if (p === l)
1940
1752
  return l;
1941
- const g = u(p);
1942
- return Ko(g, a) ? s(g) : g;
1753
+ const g = c(p);
1754
+ return _o(g, a) ? i(g) : g;
1943
1755
  }
1944
1756
  case "SET_FORM_HEALTH":
1945
- return Do(l, a);
1757
+ return wo(l, a);
1946
1758
  case "VALIDATE_ALL":
1947
- return d(s(Bo(l)));
1759
+ return u(i(Ro(l)));
1948
1760
  case "ATTEMPT_VALIDATION": {
1949
- if (!Go(t, a.payload.reason))
1761
+ if (!Lo(t, a.payload.reason))
1950
1762
  return l;
1951
1763
  const p = {
1952
1764
  ...l,
1953
1765
  touched: !0,
1954
1766
  touchedControls: { ...l.touchedControls, [a.payload.path]: !0 }
1955
1767
  };
1956
- return d(s(p));
1768
+ return u(i(p));
1957
1769
  }
1958
1770
  case "INJECT_VALIDATION_ISSUES":
1959
- return ko(l, a);
1771
+ return $o(l, a);
1960
1772
  default:
1961
- return Lr(a);
1773
+ return Wr(a);
1962
1774
  }
1963
1775
  };
1964
- }, Uo = /* @__PURE__ */ new Set([
1965
- F.calculateCurrentStateError,
1966
- F.calculateWidgetFlagsError,
1967
- F.calculateWidgetPropsError,
1968
- F.resolveStringInterpolationError
1969
- ]), Ho = (e) => e.formHealth.status === "errored" && !Uo.has(e.formHealth.code);
1970
- function bo(e, t) {
1971
- const r = Gn(t), n = xn(t), o = or(e, t);
1972
- return function(i) {
1973
- if (Ho(i))
1974
- return i;
1975
- const u = (d) => ({ ...i, formHealth: d });
1776
+ }, Fo = /* @__PURE__ */ new Set([
1777
+ k.calculateCurrentStateError,
1778
+ k.calculateWidgetFlagsError,
1779
+ k.calculateWidgetPropsError,
1780
+ k.resolveStringInterpolationError
1781
+ ]), To = (e) => e.formHealth.status === "errored" && !Fo.has(e.formHealth.code);
1782
+ function No(e, t) {
1783
+ const r = Ln(t), n = Mn(t), o = Zt(e, t);
1784
+ return function(s) {
1785
+ if (To(s))
1786
+ return s;
1787
+ const c = (u) => ({ ...s, formHealth: u });
1976
1788
  try {
1977
- let d = i.formHealth.status === "ok" ? i : { ...i, formHealth: { status: "ok" } };
1978
- d = Gr(d), d = $o(d);
1979
- const l = Se(d);
1980
- return d = r(d, l), d.formHealth.status !== "ok" ? u(d.formHealth) : (d = n(d, l), d = Ao(d), d = o(d, l), d.formHealth.status === "ok" ? d : u(d.formHealth));
1981
- } catch (d) {
1982
- const l = F.calculateWidgetFlagsError;
1983
- return u({
1789
+ let u = s.formHealth.status === "ok" ? s : { ...s, formHealth: { status: "ok" } };
1790
+ u = Lr(u), u = ao(u);
1791
+ const l = ve(u);
1792
+ return u = r(u, l), u.formHealth.status !== "ok" ? c(u.formHealth) : (u = n(u, l), u = po(u), u = o(u, l), u.formHealth.status === "ok" ? u : c(u.formHealth));
1793
+ } catch (u) {
1794
+ const l = k.calculateWidgetFlagsError;
1795
+ return c({
1984
1796
  status: "errored",
1985
1797
  code: l,
1986
- message: `[${l}] ${d.message}`
1798
+ message: `[${l}] ${u.message}`
1987
1799
  });
1988
1800
  }
1989
1801
  };
1990
1802
  }
1991
- function Et(e, t, r, n) {
1992
- const o = (a) => n ? wt(a) : a, s = e.resolvedSources, i = e.widgetFlags;
1993
- let u = t(e);
1994
- if (!u.allControlsValidated || u.formHealth.status !== "ok")
1995
- return o(u);
1996
- const d = zo(u, s, i);
1997
- if (d.length === 0)
1998
- return o(u);
1999
- const l = { ...u.touchedControls };
2000
- for (const a of d)
1803
+ function vt(e, t, r, n) {
1804
+ const o = (a) => n ? $t(a) : a, i = e.resolvedSources, s = e.widgetFlags;
1805
+ let c = t(e);
1806
+ if (!c.allControlsValidated || c.formHealth.status !== "ok")
1807
+ return o(c);
1808
+ const u = Vo(c, i, s);
1809
+ if (u.length === 0)
1810
+ return o(c);
1811
+ const l = { ...c.touchedControls };
1812
+ for (const a of u)
2001
1813
  l[a] = !0;
2002
- return u = { ...u, touchedControls: l }, wt(t(r(u)));
1814
+ return c = { ...c, touchedControls: l }, $t(t(r(c)));
2003
1815
  }
2004
- function zo(e, t, r) {
1816
+ function Vo(e, t, r) {
2005
1817
  const n = [];
2006
- for (const [o, s] of Object.entries(e.resolvedSources)) {
2007
- const i = R(s);
2008
- if (i === void 0 || e.widgetFlags[o]?.hidden === !0 || e.touchedControls[i] === !0)
1818
+ for (const [o, i] of Object.entries(e.resolvedSources)) {
1819
+ const s = T(i);
1820
+ if (s === void 0 || e.widgetFlags[o]?.hidden === !0 || e.touchedControls[s] === !0)
2009
1821
  continue;
2010
- const u = t[o] === void 0, d = r[o]?.hidden === !0;
2011
- (u || d) && n.push(i);
1822
+ const c = t[o] === void 0, u = r[o]?.hidden === !0;
1823
+ (c || u) && n.push(s);
2012
1824
  }
2013
1825
  return n;
2014
1826
  }
2015
- function Bo(e) {
1827
+ function Ro(e) {
2016
1828
  const t = {};
2017
1829
  for (const { source: r, current: n } of Object.values(e.calculatedWidgets)) {
2018
- const o = R(n) ?? R(r);
1830
+ const o = T(n) ?? T(r);
2019
1831
  o !== void 0 && (t[o] = !0);
2020
1832
  }
2021
1833
  return { ...e, touched: !0, allControlsValidated: !0, touchedControls: t };
2022
1834
  }
2023
- function Go(e, t) {
1835
+ function Lo(e, t) {
2024
1836
  return e === "eager" || t === e || Array.isArray(e) && e.includes(t);
2025
1837
  }
2026
- function Ko(e, t) {
1838
+ function _o(e, t) {
2027
1839
  if (!e.touched)
2028
1840
  return !1;
2029
1841
  let r;
@@ -2031,70 +1843,70 @@ function Ko(e, t) {
2031
1843
  r = t.payload.path;
2032
1844
  else {
2033
1845
  const n = e.calculatedWidgets[t.payload.uid]?.current;
2034
- n && j(n) && (r = n.path);
1846
+ n && I(n) && (r = n.path);
2035
1847
  }
2036
1848
  return r !== void 0 && e.touchedControls[r] === !0;
2037
1849
  }
2038
- function wt(e) {
1850
+ function $t(e) {
2039
1851
  const t = Object.keys(e.injectedValidations), r = Object.keys(e.validations);
2040
1852
  if (t.length === 0 && r.length === 0)
2041
1853
  return { ...e, isFormValid: !0 };
2042
1854
  let n = t.find((o) => {
2043
- const s = e.injectedValidations[o];
2044
- return Array.isArray(s) && s.length > 0;
1855
+ const i = e.injectedValidations[o];
1856
+ return Array.isArray(i) && i.length > 0;
2045
1857
  });
2046
1858
  return n !== void 0 ? { ...e, isFormValid: !1 } : (n = r.find((o) => {
2047
- const s = e.validations[o];
2048
- return Array.isArray(s) && s.length > 0;
1859
+ const i = e.validations[o];
1860
+ return Array.isArray(i) && i.length > 0;
2049
1861
  }), n !== void 0 ? { ...e, isFormValid: !1 } : { ...e, isFormValid: !0 });
2050
1862
  }
2051
- function xo(e = [], t, r, n, o = {}) {
2052
- const s = new hr(Wt(n.lang)), i = s.asObservable().pipe(Le()), u = _o({ validators: t, validateOn: r, localization: n, functions: o });
2053
- function d(g) {
2054
- const I = s.getValue(), Oe = u(I, g);
2055
- s.next(Oe);
1863
+ function Mo(e = [], t, r, n, o = {}) {
1864
+ const i = new dr(It(n.lang)), s = i.asObservable().pipe(Ne()), c = Do({ validators: t, validateOn: r, localization: n, functions: o });
1865
+ function u(g) {
1866
+ const w = i.getValue(), Ee = c(w, g);
1867
+ i.next(Ee);
2056
1868
  }
2057
- let l = d;
1869
+ let l = u;
2058
1870
  const a = {
2059
- getState: () => s.getValue(),
1871
+ getState: () => i.getValue(),
2060
1872
  dispatch: (g) => l(g)
2061
1873
  // reference is updated later
2062
1874
  };
2063
- return l = e.map((g) => g(a)).reduceRight((g, I) => I(g), d), {
2064
- state$: i,
1875
+ return l = e.map((g) => g(a)).reduceRight((g, w) => w(g), u), {
1876
+ state$: s,
2065
1877
  dispatch: l,
2066
- getState: () => s.getValue()
1878
+ getState: () => i.getValue()
2067
1879
  };
2068
1880
  }
2069
- class as {
1881
+ class oi {
2070
1882
  constructor() {
2071
- this.widgetRegistry = new ce(), this.store = {}, this.events$ = new it(), this.submit$ = new it(), this.itemRenderers = {}, this.dependencies = {};
1883
+ this.widgetRegistry = new ie(), this.store = {}, this.events$ = new nt(), this.submit$ = new nt(), this.itemRenderers = {}, this.dependencies = {};
2072
1884
  }
2073
- initialize(t, r = [], n, o, s, i = Rr(), u, d = {}) {
2074
- this.localization = i, this.dependencies = u, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = s, this.store = xo(r, n, o, i, d);
1885
+ initialize(t, r = [], n, o, i, s = jr(), c, u = {}) {
1886
+ this.localization = s, this.dependencies = c, this.widgetRegistry.setWidgetLoaders(t), this.itemRenderers = i, this.store = Mo(r, n, o, s, u);
2075
1887
  }
2076
1888
  emitEvent(t, r, n) {
2077
- const s = this.store.getState().currentStates.filter((i) => r.on?.[`${t}.${i}`] !== void 0);
2078
- if (this.attemptValidation(t, r), s.length > 0)
2079
- s.forEach((i) => {
2080
- const u = r.on?.[`${t}.${i}`];
2081
- u && this.events$.next({
2082
- name: u,
2083
- data: Ie(this.store.getState()),
1889
+ const i = this.store.getState().currentStates.filter((s) => r.on?.[`${t}.${s}`] !== void 0);
1890
+ if (this.attemptValidation(t, r), i.length > 0)
1891
+ i.forEach((s) => {
1892
+ const c = r.on?.[`${t}.${s}`];
1893
+ c && this.events$.next({
1894
+ name: c,
1895
+ data: we(this.store.getState()),
2084
1896
  detail: n ?? void 0,
2085
- callback: (d) => {
2086
- this.store.dispatch(d);
1897
+ callback: (u) => {
1898
+ this.store.dispatch(u);
2087
1899
  }
2088
1900
  });
2089
1901
  });
2090
1902
  else {
2091
- const i = r.on?.[t];
2092
- i && this.events$.next({
2093
- name: i,
2094
- data: Ie(this.store.getState()),
1903
+ const s = r.on?.[t];
1904
+ s && this.events$.next({
1905
+ name: s,
1906
+ data: we(this.store.getState()),
2095
1907
  detail: n,
2096
- callback: (u) => {
2097
- this.store.dispatch(u);
1908
+ callback: (c) => {
1909
+ this.store.dispatch(c);
2098
1910
  }
2099
1911
  });
2100
1912
  }
@@ -2103,7 +1915,7 @@ class as {
2103
1915
  this.store.dispatch({
2104
1916
  type: "VALIDATE_ALL"
2105
1917
  }), this.store.getState().isFormValid && this.submit$.next({
2106
- data: Ie(this.store.getState()),
1918
+ data: we(this.store.getState()),
2107
1919
  callback: (t) => {
2108
1920
  this.store.dispatch(t);
2109
1921
  }
@@ -2122,45 +1934,45 @@ class as {
2122
1934
  }));
2123
1935
  }
2124
1936
  }
2125
- function fs(e = "GolemUI Form Store") {
1937
+ function ii(e = "GolemUI Form Store") {
2126
1938
  return (t) => {
2127
1939
  const n = (typeof window < "u" ? window.__REDUX_DEVTOOLS_EXTENSION__ : void 0)?.connect({ name: e });
2128
- return n?.init(t.getState()), (o) => (s) => {
2129
- o(s), n && n.send(s, t.getState());
1940
+ return n?.init(t.getState()), (o) => (i) => {
1941
+ o(i), n && n.send(i, t.getState());
2130
1942
  };
2131
1943
  };
2132
1944
  }
2133
- const Xo = mr(
2134
- Ct((e) => e.formHealth),
2135
- Le((e, t) => e.status !== t.status ? !1 : e.status === "errored" && t.status === "errored" ? e.message === t.message && e.code === t.code : !0)
2136
- ), ps = (e) => e.pipe(Xo);
2137
- function hs(e, t) {
2138
- return fr(e, t, ar(e, t), void 0);
1945
+ const Uo = ur(
1946
+ At((e) => e.formHealth),
1947
+ Ne((e, t) => e.status !== t.status ? !1 : e.status === "errored" && t.status === "errored" ? e.message === t.message && e.code === t.code : !0)
1948
+ ), si = (e) => e.pipe(Uo);
1949
+ function ci(e, t) {
1950
+ return sr(e, t, ir(e, t), void 0);
2139
1951
  }
2140
- function Jo() {
1952
+ function Ho() {
2141
1953
  const e = /* @__PURE__ */ new Map();
2142
1954
  return (t, r) => {
2143
- const n = ar(t, r), o = e.get(r);
2144
- if (o && Zo(o.slices, n))
1955
+ const n = ir(t, r), o = e.get(r);
1956
+ if (o && Bo(o.slices, n))
2145
1957
  return o.viewModel;
2146
- const s = fr(t, r, n, o);
2147
- return e.set(r, { slices: n, viewModel: s }), s;
1958
+ const i = sr(t, r, n, o);
1959
+ return e.set(r, { slices: n, viewModel: i }), i;
2148
1960
  };
2149
1961
  }
2150
- const ms = (e) => (t) => {
2151
- const r = Jo();
1962
+ const di = (e) => (t) => {
1963
+ const r = Ho();
2152
1964
  return t.pipe(
2153
- Ct((n) => r(n, e)),
1965
+ At((n) => r(n, e)),
2154
1966
  // The reader returns the same object while nothing changed, so reference equality is enough.
2155
- Le()
1967
+ Ne()
2156
1968
  );
2157
- }, Qo = [], Ot = [], qo = [];
2158
- function ar(e, t) {
2159
- const r = Yo(e, t);
1969
+ }, zo = [], St = [], bo = [];
1970
+ function ir(e, t) {
1971
+ const r = Go(e, t);
2160
1972
  return [
2161
1973
  e.calculatedWidgets[t],
2162
1974
  e.lang,
2163
- r === void 0 ? void 0 : M(e.data, r),
1975
+ r === void 0 ? void 0 : V(e.data, r),
2164
1976
  r !== void 0 && e.touched ? e.validations[r] : null,
2165
1977
  r !== void 0 && e.touched ? e.injectedValidations[r] : null,
2166
1978
  r !== void 0 && e.touchedControls[r] === !0,
@@ -2168,60 +1980,60 @@ function ar(e, t) {
2168
1980
  e.widgetFlags[t]?.hidden === !0
2169
1981
  ];
2170
1982
  }
2171
- function Zo(e, t) {
1983
+ function Bo(e, t) {
2172
1984
  return e.every((r, n) => Object.is(r, t[n]));
2173
1985
  }
2174
- function fr(e, t, r, n) {
2175
- const [o, s, i, u, d, l, a, p] = r, g = n === void 0 || !Object.is(n.slices[0], o), I = n === void 0 || !Object.is(n.slices[2], i), Oe = n === void 0 || !Object.is(n.slices[3], u) || !Object.is(n.slices[4], d), Ce = o?.current;
1986
+ function sr(e, t, r, n) {
1987
+ const [o, i, s, c, u, l, a, p] = r, g = n === void 0 || !Object.is(n.slices[0], o), w = n === void 0 || !Object.is(n.slices[2], s), Ee = n === void 0 || !Object.is(n.slices[3], c) || !Object.is(n.slices[4], u), Ce = o?.current;
2176
1988
  return {
2177
1989
  uid: t,
2178
1990
  widget: Ce,
2179
- children: g ? es(e, t, Ce) : n.viewModel.children,
2180
- rows: g || I ? ts(e, t, Ce, i) : n.viewModel.rows,
2181
- lang: s,
2182
- value: i,
2183
- errors: Oe ? rs(u, d) : n.viewModel.errors,
1991
+ children: g ? Ko(e, t, Ce) : n.viewModel.children,
1992
+ rows: g || w ? Xo(e, t, Ce, s) : n.viewModel.rows,
1993
+ lang: i,
1994
+ value: s,
1995
+ errors: Ee ? xo(c, u) : n.viewModel.errors,
2184
1996
  touched: l,
2185
1997
  formInvalid: a,
2186
1998
  hidden: p
2187
1999
  };
2188
2000
  }
2189
- function Yo(e, t) {
2001
+ function Go(e, t) {
2190
2002
  return e.resolvedSources[t]?.path;
2191
2003
  }
2192
- function es(e, t, r) {
2193
- if (r === void 0 || !H(r))
2194
- return Qo;
2195
- const n = r.children, o = te(t);
2004
+ function Ko(e, t, r) {
2005
+ if (r === void 0 || !_(r))
2006
+ return zo;
2007
+ const n = r.children, o = Z(t);
2196
2008
  if (o.length === 0)
2197
2009
  return n;
2198
- const s = o.map((i) => `[${i}]`).join("");
2199
- return n.map((i) => e.resolvedSources[`${i.uid}${s}`] ?? i);
2010
+ const i = o.map((s) => `[${s}]`).join("");
2011
+ return n.map((s) => e.resolvedSources[`${s.uid}${i}`] ?? s);
2200
2012
  }
2201
- function ts(e, t, r, n) {
2013
+ function Xo(e, t, r, n) {
2202
2014
  if (r === void 0 || !Array.isArray(n))
2203
- return Ot;
2015
+ return St;
2204
2016
  const o = e.resolvedSources[t];
2205
- if (o === void 0 || !Ae(o))
2206
- return Ot;
2207
- const s = o.props.template.uid, i = te(t);
2208
- return n.map((u, d) => {
2209
- const l = Ge(s, [...i, d]);
2017
+ if (o === void 0 || !$e(o))
2018
+ return St;
2019
+ const i = o.props.template.uid, s = Z(t);
2020
+ return n.map((c, u) => {
2021
+ const l = ze(i, [...s, u]);
2210
2022
  return e.resolvedSources[l];
2211
- }).filter((u) => u !== void 0);
2023
+ }).filter((c) => c !== void 0);
2212
2024
  }
2213
- function rs(e, t) {
2214
- return (e?.length ?? 0) + (t?.length ?? 0) === 0 ? qo : [...e ?? [], ...t ?? []];
2025
+ function xo(e, t) {
2026
+ return (e?.length ?? 0) + (t?.length ?? 0) === 0 ? bo : [...e ?? [], ...t ?? []];
2215
2027
  }
2216
- let pr = !1;
2217
- function gs() {
2218
- pr = !0;
2028
+ let cr = !1;
2029
+ function ui() {
2030
+ cr = !0;
2219
2031
  }
2220
- function ns() {
2221
- return pr;
2032
+ function Qo() {
2033
+ return cr;
2222
2034
  }
2223
- function ys(e, t, r) {
2224
- if (!ns())
2035
+ function li(e, t, r) {
2036
+ if (!Qo())
2225
2037
  return;
2226
2038
  const n = Object.keys(t ?? {}).filter((o) => o in r);
2227
2039
  if (n.length > 0)
@@ -2229,26 +2041,26 @@ function ys(e, t, r) {
2229
2041
  `[GolemUI] Widget "${e}": prop keys [${n.join(", ")}] collide with widget fields`
2230
2042
  );
2231
2043
  }
2232
- const vs = () => crypto.randomUUID().slice(0, 8);
2044
+ const ai = () => crypto.randomUUID().slice(0, 8);
2233
2045
  export {
2234
- as as FormContext,
2235
- ys as assertNoPropCollisions,
2236
- de as cloneObject,
2237
- Jo as createWidgetViewModelReader,
2238
- us as defineForm,
2239
- fs as devToolsMiddleware,
2240
- gs as enableDevMode,
2241
- F as errorCodes,
2242
- ls as filterTap,
2243
- cs as formEventNames,
2244
- ps as formHealth,
2245
- ds as getDirectionFromLanguage,
2246
- Rr as identityTranslator,
2247
- yr as isStandardValidateSuccess,
2248
- Vt as makeRepeaterItemConfig,
2249
- is as preloadFormWidgets,
2250
- vs as shortUUID,
2251
- gr as standardValidate,
2252
- hs as widgetViewModel,
2253
- ms as widgetViewModel$
2046
+ oi as FormContext,
2047
+ li as assertNoPropCollisions,
2048
+ se as cloneObject,
2049
+ Ho as createWidgetViewModelReader,
2050
+ ei as defineForm,
2051
+ ii as devToolsMiddleware,
2052
+ ui as enableDevMode,
2053
+ k as errorCodes,
2054
+ ni as filterTap,
2055
+ ti as formEventNames,
2056
+ si as formHealth,
2057
+ ri as getDirectionFromLanguage,
2058
+ jr as identityTranslator,
2059
+ mr as isStandardValidateSuccess,
2060
+ Wt as makeRepeaterItemConfig,
2061
+ Yo as preloadFormWidgets,
2062
+ ai as shortUUID,
2063
+ hr as standardValidate,
2064
+ ci as widgetViewModel,
2065
+ di as widgetViewModel$
2254
2066
  };