@boost33/ui 0.7.1 → 0.8.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/CHANGELOG.md +183 -0
  2. package/dist/buttons.module.css.js +10 -0
  3. package/dist/buttons.module.css.js.map +1 -0
  4. package/dist/components/AppShell/AppShell.d.ts +85 -17
  5. package/dist/components/AppShell/AppShell.js +75 -50
  6. package/dist/components/AppShell/AppShell.js.map +1 -1
  7. package/dist/components/AppShell/AppShell.module.css.js +22 -16
  8. package/dist/components/AppShell/AppShell.module.css.js.map +1 -1
  9. package/dist/components/AppSwitcher/AppSwitcher.d.ts +90 -45
  10. package/dist/components/AppSwitcher/AppSwitcher.js +71 -66
  11. package/dist/components/AppSwitcher/AppSwitcher.js.map +1 -1
  12. package/dist/components/AppSwitcher/AppSwitcher.module.css.js +42 -36
  13. package/dist/components/AppSwitcher/AppSwitcher.module.css.js.map +1 -1
  14. package/dist/components/AppSwitcher/icons.js +10 -10
  15. package/dist/components/AppSwitcher/icons.js.map +1 -1
  16. package/dist/components/AppSwitcher/labels.d.ts +11 -22
  17. package/dist/components/AppSwitcher/labels.js.map +1 -1
  18. package/dist/components/CommandPalette/CommandPalette.d.ts +8 -2
  19. package/dist/components/CommandPalette/CommandPalette.js.map +1 -1
  20. package/dist/components/NavItem/NavItem.d.ts +15 -2
  21. package/dist/components/NavItem/NavItem.js +14 -11
  22. package/dist/components/NavItem/NavItem.js.map +1 -1
  23. package/dist/components/NavItem/NavItem.module.css.js +6 -2
  24. package/dist/components/NavItem/NavItem.module.css.js.map +1 -1
  25. package/dist/components/NavSection/NavSection.module.css.js +5 -5
  26. package/dist/components/NotificationButton/NotificationButton.d.ts +29 -0
  27. package/dist/components/NotificationButton/NotificationButton.js +23 -0
  28. package/dist/components/NotificationButton/NotificationButton.js.map +1 -0
  29. package/dist/components/NotificationButton/NotificationButton.module.css.js +14 -0
  30. package/dist/components/NotificationButton/NotificationButton.module.css.js.map +1 -0
  31. package/dist/components/NotificationButton/labels.d.ts +12 -0
  32. package/dist/components/NotificationButton/labels.js +15 -0
  33. package/dist/components/NotificationButton/labels.js.map +1 -0
  34. package/dist/components/NotificationCenter/NotificationCenter.js +37 -36
  35. package/dist/components/NotificationCenter/NotificationCenter.js.map +1 -1
  36. package/dist/components/NotificationCenter/NotificationCenter.module.css.js +43 -43
  37. package/dist/components/Sidebar/NavHeightBudgetWarning.js +2 -2
  38. package/dist/components/Sidebar/NavHeightBudgetWarning.js.map +1 -1
  39. package/dist/components/Sidebar/Sidebar.module.css.js +1 -1
  40. package/dist/components/TopBar/TopBar.d.ts +54 -4
  41. package/dist/components/TopBar/TopBar.js +22 -7
  42. package/dist/components/TopBar/TopBar.js.map +1 -1
  43. package/dist/components/TopBar/TopBar.module.css.js +12 -8
  44. package/dist/components/TopBar/TopBar.module.css.js.map +1 -1
  45. package/dist/components/TopBar/labels.d.ts +20 -0
  46. package/dist/components/TopBar/labels.js +15 -0
  47. package/dist/components/TopBar/labels.js.map +1 -0
  48. package/dist/components/WalletChip/WalletChip.d.ts +77 -2
  49. package/dist/components/WalletChip/WalletChip.js +142 -50
  50. package/dist/components/WalletChip/WalletChip.js.map +1 -1
  51. package/dist/components/WalletChip/WalletChip.module.css.js +93 -47
  52. package/dist/components/WalletChip/WalletChip.module.css.js.map +1 -1
  53. package/dist/components/WalletChip/labels.d.ts +63 -1
  54. package/dist/components/WalletChip/labels.js +21 -6
  55. package/dist/components/WalletChip/labels.js.map +1 -1
  56. package/dist/index.d.ts +9 -3
  57. package/dist/index.js +55 -49
  58. package/dist/index.js.map +1 -1
  59. package/dist/nav-height-budget.d.ts +12 -9
  60. package/dist/nav-height-budget.js +3 -3
  61. package/dist/nav-height-budget.js.map +1 -1
  62. package/dist/style.css +1 -1
  63. package/dist/theme.css +1 -1
  64. package/package.json +1 -1
@@ -1,71 +1,163 @@
1
1
  "use client";
