@glasshome/widget-sdk 1.13.0 → 1.14.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/dist/framework/dialogs/WidgetDialog.d.ts +15 -2
- package/dist/index.js +441 -422
- package/dist/ui.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -2,14 +2,14 @@ import { deprecate as e, deprecations as t, formatDeprecation as n } from "./dep
|
|
|
2
2
|
import { WidgetManifestSchema as r, formatSchemaError as i } from "./schemas.js";
|
|
3
3
|
import { z as a, z as o } from "zod";
|
|
4
4
|
import { getForecasts as s, getStream as c, getWebRtcClientConfig as l, hassMediaUrl as u, sendWebRtcCandidate as d, startWebRtcSession as f, state as p, trackEntityHistory as m, untrackEntityHistory as h } from "@glasshome/sync-layer";
|
|
5
|
-
import { byDomain as g, useArea as _, useCalendarEvents as v, useCamera as ee, useConnection as y, useCurrency as b, useEntities as te, useEntity as ne, useEntityHistory as re, useEntityStatistics as
|
|
6
|
-
import { Show as
|
|
7
|
-
import { addEventListener as
|
|
8
|
-
import { clsx as
|
|
9
|
-
import { twMerge as
|
|
10
|
-
import { Badge as
|
|
5
|
+
import { byDomain as g, useArea as _, useCalendarEvents as v, useCamera as ee, useConnection as y, useCurrency as b, useEntities as te, useEntity as ne, useEntityHistory as re, useEntityStatistics as ie, useForecast as ae, useHassConfig as oe, useLocale as se, useService as ce, useStore as x, useTemperatureUnit as S, useToggle as le, useTurnOff as ue, useTurnOn as C, useUnitSystem as w } from "@glasshome/sync-layer/solid";
|
|
6
|
+
import { For as de, Show as T, createContext as fe, createEffect as pe, createMemo as E, createSignal as D, on as me, onCleanup as O, onMount as he, splitProps as ge, useContext as k } from "solid-js";
|
|
7
|
+
import { addEventListener as A, className as j, createComponent as M, effect as N, insert as P, memo as F, setStyleProperty as I, style as _e, template as L, use as ve } from "solid-js/web";
|
|
8
|
+
import { clsx as ye } from "clsx";
|
|
9
|
+
import { twMerge as be } from "tailwind-merge";
|
|
10
|
+
import { Badge as xe, Button as Se, Carousel as Ce, CarouselContent as we, CarouselDots as Te, CarouselItem as Ee, CarouselNext as De, CarouselPrevious as Oe, ColorSlider as ke, ColorWheel as Ae, Input as je, Label as Me, ResponsiveDialog as Ne, ResponsiveDialogBody as Pe, ResponsiveDialogBody as Fe, ResponsiveDialogClose as Ie, ResponsiveDialogContent as Le, ResponsiveDialogDescription as Re, ResponsiveDialogFooter as ze, ResponsiveDialogFooter as Be, ResponsiveDialogHeader as Ve, ResponsiveDialogTitle as He, SchemaForm as Ue, Select as We, SelectContent as Ge, SelectItem as Ke, SelectTrigger as qe, SelectValue as Je, Slider as Ye, Switch as Xe, Tabs as Ze, Tabs as Qe, TabsContent as $e, TabsContent as et, TabsList as tt, TabsList as nt, TabsTrigger as rt, TabsTrigger as it, imageUrl as at, mediaUrl as ot, parseColor as st } from "@glasshome/ui/solid";
|
|
11
11
|
//#region src/framework/to-form-schema.ts
|
|
12
|
-
function
|
|
12
|
+
function ct(e) {
|
|
13
13
|
return o.toJSONSchema(e, { override: (e) => {
|
|
14
14
|
let t = o.globalRegistry.get(e.zodSchema);
|
|
15
15
|
return t && typeof t == "object" && Object.keys(t).length > 0 ? {
|
|
@@ -18,7 +18,7 @@ function Xe(e) {
|
|
|
18
18
|
} : e.jsonSchema;
|
|
19
19
|
} });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function lt(e) {
|
|
22
22
|
try {
|
|
23
23
|
return e.parse({});
|
|
24
24
|
} catch {
|
|
@@ -27,92 +27,92 @@ function Ze(e) {
|
|
|
27
27
|
}
|
|
28
28
|
//#endregion
|
|
29
29
|
//#region src/define-widget.ts
|
|
30
|
-
function
|
|
31
|
-
return e.configSchema && (e.manifest.schema || (e.manifest.schema =
|
|
30
|
+
function ut(e) {
|
|
31
|
+
return e.configSchema && (e.manifest.schema || (e.manifest.schema = ct(e.configSchema)), e.manifest.defaultConfig || (e.manifest.defaultConfig = lt(e.configSchema))), e;
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/framework/hooks/use-widget-context.ts
|
|
35
|
-
var
|
|
36
|
-
function
|
|
37
|
-
let e =
|
|
35
|
+
var R = fe();
|
|
36
|
+
function dt() {
|
|
37
|
+
let e = k(R);
|
|
38
38
|
if (!e) throw Error("useWidgetContext must be used within a Widget component");
|
|
39
39
|
return e;
|
|
40
40
|
}
|
|
41
41
|
//#endregion
|
|
42
42
|
//#region src/framework/hooks/use-service.ts
|
|
43
|
-
function
|
|
43
|
+
function ft(e) {
|
|
44
44
|
let t = Array.isArray(e) ? e[0] : e, n = t?.split(".")[0];
|
|
45
45
|
if (!n) throw Error(`Invalid entity ID: ${String(t)}`);
|
|
46
46
|
return n;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
48
|
+
function z(e, t) {
|
|
49
49
|
return async (n, r = {}) => {
|
|
50
|
-
await e(
|
|
50
|
+
await e(ft(n), t, r, { entity_id: n });
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
54
|
-
let e =
|
|
53
|
+
function pt() {
|
|
54
|
+
let e = k(R)?.callService;
|
|
55
55
|
return e ? {
|
|
56
56
|
callService: e,
|
|
57
|
-
turnOn:
|
|
58
|
-
turnOff:
|
|
59
|
-
toggle:
|
|
60
|
-
} :
|
|
57
|
+
turnOn: z(e, "turn_on"),
|
|
58
|
+
turnOff: z(e, "turn_off"),
|
|
59
|
+
toggle: z(e, "toggle")
|
|
60
|
+
} : ce();
|
|
61
61
|
}
|
|
62
|
-
function
|
|
63
|
-
let e =
|
|
64
|
-
return e ?
|
|
62
|
+
function mt() {
|
|
63
|
+
let e = k(R)?.callService;
|
|
64
|
+
return e ? z(e, "turn_on") : C();
|
|
65
65
|
}
|
|
66
|
-
function
|
|
67
|
-
let e =
|
|
68
|
-
return e ?
|
|
66
|
+
function ht() {
|
|
67
|
+
let e = k(R)?.callService;
|
|
68
|
+
return e ? z(e, "turn_off") : ue();
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
let e =
|
|
72
|
-
return e ?
|
|
70
|
+
function gt() {
|
|
71
|
+
let e = k(R)?.callService;
|
|
72
|
+
return e ? z(e, "toggle") : le();
|
|
73
73
|
}
|
|
74
74
|
//#endregion
|
|
75
75
|
//#region src/framework/design-system/z-index.ts
|
|
76
|
-
var
|
|
76
|
+
var B = {
|
|
77
77
|
BACKGROUND: 0,
|
|
78
78
|
CONTENT: 10,
|
|
79
79
|
OVERLAY: 20,
|
|
80
80
|
ACTIONS: 30
|
|
81
|
-
},
|
|
82
|
-
function
|
|
83
|
-
let e =
|
|
81
|
+
}, _t = fe();
|
|
82
|
+
function vt() {
|
|
83
|
+
let e = k(_t);
|
|
84
84
|
if (!e) throw Error("useWidgetDimensions must be called inside <Widget>: move the call into a component rendered within <Widget> (the top-level widget scope only sees the host stub).");
|
|
85
85
|
return e;
|
|
86
86
|
}
|
|
87
87
|
//#endregion
|
|
88
88
|
//#region src/framework/theming/tokens.css?raw
|
|
89
|
-
var
|
|
90
|
-
function
|
|
91
|
-
return
|
|
89
|
+
var yt = "/* Authoritative SDK CSS contract. Injected once on first Widget mount\n * via framework/theming/tokens.ts.\n *\n * All widget-internal visual scale is driven from CSS custom properties +\n * container queries on the `.glasshome-widget` shell (`container-type: size`).\n * No JS classifier, no size tier enum.\n */\n\n:root {\n --tone-success: oklch(0.70 0.18 145);\n --tone-warning: oklch(0.80 0.17 75);\n --tone-danger: oklch(0.64 0.22 27);\n --tone-info: oklch(0.66 0.20 245);\n --tone-neutral: oklch(0.65 0.02 250);\n --tone-accent: oklch(0.74 0.18 60);\n\n --widget-grad-strength: 1;\n --widget-glow-default: 0.4;\n --widget-border-highlight: oklch(0.98 0 0 / 0.4);\n}\n\n.dark {\n --tone-success: oklch(0.74 0.18 145);\n --tone-warning: oklch(0.82 0.17 75);\n --tone-danger: oklch(0.68 0.22 27);\n --tone-info: oklch(0.70 0.20 245);\n --tone-neutral: oklch(0.69 0.02 250);\n --tone-accent: oklch(0.78 0.18 60);\n\n --widget-grad-strength: 1.1;\n --widget-glow-default: 0.5;\n --widget-border-highlight: oklch(1 0 0 / 0.08);\n}\n\n@property --widget-color {\n syntax: \"<color>\";\n inherits: true;\n initial-value: oklch(0.65 0.02 250);\n}\n\n/* === Widget shell ===\n * Fluid scale tokens — tied to the shell's own container box (cqb=height, cqi=width).\n * Icon/pad/gap track HEIGHT (cqb) not the shortest side: two widgets of equal\n * height match regardless of width (a 2×2 and a 4×2 get the same icon). cqmin\n * starved portrait tiles by pinning the icon to the narrow width. Tune\n * multipliers / clamps to adjust density. */\n.glasshome-widget {\n --widget-color: var(--tone-neutral);\n --widget-glow-strength: var(--widget-glow-default);\n\n --widget-icon-box: clamp(44px, 25cqb, 58px);\n --widget-icon-glyph: clamp(24px, 14cqb, 33px);\n --widget-pad: clamp(8px, 3.5cqb, 22px);\n --widget-gap: clamp(6px, 2cqb, 14px);\n --widget-title-size: clamp(12px, 2cqi, 18px);\n --widget-subtitle: clamp(12px, 2.5cqi, 20px);\n --widget-status-size: clamp(14px, 5cqi, 36px);\n --widget-value-size: clamp(18px, 7cqi, 48px);\n --widget-badge-size: clamp(11px, 1.6cqi, 14px);\n}\n\n/* Shell material. Two channels, both host/variant-driven:\n * - `--widget-backdrop`: the live backdrop filter (the shared glass recipe is\n * blur + saturate, matching ui's CARD_BLUR). Default none — a variant opts\n * in (classic-glass), and a performant-blur host disables it via override\n * sheet when it paints a precomputed frost instead.\n * - `--glass-frost`: one full background layer (image + position / size +\n * repeat) composited at the BOTTOM, under the accent gradient — the same\n * frost slot ui's `.glass` formula ends its background list with. Unset →\n * none. A performant-blur host sets it per shell with the viewport-aligned\n * slice of its pre-blurred bitmap. */\n.glasshome-widget {\n background:\n var(--widget-gradient,\n linear-gradient(135deg,\n color-mix(in oklch, var(--widget-color) calc(22% * var(--widget-grad-strength)), transparent),\n color-mix(in oklch, var(--widget-color-to, var(--widget-color)) calc(11% * var(--widget-grad-strength)), transparent)\n )\n ),\n var(--glass-frost, none);\n backdrop-filter: var(--widget-backdrop, none);\n -webkit-backdrop-filter: var(--widget-backdrop, none);\n box-shadow: inset 0 1px 0 var(--widget-border-highlight);\n}\n\n/* === Slot: content layout === */\n/* Default: column. Flip to row only on wide-and-short widgets (matches the\n * old contentLayout heuristic: aspect > 1 AND height < 150px). */\n.glasshome-widget-content {\n position: relative;\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n width: 100%;\n height: 100%;\n padding: var(--widget-pad);\n gap: var(--widget-gap);\n overflow: hidden;\n}\n@container widget (min-aspect-ratio: 1) and (max-height: 149px) {\n .glasshome-widget-content {\n flex-direction: row;\n align-items: center;\n justify-content: flex-start;\n }\n}\n\n/* === Compact 1×1 ===\n * Small in BOTH axes → stack the tile: icon on top, label + status centered\n * under it. Icon stays moderate (not a hero) so the text keeps room. Wide\n * tiles (2×1) fail the width test and keep the row layout above. Placed after\n * the row-flip so it wins. */\n@container widget (max-width: 189px) and (max-height: 189px) {\n .glasshome-widget-content {\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n gap: clamp(4px, 2.5cqmin, 8px);\n }\n .glasshome-widget-content > * { align-items: center; text-align: center; }\n .glasshome-widget-icon {\n --widget-icon-box: clamp(36px, 30cqmin, 56px);\n --widget-icon-glyph: clamp(20px, 17cqmin, 32px);\n }\n .glasshome-widget-title { font-size: clamp(11px, 6cqmin, 14px); max-width: 100%; }\n .glasshome-widget-status,\n .glasshome-widget-value { font-size: clamp(13px, 7cqmin, 17px); }\n .glasshome-widget-content [class*=\"ml-auto\"] { margin-left: 0 !important; }\n}\n.glasshome-widget-content [class*=\"ml-auto\"] {\n position: relative;\n z-index: 30;\n}\n\n/* === Slot: icon === */\n.glasshome-widget-icon {\n width: var(--widget-icon-box);\n height: var(--widget-icon-box);\n border-radius: var(--radius-sm, 12px);\n background: var(--widget-icon-color, var(--widget-color));\n box-shadow: 0 0 calc(var(--widget-glow-strength) * 30px)\n color-mix(in oklch, var(--widget-icon-color, var(--widget-color)) 50%, transparent);\n color: oklch(from var(--widget-icon-color, var(--widget-color)) calc(0.52 + sign(0.5 - l) * 0.43) calc(c * 0.2) h);\n}\n.glasshome-widget-icon-glyph {\n font-size: var(--widget-icon-glyph);\n line-height: 1;\n}\n.glasshome-widget-icon-stack {\n position: absolute;\n width: 102%;\n height: 102%;\n border-radius: var(--radius-sm, 12px);\n}\n.glasshome-widget-icon-stack-2 { bottom: -14%; right: -10%; opacity: 0.45; z-index: -2; }\n.glasshome-widget-icon-stack-3 { bottom: -28%; right: -20%; opacity: 0.20; z-index: -3; }\n\n/* === Slot: text === */\n.glasshome-widget-title {\n font-size: var(--widget-title-size);\n line-height: 1.2;\n color: color-mix(in oklch, var(--color-foreground, currentColor) 60%, transparent);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.glasshome-widget-subtitle {\n font-size: var(--widget-subtitle);\n color: color-mix(in oklch, var(--color-foreground, currentColor) 60%, transparent);\n}\n.glasshome-widget-status {\n font-size: var(--widget-status-size);\n font-weight: 700;\n color: var(--color-foreground, currentColor);\n line-height: 1.1;\n}\n.glasshome-widget-value {\n font-size: var(--widget-value-size);\n font-weight: 700;\n color: var(--color-foreground, currentColor);\n line-height: 1.05;\n}\n.glasshome-widget-badge {\n font-size: var(--widget-badge-size);\n font-weight: 500;\n padding: 0.125rem 0.5rem;\n border-radius: 9999px;\n background: color-mix(in oklch, var(--color-foreground, currentColor) 20%, transparent);\n color: var(--color-foreground, currentColor);\n}\n\n.glasshome-widget-loading {\n background: color-mix(in oklch, var(--widget-color) 20%, transparent);\n}\n\n/* === Slider fill ===\n * Value flows in via --widget-fill-value (0-100). Vertical orientation auto-\n * detected via container query. */\n.glasshome-widget-slider-fill {\n --widget-fill-value: 0;\n background: color-mix(in oklch, var(--widget-icon-color, var(--widget-color)) 30%, transparent);\n box-shadow: 0 0 calc(var(--widget-glow-strength) * 40px)\n color-mix(in oklch, var(--widget-icon-color, var(--widget-color)) 40%, transparent);\n clip-path: inset(0 calc((100 - var(--widget-fill-value)) * 1%) 0 0);\n}\n@container widget (max-aspect-ratio: 1) {\n .glasshome-widget-slider-fill {\n clip-path: inset(calc((100 - var(--widget-fill-value)) * 1%) 0 0 0);\n }\n}\n", bt = !1, V, xt = /* @__PURE__ */ new WeakSet();
|
|
90
|
+
function St() {
|
|
91
|
+
return V || (V = new CSSStyleSheet(), V.replaceSync(yt.replace(/:root\b/g, ":host").replace(/^\.dark\b/gm, ":host(.dark)"))), V;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function Ct(e) {
|
|
94
94
|
if (typeof ShadowRoot < "u" && e instanceof ShadowRoot) {
|
|
95
|
-
if (
|
|
96
|
-
let t =
|
|
97
|
-
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]),
|
|
95
|
+
if (xt.has(e)) return;
|
|
96
|
+
let t = St();
|
|
97
|
+
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]), xt.add(e);
|
|
98
98
|
return;
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
100
|
+
if (bt) return;
|
|
101
101
|
let t = e ?? (typeof document > "u" ? void 0 : document);
|
|
102
102
|
if (!t) return;
|
|
103
103
|
if (t.head.querySelector?.("style[data-glasshome-tokens]")) {
|
|
104
|
-
|
|
104
|
+
bt = !0;
|
|
105
105
|
return;
|
|
106
106
|
}
|
|
107
107
|
let n = t.createElement("style");
|
|
108
|
-
n.setAttribute("data-glasshome-tokens", ""), n.textContent =
|
|
108
|
+
n.setAttribute("data-glasshome-tokens", ""), n.textContent = yt, t.head.appendChild(n), bt = !0;
|
|
109
109
|
}
|
|
110
110
|
//#endregion
|
|
111
111
|
//#region src/framework/utils/cn.ts
|
|
112
|
-
function
|
|
113
|
-
return
|
|
112
|
+
function H(...e) {
|
|
113
|
+
return be(ye(e));
|
|
114
114
|
}
|
|
115
|
-
var
|
|
115
|
+
var wt = {
|
|
116
116
|
"classic-glass": {
|
|
117
117
|
id: "classic-glass",
|
|
118
118
|
name: "Classic Glass",
|
|
@@ -194,22 +194,22 @@ var ft = {
|
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
};
|
|
197
|
-
function
|
|
198
|
-
return
|
|
197
|
+
function Tt(e) {
|
|
198
|
+
return wt[e];
|
|
199
199
|
}
|
|
200
200
|
//#endregion
|
|
201
201
|
//#region src/framework/backgrounds/WidgetSliderFill.tsx
|
|
202
|
-
var
|
|
203
|
-
function
|
|
202
|
+
var Et = /*#__PURE__*/ L("<div>");
|
|
203
|
+
function Dt(e) {
|
|
204
204
|
return (() => {
|
|
205
|
-
var t =
|
|
206
|
-
return
|
|
207
|
-
var r =
|
|
205
|
+
var t = Et();
|
|
206
|
+
return N((n) => {
|
|
207
|
+
var r = H("glasshome-widget-slider-fill pointer-events-none absolute inset-0", e.isDragging ? "duration-0" : "transition-all duration-300 ease-out", e.class), i = {
|
|
208
208
|
"--widget-fill-value": e.value,
|
|
209
|
-
"z-index":
|
|
209
|
+
"z-index": B.BACKGROUND,
|
|
210
210
|
...e.color ? { "--widget-icon-color": e.color } : {}
|
|
211
211
|
};
|
|
212
|
-
return r !== n.e &&
|
|
212
|
+
return r !== n.e && j(t, n.e = r), n.t = _e(t, i, n.t), n;
|
|
213
213
|
}, {
|
|
214
214
|
e: void 0,
|
|
215
215
|
t: void 0
|
|
@@ -218,37 +218,37 @@ function ht(e) {
|
|
|
218
218
|
}
|
|
219
219
|
//#endregion
|
|
220
220
|
//#region src/framework/components/WidgetContent.tsx
|
|
221
|
-
var
|
|
222
|
-
function
|
|
221
|
+
var Ot = /*#__PURE__*/ L("<div>");
|
|
222
|
+
function kt(e) {
|
|
223
223
|
return (() => {
|
|
224
|
-
var t =
|
|
225
|
-
return
|
|
224
|
+
var t = Ot();
|
|
225
|
+
return P(t, () => e.children), N(() => j(t, H("glasshome-widget-content", e.class))), t;
|
|
226
226
|
})();
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
229
|
//#region src/framework/components/WidgetIcon.tsx
|
|
230
|
-
var
|
|
231
|
-
function
|
|
230
|
+
var At = /*#__PURE__*/ L("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-2\">"), jt = /*#__PURE__*/ L("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-3\">"), Mt = /*#__PURE__*/ L("<div><div class=\"glasshome-widget-icon-glyph flex items-center justify-center\">");
|
|
231
|
+
function Nt(e) {
|
|
232
232
|
let t = () => e.entityCount ?? 1;
|
|
233
233
|
return (() => {
|
|
234
|
-
var n =
|
|
235
|
-
return
|
|
234
|
+
var n = Mt(), r = n.firstChild;
|
|
235
|
+
return P(n, M(T, {
|
|
236
236
|
get when() {
|
|
237
237
|
return t() >= 2;
|
|
238
238
|
},
|
|
239
239
|
get children() {
|
|
240
|
-
return
|
|
240
|
+
return At();
|
|
241
241
|
}
|
|
242
|
-
}), r),
|
|
242
|
+
}), r), P(n, M(T, {
|
|
243
243
|
get when() {
|
|
244
244
|
return t() >= 3;
|
|
245
245
|
},
|
|
246
246
|
get children() {
|
|
247
|
-
return
|
|
247
|
+
return jt();
|
|
248
248
|
}
|
|
249
|
-
}), r),
|
|
250
|
-
var r =
|
|
251
|
-
return r !== t.e &&
|
|
249
|
+
}), r), P(r, () => e.icon), N((t) => {
|
|
250
|
+
var r = H("glasshome-widget-icon", "relative flex shrink-0 items-center justify-center pointer-events-none transition-all", e.dimmed && "opacity-50", e.class), i = e.color ? { "--widget-icon-color": e.color } : void 0;
|
|
251
|
+
return r !== t.e && j(n, t.e = r), t.t = _e(n, i, t.t), t;
|
|
252
252
|
}, {
|
|
253
253
|
e: void 0,
|
|
254
254
|
t: void 0
|
|
@@ -257,16 +257,16 @@ function xt(e) {
|
|
|
257
257
|
}
|
|
258
258
|
//#endregion
|
|
259
259
|
//#region src/framework/components/WidgetStatus.tsx
|
|
260
|
-
var
|
|
261
|
-
function
|
|
260
|
+
var Pt = /*#__PURE__*/ L("<p>");
|
|
261
|
+
function Ft(e) {
|
|
262
262
|
return (() => {
|
|
263
|
-
var t =
|
|
264
|
-
return
|
|
265
|
-
var t =
|
|
263
|
+
var t = Pt();
|
|
264
|
+
return P(t, (() => {
|
|
265
|
+
var t = F(() => !!e.isUnavailable);
|
|
266
266
|
return () => t() ? "Unavailable" : e.children;
|
|
267
|
-
})()),
|
|
268
|
-
var r =
|
|
269
|
-
return r !== n.e &&
|
|
267
|
+
})()), N((n) => {
|
|
268
|
+
var r = H("glasshome-widget-status", "relative", e.dimmed && "opacity-40", e.class), i = B.ACTIONS;
|
|
269
|
+
return r !== n.e && j(t, n.e = r), i !== n.t && I(t, "z-index", n.t = i), n;
|
|
270
270
|
}, {
|
|
271
271
|
e: void 0,
|
|
272
272
|
t: void 0
|
|
@@ -275,21 +275,21 @@ function Ct(e) {
|
|
|
275
275
|
}
|
|
276
276
|
//#endregion
|
|
277
277
|
//#region src/framework/components/WidgetTitle.tsx
|
|
278
|
-
var
|
|
279
|
-
function
|
|
278
|
+
var It = /*#__PURE__*/ L("<span class=\"glasshome-widget-badge shrink-0\">"), Lt = /*#__PURE__*/ L("<div><h3 class=glasshome-widget-title>");
|
|
279
|
+
function Rt(e) {
|
|
280
280
|
return (() => {
|
|
281
|
-
var t =
|
|
282
|
-
return
|
|
281
|
+
var t = Lt(), n = t.firstChild;
|
|
282
|
+
return P(n, () => e.children), P(t, M(T, {
|
|
283
283
|
get when() {
|
|
284
|
-
return
|
|
284
|
+
return F(() => e.badge !== void 0)() && e.badge > 0;
|
|
285
285
|
},
|
|
286
286
|
get children() {
|
|
287
|
-
var t =
|
|
288
|
-
return
|
|
287
|
+
var t = It();
|
|
288
|
+
return P(t, () => e.badge), t;
|
|
289
289
|
}
|
|
290
|
-
}), null),
|
|
291
|
-
var r =
|
|
292
|
-
return r !== n.e &&
|
|
290
|
+
}), null), N((n) => {
|
|
291
|
+
var r = H("relative flex items-center gap-2", e.class), i = B.ACTIONS;
|
|
292
|
+
return r !== n.e && j(t, n.e = r), i !== n.t && I(t, "z-index", n.t = i), n;
|
|
293
293
|
}, {
|
|
294
294
|
e: void 0,
|
|
295
295
|
t: void 0
|
|
@@ -298,7 +298,7 @@ function Et(e) {
|
|
|
298
298
|
}
|
|
299
299
|
//#endregion
|
|
300
300
|
//#region src/framework/utils/entity-aggregation.ts
|
|
301
|
-
function
|
|
301
|
+
function zt(e, t = !1) {
|
|
302
302
|
if (e.length === 0) return {
|
|
303
303
|
isGroup: !1,
|
|
304
304
|
state: "unknown",
|
|
@@ -321,7 +321,7 @@ function Dt(e, t = !1) {
|
|
|
321
321
|
isUnavailable: t.state === "unavailable",
|
|
322
322
|
brightness: r,
|
|
323
323
|
brightnessPercent: i,
|
|
324
|
-
color:
|
|
324
|
+
color: Ht(t),
|
|
325
325
|
onCount: +!!n,
|
|
326
326
|
totalCount: 1,
|
|
327
327
|
description: n ? "On" : "Off"
|
|
@@ -333,7 +333,7 @@ function Dt(e, t = !1) {
|
|
|
333
333
|
if (r++, t.attributes?.brightness !== void 0 && (s += t.attributes.brightness, c++), t.attributes?.rgb_color) l.push(t.attributes.rgb_color);
|
|
334
334
|
else if (t.attributes?.hs_color) {
|
|
335
335
|
let [e, n] = t.attributes.hs_color;
|
|
336
|
-
l.push(
|
|
336
|
+
l.push(Vt(e, n));
|
|
337
337
|
}
|
|
338
338
|
break;
|
|
339
339
|
case "off":
|
|
@@ -350,7 +350,7 @@ function Dt(e, t = !1) {
|
|
|
350
350
|
if (l.length > 0) {
|
|
351
351
|
let e = Math.round(l.reduce((e, t) => e + t[0], 0) / l.length), t = Math.round(l.reduce((e, t) => e + t[1], 0) / l.length), n = Math.round(l.reduce((e, t) => e + t[2], 0) / l.length), r = v / 255;
|
|
352
352
|
y = `rgb(${Math.round(e * r)}, ${Math.round(t * r)}, ${Math.round(n * r)})`;
|
|
353
|
-
} else y =
|
|
353
|
+
} else y = Ht(e[0]);
|
|
354
354
|
let b;
|
|
355
355
|
return b = m ? "All on" : h ? "All off" : r > 0 ? `${r} of ${u} on` : "Off", {
|
|
356
356
|
isGroup: n,
|
|
@@ -365,7 +365,7 @@ function Dt(e, t = !1) {
|
|
|
365
365
|
description: b
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Bt(e, t = "mean", n = !0) {
|
|
369
369
|
if (e.length === 0) return {
|
|
370
370
|
isGroup: !1,
|
|
371
371
|
state: "unknown",
|
|
@@ -461,7 +461,7 @@ function Ot(e, t = "mean", n = !0) {
|
|
|
461
461
|
memberValues: a
|
|
462
462
|
};
|
|
463
463
|
}
|
|
464
|
-
function
|
|
464
|
+
function Vt(e, t) {
|
|
465
465
|
let n = t / 100, r = n * (1 - Math.abs(e / 60 % 2 - 1)), i = 1 - n, a = 0, o = 0, s = 0;
|
|
466
466
|
return e < 60 ? [a, o] = [n, r] : e < 120 ? [a, o] = [r, n] : e < 180 ? [o, s] = [n, r] : e < 240 ? [o, s] = [r, n] : e < 300 ? [a, s] = [r, n] : [a, s] = [n, r], [
|
|
467
467
|
(a + i) * 255,
|
|
@@ -469,7 +469,7 @@ function kt(e, t) {
|
|
|
469
469
|
(s + i) * 255
|
|
470
470
|
];
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function Ht(e) {
|
|
473
473
|
if (e.state !== "on") return "rgb(100, 100, 100)";
|
|
474
474
|
let t = (e.attributes?.brightness ?? 255) / 255;
|
|
475
475
|
if (e.attributes?.rgb_color) {
|
|
@@ -477,7 +477,7 @@ function At(e) {
|
|
|
477
477
|
return `rgb(${Math.round(n * t)}, ${Math.round(r * t)}, ${Math.round(i * t)})`;
|
|
478
478
|
}
|
|
479
479
|
if (e.attributes?.hs_color) {
|
|
480
|
-
let [n, r] = e.attributes.hs_color, [i, a, o] =
|
|
480
|
+
let [n, r] = e.attributes.hs_color, [i, a, o] = Vt(n, r);
|
|
481
481
|
return `rgb(${Math.round(i * t)}, ${Math.round(a * t)}, ${Math.round(o * t)})`;
|
|
482
482
|
}
|
|
483
483
|
if (e.attributes?.color_temp) {
|
|
@@ -488,7 +488,7 @@ function At(e) {
|
|
|
488
488
|
}
|
|
489
489
|
//#endregion
|
|
490
490
|
//#region src/framework/utils/entity-state.ts
|
|
491
|
-
function
|
|
491
|
+
function Ut(e) {
|
|
492
492
|
if (!e) return !1;
|
|
493
493
|
if ([
|
|
494
494
|
"on",
|
|
@@ -504,15 +504,15 @@ function jt(e) {
|
|
|
504
504
|
}
|
|
505
505
|
return !1;
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Wt(e, t, n) {
|
|
508
508
|
return e?.attributes ? e.attributes[t] ?? n : n;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
return e.filter(
|
|
510
|
+
function Gt(e) {
|
|
511
|
+
return e.filter(Ut).length;
|
|
512
512
|
}
|
|
513
513
|
//#endregion
|
|
514
514
|
//#region src/framework/utils/format-value.ts
|
|
515
|
-
function
|
|
515
|
+
function Kt(e, t, n) {
|
|
516
516
|
let { decimals: r, scale: i = !0 } = n || {};
|
|
517
517
|
if (typeof e == "string") return t ? `${e}${t}` : e;
|
|
518
518
|
if (e == null || Number.isNaN(e)) return t ? `--${t}` : "--";
|
|
@@ -523,35 +523,35 @@ function Pt(e, t, n) {
|
|
|
523
523
|
}
|
|
524
524
|
//#endregion
|
|
525
525
|
//#region src/framework/utils/interpret-value.ts
|
|
526
|
-
function
|
|
526
|
+
function qt(e, t) {
|
|
527
527
|
return e == null || isNaN(e) ? null : t === "°C" ? e < 10 ? "Cold" : e < 18 ? "Cool" : e < 24 ? "Comfortable" : e < 28 ? "Warm" : "Hot" : t === "°F" ? e < 50 ? "Cold" : e < 64 ? "Cool" : e < 75 ? "Comfortable" : e < 82 ? "Warm" : "Hot" : t === "%" ? e < 20 ? "Very Low" : e < 40 ? "Low" : e < 60 ? "Medium" : e < 80 ? "High" : "Very High" : t === "ppm" ? e < 400 ? "Excellent" : e < 600 ? "Good" : e < 1e3 ? "Acceptable" : e < 1500 ? "Mediocre" : "Poor" : t === "lx" ? e < 50 ? "Dark" : e < 200 ? "Dim" : e < 500 ? "Moderate" : e < 1e3 ? "Bright" : "Very Bright" : t === "AQI" ? e <= 50 ? "Good" : e <= 100 ? "Moderate" : e <= 150 ? "Unhealthy for Sensitive" : e <= 200 ? "Unhealthy" : e <= 300 ? "Very Unhealthy" : "Hazardous" : t === "dB" ? e < 30 ? "Very Quiet" : e < 50 ? "Quiet" : e < 70 ? "Moderate" : e < 85 ? "Loud" : "Very Loud" : null;
|
|
528
528
|
}
|
|
529
529
|
//#endregion
|
|
530
530
|
//#region src/framework/components/WidgetValue.tsx
|
|
531
|
-
var
|
|
532
|
-
function
|
|
531
|
+
var Jt = /*#__PURE__*/ L("<div class=glasshome-widget-subtitle>"), Yt = /*#__PURE__*/ L("<div><div class=glasshome-widget-value>");
|
|
532
|
+
function Xt(e) {
|
|
533
533
|
return (() => {
|
|
534
|
-
var t =
|
|
535
|
-
return
|
|
534
|
+
var t = Yt(), n = t.firstChild;
|
|
535
|
+
return P(n, () => Kt(e.value, e.unit)), P(t, M(T, {
|
|
536
536
|
get when() {
|
|
537
|
-
return
|
|
537
|
+
return F(() => !!e.interpret)() && typeof e.value == "number";
|
|
538
538
|
},
|
|
539
539
|
get children() {
|
|
540
|
-
var t =
|
|
541
|
-
return
|
|
540
|
+
var t = Jt();
|
|
541
|
+
return P(t, () => qt(e.value, e.unit)), t;
|
|
542
542
|
}
|
|
543
|
-
}), null),
|
|
543
|
+
}), null), N(() => j(t, H("flex flex-col", e.class))), t;
|
|
544
544
|
})();
|
|
545
545
|
}
|
|
546
546
|
//#endregion
|
|
547
547
|
//#region src/framework/core/Widget.tsx
|
|
548
|
-
var
|
|
549
|
-
function
|
|
550
|
-
let n =
|
|
548
|
+
var Zt = /*#__PURE__*/ L("<div><div class=\"relative h-full w-full\">"), Qt = /*#__PURE__*/ L("<div class=\"glasshome-widget-loading pointer-events-none absolute inset-0 animate-pulse\">"), $t = /*#__PURE__*/ L("<div class=\"flex h-full w-full flex-col items-center justify-center gap-2 text-center\">"), en = /*#__PURE__*/ L("<div class=\"flex items-center justify-center text-white/30\">"), tn = /*#__PURE__*/ L("<h3 class=\"font-semibold text-sm text-white/60\">"), nn = /*#__PURE__*/ L("<p class=\"text-white/50 text-xs\">");
|
|
549
|
+
function rn(t) {
|
|
550
|
+
let n = k(R), [r, i] = D(), [a, o] = D({
|
|
551
551
|
width: 0,
|
|
552
552
|
height: 0
|
|
553
553
|
});
|
|
554
|
-
|
|
554
|
+
pe(() => {
|
|
555
555
|
let e = r();
|
|
556
556
|
if (!e) return;
|
|
557
557
|
let t = new ResizeObserver(([e]) => {
|
|
@@ -565,19 +565,19 @@ function Gt(t) {
|
|
|
565
565
|
height: e.contentRect.height
|
|
566
566
|
});
|
|
567
567
|
});
|
|
568
|
-
t.observe(e),
|
|
568
|
+
t.observe(e), O(() => t.disconnect());
|
|
569
569
|
}), he(() => {
|
|
570
570
|
let e = r()?.getRootNode();
|
|
571
|
-
|
|
571
|
+
Ct(typeof ShadowRoot < "u" && e instanceof ShadowRoot || typeof Document < "u" && e instanceof Document ? e : void 0);
|
|
572
572
|
});
|
|
573
573
|
let s = {
|
|
574
574
|
updateConfig: n?.updateConfig ?? (() => {}),
|
|
575
575
|
registerDialogOpener: n?.registerDialogOpener,
|
|
576
576
|
callService: n?.callService,
|
|
577
577
|
dimensions: e(() => a(), "ctx.dimensions")
|
|
578
|
-
}, c =
|
|
579
|
-
if (t.variant) return typeof t.variant == "string" ?
|
|
580
|
-
}), l =
|
|
578
|
+
}, c = E(() => {
|
|
579
|
+
if (t.variant) return typeof t.variant == "string" ? Tt(t.variant) : t.variant;
|
|
580
|
+
}), l = E(() => ({
|
|
581
581
|
"container-type": "size",
|
|
582
582
|
"container-name": "widget",
|
|
583
583
|
"touch-action": t.gestures && !t.isEditMode ? t.gestures.touchAction() : void 0,
|
|
@@ -598,18 +598,18 @@ function Gt(t) {
|
|
|
598
598
|
}, h = (e) => {
|
|
599
599
|
u() && t.gestures?.onPointerCancel(e);
|
|
600
600
|
};
|
|
601
|
-
return
|
|
601
|
+
return M(R.Provider, {
|
|
602
602
|
value: s,
|
|
603
603
|
get children() {
|
|
604
|
-
return
|
|
604
|
+
return M(_t.Provider, {
|
|
605
605
|
value: a,
|
|
606
606
|
get children() {
|
|
607
|
-
var e =
|
|
608
|
-
return
|
|
607
|
+
var e = Zt(), n = e.firstChild;
|
|
608
|
+
return A(e, "pointercancel", h), A(e, "pointerup", m), A(e, "pointermove", p), A(e, "pointerdown", f), A(e, "pointerenter", d), ve((e) => {
|
|
609
609
|
i(e), t.gestures?.bindElement(e);
|
|
610
|
-
}, e),
|
|
611
|
-
var e =
|
|
612
|
-
return () => e() ?
|
|
610
|
+
}, e), P(n, (() => {
|
|
611
|
+
var e = F(() => !!t.emptyState);
|
|
612
|
+
return () => e() ? M(an, {
|
|
613
613
|
get icon() {
|
|
614
614
|
return t.emptyState.icon;
|
|
615
615
|
},
|
|
@@ -620,15 +620,15 @@ function Gt(t) {
|
|
|
620
620
|
return t.emptyState.message;
|
|
621
621
|
}
|
|
622
622
|
}) : t.children;
|
|
623
|
-
})()),
|
|
624
|
-
var e =
|
|
623
|
+
})()), P(e, (() => {
|
|
624
|
+
var e = F(() => !!t.loading);
|
|
625
625
|
return () => e() && (() => {
|
|
626
|
-
var e =
|
|
627
|
-
return
|
|
626
|
+
var e = Qt();
|
|
627
|
+
return N((t) => I(e, "z-index", B.OVERLAY)), e;
|
|
628
628
|
})();
|
|
629
|
-
})(), null),
|
|
630
|
-
var i =
|
|
631
|
-
return i !== r.e &&
|
|
629
|
+
})(), null), N((r) => {
|
|
630
|
+
var i = H("glasshome-widget", "relative h-full w-full select-none overflow-hidden rounded-xl border border-border/50", c()?.styles?.class, t.class), a = l(), o = B.CONTENT;
|
|
631
|
+
return i !== r.e && j(e, r.e = i), r.t = _e(e, a, r.t), o !== r.a && I(n, "z-index", r.a = o), r;
|
|
632
632
|
}, {
|
|
633
633
|
e: void 0,
|
|
634
634
|
t: void 0,
|
|
@@ -639,102 +639,89 @@ function Gt(t) {
|
|
|
639
639
|
}
|
|
640
640
|
});
|
|
641
641
|
}
|
|
642
|
-
function
|
|
642
|
+
function an(e) {
|
|
643
643
|
return (() => {
|
|
644
|
-
var t =
|
|
645
|
-
return
|
|
646
|
-
var t =
|
|
644
|
+
var t = $t();
|
|
645
|
+
return P(t, (() => {
|
|
646
|
+
var t = F(() => !!e.icon);
|
|
647
647
|
return () => t() && (() => {
|
|
648
|
-
var t =
|
|
649
|
-
return
|
|
648
|
+
var t = en();
|
|
649
|
+
return P(t, () => e.icon), t;
|
|
650
650
|
})();
|
|
651
|
-
})(), null),
|
|
652
|
-
var t =
|
|
651
|
+
})(), null), P(t, (() => {
|
|
652
|
+
var t = F(() => !!e.title);
|
|
653
653
|
return () => t() && (() => {
|
|
654
|
-
var t =
|
|
655
|
-
return
|
|
654
|
+
var t = tn();
|
|
655
|
+
return P(t, () => e.title), t;
|
|
656
656
|
})();
|
|
657
|
-
})(), null),
|
|
658
|
-
var t =
|
|
657
|
+
})(), null), P(t, (() => {
|
|
658
|
+
var t = F(() => !!e.message);
|
|
659
659
|
return () => t() && (() => {
|
|
660
|
-
var t =
|
|
661
|
-
return
|
|
660
|
+
var t = nn();
|
|
661
|
+
return P(t, () => e.message), t;
|
|
662
662
|
})();
|
|
663
663
|
})(), null), t;
|
|
664
664
|
})();
|
|
665
665
|
}
|
|
666
|
-
var
|
|
667
|
-
|
|
666
|
+
var U = rn;
|
|
667
|
+
U.Content = kt, U.Icon = Nt, U.Title = Rt, U.Status = Ft, U.Value = Xt, U.SliderFill = Dt;
|
|
668
668
|
//#endregion
|
|
669
669
|
//#region src/framework/dialogs/validate-config.ts
|
|
670
|
-
function
|
|
670
|
+
function on(e) {
|
|
671
671
|
let t = "";
|
|
672
672
|
for (let n of e) t += typeof n == "number" ? `[${n}]` : t ? `.${String(n)}` : String(n);
|
|
673
673
|
return t;
|
|
674
674
|
}
|
|
675
|
-
function
|
|
675
|
+
function sn(e, t) {
|
|
676
676
|
let n = e.safeParse(t);
|
|
677
677
|
return n.success ? null : n.error.issues.map((e) => {
|
|
678
|
-
let t =
|
|
678
|
+
let t = on(e.path);
|
|
679
679
|
return t ? `${t}: ${e.message}` : e.message;
|
|
680
680
|
});
|
|
681
681
|
}
|
|
682
682
|
//#endregion
|
|
683
683
|
//#region src/framework/dialogs/WidgetDialog.tsx
|
|
684
|
-
var
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
})();
|
|
698
|
-
}
|
|
699
|
-
function un(e) {
|
|
700
|
-
let [t] = ge(e, /* @__PURE__ */ "open.onOpenChange.title.onSave.hasUnsavedChanges.onDelete.editContent.controlsContent.debugContent.debugData.tabs.class.maxWidth.defaultTab.activeTab.onActiveTabChange.headerActions.configSchema.config.onConfigSave.ResponsiveDialog.ResponsiveDialogContent.ResponsiveDialogHeader.ResponsiveDialogTitle.ResponsiveDialogDescription.Button.SchemaForm".split(".")), n = () => !!t.configSchema && !!t.config && !!t.onConfigSave && !!t.SchemaForm, [r, i] = E({}), [a, o] = E(null), [s, c] = E([]);
|
|
701
|
-
w(me(() => t.config, (e) => {
|
|
684
|
+
var cn = /*#__PURE__*/ L("<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\">"), ln = /*#__PURE__*/ L("<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"), un = /*#__PURE__*/ L("<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>"), dn = /*#__PURE__*/ L("<div class=\"rounded-lg bg-muted/30 p-2 text-center md:p-6\"><p class=\"text-muted-foreground text-sm\">No additional controls"), fn = /*#__PURE__*/ L("<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\">"), pn = /*#__PURE__*/ L("<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"), mn = /*#__PURE__*/ L("<span class=\"inline-flex size-3.5 shrink-0 items-center\">"), hn = (e) => ct(e), gn = {
|
|
685
|
+
sm: "sm",
|
|
686
|
+
md: "md",
|
|
687
|
+
lg: "lg",
|
|
688
|
+
xl: "xl",
|
|
689
|
+
full: "full",
|
|
690
|
+
"2xl": "xl",
|
|
691
|
+
"3xl": "xl",
|
|
692
|
+
"4xl": "full"
|
|
693
|
+
};
|
|
694
|
+
function _n(e) {
|
|
695
|
+
let [t] = ge(e, /* @__PURE__ */ "open.onOpenChange.title.description.onSave.hasUnsavedChanges.onDelete.editContent.controlsContent.debugContent.debugData.tabs.class.maxWidth.defaultTab.activeTab.onActiveTabChange.headerActions.configSchema.config.onConfigSave.ResponsiveDialog.ResponsiveDialogContent.ResponsiveDialogHeader.ResponsiveDialogTitle.ResponsiveDialogDescription.ResponsiveDialogBody.ResponsiveDialogFooter.Button.SchemaForm.Tabs.TabsList.TabsTrigger.TabsContent".split(".")), n = () => !!t.configSchema && !!t.config && !!t.onConfigSave && !!t.SchemaForm, [r, i] = D({}), [a, o] = D(null), [s, c] = D([]);
|
|
696
|
+
pe(me(() => t.config, (e) => {
|
|
702
697
|
e && i({ ...e });
|
|
703
|
-
})),
|
|
704
|
-
e && o(
|
|
698
|
+
})), pe(me(() => t.configSchema, (e) => {
|
|
699
|
+
e && o(hn(e));
|
|
705
700
|
}));
|
|
706
701
|
let l = () => n() && JSON.stringify(r()) !== JSON.stringify(t.config), u = (e) => {
|
|
707
702
|
!e && t.config && (i({ ...t.config }), c([])), t.onOpenChange(e);
|
|
708
703
|
}, d = () => {
|
|
709
704
|
let e = t.configSchema;
|
|
710
705
|
if (e) {
|
|
711
|
-
let t =
|
|
706
|
+
let t = sn(e, r());
|
|
712
707
|
if (t) {
|
|
713
708
|
c(t);
|
|
714
709
|
return;
|
|
715
710
|
}
|
|
716
711
|
}
|
|
717
712
|
c([]), t.onConfigSave?.(r());
|
|
718
|
-
}, [f, p] =
|
|
713
|
+
}, [f, p] = D(t.defaultTab ?? "controls"), m = () => t.activeTab ?? f(), h = (e) => {
|
|
719
714
|
t.onActiveTabChange ? t.onActiveTabChange(e) : p(e);
|
|
720
|
-
}, g = () => ({
|
|
721
|
-
sm: "max-w-sm",
|
|
722
|
-
md: "max-w-md",
|
|
723
|
-
lg: "max-w-lg",
|
|
724
|
-
xl: "max-w-xl",
|
|
725
|
-
"2xl": "max-w-2xl",
|
|
726
|
-
"3xl": "max-w-3xl",
|
|
727
|
-
"4xl": "max-w-4xl"
|
|
728
|
-
})[t.maxWidth ?? "3xl"], _ = () => {
|
|
715
|
+
}, g = () => gn[t.maxWidth ?? "xl"], _ = () => {
|
|
729
716
|
if (t.tabs) return t.tabs;
|
|
730
717
|
let e = [];
|
|
731
718
|
return e.push({
|
|
732
719
|
id: "edit",
|
|
733
720
|
label: "Edit",
|
|
734
|
-
icon:
|
|
721
|
+
icon: cn(),
|
|
735
722
|
content: t.editContent ?? (() => {
|
|
736
723
|
let e = t.SchemaForm, o = n() ? a() : void 0;
|
|
737
|
-
return !o || !e ?
|
|
724
|
+
return !o || !e ? ln() : M(e, {
|
|
738
725
|
schema: o,
|
|
739
726
|
get data() {
|
|
740
727
|
return r();
|
|
@@ -748,163 +735,195 @@ function un(e) {
|
|
|
748
735
|
}), e.push({
|
|
749
736
|
id: "controls",
|
|
750
737
|
label: "Controls",
|
|
751
|
-
icon:
|
|
752
|
-
content: t.controlsContent ??
|
|
738
|
+
icon: un(),
|
|
739
|
+
content: t.controlsContent ?? dn()
|
|
753
740
|
}), e.push({
|
|
754
741
|
id: "debug",
|
|
755
742
|
label: "Debug",
|
|
756
|
-
icon:
|
|
757
|
-
content: t.debugContent ??
|
|
743
|
+
icon: fn(),
|
|
744
|
+
content: t.debugContent ?? pn()
|
|
758
745
|
}), e;
|
|
759
746
|
}, v = async () => {
|
|
760
747
|
if (t.debugData !== void 0) try {
|
|
761
748
|
let e = typeof t.debugData == "string" ? t.debugData : JSON.stringify(t.debugData, null, 2);
|
|
762
749
|
await navigator.clipboard.writeText(e);
|
|
763
750
|
} catch {}
|
|
764
|
-
}, ee =
|
|
765
|
-
let e = ie();
|
|
766
|
-
return e.find((e) => e.id === m())?.content ?? e[0]?.content;
|
|
767
|
-
}, y = t.ResponsiveDialog, b = t.ResponsiveDialogContent, te = t.ResponsiveDialogHeader, ne = t.ResponsiveDialogTitle, re = t.ResponsiveDialogDescription, x = t.Button, ie = T(me([
|
|
751
|
+
}, ee = t.ResponsiveDialog, y = t.ResponsiveDialogContent, b = t.ResponsiveDialogHeader, te = t.ResponsiveDialogTitle, ne = t.ResponsiveDialogDescription, re = t.ResponsiveDialogBody ?? Fe, ie = t.ResponsiveDialogFooter ?? Be, ae = t.Tabs ?? Qe, oe = t.TabsList ?? nt, se = t.TabsTrigger ?? it, ce = t.TabsContent ?? et, x = t.Button, S = E(me([
|
|
768
752
|
() => t.open,
|
|
769
753
|
a,
|
|
770
754
|
() => t.config,
|
|
771
755
|
() => t.tabs
|
|
772
|
-
], () => _())),
|
|
773
|
-
|
|
756
|
+
], () => _())), le = (e) => n() ? u(e) : t.onOpenChange(e), ue = () => n() ? l() : t.hasUnsavedChanges, C = () => n() ? d : t.onSave, w = () => {
|
|
757
|
+
let e = S(), t = m();
|
|
758
|
+
return e.some((e) => e.id === t) ? t : e[0]?.id ?? t;
|
|
759
|
+
}, fe = () => w() === "edit" && (C() || t.onDelete) || w() === "debug" && t.debugData !== void 0;
|
|
760
|
+
return M(ee, {
|
|
774
761
|
get open() {
|
|
775
762
|
return t.open;
|
|
776
763
|
},
|
|
777
|
-
onOpenChange: (e) =>
|
|
764
|
+
onOpenChange: (e) => le(e),
|
|
778
765
|
get children() {
|
|
779
|
-
return
|
|
766
|
+
return M(y, {
|
|
767
|
+
get size() {
|
|
768
|
+
return g();
|
|
769
|
+
},
|
|
780
770
|
get class() {
|
|
781
|
-
return
|
|
771
|
+
return t.class;
|
|
782
772
|
},
|
|
783
773
|
get children() {
|
|
784
|
-
return
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
},
|
|
816
|
-
get children() {
|
|
817
|
-
return t.headerActions;
|
|
818
|
-
}
|
|
819
|
-
}), null), e;
|
|
820
|
-
})()];
|
|
821
|
-
}
|
|
822
|
-
}),
|
|
823
|
-
(() => {
|
|
824
|
-
var e = on();
|
|
825
|
-
return N(e, ee), e;
|
|
826
|
-
})(),
|
|
827
|
-
j(C, {
|
|
828
|
-
get when() {
|
|
829
|
-
return P(() => m() === "edit")() && (S() || t.onDelete) || m() === "debug" && t.debugData !== void 0;
|
|
830
|
-
},
|
|
831
|
-
get children() {
|
|
832
|
-
var e = sn();
|
|
833
|
-
return N(e, j(C, {
|
|
834
|
-
get when() {
|
|
835
|
-
return P(() => m() === "edit")() && t.onDelete;
|
|
774
|
+
return M(ae, {
|
|
775
|
+
get value() {
|
|
776
|
+
return w();
|
|
777
|
+
},
|
|
778
|
+
onChange: h,
|
|
779
|
+
layout: "split",
|
|
780
|
+
get children() {
|
|
781
|
+
return [
|
|
782
|
+
M(b, {
|
|
783
|
+
class: "flex-wrap",
|
|
784
|
+
get action() {
|
|
785
|
+
return [M(oe, {
|
|
786
|
+
class: "w-auto",
|
|
787
|
+
get children() {
|
|
788
|
+
return M(de, {
|
|
789
|
+
get each() {
|
|
790
|
+
return S();
|
|
791
|
+
},
|
|
792
|
+
children: (e) => M(se, {
|
|
793
|
+
get value() {
|
|
794
|
+
return e.id;
|
|
795
|
+
},
|
|
796
|
+
get children() {
|
|
797
|
+
return [(() => {
|
|
798
|
+
var t = mn();
|
|
799
|
+
return P(t, () => e.icon), t;
|
|
800
|
+
})(), F(() => e.label)];
|
|
801
|
+
}
|
|
802
|
+
})
|
|
803
|
+
});
|
|
804
|
+
}
|
|
805
|
+
}), F(() => t.headerActions)];
|
|
836
806
|
},
|
|
837
807
|
get children() {
|
|
838
|
-
return
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
})
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
get when() {
|
|
847
|
-
return P(() => m() === "edit")() && S();
|
|
848
|
-
},
|
|
849
|
-
get children() {
|
|
850
|
-
return j(x, {
|
|
851
|
-
size: "sm",
|
|
852
|
-
get disabled() {
|
|
853
|
-
return !oe();
|
|
808
|
+
return [M(te, {
|
|
809
|
+
class: "truncate",
|
|
810
|
+
get children() {
|
|
811
|
+
return t.title;
|
|
812
|
+
}
|
|
813
|
+
}), M(T, {
|
|
814
|
+
get when() {
|
|
815
|
+
return t.description;
|
|
854
816
|
},
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
817
|
+
get children() {
|
|
818
|
+
return M(ne, { get children() {
|
|
819
|
+
return t.description;
|
|
820
|
+
} });
|
|
821
|
+
}
|
|
822
|
+
})];
|
|
858
823
|
}
|
|
859
|
-
}),
|
|
824
|
+
}),
|
|
825
|
+
M(re, { get children() {
|
|
826
|
+
return M(de, {
|
|
827
|
+
get each() {
|
|
828
|
+
return S();
|
|
829
|
+
},
|
|
830
|
+
children: (e) => M(ce, {
|
|
831
|
+
get value() {
|
|
832
|
+
return e.id;
|
|
833
|
+
},
|
|
834
|
+
get children() {
|
|
835
|
+
return e.content;
|
|
836
|
+
}
|
|
837
|
+
})
|
|
838
|
+
});
|
|
839
|
+
} }),
|
|
840
|
+
M(T, {
|
|
860
841
|
get when() {
|
|
861
|
-
return
|
|
842
|
+
return fe();
|
|
862
843
|
},
|
|
863
844
|
get children() {
|
|
864
|
-
return
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
845
|
+
return M(ie, { get children() {
|
|
846
|
+
return [
|
|
847
|
+
M(T, {
|
|
848
|
+
get when() {
|
|
849
|
+
return F(() => w() === "edit")() && t.onDelete;
|
|
850
|
+
},
|
|
851
|
+
get children() {
|
|
852
|
+
return M(x, {
|
|
853
|
+
size: "sm",
|
|
854
|
+
variant: "destructive",
|
|
855
|
+
onClick: () => t.onDelete?.(),
|
|
856
|
+
children: "Delete"
|
|
857
|
+
});
|
|
858
|
+
}
|
|
859
|
+
}),
|
|
860
|
+
M(T, {
|
|
861
|
+
get when() {
|
|
862
|
+
return F(() => w() === "edit")() && C();
|
|
863
|
+
},
|
|
864
|
+
get children() {
|
|
865
|
+
return M(x, {
|
|
866
|
+
size: "sm",
|
|
867
|
+
get disabled() {
|
|
868
|
+
return !ue();
|
|
869
|
+
},
|
|
870
|
+
onClick: () => C()?.(),
|
|
871
|
+
children: "Save"
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
}),
|
|
875
|
+
M(T, {
|
|
876
|
+
get when() {
|
|
877
|
+
return F(() => w() === "debug")() && t.debugData !== void 0;
|
|
878
|
+
},
|
|
879
|
+
get children() {
|
|
880
|
+
return M(x, {
|
|
881
|
+
size: "sm",
|
|
882
|
+
variant: "outline",
|
|
883
|
+
onClick: v,
|
|
884
|
+
children: "Copy"
|
|
885
|
+
});
|
|
886
|
+
}
|
|
887
|
+
})
|
|
888
|
+
];
|
|
889
|
+
} });
|
|
870
890
|
}
|
|
871
|
-
})
|
|
872
|
-
|
|
873
|
-
}
|
|
874
|
-
|
|
891
|
+
})
|
|
892
|
+
];
|
|
893
|
+
}
|
|
894
|
+
});
|
|
875
895
|
}
|
|
876
896
|
});
|
|
877
897
|
}
|
|
878
898
|
});
|
|
879
899
|
}
|
|
880
|
-
_e(["click"]);
|
|
881
900
|
//#endregion
|
|
882
901
|
//#region src/framework/hooks/use-intersection-pause.ts
|
|
883
|
-
function
|
|
902
|
+
function vn(e) {
|
|
884
903
|
if (typeof IntersectionObserver > "u") return () => !1;
|
|
885
|
-
let [t, n] =
|
|
904
|
+
let [t, n] = D(!1), r = new IntersectionObserver((e) => {
|
|
886
905
|
let t = e[0];
|
|
887
906
|
t && n(!t.isIntersecting);
|
|
888
907
|
});
|
|
889
|
-
return
|
|
908
|
+
return pe(() => {
|
|
890
909
|
let t = e();
|
|
891
910
|
r.disconnect(), t && r.observe(t);
|
|
892
|
-
}),
|
|
911
|
+
}), O(() => r.disconnect()), t;
|
|
893
912
|
}
|
|
894
913
|
//#endregion
|
|
895
914
|
//#region src/framework/hooks/use-reduced-motion.ts
|
|
896
|
-
function
|
|
915
|
+
function yn() {
|
|
897
916
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => !1;
|
|
898
|
-
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), [t, n] =
|
|
899
|
-
return e.addEventListener("change", r),
|
|
917
|
+
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), [t, n] = D(e.matches), r = (e) => n(e.matches);
|
|
918
|
+
return e.addEventListener("change", r), O(() => e.removeEventListener("change", r)), t;
|
|
900
919
|
}
|
|
901
920
|
//#endregion
|
|
902
921
|
//#region src/framework/hooks/use-widget-dialog.ts
|
|
903
|
-
function
|
|
904
|
-
let [t, n] =
|
|
922
|
+
function bn(e = "controls") {
|
|
923
|
+
let [t, n] = D(!1), [r, i] = D(e), a = (t) => {
|
|
905
924
|
i(t ?? e), n(!0);
|
|
906
|
-
}, o =
|
|
907
|
-
return o?.registerDialogOpener?.(a),
|
|
925
|
+
}, o = k(R);
|
|
926
|
+
return o?.registerDialogOpener?.(a), O(() => o?.registerDialogOpener?.(null)), {
|
|
908
927
|
showDialog: t,
|
|
909
928
|
setShowDialog: n,
|
|
910
929
|
openDialog: a,
|
|
@@ -925,15 +944,15 @@ function pn(e = "controls") {
|
|
|
925
944
|
}
|
|
926
945
|
//#endregion
|
|
927
946
|
//#region src/framework/hooks/use-widget-entity-group.ts
|
|
928
|
-
function
|
|
929
|
-
let t = e.minEntities ?? 1, n =
|
|
947
|
+
function xn(e) {
|
|
948
|
+
let t = e.minEntities ?? 1, n = E(() => e.entities().length), r = E(() => n() >= t), i = E(() => !r() || !e.calculateGroupData ? null : e.calculateGroupData(e.entities())), a = E(() => {
|
|
930
949
|
if (!r()) return;
|
|
931
950
|
let t = e.aggregationMode?.();
|
|
932
951
|
if (!t || t === "none") return;
|
|
933
952
|
let n = e.entities();
|
|
934
|
-
if (t === "light" || t === "binary-sensor" || t === "switch") return
|
|
935
|
-
if (t === "sensor") return
|
|
936
|
-
}), o =
|
|
953
|
+
if (t === "light" || t === "binary-sensor" || t === "switch") return zt(n, e.allEntitiesMode);
|
|
954
|
+
if (t === "sensor") return Bt(n, e.sensorGroupType?.() ?? "mean", !0);
|
|
955
|
+
}), o = E(() => r() ? void 0 : e.emptyStateConfig);
|
|
937
956
|
return {
|
|
938
957
|
entities: e.entities,
|
|
939
958
|
groupData: i,
|
|
@@ -945,142 +964,142 @@ function mn(e) {
|
|
|
945
964
|
}
|
|
946
965
|
//#endregion
|
|
947
966
|
//#region src/framework/gestures/cursors.ts
|
|
948
|
-
var
|
|
949
|
-
function
|
|
967
|
+
var W = 32, G = W / 2, K = "white", q = "rgba(0,0,0,0.4)", Sn = 2, J = 3;
|
|
968
|
+
function Cn(e) {
|
|
950
969
|
return `url("data:image/svg+xml,${encodeURIComponent(e)}")`;
|
|
951
970
|
}
|
|
952
971
|
function Y(e) {
|
|
953
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
972
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${W}" height="${W}" viewBox="0 0 ${W} ${W}">${e}</svg>`;
|
|
954
973
|
}
|
|
955
|
-
var
|
|
974
|
+
var wn = Y(`
|
|
956
975
|
<g transform="translate(6, 2)">
|
|
957
976
|
<!-- shadow -->
|
|
958
|
-
<g stroke="${
|
|
977
|
+
<g stroke="${q}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
959
978
|
<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"/>
|
|
960
979
|
</g>
|
|
961
980
|
<!-- main -->
|
|
962
|
-
<g stroke="${
|
|
981
|
+
<g stroke="${K}" stroke-width="${Sn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
963
982
|
<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"/>
|
|
964
983
|
</g>
|
|
965
984
|
</g>
|
|
966
|
-
`),
|
|
985
|
+
`), Tn = Y(`
|
|
967
986
|
<g>
|
|
968
|
-
<circle cx="${
|
|
969
|
-
<circle cx="${
|
|
970
|
-
<circle cx="${
|
|
987
|
+
<circle cx="${G}" cy="${G}" r="8" stroke="${q}" stroke-width="${J}" fill="none"/>
|
|
988
|
+
<circle cx="${G}" cy="${G}" r="8" stroke="${K}" stroke-width="1.5" fill="none"/>
|
|
989
|
+
<circle cx="${G}" cy="${G}" r="1.5" fill="${K}"/>
|
|
971
990
|
</g>
|
|
972
|
-
`),
|
|
991
|
+
`), En = Y(`
|
|
973
992
|
<g>
|
|
974
993
|
<!-- shadow -->
|
|
975
|
-
<g stroke="${
|
|
976
|
-
<line x1="6" y1="${
|
|
977
|
-
<polyline points="10,12 6,${
|
|
978
|
-
<polyline points="22,12 26,${
|
|
994
|
+
<g stroke="${q}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
995
|
+
<line x1="6" y1="${G}" x2="26" y2="${G}"/>
|
|
996
|
+
<polyline points="10,12 6,${G} 10,20"/>
|
|
997
|
+
<polyline points="22,12 26,${G} 22,20"/>
|
|
979
998
|
</g>
|
|
980
999
|
<!-- main -->
|
|
981
|
-
<g stroke="${
|
|
982
|
-
<line x1="6" y1="${
|
|
983
|
-
<polyline points="10,12 6,${
|
|
984
|
-
<polyline points="22,12 26,${
|
|
1000
|
+
<g stroke="${K}" stroke-width="${Sn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1001
|
+
<line x1="6" y1="${G}" x2="26" y2="${G}"/>
|
|
1002
|
+
<polyline points="10,12 6,${G} 10,20"/>
|
|
1003
|
+
<polyline points="22,12 26,${G} 22,20"/>
|
|
985
1004
|
</g>
|
|
986
1005
|
<!-- center grip dots -->
|
|
987
|
-
<circle cx="${
|
|
988
|
-
<circle cx="11" cy="${
|
|
989
|
-
<circle cx="21" cy="${
|
|
1006
|
+
<circle cx="${G}" cy="${G}" r="1.5" fill="${K}"/>
|
|
1007
|
+
<circle cx="11" cy="${G}" r="1" fill="${K}" opacity="0.6"/>
|
|
1008
|
+
<circle cx="21" cy="${G}" r="1" fill="${K}" opacity="0.6"/>
|
|
990
1009
|
</g>
|
|
991
|
-
`),
|
|
1010
|
+
`), Dn = Y(`
|
|
992
1011
|
<g>
|
|
993
1012
|
<!-- shadow -->
|
|
994
|
-
<g stroke="${
|
|
995
|
-
<line x1="${
|
|
996
|
-
<polyline points="12,10 ${
|
|
997
|
-
<polyline points="12,22 ${
|
|
1013
|
+
<g stroke="${q}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1014
|
+
<line x1="${G}" y1="6" x2="${G}" y2="26"/>
|
|
1015
|
+
<polyline points="12,10 ${G},6 20,10"/>
|
|
1016
|
+
<polyline points="12,22 ${G},26 20,22"/>
|
|
998
1017
|
</g>
|
|
999
1018
|
<!-- main -->
|
|
1000
|
-
<g stroke="${
|
|
1001
|
-
<line x1="${
|
|
1002
|
-
<polyline points="12,10 ${
|
|
1003
|
-
<polyline points="12,22 ${
|
|
1019
|
+
<g stroke="${K}" stroke-width="${Sn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1020
|
+
<line x1="${G}" y1="6" x2="${G}" y2="26"/>
|
|
1021
|
+
<polyline points="12,10 ${G},6 20,10"/>
|
|
1022
|
+
<polyline points="12,22 ${G},26 20,22"/>
|
|
1004
1023
|
</g>
|
|
1005
1024
|
<!-- center grip dots -->
|
|
1006
|
-
<circle cx="${
|
|
1007
|
-
<circle cx="${
|
|
1008
|
-
<circle cx="${
|
|
1025
|
+
<circle cx="${G}" cy="${G}" r="1.5" fill="${K}"/>
|
|
1026
|
+
<circle cx="${G}" cy="11" r="1" fill="${K}" opacity="0.6"/>
|
|
1027
|
+
<circle cx="${G}" cy="21" r="1" fill="${K}" opacity="0.6"/>
|
|
1009
1028
|
</g>
|
|
1010
|
-
`),
|
|
1029
|
+
`), On = Y(`
|
|
1011
1030
|
<g>
|
|
1012
1031
|
<!-- shadow -->
|
|
1013
|
-
<g stroke="${
|
|
1014
|
-
<line x1="7" y1="${
|
|
1015
|
-
<line x1="${
|
|
1016
|
-
<polyline points="11,13 7,${
|
|
1017
|
-
<polyline points="21,13 25,${
|
|
1018
|
-
<polyline points="13,11 ${
|
|
1019
|
-
<polyline points="13,21 ${
|
|
1032
|
+
<g stroke="${q}" stroke-width="${J}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1033
|
+
<line x1="7" y1="${G}" x2="25" y2="${G}"/>
|
|
1034
|
+
<line x1="${G}" y1="7" x2="${G}" y2="25"/>
|
|
1035
|
+
<polyline points="11,13 7,${G} 11,19"/>
|
|
1036
|
+
<polyline points="21,13 25,${G} 21,19"/>
|
|
1037
|
+
<polyline points="13,11 ${G},7 19,11"/>
|
|
1038
|
+
<polyline points="13,21 ${G},25 19,21"/>
|
|
1020
1039
|
</g>
|
|
1021
1040
|
<!-- main -->
|
|
1022
|
-
<g stroke="${
|
|
1023
|
-
<line x1="7" y1="${
|
|
1024
|
-
<line x1="${
|
|
1025
|
-
<polyline points="11,13 7,${
|
|
1026
|
-
<polyline points="21,13 25,${
|
|
1027
|
-
<polyline points="13,11 ${
|
|
1028
|
-
<polyline points="13,21 ${
|
|
1041
|
+
<g stroke="${K}" stroke-width="${Sn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
1042
|
+
<line x1="7" y1="${G}" x2="25" y2="${G}"/>
|
|
1043
|
+
<line x1="${G}" y1="7" x2="${G}" y2="25"/>
|
|
1044
|
+
<polyline points="11,13 7,${G} 11,19"/>
|
|
1045
|
+
<polyline points="21,13 25,${G} 21,19"/>
|
|
1046
|
+
<polyline points="13,11 ${G},7 19,11"/>
|
|
1047
|
+
<polyline points="13,21 ${G},25 19,21"/>
|
|
1029
1048
|
</g>
|
|
1030
1049
|
<!-- center dot -->
|
|
1031
|
-
<circle cx="${
|
|
1050
|
+
<circle cx="${G}" cy="${G}" r="2" fill="${K}"/>
|
|
1032
1051
|
</g>
|
|
1033
1052
|
`);
|
|
1034
1053
|
function X(e, t, n) {
|
|
1035
1054
|
return {
|
|
1036
|
-
css: `${
|
|
1055
|
+
css: `${Cn(e)} ${t} ${n}, auto`,
|
|
1037
1056
|
hotspotX: t,
|
|
1038
1057
|
hotspotY: n
|
|
1039
1058
|
};
|
|
1040
1059
|
}
|
|
1041
1060
|
var Z = {
|
|
1042
|
-
tap: X(
|
|
1043
|
-
hold: X(
|
|
1044
|
-
slideHorizontal: X(
|
|
1045
|
-
slideVertical: X(
|
|
1046
|
-
slideAuto: X(
|
|
1061
|
+
tap: X(wn, 12, 4),
|
|
1062
|
+
hold: X(Tn, 16, 16),
|
|
1063
|
+
slideHorizontal: X(En, G, G),
|
|
1064
|
+
slideVertical: X(Dn, G, G),
|
|
1065
|
+
slideAuto: X(On, G, G)
|
|
1047
1066
|
};
|
|
1048
1067
|
//#endregion
|
|
1049
1068
|
//#region src/framework/gestures/haptics.ts
|
|
1050
|
-
function
|
|
1069
|
+
function kn() {
|
|
1051
1070
|
if (typeof window > "u") return null;
|
|
1052
1071
|
let e = window;
|
|
1053
1072
|
return e.Capacitor?.isNativePlatform?.() ? e.Capacitor.Plugins?.Haptics ?? null : null;
|
|
1054
1073
|
}
|
|
1055
|
-
function
|
|
1074
|
+
function An(e) {
|
|
1056
1075
|
if (!(typeof navigator > "u" || typeof navigator.vibrate != "function")) try {
|
|
1057
1076
|
navigator.vibrate(e);
|
|
1058
1077
|
} catch {}
|
|
1059
1078
|
}
|
|
1060
|
-
var
|
|
1079
|
+
var jn = {
|
|
1061
1080
|
tick() {
|
|
1062
|
-
let e =
|
|
1081
|
+
let e = kn();
|
|
1063
1082
|
if (e) {
|
|
1064
1083
|
e.impact({ style: "Light" }).catch(() => {});
|
|
1065
1084
|
return;
|
|
1066
1085
|
}
|
|
1067
|
-
|
|
1086
|
+
An(8);
|
|
1068
1087
|
},
|
|
1069
1088
|
bump() {
|
|
1070
|
-
let e =
|
|
1089
|
+
let e = kn();
|
|
1071
1090
|
if (e) {
|
|
1072
1091
|
e.impact({ style: "Medium" }).catch(() => {});
|
|
1073
1092
|
return;
|
|
1074
1093
|
}
|
|
1075
|
-
|
|
1094
|
+
An(20);
|
|
1076
1095
|
},
|
|
1077
1096
|
pulse() {
|
|
1078
|
-
let e =
|
|
1097
|
+
let e = kn();
|
|
1079
1098
|
if (e) {
|
|
1080
1099
|
e.impact({ style: "Heavy" }).catch(() => {});
|
|
1081
1100
|
return;
|
|
1082
1101
|
}
|
|
1083
|
-
|
|
1102
|
+
An([
|
|
1084
1103
|
0,
|
|
1085
1104
|
15,
|
|
1086
1105
|
40,
|
|
@@ -1090,7 +1109,7 @@ var Cn = {
|
|
|
1090
1109
|
};
|
|
1091
1110
|
//#endregion
|
|
1092
1111
|
//#region src/framework/gestures/use-widget-gestures.ts
|
|
1093
|
-
function
|
|
1112
|
+
function Mn(e, t) {
|
|
1094
1113
|
let n = {
|
|
1095
1114
|
isDown: !1,
|
|
1096
1115
|
isTouch: !1,
|
|
@@ -1101,7 +1120,7 @@ function wn(e, t) {
|
|
|
1101
1120
|
sliding: !1,
|
|
1102
1121
|
holdTimer: null,
|
|
1103
1122
|
element: null
|
|
1104
|
-
}, r = null, i = null, a = null, [o, s] =
|
|
1123
|
+
}, r = null, i = null, a = null, [o, s] = D(null);
|
|
1105
1124
|
function c(e) {
|
|
1106
1125
|
e !== i && (a && a.disconnect(), a = new ResizeObserver((e) => {
|
|
1107
1126
|
let t = e[0];
|
|
@@ -1133,7 +1152,7 @@ function wn(e, t) {
|
|
|
1133
1152
|
if (n.isDown = !0, n.isTouch = t.pointerType === "touch", n.element = t.currentTarget, c(n.element), n.startX = t.clientX, n.startY = t.clientY, n.startTime = Date.now(), n.hasMoved = !1, n.sliding = !1, r.hold) {
|
|
1134
1153
|
let e = r.hold.delay ?? 300;
|
|
1135
1154
|
n.holdTimer = setTimeout(() => {
|
|
1136
|
-
n.holdTimer = null, !(!n.isDown || n.hasMoved) && (
|
|
1155
|
+
n.holdTimer = null, !(!n.isDown || n.hasMoved) && (jn.bump(), r.hold?.action(), n.isDown = !1);
|
|
1137
1156
|
}, e);
|
|
1138
1157
|
}
|
|
1139
1158
|
if (!n.isTouch && r.slide) try {
|
|
@@ -1201,7 +1220,7 @@ function wn(e, t) {
|
|
|
1201
1220
|
}
|
|
1202
1221
|
//#endregion
|
|
1203
1222
|
//#region src/framework/theming/svg-colors.ts
|
|
1204
|
-
var
|
|
1223
|
+
var Nn = {
|
|
1205
1224
|
solar: "oklch(0.74 0.18 60)",
|
|
1206
1225
|
grid: "oklch(0.62 0.12 245)",
|
|
1207
1226
|
battery: "oklch(0.70 0.18 145)",
|
|
@@ -1210,21 +1229,21 @@ var Tn = {
|
|
|
1210
1229
|
positive: "oklch(0.70 0.14 160)",
|
|
1211
1230
|
negative: "oklch(0.64 0.22 27)"
|
|
1212
1231
|
};
|
|
1213
|
-
function
|
|
1232
|
+
function Pn(e) {
|
|
1214
1233
|
return {
|
|
1215
1234
|
fill: `color-mix(in oklch, ${e} 20%, transparent)`,
|
|
1216
1235
|
stroke: e,
|
|
1217
1236
|
solid: e
|
|
1218
1237
|
};
|
|
1219
1238
|
}
|
|
1220
|
-
var
|
|
1239
|
+
var Fn = Object.fromEntries(Object.entries(Nn).map(([e, t]) => [e, Pn(t)])), In = o.enum([
|
|
1221
1240
|
"success",
|
|
1222
1241
|
"warning",
|
|
1223
1242
|
"danger",
|
|
1224
1243
|
"info",
|
|
1225
1244
|
"neutral",
|
|
1226
1245
|
"accent"
|
|
1227
|
-
]),
|
|
1246
|
+
]), Ln = {
|
|
1228
1247
|
title: e(() => o.string().optional().meta({
|
|
1229
1248
|
title: "Title",
|
|
1230
1249
|
description: "Optional display name override"
|
|
@@ -1244,45 +1263,45 @@ var Dn = Object.fromEntries(Object.entries(Tn).map(([e, t]) => [e, En(t)])), On
|
|
|
1244
1263
|
formType: "area-picker",
|
|
1245
1264
|
title: "Area"
|
|
1246
1265
|
}), "widgetFields.areaId")
|
|
1247
|
-
},
|
|
1266
|
+
}, Rn = 24;
|
|
1248
1267
|
function Q(e) {
|
|
1249
1268
|
let t = {};
|
|
1250
1269
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
1251
1270
|
return t;
|
|
1252
1271
|
}
|
|
1253
|
-
function
|
|
1272
|
+
function zn() {
|
|
1254
1273
|
return o.string().optional().meta({
|
|
1255
1274
|
title: "Title",
|
|
1256
1275
|
description: "Optional display name override"
|
|
1257
1276
|
});
|
|
1258
1277
|
}
|
|
1259
|
-
function
|
|
1278
|
+
function Bn(e) {
|
|
1260
1279
|
return (e.default === void 0 ? o.string().optional() : o.string().default(e.default)).meta(Q({
|
|
1261
1280
|
title: e.title,
|
|
1262
1281
|
description: e.description
|
|
1263
1282
|
}));
|
|
1264
1283
|
}
|
|
1265
|
-
function
|
|
1284
|
+
function Vn(e) {
|
|
1266
1285
|
let t = o.number();
|
|
1267
1286
|
return e.min !== void 0 && (t = t.min(e.min)), e.max !== void 0 && (t = t.max(e.max)), (e.default === void 0 ? t.optional() : t.default(e.default)).meta(Q({
|
|
1268
1287
|
title: e.title,
|
|
1269
1288
|
description: e.description
|
|
1270
1289
|
}));
|
|
1271
1290
|
}
|
|
1272
|
-
function
|
|
1291
|
+
function Hn(e) {
|
|
1273
1292
|
return o.boolean().default(e.default ?? !1).meta(Q({
|
|
1274
1293
|
title: e.title,
|
|
1275
1294
|
description: e.description
|
|
1276
1295
|
}));
|
|
1277
1296
|
}
|
|
1278
|
-
function
|
|
1297
|
+
function Un(e, t) {
|
|
1279
1298
|
let n = o.enum(e);
|
|
1280
1299
|
return (t.default === void 0 ? n.optional() : n.default(t.default)).meta(Q({
|
|
1281
1300
|
title: t.title,
|
|
1282
1301
|
description: t.description
|
|
1283
1302
|
}));
|
|
1284
1303
|
}
|
|
1285
|
-
function
|
|
1304
|
+
function Wn(e, t) {
|
|
1286
1305
|
return o.array(o.string()).default([]).meta(Q({
|
|
1287
1306
|
domain: e,
|
|
1288
1307
|
title: t?.title ?? "Entities",
|
|
@@ -1290,7 +1309,7 @@ function In(e, t) {
|
|
|
1290
1309
|
deviceClass: t?.deviceClass
|
|
1291
1310
|
}));
|
|
1292
1311
|
}
|
|
1293
|
-
function
|
|
1312
|
+
function Gn(e, t) {
|
|
1294
1313
|
return o.array(o.string()).default([]).meta(Q({
|
|
1295
1314
|
domain: e,
|
|
1296
1315
|
title: t?.title ?? "Entity",
|
|
@@ -1299,20 +1318,20 @@ function Ln(e, t) {
|
|
|
1299
1318
|
singleSelect: !0
|
|
1300
1319
|
}));
|
|
1301
1320
|
}
|
|
1302
|
-
function
|
|
1321
|
+
function Kn(e) {
|
|
1303
1322
|
return o.string().optional().meta({
|
|
1304
1323
|
formType: "area-picker",
|
|
1305
1324
|
title: e?.title ?? "Area"
|
|
1306
1325
|
});
|
|
1307
1326
|
}
|
|
1308
|
-
function
|
|
1327
|
+
function qn(e) {
|
|
1309
1328
|
let t = o.string().meta({
|
|
1310
1329
|
formType: "icon-picker",
|
|
1311
1330
|
title: e?.title ?? "Icon"
|
|
1312
1331
|
});
|
|
1313
1332
|
return e?.default === void 0 ? t.optional() : t.default(e.default);
|
|
1314
1333
|
}
|
|
1315
|
-
function
|
|
1334
|
+
function Jn(e) {
|
|
1316
1335
|
let t = o.string().meta(Q({
|
|
1317
1336
|
formType: "image-picker",
|
|
1318
1337
|
title: e?.title ?? "Image",
|
|
@@ -1320,36 +1339,36 @@ function Bn(e) {
|
|
|
1320
1339
|
}));
|
|
1321
1340
|
return e?.default === void 0 ? t.optional() : t.default(e.default);
|
|
1322
1341
|
}
|
|
1323
|
-
function
|
|
1342
|
+
function Yn(e) {
|
|
1324
1343
|
return o.array(o.string()).default([]).meta(Q({
|
|
1325
1344
|
title: e.title,
|
|
1326
1345
|
description: e.description
|
|
1327
1346
|
}));
|
|
1328
1347
|
}
|
|
1329
|
-
function
|
|
1348
|
+
function Xn(e, t) {
|
|
1330
1349
|
let n = o.object(e);
|
|
1331
|
-
return n.default(
|
|
1350
|
+
return n.default(lt(n)).meta({ title: t.title });
|
|
1332
1351
|
}
|
|
1333
|
-
function
|
|
1352
|
+
function Zn(e) {
|
|
1334
1353
|
return e.def;
|
|
1335
1354
|
}
|
|
1336
1355
|
function $(e) {
|
|
1337
1356
|
if (o.globalRegistry.get(e)?.formType === "list") return !0;
|
|
1338
|
-
let t =
|
|
1357
|
+
let t = Zn(e);
|
|
1339
1358
|
return t.shape ? Object.values(t.shape).some($) : t.options ? t.options.some($) : t.element ? $(t.element) : t.innerType ? $(t.innerType) : !1;
|
|
1340
1359
|
}
|
|
1341
|
-
function
|
|
1342
|
-
let t = e, n =
|
|
1343
|
-
for (; n;) t = n, n =
|
|
1360
|
+
function Qn(e) {
|
|
1361
|
+
let t = e, n = Zn(t).innerType;
|
|
1362
|
+
for (; n;) t = n, n = Zn(t).innerType;
|
|
1344
1363
|
return t;
|
|
1345
1364
|
}
|
|
1346
|
-
function
|
|
1347
|
-
let t =
|
|
1365
|
+
function $n(e) {
|
|
1366
|
+
let t = Zn(Qn(e));
|
|
1348
1367
|
if (t.shape) return new Set(Object.keys(t.shape));
|
|
1349
1368
|
if (t.options) {
|
|
1350
1369
|
let e = [];
|
|
1351
1370
|
for (let n of t.options) {
|
|
1352
|
-
let t =
|
|
1371
|
+
let t = $n(n);
|
|
1353
1372
|
if (!t) return null;
|
|
1354
1373
|
e.push(t);
|
|
1355
1374
|
}
|
|
@@ -1361,7 +1380,7 @@ function Gn(e) {
|
|
|
1361
1380
|
}
|
|
1362
1381
|
return null;
|
|
1363
1382
|
}
|
|
1364
|
-
function
|
|
1383
|
+
function er(e, t, n) {
|
|
1365
1384
|
let r = { [t]: n };
|
|
1366
1385
|
try {
|
|
1367
1386
|
return e.parse(r);
|
|
@@ -1369,12 +1388,12 @@ function Kn(e, t, n) {
|
|
|
1369
1388
|
return r;
|
|
1370
1389
|
}
|
|
1371
1390
|
}
|
|
1372
|
-
function
|
|
1391
|
+
function tr(e, t) {
|
|
1373
1392
|
if (!Number.isInteger(t.max) || t.max < 1) throw Error(`field.list: max must be a positive integer, got ${t.max}`);
|
|
1374
|
-
if (t.max >
|
|
1393
|
+
if (t.max > Rn) throw Error(`field.list: max ${t.max} exceeds the ceiling of ${Rn}`);
|
|
1375
1394
|
if (t.min !== void 0 && (!Number.isInteger(t.min) || t.min < 0 || t.min > t.max)) throw Error(`field.list: min must be an integer between 0 and max, got ${t.min}`);
|
|
1376
1395
|
if ($(e)) throw Error("field.list: a list item cannot contain another field.list (depth 1 only)");
|
|
1377
|
-
if (t.labelField !== void 0 &&
|
|
1396
|
+
if (t.labelField !== void 0 && !$n(e)?.has(t.labelField)) throw Error(`field.list: labelField "${t.labelField}" must name a field present in every item`);
|
|
1378
1397
|
let n = o.array(e);
|
|
1379
1398
|
return t.min !== void 0 && (n = n.min(t.min)), n = n.max(t.max), n.default([]).meta(Q({
|
|
1380
1399
|
formType: "list",
|
|
@@ -1384,7 +1403,7 @@ function qn(e, t) {
|
|
|
1384
1403
|
labelField: t.labelField
|
|
1385
1404
|
}));
|
|
1386
1405
|
}
|
|
1387
|
-
function
|
|
1406
|
+
function nr(e, t, n) {
|
|
1388
1407
|
let r = Object.keys(t)[0];
|
|
1389
1408
|
if (r === void 0) throw Error("field.variants: at least one variant is required");
|
|
1390
1409
|
if (n.shared && e in n.shared) throw Error(`field.variants: shared fields cannot redefine the discriminator "${e}"`);
|
|
@@ -1397,7 +1416,7 @@ function Jn(e, t, n) {
|
|
|
1397
1416
|
...r,
|
|
1398
1417
|
[e]: o.literal(t)
|
|
1399
1418
|
})), a = o.discriminatedUnion(e, i), s = i[0];
|
|
1400
|
-
return a.default(s ?
|
|
1419
|
+
return a.default(s ? er(s, e, r) : {}).meta(Q({
|
|
1401
1420
|
formType: "variants",
|
|
1402
1421
|
discriminator: e,
|
|
1403
1422
|
title: n.title,
|
|
@@ -1405,28 +1424,28 @@ function Jn(e, t, n) {
|
|
|
1405
1424
|
labels: n.labels
|
|
1406
1425
|
}));
|
|
1407
1426
|
}
|
|
1408
|
-
var
|
|
1409
|
-
title:
|
|
1410
|
-
text:
|
|
1411
|
-
number:
|
|
1412
|
-
toggle:
|
|
1413
|
-
choice:
|
|
1414
|
-
entities:
|
|
1415
|
-
entity:
|
|
1416
|
-
area:
|
|
1417
|
-
icon:
|
|
1418
|
-
image:
|
|
1419
|
-
stringList:
|
|
1420
|
-
group:
|
|
1421
|
-
list:
|
|
1422
|
-
variants:
|
|
1427
|
+
var rr = {
|
|
1428
|
+
title: zn,
|
|
1429
|
+
text: Bn,
|
|
1430
|
+
number: Vn,
|
|
1431
|
+
toggle: Hn,
|
|
1432
|
+
choice: Un,
|
|
1433
|
+
entities: Wn,
|
|
1434
|
+
entity: Gn,
|
|
1435
|
+
area: Kn,
|
|
1436
|
+
icon: qn,
|
|
1437
|
+
image: Jn,
|
|
1438
|
+
stringList: Yn,
|
|
1439
|
+
group: Xn,
|
|
1440
|
+
list: tr,
|
|
1441
|
+
variants: nr
|
|
1423
1442
|
};
|
|
1424
|
-
function
|
|
1443
|
+
function ir(e) {
|
|
1425
1444
|
return o.object(e);
|
|
1426
1445
|
}
|
|
1427
1446
|
//#endregion
|
|
1428
1447
|
//#region src/shared/spline.ts
|
|
1429
|
-
function
|
|
1448
|
+
function ar(e) {
|
|
1430
1449
|
if (e.length < 2) return "";
|
|
1431
1450
|
let t = e[0], n = e[1];
|
|
1432
1451
|
if (!t || !n) return "";
|
|
@@ -1453,14 +1472,14 @@ function Zn(e) {
|
|
|
1453
1472
|
}
|
|
1454
1473
|
//#endregion
|
|
1455
1474
|
//#region src/theme.ts
|
|
1456
|
-
function
|
|
1475
|
+
function or() {
|
|
1457
1476
|
return document.documentElement.classList.contains("dark");
|
|
1458
1477
|
}
|
|
1459
1478
|
//#endregion
|
|
1460
1479
|
//#region src/version.ts
|
|
1461
|
-
var
|
|
1480
|
+
var sr = {
|
|
1462
1481
|
name: "@glasshome/widget-sdk",
|
|
1463
|
-
version: "1.
|
|
1482
|
+
version: "1.14.0",
|
|
1464
1483
|
description: "SDK for building GlassHome dashboard widgets with SolidJS",
|
|
1465
1484
|
keywords: [
|
|
1466
1485
|
"glasshome",
|
|
@@ -1520,7 +1539,7 @@ var $n = {
|
|
|
1520
1539
|
},
|
|
1521
1540
|
peerDependencies: {
|
|
1522
1541
|
"@glasshome/sync-layer": "0.8.0",
|
|
1523
|
-
"@glasshome/ui": "1.
|
|
1542
|
+
"@glasshome/ui": "1.7.0",
|
|
1524
1543
|
"solid-js": "^1.9.11"
|
|
1525
1544
|
},
|
|
1526
1545
|
dependencies: {
|
|
@@ -1535,7 +1554,7 @@ var $n = {
|
|
|
1535
1554
|
zod: "^4.1.13"
|
|
1536
1555
|
},
|
|
1537
1556
|
devDependencies: {
|
|
1538
|
-
"@glasshome/ui": "1.
|
|
1557
|
+
"@glasshome/ui": "1.7.0",
|
|
1539
1558
|
"@solidjs/testing-library": "^0.8.10",
|
|
1540
1559
|
"@types/bun": "latest",
|
|
1541
1560
|
"@types/node": "^25.2.2",
|
|
@@ -1556,4 +1575,4 @@ var $n = {
|
|
|
1556
1575
|
engines: { node: ">=18" }
|
|
1557
1576
|
}.version;
|
|
1558
1577
|
//#endregion
|
|
1559
|
-
export {
|
|
1578
|
+
export { xe as Badge, Se as Button, Ce as Carousel, we as CarouselContent, Te as CarouselDots, Ee as CarouselItem, De as CarouselNext, Oe as CarouselPrevious, ke as ColorSlider, Ae as ColorWheel, je as Input, Me as Label, Ne as ResponsiveDialog, Pe as ResponsiveDialogBody, Ie as ResponsiveDialogClose, Le as ResponsiveDialogContent, Re as ResponsiveDialogDescription, ze as ResponsiveDialogFooter, Ve as ResponsiveDialogHeader, He as ResponsiveDialogTitle, sr as SDK_VERSION, Ue as SchemaForm, We as Select, Ge as SelectContent, Ke as SelectItem, qe as SelectTrigger, Je as SelectValue, Ye as Slider, Xe as Switch, Ze as Tabs, $e as TabsContent, tt as TabsList, rt as TabsTrigger, In as ToneSchema, U as Widget, kt as WidgetContent, R as WidgetCtx, _n as WidgetDialog, Nt as WidgetIcon, r as WidgetManifestSchema, _t as WidgetSizeCtx, Dt as WidgetSliderFill, Ft as WidgetStatus, Rt as WidgetTitle, Xt as WidgetValue, g as byDomain, zt as calculateLightGroup, Bt as calculateSensorGroup, Gt as countActiveEntities, ir as defineConfig, ut as defineWidget, t as deprecations, rr as field, n as formatDeprecation, i as formatSchemaError, Wt as getEntityAttribute, s as getForecasts, c as getStream, l as getWebRtcClientConfig, u as hassMediaUrl, at as imageUrl, Ct as injectTokens, or as isDark, Ut as isEntityActive, ot as mediaUrl, ar as monotoneCubicPath, st as parseColor, d as sendWebRtcCandidate, f as startWebRtcSession, p as state, Fn as svgColors, m as trackEntityHistory, h as untrackEntityHistory, _ as useArea, v as useCalendarEvents, ee as useCamera, y as useConnection, b as useCurrency, te as useEntities, ne as useEntity, re as useEntityHistory, ie as useEntityStatistics, ae as useForecast, oe as useHassConfig, vn as useIntersectionPause, se as useLocale, yn as useReducedMotion, pt as useService, x as useStore, S as useTemperatureUnit, gt as useToggle, ht as useTurnOff, mt as useTurnOn, w as useUnitSystem, dt as useWidgetContext, bn as useWidgetDialog, vt as useWidgetDimensions, xn as useWidgetEntityGroup, Mn as useWidgetGestures, Ln as widgetFields, a as z };
|