@umbraco-ui/uui 1.14.0-rc.3 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/uui.min.js +10 -2
- package/dist/uui.min.js.map +1 -1
- package/package.json +85 -85
package/dist/uui.min.js
CHANGED
|
@@ -68,10 +68,12 @@
|
|
|
68
68
|
margin-top: var(--uui-size-layout-1,24px);
|
|
69
69
|
margin-bottom: var(--uui-size-layout-1,24px);
|
|
70
70
|
}
|
|
71
|
+
|
|
71
72
|
.uui-text p + h1,
|
|
72
73
|
.uui-text p + .uui-h1 {
|
|
73
74
|
margin-top: var(--uui-size-layout-4,66px);
|
|
74
75
|
}
|
|
76
|
+
|
|
75
77
|
.uui-text h1.--no-top-margin,
|
|
76
78
|
.uui-text h1:first-child,
|
|
77
79
|
.uui-h1.--no-top-margin,
|
|
@@ -88,10 +90,12 @@
|
|
|
88
90
|
margin-top: var(--uui-size-layout-1,24px);
|
|
89
91
|
margin-bottom: var(--uui-size-layout-1,24px);
|
|
90
92
|
}
|
|
93
|
+
|
|
91
94
|
.uui-text p + h2,
|
|
92
95
|
.uui-text p + .uui-h2 {
|
|
93
96
|
margin-top: var(--uui-size-layout-3,42px);
|
|
94
97
|
}
|
|
98
|
+
|
|
95
99
|
.uui-text h2.--no-top-margin,
|
|
96
100
|
.uui-text h2:first-child,
|
|
97
101
|
.uui-h2.--no-top-margin,
|
|
@@ -108,6 +112,7 @@
|
|
|
108
112
|
margin-top: var(--uui-size-layout-1,24px);
|
|
109
113
|
margin-bottom: var(--uui-size-layout-1,24px);
|
|
110
114
|
}
|
|
115
|
+
|
|
111
116
|
.uui-text h3.--no-top-margin,
|
|
112
117
|
.uui-text h3:first-child,
|
|
113
118
|
.uui-h3.--no-top-margin,
|
|
@@ -124,6 +129,7 @@
|
|
|
124
129
|
margin-top: var(--uui-size-layout-1,24px);
|
|
125
130
|
margin-bottom: var(--uui-size-layout-1,24px);
|
|
126
131
|
}
|
|
132
|
+
|
|
127
133
|
.uui-text h4.--no-top-margin,
|
|
128
134
|
.uui-text h4:first-child,
|
|
129
135
|
.uui-h4.--no-top-margin,
|
|
@@ -153,6 +159,7 @@
|
|
|
153
159
|
margin-top: var(--uui-size-layout-1,24px);
|
|
154
160
|
margin-bottom: var(--uui-size-layout-1,24px);
|
|
155
161
|
}
|
|
162
|
+
|
|
156
163
|
.uui-p-lead,
|
|
157
164
|
.uui-text p.uui-lead {
|
|
158
165
|
font-size: var(--uui-size-6,18px);
|
|
@@ -169,6 +176,7 @@
|
|
|
169
176
|
.uui-text a:active {
|
|
170
177
|
color: var(--uui-color-interactive,#1b264f);
|
|
171
178
|
}
|
|
179
|
+
|
|
172
180
|
.uui-a:hover,
|
|
173
181
|
.uui-text a:hover {
|
|
174
182
|
color: var(--uui-color-interactive-emphasis,#3544b1);
|
|
@@ -309,7 +317,7 @@
|
|
|
309
317
|
* @license
|
|
310
318
|
* Copyright 2018 Google LLC
|
|
311
319
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
312
|
-
*/const $=i=>i??x;let ro=class extends z{constructor(e,t={}){super(e,{bubbles:!0,composed:!0,...t})}};ro.CLICK="click";var oh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,Ws=i=>{throw TypeError(i)},ut=(i,e,t,r)=>{for(var o=r>1?void 0:r?rh(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&oh(e,t,o),o},nh=(i,e,t)=>e.has(i)||Ws("Cannot "+t),sh=(i,e,t)=>e.has(i)?Ws("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),no=(i,e,t)=>(nh(i,e,"access private method"),t),Ot,Ar,qs,Ks;n.UUIButtonInlineCreateElement=class extends f{constructor(){super(...arguments),sh(this,Ot),this._position=0,this.vertical=!1}_onMouseMove(e){this._position=(this.vertical?e.offsetY:e.offsetX)-5}_handleClick(e){e.preventDefault(),e.stopImmediatePropagation(),e.target?.blur?.(),this.dispatchEvent(new ro(ro.CLICK))}render(){return this.href?no(this,Ot,qs).call(this):no(this,Ot,Ks).call(this)}},Ot=new WeakSet,Ar=function(){return u`<div id="plus" style="${Ae({left:this.vertical?"":this._position+"px",top:this.vertical?this._position+"px":""})}"><svg id="plus-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M420.592 214.291H296.104V89.804h-83.102v124.487H88.518v83.104h124.484v124.488h83.102V297.395h124.488z"/></svg></div>`},qs=function(){return u`<a id="button-wrapper" @mousemove="${this._onMouseMove}" href="${$(this.href)}" target="${$(this.target||void 0)}" rel="${$(this.rel||$(this.target==="_blank"?"noopener noreferrer":void 0))}" aria-label="${this.label?this.label:"create new element"}">${no(this,Ot,Ar).call(this)}</a>`},Ks=function(){return u`<button id="button-wrapper" @mousemove="${this._onMouseMove}" @click="${this._handleClick}" aria-label="${this.label?this.label:"create new element"}">${no(this,Ot,Ar).call(this)}</button>`},n.UUIButtonInlineCreateElement.styles=[Jc,g`:host{display:flex;position:relative;z-index:1}:host(:not([vertical])){height:20px;width:100%;margin:-10px 0}:host([vertical]){height:100%;width:20px;margin:0 -10px}#button-wrapper{display:flex;justify-content:center;align-items:center;position:absolute;z-index:1;outline:0;transition:opacity .24s;display:inline-flex;width:100%;border:none;height:100%;padding:0;text-decoration:none;background:0 0;color:currentColor;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;opacity:0}:host(:focus) #button-wrapper,:host(:focus-within) #button-wrapper,:host(:hover) #button-wrapper{opacity:1}:host(:focus) #button-wrapper:before,:host(:focus-within) #button-wrapper:before,:host(:hover) #button-wrapper:before{animation:${eh};background-color:var(--uui-color-interactive-emphasis,#3544b1);border-color:var(--uui-color-surface,#fff)!important}#button-wrapper:before{content:'';position:absolute;right:0;left:0;height:2px;background-color:transparent;border-top:1px solid transparent;border-bottom:1px solid transparent;border-radius:2px;pointer-events:none;transition:background-color 720ms ease-out,border-color 240ms}:host(:not([vertical])) #button-wrapper:before{top:50%;transform:translateY(-50%)}:host([vertical]) #button-wrapper:before{height:100%;width:2px;left:50%;transform:translateX(-50%);border-top:none;border-bottom:none;border-left:1px solid transparent;border-right:1px solid transparent}:host(:not([vertical]):not(:hover)) #plus:not(:focus){left:calc(50% - 2px)!important}:host([vertical]:not(:hover)) #plus:not(:focus){top:calc(50% - 2px)!important}#plus{position:absolute;display:flex;justify-content:center;align-items:center;pointer-events:none;box-sizing:border-box;width:28px;height:28px;border-radius:3em;font-size:14px;border:2px solid var(--uui-color-interactive-emphasis,#3544b1);color:var(--uui-color-interactive-emphasis,#3544b1);background-color:var(--uui-color-surface,#fff);opacity:0;transform:scale(0);transition:transform 240ms ease-in,opacity 240ms,left .1s linear 150ms,top .1s linear 150ms}:host(:focus) #plus,:host(:focus-within) #plus,:host(:hover) #plus{opacity:1;transform:scale(1);transition:transform 240ms cubic-bezier(.175,.885,.32,1.275),opacity 80ms,box-shadow 240ms cubic-bezier(.175,.885,.32,1.275);box-shadow:0 0 0 2px var(--uui-color-surface,#fff)}:host(:not([vertical])) #plus{margin-left:-18px}:host([vertical]) #plus{left:-4px;margin-top:-18px}#button-wrapper:focus #plus{border:2px solid var(--uui-color-focus,#3879ff);color:var(--uui-color-focus,#3879ff)}#plus-icon{width:50%;fill:currentColor}#button-wrapper:active #plus{transform:scale(1.1)}`],ut([U()],n.UUIButtonInlineCreateElement.prototype,"_position",2),ut([l({type:String})],n.UUIButtonInlineCreateElement.prototype,"label",2),ut([l({type:Boolean,reflect:!0})],n.UUIButtonInlineCreateElement.prototype,"vertical",2),ut([l({type:String})],n.UUIButtonInlineCreateElement.prototype,"href",2),ut([l({type:String})],n.UUIButtonInlineCreateElement.prototype,"target",2),ut([l({type:String})],n.UUIButtonInlineCreateElement.prototype,"rel",2),n.UUIButtonInlineCreateElement=ut([v("uui-button-inline-create")],n.UUIButtonInlineCreateElement);let ah=class{constructor(e,t){this._callback=e,this._timerId=null,this._remaining=null,this._onComplete=()=>{this._remaining=null,this._callback()},this.setDuration(t)}setDuration(e){this._duration=e,this._timerId!==null&&this.restart()}start(){this._timerId===null&&this.resume()}restart(){this._remaining=this._duration,this.resume()}pause(){this._timerId!==null&&(window.clearTimeout(this._timerId),this._timerId=null,this._remaining!==null&&(this._remaining-=Date.now()-this._startTime))}resume(){this._timerId!==null&&window.clearTimeout(this._timerId),this._remaining===null&&(this._remaining=this._duration),this._startTime=Date.now(),this._timerId=window.setTimeout(this._onComplete,this._remaining)}destroy(){this.pause()}};const k=(i,e,t=`This element has to be present for ${i.nodeName} to work appropriate.`)=>{customElements.get(e)||console.warn(`%c ${i.nodeName} requires ${e} element to be registered!`,"font-weight: bold;",t,i)},Xs=(i,e)=>{function t(o){const s=i.getBoundingClientRect(),a=i.ownerDocument.defaultView,c=s.left+a.scrollX,h=s.top+a.scrollY;let d;if("TouchEvent"in window&&o instanceof TouchEvent)d=o.touches[0];else if(o instanceof MouseEvent)d=o;else return;const b=d.pageX-c,p=d.pageY-h;e?.onMove&&e.onMove(b,p)}function r(){document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r),e?.onStop&&e.onStop()}document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerup",r),e?.initialEvent&&t(e.initialEvent)},O=(i,e,t)=>Math.min(Math.max(i,e),t),Ys=(i,e,t)=>t+e-i,lh=(i,e,t)=>{let r=i;for(;r!==null;){const o=r instanceof HTMLElement&&r.hasAttribute(e)&&r.getAttribute(e)===t,s=r.querySelector(`[${e}="${t}"]`)!==null;if(o)return r;if(s)return r.querySelector(`[${e}="${t}"]`);r=r.parentElement||r.parentNode||r.host||null}return null};function uh(i){return i?i.assignedNodes({flatten:!0}).length>0:!1}y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><line x1="16" x2="16" y1="2" y2="6"/><line x1="8" x2="8" y1="2" y2="6"/><line x1="3" x2="21" y1="10" y2="10"/><path d="M8 14h.01"/><path d="M12 14h.01"/><path d="M16 14h.01"/><path d="M8 18h.01"/><path d="M12 18h.01"/><path d="M16 18h.01"/></svg>`;const so=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="m2 22 1-1h3l9-9"/><path d="M3 21v-3l9-9"/><path d="m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M15.5 2H8.6c-.4 0-.8.2-1.1.5-.3.3-.5.7-.5 1.1v12.8c0 .4.2.8.5 1.1.3.3.7.5 1.1.5h9.8c.4 0 .8-.2 1.1-.5.3-.3.5-.7.5-1.1V6.5L15.5 2z"/><path d="M3 7.6v12.8c0 .4.2.8.5 1.1.3.3.7.5 1.1.5h9.8"/><path d="M15 2v5h5"/></svg>`;const ch=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/><path d="M2 10h20"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>`;const hh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="4" height="16" x="6" y="4"/><rect width="4" height="16" x="14" y="4"/></svg>`;const dh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"/></svg>`;const zr=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>`;const ph=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>`;const mh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/></svg>`;const bh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/></svg>`,vh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"/><line x1="2" x2="22" y1="2" y2="22"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M15 4V2"/><path d="M15 16v-2"/><path d="M8 9h2"/><path d="M20 9h2"/><path d="M17.8 11.8 19 13"/><path d="M15 9h0"/><path d="M17.8 6.2 19 5"/><path d="m3 21 9-9"/><path d="M12.2 6.2 11 5"/></svg>`;const gh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>`;var fh=Object.defineProperty,yh=Object.getOwnPropertyDescriptor,Zs=i=>{throw TypeError(i)},ve=(i,e,t,r)=>{for(var o=r>1?void 0:r?yh(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&fh(e,t,o),o},Qs=(i,e,t)=>e.has(i)||Zs("Cannot "+t),wh=(i,e,t)=>(Qs(i,e,"read from private field"),e.get(i)),Uh=(i,e,t)=>e.has(i)?Zs("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),_h=(i,e,t,r)=>(Qs(i,e,"write to private field"),e.set(i,t),t),ao;n.UUIButtonElement=class extends Ue(we("",Dc(f))){constructor(){super(),this.type="button",this.disabled=!1,this.look="default",this.color="default",this.compact=!1,this.state=void 0,Uh(this,ao),this.addEventListener("click",this._onHostClick)}getFormElement(){return this._button}async focus(){await this.updateComplete,this._button.focus()}async blur(){await this.updateComplete,this._button.blur()}async click(){await this.updateComplete,this._button.click()}_onHostClick(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}if(this._internals?.form)switch(this.type){case"reset":this._internals.form.reset();break;case"button":break;default:this._internals.form.requestSubmit?this._internals.form.requestSubmit():this._internals.form.dispatchEvent(new SubmitEvent("submit"));break}this._togglePopover()}updated(e){super.updated(e),e.has("state")&&(clearTimeout(wh(this,ao)),(this.state==="success"||this.state==="failed")&&_h(this,ao,setTimeout(()=>this.state=void 0,2e3)))}renderState(){let e;switch(this.state){case"waiting":k(this,"uui-loader-circle"),e=u`<uui-loader-circle id="loader"></uui-loader-circle>`;break;case"success":k(this,"uui-icon"),e=u`<uui-icon name="check" .fallback="${so.strings[0]}"></uui-icon>`;break;case"failed":k(this,"uui-icon"),e=u`<uui-icon name="wrong" .fallback="${gh.strings[0]}"></uui-icon>`;break;default:return x}return u`<div id="state">${e}</div>`}render(){return this.href?u`<a id="button" aria-label="${$(this.label)}" href="${$(this.disabled?void 0:this.href)}" target="${$(this.target||void 0)}" rel="${$(this.rel||$(this.target==="_blank"?"noopener noreferrer":void 0))}">${this.renderState()} ${this.renderLabel()}<slot name="extra"></slot></a>`:u`<button id="button" ?disabled="${this.disabled}" aria-label="${$(this.label)}">${this.renderState()} ${this.renderLabel()}<slot name="extra"></slot></button>`}},ao=new WeakMap,n.UUIButtonElement.styles=[io,g`:host{position:relative;display:inline-flex;margin-left:calc(var(--uui-button-merge-border-left,0) * -1px);--uui-button-padding-left-factor:3;--uui-button-padding-right-factor:3;--uui-button-padding-top-factor:1;--uui-button-padding-bottom-factor:1;min-height:var(--uui-button-height,var(--uui-size-11,33px));max-height:100%;cursor:pointer;text-align:center;font-size:var(--uui-button-font-size,inherit);font-weight:var(--uui-button-font-weight,500);transition:background-color 80ms,border-color 80ms,color 80ms}:host([compact]){--uui-button-padding-left-factor:1;--uui-button-padding-right-factor:1;--uui-button-padding-top-factor:0;--uui-button-padding-bottom-factor:0}.label{line-height:normal;transition:opacity 120ms;display:flex;gap:var(--uui-size-1,3px);align-items:center}:host([state]:not([state=''])) .label{opacity:0}#state{position:absolute;opacity:0;animation-name:fadeIn;animation-delay:40ms;animation-duration:360ms;animation-fill-mode:forwards;display:flex;justify-content:center;width:100%;height:100%;align-items:center}#button{width:100%;background-color:transparent;color:inherit;font-size:inherit;border-radius:inherit;font-family:inherit;font-weight:inherit;text-align:inherit;border:none;cursor:inherit;display:inline-flex;align-items:center;justify-content:var(--uui-button-content-align,center);text-decoration:none;color:currentColor;line-height:inherit;border-width:var(--uui-button-border-width,1px);border-style:solid;border-radius:var(--uui-button-border-radius,var(--uui-border-radius,3px));cursor:pointer;padding:calc(var(--uui-size-2,6px) * var(--uui-button-padding-top-factor)) calc(var(--uui-size-2,6px) * var(--uui-button-padding-right-factor)) calc(var(--uui-size-2,6px) * var(--uui-button-padding-bottom-factor)) calc(var(--uui-size-2,6px) * var(--uui-button-padding-left-factor));box-shadow:none;transition:var(--uui-button-transition,none)}#button:focus-visible{outline:2px solid var(--color-emphasis)}a:not([href]):active,button[disabled]:active{animation:${oo}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}#icon-check,#icon-wrong{display:grid;place-items:center;width:1.5em}#loader{font-size:1.5em}:host([look]:not([look=''])) #loader{color:inherit}:host(:not([color]):not([look=primary])),:host([color='']:not([look=primary])),:host([color=default]:not([look=primary])){--uui-button-contrast-hover:var(--uui-color-default-emphasis,#3544b1)}:host([color=warning][look=outline]) #button,:host([color=warning][look=placeholder]) #button{--uui-button-contrast-hover:var(--color-standalone)}#button{--color:var(--uui-color-default,#1b264f);--color-standalone:var(--uui-color-default-standalone,rgb(
|
|
320
|
+
*/const $=i=>i??x;let ro=class extends z{constructor(e,t={}){super(e,{bubbles:!0,composed:!0,...t})}};ro.CLICK="click";var oh=Object.defineProperty,rh=Object.getOwnPropertyDescriptor,Ws=i=>{throw TypeError(i)},ut=(i,e,t,r)=>{for(var o=r>1?void 0:r?rh(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&oh(e,t,o),o},nh=(i,e,t)=>e.has(i)||Ws("Cannot "+t),sh=(i,e,t)=>e.has(i)?Ws("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),no=(i,e,t)=>(nh(i,e,"access private method"),t),Ot,Ar,qs,Ks;n.UUIButtonInlineCreateElement=class extends f{constructor(){super(...arguments),sh(this,Ot),this._position=0,this.vertical=!1}_onMouseMove(e){this._position=(this.vertical?e.offsetY:e.offsetX)-5}_handleClick(e){e.preventDefault(),e.stopImmediatePropagation(),e.target?.blur?.(),this.dispatchEvent(new ro(ro.CLICK))}render(){return this.href?no(this,Ot,qs).call(this):no(this,Ot,Ks).call(this)}},Ot=new WeakSet,Ar=function(){return u`<div id="plus" style="${Ae({left:this.vertical?"":this._position+"px",top:this.vertical?this._position+"px":""})}"><svg id="plus-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path d="M420.592 214.291H296.104V89.804h-83.102v124.487H88.518v83.104h124.484v124.488h83.102V297.395h124.488z"/></svg></div>`},qs=function(){return u`<a id="button-wrapper" @mousemove="${this._onMouseMove}" href="${$(this.href)}" target="${$(this.target||void 0)}" rel="${$(this.rel||$(this.target==="_blank"?"noopener noreferrer":void 0))}" aria-label="${this.label?this.label:"create new element"}">${no(this,Ot,Ar).call(this)}</a>`},Ks=function(){return u`<button id="button-wrapper" @mousemove="${this._onMouseMove}" @click="${this._handleClick}" aria-label="${this.label?this.label:"create new element"}">${no(this,Ot,Ar).call(this)}</button>`},n.UUIButtonInlineCreateElement.styles=[Jc,g`:host{display:flex;position:relative;z-index:1}:host(:not([vertical])){height:20px;width:100%;margin:-10px 0}:host([vertical]){height:100%;width:20px;margin:0 -10px}#button-wrapper{display:flex;justify-content:center;align-items:center;position:absolute;z-index:1;outline:0;transition:opacity .24s;display:inline-flex;width:100%;border:none;height:100%;padding:0;text-decoration:none;background:0 0;color:currentColor;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;opacity:0}:host(:focus) #button-wrapper,:host(:focus-within) #button-wrapper,:host(:hover) #button-wrapper{opacity:1}:host(:focus) #button-wrapper:before,:host(:focus-within) #button-wrapper:before,:host(:hover) #button-wrapper:before{animation:${eh};background-color:var(--uui-color-interactive-emphasis,#3544b1);border-color:var(--uui-color-surface,#fff)!important}#button-wrapper:before{content:'';position:absolute;right:0;left:0;height:2px;background-color:transparent;border-top:1px solid transparent;border-bottom:1px solid transparent;border-radius:2px;pointer-events:none;transition:background-color 720ms ease-out,border-color 240ms}:host(:not([vertical])) #button-wrapper:before{top:50%;transform:translateY(-50%)}:host([vertical]) #button-wrapper:before{height:100%;width:2px;left:50%;transform:translateX(-50%);border-top:none;border-bottom:none;border-left:1px solid transparent;border-right:1px solid transparent}:host(:not([vertical]):not(:hover)) #plus:not(:focus){left:calc(50% - 2px)!important}:host([vertical]:not(:hover)) #plus:not(:focus){top:calc(50% - 2px)!important}#plus{position:absolute;display:flex;justify-content:center;align-items:center;pointer-events:none;box-sizing:border-box;width:28px;height:28px;border-radius:3em;font-size:14px;border:2px solid var(--uui-color-interactive-emphasis,#3544b1);color:var(--uui-color-interactive-emphasis,#3544b1);background-color:var(--uui-color-surface,#fff);opacity:0;transform:scale(0);transition:transform 240ms ease-in,opacity 240ms,left .1s linear 150ms,top .1s linear 150ms}:host(:focus) #plus,:host(:focus-within) #plus,:host(:hover) #plus{opacity:1;transform:scale(1);transition:transform 240ms cubic-bezier(.175,.885,.32,1.275),opacity 80ms,box-shadow 240ms cubic-bezier(.175,.885,.32,1.275);box-shadow:0 0 0 2px var(--uui-color-surface,#fff)}:host(:not([vertical])) #plus{margin-left:-18px}:host([vertical]) #plus{left:-4px;margin-top:-18px}#button-wrapper:focus #plus{border:2px solid var(--uui-color-focus,#3879ff);color:var(--uui-color-focus,#3879ff)}#plus-icon{width:50%;fill:currentColor}#button-wrapper:active #plus{transform:scale(1.1)}`],ut([U()],n.UUIButtonInlineCreateElement.prototype,"_position",2),ut([l({type:String})],n.UUIButtonInlineCreateElement.prototype,"label",2),ut([l({type:Boolean,reflect:!0})],n.UUIButtonInlineCreateElement.prototype,"vertical",2),ut([l({type:String})],n.UUIButtonInlineCreateElement.prototype,"href",2),ut([l({type:String})],n.UUIButtonInlineCreateElement.prototype,"target",2),ut([l({type:String})],n.UUIButtonInlineCreateElement.prototype,"rel",2),n.UUIButtonInlineCreateElement=ut([v("uui-button-inline-create")],n.UUIButtonInlineCreateElement);let ah=class{constructor(e,t){this._callback=e,this._timerId=null,this._remaining=null,this._onComplete=()=>{this._remaining=null,this._callback()},this.setDuration(t)}setDuration(e){this._duration=e,this._timerId!==null&&this.restart()}start(){this._timerId===null&&this.resume()}restart(){this._remaining=this._duration,this.resume()}pause(){this._timerId!==null&&(window.clearTimeout(this._timerId),this._timerId=null,this._remaining!==null&&(this._remaining-=Date.now()-this._startTime))}resume(){this._timerId!==null&&window.clearTimeout(this._timerId),this._remaining===null&&(this._remaining=this._duration),this._startTime=Date.now(),this._timerId=window.setTimeout(this._onComplete,this._remaining)}destroy(){this.pause()}};const k=(i,e,t=`This element has to be present for ${i.nodeName} to work appropriate.`)=>{customElements.get(e)||console.warn(`%c ${i.nodeName} requires ${e} element to be registered!`,"font-weight: bold;",t,i)},Xs=(i,e)=>{function t(o){const s=i.getBoundingClientRect(),a=i.ownerDocument.defaultView,c=s.left+a.scrollX,h=s.top+a.scrollY;let d;if("TouchEvent"in window&&o instanceof TouchEvent)d=o.touches[0];else if(o instanceof MouseEvent)d=o;else return;const b=d.pageX-c,p=d.pageY-h;e?.onMove&&e.onMove(b,p)}function r(){document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r),e?.onStop&&e.onStop()}document.addEventListener("pointermove",t,{passive:!0}),document.addEventListener("pointerup",r),e?.initialEvent&&t(e.initialEvent)},O=(i,e,t)=>Math.min(Math.max(i,e),t),Ys=(i,e,t)=>t+e-i,lh=(i,e,t)=>{let r=i;for(;r!==null;){const o=r instanceof HTMLElement&&r.hasAttribute(e)&&r.getAttribute(e)===t,s=r.querySelector(`[${e}="${t}"]`)!==null;if(o)return r;if(s)return r.querySelector(`[${e}="${t}"]`);r=r.parentElement||r.parentNode||r.host||null}return null};function uh(i){return i?i.assignedNodes({flatten:!0}).length>0:!1}y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="M12 5v14"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"/><path d="M12 9v4"/><path d="M12 17h.01"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="4" rx="2" ry="2"/><line x1="16" x2="16" y1="2" y2="6"/><line x1="8" x2="8" y1="2" y2="6"/><line x1="3" x2="21" y1="10" y2="10"/><path d="M8 14h.01"/><path d="M12 14h.01"/><path d="M16 14h.01"/><path d="M8 18h.01"/><path d="M12 18h.01"/><path d="M16 18h.01"/></svg>`;const so=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="8" height="4" x="8" y="2" rx="1" ry="1"/><path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="m2 22 1-1h3l9-9"/><path d="M3 21v-3l9-9"/><path d="m15 6 3.4-3.4a2.1 2.1 0 1 1 3 3L18 9l.4.4a2.1 2.1 0 1 1-3 3l-3.8-3.8a2.1 2.1 0 1 1 3-3l.4.4Z"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M15.5 2H8.6c-.4 0-.8.2-1.1.5-.3.3-.5.7-.5 1.1v12.8c0 .4.2.8.5 1.1.3.3.7.5 1.1.5h9.8c.4 0 .8-.2 1.1-.5.3-.3.5-.7.5-1.1V6.5L15.5 2z"/><path d="M3 7.6v12.8c0 .4.2.8.5 1.1.3.3.7.5 1.1.5h9.8"/><path d="M15 2v5h5"/></svg>`;const ch=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M3 6h18"/><path d="M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6"/><path d="M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2"/><line x1="10" x2="10" y1="11" y2="17"/><line x1="14" x2="14" y1="11" y2="17"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"/><polyline points="14 2 14 8 20 8"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"/><polyline points="7 10 12 15 17 10"/><line x1="12" x2="12" y1="15" y2="3"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z"/><path d="m15 5 4 4"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"/><path d="M2 10h20"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polygon points="7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="M12 16v-4"/><path d="M12 8h.01"/></svg>`,y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"/><path d="M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"/></svg>`;const hh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 10 0v4"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="4" height="16" x="6" y="4"/><rect width="4" height="16" x="14" y="4"/></svg>`;const dh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="18" x="3" y="3" rx="2" ry="2"/><circle cx="9" cy="9" r="2"/><path d="m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><polygon points="5 3 19 12 5 21 5 3"/></svg>`;const zr=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>`;const ph=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z"/><circle cx="12" cy="12" r="3"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/><circle cx="12" cy="12" r="3"/></svg>`;const mh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/></svg>`;const bh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><rect width="18" height="11" x="3" y="11" rx="2" ry="2"/><path d="M7 11V7a5 5 0 0 1 9.9-1"/></svg>`,vh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M9.88 9.88a3 3 0 1 0 4.24 4.24"/><path d="M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68"/><path d="M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61"/><line x1="2" x2="22" y1="2" y2="22"/></svg>`;y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><path d="M15 4V2"/><path d="M15 16v-2"/><path d="M8 9h2"/><path d="M20 9h2"/><path d="M17.8 11.8 19 13"/><path d="M15 9h0"/><path d="M17.8 6.2 19 5"/><path d="m3 21 9-9"/><path d="M12.2 6.2 11 5"/></svg>`;const gh=y`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><path d="m15 9-6 6"/><path d="m9 9 6 6"/></svg>`;var fh=Object.defineProperty,yh=Object.getOwnPropertyDescriptor,Zs=i=>{throw TypeError(i)},ve=(i,e,t,r)=>{for(var o=r>1?void 0:r?yh(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&fh(e,t,o),o},Qs=(i,e,t)=>e.has(i)||Zs("Cannot "+t),wh=(i,e,t)=>(Qs(i,e,"read from private field"),e.get(i)),Uh=(i,e,t)=>e.has(i)?Zs("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(i):e.set(i,t),_h=(i,e,t,r)=>(Qs(i,e,"write to private field"),e.set(i,t),t),ao;n.UUIButtonElement=class extends Ue(we("",Dc(f))){constructor(){super(),this.type="button",this.disabled=!1,this.look="default",this.color="default",this.compact=!1,this.state=void 0,Uh(this,ao),this.addEventListener("click",this._onHostClick)}getFormElement(){return this._button}async focus(){await this.updateComplete,this._button.focus()}async blur(){await this.updateComplete,this._button.blur()}async click(){await this.updateComplete,this._button.click()}_onHostClick(e){if(this.disabled){e.preventDefault(),e.stopImmediatePropagation();return}if(this._internals?.form)switch(this.type){case"reset":this._internals.form.reset();break;case"button":break;default:this._internals.form.requestSubmit?this._internals.form.requestSubmit():this._internals.form.dispatchEvent(new SubmitEvent("submit"));break}this._togglePopover()}updated(e){super.updated(e),e.has("state")&&(clearTimeout(wh(this,ao)),(this.state==="success"||this.state==="failed")&&_h(this,ao,setTimeout(()=>this.state=void 0,2e3)))}renderState(){let e;switch(this.state){case"waiting":k(this,"uui-loader-circle"),e=u`<uui-loader-circle id="loader"></uui-loader-circle>`;break;case"success":k(this,"uui-icon"),e=u`<uui-icon name="check" .fallback="${so.strings[0]}"></uui-icon>`;break;case"failed":k(this,"uui-icon"),e=u`<uui-icon name="wrong" .fallback="${gh.strings[0]}"></uui-icon>`;break;default:return x}return u`<div id="state">${e}</div>`}render(){return this.href?u`<a id="button" aria-label="${$(this.label)}" href="${$(this.disabled?void 0:this.href)}" target="${$(this.target||void 0)}" rel="${$(this.rel||$(this.target==="_blank"?"noopener noreferrer":void 0))}">${this.renderState()} ${this.renderLabel()}<slot name="extra"></slot></a>`:u`<button id="button" ?disabled="${this.disabled}" aria-label="${$(this.label)}">${this.renderState()} ${this.renderLabel()}<slot name="extra"></slot></button>`}},ao=new WeakMap,n.UUIButtonElement.styles=[io,g`:host{position:relative;display:inline-flex;margin-left:calc(var(--uui-button-merge-border-left,0) * -1px);--uui-button-padding-left-factor:3;--uui-button-padding-right-factor:3;--uui-button-padding-top-factor:1;--uui-button-padding-bottom-factor:1;min-height:var(--uui-button-height,var(--uui-size-11,33px));max-height:100%;cursor:pointer;text-align:center;font-size:var(--uui-button-font-size,inherit);font-weight:var(--uui-button-font-weight,500);transition:background-color 80ms,border-color 80ms,color 80ms}:host([compact]){--uui-button-padding-left-factor:1;--uui-button-padding-right-factor:1;--uui-button-padding-top-factor:0;--uui-button-padding-bottom-factor:0}.label{line-height:1;transition:opacity 120ms;display:flex;gap:var(--uui-size-1,3px);align-items:center}:host([state]:not([state=''])) .label{opacity:0}#state{position:absolute;opacity:0;animation-name:fadeIn;animation-delay:40ms;animation-duration:360ms;animation-fill-mode:forwards;display:flex;justify-content:center;width:100%;height:100%;align-items:center}#button{width:100%;background-color:transparent;color:inherit;font-size:inherit;border-radius:inherit;font-family:inherit;font-weight:inherit;text-align:inherit;border:none;cursor:inherit;display:inline-flex;align-items:center;justify-content:var(--uui-button-content-align,center);text-decoration:none;color:currentColor;line-height:inherit;border-width:var(--uui-button-border-width,1px);border-style:solid;border-radius:var(--uui-button-border-radius,var(--uui-border-radius,3px));cursor:pointer;padding:calc(var(--uui-size-2,6px) * var(--uui-button-padding-top-factor)) calc(var(--uui-size-2,6px) * var(--uui-button-padding-right-factor)) calc(var(--uui-size-2,6px) * var(--uui-button-padding-bottom-factor)) calc(var(--uui-size-2,6px) * var(--uui-button-padding-left-factor));box-shadow:none;transition:var(--uui-button-transition,none)}#button:focus-visible{outline:2px solid var(--color-emphasis)}a:not([href]):active,button[disabled]:active{animation:${oo}}@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}@keyframes fadeOut{0%{opacity:1}100%{opacity:0}}#icon-check,#icon-wrong{display:grid;place-items:center;width:1.5em}#loader{font-size:1.5em}:host([look]:not([look=''])) #loader{color:inherit}:host(:not([color]):not([look=primary])),:host([color='']:not([look=primary])),:host([color=default]:not([look=primary])){--uui-button-contrast-hover:var(--uui-color-default-emphasis,#3544b1)}:host([color=warning][look=outline]) #button,:host([color=warning][look=placeholder]) #button{--uui-button-contrast-hover:var(--color-standalone)}#button{--color:var(--uui-color-default,#1b264f);--color-standalone:var(--uui-color-default-standalone,rgb(
|
|
313
321
|
28,
|
|
314
322
|
35,
|
|
315
323
|
59
|
|
@@ -364,7 +372,7 @@
|
|
|
364
372
|
* @license
|
|
365
373
|
* Copyright 2020 Google LLC
|
|
366
374
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
367
|
-
*/const nd=Lt(class extends Mt{constructor(i){if(super(i),i.type!==be.PROPERTY&&i.type!==be.ATTRIBUTE&&i.type!==be.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ia(i))throw Error("`live` bindings can only contain a single expression")}render(i){return i}update(i,[e]){if(e===ie||e===x)return e;const t=i.element,r=i.name;if(i.type===be.PROPERTY){if(e===t[r])return ie}else if(i.type===be.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(r))return ie}else if(i.type===be.ATTRIBUTE&&t.getAttribute(r)===e+"")return ie;return Sa(i),e}});var sd={grad:.9,turn:360,rad:360/(2*Math.PI)},Le=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},G=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*i)/t+0},pe=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),i>t?t:i>e?i:e},Pa=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},Aa=function(i){return{r:pe(i.r,0,255),g:pe(i.g,0,255),b:pe(i.b,0,255),a:pe(i.a)}},Gr=function(i){return{r:G(i.r),g:G(i.g),b:G(i.b),a:G(i.a,3)}},ad=/^#([0-9a-f]{3,8})$/i,go=function(i){var e=i.toString(16);return e.length<2?"0"+e:e},za=function(i){var e=i.r,t=i.g,r=i.b,o=i.a,s=Math.max(e,t,r),a=s-Math.min(e,t,r),c=a?s===e?(t-r)/a:s===t?2+(r-e)/a:4+(e-t)/a:0;return{h:60*(c<0?c+6:c),s:s?a/s*100:0,v:s/255*100,a:o}},La=function(i){var e=i.h,t=i.s,r=i.v,o=i.a;e=e/360*6,t/=100,r/=100;var s=Math.floor(e),a=r*(1-t),c=r*(1-(e-s)*t),h=r*(1-(1-e+s)*t),d=s%6;return{r:255*[r,c,a,a,h,r][d],g:255*[h,r,r,c,a,a][d],b:255*[a,a,h,r,r,c][d],a:o}},Ma=function(i){return{h:Pa(i.h),s:pe(i.s,0,100),l:pe(i.l,0,100),a:pe(i.a)}},Oa=function(i){return{h:G(i.h),s:G(i.s),l:G(i.l),a:G(i.a,3)}},Ta=function(i){return La((t=(e=i).s,{h:e.h,s:(t*=((r=e.l)<50?r:100-r)/100)>0?2*t/(r+t)*100:0,v:r+t,a:e.a}));var e,t,r},xi=function(i){return{h:(e=za(i)).h,s:(o=(200-(t=e.s))*(r=e.v)/100)>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:e.a};var e,t,r,o},ld=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ud=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Wr={string:[[function(i){var e=ad.exec(i);return e?(i=e[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?G(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?G(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var e=cd.exec(i)||hd.exec(i);return e?e[2]!==e[4]||e[4]!==e[6]?null:Aa({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(i){var e=ld.exec(i)||ud.exec(i);if(!e)return null;var t,r,o=Ma({h:(t=e[1],r=e[2],r===void 0&&(r="deg"),Number(t)*(sd[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return Ta(o)},"hsl"]],object:[[function(i){var e=i.r,t=i.g,r=i.b,o=i.a,s=o===void 0?1:o;return Le(e)&&Le(t)&&Le(r)?Aa({r:Number(e),g:Number(t),b:Number(r),a:Number(s)}):null},"rgb"],[function(i){var e=i.h,t=i.s,r=i.l,o=i.a,s=o===void 0?1:o;if(!Le(e)||!Le(t)||!Le(r))return null;var a=Ma({h:Number(e),s:Number(t),l:Number(r),a:Number(s)});return Ta(a)},"hsl"],[function(i){var e=i.h,t=i.s,r=i.v,o=i.a,s=o===void 0?1:o;if(!Le(e)||!Le(t)||!Le(r))return null;var a=function(c){return{h:Pa(c.h),s:pe(c.s,0,100),v:pe(c.v,0,100),a:pe(c.a)}}({h:Number(e),s:Number(t),v:Number(r),a:Number(s)});return La(a)},"hsv"]]},Na=function(i,e){for(var t=0;t<e.length;t++){var r=e[t][0](i);if(r)return[r,e[t][1]]}return[null,void 0]},dd=function(i){return typeof i=="string"?Na(i.trim(),Wr.string):typeof i=="object"&&i!==null?Na(i,Wr.object):[null,void 0]},qr=function(i,e){var t=xi(i);return{h:t.h,s:pe(t.s+100*e,0,100),l:t.l,a:t.a}},Kr=function(i){return(299*i.r+587*i.g+114*i.b)/1e3/255},Ba=function(i,e){var t=xi(i);return{h:t.h,s:t.s,l:pe(t.l+100*e,0,100),a:t.a}},fo=function(){function i(e){this.parsed=dd(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return i.prototype.isValid=function(){return this.parsed!==null},i.prototype.brightness=function(){return G(Kr(this.rgba),2)},i.prototype.isDark=function(){return Kr(this.rgba)<.5},i.prototype.isLight=function(){return Kr(this.rgba)>=.5},i.prototype.toHex=function(){return e=Gr(this.rgba),t=e.r,r=e.g,o=e.b,a=(s=e.a)<1?go(G(255*s)):"","#"+go(t)+go(r)+go(o)+a;var e,t,r,o,s,a},i.prototype.toRgb=function(){return Gr(this.rgba)},i.prototype.toRgbString=function(){return e=Gr(this.rgba),t=e.r,r=e.g,o=e.b,(s=e.a)<1?"rgba("+t+", "+r+", "+o+", "+s+")":"rgb("+t+", "+r+", "+o+")";var e,t,r,o,s},i.prototype.toHsl=function(){return Oa(xi(this.rgba))},i.prototype.toHslString=function(){return e=Oa(xi(this.rgba)),t=e.h,r=e.s,o=e.l,(s=e.a)<1?"hsla("+t+", "+r+"%, "+o+"%, "+s+")":"hsl("+t+", "+r+"%, "+o+"%)";var e,t,r,o,s},i.prototype.toHsv=function(){return e=za(this.rgba),{h:G(e.h),s:G(e.s),v:G(e.v),a:G(e.a,3)};var e},i.prototype.invert=function(){return ge({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},i.prototype.saturate=function(e){return e===void 0&&(e=.1),ge(qr(this.rgba,e))},i.prototype.desaturate=function(e){return e===void 0&&(e=.1),ge(qr(this.rgba,-e))},i.prototype.grayscale=function(){return ge(qr(this.rgba,-1))},i.prototype.lighten=function(e){return e===void 0&&(e=.1),ge(Ba(this.rgba,e))},i.prototype.darken=function(e){return e===void 0&&(e=.1),ge(Ba(this.rgba,-e))},i.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},i.prototype.alpha=function(e){return typeof e=="number"?ge({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):G(this.rgba.a,3);var t},i.prototype.hue=function(e){var t=xi(this.rgba);return typeof e=="number"?ge({h:e,s:t.s,l:t.l,a:t.a}):G(t.h)},i.prototype.isEqual=function(e){return this.toHex()===ge(e).toHex()},i}(),ge=function(i){return i instanceof fo?i:new fo(i)},Da=[],pd=function(i){i.forEach(function(e){Da.indexOf(e)<0&&(e(fo,Wr),Da.push(e))})};function md(i,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in t)r[t[o]]=o;var s={};i.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var c,h,d=r[this.toHex()];if(d)return d;if(a?.closest){var b=this.toRgb(),p=1/0,_="black";if(!s.length)for(var m in t)s[m]=new i(t[m]).toRgb();for(var w in t){var S=(c=b,h=s[w],Math.pow(c.r-h.r,2)+Math.pow(c.g-h.g,2)+Math.pow(c.b-h.b,2));S<p&&(p=S,_=w)}return _}},e.string.push([function(a){var c=a.toLowerCase(),h=c==="transparent"?"#0000":t[c];return h?new i(h).toRgb():null},"name"])}let jt=class extends z{constructor(e,t={}){super(e,{bubbles:!0,...t})}};jt.CHANGE="change";var bd=Object.defineProperty,vd=Object.getOwnPropertyDescriptor,j=(i,e,t,r)=>{for(var o=r>1?void 0:r?vd(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&bd(e,t,o),o};pd([md]);const Va="EyeDropper"in window;n.UUIColorPickerElement=class extends we("label",f){constructor(){super(...arguments),this._value="",this.inputValue="",this.hue=0,this.saturation=0,this.lightness=0,this.alpha=100,this._colord=ge("hsl(0, 0%, 0%)"),this.format="hex",this.name="",this.size="medium",this.noFormatToggle=!1,this.inline=!1,this.disabled=!1,this.opacity=!1,this.readonly=!1,this.uppercase=!1,this.swatches=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000","#444","#888","#ccc","#fff"]}set value(e){this.value!==e&&this.setColor(e),this._value=e}get value(){return this._value}connectedCallback(){super.connectedCallback(),k(this,"uui-icon"),k(this,"uui-icon-registry-essential"),k(this,"uui-input"),k(this,"uui-button"),k(this,"uui-button-group"),k(this,"uui-color-swatches"),k(this,"uui-color-swatch"),k(this,"uui-color-area"),k(this,"uui-color-slider"),k(this,"uui-popover-container")}getFormattedValue(e){const t=this.opacity?`${e}a`:e,r=this._colord.toHex(),o=r.length>7?r.substring(0,r.length-2):r,{r:s,g:a,b:c}=this._colord.toRgb(),{h,s:d,l:b}=this._colord.toHsl(),{v:p}=this._colord.toHsv(),_=this._colord.alpha();switch(t){case"hex":return this.setLetterCase(o);case"hexa":return this.setLetterCase(r);case"rgb":return this.setLetterCase(`rgb(${s}, ${a}, ${c})`);case"rgba":return this.setLetterCase(this._colord.toRgbString());case"hsl":return this.setLetterCase(`hsl(${h}, ${d}%, ${b}%)`);case"hsla":return this.setLetterCase(this._colord.toHslString());case"hsv":return this.setLetterCase(`hsv(${h}, ${d}%, ${b}%)`);case"hsva":return this.setLetterCase(`hsva(${h}, ${d}%, ${p}%, ${_})`);default:return""}}getBrightness(e){return O(-1*(200*e/(this.saturation-200)),0,100)}getLightness(e){return O((200-this.saturation)*e/100*5/10,0,100)}handleFormatToggle(){const e=["hex","rgb","hsl","hsv"],t=(e.indexOf(this.format)+1)%e.length;this.format=e[t],this._syncValues()}handleAlphaChange(e){e.stopPropagation(),this._swatches?.resetSelection();const t=e.target,r={h:this.hue,s:this.saturation,l:this.lightness,a:Math.round(t.value)/100};this.setColor(r)}handleHueChange(e){e.stopPropagation(),this._swatches?.resetSelection();const t={h:e.target.value,s:this.saturation,l:this.lightness,a:this.alpha/100};this.setColor(t)}handleGridChange(e){e.stopPropagation(),this._swatches?.resetSelection();const t=e.target,r={h:this.hue,s:t.saturation,l:t.lightness,a:this.alpha/100};this.setColor(r)}handleInputChange(e){e.stopImmediatePropagation(),this._swatches?.resetSelection(),this.inputValue=this._input.value,this.setColor(this.inputValue)}handleInputKeyDown(e){e.stopImmediatePropagation(),e.key==="Enter"&&(this._swatches?.resetSelection(),this.inputValue=this._input.value,this.setColor(this.inputValue),setTimeout(()=>this._input.select()))}handleColorSwatchChange(e){e.stopImmediatePropagation();const t=e.target;this.setColor(t.value)}handleCopy(){navigator.clipboard.writeText(this._input.value).then(()=>{this._previewButton.classList.add("color-picker__preview-color--copied"),this._previewButton.addEventListener("animationend",()=>{this._previewButton.classList.remove("color-picker__preview-color--copied")})})}handleEyeDropper(){Va&&new EyeDropper().open().then(e=>this.setColor(e.sRGBHex)).catch(()=>{})}setColor(e){if(e===this.value)return;if(!e)return this.alpha=100,this.inputValue="",this._value=e,this.dispatchEvent(new jt(jt.CHANGE)),!0;const t=new fo(e),{h:r,s:o,l:s,a}=t.toHsl();this.hue=r,this.saturation=o,this.lightness=s,this.alpha=this.opacity?a*100:100;const c=e;return c&&c.h&&(this.hue=c.h),this._colord=t,this._syncValues(),this.dispatchEvent(new jt(jt.CHANGE)),!0}setLetterCase(e){return typeof e!="string"?"":this.uppercase?e.toUpperCase():e.toLowerCase()}getHexString(e,t,r,o=100){const s=ge(`hsla(${e}, ${t}%, ${r}%, ${o/100})`);return s.isValid()?s.toHex():""}_syncValues(){this.inputValue=this.getFormattedValue(this.format),this._value=this.inputValue}_renderColorPicker(){return u`<div class="${Vr({"color-picker":!0,"color-picker--inline":this.inline,"color-picker--disabled":this.disabled})}" aria-disabled="${this.disabled?"true":"false"}"><uui-color-area .value="${this.value}" .hue="${Math.round(this.hue)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" @change="${this.handleGridChange}"></uui-color-area><div class="color-picker__controls"><div class="color-picker__sliders"><uui-color-slider label="hue" class="hue-slider" .value="${Math.round(this.hue)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" @change="${this.handleHueChange}"></uui-color-slider>${this.opacity?u`<uui-color-slider label="alpha" class="opacity-slider" .value="${Math.round(this.alpha)}" type="opacity" .color="${this.getHexString(this.hue,this.saturation,this.lightness)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" @change="${this.handleAlphaChange}"></uui-color-slider>`:""}</div><button type="button" part="preview" class="color-picker__preview color-picker__transparent-bg" title="Copy" aria-label="Copy" style="${Ae({"--preview-color":`hsla(${this.hue}deg, ${this.saturation}%, ${this.lightness}%, ${this.alpha/100})`})}" @click="${this.handleCopy}"></button></div><div class="color-picker__user-input" aria-live="polite"><uui-input label="label" type="text" part="input" name="${this.name}" autocomplete="off" autocapitalize="off" spellcheck="false" .value="${nd(this.inputValue)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" @keydown="${this.handleInputKeyDown}" @change="${this.handleInputChange}"></uui-input><uui-button-group>${this.noFormatToggle?"":u`<uui-button label="Toggle color format" @click="${this.handleFormatToggle}" class="color-picker__toggle-format" ?disabled="${this.disabled}" compact="compact"><span>${this.format}</span></uui-button>`} ${Va?u`<uui-button label="Select a color" ?disabled="${this.disabled||this.readonly}" @click="${this.handleEyeDropper}" compact="compact"><uui-icon-registry-essential><uui-icon name="colorpicker"></uui-icon></uui-icon-registry-essential></uui-button>`:""}</uui-button-group></div>${this._renderSwatches()}</div>`}_renderSwatches(){return this.swatches?u`<uui-color-swatches id="swatches" class="color-picker__swatches" label="Swatches" ?disabled="${this.disabled}" ?readonly="${this.readonly}" @change="${this.handleColorSwatchChange}">${this.swatches.map(e=>u`<uui-color-swatch label="${e}" .value="${e}"></uui-color-swatch>`)}</uui-color-swatches>`:x}_renderPreviewButton(){return u`<button type="button" part="trigger" aria-label="${this.label||"Open Color picker"}" class="${Vr({"color-picker__trigger":!0,"color-dropdown__trigger--disabled":this.disabled,"color-dropdown__trigger--small":this.size==="small","color-dropdown__trigger--medium":this.size==="medium","color-dropdown__trigger--large":this.size==="large","color-picker__transparent-bg":!0})}" style="${Ae({"--preview-color":`hsla(${this.hue}deg, ${this.saturation}%, ${this.lightness}%, ${this.alpha/100})`})}" ?disabled="${this.disabled}" aria-haspopup="true" aria-expanded="false" popovertarget="color-picker-popover"></button><uui-popover-container id="color-picker-popover">${this._renderColorPicker()}</uui-popover-container>`}render(){return this.inline?this._renderColorPicker():this._renderPreviewButton()}},n.UUIColorPickerElement.styles=[g`:host{--uui-look-outline-border:#ddd;--uui-look-outline-border-hover:#aaa;font-size:.8rem;color:var(--uui-color-text,#060606);display:block;width:var(--uui-color-picker-width,280px)}:host>button{cursor:pointer}uui-popover-container{width:inherit}.color-picker{width:100%;background-color:var(--uui-color-surface,#fff);user-select:none;border:solid 1px var(--uui-color-border,#d8d7d9)}.color-picker__user-input{display:flex;padding:0 .75rem .75rem .75rem}.color-picker__user-input uui-button{border:var(--uui-input-border-width,1px) solid var(--uui-input-border-color,var(--uui-color-border,#d8d7d9));border-left:none}.color-picker__preview,.color-picker__trigger{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;position:relative;width:2.25rem;height:2.25rem;border:none;border-radius:50%;background:0 0}.color-picker__preview{cursor:copy;margin-left:.75rem;border-radius:50%}.color-picker__trigger[disabled]{cursor:not-allowed;opacity:.5}.color-picker__preview::before,.color-picker__trigger::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;border-radius:inherit;background-color:var(--preview-color)}.color-dropdown__trigger--empty::before{background-color:transparent}.color-picker__transparent-bg{border:1px solid var(--uui-color-border,#d8d7d9);background-image:linear-gradient(45deg,var(--uui-palette-grey,#c4c4c4) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg,transparent 75%,var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg,var(--uui-palette-grey,#c4c4c4) 25%,transparent 25%);background-size:10px 10px;background-position:0 0,0 0,-5px -5px,5px 5px}.color-picker__preview-color--copied{animation:pulse .75s}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--uui-palette-space-cadet-light,#26356e)}70%{box-shadow:0 0 0 .5rem transparent}100%{box-shadow:0 0 0 0 transparent}}.color-picker__controls{padding:.75rem;display:flex;align-items:center}.color-picker__sliders{flex:1 1 auto}uui-color-slider:not(:last-of-type){margin-bottom:1rem}.color-picker__toggle-format{min-width:45px;--uui-button-font-size:0.8rem}.color-picker__toggle-format>span{text-transform:uppercase}uui-color-swatches{border-top:solid 1px var(--uui-color-border,#d8d7d9);padding:.75rem}button[slot=trigger]{border-radius:50%;cursor:pointer;width:36px;height:36px}uui-input{font-size:.85rem;box-sizing:content-box;flex:1}uui-color-area{width:100%}`],j([A('[part="input"]')],n.UUIColorPickerElement.prototype,"_input",2),j([A(".color-picker__preview")],n.UUIColorPickerElement.prototype,"_previewButton",2),j([A("#swatches")],n.UUIColorPickerElement.prototype,"_swatches",2),j([U()],n.UUIColorPickerElement.prototype,"inputValue",2),j([U()],n.UUIColorPickerElement.prototype,"hue",2),j([U()],n.UUIColorPickerElement.prototype,"saturation",2),j([U()],n.UUIColorPickerElement.prototype,"lightness",2),j([U()],n.UUIColorPickerElement.prototype,"alpha",2),j([U()],n.UUIColorPickerElement.prototype,"_colord",2),j([l()],n.UUIColorPickerElement.prototype,"value",1),j([l()],n.UUIColorPickerElement.prototype,"format",2),j([l()],n.UUIColorPickerElement.prototype,"name",2),j([l()],n.UUIColorPickerElement.prototype,"size",2),j([l({attribute:"no-format-toggle",type:Boolean})],n.UUIColorPickerElement.prototype,"noFormatToggle",2),j([l({type:Boolean,reflect:!0})],n.UUIColorPickerElement.prototype,"inline",2),j([l({type:Boolean,reflect:!0})],n.UUIColorPickerElement.prototype,"disabled",2),j([l({type:Boolean})],n.UUIColorPickerElement.prototype,"opacity",2),j([l({type:Boolean,reflect:!0})],n.UUIColorPickerElement.prototype,"readonly",2),j([l({type:Boolean})],n.UUIColorPickerElement.prototype,"uppercase",2),j([l({attribute:!1})],n.UUIColorPickerElement.prototype,"swatches",2),n.UUIColorPickerElement=j([v("uui-color-picker")],n.UUIColorPickerElement);var gd={grad:.9,turn:360,rad:360/(2*Math.PI)},Me=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},W=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*i)/t+0},me=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),i>t?t:i>e?i:e},ja=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},Ha=function(i){return{r:me(i.r,0,255),g:me(i.g,0,255),b:me(i.b,0,255),a:me(i.a)}},Xr=function(i){return{r:W(i.r),g:W(i.g),b:W(i.b),a:W(i.a,3)}},fd=/^#([0-9a-f]{3,8})$/i,yo=function(i){var e=i.toString(16);return e.length<2?"0"+e:e},Ra=function(i){var e=i.r,t=i.g,r=i.b,o=i.a,s=Math.max(e,t,r),a=s-Math.min(e,t,r),c=a?s===e?(t-r)/a:s===t?2+(r-e)/a:4+(e-t)/a:0;return{h:60*(c<0?c+6:c),s:s?a/s*100:0,v:s/255*100,a:o}},Fa=function(i){var e=i.h,t=i.s,r=i.v,o=i.a;e=e/360*6,t/=100,r/=100;var s=Math.floor(e),a=r*(1-t),c=r*(1-(e-s)*t),h=r*(1-(1-e+s)*t),d=s%6;return{r:255*[r,c,a,a,h,r][d],g:255*[h,r,r,c,a,a][d],b:255*[a,a,h,r,r,c][d],a:o}},Ga=function(i){return{h:ja(i.h),s:me(i.s,0,100),l:me(i.l,0,100),a:me(i.a)}},Wa=function(i){return{h:W(i.h),s:W(i.s),l:W(i.l),a:W(i.a,3)}},qa=function(i){return Fa((t=(e=i).s,{h:e.h,s:(t*=((r=e.l)<50?r:100-r)/100)>0?2*t/(r+t)*100:0,v:r+t,a:e.a}));var e,t,r},Ii=function(i){return{h:(e=Ra(i)).h,s:(o=(200-(t=e.s))*(r=e.v)/100)>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:e.a};var e,t,r,o},yd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ud=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_d=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ka={string:[[function(i){var e=fd.exec(i);return e?(i=e[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?W(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?W(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var e=Ud.exec(i)||_d.exec(i);return e?e[2]!==e[4]||e[4]!==e[6]?null:Ha({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(i){var e=yd.exec(i)||wd.exec(i);if(!e)return null;var t,r,o=Ga({h:(t=e[1],r=e[2],r===void 0&&(r="deg"),Number(t)*(gd[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return qa(o)},"hsl"]],object:[[function(i){var e=i.r,t=i.g,r=i.b,o=i.a,s=o===void 0?1:o;return Me(e)&&Me(t)&&Me(r)?Ha({r:Number(e),g:Number(t),b:Number(r),a:Number(s)}):null},"rgb"],[function(i){var e=i.h,t=i.s,r=i.l,o=i.a,s=o===void 0?1:o;if(!Me(e)||!Me(t)||!Me(r))return null;var a=Ga({h:Number(e),s:Number(t),l:Number(r),a:Number(s)});return qa(a)},"hsl"],[function(i){var e=i.h,t=i.s,r=i.v,o=i.a,s=o===void 0?1:o;if(!Me(e)||!Me(t)||!Me(r))return null;var a=function(c){return{h:ja(c.h),s:me(c.s,0,100),v:me(c.v,0,100),a:me(c.a)}}({h:Number(e),s:Number(t),v:Number(r),a:Number(s)});return Fa(a)},"hsv"]]},Xa=function(i,e){for(var t=0;t<e.length;t++){var r=e[t][0](i);if(r)return[r,e[t][1]]}return[null,void 0]},$d=function(i){return typeof i=="string"?Xa(i.trim(),Ka.string):typeof i=="object"&&i!==null?Xa(i,Ka.object):[null,void 0]},Yr=function(i,e){var t=Ii(i);return{h:t.h,s:me(t.s+100*e,0,100),l:t.l,a:t.a}},Zr=function(i){return(299*i.r+587*i.g+114*i.b)/1e3/255},Ya=function(i,e){var t=Ii(i);return{h:t.h,s:t.s,l:me(t.l+100*e,0,100),a:t.a}},Qr=function(){function i(e){this.parsed=$d(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return i.prototype.isValid=function(){return this.parsed!==null},i.prototype.brightness=function(){return W(Zr(this.rgba),2)},i.prototype.isDark=function(){return Zr(this.rgba)<.5},i.prototype.isLight=function(){return Zr(this.rgba)>=.5},i.prototype.toHex=function(){return e=Xr(this.rgba),t=e.r,r=e.g,o=e.b,a=(s=e.a)<1?yo(W(255*s)):"","#"+yo(t)+yo(r)+yo(o)+a;var e,t,r,o,s,a},i.prototype.toRgb=function(){return Xr(this.rgba)},i.prototype.toRgbString=function(){return e=Xr(this.rgba),t=e.r,r=e.g,o=e.b,(s=e.a)<1?"rgba("+t+", "+r+", "+o+", "+s+")":"rgb("+t+", "+r+", "+o+")";var e,t,r,o,s},i.prototype.toHsl=function(){return Wa(Ii(this.rgba))},i.prototype.toHslString=function(){return e=Wa(Ii(this.rgba)),t=e.h,r=e.s,o=e.l,(s=e.a)<1?"hsla("+t+", "+r+"%, "+o+"%, "+s+")":"hsl("+t+", "+r+"%, "+o+"%)";var e,t,r,o,s},i.prototype.toHsv=function(){return e=Ra(this.rgba),{h:W(e.h),s:W(e.s),v:W(e.v),a:W(e.a,3)};var e},i.prototype.invert=function(){return Oe({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},i.prototype.saturate=function(e){return e===void 0&&(e=.1),Oe(Yr(this.rgba,e))},i.prototype.desaturate=function(e){return e===void 0&&(e=.1),Oe(Yr(this.rgba,-e))},i.prototype.grayscale=function(){return Oe(Yr(this.rgba,-1))},i.prototype.lighten=function(e){return e===void 0&&(e=.1),Oe(Ya(this.rgba,e))},i.prototype.darken=function(e){return e===void 0&&(e=.1),Oe(Ya(this.rgba,-e))},i.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},i.prototype.alpha=function(e){return typeof e=="number"?Oe({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):W(this.rgba.a,3);var t},i.prototype.hue=function(e){var t=Ii(this.rgba);return typeof e=="number"?Oe({h:e,s:t.s,l:t.l,a:t.a}):W(t.h)},i.prototype.isEqual=function(e){return this.toHex()===Oe(e).toHex()},i}(),Oe=function(i){return i instanceof Qr?i:new Qr(i)};let wo=class extends z{constructor(e,t={}){super(e,{bubbles:!0,...t})}};wo.CHANGE="change";var kd=Object.defineProperty,Ed=Object.getOwnPropertyDescriptor,$e=(i,e,t,r)=>{for(var o=r>1?void 0:r?Ed(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&kd(e,t,o),o};n.UUIColorSliderElement=class extends we("label",f){constructor(){super(...arguments),this.type="hue",this.color="",this.min=0,this.max=100,this.precision=1,this.vertical=!1,this.value=0,this.readonly=!1,this.disabled=!1}willUpdate(e){if(e.has("type")&&(this.type==="hue"?this.max=this.max??360:this.type==="saturation"?this.max=this.max??100:this.type==="lightness"?this.max=this.max??100:this.type==="opacity"&&(this.max=this.max??100),this.precision=this.precision??1,this.color)){const t=new Qr(this.color),{h:r,s:o,l:s}=t.toHsl(),a=this.type==="saturation"?`linear-gradient(to ${this.vertical?"top":"right"}, hsl(${r}, 0%, ${s}%), hsl(${r}, 100%, ${s}%))`:this.type==="lightness"?`linear-gradient(to ${this.vertical?"top":"right"}, hsl(${r}, ${o}%, 0%), hsl(${r}, ${o}%, 100%))`:null;this.style.setProperty("--uui-slider-background-image",a)}}firstUpdated(){this.container=this.shadowRoot.querySelector("#color-slider"),this.handle=this.container.querySelector("#color-slider__handle")}handleDrag(e){if(this.disabled||this.readonly||!this.container||!this.handle)return;const{width:t,height:r}=this.container.getBoundingClientRect();this.handle.focus(),e.preventDefault(),Xs(this.container,{onMove:(o,s)=>{this.vertical?this.value=Ys(O(s/r*this.max,this.min,this.max),this.min,this.max):this.value=O(o/t*this.max,this.min,this.max),this.syncValues()},initialEvent:e})}handleClick(e){this.disabled||this.readonly||(this.value=this.getValueFromMousePosition(e),this.syncValues())}handleKeyDown(e){const t=e.shiftKey?10:1;e.key==="ArrowLeft"?(e.preventDefault(),this.value=O(this.value-t,this.min,this.max),this.syncValues()):e.key==="ArrowRight"?(e.preventDefault(),this.value=O(this.value+t,this.min,this.max),this.syncValues()):e.key==="ArrowUp"?(e.preventDefault(),this.value=O(this.value+t,this.min,this.max),this.syncValues()):e.key==="ArrowDown"?(e.preventDefault(),this.value=O(this.value-t,this.min,this.max),this.syncValues()):e.key==="Home"?(e.preventDefault(),this.value=this.min,this.syncValues()):e.key==="End"&&(e.preventDefault(),this.value=this.max,this.syncValues())}getValueFromMousePosition(e){return this.vertical?this.getValueFromYCoordinate(e.clientY):this.getValueFromXCoordinate(e.clientX)}getValueFromTouchPosition(e){return this.vertical?this.getValueFromYCoordinate(e.touches[0].clientY):this.getValueFromXCoordinate(e.touches[0].clientX)}getValueFromXCoordinate(e){const{left:t,width:r}=this.container.getBoundingClientRect();return O(this.roundToPrecision((e-t)/r*this.max),this.min,this.max)}getValueFromYCoordinate(e){const{top:t,height:r}=this.container.getBoundingClientRect();return O(this.roundToPrecision((e-t)/r*this.max),this.min,this.max)}roundToPrecision(e){const t=1/this.precision;return Math.ceil(e*t)/t}syncValues(){this.dispatchEvent(new wo(wo.CHANGE))}get cssPropCurrentValue(){return this.value===0?this.vertical?100:0:100/(this.vertical?this.max/Ys(this.value,this.min,this.max):this.max/this.value)}render(){return u`<div part="slider" id="color-slider" role="slider" aria-label="${this.label}" aria-orientation="${this.vertical?"vertical":"horizontal"}" aria-valuemin="${Math.round(this.min)}" aria-valuemax="${Math.round(this.max)}" aria-valuenow="${Math.round(this.value)}" @click="${this.handleClick}" @mousedown="${this.handleDrag}" @touchstart="${this.handleDrag}" @keydown="${this.handleKeyDown}">${this.type==="opacity"?u`<div id="current-hue" style="${Ae({backgroundImage:`linear-gradient(to ${this.vertical?"top":"right"},
|
|
375
|
+
*/const nd=Lt(class extends Mt{constructor(i){if(super(i),i.type!==be.PROPERTY&&i.type!==be.ATTRIBUTE&&i.type!==be.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Ia(i))throw Error("`live` bindings can only contain a single expression")}render(i){return i}update(i,[e]){if(e===ie||e===x)return e;const t=i.element,r=i.name;if(i.type===be.PROPERTY){if(e===t[r])return ie}else if(i.type===be.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(r))return ie}else if(i.type===be.ATTRIBUTE&&t.getAttribute(r)===e+"")return ie;return Sa(i),e}});var sd={grad:.9,turn:360,rad:360/(2*Math.PI)},Le=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},G=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*i)/t+0},pe=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),i>t?t:i>e?i:e},Pa=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},Aa=function(i){return{r:pe(i.r,0,255),g:pe(i.g,0,255),b:pe(i.b,0,255),a:pe(i.a)}},Gr=function(i){return{r:G(i.r),g:G(i.g),b:G(i.b),a:G(i.a,3)}},ad=/^#([0-9a-f]{3,8})$/i,go=function(i){var e=i.toString(16);return e.length<2?"0"+e:e},za=function(i){var e=i.r,t=i.g,r=i.b,o=i.a,s=Math.max(e,t,r),a=s-Math.min(e,t,r),c=a?s===e?(t-r)/a:s===t?2+(r-e)/a:4+(e-t)/a:0;return{h:60*(c<0?c+6:c),s:s?a/s*100:0,v:s/255*100,a:o}},La=function(i){var e=i.h,t=i.s,r=i.v,o=i.a;e=e/360*6,t/=100,r/=100;var s=Math.floor(e),a=r*(1-t),c=r*(1-(e-s)*t),h=r*(1-(1-e+s)*t),d=s%6;return{r:255*[r,c,a,a,h,r][d],g:255*[h,r,r,c,a,a][d],b:255*[a,a,h,r,r,c][d],a:o}},Ma=function(i){return{h:Pa(i.h),s:pe(i.s,0,100),l:pe(i.l,0,100),a:pe(i.a)}},Oa=function(i){return{h:G(i.h),s:G(i.s),l:G(i.l),a:G(i.a,3)}},Ta=function(i){return La((t=(e=i).s,{h:e.h,s:(t*=((r=e.l)<50?r:100-r)/100)>0?2*t/(r+t)*100:0,v:r+t,a:e.a}));var e,t,r},xi=function(i){return{h:(e=za(i)).h,s:(o=(200-(t=e.s))*(r=e.v)/100)>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:e.a};var e,t,r,o},ld=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,ud=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,cd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Wr={string:[[function(i){var e=ad.exec(i);return e?(i=e[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?G(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?G(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var e=cd.exec(i)||hd.exec(i);return e?e[2]!==e[4]||e[4]!==e[6]?null:Aa({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(i){var e=ld.exec(i)||ud.exec(i);if(!e)return null;var t,r,o=Ma({h:(t=e[1],r=e[2],r===void 0&&(r="deg"),Number(t)*(sd[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return Ta(o)},"hsl"]],object:[[function(i){var e=i.r,t=i.g,r=i.b,o=i.a,s=o===void 0?1:o;return Le(e)&&Le(t)&&Le(r)?Aa({r:Number(e),g:Number(t),b:Number(r),a:Number(s)}):null},"rgb"],[function(i){var e=i.h,t=i.s,r=i.l,o=i.a,s=o===void 0?1:o;if(!Le(e)||!Le(t)||!Le(r))return null;var a=Ma({h:Number(e),s:Number(t),l:Number(r),a:Number(s)});return Ta(a)},"hsl"],[function(i){var e=i.h,t=i.s,r=i.v,o=i.a,s=o===void 0?1:o;if(!Le(e)||!Le(t)||!Le(r))return null;var a=function(c){return{h:Pa(c.h),s:pe(c.s,0,100),v:pe(c.v,0,100),a:pe(c.a)}}({h:Number(e),s:Number(t),v:Number(r),a:Number(s)});return La(a)},"hsv"]]},Na=function(i,e){for(var t=0;t<e.length;t++){var r=e[t][0](i);if(r)return[r,e[t][1]]}return[null,void 0]},dd=function(i){return typeof i=="string"?Na(i.trim(),Wr.string):typeof i=="object"&&i!==null?Na(i,Wr.object):[null,void 0]},qr=function(i,e){var t=xi(i);return{h:t.h,s:pe(t.s+100*e,0,100),l:t.l,a:t.a}},Kr=function(i){return(299*i.r+587*i.g+114*i.b)/1e3/255},Ba=function(i,e){var t=xi(i);return{h:t.h,s:t.s,l:pe(t.l+100*e,0,100),a:t.a}},fo=function(){function i(e){this.parsed=dd(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return i.prototype.isValid=function(){return this.parsed!==null},i.prototype.brightness=function(){return G(Kr(this.rgba),2)},i.prototype.isDark=function(){return Kr(this.rgba)<.5},i.prototype.isLight=function(){return Kr(this.rgba)>=.5},i.prototype.toHex=function(){return e=Gr(this.rgba),t=e.r,r=e.g,o=e.b,a=(s=e.a)<1?go(G(255*s)):"","#"+go(t)+go(r)+go(o)+a;var e,t,r,o,s,a},i.prototype.toRgb=function(){return Gr(this.rgba)},i.prototype.toRgbString=function(){return e=Gr(this.rgba),t=e.r,r=e.g,o=e.b,(s=e.a)<1?"rgba("+t+", "+r+", "+o+", "+s+")":"rgb("+t+", "+r+", "+o+")";var e,t,r,o,s},i.prototype.toHsl=function(){return Oa(xi(this.rgba))},i.prototype.toHslString=function(){return e=Oa(xi(this.rgba)),t=e.h,r=e.s,o=e.l,(s=e.a)<1?"hsla("+t+", "+r+"%, "+o+"%, "+s+")":"hsl("+t+", "+r+"%, "+o+"%)";var e,t,r,o,s},i.prototype.toHsv=function(){return e=za(this.rgba),{h:G(e.h),s:G(e.s),v:G(e.v),a:G(e.a,3)};var e},i.prototype.invert=function(){return ge({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},i.prototype.saturate=function(e){return e===void 0&&(e=.1),ge(qr(this.rgba,e))},i.prototype.desaturate=function(e){return e===void 0&&(e=.1),ge(qr(this.rgba,-e))},i.prototype.grayscale=function(){return ge(qr(this.rgba,-1))},i.prototype.lighten=function(e){return e===void 0&&(e=.1),ge(Ba(this.rgba,e))},i.prototype.darken=function(e){return e===void 0&&(e=.1),ge(Ba(this.rgba,-e))},i.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},i.prototype.alpha=function(e){return typeof e=="number"?ge({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):G(this.rgba.a,3);var t},i.prototype.hue=function(e){var t=xi(this.rgba);return typeof e=="number"?ge({h:e,s:t.s,l:t.l,a:t.a}):G(t.h)},i.prototype.isEqual=function(e){return this.toHex()===ge(e).toHex()},i}(),ge=function(i){return i instanceof fo?i:new fo(i)},Da=[],pd=function(i){i.forEach(function(e){Da.indexOf(e)<0&&(e(fo,Wr),Da.push(e))})};function md(i,e){var t={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},r={};for(var o in t)r[t[o]]=o;var s={};i.prototype.toName=function(a){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var c,h,d=r[this.toHex()];if(d)return d;if(a?.closest){var b=this.toRgb(),p=1/0,_="black";if(!s.length)for(var m in t)s[m]=new i(t[m]).toRgb();for(var w in t){var S=(c=b,h=s[w],Math.pow(c.r-h.r,2)+Math.pow(c.g-h.g,2)+Math.pow(c.b-h.b,2));S<p&&(p=S,_=w)}return _}},e.string.push([function(a){var c=a.toLowerCase(),h=c==="transparent"?"#0000":t[c];return h?new i(h).toRgb():null},"name"])}let jt=class extends z{constructor(e,t={}){super(e,{bubbles:!0,...t})}};jt.CHANGE="change";var bd=Object.defineProperty,vd=Object.getOwnPropertyDescriptor,j=(i,e,t,r)=>{for(var o=r>1?void 0:r?vd(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&bd(e,t,o),o};pd([md]);const Va="EyeDropper"in window;n.UUIColorPickerElement=class extends we("label",f){constructor(){super(...arguments),this._value="",this.inputValue="",this.hue=0,this.saturation=0,this.lightness=0,this.alpha=100,this._colord=ge("hsl(0, 0%, 0%)"),this.format="hex",this.name="",this.size="medium",this.noFormatToggle=!1,this.inline=!1,this.disabled=!1,this.opacity=!1,this.readonly=!1,this.uppercase=!1,this.swatches=["#d0021b","#f5a623","#f8e71c","#8b572a","#7ed321","#417505","#bd10e0","#9013fe","#4a90e2","#50e3c2","#b8e986","#000","#444","#888","#ccc","#fff"]}set value(e){this.value!==e&&this.setColor(e),this._value=e}get value(){return this._value}connectedCallback(){super.connectedCallback(),k(this,"uui-icon"),k(this,"uui-icon-registry-essential"),k(this,"uui-input"),k(this,"uui-button"),k(this,"uui-button-group"),k(this,"uui-color-swatches"),k(this,"uui-color-swatch"),k(this,"uui-color-area"),k(this,"uui-color-slider"),k(this,"uui-popover-container")}getFormattedValue(e){const t=this.opacity?`${e}a`:e,r=this._colord.toHex(),o=r.length>7?r.substring(0,r.length-2):r,{r:s,g:a,b:c}=this._colord.toRgb(),{h,s:d,l:b}=this._colord.toHsl(),{v:p}=this._colord.toHsv(),_=this._colord.alpha();switch(t){case"hex":return this.setLetterCase(o);case"hexa":return this.setLetterCase(r);case"rgb":return this.setLetterCase(`rgb(${s}, ${a}, ${c})`);case"rgba":return this.setLetterCase(this._colord.toRgbString());case"hsl":return this.setLetterCase(`hsl(${h}, ${d}%, ${b}%)`);case"hsla":return this.setLetterCase(this._colord.toHslString());case"hsv":return this.setLetterCase(`hsv(${h}, ${d}%, ${b}%)`);case"hsva":return this.setLetterCase(`hsva(${h}, ${d}%, ${p}%, ${_})`);default:return""}}getBrightness(e){return O(-1*(200*e/(this.saturation-200)),0,100)}getLightness(e){return O((200-this.saturation)*e/100*5/10,0,100)}handleFormatToggle(){const e=["hex","rgb","hsl","hsv"],t=(e.indexOf(this.format)+1)%e.length;this.format=e[t],this._syncValues()}handleAlphaChange(e){e.stopPropagation(),this._swatches?.resetSelection();const t=e.target,r={h:this.hue,s:this.saturation,l:this.lightness,a:Math.round(t.value)/100};this.setColor(r)}handleHueChange(e){e.stopPropagation(),this._swatches?.resetSelection();const t={h:e.target.value,s:this.saturation,l:this.lightness,a:this.alpha/100};this.setColor(t)}handleGridChange(e){e.stopPropagation(),this._swatches?.resetSelection();const t=e.target,r={h:this.hue,s:t.saturation,l:t.lightness,a:this.alpha/100};this.setColor(r)}handleInputChange(e){e.stopImmediatePropagation(),this._swatches?.resetSelection(),this.inputValue=this._input.value,this.setColor(this.inputValue)}handleInputKeyDown(e){e.stopImmediatePropagation(),e.key==="Enter"&&(this._swatches?.resetSelection(),this.inputValue=this._input.value,this.setColor(this.inputValue),setTimeout(()=>this._input.select()))}handleColorSwatchChange(e){e.stopImmediatePropagation();const t=e.target;this.setColor(t.value)}handleCopy(){navigator.clipboard.writeText(this._input.value).then(()=>{this._previewButton.classList.add("color-picker__preview-color--copied"),this._previewButton.addEventListener("animationend",()=>{this._previewButton.classList.remove("color-picker__preview-color--copied")})})}handleEyeDropper(){Va&&new EyeDropper().open().then(e=>this.setColor(e.sRGBHex)).catch(()=>{})}setColor(e){if(e===this.value)return;if(!e)return this.alpha=100,this.inputValue="",this._value=e,this.dispatchEvent(new jt(jt.CHANGE)),!0;const t=new fo(e),{h:r,s:o,l:s,a}=t.toHsl();this.hue=r,this.saturation=o,this.lightness=s,this.alpha=this.opacity?a*100:100;const c=e;return c&&c.h&&(this.hue=c.h),this._colord=t,this._syncValues(),this.dispatchEvent(new jt(jt.CHANGE)),!0}setLetterCase(e){return typeof e!="string"?"":this.uppercase?e.toUpperCase():e.toLowerCase()}getHexString(e,t,r,o=100){const s=ge(`hsla(${e}, ${t}%, ${r}%, ${o/100})`);return s.isValid()?s.toHex():""}_syncValues(){this.inputValue=this.getFormattedValue(this.format),this._value=this.inputValue}_renderColorPicker(){return u`<div class="${Vr({"color-picker":!0,"color-picker--inline":this.inline,"color-picker--disabled":this.disabled})}" aria-disabled="${this.disabled?"true":"false"}"><uui-color-area .value="${this.value}" .hue="${Math.round(this.hue)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" @change="${this.handleGridChange}"></uui-color-area><div class="color-picker__controls"><div class="color-picker__sliders"><uui-color-slider label="hue" class="hue-slider" .value="${Math.round(this.hue)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" @change="${this.handleHueChange}"></uui-color-slider>${this.opacity?u`<uui-color-slider label="alpha" class="opacity-slider" .value="${Math.round(this.alpha)}" type="opacity" .color="${this.getHexString(this.hue,this.saturation,this.lightness)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" @change="${this.handleAlphaChange}"></uui-color-slider>`:""}</div><button type="button" part="preview" class="color-picker__preview color-picker__transparent-bg" title="Copy" aria-label="Copy" style="${Ae({"--preview-color":`hsla(${this.hue}deg, ${this.saturation}%, ${this.lightness}%, ${this.alpha/100})`})}" @click="${this.handleCopy}"></button></div><div class="color-picker__user-input" aria-live="polite"><uui-input label="label" type="text" part="input" name="${this.name}" autocomplete="off" autocapitalize="off" spellcheck="false" .value="${nd(this.inputValue)}" ?disabled="${this.disabled}" ?readonly="${this.readonly}" @keydown="${this.handleInputKeyDown}" @change="${this.handleInputChange}"></uui-input><uui-button-group>${this.noFormatToggle?"":u`<uui-button label="Toggle color format" @click="${this.handleFormatToggle}" class="color-picker__toggle-format" ?disabled="${this.disabled}" compact="compact"><span>${this.format}</span></uui-button>`} ${Va?u`<uui-button label="Select a color" ?disabled="${this.disabled||this.readonly}" @click="${this.handleEyeDropper}" compact="compact"><uui-icon-registry-essential><uui-icon name="colorpicker"></uui-icon></uui-icon-registry-essential></uui-button>`:""}</uui-button-group></div>${this._renderSwatches()}</div>`}_renderSwatches(){return this.swatches?.length?u`<uui-color-swatches id="swatches" class="color-picker__swatches" label="Swatches" ?disabled="${this.disabled}" ?readonly="${this.readonly}" @change="${this.handleColorSwatchChange}">${this.swatches.map(e=>u`<uui-color-swatch label="${e}" .value="${e}"></uui-color-swatch>`)}</uui-color-swatches>`:x}_renderPreviewButton(){return u`<button type="button" part="trigger" aria-label="${this.label||"Open Color picker"}" class="${Vr({"color-picker__trigger":!0,"color-dropdown__trigger--disabled":this.disabled,"color-dropdown__trigger--small":this.size==="small","color-dropdown__trigger--medium":this.size==="medium","color-dropdown__trigger--large":this.size==="large","color-picker__transparent-bg":!0})}" style="${Ae({"--preview-color":`hsla(${this.hue}deg, ${this.saturation}%, ${this.lightness}%, ${this.alpha/100})`})}" ?disabled="${this.disabled}" aria-haspopup="true" aria-expanded="false" popovertarget="color-picker-popover"></button><uui-popover-container id="color-picker-popover">${this._renderColorPicker()}</uui-popover-container>`}render(){return this.inline?this._renderColorPicker():this._renderPreviewButton()}},n.UUIColorPickerElement.styles=[g`:host{--uui-look-outline-border:#ddd;--uui-look-outline-border-hover:#aaa;font-size:.8rem;color:var(--uui-color-text,#060606);display:block;width:var(--uui-color-picker-width,280px)}:host>button{cursor:pointer}uui-popover-container{width:inherit}.color-picker{width:100%;background-color:var(--uui-color-surface,#fff);user-select:none;border:solid 1px var(--uui-color-border,#d8d7d9)}.color-picker__user-input{display:flex;padding:0 .75rem .75rem .75rem}.color-picker__user-input uui-button{border:var(--uui-input-border-width,1px) solid var(--uui-input-border-color,var(--uui-color-border,#d8d7d9));border-left:none}.color-picker__preview,.color-picker__trigger{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;position:relative;width:2.25rem;height:2.25rem;border:none;border-radius:50%;background:0 0}.color-picker__preview{cursor:copy;margin-left:.75rem;border-radius:50%}.color-picker__trigger[disabled]{cursor:not-allowed;opacity:.5}.color-picker__preview::before,.color-picker__trigger::before{content:'';position:absolute;top:0;left:0;width:100%;height:100%;border-radius:inherit;background-color:var(--preview-color)}.color-dropdown__trigger--empty::before{background-color:transparent}.color-picker__transparent-bg{border:1px solid var(--uui-color-border,#d8d7d9);background-image:linear-gradient(45deg,var(--uui-palette-grey,#c4c4c4) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg,transparent 75%,var(--uui-palette-grey,#c4c4c4) 75%),linear-gradient(45deg,var(--uui-palette-grey,#c4c4c4) 25%,transparent 25%);background-size:10px 10px;background-position:0 0,0 0,-5px -5px,5px 5px}.color-picker__preview-color--copied{animation:pulse .75s}@keyframes pulse{0%{box-shadow:0 0 0 0 var(--uui-palette-space-cadet-light,#26356e)}70%{box-shadow:0 0 0 .5rem transparent}100%{box-shadow:0 0 0 0 transparent}}.color-picker__controls{padding:.75rem;display:flex;align-items:center}.color-picker__sliders{flex:1 1 auto}uui-color-slider:not(:last-of-type){margin-bottom:1rem}.color-picker__toggle-format{min-width:45px;--uui-button-font-size:0.8rem}.color-picker__toggle-format>span{text-transform:uppercase}uui-color-swatches{border-top:solid 1px var(--uui-color-border,#d8d7d9);padding:.75rem}button[slot=trigger]{border-radius:50%;cursor:pointer;width:36px;height:36px}uui-input{font-size:.85rem;box-sizing:content-box;flex:1}uui-color-area{width:100%}`],j([A('[part="input"]')],n.UUIColorPickerElement.prototype,"_input",2),j([A(".color-picker__preview")],n.UUIColorPickerElement.prototype,"_previewButton",2),j([A("#swatches")],n.UUIColorPickerElement.prototype,"_swatches",2),j([U()],n.UUIColorPickerElement.prototype,"inputValue",2),j([U()],n.UUIColorPickerElement.prototype,"hue",2),j([U()],n.UUIColorPickerElement.prototype,"saturation",2),j([U()],n.UUIColorPickerElement.prototype,"lightness",2),j([U()],n.UUIColorPickerElement.prototype,"alpha",2),j([U()],n.UUIColorPickerElement.prototype,"_colord",2),j([l()],n.UUIColorPickerElement.prototype,"value",1),j([l()],n.UUIColorPickerElement.prototype,"format",2),j([l()],n.UUIColorPickerElement.prototype,"name",2),j([l()],n.UUIColorPickerElement.prototype,"size",2),j([l({attribute:"no-format-toggle",type:Boolean})],n.UUIColorPickerElement.prototype,"noFormatToggle",2),j([l({type:Boolean,reflect:!0})],n.UUIColorPickerElement.prototype,"inline",2),j([l({type:Boolean,reflect:!0})],n.UUIColorPickerElement.prototype,"disabled",2),j([l({type:Boolean})],n.UUIColorPickerElement.prototype,"opacity",2),j([l({type:Boolean,reflect:!0})],n.UUIColorPickerElement.prototype,"readonly",2),j([l({type:Boolean})],n.UUIColorPickerElement.prototype,"uppercase",2),j([l({attribute:!1})],n.UUIColorPickerElement.prototype,"swatches",2),n.UUIColorPickerElement=j([v("uui-color-picker")],n.UUIColorPickerElement);var gd={grad:.9,turn:360,rad:360/(2*Math.PI)},Me=function(i){return typeof i=="string"?i.length>0:typeof i=="number"},W=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*i)/t+0},me=function(i,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),i>t?t:i>e?i:e},ja=function(i){return(i=isFinite(i)?i%360:0)>0?i:i+360},Ha=function(i){return{r:me(i.r,0,255),g:me(i.g,0,255),b:me(i.b,0,255),a:me(i.a)}},Xr=function(i){return{r:W(i.r),g:W(i.g),b:W(i.b),a:W(i.a,3)}},fd=/^#([0-9a-f]{3,8})$/i,yo=function(i){var e=i.toString(16);return e.length<2?"0"+e:e},Ra=function(i){var e=i.r,t=i.g,r=i.b,o=i.a,s=Math.max(e,t,r),a=s-Math.min(e,t,r),c=a?s===e?(t-r)/a:s===t?2+(r-e)/a:4+(e-t)/a:0;return{h:60*(c<0?c+6:c),s:s?a/s*100:0,v:s/255*100,a:o}},Fa=function(i){var e=i.h,t=i.s,r=i.v,o=i.a;e=e/360*6,t/=100,r/=100;var s=Math.floor(e),a=r*(1-t),c=r*(1-(e-s)*t),h=r*(1-(1-e+s)*t),d=s%6;return{r:255*[r,c,a,a,h,r][d],g:255*[h,r,r,c,a,a][d],b:255*[a,a,h,r,r,c][d],a:o}},Ga=function(i){return{h:ja(i.h),s:me(i.s,0,100),l:me(i.l,0,100),a:me(i.a)}},Wa=function(i){return{h:W(i.h),s:W(i.s),l:W(i.l),a:W(i.a,3)}},qa=function(i){return Fa((t=(e=i).s,{h:e.h,s:(t*=((r=e.l)<50?r:100-r)/100)>0?2*t/(r+t)*100:0,v:r+t,a:e.a}));var e,t,r},Ii=function(i){return{h:(e=Ra(i)).h,s:(o=(200-(t=e.s))*(r=e.v)/100)>0&&o<200?t*r/100/(o<=100?o:200-o)*100:0,l:o/2,a:e.a};var e,t,r,o},yd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ud=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_d=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Ka={string:[[function(i){var e=fd.exec(i);return e?(i=e[1]).length<=4?{r:parseInt(i[0]+i[0],16),g:parseInt(i[1]+i[1],16),b:parseInt(i[2]+i[2],16),a:i.length===4?W(parseInt(i[3]+i[3],16)/255,2):1}:i.length===6||i.length===8?{r:parseInt(i.substr(0,2),16),g:parseInt(i.substr(2,2),16),b:parseInt(i.substr(4,2),16),a:i.length===8?W(parseInt(i.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(i){var e=Ud.exec(i)||_d.exec(i);return e?e[2]!==e[4]||e[4]!==e[6]?null:Ha({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(i){var e=yd.exec(i)||wd.exec(i);if(!e)return null;var t,r,o=Ga({h:(t=e[1],r=e[2],r===void 0&&(r="deg"),Number(t)*(gd[r]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return qa(o)},"hsl"]],object:[[function(i){var e=i.r,t=i.g,r=i.b,o=i.a,s=o===void 0?1:o;return Me(e)&&Me(t)&&Me(r)?Ha({r:Number(e),g:Number(t),b:Number(r),a:Number(s)}):null},"rgb"],[function(i){var e=i.h,t=i.s,r=i.l,o=i.a,s=o===void 0?1:o;if(!Me(e)||!Me(t)||!Me(r))return null;var a=Ga({h:Number(e),s:Number(t),l:Number(r),a:Number(s)});return qa(a)},"hsl"],[function(i){var e=i.h,t=i.s,r=i.v,o=i.a,s=o===void 0?1:o;if(!Me(e)||!Me(t)||!Me(r))return null;var a=function(c){return{h:ja(c.h),s:me(c.s,0,100),v:me(c.v,0,100),a:me(c.a)}}({h:Number(e),s:Number(t),v:Number(r),a:Number(s)});return Fa(a)},"hsv"]]},Xa=function(i,e){for(var t=0;t<e.length;t++){var r=e[t][0](i);if(r)return[r,e[t][1]]}return[null,void 0]},$d=function(i){return typeof i=="string"?Xa(i.trim(),Ka.string):typeof i=="object"&&i!==null?Xa(i,Ka.object):[null,void 0]},Yr=function(i,e){var t=Ii(i);return{h:t.h,s:me(t.s+100*e,0,100),l:t.l,a:t.a}},Zr=function(i){return(299*i.r+587*i.g+114*i.b)/1e3/255},Ya=function(i,e){var t=Ii(i);return{h:t.h,s:t.s,l:me(t.l+100*e,0,100),a:t.a}},Qr=function(){function i(e){this.parsed=$d(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return i.prototype.isValid=function(){return this.parsed!==null},i.prototype.brightness=function(){return W(Zr(this.rgba),2)},i.prototype.isDark=function(){return Zr(this.rgba)<.5},i.prototype.isLight=function(){return Zr(this.rgba)>=.5},i.prototype.toHex=function(){return e=Xr(this.rgba),t=e.r,r=e.g,o=e.b,a=(s=e.a)<1?yo(W(255*s)):"","#"+yo(t)+yo(r)+yo(o)+a;var e,t,r,o,s,a},i.prototype.toRgb=function(){return Xr(this.rgba)},i.prototype.toRgbString=function(){return e=Xr(this.rgba),t=e.r,r=e.g,o=e.b,(s=e.a)<1?"rgba("+t+", "+r+", "+o+", "+s+")":"rgb("+t+", "+r+", "+o+")";var e,t,r,o,s},i.prototype.toHsl=function(){return Wa(Ii(this.rgba))},i.prototype.toHslString=function(){return e=Wa(Ii(this.rgba)),t=e.h,r=e.s,o=e.l,(s=e.a)<1?"hsla("+t+", "+r+"%, "+o+"%, "+s+")":"hsl("+t+", "+r+"%, "+o+"%)";var e,t,r,o,s},i.prototype.toHsv=function(){return e=Ra(this.rgba),{h:W(e.h),s:W(e.s),v:W(e.v),a:W(e.a,3)};var e},i.prototype.invert=function(){return Oe({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},i.prototype.saturate=function(e){return e===void 0&&(e=.1),Oe(Yr(this.rgba,e))},i.prototype.desaturate=function(e){return e===void 0&&(e=.1),Oe(Yr(this.rgba,-e))},i.prototype.grayscale=function(){return Oe(Yr(this.rgba,-1))},i.prototype.lighten=function(e){return e===void 0&&(e=.1),Oe(Ya(this.rgba,e))},i.prototype.darken=function(e){return e===void 0&&(e=.1),Oe(Ya(this.rgba,-e))},i.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},i.prototype.alpha=function(e){return typeof e=="number"?Oe({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):W(this.rgba.a,3);var t},i.prototype.hue=function(e){var t=Ii(this.rgba);return typeof e=="number"?Oe({h:e,s:t.s,l:t.l,a:t.a}):W(t.h)},i.prototype.isEqual=function(e){return this.toHex()===Oe(e).toHex()},i}(),Oe=function(i){return i instanceof Qr?i:new Qr(i)};let wo=class extends z{constructor(e,t={}){super(e,{bubbles:!0,...t})}};wo.CHANGE="change";var kd=Object.defineProperty,Ed=Object.getOwnPropertyDescriptor,$e=(i,e,t,r)=>{for(var o=r>1?void 0:r?Ed(e,t):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(o=(r?a(e,t,o):a(o))||o);return r&&o&&kd(e,t,o),o};n.UUIColorSliderElement=class extends we("label",f){constructor(){super(...arguments),this.type="hue",this.color="",this.min=0,this.max=100,this.precision=1,this.vertical=!1,this.value=0,this.readonly=!1,this.disabled=!1}willUpdate(e){if(e.has("type")&&(this.type==="hue"?this.max=this.max??360:this.type==="saturation"?this.max=this.max??100:this.type==="lightness"?this.max=this.max??100:this.type==="opacity"&&(this.max=this.max??100),this.precision=this.precision??1,this.color)){const t=new Qr(this.color),{h:r,s:o,l:s}=t.toHsl(),a=this.type==="saturation"?`linear-gradient(to ${this.vertical?"top":"right"}, hsl(${r}, 0%, ${s}%), hsl(${r}, 100%, ${s}%))`:this.type==="lightness"?`linear-gradient(to ${this.vertical?"top":"right"}, hsl(${r}, ${o}%, 0%), hsl(${r}, ${o}%, 100%))`:null;this.style.setProperty("--uui-slider-background-image",a)}}firstUpdated(){this.container=this.shadowRoot.querySelector("#color-slider"),this.handle=this.container.querySelector("#color-slider__handle")}handleDrag(e){if(this.disabled||this.readonly||!this.container||!this.handle)return;const{width:t,height:r}=this.container.getBoundingClientRect();this.handle.focus(),e.preventDefault(),Xs(this.container,{onMove:(o,s)=>{this.vertical?this.value=Ys(O(s/r*this.max,this.min,this.max),this.min,this.max):this.value=O(o/t*this.max,this.min,this.max),this.syncValues()},initialEvent:e})}handleClick(e){this.disabled||this.readonly||(this.value=this.getValueFromMousePosition(e),this.syncValues())}handleKeyDown(e){const t=e.shiftKey?10:1;e.key==="ArrowLeft"?(e.preventDefault(),this.value=O(this.value-t,this.min,this.max),this.syncValues()):e.key==="ArrowRight"?(e.preventDefault(),this.value=O(this.value+t,this.min,this.max),this.syncValues()):e.key==="ArrowUp"?(e.preventDefault(),this.value=O(this.value+t,this.min,this.max),this.syncValues()):e.key==="ArrowDown"?(e.preventDefault(),this.value=O(this.value-t,this.min,this.max),this.syncValues()):e.key==="Home"?(e.preventDefault(),this.value=this.min,this.syncValues()):e.key==="End"&&(e.preventDefault(),this.value=this.max,this.syncValues())}getValueFromMousePosition(e){return this.vertical?this.getValueFromYCoordinate(e.clientY):this.getValueFromXCoordinate(e.clientX)}getValueFromTouchPosition(e){return this.vertical?this.getValueFromYCoordinate(e.touches[0].clientY):this.getValueFromXCoordinate(e.touches[0].clientX)}getValueFromXCoordinate(e){const{left:t,width:r}=this.container.getBoundingClientRect();return O(this.roundToPrecision((e-t)/r*this.max),this.min,this.max)}getValueFromYCoordinate(e){const{top:t,height:r}=this.container.getBoundingClientRect();return O(this.roundToPrecision((e-t)/r*this.max),this.min,this.max)}roundToPrecision(e){const t=1/this.precision;return Math.ceil(e*t)/t}syncValues(){this.dispatchEvent(new wo(wo.CHANGE))}get cssPropCurrentValue(){return this.value===0?this.vertical?100:0:100/(this.vertical?this.max/Ys(this.value,this.min,this.max):this.max/this.value)}render(){return u`<div part="slider" id="color-slider" role="slider" aria-label="${this.label}" aria-orientation="${this.vertical?"vertical":"horizontal"}" aria-valuemin="${Math.round(this.min)}" aria-valuemax="${Math.round(this.max)}" aria-valuenow="${Math.round(this.value)}" @click="${this.handleClick}" @mousedown="${this.handleDrag}" @touchstart="${this.handleDrag}" @keydown="${this.handleKeyDown}">${this.type==="opacity"?u`<div id="current-hue" style="${Ae({backgroundImage:`linear-gradient(to ${this.vertical?"top":"right"},
|
|
368
376
|
transparent 0%,
|
|
369
377
|
${this.color} 100%
|
|
370
378
|
)`})}"></div>`:""} <span id="color-slider__handle" style="--current-value:${this.cssPropCurrentValue}" tabindex="${$(this.disabled?void 0:"0")}"></span></div>${Math.round(this.value)}`}},n.UUIColorSliderElement.styles=[g`:host{--uui-slider-height:15px;--uui-slider-handle-size:17px;--uui-slider-background-image:#fff;--uui-slider-background-size:100%;--uui-slider-background-position:top left;display:block}:host([type=hue]){--uui-slider-background-image:linear-gradient(
|