@rettangoli/ui 1.0.4 → 1.0.6

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.
@@ -1,4 +1,4 @@
1
- var rettangoli=(()=>{var O=`
1
+ var rettangoli=(()=>{var $=`
2
2
  :host([href]) {
3
3
  cursor: pointer;
4
4
  position: relative;
@@ -12,27 +12,27 @@ var rettangoli=(()=>{var O=`
12
12
  bottom: 0;
13
13
  z-index: 1;
14
14
  }
15
- `,W=({linkElement:i,href:t,newTab:e,rel:s})=>{i.href=t,e?i.target="_blank":i.removeAttribute("target"),s!=null?i.rel=s:e?i.rel="noopener noreferrer":i.removeAttribute("rel")},L=({shadowRoot:i,slotElement:t,linkElement:e,href:s,newTab:n,rel:r})=>{if(t.parentNode!==i&&i.appendChild(t),!s)return e&&e.parentNode===i&&i.removeChild(e),null;let o=e||document.createElement("a");return W({linkElement:o,href:s,newTab:n,rel:r}),o.parentNode!==i&&i.appendChild(o),o},P=({shadowRoot:i,childElement:t,linkElement:e,href:s,newTab:n,rel:r})=>{if(!s)return e?(t.parentNode===e&&i.appendChild(t),e.parentNode===i&&i.removeChild(e),null):(t.parentNode!==i&&i.appendChild(t),null);let o=e||document.createElement("a");return W({linkElement:o,href:s,newTab:n,rel:r}),t.parentNode!==o&&o.appendChild(t),o.parentNode!==i&&i.appendChild(o),o};var x=["default","sm","md","lg","xl"],g=()=>x.reduce((i,t)=>(i[t]={},i),{}),dt=["sm","md","lg","xl"],Dt=({size:i,attr:t})=>i==="default"?t:`${i}-${t}`,Ft=({size:i,includeDefault:t=!0})=>{if(i==="default")return["default"];let e=dt.indexOf(i);if(e===-1)return t?["default"]:[];let s=dt.slice(e);return t&&s.push("default"),s},H=({element:i,size:t,attr:e,includeDefault:s=!0})=>{let n=Ft({size:t,includeDefault:s});for(let r of n){let o=Dt({size:r,attr:e}),l=i.getAttribute(o);if(l!==null)return l}return null};var Nt=/^([1-9]|1[0-2])fg$/,Vt=/^([1-9]\d*)\/([1-9]\d*)fb$/,q=i=>typeof i=="string"&&Nt.test(i),ut=i=>{if(typeof i!="string")return null;let t=i.match(Vt);if(!t)return null;let e=Number(t[1]),s=Number(t[2]);return!Number.isInteger(e)||!Number.isInteger(s)||s<=0||e>s?null:{numerator:e,denominator:s}};function ct({numerator:i,denominator:t,gapVar:e}){return i===t?"100%":i===1?`calc((100% - ((${t} - 1) * ${e})) / ${t})`:`calc(((100% - ((${t} - 1) * ${e})) * ${i}) / ${t})`}var f=({styleBucket:i,axis:t,dimension:e,fillValue:s,allowFlexGrow:n=!1,flexMinDimension:r="0",lockBounds:o=!0})=>{let l=()=>{!n||t!=="width"||(i["flex-grow"]="0",i["flex-shrink"]="1",i["flex-basis"]="auto")},a=()=>{i[`min-${t}`]="unset",i[`max-${t}`]="unset"};if(e===void 0)return;if(e==="f"){l(),i[t]=s,a();return}if(n&&q(e)){i["flex-grow"]=e.slice(0,-2),i["flex-basis"]="0%",i[`min-${t}`]=r,i[`max-${t}`]="unset";return}let h=n?ut(e):null;if(h){i["flex-grow"]="0",i["flex-shrink"]="0",i["flex-basis"]=ct({...h,gapVar:"var(--rtgl-flex-gap, 0px)"}),i[`min-${t}`]=r,i[`max-${t}`]="unset";return}l(),i[t]=e,o&&(i[`min-${t}`]=e,i[`max-${t}`]=e)},G=({style:i,width:t,fillValue:e="var(--width-stretch)",allowFlexGrow:s=!0,flexMinWidth:n="0"})=>{if(t==="f"){i.width=e,i.flexGrow="",i.flexBasis="",i.minWidth="";return}if(s&&q(t)){i.width="",i.flexGrow=t.slice(0,-2),i.flexShrink="",i.flexBasis="0%",i.minWidth=n;return}let r=s?ut(t):null;if(r){i.width="",i.flexGrow="0",i.flexShrink="0",i.flexBasis=ct({...r,gapVar:"var(--rtgl-flex-gap, 0px)"}),i.minWidth=n;return}if(t!=null){i.width=t,i.flexGrow="",i.flexShrink="",i.flexBasis="",i.minWidth="";return}i.width="",i.flexGrow="",i.flexShrink="",i.flexBasis="",i.minWidth=""};function u(i,...t){let e="";return i.forEach((s,n)=>{e+=s+(t[n]||"")}),e}var jt=["sm","md","lg","xl"],pt={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap --rtgl-flex-gap",gv:"row-gap --rtgl-flex-gap",gh:"column-gap --rtgl-flex-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",cur:"cursor"},A=Object.keys(pt),_=i=>i.concat(jt.flatMap(t=>i.map(e=>`${t}-${e}`))),mt={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},b=(i,t={},e=null)=>{let s="";for(let[n,r]of Object.entries(mt)){n!=="default"&&(s+=`${r} {`);for(let[o,l]of Object.entries(i))for(let[a,h]of Object.entries(l)){let m=pt[o],y=h.startsWith("--")?`var(${h})`:h,S=n==="default"?o:`${n}-${o}`,F=n==="default"?`h-${o}`:`${n}-h-${o}`,C=(I,$=!1)=>{let E=$?`:host([${I}="${a}"]:hover)`:`:host([${I}="${a}"])`;if(e)return e.split(",").map(j=>`${E} ${j.trim()}`).join(", ");let z=t[o];return z?`${E} ${z}`:E};if(m){let $=m.split(" ").map(E=>`${E}: ${y};`).join(" ");s+=`
16
- ${C(S)}{
17
- ${$}
15
+ `,L=({linkElement:i,href:t,newTab:e,rel:s})=>{i.href=t,e?i.target="_blank":i.removeAttribute("target"),s!=null?i.rel=s:e?i.rel="noopener noreferrer":i.removeAttribute("rel")},z=({shadowRoot:i,slotElement:t,linkElement:e,href:s,newTab:r,rel:n})=>{if(t.parentNode!==i&&i.appendChild(t),!s)return e&&e.parentNode===i&&i.removeChild(e),null;let o=e||document.createElement("a");return L({linkElement:o,href:s,newTab:r,rel:n}),o.parentNode!==i&&i.appendChild(o),o},U=({shadowRoot:i,childElement:t,linkElement:e,href:s,newTab:r,rel:n})=>{if(!s)return e?(t.parentNode===e&&i.appendChild(t),e.parentNode===i&&i.removeChild(e),null):(t.parentNode!==i&&i.appendChild(t),null);let o=e||document.createElement("a");return L({linkElement:o,href:s,newTab:r,rel:n}),t.parentNode!==o&&o.appendChild(t),o.parentNode!==i&&i.appendChild(o),o};var S=["default","sm","md","lg","xl"],g=()=>S.reduce((i,t)=>(i[t]={},i),{}),gt=["sm","md","lg","xl"],qt=({size:i,attr:t})=>i==="default"?t:`${i}-${t}`,Gt=({size:i,includeDefault:t=!0})=>{if(i==="default")return["default"];let e=gt.indexOf(i);if(e===-1)return t?["default"]:[];let s=gt.slice(e);return t&&s.push("default"),s},K=({element:i,size:t,attr:e,includeDefault:s=!0})=>{let r=Gt({size:t,includeDefault:s});for(let n of r){let o=qt({size:n,attr:e}),l=i.getAttribute(o);if(l!==null)return l}return null};var Ut=/^([1-9]|1[0-2])fg$/,Kt=/^([1-9]\d*)\/([1-9]\d*)fb$/,X=i=>typeof i=="string"&&Ut.test(i),ft=i=>{if(typeof i!="string")return null;let t=i.match(Kt);if(!t)return null;let e=Number(t[1]),s=Number(t[2]);return!Number.isInteger(e)||!Number.isInteger(s)||s<=0||e>s?null:{numerator:e,denominator:s}};function bt({numerator:i,denominator:t,gapVar:e}){return i===t?"100%":i===1?`calc((100% - ((${t} - 1) * ${e})) / ${t})`:`calc(((100% - ((${t} - 1) * ${e})) * ${i}) / ${t})`}var f=({styleBucket:i,axis:t,dimension:e,fillValue:s,allowFlexGrow:r=!1,flexMinDimension:n="0",lockBounds:o=!0})=>{let l=()=>{!r||t!=="width"||(i["flex-grow"]="0",i["flex-shrink"]="1",i["flex-basis"]="auto")},a=()=>{i[`min-${t}`]="unset",i[`max-${t}`]="unset"};if(e===void 0)return;if(e==="f"){l(),i[t]=s,a();return}if(r&&X(e)){i["flex-grow"]=e.slice(0,-2),i["flex-basis"]="0%",i[`min-${t}`]=n,i[`max-${t}`]="unset";return}let h=r?ft(e):null;if(h){i["flex-grow"]="0",i["flex-shrink"]="0",i["flex-basis"]=bt({...h,gapVar:"var(--rtgl-flex-gap, 0px)"}),i[`min-${t}`]=n,i[`max-${t}`]="unset";return}l(),i[t]=e,o&&(i[`min-${t}`]=e,i[`max-${t}`]=e)},M=({style:i,width:t,fillValue:e="var(--width-stretch)",allowFlexGrow:s=!0,flexMinWidth:r="0"})=>{if(t==="f"){i.width=e,i.flexGrow="",i.flexBasis="",i.minWidth="";return}if(s&&X(t)){i.width="",i.flexGrow=t.slice(0,-2),i.flexShrink="",i.flexBasis="0%",i.minWidth=r;return}let n=s?ft(t):null;if(n){i.width="",i.flexGrow="0",i.flexShrink="0",i.flexBasis=bt({...n,gapVar:"var(--rtgl-flex-gap, 0px)"}),i.minWidth=r;return}if(t!=null){i.width=t,i.flexGrow="",i.flexShrink="",i.flexBasis="",i.minWidth="";return}i.width="",i.flexGrow="",i.flexShrink="",i.flexBasis="",i.minWidth=""};var Xt=i=>`${i}`.trim().replace(/\s*\/\s*/g,"/"),T=i=>{if(i==null)return;let t=Xt(i);if(t.length!==0)return typeof CSS<"u"&&typeof CSS.supports=="function"?CSS.supports("aspect-ratio",t)?t:void 0:t};function u(i,...t){let e="";return i.forEach((s,r)=>{e+=s+(t[r]||"")}),e}var Yt=["sm","md","lg","xl"],vt={mt:"margin-top",mr:"margin-right",mb:"margin-bottom",ml:"margin-left",m:"margin",mh:"margin-left margin-right",mv:"margin-top margin-bottom",pt:"padding-top",pr:"padding-right",pb:"padding-bottom",pl:"padding-left",p:"padding",ph:"padding-left padding-right",pv:"padding-top padding-bottom",g:"gap --rtgl-flex-gap",gv:"row-gap --rtgl-flex-gap",gh:"column-gap --rtgl-flex-gap",bw:"border-width",bwt:"border-top-width",bwr:"border-right-width",bwb:"border-bottom-width",bwl:"border-left-width",bc:"border-color",br:"border-radius",pos:"position",shadow:"box-shadow",cur:"cursor"},E=Object.keys(vt),w=i=>i.concat(Yt.flatMap(t=>i.map(e=>`${t}-${e}`))),yt={default:void 0,xl:"@media only screen and (max-width: 1280px)",lg:"@media only screen and (max-width: 1024px)",md:"@media only screen and (max-width: 768px)",sm:"@media only screen and (max-width: 640px)"},v=(i,t={},e=null)=>{let s="";for(let[r,n]of Object.entries(yt)){r!=="default"&&(s+=`${n} {`);for(let[o,l]of Object.entries(i))for(let[a,h]of Object.entries(l)){let y=vt[o],b=h.startsWith("--")?`var(${h})`:h,_=r==="default"?o:`${r}-${o}`,A=r==="default"?`h-${o}`:`${r}-h-${o}`,I=(R,B=!1)=>{let C=B?`:host([${R}="${a}"]:hover)`:`:host([${R}="${a}"])`;if(e)return e.split(",").map(P=>`${C} ${P.trim()}`).join(", ");let W=t[o];return W?`${C} ${W}`:C};if(y){let B=y.split(" ").map(C=>`${C}: ${b};`).join(" ");s+=`
16
+ ${I(_)}{
17
+ ${B}
18
18
  }
19
- ${C(F,!0)}{
20
- ${$}
19
+ ${I(A,!0)}{
20
+ ${B}
21
21
  }
22
22
  `}else s+=`
23
- ${C(S)}{
23
+ ${I(_)}{
24
24
  ${h}
25
25
  }
26
- ${C(F,!0)}{
26
+ ${I(A,!0)}{
27
27
  ${h}
28
28
  }
29
- `}n!=="default"&&(s+="}")}return s};function Pt(i){if(i===null||i.includes("/"))return!1;let t=String(i);return/[0-9]$/.test(t)}var Ht=i=>/%$/.test(i),qt=i=>/^([1-9]|1[0-2])fg$/.test(i),c=i=>{if(i!=null)return qt(i)||Ht(i)?i:Pt(i)?`${i}px`:Object.keys(d).includes(i)?`var(${d[i]})`:i},d={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function w(i,t=":host"){let e="",s=["default","xl","lg","md","sm"];for(let n of s){let r=mt[n];if(!i[n]||Object.keys(i[n]).length===0)continue;n!=="default"&&(e+=`${r} {
30
- `);let o="";for(let[l,a]of Object.entries(i[n]))a!=null&&(o+=`${l}: ${a} !important;
29
+ `}r!=="default"&&(s+="}")}return s};function Qt(i){if(i===null||i.includes("/"))return!1;let t=String(i);return/[0-9]$/.test(t)}var Jt=i=>/%$/.test(i),Zt=i=>/^([1-9]|1[0-2])fg$/.test(i),c=i=>{if(i!=null)return Zt(i)||Jt(i)?i:Qt(i)?`${i}px`:Object.keys(d).includes(i)?`var(${d[i]})`:i},d={xs:"--spacing-xs",sm:"--spacing-sm",md:"--spacing-md",lg:"--spacing-lg",xl:"--spacing-xl"};function x(i,t=":host"){let e="",s=["default","xl","lg","md","sm"];for(let r of s){let n=yt[r];if(!i[r]||Object.keys(i[r]).length===0)continue;r!=="default"&&(e+=`${n} {
30
+ `);let o="";for(let[l,a]of Object.entries(i[r]))a!=null&&(o+=`${l}: ${a} !important;
31
31
  `);e+=`${t} {
32
32
  ${o.trim()}
33
33
  }
34
- `,n!=="default"&&(e+=`}
35
- `)}return e}var Gt={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d,s:{sm:`
34
+ `,r!=="default"&&(e+=`}
35
+ `)}return e}var te={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d,s:{sm:`
36
36
  height: 28px;
37
37
  padding-left: 12px;
38
38
  padding-right: 12px;
@@ -81,7 +81,7 @@ var rettangoli=(()=>{var O=`
81
81
  `,lk:`
82
82
  background-color: transparent;
83
83
  color: var(--foreground);
84
- `}},gt=b(Gt,{},".surface");var Ut=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],U=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
84
+ `}},_t=v(te,{},".surface");var ee=[{prefix:"sm",maxWidth:640},{prefix:"md",maxWidth:768},{prefix:"lg",maxWidth:1024},{prefix:"xl",maxWidth:1280}],Y=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
85
85
  :host {
86
86
  display: inline-flex;
87
87
  }
@@ -248,79 +248,8 @@ var rettangoli=(()=>{var O=`
248
248
  color: inherit;
249
249
  }
250
250
 
251
- ${gt}
252
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,e,s){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:e,maxWidth:s}of Ut){let n=`${e}-s`;if(t<=s&&this.hasAttribute(n))return this.getAttribute(n)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),e=this.getAttribute("href"),s=this.hasAttribute("new-tab"),n=this.getAttribute("rel"),r=e&&!t,o=r?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==o){let l=document.createElement(o);l.className="surface",l.appendChild(this._slotElement),this._surfaceElement=l}this._updateIcon(),this.hasAttribute("sq")?(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):this._updateWidth(),r?(W({linkElement:this._surfaceElement,href:e,newTab:s,rel:n}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},e=this._resolveResponsiveSizeToken(),s=18;this.hasAttribute("sq")?s={sm:14,lg:22}[e]||18:s=t[e]||18;let n=this.getAttribute("pre");n&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",n),this._prefixIcon.setAttribute("wh",s.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let r=this.getAttribute("suf");r&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",r),this._suffixIcon.setAttribute("wh",s.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=c(this.getAttribute("w"));t==="f"?(this.style.width="var(--width-stretch)",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this.style.width=t,this.style.minWidth=t,this.style.maxWidth=t,this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},ft=({render:i,html:t})=>U;var bt=u`
253
-
254
- :host([d="h"]) {
255
- flex-direction: row;
256
- }
257
- :host([d="v"]) {
258
- flex-direction: column;
259
- }
260
- :host([d="h"]:not([ah])) {
261
- justify-content: flex-start;
262
- }
263
- :host([d="h"][ah="c"]) {
264
- justify-content: center;
265
- }
266
- :host([d="h"][ah="e"]) {
267
- justify-content: flex-end;
268
- }
269
- :host([d="h"]:not([av])) {
270
- align-items: flex-start;
271
- }
272
- :host([d="h"][av="c"]) {
273
- align-items: center;
274
- align-content: center;
275
- }
276
- :host([d="h"][av="e"]) {
277
- align-items: flex-end;
278
- align-content: flex-end;
279
- }
280
-
281
- /* Default/vertical direction - horizontal alignment */
282
- :host(:not([d]):not([ah])),
283
- :host([d="v"]:not([ah])) {
284
- align-items: flex-start;
285
- }
286
- :host(:not([d])[ah="c"]),
287
- :host([d="v"][ah="c"]) {
288
- align-items: center;
289
- }
290
- :host(:not([d])[ah="e"]),
291
- :host([d="v"][ah="e"]) {
292
- align-items: flex-end;
293
- }
294
-
295
- :host(:not([d]):not([av])),
296
- :host([d="v"]:not([av])) {
297
- justify-content: flex-start;
298
- }
299
- :host(:not([d])[av="c"]),
300
- :host([d="v"][av="c"]) {
301
- justify-content: center;
302
- }
303
- :host(:not([d])[av="e"]),
304
- :host([d="v"][av="e"]) {
305
- justify-content: flex-end;
306
- }
307
-
308
- @media screen and (max-width: 640px) {
309
- :host([sm-d="v"]) {
310
- flex-direction: column;
311
- }
312
- :host([sm-d="h"]) {
313
- flex-direction: row;
314
- }
315
- :host([sm-d="h"][sm-av="c"]) {
316
- align-items: center;
317
- align-content: center;
318
- }
319
- :host([sm-d="v"][sm-av="c"]) {
320
- justify-content: center;
321
- }
322
- }
323
- `;var Kt={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},p=b(Kt);var vt=u`
251
+ ${_t}
252
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._containerElement=null,this._surfaceElement=document.createElement("button"),this._slotElement=document.createElement("slot"),this._prefixIcon=null,this._suffixIcon=null,this._surfaceElement.className="surface",this._surfaceElement.appendChild(this._slotElement),this._onWindowResize=this._onWindowResize.bind(this)}static get observedAttributes(){return["key","href","new-tab","rel","w","pre","suf","disabled","v","s","sq","sm-s","md-s","lg-s","xl-s"]}connectedCallback(){window.addEventListener("resize",this._onWindowResize),this._updateButton()}disconnectedCallback(){window.removeEventListener("resize",this._onWindowResize)}attributeChangedCallback(t,e,s){this._updateButton()}_onWindowResize(){(this.hasAttribute("sm-s")||this.hasAttribute("md-s")||this.hasAttribute("lg-s")||this.hasAttribute("xl-s"))&&this._updateIcon()}_resolveResponsiveSizeToken(){let t=window.innerWidth;for(let{prefix:e,maxWidth:s}of ee){let r=`${e}-s`;if(t<=s&&this.hasAttribute(r))return this.getAttribute(r)}return this.getAttribute("s")}_updateButton(){this.shadow.innerHTML="";let t=this.hasAttribute("disabled"),e=this.getAttribute("href"),s=this.hasAttribute("new-tab"),r=this.getAttribute("rel"),n=e&&!t,o=n?"a":"button";if(this._surfaceElement.tagName.toLowerCase()!==o){let l=document.createElement(o);l.className="surface",l.appendChild(this._slotElement),this._surfaceElement=l}this._updateIcon(),this.hasAttribute("sq")?(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):this._updateWidth(),n?(L({linkElement:this._surfaceElement,href:e,newTab:s,rel:r}),this._surfaceElement.removeAttribute("disabled")):(this._surfaceElement.removeAttribute("href"),this._surfaceElement.removeAttribute("target"),this._surfaceElement.removeAttribute("rel"),t?this._surfaceElement.setAttribute("disabled",""):this._surfaceElement.removeAttribute("disabled")),this.shadow.appendChild(this._surfaceElement),this._containerElement=this._surfaceElement}_updateIcon(){this._prefixIcon&&(this._prefixIcon.remove(),this._prefixIcon=null),this._suffixIcon&&(this._suffixIcon.remove(),this._suffixIcon=null);let t={sm:14,md:18,lg:22},e=this._resolveResponsiveSizeToken(),s=18;this.hasAttribute("sq")?s={sm:14,lg:22}[e]||18:s=t[e]||18;let r=this.getAttribute("pre");r&&(this._prefixIcon=document.createElement("rtgl-svg"),this._prefixIcon.setAttribute("svg",r),this._prefixIcon.setAttribute("wh",s.toString()),this._prefixIcon.style.color="inherit",this._surfaceElement.insertBefore(this._prefixIcon,this._slotElement));let n=this.getAttribute("suf");n&&(this._suffixIcon=document.createElement("rtgl-svg"),this._suffixIcon.setAttribute("svg",n),this._suffixIcon.setAttribute("wh",s.toString()),this._suffixIcon.style.color="inherit",this._surfaceElement.appendChild(this._suffixIcon))}_updateWidth(){let t=c(this.getAttribute("w"));t==="f"?(this.style.width="var(--width-stretch)",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):t!=null?(this.style.width=t,this.style.minWidth=t,this.style.maxWidth=t,this._surfaceElement.style.width="100%",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth=""):(this.style.width="",this.style.minWidth="",this.style.maxWidth="",this._surfaceElement.style.width="",this._surfaceElement.style.minWidth="",this._surfaceElement.style.maxWidth="")}getBoundingClientRect(){return this._surfaceElement?this._surfaceElement.getBoundingClientRect():super.getBoundingClientRect()}},wt=({render:i,html:t})=>Y;var ie={cur:{alias:"alias","all-scroll":"all-scroll",auto:"auto",cell:"cell","col-resize":"col-resize","context-menu":"context-menu",copy:"copy",crosshair:"crosshair",default:"default","e-resize":"e-resize","ew-resize":"ew-resize",grab:"grab",grabbing:"grabbing",help:"help",move:"move","n-resize":"n-resize","ne-resize":"ne-resize","nesw-resize":"nesw-resize","ns-resize":"ns-resize","nw-resize":"nw-resize","nwse-resize":"nwse-resize","no-drop":"no-drop",none:"none","not-allowed":"not-allowed",pointer:"pointer",progress:"progress","row-resize":"row-resize","s-resize":"s-resize","se-resize":"se-resize","sw-resize":"sw-resize",text:"text",url:"url","w-resize":"w-resize",wait:"wait","zoom-in":"zoom-in","zoom-out":"zoom-out"}},p=v(ie);var H=u`
324
253
  :host([sh]:not([sv])) {
325
254
  overflow-x: scroll;
326
255
  flex-wrap: nowrap;
@@ -367,7 +296,7 @@ var rettangoli=(()=>{var O=`
367
296
  flex-wrap: nowrap;
368
297
  }
369
298
 
370
- `;var R={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Xt={bgc:{pr:`
299
+ `;var D={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},se={bgc:{pr:`
371
300
  background-color: var(--primary);
372
301
  `,se:`
373
302
  background-color: var(--secondary);
@@ -407,7 +336,7 @@ var rettangoli=(()=>{var O=`
407
336
  left: 0;
408
337
  top: 0;
409
338
  height: 100%;
410
- `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:d,pr:d,pb:d,pl:d,p:d,ph:d,pv:d,g:d,gv:d,gh:d,bw:R,bwt:R,bwr:R,bwb:R,bwl:R,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},yt=b(Xt);var Yt={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},v=b(Yt);var N=u`
339
+ `},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},pt:d,pr:d,pb:d,pl:d,p:d,ph:d,pv:d,g:d,gv:d,gh:d,bw:D,bwt:D,bwr:D,bwb:D,bwl:D,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},q=v(se);var re={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},m=v(re);var O=u`
411
340
  a, a:link, a:visited, a:hover, a:active {
412
341
  color: inherit;
413
342
  text-decoration: none;
@@ -417,7 +346,98 @@ var rettangoli=(()=>{var O=`
417
346
  margin: 0;
418
347
  font: inherit;
419
348
  }
420
- `;var K=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
349
+ `;var ne=i=>{if(i==null)return null;let t=i.trim();return t===""?null:/^[1-9]\d*$/.test(t)?`repeat(${t}, minmax(0, 1fr))`:t},Q=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
350
+ slot {
351
+ display: contents;
352
+ }
353
+ :host {
354
+ display: grid;
355
+ grid-template-columns: repeat(1, minmax(0, 1fr));
356
+ align-self: auto;
357
+ border-style: solid;
358
+ border-width: 0;
359
+ box-sizing: border-box;
360
+ border-color: var(--border);
361
+ }
362
+
363
+ ${H}
364
+ ${m}
365
+ ${p}
366
+ ${q}
367
+ ${O}
368
+ ${$}
369
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...w([...E,"cols","op","wh","w","h","hide","show","sh","sv","z","overflow"])]}_styles=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=z({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=g(),S.forEach(e=>{let s=A=>`${e==="default"?"":`${e}-`}${A}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=ne(this.getAttribute(s("cols"))),a=this.getAttribute(s("op")),h=this.getAttribute(s("z"));l!==null&&(this._styles[e]["grid-template-columns"]=l),h!==null&&(this._styles[e]["z-index"]=h),a!==null&&(this._styles[e].opacity=a),f({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="grid");let y=this.hasAttribute(s("sh")),b=this.hasAttribute(s("sv")),_=this.getAttribute(s("overflow"));y&&b?this._styles[e].overflow="scroll":y?this._styles[e]["overflow-x"]="scroll":b&&(this._styles[e]["overflow-y"]="scroll"),_==="hidden"&&(this._styles[e].overflow="hidden")});let t=x(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}e!==s&&this.updateStyles()}},xt=({render:i,html:t})=>Q;var St=u`
370
+
371
+ :host([d="h"]) {
372
+ flex-direction: row;
373
+ }
374
+ :host([d="v"]) {
375
+ flex-direction: column;
376
+ }
377
+ :host([d="h"]:not([ah])) {
378
+ justify-content: flex-start;
379
+ }
380
+ :host([d="h"][ah="c"]) {
381
+ justify-content: center;
382
+ }
383
+ :host([d="h"][ah="e"]) {
384
+ justify-content: flex-end;
385
+ }
386
+ :host([d="h"]:not([av])) {
387
+ align-items: flex-start;
388
+ }
389
+ :host([d="h"][av="c"]) {
390
+ align-items: center;
391
+ align-content: center;
392
+ }
393
+ :host([d="h"][av="e"]) {
394
+ align-items: flex-end;
395
+ align-content: flex-end;
396
+ }
397
+
398
+ /* Default/vertical direction - horizontal alignment */
399
+ :host(:not([d]):not([ah])),
400
+ :host([d="v"]:not([ah])) {
401
+ align-items: flex-start;
402
+ }
403
+ :host(:not([d])[ah="c"]),
404
+ :host([d="v"][ah="c"]) {
405
+ align-items: center;
406
+ }
407
+ :host(:not([d])[ah="e"]),
408
+ :host([d="v"][ah="e"]) {
409
+ align-items: flex-end;
410
+ }
411
+
412
+ :host(:not([d]):not([av])),
413
+ :host([d="v"]:not([av])) {
414
+ justify-content: flex-start;
415
+ }
416
+ :host(:not([d])[av="c"]),
417
+ :host([d="v"][av="c"]) {
418
+ justify-content: center;
419
+ }
420
+ :host(:not([d])[av="e"]),
421
+ :host([d="v"][av="e"]) {
422
+ justify-content: flex-end;
423
+ }
424
+
425
+ @media screen and (max-width: 640px) {
426
+ :host([sm-d="v"]) {
427
+ flex-direction: column;
428
+ }
429
+ :host([sm-d="h"]) {
430
+ flex-direction: row;
431
+ }
432
+ :host([sm-d="h"][sm-av="c"]) {
433
+ align-items: center;
434
+ align-content: center;
435
+ }
436
+ :host([sm-d="v"][sm-av="c"]) {
437
+ justify-content: center;
438
+ }
439
+ }
440
+ `;var J=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
421
441
  slot {
422
442
  display: contents;
423
443
  }
@@ -433,14 +453,14 @@ var rettangoli=(()=>{var O=`
433
453
  }
434
454
 
435
455
 
436
- ${vt}
437
- ${bt}
438
- ${v}
456
+ ${H}
457
+ ${St}
458
+ ${m}
439
459
  ${p}
440
- ${yt}
441
- ${N}
460
+ ${q}
442
461
  ${O}
443
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",..._([...A,"op","wh","w","h","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=L({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=g(),x.forEach(e=>{let s=ht=>`${e==="default"?"":`${e}-`}${ht}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),f({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="flex");let h=this.getAttribute(s("d")),m=this.getAttribute(s("ah")),y=this.getAttribute(s("av")),S=H({element:this,size:e,attr:"d"});h==="h"?this._styles[e]["flex-direction"]="row":h==="v"?this._styles[e]["flex-direction"]="column":e==="default"&&!h&&["sm","md","lg","xl"].some(Bt=>this.hasAttribute(`${Bt}-d`))&&(this._styles[e]["flex-direction"]="column");let F=S==="h",C=S==="v"||!S;F&&(m==="c"?this._styles[e]["justify-content"]="center":m==="e"?this._styles[e]["justify-content"]="flex-end":m==="s"&&(this._styles[e]["justify-content"]="flex-start"),y==="c"?(this._styles[e]["align-items"]="center",this._styles[e]["align-content"]="center"):y==="e"?(this._styles[e]["align-items"]="flex-end",this._styles[e]["align-content"]="flex-end"):y==="s"&&(this._styles[e]["align-items"]="flex-start")),C&&(m!==null||y!==null)&&(m==="c"?this._styles[e]["align-items"]="center":m==="e"?this._styles[e]["align-items"]="flex-end":m==="s"&&(this._styles[e]["align-items"]="flex-start"),y==="c"?this._styles[e]["justify-content"]="center":y==="e"?this._styles[e]["justify-content"]="flex-end":y==="s"&&(this._styles[e]["justify-content"]="flex-start"));let I=this.hasAttribute(s("wrap")),$=this.hasAttribute(s("no-wrap"));I&&(this._styles[e]["flex-wrap"]="wrap"),$&&(this._styles[e]["flex-wrap"]="nowrap");let E=this.hasAttribute(s("sh")),z=this.hasAttribute(s("sv")),j=this.getAttribute(s("overflow"));E&&z?(this._styles[e].overflow="scroll",this._styles[e]["flex-wrap"]="nowrap"):E?(this._styles[e]["overflow-x"]="scroll",this._styles[e]["flex-wrap"]="nowrap"):z&&(this._styles[e]["overflow-y"]="scroll",this._styles[e]["flex-wrap"]="nowrap"),j==="hidden"&&(this._styles[e].overflow="hidden",this._styles[e]["flex-wrap"]="nowrap")});let t=w(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}e!==s&&this.updateStyles()}},_t=({render:i,html:t})=>K;var Qt={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
462
+ ${$}
463
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._slotElement=document.createElement("slot"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return["href","new-tab","rel",...w([...E,"op","wh","w","h","ar","hide","show","sh","sv","z","d","ah","av","wrap","no-wrap","overflow"])]}_styles=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=z({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this.updateStyles()}updateStyles(){this._styles=g(),S.forEach(e=>{let s=mt=>`${e==="default"?"":`${e}-`}${mt}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z")),h=T(this.getAttribute(s("ar")));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),h!==void 0&&(this._styles[e]["aspect-ratio"]=h),f({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)",allowFlexGrow:!0}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%",allowFlexGrow:!0}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="flex");let y=this.getAttribute(s("d")),b=this.getAttribute(s("ah")),_=this.getAttribute(s("av")),A=K({element:this,size:e,attr:"d"});y==="h"?this._styles[e]["flex-direction"]="row":y==="v"?this._styles[e]["flex-direction"]="column":e==="default"&&!y&&["sm","md","lg","xl"].some(Ht=>this.hasAttribute(`${Ht}-d`))&&(this._styles[e]["flex-direction"]="column");let I=A==="h",R=A==="v"||!A;I&&(b==="c"?this._styles[e]["justify-content"]="center":b==="e"?this._styles[e]["justify-content"]="flex-end":b==="s"&&(this._styles[e]["justify-content"]="flex-start"),_==="c"?(this._styles[e]["align-items"]="center",this._styles[e]["align-content"]="center"):_==="e"?(this._styles[e]["align-items"]="flex-end",this._styles[e]["align-content"]="flex-end"):_==="s"&&(this._styles[e]["align-items"]="flex-start")),R&&(b!==null||_!==null)&&(b==="c"?this._styles[e]["align-items"]="center":b==="e"?this._styles[e]["align-items"]="flex-end":b==="s"&&(this._styles[e]["align-items"]="flex-start"),_==="c"?this._styles[e]["justify-content"]="center":_==="e"?this._styles[e]["justify-content"]="flex-end":_==="s"&&(this._styles[e]["justify-content"]="flex-start"));let B=this.hasAttribute(s("wrap")),C=this.hasAttribute(s("no-wrap"));B&&(this._styles[e]["flex-wrap"]="wrap"),C&&(this._styles[e]["flex-wrap"]="nowrap");let W=this.hasAttribute(s("sh")),P=this.hasAttribute(s("sv")),Pt=this.getAttribute(s("overflow"));W&&P?(this._styles[e].overflow="scroll",this._styles[e]["flex-wrap"]="nowrap"):W?(this._styles[e]["overflow-x"]="scroll",this._styles[e]["flex-wrap"]="nowrap"):P&&(this._styles[e]["overflow-y"]="scroll",this._styles[e]["flex-wrap"]="nowrap"),Pt==="hidden"&&(this._styles[e].overflow="hidden",this._styles[e]["flex-wrap"]="nowrap")});let t=x(this._styles);t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}e!==s&&this.updateStyles()}},Et=({render:i,html:t})=>J;var oe={ta:{s:"text-align: start;",c:"text-align: center;",e:"text-align: end;",j:"text-align: justify;"},s:{h1:`
444
464
  font-size: var(--h1-font-size);
445
465
  font-weight: var(--h1-font-weight);
446
466
  line-height: var(--h1-line-height);
@@ -480,7 +500,7 @@ var rettangoli=(()=>{var O=`
480
500
  font-weight: var(--xs-font-weight);
481
501
  line-height: var(--xs-line-height);
482
502
  letter-spacing: var(--xs-letter-spacing);
483
- `}},wt=b(Qt);var Jt={c:{pr:"color: var(--primary);",se:"color: var(--secondary);",de:"color: var(--destructive);",fg:"color: var(--foreground);",bg:"color: var(--background);",mu:"color: var(--muted-foreground);",ac:"color: var(--accent);",bo:"color: var(--border);",tr:"color: transparent;","pr-fg":"color: var(--primary-foreground);","se-fg":"color: var(--secondary-foreground);","de-fg":"color: var(--destructive-foreground);","mu-fg":"color: var(--muted-foreground);","ac-fg":"color: var(--accent-foreground);"}},V=b(Jt);var X=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
503
+ `}},At=v(oe);var le={c:{pr:"color: var(--primary);",se:"color: var(--secondary);",de:"color: var(--destructive);",fg:"color: var(--foreground);",bg:"color: var(--background);",mu:"color: var(--muted-foreground);",ac:"color: var(--accent);",bo:"color: var(--border);",tr:"color: transparent;","pr-fg":"color: var(--primary-foreground);","se-fg":"color: var(--secondary-foreground);","de-fg":"color: var(--destructive-foreground);","mu-fg":"color: var(--muted-foreground);","ac-fg":"color: var(--accent-foreground);"}},G=v(le);var Z=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
484
504
  :host {
485
505
  display: block;
486
506
  font-size: var(--md-font-size);
@@ -499,12 +519,12 @@ var rettangoli=(()=>{var O=`
499
519
  text-decoration: var(--anchor-text-decoration-hover);
500
520
  color: var(--anchor-color-hover);
501
521
  }
502
- ${O}
503
- ${wt}
504
- ${V}
505
- ${v}
522
+ ${$}
523
+ ${At}
524
+ ${G}
525
+ ${m}
506
526
  ${p}
507
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,e,s){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=c(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),G({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=L({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}},xt=({render:i,html:t})=>X;var M={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},Zt={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:M,bwt:M,bwr:M,bwb:M,bwl:M,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},St=i=>b(Zt,{},i);var te={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},Et=i=>b(te,{},i);var Y=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
527
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._slotElement=document.createElement("slot"),this._linkElement=null,this._updateDOM()}static get observedAttributes(){return["key","w","ellipsis","href","new-tab","rel"]}connectedCallback(){this._updateStyling(),this._updateDOM()}attributeChangedCallback(t,e,s){t==="href"||t==="new-tab"||t==="rel"?this._updateDOM():this._updateStyling()}_updateStyling(){let t=c(this.getAttribute("w"));this.hasAttribute("ellipsis")?(this.style.overflow="hidden",this.style.textOverflow="ellipsis",this.style.whiteSpace="nowrap"):(this.style.overflow="",this.style.textOverflow="",this.style.whiteSpace=""),M({style:this.style,width:t,flexMinWidth:"0"})}_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=z({shadowRoot:this.shadow,slotElement:this._slotElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}},kt=({render:i,html:t})=>Z;var N={none:"0",xs:"--border-width-xs",sm:"--border-width-sm",md:"--border-width-md",lg:"--border-width-lg",xl:"--border-width-xl"},ae={bgc:{pr:"background-color: var(--primary);",se:"background-color: var(--secondary);",de:"background-color: var(--destructive);",fg:"background-color: var(--foreground);",bg:"background-color: var(--background);",mu:"background-color: var(--muted);",ac:"background-color: var(--accent);",bo:"background-color: var(--border);"},pos:{rel:"relative",abs:"absolute",fix:"fixed"},shadow:{sm:"--shadow-sm",md:"--shadow-md",lg:"--shadow-lg"},bw:N,bwt:N,bwr:N,bwb:N,bwl:N,bc:{pr:"--primary",se:"--secondary",de:"--destructive",fg:"--foreground",bg:"--background",mu:"--muted",ac:"--accent",bo:"--border",tr:"transparent"},br:{xs:"--border-radius-xs",sm:"--border-radius-sm",md:"--border-radius-md",lg:"--border-radius-lg",xl:"--border-radius-xl",f:"--border-radius-f"}},Ct=i=>v(ae,{},i);var he={mt:d,mr:d,mb:d,ml:d,m:d,mh:d,mv:d},$t=i=>v(he,{},i);var tt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
508
528
  :host {
509
529
  display: contents;
510
530
  }
@@ -531,7 +551,7 @@ var rettangoli=(()=>{var O=`
531
551
  height: auto;
532
552
  }
533
553
 
534
- ${N}
554
+ ${O}
535
555
 
536
556
  a {
537
557
  display: block;
@@ -539,10 +559,165 @@ var rettangoli=(()=>{var O=`
539
559
  width: 100%;
540
560
  }
541
561
 
542
- ${St("img, a")}
543
- ${Et("img, a")}
562
+ ${Ct("img, a")}
563
+ ${$t("img, a")}
564
+ ${p}
565
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return w([...E,"key","src","alt","href","new-tab","rel","wh","w","h","ar","hide","show","op","z","of"])}_styles=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=U({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}e!==s&&this.updateStyles()}updateStyles(){this._styles=g(),S.forEach(e=>{let s=y=>`${e==="default"?"":`${e}-`}${y}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z")),h=T(this.getAttribute(s("ar")));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),h!==void 0&&(this._styles[e]["aspect-ratio"]=h),f({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none !important"),this.hasAttribute(s("show"))&&(this._styles[e].display="block !important")});let t=x(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),e=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),e!==null?this._imgElement.setAttribute("alt",e):this._imgElement.removeAttribute("alt")}},zt=({render:i,html:t})=>tt;var de={s:{sm:`
566
+ height: 20px;
567
+ padding-left: 8px;
568
+ padding-right: 8px;
569
+ gap: 6px;
570
+ font-size: var(--xs-font-size);
571
+ font-weight: var(--xs-font-weight);
572
+ line-height: var(--xs-line-height);
573
+ letter-spacing: var(--xs-letter-spacing);
574
+ --rtgl-tag-icon-size: 10px;
575
+ --rtgl-tag-remove-size: 14px;
576
+ `,md:`
577
+ height: 24px;
578
+ padding-left: 10px;
579
+ padding-right: 10px;
580
+ gap: 6px;
581
+ font-size: var(--xs-font-size);
582
+ font-weight: var(--xs-font-weight);
583
+ line-height: var(--xs-line-height);
584
+ letter-spacing: var(--xs-letter-spacing);
585
+ --rtgl-tag-icon-size: 12px;
586
+ --rtgl-tag-remove-size: 16px;
587
+ `,lg:`
588
+ height: 28px;
589
+ padding-left: 12px;
590
+ padding-right: 12px;
591
+ gap: 8px;
592
+ font-size: var(--sm-font-size);
593
+ font-weight: var(--sm-font-weight);
594
+ line-height: var(--sm-line-height);
595
+ letter-spacing: var(--sm-letter-spacing);
596
+ --rtgl-tag-icon-size: 14px;
597
+ --rtgl-tag-remove-size: 18px;
598
+ `},v:{mu:`
599
+ background-color: var(--muted);
600
+ color: var(--muted-foreground);
601
+ border-color: var(--border);
602
+ `,pr:`
603
+ background-color: var(--primary);
604
+ color: var(--primary-foreground);
605
+ border-color: transparent;
606
+ `,se:`
607
+ background-color: var(--secondary);
608
+ color: var(--secondary-foreground);
609
+ border-color: transparent;
610
+ `,ac:`
611
+ background-color: var(--accent);
612
+ color: var(--accent-foreground);
613
+ border-color: transparent;
614
+ `,de:`
615
+ background-color: var(--destructive);
616
+ color: var(--destructive-foreground);
617
+ border-color: transparent;
618
+ `}},It=v(de,{},".surface");var et=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
619
+ :host {
620
+ display: inline-flex;
621
+ min-width: 0;
622
+ }
623
+
624
+ slot {
625
+ display: contents;
626
+ }
627
+
628
+ .surface {
629
+ --rtgl-tag-icon-size: 12px;
630
+ --rtgl-tag-remove-size: 16px;
631
+ display: inline-flex;
632
+ align-items: center;
633
+ min-width: 0;
634
+ max-width: 100%;
635
+ width: 100%;
636
+ height: 24px;
637
+ padding-left: 10px;
638
+ padding-right: 10px;
639
+ gap: 6px;
640
+ box-sizing: border-box;
641
+ border: 1px solid var(--border);
642
+ border-radius: var(--tag-border-radius);
643
+ background-color: var(--muted);
644
+ color: var(--muted-foreground);
645
+ font-size: var(--xs-font-size);
646
+ font-weight: var(--xs-font-weight);
647
+ line-height: var(--xs-line-height);
648
+ letter-spacing: var(--xs-letter-spacing);
649
+ vertical-align: middle;
650
+ }
651
+
652
+ .surface rtgl-svg {
653
+ width: var(--rtgl-tag-icon-size);
654
+ height: var(--rtgl-tag-icon-size);
655
+ color: inherit;
656
+ flex-shrink: 0;
657
+ }
658
+
659
+ .label {
660
+ min-width: 0;
661
+ overflow: hidden;
662
+ text-overflow: ellipsis;
663
+ white-space: nowrap;
664
+ }
665
+
666
+ .removeButton {
667
+ position: relative;
668
+ appearance: none;
669
+ display: inline-flex;
670
+ align-items: center;
671
+ justify-content: center;
672
+ flex-shrink: 0;
673
+ width: var(--rtgl-tag-remove-size);
674
+ height: var(--rtgl-tag-remove-size);
675
+ padding: 0;
676
+ margin: 0;
677
+ border: 0;
678
+ border-radius: var(--border-radius-f);
679
+ background: transparent;
680
+ color: inherit;
681
+ opacity: 0.76;
682
+ }
683
+
684
+ .removeButton::before,
685
+ .removeButton::after {
686
+ content: "";
687
+ position: absolute;
688
+ width: calc(var(--rtgl-tag-icon-size) - 1px);
689
+ height: 1.5px;
690
+ border-radius: 1px;
691
+ background: currentColor;
692
+ }
693
+
694
+ .removeButton::before {
695
+ transform: rotate(45deg);
696
+ }
697
+
698
+ .removeButton::after {
699
+ transform: rotate(-45deg);
700
+ }
701
+
702
+ .removeButton:hover {
703
+ cursor: pointer;
704
+ opacity: 1;
705
+ background-color: color-mix(in srgb, currentColor 12%, transparent);
706
+ }
707
+
708
+ .removeButton:focus-visible {
709
+ outline: 2px solid color-mix(in srgb, currentColor 30%, transparent);
710
+ outline-offset: 1px;
711
+ opacity: 1;
712
+ }
713
+
714
+ ${It}
715
+ :host .surface {
716
+ border-radius: var(--tag-border-radius) !important;
717
+ }
718
+ ${m}
544
719
  ${p}
545
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styleElement=document.createElement("style"),this._imgElement=document.createElement("img"),this._linkElement=null,this.shadow.appendChild(this._styleElement),this._updateDOM()}static get observedAttributes(){return _([...A,"key","src","alt","href","new-tab","rel","wh","w","h","hide","show","op","z","of"])}_styles=g();_lastStyleString="";_updateDOM(){let t=this.getAttribute("href"),e=this.hasAttribute("new-tab"),s=this.getAttribute("rel");this._linkElement=P({shadowRoot:this.shadow,childElement:this._imgElement,linkElement:this._linkElement,href:t,newTab:e,rel:s})}connectedCallback(){this._updateImageAttributes(),this.updateStyles()}attributeChangedCallback(t,e,s){if(t==="href"||t==="new-tab"||t==="rel"){this._updateDOM();return}if(t==="src"||t==="alt"){this._updateImageAttributes();return}e!==s&&this.updateStyles()}updateStyles(){this._styles=g(),x.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),f({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none !important"),this.hasAttribute(s("show"))&&(this._styles[e].display="block !important")});let t=w(this._styles,"img, a");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_updateImageAttributes(){let t=this.getAttribute("src"),e=this.getAttribute("alt");t!==null?this._imgElement.setAttribute("src",t):this._imgElement.removeAttribute("src"),e!==null?this._imgElement.setAttribute("alt",e):this._imgElement.removeAttribute("alt")}},At=({render:i,html:t})=>Y;var kt=u`
720
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._surfaceElement=document.createElement("span"),this._surfaceElement.className="surface",this._surfaceElement.setAttribute("part","surface"),this._labelElement=document.createElement("span"),this._labelElement.className="label",this._labelElement.setAttribute("part","label"),this._slotElement=document.createElement("slot"),this._labelElement.appendChild(this._slotElement),this._surfaceElement.appendChild(this._labelElement),this.shadow.appendChild(this._surfaceElement),this._prefixIcon=null,this._suffixIcon=null,this._removeButton=null,this._onRemoveClick=this._onRemoveClick.bind(this)}static get observedAttributes(){return["key","pre","suf","removable","w"]}connectedCallback(){this._updateWidth(),this._updateStructure()}attributeChangedCallback(t,e,s){if(t==="w"){this._updateWidth();return}e!==s&&this._updateStructure()}_updateWidth(){let t=c(this.getAttribute("w"));M({style:this.style,width:t,flexMinWidth:"0"})}_createIconElement(t,e){let s=document.createElement("rtgl-svg");return s.className=t,s.setAttribute("part",e),s.setAttribute("aria-hidden","true"),s}_syncIcon({iconName:t,element:e,className:s,part:r,insertBeforeElement:n}){if(!t)return e&&e.remove(),null;let o=e||this._createIconElement(s,r);return o.setAttribute("svg",t),o.parentNode!==this._surfaceElement?this._surfaceElement.insertBefore(o,n):o.nextSibling!==n&&this._surfaceElement.insertBefore(o,n),o}_syncRemoveButton(){if(!this.hasAttribute("removable")){this._removeButton&&(this._removeButton.removeEventListener("click",this._onRemoveClick),this._removeButton.remove(),this._removeButton=null);return}this._removeButton||(this._removeButton=document.createElement("button"),this._removeButton.type="button",this._removeButton.className="removeButton",this._removeButton.setAttribute("part","remove-button"),this._removeButton.setAttribute("aria-label","Remove tag"),this._removeButton.addEventListener("click",this._onRemoveClick),this._surfaceElement.appendChild(this._removeButton))}_updateStructure(){this._prefixIcon=this._syncIcon({iconName:this.getAttribute("pre"),element:this._prefixIcon,className:"prefixIcon",part:"prefix-icon",insertBeforeElement:this._labelElement}),this._syncRemoveButton(),this._suffixIcon=this._syncIcon({iconName:this.getAttribute("suf"),element:this._suffixIcon,className:"suffixIcon",part:"suffix-icon",insertBeforeElement:this._removeButton})}_onRemoveClick(t){t.preventDefault(),t.stopPropagation(),this.dispatchEvent(new CustomEvent("remove-click",{detail:{value:this.getAttribute("value")},bubbles:!0,composed:!0}))}},Bt=({render:i,html:t})=>et;var Ot=u`
546
721
  :host([pt="xs"]) svg {
547
722
  padding-top: var(--spacing-xs);
548
723
  }
@@ -658,16 +833,16 @@ var rettangoli=(()=>{var O=`
658
833
  padding-top: var(--spacing-xl);
659
834
  padding-bottom: var(--spacing-xl);
660
835
  }
661
- `;var Q=class i extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
836
+ `;var it=class i extends HTMLElement{static styleSheet=null;static _icons={};static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
662
837
  :host {
663
838
  color: var(--foreground);
664
839
  flex-shrink: 0;
665
840
  }
666
- ${V}
667
- ${kt}
668
- ${v}
841
+ ${G}
842
+ ${Ot}
843
+ ${m}
669
844
  ${p}
670
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return i._icons}static addIcon(t,e){i._icons[t]=e}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,e,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),e=c(t===null?this.getAttribute("w"):t),s=c(t===null?this.getAttribute("h"):t);e!=null?this.style.width=e:this.style.width="",s!=null?this.style.height=s:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),e=i._icons[t]||(window.rtglIcons||{})[t];if(e){this.shadow.innerHTML=e;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Ct=({render:i,html:t})=>Q;var ee=["mt","mr","mb","ml","m","mh","mv","cur"],J=class i extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","min","max","step","s"];static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
845
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet]}static get observedAttributes(){return["key","svg","w","h","wh"]}static get icons(){return i._icons}static addIcon(t,e){i._icons[t]=e}connectedCallback(){this._updateSizing(),this._render()}attributeChangedCallback(t,e,s){this._updateSizing(),this._render()}_updateSizing(){let t=this.getAttribute("wh"),e=c(t===null?this.getAttribute("w"):t),s=c(t===null?this.getAttribute("h"):t);e!=null?this.style.width=e:this.style.width="",s!=null?this.style.height=s:this.style.height=""}_render(){try{let t=this.getAttribute("svg"),e=i._icons[t]||(window.rtglIcons||{})[t];if(e){this.shadow.innerHTML=e;return}}catch(t){console.log("error in rtgl-svg render",t)}this.shadow.innerHTML=""}},Rt=({render:i,html:t})=>it;var ue=["mt","mr","mb","ml","m","mh","mv","cur"],st=class i extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["type","disabled","min","max","step","s"];static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
671
846
  :host {
672
847
  display: contents;
673
848
  }
@@ -729,9 +904,9 @@ var rettangoli=(()=>{var O=`
729
904
  input[type="datetime-local"]::-webkit-date-and-time-value {
730
905
  text-align: left;
731
906
  }
732
- ${v}
907
+ ${m}
733
908
  ${p}
734
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",..._([...ee,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(i.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=g(),x.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),f({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=w(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,e){if(e==null||e==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,e)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),s=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",n=this.getAttribute("min"),r=this.getAttribute("max"),o=this.getAttribute("step"),l=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",s),this._setOrRemoveInputAttribute("min",n),this._setOrRemoveInputAttribute("max",r),this._setOrRemoveInputAttribute("step",o),l?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},k=({render:i,html:t})=>J;var ie=k({}),T="date",Z=class extends ie{connectedCallback(){this.getAttribute("type")!==T&&super.setAttribute("type",T),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==T){this.getAttribute("type")!==T&&super.setAttribute("type",T);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},$t=({render:i,html:t})=>Z;var se=k({}),B="time",tt=class extends se{connectedCallback(){this.getAttribute("type")!==B&&super.setAttribute("type",B),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==B){this.getAttribute("type")!==B&&super.setAttribute("type",B);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},It=({render:i,html:t})=>tt;var ne=k({}),D="datetime-local",et=class extends ne{connectedCallback(){this.getAttribute("type")!==D&&super.setAttribute("type",D),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==D){this.getAttribute("type")!==D&&super.setAttribute("type",D);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},zt=({render:i,html:t})=>et;var re=["mt","mr","mb","ml","m","mh","mv","cur"],it=class i extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["disabled","step","min","max","s"];static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
909
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","type","placeholder","disabled","value","min","max","step","s",...w([...ue,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(i.inputSpecificAttributes.includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=g(),S.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),f({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=x(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,e){if(e==null||e==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,e)}_syncValueAttribute(){this._inputElement.value=this.getAttribute("value")??""}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("type"),s=new Set(["text","password","date","time","datetime-local"]).has(t)?t:"text",r=this.getAttribute("min"),n=this.getAttribute("max"),o=this.getAttribute("step"),l=this.hasAttribute("disabled");this._setOrRemoveInputAttribute("type",s),this._setOrRemoveInputAttribute("min",r),this._setOrRemoveInputAttribute("max",n),this._setOrRemoveInputAttribute("step",o),l?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},k=({render:i,html:t})=>st;var ce=k({}),V="date",rt=class extends ce{connectedCallback(){this.getAttribute("type")!==V&&super.setAttribute("type",V),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==V){this.getAttribute("type")!==V&&super.setAttribute("type",V);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Wt=({render:i,html:t})=>rt;var pe=k({}),F="time",nt=class extends pe{connectedCallback(){this.getAttribute("type")!==F&&super.setAttribute("type",F),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==F){this.getAttribute("type")!==F&&super.setAttribute("type",F);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Lt=({render:i,html:t})=>nt;var me=k({}),j="datetime-local",ot=class extends me{connectedCallback(){this.getAttribute("type")!==j&&super.setAttribute("type",j),super.connectedCallback&&super.connectedCallback()}attributeChangedCallback(t,e,s){if(t==="type"&&s!==j){this.getAttribute("type")!==j&&super.setAttribute("type",j);return}super.attributeChangedCallback&&super.attributeChangedCallback(t,e,s)}},Mt=({render:i,html:t})=>ot;var ge=["mt","mr","mb","ml","m","mh","mv","cur"],lt=class i extends HTMLElement{static styleSheet=null;static inputSpecificAttributes=["disabled","step","min","max","s"];static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
735
910
  :host {
736
911
  display: contents;
737
912
  }
@@ -764,9 +939,9 @@ var rettangoli=(()=>{var O=`
764
939
  input:disabled {
765
940
  cursor: not-allowed;
766
941
  }
767
- ${v}
942
+ ${m}
768
943
  ${p}
769
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",..._([...re,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let e=this._inputElement.value;if(e.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let s=parseFloat(e);isNaN(s)||(s=this._clampValueToBounds(s),this._inputElement.value=s.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:s},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(i.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=g(),x.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),f({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=w(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,e){if(e==null||e==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,e)}_clampValueToBounds(t){let e=t,s=this.getAttribute("min");if(s!==null){let r=parseFloat(s);isNaN(r)||(e=Math.max(e,r))}let n=this.getAttribute("max");if(n!==null){let r=parseFloat(n);isNaN(r)||(e=Math.min(e,r))}return e}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let e=parseFloat(t);if(isNaN(e)){this._inputElement.value="";return}let s=this._clampValueToBounds(e);this._inputElement.value=s.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),e=this.getAttribute("min"),s=this.getAttribute("max"),n=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",e),this._setOrRemoveInputAttribute("max",s),n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Ot=({render:i,html:t})=>it;var st=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
944
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","placeholder","disabled","value","step","min","max","s",...w([...ge,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}focus(){this._inputElement.focus()}_emitValueEvent=t=>{let e=this._inputElement.value;if(e.trim()===""){this.dispatchEvent(new CustomEvent(t,{detail:{value:null},bubbles:!0}));return}let s=parseFloat(e);isNaN(s)||(s=this._clampValueToBounds(s),this._inputElement.value=s.toString(),this.dispatchEvent(new CustomEvent(t,{detail:{value:s},bubbles:!0})))};_onInput=()=>{this._emitValueEvent("value-input")};_onChange=()=>{this._emitValueEvent("value-change")};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(t==="value"){this._syncValueAttribute();return}if(t==="placeholder"){this._syncPlaceholderAttribute();return}if(i.inputSpecificAttributes.includes(t)){this._updateInputAttributes(),(t==="min"||t==="max")&&this._syncValueAttribute();return}this.updateStyles()}}updateStyles(){this._styles=g(),S.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),f({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=x(this._styles,"input");t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_setOrRemoveInputAttribute(t,e){if(e==null||e==="null"){this._inputElement.removeAttribute(t);return}this._inputElement.setAttribute(t,e)}_clampValueToBounds(t){let e=t,s=this.getAttribute("min");if(s!==null){let n=parseFloat(s);isNaN(n)||(e=Math.max(e,n))}let r=this.getAttribute("max");if(r!==null){let n=parseFloat(r);isNaN(n)||(e=Math.min(e,n))}return e}_syncValueAttribute(){let t=this.getAttribute("value");if(t==null||t===""){this._inputElement.value="";return}let e=parseFloat(t);if(isNaN(e)){this._inputElement.value="";return}let s=this._clampValueToBounds(e);this._inputElement.value=s.toString()}_syncPlaceholderAttribute(){this._setOrRemoveInputAttribute("placeholder",this.getAttribute("placeholder"))}_updateInputAttributes(){let t=this.getAttribute("step"),e=this.getAttribute("min"),s=this.getAttribute("max"),r=this.hasAttribute("disabled");this._inputElement.setAttribute("type","number"),this._setOrRemoveInputAttribute("step",t),this._setOrRemoveInputAttribute("min",e),this._setOrRemoveInputAttribute("max",s),r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this._syncValueAttribute(),this._syncPlaceholderAttribute(),this.updateStyles()}},Tt=({render:i,html:t})=>lt;var at=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
770
945
  :host {
771
946
  display: contents;
772
947
  }
@@ -792,9 +967,9 @@ var rettangoli=(()=>{var O=`
792
967
  textarea:disabled {
793
968
  cursor: not-allowed;
794
969
  }
795
- ${v}
970
+ ${m}
796
971
  ${p}
797
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",..._([...A,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,e,s){if(t==="key"){requestAnimationFrame(()=>{let r=this.getAttribute("value");this._textareaElement.value=r??""});return}if(t==="value"&&requestAnimationFrame(()=>{let r=this.getAttribute("value");this._textareaElement.value=r??""}),t==="placeholder"&&requestAnimationFrame(()=>{let r=this.getAttribute("placeholder");r===void 0||r==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",r??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(r=>{let o=S=>`${r==="default"?"":`${r}-`}${S}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),m=this.getAttribute(o("op")),y=this.getAttribute(o("z"));y!==null&&(this._styles[r]["z-index"]=y),m!==null&&(this._styles[r].opacity=m),a==="f"?this._styles[r].width="var(--width-stretch)":a!==void 0&&(this._styles[r].width=a,this._styles[r]["min-width"]=a,this._styles[r]["max-width"]=a),h==="f"?this._styles[r].height="100%":h!==void 0&&(this._styles[r].height=h,this._styles[r]["min-height"]=h,this._styles[r]["max-height"]=h),this.hasAttribute(o("hide"))&&(this._styles[r].display="none"),this.hasAttribute(o("show"))&&(this._styles[r].display="block")});let n=w(this._styles,"textarea");n!==this._lastStyleString&&(this._styleElement.textContent=n,this._lastStyleString=n)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),e=this.getAttribute("rows"),s=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),e!==null?this._textareaElement.setAttribute("rows",e):this._textareaElement.removeAttribute("rows"),s?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Wt=({render:i,html:t})=>st;var oe=["mt","mr","mb","ml","m","mh","mv","cur"],le=/^#[0-9a-fA-F]{6}$/,nt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
972
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._textareaElement=document.createElement("textarea"),this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._textareaElement),this._textareaElement.addEventListener("input",this._onInput),this._textareaElement.addEventListener("change",this._onChange)}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._textareaElement.value},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._textareaElement.value},bubbles:!0}))};static get observedAttributes(){return["key","placeholder","disabled","value","cols","rows",...w([...E,"wh","w","h","hide","show","op","z"])]}get value(){return this._textareaElement.value}set value(t){this._textareaElement.value=t}connectedCallback(){this._updateTextareaAttributes()}focus(){this._textareaElement&&this._textareaElement.focus()}select(){this._textareaElement&&this._textareaElement.select()}attributeChangedCallback(t,e,s){if(t==="key"){requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""});return}if(t==="value"&&requestAnimationFrame(()=>{let n=this.getAttribute("value");this._textareaElement.value=n??""}),t==="placeholder"&&requestAnimationFrame(()=>{let n=this.getAttribute("placeholder");n===void 0||n==="null"?this._textareaElement.removeAttribute("placeholder"):this._textareaElement.setAttribute("placeholder",n??"")}),["cols","rows","disabled"].includes(t)){this._updateTextareaAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=_=>`${n==="default"?"":`${n}-`}${_}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),y=this.getAttribute(o("op")),b=this.getAttribute(o("z"));b!==null&&(this._styles[n]["z-index"]=b),y!==null&&(this._styles[n].opacity=y),a==="f"?this._styles[n].width="var(--width-stretch)":a!==void 0&&(this._styles[n].width=a,this._styles[n]["min-width"]=a,this._styles[n]["max-width"]=a),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=x(this._styles,"textarea");r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateTextareaAttributes(){let t=this.getAttribute("cols"),e=this.getAttribute("rows"),s=this.hasAttribute("disabled");t!==null?this._textareaElement.setAttribute("cols",t):this._textareaElement.removeAttribute("cols"),e!==null?this._textareaElement.setAttribute("rows",e):this._textareaElement.removeAttribute("rows"),s?this._textareaElement.setAttribute("disabled",""):this._textareaElement.removeAttribute("disabled")}},Dt=({render:i,html:t})=>at;var fe=["mt","mr","mb","ml","m","mh","mv","cur"],be=/^#[0-9a-fA-F]{6}$/,ht=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
798
973
  :host {
799
974
  display: contents;
800
975
  }
@@ -815,9 +990,9 @@ var rettangoli=(()=>{var O=`
815
990
  cursor: not-allowed;
816
991
  opacity: 0.5;
817
992
  }
818
- ${v}
993
+ ${m}
819
994
  ${p}
820
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",..._([...oe,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=g(),x.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,n=this.getAttribute(s("wh")),r=c(n===null?this.getAttribute(s("w")):n),o=c(n===null?this.getAttribute(s("h")):n),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),f({styleBucket:this._styles[e],axis:"width",dimension:r,fillValue:"var(--width-stretch)"}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=w(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=le.test(t)?t:"#000000"}_updateInputAttributes(){let t=this.hasAttribute("disabled");this._syncValueAttribute(),t?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this.updateStyles()}},Lt=({render:i,html:t})=>nt;var rt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
995
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles=g(),this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="color",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("change",this._onChange),this._inputElement.addEventListener("input",this._onInput)}static get observedAttributes(){return["key","value","disabled",...w([...fe,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:this._inputElement.value},bubbles:!0}))};_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:this._inputElement.value},bubbles:!0}))};attributeChangedCallback(t,e,s){if(e!==s){if(t==="key"){this._syncValueAttribute();return}if(["value","disabled"].includes(t)){this._updateInputAttributes();return}this.updateStyles()}}updateStyles(){this._styles=g(),S.forEach(e=>{let s=h=>`${e==="default"?"":`${e}-`}${h}`,r=this.getAttribute(s("wh")),n=c(r===null?this.getAttribute(s("w")):r),o=c(r===null?this.getAttribute(s("h")):r),l=this.getAttribute(s("op")),a=this.getAttribute(s("z"));a!==null&&(this._styles[e]["z-index"]=a),l!==null&&(this._styles[e].opacity=l),f({styleBucket:this._styles[e],axis:"width",dimension:n,fillValue:"var(--width-stretch)"}),f({styleBucket:this._styles[e],axis:"height",dimension:o,fillValue:"100%"}),this.hasAttribute(s("hide"))&&(this._styles[e].display="none"),this.hasAttribute(s("show"))&&(this._styles[e].display="block")});let t=x(this._styles,'input[type="color"]');t!==this._lastStyleString&&(this._styleElement.textContent=t,this._lastStyleString=t)}_syncValueAttribute(){let t=this.getAttribute("value");if(t===null){this._inputElement.value="#000000";return}this._inputElement.value=be.test(t)?t:"#000000"}_updateInputAttributes(){let t=this.hasAttribute("disabled");this._syncValueAttribute(),t?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes(),this.updateStyles()}},Nt=({render:i,html:t})=>ht;var dt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
821
996
  :host {
822
997
  display: contents;
823
998
  }
