@glasshome/widget-sdk 1.19.0 → 1.20.1
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/components/anatomy.d.ts +2 -1
- package/dist/framework/dialogs/WidgetDialog.d.ts +1 -1
- package/dist/framework/gestures/use-widget-gestures.d.ts +4 -0
- package/dist/framework/hooks/use-widget-context.d.ts +4 -0
- package/dist/framework/hooks/widget-registry.d.ts +4 -1
- package/dist/index.js +584 -555
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { deprecate as e, deprecations as t, formatDeprecation as n } from "./deprecations.js";
|
|
2
2
|
import { WidgetManifestSchema as r, formatSchemaError as i } from "./schemas.js";
|
|
3
3
|
import { z as a, z as o } from "zod";
|
|
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
|
|
5
|
-
import { byDomain as
|
|
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 ee } from "@glasshome/sync-layer";
|
|
5
|
+
import { byDomain as h, useArea as g, useCalendarEvents as _, useCamera as v, useConnection as y, useCurrency as b, useEntities as x, useEntity as S, useEntity as te, useEntityHistory as ne, useEntityStatistics as re, useForecast as ie, useHassConfig as ae, useLocale as oe, useService as se, useStore as ce, useTemperatureUnit as le, useToggle as ue, useTurnOff as de, useTurnOn as fe, useUnitSystem as pe } from "@glasshome/sync-layer/solid";
|
|
6
6
|
import { For as C, Show as w, children as T, createContext as me, createEffect as E, createMemo as D, createSignal as O, on as he, onCleanup as k, onMount as ge, splitProps as _e, useContext as A } from "solid-js";
|
|
7
7
|
import { addEventListener as j, className as M, createComponent as N, delegateEvents as ve, effect as P, insert as F, memo as I, setAttribute as L, setStyleProperty as R, style as z, template as B, use as V } from "solid-js/web";
|
|
8
|
-
import { Accordion as ye, AccordionContent as be, AccordionItem as xe, AccordionTrigger as Se, Badge as Ce, Badge as we, Button as Te, Button as Ee, ButtonGroup as De, ButtonGroup as Oe, Carousel as ke, CarouselContent as Ae, CarouselDots as je, CarouselItem as Me, CarouselNext as Ne, CarouselPrevious as Pe, ColorDisc as Fe, ColorSlider as Ie, ColorWheel as Le, CountPill as Re, CountPill as ze, Empty as Be, EmptyDescription as Ve, EmptyHeader as He, EmptyTitle as Ue, FactRow as H, FieldGroup as We, FieldTitle as Ge,
|
|
9
|
-
import { clsx as
|
|
10
|
-
import { twMerge as
|
|
8
|
+
import { Accordion as ye, AccordionContent as be, AccordionItem as xe, AccordionTrigger as Se, Badge as Ce, Badge as we, Button as Te, Button as Ee, ButtonGroup as De, ButtonGroup as Oe, Carousel as ke, CarouselContent as Ae, CarouselDots as je, CarouselItem as Me, CarouselNext as Ne, CarouselPrevious as Pe, ColorDisc as Fe, ColorSlider as Ie, ColorWheel as Le, CountPill as Re, CountPill as ze, Empty as Be, EmptyDescription as Ve, EmptyHeader as He, EmptyTitle as Ue, FactRow as H, FieldGroup as We, FieldTitle as Ge, HOLD_GRACE_MS as Ke, HOLD_MS as qe, Icon as Je, Icon as U, Input as Ye, Label as Xe, Popover as Ze, PopoverContent as Qe, Progress as $e, ResponsiveDialog as et, ResponsiveDialogBody as tt, ResponsiveDialogBody as nt, ResponsiveDialogClose as rt, ResponsiveDialogContent as it, ResponsiveDialogDescription as at, ResponsiveDialogFooter as ot, ResponsiveDialogFooter as st, ResponsiveDialogHeader as ct, ResponsiveDialogTitle as lt, SchemaForm as ut, SectionIcon as dt, SectionIcon as ft, SectionMeta as pt, SectionRow as mt, SectionTitle as ht, Select as gt, SelectContent as _t, SelectItem as vt, SelectTrigger as yt, SelectValue as bt, Slider as xt, SwatchPicker as St, Switch as Ct, Tabs as wt, Tabs as Tt, TabsContent as Et, TabsContent as Dt, TabsList as Ot, TabsList as kt, TabsTrigger as At, TabsTrigger as jt, TemperatureBar as Mt, Toggle as Nt, ToggleGroup as Pt, ToggleGroup as Ft, ToggleGroupItem as It, ToggleGroupItem as Lt, buttonVariants as Rt, imagePreset as zt, imagePreset as Bt, imageUrl as Vt, imageUrl as Ht, mediaUrl as Ut, parseColor as Wt, presetValue as Gt } from "@glasshome/ui/solid";
|
|
9
|
+
import { clsx as Kt } from "clsx";
|
|
10
|
+
import { twMerge as qt } from "tailwind-merge";
|
|
11
11
|
//#region src/framework/to-form-schema.ts
|
|
12
|
-
function
|
|
12
|
+
function Jt(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 Wt(e) {
|
|
|
18
18
|
} : e.jsonSchema;
|
|
19
19
|
} });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function Yt(e) {
|
|
22
22
|
try {
|
|
23
23
|
return e.parse({});
|
|
24
24
|
} catch {
|
|
@@ -27,30 +27,30 @@ function Gt(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 Xt(e) {
|
|
31
|
+
return e.configSchema && (e.manifest.schema || (e.manifest.schema = Jt(e.configSchema)), e.manifest.defaultConfig || (e.manifest.defaultConfig = Yt(e.configSchema))), e;
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
34
|
//#region src/framework/hooks/use-widget-context.ts
|
|
35
35
|
var W = me();
|
|
36
|
-
function
|
|
36
|
+
function Zt() {
|
|
37
37
|
let e = A(W);
|
|
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 Qt(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
48
|
function G(e, t) {
|
|
49
49
|
return async (n, r = {}) => {
|
|
50
|
-
await e(
|
|
50
|
+
await e(Qt(n), t, r, { entity_id: n });
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function $t() {
|
|
54
54
|
let e = A(W)?.callService;
|
|
55
55
|
return e ? {
|
|
56
56
|
callService: e,
|
|
@@ -59,15 +59,15 @@ function Yt() {
|
|
|
59
59
|
toggle: G(e, "toggle")
|
|
60
60
|
} : se();
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function en() {
|
|
63
63
|
let e = A(W)?.callService;
|
|
64
64
|
return e ? G(e, "turn_on") : fe();
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function tn() {
|
|
67
67
|
let e = A(W)?.callService;
|
|
68
68
|
return e ? G(e, "turn_off") : de();
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function nn() {
|
|
71
71
|
let e = A(W)?.callService;
|
|
72
72
|
return e ? G(e, "toggle") : ue();
|
|
73
73
|
}
|
|
@@ -79,7 +79,7 @@ var K = {
|
|
|
79
79
|
OVERLAY: 20,
|
|
80
80
|
ACTIONS: 30
|
|
81
81
|
}, q = /* @__PURE__ */ new WeakMap();
|
|
82
|
-
function
|
|
82
|
+
function rn(e = "controls") {
|
|
83
83
|
let [t, n] = O(!1), [r, i] = O(e), a = (t) => {
|
|
84
84
|
i(t ?? e), n(!0);
|
|
85
85
|
}, o = A(W);
|
|
@@ -106,15 +106,15 @@ function $t(e = "controls") {
|
|
|
106
106
|
}
|
|
107
107
|
//#endregion
|
|
108
108
|
//#region src/framework/hooks/widget-registry.ts
|
|
109
|
-
var
|
|
110
|
-
function
|
|
111
|
-
return e[
|
|
109
|
+
var an = /* @__PURE__ */ new WeakMap(), on = Symbol("glasshome.widget.registry");
|
|
110
|
+
function sn(e) {
|
|
111
|
+
return e[on] ?? e;
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function cn(e) {
|
|
114
114
|
if (!e) return;
|
|
115
|
-
let t =
|
|
115
|
+
let t = sn(e), n = an.get(t);
|
|
116
116
|
if (!n) {
|
|
117
|
-
let [e, r] = O(!1), [i, a] = O(), [o, s] = O(), [c, l] = O();
|
|
117
|
+
let [e, r] = O(!1), [i, a] = O(), [o, s] = O(), [c, l] = O(), [u, d] = O(!1);
|
|
118
118
|
n = {
|
|
119
119
|
hasSheet: e,
|
|
120
120
|
setHasSheet: r,
|
|
@@ -123,47 +123,49 @@ function rn(e) {
|
|
|
123
123
|
accent: o,
|
|
124
124
|
setAccent: s,
|
|
125
125
|
icon: c,
|
|
126
|
-
setIcon: l
|
|
127
|
-
|
|
126
|
+
setIcon: l,
|
|
127
|
+
nothingMore: u,
|
|
128
|
+
setNothingMore: d
|
|
129
|
+
}, an.set(t, n);
|
|
128
130
|
}
|
|
129
131
|
return n;
|
|
130
132
|
}
|
|
131
133
|
//#endregion
|
|
132
134
|
//#region src/framework/gestures/cursors.ts
|
|
133
|
-
var
|
|
134
|
-
function
|
|
135
|
+
var ln = 32, J = ln / 2, Y = "white", un = "rgba(0,0,0,0.4)", dn = 2, fn = 3;
|
|
136
|
+
function pn(e) {
|
|
135
137
|
return `url("data:image/svg+xml,${encodeURIComponent(e)}")`;
|
|
136
138
|
}
|
|
137
|
-
function
|
|
138
|
-
return `<svg xmlns="http://www.w3.org/2000/svg" width="${
|
|
139
|
+
function mn(e) {
|
|
140
|
+
return `<svg xmlns="http://www.w3.org/2000/svg" width="${ln}" height="${ln}" viewBox="0 0 ${ln} ${ln}">${e}</svg>`;
|
|
139
141
|
}
|
|
140
|
-
var
|
|
142
|
+
var hn = mn(`
|
|
141
143
|
<g transform="translate(6, 2)">
|
|
142
144
|
<!-- shadow -->
|
|
143
|
-
<g stroke="${
|
|
145
|
+
<g stroke="${un}" stroke-width="${fn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
144
146
|
<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"/>
|
|
145
147
|
</g>
|
|
146
148
|
<!-- main -->
|
|
147
|
-
<g stroke="${Y}" stroke-width="${
|
|
149
|
+
<g stroke="${Y}" stroke-width="${dn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
148
150
|
<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"/>
|
|
149
151
|
</g>
|
|
150
152
|
</g>
|
|
151
|
-
`),
|
|
153
|
+
`), gn = mn(`
|
|
152
154
|
<g>
|
|
153
|
-
<circle cx="${J}" cy="${J}" r="8" stroke="${
|
|
155
|
+
<circle cx="${J}" cy="${J}" r="8" stroke="${un}" stroke-width="${fn}" fill="none"/>
|
|
154
156
|
<circle cx="${J}" cy="${J}" r="8" stroke="${Y}" stroke-width="1.5" fill="none"/>
|
|
155
157
|
<circle cx="${J}" cy="${J}" r="1.5" fill="${Y}"/>
|
|
156
158
|
</g>
|
|
157
|
-
`),
|
|
159
|
+
`), _n = mn(`
|
|
158
160
|
<g>
|
|
159
161
|
<!-- shadow -->
|
|
160
|
-
<g stroke="${
|
|
162
|
+
<g stroke="${un}" stroke-width="${fn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
161
163
|
<line x1="6" y1="${J}" x2="26" y2="${J}"/>
|
|
162
164
|
<polyline points="10,12 6,${J} 10,20"/>
|
|
163
165
|
<polyline points="22,12 26,${J} 22,20"/>
|
|
164
166
|
</g>
|
|
165
167
|
<!-- main -->
|
|
166
|
-
<g stroke="${Y}" stroke-width="${
|
|
168
|
+
<g stroke="${Y}" stroke-width="${dn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
167
169
|
<line x1="6" y1="${J}" x2="26" y2="${J}"/>
|
|
168
170
|
<polyline points="10,12 6,${J} 10,20"/>
|
|
169
171
|
<polyline points="22,12 26,${J} 22,20"/>
|
|
@@ -173,16 +175,16 @@ var dn = un(`
|
|
|
173
175
|
<circle cx="11" cy="${J}" r="1" fill="${Y}" opacity="0.6"/>
|
|
174
176
|
<circle cx="21" cy="${J}" r="1" fill="${Y}" opacity="0.6"/>
|
|
175
177
|
</g>
|
|
176
|
-
`),
|
|
178
|
+
`), vn = mn(`
|
|
177
179
|
<g>
|
|
178
180
|
<!-- shadow -->
|
|
179
|
-
<g stroke="${
|
|
181
|
+
<g stroke="${un}" stroke-width="${fn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
180
182
|
<line x1="${J}" y1="6" x2="${J}" y2="26"/>
|
|
181
183
|
<polyline points="12,10 ${J},6 20,10"/>
|
|
182
184
|
<polyline points="12,22 ${J},26 20,22"/>
|
|
183
185
|
</g>
|
|
184
186
|
<!-- main -->
|
|
185
|
-
<g stroke="${Y}" stroke-width="${
|
|
187
|
+
<g stroke="${Y}" stroke-width="${dn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
186
188
|
<line x1="${J}" y1="6" x2="${J}" y2="26"/>
|
|
187
189
|
<polyline points="12,10 ${J},6 20,10"/>
|
|
188
190
|
<polyline points="12,22 ${J},26 20,22"/>
|
|
@@ -192,10 +194,10 @@ var dn = un(`
|
|
|
192
194
|
<circle cx="${J}" cy="11" r="1" fill="${Y}" opacity="0.6"/>
|
|
193
195
|
<circle cx="${J}" cy="21" r="1" fill="${Y}" opacity="0.6"/>
|
|
194
196
|
</g>
|
|
195
|
-
`),
|
|
197
|
+
`), yn = mn(`
|
|
196
198
|
<g>
|
|
197
199
|
<!-- shadow -->
|
|
198
|
-
<g stroke="${
|
|
200
|
+
<g stroke="${un}" stroke-width="${fn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
199
201
|
<line x1="7" y1="${J}" x2="25" y2="${J}"/>
|
|
200
202
|
<line x1="${J}" y1="7" x2="${J}" y2="25"/>
|
|
201
203
|
<polyline points="11,13 7,${J} 11,19"/>
|
|
@@ -204,7 +206,7 @@ var dn = un(`
|
|
|
204
206
|
<polyline points="13,21 ${J},25 19,21"/>
|
|
205
207
|
</g>
|
|
206
208
|
<!-- main -->
|
|
207
|
-
<g stroke="${Y}" stroke-width="${
|
|
209
|
+
<g stroke="${Y}" stroke-width="${dn}" fill="none" stroke-linecap="round" stroke-linejoin="round">
|
|
208
210
|
<line x1="7" y1="${J}" x2="25" y2="${J}"/>
|
|
209
211
|
<line x1="${J}" y1="7" x2="${J}" y2="25"/>
|
|
210
212
|
<polyline points="11,13 7,${J} 11,19"/>
|
|
@@ -216,71 +218,69 @@ var dn = un(`
|
|
|
216
218
|
<circle cx="${J}" cy="${J}" r="2" fill="${Y}"/>
|
|
217
219
|
</g>
|
|
218
220
|
`);
|
|
219
|
-
function
|
|
221
|
+
function bn(e, t, n) {
|
|
220
222
|
return {
|
|
221
|
-
css: `${
|
|
223
|
+
css: `${pn(e)} ${t} ${n}, auto`,
|
|
222
224
|
hotspotX: t,
|
|
223
225
|
hotspotY: n
|
|
224
226
|
};
|
|
225
227
|
}
|
|
226
|
-
var
|
|
227
|
-
tap:
|
|
228
|
-
hold: gn
|
|
229
|
-
slideHorizontal:
|
|
230
|
-
slideVertical:
|
|
231
|
-
slideAuto:
|
|
228
|
+
var xn = {
|
|
229
|
+
tap: bn(hn, 12, 4),
|
|
230
|
+
hold: bn(gn, 16, 16),
|
|
231
|
+
slideHorizontal: bn(_n, J, J),
|
|
232
|
+
slideVertical: bn(vn, J, J),
|
|
233
|
+
slideAuto: bn(yn, J, J)
|
|
232
234
|
};
|
|
233
235
|
//#endregion
|
|
234
236
|
//#region src/framework/gestures/haptics.ts
|
|
235
|
-
function
|
|
237
|
+
function Sn() {
|
|
236
238
|
if (typeof window > "u") return null;
|
|
237
239
|
let e = window;
|
|
238
240
|
return e.Capacitor?.isNativePlatform?.() ? e.Capacitor.Plugins?.Haptics ?? null : null;
|
|
239
241
|
}
|
|
240
|
-
function
|
|
242
|
+
function Cn(e) {
|
|
241
243
|
if (typeof navigator < "u" && typeof navigator.vibrate == "function") try {
|
|
242
244
|
navigator.vibrate(e);
|
|
243
245
|
} catch {}
|
|
244
246
|
}
|
|
245
|
-
var
|
|
247
|
+
var wn = {
|
|
246
248
|
tick() {
|
|
247
|
-
let e =
|
|
249
|
+
let e = Sn();
|
|
248
250
|
if (e) {
|
|
249
251
|
e.impact({ style: "Light" }).catch(() => {});
|
|
250
252
|
return;
|
|
251
253
|
}
|
|
252
|
-
|
|
254
|
+
Cn(8);
|
|
253
255
|
},
|
|
254
256
|
bump() {
|
|
255
|
-
let e =
|
|
257
|
+
let e = Sn();
|
|
256
258
|
if (e) {
|
|
257
259
|
e.impact({ style: "Medium" }).catch(() => {});
|
|
258
260
|
return;
|
|
259
261
|
}
|
|
260
|
-
|
|
262
|
+
Cn(20);
|
|
261
263
|
},
|
|
262
264
|
pulse() {
|
|
263
|
-
let e =
|
|
265
|
+
let e = Sn();
|
|
264
266
|
if (e) {
|
|
265
267
|
e.impact({ style: "Heavy" }).catch(() => {});
|
|
266
268
|
return;
|
|
267
269
|
}
|
|
268
|
-
|
|
270
|
+
Cn([
|
|
269
271
|
0,
|
|
270
272
|
15,
|
|
271
273
|
40,
|
|
272
274
|
15
|
|
273
275
|
]);
|
|
274
276
|
}
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
function xn(e, t) {
|
|
279
|
-
let n = A(W), r = rn(n), i = () => {
|
|
277
|
+
}, Tn = "button, a, input, select, textarea, [role=\"slider\"], [role=\"radio\"], [role=\"switch\"]";
|
|
278
|
+
function En(e, t) {
|
|
279
|
+
let n = A(W), r = cn(n), i = () => {
|
|
280
280
|
let t = e();
|
|
281
|
-
return t.hold || !n
|
|
281
|
+
return t.hold || !n ? t : {
|
|
282
282
|
...t,
|
|
283
|
-
hold: { action: () => q.get(n)?.() }
|
|
283
|
+
hold: { action: () => r?.hasSheet() ? q.get(n)?.() : r?.setNothingMore(!0) }
|
|
284
284
|
};
|
|
285
285
|
}, a = {
|
|
286
286
|
isDown: !1,
|
|
@@ -290,6 +290,7 @@ function xn(e, t) {
|
|
|
290
290
|
startTime: 0,
|
|
291
291
|
hasMoved: !1,
|
|
292
292
|
sliding: !1,
|
|
293
|
+
holdOnly: !1,
|
|
293
294
|
holdTimer: null,
|
|
294
295
|
graceTimer: null,
|
|
295
296
|
element: null
|
|
@@ -314,7 +315,7 @@ function xn(e, t) {
|
|
|
314
315
|
}
|
|
315
316
|
let m = () => {
|
|
316
317
|
a.holdTimer &&= (clearTimeout(a.holdTimer), null), a.graceTimer &&= (clearTimeout(a.graceTimer), null), s(null);
|
|
317
|
-
},
|
|
318
|
+
}, ee = (e) => {
|
|
318
319
|
let t = (e) => {
|
|
319
320
|
e.stopPropagation(), e.preventDefault();
|
|
320
321
|
}, n = () => e.removeEventListener("click", t, !0);
|
|
@@ -322,39 +323,39 @@ function xn(e, t) {
|
|
|
322
323
|
capture: !0,
|
|
323
324
|
once: !0
|
|
324
325
|
});
|
|
325
|
-
},
|
|
326
|
-
a.isDown = !1, a.hasMoved = !1, a.sliding = !1;
|
|
327
|
-
},
|
|
326
|
+
}, h = () => {
|
|
327
|
+
a.isDown = !1, a.hasMoved = !1, a.sliding = !1, a.holdOnly = !1;
|
|
328
|
+
}, g = (e) => {
|
|
328
329
|
let n = i().slide;
|
|
329
330
|
return n?.orientation === "horizontal" ? "horizontal" : n?.orientation === "vertical" ? "vertical" : e && (c || p(e), c) ? c.height > c.width ? "vertical" : "horizontal" : (t?.() ?? "horizontal") === "horizontal" ? "horizontal" : "vertical";
|
|
330
|
-
},
|
|
331
|
-
let t = i();
|
|
332
|
-
if (t.tap
|
|
333
|
-
if (a.isDown = !0, a.isTouch = e.pointerType === "touch", a.element = e.currentTarget, p(a.element), a.startX = e.clientX, a.startY = e.clientY, a.startTime = Date.now(), a.hasMoved = !1, a.sliding = !1, t.hold) {
|
|
334
|
-
let
|
|
331
|
+
}, _ = (e) => {
|
|
332
|
+
let t = i(), r = e.target instanceof Element ? e.target.closest(`${Tn}, .glasshome-widget-controls`) : null, o = r !== null && r !== e.currentTarget;
|
|
333
|
+
if (!(o ? !t.hold : !t.tap && !t.hold && !t.slide)) {
|
|
334
|
+
if (a.isDown = !0, a.holdOnly = o, a.isTouch = e.pointerType === "touch", a.element = e.currentTarget, p(a.element), a.startX = e.clientX, a.startY = e.clientY, a.startTime = Date.now(), a.hasMoved = !1, a.sliding = !1, t.hold) {
|
|
335
|
+
let r = t.hold.delay ?? qe, i = a.element.getBoundingClientRect(), o = e.clientX - i.left, c = e.clientY - i.top, l = Math.hypot(Math.max(o, i.width - o), Math.max(c, i.height - c));
|
|
335
336
|
a.graceTimer = setTimeout(() => {
|
|
336
337
|
a.graceTimer = null, s({
|
|
337
|
-
x:
|
|
338
|
-
y:
|
|
339
|
-
r:
|
|
338
|
+
x: o,
|
|
339
|
+
y: c,
|
|
340
|
+
r: l,
|
|
340
341
|
fired: !1
|
|
341
342
|
});
|
|
342
|
-
}, Math.min(
|
|
343
|
+
}, Math.min(Ke, r)), a.holdTimer = setTimeout(() => {
|
|
343
344
|
a.holdTimer = null, a.isDown && !a.hasMoved && (s((e) => e && {
|
|
344
345
|
...e,
|
|
345
346
|
fired: !0
|
|
346
|
-
}),
|
|
347
|
-
},
|
|
347
|
+
}), wn.bump(), a.element && ee(a.element), t.hold?.action(), n?.onHeld?.(), a.isDown = !1);
|
|
348
|
+
}, r);
|
|
348
349
|
}
|
|
349
|
-
if (!a.isTouch && t.slide) try {
|
|
350
|
+
if (!a.isTouch && t.slide && !o) try {
|
|
350
351
|
e.currentTarget.setPointerCapture(e.pointerId);
|
|
351
352
|
} catch {}
|
|
352
353
|
}
|
|
353
|
-
},
|
|
354
|
+
}, v = (e) => {
|
|
354
355
|
if (!a.isDown) return;
|
|
355
356
|
let t = i(), n = e.clientX - a.startX, r = e.clientY - a.startY;
|
|
356
|
-
if (Math.sqrt(n * n + r * r) > 10 && (m(), a.hasMoved = !0), t.slide && a.hasMoved) {
|
|
357
|
-
let i = e.currentTarget, o =
|
|
357
|
+
if (Math.sqrt(n * n + r * r) > 10 && (m(), a.hasMoved = !0), t.slide && a.hasMoved && !a.holdOnly) {
|
|
358
|
+
let i = e.currentTarget, o = g(i);
|
|
358
359
|
if (a.isTouch && !a.sliding && Math.abs(o === "vertical" ? r : n) < Math.abs(o === "vertical" ? n : r)) return;
|
|
359
360
|
a.sliding = !0;
|
|
360
361
|
let s = t.slide.min ?? 0, l = t.slide.max ?? 100, u = l - s, d = o === "vertical" ? -r : n, f = c ?? {
|
|
@@ -363,40 +364,40 @@ function xn(e, t) {
|
|
|
363
364
|
}, p = d / (o === "vertical" ? f.height : f.width) * u, m = Math.max(s, Math.min(l, t.slide.value + p));
|
|
364
365
|
t.slide.onChange(Math.round(m)), a.startX = e.clientX, a.startY = e.clientY, e.preventDefault();
|
|
365
366
|
}
|
|
366
|
-
},
|
|
367
|
-
let t = i(), n = a.isDown, r = Date.now() - a.startTime, o = t.hold?.delay ??
|
|
368
|
-
m(), n && t.tap && !a.hasMoved && r < o && t.tap();
|
|
367
|
+
}, y = (e) => {
|
|
368
|
+
let t = i(), n = a.isDown, r = Date.now() - a.startTime, o = t.hold?.delay ?? qe;
|
|
369
|
+
m(), n && t.tap && !a.hasMoved && !a.holdOnly && r < o && t.tap();
|
|
369
370
|
try {
|
|
370
371
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
371
372
|
} catch {}
|
|
372
|
-
|
|
373
|
-
},
|
|
373
|
+
h();
|
|
374
|
+
}, b = (e) => {
|
|
374
375
|
m();
|
|
375
376
|
try {
|
|
376
377
|
e.currentTarget.releasePointerCapture(e.pointerId);
|
|
377
378
|
} catch {}
|
|
378
|
-
|
|
379
|
-
},
|
|
379
|
+
h();
|
|
380
|
+
}, x = (e) => {
|
|
380
381
|
let t = i();
|
|
381
382
|
if (t.slide) {
|
|
382
383
|
let n = t.slide.orientation;
|
|
383
|
-
return n === "horizontal" ?
|
|
384
|
+
return n === "horizontal" ? xn.slideHorizontal.css : n === "vertical" ? xn.slideVertical.css : (c || p(e), c && c.height > c.width ? xn.slideVertical.css : xn.slideHorizontal.css);
|
|
384
385
|
}
|
|
385
|
-
return t.tap ?
|
|
386
|
+
return t.tap ? xn.tap.css : t.hold ? xn.hold.css : "";
|
|
386
387
|
};
|
|
387
388
|
return {
|
|
388
389
|
onKeyDown: (e) => {
|
|
389
390
|
if (e.target !== e.currentTarget) return;
|
|
390
391
|
let t = i();
|
|
391
|
-
(e.key === "Enter" || e.key === " ") && t.tap ? (e.preventDefault(), t.tap()) : (e.key === "ContextMenu" || e.shiftKey && e.key === "F10") && t.hold && (e.preventDefault(), t.hold.action());
|
|
392
|
+
(e.key === "Enter" || e.key === " ") && t.tap ? (e.preventDefault(), t.tap()) : (e.key === "ContextMenu" || e.shiftKey && e.key === "F10") && t.hold && (e.preventDefault(), t.hold.action(), n?.onHeld?.());
|
|
392
393
|
},
|
|
393
|
-
onPointerDown:
|
|
394
|
-
onPointerMove:
|
|
395
|
-
onPointerUp:
|
|
396
|
-
onPointerCancel:
|
|
394
|
+
onPointerDown: _,
|
|
395
|
+
onPointerMove: v,
|
|
396
|
+
onPointerUp: y,
|
|
397
|
+
onPointerCancel: b,
|
|
397
398
|
onPointerEnter: (e) => {
|
|
398
399
|
let t = e.currentTarget;
|
|
399
|
-
a.element = t, t.style.cursor =
|
|
400
|
+
a.element = t, t.style.cursor = x(t);
|
|
400
401
|
},
|
|
401
402
|
bindElement: (e) => {
|
|
402
403
|
e && (a.element = e, p(e));
|
|
@@ -410,6 +411,7 @@ function xn(e, t) {
|
|
|
410
411
|
return e.tap || e.hold ? "manipulation" : "auto";
|
|
411
412
|
},
|
|
412
413
|
hold: o,
|
|
414
|
+
holds: () => !!e().hold || !!r?.hasSheet(),
|
|
413
415
|
dispose: () => {
|
|
414
416
|
m(), u &&= (u.disconnect(), null), l = null, c = null;
|
|
415
417
|
}
|
|
@@ -417,16 +419,16 @@ function xn(e, t) {
|
|
|
417
419
|
}
|
|
418
420
|
//#endregion
|
|
419
421
|
//#region src/framework/hooks/use-widget-dimensions.ts
|
|
420
|
-
var
|
|
421
|
-
function
|
|
422
|
-
let e = A(
|
|
422
|
+
var Dn = me();
|
|
423
|
+
function On() {
|
|
424
|
+
let e = A(Dn);
|
|
423
425
|
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).");
|
|
424
426
|
return e;
|
|
425
427
|
}
|
|
426
428
|
//#endregion
|
|
427
429
|
//#region src/framework/hooks/use-confirm.ts
|
|
428
|
-
var
|
|
429
|
-
function
|
|
430
|
+
var kn = 1600;
|
|
431
|
+
function An() {
|
|
430
432
|
let [e, t] = O(/* @__PURE__ */ new Set()), n;
|
|
431
433
|
return k(() => clearTimeout(n)), {
|
|
432
434
|
has: (t) => e().has(t),
|
|
@@ -437,35 +439,35 @@ function Tn() {
|
|
|
437
439
|
} catch {
|
|
438
440
|
return !1;
|
|
439
441
|
}
|
|
440
|
-
return t(new Set(e)), clearTimeout(n), n = setTimeout(() => t(/* @__PURE__ */ new Set()),
|
|
442
|
+
return t(new Set(e)), clearTimeout(n), n = setTimeout(() => t(/* @__PURE__ */ new Set()), kn), !0;
|
|
441
443
|
}
|
|
442
444
|
};
|
|
443
445
|
}
|
|
444
446
|
//#endregion
|
|
445
447
|
//#region src/framework/utils/cn.ts
|
|
446
448
|
function X(...e) {
|
|
447
|
-
return
|
|
449
|
+
return qt(Kt(e));
|
|
448
450
|
}
|
|
449
451
|
//#endregion
|
|
450
452
|
//#region src/framework/components/WidgetIcon.tsx
|
|
451
|
-
var
|
|
452
|
-
function
|
|
453
|
+
var jn = /*#__PURE__*/ B("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-2 glass glass-tint\">"), Mn = /*#__PURE__*/ B("<div class=\"glasshome-widget-icon glasshome-widget-icon-stack glasshome-widget-icon-stack-3 glass glass-tint\">"), Nn = /*#__PURE__*/ B("<div><div class=\"glasshome-widget-icon-glyph flex items-center justify-center\">");
|
|
454
|
+
function Pn(e) {
|
|
453
455
|
let t = () => e.entityCount ?? 1;
|
|
454
456
|
return (() => {
|
|
455
|
-
var n =
|
|
457
|
+
var n = Nn(), r = n.firstChild;
|
|
456
458
|
return F(n, N(w, {
|
|
457
459
|
get when() {
|
|
458
460
|
return t() >= 2;
|
|
459
461
|
},
|
|
460
462
|
get children() {
|
|
461
|
-
return
|
|
463
|
+
return jn();
|
|
462
464
|
}
|
|
463
465
|
}), r), F(n, N(w, {
|
|
464
466
|
get when() {
|
|
465
467
|
return t() >= 3;
|
|
466
468
|
},
|
|
467
469
|
get children() {
|
|
468
|
-
return
|
|
470
|
+
return Mn();
|
|
469
471
|
}
|
|
470
472
|
}), r), F(r, () => e.icon), P((t) => {
|
|
471
473
|
var r = X("glasshome-widget-icon glass glass-tint", "pointer-events-none relative flex shrink-0 items-center justify-center transition-all", e.dimmed && "opacity-50", e.class), i = e.color ? { "--widget-icon-color": e.color } : void 0;
|
|
@@ -478,9 +480,9 @@ function kn(e) {
|
|
|
478
480
|
}
|
|
479
481
|
//#endregion
|
|
480
482
|
//#region src/framework/components/anatomy.tsx
|
|
481
|
-
var
|
|
482
|
-
function
|
|
483
|
-
let t = A(
|
|
483
|
+
var Fn = /*#__PURE__*/ B("<span class=glasshome-widget-eyebrow>"), In = /*#__PURE__*/ B("<div class=glasshome-widget-head-aside>"), Ln = /*#__PURE__*/ B("<div class=glasshome-widget-head><div class=glasshome-widget-head-text><span class=glasshome-widget-name>"), Rn = /*#__PURE__*/ B("<span class=glasshome-widget-sub>"), zn = /*#__PURE__*/ B("<span class=glasshome-widget-unit>"), Bn = /*#__PURE__*/ B("<div class=glasshome-widget-art>"), Vn = /*#__PURE__*/ B("<div><div class=glasshome-widget-reading><span class=glasshome-widget-reading-value>"), Hn = /*#__PURE__*/ B("<div class=glasshome-widget-controls>"), Un = /*#__PURE__*/ B("<div>"), Wn = /*#__PURE__*/ B("<div class=glasshome-widget-backdrop>"), Gn = /*#__PURE__*/ B("<div class=glasshome-widget-glyph aria-hidden=true>"), Kn = me(() => !1), qn = "mdi:check";
|
|
484
|
+
function Jn(e) {
|
|
485
|
+
let t = A(Kn), n = cn(A(W));
|
|
484
486
|
E(() => n?.setIcon(e.icon)), k(() => {
|
|
485
487
|
n?.icon() === e.icon && n?.setIcon(void 0);
|
|
486
488
|
});
|
|
@@ -489,15 +491,15 @@ function Un(e) {
|
|
|
489
491
|
return typeof t == "string" && typeof e.name == "string" && t.trim().toLowerCase() === e.name.trim().toLowerCase();
|
|
490
492
|
};
|
|
491
493
|
return (() => {
|
|
492
|
-
var n =
|
|
494
|
+
var n = Ln(), o = n.firstChild, s = o.firstChild;
|
|
493
495
|
return F(n, N(w, {
|
|
494
496
|
get when() {
|
|
495
497
|
return e.icon;
|
|
496
498
|
},
|
|
497
|
-
children: (n) => N(
|
|
499
|
+
children: (n) => N(Pn, {
|
|
498
500
|
get icon() {
|
|
499
501
|
return N(U, { get icon() {
|
|
500
|
-
return I(() => !!t())() ?
|
|
502
|
+
return I(() => !!t())() ? qn : n();
|
|
501
503
|
} });
|
|
502
504
|
},
|
|
503
505
|
get entityCount() {
|
|
@@ -513,7 +515,7 @@ function Un(e) {
|
|
|
513
515
|
return I(() => !!r())() && !a();
|
|
514
516
|
},
|
|
515
517
|
get children() {
|
|
516
|
-
var e =
|
|
518
|
+
var e = Fn();
|
|
517
519
|
return F(e, r), e;
|
|
518
520
|
}
|
|
519
521
|
}), s), F(s, () => e.name), F(n, N(w, {
|
|
@@ -521,22 +523,22 @@ function Un(e) {
|
|
|
521
523
|
return i();
|
|
522
524
|
},
|
|
523
525
|
get children() {
|
|
524
|
-
var e =
|
|
526
|
+
var e = In();
|
|
525
527
|
return F(e, i), e;
|
|
526
528
|
}
|
|
527
529
|
}), null), n;
|
|
528
530
|
})();
|
|
529
531
|
}
|
|
530
|
-
function
|
|
532
|
+
function Yn(e) {
|
|
531
533
|
let t = T(() => e.sub), n = T(() => e.art), r = D(() => typeof e.value == "string" ? e.value.replace(/[\d\s.,:/%°+\-−]/g, "") : void 0), i = () => typeof e.value == "string" || typeof e.value == "number" ? String(e.value).length + (e.unit ? .5 : 0) : void 0, [a, o] = O();
|
|
532
534
|
return E(he(r, () => o((e) => e === "a" ? "b" : "a"), { defer: !0 })), (() => {
|
|
533
|
-
var r =
|
|
535
|
+
var r = Vn(), o = r.firstChild, s = o.firstChild;
|
|
534
536
|
return F(o, N(w, {
|
|
535
537
|
get when() {
|
|
536
538
|
return t();
|
|
537
539
|
},
|
|
538
540
|
get children() {
|
|
539
|
-
var e =
|
|
541
|
+
var e = Rn();
|
|
540
542
|
return F(e, t), e;
|
|
541
543
|
}
|
|
542
544
|
}), s), F(s, () => e.value, null), F(s, N(w, {
|
|
@@ -544,7 +546,7 @@ function Wn(e) {
|
|
|
544
546
|
return e.unit;
|
|
545
547
|
},
|
|
546
548
|
get children() {
|
|
547
|
-
var t =
|
|
549
|
+
var t = zn();
|
|
548
550
|
return F(t, () => e.unit), P(() => L(t, "data-degree", e.unit === "°" || void 0)), t;
|
|
549
551
|
}
|
|
550
552
|
}), null), F(r, N(w, {
|
|
@@ -552,7 +554,7 @@ function Wn(e) {
|
|
|
552
554
|
return n();
|
|
553
555
|
},
|
|
554
556
|
get children() {
|
|
555
|
-
var e =
|
|
557
|
+
var e = Bn();
|
|
556
558
|
return F(e, n), e;
|
|
557
559
|
}
|
|
558
560
|
}), null), P((o) => {
|
|
@@ -567,13 +569,13 @@ function Wn(e) {
|
|
|
567
569
|
}), r;
|
|
568
570
|
})();
|
|
569
571
|
}
|
|
570
|
-
function
|
|
572
|
+
function Xn(e) {
|
|
571
573
|
return (() => {
|
|
572
|
-
var t =
|
|
573
|
-
return
|
|
574
|
+
var t = Hn();
|
|
575
|
+
return F(t, () => e.children), t;
|
|
574
576
|
})();
|
|
575
577
|
}
|
|
576
|
-
function
|
|
578
|
+
function Zn(e) {
|
|
577
579
|
return N(Oe, {
|
|
578
580
|
get "aria-label"() {
|
|
579
581
|
return e.label;
|
|
@@ -602,8 +604,8 @@ function Kn(e) {
|
|
|
602
604
|
}
|
|
603
605
|
});
|
|
604
606
|
}
|
|
605
|
-
function
|
|
606
|
-
return N(
|
|
607
|
+
function Qn(e) {
|
|
608
|
+
return N(Ft, {
|
|
607
609
|
get "aria-label"() {
|
|
608
610
|
return e.label;
|
|
609
611
|
},
|
|
@@ -620,7 +622,7 @@ function qn(e) {
|
|
|
620
622
|
get each() {
|
|
621
623
|
return e.options;
|
|
622
624
|
},
|
|
623
|
-
children: (t) => N(
|
|
625
|
+
children: (t) => N(Lt, {
|
|
624
626
|
get value() {
|
|
625
627
|
return t.value;
|
|
626
628
|
},
|
|
@@ -641,8 +643,8 @@ function qn(e) {
|
|
|
641
643
|
}
|
|
642
644
|
});
|
|
643
645
|
}
|
|
644
|
-
function
|
|
645
|
-
let t =
|
|
646
|
+
function $n(e) {
|
|
647
|
+
let t = An(), n = () => e.confirm ?? t, r = () => e.id ?? e["aria-label"] ?? e.icon, i = () => n().has(r());
|
|
646
648
|
return N(Ee, {
|
|
647
649
|
variant: "outline",
|
|
648
650
|
get size() {
|
|
@@ -660,12 +662,12 @@ function Jn(e) {
|
|
|
660
662
|
onClick: () => void n().run([r()], e.run),
|
|
661
663
|
get children() {
|
|
662
664
|
return [N(U, { get icon() {
|
|
663
|
-
return I(() => !!i())() ?
|
|
665
|
+
return I(() => !!i())() ? qn : e.icon;
|
|
664
666
|
} }), I(() => e.children)];
|
|
665
667
|
}
|
|
666
668
|
});
|
|
667
669
|
}
|
|
668
|
-
function
|
|
670
|
+
function er(e) {
|
|
669
671
|
return N(we, {
|
|
670
672
|
get tone() {
|
|
671
673
|
return e.tone ?? "var(--muted-foreground)";
|
|
@@ -683,53 +685,53 @@ function Yn(e) {
|
|
|
683
685
|
}
|
|
684
686
|
});
|
|
685
687
|
}
|
|
686
|
-
function
|
|
688
|
+
function tr(e) {
|
|
687
689
|
return (() => {
|
|
688
|
-
var t =
|
|
690
|
+
var t = Un();
|
|
689
691
|
return F(t, () => e.children), P(() => M(t, X("glasshome-widget-layer", e.class))), t;
|
|
690
692
|
})();
|
|
691
693
|
}
|
|
692
|
-
function
|
|
694
|
+
function nr(e) {
|
|
693
695
|
return (() => {
|
|
694
|
-
var t =
|
|
696
|
+
var t = Wn();
|
|
695
697
|
return F(t, () => e.children), t;
|
|
696
698
|
})();
|
|
697
699
|
}
|
|
698
|
-
function
|
|
699
|
-
let t = A(
|
|
700
|
+
function rr(e) {
|
|
701
|
+
let t = A(Kn);
|
|
700
702
|
return (() => {
|
|
701
|
-
var n =
|
|
703
|
+
var n = Gn();
|
|
702
704
|
return F(n, N(U, { get icon() {
|
|
703
|
-
return I(() => !!t())() ?
|
|
705
|
+
return I(() => !!t())() ? qn : e.icon;
|
|
704
706
|
} })), n;
|
|
705
707
|
})();
|
|
706
708
|
}
|
|
707
709
|
//#endregion
|
|
708
710
|
//#region src/framework/theming/tokens.css?raw
|
|
709
|
-
var $n = "/* 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.7 0.18 145);\n --tone-warning: oklch(0.8 0.17 75);\n --tone-danger: oklch(0.64 0.22 27);\n --tone-info: oklch(0.66 0.2 245);\n --tone-neutral: oklch(0.65 0.02 250);\n --tone-accent: oklch(0.74 0.18 60);\n\n --widget-glow-default: 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.7 0.2 245);\n --tone-neutral: oklch(0.69 0.02 250);\n --tone-accent: oklch(0.78 0.18 60);\n\n --widget-glow-default: 0.5;\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 * One scale: --widget-unit is 1% of the shell's short side. Each size is a floor,\n * a line through the designed 2x2 and 4x4 sizes, and past 4x4 the share it has\n * at 4x4. A widget sizes its own text with these tokens and scales with every tile. */\n.glasshome-widget {\n --widget-color: var(--tone-neutral);\n --widget-glow-strength: var(--widget-glow-default);\n --widget-radius: var(--radius-xl, 12px);\n\n --widget-unit: 1cqmin;\n --widget-text-value: max(\n 22px,\n calc(8.5px + 13.4 * var(--widget-unit)),\n calc(16 * var(--widget-unit))\n );\n --widget-text-name: max(\n 14px,\n calc(8.9px + 4.37 * var(--widget-unit)),\n calc(7.07 * var(--widget-unit))\n );\n --widget-text-meta: max(\n 11px,\n calc(8px + 2.44 * var(--widget-unit)),\n calc(4.88 * var(--widget-unit))\n );\n --widget-text-sub: max(\n 12px,\n calc(10.1px + 1.22 * var(--widget-unit)),\n calc(4.3 * var(--widget-unit))\n );\n --widget-text-caption: max(11px, calc(3.6 * var(--widget-unit)));\n --widget-control-h: max(36px, calc(30px + 3.84 * var(--widget-unit)));\n --widget-grid-pad: max(\n 10px,\n calc(1.2px + 5.64 * var(--widget-unit)),\n calc(6 * var(--widget-unit))\n );\n --widget-grid-gap: max(6px, calc(2.5px + 2.23 * var(--widget-unit)));\n --widget-icon-box: max(\n 44px,\n calc(31.3px + 8.14 * var(--widget-unit)),\n calc(17.7 * var(--widget-unit))\n );\n --widget-icon-glyph: max(\n 24px,\n calc(16px + 5.12 * var(--widget-unit)),\n calc(10 * var(--widget-unit))\n );\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: ui's .glass, worn through the class Widget.tsx carries.\n * Unlayered and class-specific, so these beat the formula's :where() defaults\n * (wash-2 is re-declared there and cannot be set from a utility). The tone\n * stays the formula's transparent default until Widget.tsx sets one inline:\n * a widget without a tone is the plain card, never a neutral-grey wash. */\n.glasshome-widget {\n --widget-wash: 22%;\n --widget-wash-2: 11%;\n --glass-wash: var(--widget-wash);\n --glass-wash-2: var(--widget-wash-2);\n --glass-wash-angle: 135deg;\n --glass-base: color-mix(in srgb, var(--card) var(--material-clarity, 60%), transparent);\n --glass-rim: 0.3;\n --glass-lift: 0.45;\n --glass-shade: 0.05;\n backdrop-filter: var(--widget-backdrop, none);\n -webkit-backdrop-filter: var(--widget-backdrop, none);\n}\n/* A fill widget keeps a neutral card; the fill carries the tone, so a full fill is the toned card. */\n.glasshome-widget:has(.glasshome-widget-slider-fill) {\n --glass-wash: 0%;\n --glass-wash-2: 0%;\n}\n.dark .glasshome-widget {\n --glass-shade: 0;\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 border-radius: var(--widget-radius);\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 > * {\n align-items: center;\n text-align: center;\n }\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 {\n font-size: clamp(11px, 6cqmin, 14px);\n max-width: 100%;\n }\n .glasshome-widget-status,\n .glasshome-widget-value {\n font-size: clamp(13px, 7cqmin, 17px);\n }\n .glasshome-widget-content [class*=\"ml-auto\"] {\n margin-left: 0 !important;\n }\n}\n.glasshome-widget-content [class*=\"ml-auto\"] {\n position: relative;\n z-index: 30;\n}\n\n/* === Slot: icon ===\n * ui's tinted icon pill (ICON_PILL_TINT): the disc is .glass, so the material shapes it. */\n.glasshome-widget-icon {\n width: var(--widget-icon-box);\n height: var(--widget-icon-box);\n border-radius: var(--radius-sm, 12px);\n --glass-tone: var(--widget-icon-color, var(--widget-color));\n --glass-rim: 0.4;\n --glass-wash: 18%;\n}\n.glasshome-widget-icon-glyph {\n font-size: var(--widget-icon-glyph);\n line-height: 1;\n}\n.glasshome-widget-icon-stack {\n --stack-step: calc(var(--widget-icon-box) * 0.12);\n position: absolute;\n /* The pill's border would otherwise shrink each plate and widen the first step. */\n inset: -1px;\n width: auto;\n height: auto;\n border-radius: var(--radius-sm, 12px);\n}\n.glasshome-widget-icon-stack-2 {\n translate: var(--stack-step) var(--stack-step);\n opacity: 0.45;\n z-index: -2;\n}\n.glasshome-widget-icon-stack-3 {\n translate: calc(2 * var(--stack-step)) calc(2 * var(--stack-step));\n opacity: 0.2;\n z-index: -3;\n}\n\n/* === Slot: text === */\n.glasshome-widget-title {\n font-size: var(--widget-title-size);\n line-height: 1.2;\n color: var(--color-muted-foreground, currentColor);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.glasshome-widget-subtitle {\n font-size: var(--widget-subtitle);\n color: var(--color-muted-foreground, currentColor);\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: linear-gradient(\n 135deg,\n color-mix(\n in srgb,\n var(--widget-color) calc(var(--widget-wash) * var(--material-tint, 1)),\n transparent\n ),\n color-mix(\n in srgb,\n var(--widget-color-to, var(--widget-color))\n calc(var(--widget-wash-2) * var(--material-tint, 1)),\n transparent\n )\n );\n /* Inset: the clip-path cuts any outer shadow. */\n box-shadow: inset 0 0 calc(var(--material-glow, 0px) * 1.2)\n oklch(from var(--widget-color) l c h / 0.55);\n clip-path: inset(0 calc((100 - var(--widget-fill-value)) * 1%) 0 0 round var(--widget-radius));\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 round var(--widget-radius));\n }\n}\n\n/* === Anatomy: Widget.Content with a Widget.Head lays its parts out as a tile === */\n.glasshome-widget-grid {\n position: relative;\n display: grid;\n grid-template-columns: max-content minmax(0, 1fr);\n grid-template-rows: auto minmax(0, 1fr) auto;\n gap: var(--widget-grid-gap);\n height: 100%;\n padding: var(--widget-grid-pad);\n overflow: hidden;\n isolation: isolate;\n color: var(--foreground);\n}\n\n/* In-flow content spans the tile (the max-content first column would collapse it); absolute parts keep the padding box. */\n.glasshome-widget-grid\n > :where(:not(.glasshome-widget-backdrop, .glasshome-widget-layer, .glasshome-widget-glyph)) {\n grid-column: 1 / -1;\n}\n.glasshome-widget-layer {\n position: absolute;\n inset: 0;\n z-index: -1;\n overflow: hidden;\n}\n.glasshome-widget-head {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n min-width: 0;\n}\n.glasshome-widget-head-text {\n min-height: var(--widget-icon-box);\n justify-content: center;\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n flex: 1;\n}\n.glasshome-widget-head-aside {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 6px;\n max-height: 26px;\n overflow: hidden;\n flex-shrink: 1;\n}\n.glasshome-widget-eyebrow {\n font-size: var(--widget-text-meta);\n font-weight: 500;\n line-height: 1.25;\n color: var(--muted-foreground);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.glasshome-widget-name {\n font-size: var(--widget-text-name);\n font-weight: 650;\n line-height: 1.2;\n letter-spacing: -0.01em;\n color: var(--foreground);\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n overflow-wrap: break-word;\n}\n\n.glasshome-widget-hero {\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n gap: var(--widget-grid-gap);\n min-height: 0;\n min-width: 0;\n}\n.glasshome-widget-reading {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n z-index: 1;\n}\n.glasshome-widget-reading-value {\n font-size: var(--widget-text-value);\n font-weight: 650;\n line-height: 1;\n letter-spacing: -0.03em;\n font-variant-numeric: tabular-nums;\n color: var(--foreground);\n white-space: nowrap;\n}\n/* Alternating names restart the rise on each change without rebuilding the text. */\n.glasshome-widget-reading-value[data-turn=\"a\"] {\n animation: tile-value-in-a var(--duration-morph) var(--ease-morph);\n}\n.glasshome-widget-reading-value[data-turn=\"b\"] {\n animation: tile-value-in-b var(--duration-morph) var(--ease-morph);\n}\n@keyframes tile-value-in-a {\n from {\n opacity: 0;\n transform: translateY(0.25em);\n }\n}\n@keyframes tile-value-in-b {\n from {\n opacity: 0;\n transform: translateY(0.25em);\n }\n}\n.glasshome-widget-unit {\n font-size: 0.5em;\n font-weight: 550;\n letter-spacing: 0;\n margin-left: 0.08em;\n color: var(--muted-foreground);\n}\n.glasshome-widget-sub {\n font-size: var(--widget-text-sub);\n font-weight: 500;\n color: var(--muted-foreground);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* Placed on the tile, not the hero, so a control row never moves or shrinks it. */\n.glasshome-widget-art {\n position: absolute;\n right: var(--widget-grid-pad);\n bottom: var(--widget-grid-pad);\n height: min(\n calc(100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - var(--widget-grid-gap)),\n 48cqi\n );\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n pointer-events: none;\n}\n/* Beside art a long word (\"Unlocked\") shrinks to end where the art starts, at about 50cqi; short values keep full size. */\n@container widget (min-width: 180px) and (min-height: 130px) {\n .glasshome-widget-hero[data-art] .glasshome-widget-reading-value {\n font-size: max(18px, min(var(--widget-text-value), calc(50cqi / (var(--value-len, 1) * 0.56))));\n }\n}\n.glasshome-widget-backdrop > img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n/* Art keeps its shape and clears a state word at its largest (15cqi, about 3.4em); each art sets --art-aspect. */\n.glasshome-widget-grid .glasshome-widget-art > * {\n height: min(\n 100%,\n calc((52cqi - 2 * var(--widget-grid-pad) - var(--widget-grid-gap)) / var(--art-aspect, 1))\n );\n flex-shrink: 0;\n}\n.glasshome-widget-grid .glasshome-widget-art > img {\n width: auto;\n height: auto;\n max-height: 100%;\n max-width: calc(52cqi - 2 * var(--widget-grid-pad) - var(--widget-grid-gap));\n}\n\n.glasshome-widget-controls {\n display: flex;\n gap: 8px;\n min-width: 0;\n}\n\n.glasshome-widget-glyph {\n display: none;\n position: absolute;\n right: -8%;\n bottom: -22%;\n font-size: min(130cqb, 80cqi);\n line-height: 1;\n color: var(--widget-color);\n opacity: 0.16;\n pointer-events: none;\n z-index: -1;\n}\n\n/* Controls sit on the bottom row beside the value, or under it on a narrow tile; the art lifts above them. */\n.glasshome-widget-head {\n grid-column: 1 / -1;\n}\n.glasshome-widget-hero {\n grid-row: 3;\n grid-column: 1 / -1;\n}\n.glasshome-widget-grid:has(> .glasshome-widget-controls) > .glasshome-widget-hero {\n grid-column: 1;\n}\n.glasshome-widget-controls {\n grid-row: 3;\n grid-column: 2;\n align-self: end;\n position: relative;\n z-index: 1;\n}\n.glasshome-widget-grid:has(> .glasshome-widget-hero[data-empty]) > .glasshome-widget-controls {\n grid-column: 1 / -1;\n}\n@container widget (max-width: 519px) {\n .glasshome-widget-grid:has(> .glasshome-widget-controls) {\n grid-template-rows: auto minmax(0, 1fr) auto auto;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) > .glasshome-widget-hero {\n grid-column: 1 / -1;\n }\n .glasshome-widget-controls {\n grid-row: 4;\n grid-column: 1 / -1;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) .glasshome-widget-art {\n bottom: calc(var(--widget-grid-pad) + var(--widget-control-h) + var(--widget-grid-gap));\n height: min(\n calc(\n 100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - 2 * var(--widget-grid-gap) -\n var(--widget-control-h)\n ),\n 48cqi\n );\n }\n}\n@container widget (max-height: 229px) {\n .glasshome-widget-controls {\n display: none;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) {\n grid-template-rows: auto minmax(0, 1fr) auto;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) .glasshome-widget-art {\n bottom: var(--widget-grid-pad);\n height: min(\n calc(100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - var(--widget-grid-gap)),\n 48cqi\n );\n }\n}\n@container widget (max-width: 179px) {\n .glasshome-widget-art {\n display: none;\n }\n}\n@container widget (max-height: 169px) {\n .glasshome-widget-head-aside {\n display: none;\n }\n}\n@container widget ((max-height: 129px) or (max-width: 139px)) {\n .glasshome-widget-head-text {\n min-height: 0;\n }\n .glasshome-widget-name {\n -webkit-line-clamp: 1;\n }\n .glasshome-widget-grid {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n gap: 2px;\n }\n .glasshome-widget-head-icon,\n .glasshome-widget-art,\n .glasshome-widget-eyebrow,\n .glasshome-widget-sub {\n display: none;\n }\n .glasshome-widget-glyph {\n display: block;\n }\n .glasshome-widget-reading-value {\n font-size: clamp(18px, min(34cqb, 20cqi), 30px);\n }\n .glasshome-widget-name {\n font-size: clamp(12px, min(18cqb, 11cqi), 15px);\n font-weight: 550;\n color: var(--muted-foreground);\n }\n}\n@container widget (max-height: 129px) and (min-width: 260px) {\n .glasshome-widget-grid {\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: var(--widget-grid-gap);\n }\n .glasshome-widget-name {\n font-size: clamp(14px, 22cqb, 18px);\n font-weight: 650;\n color: var(--foreground);\n }\n .glasshome-widget-eyebrow {\n display: block;\n }\n}\n\n.glasshome-widget-backdrop {\n position: absolute;\n inset: 0;\n z-index: -2;\n overflow: hidden;\n}\n.glasshome-widget-backdrop > img.area-night {\n opacity: 0;\n transition: opacity 700ms ease;\n}\n.glasshome-widget-backdrop > img.area-night[data-visible] {\n opacity: 1;\n}\n.glasshome-widget-backdrop > .glasshome-widget-backdrop-light {\n position: absolute;\n inset: 0;\n background: radial-gradient(90% 80% at 25% 30%, oklch(0.8 0.14 70), transparent 70%);\n mix-blend-mode: soft-light;\n opacity: var(--backdrop-light, 0);\n transition: opacity 500ms ease;\n}\n.glasshome-widget-backdrop::after {\n content: \"\";\n position: absolute;\n inset: 0;\n background: linear-gradient(\n to bottom,\n color-mix(in oklch, var(--card) 82%, transparent) 0%,\n color-mix(in oklch, var(--card) 40%, transparent) 22%,\n transparent 42%,\n transparent 62%,\n color-mix(in oklch, var(--card) 45%, transparent) 82%,\n color-mix(in oklch, var(--card) 80%, transparent) 100%\n );\n}\n\n@container widget (max-width: 239px) {\n .glasshome-widget-choice [data-optional] {\n display: none;\n }\n}\n@container widget (max-width: 259px) {\n .glasshome-widget-head-aside {\n display: none;\n }\n}\n@container widget (max-width: 139px) {\n .glasshome-widget-controls {\n display: none;\n }\n}\n\n.glasshome-widget-controls {\n justify-content: flex-start;\n align-items: center;\n}\n.glasshome-widget-control.glasshome-widget-control {\n width: var(--widget-control-h);\n height: var(--widget-control-h);\n}\n.glasshome-widget-choice .glasshome-widget-control.glasshome-widget-control {\n width: calc(var(--widget-control-h) - 8px);\n height: calc(var(--widget-control-h) - 8px);\n}\n@container widget (max-width: 179px) and (min-height: 130px) {\n .glasshome-widget-grid:not(:has(> .glasshome-widget-backdrop)) .glasshome-widget-head-text {\n min-height: 0;\n }\n .glasshome-widget-grid:not(:has(> .glasshome-widget-backdrop)) .glasshome-widget-head {\n flex-direction: column;\n gap: 6px;\n }\n}\n.glasshome-widget-unit[data-degree] {\n vertical-align: top;\n margin-left: 0.02em;\n color: var(--foreground);\n}\n.glasshome-widget-control-wide.glasshome-widget-control-wide {\n height: var(--widget-control-h);\n gap: 6px;\n padding: 0 14px;\n}\n@container widget (max-width: 179px) {\n .glasshome-widget-grid:has(> .glasshome-widget-backdrop) .glasshome-widget-head-icon {\n display: none;\n }\n}\n.glasshome-widget-grid:has(> .glasshome-widget-backdrop)\n :is(\n .glasshome-widget-reading-value,\n .glasshome-widget-sub,\n .glasshome-widget-name,\n .glasshome-widget-eyebrow\n ) {\n text-shadow: 0 1px 8px color-mix(in oklch, var(--card) 75%, transparent);\n}\n.glasshome-widget-grid:has(> .glasshome-widget-backdrop)\n :is(.glasshome-widget-sub, .glasshome-widget-eyebrow) {\n color: color-mix(in oklch, var(--foreground) 82%, transparent);\n}\n/* Control glyphs and words keep their share of a control as it grows past 4x4. */\n.glasshome-widget-grid\n :is(.glasshome-widget-control, .glasshome-widget-control-wide)\n :is(iconify-icon, svg) {\n font-size: calc(var(--widget-control-h) * 0.43);\n width: 1em;\n height: 1em;\n}\n:is(.glasshome-widget-controls, .glasshome-widget-control-wide) {\n font-size: max(13px, calc(var(--widget-control-h) * 0.3));\n}\n/* A big tile with no art of its own carries its icon large and faint, so the glass is not an empty box. */\n@container widget (min-width: 300px) and (min-height: 260px) {\n .glasshome-widget-grid:not(\n :has(> .glasshome-widget-backdrop),\n :has(> .glasshome-widget-hero[data-art], > .glasshome-widget-art, > .glasshome-widget-layer)\n )\n > .glasshome-widget-glyph {\n display: block;\n right: -3%;\n bottom: -12%;\n font-size: min(78cqb, 52cqi);\n opacity: 0.1;\n }\n}\n/* A one-shot action confirms on its control and on the glyph, the one thing a compact tile shows. */\n.glasshome-widget-grid > .glasshome-widget-glyph {\n transition: opacity var(--duration-state) var(--ease-morph);\n}\n.glasshome-widget[data-confirmed] .glasshome-widget-glyph {\n opacity: 0.5;\n}\n.glasshome-widget-grid\n [data-confirmed]:is(.glasshome-widget-control, .glasshome-widget-control-wide) {\n --glass-base: color-mix(in srgb, var(--widget-color) 35%, transparent);\n transition: background-color var(--duration-state) var(--ease-morph);\n}\n\n/* === Sheet: what a held tile opens (framework/panel) ===\n * Rendered in a popover or dialog outside the widget's shadow root, so every rule\n * the sheet needs lives here, never in a widget's own utilities. */\n.glasshome-sheet {\n display: flex;\n flex-direction: column;\n gap: 18px;\n color: var(--foreground);\n}\n.glasshome-sheet [data-slot=\"swatch-picker\"] {\n max-width: 360px;\n}\n.glasshome-panel-section {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n.glasshome-panel-label {\n margin: 0;\n font-size: 13px;\n font-weight: 500;\n color: var(--muted-foreground);\n}\n.glasshome-panel-rows {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));\n gap: 8px;\n}\n.glasshome-panel-row-wrap {\n position: relative;\n min-width: 0;\n}\n.glasshome-panel-row {\n --widget-wash: 22%;\n --widget-wash-2: 11%;\n --widget-radius: var(--radius-lg, 16px);\n --widget-icon-box: 34px;\n --widget-icon-glyph: 19px;\n position: relative;\n width: 100%;\n height: 56px;\n justify-content: flex-start;\n gap: 10px;\n padding: 0 12px 0 10px;\n overflow: hidden;\n text-align: left;\n touch-action: pan-y;\n}\n.glasshome-panel-row-static {\n cursor: default;\n scale: none;\n}\n.glasshome-panel-row-fill {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.glasshome-panel-row-icon {\n position: relative;\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n}\n.glasshome-panel-row-icon-off {\n color: var(--muted-foreground);\n}\n.glasshome-panel-row-text {\n position: relative;\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n.glasshome-panel-row-name,\n.glasshome-panel-row-state,\n.glasshome-panel-fact-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n/* A reading may take a second line rather than lose its end (\"3 Moderate\"). */\n.glasshome-panel-fact-value {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n.glasshome-panel-row-name,\n.glasshome-panel-fact-value {\n font-size: 14px;\n font-weight: 500;\n color: var(--foreground);\n}\n.glasshome-panel-row-state,\n.glasshome-panel-fact-label {\n font-size: 12px;\n font-weight: 400;\n color: var(--muted-foreground);\n}\n.glasshome-panel-row-trailing {\n position: absolute;\n top: 50%;\n right: 10px;\n translate: 0 -50%;\n}\n.glasshome-panel-facts {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));\n row-gap: 10px;\n padding: 10px 4px 10px 0;\n overflow: hidden;\n border-radius: var(--radius-lg, 16px);\n --glass-base: color-mix(in srgb, var(--card) var(--material-clarity, 60%), transparent);\n backdrop-filter: blur(calc(var(--material-blur, 24px) * 0.6)) saturate(1.6);\n -webkit-backdrop-filter: blur(calc(var(--material-blur, 24px) * 0.6)) saturate(1.6);\n}\n/* Without blur a see-through strip is just see-through: it takes the card fill. */\n.reduce-blur .glasshome-panel-facts {\n --glass-base: var(--card);\n}\n.glasshome-panel-fact {\n display: flex;\n min-width: 0;\n align-items: center;\n gap: 8px;\n padding: 0 12px;\n box-shadow: -1px 0 0 color-mix(in oklch, var(--foreground) 10%, transparent);\n}\n.glasshome-panel-fact-icon {\n flex-shrink: 0;\n font-size: 18px;\n color: var(--muted-foreground);\n}\n\n/* Inset: the grid cell clips anything drawn outside the tile. */\n.glasshome-widget:focus-visible {\n outline: 2px solid var(--ring);\n outline-offset: -2px;\n}\n\n/* === Hold flood: the dock's hold fill (ui HOLD_MOTION), grown from the finger === */\n.glasshome-widget-hold-flood {\n position: absolute;\n translate: -50% -50%;\n border-radius: 9999px;\n background: color-mix(in oklch, var(--primary) 45%, transparent);\n pointer-events: none;\n scale: 0;\n opacity: 0;\n transition:\n scale var(--duration-state, 200ms) var(--ease-contract, ease-in),\n opacity var(--duration-state, 200ms) var(--ease-contract, ease-in);\n}\n.glasshome-widget-hold-flood[data-hold] {\n scale: 1;\n opacity: 1;\n transition-duration: var(--duration-morph, 400ms);\n transition-timing-function: linear;\n}\n.glasshome-widget-hold-flood[data-fired] {\n scale: 1;\n opacity: 0;\n}\n/* A row of ui buttons in a sheet (scenes, one-tap actions). */\n.glasshome-sheet-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n/* The sheet wears its tile: the tile's tone washed into the glass, its picture as a band behind\n the head that fades into the glass, so the tile reads as having grown open. */\n.glasshome-sheet-surface {\n --glass-wash: 20%;\n --glass-wash-2: 7%;\n --widget-icon-box: 48px;\n --widget-icon-glyph: 26px;\n}\n.glasshome-sheet-band {\n position: absolute;\n inset: 0 0 auto;\n height: 150px;\n overflow: hidden;\n pointer-events: none;\n mask-image: linear-gradient(180deg, #000 30%, transparent);\n}\n.glasshome-sheet-band > img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n opacity: 0.55;\n}\n.glasshome-sheet-surface > [data-slot$=\"-header\"],\n.glasshome-sheet-surface > [data-slot$=\"-body\"] {\n position: relative;\n}\n.glasshome-sheet-icon {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", er = !1, tr, nr = /* @__PURE__ */ new WeakSet();
|
|
710
|
-
function
|
|
711
|
-
return
|
|
711
|
+
var ir = "/* 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.7 0.18 145);\n --tone-warning: oklch(0.8 0.17 75);\n --tone-danger: oklch(0.64 0.22 27);\n --tone-info: oklch(0.66 0.2 245);\n --tone-neutral: oklch(0.65 0.02 250);\n --tone-accent: oklch(0.74 0.18 60);\n\n --widget-glow-default: 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.7 0.2 245);\n --tone-neutral: oklch(0.69 0.02 250);\n --tone-accent: oklch(0.78 0.18 60);\n\n --widget-glow-default: 0.5;\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 * One scale: --widget-unit is 1% of the shell's short side. Each size is a floor,\n * a line through the designed 2x2 and 4x4 sizes, and past 4x4 the share it has\n * at 4x4. A widget sizes its own text with these tokens and scales with every tile. */\n.glasshome-widget {\n --widget-color: var(--tone-neutral);\n --widget-glow-strength: var(--widget-glow-default);\n --widget-radius: var(--radius-xl, 12px);\n\n --widget-unit: 1cqmin;\n --widget-text-value: max(\n 22px,\n calc(8.5px + 13.4 * var(--widget-unit)),\n calc(16 * var(--widget-unit))\n );\n --widget-text-name: max(\n 14px,\n calc(8.9px + 4.37 * var(--widget-unit)),\n calc(7.07 * var(--widget-unit))\n );\n --widget-text-meta: max(\n 11px,\n calc(8px + 2.44 * var(--widget-unit)),\n calc(4.88 * var(--widget-unit))\n );\n --widget-text-sub: max(\n 12px,\n calc(10.1px + 1.22 * var(--widget-unit)),\n calc(4.3 * var(--widget-unit))\n );\n --widget-text-caption: max(11px, calc(3.6 * var(--widget-unit)));\n --widget-control-h: max(36px, calc(30px + 3.84 * var(--widget-unit)));\n --widget-grid-pad: max(\n 10px,\n calc(1.2px + 5.64 * var(--widget-unit)),\n calc(6 * var(--widget-unit))\n );\n --widget-grid-gap: max(6px, calc(2.5px + 2.23 * var(--widget-unit)));\n --widget-icon-box: max(\n 44px,\n calc(31.3px + 8.14 * var(--widget-unit)),\n calc(17.7 * var(--widget-unit))\n );\n --widget-icon-glyph: max(\n 24px,\n calc(16px + 5.12 * var(--widget-unit)),\n calc(10 * var(--widget-unit))\n );\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: ui's .glass, worn through the class Widget.tsx carries.\n * Unlayered and class-specific, so these beat the formula's :where() defaults\n * (wash-2 is re-declared there and cannot be set from a utility). The tone\n * stays the formula's transparent default until Widget.tsx sets one inline:\n * a widget without a tone is the plain card, never a neutral-grey wash. */\n.glasshome-widget {\n --widget-wash: 22%;\n --widget-wash-2: 11%;\n --glass-wash: var(--widget-wash);\n --glass-wash-2: var(--widget-wash-2);\n --glass-wash-angle: 135deg;\n --glass-base: color-mix(in srgb, var(--card) var(--material-clarity, 60%), transparent);\n --glass-rim: 0.3;\n --glass-lift: 0.45;\n --glass-shade: 0.05;\n backdrop-filter: var(--widget-backdrop, none);\n -webkit-backdrop-filter: var(--widget-backdrop, none);\n}\n/* A fill widget keeps a neutral card; the fill carries the tone, so a full fill is the toned card. */\n.glasshome-widget:has(.glasshome-widget-slider-fill) {\n --glass-wash: 0%;\n --glass-wash-2: 0%;\n}\n.dark .glasshome-widget {\n --glass-shade: 0;\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 border-radius: var(--widget-radius);\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 > * {\n align-items: center;\n text-align: center;\n }\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 {\n font-size: clamp(11px, 6cqmin, 14px);\n max-width: 100%;\n }\n .glasshome-widget-status,\n .glasshome-widget-value {\n font-size: clamp(13px, 7cqmin, 17px);\n }\n .glasshome-widget-content [class*=\"ml-auto\"] {\n margin-left: 0 !important;\n }\n}\n.glasshome-widget-content [class*=\"ml-auto\"] {\n position: relative;\n z-index: 30;\n}\n\n/* === Slot: icon ===\n * ui's tinted icon pill (ICON_PILL_TINT): the disc is .glass, so the material shapes it. */\n.glasshome-widget-icon {\n width: var(--widget-icon-box);\n height: var(--widget-icon-box);\n border-radius: var(--radius-sm, 12px);\n --glass-tone: var(--widget-icon-color, var(--widget-color));\n --glass-rim: 0.4;\n --glass-wash: 18%;\n}\n.glasshome-widget-icon-glyph {\n font-size: var(--widget-icon-glyph);\n line-height: 1;\n}\n.glasshome-widget-icon-stack {\n --stack-step: calc(var(--widget-icon-box) * 0.12);\n position: absolute;\n /* The pill's border would otherwise shrink each plate and widen the first step. */\n inset: -1px;\n width: auto;\n height: auto;\n border-radius: var(--radius-sm, 12px);\n}\n.glasshome-widget-icon-stack-2 {\n translate: var(--stack-step) var(--stack-step);\n opacity: 0.45;\n z-index: -2;\n}\n.glasshome-widget-icon-stack-3 {\n translate: calc(2 * var(--stack-step)) calc(2 * var(--stack-step));\n opacity: 0.2;\n z-index: -3;\n}\n\n/* === Slot: text === */\n.glasshome-widget-title {\n font-size: var(--widget-title-size);\n line-height: 1.2;\n color: var(--color-muted-foreground, currentColor);\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.glasshome-widget-subtitle {\n font-size: var(--widget-subtitle);\n color: var(--color-muted-foreground, currentColor);\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: linear-gradient(\n 135deg,\n color-mix(\n in srgb,\n var(--widget-color) calc(var(--widget-wash) * var(--material-tint, 1)),\n transparent\n ),\n color-mix(\n in srgb,\n var(--widget-color-to, var(--widget-color))\n calc(var(--widget-wash-2) * var(--material-tint, 1)),\n transparent\n )\n );\n /* Inset: the clip-path cuts any outer shadow. */\n box-shadow: inset 0 0 calc(var(--material-glow, 0px) * 1.2)\n oklch(from var(--widget-color) l c h / 0.55);\n clip-path: inset(0 calc((100 - var(--widget-fill-value)) * 1%) 0 0 round var(--widget-radius));\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 round var(--widget-radius));\n }\n}\n\n/* === Anatomy: Widget.Content with a Widget.Head lays its parts out as a tile === */\n.glasshome-widget-grid {\n position: relative;\n display: grid;\n grid-template-columns: max-content minmax(0, 1fr);\n grid-template-rows: auto minmax(0, 1fr) auto;\n gap: var(--widget-grid-gap);\n height: 100%;\n padding: var(--widget-grid-pad);\n overflow: hidden;\n isolation: isolate;\n color: var(--foreground);\n}\n\n/* In-flow content spans the tile (the max-content first column would collapse it); absolute parts keep the padding box. */\n.glasshome-widget-grid\n > :where(:not(.glasshome-widget-backdrop, .glasshome-widget-layer, .glasshome-widget-glyph)) {\n grid-column: 1 / -1;\n}\n.glasshome-widget-layer {\n position: absolute;\n inset: 0;\n z-index: -1;\n overflow: hidden;\n}\n.glasshome-widget-head {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n min-width: 0;\n}\n.glasshome-widget-head-text {\n min-height: var(--widget-icon-box);\n justify-content: center;\n display: flex;\n flex-direction: column;\n gap: 1px;\n min-width: 0;\n flex: 1;\n}\n.glasshome-widget-head-aside {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-end;\n gap: 6px;\n max-height: 26px;\n overflow: hidden;\n flex-shrink: 1;\n}\n.glasshome-widget-eyebrow {\n font-size: var(--widget-text-meta);\n font-weight: 500;\n line-height: 1.25;\n color: var(--muted-foreground);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.glasshome-widget-name {\n font-size: var(--widget-text-name);\n font-weight: 650;\n line-height: 1.2;\n letter-spacing: -0.01em;\n color: var(--foreground);\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n overflow: hidden;\n overflow-wrap: break-word;\n}\n\n.glasshome-widget-hero {\n display: flex;\n align-items: flex-end;\n justify-content: space-between;\n gap: var(--widget-grid-gap);\n min-height: 0;\n min-width: 0;\n}\n.glasshome-widget-reading {\n display: flex;\n flex-direction: column;\n gap: 2px;\n min-width: 0;\n z-index: 1;\n}\n.glasshome-widget-reading-value {\n font-size: var(--widget-text-value);\n font-weight: 650;\n line-height: 1;\n letter-spacing: -0.03em;\n font-variant-numeric: tabular-nums;\n color: var(--foreground);\n white-space: nowrap;\n}\n/* Alternating names restart the rise on each change without rebuilding the text. */\n.glasshome-widget-reading-value[data-turn=\"a\"] {\n animation: tile-value-in-a var(--duration-morph) var(--ease-morph);\n}\n.glasshome-widget-reading-value[data-turn=\"b\"] {\n animation: tile-value-in-b var(--duration-morph) var(--ease-morph);\n}\n@keyframes tile-value-in-a {\n from {\n opacity: 0;\n transform: translateY(0.25em);\n }\n}\n@keyframes tile-value-in-b {\n from {\n opacity: 0;\n transform: translateY(0.25em);\n }\n}\n.glasshome-widget-unit {\n font-size: 0.5em;\n font-weight: 550;\n letter-spacing: 0;\n margin-left: 0.08em;\n color: var(--muted-foreground);\n}\n.glasshome-widget-sub {\n font-size: var(--widget-text-sub);\n font-weight: 500;\n color: var(--muted-foreground);\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n\n/* Placed on the tile, not the hero, so a control row never moves or shrinks it. */\n.glasshome-widget-art {\n position: absolute;\n right: var(--widget-grid-pad);\n bottom: var(--widget-grid-pad);\n height: min(\n calc(100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - var(--widget-grid-gap)),\n 48cqi\n );\n display: flex;\n align-items: flex-end;\n justify-content: flex-end;\n pointer-events: none;\n}\n/* Beside art a long word (\"Unlocked\") shrinks to end where the art starts, at about 50cqi; short values keep full size. */\n@container widget (min-width: 180px) and (min-height: 130px) {\n .glasshome-widget-hero[data-art] .glasshome-widget-reading-value {\n font-size: max(18px, min(var(--widget-text-value), calc(50cqi / (var(--value-len, 1) * 0.56))));\n }\n}\n.glasshome-widget-backdrop > img {\n position: absolute;\n inset: 0;\n width: 100%;\n height: 100%;\n object-fit: cover;\n}\n/* Art keeps its shape and clears a state word at its largest (15cqi, about 3.4em); each art sets --art-aspect. */\n.glasshome-widget-grid .glasshome-widget-art > * {\n height: min(\n 100%,\n calc((52cqi - 2 * var(--widget-grid-pad) - var(--widget-grid-gap)) / var(--art-aspect, 1))\n );\n flex-shrink: 0;\n}\n.glasshome-widget-grid .glasshome-widget-art > img {\n width: auto;\n height: auto;\n max-height: 100%;\n max-width: calc(52cqi - 2 * var(--widget-grid-pad) - var(--widget-grid-gap));\n}\n\n.glasshome-widget-controls {\n display: flex;\n gap: 8px;\n min-width: 0;\n}\n\n.glasshome-widget-glyph {\n display: none;\n position: absolute;\n right: -8%;\n bottom: -22%;\n font-size: min(130cqb, 80cqi);\n line-height: 1;\n color: var(--widget-color);\n opacity: 0.16;\n pointer-events: none;\n z-index: -1;\n}\n\n/* Controls sit on the bottom row beside the value, or under it on a narrow tile; the art lifts above them. */\n.glasshome-widget-head {\n grid-column: 1 / -1;\n}\n.glasshome-widget-hero {\n grid-row: 3;\n grid-column: 1 / -1;\n}\n.glasshome-widget-grid:has(> .glasshome-widget-controls) > .glasshome-widget-hero {\n grid-column: 1;\n}\n.glasshome-widget-controls {\n grid-row: 3;\n grid-column: 2;\n align-self: end;\n position: relative;\n z-index: 1;\n}\n.glasshome-widget-grid:has(> .glasshome-widget-hero[data-empty]) > .glasshome-widget-controls {\n grid-column: 1 / -1;\n}\n@container widget (max-width: 519px) {\n .glasshome-widget-grid:has(> .glasshome-widget-controls) {\n grid-template-rows: auto minmax(0, 1fr) auto auto;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) > .glasshome-widget-hero {\n grid-column: 1 / -1;\n }\n .glasshome-widget-controls {\n grid-row: 4;\n grid-column: 1 / -1;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) .glasshome-widget-art {\n bottom: calc(var(--widget-grid-pad) + var(--widget-control-h) + var(--widget-grid-gap));\n height: min(\n calc(\n 100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - 2 * var(--widget-grid-gap) -\n var(--widget-control-h)\n ),\n 48cqi\n );\n }\n}\n@container widget (max-height: 229px) {\n .glasshome-widget-controls {\n display: none;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) {\n grid-template-rows: auto minmax(0, 1fr) auto;\n }\n .glasshome-widget-grid:has(> .glasshome-widget-controls) .glasshome-widget-art {\n bottom: var(--widget-grid-pad);\n height: min(\n calc(100% - 2 * var(--widget-grid-pad) - var(--widget-icon-box) - var(--widget-grid-gap)),\n 48cqi\n );\n }\n}\n@container widget (max-width: 179px) {\n .glasshome-widget-art {\n display: none;\n }\n}\n@container widget (max-height: 169px) {\n .glasshome-widget-head-aside {\n display: none;\n }\n}\n@container widget ((max-height: 129px) or (max-width: 139px)) {\n .glasshome-widget-head-text {\n min-height: 0;\n }\n .glasshome-widget-name {\n -webkit-line-clamp: 1;\n }\n .glasshome-widget-grid {\n display: flex;\n flex-direction: column;\n justify-content: space-between;\n gap: 2px;\n }\n .glasshome-widget-head-icon,\n .glasshome-widget-art,\n .glasshome-widget-eyebrow,\n .glasshome-widget-sub {\n display: none;\n }\n .glasshome-widget-glyph {\n display: block;\n }\n .glasshome-widget-reading-value {\n font-size: clamp(18px, min(34cqb, 20cqi), 30px);\n }\n .glasshome-widget-name {\n font-size: clamp(12px, min(18cqb, 11cqi), 15px);\n font-weight: 550;\n color: var(--muted-foreground);\n }\n}\n@container widget (max-height: 129px) and (min-width: 260px) {\n .glasshome-widget-grid {\n flex-direction: row;\n align-items: center;\n justify-content: space-between;\n gap: var(--widget-grid-gap);\n }\n .glasshome-widget-name {\n font-size: clamp(14px, 22cqb, 18px);\n font-weight: 650;\n color: var(--foreground);\n }\n .glasshome-widget-eyebrow {\n display: block;\n }\n}\n\n.glasshome-widget-backdrop {\n position: absolute;\n inset: 0;\n z-index: -2;\n overflow: hidden;\n}\n.glasshome-widget-backdrop > img.area-night {\n opacity: 0;\n transition: opacity 700ms ease;\n}\n.glasshome-widget-backdrop > img.area-night[data-visible] {\n opacity: 1;\n}\n.glasshome-widget-backdrop > .glasshome-widget-backdrop-light {\n position: absolute;\n inset: 0;\n background: radial-gradient(90% 80% at 25% 30%, oklch(0.8 0.14 70), transparent 70%);\n mix-blend-mode: soft-light;\n opacity: var(--backdrop-light, 0);\n transition: opacity 500ms ease;\n}\n.glasshome-widget-backdrop::after {\n content: \"\";\n position: absolute;\n inset: 0;\n background: linear-gradient(\n to bottom,\n color-mix(in oklch, var(--card) 82%, transparent) 0%,\n color-mix(in oklch, var(--card) 40%, transparent) 22%,\n transparent 42%,\n transparent 62%,\n color-mix(in oklch, var(--card) 45%, transparent) 82%,\n color-mix(in oklch, var(--card) 80%, transparent) 100%\n );\n}\n\n@container widget (max-width: 239px) {\n .glasshome-widget-choice [data-optional] {\n display: none;\n }\n}\n@container widget (max-width: 259px) {\n .glasshome-widget-head-aside {\n display: none;\n }\n}\n@container widget (max-width: 139px) {\n .glasshome-widget-controls {\n display: none;\n }\n}\n\n.glasshome-widget-controls {\n justify-content: flex-start;\n align-items: center;\n}\n.glasshome-widget-control.glasshome-widget-control {\n width: var(--widget-control-h);\n height: var(--widget-control-h);\n}\n.glasshome-widget-choice .glasshome-widget-control.glasshome-widget-control {\n width: calc(var(--widget-control-h) - 8px);\n height: calc(var(--widget-control-h) - 8px);\n}\n@container widget (max-width: 179px) and (min-height: 130px) {\n .glasshome-widget-grid:not(:has(> .glasshome-widget-backdrop)) .glasshome-widget-head-text {\n min-height: 0;\n }\n .glasshome-widget-grid:not(:has(> .glasshome-widget-backdrop)) .glasshome-widget-head {\n flex-direction: column;\n gap: 6px;\n }\n}\n.glasshome-widget-unit[data-degree] {\n vertical-align: top;\n margin-left: 0.02em;\n color: var(--foreground);\n}\n.glasshome-widget-control-wide.glasshome-widget-control-wide {\n height: var(--widget-control-h);\n gap: 6px;\n padding: 0 14px;\n}\n@container widget (max-width: 179px) {\n .glasshome-widget-grid:has(> .glasshome-widget-backdrop) .glasshome-widget-head-icon {\n display: none;\n }\n}\n.glasshome-widget-grid:has(> .glasshome-widget-backdrop)\n :is(\n .glasshome-widget-reading-value,\n .glasshome-widget-sub,\n .glasshome-widget-name,\n .glasshome-widget-eyebrow\n ) {\n text-shadow: 0 1px 8px color-mix(in oklch, var(--card) 75%, transparent);\n}\n.glasshome-widget-grid:has(> .glasshome-widget-backdrop)\n :is(.glasshome-widget-sub, .glasshome-widget-eyebrow) {\n color: color-mix(in oklch, var(--foreground) 82%, transparent);\n}\n/* Control glyphs and words keep their share of a control as it grows past 4x4. */\n.glasshome-widget-grid\n :is(.glasshome-widget-control, .glasshome-widget-control-wide)\n :is(iconify-icon, svg) {\n font-size: calc(var(--widget-control-h) * 0.43);\n width: 1em;\n height: 1em;\n}\n:is(.glasshome-widget-controls, .glasshome-widget-control-wide) {\n font-size: max(13px, calc(var(--widget-control-h) * 0.3));\n}\n/* A big tile with no art of its own carries its icon large and faint, so the glass is not an empty box. */\n@container widget (min-width: 300px) and (min-height: 260px) {\n .glasshome-widget-grid:not(\n :has(> .glasshome-widget-backdrop),\n :has(> .glasshome-widget-hero[data-art], > .glasshome-widget-art, > .glasshome-widget-layer)\n )\n > .glasshome-widget-glyph {\n display: block;\n right: -3%;\n bottom: -12%;\n font-size: min(78cqb, 52cqi);\n opacity: 0.1;\n }\n}\n/* A one-shot action confirms on its control and on the glyph, the one thing a compact tile shows. */\n.glasshome-widget-grid > .glasshome-widget-glyph {\n transition: opacity var(--duration-state) var(--ease-morph);\n}\n.glasshome-widget[data-confirmed] .glasshome-widget-glyph {\n opacity: 0.5;\n}\n.glasshome-widget-grid\n [data-confirmed]:is(.glasshome-widget-control, .glasshome-widget-control-wide) {\n --glass-base: color-mix(in srgb, var(--widget-color) 35%, transparent);\n transition: background-color var(--duration-state) var(--ease-morph);\n}\n\n/* === Sheet: what a held tile opens (framework/panel) ===\n * Rendered in a popover or dialog outside the widget's shadow root, so every rule\n * the sheet needs lives here, never in a widget's own utilities. */\n.glasshome-sheet {\n display: flex;\n flex-direction: column;\n gap: 18px;\n color: var(--foreground);\n}\n.glasshome-sheet [data-slot=\"swatch-picker\"] {\n max-width: 360px;\n}\n.glasshome-panel-section {\n display: flex;\n flex-direction: column;\n gap: 10px;\n}\n.glasshome-panel-label {\n margin: 0;\n font-size: 13px;\n font-weight: 500;\n color: var(--muted-foreground);\n}\n.glasshome-panel-rows {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));\n gap: 8px;\n}\n.glasshome-panel-row-wrap {\n position: relative;\n min-width: 0;\n}\n.glasshome-panel-row {\n --widget-wash: 22%;\n --widget-wash-2: 11%;\n --widget-radius: var(--radius-lg, 16px);\n --widget-icon-box: 34px;\n --widget-icon-glyph: 19px;\n position: relative;\n width: 100%;\n height: 56px;\n justify-content: flex-start;\n gap: 10px;\n padding: 0 12px 0 10px;\n overflow: hidden;\n text-align: left;\n touch-action: pan-y;\n}\n.glasshome-panel-row-static {\n cursor: default;\n scale: none;\n}\n.glasshome-panel-row-fill {\n position: absolute;\n inset: 0;\n pointer-events: none;\n}\n.glasshome-panel-row-icon {\n position: relative;\n display: flex;\n flex-shrink: 0;\n align-items: center;\n justify-content: center;\n}\n.glasshome-panel-row-icon-off {\n color: var(--muted-foreground);\n}\n.glasshome-panel-row-text {\n position: relative;\n display: flex;\n flex-direction: column;\n min-width: 0;\n}\n.glasshome-panel-row-name,\n.glasshome-panel-row-state,\n.glasshome-panel-fact-label {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n/* A reading may take a second line rather than lose its end (\"3 Moderate\"). */\n.glasshome-panel-fact-value {\n overflow: hidden;\n display: -webkit-box;\n -webkit-box-orient: vertical;\n -webkit-line-clamp: 2;\n}\n.glasshome-panel-row-name,\n.glasshome-panel-fact-value {\n font-size: 14px;\n font-weight: 500;\n color: var(--foreground);\n}\n.glasshome-panel-row-state,\n.glasshome-panel-fact-label {\n font-size: 12px;\n font-weight: 400;\n color: var(--muted-foreground);\n}\n.glasshome-panel-row-trailing {\n position: absolute;\n top: 50%;\n right: 10px;\n translate: 0 -50%;\n}\n.glasshome-panel-facts {\n display: grid;\n grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));\n row-gap: 10px;\n padding: 10px 4px 10px 0;\n overflow: hidden;\n border-radius: var(--radius-lg, 16px);\n --glass-base: color-mix(in srgb, var(--card) var(--material-clarity, 60%), transparent);\n backdrop-filter: blur(calc(var(--material-blur, 24px) * 0.6)) saturate(1.6);\n -webkit-backdrop-filter: blur(calc(var(--material-blur, 24px) * 0.6)) saturate(1.6);\n}\n/* Without blur a see-through strip is just see-through: it takes the card fill. */\n.reduce-blur .glasshome-panel-facts {\n --glass-base: var(--card);\n}\n.glasshome-panel-fact {\n display: flex;\n min-width: 0;\n align-items: center;\n gap: 8px;\n padding: 0 12px;\n box-shadow: -1px 0 0 color-mix(in oklch, var(--foreground) 10%, transparent);\n}\n.glasshome-panel-fact-icon {\n flex-shrink: 0;\n font-size: 18px;\n color: var(--muted-foreground);\n}\n\n/* Inset: the grid cell clips anything drawn outside the tile. */\n.glasshome-widget:focus-visible {\n outline: 2px solid var(--ring);\n outline-offset: -2px;\n}\n\n/* === Hold flood: the dock's hold fill (ui HOLD_MOTION), grown from the finger === */\n.glasshome-widget-hold-flood {\n position: absolute;\n translate: -50% -50%;\n border-radius: 9999px;\n background: color-mix(in oklch, var(--primary) 45%, transparent);\n pointer-events: none;\n scale: 0;\n opacity: 0;\n transition:\n scale var(--duration-state, 200ms) var(--ease-contract, ease-in),\n opacity var(--duration-state, 200ms) var(--ease-contract, ease-in);\n}\n.glasshome-widget-hold-flood[data-hold] {\n scale: 1;\n opacity: 1;\n transition-duration: var(--duration-hold, 250ms);\n transition-timing-function: linear;\n}\n.glasshome-widget-hold-flood[data-fired] {\n scale: 1;\n opacity: 0;\n}\n/* A row of ui buttons in a sheet (scenes, one-tap actions). */\n.glasshome-sheet-actions {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n}\n/* The sheet wears its tile: the tile's tone washed into the glass, its picture as a band behind\n the head that fades into the glass, so the tile reads as having grown open. */\n.glasshome-sheet-surface {\n --glass-wash: 20%;\n --glass-wash-2: 7%;\n --widget-icon-box: 48px;\n --widget-icon-glyph: 26px;\n}\n.glasshome-sheet-band {\n position: absolute;\n inset: 0 0 auto;\n height: 150px;\n overflow: hidden;\n pointer-events: none;\n mask-image: linear-gradient(180deg, #000 30%, transparent);\n}\n.glasshome-sheet-band > img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n opacity: 0.55;\n}\n.glasshome-sheet-surface > [data-slot$=\"-header\"],\n.glasshome-sheet-surface > [data-slot$=\"-body\"] {\n position: relative;\n}\n.glasshome-sheet-icon {\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n", ar = !1, or, sr = /* @__PURE__ */ new WeakSet();
|
|
712
|
+
function cr() {
|
|
713
|
+
return or || (or = new CSSStyleSheet(), or.replaceSync(ir.replace(/:root\b/g, ":host").replace(/^\.dark\b/gm, ":host(.dark)"))), or;
|
|
712
714
|
}
|
|
713
|
-
function
|
|
715
|
+
function lr(e) {
|
|
714
716
|
if (typeof ShadowRoot < "u" && e instanceof ShadowRoot) {
|
|
715
|
-
if (
|
|
716
|
-
let t =
|
|
717
|
-
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]),
|
|
717
|
+
if (sr.has(e)) return;
|
|
718
|
+
let t = cr();
|
|
719
|
+
e.adoptedStyleSheets.includes(t) || (e.adoptedStyleSheets = [...e.adoptedStyleSheets, t]), sr.add(e);
|
|
718
720
|
return;
|
|
719
721
|
}
|
|
720
|
-
if (
|
|
722
|
+
if (ar) return;
|
|
721
723
|
let t = e ?? (typeof document > "u" ? void 0 : document);
|
|
722
724
|
if (!t) return;
|
|
723
725
|
if (t.head.querySelector?.("style[data-glasshome-tokens]")) {
|
|
724
|
-
|
|
726
|
+
ar = !0;
|
|
725
727
|
return;
|
|
726
728
|
}
|
|
727
729
|
let n = t.createElement("style");
|
|
728
|
-
n.setAttribute("data-glasshome-tokens", ""), n.textContent =
|
|
730
|
+
n.setAttribute("data-glasshome-tokens", ""), n.textContent = ir, t.head.appendChild(n), ar = !0;
|
|
729
731
|
}
|
|
730
732
|
//#endregion
|
|
731
733
|
//#region src/framework/variants/built-in-variants.ts
|
|
732
|
-
var
|
|
734
|
+
var ur = {
|
|
733
735
|
"classic-glass": { cssVars: {
|
|
734
736
|
"--widget-padding": "1.5rem",
|
|
735
737
|
"--widget-backdrop": "blur(var(--glass-blur, var(--material-blur, 24px))) saturate(1.8)"
|
|
@@ -749,15 +751,15 @@ var ar = {
|
|
|
749
751
|
"--widget-backdrop": "blur(16px) saturate(1.8)"
|
|
750
752
|
} }
|
|
751
753
|
};
|
|
752
|
-
function
|
|
753
|
-
return Object.hasOwn(
|
|
754
|
+
function dr(e) {
|
|
755
|
+
return Object.hasOwn(ur, e) ? ur[e] : void 0;
|
|
754
756
|
}
|
|
755
757
|
//#endregion
|
|
756
758
|
//#region src/framework/backgrounds/WidgetSliderFill.tsx
|
|
757
|
-
var
|
|
758
|
-
function
|
|
759
|
-
return e.color !== void 0 &&
|
|
760
|
-
var t =
|
|
759
|
+
var fr = /*#__PURE__*/ B("<div>"), pr = e(() => void 0, "sliderFill.color");
|
|
760
|
+
function mr(e) {
|
|
761
|
+
return e.color !== void 0 && pr(), (() => {
|
|
762
|
+
var t = fr();
|
|
761
763
|
return P((n) => {
|
|
762
764
|
var r = X("glasshome-widget-slider-fill pointer-events-none absolute inset-0", e.isDragging ? "duration-0" : "transition-all duration-300 ease-out", e.class), i = {
|
|
763
765
|
"--widget-fill-value": e.value,
|
|
@@ -772,13 +774,13 @@ function lr(e) {
|
|
|
772
774
|
}
|
|
773
775
|
//#endregion
|
|
774
776
|
//#region src/framework/components/WidgetContent.tsx
|
|
775
|
-
var
|
|
776
|
-
function
|
|
777
|
-
let t =
|
|
777
|
+
var hr = /*#__PURE__*/ B("<div>"), gr = /\bglasshome-widget-(head|hero|controls|backdrop|glyph|layer)\b/;
|
|
778
|
+
function _r(e) {
|
|
779
|
+
let t = cn(A(W));
|
|
778
780
|
E(() => t?.setAccent(e.accent)), k(() => t?.setAccent(void 0));
|
|
779
|
-
let n = T(() => e.children), r = D(() => n.toArray().some((e) => e instanceof Element &&
|
|
781
|
+
let n = T(() => e.children), r = D(() => n.toArray().some((e) => e instanceof Element && gr.test(e.className)));
|
|
780
782
|
return (() => {
|
|
781
|
-
var t =
|
|
783
|
+
var t = hr();
|
|
782
784
|
return F(t, n), P((n) => {
|
|
783
785
|
var i = X(r() ? "glasshome-widget-grid" : "glasshome-widget-content", e.class), a = e.accent ? { "--widget-color": e.accent } : void 0;
|
|
784
786
|
return i !== n.e && M(t, n.e = i), n.t = z(t, a, n.t), n;
|
|
@@ -790,10 +792,10 @@ function fr(e) {
|
|
|
790
792
|
}
|
|
791
793
|
//#endregion
|
|
792
794
|
//#region src/framework/components/WidgetStatus.tsx
|
|
793
|
-
var
|
|
794
|
-
function
|
|
795
|
+
var vr = /*#__PURE__*/ B("<p>");
|
|
796
|
+
function yr(e) {
|
|
795
797
|
return (() => {
|
|
796
|
-
var t =
|
|
798
|
+
var t = vr();
|
|
797
799
|
return F(t, (() => {
|
|
798
800
|
var t = I(() => !!e.isUnavailable);
|
|
799
801
|
return () => t() ? "Unavailable" : e.children;
|
|
@@ -808,16 +810,16 @@ function mr(e) {
|
|
|
808
810
|
}
|
|
809
811
|
//#endregion
|
|
810
812
|
//#region src/framework/components/WidgetTitle.tsx
|
|
811
|
-
var
|
|
812
|
-
function
|
|
813
|
+
var br = /*#__PURE__*/ B("<span class=\"glasshome-widget-badge shrink-0\">"), xr = /*#__PURE__*/ B("<div><h3 class=glasshome-widget-title>");
|
|
814
|
+
function Sr(e) {
|
|
813
815
|
return (() => {
|
|
814
|
-
var t =
|
|
816
|
+
var t = xr(), n = t.firstChild;
|
|
815
817
|
return F(n, () => e.children), F(t, N(w, {
|
|
816
818
|
get when() {
|
|
817
819
|
return I(() => e.badge !== void 0)() && e.badge > 0;
|
|
818
820
|
},
|
|
819
821
|
get children() {
|
|
820
|
-
var t =
|
|
822
|
+
var t = br();
|
|
821
823
|
return F(t, () => e.badge), t;
|
|
822
824
|
}
|
|
823
825
|
}), null), P((n) => {
|
|
@@ -831,14 +833,14 @@ function _r(e) {
|
|
|
831
833
|
}
|
|
832
834
|
//#endregion
|
|
833
835
|
//#region src/framework/utils/clipboard.ts
|
|
834
|
-
async function
|
|
836
|
+
async function Cr(e) {
|
|
835
837
|
if (navigator.clipboard?.writeText) try {
|
|
836
838
|
return await navigator.clipboard.writeText(e), !0;
|
|
837
839
|
} catch {}
|
|
838
|
-
return
|
|
840
|
+
return wr(e);
|
|
839
841
|
}
|
|
840
|
-
function
|
|
841
|
-
let t =
|
|
842
|
+
function wr(e) {
|
|
843
|
+
let t = Tr(), n = document.createElement("textarea");
|
|
842
844
|
n.value = e, n.setAttribute("readonly", ""), n.style.position = "fixed", n.style.top = "0", n.style.left = "0", n.style.opacity = "0", (t?.parentElement ?? document.body).append(n);
|
|
843
845
|
try {
|
|
844
846
|
return n.focus(), n.select(), n.setSelectionRange(0, e.length), n.getRootNode().activeElement === n && document.execCommand("copy");
|
|
@@ -848,23 +850,23 @@ function yr(e) {
|
|
|
848
850
|
n.remove(), t?.focus();
|
|
849
851
|
}
|
|
850
852
|
}
|
|
851
|
-
function
|
|
853
|
+
function Tr() {
|
|
852
854
|
let e = document.activeElement;
|
|
853
855
|
for (; e?.shadowRoot?.activeElement;) e = e.shadowRoot.activeElement;
|
|
854
856
|
return e instanceof HTMLElement ? e : null;
|
|
855
857
|
}
|
|
856
|
-
function
|
|
858
|
+
function Er(e = 2e3) {
|
|
857
859
|
let [t, n] = O("idle"), r;
|
|
858
860
|
return k(() => clearTimeout(r)), {
|
|
859
861
|
state: t,
|
|
860
862
|
copy: async (t) => {
|
|
861
|
-
n(await
|
|
863
|
+
n(await Cr(t) ? "copied" : "failed"), clearTimeout(r), r = setTimeout(() => n("idle"), e);
|
|
862
864
|
}
|
|
863
865
|
};
|
|
864
866
|
}
|
|
865
867
|
//#endregion
|
|
866
868
|
//#region src/framework/utils/entity-aggregation.ts
|
|
867
|
-
function
|
|
869
|
+
function Dr(e, t = !1) {
|
|
868
870
|
let n = e[0];
|
|
869
871
|
if (!n) return {
|
|
870
872
|
isGroup: !1,
|
|
@@ -888,7 +890,7 @@ function Sr(e, t = !1) {
|
|
|
888
890
|
isUnavailable: e.state === "unavailable",
|
|
889
891
|
brightness: r,
|
|
890
892
|
brightnessPercent: i,
|
|
891
|
-
color:
|
|
893
|
+
color: Ar(e),
|
|
892
894
|
onCount: +!!t,
|
|
893
895
|
totalCount: 1,
|
|
894
896
|
description: t ? "On" : "Off"
|
|
@@ -900,7 +902,7 @@ function Sr(e, t = !1) {
|
|
|
900
902
|
if (i++, t.attributes?.brightness !== void 0 && (c += t.attributes.brightness, l++), t.attributes?.rgb_color) u.push(t.attributes.rgb_color);
|
|
901
903
|
else if (t.attributes?.hs_color) {
|
|
902
904
|
let [e, n] = t.attributes.hs_color;
|
|
903
|
-
u.push(
|
|
905
|
+
u.push(kr(e, n));
|
|
904
906
|
}
|
|
905
907
|
break;
|
|
906
908
|
case "off":
|
|
@@ -911,28 +913,28 @@ function Sr(e, t = !1) {
|
|
|
911
913
|
break;
|
|
912
914
|
case "unavailable": s++;
|
|
913
915
|
}
|
|
914
|
-
let d = e.length, f = s === d, p = o + s === d, m = i > 0,
|
|
915
|
-
t ? f ? (
|
|
916
|
-
let
|
|
916
|
+
let d = e.length, f = s === d, p = o + s === d, m = i > 0, ee = i === d, h = a === d, g, _;
|
|
917
|
+
t ? f ? (g = "unavailable", _ = !1) : o > 0 || s > 0 ? (g = "unknown", _ = !1) : a > 0 ? (g = "off", _ = !1) : (g = "on", _ = !0) : f ? (g = "unavailable", _ = !1) : p ? (g = "unknown", _ = !1) : m ? (g = "on", _ = !0) : (g = "off", _ = !1);
|
|
918
|
+
let v = l > 0 ? Math.round(c / l) : 0, y = Math.round(v / 255 * 100), b;
|
|
917
919
|
if (u.length > 0) {
|
|
918
|
-
let e = Math.round(u.reduce((e, t) => e + t[0], 0) / u.length), t = Math.round(u.reduce((e, t) => e + t[1], 0) / u.length), n = Math.round(u.reduce((e, t) => e + t[2], 0) / u.length), r =
|
|
919
|
-
|
|
920
|
-
} else
|
|
921
|
-
let
|
|
922
|
-
return
|
|
920
|
+
let e = Math.round(u.reduce((e, t) => e + t[0], 0) / u.length), t = Math.round(u.reduce((e, t) => e + t[1], 0) / u.length), n = Math.round(u.reduce((e, t) => e + t[2], 0) / u.length), r = v / 255;
|
|
921
|
+
b = `rgb(${Math.round(e * r)}, ${Math.round(t * r)}, ${Math.round(n * r)})`;
|
|
922
|
+
} else b = Ar(n);
|
|
923
|
+
let x;
|
|
924
|
+
return x = ee ? "All on" : h ? "All off" : i > 0 ? `${i} of ${d} on` : "Off", {
|
|
923
925
|
isGroup: r,
|
|
924
|
-
state:
|
|
925
|
-
isOn:
|
|
926
|
-
isUnavailable:
|
|
927
|
-
brightness:
|
|
928
|
-
brightnessPercent:
|
|
929
|
-
color:
|
|
926
|
+
state: g,
|
|
927
|
+
isOn: _,
|
|
928
|
+
isUnavailable: g === "unavailable",
|
|
929
|
+
brightness: v,
|
|
930
|
+
brightnessPercent: y,
|
|
931
|
+
color: b,
|
|
930
932
|
onCount: i,
|
|
931
933
|
totalCount: d,
|
|
932
|
-
description:
|
|
934
|
+
description: x
|
|
933
935
|
};
|
|
934
936
|
}
|
|
935
|
-
function
|
|
937
|
+
function Or(e, t = "mean", n = !0) {
|
|
936
938
|
let r = e[0];
|
|
937
939
|
if (!r) return {
|
|
938
940
|
isGroup: !1,
|
|
@@ -1029,7 +1031,7 @@ function Cr(e, t = "mean", n = !0) {
|
|
|
1029
1031
|
memberValues: o
|
|
1030
1032
|
};
|
|
1031
1033
|
}
|
|
1032
|
-
function
|
|
1034
|
+
function kr(e, t) {
|
|
1033
1035
|
let n = t / 100, r = n * (1 - Math.abs(e / 60 % 2 - 1)), i = 1 - n, a = 0, o = 0, s = 0;
|
|
1034
1036
|
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], [
|
|
1035
1037
|
(a + i) * 255,
|
|
@@ -1037,7 +1039,7 @@ function wr(e, t) {
|
|
|
1037
1039
|
(s + i) * 255
|
|
1038
1040
|
];
|
|
1039
1041
|
}
|
|
1040
|
-
function
|
|
1042
|
+
function Ar(e) {
|
|
1041
1043
|
if (e.state !== "on") return "rgb(100, 100, 100)";
|
|
1042
1044
|
let t = (e.attributes?.brightness ?? 255) / 255;
|
|
1043
1045
|
if (e.attributes?.rgb_color) {
|
|
@@ -1045,7 +1047,7 @@ function Tr(e) {
|
|
|
1045
1047
|
return `rgb(${Math.round(n * t)}, ${Math.round(r * t)}, ${Math.round(i * t)})`;
|
|
1046
1048
|
}
|
|
1047
1049
|
if (e.attributes?.hs_color) {
|
|
1048
|
-
let [n, r] = e.attributes.hs_color, [i, a, o] =
|
|
1050
|
+
let [n, r] = e.attributes.hs_color, [i, a, o] = kr(n, r);
|
|
1049
1051
|
return `rgb(${Math.round(i * t)}, ${Math.round(a * t)}, ${Math.round(o * t)})`;
|
|
1050
1052
|
}
|
|
1051
1053
|
if (e.attributes?.color_temp) {
|
|
@@ -1056,7 +1058,7 @@ function Tr(e) {
|
|
|
1056
1058
|
}
|
|
1057
1059
|
//#endregion
|
|
1058
1060
|
//#region src/framework/utils/entity-state.ts
|
|
1059
|
-
function
|
|
1061
|
+
function jr(e) {
|
|
1060
1062
|
if (!e) return !1;
|
|
1061
1063
|
if ([
|
|
1062
1064
|
"on",
|
|
@@ -1072,15 +1074,15 @@ function Er(e) {
|
|
|
1072
1074
|
}
|
|
1073
1075
|
return !1;
|
|
1074
1076
|
}
|
|
1075
|
-
function
|
|
1077
|
+
function Mr(e, t, n) {
|
|
1076
1078
|
return e?.attributes ? e.attributes[t] ?? n : n;
|
|
1077
1079
|
}
|
|
1078
|
-
function
|
|
1079
|
-
return e.filter(
|
|
1080
|
+
function Nr(e) {
|
|
1081
|
+
return e.filter(jr).length;
|
|
1080
1082
|
}
|
|
1081
1083
|
//#endregion
|
|
1082
1084
|
//#region src/framework/utils/format-value.ts
|
|
1083
|
-
function
|
|
1085
|
+
function Pr(e, t, n) {
|
|
1084
1086
|
let { decimals: r, scale: i = !0 } = n || {};
|
|
1085
1087
|
if (typeof e == "string") return t ? `${e}${t}` : e;
|
|
1086
1088
|
if (e == null || Number.isNaN(e)) return t ? `--${t}` : "--";
|
|
@@ -1091,47 +1093,51 @@ function kr(e, t, n) {
|
|
|
1091
1093
|
}
|
|
1092
1094
|
//#endregion
|
|
1093
1095
|
//#region src/framework/utils/interpret-value.ts
|
|
1094
|
-
function
|
|
1096
|
+
function Fr(e, t) {
|
|
1095
1097
|
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;
|
|
1096
1098
|
}
|
|
1097
1099
|
//#endregion
|
|
1098
1100
|
//#region src/framework/components/WidgetValue.tsx
|
|
1099
|
-
var
|
|
1100
|
-
function
|
|
1101
|
+
var Ir = /*#__PURE__*/ B("<div class=glasshome-widget-subtitle>"), Lr = /*#__PURE__*/ B("<div><div class=glasshome-widget-value>");
|
|
1102
|
+
function Rr(e) {
|
|
1101
1103
|
return (() => {
|
|
1102
|
-
var t =
|
|
1103
|
-
return F(n, () =>
|
|
1104
|
+
var t = Lr(), n = t.firstChild;
|
|
1105
|
+
return F(n, () => Pr(e.value, e.unit)), F(t, N(w, {
|
|
1104
1106
|
get when() {
|
|
1105
1107
|
return I(() => !!e.interpret)() && typeof e.value == "number";
|
|
1106
1108
|
},
|
|
1107
1109
|
get children() {
|
|
1108
|
-
var t =
|
|
1109
|
-
return F(t, () =>
|
|
1110
|
+
var t = Ir();
|
|
1111
|
+
return F(t, () => Fr(e.value, e.unit)), t;
|
|
1110
1112
|
}
|
|
1111
1113
|
}), null), P(() => M(t, X("flex flex-col", e.class))), t;
|
|
1112
1114
|
})();
|
|
1113
1115
|
}
|
|
1114
1116
|
//#endregion
|
|
1115
1117
|
//#region src/framework/core/Widget.tsx
|
|
1116
|
-
var
|
|
1117
|
-
function
|
|
1118
|
-
let n = A(W), r =
|
|
1118
|
+
var zr = /*#__PURE__*/ B("<span class=glasshome-widget-hold-flood aria-hidden=true>"), Br = /*#__PURE__*/ B("<div><div class=\"relative h-full w-full\">"), Vr = /*#__PURE__*/ B("<div class=\"glasshome-widget-loading pointer-events-none absolute inset-0 animate-pulse\">"), Hr = /*#__PURE__*/ B("<div class=\"flex h-full w-full flex-col items-center justify-center gap-2 text-center\">"), Ur = /*#__PURE__*/ B("<div class=\"text-muted-foreground flex items-center justify-center\">"), Wr = /*#__PURE__*/ B("<h3 class=\"text-foreground text-sm font-semibold\">"), Gr = /*#__PURE__*/ B("<p class=\"text-muted-foreground text-xs\">"), Kr = 2e3;
|
|
1119
|
+
function qr(t) {
|
|
1120
|
+
let n = A(W), r = En(() => ({ hold: { action: () => (q.get(n ?? {}) ?? q.get(f))?.("edit") } }));
|
|
1119
1121
|
k(r.dispose);
|
|
1120
|
-
let i =
|
|
1121
|
-
k(
|
|
1122
|
-
let
|
|
1123
|
-
E(() =>
|
|
1124
|
-
|
|
1122
|
+
let i = cn(n), a = !!n && !(on in n), o = En(() => ({ hold: i?.hasSheet() ? { action: () => (q.get(n ?? {}) ?? q.get(f))?.() } : void 0 }));
|
|
1123
|
+
k(o.dispose);
|
|
1124
|
+
let s = () => t.emptyState && n ? r : t.gestures ?? (a ? o : void 0);
|
|
1125
|
+
a && (E(() => n?.onHoldable?.(!t.emptyState && !!s()?.holds?.())), k(() => n?.onHoldable?.(!1))), E(() => {
|
|
1126
|
+
if (!a || !i?.nothingMore()) return;
|
|
1127
|
+
let e = setTimeout(() => i.setNothingMore(!1), Kr);
|
|
1128
|
+
k(() => clearTimeout(e));
|
|
1129
|
+
}), E(() => i?.setTone(t.color ?? (t.tone ? `var(--tone-${t.tone})` : void 0)));
|
|
1130
|
+
let [c, l] = O(), [u, d] = O({
|
|
1125
1131
|
width: 0,
|
|
1126
1132
|
height: 0
|
|
1127
1133
|
});
|
|
1128
1134
|
E(() => {
|
|
1129
|
-
let e =
|
|
1135
|
+
let e = c();
|
|
1130
1136
|
if (!e) return;
|
|
1131
1137
|
let t = new ResizeObserver(([e]) => {
|
|
1132
1138
|
if (!e) return;
|
|
1133
1139
|
let t = e.borderBoxSize?.[0];
|
|
1134
|
-
|
|
1140
|
+
d(t ? {
|
|
1135
1141
|
width: t.inlineSize,
|
|
1136
1142
|
height: t.blockSize
|
|
1137
1143
|
} : {
|
|
@@ -1141,23 +1147,23 @@ function Vr(t) {
|
|
|
1141
1147
|
});
|
|
1142
1148
|
t.observe(e), k(() => t.disconnect());
|
|
1143
1149
|
}), ge(() => {
|
|
1144
|
-
let e =
|
|
1145
|
-
|
|
1150
|
+
let e = c()?.getRootNode();
|
|
1151
|
+
lr(typeof ShadowRoot < "u" && e instanceof ShadowRoot || typeof Document < "u" && e instanceof Document ? e : void 0);
|
|
1146
1152
|
});
|
|
1147
|
-
let
|
|
1153
|
+
let f = {
|
|
1148
1154
|
...n,
|
|
1149
1155
|
updateConfig: n?.updateConfig ?? (() => {}),
|
|
1150
|
-
dimensions: e(() =>
|
|
1156
|
+
dimensions: e(() => u(), "ctx.dimensions")
|
|
1151
1157
|
};
|
|
1152
|
-
n && Object.defineProperty(
|
|
1153
|
-
let
|
|
1154
|
-
if (t.variant) return typeof t.variant == "string" ?
|
|
1155
|
-
}),
|
|
1158
|
+
n && Object.defineProperty(f, on, { value: n });
|
|
1159
|
+
let p = D(() => {
|
|
1160
|
+
if (t.variant) return typeof t.variant == "string" ? dr(t.variant) : t.variant.styles;
|
|
1161
|
+
}), m = e(() => t.gradient, "widget.gradient"), ee = D(() => ({
|
|
1156
1162
|
"container-type": "size",
|
|
1157
1163
|
"container-name": "widget",
|
|
1158
|
-
"touch-action":
|
|
1159
|
-
...
|
|
1160
|
-
...
|
|
1164
|
+
"touch-action": s() && !t.isEditMode ? s()?.touchAction() : void 0,
|
|
1165
|
+
...p()?.container,
|
|
1166
|
+
...p()?.cssVars || {},
|
|
1161
1167
|
...t.tone ? { "--widget-color": `var(--tone-${t.tone})` } : {},
|
|
1162
1168
|
...t.color ? { "--widget-color": t.color } : {},
|
|
1163
1169
|
...t.tone && t.tone !== "neutral" || t.color ? { "--glass-tone": "var(--widget-color)" } : {},
|
|
@@ -1165,22 +1171,22 @@ function Vr(t) {
|
|
|
1165
1171
|
"--widget-color-to": t.colorTo,
|
|
1166
1172
|
"--glass-tone-2": t.colorTo
|
|
1167
1173
|
} : {},
|
|
1168
|
-
...t.gradient ? { "background-image":
|
|
1169
|
-
})), h = () => !!
|
|
1170
|
-
h() &&
|
|
1174
|
+
...t.gradient ? { "background-image": m() } : {}
|
|
1175
|
+
})), h = () => !!s() && !t.isEditMode, g = (e) => {
|
|
1176
|
+
h() && s()?.onPointerEnter(e);
|
|
1171
1177
|
}, _ = (e) => {
|
|
1172
|
-
h() &&
|
|
1178
|
+
h() && s()?.onPointerDown(e);
|
|
1173
1179
|
}, v = (e) => {
|
|
1174
|
-
h() &&
|
|
1180
|
+
h() && s()?.onPointerMove(e);
|
|
1175
1181
|
}, y = (e) => {
|
|
1176
|
-
h() &&
|
|
1182
|
+
h() && s()?.onPointerUp(e);
|
|
1177
1183
|
}, b = (e) => {
|
|
1178
|
-
h() &&
|
|
1179
|
-
}, x = () =>
|
|
1184
|
+
h() && s()?.onPointerCancel(e);
|
|
1185
|
+
}, x = () => s()?.hold?.() ?? null, S = {
|
|
1180
1186
|
x: 0,
|
|
1181
1187
|
y: 0,
|
|
1182
1188
|
r: 0
|
|
1183
|
-
},
|
|
1189
|
+
}, te = (e) => (e && Object.assign(S, {
|
|
1184
1190
|
x: e.x,
|
|
1185
1191
|
y: e.y,
|
|
1186
1192
|
r: e.r
|
|
@@ -1192,63 +1198,86 @@ function Vr(t) {
|
|
|
1192
1198
|
"z-index": K.BACKGROUND
|
|
1193
1199
|
});
|
|
1194
1200
|
return N(W.Provider, {
|
|
1195
|
-
value:
|
|
1201
|
+
value: f,
|
|
1196
1202
|
get children() {
|
|
1197
|
-
return N(
|
|
1203
|
+
return N(Kn.Provider, {
|
|
1198
1204
|
value: () => t.confirmed === !0,
|
|
1199
1205
|
get children() {
|
|
1200
|
-
return N(
|
|
1201
|
-
value:
|
|
1206
|
+
return N(Dn.Provider, {
|
|
1207
|
+
value: u,
|
|
1202
1208
|
get children() {
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
get children() {
|
|
1213
|
-
var e = Pr();
|
|
1214
|
-
return P((t) => {
|
|
1215
|
-
var n = x() && !x()?.fired ? "" : void 0, r = x()?.fired ? "" : void 0, i = ee(x());
|
|
1216
|
-
return n !== t.e && L(e, "data-hold", t.e = n), r !== t.t && L(e, "data-fired", t.t = r), t.a = z(e, i, t.a), t;
|
|
1217
|
-
}, {
|
|
1218
|
-
e: void 0,
|
|
1219
|
-
t: void 0,
|
|
1220
|
-
a: void 0
|
|
1221
|
-
}), e;
|
|
1222
|
-
}
|
|
1223
|
-
}), n), F(n, (() => {
|
|
1224
|
-
var e = I(() => !!t.emptyState);
|
|
1225
|
-
return () => e() ? N(Hr, {
|
|
1226
|
-
get icon() {
|
|
1227
|
-
return t.emptyState.icon;
|
|
1228
|
-
},
|
|
1229
|
-
get title() {
|
|
1230
|
-
return t.emptyState.title;
|
|
1209
|
+
return [(() => {
|
|
1210
|
+
var e = Br(), n = e.firstChild;
|
|
1211
|
+
return e.$$keydown = (e) => {
|
|
1212
|
+
h() && s()?.onKeyDown?.(e);
|
|
1213
|
+
}, j(e, "pointercancel", b), j(e, "pointerup", y), j(e, "pointermove", v), j(e, "pointerdown", _), j(e, "pointerenter", g), V((e) => {
|
|
1214
|
+
l(e), t.gestures?.bindElement(e), r.bindElement(e);
|
|
1215
|
+
}, e), F(e, N(w, {
|
|
1216
|
+
get when() {
|
|
1217
|
+
return s()?.hold;
|
|
1231
1218
|
},
|
|
1232
|
-
get
|
|
1233
|
-
|
|
1219
|
+
get children() {
|
|
1220
|
+
var e = zr();
|
|
1221
|
+
return P((t) => {
|
|
1222
|
+
var n = x() && !x()?.fired ? "" : void 0, r = x()?.fired ? "" : void 0, i = te(x());
|
|
1223
|
+
return n !== t.e && L(e, "data-hold", t.e = n), r !== t.t && L(e, "data-fired", t.t = r), t.a = z(e, i, t.a), t;
|
|
1224
|
+
}, {
|
|
1225
|
+
e: void 0,
|
|
1226
|
+
t: void 0,
|
|
1227
|
+
a: void 0
|
|
1228
|
+
}), e;
|
|
1234
1229
|
}
|
|
1235
|
-
})
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1230
|
+
}), n), F(n, (() => {
|
|
1231
|
+
var e = I(() => !!t.emptyState);
|
|
1232
|
+
return () => e() ? N(Jr, {
|
|
1233
|
+
get icon() {
|
|
1234
|
+
return t.emptyState.icon;
|
|
1235
|
+
},
|
|
1236
|
+
get title() {
|
|
1237
|
+
return t.emptyState.title;
|
|
1238
|
+
},
|
|
1239
|
+
get message() {
|
|
1240
|
+
return t.emptyState.message;
|
|
1241
|
+
}
|
|
1242
|
+
}) : t.children;
|
|
1243
|
+
})()), F(e, (() => {
|
|
1244
|
+
var e = I(() => !!t.loading);
|
|
1245
|
+
return () => e() && (() => {
|
|
1246
|
+
var e = Vr();
|
|
1247
|
+
return P((t) => R(e, "z-index", K.OVERLAY)), e;
|
|
1248
|
+
})();
|
|
1249
|
+
})(), null), P((r) => {
|
|
1250
|
+
var i = X("glasshome-widget glass", "relative h-full w-full overflow-hidden rounded-xl select-none", p()?.class, t.class), a = ee(), o = t.confirmed || void 0, s = h() ? 0 : void 0, c = K.CONTENT;
|
|
1251
|
+
return i !== r.e && M(e, r.e = i), r.t = z(e, a, r.t), o !== r.a && L(e, "data-confirmed", r.a = o), s !== r.o && L(e, "tabindex", r.o = s), c !== r.i && R(n, "z-index", r.i = c), r;
|
|
1252
|
+
}, {
|
|
1253
|
+
e: void 0,
|
|
1254
|
+
t: void 0,
|
|
1255
|
+
a: void 0,
|
|
1256
|
+
o: void 0,
|
|
1257
|
+
i: void 0
|
|
1258
|
+
}), e;
|
|
1259
|
+
})(), N(w, {
|
|
1260
|
+
when: a,
|
|
1261
|
+
get children() {
|
|
1262
|
+
return N(Ze, {
|
|
1263
|
+
get open() {
|
|
1264
|
+
return i?.nothingMore() ?? !1;
|
|
1265
|
+
},
|
|
1266
|
+
onOpenChange: (e) => {
|
|
1267
|
+
e || i?.setNothingMore(!1);
|
|
1268
|
+
},
|
|
1269
|
+
anchorRef: c,
|
|
1270
|
+
get children() {
|
|
1271
|
+
return N(Qe, {
|
|
1272
|
+
class: "flex w-auto items-center gap-2 p-3 text-sm",
|
|
1273
|
+
get children() {
|
|
1274
|
+
return [N(U, { icon: "mdi:information-outline" }), "No more controls for this widget"];
|
|
1275
|
+
}
|
|
1276
|
+
});
|
|
1277
|
+
}
|
|
1278
|
+
});
|
|
1279
|
+
}
|
|
1280
|
+
})];
|
|
1252
1281
|
}
|
|
1253
1282
|
});
|
|
1254
1283
|
}
|
|
@@ -1256,81 +1285,81 @@ function Vr(t) {
|
|
|
1256
1285
|
}
|
|
1257
1286
|
});
|
|
1258
1287
|
}
|
|
1259
|
-
function
|
|
1288
|
+
function Jr(e) {
|
|
1260
1289
|
return (() => {
|
|
1261
|
-
var t =
|
|
1290
|
+
var t = Hr();
|
|
1262
1291
|
return F(t, (() => {
|
|
1263
1292
|
var t = I(() => !!e.icon);
|
|
1264
1293
|
return () => t() && (() => {
|
|
1265
|
-
var t =
|
|
1294
|
+
var t = Ur();
|
|
1266
1295
|
return F(t, () => e.icon), t;
|
|
1267
1296
|
})();
|
|
1268
1297
|
})(), null), F(t, (() => {
|
|
1269
1298
|
var t = I(() => !!e.title);
|
|
1270
1299
|
return () => t() && (() => {
|
|
1271
|
-
var t =
|
|
1300
|
+
var t = Wr();
|
|
1272
1301
|
return F(t, () => e.title), t;
|
|
1273
1302
|
})();
|
|
1274
1303
|
})(), null), F(t, (() => {
|
|
1275
1304
|
var t = I(() => !!e.message);
|
|
1276
1305
|
return () => t() && (() => {
|
|
1277
|
-
var t =
|
|
1306
|
+
var t = Gr();
|
|
1278
1307
|
return F(t, () => e.message), t;
|
|
1279
1308
|
})();
|
|
1280
1309
|
})(), null), t;
|
|
1281
1310
|
})();
|
|
1282
1311
|
}
|
|
1283
|
-
var Z =
|
|
1284
|
-
Z.Content =
|
|
1312
|
+
var Z = qr;
|
|
1313
|
+
Z.Content = _r, Z.Icon = Pn, Z.Title = Sr, Z.Status = yr, Z.Value = Rr, Z.SliderFill = mr, Z.Head = Jn, Z.Hero = Yn, Z.Controls = Xn, Z.Stepper = Zn, Z.Choice = Qn, Z.Action = $n, Z.Chip = er, Z.Backdrop = nr, Z.Layer = tr, Z.Glyph = rr, ve(["keydown"]);
|
|
1285
1314
|
//#endregion
|
|
1286
1315
|
//#region src/framework/panel/panel.tsx
|
|
1287
|
-
var
|
|
1288
|
-
function
|
|
1289
|
-
let t, n = !1,
|
|
1316
|
+
var Yr = /*#__PURE__*/ B("<section class=glasshome-panel-section><h3 class=glasshome-panel-label>"), Xr = /*#__PURE__*/ B("<div class=glasshome-panel-rows>"), Zr = /*#__PURE__*/ B("<span class=\"glasshome-widget-slider-fill glasshome-panel-row-fill\">"), Qr = /*#__PURE__*/ B("<span class=\"glasshome-widget-icon glass glasshome-panel-row-icon\">"), $r = /*#__PURE__*/ B("<span class=glasshome-panel-row-state>"), ei = /*#__PURE__*/ B("<span class=glasshome-panel-row-text><span class=glasshome-panel-row-name>"), ti = /*#__PURE__*/ B("<span class=glasshome-panel-row-trailing>"), ni = /*#__PURE__*/ B("<div class=glasshome-panel-row-wrap>"), ri = /*#__PURE__*/ B("<div>"), ii = /*#__PURE__*/ B("<div class=\"glasshome-panel-facts glass\">"), ai = /*#__PURE__*/ B("<div class=glasshome-panel-fact><span class=glasshome-panel-row-text><span class=glasshome-panel-fact-label></span><span class=glasshome-panel-fact-value>"), oi = 8, si = (e, t, n) => Math.min(n, Math.max(t, e));
|
|
1317
|
+
function ci(e) {
|
|
1318
|
+
let t = A(W), n, r = !1, i = !1, a, o = 0, s = (t, n) => {
|
|
1290
1319
|
let r = e.slide?.();
|
|
1291
1320
|
if (!r) return 0;
|
|
1292
1321
|
let i = t.getBoundingClientRect(), a = e.axis === "x" ? (n.clientX - i.left) / i.width : 1 - (n.clientY - i.top) / i.height, o = r.min ?? 0, s = r.max ?? 100;
|
|
1293
|
-
return Math.round(
|
|
1294
|
-
},
|
|
1295
|
-
clearTimeout(
|
|
1322
|
+
return Math.round(si(o + a * (s - o), o, s));
|
|
1323
|
+
}, c = () => {
|
|
1324
|
+
clearTimeout(a), n = void 0;
|
|
1296
1325
|
};
|
|
1297
|
-
return k(() => clearTimeout(
|
|
1298
|
-
onPointerDown: (
|
|
1299
|
-
if (
|
|
1300
|
-
let
|
|
1301
|
-
|
|
1302
|
-
x:
|
|
1303
|
-
y:
|
|
1304
|
-
id:
|
|
1305
|
-
},
|
|
1306
|
-
|
|
1307
|
-
},
|
|
1326
|
+
return k(() => clearTimeout(a)), {
|
|
1327
|
+
onPointerDown: (o) => {
|
|
1328
|
+
if (o.button !== 0 || n) return;
|
|
1329
|
+
let s = o.target instanceof Element ? o.target.closest(Tn) : null;
|
|
1330
|
+
s && s !== o.currentTarget || (n = {
|
|
1331
|
+
x: o.clientX,
|
|
1332
|
+
y: o.clientY,
|
|
1333
|
+
id: o.pointerId
|
|
1334
|
+
}, o.currentTarget.setPointerCapture?.(o.pointerId), r = !1, i = !1, e.onHold && (a = setTimeout(() => {
|
|
1335
|
+
i = !0, e.onHold?.(), t?.onHeld?.();
|
|
1336
|
+
}, qe)));
|
|
1308
1337
|
},
|
|
1309
|
-
onPointerMove: (
|
|
1310
|
-
if (!
|
|
1311
|
-
let c =
|
|
1312
|
-
!
|
|
1338
|
+
onPointerMove: (t) => {
|
|
1339
|
+
if (!n || t.pointerId !== n.id || i) return;
|
|
1340
|
+
let c = t.currentTarget, l = e.axis === "x" ? Math.abs(t.clientX - n.x) : Math.abs(t.clientY - n.y);
|
|
1341
|
+
!r && e.slide?.() && l > oi && (r = !0, clearTimeout(a)), r ? (o = s(c, t), e.slide?.()?.onChange(o)) : Math.hypot(t.clientX - n.x, t.clientY - n.y) > oi && clearTimeout(a);
|
|
1313
1342
|
},
|
|
1314
|
-
onPointerUp: (
|
|
1315
|
-
|
|
1343
|
+
onPointerUp: (t) => {
|
|
1344
|
+
n && t.pointerId === n.id && (r ? e.slide?.()?.onCommit?.(o) : i || e.onTap?.(), c());
|
|
1316
1345
|
},
|
|
1317
|
-
onPointerCancel:
|
|
1346
|
+
onPointerCancel: c
|
|
1318
1347
|
};
|
|
1319
1348
|
}
|
|
1320
|
-
function
|
|
1349
|
+
function li(e) {
|
|
1321
1350
|
return (() => {
|
|
1322
|
-
var t =
|
|
1351
|
+
var t = Yr(), n = t.firstChild;
|
|
1323
1352
|
return F(n, () => e.label), F(t, () => e.children, null), t;
|
|
1324
1353
|
})();
|
|
1325
1354
|
}
|
|
1326
|
-
function
|
|
1355
|
+
function ui(e) {
|
|
1327
1356
|
return (() => {
|
|
1328
|
-
var t =
|
|
1357
|
+
var t = Xr();
|
|
1329
1358
|
return F(t, () => e.children), t;
|
|
1330
1359
|
})();
|
|
1331
1360
|
}
|
|
1332
|
-
function
|
|
1333
|
-
let t = () => !!(e.onTap || e.slide || e.onHold), n =
|
|
1361
|
+
function di(e) {
|
|
1362
|
+
let t = () => !!(e.onTap || e.slide || e.onHold), n = ci({
|
|
1334
1363
|
axis: "x",
|
|
1335
1364
|
slide: () => e.slide,
|
|
1336
1365
|
onTap: () => e.onTap?.(),
|
|
@@ -1347,7 +1376,7 @@ function si(e) {
|
|
|
1347
1376
|
let r = t.key === "ArrowRight" || t.key === "ArrowUp" ? 5 : t.key === "ArrowLeft" || t.key === "ArrowDown" ? -5 : 0;
|
|
1348
1377
|
if (!r) return;
|
|
1349
1378
|
t.preventDefault();
|
|
1350
|
-
let i =
|
|
1379
|
+
let i = si(n.value + r, n.min ?? 0, n.max ?? 100);
|
|
1351
1380
|
n.onChange(i), n.onCommit?.(i);
|
|
1352
1381
|
}, a = () => [
|
|
1353
1382
|
N(w, {
|
|
@@ -1355,12 +1384,12 @@ function si(e) {
|
|
|
1355
1384
|
return r() !== void 0;
|
|
1356
1385
|
},
|
|
1357
1386
|
get children() {
|
|
1358
|
-
var e =
|
|
1387
|
+
var e = Zr();
|
|
1359
1388
|
return P((t) => z(e, { "--widget-fill-value": r() }, t)), e;
|
|
1360
1389
|
}
|
|
1361
1390
|
}),
|
|
1362
1391
|
(() => {
|
|
1363
|
-
var t =
|
|
1392
|
+
var t = Qr();
|
|
1364
1393
|
return F(t, N(U, {
|
|
1365
1394
|
get icon() {
|
|
1366
1395
|
return e.icon;
|
|
@@ -1375,29 +1404,29 @@ function si(e) {
|
|
|
1375
1404
|
}), t;
|
|
1376
1405
|
})(),
|
|
1377
1406
|
(() => {
|
|
1378
|
-
var t =
|
|
1407
|
+
var t = ei(), n = t.firstChild;
|
|
1379
1408
|
return F(n, () => e.name), F(t, N(w, {
|
|
1380
1409
|
get when() {
|
|
1381
1410
|
return e.state !== void 0;
|
|
1382
1411
|
},
|
|
1383
1412
|
get children() {
|
|
1384
|
-
var t =
|
|
1413
|
+
var t = $r();
|
|
1385
1414
|
return F(t, () => e.state), t;
|
|
1386
1415
|
}
|
|
1387
1416
|
}), null), t;
|
|
1388
1417
|
})()
|
|
1389
1418
|
], o = () => ({ "--widget-color": e.tone ?? "var(--tone-neutral)" });
|
|
1390
1419
|
return (() => {
|
|
1391
|
-
var r =
|
|
1420
|
+
var r = ni();
|
|
1392
1421
|
return F(r, N(w, {
|
|
1393
1422
|
get when() {
|
|
1394
1423
|
return t();
|
|
1395
1424
|
},
|
|
1396
1425
|
get fallback() {
|
|
1397
1426
|
return (() => {
|
|
1398
|
-
var e =
|
|
1427
|
+
var e = ri();
|
|
1399
1428
|
return F(e, a), P((t) => {
|
|
1400
|
-
var n = `${
|
|
1429
|
+
var n = `${Rt({
|
|
1401
1430
|
variant: "outline",
|
|
1402
1431
|
size: "none"
|
|
1403
1432
|
})} glasshome-panel-row glasshome-panel-row-static`, r = o();
|
|
@@ -1448,21 +1477,21 @@ function si(e) {
|
|
|
1448
1477
|
return e.trailing;
|
|
1449
1478
|
},
|
|
1450
1479
|
get children() {
|
|
1451
|
-
var t =
|
|
1480
|
+
var t = ti();
|
|
1452
1481
|
return F(t, () => e.trailing), t;
|
|
1453
1482
|
}
|
|
1454
1483
|
}), null), r;
|
|
1455
1484
|
})();
|
|
1456
1485
|
}
|
|
1457
|
-
function
|
|
1486
|
+
function fi(e) {
|
|
1458
1487
|
return (() => {
|
|
1459
|
-
var t =
|
|
1488
|
+
var t = ii();
|
|
1460
1489
|
return F(t, N(C, {
|
|
1461
1490
|
get each() {
|
|
1462
1491
|
return e.items;
|
|
1463
1492
|
},
|
|
1464
1493
|
children: (e) => (() => {
|
|
1465
|
-
var t =
|
|
1494
|
+
var t = ai(), n = t.firstChild, r = n.firstChild, i = r.nextSibling;
|
|
1466
1495
|
return F(t, N(U, {
|
|
1467
1496
|
get icon() {
|
|
1468
1497
|
return e.icon;
|
|
@@ -1475,7 +1504,7 @@ function ci(e) {
|
|
|
1475
1504
|
}
|
|
1476
1505
|
//#endregion
|
|
1477
1506
|
//#region src/framework/panel/panel-entity.tsx
|
|
1478
|
-
var
|
|
1507
|
+
var pi = (e) => typeof e == "number" ? Math.round(e) : void 0, mi = (e) => e.charAt(0).toUpperCase() + e.slice(1).replaceAll("_", " "), Q = (e) => ({ entity_id: e.id }), hi = {
|
|
1479
1508
|
light: {
|
|
1480
1509
|
icon: "mdi:lightbulb",
|
|
1481
1510
|
tone: (e) => {
|
|
@@ -1515,10 +1544,10 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1515
1544
|
on: (e) => e.state === "on",
|
|
1516
1545
|
state: (e) => {
|
|
1517
1546
|
if (e.state !== "on") return "Off";
|
|
1518
|
-
let t =
|
|
1547
|
+
let t = pi(e.attributes.percentage);
|
|
1519
1548
|
return t === void 0 ? "On" : `${t}%`;
|
|
1520
1549
|
},
|
|
1521
|
-
level: (e) => e.state === "on" ?
|
|
1550
|
+
level: (e) => e.state === "on" ? pi(e.attributes.percentage) ?? 100 : 0,
|
|
1522
1551
|
setLevel: (e, t, n) => e("fan", "set_percentage", { percentage: n }, Q(t)),
|
|
1523
1552
|
tap: (e, t) => e("fan", "toggle", {}, Q(t))
|
|
1524
1553
|
},
|
|
@@ -1527,10 +1556,10 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1527
1556
|
tone: "var(--tone-info)",
|
|
1528
1557
|
on: (e) => e.state !== "closed",
|
|
1529
1558
|
state: (e) => {
|
|
1530
|
-
let t =
|
|
1559
|
+
let t = pi(e.attributes.current_position), n = mi(e.state);
|
|
1531
1560
|
return t !== void 0 && e.state === "open" ? `${n} · ${t}%` : n;
|
|
1532
1561
|
},
|
|
1533
|
-
level: (e) =>
|
|
1562
|
+
level: (e) => pi(e.attributes.current_position),
|
|
1534
1563
|
setLevel: (e, t, n) => e("cover", "set_cover_position", { position: n }, Q(t)),
|
|
1535
1564
|
tap: (e, t) => e("cover", t.state === "closed" ? "open_cover" : "close_cover", {}, Q(t))
|
|
1536
1565
|
},
|
|
@@ -1538,7 +1567,7 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1538
1567
|
icon: (e) => e.state === "locked" ? "mdi:lock" : "mdi:lock-open-variant",
|
|
1539
1568
|
tone: "var(--tone-success)",
|
|
1540
1569
|
on: (e) => e.state === "locked",
|
|
1541
|
-
state: (e) =>
|
|
1570
|
+
state: (e) => mi(e.state),
|
|
1542
1571
|
tap: (e, t) => e("lock", t.state === "locked" ? "unlock" : "lock", {}, Q(t))
|
|
1543
1572
|
},
|
|
1544
1573
|
climate: {
|
|
@@ -1548,14 +1577,14 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1548
1577
|
state: (e) => {
|
|
1549
1578
|
if (e.state === "off") return "Off";
|
|
1550
1579
|
let t = e.attributes.temperature;
|
|
1551
|
-
return typeof t == "number" ? `${
|
|
1580
|
+
return typeof t == "number" ? `${mi(e.state)} · ${t}°` : mi(e.state);
|
|
1552
1581
|
}
|
|
1553
1582
|
},
|
|
1554
1583
|
media_player: {
|
|
1555
1584
|
icon: "mdi:speaker",
|
|
1556
1585
|
tone: "var(--tone-accent)",
|
|
1557
1586
|
on: (e) => e.state === "playing",
|
|
1558
|
-
state: (e) => typeof e.attributes.media_title == "string" && e.state !== "off" ? e.attributes.media_title :
|
|
1587
|
+
state: (e) => typeof e.attributes.media_title == "string" && e.state !== "off" ? e.attributes.media_title : mi(e.state),
|
|
1559
1588
|
level: (e) => typeof e.attributes.volume_level == "number" ? Math.round(e.attributes.volume_level * 100) : void 0,
|
|
1560
1589
|
setLevel: (e, t, n) => e("media_player", "volume_set", { volume_level: n / 100 }, Q(t)),
|
|
1561
1590
|
tap: (e, t) => e("media_player", "media_play_pause", {}, Q(t))
|
|
@@ -1565,7 +1594,7 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1565
1594
|
tone: "var(--tone-info)",
|
|
1566
1595
|
on: (e) => e.state === "on",
|
|
1567
1596
|
state: (e) => {
|
|
1568
|
-
let t =
|
|
1597
|
+
let t = _i[e.deviceClass ?? ""] ?? ["On", "Off"];
|
|
1569
1598
|
return e.state === "on" ? t[0] : t[1];
|
|
1570
1599
|
}
|
|
1571
1600
|
},
|
|
@@ -1573,14 +1602,14 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1573
1602
|
icon: "mdi:gesture-tap-button",
|
|
1574
1603
|
tone: "var(--tone-accent)",
|
|
1575
1604
|
on: () => !1,
|
|
1576
|
-
state: (e) =>
|
|
1605
|
+
state: (e) => vi(e.state),
|
|
1577
1606
|
tap: (e, t) => e("button", "press", {}, Q(t))
|
|
1578
1607
|
},
|
|
1579
1608
|
input_button: {
|
|
1580
1609
|
icon: "mdi:gesture-tap-button",
|
|
1581
1610
|
tone: "var(--tone-accent)",
|
|
1582
1611
|
on: () => !1,
|
|
1583
|
-
state: (e) =>
|
|
1612
|
+
state: (e) => vi(e.state),
|
|
1584
1613
|
tap: (e, t) => e("input_button", "press", {}, Q(t))
|
|
1585
1614
|
},
|
|
1586
1615
|
scene: {
|
|
@@ -1597,14 +1626,14 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1597
1626
|
state: (e) => e.state === "on" ? "Running" : "Tap to run",
|
|
1598
1627
|
tap: (e, t) => e("script", "turn_on", {}, Q(t))
|
|
1599
1628
|
}
|
|
1600
|
-
},
|
|
1629
|
+
}, gi = {
|
|
1601
1630
|
garage: "mdi:garage",
|
|
1602
1631
|
gate: "mdi:gate",
|
|
1603
1632
|
door: "mdi:door",
|
|
1604
1633
|
curtain: "mdi:curtains",
|
|
1605
1634
|
shutter: "mdi:window-shutter",
|
|
1606
1635
|
awning: "mdi:awning"
|
|
1607
|
-
},
|
|
1636
|
+
}, _i = {
|
|
1608
1637
|
door: ["Open", "Closed"],
|
|
1609
1638
|
window: ["Open", "Closed"],
|
|
1610
1639
|
garage_door: ["Open", "Closed"],
|
|
@@ -1618,29 +1647,29 @@ var li = (e) => typeof e == "number" ? Math.round(e) : void 0, ui = (e) => e.cha
|
|
|
1618
1647
|
battery: ["Low", "Normal"],
|
|
1619
1648
|
connectivity: ["Connected", "Disconnected"]
|
|
1620
1649
|
};
|
|
1621
|
-
function
|
|
1650
|
+
function vi(e) {
|
|
1622
1651
|
let t = Date.parse(e);
|
|
1623
1652
|
return Number.isNaN(t) ? "Never pressed" : new Date(t).toLocaleTimeString([], {
|
|
1624
1653
|
hour: "2-digit",
|
|
1625
1654
|
minute: "2-digit"
|
|
1626
1655
|
});
|
|
1627
1656
|
}
|
|
1628
|
-
var
|
|
1657
|
+
var yi = {
|
|
1629
1658
|
icon: "mdi:circle-medium",
|
|
1630
1659
|
tone: "var(--tone-neutral)",
|
|
1631
1660
|
on: (e) => e.state === "on",
|
|
1632
|
-
state: (e) =>
|
|
1661
|
+
state: (e) => mi(e.state)
|
|
1633
1662
|
};
|
|
1634
|
-
function
|
|
1663
|
+
function bi(e, t) {
|
|
1635
1664
|
if (!t || e.length <= t.length || !e.toLowerCase().startsWith(t.toLowerCase())) return e;
|
|
1636
1665
|
let n = e.slice(t.length).trim();
|
|
1637
1666
|
return n ? n.charAt(0).toUpperCase() + n.slice(1) : e;
|
|
1638
1667
|
}
|
|
1639
|
-
function
|
|
1640
|
-
return !!
|
|
1668
|
+
function xi(e) {
|
|
1669
|
+
return !!hi[e]?.tap || !!hi[e]?.setLevel;
|
|
1641
1670
|
}
|
|
1642
|
-
function
|
|
1643
|
-
let t = te(() => e.entityId), { callService: n } =
|
|
1671
|
+
function Si(e) {
|
|
1672
|
+
let t = te(() => e.entityId), { callService: n } = $t(), [r, i] = O();
|
|
1644
1673
|
return E(() => {
|
|
1645
1674
|
t(), i(void 0);
|
|
1646
1675
|
}), N(w, {
|
|
@@ -1648,14 +1677,14 @@ function vi(e) {
|
|
|
1648
1677
|
return t();
|
|
1649
1678
|
},
|
|
1650
1679
|
children: (t) => {
|
|
1651
|
-
let a = () =>
|
|
1652
|
-
return N(
|
|
1680
|
+
let a = () => hi[t().domain] ?? yi, o = () => r() ?? a().level?.(t()), s = () => a().setLevel;
|
|
1681
|
+
return N(di, {
|
|
1653
1682
|
get icon() {
|
|
1654
1683
|
let n = a().icon;
|
|
1655
|
-
return typeof n == "function" ? e.icon ?? n(t()) : e.icon ?? t().icon ??
|
|
1684
|
+
return typeof n == "function" ? e.icon ?? n(t()) : e.icon ?? t().icon ?? gi[t().domain === "cover" ? t().deviceClass ?? "" : ""] ?? n;
|
|
1656
1685
|
},
|
|
1657
1686
|
get name() {
|
|
1658
|
-
return e.name ??
|
|
1687
|
+
return e.name ?? bi(t().friendlyName ?? t().id, e.within);
|
|
1659
1688
|
},
|
|
1660
1689
|
get state() {
|
|
1661
1690
|
return a().state(t());
|
|
@@ -1687,8 +1716,8 @@ function vi(e) {
|
|
|
1687
1716
|
}
|
|
1688
1717
|
//#endregion
|
|
1689
1718
|
//#region src/framework/dialogs/debug-view.tsx
|
|
1690
|
-
var
|
|
1691
|
-
function
|
|
1719
|
+
var Ci = /*#__PURE__*/ B("<pre class=\"text-muted-foreground max-h-64 overflow-auto p-3 font-mono text-xs leading-relaxed\">"), wi = /*#__PURE__*/ B("<span class=\"flex items-center gap-2\">"), Ti = /*#__PURE__*/ B("<section class=\"flex min-w-0 flex-col gap-2\"><header class=\"flex items-center gap-3\"><div class=\"flex min-w-0 flex-1 flex-col\"></div></header><div class=\"flex flex-col gap-2\">"), Ei = /*#__PURE__*/ B("<div class=\"flex flex-col\">"), Di = /*#__PURE__*/ B("<pre class=\"text-muted-foreground max-h-96 overflow-auto p-3 font-mono text-xs leading-relaxed whitespace-pre-wrap\">");
|
|
1720
|
+
function Oi(e, t, n) {
|
|
1692
1721
|
return {
|
|
1693
1722
|
widgetConfig: e,
|
|
1694
1723
|
entities: t.map((e) => ({
|
|
@@ -1705,17 +1734,17 @@ function wi(e, t, n) {
|
|
|
1705
1734
|
...n
|
|
1706
1735
|
};
|
|
1707
1736
|
}
|
|
1708
|
-
var
|
|
1737
|
+
var ki = (e) => JSON.stringify(e, null, 2), Ai = {
|
|
1709
1738
|
idle: "lucide:copy",
|
|
1710
1739
|
copied: "lucide:check",
|
|
1711
1740
|
failed: "lucide:triangle-alert"
|
|
1712
|
-
},
|
|
1741
|
+
}, ji = {
|
|
1713
1742
|
idle: "text-muted-foreground",
|
|
1714
1743
|
copied: "text-success",
|
|
1715
1744
|
failed: "text-destructive"
|
|
1716
1745
|
};
|
|
1717
|
-
function
|
|
1718
|
-
let { state: t, copy: n } =
|
|
1746
|
+
function Mi(e) {
|
|
1747
|
+
let { state: t, copy: n } = Er();
|
|
1719
1748
|
return N(Ee, {
|
|
1720
1749
|
variant: "ghost",
|
|
1721
1750
|
size: "icon",
|
|
@@ -1727,42 +1756,42 @@ function Oi(e) {
|
|
|
1727
1756
|
get children() {
|
|
1728
1757
|
return N(U, {
|
|
1729
1758
|
get icon() {
|
|
1730
|
-
return
|
|
1759
|
+
return Ai[t()];
|
|
1731
1760
|
},
|
|
1732
1761
|
width: 16,
|
|
1733
1762
|
height: 16,
|
|
1734
1763
|
get class() {
|
|
1735
|
-
return
|
|
1764
|
+
return ji[t()];
|
|
1736
1765
|
}
|
|
1737
1766
|
});
|
|
1738
1767
|
}
|
|
1739
1768
|
});
|
|
1740
1769
|
}
|
|
1741
|
-
function
|
|
1770
|
+
function Ni(e) {
|
|
1742
1771
|
let t = e.replace(/([a-z\d])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ");
|
|
1743
1772
|
return t.charAt(0).toUpperCase() + t.slice(1).toLowerCase();
|
|
1744
1773
|
}
|
|
1745
|
-
var
|
|
1746
|
-
function
|
|
1774
|
+
var Pi = (e) => e === null || typeof e != "object" && typeof e != "function";
|
|
1775
|
+
function Fi(e) {
|
|
1747
1776
|
return e == null ? "None" : String(e);
|
|
1748
1777
|
}
|
|
1749
|
-
function
|
|
1778
|
+
function Ii(e) {
|
|
1750
1779
|
return Array.isArray(e) ? e.length : typeof e == "object" && e ? Object.keys(e).length : 0;
|
|
1751
1780
|
}
|
|
1752
|
-
function
|
|
1781
|
+
function Li(e) {
|
|
1753
1782
|
let t = new Date(e);
|
|
1754
1783
|
return Number.isNaN(t.getTime()) ? e : t.toLocaleString();
|
|
1755
1784
|
}
|
|
1756
|
-
function
|
|
1757
|
-
return N(
|
|
1785
|
+
function Ri(e) {
|
|
1786
|
+
return N(mt, {
|
|
1758
1787
|
class: "overflow-hidden p-0",
|
|
1759
1788
|
get children() {
|
|
1760
|
-
var t =
|
|
1761
|
-
return F(t, () =>
|
|
1789
|
+
var t = Ci();
|
|
1790
|
+
return F(t, () => ki(e.value)), t;
|
|
1762
1791
|
}
|
|
1763
1792
|
});
|
|
1764
1793
|
}
|
|
1765
|
-
function
|
|
1794
|
+
function zi(e) {
|
|
1766
1795
|
return N(ye, {
|
|
1767
1796
|
collapsible: !0,
|
|
1768
1797
|
class: "border-border/50 border-t",
|
|
@@ -1775,7 +1804,7 @@ function Fi(e) {
|
|
|
1775
1804
|
return [N(Se, {
|
|
1776
1805
|
class: "text-muted-foreground py-3 text-xs",
|
|
1777
1806
|
get children() {
|
|
1778
|
-
var t =
|
|
1807
|
+
var t = wi();
|
|
1779
1808
|
return F(t, () => e.label, null), F(t, N(w, {
|
|
1780
1809
|
get when() {
|
|
1781
1810
|
return e.count !== void 0;
|
|
@@ -1788,7 +1817,7 @@ function Fi(e) {
|
|
|
1788
1817
|
}), null), t;
|
|
1789
1818
|
}
|
|
1790
1819
|
}), N(be, { get children() {
|
|
1791
|
-
return N(
|
|
1820
|
+
return N(Ri, { get value() {
|
|
1792
1821
|
return e.value;
|
|
1793
1822
|
} });
|
|
1794
1823
|
} })];
|
|
@@ -1797,10 +1826,10 @@ function Fi(e) {
|
|
|
1797
1826
|
}
|
|
1798
1827
|
});
|
|
1799
1828
|
}
|
|
1800
|
-
function
|
|
1829
|
+
function Bi(e) {
|
|
1801
1830
|
return (() => {
|
|
1802
|
-
var t =
|
|
1803
|
-
return F(n, N(
|
|
1831
|
+
var t = Ti(), n = t.firstChild, r = n.firstChild, i = n.nextSibling;
|
|
1832
|
+
return F(n, N(ft, {
|
|
1804
1833
|
get icon() {
|
|
1805
1834
|
return e.icon;
|
|
1806
1835
|
},
|
|
@@ -1814,28 +1843,28 @@ function Ii(e) {
|
|
|
1814
1843
|
get when() {
|
|
1815
1844
|
return e.subtitle;
|
|
1816
1845
|
},
|
|
1817
|
-
children: (e) => N(
|
|
1846
|
+
children: (e) => N(pt, {
|
|
1818
1847
|
class: "truncate font-mono",
|
|
1819
1848
|
get children() {
|
|
1820
1849
|
return e();
|
|
1821
1850
|
}
|
|
1822
1851
|
})
|
|
1823
|
-
}), null), F(n, () => e.badge, null), F(n, N(
|
|
1852
|
+
}), null), F(n, () => e.badge, null), F(n, N(Mi, {
|
|
1824
1853
|
get label() {
|
|
1825
1854
|
return `Copy ${e.title}`;
|
|
1826
1855
|
},
|
|
1827
|
-
text: () =>
|
|
1856
|
+
text: () => ki(e.source)
|
|
1828
1857
|
}), null), F(i, () => e.children), t;
|
|
1829
1858
|
})();
|
|
1830
1859
|
}
|
|
1831
|
-
function
|
|
1832
|
-
let t = D(() => Object.entries(e.record)), n = D(() => t().flatMap(([e, t]) =>
|
|
1860
|
+
function Vi(e) {
|
|
1861
|
+
let t = D(() => Object.entries(e.record)), n = D(() => t().flatMap(([e, t]) => Pi(t) ? [[e, t]] : [])), r = D(() => t().filter(([, e]) => !Pi(e)));
|
|
1833
1862
|
return N(w, {
|
|
1834
1863
|
get when() {
|
|
1835
1864
|
return t().length > 0;
|
|
1836
1865
|
},
|
|
1837
1866
|
get fallback() {
|
|
1838
|
-
return N(
|
|
1867
|
+
return N(pt, { children: "Nothing set" });
|
|
1839
1868
|
},
|
|
1840
1869
|
get children() {
|
|
1841
1870
|
return [N(w, {
|
|
@@ -1843,17 +1872,17 @@ function Li(e) {
|
|
|
1843
1872
|
return n().length > 0;
|
|
1844
1873
|
},
|
|
1845
1874
|
get children() {
|
|
1846
|
-
var e =
|
|
1875
|
+
var e = Ei();
|
|
1847
1876
|
return F(e, N(C, {
|
|
1848
1877
|
get each() {
|
|
1849
1878
|
return n();
|
|
1850
1879
|
},
|
|
1851
1880
|
children: ([e, t]) => N(H, {
|
|
1852
1881
|
get label() {
|
|
1853
|
-
return
|
|
1882
|
+
return Ni(e);
|
|
1854
1883
|
},
|
|
1855
1884
|
get children() {
|
|
1856
|
-
return
|
|
1885
|
+
return Fi(t);
|
|
1857
1886
|
}
|
|
1858
1887
|
})
|
|
1859
1888
|
})), e;
|
|
@@ -1862,12 +1891,12 @@ function Li(e) {
|
|
|
1862
1891
|
get each() {
|
|
1863
1892
|
return r();
|
|
1864
1893
|
},
|
|
1865
|
-
children: ([e, t]) => N(
|
|
1894
|
+
children: ([e, t]) => N(zi, {
|
|
1866
1895
|
get label() {
|
|
1867
|
-
return
|
|
1896
|
+
return Ni(e);
|
|
1868
1897
|
},
|
|
1869
1898
|
get count() {
|
|
1870
|
-
return
|
|
1899
|
+
return Ii(t);
|
|
1871
1900
|
},
|
|
1872
1901
|
value: t
|
|
1873
1902
|
})
|
|
@@ -1875,9 +1904,9 @@ function Li(e) {
|
|
|
1875
1904
|
}
|
|
1876
1905
|
});
|
|
1877
1906
|
}
|
|
1878
|
-
function
|
|
1907
|
+
function Hi(e) {
|
|
1879
1908
|
let t = () => e.entity.attributes ?? {};
|
|
1880
|
-
return N(
|
|
1909
|
+
return N(Bi, {
|
|
1881
1910
|
icon: "lucide:activity",
|
|
1882
1911
|
get title() {
|
|
1883
1912
|
return e.entity.friendly_name ?? e.entity.entity_id;
|
|
@@ -1895,7 +1924,7 @@ function Ri(e) {
|
|
|
1895
1924
|
},
|
|
1896
1925
|
get children() {
|
|
1897
1926
|
return [(() => {
|
|
1898
|
-
var t =
|
|
1927
|
+
var t = Ei();
|
|
1899
1928
|
return F(t, N(H, {
|
|
1900
1929
|
label: "Domain",
|
|
1901
1930
|
get children() {
|
|
@@ -1924,23 +1953,23 @@ function Ri(e) {
|
|
|
1924
1953
|
}), null), F(t, N(H, {
|
|
1925
1954
|
label: "Changed",
|
|
1926
1955
|
get children() {
|
|
1927
|
-
return
|
|
1956
|
+
return Li(e.entity.last_changed);
|
|
1928
1957
|
}
|
|
1929
1958
|
}), null), F(t, N(H, {
|
|
1930
1959
|
label: "Updated",
|
|
1931
1960
|
get children() {
|
|
1932
|
-
return
|
|
1961
|
+
return Li(e.entity.last_updated);
|
|
1933
1962
|
}
|
|
1934
1963
|
}), null), t;
|
|
1935
1964
|
})(), N(w, {
|
|
1936
1965
|
get when() {
|
|
1937
|
-
return
|
|
1966
|
+
return Ii(t()) > 0;
|
|
1938
1967
|
},
|
|
1939
1968
|
get children() {
|
|
1940
|
-
return N(
|
|
1969
|
+
return N(zi, {
|
|
1941
1970
|
label: "Attributes",
|
|
1942
1971
|
get count() {
|
|
1943
|
-
return
|
|
1972
|
+
return Ii(t());
|
|
1944
1973
|
},
|
|
1945
1974
|
get value() {
|
|
1946
1975
|
return t();
|
|
@@ -1951,18 +1980,18 @@ function Ri(e) {
|
|
|
1951
1980
|
}
|
|
1952
1981
|
});
|
|
1953
1982
|
}
|
|
1954
|
-
function
|
|
1983
|
+
function Ui(e) {
|
|
1955
1984
|
let t = D(() => Object.keys(e.data).filter((e) => e !== "widgetConfig" && e !== "entities"));
|
|
1956
1985
|
return N(We, { get children() {
|
|
1957
1986
|
return [
|
|
1958
|
-
N(
|
|
1987
|
+
N(Bi, {
|
|
1959
1988
|
icon: "lucide:sliders-horizontal",
|
|
1960
1989
|
title: "Configuration",
|
|
1961
1990
|
get source() {
|
|
1962
1991
|
return e.data.widgetConfig;
|
|
1963
1992
|
},
|
|
1964
1993
|
get children() {
|
|
1965
|
-
return N(
|
|
1994
|
+
return N(Vi, { get record() {
|
|
1966
1995
|
return e.data.widgetConfig;
|
|
1967
1996
|
} });
|
|
1968
1997
|
}
|
|
@@ -1971,22 +2000,22 @@ function zi(e) {
|
|
|
1971
2000
|
get each() {
|
|
1972
2001
|
return e.data.entities;
|
|
1973
2002
|
},
|
|
1974
|
-
children: (e) => N(
|
|
2003
|
+
children: (e) => N(Hi, { entity: e })
|
|
1975
2004
|
}),
|
|
1976
2005
|
N(C, {
|
|
1977
2006
|
get each() {
|
|
1978
2007
|
return t();
|
|
1979
2008
|
},
|
|
1980
|
-
children: (t) => N(
|
|
2009
|
+
children: (t) => N(Bi, {
|
|
1981
2010
|
icon: "lucide:braces",
|
|
1982
2011
|
get title() {
|
|
1983
|
-
return
|
|
2012
|
+
return Ni(t);
|
|
1984
2013
|
},
|
|
1985
2014
|
get source() {
|
|
1986
2015
|
return e.data[t];
|
|
1987
2016
|
},
|
|
1988
2017
|
get children() {
|
|
1989
|
-
return N(
|
|
2018
|
+
return N(Ri, { get value() {
|
|
1990
2019
|
return e.data[t];
|
|
1991
2020
|
} });
|
|
1992
2021
|
}
|
|
@@ -1995,13 +2024,13 @@ function zi(e) {
|
|
|
1995
2024
|
];
|
|
1996
2025
|
} });
|
|
1997
2026
|
}
|
|
1998
|
-
function
|
|
2027
|
+
function Wi(e) {
|
|
1999
2028
|
if (typeof e != "object" || !e) return;
|
|
2000
2029
|
let t = e;
|
|
2001
2030
|
return Array.isArray(t.entities) && typeof t.widgetConfig == "object" ? t : void 0;
|
|
2002
2031
|
}
|
|
2003
|
-
function
|
|
2004
|
-
let t = D(() =>
|
|
2032
|
+
function Gi(e) {
|
|
2033
|
+
let t = D(() => Wi(e.data));
|
|
2005
2034
|
return N(w, {
|
|
2006
2035
|
get when() {
|
|
2007
2036
|
return e.data !== void 0;
|
|
@@ -2019,7 +2048,7 @@ function Vi(e) {
|
|
|
2019
2048
|
return t();
|
|
2020
2049
|
},
|
|
2021
2050
|
get fallback() {
|
|
2022
|
-
return N(
|
|
2051
|
+
return N(Bi, {
|
|
2023
2052
|
icon: "lucide:braces",
|
|
2024
2053
|
title: "Debug data",
|
|
2025
2054
|
get source() {
|
|
@@ -2031,15 +2060,15 @@ function Vi(e) {
|
|
|
2031
2060
|
return typeof e.data == "string";
|
|
2032
2061
|
},
|
|
2033
2062
|
get fallback() {
|
|
2034
|
-
return N(
|
|
2063
|
+
return N(Ri, { get value() {
|
|
2035
2064
|
return e.data;
|
|
2036
2065
|
} });
|
|
2037
2066
|
},
|
|
2038
2067
|
get children() {
|
|
2039
|
-
return N(
|
|
2068
|
+
return N(mt, {
|
|
2040
2069
|
class: "overflow-hidden p-0",
|
|
2041
2070
|
get children() {
|
|
2042
|
-
var t =
|
|
2071
|
+
var t = Di();
|
|
2043
2072
|
return F(t, () => e.data), t;
|
|
2044
2073
|
}
|
|
2045
2074
|
});
|
|
@@ -2048,7 +2077,7 @@ function Vi(e) {
|
|
|
2048
2077
|
}
|
|
2049
2078
|
});
|
|
2050
2079
|
},
|
|
2051
|
-
children: (e) => N(
|
|
2080
|
+
children: (e) => N(Ui, { get data() {
|
|
2052
2081
|
return e();
|
|
2053
2082
|
} })
|
|
2054
2083
|
});
|
|
@@ -2057,21 +2086,21 @@ function Vi(e) {
|
|
|
2057
2086
|
}
|
|
2058
2087
|
//#endregion
|
|
2059
2088
|
//#region src/framework/dialogs/validate-config.ts
|
|
2060
|
-
function
|
|
2089
|
+
function Ki(e) {
|
|
2061
2090
|
let t = "";
|
|
2062
2091
|
for (let n of e) t += typeof n == "number" ? `[${n}]` : t ? `.${String(n)}` : String(n);
|
|
2063
2092
|
return t;
|
|
2064
2093
|
}
|
|
2065
|
-
function
|
|
2094
|
+
function qi(e, t) {
|
|
2066
2095
|
let n = e.safeParse(t);
|
|
2067
2096
|
return n.success ? null : n.error.issues.map((e) => {
|
|
2068
|
-
let t =
|
|
2097
|
+
let t = Ki(e.path);
|
|
2069
2098
|
return t ? `${t}: ${e.message}` : e.message;
|
|
2070
2099
|
});
|
|
2071
2100
|
}
|
|
2072
2101
|
//#endregion
|
|
2073
2102
|
//#region src/framework/dialogs/WidgetDialog.tsx
|
|
2074
|
-
var
|
|
2103
|
+
var Ji = /*#__PURE__*/ B("<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\">"), Yi = /*#__PURE__*/ B("<div class=\"bg-muted/30 rounded-lg p-2 text-center md:p-6\"><p class=\"text-muted-foreground text-sm\">No edit options available"), Xi = /*#__PURE__*/ B("<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>"), Zi = /*#__PURE__*/ B("<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\">"), Qi = /*#__PURE__*/ B("<div class=glasshome-sheet>"), $i = /*#__PURE__*/ B("<div class=glasshome-sheet-band aria-hidden=true><img alt>"), ea = /*#__PURE__*/ B("<span class=\"glasshome-widget-icon glass glass-tint glasshome-sheet-icon\">"), ta = /*#__PURE__*/ B("<span class=\"inline-flex size-3.5 shrink-0 items-center\">"), na = (e) => Jt(e), ra = {
|
|
2075
2104
|
sm: "sm",
|
|
2076
2105
|
md: "md",
|
|
2077
2106
|
lg: "lg",
|
|
@@ -2080,33 +2109,33 @@ var Wi = /*#__PURE__*/ B("<svg xmlns=http://www.w3.org/2000/svg class=size-3.5 f
|
|
|
2080
2109
|
"2xl": "xl",
|
|
2081
2110
|
"3xl": "xl",
|
|
2082
2111
|
"4xl": "full"
|
|
2083
|
-
},
|
|
2112
|
+
}, ia = {
|
|
2084
2113
|
idle: "Copy all",
|
|
2085
2114
|
copied: "Copied",
|
|
2086
2115
|
failed: "Copy failed"
|
|
2087
2116
|
};
|
|
2088
|
-
function
|
|
2117
|
+
function aa(e) {
|
|
2089
2118
|
let [t] = _e(e, /* @__PURE__ */ "open.onOpenChange.title.description.onSave.hasUnsavedChanges.onDelete.editContent.controlsContent.sheet.tile.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] = O({}), [a, o] = O(null), [s, c] = O([]);
|
|
2090
2119
|
E(he(() => t.config, (e) => {
|
|
2091
2120
|
e && i({ ...e });
|
|
2092
2121
|
})), E(he(() => t.configSchema, (e) => {
|
|
2093
|
-
e && o(
|
|
2122
|
+
e && o(na(e));
|
|
2094
2123
|
}));
|
|
2095
2124
|
let l = () => n() && JSON.stringify(r()) !== JSON.stringify(t.config), u = (e) => {
|
|
2096
2125
|
!e && t.config && (i({ ...t.config }), c([])), t.onOpenChange(e);
|
|
2097
2126
|
}, d = () => {
|
|
2098
2127
|
let e = t.configSchema;
|
|
2099
2128
|
if (e) {
|
|
2100
|
-
let t =
|
|
2129
|
+
let t = qi(e, r());
|
|
2101
2130
|
if (t) {
|
|
2102
2131
|
c(t);
|
|
2103
2132
|
return;
|
|
2104
2133
|
}
|
|
2105
2134
|
}
|
|
2106
2135
|
c([]), t.onConfigSave?.(r());
|
|
2107
|
-
}, [f, p] = O(t.defaultTab ?? "controls"), m = () => t.activeTab ?? f(),
|
|
2136
|
+
}, [f, p] = O(t.defaultTab ?? "controls"), m = () => t.activeTab ?? f(), ee = (e) => {
|
|
2108
2137
|
t.onActiveTabChange ? t.onActiveTabChange(e) : p(e);
|
|
2109
|
-
},
|
|
2138
|
+
}, h = () => ra[t.maxWidth ?? "xl"], g = () => {
|
|
2110
2139
|
if (t.tabs) return t.tabs.map((e) => ({
|
|
2111
2140
|
...e,
|
|
2112
2141
|
icon: () => e.icon,
|
|
@@ -2116,10 +2145,10 @@ function ta(e) {
|
|
|
2116
2145
|
return e.push({
|
|
2117
2146
|
id: "edit",
|
|
2118
2147
|
label: "Edit",
|
|
2119
|
-
icon: () =>
|
|
2148
|
+
icon: () => Ji(),
|
|
2120
2149
|
content: () => t.editContent ?? (() => {
|
|
2121
2150
|
let e = t.SchemaForm, o = n() ? a() : void 0;
|
|
2122
|
-
return !o || !e ?
|
|
2151
|
+
return !o || !e ? Yi() : N(e, {
|
|
2123
2152
|
schema: o,
|
|
2124
2153
|
get data() {
|
|
2125
2154
|
return r();
|
|
@@ -2133,7 +2162,7 @@ function ta(e) {
|
|
|
2133
2162
|
}), e.push({
|
|
2134
2163
|
id: "controls",
|
|
2135
2164
|
label: "Controls",
|
|
2136
|
-
icon: () =>
|
|
2165
|
+
icon: () => Xi(),
|
|
2137
2166
|
content: () => t.controlsContent ?? N(Be, { get children() {
|
|
2138
2167
|
return N(He, { get children() {
|
|
2139
2168
|
return [N(Ue, { children: "No controls" }), N(Ve, { children: "This widget is shown as is." })];
|
|
@@ -2142,27 +2171,27 @@ function ta(e) {
|
|
|
2142
2171
|
}), e.push({
|
|
2143
2172
|
id: "debug",
|
|
2144
2173
|
label: "Debug",
|
|
2145
|
-
icon: () =>
|
|
2146
|
-
content: () => t.debugContent ?? N(
|
|
2174
|
+
icon: () => Zi(),
|
|
2175
|
+
content: () => t.debugContent ?? N(Gi, { get data() {
|
|
2147
2176
|
return t.debugData;
|
|
2148
2177
|
} })
|
|
2149
2178
|
}), e;
|
|
2150
|
-
},
|
|
2151
|
-
E(() =>
|
|
2152
|
-
let
|
|
2153
|
-
icon: t.tile?.icon ??
|
|
2154
|
-
tone: t.tile?.tone ??
|
|
2179
|
+
}, _ = A(W), v = cn(_);
|
|
2180
|
+
E(() => v?.setHasSheet(t.sheet !== void 0)), k(() => v?.setHasSheet(!1));
|
|
2181
|
+
let y = () => ({
|
|
2182
|
+
icon: t.tile?.icon ?? v?.icon(),
|
|
2183
|
+
tone: t.tile?.tone ?? v?.accent() ?? v?.tone(),
|
|
2155
2184
|
backdrop: t.tile?.backdrop
|
|
2156
|
-
}),
|
|
2185
|
+
}), b = () => _?.developer?.() ?? !1, x = () => V() === "controls" && t.sheet !== void 0, S = oa(), te = () => _?.anchor?.(), ne = () => x() && !S() && te() !== void 0, re = Er(), ie = () => {
|
|
2157
2186
|
if (t.debugData === void 0) return;
|
|
2158
2187
|
let e = typeof t.debugData == "string" ? t.debugData : JSON.stringify(t.debugData, null, 2);
|
|
2159
2188
|
re.copy(e);
|
|
2160
|
-
}, ae = t.ResponsiveDialog, oe = t.ResponsiveDialogContent, se = t.ResponsiveDialogHeader, ce = t.ResponsiveDialogTitle, le = t.ResponsiveDialogDescription, ue = t.ResponsiveDialogBody ??
|
|
2189
|
+
}, ae = t.ResponsiveDialog, oe = t.ResponsiveDialogContent, se = t.ResponsiveDialogHeader, ce = t.ResponsiveDialogTitle, le = t.ResponsiveDialogDescription, ue = t.ResponsiveDialogBody ?? nt, de = t.ResponsiveDialogFooter ?? st, fe = t.Tabs ?? Tt, pe = t.TabsList ?? kt, T = t.TabsTrigger ?? jt, me = t.TabsContent ?? Dt, ge = t.Button, j = D(he([
|
|
2161
2190
|
() => t.open,
|
|
2162
2191
|
a,
|
|
2163
2192
|
() => t.config,
|
|
2164
2193
|
() => t.tabs
|
|
2165
|
-
], () =>
|
|
2194
|
+
], () => g())), M = (e) => n() ? u(e) : t.onOpenChange(e), ve = () => n() ? l() : t.hasUnsavedChanges, R = () => n() ? d : t.onSave, z = () => j().filter((e) => e.id !== "debug" || b()), B = () => z().filter((e) => e.id !== "controls" || t.sheet === void 0), V = () => {
|
|
2166
2195
|
let e = z(), n = m() === "controls" && t.sheet === void 0 && !("controlsContent" in t) && !t.tabs ? "edit" : m();
|
|
2167
2196
|
return e.some((e) => e.id === n) ? n : e[0]?.id ?? n;
|
|
2168
2197
|
}, ye = () => V() === "edit" && (R() || t.onDelete) || V() === "debug" && t.debugData !== void 0;
|
|
@@ -2174,7 +2203,7 @@ function ta(e) {
|
|
|
2174
2203
|
get children() {
|
|
2175
2204
|
return N(w, {
|
|
2176
2205
|
get when() {
|
|
2177
|
-
return !
|
|
2206
|
+
return !x();
|
|
2178
2207
|
},
|
|
2179
2208
|
get fallback() {
|
|
2180
2209
|
return N(oe, {
|
|
@@ -2187,19 +2216,19 @@ function ta(e) {
|
|
|
2187
2216
|
},
|
|
2188
2217
|
class: "glasshome-sheet-surface",
|
|
2189
2218
|
get style() {
|
|
2190
|
-
return I(() => !!
|
|
2191
|
-
"--glass-tone":
|
|
2192
|
-
"--widget-color":
|
|
2219
|
+
return I(() => !!y().tone)() ? {
|
|
2220
|
+
"--glass-tone": y().tone,
|
|
2221
|
+
"--widget-color": y().tone
|
|
2193
2222
|
} : void 0;
|
|
2194
2223
|
},
|
|
2195
2224
|
get children() {
|
|
2196
2225
|
return [
|
|
2197
2226
|
N(w, {
|
|
2198
2227
|
get when() {
|
|
2199
|
-
return
|
|
2228
|
+
return y().backdrop;
|
|
2200
2229
|
},
|
|
2201
2230
|
children: (e) => (() => {
|
|
2202
|
-
var t =
|
|
2231
|
+
var t = $i(), n = t.firstChild;
|
|
2203
2232
|
return P(() => L(n, "src", e())), t;
|
|
2204
2233
|
})()
|
|
2205
2234
|
}),
|
|
@@ -2208,10 +2237,10 @@ function ta(e) {
|
|
|
2208
2237
|
get media() {
|
|
2209
2238
|
return N(w, {
|
|
2210
2239
|
get when() {
|
|
2211
|
-
return
|
|
2240
|
+
return y().icon;
|
|
2212
2241
|
},
|
|
2213
2242
|
children: (e) => (() => {
|
|
2214
|
-
var t =
|
|
2243
|
+
var t = ea();
|
|
2215
2244
|
return F(t, N(U, {
|
|
2216
2245
|
get icon() {
|
|
2217
2246
|
return e();
|
|
@@ -2231,7 +2260,7 @@ function ta(e) {
|
|
|
2231
2260
|
}
|
|
2232
2261
|
}),
|
|
2233
2262
|
N(ue, { get children() {
|
|
2234
|
-
var e =
|
|
2263
|
+
var e = Qi();
|
|
2235
2264
|
return F(e, () => t.sheet?.()), e;
|
|
2236
2265
|
} })
|
|
2237
2266
|
];
|
|
@@ -2241,7 +2270,7 @@ function ta(e) {
|
|
|
2241
2270
|
get children() {
|
|
2242
2271
|
return N(oe, {
|
|
2243
2272
|
get size() {
|
|
2244
|
-
return
|
|
2273
|
+
return h();
|
|
2245
2274
|
},
|
|
2246
2275
|
get class() {
|
|
2247
2276
|
return t.class;
|
|
@@ -2251,7 +2280,7 @@ function ta(e) {
|
|
|
2251
2280
|
get value() {
|
|
2252
2281
|
return V();
|
|
2253
2282
|
},
|
|
2254
|
-
onChange:
|
|
2283
|
+
onChange: ee,
|
|
2255
2284
|
layout: "split",
|
|
2256
2285
|
get children() {
|
|
2257
2286
|
return [
|
|
@@ -2260,7 +2289,7 @@ function ta(e) {
|
|
|
2260
2289
|
get action() {
|
|
2261
2290
|
return [N(w, {
|
|
2262
2291
|
get when() {
|
|
2263
|
-
return
|
|
2292
|
+
return b() || t.tabs !== void 0;
|
|
2264
2293
|
},
|
|
2265
2294
|
get children() {
|
|
2266
2295
|
return N(pe, {
|
|
@@ -2276,7 +2305,7 @@ function ta(e) {
|
|
|
2276
2305
|
},
|
|
2277
2306
|
get children() {
|
|
2278
2307
|
return [(() => {
|
|
2279
|
-
var t =
|
|
2308
|
+
var t = ta();
|
|
2280
2309
|
return F(t, () => e.icon()), t;
|
|
2281
2310
|
})(), I(() => e.label)];
|
|
2282
2311
|
}
|
|
@@ -2365,7 +2394,7 @@ function ta(e) {
|
|
|
2365
2394
|
variant: "outline",
|
|
2366
2395
|
onClick: ie,
|
|
2367
2396
|
get children() {
|
|
2368
|
-
return
|
|
2397
|
+
return ia[re.state()];
|
|
2369
2398
|
}
|
|
2370
2399
|
});
|
|
2371
2400
|
}
|
|
@@ -2384,7 +2413,7 @@ function ta(e) {
|
|
|
2384
2413
|
}
|
|
2385
2414
|
});
|
|
2386
2415
|
}
|
|
2387
|
-
function
|
|
2416
|
+
function oa() {
|
|
2388
2417
|
let e = "(max-width: 639px)", [t, n] = O(typeof window < "u" && window.matchMedia(e).matches);
|
|
2389
2418
|
return ge(() => {
|
|
2390
2419
|
let t = window.matchMedia(e), r = () => n(t.matches);
|
|
@@ -2393,25 +2422,25 @@ function na() {
|
|
|
2393
2422
|
}
|
|
2394
2423
|
//#endregion
|
|
2395
2424
|
//#region src/framework/hooks/use-widget-dashboard.ts
|
|
2396
|
-
var
|
|
2425
|
+
var sa = {
|
|
2397
2426
|
name: "",
|
|
2398
2427
|
icon: "",
|
|
2399
2428
|
areaId: null
|
|
2400
2429
|
};
|
|
2401
|
-
function
|
|
2430
|
+
function ca() {
|
|
2402
2431
|
let e = A(W);
|
|
2403
|
-
return () => e?.dashboard?.() ??
|
|
2432
|
+
return () => e?.dashboard?.() ?? sa;
|
|
2404
2433
|
}
|
|
2405
2434
|
//#endregion
|
|
2406
2435
|
//#region src/framework/hooks/use-widget-viewer.ts
|
|
2407
|
-
var
|
|
2408
|
-
function
|
|
2436
|
+
var la = { name: null };
|
|
2437
|
+
function ua() {
|
|
2409
2438
|
let e = A(W);
|
|
2410
|
-
return () => e?.viewer?.() ??
|
|
2439
|
+
return () => e?.viewer?.() ?? la;
|
|
2411
2440
|
}
|
|
2412
2441
|
//#endregion
|
|
2413
2442
|
//#region src/framework/hooks/use-intersection-pause.ts
|
|
2414
|
-
function
|
|
2443
|
+
function da(e) {
|
|
2415
2444
|
if (typeof IntersectionObserver > "u") return () => !1;
|
|
2416
2445
|
let [t, n] = O(!1), r = new IntersectionObserver((e) => {
|
|
2417
2446
|
let t = e[0];
|
|
@@ -2424,40 +2453,40 @@ function sa(e) {
|
|
|
2424
2453
|
}
|
|
2425
2454
|
//#endregion
|
|
2426
2455
|
//#region src/framework/hooks/use-daylight.ts
|
|
2427
|
-
var
|
|
2428
|
-
function
|
|
2456
|
+
var fa = -6, pa = 864e5;
|
|
2457
|
+
function ma(e, t) {
|
|
2429
2458
|
let n = e.next_rising ? Date.parse(e.next_rising) : NaN, r = e.next_setting ? Date.parse(e.next_setting) : NaN;
|
|
2430
2459
|
if (!Number.isFinite(n) || !Number.isFinite(r)) return;
|
|
2431
|
-
let [i, a] = e.state === "above_horizon" ? [n -
|
|
2460
|
+
let [i, a] = e.state === "above_horizon" ? [n - pa, r] : [r - pa, n], o = a - i;
|
|
2432
2461
|
if (!(o <= 0)) return Math.min(1, Math.max(0, (t.getTime() - i) / o));
|
|
2433
2462
|
}
|
|
2434
|
-
var
|
|
2435
|
-
function
|
|
2463
|
+
var ha = 20, ga = 7;
|
|
2464
|
+
function _a(e, t) {
|
|
2436
2465
|
if (e && (e.state === "above_horizon" || e.state === "below_horizon")) {
|
|
2437
|
-
let n = e.elevation, r = e.state === "above_horizon" ? "day" : n !== void 0 && n >
|
|
2466
|
+
let n = e.elevation, r = e.state === "above_horizon" ? "day" : n !== void 0 && n > fa ? e.rising ? "dawn" : "dusk" : "night";
|
|
2438
2467
|
return {
|
|
2439
2468
|
phase: r,
|
|
2440
2469
|
isNight: r === "night",
|
|
2441
2470
|
elevation: n,
|
|
2442
|
-
progress:
|
|
2471
|
+
progress: ma(e, t)
|
|
2443
2472
|
};
|
|
2444
2473
|
}
|
|
2445
|
-
let n = t.getHours(), r = n >=
|
|
2474
|
+
let n = t.getHours(), r = n >= ha || n < ga ? "night" : "day";
|
|
2446
2475
|
return {
|
|
2447
2476
|
phase: r,
|
|
2448
2477
|
isNight: r === "night"
|
|
2449
2478
|
};
|
|
2450
2479
|
}
|
|
2451
|
-
var [
|
|
2452
|
-
function
|
|
2453
|
-
return
|
|
2454
|
-
|
|
2480
|
+
var [va, ya] = O(/* @__PURE__ */ new Date()), ba = 0, xa;
|
|
2481
|
+
function Sa() {
|
|
2482
|
+
return ba++, xa ||= (ya(/* @__PURE__ */ new Date()), setInterval(() => ya(/* @__PURE__ */ new Date()), 6e4)), () => {
|
|
2483
|
+
ba--, ba === 0 && xa && (clearInterval(xa), xa = void 0);
|
|
2455
2484
|
};
|
|
2456
2485
|
}
|
|
2457
|
-
function
|
|
2486
|
+
function Ca() {
|
|
2458
2487
|
let e = te("sun.sun");
|
|
2459
2488
|
return E(() => {
|
|
2460
|
-
e() || k(
|
|
2489
|
+
e() || k(Sa());
|
|
2461
2490
|
}), D(() => {
|
|
2462
2491
|
let t = e(), n = t ? {
|
|
2463
2492
|
state: t.state,
|
|
@@ -2466,26 +2495,26 @@ function ya() {
|
|
|
2466
2495
|
next_rising: t.attributes?.next_rising,
|
|
2467
2496
|
next_setting: t.attributes?.next_setting
|
|
2468
2497
|
} : void 0;
|
|
2469
|
-
return
|
|
2498
|
+
return _a(n, n ? /* @__PURE__ */ new Date() : va());
|
|
2470
2499
|
});
|
|
2471
2500
|
}
|
|
2472
2501
|
//#endregion
|
|
2473
2502
|
//#region src/framework/hooks/use-reduced-motion.ts
|
|
2474
|
-
function
|
|
2503
|
+
function wa() {
|
|
2475
2504
|
if (typeof window > "u" || typeof window.matchMedia != "function") return () => !1;
|
|
2476
2505
|
let e = window.matchMedia("(prefers-reduced-motion: reduce)"), [t, n] = O(e.matches), r = (e) => n(e.matches);
|
|
2477
2506
|
return e.addEventListener("change", r), k(() => e.removeEventListener("change", r)), t;
|
|
2478
2507
|
}
|
|
2479
2508
|
//#endregion
|
|
2480
2509
|
//#region src/framework/hooks/use-widget-entity-group.ts
|
|
2481
|
-
function
|
|
2510
|
+
function Ta(e) {
|
|
2482
2511
|
let t = e.minEntities ?? 1, n = D(() => e.entities().length), r = D(() => n() >= t), i = D(() => !r() || !e.calculateGroupData ? null : e.calculateGroupData(e.entities())), a = D(() => {
|
|
2483
2512
|
if (!r()) return;
|
|
2484
2513
|
let t = e.aggregationMode?.();
|
|
2485
2514
|
if (!t || t === "none") return;
|
|
2486
2515
|
let n = e.entities();
|
|
2487
|
-
if (t === "light" || t === "binary-sensor" || t === "switch") return
|
|
2488
|
-
if (t === "sensor") return
|
|
2516
|
+
if (t === "light" || t === "binary-sensor" || t === "switch") return Dr(n, e.allEntitiesMode);
|
|
2517
|
+
if (t === "sensor") return Or(n, e.sensorGroupType?.() ?? "mean", !0);
|
|
2489
2518
|
}), o = D(() => r() ? void 0 : e.emptyStateConfig);
|
|
2490
2519
|
return {
|
|
2491
2520
|
entities: e.entities,
|
|
@@ -2498,7 +2527,7 @@ function xa(e) {
|
|
|
2498
2527
|
}
|
|
2499
2528
|
//#endregion
|
|
2500
2529
|
//#region src/framework/theming/svg-colors.ts
|
|
2501
|
-
var
|
|
2530
|
+
var Ea = {
|
|
2502
2531
|
solar: "oklch(0.74 0.18 60)",
|
|
2503
2532
|
grid: "oklch(0.62 0.12 245)",
|
|
2504
2533
|
battery: "oklch(0.70 0.18 145)",
|
|
@@ -2507,21 +2536,21 @@ var Sa = {
|
|
|
2507
2536
|
positive: "oklch(0.70 0.14 160)",
|
|
2508
2537
|
negative: "oklch(0.64 0.22 27)"
|
|
2509
2538
|
};
|
|
2510
|
-
function
|
|
2539
|
+
function Da(e) {
|
|
2511
2540
|
return {
|
|
2512
2541
|
fill: `color-mix(in oklch, ${e} 20%, transparent)`,
|
|
2513
2542
|
stroke: e,
|
|
2514
2543
|
solid: e
|
|
2515
2544
|
};
|
|
2516
2545
|
}
|
|
2517
|
-
var
|
|
2546
|
+
var Oa = Object.fromEntries(Object.entries(Ea).map(([e, t]) => [e, Da(t)])), ka = o.enum([
|
|
2518
2547
|
"success",
|
|
2519
2548
|
"warning",
|
|
2520
2549
|
"danger",
|
|
2521
2550
|
"info",
|
|
2522
2551
|
"neutral",
|
|
2523
2552
|
"accent"
|
|
2524
|
-
]),
|
|
2553
|
+
]), Aa = {
|
|
2525
2554
|
title: e(() => o.string().optional().meta({
|
|
2526
2555
|
title: "Title",
|
|
2527
2556
|
description: "Optional display name override"
|
|
@@ -2541,38 +2570,38 @@ var wa = Object.fromEntries(Object.entries(Sa).map(([e, t]) => [e, Ca(t)])), Ta
|
|
|
2541
2570
|
formType: "area-picker",
|
|
2542
2571
|
title: "Area"
|
|
2543
2572
|
}), "widgetFields.areaId")
|
|
2544
|
-
},
|
|
2573
|
+
}, ja = 24;
|
|
2545
2574
|
function $(e) {
|
|
2546
2575
|
let t = {};
|
|
2547
2576
|
for (let [n, r] of Object.entries(e)) r !== void 0 && (t[n] = r);
|
|
2548
2577
|
return t;
|
|
2549
2578
|
}
|
|
2550
|
-
function
|
|
2579
|
+
function Ma() {
|
|
2551
2580
|
return o.string().optional().meta({
|
|
2552
2581
|
title: "Title",
|
|
2553
2582
|
description: "Optional display name override"
|
|
2554
2583
|
});
|
|
2555
2584
|
}
|
|
2556
|
-
function
|
|
2585
|
+
function Na(e) {
|
|
2557
2586
|
return (e.default === void 0 ? o.string().optional() : o.string().default(e.default)).meta($({
|
|
2558
2587
|
title: e.title,
|
|
2559
2588
|
description: e.description
|
|
2560
2589
|
}));
|
|
2561
2590
|
}
|
|
2562
|
-
function
|
|
2591
|
+
function Pa(e) {
|
|
2563
2592
|
let t = o.number();
|
|
2564
2593
|
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($({
|
|
2565
2594
|
title: e.title,
|
|
2566
2595
|
description: e.description
|
|
2567
2596
|
}));
|
|
2568
2597
|
}
|
|
2569
|
-
function
|
|
2598
|
+
function Fa(e) {
|
|
2570
2599
|
return o.boolean().default(e.default ?? !1).meta($({
|
|
2571
2600
|
title: e.title,
|
|
2572
2601
|
description: e.description
|
|
2573
2602
|
}));
|
|
2574
2603
|
}
|
|
2575
|
-
function
|
|
2604
|
+
function Ia(e, t) {
|
|
2576
2605
|
let n = o.enum(e);
|
|
2577
2606
|
return (t.default === void 0 ? n.optional() : n.default(t.default)).meta($({
|
|
2578
2607
|
title: t.title,
|
|
@@ -2581,14 +2610,14 @@ function Ma(e, t) {
|
|
|
2581
2610
|
icons: t.icons
|
|
2582
2611
|
}));
|
|
2583
2612
|
}
|
|
2584
|
-
function
|
|
2613
|
+
function La(e, t) {
|
|
2585
2614
|
return o.array(o.enum(e)).default([...t.default ?? []]).meta($({
|
|
2586
2615
|
title: t.title,
|
|
2587
2616
|
description: t.description,
|
|
2588
2617
|
labels: t.labels
|
|
2589
2618
|
}));
|
|
2590
2619
|
}
|
|
2591
|
-
function
|
|
2620
|
+
function Ra(e, t) {
|
|
2592
2621
|
return o.array(o.string()).default([]).meta($({
|
|
2593
2622
|
domain: e,
|
|
2594
2623
|
title: t?.title ?? "Entities",
|
|
@@ -2596,7 +2625,7 @@ function Pa(e, t) {
|
|
|
2596
2625
|
deviceClass: t?.deviceClass
|
|
2597
2626
|
}));
|
|
2598
2627
|
}
|
|
2599
|
-
function
|
|
2628
|
+
function za(e, t) {
|
|
2600
2629
|
return o.array(o.string()).default([]).meta($({
|
|
2601
2630
|
domain: e,
|
|
2602
2631
|
title: t?.title ?? "Entity",
|
|
@@ -2605,13 +2634,13 @@ function Fa(e, t) {
|
|
|
2605
2634
|
singleSelect: !0
|
|
2606
2635
|
}));
|
|
2607
2636
|
}
|
|
2608
|
-
function
|
|
2637
|
+
function Ba(e) {
|
|
2609
2638
|
return o.string().optional().meta({
|
|
2610
2639
|
formType: "area-picker",
|
|
2611
2640
|
title: e?.title ?? "Area"
|
|
2612
2641
|
});
|
|
2613
2642
|
}
|
|
2614
|
-
function
|
|
2643
|
+
function Va(e) {
|
|
2615
2644
|
let t = o.string().meta($({
|
|
2616
2645
|
formType: "icon-picker",
|
|
2617
2646
|
title: e?.title ?? "Icon",
|
|
@@ -2619,7 +2648,7 @@ function La(e) {
|
|
|
2619
2648
|
}));
|
|
2620
2649
|
return e?.default === void 0 ? t.optional() : t.default(e.default);
|
|
2621
2650
|
}
|
|
2622
|
-
function
|
|
2651
|
+
function Ha(e) {
|
|
2623
2652
|
let t = e?.presets && Object.fromEntries(Object.entries(e.presets).map(([e, t]) => [e, {
|
|
2624
2653
|
label: t.label,
|
|
2625
2654
|
thumb: t.thumb
|
|
@@ -2631,36 +2660,36 @@ function Ra(e) {
|
|
|
2631
2660
|
}));
|
|
2632
2661
|
return e?.default === void 0 ? n.optional() : n.default(e.default);
|
|
2633
2662
|
}
|
|
2634
|
-
function
|
|
2663
|
+
function Ua(e) {
|
|
2635
2664
|
return o.array(o.string()).default([]).meta($({
|
|
2636
2665
|
title: e.title,
|
|
2637
2666
|
description: e.description
|
|
2638
2667
|
}));
|
|
2639
2668
|
}
|
|
2640
|
-
function
|
|
2669
|
+
function Wa(e, t) {
|
|
2641
2670
|
let n = o.object(e);
|
|
2642
|
-
return n.default(
|
|
2671
|
+
return n.default(Yt(n)).meta({ title: t.title });
|
|
2643
2672
|
}
|
|
2644
|
-
function
|
|
2673
|
+
function Ga(e) {
|
|
2645
2674
|
return e.def;
|
|
2646
2675
|
}
|
|
2647
|
-
function
|
|
2676
|
+
function Ka(e) {
|
|
2648
2677
|
if (o.globalRegistry.get(e)?.formType === "list") return !0;
|
|
2649
|
-
let t =
|
|
2650
|
-
return t.shape ? Object.values(t.shape).some(
|
|
2678
|
+
let t = Ga(e);
|
|
2679
|
+
return t.shape ? Object.values(t.shape).some(Ka) : t.options ? t.options.some(Ka) : t.element ? Ka(t.element) : t.innerType ? Ka(t.innerType) : !1;
|
|
2651
2680
|
}
|
|
2652
|
-
function
|
|
2653
|
-
let t = e, n =
|
|
2654
|
-
for (; n;) t = n, n =
|
|
2681
|
+
function qa(e) {
|
|
2682
|
+
let t = e, n = Ga(t).innerType;
|
|
2683
|
+
for (; n;) t = n, n = Ga(t).innerType;
|
|
2655
2684
|
return t;
|
|
2656
2685
|
}
|
|
2657
|
-
function
|
|
2658
|
-
let t =
|
|
2686
|
+
function Ja(e) {
|
|
2687
|
+
let t = Ga(qa(e));
|
|
2659
2688
|
if (t.shape) return new Set(Object.keys(t.shape));
|
|
2660
2689
|
if (t.options) {
|
|
2661
2690
|
let e = [];
|
|
2662
2691
|
for (let n of t.options) {
|
|
2663
|
-
let t =
|
|
2692
|
+
let t = Ja(n);
|
|
2664
2693
|
if (!t) return null;
|
|
2665
2694
|
e.push(t);
|
|
2666
2695
|
}
|
|
@@ -2672,7 +2701,7 @@ function Wa(e) {
|
|
|
2672
2701
|
}
|
|
2673
2702
|
return null;
|
|
2674
2703
|
}
|
|
2675
|
-
function
|
|
2704
|
+
function Ya(e, t, n) {
|
|
2676
2705
|
let r = { [t]: n };
|
|
2677
2706
|
try {
|
|
2678
2707
|
return e.parse(r);
|
|
@@ -2680,12 +2709,12 @@ function Ga(e, t, n) {
|
|
|
2680
2709
|
return r;
|
|
2681
2710
|
}
|
|
2682
2711
|
}
|
|
2683
|
-
function
|
|
2712
|
+
function Xa(e, t) {
|
|
2684
2713
|
if (!Number.isInteger(t.max) || t.max < 1) throw Error(`field.list: max must be a positive integer, got ${t.max}`);
|
|
2685
|
-
if (t.max >
|
|
2714
|
+
if (t.max > ja) throw Error(`field.list: max ${t.max} exceeds the ceiling of ${ja}`);
|
|
2686
2715
|
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}`);
|
|
2687
|
-
if (
|
|
2688
|
-
if (t.labelField !== void 0 && !
|
|
2716
|
+
if (Ka(e)) throw Error("field.list: a list item cannot contain another field.list (depth 1 only)");
|
|
2717
|
+
if (t.labelField !== void 0 && !Ja(e)?.has(t.labelField)) throw Error(`field.list: labelField "${t.labelField}" must name a field present in every item`);
|
|
2689
2718
|
let n = o.array(e);
|
|
2690
2719
|
return t.min !== void 0 && (n = n.min(t.min)), n = n.max(t.max), n.default([]).meta($({
|
|
2691
2720
|
formType: "list",
|
|
@@ -2695,7 +2724,7 @@ function Ka(e, t) {
|
|
|
2695
2724
|
labelField: t.labelField
|
|
2696
2725
|
}));
|
|
2697
2726
|
}
|
|
2698
|
-
function
|
|
2727
|
+
function Za(e, t, n) {
|
|
2699
2728
|
let r = Object.keys(t)[0];
|
|
2700
2729
|
if (r === void 0) throw Error("field.variants: at least one variant is required");
|
|
2701
2730
|
if (n.shared && e in n.shared) throw Error(`field.variants: shared fields cannot redefine the discriminator "${e}"`);
|
|
@@ -2708,7 +2737,7 @@ function qa(e, t, n) {
|
|
|
2708
2737
|
...r,
|
|
2709
2738
|
[e]: o.literal(t)
|
|
2710
2739
|
})), a = o.discriminatedUnion(e, i), s = i[0];
|
|
2711
|
-
return a.default(s ?
|
|
2740
|
+
return a.default(s ? Ya(s, e, r) : {}).meta($({
|
|
2712
2741
|
formType: "variants",
|
|
2713
2742
|
discriminator: e,
|
|
2714
2743
|
title: n.title,
|
|
@@ -2716,35 +2745,35 @@ function qa(e, t, n) {
|
|
|
2716
2745
|
labels: n.labels
|
|
2717
2746
|
}));
|
|
2718
2747
|
}
|
|
2719
|
-
var
|
|
2720
|
-
title:
|
|
2721
|
-
text:
|
|
2722
|
-
number:
|
|
2723
|
-
toggle:
|
|
2724
|
-
choice:
|
|
2725
|
-
choices:
|
|
2726
|
-
entities:
|
|
2727
|
-
entity:
|
|
2728
|
-
area:
|
|
2729
|
-
icon:
|
|
2730
|
-
image:
|
|
2731
|
-
stringList:
|
|
2732
|
-
group:
|
|
2733
|
-
list:
|
|
2734
|
-
variants:
|
|
2748
|
+
var Qa = {
|
|
2749
|
+
title: Ma,
|
|
2750
|
+
text: Na,
|
|
2751
|
+
number: Pa,
|
|
2752
|
+
toggle: Fa,
|
|
2753
|
+
choice: Ia,
|
|
2754
|
+
choices: La,
|
|
2755
|
+
entities: Ra,
|
|
2756
|
+
entity: za,
|
|
2757
|
+
area: Ba,
|
|
2758
|
+
icon: Va,
|
|
2759
|
+
image: Ha,
|
|
2760
|
+
stringList: Ua,
|
|
2761
|
+
group: Wa,
|
|
2762
|
+
list: Xa,
|
|
2763
|
+
variants: Za
|
|
2735
2764
|
};
|
|
2736
|
-
function
|
|
2765
|
+
function $a(e) {
|
|
2737
2766
|
return o.object(e);
|
|
2738
2767
|
}
|
|
2739
2768
|
//#endregion
|
|
2740
2769
|
//#region src/framework/image-src.ts
|
|
2741
|
-
function
|
|
2742
|
-
let n =
|
|
2743
|
-
return n === void 0 ?
|
|
2770
|
+
function eo(e, t) {
|
|
2771
|
+
let n = Bt(e);
|
|
2772
|
+
return n === void 0 ? Ht(e) : t?.[n]?.src;
|
|
2744
2773
|
}
|
|
2745
2774
|
//#endregion
|
|
2746
2775
|
//#region src/shared/spline.ts
|
|
2747
|
-
function
|
|
2776
|
+
function to(e) {
|
|
2748
2777
|
if (e.length < 2) return "";
|
|
2749
2778
|
let t = e[0], n = e[1];
|
|
2750
2779
|
if (!t || !n) return "";
|
|
@@ -2771,14 +2800,14 @@ function Za(e) {
|
|
|
2771
2800
|
}
|
|
2772
2801
|
//#endregion
|
|
2773
2802
|
//#region src/theme.ts
|
|
2774
|
-
function
|
|
2803
|
+
function no() {
|
|
2775
2804
|
return document.documentElement.classList.contains("dark");
|
|
2776
2805
|
}
|
|
2777
2806
|
//#endregion
|
|
2778
2807
|
//#region src/version.ts
|
|
2779
|
-
var
|
|
2808
|
+
var ro = {
|
|
2780
2809
|
name: "@glasshome/widget-sdk",
|
|
2781
|
-
version: "1.
|
|
2810
|
+
version: "1.20.1",
|
|
2782
2811
|
description: "SDK for building GlassHome dashboard widgets with SolidJS",
|
|
2783
2812
|
keywords: [
|
|
2784
2813
|
"dashboard",
|
|
@@ -2859,7 +2888,7 @@ var $a = {
|
|
|
2859
2888
|
zod: "^4.1.13"
|
|
2860
2889
|
},
|
|
2861
2890
|
devDependencies: {
|
|
2862
|
-
"@glasshome/ui": "1.
|
|
2891
|
+
"@glasshome/ui": "1.24.0",
|
|
2863
2892
|
"@solidjs/testing-library": "^0.8.10",
|
|
2864
2893
|
"@types/bun": "^1.4.0",
|
|
2865
2894
|
"@types/node": "^25.2.2",
|
|
@@ -2874,10 +2903,10 @@ var $a = {
|
|
|
2874
2903
|
},
|
|
2875
2904
|
peerDependencies: {
|
|
2876
2905
|
"@glasshome/sync-layer": "0.9.1",
|
|
2877
|
-
"@glasshome/ui": "1.
|
|
2906
|
+
"@glasshome/ui": "1.24.0",
|
|
2878
2907
|
"solid-js": "^1.9.11"
|
|
2879
2908
|
},
|
|
2880
2909
|
engines: { node: ">=18" }
|
|
2881
2910
|
}.version;
|
|
2882
2911
|
//#endregion
|
|
2883
|
-
export { Ce as Badge, Te as Button, De as ButtonGroup, ke as Carousel, Ae as CarouselContent, je as CarouselDots, Me as CarouselItem, Ne as CarouselNext, Pe as CarouselPrevious, Fe as ColorDisc, Ie as ColorSlider, Le as ColorWheel, Re as CountPill,
|
|
2912
|
+
export { Ce as Badge, Te as Button, De as ButtonGroup, ke as Carousel, Ae as CarouselContent, je as CarouselDots, Me as CarouselItem, Ne as CarouselNext, Pe as CarouselPrevious, Fe as ColorDisc, Ie as ColorSlider, Le as ColorWheel, Re as CountPill, Je as Icon, Ye as Input, Xe as Label, Si as PanelEntityRow, fi as PanelFacts, di as PanelRow, ui as PanelRows, li as PanelSection, $e as Progress, et as ResponsiveDialog, tt as ResponsiveDialogBody, rt as ResponsiveDialogClose, it as ResponsiveDialogContent, at as ResponsiveDialogDescription, ot as ResponsiveDialogFooter, ct as ResponsiveDialogHeader, lt as ResponsiveDialogTitle, ro as SDK_VERSION, ut as SchemaForm, dt as SectionIcon, ht as SectionTitle, gt as Select, _t as SelectContent, vt as SelectItem, yt as SelectTrigger, bt as SelectValue, xt as Slider, St as SwatchPicker, Ct as Switch, wt as Tabs, Et as TabsContent, Ot as TabsList, At as TabsTrigger, Mt as TemperatureBar, Nt as Toggle, Pt as ToggleGroup, It as ToggleGroupItem, ka as ToneSchema, Z as Widget, $n as WidgetAction, nr as WidgetBackdrop, er as WidgetChip, Qn as WidgetChoice, _r as WidgetContent, Xn as WidgetControls, W as WidgetCtx, Gi as WidgetDebugTab, Ui as WidgetDebugView, aa as WidgetDialog, rr as WidgetGlyph, Jn as WidgetHead, Yn as WidgetHero, Pn as WidgetIcon, tr as WidgetLayer, r as WidgetManifestSchema, Dn as WidgetSizeCtx, mr as WidgetSliderFill, yr as WidgetStatus, Zn as WidgetStepper, Sr as WidgetTitle, Rr as WidgetValue, Oi as buildDebugData, h as byDomain, Dr as calculateLightGroup, Or as calculateSensorGroup, Cr as copyText, Nr as countActiveEntities, $a as defineConfig, Xt as defineWidget, t as deprecations, Qa as field, n as formatDeprecation, i as formatSchemaError, Mr as getEntityAttribute, s as getForecasts, c as getStream, l as getWebRtcClientConfig, u as hassMediaUrl, zt as imagePreset, eo as imageSrc, Vt as imageUrl, lr as injectTokens, no as isDark, jr as isEntityActive, xi as isPanelControllable, Ut as mediaUrl, to as monotoneCubicPath, Wt as parseColor, Gt as presetValue, d as sendWebRtcCandidate, f as startWebRtcSession, p as state, Oa as svgColors, m as trackEntityHistory, ee as untrackEntityHistory, g as useArea, _ as useCalendarEvents, v as useCamera, An as useConfirm, y as useConnection, Er as useCopyText, b as useCurrency, Ca as useDaylight, x as useEntities, S as useEntity, ne as useEntityHistory, re as useEntityStatistics, ie as useForecast, ae as useHassConfig, da as useIntersectionPause, oe as useLocale, wa as useReducedMotion, $t as useService, ce as useStore, le as useTemperatureUnit, nn as useToggle, tn as useTurnOff, en as useTurnOn, pe as useUnitSystem, Zt as useWidgetContext, ca as useWidgetDashboard, rn as useWidgetDialog, On as useWidgetDimensions, Ta as useWidgetEntityGroup, En as useWidgetGestures, ua as useWidgetViewer, Aa as widgetFields, a as z };
|