@sentinel-nvr/web 0.21.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1102 @@
1
+ // src/ui/themes-data.ts
2
+ var THEME_NAMES = ["aurora", "sunset", "ocean", "forest"];
3
+ var THEME_LABELS = {
4
+ aurora: "Aurora",
5
+ sunset: "Sunset",
6
+ ocean: "Ocean",
7
+ forest: "Forest"
8
+ };
9
+ var THEMES = {
10
+ // Aurora — the default: neutral surfaces, warm orange accent (matches mockups)
11
+ aurora: {
12
+ light: {
13
+ bg: "#f3f4f6",
14
+ bgRaised: "#ffffff",
15
+ bgCard: "#ffffff",
16
+ bgCardHover: "#f8f9fb",
17
+ bgSubtle: "#f1f3f5",
18
+ text: "#1a1d23",
19
+ textDim: "#697079",
20
+ textFaint: "#9aa1ab",
21
+ accent: "#f2941c",
22
+ accentSoft: "rgba(242, 148, 28, 0.12)",
23
+ onAccent: "#ffffff",
24
+ line: "rgba(20, 24, 30, 0.07)",
25
+ border: "#e8eaee",
26
+ positive: "#16a34a",
27
+ positiveSoft: "rgba(22, 163, 74, 0.12)",
28
+ warning: "#e59411",
29
+ warningSoft: "rgba(229, 148, 17, 0.12)",
30
+ danger: "#e5484d",
31
+ dangerSoft: "rgba(229, 72, 77, 0.10)",
32
+ info: "#3b82f6",
33
+ infoSoft: "rgba(59, 130, 246, 0.12)",
34
+ shadowCard: "0 1px 2px rgba(16, 24, 40, 0.04), 0 1px 3px rgba(16, 24, 40, 0.06)",
35
+ shadowElevated: "0 12px 32px -8px rgba(16, 24, 40, 0.16)",
36
+ shadowActive: "0 0 0 1px var(--accent-soft), 0 6px 20px -8px rgba(242, 148, 28, 0.30)"
37
+ },
38
+ dark: {
39
+ bg: "#0f1116",
40
+ bgRaised: "#171a21",
41
+ bgCard: "#171a21",
42
+ bgCardHover: "#1e222b",
43
+ bgSubtle: "#22262f",
44
+ text: "#f2f4f7",
45
+ textDim: "#9aa1ad",
46
+ textFaint: "#646b76",
47
+ accent: "#f5a623",
48
+ accentSoft: "rgba(245, 166, 35, 0.16)",
49
+ onAccent: "#1a1205",
50
+ line: "rgba(255, 255, 255, 0.08)",
51
+ border: "rgba(255, 255, 255, 0.09)",
52
+ positive: "#3ad07f",
53
+ positiveSoft: "rgba(58, 208, 127, 0.15)",
54
+ warning: "#f5b53d",
55
+ warningSoft: "rgba(245, 181, 61, 0.15)",
56
+ danger: "#f0686d",
57
+ dangerSoft: "rgba(240, 104, 109, 0.15)",
58
+ info: "#5fa0f5",
59
+ infoSoft: "rgba(95, 160, 245, 0.15)",
60
+ shadowCard: "0 2px 8px -2px rgba(0, 0, 0, 0.5)",
61
+ shadowElevated: "0 16px 40px -12px rgba(0, 0, 0, 0.7)",
62
+ shadowActive: "0 0 0 1px var(--accent-soft), 0 6px 24px -8px rgba(245, 166, 35, 0.30)"
63
+ }
64
+ },
65
+ // Sunset — warm amber identity, warm-tinted surfaces
66
+ sunset: {
67
+ light: {
68
+ bg: "#f6f1ea",
69
+ bgRaised: "#fffdfa",
70
+ bgCard: "#fffdfa",
71
+ bgCardHover: "#f7f1e9",
72
+ bgSubtle: "#f1e9dd",
73
+ text: "#241d15",
74
+ textDim: "#7c6f5e",
75
+ textFaint: "#b3a692",
76
+ accent: "#d98324",
77
+ accentSoft: "rgba(217, 131, 36, 0.13)",
78
+ onAccent: "#ffffff",
79
+ line: "rgba(40, 30, 18, 0.09)",
80
+ border: "#ece2d3",
81
+ positive: "#3f8a5d",
82
+ positiveSoft: "rgba(63, 138, 93, 0.13)",
83
+ warning: "#c98a1e",
84
+ warningSoft: "rgba(201, 138, 30, 0.14)",
85
+ danger: "#c75a44",
86
+ dangerSoft: "rgba(199, 90, 68, 0.12)",
87
+ info: "#3f7da0",
88
+ infoSoft: "rgba(63, 125, 160, 0.13)",
89
+ shadowCard: "0 1px 3px rgba(80, 55, 20, 0.07)",
90
+ shadowElevated: "0 12px 32px -8px rgba(80, 55, 20, 0.18)",
91
+ shadowActive: "0 0 0 1px var(--accent-soft), 0 6px 20px -8px rgba(217, 131, 36, 0.30)"
92
+ },
93
+ dark: {
94
+ bg: "#161310",
95
+ bgRaised: "#1f1b16",
96
+ bgCard: "#241f19",
97
+ bgCardHover: "#2a241d",
98
+ bgSubtle: "#2f2820",
99
+ text: "#f2ece2",
100
+ textDim: "#a39a8c",
101
+ textFaint: "#6f675c",
102
+ accent: "#e8a84b",
103
+ accentSoft: "rgba(232, 168, 75, 0.16)",
104
+ onAccent: "#1c1610",
105
+ line: "rgba(242, 236, 226, 0.08)",
106
+ border: "rgba(242, 236, 226, 0.09)",
107
+ positive: "#8fc7a2",
108
+ positiveSoft: "rgba(143, 199, 162, 0.16)",
109
+ warning: "#e8a84b",
110
+ warningSoft: "rgba(232, 168, 75, 0.16)",
111
+ danger: "#e08a78",
112
+ dangerSoft: "rgba(224, 138, 120, 0.16)",
113
+ info: "#8fb7c7",
114
+ infoSoft: "rgba(143, 183, 199, 0.16)",
115
+ shadowCard: "0 2px 10px -3px rgba(0, 0, 0, 0.5)",
116
+ shadowElevated: "0 16px 40px -12px rgba(0, 0, 0, 0.66)",
117
+ shadowActive: "0 0 0 1px var(--accent-soft), 0 6px 24px -8px rgba(232, 168, 75, 0.28)"
118
+ }
119
+ },
120
+ // Ocean — cool steel-blue identity
121
+ ocean: {
122
+ light: {
123
+ bg: "#eef1f5",
124
+ bgRaised: "#ffffff",
125
+ bgCard: "#ffffff",
126
+ bgCardHover: "#f4f7fa",
127
+ bgSubtle: "#eaeef3",
128
+ text: "#172029",
129
+ textDim: "#5f6c7a",
130
+ textFaint: "#9aa6b3",
131
+ accent: "#2f7fd6",
132
+ accentSoft: "rgba(47, 127, 214, 0.12)",
133
+ onAccent: "#ffffff",
134
+ line: "rgba(20, 30, 45, 0.08)",
135
+ border: "#e3e8ee",
136
+ positive: "#159a6e",
137
+ positiveSoft: "rgba(21, 154, 110, 0.12)",
138
+ warning: "#e09112",
139
+ warningSoft: "rgba(224, 145, 18, 0.13)",
140
+ danger: "#e0495a",
141
+ dangerSoft: "rgba(224, 73, 90, 0.11)",
142
+ info: "#2f7fd6",
143
+ infoSoft: "rgba(47, 127, 214, 0.12)",
144
+ shadowCard: "0 1px 3px rgba(20, 35, 60, 0.07)",
145
+ shadowElevated: "0 12px 32px -8px rgba(20, 35, 60, 0.16)",
146
+ shadowActive: "0 0 0 1px var(--accent-soft), 0 6px 20px -8px rgba(47, 127, 214, 0.28)"
147
+ },
148
+ dark: {
149
+ bg: "#0a0c10",
150
+ bgRaised: "#0f1218",
151
+ bgCard: "#12151c",
152
+ bgCardHover: "#181c25",
153
+ bgSubtle: "#1d2230",
154
+ text: "#e8ecf2",
155
+ textDim: "#8a9ab0",
156
+ textFaint: "#566173",
157
+ accent: "#5fa8e8",
158
+ accentSoft: "rgba(95, 168, 232, 0.16)",
159
+ onAccent: "#06090f",
160
+ line: "rgba(232, 236, 242, 0.08)",
161
+ border: "rgba(232, 236, 242, 0.09)",
162
+ positive: "#4dc596",
163
+ positiveSoft: "rgba(77, 197, 150, 0.16)",
164
+ warning: "#e3b256",
165
+ warningSoft: "rgba(227, 178, 86, 0.16)",
166
+ danger: "#e68086",
167
+ dangerSoft: "rgba(230, 128, 134, 0.16)",
168
+ info: "#5fa8e8",
169
+ infoSoft: "rgba(95, 168, 232, 0.16)",
170
+ shadowCard: "0 2px 12px -3px rgba(0, 0, 0, 0.6)",
171
+ shadowElevated: "0 16px 40px -12px rgba(0, 0, 0, 0.72)",
172
+ shadowActive: "0 0 0 1px var(--accent-soft), 0 6px 24px -8px rgba(95, 168, 232, 0.30)"
173
+ }
174
+ },
175
+ // Forest — muted green identity
176
+ forest: {
177
+ light: {
178
+ bg: "#edf1ec",
179
+ bgRaised: "#ffffff",
180
+ bgCard: "#ffffff",
181
+ bgCardHover: "#f3f7f2",
182
+ bgSubtle: "#e8eee7",
183
+ text: "#1b2620",
184
+ textDim: "#5f6f64",
185
+ textFaint: "#9aa89f",
186
+ accent: "#3f9a63",
187
+ accentSoft: "rgba(63, 154, 99, 0.13)",
188
+ onAccent: "#ffffff",
189
+ line: "rgba(24, 36, 28, 0.08)",
190
+ border: "#e0e8e1",
191
+ positive: "#2f9a5e",
192
+ positiveSoft: "rgba(47, 154, 94, 0.13)",
193
+ warning: "#cf9120",
194
+ warningSoft: "rgba(207, 145, 32, 0.13)",
195
+ danger: "#cf5746",
196
+ dangerSoft: "rgba(207, 87, 70, 0.11)",
197
+ info: "#3f86a0",
198
+ infoSoft: "rgba(63, 134, 160, 0.13)",
199
+ shadowCard: "0 1px 3px rgba(24, 45, 32, 0.07)",
200
+ shadowElevated: "0 12px 32px -8px rgba(24, 45, 32, 0.16)",
201
+ shadowActive: "0 0 0 1px var(--accent-soft), 0 6px 20px -8px rgba(63, 154, 99, 0.28)"
202
+ },
203
+ dark: {
204
+ bg: "#0c110d",
205
+ bgRaised: "#121812",
206
+ bgCard: "#161d17",
207
+ bgCardHover: "#1d261e",
208
+ bgSubtle: "#212c22",
209
+ text: "#e9efe9",
210
+ textDim: "#8ba091",
211
+ textFaint: "#586860",
212
+ accent: "#5cc486",
213
+ accentSoft: "rgba(92, 196, 134, 0.16)",
214
+ onAccent: "#06120a",
215
+ line: "rgba(233, 239, 233, 0.08)",
216
+ border: "rgba(233, 239, 233, 0.09)",
217
+ positive: "#5cc486",
218
+ positiveSoft: "rgba(92, 196, 134, 0.16)",
219
+ warning: "#e0b455",
220
+ warningSoft: "rgba(224, 180, 85, 0.16)",
221
+ danger: "#e6807a",
222
+ dangerSoft: "rgba(230, 128, 122, 0.16)",
223
+ info: "#62b0c4",
224
+ infoSoft: "rgba(98, 176, 196, 0.16)",
225
+ shadowCard: "0 2px 12px -3px rgba(0, 0, 0, 0.55)",
226
+ shadowElevated: "0 16px 40px -12px rgba(0, 0, 0, 0.7)",
227
+ shadowActive: "0 0 0 1px var(--accent-soft), 0 6px 24px -8px rgba(92, 196, 134, 0.30)"
228
+ }
229
+ }
230
+ };
231
+ function resolveThemeMode(mode, systemPrefersDark) {
232
+ if (mode === "light" || mode === "dark") return mode;
233
+ return systemPrefersDark ? "dark" : "light";
234
+ }
235
+ function accentOverride(hue, resolvedMode) {
236
+ const isDark = resolvedMode === "dark";
237
+ const l = isDark ? 60 : 50;
238
+ const s = 78;
239
+ return {
240
+ accent: `hsl(${hue}, ${s}%, ${l}%)`,
241
+ accentSoft: `hsla(${hue}, ${s}%, ${l}%, ${isDark ? 0.16 : 0.12})`,
242
+ onAccent: isDark ? "#140e04" : "#ffffff"
243
+ };
244
+ }
245
+
246
+ // src/ui/theme.ts
247
+ var TOKEN_TO_VAR = {
248
+ bg: "--bg",
249
+ bgRaised: "--bg-raised",
250
+ bgCard: "--bg-card",
251
+ bgCardHover: "--bg-card-hover",
252
+ bgSubtle: "--bg-subtle",
253
+ text: "--text",
254
+ textDim: "--text-dim",
255
+ textFaint: "--text-faint",
256
+ accent: "--accent",
257
+ accentSoft: "--accent-soft",
258
+ onAccent: "--on-accent",
259
+ line: "--line",
260
+ border: "--border",
261
+ positive: "--positive",
262
+ positiveSoft: "--positive-soft",
263
+ warning: "--warning",
264
+ warningSoft: "--warning-soft",
265
+ danger: "--danger",
266
+ dangerSoft: "--danger-soft",
267
+ info: "--info",
268
+ infoSoft: "--info-soft",
269
+ shadowCard: "--shadow-card",
270
+ shadowElevated: "--shadow-elevated",
271
+ shadowActive: "--shadow-active"
272
+ };
273
+ var darkMql = () => typeof window !== "undefined" && window.matchMedia ? window.matchMedia("(prefers-color-scheme: dark)") : null;
274
+ function resolveMode(mode) {
275
+ return resolveThemeMode(mode, darkMql()?.matches ?? false);
276
+ }
277
+ function isThemeName(name) {
278
+ return THEME_NAMES.includes(name);
279
+ }
280
+ function applyTheme(name, mode = "light", accentHue) {
281
+ const root = document.documentElement;
282
+ const theme = isThemeName(name) ? name : "aurora";
283
+ const resolved = resolveMode(mode);
284
+ const tokens = THEMES[theme][resolved];
285
+ for (const key of Object.keys(TOKEN_TO_VAR))
286
+ root.style.setProperty(TOKEN_TO_VAR[key], tokens[key]);
287
+ root.setAttribute("data-theme", theme);
288
+ root.setAttribute("data-mode", resolved);
289
+ root.style.setProperty("color-scheme", resolved);
290
+ if (accentHue !== void 0) {
291
+ const o = accentOverride(accentHue, resolved);
292
+ root.style.setProperty("--accent", o.accent);
293
+ root.style.setProperty("--accent-soft", o.accentSoft);
294
+ root.style.setProperty("--on-accent", o.onAccent);
295
+ }
296
+ return resolved;
297
+ }
298
+ function watchSystemMode(getState) {
299
+ const mql = darkMql();
300
+ if (!mql)
301
+ return () => {
302
+ };
303
+ const on = () => {
304
+ const s = getState();
305
+ if (s.mode === "auto") applyTheme(s.theme, s.mode, s.accentHue);
306
+ };
307
+ mql.addEventListener("change", on);
308
+ return () => mql.removeEventListener("change", on);
309
+ }
310
+
311
+ // src/glas/glas-data.ts
312
+ var UI_STYLES = ["classic", "glas"];
313
+ var GLAS_STRENGTHS = ["clear", "tinted", "opaque"];
314
+ var LIGHT = {
315
+ bg: "#F2F2F7",
316
+ card: "#FFFFFF",
317
+ card2: "#F2F2F7",
318
+ cardSolid: "#FFFFFF",
319
+ cardHover: "#F7F7FA",
320
+ group: "#FFFFFF",
321
+ sheetSolid: "#F2F2F7",
322
+ fill: "rgba(120,120,128,.12)",
323
+ fill2: "rgba(120,120,128,.20)",
324
+ fillSolid: "#E5E5EA",
325
+ sep: "rgba(60,60,67,.18)",
326
+ sepStrong: "rgba(60,60,67,.36)",
327
+ label: "#000000",
328
+ label2: "#5F5F64",
329
+ label3: "#7C7C80",
330
+ glassLabel2: "#3A3A3C",
331
+ textFaint: "#636366",
332
+ glyphDark: "#1C1C1E",
333
+ onMedia: "#FFFFFF",
334
+ mediaBg: "#000000",
335
+ grabber: "rgba(60,60,67,.30)",
336
+ yellow: "#FFCC00",
337
+ yellowInk: "#7D5E00",
338
+ yellowSoft: "rgba(255,204,0,.24)",
339
+ orange: "#FF9500",
340
+ orangeInk: "#B25000",
341
+ orangeSoft: "rgba(255,149,0,.16)",
342
+ teal: "#30B0C7",
343
+ tealInk: "#0A7389",
344
+ tealSoft: "rgba(48,176,199,.16)",
345
+ green: "#34C759",
346
+ greenInk: "#1F7A35",
347
+ greenSoft: "rgba(52,199,89,.16)",
348
+ red: "#FF3B30",
349
+ redInk: "#D70015",
350
+ redSoft: "rgba(255,59,48,.12)",
351
+ blue: "#007AFF",
352
+ blueInk: "#0060DF",
353
+ blueSoft: "rgba(0,122,255,.12)",
354
+ purple: "#AF52DE",
355
+ purpleInk: "#8944AB",
356
+ indigo: "#5856D6",
357
+ indigoInk: "#3634A3",
358
+ gray: "#8E8E93",
359
+ warnInk: "#7D5E00",
360
+ warnSoft: "rgba(255,204,0,.24)",
361
+ switchOn: "#34C759",
362
+ switchOff: "rgba(120,120,128,.24)",
363
+ knob: "#FFFFFF",
364
+ badge: "#D70015",
365
+ onBadge: "#FFFFFF",
366
+ live: "#D70015",
367
+ liveDot: "#FF3B30",
368
+ actDel: "#D70015",
369
+ actOk: "#1F7A35",
370
+ actNeutral: "#636366",
371
+ binRest: "#8E8E93",
372
+ binPaper: "#007AFF",
373
+ binYellow: "#FFCC00",
374
+ binBio: "#34C759",
375
+ binBrown: "#A2845E",
376
+ ct1: "#FFB25B",
377
+ ct2: "#FFD39C",
378
+ ct3: "#FFF3E3",
379
+ ct4: "#DCE8FF",
380
+ tileOn: "#FFFFFF",
381
+ tileOff: "color-mix(in srgb, #FFFFFF 45%, #F2F2F7)",
382
+ tileOffLabel: "#5F5F64",
383
+ chartNetz: "#8E8E93",
384
+ chartSolar: "#FFCC00",
385
+ chartSolarEdge: "#A67C00",
386
+ chartBar: "rgba(120,120,128,.32)",
387
+ chartLine: "#3A3A3C",
388
+ chartArea: "rgba(120,120,128,.14)",
389
+ chartGrid: "rgba(60,60,67,.36)",
390
+ chartAvg: "#000000",
391
+ seg: "#FFFFFF",
392
+ segShadow: "0 3px 8px rgba(0,0,0,.12), 0 .5px 0 rgba(0,0,0,.04)",
393
+ lens: "#E6E6E9",
394
+ hover: "rgba(120,120,128,.08)",
395
+ scrim: "rgba(0,0,0,.25)",
396
+ scrimDesktop: "rgba(0,0,0,.22)",
397
+ ctxDim: "rgba(0,0,0,.18)",
398
+ ctxScrimDesktop: "rgba(242,242,247,.35)",
399
+ avDim: "rgba(0,0,0,.10)",
400
+ glow: "rgba(255,255,255,.45)",
401
+ toastBg: "rgba(28,28,30,.92)",
402
+ toastText: "#FFFFFF",
403
+ bannerReconnecting: "color-mix(in srgb, #FFCC00 26%, #FFFFFF)",
404
+ bannerLost: "color-mix(in srgb, #FF3B30 16%, #FFFFFF)",
405
+ edgeTint: "#F2F2F7",
406
+ wallTint: "rgba(242,242,247,.38)"
407
+ };
408
+ var DARK = {
409
+ bg: "#000000",
410
+ card: "#1C1C1E",
411
+ card2: "#2C2C2E",
412
+ cardSolid: "#1C1C1E",
413
+ cardHover: "#2C2C2E",
414
+ group: "#2C2C2E",
415
+ sheetSolid: "#1C1C1E",
416
+ fill: "rgba(120,120,128,.24)",
417
+ fill2: "rgba(120,120,128,.36)",
418
+ fillSolid: "#3A3A3C",
419
+ sep: "rgba(84,84,88,.55)",
420
+ sepStrong: "rgba(84,84,88,.95)",
421
+ label: "#FFFFFF",
422
+ label2: "#AEAEB2",
423
+ label3: "#8E8E93",
424
+ glassLabel2: "#D1D1D6",
425
+ textFaint: "#A1A1A6",
426
+ glyphDark: "#1C1C1E",
427
+ onMedia: "#FFFFFF",
428
+ mediaBg: "#000000",
429
+ grabber: "rgba(235,235,245,.30)",
430
+ yellow: "#FFD60A",
431
+ yellowInk: "#FFD60A",
432
+ yellowSoft: "rgba(255,214,10,.20)",
433
+ orange: "#FF9F0A",
434
+ orangeInk: "#FFB340",
435
+ orangeSoft: "rgba(255,159,10,.22)",
436
+ teal: "#40C8E0",
437
+ tealInk: "#40C8E0",
438
+ tealSoft: "rgba(64,200,224,.20)",
439
+ green: "#30D158",
440
+ greenInk: "#30D158",
441
+ greenSoft: "rgba(48,209,88,.20)",
442
+ red: "#FF453A",
443
+ redInk: "#FF6961",
444
+ redSoft: "rgba(255,69,58,.22)",
445
+ blue: "#0A84FF",
446
+ blueInk: "#409CFF",
447
+ blueSoft: "rgba(10,132,255,.22)",
448
+ purple: "#BF5AF2",
449
+ purpleInk: "#DA8FFF",
450
+ indigo: "#5E5CE6",
451
+ indigoInk: "#9D9BFF",
452
+ gray: "#8E8E93",
453
+ warnInk: "#FFD60A",
454
+ warnSoft: "rgba(255,214,10,.20)",
455
+ switchOn: "#30D158",
456
+ switchOff: "rgba(120,120,128,.32)",
457
+ knob: "#FFFFFF",
458
+ badge: "#D70015",
459
+ onBadge: "#FFFFFF",
460
+ live: "#D70015",
461
+ liveDot: "#FF3B30",
462
+ actDel: "#D70015",
463
+ actOk: "#1F7A35",
464
+ actNeutral: "#636366",
465
+ binRest: "#8E8E93",
466
+ binPaper: "#0A84FF",
467
+ binYellow: "#FFD60A",
468
+ binBio: "#30D158",
469
+ binBrown: "#AC8E68",
470
+ ct1: "#FFB25B",
471
+ ct2: "#FFD39C",
472
+ ct3: "#FFF3E3",
473
+ ct4: "#DCE8FF",
474
+ tileOn: "#2C2C2E",
475
+ tileOff: "#1C1C1E",
476
+ tileOffLabel: "#AEAEB2",
477
+ chartNetz: "#8E8E93",
478
+ chartSolar: "#FFD60A",
479
+ chartSolarEdge: "rgba(0,0,0,0)",
480
+ chartBar: "rgba(120,120,128,.48)",
481
+ chartLine: "#D1D1D6",
482
+ chartArea: "rgba(120,120,128,.24)",
483
+ chartGrid: "rgba(84,84,88,.95)",
484
+ chartAvg: "#FFFFFF",
485
+ seg: "#636366",
486
+ segShadow: "0 3px 8px rgba(0,0,0,.30)",
487
+ lens: "#3C3C3D",
488
+ hover: "rgba(255,255,255,.06)",
489
+ scrim: "rgba(0,0,0,.45)",
490
+ scrimDesktop: "rgba(0,0,0,.45)",
491
+ ctxDim: "rgba(0,0,0,.40)",
492
+ ctxScrimDesktop: "rgba(0,0,0,.35)",
493
+ avDim: "rgba(0,0,0,.36)",
494
+ glow: "rgba(255,255,255,.22)",
495
+ toastBg: "rgba(58,58,60,.94)",
496
+ toastText: "#FFFFFF",
497
+ bannerReconnecting: "color-mix(in srgb, #FFD60A 26%, #1C1C1E)",
498
+ bannerLost: "color-mix(in srgb, #FF453A 16%, #1C1C1E)",
499
+ edgeTint: "#000000",
500
+ wallTint: "rgba(0,0,0,.42)"
501
+ };
502
+ var GLAS_COLORS = { light: LIGHT, dark: DARK };
503
+ var GLAS_TINT = { clear: 0.25, tinted: 0.75 };
504
+ var GLAS_SURFACE_TINT = {
505
+ default: { clear: 0.25, tinted: 0.75 },
506
+ tabBar: { clear: 0.6, tinted: 0.75 },
507
+ avatarButton: { clear: 0.6, tinted: 0.75 },
508
+ backButton: { clear: 0.5, tinted: 0.75 },
509
+ dateChip: { clear: 0.55, tinted: 0.75 },
510
+ headerCapsule: { clear: 0.25, tinted: 0.75 },
511
+ sidebar: { clear: 0.5, tinted: 0.8 },
512
+ sheetMedium: { clear: 0.7, tinted: 0.75 },
513
+ dialogDesktop: { clear: 0.68, tinted: 0.85 },
514
+ inspector: { clear: 0.68, tinted: 0.85 },
515
+ toastDesktop: { clear: 0.68, tinted: 0.85 },
516
+ menu: { clear: 0.88, tinted: 0.94 }
517
+ };
518
+ var MATERIAL = {
519
+ light: {
520
+ rgb: "255 255 255",
521
+ a0: 0.3,
522
+ a1: 0.14,
523
+ sat: "210%",
524
+ bright: 1.06,
525
+ rim: "linear-gradient(135deg, rgba(255,255,255,.95) 0%, rgba(255,255,255,.35) 22%, rgba(255,255,255,.06) 50%, rgba(255,255,255,.30) 78%, rgba(255,255,255,.85) 100%)",
526
+ inner: "inset 1.5px 1.5px 1px -1px rgba(255,255,255,.6), inset -1.5px -1.5px 1px -1px rgba(255,255,255,.4), inset 0 1px 1.5px rgba(255,255,255,.75), inset 0 -1.5px 3px rgba(255,255,255,.22), inset 0 0 16px rgba(255,255,255,.18), inset 0 -12px 20px -14px rgba(0,0,0,.10), 0 0 0 .5px rgba(0,0,0,.10)",
527
+ outer: "0 1px 2px rgba(0,0,0,.08), 0 12px 32px rgba(0,0,0,.14)"
528
+ },
529
+ dark: {
530
+ rgb: "40 40 44",
531
+ a0: 0.3,
532
+ a1: 0.2,
533
+ sat: "180%",
534
+ bright: 0.9,
535
+ rim: "linear-gradient(135deg, rgba(255,255,255,.55) 0%, rgba(255,255,255,.2) 22%, rgba(255,255,255,.04) 50%, rgba(255,255,255,.17) 78%, rgba(255,255,255,.5) 100%)",
536
+ inner: "inset 1.5px 1.5px 1px -1px rgba(255,255,255,.32), inset -1.5px -1.5px 1px -1px rgba(255,255,255,.2), inset 0 1px 1.5px rgba(255,255,255,.24), inset 0 0 16px rgba(255,255,255,.05), 0 0 0 .5px rgba(0,0,0,.55)",
537
+ outer: "0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.5)"
538
+ }
539
+ };
540
+ var SHEET = {
541
+ // Light: white enough that coloured text keeps 4.5:1 over the scrimmed page (Etappe 7, K109; was
542
+ // rgba(246,246,250,.86) → rgba(242,242,247,.80), the inks fell to 3.9:1 over the dimmed page)
543
+ light: {
544
+ fill: "linear-gradient(180deg, rgba(255,255,255,.88), rgba(255,255,255,.82))",
545
+ filter: "blur(28px) saturate(190%) brightness(1.04)",
546
+ bottom: "rgba(255,255,255,.82)",
547
+ bright: 1.04
548
+ },
549
+ dark: {
550
+ fill: "linear-gradient(180deg, rgba(36,36,40,.86), rgba(28,28,30,.80))",
551
+ filter: "blur(28px) saturate(170%) brightness(.9)",
552
+ bottom: "rgba(28,28,30,.80)",
553
+ bright: 0.9
554
+ }
555
+ };
556
+ var GLAS_SHADOWS = {
557
+ menu: "var(--g-glass-inner), 0 2px 6px rgba(0,0,0,.08), 0 24px 60px rgba(0,0,0,.25)",
558
+ popover: "var(--g-glass-inner), 0 2px 6px rgba(0,0,0,.08), 0 24px 60px rgba(0,0,0,.22)",
559
+ banner: "0 4px 16px rgba(0,0,0,.08)",
560
+ toast: "0 10px 30px rgba(0,0,0,.25)",
561
+ prominent: "0 1px 2px rgba(0,0,0,.08), 0 6px 18px rgba(0,0,0,.12)",
562
+ chip: "0 1px 3px rgba(0,0,0,.12), 0 4px 12px rgba(0,0,0,.08)",
563
+ live: "0 2px 8px rgba(0,0,0,.25)"
564
+ };
565
+ var GLAS_WINDOW_SHADOWS = {
566
+ light: {
567
+ dialog: "var(--g-glass-inner), 0 2px 6px rgba(0,0,0,.08), 0 30px 80px rgba(0,0,0,.28)",
568
+ inspector: "var(--g-glass-inner), 0 2px 6px rgba(0,0,0,.06), 0 24px 70px rgba(0,0,0,.20)",
569
+ sheetLarge: "0 -10px 40px rgba(0,0,0,.14)",
570
+ pushedScreen: "-12px 0 32px rgba(0,0,0,.14)",
571
+ liftContext: "0 18px 50px rgba(0,0,0,.22), 0 2px 8px rgba(0,0,0,.08)",
572
+ liftContextDesktop: "0 18px 50px rgba(0,0,0,.28)",
573
+ cardHover: "0 1px 2px rgba(0,0,0,.05), 0 10px 24px rgba(0,0,0,.08)",
574
+ tileLift: "0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.06)",
575
+ tileOnDesktop: "0 1px 2px rgba(0,0,0,.06), 0 6px 16px rgba(0,0,0,.08)",
576
+ knob: "0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16)",
577
+ lightGlow: "0 4px 14px rgba(255,204,0,.35)"
578
+ },
579
+ dark: {
580
+ dialog: "var(--g-glass-inner), 0 2px 6px rgba(0,0,0,.08), 0 30px 80px rgba(0,0,0,.28)",
581
+ inspector: "var(--g-glass-inner), 0 2px 6px rgba(0,0,0,.06), 0 24px 70px rgba(0,0,0,.20)",
582
+ sheetLarge: "0 -10px 40px rgba(0,0,0,.6)",
583
+ pushedScreen: "-12px 0 32px rgba(0,0,0,.14)",
584
+ liftContext: "0 18px 50px rgba(0,0,0,.6)",
585
+ liftContextDesktop: "0 18px 50px rgba(0,0,0,.6)",
586
+ cardHover: "0 10px 24px rgba(0,0,0,.5)",
587
+ tileLift: "none",
588
+ tileOnDesktop: "0 6px 16px rgba(0,0,0,.4)",
589
+ knob: "0 3px 8px rgba(0,0,0,.15), 0 1px 1px rgba(0,0,0,.16)",
590
+ lightGlow: "0 4px 14px rgba(255,204,0,.35)"
591
+ }
592
+ };
593
+ var CLEAR = {
594
+ fill: "rgba(0,0,0,.20)",
595
+ // Text on clear glass over a picture (the camera tiles' names, the NVR card's pill): white 15 px keeps 4.5:1 over a
596
+ // white picture together with the tile's top shade (GLAS-DESIGN §2.5 rule 5; Etappe 7, K109: .20 gave 1.4:1 over sky)
597
+ textFill: "rgba(0,0,0,.50)",
598
+ filter: "blur(4px) saturate(160%)",
599
+ rim: "linear-gradient(135deg, rgba(255,255,255,.62) 0%, rgba(255,255,255,.2) 24%, rgba(255,255,255,.04) 50%, rgba(255,255,255,.18) 76%, rgba(255,255,255,.52) 100%)",
600
+ shadow: "inset 1.5px 1.5px 1px -1px rgba(255,255,255,.35), inset 0 1px 1px rgba(255,255,255,.28), inset 0 0 12px rgba(255,255,255,.08), 0 0 0 .5px rgba(0,0,0,.25), 0 6px 20px rgba(0,0,0,.25)",
601
+ textShadow: "0 1px 2px rgba(0,0,0,.45)"
602
+ };
603
+ var GLAS_SPRINGS = {
604
+ smooth: {
605
+ linear: "linear(0, 0.0263, 0.0895, 0.1722, 0.2626, 0.3534, 0.4399, 0.5197, 0.5916, 0.6551, 0.7104, 0.7581, 0.7988, 0.8334, 0.8624, 0.8868, 0.9071, 0.9239, 0.9379, 0.9494, 0.9588, 0.9665, 0.9729, 0.978, 0.9822, 0.9857, 0.9884, 0.9907, 0.9925, 0.994, 0.9952, 0.9961, 0.9969, 0.9975, 0.998, 0.9984, 0.9987, 0.999, 0.9992, 0.9993, 1)",
606
+ fallback: "cubic-bezier(.3,.6,.04,1)",
607
+ duration: ".5s"
608
+ },
609
+ snappy: {
610
+ linear: "linear(0, 0.0217, 0.0778, 0.1568, 0.2492, 0.3477, 0.4464, 0.5414, 0.6296, 0.7093, 0.7795, 0.8398, 0.8905, 0.932, 0.9651, 0.9908, 1.0099, 1.0234, 1.0323, 1.0375, 1.0398, 1.0398, 1.0381, 1.0354, 1.0319, 1.028, 1.0241, 1.0202, 1.0165, 1.0131, 1.0101, 1.0075, 1.0053, 1.0035, 1.002, 1.0008, 0.9999, 0.9993, 0.9989, 0.9986, 1)",
611
+ fallback: "cubic-bezier(.34,.65,0,1.2)",
612
+ duration: ".35s"
613
+ },
614
+ bouncy: {
615
+ linear: "linear(0, 0.0371, 0.131, 0.2588, 0.4016, 0.5451, 0.679, 0.7967, 0.8947, 0.9716, 1.0283, 1.0667, 1.0892, 1.099, 1.099, 1.092, 1.0806, 1.0669, 1.0524, 1.0384, 1.0258, 1.015, 1.0063, 0.9997, 0.995, 0.992, 0.9904, 0.99, 0.9904, 0.9913, 0.9926, 0.9941, 0.9955, 0.9968, 0.998, 0.999, 0.9997, 1.0003, 1.0007, 1.0009, 1)",
616
+ fallback: "cubic-bezier(.34,1.2,0,1.12)",
617
+ duration: ".6s"
618
+ }
619
+ };
620
+ function parseColor(input) {
621
+ const s = input.trim().toLowerCase();
622
+ if (s === "transparent") return { r: 0, g: 0, b: 0, a: 0 };
623
+ let m = /^#([0-9a-f]{3})$/.exec(s);
624
+ if (m) {
625
+ const h = m[1];
626
+ return { r: parseInt(h[0] + h[0], 16), g: parseInt(h[1] + h[1], 16), b: parseInt(h[2] + h[2], 16), a: 1 };
627
+ }
628
+ m = /^#([0-9a-f]{6})$/.exec(s);
629
+ if (m) {
630
+ const h = m[1];
631
+ return { r: parseInt(h.slice(0, 2), 16), g: parseInt(h.slice(2, 4), 16), b: parseInt(h.slice(4, 6), 16), a: 1 };
632
+ }
633
+ m = /^rgba?\(\s*([\d.]+)[\s,]+([\d.]+)[\s,]+([\d.]+)(?:\s*[,/]\s*([\d.]+%?))?\s*\)$/.exec(s);
634
+ if (m) {
635
+ const alpha = m[4] === void 0 ? 1 : m[4].endsWith("%") ? parseFloat(m[4]) / 100 : parseFloat(m[4]);
636
+ return { r: parseFloat(m[1]), g: parseFloat(m[2]), b: parseFloat(m[3]), a: alpha };
637
+ }
638
+ return null;
639
+ }
640
+ function mustParse(c) {
641
+ const p = parseColor(c);
642
+ if (!p) throw new Error(`glasTokens: not a plain colour: ${c}`);
643
+ return p;
644
+ }
645
+ var clamp255 = (v) => Math.max(0, Math.min(255, v));
646
+ function toHex(c) {
647
+ const h = (v) => Math.round(clamp255(v)).toString(16).padStart(2, "0");
648
+ return `#${h(c.r)}${h(c.g)}${h(c.b)}`.toUpperCase();
649
+ }
650
+ function compositeOver(fg, bg) {
651
+ const f = mustParse(fg), b = mustParse(bg);
652
+ return toHex({ r: f.r * f.a + b.r * (1 - f.a), g: f.g * f.a + b.g * (1 - f.a), b: f.b * f.a + b.b * (1 - f.a) });
653
+ }
654
+ function relativeLuminance(color) {
655
+ const c = mustParse(color);
656
+ const lin = (v) => {
657
+ const x = v / 255;
658
+ return x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
659
+ };
660
+ return 0.2126 * lin(c.r) + 0.7152 * lin(c.g) + 0.0722 * lin(c.b);
661
+ }
662
+ function contrastRatio(a, b) {
663
+ const la = relativeLuminance(a), lb = relativeLuminance(b);
664
+ return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05);
665
+ }
666
+ function hslToHex(h, s, l) {
667
+ const hh = (h % 360 + 360) % 360, ss = s / 100, ll = l / 100;
668
+ const k = (n) => (n + hh / 30) % 12;
669
+ const a = ss * Math.min(ll, 1 - ll);
670
+ const f = (n) => ll - a * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));
671
+ return toHex({ r: f(0) * 255, g: f(8) * 255, b: f(4) * 255 });
672
+ }
673
+ function glassOver(backdrop, mode, tint) {
674
+ const m = MATERIAL[mode];
675
+ const b = mustParse(backdrop);
676
+ const lit = toHex({ r: b.r * m.bright, g: b.g * m.bright, b: b.b * m.bright });
677
+ const [r, g, bb] = m.rgb.split(" ").map(Number);
678
+ const alpha = Math.min(1, m.a1 + 0.4 * tint);
679
+ return compositeOver(`rgba(${r},${g},${bb},${alpha})`, lit);
680
+ }
681
+ function sheetOver(backdrop, mode) {
682
+ const s = SHEET[mode];
683
+ const b = mustParse(backdrop);
684
+ return compositeOver(s.bottom, toHex({ r: b.r * s.bright, g: b.g * s.bright, b: b.b * s.bright }));
685
+ }
686
+ function windowGround(mode, scrim, page) {
687
+ return sheetOver(compositeOver(scrim, page), mode);
688
+ }
689
+ function resolveMix(input) {
690
+ const m = /^color-mix\(in srgb,\s*([^,]+?)\s+([\d.]+)%,\s*([^,]+?)\s*\)$/.exec(input.trim());
691
+ if (!m) return toHex(mustParse(input));
692
+ const a = mustParse(m[1]), b = mustParse(m[3]), p = parseFloat(m[2]) / 100;
693
+ return toHex({ r: a.r * p + b.r * (1 - p), g: a.g * p + b.g * (1 - p), b: a.b * p + b.b * (1 - p) });
694
+ }
695
+ function atAlpha(color, alpha) {
696
+ const p = mustParse(color);
697
+ return `rgba(${p.r},${p.g},${p.b},${alpha})`;
698
+ }
699
+ var NEUTRAL_DARK = "#1C1C1E";
700
+ var DEFAULT_ACCENT = {
701
+ light: { accent: "#FF9500", accentInk: "#A64B00", tabInk: "#A64B00", accentSoft: "rgba(255,149,0,.16)", prominent: "#FF9500", onProminent: "#1C1C1E", focus: "#A64B00" },
702
+ dark: { accent: "#FF9F0A", accentInk: "#FFB340", tabInk: "#FFB340", accentSoft: "rgba(255,159,10,.26)", prominent: "#FF9F0A", onProminent: "#1C1C1E", focus: "#FFB340" }
703
+ };
704
+ function bestOn(bg) {
705
+ return contrastRatio("#FFFFFF", bg) >= contrastRatio(NEUTRAL_DARK, bg) ? "#FFFFFF" : NEUTRAL_DARK;
706
+ }
707
+ function inkFor(start, mode, against, darken, lighten) {
708
+ let c = mustParse(start);
709
+ const worst = () => Math.min(...against.map((b) => contrastRatio(toHex(c), b)));
710
+ for (let i = 0; i < 40 && worst() < 4.5; i++) {
711
+ c = mode === "light" ? { r: c.r * darken, g: c.g * darken, b: c.b * darken, a: 1 } : { r: c.r + (255 - c.r) * lighten, g: c.g + (255 - c.g) * lighten, b: c.b + (255 - c.b) * lighten, a: 1 };
712
+ }
713
+ return toHex(c);
714
+ }
715
+ function inkSurfaces(mode, accentSoft) {
716
+ const c = GLAS_COLORS[mode];
717
+ const win = windowGround(mode, c.scrim, c.bg);
718
+ return mode === "light" ? [c.bg, compositeOver(c.fill, c.card), compositeOver(c.fill, c.bg), compositeOver(accentSoft, c.card), win, compositeOver(accentSoft, win)] : [c.card, c.card2, compositeOver(c.fill, c.card), compositeOver(accentSoft, c.card), compositeOver(accentSoft, c.group), win, compositeOver(accentSoft, win)];
719
+ }
720
+ function glasAccent(hue, mode) {
721
+ if (hue === void 0 || !Number.isFinite(hue)) {
722
+ const d = DEFAULT_ACCENT[mode];
723
+ return { ...d, onAccentInk: bestOn(d.accentInk) };
724
+ }
725
+ const accent = hslToHex(hue, 78, mode === "light" ? 50 : 60);
726
+ const a = mustParse(accent);
727
+ const accentSoft = `rgba(${a.r},${a.g},${a.b},${mode === "light" ? ".16" : ".26"})`;
728
+ const accentInk = inkFor(accent, mode, inkSurfaces(mode, accentSoft), 0.9, 0.12);
729
+ const tabInk = inkFor(accentInk, mode, [GLAS_COLORS[mode].lens], 0.93, 0.1);
730
+ let prominent = accent, onProminent = NEUTRAL_DARK;
731
+ if (contrastRatio(NEUTRAL_DARK, accent) < 4.5) {
732
+ if (contrastRatio("#FFFFFF", accent) >= 4.5) onProminent = "#FFFFFF";
733
+ else {
734
+ prominent = accentInk;
735
+ onProminent = bestOn(accentInk);
736
+ }
737
+ }
738
+ return { accent, accentInk, tabInk, accentSoft, prominent, onProminent, onAccentInk: bestOn(accentInk), focus: accentInk };
739
+ }
740
+ function focusPair(focus, card) {
741
+ if (contrastRatio(focus, card) >= 9) return "transparent";
742
+ return contrastRatio("#000000", card) >= contrastRatio("#FFFFFF", card) ? "#000000" : "#FFFFFF";
743
+ }
744
+ function adjustedColors(input) {
745
+ const c = { ...GLAS_COLORS[input.mode] };
746
+ const light = input.mode === "light";
747
+ if (input.contrastMore) {
748
+ c.label2 = c.glassLabel2;
749
+ c.sep = light ? "rgba(60,60,67,.5)" : "rgba(84,84,88,.95)";
750
+ c.sepStrong = light ? "rgba(60,60,67,.7)" : "rgba(160,160,168,.9)";
751
+ } else if (input.strength === "opaque") {
752
+ c.label2 = c.glassLabel2;
753
+ c.sep = light ? "rgba(60,60,67,.36)" : "rgba(84,84,88,.9)";
754
+ }
755
+ return c;
756
+ }
757
+ function glasThemeTokens(input) {
758
+ const c = adjustedColors(input);
759
+ const a = glasAccent(input.accentHue, input.mode);
760
+ const light = input.mode === "light";
761
+ return {
762
+ bg: c.bg,
763
+ bgRaised: c.card,
764
+ bgCard: c.card,
765
+ bgCardHover: c.cardHover,
766
+ bgSubtle: c.fill,
767
+ text: c.label,
768
+ textDim: c.label2,
769
+ textFaint: input.contrastMore ? c.glassLabel2 : c.textFaint,
770
+ accent: a.accentInk,
771
+ accentSoft: a.accentSoft,
772
+ onAccent: a.onAccentInk,
773
+ line: c.sep,
774
+ // Plan K14: not `transparent` (GLAS-DESIGN §2.6) — HAPulse also uses --border for control outlines, switch-off
775
+ // tracks and gauge/progress tracks, which would vanish. Cards are made borderless in styles/glas/base.css.
776
+ border: c.fillSolid,
777
+ positive: c.greenInk,
778
+ positiveSoft: c.greenSoft,
779
+ warning: c.warnInk,
780
+ warningSoft: c.warnSoft,
781
+ danger: c.redInk,
782
+ dangerSoft: c.redSoft,
783
+ info: c.blueInk,
784
+ infoSoft: c.blueSoft,
785
+ shadowCard: light ? "0 .5px 1px rgba(0,0,0,.04)" : "none",
786
+ shadowElevated: light ? "0 1px 2px rgba(0,0,0,.08), 0 12px 32px rgba(0,0,0,.14)" : "0 1px 2px rgba(0,0,0,.3), 0 12px 32px rgba(0,0,0,.5)",
787
+ shadowActive: light ? "0 1px 2px rgba(0,0,0,.04), 0 4px 14px rgba(0,0,0,.06)" : "none"
788
+ };
789
+ }
790
+ var kebab = (s) => s.replace(/([a-z0-9])([A-Z])/g, "$1-$2").replace(/([a-zA-Z])(\d)/g, "$1-$2").toLowerCase();
791
+ var classicTokenVar = (key) => `--${kebab(key)}`;
792
+ var glasColorVar = (key) => `--g-${kebab(key)}`;
793
+ function glasCssVars(input) {
794
+ const out = {};
795
+ const tokens = glasThemeTokens(input);
796
+ for (const k of Object.keys(tokens)) out[classicTokenVar(k)] = tokens[k];
797
+ const c = adjustedColors(input);
798
+ for (const k of Object.keys(c)) out[glasColorVar(k)] = c[k];
799
+ const a = glasAccent(input.accentHue, input.mode);
800
+ out["--g-accent"] = a.accent;
801
+ out["--g-accent-ink"] = a.accentInk;
802
+ out["--g-tab-ink"] = a.tabInk;
803
+ out["--g-accent-soft"] = a.accentSoft;
804
+ out["--g-prominent"] = a.prominent;
805
+ out["--g-on-prominent"] = a.onProminent;
806
+ out["--g-focus"] = a.focus;
807
+ out["--g-focus-pair"] = focusPair(a.focus, c.card);
808
+ const m = MATERIAL[input.mode];
809
+ const light = input.mode === "light";
810
+ out["--g-glass-tint"] = String(input.strength === "opaque" ? 1 : GLAS_TINT[input.strength]);
811
+ out["--g-glass-rgb"] = m.rgb;
812
+ out["--g-glass-a0"] = String(m.a0);
813
+ out["--g-glass-a1"] = String(m.a1);
814
+ out["--g-glass-sat"] = m.sat;
815
+ out["--g-glass-bright"] = String(m.bright);
816
+ out["--g-glass-rim"] = m.rim;
817
+ out["--g-glass-inner"] = m.inner;
818
+ out["--g-glass-shadow"] = `${m.inner}, ${m.outer}`;
819
+ out["--g-glass-clear-fill"] = CLEAR.fill;
820
+ out["--g-glass-clear-text-fill"] = CLEAR.textFill;
821
+ out["--g-glass-clear-filter"] = CLEAR.filter;
822
+ out["--g-glass-clear-rim"] = CLEAR.rim;
823
+ out["--g-glass-clear-shadow"] = CLEAR.shadow;
824
+ out["--g-glass-clear-text-shadow"] = CLEAR.textShadow;
825
+ out["--g-glass-opaque-shadow"] = input.contrastMore ? light ? "0 0 0 1px #000000, 0 10px 30px rgba(0,0,0,.12)" : "0 0 0 1px #FFFFFF" : `0 0 0 1px ${c.sepStrong}, 0 10px 30px rgba(0,0,0,.12)`;
826
+ out["--g-glass-opaque-clear-fill"] = "rgba(0,0,0,.72)";
827
+ out["--g-glass-opaque-clear-shadow"] = input.contrastMore ? "0 0 0 1px rgba(255,255,255,.7)" : "0 0 0 1px rgba(255,255,255,.35)";
828
+ for (const surface of Object.keys(GLAS_SURFACE_TINT)) {
829
+ if (surface === "default") continue;
830
+ out[`--g-tint-${kebab(surface)}`] = String(input.strength === "opaque" ? 1 : GLAS_SURFACE_TINT[surface][input.strength]);
831
+ }
832
+ out["--g-sheet-fill"] = SHEET[input.mode].fill;
833
+ out["--g-sheet-filter"] = SHEET[input.mode].filter;
834
+ for (const name of Object.keys(GLAS_SHADOWS)) out[`--g-shadow-${name}`] = GLAS_SHADOWS[name];
835
+ const windowShadows = GLAS_WINDOW_SHADOWS[input.mode];
836
+ for (const name of Object.keys(windowShadows)) out[`--g-shadow-${kebab(name)}`] = windowShadows[name];
837
+ out["--g-pill-open-ink"] = openPillInk(input.mode, c);
838
+ for (const name of ["smooth", "snappy", "bouncy"]) {
839
+ const s = GLAS_SPRINGS[name];
840
+ out[`--g-spring-${name}`] = input.supportsLinear === false ? s.fallback : s.linear;
841
+ out[`--g-d-${name}`] = s.duration;
842
+ }
843
+ return out;
844
+ }
845
+ function glasContrastPairs(input) {
846
+ const c = adjustedColors(input);
847
+ const t = glasThemeTokens(input);
848
+ const a = glasAccent(input.accentHue, input.mode);
849
+ const light = input.mode === "light";
850
+ const surfaces = { bg: c.bg, card: c.card, card2: c.card2, fillOnCard: compositeOver(c.fill, c.card) };
851
+ const pairs = [];
852
+ for (const [sName, s] of Object.entries(surfaces)) {
853
+ pairs.push({ name: `text on ${sName}`, fg: t.text, bg: s, min: 4.5 });
854
+ pairs.push({ name: `textDim on ${sName}`, fg: t.textDim, bg: s, min: 4.5 });
855
+ pairs.push({ name: `textFaint on ${sName}`, fg: t.textFaint, bg: s, min: 4.5 });
856
+ pairs.push({ name: `accent (ink) on ${sName}`, fg: t.accent, bg: s, min: 4.5 });
857
+ }
858
+ if (light) {
859
+ pairs.push({ name: "textDim on fill over bg", fg: t.textDim, bg: compositeOver(c.fill, c.bg), min: 4.5 });
860
+ pairs.push({ name: "accent (ink) on fill over bg", fg: t.accent, bg: compositeOver(c.fill, c.bg), min: 4.5 });
861
+ } else {
862
+ pairs.push({ name: "textFaint on fill over card2", fg: t.textFaint, bg: compositeOver(c.fill, c.card2), min: 4 });
863
+ }
864
+ for (const ink of ["yellowInk", "orangeInk", "tealInk", "greenInk", "redInk", "blueInk", "purpleInk", "indigoInk"]) {
865
+ pairs.push({ name: `${ink} on card`, fg: c[ink], bg: c.card, min: 4.5 });
866
+ pairs.push({ name: `${ink} on bg`, fg: c[ink], bg: c.bg, min: 4.5 });
867
+ }
868
+ for (const [ink, soft] of [["yellowInk", "yellowSoft"], ["orangeInk", "orangeSoft"], ["tealInk", "tealSoft"], ["greenInk", "greenSoft"], ["redInk", "redSoft"], ["blueInk", "blueSoft"]]) {
869
+ pairs.push({ name: `${ink} on ${soft} over card`, fg: c[ink], bg: compositeOver(c[soft], c.card), min: 4.5 });
870
+ }
871
+ pairs.push({ name: "onAccent on accent (classic names)", fg: t.onAccent, bg: t.accent, min: 4.5 });
872
+ pairs.push({ name: "onProminent on prominent", fg: a.onProminent, bg: a.prominent, min: 4.5 });
873
+ pairs.push({ name: "tabInk on lens (opaque, also the active symbol of the sidebar)", fg: a.tabInk, bg: c.lens, min: 4.5 });
874
+ pairs.push({ name: "accent ink on accentSoft over card", fg: a.accentInk, bg: compositeOver(a.accentSoft, c.card), min: 4.5 });
875
+ pairs.push({ name: "focus ring beside its inner tone on a picture (the card colour)", fg: a.focus, bg: c.card, min: 3 });
876
+ const pair = focusPair(a.focus, c.card);
877
+ pairs.push(pair === "transparent" ? { name: "ring on a picture: focus colour and card colour (C40)", fg: a.focus, bg: c.card, min: 9 } : { name: "ring on a picture: card colour and its counter-tone (C40)", fg: pair, bg: c.card, min: 9 });
878
+ if (input.strength !== "opaque") {
879
+ const tint = GLAS_TINT[input.strength];
880
+ for (const back of light ? ["#FFFFFF", "#F2F2F7", "#808080"] : ["#000000", "#1C1C1E", "#2C2C2E"]) {
881
+ const g = glassOver(back, input.mode, tint);
882
+ pairs.push({ name: `label on glass over ${back}`, fg: c.label, bg: g, min: 4.5 });
883
+ pairs.push({ name: `glassLabel2 on glass over ${back}`, fg: c.glassLabel2, bg: g, min: 4.5 });
884
+ }
885
+ }
886
+ return [
887
+ ...pairs,
888
+ ...mediaContrastPairs(),
889
+ ...frameContrastPairs(input, c, a),
890
+ ...windowContrastPairs(input, c, a),
891
+ ...homeContrastPairs(c, a),
892
+ ...pagesContrastPairs(c, a)
893
+ ];
894
+ }
895
+ function mediaContrastPairs() {
896
+ const shade = 0.35 * (1 - 38 / 76);
897
+ const white = compositeOver(`rgba(0,0,0,${shade})`, "#FFFFFF");
898
+ return [{ name: "camera name on clear text glass over a white picture under the top shade", fg: "#FFFFFF", bg: compositeOver(CLEAR.textFill, white), min: 4.5 }];
899
+ }
900
+ function openPillInk(mode, c) {
901
+ return mode === "light" ? c.redInk : c.label;
902
+ }
903
+ function windowContrastPairs(input, c, a) {
904
+ const pairs = [];
905
+ for (const fg of ["label", "label2", "redInk", "greenInk", "tealInk", "blueInk", "yellowInk", "orangeInk"]) {
906
+ pairs.push({ name: `${fg} on group`, fg: c[fg], bg: c.group, min: 4.5 });
907
+ }
908
+ pairs.push({ name: "accent ink on group", fg: a.accentInk, bg: c.group, min: 4.5 });
909
+ pairs.push({ name: "accent ink on accentSoft over group (alarm mode)", fg: a.accentInk, bg: compositeOver(a.accentSoft, c.group), min: 4.5 });
910
+ pairs.push({ name: "label on accentSoft over group (alarm mode)", fg: c.label, bg: compositeOver(a.accentSoft, c.group), min: 4.5 });
911
+ pairs.push({ name: '"open" pill text on redSoft over group', fg: openPillInk(input.mode, c), bg: compositeOver(c.redSoft, c.group), min: 4.5 });
912
+ pairs.push({ name: 'label2 on fill over group ("closed" pill)', fg: c.label2, bg: compositeOver(c.fill, c.group), min: 4.5 });
913
+ pairs.push({ name: "label on fill over group (secondary button)", fg: c.label, bg: compositeOver(c.fill, c.group), min: 4.5 });
914
+ for (const act of ["actDel", "actOk", "actNeutral"]) {
915
+ pairs.push({ name: `white on ${act}`, fg: "#FFFFFF", bg: c[act], min: 4.5 });
916
+ }
917
+ pairs.push({ name: "white play glyph on blue", fg: "#FFFFFF", bg: c.blue, min: 3 });
918
+ if (input.strength !== "opaque") {
919
+ const light = input.mode === "light";
920
+ const backs = light ? ["#FFFFFF", "#F2F2F7", "#808080"] : ["#000000", "#1C1C1E", "#2C2C2E"];
921
+ const tint = GLAS_SURFACE_TINT.inspector[input.strength];
922
+ for (const back of backs) {
923
+ const g = glassOver(back, input.mode, tint);
924
+ pairs.push({ name: `label on inspector glass over ${back}`, fg: c.label, bg: g, min: 4.5 });
925
+ pairs.push({ name: `glassLabel2 on inspector glass over ${back}`, fg: c.glassLabel2, bg: g, min: 4.5 });
926
+ }
927
+ const windows = [["sheet", c.scrim], ["dialog", c.scrimDesktop], ["context menu", c.ctxDim]];
928
+ for (const [win, scrim] of windows) {
929
+ for (const back of backs) {
930
+ const g = windowGround(input.mode, scrim, back);
931
+ pairs.push({ name: `label on the ${win} over the scrimmed ${back}`, fg: c.label, bg: g, min: 4.5 });
932
+ pairs.push({ name: `glassLabel2 on the ${win} over the scrimmed ${back}`, fg: c.glassLabel2, bg: g, min: 4.5 });
933
+ }
934
+ for (const back of light ? ["#FFFFFF", "#F2F2F7"] : ["#000000", "#1C1C1E"]) {
935
+ const g = windowGround(input.mode, scrim, back);
936
+ for (const ink of ["redInk", "greenInk", "tealInk", "blueInk", "yellowInk", "orangeInk", "warnInk", "purpleInk", "indigoInk"]) {
937
+ pairs.push({ name: `${ink} on the ${win} over the scrimmed ${back}`, fg: c[ink], bg: g, min: 4.5 });
938
+ }
939
+ pairs.push({ name: `accent ink on the ${win} over the scrimmed ${back}`, fg: a.accentInk, bg: g, min: 4.5 });
940
+ pairs.push({ name: `accent ink on accentSoft (selected chip) on the ${win} over the scrimmed ${back}`, fg: a.accentInk, bg: compositeOver(a.accentSoft, g), min: 4.5 });
941
+ }
942
+ }
943
+ }
944
+ return pairs;
945
+ }
946
+ function homeContrastPairs(c, a) {
947
+ const pairs = [];
948
+ const tileOff = resolveMix(c.tileOff);
949
+ for (const [name, tile] of [["tileOff", tileOff], ["tileOn", resolveMix(c.tileOn)]]) {
950
+ pairs.push({ name: `label on ${name}`, fg: c.label, bg: tile, min: 4.5 });
951
+ pairs.push({ name: `label2 on ${name}`, fg: c.label2, bg: tile, min: 4.5 });
952
+ }
953
+ pairs.push({ name: "tileOffLabel on tileOff (device off)", fg: c.tileOffLabel, bg: tileOff, min: 4.5 });
954
+ const circleOff = compositeOver(c.fill, tileOff);
955
+ pairs.push({ name: "label2 glyph in the grey circle (device off)", fg: c.label2, bg: circleOff, min: 3 });
956
+ for (const ink of ["yellowInk", "orangeInk", "tealInk", "purpleInk", "indigoInk", "blueInk"]) {
957
+ pairs.push({ name: `${ink} glyph in the grey circle (scene off)`, fg: c[ink], bg: circleOff, min: 3 });
958
+ }
959
+ const onCircle = [["yellow", "glyphDark"], ["orange", "glyphDark"], ["teal", "glyphDark"], ["green", "glyphDark"], ["purple", "onBadge"], ["indigo", "onBadge"], ["blue", "onBadge"]];
960
+ for (const [tone, glyph] of onCircle) {
961
+ pairs.push({ name: `${glyph} glyph on ${tone} (scene or device on)`, fg: c[glyph], bg: c[tone], min: 3 });
962
+ }
963
+ pairs.push({ name: "grid bars on card", fg: c.chartNetz, bg: c.card, min: 3 });
964
+ const solarEdge = (parseColor(c.chartSolarEdge)?.a ?? 0) > 0 ? c.chartSolarEdge : c.chartSolar;
965
+ pairs.push({ name: "solar bars (their edge) on card", fg: solarEdge, bg: c.card, min: 3 });
966
+ pairs.push({ name: "average line on card", fg: compositeOver(atAlpha(c.chartAvg, 0.7), c.card), bg: c.card, min: 3 });
967
+ for (const [name, fill, ink] of [["accent", a.accent, a.accentInk], ["orange", c.orange, c.orangeInk], ["blue", c.blue, c.blueInk]]) {
968
+ pairs.push({ name: `${name} chart line on group`, fg: ink, bg: c.group, min: 3 });
969
+ pairs.push({ name: `${name} chart line on its area over group`, fg: ink, bg: compositeOver(atAlpha(fill, 0.22), c.group), min: 3 });
970
+ }
971
+ return pairs;
972
+ }
973
+ function pagesContrastPairs(c, a) {
974
+ const pairs = [];
975
+ for (const [name, under] of [["card", c.card], ["bg", c.bg]]) {
976
+ const field = compositeOver(c.fill, under);
977
+ pairs.push({ name: `field text (label) on fill over ${name}`, fg: c.label, bg: field, min: 4.5 });
978
+ pairs.push({ name: `field placeholder (label2) on fill over ${name}`, fg: c.label2, bg: field, min: 4.5 });
979
+ }
980
+ pairs.push({ name: "chosen pill (accentInk on accentSoft over card)", fg: a.accentInk, bg: compositeOver(a.accentSoft, c.card), min: 4.5 });
981
+ pairs.push({ name: "warnInk on card", fg: c.warnInk, bg: c.card, min: 4.5 });
982
+ pairs.push({ name: "warnInk on warnSoft over card (motion pill)", fg: c.warnInk, bg: compositeOver(c.warnSoft, c.card), min: 4.5 });
983
+ pairs.push({ name: "label on seg (segment lens)", fg: c.label, bg: c.seg, min: 4.5 });
984
+ pairs.push({ name: "glyphDark on teal (hours of an on window, pool schedule editor)", fg: c.glyphDark, bg: c.teal, min: 4.5 });
985
+ pairs.push({ name: "group on label (time at the dragged handle)", fg: c.group, bg: c.label, min: 4.5 });
986
+ const tile = compositeOver(c.fill, c.card);
987
+ for (const [ink, soft] of [["blueInk", "blueSoft"], ["greenInk", "greenSoft"], ["yellowInk", "yellowSoft"], ["redInk", "redSoft"]]) {
988
+ pairs.push({ name: `${ink} glyph on ${soft} over fill over card (energy tile)`, fg: c[ink], bg: compositeOver(c[soft], tile), min: 3 });
989
+ }
990
+ pairs.push({ name: "blueInk on blueSoft over card (playing zone tile badge, the card under it)", fg: c.blueInk, bg: compositeOver(c.blueSoft, c.card), min: 4.5 });
991
+ pairs.push({ name: "label on accentSoft over card (chosen player: name and state)", fg: c.label, bg: compositeOver(a.accentSoft, c.card), min: 4.5 });
992
+ pairs.push({ name: "label glyph on fillSolid (library item more)", fg: c.label, bg: c.fillSolid, min: 3 });
993
+ pairs.push({ name: "yellowInk glyph on fillSolid (library favourite star)", fg: c.yellowInk, bg: c.fillSolid, min: 3 });
994
+ pairs.push({ name: "glyphDark on knob (library play)", fg: c.glyphDark, bg: c.knob, min: 3 });
995
+ pairs.push({ name: "yellowInk glyph on yellowSoft over group (device window favourite)", fg: c.yellowInk, bg: compositeOver(c.yellowSoft, c.group), min: 3 });
996
+ pairs.push({ name: "bg glyph on label (eye of a hidden entity or card)", fg: c.bg, bg: c.label, min: 3 });
997
+ for (const ink of ["greenInk", "blueInk", "tealInk"]) {
998
+ pairs.push({ name: `${ink} glyph on fill over card (hero stats)`, fg: c[ink], bg: compositeOver(c.fill, c.card), min: 3 });
999
+ }
1000
+ for (const ink of ["orangeInk", "redInk"]) {
1001
+ pairs.push({ name: `${ink} glyph on fill over card (battery symbol)`, fg: c[ink], bg: compositeOver(c.fill, c.card), min: 3 });
1002
+ }
1003
+ for (const soft of ["greenSoft", "warnSoft", "redSoft"]) {
1004
+ const chip = compositeOver(c.fill, compositeOver(atAlpha(c[soft], mustParse(c[soft]).a / 2), c.card));
1005
+ pairs.push({ name: `label2 on fill over the ${soft} wash (hero chip)`, fg: c.label2, bg: chip, min: 4.5 });
1006
+ for (const ink of ["warnInk", "redInk"]) {
1007
+ pairs.push({ name: `${ink} glyph on fill over the ${soft} wash (hero chip dot or symbol)`, fg: c[ink], bg: chip, min: 3 });
1008
+ }
1009
+ }
1010
+ return pairs;
1011
+ }
1012
+ function frameContrastPairs(input, c, a) {
1013
+ const light = input.mode === "light";
1014
+ const mode = input.mode;
1015
+ const pairs = [];
1016
+ const backs = light ? ["#FFFFFF", "#F2F2F7", "#808080"] : ["#000000", "#1C1C1E", "#2C2C2E"];
1017
+ const rest = light ? ["#FFFFFF", "#F2F2F7"] : ["#000000", "#1C1C1E"];
1018
+ if (input.strength !== "opaque") {
1019
+ const strength = input.strength;
1020
+ const t = (surface) => GLAS_SURFACE_TINT[surface][strength];
1021
+ for (const back of backs) {
1022
+ const tab = glassOver(back, mode, t("tabBar"));
1023
+ const side = glassOver(back, mode, t("sidebar"));
1024
+ const menu = glassOver(back, mode, t("menu"));
1025
+ const toast = glassOver(back, mode, t("toastDesktop"));
1026
+ pairs.push({ name: `tab label on tab bar over ${back}`, fg: c.label, bg: tab, min: 4.5 });
1027
+ pairs.push({ name: `glassLabel2 on sidebar over ${back}`, fg: c.glassLabel2, bg: side, min: 4.5 });
1028
+ pairs.push({ name: `glassLabel2 on fill over sidebar over ${back}`, fg: c.glassLabel2, bg: compositeOver(c.fill, side), min: 4.5 });
1029
+ pairs.push({ name: `label on fill over sidebar over ${back}`, fg: c.label, bg: compositeOver(c.fill, side), min: 4.5 });
1030
+ pairs.push({ name: `menu text on menu glass over ${back}`, fg: c.label, bg: menu, min: 4.5 });
1031
+ pairs.push({ name: `glassLabel2 on menu glass over ${back}`, fg: c.glassLabel2, bg: menu, min: 4.5 });
1032
+ pairs.push({ name: `label on desktop toast over ${back}`, fg: c.label, bg: toast, min: 4.5 });
1033
+ }
1034
+ for (const back of rest) {
1035
+ const menu = glassOver(back, mode, t("menu"));
1036
+ pairs.push({ name: `accent ink ("dismiss all") on menu glass over ${back}`, fg: a.accentInk, bg: menu, min: 4.5 });
1037
+ pairs.push({ name: `accent ink (current row, "on" symbol) on the phone menu over the scrimmed ${back}`, fg: a.accentInk, bg: windowGround(mode, c.scrim, back), min: 4.5 });
1038
+ pairs.push({ name: `redInk on desktop toast over ${back}`, fg: c.redInk, bg: glassOver(back, mode, t("toastDesktop")), min: 4.5 });
1039
+ pairs.push({ name: `focus ring on glass over ${back}`, fg: a.focus, bg: glassOver(back, mode, GLAS_TINT[strength]), min: 3 });
1040
+ const dimmed = sheetOver(compositeOver(c.ctxDim, back), mode);
1041
+ const scrimmed = glassOver(compositeOver(c.ctxScrimDesktop, back), mode, t("menu"));
1042
+ pairs.push({ name: `label on the context menu over the dimmed ${back}`, fg: c.label, bg: dimmed, min: 4.5 });
1043
+ pairs.push({ name: `redInk ("hide") on the context menu over the dimmed ${back}`, fg: c.redInk, bg: dimmed, min: 4.5 });
1044
+ pairs.push({ name: `label on the desktop context menu over the scrimmed ${back}`, fg: c.label, bg: scrimmed, min: 4.5 });
1045
+ pairs.push({ name: `redInk ("hide") on the desktop context menu over the scrimmed ${back}`, fg: c.redInk, bg: scrimmed, min: 4.5 });
1046
+ }
1047
+ for (const back of light ? ["#FFFFFF", "#F2F2F7", "#808080"] : ["#000000", "#1C1C1E", "#FFFFFF"]) {
1048
+ pairs.push({ name: `menu text on sheet over ${back}`, fg: c.label, bg: sheetOver(back, mode), min: 4.5 });
1049
+ pairs.push({ name: `glassLabel2 on sheet over ${back}`, fg: c.glassLabel2, bg: sheetOver(back, mode), min: 4.5 });
1050
+ }
1051
+ }
1052
+ for (const back of ["#FFFFFF", "#808080", "#000000"]) {
1053
+ pairs.push({ name: `toast text on toast over ${back}`, fg: c.toastText, bg: compositeOver(c.toastBg, back), min: 4.5 });
1054
+ }
1055
+ pairs.push({ name: "banner text on reconnecting", fg: c.label, bg: resolveMix(c.bannerReconnecting), min: 4.5 });
1056
+ pairs.push({ name: "banner text on lost", fg: c.label, bg: resolveMix(c.bannerLost), min: 4.5 });
1057
+ pairs.push({ name: "onBadge on badge", fg: c.onBadge, bg: c.badge, min: 4.5 });
1058
+ for (const s of ["green", "yellow", "red", "gray"]) {
1059
+ pairs.push({ name: `glyphDark on ${s} (status pill, devices hero)`, fg: c.glyphDark, bg: c[s], min: 4.5 });
1060
+ }
1061
+ return pairs;
1062
+ }
1063
+
1064
+ export {
1065
+ THEME_NAMES,
1066
+ THEME_LABELS,
1067
+ THEMES,
1068
+ resolveThemeMode,
1069
+ accentOverride,
1070
+ TOKEN_TO_VAR,
1071
+ resolveMode,
1072
+ isThemeName,
1073
+ applyTheme,
1074
+ watchSystemMode,
1075
+ UI_STYLES,
1076
+ GLAS_STRENGTHS,
1077
+ GLAS_COLORS,
1078
+ GLAS_TINT,
1079
+ GLAS_SURFACE_TINT,
1080
+ GLAS_SHADOWS,
1081
+ GLAS_WINDOW_SHADOWS,
1082
+ GLAS_SPRINGS,
1083
+ parseColor,
1084
+ toHex,
1085
+ compositeOver,
1086
+ relativeLuminance,
1087
+ contrastRatio,
1088
+ hslToHex,
1089
+ glassOver,
1090
+ sheetOver,
1091
+ windowGround,
1092
+ resolveMix,
1093
+ glasAccent,
1094
+ focusPair,
1095
+ glasThemeTokens,
1096
+ classicTokenVar,
1097
+ glasColorVar,
1098
+ glasCssVars,
1099
+ glasContrastPairs
1100
+ };
1101
+ /*! Theme tokens derived from HAPulse (https://github.com/jlnbln/HAPulse) — MIT License, Copyright (c) 2026 Julian */
1102
+ //# sourceMappingURL=chunk-Z5USWUIE.js.map