@takazudo/zdtp 0.4.12 → 0.4.13
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/CHANGELOG.md +75 -27
- package/PORTABLE-CONTRACT.md +30 -1
- package/README.md +3 -3
- package/dist/astro/host-adapter.js +3 -3
- package/dist/astro/index.js +1 -1
- package/dist/{autoload-state-CTDDBxI8.js → autoload-state-CfL2VUe1.js} +1 -1
- package/dist/components/palette-chart/palette-chart.d.ts +14 -3
- package/dist/{index-C8GR1TU-.js → index-BAY1JOUl.js} +2 -2
- package/dist/index-U7Ol7tgA.js +7591 -0
- package/dist/index.js +6 -6
- package/dist/{panel-config-7Xg59uKj.js → panel-config-COHesW2B.js} +4 -0
- package/dist/tabs/palette/palette-check-view.d.ts +0 -13
- package/dist/testing.js +2 -2
- package/dist/tokens/tier-model.d.ts +7 -5
- package/dist/{tweak-state-DRKV1uYj.js → tweak-state-BKNxtHzb.js} +259 -237
- package/dist/utils/color-oklch.d.ts +13 -0
- package/dist/zdtp.css +1 -1
- package/package.json +1 -1
- package/dist/index-BeYH-tJD.js +0 -7582
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as mt, g, k as yt, l as bt, h as xt, d as Mt, n as
|
|
2
|
-
const
|
|
1
|
+
import { r as mt, g, k as yt, l as bt, h as xt, d as Mt, n as Z, o as Q, p as Ae, q as Pe, t as kt, e as vt, u as St, v as B, f as wt, w as _e, x as $t, y as Nt } from "./panel-config-COHesW2B.js";
|
|
2
|
+
const Le = (e, t) => {
|
|
3
3
|
if (typeof e == "number") {
|
|
4
4
|
if (t === 3)
|
|
5
5
|
return {
|
|
@@ -32,7 +32,7 @@ const je = (e, t) => {
|
|
|
32
32
|
alpha: (e & 255) / 255
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
},
|
|
35
|
+
}, Ct = {
|
|
36
36
|
aliceblue: 15792383,
|
|
37
37
|
antiquewhite: 16444375,
|
|
38
38
|
aqua: 65535,
|
|
@@ -183,10 +183,10 @@ const je = (e, t) => {
|
|
|
183
183
|
whitesmoke: 16119285,
|
|
184
184
|
yellow: 16776960,
|
|
185
185
|
yellowgreen: 10145074
|
|
186
|
-
},
|
|
186
|
+
}, Tt = (e) => Le(Ct[e.toLowerCase()], 6), It = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i, Ot = (e) => {
|
|
187
187
|
let t;
|
|
188
|
-
return (t = e.match(It)) ?
|
|
189
|
-
}, w = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", H = `${w}%`, ke = `(?:${w}%|${w})`,
|
|
188
|
+
return (t = e.match(It)) ? Le(parseInt(t[1], 16), t[1].length) : void 0;
|
|
189
|
+
}, w = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)", H = `${w}%`, ke = `(?:${w}%|${w})`, At = `(?:${w}(deg|grad|rad|turn)|${w})`, I = "\\s*,\\s*", Pt = new RegExp(
|
|
190
190
|
`^rgba?\\(\\s*${w}${I}${w}${I}${w}\\s*(?:,\\s*${ke}\\s*)?\\)$`
|
|
191
191
|
), _t = new RegExp(
|
|
192
192
|
`^rgba?\\(\\s*${H}${I}${H}${I}${H}\\s*(?:,\\s*${ke}\\s*)?\\)$`
|
|
@@ -199,7 +199,7 @@ const je = (e, t) => {
|
|
|
199
199
|
else
|
|
200
200
|
return;
|
|
201
201
|
return n[4] !== void 0 ? t.alpha = Math.max(0, Math.min(1, n[4] / 100)) : n[5] !== void 0 && (t.alpha = Math.max(0, Math.min(1, +n[5]))), t;
|
|
202
|
-
}, G = (e, t) => e === void 0 ? void 0 : typeof e != "object" ?
|
|
202
|
+
}, G = (e, t) => e === void 0 ? void 0 : typeof e != "object" ? Se(e) : e.mode !== void 0 ? e : t ? { ...e, mode: t } : void 0, x = (e = "rgb") => (t) => (t = G(t, e)) !== void 0 ? (
|
|
203
203
|
// if the color's mode corresponds to our target mode
|
|
204
204
|
t.mode === e ? (
|
|
205
205
|
// then just return the color
|
|
@@ -222,7 +222,7 @@ const je = (e, t) => {
|
|
|
222
222
|
)
|
|
223
223
|
)
|
|
224
224
|
)
|
|
225
|
-
) : void 0, M = {}, ze = {}, q = [],
|
|
225
|
+
) : void 0, M = {}, ze = {}, q = [], De = {}, Et = (e) => e, ve = (e) => (M[e.mode] = {
|
|
226
226
|
...M[e.mode],
|
|
227
227
|
...e.toMode
|
|
228
228
|
}, Object.keys(e.fromMode || {}).forEach((t) => {
|
|
@@ -235,13 +235,13 @@ const je = (e, t) => {
|
|
|
235
235
|
}), e.interpolate[t].fixup || (e.interpolate[t].fixup = Et);
|
|
236
236
|
}), ze[e.mode] = e, (e.parse || []).forEach((t) => {
|
|
237
237
|
Vt(t, e.mode);
|
|
238
|
-
}), x(e.mode)),
|
|
238
|
+
}), x(e.mode)), ee = (e) => ze[e], Vt = (e, t) => {
|
|
239
239
|
if (typeof e == "string") {
|
|
240
240
|
if (!t)
|
|
241
241
|
throw new Error("'mode' required when 'parser' is a string");
|
|
242
|
-
|
|
242
|
+
De[e] = t;
|
|
243
243
|
} else typeof e == "function" && q.indexOf(e) < 0 && q.push(e);
|
|
244
|
-
},
|
|
244
|
+
}, le = /[^\x00-\x7F]|[a-zA-Z_]/, Ft = /[^\x00-\x7F]|[-\w]/, l = {
|
|
245
245
|
Function: "function",
|
|
246
246
|
Ident: "ident",
|
|
247
247
|
Number: "number",
|
|
@@ -252,25 +252,25 @@ const je = (e, t) => {
|
|
|
252
252
|
Alpha: "alpha"
|
|
253
253
|
};
|
|
254
254
|
let c = 0;
|
|
255
|
-
function
|
|
255
|
+
function j(e) {
|
|
256
256
|
let t = e[c], n = e[c + 1];
|
|
257
257
|
return t === "-" || t === "+" ? /\d/.test(n) || n === "." && /\d/.test(e[c + 2]) : t === "." ? /\d/.test(n) : /\d/.test(t);
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function ue(e) {
|
|
260
260
|
if (c >= e.length)
|
|
261
261
|
return !1;
|
|
262
262
|
let t = e[c];
|
|
263
|
-
if (
|
|
263
|
+
if (le.test(t))
|
|
264
264
|
return !0;
|
|
265
265
|
if (t === "-") {
|
|
266
266
|
if (e.length - c < 2)
|
|
267
267
|
return !1;
|
|
268
268
|
let n = e[c + 1];
|
|
269
|
-
return !!(n === "-" ||
|
|
269
|
+
return !!(n === "-" || le.test(n));
|
|
270
270
|
}
|
|
271
271
|
return !1;
|
|
272
272
|
}
|
|
273
|
-
const
|
|
273
|
+
const Rt = {
|
|
274
274
|
deg: 1,
|
|
275
275
|
rad: 180 / Math.PI,
|
|
276
276
|
grad: 9 / 10,
|
|
@@ -278,13 +278,13 @@ const jt = {
|
|
|
278
278
|
};
|
|
279
279
|
function P(e) {
|
|
280
280
|
let t = "";
|
|
281
|
-
if ((e[c] === "-" || e[c] === "+") && (t += e[c++]), t +=
|
|
281
|
+
if ((e[c] === "-" || e[c] === "+") && (t += e[c++]), t += L(e), e[c] === "." && /\d/.test(e[c + 1]) && (t += e[c++] + L(e)), (e[c] === "e" || e[c] === "E") && ((e[c + 1] === "-" || e[c + 1] === "+") && /\d/.test(e[c + 2]) ? t += e[c++] + e[c++] + L(e) : /\d/.test(e[c + 1]) && (t += e[c++] + L(e))), ue(e)) {
|
|
282
282
|
let n = W(e);
|
|
283
|
-
return n === "deg" || n === "rad" || n === "turn" || n === "grad" ? { type: l.Hue, value: t *
|
|
283
|
+
return n === "deg" || n === "rad" || n === "turn" || n === "grad" ? { type: l.Hue, value: t * Rt[n] } : void 0;
|
|
284
284
|
}
|
|
285
285
|
return e[c] === "%" ? (c++, { type: l.Percentage, value: +t }) : { type: l.Number, value: +t };
|
|
286
286
|
}
|
|
287
|
-
function
|
|
287
|
+
function L(e) {
|
|
288
288
|
let t = "";
|
|
289
289
|
for (; /\d/.test(e[c]); )
|
|
290
290
|
t += e[c++];
|
|
@@ -292,15 +292,15 @@ function F(e) {
|
|
|
292
292
|
}
|
|
293
293
|
function W(e) {
|
|
294
294
|
let t = "";
|
|
295
|
-
for (; c < e.length &&
|
|
295
|
+
for (; c < e.length && Ft.test(e[c]); )
|
|
296
296
|
t += e[c++];
|
|
297
297
|
return t;
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function jt(e) {
|
|
300
300
|
let t = W(e);
|
|
301
301
|
return e[c] === "(" ? (c++, { type: l.Function, value: t }) : t === "none" ? { type: l.None, value: void 0 } : { type: l.Ident, value: t };
|
|
302
302
|
}
|
|
303
|
-
function
|
|
303
|
+
function Lt(e = "") {
|
|
304
304
|
let t = e.trim(), n = [], r;
|
|
305
305
|
for (c = 0; c < t.length; ) {
|
|
306
306
|
if (r = t[c++], r === `
|
|
@@ -317,25 +317,25 @@ function Ft(e = "") {
|
|
|
317
317
|
continue;
|
|
318
318
|
}
|
|
319
319
|
if (r === "+") {
|
|
320
|
-
if (c--,
|
|
320
|
+
if (c--, j(t)) {
|
|
321
321
|
n.push(P(t));
|
|
322
322
|
continue;
|
|
323
323
|
}
|
|
324
324
|
return;
|
|
325
325
|
}
|
|
326
326
|
if (r === "-") {
|
|
327
|
-
if (c--,
|
|
327
|
+
if (c--, j(t)) {
|
|
328
328
|
n.push(P(t));
|
|
329
329
|
continue;
|
|
330
330
|
}
|
|
331
|
-
if (
|
|
331
|
+
if (ue(t)) {
|
|
332
332
|
n.push({ type: l.Ident, value: W(t) });
|
|
333
333
|
continue;
|
|
334
334
|
}
|
|
335
335
|
return;
|
|
336
336
|
}
|
|
337
337
|
if (r === ".") {
|
|
338
|
-
if (c--,
|
|
338
|
+
if (c--, j(t)) {
|
|
339
339
|
n.push(P(t));
|
|
340
340
|
continue;
|
|
341
341
|
}
|
|
@@ -346,11 +346,11 @@ function Ft(e = "") {
|
|
|
346
346
|
` || t[c] === " " || t[c] === " "); )
|
|
347
347
|
c++;
|
|
348
348
|
let o;
|
|
349
|
-
if (
|
|
349
|
+
if (j(t) && (o = P(t), o.type !== l.Hue)) {
|
|
350
350
|
n.push({ type: l.Alpha, value: o });
|
|
351
351
|
continue;
|
|
352
352
|
}
|
|
353
|
-
if (
|
|
353
|
+
if (ue(t) && W(t) === "none") {
|
|
354
354
|
n.push({
|
|
355
355
|
type: l.Alpha,
|
|
356
356
|
value: { type: l.None, value: void 0 }
|
|
@@ -363,31 +363,31 @@ function Ft(e = "") {
|
|
|
363
363
|
c--, n.push(P(t));
|
|
364
364
|
continue;
|
|
365
365
|
}
|
|
366
|
-
if (
|
|
367
|
-
c--, n.push(
|
|
366
|
+
if (le.test(r)) {
|
|
367
|
+
c--, n.push(jt(t));
|
|
368
368
|
continue;
|
|
369
369
|
}
|
|
370
370
|
return;
|
|
371
371
|
}
|
|
372
372
|
return n;
|
|
373
373
|
}
|
|
374
|
-
function
|
|
374
|
+
function zt(e) {
|
|
375
375
|
e._i = 0;
|
|
376
376
|
let t = e[e._i++];
|
|
377
377
|
if (!t || t.type !== l.Function || t.value !== "color" || (t = e[e._i++], t.type !== l.Ident))
|
|
378
378
|
return;
|
|
379
|
-
const n =
|
|
379
|
+
const n = De[t.value];
|
|
380
380
|
if (!n)
|
|
381
381
|
return;
|
|
382
|
-
const r = { mode: n }, o =
|
|
382
|
+
const r = { mode: n }, o = Ke(e, !1);
|
|
383
383
|
if (!o)
|
|
384
384
|
return;
|
|
385
|
-
const i =
|
|
385
|
+
const i = ee(n).channels;
|
|
386
386
|
for (let a = 0, s, f; a < i.length; a++)
|
|
387
387
|
s = o[a], f = i[a], s.type !== l.None && (r[f] = s.type === l.Number ? s.value : s.value / 100, f === "alpha" && (r[f] = Math.max(0, Math.min(1, r[f]))));
|
|
388
388
|
return r;
|
|
389
389
|
}
|
|
390
|
-
function
|
|
390
|
+
function Ke(e, t) {
|
|
391
391
|
const n = [];
|
|
392
392
|
let r;
|
|
393
393
|
for (; e._i < e.length; ) {
|
|
@@ -416,19 +416,19 @@ function Dt(e, t) {
|
|
|
416
416
|
let n = e[e._i++];
|
|
417
417
|
if (!n || n.type !== l.Function)
|
|
418
418
|
return;
|
|
419
|
-
let r =
|
|
419
|
+
let r = Ke(e, t);
|
|
420
420
|
if (r)
|
|
421
421
|
return r.unshift(n.value), r;
|
|
422
422
|
}
|
|
423
|
-
const
|
|
423
|
+
const Se = (e) => {
|
|
424
424
|
if (typeof e != "string")
|
|
425
425
|
return;
|
|
426
|
-
const t =
|
|
426
|
+
const t = Lt(e), n = t ? Dt(t, !0) : void 0;
|
|
427
427
|
let r, o = 0, i = q.length;
|
|
428
428
|
for (; o < i; )
|
|
429
429
|
if ((r = q[o++](e, n)) !== void 0)
|
|
430
430
|
return r;
|
|
431
|
-
return t ?
|
|
431
|
+
return t ? zt(t) : void 0;
|
|
432
432
|
};
|
|
433
433
|
function Kt(e, t) {
|
|
434
434
|
if (!t || t[0] !== "rgb" && t[0] !== "rgba")
|
|
@@ -456,7 +456,7 @@ const Bt = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
456
456
|
let o = r * n.length, i = r >= 1 ? n.length - 1 : Math.max(Math.floor(o), 0), a = n[i];
|
|
457
457
|
return a === void 0 ? void 0 : e(a[0], a[1], o - i);
|
|
458
458
|
};
|
|
459
|
-
}, y = Wt(Gt),
|
|
459
|
+
}, y = Wt(Gt), we = (e) => {
|
|
460
460
|
let t = !1, n = e.map((r) => r !== void 0 ? (t = !0, r) : 1);
|
|
461
461
|
return t ? n : e;
|
|
462
462
|
}, Jt = {
|
|
@@ -464,9 +464,9 @@ const Bt = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
464
464
|
channels: ["r", "g", "b", "alpha"],
|
|
465
465
|
parse: [
|
|
466
466
|
Kt,
|
|
467
|
-
|
|
467
|
+
Ot,
|
|
468
468
|
Ht,
|
|
469
|
-
|
|
469
|
+
Tt,
|
|
470
470
|
Bt,
|
|
471
471
|
"srgb"
|
|
472
472
|
],
|
|
@@ -475,31 +475,31 @@ const Bt = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
475
475
|
r: y,
|
|
476
476
|
g: y,
|
|
477
477
|
b: y,
|
|
478
|
-
alpha: { use: y, fixup:
|
|
478
|
+
alpha: { use: y, fixup: we }
|
|
479
479
|
},
|
|
480
480
|
gamut: !0,
|
|
481
481
|
white: { r: 1, g: 1, b: 1 },
|
|
482
482
|
black: { r: 0, g: 0, b: 0 }
|
|
483
|
-
},
|
|
483
|
+
}, re = (e = 0) => {
|
|
484
484
|
const t = Math.abs(e);
|
|
485
485
|
return t <= 0.04045 ? e / 12.92 : (Math.sign(e) || 1) * Math.pow((t + 0.055) / 1.055, 2.4);
|
|
486
|
-
},
|
|
486
|
+
}, Be = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
487
487
|
let o = {
|
|
488
488
|
mode: "lrgb",
|
|
489
|
-
r:
|
|
490
|
-
g:
|
|
491
|
-
b:
|
|
489
|
+
r: re(e),
|
|
490
|
+
g: re(t),
|
|
491
|
+
b: re(n)
|
|
492
492
|
};
|
|
493
493
|
return r !== void 0 && (o.alpha = r), o;
|
|
494
|
-
},
|
|
494
|
+
}, oe = (e = 0) => {
|
|
495
495
|
const t = Math.abs(e);
|
|
496
496
|
return t > 31308e-7 ? (Math.sign(e) || 1) * (1.055 * Math.pow(t, 1 / 2.4) - 0.055) : e * 12.92;
|
|
497
|
-
},
|
|
497
|
+
}, Ge = ({ r: e, g: t, b: n, alpha: r }, o = "rgb") => {
|
|
498
498
|
let i = {
|
|
499
499
|
mode: o,
|
|
500
|
-
r:
|
|
501
|
-
g:
|
|
502
|
-
b:
|
|
500
|
+
r: oe(e),
|
|
501
|
+
g: oe(t),
|
|
502
|
+
b: oe(n)
|
|
503
503
|
};
|
|
504
504
|
return r !== void 0 && (i.alpha = r), i;
|
|
505
505
|
}, $ = (e) => (e = e % 360) < 0 ? e + 360 : e, Xt = (e, t) => e.map((n, r, o) => {
|
|
@@ -507,7 +507,7 @@ const Bt = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
507
507
|
return n;
|
|
508
508
|
let i = $(n);
|
|
509
509
|
return r === 0 || e[r - 1] === void 0 ? i : t(i - $(o[r - 1]));
|
|
510
|
-
}).reduce((n, r) => !n.length || r === void 0 || n[n.length - 1] === void 0 ? (n.push(r), n) : (n.push(r + n[n.length - 1]), n), []),
|
|
510
|
+
}).reduce((n, r) => !n.length || r === void 0 || n[n.length - 1] === void 0 ? (n.push(r), n) : (n.push(r + n[n.length - 1]), n), []), qe = (e) => Xt(e, (t) => Math.abs(t) <= 180 ? t : t - 360 * Math.sign(t)), Yt = (e, t) => {
|
|
511
511
|
if (e.h === void 0 || t.h === void 0 || !e.s || !t.s)
|
|
512
512
|
return 0;
|
|
513
513
|
let n = $(e.h), r = $(t.h), o = Math.sin((r - n + 360) / 2 * Math.PI / 180);
|
|
@@ -517,7 +517,7 @@ const Bt = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
517
517
|
return 0;
|
|
518
518
|
let n = $(e.h), r = $(t.h), o = Math.sin((r - n + 360) / 2 * Math.PI / 180);
|
|
519
519
|
return 2 * Math.sqrt(e.c * t.c) * o;
|
|
520
|
-
},
|
|
520
|
+
}, We = (e) => {
|
|
521
521
|
let t = e.reduce(
|
|
522
522
|
(r, o) => {
|
|
523
523
|
if (o !== void 0) {
|
|
@@ -542,7 +542,7 @@ const Bt = (e) => e === "transparent" ? { mode: "rgb", r: 0, g: 0, b: 0, alpha:
|
|
|
542
542
|
b: t ? t * Math.sin(n / 180 * Math.PI) : 0
|
|
543
543
|
};
|
|
544
544
|
return r !== void 0 && (i.alpha = r), i;
|
|
545
|
-
},
|
|
545
|
+
}, T = {
|
|
546
546
|
X: 0.3457 / 0.3585,
|
|
547
547
|
Y: 1,
|
|
548
548
|
Z: (1 - 0.3457 - 0.3585) / 0.3585
|
|
@@ -595,7 +595,7 @@ const en = (e, t) => {
|
|
|
595
595
|
return e * 360;
|
|
596
596
|
}
|
|
597
597
|
}, tn = new RegExp(
|
|
598
|
-
`^hsla?\\(\\s*${
|
|
598
|
+
`^hsla?\\(\\s*${At}${I}${H}${I}${H}\\s*(?:,\\s*${ke}\\s*)?\\)$`
|
|
599
599
|
), nn = (e) => {
|
|
600
600
|
let t = e.match(tn);
|
|
601
601
|
if (!t) return;
|
|
@@ -645,47 +645,47 @@ const on = {
|
|
|
645
645
|
parse: [rn, nn],
|
|
646
646
|
serialize: (e) => `hsl(${e.h !== void 0 ? e.h : "none"} ${e.s !== void 0 ? e.s * 100 + "%" : "none"} ${e.l !== void 0 ? e.l * 100 + "%" : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
647
647
|
interpolate: {
|
|
648
|
-
h: { use: y, fixup:
|
|
648
|
+
h: { use: y, fixup: qe },
|
|
649
649
|
s: y,
|
|
650
650
|
l: y,
|
|
651
|
-
alpha: { use: y, fixup:
|
|
651
|
+
alpha: { use: y, fixup: we }
|
|
652
652
|
},
|
|
653
653
|
difference: {
|
|
654
654
|
h: Yt
|
|
655
655
|
},
|
|
656
656
|
average: {
|
|
657
|
-
h:
|
|
657
|
+
h: We
|
|
658
658
|
}
|
|
659
|
-
},
|
|
660
|
-
let
|
|
659
|
+
}, Je = Math.pow(29, 3) / Math.pow(3, 3), Xe = Math.pow(6, 3) / Math.pow(29, 3);
|
|
660
|
+
let ie = (e) => Math.pow(e, 3) > Xe ? Math.pow(e, 3) : (116 * e - 16) / Je;
|
|
661
661
|
const an = ({ l: e, a: t, b: n, alpha: r }) => {
|
|
662
662
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
663
663
|
let o = (e + 16) / 116, i = t / 500 + o, a = o - n / 200, s = {
|
|
664
664
|
mode: "xyz50",
|
|
665
|
-
x:
|
|
666
|
-
y:
|
|
667
|
-
z:
|
|
665
|
+
x: ie(i) * T.X,
|
|
666
|
+
y: ie(o) * T.Y,
|
|
667
|
+
z: ie(a) * T.Z
|
|
668
668
|
};
|
|
669
669
|
return r !== void 0 && (s.alpha = r), s;
|
|
670
670
|
}, sn = ({ x: e, y: t, z: n, alpha: r }) => {
|
|
671
671
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
672
|
-
let o =
|
|
672
|
+
let o = Ge({
|
|
673
673
|
r: e * 3.1341359569958707 - t * 1.6173863321612538 - 0.4906619460083532 * n,
|
|
674
674
|
g: e * -0.978795502912089 + t * 1.916254567259524 + 0.03344273116131949 * n,
|
|
675
675
|
b: e * 0.07195537988411677 - t * 0.2289768264158322 + 1.405386058324125 * n
|
|
676
676
|
});
|
|
677
677
|
return r !== void 0 && (o.alpha = r), o;
|
|
678
678
|
}, fn = (e) => sn(an(e)), ln = (e) => {
|
|
679
|
-
let { r: t, g: n, b: r, alpha: o } =
|
|
679
|
+
let { r: t, g: n, b: r, alpha: o } = Be(e), i = {
|
|
680
680
|
mode: "xyz50",
|
|
681
681
|
x: 0.436065742824811 * t + 0.3851514688337912 * n + 0.14307845442264197 * r,
|
|
682
682
|
y: 0.22249319175623702 * t + 0.7168870538238823 * n + 0.06061979053616537 * r,
|
|
683
683
|
z: 0.013923904500943465 * t + 0.09708128566574634 * n + 0.7140993584005155 * r
|
|
684
684
|
};
|
|
685
685
|
return o !== void 0 && (i.alpha = o), i;
|
|
686
|
-
},
|
|
686
|
+
}, ae = (e) => e > Xe ? Math.cbrt(e) : (Je * e + 16) / 116, un = ({ x: e, y: t, z: n, alpha: r }) => {
|
|
687
687
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
688
|
-
let o =
|
|
688
|
+
let o = ae(e / T.X), i = ae(t / T.Y), a = ae(n / T.Z), s = {
|
|
689
689
|
mode: "lab",
|
|
690
690
|
l: 116 * i - 16,
|
|
691
691
|
a: 500 * (o - i),
|
|
@@ -740,16 +740,16 @@ const hn = {
|
|
|
740
740
|
parse: [dn],
|
|
741
741
|
serialize: (e) => `lch(${e.l !== void 0 ? e.l : "none"} ${e.c !== void 0 ? e.c : "none"} ${e.h !== void 0 ? e.h : "none"}${e.alpha < 1 ? ` / ${e.alpha}` : ""})`,
|
|
742
742
|
interpolate: {
|
|
743
|
-
h: { use: y, fixup:
|
|
743
|
+
h: { use: y, fixup: qe },
|
|
744
744
|
c: y,
|
|
745
745
|
l: y,
|
|
746
|
-
alpha: { use: y, fixup:
|
|
746
|
+
alpha: { use: y, fixup: we }
|
|
747
747
|
},
|
|
748
748
|
difference: {
|
|
749
749
|
h: Ut
|
|
750
750
|
},
|
|
751
751
|
average: {
|
|
752
|
-
h:
|
|
752
|
+
h: We
|
|
753
753
|
}
|
|
754
754
|
}, pn = ({ r: e, g: t, b: n, alpha: r }) => {
|
|
755
755
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
@@ -767,7 +767,7 @@ const hn = {
|
|
|
767
767
|
};
|
|
768
768
|
return r !== void 0 && (s.alpha = r), s;
|
|
769
769
|
}, gn = (e) => {
|
|
770
|
-
let t = pn(
|
|
770
|
+
let t = pn(Be(e));
|
|
771
771
|
return e.r === e.b && e.b === e.g && (t.a = t.b = 0), t;
|
|
772
772
|
}, mn = ({ l: e, a: t, b: n, alpha: r }) => {
|
|
773
773
|
e === void 0 && (e = 0), t === void 0 && (t = 0), n === void 0 && (n = 0);
|
|
@@ -778,7 +778,7 @@ const hn = {
|
|
|
778
778
|
b: -0.0041960761386756 * o - 0.7034186179359362 * i + 1.7076146940746117 * a
|
|
779
779
|
};
|
|
780
780
|
return r !== void 0 && (s.alpha = r), s;
|
|
781
|
-
}, yn = (e) =>
|
|
781
|
+
}, yn = (e) => Ge(mn(e));
|
|
782
782
|
function bn(e, t) {
|
|
783
783
|
if (!t || t[0] !== "oklch")
|
|
784
784
|
return;
|
|
@@ -825,7 +825,7 @@ const xn = {
|
|
|
825
825
|
c: [0, 0.4],
|
|
826
826
|
h: [0, 360]
|
|
827
827
|
}
|
|
828
|
-
}, Mn = (e) => Math.max(0, Math.min(1, e || 0)), D = (e) => Math.round(Mn(e) * 255),
|
|
828
|
+
}, Mn = (e) => Math.max(0, Math.min(1, e || 0)), D = (e) => Math.round(Mn(e) * 255), Ye = x("rgb"), Ue = (e) => {
|
|
829
829
|
if (e === void 0)
|
|
830
830
|
return;
|
|
831
831
|
let t = D(e.r), n = D(e.g), r = D(e.b);
|
|
@@ -834,8 +834,8 @@ const xn = {
|
|
|
834
834
|
if (e === void 0)
|
|
835
835
|
return;
|
|
836
836
|
let t = D(e.alpha !== void 0 ? e.alpha : 1);
|
|
837
|
-
return
|
|
838
|
-
}, vn = (e) => Ye(
|
|
837
|
+
return Ue(e) + (256 | t).toString(16).slice(1);
|
|
838
|
+
}, vn = (e) => Ue(Ye(e)), Sn = (e) => kn(Ye(e)), Ze = x("rgb"), Qe = (e) => {
|
|
839
839
|
const t = {
|
|
840
840
|
mode: e.mode,
|
|
841
841
|
r: Math.max(0, Math.min(e.r !== void 0 ? e.r : 0, 1)),
|
|
@@ -843,22 +843,22 @@ const xn = {
|
|
|
843
843
|
b: Math.max(0, Math.min(e.b !== void 0 ? e.b : 0, 1))
|
|
844
844
|
};
|
|
845
845
|
return e.alpha !== void 0 && (t.alpha = e.alpha), t;
|
|
846
|
-
}, wn = (e) => Ze(
|
|
846
|
+
}, wn = (e) => Qe(Ze(e)), et = (e) => e !== void 0 && (e.r === void 0 || e.r >= 0 && e.r <= 1) && (e.g === void 0 || e.g >= 0 && e.g <= 1) && (e.b === void 0 || e.b >= 0 && e.b <= 1);
|
|
847
847
|
function $n(e) {
|
|
848
|
-
return
|
|
848
|
+
return et(Ze(e));
|
|
849
849
|
}
|
|
850
|
-
function
|
|
851
|
-
const { gamut: t } =
|
|
850
|
+
function $e(e = "rgb") {
|
|
851
|
+
const { gamut: t } = ee(e);
|
|
852
852
|
if (!t)
|
|
853
853
|
return (r) => !0;
|
|
854
854
|
const n = x(typeof t == "string" ? t : e);
|
|
855
|
-
return (r) =>
|
|
855
|
+
return (r) => et(n(r));
|
|
856
856
|
}
|
|
857
857
|
function Nn(e = "rgb") {
|
|
858
|
-
const { gamut: t } =
|
|
858
|
+
const { gamut: t } = ee(e);
|
|
859
859
|
if (!t)
|
|
860
860
|
return (i) => G(i);
|
|
861
|
-
const n = typeof t == "string" ? t : e, r = x(n), o =
|
|
861
|
+
const n = typeof t == "string" ? t : e, r = x(n), o = $e(n);
|
|
862
862
|
return (i) => {
|
|
863
863
|
const a = G(i);
|
|
864
864
|
if (!a)
|
|
@@ -866,20 +866,20 @@ function Nn(e = "rgb") {
|
|
|
866
866
|
const s = r(a);
|
|
867
867
|
if (o(s))
|
|
868
868
|
return a;
|
|
869
|
-
const f =
|
|
869
|
+
const f = Qe(s);
|
|
870
870
|
return a.mode === f.mode ? f : x(a.mode)(f);
|
|
871
871
|
};
|
|
872
872
|
}
|
|
873
|
-
function
|
|
873
|
+
function Cn(e, t = "lch", n = "rgb") {
|
|
874
874
|
e = G(e);
|
|
875
|
-
let r = n === "rgb" ? $n :
|
|
875
|
+
let r = n === "rgb" ? $n : $e(n), o = n === "rgb" ? wn : Nn(n);
|
|
876
876
|
if (e === void 0 || r(e)) return e;
|
|
877
877
|
let i = x(e.mode);
|
|
878
878
|
e = x(t)(e);
|
|
879
879
|
let a = { ...e, c: 0 };
|
|
880
880
|
if (!r(a))
|
|
881
881
|
return i(o(a));
|
|
882
|
-
let s = 0, f = e.c !== void 0 ? e.c : 0, u =
|
|
882
|
+
let s = 0, f = e.c !== void 0 ? e.c : 0, u = ee(t).ranges.c, d = (u[1] - u[0]) / Math.pow(2, 13), h = a.c;
|
|
883
883
|
for (; f - s > d; )
|
|
884
884
|
a.c = s + (f - s) * 0.5, r(a) ? (h = a.c, s = a.c) : f = a.c;
|
|
885
885
|
return i(
|
|
@@ -889,8 +889,8 @@ function Tn(e, t = "lch", n = "rgb") {
|
|
|
889
889
|
ve(xn);
|
|
890
890
|
ve(Jt);
|
|
891
891
|
ve(on);
|
|
892
|
-
const cr = 0.37,
|
|
893
|
-
function
|
|
892
|
+
const cr = 0.37, Ne = x("oklch"), tt = x("rgb"), Tn = x("hsl"), In = $e("rgb");
|
|
893
|
+
function te(e) {
|
|
894
894
|
return {
|
|
895
895
|
mode: "oklch",
|
|
896
896
|
l: e.l / 100,
|
|
@@ -899,7 +899,7 @@ function ee(e) {
|
|
|
899
899
|
alpha: e.a / 100
|
|
900
900
|
};
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function On(e) {
|
|
903
903
|
return {
|
|
904
904
|
l: (e.l ?? 0) * 100,
|
|
905
905
|
c: e.c ?? 0,
|
|
@@ -917,9 +917,9 @@ function dr(e) {
|
|
|
917
917
|
function hr(e) {
|
|
918
918
|
const t = { l: 0, c: 0, h: 0, a: 100 };
|
|
919
919
|
try {
|
|
920
|
-
const n =
|
|
920
|
+
const n = Se(e);
|
|
921
921
|
if (!n) return t;
|
|
922
|
-
const r =
|
|
922
|
+
const r = Ne(n);
|
|
923
923
|
if (!r) return t;
|
|
924
924
|
const o = r.alpha === void 0 ? 1 : r.alpha;
|
|
925
925
|
return {
|
|
@@ -933,11 +933,11 @@ function hr(e) {
|
|
|
933
933
|
}
|
|
934
934
|
}
|
|
935
935
|
function pr(e, t) {
|
|
936
|
-
const n =
|
|
936
|
+
const n = te(e), r = tt(n);
|
|
937
937
|
return r ? e.a < 100 ? Sn({ ...r, alpha: e.a / 100 }) ?? "#000000ff" : vn(r) ?? "#000000" : "#000000";
|
|
938
938
|
}
|
|
939
939
|
function gr(e) {
|
|
940
|
-
const t =
|
|
940
|
+
const t = te(e), n = Tn(t);
|
|
941
941
|
return n ? {
|
|
942
942
|
h: n.h ?? 0,
|
|
943
943
|
s: (n.s ?? 0) * 100,
|
|
@@ -952,11 +952,11 @@ function mr(e) {
|
|
|
952
952
|
s: e.s / 100,
|
|
953
953
|
l: e.l / 100,
|
|
954
954
|
alpha: e.a / 100
|
|
955
|
-
}, n =
|
|
956
|
-
return n ?
|
|
955
|
+
}, n = Ne(t);
|
|
956
|
+
return n ? On(n) : { l: 0, c: 0, h: 0, a: e.a };
|
|
957
957
|
}
|
|
958
958
|
function yr(e) {
|
|
959
|
-
const t =
|
|
959
|
+
const t = te(e), n = Cn(t, "oklch", "rgb");
|
|
960
960
|
return n ? {
|
|
961
961
|
l: (n.l ?? e.l / 100) * 100,
|
|
962
962
|
c: n.c ?? 0,
|
|
@@ -965,10 +965,31 @@ function yr(e) {
|
|
|
965
965
|
} : { l: e.l, c: 0, h: e.h, a: e.a };
|
|
966
966
|
}
|
|
967
967
|
function br(e) {
|
|
968
|
-
const t = tt(
|
|
968
|
+
const t = tt(te(e));
|
|
969
969
|
return t ? In(t) : !1;
|
|
970
970
|
}
|
|
971
|
-
function
|
|
971
|
+
function xr(e) {
|
|
972
|
+
const t = e.trim();
|
|
973
|
+
if (!t) return null;
|
|
974
|
+
if (/^oklch\s*\(/i.test(t))
|
|
975
|
+
return Y(t);
|
|
976
|
+
try {
|
|
977
|
+
const n = Se(t.toLowerCase());
|
|
978
|
+
if (!n) return null;
|
|
979
|
+
const r = Ne(n);
|
|
980
|
+
return !r || !Number.isFinite(r.l) || !Number.isFinite(r.c) || r.h !== void 0 && !Number.isFinite(r.h) || r.alpha !== void 0 && !Number.isFinite(r.alpha) ? null : {
|
|
981
|
+
l: r.l * 100,
|
|
982
|
+
c: r.c,
|
|
983
|
+
// Culori omits hue for achromatic colors; panel consumers require a
|
|
984
|
+
// finite channel, and zero is the neutral canonical representation.
|
|
985
|
+
h: r.h ?? 0,
|
|
986
|
+
a: (r.alpha ?? 1) * 100
|
|
987
|
+
};
|
|
988
|
+
} catch {
|
|
989
|
+
return null;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
function An(e, t) {
|
|
972
993
|
const n = parseFloat(e);
|
|
973
994
|
let r;
|
|
974
995
|
switch (t.toLowerCase()) {
|
|
@@ -986,7 +1007,7 @@ function On(e, t) {
|
|
|
986
1007
|
}
|
|
987
1008
|
return (r % 360 + 360) % 360;
|
|
988
1009
|
}
|
|
989
|
-
function
|
|
1010
|
+
function Y(e) {
|
|
990
1011
|
const n = e.trim().match(/^oklch\(\s*(.*?)\s*\)$/i);
|
|
991
1012
|
if (!n) return null;
|
|
992
1013
|
const o = n[1].split("/");
|
|
@@ -995,10 +1016,10 @@ function ue(e) {
|
|
|
995
1016
|
if (s.length !== 3) return null;
|
|
996
1017
|
const f = (m) => {
|
|
997
1018
|
if (m.toLowerCase() === "none") return { value: 0, isPercent: !1 };
|
|
998
|
-
const
|
|
999
|
-
if (!
|
|
1000
|
-
const
|
|
1001
|
-
return isNaN(
|
|
1019
|
+
const A = m.match(/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(%?)$/i);
|
|
1020
|
+
if (!A) return null;
|
|
1021
|
+
const R = parseFloat(A[1]);
|
|
1022
|
+
return isNaN(R) ? null : { value: R, isPercent: A[2] === "%" };
|
|
1002
1023
|
}, u = f(s[0]);
|
|
1003
1024
|
if (!u) return null;
|
|
1004
1025
|
const d = u.isPercent ? u.value : u.value * 100, h = f(s[1]);
|
|
@@ -1010,20 +1031,20 @@ function ue(e) {
|
|
|
1010
1031
|
else {
|
|
1011
1032
|
const m = k.match(/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(deg|rad|grad|turn)?$/i);
|
|
1012
1033
|
if (!m) return null;
|
|
1013
|
-
const
|
|
1014
|
-
v =
|
|
1034
|
+
const A = m[1], R = m[2] ?? "deg";
|
|
1035
|
+
v = An(A, R);
|
|
1015
1036
|
}
|
|
1016
|
-
let
|
|
1037
|
+
let O = 100;
|
|
1017
1038
|
if (a !== null) {
|
|
1018
1039
|
const m = f(a.trim());
|
|
1019
1040
|
if (!m) return null;
|
|
1020
|
-
|
|
1041
|
+
O = m.isPercent ? m.value : m.value * 100;
|
|
1021
1042
|
}
|
|
1022
1043
|
return {
|
|
1023
1044
|
l: d,
|
|
1024
1045
|
c: p,
|
|
1025
1046
|
h: v,
|
|
1026
|
-
a:
|
|
1047
|
+
a: O
|
|
1027
1048
|
};
|
|
1028
1049
|
}
|
|
1029
1050
|
function nt(e = g()) {
|
|
@@ -1035,10 +1056,10 @@ function rt(e = g()) {
|
|
|
1035
1056
|
function ot(e = g()) {
|
|
1036
1057
|
return bt(e);
|
|
1037
1058
|
}
|
|
1038
|
-
function
|
|
1059
|
+
function F(e = g()) {
|
|
1039
1060
|
return yt(e);
|
|
1040
1061
|
}
|
|
1041
|
-
function
|
|
1062
|
+
function Mr(e = g()) {
|
|
1042
1063
|
return Mt(e);
|
|
1043
1064
|
}
|
|
1044
1065
|
function it(e = g()) {
|
|
@@ -1055,7 +1076,7 @@ function _n(e = 0, t) {
|
|
|
1055
1076
|
const { top: n, left: r } = ft(e, t);
|
|
1056
1077
|
return { top: n, left: r };
|
|
1057
1078
|
}
|
|
1058
|
-
function
|
|
1079
|
+
function kr(e, t = 0, n) {
|
|
1059
1080
|
try {
|
|
1060
1081
|
const r = localStorage.getItem(it(e));
|
|
1061
1082
|
if (r) {
|
|
@@ -1067,27 +1088,27 @@ function Mr(e, t = 0, n) {
|
|
|
1067
1088
|
}
|
|
1068
1089
|
return _n(t, n);
|
|
1069
1090
|
}
|
|
1070
|
-
function
|
|
1091
|
+
function vr(e, t) {
|
|
1071
1092
|
try {
|
|
1072
1093
|
localStorage.setItem(it(t), JSON.stringify(e));
|
|
1073
1094
|
} catch {
|
|
1074
1095
|
}
|
|
1075
1096
|
}
|
|
1076
|
-
const
|
|
1097
|
+
const se = 60, He = 320, Ee = 240, ce = 1600, de = 1200, Hn = { width: 1024 * 0.8, height: 768 * 0.8 };
|
|
1077
1098
|
function En() {
|
|
1078
1099
|
const { width: e, height: t } = ft();
|
|
1079
1100
|
return { width: e, height: t };
|
|
1080
1101
|
}
|
|
1081
|
-
const
|
|
1102
|
+
const Ve = 32;
|
|
1082
1103
|
function he(e, t) {
|
|
1083
|
-
const n = typeof window < "u" ? window.innerWidth : ce, r = typeof window < "u" ? window.innerHeight : de, o = Math.max(
|
|
1104
|
+
const n = typeof window < "u" ? window.innerWidth : ce, r = typeof window < "u" ? window.innerHeight : de, o = Math.max(He, Math.min(ce, n - Ve)), i = Math.max(Ee, Math.min(de, r - Ve));
|
|
1084
1105
|
return {
|
|
1085
|
-
width: Math.max(
|
|
1086
|
-
height: Math.max(
|
|
1106
|
+
width: Math.max(He, Math.min(e, o)),
|
|
1107
|
+
height: Math.max(Ee, Math.min(t, i))
|
|
1087
1108
|
};
|
|
1088
1109
|
}
|
|
1089
1110
|
const Vn = 24;
|
|
1090
|
-
function
|
|
1111
|
+
function Fn(e) {
|
|
1091
1112
|
return Number.isFinite(e) ? Math.max(0, Math.floor(e)) : 0;
|
|
1092
1113
|
}
|
|
1093
1114
|
function ft(e = 0, t) {
|
|
@@ -1096,7 +1117,7 @@ function ft(e = 0, t) {
|
|
|
1096
1117
|
const { width: n, height: r } = t ? he(t.width, t.height) : he(
|
|
1097
1118
|
Math.min(1200, 0.8 * window.innerWidth),
|
|
1098
1119
|
Math.min(800, 0.8 * window.innerHeight)
|
|
1099
|
-
), o = Math.max(0, Math.round((window.innerHeight - r) / 2)), i = Math.max(0, Math.round((window.innerWidth - n) / 2)), a = Vn *
|
|
1120
|
+
), o = Math.max(0, Math.round((window.innerHeight - r) / 2)), i = Math.max(0, Math.round((window.innerWidth - n) / 2)), a = Vn * Fn(e), { top: s, left: f } = Rn(
|
|
1100
1121
|
o + a,
|
|
1101
1122
|
i + a,
|
|
1102
1123
|
n,
|
|
@@ -1104,14 +1125,14 @@ function ft(e = 0, t) {
|
|
|
1104
1125
|
);
|
|
1105
1126
|
return { top: s, left: f, width: n, height: r };
|
|
1106
1127
|
}
|
|
1107
|
-
function
|
|
1128
|
+
function Rn(e, t, n, r) {
|
|
1108
1129
|
const o = typeof window < "u" ? window.innerWidth : ce, i = typeof window < "u" ? window.innerHeight : de;
|
|
1109
1130
|
return {
|
|
1110
1131
|
top: Math.min(Math.max(0, e), Math.max(0, i - r)),
|
|
1111
1132
|
left: Math.min(Math.max(0, t), Math.max(0, o - n))
|
|
1112
1133
|
};
|
|
1113
1134
|
}
|
|
1114
|
-
function
|
|
1135
|
+
function Sr(e) {
|
|
1115
1136
|
try {
|
|
1116
1137
|
const t = localStorage.getItem(at(e));
|
|
1117
1138
|
if (t) {
|
|
@@ -1123,41 +1144,41 @@ function vr(e) {
|
|
|
1123
1144
|
}
|
|
1124
1145
|
return En();
|
|
1125
1146
|
}
|
|
1126
|
-
function
|
|
1147
|
+
function wr(e, t) {
|
|
1127
1148
|
try {
|
|
1128
1149
|
localStorage.setItem(at(t), JSON.stringify(e));
|
|
1129
1150
|
} catch {
|
|
1130
1151
|
}
|
|
1131
1152
|
}
|
|
1132
|
-
const
|
|
1133
|
-
function
|
|
1153
|
+
const jn = 1;
|
|
1154
|
+
function $r(e) {
|
|
1134
1155
|
return e === 0 ? "192px" : e === 2 ? "100%" : "288px";
|
|
1135
1156
|
}
|
|
1136
|
-
function
|
|
1157
|
+
function Nr(e) {
|
|
1137
1158
|
try {
|
|
1138
1159
|
const t = localStorage.getItem(st(e));
|
|
1139
1160
|
if (t === "0" || t === "1" || t === "2")
|
|
1140
1161
|
return Number(t);
|
|
1141
1162
|
} catch {
|
|
1142
1163
|
}
|
|
1143
|
-
return
|
|
1164
|
+
return jn;
|
|
1144
1165
|
}
|
|
1145
|
-
function
|
|
1166
|
+
function Cr(e, t) {
|
|
1146
1167
|
try {
|
|
1147
1168
|
localStorage.setItem(st(t), String(e));
|
|
1148
1169
|
} catch {
|
|
1149
1170
|
}
|
|
1150
1171
|
}
|
|
1151
1172
|
function Tr(e, t, n, r) {
|
|
1152
|
-
const o = -(n -
|
|
1173
|
+
const o = -(n - se), i = window.innerWidth - se, a = -30, s = window.innerHeight - se, f = Math.max(s, a), u = Math.max(i, o);
|
|
1153
1174
|
return {
|
|
1154
1175
|
top: Math.max(a, Math.min(e, f)),
|
|
1155
1176
|
left: Math.max(o, Math.min(t, u))
|
|
1156
1177
|
};
|
|
1157
1178
|
}
|
|
1158
|
-
async function
|
|
1179
|
+
async function Ir(e) {
|
|
1159
1180
|
}
|
|
1160
|
-
function
|
|
1181
|
+
function Ln(e) {
|
|
1161
1182
|
return typeof e == "number" || e === "bg" || e === "fg";
|
|
1162
1183
|
}
|
|
1163
1184
|
function pe(e) {
|
|
@@ -1166,10 +1187,10 @@ function pe(e) {
|
|
|
1166
1187
|
function ge(e) {
|
|
1167
1188
|
return pe(e) && typeof e.literal == "object" && e.literal !== null;
|
|
1168
1189
|
}
|
|
1169
|
-
function
|
|
1190
|
+
function zn(e) {
|
|
1170
1191
|
return typeof e == "object" && e !== null && "ref" in e;
|
|
1171
1192
|
}
|
|
1172
|
-
function
|
|
1193
|
+
function fe() {
|
|
1173
1194
|
return {};
|
|
1174
1195
|
}
|
|
1175
1196
|
const Dn = {
|
|
@@ -1188,7 +1209,7 @@ const Dn = {
|
|
|
1188
1209
|
function b(e = g()) {
|
|
1189
1210
|
return mt(e.tabs) ?? Dn;
|
|
1190
1211
|
}
|
|
1191
|
-
function
|
|
1212
|
+
function ne(e) {
|
|
1192
1213
|
const t = e.paletteSize;
|
|
1193
1214
|
return {
|
|
1194
1215
|
palette: Array.from({ length: t }, (r, o) => {
|
|
@@ -1205,9 +1226,9 @@ function te(e) {
|
|
|
1205
1226
|
shikiTheme: e.defaultShikiTheme
|
|
1206
1227
|
};
|
|
1207
1228
|
}
|
|
1208
|
-
function
|
|
1209
|
-
const t =
|
|
1210
|
-
return t ?
|
|
1229
|
+
function Or(e) {
|
|
1230
|
+
const t = Q(e);
|
|
1231
|
+
return t ? ne(t) : void 0;
|
|
1211
1232
|
}
|
|
1212
1233
|
function Kn() {
|
|
1213
1234
|
try {
|
|
@@ -1263,28 +1284,28 @@ function Wn(e, t) {
|
|
|
1263
1284
|
let n = Math.abs(e.h - t.h) % 360;
|
|
1264
1285
|
return n > 180 && (n = 360 - n), Math.abs(e.l - t.l) <= 1e-3 && Math.abs(e.c - t.c) <= 1e-5 && n <= 1e-3 && Math.abs(e.a - t.a) <= 1e-3;
|
|
1265
1286
|
}
|
|
1266
|
-
function
|
|
1287
|
+
function C(e, t, n) {
|
|
1267
1288
|
if (e === void 0) return n;
|
|
1268
1289
|
if (typeof e == "number") return e;
|
|
1269
1290
|
const r = t.indexOf(e);
|
|
1270
1291
|
if (r >= 0) return r;
|
|
1271
|
-
const o =
|
|
1292
|
+
const o = Y(e);
|
|
1272
1293
|
if (o)
|
|
1273
1294
|
for (let h = 0; h < t.length; h++) {
|
|
1274
|
-
const p =
|
|
1295
|
+
const p = Y(t[h]);
|
|
1275
1296
|
if (p && Wn(o, p)) return h;
|
|
1276
1297
|
}
|
|
1277
1298
|
const i = me(e), a = t.map((h) => me(h)), s = a.indexOf(i);
|
|
1278
1299
|
if (s >= 0) return s;
|
|
1279
|
-
const f =
|
|
1300
|
+
const f = Fe(i);
|
|
1280
1301
|
let u = n, d = 1 / 0;
|
|
1281
1302
|
for (let h = 0; h < a.length; h++) {
|
|
1282
|
-
const p =
|
|
1303
|
+
const p = Fe(a[h]), k = (f.r - p.r) ** 2 + (f.g - p.g) ** 2 + (f.b - p.b) ** 2;
|
|
1283
1304
|
k < d && (d = k, u = h);
|
|
1284
1305
|
}
|
|
1285
1306
|
return u;
|
|
1286
1307
|
}
|
|
1287
|
-
function
|
|
1308
|
+
function Fe(e) {
|
|
1288
1309
|
const t = e.replace("#", "");
|
|
1289
1310
|
return {
|
|
1290
1311
|
r: parseInt(t.substring(0, 2), 16) || 0,
|
|
@@ -1305,21 +1326,21 @@ function lt(e = b(), t) {
|
|
|
1305
1326
|
function Jn(e = b(), t) {
|
|
1306
1327
|
const n = e.colorSchemes;
|
|
1307
1328
|
if (Object.keys(n).length === 0)
|
|
1308
|
-
return
|
|
1329
|
+
return ne(e);
|
|
1309
1330
|
const r = lt(e, t), o = n[r] ?? Object.values(n)[0];
|
|
1310
1331
|
return Yn(o, e);
|
|
1311
1332
|
}
|
|
1312
|
-
function
|
|
1333
|
+
function Ce(e = b(), t) {
|
|
1313
1334
|
return lt(e, t);
|
|
1314
1335
|
}
|
|
1315
1336
|
function Xn(e) {
|
|
1316
|
-
return
|
|
1337
|
+
return Y(e) ? e : me(e);
|
|
1317
1338
|
}
|
|
1318
1339
|
function Yn(e, t = b()) {
|
|
1319
1340
|
if (t.paletteSize === 0)
|
|
1320
1341
|
return console.warn(
|
|
1321
1342
|
`[tweak] Scheme/preset load ignored for palette-less cluster "${t.id}" (paletteSize: 0) — schemes cannot seed a tier with no palette.`
|
|
1322
|
-
),
|
|
1343
|
+
), ne(t);
|
|
1323
1344
|
const n = e.palette.map(Xn), r = {};
|
|
1324
1345
|
for (const [o, i] of Object.entries(t.semanticDefaults)) {
|
|
1325
1346
|
const a = e.semantic?.[o];
|
|
@@ -1329,28 +1350,28 @@ function Yn(e, t = b()) {
|
|
|
1329
1350
|
r[o] = a;
|
|
1330
1351
|
else {
|
|
1331
1352
|
const s = typeof i == "number" ? i : 0;
|
|
1332
|
-
r[o] =
|
|
1353
|
+
r[o] = C(a, e.palette, s);
|
|
1333
1354
|
}
|
|
1334
1355
|
}
|
|
1335
1356
|
return {
|
|
1336
1357
|
palette: n,
|
|
1337
|
-
background:
|
|
1358
|
+
background: C(
|
|
1338
1359
|
e.background,
|
|
1339
1360
|
e.palette,
|
|
1340
1361
|
t.baseDefaults.background ?? 0
|
|
1341
1362
|
),
|
|
1342
|
-
foreground:
|
|
1363
|
+
foreground: C(
|
|
1343
1364
|
e.foreground,
|
|
1344
1365
|
e.palette,
|
|
1345
1366
|
t.baseDefaults.foreground ?? 0
|
|
1346
1367
|
),
|
|
1347
|
-
cursor:
|
|
1348
|
-
selectionBg:
|
|
1368
|
+
cursor: C(e.cursor, e.palette, t.baseDefaults.cursor ?? 0),
|
|
1369
|
+
selectionBg: C(
|
|
1349
1370
|
e.selectionBg,
|
|
1350
1371
|
e.palette,
|
|
1351
1372
|
t.baseDefaults.selectionBg ?? 0
|
|
1352
1373
|
),
|
|
1353
|
-
selectionFg:
|
|
1374
|
+
selectionFg: C(
|
|
1354
1375
|
e.selectionFg,
|
|
1355
1376
|
e.palette,
|
|
1356
1377
|
t.baseDefaults.selectionFg ?? 0
|
|
@@ -1367,11 +1388,11 @@ function E(e, t) {
|
|
|
1367
1388
|
return e >= 0 && e < t ? e : 0;
|
|
1368
1389
|
}
|
|
1369
1390
|
function ye(e, t, n, r, o, i, a) {
|
|
1370
|
-
if (
|
|
1391
|
+
if (Ln(e)) return Un(e, t, n, r);
|
|
1371
1392
|
if (pe(e) && ge(e))
|
|
1372
1393
|
return a ? e.literal[a] : `light-dark(${e.literal.light}, ${e.literal.dark})`;
|
|
1373
1394
|
if (pe(e) && !ge(e)) return e.literal;
|
|
1374
|
-
if (
|
|
1395
|
+
if (zn(e) && o)
|
|
1375
1396
|
try {
|
|
1376
1397
|
return `var(${Nt(e.ref, o, i ?? [o])})`;
|
|
1377
1398
|
} catch {
|
|
@@ -1386,7 +1407,7 @@ function Zn(e) {
|
|
|
1386
1407
|
function Ar(e, t) {
|
|
1387
1408
|
return e.literal[t];
|
|
1388
1409
|
}
|
|
1389
|
-
function
|
|
1410
|
+
function Pr(e, t, n = b(), r, o) {
|
|
1390
1411
|
return ye(
|
|
1391
1412
|
e,
|
|
1392
1413
|
t.palette,
|
|
@@ -1398,14 +1419,14 @@ function Or(e, t, n = b(), r, o) {
|
|
|
1398
1419
|
) ?? "#000000";
|
|
1399
1420
|
}
|
|
1400
1421
|
const N = "color-scheme", be = "light dark";
|
|
1401
|
-
function
|
|
1422
|
+
function U(e, t) {
|
|
1402
1423
|
for (const n of Object.keys(t.semanticCssNames)) {
|
|
1403
1424
|
const r = e.semanticMappings[n] ?? t.semanticDefaults[n];
|
|
1404
1425
|
if (r !== void 0 && ge(r)) return !0;
|
|
1405
1426
|
}
|
|
1406
1427
|
return !1;
|
|
1407
1428
|
}
|
|
1408
|
-
function
|
|
1429
|
+
function Re(e, t = b(), n, r, o, i) {
|
|
1409
1430
|
const a = e.palette.length;
|
|
1410
1431
|
if (n) {
|
|
1411
1432
|
const s = [];
|
|
@@ -1427,7 +1448,7 @@ function Ve(e, t = b(), n, r, o, i) {
|
|
|
1427
1448
|
);
|
|
1428
1449
|
h !== null && s.push([u, h]);
|
|
1429
1450
|
}
|
|
1430
|
-
|
|
1451
|
+
U(e, t) && (s.push([N, be]), i && _e(i));
|
|
1431
1452
|
try {
|
|
1432
1453
|
n.apply(s);
|
|
1433
1454
|
} catch (f) {
|
|
@@ -1453,51 +1474,51 @@ function Ve(e, t = b(), n, r, o, i) {
|
|
|
1453
1474
|
);
|
|
1454
1475
|
d !== null && _(f, d);
|
|
1455
1476
|
}
|
|
1456
|
-
|
|
1477
|
+
U(e, t) && (_(N, be), i && _e(i));
|
|
1457
1478
|
}
|
|
1458
1479
|
function Qn(e, t, n) {
|
|
1459
1480
|
const r = n ?? g(), o = r.applySink, i = r.tabs.find((u) => u.id === "color"), a = b(r);
|
|
1460
|
-
|
|
1461
|
-
const s =
|
|
1481
|
+
Re(e, a, o, i, r.tabs, r.storagePrefix);
|
|
1482
|
+
const s = Q(r);
|
|
1462
1483
|
let f = !1;
|
|
1463
1484
|
if (s && t) {
|
|
1464
1485
|
const u = r.tabs.find((d) => d.id === "color-secondary");
|
|
1465
|
-
|
|
1486
|
+
Re(
|
|
1466
1487
|
t,
|
|
1467
1488
|
s,
|
|
1468
1489
|
o,
|
|
1469
1490
|
u,
|
|
1470
1491
|
r.tabs,
|
|
1471
1492
|
r.storagePrefix
|
|
1472
|
-
), f =
|
|
1493
|
+
), f = U(t, s);
|
|
1473
1494
|
}
|
|
1474
|
-
if (!
|
|
1495
|
+
if (!U(e, a) && !f)
|
|
1475
1496
|
if (o) {
|
|
1476
1497
|
try {
|
|
1477
1498
|
o.clear([N]);
|
|
1478
1499
|
} catch (u) {
|
|
1479
1500
|
console.warn("[design-token-panel] applySink.clear threw; falling back silently.", u);
|
|
1480
1501
|
}
|
|
1481
|
-
|
|
1502
|
+
Z(r.storagePrefix);
|
|
1482
1503
|
} else
|
|
1483
1504
|
dt(r.storagePrefix);
|
|
1484
1505
|
}
|
|
1485
|
-
function
|
|
1506
|
+
function _r(e, t) {
|
|
1486
1507
|
const n = t ?? g();
|
|
1487
1508
|
Qn(e.color, e.secondary, n), er(e, n);
|
|
1488
1509
|
}
|
|
1489
1510
|
function er(e, t) {
|
|
1490
1511
|
const n = t ?? g(), r = n.applySink;
|
|
1491
|
-
if (
|
|
1512
|
+
if (z(n.tabs, "spacing", e.spacing, r), z(n.tabs, "font", e.typography, r), z(n.tabs, "size", e.size, r), e.tabs)
|
|
1492
1513
|
for (const [o, i] of Object.entries(e.tabs)) {
|
|
1493
1514
|
const a = {};
|
|
1494
1515
|
for (const s of Object.values(i))
|
|
1495
1516
|
for (const [f, u] of Object.entries(s))
|
|
1496
1517
|
a[f] = u;
|
|
1497
|
-
|
|
1518
|
+
z(n.tabs, o, a, r);
|
|
1498
1519
|
}
|
|
1499
1520
|
}
|
|
1500
|
-
function
|
|
1521
|
+
function z(e, t, n, r) {
|
|
1501
1522
|
const o = e.find((s) => s.id === t);
|
|
1502
1523
|
if (!o) return;
|
|
1503
1524
|
const i = {};
|
|
@@ -1515,7 +1536,7 @@ function L(e, t, n, r) {
|
|
|
1515
1536
|
for (const d of u.items)
|
|
1516
1537
|
if (!d.readonly)
|
|
1517
1538
|
try {
|
|
1518
|
-
const h =
|
|
1539
|
+
const h = Ae(o, u.id, d.id, i), p = Pe(h);
|
|
1519
1540
|
typeof n[d.id] == "string" && n[d.id].length > 0 || u.referencesTier !== void 0 ? s.push([d.cssVar, p]) : f.push(d.cssVar);
|
|
1520
1541
|
} catch {
|
|
1521
1542
|
f.push(d.cssVar);
|
|
@@ -1539,14 +1560,14 @@ function L(e, t, n, r) {
|
|
|
1539
1560
|
for (const f of s.items)
|
|
1540
1561
|
if (!f.readonly)
|
|
1541
1562
|
try {
|
|
1542
|
-
const u =
|
|
1563
|
+
const u = Ae(o, s.id, f.id, i), d = Pe(u);
|
|
1543
1564
|
typeof n[f.id] == "string" && n[f.id].length > 0 || s.referencesTier !== void 0 ? _(f.cssVar, d) : a.style.removeProperty(f.cssVar);
|
|
1544
1565
|
} catch {
|
|
1545
1566
|
a.style.removeProperty(f.cssVar);
|
|
1546
1567
|
}
|
|
1547
1568
|
}
|
|
1548
1569
|
function ut(e) {
|
|
1549
|
-
const t = e ?? g(), n = b(t), r =
|
|
1570
|
+
const t = e ?? g(), n = b(t), r = Q(t);
|
|
1550
1571
|
return r ? [n, r] : [n];
|
|
1551
1572
|
}
|
|
1552
1573
|
function ct(e) {
|
|
@@ -1571,7 +1592,7 @@ function tr(e) {
|
|
|
1571
1592
|
function dt(e) {
|
|
1572
1593
|
if (!$t(e)) return;
|
|
1573
1594
|
const t = document.documentElement;
|
|
1574
|
-
t.style.getPropertyValue(N) === be && t.style.removeProperty(N),
|
|
1595
|
+
t.style.getPropertyValue(N) === be && t.style.removeProperty(N), Z(e);
|
|
1575
1596
|
}
|
|
1576
1597
|
function nr(e, t, n) {
|
|
1577
1598
|
const r = e ?? ut(n), o = n?.applySink, i = (n ?? g()).storagePrefix;
|
|
@@ -1588,7 +1609,7 @@ function rr(e, t, n) {
|
|
|
1588
1609
|
} catch (i) {
|
|
1589
1610
|
console.warn("[design-token-panel] applySink.clear threw; falling back silently.", i);
|
|
1590
1611
|
}
|
|
1591
|
-
n && e.length > 0 &&
|
|
1612
|
+
n && e.length > 0 && Z(n);
|
|
1592
1613
|
return;
|
|
1593
1614
|
}
|
|
1594
1615
|
const r = document.documentElement;
|
|
@@ -1602,7 +1623,7 @@ function rr(e, t, n) {
|
|
|
1602
1623
|
}
|
|
1603
1624
|
e.length > 0 && n && dt(n);
|
|
1604
1625
|
}
|
|
1605
|
-
function
|
|
1626
|
+
function Hr(e, t) {
|
|
1606
1627
|
const n = t ?? g(), r = n.applySink, o = ut(n);
|
|
1607
1628
|
if (r) {
|
|
1608
1629
|
const a = [];
|
|
@@ -1614,7 +1635,7 @@ function _r(e, t) {
|
|
|
1614
1635
|
} catch (s) {
|
|
1615
1636
|
console.warn("[design-token-panel] applySink.clear threw; falling back silently.", s);
|
|
1616
1637
|
}
|
|
1617
|
-
o.length > 0 &&
|
|
1638
|
+
o.length > 0 && Z(n.storagePrefix);
|
|
1618
1639
|
return;
|
|
1619
1640
|
}
|
|
1620
1641
|
nr(o, void 0, n);
|
|
@@ -1691,7 +1712,7 @@ function xe(e, t, n) {
|
|
|
1691
1712
|
shikiTheme: typeof e.shikiTheme == "string" && e.shikiTheme.length > 0 ? e.shikiTheme : t.shikiTheme
|
|
1692
1713
|
};
|
|
1693
1714
|
}
|
|
1694
|
-
const
|
|
1715
|
+
const Er = {
|
|
1695
1716
|
"text-caption": "text-xs",
|
|
1696
1717
|
"text-small": "text-sm",
|
|
1697
1718
|
"text-body": "text-base",
|
|
@@ -1701,7 +1722,7 @@ const Hr = {
|
|
|
1701
1722
|
// Dropped — no main-site equivalent. `null` signals "discard".
|
|
1702
1723
|
"text-micro": null
|
|
1703
1724
|
};
|
|
1704
|
-
function
|
|
1725
|
+
function je(e) {
|
|
1705
1726
|
if (!e || typeof e != "object") return {};
|
|
1706
1727
|
const t = {};
|
|
1707
1728
|
for (const [n, r] of Object.entries(e))
|
|
@@ -1740,20 +1761,20 @@ function sr(e) {
|
|
|
1740
1761
|
}
|
|
1741
1762
|
function Me(e, t, n, r = g()) {
|
|
1742
1763
|
if (!e.color || typeof e.color != "object") return null;
|
|
1743
|
-
const o = n ??
|
|
1764
|
+
const o = n ?? Oe(t, r), i = e.typography !== void 0 ? e.typography : e.font, a = r.legacyIdRenameMap ?? {}, s = {
|
|
1744
1765
|
color: xe(e.color, o, t.paletteSize),
|
|
1745
1766
|
// New sections added after v1 migration — tolerate their absence so
|
|
1746
1767
|
// older v2 payloads (Color-only) still load cleanly.
|
|
1747
|
-
spacing:
|
|
1768
|
+
spacing: je(e.spacing),
|
|
1748
1769
|
// Typography slice: apply the host-configured rename map (if any)
|
|
1749
1770
|
// so payloads persisted under the host's "old" ids survive a
|
|
1750
1771
|
// host-driven id rename without losing the user's tweaks.
|
|
1751
1772
|
typography: ar(i, a),
|
|
1752
|
-
size:
|
|
1753
|
-
}, f =
|
|
1773
|
+
size: je(e.size)
|
|
1774
|
+
}, f = Q(r);
|
|
1754
1775
|
f && e.secondary && ht(e.secondary, f.paletteSize) && (s.secondary = xe(
|
|
1755
1776
|
e.secondary,
|
|
1756
|
-
|
|
1777
|
+
ne(f),
|
|
1757
1778
|
f.paletteSize
|
|
1758
1779
|
));
|
|
1759
1780
|
const u = sr(e.tabs);
|
|
@@ -1766,7 +1787,7 @@ function fr(e = localStorage, t, n = b(), r = g()) {
|
|
|
1766
1787
|
if (d && typeof d == "object") {
|
|
1767
1788
|
const h = d, p = Me(h, n, t, r);
|
|
1768
1789
|
if (p !== null) {
|
|
1769
|
-
const k = h.typography !== void 0 ? h.typography : h.font, v = JSON.stringify(k ?? {}) !== JSON.stringify(p.typography),
|
|
1790
|
+
const k = h.typography !== void 0 ? h.typography : h.font, v = JSON.stringify(k ?? {}) !== JSON.stringify(p.typography), O = h.color, m = Array.isArray(O?.palette) && O.palette.length !== n.paletteSize;
|
|
1770
1791
|
if (v || h.typography === void 0 || m)
|
|
1771
1792
|
try {
|
|
1772
1793
|
e.setItem(a, JSON.stringify(p));
|
|
@@ -1796,13 +1817,13 @@ function fr(e = localStorage, t, n = b(), r = g()) {
|
|
|
1796
1817
|
if (u !== null) {
|
|
1797
1818
|
const d = K(u);
|
|
1798
1819
|
if (d && typeof d == "object" && ht(d, n.paletteSize)) {
|
|
1799
|
-
const h = t ??
|
|
1820
|
+
const h = t ?? Oe(n, r), p = d;
|
|
1800
1821
|
p.shikiTheme || (p.shikiTheme = h.shikiTheme);
|
|
1801
1822
|
const v = {
|
|
1802
1823
|
color: xe(p, h, n.paletteSize),
|
|
1803
|
-
spacing:
|
|
1804
|
-
typography:
|
|
1805
|
-
size:
|
|
1824
|
+
spacing: fe(),
|
|
1825
|
+
typography: fe(),
|
|
1826
|
+
size: fe()
|
|
1806
1827
|
};
|
|
1807
1828
|
try {
|
|
1808
1829
|
e.setItem(a, JSON.stringify(v)), e.removeItem(o);
|
|
@@ -1818,15 +1839,15 @@ function fr(e = localStorage, t, n = b(), r = g()) {
|
|
|
1818
1839
|
}
|
|
1819
1840
|
return null;
|
|
1820
1841
|
}
|
|
1821
|
-
function
|
|
1822
|
-
const n = V(e,
|
|
1842
|
+
function Te(e, t) {
|
|
1843
|
+
const n = V(e, F(t));
|
|
1823
1844
|
if (n === null) return null;
|
|
1824
1845
|
const r = K(n);
|
|
1825
1846
|
if (!r || typeof r != "object" || Array.isArray(r)) return null;
|
|
1826
1847
|
const o = r, i = o.color;
|
|
1827
1848
|
return !i || typeof i != "object" || Array.isArray(i) || Array.isArray(i.palette) ? null : o;
|
|
1828
1849
|
}
|
|
1829
|
-
function
|
|
1850
|
+
function Ie(e) {
|
|
1830
1851
|
const t = e?.color;
|
|
1831
1852
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
1832
1853
|
}
|
|
@@ -1835,7 +1856,7 @@ function pt(e) {
|
|
|
1835
1856
|
return t && typeof t == "object" && !Array.isArray(t) ? t : void 0;
|
|
1836
1857
|
}
|
|
1837
1858
|
function lr(e, t, n, r) {
|
|
1838
|
-
const o =
|
|
1859
|
+
const o = Ce(t, r), i = Ie(e)?.[o], a = i && typeof i == "object" && !Array.isArray(i) ? i : void 0, s = pt(e)?.[o], f = n ?? Oe(t, r), u = {
|
|
1839
1860
|
color: a ?? f,
|
|
1840
1861
|
secondary: s,
|
|
1841
1862
|
spacing: e.spacing,
|
|
@@ -1846,16 +1867,16 @@ function lr(e, t, n, r) {
|
|
|
1846
1867
|
};
|
|
1847
1868
|
return Me(u, t, f, r);
|
|
1848
1869
|
}
|
|
1849
|
-
function
|
|
1850
|
-
const r =
|
|
1870
|
+
function Vr(e = g(), t = b(e), n = localStorage) {
|
|
1871
|
+
const r = Te(n, e);
|
|
1851
1872
|
if (!r) return !1;
|
|
1852
|
-
const o =
|
|
1873
|
+
const o = Ce(t, e), i = Ie(r)?.[o];
|
|
1853
1874
|
return !!i && typeof i == "object" && !Array.isArray(i);
|
|
1854
1875
|
}
|
|
1855
1876
|
function gt(e, t, n, r, o) {
|
|
1856
|
-
const i =
|
|
1877
|
+
const i = Ce(r, o), s = {
|
|
1857
1878
|
color: {
|
|
1858
|
-
...
|
|
1879
|
+
...Ie(t),
|
|
1859
1880
|
[i]: e.color
|
|
1860
1881
|
},
|
|
1861
1882
|
spacing: e.spacing,
|
|
@@ -1864,25 +1885,25 @@ function gt(e, t, n, r, o) {
|
|
|
1864
1885
|
}, f = { ...pt(t) };
|
|
1865
1886
|
e.secondary !== void 0 ? f[i] = e.secondary : delete f[i], Object.keys(f).length > 0 && (s.secondary = f), e.tabs && Object.keys(e.tabs).length > 0 && (s.tabs = e.tabs);
|
|
1866
1887
|
try {
|
|
1867
|
-
n.setItem(
|
|
1888
|
+
n.setItem(F(o), JSON.stringify(s));
|
|
1868
1889
|
} catch {
|
|
1869
1890
|
}
|
|
1870
1891
|
}
|
|
1871
|
-
function
|
|
1872
|
-
const o =
|
|
1892
|
+
function Fr(e = localStorage, t, n = b(), r = g()) {
|
|
1893
|
+
const o = Te(e, r);
|
|
1873
1894
|
if (o !== null)
|
|
1874
1895
|
return lr(o, n, t, r);
|
|
1875
|
-
V(e,
|
|
1896
|
+
V(e, F(r)) !== null && console.warn(`[tweak] Malformed ${F(r)}, attempting v3/v2/v1 migration`);
|
|
1876
1897
|
const i = fr(e, t, n, r);
|
|
1877
1898
|
return i === null ? null : (gt(i, null, e, n, r), i);
|
|
1878
1899
|
}
|
|
1879
1900
|
function Rr(e, t = localStorage, n = g()) {
|
|
1880
|
-
const r = b(n), o =
|
|
1901
|
+
const r = b(n), o = Te(t, n);
|
|
1881
1902
|
gt(e, o, t, r, n);
|
|
1882
1903
|
}
|
|
1883
1904
|
function jr(e = localStorage, t = g()) {
|
|
1884
1905
|
for (const n of [
|
|
1885
|
-
|
|
1906
|
+
F(t),
|
|
1886
1907
|
ot(t),
|
|
1887
1908
|
rt(t),
|
|
1888
1909
|
nt(t)
|
|
@@ -1906,7 +1927,7 @@ function K(e) {
|
|
|
1906
1927
|
return null;
|
|
1907
1928
|
}
|
|
1908
1929
|
}
|
|
1909
|
-
function
|
|
1930
|
+
function Oe(e, t) {
|
|
1910
1931
|
try {
|
|
1911
1932
|
return Jn(e, t);
|
|
1912
1933
|
} catch {
|
|
@@ -1926,43 +1947,44 @@ function Ce(e, t) {
|
|
|
1926
1947
|
}
|
|
1927
1948
|
}
|
|
1928
1949
|
export {
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1950
|
+
En as A,
|
|
1951
|
+
jn as B,
|
|
1952
|
+
Sr as C,
|
|
1932
1953
|
Pn as D,
|
|
1933
|
-
|
|
1934
|
-
|
|
1954
|
+
kr as E,
|
|
1955
|
+
Tr as F,
|
|
1935
1956
|
Nr as G,
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1957
|
+
Cr as H,
|
|
1958
|
+
Vr as I,
|
|
1959
|
+
er as J,
|
|
1960
|
+
nr as K,
|
|
1961
|
+
jr as L,
|
|
1941
1962
|
cr as M,
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1963
|
+
Hr as N,
|
|
1964
|
+
Or as O,
|
|
1965
|
+
$r as P,
|
|
1966
|
+
Jn as Q,
|
|
1967
|
+
Qn as R,
|
|
1968
|
+
vr as S,
|
|
1969
|
+
wr as T,
|
|
1970
|
+
he as U,
|
|
1971
|
+
fe as V,
|
|
1972
|
+
F as W,
|
|
1973
|
+
ot as X,
|
|
1974
|
+
Pr as Y,
|
|
1975
|
+
Er as Z,
|
|
1954
1976
|
nt as a,
|
|
1955
1977
|
rt as b,
|
|
1956
1978
|
b as c,
|
|
1957
1979
|
ge as d,
|
|
1958
1980
|
pe as e,
|
|
1959
|
-
|
|
1960
|
-
|
|
1981
|
+
zn as f,
|
|
1982
|
+
Mr as g,
|
|
1961
1983
|
Yn as h,
|
|
1962
|
-
|
|
1984
|
+
Ln as i,
|
|
1963
1985
|
hr as j,
|
|
1964
1986
|
gr as k,
|
|
1965
|
-
|
|
1987
|
+
Fr as l,
|
|
1966
1988
|
yr as m,
|
|
1967
1989
|
Xn as n,
|
|
1968
1990
|
pr as o,
|
|
@@ -1970,11 +1992,11 @@ export {
|
|
|
1970
1992
|
mr as q,
|
|
1971
1993
|
br as r,
|
|
1972
1994
|
E as s,
|
|
1973
|
-
|
|
1995
|
+
Y as t,
|
|
1974
1996
|
Ar as u,
|
|
1975
1997
|
Zn as v,
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1998
|
+
Ir as w,
|
|
1999
|
+
xr as x,
|
|
2000
|
+
_r as y,
|
|
2001
|
+
Rr as z
|
|
1980
2002
|
};
|