@glasshome/widget-sdk 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +79 -0
- package/dist/create-entity.d.ts +22 -0
- package/dist/define-widget.d.ts +10 -0
- package/dist/framework/backgrounds/Glow.d.ts +24 -0
- package/dist/framework/backgrounds/WidgetSliderFill.d.ts +33 -0
- package/dist/framework/components/WidgetContent.d.ts +29 -0
- package/dist/framework/components/WidgetEmptyState.d.ts +34 -0
- package/dist/framework/components/WidgetIcon.d.ts +48 -0
- package/dist/framework/components/WidgetMetrics.d.ts +47 -0
- package/dist/framework/components/WidgetStatus.d.ts +26 -0
- package/dist/framework/components/WidgetSubtitle.d.ts +28 -0
- package/dist/framework/components/WidgetTitle.d.ts +29 -0
- package/dist/framework/components/WidgetValue.d.ts +31 -0
- package/dist/framework/core/Widget.d.ts +88 -0
- package/dist/framework/design-system/index.d.ts +8 -0
- package/dist/framework/design-system/spacing.d.ts +40 -0
- package/dist/framework/design-system/typography.d.ts +40 -0
- package/dist/framework/design-system/z-index.d.ts +23 -0
- package/dist/framework/dialogs/WidgetDialog.d.ts +47 -0
- package/dist/framework/dialogs/index.d.ts +4 -0
- package/dist/framework/gestures/cursors.d.ts +17 -0
- package/dist/framework/gestures/use-widget-gestures.d.ts +53 -0
- package/dist/framework/hooks/index.d.ts +15 -0
- package/dist/framework/hooks/use-debug-data.d.ts +46 -0
- package/dist/framework/hooks/use-widget-config.d.ts +48 -0
- package/dist/framework/hooks/use-widget-context.d.ts +46 -0
- package/dist/framework/hooks/use-widget-dialog.d.ts +45 -0
- package/dist/framework/hooks/use-widget-entity-group.d.ts +67 -0
- package/dist/framework/hooks/use-widget-entity.d.ts +53 -0
- package/dist/framework/hooks/use-widget-form.d.ts +79 -0
- package/dist/framework/hooks/use-widget-responsive.d.ts +41 -0
- package/dist/framework/index.d.ts +55 -0
- package/dist/framework/layout/WidgetStack.d.ts +28 -0
- package/dist/framework/theming/adaptive-color.d.ts +28 -0
- package/dist/framework/theming/colors.d.ts +59 -0
- package/dist/framework/theming/index.d.ts +8 -0
- package/dist/framework/types.d.ts +335 -0
- package/dist/framework/utils/cn.d.ts +28 -0
- package/dist/framework/utils/empty-state.d.ts +49 -0
- package/dist/framework/utils/entity-aggregation.d.ts +73 -0
- package/dist/framework/utils/entity-state.d.ts +103 -0
- package/dist/framework/utils/format-value.d.ts +22 -0
- package/dist/framework/utils/index.d.ts +12 -0
- package/dist/framework/utils/interpret-value.d.ts +17 -0
- package/dist/framework/variants/built-in-variants.d.ts +39 -0
- package/dist/framework/variants/index.d.ts +7 -0
- package/dist/framework/variants/variant-utils.d.ts +105 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +1955 -0
- package/dist/theme.d.ts +21 -0
- package/dist/types.d.ts +51 -0
- package/dist/version.d.ts +5 -0
- package/dist/vite/index.d.ts +56 -0
- package/dist/vite/index.js +184 -0
- package/package.json +76 -0
- package/preview/host.tsx +89 -0
- package/preview/preview.html +49 -0
- package/tailwind-sources.css +1 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,1955 @@
|
|
|
1
|
+
import { createSignal as U, createContext as yt, useContext as mt, createEffect as wt, untrack as lt, createMemo as z, splitProps as $t, Show as X } from "solid-js";
|
|
2
|
+
import { memo as D, effect as C, setStyleProperty as p, className as k, template as h, insert as f, style as Q, createComponent as O, use as kt, delegateEvents as pt } from "solid-js/web";
|
|
3
|
+
import { clsx as St } from "clsx";
|
|
4
|
+
import { twMerge as Ct } from "tailwind-merge";
|
|
5
|
+
import { createElementSize as Mt } from "@solid-primitives/resize-observer";
|
|
6
|
+
import { createForm as zt, zodForm as Dt, reset as _t, setValue as At, getValue as Nt } from "@modular-forms/solid";
|
|
7
|
+
function xn(t) {
|
|
8
|
+
const [e] = U(t);
|
|
9
|
+
return e;
|
|
10
|
+
}
|
|
11
|
+
function vn(t) {
|
|
12
|
+
return t;
|
|
13
|
+
}
|
|
14
|
+
const j = {
|
|
15
|
+
/** Background layer (gradients, images, glows) */
|
|
16
|
+
BACKGROUND: 0,
|
|
17
|
+
/** Main content layer (icon, title, text) */
|
|
18
|
+
CONTENT: 10,
|
|
19
|
+
/** Overlay layer (loading states, volume indicators) */
|
|
20
|
+
OVERLAY: 20,
|
|
21
|
+
/** Action layer (buttons, edit controls) */
|
|
22
|
+
ACTIONS: 30
|
|
23
|
+
}, it = yt();
|
|
24
|
+
function R() {
|
|
25
|
+
const t = mt(it);
|
|
26
|
+
if (!t)
|
|
27
|
+
throw new Error("useWidgetContext must be used within a Widget component");
|
|
28
|
+
return t;
|
|
29
|
+
}
|
|
30
|
+
function w(...t) {
|
|
31
|
+
return Ct(St(t));
|
|
32
|
+
}
|
|
33
|
+
const Tt = {
|
|
34
|
+
id: "classic-glass",
|
|
35
|
+
name: "Classic Glass",
|
|
36
|
+
description: "Default glassmorphism design with blur background and gradient",
|
|
37
|
+
styles: {
|
|
38
|
+
cssVars: {
|
|
39
|
+
"--widget-bg": "rgba(255, 255, 255, 0.1)",
|
|
40
|
+
"--widget-border": "rgba(255, 255, 255, 0.2)",
|
|
41
|
+
"--widget-blur": "12px",
|
|
42
|
+
"--widget-shadow": "0 8px 32px rgba(0, 0, 0, 0.2)",
|
|
43
|
+
"--widget-padding": "1.5rem"
|
|
44
|
+
},
|
|
45
|
+
class: "backdrop-blur-xl"
|
|
46
|
+
},
|
|
47
|
+
layout: {
|
|
48
|
+
type: "flex",
|
|
49
|
+
direction: "column",
|
|
50
|
+
align: "start",
|
|
51
|
+
justify: "start",
|
|
52
|
+
gap: "0.75rem"
|
|
53
|
+
},
|
|
54
|
+
interactions: {
|
|
55
|
+
hover: !0,
|
|
56
|
+
active: !0,
|
|
57
|
+
focus: !0,
|
|
58
|
+
hoverScale: 1.02,
|
|
59
|
+
activeScale: 0.98
|
|
60
|
+
}
|
|
61
|
+
}, Et = {
|
|
62
|
+
id: "minimal",
|
|
63
|
+
name: "Minimal",
|
|
64
|
+
description: "Clean, minimal design with no background effects",
|
|
65
|
+
styles: {
|
|
66
|
+
cssVars: {
|
|
67
|
+
"--widget-bg": "transparent",
|
|
68
|
+
"--widget-border": "rgba(255, 255, 255, 0.1)",
|
|
69
|
+
"--widget-padding": "1rem"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
layout: {
|
|
73
|
+
type: "flex",
|
|
74
|
+
direction: "column",
|
|
75
|
+
align: "start",
|
|
76
|
+
justify: "start",
|
|
77
|
+
gap: "0.5rem"
|
|
78
|
+
},
|
|
79
|
+
elements: {
|
|
80
|
+
visible: {
|
|
81
|
+
background: !1,
|
|
82
|
+
decorations: !1
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
interactions: {
|
|
86
|
+
hover: !1,
|
|
87
|
+
active: !1,
|
|
88
|
+
focus: !0
|
|
89
|
+
}
|
|
90
|
+
}, Ot = {
|
|
91
|
+
id: "compact-horizontal",
|
|
92
|
+
name: "Compact Horizontal",
|
|
93
|
+
description: "Horizontal layout for compact widgets",
|
|
94
|
+
styles: {
|
|
95
|
+
cssVars: {
|
|
96
|
+
"--widget-bg": "rgba(255, 255, 255, 0.08)",
|
|
97
|
+
"--widget-border": "rgba(255, 255, 255, 0.15)",
|
|
98
|
+
"--widget-blur": "10px",
|
|
99
|
+
"--widget-padding": "1rem",
|
|
100
|
+
"--widget-icon-size": "2.5rem"
|
|
101
|
+
},
|
|
102
|
+
class: "backdrop-blur-lg"
|
|
103
|
+
},
|
|
104
|
+
layout: {
|
|
105
|
+
type: "flex",
|
|
106
|
+
direction: "row",
|
|
107
|
+
align: "center",
|
|
108
|
+
justify: "start",
|
|
109
|
+
gap: "1rem"
|
|
110
|
+
},
|
|
111
|
+
interactions: {
|
|
112
|
+
hover: !0,
|
|
113
|
+
active: !0,
|
|
114
|
+
focus: !0,
|
|
115
|
+
hoverScale: 1.02,
|
|
116
|
+
activeScale: 0.98
|
|
117
|
+
}
|
|
118
|
+
}, at = {
|
|
119
|
+
"classic-glass": Tt,
|
|
120
|
+
minimal: Et,
|
|
121
|
+
"compact-horizontal": Ot
|
|
122
|
+
};
|
|
123
|
+
function Vt(t) {
|
|
124
|
+
return at[t];
|
|
125
|
+
}
|
|
126
|
+
function bn(t) {
|
|
127
|
+
return t in at;
|
|
128
|
+
}
|
|
129
|
+
function yn() {
|
|
130
|
+
return Object.keys(at);
|
|
131
|
+
}
|
|
132
|
+
function ft(t, e) {
|
|
133
|
+
if (typeof t != "object" || t === null)
|
|
134
|
+
return e;
|
|
135
|
+
const n = { ...t };
|
|
136
|
+
for (const i in e) {
|
|
137
|
+
const r = e[i], a = t[i];
|
|
138
|
+
if (r !== void 0) {
|
|
139
|
+
if (Array.isArray(r)) {
|
|
140
|
+
n[i] = r;
|
|
141
|
+
continue;
|
|
142
|
+
}
|
|
143
|
+
if (typeof r == "object" && r !== null && !Array.isArray(r)) {
|
|
144
|
+
typeof a == "object" && a !== null ? n[i] = ft(a, r) : n[i] = r;
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
n[i] = r;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return n;
|
|
151
|
+
}
|
|
152
|
+
function Wt(t, e) {
|
|
153
|
+
if (!(!t && !e))
|
|
154
|
+
return t ? e ? {
|
|
155
|
+
container: { ...t.container, ...e.container },
|
|
156
|
+
class: e.class ?? t.class,
|
|
157
|
+
cssVars: { ...t.cssVars, ...e.cssVars }
|
|
158
|
+
} : t : e;
|
|
159
|
+
}
|
|
160
|
+
function It(t, e) {
|
|
161
|
+
return e ?? t;
|
|
162
|
+
}
|
|
163
|
+
function Rt(t, e) {
|
|
164
|
+
if (!(!t && !e))
|
|
165
|
+
return t ? e ? {
|
|
166
|
+
visible: { ...t.visible, ...e.visible },
|
|
167
|
+
styles: ft(t.styles ?? {}, e.styles ?? {}),
|
|
168
|
+
classNames: { ...t.classNames, ...e.classNames }
|
|
169
|
+
} : t : e;
|
|
170
|
+
}
|
|
171
|
+
function Gt(t, e) {
|
|
172
|
+
if (!(!t && !e))
|
|
173
|
+
return t ? e ? {
|
|
174
|
+
background: e.background ?? t.background,
|
|
175
|
+
overlay: e.overlay ?? t.overlay,
|
|
176
|
+
decorations: e.decorations ?? t.decorations
|
|
177
|
+
} : t : e;
|
|
178
|
+
}
|
|
179
|
+
function Ht(t, e) {
|
|
180
|
+
if (!(!t && !e))
|
|
181
|
+
return t ? e ? {
|
|
182
|
+
hover: e.hover ?? t.hover,
|
|
183
|
+
active: e.active ?? t.active,
|
|
184
|
+
focus: e.focus ?? t.focus,
|
|
185
|
+
hoverScale: e.hoverScale ?? t.hoverScale,
|
|
186
|
+
activeScale: e.activeScale ?? t.activeScale
|
|
187
|
+
} : t : e;
|
|
188
|
+
}
|
|
189
|
+
function st(t, e) {
|
|
190
|
+
return {
|
|
191
|
+
id: e.id ?? t.id,
|
|
192
|
+
name: e.name ?? t.name,
|
|
193
|
+
description: e.description ?? t.description,
|
|
194
|
+
styles: Wt(t.styles, e.styles),
|
|
195
|
+
layout: It(t.layout, e.layout),
|
|
196
|
+
elements: Rt(t.elements, e.elements),
|
|
197
|
+
plugins: Gt(t.plugins, e.plugins),
|
|
198
|
+
interactions: Ht(t.interactions, e.interactions),
|
|
199
|
+
extends: e.extends ?? t.extends
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function wn(t, e) {
|
|
203
|
+
return {
|
|
204
|
+
...e,
|
|
205
|
+
extends: t
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
function $n(...t) {
|
|
209
|
+
if (t.length === 0)
|
|
210
|
+
throw new Error("composeVariants requires at least one variant");
|
|
211
|
+
return t.length === 1 ? t[0] : t.reduce((e, n) => st(e, n));
|
|
212
|
+
}
|
|
213
|
+
function kn(t, e) {
|
|
214
|
+
return st(t, { layout: e });
|
|
215
|
+
}
|
|
216
|
+
function pn(t, e) {
|
|
217
|
+
return st(t, {
|
|
218
|
+
styles: { cssVars: e }
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
function Sn(t = "column", e = "start", n = "start", i) {
|
|
222
|
+
return {
|
|
223
|
+
type: "flex",
|
|
224
|
+
direction: t,
|
|
225
|
+
align: e,
|
|
226
|
+
justify: n,
|
|
227
|
+
...i
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
var Bt = /* @__PURE__ */ h("<div>"), Lt = /* @__PURE__ */ h('<div class="pointer-events-none absolute inset-0 opacity-40 blur-2xl">');
|
|
231
|
+
function jt(t) {
|
|
232
|
+
const e = R(), n = () => e.orientation() === "vertical" ? `inset(${100 - t.value}% 0 0 0)` : `inset(0 ${100 - t.value}% 0 0)`, i = () => t.color ?? "rgb(59, 130, 246)";
|
|
233
|
+
return [D(() => D(() => !!((t.glow ?? !1) && t.value > 0))() && (() => {
|
|
234
|
+
var r = Lt();
|
|
235
|
+
return C((a) => {
|
|
236
|
+
var s = i(), o = j.BACKGROUND;
|
|
237
|
+
return s !== a.e && p(r, "background", a.e = s), o !== a.t && p(r, "z-index", a.t = o), a;
|
|
238
|
+
}, {
|
|
239
|
+
e: void 0,
|
|
240
|
+
t: void 0
|
|
241
|
+
}), r;
|
|
242
|
+
})()), (() => {
|
|
243
|
+
var r = Bt();
|
|
244
|
+
return C((a) => {
|
|
245
|
+
var s = w("pointer-events-none absolute inset-0", t.isDragging ? "duration-0" : "transition-all duration-300 ease-out", t.class), o = i(), c = n(), g = t.opacity ?? 0.3, d = j.BACKGROUND;
|
|
246
|
+
return s !== a.e && k(r, a.e = s), o !== a.t && p(r, "background", a.t = o), c !== a.a && p(r, "clip-path", a.a = c), g !== a.o && p(r, "opacity", a.o = g), d !== a.i && p(r, "z-index", a.i = d), a;
|
|
247
|
+
}, {
|
|
248
|
+
e: void 0,
|
|
249
|
+
t: void 0,
|
|
250
|
+
a: void 0,
|
|
251
|
+
o: void 0,
|
|
252
|
+
i: void 0
|
|
253
|
+
}), r;
|
|
254
|
+
})()];
|
|
255
|
+
}
|
|
256
|
+
const K = {
|
|
257
|
+
S1: { xs: 4, sm: 4, md: 6, lg: 6, xl: 8 },
|
|
258
|
+
S2: { xs: 6, sm: 8, md: 10, lg: 12, xl: 14 },
|
|
259
|
+
S3: { xs: 8, sm: 10, md: 12, lg: 14, xl: 16 },
|
|
260
|
+
S4: { xs: 12, sm: 14, md: 16, lg: 18, xl: 20 }
|
|
261
|
+
}, N = {
|
|
262
|
+
/** Extra small spacing (4-8px) */
|
|
263
|
+
S1: (t) => `${K.S1[t]}px`,
|
|
264
|
+
/** Small spacing (6-14px) - default for most layouts */
|
|
265
|
+
S2: (t) => `${K.S2[t]}px`,
|
|
266
|
+
/** Medium spacing (8-16px) */
|
|
267
|
+
S3: (t) => `${K.S3[t]}px`,
|
|
268
|
+
/** Large spacing (12-20px) */
|
|
269
|
+
S4: (t) => `${K.S4[t]}px`,
|
|
270
|
+
/** Icon container size in pixels */
|
|
271
|
+
icon: (t) => ({
|
|
272
|
+
xs: 32,
|
|
273
|
+
// 1x1, 1x2 widgets
|
|
274
|
+
sm: 40,
|
|
275
|
+
// 2x1, 2x2 widgets (current WidgetIcon default)
|
|
276
|
+
md: 48,
|
|
277
|
+
// 2x3, 2x4 widgets
|
|
278
|
+
lg: 52,
|
|
279
|
+
// 2x6, 3x6, 4x2 widgets
|
|
280
|
+
xl: 56
|
|
281
|
+
// 4x4 widgets
|
|
282
|
+
})[t],
|
|
283
|
+
/** Icon stroke size for lucide icons */
|
|
284
|
+
iconSize: (t) => ({
|
|
285
|
+
xs: 18,
|
|
286
|
+
// Smaller stroke for tiny widgets
|
|
287
|
+
sm: 20,
|
|
288
|
+
// Current WidgetIcon default (size-5 = 20px)
|
|
289
|
+
md: 24,
|
|
290
|
+
// Medium widgets
|
|
291
|
+
lg: 26,
|
|
292
|
+
// Large widgets
|
|
293
|
+
xl: 28
|
|
294
|
+
// Extra large widgets
|
|
295
|
+
})[t],
|
|
296
|
+
/** Spacing between icon and title */
|
|
297
|
+
iconToTitle: (t) => ({
|
|
298
|
+
xs: "8px",
|
|
299
|
+
// Tight spacing for small widgets
|
|
300
|
+
sm: "10px",
|
|
301
|
+
// Slightly more room
|
|
302
|
+
md: "12px",
|
|
303
|
+
// Current pattern from LockWidget (@[300px]:mt-3 = 12px)
|
|
304
|
+
lg: "14px",
|
|
305
|
+
// More breathing room
|
|
306
|
+
xl: "16px"
|
|
307
|
+
// Maximum spacing (@[400px]:mt-4 = 16px)
|
|
308
|
+
})[t],
|
|
309
|
+
/** Container padding */
|
|
310
|
+
container: (t) => ({
|
|
311
|
+
xs: "8px",
|
|
312
|
+
// Minimal padding for tiny widgets
|
|
313
|
+
sm: "16px",
|
|
314
|
+
// Current BaseWidget default (p-4 = 16px)
|
|
315
|
+
md: "16px",
|
|
316
|
+
lg: "20px",
|
|
317
|
+
// More padding for larger widgets
|
|
318
|
+
xl: "20px"
|
|
319
|
+
})[t]
|
|
320
|
+
}, Pt = {
|
|
321
|
+
4: "gap-1",
|
|
322
|
+
6: "gap-1.5",
|
|
323
|
+
8: "gap-2",
|
|
324
|
+
10: "gap-2.5",
|
|
325
|
+
12: "gap-3",
|
|
326
|
+
14: "gap-3.5",
|
|
327
|
+
16: "gap-4",
|
|
328
|
+
18: "gap-[18px]",
|
|
329
|
+
20: "gap-5"
|
|
330
|
+
};
|
|
331
|
+
function Ut(t, e) {
|
|
332
|
+
const n = K[t][e];
|
|
333
|
+
return Pt[n] || `gap-[${n}px]`;
|
|
334
|
+
}
|
|
335
|
+
var Ft = /* @__PURE__ */ h("<div>");
|
|
336
|
+
function Yt(t) {
|
|
337
|
+
const e = R();
|
|
338
|
+
return (() => {
|
|
339
|
+
var n = Ft();
|
|
340
|
+
return f(n, () => t.children), C((i) => {
|
|
341
|
+
var r = w(
|
|
342
|
+
"relative flex h-full w-full overflow-hidden",
|
|
343
|
+
// Ensure controls (ml-auto divs) are above other content
|
|
344
|
+
"[&_div.ml-auto]:relative [&_div.ml-auto]:z-30",
|
|
345
|
+
e.contentLayout() === "horizontal" ? "flex-row items-center" : "flex-col justify-between",
|
|
346
|
+
Ut("S3", e.size()),
|
|
347
|
+
t.class
|
|
348
|
+
), a = N.container(e.size()), s = j.CONTENT;
|
|
349
|
+
return r !== i.e && k(n, i.e = r), a !== i.t && p(n, "padding", i.t = a), s !== i.a && p(n, "z-index", i.a = s), i;
|
|
350
|
+
}, {
|
|
351
|
+
e: void 0,
|
|
352
|
+
t: void 0,
|
|
353
|
+
a: void 0
|
|
354
|
+
}), n;
|
|
355
|
+
})();
|
|
356
|
+
}
|
|
357
|
+
const B = {
|
|
358
|
+
/** Container base text sizing */
|
|
359
|
+
container: (t) => ({
|
|
360
|
+
xs: "text-xs",
|
|
361
|
+
// Smallest widgets
|
|
362
|
+
sm: "text-sm",
|
|
363
|
+
// Small widgets
|
|
364
|
+
md: "text-base",
|
|
365
|
+
// Medium widgets
|
|
366
|
+
lg: "text-base",
|
|
367
|
+
// Large widgets
|
|
368
|
+
xl: "text-lg"
|
|
369
|
+
// Extra large widgets
|
|
370
|
+
})[t],
|
|
371
|
+
/** Title text sizing (main heading) */
|
|
372
|
+
title: (t) => ({
|
|
373
|
+
xs: "text-xs",
|
|
374
|
+
// 12px - Very compact
|
|
375
|
+
sm: "text-xs",
|
|
376
|
+
// 12px - Stay small
|
|
377
|
+
md: "text-sm",
|
|
378
|
+
// 14px - More readable (@[300px] equivalent)
|
|
379
|
+
lg: "text-sm",
|
|
380
|
+
// 14px - Maintain size
|
|
381
|
+
xl: "text-sm"
|
|
382
|
+
// 14px - Don't go too large for secondary text
|
|
383
|
+
})[t],
|
|
384
|
+
/** Subtitle/secondary text sizing */
|
|
385
|
+
subtitle: (t) => ({
|
|
386
|
+
xs: "text-xs",
|
|
387
|
+
// 12px - Very compact
|
|
388
|
+
sm: "text-sm",
|
|
389
|
+
// 12px - Stay small
|
|
390
|
+
md: "text-base",
|
|
391
|
+
// 14px - More readable (@[300px] equivalent)
|
|
392
|
+
lg: "text-base",
|
|
393
|
+
// 14px - Maintain size
|
|
394
|
+
xl: "text-base"
|
|
395
|
+
// 14px - Don't go too large for secondary text
|
|
396
|
+
})[t],
|
|
397
|
+
/** Value display text sizing (large numbers) */
|
|
398
|
+
value: (t) => ({
|
|
399
|
+
xs: "text-lg",
|
|
400
|
+
// 18px - Still readable on small widgets
|
|
401
|
+
sm: "text-xl",
|
|
402
|
+
// 20px - Slightly larger
|
|
403
|
+
md: "text-2xl",
|
|
404
|
+
// 24px - Prominent
|
|
405
|
+
lg: "text-3xl",
|
|
406
|
+
// 30px - Very prominent
|
|
407
|
+
xl: "text-4xl"
|
|
408
|
+
// 36px - Maximum impact
|
|
409
|
+
})[t],
|
|
410
|
+
/** Badge text sizing (entity count badges) */
|
|
411
|
+
badge: (t) => ({
|
|
412
|
+
xs: "text-xs",
|
|
413
|
+
// 12px - Compact badge
|
|
414
|
+
sm: "text-xs",
|
|
415
|
+
// 12px - Keep small
|
|
416
|
+
md: "text-xs",
|
|
417
|
+
// 12px - Badges should stay small
|
|
418
|
+
lg: "text-sm",
|
|
419
|
+
// 14px - Slightly larger for readability
|
|
420
|
+
xl: "text-sm"
|
|
421
|
+
// 14px - Maximum badge size
|
|
422
|
+
})[t],
|
|
423
|
+
/** Metric label text sizing */
|
|
424
|
+
metricLabel: (t) => ({
|
|
425
|
+
xs: "text-xs",
|
|
426
|
+
// 12px - Compact labels
|
|
427
|
+
sm: "text-xs",
|
|
428
|
+
// 12px
|
|
429
|
+
md: "text-xs",
|
|
430
|
+
// 12px - Labels stay small
|
|
431
|
+
lg: "text-sm",
|
|
432
|
+
// 14px - More readable on large widgets
|
|
433
|
+
xl: "text-sm"
|
|
434
|
+
// 14px
|
|
435
|
+
})[t],
|
|
436
|
+
/** Metric value text sizing */
|
|
437
|
+
metricValue: (t) => ({
|
|
438
|
+
xs: "text-sm",
|
|
439
|
+
// 14px - Readable metric values
|
|
440
|
+
sm: "text-sm",
|
|
441
|
+
// 14px
|
|
442
|
+
md: "text-sm",
|
|
443
|
+
// 14px - Keep metrics compact
|
|
444
|
+
lg: "text-base",
|
|
445
|
+
// 16px - Slightly larger
|
|
446
|
+
xl: "text-base"
|
|
447
|
+
// 16px
|
|
448
|
+
})[t],
|
|
449
|
+
/** Status text (same as subtitle but semantic) */
|
|
450
|
+
status: (t) => ({
|
|
451
|
+
xs: "text-md",
|
|
452
|
+
sm: "text-xl",
|
|
453
|
+
md: "text-2xl",
|
|
454
|
+
lg: "text-3xl",
|
|
455
|
+
xl: "text-3xl"
|
|
456
|
+
})[t],
|
|
457
|
+
/** Empty state message text */
|
|
458
|
+
emptyState: (t) => ({
|
|
459
|
+
xs: "text-xs",
|
|
460
|
+
// 12px
|
|
461
|
+
sm: "text-sm",
|
|
462
|
+
// 14px
|
|
463
|
+
md: "text-sm",
|
|
464
|
+
// 14px
|
|
465
|
+
lg: "text-base",
|
|
466
|
+
// 16px
|
|
467
|
+
xl: "text-base"
|
|
468
|
+
// 16px
|
|
469
|
+
})[t]
|
|
470
|
+
};
|
|
471
|
+
var Xt = /* @__PURE__ */ h("<div><div>"), Kt = /* @__PURE__ */ h("<div>"), qt = /* @__PURE__ */ h("<h3>"), Zt = /* @__PURE__ */ h("<p>"), Qt = /* @__PURE__ */ h("<div class=mt-2>");
|
|
472
|
+
function Jt(t) {
|
|
473
|
+
const e = R(), n = () => e.contentLayout() === "horizontal";
|
|
474
|
+
return (() => {
|
|
475
|
+
var i = Xt(), r = i.firstChild;
|
|
476
|
+
return f(i, (() => {
|
|
477
|
+
var a = D(() => !!t.icon);
|
|
478
|
+
return () => a() && (() => {
|
|
479
|
+
var s = Kt();
|
|
480
|
+
return f(s, () => t.icon), C((o) => {
|
|
481
|
+
var c = w("flex items-center justify-center text-white/30", n() ? "shrink-0" : ""), g = `${N.icon(e.size())}px`, d = `${N.icon(e.size())}px`;
|
|
482
|
+
return c !== o.e && k(s, o.e = c), g !== o.t && p(s, "width", o.t = g), d !== o.a && p(s, "height", o.a = d), o;
|
|
483
|
+
}, {
|
|
484
|
+
e: void 0,
|
|
485
|
+
t: void 0,
|
|
486
|
+
a: void 0
|
|
487
|
+
}), s;
|
|
488
|
+
})();
|
|
489
|
+
})(), r), f(r, (() => {
|
|
490
|
+
var a = D(() => !!(t.title ?? "No data"));
|
|
491
|
+
return () => a() && (() => {
|
|
492
|
+
var s = qt();
|
|
493
|
+
return f(s, () => t.title ?? "No data"), C((o) => {
|
|
494
|
+
var c = w("font-semibold text-white/60", B.subtitle(e.size())), g = n() ? "100%" : "80%";
|
|
495
|
+
return c !== o.e && k(s, o.e = c), g !== o.t && p(s, "max-width", o.t = g), o;
|
|
496
|
+
}, {
|
|
497
|
+
e: void 0,
|
|
498
|
+
t: void 0
|
|
499
|
+
}), s;
|
|
500
|
+
})();
|
|
501
|
+
})(), null), f(r, (() => {
|
|
502
|
+
var a = D(() => !!t.message);
|
|
503
|
+
return () => a() && (() => {
|
|
504
|
+
var s = Zt();
|
|
505
|
+
return f(s, () => t.message), C((o) => {
|
|
506
|
+
var c = w("text-white/50", B.emptyState(e.size())), g = n() ? "100%" : "85%";
|
|
507
|
+
return c !== o.e && k(s, o.e = c), g !== o.t && p(s, "max-width", o.t = g), o;
|
|
508
|
+
}, {
|
|
509
|
+
e: void 0,
|
|
510
|
+
t: void 0
|
|
511
|
+
}), s;
|
|
512
|
+
})();
|
|
513
|
+
})(), null), f(r, (() => {
|
|
514
|
+
var a = D(() => !!t.action);
|
|
515
|
+
return () => a() && (() => {
|
|
516
|
+
var s = Qt();
|
|
517
|
+
return f(s, () => t.action), s;
|
|
518
|
+
})();
|
|
519
|
+
})(), null), C((a) => {
|
|
520
|
+
var s = w("flex h-full w-full", n() ? "flex-row items-center justify-start" : "flex-col items-center justify-center text-center", t.class), o = N.S2(e.size()), c = N.container(e.size()), g = w("flex flex-col", n() ? "items-start text-left" : "items-center text-center"), d = N.S1(e.size());
|
|
521
|
+
return s !== a.e && k(i, a.e = s), o !== a.t && p(i, "gap", a.t = o), c !== a.a && p(i, "padding", a.a = c), g !== a.o && k(r, a.o = g), d !== a.i && p(r, "gap", a.i = d), a;
|
|
522
|
+
}, {
|
|
523
|
+
e: void 0,
|
|
524
|
+
t: void 0,
|
|
525
|
+
a: void 0,
|
|
526
|
+
o: void 0,
|
|
527
|
+
i: void 0
|
|
528
|
+
}), i;
|
|
529
|
+
})();
|
|
530
|
+
}
|
|
531
|
+
function te(t) {
|
|
532
|
+
const e = t.match(/hsl\(\s*([\d.]+)\s*,\s*([\d.]+)%?\s*,\s*([\d.]+)%?\s*\)/);
|
|
533
|
+
return e ? { h: Number(e[1]), s: Number(e[2]), l: Number(e[3]) } : null;
|
|
534
|
+
}
|
|
535
|
+
function ee(t) {
|
|
536
|
+
const e = t.match(/rgb\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)\s*\)/);
|
|
537
|
+
return e ? ht(Number(e[1]), Number(e[2]), Number(e[3])) : null;
|
|
538
|
+
}
|
|
539
|
+
function ne(t) {
|
|
540
|
+
const e = t.match(/^#([0-9a-f]{3,8})$/i);
|
|
541
|
+
if (!e) return null;
|
|
542
|
+
let n = e[1];
|
|
543
|
+
n.length === 3 && (n = n[0] + n[0] + n[1] + n[1] + n[2] + n[2]);
|
|
544
|
+
const i = Number.parseInt(n.slice(0, 2), 16), r = Number.parseInt(n.slice(2, 4), 16), a = Number.parseInt(n.slice(4, 6), 16);
|
|
545
|
+
return ht(i, r, a);
|
|
546
|
+
}
|
|
547
|
+
function ht(t, e, n) {
|
|
548
|
+
t /= 255, e /= 255, n /= 255;
|
|
549
|
+
const i = Math.max(t, e, n), r = Math.min(t, e, n), a = (i + r) / 2;
|
|
550
|
+
if (i === r) return { h: 0, s: 0, l: a * 100 };
|
|
551
|
+
const s = i - r, o = a > 0.5 ? s / (2 - i - r) : s / (i + r);
|
|
552
|
+
let c = 0;
|
|
553
|
+
return i === t ? c = ((e - n) / s + (e < n ? 6 : 0)) / 6 : i === e ? c = ((n - t) / s + 2) / 6 : c = ((t - e) / s + 4) / 6, { h: c * 360, s: o * 100, l: a * 100 };
|
|
554
|
+
}
|
|
555
|
+
function re(t) {
|
|
556
|
+
return te(t) ?? ee(t) ?? ne(t);
|
|
557
|
+
}
|
|
558
|
+
function ct(t, e, n, i) {
|
|
559
|
+
const r = Math.round(t), a = Math.round(Math.min(100, Math.max(0, e))), s = Math.round(Math.min(100, Math.max(0, n)));
|
|
560
|
+
return i !== void 0 && i < 1 ? `hsla(${r}, ${a}%, ${s}%, ${i})` : `hsl(${r}, ${a}%, ${s}%)`;
|
|
561
|
+
}
|
|
562
|
+
function ie(t) {
|
|
563
|
+
const e = re(t);
|
|
564
|
+
if (!e) return null;
|
|
565
|
+
const { h: n, s: i, l: r } = e;
|
|
566
|
+
let a, s = Math.min(i + 10, 100);
|
|
567
|
+
r < 25 ? (a = r + 12, s = Math.min(i + 15, 100)) : r < 40 ? a = Math.max(r - 8, 15) : a = Math.max(18, r * 0.3), i < 15 && (s = 10, a = Math.max(a, 20));
|
|
568
|
+
const o = ct(n, s, a, 0.85), c = ct(n, Math.min(i, 90), Math.min(r, 55), 0.5);
|
|
569
|
+
return { background: o, glow: c };
|
|
570
|
+
}
|
|
571
|
+
var ae = /* @__PURE__ */ h('<div><div class="flex items-center justify-center text-white">'), ut = /* @__PURE__ */ h("<div>");
|
|
572
|
+
function se(t) {
|
|
573
|
+
const e = R(), n = () => t.dynamicColor ? ie(t.dynamicColor) : null, i = () => !!n(), r = () => {
|
|
574
|
+
const c = n();
|
|
575
|
+
if (c)
|
|
576
|
+
return {
|
|
577
|
+
"background-color": c.background
|
|
578
|
+
};
|
|
579
|
+
}, a = () => {
|
|
580
|
+
const c = n();
|
|
581
|
+
if (c)
|
|
582
|
+
return {
|
|
583
|
+
"box-shadow": `0 0 25px ${c.glow}`
|
|
584
|
+
};
|
|
585
|
+
}, s = () => {
|
|
586
|
+
const c = {
|
|
587
|
+
width: `${N.icon(e.size())}px`,
|
|
588
|
+
height: `${N.icon(e.size())}px`,
|
|
589
|
+
"border-radius": "var(--radius-sm, 12px)"
|
|
590
|
+
}, g = r(), d = a();
|
|
591
|
+
return g && Object.assign(c, g), d && Object.assign(c, d), c;
|
|
592
|
+
}, o = (c, g, d) => {
|
|
593
|
+
const x = {
|
|
594
|
+
width: `${N.icon(e.size()) * 1.02}px`,
|
|
595
|
+
height: `${N.icon(e.size()) * 1.02}px`,
|
|
596
|
+
"border-radius": "var(--radius-sm, 12px)",
|
|
597
|
+
bottom: `${-N.icon(e.size()) * c}px`,
|
|
598
|
+
right: `${-N.icon(e.size()) * (c * 0.71)}px`,
|
|
599
|
+
"z-index": g,
|
|
600
|
+
opacity: d
|
|
601
|
+
}, S = r();
|
|
602
|
+
return S && Object.assign(x, S), x;
|
|
603
|
+
};
|
|
604
|
+
return (() => {
|
|
605
|
+
var c = ae(), g = c.firstChild;
|
|
606
|
+
return f(c, (() => {
|
|
607
|
+
var d = D(() => (t.entityCount ?? 1) >= 2);
|
|
608
|
+
return () => d() && (() => {
|
|
609
|
+
var x = ut();
|
|
610
|
+
return C((S) => {
|
|
611
|
+
var u = w("absolute", !i() && (t.color ?? "bg-white/10")), l = o(0.14, -2, 0.45);
|
|
612
|
+
return u !== S.e && k(x, S.e = u), S.t = Q(x, l, S.t), S;
|
|
613
|
+
}, {
|
|
614
|
+
e: void 0,
|
|
615
|
+
t: void 0
|
|
616
|
+
}), x;
|
|
617
|
+
})();
|
|
618
|
+
})(), g), f(c, (() => {
|
|
619
|
+
var d = D(() => (t.entityCount ?? 1) >= 3);
|
|
620
|
+
return () => d() && (() => {
|
|
621
|
+
var x = ut();
|
|
622
|
+
return C((S) => {
|
|
623
|
+
var u = w("absolute", !i() && (t.color ?? "bg-white/10")), l = o(0.28, -3, 0.2);
|
|
624
|
+
return u !== S.e && k(x, S.e = u), S.t = Q(x, l, S.t), S;
|
|
625
|
+
}, {
|
|
626
|
+
e: void 0,
|
|
627
|
+
t: void 0
|
|
628
|
+
}), x;
|
|
629
|
+
})();
|
|
630
|
+
})(), g), f(g, () => t.icon), C((d) => {
|
|
631
|
+
var x = w(
|
|
632
|
+
"relative flex shrink-0 items-center justify-center transition-all",
|
|
633
|
+
"pointer-events-none",
|
|
634
|
+
t.dimmed && "opacity-50",
|
|
635
|
+
// Only apply Tailwind classes when not using dynamic colors
|
|
636
|
+
!i() && t.glow && "shadow-[0_0_25px]",
|
|
637
|
+
!i() && (t.color ?? "bg-white/10"),
|
|
638
|
+
!i() && t.glow,
|
|
639
|
+
t.class
|
|
640
|
+
), S = s(), u = `${N.iconSize(e.size())}px`;
|
|
641
|
+
return x !== d.e && k(c, d.e = x), d.t = Q(c, S, d.t), u !== d.a && p(g, "font-size", d.a = u), d;
|
|
642
|
+
}, {
|
|
643
|
+
e: void 0,
|
|
644
|
+
t: void 0,
|
|
645
|
+
a: void 0
|
|
646
|
+
}), c;
|
|
647
|
+
})();
|
|
648
|
+
}
|
|
649
|
+
var oe = /* @__PURE__ */ h("<div>"), le = /* @__PURE__ */ h("<div><div><span></span></div><div>"), ce = /* @__PURE__ */ h("<span class=shrink-0>"), ue = /* @__PURE__ */ h('<span class="ml-1 text-white/70">');
|
|
650
|
+
function de(t) {
|
|
651
|
+
const e = R(), n = () => {
|
|
652
|
+
const i = t.direction ?? "auto";
|
|
653
|
+
return i === "auto" ? e.orientation() === "horizontal" ? "horizontal" : "vertical" : i;
|
|
654
|
+
};
|
|
655
|
+
return (() => {
|
|
656
|
+
var i = oe();
|
|
657
|
+
return f(i, () => t.children), C(() => k(i, w("flex", n() === "horizontal" ? "flex-row gap-4" : "flex-col gap-2", t.class))), i;
|
|
658
|
+
})();
|
|
659
|
+
}
|
|
660
|
+
function ge(t) {
|
|
661
|
+
const e = R();
|
|
662
|
+
return (() => {
|
|
663
|
+
var n = le(), i = n.firstChild, r = i.firstChild, a = i.nextSibling;
|
|
664
|
+
return f(i, (() => {
|
|
665
|
+
var s = D(() => !!t.icon);
|
|
666
|
+
return () => s() && (() => {
|
|
667
|
+
var o = ce();
|
|
668
|
+
return f(o, () => t.icon), o;
|
|
669
|
+
})();
|
|
670
|
+
})(), r), f(r, () => t.label), f(a, () => t.value, null), f(a, (() => {
|
|
671
|
+
var s = D(() => !!t.unit);
|
|
672
|
+
return () => s() && (() => {
|
|
673
|
+
var o = ue();
|
|
674
|
+
return f(o, () => t.unit), o;
|
|
675
|
+
})();
|
|
676
|
+
})(), null), C((s) => {
|
|
677
|
+
var o = w("flex flex-col", t.dimmed && "opacity-50", t.class), c = N.S1(e.size()), g = w("flex items-center gap-1 text-white/60", B.metricLabel(e.size())), d = w("font-semibold text-white", B.metricValue(e.size()));
|
|
678
|
+
return o !== s.e && k(n, s.e = o), c !== s.t && p(n, "gap", s.t = c), g !== s.a && k(i, s.a = g), d !== s.o && k(a, s.o = d), s;
|
|
679
|
+
}, {
|
|
680
|
+
e: void 0,
|
|
681
|
+
t: void 0,
|
|
682
|
+
a: void 0,
|
|
683
|
+
o: void 0
|
|
684
|
+
}), n;
|
|
685
|
+
})();
|
|
686
|
+
}
|
|
687
|
+
const xt = de;
|
|
688
|
+
xt.Item = ge;
|
|
689
|
+
var me = /* @__PURE__ */ h("<p>");
|
|
690
|
+
function fe(t) {
|
|
691
|
+
const e = R();
|
|
692
|
+
return (() => {
|
|
693
|
+
var n = me();
|
|
694
|
+
return f(n, (() => {
|
|
695
|
+
var i = D(() => !!t.isUnavailable);
|
|
696
|
+
return () => i() ? "Unavailable" : t.children;
|
|
697
|
+
})()), C((i) => {
|
|
698
|
+
var r = w("relative font-bold text-white", t.dimmed && "opacity-40", B.status(e.size()), t.class), a = j.ACTIONS;
|
|
699
|
+
return r !== i.e && k(n, i.e = r), a !== i.t && p(n, "z-index", i.t = a), i;
|
|
700
|
+
}, {
|
|
701
|
+
e: void 0,
|
|
702
|
+
t: void 0
|
|
703
|
+
}), n;
|
|
704
|
+
})();
|
|
705
|
+
}
|
|
706
|
+
var he = /* @__PURE__ */ h("<p>");
|
|
707
|
+
function xe(t) {
|
|
708
|
+
const e = R();
|
|
709
|
+
return (() => {
|
|
710
|
+
var n = he();
|
|
711
|
+
return f(n, () => t.children), C(() => k(n, w("truncate font-medium text-white/80", t.dimmed && "text-white/50", B.subtitle(e.size()), t.class))), n;
|
|
712
|
+
})();
|
|
713
|
+
}
|
|
714
|
+
var ve = /* @__PURE__ */ h("<div><h3>"), be = /* @__PURE__ */ h("<span>");
|
|
715
|
+
function ye(t) {
|
|
716
|
+
const e = R();
|
|
717
|
+
return (() => {
|
|
718
|
+
var n = ve(), i = n.firstChild;
|
|
719
|
+
return f(i, () => t.children), f(n, (() => {
|
|
720
|
+
var r = D(() => t.badge !== void 0 && t.badge > 0);
|
|
721
|
+
return () => r() && (() => {
|
|
722
|
+
var a = be();
|
|
723
|
+
return f(a, () => t.badge), C(() => k(a, w("shrink-0 rounded-full bg-white/20 px-2 py-0.5 font-medium text-white", B.badge(e.size())))), a;
|
|
724
|
+
})();
|
|
725
|
+
})(), null), C((r) => {
|
|
726
|
+
var a = w("relative flex items-center", t.class), s = N.S1(e.size()), o = j.ACTIONS, c = w("truncate text-white/60", B.title(e.size()));
|
|
727
|
+
return a !== r.e && k(n, r.e = a), s !== r.t && p(n, "gap", r.t = s), o !== r.a && p(n, "z-index", r.a = o), c !== r.o && k(i, r.o = c), r;
|
|
728
|
+
}, {
|
|
729
|
+
e: void 0,
|
|
730
|
+
t: void 0,
|
|
731
|
+
a: void 0,
|
|
732
|
+
o: void 0
|
|
733
|
+
}), n;
|
|
734
|
+
})();
|
|
735
|
+
}
|
|
736
|
+
function Cn(t) {
|
|
737
|
+
return {
|
|
738
|
+
icon: t.icon,
|
|
739
|
+
title: t.title,
|
|
740
|
+
message: t.message || `Configure this widget to add ${t.entityType || "an entity"}`
|
|
741
|
+
};
|
|
742
|
+
}
|
|
743
|
+
function we(t, e = !1) {
|
|
744
|
+
if (t.length === 0)
|
|
745
|
+
return {
|
|
746
|
+
isGroup: !1,
|
|
747
|
+
state: "unknown",
|
|
748
|
+
isOn: !1,
|
|
749
|
+
isUnavailable: !0,
|
|
750
|
+
brightness: 0,
|
|
751
|
+
brightnessPercent: 0,
|
|
752
|
+
color: "rgb(100, 100, 100)",
|
|
753
|
+
onCount: 0,
|
|
754
|
+
totalCount: 0,
|
|
755
|
+
description: "No entities"
|
|
756
|
+
};
|
|
757
|
+
const n = t.length > 1;
|
|
758
|
+
if (!n) {
|
|
759
|
+
const y = t[0], _ = y.state === "on", G = y.attributes?.brightness || 0, E = Math.round(G / 255 * 100);
|
|
760
|
+
return {
|
|
761
|
+
isGroup: !1,
|
|
762
|
+
state: y.state,
|
|
763
|
+
isOn: _,
|
|
764
|
+
isUnavailable: y.state === "unavailable",
|
|
765
|
+
brightness: G,
|
|
766
|
+
brightnessPercent: E,
|
|
767
|
+
color: dt(y),
|
|
768
|
+
onCount: _ ? 1 : 0,
|
|
769
|
+
totalCount: 1,
|
|
770
|
+
description: _ ? "On" : "Off"
|
|
771
|
+
};
|
|
772
|
+
}
|
|
773
|
+
let i = 0, r = 0, a = 0, s = 0, o = 0, c = 0;
|
|
774
|
+
const g = [];
|
|
775
|
+
for (const y of t)
|
|
776
|
+
switch (y.state) {
|
|
777
|
+
case "on":
|
|
778
|
+
i++, y.attributes?.brightness !== void 0 && (o += y.attributes.brightness, c++), y.attributes?.rgb_color && g.push(y.attributes.rgb_color);
|
|
779
|
+
break;
|
|
780
|
+
case "off":
|
|
781
|
+
r++;
|
|
782
|
+
break;
|
|
783
|
+
case "unknown":
|
|
784
|
+
a++;
|
|
785
|
+
break;
|
|
786
|
+
case "unavailable":
|
|
787
|
+
s++;
|
|
788
|
+
break;
|
|
789
|
+
}
|
|
790
|
+
const d = t.length, x = s === d, S = a + s === d, u = i > 0, l = i === d, b = r === d;
|
|
791
|
+
let v, T;
|
|
792
|
+
e ? x ? (v = "unavailable", T = !1) : a > 0 || s > 0 ? (v = "unknown", T = !1) : r > 0 ? (v = "off", T = !1) : (v = "on", T = !0) : x ? (v = "unavailable", T = !1) : S ? (v = "unknown", T = !1) : u ? (v = "on", T = !0) : (v = "off", T = !1);
|
|
793
|
+
const $ = c > 0 ? Math.round(o / c) : 0, A = Math.round($ / 255 * 100);
|
|
794
|
+
let I;
|
|
795
|
+
if (g.length > 0) {
|
|
796
|
+
const y = Math.round(g.reduce((W, L) => W + L[0], 0) / g.length), _ = Math.round(g.reduce((W, L) => W + L[1], 0) / g.length), G = Math.round(g.reduce((W, L) => W + L[2], 0) / g.length), E = $ / 255;
|
|
797
|
+
I = `rgb(${Math.round(y * E)}, ${Math.round(_ * E)}, ${Math.round(G * E)})`;
|
|
798
|
+
} else
|
|
799
|
+
I = dt(t[0]);
|
|
800
|
+
let V;
|
|
801
|
+
return l ? V = "All on" : b ? V = "All off" : i > 0 ? V = `${i} of ${d} on` : V = "Off", {
|
|
802
|
+
isGroup: n,
|
|
803
|
+
state: v,
|
|
804
|
+
isOn: T,
|
|
805
|
+
isUnavailable: v === "unavailable",
|
|
806
|
+
brightness: $,
|
|
807
|
+
brightnessPercent: A,
|
|
808
|
+
color: I,
|
|
809
|
+
onCount: i,
|
|
810
|
+
totalCount: d,
|
|
811
|
+
description: V
|
|
812
|
+
};
|
|
813
|
+
}
|
|
814
|
+
function $e(t, e = "mean", n = !0) {
|
|
815
|
+
if (t.length === 0)
|
|
816
|
+
return {
|
|
817
|
+
isGroup: !1,
|
|
818
|
+
state: "unknown",
|
|
819
|
+
numericValue: null,
|
|
820
|
+
isUnavailable: !0,
|
|
821
|
+
description: "No entities"
|
|
822
|
+
};
|
|
823
|
+
const i = t.length > 1;
|
|
824
|
+
if (!i) {
|
|
825
|
+
const u = t[0], l = Number.parseFloat(u.state);
|
|
826
|
+
let b = u.state;
|
|
827
|
+
return Number.isNaN(l) || (b = Number.isInteger(l) ? l.toString() : l.toFixed(1)), {
|
|
828
|
+
isGroup: !1,
|
|
829
|
+
state: b,
|
|
830
|
+
numericValue: Number.isNaN(l) ? null : l,
|
|
831
|
+
isUnavailable: u.state === "unavailable",
|
|
832
|
+
unit: u.unitOfMeasurement ?? void 0,
|
|
833
|
+
description: b
|
|
834
|
+
};
|
|
835
|
+
}
|
|
836
|
+
const r = [], a = [];
|
|
837
|
+
let s = 0, o;
|
|
838
|
+
for (const u of t) {
|
|
839
|
+
if (!o && u.unitOfMeasurement && (o = u.unitOfMeasurement), u.state === "unavailable") {
|
|
840
|
+
s++, a.push({
|
|
841
|
+
entityId: u.id,
|
|
842
|
+
value: "unavailable",
|
|
843
|
+
friendly_name: u.friendlyName
|
|
844
|
+
});
|
|
845
|
+
continue;
|
|
846
|
+
}
|
|
847
|
+
const l = Number.parseFloat(u.state);
|
|
848
|
+
isNaN(l) ? n || a.push({
|
|
849
|
+
entityId: u.id,
|
|
850
|
+
value: u.state,
|
|
851
|
+
friendly_name: u.friendlyName
|
|
852
|
+
}) : (r.push(l), a.push({
|
|
853
|
+
entityId: u.id,
|
|
854
|
+
value: l,
|
|
855
|
+
friendly_name: u.friendlyName
|
|
856
|
+
}));
|
|
857
|
+
}
|
|
858
|
+
const c = s === t.length, g = r.length === 0;
|
|
859
|
+
if (c || g)
|
|
860
|
+
return {
|
|
861
|
+
isGroup: i,
|
|
862
|
+
state: c ? "unavailable" : "unknown",
|
|
863
|
+
numericValue: null,
|
|
864
|
+
isUnavailable: c,
|
|
865
|
+
unit: o,
|
|
866
|
+
description: c ? "Unavailable" : "No numeric values",
|
|
867
|
+
memberValues: a
|
|
868
|
+
};
|
|
869
|
+
let d, x;
|
|
870
|
+
switch (e) {
|
|
871
|
+
case "min":
|
|
872
|
+
d = Math.min(...r), x = "Minimum";
|
|
873
|
+
break;
|
|
874
|
+
case "max":
|
|
875
|
+
d = Math.max(...r), x = "Maximum";
|
|
876
|
+
break;
|
|
877
|
+
case "mean":
|
|
878
|
+
d = r.reduce((u, l) => u + l, 0) / r.length, x = "Average";
|
|
879
|
+
break;
|
|
880
|
+
case "median": {
|
|
881
|
+
const u = [...r].sort((b, v) => b - v), l = Math.floor(u.length / 2);
|
|
882
|
+
d = u.length % 2 === 0 ? (u[l - 1] + u[l]) / 2 : u[l], x = "Median";
|
|
883
|
+
break;
|
|
884
|
+
}
|
|
885
|
+
case "sum":
|
|
886
|
+
d = r.reduce((u, l) => u + l, 0), x = "Sum";
|
|
887
|
+
break;
|
|
888
|
+
case "last":
|
|
889
|
+
d = r[r.length - 1], x = "Latest";
|
|
890
|
+
break;
|
|
891
|
+
case "range":
|
|
892
|
+
d = Math.max(...r) - Math.min(...r), x = "Range";
|
|
893
|
+
break;
|
|
894
|
+
case "product":
|
|
895
|
+
d = r.reduce((u, l) => u * l, 1), x = "Product";
|
|
896
|
+
break;
|
|
897
|
+
case "std_dev": {
|
|
898
|
+
const u = r.reduce((b, v) => b + v, 0) / r.length, l = r.reduce((b, v) => b + (v - u) ** 2, 0) / r.length;
|
|
899
|
+
d = Math.sqrt(l), x = "Std Dev";
|
|
900
|
+
break;
|
|
901
|
+
}
|
|
902
|
+
default:
|
|
903
|
+
d = r.reduce((u, l) => u + l, 0) / r.length, x = "Average";
|
|
904
|
+
}
|
|
905
|
+
const S = Number.isInteger(d) ? d.toString() : d.toFixed(1);
|
|
906
|
+
return {
|
|
907
|
+
isGroup: i,
|
|
908
|
+
state: S,
|
|
909
|
+
numericValue: d,
|
|
910
|
+
isUnavailable: !1,
|
|
911
|
+
unit: o,
|
|
912
|
+
description: `${x} of ${r.length}`,
|
|
913
|
+
memberValues: a
|
|
914
|
+
};
|
|
915
|
+
}
|
|
916
|
+
function dt(t) {
|
|
917
|
+
if (t.state !== "on") return "rgb(100, 100, 100)";
|
|
918
|
+
const n = (t.attributes?.brightness ?? 255) / 255;
|
|
919
|
+
if (t.attributes?.rgb_color) {
|
|
920
|
+
const [i, r, a] = t.attributes.rgb_color;
|
|
921
|
+
return `rgb(${Math.round(i * n)}, ${Math.round(r * n)}, ${Math.round(a * n)})`;
|
|
922
|
+
}
|
|
923
|
+
if (t.attributes?.color_temp) {
|
|
924
|
+
const r = 1e6 / t.attributes.color_temp / 100;
|
|
925
|
+
let a, s, o;
|
|
926
|
+
return r <= 66 ? (a = 255, s = r <= 19 ? 0 : 99.4708025861 * Math.log(r - 10) - 161.1195681661, o = r <= 19 ? 0 : r <= 66 ? 138.5177312231 * Math.log(r - 10) - 305.0447927307 : 255) : (a = 329.698727446 * (r - 60) ** -0.1332047592, s = 288.1221695283 * (r - 60) ** -0.0755148492, o = 255), a = Math.max(0, Math.min(255, a)) * n, s = Math.max(0, Math.min(255, s)) * n, o = Math.max(0, Math.min(255, o)) * n, `rgb(${Math.round(a)}, ${Math.round(s)}, ${Math.round(o)})`;
|
|
927
|
+
}
|
|
928
|
+
return `rgb(${Math.round(255 * n)}, ${Math.round(220 * n)}, ${Math.round(180 * n)})`;
|
|
929
|
+
}
|
|
930
|
+
function ke(t) {
|
|
931
|
+
return t ? t.state !== "unavailable" && t.state !== "unknown" : !1;
|
|
932
|
+
}
|
|
933
|
+
function pe(t) {
|
|
934
|
+
if (!t) return !1;
|
|
935
|
+
if (["on", "open", "locked", "home", "playing", "active"].includes(t.state))
|
|
936
|
+
return !0;
|
|
937
|
+
if (t.domain === "sensor") {
|
|
938
|
+
const e = Number.parseFloat(t.state);
|
|
939
|
+
return !isNaN(e) && e > 0;
|
|
940
|
+
}
|
|
941
|
+
return !1;
|
|
942
|
+
}
|
|
943
|
+
function Mn(t, e = "unknown") {
|
|
944
|
+
return t?.state ?? e;
|
|
945
|
+
}
|
|
946
|
+
function zn(t, e, n) {
|
|
947
|
+
return t?.attributes ? t.attributes[e] ?? n : n;
|
|
948
|
+
}
|
|
949
|
+
function Dn(t, e) {
|
|
950
|
+
return t.filter((n) => n.state === e).length;
|
|
951
|
+
}
|
|
952
|
+
function _n(t) {
|
|
953
|
+
return t.filter(ke).length;
|
|
954
|
+
}
|
|
955
|
+
function An(t) {
|
|
956
|
+
return t.filter(pe).length;
|
|
957
|
+
}
|
|
958
|
+
function Nn(t, e) {
|
|
959
|
+
return t.length > 0 && t.every((n) => n.state === e);
|
|
960
|
+
}
|
|
961
|
+
function Tn(t, e) {
|
|
962
|
+
return t.some((n) => n.state === e);
|
|
963
|
+
}
|
|
964
|
+
function Se(t, e, n) {
|
|
965
|
+
const { decimals: i, scale: r = !0 } = n || {};
|
|
966
|
+
if (typeof t == "string")
|
|
967
|
+
return e ? `${t}${e}` : t;
|
|
968
|
+
if (t == null || Number.isNaN(t))
|
|
969
|
+
return e ? `--${e}` : "--";
|
|
970
|
+
let a = t, s = e || "";
|
|
971
|
+
r && e && (e === "W" || e === "kW" || e === "MW") && (t >= 1e6 ? (a = t / 1e6, s = "MW") : t >= 1e3 ? (a = t / 1e3, s = "kW") : s = "W"), r && e && (e === "B" || e === "KB" || e === "MB" || e === "GB") && (t >= 1073741824 ? (a = t / 1073741824, s = "GB") : t >= 1048576 ? (a = t / 1048576, s = "MB") : t >= 1024 ? (a = t / 1024, s = "KB") : s = "B");
|
|
972
|
+
let o;
|
|
973
|
+
return i !== void 0 ? o = a.toFixed(i) : a !== t ? o = a.toFixed(1) : Number.isInteger(t) ? o = t.toString() : o = Number.parseFloat(t.toFixed(2)).toString(), s ? `${o}${s}` : o;
|
|
974
|
+
}
|
|
975
|
+
function Ce(t, e) {
|
|
976
|
+
return t == null || isNaN(t) ? null : e === "°C" ? t < 10 ? "Cold" : t < 18 ? "Cool" : t < 24 ? "Comfortable" : t < 28 ? "Warm" : "Hot" : e === "°F" ? t < 50 ? "Cold" : t < 64 ? "Cool" : t < 75 ? "Comfortable" : t < 82 ? "Warm" : "Hot" : e === "%" ? t < 20 ? "Very Low" : t < 40 ? "Low" : t < 60 ? "Medium" : t < 80 ? "High" : "Very High" : e === "ppm" ? t < 400 ? "Excellent" : t < 600 ? "Good" : t < 1e3 ? "Acceptable" : t < 1500 ? "Mediocre" : "Poor" : e === "lx" ? t < 50 ? "Dark" : t < 200 ? "Dim" : t < 500 ? "Moderate" : t < 1e3 ? "Bright" : "Very Bright" : e === "AQI" ? t <= 50 ? "Good" : t <= 100 ? "Moderate" : t <= 150 ? "Unhealthy for Sensitive" : t <= 200 ? "Unhealthy" : t <= 300 ? "Very Unhealthy" : "Hazardous" : e === "dB" ? t < 30 ? "Very Quiet" : t < 50 ? "Quiet" : t < 70 ? "Moderate" : t < 85 ? "Loud" : "Very Loud" : null;
|
|
977
|
+
}
|
|
978
|
+
var Me = /* @__PURE__ */ h("<div><div>"), ze = /* @__PURE__ */ h("<div>");
|
|
979
|
+
function De(t) {
|
|
980
|
+
const e = R();
|
|
981
|
+
return (() => {
|
|
982
|
+
var n = Me(), i = n.firstChild;
|
|
983
|
+
return f(i, () => Se(t.value, t.unit)), f(n, (() => {
|
|
984
|
+
var r = D(() => !!(t.interpret && typeof t.value == "number"));
|
|
985
|
+
return () => r() && (() => {
|
|
986
|
+
var a = ze();
|
|
987
|
+
return f(a, () => Ce(t.value, t.unit)), C((s) => {
|
|
988
|
+
var o = w("text-white/60", B.subtitle(e.size())), c = N.S1(e.size());
|
|
989
|
+
return o !== s.e && k(a, s.e = o), c !== s.t && p(a, "margin-top", s.t = c), s;
|
|
990
|
+
}, {
|
|
991
|
+
e: void 0,
|
|
992
|
+
t: void 0
|
|
993
|
+
}), a;
|
|
994
|
+
})();
|
|
995
|
+
})(), null), C((r) => {
|
|
996
|
+
var a = w("flex flex-col", t.class), s = w("font-bold text-white", B.value(e.size()));
|
|
997
|
+
return a !== r.e && k(n, r.e = a), s !== r.t && k(i, r.t = s), r;
|
|
998
|
+
}, {
|
|
999
|
+
e: void 0,
|
|
1000
|
+
t: void 0
|
|
1001
|
+
}), n;
|
|
1002
|
+
})();
|
|
1003
|
+
}
|
|
1004
|
+
var _e = /* @__PURE__ */ h('<div><div><div class="relative h-full w-full">'), Ae = /* @__PURE__ */ h('<div class="pointer-events-none absolute inset-0"><div>'), Ne = /* @__PURE__ */ h('<div class="pointer-events-none absolute inset-0 animate-pulse bg-blue-500/20">'), Te = /* @__PURE__ */ h('<div class="flex h-full w-full flex-col items-center justify-center gap-2 text-center">'), Ee = /* @__PURE__ */ h('<div class="flex items-center justify-center text-white/30">'), Oe = /* @__PURE__ */ h('<h3 class="font-semibold text-sm text-white/60">'), Ve = /* @__PURE__ */ h('<p class="text-white/50 text-xs">');
|
|
1005
|
+
function We(t, e) {
|
|
1006
|
+
const n = t * e;
|
|
1007
|
+
return n <= 2 ? "xs" : n <= 4 ? "sm" : n <= 8 ? "md" : n <= 18 ? "lg" : "xl";
|
|
1008
|
+
}
|
|
1009
|
+
function Ie(t, e) {
|
|
1010
|
+
return t > e ? "horizontal" : e > t ? "vertical" : "square";
|
|
1011
|
+
}
|
|
1012
|
+
function Re(t, e) {
|
|
1013
|
+
return e >= 150 ? "vertical" : t > e ? "horizontal" : e > t ? "vertical" : "square";
|
|
1014
|
+
}
|
|
1015
|
+
function Ge(t) {
|
|
1016
|
+
let e;
|
|
1017
|
+
const n = Mt(() => e), i = 2, [r, a] = U(0), [s, o] = U(0);
|
|
1018
|
+
wt(() => {
|
|
1019
|
+
const $ = Math.round(n.width ?? 0), A = Math.round(n.height ?? 0), I = lt(r), V = lt(s);
|
|
1020
|
+
(Math.abs($ - I) > i || Math.abs(A - V) > i) && (a($), o(A));
|
|
1021
|
+
});
|
|
1022
|
+
const c = z(() => {
|
|
1023
|
+
if (t.variant)
|
|
1024
|
+
return typeof t.variant == "string" ? Vt(t.variant) : t.variant;
|
|
1025
|
+
}), g = z(() => ({
|
|
1026
|
+
width: r(),
|
|
1027
|
+
height: s(),
|
|
1028
|
+
gridWidth: Math.max(1, Math.round(r() / 150)),
|
|
1029
|
+
gridHeight: Math.max(1, Math.round(s() / 75))
|
|
1030
|
+
}), void 0, {
|
|
1031
|
+
equals: ($, A) => $.width === A.width && $.height === A.height && $.gridWidth === A.gridWidth && $.gridHeight === A.gridHeight
|
|
1032
|
+
}), d = z(() => {
|
|
1033
|
+
const $ = g();
|
|
1034
|
+
return We($.gridWidth, $.gridHeight);
|
|
1035
|
+
}), x = z(() => {
|
|
1036
|
+
const $ = g();
|
|
1037
|
+
return Ie($.width, $.height);
|
|
1038
|
+
}), S = z(() => {
|
|
1039
|
+
const $ = g();
|
|
1040
|
+
return Re($.width, $.height);
|
|
1041
|
+
}), u = mt(it), l = {
|
|
1042
|
+
size: d,
|
|
1043
|
+
orientation: x,
|
|
1044
|
+
contentLayout: S,
|
|
1045
|
+
dimensions: g,
|
|
1046
|
+
isEditMode: () => t.isEditMode ?? !1,
|
|
1047
|
+
updateConfig: u?.updateConfig ?? (() => {
|
|
1048
|
+
})
|
|
1049
|
+
}, b = "bg-gradient-to-br from-gray-500/20 to-gray-600/20", v = z(() => t.emptyState && !t.gradient ? b : t.gradient), T = z(() => ({
|
|
1050
|
+
"container-type": "size",
|
|
1051
|
+
"container-name": "widget",
|
|
1052
|
+
...c()?.styles?.container,
|
|
1053
|
+
...c()?.styles?.cssVars || {}
|
|
1054
|
+
}));
|
|
1055
|
+
return O(it.Provider, {
|
|
1056
|
+
value: l,
|
|
1057
|
+
get children() {
|
|
1058
|
+
var $ = _e(), A = $.firstChild, I = A.firstChild, V = e;
|
|
1059
|
+
return typeof V == "function" ? kt(V, $) : e = $, f(A, (() => {
|
|
1060
|
+
var y = D(() => !!t.backgroundGlow);
|
|
1061
|
+
return () => y() && (() => {
|
|
1062
|
+
var _ = Ae(), G = _.firstChild;
|
|
1063
|
+
return C((E) => {
|
|
1064
|
+
var W = j.BACKGROUND, L = w("absolute inset-0 opacity-20 blur-2xl", t.backgroundGlow);
|
|
1065
|
+
return W !== E.e && p(_, "z-index", E.e = W), L !== E.t && k(G, E.t = L), E;
|
|
1066
|
+
}, {
|
|
1067
|
+
e: void 0,
|
|
1068
|
+
t: void 0
|
|
1069
|
+
}), _;
|
|
1070
|
+
})();
|
|
1071
|
+
})(), I), f(I, (() => {
|
|
1072
|
+
var y = D(() => !!t.emptyState);
|
|
1073
|
+
return () => y() ? O(He, {
|
|
1074
|
+
get icon() {
|
|
1075
|
+
return t.emptyState.icon;
|
|
1076
|
+
},
|
|
1077
|
+
get title() {
|
|
1078
|
+
return t.emptyState.title;
|
|
1079
|
+
},
|
|
1080
|
+
get message() {
|
|
1081
|
+
return t.emptyState.message;
|
|
1082
|
+
}
|
|
1083
|
+
}) : t.children;
|
|
1084
|
+
})()), f(A, (() => {
|
|
1085
|
+
var y = D(() => !!t.loading);
|
|
1086
|
+
return () => y() && (() => {
|
|
1087
|
+
var _ = Ne();
|
|
1088
|
+
return C((G) => p(_, "z-index", j.OVERLAY)), _;
|
|
1089
|
+
})();
|
|
1090
|
+
})(), null), C((y) => {
|
|
1091
|
+
var _ = w(
|
|
1092
|
+
"relative h-full w-full select-none rounded-xl border border-border/50",
|
|
1093
|
+
// Variant styles (lowest priority)
|
|
1094
|
+
c()?.styles?.class,
|
|
1095
|
+
// Custom class (highest priority)
|
|
1096
|
+
t.class
|
|
1097
|
+
), G = T(), E = w(
|
|
1098
|
+
"relative h-full w-full overflow-hidden rounded-xl",
|
|
1099
|
+
// Gradient prop (overrides variant, auto-applied for empty state)
|
|
1100
|
+
v()
|
|
1101
|
+
), W = j.CONTENT;
|
|
1102
|
+
return _ !== y.e && k($, y.e = _), y.t = Q($, G, y.t), E !== y.a && k(A, y.a = E), W !== y.o && p(I, "z-index", y.o = W), y;
|
|
1103
|
+
}, {
|
|
1104
|
+
e: void 0,
|
|
1105
|
+
t: void 0,
|
|
1106
|
+
a: void 0,
|
|
1107
|
+
o: void 0
|
|
1108
|
+
}), $;
|
|
1109
|
+
}
|
|
1110
|
+
});
|
|
1111
|
+
}
|
|
1112
|
+
function He(t) {
|
|
1113
|
+
return (() => {
|
|
1114
|
+
var e = Te();
|
|
1115
|
+
return f(e, (() => {
|
|
1116
|
+
var n = D(() => !!t.icon);
|
|
1117
|
+
return () => n() && (() => {
|
|
1118
|
+
var i = Ee();
|
|
1119
|
+
return f(i, () => t.icon), i;
|
|
1120
|
+
})();
|
|
1121
|
+
})(), null), f(e, (() => {
|
|
1122
|
+
var n = D(() => !!t.title);
|
|
1123
|
+
return () => n() && (() => {
|
|
1124
|
+
var i = Oe();
|
|
1125
|
+
return f(i, () => t.title), i;
|
|
1126
|
+
})();
|
|
1127
|
+
})(), null), f(e, (() => {
|
|
1128
|
+
var n = D(() => !!t.message);
|
|
1129
|
+
return () => n() && (() => {
|
|
1130
|
+
var i = Ve();
|
|
1131
|
+
return f(i, () => t.message), i;
|
|
1132
|
+
})();
|
|
1133
|
+
})(), null), e;
|
|
1134
|
+
})();
|
|
1135
|
+
}
|
|
1136
|
+
const P = Ge;
|
|
1137
|
+
P.Content = Yt;
|
|
1138
|
+
P.Icon = se;
|
|
1139
|
+
P.Title = ye;
|
|
1140
|
+
P.Subtitle = xe;
|
|
1141
|
+
P.Status = fe;
|
|
1142
|
+
P.Value = De;
|
|
1143
|
+
P.Metrics = xt;
|
|
1144
|
+
P.EmptyState = Jt;
|
|
1145
|
+
P.SliderFill = jt;
|
|
1146
|
+
var Be = /* @__PURE__ */ h("<div><div>");
|
|
1147
|
+
const Le = {
|
|
1148
|
+
blue: "bg-blue-500/30",
|
|
1149
|
+
green: "bg-green-500/30",
|
|
1150
|
+
red: "bg-red-500/30",
|
|
1151
|
+
yellow: "bg-yellow-500/30",
|
|
1152
|
+
purple: "bg-purple-500/30",
|
|
1153
|
+
gray: "bg-gray-500/30"
|
|
1154
|
+
};
|
|
1155
|
+
function En(t) {
|
|
1156
|
+
const e = () => Le[t.color] ?? t.color;
|
|
1157
|
+
return (() => {
|
|
1158
|
+
var n = Be(), i = n.firstChild;
|
|
1159
|
+
return C((r) => {
|
|
1160
|
+
var a = w("pointer-events-none absolute inset-0", t.class), s = j.BACKGROUND, o = w("absolute inset-0 opacity-40 blur-3xl", e());
|
|
1161
|
+
return a !== r.e && k(n, r.e = a), s !== r.t && p(n, "z-index", r.t = s), o !== r.a && k(i, r.a = o), r;
|
|
1162
|
+
}, {
|
|
1163
|
+
e: void 0,
|
|
1164
|
+
t: void 0,
|
|
1165
|
+
a: void 0
|
|
1166
|
+
}), n;
|
|
1167
|
+
})();
|
|
1168
|
+
}
|
|
1169
|
+
var je = /* @__PURE__ */ h("<div>");
|
|
1170
|
+
function On(t) {
|
|
1171
|
+
const e = R(), n = () => {
|
|
1172
|
+
const i = t.spacing ?? "S2";
|
|
1173
|
+
return N[i](e.size());
|
|
1174
|
+
};
|
|
1175
|
+
return (() => {
|
|
1176
|
+
var i = je();
|
|
1177
|
+
return f(i, () => t.children), C((r) => {
|
|
1178
|
+
var a = w("flex flex-col", t.class), s = n();
|
|
1179
|
+
return a !== r.e && k(i, r.e = a), s !== r.t && p(i, "gap", r.t = s), r;
|
|
1180
|
+
}, {
|
|
1181
|
+
e: void 0,
|
|
1182
|
+
t: void 0
|
|
1183
|
+
}), i;
|
|
1184
|
+
})();
|
|
1185
|
+
}
|
|
1186
|
+
var Pe = /* @__PURE__ */ h('<span class="inline-flex size-3.5 shrink-0 items-center">'), Ue = /* @__PURE__ */ h("<button type=button>"), Fe = /* @__PURE__ */ h('<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z">'), Ye = /* @__PURE__ */ h('<div class="rounded-lg bg-muted/30 p-2 text-center md:p-6"><p class="text-muted-foreground text-sm">No edit options available'), Xe = /* @__PURE__ */ h('<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><line x1=4 y1=21 x2=4 y2=14></line><line x1=4 y1=10 x2=4 y2=3></line><line x1=12 y1=21 x2=12 y2=12></line><line x1=12 y1=8 x2=12 y2=3></line><line x1=20 y1=21 x2=20 y2=16></line><line x1=20 y1=12 x2=20 y2=3></line><line x1=1 y1=14 x2=7 y2=14></line><line x1=9 y1=8 x2=15 y2=8></line><line x1=17 y1=16 x2=23 y2=16>'), Ke = /* @__PURE__ */ h('<div class="rounded-lg bg-muted/30 p-2 text-center md:p-6"><p class="text-muted-foreground text-sm">No additional controls'), qe = /* @__PURE__ */ h('<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 fill=none viewBox="0 0 24 24"stroke=currentColor stroke-width=2><path d="m8 2 1.88 1.88"></path><path d="M14.12 3.88 16 2"></path><path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"></path><path d="M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6"></path><path d="M12 20v-9"></path><path d="M6.53 9C4.6 8.8 3 7.1 3 5"></path><path d="M6 13H2"></path><path d="M3 21c0-2.1 1.7-3.9 3.8-4"></path><path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"></path><path d="M22 13h-4"></path><path d="M17.2 17c2.1.1 3.8 1.9 3.8 4">'), Ze = /* @__PURE__ */ h('<div class="rounded-lg bg-muted/30 p-2 text-center md:p-6"><p class="text-muted-foreground text-sm">No debug information available'), Qe = /* @__PURE__ */ h('<div class="min-w-0 shrink-0">'), Je = /* @__PURE__ */ h('<div class="flex items-center gap-2"><div class="flex h-8 items-center rounded-lg border border-border/50 bg-muted/30 p-0.5">'), tn = /* @__PURE__ */ h('<div class="min-h-0 flex-1 overflow-y-auto p-2 md:p-6">'), en = /* @__PURE__ */ h('<div class="flex shrink-0 justify-end pt-3">');
|
|
1187
|
+
function nn(t) {
|
|
1188
|
+
return (() => {
|
|
1189
|
+
var e = Ue();
|
|
1190
|
+
return e.$$click = () => t.onClick(), f(e, O(X, {
|
|
1191
|
+
get when() {
|
|
1192
|
+
return t.isActive;
|
|
1193
|
+
},
|
|
1194
|
+
get children() {
|
|
1195
|
+
var n = Pe();
|
|
1196
|
+
return f(n, () => t.icon), n;
|
|
1197
|
+
}
|
|
1198
|
+
}), null), f(e, () => t.label, null), C(() => k(e, w("flex cursor-pointer items-center justify-center rounded-md px-3 py-1.5 text-xs transition-all duration-300 ease-in-out", t.isActive ? "gap-1.5 bg-foreground/10 font-semibold text-foreground shadow-sm" : "gap-0 text-muted-foreground hover:bg-foreground/5 hover:text-foreground"))), e;
|
|
1199
|
+
})();
|
|
1200
|
+
}
|
|
1201
|
+
function Vn(t) {
|
|
1202
|
+
const [e] = $t(t, ["open", "onOpenChange", "title", "onSave", "hasUnsavedChanges", "onDelete", "editContent", "controlsContent", "debugContent", "debugData", "tabs", "class", "maxWidth", "defaultTab", "headerActions", "ResponsiveDialog", "ResponsiveDialogContent", "ResponsiveDialogHeader", "ResponsiveDialogTitle", "ResponsiveDialogDescription", "Button"]), [n, i] = U(e.defaultTab ?? "controls"), r = () => {
|
|
1203
|
+
const l = e.maxWidth ?? "3xl";
|
|
1204
|
+
return {
|
|
1205
|
+
sm: "max-w-sm",
|
|
1206
|
+
md: "max-w-md",
|
|
1207
|
+
lg: "max-w-lg",
|
|
1208
|
+
xl: "max-w-xl",
|
|
1209
|
+
"2xl": "max-w-2xl",
|
|
1210
|
+
"3xl": "max-w-3xl",
|
|
1211
|
+
"4xl": "max-w-4xl"
|
|
1212
|
+
}[l];
|
|
1213
|
+
}, a = () => {
|
|
1214
|
+
if (e.tabs) return e.tabs;
|
|
1215
|
+
const l = [];
|
|
1216
|
+
return l.push({
|
|
1217
|
+
id: "edit",
|
|
1218
|
+
label: "Edit",
|
|
1219
|
+
icon: Fe(),
|
|
1220
|
+
content: e.editContent ?? Ye()
|
|
1221
|
+
}), l.push({
|
|
1222
|
+
id: "controls",
|
|
1223
|
+
label: "Controls",
|
|
1224
|
+
icon: Xe(),
|
|
1225
|
+
content: e.controlsContent ?? Ke()
|
|
1226
|
+
}), l.push({
|
|
1227
|
+
id: "debug",
|
|
1228
|
+
label: "Debug",
|
|
1229
|
+
icon: qe(),
|
|
1230
|
+
content: e.debugContent ?? Ze()
|
|
1231
|
+
}), l;
|
|
1232
|
+
}, s = async () => {
|
|
1233
|
+
if (e.debugData !== void 0)
|
|
1234
|
+
try {
|
|
1235
|
+
const l = typeof e.debugData == "string" ? e.debugData : JSON.stringify(e.debugData, null, 2);
|
|
1236
|
+
await navigator.clipboard.writeText(l);
|
|
1237
|
+
} catch {
|
|
1238
|
+
}
|
|
1239
|
+
}, o = () => {
|
|
1240
|
+
const l = a();
|
|
1241
|
+
return l.find((v) => v.id === n())?.content ?? l[0]?.content;
|
|
1242
|
+
}, c = e.ResponsiveDialog, g = e.ResponsiveDialogContent, d = e.ResponsiveDialogHeader, x = e.ResponsiveDialogTitle, S = e.ResponsiveDialogDescription, u = e.Button;
|
|
1243
|
+
return O(c, {
|
|
1244
|
+
get open() {
|
|
1245
|
+
return e.open;
|
|
1246
|
+
},
|
|
1247
|
+
get onOpenChange() {
|
|
1248
|
+
return e.onOpenChange;
|
|
1249
|
+
},
|
|
1250
|
+
get children() {
|
|
1251
|
+
return O(g, {
|
|
1252
|
+
get class() {
|
|
1253
|
+
return w(r(), e.class);
|
|
1254
|
+
},
|
|
1255
|
+
get children() {
|
|
1256
|
+
return [O(d, {
|
|
1257
|
+
class: "flex flex-row items-center justify-between gap-3",
|
|
1258
|
+
get children() {
|
|
1259
|
+
return [(() => {
|
|
1260
|
+
var l = Qe();
|
|
1261
|
+
return f(l, O(x, {
|
|
1262
|
+
class: "truncate leading-tight",
|
|
1263
|
+
get children() {
|
|
1264
|
+
return e.title;
|
|
1265
|
+
}
|
|
1266
|
+
}), null), f(l, O(S, {
|
|
1267
|
+
class: "sr-only",
|
|
1268
|
+
children: "Widget configuration dialog"
|
|
1269
|
+
}), null), l;
|
|
1270
|
+
})(), (() => {
|
|
1271
|
+
var l = Je(), b = l.firstChild;
|
|
1272
|
+
return f(b, () => a().map((v) => O(nn, {
|
|
1273
|
+
get icon() {
|
|
1274
|
+
return v.icon;
|
|
1275
|
+
},
|
|
1276
|
+
get label() {
|
|
1277
|
+
return v.label;
|
|
1278
|
+
},
|
|
1279
|
+
get isActive() {
|
|
1280
|
+
return n() === v.id;
|
|
1281
|
+
},
|
|
1282
|
+
onClick: () => i(v.id)
|
|
1283
|
+
}))), f(l, O(X, {
|
|
1284
|
+
get when() {
|
|
1285
|
+
return e.headerActions;
|
|
1286
|
+
},
|
|
1287
|
+
get children() {
|
|
1288
|
+
return e.headerActions;
|
|
1289
|
+
}
|
|
1290
|
+
}), null), f(l, O(X, {
|
|
1291
|
+
get when() {
|
|
1292
|
+
return D(() => !!(n() === "edit" && e.onSave))() && e.hasUnsavedChanges;
|
|
1293
|
+
},
|
|
1294
|
+
get children() {
|
|
1295
|
+
return O(u, {
|
|
1296
|
+
size: "sm",
|
|
1297
|
+
onClick: () => e.onSave?.(),
|
|
1298
|
+
children: "Save"
|
|
1299
|
+
});
|
|
1300
|
+
}
|
|
1301
|
+
}), null), f(l, O(X, {
|
|
1302
|
+
get when() {
|
|
1303
|
+
return D(() => n() === "edit")() && e.onDelete;
|
|
1304
|
+
},
|
|
1305
|
+
get children() {
|
|
1306
|
+
return O(u, {
|
|
1307
|
+
size: "sm",
|
|
1308
|
+
variant: "destructive",
|
|
1309
|
+
onClick: () => e.onDelete?.(),
|
|
1310
|
+
children: "Delete"
|
|
1311
|
+
});
|
|
1312
|
+
}
|
|
1313
|
+
}), null), l;
|
|
1314
|
+
})()];
|
|
1315
|
+
}
|
|
1316
|
+
}), (() => {
|
|
1317
|
+
var l = tn();
|
|
1318
|
+
return f(l, o), l;
|
|
1319
|
+
})(), O(X, {
|
|
1320
|
+
get when() {
|
|
1321
|
+
return D(() => n() === "debug")() && e.debugData !== void 0;
|
|
1322
|
+
},
|
|
1323
|
+
get children() {
|
|
1324
|
+
var l = en();
|
|
1325
|
+
return f(l, O(u, {
|
|
1326
|
+
size: "sm",
|
|
1327
|
+
variant: "outline",
|
|
1328
|
+
onClick: s,
|
|
1329
|
+
children: "Copy"
|
|
1330
|
+
})), l;
|
|
1331
|
+
}
|
|
1332
|
+
})];
|
|
1333
|
+
}
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
pt(["click"]);
|
|
1339
|
+
const q = 32, m = q / 2, H = "white", J = "rgba(0,0,0,0.4)", ot = 2, tt = 3;
|
|
1340
|
+
function rn(t) {
|
|
1341
|
+
return `url("data:image/svg+xml,${encodeURIComponent(t)}")`;
|
|
1342
|
+
}
|
|
1343
|
+
function et(t) {
|
|
1344
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${q}" height="${q}" viewBox="0 0 ${q} ${q}">${t}</svg>`;
|
|
1345
|
+
}
|
|
1346
|
+
const an = et(`
|
|
1347
|
+
<g transform="translate(6, 2)">
|
|
1348
|
+
<!-- shadow -->
|
|
1349
|
+
<g stroke="${J}" stroke-width="${tt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1350
|
+
<path d="M10 8V3a2 2 0 0 1 4 0v10l4.5-4.5a2 2 0 0 1 2.83 2.83L14 18.5c-2 2-4 3.5-8 3.5-3 0-5-2-5-5v-6a2 2 0 0 1 4 0v2"/>
|
|
1351
|
+
</g>
|
|
1352
|
+
<!-- main -->
|
|
1353
|
+
<g stroke="${H}" stroke-width="${ot}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1354
|
+
<path d="M10 8V3a2 2 0 0 1 4 0v10l4.5-4.5a2 2 0 0 1 2.83 2.83L14 18.5c-2 2-4 3.5-8 3.5-3 0-5-2-5-5v-6a2 2 0 0 1 4 0v2"/>
|
|
1355
|
+
</g>
|
|
1356
|
+
</g>
|
|
1357
|
+
`), sn = et(`
|
|
1358
|
+
<g>
|
|
1359
|
+
<circle cx="${m}" cy="${m}" r="8" stroke="${J}" stroke-width="${tt}" fill="none"/>
|
|
1360
|
+
<circle cx="${m}" cy="${m}" r="8" stroke="${H}" stroke-width="1.5" fill="none"/>
|
|
1361
|
+
<circle cx="${m}" cy="${m}" r="1.5" fill="${H}"/>
|
|
1362
|
+
</g>
|
|
1363
|
+
`), on = et(`
|
|
1364
|
+
<g>
|
|
1365
|
+
<!-- shadow -->
|
|
1366
|
+
<g stroke="${J}" stroke-width="${tt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1367
|
+
<line x1="6" y1="${m}" x2="26" y2="${m}"/>
|
|
1368
|
+
<polyline points="10,${m - 4} 6,${m} 10,${m + 4}"/>
|
|
1369
|
+
<polyline points="22,${m - 4} 26,${m} 22,${m + 4}"/>
|
|
1370
|
+
</g>
|
|
1371
|
+
<!-- main -->
|
|
1372
|
+
<g stroke="${H}" stroke-width="${ot}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1373
|
+
<line x1="6" y1="${m}" x2="26" y2="${m}"/>
|
|
1374
|
+
<polyline points="10,${m - 4} 6,${m} 10,${m + 4}"/>
|
|
1375
|
+
<polyline points="22,${m - 4} 26,${m} 22,${m + 4}"/>
|
|
1376
|
+
</g>
|
|
1377
|
+
<!-- center grip dots -->
|
|
1378
|
+
<circle cx="${m}" cy="${m}" r="1.5" fill="${H}"/>
|
|
1379
|
+
<circle cx="${m - 5}" cy="${m}" r="1" fill="${H}" opacity="0.6"/>
|
|
1380
|
+
<circle cx="${m + 5}" cy="${m}" r="1" fill="${H}" opacity="0.6"/>
|
|
1381
|
+
</g>
|
|
1382
|
+
`), ln = et(`
|
|
1383
|
+
<g>
|
|
1384
|
+
<!-- shadow -->
|
|
1385
|
+
<g stroke="${J}" stroke-width="${tt}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1386
|
+
<line x1="${m}" y1="6" x2="${m}" y2="26"/>
|
|
1387
|
+
<polyline points="${m - 4},10 ${m},6 ${m + 4},10"/>
|
|
1388
|
+
<polyline points="${m - 4},22 ${m},26 ${m + 4},22"/>
|
|
1389
|
+
</g>
|
|
1390
|
+
<!-- main -->
|
|
1391
|
+
<g stroke="${H}" stroke-width="${ot}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1392
|
+
<line x1="${m}" y1="6" x2="${m}" y2="26"/>
|
|
1393
|
+
<polyline points="${m - 4},10 ${m},6 ${m + 4},10"/>
|
|
1394
|
+
<polyline points="${m - 4},22 ${m},26 ${m + 4},22"/>
|
|
1395
|
+
</g>
|
|
1396
|
+
<!-- center grip dots -->
|
|
1397
|
+
<circle cx="${m}" cy="${m}" r="1.5" fill="${H}"/>
|
|
1398
|
+
<circle cx="${m}" cy="${m - 5}" r="1" fill="${H}" opacity="0.6"/>
|
|
1399
|
+
<circle cx="${m}" cy="${m + 5}" r="1" fill="${H}" opacity="0.6"/>
|
|
1400
|
+
</g>
|
|
1401
|
+
`);
|
|
1402
|
+
function Z(t, e, n) {
|
|
1403
|
+
return { css: `${rn(t)} ${e} ${n}, auto`, hotspotX: e, hotspotY: n };
|
|
1404
|
+
}
|
|
1405
|
+
const F = {
|
|
1406
|
+
tap: Z(an, 12, 4),
|
|
1407
|
+
hold: Z(sn, 16, 16),
|
|
1408
|
+
slideHorizontal: Z(on, m, m),
|
|
1409
|
+
slideVertical: Z(ln, m, m)
|
|
1410
|
+
};
|
|
1411
|
+
function Wn(t, e) {
|
|
1412
|
+
const n = {
|
|
1413
|
+
isDown: !1,
|
|
1414
|
+
startX: 0,
|
|
1415
|
+
startY: 0,
|
|
1416
|
+
currentX: 0,
|
|
1417
|
+
currentY: 0,
|
|
1418
|
+
startTime: 0,
|
|
1419
|
+
hasMoved: !1,
|
|
1420
|
+
holdTimer: null,
|
|
1421
|
+
slideActive: !1,
|
|
1422
|
+
slideActivationTimer: null,
|
|
1423
|
+
lockedAxis: null,
|
|
1424
|
+
element: null
|
|
1425
|
+
}, i = 10, r = 5, a = () => {
|
|
1426
|
+
n.holdTimer && (clearTimeout(n.holdTimer), n.holdTimer = null), n.slideActivationTimer && (clearTimeout(n.slideActivationTimer), n.slideActivationTimer = null);
|
|
1427
|
+
}, s = (u) => {
|
|
1428
|
+
const b = t().slide;
|
|
1429
|
+
if (b?.orientation === "horizontal") return "horizontal";
|
|
1430
|
+
if (b?.orientation === "vertical") return "vertical";
|
|
1431
|
+
if (u) {
|
|
1432
|
+
const T = u.getBoundingClientRect();
|
|
1433
|
+
return T.height > T.width ? "vertical" : "horizontal";
|
|
1434
|
+
}
|
|
1435
|
+
return (e?.() ?? "horizontal") === "horizontal" ? "horizontal" : "vertical";
|
|
1436
|
+
}, o = (u) => {
|
|
1437
|
+
const l = t();
|
|
1438
|
+
if (!(!l.tap && !l.hold && !l.slide)) {
|
|
1439
|
+
if (n.isDown = !0, n.element = u.currentTarget, n.startX = u.clientX, n.startY = u.clientY, n.currentX = u.clientX, n.currentY = u.clientY, n.startTime = Date.now(), n.hasMoved = !1, n.slideActive = !1, n.lockedAxis = null, u.currentTarget.setPointerCapture(u.pointerId), l.hold) {
|
|
1440
|
+
const b = l.hold.delay ?? 300;
|
|
1441
|
+
n.holdTimer = setTimeout(() => {
|
|
1442
|
+
n.isDown && !n.hasMoved && (l.hold.action(), n.isDown = !1);
|
|
1443
|
+
}, b);
|
|
1444
|
+
}
|
|
1445
|
+
if (l.slide) {
|
|
1446
|
+
const b = l.slide.activationDelay ?? 0;
|
|
1447
|
+
b > 0 ? n.slideActivationTimer = setTimeout(() => {
|
|
1448
|
+
n.slideActive = !0;
|
|
1449
|
+
}, b) : n.slideActive = !0;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
}, c = (u) => {
|
|
1453
|
+
if (!n.isDown) return;
|
|
1454
|
+
const l = t();
|
|
1455
|
+
n.currentX = u.clientX, n.currentY = u.clientY;
|
|
1456
|
+
const b = n.currentX - n.startX, v = n.currentY - n.startY, T = Math.abs(b), $ = Math.abs(v), A = Math.sqrt(b * b + v * v), I = u.currentTarget, V = s(I);
|
|
1457
|
+
if (!n.lockedAxis && A > r && (T > $ ? n.lockedAxis = "horizontal" : n.lockedAxis = "vertical", l.slide && n.lockedAxis !== V)) {
|
|
1458
|
+
I.releasePointerCapture(u.pointerId), n.isDown = !1, n.slideActive = !1, a();
|
|
1459
|
+
return;
|
|
1460
|
+
}
|
|
1461
|
+
if (A > i && (n.hasMoved = !0, a()), l.slide && n.slideActive && n.hasMoved && n.lockedAxis === V) {
|
|
1462
|
+
const y = l.slide.min ?? 0, _ = l.slide.max ?? 100, G = _ - y, E = V === "vertical" ? -v : b, W = V === "vertical" ? u.currentTarget.clientHeight : u.currentTarget.clientWidth, vt = E / W * G, bt = Math.max(y, Math.min(_, l.slide.value + vt));
|
|
1463
|
+
l.slide.onChange(Math.round(bt)), n.startX = n.currentX, n.startY = n.currentY, u.preventDefault();
|
|
1464
|
+
}
|
|
1465
|
+
}, g = (u) => {
|
|
1466
|
+
if (!n.isDown) return;
|
|
1467
|
+
const l = t(), b = l.hold?.delay ?? 300;
|
|
1468
|
+
if (a(), l.tap && !n.hasMoved) {
|
|
1469
|
+
const v = Date.now() - n.startTime;
|
|
1470
|
+
n.isDown && v < b && l.tap();
|
|
1471
|
+
}
|
|
1472
|
+
n.isDown = !1, n.hasMoved = !1, n.slideActive = !1, n.lockedAxis = null, u.currentTarget.releasePointerCapture(u.pointerId);
|
|
1473
|
+
}, d = (u) => {
|
|
1474
|
+
a(), n.isDown = !1, n.hasMoved = !1, n.slideActive = !1, n.lockedAxis = null, u.currentTarget.releasePointerCapture(u.pointerId);
|
|
1475
|
+
}, x = (u) => {
|
|
1476
|
+
const l = t();
|
|
1477
|
+
if (l.slide) {
|
|
1478
|
+
const b = l.slide.orientation;
|
|
1479
|
+
if (b === "horizontal") return F.slideHorizontal.css;
|
|
1480
|
+
if (b === "vertical") return F.slideVertical.css;
|
|
1481
|
+
const v = u.getBoundingClientRect();
|
|
1482
|
+
return v.height > v.width ? F.slideVertical.css : F.slideHorizontal.css;
|
|
1483
|
+
}
|
|
1484
|
+
return l.tap ? F.tap.css : l.hold ? F.hold.css : "";
|
|
1485
|
+
};
|
|
1486
|
+
return {
|
|
1487
|
+
onPointerDown: o,
|
|
1488
|
+
onPointerMove: c,
|
|
1489
|
+
onPointerUp: g,
|
|
1490
|
+
onPointerCancel: d,
|
|
1491
|
+
onPointerEnter: (u) => {
|
|
1492
|
+
const l = u.currentTarget;
|
|
1493
|
+
n.element = l, l.style.cursor = x(l);
|
|
1494
|
+
},
|
|
1495
|
+
dispose: a
|
|
1496
|
+
};
|
|
1497
|
+
}
|
|
1498
|
+
function In(t) {
|
|
1499
|
+
return z(() => {
|
|
1500
|
+
const e = t.entities();
|
|
1501
|
+
if (e.length === 0) return;
|
|
1502
|
+
const n = {
|
|
1503
|
+
widgetConfig: t.widgetConfig,
|
|
1504
|
+
entities: e.map((i) => {
|
|
1505
|
+
const r = {
|
|
1506
|
+
entity_id: i.id,
|
|
1507
|
+
state: i.state,
|
|
1508
|
+
domain: i.domain,
|
|
1509
|
+
friendly_name: i.friendlyName
|
|
1510
|
+
};
|
|
1511
|
+
return t.customEntityFields ? {
|
|
1512
|
+
...r,
|
|
1513
|
+
...t.customEntityFields(i)
|
|
1514
|
+
} : r;
|
|
1515
|
+
})
|
|
1516
|
+
};
|
|
1517
|
+
return t.additionalData && Object.assign(n, t.additionalData), n;
|
|
1518
|
+
});
|
|
1519
|
+
}
|
|
1520
|
+
function Rn(t = {}) {
|
|
1521
|
+
const [e, n] = U(!1), [i, r] = U(!1);
|
|
1522
|
+
return {
|
|
1523
|
+
save: async (o) => {
|
|
1524
|
+
if (t.onSave) {
|
|
1525
|
+
n(!0);
|
|
1526
|
+
try {
|
|
1527
|
+
await t.onSave(o), t.onSaveSuccess?.();
|
|
1528
|
+
} finally {
|
|
1529
|
+
n(!1);
|
|
1530
|
+
}
|
|
1531
|
+
}
|
|
1532
|
+
},
|
|
1533
|
+
remove: async () => {
|
|
1534
|
+
if (t.onDelete) {
|
|
1535
|
+
r(!0);
|
|
1536
|
+
try {
|
|
1537
|
+
await t.onDelete(), t.onDeleteSuccess?.();
|
|
1538
|
+
} finally {
|
|
1539
|
+
r(!1);
|
|
1540
|
+
}
|
|
1541
|
+
}
|
|
1542
|
+
},
|
|
1543
|
+
isSaving: e,
|
|
1544
|
+
isDeleting: i
|
|
1545
|
+
};
|
|
1546
|
+
}
|
|
1547
|
+
function Gn(t = "edit") {
|
|
1548
|
+
const [e, n] = U(!1), [i, r] = U(t);
|
|
1549
|
+
return {
|
|
1550
|
+
showDialog: e,
|
|
1551
|
+
setShowDialog: n,
|
|
1552
|
+
openDialog: () => n(!0),
|
|
1553
|
+
closeDialog: () => n(!1),
|
|
1554
|
+
activeTab: i,
|
|
1555
|
+
setActiveTab: r
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
function Hn(t) {
|
|
1559
|
+
const e = z(() => t.entity() !== null), n = z(() => {
|
|
1560
|
+
const r = t.entity();
|
|
1561
|
+
return r ? t.calculateData(r) : null;
|
|
1562
|
+
}), i = z(() => e() ? void 0 : t.emptyStateConfig);
|
|
1563
|
+
return {
|
|
1564
|
+
entity: t.entity,
|
|
1565
|
+
data: n,
|
|
1566
|
+
emptyState: i,
|
|
1567
|
+
hasEntity: e
|
|
1568
|
+
};
|
|
1569
|
+
}
|
|
1570
|
+
function Bn(t) {
|
|
1571
|
+
const e = t.minEntities ?? 1, n = z(() => t.entities().length), i = z(() => n() >= e), r = z(() => !i() || !t.calculateGroupData ? null : t.calculateGroupData(t.entities())), a = z(() => {
|
|
1572
|
+
if (!i()) return;
|
|
1573
|
+
const o = t.aggregationMode?.();
|
|
1574
|
+
if (!o || o === "none") return;
|
|
1575
|
+
const c = t.entities();
|
|
1576
|
+
if (o === "light" || o === "binary-sensor" || o === "switch")
|
|
1577
|
+
return we(c, t.allEntitiesMode);
|
|
1578
|
+
if (o === "sensor") {
|
|
1579
|
+
const g = t.sensorGroupType?.() ?? "mean";
|
|
1580
|
+
return $e(c, g, !0);
|
|
1581
|
+
}
|
|
1582
|
+
}), s = z(() => i() ? void 0 : t.emptyStateConfig);
|
|
1583
|
+
return {
|
|
1584
|
+
entities: t.entities,
|
|
1585
|
+
groupData: r,
|
|
1586
|
+
aggregatedData: a,
|
|
1587
|
+
emptyState: s,
|
|
1588
|
+
hasEntities: i,
|
|
1589
|
+
count: n
|
|
1590
|
+
};
|
|
1591
|
+
}
|
|
1592
|
+
function Ln(t) {
|
|
1593
|
+
const [e] = zt({
|
|
1594
|
+
validate: Dt(t.schema),
|
|
1595
|
+
initialValues: t.initialValues
|
|
1596
|
+
}), n = z(() => e.dirty), i = z(() => e.submitting);
|
|
1597
|
+
return {
|
|
1598
|
+
form: e,
|
|
1599
|
+
isDirty: n,
|
|
1600
|
+
isSubmitting: i,
|
|
1601
|
+
handleSubmit: (a) => {
|
|
1602
|
+
t.onSubmit?.(a);
|
|
1603
|
+
},
|
|
1604
|
+
getValue: Nt,
|
|
1605
|
+
setValue: At,
|
|
1606
|
+
reset: _t
|
|
1607
|
+
};
|
|
1608
|
+
}
|
|
1609
|
+
const nt = ["xs", "sm", "md", "lg", "xl"];
|
|
1610
|
+
function jn() {
|
|
1611
|
+
const t = R(), e = z(() => nt.indexOf(t.size())), n = z(() => {
|
|
1612
|
+
const c = t.size();
|
|
1613
|
+
return c === "xs" || c === "sm";
|
|
1614
|
+
}), i = z(() => {
|
|
1615
|
+
const c = t.size();
|
|
1616
|
+
return c === "lg" || c === "xl";
|
|
1617
|
+
}), r = z(() => e() >= 2);
|
|
1618
|
+
return {
|
|
1619
|
+
isCompact: n,
|
|
1620
|
+
isLarge: i,
|
|
1621
|
+
showDetail: r,
|
|
1622
|
+
showOn: (c) => c.includes(t.size()),
|
|
1623
|
+
hideOn: (c) => !c.includes(t.size()),
|
|
1624
|
+
matches: (c) => {
|
|
1625
|
+
const g = c.trim();
|
|
1626
|
+
if (g.endsWith("+")) {
|
|
1627
|
+
const d = g.slice(0, -1), x = nt.indexOf(d);
|
|
1628
|
+
return x >= 0 && e() >= x;
|
|
1629
|
+
}
|
|
1630
|
+
if (g.endsWith("-")) {
|
|
1631
|
+
const d = g.slice(0, -1), x = nt.indexOf(d);
|
|
1632
|
+
return x >= 0 && e() <= x;
|
|
1633
|
+
}
|
|
1634
|
+
return t.size() === g;
|
|
1635
|
+
}
|
|
1636
|
+
};
|
|
1637
|
+
}
|
|
1638
|
+
const M = {
|
|
1639
|
+
ocean: "bg-gradient-to-br from-cyan-600/20 to-blue-700/20",
|
|
1640
|
+
sunset: "bg-gradient-to-br from-orange-500/20 to-purple-700/20",
|
|
1641
|
+
forest: "bg-gradient-to-br from-emerald-600/20 to-teal-700/20",
|
|
1642
|
+
lavender: "bg-gradient-to-br from-purple-500/20 to-pink-500/20",
|
|
1643
|
+
golden: "bg-gradient-to-br from-yellow-500/20 to-orange-600/20",
|
|
1644
|
+
midnight: "bg-gradient-to-br from-blue-700/20 to-indigo-900/20",
|
|
1645
|
+
rose: "bg-gradient-to-br from-pink-400/20 to-red-500/20",
|
|
1646
|
+
mint: "bg-gradient-to-br from-green-400/20 to-cyan-500/20",
|
|
1647
|
+
slate: "bg-gradient-to-br from-slate-600/20 to-slate-800/20",
|
|
1648
|
+
coral: "bg-gradient-to-br from-pink-300/20 to-rose-400/20",
|
|
1649
|
+
aurora: "bg-gradient-to-br from-blue-500/20 to-cyan-400/20",
|
|
1650
|
+
ember: "bg-gradient-to-br from-red-500/20 to-yellow-500/20",
|
|
1651
|
+
steel: "bg-gradient-to-br from-gray-500/20 to-gray-700/20",
|
|
1652
|
+
twilight: "bg-gradient-to-br from-violet-600/20 to-indigo-700/20",
|
|
1653
|
+
sage: "bg-gradient-to-br from-lime-600/20 to-green-600/20",
|
|
1654
|
+
copper: "bg-gradient-to-br from-amber-600/20 to-amber-800/20",
|
|
1655
|
+
dusk: "bg-gradient-to-br from-blue-500/20 to-purple-600/20"
|
|
1656
|
+
}, Pn = {
|
|
1657
|
+
ocean: "Ocean Breeze",
|
|
1658
|
+
sunset: "Sunset Glow",
|
|
1659
|
+
forest: "Forest Dawn",
|
|
1660
|
+
lavender: "Lavender Dreams",
|
|
1661
|
+
golden: "Golden Hour",
|
|
1662
|
+
midnight: "Deep Ocean",
|
|
1663
|
+
rose: "Rose Garden",
|
|
1664
|
+
mint: "Mint Fresh",
|
|
1665
|
+
slate: "Midnight",
|
|
1666
|
+
coral: "Cherry Blossom",
|
|
1667
|
+
aurora: "Electric Blue",
|
|
1668
|
+
ember: "Autumn Leaves",
|
|
1669
|
+
steel: "Steel",
|
|
1670
|
+
twilight: "Twilight",
|
|
1671
|
+
sage: "Sage",
|
|
1672
|
+
copper: "Copper",
|
|
1673
|
+
dusk: "Dusk"
|
|
1674
|
+
}, Un = Object.keys(M);
|
|
1675
|
+
function gt(t) {
|
|
1676
|
+
const e = Object.keys(M);
|
|
1677
|
+
let n = 0;
|
|
1678
|
+
for (const r of t)
|
|
1679
|
+
n = (n << 5) - n + r.charCodeAt(0), n = n & n;
|
|
1680
|
+
const i = Math.abs(n) % e.length;
|
|
1681
|
+
return e[i];
|
|
1682
|
+
}
|
|
1683
|
+
function Fn(t, e) {
|
|
1684
|
+
if (!t) {
|
|
1685
|
+
const i = gt(e);
|
|
1686
|
+
return M[i];
|
|
1687
|
+
}
|
|
1688
|
+
if (typeof t == "string" && t in M)
|
|
1689
|
+
return M[t];
|
|
1690
|
+
if (typeof t == "string")
|
|
1691
|
+
return t;
|
|
1692
|
+
const n = gt(e);
|
|
1693
|
+
return M[n];
|
|
1694
|
+
}
|
|
1695
|
+
const Y = {
|
|
1696
|
+
ocean: {
|
|
1697
|
+
gradient: M.ocean,
|
|
1698
|
+
bg: "bg-cyan-600/20",
|
|
1699
|
+
icon: "bg-cyan-500 dark:bg-cyan-400",
|
|
1700
|
+
glow: "shadow-cyan-500/50 dark:shadow-cyan-400/50",
|
|
1701
|
+
text: {
|
|
1702
|
+
primary: "text-cyan-400 dark:text-cyan-300",
|
|
1703
|
+
muted: "text-cyan-400/60 dark:text-cyan-300/60"
|
|
1704
|
+
}
|
|
1705
|
+
},
|
|
1706
|
+
sunset: {
|
|
1707
|
+
gradient: M.sunset,
|
|
1708
|
+
bg: "bg-orange-500/20",
|
|
1709
|
+
icon: "bg-orange-500 dark:bg-orange-400",
|
|
1710
|
+
glow: "shadow-orange-500/50 dark:shadow-orange-400/50",
|
|
1711
|
+
text: {
|
|
1712
|
+
primary: "text-orange-400 dark:text-orange-300",
|
|
1713
|
+
muted: "text-orange-400/60 dark:text-orange-300/60"
|
|
1714
|
+
}
|
|
1715
|
+
},
|
|
1716
|
+
forest: {
|
|
1717
|
+
gradient: M.forest,
|
|
1718
|
+
bg: "bg-emerald-600/20",
|
|
1719
|
+
icon: "bg-emerald-500 dark:bg-emerald-400",
|
|
1720
|
+
glow: "shadow-emerald-500/50 dark:shadow-emerald-400/50",
|
|
1721
|
+
text: {
|
|
1722
|
+
primary: "text-emerald-400 dark:text-emerald-300",
|
|
1723
|
+
muted: "text-emerald-400/60 dark:text-emerald-300/60"
|
|
1724
|
+
}
|
|
1725
|
+
},
|
|
1726
|
+
lavender: {
|
|
1727
|
+
gradient: M.lavender,
|
|
1728
|
+
bg: "bg-purple-500/20",
|
|
1729
|
+
icon: "bg-purple-500 dark:bg-purple-400",
|
|
1730
|
+
glow: "shadow-purple-500/50 dark:shadow-purple-400/50",
|
|
1731
|
+
text: {
|
|
1732
|
+
primary: "text-purple-400 dark:text-purple-300",
|
|
1733
|
+
muted: "text-purple-400/60 dark:text-purple-300/60"
|
|
1734
|
+
}
|
|
1735
|
+
},
|
|
1736
|
+
golden: {
|
|
1737
|
+
gradient: M.golden,
|
|
1738
|
+
bg: "bg-yellow-500/20",
|
|
1739
|
+
icon: "bg-yellow-500 dark:bg-yellow-400",
|
|
1740
|
+
glow: "shadow-yellow-500/50 dark:shadow-yellow-400/50",
|
|
1741
|
+
text: {
|
|
1742
|
+
primary: "text-yellow-400 dark:text-yellow-300",
|
|
1743
|
+
muted: "text-yellow-400/60 dark:text-yellow-300/60"
|
|
1744
|
+
}
|
|
1745
|
+
},
|
|
1746
|
+
midnight: {
|
|
1747
|
+
gradient: M.midnight,
|
|
1748
|
+
bg: "bg-blue-700/20",
|
|
1749
|
+
icon: "bg-blue-700 dark:bg-blue-600",
|
|
1750
|
+
glow: "shadow-blue-700/50 dark:shadow-blue-600/50",
|
|
1751
|
+
text: {
|
|
1752
|
+
primary: "text-blue-400 dark:text-blue-300",
|
|
1753
|
+
muted: "text-blue-400/60 dark:text-blue-300/60"
|
|
1754
|
+
}
|
|
1755
|
+
},
|
|
1756
|
+
rose: {
|
|
1757
|
+
gradient: M.rose,
|
|
1758
|
+
bg: "bg-pink-400/20",
|
|
1759
|
+
icon: "bg-pink-500 dark:bg-pink-400",
|
|
1760
|
+
glow: "shadow-pink-500/50 dark:shadow-pink-400/50",
|
|
1761
|
+
text: {
|
|
1762
|
+
primary: "text-pink-400 dark:text-pink-300",
|
|
1763
|
+
muted: "text-pink-400/60 dark:text-pink-300/60"
|
|
1764
|
+
}
|
|
1765
|
+
},
|
|
1766
|
+
mint: {
|
|
1767
|
+
gradient: M.mint,
|
|
1768
|
+
bg: "bg-green-400/20",
|
|
1769
|
+
icon: "bg-green-500 dark:bg-green-400",
|
|
1770
|
+
glow: "shadow-green-500/50 dark:shadow-green-400/50",
|
|
1771
|
+
text: {
|
|
1772
|
+
primary: "text-green-400 dark:text-green-300",
|
|
1773
|
+
muted: "text-green-400/60 dark:text-green-300/60"
|
|
1774
|
+
}
|
|
1775
|
+
},
|
|
1776
|
+
slate: {
|
|
1777
|
+
gradient: M.slate,
|
|
1778
|
+
bg: "bg-slate-600/20",
|
|
1779
|
+
icon: "bg-slate-600 dark:bg-slate-500",
|
|
1780
|
+
glow: "shadow-slate-600/50 dark:shadow-slate-500/50",
|
|
1781
|
+
text: {
|
|
1782
|
+
primary: "text-slate-400 dark:text-slate-300",
|
|
1783
|
+
muted: "text-slate-400/60 dark:text-slate-300/60"
|
|
1784
|
+
}
|
|
1785
|
+
},
|
|
1786
|
+
coral: {
|
|
1787
|
+
gradient: M.coral,
|
|
1788
|
+
bg: "bg-pink-300/20",
|
|
1789
|
+
icon: "bg-pink-400 dark:bg-pink-300",
|
|
1790
|
+
glow: "shadow-pink-400/50 dark:shadow-pink-300/50",
|
|
1791
|
+
text: {
|
|
1792
|
+
primary: "text-pink-400 dark:text-pink-300",
|
|
1793
|
+
muted: "text-pink-400/60 dark:text-pink-300/60"
|
|
1794
|
+
}
|
|
1795
|
+
},
|
|
1796
|
+
aurora: {
|
|
1797
|
+
gradient: M.aurora,
|
|
1798
|
+
bg: "bg-blue-500/20",
|
|
1799
|
+
icon: "bg-blue-500 dark:bg-blue-400",
|
|
1800
|
+
glow: "shadow-blue-500/50 dark:shadow-blue-400/50",
|
|
1801
|
+
text: {
|
|
1802
|
+
primary: "text-blue-400 dark:text-blue-300",
|
|
1803
|
+
muted: "text-blue-400/60 dark:text-blue-300/60"
|
|
1804
|
+
}
|
|
1805
|
+
},
|
|
1806
|
+
ember: {
|
|
1807
|
+
gradient: M.ember,
|
|
1808
|
+
bg: "bg-red-500/20",
|
|
1809
|
+
icon: "bg-red-500 dark:bg-red-400",
|
|
1810
|
+
glow: "shadow-red-500/50 dark:shadow-red-400/50",
|
|
1811
|
+
text: {
|
|
1812
|
+
primary: "text-red-400 dark:text-red-300",
|
|
1813
|
+
muted: "text-red-400/60 dark:text-red-300/60"
|
|
1814
|
+
}
|
|
1815
|
+
},
|
|
1816
|
+
steel: {
|
|
1817
|
+
gradient: M.steel,
|
|
1818
|
+
bg: "bg-gray-500/20",
|
|
1819
|
+
icon: "bg-gray-500 dark:bg-gray-400",
|
|
1820
|
+
glow: void 0,
|
|
1821
|
+
text: {
|
|
1822
|
+
primary: "text-gray-400 dark:text-gray-300",
|
|
1823
|
+
muted: "text-gray-400/60 dark:text-gray-300/60"
|
|
1824
|
+
}
|
|
1825
|
+
},
|
|
1826
|
+
twilight: {
|
|
1827
|
+
gradient: M.twilight,
|
|
1828
|
+
bg: "bg-violet-600/20",
|
|
1829
|
+
icon: "bg-violet-500 dark:bg-violet-400",
|
|
1830
|
+
glow: "shadow-violet-500/50 dark:shadow-violet-400/50",
|
|
1831
|
+
text: {
|
|
1832
|
+
primary: "text-violet-400 dark:text-violet-300",
|
|
1833
|
+
muted: "text-violet-400/60 dark:text-violet-300/60"
|
|
1834
|
+
}
|
|
1835
|
+
},
|
|
1836
|
+
sage: {
|
|
1837
|
+
gradient: M.sage,
|
|
1838
|
+
bg: "bg-lime-600/20",
|
|
1839
|
+
icon: "bg-lime-500 dark:bg-lime-400",
|
|
1840
|
+
glow: "shadow-lime-500/50 dark:shadow-lime-400/50",
|
|
1841
|
+
text: {
|
|
1842
|
+
primary: "text-lime-400 dark:text-lime-300",
|
|
1843
|
+
muted: "text-lime-400/60 dark:text-lime-300/60"
|
|
1844
|
+
}
|
|
1845
|
+
},
|
|
1846
|
+
copper: {
|
|
1847
|
+
gradient: M.copper,
|
|
1848
|
+
bg: "bg-amber-600/20",
|
|
1849
|
+
icon: "bg-amber-600 dark:bg-amber-500",
|
|
1850
|
+
glow: "shadow-amber-600/50 dark:shadow-amber-500/50",
|
|
1851
|
+
text: {
|
|
1852
|
+
primary: "text-amber-400 dark:text-amber-300",
|
|
1853
|
+
muted: "text-amber-400/60 dark:text-amber-300/60"
|
|
1854
|
+
}
|
|
1855
|
+
},
|
|
1856
|
+
dusk: {
|
|
1857
|
+
gradient: M.dusk,
|
|
1858
|
+
bg: "bg-blue-500/20",
|
|
1859
|
+
icon: "bg-blue-500 dark:bg-blue-400",
|
|
1860
|
+
glow: "shadow-blue-500/50 dark:shadow-blue-400/50",
|
|
1861
|
+
text: {
|
|
1862
|
+
primary: "text-blue-400 dark:text-blue-300",
|
|
1863
|
+
muted: "text-blue-400/60 dark:text-blue-300/60"
|
|
1864
|
+
}
|
|
1865
|
+
}
|
|
1866
|
+
}, Yn = {
|
|
1867
|
+
unavailable: Y.steel,
|
|
1868
|
+
active: Y.ocean,
|
|
1869
|
+
inactive: Y.steel,
|
|
1870
|
+
success: Y.forest,
|
|
1871
|
+
warning: Y.ember,
|
|
1872
|
+
error: Y.rose
|
|
1873
|
+
};
|
|
1874
|
+
let rt = null;
|
|
1875
|
+
function cn() {
|
|
1876
|
+
return rt || (rt = getComputedStyle(document.documentElement)), rt;
|
|
1877
|
+
}
|
|
1878
|
+
function Xn(t) {
|
|
1879
|
+
const e = t.startsWith("--") ? t : `--${t}`;
|
|
1880
|
+
return cn().getPropertyValue(e).trim();
|
|
1881
|
+
}
|
|
1882
|
+
function Kn() {
|
|
1883
|
+
return document.documentElement.classList.contains("dark");
|
|
1884
|
+
}
|
|
1885
|
+
const qn = "0.2.0";
|
|
1886
|
+
export {
|
|
1887
|
+
Pn as GRADIENT_NAMES,
|
|
1888
|
+
M as GRADIENT_PRESETS,
|
|
1889
|
+
Un as GRADIENT_PRESET_KEYS,
|
|
1890
|
+
En as Glow,
|
|
1891
|
+
qn as SDK_VERSION,
|
|
1892
|
+
j as WIDGET_Z,
|
|
1893
|
+
P as Widget,
|
|
1894
|
+
Yt as WidgetContent,
|
|
1895
|
+
it as WidgetCtx,
|
|
1896
|
+
Vn as WidgetDialog,
|
|
1897
|
+
Jt as WidgetEmptyState,
|
|
1898
|
+
se as WidgetIcon,
|
|
1899
|
+
xt as WidgetMetrics,
|
|
1900
|
+
jt as WidgetSliderFill,
|
|
1901
|
+
On as WidgetStack,
|
|
1902
|
+
fe as WidgetStatus,
|
|
1903
|
+
xe as WidgetSubtitle,
|
|
1904
|
+
ye as WidgetTitle,
|
|
1905
|
+
De as WidgetValue,
|
|
1906
|
+
Nn as allEntitiesInState,
|
|
1907
|
+
Tn as anyEntityInState,
|
|
1908
|
+
pn as applyCssVars,
|
|
1909
|
+
kn as applyLayout,
|
|
1910
|
+
at as builtInVariants,
|
|
1911
|
+
we as calculateLightGroup,
|
|
1912
|
+
$e as calculateSensorGroup,
|
|
1913
|
+
Tt as classicGlass,
|
|
1914
|
+
w as cn,
|
|
1915
|
+
Ot as compactHorizontal,
|
|
1916
|
+
$n as composeVariants,
|
|
1917
|
+
An as countActiveEntities,
|
|
1918
|
+
_n as countAvailableEntities,
|
|
1919
|
+
Dn as countEntitiesByState,
|
|
1920
|
+
Cn as createEmptyStateConfig,
|
|
1921
|
+
xn as createEntity,
|
|
1922
|
+
Sn as createFlexLayout,
|
|
1923
|
+
vn as defineWidget,
|
|
1924
|
+
ie as deriveAdaptiveIconColors,
|
|
1925
|
+
wn as extendVariant,
|
|
1926
|
+
Se as formatValue,
|
|
1927
|
+
Vt as getBuiltInVariant,
|
|
1928
|
+
yn as getBuiltInVariantIds,
|
|
1929
|
+
zn as getEntityAttribute,
|
|
1930
|
+
Mn as getEntityState,
|
|
1931
|
+
Fn as getGradient,
|
|
1932
|
+
gt as getGradientFromString,
|
|
1933
|
+
Ut as getSpacingClass,
|
|
1934
|
+
Xn as getThemeToken,
|
|
1935
|
+
Y as gradientColorPresets,
|
|
1936
|
+
Ce as interpretValue,
|
|
1937
|
+
bn as isBuiltInVariant,
|
|
1938
|
+
Kn as isDark,
|
|
1939
|
+
pe as isEntityActive,
|
|
1940
|
+
ke as isEntityAvailable,
|
|
1941
|
+
st as mergeVariants,
|
|
1942
|
+
Et as minimal,
|
|
1943
|
+
N as spacing,
|
|
1944
|
+
Yn as stateColors,
|
|
1945
|
+
B as typography,
|
|
1946
|
+
In as useDebugData,
|
|
1947
|
+
Rn as useWidgetConfig,
|
|
1948
|
+
R as useWidgetContext,
|
|
1949
|
+
Gn as useWidgetDialog,
|
|
1950
|
+
Hn as useWidgetEntity,
|
|
1951
|
+
Bn as useWidgetEntityGroup,
|
|
1952
|
+
Ln as useWidgetForm,
|
|
1953
|
+
Wn as useWidgetGestures,
|
|
1954
|
+
jn as useWidgetResponsive
|
|
1955
|
+
};
|