@neptune3d/dom 0.0.12 → 0.0.14

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/README.md CHANGED
@@ -53,21 +53,6 @@ const checkbox = $input("checkbox").on("change", (e) => {
53
53
  $body().add(checkbox);
54
54
  ```
55
55
 
56
- ## 🎯 Popover API
57
-
58
- ```ts
59
- const popup = $("div")
60
- .text("Popover content")
61
- .popover("manual")
62
- .style({ padding: "1rem", background: "#222", color: "#fff" });
63
-
64
- $body().add(popup);
65
-
66
- // Show/hide programmatically
67
- popup.showPopover();
68
- popup.hidePopover();
69
- ```
70
-
71
56
  ## 🎨 CSS Stylesheet
72
57
 
73
58
  ```ts
@@ -104,12 +89,24 @@ $window().on("resize", (e) => console.log("Window resized"));
104
89
  $document().on("visibilitychange", () => console.log("Visibility changed"));
105
90
  ```
106
91
 
92
+ ## 🎯 Popover API
93
+
94
+ ```ts
95
+ const popup = $("div")
96
+ .text("Popover content")
97
+ .popover("manual")
98
+ .style({ padding: "1rem", background: "#222", color: "#fff" });
99
+
100
+ $body().add(popup);
101
+
102
+ // Show/hide programmatically
103
+ popup.showPopover();
104
+ popup.hidePopover();
105
+ ```
106
+
107
107
  ## 📦 Features
108
108
 
109
109
  - Chainable DOM manipulation
110
110
  - Typed input element helpers
111
- - Popover API support
112
- - Scoped and global CSS rule injection
113
- - Media query management
114
- - Window and document event wrappers
115
- - SVG and HTML element abstraction
111
+ - Stylesheet API support
112
+ - Window, document, body and head wrappers
package/dist/index.d.ts CHANGED
@@ -323,6 +323,21 @@ interface ContentSecurityPolicy {
323
323
  }
324
324
  type IFrameSandboxFlag = "allow-forms" | "allow-modals" | "allow-orientation-lock" | "allow-pointer-lock" | "allow-popups" | "allow-popups-to-escape-sandbox" | "allow-presentation" | "allow-same-origin" | "allow-scripts" | "allow-storage-access-by-user-activation" | "allow-top-navigation" | "allow-top-navigation-by-user-activation";
325
325
  type TextAreaWrapMode = "soft" | "hard" | "off";
326
+ /**
327
+ * All known WAI-ARIA role strings as defined by the ARIA specification.
328
+ * Source: WAI-ARIA Roles (MDN, W3C).
329
+ */
330
+ type AriaRole = "alert" | "alertdialog" | "application" | "article" | "banner" | "blockquote" | "button" | "cell" | "checkbox" | "code" | "columnheader" | "combobox" | "complementary" | "contentinfo" | "definition" | "deletion" | "dialog" | "document" | "emphasis" | "feed" | "figure" | "form" | "grid" | "gridcell" | "group" | "heading" | "img" | "insertion" | "link" | "list" | "listbox" | "listitem" | "log" | "main" | "marquee" | "math" | "menu" | "menubar" | "menuitem" | "menuitemcheckbox" | "menuitemradio" | "meter" | "navigation" | "none" | "note" | "option" | "paragraph" | "presentation" | "progressbar" | "radio" | "radiogroup" | "region" | "row" | "rowgroup" | "rowheader" | "scrollbar" | "search" | "searchbox" | "separator" | "slider" | "spinbutton" | "status" | "strong" | "subscript" | "superscript" | "switch" | "tab" | "table" | "tablist" | "tabpanel" | "term" | "textbox" | "time" | "toolbar" | "tooltip" | "tree" | "treegrid" | "treeitem";
331
+ /**
332
+ * All known values for the `aria-haspopup` attribute.
333
+ * Source: WAI-ARIA specification (current).
334
+ */
335
+ type AriaHasPopup = "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog";
336
+ /**
337
+ * All known values for the `aria-live` attribute.
338
+ * Source: WAI-ARIA specification (current).
339
+ */
340
+ type AriaLive = "off" | "polite" | "assertive";
326
341
  //#endregion
327
342
  //#region src/BaseStyle.d.ts
328
343
  declare abstract class BaseStyle {
@@ -804,6 +819,16 @@ declare abstract class BaseStyle {
804
819
  * @return This instance for chaining.
805
820
  */
806
821
  bbr(value: Property.BorderBottom | Property.BorderRight | undefined): this;
822
+ /**
823
+ * Sets the `border-collapse` style of the element.
824
+ * Controls whether table borders are collapsed or separated.
825
+ * Accepts values like `"collapse"`, `"separate"`, or CSS variables.
826
+ * Passing `undefined` removes the border-collapse style.
827
+ *
828
+ * @param value - The border-collapse behavior to apply, or `undefined` to remove it.
829
+ * @return This instance for chaining.
830
+ */
831
+ bCollapse(value: Property.BorderCollapse | undefined): this;
807
832
  /**
808
833
  * Sets the `overflow` style of the element.
809
834
  * Controls how content that exceeds the element's bounds is handled on both axes.
@@ -1289,15 +1314,77 @@ declare abstract class BaseStyle {
1289
1314
  */
1290
1315
  resize(value: Property.Resize | undefined): this;
1291
1316
  /**
1292
- * Sets the `border-collapse` style of the element.
1293
- * Controls whether table borders are collapsed or separated.
1294
- * Accepts values like `"collapse"`, `"separate"`, or CSS variables.
1295
- * Passing `undefined` removes the border-collapse style.
1317
+ * Sets the CSS `fill` style of the element.
1318
+ * Controls the paint used to fill the interior of SVG shapes or text.
1319
+ * Accepts values like color strings (`"red"`, `"#000"`, `"currentColor"`), gradients, or CSS variables.
1320
+ * Passing `undefined` removes the fill style.
1296
1321
  *
1297
- * @param value - The border-collapse behavior to apply, or `undefined` to remove it.
1322
+ * @param value - The fill style to apply, or `undefined` to remove it.
1323
+ * @return This instance for chaining.
1324
+ */
1325
+ fill(value: Property.Fill | undefined): this;
1326
+ /**
1327
+ * Sets the CSS `stroke` style of the element.
1328
+ * Controls the color used to outline SVG shapes or text.
1329
+ * Accepts values like color strings (`"black"`, `"none"`, `"currentColor"`), gradients, or CSS variables.
1330
+ * Passing `undefined` removes the stroke style.
1331
+ *
1332
+ * @param value - The stroke style to apply, or `undefined` to remove it.
1298
1333
  * @return This instance for chaining.
1299
1334
  */
1300
- borderCollapse(value: Property.BorderCollapse | undefined): this;
1335
+ stroke(value: Property.Stroke | undefined): this;
1336
+ /**
1337
+ * Sets the CSS `stroke-width` style of the element.
1338
+ * Controls the thickness of the stroke used to outline SVG shapes or text.
1339
+ * Accepts values like `"1px"`, `"0.5em"`, numeric values, or CSS variables.
1340
+ * Passing `undefined` removes the stroke-width style.
1341
+ *
1342
+ * @param value - The stroke-width style to apply, or `undefined` to remove it.
1343
+ * @return This instance for chaining.
1344
+ */
1345
+ strokeWidth(value: Property.StrokeWidth | number | undefined): this;
1346
+ /**
1347
+ * Sets or clears the `content` CSS property.
1348
+ *
1349
+ * The `content` property is primarily used with pseudo-elements
1350
+ * (`::before`, `::after`) to insert generated content.
1351
+ *
1352
+ * - Accepts any valid CSS content value (e.g., `"\"Hello\""`, `none`, `attr(title)`).
1353
+ * - Passing `undefined` removes the property.
1354
+ * - Chainable for fluent DOM composition.
1355
+ *
1356
+ * @param value - The content value to apply, or `undefined` to remove it.
1357
+ * @returns This instance for chaining.
1358
+ */
1359
+ content(value: Property.Content | string | undefined): this;
1360
+ /**
1361
+ * Sets or clears the `pointer-events` CSS property.
1362
+ *
1363
+ * The `pointer-events` property controls whether an element can be the target
1364
+ * of mouse, touch, or pointer interactions.
1365
+ *
1366
+ * - Accepts any valid CSS pointer-events value (e.g., `"auto"`, `"none"`, `"visiblePainted"`).
1367
+ * - Passing `undefined` removes the property.
1368
+ * - Chainable for fluent DOM composition.
1369
+ *
1370
+ * @param value - The pointer-events value to apply, or `undefined` to remove it.
1371
+ * @returns This instance for chaining.
1372
+ */
1373
+ pointerEvents(value: Property.PointerEvents | string | undefined): this;
1374
+ /**
1375
+ * Sets or clears the `filter` CSS property.
1376
+ *
1377
+ * The `filter` property applies graphical effects such as blur,
1378
+ * brightness, contrast, or drop-shadow to an element.
1379
+ *
1380
+ * - Accepts any valid CSS filter value (e.g., `"blur(5px)"`, `"brightness(0.8)"`, `"none"`).
1381
+ * - Passing `undefined` removes the property.
1382
+ * - Chainable for fluent DOM composition.
1383
+ *
1384
+ * @param value - The filter value to apply, or `undefined` to remove it.
1385
+ * @returns This instance for chaining.
1386
+ */
1387
+ filter(value: Property.Filter | string | undefined): this;
1301
1388
  /**
1302
1389
  * Applies CSS styles to truncate overflowing text with an ellipsis.
1303
1390
  * Ensures the text stays on a single line and hides overflow.
@@ -1322,6 +1409,34 @@ declare abstract class BaseStyle {
1322
1409
  * @return This instance for chaining.
1323
1410
  */
1324
1411
  linearGradient(direction: LinearGradientDirection, ...stops: string[]): this;
1412
+ /**
1413
+ * Sets the `filter` style to a drop-shadow effect.
1414
+ * Constructs a valid CSS `drop-shadow(...)` string and applies it via the `filter` method.
1415
+ *
1416
+ * - Numeric values for `offsetX`, `offsetY`, and `blurRadius` are automatically suffixed with `"px"`.
1417
+ * - String values are used as-is, allowing units like `"em"`, `"rem"`, `"%"`, etc.
1418
+ *
1419
+ * @param offsetX - Horizontal offset of the shadow (e.g., `5` → `"5px"`, or `"0.5em"`).
1420
+ * @param offsetY - Vertical offset of the shadow (e.g., `5` → `"5px"`, or `"0.5em"`).
1421
+ * @param blurRadius - Blur radius of the shadow (e.g., `10` → `"10px"`, or `"1rem"`).
1422
+ * @param color - Shadow color (e.g., `"rgba(0,0,0,0.5)"`).
1423
+ * @returns This instance for chaining.
1424
+ */
1425
+ dropShadow(offsetX: string | number, offsetY: string | number, blurRadius: string | number, color: string): this;
1426
+ /**
1427
+ * Sets or clears the `app-region` CSS property.
1428
+ *
1429
+ * Used in Electron to define draggable and non‑draggable regions
1430
+ * of a frameless window.
1431
+ *
1432
+ * - Common values: `"drag"`, `"no-drag"`.
1433
+ * - Passing `undefined` removes the property.
1434
+ * - Chainable for fluent DOM composition.
1435
+ *
1436
+ * @param value - The app-region value to apply, or `undefined` to remove it.
1437
+ * @returns This instance for chaining.
1438
+ */
1439
+ appRegion(value: "drag" | "no-drag" | string | undefined): this;
1325
1440
  /**
1326
1441
  * Applies a batch of CSS style properties to the element.
1327
1442
  * Delegates each property to `setStyleProp`, which handles value normalization and kebab-case conversion.
@@ -1334,6 +1449,29 @@ declare abstract class BaseStyle {
1334
1449
  * @returns This instance for chaining.
1335
1450
  */
1336
1451
  style(props: CssProperties): this;
1452
+ /**
1453
+ * Sets or clears a single CSS style property when the key is a known property.
1454
+ *
1455
+ * This overload provides type‑safe autocompletion for standard CSS properties.
1456
+ *
1457
+ * @typeParam K - A key of `CssProperties`.
1458
+ * @param name - The CSS property name (camelCase or kebab-case).
1459
+ * @param value - The property value, or `undefined` to remove it.
1460
+ * Numeric values are allowed for unit resolution.
1461
+ * @returns This instance for chaining.
1462
+ */
1463
+ styleProp<K extends keyof CssProperties>(name: Autocomplete<K>, value: CssProperties[K] | number | undefined): this;
1464
+ /**
1465
+ * Sets or clears a single CSS style property when the key is arbitrary.
1466
+ *
1467
+ * This overload allows free‑form property names such as CSS variables (`--my-var`)
1468
+ * or vendor‑prefixed properties (`-webkit-line-clamp`).
1469
+ *
1470
+ * @param name - The CSS property name as a string.
1471
+ * @param value - The property value, or `undefined` to remove it.
1472
+ * @returns This instance for chaining.
1473
+ */
1474
+ styleProp(name: string, value: string | number | undefined): this;
1337
1475
  }
1338
1476
  //#endregion
1339
1477
  //#region src/BaseDom.d.ts
@@ -1431,6 +1569,12 @@ declare abstract class BaseDom<E extends HTMLElement | SVGElement> extends BaseS
1431
1569
  * @return `true` if the class is present, otherwise `false`.
1432
1570
  */
1433
1571
  hasClass(name: string): boolean;
1572
+ /**
1573
+ * Returns true if this element is currently focused.
1574
+ * Works for documents, shadow roots, and gracefully
1575
+ * handles elements not connected to the DOM.
1576
+ */
1577
+ isFocused(): boolean;
1434
1578
  /**
1435
1579
  * Sets the `textContent` of the element using any value.
1436
1580
  * If the value is `null` or `undefined`, clears the content.
@@ -1489,6 +1633,199 @@ declare abstract class BaseDom<E extends HTMLElement | SVGElement> extends BaseS
1489
1633
  * @return This instance for chaining.
1490
1634
  */
1491
1635
  toggleAttr(name: string, force?: boolean): this;
1636
+ /**
1637
+ * Sets or clears the `role` attribute on the element.
1638
+ *
1639
+ * - Common values: `"button"`, `"dialog"`, `"navigation"`, `"presentation"`, etc.
1640
+ * - Passing `undefined` removes the attribute.
1641
+ * - Chainable for fluent DOM composition.
1642
+ *
1643
+ * @param value - The role value to apply, or `undefined` to remove it.
1644
+ * @returns This instance for chaining.
1645
+ */
1646
+ role(value: Autocomplete<AriaRole> | undefined): this;
1647
+ /**
1648
+ * Sets or clears the `aria-label` attribute on the element.
1649
+ *
1650
+ * - Used to provide an accessible name for elements.
1651
+ * - Passing `undefined` removes the attribute.
1652
+ * - Chainable for fluent DOM composition.
1653
+ *
1654
+ * @param value - The aria-label value to apply, or `undefined` to remove it.
1655
+ * @returns This instance for chaining.
1656
+ */
1657
+ ariaLabel(value: string | undefined): this;
1658
+ /**
1659
+ * Sets or clears the `aria-hidden` attribute on the element.
1660
+ *
1661
+ * - Used to indicate whether the element should be exposed to assistive technologies.
1662
+ * - Passing `true` sets `aria-hidden="true"`.
1663
+ * - Passing `false` sets `aria-hidden="false"`.
1664
+ * - Passing `undefined` removes the attribute.
1665
+ * - Chainable for fluent DOM composition.
1666
+ *
1667
+ * @param value - `true` to hide from assistive tech, `false` to expose, or `undefined` to remove.
1668
+ * @returns This instance for chaining.
1669
+ */
1670
+ ariaHidden(value: boolean | undefined): this;
1671
+ /**
1672
+ * Sets or clears the `aria-selected` attribute on the element.
1673
+ *
1674
+ * - Used to indicate the current selection state of an item in a list, tablist, tree, etc.
1675
+ * - Passing `true` sets `aria-selected="true"`.
1676
+ * - Passing `false` sets `aria-selected="false"`.
1677
+ * - Passing `undefined` removes the attribute.
1678
+ * - Chainable for fluent DOM composition.
1679
+ *
1680
+ * @param value - `true` to mark as selected, `false` to mark as not selected, or `undefined` to remove.
1681
+ * @returns This instance for chaining.
1682
+ */
1683
+ ariaSelected(value: boolean | undefined): this;
1684
+ /**
1685
+ * Sets or clears the `aria-multiselectable` attribute on the element.
1686
+ *
1687
+ * - Used to indicate whether multiple items can be selected in a listbox, tree, or grid.
1688
+ * - Passing `true` sets `aria-multiselectable="true"`.
1689
+ * - Passing `false` sets `aria-multiselectable="false"`.
1690
+ * - Passing `undefined` removes the attribute.
1691
+ * - Chainable for fluent DOM composition.
1692
+ *
1693
+ * @param value - `true` to allow multiple selection, `false` to restrict to single selection, or `undefined` to remove.
1694
+ * @returns This instance for chaining.
1695
+ */
1696
+ ariaMultiselectable(value: boolean | undefined): this;
1697
+ /**
1698
+ * Sets or clears the `aria-setsize` attribute on the element.
1699
+ *
1700
+ * - Used to define the number of items in a set (e.g. list, tree, grid).
1701
+ * - Passing `undefined` removes the attribute.
1702
+ * - Chainable for fluent DOM composition.
1703
+ *
1704
+ * @param value - The set size value to apply, or `undefined` to remove it.
1705
+ * @returns This instance for chaining.
1706
+ */
1707
+ ariaSetSize(value: number | undefined): this;
1708
+ /**
1709
+ * Sets or clears the `aria-posinset` attribute on the element.
1710
+ *
1711
+ * - Used to define the position of an item within a set (e.g. list, tree, grid).
1712
+ * - Passing `undefined` removes the attribute.
1713
+ * - Chainable for fluent DOM composition.
1714
+ *
1715
+ * @param value - The position value to apply, or `undefined` to remove it.
1716
+ * @returns This instance for chaining.
1717
+ */
1718
+ ariaPosInSet(value: number | undefined): this;
1719
+ /**
1720
+ * Sets or clears the `aria-expanded` attribute on the element.
1721
+ *
1722
+ * - Used to indicate whether a collapsible element (like a disclosure widget) is expanded or collapsed.
1723
+ * - Passing `true` sets `aria-expanded="true"`.
1724
+ * - Passing `false` sets `aria-expanded="false"`.
1725
+ * - Passing `undefined` removes the attribute.
1726
+ * - Chainable for fluent DOM composition.
1727
+ *
1728
+ * @param value - `true` to mark as expanded, `false` to mark as collapsed, or `undefined` to remove.
1729
+ * @returns This instance for chaining.
1730
+ */
1731
+ ariaExpanded(value: boolean | undefined): this;
1732
+ /**
1733
+ * Sets or clears the `aria-controls` attribute on the element.
1734
+ *
1735
+ * - Used to indicate the element(s) whose contents or presence are controlled by this element.
1736
+ * - Accepts one or more element IDs (space-separated).
1737
+ * - Passing `undefined` removes the attribute.
1738
+ * - Chainable for fluent DOM composition.
1739
+ *
1740
+ * @param value - The ID or space-separated list of IDs of controlled elements,
1741
+ * or `undefined` to remove the attribute.
1742
+ * @returns This instance for chaining.
1743
+ */
1744
+ ariaControls(value: string | undefined): this;
1745
+ /**
1746
+ * Sets or clears the `aria-live` attribute on the element.
1747
+ *
1748
+ * - Used to indicate how updates to the element should be announced by assistive technologies.
1749
+ * - Known values: `"off"`, `"polite"`, `"assertive"`.
1750
+ * - Passing `undefined` removes the attribute.
1751
+ * - Chainable for fluent DOM composition.
1752
+ *
1753
+ * @param value - The aria-live value to apply, or `undefined` to remove it.
1754
+ * @returns This instance for chaining.
1755
+ */
1756
+ ariaLive(value: Autocomplete<AriaLive> | undefined): this;
1757
+ /**
1758
+ * Sets or clears the `aria-haspopup` attribute on the element.
1759
+ *
1760
+ * - Indicates the availability and type of interactive popup element.
1761
+ * - Known values: `"false"`, `"true"`, `"menu"`, `"listbox"`, `"tree"`, `"grid"`, `"dialog"`.
1762
+ * - Passing `undefined` removes the attribute.
1763
+ * - Chainable for fluent DOM composition.
1764
+ *
1765
+ * @param value - The aria-haspopup value to apply, or `undefined` to remove it.
1766
+ * @returns This instance for chaining.
1767
+ */
1768
+ ariaHasPopup(value: Autocomplete<AriaHasPopup> | undefined): this;
1769
+ /**
1770
+ * Sets or clears the `aria-valuemin` attribute on the element.
1771
+ *
1772
+ * - Used to define the minimum allowed value for a range widget (slider, spinbutton, progressbar).
1773
+ * - Passing a number sets `aria-valuemin` to that value.
1774
+ * - Passing `undefined` removes the attribute.
1775
+ * - Chainable for fluent DOM composition.
1776
+ *
1777
+ * @param value - The minimum value to apply, or `undefined` to remove it.
1778
+ * @returns This instance for chaining.
1779
+ */
1780
+ ariaValueMin(value: number | undefined): this;
1781
+ /**
1782
+ * Sets or clears the `aria-valuemax` attribute on the element.
1783
+ *
1784
+ * - Used to define the maximum allowed value for a range widget (slider, spinbutton, progressbar).
1785
+ * - Passing a number sets `aria-valuemax` to that value.
1786
+ * - Passing `undefined` removes the attribute.
1787
+ * - Chainable for fluent DOM composition.
1788
+ *
1789
+ * @param value - The maximum value to apply, or `undefined` to remove it.
1790
+ * @returns This instance for chaining.
1791
+ */
1792
+ ariaValueMax(value: number | undefined): this;
1793
+ /**
1794
+ * Sets or clears the `aria-valuenow` attribute on the element.
1795
+ *
1796
+ * - Used to define the current value of a range widget (slider, spinbutton, progressbar).
1797
+ * - Passing a number sets `aria-valuenow` to that value.
1798
+ * - Passing `undefined` removes the attribute.
1799
+ * - Chainable for fluent DOM composition.
1800
+ *
1801
+ * @param value - The current value to apply, or `undefined` to remove it.
1802
+ * @returns This instance for chaining.
1803
+ */
1804
+ ariaValueNow(value: number | undefined): this;
1805
+ /**
1806
+ * Sets or clears the `aria-valuetext` attribute on the element.
1807
+ *
1808
+ * - Used to provide a human-readable text alternative for the current value of a range widget.
1809
+ * - Passing a string sets `aria-valuetext` to that value.
1810
+ * - Passing `undefined` removes the attribute.
1811
+ * - Chainable for fluent DOM composition.
1812
+ *
1813
+ * @param value - The text value to apply, or `undefined` to remove it.
1814
+ * @returns This instance for chaining.
1815
+ */
1816
+ ariaValueText(value: string | undefined): this;
1817
+ /**
1818
+ * Sets or clears the `draggable` attribute on the element.
1819
+ *
1820
+ * - Used to indicate whether the element is draggable.
1821
+ * - Valid values: `"true"`, `"false"`, `"auto"`.
1822
+ * - Passing `undefined` removes the attribute.
1823
+ * - Chainable for fluent DOM composition.
1824
+ *
1825
+ * @param value - The draggable value to apply, or `undefined` to remove it.
1826
+ * @returns This instance for chaining.
1827
+ */
1828
+ draggable(value: "true" | "false" | "auto" | undefined): this;
1492
1829
  /**
1493
1830
  * Sets a single property on the element.
1494
1831
  * @param name - The property name (e.g. "checked", "value", "disabled").
@@ -1627,6 +1964,7 @@ declare abstract class BaseDom<E extends HTMLElement | SVGElement> extends BaseS
1627
1964
  ref(refFn: (el: this) => void): this;
1628
1965
  protected resolveNode(child: DomElementChild): Node;
1629
1966
  protected setStyleProp(name: Autocomplete<keyof CssProperties>, value: string | number | undefined): this;
1967
+ protected booleanishAttr(name: string, value: boolean | undefined): this;
1630
1968
  /**
1631
1969
  * Checks whether a value is a `BaseDom` instance.
1632
1970
  * Uses a symbol-based identity marker and avoids the `in` operator.
@@ -1853,11 +2191,15 @@ declare function $a(): AnchorElement;
1853
2191
  */
1854
2192
  declare class BaseSvgElement<T$1 extends keyof SvgElementTagNameMap> extends DomElement<T$1> {
1855
2193
  /**
1856
- * Sets the `fill` color.
1857
- * @param color - Fill color (e.g. "red", "#ff0000", "none").
2194
+ * Sets the `fill` attribute on the SVG element.
2195
+ * Controls the paint used to fill the interior of shapes.
2196
+ * Accepts values like color strings (`"red"`, `"#000"`, `"currentColor"`), gradients, or CSS variables.
2197
+ * Passing `undefined` removes the attribute.
2198
+ *
2199
+ * @param value - The fill value to apply as an SVG attribute, or `undefined` to remove it.
1858
2200
  * @return This instance for chaining.
1859
2201
  */
1860
- svgFill(color: string): this;
2202
+ fill(value: string | undefined): this;
1861
2203
  /**
1862
2204
  * Sets the `fill-rule` property.
1863
2205
  * Determines how the interior of a shape is determined when paths intersect.
@@ -1867,17 +2209,36 @@ declare class BaseSvgElement<T$1 extends keyof SvgElementTagNameMap> extends Dom
1867
2209
  */
1868
2210
  fillRule(rule: "nonzero" | "evenodd"): this;
1869
2211
  /**
1870
- * Sets the `stroke` color.
1871
- * @param color - Stroke color (e.g. "black", "#000", "none").
2212
+ * Sets the `fill-opacity` attribute on the SVG element.
2213
+ * Controls the transparency of the fill independently from the overall element opacity.
2214
+ * Accepts values from `0` (fully transparent) to `1` (fully opaque), or CSS variables.
2215
+ * Useful for layering visual effects or emphasizing fill contrast without affecting stroke or children.
2216
+ * Passing `undefined` removes the attribute.
2217
+ *
2218
+ * @param value - The fill opacity value to apply as an SVG attribute, or `undefined` to remove it.
2219
+ * @return This instance for chaining.
2220
+ */
2221
+ fillOpacity(value: string | number | undefined): this;
2222
+ /**
2223
+ * Sets the `stroke` attribute on the SVG element.
2224
+ * Controls the color used to outline shapes.
2225
+ * Accepts values like color strings (`"black"`, `"none"`, `"currentColor"`), gradients, or CSS variables.
2226
+ * Passing `undefined` removes the attribute.
2227
+ *
2228
+ * @param value - The stroke value to apply as an SVG attribute, or `undefined` to remove it.
1872
2229
  * @return This instance for chaining.
1873
2230
  */
1874
- svgStroke(color: string): this;
2231
+ stroke(value: string | undefined): this;
1875
2232
  /**
1876
- * Sets the `stroke-width` value.
1877
- * @param width - Stroke width in pixels or units.
2233
+ * Sets the `stroke-width` attribute on the SVG element.
2234
+ * Controls the thickness of the stroke used to outline shapes.
2235
+ * Accepts values like `"1"`, `"0.5"`, `"2px"`, or CSS variables.
2236
+ * Passing `undefined` removes the attribute.
2237
+ *
2238
+ * @param value - The stroke-width value to apply as an SVG attribute, or `undefined` to remove it.
1878
2239
  * @return This instance for chaining.
1879
2240
  */
1880
- svgStrokeWidth(width: number | string): this;
2241
+ strokeWidth(value: string | number | undefined): this;
1881
2242
  /**
1882
2243
  * Sets the `stroke-linejoin` style.
1883
2244
  * Controls how two connected segments in a stroke join.
@@ -1903,19 +2264,56 @@ declare class BaseSvgElement<T$1 extends keyof SvgElementTagNameMap> extends Dom
1903
2264
  */
1904
2265
  strokeMiterlimit(value: number): this;
1905
2266
  /**
1906
- * Sets the `opacity` value.
1907
- * @param value - Opacity from 0 to 1.
2267
+ * Sets the `stroke-opacity` attribute on the SVG element.
2268
+ * Controls the transparency of the stroke independently from the overall element opacity.
2269
+ * Accepts values from `0` (fully transparent) to `1` (fully opaque), or CSS variables.
2270
+ * Passing `undefined` removes the attribute.
2271
+ *
2272
+ * @param value - The stroke opacity value to apply as an SVG attribute, or `undefined` to remove it.
2273
+ * @return This instance for chaining.
2274
+ */
2275
+ strokeOpacity(value: string | number | undefined): this;
2276
+ /**
2277
+ * Sets the `stroke-dasharray` attribute on the SVG element.
2278
+ * Defines the pattern of dashes and gaps used to render the stroke.
2279
+ * Accepts a space- or comma-separated list of lengths (e.g. `"5 2"` or `"5,2"`), numeric values, or CSS variables.
2280
+ * Passing `undefined` removes the attribute.
2281
+ *
2282
+ * @param value - The dash pattern to apply as an SVG attribute, or `undefined` to remove it.
2283
+ * @return This instance for chaining.
2284
+ */
2285
+ strokeDasharray(value: string | number | undefined): this;
2286
+ /**
2287
+ * Sets the `stroke-dashoffset` attribute on the SVG element.
2288
+ * Specifies how far into the dash pattern the stroke should start.
2289
+ * Useful for animating dashed strokes or offsetting patterns.
2290
+ * Accepts numeric values, length strings (e.g. `"4px"`), or CSS variables.
2291
+ * Passing `undefined` removes the attribute.
2292
+ *
2293
+ * @param value - The dash offset to apply as an SVG attribute, or `undefined` to remove it.
2294
+ * @return This instance for chaining.
2295
+ */
2296
+ strokeDashoffset(value: string | number | undefined): this;
2297
+ /**
2298
+ * Sets the `opacity` attribute on the SVG element.
2299
+ * Controls the overall transparency of the element.
2300
+ * Accepts values from `0` (fully transparent) to `1` (fully opaque), or CSS variables.
2301
+ * Passing `undefined` removes the attribute.
2302
+ *
2303
+ * @param value - The opacity value to apply as an SVG attribute, or `undefined` to remove it.
1908
2304
  * @return This instance for chaining.
1909
2305
  */
1910
- svgOpacity(value: number): this;
2306
+ opacity(value: string | number | undefined): this;
1911
2307
  /**
1912
- * Sets the `transform` attribute with a raw SVG transform string.
1913
- * Accepts any valid transform function: translate, rotate, scale, skewX, skewY, matrix.
2308
+ * Sets the `transform` attribute on the SVG element.
2309
+ * Controls geometric transformations like translation, rotation, scaling, and skewing.
2310
+ * Accepts values like `"translate(10, 20)"`, `"rotate(45)"`, `"scale(2)"`, or composed transforms.
2311
+ * Passing `undefined` removes the attribute.
1914
2312
  *
1915
- * @param value - SVG transform string (e.g. "translate(10, 20) rotate(45)").
2313
+ * @param value - The transform string to apply as an SVG attribute, or `undefined` to remove it.
1916
2314
  * @return This instance for chaining.
1917
2315
  */
1918
- svgTransform(value: string): this;
2316
+ transform(value: string | undefined): this;
1919
2317
  /**
1920
2318
  * Applies a `translate(x, y)` transform to the element.
1921
2319
  * Sets the `transform` attribute, replacing any existing value.
@@ -1924,7 +2322,7 @@ declare class BaseSvgElement<T$1 extends keyof SvgElementTagNameMap> extends Dom
1924
2322
  * @param y - Vertical translation in user units.
1925
2323
  * @return This instance for chaining.
1926
2324
  */
1927
- svgTranslate(x: number, y: number): this;
2325
+ translate(x: number, y: number): this;
1928
2326
  /**
1929
2327
  * Applies a horizontal `translate(x, 0)` transform to the element.
1930
2328
  * Sets the `transform` attribute, replacing any existing value.
@@ -1932,7 +2330,7 @@ declare class BaseSvgElement<T$1 extends keyof SvgElementTagNameMap> extends Dom
1932
2330
  * @param x - Horizontal translation in user units.
1933
2331
  * @return This instance for chaining.
1934
2332
  */
1935
- svgTranslateX(x: number): this;
2333
+ translateX(x: number): this;
1936
2334
  /**
1937
2335
  * Applies a vertical `translate(0, y)` transform to the element.
1938
2336
  * Sets the `transform` attribute, replacing any existing value.
@@ -1940,7 +2338,7 @@ declare class BaseSvgElement<T$1 extends keyof SvgElementTagNameMap> extends Dom
1940
2338
  * @param y - Vertical translation in user units.
1941
2339
  * @return This instance for chaining.
1942
2340
  */
1943
- svgTranslateY(y: number): this;
2341
+ translateY(y: number): this;
1944
2342
  /**
1945
2343
  * Applies a `rotate(angle)` or `rotate(angle, cx, cy)` transform to the element.
1946
2344
  * Sets the `transform` attribute, replacing any existing value.
@@ -1950,7 +2348,7 @@ declare class BaseSvgElement<T$1 extends keyof SvgElementTagNameMap> extends Dom
1950
2348
  * @param cy - Optional y coordinate of the rotation center.
1951
2349
  * @return This instance for chaining.
1952
2350
  */
1953
- svgRotate(angle: number, cx?: number, cy?: number): this;
2351
+ rotate(angle: number, cx?: number, cy?: number): this;
1954
2352
  /**
1955
2353
  * Applies a uniform `scale(s)` transform to the element.
1956
2354
  * Sets the `transform` attribute, replacing any existing value.
@@ -1958,7 +2356,7 @@ declare class BaseSvgElement<T$1 extends keyof SvgElementTagNameMap> extends Dom
1958
2356
  * @param s - Uniform scale factor for both x and y axes.
1959
2357
  * @return This instance for chaining.
1960
2358
  */
1961
- svgScale(s: number): this;
2359
+ scale(s: number): this;
1962
2360
  /**
1963
2361
  * Applies a horizontal `scale(sx, 1)` transform to the element.
1964
2362
  * Sets the `transform` attribute, replacing any existing value.
@@ -1966,7 +2364,7 @@ declare class BaseSvgElement<T$1 extends keyof SvgElementTagNameMap> extends Dom
1966
2364
  * @param sx - Horizontal scale factor.
1967
2365
  * @return This instance for chaining.
1968
2366
  */
1969
- svgScaleX(sx: number): this;
2367
+ scaleX(sx: number): this;
1970
2368
  /**
1971
2369
  * Applies a vertical `scale(1, sy)` transform to the element.
1972
2370
  * Sets the `transform` attribute, replacing any existing value.
@@ -1974,13 +2372,50 @@ declare class BaseSvgElement<T$1 extends keyof SvgElementTagNameMap> extends Dom
1974
2372
  * @param sy - Vertical scale factor.
1975
2373
  * @return This instance for chaining.
1976
2374
  */
1977
- svgScaleY(sy: number): this;
2375
+ scaleY(sy: number): this;
2376
+ /**
2377
+ * Applies a horizontal skew transform to the SVG element.
2378
+ * Sets the `transform` attribute to `skewX(angle)`, replacing any existing transform.
2379
+ * Skewing distorts the element along the X-axis by the specified angle.
2380
+ *
2381
+ * @param angle - Skew angle in degrees. Positive values skew right, negative values skew left.
2382
+ * @return This instance for chaining.
2383
+ */
2384
+ skewX(angle: number): this;
2385
+ /**
2386
+ * Applies a vertical skew transform to the SVG element.
2387
+ * Sets the `transform` attribute to `skewY(angle)`, replacing any existing transform.
2388
+ * Skewing distorts the element along the Y-axis by the specified angle.
2389
+ *
2390
+ * @param angle - Skew angle in degrees. Positive values skew downward, negative values skew upward.
2391
+ * @return This instance for chaining.
2392
+ */
2393
+ skewY(angle: number): this;
2394
+ /**
2395
+ * Sets the `vector-effect` attribute on the SVG element.
2396
+ * Controls how stroke rendering behaves under geometric transformations.
2397
+ * Commonly used to preserve stroke width when scaling with `transform`.
2398
+ *
2399
+ * @param value - One of:
2400
+ * - `"none"`: Stroke scales with the element.
2401
+ * - `"non-scaling-stroke"`: Stroke width remains constant regardless of scale.
2402
+ * @return This instance for chaining.
2403
+ */
2404
+ vectorEffect(value: "none" | "non-scaling-stroke"): this;
1978
2405
  }
1979
2406
  //#endregion
1980
2407
  //#region src/Button.d.ts
1981
2408
  declare class Button extends DomElement<"button"> {
1982
2409
  constructor();
1983
2410
  type(value: "button" | "submit" | "reset"): this;
2411
+ /**
2412
+ * Checks whether the button is disabled.
2413
+ *
2414
+ * Always safe because this class wraps a `<button>` element.
2415
+ *
2416
+ * @returns `true` if the button is disabled, otherwise `false`.
2417
+ */
2418
+ isDisabled(): boolean;
1984
2419
  }
1985
2420
  declare function $btn(): Button;
1986
2421
  //#endregion
@@ -3440,5 +3875,6 @@ declare function $textarea(): TextArea;
3440
3875
  declare function uniqueId(): string;
3441
3876
  declare function camelToKebab(prop: string): string;
3442
3877
  declare function getStyleValue(name: Autocomplete<keyof CssProperties>, value: string | number): string;
3878
+ declare function getPxStyleValue(value: string | number): string;
3443
3879
  //#endregion
3444
- export { $, $a, $body, $btn, $canvas, $circle, $d, $document, $group, $head, $iframe, $img, $input, $option, $path, $progress, $query, $rect, $select, $svg, $textarea, $window, AnchorElement, Autocomplete, BaseDom, BaseStyle, BaseSvgElement, Button, Canvas, ContentSecurityPolicy, CssProperties, type CssProperty, CssRule, DomBody, DomDocument, DomElement, DomElementChild, DomElementEventMap, DomElementTagNameMap, DomHead, DomWindow, IFrame, IFrameSandboxFlag, ImageElement, InputCheckbox, InputColor, InputElementMap, InputNumber, InputRange, InputText, LinearGradientDirection, MediaRule, OptionElement, ProgressElement, SVG_TAGS, SelectElement, StyleSheet, SvgCircle, SvgElement, SvgElementTagNameMap, SvgGroup, SvgPath, SvgPathData, SvgRect, TAG_ALIAS, TagAlias, TextArea, TextAreaWrapMode, UNITLESS_CSS_PROPS, VENDOR_CSS_PROPS, camelToKebab, getStyleValue, uniqueId };
3880
+ export { $, $a, $body, $btn, $canvas, $circle, $d, $document, $group, $head, $iframe, $img, $input, $option, $path, $progress, $query, $rect, $select, $svg, $textarea, $window, AnchorElement, AriaHasPopup, AriaLive, AriaRole, Autocomplete, BaseDom, BaseStyle, BaseSvgElement, Button, Canvas, ContentSecurityPolicy, CssProperties, type CssProperty, CssRule, DomBody, DomDocument, DomElement, DomElementChild, DomElementEventMap, DomElementTagNameMap, DomHead, DomWindow, IFrame, IFrameSandboxFlag, ImageElement, InputCheckbox, InputColor, InputElementMap, InputNumber, InputRange, InputText, LinearGradientDirection, MediaRule, OptionElement, ProgressElement, SVG_TAGS, SelectElement, StyleSheet, SvgCircle, SvgElement, SvgElementTagNameMap, SvgGroup, SvgPath, SvgPathData, SvgRect, TAG_ALIAS, TagAlias, TextArea, TextAreaWrapMode, UNITLESS_CSS_PROPS, VENDOR_CSS_PROPS, camelToKebab, getPxStyleValue, getStyleValue, uniqueId };
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- var e=class{p(e){return this.setStyleProp(`padding`,e)}pt(e){return this.setStyleProp(`paddingTop`,e)}pr(e){return this.setStyleProp(`paddingRight`,e)}pb(e){return this.setStyleProp(`paddingBottom`,e)}pl(e){return this.setStyleProp(`paddingLeft`,e)}px(e){return this.pl(e).pr(e)}py(e){return this.pt(e).pb(e)}m(e){return this.setStyleProp(`margin`,e)}mt(e){return this.setStyleProp(`marginTop`,e)}mr(e){return this.setStyleProp(`marginRight`,e)}mb(e){return this.setStyleProp(`marginBottom`,e)}ml(e){return this.setStyleProp(`marginLeft`,e)}radius(e){return this.setStyleProp(`borderRadius`,e)}radiusTopLeft(e){return this.setStyleProp(`borderTopLeftRadius`,e)}radiusTopRight(e){return this.setStyleProp(`borderTopRightRadius`,e)}radiusBottomLeft(e){return this.setStyleProp(`borderBottomLeftRadius`,e)}radiusBottomRight(e){return this.setStyleProp(`borderBottomRightRadius`,e)}radiusTop(e){return this.radiusTopLeft(e).radiusTopRight(e)}radiusBottom(e){return this.radiusBottomLeft(e).radiusBottomRight(e)}radiusLeft(e){return this.radiusTopLeft(e).radiusBottomLeft(e)}radiusRight(e){return this.radiusTopRight(e).radiusBottomRight(e)}radiusX(e){return this.radiusLeft(e).radiusRight(e)}radiusY(e){return this.radiusTop(e).radiusBottom(e)}display(e){return this.setStyleProp(`display`,e)}flexShrink(e){return this.setStyleProp(`flexShrink`,e)}flex(e){return this.setStyleProp(`flex`,e)}bgColor(e){return this.setStyleProp(`backgroundColor`,e)}color(e){return this.setStyleProp(`color`,e)}w(e){return this.setStyleProp(`width`,e)}h(e){return this.setStyleProp(`height`,e)}minW(e){return this.setStyleProp(`minWidth`,e)}maxW(e){return this.setStyleProp(`maxWidth`,e)}minH(e){return this.setStyleProp(`minHeight`,e)}maxH(e){return this.setStyleProp(`maxHeight`,e)}b(e){return this.setStyleProp(`border`,e)}bWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`borderWidth`,t)}bStyle(e){return this.setStyleProp(`borderStyle`,e)}bColor(e){return this.setStyleProp(`borderColor`,e)}bt(e){return this.setStyleProp(`borderTop`,e)}btWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`borderTopWidth`,t)}btStyle(e){return this.setStyleProp(`borderTopStyle`,e)}btColor(e){return this.setStyleProp(`borderTopColor`,e)}br(e){return this.setStyleProp(`borderRight`,e)}brWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`borderRightWidth`,t)}brStyle(e){return this.setStyleProp(`borderRightStyle`,e)}brColor(e){return this.setStyleProp(`borderRightColor`,e)}bb(e){return this.setStyleProp(`borderBottom`,e)}bbWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`borderBottomWidth`,t)}bbStyle(e){return this.setStyleProp(`borderBottomStyle`,e)}bbColor(e){return this.setStyleProp(`borderBottomColor`,e)}bl(e){return this.setStyleProp(`borderLeft`,e)}blWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`borderLeftWidth`,t)}blStyle(e){return this.setStyleProp(`borderLeftStyle`,e)}blColor(e){return this.setStyleProp(`borderLeftColor`,e)}bx(e){return this.setStyleProp(`borderLeft`,e),this.setStyleProp(`borderRight`,e),this}by(e){return this.setStyleProp(`borderTop`,e),this.setStyleProp(`borderBottom`,e),this}btl(e){return this.setStyleProp(`borderTop`,e),this.setStyleProp(`borderLeft`,e),this}btr(e){return this.setStyleProp(`borderTop`,e),this.setStyleProp(`borderRight`,e),this}bbl(e){return this.setStyleProp(`borderBottom`,e),this.setStyleProp(`borderLeft`,e),this}bbr(e){return this.setStyleProp(`borderBottom`,e),this.setStyleProp(`borderRight`,e),this}overflow(e){return this.setStyleProp(`overflow`,e)}overflowY(e){return this.setStyleProp(`overflowY`,e)}overflowX(e){return this.setStyleProp(`overflowX`,e)}fontSize(e){return this.setStyleProp(`fontSize`,e)}fontWeight(e){return this.setStyleProp(`fontWeight`,e)}fontFamily(e){return this.setStyleProp(`fontFamily`,e)}fontStyle(e){return this.setStyleProp(`fontStyle`,e)}textAlign(e){return this.setStyleProp(`textAlign`,e)}textDecoration(e){return this.setStyleProp(`textDecoration`,e)}pos(e){return this.setStyleProp(`position`,e)}top(e){return this.setStyleProp(`top`,e)}bottom(e){return this.setStyleProp(`bottom`,e)}left(e){return this.setStyleProp(`left`,e)}right(e){return this.setStyleProp(`right`,e)}cursor(e){return this.setStyleProp(`cursor`,e)}alignItems(e){return this.setStyleProp(`alignItems`,e)}justifyContent(e){return this.setStyleProp(`justifyContent`,e)}gap(e){return this.setStyleProp(`gap`,e)}flexDirection(e){return this.setStyleProp(`flexDirection`,e)}templateColumns(e){return this.setStyleProp(`gridTemplateColumns`,e)}templateRows(e){return this.setStyleProp(`gridTemplateRows`,e)}appearance(e){return this.setStyleProp(`appearance`,e)}userSelect(e){return this.setStyleProp(`userSelect`,e)}verticalAlign(e){return this.setStyleProp(`verticalAlign`,e)}whiteSpace(e){return this.setStyleProp(`whiteSpace`,e)}textOverflow(e){return this.setStyleProp(`textOverflow`,e)}zIndex(e){return this.setStyleProp(`zIndex`,e)}opacity(e){return this.setStyleProp(`opacity`,e)}transform(e){return this.setStyleProp(`transform`,e)}translate(e,t){let n=typeof e==`number`?`${e}px`:e,r=typeof t==`number`?`${t}px`:t;return this.setStyleProp(`transform`,`translate(${n}, ${r})`)}translateX(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`transform`,`translateX(${t})`)}translateY(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`transform`,`translateY(${t})`)}scale(e,t){let n=typeof e==`number`?e.toString():e,r=typeof t==`number`?t.toString():t;return this.setStyleProp(`transform`,`scale(${n}, ${r})`)}scaleX(e){let t=typeof e==`number`?e.toString():e;return this.setStyleProp(`transform`,`scaleX(${t})`)}scaleY(e){let t=typeof e==`number`?e.toString():e;return this.setStyleProp(`transform`,`scaleY(${t})`)}rotate(e){let t=typeof e==`number`?`${e}deg`:e;return this.setStyleProp(`transform`,`rotate(${t})`)}rotateX(e){let t=typeof e==`number`?`${e}deg`:e;return this.setStyleProp(`transform`,`rotateX(${t})`)}rotateY(e){let t=typeof e==`number`?`${e}deg`:e;return this.setStyleProp(`transform`,`rotateY(${t})`)}rotateZ(e){let t=typeof e==`number`?`${e}deg`:e;return this.setStyleProp(`transform`,`rotateZ(${t})`)}transformOrigin(e){return this.setStyleProp(`transformOrigin`,e)}transition(e){return this.setStyleProp(`transition`,e)}willChange(e){return this.setStyleProp(`willChange`,e)}boxShadow(e){return this.setStyleProp(`boxShadow`,e)}boxSizing(e){return this.setStyleProp(`boxSizing`,e)}background(e){return this.setStyleProp(`background`,e)}outline(e){return this.setStyleProp(`outline`,e)}outlineWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`outlineWidth`,t)}outlineStyle(e){return this.setStyleProp(`outlineStyle`,e)}outlineColor(e){return this.setStyleProp(`outlineColor`,e)}outlineOffset(e){return this.setStyleProp(`outlineOffset`,e)}lineHeight(e){return this.setStyleProp(`lineHeight`,e)}wordWrap(e){return this.setStyleProp(`wordWrap`,e)}tabSize(e){return this.setStyleProp(`tabSize`,e)}resize(e){return this.setStyleProp(`resize`,e)}borderCollapse(e){return this.setStyleProp(`borderCollapse`,e)}overflowEllipsis(){return this.overflow(`hidden`).whiteSpace(`nowrap`).textOverflow(`ellipsis`)}linearGradient(e,...t){let n=`linear-gradient(${e}, ${t.join(`, `)})`;return this.setStyleProp(`background`,n)}style(e){for(let t of Object.keys(e))this.setStyleProp(t,e[t]);return this}};const t={opacity:1,zIndex:1,fontWeight:1,lineHeight:1,flexGrow:1,flexShrink:1,order:1,zoom:1,scale:1,counterIncrement:1,counterReset:1,tabSize:1,orphans:1,widows:1,columns:1,columnCount:1,gridRow:1,gridColumn:1},n={WebkitAppearance:1},r=`svg.svgA.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`),i={svgA:`a`};function a(){return`${Date.now().toString(36)}-${(o++).toString(36)}`}let o=0;function s(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function c(e,n){return typeof n==`number`?t[e]?String(n):`${n}px`:n}const l=Symbol(`BaseDomIdentity`);var u=class t extends e{[l]=!0;getClientWidth(){return this.dom.clientWidth??0}getClientHeight(){return this.dom.clientHeight??0}getRect(){return this.dom.getBoundingClientRect()}getComputedStyle(){return window.getComputedStyle(this.dom)}getChildAt(e){return this.dom.children.item(e)}getNodeAt(e){return this.dom.childNodes.item(e)}getChildren(){return Array.from(this.dom.children)}getNodes(){return Array.from(this.dom.childNodes)}getText(){return this.dom.textContent}getAttr(e){return this.dom.getAttribute(e)}getProp(e){return this.dom[e]}hasClass(e){return this.dom.classList.contains(e)}text(e){return this.dom.textContent=e==null?``:String(e),this}html(e){return this.dom.innerHTML=e,this}id(e){return this.dom.id=e??``,this}attr(e,t){return t===void 0||t===!1?this.dom.removeAttribute(e):t===!0?this.dom.setAttribute(e,``):this.dom.setAttribute(e,String(t)),this}attrs(e){for(let[t,n]of Object.entries(e))this.attr(t,n);return this}toggleAttr(e,t){return this.dom.toggleAttribute(e,t),this}prop(e,t){return this.dom[e]=t,this}props(e){for(let[t,n]of Object.entries(e))this.prop(t,n);return this}className(e){return e==null?this.dom.removeAttribute(`class`):this.dom.setAttribute(`class`,e),this}tabIndex(e){return this.attr(`tabindex`,e)}toggleClass(e,t){return this.dom.classList.toggle(e,t),this}on(e,t,n){return this.dom.addEventListener(e,t,n),this}off(e,t,n){return this.dom.removeEventListener(e,t,n),this}add(...e){return this.dom.append(...e.map(e=>this.resolveNode(e))),this}insertAtIndex(e,...t){let n=Array.from(this.dom.children),r=Math.max(0,Math.min(e,n.length));for(let e of t){let t=n[r]??null;this.dom.insertBefore(this.resolveNode(e),t),r++}return this}setChildren(...e){return this.clear().add(...e)}setChildrenFromIndex(e,...t){let n=Array.from(this.dom.children),r=n.length,i=Math.max(0,Math.min(e,r));for(let e=i;e<r;e++)this.dom.removeChild(n[e]);let a=this.dom.children[i]??null;for(let e of t)this.dom.insertBefore(this.resolveNode(e),a);return this}clear(){return this.dom.textContent=``,this}clearRange(e,t){let n=Array.from(this.dom.children),r=Math.max(0,e??0),i=Math.min(n.length,t??n.length);for(let e=r;e<i;e++)this.dom.removeChild(n[e]);return this}contains(e){let n=e instanceof t?e.dom:e;return this.dom.contains(n)}query(e){let t=this.dom.querySelector(e);return t?new d(t.tagName.toLowerCase(),t):null}ref(e){return e(this),this}resolveNode(e){return typeof e==`string`||typeof e==`number`?document.createTextNode(String(e)):t.isBaseDom(e)?e.dom:e}setStyleProp(e,t){return t===void 0?(this.dom.style.removeProperty(s(e)),this):(this.dom.style.setProperty(s(e),c(e,t)),this)}static isBaseDom(e){return typeof e!=`object`||!e?!1:Object.getOwnPropertySymbols(e).includes(l)}},d=class extends u{constructor(e,t){super(),this._tag=i[e]??e,this._isSvg=r.includes(this._tag),this._dom=t??(this._isSvg?document.createElementNS(`http://www.w3.org/2000/svg`,this._tag):document.createElement(this._tag))}_tag;_isSvg;_dom;get tag(){return this._tag}get isSvg(){return this._isSvg}get dom(){return this._dom}remove(){this.dom.remove()}htmlFor(e){return this.tag===`label`&&(this.dom.htmlFor=e??``),this}title(e){return this.attr(`title`,e)}disabled(e){return this.attr(`disabled`,e)}disable(){return this.disabled(!0)}enable(){return this.disabled(!1)}focus(){return this.dom.focus(),this}blur(){return this.dom.blur(),this}click(){return this.isSvg||this.dom.click(),this}popover(e){return this.attr(`popover`,e)}popoverTarget(e){return this.attr(`popovertarget`,e)}popoverTargetAction(e){return this.attr(`popovertargetaction`,e)}showPopover(e){return this.dom.showPopover({source:e}),this}hidePopover(){return this.dom.hidePopover(),this}togglePopover(e,t){return this.dom.togglePopover({force:e,source:t}),this}};function f(e){return new d(e)}function p(e){let t=document.querySelector(e);return t?new d(t.tagName.toLowerCase(),t):null}var m=class extends d{constructor(){super(`a`)}href(e){return this.dom.href=e,this}};function h(){return new m}var g=class extends d{svgFill(e){return this.attr(`fill`,e)}fillRule(e){return this.attr(`fill-rule`,e)}svgStroke(e){return this.attr(`stroke`,e)}svgStrokeWidth(e){return this.attr(`stroke-width`,e.toString())}strokeLinejoin(e){return this.attr(`stroke-linejoin`,e)}strokeLinecap(e){return this.attr(`stroke-linecap`,e)}strokeMiterlimit(e){return this.attr(`stroke-miterlimit`,e.toString())}svgOpacity(e){return this.attr(`opacity`,e.toString())}svgTransform(e){return this.attr(`transform`,e)}svgTranslate(e,t){return this.attr(`transform`,`translate(${e} ${t})`)}svgTranslateX(e){return this.attr(`transform`,`translate(${e} 0)`)}svgTranslateY(e){return this.attr(`transform`,`translate(0 ${e})`)}svgRotate(e,t,n){let r=t!==void 0&&n!==void 0?`rotate(${e} ${t} ${n})`:`rotate(${e})`;return this.attr(`transform`,r)}svgScale(e){return this.attr(`transform`,`scale(${e})`)}svgScaleX(e){return this.attr(`transform`,`scale(${e} 1)`)}svgScaleY(e){return this.attr(`transform`,`scale(1 ${e})`)}},_=class extends d{constructor(){super(`button`)}type(e){return this.dom.type=e,this}};function ee(){return new _}var v=class extends d{constructor(e){super(`canvas`,e)}_size={width:this.dom.width,height:this.dom.height};getWidth(){return this.dom.width}getHeight(){return this.dom.height}width(e){return this.dom.width=e,this}height(e){return this.dom.height=e,this}setSize(e,t){return this.dom.width=e,this.dom.height=t,this}getSize(){return this._size.width=this.dom.width,this._size.height=this.dom.height,this._size}getAspect(){return this.dom.width/this.dom.height}getAspectScale(e){let t=this.dom.width/this.dom.height,n,r,i;return t>=1?(n=1/t,r=1,i=1):(n=1,r=t,i=1),e.x=n,e.y=r,e.z=i,e}};function y(){return new v}var b=class extends e{constructor(e,t,n){super(),this._sheet=e,this._index=t,this._rule=n}_sheet;_index;_rule;get sheet(){return this._sheet}get index(){return this._index}get rule(){return this._rule}get selectorText(){return this._rule.selectorText}remove(){this._sheet.removeRule(this)}extend(e){return this.sheet.cssRule(`${this.selectorText}${e}`)}hover(){return this.extend(`:hover`)}focus(){return this.extend(`:focus`)}focusWithin(){return this.extend(`:focus-within`)}active(){return this.extend(`:active`)}disabled(){return this.extend(`:disabled`)}setStyleProp(e,t){return t===void 0?(this.rule.style.removeProperty(s(e)),this):(this.rule.style.setProperty(s(e),c(e,t)),this)}},x=class extends u{constructor(e){super(),this._body=e}_body;get dom(){return this._body}};function S(e){return new x(e??document.body)}var C=class extends u{constructor(e){super(),this._head=e}_head;get dom(){return this._head}title(e){let t=this.dom.querySelector(`title`);return t||(t=this.dom.ownerDocument.createElement(`title`),this.dom.appendChild(t)),t.textContent=e,this}charset(e){let t=this.dom.querySelector(`meta[charset]`);return t||(t=this.dom.ownerDocument.createElement(`meta`),this.dom.insertBefore(t,this.dom.firstChild)),t.setAttribute(`charset`,e),this}viewport(e){let t=this.dom.querySelector(`meta[name="viewport"]`);return t||(t=this.dom.ownerDocument.createElement(`meta`),t.setAttribute(`name`,`viewport`),this.dom.appendChild(t)),t.setAttribute(`content`,e),this}httpEquiv(e,t){let n=this.dom.querySelector(`meta[http-equiv="${e}"]`);return n||(n=this.dom.ownerDocument.createElement(`meta`),n.setAttribute(`http-equiv`,e),this.dom.appendChild(n)),n.setAttribute(`content`,t),this}csp(e){let t=Object.entries(e).map(([e,t])=>`${e} ${t}`).join(`; `);return this.httpEquiv(`Content-Security-Policy`,t)}description(e){let t=this.dom.querySelector(`meta[name="description"]`);return t||(t=this.dom.ownerDocument.createElement(`meta`),t.setAttribute(`name`,`description`),this.dom.appendChild(t)),t.setAttribute(`content`,e),this}keywords(e){let t=this.dom.querySelector(`meta[name="keywords"]`);return t||(t=this.dom.ownerDocument.createElement(`meta`),t.setAttribute(`name`,`keywords`),this.dom.appendChild(t)),t.setAttribute(`content`,e),this}link(e,t,n={}){let r=this.dom.querySelector(`link[rel="${e}"]`);r||(r=this.dom.ownerDocument.createElement(`link`),r.setAttribute(`rel`,e),this.dom.appendChild(r)),r.setAttribute(`href`,t);for(let[e,t]of Object.entries(n))r.setAttribute(e,t);return this}};function w(e){return new C(e??document.head)}var T=class{constructor(e=window.document){this._document=e}_document;get dom(){return this._document}getBody(){return new x(this._document.body)}getHead(){return new C(this._document.head)}on(e,t,n){return this._document.addEventListener(e,t,n),this}off(e,t,n){return this._document.removeEventListener(e,t,n),this}dispatch(e){return this._document.dispatchEvent(e),this}query(e){let t=this._document.querySelector(e);return t?new d(t.tagName.toLowerCase(),t):null}};function E(){return new T}var D=class{constructor(e=window){this._window=e}_window;get dom(){return this._window}getDocument(){return new T(this._window.document)}on(e,t,n){return this._window.addEventListener(e,t,n),this}off(e,t,n){return this._window.removeEventListener(e,t,n),this}dispatch(e){return this._window.dispatchEvent(e),this}postMessage(e,t){return this._window.postMessage(e,t),this}};function O(e){return new D(e)}var k=class extends d{constructor(){super(`iframe`)}getContentWindow(){let e=this.dom.contentWindow;return e?new D(e):null}getContentDocument(){let e=this.dom.contentDocument;return e?new T(e):null}getBody(){let e=this.getContentDocument();return e?e.getBody():null}getHead(){let e=this.getContentDocument();return e?e.getHead():null}isSameOrigin(){try{return this.dom.contentWindow?.location.href,!0}catch{return!1}}src(e){return this.dom.src=e,this}allowFullscreen(e=!0){return this.dom.allowFullscreen=e,this}width(e){return this.dom.width=c(`width`,e),this}height(e){return this.dom.height=c(`height`,e),this}size(e,t){return this.width(e).height(t)}sandbox(e){let t=e?.join(` `);return this.attr(`sandbox`,t)}referrerPolicy(e){return this.dom.referrerPolicy=e,this}loading(e){return this.dom.loading=e,this}reloadViaSrc(){return this.dom.src&&(this.dom.src=this.dom.src),this}reloadViaLocation(){return this.dom.contentWindow?.location.reload(),this}reload(){try{this.dom.contentWindow?.location.reload()}catch{this.dom.src&&(this.dom.src=this.dom.src)}return this}queryInside(e){let t=this.getContentDocument()?.dom.querySelector(e);return t?new d(t.tagName.toLowerCase(),t):null}postMessage(e,t){let n=this.getContentWindow();return n&&n.postMessage(e,t),this}};function A(){return new k}var j=class extends d{constructor(){super(`img`)}getNaturalWidth(){return this.dom.naturalWidth??0}getNaturalHeight(){return this.dom.naturalHeight??0}src(e){return this.dom.src=e,this}width(e){return this.dom.width=e,this}height(e){return this.dom.height=e,this}setSize(e,t){return this.width(e).height(t)}alt(e){return this.dom.alt=e,this}};function te(){return new j}var M=class extends d{constructor(){super(`input`),this.dom.type=`checkbox`}name(e){return this.dom.name=e,this}checked(e){return this.prop(`checked`,e),this}isChecked(){return this.getProp(`checked`)}},N=class extends d{constructor(){super(`input`),this._dom.type=`color`}_rgb={r:1,g:1,b:1};name(e){return this._dom.name=e,this}value(e){return this._dom.value=e,this}getValue(){return this._dom.value}getRGB(){let e=this._dom.value,t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return this._rgb.r=t,this._rgb.g=n,this._rgb.b=r,this._rgb}getNormalizedRGB(){let e=this._dom.value,t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return this._rgb.r=t/255,this._rgb.g=n/255,this._rgb.b=r/255,this._rgb}},P=class extends d{constructor(){super(`input`),this.dom.type=`number`}name(e){return this.dom.name=e,this}value(e){return this.dom.value=String(e),this}getValue(){return Number(this.dom.value)}min(e){return this.dom.min=String(e),this}max(e){return this.dom.max=String(e),this}step(e){return this.dom.step=String(e),this}placeholder(e){return this.dom.placeholder=e,this}},F=class extends d{constructor(){super(`input`),this.dom.type=`range`}getValue(){return Number(this.dom.value)}getMin(){return Number(this.dom.min)}getMax(){return Number(this.dom.max)}getStep(){return Number(this.dom.step)}getRatio(){let e=this.getMin(),t=this.getMax(),n=this.getValue(),r=t-e;return r>0?Math.max(0,Math.min(1,(n-e)/r)):0}getPercent(){return this.getRatio()*100}name(e){return this.dom.name=e,this}value(e){return this.dom.value=String(e),this}min(e){return this.dom.min=String(e),this}max(e){return this.dom.max=String(e),this}step(e){return this.dom.step=String(e),this}bounds(e,t,n){return this.min(e).max(t).step(n)}ratio(e){let t=this.getMin(),n=this.getMax()-t,r=Math.max(0,Math.min(1,e));return this.value(t+r*n)}percent(e){return this.ratio(e/100)}trackFillColors(e,t){let n=this.getPercent();return this.linearGradient(`to right`,`${e} ${n}%`,`${t} ${n}%`)}},I=class extends d{constructor(){super(`input`),this.dom.type=`text`}name(e){return this.dom.name=e,this}value(e){return this.dom.value=e,this}getValue(){return this.dom.value}placeholder(e){return this.dom.placeholder=e,this}};function ne(e){switch(e){case`text`:return new I;case`number`:return new P;case`checkbox`:return new M;case`color`:return new N;case`range`:return new F}}var L=class{constructor(e,t,n){this._sheet=e,this._index=t,this._rule=n}_sheet;_index;_rule;get sheet(){return this._sheet}get index(){return this._index}get rule(){return this._rule}get length(){return this._rule.cssRules.length}get mediaText(){return this._rule.media.mediaText}cssRule(e){let t=this.length;return this.rule.insertRule(`${e}{}`,t),new b(this.sheet,t,this.rule.cssRules.item(t))}remove(){this.sheet.removeRule(this)}removeRule(e){this.rule.deleteRule(e.index)}},R=class extends d{constructor(){super(`option`)}value(e){return this.dom.value=String(e),this}getValue(){return this.dom.value}};function re(){return new R}var z=class extends d{constructor(){super(`progress`)}value(e){return this.dom.value=e,this}getValue(){return this.dom.value}max(e){return this.dom.max=e,this}getMax(){return this.dom.max}indeterminate(){return this.dom.removeAttribute(`value`),this}};function B(){return new z}var V=class extends d{constructor(){super(`select`)}name(e){return this.dom.name=e,this}value(e){return this.dom.value=String(e),this}getValue(){return this.dom.value}};function H(){return new V}var U=class e{constructor(e){this._dom=e}_dom;get dom(){return this._dom}get sheet(){return this.dom.sheet}get length(){return this.sheet.cssRules.length}cssRule(e){let t=this.length;return this.sheet.insertRule(`${e}{}`,t),new b(this,t,this.sheet.cssRules.item(t))}mediaRule(e){let t=this.length;return this.sheet.insertRule(`@media(${e}){}`,t),new L(this,t,this.sheet.cssRules.item(t))}mediaMinWidth(e){return this.mediaRule(`min-width: ${c(`min-width`,e)}`)}mediaMaxWidth(e){return this.mediaRule(`max-width: ${c(`max-width`,e)}`)}removeRule(e){this.sheet.deleteRule(e.index)}static getSheet(t=e.DEFAULT_STYLE_ID){let n=document.head.querySelector(`#${t}`);if(n)return new e(n);{let n=document.createElement(`style`);return n.id=t,n.setAttribute(`type`,`text/css`),document.head.append(n),new e(n)}}static DEFAULT_STYLE_ID=`__neptune-style__`},W=class extends g{constructor(){super(`circle`)}cx(e){return this.attr(`cx`,e.toString())}cy(e){return this.attr(`cy`,e.toString())}r(e){return this.attr(`r`,e.toString())}};function G(){return new W}var K=class extends g{constructor(){super(`svg`)}width(e){return this.attr(`width`,e.toString())}height(e){return this.attr(`height`,e.toString())}viewBox(e,t,n,r){return this.attr(`viewBox`,`${e} ${t} ${n} ${r}`)}};function q(){return new K}var J=class extends g{constructor(){super(`g`)}};function Y(){return new J}var X=class extends g{constructor(){super(`path`)}d(e){let t=typeof e==`string`?e:e.toString();return this.attr(`d`,t)}};function ie(){return new X}var Z=class{_segments=[];m(e,t,n=!1){let r=n?`m`:`M`;return this._segments.push(`${r}${e} ${t}`),this}l(e,t,n=!1){let r=n?`l`:`L`;return this._segments.push(`${r}${e} ${t}`),this}h(e,t=!1){let n=t?`h`:`H`;return this._segments.push(`${n}${e}`),this}v(e,t=!1){let n=t?`v`:`V`;return this._segments.push(`${n}${e}`),this}c(e,t,n,r,i,a,o=!1){let s=o?`c`:`C`;return this._segments.push(`${s}${e} ${t}, ${n} ${r}, ${i} ${a}`),this}q(e,t,n,r,i=!1){let a=i?`q`:`Q`;return this._segments.push(`${a}${e} ${t}, ${n} ${r}`),this}a(e,t,n,r,i,a,o,s=!1){let c=s?`a`:`A`;return this._segments.push(`${c}${e} ${t} ${n} ${r?1:0} ${i?1:0} ${a} ${o}`),this}t(e,t,n=!1){let r=n?`t`:`T`;return this._segments.push(`${r}${e} ${t}`),this}s(e,t,n,r,i=!1){let a=i?`s`:`S`;return this._segments.push(`${a}${e} ${t}, ${n} ${r}`),this}close(){return this._segments.push(`Z`),this}rect(e,t,n,r,i=!1){return i?this.m(e,t,!0).h(n,!0).v(r,!0).h(-n,!0).close():this.m(e,t).h(e+n).v(t+r).h(e).close()}roundedRect(e,t,n,r,i){let a=e+n,o=t+r;return this.m(e+i,t).h(a-i).a(i,i,0,!1,!0,a,t+i).v(o-i).a(i,i,0,!1,!0,a-i,o).h(e+i).a(i,i,0,!1,!0,e,o-i).v(t+i).a(i,i,0,!1,!0,e+i,t).close()}circle(e,t,n,r=!1){let i=e+n,a=t;return r?this.m(i,a,!0).a(n,n,0,!0,!1,-2*n,0,!0).a(n,n,0,!0,!1,2*n,0,!0):this.m(i,a).a(n,n,0,!0,!1,e-n,t).a(n,n,0,!0,!1,i,a)}ellipse(e,t,n,r,i=!1){let a=e+n,o=t;return i?this.m(a,o,!0).a(n,r,0,!0,!1,-2*n,0,!0).a(n,r,0,!0,!1,2*n,0,!0):this.m(a,o).a(n,r,0,!0,!1,e-n,t).a(n,r,0,!0,!1,a,o)}star(e,t,n,r,i=.5,a=!1){if(n<2)return this;let o=Math.PI/n,s=r*i;for(let i=0;i<n*2;i++){let n=i%2==0?r:s,c=i*o-Math.PI/2,l=e+n*Math.cos(c),u=t+n*Math.sin(c);if(a){let e=n*Math.cos(c),t=n*Math.sin(c);i===0?this.m(e,t,!0):this.l(e,t,!0)}else i===0?this.m(l,u):this.l(l,u)}return this.close()}polygon(e,t=!1){if(e.length<2)return this;let[n,r]=e[0];this.m(n,r,t);for(let n=1,r=e.length;n<r;n++){let[r,i]=e[n];this.l(r,i,t)}return this.close()}polyline(e,t=!1){if(e.length<2)return this;let[n,r]=e[0];this.m(n,r,t);for(let n=1,r=e.length;n<r;n++){let[r,i]=e[n];this.l(r,i,t)}return this}spline(e,t=.5,n=!1){let r=e.length;if(r<2)return this;let[i,a]=e[0];this.m(i,a,n);for(let o=0;o<r-1;o++){let[r,s]=e[o-1]??e[o],[c,l]=e[o],[u,d]=e[o+1],[f,p]=e[o+2]??e[o+1],m=(u-r)*t/6,h=(d-s)*t/6,g=(f-c)*t/6,_=(p-l)*t/6;if(n){let e=c+m-i,t=l+h-a,n=u-g-i,r=d-_-a,o=u-i,s=d-a;this.c(e,t,n,r,o,s,!0)}else this.c(c+m,l+h,u-g,d-_,u,d);[i,a]=[u,d]}return this}pathFrom(e,t=!1,n=!1){if(e.length<2)return this;let[r,i]=e[0];this.m(r,i,n);for(let t=1,r=e.length;t<r;t++){let[r,i]=e[t];this.l(r,i,n)}return t&&this.close(),this}polyBezier(e,t=!1){if(e.length<4||(e.length-1)%3!=0)return this;let[n,r]=e[0];this.m(n,r,t);for(let i=1;i<e.length;i+=3){let[a,o]=e[i],[s,c]=e[i+1],[l,u]=e[i+2];if(t){let e=a-n,t=o-r,i=s-n,d=c-r,f=l-n,p=u-r;this.c(e,t,i,d,f,p,!0)}else this.c(a,o,s,c,l,u);[n,r]=[l,u]}return this}polyQuadratic(e,t=!1){if(e.length<3||(e.length-1)%2!=0)return this;let[n,r]=e[0];this.m(n,r,t);for(let i=1;i<e.length;i+=2){let[a,o]=e[i],[s,c]=e[i+1];if(t){let e=a-n,t=o-r,i=s-n,l=c-r;this.q(e,t,i,l,!0)}else this.q(a,o,s,c);[n,r]=[s,c]}return this}polyArc(e,t=!1){if(e.length<2)return this;let[n,r]=e[0];this.m(n,r,t);for(let i=1,a=e.length;i<a;i++){let[a,o,s,c,l,u,d]=e[i];if(t){let e=u-n,t=d-r;this.a(a,o,s,c,l,e,t,!0)}else this.a(a,o,s,c,l,u,d);[n,r]=[u,d]}return this}toString(){return this._segments.join(` `)}};function ae(){return new Z}var Q=class extends g{constructor(){super(`rect`)}x(e){return this.attr(`x`,e.toString())}y(e){return this.attr(`y`,e.toString())}width(e){return this.attr(`width`,e.toString())}height(e){return this.attr(`height`,e.toString())}rx(e){return this.attr(`rx`,e.toString())}ry(e){return this.attr(`ry`,e.toString())}};function oe(){return new Q}var $=class extends d{constructor(){super(`textarea`)}name(e){return this.dom.name=e,this}value(e){return this.dom.value=e,this}getValue(){return this.dom.value}placeholder(e){return this.dom.placeholder=e,this}rows(e){return this.dom.rows=e,this}cols(e){return this.dom.cols=e,this}wrap(e){return this.dom.wrap=e,this}maxLength(e){return this.dom.maxLength=e,this}};function se(){return new $}export{f as $,h as $a,S as $body,ee as $btn,y as $canvas,G as $circle,ae as $d,E as $document,Y as $group,w as $head,A as $iframe,te as $img,ne as $input,re as $option,ie as $path,B as $progress,p as $query,oe as $rect,H as $select,q as $svg,se as $textarea,O as $window,m as AnchorElement,u as BaseDom,e as BaseStyle,g as BaseSvgElement,_ as Button,v as Canvas,b as CssRule,x as DomBody,T as DomDocument,d as DomElement,C as DomHead,D as DomWindow,k as IFrame,j as ImageElement,M as InputCheckbox,N as InputColor,P as InputNumber,F as InputRange,I as InputText,L as MediaRule,R as OptionElement,z as ProgressElement,r as SVG_TAGS,V as SelectElement,U as StyleSheet,W as SvgCircle,K as SvgElement,J as SvgGroup,X as SvgPath,Z as SvgPathData,Q as SvgRect,i as TAG_ALIAS,$ as TextArea,t as UNITLESS_CSS_PROPS,n as VENDOR_CSS_PROPS,s as camelToKebab,c as getStyleValue,a as uniqueId};
1
+ const e={opacity:1,zIndex:1,fontWeight:1,lineHeight:1,flexGrow:1,flexShrink:1,order:1,zoom:1,scale:1,counterIncrement:1,counterReset:1,tabSize:1,orphans:1,widows:1,columns:1,columnCount:1,gridRow:1,gridColumn:1},t={WebkitAppearance:1},n=`svg.svgA.animate.animateMotion.animateTransform.circle.clipPath.defs.desc.ellipse.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feDropShadow.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.filter.foreignObject.g.image.line.linearGradient.marker.mask.metadata.mpath.path.pattern.polygon.polyline.radialGradient.rect.script.set.stop.style.switch.symbol.text.textPath.title.tspan.use.view`.split(`.`),r={svgA:`a`};function i(){return`${Date.now().toString(36)}-${(a++).toString(36)}`}let a=0;function o(e){return e.replace(/([a-z])([A-Z])/g,`$1-$2`).toLowerCase()}function s(t,n){return typeof n==`number`?e[t]?String(n):`${n}px`:n}function c(e){return typeof e==`number`?`${e}px`:e}var l=class{p(e){return this.setStyleProp(`padding`,e)}pt(e){return this.setStyleProp(`paddingTop`,e)}pr(e){return this.setStyleProp(`paddingRight`,e)}pb(e){return this.setStyleProp(`paddingBottom`,e)}pl(e){return this.setStyleProp(`paddingLeft`,e)}px(e){return this.pl(e).pr(e)}py(e){return this.pt(e).pb(e)}m(e){return this.setStyleProp(`margin`,e)}mt(e){return this.setStyleProp(`marginTop`,e)}mr(e){return this.setStyleProp(`marginRight`,e)}mb(e){return this.setStyleProp(`marginBottom`,e)}ml(e){return this.setStyleProp(`marginLeft`,e)}radius(e){return this.setStyleProp(`borderRadius`,e)}radiusTopLeft(e){return this.setStyleProp(`borderTopLeftRadius`,e)}radiusTopRight(e){return this.setStyleProp(`borderTopRightRadius`,e)}radiusBottomLeft(e){return this.setStyleProp(`borderBottomLeftRadius`,e)}radiusBottomRight(e){return this.setStyleProp(`borderBottomRightRadius`,e)}radiusTop(e){return this.radiusTopLeft(e).radiusTopRight(e)}radiusBottom(e){return this.radiusBottomLeft(e).radiusBottomRight(e)}radiusLeft(e){return this.radiusTopLeft(e).radiusBottomLeft(e)}radiusRight(e){return this.radiusTopRight(e).radiusBottomRight(e)}radiusX(e){return this.radiusLeft(e).radiusRight(e)}radiusY(e){return this.radiusTop(e).radiusBottom(e)}display(e){return this.setStyleProp(`display`,e)}flexShrink(e){return this.setStyleProp(`flexShrink`,e)}flex(e){return this.setStyleProp(`flex`,e)}bgColor(e){return this.setStyleProp(`backgroundColor`,e)}color(e){return this.setStyleProp(`color`,e)}w(e){return this.setStyleProp(`width`,e)}h(e){return this.setStyleProp(`height`,e)}minW(e){return this.setStyleProp(`minWidth`,e)}maxW(e){return this.setStyleProp(`maxWidth`,e)}minH(e){return this.setStyleProp(`minHeight`,e)}maxH(e){return this.setStyleProp(`maxHeight`,e)}b(e){return this.setStyleProp(`border`,e)}bWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`borderWidth`,t)}bStyle(e){return this.setStyleProp(`borderStyle`,e)}bColor(e){return this.setStyleProp(`borderColor`,e)}bt(e){return this.setStyleProp(`borderTop`,e)}btWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`borderTopWidth`,t)}btStyle(e){return this.setStyleProp(`borderTopStyle`,e)}btColor(e){return this.setStyleProp(`borderTopColor`,e)}br(e){return this.setStyleProp(`borderRight`,e)}brWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`borderRightWidth`,t)}brStyle(e){return this.setStyleProp(`borderRightStyle`,e)}brColor(e){return this.setStyleProp(`borderRightColor`,e)}bb(e){return this.setStyleProp(`borderBottom`,e)}bbWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`borderBottomWidth`,t)}bbStyle(e){return this.setStyleProp(`borderBottomStyle`,e)}bbColor(e){return this.setStyleProp(`borderBottomColor`,e)}bl(e){return this.setStyleProp(`borderLeft`,e)}blWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`borderLeftWidth`,t)}blStyle(e){return this.setStyleProp(`borderLeftStyle`,e)}blColor(e){return this.setStyleProp(`borderLeftColor`,e)}bx(e){return this.setStyleProp(`borderLeft`,e),this.setStyleProp(`borderRight`,e),this}by(e){return this.setStyleProp(`borderTop`,e),this.setStyleProp(`borderBottom`,e),this}btl(e){return this.setStyleProp(`borderTop`,e),this.setStyleProp(`borderLeft`,e),this}btr(e){return this.setStyleProp(`borderTop`,e),this.setStyleProp(`borderRight`,e),this}bbl(e){return this.setStyleProp(`borderBottom`,e),this.setStyleProp(`borderLeft`,e),this}bbr(e){return this.setStyleProp(`borderBottom`,e),this.setStyleProp(`borderRight`,e),this}bCollapse(e){return this.setStyleProp(`borderCollapse`,e)}overflow(e){return this.setStyleProp(`overflow`,e)}overflowY(e){return this.setStyleProp(`overflowY`,e)}overflowX(e){return this.setStyleProp(`overflowX`,e)}fontSize(e){return this.setStyleProp(`fontSize`,e)}fontWeight(e){return this.setStyleProp(`fontWeight`,e)}fontFamily(e){return this.setStyleProp(`fontFamily`,e)}fontStyle(e){return this.setStyleProp(`fontStyle`,e)}textAlign(e){return this.setStyleProp(`textAlign`,e)}textDecoration(e){return this.setStyleProp(`textDecoration`,e)}pos(e){return this.setStyleProp(`position`,e)}top(e){return this.setStyleProp(`top`,e)}bottom(e){return this.setStyleProp(`bottom`,e)}left(e){return this.setStyleProp(`left`,e)}right(e){return this.setStyleProp(`right`,e)}cursor(e){return this.setStyleProp(`cursor`,e)}alignItems(e){return this.setStyleProp(`alignItems`,e)}justifyContent(e){return this.setStyleProp(`justifyContent`,e)}gap(e){return this.setStyleProp(`gap`,e)}flexDirection(e){return this.setStyleProp(`flexDirection`,e)}templateColumns(e){return this.setStyleProp(`gridTemplateColumns`,e)}templateRows(e){return this.setStyleProp(`gridTemplateRows`,e)}appearance(e){return this.setStyleProp(`appearance`,e)}userSelect(e){return this.setStyleProp(`userSelect`,e)}verticalAlign(e){return this.setStyleProp(`verticalAlign`,e)}whiteSpace(e){return this.setStyleProp(`whiteSpace`,e)}textOverflow(e){return this.setStyleProp(`textOverflow`,e)}zIndex(e){return this.setStyleProp(`zIndex`,e)}opacity(e){return this.setStyleProp(`opacity`,e)}transform(e){return this.setStyleProp(`transform`,e)}translate(e,t){let n=typeof e==`number`?`${e}px`:e,r=typeof t==`number`?`${t}px`:t;return this.setStyleProp(`transform`,`translate(${n}, ${r})`)}translateX(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`transform`,`translateX(${t})`)}translateY(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`transform`,`translateY(${t})`)}scale(e,t){let n=typeof e==`number`?e.toString():e,r=typeof t==`number`?t.toString():t;return this.setStyleProp(`transform`,`scale(${n}, ${r})`)}scaleX(e){let t=typeof e==`number`?e.toString():e;return this.setStyleProp(`transform`,`scaleX(${t})`)}scaleY(e){let t=typeof e==`number`?e.toString():e;return this.setStyleProp(`transform`,`scaleY(${t})`)}rotate(e){let t=typeof e==`number`?`${e}deg`:e;return this.setStyleProp(`transform`,`rotate(${t})`)}rotateX(e){let t=typeof e==`number`?`${e}deg`:e;return this.setStyleProp(`transform`,`rotateX(${t})`)}rotateY(e){let t=typeof e==`number`?`${e}deg`:e;return this.setStyleProp(`transform`,`rotateY(${t})`)}rotateZ(e){let t=typeof e==`number`?`${e}deg`:e;return this.setStyleProp(`transform`,`rotateZ(${t})`)}transformOrigin(e){return this.setStyleProp(`transformOrigin`,e)}transition(e){return this.setStyleProp(`transition`,e)}willChange(e){return this.setStyleProp(`willChange`,e)}boxShadow(e){return this.setStyleProp(`boxShadow`,e)}boxSizing(e){return this.setStyleProp(`boxSizing`,e)}background(e){return this.setStyleProp(`background`,e)}outline(e){return this.setStyleProp(`outline`,e)}outlineWidth(e){let t=typeof e==`number`?`${e}px`:e;return this.setStyleProp(`outlineWidth`,t)}outlineStyle(e){return this.setStyleProp(`outlineStyle`,e)}outlineColor(e){return this.setStyleProp(`outlineColor`,e)}outlineOffset(e){return this.setStyleProp(`outlineOffset`,e)}lineHeight(e){return this.setStyleProp(`lineHeight`,e)}wordWrap(e){return this.setStyleProp(`wordWrap`,e)}tabSize(e){return this.setStyleProp(`tabSize`,e)}resize(e){return this.setStyleProp(`resize`,e)}fill(e){return this.setStyleProp(`fill`,e)}stroke(e){return this.setStyleProp(`stroke`,e)}strokeWidth(e){return this.setStyleProp(`strokeWidth`,e)}content(e){return this.setStyleProp(`content`,e)}pointerEvents(e){return this.setStyleProp(`pointerEvents`,e)}filter(e){return this.setStyleProp(`filter`,e)}overflowEllipsis(){return this.overflow(`hidden`).whiteSpace(`nowrap`).textOverflow(`ellipsis`)}linearGradient(e,...t){let n=`linear-gradient(${e}, ${t.join(`, `)})`;return this.setStyleProp(`background`,n)}dropShadow(e,t,n,r){let i=`drop-shadow(${c(e)} ${c(t)} ${c(n)} ${r})`;return this.filter(i)}appRegion(e){return this.setStyleProp(`appRegion`,e)}style(e){for(let t of Object.keys(e))this.setStyleProp(t,e[t]);return this}styleProp(e,t){return this.setStyleProp(e,t)}};const u=Symbol(`BaseDomIdentity`);var d=class e extends l{[u]=!0;getClientWidth(){return this.dom.clientWidth??0}getClientHeight(){return this.dom.clientHeight??0}getRect(){return this.dom.getBoundingClientRect()}getComputedStyle(){return window.getComputedStyle(this.dom)}getChildAt(e){return this.dom.children.item(e)}getNodeAt(e){return this.dom.childNodes.item(e)}getChildren(){return Array.from(this.dom.children)}getNodes(){return Array.from(this.dom.childNodes)}getText(){return this.dom.textContent}getAttr(e){return this.dom.getAttribute(e)}getProp(e){return this.dom[e]}hasClass(e){return this.dom.classList.contains(e)}isFocused(){let e=this.dom.getRootNode();return!e||!(`activeElement`in e)?!1:e.activeElement===this.dom}text(e){return this.dom.textContent=e==null?``:String(e),this}html(e){return this.dom.innerHTML=e,this}id(e){return this.dom.id=e??``,this}attr(e,t){return t===void 0||t===!1?this.dom.removeAttribute(e):t===!0?this.dom.setAttribute(e,``):this.dom.setAttribute(e,String(t)),this}attrs(e){for(let[t,n]of Object.entries(e))this.attr(t,n);return this}toggleAttr(e,t){return this.dom.toggleAttribute(e,t),this}role(e){return this.attr(`role`,e)}ariaLabel(e){return this.attr(`aria-label`,e)}ariaHidden(e){return this.booleanishAttr(`aria-hidden`,e)}ariaSelected(e){return this.booleanishAttr(`aria-selected`,e)}ariaMultiselectable(e){return this.booleanishAttr(`aria-multiselectable`,e)}ariaSetSize(e){return this.attr(`aria-setsize`,e)}ariaPosInSet(e){return this.attr(`aria-posinset`,e)}ariaExpanded(e){return this.booleanishAttr(`aria-expanded`,e)}ariaControls(e){return this.attr(`aria-controls`,e)}ariaLive(e){return this.attr(`aria-live`,e)}ariaHasPopup(e){return this.attr(`aria-haspopup`,e)}ariaValueMin(e){return this.attr(`aria-valuemin`,e)}ariaValueMax(e){return this.attr(`aria-valuemax`,e)}ariaValueNow(e){return this.attr(`aria-valuenow`,e)}ariaValueText(e){return this.attr(`aria-valuetext`,e)}draggable(e){return this.attr(`draggable`,e)}prop(e,t){return this.dom[e]=t,this}props(e){for(let[t,n]of Object.entries(e))this.prop(t,n);return this}className(e){return e==null?this.dom.removeAttribute(`class`):this.dom.setAttribute(`class`,e),this}tabIndex(e){return this.attr(`tabindex`,e)}toggleClass(e,t){return this.dom.classList.toggle(e,t),this}on(e,t,n){return this.dom.addEventListener(e,t,n),this}off(e,t,n){return this.dom.removeEventListener(e,t,n),this}add(...e){return this.dom.append(...e.map(e=>this.resolveNode(e))),this}insertAtIndex(e,...t){let n=Array.from(this.dom.children),r=Math.max(0,Math.min(e,n.length));for(let e of t){let t=n[r]??null;this.dom.insertBefore(this.resolveNode(e),t),r++}return this}setChildren(...e){return this.clear().add(...e)}setChildrenFromIndex(e,...t){let n=Array.from(this.dom.children),r=n.length,i=Math.max(0,Math.min(e,r));for(let e=i;e<r;e++)this.dom.removeChild(n[e]);let a=this.dom.children[i]??null;for(let e of t)this.dom.insertBefore(this.resolveNode(e),a);return this}clear(){return this.dom.textContent=``,this}clearRange(e,t){let n=Array.from(this.dom.children),r=Math.max(0,e??0),i=Math.min(n.length,t??n.length);for(let e=r;e<i;e++)this.dom.removeChild(n[e]);return this}contains(t){let n=t instanceof e?t.dom:t;return this.dom.contains(n)}query(e){let t=this.dom.querySelector(e);return t?new f(t.tagName.toLowerCase(),t):null}ref(e){return e(this),this}resolveNode(t){return typeof t==`string`||typeof t==`number`?document.createTextNode(String(t)):e.isBaseDom(t)?t.dom:t}setStyleProp(e,t){return t===void 0?(this.dom.style.removeProperty(o(e)),this):(this.dom.style.setProperty(o(e),s(e,t)),this)}booleanishAttr(e,t){return this.attr(e,t===void 0?void 0:t?`true`:`false`)}static isBaseDom(e){return typeof e!=`object`||!e?!1:Object.getOwnPropertySymbols(e).includes(u)}},f=class extends d{constructor(e,t){super(),this._tag=r[e]??e,this._isSvg=n.includes(this._tag),this._dom=t??(this._isSvg?document.createElementNS(`http://www.w3.org/2000/svg`,this._tag):document.createElement(this._tag))}_tag;_isSvg;_dom;get tag(){return this._tag}get isSvg(){return this._isSvg}get dom(){return this._dom}remove(){this.dom.remove()}htmlFor(e){return this.tag===`label`&&(this.dom.htmlFor=e??``),this}title(e){return this.attr(`title`,e)}disabled(e){return this.attr(`disabled`,e)}disable(){return this.disabled(!0)}enable(){return this.disabled(!1)}focus(){return this.dom.focus(),this}blur(){return this.dom.blur(),this}click(){return this.isSvg||this.dom.click(),this}popover(e){return this.attr(`popover`,e)}popoverTarget(e){return this.attr(`popovertarget`,e)}popoverTargetAction(e){return this.attr(`popovertargetaction`,e)}showPopover(e){return this.dom.showPopover({source:e}),this}hidePopover(){return this.dom.hidePopover(),this}togglePopover(e,t){return this.dom.togglePopover({force:e,source:t}),this}};function p(e){return new f(e)}function m(e){let t=document.querySelector(e);return t?new f(t.tagName.toLowerCase(),t):null}var h=class extends f{constructor(){super(`a`)}href(e){return this.dom.href=e,this}};function g(){return new h}var _=class extends f{fill(e){return this.attr(`fill`,e)}fillRule(e){return this.attr(`fill-rule`,e)}fillOpacity(e){return this.attr(`fill-opacity`,e)}stroke(e){return this.attr(`stroke`,e)}strokeWidth(e){return this.attr(`stroke-width`,e)}strokeLinejoin(e){return this.attr(`stroke-linejoin`,e)}strokeLinecap(e){return this.attr(`stroke-linecap`,e)}strokeMiterlimit(e){return this.attr(`stroke-miterlimit`,e.toString())}strokeOpacity(e){return this.attr(`stroke-opacity`,e)}strokeDasharray(e){return this.attr(`stroke-dasharray`,e)}strokeDashoffset(e){return this.attr(`stroke-dashoffset`,e)}opacity(e){return this.attr(`opacity`,e)}transform(e){return this.attr(`transform`,e)}translate(e,t){return this.attr(`transform`,`translate(${e} ${t})`)}translateX(e){return this.attr(`transform`,`translate(${e} 0)`)}translateY(e){return this.attr(`transform`,`translate(0 ${e})`)}rotate(e,t,n){let r=t!==void 0&&n!==void 0?`rotate(${e} ${t} ${n})`:`rotate(${e})`;return this.attr(`transform`,r)}scale(e){return this.attr(`transform`,`scale(${e})`)}scaleX(e){return this.attr(`transform`,`scale(${e} 1)`)}scaleY(e){return this.attr(`transform`,`scale(1 ${e})`)}skewX(e){return this.attr(`transform`,`skewX(${e})`)}skewY(e){return this.attr(`transform`,`skewY(${e})`)}vectorEffect(e){return this.attr(`vector-effect`,e)}},v=class extends f{constructor(){super(`button`)}type(e){return this.dom.type=e,this}isDisabled(){return this.dom.disabled}};function y(){return new v}var b=class extends f{constructor(e){super(`canvas`,e)}_size={width:this.dom.width,height:this.dom.height};getWidth(){return this.dom.width}getHeight(){return this.dom.height}width(e){return this.dom.width=e,this}height(e){return this.dom.height=e,this}setSize(e,t){return this.dom.width=e,this.dom.height=t,this}getSize(){return this._size.width=this.dom.width,this._size.height=this.dom.height,this._size}getAspect(){return this.dom.width/this.dom.height}getAspectScale(e){let t=this.dom.width/this.dom.height,n,r,i;return t>=1?(n=1/t,r=1,i=1):(n=1,r=t,i=1),e.x=n,e.y=r,e.z=i,e}};function x(){return new b}var S=class extends l{constructor(e,t,n){super(),this._sheet=e,this._index=t,this._rule=n}_sheet;_index;_rule;get sheet(){return this._sheet}get index(){return this._index}get rule(){return this._rule}get selectorText(){return this._rule.selectorText}remove(){this._sheet.removeRule(this)}extend(e){return this.sheet.cssRule(`${this.selectorText}${e}`)}hover(){return this.extend(`:hover`)}focus(){return this.extend(`:focus`)}focusWithin(){return this.extend(`:focus-within`)}active(){return this.extend(`:active`)}disabled(){return this.extend(`:disabled`)}setStyleProp(e,t){return t===void 0?(this.rule.style.removeProperty(o(e)),this):(this.rule.style.setProperty(o(e),s(e,t)),this)}},C=class extends d{constructor(e){super(),this._body=e}_body;get dom(){return this._body}};function ee(e){return new C(e??document.body)}var w=class extends d{constructor(e){super(),this._head=e}_head;get dom(){return this._head}title(e){let t=this.dom.querySelector(`title`);return t||(t=this.dom.ownerDocument.createElement(`title`),this.dom.appendChild(t)),t.textContent=e,this}charset(e){let t=this.dom.querySelector(`meta[charset]`);return t||(t=this.dom.ownerDocument.createElement(`meta`),this.dom.insertBefore(t,this.dom.firstChild)),t.setAttribute(`charset`,e),this}viewport(e){let t=this.dom.querySelector(`meta[name="viewport"]`);return t||(t=this.dom.ownerDocument.createElement(`meta`),t.setAttribute(`name`,`viewport`),this.dom.appendChild(t)),t.setAttribute(`content`,e),this}httpEquiv(e,t){let n=this.dom.querySelector(`meta[http-equiv="${e}"]`);return n||(n=this.dom.ownerDocument.createElement(`meta`),n.setAttribute(`http-equiv`,e),this.dom.appendChild(n)),n.setAttribute(`content`,t),this}csp(e){let t=Object.entries(e).map(([e,t])=>`${e} ${t}`).join(`; `);return this.httpEquiv(`Content-Security-Policy`,t)}description(e){let t=this.dom.querySelector(`meta[name="description"]`);return t||(t=this.dom.ownerDocument.createElement(`meta`),t.setAttribute(`name`,`description`),this.dom.appendChild(t)),t.setAttribute(`content`,e),this}keywords(e){let t=this.dom.querySelector(`meta[name="keywords"]`);return t||(t=this.dom.ownerDocument.createElement(`meta`),t.setAttribute(`name`,`keywords`),this.dom.appendChild(t)),t.setAttribute(`content`,e),this}link(e,t,n={}){let r=this.dom.querySelector(`link[rel="${e}"]`);r||(r=this.dom.ownerDocument.createElement(`link`),r.setAttribute(`rel`,e),this.dom.appendChild(r)),r.setAttribute(`href`,t);for(let[e,t]of Object.entries(n))r.setAttribute(e,t);return this}};function te(e){return new w(e??document.head)}var T=class{constructor(e=window.document){this._document=e}_document;get dom(){return this._document}getBody(){return new C(this._document.body)}getHead(){return new w(this._document.head)}on(e,t,n){return this._document.addEventListener(e,t,n),this}off(e,t,n){return this._document.removeEventListener(e,t,n),this}dispatch(e){return this._document.dispatchEvent(e),this}query(e){let t=this._document.querySelector(e);return t?new f(t.tagName.toLowerCase(),t):null}};function E(){return new T}var D=class{constructor(e=window){this._window=e}_window;get dom(){return this._window}getDocument(){return new T(this._window.document)}on(e,t,n){return this._window.addEventListener(e,t,n),this}off(e,t,n){return this._window.removeEventListener(e,t,n),this}dispatch(e){return this._window.dispatchEvent(e),this}postMessage(e,t){return this._window.postMessage(e,t),this}};function O(e){return new D(e)}var k=class extends f{constructor(){super(`iframe`)}getContentWindow(){let e=this.dom.contentWindow;return e?new D(e):null}getContentDocument(){let e=this.dom.contentDocument;return e?new T(e):null}getBody(){let e=this.getContentDocument();return e?e.getBody():null}getHead(){let e=this.getContentDocument();return e?e.getHead():null}isSameOrigin(){try{return this.dom.contentWindow?.location.href,!0}catch{return!1}}src(e){return this.dom.src=e,this}allowFullscreen(e=!0){return this.dom.allowFullscreen=e,this}width(e){return this.dom.width=s(`width`,e),this}height(e){return this.dom.height=s(`height`,e),this}size(e,t){return this.width(e).height(t)}sandbox(e){let t=e?.join(` `);return this.attr(`sandbox`,t)}referrerPolicy(e){return this.dom.referrerPolicy=e,this}loading(e){return this.dom.loading=e,this}reloadViaSrc(){return this.dom.src&&(this.dom.src=this.dom.src),this}reloadViaLocation(){return this.dom.contentWindow?.location.reload(),this}reload(){try{this.dom.contentWindow?.location.reload()}catch{this.dom.src&&(this.dom.src=this.dom.src)}return this}queryInside(e){let t=this.getContentDocument()?.dom.querySelector(e);return t?new f(t.tagName.toLowerCase(),t):null}postMessage(e,t){let n=this.getContentWindow();return n&&n.postMessage(e,t),this}};function A(){return new k}var j=class extends f{constructor(){super(`img`)}getNaturalWidth(){return this.dom.naturalWidth??0}getNaturalHeight(){return this.dom.naturalHeight??0}src(e){return this.dom.src=e,this}width(e){return this.dom.width=e,this}height(e){return this.dom.height=e,this}setSize(e,t){return this.width(e).height(t)}alt(e){return this.dom.alt=e,this}};function ne(){return new j}var M=class extends f{constructor(){super(`input`),this.dom.type=`checkbox`}name(e){return this.dom.name=e,this}checked(e){return this.prop(`checked`,e),this}isChecked(){return this.getProp(`checked`)}},N=class extends f{constructor(){super(`input`),this._dom.type=`color`}_rgb={r:1,g:1,b:1};name(e){return this._dom.name=e,this}value(e){return this._dom.value=e,this}getValue(){return this._dom.value}getRGB(){let e=this._dom.value,t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return this._rgb.r=t,this._rgb.g=n,this._rgb.b=r,this._rgb}getNormalizedRGB(){let e=this._dom.value,t=parseInt(e.slice(1,3),16),n=parseInt(e.slice(3,5),16),r=parseInt(e.slice(5,7),16);return this._rgb.r=t/255,this._rgb.g=n/255,this._rgb.b=r/255,this._rgb}},P=class extends f{constructor(){super(`input`),this.dom.type=`number`}name(e){return this.dom.name=e,this}value(e){return this.dom.value=String(e),this}getValue(){return Number(this.dom.value)}min(e){return this.dom.min=String(e),this}max(e){return this.dom.max=String(e),this}step(e){return this.dom.step=String(e),this}placeholder(e){return this.dom.placeholder=e,this}},F=class extends f{constructor(){super(`input`),this.dom.type=`range`}getValue(){return Number(this.dom.value)}getMin(){return Number(this.dom.min)}getMax(){return Number(this.dom.max)}getStep(){return Number(this.dom.step)}getRatio(){let e=this.getMin(),t=this.getMax(),n=this.getValue(),r=t-e;return r>0?Math.max(0,Math.min(1,(n-e)/r)):0}getPercent(){return this.getRatio()*100}name(e){return this.dom.name=e,this}value(e){return this.dom.value=String(e),this}min(e){return this.dom.min=String(e),this}max(e){return this.dom.max=String(e),this}step(e){return this.dom.step=String(e),this}bounds(e,t,n){return this.min(e).max(t).step(n)}ratio(e){let t=this.getMin(),n=this.getMax()-t,r=Math.max(0,Math.min(1,e));return this.value(t+r*n)}percent(e){return this.ratio(e/100)}trackFillColors(e,t){let n=this.getPercent();return this.linearGradient(`to right`,`${e} ${n}%`,`${t} ${n}%`)}},I=class extends f{constructor(){super(`input`),this.dom.type=`text`}name(e){return this.dom.name=e,this}value(e){return this.dom.value=e,this}getValue(){return this.dom.value}placeholder(e){return this.dom.placeholder=e,this}};function L(e){switch(e){case`text`:return new I;case`number`:return new P;case`checkbox`:return new M;case`color`:return new N;case`range`:return new F}}var R=class{constructor(e,t,n){this._sheet=e,this._index=t,this._rule=n}_sheet;_index;_rule;get sheet(){return this._sheet}get index(){return this._index}get rule(){return this._rule}get length(){return this._rule.cssRules.length}get mediaText(){return this._rule.media.mediaText}cssRule(e){let t=this.length;return this.rule.insertRule(`${e}{}`,t),new S(this.sheet,t,this.rule.cssRules.item(t))}remove(){this.sheet.removeRule(this)}removeRule(e){this.rule.deleteRule(e.index)}},z=class extends f{constructor(){super(`option`)}value(e){return this.dom.value=String(e),this}getValue(){return this.dom.value}};function re(){return new z}var B=class extends f{constructor(){super(`progress`)}value(e){return this.dom.value=e,this}getValue(){return this.dom.value}max(e){return this.dom.max=e,this}getMax(){return this.dom.max}indeterminate(){return this.dom.removeAttribute(`value`),this}};function V(){return new B}var H=class extends f{constructor(){super(`select`)}name(e){return this.dom.name=e,this}value(e){return this.dom.value=String(e),this}getValue(){return this.dom.value}};function U(){return new H}var W=class e{constructor(e){this._dom=e}_dom;get dom(){return this._dom}get sheet(){return this.dom.sheet}get length(){return this.sheet.cssRules.length}cssRule(e){let t=this.length;return this.sheet.insertRule(`${e}{}`,t),new S(this,t,this.sheet.cssRules.item(t))}mediaRule(e){let t=this.length;return this.sheet.insertRule(`@media(${e}){}`,t),new R(this,t,this.sheet.cssRules.item(t))}mediaMinWidth(e){return this.mediaRule(`min-width: ${s(`min-width`,e)}`)}mediaMaxWidth(e){return this.mediaRule(`max-width: ${s(`max-width`,e)}`)}removeRule(e){this.sheet.deleteRule(e.index)}static getSheet(t=e.DEFAULT_STYLE_ID){let n=document.head.querySelector(`#${t}`);if(n)return new e(n);{let n=document.createElement(`style`);return n.id=t,n.setAttribute(`type`,`text/css`),document.head.append(n),new e(n)}}static DEFAULT_STYLE_ID=`__neptune-style__`},G=class extends _{constructor(){super(`circle`)}cx(e){return this.attr(`cx`,e.toString())}cy(e){return this.attr(`cy`,e.toString())}r(e){return this.attr(`r`,e.toString())}};function K(){return new G}var q=class extends _{constructor(){super(`svg`)}width(e){return this.attr(`width`,e.toString())}height(e){return this.attr(`height`,e.toString())}viewBox(e,t,n,r){return this.attr(`viewBox`,`${e} ${t} ${n} ${r}`)}};function J(){return new q}var Y=class extends _{constructor(){super(`g`)}};function ie(){return new Y}var X=class extends _{constructor(){super(`path`)}d(e){let t=typeof e==`string`?e:e.toString();return this.attr(`d`,t)}};function ae(){return new X}var Z=class{_segments=[];m(e,t,n=!1){let r=n?`m`:`M`;return this._segments.push(`${r}${e} ${t}`),this}l(e,t,n=!1){let r=n?`l`:`L`;return this._segments.push(`${r}${e} ${t}`),this}h(e,t=!1){let n=t?`h`:`H`;return this._segments.push(`${n}${e}`),this}v(e,t=!1){let n=t?`v`:`V`;return this._segments.push(`${n}${e}`),this}c(e,t,n,r,i,a,o=!1){let s=o?`c`:`C`;return this._segments.push(`${s}${e} ${t}, ${n} ${r}, ${i} ${a}`),this}q(e,t,n,r,i=!1){let a=i?`q`:`Q`;return this._segments.push(`${a}${e} ${t}, ${n} ${r}`),this}a(e,t,n,r,i,a,o,s=!1){let c=s?`a`:`A`;return this._segments.push(`${c}${e} ${t} ${n} ${r?1:0} ${i?1:0} ${a} ${o}`),this}t(e,t,n=!1){let r=n?`t`:`T`;return this._segments.push(`${r}${e} ${t}`),this}s(e,t,n,r,i=!1){let a=i?`s`:`S`;return this._segments.push(`${a}${e} ${t}, ${n} ${r}`),this}close(){return this._segments.push(`Z`),this}rect(e,t,n,r,i=!1){return i?this.m(e,t,!0).h(n,!0).v(r,!0).h(-n,!0).close():this.m(e,t).h(e+n).v(t+r).h(e).close()}roundedRect(e,t,n,r,i){let a=e+n,o=t+r;return this.m(e+i,t).h(a-i).a(i,i,0,!1,!0,a,t+i).v(o-i).a(i,i,0,!1,!0,a-i,o).h(e+i).a(i,i,0,!1,!0,e,o-i).v(t+i).a(i,i,0,!1,!0,e+i,t).close()}circle(e,t,n,r=!1){let i=e+n,a=t;return r?this.m(i,a,!0).a(n,n,0,!0,!1,-2*n,0,!0).a(n,n,0,!0,!1,2*n,0,!0):this.m(i,a).a(n,n,0,!0,!1,e-n,t).a(n,n,0,!0,!1,i,a)}ellipse(e,t,n,r,i=!1){let a=e+n,o=t;return i?this.m(a,o,!0).a(n,r,0,!0,!1,-2*n,0,!0).a(n,r,0,!0,!1,2*n,0,!0):this.m(a,o).a(n,r,0,!0,!1,e-n,t).a(n,r,0,!0,!1,a,o)}star(e,t,n,r,i=.5,a=!1){if(n<2)return this;let o=Math.PI/n,s=r*i;for(let i=0;i<n*2;i++){let n=i%2==0?r:s,c=i*o-Math.PI/2,l=e+n*Math.cos(c),u=t+n*Math.sin(c);if(a){let e=n*Math.cos(c),t=n*Math.sin(c);i===0?this.m(e,t,!0):this.l(e,t,!0)}else i===0?this.m(l,u):this.l(l,u)}return this.close()}polygon(e,t=!1){if(e.length<2)return this;let[n,r]=e[0];this.m(n,r,t);for(let n=1,r=e.length;n<r;n++){let[r,i]=e[n];this.l(r,i,t)}return this.close()}polyline(e,t=!1){if(e.length<2)return this;let[n,r]=e[0];this.m(n,r,t);for(let n=1,r=e.length;n<r;n++){let[r,i]=e[n];this.l(r,i,t)}return this}spline(e,t=.5,n=!1){let r=e.length;if(r<2)return this;let[i,a]=e[0];this.m(i,a,n);for(let o=0;o<r-1;o++){let[r,s]=e[o-1]??e[o],[c,l]=e[o],[u,d]=e[o+1],[f,p]=e[o+2]??e[o+1],m=(u-r)*t/6,h=(d-s)*t/6,g=(f-c)*t/6,_=(p-l)*t/6;if(n){let e=c+m-i,t=l+h-a,n=u-g-i,r=d-_-a,o=u-i,s=d-a;this.c(e,t,n,r,o,s,!0)}else this.c(c+m,l+h,u-g,d-_,u,d);[i,a]=[u,d]}return this}pathFrom(e,t=!1,n=!1){if(e.length<2)return this;let[r,i]=e[0];this.m(r,i,n);for(let t=1,r=e.length;t<r;t++){let[r,i]=e[t];this.l(r,i,n)}return t&&this.close(),this}polyBezier(e,t=!1){if(e.length<4||(e.length-1)%3!=0)return this;let[n,r]=e[0];this.m(n,r,t);for(let i=1;i<e.length;i+=3){let[a,o]=e[i],[s,c]=e[i+1],[l,u]=e[i+2];if(t){let e=a-n,t=o-r,i=s-n,d=c-r,f=l-n,p=u-r;this.c(e,t,i,d,f,p,!0)}else this.c(a,o,s,c,l,u);[n,r]=[l,u]}return this}polyQuadratic(e,t=!1){if(e.length<3||(e.length-1)%2!=0)return this;let[n,r]=e[0];this.m(n,r,t);for(let i=1;i<e.length;i+=2){let[a,o]=e[i],[s,c]=e[i+1];if(t){let e=a-n,t=o-r,i=s-n,l=c-r;this.q(e,t,i,l,!0)}else this.q(a,o,s,c);[n,r]=[s,c]}return this}polyArc(e,t=!1){if(e.length<2)return this;let[n,r]=e[0];this.m(n,r,t);for(let i=1,a=e.length;i<a;i++){let[a,o,s,c,l,u,d]=e[i];if(t){let e=u-n,t=d-r;this.a(a,o,s,c,l,e,t,!0)}else this.a(a,o,s,c,l,u,d);[n,r]=[u,d]}return this}toString(){return this._segments.join(` `)}};function oe(){return new Z}var Q=class extends _{constructor(){super(`rect`)}x(e){return this.attr(`x`,e.toString())}y(e){return this.attr(`y`,e.toString())}width(e){return this.attr(`width`,e.toString())}height(e){return this.attr(`height`,e.toString())}rx(e){return this.attr(`rx`,e.toString())}ry(e){return this.attr(`ry`,e.toString())}};function se(){return new Q}var $=class extends f{constructor(){super(`textarea`)}name(e){return this.dom.name=e,this}value(e){return this.dom.value=e,this}getValue(){return this.dom.value}placeholder(e){return this.dom.placeholder=e,this}rows(e){return this.dom.rows=e,this}cols(e){return this.dom.cols=e,this}wrap(e){return this.dom.wrap=e,this}maxLength(e){return this.dom.maxLength=e,this}};function ce(){return new $}export{p as $,g as $a,ee as $body,y as $btn,x as $canvas,K as $circle,oe as $d,E as $document,ie as $group,te as $head,A as $iframe,ne as $img,L as $input,re as $option,ae as $path,V as $progress,m as $query,se as $rect,U as $select,J as $svg,ce as $textarea,O as $window,h as AnchorElement,d as BaseDom,l as BaseStyle,_ as BaseSvgElement,v as Button,b as Canvas,S as CssRule,C as DomBody,T as DomDocument,f as DomElement,w as DomHead,D as DomWindow,k as IFrame,j as ImageElement,M as InputCheckbox,N as InputColor,P as InputNumber,F as InputRange,I as InputText,R as MediaRule,z as OptionElement,B as ProgressElement,n as SVG_TAGS,H as SelectElement,W as StyleSheet,G as SvgCircle,q as SvgElement,Y as SvgGroup,X as SvgPath,Z as SvgPathData,Q as SvgRect,r as TAG_ALIAS,$ as TextArea,e as UNITLESS_CSS_PROPS,t as VENDOR_CSS_PROPS,o as camelToKebab,c as getPxStyleValue,s as getStyleValue,i as uniqueId};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neptune3d/dom",
3
- "version": "0.0.12",
3
+ "version": "0.0.14",
4
4
  "description": "Helper classes and functions for the DOM.",
5
5
  "keywords": [
6
6
  "dom"