@@ -869,9 +1044,9 @@ var rettangoli=(()=>{var O=`
869
1044
  input[type="range"]:disabled::-moz-range-thumb {
870
1045
  cursor: not-allowed;
871
1046
  }
872
- ${v}
1047
+ ${m}
873
1048
  ${p}
874
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",..._([...A,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,e,s){if(t==="key"&&e!==s){requestAnimationFrame(()=>{let r=this.getAttribute("value"),o=this.getAttribute("min")||"0";this._inputElement.value=r??o});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(r=>{let o=S=>`${r==="default"?"":`${r}-`}${S}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),m=this.getAttribute(o("op")),y=this.getAttribute(o("z"));y!==null&&(this._styles[r]["z-index"]=y),m!==null&&(this._styles[r].opacity=m),a==="f"?this._styles[r].width="var(--width-stretch)":a!==void 0&&(this._styles[r].width=a,this._styles[r]["min-width"]=a,this._styles[r]["max-width"]=a),h==="f"?this._styles[r].height="100%":h!==void 0&&(this._styles[r].height=h,this._styles[r]["min-height"]=h,this._styles[r]["max-height"]=h),this.hasAttribute(o("hide"))&&(this._styles[r].display="none"),this.hasAttribute(o("show"))&&(this._styles[r].display="block")});let n=w(this._styles,'input[type="range"]');n!==this._lastStyleString&&(this._styleElement.textContent=n,this._lastStyleString=n)}_updateInputAttributes(){let t=this.getAttribute("value"),e=this.getAttribute("min"),s=this.getAttribute("max"),n=this.getAttribute("step"),r=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=e??0,e!==null?this._inputElement.min=e:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",n!==null?this._inputElement.step=n:this._inputElement.step="1",r?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Rt=({render:i,html:t})=>rt;var ot=40,ae=6,lt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
1049
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._styles={default:{},sm:{},md:{},lg:{},xl:{}},this._lastStyleString="",this._inputElement=document.createElement("input"),this._inputElement.type="range",this._styleElement=document.createElement("style"),this.shadow.appendChild(this._styleElement),this.shadow.appendChild(this._inputElement),this._inputElement.addEventListener("input",this._onInput),this._inputElement.addEventListener("change",this._onChange)}static get observedAttributes(){return["key","value","min","max","step","disabled",...w([...E,"wh","w","h","hide","show","op","z"])]}get value(){return this._inputElement.value}set value(t){this._inputElement.value=t}_onInput=()=>{this.dispatchEvent(new CustomEvent("value-input",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};_onChange=()=>{this.dispatchEvent(new CustomEvent("value-change",{detail:{value:Number(this._inputElement.value)},bubbles:!0}))};attributeChangedCallback(t,e,s){if(t==="key"&&e!==s){requestAnimationFrame(()=>{let n=this.getAttribute("value"),o=this.getAttribute("min")||"0";this._inputElement.value=n??o});return}if(["value","min","max","step","disabled"].includes(t)){this._updateInputAttributes();return}this._styles={default:{},sm:{},md:{},lg:{},xl:{}},["default","sm","md","lg","xl"].forEach(n=>{let o=_=>`${n==="default"?"":`${n}-`}${_}`,l=this.getAttribute(o("wh")),a=c(l===null?this.getAttribute(o("w")):l),h=c(l===null?this.getAttribute(o("h")):l),y=this.getAttribute(o("op")),b=this.getAttribute(o("z"));b!==null&&(this._styles[n]["z-index"]=b),y!==null&&(this._styles[n].opacity=y),a==="f"?this._styles[n].width="var(--width-stretch)":a!==void 0&&(this._styles[n].width=a,this._styles[n]["min-width"]=a,this._styles[n]["max-width"]=a),h==="f"?this._styles[n].height="100%":h!==void 0&&(this._styles[n].height=h,this._styles[n]["min-height"]=h,this._styles[n]["max-height"]=h),this.hasAttribute(o("hide"))&&(this._styles[n].display="none"),this.hasAttribute(o("show"))&&(this._styles[n].display="block")});let r=x(this._styles,'input[type="range"]');r!==this._lastStyleString&&(this._styleElement.textContent=r,this._lastStyleString=r)}_updateInputAttributes(){let t=this.getAttribute("value"),e=this.getAttribute("min"),s=this.getAttribute("max"),r=this.getAttribute("step"),n=this.hasAttribute("disabled");t!==null?this._inputElement.value=t:this._inputElement.value=e??0,e!==null?this._inputElement.min=e:this._inputElement.min="0",s!==null?this._inputElement.max=s:this._inputElement.max="100",r!==null?this._inputElement.step=r:this._inputElement.step="1",n?this._inputElement.setAttribute("disabled",""):this._inputElement.removeAttribute("disabled")}connectedCallback(){this._updateInputAttributes()}},Vt=({render:i,html:t})=>dt;var ut=40,ve=6,ct=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
875
1050
  :host {
876
1051
  display: contents;
877
1052
  }
@@ -948,7 +1123,7 @@ var rettangoli=(()=>{var O=`
948
1123
  animation: none;
949
1124
  }
950
1125
  }
951
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0}))}_hideModal(){this._dialogElement.open&&(this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=t,this._observedContentElement&&this._resizeObserver.observe(this._observedContentElement))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),e=t?Math.round(t.getBoundingClientRect().height):0;if(e<=0){this._layoutRetryCount<ae&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let s=window.innerHeight;if(e>=s-2*ot){this._slotElement.style.marginTop=`${ot}px`,this._slotElement.style.marginBottom=`${ot}px`,this._dialogElement.style.height="100vh";return}let n=s-e,r=Math.floor(n/2);this._slotElement.style.marginTop=`${r}px`,this._slotElement.style.marginBottom=`${r}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},Mt=({render:i,html:t})=>lt;var at=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
1126
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._slotElement=null,this._isConnected=!1,this._adaptiveFrameId=null,this._layoutRetryCount=0,this._observedContentElement=null,this._resizeObserver=typeof ResizeObserver<"u"?new ResizeObserver(()=>{this._scheduleAdaptiveCentering()}):null,this._onSlotChange=()=>{this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0})},this._onWindowResize=()=>{this._scheduleAdaptiveCentering({resetRetries:!0})},this._mouseDownInContent=!1,this._dialogElement.addEventListener("mousedown",t=>{this._mouseDownInContent=t.target!==this._dialogElement}),this._dialogElement.addEventListener("click",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&this._attemptClose(),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("contextmenu",t=>{t.target===this._dialogElement&&!this._mouseDownInContent&&(t.preventDefault(),this._attemptClose()),this._mouseDownInContent=!1}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._attemptClose()})}_attemptClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","w","s"]}connectedCallback(){this._updateDialog(),this._isConnected=!0,this.hasAttribute("open")&&this._showModal()}disconnectedCallback(){this._isConnected=!1,this._stopAdaptiveObservers(),this._slotElement&&this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._dialogElement.open&&this._isConnected?this._showModal():s===null&&this._dialogElement.open&&this._hideModal():t==="w"&&this._updateWidth()}_updateDialog(){this._updateWidth()}_updateWidth(){let t=this.getAttribute("w");t?this._dialogElement.style.width=t:this._dialogElement.style.width=""}_showModal(){this._dialogElement.open||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._slotElement.addEventListener("slotchange",this._onSlotChange),this._dialogElement.appendChild(this._slotElement)),this._dialogElement.showModal(),this._dialogElement.scrollTop=0,window.addEventListener("resize",this._onWindowResize),this._observeAssignedContent(),this._scheduleAdaptiveCentering({resetRetries:!0}))}_hideModal(){this._dialogElement.open&&(this._stopAdaptiveObservers(),this._dialogElement.close(),this._slotElement&&(this._slotElement.removeEventListener("slotchange",this._onSlotChange),this._slotElement.style.marginTop="",this._slotElement.style.marginBottom="",this._dialogElement.removeChild(this._slotElement),this._slotElement=null),this._dialogElement.style.height="")}_stopAdaptiveObservers(){this._adaptiveFrameId!==null&&(cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=null),this._layoutRetryCount=0,window.removeEventListener("resize",this._onWindowResize),this._resizeObserver&&this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=null}_getAssignedContentElement(){if(!this._slotElement)return null;let t=this._slotElement.assignedElements({flatten:!0});return t.length>0?t[0]:null}_observeAssignedContent(){if(!this._resizeObserver)return;let t=this._getAssignedContentElement();this._observedContentElement!==t&&(this._observedContentElement&&this._resizeObserver.unobserve(this._observedContentElement),this._observedContentElement=t,this._observedContentElement&&this._resizeObserver.observe(this._observedContentElement))}_scheduleAdaptiveCentering({resetRetries:t=!1}={}){!this._slotElement||!this._dialogElement.open||(t&&(this._layoutRetryCount=0),this._adaptiveFrameId!==null&&cancelAnimationFrame(this._adaptiveFrameId),this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=requestAnimationFrame(()=>{this._adaptiveFrameId=null,this._applyAdaptiveCentering()})}))}_applyAdaptiveCentering(){if(!this._slotElement||!this._dialogElement.open)return;this._observeAssignedContent();let t=this._getAssignedContentElement(),e=t?Math.round(t.getBoundingClientRect().height):0;if(e<=0){this._layoutRetryCount<ve&&(this._layoutRetryCount+=1,this._scheduleAdaptiveCentering());return}this._layoutRetryCount=0;let s=window.innerHeight;if(e>=s-2*ut){this._slotElement.style.marginTop=`${ut}px`,this._slotElement.style.marginBottom=`${ut}px`,this._dialogElement.style.height="100vh";return}let r=s-e,n=Math.floor(r/2);this._slotElement.style.marginTop=`${n}px`,this._slotElement.style.marginBottom=`${n}px`,this._dialogElement.style.height="auto"}get dialog(){return this._dialogElement}},Ft=({render:i,html:t})=>ct;var pt=class i extends HTMLElement{static styleSheet=null;static initializeStyleSheet(){i.styleSheet||(i.styleSheet=new CSSStyleSheet,i.styleSheet.replaceSync(u`
952
1127
  :host {
953
1128
  display: contents;
954
1129
  }
