bank20baht-ui 0.4.1 → 0.4.2

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.
@@ -1,20 +1,20 @@
1
- import { nothing as h, html as n, svg as A } from "lit";
2
- import { property as l, customElement as b, state as $, query as Bt } from "lit/decorators.js";
3
- import { B as y, b as ne, h as S, a as J } from "./base-CajA2aCO.js";
1
+ import { nothing as h, html as n, svg as L } from "lit";
2
+ import { property as l, customElement as b, state as y, query as It } from "lit/decorators.js";
3
+ import { B as g, b as he, h as S, a as Y } from "./base-CajA2aCO.js";
4
4
  import { t as m } from "./i18n-BcPL9_Jh.js";
5
- import { n as $e, k as Lt, o as ds, i as Rt, p as us, d as se, a as rs, m as Ae, v as Le, c as bs, g as fs, l as ms } from "./display-DQRcvsn7.js";
5
+ import { n as $e, k as Nt, o as ds, i as zt, p as us, d as ae, a as rs, m as Ae, v as Le, c as bs, g as fs, l as ms } from "./display-DQRcvsn7.js";
6
6
  import { repeat as Ce } from "lit/directives/repeat.js";
7
- import { html as ee, unsafeStatic as os } from "lit/static-html.js";
8
- import { c as vs, r as H } from "./baht-toast-CD1WrOYr.js";
9
- import { live as ot } from "lit/directives/live.js";
10
- import { ifDefined as L } from "lit/directives/if-defined.js";
7
+ import { html as se, unsafeStatic as os } from "lit/static-html.js";
8
+ import { c as vs, r as W } from "./baht-toast-CD1WrOYr.js";
9
+ import { live as lt } from "lit/directives/live.js";
10
+ import { ifDefined as N } from "lit/directives/if-defined.js";
11
11
  import $s from "flatpickr";
12
- var ys = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, he = (t, e, i, a) => {
12
+ var ys = Object.defineProperty, gs = Object.getOwnPropertyDescriptor, ce = (t, e, i, a) => {
13
13
  for (var s = a > 1 ? void 0 : a ? gs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
14
14
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
15
15
  return a && s && ys(e, i, s), s;
16
16
  };
17
- let zt = class extends y {
17
+ let Vt = class extends g {
18
18
  constructor() {
19
19
  super(...arguments), this.tone = "neutral", this.label = "", this.dot = null;
20
20
  }
@@ -28,50 +28,50 @@ let zt = class extends y {
28
28
  </span>`;
29
29
  }
30
30
  };
31
- he([
31
+ ce([
32
32
  l()
33
- ], zt.prototype, "tone", 2);
34
- he([
33
+ ], Vt.prototype, "tone", 2);
34
+ ce([
35
35
  l()
36
- ], zt.prototype, "label", 2);
37
- he([
36
+ ], Vt.prototype, "label", 2);
37
+ ce([
38
38
  l({ attribute: !1 })
39
- ], zt.prototype, "dot", 2);
40
- zt = he([
39
+ ], Vt.prototype, "dot", 2);
40
+ Vt = ce([
41
41
  b("baht-badge")
42
- ], zt);
43
- var ws = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, je = (t, e, i, a) => {
42
+ ], Vt);
43
+ var ws = Object.defineProperty, xs = Object.getOwnPropertyDescriptor, Me = (t, e, i, a) => {
44
44
  for (var s = a > 1 ? void 0 : a ? xs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
45
45
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
46
46
  return a && s && ws(e, i, s), s;
47
47
  };
48
- let ae = class extends y {
48
+ let ie = class extends g {
49
49
  constructor() {
50
50
  super(...arguments), this.variant = "inline", this.code = "";
51
51
  }
52
52
  firstUpdated() {
53
53
  const t = this.renderRoot.querySelector(this.variant === "block" ? "pre" : "code");
54
- t && ne(this, t);
54
+ t && he(this, t);
55
55
  }
56
56
  render() {
57
57
  return this.variant === "block" ? n`<pre class="baht-code baht-code--block" tabindex="0">${this.code}</pre>` : n`<code class="baht-code">${this.code}</code>`;
58
58
  }
59
59
  };
60
- je([
60
+ Me([
61
61
  l()
62
- ], ae.prototype, "variant", 2);
63
- je([
62
+ ], ie.prototype, "variant", 2);
63
+ Me([
64
64
  l()
65
- ], ae.prototype, "code", 2);
66
- ae = je([
65
+ ], ie.prototype, "code", 2);
66
+ ie = Me([
67
67
  b("baht-code")
68
- ], ae);
69
- var _s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, yt = (t, e, i, a) => {
68
+ ], ie);
69
+ var _s = Object.defineProperty, ks = Object.getOwnPropertyDescriptor, gt = (t, e, i, a) => {
70
70
  for (var s = a > 1 ? void 0 : a ? ks(e, i) : e, r = t.length - 1, o; r >= 0; r--)
71
71
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
72
72
  return a && s && _s(e, i, s), s;
73
73
  };
74
- let ht = class extends y {
74
+ let ht = class extends g {
75
75
  constructor() {
76
76
  super(...arguments), this.page = 1, this.totalPages = 1, this.variant = "numbered", this.siblings = 1, this.hasNext = !1, this.hasPrev = !1;
77
77
  }
@@ -126,25 +126,25 @@ let ht = class extends y {
126
126
  </nav>`;
127
127
  }
128
128
  };
129
- yt([
129
+ gt([
130
130
  l({ type: Number })
131
131
  ], ht.prototype, "page", 2);
132
- yt([
132
+ gt([
133
133
  l({ type: Number, attribute: "total-pages" })
134
134
  ], ht.prototype, "totalPages", 2);
135
- yt([
135
+ gt([
136
136
  l()
137
137
  ], ht.prototype, "variant", 2);
138
- yt([
138
+ gt([
139
139
  l({ type: Number })
140
140
  ], ht.prototype, "siblings", 2);
141
- yt([
141
+ gt([
142
142
  l({ type: Boolean, attribute: "has-next" })
143
143
  ], ht.prototype, "hasNext", 2);
144
- yt([
144
+ gt([
145
145
  l({ type: Boolean, attribute: "has-prev" })
146
146
  ], ht.prototype, "hasPrev", 2);
147
- ht = yt([
147
+ ht = gt([
148
148
  b("baht-pagination")
149
149
  ], ht);
150
150
  var Ps = Object.defineProperty, Os = Object.getOwnPropertyDescriptor, O = (t, e, i, a) => {
@@ -152,8 +152,8 @@ var Ps = Object.defineProperty, Os = Object.getOwnPropertyDescriptor, O = (t, e,
152
152
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
153
153
  return a && s && Ps(e, i, s), s;
154
154
  };
155
- const Cs = " › ", ye = (t) => t !== null && typeof t == "object" && !Array.isArray(t) && !(t instanceof Date), te = (t) => t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
156
- let k = class extends y {
155
+ const Cs = " › ", ye = (t) => t !== null && typeof t == "object" && !Array.isArray(t) && !(t instanceof Date), ee = (t) => t.replace(/_/g, " ").replace(/\b\w/g, (e) => e.toUpperCase());
156
+ let k = class extends g {
157
157
  constructor() {
158
158
  super(...arguments), this.items = [], this.columns = {}, this.loading = !1, this.error = !1, this.errorMessage = "Couldn't load data. Try again.", this.emptyMessage = "No records yet.", this.showIndex = !0, this.indexOffset = 0, this.skeletonRows = 10, this.rowKey = "", this.clickable = !0, this.renderers = {}, this.visibleColumns = [], this.columnPicker = !0, this.page = 1, this.totalPages = 1, this.cursorMode = !1, this.hasNext = !1, this.hasPrev = !1, this.pickerOpen = !1, this.pickedColumns = null, this.draftColumns = [], this.pickAvail = [], this.pickSel = [], this.expanded = [], this.pickerPreviousFocus = null, this.onPickerKeydown = (t) => {
159
159
  t.key === "Escape" ? this.closePicker() : t.key === "Tab" && this.trapPickerFocus(t);
@@ -192,9 +192,9 @@ let k = class extends y {
192
192
  const e = {};
193
193
  for (const [i, a] of Object.entries(t))
194
194
  e[i] = ye(a) ? {
195
- label: te(i),
196
- fields: Object.fromEntries(Object.keys(a).map((s) => [s, te(s)]))
197
- } : te(i);
195
+ label: ee(i),
196
+ fields: Object.fromEntries(Object.keys(a).map((s) => [s, ee(s)]))
197
+ } : ee(i);
198
198
  return e;
199
199
  }
200
200
  /** Walk a dotted key through the spec; undefined when no such column exists. */
@@ -233,7 +233,7 @@ let k = class extends y {
233
233
  for (const a of t.split(".")) {
234
234
  const s = i == null ? void 0 : i[a];
235
235
  if (s === void 0) {
236
- e.push(te(a)), i = void 0;
236
+ e.push(ee(a)), i = void 0;
237
237
  continue;
238
238
  }
239
239
  e.push(typeof s == "string" ? s : s.label), i = typeof s == "string" ? void 0 : s.fields;
@@ -514,22 +514,22 @@ O([
514
514
  l({ type: Boolean, attribute: "has-prev" })
515
515
  ], k.prototype, "hasPrev", 2);
516
516
  O([
517
- $()
517
+ y()
518
518
  ], k.prototype, "pickerOpen", 2);
519
519
  O([
520
- $()
520
+ y()
521
521
  ], k.prototype, "pickedColumns", 2);
522
522
  O([
523
- $()
523
+ y()
524
524
  ], k.prototype, "draftColumns", 2);
525
525
  O([
526
- $()
526
+ y()
527
527
  ], k.prototype, "pickAvail", 2);
528
528
  O([
529
- $()
529
+ y()
530
530
  ], k.prototype, "pickSel", 2);
531
531
  O([
532
- $()
532
+ y()
533
533
  ], k.prototype, "expanded", 2);
534
534
  k = O([
535
535
  b("baht-table")
@@ -539,7 +539,7 @@ var Ds = Object.defineProperty, Fs = Object.getOwnPropertyDescriptor, ut = (t, e
539
539
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
540
540
  return a && s && Ds(e, i, s), s;
541
541
  };
542
- let it = class extends y {
542
+ let rt = class extends g {
543
543
  constructor() {
544
544
  super(...arguments), this.items = [], this.loading = !1, this.error = !1, this.errorMessage = "Couldn't load data. Try again.", this.emptyMessage = "Nothing here yet.", this.skeletonRows = 5, this.clickable = !0;
545
545
  }
@@ -587,34 +587,34 @@ let it = class extends y {
587
587
  };
588
588
  ut([
589
589
  l({ attribute: !1 })
590
- ], it.prototype, "items", 2);
590
+ ], rt.prototype, "items", 2);
591
591
  ut([
592
592
  l({ type: Boolean })
593
- ], it.prototype, "loading", 2);
593
+ ], rt.prototype, "loading", 2);
594
594
  ut([
595
595
  l({ type: Boolean })
596
- ], it.prototype, "error", 2);
596
+ ], rt.prototype, "error", 2);
597
597
  ut([
598
598
  l({ attribute: "error-message" })
599
- ], it.prototype, "errorMessage", 2);
599
+ ], rt.prototype, "errorMessage", 2);
600
600
  ut([
601
601
  l({ attribute: "empty-message" })
602
- ], it.prototype, "emptyMessage", 2);
602
+ ], rt.prototype, "emptyMessage", 2);
603
603
  ut([
604
604
  l({ type: Number, attribute: "skeleton-rows" })
605
- ], it.prototype, "skeletonRows", 2);
605
+ ], rt.prototype, "skeletonRows", 2);
606
606
  ut([
607
607
  l({ type: Boolean })
608
- ], it.prototype, "clickable", 2);
609
- it = ut([
608
+ ], rt.prototype, "clickable", 2);
609
+ rt = ut([
610
610
  b("baht-list")
611
- ], it);
612
- var Es = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, Wt = (t, e, i, a) => {
611
+ ], rt);
612
+ var Es = Object.defineProperty, Bs = Object.getOwnPropertyDescriptor, Jt = (t, e, i, a) => {
613
613
  for (var s = a > 1 ? void 0 : a ? Bs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
614
614
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
615
615
  return a && s && Es(e, i, s), s;
616
616
  };
617
- let kt = class extends y {
617
+ let Pt = class extends g {
618
618
  constructor() {
619
619
  super(...arguments), this.text = "", this.position = "top", this.dismissed = !1;
620
620
  }
@@ -633,7 +633,7 @@ let kt = class extends y {
633
633
  t ? (t.setAttribute("aria-describedby", this.tooltipId), this.anchorEl.removeAttribute("tabindex"), this.anchorEl.removeAttribute("aria-describedby")) : (this.anchorEl.setAttribute("tabindex", "0"), this.anchorEl.setAttribute("aria-describedby", this.tooltipId));
634
634
  }
635
635
  firstUpdated() {
636
- ne(this, this.anchorEl), this.wireDescribedBy(), setTimeout(() => this.isConnected && this.wireDescribedBy(), 0);
636
+ he(this, this.anchorEl), this.wireDescribedBy(), setTimeout(() => this.isConnected && this.wireDescribedBy(), 0);
637
637
  }
638
638
  onKeydown(t) {
639
639
  t.key === "Escape" && (this.dismissed = !0);
@@ -653,27 +653,27 @@ let kt = class extends y {
653
653
  </span>`;
654
654
  }
655
655
  };
656
- Wt([
656
+ Jt([
657
657
  l()
658
- ], kt.prototype, "text", 2);
659
- Wt([
658
+ ], Pt.prototype, "text", 2);
659
+ Jt([
660
660
  l()
661
- ], kt.prototype, "position", 2);
662
- Wt([
663
- Bt(".baht-tooltip-anchor")
664
- ], kt.prototype, "anchorEl", 2);
665
- Wt([
666
- $()
667
- ], kt.prototype, "dismissed", 2);
668
- kt = Wt([
661
+ ], Pt.prototype, "position", 2);
662
+ Jt([
663
+ It(".baht-tooltip-anchor")
664
+ ], Pt.prototype, "anchorEl", 2);
665
+ Jt([
666
+ y()
667
+ ], Pt.prototype, "dismissed", 2);
668
+ Pt = Jt([
669
669
  b("baht-tooltip")
670
- ], kt);
671
- var Is = Object.defineProperty, js = Object.getOwnPropertyDescriptor, It = (t, e, i, a) => {
672
- for (var s = a > 1 ? void 0 : a ? js(e, i) : e, r = t.length - 1, o; r >= 0; r--)
670
+ ], Pt);
671
+ var Is = Object.defineProperty, Ms = Object.getOwnPropertyDescriptor, Mt = (t, e, i, a) => {
672
+ for (var s = a > 1 ? void 0 : a ? Ms(e, i) : e, r = t.length - 1, o; r >= 0; r--)
673
673
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
674
674
  return a && s && Is(e, i, s), s;
675
675
  };
676
- let ft = class extends y {
676
+ let mt = class extends g {
677
677
  constructor() {
678
678
  super(...arguments), this.tone = "info", this.heading = "", this.message = "", this.dismissible = !1, this.dismissed = !1, this.generation = 0;
679
679
  }
@@ -701,30 +701,30 @@ let ft = class extends y {
701
701
  </div>`;
702
702
  }
703
703
  };
704
- It([
704
+ Mt([
705
705
  l()
706
- ], ft.prototype, "tone", 2);
707
- It([
706
+ ], mt.prototype, "tone", 2);
707
+ Mt([
708
708
  l()
709
- ], ft.prototype, "heading", 2);
710
- It([
709
+ ], mt.prototype, "heading", 2);
710
+ Mt([
711
711
  l()
712
- ], ft.prototype, "message", 2);
713
- It([
712
+ ], mt.prototype, "message", 2);
713
+ Mt([
714
714
  l({ type: Boolean })
715
- ], ft.prototype, "dismissible", 2);
716
- It([
717
- $()
718
- ], ft.prototype, "dismissed", 2);
719
- ft = It([
715
+ ], mt.prototype, "dismissible", 2);
716
+ Mt([
717
+ y()
718
+ ], mt.prototype, "dismissed", 2);
719
+ mt = Mt([
720
720
  b("baht-alert")
721
- ], ft);
722
- var Ss = Object.defineProperty, Ms = Object.getOwnPropertyDescriptor, jt = (t, e, i, a) => {
723
- for (var s = a > 1 ? void 0 : a ? Ms(e, i) : e, r = t.length - 1, o; r >= 0; r--)
721
+ ], mt);
722
+ var js = Object.defineProperty, Ss = Object.getOwnPropertyDescriptor, jt = (t, e, i, a) => {
723
+ for (var s = a > 1 ? void 0 : a ? Ss(e, i) : e, r = t.length - 1, o; r >= 0; r--)
724
724
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
725
- return a && s && Ss(e, i, s), s;
725
+ return a && s && js(e, i, s), s;
726
726
  };
727
- let mt = class extends y {
727
+ let vt = class extends g {
728
728
  constructor() {
729
729
  super(...arguments), this.value = 0, this.max = 5, this.readonly = !1, this.label = "Rating", this.hover = 0;
730
730
  }
@@ -779,28 +779,28 @@ let mt = class extends y {
779
779
  };
780
780
  jt([
781
781
  l({ type: Number })
782
- ], mt.prototype, "value", 2);
782
+ ], vt.prototype, "value", 2);
783
783
  jt([
784
784
  l({ type: Number })
785
- ], mt.prototype, "max", 2);
785
+ ], vt.prototype, "max", 2);
786
786
  jt([
787
787
  l({ type: Boolean })
788
- ], mt.prototype, "readonly", 2);
788
+ ], vt.prototype, "readonly", 2);
789
789
  jt([
790
790
  l()
791
- ], mt.prototype, "label", 2);
791
+ ], vt.prototype, "label", 2);
792
792
  jt([
793
- $()
794
- ], mt.prototype, "hover", 2);
795
- mt = jt([
793
+ y()
794
+ ], vt.prototype, "hover", 2);
795
+ vt = jt([
796
796
  b("baht-rating")
797
- ], mt);
797
+ ], vt);
798
798
  var Ts = Object.defineProperty, As = Object.getOwnPropertyDescriptor, bt = (t, e, i, a) => {
799
799
  for (var s = a > 1 ? void 0 : a ? As(e, i) : e, r = t.length - 1, o; r >= 0; r--)
800
800
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
801
801
  return a && s && Ts(e, i, s), s;
802
802
  };
803
- let rt = class extends y {
803
+ let ot = class extends g {
804
804
  constructor() {
805
805
  super(...arguments), this.value = 0, this.min = 0, this.max = 100, this.step = 1, this.label = "", this.disabled = !1, this.showValue = !0;
806
806
  }
@@ -821,7 +821,7 @@ let rt = class extends y {
821
821
  type="range"
822
822
  id=${this.inputId}
823
823
  aria-label=${this.label ? h : "Value"}
824
- .value=${ot(String(this.value))}
824
+ .value=${lt(String(this.value))}
825
825
  min=${this.min}
826
826
  max=${this.max}
827
827
  step=${this.step}
@@ -835,34 +835,34 @@ let rt = class extends y {
835
835
  };
836
836
  bt([
837
837
  l({ type: Number })
838
- ], rt.prototype, "value", 2);
838
+ ], ot.prototype, "value", 2);
839
839
  bt([
840
840
  l({ type: Number })
841
- ], rt.prototype, "min", 2);
841
+ ], ot.prototype, "min", 2);
842
842
  bt([
843
843
  l({ type: Number })
844
- ], rt.prototype, "max", 2);
844
+ ], ot.prototype, "max", 2);
845
845
  bt([
846
846
  l({ type: Number })
847
- ], rt.prototype, "step", 2);
847
+ ], ot.prototype, "step", 2);
848
848
  bt([
849
849
  l()
850
- ], rt.prototype, "label", 2);
850
+ ], ot.prototype, "label", 2);
851
851
  bt([
852
852
  l({ type: Boolean })
853
- ], rt.prototype, "disabled", 2);
853
+ ], ot.prototype, "disabled", 2);
854
854
  bt([
855
855
  l({ type: Boolean, attribute: "show-value" })
856
- ], rt.prototype, "showValue", 2);
857
- rt = bt([
856
+ ], ot.prototype, "showValue", 2);
857
+ ot = bt([
858
858
  b("baht-range")
859
- ], rt);
859
+ ], ot);
860
860
  var Ls = Object.defineProperty, Ns = Object.getOwnPropertyDescriptor, St = (t, e, i, a) => {
861
861
  for (var s = a > 1 ? void 0 : a ? Ns(e, i) : e, r = t.length - 1, o; r >= 0; r--)
862
862
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
863
863
  return a && s && Ls(e, i, s), s;
864
864
  };
