@hanzo/ui 8.0.7 → 8.0.8

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 (214) hide show
  1. package/dist/ThemeToggleNext-7727UR5W.js +4 -0
  2. package/dist/ThemeToggleNext-7727UR5W.js.map +1 -0
  3. package/dist/ThemeToggleNext-ICB5KL5J.cjs +19 -0
  4. package/dist/ThemeToggleNext-ICB5KL5J.cjs.map +1 -0
  5. package/dist/billing.cjs +15 -0
  6. package/dist/billing.cjs.map +1 -0
  7. package/{types → dist}/billing.d.ts +0 -1
  8. package/dist/billing.js +4 -0
  9. package/dist/billing.js.map +1 -0
  10. package/dist/canvas.cjs +15 -0
  11. package/dist/canvas.cjs.map +1 -0
  12. package/dist/canvas.d.ts +1 -0
  13. package/dist/canvas.js +4 -0
  14. package/dist/canvas.js.map +1 -0
  15. package/{types → dist}/cd/layout.d.ts +0 -1
  16. package/{types → dist}/cd/status.d.ts +0 -1
  17. package/{types → dist}/cd/time.d.ts +0 -1
  18. package/{types → dist}/cd/types.d.ts +0 -1
  19. package/dist/chunk-42CU5GSF.js +98 -0
  20. package/dist/chunk-42CU5GSF.js.map +1 -0
  21. package/dist/chunk-GDGVXU7W.js +1999 -0
  22. package/dist/chunk-GDGVXU7W.js.map +1 -0
  23. package/dist/chunk-HSPMQQVJ.cjs +2066 -0
  24. package/dist/chunk-HSPMQQVJ.cjs.map +1 -0
  25. package/dist/chunk-YBXVUV7P.cjs +103 -0
  26. package/dist/chunk-YBXVUV7P.cjs.map +1 -0
  27. package/dist/dashboard.cjs +15 -0
  28. package/dist/dashboard.cjs.map +1 -0
  29. package/dist/dashboard.d.ts +1 -0
  30. package/dist/dashboard.js +4 -0
  31. package/dist/dashboard.js.map +1 -0
  32. package/dist/data.cjs +15 -0
  33. package/dist/data.cjs.map +1 -0
  34. package/dist/data.d.ts +1 -0
  35. package/dist/data.js +4 -0
  36. package/dist/data.js.map +1 -0
  37. package/dist/gitops.cjs +15 -0
  38. package/dist/gitops.cjs.map +1 -0
  39. package/dist/gitops.d.ts +1 -0
  40. package/dist/gitops.js +4 -0
  41. package/dist/gitops.js.map +1 -0
  42. package/dist/index.cjs +291 -0
  43. package/dist/index.cjs.map +1 -0
  44. package/{types → dist}/index.d.ts +0 -1
  45. package/dist/index.js +6 -0
  46. package/dist/index.js.map +1 -0
  47. package/dist/network.cjs +15 -0
  48. package/dist/network.cjs.map +1 -0
  49. package/{types → dist}/network.d.ts +0 -1
  50. package/dist/network.js +4 -0
  51. package/dist/network.js.map +1 -0
  52. package/dist/primitives/bases/data/index.cjs +15 -0
  53. package/dist/primitives/bases/data/index.cjs.map +1 -0
  54. package/dist/primitives/bases/data/index.d.ts +1 -0
  55. package/dist/primitives/bases/data/index.js +4 -0
  56. package/dist/primitives/bases/data/index.js.map +1 -0
  57. package/{types → dist}/product/AppHeader.d.ts +0 -1
  58. package/{types → dist}/product/BrandMark.d.ts +0 -1
  59. package/{types → dist}/product/Charts.d.ts +0 -1
  60. package/{types → dist}/product/ComboBox.d.ts +0 -1
  61. package/{types → dist}/product/DataTable.d.ts +0 -1
  62. package/{types → dist}/product/Donut.d.ts +0 -1
  63. package/{types → dist}/product/EmptyState.d.ts +0 -1
  64. package/{types → dist}/product/FadeIn.d.ts +0 -1
  65. package/{types → dist}/product/Field.d.ts +0 -1
  66. package/{types → dist}/product/HanzoMark.d.ts +0 -1
  67. package/{types → dist}/product/Metric.d.ts +0 -1
  68. package/{types → dist}/product/OrgSwitcher.d.ts +0 -1
  69. package/{types → dist}/product/PageHeader.d.ts +0 -1
  70. package/{types → dist}/product/PrimaryButton.d.ts +0 -1
  71. package/{types → dist}/product/ProductIcon.d.ts +0 -1
  72. package/{types → dist}/product/ProviderLogo.d.ts +0 -1
  73. package/{types → dist}/product/Reorder.d.ts +0 -1
  74. package/{types → dist}/product/SelectMenu.d.ts +6 -8
  75. package/{types → dist}/product/SlideOver.d.ts +0 -1
  76. package/{types → dist}/product/StatusTag.d.ts +0 -1
  77. package/{types → dist}/product/ThemeToggle.d.ts +0 -1
  78. package/{types → dist}/product/ThemeToggleNext.d.ts +0 -1
  79. package/{types → dist}/product/Toast.d.ts +0 -1
  80. package/{types → dist}/product/color.d.ts +0 -1
  81. package/{types → dist}/product/combobox/filter.d.ts +0 -1
  82. package/dist/product/index.cjs +278 -0
  83. package/dist/product/index.cjs.map +1 -0
  84. package/{types → dist}/product/index.d.ts +0 -1
  85. package/dist/product/index.js +5 -0
  86. package/dist/product/index.js.map +1 -0
  87. package/{types → dist}/product/menu/ContextMenu.d.ts +3 -6
  88. package/dist/product/menu/DropdownMenu.d.ts +29 -0
  89. package/dist/product/menu/FloatingMenu.d.ts +36 -0
  90. package/{types → dist}/product/menu/index.d.ts +1 -1
  91. package/{types → dist}/product/menu/items.d.ts +0 -1
  92. package/{types → dist}/product/menu/portal-theme.d.ts +0 -1
  93. package/{types → dist}/product/menu/roving.d.ts +0 -1
  94. package/{types → dist}/product/scope.d.ts +0 -1
  95. package/{types → dist}/product/surfaces.data.d.ts +0 -1
  96. package/dist/usage.cjs +15 -0
  97. package/dist/usage.cjs.map +1 -0
  98. package/dist/usage.d.ts +1 -0
  99. package/dist/usage.js +4 -0
  100. package/dist/usage.js.map +1 -0
  101. package/dist/wallet.cjs +15 -0
  102. package/dist/wallet.cjs.map +1 -0
  103. package/{types → dist}/wallet.d.ts +0 -1
  104. package/dist/wallet.js +4 -0
  105. package/dist/wallet.js.map +1 -0
  106. package/package.json +54 -32
  107. package/src/billing.ts +0 -9
  108. package/src/canvas.ts +0 -11
  109. package/src/cd/layout.ts +0 -184
  110. package/src/cd/status.ts +0 -158
  111. package/src/cd/time.ts +0 -52
  112. package/src/cd/types.ts +0 -318
  113. package/src/dashboard.ts +0 -8
  114. package/src/data.ts +0 -12
  115. package/src/gitops.ts +0 -5
  116. package/src/gui-env.d.ts +0 -27
  117. package/src/index.ts +0 -22
  118. package/src/network.ts +0 -11
  119. package/src/primitives/bases/data/index.ts +0 -13
  120. package/src/product/AppHeader.tsx +0 -183
  121. package/src/product/BrandMark.tsx +0 -27
  122. package/src/product/Charts.tsx +0 -471
  123. package/src/product/ComboBox.tsx +0 -127
  124. package/src/product/DataTable.tsx +0 -99
  125. package/src/product/Donut.tsx +0 -83
  126. package/src/product/EmptyState.tsx +0 -129
  127. package/src/product/FadeIn.tsx +0 -38
  128. package/src/product/Field.tsx +0 -160
  129. package/src/product/HanzoMark.tsx +0 -31
  130. package/src/product/Metric.tsx +0 -253
  131. package/src/product/OrgSwitcher.tsx +0 -332
  132. package/src/product/PageHeader.tsx +0 -31
  133. package/src/product/PrimaryButton.tsx +0 -17
  134. package/src/product/ProductIcon.tsx +0 -61
  135. package/src/product/ProviderLogo.tsx +0 -137
  136. package/src/product/Reorder.test.ts +0 -41
  137. package/src/product/Reorder.tsx +0 -110
  138. package/src/product/SelectMenu.tsx +0 -80
  139. package/src/product/SlideOver.tsx +0 -197
  140. package/src/product/StatusTag.tsx +0 -49
  141. package/src/product/ThemeToggle.tsx +0 -135
  142. package/src/product/ThemeToggleNext.tsx +0 -27
  143. package/src/product/Toast.tsx +0 -166
  144. package/src/product/color.ts +0 -17
  145. package/src/product/combobox/filter.test.ts +0 -51
  146. package/src/product/combobox/filter.ts +0 -39
  147. package/src/product/index.ts +0 -76
  148. package/src/product/menu/ContextMenu.tsx +0 -114
  149. package/src/product/menu/DropdownMenu.tsx +0 -76
  150. package/src/product/menu/index.ts +0 -15
  151. package/src/product/menu/items.tsx +0 -230
  152. package/src/product/menu/portal-theme.tsx +0 -33
  153. package/src/product/menu/roving.ts +0 -34
  154. package/src/product/scope.test.ts +0 -92
  155. package/src/product/scope.ts +0 -123
  156. package/src/product/surfaces.data.ts +0 -42
  157. package/src/usage.ts +0 -8
  158. package/src/wallet.ts +0 -11
  159. package/types/billing.d.ts.map +0 -1
  160. package/types/canvas.d.ts +0 -2
  161. package/types/canvas.d.ts.map +0 -1
  162. package/types/cd/layout.d.ts.map +0 -1
  163. package/types/cd/status.d.ts.map +0 -1
  164. package/types/cd/time.d.ts.map +0 -1
  165. package/types/cd/types.d.ts.map +0 -1
  166. package/types/dashboard.d.ts +0 -2
  167. package/types/dashboard.d.ts.map +0 -1
  168. package/types/data.d.ts +0 -2
  169. package/types/data.d.ts.map +0 -1
  170. package/types/gitops.d.ts +0 -2
  171. package/types/gitops.d.ts.map +0 -1
  172. package/types/index.d.ts.map +0 -1
  173. package/types/network.d.ts.map +0 -1
  174. package/types/primitives/bases/data/index.d.ts +0 -2
  175. package/types/primitives/bases/data/index.d.ts.map +0 -1
  176. package/types/product/AppHeader.d.ts.map +0 -1
  177. package/types/product/BrandMark.d.ts.map +0 -1
  178. package/types/product/Charts.d.ts.map +0 -1
  179. package/types/product/ComboBox.d.ts.map +0 -1
  180. package/types/product/DataTable.d.ts.map +0 -1
  181. package/types/product/Donut.d.ts.map +0 -1
  182. package/types/product/EmptyState.d.ts.map +0 -1
  183. package/types/product/FadeIn.d.ts.map +0 -1
  184. package/types/product/Field.d.ts.map +0 -1
  185. package/types/product/HanzoMark.d.ts.map +0 -1
  186. package/types/product/Metric.d.ts.map +0 -1
  187. package/types/product/OrgSwitcher.d.ts.map +0 -1
  188. package/types/product/PageHeader.d.ts.map +0 -1
  189. package/types/product/PrimaryButton.d.ts.map +0 -1
  190. package/types/product/ProductIcon.d.ts.map +0 -1
  191. package/types/product/ProviderLogo.d.ts.map +0 -1
  192. package/types/product/Reorder.d.ts.map +0 -1
  193. package/types/product/SelectMenu.d.ts.map +0 -1
  194. package/types/product/SlideOver.d.ts.map +0 -1
  195. package/types/product/StatusTag.d.ts.map +0 -1
  196. package/types/product/ThemeToggle.d.ts.map +0 -1
  197. package/types/product/ThemeToggleNext.d.ts.map +0 -1
  198. package/types/product/Toast.d.ts.map +0 -1
  199. package/types/product/color.d.ts.map +0 -1
  200. package/types/product/combobox/filter.d.ts.map +0 -1
  201. package/types/product/index.d.ts.map +0 -1
  202. package/types/product/menu/ContextMenu.d.ts.map +0 -1
  203. package/types/product/menu/DropdownMenu.d.ts +0 -34
  204. package/types/product/menu/DropdownMenu.d.ts.map +0 -1
  205. package/types/product/menu/index.d.ts.map +0 -1
  206. package/types/product/menu/items.d.ts.map +0 -1
  207. package/types/product/menu/portal-theme.d.ts.map +0 -1
  208. package/types/product/menu/roving.d.ts.map +0 -1
  209. package/types/product/scope.d.ts.map +0 -1
  210. package/types/product/surfaces.data.d.ts.map +0 -1
  211. package/types/usage.d.ts +0 -2
  212. package/types/usage.d.ts.map +0 -1
  213. package/types/wallet.d.ts.map +0 -1
  214. /package/{src → dist}/styles/hanzo-motion.css +0 -0