@@ -1002,4 +1177,4 @@ var rettangoli=(()=>{var O=`
1002
1177
  min-width: 200px;
1003
1178
  max-width: 400px;
1004
1179
  }
1005
- `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&e!==s&&this._isOpen&&(this._hide(),this._show())}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),e=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let n=this._popoverContainer.getBoundingClientRect(),{left:r,top:o}=this._calculatePosition(t,e,n.width,n.height,s);this._popoverContainer.style.left=`${r}px`,this._popoverContainer.style.top=`${o}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,e,s,n,r){let l=t,a=e;switch(r){case"t":l=t-s/2,a=e-n-8;break;case"ts":l=t,a=e-n-8;break;case"te":l=t-s,a=e-n-8;break;case"r":l=t+8,a=e-n/2;break;case"rs":l=t+8,a=e;break;case"re":l=t+8,a=e-n;break;case"b":l=t-s/2,a=e+8;break;case"bs":l=t,a=e+8;break;case"be":l=t-s,a=e+8;break;case"l":l=t-s-8,a=e-n/2;break;case"ls":l=t-s-8,a=e;break;case"le":l=t-s-8,a=e-n;break;default:l=t,a=e+8;break}let h=8;return l=Math.max(h,Math.min(l,window.innerWidth-s-h)),a=Math.max(h,Math.min(a,window.innerHeight-n-h)),{left:l,top:a}}get popover(){return this._popoverContainer}},Tt=({render:i,html:t})=>at;customElements.define("rtgl-button",ft({}));customElements.define("rtgl-view",_t({}));customElements.define("rtgl-text",xt({}));customElements.define("rtgl-image",At({}));customElements.define("rtgl-svg",Ct({}));customElements.define("rtgl-input",k({}));customElements.define("rtgl-input-date",$t({}));customElements.define("rtgl-input-time",It({}));customElements.define("rtgl-input-datetime",zt({}));customElements.define("rtgl-input-number",Ot({}));customElements.define("rtgl-textarea",Wt({}));customElements.define("rtgl-color-picker",Lt({}));customElements.define("rtgl-slider",Rt({}));customElements.define("rtgl-dialog",Mt({}));customElements.define("rtgl-popover",Tt({}));})();
1180
+ `))}constructor(){super(),i.initializeStyleSheet(),this.shadow=this.attachShadow({mode:"open"}),this.shadow.adoptedStyleSheets=[i.styleSheet],this._dialogElement=document.createElement("dialog"),this.shadow.appendChild(this._dialogElement),this._dialogElement.addEventListener("click",t=>{t.stopPropagation();let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&this._emitClose()}),this._dialogElement.addEventListener("contextmenu",t=>{let e=t.composedPath();(e[0]===this._dialogElement||e[0].nodeName==="DIALOG"&&e[0]===this._dialogElement)&&(t.preventDefault(),this._emitClose())}),this._dialogElement.addEventListener("cancel",t=>{t.preventDefault(),this._emitClose()}),this._popoverContainer=document.createElement("div"),this._popoverContainer.className="popover-container",this._dialogElement.appendChild(this._popoverContainer),this._slotElement=null,this._isOpen=!1}_emitClose(){this.dispatchEvent(new CustomEvent("close",{detail:{},bubbles:!0}))}static get observedAttributes(){return["open","x","y","place","no-overlay"]}connectedCallback(){this.hasAttribute("open")&&this._show()}disconnectedCallback(){this._isOpen&&this._dialogElement.open&&this._dialogElement.close()}attributeChangedCallback(t,e,s){t==="open"?s!==null&&!this._isOpen?this.isConnected&&this._show():s===null&&this._isOpen&&this._hide():(t==="x"||t==="y"||t==="place")&&this._isOpen?this._updatePosition():t==="no-overlay"&&e!==s&&this._isOpen&&(this._hide(),this._show())}_show(){this._isOpen||(this._slotElement||(this._slotElement=document.createElement("slot"),this._slotElement.setAttribute("name","content"),this._popoverContainer.appendChild(this._slotElement)),this._isOpen=!0,this._dialogElement.open||setTimeout(()=>{this._dialogElement&&!this._dialogElement.open&&(this.hasAttribute("no-overlay")?this._dialogElement.show():this._dialogElement.showModal())},0),requestAnimationFrame(()=>{this._updatePosition()}))}_hide(){this._isOpen&&(this._isOpen=!1,this._dialogElement.open&&this._dialogElement.close(),this._slotElement&&(this._popoverContainer.removeChild(this._slotElement),this._slotElement=null))}_updatePosition(){let t=parseFloat(this.getAttribute("x")||"0"),e=parseFloat(this.getAttribute("y")||"0"),s=this.getAttribute("place")||"bs";this.removeAttribute("positioned"),requestAnimationFrame(()=>{let r=this._popoverContainer.getBoundingClientRect(),{left:n,top:o}=this._calculatePosition(t,e,r.width,r.height,s);this._popoverContainer.style.left=`${n}px`,this._popoverContainer.style.top=`${o}px`,requestAnimationFrame(()=>{this.setAttribute("positioned","")})})}_calculatePosition(t,e,s,r,n){let l=t,a=e;switch(n){case"t":l=t-s/2,a=e-r-8;break;case"ts":l=t,a=e-r-8;break;case"te":l=t-s,a=e-r-8;break;case"r":l=t+8,a=e-r/2;break;case"rs":l=t+8,a=e;break;case"re":l=t+8,a=e-r;break;case"b":l=t-s/2,a=e+8;break;case"bs":l=t,a=e+8;break;case"be":l=t-s,a=e+8;break;case"l":l=t-s-8,a=e-r/2;break;case"ls":l=t-s-8,a=e;break;case"le":l=t-s-8,a=e-r;break;default:l=t,a=e+8;break}let h=8;return l=Math.max(h,Math.min(l,window.innerWidth-s-h)),a=Math.max(h,Math.min(a,window.innerHeight-r-h)),{left:l,top:a}}get popover(){return this._popoverContainer}},jt=({render:i,html:t})=>pt;customElements.define("rtgl-button",wt({}));customElements.define("rtgl-grid",xt({}));customElements.define("rtgl-view",Et({}));customElements.define("rtgl-text",kt({}));customElements.define("rtgl-image",zt({}));customElements.define("rtgl-tag",Bt({}));customElements.define("rtgl-svg",Rt({}));customElements.define("rtgl-input",k({}));customElements.define("rtgl-input-date",Wt({}));customElements.define("rtgl-input-time",Lt({}));customElements.define("rtgl-input-datetime",Mt({}));customElements.define("rtgl-input-number",Tt({}));customElements.define("rtgl-textarea",Dt({}));customElements.define("rtgl-color-picker",Nt({}));customElements.define("rtgl-slider",Vt({}));customElements.define("rtgl-dialog",Ft({}));customElements.define("rtgl-popover",jt({}));})();