865
- let vt = class extends y {
865
+ let $t = class extends g {
866
866
  constructor() {
867
867
  super(...arguments), this.length = 6, this.value = "", this.disabled = !1, this.mode = "numeric", this.label = "One-time code", this._chars = [], this._lastValue = "", this._wasFull = !1;
868
868
  }
@@ -948,28 +948,28 @@ let vt = class extends y {
948
948
  };
949
949
  St([
950
950
  l({ type: Number })
951
- ], vt.prototype, "length", 2);
951
+ ], $t.prototype, "length", 2);
952
952
  St([
953
953
  l()
954
- ], vt.prototype, "value", 2);
954
+ ], $t.prototype, "value", 2);
955
955
  St([
956
956
  l({ type: Boolean })
957
- ], vt.prototype, "disabled", 2);
957
+ ], $t.prototype, "disabled", 2);
958
958
  St([
959
959
  l()
960
- ], vt.prototype, "mode", 2);
960
+ ], $t.prototype, "mode", 2);
961
961
  St([
962
962
  l()
963
- ], vt.prototype, "label", 2);
964
- vt = St([
963
+ ], $t.prototype, "label", 2);
964
+ $t = St([
965
965
  b("baht-otp")
966
- ], vt);
967
- var qs = Object.defineProperty, Rs = Object.getOwnPropertyDescriptor, Mt = (t, e, i, a) => {
966
+ ], $t);
967
+ var qs = Object.defineProperty, Rs = Object.getOwnPropertyDescriptor, Tt = (t, e, i, a) => {
968
968
  for (var s = a > 1 ? void 0 : a ? Rs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
969
969
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
970
970
  return a && s && qs(e, i, s), s;
971
971
  };
972
- let $t = class extends y {
972
+ let yt = class extends g {
973
973
  constructor() {
974
974
  super(...arguments), this.options = [], this.selected = [], this.multiple = !0, this.disabled = !1, this.label = "Filters";
975
975
  }
@@ -993,30 +993,30 @@ let $t = class extends y {
993
993
  </div>`;
994
994
  }
995
995
  };
996
- Mt([
996
+ Tt([
997
997
  l({ attribute: !1 })
998
- ], $t.prototype, "options", 2);
999
- Mt([
998
+ ], yt.prototype, "options", 2);
999
+ Tt([
1000
1000
  l({ attribute: !1 })
1001
- ], $t.prototype, "selected", 2);
1002
- Mt([
1001
+ ], yt.prototype, "selected", 2);
1002
+ Tt([
1003
1003
  l({ type: Boolean })
1004
- ], $t.prototype, "multiple", 2);
1005
- Mt([
1004
+ ], yt.prototype, "multiple", 2);
1005
+ Tt([
1006
1006
  l({ type: Boolean })
1007
- ], $t.prototype, "disabled", 2);
1008
- Mt([
1007
+ ], yt.prototype, "disabled", 2);
1008
+ Tt([
1009
1009
  l()
1010
- ], $t.prototype, "label", 2);
1011
- $t = Mt([
1010
+ ], yt.prototype, "label", 2);
1011
+ yt = Tt([
1012
1012
  b("baht-filter")
1013
- ], $t);
1014
- var zs = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, ce = (t, e, i, a) => {
1013
+ ], yt);
1014
+ var zs = Object.defineProperty, Vs = Object.getOwnPropertyDescriptor, pe = (t, e, i, a) => {
1015
1015
  for (var s = a > 1 ? void 0 : a ? Vs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1016
1016
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
1017
1017
  return a && s && zs(e, i, s), s;
1018
1018
  };
1019
- let Vt = class extends y {
1019
+ let Kt = class extends g {
1020
1020
  constructor() {
1021
1021
  super(...arguments), this.variant = "rect", this.width = "100%", this.height = "";
1022
1022
  }
@@ -1029,24 +1029,24 @@ let Vt = class extends y {
1029
1029
  ></span>`;
1030
1030
  }
1031
1031
  };
1032
- ce([
1032
+ pe([
1033
1033
  l()
1034
- ], Vt.prototype, "variant", 2);
1035
- ce([
1034
+ ], Kt.prototype, "variant", 2);
1035
+ pe([
1036
1036
  l()
1037
- ], Vt.prototype, "width", 2);
1038
- ce([
1037
+ ], Kt.prototype, "width", 2);
1038
+ pe([
1039
1039
  l()
1040
- ], Vt.prototype, "height", 2);
1041
- Vt = ce([
1040
+ ], Kt.prototype, "height", 2);
1041
+ Kt = pe([
1042
1042
  b("baht-skeleton")
1043
- ], Vt);
1044
- var Ks = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, Jt = (t, e, i, a) => {
1043
+ ], Kt);
1044
+ var Ks = Object.defineProperty, Us = Object.getOwnPropertyDescriptor, Yt = (t, e, i, a) => {
1045
1045
  for (var s = a > 1 ? void 0 : a ? Us(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1046
1046
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
1047
1047
  return a && s && Ks(e, i, s), s;
1048
1048
  };
1049
- let Pt = class extends y {
1049
+ let Ot = class extends g {
1050
1050
  constructor() {
1051
1051
  super(...arguments), this.value = null, this.tone = "primary", this.showLabel = !1, this.label = "Progress";
1052
1052
  }
@@ -1067,27 +1067,27 @@ let Pt = class extends y {
1067
1067
  </div>`;
1068
1068
  }
1069
1069
  };
1070
- Jt([
1070
+ Yt([
1071
1071
  l({ type: Number })
1072
- ], Pt.prototype, "value", 2);
1073
- Jt([
1072
+ ], Ot.prototype, "value", 2);
1073
+ Yt([
1074
1074
  l()
1075
- ], Pt.prototype, "tone", 2);
1076
- Jt([
1075
+ ], Ot.prototype, "tone", 2);
1076
+ Yt([
1077
1077
  l({ type: Boolean, attribute: "show-label" })
1078
- ], Pt.prototype, "showLabel", 2);
1079
- Jt([
1078
+ ], Ot.prototype, "showLabel", 2);
1079
+ Yt([
1080
1080
  l()
1081
- ], Pt.prototype, "label", 2);
1082
- Pt = Jt([
1081
+ ], Ot.prototype, "label", 2);
1082
+ Ot = Yt([
1083
1083
  b("baht-progress")
1084
- ], Pt);
1085
- var Hs = Object.defineProperty, Gs = Object.getOwnPropertyDescriptor, Se = (t, e, i, a) => {
1084
+ ], Ot);
1085
+ var Hs = Object.defineProperty, Gs = Object.getOwnPropertyDescriptor, je = (t, e, i, a) => {
1086
1086
  for (var s = a > 1 ? void 0 : a ? Gs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1087
1087
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
1088
1088
  return a && s && Hs(e, i, s), s;
1089
1089
  };
1090
- let ie = class extends y {
1090
+ let re = class extends g {
1091
1091
  constructor() {
1092
1092
  super(...arguments), this.size = "md", this.label = "Loading";
1093
1093
  }
@@ -1096,26 +1096,26 @@ let ie = class extends y {
1096
1096
  return n`<span class="baht-spinner${t}" role="status" aria-label=${this.label}></span>`;
1097
1097
  }
1098
1098
  };
1099
- Se([
1099
+ je([
1100
1100
  l()
1101
- ], ie.prototype, "size", 2);
1102
- Se([
1101
+ ], re.prototype, "size", 2);
1102
+ je([
1103
1103
  l()
1104
- ], ie.prototype, "label", 2);
1105
- ie = Se([
1104
+ ], re.prototype, "label", 2);
1105
+ re = je([
1106
1106
  b("baht-spinner")
1107
- ], ie);
1108
- var Ws = Object.defineProperty, Js = Object.getOwnPropertyDescriptor, Yt = (t, e, i, a) => {
1107
+ ], re);
1108
+ var Ws = Object.defineProperty, Js = Object.getOwnPropertyDescriptor, Xt = (t, e, i, a) => {
1109
1109
  for (var s = a > 1 ? void 0 : a ? Js(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1110
1110
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
1111
1111
  return a && s && Ws(e, i, s), s;
1112
1112
  };
1113
- let Ot = class extends y {
1113
+ let Ct = class extends g {
1114
1114
  constructor() {
1115
1115
  super(...arguments), this.heading = "", this.subtitle = "", this.hero = !1;
1116
1116
  }
1117
1117
  firstUpdated() {
1118
- ne(this, this.bodyEl);
1118
+ he(this, this.bodyEl);
1119
1119
  }
1120
1120
  render() {
1121
1121
  return n`<div class="baht-card${this.hero ? " baht-card--hero" : ""}">
@@ -1125,32 +1125,32 @@ let Ot = class extends y {
1125
1125
  </div>`;
1126
1126
  }
1127
1127
  };
1128
- Yt([
1128
+ Xt([
1129
1129
  l()
1130
- ], Ot.prototype, "heading", 2);
1131
- Yt([
1130
+ ], Ct.prototype, "heading", 2);
1131
+ Xt([
1132
1132
  l()
1133
- ], Ot.prototype, "subtitle", 2);
1134
- Yt([
1133
+ ], Ct.prototype, "subtitle", 2);
1134
+ Xt([
1135
1135
  l({ type: Boolean })
1136
- ], Ot.prototype, "hero", 2);
1137
- Yt([
1138
- Bt(".baht-card-body")
1139
- ], Ot.prototype, "bodyEl", 2);
1140
- Ot = Yt([
1136
+ ], Ct.prototype, "hero", 2);
1137
+ Xt([
1138
+ It(".baht-card-body")
1139
+ ], Ct.prototype, "bodyEl", 2);
1140
+ Ct = Xt([
1141
1141
  b("baht-card")
1142
- ], Ot);
1143
- var Ys = Object.defineProperty, Xs = Object.getOwnPropertyDescriptor, pe = (t, e, i, a) => {
1142
+ ], Ct);
1143
+ var Ys = Object.defineProperty, Xs = Object.getOwnPropertyDescriptor, de = (t, e, i, a) => {
1144
1144
  for (var s = a > 1 ? void 0 : a ? Xs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1145
1145
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
1146
1146
  return a && s && Ys(e, i, s), s;
1147
1147
  };
1148
- let Kt = class extends y {
1148
+ let Ut = class extends g {
1149
1149
  constructor() {
1150
1150
  super(...arguments), this.legend = "", this.disabled = !1;
1151
1151
  }
1152
1152
  firstUpdated() {
1153
- ne(this, this.bodyEl);
1153
+ he(this, this.bodyEl);
1154
1154
  }
1155
1155
  render() {
1156
1156
  return n`<fieldset class="baht-fieldset" ?disabled=${this.disabled}>
@@ -1159,24 +1159,24 @@ let Kt = class extends y {
1159
1159
  </fieldset>`;
1160
1160
  }
1161
1161
  };
1162
- pe([
1162
+ de([
1163
1163
  l()
1164
- ], Kt.prototype, "legend", 2);
1165
- pe([
1164
+ ], Ut.prototype, "legend", 2);
1165
+ de([
1166
1166
  l({ type: Boolean })
1167
- ], Kt.prototype, "disabled", 2);
1168
- pe([
1169
- Bt(".baht-fieldset-body")
1170
- ], Kt.prototype, "bodyEl", 2);
1171
- Kt = pe([
1167
+ ], Ut.prototype, "disabled", 2);
1168
+ de([
1169
+ It(".baht-fieldset-body")
1170
+ ], Ut.prototype, "bodyEl", 2);
1171
+ Ut = de([
1172
1172
  b("baht-fieldset")
1173
- ], Kt);
1173
+ ], Ut);
1174
1174
  var Zs = Object.defineProperty, Qs = Object.getOwnPropertyDescriptor, ls = (t, e, i, a) => {
1175
1175
  for (var s = a > 1 ? void 0 : a ? Qs(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1176
1176
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
1177
1177
  return a && s && Zs(e, i, s), s;
1178
1178
  };
1179
- let De = class extends y {
1179
+ let De = class extends g {
1180
1180
  constructor() {
1181
1181
  super(...arguments), this.items = [];
1182
1182
  }
@@ -1206,12 +1206,12 @@ ls([
1206
1206
  De = ls([
1207
1207
  b("baht-timeline")
1208
1208
  ], De);
1209
- var ta = Object.defineProperty, ea = Object.getOwnPropertyDescriptor, de = (t, e, i, a) => {
1209
+ var ta = Object.defineProperty, ea = Object.getOwnPropertyDescriptor, ue = (t, e, i, a) => {
1210
1210
  for (var s = a > 1 ? void 0 : a ? ea(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1211
1211
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
1212
1212
  return a && s && ta(e, i, s), s;
1213
1213
  };
1214
- let Ct = class extends y {
1214
+ let Dt = class extends g {
1215
1215
  constructor() {
1216
1216
  super(...arguments), this.items = [], this.multiple = !1, this.openSet = /* @__PURE__ */ new Set(), this.itemsFingerprint = "";
1217
1217
  }
@@ -1220,7 +1220,7 @@ let Ct = class extends y {
1220
1220
  }
1221
1221
  willUpdate(t) {
1222
1222
  if (t.has("items")) {
1223
- const e = Ct.fingerprint(this.items);
1223
+ const e = Dt.fingerprint(this.items);
1224
1224
  e !== this.itemsFingerprint && (this.itemsFingerprint = e, this.openSet = new Set(this.items.flatMap((i, a) => i.open ? [a] : [])));
1225
1225
  }
1226
1226
  }
@@ -1252,24 +1252,24 @@ let Ct = class extends y {
1252
1252
  </div>`;
1253
1253
  }
1254
1254
  };
1255
- de([
1255
+ ue([
1256
1256
  l({ attribute: !1 })
1257
- ], Ct.prototype, "items", 2);
1258
- de([
1257
+ ], Dt.prototype, "items", 2);
1258
+ ue([
1259
1259
  l({ type: Boolean })
1260
- ], Ct.prototype, "multiple", 2);
1261
- de([
1262
- $()
1263
- ], Ct.prototype, "openSet", 2);
1264
- Ct = de([
1260
+ ], Dt.prototype, "multiple", 2);
1261
+ ue([
1262
+ y()
1263
+ ], Dt.prototype, "openSet", 2);
1264
+ Dt = ue([
1265
1265
  b("baht-accordion")
1266
- ], Ct);
1267
- var sa = Object.defineProperty, aa = Object.getOwnPropertyDescriptor, Xt = (t, e, i, a) => {
1266
+ ], Dt);
1267
+ var sa = Object.defineProperty, aa = Object.getOwnPropertyDescriptor, Zt = (t, e, i, a) => {
1268
1268
  for (var s = a > 1 ? void 0 : a ? aa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1269
1269
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
1270
1270
  return a && s && sa(e, i, s), s;
1271
1271
  };
1272
- let Dt = class extends y {
1272
+ let Ft = class extends g {
1273
1273
  constructor() {
1274
1274
  super(...arguments), this.href = "", this.label = "", this.external = !1, this.externalHint = "opens in new tab";
1275
1275
  }
@@ -1282,27 +1282,27 @@ let Dt = class extends y {
1282
1282
  >${this.label}${this.external ? n` <span class="baht-link-external" aria-hidden="true">↗</span><span class="baht-visually-hidden"> (${this.externalHint})</span>` : h}</a>`;
1283
1283
  }
1284
1284
  };
1285
- Xt([
1285
+ Zt([
1286
1286
  l()
1287
- ], Dt.prototype, "href", 2);
1288
- Xt([
1287
+ ], Ft.prototype, "href", 2);
1288
+ Zt([
1289
1289
  l()
1290
- ], Dt.prototype, "label", 2);
1291
- Xt([
1290
+ ], Ft.prototype, "label", 2);
1291
+ Zt([
1292
1292
  l({ type: Boolean })
1293
- ], Dt.prototype, "external", 2);
1294
- Xt([
1293
+ ], Ft.prototype, "external", 2);
1294
+ Zt([
1295
1295
  l({ attribute: "external-hint" })
1296
- ], Dt.prototype, "externalHint", 2);
1297
- Dt = Xt([
1296
+ ], Ft.prototype, "externalHint", 2);
1297
+ Ft = Zt([
1298
1298
  b("baht-link")
1299
- ], Dt);
1300
- var ia = Object.defineProperty, ra = Object.getOwnPropertyDescriptor, Me = (t, e, i, a) => {
1299
+ ], Ft);
1300
+ var ia = Object.defineProperty, ra = Object.getOwnPropertyDescriptor, Se = (t, e, i, a) => {
1301
1301
  for (var s = a > 1 ? void 0 : a ? ra(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1302
1302
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
1303
1303
  return a && s && ia(e, i, s), s;
1304
1304
  };
1305
- let re = class extends y {
1305
+ let oe = class extends g {
1306
1306
  constructor() {
1307
1307
  super(...arguments), this.items = [], this.separator = "›";
1308
1308
  }
@@ -1327,30 +1327,30 @@ let re = class extends y {
1327
1327
  </nav>`;
1328
1328
  }
1329
1329
  };
1330
- Me([
1330
+ Se([
1331
1331
  l({ attribute: !1 })
1332
- ], re.prototype, "items", 2);
1333
- Me([
1332
+ ], oe.prototype, "items", 2);
1333
+ Se([
1334
1334
  l()
1335
- ], re.prototype, "separator", 2);
1336
- re = Me([
1335
+ ], oe.prototype, "separator", 2);
1336
+ oe = Se([
1337
1337
  b("baht-breadcrumbs")
1338
- ], re);
1338
+ ], oe);
1339
1339
  var oa = Object.getOwnPropertyDescriptor, la = (t, e, i, a) => {
1340
1340
  for (var s = a > 1 ? void 0 : a ? oa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1341
1341
  (o = t[r]) && (s = o(s) || s);
1342
1342
  return s;
1343
1343
  };
1344
- let Ne = class extends J {
1344
+ let Ne = class extends Y {
1345
1345
  renderControl() {
1346
1346
  return n`<input
1347
1347
  class="baht-control baht-control--text"
1348
1348
  id=${this.controlId}
1349
1349
  type=${this.field.type === "email" ? "email" : this.field.type === "password" ? "password" : "text"}
1350
- .value=${ot(this.shownValue == null ? "" : String(this.shownValue))}
1351
- placeholder=${L(this.field.placeholder)}
1352
- maxlength=${L(this.field.max_length)}
1353
- autocomplete=${L(this.field.autocomplete)}
1350
+ .value=${lt(this.shownValue == null ? "" : String(this.shownValue))}
1351
+ placeholder=${N(this.field.placeholder)}
1352
+ maxlength=${N(this.field.max_length)}
1353
+ autocomplete=${N(this.field.autocomplete)}
1354
1354
  ?disabled=${this.disabled}
1355
1355
  ?readonly=${this.readonly}
1356
1356
  ?required=${this.required}
@@ -1368,16 +1368,16 @@ var na = Object.getOwnPropertyDescriptor, ha = (t, e, i, a) => {
1368
1368
  (o = t[r]) && (s = o(s) || s);
1369
1369
  return s;
1370
1370
  };
1371
- let qe = class extends J {
1371
+ let qe = class extends Y {
1372
1372
  renderControl() {
1373
1373
  return n`<textarea
1374
1374
  class="baht-control baht-control--textarea"
1375
1375
  id=${this.controlId}
1376
- .value=${ot(this.shownValue == null ? "" : String(this.shownValue))}
1377
- placeholder=${L(this.field.placeholder)}
1378
- maxlength=${L(this.field.max_length)}
1376
+ .value=${lt(this.shownValue == null ? "" : String(this.shownValue))}
1377
+ placeholder=${N(this.field.placeholder)}
1378
+ maxlength=${N(this.field.max_length)}
1379
1379
  rows=${this.field.rows ?? 3}
1380
- autocomplete=${L(this.field.autocomplete)}
1380
+ autocomplete=${N(this.field.autocomplete)}
1381
1381
  ?disabled=${this.disabled}
1382
1382
  ?readonly=${this.readonly}
1383
1383
  ?required=${this.required}
@@ -1395,17 +1395,17 @@ var ca = Object.getOwnPropertyDescriptor, pa = (t, e, i, a) => {
1395
1395
  (o = t[r]) && (s = o(s) || s);
1396
1396
  return s;
1397
1397
  };
1398
- let Re = class extends J {
1398
+ let Re = class extends Y {
1399
1399
  renderControl() {
1400
1400
  return n`<input
1401
1401
  class="baht-control baht-control--number"
1402
1402
  id=${this.controlId}
1403
1403
  type="number"
1404
- .value=${ot(this.shownValue == null ? "" : String(this.shownValue))}
1405
- placeholder=${L(this.field.placeholder)}
1406
- min=${L(this.field.min)}
1407
- max=${L(this.field.max)}
1408
- step=${L(this.field.step)}
1404
+ .value=${lt(this.shownValue == null ? "" : String(this.shownValue))}
1405
+ placeholder=${N(this.field.placeholder)}
1406
+ min=${N(this.field.min)}
1407
+ max=${N(this.field.max)}
1408
+ step=${N(this.field.step)}
1409
1409
  ?disabled=${this.disabled}
1410
1410
  ?readonly=${this.readonly}
1411
1411
  ?required=${this.required}
@@ -1427,7 +1427,7 @@ var da = Object.defineProperty, ua = Object.getOwnPropertyDescriptor, Te = (t, e
1427
1427
  return a && s && da(e, i, s), s;
1428
1428
  };
1429
1429
  const ba = 500;
1430
- let oe = class extends J {
1430
+ let le = class extends Y {
1431
1431
  constructor() {
1432
1432
  super(...arguments), this.open = !1, this.active = 0, this.typeBuffer = "", this.onDocMousedown = (t) => {
1433
1433
  this.contains(t.target) || this.close();
@@ -1585,20 +1585,20 @@ let oe = class extends J {
1585
1585
  }
1586
1586
  };
1587
1587
  Te([
1588
- $()
1589
- ], oe.prototype, "open", 2);
1588
+ y()
1589
+ ], le.prototype, "open", 2);
1590
1590
  Te([
1591
- $()
1592
- ], oe.prototype, "active", 2);
1593
- oe = Te([
1591
+ y()
1592
+ ], le.prototype, "active", 2);
1593
+ le = Te([
1594
1594
  b("baht-select")
1595
- ], oe);
1595
+ ], le);
1596
1596
  var fa = Object.getOwnPropertyDescriptor, ma = (t, e, i, a) => {
1597
1597
  for (var s = a > 1 ? void 0 : a ? fa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1598
1598
  (o = t[r]) && (s = o(s) || s);
1599
1599
  return s;
1600
1600
  };
1601
- let ze = class extends J {
1601
+ let ze = class extends Y {
1602
1602
  get selected() {
1603
1603
  return Array.isArray(this.value) ? this.value : [];
1604
1604
  }
@@ -1618,7 +1618,7 @@ let ze = class extends J {
1618
1618
  <input
1619
1619
  type="checkbox"
1620
1620
  value=${t.key}
1621
- .checked=${ot(this.selected.includes(t.key))}
1621
+ .checked=${lt(this.selected.includes(t.key))}
1622
1622
  ?disabled=${this.disabled || this.readonly}
1623
1623
  @change=${(e) => this.toggle(t.key, e.target.checked)}
1624
1624
  />
@@ -1636,7 +1636,7 @@ var va = Object.getOwnPropertyDescriptor, $a = (t, e, i, a) => {
1636
1636
  (o = t[r]) && (s = o(s) || s);
1637
1637
  return s;
1638
1638
  };
1639
- let Ve = class extends J {
1639
+ let Ve = class extends Y {
1640
1640
  /** Label sits beside the box, so suppress the block label. */
1641
1641
  renderLabel() {
1642
1642
  return h;
@@ -1646,7 +1646,7 @@ let Ve = class extends J {
1646
1646
  <input
1647
1647
  type="checkbox"
1648
1648
  id=${this.controlId}
1649
- .checked=${ot(this.value === !0)}
1649
+ .checked=${lt(this.value === !0)}
1650
1650
  ?disabled=${this.disabled || this.readonly}
1651
1651
  ?required=${this.required}
1652
1652
  aria-invalid=${this.invalid}
@@ -1667,7 +1667,7 @@ var ya = Object.getOwnPropertyDescriptor, ga = (t, e, i, a) => {
1667
1667
  (o = t[r]) && (s = o(s) || s);
1668
1668
  return s;
1669
1669
  };
1670
- let Ke = class extends J {
1670
+ let Ke = class extends Y {
1671
1671
  renderControl() {
1672
1672
  return n`<div
1673
1673
  class="baht-control baht-control--radio"
@@ -1683,7 +1683,7 @@ let Ke = class extends J {
1683
1683
  type="radio"
1684
1684
  name=${this.controlId}
1685
1685
  value=${t.key}
1686
- .checked=${ot(this.value === t.key)}
1686
+ .checked=${lt(this.value === t.key)}
1687
1687
  ?disabled=${this.disabled || this.readonly}
1688
1688
  @change=${() => this.emitInput(t.key)}
1689
1689
  />
@@ -1701,7 +1701,7 @@ var wa = Object.getOwnPropertyDescriptor, xa = (t, e, i, a) => {
1701
1701
  (o = t[r]) && (s = o(s) || s);
1702
1702
  return s;
1703
1703
  };
1704
- let Ue = class extends J {
1704
+ let Ue = class extends Y {
1705
1705
  renderLabel() {
1706
1706
  return h;
1707
1707
  }
@@ -1712,7 +1712,7 @@ let Ue = class extends J {
1712
1712
  role="switch"
1713
1713
  id=${this.controlId}
1714
1714
  aria-checked=${this.value === !0 ? "true" : "false"}
1715
- .checked=${ot(this.value === !0)}
1715
+ .checked=${lt(this.value === !0)}
1716
1716
  ?disabled=${this.disabled || this.readonly}
1717
1717
  ?required=${this.required}
1718
1718
  aria-invalid=${this.invalid}
@@ -1734,7 +1734,7 @@ var _a = Object.getOwnPropertyDescriptor, ka = (t, e, i, a) => {
1734
1734
  (o = t[r]) && (s = o(s) || s);
1735
1735
  return s;
1736
1736
  };
1737
- let He = class extends J {
1737
+ let He = class extends Y {
1738
1738
  constructor() {
1739
1739
  super(...arguments), this.lastEmitted = null;
1740
1740
  }
@@ -1744,7 +1744,7 @@ let He = class extends J {
1744
1744
  id=${this.controlId}
1745
1745
  type="text"
1746
1746
  autocomplete="off"
1747
- placeholder=${L(this.field.placeholder)}
1747
+ placeholder=${N(this.field.placeholder)}
1748
1748
  ?disabled=${this.disabled}
1749
1749
  ?readonly=${this.readonly}
1750
1750
  ?required=${this.required}
@@ -1781,7 +1781,7 @@ let He = class extends J {
1781
1781
  We(this.fp.selectedDates, t) || (t.length === 0 ? this.fp.clear(!1) : this.fp.setDate(t, !1));
1782
1782
  }
1783
1783
  options() {
1784
- const t = this.field, e = $e(t), i = Lt(t.min), a = Lt(t.max);
1784
+ const t = this.field, e = $e(t), i = Nt(t.min), a = Nt(t.max);
1785
1785
  return {
1786
1786
  static: !0,
1787
1787
  disableMobile: !0,
@@ -1824,15 +1824,15 @@ let He = class extends J {
1824
1824
  t && (this.todayBtn && (this.todayBtn.disabled = !this.todayAllowed()), this.clearBtn && (this.clearBtn.disabled = t.selectedDates.length === 0));
1825
1825
  }
1826
1826
  todayAllowed() {
1827
- const t = _t(/* @__PURE__ */ new Date()), e = Lt(this.field.min), i = Lt(this.field.max);
1828
- if (e && t < _t(e) || i && t > _t(i)) return !1;
1827
+ const t = kt(/* @__PURE__ */ new Date()), e = Nt(this.field.min), i = Nt(this.field.max);
1828
+ if (e && t < kt(e) || i && t > kt(i)) return !1;
1829
1829
  for (const a of Je(this.field) ?? [])
1830
1830
  if (a instanceof Date) {
1831
1831
  if (Ge(a, t)) return !1;
1832
1832
  } else if (typeof a == "function") {
1833
1833
  if (a(t)) return !1;
1834
1834
  } else if (typeof a == "object" && "from" in a) {
1835
- const s = _t(new Date(a.from)), r = _t(new Date(a.to));
1835
+ const s = kt(new Date(a.from)), r = kt(new Date(a.to));
1836
1836
  if (t >= s && t <= r) return !1;
1837
1837
  }
1838
1838
  return !0;
@@ -1840,7 +1840,7 @@ let He = class extends J {
1840
1840
  pickToday() {
1841
1841
  const t = this.fp;
1842
1842
  if (!t || !this.todayAllowed()) return;
1843
- const e = _t(/* @__PURE__ */ new Date());
1843
+ const e = kt(/* @__PURE__ */ new Date());
1844
1844
  switch ($e(this.field)) {
1845
1845
  case "range":
1846
1846
  t.setDate([e, e], !0);
@@ -1860,11 +1860,11 @@ let He = class extends J {
1860
1860
  }
1861
1861
  /** Host value (any mode) -> the Date list flatpickr works with. */
1862
1862
  datesOf(t) {
1863
- return ds(t).map(Lt).filter((e) => e !== null);
1863
+ return ds(t).map(Nt).filter((e) => e !== null);
1864
1864
  }
1865
1865
  /** flatpickr's selection -> the value shape of the field's mode. */
1866
1866
  toValue(t) {
1867
- const e = t.map(Rt);
1867
+ const e = t.map(zt);
1868
1868
  switch ($e(this.field)) {
1869
1869
  case "range":
1870
1870
  return e.length === 2 ? [e[0], e[1]] : null;
@@ -1878,14 +1878,14 @@ let He = class extends J {
1878
1878
  He = ka([
1879
1879
  b("baht-datepicker")
1880
1880
  ], He);
1881
- function _t(t) {
1881
+ function kt(t) {
1882
1882
  return new Date(t.getFullYear(), t.getMonth(), t.getDate());
1883
1883
  }
1884
1884
  function Ge(t, e) {
1885
- return Rt(t) === Rt(e);
1885
+ return zt(t) === zt(e);
1886
1886
  }
1887
1887
  function We(t, e) {
1888
- return t.length !== e.length ? !1 : t.every((i, a) => Rt(i) === Rt(e[a]));
1888
+ return t.length !== e.length ? !1 : t.every((i, a) => zt(i) === zt(e[a]));
1889
1889
  }
1890
1890
  function Je(t) {
1891
1891
  const e = [];
@@ -1896,7 +1896,7 @@ function Je(t) {
1896
1896
  const i = t.disabled_weekdays;
1897
1897
  return i != null && i.length && e.push((a) => i.includes(a.getDay())), e;
1898
1898
  }
1899
- var Pa = Object.defineProperty, Oa = Object.getOwnPropertyDescriptor, Zt = (t, e, i, a) => {
1899
+ var Pa = Object.defineProperty, Oa = Object.getOwnPropertyDescriptor, Qt = (t, e, i, a) => {
1900
1900
  for (var s = a > 1 ? void 0 : a ? Oa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
1901
1901
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
1902
1902
  return a && s && Pa(e, i, s), s;
@@ -1907,7 +1907,7 @@ function Ye(t) {
1907
1907
  function ge(t) {
1908
1908
  return t >= 1024 * 1024 ? `${(t / 1024 / 1024).toFixed(1)} MB` : t >= 1024 ? `${Math.round(t / 1024)} KB` : `${t} B`;
1909
1909
  }
1910
- let Ft = class extends J {
1910
+ let Et = class extends Y {
1911
1911
  constructor() {
1912
1912
  super(...arguments), this.uploadingCount = 0, this.uploadError = null, this.rejectedNames = [];
1913
1913
  }
@@ -1973,7 +1973,7 @@ let Ft = class extends J {
1973
1973
  class="baht-control baht-control--file baht-dropzone-input"
1974
1974
  id=${this.controlId}
1975
1975
  type="file"
1976
- accept=${L(this.field.accept)}
1976
+ accept=${N(this.field.accept)}
1977
1977
  ?multiple=${this.field.multiple}
1978
1978
  ?disabled=${t}
1979
1979
  ?required=${this.required}
@@ -1981,7 +1981,7 @@ let Ft = class extends J {
1981
1981
  aria-describedby=${this.describedBy}
1982
1982
  @change=${(a) => this.onPick(a)}
1983
1983
  />
1984
- <span class="baht-dropzone-icon" aria-hidden="true">${H("upload")}</span>
1984
+ <span class="baht-dropzone-icon" aria-hidden="true">${W("upload")}</span>
1985
1985
  <span class="baht-dropzone-text">
1986
1986
  <label class="baht-dropzone-action" for=${this.controlId}
1987
1987
  >${this.field.multiple ? m("chooseFiles") : m("chooseFile")}</label
@@ -2014,28 +2014,28 @@ let Ft = class extends J {
2014
2014
  title=${m("removeFile")}
2015
2015
  @click=${() => this.emitRefs(this.refs.filter((s) => s !== a))}
2016
2016
  >
2017
- ${H("close")}
2017
+ ${W("close")}
2018
2018
  </button>`}
2019
2019
  </span>`
2020
2020
  )}`;
2021
2021
  }
2022
2022
  };
2023
- Zt([
2023
+ Qt([
2024
2024
  l({ attribute: !1 })
2025
- ], Ft.prototype, "uploader", 2);
2026
- Zt([
2027
- $()
2028
- ], Ft.prototype, "uploadingCount", 2);
2029
- Zt([
2030
- $()
2031
- ], Ft.prototype, "uploadError", 2);
2032
- Zt([
2033
- $()
2034
- ], Ft.prototype, "rejectedNames", 2);
2035
- Ft = Zt([
2025
+ ], Et.prototype, "uploader", 2);
2026
+ Qt([
2027
+ y()
2028
+ ], Et.prototype, "uploadingCount", 2);
2029
+ Qt([
2030
+ y()
2031
+ ], Et.prototype, "uploadError", 2);
2032
+ Qt([
2033
+ y()
2034
+ ], Et.prototype, "rejectedNames", 2);
2035
+ Et = Qt([
2036
2036
  b("baht-file")
2037
- ], Ft);
2038
- var Ca = Object.defineProperty, Da = Object.getOwnPropertyDescriptor, B = (t, e, i, a) => {
2037
+ ], Et);
2038
+ var Ca = Object.defineProperty, Da = Object.getOwnPropertyDescriptor, I = (t, e, i, a) => {
2039
2039
  for (var s = a > 1 ? void 0 : a ? Da(e, i) : e, r = t.length - 1, o; r >= 0; r--)
2040
2040
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
2041
2041
  return a && s && Ca(e, i, s), s;
@@ -2068,7 +2068,7 @@ function Ba(t) {
2068
2068
  function we(t) {
2069
2069
  return t >= 1024 * 1024 ? `${(t / 1024 / 1024).toFixed(1)} MB` : t >= 1024 ? `${Math.round(t / 1024)} KB` : `${t} B`;
2070
2070
  }
2071
- let D = class extends y {
2071
+ let F = class extends g {
2072
2072
  constructor() {
2073
2073
  super(...arguments), this.url = "", this.method = "POST", this.fieldName = "file", this.responseKey = "url", this.headers = {}, this.withCredentials = !1, this.value = null, this.label = "", this.hint = "", this.multiple = !1, this.disabled = !1, this.required = !1, this.error = null, this.pending = [], this.rejectedNames = [], this.dragging = !1, this.known = /* @__PURE__ */ new Map(), this.seq = 0;
2074
2074
  }
@@ -2194,22 +2194,22 @@ let D = class extends y {
2194
2194
  class="baht-dropzone-input"
2195
2195
  id=${this.inputId}
2196
2196
  type="file"
2197
- accept=${L(this.accept)}
2197
+ accept=${N(this.accept)}
2198
2198
  ?multiple=${this.multiple}
2199
2199
  ?disabled=${this.disabled}
2200
2200
  ?required=${this.required}
2201
2201
  aria-invalid=${e ? "true" : "false"}
2202
- aria-describedby=${L(r)}
2202
+ aria-describedby=${N(r)}
2203
2203
  @change=${(c) => this.onPick(c)}
2204
2204
  />
2205
- <span class="baht-dropzone-icon" aria-hidden="true">${H("upload")}</span>
2205
+ <span class="baht-dropzone-icon" aria-hidden="true">${W("upload")}</span>
2206
2206
  <span class="baht-dropzone-text">
2207
2207
  <label class="baht-dropzone-action" for=${this.inputId}
2208
2208
  >${this.multiple ? m("chooseFiles") : m("chooseFile")}</label
2209
2209
  >
2210
2210
  <span class="baht-dropzone-or">${m("orDropHere")}</span>
2211
2211
  </span>
2212
- ${i ? n`<span class="baht-dropzone-hint" id=${L(a)}>${i}</span>` : h}
2212
+ ${i ? n`<span class="baht-dropzone-hint" id=${N(a)}>${i}</span>` : h}
2213
2213
  </div>
2214
2214
 
2215
2215
  ${this.pending.length > 0 || this.urls.length > 0 ? n`<ul class="baht-upload-list" aria-live="polite" aria-busy=${t ? "true" : "false"}>
@@ -2219,13 +2219,13 @@ let D = class extends y {
2219
2219
  ${this.rejectedNames.length > 0 ? n`<p class="baht-error" role="alert">
2220
2220
  ${m("fileRejectedTooLarge", { names: this.rejectedNames.join(", ") })}
2221
2221
  </p>` : h}
2222
- ${this.error ? n`<p class="baht-error" id=${L(s)} role="alert">${this.error}</p>` : h}
2222
+ ${this.error ? n`<p class="baht-error" id=${N(s)} role="alert">${this.error}</p>` : h}
2223
2223
  </div>`;
2224
2224
  }
2225
2225
  renderStored(t) {
2226
2226
  const e = this.fileFor(t);
2227
2227
  return n`<li class="baht-file-chip baht-file-chip--done">
2228
- <span class="baht-file-chip-icon" aria-hidden="true">${H("check")}</span>
2228
+ <span class="baht-file-chip-icon" aria-hidden="true">${W("check")}</span>
2229
2229
  <a class="baht-file-name" href=${t} target="_blank" rel="noreferrer"
2230
2230
  >${e.name}<span class="baht-visually-hidden"> (${m("opensInNewTab")})</span></a
2231
2231
  >
@@ -2237,7 +2237,7 @@ let D = class extends y {
2237
2237
  title=${m("removeFile")}
2238
2238
  @click=${() => this.emitValue(this.urls.filter((i) => i !== t))}
2239
2239
  >
2240
- ${H("close")}
2240
+ ${W("close")}
2241
2241
  </button>`}
2242
2242
  </li>`;
2243
2243
  }
@@ -2256,7 +2256,7 @@ let D = class extends y {
2256
2256
  title=${m("removeFile")}
2257
2257
  @click=${() => this.dismiss(t)}
2258
2258
  >
2259
- ${H("close")}
2259
+ ${W("close")}
2260
2260
  </button>` : n`<span
2261
2261
  class="baht-upload-bar"
2262
2262
  role="progressbar"
@@ -2269,69 +2269,69 @@ let D = class extends y {
2269
2269
  </li>`;
2270
2270
  }
2271
2271
  };
2272
- B([
2272
+ I([
2273
2273
  l()
2274
- ], D.prototype, "url", 2);
2275
- B([
2274
+ ], F.prototype, "url", 2);
2275
+ I([
2276
2276
  l()
2277
- ], D.prototype, "method", 2);
2278
- B([
2277
+ ], F.prototype, "method", 2);
2278
+ I([
2279
2279
  l({ attribute: "field-name" })
2280
- ], D.prototype, "fieldName", 2);
2281
- B([
2280
+ ], F.prototype, "fieldName", 2);
2281
+ I([
2282
2282
  l({ attribute: "response-key" })
2283
- ], D.prototype, "responseKey", 2);
2284
- B([
2283
+ ], F.prototype, "responseKey", 2);
2284
+ I([
2285
2285
  l({ attribute: !1 })
2286
- ], D.prototype, "headers", 2);
2287
- B([
2286
+ ], F.prototype, "headers", 2);
2287
+ I([
2288
2288
  l({ type: Boolean, attribute: "with-credentials" })
2289
- ], D.prototype, "withCredentials", 2);
2290
- B([
2289
+ ], F.prototype, "withCredentials", 2);
2290
+ I([
2291
2291
  l({ attribute: !1 })
2292
- ], D.prototype, "value", 2);
2293
- B([
2292
+ ], F.prototype, "value", 2);
2293
+ I([
2294
2294
  l()
2295
- ], D.prototype, "label", 2);
2296
- B([
2295
+ ], F.prototype, "label", 2);
2296
+ I([
2297
2297
  l()
2298
- ], D.prototype, "hint", 2);
2299
- B([
2298
+ ], F.prototype, "hint", 2);
2299
+ I([
2300
2300
  l()
2301
- ], D.prototype, "accept", 2);
2302
- B([
2301
+ ], F.prototype, "accept", 2);
2302
+ I([
2303
2303
  l({ type: Boolean })
2304
- ], D.prototype, "multiple", 2);
2305
- B([
2304
+ ], F.prototype, "multiple", 2);
2305
+ I([
2306
2306
  l({ type: Number, attribute: "max-size" })
2307
- ], D.prototype, "maxSize", 2);
2308
- B([
2307
+ ], F.prototype, "maxSize", 2);
2308
+ I([
2309
2309
  l({ type: Boolean })
2310
- ], D.prototype, "disabled", 2);
2311
- B([
2310
+ ], F.prototype, "disabled", 2);
2311
+ I([
2312
2312
  l({ type: Boolean })
2313
- ], D.prototype, "required", 2);
2314
- B([
2313
+ ], F.prototype, "required", 2);
2314
+ I([
2315
2315
  l()
2316
- ], D.prototype, "error", 2);
2317
- B([
2318
- $()
2319
- ], D.prototype, "pending", 2);
2320
- B([
2321
- $()
2322
- ], D.prototype, "rejectedNames", 2);
2323
- B([
2324
- $()
2325
- ], D.prototype, "dragging", 2);
2326
- D = B([
2316
+ ], F.prototype, "error", 2);
2317
+ I([
2318
+ y()
2319
+ ], F.prototype, "pending", 2);
2320
+ I([
2321
+ y()
2322
+ ], F.prototype, "rejectedNames", 2);
2323
+ I([
2324
+ y()
2325
+ ], F.prototype, "dragging", 2);
2326
+ F = I([
2327
2327
  b("baht-upload")
2328
- ], D);
2329
- var Ia = Object.defineProperty, ja = Object.getOwnPropertyDescriptor, ns = (t, e, i, a) => {
2330
- for (var s = a > 1 ? void 0 : a ? ja(e, i) : e, r = t.length - 1, o; r >= 0; r--)
2328
+ ], F);
2329
+ var Ia = Object.defineProperty, Ma = Object.getOwnPropertyDescriptor, ns = (t, e, i, a) => {
2330
+ for (var s = a > 1 ? void 0 : a ? Ma(e, i) : e, r = t.length - 1, o; r >= 0; r--)
2331
2331
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
2332
2332
  return a && s && Ia(e, i, s), s;
2333
2333
  };
2334
- let Fe = class extends y {
2334
+ let Fe = class extends g {
2335
2335
  render() {
2336
2336
  if (!this.field) return h;
2337
2337
  const t = this.field.variant ?? "body";
@@ -2344,12 +2344,12 @@ ns([
2344
2344
  Fe = ns([
2345
2345
  b("baht-text")
2346
2346
  ], Fe);
2347
- var Sa = Object.defineProperty, Ma = Object.getOwnPropertyDescriptor, hs = (t, e, i, a) => {
2348
- for (var s = a > 1 ? void 0 : a ? Ma(e, i) : e, r = t.length - 1, o; r >= 0; r--)
2347
+ var ja = Object.defineProperty, Sa = Object.getOwnPropertyDescriptor, hs = (t, e, i, a) => {
2348
+ for (var s = a > 1 ? void 0 : a ? Sa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
2349
2349
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
2350
- return a && s && Sa(e, i, s), s;
2350
+ return a && s && ja(e, i, s), s;
2351
2351
  };
2352
- let Ee = class extends y {
2352
+ let Ee = class extends g {
2353
2353
  render() {
2354
2354
  return this.field ? n`<div class="baht-section">
2355
2355
  <span class="baht-section-label">${this.field.text ?? this.field.label ?? ""}</span>
@@ -2362,12 +2362,12 @@ hs([
2362
2362
  Ee = hs([
2363
2363
  b("baht-section")
2364
2364
  ], Ee);
2365
- var Ta = Object.defineProperty, Aa = Object.getOwnPropertyDescriptor, ue = (t, e, i, a) => {
2365
+ var Ta = Object.defineProperty, Aa = Object.getOwnPropertyDescriptor, be = (t, e, i, a) => {
2366
2366
  for (var s = a > 1 ? void 0 : a ? Aa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
2367
2367
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
2368
2368
  return a && s && Ta(e, i, s), s;
2369
2369
  };
2370
- let Ut = class extends y {
2370
+ let Ht = class extends g {
2371
2371
  constructor() {
2372
2372
  super(...arguments), this.total = 0, this.label = "", this.color = "";
2373
2373
  }
@@ -2381,31 +2381,31 @@ let Ut = class extends y {
2381
2381
  </div>`;
2382
2382
  }
2383
2383
  };
2384
- ue([
2384
+ be([
2385
2385
  l({ type: Number })
2386
- ], Ut.prototype, "total", 2);
2387
- ue([
2386
+ ], Ht.prototype, "total", 2);
2387
+ be([
2388
2388
  l()
2389
- ], Ut.prototype, "label", 2);
2390
- ue([
2389
+ ], Ht.prototype, "label", 2);
2390
+ be([
2391
2391
  l()
2392
- ], Ut.prototype, "color", 2);
2393
- Ut = ue([
2392
+ ], Ht.prototype, "color", 2);
2393
+ Ht = be([
2394
2394
  b("baht-stat-chart")
2395
- ], Ut);
2396
- var La = Object.defineProperty, Tt = (t, e, i, a) => {
2395
+ ], Ht);
2396
+ var La = Object.defineProperty, At = (t, e, i, a) => {
2397
2397
  for (var s = void 0, r = t.length - 1, o; r >= 0; r--)
2398
2398
  (o = t[r]) && (s = o(e, i, s) || s);
2399
2399
  return s && La(e, i, s), s;
2400
2400
  };
2401
2401
  const Na = 10;
2402
- function nt(t, e) {
2402
+ function ft(t, e) {
2403
2403
  return e && t === 0 ? e : `var(--baht-chart-${t % Na + 1})`;
2404
2404
  }
2405
2405
  function Xe(t, e = 5) {
2406
2406
  return `var(--baht-chart-seq-${Math.min(e - 1, Math.max(0, t)) + 1})`;
2407
2407
  }
2408
- function qt(t, e = "number", i = "THB") {
2408
+ function Rt(t, e = "number", i = "THB") {
2409
2409
  if (!Number.isFinite(t)) return "—";
2410
2410
  switch (e) {
2411
2411
  case "currency":
@@ -2435,7 +2435,7 @@ function Be(t, e = 4) {
2435
2435
  for (let c = 0; c <= r + s / 1e3; c += s) o.push(Number(c.toFixed(10)));
2436
2436
  return o;
2437
2437
  }
2438
- function le(t, e) {
2438
+ function ne(t, e) {
2439
2439
  const [i, a] = t, [s, r] = e, o = a - i;
2440
2440
  return !Number.isFinite(o) || o === 0 ? () => s : (c) => s + (c - i) / o * (r - s);
2441
2441
  }
@@ -2444,7 +2444,7 @@ function qa(t, e, i = "Other") {
2444
2444
  const a = t.slice(0, e - 1), s = t.slice(e - 1).reduce((r, o) => r + o.count, 0);
2445
2445
  return [...a, { label: i, count: s }];
2446
2446
  }
2447
- function be(t, e, i, a = "View as table") {
2447
+ function fe(t, e, i, a = "View as table") {
2448
2448
  return n`<details class="baht-chart-table">
2449
2449
  <summary>${a}</summary>
2450
2450
  <table>
@@ -2466,13 +2466,13 @@ function be(t, e, i, a = "View as table") {
2466
2466
  </table>
2467
2467
  </details>`;
2468
2468
  }
2469
- class tt extends y {
2469
+ class st extends g {
2470
2470
  constructor() {
2471
2471
  super(...arguments), this.emptyMessage = "No data to chart", this.loading = !1, this.showTable = !0, this.format = "number", this.currency = "THB", this.held = null;
2472
2472
  }
2473
2473
  /** Value → display text using this chart's `format` / `currency`. */
2474
2474
  fmt(e) {
2475
- return qt(e, this.format, this.currency);
2475
+ return Rt(e, this.format, this.currency);
2476
2476
  }
2477
2477
  /**
2478
2478
  * The snapshot to draw. While `loading` is set the previous one is returned,
@@ -2495,7 +2495,7 @@ class tt extends y {
2495
2495
  * untrusted data (interaction.md).
2496
2496
  */
2497
2497
  showTip(e, i) {
2498
- var g;
2498
+ var $;
2499
2499
  const a = this.tipEl;
2500
2500
  if (!a) return;
2501
2501
  a.textContent = i, a.hidden = !1;
@@ -2506,7 +2506,7 @@ class tt extends y {
2506
2506
  if (typeof o.clientX == "number" && (o.clientX !== 0 || o.clientY !== 0))
2507
2507
  c = o.clientX - r.left, f = o.clientY - r.top;
2508
2508
  else {
2509
- const _ = e.currentTarget, p = (g = _ == null ? void 0 : _.getBoundingClientRect) == null ? void 0 : g.call(_);
2509
+ const w = e.currentTarget, p = ($ = w == null ? void 0 : w.getBoundingClientRect) == null ? void 0 : $.call(w);
2510
2510
  c = p ? p.left + p.width / 2 - r.left : 0, f = p ? p.top - r.top : 0;
2511
2511
  }
2512
2512
  a.style.left = `${Math.round(c)}px`, a.style.top = `${Math.round(f)}px`;
@@ -2538,78 +2538,78 @@ class tt extends y {
2538
2538
  </div>`;
2539
2539
  }
2540
2540
  }
2541
- Tt([
2541
+ At([
2542
2542
  l({ attribute: "empty-message" })
2543
- ], tt.prototype, "emptyMessage");
2544
- Tt([
2543
+ ], st.prototype, "emptyMessage");
2544
+ At([
2545
2545
  l({ type: Boolean, reflect: !0 })
2546
- ], tt.prototype, "loading");
2547
- Tt([
2546
+ ], st.prototype, "loading");
2547
+ At([
2548
2548
  l({ type: Boolean, attribute: "show-table" })
2549
- ], tt.prototype, "showTable");
2550
- Tt([
2549
+ ], st.prototype, "showTable");
2550
+ At([
2551
2551
  l()
2552
- ], tt.prototype, "format");
2553
- Tt([
2552
+ ], st.prototype, "format");
2553
+ At([
2554
2554
  l()
2555
- ], tt.prototype, "currency");
2556
- Tt([
2557
- Bt(".baht-chart-tooltip")
2558
- ], tt.prototype, "tipEl");
2559
- var Ra = Object.defineProperty, za = Object.getOwnPropertyDescriptor, gt = (t, e, i, a) => {
2555
+ ], st.prototype, "currency");
2556
+ At([
2557
+ It(".baht-chart-tooltip")
2558
+ ], st.prototype, "tipEl");
2559
+ var Ra = Object.defineProperty, za = Object.getOwnPropertyDescriptor, wt = (t, e, i, a) => {
2560
2560
  for (var s = a > 1 ? void 0 : a ? za(e, i) : e, r = t.length - 1, o; r >= 0; r--)
2561
2561
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
2562
2562
  return a && s && Ra(e, i, s), s;
2563
2563
  };
2564
- let ct = class extends y {
2564
+ let ct = class extends g {
2565
2565
  constructor() {
2566
2566
  super(...arguments), this.values = [], this.width = 96, this.height = 24, this.accentLast = !0, this.color = "", this.label = "";
2567
2567
  }
2568
2568
  render() {
2569
- const t = (this.values ?? []).filter((C) => Number.isFinite(C));
2569
+ const t = (this.values ?? []).filter((x) => Number.isFinite(x));
2570
2570
  if (t.length < 2) return h;
2571
- const e = Math.max(16, this.width), i = Math.max(8, this.height), a = 3, s = Math.min(...t), r = Math.max(...t), o = le([0, t.length - 1], [a, e - a]), c = le([s, r === s ? s + 1 : r], [i - a, a]), f = t.map((C, d) => `${o(d).toFixed(2)},${c(C).toFixed(2)}`).join(" "), g = o(t.length - 1), _ = c(t[t.length - 1]), p = this.color || "var(--baht-chart-muted)", w = this.label || `Trend of ${t.length} points`;
2571
+ const e = Math.max(16, this.width), i = Math.max(8, this.height), a = 3, s = Math.min(...t), r = Math.max(...t), o = ne([0, t.length - 1], [a, e - a]), c = ne([s, r === s ? s + 1 : r], [i - a, a]), f = t.map((x, u) => `${o(u).toFixed(2)},${c(x).toFixed(2)}`).join(" "), $ = o(t.length - 1), w = c(t[t.length - 1]), p = this.color || "var(--baht-chart-muted)", P = this.label || `Trend of ${t.length} points`;
2572
2572
  return n`<svg
2573
2573
  class="baht-sparkline"
2574
2574
  width=${e}
2575
2575
  height=${i}
2576
2576
  viewBox="0 0 ${e} ${i}"
2577
2577
  role="img"
2578
- aria-label=${w}
2578
+ aria-label=${P}
2579
2579
  >
2580
- ${A`<polyline class="baht-sparkline-line" points=${f} fill="none" stroke=${p}/>`}
2581
- ${this.accentLast ? A`<circle class="baht-sparkline-dot" cx=${g.toFixed(2)} cy=${_.toFixed(2)} r="3"
2580
+ ${L`<polyline class="baht-sparkline-line" points=${f} fill="none" stroke=${p}/>`}
2581
+ ${this.accentLast ? L`<circle class="baht-sparkline-dot" cx=${$.toFixed(2)} cy=${w.toFixed(2)} r="3"
2582
2582
  fill="var(--baht-chart-1)"/>` : h}
2583
2583
  </svg>`;
2584
2584
  }
2585
2585
  };
2586
- gt([
2586
+ wt([
2587
2587
  l({ type: Array })
2588
2588
  ], ct.prototype, "values", 2);
2589
- gt([
2589
+ wt([
2590
2590
  l({ type: Number })
2591
2591
  ], ct.prototype, "width", 2);
2592
- gt([
2592
+ wt([
2593
2593
  l({ type: Number })
2594
2594
  ], ct.prototype, "height", 2);
2595
- gt([
2595
+ wt([
2596
2596
  l({ type: Boolean, attribute: "accent-last" })
2597
2597
  ], ct.prototype, "accentLast", 2);
2598
- gt([
2598
+ wt([
2599
2599
  l()
2600
2600
  ], ct.prototype, "color", 2);
2601
- gt([
2601
+ wt([
2602
2602
  l()
2603
2603
  ], ct.prototype, "label", 2);
2604
- ct = gt([
2604
+ ct = wt([
2605
2605
  b("baht-sparkline")
2606
2606
  ], ct);
2607
- var Va = Object.defineProperty, Ka = Object.getOwnPropertyDescriptor, Y = (t, e, i, a) => {
2607
+ var Va = Object.defineProperty, Ka = Object.getOwnPropertyDescriptor, X = (t, e, i, a) => {
2608
2608
  for (var s = a > 1 ? void 0 : a ? Ka(e, i) : e, r = t.length - 1, o; r >= 0; r--)
2609
2609
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
2610
2610
  return a && s && Va(e, i, s), s;
2611
2611
  };
2612
- let K = class extends y {
2612
+ let K = class extends g {
2613
2613
  constructor() {
2614
2614
  super(...arguments), this.label = "", this.value = 0, this.format = "number", this.currency = "THB", this.delta = null, this.deltaKind = "pct", this.deltaLabel = "", this.upIsGood = !0, this.trend = [], this.size = "md";
2615
2615
  }
@@ -2624,19 +2624,20 @@ let K = class extends y {
2624
2624
  }
2625
2625
  get deltaText() {
2626
2626
  const t = this.delta ?? 0, e = Math.abs(t);
2627
- return this.deltaKind === "pct" ? `${qt(e / 100, "percent")}` : qt(e, this.format, this.currency);
2627
+ return this.deltaKind === "pct" ? `${Rt(e / 100, "percent")}` : Rt(e, this.format, this.currency);
2628
2628
  }
2629
2629
  render() {
2630
2630
  const t = this.delta != null && Number.isFinite(this.delta), e = this.tone, i = (this.delta ?? 0) > 0 ? "up" : (this.delta ?? 0) < 0 ? "down" : "flat";
2631
2631
  return n`<div class="baht-stat${this.size === "hero" ? " baht-stat--hero" : ""}">
2632
2632
  ${this.label ? n`<div class="baht-stat-label">${this.label}</div>` : h}
2633
- <div class="baht-stat-value">${qt(this.value, this.format, this.currency)}</div>
2633
+ <div class="baht-stat-value">${Rt(this.value, this.format, this.currency)}</div>
2634
2634
  ${t ? n`<div class="baht-stat-delta baht-stat-delta--${e}">
2635
2635
  <span class="baht-stat-arrow" aria-hidden="true">${this.arrow}</span>
2636
2636
  <span class="baht-stat-delta-value">${this.deltaText}</span>
2637
2637
  <span class="baht-visually-hidden">${i}</span>
2638
2638
  ${this.deltaLabel ? n`<span class="baht-stat-delta-label">${this.deltaLabel}</span>` : h}
2639
2639
  </div>` : h}
2640
+ ${!t && this.deltaLabel ? n`<div class="baht-stat-caption">${this.deltaLabel}</div>` : h}
2640
2641
  ${this.trend.length > 1 ? n`<baht-sparkline
2641
2642
  class="baht-stat-trend"
2642
2643
  .values=${this.trend}
@@ -2645,46 +2646,46 @@ let K = class extends y {
2645
2646
  </div>`;
2646
2647
  }
2647
2648
  };
2648
- Y([
2649
+ X([
2649
2650
  l()
2650
2651
  ], K.prototype, "label", 2);
2651
- Y([
2652
+ X([
2652
2653
  l({ type: Number })
2653
2654
  ], K.prototype, "value", 2);
2654
- Y([
2655
+ X([
2655
2656
  l()
2656
2657
  ], K.prototype, "format", 2);
2657
- Y([
2658
+ X([
2658
2659
  l()
2659
2660
  ], K.prototype, "currency", 2);
2660
- Y([
2661
+ X([
2661
2662
  l({ type: Number })
2662
2663
  ], K.prototype, "delta", 2);
2663
- Y([
2664
+ X([
2664
2665
  l({ attribute: "delta-kind" })
2665
2666
  ], K.prototype, "deltaKind", 2);
2666
- Y([
2667
+ X([
2667
2668
  l({ attribute: "delta-label" })
2668
2669
  ], K.prototype, "deltaLabel", 2);
2669
- Y([
2670
+ X([
2670
2671
  l({ type: Boolean, attribute: "up-is-good" })
2671
2672
  ], K.prototype, "upIsGood", 2);
2672
- Y([
2673
+ X([
2673
2674
  l({ type: Array })
2674
2675
  ], K.prototype, "trend", 2);
2675
- Y([
2676
+ X([
2676
2677
  l()
2677
2678
  ], K.prototype, "size", 2);
2678
- K = Y([
2679
+ K = X([
2679
2680
  b("baht-stat")
2680
2681
  ], K);
2681
- var Ua = Object.defineProperty, Ha = Object.getOwnPropertyDescriptor, At = (t, e, i, a) => {
2682
+ var Ua = Object.defineProperty, Ha = Object.getOwnPropertyDescriptor, Lt = (t, e, i, a) => {
2682
2683
  for (var s = a > 1 ? void 0 : a ? Ha(e, i) : e, r = t.length - 1, o; r >= 0; r--)
2683
2684
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
2684
2685
  return a && s && Ua(e, i, s), s;
2685
2686
  };
2686
2687
  const Ze = 6;
2687
- let G = class extends tt {
2688
+ let J = class extends st {
2688
2689
  constructor() {
2689
2690
  super(...arguments), this.groups = [], this.total = null, this.color = "", this.centerLabel = "records", this.otherLabel = "Other";
2690
2691
  }
@@ -2692,24 +2693,24 @@ let G = class extends tt {
2692
2693
  const t = this.hold(this.groups ?? []);
2693
2694
  if (t.length === 0)
2694
2695
  return n`<div class=${this.rootClass("baht-donut-chart")}>${this.renderEmpty()}</div>`;
2695
- const e = qa(t, Ze, this.otherLabel), i = e.reduce((p, w) => p + w.count, 0) || 1, a = this.total ?? t.reduce((p, w) => p + w.count, 0), s = G.R, r = 2 * Math.PI * s, o = e.length > 1 ? G.GAP : 0, c = t.length > Ze;
2696
+ const e = qa(t, Ze, this.otherLabel), i = e.reduce((p, P) => p + P.count, 0) || 1, a = this.total ?? t.reduce((p, P) => p + P.count, 0), s = J.R, r = 2 * Math.PI * s, o = e.length > 1 ? J.GAP : 0, c = t.length > Ze;
2696
2697
  let f = 0;
2697
- const g = e.map((p, w) => {
2698
- const C = p.count / i, d = Math.max(0, C * r - o), v = {
2698
+ const $ = e.map((p, P) => {
2699
+ const x = p.count / i, u = Math.max(0, x * r - o), v = {
2699
2700
  ...p,
2700
- frac: C,
2701
- dash: `${d} ${r - d}`,
2701
+ frac: x,
2702
+ dash: `${u} ${r - u}`,
2702
2703
  offset: -f * r,
2703
2704
  // the folded tail is grey — never a generated ninth hue
2704
- color: c && w === e.length - 1 ? "var(--baht-chart-muted)" : nt(w, this.color || void 0)
2705
+ color: c && P === e.length - 1 ? "var(--baht-chart-muted)" : ft(P, this.color || void 0)
2705
2706
  };
2706
- return f += C, v;
2707
- }), _ = `${a} ${this.centerLabel}: ${g.map((p) => `${p.label || "(empty)"} ${p.count} (${Math.round(p.frac * 100)}%)`).join(", ")}`;
2707
+ return f += x, v;
2708
+ }), w = `${a} ${this.centerLabel}: ${$.map((p) => `${p.label || "(empty)"} ${p.count} (${Math.round(p.frac * 100)}%)`).join(", ")}`;
2708
2709
  return n`<div class=${this.rootClass("baht-donut-chart")}>
2709
- <svg width="160" height="160" viewBox="0 0 160 160" role="img" aria-label=${_}>
2710
+ <svg width="160" height="160" viewBox="0 0 160 160" role="img" aria-label=${w}>
2710
2711
  <g transform="translate(80,80) rotate(-90)">
2711
- ${g.map(
2712
- (p) => A`<circle r=${s} cx="0" cy="0" fill="none" stroke=${p.color}
2712
+ ${$.map(
2713
+ (p) => L`<circle r=${s} cx="0" cy="0" fill="none" stroke=${p.color}
2713
2714
  stroke-width="22" stroke-dasharray=${p.dash} stroke-dashoffset=${p.offset}/>`
2714
2715
  )}
2715
2716
  </g>
@@ -2717,7 +2718,7 @@ let G = class extends tt {
2717
2718
  <text x="80" y="94" text-anchor="middle" class="baht-donut-chart-sub">${this.centerLabel}</text>
2718
2719
  </svg>
2719
2720
  <div class="baht-chart-legend">
2720
- ${g.map(
2721
+ ${$.map(
2721
2722
  (p) => n`<div class="baht-chart-legend-row">
2722
2723
  <span class="baht-chart-swatch" style="background:${p.color}" aria-hidden="true"></span>
2723
2724
  <span class="baht-chart-legend-label">${p.label || "(empty)"}</span>
@@ -2726,10 +2727,10 @@ let G = class extends tt {
2726
2727
  </div>`
2727
2728
  )}
2728
2729
  </div>
2729
- ${this.showTable ? be(
2730
+ ${this.showTable ? fe(
2730
2731
  `${a} ${this.centerLabel}`,
2731
2732
  ["Slice", "Value", "Share"],
2732
- g.map((p) => [
2733
+ $.map((p) => [
2733
2734
  p.label || "(empty)",
2734
2735
  this.fmt(p.count),
2735
2736
  `${Math.round(p.frac * 100)}%`
@@ -2738,35 +2739,35 @@ let G = class extends tt {
2738
2739
  </div>`;
2739
2740
  }
2740
2741
  };
2741
- G.R = 54;
2742
- G.GAP = 2;
2743
- At([
2742
+ J.R = 54;
2743
+ J.GAP = 2;
2744
+ Lt([
2744
2745
  l({ attribute: !1 })
2745
- ], G.prototype, "groups", 2);
2746
- At([
2746
+ ], J.prototype, "groups", 2);
2747
+ Lt([
2747
2748
  l({ type: Number })
2748
- ], G.prototype, "total", 2);
2749
- At([
2749
+ ], J.prototype, "total", 2);
2750
+ Lt([
2750
2751
  l()
2751
- ], G.prototype, "color", 2);
2752
- At([
2752
+ ], J.prototype, "color", 2);
2753
+ Lt([
2753
2754
  l({ attribute: "center-label" })
2754
- ], G.prototype, "centerLabel", 2);
2755
- At([
2755
+ ], J.prototype, "centerLabel", 2);
2756
+ Lt([
2756
2757
  l({ attribute: "other-label" })
2757
- ], G.prototype, "otherLabel", 2);
2758
- G = At([
2758
+ ], J.prototype, "otherLabel", 2);
2759
+ J = Lt([
2759
2760
  b("baht-donut-chart")
2760
- ], G);
2761
+ ], J);
2761
2762
  var Ga = Object.defineProperty, Wa = Object.getOwnPropertyDescriptor, V = (t, e, i, a) => {
2762
2763
  for (var s = a > 1 ? void 0 : a ? Wa(e, i) : e, r = t.length - 1, o; r >= 0; r--)
2763
2764
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
2764
2765
  return a && s && Ga(e, i, s), s;
2765
2766
  };
2766
2767
  const Qe = 24, ts = 2, Ja = 56, Ya = 26;
2767
- let R = class extends tt {
2768
+ let z = class extends st {
2768
2769
  constructor() {
2769
- super(...arguments), this.groups = [], this.series = [], this.categories = [], this.orientation = "horizontal", this.stacked = !1, this.compare = [], this.markers = [], this.labelValues = "ends", this.emphasis = null, this.color = "", this.label = "", this.band = 0;
2770
+ super(...arguments), this.groups = [], this.series = [], this.categories = [], this.orientation = "horizontal", this.stacked = !1, this.compare = [], this.compareLabel = "Previous period", this.markers = [], this.labelValues = "ends", this.emphasis = null, this.color = "", this.label = "", this.band = 0;
2770
2771
  }
2771
2772
  connectedCallback() {
2772
2773
  super.connectedCallback(), !(!S() || typeof ResizeObserver > "u") && (this.resizeObserver = new ResizeObserver(() => this.measure()), this.resizeObserver.observe(this));
@@ -2807,7 +2808,7 @@ let R = class extends tt {
2807
2808
  }
2808
2809
  colorFor(t, e, i) {
2809
2810
  const a = this.model.series[t];
2810
- return this.emphasis != null && !(i ? t === this.emphasis : e === this.emphasis) ? "var(--baht-chart-muted)" : nt(i ? t : 0, this.color || (a == null ? void 0 : a.color) || void 0);
2811
+ return this.emphasis != null && !(i ? t === this.emphasis : e === this.emphasis) ? "var(--baht-chart-muted)" : ft(i ? t : 0, this.color || (a == null ? void 0 : a.color) || void 0);
2811
2812
  }
2812
2813
  render() {
2813
2814
  const t = this.hold(this.model);
@@ -2817,7 +2818,7 @@ let R = class extends tt {
2817
2818
  domainMax(t, e, i) {
2818
2819
  const a = Math.max(...t.map((c) => c.values.length)), s = Array.from(
2819
2820
  { length: a },
2820
- (c, f) => e ? t.reduce((g, _) => g + (_.values[f] ?? 0), 0) : Math.max(...t.map((g) => g.values[f] ?? 0))
2821
+ (c, f) => e ? t.reduce(($, w) => $ + (w.values[f] ?? 0), 0) : Math.max(...t.map(($) => $.values[f] ?? 0))
2821
2822
  ), r = Math.max(
2822
2823
  1,
2823
2824
  ...s,
@@ -2829,284 +2830,341 @@ let R = class extends tt {
2829
2830
  return o[o.length - 1] ?? r;
2830
2831
  }
2831
2832
  tableTwin(t, e, i) {
2832
- var s;
2833
+ var r;
2833
2834
  if (!this.showTable) return h;
2834
- const a = ["Category", ...t.map((r) => r.name || "Value")];
2835
- return (s = this.compare) != null && s.length && a.push("Previous"), be(
2836
- this.label || "Bar chart data",
2837
- a,
2838
- Array.from({ length: i }, (r, o) => {
2839
- var f;
2840
- const c = [
2841
- e[o] || "(empty)",
2842
- ...t.map((g) => this.fmt(g.values[o] ?? 0))
2843
- ];
2844
- return (f = this.compare) != null && f.length && c.push(this.fmt(this.compare[o] ?? 0)), c;
2845
- })
2846
- );
2835
+ const a = ["Category", ...t.map((o) => o.name || "Value")];
2836
+ (r = this.compare) != null && r.length && a.push(this.compareLabel);
2837
+ const s = Array.from({ length: i }, (o, c) => {
2838
+ var $;
2839
+ const f = [
2840
+ e[c] || "(empty)",
2841
+ ...t.map((w) => this.fmt(w.values[c] ?? 0))
2842
+ ];
2843
+ return ($ = this.compare) != null && $.length && f.push(this.fmt(this.compare[c] ?? 0)), f;
2844
+ });
2845
+ for (const o of this.markers ?? [])
2846
+ s.push([
2847
+ `${o.label ?? "Target"}${o.category ? ` (${o.category})` : ""}`,
2848
+ this.fmt(o.value),
2849
+ ...Array.from({ length: a.length - 2 }, () => "—")
2850
+ ]);
2851
+ return fe(this.label || "Bar chart data", a, s);
2847
2852
  }
2848
2853
  /** Markers with no `category` span the chart; the rest ride their own row. */
2849
2854
  markersFor(t) {
2850
2855
  return (this.markers ?? []).filter((e) => !e.category || e.category === t);
2851
2856
  }
2857
+ /** Markers that apply to every row / column. */
2858
+ get chartMarkers() {
2859
+ return (this.markers ?? []).filter((t) => !t.category);
2860
+ }
2861
+ /** What a marker reads as: its own label, else its formatted value. */
2862
+ markerText(t) {
2863
+ return t.label ? `${t.label} ${this.fmt(t.value)}` : this.fmt(t.value);
2864
+ }
2865
+ /**
2866
+ * Marker lines, positioned along the value axis. The label is drawn separately
2867
+ * (`markerLabels`) as real text — a `title` attribute alone never reaches AT.
2868
+ */
2852
2869
  markerOverlay(t, e) {
2853
2870
  return this.markersFor(e).map(
2854
2871
  (i) => n`<span
2855
2872
  class="baht-bar-chart-marker"
2856
2873
  style=${`left:${Math.min(100, i.value / t * 100).toFixed(2)}%`}
2857
- title=${i.label ?? this.fmt(i.value)}
2858
2874
  aria-hidden="true"
2859
2875
  ></span>`
2860
2876
  );
2861
2877
  }
2878
+ /**
2879
+ * Marker labels, sorted along the axis and thinned so neighbours never collide:
2880
+ * a dropped label keeps its line, and its value still reads in the table twin.
2881
+ */
2882
+ placedMarkers(t) {
2883
+ const e = [], i = [...this.chartMarkers].sort((a, s) => a.value - s.value);
2884
+ for (const a of i) {
2885
+ const s = Math.min(100, Math.max(0, a.value / t * 100)), r = e[e.length - 1];
2886
+ r && s - r.pct < 12 || e.push({ m: a, pct: s });
2887
+ }
2888
+ return e;
2889
+ }
2890
+ /** Legend rows: one per series, plus the muted `compare` key when it is set. */
2891
+ legendEntries(t) {
2892
+ const e = t.map((i, a) => ({
2893
+ label: i.name || "Value",
2894
+ color: ft(a, i.color)
2895
+ }));
2896
+ return (this.compare ?? []).length > 0 && e.push({ label: this.compareLabel, color: "var(--baht-chart-muted)" }), e;
2897
+ }
2862
2898
  renderHorizontal(t) {
2863
- const { series: e, categories: i, legacy: a } = t, s = e.length > 1, r = Math.max(...e.map((p) => p.values.length)), o = this.domainMax(e, this.stacked, a), c = (this.compare ?? []).length > 0, f = (this.stacked ? 1 : e.length) + (c ? 1 : 0), g = Math.min(Qe, Math.max(6, Math.floor(48 / f))), _ = Array.from({ length: r }, (p, w) => {
2864
- const C = i[w] || "(empty)", d = e.reduce((P, q) => P + (q.values[w] ?? 0), 0), v = `${C}: ${e.map((P) => `${P.name ? `${P.name} ` : ""}${this.fmt(P.values[w] ?? 0)}`).join(", ")}${c ? `, previous ${this.fmt(this.compare[w] ?? 0)}` : ""}`, z = e.map((P, q) => ({
2865
- value: P.values[w] ?? 0,
2866
- color: this.colorFor(q, w, s),
2867
- name: P.name
2899
+ const { series: e, categories: i, legacy: a } = t, s = e.length > 1, r = Math.max(...e.map((P) => P.values.length)), o = this.domainMax(e, this.stacked, a), c = (this.compare ?? []).length > 0, f = (this.stacked ? 1 : e.length) + (c ? 1 : 0), $ = Math.min(Qe, Math.max(6, Math.floor(48 / f))), w = Array.from({ length: r }, (P, x) => {
2900
+ const u = i[x] || "(empty)", v = e.reduce((C, R) => C + (R.values[x] ?? 0), 0), D = `${u}: ${e.map((C) => `${C.name ? `${C.name} ` : ""}${this.fmt(C.values[x] ?? 0)}`).join(", ")}${c ? `, previous ${this.fmt(this.compare[x] ?? 0)}` : ""}`, G = e.map((C, R) => ({
2901
+ value: C.values[x] ?? 0,
2902
+ color: this.colorFor(R, x, s),
2903
+ name: C.name
2868
2904
  }));
2869
2905
  return n`<div class="baht-bar-chart-row">
2870
- <span class="baht-bar-chart-label" title=${C}>${C}</span>
2906
+ <span class="baht-bar-chart-label" title=${u}>${u}</span>
2871
2907
  <div
2872
2908
  class="baht-bar-chart-track${this.stacked ? " baht-bar-chart-track--stacked" : ""}"
2873
2909
  tabindex="0"
2874
2910
  role="button"
2875
- aria-label=${v}
2876
- @pointermove=${(P) => this.showTip(P, v)}
2911
+ aria-label=${D}
2912
+ @pointermove=${(C) => this.showTip(C, D)}
2877
2913
  @pointerleave=${() => this.hideTip()}
2878
- @focus=${(P) => this.showTip(P, v)}
2914
+ @focus=${(C) => this.showTip(C, D)}
2879
2915
  @blur=${() => this.hideTip()}
2880
2916
  >
2881
- ${this.markerOverlay(o, C)}
2917
+ ${this.markerOverlay(o, u)}
2882
2918
  <div class="baht-bar-chart-bars">
2883
- ${this.stacked ? n`<div class="baht-bar-chart-stack" style=${`height:${g}px`}>
2884
- ${z.map(
2885
- (P) => n`<div
2919
+ ${this.stacked ? n`<div class="baht-bar-chart-stack" style=${`height:${$}px`}>
2920
+ ${G.map(
2921
+ (C) => n`<div
2886
2922
  class="baht-bar-chart-bar baht-bar-chart-bar--segment"
2887
- style=${`width:${Math.max(0, P.value / o * 100)}%;background:${P.color}`}
2923
+ style=${`width:${Math.max(0, C.value / o * 100)}%;background:${C.color}`}
2888
2924
  ></div>`
2889
2925
  )}
2890
- </div>` : z.map(
2891
- (P) => n`<div
2926
+ </div>` : G.map(
2927
+ (C) => n`<div
2892
2928
  class="baht-bar-chart-bar"
2893
- style=${`width:${Math.max(2, P.value / o * 100)}%;height:${g}px;background:${P.color}`}
2929
+ style=${`width:${Math.max(2, C.value / o * 100)}%;height:${$}px;background:${C.color}`}
2894
2930
  ></div>`
2895
2931
  )}
2896
2932
  ${c ? n`<div
2897
2933
  class="baht-bar-chart-bar baht-bar-chart-bar--compare"
2898
- style=${`width:${Math.max(2, (this.compare[w] ?? 0) / o * 100)}%;height:${Math.min(8, g)}px`}
2934
+ style=${`width:${Math.max(2, (this.compare[x] ?? 0) / o * 100)}%;height:${Math.min(8, $)}px`}
2899
2935
  ></div>` : h}
2900
2936
  </div>
2901
2937
  </div>
2902
2938
  ${this.labelValues === "ends" ? n`<span class="baht-bar-chart-count"
2903
- >${a ? e[0].values[w] ?? 0 : this.fmt(this.stacked ? d : e[0].values[w] ?? 0)}</span
2939
+ >${a ? e[0].values[x] ?? 0 : this.fmt(this.stacked ? v : e[0].values[x] ?? 0)}</span
2904
2940
  >` : h}
2905
2941
  </div>`;
2906
- });
2942
+ }), p = this.placedMarkers(o);
2907
2943
  return n`<div class=${this.rootClass("baht-bar-chart")}>
2908
- ${_}
2944
+ ${p.length > 0 ? n`<div class="baht-bar-chart-row baht-bar-chart-row--markers">
2945
+ <span class="baht-bar-chart-label"></span>
2946
+ <div class="baht-bar-chart-markbar">
2947
+ ${p.map(
2948
+ ({ m: P, pct: x }) => n`<span
2949
+ class="baht-bar-chart-marker-label"
2950
+ style=${`left:${x.toFixed(2)}%;transform:translateX(${x > 88 ? "-100%" : x < 12 ? "0" : "-50%"})`}
2951
+ >${this.markerText(P)}</span
2952
+ >`
2953
+ )}
2954
+ </div>
2955
+ ${this.labelValues === "ends" ? n`<span class="baht-bar-chart-count"></span>` : h}
2956
+ </div>` : h}
2957
+ ${w}
2909
2958
  ${this.renderTooltip()}
2910
- ${this.renderLegend(e.map((p, w) => ({ label: p.name, color: nt(w, p.color) })))}
2959
+ ${this.renderLegend(this.legendEntries(e))}
2911
2960
  ${this.tableTwin(e, i, r)}
2912
2961
  </div>`;
2913
2962
  }
2914
2963
  renderVertical(t) {
2915
- const { series: e, categories: i, legacy: a } = t, s = e.length > 1, r = Math.max(...e.map((d) => d.values.length)), o = this.domainMax(e, this.stacked, a), c = Be(o, 4), f = (this.compare ?? []).length > 0, g = (this.stacked ? 1 : e.length) + (f ? 1 : 0), _ = this.band > 0 ? (this.band - ts) / g : 48 / g, p = Math.min(Qe, Math.max(2, Math.floor(_))), w = this.band > 0 ? Math.max(1, Math.ceil(Ya / Math.max(1, this.band))) : Math.max(1, Math.ceil(r / 12)), C = this.label || `Column chart, ${r} categories. ${i.map((d, v) => `${d} ${this.fmt(e[0].values[v] ?? 0)}`).join(", ")}`;
2964
+ const { series: e, categories: i, legacy: a } = t, s = e.length > 1, r = Math.max(...e.map((v) => v.values.length)), o = this.domainMax(e, this.stacked, a), c = Be(o, 4), f = (this.compare ?? []).length > 0, $ = (this.stacked ? 1 : e.length) + (f ? 1 : 0), w = this.band > 0 ? (this.band - ts) / $ : 48 / $, p = Math.min(Qe, Math.max(2, Math.floor(w))), P = this.band > 0 ? Math.max(1, Math.ceil(Ya / Math.max(1, this.band))) : Math.max(1, Math.ceil(r / 12)), x = this.chartMarkers.map((v) => this.markerText(v)), u = this.label || `Column chart, ${r} categories. ${i.map((v, D) => `${v} ${this.fmt(e[0].values[D] ?? 0)}`).join(", ")}${x.length ? `. Reference lines: ${x.join(", ")}` : ""}`;
2916
2965
  return n`<div class=${this.rootClass("baht-bar-chart baht-bar-chart--vertical")}>
2917
- <div class="baht-bar-chart-plot" role="img" aria-label=${C}>
2966
+ <div class="baht-bar-chart-plot" role="img" aria-label=${u}>
2918
2967
  <div class="baht-bar-chart-yaxis" aria-hidden="true">
2919
- ${[...c].reverse().map((d) => n`<span class="baht-chart-tick-text">${this.fmt(d)}</span>`)}
2968
+ ${[...c].reverse().map((v) => n`<span class="baht-chart-tick-text">${this.fmt(v)}</span>`)}
2920
2969
  </div>
2921
2970
  <div class="baht-bar-chart-grid">
2922
- ${(this.markers ?? []).filter((d) => !d.category).map(
2923
- (d) => n`<span
2924
- class="baht-bar-chart-marker baht-bar-chart-marker--horizontal"
2925
- style=${`bottom:${Math.min(100, d.value / o * 100).toFixed(2)}%`}
2926
- title=${d.label ?? this.fmt(d.value)}
2927
- aria-hidden="true"
2928
- ></span>`
2971
+ ${this.chartMarkers.map(
2972
+ (v) => n`<span
2973
+ class="baht-bar-chart-marker baht-bar-chart-marker--horizontal"
2974
+ style=${`bottom:${Math.min(100, v.value / o * 100).toFixed(2)}%`}
2975
+ aria-hidden="true"
2976
+ ></span>`
2977
+ )}
2978
+ ${this.placedMarkers(o).map(
2979
+ ({ m: v, pct: D }) => n`<span
2980
+ class="baht-bar-chart-marker-label baht-bar-chart-marker-label--end"
2981
+ style=${`bottom:${D.toFixed(2)}%`}
2982
+ >${this.markerText(v)}</span
2983
+ >`
2929
2984
  )}
2930
2985
  ${[...c].reverse().map(() => n`<span class="baht-chart-grid-rule" aria-hidden="true"></span>`)}
2931
2986
  <div class="baht-bar-chart-columns">
2932
- ${Array.from({ length: r }, (d, v) => {
2933
- const z = i[v] || "(empty)", P = `${z}: ${e.map((q) => `${q.name ? `${q.name} ` : ""}${this.fmt(q.values[v] ?? 0)}`).join(", ")}`;
2987
+ ${Array.from({ length: r }, (v, D) => {
2988
+ const G = i[D] || "(empty)", C = `${G}: ${e.map((R) => `${R.name ? `${R.name} ` : ""}${this.fmt(R.values[D] ?? 0)}`).join(", ")}`;
2934
2989
  return n`<div
2935
2990
  class="baht-bar-chart-column"
2936
2991
  style=${this.band > 0 ? `flex:0 0 auto;width:${this.band}px` : h}
2937
2992
  tabindex="0"
2938
2993
  role="button"
2939
- aria-label=${P}
2940
- @pointermove=${(q) => this.showTip(q, P)}
2994
+ aria-label=${C}
2995
+ @pointermove=${(R) => this.showTip(R, C)}
2941
2996
  @pointerleave=${() => this.hideTip()}
2942
- @focus=${(q) => this.showTip(q, P)}
2997
+ @focus=${(R) => this.showTip(R, C)}
2943
2998
  @blur=${() => this.hideTip()}
2944
2999
  >
2945
3000
  <div class="baht-bar-chart-column-bars">
2946
3001
  ${e.map(
2947
- (q, ve) => n`<div
3002
+ (R, d) => n`<div
2948
3003
  class="baht-bar-chart-col"
2949
- style=${`height:${Math.max(1, (q.values[v] ?? 0) / o * 100)}%;width:${p}px;background:${this.colorFor(ve, v, s)}`}
3004
+ style=${`height:${Math.max(1, (R.values[D] ?? 0) / o * 100)}%;width:${p}px;background:${this.colorFor(d, D, s)}`}
2950
3005
  ></div>`
2951
3006
  )}
2952
3007
  ${f ? n`<div
2953
3008
  class="baht-bar-chart-col baht-bar-chart-col--compare"
2954
- style=${`height:${Math.max(1, (this.compare[v] ?? 0) / o * 100)}%;width:${Math.min(8, p)}px`}
3009
+ style=${`height:${Math.max(1, (this.compare[D] ?? 0) / o * 100)}%;width:${Math.min(8, p)}px`}
2955
3010
  ></div>` : h}
2956
3011
  </div>
2957
- ${v % w === 0 ? n`<span class="baht-bar-chart-xlabel">${z}</span>` : h}
3012
+ ${D % P === 0 ? n`<span class="baht-bar-chart-xlabel">${G}</span>` : h}
2958
3013
  </div>`;
2959
3014
  })}
2960
3015
  </div>
2961
3016
  </div>
2962
3017
  </div>
2963
3018
  ${this.renderTooltip()}
2964
- ${this.renderLegend(e.map((d, v) => ({ label: d.name, color: nt(v, d.color) })))}
3019
+ ${this.renderLegend(this.legendEntries(e))}
2965
3020
  ${this.tableTwin(e, i, r)}
2966
3021
  </div>`;
2967
3022
  }
2968
3023
  };
2969
3024
  V([
2970
3025
  l({ attribute: !1 })
2971
- ], R.prototype, "groups", 2);
3026
+ ], z.prototype, "groups", 2);
2972
3027
  V([
2973
3028
  l({ attribute: !1 })
2974
- ], R.prototype, "series", 2);
3029
+ ], z.prototype, "series", 2);
2975
3030
  V([
2976
3031
  l({ attribute: !1 })
2977
- ], R.prototype, "categories", 2);
3032
+ ], z.prototype, "categories", 2);
2978
3033
  V([
2979
3034
  l()
2980
- ], R.prototype, "orientation", 2);
3035
+ ], z.prototype, "orientation", 2);
2981
3036
  V([
2982
3037
  l({ type: Boolean })
2983
- ], R.prototype, "stacked", 2);
3038
+ ], z.prototype, "stacked", 2);
2984
3039
  V([
2985
3040
  l({ attribute: !1 })
2986
- ], R.prototype, "compare", 2);
3041
+ ], z.prototype, "compare", 2);
3042
+ V([
3043
+ l({ attribute: "compare-label" })
3044
+ ], z.prototype, "compareLabel", 2);
2987
3045
  V([
2988
3046
  l({ attribute: !1 })
2989
- ], R.prototype, "markers", 2);
3047
+ ], z.prototype, "markers", 2);
2990
3048
  V([
2991
3049
  l({ attribute: "label-values" })
2992
- ], R.prototype, "labelValues", 2);
3050
+ ], z.prototype, "labelValues", 2);
2993
3051
  V([
2994
3052
  l({ type: Number })
2995
- ], R.prototype, "emphasis", 2);
3053
+ ], z.prototype, "emphasis", 2);
2996
3054
  V([
2997
3055
  l()
2998
- ], R.prototype, "color", 2);
3056
+ ], z.prototype, "color", 2);
2999
3057
  V([
3000
3058
  l()
3001
- ], R.prototype, "label", 2);
3059
+ ], z.prototype, "label", 2);
3002
3060
  V([
3003
- $()
3004
- ], R.prototype, "band", 2);
3005
- R = V([
3061
+ y()
3062
+ ], z.prototype, "band", 2);
3063
+ z = V([
3006
3064
  b("baht-bar-chart")
3007
- ], R);
3008
- var Xa = Object.defineProperty, Za = Object.getOwnPropertyDescriptor, lt = (t, e, i, a) => {
3065
+ ], z);
3066
+ var Xa = Object.defineProperty, Za = Object.getOwnPropertyDescriptor, nt = (t, e, i, a) => {
3009
3067
  for (var s = a > 1 ? void 0 : a ? Za(e, i) : e, r = t.length - 1, o; r >= 0; r--)
3010
3068
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
3011
3069
  return a && s && Xa(e, i, s), s;
3012
3070
  };
3013
- const es = 640, xe = 260, E = { top: 14, right: 72, bottom: 30, left: 60 };
3014
- let Q = class extends tt {
3071
+ const es = 640, xe = 260, B = { top: 14, right: 72, bottom: 30, left: 60 };
3072
+ let et = class extends st {
3015
3073
  constructor() {
3016
3074
  super(...arguments), this.series = [], this.categories = [], this.area = !1, this.markers = [], this.forecast = 0, this.baseline = null, this.labelValues = "ends", this.label = "", this.crosshairAt = null;
3017
3075
  }
3018
3076
  get plot() {
3019
- return { w: es - E.left - E.right, h: xe - E.top - E.bottom };
3077
+ return { w: es - B.left - B.right, h: xe - B.top - B.bottom };
3020
3078
  }
3021
3079
  render() {
3022
3080
  const t = this.hold({
3023
- series: (this.series ?? []).filter((u) => {
3024
- var x;
3025
- return u && ((x = u.values) == null ? void 0 : x.length);
3081
+ series: (this.series ?? []).filter((d) => {
3082
+ var _;
3083
+ return d && ((_ = d.values) == null ? void 0 : _.length);
3026
3084
  }),
3027
3085
  categories: this.categories ?? []
3028
3086
  }), { series: e, categories: i } = t;
3029
3087
  if (e.length === 0)
3030
3088
  return n`<div class=${this.rootClass("baht-line-chart")}>${this.renderEmpty()}</div>`;
3031
- const a = Math.max(...e.map((u) => u.values.length)), s = e.flatMap((u) => u.values).filter((u) => Number.isFinite(u)), r = Math.max(0, ...s, ...(this.markers ?? []).map((u) => u.value)), o = Be(r, 4), c = o[o.length - 1] ?? 1, { w: f, h: g } = this.plot, _ = le([0, Math.max(1, a - 1)], [E.left, E.left + f]), p = le([0, c], [E.top + g, E.top]), w = Math.max(0, a - 1 - Math.max(0, this.forecast)), C = (u, x, Z) => u.slice(x, Z + 1).map((st, at) => `${at === 0 ? "M" : "L"}${_(x + at).toFixed(2)},${p(st).toFixed(2)}`).join(" "), d = e.map((u, x) => ({
3032
- i: x,
3033
- name: u.name,
3034
- value: u.values[u.values.length - 1] ?? 0,
3035
- yPos: p(u.values[u.values.length - 1] ?? 0),
3036
- color: nt(x, u.color)
3037
- })), v = [...d].sort((u, x) => u.yPos - x.yPos), z = v.some((u, x) => x > 0 && u.yPos - v[x - 1].yPos < 15), P = this.labelValues === "ends" && !z, q = Math.max(1, Math.ceil(a / 8)), ve = this.label || `Line chart, ${e.length} series over ${a} points. ${e.map((u, x) => `${u.name}: ${this.fmt(d[x].value)} at the end`).join(". ")}`;
3089
+ const a = Math.max(...e.map((d) => d.values.length)), s = e.flatMap((d) => d.values).filter((d) => Number.isFinite(d)), r = Math.max(0, ...s, ...(this.markers ?? []).map((d) => d.value)), o = Be(r, 4), c = o[o.length - 1] ?? 1, { w: f, h: $ } = this.plot, w = ne([0, Math.max(1, a - 1)], [B.left, B.left + f]), p = ne([0, c], [B.top + $, B.top]), P = Math.max(0, a - 1 - Math.max(0, this.forecast)), x = (d, _, tt) => d.slice(_, tt + 1).map((at, it) => `${it === 0 ? "M" : "L"}${w(_ + it).toFixed(2)},${p(at).toFixed(2)}`).join(" "), u = e.map((d, _) => ({
3090
+ i: _,
3091
+ name: d.name,
3092
+ value: d.values[d.values.length - 1] ?? 0,
3093
+ yPos: p(d.values[d.values.length - 1] ?? 0),
3094
+ color: ft(_, d.color)
3095
+ })), v = [...u].sort((d, _) => d.yPos - _.yPos), D = v.some((d, _) => _ > 0 && d.yPos - v[_ - 1].yPos < 15), G = this.labelValues === "ends" && !D, C = Math.max(1, Math.ceil(a / 8)), R = this.label || `Line chart, ${e.length} series over ${a} points. ${e.map((d, _) => `${d.name}: ${this.fmt(u[_].value)} at the end`).join(". ")}`;
3038
3096
  return n`<div class=${this.rootClass("baht-line-chart")}>
3039
3097
  <svg
3040
3098
  class="baht-chart-svg"
3041
3099
  viewBox="0 0 ${es} ${xe}"
3042
3100
  preserveAspectRatio="xMidYMid meet"
3043
3101
  role="img"
3044
- aria-label=${ve}
3102
+ aria-label=${R}
3045
3103
  >
3046
3104
  ${o.map(
3047
- (u) => A`
3048
- <line class="baht-chart-grid-line" x1=${E.left} x2=${E.left + f}
3049
- y1=${p(u).toFixed(2)} y2=${p(u).toFixed(2)}/>
3050
- <text class="baht-chart-tick" x=${E.left - 8} y=${(p(u) + 4).toFixed(2)}
3051
- text-anchor="end">${this.fmt(u)}</text>`
3105
+ (d) => L`
3106
+ <line class="baht-chart-grid-line" x1=${B.left} x2=${B.left + f}
3107
+ y1=${p(d).toFixed(2)} y2=${p(d).toFixed(2)}/>
3108
+ <text class="baht-chart-tick" x=${B.left - 8} y=${(p(d) + 4).toFixed(2)}
3109
+ text-anchor="end">${this.fmt(d)}</text>`
3052
3110
  )}
3053
3111
  ${this.baseline != null ? [
3054
- A`<line class="baht-chart-baseline" x1=${E.left} x2=${E.left + f}
3112
+ L`<line class="baht-chart-baseline" x1=${B.left} x2=${B.left + f}
3055
3113
  y1=${p(this.baseline).toFixed(2)} y2=${p(this.baseline).toFixed(2)}/>`
3056
3114
  ] : []}
3057
3115
  ${(this.markers ?? []).map(
3058
- (u) => A`
3059
- <line class="baht-chart-marker-line" x1=${E.left} x2=${E.left + f}
3060
- y1=${p(u.value).toFixed(2)} y2=${p(u.value).toFixed(2)}/>
3061
- <text class="baht-chart-marker-label" x=${E.left + f} y=${(p(u.value) - 5).toFixed(2)}
3062
- text-anchor="end">${u.label ?? this.fmt(u.value)}</text>`
3116
+ (d) => L`
3117
+ <line class="baht-chart-marker-line" x1=${B.left} x2=${B.left + f}
3118
+ y1=${p(d.value).toFixed(2)} y2=${p(d.value).toFixed(2)}/>
3119
+ <text class="baht-chart-marker-label" x=${B.left + f} y=${(p(d.value) - 5).toFixed(2)}
3120
+ text-anchor="end">${d.label ?? this.fmt(d.value)}</text>`
3063
3121
  )}
3064
- ${this.area && e.length === 1 ? A`<path class="baht-chart-area" fill=${nt(0, e[0].color)}
3065
- d=${`${C(e[0].values, 0, a - 1)} L${_(a - 1).toFixed(2)},${p(0).toFixed(2)} L${_(0).toFixed(2)},${p(0).toFixed(2)} Z`}/>` : h}
3066
- ${e.map((u, x) => {
3067
- const Z = nt(x, u.color), st = [
3068
- A`<path class="baht-chart-line" d=${C(u.values, 0, w)} stroke=${Z} fill="none"/>`
3122
+ ${this.area && e.length === 1 ? L`<path class="baht-chart-area" fill=${ft(0, e[0].color)}
3123
+ d=${`${x(e[0].values, 0, a - 1)} L${w(a - 1).toFixed(2)},${p(0).toFixed(2)} L${w(0).toFixed(2)},${p(0).toFixed(2)} Z`}/>` : h}
3124
+ ${e.map((d, _) => {
3125
+ const tt = ft(_, d.color), at = [
3126
+ L`<path class="baht-chart-line" d=${x(d.values, 0, P)} stroke=${tt} fill="none"/>`
3069
3127
  ];
3070
- return w < a - 1 && st.push(
3071
- A`<path class="baht-chart-line baht-chart-line--forecast" d=${C(u.values, w, a - 1)}
3072
- stroke=${Z} fill="none"/>`
3073
- ), st.push(
3074
- A`<circle class="baht-chart-end-dot" cx=${_(a - 1).toFixed(2)}
3075
- cy=${p(u.values[u.values.length - 1] ?? 0).toFixed(2)} r="4" fill=${Z}/>`
3076
- ), st;
3128
+ return P < a - 1 && at.push(
3129
+ L`<path class="baht-chart-line baht-chart-line--forecast" d=${x(d.values, P, a - 1)}
3130
+ stroke=${tt} fill="none"/>`
3131
+ ), at.push(
3132
+ L`<circle class="baht-chart-end-dot" cx=${w(a - 1).toFixed(2)}
3133
+ cy=${p(d.values[d.values.length - 1] ?? 0).toFixed(2)} r="4" fill=${tt}/>`
3134
+ ), at;
3077
3135
  })}
3078
- ${P ? d.map(
3079
- (u) => A`
3080
- <text class="baht-chart-end-label" x=${_(a - 1) + 10} y=${(u.yPos + 4).toFixed(2)}
3081
- text-anchor="start">${this.fmt(u.value)}</text>`
3136
+ ${G ? u.map(
3137
+ (d) => L`
3138
+ <text class="baht-chart-end-label" x=${w(a - 1) + 10} y=${(d.yPos + 4).toFixed(2)}
3139
+ text-anchor="start">${this.fmt(d.value)}</text>`
3082
3140
  ) : h}
3083
3141
  ${i.map(
3084
- (u, x) => x % q === 0 ? A`<text class="baht-chart-tick" x=${_(x).toFixed(2)} y=${xe - 10} text-anchor="middle">${u}</text>` : h
3142
+ (d, _) => _ % C === 0 ? L`<text class="baht-chart-tick" x=${w(_).toFixed(2)} y=${xe - 10} text-anchor="middle">${d}</text>` : h
3085
3143
  )}
3086
- ${Array.from({ length: a }, (u, x) => {
3087
- const Z = f / Math.max(1, a - 1), st = `${i[x] ?? `Point ${x + 1}`}: ${e.map((at) => `${at.name} ${this.fmt(at.values[x] ?? 0)}`).join(", ")}`;
3088
- return A`<rect class="baht-chart-hit" x=${(_(x) - Z / 2).toFixed(2)} y=${E.top}
3089
- width=${Math.max(24, Z).toFixed(2)} height=${g} tabindex="0" role="button"
3090
- aria-label=${st}
3091
- @pointermove=${(at) => this.onHover(at, x, st)}
3144
+ ${Array.from({ length: a }, (d, _) => {
3145
+ const tt = f / Math.max(1, a - 1), at = `${i[_] ?? `Point ${_ + 1}`}: ${e.map((it) => `${it.name} ${this.fmt(it.values[_] ?? 0)}`).join(", ")}`;
3146
+ return L`<rect class="baht-chart-hit" x=${(w(_) - tt / 2).toFixed(2)} y=${B.top}
3147
+ width=${Math.max(24, tt).toFixed(2)} height=${$} tabindex="0" role="button"
3148
+ aria-label=${at}
3149
+ @pointermove=${(it) => this.onHover(it, _, at)}
3092
3150
  @pointerleave=${() => this.onLeave()}
3093
- @focus=${(at) => this.onHover(at, x, st)}
3151
+ @focus=${(it) => this.onHover(it, _, at)}
3094
3152
  @blur=${() => this.onLeave()}/>`;
3095
3153
  })}
3096
- ${this.crosshairAt != null ? A`<line class="baht-chart-crosshair" x1=${_(this.crosshairAt).toFixed(2)}
3097
- x2=${_(this.crosshairAt).toFixed(2)} y1=${E.top} y2=${E.top + g}/>` : h}
3154
+ ${this.crosshairAt != null ? L`<line class="baht-chart-crosshair" x1=${w(this.crosshairAt).toFixed(2)}
3155
+ x2=${w(this.crosshairAt).toFixed(2)} y1=${B.top} y2=${B.top + $}/>` : h}
3098
3156
  </svg>
3099
3157
  ${this.renderTooltip()}
3100
3158
  ${this.renderLegend(
3101
- e.map((u, x) => ({ label: u.name, color: nt(x, u.color) })),
3159
+ e.map((d, _) => ({ label: d.name, color: ft(_, d.color) })),
3102
3160
  "line"
3103
3161
  )}
3104
- ${this.showTable ? be(
3162
+ ${this.showTable ? fe(
3105
3163
  this.label || "Line chart data",
3106
- ["Point", ...e.map((u) => u.name)],
3107
- Array.from({ length: a }, (u, x) => [
3108
- i[x] ?? `Point ${x + 1}`,
3109
- ...e.map((Z) => this.fmt(Z.values[x] ?? 0))
3164
+ ["Point", ...e.map((d) => d.name)],
3165
+ Array.from({ length: a }, (d, _) => [
3166
+ i[_] ?? `Point ${_ + 1}`,
3167
+ ...e.map((tt) => this.fmt(tt.values[_] ?? 0))
3110
3168
  ])
3111
3169
  ) : h}
3112
3170
  </div>`;
@@ -3118,39 +3176,39 @@ let Q = class extends tt {
3118
3176
  this.crosshairAt = null, this.requestUpdate(), this.hideTip();
3119
3177
  }
3120
3178
  };
3121
- lt([
3179
+ nt([
3122
3180
  l({ attribute: !1 })
3123
- ], Q.prototype, "series", 2);
3124
- lt([
3181
+ ], et.prototype, "series", 2);
3182
+ nt([
3125
3183
  l({ attribute: !1 })
3126
- ], Q.prototype, "categories", 2);
3127
- lt([
3184
+ ], et.prototype, "categories", 2);
3185
+ nt([
3128
3186
  l({ type: Boolean })
3129
- ], Q.prototype, "area", 2);
3130
- lt([
3187
+ ], et.prototype, "area", 2);
3188
+ nt([
3131
3189
  l({ attribute: !1 })
3132
- ], Q.prototype, "markers", 2);
3133
- lt([
3190
+ ], et.prototype, "markers", 2);
3191
+ nt([
3134
3192
  l({ type: Number })
3135
- ], Q.prototype, "forecast", 2);
3136
- lt([
3193
+ ], et.prototype, "forecast", 2);
3194
+ nt([
3137
3195
  l({ type: Number })
3138
- ], Q.prototype, "baseline", 2);
3139
- lt([
3196
+ ], et.prototype, "baseline", 2);
3197
+ nt([
3140
3198
  l({ attribute: "label-values" })
3141
- ], Q.prototype, "labelValues", 2);
3142
- lt([
3199
+ ], et.prototype, "labelValues", 2);
3200
+ nt([
3143
3201
  l()
3144
- ], Q.prototype, "label", 2);
3145
- Q = lt([
3202
+ ], et.prototype, "label", 2);
3203
+ et = nt([
3146
3204
  b("baht-line-chart")
3147
- ], Q);
3148
- var Qa = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, wt = (t, e, i, a) => {
3205
+ ], et);
3206
+ var Qa = Object.defineProperty, ti = Object.getOwnPropertyDescriptor, xt = (t, e, i, a) => {
3149
3207
  for (var s = a > 1 ? void 0 : a ? ti(e, i) : e, r = t.length - 1, o; r >= 0; r--)
3150
3208
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
3151
3209
  return a && s && Qa(e, i, s), s;
3152
3210
  };
3153
- const _e = 22, Nt = 24, ss = 34, ke = 18, ei = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
3211
+ const _e = 22, qt = 24, ss = 34, ke = 18, ei = ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"];
3154
3212
  function Pe(t) {
3155
3213
  const e = /^(\d{4})-(\d{2})-(\d{2})/.exec(t ?? "");
3156
3214
  return e ? new Date(Date.UTC(+e[1], +e[2] - 1, +e[3])) : null;
@@ -3158,7 +3216,7 @@ function Pe(t) {
3158
3216
  function Oe(t) {
3159
3217
  return t.toISOString().slice(0, 10);
3160
3218
  }
3161
- let pt = class extends tt {
3219
+ let pt = class extends st {
3162
3220
  constructor() {
3163
3221
  super(...arguments), this.values = [], this.from = "", this.to = "", this.lessLabel = "Less", this.moreLabel = "More", this.label = "";
3164
3222
  }
@@ -3170,33 +3228,33 @@ let pt = class extends tt {
3170
3228
  const t = this.hold({ values: this.values ?? [], range: this.range }), e = t.range;
3171
3229
  if (!e || t.values.length === 0)
3172
3230
  return n`<div class=${this.rootClass("baht-heatmap")}>${this.renderEmpty()}</div>`;
3173
- const i = new Map(t.values.map((d) => [d.date.slice(0, 10), d.value])), a = [], s = new Date(e.start), r = (e.start.getUTCDay() + 6) % 7;
3231
+ const i = new Map(t.values.map((u) => [u.date.slice(0, 10), u.value])), a = [], s = new Date(e.start), r = (e.start.getUTCDay() + 6) % 7;
3174
3232
  let o = 0;
3175
3233
  for (; +s <= +e.end; ) {
3176
- const d = Oe(s), v = (s.getUTCDay() + 6) % 7, z = Math.floor((r + o) / 7);
3177
- a.push({ iso: d, value: i.has(d) ? i.get(d) : null, col: z, row: v }), s.setUTCDate(s.getUTCDate() + 1), o += 1;
3234
+ const u = Oe(s), v = (s.getUTCDay() + 6) % 7, D = Math.floor((r + o) / 7);
3235
+ a.push({ iso: u, value: i.has(u) ? i.get(u) : null, col: D, row: v }), s.setUTCDate(s.getUTCDate() + 1), o += 1;
3178
3236
  }
3179
- const c = Math.max(1, ...a.map((d) => d.col + 1)), f = ss + c * Nt, g = ke + 7 * Nt + 4, _ = Math.max(1, ...a.map((d) => d.value ?? 0)), p = (d) => Math.min(4, Math.max(0, Math.ceil(d / _ * 5) - 1)), w = a.reduce((d, v) => d + (v.value ?? 0), 0), C = this.label || `Calendar heatmap, ${a.length} days from ${Oe(e.start)} to ${Oe(e.end)}, total ${this.fmt(w)}`;
3237
+ const c = Math.max(1, ...a.map((u) => u.col + 1)), f = ss + c * qt, $ = ke + 7 * qt + 4, w = Math.max(1, ...a.map((u) => u.value ?? 0)), p = (u) => Math.min(4, Math.max(0, Math.ceil(u / w * 5) - 1)), P = a.reduce((u, v) => u + (v.value ?? 0), 0), x = this.label || `Calendar heatmap, ${a.length} days from ${Oe(e.start)} to ${Oe(e.end)}, total ${this.fmt(P)}`;
3180
3238
  return n`<div class=${this.rootClass("baht-heatmap")}>
3181
3239
  <svg
3182
3240
  class="baht-chart-svg baht-heatmap-svg"
3183
3241
  width=${f}
3184
- height=${g}
3185
- viewBox="0 0 ${f} ${g}"
3242
+ height=${$}
3243
+ viewBox="0 0 ${f} ${$}"
3186
3244
  preserveAspectRatio="xMinYMin meet"
3187
3245
  role="img"
3188
- aria-label=${C}
3246
+ aria-label=${x}
3189
3247
  >
3190
3248
  ${ei.map(
3191
- (d, v) => v % 2 === 0 ? A`<text class="baht-chart-tick" x="0" y=${ke + v * Nt + _e / 2 + 4}>${d}</text>` : h
3249
+ (u, v) => v % 2 === 0 ? L`<text class="baht-chart-tick" x="0" y=${ke + v * qt + _e / 2 + 4}>${u}</text>` : h
3192
3250
  )}
3193
- ${a.map((d) => {
3194
- const v = d.value == null ? `${d.iso}: no activity` : `${d.iso}: ${this.fmt(d.value)}`, z = d.value == null || d.value <= 0 ? "var(--baht-chart-grid)" : Xe(p(d.value));
3195
- return A`<rect class="baht-heatmap-cell" x=${ss + d.col * Nt} y=${ke + d.row * Nt}
3196
- width=${_e} height=${_e} rx="3" fill=${z} tabindex="0" role="button" aria-label=${v}
3197
- @pointermove=${(P) => this.showTip(P, v)}
3251
+ ${a.map((u) => {
3252
+ const v = u.value == null ? `${u.iso}: no activity` : `${u.iso}: ${this.fmt(u.value)}`, D = u.value == null || u.value <= 0 ? "var(--baht-chart-grid)" : Xe(p(u.value));
3253
+ return L`<rect class="baht-heatmap-cell" x=${ss + u.col * qt} y=${ke + u.row * qt}
3254
+ width=${_e} height=${_e} rx="3" fill=${D} tabindex="0" role="button" aria-label=${v}
3255
+ @pointermove=${(G) => this.showTip(G, v)}
3198
3256
  @pointerleave=${() => this.hideTip()}
3199
- @focus=${(P) => this.showTip(P, v)}
3257
+ @focus=${(G) => this.showTip(G, v)}
3200
3258
  @blur=${() => this.hideTip()}/>`;
3201
3259
  })}
3202
3260
  </svg>
@@ -3204,73 +3262,79 @@ let pt = class extends tt {
3204
3262
  <div class="baht-heatmap-scale">
3205
3263
  <span class="baht-heatmap-scale-label">${this.lessLabel}</span>
3206
3264
  ${[0, 1, 2, 3, 4].map(
3207
- (d) => n`<span
3265
+ (u) => n`<span
3208
3266
  class="baht-chart-swatch"
3209
- style=${`background:${Xe(d)}`}
3267
+ style=${`background:${Xe(u)}`}
3210
3268
  aria-hidden="true"
3211
3269
  ></span>`
3212
3270
  )}
3213
3271
  <span class="baht-heatmap-scale-label">${this.moreLabel}</span>
3214
3272
  </div>
3215
- ${this.showTable ? be(
3273
+ ${this.showTable ? fe(
3216
3274
  this.label || "Calendar heatmap data",
3217
3275
  ["Date", "Value"],
3218
- a.map((d) => [d.iso, d.value == null ? "—" : this.fmt(d.value)])
3276
+ a.map((u) => [u.iso, u.value == null ? "—" : this.fmt(u.value)])
3219
3277
  ) : h}
3220
3278
  </div>`;
3221
3279
  }
3222
3280
  };
3223
- wt([
3281
+ xt([
3224
3282
  l({ attribute: !1 })
3225
3283
  ], pt.prototype, "values", 2);
3226
- wt([
3284
+ xt([
3227
3285
  l()
3228
3286
  ], pt.prototype, "from", 2);
3229
- wt([
3287
+ xt([
3230
3288
  l()
3231
3289
  ], pt.prototype, "to", 2);
3232
- wt([
3290
+ xt([
3233
3291
  l({ attribute: "less-label" })
3234
3292
  ], pt.prototype, "lessLabel", 2);
3235
- wt([
3293
+ xt([
3236
3294
  l({ attribute: "more-label" })
3237
3295
  ], pt.prototype, "moreLabel", 2);
3238
- wt([
3296
+ xt([
3239
3297
  l()
3240
3298
  ], pt.prototype, "label", 2);
3241
- pt = wt([
3299
+ pt = xt([
3242
3300
  b("baht-heatmap")
3243
3301
  ], pt);
3244
- var si = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, et = (t, e, i, a) => {
3302
+ var si = Object.defineProperty, ai = Object.getOwnPropertyDescriptor, Z = (t, e, i, a) => {
3245
3303
  for (var s = a > 1 ? void 0 : a ? ai(e, i) : e, r = t.length - 1, o; r >= 0; r--)
3246
3304
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
3247
3305
  return a && s && si(e, i, s), s;
3248
3306
  };
3249
- let W = class extends y {
3307
+ let U = class extends g {
3250
3308
  constructor() {
3251
- super(...arguments), this.value = 0, this.max = 100, this.label = "", this.format = "number", this.currency = "THB", this.thresholds = { warning: 0.8, danger: 1 }, this.expected = null, this.overLabel = "Over budget", this.nearLabel = "Near limit";
3309
+ super(...arguments), this.value = 0, this.max = 100, this.label = "", this.format = "number", this.currency = "THB", this.thresholds = { warning: 0.8, danger: 1 }, this.expected = null, this.overLabel = "Over budget", this.atLabel = "At budget", this.nearLabel = "Near limit";
3252
3310
  }
3253
3311
  get fraction() {
3254
3312
  const t = this.max || 1, e = this.value / t;
3255
3313
  return Number.isFinite(e) ? Math.max(0, e) : 0;
3256
3314
  }
3257
- /** `ok` | `warning` | `danger`, from the fraction and the thresholds. */
3315
+ /**
3316
+ * `ok` | `warning` | `danger`, from the fraction and the thresholds. `danger` is
3317
+ * strictly **above** its threshold: spending exactly the budget is not
3318
+ * overspending, so it reads as the warning tone with an "At budget" status.
3319
+ * `warning` stays inclusive (`>=`).
3320
+ */
3258
3321
  get severity() {
3259
3322
  const { warning: t, danger: e } = this.thresholds ?? { warning: 0.8, danger: 1 }, i = this.fraction;
3260
- return i >= e ? "danger" : i >= t ? "warning" : "ok";
3323
+ return i > e ? "danger" : i >= t ? "warning" : "ok";
3261
3324
  }
3262
3325
  get statusText() {
3263
- const t = this.severity;
3264
- return t === "danger" ? this.overLabel : t === "warning" ? this.nearLabel : "";
3326
+ const { danger: t } = this.thresholds ?? { danger: 1 }, e = this.severity;
3327
+ return e === "danger" ? this.overLabel : e === "warning" ? this.fraction >= t ? this.atLabel : this.nearLabel : "";
3265
3328
  }
3266
3329
  render() {
3267
- const t = this.severity, e = Math.min(100, this.fraction * 100), i = (o) => qt(o, this.format, this.currency), a = this.expected != null && Number.isFinite(this.expected) && this.max ? Math.min(100, Math.max(0, this.expected / this.max * 100)) : null, s = `${i(this.value)} of ${i(this.max)}`, r = t === "danger" ? "!" : t === "warning" ? "△" : "";
3330
+ var c;
3331
+ const t = this.severity, e = Math.min(100, this.fraction * 100), i = (f) => Rt(f, this.format, this.currency), a = this.expected != null && Number.isFinite(this.expected) && this.max ? Math.min(100, Math.max(0, this.expected / this.max * 100)) : null, s = `${i(this.value)} of ${i(this.max)}`, r = t === "warning" && this.fraction >= (((c = this.thresholds) == null ? void 0 : c.danger) ?? 1), o = t === "danger" ? "!" : r ? "=" : t === "warning" ? "△" : "";
3268
3332
  return n`<div class="baht-meter baht-meter--${t}">
3269
3333
  <div class="baht-meter-head">
3270
3334
  ${this.label ? n`<span class="baht-meter-label">${this.label}</span>` : h}
3271
3335
  <span class="baht-meter-value">${s}</span>
3272
3336
  ${this.statusText ? n`<span class="baht-meter-status"
3273
- ><span class="baht-meter-icon" aria-hidden="true">${r}</span
3337
+ ><span class="baht-meter-icon" aria-hidden="true">${o}</span
3274
3338
  >${this.statusText}</span
3275
3339
  >` : h}
3276
3340
  </div>
@@ -3294,42 +3358,45 @@ let W = class extends y {
3294
3358
  </div>`;
3295
3359
  }
3296
3360
  };
3297
- et([
3361
+ Z([
3298
3362
  l({ type: Number })
3299
- ], W.prototype, "value", 2);
3300
- et([
3363
+ ], U.prototype, "value", 2);
3364
+ Z([
3301
3365
  l({ type: Number })
3302
- ], W.prototype, "max", 2);
3303
- et([
3366
+ ], U.prototype, "max", 2);
3367
+ Z([
3304
3368
  l()
3305
- ], W.prototype, "label", 2);
3306
- et([
3369
+ ], U.prototype, "label", 2);
3370
+ Z([
3307
3371
  l()
3308
- ], W.prototype, "format", 2);
3309
- et([
3372
+ ], U.prototype, "format", 2);
3373
+ Z([
3310
3374
  l()
3311
- ], W.prototype, "currency", 2);
3312
- et([
3375
+ ], U.prototype, "currency", 2);
3376
+ Z([
3313
3377
  l({ attribute: !1 })
3314
- ], W.prototype, "thresholds", 2);
3315
- et([
3378
+ ], U.prototype, "thresholds", 2);
3379
+ Z([
3316
3380
  l({ type: Number })
3317
- ], W.prototype, "expected", 2);
3318
- et([
3381
+ ], U.prototype, "expected", 2);
3382
+ Z([
3319
3383
  l({ attribute: "over-label" })
3320
- ], W.prototype, "overLabel", 2);
3321
- et([
3384
+ ], U.prototype, "overLabel", 2);
3385
+ Z([
3386
+ l({ attribute: "at-label" })
3387
+ ], U.prototype, "atLabel", 2);
3388
+ Z([
3322
3389
  l({ attribute: "near-label" })
3323
- ], W.prototype, "nearLabel", 2);
3324
- W = et([
3390
+ ], U.prototype, "nearLabel", 2);
3391
+ U = Z([
3325
3392
  b("baht-meter")
3326
- ], W);
3327
- var ii = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, fe = (t, e, i, a) => {
3393
+ ], U);
3394
+ var ii = Object.defineProperty, ri = Object.getOwnPropertyDescriptor, me = (t, e, i, a) => {
3328
3395
  for (var s = a > 1 ? void 0 : a ? ri(e, i) : e, r = t.length - 1, o; r >= 0; r--)
3329
3396
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
3330
3397
  return a && s && ii(e, i, s), s;
3331
3398
  };
3332
- let Ht = class extends y {
3399
+ let Gt = class extends g {
3333
3400
  constructor() {
3334
3401
  super(...arguments), this.icon = "🗂️", this.message = "Nothing to display", this.hint = "";
3335
3402
  }
@@ -3341,24 +3408,24 @@ let Ht = class extends y {
3341
3408
  </div>`;
3342
3409
  }
3343
3410
  };
3344
- fe([
3411
+ me([
3345
3412
  l()
3346
- ], Ht.prototype, "icon", 2);
3347
- fe([
3413
+ ], Gt.prototype, "icon", 2);
3414
+ me([
3348
3415
  l()
3349
- ], Ht.prototype, "message", 2);
3350
- fe([
3416
+ ], Gt.prototype, "message", 2);
3417
+ me([
3351
3418
  l()
3352
- ], Ht.prototype, "hint", 2);
3353
- Ht = fe([
3419
+ ], Gt.prototype, "hint", 2);
3420
+ Gt = me([
3354
3421
  b("baht-empty-state")
3355
- ], Ht);
3356
- var oi = Object.defineProperty, li = Object.getOwnPropertyDescriptor, Qt = (t, e, i, a) => {
3422
+ ], Gt);
3423
+ var oi = Object.defineProperty, li = Object.getOwnPropertyDescriptor, te = (t, e, i, a) => {
3357
3424
  for (var s = a > 1 ? void 0 : a ? li(e, i) : e, r = t.length - 1, o; r >= 0; r--)
3358
3425
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
3359
3426
  return a && s && oi(e, i, s), s;
3360
3427
  };
3361
- let Et = class extends y {
3428
+ let Bt = class extends g {
3362
3429
  constructor() {
3363
3430
  super(...arguments), this.icon = "⚠️", this.heading = "Something went wrong", this.message = "", this.retryLabel = "";
3364
3431
  }
@@ -3374,27 +3441,27 @@ let Et = class extends y {
3374
3441
  </div>`;
3375
3442
  }
3376
3443
  };
3377
- Qt([
3444
+ te([
3378
3445
  l()
3379
- ], Et.prototype, "icon", 2);
3380
- Qt([
3446
+ ], Bt.prototype, "icon", 2);
3447
+ te([
3381
3448
  l()
3382
- ], Et.prototype, "heading", 2);
3383
- Qt([
3449
+ ], Bt.prototype, "heading", 2);
3450
+ te([
3384
3451
  l()
3385
- ], Et.prototype, "message", 2);
3386
- Qt([
3452
+ ], Bt.prototype, "message", 2);
3453
+ te([
3387
3454
  l({ attribute: "retry-label" })
3388
- ], Et.prototype, "retryLabel", 2);
3389
- Et = Qt([
3455
+ ], Bt.prototype, "retryLabel", 2);
3456
+ Bt = te([
3390
3457
  b("baht-error-state")
3391
- ], Et);
3392
- var ni = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, xt = (t, e, i, a) => {
3458
+ ], Bt);
3459
+ var ni = Object.defineProperty, hi = Object.getOwnPropertyDescriptor, _t = (t, e, i, a) => {
3393
3460
  for (var s = a > 1 ? void 0 : a ? hi(e, i) : e, r = t.length - 1, o; r >= 0; r--)
3394
3461
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
3395
3462
  return a && s && ni(e, i, s), s;
3396
3463
  };
3397
- let dt = class extends y {
3464
+ let dt = class extends g {
3398
3465
  constructor() {
3399
3466
  super(...arguments), this.value = {}, this.keyPlaceholder = "key", this.valuePlaceholder = "value", this.add_label = "Add row", this.disabled = !1, this.rows = [{ k: "", v: "" }], this.syncedJson = "";
3400
3467
  }
@@ -3451,7 +3518,7 @@ let dt = class extends y {
3451
3518
  aria-label="Remove row ${e + 1}"
3452
3519
  ?disabled=${this.disabled}
3453
3520
  @click=${() => this.commit(this.rows.filter((i, a) => a !== e))}
3454
- >${H("close")}</button>
3521
+ >${W("close")}</button>
3455
3522
  </div>`
3456
3523
  )}
3457
3524
  <button
@@ -3459,37 +3526,37 @@ let dt = class extends y {
3459
3526
  class="baht-keyvalue-add"
3460
3527
  ?disabled=${this.disabled}
3461
3528
  @click=${this.addRow}
3462
- >${H("plus")}${this.add_label}</button>
3529
+ >${W("plus")}${this.add_label}</button>
3463
3530
  </div>`;
3464
3531
  }
3465
3532
  };
3466
- xt([
3533
+ _t([
3467
3534
  l({ attribute: !1 })
3468
3535
  ], dt.prototype, "value", 2);
3469
- xt([
3536
+ _t([
3470
3537
  l({ attribute: "key-placeholder" })
3471
3538
  ], dt.prototype, "keyPlaceholder", 2);
3472
- xt([
3539
+ _t([
3473
3540
  l({ attribute: "value-placeholder" })
3474
3541
  ], dt.prototype, "valuePlaceholder", 2);
3475
- xt([
3542
+ _t([
3476
3543
  l({ attribute: "add-label" })
3477
3544
  ], dt.prototype, "add_label", 2);
3478
- xt([
3545
+ _t([
3479
3546
  l({ type: Boolean })
3480
3547
  ], dt.prototype, "disabled", 2);
3481
- xt([
3482
- $()
3548
+ _t([
3549
+ y()
3483
3550
  ], dt.prototype, "rows", 2);
3484
- dt = xt([
3551
+ dt = _t([
3485
3552
  b("baht-keyvalue-editor")
3486
3553
  ], dt);
3487
- var ci = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, T = (t, e, i, a) => {
3554
+ var ci = Object.defineProperty, pi = Object.getOwnPropertyDescriptor, A = (t, e, i, a) => {
3488
3555
  for (var s = a > 1 ? void 0 : a ? pi(e, i) : e, r = t.length - 1, o; r >= 0; r--)
3489
3556
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
3490
3557
  return a && s && ci(e, i, s), s;
3491
3558
  };
3492
- let j = class extends y {
3559
+ let j = class extends g {
3493
3560
  constructor() {
3494
3561
  super(...arguments), this.label = "Reference", this.value = "", this.display = "", this.placeholder = "", this.disabled = !1, this.invalid = !1, this.href = "", this.lookupLabel = "Look up records", this.debounce = 200, this.fetcher = null, this.open = !1, this.term = "", this.options = [], this.loading = !1, this.activeIndex = -1, this.fetchSeq = 0, this.onDocMousedown = (t) => {
3495
3562
  this.contains(t.target) || this.close();
@@ -3583,7 +3650,7 @@ let j = class extends y {
3583
3650
  aria-label="Clear"
3584
3651
  @mousedown=${(e) => e.preventDefault()}
3585
3652
  @click=${() => this.clear()}
3586
- >${H("close")}</button>` : h}
3653
+ >${W("close")}</button>` : h}
3587
3654
  </div>
3588
3655
  <button
3589
3656
  type="button"
@@ -3592,13 +3659,13 @@ let j = class extends y {
3592
3659
  title=${this.lookupLabel}
3593
3660
  ?disabled=${this.disabled}
3594
3661
  @click=${() => this.open ? this.close() : this.openLookup()}
3595
- >${H("search")}</button>
3662
+ >${W("search")}</button>
3596
3663
  ${this.value && this.href ? n`<a
3597
3664
  class="baht-refpicker-open"
3598
3665
  href=${this.href}
3599
3666
  aria-label="Open record"
3600
3667
  title="Open record"
3601
- >${H("external")}</a>` : h}
3668
+ >${W("external")}</a>` : h}
3602
3669
  <div
3603
3670
  class="baht-refpicker-list"
3604
3671
  id=${this.listboxId}
@@ -3625,63 +3692,63 @@ let j = class extends y {
3625
3692
  </div>`;
3626
3693
  }
3627
3694
  };
3628
- T([
3695
+ A([
3629
3696
  l()
3630
3697
  ], j.prototype, "label", 2);
3631
- T([
3698
+ A([
3632
3699
  l()
3633
3700
  ], j.prototype, "value", 2);
3634
- T([
3701
+ A([
3635
3702
  l()
3636
3703
  ], j.prototype, "display", 2);
3637
- T([
3704
+ A([
3638
3705
  l()
3639
3706
  ], j.prototype, "placeholder", 2);
3640
- T([
3707
+ A([
3641
3708
  l({ type: Boolean })
3642
3709
  ], j.prototype, "disabled", 2);
3643
- T([
3710
+ A([
3644
3711
  l({ type: Boolean })
3645
3712
  ], j.prototype, "invalid", 2);
3646
- T([
3713
+ A([
3647
3714
  l()
3648
3715
  ], j.prototype, "href", 2);
3649
- T([
3716
+ A([
3650
3717
  l({ attribute: "lookup-label" })
3651
3718
  ], j.prototype, "lookupLabel", 2);
3652
- T([
3719
+ A([
3653
3720
  l({ type: Number })
3654
3721
  ], j.prototype, "debounce", 2);
3655
- T([
3722
+ A([
3656
3723
  l({ attribute: !1 })
3657
3724
  ], j.prototype, "fetcher", 2);
3658
- T([
3659
- $()
3725
+ A([
3726
+ y()
3660
3727
  ], j.prototype, "open", 2);
3661
- T([
3662
- $()
3728
+ A([
3729
+ y()
3663
3730
  ], j.prototype, "term", 2);
3664
- T([
3665
- $()
3731
+ A([
3732
+ y()
3666
3733
  ], j.prototype, "options", 2);
3667
- T([
3668
- $()
3734
+ A([
3735
+ y()
3669
3736
  ], j.prototype, "loading", 2);
3670
- T([
3671
- $()
3737
+ A([
3738
+ y()
3672
3739
  ], j.prototype, "activeIndex", 2);
3673
- T([
3674
- Bt("input")
3740
+ A([
3741
+ It("input")
3675
3742
  ], j.prototype, "inputEl", 2);
3676
- j = T([
3743
+ j = A([
3677
3744
  b("baht-reference-picker")
3678
3745
  ], j);
3679
- var di = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, I = (t, e, i, a) => {
3746
+ var di = Object.defineProperty, ui = Object.getOwnPropertyDescriptor, M = (t, e, i, a) => {
3680
3747
  for (var s = a > 1 ? void 0 : a ? ui(e, i) : e, r = t.length - 1, o; r >= 0; r--)
3681
3748
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
3682
3749
  return a && s && di(e, i, s), s;
3683
3750
  };
3684
- let F = class extends y {
3751
+ let E = class extends g {
3685
3752
  constructor() {
3686
3753
  super(...arguments), this.label = "Search", this.value = "", this.placeholder = "", this.disabled = !1, this.invalid = !1, this.options = [], this.fetcher = null, this.debounce = 150, this.minChars = 1, this.maxItems = 8, this.freeText = !0, this.autocomplete = "off", this.term = "", this.open = !1, this.results = [], this.loading = !1, this.activeIndex = -1, this.fetchSeq = 0, this.picked = null, this.lastPicked = null, this.onDocMousedown = (t) => {
3687
3754
  this.contains(t.target) || this.close();
@@ -3827,7 +3894,7 @@ let F = class extends y {
3827
3894
  aria-invalid=${this.invalid ? "true" : h}
3828
3895
  autocomplete=${this.autocomplete}
3829
3896
  placeholder=${this.placeholder || h}
3830
- .value=${ot(this.term)}
3897
+ .value=${lt(this.term)}
3831
3898
  ?disabled=${this.disabled}
3832
3899
  @input=${(i) => this.onInput(i)}
3833
3900
  @keydown=${(i) => this.onKeydown(i)}
@@ -3864,63 +3931,63 @@ let F = class extends y {
3864
3931
  </div>`;
3865
3932
  }
3866
3933
  };
3867
- I([
3934
+ M([
3868
3935
  l()
3869
- ], F.prototype, "label", 2);
3870
- I([
3936
+ ], E.prototype, "label", 2);
3937
+ M([
3871
3938
  l()
3872
- ], F.prototype, "value", 2);
3873
- I([
3939
+ ], E.prototype, "value", 2);
3940
+ M([
3874
3941
  l()
3875
- ], F.prototype, "placeholder", 2);
3876
- I([
3942
+ ], E.prototype, "placeholder", 2);
3943
+ M([
3877
3944
  l({ type: Boolean })
3878
- ], F.prototype, "disabled", 2);
3879
- I([
3945
+ ], E.prototype, "disabled", 2);
3946
+ M([
3880
3947
  l({ type: Boolean })
3881
- ], F.prototype, "invalid", 2);
3882
- I([
3948
+ ], E.prototype, "invalid", 2);
3949
+ M([
3883
3950
  l({ attribute: !1 })
3884
- ], F.prototype, "options", 2);
3885
- I([
3951
+ ], E.prototype, "options", 2);
3952
+ M([
3886
3953
  l({ attribute: !1 })
3887
- ], F.prototype, "fetcher", 2);
3888
- I([
3954
+ ], E.prototype, "fetcher", 2);
3955
+ M([
3889
3956
  l({ type: Number })
3890
- ], F.prototype, "debounce", 2);
3891
- I([
3957
+ ], E.prototype, "debounce", 2);
3958
+ M([
3892
3959
  l({ type: Number, attribute: "min-chars" })
3893
- ], F.prototype, "minChars", 2);
3894
- I([
3960
+ ], E.prototype, "minChars", 2);
3961
+ M([
3895
3962
  l({ type: Number, attribute: "max-items" })
3896
- ], F.prototype, "maxItems", 2);
3897
- I([
3963
+ ], E.prototype, "maxItems", 2);
3964
+ M([
3898
3965
  l({ attribute: "free-text", converter: (t) => t !== "false" })
3899
- ], F.prototype, "freeText", 2);
3900
- I([
3966
+ ], E.prototype, "freeText", 2);
3967
+ M([
3901
3968
  l()
3902
- ], F.prototype, "autocomplete", 2);
3903
- I([
3904
- $()
3905
- ], F.prototype, "term", 2);
3906
- I([
3907
- $()
3908
- ], F.prototype, "open", 2);
3909
- I([
3910
- $()
3911
- ], F.prototype, "results", 2);
3912
- I([
3913
- $()
3914
- ], F.prototype, "loading", 2);
3915
- I([
3916
- $()
3917
- ], F.prototype, "activeIndex", 2);
3918
- I([
3919
- Bt("input")
3920
- ], F.prototype, "inputEl", 2);
3921
- F = I([
3969
+ ], E.prototype, "autocomplete", 2);
3970
+ M([
3971
+ y()
3972
+ ], E.prototype, "term", 2);
3973
+ M([
3974
+ y()
3975
+ ], E.prototype, "open", 2);
3976
+ M([
3977
+ y()
3978
+ ], E.prototype, "results", 2);
3979
+ M([
3980
+ y()
3981
+ ], E.prototype, "loading", 2);
3982
+ M([
3983
+ y()
3984
+ ], E.prototype, "activeIndex", 2);
3985
+ M([
3986
+ It("input")
3987
+ ], E.prototype, "inputEl", 2);
3988
+ E = M([
3922
3989
  b("baht-typeahead")
3923
- ], F);
3990
+ ], E);
3924
3991
  const cs = {
3925
3992
  text: "baht-input",
3926
3993
  email: "baht-input",
@@ -3953,7 +4020,7 @@ function vi(t) {
3953
4020
  let e = as.get(t);
3954
4021
  return e || (e = os(t), as.set(t, e)), e;
3955
4022
  }
3956
- let Ie = class extends J {
4023
+ let Ie = class extends Y {
3957
4024
  constructor() {
3958
4025
  super(...arguments), this.rowErrors = [];
3959
4026
  }
@@ -3973,7 +4040,7 @@ let Ie = class extends J {
3973
4040
  addRow() {
3974
4041
  const t = {};
3975
4042
  for (const e of this.subFields)
3976
- e.type === "label" || e.type === "section" || (t[e.key] = se(e));
4043
+ e.type === "label" || e.type === "section" || (t[e.key] = ae(e));
3977
4044
  this.emitInput([...this.rows, t]);
3978
4045
  }
3979
4046
  removeRow(t) {
@@ -4006,9 +4073,9 @@ let Ie = class extends J {
4006
4073
  this.patchRow(e, i.key, f);
4007
4074
  };
4008
4075
  return n`<div class="baht-field ${r}" data-key=${i.key} data-type=${i.type}>
4009
- ${ee`<${s}
4076
+ ${se`<${s}
4010
4077
  .field=${i}
4011
- .value=${Object.hasOwn(t, i.key) ? t[i.key] : se(i)}
4078
+ .value=${Object.hasOwn(t, i.key) ? t[i.key] : ae(i)}
4012
4079
  .disabled=${this.disabled}
4013
4080
  .readonly=${this.readonly}
4014
4081
  .required=${!!i.required}
@@ -4069,12 +4136,12 @@ ps([
4069
4136
  Ie = ps([
4070
4137
  b("baht-repeater")
4071
4138
  ], Ie);
4072
- var $i = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, me = (t, e, i, a) => {
4139
+ var $i = Object.defineProperty, yi = Object.getOwnPropertyDescriptor, ve = (t, e, i, a) => {
4073
4140
  for (var s = a > 1 ? void 0 : a ? yi(e, i) : e, r = t.length - 1, o; r >= 0; r--)
4074
4141
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
4075
4142
  return a && s && $i(e, i, s), s;
4076
4143
  };
4077
- let Gt = class extends y {
4144
+ let Wt = class extends g {
4078
4145
  constructor() {
4079
4146
  super(...arguments), this.steps = [], this.current = 0, this.variant = "default";
4080
4147
  }
@@ -4098,19 +4165,19 @@ let Gt = class extends y {
4098
4165
  </ol>`;
4099
4166
  }
4100
4167
  };
4101
- me([
4168
+ ve([
4102
4169
  l({ attribute: !1 })
4103
- ], Gt.prototype, "steps", 2);
4104
- me([
4170
+ ], Wt.prototype, "steps", 2);
4171
+ ve([
4105
4172
  l({ type: Number })
4106
- ], Gt.prototype, "current", 2);
4107
- me([
4173
+ ], Wt.prototype, "current", 2);
4174
+ ve([
4108
4175
  l()
4109
- ], Gt.prototype, "variant", 2);
4110
- Gt = me([
4176
+ ], Wt.prototype, "variant", 2);
4177
+ Wt = ve([
4111
4178
  b("baht-steps")
4112
- ], Gt);
4113
- var gi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, X = (t, e, i, a) => {
4179
+ ], Wt);
4180
+ var gi = Object.defineProperty, wi = Object.getOwnPropertyDescriptor, Q = (t, e, i, a) => {
4114
4181
  for (var s = a > 1 ? void 0 : a ? wi(e, i) : e, r = t.length - 1, o; r >= 0; r--)
4115
4182
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
4116
4183
  return a && s && gi(e, i, s), s;
@@ -4125,7 +4192,7 @@ function _i(t) {
4125
4192
  let e = is.get(t);
4126
4193
  return e || (e = os(t), is.set(t, e)), e;
4127
4194
  }
4128
- let U = class extends y {
4195
+ let H = class extends g {
4129
4196
  constructor() {
4130
4197
  super(...arguments), this.value = {}, this.registry = {}, this.options = {}, this.fieldStates = {}, this.flags = {}, this.readonly = !1, this.edits = {}, this.errors = [], this.dynamicOptions = /* @__PURE__ */ new Map(), this.optionsSnapshots = /* @__PURE__ */ new Map(), this.optionsEpoch = /* @__PURE__ */ new Map(), this.warnedViews = /* @__PURE__ */ new Set(), this.flagCache = {};
4131
4198
  }
@@ -4178,7 +4245,7 @@ let U = class extends y {
4178
4245
  for (; e.length > 0; ) {
4179
4246
  const r = e.shift();
4180
4247
  for (const o of ((a = this.effectiveForm) == null ? void 0 : a.fields) ?? [])
4181
- !((s = o.options_deps) != null && s.includes(r)) || i.has(o.key) || (i.add(o.key), this.edits = { ...this.edits, [o.key]: se(o) }, e.push(o.key));
4248
+ !((s = o.options_deps) != null && s.includes(r)) || i.has(o.key) || (i.add(o.key), this.edits = { ...this.edits, [o.key]: ae(o) }, e.push(o.key));
4182
4249
  }
4183
4250
  }
4184
4251
  get sortedFields() {
@@ -4196,7 +4263,7 @@ let U = class extends y {
4196
4263
  };
4197
4264
  }
4198
4265
  valueFor(t) {
4199
- return Object.hasOwn(this.edits, t.key) ? this.edits[t.key] : Object.hasOwn(this.value, t.key) ? this.value[t.key] : se(t);
4266
+ return Object.hasOwn(this.edits, t.key) ? this.edits[t.key] : Object.hasOwn(this.value, t.key) ? this.value[t.key] : ae(t);
4200
4267
  }
4201
4268
  // ---- public API (spec 01 §6) ----
4202
4269
  /** Debounced keystrokes still in a control land in `edits` before anyone reads them. */
@@ -4265,51 +4332,51 @@ let U = class extends y {
4265
4332
  this.errors = [...i, ...e];
4266
4333
  }
4267
4334
  renderField(t) {
4268
- var C, d;
4335
+ var x, u;
4269
4336
  const e = cs[t.type];
4270
4337
  if (!e)
4271
4338
  return console.warn(`[bahtui] unknown field type "${t.type}" — skipped`), h;
4272
- const i = this.stateFor(t), a = xi[t.width ?? "full"] ?? "baht-field--w-full", s = ((C = this.errors.find((v) => v.key === t.key)) == null ? void 0 : C.message) ?? null;
4339
+ const i = this.stateFor(t), a = xi[t.width ?? "full"] ?? "baht-field--w-full", s = ((x = this.errors.find((v) => v.key === t.key)) == null ? void 0 : x.message) ?? null;
4273
4340
  if (this.readonly && t.type !== "label" && t.type !== "section")
4274
4341
  return this.renderReadonlyField(t, a, i.visible);
4275
- const r = t.options_from ? { ...t, options: this.dynamicOptions.get(t.key) ?? t.options ?? [] } : t, o = this.valueFor(t), c = !i.enabled, f = this.readonly || i.readonly, g = this.options.inputDebounce, _ = (v) => this.onControlInput(t.key, v), p = _i(e);
4276
- let w;
4342
+ const r = t.options_from ? { ...t, options: this.dynamicOptions.get(t.key) ?? t.options ?? [] } : t, o = this.valueFor(t), c = !i.enabled, f = this.readonly || i.readonly, $ = this.options.inputDebounce, w = (v) => this.onControlInput(t.key, v), p = _i(e);
4343
+ let P;
4277
4344
  if (t.type === "repeater") {
4278
- const v = this.errors.filter((z) => z.key.startsWith(`${t.key}[`));
4279
- w = ee`<${p}
4345
+ const v = this.errors.filter((D) => D.key.startsWith(`${t.key}[`));
4346
+ P = se`<${p}
4280
4347
  .field=${r}
4281
4348
  .value=${o}
4282
4349
  .disabled=${c}
4283
4350
  .readonly=${f}
4284
4351
  .required=${i.required}
4285
4352
  .error=${s}
4286
- .debounce=${g}
4353
+ .debounce=${$}
4287
4354
  .rowErrors=${v}
4288
- @baht-input=${_}
4355
+ @baht-input=${w}
4289
4356
  ></${p}>`;
4290
4357
  } else if (t.type === "file") {
4291
4358
  let v;
4292
- t.uploader && (v = (d = this.registry.uploaders) == null ? void 0 : d[t.uploader], v || console.warn(`[bahtui] unknown uploader "${t.uploader}" — capture only`)), w = ee`<${p}
4359
+ t.uploader && (v = (u = this.registry.uploaders) == null ? void 0 : u[t.uploader], v || console.warn(`[bahtui] unknown uploader "${t.uploader}" — capture only`)), P = se`<${p}
4293
4360
  .field=${r}
4294
4361
  .value=${o}
4295
4362
  .disabled=${c}
4296
4363
  .readonly=${f}
4297
4364
  .required=${i.required}
4298
4365
  .error=${s}
4299
- .debounce=${g}
4366
+ .debounce=${$}
4300
4367
  .uploader=${v}
4301
- @baht-input=${_}
4368
+ @baht-input=${w}
4302
4369
  ></${p}>`;
4303
4370
  } else
4304
- w = ee`<${p}
4371
+ P = se`<${p}
4305
4372
  .field=${r}
4306
4373
  .value=${o}
4307
4374
  .disabled=${c}
4308
4375
  .readonly=${f}
4309
4376
  .required=${i.required}
4310
4377
  .error=${s}
4311
- .debounce=${g}
4312
- @baht-input=${_}
4378
+ .debounce=${$}
4379
+ @baht-input=${w}
4313
4380
  ></${p}>`;
4314
4381
  return n`<div
4315
4382
  class="baht-field ${a} ${i.visible ? "" : "baht-field--hidden"}"
@@ -4318,7 +4385,7 @@ let U = class extends y {
4318
4385
  data-testid="${this.form.form_id}.${t.key}"
4319
4386
  @focusout=${() => this.onFieldBlur(t)}
4320
4387
  >
4321
- ${w}
4388
+ ${P}
4322
4389
  </div>`;
4323
4390
  }
4324
4391
  /**
@@ -4365,45 +4432,45 @@ let U = class extends y {
4365
4432
  </div>`;
4366
4433
  }
4367
4434
  };
4368
- X([
4435
+ Q([
4369
4436
  l({ attribute: !1 })
4370
- ], U.prototype, "form", 2);
4371
- X([
4437
+ ], H.prototype, "form", 2);
4438
+ Q([
4372
4439
  l({ attribute: !1 })
4373
- ], U.prototype, "value", 2);
4374
- X([
4440
+ ], H.prototype, "value", 2);
4441
+ Q([
4375
4442
  l({ attribute: !1 })
4376
- ], U.prototype, "registry", 2);
4377
- X([
4443
+ ], H.prototype, "registry", 2);
4444
+ Q([
4378
4445
  l({ attribute: !1 })
4379
- ], U.prototype, "options", 2);
4380
- X([
4446
+ ], H.prototype, "options", 2);
4447
+ Q([
4381
4448
  l({ attribute: !1 })
4382
- ], U.prototype, "fieldStates", 2);
4383
- X([
4449
+ ], H.prototype, "fieldStates", 2);
4450
+ Q([
4384
4451
  l({ type: String })
4385
- ], U.prototype, "view", 2);
4386
- X([
4452
+ ], H.prototype, "view", 2);
4453
+ Q([
4387
4454
  l({ attribute: !1 })
4388
- ], U.prototype, "flags", 2);
4389
- X([
4455
+ ], H.prototype, "flags", 2);
4456
+ Q([
4390
4457
  l({ type: Boolean })
4391
- ], U.prototype, "readonly", 2);
4392
- X([
4393
- $()
4394
- ], U.prototype, "edits", 2);
4395
- X([
4396
- $()
4397
- ], U.prototype, "errors", 2);
4398
- U = X([
4458
+ ], H.prototype, "readonly", 2);
4459
+ Q([
4460
+ y()
4461
+ ], H.prototype, "edits", 2);
4462
+ Q([
4463
+ y()
4464
+ ], H.prototype, "errors", 2);
4465
+ H = Q([
4399
4466
  b("baht-form")
4400
- ], U);
4401
- var ki = Object.defineProperty, Pi = Object.getOwnPropertyDescriptor, N = (t, e, i, a) => {
4467
+ ], H);
4468
+ var ki = Object.defineProperty, Pi = Object.getOwnPropertyDescriptor, q = (t, e, i, a) => {
4402
4469
  for (var s = a > 1 ? void 0 : a ? Pi(e, i) : e, r = t.length - 1, o; r >= 0; r--)
4403
4470
  (o = t[r]) && (s = (a ? o(e, i, s) : o(s)) || s);
4404
4471
  return a && s && ki(e, i, s), s;
4405
4472
  };
4406
- let M = class extends y {
4473
+ let T = class extends g {
4407
4474
  constructor() {
4408
4475
  super(...arguments), this.value = {}, this.registry = {}, this.validateGate = !0, this.showBack = !0, this.flags = {}, this.showSteps = !1, this.stepsVariant = "default", this.data = {}, this.derived = null, this.current = null, this.approvalError = null, this.history = [], this.flagCache = {};
4409
4476
  }
@@ -4538,7 +4605,7 @@ let M = class extends y {
4538
4605
  }
4539
4606
  this.emit("baht-reject", o);
4540
4607
  const c = i.on_reject ?? { action: "end" };
4541
- c.action === "goto" && this.visibleForms.some((g) => g.form_name === c.form) ? this.gotoForm(c.form) : this.emit("baht-complete", { data: this.getData(), status: "rejected" });
4608
+ c.action === "goto" && this.visibleForms.some(($) => $.form_name === c.form) ? this.gotoForm(c.form) : this.emit("baht-complete", { data: this.getData(), status: "rejected" });
4542
4609
  }
4543
4610
  /** Jump back to a visible form, truncating the history to that point. */
4544
4611
  gotoForm(t) {
@@ -4672,112 +4739,112 @@ let M = class extends y {
4672
4739
  </div>`;
4673
4740
  }
4674
4741
  };
4675
- N([
4742
+ q([
4676
4743
  l({ attribute: !1 })
4677
- ], M.prototype, "workflow", 2);
4678
- N([
4744
+ ], T.prototype, "workflow", 2);
4745
+ q([
4679
4746
  l({ attribute: !1 })
4680
- ], M.prototype, "value", 2);
4681
- N([
4747
+ ], T.prototype, "value", 2);
4748
+ q([
4682
4749
  l({ attribute: !1 })
4683
- ], M.prototype, "registry", 2);
4684
- N([
4750
+ ], T.prototype, "registry", 2);
4751
+ q([
4685
4752
  l({ type: Boolean, attribute: "validate-gate" })
4686
- ], M.prototype, "validateGate", 2);
4687
- N([
4753
+ ], T.prototype, "validateGate", 2);
4754
+ q([
4688
4755
  l({ attribute: "next-label" })
4689
- ], M.prototype, "nextLabel", 2);
4690
- N([
4756
+ ], T.prototype, "nextLabel", 2);
4757
+ q([
4691
4758
  l({ attribute: "submit-label" })
4692
- ], M.prototype, "submitLabel", 2);
4693
- N([
4759
+ ], T.prototype, "submitLabel", 2);
4760
+ q([
4694
4761
  l({ attribute: "back-label" })
4695
- ], M.prototype, "backLabel", 2);
4696
- N([
4762
+ ], T.prototype, "backLabel", 2);
4763
+ q([
4697
4764
  l({ type: Boolean, attribute: "show-back" })
4698
- ], M.prototype, "showBack", 2);
4699
- N([
4765
+ ], T.prototype, "showBack", 2);
4766
+ q([
4700
4767
  l({ attribute: !1 })
4701
- ], M.prototype, "flags", 2);
4702
- N([
4768
+ ], T.prototype, "flags", 2);
4769
+ q([
4703
4770
  l({ type: Boolean, attribute: "show-steps" })
4704
- ], M.prototype, "showSteps", 2);
4705
- N([
4771
+ ], T.prototype, "showSteps", 2);
4772
+ q([
4706
4773
  l({ attribute: "steps-variant" })
4707
- ], M.prototype, "stepsVariant", 2);
4708
- N([
4709
- $()
4710
- ], M.prototype, "data", 2);
4711
- N([
4712
- $()
4713
- ], M.prototype, "derived", 2);
4714
- N([
4715
- $()
4716
- ], M.prototype, "current", 2);
4717
- N([
4718
- $()
4719
- ], M.prototype, "approvalError", 2);
4720
- M = N([
4774
+ ], T.prototype, "stepsVariant", 2);
4775
+ q([
4776
+ y()
4777
+ ], T.prototype, "data", 2);
4778
+ q([
4779
+ y()
4780
+ ], T.prototype, "derived", 2);
4781
+ q([
4782
+ y()
4783
+ ], T.prototype, "current", 2);
4784
+ q([
4785
+ y()
4786
+ ], T.prototype, "approvalError", 2);
4787
+ T = q([
4721
4788
  b("baht-workflow")
4722
- ], M);
4789
+ ], T);
4723
4790
  export {
4724
4791
  Xe as $,
4725
4792
  ht as A,
4726
- Ct as B,
4727
- Pt as C,
4793
+ Dt as B,
4794
+ Ot as C,
4728
4795
  Ke as D,
4729
- rt as E,
4730
- mt as F,
4796
+ ot as E,
4797
+ vt as F,
4731
4798
  j as G,
4732
4799
  Ie as H,
4733
4800
  Ee as I,
4734
- oe as J,
4735
- Vt as K,
4801
+ le as J,
4802
+ Kt as K,
4736
4803
  ct as L,
4737
- ie as M,
4804
+ re as M,
4738
4805
  K as N,
4739
- Ut as O,
4740
- Gt as P,
4806
+ Ht as O,
4807
+ Wt as P,
4741
4808
  k as Q,
4742
4809
  Fe as R,
4743
4810
  qe as S,
4744
4811
  De as T,
4745
4812
  Ue as U,
4746
- kt as V,
4747
- F as W,
4748
- D as X,
4749
- M as Y,
4813
+ Pt as V,
4814
+ E as W,
4815
+ F as X,
4816
+ T as Y,
4750
4817
  cs as Z,
4751
- nt as _,
4752
- ft as a,
4818
+ ft as _,
4819
+ mt as a,
4753
4820
  qa as a0,
4754
- qt as a1,
4755
- le as a2,
4821
+ Rt as a1,
4822
+ ne as a2,
4756
4823
  Be as a3,
4757
- be as a4,
4758
- zt as b,
4759
- R as c,
4760
- re as d,
4761
- Ot as e,
4762
- tt as f,
4824
+ fe as a4,
4825
+ Vt as b,
4826
+ z as c,
4827
+ oe as d,
4828
+ Ct as e,
4829
+ st as f,
4763
4830
  Ve as g,
4764
- ae as h,
4831
+ ie as h,
4765
4832
  He as i,
4766
- G as j,
4767
- Ht as k,
4768
- Et as l,
4769
- Kt as m,
4770
- Ft as n,
4771
- $t as o,
4772
- U as p,
4833
+ J as j,
4834
+ Gt as k,
4835
+ Bt as l,
4836
+ Ut as m,
4837
+ Et as n,
4838
+ yt as o,
4839
+ H as p,
4773
4840
  pt as q,
4774
4841
  Ne as r,
4775
4842
  dt as s,
4776
- Q as t,
4777
- Dt as u,
4778
- it as v,
4779
- W as w,
4843
+ et as t,
4844
+ Ft as u,
4845
+ rt as v,
4846
+ U as w,
4780
4847
  ze as x,
4781
4848
  Re as y,
4782
- vt as z
4849
+ $t as z
4783
4850
  };