2
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
3
- import a from "./WalletChip.module.css.js";
4
- import { thousandsFigure as A, formatTokens as m, DEFAULT_WALLET_LOCALE as M } from "./format.js";
5
- import { WalletMark as R, RetryMark as W } from "./icons.js";
6
- import { resolveWalletChipLabels as w } from "./labels.js";
7
- const y = 0.8, F = "var(--spacing-wallet-segment-min)";
8
- function g(s, r) {
9
- const t = r > 0 ? s / r * 100 : 0;
10
- return s <= 0 ? `${t}%` : `max(${t}%, ${F})`;
2
+ import { jsx as a, jsxs as n, Fragment as P } from "react/jsx-runtime";
3
+ import { useAnchoredOverlay as U } from "../../anchored-overlay.js";
4
+ import { Chevron as O } from "../AppSwitcher/icons.js";
5
+ import F from "../../buttons.module.css.js";
6
+ import e from "./WalletChip.module.css.js";
7
+ import { formatTokens as o, DEFAULT_WALLET_LOCALE as k, thousandsFigure as w } from "./format.js";
8
+ import { WalletMark as x, RetryMark as $ } from "./icons.js";
9
+ import { resolveWalletChipLabels as A } from "./labels.js";
10
+ const E = 0.8, G = "var(--spacing-wallet-segment-min)";
11
+ function L(i, l) {
12
+ const r = l > 0 ? i / l * 100 : 0;
13
+ return i <= 0 ? `${r}%` : `max(${r}%, ${G})`;
11
14
  }
12
- function B({ granted: s, purchased: r, cycleTotal: t, tone: h, label: o }) {
13
- return /* @__PURE__ */ l("div", { className: a.bar, "data-tone": h, role: "img", "aria-label": o, children: [
14
- /* @__PURE__ */ e("span", { className: a.segmentGranted, "data-testid": "segment-granted", style: { width: g(s, t) } }),
15
- /* @__PURE__ */ e("span", { className: a.segmentPurchased, "data-testid": "segment-purchased", style: { width: g(r, t) } })
15
+ function R({ granted: i, purchased: l, cycleTotal: r, tone: m, label: t }) {
16
+ return /* @__PURE__ */ n("div", { className: e.bar, "data-tone": m, role: "img", "aria-label": t, children: [
17
+ /* @__PURE__ */ a("span", { className: e.segmentGranted, "data-testid": "segment-granted", style: { width: L(i, r) } }),
18
+ /* @__PURE__ */ a("span", { className: e.segmentPurchased, "data-testid": "segment-purchased", style: { width: L(l, r) } })
16
19
  ] });
17
20
  }
18
- function $({ granted: s = 0, purchased: r = 0, grantCycle: t, burnedFraction: h, grantExpires: o, burnNote: p, unknown: n = !1, collapsed: x = !1, onTopUp: u, labels: E, locale: d = M }) {
19
- const i = w(E), b = () => i.bar(m(s, d), m(r, d), m(s + r, d)), v = s + r, f = (t ?? s) + r, U = t !== void 0 && t > 0 ? (t - s) / t : 0, L = h ?? U, c = !n && L >= y;
20
- if (x) {
21
- const N = n ? void 0 : i.railFigure(A(v, d));
22
- return /* @__PURE__ */ l("div", { className: a.rail, role: "group", "aria-label": N === void 0 ? i.railBalanceUnknown : i.railBalance(N), tabIndex: 0, children: [
23
- /* @__PURE__ */ e(R, { className: a.railIcon }),
24
- /* @__PURE__ */ e("span", { className: a.railFigure, children: N ?? "—" }),
25
- n ? /* @__PURE__ */ e("span", { className: a.srOnly, children: i.railUnknown }) : /* @__PURE__ */ e(B, { granted: s, purchased: r, cycleTotal: f, tone: c ? "threshold" : "rest", label: b() })
21
+ function J(i) {
22
+ return i.totalOnly === !0 ? /* @__PURE__ */ a(W, { ...i }) : i.placement === "topbar" ? /* @__PURE__ */ a(M, { ...i }) : /* @__PURE__ */ a(I, { ...i });
23
+ }
24
+ function M({ granted: i = 0, purchased: l = 0, grantExpires: r, burnNote: m, unknown: t = !1, onTopUp: v, labels: p, locale: u = k, walletHref: c, linkComponent: g, defaultOpen: h }) {
25
+ const s = A(p), d = U({ defaultOpen: h }), y = g ?? "a", b = i + l, B = b, f = t ? "—" : o(b, u), N = () => s.bar(o(i, u), o(l, u), o(b, u));
26
+ return /* @__PURE__ */ n("div", { className: e.topRoot, children: [
27
+ /* @__PURE__ */ n("button", { type: "button", className: e.topTrigger, "aria-label": t ? s.railBalanceUnknown : s.railBalance(f), onClick: d.toggle, ...d.triggerProps, children: [
28
+ /* @__PURE__ */ n("span", { className: e.topFigure, "aria-hidden": "true", children: [
29
+ /* @__PURE__ */ a("span", { className: e.topAmount, children: f }),
30
+ /* @__PURE__ */ a("span", { className: e.topUnit, children: s.unit })
31
+ ] }),
32
+ !t && /* @__PURE__ */ a(T, { granted: i, purchased: l, total: B, className: e.topBar }),
33
+ /* @__PURE__ */ a(O, { className: e.topChevron })
34
+ ] }),
35
+ d.open && /* @__PURE__ */ n("div", { ...d.panelProps, className: e.popover, "aria-label": s.popover, children: [
36
+ /* @__PURE__ */ n("div", { className: e.popHead, children: [
37
+ /* @__PURE__ */ n("span", { className: e.popFigure, children: [
38
+ /* @__PURE__ */ a("span", { className: e.popAmount, children: f }),
39
+ /* @__PURE__ */ a("span", { className: e.popUnit, children: s.unit })
40
+ ] }),
41
+ c !== void 0 && /* @__PURE__ */ a(y, { className: F.quiet, href: c, onClick: d.close, children: s.open })
42
+ ] }),
43
+ t ? /* @__PURE__ */ a("p", { className: e.popNote, children: s.balanceUnknown }) : /* @__PURE__ */ n(P, { children: [
44
+ /* @__PURE__ */ a(T, { granted: i, purchased: l, total: B, className: e.popBar, label: N() }),
45
+ /* @__PURE__ */ n("ul", { className: e.legend, children: [
46
+ /* @__PURE__ */ n("li", { className: e.legendRow, children: [
47
+ /* @__PURE__ */ a("span", { className: e.swatchGranted, "aria-hidden": "true" }),
48
+ /* @__PURE__ */ n("span", { className: e.legendText, children: [
49
+ /* @__PURE__ */ a("span", { className: e.legendFigure, children: s.grantedFigure(o(i, u)) }),
50
+ /* @__PURE__ */ a("span", { className: e.legendNote, children: r ? s.grantedNote(r) : s.grantedNoteUndated })
51
+ ] })
52
+ ] }),
53
+ /* @__PURE__ */ n("li", { className: e.legendRow, children: [
54
+ /* @__PURE__ */ a("span", { className: e.swatchPurchased, "aria-hidden": "true" }),
55
+ /* @__PURE__ */ n("span", { className: e.legendText, children: [
56
+ /* @__PURE__ */ a("span", { className: e.legendFigure, children: s.purchasedFigure(o(l, u)) }),
57
+ /* @__PURE__ */ a("span", { className: e.legendNote, children: s.purchasedNote })
58
+ ] })
59
+ ] })
60
+ ] }),
61
+ (m || v !== void 0) && /* @__PURE__ */ n("div", { className: e.popFoot, children: [
62
+ m && /* @__PURE__ */ a("p", { className: e.popNote, children: m }),
63
+ v !== void 0 && /* @__PURE__ */ a("button", { type: "button", className: `${F.primary} ${e.buy}`, "data-tone": "accent", onClick: v, children: s.buyTokens })
64
+ ] })
65
+ ] })
66
+ ] })
67
+ ] });
68
+ }
69
+ function W({ balance: i, burnNote: l, onTopUp: r, labels: m, locale: t = k, walletHref: v, linkComponent: p, defaultOpen: u }) {
70
+ const c = A(m), g = U({ defaultOpen: u }), h = p ?? "a", s = i < 0, d = o(s ? -i : i, t);
71
+ return /* @__PURE__ */ n("div", { className: e.topRoot, "data-past-zero": s ? "true" : void 0, children: [
72
+ /* @__PURE__ */ n("button", { type: "button", className: e.topTrigger, "aria-label": s ? c.pastZeroBalance(d) : c.railBalance(d), onClick: g.toggle, ...g.triggerProps, children: [
73
+ /* @__PURE__ */ n("span", { className: e.topFigure, "aria-hidden": "true", children: [
74
+ /* @__PURE__ */ a("span", { className: e.topAmount, children: d }),
75
+ /* @__PURE__ */ a("span", { className: e.topUnit, children: s ? c.pastZero : c.unit })
76
+ ] }),
77
+ /* @__PURE__ */ a(O, { className: e.topChevron })
78
+ ] }),
79
+ g.open && /* @__PURE__ */ n("div", { ...g.panelProps, className: e.popover, "aria-label": c.popover, children: [
80
+ /* @__PURE__ */ n("div", { className: e.popHead, children: [
81
+ /* @__PURE__ */ n("span", { className: e.popFigure, children: [
82
+ /* @__PURE__ */ a("span", { className: e.popAmount, children: d }),
83
+ /* @__PURE__ */ a("span", { className: e.popUnit, children: s ? c.pastZeroLong : c.unit })
84
+ ] }),
85
+ v !== void 0 && /* @__PURE__ */ a(h, { className: e.popOpen, href: v, onClick: g.close, children: c.open })
86
+ ] }),
87
+ (l || r !== void 0) && /* @__PURE__ */ n("div", { className: e.popFoot, children: [
88
+ l && /* @__PURE__ */ a("p", { className: e.popNote, children: l }),
89
+ r !== void 0 && /* @__PURE__ */ a("button", { type: "button", className: e.buy, onClick: r, children: c.buyTokens })
90
+ ] })
91
+ ] })
92
+ ] });
93
+ }
94
+ function T({ granted: i, purchased: l, total: r, className: m, label: t }) {
95
+ return /* @__PURE__ */ n("span", { className: m, role: t ? "img" : void 0, "aria-label": t, "aria-hidden": t ? void 0 : "true", children: [
96
+ /* @__PURE__ */ a("span", { className: e.segmentGranted, "data-segment": "granted", style: { width: L(i, r) } }),
97
+ /* @__PURE__ */ a("span", { className: e.segmentPurchased, "data-segment": "purchased", style: { width: L(l, r) } })
98
+ ] });
99
+ }
100
+ function I({ granted: i = 0, purchased: l = 0, grantCycle: r, burnedFraction: m, grantExpires: t, burnNote: v, unknown: p = !1, collapsed: u = !1, onTopUp: c, labels: g, locale: h = k }) {
101
+ const s = A(g), d = () => s.bar(o(i, h), o(l, h), o(i + l, h)), y = i + l, b = (r ?? i) + l, B = r !== void 0 && r > 0 ? (r - i) / r : 0, f = m ?? B, N = !p && f >= E;
102
+ if (u) {
103
+ const C = p ? void 0 : s.railFigure(w(y, h));
104
+ return /* @__PURE__ */ n("div", { className: e.rail, role: "group", "aria-label": C === void 0 ? s.railBalanceUnknown : s.railBalance(C), tabIndex: 0, children: [
105
+ /* @__PURE__ */ a(x, { className: e.railIcon }),
106
+ /* @__PURE__ */ a("span", { className: e.railFigure, children: C ?? "—" }),
107
+ p ? /* @__PURE__ */ a("span", { className: e.srOnly, children: s.railUnknown }) : /* @__PURE__ */ a(R, { granted: i, purchased: l, cycleTotal: b, tone: N ? "threshold" : "rest", label: d() })
26
108
  ] });
27
109
  }
28
- return /* @__PURE__ */ l("div", { className: a.chip, role: "group", "aria-label": i.region, tabIndex: 0, "data-threshold": c ? "true" : void 0, "data-unknown": n ? "true" : void 0, children: [
29
- /* @__PURE__ */ l("div", { className: a.header, children: [
30
- /* @__PURE__ */ e("span", { className: a.name, children: i.name }),
31
- c && /* @__PURE__ */ l("span", { className: a.pill, children: [
32
- Math.round(L * 100),
110
+ return /* @__PURE__ */ n("div", { className: e.chip, role: "group", "aria-label": s.region, tabIndex: 0, "data-threshold": N ? "true" : void 0, "data-unknown": p ? "true" : void 0, children: [
111
+ /* @__PURE__ */ n("div", { className: e.header, children: [
112
+ /* @__PURE__ */ a("span", { className: e.name, children: s.name }),
113
+ N && /* @__PURE__ */ n("span", { className: e.pill, children: [
114
+ Math.round(f * 100),
33
115
  "%"
34
116
  ] })
35
117
  ] }),
36
- n ? /* @__PURE__ */ l("div", { className: a.figure, children: [
37
- /* @__PURE__ */ e("span", { className: a.amount, "aria-hidden": "true", children: "—" }),
38
- /* @__PURE__ */ e(W, { className: a.retry }),
39
- /* @__PURE__ */ e("span", { className: a.srOnly, children: i.balanceUnknown })
40
- ] }) : /* @__PURE__ */ l("div", { className: a.figure, children: [
41
- /* @__PURE__ */ e("span", { className: a.amount, children: m(v, d) }),
42
- /* @__PURE__ */ e("span", { className: a.unit, children: i.unit })
118
+ p ? /* @__PURE__ */ n("div", { className: e.figure, children: [
119
+ /* @__PURE__ */ a("span", { className: e.amount, "aria-hidden": "true", children: "—" }),
120
+ /* @__PURE__ */ a($, { className: e.retry }),
121
+ /* @__PURE__ */ a("span", { className: e.srOnly, children: s.balanceUnknown })
122
+ ] }) : /* @__PURE__ */ n("div", { className: e.figure, children: [
123
+ /* @__PURE__ */ a("span", { className: e.amount, children: o(y, h) }),
124
+ /* @__PURE__ */ a("span", { className: e.unit, children: s.unit })
43
125
  ] }),
44
- n ? /* @__PURE__ */ e("div", { className: a.bar, "data-tone": "unknown", "aria-hidden": "true" }) : /* @__PURE__ */ e(B, { granted: s, purchased: r, cycleTotal: f, tone: c ? "threshold" : "rest", label: b() }),
45
- !n && !c && /* @__PURE__ */ l("div", { className: a.details, children: [
46
- /* @__PURE__ */ l("dl", { className: a.split, children: [
47
- /* @__PURE__ */ l("div", { className: a.splitRow, children: [
48
- /* @__PURE__ */ l("dt", { className: a.splitLabel, children: [
49
- /* @__PURE__ */ e("span", { className: a.dotGranted, "aria-hidden": "true" }),
50
- i.granted
126
+ p ? /* @__PURE__ */ a("div", { className: e.bar, "data-tone": "unknown", "aria-hidden": "true" }) : /* @__PURE__ */ a(R, { granted: i, purchased: l, cycleTotal: b, tone: N ? "threshold" : "rest", label: d() }),
127
+ !p && !N && /* @__PURE__ */ n("div", { className: e.details, children: [
128
+ /* @__PURE__ */ n("dl", { className: e.split, children: [
129
+ /* @__PURE__ */ n("div", { className: e.splitRow, children: [
130
+ /* @__PURE__ */ n("dt", { className: e.splitLabel, children: [
131
+ /* @__PURE__ */ a("span", { className: e.dotGranted, "aria-hidden": "true" }),
132
+ s.granted
51
133
  ] }),
52
- /* @__PURE__ */ e("dd", { className: a.splitAmount, children: m(s, d) })
134
+ /* @__PURE__ */ a("dd", { className: e.splitAmount, children: o(i, h) })
53
135
  ] }),
54
- /* @__PURE__ */ l("div", { className: a.splitRow, children: [
55
- /* @__PURE__ */ l("dt", { className: a.splitLabel, children: [
56
- /* @__PURE__ */ e("span", { className: a.dotPurchased, "aria-hidden": "true" }),
57
- i.purchased
136
+ /* @__PURE__ */ n("div", { className: e.splitRow, children: [
137
+ /* @__PURE__ */ n("dt", { className: e.splitLabel, children: [
138
+ /* @__PURE__ */ a("span", { className: e.dotPurchased, "aria-hidden": "true" }),
139
+ s.purchased
58
140
  ] }),
59
- /* @__PURE__ */ e("dd", { className: a.splitAmount, children: m(r, d) })
141
+ /* @__PURE__ */ a("dd", { className: e.splitAmount, children: o(l, h) })
60
142
  ] })
61
143
  ] }),
62
- o && /* @__PURE__ */ e("p", { className: a.footer, children: i.grantExpiry(o) })
144
+ t && /* @__PURE__ */ a("p", { className: e.footer, children: s.grantExpiry(t) })
63
145
  ] }),
64
- c && p && /* @__PURE__ */ e("p", { className: a.burnNote, children: p }),
65
- !n && u !== void 0 && /* @__PURE__ */ e("button", { type: "button", className: a.topUp, "data-grown": c ? "true" : void 0, onClick: u, children: i.topUp })
146
+ N && v && /* @__PURE__ */ a("p", { className: e.burnNote, children: v }),
147
+ !p && c !== void 0 && /* @__PURE__ */ a(
148
+ "button",
149
+ {
150
+ type: "button",
151
+ className: `${N ? F.primary : F.quiet} ${e.topUp}`,
152
+ "data-tone": N ? "accent" : void 0,
153
+ "data-grown": N ? "true" : void 0,
154
+ onClick: c,
155
+ children: s.topUp
156
+ }
157
+ )
66
158
  ] });
67
159
  }
68
160
  export {
69
- $ as WalletChip
161
+ J as WalletChip
70
162
  };
71
163
  //# sourceMappingURL=WalletChip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WalletChip.js","sources":["../../../src/components/WalletChip/WalletChip.tsx"],"sourcesContent":["'use client'\n\n// A client module: the chip wires `onTopUp` to a button's onClick, which a\n// Server Component cannot carry. The rest of the shell stays on the server --\n// see Sidebar and B33-846.\n\nimport styles from './WalletChip.module.css'\nimport { DEFAULT_WALLET_LOCALE, formatTokens, thousandsFigure } from './format'\nimport { RetryMark, WalletMark } from './icons'\nimport { resolveWalletChipLabels, type WalletChipLabels } from './labels'\n\n// Past this fraction of the cycle's grant burned, the chip stops resting. The\n// spec's threshold, in one place so the derivation and the styling agree.\n//\n// It stays in the package and is not a prop, which is the whole reason\n// `burnedFraction` is a fraction rather than a `threshold?: boolean` (B33-483).\n// The consumer measures its own burn; 80% is where four products agree that\n// measurement means something, and a boolean would hand each of them the policy\n// and let it drift. It also happens to agree with the middle rung of Score's own\n// burndown alerts, so adopting it changed no product decision.\nconst THRESHOLD_BURN = 0.8\n\n// The floor under a non-zero bar segment, named once so the width expression\n// below reads as what it is. The value and its derivation live in the token --\n// see --spacing-wallet-segment-min in tokens.css.\nconst SEGMENT_MIN = 'var(--spacing-wallet-segment-min)'\n\n/**\n * A bar segment's CSS `width`: its honest share of everything the cycle started\n * with, floored so that a non-zero amount is never drawn below one visible mark.\n *\n * `max()` rather than a `min-width` on the segment classes, and the reason is the\n * zero case (B33-590). A stylesheet sees only the percentage, and no CSS length\n * can tell 0% from 0.3% -- a bare `min-width` would floor a wallet that holds\n * none of that kind of token into a phantom sliver, which is the same lie in the\n * other direction. The decision needs the amount itself, so it is made here where\n * the amount is, in one expression instead of a rule plus a signal from the\n * component to switch it off. `max()` also keeps the honest percentage wherever\n * the share clears the floor: the floor only ever wins when the truth is\n * unpaintable.\n *\n * Why it needs flooring at all: once a seller has bought tokens the grant is a\n * small share of the cycle, and a small share of a 240px bar is a fraction of a\n * pixel. Score measured 3,000 granted rendering at `width: 0.3%` -- 0.72px, which\n * paints nothing, while the ledger still held the grant. Both segments are\n * floored: purchased burns second, so it drains to zero through every small\n * number on the way, and 10 purchased on a spent 3,000 grant is 0.33% of the\n * cycle and the seller's entire remaining balance.\n *\n * This is the second time the rendering has been reported. Score fixed it in its\n * own wallet markup; B33-482 replaced that markup with this component, which\n * carried no floor. Its record of the first fix is still on disk there, as dead\n * code, at components/app-shell/wallet-bar.ts.\n */\nfunction segmentWidth(amount: number, cycleTotal: number): string {\n // A cycle of nothing has no shares in it. Guarded because the divisor is\n // reachable -- a known balance of zero on a cycle that granted zero rendered\n // `width: NaN%`, which a browser drops rather than reports.\n const share = cycleTotal > 0 ? (amount / cycleTotal) * 100 : 0\n if (amount <= 0) return `${share}%`\n return `max(${share}%, ${SEGMENT_MIN})`\n}\n\n/**\n * The props that say nothing about a balance, so both states take them\n * identically: where the chip is drawn, what it is wired to, and the words and\n * number formats it renders with.\n */\ninterface WalletChipChromeProps {\n /** The 56px rail. Abbreviates the balance and turns the split on its side. */\n collapsed?: boolean\n /**\n * Top up. Wiring for the one button the sidebar is allowed to have.\n *\n * **It is also what makes that button exist.** Omit it and the chip draws no\n * top-up affordance at all, in every state, and that is the fix B33-1270 made.\n * The render used to be gated on `!unknown` alone, so a consumer that passed\n * no handler got a visible control that did nothing and could not be removed\n * -- `.topUp`'s class name is CSS-Modules-hashed, so there is no selector to\n * reach it from outside the package.\n *\n * That was not hypothetical in either consumer. The Wallet passes no handler\n * and ships the dead button today\n * (`boostledger/src/app/(wallet)/WalletShell.tsx`), and Score wrote a whole\n * client module to arm it across a Server Component boundary rather than live\n * with it (`boostscore/components/app-shell/wallet-chip-top-up.tsx`, which\n * says so at length).\n *\n * Nothing renders in the button's place. It carries no information of its own\n * -- only its own affordance -- so a consumer with nowhere to send someone is\n * better served by the chip without it than by a disabled one they did not\n * ask for (ADR-0010, \"Not entitled is not disabled\", on why unavailable is not\n * the same as disabled). B33-1047 is the other half: an `href` form of the\n * same affordance, for a consumer that cannot pass a callback at all.\n */\n onTopUp?: () => void\n /**\n * The chip's user-facing strings. Every field has an English default, so a\n * consumer supplies only the ones it translates; the first two consumers are\n * French-default. The package takes no i18n dependency -- it renders what it\n * is given (B33-849).\n *\n * Every field is a plain string, so the whole object crosses the React Server\n * Component boundary and a Next App Router page can build it. The four labels\n * that carry a value mark its position with a `%placeholder%` (B33-1277). None\n * of them takes a function: that form only ever worked from a Client Component\n * and nothing in the type said so (B33-880, B33-1278).\n */\n labels?: Partial<WalletChipLabels>\n /**\n * The BCP-47 language tag the chip's figures are formatted in. Defaults to\n * `en-US`, which is what the chip rendered before this prop existed.\n *\n * `labels` gives the consumer the chip's words; this gives it their numbers.\n * French writes `4 600` where English writes `4,600`, and a label cannot fix\n * it -- the label functions receive the figures already formatted, so before\n * this prop there was no hook at all (B33-876). Grouping and the decimal\n * separator are CLDR facts about a locale rather than a property of the\n * consumer's sentence, so a tag is enough: `Intl.NumberFormat` knows the rest,\n * and a tag is a plain string, which a Server Component can pass where a\n * formatter function could not.\n *\n * It reaches the visible figures and, because the same strings are\n * interpolated into them, the `bar` and `railBalance` accessible names.\n *\n * The `k` after the rail's abbreviated balance is a word, not a number, so it\n * is `labels.railFigure` and not this.\n */\n locale?: string\n}\n\n/**\n * The chip with a balance the consumer stands behind. The two remaining figures\n * are required, because this is the state that renders them.\n */\nexport interface WalletChipKnownProps extends WalletChipChromeProps {\n /**\n * Absent or `false`. The discriminant: it is what makes the figures below\n * required here and forbidden in {@link WalletChipUnknownProps}.\n */\n unknown?: false\n /** Remaining granted tokens. Granted burns first and expires. */\n granted: number\n /** Remaining purchased tokens. Purchased never expires. */\n purchased: number\n /**\n * What this cycle's grant started with, if the consumer knows. The bar's full\n * width alongside purchased, so the part already burned draws as empty track\n * and the filled portion shortens as the month runs.\n *\n * **Optional, and that is the fix B33-483 made.** It used to be required, and\n * no consumer could satisfy it honestly: it is the Ledger's\n * `grant_tokens_per_cycle`, and it cannot be reconstructed from a balance --\n * `cycleUsedPct` counts purchased-bucket spend, is not `(cycle total -\n * remaining)` once a credit, refund or void has touched the account, and is not\n * bounded at 100. So the Wallet passed `grantCycle = granted`, which pins\n * `burned` at 0 and held the threshold state unreachable in the reference\n * implementation, and Score passed a local per-plan belief instead.\n *\n * Omitted, the bar measures against `granted + purchased` -- the balance\n * itself. It then draws full and claims nothing about what burned, which is the\n * honest rendering when nobody can say.\n *\n * It no longer decides the threshold on its own: {@link burnedFraction} does\n * that, and this is only consulted when that is absent.\n */\n grantCycle?: number\n /**\n * How much of the cycle's grant has burned, as a fraction -- `0.88` for 88%.\n * Drives the threshold state, and is the figure the chip rounds into its pill.\n *\n * Passed in rather than derived, for exactly the reason {@link burnNote}\n * already is: the burn is the product's measurement to make, not the chip's.\n * The chip kept the arithmetic while taking the runway line as a prop, and fed\n * it from a denominator no product could supply -- so the measurement was the\n * chip's in name and nobody's in fact (B33-483).\n *\n * The *policy* stays here. `THRESHOLD_BURN` is 0.8 in this package, so four\n * products trip at the same place and cannot drift to four different numbers.\n * That is why this is a fraction and not a `threshold?: boolean`: a boolean\n * would move the 80% decision into each consumer, and it would leave the pill\n * with no figure to print.\n *\n * Supplied, it wins. Absent, the chip derives it from {@link grantCycle} as it\n * always did; absent with no `grantCycle` either, nothing is claimed and the\n * chip rests.\n *\n * It is not clamped. A consumer that passes a percentage where a fraction\n * belongs renders a visibly absurd pill rather than a plausible \"100%\", and a\n * wrong figure that looks wrong is the one that gets fixed.\n */\n burnedFraction?: number\n /** When the current grant expires, preformatted for display, e.g. \"30 Sep\". */\n grantExpires?: string\n /**\n * The threshold state's runway line, preformatted, e.g. \"About four days left\n * at your current burn.\" Passed in rather than derived: the burn estimate is\n * the product's to make, not the chip's -- the chip renders what it is given.\n */\n burnNote?: string\n}\n\n/**\n * The chip whose balance could not be confirmed. It renders an em dash, no bar\n * and no button, so **it takes no figures at all** -- each one below is\n * `?: never`.\n *\n * That is deliberate and it is the second half of B33-483. The figures were\n * required in every state, so both consumers manufactured zeroes to get past the\n * type and then apologised for them in a comment -- \"these zeroes are never\n * rendered ... but they are not a balance and must not be read as one\"\n * (`boostscore/components/app-shell/wallet-chip.tsx`), and the same again in\n * `wallet-slot.tsx` and `boostledger/src/app/(wallet)/layout.tsx`. A zero is a\n * confident claim about someone's money. The type now refuses it rather than\n * asking a comment to.\n *\n * `undefined` is still accepted, so a consumer that must build one props object\n * can write `{ unknown: true, granted: undefined }` instead of branching.\n */\nexport interface WalletChipUnknownProps extends WalletChipChromeProps {\n /** The balance could not be confirmed. Renders as unknown, never as zero. */\n unknown: true\n granted?: never\n purchased?: never\n grantCycle?: never\n burnedFraction?: never\n /** Not rendered in this state: the footer only draws on a resting chip. */\n grantExpires?: never\n /** Not rendered in this state: the runway line only draws past the threshold. */\n burnNote?: never\n}\n\n/**\n * A discriminated union on `unknown`, and the discriminant has consequences for\n * how a consumer *types* its own code, not only what it passes:\n *\n * - A helper that returns props for both states needs an explicit\n * `: WalletChipProps` return annotation. Without one, TypeScript widens the\n * `unknown: true` in an object literal to `boolean`, which matches neither\n * member, and the spread at the call site stops compiling.\n * - `Omit<WalletChipProps, 'onTopUp'>` is not what it looks like. `Omit` over a\n * union flattens it into one object and loses the discrimination. Omit from\n * the members instead -- `Omit<WalletChipKnownProps, 'onTopUp'> |\n * Omit<WalletChipUnknownProps, 'onTopUp'>` -- which is why both are exported.\n */\nexport type WalletChipProps = WalletChipKnownProps | WalletChipUnknownProps\n\n/**\n * The granted/purchased bar. Granted is drawn first, because granted burns\n * first. The accessible label is passed in whole rather than assembled here:\n * word order is the consumer's, not English's (B33-849).\n */\nfunction Bar({ granted, purchased, cycleTotal, tone, label }: { granted: number; purchased: number; cycleTotal: number; tone: 'rest' | 'threshold'; label: string }) {\n return (\n <div className={styles.bar} data-tone={tone} role=\"img\" aria-label={label}>\n <span className={styles.segmentGranted} data-testid=\"segment-granted\" style={{ width: segmentWidth(granted, cycleTotal) }} />\n <span className={styles.segmentPurchased} data-testid=\"segment-purchased\" style={{ width: segmentWidth(purchased, cycleTotal) }} />\n </div>\n )\n}\n\nexport function WalletChip({ granted = 0, purchased = 0, grantCycle, burnedFraction, grantExpires, burnNote, unknown = false, collapsed = false, onTopUp, labels, locale = DEFAULT_WALLET_LOCALE }: WalletChipProps) {\n const t = resolveWalletChipLabels(labels)\n // Assembled lazily: the unknown state draws no bar, and a consumer's `bar`\n // implementation can throw on the zeroes the destructure above defaults the\n // degraded path's absent figures to. Calling it only where a bar renders keeps\n // that crash surface off the render that exists precisely because fetching the\n // balance already failed (B33-875). B33-483 stopped the consumer having to pass\n // those zeroes; the chip still has to pick something, so the laziness stays.\n const buildBarLabel = () =>\n t.bar(formatTokens(granted, locale), formatTokens(purchased, locale), formatTokens(granted + purchased, locale))\n const balance = granted + purchased\n // Everything the cycle started with: the grant plus the purchased balance\n // sitting alongside it. Measuring against this is what makes the bar shorten\n // as tokens burn instead of only re-proportioning to a full width.\n //\n // With no `grantCycle` the denominator falls back to `granted + purchased`, so\n // the bar fills and there is no burned track -- the honest drawing when nobody\n // can say what the cycle started with (B33-483). The zero-division guard inside\n // segmentWidth still covers the case where that balance is itself zero.\n const cycleTotal = (grantCycle ?? granted) + purchased\n // How much of the cycle's grant has burned. The consumer's own figure wins;\n // `grantCycle` derives it exactly as it always did; with neither, nothing is\n // claimed and the chip rests. `grantCycle` is tested against undefined rather\n // than leaned on for falsiness, because 0 and \"not supplied\" both resolve to a\n // burn of 0 and must keep doing so.\n const derivedBurn = grantCycle !== undefined && grantCycle > 0 ? (grantCycle - granted) / grantCycle : 0\n const burned = burnedFraction ?? derivedBurn\n const isThreshold = !unknown && burned >= THRESHOLD_BURN\n\n if (collapsed) {\n // The abbreviated balance, assembled once: it is both the rail's visible\n // text and the figure the group's accessible name is built around, and a\n // sighted user and a screen-reader user must not be told different numbers.\n // Built only when a balance is known, for the same reason buildBarLabel is\n // lazy -- the unknown rail shows no figure, and a consumer's railFigure\n // should not run on a degraded path it never renders on (B33-875).\n const railBalance = unknown ? undefined : t.railFigure(thousandsFigure(balance, locale))\n return (\n <div className={styles.rail} role=\"group\" aria-label={railBalance === undefined ? t.railBalanceUnknown : t.railBalance(railBalance)} tabIndex={0}>\n <WalletMark className={styles.railIcon} />\n <span className={styles.railFigure}>{railBalance ?? '—'}</span>\n {unknown ? <span className={styles.srOnly}>{t.railUnknown}</span> : <Bar granted={granted} purchased={purchased} cycleTotal={cycleTotal} tone={isThreshold ? 'threshold' : 'rest'} label={buildBarLabel()} />}\n </div>\n )\n }\n\n return (\n <div className={styles.chip} role=\"group\" aria-label={t.region} tabIndex={0} data-threshold={isThreshold ? 'true' : undefined} data-unknown={unknown ? 'true' : undefined}>\n <div className={styles.header}>\n <span className={styles.name}>{t.name}</span>\n {isThreshold && <span className={styles.pill}>{Math.round(burned * 100)}%</span>}\n </div>\n\n {unknown ? (\n <div className={styles.figure}>\n <span className={styles.amount} aria-hidden=\"true\">\n {'—'}\n </span>\n <RetryMark className={styles.retry} />\n <span className={styles.srOnly}>{t.balanceUnknown}</span>\n </div>\n ) : (\n <div className={styles.figure}>\n <span className={styles.amount}>{formatTokens(balance, locale)}</span>\n <span className={styles.unit}>{t.unit}</span>\n </div>\n )}\n\n {unknown ? (\n <div className={styles.bar} data-tone=\"unknown\" aria-hidden=\"true\" />\n ) : (\n <Bar granted={granted} purchased={purchased} cycleTotal={cycleTotal} tone={isThreshold ? 'threshold' : 'rest'} label={buildBarLabel()} />\n )}\n\n {!unknown && !isThreshold && (\n <div className={styles.details}>\n <dl className={styles.split}>\n <div className={styles.splitRow}>\n <dt className={styles.splitLabel}>\n <span className={styles.dotGranted} aria-hidden=\"true\" />\n {t.granted}\n </dt>\n <dd className={styles.splitAmount}>{formatTokens(granted, locale)}</dd>\n </div>\n <div className={styles.splitRow}>\n <dt className={styles.splitLabel}>\n <span className={styles.dotPurchased} aria-hidden=\"true\" />\n {t.purchased}\n </dt>\n <dd className={styles.splitAmount}>{formatTokens(purchased, locale)}</dd>\n </div>\n </dl>\n {grantExpires && <p className={styles.footer}>{t.grantExpiry(grantExpires)}</p>}\n </div>\n )}\n\n {isThreshold && burnNote && <p className={styles.burnNote}>{burnNote}</p>}\n\n {/* A handler is what makes the button exist, not only what it does when\n pressed (B33-1270). `!unknown` alone drew it for a consumer with\n nowhere to send anyone, and a hashed class name left them no way to\n take it back out -- see `onTopUp`. Tested against `undefined` rather\n than for truthiness so that `onTopUp={undefined}`, which is what a\n consumer's own absent value looks like, reads the same as omitting it. */}\n {!unknown && onTopUp !== undefined && (\n <button type=\"button\" className={styles.topUp} data-grown={isThreshold ? 'true' : undefined} onClick={onTopUp}>\n {t.topUp}\n </button>\n )}\n </div>\n )\n}\n"],"names":["THRESHOLD_BURN","SEGMENT_MIN","segmentWidth","amount","cycleTotal","share","Bar","granted","purchased","tone","label","jsxs","styles","jsx","WalletChip","grantCycle","burnedFraction","grantExpires","burnNote","unknown","collapsed","onTopUp","labels","locale","DEFAULT_WALLET_LOCALE","t","resolveWalletChipLabels","buildBarLabel","formatTokens","balance","derivedBurn","burned","isThreshold","railBalance","thousandsFigure","WalletMark","RetryMark"],"mappings":";;;;;;AAoBA,MAAMA,IAAiB,KAKjBC,IAAc;AA6BpB,SAASC,EAAaC,GAAgBC,GAA4B;AAIhE,QAAMC,IAAQD,IAAa,IAAKD,IAASC,IAAc,MAAM;AAC7D,SAAID,KAAU,IAAU,GAAGE,CAAK,MACzB,OAAOA,CAAK,MAAMJ,CAAW;AACtC;AA+LA,SAASK,EAAI,EAAE,SAAAC,GAAS,WAAAC,GAAW,YAAAJ,GAAY,MAAAK,GAAM,OAAAC,KAAgH;AACnK,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,KAAK,aAAWH,GAAM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C,UAAA,EAAO,MAAK,UAAS,WAAWD,EAAO,OAAO,cAAYoB,IAAc,SAAS,QAAW,SAASX,GACnG,YAAE,MAAA,CACL;AAAA,EAAA,GAEJ;AAEJ;"}
1
+ {"version":3,"file":"WalletChip.js","sources":["../../../src/components/WalletChip/WalletChip.tsx"],"sourcesContent":["'use client'\n\n// A client module: the chip wires `onTopUp` to a button's onClick, which a\n// Server Component cannot carry. The rest of the shell stays on the server --\n// see Sidebar and B33-846.\n\nimport type { ElementType } from 'react'\nimport { useAnchoredOverlay } from '../../anchored-overlay'\nimport { Chevron } from '../AppSwitcher/icons'\nimport buttons from '../../buttons.module.css'\nimport styles from './WalletChip.module.css'\nimport { DEFAULT_WALLET_LOCALE, formatTokens, thousandsFigure } from './format'\nimport { RetryMark, WalletMark } from './icons'\nimport { resolveWalletChipLabels, type WalletChipLabels } from './labels'\n\n// Past this fraction of the cycle's grant burned, the chip stops resting. The\n// spec's threshold, in one place so the derivation and the styling agree.\n//\n// It stays in the package and is not a prop, which is the whole reason\n// `burnedFraction` is a fraction rather than a `threshold?: boolean` (B33-483).\n// The consumer measures its own burn; 80% is where four products agree that\n// measurement means something, and a boolean would hand each of them the policy\n// and let it drift. It also happens to agree with the middle rung of Score's own\n// burndown alerts, so adopting it changed no product decision.\nconst THRESHOLD_BURN = 0.8\n\n// The floor under a non-zero bar segment, named once so the width expression\n// below reads as what it is. The value and its derivation live in the token --\n// see --spacing-wallet-segment-min in tokens.css.\nconst SEGMENT_MIN = 'var(--spacing-wallet-segment-min)'\n\n/**\n * A bar segment's CSS `width`: its honest share of everything the cycle started\n * with, floored so that a non-zero amount is never drawn below one visible mark.\n *\n * `max()` rather than a `min-width` on the segment classes, and the reason is the\n * zero case (B33-590). A stylesheet sees only the percentage, and no CSS length\n * can tell 0% from 0.3% -- a bare `min-width` would floor a wallet that holds\n * none of that kind of token into a phantom sliver, which is the same lie in the\n * other direction. The decision needs the amount itself, so it is made here where\n * the amount is, in one expression instead of a rule plus a signal from the\n * component to switch it off. `max()` also keeps the honest percentage wherever\n * the share clears the floor: the floor only ever wins when the truth is\n * unpaintable.\n *\n * Why it needs flooring at all: once a seller has bought tokens the grant is a\n * small share of the cycle, and a small share of a 240px bar is a fraction of a\n * pixel. Score measured 3,000 granted rendering at `width: 0.3%` -- 0.72px, which\n * paints nothing, while the ledger still held the grant. Both segments are\n * floored: purchased burns second, so it drains to zero through every small\n * number on the way, and 10 purchased on a spent 3,000 grant is 0.33% of the\n * cycle and the seller's entire remaining balance.\n *\n * This is the second time the rendering has been reported. Score fixed it in its\n * own wallet markup; B33-482 replaced that markup with this component, which\n * carried no floor. Its record of the first fix is still on disk there, as dead\n * code, at components/app-shell/wallet-bar.ts.\n */\nfunction segmentWidth(amount: number, cycleTotal: number): string {\n // A cycle of nothing has no shares in it. Guarded because the divisor is\n // reachable -- a known balance of zero on a cycle that granted zero rendered\n // `width: NaN%`, which a browser drops rather than reports.\n const share = cycleTotal > 0 ? (amount / cycleTotal) * 100 : 0\n if (amount <= 0) return `${share}%`\n return `max(${share}%, ${SEGMENT_MIN})`\n}\n\n/**\n * The props that say nothing about a balance, so both states take them\n * identically: where the chip is drawn, what it is wired to, and the words and\n * number formats it renders with.\n */\ninterface WalletChipChromeProps {\n /**\n * Where the chip is drawn. `'sidebar'`, the default, is the card it has always\n * been, pinned at the sidebar's foot. `'topbar'` is the 3 Nov 2026 redesign's\n * token chip (B33-1712, boards 20 and 21): a 32px pill in the top bar, drawn\n * like the app switcher, that opens a popover with the breakdown.\n *\n * One component in two placements rather than a second component, because the\n * figures, the bar's rules and every word are the same chip's (CLAUDE.md:\n * build once, add a prop). `collapsed` applies to the sidebar placement only;\n * the top bar has no rail.\n */\n placement?: 'sidebar' | 'topbar'\n /**\n * Where the popover's \"Open\" link goes -- the Wallet. `placement=\"topbar\"`\n * only. Omit it and the popover draws no link. The consumer supplies the URL;\n * Identity owns where the Wallet lives.\n */\n walletHref?: string\n /**\n * The element the popover's \"Open\" link renders through, so it routes\n * client-side with the locale prefix intact (ADR-0011). Defaults to `a`.\n */\n linkComponent?: ElementType\n /** Render the top-bar popover open on first paint -- the specimen's open state. */\n defaultOpen?: boolean\n /** The 56px rail. Abbreviates the balance and turns the split on its side. */\n collapsed?: boolean\n /**\n * Top up. Wiring for the one button the sidebar is allowed to have.\n *\n * **It is also what makes that button exist.** Omit it and the chip draws no\n * top-up affordance at all, in every state, and that is the fix B33-1270 made.\n * The render used to be gated on `!unknown` alone, so a consumer that passed\n * no handler got a visible control that did nothing and could not be removed\n * -- `.topUp`'s class name is CSS-Modules-hashed, so there is no selector to\n * reach it from outside the package.\n *\n * That was not hypothetical in either consumer. The Wallet passes no handler\n * and ships the dead button today\n * (`boostledger/src/app/(wallet)/WalletShell.tsx`), and Score wrote a whole\n * client module to arm it across a Server Component boundary rather than live\n * with it (`boostscore/components/app-shell/wallet-chip-top-up.tsx`, which\n * says so at length).\n *\n * Nothing renders in the button's place. It carries no information of its own\n * -- only its own affordance -- so a consumer with nowhere to send someone is\n * better served by the chip without it than by a disabled one they did not\n * ask for (ADR-0010, \"Not entitled is not disabled\", on why unavailable is not\n * the same as disabled). B33-1047 is the other half: an `href` form of the\n * same affordance, for a consumer that cannot pass a callback at all.\n */\n onTopUp?: () => void\n /**\n * The chip's user-facing strings. Every field has an English default, so a\n * consumer supplies only the ones it translates; the first two consumers are\n * French-default. The package takes no i18n dependency -- it renders what it\n * is given (B33-849).\n *\n * Every field is a plain string, so the whole object crosses the React Server\n * Component boundary and a Next App Router page can build it. The four labels\n * that carry a value mark its position with a `%placeholder%` (B33-1277). None\n * of them takes a function: that form only ever worked from a Client Component\n * and nothing in the type said so (B33-880, B33-1278).\n */\n labels?: Partial<WalletChipLabels>\n /**\n * The BCP-47 language tag the chip's figures are formatted in. Defaults to\n * `en-US`, which is what the chip rendered before this prop existed.\n *\n * `labels` gives the consumer the chip's words; this gives it their numbers.\n * French writes `4 600` where English writes `4,600`, and a label cannot fix\n * it -- the label functions receive the figures already formatted, so before\n * this prop there was no hook at all (B33-876). Grouping and the decimal\n * separator are CLDR facts about a locale rather than a property of the\n * consumer's sentence, so a tag is enough: `Intl.NumberFormat` knows the rest,\n * and a tag is a plain string, which a Server Component can pass where a\n * formatter function could not.\n *\n * It reaches the visible figures and, because the same strings are\n * interpolated into them, the `bar` and `railBalance` accessible names.\n *\n * The `k` after the rail's abbreviated balance is a word, not a number, so it\n * is `labels.railFigure` and not this.\n */\n locale?: string\n}\n\n/**\n * The chip with a balance the consumer stands behind. The two remaining figures\n * are required, because this is the state that renders them.\n */\nexport interface WalletChipKnownProps extends WalletChipChromeProps {\n /**\n * Absent or `false`. The discriminant: it is what makes the figures below\n * required here and forbidden in {@link WalletChipUnknownProps}.\n */\n unknown?: false\n /** Absent or `false`: see {@link WalletChipTotalOnlyProps}. */\n totalOnly?: false\n /** Remaining granted tokens. Granted burns first and expires. */\n granted: number\n /** Remaining purchased tokens. Purchased never expires. */\n purchased: number\n /**\n * What this cycle's grant started with, if the consumer knows. The bar's full\n * width alongside purchased, so the part already burned draws as empty track\n * and the filled portion shortens as the month runs.\n *\n * **Optional, and that is the fix B33-483 made.** It used to be required, and\n * no consumer could satisfy it honestly: it is the Ledger's\n * `grant_tokens_per_cycle`, and it cannot be reconstructed from a balance --\n * `cycleUsedPct` counts purchased-bucket spend, is not `(cycle total -\n * remaining)` once a credit, refund or void has touched the account, and is not\n * bounded at 100. So the Wallet passed `grantCycle = granted`, which pins\n * `burned` at 0 and held the threshold state unreachable in the reference\n * implementation, and Score passed a local per-plan belief instead.\n *\n * Omitted, the bar measures against `granted + purchased` -- the balance\n * itself. It then draws full and claims nothing about what burned, which is the\n * honest rendering when nobody can say.\n *\n * It no longer decides the threshold on its own: {@link burnedFraction} does\n * that, and this is only consulted when that is absent.\n */\n grantCycle?: number\n /**\n * How much of the cycle's grant has burned, as a fraction -- `0.88` for 88%.\n * Drives the threshold state, and is the figure the chip rounds into its pill.\n *\n * Passed in rather than derived, for exactly the reason {@link burnNote}\n * already is: the burn is the product's measurement to make, not the chip's.\n * The chip kept the arithmetic while taking the runway line as a prop, and fed\n * it from a denominator no product could supply -- so the measurement was the\n * chip's in name and nobody's in fact (B33-483).\n *\n * The *policy* stays here. `THRESHOLD_BURN` is 0.8 in this package, so four\n * products trip at the same place and cannot drift to four different numbers.\n * That is why this is a fraction and not a `threshold?: boolean`: a boolean\n * would move the 80% decision into each consumer, and it would leave the pill\n * with no figure to print.\n *\n * Supplied, it wins. Absent, the chip derives it from {@link grantCycle} as it\n * always did; absent with no `grantCycle` either, nothing is claimed and the\n * chip rests.\n *\n * It is not clamped. A consumer that passes a percentage where a fraction\n * belongs renders a visibly absurd pill rather than a plausible \"100%\", and a\n * wrong figure that looks wrong is the one that gets fixed.\n */\n burnedFraction?: number\n /** When the current grant expires, preformatted for display, e.g. \"30 Sep\". */\n grantExpires?: string\n /**\n * The threshold state's runway line, preformatted, e.g. \"About four days left\n * at your current burn.\" Passed in rather than derived: the burn estimate is\n * the product's to make, not the chip's -- the chip renders what it is given.\n */\n burnNote?: string\n}\n\n/**\n * The chip whose balance could not be confirmed. It renders an em dash, no bar\n * and no button, so **it takes no figures at all** -- each one below is\n * `?: never`.\n *\n * That is deliberate and it is the second half of B33-483. The figures were\n * required in every state, so both consumers manufactured zeroes to get past the\n * type and then apologised for them in a comment -- \"these zeroes are never\n * rendered ... but they are not a balance and must not be read as one\"\n * (`boostscore/components/app-shell/wallet-chip.tsx`), and the same again in\n * `wallet-slot.tsx` and `boostledger/src/app/(wallet)/layout.tsx`. A zero is a\n * confident claim about someone's money. The type now refuses it rather than\n * asking a comment to.\n *\n * `undefined` is still accepted, so a consumer that must build one props object\n * can write `{ unknown: true, granted: undefined }` instead of branching.\n */\nexport interface WalletChipUnknownProps extends WalletChipChromeProps {\n /** The balance could not be confirmed. Renders as unknown, never as zero. */\n unknown: true\n totalOnly?: false\n balance?: never\n granted?: never\n purchased?: never\n grantCycle?: never\n burnedFraction?: never\n /** Not rendered in this state: the footer only draws on a resting chip. */\n grantExpires?: never\n /** Not rendered in this state: the runway line only draws past the threshold. */\n burnNote?: never\n}\n\n/**\n * A discriminated union on `unknown`, and the discriminant has consequences for\n * how a consumer *types* its own code, not only what it passes:\n *\n * - A helper that returns props for both states needs an explicit\n * `: WalletChipProps` return annotation. Without one, TypeScript widens the\n * `unknown: true` in an object literal to `boolean`, which matches neither\n * member, and the spread at the call site stops compiling.\n * - `Omit<WalletChipProps, 'onTopUp'>` is not what it looks like. `Omit` over a\n * union flattens it into one object and loses the discrimination. Omit from\n * the members instead -- `Omit<WalletChipKnownProps, 'onTopUp'> |\n * Omit<WalletChipUnknownProps, 'onTopUp'>` -- which is why both are exported.\n */\nexport type WalletChipProps = WalletChipKnownProps | WalletChipUnknownProps | WalletChipTotalOnlyProps\n\n/**\n * The top-bar chip with a real total and no drawable split (B33-1712). Debits\n * draw the grant first, then purchased, and may run a set share past zero (the\n * Ledger's overdraft); credits add only to the bucket they name and never pay a\n * negative one off. So the Ledger can report a bucket below zero -- granted 0 /\n * purchased -40 (overdrawn, total -40), or granted 1000 / purchased -40 after\n * the month's grant lands (total 960, for the rest of the month). A two-segment\n * bar cannot draw a negative, and clamping it to zero would draw a split nobody\n * has: a split invented by the interface. So this state takes **the total and\n * no split**, and draws no bar and no granted / purchased legend.\n *\n * Below zero the figure is the distance past zero, positive, in --color-danger,\n * with the words \"past zero\" where a minus sign would be -- the Wallet's own\n * past-zero screen (boostledger, Paper 201 screen 03), followed rather than\n * inventing a third look. Nothing is broken and the copy does not say it is;\n * what happens next is the consumer's `burnNote`, because the overdraft limit is\n * the Ledger's. At zero or above it is the plain balance.\n *\n * **Top bar only.** The sidebar card has no drawing for this and the redesigned\n * shell does not render it, so the type requires `placement=\"topbar\"` rather\n * than leaving the card to guess. No board draws either form: they are new\n * undrawn states for the person at the gate to judge.\n */\nexport interface WalletChipTotalOnlyProps extends WalletChipChromeProps {\n placement: 'topbar'\n totalOnly: true\n unknown?: false\n /**\n * The balance, signed, in whole tokens: `granted + purchased` from the\n * Ledger's signed figures, which its single balance row guarantees is the\n * balance.\n */\n balance: number\n /**\n * What happens next, preformatted, e.g. \"Work carries on for another 930\n * tokens, then paid actions stop.\" The consumer's, because the overdraft limit\n * is the Ledger's, not the chip's.\n */\n burnNote?: string\n granted?: never\n purchased?: never\n grantCycle?: never\n burnedFraction?: never\n grantExpires?: never\n}\n\n/**\n * The granted/purchased bar. Granted is drawn first, because granted burns\n * first. The accessible label is passed in whole rather than assembled here:\n * word order is the consumer's, not English's (B33-849).\n */\nfunction Bar({ granted, purchased, cycleTotal, tone, label }: { granted: number; purchased: number; cycleTotal: number; tone: 'rest' | 'threshold'; label: string }) {\n return (\n <div className={styles.bar} data-tone={tone} role=\"img\" aria-label={label}>\n <span className={styles.segmentGranted} data-testid=\"segment-granted\" style={{ width: segmentWidth(granted, cycleTotal) }} />\n <span className={styles.segmentPurchased} data-testid=\"segment-purchased\" style={{ width: segmentWidth(purchased, cycleTotal) }} />\n </div>\n )\n}\n\nexport function WalletChip(props: WalletChipProps) {\n if (props.totalOnly === true) return <TotalOnlyChip {...props} />\n if (props.placement === 'topbar') return <TopBarChip {...props} />\n return <SidebarChip {...props} />\n}\n\n/**\n * The top-bar token chip (B33-1712). The pill shows the balance and the\n * two-segment bar; the popover (board 21) shows the figure, the bar again at\n * width, each kind of token with what it means, the runway line, and the buy\n * button.\n *\n * Both segments are always drawn and a zero one is 0px wide with the gap kept\n * -- board 22, and B33-590's rule that a zero is never drawn as a sliver. That\n * overrides B33-1712's line about copying the hub's 4px floor, by Jamal's\n * decision of 3 Nov 2026. A non-zero segment keeps the existing floor\n * (`segmentWidth`).\n *\n * Every figure is the consumer's. Unknown renders an em dash, no bar and no\n * breakdown -- a made-up split in a token balance is a commercial fact invented\n * by the interface (B33-1712).\n *\n * A disclosure, like the switcher (ADR-0010): the trigger is a button, the\n * panel carries no widget role, and dismissal is the shared anchored-overlay\n * contract's (ADR-0009).\n */\nfunction TopBarChip({ granted = 0, purchased = 0, grantExpires, burnNote, unknown = false, onTopUp, labels, locale = DEFAULT_WALLET_LOCALE, walletHref, linkComponent, defaultOpen }: WalletChipProps) {\n const t = resolveWalletChipLabels(labels)\n const overlay = useAnchoredOverlay({ defaultOpen })\n const Link: ElementType = linkComponent ?? 'a'\n const balance = granted + purchased\n // The pill and the popover draw the split of the balance itself: no burned\n // track, because the top bar claims nothing about what the cycle started\n // with. The sidebar card still does, from `grantCycle`.\n const total = balance\n const figure = unknown ? '—' : formatTokens(balance, locale)\n const buildBarLabel = () => t.bar(formatTokens(granted, locale), formatTokens(purchased, locale), formatTokens(balance, locale))\n\n return (\n <div className={styles.topRoot}>\n <button type=\"button\" className={styles.topTrigger} aria-label={unknown ? t.railBalanceUnknown : t.railBalance(figure)} onClick={overlay.toggle} {...overlay.triggerProps}>\n <span className={styles.topFigure} aria-hidden=\"true\">\n <span className={styles.topAmount}>{figure}</span>\n <span className={styles.topUnit}>{t.unit}</span>\n </span>\n {!unknown && <TopBar granted={granted} purchased={purchased} total={total} className={styles.topBar} />}\n <Chevron className={styles.topChevron} />\n </button>\n\n {overlay.open && (\n <div {...overlay.panelProps} className={styles.popover} aria-label={t.popover}>\n <div className={styles.popHead}>\n <span className={styles.popFigure}>\n <span className={styles.popAmount}>{figure}</span>\n <span className={styles.popUnit}>{t.unit}</span>\n </span>\n {walletHref !== undefined && (\n <Link className={buttons.quiet} href={walletHref} onClick={overlay.close}>\n {t.open}\n </Link>\n )}\n </div>\n\n {unknown ? (\n <p className={styles.popNote}>{t.balanceUnknown}</p>\n ) : (\n <>\n <TopBar granted={granted} purchased={purchased} total={total} className={styles.popBar} label={buildBarLabel()} />\n <ul className={styles.legend}>\n <li className={styles.legendRow}>\n <span className={styles.swatchGranted} aria-hidden=\"true\" />\n <span className={styles.legendText}>\n <span className={styles.legendFigure}>{t.grantedFigure(formatTokens(granted, locale))}</span>\n <span className={styles.legendNote}>{grantExpires ? t.grantedNote(grantExpires) : t.grantedNoteUndated}</span>\n </span>\n </li>\n <li className={styles.legendRow}>\n <span className={styles.swatchPurchased} aria-hidden=\"true\" />\n <span className={styles.legendText}>\n <span className={styles.legendFigure}>{t.purchasedFigure(formatTokens(purchased, locale))}</span>\n <span className={styles.legendNote}>{t.purchasedNote}</span>\n </span>\n </li>\n </ul>\n {(burnNote || onTopUp !== undefined) && (\n <div className={styles.popFoot}>\n {burnNote && <p className={styles.popNote}>{burnNote}</p>}\n {onTopUp !== undefined && (\n <button type=\"button\" className={`${buttons.primary} ${styles.buy}`} data-tone=\"accent\" onClick={onTopUp}>\n {t.buyTokens}\n </button>\n )}\n </div>\n )}\n </>\n )}\n </div>\n )}\n </div>\n )\n}\n\n/**\n * The top-bar chip with no drawable split (`WalletChipTotalOnlyProps`): the same\n * pill and popover as {@link TopBarChip}, with the total alone -- the distance\n * past zero when it is below -- and no bar and no legend anywhere.\n */\nfunction TotalOnlyChip({ balance, burnNote, onTopUp, labels, locale = DEFAULT_WALLET_LOCALE, walletHref, linkComponent, defaultOpen }: WalletChipTotalOnlyProps) {\n const t = resolveWalletChipLabels(labels)\n const overlay = useAnchoredOverlay({ defaultOpen })\n const Link: ElementType = linkComponent ?? 'a'\n const pastZero = balance < 0\n const figure = formatTokens(pastZero ? -balance : balance, locale)\n\n return (\n <div className={styles.topRoot} data-past-zero={pastZero ? 'true' : undefined}>\n <button type=\"button\" className={styles.topTrigger} aria-label={pastZero ? t.pastZeroBalance(figure) : t.railBalance(figure)} onClick={overlay.toggle} {...overlay.triggerProps}>\n <span className={styles.topFigure} aria-hidden=\"true\">\n <span className={styles.topAmount}>{figure}</span>\n <span className={styles.topUnit}>{pastZero ? t.pastZero : t.unit}</span>\n </span>\n <Chevron className={styles.topChevron} />\n </button>\n\n {overlay.open && (\n <div {...overlay.panelProps} className={styles.popover} aria-label={t.popover}>\n <div className={styles.popHead}>\n <span className={styles.popFigure}>\n <span className={styles.popAmount}>{figure}</span>\n <span className={styles.popUnit}>{pastZero ? t.pastZeroLong : t.unit}</span>\n </span>\n {walletHref !== undefined && (\n <Link className={styles.popOpen} href={walletHref} onClick={overlay.close}>\n {t.open}\n </Link>\n )}\n </div>\n {(burnNote || onTopUp !== undefined) && (\n <div className={styles.popFoot}>\n {burnNote && <p className={styles.popNote}>{burnNote}</p>}\n {onTopUp !== undefined && (\n <button type=\"button\" className={styles.buy} onClick={onTopUp}>\n {t.buyTokens}\n </button>\n )}\n </div>\n )}\n </div>\n )}\n </div>\n )\n}\n\n/**\n * The top bar's two-segment bar, in the pill and in the popover. Granted first,\n * because it burns first; a fixed gap between the two that stays when a segment\n * is zero, so a two-part balance never reads as one lump (board 22).\n */\nfunction TopBar({ granted, purchased, total, className, label }: { granted: number; purchased: number; total: number; className?: string; label?: string }) {\n return (\n <span className={className} role={label ? 'img' : undefined} aria-label={label} aria-hidden={label ? undefined : 'true'}>\n <span className={styles.segmentGranted} data-segment=\"granted\" style={{ width: segmentWidth(granted, total) }} />\n <span className={styles.segmentPurchased} data-segment=\"purchased\" style={{ width: segmentWidth(purchased, total) }} />\n </span>\n )\n}\n\nfunction SidebarChip({ granted = 0, purchased = 0, grantCycle, burnedFraction, grantExpires, burnNote, unknown = false, collapsed = false, onTopUp, labels, locale = DEFAULT_WALLET_LOCALE }: WalletChipProps) {\n const t = resolveWalletChipLabels(labels)\n // Assembled lazily: the unknown state draws no bar, and a consumer's `bar`\n // implementation can throw on the zeroes the destructure above defaults the\n // degraded path's absent figures to. Calling it only where a bar renders keeps\n // that crash surface off the render that exists precisely because fetching the\n // balance already failed (B33-875). B33-483 stopped the consumer having to pass\n // those zeroes; the chip still has to pick something, so the laziness stays.\n const buildBarLabel = () =>\n t.bar(formatTokens(granted, locale), formatTokens(purchased, locale), formatTokens(granted + purchased, locale))\n const balance = granted + purchased\n // Everything the cycle started with: the grant plus the purchased balance\n // sitting alongside it. Measuring against this is what makes the bar shorten\n // as tokens burn instead of only re-proportioning to a full width.\n //\n // With no `grantCycle` the denominator falls back to `granted + purchased`, so\n // the bar fills and there is no burned track -- the honest drawing when nobody\n // can say what the cycle started with (B33-483). The zero-division guard inside\n // segmentWidth still covers the case where that balance is itself zero.\n const cycleTotal = (grantCycle ?? granted) + purchased\n // How much of the cycle's grant has burned. The consumer's own figure wins;\n // `grantCycle` derives it exactly as it always did; with neither, nothing is\n // claimed and the chip rests. `grantCycle` is tested against undefined rather\n // than leaned on for falsiness, because 0 and \"not supplied\" both resolve to a\n // burn of 0 and must keep doing so.\n const derivedBurn = grantCycle !== undefined && grantCycle > 0 ? (grantCycle - granted) / grantCycle : 0\n const burned = burnedFraction ?? derivedBurn\n const isThreshold = !unknown && burned >= THRESHOLD_BURN\n\n if (collapsed) {\n // The abbreviated balance, assembled once: it is both the rail's visible\n // text and the figure the group's accessible name is built around, and a\n // sighted user and a screen-reader user must not be told different numbers.\n // Built only when a balance is known, for the same reason buildBarLabel is\n // lazy -- the unknown rail shows no figure, and a consumer's railFigure\n // should not run on a degraded path it never renders on (B33-875).\n const railBalance = unknown ? undefined : t.railFigure(thousandsFigure(balance, locale))\n return (\n <div className={styles.rail} role=\"group\" aria-label={railBalance === undefined ? t.railBalanceUnknown : t.railBalance(railBalance)} tabIndex={0}>\n <WalletMark className={styles.railIcon} />\n <span className={styles.railFigure}>{railBalance ?? '—'}</span>\n {unknown ? <span className={styles.srOnly}>{t.railUnknown}</span> : <Bar granted={granted} purchased={purchased} cycleTotal={cycleTotal} tone={isThreshold ? 'threshold' : 'rest'} label={buildBarLabel()} />}\n </div>\n )\n }\n\n return (\n <div className={styles.chip} role=\"group\" aria-label={t.region} tabIndex={0} data-threshold={isThreshold ? 'true' : undefined} data-unknown={unknown ? 'true' : undefined}>\n <div className={styles.header}>\n <span className={styles.name}>{t.name}</span>\n {isThreshold && <span className={styles.pill}>{Math.round(burned * 100)}%</span>}\n </div>\n\n {unknown ? (\n <div className={styles.figure}>\n <span className={styles.amount} aria-hidden=\"true\">\n {'—'}\n </span>\n <RetryMark className={styles.retry} />\n <span className={styles.srOnly}>{t.balanceUnknown}</span>\n </div>\n ) : (\n <div className={styles.figure}>\n <span className={styles.amount}>{formatTokens(balance, locale)}</span>\n <span className={styles.unit}>{t.unit}</span>\n </div>\n )}\n\n {unknown ? (\n <div className={styles.bar} data-tone=\"unknown\" aria-hidden=\"true\" />\n ) : (\n <Bar granted={granted} purchased={purchased} cycleTotal={cycleTotal} tone={isThreshold ? 'threshold' : 'rest'} label={buildBarLabel()} />\n )}\n\n {!unknown && !isThreshold && (\n <div className={styles.details}>\n <dl className={styles.split}>\n <div className={styles.splitRow}>\n <dt className={styles.splitLabel}>\n <span className={styles.dotGranted} aria-hidden=\"true\" />\n {t.granted}\n </dt>\n <dd className={styles.splitAmount}>{formatTokens(granted, locale)}</dd>\n </div>\n <div className={styles.splitRow}>\n <dt className={styles.splitLabel}>\n <span className={styles.dotPurchased} aria-hidden=\"true\" />\n {t.purchased}\n </dt>\n <dd className={styles.splitAmount}>{formatTokens(purchased, locale)}</dd>\n </div>\n </dl>\n {grantExpires && <p className={styles.footer}>{t.grantExpiry(grantExpires)}</p>}\n </div>\n )}\n\n {isThreshold && burnNote && <p className={styles.burnNote}>{burnNote}</p>}\n\n {/* A handler is what makes the button exist, not only what it does when\n pressed (B33-1270). `!unknown` alone drew it for a consumer with\n nowhere to send anyone, and a hashed class name left them no way to\n take it back out -- see `onTopUp`. Tested against `undefined` rather\n than for truthiness so that `onTopUp={undefined}`, which is what a\n consumer's own absent value looks like, reads the same as omitting it. */}\n {!unknown && onTopUp !== undefined && (\n <button\n type=\"button\"\n // Two tiers for one button (B33-1713, ADR-0016): at rest it is a word\n // in the chip's header, the quiet tier; past the threshold it grows\n // into the chip's one call to action, the primary tier in the accent\n // tone. `.topUp` adds only where it sits.\n className={`${isThreshold ? buttons.primary : buttons.quiet} ${styles.topUp}`}\n data-tone={isThreshold ? 'accent' : undefined}\n data-grown={isThreshold ? 'true' : undefined}\n onClick={onTopUp}\n >\n {t.topUp}\n </button>\n )}\n </div>\n )\n}\n"],"names":["THRESHOLD_BURN","SEGMENT_MIN","segmentWidth","amount","cycleTotal","share","Bar","granted","purchased","tone","label","jsxs","styles","jsx","WalletChip","props","TotalOnlyChip","TopBarChip","SidebarChip","grantExpires","burnNote","unknown","onTopUp","labels","locale","DEFAULT_WALLET_LOCALE","walletHref","linkComponent","defaultOpen","t","resolveWalletChipLabels","overlay","useAnchoredOverlay","Link","balance","total","figure","formatTokens","buildBarLabel","TopBar","Chevron","buttons","Fragment","pastZero","className","grantCycle","burnedFraction","collapsed","derivedBurn","burned","isThreshold","railBalance","thousandsFigure","WalletMark","RetryMark"],"mappings":";;;;;;;;;AAwBA,MAAMA,IAAiB,KAKjBC,IAAc;AA6BpB,SAASC,EAAaC,GAAgBC,GAA4B;AAIhE,QAAMC,IAAQD,IAAa,IAAKD,IAASC,IAAc,MAAM;AAC7D,SAAID,KAAU,IAAU,GAAGE,CAAK,MACzB,OAAOA,CAAK,MAAMJ,CAAW;AACtC;AA0QA,SAASK,EAAI,EAAE,SAAAC,GAAS,WAAAC,GAAW,YAAAJ,GAAY,MAAAK,GAAM,OAAAC,KAAgH;AACnK,SACE,gBAAAC,EAAC,OAAA,EAAI,WAAWC,EAAO,KAAK,aAAWH,GAAM,MAAK,OAAM,cAAYC,GAClE,UAAA;AAAA,IAAA,gBAAAG,EAAC,QAAA,EAAK,WAAWD,EAAO,gBAAgB,eAAY,mBAAkB,OAAO,EAAE,OAAOV,EAAaK,GAASH,CAAU,IAAE,CAAG;AAAA,IAC3H,gBAAAS,EAAC,QAAA,EAAK,WAAWD,EAAO,kBAAkB,eAAY,qBAAoB,OAAO,EAAE,OAAOV,EAAaM,GAAWJ,CAAU,IAAE,CAAG;AAAA,EAAA,GACnI;AAEJ;AAEO,SAASU,EAAWC,GAAwB;AACjD,SAAIA,EAAM,cAAc,KAAa,gBAAAF,EAACG,GAAA,EAAe,GAAGD,GAAO,IAC3DA,EAAM,cAAc,WAAiB,gBAAAF,EAACI,GAAA,EAAY,GAAGF,GAAO,IACzD,gBAAAF,EAACK,GAAA,EAAa,GAA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AC,OAAA,EAAI,WAAWC,EAAO,UACrB,UAAA;AAAA,UAAA,gBAAAD,EAAC,MAAA,EAAG,WAAWC,EAAO,YACpB,UAAA;AAAA,YAAA,gBAAAC,EAAC,QAAA,EAAK,WAAWD,EAAO,cAAc,eAAY,QAAO;AAAA,YACxDiB,EAAE;AAAA,UAAA,GACL;AAAA,UACA,gBAAAhB,EAAC,QAAG,WAAWD,EAAO,aAAc,UAAAyB,EAAa7B,GAAWgB,CAAM,EAAA,CAAE;AAAA,QAAA,EAAA,CACtE;AAAA,MAAA,GACF;AAAA,MACCL,uBAAiB,KAAA,EAAE,WAAWP,EAAO,QAAS,UAAAiB,EAAE,YAAYV,CAAY,EAAA,CAAE;AAAA,IAAA,GAC7E;AAAA,IAGD+B,KAAe9B,KAAY,gBAAAP,EAAC,OAAE,WAAWD,EAAO,UAAW,UAAAQ,GAAS;AAAA,IAQpE,CAACC,KAAWC,MAAY,UACvB,gBAAAT;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QAKL,WAAW,GAAGqC,IAAcT,EAAQ,UAAUA,EAAQ,KAAK,IAAI7B,EAAO,KAAK;AAAA,QAC3E,aAAWsC,IAAc,WAAW;AAAA,QACpC,cAAYA,IAAc,SAAS;AAAA,QACnC,SAAS5B;AAAA,QAER,UAAAO,EAAE;AAAA,MAAA;AAAA,IAAA;AAAA,EACL,GAEJ;AAEJ;"}
@@ -1,56 +1,102 @@
1
- const t = "_chip_xxga2_37", _ = "_header_xxga2_74", a = "_name_xxga2_83", n = "_pill_xxga2_162", s = "_figure_xxga2_171", e = "_amount_xxga2_186", o = "_unit_xxga2_195", x = "_retry_xxga2_200", r = "_bar_xxga2_209", i = "_segmentGranted_xxga2_230", c = "_segmentPurchased_xxga2_231", l = "_details_xxga2_275", g = "_split_xxga2_284", d = "_splitRow_xxga2_291", p = "_splitLabel_xxga2_297", u = "_splitAmount_xxga2_305", m = "_dotGranted_xxga2_313", h = "_dotPurchased_xxga2_314", b = "_footer_xxga2_328", f = "_burnNote_xxga2_336", y = "_topUp_xxga2_87", G = "_rail_xxga2_402", P = "_railIcon_xxga2_416", w = "_railFigure_xxga2_422", A = "_srOnly_xxga2_435", F = {
1
+ const t = "_chip_qvtyk_37", o = "_header_qvtyk_74", _ = "_name_qvtyk_83", e = "_pill_qvtyk_162", n = "_figure_qvtyk_171", p = "_amount_qvtyk_186", s = "_unit_qvtyk_195", r = "_retry_qvtyk_200", c = "_bar_qvtyk_209", a = "_segmentGranted_qvtyk_230", y = "_segmentPurchased_qvtyk_231", i = "_details_qvtyk_275", v = "_split_qvtyk_284", l = "_splitRow_qvtyk_291", d = "_splitLabel_qvtyk_297", k = "_splitAmount_qvtyk_305", q = "_dotGranted_qvtyk_313", u = "_dotPurchased_qvtyk_314", g = "_footer_qvtyk_328", h = "_burnNote_qvtyk_336", m = "_topUp_qvtyk_87", F = "_rail_qvtyk_387", b = "_railIcon_qvtyk_401", w = "_railFigure_qvtyk_407", A = "_srOnly_qvtyk_420", G = "_topRoot_qvtyk_444", N = "_topTrigger_qvtyk_453", P = "_topFigure_qvtyk_482", R = "_topAmount_qvtyk_489", U = "_topUnit_qvtyk_497", f = "_topChevron_qvtyk_508", B = "_topBar_qvtyk_518", T = "_popBar_qvtyk_519", x = "_popover_qvtyk_534", C = "_popHead_qvtyk_551", H = "_popFigure_qvtyk_558", I = "_popAmount_qvtyk_566", L = "_popUnit_qvtyk_575", O = "_legend_qvtyk_589", j = "_legendText_qvtyk_598", z = "_legendRow_qvtyk_603", D = "_swatchGranted_qvtyk_609", E = "_swatchPurchased_qvtyk_610", J = "_legendFigure_qvtyk_626", K = "_legendNote_qvtyk_634", M = "_popFoot_qvtyk_641", Q = "_popNote_qvtyk_649", S = "_buy_qvtyk_658", V = {
2
2
  chip: t,
3
- header: _,
4
- name: a,
5
- pill: n,
6
- figure: s,
7
- amount: e,
8
- unit: o,
9
- retry: x,
10
- bar: r,
11
- segmentGranted: i,
12
- segmentPurchased: c,
13
- details: l,
14
- split: g,
15
- splitRow: d,
16
- splitLabel: p,
17
- splitAmount: u,
18
- dotGranted: m,
19
- dotPurchased: h,
20
- footer: b,
21
- burnNote: f,
22
- topUp: y,
23
- rail: G,
24
- railIcon: P,
3
+ header: o,
4
+ name: _,
5
+ pill: e,
6
+ figure: n,
7
+ amount: p,
8
+ unit: s,
9
+ retry: r,
10
+ bar: c,
11
+ segmentGranted: a,
12
+ segmentPurchased: y,
13
+ details: i,
14
+ split: v,
15
+ splitRow: l,
16
+ splitLabel: d,
17
+ splitAmount: k,
18
+ dotGranted: q,
19
+ dotPurchased: u,
20
+ footer: g,
21
+ burnNote: h,
22
+ topUp: m,
23
+ rail: F,
24
+ railIcon: b,
25
25
  railFigure: w,
26
- srOnly: A
26
+ srOnly: A,
27
+ topRoot: G,
28
+ topTrigger: N,
29
+ topFigure: P,
30
+ topAmount: R,
31
+ topUnit: U,
32
+ topChevron: f,
33
+ topBar: B,
34
+ popBar: T,
35
+ popover: x,
36
+ popHead: C,
37
+ popFigure: H,
38
+ popAmount: I,
39
+ popUnit: L,
40
+ legend: O,
41
+ legendText: j,
42
+ legendRow: z,
43
+ swatchGranted: D,
44
+ swatchPurchased: E,
45
+ legendFigure: J,
46
+ legendNote: K,
47
+ popFoot: M,
48
+ popNote: Q,
49
+ buy: S
27
50
  };
28
51
  export {
29
- e as amount,
30
- r as bar,
31
- f as burnNote,
52
+ p as amount,
53
+ c as bar,
54
+ h as burnNote,
55
+ S as buy,
32
56
  t as chip,
33
- F as default,
34
- l as details,
35
- m as dotGranted,
36
- h as dotPurchased,
37
- s as figure,
38
- b as footer,
39
- _ as header,
40
- a as name,
41
- n as pill,
42
- G as rail,
57
+ V as default,
58
+ i as details,
59
+ q as dotGranted,
60
+ u as dotPurchased,
61
+ n as figure,
62
+ g as footer,
63
+ o as header,
64
+ O as legend,
65
+ J as legendFigure,
66
+ K as legendNote,
67
+ z as legendRow,
68
+ j as legendText,
69
+ _ as name,
70
+ e as pill,
71
+ I as popAmount,
72
+ T as popBar,
73
+ H as popFigure,
74
+ M as popFoot,
75
+ C as popHead,
76
+ Q as popNote,
77
+ L as popUnit,
78
+ x as popover,
79
+ F as rail,
43
80
  w as railFigure,
44
- P as railIcon,
45
- x as retry,
46
- i as segmentGranted,
47
- c as segmentPurchased,
48
- g as split,
49
- u as splitAmount,
50
- p as splitLabel,
51
- d as splitRow,
81
+ b as railIcon,
82
+ r as retry,
83
+ a as segmentGranted,
84
+ y as segmentPurchased,
85
+ v as split,
86
+ k as splitAmount,
87
+ d as splitLabel,
88
+ l as splitRow,
52
89
  A as srOnly,
53
- y as topUp,
54
- o as unit
90
+ D as swatchGranted,
91
+ E as swatchPurchased,
92
+ R as topAmount,
93
+ B as topBar,
94
+ f as topChevron,
95
+ P as topFigure,
96
+ G as topRoot,
97
+ N as topTrigger,
98
+ U as topUnit,
99
+ m as topUp,
100
+ s as unit
55
101
  };
56
102
  //# sourceMappingURL=WalletChip.module.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"WalletChip.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"WalletChip.module.css.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}