@golemui/core 1.1.0 → 1.1.1-rc.1

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