@luzmo/analytics-components-kit 1.0.1-alpha.54 → 1.0.1-alpha.55
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/components/display-settings/index.cjs +1 -1
- package/components/display-settings/index.js +1 -1
- package/components/display-settings-binning/index.cjs +1 -1
- package/components/display-settings-binning/index.js +3 -3
- package/components/display-settings-datetime/index.cjs +1 -1
- package/components/display-settings-datetime/index.js +4 -4
- package/components/display-settings-grand-totals/index.cjs +1 -1
- package/components/display-settings-grand-totals/index.js +2 -2
- package/components/display-settings-numeric/index.cjs +1 -1
- package/components/display-settings-numeric/index.js +4 -4
- package/components/display-settings-period-over-period/index.cjs +6 -6
- package/components/display-settings-period-over-period/index.js +4 -4
- package/components/draggable-data-item-level/index.cjs +1 -1
- package/components/draggable-data-item-level/index.js +1 -1
- package/components/droppable-slot/index.cjs +1 -1
- package/components/droppable-slot/index.js +1 -1
- package/components/edit-item/index.cjs +1 -1
- package/components/edit-item/index.js +1 -1
- package/components/edit-option-action-button-group/index.cjs +1 -1
- package/components/edit-option-action-button-group/index.js +2 -2
- package/components/edit-option-color-picker/index.cjs +1 -1
- package/components/edit-option-color-picker/index.js +2 -2
- package/components/edit-option-color-range/index.cjs +1 -1
- package/components/edit-option-color-range/index.js +5 -5
- package/components/edit-option-multi-language-field/index.cjs +1 -1
- package/components/edit-option-multi-language-field/index.js +1 -1
- package/components/edit-option-number-field/index.cjs +1 -1
- package/components/edit-option-number-field/index.js +1 -1
- package/components/edit-option-picker/index.cjs +1 -1
- package/components/edit-option-picker/index.js +2 -2
- package/components/edit-option-position-picker/index.cjs +1 -1
- package/components/edit-option-position-picker/index.js +1 -1
- package/components/edit-option-positions-number-field/index.cjs +1 -1
- package/components/edit-option-positions-number-field/index.js +1 -1
- package/components/edit-option-radio-button-group/index.cjs +1 -1
- package/components/edit-option-radio-button-group/index.js +1 -1
- package/components/edit-option-text-field/index.cjs +1 -1
- package/components/edit-option-text-field/index.js +1 -1
- package/components/filter-data-item-picker/index.cjs +1 -1
- package/components/filter-data-item-picker/index.js +3 -3
- package/components/filter-expression-picker/index.cjs +1 -1
- package/components/filter-expression-picker/index.js +1 -1
- package/components/filter-item/index.cjs +1 -1
- package/components/filter-item/index.js +1 -1
- package/components/filter-value-picker/index.cjs +1 -1
- package/components/filter-value-picker/index.js +1 -1
- package/components/filter-value-picker-datetime/index.cjs +1 -1
- package/components/filter-value-picker-datetime/index.js +7 -7
- package/components/filter-value-picker-hierarchy/index.cjs +1 -1
- package/components/filter-value-picker-hierarchy/index.js +2 -2
- package/components/filter-value-picker-numeric/index.cjs +1 -1
- package/components/filter-value-picker-numeric/index.js +2 -2
- package/components/grid/index.cjs +1 -1
- package/components/grid/index.js +2 -2
- package/components/{index-Tx5oQjbt.cjs → index--3gSNupB.cjs} +1 -1
- package/components/{index-B2ngKWOI.js → index-9LxnqLJa.js} +2 -2
- package/components/{index-CZ0HI7ep.js → index-B759H2a6.js} +2 -2
- package/components/{index-tXl_aMnZ.cjs → index-BKx2WhDB.cjs} +1 -1
- package/components/{index-cHKqEi5-.cjs → index-BSgp4MWQ.cjs} +1 -1
- package/components/{index-DTI4dIyd.js → index-BY1yDIAI.js} +634 -586
- package/components/index-Be-pSgzQ.js +174 -0
- package/components/{index-D4JNE3zI.cjs → index-BgaRiq5f.cjs} +1 -1
- package/components/{index-BssHAgUU.js → index-BobhBKA2.js} +1 -1
- package/components/{index-MPM_B4re.cjs → index-Bpdwb9Js.cjs} +3 -3
- package/components/{index-Ck5VRoXN.cjs → index-BukPAqqU.cjs} +1 -1
- package/components/{index-DsP81c4M.js → index-C6NpWavw.js} +2 -2
- package/components/{index-BC1LV3vH.js → index-COU9XhBt.js} +1 -1
- package/components/{index-BEtf1WaQ.js → index-Cf_a7VrO.js} +2 -2
- package/components/{index-DV63kOPg.js → index-CgriGUqp.js} +3 -3
- package/components/{index-D05oY5ND.cjs → index-CpUmLQwd.cjs} +1 -1
- package/components/index-DCdx3dxQ.cjs +42 -0
- package/components/{index-BbpsZYZF.cjs → index-DMhm0FM8.cjs} +26 -25
- package/components/{index-DE3d0E0P.js → index-DYmi-X87.js} +2 -2
- package/components/{index-CbuHBIDB.js → index-DeIay7ZE.js} +2 -2
- package/components/{index-1oIrlkAr.cjs → index-cbfU96gS.cjs} +8 -8
- package/components/{index-DSQyBS9Z.cjs → index-fwJBhawL.cjs} +1 -1
- package/components/index.cjs +1 -1
- package/components/index.js +2 -2
- package/components/item-context-configs.cjs +56 -58
- package/components/item-context-configs.js +151 -35
- package/components/{luzmo-icons-DbwDQtuO-DSQ-uVxy.cjs → luzmo-icons-4nDFv1Lq-D6-m-VWM.cjs} +2 -2
- package/components/{luzmo-icons-DbwDQtuO-QG0fLECn.js → luzmo-icons-4nDFv1Lq-DffGNBpO.js} +7 -7
- package/components/slot-contents-picker/index.cjs +1 -1
- package/components/slot-contents-picker/index.js +3 -3
- package/components/slot-menu/index.cjs +1 -1
- package/components/slot-menu/index.js +1 -1
- package/components/{text-field-BIADXoLC-B9oE05VF.js → text-field-ol9Ed5lQ-DbpeM4EP.js} +1 -1
- package/components/{text-field-BIADXoLC-B8w9TVmS.cjs → text-field-ol9Ed5lQ-cRqtIf_0.cjs} +1 -1
- package/item-definitions/area-chart/area-chart-context.config.d.ts +1 -0
- package/item-definitions/bar-chart/bar-chart-context.config.d.ts +1 -0
- package/item-definitions/box-plot/box-plot-context.config.d.ts +1 -0
- package/item-definitions/bubble-chart/bubble-chart-context.config.d.ts +1 -0
- package/item-definitions/bullet-chart/bullet-chart-context.config.d.ts +1 -0
- package/item-definitions/choropleth-map/choropleth-map-context.config.d.ts +1 -0
- package/item-definitions/circle-pack-chart/circle-pack-chart-context.config.d.ts +1 -0
- package/item-definitions/circular-gauge/circular-gauge-context.config.d.ts +1 -0
- package/item-definitions/column-chart/column-chart-context.config.d.ts +1 -0
- package/item-definitions/combination-chart/combination-chart-context.config.d.ts +1 -0
- package/item-definitions/conditional-number/conditional-number-context.config.d.ts +1 -0
- package/item-definitions/date-filter/date-filter-context.config.d.ts +1 -0
- package/item-definitions/donut-chart/donut-chart-context.config.d.ts +1 -0
- package/item-definitions/dropdown-filter/dropdown-filter-context.config.d.ts +1 -0
- package/item-definitions/evolution-number/evolution-number-context.config.d.ts +1 -0
- package/item-definitions/funnel-chart/funnel-chart-context.config.d.ts +1 -0
- package/item-definitions/heat-map/heat-map-context.config.d.ts +1 -0
- package/item-definitions/heat-table/heat-table-context.config.d.ts +1 -0
- package/item-definitions/hexbin-map/hexbin-map-context.config.d.ts +1 -0
- package/item-definitions/image/image-context.config.d.ts +1 -0
- package/item-definitions/line-chart/line-chart-context.config.d.ts +1 -0
- package/item-definitions/marker-map/marker-map-context.config.d.ts +1 -0
- package/item-definitions/ohlc-chart/ohlc-chart-context.config.d.ts +1 -0
- package/item-definitions/parallel-coordinates-plot/parallel-coordinates-plot-context.config.d.ts +1 -0
- package/item-definitions/pivot-table/pivot-table-context.config.d.ts +1 -0
- package/item-definitions/pyramid-chart/pyramid-chart-context.config.d.ts +1 -0
- package/item-definitions/radar-chart/radar-chart-context.config.d.ts +1 -0
- package/item-definitions/regular-table/regular-table-context.config.d.ts +1 -0
- package/item-definitions/route-map/route-map-context.config.d.ts +1 -0
- package/item-definitions/sankey-diagram/sankey-diagram-context.config.d.ts +5 -0
- package/item-definitions/scatter-plot/scatter-plot-context.config.d.ts +1 -0
- package/item-definitions/search-filter/search-filter-context.config.d.ts +1 -0
- package/item-definitions/slicer-filter/slicer-filter-context.config.d.ts +1 -0
- package/item-definitions/slider-filter/slider-filter-context.config.d.ts +1 -0
- package/item-definitions/spacer/spacer-context.config.d.ts +1 -0
- package/item-definitions/speedometer-chart/speedometer-chart-context.config.d.ts +1 -0
- package/item-definitions/spike-map/spike-map-context.config.d.ts +1 -0
- package/item-definitions/strip-plot/strip-plot-context.config.d.ts +1 -0
- package/item-definitions/sunburst-chart/sunburst-chart-context.config.d.ts +1 -0
- package/item-definitions/symbol-map/symbol-map-context.config.d.ts +1 -0
- package/item-definitions/text/text-context.config.d.ts +1 -0
- package/item-definitions/treemap-chart/treemap-chart-context.config.d.ts +1 -0
- package/item-definitions/venn-diagram/venn-diagram-context.config.d.ts +1 -0
- package/item-definitions/video/video-context.config.d.ts +1 -0
- package/item-definitions/wordcloud-chart/wordcloud-chart-context.config.d.ts +1 -0
- package/package.json +1 -1
- package/components/index-D_jFGBMs.js +0 -174
- package/components/index-Dy_5M3M5.cjs +0 -42
@@ -17,7 +17,7 @@
|
|
17
17
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
18
18
|
* SOFTWARE.
|
19
19
|
* */
|
20
|
-
"use strict";const d=require("./base-D76d76ww-tT6yr8eb.cjs"),
|
20
|
+
"use strict";const d=require("./base-D76d76ww-tT6yr8eb.cjs"),ct=require("./directive-helpers-Cm6gitnu-BeggOiwf.cjs"),P=require("./if-defined-DOaE2coe-Cvlu5s9n.cjs"),ko=require("./luzmo-icons-4nDFv1Lq-D6-m-VWM.cjs"),Be=require("./focusable-BxtpnzWp-CkK9AeMt.cjs"),Ve=require("./async-directive-BfcqVjDp-C8C45jl6.cjs"),ee=require("./streaming-listener-CP-JE6Fa-DMzr1X1m.cjs"),na=require("./text-field-ol9Ed5lQ-cRqtIf_0.cjs"),Ne=require("./index-CUvucmA0.cjs");require("./index-DtohCwyO.cjs");require("./index-BoXbQm2o.cjs");const Je=require("./when-CDK1Tt5Y-BN3qcTK0.cjs"),ia=require("./mutation-controller-DH7YOCyj-B6sXpbgh.cjs"),ca=require("./roving-tabindex-DOg4z6ZU-DmyYPRYY.cjs");/*! * Lucero - The design system for Luzmo.
|
21
21
|
*
|
22
22
|
* Copyright © 2025 Luzmo
|
23
23
|
* All rights reserved.
|
@@ -33,7 +33,7 @@
|
|
33
33
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
34
34
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
35
35
|
* SOFTWARE.
|
36
|
-
* */const
|
36
|
+
* */const ua=':host{inline-size:var(--luzmo-color-loupe-width, 48px);block-size:var(--luzmo-color-loupe-height, 64px);transform:translateY(var(--luzmo-color-loupe-animation-distance, 8px));opacity:0;transform-origin:bottom;pointer-events:none;filter:drop-shadow(var(--luzmo-color-loupe-drop-shadow-x, 0) var(--luzmo-color-loupe-drop-shadow-y, 2px) var(--luzmo-color-loupe-drop-shadow-blur, 8px) var(--luzmo-color-loupe-drop-shadow-color, rgba(0, 0, 0, .25)));transition:transform .1s ease-in-out,opacity .125s ease-in-out;position:absolute;inset-block-end:calc(var(--luzmo-color-handle-size, 16px) - var(--luzmo-color-handle-outer-border-width, 1px) + var(--luzmo-color-loupe-offset, 12px));inset-inline-end:calc(50% - var(--luzmo-color-loupe-width, 48px) / 2)}:host:dir(rtl),:host([dir=rtl]){inset-inline-end:calc(50% - var(--luzmo-color-loupe-width, 48px) / 2 - 1px)}:host([open]){opacity:1;transform:translate(0)}.luzmo-color-loupe-inner-border{fill:var(--luzmo-picked-color);stroke:var(--luzmo-color-loupe-inner-border-color, rgba(0, 0, 0, .1));stroke-width:var(--luzmo-color-loupe-inner-border-width, 1px)}.luzmo-color-loupe-outer-border{fill:none;stroke:var(--luzmo-color-loupe-outer-border-color, white);stroke-width:calc(var(--luzmo-color-loupe-outer-border-width, 2px) + 2px);transform:translate(calc((var(--luzmo-color-loupe-outer-border-width, 2px) + 2px) / 2))}.luzmo-color-loupe-checkerboard-pattern{fill:var(--luzmo-color-loupe-checkerboard-dark-color, rgb(230, 230, 230))}.luzmo-color-loupe-checkerboard-background{fill:var(--luzmo-color-loupe-checkerboard-light-color, rgb(255, 255, 255))}.luzmo-color-loupe-checkerboard-fill{fill:var(--luzmo-color-loupe-checkerboard-fill, url(#checkerboard-primary))}@media (forced-colors: active){:host{--highcontrast-colorloupe-outer-border-color: CanvasText}}svg{width:inherit;height:inherit}.loupe-clipped{clip-path:path("M23 61.575C19.0044 57.435 15.2591 53.0606 11.784 48.475C8.68949 44.4532 5.96348 40.1608 3.639 35.65C1.224 30.8 0 26.549 0 23C0.00319993 17.6937 1.84059 12.5516 5.20091 8.44488C8.56122 4.33815 13.2378 1.51928 18.4385 0.465803C23.6392 -0.587678 29.0442 0.189006 33.7378 2.66428C38.4314 5.13955 42.125 9.16122 44.193 14.048C45.3915 16.88 46.0061 19.9248 46 23C46 26.551 44.774 30.811 42.355 35.661C40.0274 40.1747 37.298 44.4698 34.2 48.494C30.7297 53.0728 26.9898 57.4409 23 61.575ZZ")}.opacity-checkerboard{position:absolute;top:2px;left:2px;block-size:100%;inline-size:100%}.opacity-checkerboard{background:repeating-conic-gradient(var(--luzmo-color-loupe-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-color-loupe-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-color-loupe-checkerboard-position, left top)/calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2) calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2)}';var ha=Object.defineProperty,ut=(r,o,e,t)=>{for(var a=void 0,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=s(o,e,a)||a);return a&&ha(o,e,a),a};const ht=class extends d.It{constructor(){super(...arguments),this.open=!1,this.color="rgba(255, 0, 0, 0.5)"}render(){return d.Rt`
|
37
37
|
<div class="opacity-checkerboard loupe-clipped"></div>
|
38
38
|
<div class="luzmo-color-loupe-inner-border loupe-clipped"></div>
|
39
39
|
<div class="luzmo-color-loupe-outer-border loupe-clipped"></div>
|
@@ -71,7 +71,7 @@
|
|
71
71
|
</g>
|
72
72
|
</g>
|
73
73
|
</svg>
|
74
|
-
`}};
|
74
|
+
`}};ht.styles=d.at(ua);let dt=ht;ut([d.zt({type:Boolean,reflect:!0})],dt.prototype,"open");ut([d.zt({type:String})],dt.prototype,"color");/*! * Lucero - The design system for Luzmo.
|
75
75
|
*
|
76
76
|
* Copyright © 2025 Luzmo
|
77
77
|
* All rights reserved.
|
@@ -87,13 +87,13 @@
|
|
87
87
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
88
88
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
89
89
|
* SOFTWARE.
|
90
|
-
* */const
|
90
|
+
* */const da=()=>{if(typeof document<"u"&&!document.querySelector("style[data-luzmo-vars]")){const r=document.createElement("style");r.setAttribute("data-luzmo-vars",""),r.textContent='html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}',document.head.appendChild(r)}};da();const ma=':host{touch-action:none;transition:inline-size var(--luzmo-color-handle-animation-duration, .13s) var(--luzmo-color-handle-animation-easing, ease-in-out),block-size var(--luzmo-color-handle-animation-duration, .13s) var(--luzmo-color-handle-animation-easing, ease-in-out),border-width var(--luzmo-color-handle-animation-duration, .13s) var(--luzmo-color-handle-animation-easing, ease-in-out),margin-inline var(--luzmo-color-handle-animation-duration, .13s) var(--luzmo-color-handle-animation-easing, ease-in-out),margin-block var(--luzmo-color-handle-animation-duration, .13s) var(--luzmo-color-handle-animation-easing, ease-in-out)}:host{background:repeating-conic-gradient(var(--luzmo-color-loupe-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-color-loupe-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-color-loupe-checkerboard-position, left top)/calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2) calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2);background-position:50%}:host(:focus){outline:none}:host{z-index:1;box-sizing:border-box;inline-size:var(--luzmo-color-handle-size, 16px);block-size:var(--luzmo-color-handle-size, 16px);margin-inline:calc(var(--luzmo-color-handle-size, 16px) / 2 * -1);margin-block:calc(var(--luzmo-color-handle-size, 16px) / 2 * -1);border-width:var(--luzmo-color-handle-border-width, 2px);border-color:var(--luzmo-color-handle-border-color, rgb(255, 255, 255));box-shadow:0 0 0 var(--luzmo-color-handle-outer-border-width, 1px) var(--luzmo-color-handle-outer-border-color, rgba(0, 0, 0, .42));transition:all var(--luzmo-color-handle-animation-duration, 0) var(--luzmo-color-handle-animation-easing, ease-in-out);border-style:solid}:host,:host:after{border-radius:100%;display:block;position:absolute}:host:after{content:"";inset-inline:calc(50% - var(--luzmo-color-handle-hitarea-size, 24px) / 2);inset-block:calc(50% - var(--luzmo-color-handle-hitarea-size, 24px) / 2);inline-size:var(--luzmo-color-handle-hitarea-size, 24px);block-size:var(--luzmo-color-handle-hitarea-size, 24px);border-radius:var(--luzmo-color-handle-hitarea-border-radius, 100%)}:host([focused]),:host(:focus-visible){inline-size:var(--luzmo-color-handle-focused-size, 32px);block-size:var(--luzmo-color-handle-focused-size, 32px);margin-inline:calc(var(--luzmo-color-handle-size, 16px) * -1);margin-block:calc(var(--luzmo-color-handle-size, 16px) * -1);outline:none}:host([disabled]){pointer-events:none;border-color:var(--highcontrast-color-handle-border-color-disabled, var(--luzmo-color-handle-border-color-disabled, var(--luzmo-font-color-disabled)));background:var(--highcontrast-color-handle-fill-color-disabled, var(--luzmo-color-handle-fill-color-disabled, var(--luzmo-font-color-disabled)));box-shadow:none}:host([disabled]) .inner{display:none}.inner{inline-size:100%;block-size:100%;box-shadow:inset 0 0 0 var(--luzmo-color-handle-inner-border-width, var(--luzmo-border-width)) var(--luzmo-color-handle-inner-border-color, rgba(0, 0, 0, .42));background-color:var(--luzmo-picked-color);border-radius:100%}@media (forced-colors: active){:host{forced-color-adjust:none}:host([disabled]){--highcontrast-color-handle-border-color-disabled: GrayText;--highcontrast-color-handle-fill-color-disabled: Canvas}}';var pa=Object.defineProperty,se=(r,o,e,t)=>{for(var a=void 0,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=s(o,e,a)||a);return a&&pa(o,e,a),a};const mt=class extends d.It{constructor(){super(...arguments),this.disabled=!1,this.focused=!1,this.open=!1,this.color="rgba(255, 0, 0, 0.5)"}handlePointerdown(o){o.pointerType==="touch"&&(this.open=!0),this.setPointerCapture(o.pointerId)}handlePointerup(o){this.open=!1,this.releasePointerCapture(o.pointerId)}render(){return d.Rt`
|
91
91
|
<div class="inner" style="background-color: ${this.color}"></div>
|
92
92
|
<luzmo-color-loupe
|
93
93
|
color=${this.color}
|
94
94
|
?open=${this.open&&!this.disabled}
|
95
95
|
></luzmo-color-loupe>
|
96
|
-
`}firstUpdated(o){super.firstUpdated(o),this.addEventListener("pointerdown",this.handlePointerdown),this.addEventListener("pointerup",this.handlePointerup),this.addEventListener("pointercancel",this.handlePointerup)}};
|
96
|
+
`}firstUpdated(o){super.firstUpdated(o),this.addEventListener("pointerdown",this.handlePointerdown),this.addEventListener("pointerup",this.handlePointerup),this.addEventListener("pointercancel",this.handlePointerup)}};mt.styles=d.at(ma);let Eo=mt;se([d.zt({type:Boolean,reflect:!0})],Eo.prototype,"disabled");se([d.zt({type:Boolean,reflect:!0})],Eo.prototype,"focused");se([d.zt({type:Boolean,reflect:!0})],Eo.prototype,"open");se([d.zt({type:String})],Eo.prototype,"color");customElements.get("luzmo-color-handle")||customElements.define("luzmo-color-handle",Eo);const ga=Object.freeze(Object.defineProperty({__proto__:null,LuzmoColorHandle:Eo},Symbol.toStringTag,{value:"Module"}));/*! * Lucero - The design system for Luzmo.
|
97
97
|
*
|
98
98
|
* Copyright © 2025 Luzmo
|
99
99
|
* All rights reserved.
|
@@ -109,7 +109,7 @@
|
|
109
109
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
110
110
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
111
111
|
* SOFTWARE.
|
112
|
-
* */var ga=Object.defineProperty,fa=(r,o,e)=>o in r?ga(r,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[o]=e,Je=(r,o,e)=>fa(r,typeof o!="symbol"?o+"":o,e);function $(r,o){let e=r.length;Array.isArray(r[0])||(r=[r]),Array.isArray(o[0])||(o=o.map(s=>[s]));let t=o[0].length,a=o[0].map((s,n)=>o.map(i=>i[n])),l=r.map(s=>a.map(n=>{let i=0;if(!Array.isArray(s)){for(let c of n)i+=s*c;return i}for(let c=0;c<s.length;c++)i+=s[c]*(n[c]||0);return i}));return e===1&&(l=l[0]),t===1?l.map(s=>s[0]):l}function Fo(r){return co(r)==="string"}function co(r){return(Object.prototype.toString.call(r).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function re(r,{precision:o,unit:e}){return uo(r)?"none":mt(r,o)+(e??"")}function uo(r){return Number.isNaN(r)||r instanceof Number&&(r==null?void 0:r.none)}function R(r){return uo(r)?0:r}function mt(r,o){if(r===0)return 0;let e=~~r,t=0;e&&o&&(t=~~Math.log10(Math.abs(e))+1);const a=10**(o-t);return Math.floor(r*a+.5)/a}const ba={deg:1,grad:.9,rad:180/Math.PI,turn:360};function pt(r){if(!r)return;r=r.trim();const o=/^([a-z]+)\((.+?)\)$/i,e=/^-?[\d.]+$/,t=/%|deg|g?rad|turn$/,a=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g;let l=r.match(o);if(l){let s=[];return l[2].replace(a,(n,i)=>{let c=i.match(t),u=i;if(c){let h=c[0],m=u.slice(0,-h.length);h==="%"?(u=new Number(m/100),u.type="<percentage>"):(u=new Number(m*ba[h]),u.type="<angle>",u.unit=h)}else e.test(u)?(u=new Number(u),u.type="<number>"):u==="none"&&(u=new Number(NaN),u.none=!0);n.startsWith("/")&&(u=u instanceof Number?u:new Number(u),u.alpha=!0),typeof u=="object"&&u instanceof Number&&(u.raw=i),s.push(u)}),{name:l[1].toLowerCase(),rawName:l[1],rawArgs:l[2],args:s}}}function gt(r){return r[r.length-1]}function Bo(r,o,e){return isNaN(r)?o:isNaN(o)?r:r+(o-r)*e}function ft(r,o,e){return(e-r)/(o-r)}function Ie(r,o,e){return Bo(o[0],o[1],ft(r[0],r[1],e))}function bt(r){return r.map(o=>o.split("|").map(e=>{e=e.trim();let t=e.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(t){let a=new String(t[1]);return a.range=[+t[2],+t[3]],a}return e}))}function zt(r,o,e){return Math.max(Math.min(e,o),r)}function ne(r,o){return Math.sign(r)===Math.sign(o)?r:-r}function ro(r,o){return ne(Math.abs(r)**o,r)}function Oe(r,o){return o===0?0:r/o}function vt(r,o,e=0,t=r.length){for(;e<t;){const a=e+t>>1;r[a]<o?e=a+1:t=a}return e}var za=Object.freeze({__proto__:null,bisectLeft:vt,clamp:zt,copySign:ne,interpolate:Bo,interpolateInv:ft,isNone:uo,isString:Fo,last:gt,mapRange:Ie,multiplyMatrices:$,parseCoordGrammar:bt,parseFunction:pt,serializeNumber:re,skipNone:R,spow:ro,toPrecision:mt,type:co,zdiv:Oe});class va{add(o,e,t){if(typeof arguments[0]!="string"){for(var o in arguments[0])this.add(o,arguments[0][o],arguments[1]);return}(Array.isArray(o)?o:[o]).forEach(function(a){this[a]=this[a]||[],e&&this[a][t?"unshift":"push"](e)},this)}run(o,e){this[o]=this[o]||[],this[o].forEach(function(t){t.call(e&&e.context?e.context:e,e)})}}const ho=new va;var Qe,or,er,G={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((er=(or=(Qe=globalThis==null?void 0:globalThis.process)==null?void 0:Qe.env)==null?void 0:or.NODE_ENV)==null?void 0:er.toLowerCase())!=="test",warn:function(r){var o,e;this.verbose&&((e=(o=globalThis==null?void 0:globalThis.console)==null?void 0:o.warn)==null||e.call(o,r))}};const D={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function ke(r){return Array.isArray(r)?r:D[r]}function te(r,o,e,t={}){if(r=ke(r),o=ke(o),!r||!o)throw new TypeError(`Missing white point to convert ${r?"":"from"}${!r&&!o?"/":""}${o?"":"to"}`);if(r===o)return e;let a={W1:r,W2:o,XYZ:e,options:t};if(ho.run("chromatic-adaptation-start",a),a.M||(a.W1===D.D65&&a.W2===D.D50?a.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:a.W1===D.D50&&a.W2===D.D65&&(a.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),ho.run("chromatic-adaptation-end",a),a.M)return $(a.M,a.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const wa=new Set(["<number>","<percentage>","<angle>"]);function rr(r,o,e,t){return Object.entries(r.coords).map(([a,l],s)=>{let n=o.coordGrammar[s],i=t[s],c=i==null?void 0:i.type,u;if(i.none?u=n.find(f=>wa.has(f)):u=n.find(f=>f==c),!u){let f=l.name||a;throw new TypeError(`${c??i.raw} not allowed for ${f} in ${e}()`)}let h=u.range;c==="<percentage>"&&(h||(h=[0,1]));let m=l.range||l.refRange;return h&&m&&(t[s]=Ie(h,m,t[s])),u})}function wt(r,{meta:o}={}){var e,t,a,l;let s={str:(e=String(r))==null?void 0:e.trim()};if(ho.run("parse-start",s),s.color)return s.color;if(s.parsed=pt(s.str),s.parsed){let n=s.parsed.name;if(n==="color"){let i=s.parsed.args.shift(),c=i.startsWith("--")?i.substring(2):`--${i}`,u=[i,c],h=s.parsed.rawArgs.indexOf("/")>0?s.parsed.args.pop():1;for(let b of g.all){let p=b.getFormat("color");if(p&&(u.includes(p.id)||(t=p.ids)!=null&&t.filter(z=>u.includes(z)).length)){const z=Object.keys(b.coords).map((y,C)=>s.parsed.args[C]||0);let w;return p.coordGrammar&&(w=rr(b,p,"color",z)),o&&Object.assign(o,{formatId:"color",types:w}),p.id.startsWith("--")&&!i.startsWith("--")&&G.warn(`${b.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${p.id}) instead of color(${i}).`),i.startsWith("--")&&!p.id.startsWith("--")&&G.warn(`${b.name} is a standard space and supported in the CSS spec. Use color(${p.id}) instead of prefixed color(${i}).`),{spaceId:b.id,coords:z,alpha:h}}}let m="",f=i in g.registry?i:c;if(f in g.registry){let b=(l=(a=g.registry[f].formats)==null?void 0:a.color)==null?void 0:l.id;b&&(m=`Did you mean color(${b})?`)}throw new TypeError(`Cannot parse color(${i}). `+(m||"Missing a plugin?"))}else for(let i of g.all){let c=i.getFormat(n);if(c&&c.type==="function"){let u=1;(c.lastAlpha||gt(s.parsed.args).alpha)&&(u=s.parsed.args.pop());let h=s.parsed.args,m;return c.coordGrammar&&(m=rr(i,c,n,h)),o&&Object.assign(o,{formatId:c.name,types:m}),{spaceId:i.id,coords:h,alpha:u}}}}else for(let n of g.all)for(let i in n.formats){let c=n.formats[i];if(c.type!=="custom"||c.test&&!c.test(s.str))continue;let u=c.parse(s.str);if(u)return u.alpha??(u.alpha=1),o&&(o.formatId=i),u}throw new TypeError(`Could not parse ${r} as a color. Missing a plugin?`)}function v(r){if(Array.isArray(r))return r.map(v);if(!r)throw new TypeError("Empty color reference");Fo(r)&&(r=wt(r));let o=r.space||r.spaceId;return o instanceof g||(r.space=g.get(o)),r.alpha===void 0&&(r.alpha=1),r}const ya=75e-6,Me=class Q{constructor(o){var e;this.id=o.id,this.name=o.name,this.base=o.base?Q.get(o.base):null,this.aliases=o.aliases,this.base&&(this.fromBase=o.fromBase,this.toBase=o.toBase);let t=o.coords??this.base.coords;for(let l in t)"name"in t[l]||(t[l].name=l);this.coords=t;let a=o.white??this.base.white??"D65";this.white=ke(a),this.formats=o.formats??{};for(let l in this.formats){let s=this.formats[l];s.type||(s.type="function"),s.name||(s.name=l)}(e=this.formats.color)!=null&&e.id||(this.formats.color={...this.formats.color??{},id:o.cssId||this.id}),o.gamutSpace?this.gamutSpace=o.gamutSpace==="self"?this:Q.get(o.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(l,s)=>!0),this.referred=o.referred,Object.defineProperty(this,"path",{value:xa(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),ho.run("colorspace-init-end",this)}inGamut(o,{epsilon:e=ya}={}){if(!this.equals(this.gamutSpace))return o=this.to(this.gamutSpace,o),this.gamutSpace.inGamut(o,{epsilon:e});let t=Object.values(this.coords);return o.every((a,l)=>{let s=t[l];if(s.type!=="angle"&&s.range){if(Number.isNaN(a))return!0;let[n,i]=s.range;return(n===void 0||a>=n-e)&&(i===void 0||a<=i+e)}return!0})}get isUnbounded(){return Object.values(this.coords).every(o=>!("range"in o))}get cssId(){var o,e;return((e=(o=this.formats)==null?void 0:o.color)==null?void 0:e.id)||this.id}get isPolar(){for(let o in this.coords)if(this.coords[o].type==="angle")return!0;return!1}getFormat(o){if(typeof o=="object")return o=tr(o,this),o;let e;return o==="default"?e=Object.values(this.formats)[0]:e=this.formats[o],e?(e=tr(e,this),e):null}equals(o){return o?this===o||this.id===o||this.id===o.id:!1}to(o,e){if(arguments.length===1){const n=v(o);[o,e]=[n.space,n.coords]}if(o=Q.get(o),this.equals(o))return e;e=e.map(n=>Number.isNaN(n)?0:n);let t=this.path,a=o.path,l,s;for(let n=0;n<t.length&&t[n].equals(a[n]);n++)l=t[n],s=n;if(!l)throw new Error(`Cannot convert between color spaces ${this} and ${o}: no connection space was found`);for(let n=t.length-1;n>s;n--)e=t[n].toBase(e);for(let n=s+1;n<a.length;n++)e=a[n].fromBase(e);return e}from(o,e){if(arguments.length===1){const t=v(o);[o,e]=[t.space,t.coords]}return o=Q.get(o),o.to(this,e)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let o=[];for(let e in this.coords){let t=this.coords[e],a=t.range||t.refRange;o.push((a==null?void 0:a.min)??0)}return o}static get all(){return[...new Set(Object.values(Q.registry))]}static register(o,e){if(arguments.length===1&&(e=arguments[0],o=e.id),e=this.get(e),this.registry[o]&&this.registry[o]!==e)throw new Error(`Duplicate color space registration: '${o}'`);if(this.registry[o]=e,arguments.length===1&&e.aliases)for(let t of e.aliases)this.register(t,e);return e}static get(o,...e){if(!o||o instanceof Q)return o;if(co(o)==="string"){let t=Q.registry[o.toLowerCase()];if(!t)throw new TypeError(`No color space found with id = "${o}"`);return t}if(e.length)return Q.get(...e);throw new TypeError(`${o} is not a valid color space`)}static resolveCoord(o,e){var t;let a=co(o),l,s;if(a==="string"?o.includes(".")?[l,s]=o.split("."):[l,s]=[,o]:Array.isArray(o)?[l,s]=o:(l=o.space,s=o.coordId),l=Q.get(l),l||(l=e),!l)throw new TypeError(`Cannot resolve coordinate reference ${o}: No color space specified and relative references are not allowed here`);if(a=co(s),a==="number"||a==="string"&&s>=0){let c=Object.entries(l.coords)[s];if(c)return{space:l,id:c[0],index:s,...c[1]}}l=Q.get(l);let n=s.toLowerCase(),i=0;for(let c in l.coords){let u=l.coords[c];if(c.toLowerCase()===n||((t=u.name)==null?void 0:t.toLowerCase())===n)return{space:l,id:c,index:i,...u};i++}throw new TypeError(`No "${s}" coordinate found in ${l.name}. Its coordinates are: ${Object.keys(l.coords).join(", ")}`)}};Je(Me,"registry",{}),Je(Me,"DEFAULT_FORMAT",{type:"functions",name:"color"});let g=Me;function xa(r){let o=[r];for(let e=r;e=e.base;)o.push(e);return o}function tr(r,{coords:o}={}){if(r.coords&&!r.coordGrammar){r.type||(r.type="function"),r.name||(r.name="color"),r.coordGrammar=bt(r.coords);let e=Object.entries(o).map(([t,a],l)=>{let s=r.coordGrammar[l][0],n=a.range||a.refRange,i=s.range,c="";return s=="<percentage>"?(i=[0,100],c="%"):s=="<angle>"&&(c="deg"),{fromRange:n,toRange:i,suffix:c}});r.serializeCoords=(t,a)=>t.map((l,s)=>{let{fromRange:n,toRange:i,suffix:c}=e[s];return n&&i&&(l=Ie(n,i,l)),l=re(l,{precision:a,unit:c}),l})}return r}var B=new g({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});let T=class extends g{constructor(o){o.coords||(o.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),o.base||(o.base=B),o.toXYZ_M&&o.fromXYZ_M&&(o.toBase??(o.toBase=e=>{let t=$(o.toXYZ_M,e);return this.white!==this.base.white&&(t=te(this.white,this.base.white,t)),t}),o.fromBase??(o.fromBase=e=>(e=te(this.base.white,this.white,e),$(o.fromXYZ_M,e)))),o.referred??(o.referred="display"),super(o)}};function Lo(r,o){return r=v(r),!o||r.space.equals(o)?r.coords.slice():(o=g.get(o),o.from(r))}function X(r,o){r=v(r);let{space:e,index:t}=g.resolveCoord(o,r.space);return Lo(r,e)[t]}function Fe(r,o,e){return r=v(r),o=g.get(o),r.coords=o.to(r.space,e),r}Fe.returns="color";function so(r,o,e){if(r=v(r),arguments.length===2&&co(arguments[1])==="object"){let t=arguments[1];for(let a in t)so(r,a,t[a])}else{typeof e=="function"&&(e=e(X(r,o)));let{space:t,index:a}=g.resolveCoord(o,r.space),l=Lo(r,t);l[a]=e,Fe(r,t,l)}return r}so.returns="color";var Le=new g({id:"xyz-d50",name:"XYZ D50",white:"D50",base:B,fromBase:r=>te(B.white,"D50",r),toBase:r=>te("D50",B.white,r)});const Ca=216/24389,ar=24/116,To=24389/27;let de=D.D50;var Y=new g({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:de,base:Le,fromBase(r){let o=r.map((e,t)=>e/de[t]).map(e=>e>Ca?Math.cbrt(e):(To*e+16)/116);return[116*o[1]-16,500*(o[0]-o[1]),200*(o[1]-o[2])]},toBase(r){let o=[];return o[1]=(r[0]+16)/116,o[0]=r[1]/500+o[1],o[2]=o[1]-r[2]/200,[o[0]>ar?Math.pow(o[0],3):(116*o[0]-16)/To,r[0]>8?Math.pow((r[0]+16)/116,3):r[0]/To,o[2]>ar?Math.pow(o[2],3):(116*o[2]-16)/To].map((e,t)=>e*de[t])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function to(r){return(r%360+360)%360}function ka(r,o){if(r==="raw")return o;let[e,t]=o.map(to),a=t-e;return r==="increasing"?a<0&&(t+=360):r==="decreasing"?a>0&&(e+=360):r==="longer"?-180<a&&a<180&&(a>0?e+=360:t+=360):r==="shorter"&&(a>180?e+=360:a<-180&&(t+=360)),[e,t]}var Io=new g({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Y,fromBase(r){let[o,e,t]=r,a;const l=.02;return Math.abs(e)<l&&Math.abs(t)<l?a=NaN:a=Math.atan2(t,e)*180/Math.PI,[o,Math.sqrt(e**2+t**2),to(a)]},toBase(r){let[o,e,t]=r;return e<0&&(e=0),isNaN(t)&&(t=0),[o,e*Math.cos(t*Math.PI/180),e*Math.sin(t*Math.PI/180)]},formats:{lch:{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}});const lr=25**7,ae=Math.PI,sr=180/ae,wo=ae/180;function nr(r){const o=r*r;return o*o*o*r}function yt(r,o,{kL:e=1,kC:t=1,kH:a=1}={}){[r,o]=v([r,o]);let[l,s,n]=Y.from(r),i=Io.from(Y,[l,s,n])[1],[c,u,h]=Y.from(o),m=Io.from(Y,[c,u,h])[1];i<0&&(i=0),m<0&&(m=0);let f=(i+m)/2,b=nr(f),p=.5*(1-Math.sqrt(b/(b+lr))),z=(1+p)*s,w=(1+p)*u,y=Math.sqrt(z**2+n**2),C=Math.sqrt(w**2+h**2),x=z===0&&n===0?0:Math.atan2(n,z),k=w===0&&h===0?0:Math.atan2(h,w);x<0&&(x+=2*ae),k<0&&(k+=2*ae),x*=sr,k*=sr;let S=c-l,F=C-y,E=k-x,Ao=x+k,We=Math.abs(E),Ro;y*C===0?Ro=0:We<=180?Ro=E:E>180?Ro=E-360:E<-180?Ro=E+360:G.warn("the unthinkable has happened");let Ue=2*Math.sqrt(C*y)*Math.sin(Ro*wo/2),ea=(l+c)/2,he=(y+C)/2,Xe=nr(he),lo;y*C===0?lo=Ao:We<=180?lo=Ao/2:Ao<360?lo=(Ao+360)/2:lo=(Ao-360)/2;let Ye=(ea-50)**2,ra=1+.015*Ye/Math.sqrt(20+Ye),Ge=1+.045*he,Po=1;Po-=.17*Math.cos((lo-30)*wo),Po+=.24*Math.cos(2*lo*wo),Po+=.32*Math.cos((3*lo+6)*wo),Po-=.2*Math.cos((4*lo-63)*wo);let Ze=1+.015*he*Po,ta=30*Math.exp(-1*((lo-275)/25)**2),aa=2*Math.sqrt(Xe/(Xe+lr)),la=-1*Math.sin(2*ta*wo)*aa,jo=(S/(e*ra))**2;return jo+=(F/(t*Ge))**2,jo+=(Ue/(a*Ze))**2,jo+=la*(F/(t*Ge))*(Ue/(a*Ze)),Math.sqrt(jo)}const Ma=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],$a=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],Sa=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],_a=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]];var Mo=new g({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:B,fromBase(r){let o=$(Ma,r).map(e=>Math.cbrt(e));return $(Sa,o)},toBase(r){let o=$(_a,r).map(e=>e**3);return $($a,o)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function $e(r,o){[r,o]=v([r,o]);let[e,t,a]=Mo.from(r),[l,s,n]=Mo.from(o),i=e-l,c=t-s,u=a-n;return Math.sqrt(i**2+c**2+u**2)}const Ea=75e-6;function zo(r,o,{epsilon:e=Ea}={}){r=v(r),o||(o=r.space),o=g.get(o);let t=r.coords;return o!==r.space&&(t=o.from(r)),o.inGamut(t,{epsilon:e})}function $o(r){return{space:r.space,coords:r.coords.slice(),alpha:r.alpha}}function xt(r,o,e="lab"){e=g.get(e);let t=e.from(r),a=e.from(o);return Math.sqrt(t.reduce((l,s,n)=>{let i=a[n];return isNaN(s)||isNaN(i)?l:l+(i-s)**2},0))}function Aa(r,o){return xt(r,o,"lab")}const Ra=Math.PI,ir=Ra/180;function Pa(r,o,{l:e=2,c:t=1}={}){[r,o]=v([r,o]);let[a,l,s]=Y.from(r),[,n,i]=Io.from(Y,[a,l,s]),[c,u,h]=Y.from(o),m=Io.from(Y,[c,u,h])[1];n<0&&(n=0),m<0&&(m=0);let f=a-c,b=n-m,p=l-u,z=s-h,w=p**2+z**2-b**2,y=.511;a>=16&&(y=.040975*a/(1+.01765*a));let C=.0638*n/(1+.0131*n)+.638,x;Number.isNaN(i)&&(i=0),i>=164&&i<=345?x=.56+Math.abs(.2*Math.cos((i+168)*ir)):x=.36+Math.abs(.4*Math.cos((i+35)*ir));let k=Math.pow(n,4),S=Math.sqrt(k/(k+1900)),F=C*(S*x+1-S),E=(f/(e*y))**2;return E+=(b/(t*C))**2,E+=w/F**2,Math.sqrt(E)}const cr=203;var De=new g({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:B,fromBase(r){return r.map(o=>Math.max(o*cr,0))},toBase(r){return r.map(o=>Math.max(o/cr,0))}});const qo=1.15,Wo=.66,ur=2610/2**14,Ha=2**14/2610,hr=3424/2**12,dr=2413/2**7,mr=2392/2**7,Na=1.7*2523/2**5,pr=2**5/(1.7*2523),Uo=-.56,me=16295499532821565e-27,Ba=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],Ia=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Oa=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],Fa=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]];var Ct=new g({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:De,fromBase(r){let[o,e,t]=r,a=qo*o-(qo-1)*t,l=Wo*e-(Wo-1)*o,s=$(Ba,[a,l,t]).map(function(u){let h=hr+dr*(u/1e4)**ur,m=1+mr*(u/1e4)**ur;return(h/m)**Na}),[n,i,c]=$(Oa,s);return[(1+Uo)*n/(1+Uo*n)-me,i,c]},toBase(r){let[o,e,t]=r,a=(o+me)/(1+Uo-Uo*(o+me)),l=$(Fa,[a,e,t]).map(function(h){let m=hr-h**pr,f=mr*h**pr-dr;return 1e4*(m/f)**Ha}),[s,n,i]=$(Ia,l),c=(s+(qo-1)*i)/qo,u=(n+(Wo-1)*c)/Wo;return[c,u,i]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),Se=new g({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:Ct,fromBase(r){let[o,e,t]=r,a;const l=2e-4;return Math.abs(e)<l&&Math.abs(t)<l?a=NaN:a=Math.atan2(t,e)*180/Math.PI,[o,Math.sqrt(e**2+t**2),to(a)]},toBase(r){return[r[0],r[1]*Math.cos(r[2]*Math.PI/180),r[1]*Math.sin(r[2]*Math.PI/180)]}});function La(r,o){[r,o]=v([r,o]);let[e,t,a]=Se.from(r),[l,s,n]=Se.from(o),i=e-l,c=t-s;Number.isNaN(a)&&Number.isNaN(n)?(a=0,n=0):Number.isNaN(a)?a=n:Number.isNaN(n)&&(n=a);let u=a-n,h=2*Math.sqrt(t*s)*Math.sin(u/2*(Math.PI/180));return Math.sqrt(i**2+c**2+h**2)}const kt=3424/4096,Mt=2413/128,$t=2392/128,gr=2610/16384,Da=2523/32,ja=16384/2610,fr=32/2523,Ta=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],qa=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],Wa=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],Ua=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]];var _e=new g({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:De,fromBase(r){let o=$(Ta,r);return Xa(o)},toBase(r){let o=Ya(r);return $(Ua,o)}});function Xa(r){let o=r.map(function(e){let t=kt+Mt*(e/1e4)**gr,a=1+$t*(e/1e4)**gr;return(t/a)**Da});return $(qa,o)}function Ya(r){return $(Wa,r).map(function(o){let e=Math.max(o**fr-kt,0),t=Mt-$t*o**fr;return 1e4*(e/t)**ja})}function Ga(r,o){[r,o]=v([r,o]);let[e,t,a]=_e.from(r),[l,s,n]=_e.from(o);return 720*Math.sqrt((e-l)**2+.25*(t-s)**2+(a-n)**2)}const Za=D.D65,St=.42,br=1/St,pe=2*Math.PI,_t=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],Ka=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],Va=[[460,451,288],[460,-891,-261],[460,-220,-6300]],Ja={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},fo={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},Qa=180/Math.PI,zr=Math.PI/180;function Et(r,o){return r.map(e=>{const t=ro(o*Math.abs(e)*.01,St);return 400*ne(t,e)/(t+27.13)})}function ol(r,o){const e=100/o*27.13**br;return r.map(t=>{const a=Math.abs(t);return ne(e*ro(a/(400-a),br),t)})}function el(r){let o=to(r);o<=fo.h[0]&&(o+=360);const e=vt(fo.h,o)-1,[t,a]=fo.h.slice(e,e+2),[l,s]=fo.e.slice(e,e+2),n=fo.H[e],i=(o-t)/l;return n+100*i/(i+(a-o)/s)}function rl(r){let o=(r%400+400)%400;const e=Math.floor(.01*o);o=o%100;const[t,a]=fo.h.slice(e,e+2),[l,s]=fo.e.slice(e,e+2);return to((o*(s*t-l*a)-100*t*s)/(o*(s-l)-100*s))}function At(r,o,e,t,a){const l={};l.discounting=a,l.refWhite=r,l.surround=t;const s=r.map(b=>b*100);l.la=o,l.yb=e;const n=s[1],i=$(_t,s);t=Ja[l.surround];const c=t[0];l.c=t[1],l.nc=t[2];const u=(1/(5*l.la+1))**4;l.fl=u*l.la+.1*(1-u)*(1-u)*Math.cbrt(5*l.la),l.flRoot=l.fl**.25,l.n=l.yb/n,l.z=1.48+Math.sqrt(l.n),l.nbb=.725*l.n**-.2,l.ncb=l.nbb;const h=Math.max(Math.min(c*(1-1/3.6*Math.exp((-l.la-42)/92)),1),0);l.dRgb=i.map(b=>Bo(1,n/b,h)),l.dRgbInv=l.dRgb.map(b=>1/b);const m=i.map((b,p)=>b*l.dRgb[p]),f=Et(m,l.fl);return l.aW=l.nbb*(2*f[0]+f[1]+.05*f[2]),l}const vr=At(Za,64/Math.PI*.2,20,"average",!1);function Ee(r,o){if(!(r.J!==void 0^r.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(r.C!==void 0^r.M!==void 0^r.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(r.h!==void 0^r.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(r.J===0||r.Q===0)return[0,0,0];let e=0;r.h!==void 0?e=to(r.h)*zr:e=rl(r.H)*zr;const t=Math.cos(e),a=Math.sin(e);let l=0;r.J!==void 0?l=ro(r.J,1/2)*.1:r.Q!==void 0&&(l=.25*o.c*r.Q/((o.aW+4)*o.flRoot));let s=0;r.C!==void 0?s=r.C/l:r.M!==void 0?s=r.M/o.flRoot/l:r.s!==void 0&&(s=4e-4*r.s**2*(o.aW+4)/o.c);const n=ro(s*Math.pow(1.64-Math.pow(.29,o.n),-.73),10/9),i=.25*(Math.cos(e+2)+3.8),c=o.aW*ro(l,2/o.c/o.z),u=5e4/13*o.nc*o.ncb*i,h=c/o.nbb,m=23*(h+.305)*Oe(n,23*u+n*(11*t+108*a)),f=m*t,b=m*a,p=ol($(Va,[h,f,b]).map(z=>z*1/1403),o.fl);return $(Ka,p.map((z,w)=>z*o.dRgbInv[w])).map(z=>z/100)}function Rt(r,o){const e=r.map(C=>C*100),t=Et($(_t,e).map((C,x)=>C*o.dRgb[x]),o.fl),a=t[0]+(-12*t[1]+t[2])/11,l=(t[0]+t[1]-2*t[2])/9,s=(Math.atan2(l,a)%pe+pe)%pe,n=.25*(Math.cos(s+2)+3.8),i=5e4/13*o.nc*o.ncb*Oe(n*Math.sqrt(a**2+l**2),t[0]+t[1]+1.05*t[2]+.305),c=ro(i,.9)*Math.pow(1.64-Math.pow(.29,o.n),.73),u=o.nbb*(2*t[0]+t[1]+.05*t[2]),h=ro(u/o.aW,.5*o.c*o.z),m=100*ro(h,2),f=4/o.c*h*(o.aW+4)*o.flRoot,b=c*h,p=b*o.flRoot,z=to(s*Qa),w=el(z),y=50*ro(o.c*c/(o.aW+4),1/2);return{J:m,C:b,h:z,s:y,Q:f,M:p,H:w}}var tl=new g({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:B,fromBase(r){const o=Rt(r,vr);return[o.J,o.M,o.h]},toBase(r){return Ee({J:r[0],M:r[1],h:r[2]},vr)}});const al=D.D65,ll=216/24389,Pt=24389/27;function sl(r){return 116*(r>ll?Math.cbrt(r):(Pt*r+16)/116)-16}function Ae(r){return r>8?Math.pow((r+16)/116,3):r/Pt}function nl(r,o){let[e,t,a]=r,l=[],s=0;if(a===0)return[0,0,0];let n=Ae(a);a>0?s=.00379058511492914*a**2+.608983189401032*a+.9155088574762233:s=9514440756550361e-21*a**2+.08693057439788597*a-21.928975842194614;const i=2e-12,c=15;let u=0,h=1/0;for(;u<=c;){l=Ee({J:s,C:t,h:e},o);const m=Math.abs(l[1]-n);if(m<h){if(m<=i)return l;h=m}s=s-(l[1]-n)*s/(2*l[1]),u+=1}return Ee({J:s,C:t,h:e},o)}function il(r,o){const e=sl(r[1]);if(e===0)return[0,0,0];const t=Rt(r,je);return[to(t.h),t.C,e]}const je=At(al,200/Math.PI*Ae(50),Ae(50)*100,"average",!1);var Oo=new g({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:B,fromBase(r){return il(r)},toBase(r){return nl(r,je)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});const cl=Math.PI/180,wr=[1,.007,.0228];function yr(r){r[1]<0&&(r=Oo.fromBase(Oo.toBase(r)));const o=Math.log(Math.max(1+wr[2]*r[1]*je.flRoot,1))/wr[2],e=r[0]*cl,t=o*Math.cos(e),a=o*Math.sin(e);return[r[2],t,a]}function ul(r,o){[r,o]=v([r,o]);let[e,t,a]=yr(Oo.from(r)),[l,s,n]=yr(Oo.from(o));return Math.sqrt((e-l)**2+(t-s)**2+(a-n)**2)}var So={deltaE76:Aa,deltaECMC:Pa,deltaE2000:yt,deltaEJz:La,deltaEITP:Ga,deltaEOK:$e,deltaEHCT:ul};function hl(r){const o=r?Math.floor(Math.log10(Math.abs(r))):0;return Math.max(parseFloat(`1e${o-2}`),1e-6)}const xr={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function mo(r,{method:o=G.gamut_mapping,space:e=void 0,deltaEMethod:t="",jnd:a=2,blackWhiteClamp:l={}}={}){if(r=v(r),Fo(arguments[1])?e=arguments[1]:e||(e=r.space),e=g.get(e),zo(r,e,{epsilon:0}))return r;let s;if(o==="css")s=dl(r,{space:e});else{if(o!=="clip"&&!zo(r,e)){Object.prototype.hasOwnProperty.call(xr,o)&&({method:o,jnd:a,deltaEMethod:t,blackWhiteClamp:l}=xr[o]);let n=yt;if(t!==""){for(let c in So)if("deltae"+t.toLowerCase()===c.toLowerCase()){n=So[c];break}}let i=mo(M(r,e),{method:"clip",space:e});if(n(r,i)>a){if(Object.keys(l).length===3){let w=g.resolveCoord(l.channel),y=X(M(r,w.space),w.id);if(uo(y)&&(y=0),y>=l.max)return M({space:"xyz-d65",coords:D.D65},r.space);if(y<=l.min)return M({space:"xyz-d65",coords:[0,0,0]},r.space)}let c=g.resolveCoord(o),u=c.space,h=c.id,m=M(r,u);m.coords.forEach((w,y)=>{uo(w)&&(m.coords[y]=0)});let f=(c.range||c.refRange)[0],b=hl(a),p=f,z=X(m,h);for(;z-p>b;){let w=$o(m);w=mo(w,{space:e,method:"clip"}),n(m,w)-a<b?p=X(m,h):z=X(m,h),so(m,h,(p+z)/2)}s=M(m,e)}else s=i}else s=M(r,e);if(o==="clip"||!zo(s,e,{epsilon:0})){let n=Object.values(e.coords).map(i=>i.range||[]);s.coords=s.coords.map((i,c)=>{let[u,h]=n[c];return u!==void 0&&(i=Math.max(u,i)),h!==void 0&&(i=Math.min(i,h)),i})}}return e!==r.space&&(s=M(s,r.space)),r.coords=s.coords,r}mo.returns="color";const Cr={WHITE:{space:Mo,coords:[1,0,0]},BLACK:{space:Mo,coords:[0,0,0]}};function dl(r,{space:o}={}){r=v(r),o||(o=r.space),o=g.get(o);const e=g.get("oklch");if(o.isUnbounded)return M(r,o);const t=M(r,e);let a=t.coords[0];if(a>=1){const m=M(Cr.WHITE,o);return m.alpha=r.alpha,M(m,o)}if(a<=0){const m=M(Cr.BLACK,o);return m.alpha=r.alpha,M(m,o)}if(zo(t,o,{epsilon:0}))return M(t,o);function l(m){const f=M(m,o),b=Object.values(o.coords);return f.coords=f.coords.map((p,z)=>{if("range"in b[z]){const[w,y]=b[z].range;return zt(w,p,y)}return p}),f}let s=0,n=t.coords[1],i=!0,c=$o(t),u=l(c),h=$e(u,c);if(h<.02)return u;for(;n-s>1e-4;){const m=(s+n)/2;if(c.coords[1]=m,i&&zo(c,o,{epsilon:0}))s=m;else if(u=l(c),h=$e(u,c),h<.02){if(.02-h<1e-4)break;i=!1,s=m}else n=m}return u}function M(r,o,{inGamut:e}={}){r=v(r),o=g.get(o);let t=o.from(r),a={space:o,coords:t,alpha:r.alpha};return e&&(a=mo(a,e===!0?void 0:e)),a}M.returns="color";function No(r,{precision:o=G.precision,format:e="default",inGamut:t=!0,...a}={}){var l;let s;r=v(r);let n=e;e=r.space.getFormat(e)??r.space.getFormat("default")??g.DEFAULT_FORMAT;let i=r.coords.slice();if(t||(t=e.toGamut),t&&!zo(r)&&(i=mo($o(r),t===!0?void 0:t).coords),e.type==="custom")if(a.precision=o,e.serialize)s=e.serialize(i,r.alpha,a);else throw new TypeError(`format ${n} can only be used to parse colors, not for serialization`);else{let c=e.name||"color";e.serializeCoords?i=e.serializeCoords(i,o):o!==null&&(i=i.map(f=>re(f,{precision:o})));let u=[...i];if(c==="color"){let f=e.id||((l=e.ids)==null?void 0:l[0])||r.space.id;u.unshift(f)}let h=r.alpha;o!==null&&(h=re(h,{precision:o}));let m=r.alpha>=1||e.noAlpha?"":`${e.commas?",":" /"} ${h}`;s=`${c}(${u.join(e.commas?", ":" ")}${m})`}return s}const ml=[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],pl=[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]];var ie=new T({id:"rec2020-linear",cssId:"--rec2020-linear",name:"Linear REC.2020",white:"D65",toXYZ_M:ml,fromXYZ_M:pl});const Xo=1.09929682680944,kr=.018053968510807;var Ht=new T({id:"rec2020",name:"REC.2020",base:ie,toBase(r){return r.map(function(o){return o<kr*4.5?o/4.5:Math.pow((o+Xo-1)/Xo,1/.45)})},fromBase(r){return r.map(function(o){return o>=kr?Xo*Math.pow(o,.45)-(Xo-1):4.5*o})}});const gl=[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],fl=[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]];var Nt=new T({id:"p3-linear",cssId:"--display-p3-linear",name:"Linear P3",white:"D65",toXYZ_M:gl,fromXYZ_M:fl});const bl=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],H=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]];var Bt=new T({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:bl,fromXYZ_M:H}),Mr={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let $r=Array(3).fill("<percentage> | <number>[0, 255]"),Sr=Array(3).fill("<number>[0, 255]");var _o=new T({id:"srgb",name:"sRGB",base:Bt,fromBase:r=>r.map(o=>{let e=o<0?-1:1,t=o*e;return t>.0031308?e*(1.055*t**(1/2.4)-.055):12.92*o}),toBase:r=>r.map(o=>{let e=o<0?-1:1,t=o*e;return t<=.04045?o/12.92:e*((t+.055)/1.055)**2.4}),formats:{rgb:{coords:$r},rgb_number:{name:"rgb",commas:!0,coords:Sr,noAlpha:!0},color:{},rgba:{coords:$r,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:Sr},hex:{type:"custom",toGamut:!0,test:r=>/^#([a-f0-9]{3,4}){1,2}$/i.test(r),parse(r){r.length<=5&&(r=r.replace(/[a-f0-9]/gi,"$&$&"));let o=[];return r.replace(/[a-f0-9]{2}/gi,e=>{o.push(parseInt(e,16)/255)}),{spaceId:"srgb",coords:o.slice(0,3),alpha:o.slice(3)[0]}},serialize:(r,o,{collapse:e=!0}={})=>{o<1&&r.push(o),r=r.map(a=>Math.round(a*255));let t=e&&r.every(a=>a%17===0);return"#"+r.map(a=>t?(a/17).toString(16):a.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:r=>/^[a-z]+$/i.test(r),parse(r){r=r.toLowerCase();let o={spaceId:"srgb",coords:null,alpha:1};if(r==="transparent"?(o.coords=Mr.black,o.alpha=0):o.coords=Mr[r],o.coords)return o}}}}),It=new T({id:"p3",cssId:"display-p3",name:"P3",base:Nt,fromBase:_o.fromBase,toBase:_o.toBase});G.display_space=_o;let _r;if(typeof CSS<"u"&&CSS.supports)for(let r of[Y,Ht,It]){let o=r.getMinCoords(),e=No({space:r,coords:o,alpha:1});if(CSS.supports("color",e)){G.display_space=r;break}}function zl(r,{space:o=G.display_space,...e}={}){let t=No(r,e);if(typeof CSS>"u"||CSS.supports("color",t)||!G.display_space)t=new String(t),t.color=r;else{let a=r;if((r.coords.some(uo)||uo(r.alpha))&&!(_r??(_r=CSS.supports("color","hsl(none 50% 50%)")))&&(a=$o(r),a.coords=a.coords.map(R),a.alpha=R(a.alpha),t=No(a,e),CSS.supports("color",t)))return t=new String(t),t.color=a,t;a=M(a,o),t=new String(No(a,e)),t.color=a}return t}function vl(r,o){return r=v(r),o=v(o),r.space===o.space&&r.alpha===o.alpha&&r.coords.every((e,t)=>e===o.coords[t])}function po(r){return X(r,[B,"y"])}function Ot(r,o){so(r,[B,"y"],o)}function wl(r){Object.defineProperty(r.prototype,"luminance",{get(){return po(this)},set(o){Ot(this,o)}})}var yl=Object.freeze({__proto__:null,getLuminance:po,register:wl,setLuminance:Ot});function xl(r,o){r=v(r),o=v(o);let e=Math.max(po(r),0),t=Math.max(po(o),0);return t>e&&([e,t]=[t,e]),(e+.05)/(t+.05)}const Cl=.56,kl=.57,Ml=.62,$l=.65,Er=.022,Sl=1.414,_l=.1,El=5e-4,Al=1.14,Ar=.027,Rl=1.14;function Rr(r){return r>=Er?r:r+(Er-r)**Sl}function yo(r){let o=r<0?-1:1,e=Math.abs(r);return o*Math.pow(e,2.4)}function Pl(r,o){o=v(o),r=v(r);let e,t,a,l,s,n;o=M(o,"srgb"),[l,s,n]=o.coords;let i=yo(l)*.2126729+yo(s)*.7151522+yo(n)*.072175;r=M(r,"srgb"),[l,s,n]=r.coords;let c=yo(l)*.2126729+yo(s)*.7151522+yo(n)*.072175,u=Rr(i),h=Rr(c),m=h>u;return Math.abs(h-u)<El?t=0:m?(e=h**Cl-u**kl,t=e*Al):(e=h**$l-u**Ml,t=e*Rl),Math.abs(t)<_l?a=0:t>0?a=t-Ar:a=t+Ar,a*100}function Hl(r,o){r=v(r),o=v(o);let e=Math.max(po(r),0),t=Math.max(po(o),0);t>e&&([e,t]=[t,e]);let a=e+t;return a===0?0:(e-t)/a}const Nl=5e4;function Bl(r,o){r=v(r),o=v(o);let e=Math.max(po(r),0),t=Math.max(po(o),0);return t>e&&([e,t]=[t,e]),t===0?Nl:(e-t)/t}function Il(r,o){r=v(r),o=v(o);let e=X(r,[Y,"l"]),t=X(o,[Y,"l"]);return Math.abs(e-t)}const Ol=216/24389,Pr=24/116,Yo=24389/27;let ge=D.D65;var Re=new g({id:"lab-d65",name:"Lab D65",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:ge,base:B,fromBase(r){let o=r.map((e,t)=>e/ge[t]).map(e=>e>Ol?Math.cbrt(e):(Yo*e+16)/116);return[116*o[1]-16,500*(o[0]-o[1]),200*(o[1]-o[2])]},toBase(r){let o=[];return o[1]=(r[0]+16)/116,o[0]=r[1]/500+o[1],o[2]=o[1]-r[2]/200,[o[0]>Pr?Math.pow(o[0],3):(116*o[0]-16)/Yo,r[0]>8?Math.pow((r[0]+16)/116,3):r[0]/Yo,o[2]>Pr?Math.pow(o[2],3):(116*o[2]-16)/Yo].map((e,t)=>e*ge[t])},formats:{"lab-d65":{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});const fe=Math.pow(5,.5)*.5+.5;function Fl(r,o){r=v(r),o=v(o);let e=X(r,[Re,"l"]),t=X(o,[Re,"l"]),a=Math.abs(Math.pow(e,fe)-Math.pow(t,fe)),l=Math.pow(a,1/fe)*Math.SQRT2-40;return l<7.5?0:l}var oe=Object.freeze({__proto__:null,contrastAPCA:Pl,contrastDeltaPhi:Fl,contrastLstar:Il,contrastMichelson:Hl,contrastWCAG21:xl,contrastWeber:Bl});function Ll(r,o,e={}){Fo(e)&&(e={algorithm:e});let{algorithm:t,...a}=e;if(!t){let l=Object.keys(oe).map(s=>s.replace(/^contrast/,"")).join(", ");throw new TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${l}`)}r=v(r),o=v(o);for(let l in oe)if("contrast"+t.toLowerCase()===l.toLowerCase())return oe[l](r,o,a);throw new TypeError(`Unknown contrast algorithm: ${t}`)}function ce(r){let[o,e,t]=Lo(r,B),a=o+15*e+3*t;return[4*o/a,9*e/a]}function Ft(r){let[o,e,t]=Lo(r,B),a=o+e+t;return[o/a,e/a]}function Dl(r){Object.defineProperty(r.prototype,"uv",{get(){return ce(this)}}),Object.defineProperty(r.prototype,"xy",{get(){return Ft(this)}})}var jl=Object.freeze({__proto__:null,register:Dl,uv:ce,xy:Ft});function Ho(r,o,e={}){Fo(e)&&(e={method:e});let{method:t=G.deltaE,...a}=e;for(let l in So)if("deltae"+t.toLowerCase()===l.toLowerCase())return So[l](r,o,a);throw new TypeError(`Unknown deltaE method: ${t}`)}function Tl(r,o=.25){let e=[g.get("oklch","lch"),"l"];return so(r,e,t=>t*(1+o))}function ql(r,o=.25){let e=[g.get("oklch","lch"),"l"];return so(r,e,t=>t*(1-o))}var Wl=Object.freeze({__proto__:null,darken:ql,lighten:Tl});function Lt(r,o,e=.5,t={}){return[r,o]=[v(r),v(o)],co(e)==="object"&&([e,t]=[.5,e]),Do(r,o,t)(e)}function Dt(r,o,e={}){let t;Te(r)&&([t,e]=[r,o],[r,o]=t.rangeArgs.colors);let{maxDeltaE:a,deltaEMethod:l,steps:s=2,maxSteps:n=1e3,...i}=e;t||([r,o]=[v(r),v(o)],t=Do(r,o,i));let c=Ho(r,o),u=a>0?Math.max(s,Math.ceil(c/a)+1):s,h=[];if(n!==void 0&&(u=Math.min(u,n)),u===1)h=[{p:.5,color:t(.5)}];else{let m=1/(u-1);h=Array.from({length:u},(f,b)=>{let p=b*m;return{p,color:t(p)}})}if(a>0){let m=h.reduce((f,b,p)=>{if(p===0)return 0;let z=Ho(b.color,h[p-1].color,l);return Math.max(f,z)},0);for(;m>a;){m=0;for(let f=1;f<h.length&&h.length<n;f++){let b=h[f-1],p=h[f],z=(p.p+b.p)/2,w=t(z);m=Math.max(m,Ho(w,b.color),Ho(w,p.color)),h.splice(f,0,{p:z,color:t(z)}),f++}}}return h=h.map(m=>m.color),h}function Do(r,o,e={}){if(Te(r)){let[i,c]=[r,o];return Do(...i.rangeArgs.colors,{...i.rangeArgs.options,...c})}let{space:t,outputSpace:a,progression:l,premultiplied:s}=e;r=v(r),o=v(o),r=$o(r),o=$o(o);let n={colors:[r,o],options:e};if(t?t=g.get(t):t=g.registry[G.interpolationSpace]||r.space,a=a?g.get(a):t,r=M(r,t),o=M(o,t),r=mo(r),o=mo(o),t.coords.h&&t.coords.h.type==="angle"){let i=e.hue=e.hue||"shorter",c=[t,"h"],[u,h]=[X(r,c),X(o,c)];isNaN(u)&&!isNaN(h)?u=h:isNaN(h)&&!isNaN(u)&&(h=u),[u,h]=ka(i,[u,h]),so(r,c,u),so(o,c,h)}return s&&(r.coords=r.coords.map(i=>i*r.alpha),o.coords=o.coords.map(i=>i*o.alpha)),Object.assign(i=>{i=l?l(i):i;let c=r.coords.map((m,f)=>{let b=o.coords[f];return Bo(m,b,i)}),u=Bo(r.alpha,o.alpha,i),h={space:t,coords:c,alpha:u};return s&&(h.coords=h.coords.map(m=>m/u)),a!==t&&(h=M(h,a)),h},{rangeArgs:n})}function Te(r){return co(r)==="function"&&!!r.rangeArgs}G.interpolationSpace="lab";function Ul(r){r.defineFunction("mix",Lt,{returns:"color"}),r.defineFunction("range",Do,{returns:"function<color>"}),r.defineFunction("steps",Dt,{returns:"array<color>"})}var Xl=Object.freeze({__proto__:null,isRange:Te,mix:Lt,range:Do,register:Ul,steps:Dt}),jt=new g({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:_o,fromBase:r=>{let o=Math.max(...r),e=Math.min(...r),[t,a,l]=r,[s,n,i]=[NaN,0,(e+o)/2],c=o-e;if(c!==0){switch(n=i===0||i===1?0:(o-i)/Math.min(i,1-i),o){case t:s=(a-l)/c+(a<l?6:0);break;case a:s=(l-t)/c+2;break;case l:s=(t-a)/c+4}s=s*60}return n<0&&(s+=180,n=Math.abs(n)),s>=360&&(s-=360),[s,n*100,i*100]},toBase:r=>{let[o,e,t]=r;o=o%360,o<0&&(o+=360),e/=100,t/=100;function a(l){let s=(l+o/30)%12,n=e*Math.min(t,1-t);return t-n*Math.max(-1,Math.min(s-3,9-s,1))}return[a(0),a(8),a(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage>","<percentage>"]},hsla:{coords:["<number> | <angle>","<percentage>","<percentage>"],commas:!0,lastAlpha:!0}}}),Tt=new g({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:jt,fromBase(r){let[o,e,t]=r;e/=100,t/=100;let a=t+e*Math.min(t,1-t);return[o,a===0?0:200*(1-t/a),100*a]},toBase(r){let[o,e,t]=r;e/=100,t/=100;let a=t*(1-e/2);return[o,a===0||a===1?0:(t-a)/Math.min(a,1-a)*100,a*100]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Yl=new g({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:Tt,fromBase(r){let[o,e,t]=r;return[o,t*(100-e)/100,100-t]},toBase(r){let[o,e,t]=r;e/=100,t/=100;let a=e+t;if(a>=1){let n=e/a;return[o,0,n*100]}let l=1-t,s=l===0?0:1-e/l;return[o,s*100,l*100]},formats:{hwb:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});const Gl=[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],Zl=[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]];var qt=new T({id:"a98rgb-linear",cssId:"--a98-rgb-linear",name:"Linear Adobe® 98 RGB compatible",white:"D65",toXYZ_M:Gl,fromXYZ_M:Zl}),Kl=new T({id:"a98rgb",cssId:"a98-rgb",name:"Adobe® 98 RGB compatible",base:qt,toBase:r=>r.map(o=>Math.pow(Math.abs(o),563/256)*Math.sign(o)),fromBase:r=>r.map(o=>Math.pow(Math.abs(o),256/563)*Math.sign(o))});const Vl=[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],Jl=[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]];var Wt=new T({id:"prophoto-linear",cssId:"--prophoto-rgb-linear",name:"Linear ProPhoto",white:"D50",base:Le,toXYZ_M:Vl,fromXYZ_M:Jl});const Ql=1/512,os=16/512;var es=new T({id:"prophoto",cssId:"prophoto-rgb",name:"ProPhoto",base:Wt,toBase(r){return r.map(o=>o<os?o/16:o**1.8)},fromBase(r){return r.map(o=>o>=Ql?o**(1/1.8):16*o)}}),rs=new g({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Mo,fromBase(r){let[o,e,t]=r,a;const l=2e-4;return Math.abs(e)<l&&Math.abs(t)<l?a=NaN:a=Math.atan2(t,e)*180/Math.PI,[o,Math.sqrt(e**2+t**2),to(a)]},toBase(r){let[o,e,t]=r,a,l;return isNaN(t)?(a=0,l=0):(a=e*Math.cos(t*Math.PI/180),l=e*Math.sin(t*Math.PI/180)),[o,a,l]},formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});let Ut=D.D65;const ts=216/24389,Hr=24389/27,[Nr,Br]=ce({space:B,coords:Ut});var Xt=new g({id:"luv",name:"Luv",coords:{l:{refRange:[0,100],name:"Lightness"},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:Ut,base:B,fromBase(r){let o=[R(r[0]),R(r[1]),R(r[2])],e=o[1],[t,a]=ce({space:B,coords:o});if(!Number.isFinite(t)||!Number.isFinite(a))return[0,0,0];let l=e<=ts?Hr*e:116*Math.cbrt(e)-16;return[l,13*l*(t-Nr),13*l*(a-Br)]},toBase(r){let[o,e,t]=r;if(o===0||uo(o))return[0,0,0];e=R(e),t=R(t);let a=e/(13*o)+Nr,l=t/(13*o)+Br,s=o<=8?o/Hr:Math.pow((o+16)/116,3);return[s*(9*a/(4*l)),s,s*((12-3*a-20*l)/(4*l))]},formats:{color:{id:"--luv",coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),qe=new g({id:"lchuv",name:"LChuv",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,220],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Xt,fromBase(r){let[o,e,t]=r,a;const l=.02;return Math.abs(e)<l&&Math.abs(t)<l?a=NaN:a=Math.atan2(t,e)*180/Math.PI,[o,Math.sqrt(e**2+t**2),to(a)]},toBase(r){let[o,e,t]=r;return e<0&&(e=0),isNaN(t)&&(t=0),[o,e*Math.cos(t*Math.PI/180),e*Math.sin(t*Math.PI/180)]},formats:{color:{id:"--lchuv",coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}});const as=216/24389,ls=24389/27,Ir=H[0][0],Or=H[0][1],be=H[0][2],Fr=H[1][0],Lr=H[1][1],ze=H[1][2],Dr=H[2][0],jr=H[2][1],ve=H[2][2];function xo(r,o,e){const t=o/(Math.sin(e)-r*Math.cos(e));return t<0?1/0:t}function le(r){const o=Math.pow(r+16,3)/1560896,e=o>as?o:r/ls,t=e*(284517*Ir-94839*be),a=e*(838422*be+769860*Or+731718*Ir),l=e*(632260*be-126452*Or),s=e*(284517*Fr-94839*ze),n=e*(838422*ze+769860*Lr+731718*Fr),i=e*(632260*ze-126452*Lr),c=e*(284517*Dr-94839*ve),u=e*(838422*ve+769860*jr+731718*Dr),h=e*(632260*ve-126452*jr);return{r0s:t/l,r0i:a*r/l,r1s:t/(l+126452),r1i:(a-769860)*r/(l+126452),g0s:s/i,g0i:n*r/i,g1s:s/(i+126452),g1i:(n-769860)*r/(i+126452),b0s:c/h,b0i:u*r/h,b1s:c/(h+126452),b1i:(u-769860)*r/(h+126452)}}function Tr(r,o){const e=o/360*Math.PI*2,t=xo(r.r0s,r.r0i,e),a=xo(r.r1s,r.r1i,e),l=xo(r.g0s,r.g0i,e),s=xo(r.g1s,r.g1i,e),n=xo(r.b0s,r.b0i,e),i=xo(r.b1s,r.b1i,e);return Math.min(t,a,l,s,n,i)}var ss=new g({id:"hsluv",name:"HSLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:qe,gamutSpace:_o,fromBase(r){let[o,e,t]=[R(r[0]),R(r[1]),R(r[2])],a;if(o>99.9999999)a=0,o=100;else if(o<1e-8)a=0,o=0;else{let l=le(o),s=Tr(l,t);a=e/s*100}return[t,a,o]},toBase(r){let[o,e,t]=[R(r[0]),R(r[1]),R(r[2])],a;if(t>99.9999999)t=100,a=0;else if(t<1e-8)t=0,a=0;else{let l=le(t);a=Tr(l,o)/100*e}return[t,a,o]},formats:{color:{id:"--hsluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});H[0][0];H[0][1];H[0][2];H[1][0];H[1][1];H[1][2];H[2][0];H[2][1];H[2][2];function Co(r,o){return Math.abs(o)/Math.sqrt(Math.pow(r,2)+1)}function qr(r){let o=Co(r.r0s,r.r0i),e=Co(r.r1s,r.r1i),t=Co(r.g0s,r.g0i),a=Co(r.g1s,r.g1i),l=Co(r.b0s,r.b0i),s=Co(r.b1s,r.b1i);return Math.min(o,e,t,a,l,s)}var ns=new g({id:"hpluv",name:"HPLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:qe,gamutSpace:"self",fromBase(r){let[o,e,t]=[R(r[0]),R(r[1]),R(r[2])],a;if(o>99.9999999)a=0,o=100;else if(o<1e-8)a=0,o=0;else{let l=le(o),s=qr(l);a=e/s*100}return[t,a,o]},toBase(r){let[o,e,t]=[R(r[0]),R(r[1]),R(r[2])],a;if(t>99.9999999)t=100,a=0;else if(t<1e-8)t=0,a=0;else{let l=le(t);a=qr(l)/100*e}return[t,a,o]},formats:{color:{id:"--hpluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});const Wr=203,Ur=2610/2**14,is=2**14/2610,cs=2523/2**5,Xr=2**5/2523,Yr=3424/2**12,Gr=2413/2**7,Zr=2392/2**7;var us=new T({id:"rec2100pq",cssId:"rec2100-pq",name:"REC.2100-PQ",base:ie,toBase(r){return r.map(function(o){return(Math.max(o**Xr-Yr,0)/(Gr-Zr*o**Xr))**is*1e4/Wr})},fromBase(r){return r.map(function(o){let e=Math.max(o*Wr/1e4,0),t=Yr+Gr*e**Ur,a=1+Zr*e**Ur;return(t/a)**cs})}});const Kr=.17883277,Vr=.28466892,Jr=.55991073,we=3.7743;var hs=new T({id:"rec2100hlg",cssId:"rec2100-hlg",name:"REC.2100-HLG",referred:"scene",base:ie,toBase(r){return r.map(function(o){return o<=.5?o**2/3*we:(Math.exp((o-Jr)/Kr)+Vr)/12*we})},fromBase(r){return r.map(function(o){return o/=we,o<=1/12?Math.sqrt(3*o):Kr*Math.log(12*o-Vr)+Jr})}});const Yt={};ho.add("chromatic-adaptation-start",r=>{r.options.method&&(r.M=Gt(r.W1,r.W2,r.options.method))});ho.add("chromatic-adaptation-end",r=>{r.M||(r.M=Gt(r.W1,r.W2,r.options.method))});function ue({id:r,toCone_M:o,fromCone_M:e}){Yt[r]=arguments[0]}function Gt(r,o,e="Bradford"){let t=Yt[e],[a,l,s]=$(t.toCone_M,r),[n,i,c]=$(t.toCone_M,o),u=[[n/a,0,0],[0,i/l,0],[0,0,c/s]],h=$(u,t.toCone_M);return $(t.fromCone_M,h)}ue({id:"von Kries",toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]});ue({id:"Bradford",toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]});ue({id:"CAT02",toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]});ue({id:"CAT16",toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]});Object.assign(D,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]});D.ACES=[.32168/.33767,1,(1-.32168-.33767)/.33767];const ds=[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],ms=[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]];var Zt=new T({id:"acescg",cssId:"--acescg",name:"ACEScg",coords:{r:{range:[0,65504],name:"Red"},g:{range:[0,65504],name:"Green"},b:{range:[0,65504],name:"Blue"}},referred:"scene",white:D.ACES,toXYZ_M:ds,fromXYZ_M:ms});const Go=2**-16,ye=-.35828683,Zo=(Math.log2(65504)+9.72)/17.52;var ps=new T({id:"acescc",cssId:"--acescc",name:"ACEScc",coords:{r:{range:[ye,Zo],name:"Red"},g:{range:[ye,Zo],name:"Green"},b:{range:[ye,Zo],name:"Blue"}},referred:"scene",base:Zt,toBase(r){const o=-.3013698630136986;return r.map(function(e){return e<=o?(2**(e*17.52-9.72)-Go)*2:e<Zo?2**(e*17.52-9.72):65504})},fromBase(r){return r.map(function(o){return o<=0?(Math.log2(Go)+9.72)/17.52:o<Go?(Math.log2(Go+o*.5)+9.72)/17.52:(Math.log2(o)+9.72)/17.52})}}),Qr=Object.freeze({__proto__:null,A98RGB:Kl,A98RGB_Linear:qt,ACEScc:ps,ACEScg:Zt,CAM16_JMh:tl,HCT:Oo,HPLuv:ns,HSL:jt,HSLuv:ss,HSV:Tt,HWB:Yl,ICTCP:_e,JzCzHz:Se,Jzazbz:Ct,LCH:Io,LCHuv:qe,Lab:Y,Lab_D65:Re,Luv:Xt,OKLCH:rs,OKLab:Mo,P3:It,P3_Linear:Nt,ProPhoto:es,ProPhoto_Linear:Wt,REC_2020:Ht,REC_2020_Linear:ie,REC_2100_HLG:hs,REC_2100_PQ:us,XYZ_ABS_D65:De,XYZ_D50:Le,XYZ_D65:B,sRGB:_o,sRGB_Linear:Bt});let _=class j{constructor(...o){let e;o.length===1&&(e=v(o[0]));let t,a,l;e?(t=e.space||e.spaceId,a=e.coords,l=e.alpha):[t,a,l]=o,Object.defineProperty(this,"space",{value:g.get(t),writable:!1,enumerable:!0,configurable:!0}),this.coords=a?a.slice():[0,0,0],this.alpha=l>1||l===void 0?1:l<0?0:l;for(let s=0;s<this.coords.length;s++)this.coords[s]==="NaN"&&(this.coords[s]=NaN);for(let s in this.space.coords)Object.defineProperty(this,s,{get:()=>this.get(s),set:n=>this.set(s,n)})}get spaceId(){return this.space.id}clone(){return new j(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...o){let e=zl(this,...o);return e.color=new j(e.color),e}static get(o,...e){return o instanceof j?o:new j(o,...e)}static defineFunction(o,e,t=e){let{instance:a=!0,returns:l}=t,s=function(...n){let i=e(...n);if(l==="color")i=j.get(i);else if(l==="function<color>"){let c=i;i=function(...u){let h=c(...u);return j.get(h)},Object.assign(i,c)}else l==="array<color>"&&(i=i.map(c=>j.get(c)));return i};o in j||(j[o]=s),a&&(j.prototype[o]=function(...n){return s(this,...n)})}static defineFunctions(o){for(let e in o)j.defineFunction(e,o[e],o[e])}static extend(o){if(o.register)o.register(j);else for(let e in o)j.defineFunction(e,o[e])}};_.defineFunctions({get:X,getAll:Lo,set:so,setAll:Fe,to:M,equals:vl,inGamut:zo,toGamut:mo,distance:xt,toString:No});Object.assign(_,{util:za,hooks:ho,WHITES:D,Space:g,spaces:g.registry,parse:wt,defaults:G});for(let r of Object.keys(Qr))g.register(Qr[r]);for(let r in g.registry)Pe(r,g.registry[r]);ho.add("colorspace-init-end",r=>{var o;Pe(r.id,r),(o=r.aliases)==null||o.forEach(e=>{Pe(e,r)})});function Pe(r,o){let e=r.replace(/-/g,"_");Object.defineProperty(_.prototype,e,{get(){let t=this.getAll(r);return typeof Proxy>"u"?t:new Proxy(t,{has:(a,l)=>{try{return g.resolveCoord([o,l]),!0}catch{}return Reflect.has(a,l)},get:(a,l,s)=>{if(l&&typeof l!="symbol"&&!(l in a)){let{index:n}=g.resolveCoord([o,l]);if(n>=0)return a[n]}return Reflect.get(a,l,s)},set:(a,l,s,n)=>{if(l&&typeof l!="symbol"&&!(l in a)||l>=0){let{index:i}=g.resolveCoord([o,l]);if(i>=0)return a[i]=s,this.setAll(r,a),!0}return Reflect.set(a,l,s,n)}})},set(t){this.setAll(r,t)},configurable:!0,enumerable:!0})}_.extend(So);_.extend({deltaE:Ho});Object.assign(_,{deltaEMethods:So});_.extend(Wl);_.extend({contrast:Ll});_.extend(jl);_.extend(yl);_.extend(Xl);_.extend(oe);class Kt{constructor(o,{manageAs:e}={}){this._color=new _("hsv",[0,100,100],1),this.host=o,this.manageAs=e}get color(){return this._color}validateColorString(o){var e,t,a,l;const s={spaceId:null,coords:[0,0,0],isValid:!1,alpha:1},n=[/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d*\.?\d+)\s*\)/i,/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/i,/^rgba\s+(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+(0|0?\.\d+|1)\s*$/i,/^rgb\s+(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s*$/i,/^rgba\(\s*(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+(\d*\.?\d+)\s*\)$/i,/^rgb\(\s*(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s*\)$/i,/rgb\(\s*(100|[0-9]{1,2}%)\s*,\s*(100|[0-9]{1,2}%)\s*,\s*(100|[0-9]{1,2}%)\s*\)/i,/rgba\(\s*(100|[0-9]{1,2})%\s*,\s*(100|[0-9]{1,2})%\s*,\s*(100|[0-9]{1,2})%\s*,\s*(\d*\.?\d+)\s*\)/i],i=[/hsla\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d*\.?\d+)\s*\)/i,/hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)/i,/^hsla\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*$/i,/^hsl\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*$/i,/^hsla\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*\)$/i,/^hsl\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*\)$/i],c=[/hsva\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d*\.?\d+)\s*\)/i,/hsv\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)/i,/^hsva\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*$/i,/^hsv\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*$/i,/^hsva\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*\)$/i,/^hsv\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*\)$/i],u=[/^#([A-Fa-f0-9]{6})(?:\s*([01](?:\.\d+)?))?$/,/^#([A-Fa-f0-9]{3})(?:\s*([01](?:\.\d+)?))?$/],h=(e=n.find(p=>p.test(o)))==null?void 0:e.exec(o),m=(t=i.find(p=>p.test(o)))==null?void 0:t.exec(o),f=(a=c.find(p=>p.test(o)))==null?void 0:a.exec(o),b=(l=u.find(p=>p.test(o)))==null?void 0:l.exec(o);if(h){const[,p,z,w,y]=h.filter(E=>typeof E=="string"),C=y===void 0?1:Number(y),x=E=>E.includes("%")?Number(E.replace("%",""))/100:Number(E)/255,k=x(p),S=x(z),F=x(w);s.spaceId="srgb",s.coords=[k,S,F],s.alpha=C,s.isValid=k>=0&&k<=1&&S>=0&&S<=1&&F>=0&&F<=1&&C>=0&&C<=1}else if(m){const[,p,z,w,y]=m,C=[p,z,w,y===void 0?"1":y].map(E=>Number(E.replaceAll(/[^\d.]/g,""))),[x,k,S,F]=C;s.spaceId="hsl",s.coords=[x,k,S],s.alpha=F,s.isValid=x>=0&&x<=360&&k>=0&&k<=100&&S>=0&&S<=100&&F>=0&&F<=1}else if(f){const[,p,z,w,y]=f,C=[p,z,w,y===void 0?"1":y].map(E=>Number(E.replaceAll(/[^\d.]/g,""))),[x,k,S,F]=C;s.spaceId="hsv",s.coords=[x,k,S],s.alpha=F,s.isValid=x>=0&&x<=360&&k>=0&&k<=100&&S>=0&&S<=100&&F>=0&&F<=1}else if(b){const[,p,z]=b,w=S=>(S.length===1&&(S=S+S),Number.parseInt(S,16)/255);let y,C,x;p.length===3?(y=w(p.slice(0,1)),C=w(p.slice(1,2)),x=w(p.slice(2,3))):(y=w(p.slice(0,2)),C=w(p.slice(2,4)),x=w(p.slice(4,6)));const k=z?Number(z):1;s.spaceId="srgb",s.coords=[y,C,x],s.alpha=k,s.isValid=y>=0&&y<=1&&C>=0&&C<=1&&x>=0&&x<=1&&k>=0&&k<=1}return s}get colorOrigin(){return this._colorOrigin}set colorOrigin(o){this._colorOrigin=o}set color(o){this._colorOrigin=o;let e;if(typeof o=="string"){const t=this.validateColorString(o);if(t.isValid){const[a,l,s]=t.coords;e=new _(`${t.spaceId}`,[a,l,s],t.alpha)}else try{_.parse(o)}catch{try{e=new _(`#${o}`)}catch{return}}}else if(o instanceof _)e=o;else if(!Array.isArray(o)){const{h:t,s:a,l,v:s,r:n,g:i,b:c,a:u}=o;if(t!==void 0&&a!==void 0){const h=l??s;e=new _(l===void 0?"hsv":"hsl",[Number.parseFloat(t),typeof a=="string"?Number.parseFloat(a):a*100,typeof h=="string"?Number.parseFloat(h):h*100],Number.parseFloat(u||"1"))}else n!==void 0&&i!==void 0&&c!==void 0&&(e=new _("srgb",[Number.parseFloat(n)/255,Number.parseFloat(i)/255,Number.parseFloat(c)/255],Number.parseFloat(u||"1")))}e||(e=new _(o)),this._color=this.manageAs?e.to(this.manageAs):e,this.host.requestUpdate()}get colorValue(){let o;if(typeof this._colorOrigin=="string")switch(this._colorOrigin.startsWith("#")?o="hex string":this._colorOrigin.startsWith("rgb")?o="rgb":this._colorOrigin.startsWith("hsl")?o="hsl":this._colorOrigin.startsWith("hsv")?o="hsv":o="hex",o){case"hsv":{const e=this._colorOrigin[3]==="a",{h:t,s:a,v:l}=this._color.to("hsv").hsv,s=this._color.alpha;return`hsv${e?"a":""}(${Math.round(t)}, ${Math.round(a)}%, ${Math.round(l)}%${e?`, ${s}`:""})`}case"hsl":{const e=this._colorOrigin[3]==="a",{h:t,s:a,l}=this._color.to("hsl").hsl,s=this._color.alpha;return`hsl${e?"a":""}(${Math.round(t)}, ${Math.round(a)}%, ${Math.round(l)}%${e?`, ${s}`:""})`}case"hex string":{const{r:e,g:t,b:a}=this._color.to("srgb").srgb,l=this._colorOrigin.length===5||this._colorOrigin.length===9,s=this._color.alpha,n=Math.round(e*255).toString(16),i=Math.round(t*255).toString(16),c=Math.round(a*255).toString(16),u=Math.round(s*255).toString(16);return`#${n.padStart(2,"0")}${i.padStart(2,"0")}${c.padStart(2,"0")}${l?u.padStart(2,"0"):""}`}case"hex":{const{r:e,g:t,b:a}=this._color.to("srgb").srgb,l=this._colorOrigin.length===4||this._colorOrigin.length===8,s=this._color.alpha,n=Math.round(e*255).toString(16),i=Math.round(t*255).toString(16),c=Math.round(a*255).toString(16),u=Math.round(s*255).toString(16);return`${n.padStart(2,"0")}${i.padStart(2,"0")}${c.padStart(2,"0")}${l?u.padStart(2,"0"):""}`}default:{const{r:e,g:t,b:a}=this._color.to("srgb").srgb,l=this._colorOrigin[3]==="a",s=this._color.alpha;return this._colorOrigin.search("%")>-1?`rgb${l?"a":""}(${Math.round(e*100)}%, ${Math.round(t*100)}%, ${Math.round(a*100)}%${l?`,${Math.round(s*100)}%`:""})`:`rgb${l?"a":""}(${Math.round(e*255)}, ${Math.round(t*255)}, ${Math.round(a*255)}${l?`, ${s}`:""})`}}if(this._colorOrigin)try{({spaceId:o}=new _(this._colorOrigin))}catch{const{h:e,s:t,l:a,v:l,r:s,g:n,b:i}=this._colorOrigin;e!==void 0&&t!==void 0&&a!==void 0?o="hsl":e!==void 0&&t!==void 0&&l!==void 0?o="hsv":s!==void 0&&n!==void 0&&i!==void 0&&(o="srgb")}else({spaceId:o}=this.color);switch(o){case"hsv":{const{h:e,s:t,v:a}=this._color.to("hsv").hsv;return{h:e,s:t/100,v:a/100,a:this._color.alpha}}case"hsl":{const{h:e,s:t,l:a}=this._color.to("hsl").hsl;return{h:e,s:t/100,l:a/100,a:this._color.alpha}}case"srgb":{const{r:e,g:t,b:a}=this._color.to("srgb").srgb;return this._colorOrigin&&typeof this._colorOrigin.r=="string"&&this._colorOrigin.r.search("%")?{r:`${Math.round(e*255)}%`,g:`${Math.round(t*255)}%`,b:`${Math.round(a*255)}%`,a:this._color.alpha}:{r:Math.round(e*255),g:Math.round(t*255),b:Math.round(a*255),a:this._color.alpha}}}return this._color}get hue(){return Number(this._color.to("hsl").hsl.h)}set hue(o){this._color.set("h",o),this.host.requestUpdate()}getColor(o){if(typeof o=="string"&&!["srgb","hsva","hsv","hsl","hsla"].includes(o))throw new Error("not a valid format");return this._color.to(o)}getHslString(){return this._color.to("hsl").toString()}savePreviousColor(){this._previousColor=this._color.clone()}restorePreviousColor(){this._color=this._previousColor}}/*! * Lucero - The design system for Luzmo.
|
112
|
+
* */var fa=Object.defineProperty,ba=(r,o,e)=>o in r?fa(r,o,{enumerable:!0,configurable:!0,writable:!0,value:e}):r[o]=e,Qe=(r,o,e)=>ba(r,typeof o!="symbol"?o+"":o,e);function $(r,o){let e=r.length;Array.isArray(r[0])||(r=[r]),Array.isArray(o[0])||(o=o.map(s=>[s]));let t=o[0].length,a=o[0].map((s,n)=>o.map(i=>i[n])),l=r.map(s=>a.map(n=>{let i=0;if(!Array.isArray(s)){for(let c of n)i+=s*c;return i}for(let c=0;c<s.length;c++)i+=s[c]*(n[c]||0);return i}));return e===1&&(l=l[0]),t===1?l.map(s=>s[0]):l}function Fo(r){return co(r)==="string"}function co(r){return(Object.prototype.toString.call(r).match(/^\[object\s+(.*?)\]$/)[1]||"").toLowerCase()}function re(r,{precision:o,unit:e}){return uo(r)?"none":pt(r,o)+(e??"")}function uo(r){return Number.isNaN(r)||r instanceof Number&&(r==null?void 0:r.none)}function R(r){return uo(r)?0:r}function pt(r,o){if(r===0)return 0;let e=~~r,t=0;e&&o&&(t=~~Math.log10(Math.abs(e))+1);const a=10**(o-t);return Math.floor(r*a+.5)/a}const za={deg:1,grad:.9,rad:180/Math.PI,turn:360};function gt(r){if(!r)return;r=r.trim();const o=/^([a-z]+)\((.+?)\)$/i,e=/^-?[\d.]+$/,t=/%|deg|g?rad|turn$/,a=/\/?\s*(none|[-\w.]+(?:%|deg|g?rad|turn)?)/g;let l=r.match(o);if(l){let s=[];return l[2].replace(a,(n,i)=>{let c=i.match(t),u=i;if(c){let h=c[0],m=u.slice(0,-h.length);h==="%"?(u=new Number(m/100),u.type="<percentage>"):(u=new Number(m*za[h]),u.type="<angle>",u.unit=h)}else e.test(u)?(u=new Number(u),u.type="<number>"):u==="none"&&(u=new Number(NaN),u.none=!0);n.startsWith("/")&&(u=u instanceof Number?u:new Number(u),u.alpha=!0),typeof u=="object"&&u instanceof Number&&(u.raw=i),s.push(u)}),{name:l[1].toLowerCase(),rawName:l[1],rawArgs:l[2],args:s}}}function ft(r){return r[r.length-1]}function No(r,o,e){return isNaN(r)?o:isNaN(o)?r:r+(o-r)*e}function bt(r,o,e){return(e-r)/(o-r)}function Oe(r,o,e){return No(o[0],o[1],bt(r[0],r[1],e))}function zt(r){return r.map(o=>o.split("|").map(e=>{e=e.trim();let t=e.match(/^(<[a-z]+>)\[(-?[.\d]+),\s*(-?[.\d]+)\]?$/);if(t){let a=new String(t[1]);return a.range=[+t[2],+t[3]],a}return e}))}function vt(r,o,e){return Math.max(Math.min(e,o),r)}function ne(r,o){return Math.sign(r)===Math.sign(o)?r:-r}function ro(r,o){return ne(Math.abs(r)**o,r)}function Ie(r,o){return o===0?0:r/o}function wt(r,o,e=0,t=r.length){for(;e<t;){const a=e+t>>1;r[a]<o?e=a+1:t=a}return e}var va=Object.freeze({__proto__:null,bisectLeft:wt,clamp:vt,copySign:ne,interpolate:No,interpolateInv:bt,isNone:uo,isString:Fo,last:ft,mapRange:Oe,multiplyMatrices:$,parseCoordGrammar:zt,parseFunction:gt,serializeNumber:re,skipNone:R,spow:ro,toPrecision:pt,type:co,zdiv:Ie});class wa{add(o,e,t){if(typeof arguments[0]!="string"){for(var o in arguments[0])this.add(o,arguments[0][o],arguments[1]);return}(Array.isArray(o)?o:[o]).forEach(function(a){this[a]=this[a]||[],e&&this[a][t?"unshift":"push"](e)},this)}run(o,e){this[o]=this[o]||[],this[o].forEach(function(t){t.call(e&&e.context?e.context:e,e)})}}const ho=new wa;var or,er,rr,G={gamut_mapping:"css",precision:5,deltaE:"76",verbose:((rr=(er=(or=globalThis==null?void 0:globalThis.process)==null?void 0:or.env)==null?void 0:er.NODE_ENV)==null?void 0:rr.toLowerCase())!=="test",warn:function(r){var o,e;this.verbose&&((e=(o=globalThis==null?void 0:globalThis.console)==null?void 0:o.warn)==null||e.call(o,r))}};const D={D50:[.3457/.3585,1,(1-.3457-.3585)/.3585],D65:[.3127/.329,1,(1-.3127-.329)/.329]};function ke(r){return Array.isArray(r)?r:D[r]}function te(r,o,e,t={}){if(r=ke(r),o=ke(o),!r||!o)throw new TypeError(`Missing white point to convert ${r?"":"from"}${!r&&!o?"/":""}${o?"":"to"}`);if(r===o)return e;let a={W1:r,W2:o,XYZ:e,options:t};if(ho.run("chromatic-adaptation-start",a),a.M||(a.W1===D.D65&&a.W2===D.D50?a.M=[[1.0479297925449969,.022946870601609652,-.05019226628920524],[.02962780877005599,.9904344267538799,-.017073799063418826],[-.009243040646204504,.015055191490298152,.7518742814281371]]:a.W1===D.D50&&a.W2===D.D65&&(a.M=[[.955473421488075,-.02309845494876471,.06325924320057072],[-.0283697093338637,1.0099953980813041,.021041441191917323],[.012314014864481998,-.020507649298898964,1.330365926242124]])),ho.run("chromatic-adaptation-end",a),a.M)return $(a.M,a.XYZ);throw new TypeError("Only Bradford CAT with white points D50 and D65 supported for now.")}const ya=new Set(["<number>","<percentage>","<angle>"]);function tr(r,o,e,t){return Object.entries(r.coords).map(([a,l],s)=>{let n=o.coordGrammar[s],i=t[s],c=i==null?void 0:i.type,u;if(i.none?u=n.find(f=>ya.has(f)):u=n.find(f=>f==c),!u){let f=l.name||a;throw new TypeError(`${c??i.raw} not allowed for ${f} in ${e}()`)}let h=u.range;c==="<percentage>"&&(h||(h=[0,1]));let m=l.range||l.refRange;return h&&m&&(t[s]=Oe(h,m,t[s])),u})}function yt(r,{meta:o}={}){var e,t,a,l;let s={str:(e=String(r))==null?void 0:e.trim()};if(ho.run("parse-start",s),s.color)return s.color;if(s.parsed=gt(s.str),s.parsed){let n=s.parsed.name;if(n==="color"){let i=s.parsed.args.shift(),c=i.startsWith("--")?i.substring(2):`--${i}`,u=[i,c],h=s.parsed.rawArgs.indexOf("/")>0?s.parsed.args.pop():1;for(let b of g.all){let p=b.getFormat("color");if(p&&(u.includes(p.id)||(t=p.ids)!=null&&t.filter(z=>u.includes(z)).length)){const z=Object.keys(b.coords).map((y,C)=>s.parsed.args[C]||0);let w;return p.coordGrammar&&(w=tr(b,p,"color",z)),o&&Object.assign(o,{formatId:"color",types:w}),p.id.startsWith("--")&&!i.startsWith("--")&&G.warn(`${b.name} is a non-standard space and not currently supported in the CSS spec. Use prefixed color(${p.id}) instead of color(${i}).`),i.startsWith("--")&&!p.id.startsWith("--")&&G.warn(`${b.name} is a standard space and supported in the CSS spec. Use color(${p.id}) instead of prefixed color(${i}).`),{spaceId:b.id,coords:z,alpha:h}}}let m="",f=i in g.registry?i:c;if(f in g.registry){let b=(l=(a=g.registry[f].formats)==null?void 0:a.color)==null?void 0:l.id;b&&(m=`Did you mean color(${b})?`)}throw new TypeError(`Cannot parse color(${i}). `+(m||"Missing a plugin?"))}else for(let i of g.all){let c=i.getFormat(n);if(c&&c.type==="function"){let u=1;(c.lastAlpha||ft(s.parsed.args).alpha)&&(u=s.parsed.args.pop());let h=s.parsed.args,m;return c.coordGrammar&&(m=tr(i,c,n,h)),o&&Object.assign(o,{formatId:c.name,types:m}),{spaceId:i.id,coords:h,alpha:u}}}}else for(let n of g.all)for(let i in n.formats){let c=n.formats[i];if(c.type!=="custom"||c.test&&!c.test(s.str))continue;let u=c.parse(s.str);if(u)return u.alpha??(u.alpha=1),o&&(o.formatId=i),u}throw new TypeError(`Could not parse ${r} as a color. Missing a plugin?`)}function v(r){if(Array.isArray(r))return r.map(v);if(!r)throw new TypeError("Empty color reference");Fo(r)&&(r=yt(r));let o=r.space||r.spaceId;return o instanceof g||(r.space=g.get(o)),r.alpha===void 0&&(r.alpha=1),r}const xa=75e-6,Me=class oo{constructor(o){var e;this.id=o.id,this.name=o.name,this.base=o.base?oo.get(o.base):null,this.aliases=o.aliases,this.base&&(this.fromBase=o.fromBase,this.toBase=o.toBase);let t=o.coords??this.base.coords;for(let l in t)"name"in t[l]||(t[l].name=l);this.coords=t;let a=o.white??this.base.white??"D65";this.white=ke(a),this.formats=o.formats??{};for(let l in this.formats){let s=this.formats[l];s.type||(s.type="function"),s.name||(s.name=l)}(e=this.formats.color)!=null&&e.id||(this.formats.color={...this.formats.color??{},id:o.cssId||this.id}),o.gamutSpace?this.gamutSpace=o.gamutSpace==="self"?this:oo.get(o.gamutSpace):this.isPolar?this.gamutSpace=this.base:this.gamutSpace=this,this.gamutSpace.isUnbounded&&(this.inGamut=(l,s)=>!0),this.referred=o.referred,Object.defineProperty(this,"path",{value:Ca(this).reverse(),writable:!1,enumerable:!0,configurable:!0}),ho.run("colorspace-init-end",this)}inGamut(o,{epsilon:e=xa}={}){if(!this.equals(this.gamutSpace))return o=this.to(this.gamutSpace,o),this.gamutSpace.inGamut(o,{epsilon:e});let t=Object.values(this.coords);return o.every((a,l)=>{let s=t[l];if(s.type!=="angle"&&s.range){if(Number.isNaN(a))return!0;let[n,i]=s.range;return(n===void 0||a>=n-e)&&(i===void 0||a<=i+e)}return!0})}get isUnbounded(){return Object.values(this.coords).every(o=>!("range"in o))}get cssId(){var o,e;return((e=(o=this.formats)==null?void 0:o.color)==null?void 0:e.id)||this.id}get isPolar(){for(let o in this.coords)if(this.coords[o].type==="angle")return!0;return!1}getFormat(o){if(typeof o=="object")return o=ar(o,this),o;let e;return o==="default"?e=Object.values(this.formats)[0]:e=this.formats[o],e?(e=ar(e,this),e):null}equals(o){return o?this===o||this.id===o||this.id===o.id:!1}to(o,e){if(arguments.length===1){const n=v(o);[o,e]=[n.space,n.coords]}if(o=oo.get(o),this.equals(o))return e;e=e.map(n=>Number.isNaN(n)?0:n);let t=this.path,a=o.path,l,s;for(let n=0;n<t.length&&t[n].equals(a[n]);n++)l=t[n],s=n;if(!l)throw new Error(`Cannot convert between color spaces ${this} and ${o}: no connection space was found`);for(let n=t.length-1;n>s;n--)e=t[n].toBase(e);for(let n=s+1;n<a.length;n++)e=a[n].fromBase(e);return e}from(o,e){if(arguments.length===1){const t=v(o);[o,e]=[t.space,t.coords]}return o=oo.get(o),o.to(this,e)}toString(){return`${this.name} (${this.id})`}getMinCoords(){let o=[];for(let e in this.coords){let t=this.coords[e],a=t.range||t.refRange;o.push((a==null?void 0:a.min)??0)}return o}static get all(){return[...new Set(Object.values(oo.registry))]}static register(o,e){if(arguments.length===1&&(e=arguments[0],o=e.id),e=this.get(e),this.registry[o]&&this.registry[o]!==e)throw new Error(`Duplicate color space registration: '${o}'`);if(this.registry[o]=e,arguments.length===1&&e.aliases)for(let t of e.aliases)this.register(t,e);return e}static get(o,...e){if(!o||o instanceof oo)return o;if(co(o)==="string"){let t=oo.registry[o.toLowerCase()];if(!t)throw new TypeError(`No color space found with id = "${o}"`);return t}if(e.length)return oo.get(...e);throw new TypeError(`${o} is not a valid color space`)}static resolveCoord(o,e){var t;let a=co(o),l,s;if(a==="string"?o.includes(".")?[l,s]=o.split("."):[l,s]=[,o]:Array.isArray(o)?[l,s]=o:(l=o.space,s=o.coordId),l=oo.get(l),l||(l=e),!l)throw new TypeError(`Cannot resolve coordinate reference ${o}: No color space specified and relative references are not allowed here`);if(a=co(s),a==="number"||a==="string"&&s>=0){let c=Object.entries(l.coords)[s];if(c)return{space:l,id:c[0],index:s,...c[1]}}l=oo.get(l);let n=s.toLowerCase(),i=0;for(let c in l.coords){let u=l.coords[c];if(c.toLowerCase()===n||((t=u.name)==null?void 0:t.toLowerCase())===n)return{space:l,id:c,index:i,...u};i++}throw new TypeError(`No "${s}" coordinate found in ${l.name}. Its coordinates are: ${Object.keys(l.coords).join(", ")}`)}};Qe(Me,"registry",{}),Qe(Me,"DEFAULT_FORMAT",{type:"functions",name:"color"});let g=Me;function Ca(r){let o=[r];for(let e=r;e=e.base;)o.push(e);return o}function ar(r,{coords:o}={}){if(r.coords&&!r.coordGrammar){r.type||(r.type="function"),r.name||(r.name="color"),r.coordGrammar=zt(r.coords);let e=Object.entries(o).map(([t,a],l)=>{let s=r.coordGrammar[l][0],n=a.range||a.refRange,i=s.range,c="";return s=="<percentage>"?(i=[0,100],c="%"):s=="<angle>"&&(c="deg"),{fromRange:n,toRange:i,suffix:c}});r.serializeCoords=(t,a)=>t.map((l,s)=>{let{fromRange:n,toRange:i,suffix:c}=e[s];return n&&i&&(l=Oe(n,i,l)),l=re(l,{precision:a,unit:c}),l})}return r}var N=new g({id:"xyz-d65",name:"XYZ D65",coords:{x:{name:"X"},y:{name:"Y"},z:{name:"Z"}},white:"D65",formats:{color:{ids:["xyz-d65","xyz"]}},aliases:["xyz"]});let T=class extends g{constructor(o){o.coords||(o.coords={r:{range:[0,1],name:"Red"},g:{range:[0,1],name:"Green"},b:{range:[0,1],name:"Blue"}}),o.base||(o.base=N),o.toXYZ_M&&o.fromXYZ_M&&(o.toBase??(o.toBase=e=>{let t=$(o.toXYZ_M,e);return this.white!==this.base.white&&(t=te(this.white,this.base.white,t)),t}),o.fromBase??(o.fromBase=e=>(e=te(this.base.white,this.white,e),$(o.fromXYZ_M,e)))),o.referred??(o.referred="display"),super(o)}};function Lo(r,o){return r=v(r),!o||r.space.equals(o)?r.coords.slice():(o=g.get(o),o.from(r))}function X(r,o){r=v(r);let{space:e,index:t}=g.resolveCoord(o,r.space);return Lo(r,e)[t]}function Fe(r,o,e){return r=v(r),o=g.get(o),r.coords=o.to(r.space,e),r}Fe.returns="color";function so(r,o,e){if(r=v(r),arguments.length===2&&co(arguments[1])==="object"){let t=arguments[1];for(let a in t)so(r,a,t[a])}else{typeof e=="function"&&(e=e(X(r,o)));let{space:t,index:a}=g.resolveCoord(o,r.space),l=Lo(r,t);l[a]=e,Fe(r,t,l)}return r}so.returns="color";var Le=new g({id:"xyz-d50",name:"XYZ D50",white:"D50",base:N,fromBase:r=>te(N.white,"D50",r),toBase:r=>te("D50",N.white,r)});const ka=216/24389,lr=24/116,To=24389/27;let de=D.D50;var Y=new g({id:"lab",name:"Lab",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:de,base:Le,fromBase(r){let o=r.map((e,t)=>e/de[t]).map(e=>e>ka?Math.cbrt(e):(To*e+16)/116);return[116*o[1]-16,500*(o[0]-o[1]),200*(o[1]-o[2])]},toBase(r){let o=[];return o[1]=(r[0]+16)/116,o[0]=r[1]/500+o[1],o[2]=o[1]-r[2]/200,[o[0]>lr?Math.pow(o[0],3):(116*o[0]-16)/To,r[0]>8?Math.pow((r[0]+16)/116,3):r[0]/To,o[2]>lr?Math.pow(o[2],3):(116*o[2]-16)/To].map((e,t)=>e*de[t])},formats:{lab:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function to(r){return(r%360+360)%360}function Ma(r,o){if(r==="raw")return o;let[e,t]=o.map(to),a=t-e;return r==="increasing"?a<0&&(t+=360):r==="decreasing"?a>0&&(e+=360):r==="longer"?-180<a&&a<180&&(a>0?e+=360:t+=360):r==="shorter"&&(a>180?e+=360:a<-180&&(t+=360)),[e,t]}var Oo=new g({id:"lch",name:"LCH",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,150],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Y,fromBase(r){let[o,e,t]=r,a;const l=.02;return Math.abs(e)<l&&Math.abs(t)<l?a=NaN:a=Math.atan2(t,e)*180/Math.PI,[o,Math.sqrt(e**2+t**2),to(a)]},toBase(r){let[o,e,t]=r;return e<0&&(e=0),isNaN(t)&&(t=0),[o,e*Math.cos(t*Math.PI/180),e*Math.sin(t*Math.PI/180)]},formats:{lch:{coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}});const sr=25**7,ae=Math.PI,nr=180/ae,wo=ae/180;function ir(r){const o=r*r;return o*o*o*r}function xt(r,o,{kL:e=1,kC:t=1,kH:a=1}={}){[r,o]=v([r,o]);let[l,s,n]=Y.from(r),i=Oo.from(Y,[l,s,n])[1],[c,u,h]=Y.from(o),m=Oo.from(Y,[c,u,h])[1];i<0&&(i=0),m<0&&(m=0);let f=(i+m)/2,b=ir(f),p=.5*(1-Math.sqrt(b/(b+sr))),z=(1+p)*s,w=(1+p)*u,y=Math.sqrt(z**2+n**2),C=Math.sqrt(w**2+h**2),x=z===0&&n===0?0:Math.atan2(n,z),k=w===0&&h===0?0:Math.atan2(h,w);x<0&&(x+=2*ae),k<0&&(k+=2*ae),x*=nr,k*=nr;let S=c-l,F=C-y,E=k-x,Ao=x+k,Ue=Math.abs(E),Ro;y*C===0?Ro=0:Ue<=180?Ro=E:E>180?Ro=E-360:E<-180?Ro=E+360:G.warn("the unthinkable has happened");let Xe=2*Math.sqrt(C*y)*Math.sin(Ro*wo/2),ra=(l+c)/2,he=(y+C)/2,Ye=ir(he),lo;y*C===0?lo=Ao:Ue<=180?lo=Ao/2:Ao<360?lo=(Ao+360)/2:lo=(Ao-360)/2;let Ge=(ra-50)**2,ta=1+.015*Ge/Math.sqrt(20+Ge),Ze=1+.045*he,Po=1;Po-=.17*Math.cos((lo-30)*wo),Po+=.24*Math.cos(2*lo*wo),Po+=.32*Math.cos((3*lo+6)*wo),Po-=.2*Math.cos((4*lo-63)*wo);let Ke=1+.015*he*Po,aa=30*Math.exp(-1*((lo-275)/25)**2),la=2*Math.sqrt(Ye/(Ye+sr)),sa=-1*Math.sin(2*aa*wo)*la,jo=(S/(e*ta))**2;return jo+=(F/(t*Ze))**2,jo+=(Xe/(a*Ke))**2,jo+=sa*(F/(t*Ze))*(Xe/(a*Ke)),Math.sqrt(jo)}const $a=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],Sa=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],_a=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],Ea=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]];var Mo=new g({id:"oklab",name:"Oklab",coords:{l:{refRange:[0,1],name:"Lightness"},a:{refRange:[-.4,.4]},b:{refRange:[-.4,.4]}},white:"D65",base:N,fromBase(r){let o=$($a,r).map(e=>Math.cbrt(e));return $(_a,o)},toBase(r){let o=$(Ea,r).map(e=>e**3);return $(Sa,o)},formats:{oklab:{coords:["<percentage> | <number>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});function $e(r,o){[r,o]=v([r,o]);let[e,t,a]=Mo.from(r),[l,s,n]=Mo.from(o),i=e-l,c=t-s,u=a-n;return Math.sqrt(i**2+c**2+u**2)}const Aa=75e-6;function zo(r,o,{epsilon:e=Aa}={}){r=v(r),o||(o=r.space),o=g.get(o);let t=r.coords;return o!==r.space&&(t=o.from(r)),o.inGamut(t,{epsilon:e})}function $o(r){return{space:r.space,coords:r.coords.slice(),alpha:r.alpha}}function Ct(r,o,e="lab"){e=g.get(e);let t=e.from(r),a=e.from(o);return Math.sqrt(t.reduce((l,s,n)=>{let i=a[n];return isNaN(s)||isNaN(i)?l:l+(i-s)**2},0))}function Ra(r,o){return Ct(r,o,"lab")}const Pa=Math.PI,cr=Pa/180;function Ha(r,o,{l:e=2,c:t=1}={}){[r,o]=v([r,o]);let[a,l,s]=Y.from(r),[,n,i]=Oo.from(Y,[a,l,s]),[c,u,h]=Y.from(o),m=Oo.from(Y,[c,u,h])[1];n<0&&(n=0),m<0&&(m=0);let f=a-c,b=n-m,p=l-u,z=s-h,w=p**2+z**2-b**2,y=.511;a>=16&&(y=.040975*a/(1+.01765*a));let C=.0638*n/(1+.0131*n)+.638,x;Number.isNaN(i)&&(i=0),i>=164&&i<=345?x=.56+Math.abs(.2*Math.cos((i+168)*cr)):x=.36+Math.abs(.4*Math.cos((i+35)*cr));let k=Math.pow(n,4),S=Math.sqrt(k/(k+1900)),F=C*(S*x+1-S),E=(f/(e*y))**2;return E+=(b/(t*C))**2,E+=w/F**2,Math.sqrt(E)}const ur=203;var De=new g({id:"xyz-abs-d65",cssId:"--xyz-abs-d65",name:"Absolute XYZ D65",coords:{x:{refRange:[0,9504.7],name:"Xa"},y:{refRange:[0,1e4],name:"Ya"},z:{refRange:[0,10888.3],name:"Za"}},base:N,fromBase(r){return r.map(o=>Math.max(o*ur,0))},toBase(r){return r.map(o=>Math.max(o/ur,0))}});const qo=1.15,Wo=.66,hr=2610/2**14,Ba=2**14/2610,dr=3424/2**12,mr=2413/2**7,pr=2392/2**7,Na=1.7*2523/2**5,gr=2**5/(1.7*2523),Uo=-.56,me=16295499532821565e-27,Oa=[[.41478972,.579999,.014648],[-.20151,1.120649,.0531008],[-.0166008,.2648,.6684799]],Ia=[[1.9242264357876067,-1.0047923125953657,.037651404030618],[.35031676209499907,.7264811939316552,-.06538442294808501],[-.09098281098284752,-.3127282905230739,1.5227665613052603]],Fa=[[.5,.5,0],[3.524,-4.066708,.542708],[.199076,1.096799,-1.295875]],La=[[1,.1386050432715393,.05804731615611886],[.9999999999999999,-.1386050432715393,-.05804731615611886],[.9999999999999998,-.09601924202631895,-.8118918960560388]];var kt=new g({id:"jzazbz",name:"Jzazbz",coords:{jz:{refRange:[0,1],name:"Jz"},az:{refRange:[-.5,.5]},bz:{refRange:[-.5,.5]}},base:De,fromBase(r){let[o,e,t]=r,a=qo*o-(qo-1)*t,l=Wo*e-(Wo-1)*o,s=$(Oa,[a,l,t]).map(function(u){let h=dr+mr*(u/1e4)**hr,m=1+pr*(u/1e4)**hr;return(h/m)**Na}),[n,i,c]=$(Fa,s);return[(1+Uo)*n/(1+Uo*n)-me,i,c]},toBase(r){let[o,e,t]=r,a=(o+me)/(1+Uo-Uo*(o+me)),l=$(La,[a,e,t]).map(function(h){let m=dr-h**gr,f=pr*h**gr-mr;return 1e4*(m/f)**Ba}),[s,n,i]=$(Ia,l),c=(s+(qo-1)*i)/qo,u=(n+(Wo-1)*c)/Wo;return[c,u,i]},formats:{color:{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),Se=new g({id:"jzczhz",name:"JzCzHz",coords:{jz:{refRange:[0,1],name:"Jz"},cz:{refRange:[0,1],name:"Chroma"},hz:{refRange:[0,360],type:"angle",name:"Hue"}},base:kt,fromBase(r){let[o,e,t]=r,a;const l=2e-4;return Math.abs(e)<l&&Math.abs(t)<l?a=NaN:a=Math.atan2(t,e)*180/Math.PI,[o,Math.sqrt(e**2+t**2),to(a)]},toBase(r){return[r[0],r[1]*Math.cos(r[2]*Math.PI/180),r[1]*Math.sin(r[2]*Math.PI/180)]}});function Da(r,o){[r,o]=v([r,o]);let[e,t,a]=Se.from(r),[l,s,n]=Se.from(o),i=e-l,c=t-s;Number.isNaN(a)&&Number.isNaN(n)?(a=0,n=0):Number.isNaN(a)?a=n:Number.isNaN(n)&&(n=a);let u=a-n,h=2*Math.sqrt(t*s)*Math.sin(u/2*(Math.PI/180));return Math.sqrt(i**2+c**2+h**2)}const Mt=3424/4096,$t=2413/128,St=2392/128,fr=2610/16384,ja=2523/32,Ta=16384/2610,br=32/2523,qa=[[.3592832590121217,.6976051147779502,-.035891593232029],[-.1920808463704993,1.100476797037432,.0753748658519118],[.0070797844607479,.0748396662186362,.8433265453898765]],Wa=[[2048/4096,2048/4096,0],[6610/4096,-13613/4096,7003/4096],[17933/4096,-17390/4096,-543/4096]],Ua=[[.9999999999999998,.0086090370379328,.111029625003026],[.9999999999999998,-.0086090370379328,-.1110296250030259],[.9999999999999998,.5600313357106791,-.3206271749873188]],Xa=[[2.0701522183894223,-1.3263473389671563,.2066510476294053],[.3647385209748072,.6805660249472273,-.0453045459220347],[-.0497472075358123,-.0492609666966131,1.1880659249923042]];var _e=new g({id:"ictcp",name:"ICTCP",coords:{i:{refRange:[0,1],name:"I"},ct:{refRange:[-.5,.5],name:"CT"},cp:{refRange:[-.5,.5],name:"CP"}},base:De,fromBase(r){let o=$(qa,r);return Ya(o)},toBase(r){let o=Ga(r);return $(Xa,o)}});function Ya(r){let o=r.map(function(e){let t=Mt+$t*(e/1e4)**fr,a=1+St*(e/1e4)**fr;return(t/a)**ja});return $(Wa,o)}function Ga(r){return $(Ua,r).map(function(o){let e=Math.max(o**br-Mt,0),t=$t-St*o**br;return 1e4*(e/t)**Ta})}function Za(r,o){[r,o]=v([r,o]);let[e,t,a]=_e.from(r),[l,s,n]=_e.from(o);return 720*Math.sqrt((e-l)**2+.25*(t-s)**2+(a-n)**2)}const Ka=D.D65,_t=.42,zr=1/_t,pe=2*Math.PI,Et=[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],Va=[[1.8620678550872327,-1.0112546305316843,.14918677544445175],[.38752654323613717,.6214474419314753,-.008973985167612518],[-.015841498849333856,-.03412293802851557,1.0499644368778496]],Ja=[[460,451,288],[460,-891,-261],[460,-220,-6300]],Qa={dark:[.8,.525,.8],dim:[.9,.59,.9],average:[1,.69,1]},fo={h:[20.14,90,164.25,237.53,380.14],e:[.8,.7,1,1.2,.8],H:[0,100,200,300,400]},ol=180/Math.PI,vr=Math.PI/180;function At(r,o){return r.map(e=>{const t=ro(o*Math.abs(e)*.01,_t);return 400*ne(t,e)/(t+27.13)})}function el(r,o){const e=100/o*27.13**zr;return r.map(t=>{const a=Math.abs(t);return ne(e*ro(a/(400-a),zr),t)})}function rl(r){let o=to(r);o<=fo.h[0]&&(o+=360);const e=wt(fo.h,o)-1,[t,a]=fo.h.slice(e,e+2),[l,s]=fo.e.slice(e,e+2),n=fo.H[e],i=(o-t)/l;return n+100*i/(i+(a-o)/s)}function tl(r){let o=(r%400+400)%400;const e=Math.floor(.01*o);o=o%100;const[t,a]=fo.h.slice(e,e+2),[l,s]=fo.e.slice(e,e+2);return to((o*(s*t-l*a)-100*t*s)/(o*(s-l)-100*s))}function Rt(r,o,e,t,a){const l={};l.discounting=a,l.refWhite=r,l.surround=t;const s=r.map(b=>b*100);l.la=o,l.yb=e;const n=s[1],i=$(Et,s);t=Qa[l.surround];const c=t[0];l.c=t[1],l.nc=t[2];const u=(1/(5*l.la+1))**4;l.fl=u*l.la+.1*(1-u)*(1-u)*Math.cbrt(5*l.la),l.flRoot=l.fl**.25,l.n=l.yb/n,l.z=1.48+Math.sqrt(l.n),l.nbb=.725*l.n**-.2,l.ncb=l.nbb;const h=Math.max(Math.min(c*(1-1/3.6*Math.exp((-l.la-42)/92)),1),0);l.dRgb=i.map(b=>No(1,n/b,h)),l.dRgbInv=l.dRgb.map(b=>1/b);const m=i.map((b,p)=>b*l.dRgb[p]),f=At(m,l.fl);return l.aW=l.nbb*(2*f[0]+f[1]+.05*f[2]),l}const wr=Rt(Ka,64/Math.PI*.2,20,"average",!1);function Ee(r,o){if(!(r.J!==void 0^r.Q!==void 0))throw new Error("Conversion requires one and only one: 'J' or 'Q'");if(!(r.C!==void 0^r.M!==void 0^r.s!==void 0))throw new Error("Conversion requires one and only one: 'C', 'M' or 's'");if(!(r.h!==void 0^r.H!==void 0))throw new Error("Conversion requires one and only one: 'h' or 'H'");if(r.J===0||r.Q===0)return[0,0,0];let e=0;r.h!==void 0?e=to(r.h)*vr:e=tl(r.H)*vr;const t=Math.cos(e),a=Math.sin(e);let l=0;r.J!==void 0?l=ro(r.J,1/2)*.1:r.Q!==void 0&&(l=.25*o.c*r.Q/((o.aW+4)*o.flRoot));let s=0;r.C!==void 0?s=r.C/l:r.M!==void 0?s=r.M/o.flRoot/l:r.s!==void 0&&(s=4e-4*r.s**2*(o.aW+4)/o.c);const n=ro(s*Math.pow(1.64-Math.pow(.29,o.n),-.73),10/9),i=.25*(Math.cos(e+2)+3.8),c=o.aW*ro(l,2/o.c/o.z),u=5e4/13*o.nc*o.ncb*i,h=c/o.nbb,m=23*(h+.305)*Ie(n,23*u+n*(11*t+108*a)),f=m*t,b=m*a,p=el($(Ja,[h,f,b]).map(z=>z*1/1403),o.fl);return $(Va,p.map((z,w)=>z*o.dRgbInv[w])).map(z=>z/100)}function Pt(r,o){const e=r.map(C=>C*100),t=At($(Et,e).map((C,x)=>C*o.dRgb[x]),o.fl),a=t[0]+(-12*t[1]+t[2])/11,l=(t[0]+t[1]-2*t[2])/9,s=(Math.atan2(l,a)%pe+pe)%pe,n=.25*(Math.cos(s+2)+3.8),i=5e4/13*o.nc*o.ncb*Ie(n*Math.sqrt(a**2+l**2),t[0]+t[1]+1.05*t[2]+.305),c=ro(i,.9)*Math.pow(1.64-Math.pow(.29,o.n),.73),u=o.nbb*(2*t[0]+t[1]+.05*t[2]),h=ro(u/o.aW,.5*o.c*o.z),m=100*ro(h,2),f=4/o.c*h*(o.aW+4)*o.flRoot,b=c*h,p=b*o.flRoot,z=to(s*ol),w=rl(z),y=50*ro(o.c*c/(o.aW+4),1/2);return{J:m,C:b,h:z,s:y,Q:f,M:p,H:w}}var al=new g({id:"cam16-jmh",cssId:"--cam16-jmh",name:"CAM16-JMh",coords:{j:{refRange:[0,100],name:"J"},m:{refRange:[0,105],name:"Colorfulness"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:N,fromBase(r){const o=Pt(r,wr);return[o.J,o.M,o.h]},toBase(r){return Ee({J:r[0],M:r[1],h:r[2]},wr)}});const ll=D.D65,sl=216/24389,Ht=24389/27;function nl(r){return 116*(r>sl?Math.cbrt(r):(Ht*r+16)/116)-16}function Ae(r){return r>8?Math.pow((r+16)/116,3):r/Ht}function il(r,o){let[e,t,a]=r,l=[],s=0;if(a===0)return[0,0,0];let n=Ae(a);a>0?s=.00379058511492914*a**2+.608983189401032*a+.9155088574762233:s=9514440756550361e-21*a**2+.08693057439788597*a-21.928975842194614;const i=2e-12,c=15;let u=0,h=1/0;for(;u<=c;){l=Ee({J:s,C:t,h:e},o);const m=Math.abs(l[1]-n);if(m<h){if(m<=i)return l;h=m}s=s-(l[1]-n)*s/(2*l[1]),u+=1}return Ee({J:s,C:t,h:e},o)}function cl(r,o){const e=nl(r[1]);if(e===0)return[0,0,0];const t=Pt(r,je);return[to(t.h),t.C,e]}const je=Rt(ll,200/Math.PI*Ae(50),Ae(50)*100,"average",!1);var Io=new g({id:"hct",name:"HCT",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},c:{refRange:[0,145],name:"Colorfulness"},t:{refRange:[0,100],name:"Tone"}},base:N,fromBase(r){return cl(r)},toBase(r){return il(r,je)},formats:{color:{id:"--hct",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});const ul=Math.PI/180,yr=[1,.007,.0228];function xr(r){r[1]<0&&(r=Io.fromBase(Io.toBase(r)));const o=Math.log(Math.max(1+yr[2]*r[1]*je.flRoot,1))/yr[2],e=r[0]*ul,t=o*Math.cos(e),a=o*Math.sin(e);return[r[2],t,a]}function hl(r,o){[r,o]=v([r,o]);let[e,t,a]=xr(Io.from(r)),[l,s,n]=xr(Io.from(o));return Math.sqrt((e-l)**2+(t-s)**2+(a-n)**2)}var So={deltaE76:Ra,deltaECMC:Ha,deltaE2000:xt,deltaEJz:Da,deltaEITP:Za,deltaEOK:$e,deltaEHCT:hl};function dl(r){const o=r?Math.floor(Math.log10(Math.abs(r))):0;return Math.max(parseFloat(`1e${o-2}`),1e-6)}const Cr={hct:{method:"hct.c",jnd:2,deltaEMethod:"hct",blackWhiteClamp:{}},"hct-tonal":{method:"hct.c",jnd:0,deltaEMethod:"hct",blackWhiteClamp:{channel:"hct.t",min:0,max:100}}};function mo(r,{method:o=G.gamut_mapping,space:e=void 0,deltaEMethod:t="",jnd:a=2,blackWhiteClamp:l={}}={}){if(r=v(r),Fo(arguments[1])?e=arguments[1]:e||(e=r.space),e=g.get(e),zo(r,e,{epsilon:0}))return r;let s;if(o==="css")s=ml(r,{space:e});else{if(o!=="clip"&&!zo(r,e)){Object.prototype.hasOwnProperty.call(Cr,o)&&({method:o,jnd:a,deltaEMethod:t,blackWhiteClamp:l}=Cr[o]);let n=xt;if(t!==""){for(let c in So)if("deltae"+t.toLowerCase()===c.toLowerCase()){n=So[c];break}}let i=mo(M(r,e),{method:"clip",space:e});if(n(r,i)>a){if(Object.keys(l).length===3){let w=g.resolveCoord(l.channel),y=X(M(r,w.space),w.id);if(uo(y)&&(y=0),y>=l.max)return M({space:"xyz-d65",coords:D.D65},r.space);if(y<=l.min)return M({space:"xyz-d65",coords:[0,0,0]},r.space)}let c=g.resolveCoord(o),u=c.space,h=c.id,m=M(r,u);m.coords.forEach((w,y)=>{uo(w)&&(m.coords[y]=0)});let f=(c.range||c.refRange)[0],b=dl(a),p=f,z=X(m,h);for(;z-p>b;){let w=$o(m);w=mo(w,{space:e,method:"clip"}),n(m,w)-a<b?p=X(m,h):z=X(m,h),so(m,h,(p+z)/2)}s=M(m,e)}else s=i}else s=M(r,e);if(o==="clip"||!zo(s,e,{epsilon:0})){let n=Object.values(e.coords).map(i=>i.range||[]);s.coords=s.coords.map((i,c)=>{let[u,h]=n[c];return u!==void 0&&(i=Math.max(u,i)),h!==void 0&&(i=Math.min(i,h)),i})}}return e!==r.space&&(s=M(s,r.space)),r.coords=s.coords,r}mo.returns="color";const kr={WHITE:{space:Mo,coords:[1,0,0]},BLACK:{space:Mo,coords:[0,0,0]}};function ml(r,{space:o}={}){r=v(r),o||(o=r.space),o=g.get(o);const e=g.get("oklch");if(o.isUnbounded)return M(r,o);const t=M(r,e);let a=t.coords[0];if(a>=1){const m=M(kr.WHITE,o);return m.alpha=r.alpha,M(m,o)}if(a<=0){const m=M(kr.BLACK,o);return m.alpha=r.alpha,M(m,o)}if(zo(t,o,{epsilon:0}))return M(t,o);function l(m){const f=M(m,o),b=Object.values(o.coords);return f.coords=f.coords.map((p,z)=>{if("range"in b[z]){const[w,y]=b[z].range;return vt(w,p,y)}return p}),f}let s=0,n=t.coords[1],i=!0,c=$o(t),u=l(c),h=$e(u,c);if(h<.02)return u;for(;n-s>1e-4;){const m=(s+n)/2;if(c.coords[1]=m,i&&zo(c,o,{epsilon:0}))s=m;else if(u=l(c),h=$e(u,c),h<.02){if(.02-h<1e-4)break;i=!1,s=m}else n=m}return u}function M(r,o,{inGamut:e}={}){r=v(r),o=g.get(o);let t=o.from(r),a={space:o,coords:t,alpha:r.alpha};return e&&(a=mo(a,e===!0?void 0:e)),a}M.returns="color";function Bo(r,{precision:o=G.precision,format:e="default",inGamut:t=!0,...a}={}){var l;let s;r=v(r);let n=e;e=r.space.getFormat(e)??r.space.getFormat("default")??g.DEFAULT_FORMAT;let i=r.coords.slice();if(t||(t=e.toGamut),t&&!zo(r)&&(i=mo($o(r),t===!0?void 0:t).coords),e.type==="custom")if(a.precision=o,e.serialize)s=e.serialize(i,r.alpha,a);else throw new TypeError(`format ${n} can only be used to parse colors, not for serialization`);else{let c=e.name||"color";e.serializeCoords?i=e.serializeCoords(i,o):o!==null&&(i=i.map(f=>re(f,{precision:o})));let u=[...i];if(c==="color"){let f=e.id||((l=e.ids)==null?void 0:l[0])||r.space.id;u.unshift(f)}let h=r.alpha;o!==null&&(h=re(h,{precision:o}));let m=r.alpha>=1||e.noAlpha?"":`${e.commas?",":" /"} ${h}`;s=`${c}(${u.join(e.commas?", ":" ")}${m})`}return s}const pl=[[.6369580483012914,.14461690358620832,.1688809751641721],[.2627002120112671,.6779980715188708,.05930171646986196],[0,.028072693049087428,1.060985057710791]],gl=[[1.716651187971268,-.355670783776392,-.25336628137366],[-.666684351832489,1.616481236634939,.0157685458139111],[.017639857445311,-.042770613257809,.942103121235474]];var ie=new T({id:"rec2020-linear",cssId:"--rec2020-linear",name:"Linear REC.2020",white:"D65",toXYZ_M:pl,fromXYZ_M:gl});const Xo=1.09929682680944,Mr=.018053968510807;var Bt=new T({id:"rec2020",name:"REC.2020",base:ie,toBase(r){return r.map(function(o){return o<Mr*4.5?o/4.5:Math.pow((o+Xo-1)/Xo,1/.45)})},fromBase(r){return r.map(function(o){return o>=Mr?Xo*Math.pow(o,.45)-(Xo-1):4.5*o})}});const fl=[[.4865709486482162,.26566769316909306,.1982172852343625],[.2289745640697488,.6917385218365064,.079286914093745],[0,.04511338185890264,1.043944368900976]],bl=[[2.493496911941425,-.9313836179191239,-.40271078445071684],[-.8294889695615747,1.7626640603183463,.023624685841943577],[.03584583024378447,-.07617238926804182,.9568845240076872]];var Nt=new T({id:"p3-linear",cssId:"--display-p3-linear",name:"Linear P3",white:"D65",toXYZ_M:fl,fromXYZ_M:bl});const zl=[[.41239079926595934,.357584339383878,.1804807884018343],[.21263900587151027,.715168678767756,.07219231536073371],[.01933081871559182,.11919477979462598,.9505321522496607]],H=[[3.2409699419045226,-1.537383177570094,-.4986107602930034],[-.9692436362808796,1.8759675015077202,.04155505740717559],[.05563007969699366,-.20397695888897652,1.0569715142428786]];var Ot=new T({id:"srgb-linear",name:"Linear sRGB",white:"D65",toXYZ_M:zl,fromXYZ_M:H}),$r={aliceblue:[240/255,248/255,1],antiquewhite:[250/255,235/255,215/255],aqua:[0,1,1],aquamarine:[127/255,1,212/255],azure:[240/255,1,1],beige:[245/255,245/255,220/255],bisque:[1,228/255,196/255],black:[0,0,0],blanchedalmond:[1,235/255,205/255],blue:[0,0,1],blueviolet:[138/255,43/255,226/255],brown:[165/255,42/255,42/255],burlywood:[222/255,184/255,135/255],cadetblue:[95/255,158/255,160/255],chartreuse:[127/255,1,0],chocolate:[210/255,105/255,30/255],coral:[1,127/255,80/255],cornflowerblue:[100/255,149/255,237/255],cornsilk:[1,248/255,220/255],crimson:[220/255,20/255,60/255],cyan:[0,1,1],darkblue:[0,0,139/255],darkcyan:[0,139/255,139/255],darkgoldenrod:[184/255,134/255,11/255],darkgray:[169/255,169/255,169/255],darkgreen:[0,100/255,0],darkgrey:[169/255,169/255,169/255],darkkhaki:[189/255,183/255,107/255],darkmagenta:[139/255,0,139/255],darkolivegreen:[85/255,107/255,47/255],darkorange:[1,140/255,0],darkorchid:[153/255,50/255,204/255],darkred:[139/255,0,0],darksalmon:[233/255,150/255,122/255],darkseagreen:[143/255,188/255,143/255],darkslateblue:[72/255,61/255,139/255],darkslategray:[47/255,79/255,79/255],darkslategrey:[47/255,79/255,79/255],darkturquoise:[0,206/255,209/255],darkviolet:[148/255,0,211/255],deeppink:[1,20/255,147/255],deepskyblue:[0,191/255,1],dimgray:[105/255,105/255,105/255],dimgrey:[105/255,105/255,105/255],dodgerblue:[30/255,144/255,1],firebrick:[178/255,34/255,34/255],floralwhite:[1,250/255,240/255],forestgreen:[34/255,139/255,34/255],fuchsia:[1,0,1],gainsboro:[220/255,220/255,220/255],ghostwhite:[248/255,248/255,1],gold:[1,215/255,0],goldenrod:[218/255,165/255,32/255],gray:[128/255,128/255,128/255],green:[0,128/255,0],greenyellow:[173/255,1,47/255],grey:[128/255,128/255,128/255],honeydew:[240/255,1,240/255],hotpink:[1,105/255,180/255],indianred:[205/255,92/255,92/255],indigo:[75/255,0,130/255],ivory:[1,1,240/255],khaki:[240/255,230/255,140/255],lavender:[230/255,230/255,250/255],lavenderblush:[1,240/255,245/255],lawngreen:[124/255,252/255,0],lemonchiffon:[1,250/255,205/255],lightblue:[173/255,216/255,230/255],lightcoral:[240/255,128/255,128/255],lightcyan:[224/255,1,1],lightgoldenrodyellow:[250/255,250/255,210/255],lightgray:[211/255,211/255,211/255],lightgreen:[144/255,238/255,144/255],lightgrey:[211/255,211/255,211/255],lightpink:[1,182/255,193/255],lightsalmon:[1,160/255,122/255],lightseagreen:[32/255,178/255,170/255],lightskyblue:[135/255,206/255,250/255],lightslategray:[119/255,136/255,153/255],lightslategrey:[119/255,136/255,153/255],lightsteelblue:[176/255,196/255,222/255],lightyellow:[1,1,224/255],lime:[0,1,0],limegreen:[50/255,205/255,50/255],linen:[250/255,240/255,230/255],magenta:[1,0,1],maroon:[128/255,0,0],mediumaquamarine:[102/255,205/255,170/255],mediumblue:[0,0,205/255],mediumorchid:[186/255,85/255,211/255],mediumpurple:[147/255,112/255,219/255],mediumseagreen:[60/255,179/255,113/255],mediumslateblue:[123/255,104/255,238/255],mediumspringgreen:[0,250/255,154/255],mediumturquoise:[72/255,209/255,204/255],mediumvioletred:[199/255,21/255,133/255],midnightblue:[25/255,25/255,112/255],mintcream:[245/255,1,250/255],mistyrose:[1,228/255,225/255],moccasin:[1,228/255,181/255],navajowhite:[1,222/255,173/255],navy:[0,0,128/255],oldlace:[253/255,245/255,230/255],olive:[128/255,128/255,0],olivedrab:[107/255,142/255,35/255],orange:[1,165/255,0],orangered:[1,69/255,0],orchid:[218/255,112/255,214/255],palegoldenrod:[238/255,232/255,170/255],palegreen:[152/255,251/255,152/255],paleturquoise:[175/255,238/255,238/255],palevioletred:[219/255,112/255,147/255],papayawhip:[1,239/255,213/255],peachpuff:[1,218/255,185/255],peru:[205/255,133/255,63/255],pink:[1,192/255,203/255],plum:[221/255,160/255,221/255],powderblue:[176/255,224/255,230/255],purple:[128/255,0,128/255],rebeccapurple:[102/255,51/255,153/255],red:[1,0,0],rosybrown:[188/255,143/255,143/255],royalblue:[65/255,105/255,225/255],saddlebrown:[139/255,69/255,19/255],salmon:[250/255,128/255,114/255],sandybrown:[244/255,164/255,96/255],seagreen:[46/255,139/255,87/255],seashell:[1,245/255,238/255],sienna:[160/255,82/255,45/255],silver:[192/255,192/255,192/255],skyblue:[135/255,206/255,235/255],slateblue:[106/255,90/255,205/255],slategray:[112/255,128/255,144/255],slategrey:[112/255,128/255,144/255],snow:[1,250/255,250/255],springgreen:[0,1,127/255],steelblue:[70/255,130/255,180/255],tan:[210/255,180/255,140/255],teal:[0,128/255,128/255],thistle:[216/255,191/255,216/255],tomato:[1,99/255,71/255],turquoise:[64/255,224/255,208/255],violet:[238/255,130/255,238/255],wheat:[245/255,222/255,179/255],white:[1,1,1],whitesmoke:[245/255,245/255,245/255],yellow:[1,1,0],yellowgreen:[154/255,205/255,50/255]};let Sr=Array(3).fill("<percentage> | <number>[0, 255]"),_r=Array(3).fill("<number>[0, 255]");var _o=new T({id:"srgb",name:"sRGB",base:Ot,fromBase:r=>r.map(o=>{let e=o<0?-1:1,t=o*e;return t>.0031308?e*(1.055*t**(1/2.4)-.055):12.92*o}),toBase:r=>r.map(o=>{let e=o<0?-1:1,t=o*e;return t<=.04045?o/12.92:e*((t+.055)/1.055)**2.4}),formats:{rgb:{coords:Sr},rgb_number:{name:"rgb",commas:!0,coords:_r,noAlpha:!0},color:{},rgba:{coords:Sr,commas:!0,lastAlpha:!0},rgba_number:{name:"rgba",commas:!0,coords:_r},hex:{type:"custom",toGamut:!0,test:r=>/^#([a-f0-9]{3,4}){1,2}$/i.test(r),parse(r){r.length<=5&&(r=r.replace(/[a-f0-9]/gi,"$&$&"));let o=[];return r.replace(/[a-f0-9]{2}/gi,e=>{o.push(parseInt(e,16)/255)}),{spaceId:"srgb",coords:o.slice(0,3),alpha:o.slice(3)[0]}},serialize:(r,o,{collapse:e=!0}={})=>{o<1&&r.push(o),r=r.map(a=>Math.round(a*255));let t=e&&r.every(a=>a%17===0);return"#"+r.map(a=>t?(a/17).toString(16):a.toString(16).padStart(2,"0")).join("")}},keyword:{type:"custom",test:r=>/^[a-z]+$/i.test(r),parse(r){r=r.toLowerCase();let o={spaceId:"srgb",coords:null,alpha:1};if(r==="transparent"?(o.coords=$r.black,o.alpha=0):o.coords=$r[r],o.coords)return o}}}}),It=new T({id:"p3",cssId:"display-p3",name:"P3",base:Nt,fromBase:_o.fromBase,toBase:_o.toBase});G.display_space=_o;let Er;if(typeof CSS<"u"&&CSS.supports)for(let r of[Y,Bt,It]){let o=r.getMinCoords(),e=Bo({space:r,coords:o,alpha:1});if(CSS.supports("color",e)){G.display_space=r;break}}function vl(r,{space:o=G.display_space,...e}={}){let t=Bo(r,e);if(typeof CSS>"u"||CSS.supports("color",t)||!G.display_space)t=new String(t),t.color=r;else{let a=r;if((r.coords.some(uo)||uo(r.alpha))&&!(Er??(Er=CSS.supports("color","hsl(none 50% 50%)")))&&(a=$o(r),a.coords=a.coords.map(R),a.alpha=R(a.alpha),t=Bo(a,e),CSS.supports("color",t)))return t=new String(t),t.color=a,t;a=M(a,o),t=new String(Bo(a,e)),t.color=a}return t}function wl(r,o){return r=v(r),o=v(o),r.space===o.space&&r.alpha===o.alpha&&r.coords.every((e,t)=>e===o.coords[t])}function po(r){return X(r,[N,"y"])}function Ft(r,o){so(r,[N,"y"],o)}function yl(r){Object.defineProperty(r.prototype,"luminance",{get(){return po(this)},set(o){Ft(this,o)}})}var xl=Object.freeze({__proto__:null,getLuminance:po,register:yl,setLuminance:Ft});function Cl(r,o){r=v(r),o=v(o);let e=Math.max(po(r),0),t=Math.max(po(o),0);return t>e&&([e,t]=[t,e]),(e+.05)/(t+.05)}const kl=.56,Ml=.57,$l=.62,Sl=.65,Ar=.022,_l=1.414,El=.1,Al=5e-4,Rl=1.14,Rr=.027,Pl=1.14;function Pr(r){return r>=Ar?r:r+(Ar-r)**_l}function yo(r){let o=r<0?-1:1,e=Math.abs(r);return o*Math.pow(e,2.4)}function Hl(r,o){o=v(o),r=v(r);let e,t,a,l,s,n;o=M(o,"srgb"),[l,s,n]=o.coords;let i=yo(l)*.2126729+yo(s)*.7151522+yo(n)*.072175;r=M(r,"srgb"),[l,s,n]=r.coords;let c=yo(l)*.2126729+yo(s)*.7151522+yo(n)*.072175,u=Pr(i),h=Pr(c),m=h>u;return Math.abs(h-u)<Al?t=0:m?(e=h**kl-u**Ml,t=e*Rl):(e=h**Sl-u**$l,t=e*Pl),Math.abs(t)<El?a=0:t>0?a=t-Rr:a=t+Rr,a*100}function Bl(r,o){r=v(r),o=v(o);let e=Math.max(po(r),0),t=Math.max(po(o),0);t>e&&([e,t]=[t,e]);let a=e+t;return a===0?0:(e-t)/a}const Nl=5e4;function Ol(r,o){r=v(r),o=v(o);let e=Math.max(po(r),0),t=Math.max(po(o),0);return t>e&&([e,t]=[t,e]),t===0?Nl:(e-t)/t}function Il(r,o){r=v(r),o=v(o);let e=X(r,[Y,"l"]),t=X(o,[Y,"l"]);return Math.abs(e-t)}const Fl=216/24389,Hr=24/116,Yo=24389/27;let ge=D.D65;var Re=new g({id:"lab-d65",name:"Lab D65",coords:{l:{refRange:[0,100],name:"Lightness"},a:{refRange:[-125,125]},b:{refRange:[-125,125]}},white:ge,base:N,fromBase(r){let o=r.map((e,t)=>e/ge[t]).map(e=>e>Fl?Math.cbrt(e):(Yo*e+16)/116);return[116*o[1]-16,500*(o[0]-o[1]),200*(o[1]-o[2])]},toBase(r){let o=[];return o[1]=(r[0]+16)/116,o[0]=r[1]/500+o[1],o[2]=o[1]-r[2]/200,[o[0]>Hr?Math.pow(o[0],3):(116*o[0]-16)/Yo,r[0]>8?Math.pow((r[0]+16)/116,3):r[0]/Yo,o[2]>Hr?Math.pow(o[2],3):(116*o[2]-16)/Yo].map((e,t)=>e*ge[t])},formats:{"lab-d65":{coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}});const fe=Math.pow(5,.5)*.5+.5;function Ll(r,o){r=v(r),o=v(o);let e=X(r,[Re,"l"]),t=X(o,[Re,"l"]),a=Math.abs(Math.pow(e,fe)-Math.pow(t,fe)),l=Math.pow(a,1/fe)*Math.SQRT2-40;return l<7.5?0:l}var oe=Object.freeze({__proto__:null,contrastAPCA:Hl,contrastDeltaPhi:Ll,contrastLstar:Il,contrastMichelson:Bl,contrastWCAG21:Cl,contrastWeber:Ol});function Dl(r,o,e={}){Fo(e)&&(e={algorithm:e});let{algorithm:t,...a}=e;if(!t){let l=Object.keys(oe).map(s=>s.replace(/^contrast/,"")).join(", ");throw new TypeError(`contrast() function needs a contrast algorithm. Please specify one of: ${l}`)}r=v(r),o=v(o);for(let l in oe)if("contrast"+t.toLowerCase()===l.toLowerCase())return oe[l](r,o,a);throw new TypeError(`Unknown contrast algorithm: ${t}`)}function ce(r){let[o,e,t]=Lo(r,N),a=o+15*e+3*t;return[4*o/a,9*e/a]}function Lt(r){let[o,e,t]=Lo(r,N),a=o+e+t;return[o/a,e/a]}function jl(r){Object.defineProperty(r.prototype,"uv",{get(){return ce(this)}}),Object.defineProperty(r.prototype,"xy",{get(){return Lt(this)}})}var Tl=Object.freeze({__proto__:null,register:jl,uv:ce,xy:Lt});function Ho(r,o,e={}){Fo(e)&&(e={method:e});let{method:t=G.deltaE,...a}=e;for(let l in So)if("deltae"+t.toLowerCase()===l.toLowerCase())return So[l](r,o,a);throw new TypeError(`Unknown deltaE method: ${t}`)}function ql(r,o=.25){let e=[g.get("oklch","lch"),"l"];return so(r,e,t=>t*(1+o))}function Wl(r,o=.25){let e=[g.get("oklch","lch"),"l"];return so(r,e,t=>t*(1-o))}var Ul=Object.freeze({__proto__:null,darken:Wl,lighten:ql});function Dt(r,o,e=.5,t={}){return[r,o]=[v(r),v(o)],co(e)==="object"&&([e,t]=[.5,e]),Do(r,o,t)(e)}function jt(r,o,e={}){let t;Te(r)&&([t,e]=[r,o],[r,o]=t.rangeArgs.colors);let{maxDeltaE:a,deltaEMethod:l,steps:s=2,maxSteps:n=1e3,...i}=e;t||([r,o]=[v(r),v(o)],t=Do(r,o,i));let c=Ho(r,o),u=a>0?Math.max(s,Math.ceil(c/a)+1):s,h=[];if(n!==void 0&&(u=Math.min(u,n)),u===1)h=[{p:.5,color:t(.5)}];else{let m=1/(u-1);h=Array.from({length:u},(f,b)=>{let p=b*m;return{p,color:t(p)}})}if(a>0){let m=h.reduce((f,b,p)=>{if(p===0)return 0;let z=Ho(b.color,h[p-1].color,l);return Math.max(f,z)},0);for(;m>a;){m=0;for(let f=1;f<h.length&&h.length<n;f++){let b=h[f-1],p=h[f],z=(p.p+b.p)/2,w=t(z);m=Math.max(m,Ho(w,b.color),Ho(w,p.color)),h.splice(f,0,{p:z,color:t(z)}),f++}}}return h=h.map(m=>m.color),h}function Do(r,o,e={}){if(Te(r)){let[i,c]=[r,o];return Do(...i.rangeArgs.colors,{...i.rangeArgs.options,...c})}let{space:t,outputSpace:a,progression:l,premultiplied:s}=e;r=v(r),o=v(o),r=$o(r),o=$o(o);let n={colors:[r,o],options:e};if(t?t=g.get(t):t=g.registry[G.interpolationSpace]||r.space,a=a?g.get(a):t,r=M(r,t),o=M(o,t),r=mo(r),o=mo(o),t.coords.h&&t.coords.h.type==="angle"){let i=e.hue=e.hue||"shorter",c=[t,"h"],[u,h]=[X(r,c),X(o,c)];isNaN(u)&&!isNaN(h)?u=h:isNaN(h)&&!isNaN(u)&&(h=u),[u,h]=Ma(i,[u,h]),so(r,c,u),so(o,c,h)}return s&&(r.coords=r.coords.map(i=>i*r.alpha),o.coords=o.coords.map(i=>i*o.alpha)),Object.assign(i=>{i=l?l(i):i;let c=r.coords.map((m,f)=>{let b=o.coords[f];return No(m,b,i)}),u=No(r.alpha,o.alpha,i),h={space:t,coords:c,alpha:u};return s&&(h.coords=h.coords.map(m=>m/u)),a!==t&&(h=M(h,a)),h},{rangeArgs:n})}function Te(r){return co(r)==="function"&&!!r.rangeArgs}G.interpolationSpace="lab";function Xl(r){r.defineFunction("mix",Dt,{returns:"color"}),r.defineFunction("range",Do,{returns:"function<color>"}),r.defineFunction("steps",jt,{returns:"array<color>"})}var Yl=Object.freeze({__proto__:null,isRange:Te,mix:Dt,range:Do,register:Xl,steps:jt}),Tt=new g({id:"hsl",name:"HSL",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:_o,fromBase:r=>{let o=Math.max(...r),e=Math.min(...r),[t,a,l]=r,[s,n,i]=[NaN,0,(e+o)/2],c=o-e;if(c!==0){switch(n=i===0||i===1?0:(o-i)/Math.min(i,1-i),o){case t:s=(a-l)/c+(a<l?6:0);break;case a:s=(l-t)/c+2;break;case l:s=(t-a)/c+4}s=s*60}return n<0&&(s+=180,n=Math.abs(n)),s>=360&&(s-=360),[s,n*100,i*100]},toBase:r=>{let[o,e,t]=r;o=o%360,o<0&&(o+=360),e/=100,t/=100;function a(l){let s=(l+o/30)%12,n=e*Math.min(t,1-t);return t-n*Math.max(-1,Math.min(s-3,9-s,1))}return[a(0),a(8),a(4)]},formats:{hsl:{coords:["<number> | <angle>","<percentage>","<percentage>"]},hsla:{coords:["<number> | <angle>","<percentage>","<percentage>"],commas:!0,lastAlpha:!0}}}),qt=new g({id:"hsv",name:"HSV",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},v:{range:[0,100],name:"Value"}},base:Tt,fromBase(r){let[o,e,t]=r;e/=100,t/=100;let a=t+e*Math.min(t,1-t);return[o,a===0?0:200*(1-t/a),100*a]},toBase(r){let[o,e,t]=r;e/=100,t/=100;let a=t*(1-e/2);return[o,a===0||a===1?0:(t-a)/Math.min(a,1-a)*100,a*100]},formats:{color:{id:"--hsv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}}),Gl=new g({id:"hwb",name:"HWB",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},w:{range:[0,100],name:"Whiteness"},b:{range:[0,100],name:"Blackness"}},base:qt,fromBase(r){let[o,e,t]=r;return[o,t*(100-e)/100,100-t]},toBase(r){let[o,e,t]=r;e/=100,t/=100;let a=e+t;if(a>=1){let n=e/a;return[o,0,n*100]}let l=1-t,s=l===0?0:1-e/l;return[o,s*100,l*100]},formats:{hwb:{coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});const Zl=[[.5766690429101305,.1855582379065463,.1882286462349947],[.29734497525053605,.6273635662554661,.07529145849399788],[.02703136138641234,.07068885253582723,.9913375368376388]],Kl=[[2.0415879038107465,-.5650069742788596,-.34473135077832956],[-.9692436362808795,1.8759675015077202,.04155505740717557],[.013444280632031142,-.11836239223101838,1.0151749943912054]];var Wt=new T({id:"a98rgb-linear",cssId:"--a98-rgb-linear",name:"Linear Adobe® 98 RGB compatible",white:"D65",toXYZ_M:Zl,fromXYZ_M:Kl}),Vl=new T({id:"a98rgb",cssId:"a98-rgb",name:"Adobe® 98 RGB compatible",base:Wt,toBase:r=>r.map(o=>Math.pow(Math.abs(o),563/256)*Math.sign(o)),fromBase:r=>r.map(o=>Math.pow(Math.abs(o),256/563)*Math.sign(o))});const Jl=[[.7977666449006423,.13518129740053308,.0313477341283922],[.2880748288194013,.711835234241873,8993693872564e-17],[0,0,.8251046025104602]],Ql=[[1.3457868816471583,-.25557208737979464,-.05110186497554526],[-.5446307051249019,1.5082477428451468,.02052744743642139],[0,0,1.2119675456389452]];var Ut=new T({id:"prophoto-linear",cssId:"--prophoto-rgb-linear",name:"Linear ProPhoto",white:"D50",base:Le,toXYZ_M:Jl,fromXYZ_M:Ql});const os=1/512,es=16/512;var rs=new T({id:"prophoto",cssId:"prophoto-rgb",name:"ProPhoto",base:Ut,toBase(r){return r.map(o=>o<es?o/16:o**1.8)},fromBase(r){return r.map(o=>o>=os?o**(1/1.8):16*o)}}),ts=new g({id:"oklch",name:"Oklch",coords:{l:{refRange:[0,1],name:"Lightness"},c:{refRange:[0,.4],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},white:"D65",base:Mo,fromBase(r){let[o,e,t]=r,a;const l=2e-4;return Math.abs(e)<l&&Math.abs(t)<l?a=NaN:a=Math.atan2(t,e)*180/Math.PI,[o,Math.sqrt(e**2+t**2),to(a)]},toBase(r){let[o,e,t]=r,a,l;return isNaN(t)?(a=0,l=0):(a=e*Math.cos(t*Math.PI/180),l=e*Math.sin(t*Math.PI/180)),[o,a,l]},formats:{oklch:{coords:["<percentage> | <number>","<number> | <percentage>[0,1]","<number> | <angle>"]}}});let Xt=D.D65;const as=216/24389,Br=24389/27,[Nr,Or]=ce({space:N,coords:Xt});var Yt=new g({id:"luv",name:"Luv",coords:{l:{refRange:[0,100],name:"Lightness"},u:{refRange:[-215,215]},v:{refRange:[-215,215]}},white:Xt,base:N,fromBase(r){let o=[R(r[0]),R(r[1]),R(r[2])],e=o[1],[t,a]=ce({space:N,coords:o});if(!Number.isFinite(t)||!Number.isFinite(a))return[0,0,0];let l=e<=as?Br*e:116*Math.cbrt(e)-16;return[l,13*l*(t-Nr),13*l*(a-Or)]},toBase(r){let[o,e,t]=r;if(o===0||uo(o))return[0,0,0];e=R(e),t=R(t);let a=e/(13*o)+Nr,l=t/(13*o)+Or,s=o<=8?o/Br:Math.pow((o+16)/116,3);return[s*(9*a/(4*l)),s,s*((12-3*a-20*l)/(4*l))]},formats:{color:{id:"--luv",coords:["<number> | <percentage>","<number> | <percentage>[-1,1]","<number> | <percentage>[-1,1]"]}}}),qe=new g({id:"lchuv",name:"LChuv",coords:{l:{refRange:[0,100],name:"Lightness"},c:{refRange:[0,220],name:"Chroma"},h:{refRange:[0,360],type:"angle",name:"Hue"}},base:Yt,fromBase(r){let[o,e,t]=r,a;const l=.02;return Math.abs(e)<l&&Math.abs(t)<l?a=NaN:a=Math.atan2(t,e)*180/Math.PI,[o,Math.sqrt(e**2+t**2),to(a)]},toBase(r){let[o,e,t]=r;return e<0&&(e=0),isNaN(t)&&(t=0),[o,e*Math.cos(t*Math.PI/180),e*Math.sin(t*Math.PI/180)]},formats:{color:{id:"--lchuv",coords:["<number> | <percentage>","<number> | <percentage>","<number> | <angle>"]}}});const ls=216/24389,ss=24389/27,Ir=H[0][0],Fr=H[0][1],be=H[0][2],Lr=H[1][0],Dr=H[1][1],ze=H[1][2],jr=H[2][0],Tr=H[2][1],ve=H[2][2];function xo(r,o,e){const t=o/(Math.sin(e)-r*Math.cos(e));return t<0?1/0:t}function le(r){const o=Math.pow(r+16,3)/1560896,e=o>ls?o:r/ss,t=e*(284517*Ir-94839*be),a=e*(838422*be+769860*Fr+731718*Ir),l=e*(632260*be-126452*Fr),s=e*(284517*Lr-94839*ze),n=e*(838422*ze+769860*Dr+731718*Lr),i=e*(632260*ze-126452*Dr),c=e*(284517*jr-94839*ve),u=e*(838422*ve+769860*Tr+731718*jr),h=e*(632260*ve-126452*Tr);return{r0s:t/l,r0i:a*r/l,r1s:t/(l+126452),r1i:(a-769860)*r/(l+126452),g0s:s/i,g0i:n*r/i,g1s:s/(i+126452),g1i:(n-769860)*r/(i+126452),b0s:c/h,b0i:u*r/h,b1s:c/(h+126452),b1i:(u-769860)*r/(h+126452)}}function qr(r,o){const e=o/360*Math.PI*2,t=xo(r.r0s,r.r0i,e),a=xo(r.r1s,r.r1i,e),l=xo(r.g0s,r.g0i,e),s=xo(r.g1s,r.g1i,e),n=xo(r.b0s,r.b0i,e),i=xo(r.b1s,r.b1i,e);return Math.min(t,a,l,s,n,i)}var ns=new g({id:"hsluv",name:"HSLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:qe,gamutSpace:_o,fromBase(r){let[o,e,t]=[R(r[0]),R(r[1]),R(r[2])],a;if(o>99.9999999)a=0,o=100;else if(o<1e-8)a=0,o=0;else{let l=le(o),s=qr(l,t);a=e/s*100}return[t,a,o]},toBase(r){let[o,e,t]=[R(r[0]),R(r[1]),R(r[2])],a;if(t>99.9999999)t=100,a=0;else if(t<1e-8)t=0,a=0;else{let l=le(t);a=qr(l,o)/100*e}return[t,a,o]},formats:{color:{id:"--hsluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});H[0][0];H[0][1];H[0][2];H[1][0];H[1][1];H[1][2];H[2][0];H[2][1];H[2][2];function Co(r,o){return Math.abs(o)/Math.sqrt(Math.pow(r,2)+1)}function Wr(r){let o=Co(r.r0s,r.r0i),e=Co(r.r1s,r.r1i),t=Co(r.g0s,r.g0i),a=Co(r.g1s,r.g1i),l=Co(r.b0s,r.b0i),s=Co(r.b1s,r.b1i);return Math.min(o,e,t,a,l,s)}var is=new g({id:"hpluv",name:"HPLuv",coords:{h:{refRange:[0,360],type:"angle",name:"Hue"},s:{range:[0,100],name:"Saturation"},l:{range:[0,100],name:"Lightness"}},base:qe,gamutSpace:"self",fromBase(r){let[o,e,t]=[R(r[0]),R(r[1]),R(r[2])],a;if(o>99.9999999)a=0,o=100;else if(o<1e-8)a=0,o=0;else{let l=le(o),s=Wr(l);a=e/s*100}return[t,a,o]},toBase(r){let[o,e,t]=[R(r[0]),R(r[1]),R(r[2])],a;if(t>99.9999999)t=100,a=0;else if(t<1e-8)t=0,a=0;else{let l=le(t);a=Wr(l)/100*e}return[t,a,o]},formats:{color:{id:"--hpluv",coords:["<number> | <angle>","<percentage> | <number>","<percentage> | <number>"]}}});const Ur=203,Xr=2610/2**14,cs=2**14/2610,us=2523/2**5,Yr=2**5/2523,Gr=3424/2**12,Zr=2413/2**7,Kr=2392/2**7;var hs=new T({id:"rec2100pq",cssId:"rec2100-pq",name:"REC.2100-PQ",base:ie,toBase(r){return r.map(function(o){return(Math.max(o**Yr-Gr,0)/(Zr-Kr*o**Yr))**cs*1e4/Ur})},fromBase(r){return r.map(function(o){let e=Math.max(o*Ur/1e4,0),t=Gr+Zr*e**Xr,a=1+Kr*e**Xr;return(t/a)**us})}});const Vr=.17883277,Jr=.28466892,Qr=.55991073,we=3.7743;var ds=new T({id:"rec2100hlg",cssId:"rec2100-hlg",name:"REC.2100-HLG",referred:"scene",base:ie,toBase(r){return r.map(function(o){return o<=.5?o**2/3*we:(Math.exp((o-Qr)/Vr)+Jr)/12*we})},fromBase(r){return r.map(function(o){return o/=we,o<=1/12?Math.sqrt(3*o):Vr*Math.log(12*o-Jr)+Qr})}});const Gt={};ho.add("chromatic-adaptation-start",r=>{r.options.method&&(r.M=Zt(r.W1,r.W2,r.options.method))});ho.add("chromatic-adaptation-end",r=>{r.M||(r.M=Zt(r.W1,r.W2,r.options.method))});function ue({id:r,toCone_M:o,fromCone_M:e}){Gt[r]=arguments[0]}function Zt(r,o,e="Bradford"){let t=Gt[e],[a,l,s]=$(t.toCone_M,r),[n,i,c]=$(t.toCone_M,o),u=[[n/a,0,0],[0,i/l,0],[0,0,c/s]],h=$(u,t.toCone_M);return $(t.fromCone_M,h)}ue({id:"von Kries",toCone_M:[[.40024,.7076,-.08081],[-.2263,1.16532,.0457],[0,0,.91822]],fromCone_M:[[1.8599363874558397,-1.1293816185800916,.21989740959619328],[.3611914362417676,.6388124632850422,-6370596838649899e-21],[0,0,1.0890636230968613]]});ue({id:"Bradford",toCone_M:[[.8951,.2664,-.1614],[-.7502,1.7135,.0367],[.0389,-.0685,1.0296]],fromCone_M:[[.9869929054667121,-.14705425642099013,.15996265166373122],[.4323052697233945,.5183602715367774,.049291228212855594],[-.00852866457517732,.04004282165408486,.96848669578755]]});ue({id:"CAT02",toCone_M:[[.7328,.4296,-.1624],[-.7036,1.6975,.0061],[.003,.0136,.9834]],fromCone_M:[[1.0961238208355142,-.27886900021828726,.18274517938277307],[.4543690419753592,.4735331543074117,.07209780371722911],[-.009627608738429355,-.00569803121611342,1.0153256399545427]]});ue({id:"CAT16",toCone_M:[[.401288,.650173,-.051461],[-.250268,1.204414,.045854],[-.002079,.048952,.953127]],fromCone_M:[[1.862067855087233,-1.0112546305316845,.14918677544445172],[.3875265432361372,.6214474419314753,-.008973985167612521],[-.01584149884933386,-.03412293802851557,1.0499644368778496]]});Object.assign(D,{A:[1.0985,1,.35585],C:[.98074,1,1.18232],D55:[.95682,1,.92149],D75:[.94972,1,1.22638],E:[1,1,1],F2:[.99186,1,.67393],F7:[.95041,1,1.08747],F11:[1.00962,1,.6435]});D.ACES=[.32168/.33767,1,(1-.32168-.33767)/.33767];const ms=[[.6624541811085053,.13400420645643313,.1561876870049078],[.27222871678091454,.6740817658111484,.05368951740793705],[-.005574649490394108,.004060733528982826,1.0103391003129971]],ps=[[1.6410233796943257,-.32480329418479,-.23642469523761225],[-.6636628587229829,1.6153315916573379,.016756347685530137],[.011721894328375376,-.008284441996237409,.9883948585390215]];var Kt=new T({id:"acescg",cssId:"--acescg",name:"ACEScg",coords:{r:{range:[0,65504],name:"Red"},g:{range:[0,65504],name:"Green"},b:{range:[0,65504],name:"Blue"}},referred:"scene",white:D.ACES,toXYZ_M:ms,fromXYZ_M:ps});const Go=2**-16,ye=-.35828683,Zo=(Math.log2(65504)+9.72)/17.52;var gs=new T({id:"acescc",cssId:"--acescc",name:"ACEScc",coords:{r:{range:[ye,Zo],name:"Red"},g:{range:[ye,Zo],name:"Green"},b:{range:[ye,Zo],name:"Blue"}},referred:"scene",base:Kt,toBase(r){const o=-.3013698630136986;return r.map(function(e){return e<=o?(2**(e*17.52-9.72)-Go)*2:e<Zo?2**(e*17.52-9.72):65504})},fromBase(r){return r.map(function(o){return o<=0?(Math.log2(Go)+9.72)/17.52:o<Go?(Math.log2(Go+o*.5)+9.72)/17.52:(Math.log2(o)+9.72)/17.52})}}),ot=Object.freeze({__proto__:null,A98RGB:Vl,A98RGB_Linear:Wt,ACEScc:gs,ACEScg:Kt,CAM16_JMh:al,HCT:Io,HPLuv:is,HSL:Tt,HSLuv:ns,HSV:qt,HWB:Gl,ICTCP:_e,JzCzHz:Se,Jzazbz:kt,LCH:Oo,LCHuv:qe,Lab:Y,Lab_D65:Re,Luv:Yt,OKLCH:ts,OKLab:Mo,P3:It,P3_Linear:Nt,ProPhoto:rs,ProPhoto_Linear:Ut,REC_2020:Bt,REC_2020_Linear:ie,REC_2100_HLG:ds,REC_2100_PQ:hs,XYZ_ABS_D65:De,XYZ_D50:Le,XYZ_D65:N,sRGB:_o,sRGB_Linear:Ot});let _=class j{constructor(...o){let e;o.length===1&&(e=v(o[0]));let t,a,l;e?(t=e.space||e.spaceId,a=e.coords,l=e.alpha):[t,a,l]=o,Object.defineProperty(this,"space",{value:g.get(t),writable:!1,enumerable:!0,configurable:!0}),this.coords=a?a.slice():[0,0,0],this.alpha=l>1||l===void 0?1:l<0?0:l;for(let s=0;s<this.coords.length;s++)this.coords[s]==="NaN"&&(this.coords[s]=NaN);for(let s in this.space.coords)Object.defineProperty(this,s,{get:()=>this.get(s),set:n=>this.set(s,n)})}get spaceId(){return this.space.id}clone(){return new j(this.space,this.coords,this.alpha)}toJSON(){return{spaceId:this.spaceId,coords:this.coords,alpha:this.alpha}}display(...o){let e=vl(this,...o);return e.color=new j(e.color),e}static get(o,...e){return o instanceof j?o:new j(o,...e)}static defineFunction(o,e,t=e){let{instance:a=!0,returns:l}=t,s=function(...n){let i=e(...n);if(l==="color")i=j.get(i);else if(l==="function<color>"){let c=i;i=function(...u){let h=c(...u);return j.get(h)},Object.assign(i,c)}else l==="array<color>"&&(i=i.map(c=>j.get(c)));return i};o in j||(j[o]=s),a&&(j.prototype[o]=function(...n){return s(this,...n)})}static defineFunctions(o){for(let e in o)j.defineFunction(e,o[e],o[e])}static extend(o){if(o.register)o.register(j);else for(let e in o)j.defineFunction(e,o[e])}};_.defineFunctions({get:X,getAll:Lo,set:so,setAll:Fe,to:M,equals:wl,inGamut:zo,toGamut:mo,distance:Ct,toString:Bo});Object.assign(_,{util:va,hooks:ho,WHITES:D,Space:g,spaces:g.registry,parse:yt,defaults:G});for(let r of Object.keys(ot))g.register(ot[r]);for(let r in g.registry)Pe(r,g.registry[r]);ho.add("colorspace-init-end",r=>{var o;Pe(r.id,r),(o=r.aliases)==null||o.forEach(e=>{Pe(e,r)})});function Pe(r,o){let e=r.replace(/-/g,"_");Object.defineProperty(_.prototype,e,{get(){let t=this.getAll(r);return typeof Proxy>"u"?t:new Proxy(t,{has:(a,l)=>{try{return g.resolveCoord([o,l]),!0}catch{}return Reflect.has(a,l)},get:(a,l,s)=>{if(l&&typeof l!="symbol"&&!(l in a)){let{index:n}=g.resolveCoord([o,l]);if(n>=0)return a[n]}return Reflect.get(a,l,s)},set:(a,l,s,n)=>{if(l&&typeof l!="symbol"&&!(l in a)||l>=0){let{index:i}=g.resolveCoord([o,l]);if(i>=0)return a[i]=s,this.setAll(r,a),!0}return Reflect.set(a,l,s,n)}})},set(t){this.setAll(r,t)},configurable:!0,enumerable:!0})}_.extend(So);_.extend({deltaE:Ho});Object.assign(_,{deltaEMethods:So});_.extend(Ul);_.extend({contrast:Dl});_.extend(Tl);_.extend(xl);_.extend(Yl);_.extend(oe);class Vt{constructor(o,{manageAs:e}={}){this._color=new _("hsv",[0,100,100],1),this.host=o,this.manageAs=e}get color(){return this._color}validateColorString(o){var e,t,a,l;const s={spaceId:null,coords:[0,0,0],isValid:!1,alpha:1},n=[/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d*\.?\d+)\s*\)/i,/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)/i,/^rgba\s+(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+(0|0?\.\d+|1)\s*$/i,/^rgb\s+(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s*$/i,/^rgba\(\s*(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s+(\d*\.?\d+)\s*\)$/i,/^rgb\(\s*(\d{1,3})\s+(\d{1,3})\s+(\d{1,3})\s*\)$/i,/rgb\(\s*(100|[0-9]{1,2}%)\s*,\s*(100|[0-9]{1,2}%)\s*,\s*(100|[0-9]{1,2}%)\s*\)/i,/rgba\(\s*(100|[0-9]{1,2})%\s*,\s*(100|[0-9]{1,2})%\s*,\s*(100|[0-9]{1,2})%\s*,\s*(\d*\.?\d+)\s*\)/i],i=[/hsla\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d*\.?\d+)\s*\)/i,/hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)/i,/^hsla\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*$/i,/^hsl\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*$/i,/^hsla\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*\)$/i,/^hsl\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*\)$/i],c=[/hsva\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*,\s*(\d*\.?\d+)\s*\)/i,/hsv\(\s*(\d{1,3})\s*,\s*(\d{1,3}%?)\s*,\s*(\d{1,3}%?)\s*\)/i,/^hsva\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*$/i,/^hsv\s+(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*$/i,/^hsva\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s+(\d*\.?\d+)\s*\)$/i,/^hsv\(\s*(\d{1,3})\s+(\d{1,3}%?)\s+(\d{1,3}%?)\s*\)$/i],u=[/^#([A-Fa-f0-9]{6})([A-Fa-f0-9]{2})?$/,/^#([A-Fa-f0-9]{3})([A-Fa-f0-9]{1})?$/],h=(e=n.find(p=>p.test(o)))==null?void 0:e.exec(o),m=(t=i.find(p=>p.test(o)))==null?void 0:t.exec(o),f=(a=c.find(p=>p.test(o)))==null?void 0:a.exec(o),b=(l=u.find(p=>p.test(o)))==null?void 0:l.exec(o);if(h){const[,p,z,w,y]=h.filter(E=>typeof E=="string"),C=y===void 0?1:Number(y),x=E=>E.includes("%")?Number(E.replace("%",""))/100:Number(E)/255,k=x(p),S=x(z),F=x(w);s.spaceId="srgb",s.coords=[k,S,F],s.alpha=C,s.isValid=k>=0&&k<=1&&S>=0&&S<=1&&F>=0&&F<=1&&C>=0&&C<=1}else if(m){const[,p,z,w,y]=m,C=[p,z,w,y===void 0?"1":y].map(E=>Number(E.replaceAll(/[^\d.]/g,""))),[x,k,S,F]=C;s.spaceId="hsl",s.coords=[x,k,S],s.alpha=F,s.isValid=x>=0&&x<=360&&k>=0&&k<=100&&S>=0&&S<=100&&F>=0&&F<=1}else if(f){const[,p,z,w,y]=f,C=[p,z,w,y===void 0?"1":y].map(E=>Number(E.replaceAll(/[^\d.]/g,""))),[x,k,S,F]=C;s.spaceId="hsv",s.coords=[x,k,S],s.alpha=F,s.isValid=x>=0&&x<=360&&k>=0&&k<=100&&S>=0&&S<=100&&F>=0&&F<=1}else if(b){const[,p,z]=b,w=S=>(S.length===1&&(S=S+S),Number.parseInt(S,16)/255);let y,C,x;p.length===3?(y=w(p.slice(0,1)),C=w(p.slice(1,2)),x=w(p.slice(2,3))):(y=w(p.slice(0,2)),C=w(p.slice(2,4)),x=w(p.slice(4,6)));const k=z?w(z):1;s.spaceId="srgb",s.coords=[y,C,x],s.alpha=k,s.isValid=y>=0&&y<=1&&C>=0&&C<=1&&x>=0&&x<=1&&k>=0&&k<=1}return s}get colorOrigin(){return this._colorOrigin}set colorOrigin(o){this._colorOrigin=o}set color(o){this._colorOrigin=o;let e;if(typeof o=="string"){const t=this.validateColorString(o);if(t.isValid){const[a,l,s]=t.coords;e=new _(`${t.spaceId}`,[a,l,s],t.alpha)}else try{_.parse(o)}catch{try{e=new _(`#${o}`)}catch{return}}}else if(o instanceof _)e=o;else if(!Array.isArray(o)){const{h:t,s:a,l,v:s,r:n,g:i,b:c,a:u}=o;if(t!==void 0&&a!==void 0){const h=l??s;e=new _(l===void 0?"hsv":"hsl",[Number.parseFloat(t),typeof a=="string"?Number.parseFloat(a):a*100,typeof h=="string"?Number.parseFloat(h):h*100],Number.parseFloat(u||"1"))}else n!==void 0&&i!==void 0&&c!==void 0&&(e=new _("srgb",[Number.parseFloat(n)/255,Number.parseFloat(i)/255,Number.parseFloat(c)/255],Number.parseFloat(u||"1")))}e||(e=new _(o)),this._color=this.manageAs?e.to(this.manageAs):e,this.host.requestUpdate()}get colorValue(){let o;if(typeof this._colorOrigin=="string")switch(this._colorOrigin.startsWith("#")?o="hex string":this._colorOrigin.startsWith("rgb")?o="rgb":this._colorOrigin.startsWith("hsl")?o="hsl":this._colorOrigin.startsWith("hsv")?o="hsv":o="hex",o){case"hsv":{const e=this._colorOrigin[3]==="a",{h:t,s:a,v:l}=this._color.to("hsv").hsv,s=this._color.alpha;return`hsv${e?"a":""}(${Math.round(t)}, ${Math.round(a)}%, ${Math.round(l)}%${e?`, ${s}`:""})`}case"hsl":{const e=this._colorOrigin[3]==="a",{h:t,s:a,l}=this._color.to("hsl").hsl,s=this._color.alpha;return`hsl${e?"a":""}(${Math.round(t)}, ${Math.round(a)}%, ${Math.round(l)}%${e?`, ${s}`:""})`}case"hex string":{const{r:e,g:t,b:a}=this._color.to("srgb").srgb,l=this._colorOrigin.length===5||this._colorOrigin.length===9,s=this._color.alpha,n=Math.round(e*255).toString(16),i=Math.round(t*255).toString(16),c=Math.round(a*255).toString(16),u=Math.round(s*255).toString(16);return`#${n.padStart(2,"0")}${i.padStart(2,"0")}${c.padStart(2,"0")}${l?u.padStart(2,"0"):""}`}case"hex":{const{r:e,g:t,b:a}=this._color.to("srgb").srgb,l=this._colorOrigin.length===4||this._colorOrigin.length===8,s=this._color.alpha,n=Math.round(e*255).toString(16),i=Math.round(t*255).toString(16),c=Math.round(a*255).toString(16),u=Math.round(s*255).toString(16);return`${n.padStart(2,"0")}${i.padStart(2,"0")}${c.padStart(2,"0")}${l?u.padStart(2,"0"):""}`}default:{const{r:e,g:t,b:a}=this._color.to("srgb").srgb,l=this._colorOrigin[3]==="a",s=this._color.alpha;return this._colorOrigin.search("%")>-1?`rgb${l?"a":""}(${Math.round(e*100)}%, ${Math.round(t*100)}%, ${Math.round(a*100)}%${l?`,${Math.round(s*100)}%`:""})`:`rgb${l?"a":""}(${Math.round(e*255)}, ${Math.round(t*255)}, ${Math.round(a*255)}${l?`, ${s}`:""})`}}if(this._colorOrigin)try{({spaceId:o}=new _(this._colorOrigin))}catch{const{h:e,s:t,l:a,v:l,r:s,g:n,b:i}=this._colorOrigin;e!==void 0&&t!==void 0&&a!==void 0?o="hsl":e!==void 0&&t!==void 0&&l!==void 0?o="hsv":s!==void 0&&n!==void 0&&i!==void 0&&(o="srgb")}else({spaceId:o}=this.color);switch(o){case"hsv":{const{h:e,s:t,v:a}=this._color.to("hsv").hsv;return{h:e,s:t/100,v:a/100,a:this._color.alpha}}case"hsl":{const{h:e,s:t,l:a}=this._color.to("hsl").hsl;return{h:e,s:t/100,l:a/100,a:this._color.alpha}}case"srgb":{const{r:e,g:t,b:a}=this._color.to("srgb").srgb;return this._colorOrigin&&typeof this._colorOrigin.r=="string"&&this._colorOrigin.r.search("%")?{r:`${Math.round(e*255)}%`,g:`${Math.round(t*255)}%`,b:`${Math.round(a*255)}%`,a:this._color.alpha}:{r:Math.round(e*255),g:Math.round(t*255),b:Math.round(a*255),a:this._color.alpha}}}return this._color}get hue(){return Number(this._color.to("hsl").hsl.h)}set hue(o){this._color.set("h",o),this.host.requestUpdate()}getColor(o){if(typeof o=="string"&&!["srgb","hsva","hsv","hsl","hsla"].includes(o))throw new Error("not a valid format");return this._color.to(o)}getHslString(){return this._color.to("hsl").toString()}savePreviousColor(){this._previousColor=this._color.clone()}restorePreviousColor(){this._color=this._previousColor}}/*! * Lucero - The design system for Luzmo.
|
113
113
|
*
|
114
114
|
* Copyright © 2025 Luzmo
|
115
115
|
* All rights reserved.
|
@@ -125,7 +125,7 @@
|
|
125
125
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
126
126
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
127
127
|
* SOFTWARE.
|
128
|
-
* */const gs=()=>{if(typeof document<"u"&&!document.querySelector("style[data-luzmo-vars]")){const r=document.createElement("style");r.setAttribute("data-luzmo-vars",""),r.textContent='html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}',document.head.appendChild(r)}};gs();const fs="@media (forced-colors: active){:host{--highcontrast-color-area-border-color-disabled: GrayText;--highcontrast-color-area-border-color: Canvas;--highcontrast-color-area-fill-color-disabled: Canvas}.gradient,:host([disabled]){forced-color-adjust:none}}:host{cursor:default;-webkit-user-select:none;user-select:none;min-inline-size:var(--luzmo-color-area-min-width, 64px);min-block-size:var(--luzmo-color-area-min-height, 64px);inline-size:var(--luzmo-color-area-width, 192px);block-size:var(--luzmo-color-area-height, 192px);box-sizing:border-box;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color, var(--luzmo-color-area-border-color, var(--luzmo-border-color)));display:inline-block;position:relative}:host([focused]){z-index:1}:host([disabled]){pointer-events:none;background:var(--highcontrast-color-area-fill-color-disabled, var(--luzmo-color-area-disabled-background-color, var(--luzmo-dimmed-color)));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color-disabled)}:host([disabled]) .gradient{display:none}.handle{transform:translate(calc(var(--luzmo-color-area-width, 192px) - var(--luzmo-border-width)));inset-block-start:0}.handle:dir(rtl),:host([dir=rtl]) .handle{inset-inline-end:0}.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s))}.slider{opacity:0;inline-size:100%;block-size:100%;z-index:0;pointer-events:none;margin:0;position:absolute;inset-block-start:0;inset-inline-start:0}:host{touch-action:none}:host:before{pointer-events:none}.gradient{overflow:hidden}.handle{transform:translate(var(--luzmo-color-area-default-width))}::slotted(*){width:100%;height:100%}:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider[orient=vertical]{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}.slider:focus{z-index:1}.fieldset{border:0;margin:0;padding:0}";var bs=Object.defineProperty,zs=Object.getOwnPropertyDescriptor,L=(r,o,e,t)=>{for(var a=t>1?void 0:t?zs(o,e):o,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=(t?s(o,e,a):s(a))||a);return t&&a&&bs(o,e,a),a};let O=class extends d.It{constructor(){super(...arguments),this.disabled=!1,this.focused=!1,this.labelX="saturation",this.labelY="luminosity",this.isLTR=!0,this.languageResolver=new ee.l(this),this.colorController=new Kt(this,{manageAs:"hsv"}),this.activeAxis="x",this.step=.01,this.altered=0,this.activeKeys=new Set,this._valueChanged=!1,this._pointerDown=!1}static get styles(){return[d.at(fs)]}get hue(){return this.colorController.hue}set hue(o){this.colorController.hue=o}get value(){return this.colorController.colorValue}get color(){return this.colorController.colorValue}set color(o){this.colorController.color=o}get x(){return this.colorController.color.hsv.s/100}set x(o){if(o===this.x)return;const e=this.x;this.inputX?(this.inputX.value=o.toString(),this.colorController.color.set("s",this.inputX.valueAsNumber*100)):this.colorController.color.set("s",o*100),this.requestUpdate("x",e)}get y(){return this.colorController.color.hsv.v/100}set y(o){if(o===this.y)return;const e=this.y;this.inputY&&(this.inputY.value=o.toString(),this.colorController.color.set("v",this.inputY.valueAsNumber*100)),this.requestUpdate("y",e)}focus(o={}){super.focus(o),this.forwardFocus()}forwardFocus(){this.activeAxis==="x"?this.inputX.focus():this.inputY.focus()}handleFocus(){this.focused=!0,this._valueChanged=!1}handleBlur(){this._pointerDown||(this.altered=0,this.focused=!1,this._valueChanged=!1)}handleKeydown(o){const{code:e}=o;this.focused=!0,this.altered=[o.shiftKey,o.ctrlKey,o.altKey].filter(t=>!!t).length,(e.search("Arrow")===0||e.search("Page")===0||e.search("Home")===0||e.search("End")===0)&&(o.preventDefault(),this.activeKeys.add(e),this.handleKeypress())}handleKeypress(){let o=0,e=0;const t=Math.max(this.step,this.altered*5*this.step);this.activeKeys.forEach(a=>{switch(a){case"ArrowUp":{e=t;break}case"ArrowDown":{e=t*-1;break}case"ArrowLeft":{o=this.step*(this.isLTR?-1:1);break}case"ArrowRight":{o=this.step*(this.isLTR?1:-1);break}case"PageUp":{e=t*10;break}case"PageDown":{e=t*-10;break}case"Home":{o=t*(this.isLTR?-10:10);break}case"End":{o=t*(this.isLTR?10:-10);break}}}),o!==0?(this.activeAxis="x",this.inputX.focus()):e!==0&&(this.activeAxis="y",this.inputY.focus()),this.x=Math.min(1,Math.max(this.x+o,0)),this.y=Math.min(1,Math.max(this.y+e,0)),this.colorController.savePreviousColor(),(o!==0||e!==0)&&(this._valueChanged=!0,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))||this.colorController.restorePreviousColor())}handleKeyup(o){o.preventDefault();const{code:e}=o;this.activeKeys.delete(e)}handleInput(o){const{valueAsNumber:e,name:t}=o.target;this[t]=e}handleChange(o){this.handleInput(o),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerdown(o){if(o.button!==0){o.preventDefault();return}this._pointerDown=!0,this.colorController.savePreviousColor(),this.boundingClientRect=this.getBoundingClientRect(),o.target.setPointerCapture(o.pointerId),o.pointerType==="mouse"&&(this.focused=!0)}handlePointermove(o){const[e,t]=this.calculateHandlePosition(o);this._valueChanged=!1,this.x=e,this.y=t,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerup(o){o.preventDefault(),this._pointerDown=!1,o.target.releasePointerCapture(o.pointerId);const e=this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}));this.inputX.focus(),o.pointerType==="mouse"&&(this.focused=!1),e||this.colorController.restorePreviousColor()}calculateHandlePosition(o){if(!this.boundingClientRect)return[this.x,this.y];const e=this.boundingClientRect,t=e.left,a=e.top,l=o.clientX,s=o.clientY,n=e.width,i=e.height,c=Math.max(0,Math.min(1,(l-t)/n)),u=Math.max(0,Math.min(1,(s-a)/i));return[this.isLTR?c:1-c,1-u]}handleAreaPointerdown(o){o.button===0&&(o.stopPropagation(),o.preventDefault(),this.handle.dispatchEvent(new PointerEvent("pointerdown",o)),this.handlePointermove(o))}render(){const{width:o=0,height:e=0}=this.boundingClientRect||{},t=Ke.w()||Ke.a(),a="Color Picker",l=P.m(t?void 0:"2d slider"),s=this.labelX,n=this.labelY,i=new Intl.NumberFormat(this.languageResolver.language,{style:"percent",unitDisplay:"narrow"}).format(this.x),c=new Intl.NumberFormat(this.languageResolver.language,{style:"percent",unitDisplay:"narrow"}).format(this.y),u={background:`linear-gradient(to top, black 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%),linear-gradient(to right, white 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%), hsl(${this.hue}, 100%, 50%);`};return d.Rt`
|
128
|
+
* */const fs=()=>{if(typeof document<"u"&&!document.querySelector("style[data-luzmo-vars]")){const r=document.createElement("style");r.setAttribute("data-luzmo-vars",""),r.textContent='html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}',document.head.appendChild(r)}};fs();const bs="@media (forced-colors: active){:host{--highcontrast-color-area-border-color-disabled: GrayText;--highcontrast-color-area-border-color: Canvas;--highcontrast-color-area-fill-color-disabled: Canvas}.gradient,:host([disabled]){forced-color-adjust:none}}:host{cursor:default;-webkit-user-select:none;user-select:none;min-inline-size:var(--luzmo-color-area-min-width, 64px);min-block-size:var(--luzmo-color-area-min-height, 64px);inline-size:var(--luzmo-color-area-width, 192px);block-size:var(--luzmo-color-area-height, 192px);box-sizing:border-box;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color, var(--luzmo-color-area-border-color, var(--luzmo-border-color)));display:inline-block;position:relative}:host([focused]){z-index:1}:host([disabled]){pointer-events:none;background:var(--highcontrast-color-area-fill-color-disabled, var(--luzmo-color-area-disabled-background-color, var(--luzmo-dimmed-color)));border:var(--luzmo-color-area-border-width, var(--luzmo-border-width)) solid var(--highcontrast-color-area-border-color-disabled)}:host([disabled]) .gradient{display:none}.handle{transform:translate(calc(var(--luzmo-color-area-width, 192px) - var(--luzmo-border-width)));inset-block-start:0}.handle:dir(rtl),:host([dir=rtl]) .handle{inset-inline-end:0}.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-area-border-radius, var(--luzmo-border-radius-s))}.slider{opacity:0;inline-size:100%;block-size:100%;z-index:0;pointer-events:none;margin:0;position:absolute;inset-block-start:0;inset-inline-start:0}:host{touch-action:none}:host:before{pointer-events:none}.gradient{overflow:hidden}.handle{transform:translate(var(--luzmo-color-area-default-width))}::slotted(*){width:100%;height:100%}:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider[orient=vertical]{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}.slider:focus{z-index:1}.fieldset{border:0;margin:0;padding:0}";var zs=Object.defineProperty,vs=Object.getOwnPropertyDescriptor,L=(r,o,e,t)=>{for(var a=t>1?void 0:t?vs(o,e):o,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=(t?s(o,e,a):s(a))||a);return t&&a&&zs(o,e,a),a};let I=class extends d.It{constructor(){super(...arguments),this.disabled=!1,this.focused=!1,this.labelX="saturation",this.labelY="luminosity",this.isLTR=!0,this.languageResolver=new ee.l(this),this.colorController=new Vt(this,{manageAs:"hsv"}),this.activeAxis="x",this.step=.01,this.altered=0,this.activeKeys=new Set,this._valueChanged=!1,this._pointerDown=!1}static get styles(){return[d.at(bs)]}get hue(){return this.colorController.hue}set hue(o){this.colorController.hue=o}get value(){return this.colorController.colorValue}get color(){return this.colorController.colorValue}set color(o){this.colorController.color=o}get x(){return this.colorController.color.hsv.s/100}set x(o){if(o===this.x)return;const e=this.x;this.inputX?(this.inputX.value=o.toString(),this.colorController.color.set("s",this.inputX.valueAsNumber*100)):this.colorController.color.set("s",o*100),this.requestUpdate("x",e)}get y(){return this.colorController.color.hsv.v/100}set y(o){if(o===this.y)return;const e=this.y;this.inputY&&(this.inputY.value=o.toString(),this.colorController.color.set("v",this.inputY.valueAsNumber*100)),this.requestUpdate("y",e)}focus(o={}){super.focus(o),this.forwardFocus()}forwardFocus(){this.activeAxis==="x"?this.inputX.focus():this.inputY.focus()}handleFocus(){this.focused=!0,this._valueChanged=!1}handleBlur(){this._pointerDown||(this.altered=0,this.focused=!1,this._valueChanged=!1)}handleKeydown(o){const{code:e}=o;this.focused=!0,this.altered=[o.shiftKey,o.ctrlKey,o.altKey].filter(t=>!!t).length,(e.search("Arrow")===0||e.search("Page")===0||e.search("Home")===0||e.search("End")===0)&&(o.preventDefault(),this.activeKeys.add(e),this.handleKeypress())}handleKeypress(){let o=0,e=0;const t=Math.max(this.step,this.altered*5*this.step);this.activeKeys.forEach(a=>{switch(a){case"ArrowUp":{e=t;break}case"ArrowDown":{e=t*-1;break}case"ArrowLeft":{o=this.step*(this.isLTR?-1:1);break}case"ArrowRight":{o=this.step*(this.isLTR?1:-1);break}case"PageUp":{e=t*10;break}case"PageDown":{e=t*-10;break}case"Home":{o=t*(this.isLTR?-10:10);break}case"End":{o=t*(this.isLTR?10:-10);break}}}),o!==0?(this.activeAxis="x",this.inputX.focus()):e!==0&&(this.activeAxis="y",this.inputY.focus()),this.x=Math.min(1,Math.max(this.x+o,0)),this.y=Math.min(1,Math.max(this.y+e,0)),this.colorController.savePreviousColor(),(o!==0||e!==0)&&(this._valueChanged=!0,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))||this.colorController.restorePreviousColor())}handleKeyup(o){o.preventDefault();const{code:e}=o;this.activeKeys.delete(e)}handleInput(o){const{valueAsNumber:e,name:t}=o.target;this[t]=e}handleChange(o){this.handleInput(o),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerdown(o){if(o.button!==0){o.preventDefault();return}this._pointerDown=!0,this.colorController.savePreviousColor(),this.boundingClientRect=this.getBoundingClientRect(),o.target.setPointerCapture(o.pointerId),o.pointerType==="mouse"&&(this.focused=!0)}handlePointermove(o){const[e,t]=this.calculateHandlePosition(o);this._valueChanged=!1,this.x=e,this.y=t,this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerup(o){o.preventDefault(),this._pointerDown=!1,o.target.releasePointerCapture(o.pointerId);const e=this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}));this.inputX.focus(),o.pointerType==="mouse"&&(this.focused=!1),e||this.colorController.restorePreviousColor()}calculateHandlePosition(o){if(!this.boundingClientRect)return[this.x,this.y];const e=this.boundingClientRect,t=e.left,a=e.top,l=o.clientX,s=o.clientY,n=e.width,i=e.height,c=Math.max(0,Math.min(1,(l-t)/n)),u=Math.max(0,Math.min(1,(s-a)/i));return[this.isLTR?c:1-c,1-u]}handleAreaPointerdown(o){o.button===0&&(o.stopPropagation(),o.preventDefault(),this.handle.dispatchEvent(new PointerEvent("pointerdown",o)),this.handlePointermove(o))}render(){const{width:o=0,height:e=0}=this.boundingClientRect||{},t=Ve.w()||Ve.a(),a="Color Picker",l=P.m(t?void 0:"2d slider"),s=this.labelX,n=this.labelY,i=new Intl.NumberFormat(this.languageResolver.language,{style:"percent",unitDisplay:"narrow"}).format(this.x),c=new Intl.NumberFormat(this.languageResolver.language,{style:"percent",unitDisplay:"narrow"}).format(this.y),u={background:`linear-gradient(to top, black 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%),linear-gradient(to right, white 0%, hsla(${this.hue}, 100%, 0.01%, 0) 100%), hsl(${this.hue}, 100%, 50%);`};return d.Rt`
|
129
129
|
<div
|
130
130
|
@pointerdown=${this.handleAreaPointerdown}
|
131
131
|
class="gradient"
|
@@ -187,7 +187,7 @@
|
|
187
187
|
/>
|
188
188
|
</div>
|
189
189
|
</fieldset>
|
190
|
-
`}firstUpdated(o){super.firstUpdated(o),this.boundingClientRect=this.getBoundingClientRect(),this.addEventListener("focus",this.handleFocus),this.addEventListener("blur",this.handleBlur),this.addEventListener("keyup",this.handleKeyup),this.addEventListener("keydown",this.handleKeydown)}updated(o){if(super.updated(o),this.x!==this.inputX.valueAsNumber&&this.colorController.color.set("s",this.inputX.valueAsNumber*100),this.y!==this.inputY.valueAsNumber&&this.colorController.color.set("v",(1-this.inputY.valueAsNumber)*100),o.has("focused")&&this.focused){const e=this.inputX.parentElement,t=this.inputY.parentElement;if(!e.shadowRoot&&!t.shadowRoot){e.attachShadow({mode:"open"}),t.attachShadow({mode:"open"});const a='<div tabindex="-1"><slot></slot></div>';e.shadowRoot.innerHTML=a,t.shadowRoot.innerHTML=a}}}connectedCallback(){var o;super.connectedCallback(),!this.observer&&window.ResizeObserver&&(this.observer=new window.ResizeObserver(e=>{for(const t of e)this.boundingClientRect=t.contentRect;this.requestUpdate()})),(o=this.observer)==null||o.observe(this)}disconnectedCallback(){var o;(o=this.observer)==null||o.unobserve(this),super.disconnectedCallback()}};L([d.zt({type:String,reflect:!0})],
|
190
|
+
`}firstUpdated(o){super.firstUpdated(o),this.boundingClientRect=this.getBoundingClientRect(),this.addEventListener("focus",this.handleFocus),this.addEventListener("blur",this.handleBlur),this.addEventListener("keyup",this.handleKeyup),this.addEventListener("keydown",this.handleKeydown)}updated(o){if(super.updated(o),this.x!==this.inputX.valueAsNumber&&this.colorController.color.set("s",this.inputX.valueAsNumber*100),this.y!==this.inputY.valueAsNumber&&this.colorController.color.set("v",(1-this.inputY.valueAsNumber)*100),o.has("focused")&&this.focused){const e=this.inputX.parentElement,t=this.inputY.parentElement;if(!e.shadowRoot&&!t.shadowRoot){e.attachShadow({mode:"open"}),t.attachShadow({mode:"open"});const a='<div tabindex="-1"><slot></slot></div>';e.shadowRoot.innerHTML=a,t.shadowRoot.innerHTML=a}}}connectedCallback(){var o;super.connectedCallback(),!this.observer&&window.ResizeObserver&&(this.observer=new window.ResizeObserver(e=>{for(const t of e)this.boundingClientRect=t.contentRect;this.requestUpdate()})),(o=this.observer)==null||o.observe(this)}disconnectedCallback(){var o;(o=this.observer)==null||o.unobserve(this),super.disconnectedCallback()}};L([d.zt({type:String,reflect:!0})],I.prototype,"dir",2);L([d.zt({type:Boolean,reflect:!0})],I.prototype,"disabled",2);L([d.zt({type:Boolean,reflect:!0})],I.prototype,"focused",2);L([d.zt({type:String,attribute:"label-x"})],I.prototype,"labelX",2);L([d.zt({type:String,attribute:"label-y"})],I.prototype,"labelY",2);L([d.zt({type:Boolean,attribute:"is-ltr"})],I.prototype,"isLTR",2);L([P.d(".handle")],I.prototype,"handle",2);L([d.zt({type:Number})],I.prototype,"hue",1);L([d.zt({type:String})],I.prototype,"value",1);L([d.zt({type:String})],I.prototype,"color",1);L([d.zt({attribute:!1})],I.prototype,"activeAxis",2);L([d.zt({type:Number})],I.prototype,"x",1);L([d.zt({type:Number})],I.prototype,"y",1);L([d.zt({type:Number})],I.prototype,"step",2);L([P.d('[name="x"]')],I.prototype,"inputX",2);L([P.d('[name="y"]')],I.prototype,"inputY",2);customElements.get("luzmo-color-area")||customElements.define("luzmo-color-area",I);/*! * Lucero - The design system for Luzmo.
|
191
191
|
*
|
192
192
|
* Copyright © 2025 Luzmo
|
193
193
|
* All rights reserved.
|
@@ -203,12 +203,12 @@
|
|
203
203
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
204
204
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
205
205
|
* SOFTWARE.
|
206
|
-
* */const
|
207
|
-
<
|
206
|
+
* */const ws=()=>{if(typeof document<"u"&&!document.querySelector("style[data-luzmo-vars]")){const r=document.createElement("style");r.setAttribute("data-luzmo-vars",""),r.textContent='html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}',document.head.appendChild(r)}};ws();const ys=":host{position:relative}";var xs=Object.defineProperty,Jt=(r,o,e,t)=>{for(var a=void 0,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=s(o,e,a)||a);return a&&xs(o,e,a),a};class We extends na.i{constructor(){super(),this.viewColor=!1,this.noAlphaChannel=!1,this._value="",this.colorController=new Vt(this)}static get styles(){return[...super.styles,d.at(ys)]}set value(o){if(o===this.value)return;const e=this._value;this._value=o,this.requestUpdate("value",e)}get value(){return this._value}updated(o){super.updated(o),o.has("noAlphaChannel")&&this.checkValidity()}renderColorHandle(){return this.viewColor&&this.valid?d.Rt`
|
207
|
+
<luzmo-color-handle
|
208
208
|
size="m"
|
209
209
|
color=${this.colorController.getColor("srgb").toString()}
|
210
|
-
></
|
211
|
-
`:d.Rt``}getColorValue(){return this.valid?this.colorController.getColor("srgb").toString():""}render(){return this.viewColor&&Promise.resolve().then(()=>
|
210
|
+
></luzmo-color-handle>
|
211
|
+
`:d.Rt``}getColorValue(){return this.valid?this.colorController.getColor("srgb").toString():""}render(){return this.viewColor&&Promise.resolve().then(()=>ga),d.Rt` ${super.render()} ${this.renderColorHandle()} `}checkValidity(){let o=super.checkValidity();if(this.value){const e=this.colorController.validateColorString(this.value);let t=!1;this.value.startsWith("rgba")?t=!0:this.value.startsWith("rgb")?t=!1:this.value.startsWith("hsla")?t=!0:this.value.startsWith("hsl")?t=!1:this.value.startsWith("#")&&(t=this.value.length===9),this.valid=o=e.isValid&&(!this.noAlphaChannel||!t),this.invalid=!o,this.valid&&(this.colorController.color=this.value)}else this.valid=this.invalid=!1;return o}}Jt([d.zt({type:Boolean,attribute:"view-color"})],We.prototype,"viewColor");Jt([d.zt({type:Boolean,attribute:"no-alpha-channel"})],We.prototype,"noAlphaChannel");customElements.get("luzmo-color-field")||customElements.define("luzmo-color-field",We);/*! * Lucero - The design system for Luzmo.
|
212
212
|
*
|
213
213
|
* Copyright © 2025 Luzmo
|
214
214
|
* All rights reserved.
|
@@ -224,7 +224,7 @@
|
|
224
224
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
225
225
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
226
226
|
* SOFTWARE.
|
227
|
-
* */function I(r,o){Cs(r)&&(r="100%");const e=ks(r);return r=o===360?r:Math.min(o,Math.max(0,parseFloat(r))),e&&(r=parseInt(String(r*o),10)/100),Math.abs(r-o)<1e-6?1:(o===360?r=(r<0?r%o+o:r%o)/parseFloat(String(o)):r=r%o/parseFloat(String(o)),r)}function Ko(r){return Math.min(1,Math.max(0,r))}function Cs(r){return typeof r=="string"&&r.indexOf(".")!==-1&&parseFloat(r)===1}function ks(r){return typeof r=="string"&&r.indexOf("%")!==-1}function Jt(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}function Vo(r){return Number(r)<=1?`${Number(r)*100}%`:r}function bo(r){return r.length===1?"0"+r:String(r)}function Ms(r,o,e){return{r:I(r,255)*255,g:I(o,255)*255,b:I(e,255)*255}}function ot(r,o,e){r=I(r,255),o=I(o,255),e=I(e,255);const t=Math.max(r,o,e),a=Math.min(r,o,e);let l=0,s=0;const n=(t+a)/2;if(t===a)s=0,l=0;else{const i=t-a;switch(s=n>.5?i/(2-t-a):i/(t+a),t){case r:l=(o-e)/i+(o<e?6:0);break;case o:l=(e-r)/i+2;break;case e:l=(r-o)/i+4;break}l/=6}return{h:l,s,l:n}}function xe(r,o,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(o-r)*(6*e):e<1/2?o:e<2/3?r+(o-r)*(2/3-e)*6:r}function $s(r,o,e){let t,a,l;if(r=I(r,360),o=I(o,100),e=I(e,100),o===0)a=e,l=e,t=e;else{const s=e<.5?e*(1+o):e+o-e*o,n=2*e-s;t=xe(n,s,r+1/3),a=xe(n,s,r),l=xe(n,s,r-1/3)}return{r:t*255,g:a*255,b:l*255}}function et(r,o,e){r=I(r,255),o=I(o,255),e=I(e,255);const t=Math.max(r,o,e),a=Math.min(r,o,e);let l=0;const s=t,n=t-a,i=t===0?0:n/t;if(t===a)l=0;else{switch(t){case r:l=(o-e)/n+(o<e?6:0);break;case o:l=(e-r)/n+2;break;case e:l=(r-o)/n+4;break}l/=6}return{h:l,s:i,v:s}}function Ss(r,o,e){r=I(r,360)*6,o=I(o,100),e=I(e,100);const t=Math.floor(r),a=r-t,l=e*(1-o),s=e*(1-a*o),n=e*(1-(1-a)*o),i=t%6,c=[e,s,l,l,n,e][i],u=[n,e,e,s,l,l][i],h=[l,l,n,e,e,s][i];return{r:c*255,g:u*255,b:h*255}}function rt(r,o,e,t){const a=[bo(Math.round(r).toString(16)),bo(Math.round(o).toString(16)),bo(Math.round(e).toString(16))];return t&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function _s(r,o,e,t,a){const l=[bo(Math.round(r).toString(16)),bo(Math.round(o).toString(16)),bo(Math.round(e).toString(16)),bo(As(t))];return a&&l[0].startsWith(l[0].charAt(1))&&l[1].startsWith(l[1].charAt(1))&&l[2].startsWith(l[2].charAt(1))&&l[3].startsWith(l[3].charAt(1))?l[0].charAt(0)+l[1].charAt(0)+l[2].charAt(0)+l[3].charAt(0):l.join("")}function Es(r,o,e,t){const a=r/100,l=o/100,s=e/100,n=t/100,i=255*(1-a)*(1-n),c=255*(1-l)*(1-n),u=255*(1-s)*(1-n);return{r:i,g:c,b:u}}function tt(r,o,e){let t=1-r/255,a=1-o/255,l=1-e/255,s=Math.min(t,a,l);return s===1?(t=0,a=0,l=0):(t=(t-s)/(1-s)*100,a=(a-s)/(1-s)*100,l=(l-s)/(1-s)*100),s*=100,{c:Math.round(t),m:Math.round(a),y:Math.round(l),k:Math.round(s)}}function As(r){return Math.round(parseFloat(r)*255).toString(16)}function at(r){return U(r)/255}function U(r){return parseInt(r,16)}function Rs(r){return{r:r>>16,g:(r&65280)>>8,b:r&255}}const He={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Ps(r){let o={r:0,g:0,b:0},e=1,t=null,a=null,l=null,s=!1,n=!1;return typeof r=="string"&&(r=Bs(r)),typeof r=="object"&&(W(r.r)&&W(r.g)&&W(r.b)?(o=Ms(r.r,r.g,r.b),s=!0,n=String(r.r).substr(-1)==="%"?"prgb":"rgb"):W(r.h)&&W(r.s)&&W(r.v)?(t=Vo(r.s),a=Vo(r.v),o=Ss(r.h,t,a),s=!0,n="hsv"):W(r.h)&&W(r.s)&&W(r.l)?(t=Vo(r.s),l=Vo(r.l),o=$s(r.h,t,l),s=!0,n="hsl"):W(r.c)&&W(r.m)&&W(r.y)&&W(r.k)&&(o=Es(r.c,r.m,r.y,r.k),s=!0,n="cmyk"),Object.prototype.hasOwnProperty.call(r,"a")&&(e=r.a)),e=Jt(e),{ok:s,format:r.format||n,r:Math.min(255,Math.max(o.r,0)),g:Math.min(255,Math.max(o.g,0)),b:Math.min(255,Math.max(o.b,0)),a:e}}const Hs="[-\\+]?\\d+%?",Ns="[-\\+]?\\d*\\.\\d+%?",io="(?:"+Ns+")|(?:"+Hs+")",Ce="[\\s|\\(]+("+io+")[,|\\s]+("+io+")[,|\\s]+("+io+")\\s*\\)?",Jo="[\\s|\\(]+("+io+")[,|\\s]+("+io+")[,|\\s]+("+io+")[,|\\s]+("+io+")\\s*\\)?",K={CSS_UNIT:new RegExp(io),rgb:new RegExp("rgb"+Ce),rgba:new RegExp("rgba"+Jo),hsl:new RegExp("hsl"+Ce),hsla:new RegExp("hsla"+Jo),hsv:new RegExp("hsv"+Ce),hsva:new RegExp("hsva"+Jo),cmyk:new RegExp("cmyk"+Jo),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Bs(r){if(r=r.trim().toLowerCase(),r.length===0)return!1;let o=!1;if(He[r])r=He[r],o=!0;else if(r==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let e=K.rgb.exec(r);return e?{r:e[1],g:e[2],b:e[3]}:(e=K.rgba.exec(r),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=K.hsl.exec(r),e?{h:e[1],s:e[2],l:e[3]}:(e=K.hsla.exec(r),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=K.hsv.exec(r),e?{h:e[1],s:e[2],v:e[3]}:(e=K.hsva.exec(r),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=K.cmyk.exec(r),e?{c:e[1],m:e[2],y:e[3],k:e[4]}:(e=K.hex8.exec(r),e?{r:U(e[1]),g:U(e[2]),b:U(e[3]),a:at(e[4]),format:o?"name":"hex8"}:(e=K.hex6.exec(r),e?{r:U(e[1]),g:U(e[2]),b:U(e[3]),format:o?"name":"hex"}:(e=K.hex4.exec(r),e?{r:U(e[1]+e[1]),g:U(e[2]+e[2]),b:U(e[3]+e[3]),a:at(e[4]+e[4]),format:o?"name":"hex8"}:(e=K.hex3.exec(r),e?{r:U(e[1]+e[1]),g:U(e[2]+e[2]),b:U(e[3]+e[3]),format:o?"name":"hex"}:!1))))))))))}function W(r){return typeof r=="number"?!Number.isNaN(r):K.CSS_UNIT.test(r)}let N=class A{constructor(o="",e={}){if(o instanceof A)return o;typeof o=="number"&&(o=Rs(o)),this.originalInput=o;const t=Ps(o);this.originalInput=o,this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this.roundA=Math.round(100*this.a)/100,this.format=e.format??t.format,this.gradientType=e.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=t.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const o=this.toRgb();return(o.r*299+o.g*587+o.b*114)/1e3}getLuminance(){const o=this.toRgb();let e,t,a;const l=o.r/255,s=o.g/255,n=o.b/255;return l<=.03928?e=l/12.92:e=Math.pow((l+.055)/1.055,2.4),s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),.2126*e+.7152*t+.0722*a}getAlpha(){return this.a}setAlpha(o){return this.a=Jt(o),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:o}=this.toHsl();return o===0}toHsv(){const o=et(this.r,this.g,this.b);return{h:o.h*360,s:o.s,v:o.v,a:this.a}}toHsvString(){const o=et(this.r,this.g,this.b),e=Math.round(o.h*360),t=Math.round(o.s*100),a=Math.round(o.v*100);return this.a===1?`hsv(${e}, ${t}%, ${a}%)`:`hsva(${e}, ${t}%, ${a}%, ${this.roundA})`}toHsl(){const o=ot(this.r,this.g,this.b);return{h:o.h*360,s:o.s,l:o.l,a:this.a}}toHslString(){const o=ot(this.r,this.g,this.b),e=Math.round(o.h*360),t=Math.round(o.s*100),a=Math.round(o.l*100);return this.a===1?`hsl(${e}, ${t}%, ${a}%)`:`hsla(${e}, ${t}%, ${a}%, ${this.roundA})`}toHex(o=!1){return rt(this.r,this.g,this.b,o)}toHexString(o=!1){return"#"+this.toHex(o)}toHex8(o=!1){return _s(this.r,this.g,this.b,this.a,o)}toHex8String(o=!1){return"#"+this.toHex8(o)}toHexShortString(o=!1){return this.a===1?this.toHexString(o):this.toHex8String(o)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const o=Math.round(this.r),e=Math.round(this.g),t=Math.round(this.b);return this.a===1?`rgb(${o}, ${e}, ${t})`:`rgba(${o}, ${e}, ${t}, ${this.roundA})`}toPercentageRgb(){const o=e=>`${Math.round(I(e,255)*100)}%`;return{r:o(this.r),g:o(this.g),b:o(this.b),a:this.a}}toPercentageRgbString(){const o=e=>Math.round(I(e,255)*100);return this.a===1?`rgb(${o(this.r)}%, ${o(this.g)}%, ${o(this.b)}%)`:`rgba(${o(this.r)}%, ${o(this.g)}%, ${o(this.b)}%, ${this.roundA})`}toCmyk(){return{...tt(this.r,this.g,this.b)}}toCmykString(){const{c:o,m:e,y:t,k:a}=tt(this.r,this.g,this.b);return`cmyk(${o}, ${e}, ${t}, ${a})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const o="#"+rt(this.r,this.g,this.b,!1);for(const[e,t]of Object.entries(He))if(o===t)return e;return!1}toString(o){const e=!!o;o=o??this.format;let t=!1;const a=this.a<1&&this.a>=0;return!e&&a&&(o.startsWith("hex")||o==="name")?o==="name"&&this.a===0?this.toName():this.toRgbString():(o==="rgb"&&(t=this.toRgbString()),o==="prgb"&&(t=this.toPercentageRgbString()),(o==="hex"||o==="hex6")&&(t=this.toHexString()),o==="hex3"&&(t=this.toHexString(!0)),o==="hex4"&&(t=this.toHex8String(!0)),o==="hex8"&&(t=this.toHex8String()),o==="name"&&(t=this.toName()),o==="hsl"&&(t=this.toHslString()),o==="hsv"&&(t=this.toHsvString()),o==="cmyk"&&(t=this.toCmykString()),t||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new A(this.toString())}lighten(o=10){const e=this.toHsl();return e.l+=o/100,e.l=Ko(e.l),new A(e)}brighten(o=10){const e=this.toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(o/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(o/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(o/100)))),new A(e)}darken(o=10){const e=this.toHsl();return e.l-=o/100,e.l=Ko(e.l),new A(e)}tint(o=10){return this.mix("white",o)}shade(o=10){return this.mix("black",o)}desaturate(o=10){const e=this.toHsl();return e.s-=o/100,e.s=Ko(e.s),new A(e)}saturate(o=10){const e=this.toHsl();return e.s+=o/100,e.s=Ko(e.s),new A(e)}greyscale(){return this.desaturate(100)}spin(o){const e=this.toHsl(),t=(e.h+o)%360;return e.h=t<0?360+t:t,new A(e)}mix(o,e=50){const t=this.toRgb(),a=new A(o).toRgb(),l=e/100,s={r:(a.r-t.r)*l+t.r,g:(a.g-t.g)*l+t.g,b:(a.b-t.b)*l+t.b,a:(a.a-t.a)*l+t.a};return new A(s)}analogous(o=6,e=30){const t=this.toHsl(),a=360/e,l=[this];for(t.h=(t.h-(a*o>>1)+720)%360;--o;)t.h=(t.h+a)%360,l.push(new A(t));return l}complement(){const o=this.toHsl();return o.h=(o.h+180)%360,new A(o)}monochromatic(o=6){const e=this.toHsv(),{h:t}=e,{s:a}=e;let{v:l}=e;const s=[],n=1/o;for(;o--;)s.push(new A({h:t,s:a,v:l})),l=(l+n)%1;return s}splitcomplement(){const o=this.toHsl(),{h:e}=o;return[this,new A({h:(e+72)%360,s:o.s,l:o.l}),new A({h:(e+216)%360,s:o.s,l:o.l})]}onBackground(o){const e=this.toRgb(),t=new A(o).toRgb(),a=e.a+t.a*(1-e.a);return new A({r:(e.r*e.a+t.r*t.a*(1-e.a))/a,g:(e.g*e.a+t.g*t.a*(1-e.a))/a,b:(e.b*e.a+t.b*t.a*(1-e.a))/a,a})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(o){const e=this.toHsl(),{h:t}=e,a=[this],l=360/o;for(let s=1;s<o;s++)a.push(new A({h:(t+s*l)%360,s:e.s,l:e.l}));return a}equals(o){const e=new A(o);return this.format==="cmyk"||e.format==="cmyk"?this.toCmykString()===e.toCmykString():this.toRgbString()===e.toRgbString()}};const lt=/^hs[v|l]a?\s?\((\d{1,3}\.?\d*?),?\s?(\d{1,3})/,st=/(^hs[v|l]a?\s?\()\d{1,3}\.?\d*?(,?\s?)\d{1,3}/,nt=/(^hs[v|l]a?\()\d{1,3}/,Qo=(r,o)=>o?r.toHexString():r.toHex();class Is{constructor(o,{applyColorToState:e,extractColorFromState:t,maintains:a}){this.maintains="hue",this._hue=0,this._opacity=1,this.getColorProcesses={rgb:(l,s)=>s?l.toRgbString():l.toRgb(),prgb:(l,s)=>s?l.toPercentageRgbString():l.toPercentageRgb(),hex8:(l,s)=>s?l.toHex8String():l.toHex8(),name:l=>l.toName()||l.toRgbString(),hsl:(l,s)=>{if(this.maintains==="hue"){if(s)return l.toHslString().replace(nt,`$1${this.hue}`);const{s:u,l:h,a:m}=l.toHsl();return{h:this.hue,s:u,l:h,a:m}}if(s)return l.toHslString().replace(st,`$1${this.hue}$2${this.saturation}`);const{s:n,l:i,a:c}=l.toHsl();return{h:this.hue,s:n,l:i,a:c}},hsv:(l,s)=>{if(this.maintains==="hue"){if(s)return l.toHsvString().replace(nt,`$1${this.hue}`);const{s:u,v:h,a:m}=l.toHsv();return{h:this.hue,s:u,v:h,a:m}}if(s)return l.toHsvString().replace(st,`$1${this.hue}$2${this.saturation}`);const{s:n,v:i,a:c}=l.toHsv();return{h:this.hue,s:n,v:i,a:c}},hex:Qo,hex3:Qo,hex4:Qo,hex6:Qo},this._color=new N({h:0,s:1,v:1}),this._previousColor=new N({h:0,s:1,v:1}),this._format={format:"",isString:!1},this.host=o,this.applyColorToState=e,this.extractColorFromState=t,this.maintains=a||this.maintains}setColorProcess(o,e,t,a){this.maintains==="hue"?this.setColorMaintainHue(o,e,t,a):this.maintains==="saturation"&&this.setColorMaintainSaturation(o,e,t,a)}setColorMaintainHue(o,e,t,a){const{h:l,s,v:n,a:i}=this._color.toHsv();let c;if(a&&t.startsWith("hs")){const u=lt.exec(e);if(u!==null){const[,h]=u;c=Number(h)}}else if(!a&&t.startsWith("hs")){const u=o.originalInput;c=Object.values(u)[0]}this.hue=c||l,this.opacity=i??1,this.applyColorToState({h:l,s,v:n,a:i})}setColorMaintainSaturation(o,e,t,a){const{a:l}=this._color.toHsv();if(a&&t.startsWith("hs")){const s=lt.exec(e);if(s!==null){const[,n,i]=s;this.hue=Number(n),this.saturation=Number(i)}}else if(!a&&t.startsWith("hs")){const s=o.originalInput,n=Object.values(s);this.hue=n[0],this.saturation=n[1]}else{const{h:s}=o.toHsv();this.hue=s}this.opacity=l??1,this.applyColorToState(o.toHsv())}applyColorFromState(){this._color=new N(this.extractColorFromState(this))}get hue(){return this._hue}set hue(o){const e=Math.min(360,Math.max(0,o));if(e===this.hue)return;const t=this.hue,{s:a,v:l,a:s}=this._color.toHsv();this._color=new N({h:e,s:a,v:l,a:s}),this._hue=e,this.host.requestUpdate("hue",t)}get opacity(){return this._opacity}set opacity(o){const e=Math.min(1,Math.max(0,o));if(e===this.opacity)return;const t=this.opacity,{h:a,s:l,v:s}=this._color.toHsv();this._color=new N({h:a,s:l,v:s,a:e}),this._opacity=e,this.host.requestUpdate("opacity",t)}get value(){return this.color}get color(){return this.getColorProcesses[this._format.format||"hex"](this._color,this._format.isString)}set color(o){if(o===this.color)return;const e=this._color;this._color=new N(o);const t=this._color.format;let a=typeof o=="string"||o instanceof String;t.startsWith("hex")&&(a=o.startsWith("#")),this._format={format:t,isString:a},this.setColorProcess(this._color,o,t,a),this.host.requestUpdate("color",e)}getColor(o){const e={hsl:"toHsl"};return this._color[e[o]]()}setColor(o){this._color=o;const e=typeof this._color.originalInput=="string"||this._color.originalInput instanceof String;this.setColorProcess(this._color,o,this._color.format,e)}getHslString(){return this._color.toHslString()}savePreviousColor(){this._previousColor=this._color.clone()}restorePreviousColor(){this.setColor(this._previousColor)}}const Os='.opacity-checkerboard{position:absolute;block-size:100%;inline-size:100%;background:repeating-conic-gradient(var(--luzmo-color-loupe-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-color-loupe-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-color-loupe-checkerboard-position, left top)/calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2) calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2)}:host{--luzmo-color-slider-gradient-fallback: rgb(255 0 0) 0%, rgb(255 255 0) 17%, rgb(0 255 0) 33%, rgb(0 255 255) 50%, rgb(0 0 255) 67%, rgb(255 0 255) 83%, rgb(255 0 0) 100%;touch-action:none}:host([vertical]) .handle{inset-block-start:unset;inset-block-end:0}:host([vertical]) .slider{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}:host(:focus){outline:none}.gradient{overflow:hidden}::slotted(*){width:100%;height:100%}@media (forced-colors: active){:host{--highcontrast-color-slider-border-color: CanvasText;--highcontrast-color-slider-border-color-disabled: GrayText;--highcontrast-color-slider-background-color-disabled: Canvas;forced-color-adjust:none}}:host{--luzmo-color-handle-hitarea-border-radius: var( --luzmo-color-slider-handle-hitarea-border-radius, 0px );min-inline-size:var(--luzmo-color-slider-minimum-length, 80px);inline-size:var(--luzmo-color-slider-length, 192px);block-size:var(--luzmo-color-slider-control-track-width, 24px);-webkit-user-select:none;user-select:none;cursor:default;display:block;position:relative}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host([disabled]) .gradient{display:none}:host([vertical]){min-block-size:var(--luzmo-color-slider-vertical-minimum-height, var(--luzmo-color-slider-minimum-length, 80px));block-size:var(--luzmo-color-slider-vertical-height, var(--luzmo-color-slider-length, 192px));min-inline-size:0;inline-size:var(--luzmo-color-slider-vertical-control-track-width, var(--luzmo-color-slider-control-track-height, 24px));display:inline-block}:host([vertical]) .handle{inset-inline-start:50%}.handle{inset-block-start:50%;inset-inline-start:0}.checkerboard{--luzmo-color-slider-border-color-local: var( --highcontrast-color-slider-border-color, var(--luzmo-color-slider-border-color, var(--luzmo-border-color)) )}.checkerboard:before{content:"";z-index:1;box-shadow:inset 0 0 0 var(--luzmo-color-slider-border-width, var(--luzmo-border-width)) var(--luzmo-color-slider-border-color-local);border-radius:var(--luzmo-color-slider-border-rounding, var(--luzmo-border-radius-s));position:absolute;top:0;right:0;bottom:0;left:0}:host([disabled]) .checkerboard{--luzmo-color-slider-border-color-local: var( --highcontrast-color-slider-border-color-disabled, var(--luzmo-color-slider-border-color-disabled, var(--luzmo-dimmed-color)) );background:var(--highcontrast-color-slider-background-color-disabled, var(--luzmo-color-slider-background-color-disabled, var(--luzmo-dimmed-color)))}.checkerboard,.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-slider-border-rounding, var(--luzmo-border-radius-s))}.gradient:dir(rtl),:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider{opacity:0;inline-size:100%;block-size:100%;z-index:0;pointer-events:none;margin:0;position:absolute;inset-block-start:0;inset-inline-start:0}';var Fs=Object.defineProperty,Ls=Object.getOwnPropertyDescriptor,Z=(r,o,e,t)=>{for(var a=t>1?void 0:t?Ls(o,e):o,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=(t?s(o,e,a):s(a))||a);return t&&a&&Fs(o,e,a),a};let q=class extends Ne.r{constructor(){super(...arguments),this.disabled=!1,this.focused=!1,this.label="hue",this.vertical=!1,this.languageResolver=new ee.l(this),this.colorController=new Is(this,{applyColorToState:()=>{if(this.mode==="opacity"){const o=new N(this.colorController.color);this.sliderHandlePosition=100*o.getAlpha()}else this.sliderHandlePosition=100*(this.colorController.hue/360)},extractColorFromState:o=>this.mode==="opacity"?{...o.getColor("hsl"),a:this.value}:{...o.getColor("hsl"),h:this.value},maintains:"saturation"}),this.sliderHandlePosition=0,this.step=1,this.isLTR=!0,this._altered=0,this._pointerDown=!1}static get styles(){return[d.at(Os)]}get value(){return this.mode==="opacity"?this.colorController.opacity:this.colorController.hue}set value(o){this.mode==="opacity"?this.colorController.opacity=o:this.colorController.hue=o}get color(){return this.colorController.color}set color(o){this.colorController.color=o}get altered(){return this._altered}set altered(o){this._altered=o,this.step=Math.max(1,this.altered*10)}get focusElement(){return this.input}handleKeydown(o){const{key:e}=o;this.focused=!0,this.altered=[o.shiftKey,o.ctrlKey,o.altKey].filter(l=>!!l).length;let t=0;switch(e){case"ArrowUp":{t=this.step;break}case"ArrowDown":{t=-this.step;break}case"ArrowLeft":{t=this.step*(this.isLTR?-1:1);break}case"ArrowRight":{t=this.step*(this.isLTR?1:-1);break}default:return}o.preventDefault();const a=100/(this.mode==="opacity"?100:360);this.sliderHandlePosition=Math.min(100,Math.max(0,this.sliderHandlePosition+t*a)),this.value=this.mode==="opacity"?Math.min(1,Math.max(0,this.value+t/100)):Math.min(360,Math.max(0,this.value+t)),this.colorController.applyColorFromState(),t!==0&&(this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}handleInput(o){const{valueAsNumber:e}=o.target;this.value=e,this.sliderHandlePosition=100*(this.mode==="opacity"?this.value:this.value/360),this.colorController.applyColorFromState()}handleChange(o){this.handleInput(o),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}focus(o={}){super.focus(o),this.forwardFocus()}forwardFocus(){this.input.focus()}handleFocus(){this.focused=!0}handleBlur(){this._pointerDown||(this.altered=0,this.focused=!1)}handlePointerdown(o){if(o.button!==0){o.preventDefault();return}this._pointerDown=!0,this.colorController.savePreviousColor(),this.boundingClientRect=this.getBoundingClientRect(),o.target.setPointerCapture(o.pointerId),o.pointerType==="mouse"&&(this.focused=!0)}handlePointermove(o){this.sliderHandlePosition=this.calculateHandlePosition(o),this.value=(this.mode==="opacity"?1:360)*(this.sliderHandlePosition/100),this.colorController.applyColorFromState(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerup(o){this._pointerDown=!1,o.target.releasePointerCapture(o.pointerId),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))||this.colorController.restorePreviousColor(),this.focus(),o.pointerType==="mouse"&&(this.focused=!1)}calculateHandlePosition(o){if(!this.boundingClientRect)return this.sliderHandlePosition;const e=this.boundingClientRect,t=this.vertical?e.top:e.left,a=this.vertical?o.clientY:o.clientX,l=this.vertical?e.height:e.width,s=Math.max(0,Math.min(1,(a-t)/l));return this.vertical||!this.isLTR?100-100*s:100*s}handleGradientPointerdown(o){o.button===0&&(o.stopPropagation(),o.preventDefault(),this.handle.dispatchEvent(new PointerEvent("pointerdown",o)),this.handlePointermove(o))}get handlePositionStyles(){return`${this.vertical?"inset-block-end":"inset-inline-start"}: ${this.sliderHandlePosition}%`}get getColorSliderStyle(){const o=this.vertical?"top":"right";if(this.mode==="opacity"){const e=new N(this.colorController.color).setAlpha(1).toRgbString();return{background:`linear-gradient(to ${o}, transparent, ${e})`}}return{background:`linear-gradient(to ${o}, var(--luzmo-color-slider-gradient, var(--luzmo-color-slider-gradient-fallback)))`}}render(){return d.Rt`
|
227
|
+
* */function O(r,o){Cs(r)&&(r="100%");const e=ks(r);return r=o===360?r:Math.min(o,Math.max(0,parseFloat(r))),e&&(r=parseInt(String(r*o),10)/100),Math.abs(r-o)<1e-6?1:(o===360?r=(r<0?r%o+o:r%o)/parseFloat(String(o)):r=r%o/parseFloat(String(o)),r)}function Ko(r){return Math.min(1,Math.max(0,r))}function Cs(r){return typeof r=="string"&&r.indexOf(".")!==-1&&parseFloat(r)===1}function ks(r){return typeof r=="string"&&r.indexOf("%")!==-1}function Qt(r){return r=parseFloat(r),(isNaN(r)||r<0||r>1)&&(r=1),r}function Vo(r){return Number(r)<=1?`${Number(r)*100}%`:r}function bo(r){return r.length===1?"0"+r:String(r)}function Ms(r,o,e){return{r:O(r,255)*255,g:O(o,255)*255,b:O(e,255)*255}}function et(r,o,e){r=O(r,255),o=O(o,255),e=O(e,255);const t=Math.max(r,o,e),a=Math.min(r,o,e);let l=0,s=0;const n=(t+a)/2;if(t===a)s=0,l=0;else{const i=t-a;switch(s=n>.5?i/(2-t-a):i/(t+a),t){case r:l=(o-e)/i+(o<e?6:0);break;case o:l=(e-r)/i+2;break;case e:l=(r-o)/i+4;break}l/=6}return{h:l,s,l:n}}function xe(r,o,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?r+(o-r)*(6*e):e<1/2?o:e<2/3?r+(o-r)*(2/3-e)*6:r}function $s(r,o,e){let t,a,l;if(r=O(r,360),o=O(o,100),e=O(e,100),o===0)a=e,l=e,t=e;else{const s=e<.5?e*(1+o):e+o-e*o,n=2*e-s;t=xe(n,s,r+1/3),a=xe(n,s,r),l=xe(n,s,r-1/3)}return{r:t*255,g:a*255,b:l*255}}function rt(r,o,e){r=O(r,255),o=O(o,255),e=O(e,255);const t=Math.max(r,o,e),a=Math.min(r,o,e);let l=0;const s=t,n=t-a,i=t===0?0:n/t;if(t===a)l=0;else{switch(t){case r:l=(o-e)/n+(o<e?6:0);break;case o:l=(e-r)/n+2;break;case e:l=(r-o)/n+4;break}l/=6}return{h:l,s:i,v:s}}function Ss(r,o,e){r=O(r,360)*6,o=O(o,100),e=O(e,100);const t=Math.floor(r),a=r-t,l=e*(1-o),s=e*(1-a*o),n=e*(1-(1-a)*o),i=t%6,c=[e,s,l,l,n,e][i],u=[n,e,e,s,l,l][i],h=[l,l,n,e,e,s][i];return{r:c*255,g:u*255,b:h*255}}function tt(r,o,e,t){const a=[bo(Math.round(r).toString(16)),bo(Math.round(o).toString(16)),bo(Math.round(e).toString(16))];return t&&a[0].startsWith(a[0].charAt(1))&&a[1].startsWith(a[1].charAt(1))&&a[2].startsWith(a[2].charAt(1))?a[0].charAt(0)+a[1].charAt(0)+a[2].charAt(0):a.join("")}function _s(r,o,e,t,a){const l=[bo(Math.round(r).toString(16)),bo(Math.round(o).toString(16)),bo(Math.round(e).toString(16)),bo(As(t))];return a&&l[0].startsWith(l[0].charAt(1))&&l[1].startsWith(l[1].charAt(1))&&l[2].startsWith(l[2].charAt(1))&&l[3].startsWith(l[3].charAt(1))?l[0].charAt(0)+l[1].charAt(0)+l[2].charAt(0)+l[3].charAt(0):l.join("")}function Es(r,o,e,t){const a=r/100,l=o/100,s=e/100,n=t/100,i=255*(1-a)*(1-n),c=255*(1-l)*(1-n),u=255*(1-s)*(1-n);return{r:i,g:c,b:u}}function at(r,o,e){let t=1-r/255,a=1-o/255,l=1-e/255,s=Math.min(t,a,l);return s===1?(t=0,a=0,l=0):(t=(t-s)/(1-s)*100,a=(a-s)/(1-s)*100,l=(l-s)/(1-s)*100),s*=100,{c:Math.round(t),m:Math.round(a),y:Math.round(l),k:Math.round(s)}}function As(r){return Math.round(parseFloat(r)*255).toString(16)}function lt(r){return U(r)/255}function U(r){return parseInt(r,16)}function Rs(r){return{r:r>>16,g:(r&65280)>>8,b:r&255}}const He={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function Ps(r){let o={r:0,g:0,b:0},e=1,t=null,a=null,l=null,s=!1,n=!1;return typeof r=="string"&&(r=Ns(r)),typeof r=="object"&&(W(r.r)&&W(r.g)&&W(r.b)?(o=Ms(r.r,r.g,r.b),s=!0,n=String(r.r).substr(-1)==="%"?"prgb":"rgb"):W(r.h)&&W(r.s)&&W(r.v)?(t=Vo(r.s),a=Vo(r.v),o=Ss(r.h,t,a),s=!0,n="hsv"):W(r.h)&&W(r.s)&&W(r.l)?(t=Vo(r.s),l=Vo(r.l),o=$s(r.h,t,l),s=!0,n="hsl"):W(r.c)&&W(r.m)&&W(r.y)&&W(r.k)&&(o=Es(r.c,r.m,r.y,r.k),s=!0,n="cmyk"),Object.prototype.hasOwnProperty.call(r,"a")&&(e=r.a)),e=Qt(e),{ok:s,format:r.format||n,r:Math.min(255,Math.max(o.r,0)),g:Math.min(255,Math.max(o.g,0)),b:Math.min(255,Math.max(o.b,0)),a:e}}const Hs="[-\\+]?\\d+%?",Bs="[-\\+]?\\d*\\.\\d+%?",io="(?:"+Bs+")|(?:"+Hs+")",Ce="[\\s|\\(]+("+io+")[,|\\s]+("+io+")[,|\\s]+("+io+")\\s*\\)?",Jo="[\\s|\\(]+("+io+")[,|\\s]+("+io+")[,|\\s]+("+io+")[,|\\s]+("+io+")\\s*\\)?",V={CSS_UNIT:new RegExp(io),rgb:new RegExp("rgb"+Ce),rgba:new RegExp("rgba"+Jo),hsl:new RegExp("hsl"+Ce),hsla:new RegExp("hsla"+Jo),hsv:new RegExp("hsv"+Ce),hsva:new RegExp("hsva"+Jo),cmyk:new RegExp("cmyk"+Jo),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function Ns(r){if(r=r.trim().toLowerCase(),r.length===0)return!1;let o=!1;if(He[r])r=He[r],o=!0;else if(r==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};let e=V.rgb.exec(r);return e?{r:e[1],g:e[2],b:e[3]}:(e=V.rgba.exec(r),e?{r:e[1],g:e[2],b:e[3],a:e[4]}:(e=V.hsl.exec(r),e?{h:e[1],s:e[2],l:e[3]}:(e=V.hsla.exec(r),e?{h:e[1],s:e[2],l:e[3],a:e[4]}:(e=V.hsv.exec(r),e?{h:e[1],s:e[2],v:e[3]}:(e=V.hsva.exec(r),e?{h:e[1],s:e[2],v:e[3],a:e[4]}:(e=V.cmyk.exec(r),e?{c:e[1],m:e[2],y:e[3],k:e[4]}:(e=V.hex8.exec(r),e?{r:U(e[1]),g:U(e[2]),b:U(e[3]),a:lt(e[4]),format:o?"name":"hex8"}:(e=V.hex6.exec(r),e?{r:U(e[1]),g:U(e[2]),b:U(e[3]),format:o?"name":"hex"}:(e=V.hex4.exec(r),e?{r:U(e[1]+e[1]),g:U(e[2]+e[2]),b:U(e[3]+e[3]),a:lt(e[4]+e[4]),format:o?"name":"hex8"}:(e=V.hex3.exec(r),e?{r:U(e[1]+e[1]),g:U(e[2]+e[2]),b:U(e[3]+e[3]),format:o?"name":"hex"}:!1))))))))))}function W(r){return typeof r=="number"?!Number.isNaN(r):V.CSS_UNIT.test(r)}let B=class A{constructor(o="",e={}){if(o instanceof A)return o;typeof o=="number"&&(o=Rs(o)),this.originalInput=o;const t=Ps(o);this.originalInput=o,this.r=t.r,this.g=t.g,this.b=t.b,this.a=t.a,this.roundA=Math.round(100*this.a)/100,this.format=e.format??t.format,this.gradientType=e.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=t.ok}isDark(){return this.getBrightness()<128}isLight(){return!this.isDark()}getBrightness(){const o=this.toRgb();return(o.r*299+o.g*587+o.b*114)/1e3}getLuminance(){const o=this.toRgb();let e,t,a;const l=o.r/255,s=o.g/255,n=o.b/255;return l<=.03928?e=l/12.92:e=Math.pow((l+.055)/1.055,2.4),s<=.03928?t=s/12.92:t=Math.pow((s+.055)/1.055,2.4),n<=.03928?a=n/12.92:a=Math.pow((n+.055)/1.055,2.4),.2126*e+.7152*t+.0722*a}getAlpha(){return this.a}setAlpha(o){return this.a=Qt(o),this.roundA=Math.round(100*this.a)/100,this}isMonochrome(){const{s:o}=this.toHsl();return o===0}toHsv(){const o=rt(this.r,this.g,this.b);return{h:o.h*360,s:o.s,v:o.v,a:this.a}}toHsvString(){const o=rt(this.r,this.g,this.b),e=Math.round(o.h*360),t=Math.round(o.s*100),a=Math.round(o.v*100);return this.a===1?`hsv(${e}, ${t}%, ${a}%)`:`hsva(${e}, ${t}%, ${a}%, ${this.roundA})`}toHsl(){const o=et(this.r,this.g,this.b);return{h:o.h*360,s:o.s,l:o.l,a:this.a}}toHslString(){const o=et(this.r,this.g,this.b),e=Math.round(o.h*360),t=Math.round(o.s*100),a=Math.round(o.l*100);return this.a===1?`hsl(${e}, ${t}%, ${a}%)`:`hsla(${e}, ${t}%, ${a}%, ${this.roundA})`}toHex(o=!1){return tt(this.r,this.g,this.b,o)}toHexString(o=!1){return"#"+this.toHex(o)}toHex8(o=!1){return _s(this.r,this.g,this.b,this.a,o)}toHex8String(o=!1){return"#"+this.toHex8(o)}toHexShortString(o=!1){return this.a===1?this.toHexString(o):this.toHex8String(o)}toRgb(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}}toRgbString(){const o=Math.round(this.r),e=Math.round(this.g),t=Math.round(this.b);return this.a===1?`rgb(${o}, ${e}, ${t})`:`rgba(${o}, ${e}, ${t}, ${this.roundA})`}toPercentageRgb(){const o=e=>`${Math.round(O(e,255)*100)}%`;return{r:o(this.r),g:o(this.g),b:o(this.b),a:this.a}}toPercentageRgbString(){const o=e=>Math.round(O(e,255)*100);return this.a===1?`rgb(${o(this.r)}%, ${o(this.g)}%, ${o(this.b)}%)`:`rgba(${o(this.r)}%, ${o(this.g)}%, ${o(this.b)}%, ${this.roundA})`}toCmyk(){return{...at(this.r,this.g,this.b)}}toCmykString(){const{c:o,m:e,y:t,k:a}=at(this.r,this.g,this.b);return`cmyk(${o}, ${e}, ${t}, ${a})`}toName(){if(this.a===0)return"transparent";if(this.a<1)return!1;const o="#"+tt(this.r,this.g,this.b,!1);for(const[e,t]of Object.entries(He))if(o===t)return e;return!1}toString(o){const e=!!o;o=o??this.format;let t=!1;const a=this.a<1&&this.a>=0;return!e&&a&&(o.startsWith("hex")||o==="name")?o==="name"&&this.a===0?this.toName():this.toRgbString():(o==="rgb"&&(t=this.toRgbString()),o==="prgb"&&(t=this.toPercentageRgbString()),(o==="hex"||o==="hex6")&&(t=this.toHexString()),o==="hex3"&&(t=this.toHexString(!0)),o==="hex4"&&(t=this.toHex8String(!0)),o==="hex8"&&(t=this.toHex8String()),o==="name"&&(t=this.toName()),o==="hsl"&&(t=this.toHslString()),o==="hsv"&&(t=this.toHsvString()),o==="cmyk"&&(t=this.toCmykString()),t||this.toHexString())}toNumber(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)}clone(){return new A(this.toString())}lighten(o=10){const e=this.toHsl();return e.l+=o/100,e.l=Ko(e.l),new A(e)}brighten(o=10){const e=this.toRgb();return e.r=Math.max(0,Math.min(255,e.r-Math.round(255*-(o/100)))),e.g=Math.max(0,Math.min(255,e.g-Math.round(255*-(o/100)))),e.b=Math.max(0,Math.min(255,e.b-Math.round(255*-(o/100)))),new A(e)}darken(o=10){const e=this.toHsl();return e.l-=o/100,e.l=Ko(e.l),new A(e)}tint(o=10){return this.mix("white",o)}shade(o=10){return this.mix("black",o)}desaturate(o=10){const e=this.toHsl();return e.s-=o/100,e.s=Ko(e.s),new A(e)}saturate(o=10){const e=this.toHsl();return e.s+=o/100,e.s=Ko(e.s),new A(e)}greyscale(){return this.desaturate(100)}spin(o){const e=this.toHsl(),t=(e.h+o)%360;return e.h=t<0?360+t:t,new A(e)}mix(o,e=50){const t=this.toRgb(),a=new A(o).toRgb(),l=e/100,s={r:(a.r-t.r)*l+t.r,g:(a.g-t.g)*l+t.g,b:(a.b-t.b)*l+t.b,a:(a.a-t.a)*l+t.a};return new A(s)}analogous(o=6,e=30){const t=this.toHsl(),a=360/e,l=[this];for(t.h=(t.h-(a*o>>1)+720)%360;--o;)t.h=(t.h+a)%360,l.push(new A(t));return l}complement(){const o=this.toHsl();return o.h=(o.h+180)%360,new A(o)}monochromatic(o=6){const e=this.toHsv(),{h:t}=e,{s:a}=e;let{v:l}=e;const s=[],n=1/o;for(;o--;)s.push(new A({h:t,s:a,v:l})),l=(l+n)%1;return s}splitcomplement(){const o=this.toHsl(),{h:e}=o;return[this,new A({h:(e+72)%360,s:o.s,l:o.l}),new A({h:(e+216)%360,s:o.s,l:o.l})]}onBackground(o){const e=this.toRgb(),t=new A(o).toRgb(),a=e.a+t.a*(1-e.a);return new A({r:(e.r*e.a+t.r*t.a*(1-e.a))/a,g:(e.g*e.a+t.g*t.a*(1-e.a))/a,b:(e.b*e.a+t.b*t.a*(1-e.a))/a,a})}triad(){return this.polyad(3)}tetrad(){return this.polyad(4)}polyad(o){const e=this.toHsl(),{h:t}=e,a=[this],l=360/o;for(let s=1;s<o;s++)a.push(new A({h:(t+s*l)%360,s:e.s,l:e.l}));return a}equals(o){const e=new A(o);return this.format==="cmyk"||e.format==="cmyk"?this.toCmykString()===e.toCmykString():this.toRgbString()===e.toRgbString()}};const st=/^hs[v|l]a?\s?\((\d{1,3}\.?\d*?),?\s?(\d{1,3})/,nt=/(^hs[v|l]a?\s?\()\d{1,3}\.?\d*?(,?\s?)\d{1,3}/,it=/(^hs[v|l]a?\()\d{1,3}/,Qo=(r,o)=>o?r.toHexString():r.toHex();class Os{constructor(o,{applyColorToState:e,extractColorFromState:t,maintains:a}){this.maintains="hue",this._hue=0,this._opacity=1,this.getColorProcesses={rgb:(l,s)=>s?l.toRgbString():l.toRgb(),prgb:(l,s)=>s?l.toPercentageRgbString():l.toPercentageRgb(),hex8:(l,s)=>s?l.toHex8String():l.toHex8(),name:l=>l.toName()||l.toRgbString(),hsl:(l,s)=>{if(this.maintains==="hue"){if(s)return l.toHslString().replace(it,`$1${this.hue}`);const{s:u,l:h,a:m}=l.toHsl();return{h:this.hue,s:u,l:h,a:m}}if(s)return l.toHslString().replace(nt,`$1${this.hue}$2${this.saturation}`);const{s:n,l:i,a:c}=l.toHsl();return{h:this.hue,s:n,l:i,a:c}},hsv:(l,s)=>{if(this.maintains==="hue"){if(s)return l.toHsvString().replace(it,`$1${this.hue}`);const{s:u,v:h,a:m}=l.toHsv();return{h:this.hue,s:u,v:h,a:m}}if(s)return l.toHsvString().replace(nt,`$1${this.hue}$2${this.saturation}`);const{s:n,v:i,a:c}=l.toHsv();return{h:this.hue,s:n,v:i,a:c}},hex:Qo,hex3:Qo,hex4:Qo,hex6:Qo},this._color=new B({h:0,s:1,v:1}),this._previousColor=new B({h:0,s:1,v:1}),this._format={format:"",isString:!1},this.host=o,this.applyColorToState=e,this.extractColorFromState=t,this.maintains=a||this.maintains}setColorProcess(o,e,t,a){this.maintains==="hue"?this.setColorMaintainHue(o,e,t,a):this.maintains==="saturation"&&this.setColorMaintainSaturation(o,e,t,a)}setColorMaintainHue(o,e,t,a){const{h:l,s,v:n,a:i}=this._color.toHsv();let c;if(a&&t.startsWith("hs")){const u=st.exec(e);if(u!==null){const[,h]=u;c=Number(h)}}else if(!a&&t.startsWith("hs")){const u=o.originalInput;c=Object.values(u)[0]}this.hue=c||l,this.opacity=i??1,this.applyColorToState({h:l,s,v:n,a:i})}setColorMaintainSaturation(o,e,t,a){const{a:l}=this._color.toHsv();if(a&&t.startsWith("hs")){const s=st.exec(e);if(s!==null){const[,n,i]=s;this.hue=Number(n),this.saturation=Number(i)}}else if(!a&&t.startsWith("hs")){const s=o.originalInput,n=Object.values(s);this.hue=n[0],this.saturation=n[1]}else{const{h:s}=o.toHsv();this.hue=s}this.opacity=l??1,this.applyColorToState(o.toHsv())}applyColorFromState(){this._color=new B(this.extractColorFromState(this))}get hue(){return this._hue}set hue(o){const e=Math.min(360,Math.max(0,o));if(e===this.hue)return;const t=this.hue,{s:a,v:l,a:s}=this._color.toHsv();this._color=new B({h:e,s:a,v:l,a:s}),this._hue=e,this.host.requestUpdate("hue",t)}get opacity(){return this._opacity}set opacity(o){const e=Math.min(1,Math.max(0,o));if(e===this.opacity)return;const t=this.opacity,{h:a,s:l,v:s}=this._color.toHsv();this._color=new B({h:a,s:l,v:s,a:e}),this._opacity=e,this.host.requestUpdate("opacity",t)}get value(){return this.color}get color(){return this.getColorProcesses[this._format.format||"hex"](this._color,this._format.isString)}set color(o){if(o===this.color)return;const e=this._color;this._color=new B(o);const t=this._color.format;let a=typeof o=="string"||o instanceof String;t.startsWith("hex")&&(a=o.startsWith("#")),this._format={format:t,isString:a},this.setColorProcess(this._color,o,t,a),this.host.requestUpdate("color",e)}getColor(o){const e={hsl:"toHsl"};return this._color[e[o]]()}setColor(o){this._color=o;const e=typeof this._color.originalInput=="string"||this._color.originalInput instanceof String;this.setColorProcess(this._color,o,this._color.format,e)}getHslString(){return this._color.toHslString()}savePreviousColor(){this._previousColor=this._color.clone()}restorePreviousColor(){this.setColor(this._previousColor)}}const Is='.opacity-checkerboard{position:absolute;block-size:100%;inline-size:100%;background:repeating-conic-gradient(var(--luzmo-color-loupe-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-color-loupe-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-color-loupe-checkerboard-position, left top)/calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2) calc(var(--luzmo-color-loupe-checkerboard-size, 8px) * 2)}:host{--luzmo-color-slider-gradient-fallback: rgb(255 0 0) 0%, rgb(255 255 0) 17%, rgb(0 255 0) 33%, rgb(0 255 255) 50%, rgb(0 0 255) 67%, rgb(255 0 255) 83%, rgb(255 0 0) 100%;touch-action:none}:host([vertical]) .handle{inset-block-start:unset;inset-block-end:0}:host([vertical]) .slider{-webkit-appearance:slider-vertical;-moz-appearance:slider-vertical;appearance:slider-vertical}:host(:focus){outline:none}.gradient{overflow:hidden}::slotted(*){width:100%;height:100%}@media (forced-colors: active){:host{--highcontrast-color-slider-border-color: CanvasText;--highcontrast-color-slider-border-color-disabled: GrayText;--highcontrast-color-slider-background-color-disabled: Canvas;forced-color-adjust:none}}:host{--luzmo-color-handle-hitarea-border-radius: var( --luzmo-color-slider-handle-hitarea-border-radius, 0px );min-inline-size:var(--luzmo-color-slider-minimum-length, 80px);inline-size:var(--luzmo-color-slider-length, 192px);block-size:var(--luzmo-color-slider-control-track-width, 24px);-webkit-user-select:none;user-select:none;cursor:default;display:block;position:relative}:host([focused]){z-index:2}:host([disabled]){pointer-events:none}:host([disabled]) .gradient{display:none}:host([vertical]){min-block-size:var(--luzmo-color-slider-vertical-minimum-height, var(--luzmo-color-slider-minimum-length, 80px));block-size:var(--luzmo-color-slider-vertical-height, var(--luzmo-color-slider-length, 192px));min-inline-size:0;inline-size:var(--luzmo-color-slider-vertical-control-track-width, var(--luzmo-color-slider-control-track-height, 24px));display:inline-block}:host([vertical]) .handle{inset-inline-start:50%}.handle{inset-block-start:50%;inset-inline-start:0}.checkerboard{--luzmo-color-slider-border-color-local: var( --highcontrast-color-slider-border-color, var(--luzmo-color-slider-border-color, var(--luzmo-border-color)) )}.checkerboard:before{content:"";z-index:1;box-shadow:inset 0 0 0 var(--luzmo-color-slider-border-width, var(--luzmo-border-width)) var(--luzmo-color-slider-border-color-local);border-radius:var(--luzmo-color-slider-border-rounding, var(--luzmo-border-radius-s));position:absolute;top:0;right:0;bottom:0;left:0}:host([disabled]) .checkerboard{--luzmo-color-slider-border-color-local: var( --highcontrast-color-slider-border-color-disabled, var(--luzmo-color-slider-border-color-disabled, var(--luzmo-dimmed-color)) );background:var(--highcontrast-color-slider-background-color-disabled, var(--luzmo-color-slider-background-color-disabled, var(--luzmo-dimmed-color)))}.checkerboard,.gradient{inline-size:100%;block-size:100%;border-radius:var(--luzmo-color-slider-border-rounding, var(--luzmo-border-radius-s))}.gradient:dir(rtl),:host([dir=rtl]) .gradient{transform:scaleX(-1)}.slider{opacity:0;inline-size:100%;block-size:100%;z-index:0;pointer-events:none;margin:0;position:absolute;inset-block-start:0;inset-inline-start:0}';var Fs=Object.defineProperty,Ls=Object.getOwnPropertyDescriptor,Z=(r,o,e,t)=>{for(var a=t>1?void 0:t?Ls(o,e):o,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=(t?s(o,e,a):s(a))||a);return t&&a&&Fs(o,e,a),a};let q=class extends Be.r{constructor(){super(...arguments),this.disabled=!1,this.focused=!1,this.label="hue",this.vertical=!1,this.languageResolver=new ee.l(this),this.colorController=new Os(this,{applyColorToState:()=>{if(this.mode==="opacity"){const o=new B(this.colorController.color);this.sliderHandlePosition=100*o.getAlpha()}else this.sliderHandlePosition=100*(this.colorController.hue/360)},extractColorFromState:o=>this.mode==="opacity"?{...o.getColor("hsl"),a:this.value}:{...o.getColor("hsl"),h:this.value},maintains:"saturation"}),this.sliderHandlePosition=0,this.step=1,this.isLTR=!0,this._altered=0,this._pointerDown=!1}static get styles(){return[d.at(Is)]}get value(){return this.mode==="opacity"?this.colorController.opacity:this.colorController.hue}set value(o){this.mode==="opacity"?this.colorController.opacity=o:this.colorController.hue=o}get color(){return this.colorController.color}set color(o){this.colorController.color=o}get altered(){return this._altered}set altered(o){this._altered=o,this.step=Math.max(1,this.altered*10)}get focusElement(){return this.input}handleKeydown(o){const{key:e}=o;this.focused=!0,this.altered=[o.shiftKey,o.ctrlKey,o.altKey].filter(l=>!!l).length;let t=0;switch(e){case"ArrowUp":{t=this.step;break}case"ArrowDown":{t=-this.step;break}case"ArrowLeft":{t=this.step*(this.isLTR?-1:1);break}case"ArrowRight":{t=this.step*(this.isLTR?1:-1);break}default:return}o.preventDefault();const a=100/(this.mode==="opacity"?100:360);this.sliderHandlePosition=Math.min(100,Math.max(0,this.sliderHandlePosition+t*a)),this.value=this.mode==="opacity"?Math.min(1,Math.max(0,this.value+t/100)):Math.min(360,Math.max(0,this.value+t)),this.colorController.applyColorFromState(),t!==0&&(this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})))}handleInput(o){const{valueAsNumber:e}=o.target;this.value=e,this.sliderHandlePosition=100*(this.mode==="opacity"?this.value:this.value/360),this.colorController.applyColorFromState()}handleChange(o){this.handleInput(o),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}focus(o={}){super.focus(o),this.forwardFocus()}forwardFocus(){this.input.focus()}handleFocus(){this.focused=!0}handleBlur(){this._pointerDown||(this.altered=0,this.focused=!1)}handlePointerdown(o){if(o.button!==0){o.preventDefault();return}this._pointerDown=!0,this.colorController.savePreviousColor(),this.boundingClientRect=this.getBoundingClientRect(),o.target.setPointerCapture(o.pointerId),o.pointerType==="mouse"&&(this.focused=!0)}handlePointermove(o){this.sliderHandlePosition=this.calculateHandlePosition(o),this.value=(this.mode==="opacity"?1:360)*(this.sliderHandlePosition/100),this.colorController.applyColorFromState(),this.dispatchEvent(new Event("input",{bubbles:!0,composed:!0,cancelable:!0}))}handlePointerup(o){this._pointerDown=!1,o.target.releasePointerCapture(o.pointerId),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0,cancelable:!0}))||this.colorController.restorePreviousColor(),this.focus(),o.pointerType==="mouse"&&(this.focused=!1)}calculateHandlePosition(o){if(!this.boundingClientRect)return this.sliderHandlePosition;const e=this.boundingClientRect,t=this.vertical?e.top:e.left,a=this.vertical?o.clientY:o.clientX,l=this.vertical?e.height:e.width,s=Math.max(0,Math.min(1,(a-t)/l));return this.vertical||!this.isLTR?100-100*s:100*s}handleGradientPointerdown(o){o.button===0&&(o.stopPropagation(),o.preventDefault(),this.handle.dispatchEvent(new PointerEvent("pointerdown",o)),this.handlePointermove(o))}get handlePositionStyles(){return`${this.vertical?"inset-block-end":"inset-inline-start"}: ${this.sliderHandlePosition}%`}get getColorSliderStyle(){const o=this.vertical?"top":"right";if(this.mode==="opacity"){const e=new B(this.colorController.color).setAlpha(1).toRgbString();return{background:`linear-gradient(to ${o}, transparent, ${e})`}}return{background:`linear-gradient(to ${o}, var(--luzmo-color-slider-gradient, var(--luzmo-color-slider-gradient-fallback)))`}}render(){return d.Rt`
|
228
228
|
<div
|
229
229
|
class="opacity-checkerboard checkerboard"
|
230
230
|
role="presentation"
|
@@ -233,7 +233,7 @@
|
|
233
233
|
<div
|
234
234
|
class="gradient"
|
235
235
|
role="presentation"
|
236
|
-
style=${
|
236
|
+
style=${Ne.p(this.getColorSliderStyle)}
|
237
237
|
>
|
238
238
|
<slot name="gradient"></slot>
|
239
239
|
</div>
|
@@ -263,7 +263,7 @@
|
|
263
263
|
@change=${this.handleChange}
|
264
264
|
@keydown=${this.handleKeydown}
|
265
265
|
/>
|
266
|
-
`}firstUpdated(o){super.firstUpdated(o),this.boundingClientRect=this.getBoundingClientRect(),this.addEventListener("focus",this.handleFocus),this.addEventListener("blur",this.handleBlur)}updated(o){o.has("mode")&&(this.handle.style.insetInlineStart="",this.handle.style.insetBlockEnd="",this.mode==="opacity"&&(this.colorController.color=new
|
266
|
+
`}firstUpdated(o){super.firstUpdated(o),this.boundingClientRect=this.getBoundingClientRect(),this.addEventListener("focus",this.handleFocus),this.addEventListener("blur",this.handleBlur)}updated(o){o.has("mode")&&(this.handle.style.insetInlineStart="",this.handle.style.insetBlockEnd="",this.mode==="opacity"&&(this.colorController.color=new B(this.colorController.color).toRgbString(),this.handle.style.insetInlineStart=100*this.colorController.opacity+"%"))}};Z([d.zt({type:String,reflect:!0})],q.prototype,"dir",2);Z([d.zt({type:String,reflect:!0})],q.prototype,"mode",2);Z([d.zt({type:Boolean,reflect:!0})],q.prototype,"disabled",2);Z([d.zt({type:Boolean,reflect:!0})],q.prototype,"focused",2);Z([P.d(".handle")],q.prototype,"handle",2);Z([d.zt({type:String})],q.prototype,"label",2);Z([d.zt({type:Boolean,reflect:!0})],q.prototype,"vertical",2);Z([d.zt({type:Number})],q.prototype,"value",1);Z([d.zt({type:Number,reflect:!0})],q.prototype,"sliderHandlePosition",2);Z([d.zt({type:String})],q.prototype,"color",1);Z([d.zt({type:Number})],q.prototype,"step",2);Z([d.zt({type:Boolean,attribute:"is-ltr"})],q.prototype,"isLTR",2);Z([P.d("input")],q.prototype,"input",2);customElements.get("luzmo-color-slider")||customElements.define("luzmo-color-slider",q);/*! * Lucero - The design system for Luzmo.
|
267
267
|
*
|
268
268
|
* Copyright © 2025 Luzmo
|
269
269
|
* All rights reserved.
|
@@ -279,7 +279,7 @@
|
|
279
279
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
280
280
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
281
281
|
* SOFTWARE.
|
282
|
-
* */const Ds=()=>{if(typeof document<"u"&&!document.querySelector("style[data-luzmo-vars]")){const r=document.createElement("style");r.setAttribute("data-luzmo-vars",""),r.textContent='html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}',document.head.appendChild(r)}};Ds();const js='@media (forced-colors: active){:host{--highcontrast-swatch-disabled-icon-color: GrayText;--highcontrast-swatch-focus-indicator-color: ButtonText;--highcontrast-swatch-background-color-selected: Background;--highcontrast-swatch-border-color-selected: Highlight;--highcontrast-swatch-border-color: ButtonText;--highcontrast-swatch-fill-foreground-color: ButtonText}.fill{forced-color-adjust:none}:host([disabled]){--highcontrast-swatch-border-color: GrayText}}:host{box-sizing:border-box;inline-size:var(--luzmo-swatch-size, var(--swatch-size));block-size:var(--luzmo-swatch-size, var(--swatch-size));-webkit-user-select:none;user-select:none;outline:none;justify-content:center;align-items:center;display:flex;position:relative}.disabled-icon{inline-size:var(--luzmo-swatch-disabled-icon-size, var(--swatch-disabled-icon-size));block-size:var(--luzmo-swatch-disabled-icon-size, var(--swatch-disabled-icon-size))}:host,:host:before{border-radius:var(--luzmo-swatch-border-radius, var(--swatch-border-radius))}:host([selected]){background-color:var(--highcontrast-swatch-background-color-selected, var(--luzmo-swatch-inner-border-color-selected, var(--swatch-inner-border-color-selected)))}:host([selected]) .fill:before{box-shadow:none;border-radius:0}:host([selected]):before{opacity:1}:host .is-image .fill:before{background-color:initial}:host([mixed-value]) .fill{background:none;background:var(--picked-color, transparent)}:host([mixed-value]) .mixed-value-icon{color:var(--swatch-dash-icon-color);display:block}:host([nothing]) .fill{background-color:initial;background-color:var(--picked-color, transparent);background-image:none}:host([nothing]) .fill:after{inline-size:var(--luzmo-swatch-slash-thickness, var(--swatch-slash-thickness));content:"";block-size:200%;background:var(--highcontrast-swatch-fill-foreground-color, var(--luzmo-swatch-slash-icon-color, var(--swatch-slash-icon-color)));position:absolute;transform:rotate(-45deg)}:host([nothing][shape=rectangle]) .fill:after{transform:rotate(-25deg)}:host([disabled]) .disabled-icon{display:block}:host:before{content:"";border-width:var(--luzmo-swatch-border-thickness-selected, var(--swatch-border-thickness-selected));border-style:solid;border-color:var(--highcontrast-swatch-border-color-selected, var(--luzmo-swatch-border-color-selected, var(--swatch-border-color-selected)));opacity:0;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0}:host:after{content:"";inset:calc(var(--luzmo-swatch-focus-indicator-gap, var(--swatch-focus-indicator-gap)) * -2);opacity:0;border-width:var(--luzmo-swatch-focus-indicator-width, var(--swatch-focus-indicator-width));border-style:solid;border-color:var(--highcontrast-swatch-focus-indicator-color, var(--luzmo-swatch-focus-indicator-color, var(--swatch-focus-indicator-color)));border-radius:var(--luzmo-swatch-focus-indicator-border-radius, var(--swatch-focus-indicator-border-radius));transition:opacity var(--luzmo-animation-duration) ease-in-out;position:absolute}:host(:focus-visible):after{opacity:1}.fill{inline-size:100%;block-size:100%;box-sizing:border-box;border-radius:var(--luzmo-swatch-border-radius, var(--swatch-border-radius));justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.fill:before{content:"";z-index:0;box-sizing:border-box;box-shadow:inset 0 0 0 var(--luzmo-swatch-border-thickness, var(--swatch-border-thickness)) var(--highcontrast-swatch-border-color, var(--luzmo-swatch-border-color, var(--swatch-border-color)));border-radius:var(--luzmo-swatch-border-radius, var(--swatch-border-radius));position:absolute;top:0;right:0;bottom:0;left:0}:host([border=none]) .fill:before,.fill:before{background-color:initial;background-color:var(--picked-color, transparent)}:host([border=none]) .fill:before{box-shadow:none}.mixed-value-icon{pointer-events:none;color:#0000;color:var(--picked-color, transparent);display:none}.disabled-icon{z-index:1;pointer-events:none;color:var(--highcontrast-swatch-disabled-icon-color, var(--luzmo-swatch-disabled-icon-color, var(--swatch-disabled-icon-color)));stroke:var(--highcontrast-swatch-disabled-icon-color, var(--luzmo-swatch-disabled-icon-color, var(--swatch-disabled-icon-color)));display:none;position:relative}.disabled-icon path:first-child{fill:var(--highcontrast-swatch-disabled-icon-color, var(--luzmo-swatch-disabled-icon-color, var(--swatch-disabled-icon-color)))}.disabled-icon path:last-child{fill:var(--luzmo-swatch-icon-border-color, var(--swatch-icon-border-color))}:host([shape=rectangle]){inline-size:calc(var(--luzmo-swatch-size, var(--swatch-size)) * 2)}:host([rounding=none]),:host([rounding=none]) .fill,:host([rounding=none]) .fill:before,:host([rounding=none][selected]) .fill,:host([rounding=none][selected]) .fill:before,:host([rounding=none]):after,:host([rounding=none]):before{border-radius:0}:host([rounding=full][selected]:not([shape=rectangle])) .fill,:host([rounding=full][selected]:not([shape=rectangle])) .fill:before,:host([rounding=full]:not([shape=rectangle])),:host([rounding=full]:not([shape=rectangle])) .fill,:host([rounding=full]:not([shape=rectangle])) .fill:before,:host([rounding=full]:not([shape=rectangle])):after,:host([rounding=full]:not([shape=rectangle])):before{border-radius:100%}:host([selected]) .fill{width:calc(var(--luzmo-swatch-size, var(--swatch-size)) - 2 * var(--luzmo-swatch-border-thickness-selected, var(--swatch-border-thickness-selected)) + -2 * var(--luzmo-swatch-focus-indicator-gap, var(--swatch-focus-indicator-gap)));height:calc(var(--luzmo-swatch-size, var(--swatch-size)) - 2 * var(--luzmo-swatch-border-thickness-selected, var(--swatch-border-thickness-selected)) + -2 * var(--luzmo-swatch-focus-indicator-gap, var(--swatch-focus-indicator-gap)))}:host([selected][shape=rectangle]) .fill{width:calc(var(--luzmo-swatch-size, var(--swatch-size)) * 2 - 2 * var(--luzmo-swatch-border-thickness-selected, var(--swatch-border-thickness-selected)) + -2 * var(--luzmo-swatch-focus-indicator-gap, var(--swatch-focus-indicator-gap)))}::slotted([slot=image]){object-fit:contain;inline-size:100%;block-size:100%;transition:width var(--luzmo-animation-duration) ease-in-out,height var(--luzmo-animation-duration) ease-in-out}:host([size=xl]){--swatch-size: var(--luzmo-component-height-xl);--swatch-disabled-icon-size: 24px;--swatch-slash-thickness: 6px}:host([size=l]){--swatch-size: var(--luzmo-component-height-l);--swatch-disabled-icon-size: 20px;--swatch-slash-thickness: 5px}:host([size=s]){--swatch-size: var(--luzmo-component-height-s);--swatch-disabled-icon-size: 16px;--swatch-slash-thickness: 3px}:host([size=xs]){--swatch-size: var(--luzmo-component-height-xs);--swatch-disabled-icon-size: 16px;--swatch-slash-thickness: 2px}:host([size=xxs]){--swatch-size: var(--luzmo-component-height-xxs);--swatch-disabled-icon-size: 14px;--swatch-slash-thickness: 2px}:host{--swatch-size: var(--luzmo-component-height);--swatch-disabled-icon-size: 18px;--swatch-slash-thickness: 4px}:host{--swatch-border-radius: var(--luzmo-border-radius-s);--swatch-focus-indicator-border-radius: var(--luzmo-border-radius-s);--swatch-border-thickness: var(--luzmo-border-width);--swatch-border-thickness-selected: var(--luzmo-border-width);--swatch-focus-indicator-width: var(--luzmo-indicator-width);--swatch-focus-indicator-gap: var(--luzmo-indicator-gap);--swatch-border-color: var(--luzmo-border-color-down);--swatch-icon-border-color: var(--luzmo-border-color);--swatch-border-color-selected: var(--luzmo-border-color-full-down);--swatch-inner-border-color-selected: var(--luzmo-background-color);--swatch-disabled-icon-color: rgb(255, 255, 255);--swatch-dash-icon-color: var(--luzmo-font-color);--swatch-slash-icon-color: var(--luzmo-negative-color);--swatch-focus-indicator-color: var(--luzmo-primary)}.fill:before{background:var(--picked-color, transparent)}:host([border=none]) .fill:before{background:var(--picked-color, transparent)}:host .is-image .fill:before{background:#0000}:host .opacity-checkerboard{background:repeating-conic-gradient(var(--luzmo-swatch-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-swatch-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-swatch-checkerboard-position, left top)/calc(var(--luzmo-swatch-checkerboard-size, 8px) * 2) calc(var(--luzmo-swatch-checkerboard-size, 8px) * 2)}';var Ts=Object.defineProperty,qs=Object.getOwnPropertyDescriptor,oo=(r,o,e,t)=>{for(var a=t>1?void 0:t?qs(o,e):o,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=(t?s(o,e,a):s(a))||a);return t&&a&&Ts(o,e,a),a};let V=class extends d.m(Ne.r,{validSizes:["xxs","xs","s","m","l","xl"],noDefaultSize:!0}){constructor(){super(...arguments),this.color="",this.label="",this.mixedValue=!1,this.nothing=!1,this.role="button",this.selected=!1,this.readonly=!1,this.renderDisabled=()=>d.Rt`
|
282
|
+
* */const Ds=()=>{if(typeof document<"u"&&!document.querySelector("style[data-luzmo-vars]")){const r=document.createElement("style");r.setAttribute("data-luzmo-vars",""),r.textContent='html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}',document.head.appendChild(r)}};Ds();const js='@media (forced-colors: active){:host{--highcontrast-swatch-disabled-icon-color: GrayText;--highcontrast-swatch-focus-indicator-color: ButtonText;--highcontrast-swatch-background-color-selected: Background;--highcontrast-swatch-border-color-selected: Highlight;--highcontrast-swatch-border-color: ButtonText;--highcontrast-swatch-fill-foreground-color: ButtonText}.fill{forced-color-adjust:none}:host([disabled]){--highcontrast-swatch-border-color: GrayText}}:host{box-sizing:border-box;inline-size:var(--luzmo-swatch-size, var(--swatch-size));block-size:var(--luzmo-swatch-size, var(--swatch-size));-webkit-user-select:none;user-select:none;outline:none;justify-content:center;align-items:center;display:flex;position:relative}.disabled-icon{inline-size:var(--luzmo-swatch-disabled-icon-size, var(--swatch-disabled-icon-size));block-size:var(--luzmo-swatch-disabled-icon-size, var(--swatch-disabled-icon-size))}:host,:host:before{border-radius:var(--luzmo-swatch-border-radius, var(--swatch-border-radius))}:host([selected]){background-color:var(--highcontrast-swatch-background-color-selected, var(--luzmo-swatch-inner-border-color-selected, var(--swatch-inner-border-color-selected)))}:host([selected]) .fill:before{box-shadow:none;border-radius:0}:host([selected]):before{opacity:1}:host .is-image .fill:before{background-color:initial}:host([mixed-value]) .fill{background:none;background:var(--picked-color, transparent)}:host([mixed-value]) .mixed-value-icon{color:var(--swatch-dash-icon-color);display:block}:host([nothing]) .fill{background-color:initial;background-color:var(--picked-color, transparent);background-image:none}:host([nothing]) .fill:after{inline-size:var(--luzmo-swatch-slash-thickness, var(--swatch-slash-thickness));content:"";block-size:200%;background:var(--highcontrast-swatch-fill-foreground-color, var(--luzmo-swatch-slash-icon-color, var(--swatch-slash-icon-color)));position:absolute;transform:rotate(-45deg)}:host([nothing][shape=rectangle]) .fill:after{transform:rotate(-25deg)}:host([disabled]) .disabled-icon{display:block}:host:before{content:"";border-width:var(--luzmo-swatch-border-thickness-selected, var(--swatch-border-thickness-selected));border-style:solid;border-color:var(--highcontrast-swatch-border-color-selected, var(--luzmo-swatch-border-color-selected, var(--swatch-border-color-selected)));opacity:0;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0}:host:after{content:"";inset:calc(var(--luzmo-swatch-focus-indicator-gap, var(--swatch-focus-indicator-gap)) * -2);background-color:var(--luzmo-swatch-focus-indicator-background-color, var(--luzmo-background-color));z-index:-1;opacity:0;border-width:var(--luzmo-swatch-focus-indicator-width, var(--swatch-focus-indicator-width));border-style:solid;border-color:var(--highcontrast-swatch-focus-indicator-color, var(--luzmo-swatch-focus-indicator-color, var(--swatch-focus-indicator-color)));border-radius:var(--luzmo-swatch-focus-indicator-border-radius, var(--swatch-focus-indicator-border-radius));transition:opacity var(--luzmo-animation-duration) ease-in-out;position:absolute}:host(:focus-visible):after{opacity:1}.fill{inline-size:100%;block-size:100%;box-sizing:border-box;border-radius:var(--luzmo-swatch-border-radius, var(--swatch-border-radius));justify-content:center;align-items:center;display:flex;position:relative;overflow:hidden}.fill:before{content:"";z-index:0;box-sizing:border-box;box-shadow:inset 0 0 0 var(--luzmo-swatch-border-thickness, var(--swatch-border-thickness)) var(--highcontrast-swatch-border-color, var(--luzmo-swatch-border-color, var(--swatch-border-color)));border-radius:var(--luzmo-swatch-border-radius, var(--swatch-border-radius));position:absolute;top:0;right:0;bottom:0;left:0}:host([border=none]) .fill:before,.fill:before{background-color:initial;background-color:var(--picked-color, transparent)}:host([border=none]) .fill:before{box-shadow:none}.mixed-value-icon{pointer-events:none;color:#0000;color:var(--picked-color, transparent);display:none}.disabled-icon{z-index:1;pointer-events:none;color:var(--highcontrast-swatch-disabled-icon-color, var(--luzmo-swatch-disabled-icon-color, var(--swatch-disabled-icon-color)));stroke:var(--highcontrast-swatch-disabled-icon-color, var(--luzmo-swatch-disabled-icon-color, var(--swatch-disabled-icon-color)));display:none;position:relative}.disabled-icon path:first-child{fill:var(--highcontrast-swatch-disabled-icon-color, var(--luzmo-swatch-disabled-icon-color, var(--swatch-disabled-icon-color)))}.disabled-icon path:last-child{fill:var(--luzmo-swatch-icon-border-color, var(--swatch-icon-border-color))}:host([shape=rectangle]){inline-size:calc(var(--luzmo-swatch-size, var(--swatch-size)) * 2)}:host([rounding=none]),:host([rounding=none]) .fill,:host([rounding=none]) .fill:before,:host([rounding=none][selected]) .fill,:host([rounding=none][selected]) .fill:before,:host([rounding=none]):after,:host([rounding=none]):before{border-radius:0}:host([rounding=full][selected]:not([shape=rectangle])) .fill,:host([rounding=full][selected]:not([shape=rectangle])) .fill:before,:host([rounding=full]:not([shape=rectangle])),:host([rounding=full]:not([shape=rectangle])) .fill,:host([rounding=full]:not([shape=rectangle])) .fill:before,:host([rounding=full]:not([shape=rectangle])):after,:host([rounding=full]:not([shape=rectangle])):before{border-radius:100%}:host([selected]) .fill{width:calc(var(--luzmo-swatch-size, var(--swatch-size)) - 2 * var(--luzmo-swatch-border-thickness-selected, var(--swatch-border-thickness-selected)) + -2 * var(--luzmo-swatch-focus-indicator-gap, var(--swatch-focus-indicator-gap)));height:calc(var(--luzmo-swatch-size, var(--swatch-size)) - 2 * var(--luzmo-swatch-border-thickness-selected, var(--swatch-border-thickness-selected)) + -2 * var(--luzmo-swatch-focus-indicator-gap, var(--swatch-focus-indicator-gap)))}:host([selected][shape=rectangle]) .fill{width:calc(var(--luzmo-swatch-size, var(--swatch-size)) * 2 - 2 * var(--luzmo-swatch-border-thickness-selected, var(--swatch-border-thickness-selected)) + -2 * var(--luzmo-swatch-focus-indicator-gap, var(--swatch-focus-indicator-gap)))}::slotted([slot=image]){object-fit:contain;inline-size:100%;block-size:100%;transition:width var(--luzmo-animation-duration) ease-in-out,height var(--luzmo-animation-duration) ease-in-out}:host([size=xl]){--swatch-size: var(--luzmo-component-height-xl);--swatch-disabled-icon-size: 24px;--swatch-slash-thickness: 6px}:host([size=l]){--swatch-size: var(--luzmo-component-height-l);--swatch-disabled-icon-size: 20px;--swatch-slash-thickness: 5px}:host([size=s]){--swatch-size: var(--luzmo-component-height-s);--swatch-disabled-icon-size: 16px;--swatch-slash-thickness: 3px}:host([size=xs]){--swatch-size: var(--luzmo-component-height-xs);--swatch-disabled-icon-size: 16px;--swatch-slash-thickness: 2px}:host([size=xxs]){--swatch-size: var(--luzmo-component-height-xxs);--swatch-disabled-icon-size: 14px;--swatch-slash-thickness: 2px}:host{--swatch-size: var(--luzmo-component-height);--swatch-disabled-icon-size: 18px;--swatch-slash-thickness: 4px}:host{--swatch-border-radius: var(--luzmo-border-radius-s);--swatch-focus-indicator-border-radius: var(--luzmo-border-radius-s);--swatch-border-thickness: var(--luzmo-border-width);--swatch-border-thickness-selected: var(--luzmo-border-width);--swatch-focus-indicator-width: var(--luzmo-indicator-width);--swatch-focus-indicator-gap: var(--luzmo-indicator-gap);--swatch-border-color: var(--luzmo-border-color-down);--swatch-icon-border-color: var(--luzmo-border-color);--swatch-border-color-selected: var(--luzmo-border-color-full-down);--swatch-inner-border-color-selected: var(--luzmo-background-color);--swatch-disabled-icon-color: rgb(255, 255, 255);--swatch-dash-icon-color: var(--luzmo-font-color);--swatch-slash-icon-color: var(--luzmo-negative-color);--swatch-focus-indicator-color: var(--luzmo-primary)}.fill:before{background:var(--picked-color, transparent)}:host([border=none]) .fill:before{background:var(--picked-color, transparent)}:host .is-image .fill:before{background:#0000}:host .opacity-checkerboard{background:repeating-conic-gradient(var(--luzmo-swatch-checkerboard-light, rgb(255, 255, 255)) 0 25%,var(--luzmo-swatch-checkerboard-dark, rgb(230, 230, 230)) 0 50%) var(--luzmo-swatch-checkerboard-position, left top)/calc(var(--luzmo-swatch-checkerboard-size, 8px) * 2) calc(var(--luzmo-swatch-checkerboard-size, 8px) * 2)}';var Ts=Object.defineProperty,qs=Object.getOwnPropertyDescriptor,eo=(r,o,e,t)=>{for(var a=t>1?void 0:t?qs(o,e):o,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=(t?s(o,e,a):s(a))||a);return t&&a&&Ts(o,e,a),a};let J=class extends d.m(Be.r,{validSizes:["xxs","xs","s","m","l","xl"],noDefaultSize:!0}){constructor(){super(...arguments),this.color="",this.label="",this.mixedValue=!1,this.nothing=!1,this.role="button",this.selected=!1,this.readonly=!1,this.renderDisabled=()=>d.Rt`
|
283
283
|
<svg
|
284
284
|
xmlns="http://www.w3.org/2000/svg"
|
285
285
|
class="disabled-icon"
|
@@ -302,15 +302,15 @@
|
|
302
302
|
style=${P.m(this.color?`--picked-color: ${this.color}`:void 0)}
|
303
303
|
>
|
304
304
|
<slot name="image"></slot>
|
305
|
-
${
|
306
|
-
${
|
305
|
+
${Je.o(this.disabled,this.renderDisabled)}
|
306
|
+
${Je.o(this.mixedValue,this.renderMixedValue)}
|
307
307
|
</div>
|
308
|
-
`}willUpdate(o){var e;if(this.getAttribute("role")||this.setAttribute("role","button"),(o.has("selected")||o.has("role"))&&!this.readonly){const t=this.role==="button"?"aria-pressed":"aria-checked",a=this.role==="button"?"aria-checked":"aria-pressed";o.has("role")&&this.removeAttribute(a),this.setAttribute(t,this.selected?"true":"false")}(o.has("label")||o.has("color")||o.has("mixedValue"))&&(this.label!==this.color&&(e=this.label)!=null&&e.length?this.setAttribute("aria-label",this.label):this.color?this.setAttribute("aria-label",this.color):this.mixedValue?this.setAttribute("aria-label","Mixed"):this.removeAttribute("aria-label"))}firstUpdated(o){super.firstUpdated(o),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown),this.addEventListener("keypress",this.handleKeypress),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")}};
|
308
|
+
`}willUpdate(o){var e;if(this.getAttribute("role")||this.setAttribute("role","button"),(o.has("selected")||o.has("role"))&&!this.readonly){const t=this.role==="button"?"aria-pressed":"aria-checked",a=this.role==="button"?"aria-checked":"aria-pressed";o.has("role")&&this.removeAttribute(a),this.setAttribute(t,this.selected?"true":"false")}(o.has("label")||o.has("color")||o.has("mixedValue"))&&(this.label!==this.color&&(e=this.label)!=null&&e.length?this.setAttribute("aria-label",this.label):this.color?this.setAttribute("aria-label",this.color):this.mixedValue?this.setAttribute("aria-label","Mixed"):this.removeAttribute("aria-label"))}firstUpdated(o){super.firstUpdated(o),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeydown),this.addEventListener("keypress",this.handleKeypress),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0")}};eo([d.zt({reflect:!0})],J.prototype,"border",2);eo([d.zt()],J.prototype,"color",2);eo([d.zt()],J.prototype,"label",2);eo([d.zt({type:Boolean,reflect:!0,attribute:"mixed-value"})],J.prototype,"mixedValue",2);eo([d.zt({type:Boolean,reflect:!0})],J.prototype,"nothing",2);eo([d.zt({reflect:!0})],J.prototype,"role",2);eo([d.zt({reflect:!0})],J.prototype,"rounding",2);eo([d.zt({type:Boolean,reflect:!0})],J.prototype,"selected",2);eo([d.zt({type:Boolean,reflect:!0})],J.prototype,"readonly",2);eo([d.zt({reflect:!0})],J.prototype,"shape",2);eo([d.zt()],J.prototype,"value",1);const Ws=":host{justify-content:flex-start;align-items:flex-start;gap:var(--luzmo-swatch-group-spacing-regular, var(--swatch-group-spacing-regular));flex-flow:wrap;display:inline-flex}:host([density=compact]){gap:var(--luzmo-swatch-group-spacing-compact, var(--swatch-group-spacing-compact))}:host([density=spacious]){gap:var(--luzmo-swatch-group-spacing-spacious, var(--swatch-group-spacing-spacious))}:host{--swatch-group-spacing-compact: 2px;--swatch-group-spacing-regular: 4px;--swatch-group-spacing-spacious: 8px}";var Us=Object.defineProperty,Xs=Object.getOwnPropertyDescriptor,vo=(r,o,e,t)=>{for(var a=t>1?void 0:t?Xs(o,e):o,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=(t?s(o,e,a):s(a))||a);return t&&a&&Us(o,e,a),a};class go extends d.m(d.It,{validSizes:["xs","s","m","l"],noDefaultSize:!0}){constructor(){super(),this._selected=[],this.selectedSet=new Set,this.rovingTabindexController=new ca.m(this,{focusInIndex:o=>{let e=-1;const t=o.findIndex((a,l)=>(!o[e]&&!a.disabled&&(e=l),a.selected&&!a.disabled));return o[t]?t:e},elements:()=>this.swatches,isFocusableElement:o=>!o.disabled}),this.manageChange=async()=>{const o=new Set;this.selectedSet=new Set(this.selected),await Promise.all(this.swatches.map(e=>e.updateComplete)),this.swatches.forEach(e=>{o.add(e.value),e.selected&&this.selectedSet.add(e.value)}),this.selectedSet.forEach(e=>{o.has(e)||this.selectedSet.delete(e)}),this._selected=[...this.selectedSet],this.rovingTabindexController.clearElementCache()},new ia.a(this,{config:{attributes:!0,childList:!0,subtree:!0},callback:()=>{this.manageChange()}})}static get styles(){return[d.at(Ws)]}get selected(){return this._selected}set selected(o){if(o===this.selected)return;const e=this.selected;this._selected=o,this.requestUpdate("selected",e)}focus(o){this.rovingTabindexController.focus(o)}handleChange(o){o.stopPropagation();const e=this.selected;if(!this.selects){o.preventDefault();return}if(this.selects==="single"){const{target:t}=o;if(t.tabIndex=0,t.selected=!0,this.selectedSet.has(t.value))return;this.selectedSet.clear(),this.selectedSet.add(t.value),this.rovingTabindexController.elements.forEach(a=>{a!==t&&(a.selected=!1)})}else if(this.selects==="multiple"){const{target:t}=o;t.selected?this.selectedSet.add(t.value):this.selectedSet.delete(t.value)}this._selected=[...this.selectedSet],this.dispatchEvent(new Event("change",{cancelable:!0,bubbles:!0}))||(this._selected=e,o.preventDefault())}getPassthroughSwatchActions(o){const e={};o.has("selects")&&(this.selects||o.get("selects")!==void 0)&&(e.selects=this.selects),o.has("border")&&(this.border||o.get("border")!==void 0)&&(e.border=this.border),o.has("rounding")&&(this.rounding||o.get("rounding")!==void 0)&&(e.rounding=this.rounding),o.has("size")&&(this.size!=="m"||o.get("size")!==void 0)&&(e.size=this.size),o.has("shape")&&(this.shape||o.get("shape")!==void 0)&&(e.shape=this.shape);const t=[];return Object.keys(e).length>0&&t.push(a=>{"border"in e&&(a.border=e.border),"rounding"in e&&(a.rounding=e.rounding),"shape"in e&&(a.shape=e.shape),"size"in e&&(a.size=e.size)}),t}getSelectionSwatchActions(o){const e=[];if(!o.has("selects"))return e;this.selects?this.setAttribute("role",this.selects==="single"?"radiogroup":"group"):this.removeAttribute("role");const t={single:"radio",multiple:"checkbox"},a=this.selects?t[this.selects]:"button";return e.push(l=>{l.setAttribute("role",a)}),e}render(){return d.Rt`
|
309
309
|
<slot
|
310
310
|
@change=${this.handleChange}
|
311
311
|
@slotchange=${this.manageChange}
|
312
312
|
></slot>
|
313
|
-
`}willUpdate(o){const e=[...this.getPassthroughSwatchActions(o),...this.getSelectionSwatchActions(o)];let t=new Set(this.selected);const a=new Set;o.has("selected")&&e.push(s=>{a.add(s.value),s.selected=!!(t.has(s.value)||!this.hasUpdated&&s.selected)});const l=()=>{t=new Set(this.selected),this.swatches.forEach(s=>{e.forEach(n=>{n(s)})}),o.has("selected")&&(this._selected=[...t.values()].filter(s=>a.has(s)))};this.hasUpdated?l():this.renderRoot.addEventListener("slotchange",()=>{requestAnimationFrame(l)},{once:!0})}}vo([d.zt({reflect:!0})],go.prototype,"border",2);vo([d.zt({reflect:!0})],go.prototype,"density",2);vo([d.zt({reflect:!0})],go.prototype,"rounding",2);vo([d.zt({type:Array})],go.prototype,"selected",1);vo([d.zt()],go.prototype,"selects",2);vo([d.zt({reflect:!0})],go.prototype,"shape",2);vo([
|
313
|
+
`}willUpdate(o){const e=[...this.getPassthroughSwatchActions(o),...this.getSelectionSwatchActions(o)];let t=new Set(this.selected);const a=new Set;o.has("selected")&&e.push(s=>{a.add(s.value),s.selected=!!(t.has(s.value)||!this.hasUpdated&&s.selected)});const l=()=>{t=new Set(this.selected),this.swatches.forEach(s=>{e.forEach(n=>{n(s)})}),o.has("selected")&&(this._selected=[...t.values()].filter(s=>a.has(s)))};this.hasUpdated?l():this.renderRoot.addEventListener("slotchange",()=>{requestAnimationFrame(l)},{once:!0})}}vo([d.zt({reflect:!0})],go.prototype,"border",2);vo([d.zt({reflect:!0})],go.prototype,"density",2);vo([d.zt({reflect:!0})],go.prototype,"rounding",2);vo([d.zt({type:Array})],go.prototype,"selected",1);vo([d.zt()],go.prototype,"selects",2);vo([d.zt({reflect:!0})],go.prototype,"shape",2);vo([Ne.d({flatten:!0})],go.prototype,"swatches",2);customElements.get("luzmo-swatch")||customElements.define("luzmo-swatch",J);customElements.get("luzmo-swatch-group")||customElements.define("luzmo-swatch-group",go);/*! * Lucero - The design system for Luzmo.
|
314
314
|
*
|
315
315
|
* Copyright © 2025 Luzmo
|
316
316
|
* All rights reserved.
|
@@ -326,7 +326,7 @@
|
|
326
326
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
327
327
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
328
328
|
* SOFTWARE.
|
329
|
-
* */const Ys=()=>{if(typeof document<"u"&&!document.querySelector("style[data-luzmo-vars]")){const r=document.createElement("style");r.setAttribute("data-luzmo-vars",""),r.textContent='html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}',document.head.appendChild(r)}};Ys();const Gs='@charset "UTF-8";:host{width:var(--luzmo-color-menu-width, var(--color-menu-width))}.hue-opacity-text-swatches-container{display:flex;gap:var(--luzmo-color-menu-color-controls-vertical-gap, var(--color-menu-color-controls-vertical-gap));flex-direction:column;padding:var(--luzmo-color-menu-hue-opacity-text-swatches-vertical-padding, var(--color-menu-hue-opacity-text-swatches-vertical-padding)) var(--luzmo-color-menu-hue-opacity-text-swatches-horizontal-padding, var(--color-menu-hue-opacity-text-swatches-horizontal-padding))}.swatch-sliders-container{display:flex;gap:var(--luzmo-color-menu-swatch-to-sliders-space, var(--color-menu-swatch-to-sliders-space))}.swatch-example-container{display:flex;align-items:center}.field-container{display:flex;align-items:center;gap:var(--luzmo-color-menu-format-field-to-format-space, var(--color-menu-format-field-to-format-space))}.format-container{text-transform:uppercase;position:relative;background:none;border:none;outline:none;height:var(--luzmo-color-menu-format-height, var(--color-menu-format-height));cursor:pointer;font-size:var(--luzmo-color-menu-format-font-size, var(--color-menu-format-font-size));display:flex;align-items:center;color:var(--luzmo-color-menu-format-font-color, var(--color-menu-format-font-color));gap:var(--luzmo-color-menu-format-name-to-icon, var(--color-menu-format-name-to-icon-space));padding:0 var(--luzmo-color-menu-format-horizontal-padding, var(--color-menu-format-horizontal-padding))}.format-container:hover{color:var(--luzmo-color-menu-format-font-color-hover, var(--color-menu-format-font-color-hover))}.format-container:focus-visible{outline:none}.format-container:focus-visible:after{content:"";width:100%;height:100%;position:absolute;box-sizing:border-box;left:0;top:0;border:var(--luzmo-color-menu-format-indicator-width, var(--luzmo-indicator-width)) solid var(--luzmo-color-menu-format-indicator-color, var(--luzmo-indicator-color));border-radius:var(--luzmo-color-menu-format-label-indicator-border-radius, var(--luzmo-border-radius-s))}.format-container:focus-visible,.format-container:active{color:var(--luzmo-color-menu-format-font-color-down, var(--color-menu-format-font-color-down))}.format-container .format-label{-webkit-user-select:none;user-select:none}.format-container .angle-icon{display:flex;align-items:center;height:calc(var(--color-menu-format-font-size) / 1.5)}.slider-container{display:flex;flex-direction:column;justify-content:center;gap:var(--luzmo-color-menu-slider-gap, var(--color-menu-slider-gap))}luzmo-color-area{width:100%;height:var(--luzmo-color-menu-height, var(--color-menu-height))}luzmo-color-slider{width:100%}luzmo-divider{margin:var(--luzmo-spacing-5) à}.swatches-container{display:grid;grid-template-columns:repeat(6,1fr);gap:var(--luzmo-color-menu-swatches-gap, var(--color-menu-swatches-gap))}.swatches-container luzmo-swatch{cursor:pointer}.swatches-container .swatch-choice{display:flex;align-items:center;justify-content:center}:host{--luzmo-text-field-icon-size-valid: 0px;--luzmo-text-field-icon-spacing-inline-end-valid: 1px;--luzmo-text-field-text-align: center}:host{--color-menu-width: 290px;--luzmo-text-field-width: 220px;--luzmo-color-slider-control-track-width: 8px;--color-menu-height: 140px;--color-menu-hue-opacity-text-swatches-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-hue-opacity-text-swatches-vertical-padding: var( --luzmo-spacing-5 );--color-menu-color-controls-vertical-gap: var(--luzmo-spacing-5);--color-menu-swatch-to-sliders-space: var(--luzmo-spacing-5);--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-format-height: var(--luzmo-component-height);--color-menu-format-font-size: var(--luzmo-font-size-s);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-2);--color-menu-format-field-to-format-space: var(--luzmo-spacing-2);--color-menu-format-horizontal-padding: var(--luzmo-spacing-3);--color-menu-format-font-color: var(--luzmo-font-color);--color-menu-format-font-color-hover: var(--luzmo-font-color-hover);--color-menu-format-font-color-down: var(--luzmo-font-color-down);--color-menu-swatches-gap: var(--luzmo-spacing-4)}:host .swatches-container{--luzmo-swatch-size: 22px}:host([size=s]){--color-menu-width: 260px;--luzmo-text-field-width: 200px;--luzmo-color-slider-control-track-width: 8px;--color-menu-hue-opacity-text-swatches-horizontal-padding: var( --luzmo-spacing-5 );--color-menu-hue-opacity-text-swatches-vertical-padding: var( --luzmo-spacing-4 );--color-menu-color-controls-vertical-gap: var(--luzmo-spacing-4);--color-menu-swatch-to-sliders-space: var(--luzmo-spacing-4);--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-format-height: var(--luzmo-component-height-s);--color-menu-format-font-size: var(--luzmo-font-size-xs);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-2);--color-menu-format-field-to-format-space: var(--luzmo-spacing-2);--color-menu-format-horizontal-padding: var(--luzmo-spacing-2);--color-menu-swatches-gap: var(--luzmo-spacing-3)}:host([size=s]) .swatches-container{--luzmo-swatch-size: 20px}:host([size=l]){--color-menu-width: 350px;--luzmo-text-field-width: 240px;--luzmo-color-slider-control-track-width: 16px;--color-menu-hue-opacity-text-swatches-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--color-menu-hue-opacity-text-swatches-vertical-padding: var( --luzmo-spacing-5 );--color-menu-color-controls-vertical-gap: var(--luzmo-spacing-5);--color-menu-swatch-to-sliders-space: var(--luzmo-spacing-5);--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--color-menu-format-height: var(--luzmo-component-height-l);--color-menu-format-font-size: var(--luzmo-font-size);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-3);--color-menu-format-field-to-format-space: var(--luzmo-spacing-2);--color-menu-format-horizontal-padding: var(--luzmo-spacing-4);--color-menu-swatches-gap: var(--luzmo-spacing-4)}:host([size=l]) .swatches-container{--luzmo-swatch-size: 24px}:host([size=l]) .swatch-example-container{--luzmo-swatch-size: 56px}:host([size=xl]){--color-menu-width: 380px;--luzmo-text-field-width: 280px;--luzmo-color-slider-control-track-width: 16px;--color-menu-hue-opacity-text-swatches-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--color-menu-hue-opacity-text-swatches-vertical-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-color-controls-vertical-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-swatch-to-sliders-space: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-format-height: var(--luzmo-component-height-xl);--color-menu-format-font-size: var(--luzmo-font-size-l);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-3);--color-menu-format-field-to-format-space: var(--luzmo-spacing-3);--color-menu-format-horizontal-padding: var(--luzmo-spacing-4);--color-menu-swatches-gap: var(--luzmo-spacing-4)}:host([size=xl]) .swatches-container{--luzmo-swatch-size: 26px}:host([size=xl]) .swatch-example-container{--luzmo-swatch-size: 64px}';var Zs=Object.defineProperty,no=(r,o,e,t)=>{for(var a=void 0,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=s(o,e,a)||a);return a&&Zs(o,e,a),a};const Qt=class extends d.m(Ne.r){constructor(){super(...arguments),this.color="rgb(255, 0, 0)",this.noAlphaChannel=!1,this._alpha=1,this._rgbColor="rgb(255, 0, 0)",this._rgbaColor="rgb(255, 0, 0, 1)",this._previousColor="rgb(255, 0, 0)"}setColor(o){var e;const t=new N((e=o==null?void 0:o.target)==null?void 0:e.color);this._format=t.format==="name"?"rgb":t.format,this._rgbaColor=t.toRgbString(),this._alpha=this.noAlphaChannel?1:t.getAlpha(),this._rgbColor=t.setAlpha(1).toRgbString(),this.hueSliderElement.color=this._rgbColor,this.areaElement.color=this._rgbColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.swatchElement.color=this._rgbaColor,this.colorFieldElement.value=this.formatTextField(t),this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}handleAreaChange(o){o.stopPropagation(),o.preventDefault(),this._rgbColor=this.areaElement.color;const e=new N(this._rgbColor);this._rgbaColor=e.setAlpha(this._alpha).toRgbString(),this.colorFieldElement.value=this._rgbaColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.colorFieldElement.value=this.formatTextField(e),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}get focusElement(){return this.areaElement||this.colorFieldElement||this}handleHueSliderChange(o){o.stopPropagation(),o.preventDefault();const e=new N(this._rgbColor).toHsl();e.h=this.hueSliderElement.value;const t=new N(e);this._rgbColor=t.toRgbString(),this._rgbaColor=t.setAlpha(this._alpha).toRgbString(),this.areaElement.color=this._rgbColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.colorFieldElement.value=this.formatTextField(t),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}handleOpacitySliderChange(o){o.stopPropagation(),o.preventDefault(),this._alpha=this.opacitySliderElement.sliderHandlePosition/100;const e=new N(this._rgbColor).setAlpha(this._alpha);this._rgbaColor=e.toRgbString(),this.colorFieldElement.value=this.formatTextField(e),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}handleFieldChange(o){if(o.stopPropagation(),o.preventDefault(),this.colorFieldElement.checkValidity()){const e=new N(this.colorFieldElement.value);this._format=e.format,this._rgbaColor=e.toRgbString(),this._alpha=e.getAlpha(),this._rgbColor=e.setAlpha(1).toRgbString(),this.noAlphaChannel&&(this._rgbaColor=this._rgbColor,this._alpha=1),this.hueSliderElement.color=this._rgbColor,this.areaElement.color=this._rgbColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}}formatTextField(o){return this._format==="hsl"?o.toHslString():this._format==="hex"?this.noAlphaChannel?o.toHexString():o.toHex8String():(this._format==="name"&&(this._format="rgb"),o.toRgbString())}cycleFormat(){const o=["rgb","hsl","hex"];this._format=o[(o.indexOf(this._format)+1)%o.length];const e=new N(this.color),t=this.formatTextField(e);this.colorFieldElement.value=t}updated(o){if(o.has("color")&&this.color!==this._previousColor){this._previousColor=this.color;const e=new N(this.color);this._alpha=e.getAlpha(),this._rgbColor=e.setAlpha(1).toRgbString(),this._rgbaColor=e.setAlpha(this._alpha).toRgbString(),this.areaElement.color=this._rgbColor,this.hueSliderElement.color=this._rgbColor,this.colorFieldElement.value=this._rgbaColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.swatchElement.color=this._rgbaColor,this._format="rgb"}o.has("noAlphaChannel")&&!this.noAlphaChannel&&(this.opacitySliderElement.color=this._rgbaColor)}renderOpacitySlider(){return d.Rt`
|
329
|
+
* */const Ys=()=>{if(typeof document<"u"&&!document.querySelector("style[data-luzmo-vars]")){const r=document.createElement("style");r.setAttribute("data-luzmo-vars",""),r.textContent='html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}',document.head.appendChild(r)}};Ys();const Gs='@charset "UTF-8";:host{width:var(--luzmo-color-menu-width, var(--color-menu-width))}.hue-opacity-text-swatches-container{display:flex;gap:var(--luzmo-color-menu-color-controls-vertical-gap, var(--color-menu-color-controls-vertical-gap));flex-direction:column;padding:var(--luzmo-color-menu-hue-opacity-text-swatches-vertical-padding, var(--color-menu-hue-opacity-text-swatches-vertical-padding)) var(--luzmo-color-menu-hue-opacity-text-swatches-horizontal-padding, var(--color-menu-hue-opacity-text-swatches-horizontal-padding))}.swatch-sliders-container{display:flex;gap:var(--luzmo-color-menu-swatch-to-sliders-space, var(--color-menu-swatch-to-sliders-space))}.swatch-example-container{display:flex;align-items:center}.field-container{display:flex;align-items:center;gap:var(--luzmo-color-menu-format-field-to-format-space, var(--color-menu-format-field-to-format-space))}.format-container{text-transform:uppercase;position:relative;background:none;border:none;outline:none;height:var(--luzmo-color-menu-format-height, var(--color-menu-format-height));cursor:pointer;font-size:var(--luzmo-color-menu-format-font-size, var(--color-menu-format-font-size));display:flex;align-items:center;color:var(--luzmo-color-menu-format-font-color, var(--color-menu-format-font-color));gap:var(--luzmo-color-menu-format-name-to-icon, var(--color-menu-format-name-to-icon-space));padding:0 var(--luzmo-color-menu-format-horizontal-padding, var(--color-menu-format-horizontal-padding))}.format-container:hover{color:var(--luzmo-color-menu-format-font-color-hover, var(--color-menu-format-font-color-hover))}.format-container:focus-visible{outline:none}.format-container:focus-visible:after{content:"";width:100%;height:100%;position:absolute;box-sizing:border-box;left:0;top:0;border:var(--luzmo-color-menu-format-indicator-width, var(--luzmo-indicator-width)) solid var(--luzmo-color-menu-format-indicator-color, var(--luzmo-indicator-color));border-radius:var(--luzmo-color-menu-format-label-indicator-border-radius, var(--luzmo-border-radius-s))}.format-container:focus-visible,.format-container:active{color:var(--luzmo-color-menu-format-font-color-down, var(--color-menu-format-font-color-down))}.format-container .format-label{-webkit-user-select:none;user-select:none}.format-container .angle-icon{display:flex;align-items:center;height:calc(var(--color-menu-format-font-size) / 1.5)}.slider-container{display:flex;flex-direction:column;justify-content:center;gap:var(--luzmo-color-menu-slider-gap, var(--color-menu-slider-gap))}luzmo-color-area{width:100%;height:var(--luzmo-color-menu-height, var(--color-menu-height))}luzmo-color-slider{width:100%}luzmo-divider{margin:var(--luzmo-spacing-5) à}.swatches-container{display:grid;grid-template-columns:repeat(6,1fr);gap:var(--luzmo-color-menu-swatches-gap, var(--color-menu-swatches-gap))}.swatches-container luzmo-swatch{cursor:pointer}.swatches-container .swatch-choice{display:flex;align-items:center;justify-content:center}:host{--luzmo-text-field-icon-size-valid: 0px;--luzmo-text-field-icon-spacing-inline-end-valid: 1px;--luzmo-text-field-text-align: center}:host{--color-menu-width: 290px;--luzmo-text-field-width: 220px;--luzmo-color-slider-control-track-width: 8px;--color-menu-height: 140px;--color-menu-hue-opacity-text-swatches-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-hue-opacity-text-swatches-vertical-padding: var( --luzmo-spacing-5 );--color-menu-color-controls-vertical-gap: var(--luzmo-spacing-5);--color-menu-swatch-to-sliders-space: var(--luzmo-spacing-5);--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-format-height: var(--luzmo-component-height);--color-menu-format-font-size: var(--luzmo-font-size-s);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-2);--color-menu-format-field-to-format-space: var(--luzmo-spacing-2);--color-menu-format-horizontal-padding: var(--luzmo-spacing-3);--color-menu-format-font-color: var(--luzmo-font-color);--color-menu-format-font-color-hover: var(--luzmo-font-color-hover);--color-menu-format-font-color-down: var(--luzmo-font-color-down);--color-menu-swatches-gap: var(--luzmo-spacing-4)}:host .swatches-container{--luzmo-swatch-size: 22px}:host([size=s]){--color-menu-width: 260px;--luzmo-text-field-width: 200px;--luzmo-color-slider-control-track-width: 8px;--color-menu-hue-opacity-text-swatches-horizontal-padding: var( --luzmo-spacing-5 );--color-menu-hue-opacity-text-swatches-vertical-padding: var( --luzmo-spacing-4 );--color-menu-color-controls-vertical-gap: var(--luzmo-spacing-4);--color-menu-swatch-to-sliders-space: var(--luzmo-spacing-4);--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-format-height: var(--luzmo-component-height-s);--color-menu-format-font-size: var(--luzmo-font-size-xs);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-2);--color-menu-format-field-to-format-space: var(--luzmo-spacing-2);--color-menu-format-horizontal-padding: var(--luzmo-spacing-2);--color-menu-swatches-gap: var(--luzmo-spacing-3)}:host([size=s]) .swatches-container{--luzmo-swatch-size: 20px}:host([size=l]){--color-menu-width: 350px;--luzmo-text-field-width: 240px;--luzmo-color-slider-control-track-width: 16px;--color-menu-hue-opacity-text-swatches-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--color-menu-hue-opacity-text-swatches-vertical-padding: var( --luzmo-spacing-5 );--color-menu-color-controls-vertical-gap: var(--luzmo-spacing-5);--color-menu-swatch-to-sliders-space: var(--luzmo-spacing-5);--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--color-menu-format-height: var(--luzmo-component-height-l);--color-menu-format-font-size: var(--luzmo-font-size);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-3);--color-menu-format-field-to-format-space: var(--luzmo-spacing-2);--color-menu-format-horizontal-padding: var(--luzmo-spacing-4);--color-menu-swatches-gap: var(--luzmo-spacing-4)}:host([size=l]) .swatches-container{--luzmo-swatch-size: 24px}:host([size=l]) .swatch-example-container{--luzmo-swatch-size: 56px}:host([size=xl]){--color-menu-width: 380px;--luzmo-text-field-width: 280px;--luzmo-color-slider-control-track-width: 16px;--color-menu-hue-opacity-text-swatches-horizontal-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-2) );--color-menu-hue-opacity-text-swatches-vertical-padding: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-color-controls-vertical-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-swatch-to-sliders-space: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-slider-gap: calc( var(--luzmo-spacing-5) + var(--luzmo-spacing-1) );--color-menu-format-height: var(--luzmo-component-height-xl);--color-menu-format-font-size: var(--luzmo-font-size-l);--color-menu-format-name-to-icon-space: var(--luzmo-spacing-3);--color-menu-format-field-to-format-space: var(--luzmo-spacing-3);--color-menu-format-horizontal-padding: var(--luzmo-spacing-4);--color-menu-swatches-gap: var(--luzmo-spacing-4)}:host([size=xl]) .swatches-container{--luzmo-swatch-size: 26px}:host([size=xl]) .swatch-example-container{--luzmo-swatch-size: 64px}';var Zs=Object.defineProperty,no=(r,o,e,t)=>{for(var a=void 0,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=s(o,e,a)||a);return a&&Zs(o,e,a),a};const oa=class extends d.m(Be.r){constructor(){super(...arguments),this.color="rgb(255, 0, 0)",this.noAlphaChannel=!1,this._alpha=1,this._rgbColor="rgb(255, 0, 0)",this._rgbaColor="rgb(255, 0, 0, 1)",this._previousColor="rgb(255, 0, 0)"}setColor(o){var e;const t=new B((e=o==null?void 0:o.target)==null?void 0:e.color);this._format=t.format==="name"?"rgb":t.format,this._rgbaColor=t.toRgbString(),this._alpha=this.noAlphaChannel?1:t.getAlpha(),this._rgbColor=t.setAlpha(1).toRgbString(),this.hueSliderElement.color=this._rgbColor,this.areaElement.color=this._rgbColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.swatchElement.color=this._rgbaColor,this.colorFieldElement.value=this.formatTextField(t),this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}handleAreaChange(o){o.stopPropagation(),o.preventDefault(),this._rgbColor=this.areaElement.color;const e=new B(this._rgbColor);this._rgbaColor=e.setAlpha(this._alpha).toRgbString(),this.colorFieldElement.value=this._rgbaColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.colorFieldElement.value=this.formatTextField(e),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}get focusElement(){return this.areaElement||this.colorFieldElement||this}handleHueSliderChange(o){o.stopPropagation(),o.preventDefault();const e=new B(this._rgbColor).toHsl();e.h=this.hueSliderElement.value;const t=new B(e);this._rgbColor=t.toRgbString(),this._rgbaColor=t.setAlpha(this._alpha).toRgbString(),this.areaElement.color=`hsla(${e.h}, ${e.s*100}%, ${e.l*100}%, ${e.a})`,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.colorFieldElement.value=this.formatTextField(t),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}handleOpacitySliderChange(o){o.stopPropagation(),o.preventDefault(),this._alpha=this.opacitySliderElement.sliderHandlePosition/100;const e=new B(this._rgbColor).setAlpha(this._alpha);this._rgbaColor=e.toRgbString(),this.colorFieldElement.value=this.formatTextField(e),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}handleFieldChange(o){if(o.stopPropagation(),o.preventDefault(),this.colorFieldElement.checkValidity()){const e=new B(this.colorFieldElement.value);this._format=e.format,this._rgbaColor=e.toRgbString(),this._alpha=e.getAlpha(),this._rgbColor=e.setAlpha(1).toRgbString(),this.noAlphaChannel&&(this._rgbaColor=this._rgbColor,this._alpha=1),this.hueSliderElement.color=this._rgbColor,this.areaElement.color=this._rgbColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.swatchElement.color=this._rgbaColor,this._previousColor=this._rgbaColor,this.color=this._rgbaColor,this.dispatchEvent(new CustomEvent("change",{detail:this.color}))}}formatTextField(o){return this._format==="hsl"?o.toHslString():this._format==="hex"?this.noAlphaChannel?o.toHexString():o.toHex8String():(this._format==="name"&&(this._format="rgb"),o.toRgbString())}cycleFormat(){const o=["rgb","hsl","hex"];this._format=o[(o.indexOf(this._format)+1)%o.length];const e=new B(this.color),t=this.formatTextField(e);this.colorFieldElement.value=t}updated(o){if(o.has("color")&&this.color!==this._previousColor){this._previousColor=this.color;const e=new B(this.color);this._alpha=e.getAlpha(),this._rgbColor=e.setAlpha(1).toRgbString(),this._rgbaColor=e.setAlpha(this._alpha).toRgbString(),this.areaElement.color=this._rgbColor,this.hueSliderElement.color=this._rgbColor,this.colorFieldElement.value=this._rgbaColor,this.noAlphaChannel||(this.opacitySliderElement.color=this._rgbaColor),this.swatchElement.color=this._rgbaColor,this._format="rgb"}o.has("noAlphaChannel")&&!this.noAlphaChannel&&(this.opacitySliderElement.color=this._rgbaColor)}renderOpacitySlider(){return d.Rt`
|
330
330
|
<luzmo-color-slider
|
331
331
|
id="luzmo-opacity-slider"
|
332
332
|
mode="opacity"
|
@@ -394,7 +394,7 @@
|
|
394
394
|
`:""}
|
395
395
|
</div>
|
396
396
|
</div>
|
397
|
-
`}};
|
397
|
+
`}};oa.styles=d.at(Gs);let ao=oa;no([d.zt({type:String,reflect:!0})],ao.prototype,"color");no([d.zt({type:Boolean,reflect:!0,attribute:"no-alpha-channel"})],ao.prototype,"noAlphaChannel");no([d.zt({type:Array,reflect:!0})],ao.prototype,"swatches");no([P.d("luzmo-color-area")],ao.prototype,"areaElement");no([P.d("#luzmo-hue-slider")],ao.prototype,"hueSliderElement");no([P.d("#luzmo-opacity-slider")],ao.prototype,"opacitySliderElement");no([P.d("luzmo-color-field")],ao.prototype,"colorFieldElement");no([P.d("luzmo-swatch")],ao.prototype,"swatchElement");no([ct.n()],ao.prototype,"_format");customElements.get("luzmo-color-menu")||customElements.define("luzmo-color-menu",ao);/*! * Lucero - The design system for Luzmo.
|
398
398
|
*
|
399
399
|
* Copyright © 2025 Luzmo
|
400
400
|
* All rights reserved.
|
@@ -410,7 +410,7 @@
|
|
410
410
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
411
411
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
412
412
|
* SOFTWARE.
|
413
|
-
* */const Ks=()=>{if(typeof document<"u"&&!document.querySelector("style[data-luzmo-vars]")){const r=document.createElement("style");r.setAttribute("data-luzmo-vars",""),r.textContent='html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}',document.head.appendChild(r)}};Ks();const Vs="luzmo-popover{margin-left:var(--luzmo-color-picker-popover-horizontal-gap, var(--color-picker-popover-horizontal-gap));margin-right:var(--luzmo-color-picker-popover-horizontal-gap, var(--color-picker-popover-horizontal-gap))}luzmo-swatch{cursor:pointer}:host{--luzmo-popover-content-area-spacing-vertical: 0;--color-picker-popover-horizontal-gap: var(--luzmo-spacing-4)}:host([size=s]){--color-picker-popover-horizontal-gap: var(--luzmo-spacing-3)}:host([size=l]),:host([size=xl]){--color-picker-popover-horizontal-gap: var(--luzmo-spacing-5)}";var Js=Object.defineProperty,
|
413
|
+
* */const Ks=()=>{if(typeof document<"u"&&!document.querySelector("style[data-luzmo-vars]")){const r=document.createElement("style");r.setAttribute("data-luzmo-vars",""),r.textContent='html{--luzmo-animation-duration: 0.15s;--luzmo-border-color: rgba(var(--luzmo-border-color-rgb), 0.1);--luzmo-border-color-hover: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-down: rgba(var(--luzmo-border-color-rgb), 0.3);--luzmo-border-color-focus: rgba(var(--luzmo-border-color-rgb), 0.15);--luzmo-border-color-rgb: 0, 0, 0;--luzmo-border-color-full: rgb(180, 180, 180);--luzmo-border-color-full-hover: rgb(140, 140, 140);--luzmo-border-color-full-down: rgb(110, 110, 110);--luzmo-border-color-full-focus: rgb(140, 140, 140);--luzmo-border-color-disabled: #dddddd;--luzmo-border-radius: 6px;--luzmo-border-radius-s: 4px;--luzmo-border-radius-l: 8px;--luzmo-border-radius-xl: 12px;--luzmo-border-radius-full: 999rem;--luzmo-background-color: #ffffff;--luzmo-background-color-rgb: 255, 255, 255;--luzmo-background-color-disabled: #eeeeee;--luzmo-background-color-hover: #f0f0fc;--luzmo-background-color-down: #f1f1ff;--luzmo-background-color-focus: #f0f0fc;--luzmo-background-color-highlight: rgb(240, 240, 240);--luzmo-background-color-highlight-disabled: rgb(245, 245, 245);--luzmo-background-color-highlight-hover: rgb(225, 225, 225);--luzmo-background-color-highlight-down: rgb(215, 215, 215);--luzmo-background-color-highlight-focus: rgb(225, 225, 225);--luzmo-border-width: 1px;--luzmo-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", Helvetica, Arial, sans-serif;--luzmo-font-size-xs: 10px;--luzmo-font-size-s: 12px;--luzmo-font-size-m: 14px;--luzmo-font-size: 14px;--luzmo-font-size-l: 16px;--luzmo-font-size-xl: 18px;--luzmo-font-size-xxl: 20px;--luzmo-font-style: normal;--luzmo-line-height: normal;--luzmo-font-weight: 400;--luzmo-font-weight-semibold: 500;--luzmo-font-weight-bold: 600;--luzmo-font-color: #333;--luzmo-font-color-hard: #000;--luzmo-font-color-disabled: var(--luzmo-disabled-color);--luzmo-font-color-extra-dimmed: #888;--luzmo-font-color-hover: #333;--luzmo-font-color-down: #111;--luzmo-font-color-focus: #333;--luzmo-primary: #4434ff;--luzmo-primary-hover: #4234e4;--luzmo-primary-down: #392cc7;--luzmo-primary-focus: #4234e4;--luzmo-primary-inverse-color: #ffffff;--luzmo-primary-rgb: 68, 52, 255;--luzmo-secondary: #ff00ff;--luzmo-secondary-hover: #e309e3;--luzmo-secondary-down: #c711c7;--luzmo-secondary-focus: #e309e3;--luzmo-secondary-inverse-color: #ffffff;--luzmo-secondary-rgb: 255, 0, 255;--luzmo-negative-color: #ca221c;--luzmo-negative-color-hover: #b3241f;--luzmo-negative-color-down: #9f231f;--luzmo-negative-color-focus: #b3241f;--luzmo-negative-color-rgb: 202, 34, 28;--luzmo-positive-color: rgb(20, 150, 101);--luzmo-positive-color-hover: rgb(17, 128, 86);--luzmo-positive-color-down: rgb(16, 105, 71);--luzmo-positive-color-focus: rgb(17, 128, 86);--luzmo-positive-color-rgb: 20, 150, 101;--luzmo-selected-color: rgb(110, 110, 110);--luzmo-selected-color-hover: rgb(70, 70, 70);--luzmo-selected-color-down: rgb(40, 40, 40);--luzmo-selected-color-focus: rgb(70, 70, 70);--luzmo-selected-color-hard: #1e1e1e;--luzmo-selected-color-hard-hover: rgb(0, 0, 0);--luzmo-selected-color-hard-down: rgb(0, 0, 0);--luzmo-selected-color-hard-focus: rgb(0, 0, 0);--luzmo-informative-color: #1a77e9;--luzmo-informative-color-rgb: 26, 119, 233;--luzmo-disabled-color: #aaaaaa;--luzmo-spacing-1: 2px;--luzmo-spacing-2: 4px;--luzmo-spacing-3: 8px;--luzmo-spacing-4: 12px;--luzmo-spacing-5: 16px;--luzmo-indicator-gap: 2px;--luzmo-indicator-width: 1px;--luzmo-indicator-color: var(--luzmo-primary);--luzmo-component-height-xxs: 20px;--luzmo-component-height-xs: 24px;--luzmo-component-height-s: 28px;--luzmo-component-height: 32px;--luzmo-component-height-l: 40px;--luzmo-component-height-xl: 48px;--luzmo-component-height-xxl: 64px;--luzmo-icon-size-xxs: 12px;--luzmo-icon-size-xs: 14px;--luzmo-icon-size-s: 16px;--luzmo-icon-size-m: 18px;--luzmo-icon-size-l: 20px;--luzmo-icon-size-xl: 22px;--luzmo-icon-size-xxl: 32px}',document.head.appendChild(r)}};Ks();const Vs="luzmo-popover{margin-left:var(--luzmo-color-picker-popover-horizontal-gap, var(--color-picker-popover-horizontal-gap));margin-right:var(--luzmo-color-picker-popover-horizontal-gap, var(--color-picker-popover-horizontal-gap))}luzmo-swatch{cursor:pointer}:host([read-only]) luzmo-swatch{cursor:default;pointer-events:none}:host{--luzmo-popover-content-area-spacing-vertical: 0;--color-picker-popover-horizontal-gap: var(--luzmo-spacing-4)}:host([size=s]){--color-picker-popover-horizontal-gap: var(--luzmo-spacing-3)}:host([size=l]),:host([size=xl]){--color-picker-popover-horizontal-gap: var(--luzmo-spacing-5)}";var Js=Object.defineProperty,Q=(r,o,e,t)=>{for(var a=void 0,l=r.length-1,s;l>=0;l--)(s=r[l])&&(a=s(o,e,a)||a);return a&&Js(o,e,a),a};const ea=class extends d.m(d.It){constructor(){super(...arguments),this.color="rgb(255, 0, 0)",this.open=!1,this.disabled=!1,this.readOnly=!1,this.placement="left-start",this.rounding="full",this.swatches=[],this.noAlphaChannel=!1,this._renderMenu=!1}overlayCloseEvent(){this.open=!1}overlayOpenEvent(){this.open=!0}handleColorChange(){const o=this.menuElement.color;this.color=typeof o=="string"?o:String(o),this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))}firstUpdated(){this.overlayElement.addEventListener("slottable-request",o=>{this._renderMenu=o.data!==Ne.a})}updated(o){o.has("open")&&this.open===!0&&(this._renderMenu=!0)}renderColorMenu(){return d.Rt`
|
414
414
|
<luzmo-color-menu
|
415
415
|
.size=${this.size}
|
416
416
|
.color=${this.color}
|
@@ -427,11 +427,12 @@
|
|
427
427
|
.color=${this.color}
|
428
428
|
.selected=${this.open&&!this.disabled}
|
429
429
|
?disabled=${this.disabled}
|
430
|
+
?read-only=${this.readOnly}
|
430
431
|
@luzmo-closed=${this.overlayCloseEvent}
|
431
432
|
@luzmo-opened=${this.overlayOpenEvent}
|
432
433
|
></luzmo-swatch>
|
433
434
|
<luzmo-overlay
|
434
|
-
trigger=${this.disabled?"":"trigger@click"}
|
435
|
+
trigger=${this.disabled||this.readOnly?"":"trigger@click"}
|
435
436
|
.placement=${this.placement}
|
436
437
|
type="auto"
|
437
438
|
>
|
@@ -439,4 +440,4 @@
|
|
439
440
|
${this._renderMenu?this.renderColorMenu():d.Rt``}
|
440
441
|
</luzmo-popover>
|
441
442
|
</luzmo-overlay>
|
442
|
-
`}};
|
443
|
+
`}};ea.styles=d.at(Vs);let K=ea;Q([d.zt({type:String,reflect:!0})],K.prototype,"color");Q([d.zt({type:Boolean,reflect:!0})],K.prototype,"open");Q([d.zt({type:Boolean,reflect:!0})],K.prototype,"disabled");Q([d.zt({type:Boolean,reflect:!0,attribute:"read-only"})],K.prototype,"readOnly");Q([d.zt({type:String,reflect:!0})],K.prototype,"placement");Q([d.zt({type:String,reflect:!0})],K.prototype,"rounding");Q([d.zt({type:String,reflect:!0})],K.prototype,"shape");Q([d.zt({type:Array,reflect:!0})],K.prototype,"swatches");Q([d.zt({type:Boolean,reflect:!0,attribute:"no-alpha-channel"})],K.prototype,"noAlphaChannel");Q([P.d("luzmo-color-menu")],K.prototype,"menuElement");Q([P.d("luzmo-overlay")],K.prototype,"overlayElement");Q([ct.n()],K.prototype,"_renderMenu");customElements.get("luzmo-color-picker")||customElements.define("luzmo-color-picker",K);
|