@@ -0,0 +1,2066 @@
1
+ 'use client';
2
+ 'use strict';
3
+
4
+ var chunkYBXVUV7P_cjs = require('./chunk-YBXVUV7P.cjs');
5
+ var react = require('react');
6
+ var gui = require('@hanzo/gui');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+ var lucideIcons2 = require('@hanzogui/lucide-icons-2');
9
+ var react$1 = require('@hanzo/logo/react');
10
+ var reactDom = require('react-dom');
11
+
12
+ var CHART_PALETTE = [
13
+ "#7c5cff",
14
+ "#23c562",
15
+ "#ff9f45",
16
+ "#3aa0ff",
17
+ "#ff5d8f",
18
+ "#16c0c8",
19
+ "#c084fc",
20
+ "#f4c245"
21
+ ];
22
+ var CHART_OTHER = "#64748b";
23
+ var ACCENT = CHART_PALETTE[0];
24
+ var GRID = "rgba(148,163,184,0.16)";
25
+ var AXIS = "rgba(148,163,184,0.85)";
26
+ var tone = (theme, key, fallback) => {
27
+ const v = theme[key];
28
+ const got = v?.get?.();
29
+ return typeof got === "string" ? got : fallback;
30
+ };
31
+ var rampOpacity = (i, n) => n <= 1 ? 0.9 : 0.95 - i / (n - 1) * 0.62;
32
+ function useContainerWidth() {
33
+ const ref = react.useRef(null);
34
+ const [w, setW] = react.useState(0);
35
+ react.useEffect(() => {
36
+ const el = ref.current;
37
+ if (!el) return;
38
+ const measure = () => setW(el.clientWidth);
39
+ measure();
40
+ const ro = new ResizeObserver(measure);
41
+ ro.observe(el);
42
+ return () => ro.disconnect();
43
+ }, []);
44
+ return { ref, w };
45
+ }
46
+ function Sparkline({
47
+ values,
48
+ width = 120,
49
+ height = 36,
50
+ color
51
+ }) {
52
+ const theme = gui.useTheme();
53
+ const clean = (values ?? []).filter((v) => Number.isFinite(v));
54
+ if (clean.length < 2) return null;
55
+ const stroke = color ?? tone(theme, "color11", "currentColor");
56
+ const max = Math.max(...clean);
57
+ const min = Math.min(...clean);
58
+ const span = max - min || 1;
59
+ const n = clean.length;
60
+ const px = (i) => i / (n - 1) * (width - 2) + 1;
61
+ const py = (v) => height - 2 - (v - min) / span * (height - 4);
62
+ const line = clean.map((v, i) => `${i === 0 ? "M" : "L"}${px(i).toFixed(1)},${py(v).toFixed(1)}`).join(" ");
63
+ const area = `${line} L${(width - 1).toFixed(1)},${height} L1,${height} Z`;
64
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width, height, "aria-hidden": true, style: { display: "block" }, children: [
65
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: area, fill: stroke, fillOpacity: 0.12 }),
66
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: line, fill: "none", stroke, strokeWidth: 1.5, strokeLinejoin: "round", strokeLinecap: "round" })
67
+ ] });
68
+ }
69
+ function Tooltip({ x, height, label, value }) {
70
+ const left = Math.max(0, x - 60);
71
+ return /* @__PURE__ */ jsxRuntime.jsx(
72
+ "div",
73
+ {
74
+ style: {
75
+ position: "absolute",
76
+ left,
77
+ top: 0,
78
+ height,
79
+ pointerEvents: "none",
80
+ display: "flex",
81
+ alignItems: "flex-start"
82
+ },
83
+ children: /* @__PURE__ */ jsxRuntime.jsxs(
84
+ "div",
85
+ {
86
+ style: {
87
+ background: "rgba(15,17,21,0.94)",
88
+ border: "1px solid rgba(148,163,184,0.25)",
89
+ borderRadius: 8,
90
+ padding: "6px 9px",
91
+ fontSize: 11,
92
+ lineHeight: 1.35,
93
+ color: "#e2e8f0",
94
+ whiteSpace: "nowrap",
95
+ boxShadow: "0 4px 16px rgba(0,0,0,0.4)"
96
+ },
97
+ children: [
98
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { color: AXIS }, children: label }),
99
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontWeight: 700 }, children: value })
100
+ ]
101
+ }
102
+ )
103
+ }
104
+ );
105
+ }
106
+ function nearestIndex(clientX, rect, padL, innerW, n) {
107
+ if (n <= 1) return 0;
108
+ const mx = clientX - rect.left - padL;
109
+ const i = Math.round(mx / (innerW || 1) * (n - 1));
110
+ return Math.max(0, Math.min(n - 1, i));
111
+ }
112
+ function axisTicks(data) {
113
+ const n = data.length;
114
+ if (n === 0) return [];
115
+ if (n === 1) return [{ i: 0, label: data[0].label, anchor: "middle" }];
116
+ const mid = Math.floor((n - 1) / 2);
117
+ const out = [
118
+ { i: 0, label: data[0].label, anchor: "start" },
119
+ { i: n - 1, label: data[n - 1].label, anchor: "end" }
120
+ ];
121
+ if (n >= 5) out.splice(1, 0, { i: mid, label: data[mid].label, anchor: "middle" });
122
+ return out;
123
+ }
124
+ function LineChart({
125
+ data,
126
+ height = 210,
127
+ color = ACCENT,
128
+ formatValue = (v) => String(v)
129
+ }) {
130
+ const { ref, w } = useContainerWidth();
131
+ const [hover, setHover] = react.useState(null);
132
+ const padL = 10;
133
+ const padR = 10;
134
+ const padT = 12;
135
+ const padB = 24;
136
+ const n = data.length;
137
+ const innerW = Math.max(1, w - padL - padR);
138
+ const innerH = Math.max(1, height - padT - padB);
139
+ const max = Math.max(...data.map((d) => d.value), 1);
140
+ const x = (i) => padL + (n <= 1 ? innerW / 2 : i / (n - 1) * innerW);
141
+ const y = (v) => padT + innerH - v / max * innerH;
142
+ const line = data.map((d, i) => `${i === 0 ? "M" : "L"}${x(i).toFixed(1)},${y(d.value).toFixed(1)}`).join(" ");
143
+ const area = n >= 2 ? `${line} L${x(n - 1).toFixed(1)},${(padT + innerH).toFixed(1)} L${x(0).toFixed(1)},${(padT + innerH).toFixed(1)} Z` : "";
144
+ const ticks = axisTicks(data);
145
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, style: { position: "relative", width: "100%" }, children: [
146
+ w > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
147
+ "svg",
148
+ {
149
+ width: w,
150
+ height,
151
+ style: { display: "block" },
152
+ onMouseMove: (e) => setHover(nearestIndex(e.clientX, e.currentTarget.getBoundingClientRect(), padL, innerW, n)),
153
+ onMouseLeave: () => setHover(null),
154
+ children: [
155
+ [0, 0.5, 1].map((g) => /* @__PURE__ */ jsxRuntime.jsx("line", { x1: padL, x2: w - padR, y1: padT + innerH * g, y2: padT + innerH * g, stroke: GRID, strokeWidth: 1 }, g)),
156
+ area ? /* @__PURE__ */ jsxRuntime.jsx("path", { d: area, fill: color, fillOpacity: 0.1 }) : null,
157
+ n >= 2 ? /* @__PURE__ */ jsxRuntime.jsx("path", { d: line, fill: "none", stroke: color, strokeWidth: 2, strokeLinejoin: "round", strokeLinecap: "round" }) : null,
158
+ hover != null && data[hover] ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
159
+ /* @__PURE__ */ jsxRuntime.jsx("line", { x1: x(hover), x2: x(hover), y1: padT, y2: padT + innerH, stroke: AXIS, strokeWidth: 1, strokeDasharray: "3 3" }),
160
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: x(hover), cy: y(data[hover].value), r: 4, fill: color, stroke: "#0f1115", strokeWidth: 2 })
161
+ ] }) : null,
162
+ ticks.map((t) => /* @__PURE__ */ jsxRuntime.jsx("text", { x: x(t.i), y: height - 7, fontSize: 10, fill: AXIS, textAnchor: t.anchor, children: t.label }, t.i))
163
+ ]
164
+ }
165
+ ) : null,
166
+ hover != null && data[hover] ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { x: x(hover), height, label: data[hover].label, value: formatValue(data[hover].value) }) : null
167
+ ] });
168
+ }
169
+ function BarChart({
170
+ data,
171
+ height = 210,
172
+ color = ACCENT,
173
+ formatValue = (v) => String(v)
174
+ }) {
175
+ const { ref, w } = useContainerWidth();
176
+ const [hover, setHover] = react.useState(null);
177
+ const padL = 10;
178
+ const padR = 10;
179
+ const padT = 12;
180
+ const padB = 24;
181
+ const n = data.length;
182
+ const innerW = Math.max(1, w - padL - padR);
183
+ const innerH = Math.max(1, height - padT - padB);
184
+ const max = Math.max(...data.map((d) => d.value), 1);
185
+ const slot = innerW / Math.max(1, n);
186
+ const barW = Math.max(1, Math.min(slot * 0.62, 36));
187
+ const cx = (i) => padL + slot * i + slot / 2;
188
+ const ticks = axisTicks(data);
189
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, style: { position: "relative", width: "100%" }, children: [
190
+ w > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(
191
+ "svg",
192
+ {
193
+ width: w,
194
+ height,
195
+ style: { display: "block" },
196
+ onMouseMove: (e) => {
197
+ const rect = e.currentTarget.getBoundingClientRect();
198
+ const i = Math.floor((e.clientX - rect.left - padL) / (slot || 1));
199
+ setHover(Math.max(0, Math.min(n - 1, i)));
200
+ },
201
+ onMouseLeave: () => setHover(null),
202
+ children: [
203
+ [0, 0.5, 1].map((g) => /* @__PURE__ */ jsxRuntime.jsx("line", { x1: padL, x2: w - padR, y1: padT + innerH * g, y2: padT + innerH * g, stroke: GRID, strokeWidth: 1 }, g)),
204
+ data.map((d, i) => {
205
+ const h = d.value / max * innerH;
206
+ return /* @__PURE__ */ jsxRuntime.jsx(
207
+ "rect",
208
+ {
209
+ x: cx(i) - barW / 2,
210
+ y: padT + innerH - h,
211
+ width: barW,
212
+ height: Math.max(0, h),
213
+ rx: Math.min(3, barW / 2),
214
+ fill: color,
215
+ fillOpacity: hover === i ? 1 : 0.78
216
+ },
217
+ i
218
+ );
219
+ }),
220
+ ticks.map((t) => /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx(t.i), y: height - 7, fontSize: 10, fill: AXIS, textAnchor: "middle", children: t.label }, t.i))
221
+ ]
222
+ }
223
+ ) : null,
224
+ hover != null && data[hover] ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip, { x: cx(hover), height, label: data[hover].label, value: formatValue(data[hover].value) }) : null
225
+ ] });
226
+ }
227
+ function Donut({
228
+ slices,
229
+ size = 160,
230
+ thickness = 22,
231
+ center,
232
+ legend = false
233
+ }) {
234
+ const theme = gui.useTheme();
235
+ const fg = tone(theme, "color12", "currentColor");
236
+ const positive = slices.filter((s) => s.value > 0);
237
+ const total = positive.reduce((sum, s) => sum + s.value, 0);
238
+ const r = size / 2;
239
+ const rInner = r - thickness;
240
+ const mid = (r + rInner) / 2;
241
+ if (total <= 0) {
242
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { items: "center", justify: "center", height: size, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$6", color: "$color10", children: "\u2014" }) });
243
+ }
244
+ const ring = /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { position: "relative", width: size, height: size }, children: [
245
+ /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, style: { display: "block" }, children: positive.length === 1 ? /* @__PURE__ */ jsxRuntime.jsx(
246
+ "circle",
247
+ {
248
+ cx: r,
249
+ cy: r,
250
+ r: mid,
251
+ fill: "none",
252
+ stroke: positive[0].color ?? fg,
253
+ strokeOpacity: positive[0].color ? 1 : 0.9,
254
+ strokeWidth: thickness
255
+ }
256
+ ) : renderArcs(positive, total, r, rInner, fg) }),
257
+ center ? /* @__PURE__ */ jsxRuntime.jsx(
258
+ "div",
259
+ {
260
+ style: {
261
+ position: "absolute",
262
+ inset: 0,
263
+ display: "flex",
264
+ flexDirection: "column",
265
+ alignItems: "center",
266
+ justifyContent: "center",
267
+ textAlign: "center",
268
+ pointerEvents: "none"
269
+ },
270
+ children: center
271
+ }
272
+ ) : null
273
+ ] });
274
+ if (!legend) return ring;
275
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: "$4", items: "center", flexWrap: "wrap", children: [
276
+ ring,
277
+ /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { gap: "$1.5", flex: 1, minW: 150, children: positive.map((s, i) => /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: "$2", items: "center", children: [
278
+ /* @__PURE__ */ jsxRuntime.jsx(
279
+ "div",
280
+ {
281
+ style: {
282
+ width: 10,
283
+ height: 10,
284
+ borderRadius: 2,
285
+ backgroundColor: s.color ?? AXIS,
286
+ opacity: s.color ? 1 : rampOpacity(i, positive.length)
287
+ }
288
+ }
289
+ ),
290
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color11", flex: 1, numberOfLines: 1, children: s.label }),
291
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: "$2", color: "$color12", fontWeight: "600", children: [
292
+ Math.round(s.value / total * 100),
293
+ "%"
294
+ ] })
295
+ ] }, s.label)) })
296
+ ] });
297
+ }
298
+ function renderArcs(slices, total, rOuter, rInner, fg) {
299
+ let a0 = -Math.PI / 2;
300
+ const paths = [];
301
+ slices.forEach((s, idx) => {
302
+ const frac = Math.max(0, s.value) / total;
303
+ if (frac <= 0) return;
304
+ const a1 = a0 + frac * Math.PI * 2;
305
+ paths.push(
306
+ /* @__PURE__ */ jsxRuntime.jsx(
307
+ "path",
308
+ {
309
+ d: annularArc(rOuter, rOuter, rOuter, rInner, a0, Math.min(a1, a0 + Math.PI * 1.9999)),
310
+ fill: s.color ?? fg,
311
+ fillOpacity: s.color ? 1 : rampOpacity(idx, slices.length)
312
+ },
313
+ s.label || idx
314
+ )
315
+ );
316
+ a0 = a1;
317
+ });
318
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: paths });
319
+ }
320
+ function polar(cx, cy, rad, a) {
321
+ return [cx + rad * Math.cos(a), cy + rad * Math.sin(a)];
322
+ }
323
+ function annularArc(cx, cy, rOuter, rInner, a0, a1) {
324
+ const large = a1 - a0 > Math.PI ? 1 : 0;
325
+ const [x0, y0] = polar(cx, cy, rOuter, a0);
326
+ const [x1, y1] = polar(cx, cy, rOuter, a1);
327
+ const [x2, y2] = polar(cx, cy, rInner, a1);
328
+ const [x3, y3] = polar(cx, cy, rInner, a0);
329
+ return `M${x0},${y0} A${rOuter},${rOuter} 0 ${large} 1 ${x1},${y1} L${x2},${y2} A${rInner},${rInner} 0 ${large} 0 ${x3},${y3} Z`;
330
+ }
331
+ function BarRows({ bars }) {
332
+ const max = Math.max(0, ...bars.map((b) => b.value));
333
+ if (max <= 0) {
334
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$3", color: "$color10", children: "\u2014" });
335
+ }
336
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { gap: "$2.5", children: bars.map((b) => /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: "$3", items: "center", children: [
337
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { width: 64, fontSize: "$2", color: "$color11", text: "right", children: b.label }),
338
+ /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { flex: 1, height: 10, bg: "$color3", rounded: "$2", overflow: "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { height: 10, width: `${Math.max(2, b.value / max * 100)}%`, bg: "$color9", rounded: "$2" }) }),
339
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { width: 56, fontSize: "$2", color: "$color12", fontWeight: "600", children: b.value.toLocaleString() })
340
+ ] }, b.label)) });
341
+ }
342
+ var SERIES = ["#6ea8fe", "#7ee787", "#f0a868", "#c792ea", "#56d4c4", "#e879a6", "#d6c15a", "#8b9bb4"];
343
+ var colorForIndex = (i) => SERIES[i % SERIES.length];
344
+ var TRACK = "rgba(128,128,128,0.18)";
345
+ function utilColor(pct) {
346
+ if (pct >= 90) return "#e5534b";
347
+ if (pct >= 70) return "#f0a868";
348
+ return "#7ee787";
349
+ }
350
+ function Sparkline2({
351
+ points,
352
+ width = 104,
353
+ height = 30,
354
+ color = SERIES[0]
355
+ }) {
356
+ if (!points || points.length < 2) return null;
357
+ const min = Math.min(...points);
358
+ const max = Math.max(...points);
359
+ const span = max - min || 1;
360
+ const stepX = width / (points.length - 1);
361
+ const y = (v) => height - 2 - (v - min) / span * (height - 4);
362
+ const d = points.map((p, i) => `${i === 0 ? "M" : "L"}${(i * stepX).toFixed(1)},${y(p).toFixed(1)}`).join(" ");
363
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width, height, viewBox: `0 0 ${width} ${height}`, role: "img", "aria-label": "trend", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d, fill: "none", stroke: color, strokeWidth: 1.5, strokeLinejoin: "round", strokeLinecap: "round" }) });
364
+ }
365
+ function MiniBars({
366
+ bars,
367
+ width = 320,
368
+ height = 96,
369
+ color = SERIES[0]
370
+ }) {
371
+ if (!bars.length) return null;
372
+ const max = Math.max(...bars.map((b) => b.value), 1);
373
+ const gap = 4;
374
+ const bw = (width - gap * (bars.length - 1)) / bars.length;
375
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: "100%", height, viewBox: `0 0 ${width} ${height}`, preserveAspectRatio: "none", role: "img", "aria-label": "bars", children: bars.map((b, i) => {
376
+ const h = Math.max(1, b.value / max * (height - 2));
377
+ return /* @__PURE__ */ jsxRuntime.jsx("rect", { x: i * (bw + gap), y: height - h, width: bw, height: h, rx: 2, fill: color, opacity: 0.85, children: /* @__PURE__ */ jsxRuntime.jsx("title", { children: `${b.label}: ${b.value}` }) }, b.label + i);
378
+ }) });
379
+ }
380
+ function UtilBar({ value, width = 120, color }) {
381
+ const v = Math.max(0, Math.min(100, value));
382
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width, height: 8, viewBox: `0 0 ${width} 8`, role: "img", "aria-label": `${Math.round(v)}%`, children: [
383
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 1, width, height: 6, rx: 3, fill: TRACK }),
384
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { x: 0, y: 1, width: v / 100 * width, height: 6, rx: 3, fill: color ?? utilColor(v) })
385
+ ] });
386
+ }
387
+ function LegendDot({ color, label, value }) {
388
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2", justify: "space-between", children: [
389
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2", children: [
390
+ /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { width: 10, height: 10, rounded: "$1", bg: color }),
391
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color11", children: label })
392
+ ] }),
393
+ value != null ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color12", fontWeight: "600", children: value }) : null
394
+ ] });
395
+ }
396
+ function MetricCard({
397
+ icon,
398
+ label,
399
+ value,
400
+ caption,
401
+ spark,
402
+ sparkColor,
403
+ delta
404
+ }) {
405
+ const up = delta ? delta.pct >= 0 : false;
406
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.Card, { p: "$3.5", gap: "$2", borderWidth: 1, borderColor: "$borderColor", flex: 1, minW: 172, children: [
407
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2", justify: "space-between", children: [
408
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2", children: [
409
+ icon,
410
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color11", fontWeight: "600", children: label })
411
+ ] }),
412
+ delta ? /* @__PURE__ */ jsxRuntime.jsxs(gui.Text, { fontSize: "$1", color: up ? "#7ee787" : "#e5534b", children: [
413
+ up ? "\u25B2" : "\u25BC",
414
+ " ",
415
+ Math.abs(delta.pct),
416
+ "%"
417
+ ] }) : null
418
+ ] }),
419
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "flex-end", justify: "space-between", gap: "$2", children: [
420
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$8", fontWeight: "900", color: "$color12", numberOfLines: 1, children: value }),
421
+ spark && spark.length >= 2 ? /* @__PURE__ */ jsxRuntime.jsx(Sparkline2, { points: spark, color: sparkColor ?? SERIES[0] }) : null
422
+ ] }),
423
+ caption ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$1", color: "$color10", numberOfLines: 1, children: caption }) : null
424
+ ] });
425
+ }
426
+ function HintButton({
427
+ icon,
428
+ iconAfter,
429
+ children,
430
+ onPress,
431
+ disabled,
432
+ hint,
433
+ theme
434
+ }) {
435
+ const btn = /* @__PURE__ */ jsxRuntime.jsx(
436
+ gui.Button,
437
+ {
438
+ size: "$2",
439
+ theme,
440
+ icon,
441
+ iconAfter,
442
+ disabled,
443
+ onPress: disabled ? void 0 : onPress,
444
+ children
445
+ }
446
+ );
447
+ if (!hint) return btn;
448
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { title: hint, style: { display: "inline-flex" }, children: btn });
449
+ }
450
+ function Panel({
451
+ title,
452
+ right,
453
+ children,
454
+ minW = 280,
455
+ grow = true
456
+ }) {
457
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.Card, { p: "$4", gap: "$3", borderWidth: 1, borderColor: "$borderColor", flex: grow ? 1 : void 0, minW, width: grow ? void 0 : "100%", children: [
458
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", justify: "space-between", gap: "$2", children: [
459
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$4", fontWeight: "800", color: "$color12", children: title }),
460
+ right
461
+ ] }),
462
+ children
463
+ ] });
464
+ }
465
+ function Donut2({
466
+ segments,
467
+ size = 160,
468
+ thickness = 18,
469
+ centerValue,
470
+ centerLabel,
471
+ trackColor = "#2a2d2e",
472
+ valueColor = "#ecedee",
473
+ labelColor = "#9ba1a6"
474
+ }) {
475
+ const total = segments.reduce((n, s) => n + Math.max(0, s.value), 0);
476
+ if (total <= 0) return null;
477
+ const r = (size - thickness) / 2;
478
+ const cx = size / 2;
479
+ const cy = size / 2;
480
+ const circ = 2 * Math.PI * r;
481
+ let offset = 0;
482
+ const arcs = segments.filter((s) => s.value > 0).map((s) => {
483
+ const frac = s.value / total;
484
+ const dash = frac * circ;
485
+ const node = /* @__PURE__ */ jsxRuntime.jsx(
486
+ "circle",
487
+ {
488
+ cx,
489
+ cy,
490
+ r,
491
+ fill: "none",
492
+ stroke: s.color,
493
+ strokeWidth: thickness,
494
+ strokeDasharray: `${dash} ${circ - dash}`,
495
+ strokeDashoffset: -offset
496
+ },
497
+ s.label
498
+ );
499
+ offset += dash;
500
+ return node;
501
+ });
502
+ return /* @__PURE__ */ jsxRuntime.jsxs("svg", { width: size, height: size, viewBox: `0 0 ${size} ${size}`, role: "img", "aria-label": "Donut chart", children: [
503
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx, cy, r, fill: "none", stroke: trackColor, strokeWidth: thickness }),
504
+ /* @__PURE__ */ jsxRuntime.jsx("g", { transform: `rotate(-90 ${cx} ${cy})`, children: arcs }),
505
+ centerValue ? /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: cy - 2, textAnchor: "middle", fontSize: size * 0.2, fontWeight: "800", fill: valueColor, children: centerValue }) : null,
506
+ centerLabel ? /* @__PURE__ */ jsxRuntime.jsx("text", { x: cx, y: cy + size * 0.13, textAnchor: "middle", fontSize: size * 0.08, fill: labelColor, children: centerLabel }) : null
507
+ ] });
508
+ }
509
+
510
+ // src/product/combobox/filter.ts
511
+ var hay = (o) => `${o.value} ${o.label ?? ""} ${o.hint ?? ""}`.toLowerCase();
512
+ function filterOptions(options, query) {
513
+ const q = query.trim().toLowerCase();
514
+ if (!q) return options;
515
+ return options.filter((o) => hay(o).includes(q));
516
+ }
517
+ function isKnownOption(options, value) {
518
+ return options.some((o) => o.value === value);
519
+ }
520
+ var ITEM_MIN_HEIGHT = 30;
521
+ var ITEM_RADIUS = 7;
522
+ var ITEM_PX = 8;
523
+ var ITEM_GAP = 8;
524
+ var ICON_SLOT = 16;
525
+ var PANEL_RADIUS = 12;
526
+ var PANEL_PAD = 4;
527
+ var PANEL_GAP = 2;
528
+ var SEP_MARGIN = 4;
529
+ var FONT_LABEL = 13;
530
+ var FONT_MUTED = 11;
531
+ var FONT_SHORTCUT = 12;
532
+ var ACCENT2 = "var(--hanzo-accent, #8b5cf6)";
533
+ var ACCENT_SOFT = "var(--hanzo-accent-soft, rgba(139,92,246,0.16))";
534
+ var DANGER = "var(--hanzo-danger, #ef4444)";
535
+ function MenuPanel({
536
+ children,
537
+ minWidth = 200,
538
+ maxHeight = 360,
539
+ onKeyDown,
540
+ panelRef,
541
+ ...rest
542
+ }) {
543
+ return /* @__PURE__ */ jsxRuntime.jsx(
544
+ gui.YStack,
545
+ {
546
+ ref: panelRef,
547
+ role: "menu",
548
+ bg: "$color2",
549
+ borderColor: "$borderColor",
550
+ borderWidth: 1,
551
+ rounded: PANEL_RADIUS,
552
+ p: PANEL_PAD,
553
+ gap: PANEL_GAP,
554
+ minW: minWidth,
555
+ maxH: maxHeight,
556
+ overflow: "scroll",
557
+ shadowColor: "rgba(0,0,0,0.45)",
558
+ shadowRadius: 20,
559
+ shadowOffset: { width: 0, height: 10 },
560
+ onKeyDown,
561
+ ...rest,
562
+ children
563
+ }
564
+ );
565
+ }
566
+ function MenuItemView({
567
+ icon,
568
+ label,
569
+ description,
570
+ shortcut,
571
+ selected = false,
572
+ disabled = false,
573
+ destructive = false,
574
+ hasSubmenu = false,
575
+ onSelect
576
+ }) {
577
+ const press = () => {
578
+ if (!disabled) onSelect();
579
+ };
580
+ const onKeyDown = (e) => {
581
+ if (disabled) return;
582
+ if (e.key === "Enter" || e.key === " ") {
583
+ e.preventDefault();
584
+ onSelect();
585
+ }
586
+ };
587
+ const labelColor = destructive ? DANGER : "$color12";
588
+ return /* @__PURE__ */ jsxRuntime.jsxs(
589
+ gui.XStack,
590
+ {
591
+ role: "menuitem",
592
+ tabIndex: disabled ? -1 : 0,
593
+ "aria-disabled": disabled || void 0,
594
+ items: "center",
595
+ gap: ITEM_GAP,
596
+ px: ITEM_PX,
597
+ minH: ITEM_MIN_HEIGHT,
598
+ rounded: ITEM_RADIUS,
599
+ cursor: disabled ? "default" : "pointer",
600
+ opacity: disabled ? 0.4 : 1,
601
+ select: "none",
602
+ style: { outline: "none" },
603
+ hoverStyle: disabled ? {} : { bg: ACCENT_SOFT },
604
+ pressStyle: disabled ? {} : { bg: ACCENT_SOFT },
605
+ focusStyle: disabled ? {} : { bg: ACCENT_SOFT },
606
+ onPress: press,
607
+ onKeyDown,
608
+ children: [
609
+ /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { width: ICON_SLOT, height: ICON_SLOT, items: "center", justify: "center", shrink: 0, children: icon ? /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { items: "center", justify: "center", opacity: destructive ? 1 : 0.9, style: destructive ? { color: DANGER } : void 0, children: icon }) : null }),
610
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { flex: 1, minW: 0, children: [
611
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: FONT_LABEL, lineHeight: 18, color: labelColor, numberOfLines: 1, children: label }),
612
+ description ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: FONT_MUTED, lineHeight: 14, color: "$color11", numberOfLines: 1, children: description }) : null
613
+ ] }),
614
+ shortcut ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: FONT_SHORTCUT, color: "$color11", shrink: 0, children: shortcut }) : null,
615
+ selected ? /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.Check, { size: 14, color: ACCENT2 }) : null,
616
+ hasSubmenu ? /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.ChevronRight, { size: 14, color: "var(--hanzo-muted, currentColor)", opacity: 0.6 }) : null
617
+ ]
618
+ }
619
+ );
620
+ }
621
+ function MenuSeparatorView() {
622
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { height: 1, bg: "$borderColor", my: SEP_MARGIN, mx: SEP_MARGIN, role: "separator" });
623
+ }
624
+ function MenuLabelView({ children }) {
625
+ return /* @__PURE__ */ jsxRuntime.jsx(
626
+ gui.Text,
627
+ {
628
+ fontSize: FONT_MUTED,
629
+ color: "$color11",
630
+ px: ITEM_PX,
631
+ py: SEP_MARGIN,
632
+ textTransform: "uppercase",
633
+ letterSpacing: 0.4,
634
+ select: "none",
635
+ children
636
+ }
637
+ );
638
+ }
639
+ function renderMenuItems(items, close) {
640
+ return items.map((it, i) => {
641
+ if (it.type === "separator") return /* @__PURE__ */ jsxRuntime.jsx(MenuSeparatorView, {}, it.key ?? `sep-${i}`);
642
+ if (it.type === "label") return /* @__PURE__ */ jsxRuntime.jsx(MenuLabelView, { children: it.label }, it.key ?? `lbl-${i}`);
643
+ const { key, onSelect, closeOnSelect = true, ...rest } = it;
644
+ return /* @__PURE__ */ jsxRuntime.jsx(
645
+ MenuItemView,
646
+ {
647
+ ...rest,
648
+ onSelect: () => {
649
+ onSelect();
650
+ if (closeOnSelect) close?.();
651
+ }
652
+ },
653
+ key
654
+ );
655
+ });
656
+ }
657
+ function PortalTheme({ name, children }) {
658
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Theme, { name, children });
659
+ }
660
+
661
+ // src/product/menu/roving.ts
662
+ function menuKeyDown(e, onClose) {
663
+ if (e.key === "Escape") {
664
+ onClose?.();
665
+ return;
666
+ }
667
+ if (e.key !== "ArrowDown" && e.key !== "ArrowUp" && e.key !== "Home" && e.key !== "End") return;
668
+ if (typeof document === "undefined") return;
669
+ const panel = e.currentTarget;
670
+ const items = Array.from(
671
+ panel.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')
672
+ );
673
+ if (items.length === 0) return;
674
+ e.preventDefault();
675
+ const active = document.activeElement;
676
+ const current = active ? items.indexOf(active) : -1;
677
+ let next;
678
+ if (e.key === "Home") next = 0;
679
+ else if (e.key === "End") next = items.length - 1;
680
+ else if (e.key === "ArrowDown") next = current < 0 ? 0 : (current + 1) % items.length;
681
+ else next = current <= 0 ? items.length - 1 : current - 1;
682
+ items[next]?.focus();
683
+ }
684
+ var EDGE = 8;
685
+ function FloatingMenu({
686
+ open,
687
+ onClose,
688
+ anchorRect,
689
+ anchorEl,
690
+ gap = 4,
691
+ minWidth = 200,
692
+ maxHeight,
693
+ autoFocus = true,
694
+ children
695
+ }) {
696
+ const themeName = gui.useThemeName();
697
+ const panelRef = react.useRef(null);
698
+ const [pos, setPos] = react.useState(null);
699
+ const setPanel = react.useCallback((n) => {
700
+ panelRef.current = n;
701
+ }, []);
702
+ const place = react.useCallback(() => {
703
+ if (typeof window === "undefined") return;
704
+ const a = anchorRect();
705
+ if (!a) return;
706
+ const node = panelRef.current;
707
+ const w = node?.offsetWidth || minWidth;
708
+ const h = node?.offsetHeight || 0;
709
+ let left = a.left;
710
+ let top = a.bottom + gap;
711
+ if (left + w > window.innerWidth - EDGE) left = Math.max(EDGE, window.innerWidth - w - EDGE);
712
+ if (h && top + h > window.innerHeight - EDGE) {
713
+ const above = a.top - gap - h;
714
+ top = above >= EDGE ? above : Math.max(EDGE, window.innerHeight - h - EDGE);
715
+ }
716
+ setPos({ left, top });
717
+ }, [anchorRect, gap, minWidth]);
718
+ react.useLayoutEffect(() => {
719
+ if (!open) {
720
+ setPos(null);
721
+ return;
722
+ }
723
+ place();
724
+ if (autoFocus) panelRef.current?.focus?.();
725
+ }, [open, place, autoFocus]);
726
+ react.useEffect(() => {
727
+ if (!open || typeof document === "undefined") return;
728
+ const onPointerDown = (e) => {
729
+ const t = e.target;
730
+ if (panelRef.current?.contains(t)) return;
731
+ const anchor = anchorEl?.();
732
+ if (anchor && anchor.contains(t)) return;
733
+ onClose();
734
+ };
735
+ const onKey = (e) => {
736
+ if (e.key === "Escape") onClose();
737
+ };
738
+ document.addEventListener("pointerdown", onPointerDown, true);
739
+ document.addEventListener("keydown", onKey, true);
740
+ window.addEventListener("scroll", onClose, true);
741
+ window.addEventListener("resize", onClose);
742
+ window.addEventListener("blur", onClose);
743
+ return () => {
744
+ document.removeEventListener("pointerdown", onPointerDown, true);
745
+ document.removeEventListener("keydown", onKey, true);
746
+ window.removeEventListener("scroll", onClose, true);
747
+ window.removeEventListener("resize", onClose);
748
+ window.removeEventListener("blur", onClose);
749
+ };
750
+ }, [open, onClose, anchorEl]);
751
+ if (!open) return null;
752
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(PortalTheme, { name: themeName, children: /* @__PURE__ */ jsxRuntime.jsx(
753
+ MenuPanel,
754
+ {
755
+ panelRef: setPanel,
756
+ minWidth,
757
+ maxHeight,
758
+ tabIndex: -1,
759
+ onKeyDown: (e) => menuKeyDown(e, onClose),
760
+ style: {
761
+ position: "fixed",
762
+ left: pos?.left ?? 0,
763
+ top: pos?.top ?? 0,
764
+ zIndex: 1e5,
765
+ visibility: pos ? "visible" : "hidden"
766
+ },
767
+ children
768
+ }
769
+ ) }) });
770
+ }
771
+ function ComboBox({
772
+ value,
773
+ onChange,
774
+ options,
775
+ loading = false,
776
+ error = null,
777
+ onRetry,
778
+ placeholder,
779
+ disabled,
780
+ emptyText = "No matches \u2014 press to use what you typed.",
781
+ minWidth = 240
782
+ }) {
783
+ const [open, setOpen] = react.useState(false);
784
+ const rowRef = react.useRef(null);
785
+ const anchorRect = react.useCallback(() => rowRef.current?.getBoundingClientRect() ?? null, []);
786
+ const anchorEl = react.useCallback(() => rowRef.current, []);
787
+ const filtered = react.useMemo(() => filterOptions(options, value), [options, value]);
788
+ const pick = (v) => {
789
+ onChange(v);
790
+ setOpen(false);
791
+ };
792
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
793
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { ref: rowRef, items: "center", gap: "$2", minW: minWidth, children: [
794
+ /* @__PURE__ */ jsxRuntime.jsx(
795
+ gui.Input,
796
+ {
797
+ flex: 1,
798
+ value,
799
+ onChangeText: (v) => {
800
+ onChange(v);
801
+ if (!open) setOpen(true);
802
+ },
803
+ onFocus: () => setOpen(true),
804
+ disabled,
805
+ placeholder,
806
+ autoCapitalize: "none"
807
+ }
808
+ ),
809
+ /* @__PURE__ */ jsxRuntime.jsx(
810
+ gui.Button,
811
+ {
812
+ size: "$2",
813
+ chromeless: true,
814
+ disabled,
815
+ icon: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.ChevronDown, { size: 16, opacity: 0.7 }),
816
+ onPress: () => setOpen((o) => !o),
817
+ "aria-label": "Show options"
818
+ }
819
+ )
820
+ ] }),
821
+ /* @__PURE__ */ jsxRuntime.jsx(
822
+ FloatingMenu,
823
+ {
824
+ open,
825
+ onClose: () => setOpen(false),
826
+ anchorRect,
827
+ anchorEl,
828
+ autoFocus: false,
829
+ minWidth,
830
+ maxHeight: 300,
831
+ children: loading ? /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2", px: "$2", py: "$2", children: [
832
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Spinner, { size: "small", color: "$color11" }),
833
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color10", children: "Loading options\u2026" })
834
+ ] }) : error ? /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2", px: "$2", py: "$2", children: [
835
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color10", flex: 1, numberOfLines: 2, children: error }),
836
+ onRetry ? /* @__PURE__ */ jsxRuntime.jsx(gui.Button, { size: "$1", chromeless: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.RefreshCw, { size: 12 }), onPress: onRetry, "aria-label": "Retry" }) : null
837
+ ] }) : filtered.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color10", px: "$2", py: "$2", children: emptyText }) : filtered.map((o) => /* @__PURE__ */ jsxRuntime.jsx(
838
+ MenuItemView,
839
+ {
840
+ label: o.label ?? o.value,
841
+ description: o.hint,
842
+ selected: o.value === value,
843
+ onSelect: () => pick(o.value)
844
+ },
845
+ o.value
846
+ ))
847
+ }
848
+ )
849
+ ] });
850
+ }
851
+
852
+ // src/product/surfaces.data.ts
853
+ var SURFACES = [
854
+ { id: "ai", label: "Hanzo AI", href: "https://hanzo.ai", hint: "hanzo.ai" },
855
+ { id: "console", label: "Console", href: "https://console.hanzo.ai", hint: "console.hanzo.ai" },
856
+ { id: "app", label: "App", href: "https://hanzo.app", hint: "hanzo.app" },
857
+ { id: "chat", label: "Chat", href: "https://hanzo.chat", hint: "hanzo.chat" },
858
+ { id: "bot", label: "Bot", href: "https://hanzo.bot", hint: "hanzo.bot" },
859
+ { id: "team", label: "Team", href: "https://hanzo.team", hint: "hanzo.team" },
860
+ { id: "billing", label: "Billing", href: "https://billing.hanzo.ai", hint: "billing.hanzo.ai" }
861
+ ];
862
+ function otherSurfaces(current) {
863
+ return current ? SURFACES.filter((s) => s.id !== current) : SURFACES;
864
+ }
865
+ function HanzoMark({ size = 22, color = "currentColor" }) {
866
+ return /* @__PURE__ */ jsxRuntime.jsxs(
867
+ "svg",
868
+ {
869
+ width: size,
870
+ height: size,
871
+ viewBox: "0 0 67 67",
872
+ role: "img",
873
+ "aria-label": "Hanzo",
874
+ fill: color,
875
+ style: { display: "block", flexShrink: 0 },
876
+ children: [
877
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22.21 67V44.6369H0V67H22.21Z" }),
878
+ /* @__PURE__ */ jsxRuntime.jsx("path", { opacity: 0.55, d: "M0 44.6369L22.21 46.8285V44.6369H0Z" }),
879
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z" }),
880
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22.21 0H0V22.3184H22.21V0Z" }),
881
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M66.7198 0H44.5098V22.3184H66.7198V0Z" }),
882
+ /* @__PURE__ */ jsxRuntime.jsx("path", { opacity: 0.55, d: "M66.6753 22.3185L44.5098 20.0822V22.3185H66.6753Z" }),
883
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M66.7198 67V44.6369H44.5098V67H66.7198Z" })
884
+ ]
885
+ }
886
+ );
887
+ }
888
+ function BrandMark({
889
+ size = 20,
890
+ wordmark = "Hanzo",
891
+ animated = true
892
+ }) {
893
+ if (!animated) return /* @__PURE__ */ jsxRuntime.jsx(HanzoMark, { size });
894
+ return /* @__PURE__ */ jsxRuntime.jsx(react$1.HanzoLogo, { animated: true, size, wordmark });
895
+ }
896
+ var SURFACE_ICON = {
897
+ ai: lucideIcons2.Sparkles,
898
+ console: lucideIcons2.LayoutGrid,
899
+ app: lucideIcons2.AppWindow,
900
+ chat: lucideIcons2.MessageCircle,
901
+ bot: lucideIcons2.Bot,
902
+ team: lucideIcons2.Users,
903
+ billing: lucideIcons2.CreditCard
904
+ };
905
+ var openHref = (href) => {
906
+ if (typeof window !== "undefined") window.open(href, "_blank", "noopener");
907
+ };
908
+ function MenuRow({ icon, label, onPress }) {
909
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { onPress, cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", rounded: "$3", hoverStyle: { bg: "$color5" }, children: [
910
+ icon,
911
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color12", children: label })
912
+ ] });
913
+ }
914
+ function AppHeader({
915
+ brand,
916
+ wordmark = "Hanzo",
917
+ onBrand,
918
+ org,
919
+ children,
920
+ current,
921
+ surfaces,
922
+ open,
923
+ user,
924
+ menu,
925
+ theme,
926
+ onProfile,
927
+ onTeam,
928
+ onBilling,
929
+ onSignOut
930
+ }) {
931
+ const [appsOpen, setAppsOpen] = react.useState(false);
932
+ const [menuOpen, setMenuOpen] = react.useState(false);
933
+ const items = surfaces ?? otherSurfaces(current);
934
+ const launch = (s) => {
935
+ setAppsOpen(false);
936
+ if (open) open(s);
937
+ else openHref(s.href);
938
+ };
939
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2", px: "$3", height: 52, borderBottomWidth: 1, borderColor: "$borderColor", bg: "$background", children: [
940
+ /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { items: "center", cursor: onBrand ? "pointer" : void 0, onPress: onBrand, children: brand ?? /* @__PURE__ */ jsxRuntime.jsx(BrandMark, { wordmark }) }),
941
+ org ? /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { items: "center", minW: 0, children: org }) : null,
942
+ /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { flex: 1, items: "center", minW: 0, children }),
943
+ items.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(gui.Popover, { open: appsOpen, onOpenChange: setAppsOpen, placement: "bottom-end", children: [
944
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Button, { size: "$2", chromeless: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.Grip, { size: 16 }), "aria-label": "Apps" }) }),
945
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Content, { bordered: true, elevate: true, p: "$2", width: 230, bg: "$color2", borderColor: "$borderColor", children: /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { gap: "$1", children: items.map((s) => {
946
+ const Icon = SURFACE_ICON[s.id];
947
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { onPress: () => launch(s), cursor: "pointer", items: "center", gap: "$2.5", px: "$2", py: "$2", rounded: "$3", hoverStyle: { bg: "$color5" }, children: [
948
+ /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 16 }),
949
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { flex: 1, fontSize: "$2", fontWeight: "600", color: "$color12", children: s.label }),
950
+ s.hint ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$1", color: "$color10", children: s.hint }) : null
951
+ ] }, s.id);
952
+ }) }) })
953
+ ] }) : null,
954
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.Popover, { open: menuOpen, onOpenChange: setMenuOpen, placement: "bottom-end", children: [
955
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Button, { size: "$2", chromeless: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.UserRound, { size: 16 }), "aria-label": "Account", children: user ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color12", numberOfLines: 1, maxW: 140, children: user }) : null }) }),
956
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Content, { bordered: true, elevate: true, p: "$2", width: 220, bg: "$color2", borderColor: "$borderColor", children: menu ?? /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { gap: "$1", children: [
957
+ onProfile ? /* @__PURE__ */ jsxRuntime.jsx(MenuRow, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.UserRound, { size: 15 }), label: "Profile", onPress: () => (setMenuOpen(false), onProfile()) }) : null,
958
+ theme !== null ? /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2.5", px: "$2", py: "$1", rounded: "$3", children: [
959
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { flex: 1, fontSize: "$2", color: "$color12", children: "Theme" }),
960
+ theme ?? /* @__PURE__ */ jsxRuntime.jsx(chunkYBXVUV7P_cjs.ThemeToggle, {})
961
+ ] }) : null,
962
+ onTeam ? /* @__PURE__ */ jsxRuntime.jsx(MenuRow, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.Settings2, { size: 15 }), label: "Team settings", onPress: () => (setMenuOpen(false), onTeam()) }) : null,
963
+ onBilling ? /* @__PURE__ */ jsxRuntime.jsx(MenuRow, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.CreditCard, { size: 15 }), label: "Billing", onPress: () => (setMenuOpen(false), onBilling()) }) : null,
964
+ onSignOut ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
965
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Separator, { borderColor: "$borderColor", my: "$1" }),
966
+ /* @__PURE__ */ jsxRuntime.jsx(MenuRow, { icon: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.LogOut, { size: 15 }), label: "Sign out", onPress: () => (setMenuOpen(false), onSignOut()) })
967
+ ] }) : null
968
+ ] }) })
969
+ ] })
970
+ ] });
971
+ }
972
+
973
+ // src/product/scope.ts
974
+ function browserStorage() {
975
+ if (typeof window === "undefined") return null;
976
+ try {
977
+ return window.localStorage;
978
+ } catch {
979
+ return null;
980
+ }
981
+ }
982
+ function orgScope(config) {
983
+ const key = config.key ?? "hanzo.org";
984
+ const selectedKey = `${key}.selected`;
985
+ const store = () => config.storage ?? browserStorage();
986
+ const read = (k) => {
987
+ try {
988
+ return store()?.getItem(k) ?? null;
989
+ } catch {
990
+ return null;
991
+ }
992
+ };
993
+ const write = (k, v) => {
994
+ try {
995
+ if (v === null) store()?.removeItem(k);
996
+ else store()?.setItem(k, v);
997
+ } catch {
998
+ }
999
+ };
1000
+ const goHome = () => {
1001
+ if (config.navigate) return config.navigate("/");
1002
+ if (typeof window !== "undefined") window.location.assign("/");
1003
+ };
1004
+ const doReload = () => {
1005
+ if (config.reload) return config.reload();
1006
+ if (typeof window !== "undefined") window.location.reload();
1007
+ };
1008
+ const scope = {
1009
+ currentOrg: () => read(key) || config.brandOrg,
1010
+ setCurrentOrg: (org) => write(key, !org || org === config.brandOrg ? null : org),
1011
+ isScopedAway: () => scope.currentOrg() !== config.brandOrg,
1012
+ hasSelectedOrg: () => read(selectedKey) === "1",
1013
+ enterOrg: (org) => {
1014
+ if (!org) return;
1015
+ scope.setCurrentOrg(org);
1016
+ write(selectedKey, "1");
1017
+ goHome();
1018
+ },
1019
+ leaveOrg: () => {
1020
+ write(selectedKey, null);
1021
+ scope.setCurrentOrg(config.brandOrg);
1022
+ goHome();
1023
+ },
1024
+ switchOrg: (org) => {
1025
+ if (!org || org === scope.currentOrg()) return;
1026
+ scope.setCurrentOrg(org);
1027
+ write(selectedKey, "1");
1028
+ doReload();
1029
+ }
1030
+ };
1031
+ return scope;
1032
+ }
1033
+ function filterOrgs(orgs, query) {
1034
+ const q = query.trim().toLowerCase();
1035
+ if (!q) return orgs;
1036
+ return orgs.filter(
1037
+ (o) => o.name.toLowerCase().includes(q) || (o.displayName ?? "").toLowerCase().includes(q)
1038
+ );
1039
+ }
1040
+ var titleCase = (s) => s ? s[0].toUpperCase() + s.slice(1) : s;
1041
+ var initialsOf = (o) => (o.displayName || o.name).split(/\s+/).map((w) => w[0]).join("").slice(0, 2).toUpperCase();
1042
+ function OrgAvatar({ org, size = 22 }) {
1043
+ if (org.logo) {
1044
+ return /* @__PURE__ */ jsxRuntime.jsx("img", { src: org.logo, alt: "", style: { height: size, width: size, objectFit: "contain", display: "block", borderRadius: 6 } });
1045
+ }
1046
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { width: size, height: size, rounded: "$3", bg: "$color4", items: "center", justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$1", fontWeight: "800", color: "$color12", children: initialsOf(org) }) });
1047
+ }
1048
+ function OrgSwitcher({ scope, orgs, pageSize = 20, create, picker = false }) {
1049
+ const currentId = scope.currentOrg();
1050
+ const [open, setOpen] = react.useState(false);
1051
+ const [query, setQuery] = react.useState("");
1052
+ const [debounced, setDebounced] = react.useState("");
1053
+ const [rows, setRows] = react.useState([]);
1054
+ const [loading, setLoading] = react.useState(false);
1055
+ const [loadingMore, setLoadingMore] = react.useState(false);
1056
+ const [hasMore, setHasMore] = react.useState(false);
1057
+ const [creating, setCreating] = react.useState(false);
1058
+ const [newName, setNewName] = react.useState("");
1059
+ const [busy, setBusy] = react.useState(false);
1060
+ const [err, setErr] = react.useState(null);
1061
+ const pageRef = react.useRef(0);
1062
+ const reqRef = react.useRef(0);
1063
+ react.useEffect(() => {
1064
+ const id = setTimeout(() => setDebounced(query.trim()), 250);
1065
+ return () => clearTimeout(id);
1066
+ }, [query]);
1067
+ const fetchPage = react.useCallback(
1068
+ async (page, q, append) => {
1069
+ if (!orgs) return;
1070
+ const token = ++reqRef.current;
1071
+ append ? setLoadingMore(true) : setLoading(true);
1072
+ try {
1073
+ const incoming = await orgs(page, q);
1074
+ if (token !== reqRef.current) return;
1075
+ pageRef.current = page;
1076
+ setRows((prev) => {
1077
+ const merged = append ? [...prev] : [];
1078
+ const seen = new Set(merged.map((o) => o.name));
1079
+ for (const o of incoming) if (!seen.has(o.name)) merged.push(o);
1080
+ return merged;
1081
+ });
1082
+ setHasMore(incoming.length >= pageSize);
1083
+ } catch {
1084
+ if (token !== reqRef.current) return;
1085
+ if (!append) setRows([]);
1086
+ setHasMore(false);
1087
+ } finally {
1088
+ if (token === reqRef.current) {
1089
+ setLoading(false);
1090
+ setLoadingMore(false);
1091
+ }
1092
+ }
1093
+ },
1094
+ [orgs, pageSize]
1095
+ );
1096
+ react.useEffect(() => {
1097
+ if (!open || !orgs) return;
1098
+ void fetchPage(0, debounced, false);
1099
+ }, [open, debounced, fetchPage, orgs]);
1100
+ const loadMore = react.useCallback(() => {
1101
+ if (loading || loadingMore || !hasMore) return;
1102
+ void fetchPage(pageRef.current + 1, debounced, true);
1103
+ }, [loading, loadingMore, hasMore, debounced, fetchPage]);
1104
+ const visible = react.useMemo(() => {
1105
+ if (orgs) return filterOrgs(rows, query);
1106
+ return [{ name: currentId, displayName: titleCase(currentId) }];
1107
+ }, [orgs, rows, query, currentId]);
1108
+ const current = react.useMemo(
1109
+ () => rows.find((o) => o.name === currentId) ?? { name: currentId, displayName: titleCase(currentId) },
1110
+ [rows, currentId]
1111
+ );
1112
+ const select = react.useCallback(
1113
+ (org) => {
1114
+ setOpen(false);
1115
+ scope.switchOrg(org);
1116
+ },
1117
+ [scope]
1118
+ );
1119
+ const submitCreate = async () => {
1120
+ const name = newName.trim();
1121
+ if (!name || !create) return;
1122
+ setBusy(true);
1123
+ setErr(null);
1124
+ try {
1125
+ const org = await create(name);
1126
+ scope.switchOrg(org);
1127
+ } catch (e) {
1128
+ setErr(e instanceof Error ? e.message : "Could not create the organization.");
1129
+ setBusy(false);
1130
+ }
1131
+ };
1132
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.Popover, { open, onOpenChange: setOpen, placement: "bottom-start", children: [
1133
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Button, { size: "$2", chromeless: true, icon: /* @__PURE__ */ jsxRuntime.jsx(OrgAvatar, { org: current, size: 18 }), iconAfter: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.ChevronsUpDown, { size: 13 }), children: current.displayName || titleCase(current.name) }) }),
1134
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Popover.Content, { bordered: true, elevate: true, p: "$2", width: 300, bg: "$color2", borderColor: "$borderColor", children: creating ? /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { gap: "$2", children: [
1135
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color12", fontWeight: "700", children: "Create organization" }),
1136
+ /* @__PURE__ */ jsxRuntime.jsx(
1137
+ gui.Input,
1138
+ {
1139
+ size: "$3",
1140
+ placeholder: "Organization name",
1141
+ value: newName,
1142
+ onChangeText: setNewName,
1143
+ autoCapitalize: "words",
1144
+ onSubmitEditing: () => void submitCreate()
1145
+ }
1146
+ ),
1147
+ err ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$1", color: "$red10", children: err }) : null,
1148
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: "$2", justify: "flex-end", children: [
1149
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Button, { size: "$2", chromeless: true, onPress: () => setCreating(false), disabled: busy, children: "Cancel" }),
1150
+ /* @__PURE__ */ jsxRuntime.jsx(
1151
+ gui.Button,
1152
+ {
1153
+ size: "$2",
1154
+ onPress: () => void submitCreate(),
1155
+ disabled: busy || !newName.trim(),
1156
+ icon: busy ? /* @__PURE__ */ jsxRuntime.jsx(gui.Spinner, { size: "small" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.Plus, { size: 14 }),
1157
+ children: "Create"
1158
+ }
1159
+ )
1160
+ ] })
1161
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { gap: "$1", children: [
1162
+ orgs ? /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2", px: "$2", py: "$1", rounded: "$3", borderWidth: 1, borderColor: "$borderColor", children: [
1163
+ /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.Search, { size: 13, opacity: 0.6 }),
1164
+ /* @__PURE__ */ jsxRuntime.jsx(
1165
+ gui.Input,
1166
+ {
1167
+ flex: 1,
1168
+ size: "$2",
1169
+ borderWidth: 0,
1170
+ bg: "transparent",
1171
+ placeholder: "Find organization\u2026",
1172
+ value: query,
1173
+ onChangeText: setQuery,
1174
+ autoCapitalize: "none",
1175
+ autoCorrect: false
1176
+ }
1177
+ )
1178
+ ] }) : null,
1179
+ /* @__PURE__ */ jsxRuntime.jsxs(
1180
+ "div",
1181
+ {
1182
+ style: { maxHeight: 300, overflowY: "auto", display: "flex", flexDirection: "column" },
1183
+ onScroll: (e) => {
1184
+ const el = e.currentTarget;
1185
+ if (el.scrollHeight - el.scrollTop - el.clientHeight < 48) loadMore();
1186
+ },
1187
+ children: [
1188
+ loading ? /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2", px: "$2", py: "$3", children: [
1189
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Spinner, { size: "small", color: "$color11" }),
1190
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color10", children: "Loading organizations\u2026" })
1191
+ ] }) : visible.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { px: "$2", py: "$2", fontSize: "$2", color: "$color10", children: query.trim() ? `No organizations match \u201C${query.trim()}\u201D.` : "No organizations yet." }) : visible.map((org) => /* @__PURE__ */ jsxRuntime.jsxs(
1192
+ gui.XStack,
1193
+ {
1194
+ onPress: () => select(org.name),
1195
+ cursor: "pointer",
1196
+ items: "center",
1197
+ gap: "$2.5",
1198
+ px: "$2",
1199
+ py: "$2",
1200
+ rounded: "$3",
1201
+ bg: org.name === currentId ? "$color4" : "transparent",
1202
+ hoverStyle: { bg: "$color5" },
1203
+ children: [
1204
+ /* @__PURE__ */ jsxRuntime.jsx(OrgAvatar, { org }),
1205
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { flex: 1, fontSize: "$2", color: "$color12", numberOfLines: 1, children: org.displayName || org.name }),
1206
+ org.name === currentId ? /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.Check, { size: 15 }) : null
1207
+ ]
1208
+ },
1209
+ org.name
1210
+ )),
1211
+ loadingMore ? /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { items: "center", gap: "$2", px: "$2", py: "$2", children: [
1212
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Spinner, { size: "small", color: "$color11" }),
1213
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$1", color: "$color10", children: "Loading more\u2026" })
1214
+ ] }) : hasMore ? /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { onPress: loadMore, cursor: "pointer", items: "center", justify: "center", px: "$2", py: "$1.5", rounded: "$3", hoverStyle: { bg: "$color4" }, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$1", color: "$color11", fontWeight: "600", children: "Load more" }) }) : null
1215
+ ]
1216
+ }
1217
+ ),
1218
+ create ? /* @__PURE__ */ jsxRuntime.jsxs(
1219
+ gui.XStack,
1220
+ {
1221
+ onPress: () => {
1222
+ setCreating(true);
1223
+ setErr(null);
1224
+ },
1225
+ cursor: "pointer",
1226
+ items: "center",
1227
+ gap: "$2.5",
1228
+ px: "$2",
1229
+ py: "$2",
1230
+ mt: "$1",
1231
+ rounded: "$3",
1232
+ borderTopWidth: 1,
1233
+ borderColor: "$borderColor",
1234
+ hoverStyle: { bg: "$color5" },
1235
+ children: [
1236
+ /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { width: 22, height: 22, rounded: "$3", bg: "$color3", items: "center", justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.Plus, { size: 14 }) }),
1237
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color12", children: "Create organization" })
1238
+ ]
1239
+ }
1240
+ ) : null,
1241
+ picker ? /* @__PURE__ */ jsxRuntime.jsxs(
1242
+ gui.XStack,
1243
+ {
1244
+ onPress: () => {
1245
+ setOpen(false);
1246
+ scope.leaveOrg();
1247
+ },
1248
+ cursor: "pointer",
1249
+ items: "center",
1250
+ gap: "$2.5",
1251
+ px: "$2",
1252
+ py: "$2",
1253
+ rounded: "$3",
1254
+ hoverStyle: { bg: "$color5" },
1255
+ children: [
1256
+ /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { width: 22, height: 22, rounded: "$3", bg: "$color3", items: "center", justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.LayoutGrid, { size: 14 }) }),
1257
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color12", children: "All organizations" })
1258
+ ]
1259
+ }
1260
+ ) : null
1261
+ ] }) })
1262
+ ] });
1263
+ }
1264
+ function DropdownMenu({
1265
+ trigger,
1266
+ items,
1267
+ open,
1268
+ defaultOpen = false,
1269
+ onOpenChange,
1270
+ minWidth = 200,
1271
+ maxHeight
1272
+ }) {
1273
+ const [isOpen, setOpen] = gui.useControllableState({
1274
+ prop: open,
1275
+ defaultProp: defaultOpen,
1276
+ onChange: onOpenChange
1277
+ });
1278
+ const anchorRef = react.useRef(null);
1279
+ const anchorRect = react.useCallback(() => anchorRef.current?.getBoundingClientRect() ?? null, []);
1280
+ const anchorEl = react.useCallback(() => anchorRef.current, []);
1281
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1282
+ /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { ref: anchorRef, self: "flex-start", cursor: "pointer", onPress: () => setOpen(!isOpen), children: trigger }),
1283
+ /* @__PURE__ */ jsxRuntime.jsx(
1284
+ FloatingMenu,
1285
+ {
1286
+ open: isOpen,
1287
+ onClose: () => setOpen(false),
1288
+ anchorRect,
1289
+ anchorEl,
1290
+ minWidth,
1291
+ maxHeight,
1292
+ children: renderMenuItems(items, () => setOpen(false))
1293
+ }
1294
+ )
1295
+ ] });
1296
+ }
1297
+ function ContextMenu({ children, items, disabled, minWidth = 200, maxHeight }) {
1298
+ const [state, setState] = react.useState({ open: false, x: 0, y: 0 });
1299
+ const close = react.useCallback(() => setState((s) => s.open ? { ...s, open: false } : s), []);
1300
+ const anchorRect = react.useCallback(
1301
+ () => ({ left: state.x, top: state.y, right: state.x, bottom: state.y, width: 0, height: 0 }),
1302
+ [state.x, state.y]
1303
+ );
1304
+ const childOnContextMenu = children.props.onContextMenu;
1305
+ const target = react.cloneElement(children, {
1306
+ onContextMenu: (e) => {
1307
+ childOnContextMenu?.(e);
1308
+ if (disabled) return;
1309
+ e.preventDefault();
1310
+ e.stopPropagation();
1311
+ setState({ open: true, x: e.clientX, y: e.clientY });
1312
+ }
1313
+ });
1314
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1315
+ target,
1316
+ /* @__PURE__ */ jsxRuntime.jsx(FloatingMenu, { open: state.open, onClose: close, anchorRect, gap: 0, minWidth, maxHeight, children: renderMenuItems(items, close) })
1317
+ ] });
1318
+ }
1319
+ function DataTable({
1320
+ columns,
1321
+ rows,
1322
+ loading,
1323
+ empty = "Nothing here yet.",
1324
+ rowKey,
1325
+ onRowPress
1326
+ }) {
1327
+ if (loading) {
1328
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { p: "$6", justify: "center", children: /* @__PURE__ */ jsxRuntime.jsx(gui.Spinner, { size: "large", color: "$color11" }) });
1329
+ }
1330
+ if (rows.length === 0) {
1331
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { p: "$6", items: "center", borderWidth: 1, borderColor: "$borderColor", rounded: "$4", children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { color: "$color11", children: empty }) });
1332
+ }
1333
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { borderWidth: 1, borderColor: "$borderColor", rounded: "$4", overflow: "hidden", children: [
1334
+ /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { bg: "$color2", py: "$2.5", px: "$3", gap: "$3", children: columns.map((c) => /* @__PURE__ */ jsxRuntime.jsx(
1335
+ gui.Text,
1336
+ {
1337
+ width: c.width,
1338
+ flex: c.width ? void 0 : 1,
1339
+ fontSize: "$2",
1340
+ fontWeight: "700",
1341
+ color: "$color11",
1342
+ children: c.header
1343
+ },
1344
+ c.key
1345
+ )) }),
1346
+ /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { children: rows.map((row) => /* @__PURE__ */ jsxRuntime.jsx(
1347
+ gui.XStack,
1348
+ {
1349
+ py: "$2.5",
1350
+ px: "$3",
1351
+ gap: "$3",
1352
+ borderTopWidth: 1,
1353
+ borderColor: "$borderColor",
1354
+ items: "center",
1355
+ hoverStyle: onRowPress ? { bg: "$color2" } : void 0,
1356
+ cursor: onRowPress ? "pointer" : void 0,
1357
+ onPress: onRowPress ? () => onRowPress(row) : void 0,
1358
+ children: columns.map((c) => /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { width: c.width, flex: c.width ? void 0 : 1, children: c.render ? c.render(row) : /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$3", numberOfLines: 1, children: String(row[c.key] ?? "") }) }, c.key))
1359
+ },
1360
+ rowKey(row)
1361
+ )) })
1362
+ ] });
1363
+ }
1364
+ function PrimaryButton(props) {
1365
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Button, { theme: "light", ...props });
1366
+ }
1367
+ function openHref2(href) {
1368
+ if (typeof window !== "undefined") window.open(href, "_blank", "noopener");
1369
+ }
1370
+ function EmptyState({
1371
+ icon: Icon,
1372
+ title,
1373
+ description,
1374
+ bullets,
1375
+ primary,
1376
+ secondary
1377
+ }) {
1378
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1379
+ gui.Card,
1380
+ {
1381
+ borderWidth: 1,
1382
+ borderColor: "$borderColor",
1383
+ borderStyle: "dashed",
1384
+ p: "$6",
1385
+ gap: "$4",
1386
+ items: "center",
1387
+ maxWidth: 640,
1388
+ self: "center",
1389
+ width: "100%",
1390
+ children: [
1391
+ /* @__PURE__ */ jsxRuntime.jsx(
1392
+ gui.YStack,
1393
+ {
1394
+ width: 48,
1395
+ height: 48,
1396
+ items: "center",
1397
+ justify: "center",
1398
+ rounded: "$4",
1399
+ bg: "$color3",
1400
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 24 })
1401
+ }
1402
+ ),
1403
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { gap: "$2", items: "center", maxW: 480, children: [
1404
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$6", fontWeight: "800", text: "center", children: title }),
1405
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$3", color: "$color11", text: "center", children: description })
1406
+ ] }),
1407
+ bullets && bullets.length ? /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { gap: "$2", self: "stretch", maxW: 420, mx: "auto", children: bullets.map((b) => /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: "$2", items: "flex-start", children: [
1408
+ /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { pt: "$1", children: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.Check, { size: 14, color: "$color10" }) }),
1409
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$3", color: "$color11", flex: 1, children: b })
1410
+ ] }, b)) }) : null,
1411
+ primary || secondary ? /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: "$2", items: "center", flexWrap: "wrap", justify: "center", children: [
1412
+ primary ? /* @__PURE__ */ jsxRuntime.jsx(
1413
+ PrimaryButton,
1414
+ {
1415
+ icon: primary.icon,
1416
+ iconAfter: primary.href ? /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.ExternalLink, { size: 15 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.ArrowRight, { size: 15 }),
1417
+ onPress: () => primary.href ? openHref2(primary.href) : primary.onPress?.(),
1418
+ children: primary.label
1419
+ }
1420
+ ) : null,
1421
+ secondary ? /* @__PURE__ */ jsxRuntime.jsx(
1422
+ gui.Button,
1423
+ {
1424
+ chromeless: true,
1425
+ icon: secondary.icon,
1426
+ iconAfter: secondary.href ? /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.ExternalLink, { size: 14 }) : void 0,
1427
+ onPress: () => secondary.href ? openHref2(secondary.href) : secondary.onPress?.(),
1428
+ children: secondary.label
1429
+ }
1430
+ ) : null
1431
+ ] }) : null
1432
+ ]
1433
+ }
1434
+ );
1435
+ }
1436
+ function FadeIn({
1437
+ children,
1438
+ index = 0,
1439
+ step = 50,
1440
+ delayMs,
1441
+ style
1442
+ }) {
1443
+ const delay = delayMs ?? index * step;
1444
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "hz-fade-up", style: { animationDelay: `${delay}ms`, ...style }, children });
1445
+ }
1446
+ function FieldRow({ label, children }) {
1447
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: "$3", items: "flex-start", flexWrap: "wrap", children: [
1448
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Label, { width: 180, pt: "$2", color: "$color11", fontSize: "$3", children: label }),
1449
+ /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { flex: 1, minW: 240, children })
1450
+ ] });
1451
+ }
1452
+ function FieldText({
1453
+ value,
1454
+ onChange,
1455
+ disabled,
1456
+ secure,
1457
+ placeholder
1458
+ }) {
1459
+ return /* @__PURE__ */ jsxRuntime.jsx(
1460
+ gui.Input,
1461
+ {
1462
+ value,
1463
+ onChangeText: onChange,
1464
+ disabled,
1465
+ secureTextEntry: secure,
1466
+ placeholder,
1467
+ autoCapitalize: "none"
1468
+ }
1469
+ );
1470
+ }
1471
+ function FieldTextArea({
1472
+ value,
1473
+ onChange,
1474
+ disabled,
1475
+ rows = 6
1476
+ }) {
1477
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.TextArea, { value, onChangeText: onChange, disabled, numberOfLines: rows });
1478
+ }
1479
+ function FieldSwitch({
1480
+ checked,
1481
+ onChange,
1482
+ disabled
1483
+ }) {
1484
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Switch, { checked, onCheckedChange: onChange, disabled, size: "$3", children: /* @__PURE__ */ jsxRuntime.jsx(gui.Switch.Thumb, {}) });
1485
+ }
1486
+ function FieldSelect({
1487
+ value,
1488
+ options,
1489
+ onChange,
1490
+ disabled
1491
+ }) {
1492
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.Select, { value, onValueChange: onChange, disablePreventBodyScroll: true, native: true, children: [
1493
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Select.Trigger, { disabled, iconAfter: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.ChevronDown, { size: 16 }), children: /* @__PURE__ */ jsxRuntime.jsx(gui.Select.Value, { placeholder: "Select\u2026" }) }),
1494
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Select.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(gui.Select.Viewport, { children: options.map((opt, i) => /* @__PURE__ */ jsxRuntime.jsx(gui.Select.Item, { index: i, value: opt, children: /* @__PURE__ */ jsxRuntime.jsx(gui.Select.ItemText, { children: opt }) }, opt)) }) })
1495
+ ] });
1496
+ }
1497
+ function FieldSlider({
1498
+ value,
1499
+ min,
1500
+ max,
1501
+ step,
1502
+ onChange,
1503
+ disabled
1504
+ }) {
1505
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: "$3", items: "center", children: [
1506
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { width: 56, fontSize: "$3", color: "$color11", children: value }),
1507
+ /* @__PURE__ */ jsxRuntime.jsxs(
1508
+ gui.Slider,
1509
+ {
1510
+ flex: 1,
1511
+ min,
1512
+ max,
1513
+ step,
1514
+ value: [value],
1515
+ onValueChange: (v) => onChange(v[0] ?? min),
1516
+ disabled,
1517
+ children: [
1518
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Slider.Track, { children: /* @__PURE__ */ jsxRuntime.jsx(gui.Slider.TrackActive, {}) }),
1519
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Slider.Thumb, { index: 0, circular: true })
1520
+ ]
1521
+ }
1522
+ )
1523
+ ] });
1524
+ }
1525
+ function PageHeader({
1526
+ title,
1527
+ subtitle,
1528
+ actions
1529
+ }) {
1530
+ return /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { justify: "space-between", items: "flex-start", gap: "$4", children: [
1531
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { gap: "$1", children: [
1532
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$7", fontWeight: "800", children: title }),
1533
+ subtitle ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$3", color: "$color11", children: subtitle }) : null
1534
+ ] }),
1535
+ actions ? /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { gap: "$2", children: actions }) : null
1536
+ ] });
1537
+ }
1538
+
1539
+ // src/product/color.ts
1540
+ var asColor = (hex) => hex;
1541
+ function ProductIcon({
1542
+ icon: Icon,
1543
+ color,
1544
+ size = 24
1545
+ }) {
1546
+ const radius = Math.round(size * 0.28);
1547
+ const glyph = Math.round(size * 0.58);
1548
+ const tinted = typeof color === "string" && color.trim() !== "";
1549
+ if (tinted) {
1550
+ return /* @__PURE__ */ jsxRuntime.jsx(
1551
+ gui.XStack,
1552
+ {
1553
+ width: size,
1554
+ height: size,
1555
+ items: "center",
1556
+ justify: "center",
1557
+ rounded: radius,
1558
+ style: { backgroundColor: color },
1559
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: glyph, color: asColor("#ffffff") })
1560
+ }
1561
+ );
1562
+ }
1563
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { width: size, height: size, items: "center", justify: "center", rounded: radius, bg: "$color12", children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: glyph, color: "$color1" }) });
1564
+ }
1565
+ var KNOWN = {
1566
+ openrouter: lucideIcons2.Globe,
1567
+ nvidia: lucideIcons2.Cpu
1568
+ };
1569
+ var isFirstParty = (provider) => {
1570
+ const p = provider.trim().toLowerCase();
1571
+ return p === "hanzo" || p === "zen";
1572
+ };
1573
+ function EnsoMark({ size, color }) {
1574
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 100 100", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M66.22 83.26 A37 37 0 1 1 85.57 60.20", fill: "none", stroke: color, strokeWidth: 11, strokeLinecap: "round" }) });
1575
+ }
1576
+ var HANZO_PATHS = [
1577
+ "M22.21 67V44.6369H0V67H22.21Z",
1578
+ "M66.7038 22.3184H22.2534L0.0878906 44.6367H44.4634L66.7038 22.3184Z",
1579
+ "M22.21 0H0V22.3184H22.21V0Z",
1580
+ "M66.7198 0H44.5098V22.3184H66.7198V0Z",
1581
+ "M66.7198 67V44.6369H44.5098V67H66.7198Z"
1582
+ ];
1583
+ function HanzoHMark({ size, color }) {
1584
+ return /* @__PURE__ */ jsxRuntime.jsx("svg", { width: size, height: size, viewBox: "0 0 67 67", "aria-hidden": "true", children: HANZO_PATHS.map((d) => /* @__PURE__ */ jsxRuntime.jsx("path", { d, fill: color }, d)) });
1585
+ }
1586
+ function providerInitials(provider) {
1587
+ const name = provider.trim();
1588
+ if (!name) return "\u2022";
1589
+ const words = name.split(/[\s/_-]+/).filter(Boolean);
1590
+ if (words.length >= 2) return (words[0][0] + words[1][0]).toUpperCase();
1591
+ return name.slice(0, 2).toUpperCase();
1592
+ }
1593
+ function ProviderLogo({ provider, size = 24 }) {
1594
+ const theme = gui.useTheme();
1595
+ const radius = Math.round(size * 0.28);
1596
+ const iconSize = Math.round(size * 0.56);
1597
+ if (isFirstParty(provider)) {
1598
+ const fg = theme.color1?.get() ?? "#000000";
1599
+ const markSize = Math.round(size * 0.66);
1600
+ const isZen = provider.trim().toLowerCase() === "zen";
1601
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { width: size, height: size, items: "center", justify: "center", rounded: radius, bg: "$color12", children: isZen ? /* @__PURE__ */ jsxRuntime.jsx(EnsoMark, { size: markSize, color: fg }) : /* @__PURE__ */ jsxRuntime.jsx(HanzoHMark, { size: Math.round(size * 0.56), color: fg }) });
1602
+ }
1603
+ const Known = KNOWN[provider.trim().toLowerCase()];
1604
+ if (Known) {
1605
+ return /* @__PURE__ */ jsxRuntime.jsx(
1606
+ gui.XStack,
1607
+ {
1608
+ width: size,
1609
+ height: size,
1610
+ items: "center",
1611
+ justify: "center",
1612
+ rounded: radius,
1613
+ bg: "$color3",
1614
+ borderWidth: 1,
1615
+ borderColor: "$borderColor",
1616
+ children: /* @__PURE__ */ jsxRuntime.jsx(Known, { size: iconSize, color: "$color11" })
1617
+ }
1618
+ );
1619
+ }
1620
+ return /* @__PURE__ */ jsxRuntime.jsx(
1621
+ gui.XStack,
1622
+ {
1623
+ width: size,
1624
+ height: size,
1625
+ items: "center",
1626
+ justify: "center",
1627
+ rounded: radius,
1628
+ bg: "$color3",
1629
+ borderWidth: 1,
1630
+ borderColor: "$borderColor",
1631
+ children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: Math.round(size * 0.4), fontWeight: "800", color: "$color11", children: providerInitials(provider) })
1632
+ }
1633
+ );
1634
+ }
1635
+ function GenericLogo({ size = 24 }) {
1636
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.XStack, { width: size, height: size, items: "center", justify: "center", rounded: Math.round(size * 0.28), bg: "$color3", borderWidth: 1, borderColor: "$borderColor", children: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.Server, { size: Math.round(size * 0.56), color: "$color11" }) });
1637
+ }
1638
+ function targetIndex(from, dy, rowH, count) {
1639
+ if (rowH <= 0 || count <= 0) return from;
1640
+ const raw = from + Math.round(dy / rowH);
1641
+ return Math.max(0, Math.min(raw, count - 1));
1642
+ }
1643
+ function rowShift(i, from, to, dy, rowH) {
1644
+ if (i === from) return dy;
1645
+ if (from < to && i > from && i <= to) return -rowH;
1646
+ if (from > to && i < from && i >= to) return rowH;
1647
+ return 0;
1648
+ }
1649
+ function Reorder({
1650
+ items,
1651
+ keyOf,
1652
+ rowHeight = 44,
1653
+ onReorder,
1654
+ renderItem
1655
+ }) {
1656
+ const [drag, setDrag] = react.useState(null);
1657
+ const startRef = react.useRef(null);
1658
+ const to = drag ? targetIndex(drag.from, drag.dy, rowHeight, items.length) : -1;
1659
+ const begin = react.useCallback(
1660
+ (index) => (e) => {
1661
+ const startY = e.clientY ?? e.nativeEvent?.clientY ?? 0;
1662
+ startRef.current = { from: index, startY };
1663
+ setDrag({ from: index, dy: 0 });
1664
+ const move = (ev) => {
1665
+ if (!startRef.current) return;
1666
+ setDrag({ from: startRef.current.from, dy: ev.clientY - startRef.current.startY });
1667
+ };
1668
+ const end = () => {
1669
+ const s = startRef.current;
1670
+ window.removeEventListener("pointermove", move);
1671
+ window.removeEventListener("pointerup", end);
1672
+ window.removeEventListener("pointercancel", end);
1673
+ startRef.current = null;
1674
+ setDrag((d) => {
1675
+ if (s && d) {
1676
+ const t = targetIndex(s.from, d.dy, rowHeight, items.length);
1677
+ if (t !== s.from) onReorder(s.from, t);
1678
+ }
1679
+ return null;
1680
+ });
1681
+ };
1682
+ window.addEventListener("pointermove", move);
1683
+ window.addEventListener("pointerup", end);
1684
+ window.addEventListener("pointercancel", end);
1685
+ },
1686
+ [items.length, rowHeight, onReorder]
1687
+ );
1688
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { children: items.map((item, i) => {
1689
+ const dragging = drag?.from === i;
1690
+ const shift = drag && to >= 0 ? rowShift(i, drag.from, to, drag.dy, rowHeight) : 0;
1691
+ return /* @__PURE__ */ jsxRuntime.jsx(
1692
+ gui.YStack,
1693
+ {
1694
+ height: rowHeight,
1695
+ justify: "center",
1696
+ className: "hz-drag-item",
1697
+ style: {
1698
+ transform: `translateY(${shift}px)`,
1699
+ zIndex: dragging ? 2 : 1,
1700
+ ...dragging ? { transition: "none", boxShadow: "0 8px 24px rgba(0,0,0,0.28)" } : null
1701
+ },
1702
+ children: renderItem(item, { onPointerDown: begin(i) }, dragging)
1703
+ },
1704
+ keyOf(item)
1705
+ );
1706
+ }) });
1707
+ }
1708
+ function SelectMenu({
1709
+ options,
1710
+ value,
1711
+ onChange,
1712
+ allLabel = "All",
1713
+ icon,
1714
+ minWidth = 130
1715
+ }) {
1716
+ const active = value === null ? null : options.find((o) => o.key === value) ?? null;
1717
+ const triggerLabel = active ? active.label : allLabel;
1718
+ const items = [
1719
+ { key: "__all__", label: allLabel, selected: value === null, onSelect: () => onChange(null) },
1720
+ ...options.map((o) => ({ key: o.key, label: o.label, selected: value === o.key, onSelect: () => onChange(o.key) }))
1721
+ ];
1722
+ return /* @__PURE__ */ jsxRuntime.jsx(
1723
+ DropdownMenu,
1724
+ {
1725
+ minWidth: Math.max(minWidth, 160),
1726
+ trigger: /* @__PURE__ */ jsxRuntime.jsx(
1727
+ gui.Button,
1728
+ {
1729
+ size: "$2",
1730
+ minW: minWidth,
1731
+ justify: "space-between",
1732
+ borderWidth: 1,
1733
+ borderColor: "$borderColor",
1734
+ bg: value !== null ? "$color5" : "transparent",
1735
+ icon,
1736
+ iconAfter: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.ChevronDown, { size: 14, opacity: 0.6 }),
1737
+ children: /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color12", numberOfLines: 1, flex: 1, children: triggerLabel })
1738
+ }
1739
+ ),
1740
+ items
1741
+ }
1742
+ );
1743
+ }
1744
+ var LG = 1024;
1745
+ var lockCount = 0;
1746
+ var savedOverflow = "";
1747
+ function lockScroll() {
1748
+ if (typeof document === "undefined") return;
1749
+ if (lockCount === 0) {
1750
+ savedOverflow = document.body.style.overflow;
1751
+ document.body.style.overflow = "hidden";
1752
+ }
1753
+ lockCount++;
1754
+ }
1755
+ function unlockScroll() {
1756
+ if (typeof document === "undefined") return;
1757
+ lockCount = Math.max(0, lockCount - 1);
1758
+ if (lockCount === 0) document.body.style.overflow = savedOverflow;
1759
+ }
1760
+ function SlideOver({
1761
+ open,
1762
+ onClose,
1763
+ side = "right",
1764
+ size = 420,
1765
+ title,
1766
+ icon: Icon,
1767
+ iconColor,
1768
+ headerRight,
1769
+ ariaLabel,
1770
+ zIndex = 1e3,
1771
+ children
1772
+ }) {
1773
+ const panelRef = react.useRef(null);
1774
+ const openerRef = react.useRef(null);
1775
+ react.useEffect(() => {
1776
+ if (!open) return;
1777
+ openerRef.current = typeof document !== "undefined" ? document.activeElement : null;
1778
+ lockScroll();
1779
+ const t = window.setTimeout(() => {
1780
+ const el = panelRef.current;
1781
+ if (el && typeof el.focus === "function") el.focus();
1782
+ }, 0);
1783
+ return () => {
1784
+ window.clearTimeout(t);
1785
+ unlockScroll();
1786
+ const opener = openerRef.current;
1787
+ if (opener && opener instanceof HTMLElement && typeof opener.focus === "function") opener.focus();
1788
+ };
1789
+ }, [open]);
1790
+ react.useEffect(() => {
1791
+ if (!open) return;
1792
+ const onKey = (e) => {
1793
+ if (e.key === "Escape") {
1794
+ e.stopPropagation();
1795
+ onClose();
1796
+ }
1797
+ };
1798
+ window.addEventListener("keydown", onKey);
1799
+ return () => window.removeEventListener("keydown", onKey);
1800
+ }, [open, onClose]);
1801
+ const offscreen = side === "right" ? "translateX(100%)" : "translateX(-100%)";
1802
+ const edge = side === "right" ? { r: 0 } : { l: 0 };
1803
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1804
+ gui.YStack,
1805
+ {
1806
+ overflow: "hidden",
1807
+ pointerEvents: open ? "auto" : "none",
1808
+ "aria-hidden": !open,
1809
+ style: { position: "fixed", inset: 0, zIndex },
1810
+ children: [
1811
+ /* @__PURE__ */ jsxRuntime.jsx(
1812
+ gui.YStack,
1813
+ {
1814
+ position: "absolute",
1815
+ t: 0,
1816
+ l: 0,
1817
+ r: 0,
1818
+ b: 0,
1819
+ bg: "rgba(0,0,0,0.55)",
1820
+ className: "hz-fade",
1821
+ style: { opacity: open ? 1 : 0 },
1822
+ onPress: onClose
1823
+ }
1824
+ ),
1825
+ /* @__PURE__ */ jsxRuntime.jsx(
1826
+ gui.YStack,
1827
+ {
1828
+ ref: panelRef,
1829
+ tabIndex: -1,
1830
+ role: "dialog",
1831
+ "aria-modal": open ? true : void 0,
1832
+ "aria-label": typeof title === "string" ? title : ariaLabel,
1833
+ position: "absolute",
1834
+ t: 0,
1835
+ b: 0,
1836
+ ...edge,
1837
+ width: "100%",
1838
+ $lg: { width: size, maxW: "100vw" },
1839
+ bg: "$color1",
1840
+ borderLeftWidth: side === "right" ? 1 : 0,
1841
+ borderRightWidth: side === "left" ? 1 : 0,
1842
+ borderColor: "$borderColor",
1843
+ className: "hz-slide",
1844
+ style: { transform: open ? "translateX(0)" : offscreen, height: "100dvh" },
1845
+ children: title !== void 0 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1846
+ /* @__PURE__ */ jsxRuntime.jsxs(
1847
+ gui.XStack,
1848
+ {
1849
+ items: "center",
1850
+ gap: "$2.5",
1851
+ px: "$4",
1852
+ height: 56,
1853
+ borderBottomWidth: 1,
1854
+ borderColor: "$borderColor",
1855
+ children: [
1856
+ Icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 18, color: iconColor ? asColor(iconColor) : void 0 }) : null,
1857
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { flex: 1, fontSize: "$5", fontWeight: "700", color: "$color12", numberOfLines: 1, children: title }),
1858
+ headerRight,
1859
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Button, { size: "$2", chromeless: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.X, { size: 18 }), onPress: onClose, "aria-label": "Close" })
1860
+ ]
1861
+ }
1862
+ ),
1863
+ /* @__PURE__ */ jsxRuntime.jsx(gui.ScrollView, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { flex: 1, p: "$4", gap: "$3", children }) })
1864
+ ] }) : (
1865
+ // Bare mode — the caller owns the full panel layout (e.g. the nav drawer
1866
+ // renders its own header + scroll + footer).
1867
+ children
1868
+ )
1869
+ }
1870
+ )
1871
+ ]
1872
+ }
1873
+ );
1874
+ }
1875
+ var toneOf = (status) => {
1876
+ const s = status.toLowerCase();
1877
+ if (s === "green") return "green";
1878
+ if (s === "yellow") return "yellow";
1879
+ if (s === "red") return "red";
1880
+ if (["ready", "active", "running", "available", "ok"].includes(s)) return "green";
1881
+ if (["creating", "provisioning", "pending", "updating", "attaching"].includes(s)) return "yellow";
1882
+ if (["error", "failed", "degraded", "down"].includes(s)) return "red";
1883
+ return "neutral";
1884
+ };
1885
+ var TONE_BG = {
1886
+ green: "$color5",
1887
+ yellow: "$color4",
1888
+ red: "$color4",
1889
+ neutral: "$color3"
1890
+ };
1891
+ var TONE_FG = {
1892
+ green: "$color12",
1893
+ yellow: "$color12",
1894
+ red: "$color12",
1895
+ neutral: "$color11"
1896
+ };
1897
+ function StatusTag({ status }) {
1898
+ const tone2 = toneOf(status ?? "");
1899
+ return /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$1", px: "$2", py: "$1", rounded: "$2", bg: TONE_BG[tone2], color: TONE_FG[tone2], children: status || "unknown" });
1900
+ }
1901
+ var ToastContext = react.createContext(null);
1902
+ var ACCENT3 = {
1903
+ success: "$green10",
1904
+ error: "$red10",
1905
+ info: "$color11"
1906
+ };
1907
+ var ICON = {
1908
+ success: lucideIcons2.CircleCheck,
1909
+ error: lucideIcons2.CircleX,
1910
+ info: lucideIcons2.Info
1911
+ };
1912
+ function ToastCard({ t, onClose }) {
1913
+ const Icon = ICON[t.kind];
1914
+ const accent = ACCENT3[t.kind];
1915
+ return /* @__PURE__ */ jsxRuntime.jsx(
1916
+ gui.Card,
1917
+ {
1918
+ width: 360,
1919
+ maxWidth: "90%",
1920
+ p: "$3",
1921
+ gap: "$2",
1922
+ bg: "$color2",
1923
+ borderWidth: 1,
1924
+ borderColor: "$borderColor",
1925
+ borderLeftWidth: 3,
1926
+ borderLeftColor: accent,
1927
+ rounded: "$4",
1928
+ elevation: "$2",
1929
+ children: /* @__PURE__ */ jsxRuntime.jsxs(gui.XStack, { gap: "$2.5", items: "flex-start", children: [
1930
+ /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { pt: 1, children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 18, color: accent }) }),
1931
+ /* @__PURE__ */ jsxRuntime.jsxs(gui.YStack, { flex: 1, gap: "$1", children: [
1932
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$3", fontWeight: "700", color: "$color12", children: t.title }),
1933
+ t.description ? /* @__PURE__ */ jsxRuntime.jsx(gui.Text, { fontSize: "$2", color: "$color11", children: t.description }) : null
1934
+ ] }),
1935
+ /* @__PURE__ */ jsxRuntime.jsx(gui.Button, { size: "$1", chromeless: true, icon: /* @__PURE__ */ jsxRuntime.jsx(lucideIcons2.X, { size: 14 }), onPress: onClose, "aria-label": "Dismiss" })
1936
+ ] })
1937
+ }
1938
+ );
1939
+ }
1940
+ function ToastViewport({ toasts, dismiss }) {
1941
+ const [mounted, setMounted] = react.useState(false);
1942
+ react.useEffect(() => setMounted(true), []);
1943
+ if (!mounted || typeof document === "undefined") return null;
1944
+ return reactDom.createPortal(
1945
+ /* @__PURE__ */ jsxRuntime.jsx("div", { style: { position: "fixed", top: 16, right: 16, zIndex: 1e5, pointerEvents: "none" }, children: /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { gap: "$2", items: "flex-end", children: toasts.map((t) => /* @__PURE__ */ jsxRuntime.jsx(gui.YStack, { pointerEvents: "auto", children: /* @__PURE__ */ jsxRuntime.jsx(ToastCard, { t, onClose: () => dismiss(t.id) }) }, t.id)) }) }),
1946
+ document.body
1947
+ );
1948
+ }
1949
+ function ToastProvider({ children }) {
1950
+ const [toasts, setToasts] = react.useState([]);
1951
+ const timers = react.useRef(/* @__PURE__ */ new Map());
1952
+ const seq = react.useRef(0);
1953
+ const dismiss = react.useCallback((id) => {
1954
+ setToasts((ts) => ts.filter((t) => t.id !== id));
1955
+ const timer = timers.current.get(id);
1956
+ if (timer) {
1957
+ clearTimeout(timer);
1958
+ timers.current.delete(id);
1959
+ }
1960
+ }, []);
1961
+ const toast = react.useCallback(
1962
+ (input) => {
1963
+ const id = ++seq.current;
1964
+ const kind = input.kind ?? "info";
1965
+ const durationMs = input.durationMs ?? (kind === "error" ? 6e3 : 3500);
1966
+ setToasts((ts) => [...ts, { id, kind, title: input.title, description: input.description, durationMs }]);
1967
+ if (durationMs > 0) {
1968
+ timers.current.set(
1969
+ id,
1970
+ setTimeout(() => dismiss(id), durationMs)
1971
+ );
1972
+ }
1973
+ },
1974
+ [dismiss]
1975
+ );
1976
+ react.useEffect(() => {
1977
+ const map = timers.current;
1978
+ return () => map.forEach((t) => clearTimeout(t));
1979
+ }, []);
1980
+ const api = {
1981
+ toast,
1982
+ success: (title, description) => toast({ title, description, kind: "success" }),
1983
+ error: (title, description) => toast({ title, description, kind: "error" }),
1984
+ info: (title, description) => toast({ title, description, kind: "info" }),
1985
+ dismiss
1986
+ };
1987
+ return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value: api, children: [
1988
+ children,
1989
+ /* @__PURE__ */ jsxRuntime.jsx(ToastViewport, { toasts, dismiss })
1990
+ ] });
1991
+ }
1992
+ function useToast() {
1993
+ const ctx = react.useContext(ToastContext);
1994
+ if (!ctx) throw new Error("useToast must be used within <ToastProvider>");
1995
+ return ctx;
1996
+ }
1997
+
1998
+ Object.defineProperty(exports, "Boxes", {
1999
+ enumerable: true,
2000
+ get: function () { return lucideIcons2.Boxes; }
2001
+ });
2002
+ exports.AppHeader = AppHeader;
2003
+ exports.BarChart = BarChart;
2004
+ exports.BarRows = BarRows;
2005
+ exports.BrandMark = BrandMark;
2006
+ exports.CHART_OTHER = CHART_OTHER;
2007
+ exports.CHART_PALETTE = CHART_PALETTE;
2008
+ exports.ComboBox = ComboBox;
2009
+ exports.ContextMenu = ContextMenu;
2010
+ exports.DataTable = DataTable;
2011
+ exports.Donut = Donut;
2012
+ exports.Donut2 = Donut2;
2013
+ exports.DropdownMenu = DropdownMenu;
2014
+ exports.EmptyState = EmptyState;
2015
+ exports.FadeIn = FadeIn;
2016
+ exports.FieldRow = FieldRow;
2017
+ exports.FieldSelect = FieldSelect;
2018
+ exports.FieldSlider = FieldSlider;
2019
+ exports.FieldSwitch = FieldSwitch;
2020
+ exports.FieldText = FieldText;
2021
+ exports.FieldTextArea = FieldTextArea;
2022
+ exports.FloatingMenu = FloatingMenu;
2023
+ exports.GenericLogo = GenericLogo;
2024
+ exports.HanzoMark = HanzoMark;
2025
+ exports.HintButton = HintButton;
2026
+ exports.LG = LG;
2027
+ exports.LegendDot = LegendDot;
2028
+ exports.LineChart = LineChart;
2029
+ exports.MenuItemView = MenuItemView;
2030
+ exports.MenuLabelView = MenuLabelView;
2031
+ exports.MenuPanel = MenuPanel;
2032
+ exports.MenuSeparatorView = MenuSeparatorView;
2033
+ exports.MetricCard = MetricCard;
2034
+ exports.MiniBars = MiniBars;
2035
+ exports.OrgSwitcher = OrgSwitcher;
2036
+ exports.PageHeader = PageHeader;
2037
+ exports.Panel = Panel;
2038
+ exports.PortalTheme = PortalTheme;
2039
+ exports.PrimaryButton = PrimaryButton;
2040
+ exports.ProductIcon = ProductIcon;
2041
+ exports.ProviderLogo = ProviderLogo;
2042
+ exports.Reorder = Reorder;
2043
+ exports.SERIES = SERIES;
2044
+ exports.SURFACES = SURFACES;
2045
+ exports.SelectMenu = SelectMenu;
2046
+ exports.SlideOver = SlideOver;
2047
+ exports.Sparkline = Sparkline;
2048
+ exports.Sparkline2 = Sparkline2;
2049
+ exports.StatusTag = StatusTag;
2050
+ exports.ToastProvider = ToastProvider;
2051
+ exports.UtilBar = UtilBar;
2052
+ exports.asColor = asColor;
2053
+ exports.colorForIndex = colorForIndex;
2054
+ exports.filterOptions = filterOptions;
2055
+ exports.filterOrgs = filterOrgs;
2056
+ exports.isKnownOption = isKnownOption;
2057
+ exports.orgScope = orgScope;
2058
+ exports.otherSurfaces = otherSurfaces;
2059
+ exports.providerInitials = providerInitials;
2060
+ exports.renderMenuItems = renderMenuItems;
2061
+ exports.rowShift = rowShift;
2062
+ exports.targetIndex = targetIndex;
2063
+ exports.useToast = useToast;
2064
+ exports.utilColor = utilColor;
2065
+ //# sourceMappingURL=chunk-HSPMQQVJ.cjs.map
2066
+ //# sourceMappingURL=chunk-HSPMQQVJ.cjs.map