@synnaxlabs/pluto 0.34.0 → 0.35.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Animated-CnvOerW9.js → Animated-C7JTBH0T.js} +6 -6
- package/dist/{Animated-Ck87AGOu.cjs → Animated-D4IT49PS.cjs} +1 -1
- package/dist/{Item--wCat2DH.js → Item-4yG7GmwK.js} +23 -23
- package/dist/{Item-DuNQFmgk.cjs → Item-DuYEON-n.cjs} +1 -1
- package/dist/{Keyboard-DPs95Etp.cjs → Keyboard-BPoxRive.cjs} +1 -1
- package/dist/{Keyboard-Dh_Fhwg4.js → Keyboard-Csje8Cyn.js} +2 -2
- package/dist/LinePlot-DbXPZbQH.cjs +34 -0
- package/dist/{LinePlot-6KHKqa-2.js → LinePlot-DqoSTxNs.js} +2630 -2365
- package/dist/{Link-BHtl4aby.cjs → Link-BRv9hhIc.cjs} +1 -1
- package/dist/{Link-CDG2-g6A.js → Link-Crud0q_J.js} +1 -1
- package/dist/{List-BjimX8fM.js → List-Cuz80sgI.js} +6 -6
- package/dist/{List-C8vXIE2j.cjs → List-Pyj0u9YT.cjs} +1 -1
- package/dist/{Pack-D6eMgf33.js → Pack-BzCJQZ58.js} +1 -1
- package/dist/{Pack-DijAGcm_.cjs → Pack-Dvf8sQVK.cjs} +1 -1
- package/dist/Text-BJ2Pml4B.cjs +1 -0
- package/dist/{Text-CzgVM_22.js → Text-DMMYBs-R.js} +12 -12
- package/dist/{Toggle-Cdu7WaiC.js → Toggle-CLkPIiQK.js} +10438 -10080
- package/dist/Toggle-DnW_7Wr_.cjs +143 -0
- package/dist/{Video-DYSz9XOF.js → Video-BGyV37o3.js} +1 -1
- package/dist/{Video-BgDjKMJx.cjs → Video-CGe5Hscl.cjs} +1 -1
- package/dist/{aggregator-DzdAnRwI.js → aggregator-23mu0FOF.js} +2322 -2177
- package/dist/aggregator-y-jNJhKX.cjs +67 -0
- package/dist/align.cjs +1 -1
- package/dist/align.js +1 -1
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/color.cjs +1 -1
- package/dist/color.js +1 -1
- package/dist/css-BghghSL0.cjs +1 -0
- package/dist/css-DJCM-h5_.js +1178 -0
- package/dist/css.cjs +1 -1
- package/dist/css.js +2 -2
- package/dist/dropdown.cjs +1 -1
- package/dist/dropdown.js +1 -1
- package/dist/ether.cjs +1 -1
- package/dist/ether.js +75 -62
- package/dist/{external-k3Jbrj0m.js → external-0a9KHHwz.js} +13 -13
- package/dist/external-3DAfrFCZ.cjs +1 -0
- package/dist/{external-eI1p10Vf.cjs → external-B7Vpq1ol.cjs} +1 -1
- package/dist/{external-DRHWURjA.cjs → external-BV_9eXZJ.cjs} +1 -1
- package/dist/{external-lgZ2Gmbx.js → external-BZwFy-XX.js} +16 -16
- package/dist/{external-CoQwrjWl.js → external-CIH3tMhP.js} +29 -29
- package/dist/{external-BOIjtEGO.js → external-Cf5a9Ia8.js} +2 -2
- package/dist/{external-FVIwMFDr.js → external-CgpiH-10.js} +102 -102
- package/dist/{external-DcMAC_pY.js → external-Cgq0p0a8.js} +133 -126
- package/dist/{external-D9Q5Xjko.js → external-Ci-UP3Vu.js} +2 -2
- package/dist/external-CqLAQBcO.cjs +1 -0
- package/dist/{external-Cc9o20Al.cjs → external-Ctvxtwfh.cjs} +1 -1
- package/dist/{external-CAIE4G3V.cjs → external-D-PsJ1E5.cjs} +1 -1
- package/dist/external-D7FmaiqY.js +248 -0
- package/dist/{external-DvRQ7lJU.js → external-DAbicix6.js} +2 -2
- package/dist/external-DVF3ZJ4z.js +32 -0
- package/dist/external-De9tKPlO.js +76 -0
- package/dist/{external-CYsmC4uZ.cjs → external-Dk1cXh1i.cjs} +1 -1
- package/dist/{external-mtlL4Z3a.cjs → external-DtnrBHvV.cjs} +1 -1
- package/dist/external-ZxIaRZdb.cjs +1 -0
- package/dist/{external-BbS4QDTb.cjs → external-iiNZw96o.cjs} +1 -1
- package/dist/{external-DsKRFJxV.cjs → external-t43feeRt.cjs} +1 -1
- package/dist/{external-mE-a2ecU.js → external-xhGCeglf.js} +1 -1
- package/dist/{external-CjmMj11F.cjs → external-xtDHiIUX.cjs} +1 -1
- package/dist/header.cjs +1 -1
- package/dist/header.js +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.js +8292 -7208
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/list.cjs +1 -1
- package/dist/list.js +1 -1
- package/dist/menu.cjs +1 -1
- package/dist/menu.js +1 -1
- package/dist/src/breadcrumb/Breadcrumb.d.ts +10 -2
- package/dist/src/breadcrumb/Breadcrumb.d.ts.map +1 -1
- package/dist/src/button/Button.d.ts +2 -0
- package/dist/src/button/Button.d.ts.map +1 -1
- package/dist/src/button/Icon.d.ts +2 -0
- package/dist/src/button/Icon.d.ts.map +1 -1
- package/dist/src/color/GradientPicker.d.ts +10 -0
- package/dist/src/color/GradientPicker.d.ts.map +1 -0
- package/dist/src/color/Picker.d.ts +9 -0
- package/dist/src/color/Picker.d.ts.map +1 -0
- package/dist/src/color/Provider.d.ts +139 -0
- package/dist/src/color/Provider.d.ts.map +1 -0
- package/dist/src/color/Swatch.d.ts +13 -0
- package/dist/src/color/Swatch.d.ts.map +1 -0
- package/dist/src/color/core/external.d.ts +4 -0
- package/dist/src/color/core/external.d.ts.map +1 -0
- package/dist/src/color/core/gradient.d.ts +58 -0
- package/dist/src/color/core/gradient.d.ts.map +1 -0
- package/dist/src/color/core/index.d.ts +1 -2
- package/dist/src/color/core/index.d.ts.map +1 -1
- package/dist/src/color/core/palette.d.ts +74 -0
- package/dist/src/color/core/palette.d.ts.map +1 -0
- package/dist/src/color/external.d.ts +4 -1
- package/dist/src/color/external.d.ts.map +1 -1
- package/dist/src/haul/Haul.d.ts +0 -1
- package/dist/src/haul/Haul.d.ts.map +1 -1
- package/dist/src/hooks/index.d.ts +1 -0
- package/dist/src/hooks/index.d.ts.map +1 -1
- package/dist/src/hooks/useDelayedState.d.ts +11 -0
- package/dist/src/hooks/useDelayedState.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/input/Text.d.ts.map +1 -1
- package/dist/src/nav/Drawer.d.ts.map +1 -1
- package/dist/src/notation/Select.d.ts +8 -0
- package/dist/src/notation/Select.d.ts.map +1 -0
- package/dist/src/notation/external.d.ts +3 -0
- package/dist/src/notation/external.d.ts.map +1 -0
- package/dist/src/notation/index.d.ts +2 -0
- package/dist/src/notation/index.d.ts.map +1 -0
- package/dist/src/notation/notation.d.ts.map +1 -1
- package/dist/src/pluto/Pluto.d.ts +3 -1
- package/dist/src/pluto/Pluto.d.ts.map +1 -1
- package/dist/src/pluto/aether/pluto.d.ts.map +1 -1
- package/dist/src/select/Button.d.ts +5 -3
- package/dist/src/select/Button.d.ts.map +1 -1
- package/dist/src/select/Direction.d.ts +2 -1
- package/dist/src/select/Direction.d.ts.map +1 -1
- package/dist/src/select/Single.d.ts +1 -1
- package/dist/src/select/Single.d.ts.map +1 -1
- package/dist/src/status/Circle.d.ts +1 -1
- package/dist/src/status/Circle.d.ts.map +1 -1
- package/dist/src/table/Table.d.ts +30 -0
- package/dist/src/table/Table.d.ts.map +1 -0
- package/dist/src/table/aether/Table.d.ts +493 -0
- package/dist/src/table/aether/Table.d.ts.map +1 -0
- package/dist/src/table/aether/index.d.ts +2 -0
- package/dist/src/table/aether/index.d.ts.map +1 -0
- package/dist/src/table/cells/Cells.d.ts +191 -0
- package/dist/src/table/cells/Cells.d.ts.map +1 -0
- package/dist/src/table/cells/Forms.d.ts +7 -0
- package/dist/src/table/cells/Forms.d.ts.map +1 -0
- package/dist/src/table/cells/index.d.ts +2 -0
- package/dist/src/table/cells/index.d.ts.map +1 -0
- package/dist/src/table/cells/registry.d.ts +17 -0
- package/dist/src/table/cells/registry.d.ts.map +1 -0
- package/dist/src/table/external.d.ts +2 -0
- package/dist/src/table/external.d.ts.map +1 -0
- package/dist/src/table/index.d.ts +2 -0
- package/dist/src/table/index.d.ts.map +1 -0
- package/dist/src/telem/aether/pipeline.d.ts +35 -24
- package/dist/src/telem/aether/pipeline.d.ts.map +1 -1
- package/dist/src/telem/aether/provider.d.ts +7 -6
- package/dist/src/telem/aether/provider.d.ts.map +1 -1
- package/dist/src/telem/aether/static.d.ts +22 -1
- package/dist/src/telem/aether/static.d.ts.map +1 -1
- package/dist/src/telem/aether/transformers.d.ts +217 -2
- package/dist/src/telem/aether/transformers.d.ts.map +1 -1
- package/dist/src/telem/control/aether/controller.d.ts.map +1 -1
- package/dist/src/text/Editable.d.ts +2 -1
- package/dist/src/text/Editable.d.ts.map +1 -1
- package/dist/src/text/Select.d.ts +19 -0
- package/dist/src/text/Select.d.ts.map +1 -0
- package/dist/src/text/core/types.d.ts +2 -1
- package/dist/src/text/core/types.d.ts.map +1 -1
- package/dist/src/text/external.d.ts +1 -1
- package/dist/src/text/external.d.ts.map +1 -1
- package/dist/src/theming/Provider.d.ts.map +1 -1
- package/dist/src/theming/aether/provider.d.ts +375 -0
- package/dist/src/theming/aether/provider.d.ts.map +1 -1
- package/dist/src/theming/core/theme.d.ts +127 -0
- package/dist/src/theming/core/theme.d.ts.map +1 -1
- package/dist/src/tree/core.d.ts +3 -1
- package/dist/src/tree/core.d.ts.map +1 -1
- package/dist/src/vis/axis/canvas.d.ts +11 -0
- package/dist/src/vis/axis/canvas.d.ts.map +1 -1
- package/dist/src/vis/canvas/Canvas.d.ts.map +1 -1
- package/dist/src/vis/diagram/Diagram.d.ts +2 -1
- package/dist/src/vis/diagram/Diagram.d.ts.map +1 -1
- package/dist/src/vis/diagram/aether/types.d.ts +17 -0
- package/dist/src/vis/diagram/aether/types.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/Edge.d.ts +3 -2
- package/dist/src/vis/diagram/edge/Edge.d.ts.map +1 -1
- package/dist/src/vis/diagram/edge/paths.d.ts +20 -0
- package/dist/src/vis/diagram/edge/paths.d.ts.map +1 -0
- package/dist/src/vis/diagram/external.d.ts +1 -0
- package/dist/src/vis/diagram/external.d.ts.map +1 -1
- package/dist/src/vis/draw2d/canvas.d.ts +19 -0
- package/dist/src/vis/draw2d/canvas.d.ts.map +1 -1
- package/dist/src/vis/legend/Container.d.ts.map +1 -1
- package/dist/src/vis/line/aether/line.d.ts.map +1 -1
- package/dist/src/vis/lineplot/aether/YAxis.d.ts.map +1 -1
- package/dist/src/vis/render/context.d.ts.map +1 -1
- package/dist/src/vis/schematic/Forms.d.ts +1 -0
- package/dist/src/vis/schematic/Forms.d.ts.map +1 -1
- package/dist/src/vis/schematic/Grid.d.ts +16 -0
- package/dist/src/vis/schematic/Grid.d.ts.map +1 -0
- package/dist/src/vis/schematic/Symbols.d.ts +248 -371
- package/dist/src/vis/schematic/Symbols.d.ts.map +1 -1
- package/dist/src/vis/schematic/primitives/Primitives.d.ts +39 -0
- package/dist/src/vis/schematic/primitives/Primitives.d.ts.map +1 -1
- package/dist/src/vis/schematic/registry.d.ts +2 -2
- package/dist/src/vis/schematic/registry.d.ts.map +1 -1
- package/dist/src/vis/value/Form.d.ts +9 -0
- package/dist/src/vis/value/Form.d.ts.map +1 -0
- package/dist/src/vis/value/aether/value.d.ts +167 -0
- package/dist/src/vis/value/aether/value.d.ts.map +1 -1
- package/dist/src/vis/value/external.d.ts +1 -0
- package/dist/src/vis/value/external.d.ts.map +1 -1
- package/dist/src/vis/value/use.d.ts +56 -1
- package/dist/src/vis/value/use.d.ts.map +1 -1
- package/dist/src/workMain.d.ts +2 -0
- package/dist/src/workMain.d.ts.map +1 -0
- package/dist/style.css +1 -1
- package/dist/tabs.cjs +1 -1
- package/dist/tabs.js +1 -1
- package/dist/text.cjs +1 -1
- package/dist/text.js +2 -2
- package/dist/theming.cjs +1 -1
- package/dist/theming.js +2 -2
- package/dist/tree.cjs +1 -1
- package/dist/tree.js +1 -1
- package/dist/triggers.cjs +1 -1
- package/dist/triggers.js +1 -1
- package/dist/{units-CR-P9eLW.cjs → units-9h1yAbxY.cjs} +1 -1
- package/dist/{units-rb5QAWjs.js → units-D19WggGS.js} +1 -1
- package/dist/video.cjs +1 -1
- package/dist/video.js +1 -1
- package/package.json +6 -5
- package/dist/LinePlot--yLT9nkT.cjs +0 -34
- package/dist/Text-Cg0q7seY.cjs +0 -1
- package/dist/Toggle-CP9KtybX.cjs +0 -143
- package/dist/aggregator-C0Ab25_o.cjs +0 -67
- package/dist/css-B4FcyECk.js +0 -1112
- package/dist/css-Dh7n0EGs.cjs +0 -1
- package/dist/external-B72rRj4o.js +0 -76
- package/dist/external-CsqyDUsJ.js +0 -96
- package/dist/external-CsrLjLOh.cjs +0 -1
- package/dist/external-Dm2-owlq.cjs +0 -1
- package/dist/external-Yf8Lv9AU.js +0 -248
- package/dist/external-gz4sf3pG.cjs +0 -1
- package/dist/src/color/Picker/Picker.d.ts +0 -7
- package/dist/src/color/Picker/Picker.d.ts.map +0 -1
- package/dist/src/color/Picker/index.d.ts +0 -2
- package/dist/src/color/Picker/index.d.ts.map +0 -1
- package/dist/src/color/Swatch/Swatch.d.ts +0 -10
- package/dist/src/color/Swatch/Swatch.d.ts.map +0 -1
- package/dist/src/color/Swatch/index.d.ts +0 -2
- package/dist/src/color/Swatch/index.d.ts.map +0 -1
- package/dist/src/notation/SelectNotation.d.ts +0 -12
- package/dist/src/notation/SelectNotation.d.ts.map +0 -1
- package/dist/src/text/SelectLevel.d.ts +0 -12
- package/dist/src/text/SelectLevel.d.ts.map +0 -1
- package/dist/src/vis/schematic/Labeled.d.ts +0 -17
- package/dist/src/vis/schematic/Labeled.d.ts.map +0 -1
|
@@ -0,0 +1,1178 @@
|
|
|
1
|
+
var vt = Object.defineProperty;
|
|
2
|
+
var Ot = (t, e, r) => e in t ? vt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
|
+
var C = (t, e, r) => Ot(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
+
import { z as i } from "zod";
|
|
5
|
+
const te = i.tuple([i.number(), i.number()]);
|
|
6
|
+
i.tuple([i.bigint(), i.bigint()]);
|
|
7
|
+
const Oe = i.object({ width: i.number(), height: i.number() }), Mt = i.object({
|
|
8
|
+
signedWidth: i.number(),
|
|
9
|
+
signedHeight: i.number()
|
|
10
|
+
}), jt = ["width", "height"];
|
|
11
|
+
i.enum(jt);
|
|
12
|
+
const Tt = ["start", "center", "end"], It = ["signedWidth", "signedHeight"];
|
|
13
|
+
i.enum(It);
|
|
14
|
+
const H = i.object({ x: i.number(), y: i.number() }), Ye = i.object({ clientX: i.number(), clientY: i.number() }), Me = ["x", "y"], je = i.enum(Me), ke = ["top", "right", "bottom", "left"], Et = i.enum(ke), re = ["left", "right"], Te = i.enum(re), ne = ["top", "bottom"], Ie = i.enum(ne), Ee = ["center"], le = i.enum(Ee), St = [...ke, ...Ee], Se = i.enum(St);
|
|
15
|
+
i.enum(Tt);
|
|
16
|
+
const Bt = ["first", "last"];
|
|
17
|
+
i.enum(Bt);
|
|
18
|
+
const Fe = i.object({ lower: i.number(), upper: i.number() }), Nt = i.object({ lower: i.bigint(), upper: i.bigint() });
|
|
19
|
+
i.union([Fe, te]);
|
|
20
|
+
i.union([Nt, te]);
|
|
21
|
+
const zt = i.union([je, Se]), Ct = i.union([je, Se, i.instanceof(String)]), T = (t) => typeof t == "bigint" || t instanceof BigInt, Z = (t, e) => T(t) ? t.valueOf() - BigInt(e.valueOf().valueOf()) : t.valueOf() - Number(e.valueOf()), Xe = (t, e) => T(t) ? t.valueOf() + BigInt(e.valueOf().valueOf()) : t + Number(e.valueOf()), At = (t, e, r = 1e-4) => Math.abs(t - e) < r, pe = (t, e) => T(t) ? t === BigInt(e.valueOf().valueOf()) : t === Number(e.valueOf()), Rt = (t) => {
|
|
22
|
+
const e = 10 ** Math.floor(Math.log10(t));
|
|
23
|
+
return Math.round(t / e) * e;
|
|
24
|
+
}, De = (t, e) => T(t) ? t.valueOf() < BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() < Number(e.valueOf()) ? t : Number(e.valueOf()), Lt = (t, e) => T(t) ? t.valueOf() > BigInt(e.valueOf()) ? t : BigInt(e.valueOf()) : t.valueOf() > Number(e.valueOf()) ? t : Number(e.valueOf()), qe = (t) => T(t) || t instanceof BigInt ? t.valueOf() < 0n ? -t : t : t.valueOf() < 0 ? -t : t, _t = (t, e) => T(t) ? t.valueOf() * BigInt(e.valueOf()) : t.valueOf() * Number(e.valueOf()), Pt = (t, e) => T(t) ? t.valueOf() / BigInt(e.valueOf()) : t.valueOf() / Number(e.valueOf()), kn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
25
|
+
__proto__: null,
|
|
26
|
+
abs: qe,
|
|
27
|
+
add: Xe,
|
|
28
|
+
closeTo: At,
|
|
29
|
+
div: Pt,
|
|
30
|
+
equal: pe,
|
|
31
|
+
max: Lt,
|
|
32
|
+
min: De,
|
|
33
|
+
mult: _t,
|
|
34
|
+
roundToNearestMagnitude: Rt,
|
|
35
|
+
sub: Z
|
|
36
|
+
}, Symbol.toStringTag, { value: "Module" })), p = (t, e) => {
|
|
37
|
+
const r = {};
|
|
38
|
+
if (typeof t == "number" || typeof t == "bigint")
|
|
39
|
+
e != null ? (r.lower = t, r.upper = e) : (r.lower = typeof t == "bigint" ? 0n : 0, r.upper = t);
|
|
40
|
+
else if (Array.isArray(t)) {
|
|
41
|
+
if (t.length !== 2) throw new Error("bounds: expected array of length 2");
|
|
42
|
+
[r.lower, r.upper] = t;
|
|
43
|
+
} else return he(t);
|
|
44
|
+
return he(r);
|
|
45
|
+
}, Zt = Object.freeze({ lower: 0, upper: 0 }), Ht = Object.freeze({ lower: -1 / 0, upper: 1 / 0 }), Wt = Object.freeze({ lower: 0, upper: 1 }), Yt = Object.freeze({ lower: -1, upper: 1 }), kt = (t, e) => {
|
|
46
|
+
if (t == null && e == null) return !0;
|
|
47
|
+
if (t == null || e == null) return !1;
|
|
48
|
+
const r = p(t), n = p(e);
|
|
49
|
+
return (r == null ? void 0 : r.lower) === (n == null ? void 0 : n.lower) && (r == null ? void 0 : r.upper) === (n == null ? void 0 : n.upper);
|
|
50
|
+
}, he = (t) => t.lower > t.upper ? { lower: t.upper, upper: t.lower } : t, Ft = (t, e) => {
|
|
51
|
+
const r = p(t);
|
|
52
|
+
return e < r.lower ? r.lower : e >= r.upper ? r.upper - (typeof r.upper == "number" ? 1 : 1n) : e;
|
|
53
|
+
}, S = (t, e) => {
|
|
54
|
+
const r = p(t);
|
|
55
|
+
if (typeof e == "number" || typeof e == "bigint")
|
|
56
|
+
return e >= r.lower && e < r.upper;
|
|
57
|
+
const n = p(e);
|
|
58
|
+
return n.lower >= r.lower && n.upper <= r.upper;
|
|
59
|
+
}, Xt = (t, e) => {
|
|
60
|
+
const r = p(t), n = p(e);
|
|
61
|
+
return r.lower === n.lower ? !0 : n.upper === r.lower || n.lower === r.upper ? !1 : S(r, n.upper) || S(r, n.lower) || S(n, r.upper) || S(n, r.lower);
|
|
62
|
+
}, oe = (t) => {
|
|
63
|
+
const e = p(t);
|
|
64
|
+
return e.upper - e.lower;
|
|
65
|
+
}, Dt = (t) => {
|
|
66
|
+
const e = p(t);
|
|
67
|
+
return typeof e.lower == "bigint" ? e.lower === 0n && e.upper === 0n : e.lower === 0 && e.upper === 0;
|
|
68
|
+
}, qt = (t) => {
|
|
69
|
+
const e = oe(t);
|
|
70
|
+
return typeof e == "number" ? e === 0 : e === 0n;
|
|
71
|
+
}, Vt = (t) => {
|
|
72
|
+
const e = p(t);
|
|
73
|
+
return typeof e.lower == "bigint" ? !0 : Number.isFinite(e.lower) && Number.isFinite(e.upper);
|
|
74
|
+
}, Ut = (t) => ({
|
|
75
|
+
lower: Math.min(...t.map((e) => p(e).lower)),
|
|
76
|
+
upper: Math.max(...t.map((e) => p(e).upper))
|
|
77
|
+
}), Gt = (t) => ({
|
|
78
|
+
lower: Math.max(...t.map((e) => p(e).lower)),
|
|
79
|
+
upper: Math.min(...t.map((e) => p(e).upper))
|
|
80
|
+
}), Kt = (t) => {
|
|
81
|
+
const e = p(t), r = typeof e.lower == "bigint";
|
|
82
|
+
return Array.from({ length: Number(oe(t)) }, (n, o) => r ? e.lower + BigInt(o) : e.lower + o);
|
|
83
|
+
}, ye = (t, e) => {
|
|
84
|
+
const r = t.map((s) => p(s)), n = r.findIndex((s) => S(s, e) || e < s.lower);
|
|
85
|
+
if (n === -1) return { index: t.length, position: 0 };
|
|
86
|
+
const o = r[n];
|
|
87
|
+
return S(o, e) ? { index: n, position: Number(e - o.lower) } : { index: n, position: 0 };
|
|
88
|
+
}, ae = {
|
|
89
|
+
removeBefore: 0,
|
|
90
|
+
removeAfter: 0,
|
|
91
|
+
insertInto: 0,
|
|
92
|
+
deleteInBetween: 0
|
|
93
|
+
}, Jt = (t, e) => {
|
|
94
|
+
const r = t.map((l) => p(l)), n = p(e);
|
|
95
|
+
if (r.length === 0) return ae;
|
|
96
|
+
const o = ye(r, n.lower), s = ye(r, n.upper);
|
|
97
|
+
if (o.index === t.length) return { ...ae, insertInto: t.length };
|
|
98
|
+
if (s.index === 0) return { ...ae, removeAfter: s.position };
|
|
99
|
+
if (o.index === s.index)
|
|
100
|
+
return o.position !== 0 && s.position !== 0 ? null : {
|
|
101
|
+
removeAfter: s.position,
|
|
102
|
+
removeBefore: o.position,
|
|
103
|
+
insertInto: o.index,
|
|
104
|
+
deleteInBetween: 0
|
|
105
|
+
};
|
|
106
|
+
let u = s.index - o.index, a = o.index, c = Z(Number(oe(r[o.index])), o.position);
|
|
107
|
+
return o.position !== 0 ? (u -= 1, a += 1) : c = 0, {
|
|
108
|
+
removeBefore: c,
|
|
109
|
+
removeAfter: s.position,
|
|
110
|
+
insertInto: a,
|
|
111
|
+
deleteInBetween: u
|
|
112
|
+
};
|
|
113
|
+
}, Qt = (t, e, r) => {
|
|
114
|
+
const n = t.map((a) => p(a)), o = r > 0 ? 1 : r < 0 ? -1 : 0;
|
|
115
|
+
if (o === 0) return e;
|
|
116
|
+
let s = r, u = e;
|
|
117
|
+
for (; pe(s, 0) === !1; ) {
|
|
118
|
+
const a = n.findIndex((c) => o > 0 ? u >= c.lower && u < c.upper : u > c.lower && u <= c.upper);
|
|
119
|
+
if (a !== -1) {
|
|
120
|
+
const c = n[a];
|
|
121
|
+
let l;
|
|
122
|
+
if (o > 0 ? l = Z(c.upper, u) : l = Z(u, c.lower), l > 0) {
|
|
123
|
+
const h = De(qe(s), l);
|
|
124
|
+
if (u = Xe(
|
|
125
|
+
u,
|
|
126
|
+
o > 0 ? h : -h
|
|
127
|
+
), s = Z(s, o > 0 ? h : -h), pe(s, 0)) return u;
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (o > 0) {
|
|
132
|
+
const c = n.filter((l) => l.lower > u);
|
|
133
|
+
if (c.length > 0) u = c[0].lower;
|
|
134
|
+
else return u;
|
|
135
|
+
} else {
|
|
136
|
+
const c = n.filter((l) => l.upper < u);
|
|
137
|
+
if (c.length > 0)
|
|
138
|
+
u = c[c.length - 1].upper;
|
|
139
|
+
else return u;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
return u;
|
|
143
|
+
}, er = (t, e, r) => {
|
|
144
|
+
const n = t.map((u) => p(u));
|
|
145
|
+
if (e === r) return typeof e == "bigint" ? 0n : 0;
|
|
146
|
+
const o = e < r ? p([e, r]) : p([r, e]);
|
|
147
|
+
let s = typeof e == "bigint" ? 0n : 0;
|
|
148
|
+
for (const u of n) {
|
|
149
|
+
const a = u.lower > o.lower ? u.lower : o.lower, c = u.upper < o.upper ? u.upper : o.upper;
|
|
150
|
+
if (a < c) {
|
|
151
|
+
const l = c - a;
|
|
152
|
+
s = s + l;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
return s;
|
|
156
|
+
}, Fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
157
|
+
__proto__: null,
|
|
158
|
+
CLIP: Yt,
|
|
159
|
+
DECIMAL: Wt,
|
|
160
|
+
INFINITE: Ht,
|
|
161
|
+
ZERO: Zt,
|
|
162
|
+
bounds: Fe,
|
|
163
|
+
buildInsertionPlan: Jt,
|
|
164
|
+
clamp: Ft,
|
|
165
|
+
construct: p,
|
|
166
|
+
contains: S,
|
|
167
|
+
distance: er,
|
|
168
|
+
equals: kt,
|
|
169
|
+
findInsertPosition: ye,
|
|
170
|
+
isFinite: Vt,
|
|
171
|
+
isZero: Dt,
|
|
172
|
+
linspace: Kt,
|
|
173
|
+
makeValid: he,
|
|
174
|
+
max: Ut,
|
|
175
|
+
min: Gt,
|
|
176
|
+
overlapsWith: Xt,
|
|
177
|
+
span: oe,
|
|
178
|
+
spanIsZero: qt,
|
|
179
|
+
traverse: Qt
|
|
180
|
+
}, Symbol.toStringTag, { value: "Module" })), Ve = zt, I = (t) => Me.includes(t) ? t : ne.includes(t) ? "y" : "x", tr = (t) => I(t) === "x" ? "y" : "x", rr = (t) => I(t) === "x" ? "width" : "height", nr = (t) => I(t) === "x" ? "left" : "top", or = (t) => Ve.safeParse(t).success, sr = (t) => I(t) === "x" ? "signedWidth" : "signedHeight", ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
181
|
+
__proto__: null,
|
|
182
|
+
construct: I,
|
|
183
|
+
crude: Ve,
|
|
184
|
+
dimension: rr,
|
|
185
|
+
direction: je,
|
|
186
|
+
isDirection: or,
|
|
187
|
+
location: nr,
|
|
188
|
+
signedDimension: sr,
|
|
189
|
+
swap: tr
|
|
190
|
+
}, Symbol.toStringTag, { value: "Module" })), ur = (t) => {
|
|
191
|
+
const e = t.replace(/_[a-z]/g, (r) => r[1].toUpperCase());
|
|
192
|
+
return e.length > 1 && e[0] === e[0].toUpperCase() && e[1] === e[1].toUpperCase() || e.length === 0 ? e : e[0].toLowerCase() + e.slice(1);
|
|
193
|
+
}, Ue = (t) => {
|
|
194
|
+
const e = (r, n = Q) => {
|
|
195
|
+
if (typeof r == "string") return t(r);
|
|
196
|
+
if (Array.isArray(r)) return r.map((u) => e(u, n));
|
|
197
|
+
if (!U(r)) return r;
|
|
198
|
+
n = Ke(n);
|
|
199
|
+
const o = {}, s = r;
|
|
200
|
+
return Object.keys(s).forEach((u) => {
|
|
201
|
+
let a = s[u];
|
|
202
|
+
const c = t(u);
|
|
203
|
+
n.recursive && (U(a) ? de(a, n.keepTypesOnRecursion) || (a = e(a, n)) : n.recursiveInArray && fe(a) && (a = [...a].map((l) => {
|
|
204
|
+
let h = l;
|
|
205
|
+
return U(l) ? de(h, n.keepTypesOnRecursion) || (h = e(l, n)) : fe(l) && (h = e({ key: l }, n).key), h;
|
|
206
|
+
}))), o[c] = a;
|
|
207
|
+
}), o;
|
|
208
|
+
};
|
|
209
|
+
return e;
|
|
210
|
+
}, ar = Ue(ur), cr = (t) => (
|
|
211
|
+
// Don't convert the first character and don't convert a character that is after a
|
|
212
|
+
// non-alphanumeric character
|
|
213
|
+
t.replace(/([a-z0-9])([A-Z])/g, (e, r, n) => `${r}_${n.toLowerCase()}`)
|
|
214
|
+
), lr = Ue(cr), Ge = (t) => t.length === 0 ? t : t[0].toUpperCase() + t.slice(1), Q = {
|
|
215
|
+
recursive: !0,
|
|
216
|
+
recursiveInArray: !0,
|
|
217
|
+
keepTypesOnRecursion: [Number, String, Uint8Array]
|
|
218
|
+
}, Ke = (t = Q) => (t.recursive == null ? t = Q : t.recursiveInArray ?? (t.recursiveInArray = !1), t), fe = (t) => t != null && Array.isArray(t), U = (t) => t != null && typeof t == "object" && !Array.isArray(t), de = (t, e) => (e || []).some((r) => t instanceof r), Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
219
|
+
__proto__: null,
|
|
220
|
+
belongToTypes: de,
|
|
221
|
+
camelToSnake: lr,
|
|
222
|
+
capitalize: Ge,
|
|
223
|
+
defaultOptions: Q,
|
|
224
|
+
isArrayObject: fe,
|
|
225
|
+
isValidObject: U,
|
|
226
|
+
snakeToCamel: ar,
|
|
227
|
+
validateOptions: Ke
|
|
228
|
+
}, Symbol.toStringTag, { value: "Module" })), pr = Te, hr = Ie, yr = le, fr = {
|
|
229
|
+
top: "bottom",
|
|
230
|
+
right: "left",
|
|
231
|
+
bottom: "top",
|
|
232
|
+
left: "right",
|
|
233
|
+
center: "center"
|
|
234
|
+
}, dr = {
|
|
235
|
+
top: "left",
|
|
236
|
+
right: "top",
|
|
237
|
+
bottom: "right",
|
|
238
|
+
left: "bottom",
|
|
239
|
+
center: "center"
|
|
240
|
+
}, gr = Ct, O = (t) => t instanceof String || !Me.includes(t) ? t : t === "x" ? "left" : "top", br = (t) => fr[O(t)], xr = (t) => dr[O(t)], W = (t) => {
|
|
241
|
+
const e = O(t);
|
|
242
|
+
return e === "top" || e === "bottom" ? "y" : "x";
|
|
243
|
+
}, mr = i.object({
|
|
244
|
+
x: Te.or(le),
|
|
245
|
+
y: Ie.or(le)
|
|
246
|
+
}), Je = i.object({ x: Te, y: Ie }), k = Object.freeze({ x: "left", y: "top" }), Be = Object.freeze({ x: "right", y: "top" }), se = Object.freeze({ x: "left", y: "bottom" }), Ne = Object.freeze({ x: "right", y: "bottom" }), ze = Object.freeze({ x: "center", y: "center" }), Qe = Object.freeze({ x: "center", y: "top" }), et = Object.freeze({ x: "center", y: "bottom" }), tt = Object.freeze({ x: "right", y: "center" }), rt = Object.freeze({ x: "left", y: "center" }), wr = Object.freeze([
|
|
247
|
+
rt,
|
|
248
|
+
tt,
|
|
249
|
+
Qe,
|
|
250
|
+
et,
|
|
251
|
+
k,
|
|
252
|
+
Be,
|
|
253
|
+
se,
|
|
254
|
+
Ne,
|
|
255
|
+
ze
|
|
256
|
+
]), Ce = (t, e) => t.x === e.x && t.y === e.y, $r = (t, e) => {
|
|
257
|
+
if (typeof e == "object") {
|
|
258
|
+
let r = !0;
|
|
259
|
+
return "x" in e && (t.x === e.x || (r = !1)), "y" in e && (t.y === e.y || (r = !1)), r;
|
|
260
|
+
}
|
|
261
|
+
return t.x === e || t.y === e;
|
|
262
|
+
}, nt = (t) => [t.x, t.y], G = (t) => W(O(t)) === "x", vr = (t) => W(O(t)) === "y", Or = (t) => `${t.x}${Ge(t.y)}`, Mr = (t, e) => {
|
|
263
|
+
let r, n;
|
|
264
|
+
if (typeof t == "object" && "x" in t ? (r = t.x, n = t.y) : (r = O(t), n = O(e ?? t)), W(r) === W(n) && r !== "center" && n !== "center")
|
|
265
|
+
throw new Error(
|
|
266
|
+
`[XYLocation] - encountered two locations with the same direction: ${r.toString()} - ${n.toString()}`
|
|
267
|
+
);
|
|
268
|
+
const o = { ...ze };
|
|
269
|
+
return r === "center" ? G(n) ? [o.x, o.y] = [n, r] : [o.x, o.y] = [r, n] : n === "center" ? G(r) ? [o.x, o.y] = [r, n] : [o.x, o.y] = [n, r] : G(r) ? [o.x, o.y] = [r, n] : [o.x, o.y] = [n, r], o;
|
|
270
|
+
}, ot = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
271
|
+
__proto__: null,
|
|
272
|
+
BOTTOM_CENTER: et,
|
|
273
|
+
BOTTOM_LEFT: se,
|
|
274
|
+
BOTTOM_RIGHT: Ne,
|
|
275
|
+
CENTER: ze,
|
|
276
|
+
CENTER_LOCATIONS: Ee,
|
|
277
|
+
LEFT_CENTER: rt,
|
|
278
|
+
RIGHT_CENTER: tt,
|
|
279
|
+
TOP_CENTER: Qe,
|
|
280
|
+
TOP_LEFT: k,
|
|
281
|
+
TOP_RIGHT: Be,
|
|
282
|
+
XY_LOCATIONS: wr,
|
|
283
|
+
X_LOCATIONS: re,
|
|
284
|
+
Y_LOCATIONS: ne,
|
|
285
|
+
center: yr,
|
|
286
|
+
construct: O,
|
|
287
|
+
constructXY: Mr,
|
|
288
|
+
corner: Je,
|
|
289
|
+
crude: gr,
|
|
290
|
+
direction: W,
|
|
291
|
+
isX: G,
|
|
292
|
+
isY: vr,
|
|
293
|
+
location: Se,
|
|
294
|
+
outer: Et,
|
|
295
|
+
rotate90: xr,
|
|
296
|
+
swap: br,
|
|
297
|
+
x: pr,
|
|
298
|
+
xy: mr,
|
|
299
|
+
xyCouple: nt,
|
|
300
|
+
xyEquals: Ce,
|
|
301
|
+
xyMatches: $r,
|
|
302
|
+
xyToString: Or,
|
|
303
|
+
y: hr
|
|
304
|
+
}, Symbol.toStringTag, { value: "Module" })), ge = i.union([
|
|
305
|
+
i.number(),
|
|
306
|
+
H,
|
|
307
|
+
te,
|
|
308
|
+
Oe,
|
|
309
|
+
Mt,
|
|
310
|
+
Ye
|
|
311
|
+
]), f = (t, e) => {
|
|
312
|
+
if (typeof t == "string") {
|
|
313
|
+
if (e === void 0) throw new Error("The y coordinate must be given.");
|
|
314
|
+
return t === "x" ? { x: e, y: 0 } : { x: 0, y: e };
|
|
315
|
+
}
|
|
316
|
+
return typeof t == "number" ? { x: t, y: e ?? t } : Array.isArray(t) ? { x: t[0], y: t[1] } : "signedWidth" in t ? { x: t.signedWidth, y: t.signedHeight } : "clientX" in t ? { x: t.clientX, y: t.clientY } : "width" in t ? { x: t.width, y: t.height } : { x: t.x, y: t.y };
|
|
317
|
+
}, x = Object.freeze({ x: 0, y: 0 }), st = Object.freeze({ x: 1, y: 1 }), jr = Object.freeze({ x: 1 / 0, y: 1 / 0 }), Tr = Object.freeze({ x: NaN, y: NaN }), ee = (t, e, r = 0) => {
|
|
318
|
+
const n = f(t), o = f(e);
|
|
319
|
+
return r === 0 ? n.x === o.x && n.y === o.y : Math.abs(n.x - o.x) <= r && Math.abs(n.y - o.y) <= r;
|
|
320
|
+
}, Ir = (t) => ee(t, x), Ae = (t, e, r) => {
|
|
321
|
+
const n = f(t), o = f(e, r);
|
|
322
|
+
return { x: n.x * o.x, y: n.y * o.y };
|
|
323
|
+
}, it = (t, e) => {
|
|
324
|
+
const r = f(t);
|
|
325
|
+
return { x: r.x + e, y: r.y };
|
|
326
|
+
}, ut = (t, e) => {
|
|
327
|
+
const r = f(t);
|
|
328
|
+
return { x: r.x, y: r.y + e };
|
|
329
|
+
}, Y = (t, e, r, ...n) => typeof e == "string" && typeof r == "number" ? e === "x" ? it(t, r) : ut(t, r) : [t, e, r ?? x, ...n].reduce((o, s) => {
|
|
330
|
+
const u = f(s);
|
|
331
|
+
return { x: o.x + u.x, y: o.y + u.y };
|
|
332
|
+
}, x), Er = (t, e, r) => {
|
|
333
|
+
const n = f(t);
|
|
334
|
+
return e === "x" ? { x: r, y: n.y } : { x: n.x, y: r };
|
|
335
|
+
}, Sr = (t, e) => {
|
|
336
|
+
const r = f(t), n = f(e);
|
|
337
|
+
return Math.sqrt((r.x - n.x) ** 2 + (r.y - n.y) ** 2);
|
|
338
|
+
}, Br = (t, e) => {
|
|
339
|
+
const r = f(t), n = f(e);
|
|
340
|
+
return { x: n.x - r.x, y: n.y - r.y };
|
|
341
|
+
}, Nr = (t) => {
|
|
342
|
+
const e = f(t);
|
|
343
|
+
return Number.isNaN(e.x) || Number.isNaN(e.y);
|
|
344
|
+
}, zr = (t) => {
|
|
345
|
+
const e = f(t);
|
|
346
|
+
return Number.isFinite(e.x) && Number.isFinite(e.y);
|
|
347
|
+
}, Cr = (t) => {
|
|
348
|
+
const e = f(t);
|
|
349
|
+
return [e.x, e.y];
|
|
350
|
+
}, Ar = (t) => {
|
|
351
|
+
const e = f(t);
|
|
352
|
+
return { left: e.x, top: e.y };
|
|
353
|
+
}, be = (t, e = 0) => {
|
|
354
|
+
const r = f(t);
|
|
355
|
+
return { x: Number(r.x.toFixed(e)), y: Number(r.y.toFixed(e)) };
|
|
356
|
+
}, L = (t, e) => {
|
|
357
|
+
const r = f(t), n = f(e);
|
|
358
|
+
return { x: r.x - n.x, y: r.y - n.y };
|
|
359
|
+
}, _ = (t) => {
|
|
360
|
+
const e = f(t), r = Math.hypot(e.x, e.y);
|
|
361
|
+
return r === 0 ? { x: 0, y: 0 } : { x: -e.y / r, y: e.x / r };
|
|
362
|
+
}, at = (t) => {
|
|
363
|
+
const e = f(t), r = Math.hypot(e.x, e.y);
|
|
364
|
+
return r === 0 ? { x: 0, y: 0 } : { x: e.x / r, y: e.y / r };
|
|
365
|
+
}, ct = (...t) => {
|
|
366
|
+
const e = t.reduce((r, n) => Y(r, n), x);
|
|
367
|
+
return Ae(e, 1 / t.length);
|
|
368
|
+
}, Rr = (t, e) => {
|
|
369
|
+
const r = [];
|
|
370
|
+
for (let n = 0; n < t.length; n++) {
|
|
371
|
+
const o = t[n];
|
|
372
|
+
let s, u, a, c;
|
|
373
|
+
if (n === 0) {
|
|
374
|
+
const l = t[n + 1], h = L(l, o);
|
|
375
|
+
u = _(h), a = u, c = e;
|
|
376
|
+
} else if (n === t.length - 1) {
|
|
377
|
+
const l = t[n - 1], h = L(o, l);
|
|
378
|
+
s = _(h), a = s, c = e;
|
|
379
|
+
} else {
|
|
380
|
+
const l = t[n - 1], h = t[n + 1], E = L(o, l), R = L(h, o);
|
|
381
|
+
s = _(E), u = _(R);
|
|
382
|
+
const $t = Math.acos(
|
|
383
|
+
(E.x * R.x + E.y * R.y) / (Math.hypot(E.x, E.y) * Math.hypot(R.x, R.y))
|
|
384
|
+
), Ze = Math.sin($t / 2);
|
|
385
|
+
Ze === 0 ? c = e : c = e / Ze, a = at(ct(s, u));
|
|
386
|
+
}
|
|
387
|
+
r.push(Ae(a, c));
|
|
388
|
+
}
|
|
389
|
+
return r;
|
|
390
|
+
}, Dn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
391
|
+
__proto__: null,
|
|
392
|
+
INFINITY: jr,
|
|
393
|
+
NAN: Tr,
|
|
394
|
+
ONE: st,
|
|
395
|
+
ZERO: x,
|
|
396
|
+
average: ct,
|
|
397
|
+
calculateMiters: Rr,
|
|
398
|
+
clientXY: Ye,
|
|
399
|
+
construct: f,
|
|
400
|
+
couple: Cr,
|
|
401
|
+
crudeZ: ge,
|
|
402
|
+
css: Ar,
|
|
403
|
+
distance: Sr,
|
|
404
|
+
equals: ee,
|
|
405
|
+
isFinite: zr,
|
|
406
|
+
isNan: Nr,
|
|
407
|
+
isZero: Ir,
|
|
408
|
+
normal: _,
|
|
409
|
+
normalize: at,
|
|
410
|
+
scale: Ae,
|
|
411
|
+
set: Er,
|
|
412
|
+
sub: L,
|
|
413
|
+
translate: Y,
|
|
414
|
+
translateX: it,
|
|
415
|
+
translateY: ut,
|
|
416
|
+
translation: Br,
|
|
417
|
+
truncate: be,
|
|
418
|
+
xy: H
|
|
419
|
+
}, Symbol.toStringTag, { value: "Module" })), X = i.union([i.number(), i.string()]), Lr = i.object({
|
|
420
|
+
top: X,
|
|
421
|
+
left: X,
|
|
422
|
+
width: X,
|
|
423
|
+
height: X
|
|
424
|
+
}), _r = i.object({
|
|
425
|
+
left: i.number(),
|
|
426
|
+
top: i.number(),
|
|
427
|
+
right: i.number(),
|
|
428
|
+
bottom: i.number()
|
|
429
|
+
}), Pr = i.object({
|
|
430
|
+
one: H,
|
|
431
|
+
two: H,
|
|
432
|
+
root: Je
|
|
433
|
+
}), lt = { one: x, two: x, root: k }, Zr = { one: x, two: st, root: se }, pt = (t, e) => ({
|
|
434
|
+
one: t.one,
|
|
435
|
+
two: t.two,
|
|
436
|
+
root: e ?? t.root
|
|
437
|
+
}), y = (t, e, r = 0, n = 0, o) => {
|
|
438
|
+
const s = {
|
|
439
|
+
one: { ...x },
|
|
440
|
+
two: { ...x },
|
|
441
|
+
root: o ?? k
|
|
442
|
+
};
|
|
443
|
+
if (typeof t == "number") {
|
|
444
|
+
if (typeof e != "number")
|
|
445
|
+
throw new Error("Box constructor called with invalid arguments");
|
|
446
|
+
return s.one = { x: t, y: e }, s.two = { x: s.one.x + r, y: s.one.y + n }, s;
|
|
447
|
+
}
|
|
448
|
+
return "one" in t && "two" in t && "root" in t ? { ...t, root: o ?? t.root } : ("getBoundingClientRect" in t && (t = t.getBoundingClientRect()), "left" in t ? (s.one = { x: t.left, y: t.top }, s.two = { x: t.right, y: t.bottom }, s) : (s.one = t, e == null ? s.two = { x: s.one.x + r, y: s.one.y + n } : typeof e == "number" ? s.two = { x: s.one.x + e, y: s.one.y + r } : "width" in e ? s.two = {
|
|
449
|
+
x: s.one.x + e.width,
|
|
450
|
+
y: s.one.y + e.height
|
|
451
|
+
} : "signedWidth" in e ? s.two = {
|
|
452
|
+
x: s.one.x + e.signedWidth,
|
|
453
|
+
y: s.one.y + e.signedHeight
|
|
454
|
+
} : s.two = e, s));
|
|
455
|
+
}, Hr = (t, e, r) => {
|
|
456
|
+
const n = y(t);
|
|
457
|
+
if (typeof e == "string") {
|
|
458
|
+
if (r == null) throw new Error("Invalid arguments for resize");
|
|
459
|
+
const o = I(e);
|
|
460
|
+
return y(
|
|
461
|
+
n.one,
|
|
462
|
+
void 0,
|
|
463
|
+
o === "x" ? r : M(n),
|
|
464
|
+
o === "y" ? r : j(n),
|
|
465
|
+
n.root
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
return y(n.one, e, void 0, void 0, n.root);
|
|
469
|
+
}, Wr = (t, e, r = !0) => {
|
|
470
|
+
const n = y(t);
|
|
471
|
+
let o = (s, u) => s < u;
|
|
472
|
+
return r && (o = (s, u) => s <= u), "one" in e ? o($(n), $(e)) && o(B(e), B(n)) && o(v(n), v(e)) && o(N(e), N(n)) : o($(n), e.x) && o(e.x, B(n)) && o(v(n), e.y) && o(e.y, N(n));
|
|
473
|
+
}, Yr = (t, e) => ee(t.one, e.one) && ee(t.two, e.two) && Ce(t.root, e.root), ht = (t) => ({
|
|
474
|
+
width: M(t),
|
|
475
|
+
height: j(t)
|
|
476
|
+
}), kr = (t) => ({
|
|
477
|
+
signedWidth: ie(t),
|
|
478
|
+
signedHeight: ue(t)
|
|
479
|
+
}), Fr = (t) => ({
|
|
480
|
+
top: v(t),
|
|
481
|
+
left: $(t),
|
|
482
|
+
width: M(t),
|
|
483
|
+
height: j(t)
|
|
484
|
+
}), Re = (t, e, r = !1) => {
|
|
485
|
+
const n = I(e) === "y" ? ue(t) : ie(t);
|
|
486
|
+
return r ? n : Math.abs(n);
|
|
487
|
+
}, F = (t, e) => {
|
|
488
|
+
const r = y(t);
|
|
489
|
+
return {
|
|
490
|
+
x: e.x === "center" ? xe(r).x : z(r, e.x),
|
|
491
|
+
y: e.y === "center" ? xe(r).y : z(r, e.y)
|
|
492
|
+
};
|
|
493
|
+
}, z = (t, e) => {
|
|
494
|
+
const r = y(t), n = nt(r.root).includes(e) ? Math.min : Math.max;
|
|
495
|
+
return re.includes(e) ? n(r.one.x, r.two.x) : n(r.one.y, r.two.y);
|
|
496
|
+
}, Xr = (t) => t.one.x === t.two.x && t.one.y === t.two.y, M = (t) => Re(t, "x"), j = (t) => Re(t, "y"), ie = (t) => {
|
|
497
|
+
const e = y(t);
|
|
498
|
+
return e.two.x - e.one.x;
|
|
499
|
+
}, ue = (t) => {
|
|
500
|
+
const e = y(t);
|
|
501
|
+
return e.two.y - e.one.y;
|
|
502
|
+
}, yt = (t) => F(t, k), Dr = (t) => F(t, Be), qr = (t) => F(t, se), Vr = (t) => F(t, Ne), B = (t) => z(t, "right"), N = (t) => z(t, "bottom"), $ = (t) => z(t, "left"), v = (t) => z(t, "top"), xe = (t) => Y(yt(t), {
|
|
503
|
+
x: ie(t) / 2,
|
|
504
|
+
y: ue(t) / 2
|
|
505
|
+
}), Le = (t) => {
|
|
506
|
+
const e = y(t);
|
|
507
|
+
return e.root.x === "left" ? $(e) : B(e);
|
|
508
|
+
}, _e = (t) => {
|
|
509
|
+
const e = y(t);
|
|
510
|
+
return e.root.y === "top" ? v(e) : N(e);
|
|
511
|
+
}, Ur = (t) => ({ x: Le(t), y: _e(t) }), K = (t) => {
|
|
512
|
+
const e = y(t);
|
|
513
|
+
return { lower: e.one.x, upper: e.two.x };
|
|
514
|
+
}, J = (t) => {
|
|
515
|
+
const e = y(t);
|
|
516
|
+
return { lower: e.one.y, upper: e.two.y };
|
|
517
|
+
}, Gr = (t, e) => pt(t, e), Kr = (t, e) => {
|
|
518
|
+
const r = y(t), n = re.includes(e) ? "x" : ne.includes(e) ? "y" : null;
|
|
519
|
+
if (n === null) throw new Error(`Invalid location: ${ot}`);
|
|
520
|
+
const o = e === "top" || e === "left" ? Math.min : Math.max, s = { ...r.one }, u = { ...r.two };
|
|
521
|
+
return s[n] = o(r.one[n], r.two[n]), u[n] = o(r.one[n], r.two[n]), [s, u];
|
|
522
|
+
}, Jr = (t, e) => {
|
|
523
|
+
const r = y(t), n = y(e), o = Le(n) + (M(n) - M(r)) / 2, s = _e(n) + (j(n) - j(r)) / 2;
|
|
524
|
+
return y({ x: o, y: s }, ht(r));
|
|
525
|
+
}, ft = (t) => typeof t != "object" || t == null ? !1 : "one" in t && "two" in t && "root" in t, Qr = (t) => M(t) / j(t), en = (t, e, r) => {
|
|
526
|
+
if (typeof e == "string") {
|
|
527
|
+
if (r == null) throw new Error("Undefined amount passed into box.translate");
|
|
528
|
+
const o = I(e);
|
|
529
|
+
e = f(o, r);
|
|
530
|
+
}
|
|
531
|
+
const n = y(t);
|
|
532
|
+
return y(
|
|
533
|
+
Y(n.one, e),
|
|
534
|
+
Y(n.two, e),
|
|
535
|
+
void 0,
|
|
536
|
+
void 0,
|
|
537
|
+
n.root
|
|
538
|
+
);
|
|
539
|
+
}, tn = (t, e) => {
|
|
540
|
+
const r = Math.max($(t), $(e)), n = Math.max(v(t), v(e)), o = Math.min(B(t), B(e)), s = Math.min(N(t), N(e));
|
|
541
|
+
return r > o || n > s ? lt : y({ x: r, y: n }, { x: o, y: s }, void 0, void 0, t.root);
|
|
542
|
+
}, rn = (t) => M(t) * j(t), nn = (t, e) => {
|
|
543
|
+
const r = y(t);
|
|
544
|
+
return y(
|
|
545
|
+
be(r.one, e),
|
|
546
|
+
be(r.two, e),
|
|
547
|
+
void 0,
|
|
548
|
+
void 0,
|
|
549
|
+
r.root
|
|
550
|
+
);
|
|
551
|
+
}, on = (t, e, r, n, o, s) => {
|
|
552
|
+
const u = { x: t, y: e }, a = { x: t + r, y: e + n };
|
|
553
|
+
return o.x !== s.x && (o.x === "center" ? (u.x -= r / 2, a.x -= r / 2) : (u.x -= r, a.x -= r)), o.y !== s.y && (o.y === "center" ? (u.y -= n / 2, a.y -= n / 2) : (u.y -= n, a.y -= n)), y(u, a, void 0, void 0, s);
|
|
554
|
+
}, qn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
555
|
+
__proto__: null,
|
|
556
|
+
DECIMAL: Zr,
|
|
557
|
+
ZERO: lt,
|
|
558
|
+
area: rn,
|
|
559
|
+
areaIsZero: Xr,
|
|
560
|
+
aspect: Qr,
|
|
561
|
+
bottom: N,
|
|
562
|
+
bottomLeft: qr,
|
|
563
|
+
bottomRight: Vr,
|
|
564
|
+
box: Pr,
|
|
565
|
+
center: xe,
|
|
566
|
+
construct: y,
|
|
567
|
+
constructWithAlternateRoot: on,
|
|
568
|
+
contains: Wr,
|
|
569
|
+
copy: pt,
|
|
570
|
+
css: Fr,
|
|
571
|
+
cssBox: Lr,
|
|
572
|
+
dim: Re,
|
|
573
|
+
dims: ht,
|
|
574
|
+
domRect: _r,
|
|
575
|
+
edgePoints: Kr,
|
|
576
|
+
equals: Yr,
|
|
577
|
+
height: j,
|
|
578
|
+
intersection: tn,
|
|
579
|
+
isBox: ft,
|
|
580
|
+
left: $,
|
|
581
|
+
loc: z,
|
|
582
|
+
positionInCenter: Jr,
|
|
583
|
+
reRoot: Gr,
|
|
584
|
+
resize: Hr,
|
|
585
|
+
right: B,
|
|
586
|
+
root: Ur,
|
|
587
|
+
signedDims: kr,
|
|
588
|
+
signedHeight: ue,
|
|
589
|
+
signedWidth: ie,
|
|
590
|
+
top: v,
|
|
591
|
+
topLeft: yt,
|
|
592
|
+
topRight: Dr,
|
|
593
|
+
translate: en,
|
|
594
|
+
truncate: nn,
|
|
595
|
+
width: M,
|
|
596
|
+
x: Le,
|
|
597
|
+
xBounds: K,
|
|
598
|
+
xyLoc: F,
|
|
599
|
+
y: _e,
|
|
600
|
+
yBounds: J
|
|
601
|
+
}, Symbol.toStringTag, { value: "Module" })), dt = i.object({ signedWidth: i.number(), signedHeight: i.number() }), sn = i.union([Oe, dt, H, te]), un = { width: 0, height: 0 }, an = { width: 1, height: 1 }, g = (t, e) => typeof t == "number" ? { width: t, height: e ?? t } : Array.isArray(t) ? { width: t[0], height: t[1] } : "x" in t ? { width: t.x, height: t.y } : "signedWidth" in t ? { width: t.signedWidth, height: t.signedHeight } : { ...t }, cn = (t, e) => {
|
|
602
|
+
if (e == null) return !1;
|
|
603
|
+
const r = g(t), n = g(e);
|
|
604
|
+
return r.width === n.width && r.height === n.height;
|
|
605
|
+
}, ln = (t) => {
|
|
606
|
+
const e = g(t);
|
|
607
|
+
return { width: e.height, height: e.width };
|
|
608
|
+
}, pn = (t) => {
|
|
609
|
+
const e = g(t);
|
|
610
|
+
return `0 0 ${e.width} ${e.height}`;
|
|
611
|
+
}, hn = (t) => {
|
|
612
|
+
const e = g(t);
|
|
613
|
+
return [e.width, e.height];
|
|
614
|
+
}, yn = (t) => ({
|
|
615
|
+
width: Math.max(...t.map((e) => g(e).width)),
|
|
616
|
+
height: Math.max(...t.map((e) => g(e).height))
|
|
617
|
+
}), fn = (t) => ({
|
|
618
|
+
width: Math.min(...t.map((e) => g(e).width)),
|
|
619
|
+
height: Math.min(...t.map((e) => g(e).height))
|
|
620
|
+
}), dn = (t, e) => {
|
|
621
|
+
const r = g(t);
|
|
622
|
+
return { width: r.width * e, height: r.height * e };
|
|
623
|
+
}, Vn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
624
|
+
__proto__: null,
|
|
625
|
+
DECIMAL: an,
|
|
626
|
+
ZERO: un,
|
|
627
|
+
construct: g,
|
|
628
|
+
couple: hn,
|
|
629
|
+
crude: sn,
|
|
630
|
+
dimensions: Oe,
|
|
631
|
+
equals: cn,
|
|
632
|
+
max: yn,
|
|
633
|
+
min: fn,
|
|
634
|
+
scale: dn,
|
|
635
|
+
signed: dt,
|
|
636
|
+
svgViewBox: pn,
|
|
637
|
+
swap: ln
|
|
638
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
639
|
+
var gn = Object.defineProperty, bn = (t, e, r) => e in t ? gn(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r, w = (t, e, r) => bn(t, typeof e != "symbol" ? e + "" : e, r);
|
|
640
|
+
const xn = (t, e, r) => e !== void 0 && t < e ? e : r !== void 0 && t > r ? r : t, mn = i.object({ offset: ge, scale: ge }), wn = i.object({ offset: i.number(), scale: i.number() }), $n = (t) => (e, r, n, o) => r === "dimension" ? [e, n] : [
|
|
641
|
+
e,
|
|
642
|
+
o ? n - t : n + t
|
|
643
|
+
], vn = (t) => (e, r, n, o) => [
|
|
644
|
+
e,
|
|
645
|
+
o ? n / t : n * t
|
|
646
|
+
], On = (t) => (e, r, n) => {
|
|
647
|
+
if (e === null) return [t, n];
|
|
648
|
+
const { lower: o, upper: s } = e, { lower: u, upper: a } = t, c = s - o, l = a - u;
|
|
649
|
+
if (r === "dimension") return [t, n * (l / c)];
|
|
650
|
+
const h = (n - o) * (l / c) + u;
|
|
651
|
+
return [t, h];
|
|
652
|
+
}, Mn = (t) => (e, r, n) => [t, n], jn = () => (t, e, r) => {
|
|
653
|
+
if (t === null) throw new Error("cannot invert without bounds");
|
|
654
|
+
if (e === "dimension") return [t, r];
|
|
655
|
+
const { lower: n, upper: o } = t;
|
|
656
|
+
return [t, o - (r - n)];
|
|
657
|
+
}, Tn = (t) => (e, r, n) => {
|
|
658
|
+
const { lower: o, upper: s } = t;
|
|
659
|
+
return n = xn(n, o, s), [e, n];
|
|
660
|
+
}, me = class P {
|
|
661
|
+
constructor() {
|
|
662
|
+
w(this, "ops", []), w(this, "currBounds", null), w(this, "currType", null), w(this, "reversed", !1), this.ops = [];
|
|
663
|
+
}
|
|
664
|
+
/**
|
|
665
|
+
* @returns a new scale with a translation as its first operation. Any number provided
|
|
666
|
+
* to the {@link pos} operation on the scale will be translated by the specified value.
|
|
667
|
+
* @param value - The amount to translate by.
|
|
668
|
+
*/
|
|
669
|
+
static translate(e) {
|
|
670
|
+
return new P().translate(e);
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* @returns a new scale with a magnification as its first operation. Any number provided
|
|
674
|
+
* to the {@link pos} or {@link dim} operation will be multiplied by the specified value.
|
|
675
|
+
* @param value - The amount to translate by.
|
|
676
|
+
*/
|
|
677
|
+
static magnify(e) {
|
|
678
|
+
return new P().magnify(e);
|
|
679
|
+
}
|
|
680
|
+
static scale(e, r) {
|
|
681
|
+
return new P().scale(e, r);
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* @returns a copy of the scale with a translation as its next operation. Any
|
|
685
|
+
* number provided to the {@link pos} method on the scale will be translated by the
|
|
686
|
+
* specified value.
|
|
687
|
+
* @param value - The amount to translate by.
|
|
688
|
+
*/
|
|
689
|
+
translate(e) {
|
|
690
|
+
const r = this.new(), n = $n(e);
|
|
691
|
+
return n.type = "translate", r.ops.push(n), r;
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* @returns a copy of the scale with a translation as its next operation. Any number
|
|
695
|
+
* provided to the {@link pos} or {@link dim} method on the scale will be multiplied
|
|
696
|
+
* by the specified value.
|
|
697
|
+
* @param value - The amount to magnify by.
|
|
698
|
+
*/
|
|
699
|
+
magnify(e) {
|
|
700
|
+
const r = this.new(), n = vn(e);
|
|
701
|
+
return n.type = "magnify", r.ops.push(n), r;
|
|
702
|
+
}
|
|
703
|
+
scale(e, r) {
|
|
704
|
+
const n = p(e, r), o = this.new(), s = On(n);
|
|
705
|
+
return s.type = "scale", o.ops.push(s), o;
|
|
706
|
+
}
|
|
707
|
+
clamp(e, r) {
|
|
708
|
+
const n = p(e, r), o = this.new(), s = Tn(n);
|
|
709
|
+
return s.type = "clamp", o.ops.push(s), o;
|
|
710
|
+
}
|
|
711
|
+
reBound(e, r) {
|
|
712
|
+
const n = p(e, r), o = this.new(), s = Mn(n);
|
|
713
|
+
return s.type = "re-bound", o.ops.push(s), o;
|
|
714
|
+
}
|
|
715
|
+
invert() {
|
|
716
|
+
const e = jn();
|
|
717
|
+
e.type = "invert";
|
|
718
|
+
const r = this.new();
|
|
719
|
+
return r.ops.push(e), r;
|
|
720
|
+
}
|
|
721
|
+
pos(e) {
|
|
722
|
+
return this.exec("position", e);
|
|
723
|
+
}
|
|
724
|
+
dim(e) {
|
|
725
|
+
return this.exec("dimension", e);
|
|
726
|
+
}
|
|
727
|
+
new() {
|
|
728
|
+
const e = new P();
|
|
729
|
+
return e.ops = this.ops.slice(), e.reversed = this.reversed, e;
|
|
730
|
+
}
|
|
731
|
+
exec(e, r) {
|
|
732
|
+
return this.currBounds = null, this.ops.reduce(
|
|
733
|
+
([n, o], s) => s(n, e, o, this.reversed),
|
|
734
|
+
[null, r]
|
|
735
|
+
)[1];
|
|
736
|
+
}
|
|
737
|
+
reverse() {
|
|
738
|
+
const e = this.new();
|
|
739
|
+
e.ops.reverse();
|
|
740
|
+
const r = [];
|
|
741
|
+
return e.ops.forEach((n, o) => {
|
|
742
|
+
if (n.type === "scale" || r.some(([u, a]) => o >= u && o <= a))
|
|
743
|
+
return;
|
|
744
|
+
const s = e.ops.findIndex((u, a) => u.type === "scale" && a > o);
|
|
745
|
+
s !== -1 && r.push([o, s]);
|
|
746
|
+
}), r.forEach(([n, o]) => {
|
|
747
|
+
const s = e.ops.slice(n, o);
|
|
748
|
+
s.unshift(e.ops[o]), e.ops.splice(n, o - n + 1, ...s);
|
|
749
|
+
}), e.reversed = !e.reversed, e;
|
|
750
|
+
}
|
|
751
|
+
get transform() {
|
|
752
|
+
return { scale: this.dim(1), offset: this.pos(0) };
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
w(me, "IDENTITY", new me());
|
|
756
|
+
let we = me;
|
|
757
|
+
const $e = class m {
|
|
758
|
+
constructor(e = new we(), r = new we(), n = null) {
|
|
759
|
+
w(this, "x"), w(this, "y"), w(this, "currRoot"), this.x = e, this.y = r, this.currRoot = n;
|
|
760
|
+
}
|
|
761
|
+
static translate(e, r) {
|
|
762
|
+
return new m().translate(e, r);
|
|
763
|
+
}
|
|
764
|
+
static translateX(e) {
|
|
765
|
+
return new m().translateX(e);
|
|
766
|
+
}
|
|
767
|
+
static translateY(e) {
|
|
768
|
+
return new m().translateY(e);
|
|
769
|
+
}
|
|
770
|
+
static clamp(e) {
|
|
771
|
+
return new m().clamp(e);
|
|
772
|
+
}
|
|
773
|
+
static magnify(e) {
|
|
774
|
+
return new m().magnify(e);
|
|
775
|
+
}
|
|
776
|
+
static scale(e) {
|
|
777
|
+
return new m().scale(e);
|
|
778
|
+
}
|
|
779
|
+
static reBound(e) {
|
|
780
|
+
return new m().reBound(e);
|
|
781
|
+
}
|
|
782
|
+
translate(e, r) {
|
|
783
|
+
const n = f(e, r), o = this.copy();
|
|
784
|
+
return o.x = this.x.translate(n.x), o.y = this.y.translate(n.y), o;
|
|
785
|
+
}
|
|
786
|
+
translateX(e) {
|
|
787
|
+
const r = this.copy();
|
|
788
|
+
return r.x = this.x.translate(e), r;
|
|
789
|
+
}
|
|
790
|
+
translateY(e) {
|
|
791
|
+
const r = this.copy();
|
|
792
|
+
return r.y = this.y.translate(e), r;
|
|
793
|
+
}
|
|
794
|
+
magnify(e) {
|
|
795
|
+
const r = this.copy();
|
|
796
|
+
return r.x = this.x.magnify(e.x), r.y = this.y.magnify(e.y), r;
|
|
797
|
+
}
|
|
798
|
+
scale(e) {
|
|
799
|
+
const r = this.copy();
|
|
800
|
+
if (ft(e)) {
|
|
801
|
+
const n = this.currRoot;
|
|
802
|
+
return r.currRoot = e.root, n != null && !Ce(n, e.root) && (n.x !== e.root.x && (r.x = r.x.invert()), n.y !== e.root.y && (r.y = r.y.invert())), r.x = r.x.scale(K(e)), r.y = r.y.scale(J(e)), r;
|
|
803
|
+
}
|
|
804
|
+
return r.x = r.x.scale(e.width), r.y = r.y.scale(e.height), r;
|
|
805
|
+
}
|
|
806
|
+
reBound(e) {
|
|
807
|
+
const r = this.copy();
|
|
808
|
+
return r.x = this.x.reBound(K(e)), r.y = this.y.reBound(J(e)), r;
|
|
809
|
+
}
|
|
810
|
+
clamp(e) {
|
|
811
|
+
const r = this.copy();
|
|
812
|
+
return r.x = this.x.clamp(K(e)), r.y = this.y.clamp(J(e)), r;
|
|
813
|
+
}
|
|
814
|
+
copy() {
|
|
815
|
+
const e = new m();
|
|
816
|
+
return e.currRoot = this.currRoot, e.x = this.x, e.y = this.y, e;
|
|
817
|
+
}
|
|
818
|
+
reverse() {
|
|
819
|
+
const e = this.copy();
|
|
820
|
+
return e.x = this.x.reverse(), e.y = this.y.reverse(), e;
|
|
821
|
+
}
|
|
822
|
+
pos(e) {
|
|
823
|
+
return { x: this.x.pos(e.x), y: this.y.pos(e.y) };
|
|
824
|
+
}
|
|
825
|
+
dim(e) {
|
|
826
|
+
return { x: this.x.dim(e.x), y: this.y.dim(e.y) };
|
|
827
|
+
}
|
|
828
|
+
box(e) {
|
|
829
|
+
return y(
|
|
830
|
+
this.pos(e.one),
|
|
831
|
+
this.pos(e.two),
|
|
832
|
+
0,
|
|
833
|
+
0,
|
|
834
|
+
this.currRoot ?? e.root
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
get transform() {
|
|
838
|
+
return {
|
|
839
|
+
scale: this.dim({ x: 1, y: 1 }),
|
|
840
|
+
offset: this.pos({ x: 0, y: 0 })
|
|
841
|
+
};
|
|
842
|
+
}
|
|
843
|
+
};
|
|
844
|
+
w($e, "IDENTITY", new $e());
|
|
845
|
+
let In = $e;
|
|
846
|
+
const Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
847
|
+
__proto__: null,
|
|
848
|
+
Scale: we,
|
|
849
|
+
XY: In,
|
|
850
|
+
crudeXYTransform: mn,
|
|
851
|
+
transform: wn
|
|
852
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
853
|
+
function gt(t) {
|
|
854
|
+
var e, r, n = "";
|
|
855
|
+
if (typeof t == "string" || typeof t == "number") n += t;
|
|
856
|
+
else if (typeof t == "object") if (Array.isArray(t)) {
|
|
857
|
+
var o = t.length;
|
|
858
|
+
for (e = 0; e < o; e++) t[e] && (r = gt(t[e])) && (n && (n += " "), n += r);
|
|
859
|
+
} else for (r in t) t[r] && (n && (n += " "), n += r);
|
|
860
|
+
return n;
|
|
861
|
+
}
|
|
862
|
+
function En() {
|
|
863
|
+
for (var t, e, r = 0, n = "", o = arguments.length; r < o; r++) (t = arguments[r]) && (e = gt(t)) && (n && (n += " "), n += e);
|
|
864
|
+
return n;
|
|
865
|
+
}
|
|
866
|
+
const Sn = En, He = "-", We = "__", D = "--", bt = (t) => {
|
|
867
|
+
const e = (...r) => Sn(...r);
|
|
868
|
+
return e.B = (r) => t + He + r, e.E = (r) => t + We + r, e.M = (r) => t + D + r, e.BM = (r, n) => e.B(r) + D + n, e.BE = (r, n) => e.B(r) + We + n, e.BEM = (r, n, o) => e.BE(r, n) + D + o, e.extend = (r) => bt(e.B(r)), e.var = (r) => D + t + He + r, e;
|
|
869
|
+
}, Bn = /^#?([0-9a-f]{6}|[0-9a-f]{8})$/i, ve = i.string().regex(Bn), A = i.number().min(0).max(255), Nn = i.number().min(0).max(1), Pe = i.tuple([A, A, A, Nn]), xt = i.tuple([A, A, A]), mt = i.object({ rgba255: Pe }), Gn = (t) => t == null ? void 0 : new d(t).hex, Kn = (t) => {
|
|
870
|
+
if (t == null) return;
|
|
871
|
+
const e = d.z.safeParse(t);
|
|
872
|
+
if (e.success) return e.data.rgbaCSS;
|
|
873
|
+
if (typeof t == "string") return t;
|
|
874
|
+
throw e.error;
|
|
875
|
+
}, b = class b {
|
|
876
|
+
/**
|
|
877
|
+
* @constructor Creates a new color from the given color value. The color value can be
|
|
878
|
+
* a hex string, an array of RGB or RGBA values, or another color.
|
|
879
|
+
*
|
|
880
|
+
* @param color - The color value to create the color from. If the color value is a
|
|
881
|
+
* string, it must be a valid hex color (with or without the '#') with a hasheless
|
|
882
|
+
* length 6 or 8. If the hex color is 8 characters long, the last twoc haracters are
|
|
883
|
+
* used as the alpha value. If the color value is an array, it must be an array of
|
|
884
|
+
* length 3 or 4, with each value between 0 and 255. If the color value is another
|
|
885
|
+
* color, the color will be copied.
|
|
886
|
+
*
|
|
887
|
+
* @param alpha - An optional alpha value to set. If the color value carries its own
|
|
888
|
+
* alpha value, this value will be ignored. Defaults to 1.
|
|
889
|
+
*/
|
|
890
|
+
constructor(e, r = 1) {
|
|
891
|
+
/**
|
|
892
|
+
* @property the color as an RGBA tuple, with each color value between 0 and 255,
|
|
893
|
+
* and the alpha value between 0 and 1.
|
|
894
|
+
*/
|
|
895
|
+
C(this, "rgba255");
|
|
896
|
+
if (typeof e == "string") this.rgba255 = b.fromHex(e, r);
|
|
897
|
+
else if (Array.isArray(e)) {
|
|
898
|
+
if (e.length < 3 || e.length > 4)
|
|
899
|
+
throw new Error(`Invalid color: [${e.join(", ")}]`);
|
|
900
|
+
this.rgba255 = e.length === 3 ? [...e, r ?? 1] : e;
|
|
901
|
+
} else this.rgba255 = e.rgba255;
|
|
902
|
+
}
|
|
903
|
+
/**
|
|
904
|
+
* @returns true if the given color is semantically equal to this color. Different
|
|
905
|
+
* representations of the same color are considered equal (e.g. hex and rgba).
|
|
906
|
+
*/
|
|
907
|
+
equals(e) {
|
|
908
|
+
if (e == null) return !1;
|
|
909
|
+
const r = new b(e);
|
|
910
|
+
return this.rgba255.every((n, o) => n === r.rgba255[o]);
|
|
911
|
+
}
|
|
912
|
+
/**
|
|
913
|
+
* @returns the hex representation of the color. If the color has an opacity of 1,
|
|
914
|
+
* the returned hex will be 6 characters long. Otherwise, it will be 8 characters
|
|
915
|
+
* long.
|
|
916
|
+
*/
|
|
917
|
+
get hex() {
|
|
918
|
+
const [e, r, n, o] = this.rgba255;
|
|
919
|
+
return `#${q(e)}${q(r)}${q(n)}${o === 1 ? "" : q(o * 255)}`;
|
|
920
|
+
}
|
|
921
|
+
/**
|
|
922
|
+
* @returns the color as a CSS RGBA string.
|
|
923
|
+
*/
|
|
924
|
+
get rgbaCSS() {
|
|
925
|
+
const [e, r, n, o] = this.rgba255;
|
|
926
|
+
return `rgba(${e}, ${r}, ${n}, ${o})`;
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* @returns the color as a CSS RGB string with no alpha value.
|
|
930
|
+
*/
|
|
931
|
+
get rgbCSS() {
|
|
932
|
+
return `rgb(${this.rgbString})`;
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* @returns the color as an RGB string, with each color value between 0 and 255.
|
|
936
|
+
* @example "255, 255, 255"
|
|
937
|
+
*/
|
|
938
|
+
get rgbString() {
|
|
939
|
+
const [e, r, n] = this.rgba255;
|
|
940
|
+
return `${e}, ${r}, ${n}`;
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* @returns the color as an RGBA tuple, with each color value between 0 and 1,
|
|
944
|
+
* and the alpha value between 0 and 1.
|
|
945
|
+
*/
|
|
946
|
+
get rgba1() {
|
|
947
|
+
return [...this.rgb1, this.rgba255[3]];
|
|
948
|
+
}
|
|
949
|
+
get rgb1() {
|
|
950
|
+
return [this.rgba255[0] / 255, this.rgba255[1] / 255, this.rgba255[2] / 255];
|
|
951
|
+
}
|
|
952
|
+
/** @returns the red value of the color, between 0 and 255. */
|
|
953
|
+
get r() {
|
|
954
|
+
return this.rgba255[0];
|
|
955
|
+
}
|
|
956
|
+
/** @returns the green value of the color, between 0 and 255. */
|
|
957
|
+
get g() {
|
|
958
|
+
return this.rgba255[1];
|
|
959
|
+
}
|
|
960
|
+
/** @returns the blue value of the color, between 0 and 255. */
|
|
961
|
+
get b() {
|
|
962
|
+
return this.rgba255[2];
|
|
963
|
+
}
|
|
964
|
+
/** @returns the alpha value of the color, between 0 and 1. */
|
|
965
|
+
get a() {
|
|
966
|
+
return this.rgba255[3];
|
|
967
|
+
}
|
|
968
|
+
/** @returns true if all RGBA values are 0. */
|
|
969
|
+
get isZero() {
|
|
970
|
+
return this.equals(wt);
|
|
971
|
+
}
|
|
972
|
+
get hsla() {
|
|
973
|
+
return Cn(this.rgba255);
|
|
974
|
+
}
|
|
975
|
+
/**
|
|
976
|
+
* Creates a new color with the given alpha.
|
|
977
|
+
*
|
|
978
|
+
* @param alpha - The alpha value to set. If the value is greater than 1, it will be
|
|
979
|
+
* divided by 100.
|
|
980
|
+
* @returns A new color with the given alpha.
|
|
981
|
+
*/
|
|
982
|
+
setAlpha(e) {
|
|
983
|
+
const [r, n, o] = this.rgba255;
|
|
984
|
+
if (e > 100)
|
|
985
|
+
throw new Error(`Color opacity must be between 0 and 100, got ${e}`);
|
|
986
|
+
return e > 1 && (e /= 100), new b([r, n, o, e]);
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* @returns the luminance of the color, between 0 and 1.
|
|
990
|
+
*/
|
|
991
|
+
get luminance() {
|
|
992
|
+
const [e, r, n] = this.rgb1.map(
|
|
993
|
+
(o) => o <= 0.03928 ? o / 12.92 : ((o + 0.055) / 1.055) ** 2.4
|
|
994
|
+
);
|
|
995
|
+
return Number((0.2126 * e + 0.7152 * r + 0.0722 * n).toFixed(3));
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* @returns the contrast ratio between this color and the given color. The contrast
|
|
999
|
+
* ratio is a number between 1 and 21, where 1 is the lowest contrast and 21 is the
|
|
1000
|
+
* highest.
|
|
1001
|
+
* @param other
|
|
1002
|
+
* @returns
|
|
1003
|
+
*/
|
|
1004
|
+
contrast(e) {
|
|
1005
|
+
const r = new b(e), n = this.luminance, o = r.luminance;
|
|
1006
|
+
return (Math.max(n, o) + 0.5) / (Math.min(n, o) + 0.5);
|
|
1007
|
+
}
|
|
1008
|
+
pickByContrast(...e) {
|
|
1009
|
+
if (e.length === 0)
|
|
1010
|
+
throw new Error("[Color.pickByContrast] - must provide at least one color");
|
|
1011
|
+
const [r] = e.map((n) => new b(n)).sort((n, o) => this.contrast(o) - this.contrast(n));
|
|
1012
|
+
return r;
|
|
1013
|
+
}
|
|
1014
|
+
get isDark() {
|
|
1015
|
+
return this.luminance < 0.5;
|
|
1016
|
+
}
|
|
1017
|
+
get isLight() {
|
|
1018
|
+
return !this.isDark;
|
|
1019
|
+
}
|
|
1020
|
+
static fromHex(e, r = 1) {
|
|
1021
|
+
if (!ve.safeParse(e).success) throw new Error(`Invalid hex color: ${e}`);
|
|
1022
|
+
return e = zn(e), [
|
|
1023
|
+
V(e, 0),
|
|
1024
|
+
V(e, 2),
|
|
1025
|
+
V(e, 4),
|
|
1026
|
+
e.length === 8 ? V(e, 6) / 255 : r
|
|
1027
|
+
];
|
|
1028
|
+
}
|
|
1029
|
+
};
|
|
1030
|
+
C(b, "z", i.union([ve, Pe, xt, i.instanceof(b), mt]).transform((e) => new b(e)));
|
|
1031
|
+
let d = b;
|
|
1032
|
+
const wt = new d([0, 0, 0, 0]), q = (t) => Math.floor(t).toString(16).padStart(2, "0"), V = (t, e) => parseInt(t.slice(e, e + 2), 16), zn = (t) => t.startsWith("#") ? t.slice(1) : t, Jn = (t) => {
|
|
1033
|
+
let [e, r, n] = t;
|
|
1034
|
+
const o = t[3];
|
|
1035
|
+
e /= 360, r /= 100, n /= 100;
|
|
1036
|
+
let s, u, a;
|
|
1037
|
+
if (r === 0)
|
|
1038
|
+
s = u = a = n;
|
|
1039
|
+
else {
|
|
1040
|
+
const c = n < 0.5 ? n * (1 + r) : n + r - n * r, l = 2 * n - c;
|
|
1041
|
+
s = ce(l, c, e + 1 / 3), u = ce(l, c, e), a = ce(l, c, e - 1 / 3);
|
|
1042
|
+
}
|
|
1043
|
+
return [Math.round(s * 255), Math.round(u * 255), Math.round(a * 255), o];
|
|
1044
|
+
}, ce = (t, e, r) => (r < 0 && (r += 1), r > 1 && (r -= 1), r < 1 / 6 ? t + (e - t) * 6 * r : r < 1 / 2 ? e : r < 2 / 3 ? t + (e - t) * (2 / 3 - r) * 6 : t), Cn = (t) => {
|
|
1045
|
+
let [e, r, n] = t;
|
|
1046
|
+
const o = t[3];
|
|
1047
|
+
e /= 255, r /= 255, n /= 255, e /= 255, r /= 255, n /= 255;
|
|
1048
|
+
const s = Math.max(e, r, n), u = Math.min(e, r, n);
|
|
1049
|
+
let a, c, l = (s + u) / 2;
|
|
1050
|
+
if (s === u)
|
|
1051
|
+
a = c = 0;
|
|
1052
|
+
else {
|
|
1053
|
+
const h = s - u;
|
|
1054
|
+
c = l > 0.5 ? h / (2 - s - u) : h / (s + u), s === e ? a = (r - n) / h + (r < n ? 6 : 0) : s === r ? a = (n - e) / h + 2 : a = (e - r) / h + 4, a /= 6;
|
|
1055
|
+
}
|
|
1056
|
+
return a *= 360, c *= 100, l *= 100, [Math.round(a), Math.round(c), Math.round(l), o];
|
|
1057
|
+
}, An = i.union([
|
|
1058
|
+
ve,
|
|
1059
|
+
Pe,
|
|
1060
|
+
i.instanceof(d),
|
|
1061
|
+
i.string(),
|
|
1062
|
+
xt,
|
|
1063
|
+
mt
|
|
1064
|
+
]), Rn = i.object({
|
|
1065
|
+
key: i.string(),
|
|
1066
|
+
color: An,
|
|
1067
|
+
position: i.number(),
|
|
1068
|
+
switched: i.boolean().optional()
|
|
1069
|
+
}), Qn = i.array(Rn), eo = (t, e) => {
|
|
1070
|
+
if (t.length === 0) return wt;
|
|
1071
|
+
if (t = t.slice().sort((r, n) => r.position - n.position), e <= t[0].position) return new d(t[0].color);
|
|
1072
|
+
if (e >= t[t.length - 1].position)
|
|
1073
|
+
return new d(t[t.length - 1].color);
|
|
1074
|
+
for (let r = 0; r < t.length - 1; r++) {
|
|
1075
|
+
const n = t[r], o = t[r + 1];
|
|
1076
|
+
if (e >= n.position && e <= o.position) {
|
|
1077
|
+
if (e === n.position) return new d(n.color);
|
|
1078
|
+
if (e === o.position) return new d(o.color);
|
|
1079
|
+
const s = (e - n.position) / (o.position - n.position), u = new d(n.color), a = new d(o.color), c = Math.round(u.r + s * (a.r - u.r)), l = Math.round(u.g + s * (a.g - u.g)), h = Math.round(u.b + s * (a.b - u.b)), E = u.a + s * (a.a - u.a);
|
|
1080
|
+
return new d([c, l, h, E]);
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
return new d(t[t.length - 1].color);
|
|
1084
|
+
}, Ln = i.object({
|
|
1085
|
+
key: i.string(),
|
|
1086
|
+
name: i.string(),
|
|
1087
|
+
color: d.z
|
|
1088
|
+
}), to = i.object({
|
|
1089
|
+
key: i.string(),
|
|
1090
|
+
name: i.string(),
|
|
1091
|
+
swatches: i.array(Ln)
|
|
1092
|
+
});
|
|
1093
|
+
class _n {
|
|
1094
|
+
constructor(e = "") {
|
|
1095
|
+
C(this, "rows", []);
|
|
1096
|
+
C(this, "columns", []);
|
|
1097
|
+
C(this, "prefix");
|
|
1098
|
+
this.prefix = e;
|
|
1099
|
+
}
|
|
1100
|
+
row(e, r, n) {
|
|
1101
|
+
const { prefix: o } = this;
|
|
1102
|
+
return this.rows.push({ startLabel: o + e, endLabel: o + r, size: n }), this;
|
|
1103
|
+
}
|
|
1104
|
+
col(e, r, n) {
|
|
1105
|
+
const { prefix: o } = this;
|
|
1106
|
+
return this.columns.push({ startLabel: o + e, endLabel: o + r, size: n }), this;
|
|
1107
|
+
}
|
|
1108
|
+
build() {
|
|
1109
|
+
return {
|
|
1110
|
+
display: "grid",
|
|
1111
|
+
gridTemplateRows: this.rows.map((e, r) => {
|
|
1112
|
+
let n = r === 0 ? "[" : "";
|
|
1113
|
+
return n += `${e.startLabel}] ${e.size}${typeof e.size == "number" ? "px" : ""} [${e.endLabel}`, n += r === this.rows.length - 1 ? "]" : "", n;
|
|
1114
|
+
}).join(" "),
|
|
1115
|
+
gridTemplateColumns: this.columns.map((e, r) => {
|
|
1116
|
+
let n = r === 0 ? "[" : "";
|
|
1117
|
+
return n += `${e.startLabel}] ${e.size}${typeof e.size == "number" ? "px" : ""} [${e.endLabel}`, n += r === this.columns.length - 1 ? "]" : "", n;
|
|
1118
|
+
}).join(" ")
|
|
1119
|
+
};
|
|
1120
|
+
}
|
|
1121
|
+
}
|
|
1122
|
+
const Pn = (t, e) => Object.entries(e).forEach(
|
|
1123
|
+
([r, n]) => n != null && t.style.setProperty(r, `${n}`)
|
|
1124
|
+
), Zn = (t, e) => Array.from(t.style).forEach((r) => {
|
|
1125
|
+
r.startsWith(e) && t.style.removeProperty(r);
|
|
1126
|
+
}), Hn = (t) => {
|
|
1127
|
+
const e = bt(t);
|
|
1128
|
+
return e.visible = (r) => e.M(r ? "visible" : "hidden"), e.expanded = (r) => e.M(r ? "expanded" : "collapsed"), e.loc = (r) => e.M(ot.construct(r)), e.disabled = (r) => r === !0 && e.M("disabled"), e.align = (r) => e.M(r), e.dir = (r) => r != null && e.M(ir.construct(r)), e.size = (r) => typeof r == "string" && e.M(r), e.sharp = (r) => r !== !1 && e.M("sharp"), e.rounded = (r) => r !== !1 && e.M("rounded"), e.bordered = (r) => typeof r == "boolean" ? r && e.M("bordered") : r != null ? e.M(`bordered-${r}`) : e.M("bordered"), e.selected = (r) => r && e.M("selected"), e.altColor = (r) => r && e.M("alt-color"), e.editable = (r) => r && e.M("editable"), e.noSelect = e.M("no-select"), e.noWrap = (r) => r && e.M("no-wrap"), e.applyVars = Pn, e.removeVars = Zn, e.newGridBuilder = (r) => new _n(r), e.dropRegion = (r) => r && e.B("haul-drop-region"), e.px = (r) => `${r}px`, e.inheritDims = (r = !0) => r && e.M("inherit-dims"), e.shade = (r) => e.M(`shade-${r}`), e.shadeVar = (r) => `var(--${t}-gray-l${r})`, e.levelSizeVar = (r) => `var(--${t}-${r}-size)`, e;
|
|
1129
|
+
}, ro = Hn("pluto");
|
|
1130
|
+
export {
|
|
1131
|
+
wr as $,
|
|
1132
|
+
on as A,
|
|
1133
|
+
Ce as B,
|
|
1134
|
+
ro as C,
|
|
1135
|
+
$r as D,
|
|
1136
|
+
qn as E,
|
|
1137
|
+
k as F,
|
|
1138
|
+
Dn as G,
|
|
1139
|
+
j as H,
|
|
1140
|
+
M as I,
|
|
1141
|
+
rn as J,
|
|
1142
|
+
ot as K,
|
|
1143
|
+
tn as L,
|
|
1144
|
+
_t as M,
|
|
1145
|
+
br as P,
|
|
1146
|
+
Ft as T,
|
|
1147
|
+
er as U,
|
|
1148
|
+
kn as W,
|
|
1149
|
+
xn as Y,
|
|
1150
|
+
wt as Z,
|
|
1151
|
+
Vn as _,
|
|
1152
|
+
d as a,
|
|
1153
|
+
Kn as b,
|
|
1154
|
+
An as c,
|
|
1155
|
+
Jn as d,
|
|
1156
|
+
ir as e,
|
|
1157
|
+
eo as f,
|
|
1158
|
+
Qn as g,
|
|
1159
|
+
lr as h,
|
|
1160
|
+
p as i,
|
|
1161
|
+
S as j,
|
|
1162
|
+
ar as k,
|
|
1163
|
+
Qt as l,
|
|
1164
|
+
Fn as m,
|
|
1165
|
+
bt as n,
|
|
1166
|
+
Un as o,
|
|
1167
|
+
to as p,
|
|
1168
|
+
En as q,
|
|
1169
|
+
Xn as r,
|
|
1170
|
+
Rn as s,
|
|
1171
|
+
Gn as t,
|
|
1172
|
+
Se as u,
|
|
1173
|
+
I as v,
|
|
1174
|
+
mr as w,
|
|
1175
|
+
ze as x,
|
|
1176
|
+
y,
|
|
1177
|
+
F as z
|
|
1178
|
+
};
|