@jsswift/ui 1.0.49 → 1.0.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/min-ui.js +3 -3
- package/dist/ui.js +12 -2
- package/dist/ui.min.js +3 -3
- package/package.json +2 -2
- package/src/10-primitives-layout.js +12 -2
package/dist/ui.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(He){var Cl;He.ui=He.ui||{},He.services=He.services||{},He.services.notify=He.services.notify||{};const ts=Symbol("cms.ui.rodPathRaw"),Fn=Symbol("cms.ui.rodPathEnhanced"),As=Symbol("cms.ui.rodPathPatchedH"),On=Symbol("cms.ui.rodPathWrappedUI"),xn=new WeakMap,Is=new WeakMap,zs=new WeakMap,Ht=[],Ps=t=>{if(typeof t=="number")return Number.isInteger(t)&&t>=0;if(typeof t!="string"||t===""||t[0]==="-"||t.includes("."))return!1;const e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t},ns=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"},ln=t=>{if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};let ss=!1;const Yl=()=>{ss||(ss=!0,queueMicrotask(()=>{ss=!1,Ht.length=0}))},ql=t=>{Ht.push(t),Ht.length>128&&Ht.splice(0,Ht.length-128),Yl()},Js=()=>{if(!Ht.length)return null;const t=Ht.slice();return Ht.length=0,{items:t,index:0}},Es=(t,e)=>{if(!t)return null;const n=t.items[t.index];return!n||!Object.is(n.value,e)?null:(t.index+=1,n)},ls=t=>t&&typeof t=="object"&&t[ts]?t[ts]:t,os=(t,e)=>{const n=xn.get(t);if(!n)return;let s=n.rawGet();for(const o of e){if(s==null)return;s=s[o]}return s},Xl=(t,e,n)=>{const s=xn.get(t);if(!s)return;const o=ls(n);if(!e.length){if(Object.is(s.rawGet(),o))return;s.rawSet(o);return}let r=s.rawGet();(!r||typeof r!="object")&&(r=Ps(e[0])?[]:{});let v=r;for(let u=0;u<e.length-1;u++){const i=e[u];let b=v[i];if(!b||typeof b!="object"){const R=e[u+1];b=Ps(R)?[]:{},v[i]=b}v=b}Object.is(v[e[e.length-1]],o)||(v[e[e.length-1]]=o,s.rawSet(r))},Ts=(t,e)=>[()=>os(t,e),n=>Xl(t,e,n)],Rs=(t,e,n=[])=>{if(!e||typeof e!="object")return e;let s=Is.get(t);s||(s=new WeakMap,Is.set(t,s));const o=s.get(e);if(o)return o;const r=new Proxy(e,{get(v,u,i){if(u===ts)return v;const b=Reflect.get(v,u,i);if(typeof u=="symbol")return b;const R=n.concat(u);return b&&typeof b=="object"?Rs(t,b,R):typeof b=="function"?b.bind(i):(ns(b)&&ql({rod:t,path:R,value:b}),b)},set(v,u,i,b){const R=ls(i),S=Reflect.get(v,u,b);if(Object.is(S,R))return!0;const y=Reflect.set(v,u,R,b);if(y){const P=xn.get(t);P==null||P.rawSet(P.rawGet())}return y},deleteProperty(v,u){const i=Reflect.has(v,u),b=Reflect.deleteProperty(v,u);if(b&&i){const R=xn.get(t);R==null||R.rawSet(R.rawGet())}return b}});return s.set(e,r),r},Ms=t=>{if(!t||typeof t!="object"||t.type!=="rod"||t[Fn])return t;const e=Object.getOwnPropertyDescriptor(t,"value");if(!e||typeof e.get!="function"||typeof e.set!="function")return t;const n=()=>e.get.call(t),s=o=>e.set.call(t,ls(o));return xn.set(t,{rawGet:n,rawSet:s}),Object.defineProperty(t,"value",{get(){const o=n();return!o||typeof o!="object"?o:Rs(t,o,[])},set(o){s(o)},configurable:!0}),Object.defineProperty(t,Fn,{value:!0,configurable:!1}),t},Ql=()=>{if(typeof window._.rod!="function"||window._.rod[Fn])return;const t=window._.rod,e=function(...s){return Ms(t(...s))};Object.defineProperty(e,Fn,{value:!0,configurable:!1}),window._.rod=e};He.ui.withoutRodPathCapture=t=>{const e=Ht.length;try{return t()}finally{Ht.length=e}};const is=(t,e,n="")=>{if(Array.isArray(t)){let r=!1;const v=t.map(u=>{const i=is(u,e,"");return i!==u&&(r=!0),i});return r?v:t}if(ns(t)){const r=Es(e,t);return r?n==="model"?Ts(r.rod,r.path):()=>os(r.rod,r.path):t}if(!ln(t))return t;let s=!1;const o={};for(const r of Object.keys(t)){const v=is(t[r],e,r);o[r]=v,v!==t[r]&&(s=!0)}return s?o:t},as=(t,e,n="")=>{if(Array.isArray(t)){let r=!1;const v=t.map(u=>{const i=as(u,e,"");return i!==u&&(r=!0),i});return r?v:t}if(ns(t)){const r=Es(e,t);return r?n==="model"?Ts(r.rod,r.path):()=>os(r.rod,r.path):t}if(!ln(t))return t;let s=!1;const o={};for(const r of Object.keys(t)){const u=r==="model"||r==="children"?as(t[r],e,r):t[r];o[r]=u,u!==t[r]&&(s=!0)}return s?o:t},Fs=t=>{if(typeof t!="function"||t[On])return t;const e=zs.get(t);if(e)return e;const n=function(...o){const r=Js();if(!r)return t.apply(this,o);let v=!1;const u=o.map(i=>{const b=as(i,r,"");return b!==i&&(v=!0),b});return t.apply(this,v?u:o)};return Object.defineProperty(n,On,{value:!0,configurable:!1}),zs.set(t,n),n},Zl=()=>{const t=He.ui;if(!(!t||t[On])){Object.defineProperty(t,On,{value:!0,configurable:!1});for(const e of Object.keys(t))typeof t[e]=="function"&&(t[e]=Fs(t[e]));He.ui=new Proxy(t,{get(e,n,s){return Reflect.get(e,n,s)},set(e,n,s,o){const r=typeof s=="function"?Fs(s):s;return Reflect.set(e,n,r,o)}})}},eo=()=>{if(!window._||window._[As])return;Object.defineProperty(window._,As,{value:!0,configurable:!1});const t=new Set(["rod","rodBind","rodFromSignal"]);for(const e of Object.keys(window._)){if(t.has(e))continue;const n=window._[e];typeof n=="function"&&(window._[e]=function(...o){const r=Js();if(!r)return n.apply(this,o);let v=!1;const u=o.map(i=>{const b=is(i,r,"");return b!==i&&(v=!0),b});return n.apply(this,v?u:o)})}};Ql(),((Cl=JSswift.rod)==null?void 0:Cl._all)instanceof Set&&JSswift.rod._all.forEach(t=>Ms(t)),eo(),Zl();const Os={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},ui=new Set(Object.values(Os)),to=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),no=new Set(["none","sm","md","lg"]),kn={xxs:{font:"9px",pad:"2px 5px"},xs:{font:"10px",pad:"2px 6px"},sm:{font:"11px",pad:"2px 7px"},md:{font:"12px",pad:"2px 8px"},lg:{font:"13px",pad:"3px 10px"},xl:{font:"14px",pad:"4px 12px"},xxl:{font:"15px",pad:"5px 14px"},xxxl:{font:"16px",pad:"6px 16px"}},Qt=t=>{if(t.indexOf("-")>-1)return!0},mt=t=>{if(!t)return"";const e=String(t).toLowerCase();return Os[e]||""},so=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":to.has(e)?e:null},Dn=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return no.has(e)?e:null},_n=t=>t&&typeof t=="object"&&!t.nodeType&&!Array.isArray(t)&&!(t instanceof Function),rs=t=>t&&t.nodeType===1&&String(t.tagName||"").toLowerCase()==="li",Zt=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];JSswift.isUIPlainObject=_n,JSswift.isListItemNode=rs,JSswift.asNodeArray=Zt;const mn=[{key:"mobile",aliases:["mobile","mobil"],prefix:"cms-"},{key:"tablet",aliases:["tablet"],prefix:"cms-tablet-"},{key:"pc",aliases:["pc","desktop"],prefix:"cms-pc-"}],cs=mn.flatMap(t=>t.aliases),$n=(t,e)=>Object.prototype.hasOwnProperty.call(t||{},e),Nn=(t={},e)=>{if(!e)return null;for(const n of e.aliases){if(!$n(t,n))continue;const s=l(t[n]);if(_n(s))return s}return null},Ds=(t={},e)=>{const n=Array.isArray(e)?e:[e];return mn.some(s=>{const o=Nn(t,s);return!!o&&n.some(r=>$n(o,r))})},lo=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),oo=(t={},e=[])=>{const n=[];for(const s of mn){const o=Nn(t,s);if(o)for(const r of e){const v=Array.isArray(r.prop)?r.prop:[r.prop];let u=!1,i,b="";for(const y of v)if($n(o,y)){i=l(o[y]),b=y,u=!0;break}if(!u||i==null||i===""||i===!1&&!r.allowFalse)continue;const R=typeof r.map=="function"?r.map(i,{propName:b,props:o,device:s,rule:r}):`${r.class}-${lo(i)}`,S=Array.isArray(R)?R:[R];for(const y of S)y&&n.push(String(y).startsWith("cms-")?y:`${s.prefix}${y}`)}}return n},$s=(t={})=>mn.some(e=>!!Nn(t,e)),io=(t={},e=[])=>{for(const n of e){if(!$n(t,n))continue;const s=l(t[n]);if(!(s==null||s===""))return s}},ao=(t,e={})=>{var n;return t==null||t===""||t===!1&&!e.allowFalse?"":typeof e.mapValue=="function"?e.mapValue(t,e):typeof t=="number"?e.number==="raw"?String(t):`${t}px`:e.token&&typeof t=="string"&&((n=JSswift.uiSizes)!=null&&n.includes(t))?`var(--cms-${e.token}-${t})`:String(t)},ro=(t,e,n)=>{!t||n==null||n===""||(typeof t.setProperty=="function"?t.setProperty(e,n):t[e]=n)},co=(t,e)=>t==="mobile"?`cms-rsp-${e}`:`cms-rsp-${t}-${e}`,Vs=(t,e)=>{var n;if(!(!t||!e)){if((n=t.classList)!=null&&n.add){t.classList.add(e);return}t.class=ae([t.class,e])}},Bs=(t,e={},n=[])=>{if(!t||!e||!$s(e))return t;const s=t.style||{};let o=!1;for(const r of n){const v=Array.isArray(r.prop)?r.prop:[r.prop],u=(i,b)=>{const R=io(b,v),S=ao(R,r);if(!S)return;const y=r.var||r.css,P=i==="mobile"?"--cms-rsp-":`--cms-rsp-${i}-`;ro(s,`${P}${y}`,S),Vs(t,co(i,y)),o=!0};u("mobile",e);for(const i of mn){const b=Nn(e,i);b&&u(i.key,b)}}return o&&(t.nodeType||(t.style=s),Vs(t,"cms-rsp")),t};JSswift.uiResponsiveDevices=mn,JSswift.uiResponsiveOmitProps=cs,JSswift.uiResponsivePropsFor=Nn,JSswift.uiResponsiveHasConfig=$s,JSswift.uiResponsiveHasProp=Ds,JSswift.uiResponsiveClasses=oo,JSswift.uiApplyResponsiveProps=Bs;const uo=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(cs):cs;return uo(t,n)};const Yt=(t={})=>{var s;const e=[],n={};if(e.push(fe(t.clickable,"cms-clickable"),fe(t.dense,"cms-dense"),fe(t.flat,"cms-flat"),fe(t.border,"cms-border"),fe(t.glossy,"cms-glossy"),fe(t.glow,"cms-glow"),fe(t.glass,"cms-glass"),fe(t.shadow,"cms-shadow"),fe(t.outline,"cms-outline"),fe(t.rounded,"cms-rounded"),fe(t.gradient,"cms-gradient"),fe(t.textGradient,"cms-text-gradient"),fe(t.lightShadow,"cms-light-shadow")),at(t.color))e.push(()=>{const o=l(t.color),r=mt(o);return r?`cms-state-${r}`:""}),n.backgroundColor=()=>{const o=l(t.color);return mt(o)?"":o&&Qt(String(o))?`var(--cms-${o})`:o||""};else{const o=mt(t.color);o?e.push(`cms-state-${o}`):t.color&&Qt(t.color)?n.backgroundColor=`var(--cms-${t.color})`:t.color&&(n.backgroundColor=t.color)}if(at(t.textColor)?n.color=()=>{const o=l(t.textColor);return o&&Qt(String(o))?`var(--cms-${o})`:o||""}:t.textColor&&Qt(t.textColor)?n.color=`var(--cms-${t.textColor})`:t.textColor&&(n.color=t.textColor),at(t.size))e.push(()=>{var r;const o=l(t.size);return typeof o=="string"&&((r=JSswift.uiSizes)!=null&&r.includes(o))?`cms-size-${o}`:""});else{const o=t.size;typeof o=="string"&&((s=JSswift.uiSizes)!=null&&s.includes(o))&&e.push(`cms-size-${o}`)}if(at(t.shadow))e.push(()=>{const o=l(t.shadow),r=Dn(o);return r?`cms-shadow-${r}`:""}),n.boxShadow=()=>{const o=l(t.shadow);return Dn(o)||o==null||o===!1?"":typeof o=="string"?o:""};else{const o=Dn(t.shadow);o?e.push(`cms-shadow-${o}`):t.shadow&&typeof t.shadow=="string"&&(n.boxShadow=t.shadow)}e.length&&(t.class=ae([t.class,...e])),Object.keys(n).length&&(t.style={...n,...t.style||{}})},fo=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=fo(t),n=e.props||{};if(n&&Object.prototype.hasOwnProperty.call(n,"children")){const s=n.children;(!e.children||e.children.length===0)&&(e.children=Array.isArray(s)?s:[s]),delete n.children}return Yt(n),e};const he=window._;function on(t){if(!t)return null;if(!Array.isArray(t))return t;const e=[],n=t.slice();for(;n.length;){const s=n.shift();s&&(Array.isArray(s)?n.unshift(...s):e.push(s))}return e.length?e:null}const Hs={padding:"p",paddingTop:"p",paddingRight:"p",paddingBottom:"p",paddingLeft:"p",paddingInline:"p",paddingInlineStart:"p",paddingInlineEnd:"p",paddingBlock:"p",paddingBlockStart:"p",paddingBlockEnd:"p",margin:"m",marginTop:"m",marginRight:"m",marginBottom:"m",marginLeft:"m",marginInline:"m",marginInlineStart:"m",marginInlineEnd:"m",marginBlock:"m",marginBlockStart:"m",marginBlockEnd:"m",width:"w",minWidth:"w",maxWidth:"w",height:"h",minHeight:"h",maxHeight:"h"},mo=t=>t===!0?"wrap":t===!1?"nowrap":String(t),js=t=>typeof t=="number"?`repeat(${Math.max(1,Math.round(t))}, minmax(0, 1fr))`:String(t),Ws=[{prop:"display",css:"display",var:"display"},{prop:"direction",css:"flex-direction",var:"flex-direction"},{prop:"wrap",css:"flex-wrap",var:"flex-wrap",allowFalse:!0,mapValue:mo},{prop:"align",css:"align-items",var:"align-items"},{prop:"justify",css:"justify-content",var:"justify-content"},{prop:"self",css:"align-self",var:"align-self"},{prop:"justifySelf",css:"justify-self",var:"justify-self"},{prop:"place",css:"place-items",var:"place-items"},{prop:"placeSelf",css:"place-self",var:"place-self"},{prop:["cols","columns"],css:"grid-template-columns",var:"grid-template-columns",mapValue:js},{prop:"rows",css:"grid-template-rows",var:"grid-template-rows",mapValue:js},{prop:"flow",css:"grid-auto-flow",var:"grid-auto-flow",mapValue:t=>String(t).trim().toLowerCase().replace("-"," ")},{prop:"autoRows",css:"grid-auto-rows",var:"grid-auto-rows"},{prop:["span","gridColumn"],css:"grid-column",var:"grid-column",number:"raw"},{prop:["row","rowSpan"],css:"grid-row",var:"grid-row",number:"raw"},{prop:"area",css:"grid-area",var:"grid-area"},{prop:"gap",css:"gap",var:"gap",token:"gap"},{prop:"rowGap",css:"row-gap",var:"row-gap",token:"gap"},{prop:["columnGap","colGap"],css:"column-gap",var:"column-gap",token:"gap"},{prop:"width",css:"width",var:"width",token:"w"},{prop:"minWidth",css:"min-width",var:"min-width",token:"min-w"},{prop:"maxWidth",css:"max-width",var:"max-width",token:"max-w"},{prop:"height",css:"height",var:"height",token:"h"},{prop:"minHeight",css:"min-height",var:"min-height",token:"min-h"},{prop:"maxHeight",css:"max-height",var:"max-height",token:"max-h"},{prop:"padding",css:"padding",var:"padding",token:"p"},{prop:"paddingLeft",css:"padding-left",var:"padding-left",token:"p"},{prop:"paddingRight",css:"padding-right",var:"padding-right",token:"p"},{prop:"paddingTop",css:"padding-top",var:"padding-top",token:"p"},{prop:"paddingBottom",css:"padding-bottom",var:"padding-bottom",token:"p"},{prop:"margin",css:"margin",var:"margin",token:"m"},{prop:"marginLeft",css:"margin-left",var:"margin-left",token:"m"},{prop:"marginRight",css:"margin-right",var:"margin-right",token:"m"},{prop:"marginTop",css:"margin-top",var:"margin-top",token:"m"},{prop:"marginBottom",css:"margin-bottom",var:"margin-bottom",token:"m"},{prop:"fontSize",css:"font-size",var:"font-size",token:"f"},{prop:"fontWeight",css:"font-weight",var:"font-weight",token:"fw",number:"raw"},{prop:"lineHeight",css:"line-height",var:"line-height",token:"lh",number:"raw"},{prop:"letterSpacing",css:"letter-spacing",var:"letter-spacing",token:"ls"},{prop:["borderRadius","radius"],css:"border-radius",var:"border-radius",token:"r"},{prop:"overflow",css:"overflow",var:"overflow"},{prop:"order",css:"order",var:"order",number:"raw"}],Us=Ws.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return e.some(n=>Object.prototype.hasOwnProperty.call(Hs,n))||e.includes("fontSize")||e.includes("fontWeight")||e.includes("lineHeight")||e.includes("letterSpacing")||e.includes("borderRadius")||e.includes("radius")});JSswift.uiResponsiveStyleRules=Ws,JSswift.uiResponsiveCommonStyleRules=Us;const go=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),ho=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(go(n),ms(e,s))};function Ke(t,e){e.size&&(typeof e.size=="number"?t.style.setProperty("--cms-font-size",`${e.size}px`):JSswift.uiSizes.includes(e.size)&&t.style.setProperty("--cms-font-size",`var(--cms-font-size-${e.size})`)),Object.entries(Hs).forEach(([n,s])=>{Ds(e,n)||ho(t,e[n],n,s)}),Bs(t,e,Us),e.gradient&&typeof e.gradient=="number"&&t.style.setProperty("--set-gradient-deg",`${e.gradient}deg`),e.radius&&(typeof e.radius=="number"?t.style.setProperty("--set-border-radius",`${e.radius}px`):JSswift.uiSizes.includes(e.radius)?t.style.setProperty("--set-border-radius",`var(--cms-r-${e.radius})`):t.style.setProperty("--set-border-radius",`${e.radius}`))}function us(t={},...e){const n=document.createElement("option");t&&typeof t=="object"&&(t.value!=null&&(n.value=String(t.value)),t.label!=null&&(n.label=String(t.label)),t.disabled!=null&&(n.disabled=!!t.disabled),t.selected!=null&&(n.selected=!!t.selected),t.class!=null&&(n.className=String(t.class)));const s=e.flat?e.flat(1/0):e;return s.length?s.forEach(o=>{o==null||o===!1||(o instanceof Node?n.appendChild(o):n.appendChild(document.createTextNode(String(o))))}):t&&t.text!=null&&(n.textContent=String(t.text)),n}JSswift.ui.getSlot=(t,e)=>t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:null,JSswift.ui.renderSlot=(t,e,n,s)=>{const o=JSswift.ui.getSlot(t,e),v=o!=null?typeof o=="function"?o(n||{}):o:s;return v==null?null:on(JSswift.ui.slot(v))};const E=(t,e,n,s)=>{const o=JSswift.ui.renderSlot(t,e,n,s);return o?Array.isArray(o)?o:[o]:[]},gn=new Set;let Vn=!1;const po=new Set(["ctrl","alt","shift","meta"]),bo={control:"ctrl",ctl:"ctrl",option:"alt",opt:"alt",command:"meta",cmd:"meta","\u2318":"meta","\u2303":"ctrl","\u2325":"alt","\u21E7":"shift",esc:"escape",return:"enter",plus:"+",spacebar:"space",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",del:"delete"},yo={ctrl:"Ctrl",alt:"Alt",shift:"Shift",meta:"Meta",escape:"Esc",enter:"Enter",tab:"Tab",space:"Space",backspace:"Backspace",delete:"Del",arrowup:"Up",arrowdown:"Down",arrowleft:"Left",arrowright:"Right",pageup:"PgUp",pagedown:"PgDn"},Gs=()=>{if(typeof navigator=="undefined")return!1;const t=String(navigator.platform||navigator.userAgent||"");return/(mac|iphone|ipad|ipod)/i.test(t)},ds=t=>{if(t==null)return"";const e=String(t).trim().toLowerCase();return e?bo[e]||e:""},Ks=t=>{if(t==null||t===!1)return null;const e=String(t).trim();if(!e)return null;const n=e.split("+").map(ds).filter(Boolean);if(!n.length)return null;const s={raw:e,key:"",ctrl:!1,alt:!1,shift:!1,meta:!1};return n.forEach(o=>{if(o==="mod"){Gs()?s.meta=!0:s.ctrl=!0;return}if(po.has(o)){s[o]=!0;return}s.key=o}),s.key?s:null},wo=t=>t==null||t===!1?[]:(Array.isArray(t)?t:[t]).map(n=>{var o,r,v;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const u=Ks((v=(r=(o=n.shortcode)!=null?o:n.shortcut)!=null?r:n.keys)!=null?v:n.key);return u?{...n,...u}:null}const s=Ks(n);return s?{...s}:null}).filter(Boolean),Ys=(t={})=>{var e,n,s;return wo((s=(n=(e=t.shortcode)!=null?e:t.shortcut)!=null?n:t.hotkey)!=null?s:t.keys)},vo=(t={})=>t.showShortcode===!0||t.showShortcut===!0,Ln=t=>{const e=ds(t);if(!e)return"";const n={...yo};return Gs()&&(n.alt="Option",n.meta="Cmd"),n[e]?n[e]:e.length===1?e.toUpperCase():e.replace(/(^|[-_ ])(\w)/g,(s,o,r)=>`${o}${r.toUpperCase()}`)},So=t=>{if(!t)return"";const e=[];return t.ctrl&&e.push(Ln("ctrl")),t.alt&&e.push(Ln("alt")),t.shift&&e.push(Ln("shift")),t.meta&&e.push(Ln("meta")),e.push(Ln(t.key)),e.filter(Boolean).join("+")},Co=t=>(Array.isArray(t)?t:[]).map(So).filter(Boolean).join(" / "),fs=(t={},e={})=>{const n=Ys(t);if(!vo(t)||!n.length||typeof document=="undefined")return null;const s=document.createElement("span");return s.className=e.className||"cms-shortcode",s.setAttribute("aria-hidden","true"),s.textContent=Co(n),s},xo=t=>{const e=(t==null?void 0:t.nodeType)===1?t:t==null?void 0:t.parentElement;if(!e||typeof e.closest!="function")return!1;if(e.isContentEditable)return!0;const n=e.closest("input, textarea, select, [contenteditable], [contenteditable='true'], [contenteditable='plaintext-only']");return!(!n||"disabled"in n&&n.disabled)},ko=(t,e)=>!t||!e||!!t.ctrlKey!=!!e.ctrl||!!t.altKey!=!!e.alt||!!t.shiftKey!=!!e.shift||!!t.metaKey!=!!e.meta?!1:ds(t.key)===e.key,qs=()=>{gn.size||!Vn||typeof document=="undefined"||(document.removeEventListener("keydown",Xs,!0),Vn=!1)};function Xs(t){var s,o,r,v,u,i;if(!gn.size||!t||t.defaultPrevented||t.isComposing)return;const e=xo(t.target),n=Array.from(gn);for(let b=n.length-1;b>=0;b-=1){const R=n[b],S=R==null?void 0:R.anchor;if(!S||!S.isConnected){gn.delete(R);continue}if(((s=R.isEnabled)==null?void 0:s.call(R))===!1)continue;const y=R.specs.find(ie=>{var $,Y;const D=(Y=($=ie.allowInEditable)!=null?$:R.allowInEditable)!=null?Y:!1;return e&&!D?!1:ko(t,ie)});if(!y)continue;const P=(r=(o=y.preventDefault)!=null?o:R.preventDefault)!=null?r:!0,Q=(u=(v=y.stopPropagation)!=null?v:R.stopPropagation)!=null?u:!0;if(P&&t.preventDefault(),Q&&t.stopPropagation(),((i=R.action)==null?void 0:i.call(R,t,y,S))!==!1)break}qs()}const an=(t,e={},n={})=>{var v,u;const s=Ys(e);if(!t||!s.length||typeof document=="undefined")return null;const o={anchor:t,specs:s,action:typeof n.action=="function"?n.action:()=>{var i;return(i=t.click)==null?void 0:i.call(t)},isEnabled:typeof n.isEnabled=="function"?n.isEnabled:null,allowInEditable:!!n.allowInEditable,preventDefault:(v=n.preventDefault)!=null?v:!0,stopPropagation:(u=n.stopPropagation)!=null?u:!0};gn.add(o),Vn||(document.addEventListener("keydown",Xs,!0),Vn=!0);const r=()=>{gn.delete(o),qs()};return JSswift._registerCleanup(t,r),r},hn=(t,e={})=>{var n;if(!t||typeof t.focus!="function")return!1;try{t.focus({preventScroll:(n=e.preventScroll)!=null?n:!0})}catch(s){t.focus()}if(e.selectText&&typeof t.select=="function")try{t.select()}catch(s){}return!0},ms=(t,e="size")=>typeof t=="number"?t+"px":JSswift.uiSizes.includes(t)?`var(--cms-${e}-${t})`:t,Ot=(t,e=JSswift.uiSizes)=>n=>{const s=String(n).trim();return e!=null&&e.includes(s)?`${t}-${s}`:""},jt=t=>e=>`${t}-${String(e).trim().toLowerCase().replace(/\s+/g,"-")}`,_o=t=>{if(t===!0)return"wrap-wrap";if(t===!1)return"wrap-nowrap";const e=String(t).trim().toLowerCase();return e==="false"||e==="no"||e==="none"?"wrap-nowrap":e==="reverse"?"wrap-reverse":`wrap-${e}`},gs=(t,e,n)=>t?e:n,No=t=>{const e=l(t);if(e==null||e==="")return"";if(e==="auto")return"col-auto";if(e===!0)return"col-24";const n=Number(e);if(Number.isFinite(n)&&n>0)return`col-${Math.max(1,Math.min(24,Math.round(n)))}`;if(typeof e=="string"){const s=e.trim();if(/^\d+$/.test(s))return`col-${Math.max(1,Math.min(24,Number(s)))}`}return""},Lo=t=>{const e=Number(t);return Number.isFinite(e)&&e>0?`grid-cols-${Math.max(1,Math.min(24,Math.round(e)))}`:""},We=(t,e)=>{const n=Array.isArray(e)?e:[e];return JSswift.uiResponsiveDevices.some(s=>{const o=JSswift.uiResponsivePropsFor(t,s);return!!o&&n.some(r=>Object.prototype.hasOwnProperty.call(o,r))})},pn=t=>JSswift.uiResponsiveDevices.find(e=>e.key===t),rn=[{prop:"gap",class:"gap",map:Ot("gap")},{prop:"rowGap",class:"gap-y",map:Ot("gap-y")},{prop:["columnGap","colGap"],class:"gap-x",map:Ot("gap-x")},{prop:"direction",class:"dir",map:jt("dir")},{prop:"wrap",class:"wrap",allowFalse:!0,map:_o},{prop:"align",class:"align",map:jt("align")},{prop:"justify",class:"justify",map:jt("justify")},{prop:"width",class:"w",map:Ot("w")},{prop:"minWidth",class:"min-w",map:Ot("min-w")},{prop:"maxWidth",class:"max-w",map:Ot("max-w")},{prop:"height",class:"h",map:Ot("h")},{prop:"minHeight",class:"min-h",map:Ot("min-h")},{prop:"maxHeight",class:"max-h",map:Ot("max-h")},{prop:"padding",class:"p",map:Ot("p")},{prop:"margin",class:"m",map:Ot("m")}],Ao=rn.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("align")&&!e.includes("justify")}),Qs=[{prop:["col","span"],class:"col",map:No},{prop:"auto",class:"col",map:t=>t?"col-auto":""},{prop:"inline",class:"display",allowFalse:!0,map:t=>gs(t,"display-inline-flex","display-flex")},{prop:"self",class:"self",map:jt("self")},...rn],Zs=[{prop:["cols","columns"],class:"grid-cols",map:Lo},{prop:"inline",class:"display",allowFalse:!0,map:t=>gs(t,"display-inline-grid","display-grid")},{prop:"flow",class:"grid-flow",map:t=>`grid-flow-${String(t).trim().toLowerCase().replace(/\s+/g,"-")}`},...rn],el=[{prop:"inline",class:"display",allowFalse:!0,map:t=>gs(t,"display-inline-flex","display-flex")},{prop:"direction",class:"dir",map:jt("dir")},{prop:"contentAlign",class:"align",map:jt("align")},{prop:"contentJustify",class:"justify",map:jt("justify")},{prop:"align",class:"self",map:jt("self")},{prop:"justify",class:"justify-self",map:jt("justify-self")},{prop:"place",class:"place-self",map:jt("place-self")},...Ao],Io=(JSswift.uiResponsiveStyleRules||[]).filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("span")&&!e.includes("gridColumn")});he.Row=(...t)=>{var f,m,g,F,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(a,C,h={})=>{const J=Array.isArray(a)?a:[a];for(const j of J)if(JSswift.ui.getSlot(s,j)!=null)return E(s,j,h,C);return C==null?[]:E(null,"default",h,C)},r=a=>{var C;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?`var(--cms-s-${a})`:String(a)},v=a=>{var C;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?`var(--cms-w-${a})`:String(a)},u=JSswift.omit(e,["slots","start","left","startClass","body","center","bodyClass","centerClass","end","right","endClass","align","justify","wrap","gap","rowGap","columnGap","direction","reverse","inline","full","width","minWidth","maxWidth",...JSswift.uiResponsiveOmitProps]);u.class=ae(["cms-row",JSswift.uiResponsiveClasses({mobile:e},rn),JSswift.uiResponsiveClasses(e,rn),e.class]);const i={...e.style||{}},b=qe([e.direction,e.reverse],()=>{const a=l(e.direction);return a!=null&&a!==""?String(a):l(e.reverse)?"row-reverse":""}),R=ze(e.align),S=ze(e.justify),y=ze(e.wrap,a=>typeof a=="boolean"?a?"wrap":"nowrap":String(a)),P=ze(e.gap,r),Q=ze(e.rowGap,r),G=ze(e.columnGap,r),ie=ze(e.inline,a=>a?"inline-flex":"flex"),D=ze(e.width,v),$=ze(e.minWidth,v),Y=ze(e.maxWidth,v),W=ze(e.full,a=>a?"100%":"",""),le=qe([e.inline,e.full,e.width],()=>{const a=!!l(e.inline),C=!!l(e.full),h=l(e.width)!=null&&l(e.width)!==!1&&l(e.width)!=="";return!a||C||h?"":"max-content"});b!=null&&!We(e,"direction")&&(i.flexDirection=b),R!=null&&!We(e,"align")&&(i.alignItems=R),S!=null&&!We(e,"justify")&&(i.justifyContent=S),y!=null&&!We(e,"wrap")&&(i.flexWrap=y),P!=null&&!We(e,"gap")&&(i.gap=P),Q!=null&&!We(e,"rowGap")&&(i.rowGap=Q),G!=null&&!We(e,"columnGap")&&(i.columnGap=G),ie!=null&&(i.display=ie),le!=null&&(i.width=le),D!=null&&!We(e,"width")&&(i.width=D),$!=null&&!We(e,"minWidth")&&(i.minWidth=$),Y!=null&&!We(e,"maxWidth")&&(i.maxWidth=Y),W!=null&&(i.width=W),Object.keys(i).length&&(u.style=i),JSswift.uiApplyResponsiveProps(u,e,JSswift.uiResponsiveStyleRules);const me={props:e},re=o(["start","left"],(f=e.start)!=null?f:e.left,me),oe=o(["body","center","default"],(g=(m=e.body)!=null?m:e.center)!=null?g:n,me),se=o(["end","right"],(F=e.end)!=null?F:e.right,me);if(!(re.length||se.length||e.body!=null||e.center!=null||e.startClass||e.bodyClass||e.centerClass||e.endClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"left")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"center")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"right")!=null)){const a=E(s,"default",me,n),C=_.div(u,...a);return Ke(C,e),C}const M={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},Z=(X=e.bodyClass)!=null?X:e.centerClass,q=qe([e.direction,e.reverse],()=>(l(e.direction)||(l(e.reverse)?"row-reverse":"row"))==="row"?"auto":""),ue=[re.length?_.div({class:ae(["cms-row-start",e.startClass]),style:{...M}},...re):null,oe.length?_.div({class:ae(["cms-row-body",Z]),style:{...M,flex:"1 1 auto"}},...oe):null,se.length?_.div({class:ae(["cms-row-end",e.endClass]),style:{...M,justifyContent:"flex-end",marginInlineStart:q}},...se):null].filter(Boolean),L=_.div(u,...ue);return Ke(L,e),L};function At(t){return Array.isArray(t)&&(t.length===2||t.length===3&&typeof t[2]=="function")&&typeof t[0]=="function"&&typeof t[1]=="function"}function Jt(t){return!!t&&t.type==="rod"}function at(t){return typeof t=="function"||Jt(t)||At(t)}function l(t){return typeof t=="function"?t():Jt(t)?t.value:At(t)?t[0]():t}function zo(t){const e=Array.isArray(t)?[...t]:[t];for(;e.length;){const n=e.pop();if(at(n))return!0;Array.isArray(n)&&e.push(...n)}return!1}function ae(t){const e=zo(t),n=()=>{const s=[],o=Array.isArray(t)?[...t]:[t];for(;o.length;){const r=o.shift();if(r==null||r===!1)continue;const v=l(r);if(!(v==null||v===!1||v==="")){if(Array.isArray(v)){o.unshift(...v);continue}s.push(v)}}return s.join(" ")};return e?n:n()}function Dt(t){const e=ae(t);return typeof e=="function"?e():e}function fe(t,e,n=""){return at(t)?()=>l(t)?e:n:t?e:n}function tl(t,e,n=""){return at(t)?()=>{const s=l(t);return s==null||s===""?"":`${e}${s}${n}`}:t==null||t===""?"":`${e}${t}${n}`}function qe(t,e){return(Array.isArray(t)?t:[t]).some(at)?()=>e():e()}function ze(t,e,n=""){return at(t)?()=>{const s=l(t);return s==null||s===!1?n:e?e(s):s}:t==null||t===!1?null:e?e(t):t}JSswift.uiIsReactive=at,JSswift.uiUnwrap=l,JSswift.uiClass=ae,JSswift.uiClassStatic=Dt,JSswift.uiWhen=fe,JSswift.uiClassValue=tl,JSswift.uiComputed=qe,JSswift.uiStyleValue=ze,he.Col=(...t)=>{var J,j,U,ce,k,d;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=N=>Object.prototype.hasOwnProperty.call(e,N),r=(N,I,H={})=>{const ge=Array.isArray(N)?N:[N];for(const Se of ge)if(JSswift.ui.getSlot(s,Se)!=null)return E(s,Se,H,I);return I==null?[]:E(null,"default",H,I)},v=N=>{var I;return N==null||N===!1||N===""?"":typeof N=="number"?`${N}px`:typeof N=="string"&&((I=JSswift.uiSizes)!=null&&I.includes(N))?`var(--cms-s-${N})`:String(N)},u=N=>{var I;return N==null||N===!1||N===""?"":typeof N=="string"&&((I=JSswift.uiSizes)!=null&&I.includes(N))?ms(N,"size"):Be(N)},i=(N,I)=>{const H=l(N);if(H==null||H===!1||H==="")return"";if(H==="auto")return I==="cms-col-"?"cms-col-auto":"";if(H===!0)return`${I}24`;const ge=Number(H);if(Number.isFinite(ge)&&ge>0)return`${I}${Math.max(1,Math.min(24,Math.round(ge)))}`;if(typeof H=="string"){const Se=H.trim();if(!Se)return"";if(Se.startsWith(I))return Se;if(/^\d+$/.test(Se))return`${I}${Math.max(1,Math.min(24,Number(Se)))}`}return""},b=()=>{const N=l(e.flex);if(N!=null&&N!==!1&&N!=="")return String(N);if(l(e.fill))return"1 1 auto";const I=o("grow"),H=o("shrink"),ge=o("basis");if(!I&&!H&&!ge)return"";const Se=I?l(e.grow):0,ye=H?l(e.shrink):1,V=ge?u(l(e.basis)):"auto";return`${Se} ${ye} ${V||"auto"}`},R=qe([e.auto,e.col,e.span],()=>{if(l(e.auto))return"cms-col-auto";const N=o("span")?e.span:e.col;return i(N,"cms-col-")||"cms-col"}),S=JSswift.omit(e,["slots","col","span","sm","md","lg","auto","size","width","minWidth","maxWidth","height","minHeight","maxHeight","gap","rowGap","columnGap","align","justify","inline","center","stack","flex","fill","grow","shrink","basis","self","order","scroll","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass",...JSswift.uiResponsiveOmitProps]),y={...e.style||{}};!We(e,"minWidth")&&y.minWidth==null&&(y.minWidth=0);const P=ze(e.gap,v),Q=ze(e.rowGap,v),G=ze(e.columnGap,v),ie=ze(e.align),D=ze(e.justify),$=o("width")?e.width:e.size,Y=ze($,u),W=ze(e.minWidth,u),le=ze(e.maxWidth,u),me=ze(e.height,u),re=ze(e.minHeight,u),oe=ze(e.maxHeight,u),se=ze(e.self),te=ze(e.order,N=>String(N)),M=ze(e.scroll,N=>N?"auto":"",""),Z=qe([e.flex,e.fill,e.grow,e.shrink,e.basis],b),q=qe([e.center,e.align,e.justify],()=>!!l(e.center)&&(l(e.align)==null||l(e.align)==="")&&(l(e.justify)==null||l(e.justify)===""));Z!=null&&Z!==""&&(y.flex=Z),se!=null&&!We(e,"self")&&(y.alignSelf=se),te!=null&&(y.order=te),M!=null&&M!==""&&(y.overflow=M),Y!=null&&Y!==""&&!We(e,["width","size"])&&(y.width=Y,!o("flex")&&!o("fill")&&!o("grow")&&!o("shrink")&&!o("basis")&&(y.flex="0 0 auto")),W!=null&&!We(e,"minWidth")&&(y.minWidth=W),le!=null&&!We(e,"maxWidth")&&(y.maxWidth=le),me!=null&&!We(e,"height")&&(y.height=me),re!=null&&!We(e,"minHeight")&&(y.minHeight=re),oe!=null&&!We(e,"maxHeight")&&(y.maxHeight=oe),Object.keys(y).length&&(S.style=y);const ue={props:e},L=r(["start","top","header","before"],(U=(j=(J=e.start)!=null?J:e.top)!=null?j:e.header)!=null?U:e.before,ue),f=o("body")?e.body:o("content")?e.content:n,m=r(["body","content","default"],f,ue),g=r(["end","bottom","footer","after"],(d=(k=(ce=e.end)!=null?ce:e.bottom)!=null?k:e.footer)!=null?d:e.after,ue),F=L.length||g.length||o("start")||o("top")||o("header")||o("before")||o("body")||o("content")||o("end")||o("bottom")||o("footer")||o("after")||e.startClass||e.bodyClass||e.contentClass||e.endClass||e.topClass||e.headerClass||e.bottomClass||e.footerClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"top")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"content")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"bottom")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,X=qe([e.stack,e.gap,e.rowGap,e.columnGap,e.align,e.justify,e.center],()=>l(e.stack)||F||[l(e.gap),l(e.rowGap),l(e.columnGap),l(e.align),l(e.justify)].some(I=>I!=null&&I!==!1&&I!=="")?!0:!!l(e.center));if(S.class=ae(["cms-col",R,qe(e.sm,()=>i(e.sm,"cms-sm-col-")),qe(e.md,()=>i(e.md,"cms-md-col-")),qe(e.lg,()=>i(e.lg,"cms-lg-col-")),JSswift.uiResponsiveClasses({mobile:e},Qs),JSswift.uiResponsiveClasses(e,Qs),fe(X,"cms-col-flex"),fe(e.inline,"cms-col-inline"),e.class]),P!=null&&!We(e,"gap")&&(y.gap=P),Q!=null&&!We(e,"rowGap")&&(y.rowGap=Q),G!=null&&!We(e,"columnGap")&&(y.columnGap=G),ie!=null&&!We(e,"align")?y.alignItems=ie:q!=null&&q!==""&&(y.alignItems=q?"center":""),D!=null&&!We(e,"justify")?y.justifyContent=D:q!=null&&q!==""&&(y.justifyContent=q?"center":""),Object.keys(y).length&&(S.style=y),JSswift.uiApplyResponsiveProps(S,e,JSswift.uiResponsiveStyleRules),!F){const N=_.div(S,...E(s,"default",ue,n));return Ke(N,e),N}const a={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},C=[L.length?_.div({class:ae(["cms-col-start",e.startClass,e.topClass,e.headerClass]),style:{...a}},...L):null,m.length?_.div({class:ae(["cms-col-body",e.bodyClass,e.contentClass]),style:{...a,flex:"1 1 auto"}},...m):null,g.length?_.div({class:ae(["cms-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...a}},...g):null].filter(Boolean),h=_.div(S,...C);return Ke(h,e),h},he.Spacer=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=JSswift.omit(e,["slots"]);o.class=ae(["cms-spacer",e.class]);const r=E(s,"default",{},n);return _.div(o,...r)},he.Container=(...t)=>{var g,F,X,a;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e},r=C=>Object.prototype.hasOwnProperty.call(e,C),v={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},u=C=>{if(C==null||C===!1||C==="")return"";if(typeof C=="number")return`${C}px`;const h=String(C).trim().toLowerCase();return h?h==="full"||h==="fluid"?"100%":v[h]||String(C):""},i=C=>{var h;return C==null||C===!1||C===""?"":typeof C=="number"?`${C}px`:typeof C=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(C))?`var(--cms-s-${C})`:String(C)},b=C=>{if(C==null||C===!1||C==="")return"";if(typeof C=="number"&&Number.isFinite(C))return`repeat(${Math.max(1,Math.floor(C))}, minmax(0, 1fr))`;const h=String(C).trim();return h?/^\d+$/.test(h)?`repeat(${Math.max(1,Number(h))}, minmax(0, 1fr))`:h:""},R=C=>C==null||C===""?"":C===!0?"wrap":C===!1?"nowrap":String(C),S={props:e},y=(C,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(J=>y(C,J));return}if(h!=null&&h.nodeType){C.appendChild(h);return}C.appendChild(document.createTextNode(String(h)))}},P=(C,h)=>{const J=JSswift.ui.getSlot(s,C);if(J!=null)return E(s,C,S,null);if(typeof h=="function"){const j=_.div({class:`cms-container-slot-${C}`});return JSswift.reactive.effect(()=>{const U=on(JSswift.ui.slot(h(S)));j.replaceChildren(),Array.isArray(U)?U.forEach(ce=>y(j,ce)):y(j,U)},`UI.Container:${C}`),[j]}return E(s,C,S,h)},Q=r("content")?e.content:n!=null&&n.length?n:null,G=P("before",(g=e.before)!=null?g:e.top),ie=P("header",e.header),D=[...P("left",e.left),...P("start",e.start)],$=P("body",r("body")?e.body:null),Y=(()=>{const C=P("content",r("content")?e.content:null);return C.length?C:P("default",Q)})(),W=[...P("right",e.right),...P("end",e.end)],le=P("footer",e.footer),me=P("after",(F=e.after)!=null?F:e.bottom),re=G.length||ie.length||D.length||W.length||le.length||me.length||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"left")!=null||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"right")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,oe=!!re||$.length>0&&(JSswift.ui.getSlot(s,"body")!=null||re),se=()=>{var h;const C=String(l((h=e.layout)!=null?h:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(C)?C:["inline","inline-flex","inlineflex"].includes(C)||l(e.inline)?"inline":l(e.grid)||l(e.cols)!=null?"grid":C==="block"?"block":l(e.direction)!=null||l(e.wrap)!=null||l(e.align)!=null||l(e.justify)!=null||l(e.gap)!=null||D.length||W.length?"flex":"block"},te=qe([e.layout,e.display,e.inline,e.grid,e.cols,e.direction,e.wrap,e.align,e.justify,e.gap],()=>{const C=se();return C==="block"?"":`is-${C}`}),M={...o.style||{}},Z=(C,h)=>{h!=null&&(M[C]=h)};Z("maxWidth",qe([e.maxWidth,e.fluid],()=>l(e.fluid)?"none":u(l(e.maxWidth))||"")),Z("width",ze(e.width,u)),Z("minWidth",ze(e.minWidth,u)),Z("--cms-container-padding",ze(e.padding,i)),Z("--cms-container-padding-x",ze((X=e.paddingX)!=null?X:e.gutter,i)),Z("--cms-container-padding-y",ze(e.paddingY,i)),Z("--cms-container-gap",ze(e.gap,i)),Z("--cms-container-section-gap",ze((a=e.sectionGap)!=null?a:e.gap,i)),Z("--cms-container-cols",ze(e.cols,b)),Z("--cms-container-align",ze(e.align,C=>String(C))),Z("--cms-container-justify",ze(e.justify,C=>String(C))),Z("--cms-container-direction",ze(e.direction,C=>String(C))),Z("--cms-container-wrap",ze(e.wrap,R));const q=JSswift.omit(o,["after","afterClass","align","as","before","beforeClass","body","bodyClass","bottom","cols","content","contentClass","direction","display","end","endClass","fluid","footer","footerClass","gap","grid","gutter","header","headerClass","inline","justify","layout","left","mainClass","maxWidth","minWidth","padding","paddingX","paddingY","right","sectionGap","slots","start","startClass","tag","top","width","wrap"]);q.class=ae(["cms-container",fe(e.fluid,"is-fluid"),fe(oe,"has-structure"),oe?"":te,o.class]),q.style=M,JSswift.uiApplyResponsiveProps(q,e,JSswift.uiResponsiveStyleRules);const ue=(C,h,J)=>h.length?_.div({class:ae(["cms-container-section",`cms-container-${C}`,J])},...h):null,L=$.length?_.div({class:ae(["cms-container-body",oe?te:"",e.bodyClass])},...$):D.length||Y.length||W.length?_.div({class:ae(["cms-container-body",oe?te:"",e.bodyClass])},ue("start",D,e.startClass),Y.length?_.div({class:ae(["cms-container-main",e.mainClass,e.contentClass])},...Y):null,ue("end",W,e.endClass)):null,f=(()=>{var h;const C=String(l((h=e.tag)!=null?h:e.as)||"div").toLowerCase();return typeof _[C]=="function"?_[C]:_.div})(),m=oe?f(q,ue("before",G,e.beforeClass),ue("header",ie,e.headerClass),L,ue("footer",le,e.footerClass),ue("after",me,e.afterClass)):f(q,...$.length?$:Y);return Ke(m,e),m},he.Card=(...t)=>{var ce,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e};Yt(o);const r=(d,N)=>{var I;return!!(d&&d.nodeType===1&&((I=d.classList)!=null&&I.contains(`cms-card-${N}`)))},u=(d=>d==null?null:typeof d=="string"?he.Icon({name:d,size:e.iconSize||e.size||"lg"}):JSswift.ui.slot(d,{as:"icon"}))(e.icon),i=e.image?_.img({src:e.image,alt:e.imageAlt||"",class:ae(["cms-card-cover-media",e.imageClass]),style:e.imageStyle}):e.cover,b={dense:!!l(e.dense),flat:!!l(e.flat),clickable:!!l(e.clickable),to:l(e.to)||null},R=E(s,"default",b,n!=null&&n.length?n:[]),S={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},y=[];R.forEach(d=>{r(d,"identifier")?S.identifier.push(d):r(d,"cover")?S.cover.push(d):r(d,"media")?S.media.push(d):r(d,"header")?S.header.push(d):r(d,"body")?S.body.push(d):r(d,"footer")?S.footer.push(d):r(d,"actions")?S.actions.push(d):y.push(d)});const P=E(s,"identifier",b,e.identifier),Q=E(s,"cover",b,i),G=E(s,"media",b,e.media),ie=E(s,"eyebrow",b,(ce=e.eyebrow)!=null?ce:e.kicker),D=E(s,"title",b,e.title),$=E(s,"subtitle",b,e.subtitle),Y=E(s,"header",b,e.header),W=E(s,"icon",b,u),le=E(s,"aside",b,(k=e.aside)!=null?k:e.headerAside),me=E(s,"body",b,e.body),re=E(s,"footer",b,e.footer),oe=E(s,"actions",b,e.actions),se=P.length?_.div({class:ae(["cms-card-identifier",e.identifierClass])},...P):null,te=Q.length?_.div({class:ae(["cms-card-cover",e.coverClass])},...Q):null,M=G.length?_.div({class:ae(["cms-card-media",e.mediaClass])},...G):null,q=W.length||ie.length||D.length||$.length||Y.length||le.length?_.div({class:ae(["cms-card-header",e.headerClass])},_.div({class:"cms-card-head"},W.length?_.div({class:"cms-card-icon"},...W):null,_.div({class:"cms-card-head-main"},ie.length?_.div({class:ae(["cms-card-eyebrow",e.eyebrowClass])},...ie):null,D.length?_.div({class:ae(["cms-card-title",e.titleClass])},...D):null,$.length?_.div({class:ae(["cms-card-subtitle",e.subtitleClass])},...$):null,Y.length?_.div({class:ae(["cms-card-header-content",e.headerContentClass])},...Y):null),le.length?_.div({class:ae(["cms-card-aside",e.asideClass])},...le):null)):null,ue=[...me,...y],L=ue.length?_.div({class:ae(["cms-card-body",e.bodyClass])},...ue):null,f=[...oe,...S.actions],m=re.length||f.length?_.div({class:ae(["cms-card-footer",e.footerClass])},...re,f.length?_.div({class:"cms-card-actions"},...f):null):null,g=qe([e.clickable,e.to],()=>l(e.clickable)||l(e.to)?"cms-card-clickable":""),F=P.length||S.identifier.length,X=Q.length||S.cover.length||G.length||S.media.length,a=JSswift.omit(o,["actions","aside","asideClass","body","bodyClass","clickable","cover","coverClass","coverHeight","dense","eyebrow","eyebrowClass","flat","footer","footerClass","header","headerAside","headerClass","headerContentClass","icon","iconSize","identifier","identifierClass","image","imageAlt","imageClass","imageStyle","kicker","media","mediaClass","slots","subtitle","subtitleClass","title","titleClass","to","display","direction","wrap","align","justify","gap","rowGap","columnGap","cols","columns"]);a.class=ae(["cms-panel","cms-card","cms-clear-set","cms-singularity",fe(e.flat,"cms-card-flat"),fe(e.dense,"cms-card-dense"),fe(F,"cms-card-has-identifier"),fe(X,"cms-card-has-top-visual"),g,o.class]),a.style={...o.style||{}},e.coverHeight!=null&&(a.style["--cms-card-cover-height"]=Be(l(e.coverHeight))),JSswift.uiApplyResponsiveProps(a,e,JSswift.uiResponsiveStyleRules);const C=e.onClick,h=e.onKeydown,J=d=>{var I;if(C==null||C(d),d.defaultPrevented)return;const N=l(e.to);N&&((I=JSswift.router)!=null&&I.navigate)&&(d.preventDefault(),JSswift.router.navigate(N))},j=d=>{h==null||h(d),!d.defaultPrevented&&(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),J(d))};(l(e.clickable)||l(e.to))&&(a.onClick=J,a.onKeydown=j,a.tabIndex==null&&(a.tabIndex=0),a.role==null&&(a.role="button"));const U=_.div(a,se,...S.identifier,te,...S.cover,M,...S.media,q,...S.header,L,...S.body,m,...S.footer);return Ke(U,e),U},he.Btn=(...t)=>{var te;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe([e.color,e.state],()=>{const M=l(e.color)||l(e.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(M)?M:l(e.state)||""}),r=ae(["cms-clear-set","cms-btn","cms-singularity","cms-clickable",o,fe(e.outline,"outline"),e.class]),v=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);v.class=r;const u=()=>!!l(e.loading),i=()=>!!l(e.disabled)||u(),b=e.icon!=null?typeof e.icon=="string"?he.Icon({name:e.icon}):e.icon:null,R=e.iconRight!=null?typeof e.iconRight=="string"?he.Icon({name:e.iconRight}):e.iconRight:null,S=JSswift.ui.renderSlot(s,"icon",{},b),y=JSswift.ui.renderSlot(s,"iconRight",{},R),P=JSswift.ui.renderSlot(s,"label",{},e.label),Q=E(s,"default",{},n),G=[],ie=M=>{M&&(Array.isArray(M)?G.push(...M):G.push(M))},D=e.iconAlign;(D==="after"||D==="right")&&!R?(ie(P),Q.length&&G.push(...Q),ie(S)):(ie(S),ie(P),Q.length&&G.push(...Q)),ie(y),ie(fs(e,{className:"cms-shortcode cms-btn-shortcode"})),G.length===0&&G.push(_.span("Button"));const Y=_.span({class:"cms-btn-loading",hidden:!0}),W=_.span({class:"cms-btn-content"},...G);let le=!1;const me=()=>{const M=he.Spinner?he.Spinner({size:e.loadingSize||e.spinnerSize||16,thickness:e.loadingThickness||2,color:e.loadingColor||"currentColor",label:e.loadingText||null,"aria-label":e.loadingText?null:"Loading"}):_.span({class:"cms-muted",style:{marginRight:"8px"}},e.loadingText||"Loading");return E(null,"default",{},JSswift.ui.renderSlot(s,"loading",{},M))},re=M=>{var f;if((f=e.onPointerDown)==null||f.call(e,M),i()||!(M!=null&&M.currentTarget))return;const Z=M.currentTarget,q=Z.getBoundingClientRect(),ue=typeof M.clientX=="number"?M.clientX-q.left:q.width/2,L=typeof M.clientY=="number"?M.clientY-q.top:q.height/2;Z.style.setProperty("--cms-burst-x",`${ue}px`),Z.style.setProperty("--cms-burst-y",`${L}px`),Z.classList.remove("cms-btn-burst"),Z.offsetWidth,Z.classList.add("cms-btn-burst")},oe=_.button({...v,disabled:i(),onClick:M=>{var Z,q;return i()?((Z=M==null?void 0:M.preventDefault)==null||Z.call(M),!1):(q=e.onClick)==null?void 0:q.call(e,M)},onPointerDown:re,"aria-disabled":i()?"true":null,"aria-busy":u()?"true":null},Y,W),se=JSswift.reactive.effect(()=>{const M=u(),Z=i();oe.disabled=Z,oe.classList.toggle("is-loading",M),oe.setAttribute("aria-disabled",Z?"true":"false"),M?oe.setAttribute("aria-busy","true"):oe.removeAttribute("aria-busy"),Y.hidden=!M,M!==le&&(Y.replaceChildren(...M?me():[]),le=M)},"UI.Btn:state");return(te=JSswift._registerCleanup)==null||te.call(JSswift,oe,se),Ke(oe,e),an(oe,e,{isEnabled:()=>!i(),action:()=>{if(i())return!1;oe.click()}}),oe},he.Button=he.Btn,JSswift.ui.Btn=he.Btn,JSswift.ui.Button=he.Button,he.FormField=(t={})=>{var oe,se,te,M,Z,q,ue;Yt(t);const e=t.slots||{},n=qe([t.color,t.state],()=>{const L=l(t.color)||l(t.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(L)?L:l(t.state)||""}),s=_.div({class:ae(["cms-clear-field-set","cms-field","cms-singularity-field",n,fe(t.fill,"cms-field-fill"),fe(t.outline,"outline"),t.wrapClass,t.class])}),o=E(e,"topLabel",{},t.topLabel);o.length&&s.appendChild(_.div({class:"cms-field-label"},...o));const r=t.multi||t.multiple,v=typeof t.control=="function"?t.control():t.control,u=()=>{if(typeof t.hasValue=="function")return!!t.hasValue();if(t.hasValue!=null)return!!l(t.hasValue);const L=t.getValue?t.getValue():null;return!(L==null||L==="")},i=()=>JSswift.reactive.untracked(u),b=()=>{var L,f;t.disabled||t.readonly||((L=t.onClear)==null||L.call(t),(f=t.onFocus)==null||f.call(t))},R=JSswift.ui.renderSlot(e,"control",{control:v,clear:b,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:i()},null);let S=null,y=null;if(R)S=Array.isArray(R)?_.div({class:"cms-control"},...R):R;else{S=_.div({class:"cms-control"});const L=_.div({class:"cms-addon cms-addon-left"}),f=t.icon!=null?typeof t.icon=="string"?he.Icon({name:t.icon}):t.icon:null,m=JSswift.ui.renderSlot(e,"icon",{},f),g=JSswift.ui.renderSlot(e,"prefix",{},t.prefix);E(null,"default",{},m).forEach(k=>L.appendChild(k)),E(null,"default",{},g).forEach(k=>L.appendChild(k)),L.childNodes.length&&S.appendChild(L);const F=_.div({class:"cms-mid"+(L.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});v&&F.appendChild(v);const X=E(e,"label",{},t.label);if(X.length){const k=_.div({class:ae(["cms-float-label",fe(r,"cms-multiselect")])},...X);F.appendChild(k)}S.appendChild(F);const a=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:b},he.Icon({name:"close"})):null,C=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:i()},a);C&&(C.onclick=k=>{k.stopPropagation(),b()},E(null,"default",{},C).forEach(k=>S.appendChild(k))),y=a,y&&((oe=t.clearable)!=null&&oe.action)&&t.clearable.action(k=>k?y.classList.remove("cms-d-none"):y.classList.add("cms-d-none"));const h=_.div({class:"cms-addon cms-addon-right"}),J=t.iconRight!=null?typeof t.iconRight=="string"?he.Icon({name:t.iconRight}):t.iconRight:null,j=JSswift.ui.renderSlot(e,"iconRight",{},J),U=JSswift.ui.renderSlot(e,"suffix",{},t.suffix),ce=JSswift.ui.renderSlot(e,"shortcode",{props:t},fs(t,{className:"cms-shortcode cms-field-shortcode"}));E(null,"default",{},U).forEach(k=>h.appendChild(k)),E(null,"default",{},j).forEach(k=>h.appendChild(k)),E(null,"default",{},ce).forEach(k=>h.appendChild(k)),h.childNodes.length&&(S.appendChild(h),F.classList.add("cms-with-right"))}const P=L=>L&&(L&&typeof L.action=="function"?L.value:Array.isArray(L)&&typeof L[0]=="function"?L[0]():typeof L=="function"?L():L),Q=L=>L==null||L===!1||L===""?!1:Array.isArray(L)?L.length>0:!0;let G=null;const ie=()=>{const L=[{key:"error",value:P(t.error),slot:"errorMessage",className:"cms-error"},{key:"warning",value:P(t.warning),slot:"warning",className:"cms-warning"},{key:"success",value:P(t.success),slot:"success",className:"cms-success"},{key:"note",value:P(t.note),slot:"note",className:"cms-note"},{key:"hint",value:P(t.hint),slot:"hint",className:"cms-hint"}];let f=null;for(const a of L)if(Q(a.value)){f=a;break}const m={error:L[0].value,warning:L[1].value,success:L[2].value,note:L[3].value,hint:L[4].value,props:t},g=f?E(e,f.slot,m,f.value):[],F=g.length?_.div({class:f==null?void 0:f.className},...g):null;["error","warning","success","note"].forEach(a=>{var C;return(C=S==null?void 0:S.classList)==null?void 0:C.toggle(a,(f==null?void 0:f.key)===a)}),G?F?G.replaceWith(F):G.remove():F&&s.appendChild(F),G=F},D=()=>{var f;const L=u();(f=S==null?void 0:S.classList)==null||f.toggle("has-value",L),y&&(y.style.display=L?"":"none")};JSswift.reactive.untracked(D),(se=S==null?void 0:S.classList)==null||se.toggle("disabled",!!t.disabled),s.appendChild(S);const $=JSswift.ui.getSlot(e,"errorMessage"),Y=JSswift.ui.getSlot(e,"warning"),W=JSswift.ui.getSlot(e,"success"),le=JSswift.ui.getSlot(e,"note"),me=JSswift.ui.getSlot(e,"hint");return!!((te=t.error)!=null&&te.action||(M=t.warning)!=null&&M.action||(Z=t.success)!=null&&Z.action||(q=t.note)!=null&&q.action||(ue=t.hint)!=null&&ue.action)||Array.isArray(t.error)&&typeof t.error[0]=="function"||Array.isArray(t.warning)&&typeof t.warning[0]=="function"||Array.isArray(t.success)&&typeof t.success[0]=="function"||Array.isArray(t.note)&&typeof t.note[0]=="function"||Array.isArray(t.hint)&&typeof t.hint[0]=="function"||typeof t.error=="function"||typeof t.warning=="function"||typeof t.success=="function"||typeof t.note=="function"||typeof t.hint=="function"||typeof $=="function"||typeof Y=="function"||typeof W=="function"||typeof le=="function"||typeof me=="function"?JSswift.reactive.effect(()=>{ie()},"UI.FormField:message"):ie(),s._refresh=D,s._control=S,s._el=v,s},he.InputRaw=(t={})=>{var R;const e=_.input({class:ae(["cms-input-raw",t.class]),type:t.type||"text",name:t.name,placeholder:t.placeholder,autocomplete:t.autocomplete,value:t.value});let n=(R=e.value)!=null?R:"";const s=()=>{var y;const S=(y=e.value)!=null?y:"";S!==n&&(n=S,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let o=null,r=!1;const v=()=>{if(r)return;r=!0;let S=0;const y=()=>{if(s(),S+=1,S>=10){r=!1;return}setTimeout(y,120)};setTimeout(y,40)},u=()=>{o||(o=setInterval(()=>{if(document.activeElement!==e){clearInterval(o),o=null;return}s()},250))},i=()=>{o&&(clearInterval(o),o=null)};e.addEventListener("input",()=>{var S;n=(S=e.value)!=null?S:""}),e.addEventListener("change",()=>{var S;n=(S=e.value)!=null?S:""}),e.addEventListener("animationstart",S=>{S.animationName==="cms-autofill"&&(s(),u(),v())}),e.addEventListener("focus",()=>{u(),v(),setTimeout(s,50)}),e.addEventListener("blur",()=>{i(),setTimeout(s,0)}),setTimeout(s,0),v();const b=t.model;if(b){if(typeof b=="object"&&typeof b._bind=="function")He.rodModel(e,b);else if(Array.isArray(b)&&typeof b[0]=="function"&&typeof b[1]=="function"){const S=He.rodFromSignal(b[0],b[1]);He.rodModel(e,S)}}return an(e,t,{isEnabled:()=>!e.disabled,action:()=>hn(e,{selectText:!!t.selectOnShortcode})}),e};function nl(t,e,n,s=!1){t.focus=r=>e.focus(r);const o=(r,v)=>{v==null||v===!1?e.removeAttribute(r):e.setAttribute(r,String(v))};JSswift.reactive.effect(()=>{var i;const r=(i=l(n.ariaLabel))!=null?i:typeof n.label=="string"?n.label:null;o("aria-label",r),o("aria-labelledby",l(n.ariaLabelledBy)),o("aria-describedby",l(n.ariaDescribedBy));const v=n.ariaInvalid==null?!!l(n.error):!!l(n.ariaInvalid);e.setAttribute("aria-invalid",String(v));const u=!!l(n.required);if(e.setAttribute("aria-required",String(u)),s){e.required=u;for(const b of["min","max","step","pattern","minLength","maxLength"])o(b.toLowerCase(),l(n[b]))}},"UI.Field:controlAttributes")}he.Input=(t={})=>{var G,ie,D;const e=t.slots||{},n={...t,label:(G=t.label)!=null?G:t.placeholder},s=_.input({class:ae(["cms-input",t.class]),type:t.type||"text",name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,value:(ie=t.value)!=null?ie:"",disabled:!!t.disabled,readOnly:!!t.readonly});let o=(D=s.value)!=null?D:"";const r=()=>{var Y;const $=(Y=s.value)!=null?Y:"";$!==o&&(o=$,s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})))};let v=null,u=!1;const i=()=>{if(u)return;u=!0;let $=0;const Y=()=>{if(r(),$+=1,$>=10){u=!1;return}setTimeout(Y,120)};setTimeout(Y,40)},b=()=>{v||(v=setInterval(()=>{if(document.activeElement!==s){clearInterval(v),v=null;return}r()},250))},R=()=>{v&&(clearInterval(v),v=null)};s.addEventListener("input",()=>{var $,Y;o=($=s.value)!=null?$:"",(Y=t.onInput)==null||Y.call(t,s.value)}),s.addEventListener("change",()=>{var $,Y;o=($=s.value)!=null?$:"",(Y=t.onChange)==null||Y.call(t,s.value)}),s.addEventListener("focus",$=>{var Y;(Y=t.onFocus)==null||Y.call(t,$),b(),i(),setTimeout(r,50)}),s.addEventListener("blur",$=>{var Y;(Y=t.onBlur)==null||Y.call(t,$),R(),setTimeout(r,0)}),s.addEventListener("animationstart",$=>{$.animationName==="cms-autofill"&&(r(),b(),i())}),setTimeout(r,0),i();const S=t.model;if(S){const $=Y=>{let W=!1;const le=re=>{const oe=re!=null?re:"";s.value!==oe&&(s.value=oe,o=oe)};Y.action(re=>{if(!W){W=!0;try{le(re)}finally{W=!1}}}),JSswift.reactive.untracked(()=>le(Y.value));const me=re=>{if(W||re!=null&&re.isComposing)return;const oe=s.value;if(Y.value!==oe){W=!0;try{Y.value=oe}finally{W=!1}}};s.addEventListener("input",me),s.addEventListener("compositionend",me),typeof Y.onDispose=="function"&&Y.onDispose(()=>{s.removeEventListener("input",me),s.removeEventListener("compositionend",me)})};if(typeof S=="object"&&typeof S._bind=="function")$(S);else if(Array.isArray(S)&&typeof S[0]=="function"&&typeof S[1]=="function"){const Y=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(S[0],S[1]));$(Y)}}const y=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),P=Array.isArray(y)?_.div({style:{display:"contents"}},...y):y,Q=he.FormField({...n,control:P,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var $;return($=Q._refresh)==null?void 0:$.call(Q)}),s.addEventListener("change",()=>{var $;return($=Q._refresh)==null?void 0:$.call(Q)}),Q._input=s,nl(Q,s,t,!0),an(s,t,{isEnabled:()=>!s.disabled,action:()=>hn(s,{selectText:!!t.selectOnShortcode})}),Q},he.Textarea=(t={})=>{var b,R,S,y;const e=t.slots||{},n={...t,label:(b=t.label)!=null?b:t.placeholder,wrapClass:ae(["cms-textarea-field",t.wrapClass])},s=_.textarea({class:ae(["cms-input","cms-textarea",t.class]),name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,rows:t.rows,cols:t.cols,maxLength:(R=t.maxLength)!=null?R:t.maxlength,minLength:(S=t.minLength)!=null?S:t.minlength,wrap:t.wrap,value:(y=t.value)!=null?y:"",disabled:!!t.disabled,readOnly:!!t.readonly});s.addEventListener("input",()=>{var P;(P=t.onInput)==null||P.call(t,s.value)}),s.addEventListener("change",()=>{var P;(P=t.onChange)==null||P.call(t,s.value)}),s.addEventListener("focus",P=>{var Q;(Q=t.onFocus)==null||Q.call(t,P)}),s.addEventListener("blur",P=>{var Q;(Q=t.onBlur)==null||Q.call(t,P)});const o=t.model;if(o){const P=Q=>{let G=!1;const ie=$=>{const Y=$!=null?$:"";s.value!==Y&&(s.value=Y)};Q.action($=>{if(!G){G=!0;try{ie($)}finally{G=!1}}}),JSswift.reactive.untracked(()=>ie(Q.value));const D=$=>{if(G||$!=null&&$.isComposing)return;const Y=s.value;if(Q.value!==Y){G=!0;try{Q.value=Y}finally{G=!1}}};s.addEventListener("input",D),s.addEventListener("compositionend",D),typeof Q.onDispose=="function"&&Q.onDispose(()=>{s.removeEventListener("input",D),s.removeEventListener("compositionend",D)})};if(typeof o=="object"&&typeof o._bind=="function")P(o);else if(Array.isArray(o)&&typeof o[0]=="function"&&typeof o[1]=="function"){const Q=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(o[0],o[1]));P(Q)}}const r=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",v=JSswift.ui.renderSlot(e,r,{textarea:s,input:s,props:t},s),u=Array.isArray(v)?_.div({style:{display:"contents"}},...v):v,i=he.FormField({...n,control:u,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var P;return(P=i._refresh)==null?void 0:P.call(i)}),s.addEventListener("change",()=>{var P;return(P=i._refresh)==null?void 0:P.call(i)}),i._input=s,i._textarea=s,an(s,t,{isEnabled:()=>!s.disabled,action:()=>hn(s,{selectText:!!t.selectOnShortcode})}),i},he.Search=(t={})=>{var z,we;const e=t.slots||{},n=T=>!!T&&(typeof T=="object"&&typeof T._bind=="function"||At(T)),s=n(t.model)?t.model:n(t.value)?t.value:null,o=s?typeof s=="object"&&typeof s._bind=="function"?s.value:s[0]():l(t.value),[r,v]=JSswift.reactive.signal(o==null?"":String(o)),[u,i]=JSswift.reactive.signal(!1),[b,R]=JSswift.reactive.signal(!1),[S,y]=JSswift.reactive.signal(null),[P,Q]=JSswift.reactive.signal([]),[G,ie]=JSswift.reactive.signal(-1),D=`cms-search-${Math.random().toString(36).slice(2,10)}`,$=new Map;let Y=null,W=null,le=null,me=0,re=0,oe=!1,se=-1,te=[];const M=(T,x)=>{const w=Number(l(T));return Number.isFinite(w)?w:x},Z=(T,x=!1)=>{const w=l(T);return w==null?x:!!w},q=()=>Z(t.disabled,!1),ue=()=>Z(t.readonly,!1),L=()=>Math.max(0,M(t.minLength,t.endpoint?1:0)),f=()=>Math.max(0,M(t.debounce,250)),m=T=>{var w,c,A,de,Le;const x=t.getLabel||t.labelOf;return typeof x=="function"?x(T):T==null?"":typeof T=="string"||typeof T=="number"?String(T):(Le=(de=(A=(c=(w=T.label)!=null?w:T.title)!=null?c:T.name)!=null?A:T.text)!=null?de:T.value)!=null?Le:""},g=T=>{var w,c,A;const x=t.getValue||t.valueOf;return typeof x=="function"?x(T):T==null?"":typeof T=="string"||typeof T=="number"?T:(A=(c=(w=T.value)!=null?w:T.id)!=null?c:T.key)!=null?A:m(T)},F=T=>Array.isArray(T)?T:!T||typeof T!="object"?[]:Array.isArray(T.items)?T.items:Array.isArray(T.results)?T.results:Array.isArray(T.data)?T.data:[],X=async(T,x)=>{const w=typeof T=="function"?T(x,{props:t}):l(T);return w&&typeof w.then=="function"?await w:w},a=(T,x)=>{const w=typeof T=="function"?T(x,{props:t}):l(T);if(!w)return"";const c=String(w),A=new URL(c,window.location.href),de=l(t.queryParam)||"q";de&&A.searchParams.set(de,x);const Le=typeof t.params=="function"?t.params(x,{props:t}):l(t.params);return Le&&typeof Le=="object"&&Object.keys(Le).forEach(Je=>{const B=l(Le[Je]);B==null||B===!1||A.searchParams.set(Je,String(B))}),A.toString()},C=(T,x={})=>{var c,A;const w=T==null?"":String(T);r()!==w&&v(w),ee.value!==w&&(ee.value=w),Y&&!x.fromModel&&Y(w),x.fromModel||(c=t.onInput)==null||c.call(t,w,x.event),(A=pe==null?void 0:pe._refresh)==null||A.call(pe)},h=()=>{i(!1),ie(-1)},J=()=>b()||S()||P().length?!0:r().trim().length>=L()?!!(t.emptyText||JSswift.ui.getSlot(e,"empty")!=null):!!(t.startText||JSswift.ui.getSlot(e,"empty")!=null),j=()=>{q()||J()&&(i(!0),Se())},U=()=>{Q([]),y(null),ie(-1)},ce=async(T,x={})=>{var B,Ae,Me,Ee,De,Ue;const w=T==null?"":String(T).trim(),c=++me,A=l((B=t.endpoint)!=null?B:t.url),de=(Me=(Ae=t.items)!=null?Ae:t.options)!=null?Me:t.suggestions;if(le&&(le.abort(),le=null),w.length<L()){R(!1),U(),x.open&&J()?j():J()||h();return}const Le=t.cache!==!1,Je=`${A||"local"}::${w}`;if(Le&&$.has(Je)){Q($.get(Je)),y(null),R(!1),ie($.get(Je).length?0:-1),x.open!==!1&&j();return}R(!0),y(null),x.open!==!1&&j(),(Ee=t.onSearch)==null||Ee.call(t,w);try{let Ye;if(A){le=new AbortController;const Te=a(A,w),je=await fetch(Te,{method:"GET",headers:t.headers,credentials:t.credentials,signal:le.signal});if(!je.ok)throw new Error(`Search request failed (${je.status})`);Ye=await(t.parseResponse||(nt=>nt.json()))(je)}else if(de!=null){const Te=F(await X(de,w)),je=t.filter||((tt,nt)=>String(m(tt)).toLowerCase().includes(nt.toLowerCase()));Ye=Te.filter(tt=>je(tt,w))}else Ye=[];if(c!==me)return;const Ze=typeof t.mapResponse=="function"?t.mapResponse(Ye,w):F(Ye),Qe=F(Ze);Le&&$.set(Je,Qe),Q(Qe),ie(Qe.length?0:-1),(De=t.onResults)==null||De.call(t,Qe,w)}catch(Ye){if((Ye==null?void 0:Ye.name)==="AbortError"||c!==me)return;y(Ye),Q([]),ie(-1),(Ue=t.onError)==null||Ue.call(t,Ye,w)}finally{c===me&&(R(!1),le=null,Se())}},k=(T,x={})=>{W&&clearTimeout(W);const w=x.immediate?0:f();W=setTimeout(()=>{W=null,ce(T,x)},w)},d=T=>{var w;const x=r();(w=t.onSubmit)==null||w.call(t,x,T),t.submitOnEnter!==!1&&k(x,{immediate:!0,open:!0})},N=(T,x)=>{var A;if(!T)return;const w=g(T),c=m(T);t.commitValue==="value"?C(w,{event:x}):t.commitValue!==!1&&C(c,{event:x}),(A=t.onSelect)==null||A.call(t,T,{value:w,label:c,query:r(),event:x}),t.closeOnSelect!==!1&&h()},I=T=>{const x=P();if(!x.length)return;const w=G(),c=w<0?T>0?0:x.length-1:Math.max(0,Math.min(x.length-1,w+T));ie(c)},H=T=>{const x=T==null?"":String(T),w=r().trim();if(!w||t.highlight===!1)return[document.createTextNode(x)];const c=x.toLowerCase().indexOf(w.toLowerCase());return c<0?[document.createTextNode(x)]:[document.createTextNode(x.slice(0,c)),_.mark({class:"cms-search-highlight"},x.slice(c,c+w.length)),document.createTextNode(x.slice(c+w.length))]},ge=T=>{var c,A;const x=m(T),w=T&&typeof T=="object"?(A=(c=T.description)!=null?c:T.subtitle)!=null?A:T.note:null;return _.div({class:"cms-search-result-content"},_.div({class:"cms-search-result-label"},...H(x)),w?_.div({class:"cms-search-result-description"},String(w)):null)},Se=()=>{!u()||be.parentNode!==document.body||re||(re=requestAnimationFrame(()=>{if(re=0,!u()||!Ce.isConnected||be.parentNode!==document.body)return;const T=Ce.getBoundingClientRect(),x=6,w=8,c=Math.max(180,window.innerWidth-w*2),A=Math.min(Math.max(T.width,M(t.minMenuWidth,260)),c),de=Math.max(w,Math.min(T.left,window.innerWidth-A-w));be.style.width=`${A}px`,be.style.left=`${de}px`,be.style.right="auto";const Le=be.getBoundingClientRect().height||0,Je=window.innerHeight-T.bottom-x-w,B=T.top-x-w;let Me=Je<180&&B>Je?T.top-x-Le:T.bottom+x;Me=Math.max(w,Math.min(Me,window.innerHeight-Le-w)),be.style.top=`${Me}px`}))},ye=()=>{oe||(oe=!0,window.addEventListener("resize",Se),window.addEventListener("scroll",Se,!0))},V=()=>{oe&&(oe=!1,window.removeEventListener("resize",Se),window.removeEventListener("scroll",Se,!0))},O=()=>{be.parentNode!==document.body&&(re&&(cancelAnimationFrame(re),re=0),be.classList.add("portal"),be.style.display="block",document.body.appendChild(be),ye(),Se())},K=()=>{re&&(cancelAnimationFrame(re),re=0),V(),be.parentNode!==Ce&&Ce.appendChild(be),be.classList.remove("portal"),be.style.display="",be.style.position="",be.style.top="",be.style.left="",be.style.right="",be.style.width=""},ke=t.label!=null||JSswift.ui.getSlot(e,"label")!=null,Ne=()=>{if(!ke){ee.placeholder=l(t.placeholder)||"";return}ee.placeholder=document.activeElement===ee&&l(t.placeholder)||""},ee=_.input({id:t.id,class:ae(["cms-input","cms-search-input",t.inputClass]),type:"search",name:t.name,placeholder:ke?"":t.placeholder,autocomplete:t.autocomplete||"off",inputmode:t.inputmode,value:r(),disabled:q(),readOnly:ue(),role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-controls":`${D}-list`}),xe=_.div({id:`${D}-list`,class:"cms-search-results",role:"listbox"}),be=_.div({class:ae(["cms-search-menu","cms-singularity-menu-select",t.menuClass,fe(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:T=>T.stopPropagation()},xe),Ce=_.div({class:ae(["cms-search",t.class]),role:"presentation"},ee,be);let pe=null;if(s){if(typeof s=="object"&&typeof s._bind=="function")s.action(T=>C(T,{fromModel:!0})),Y=T=>{s.value!==T&&(s.value=T)};else if(Array.isArray(s)&&typeof s[0]=="function"&&typeof s[1]=="function"){const T=s[0],x=s[1];JSswift.reactive.effect(()=>{C(T(),{fromModel:!0})},"UI.Search:model"),Y=w=>x(w)}}else at(t.value)&&JSswift.reactive.effect(()=>{C(l(t.value),{fromModel:!0})},"UI.Search:value");ee.addEventListener("input",T=>{C(ee.value,{event:T}),t.searchOnInput!==!1&&k(ee.value,{open:!0})}),ee.addEventListener("change",T=>{var x;return(x=t.onChange)==null?void 0:x.call(t,ee.value,T)}),ee.addEventListener("focus",T=>{var x;Ne(),(x=t.onFocus)==null||x.call(t,T),t.openOnFocus!==!1&&(t.searchOnFocus&&!P().length?k(ee.value,{immediate:!0,open:!0}):j())}),ee.addEventListener("blur",T=>{var x;Ne(),(x=t.onBlur)==null||x.call(t,T)}),ee.addEventListener("keydown",T=>{if(q()||ue())return;const x=u(),w=P(),c=G();if(T.key==="Escape"){x&&(T.preventDefault(),h());return}if(T.key==="ArrowDown"){T.preventDefault(),x?I(1):(j(),w.length||k(ee.value,{immediate:!0,open:!0}));return}if(T.key==="ArrowUp"){T.preventDefault(),x?I(-1):j();return}if(T.key==="Home"&&x&&w.length&&(T.metaKey||T.ctrlKey)){T.preventDefault(),ie(0);return}if(T.key==="End"&&x&&w.length&&(T.metaKey||T.ctrlKey)){T.preventDefault(),ie(w.length-1);return}T.key==="Enter"&&(x&&c>=0&&w[c]?(T.preventDefault(),N(w[c],T)):d(T))});const Ie=T=>{if(!Ce.isConnected)return;const x=T.target;Ce.contains(x)||be.contains(x)||h()};document.addEventListener("click",Ie,!0),JSswift.reactive.effect(()=>{const T=u();Ce.classList.toggle("open",T),ee.setAttribute("aria-expanded",T?"true":"false"),T?O():K()},"UI.Search:open"),JSswift.reactive.effect(()=>{const T=q(),x=ue();Ce.classList.toggle("disabled",T),Ce.classList.toggle("readonly",x),ee.disabled=T,ee.readOnly=x},"UI.Search:disabled"),JSswift.reactive.effect(()=>{const T=b(),x=S(),w=P(),c=r();if(xe.innerHTML="",te=[],se=-1,T){const A=JSswift.ui.renderSlot(e,"loading",{query:c},t.loadingText||"Caricamento...");xe.appendChild(_.div({class:"cms-search-empty is-loading"},...E(null,"default",{},A)))}else if(x){const A=JSswift.ui.renderSlot(e,"error",{error:x,query:c},t.errorText||"Errore ricerca");xe.appendChild(_.div({class:"cms-search-empty is-error"},...E(null,"default",{},A)))}else if(w.length)w.forEach((A,de)=>{const Je=m(A),B=g(A),Ae=De=>N(A,De),Me=JSswift.ui.renderSlot(e,"result",{item:A,index:de,active:!1,label:Je,value:B,query:c,select:Ae},ge(A)),Ee=_.div({id:`${D}-result-${de}`,class:ae(["cms-search-result",""]),role:"option","aria-selected":"false",onMouseEnter:()=>ie(de),onMouseDown:De=>De.preventDefault(),onClick:Ae},...E(null,"default",{},Me));xe.appendChild(Ee),te[de]=Ee});else{const de=c.trim().length>=L()?t.emptyText||"Nessun risultato":t.startText||"",Le=JSswift.ui.renderSlot(e,"empty",{query:c},de);(de||JSswift.ui.getSlot(e,"empty")!=null)&&xe.appendChild(_.div({class:"cms-search-empty"},...E(null,"default",{},Le)))}J()||h(),Se()},"UI.Search:render"),JSswift.reactive.effect(()=>{const T=G();T!==se&&(te[se]&&(te[se].classList.remove("active"),te[se].setAttribute("aria-selected","false")),te[T]?(te[T].classList.add("active"),te[T].setAttribute("aria-selected","true"),te[T].scrollIntoView({block:"nearest"}),ee.setAttribute("aria-activedescendant",`${D}-result-${T}`)):ee.removeAttribute("aria-activedescendant"),se=T)},"UI.Search:active"),pe=he.FormField({...t,icon:(z=t.icon)!=null?z:"search",wrapClass:ae(["cms-search-field",t.wrapClass]),control:Ce,getValue:()=>r(),onClear:()=>{var T;q()||ue()||(C("",{}),U(),(T=t.onClear)==null||T.call(t))},onFocus:()=>ee.focus()}),ee.addEventListener("input",()=>{var T;return(T=pe._refresh)==null?void 0:T.call(pe)}),ee.addEventListener("change",()=>{var T;return(T=pe._refresh)==null?void 0:T.call(pe)}),pe._input=ee,pe._search=Ce,pe._open=j,pe._close=h,pe._searchNow=()=>ce(r(),{immediate:!0,open:!0}),pe._getResults=P,pe._setValue=T=>C(T,{});let _e=!1;return pe._dispose=()=>{_e||(_e=!0,document.removeEventListener("click",Ie,!0),W&&clearTimeout(W),le&&le.abort(),K())},(we=JSswift._registerCleanup)==null||we.call(JSswift,pe,pe._dispose),an(ee,t,{isEnabled:()=>!ee.disabled,action:()=>hn(ee,{selectText:!!t.selectOnShortcode})}),(t.autoSearch||t.searchOnMount)&&k(r(),{immediate:!0,open:!1}),pe},he.Select=(t={})=>{var we,T;const e={...t,label:(we=t.label)!=null?we:t.placeholder},n=t.filterable,s=!!t.multiple||!!t.multi,o=!!t.allowCustom||!!t.allowCustomValue,r=t.slots||{},v=x=>!!x&&(typeof x=="object"&&typeof x._bind=="function"||At(x)),u=v(t.model)?t.model:v(t.value)?t.value:null,i=x=>Array.isArray(x)?x.slice():x==null||x===""?[]:[x],b=x=>s?i(x):x,R=u?JSswift.reactive.untracked(()=>typeof u=="object"&&typeof u._bind=="function"?u.value:u[0]()):t.value,[S,y]=JSswift.reactive.signal(!1),[P,Q]=JSswift.reactive.signal(""),[G,ie]=JSswift.reactive.signal(s?i(R):R!=null?R:""),[D,$]=JSswift.reactive.signal(!1),[Y,W]=JSswift.reactive.signal([]),[le,me]=JSswift.reactive.signal([]),[re,oe]=JSswift.reactive.signal(-1);let se=null;if(u){if(typeof u=="object"&&typeof u._bind=="function")JSswift.reactive.untracked(()=>ie(b(u.value))),u.action(x=>ie(b(x))),se=x=>{const w=b(x);u.value!==w&&(u.value=w)};else if(Array.isArray(u)&&typeof u[0]=="function"&&typeof u[1]=="function"){const x=u[0],w=u[1];JSswift.reactive.untracked(()=>{JSswift.reactive.effect(()=>{ie(b(x()))},"UI.Select:model")}),se=c=>w(b(c))}}function te(){var x;return typeof t.disabled=="function"?t.disabled():typeof t.disabled=="boolean"?t.disabled:(x=t==null?void 0:t.disabled)!=null&&x.action?t.disabled.value:!1}function M(x){var w,c,A,de;if(x==null)return null;if(typeof x=="string"||typeof x=="number")return{type:"option",label:String(x),value:x,disabled:!1};if(typeof x=="object"){if(Array.isArray(x.options))return{type:"group",label:String((w=x.label)!=null?w:""),options:x.options};const Le=(c=x.label)!=null?c:x.value!=null?String(x.value):"";return{type:"option",label:String(Le),value:(de=(A=x.value)!=null?A:x.label)!=null?de:"",disabled:!!x.disabled}}return{type:"option",label:String(x),value:x,disabled:!1}}function Z(x){const c=(Array.isArray(x)?x:[]).map(M).filter(Boolean),A=[],de=[];for(const Le of c)if(Le.type==="group"){A.push({type:"group",label:Le.label});const Je=(Le.options||[]).map(M).filter(Boolean).filter(B=>B.type==="option");for(const B of Je)A.push(B),de.push(B)}else A.push(Le),de.push(Le);W(A),me(de)}async function q(){const x=t.options;let w;try{const c=typeof x=="function"?JSswift.ui.withoutRodPathCapture(()=>x()):x;c&&typeof c.then=="function"?($(!0),w=await c):w=c,Z(w)}catch(c){console.error("[UI.Select] options load error:",c),Z([])}finally{$(!1)}}function ue(x){var c;const w=b(x);ie(w),se&&se(w),(c=t.onChange)==null||c.call(t,w)}function L(x){const w=i(G()),A=w.some(de=>de==x)?w.filter(de=>de!=x):[...w,x];ue(A)}function f(x,w=!1){s?(L(x),w&&m()):(ue(x),g())}function m(){Q(""),ce&&(ce.value="")}function g(){y(!1),m(),oe(-1)}async function F(){if(te())return;y(!0),await q();const x=G(),w=le();let c=-1;if(s){const A=i(x);for(const de of A)if(c=w.findIndex(Le=>Le.value==de&&!Le.disabled),c>=0)break}else c=w.findIndex(A=>A.value==x&&!A.disabled);c<0&&(c=w.findIndex(A=>!A.disabled)),oe(c),ce&&setTimeout(()=>ce.focus(),0)}function X(){S()?g():F()}const a=_.div({class:ae(["cms-select",s?"multiple":"",t.class]),tabIndex:te()?-1:0,role:"combobox","aria-expanded":"false","aria-disabled":te()?"true":"false"}),C=_.div({class:ae(["cms-select-value",s?"cms-select-value-multi":""])});JSswift.reactive.effect(()=>{const x=le();if(C.innerHTML="",s){const w=i(G());for(const c of w){const A=x.find(B=>B.value==c),de=A?A.label:c==null?"":String(c);let Le=!1;const Je=he.Chip({label:de,dense:!0,color:t.chipColor||t.color,icon:t.chipIcon||null,iconRight:t.chipIconRight||null,glossy:t.glossy,glow:t.glow,glass:t.chipGlass||t.glass,class:t.chipClass,flat:t.flat,rounded:t.rounded,outline:t.outline,shadow:t.chipShadow,lightShadow:t.lightShadow,gloss:t.gloss,border:t.border,size:t.chipSize,removable:!0,onRemove:B=>{var Ae,Me,Ee;(Ae=B==null?void 0:B.preventDefault)==null||Ae.call(B),(Me=B==null?void 0:B.stopPropagation)==null||Me.call(B),(Ee=B==null?void 0:B.stopImmediatePropagation)==null||Ee.call(B),!Le&&(Le=!0,L(c))}});C.appendChild(Je)}}else{const w=G(),c=x.find(A=>A.value==w);C.textContent=c?c.label:w==null||w===""?"":String(w)}},"UI.Select:value");const h=_.div({class:"cms-select-arrow"});JSswift.reactive.effect(()=>{const x=JSswift.ui.renderSlot(r,"arrow",{open:S()},he.Icon("#chevron-down"));h.innerHTML="",E(null,"default",{},x).forEach(w=>h.appendChild(w))},"UI.Select:arrow");const J=_.div({class:"cms-select-control",onClick:X},C,h),j=_.div({class:"cms-select-options",role:"listbox","aria-multiselectable":s?"true":"false"}),U=_.div({class:"cms-select-filter cms-d-none"});let ce=null;const k=_.input({class:"cms-input",type:"text",placeholder:t.filterPlaceholder||"Cerca...",onInput:x=>Q(x.target.value||"")}),d=()=>{const x=JSswift.ui.renderSlot(r,"filter",{value:P(),setValue:c=>{const A=c==null?"":String(c);Q(A),ce&&"value"in ce&&(ce.value=A)},close:g},k);U.innerHTML="";const w=E(null,"default",{},x);w.forEach(c=>U.appendChild(c)),ce=w.length===1&&w[0]&&w[0].tagName==="INPUT"?w[0]:null,ce&&(ce.value=P()||"")};JSswift.reactive.untracked(d),JSswift.reactive.effect(()=>{const x=P()||"";ce&&"value"in ce&&ce.value!==x&&(ce.value=x)},"UI.Select:filterValue"),typeof n=="boolean"?n?U.classList.remove("cms-d-none"):U.classList.add("cms-d-none"):n!=null&&n.action&&(n.action(x=>{x?U.classList.remove("cms-d-none"):U.classList.add("cms-d-none")}),n.value?U.classList.remove("cms-d-none"):U.classList.add("cms-d-none"));const N={...t};Yt(N);const I=qe([N.color,N.state],()=>{const x=l(N.color)||l(N.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(x)?x:l(N.state)||""}),H=_.div({class:ae(["cms-select-menu","cms-singularity-menu-select",I,N.class,fe(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:x=>x.stopPropagation()},U,j);let ge=0,Se=!1;const ye=()=>{!S()||H.parentNode!==document.body||ge||(ge=requestAnimationFrame(()=>{if(ge=0,!S()||!a.isConnected||H.parentNode!==document.body)return;const x=a.getBoundingClientRect(),w=6,c=8,A=Math.max(160,window.innerWidth-c*2),de=Math.min(Math.max(x.width,180),A),Le=Math.max(c,Math.min(x.left,window.innerWidth-de-c));H.style.width=`${de}px`,H.style.left=`${Le}px`,H.style.right="auto",H.style.marginTop="0";const Je=H.getBoundingClientRect().height||0,B=window.innerHeight-x.bottom-w-c,Ae=x.top-w-c;let Ee=B<180&&Ae>B?x.top-w-Je:x.bottom+w;Ee=Math.max(c,Math.min(Ee,window.innerHeight-Je-c)),H.style.top=`${Ee}px`}))},V=()=>{Se||(Se=!0,window.addEventListener("resize",ye),window.addEventListener("scroll",ye,!0))},O=()=>{Se&&(Se=!1,window.removeEventListener("resize",ye),window.removeEventListener("scroll",ye,!0))},K=()=>{H.parentNode!==document.body&&(ge&&(cancelAnimationFrame(ge),ge=0),H.classList.add("portal"),H.style.display="block",document.body.appendChild(H),V(),ye())},ke=()=>{ge&&(cancelAnimationFrame(ge),ge=0),O(),H.parentNode!==a&&a.appendChild(H),H.classList.remove("portal"),H.style.display="",H.style.position="",H.style.top="",H.style.left="",H.style.right="",H.style.width="",H.style.marginTop=""};a.appendChild(J),a.appendChild(H),JSswift.reactive.effect(()=>{const x=S();a.classList.toggle("open",x),a.setAttribute("aria-expanded",x?"true":"false"),x?K():ke()},"UI.Select:open"),JSswift.reactive.effect(()=>{const x=te();a.classList.toggle("disabled",x),a.tabIndex=x?-1:0,a.setAttribute("aria-disabled",x?"true":"false")},"UI.Select:disabled");let Ne=[],ee=-1,xe=-1;function be(){var w;const x=re();xe=x,x!==ee&&(Ne[ee]&&Ne[ee].classList.remove("active"),Ne[x]&&Ne[x].classList.add("active"),ee=x,x>=0&&((w=Ne[x])==null||w.scrollIntoView({block:"nearest"})))}JSswift.reactive.effect(()=>{const x=Y(),w=le(),c=(P()||"").toLowerCase().trim(),A=G(),de=s?i(A):[A],Le=D(),Je=xe;j.innerHTML="",Ne=[],ee=-1;const B=[];let Ae=0;const Me=Ee=>{const De=de.some(tt=>tt==Ee.value),Ue=!!Ee.disabled,Ye=["cms-select-option",De?"selected":"",Ue?"disabled":""].filter(Boolean).join(" "),Ze=()=>{s?L(Ee.value):(ue(Ee.value),g())},Qe=JSswift.ui.renderSlot(r,"option",{opt:Ee,selected:De,active:Ae===Je,disabled:Ue,select:Ze},Ee.label),Te=E(null,"default",{},Qe),je=_.div({class:Ye,"data-flat-index":String(Ae),onClick:Ue?null:Ze},...Te);B.push(je),Ne[Ae]=je,Ae++};if(c){const Ee=w.filter(De=>De.label.toLowerCase().includes(c));if(Ee.length===0){const De=JSswift.ui.renderSlot(r,"empty",{filter:c},t.emptyText||"Nessuna opzione");j.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},De))),S()&&ye();return}for(const De of Ee)Me(De)}else{let Ee=!1;for(const De of x)if(De.type==="group"){const Ue=JSswift.ui.renderSlot(r,"group",{label:De.label},De.label);B.push(_.div({class:"cms-select-group"},...E(null,"default",{},Ue)))}else Ee=!0,Me(De);if(!Ee){const De=JSswift.ui.renderSlot(r,"empty",{filter:c},t.emptyText||"Nessuna opzione");j.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},De))),S()&&ye();return}}if(Le){const Ee=JSswift.ui.renderSlot(r,"loading",{},"Caricamento...");j.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},Ee))),S()&&ye();return}for(const Ee of B)j.appendChild(Ee);be(),S()&&ye()},"UI.Select:render"),JSswift.reactive.effect(()=>{be()},"UI.Select:paintActive");const Ce=x=>{if(!a.isConnected)return;const w=x.target;a.contains(w)||H.contains(w)||g()};document.addEventListener("click",Ce,!0);const pe=x=>{if(te())return;const w=S(),c=le(),A=re(),de=ce&&x.target===ce,Le=(B,Ae)=>{let Me=B;for(;Me>=0&&Me<c.length;){if(!c[Me].disabled)return Me;Me+=Ae}return-1},Je=B=>{if(!B)return null;const Ae=B.toLowerCase();let Me=c.find(Ee=>String(Ee.label).toLowerCase()===Ae||String(Ee.value).toLowerCase()===Ae);return Me||(Me=c.find(Ee=>String(Ee.label).toLowerCase().includes(Ae))),Me&&!Me.disabled?Me:null};if(x.key==="Escape"){w&&(x.preventDefault(),g());return}if(de&&(x.key==="Enter"||x.key===" ")){const B=(P()||"").trim();if(B){const Ae=Je(B);if(Ae){x.preventDefault(),f(Ae.value,!0);return}if(o&&x.key==="Enter"){x.preventDefault(),f(B,!0);return}if(x.key==="Enter"){x.preventDefault();return}}if(x.key===" ")return}if(x.key==="Enter"||x.key===" "){if(x.preventDefault(),!w){F();return}A>=0&&c[A]&&!c[A].disabled&&(s?L(c[A].value):(ue(c[A].value),g()));return}if(x.key==="ArrowDown"){if(x.preventDefault(),!w){F();return}const B=Le(A<0?0:A+1,1);B>=0&&oe(B);return}if(x.key==="ArrowUp"){if(x.preventDefault(),!w){F();return}const B=Le(A<0?c.length-1:A-1,-1);B>=0&&oe(B);return}if(x.key==="Home"){if(!w)return;x.preventDefault();const B=Le(0,1);B>=0&&oe(B);return}if(x.key==="End"){if(!w)return;x.preventDefault();const B=Le(c.length-1,-1);B>=0&&oe(B);return}};a.addEventListener("keydown",pe),U.addEventListener("keydown",pe);let Ie=!1;a._dispose=()=>{Ie||(Ie=!0,document.removeEventListener("click",Ce,!0),a.removeEventListener("keydown",pe),U.removeEventListener("keydown",pe),ke())};const _e=()=>{const x=G();return s?Array.isArray(x)&&x.length>0:x==null?!1:x!==""?!0:le().some(w=>w.value==="")},z=he.FormField({...e,control:a,clearable:t.clearable,disabled:te(),readonly:!1,hasValue:_e,getValue:()=>{const x=G();return s?Array.isArray(x)&&x.length?x:"":x},onClear:()=>{te()||(ue(s?[]:null),g())},onFocus:()=>{F()}});return JSswift.reactive.effect(()=>{var x;(x=z._refresh)==null||x.call(z)},"UI.Select:fieldRefresh"),nl(z,a,t),z._select=a,z._dispose=a._dispose,(T=JSswift._registerCleanup)==null||T.call(JSswift,z,z._dispose),an(z,t,{isEnabled:()=>!te(),action:()=>{if(te())return!1;hn(a),F()}}),q(),z},he.Upload=(t={})=>{var _e;Yt(t);const e=t.slots||{},[n,s]=JSswift.reactive.signal([]),[o,r]=JSswift.reactive.signal(!1),[v,u]=JSswift.reactive.signal(!1),[i,b]=JSswift.reactive.signal(null);let R=0,S=!1;const y=()=>!!l(t.disabled)||!!l(t.readonly),P=()=>t.multiple!==!1&&t.single!==!0,Q=()=>{var z,we;return["form","native","submit","external"].includes(String(l((we=(z=t.submitMode)!=null?z:t.modeSubmit)!=null?we:t.uploadMode)||"").toLowerCase())},G=()=>{var z;return l((z=t.showBrowse)!=null?z:t.browseButton)!==!1},ie=()=>{var z;return!Q()&&l((z=t.showUpload)!=null?z:t.uploadButton)!==!1},D=()=>{var z;return l((z=t.showClear)!=null?z:t.clearButton)!==!1},$=()=>{var z;return l((z=t.showFiles)!=null?z:t.files)!==!1},Y=()=>{const z=mt(l(t.state)||l(t.status));return z?`cms-state-${z}`:""},W=()=>t.fieldName||t.paramName||t.name||"file",le=()=>{var z;return Math.max(1,Number(l((z=t.parallelUploads)!=null?z:t.parallel)||1))},me=()=>{var we,T,x,w;const z=l(t.retry);return z===!0?{attempts:2,delay:350,factor:2}:z?{attempts:Math.max(0,Number((T=(we=z.attempts)!=null?we:z.retries)!=null?T:0)),delay:Math.max(0,Number((x=z.delay)!=null?x:350)),factor:Math.max(1,Number((w=z.factor)!=null?w:2))}:{attempts:0,delay:350,factor:2}},re=z=>z?Array.isArray(z)?z:Array.from(z):[],oe=z=>{const we=Number(z||0);return we<1024?`${we} B`:we<1024*1024?`${(we/1024).toFixed(1)} KB`:we<1024*1024*1024?`${(we/1024/1024).toFixed(1)} MB`:`${(we/1024/1024/1024).toFixed(1)} GB`},se=()=>{var z;return String(l((z=t.acceptedFiles)!=null?z:t.accept)||"").trim()},te=z=>{const we=se();if(!we)return!0;const T=String(z.name||"").toLowerCase(),x=String(z.type||"").toLowerCase();return we.split(",").map(w=>w.trim().toLowerCase()).filter(Boolean).some(w=>w.startsWith(".")?T.endsWith(w):w.endsWith("/*")?x.startsWith(w.slice(0,-1)):x===w)},M=()=>n().filter(z=>z.status!=="rejected"&&z.status!=="removed"),Z=(z=0)=>M().reduce((we,T)=>we+Number(T.size||0),z),q=()=>{var z;s(n().slice()),O.classList.toggle("is-busy",n().some(we=>we.status==="uploading")),O.classList.toggle("has-files",n().some(we=>we.status!=="removed")),(z=t.onChange)==null||z.call(t,n().slice(),K)},ue=(z,we,T=null)=>{var w;const x={id:`upload_${Date.now()}_${++R}`,file:z,name:(z==null?void 0:z.name)||"file",size:Number((z==null?void 0:z.size)||0),type:(z==null?void 0:z.type)||"",status:"rejected",progress:0,error:we,detail:T,attempts:0,response:null,xhr:null};return n().push(x),(w=t.onRejected)==null||w.call(t,x,{reason:we,detail:T,api:K}),x},L=async(z,we)=>{const T=t.maxFiles==null?null:Number(l(t.maxFiles)),x=t.maxFileSize==null?null:Number(l(t.maxFileSize)),w=t.minFileSize==null?null:Number(l(t.minFileSize)),c=t.maxTotalSize==null?null:Number(l(t.maxTotalSize));if(T!=null&&we>T)return"max-files";if(x!=null&&Number(z.size||0)>x)return"max-file-size";if(w!=null&&Number(z.size||0)<w)return"min-file-size";if(c!=null&&Z(Number(z.size||0))>c)return"max-total-size";if(!te(z))return"accept";const A=t.filter||t.acceptFile||t.validate;if(typeof A=="function"){const de=await A(z,{files:n().slice(),api:K});if(de===!1)return"filter";if(typeof de=="string")return de}return null},f=async()=>{for(const z of n()){if(z.status!=="rejected"||z.error!=="max-files")continue;const we=await L(z.file,M().length+1);if(we){z.error=we;continue}z.status="queued",z.progress=0,z.error=null,z.detail=null}},m=z=>({id:`upload_${Date.now()}_${++R}`,file:z,name:(z==null?void 0:z.name)||"file",size:Number((z==null?void 0:z.size)||0),type:(z==null?void 0:z.type)||"",status:"queued",progress:0,bytesUploaded:0,error:null,detail:null,attempts:0,response:null,xhr:null}),g=async(z,we={})=>{var w;if(y())return[];b(null);const T=re(z),x=[];!P()&&T.length&&F({silent:!0});for(const c of T){const A=await L(c,M().length+1);if(A){ue(c,A);continue}const de=m(c);if(n().push(de),x.push(de),(w=t.onAdded)==null||w.call(t,de,{file:c,meta:we,api:K}),!P())break}return q(),x.length&&t.autoUpload&&!Q()&&d(),x},F=(z={})=>{var we;for(const T of n())T.status==="uploading"&&a(T),T.status="removed";s([]),b(null),q(),z.silent||(we=t.onClear)==null||we.call(t,K)},X=async z=>{var x;const we=typeof z=="string"?n().find(w=>w.id===z):z;if(!we)return;we.status==="uploading"&&a(we);const T=n().filter(w=>w!==we);s(T),await f(),q(),(x=t.onRemove)==null||x.call(t,we,{api:K})},a=z=>{var T,x,w;const we=typeof z=="string"?n().find(c=>c.id===z):z;!we||we.status!=="uploading"||(we.status="canceled",we.error="canceled",(x=(T=we.xhr)==null?void 0:T.abort)==null||x.call(T),(w=t.onCancel)==null||w.call(t,we,{api:K}),q())},C=()=>n().filter(z=>z.status==="uploading").forEach(a),h=async z=>{var T,x;const we={url:l(t.url),method:l(t.method||"POST"),headers:t.headers,formFields:t.formFields||t.fields,fieldName:W(),withCredentials:!!l((T=t.withCredentials)!=null?T:t.credentials),sendRaw:!!l(t.sendRaw)};if(typeof t.factory=="function")try{const w=await t.factory(z.file,{item:z,files:n().slice(),api:K});if(w&&typeof w=="object")Object.assign(we,w);else if(w!=null)throw new Error("factory must return an object")}catch(w){throw(x=t.onFactoryFailed)==null||x.call(t,w,{item:z,api:K}),w}return we},J=(z,we,T)=>{const x=typeof we=="function"?we(T.file,{item:T,api:K}):we;x&&(x instanceof Headers?x.forEach((w,c)=>z.setRequestHeader(c,w)):Array.isArray(x)?x.forEach(w=>{Array.isArray(w)?z.setRequestHeader(w[0],w[1]):w!=null&&w.name&&z.setRequestHeader(w.name,w.value)}):typeof x=="object"&&Object.keys(x).forEach(w=>z.setRequestHeader(w,x[w])))},j=(z,we,T)=>{const x=typeof we=="function"?we(T.file,{item:T,api:K}):we;x&&(Array.isArray(x)?x.forEach(w=>{Array.isArray(w)?z.append(w[0],w[1]):w!=null&&w.name&&z.append(w.name,w.value)}):typeof x=="object"&&Object.keys(x).forEach(w=>z.append(w,x[w])))},U=(z,we)=>new Promise((T,x)=>{if(!we.url){x(new Error("UI.Upload: url is required"));return}if(typeof XMLHttpRequest!="function"){x(new Error("UI.Upload: XMLHttpRequest is not available"));return}const w=new XMLHttpRequest;z.xhr=w,w.open(String(we.method||"POST").toUpperCase(),we.url,!0),w.withCredentials=!!we.withCredentials,J(w,we.headers,z),w.upload.onprogress=A=>{var de;A.lengthComputable&&(z.bytesUploaded=A.loaded,z.progress=Math.max(0,Math.min(100,Math.round(A.loaded/A.total*100))),(de=t.onProgress)==null||de.call(t,z,{event:A,api:K}),q())},w.onload=()=>{const A=w.status>=200&&w.status<300,de={status:w.status,text:w.responseText,xhr:w};A?T(de):x(Object.assign(new Error(`HTTP error ${w.status}`),{response:de}))},w.onerror=()=>x(new Error("network-error")),w.onabort=()=>x(new Error("canceled"));const c=we.sendRaw?z.file:(()=>{const A=new FormData;return j(A,we.formFields,z),A.append(we.fieldName||"file",z.file,z.name),A})();w.send(c)}),ce=async z=>{var x,w,c,A,de,Le;const we=me();let T=we.delay;z.status="uploading",z.error=null,z.progress=Math.max(0,z.progress||0),(x=t.onStart)==null||x.call(t,z,{api:K}),q();for(let Je=0;Je<=we.attempts;Je++){z.attempts=Je+1;try{const B=await h(z),Ae=typeof t.upload=="function"||typeof t.uploader=="function"?await(t.upload||t.uploader)(z.file,{item:z,options:B,progress:Me=>{var Ee;z.progress=Math.max(0,Math.min(100,Number(Me)||0)),(Ee=t.onProgress)==null||Ee.call(t,z,{api:K}),q()},api:K}):await U(z,B);return z.status="done",z.progress=100,z.response=Ae,z.xhr=null,(w=t.onSuccess)==null||w.call(t,z,{response:Ae,api:K}),(c=t.onComplete)==null||c.call(t,z,{response:Ae,api:K}),q(),z}catch(B){if(String((B==null?void 0:B.message)||B)==="canceled"||z.status==="canceled")return z.status="canceled",z.error="canceled",z.xhr=null,(A=t.onComplete)==null||A.call(t,z,{error:B,api:K}),q(),z;if(Je<we.attempts){await new Promise(Ae=>setTimeout(Ae,T)),T=Math.round(T*we.factor);continue}return z.status="error",z.error=B,z.xhr=null,b(B),(de=t.onError)==null||de.call(t,z,{error:B,api:K}),(Le=t.onComplete)==null||Le.call(t,z,{error:B,api:K}),q(),z}}return z},k=()=>{var x;if(S||y())return;const z=n().filter(w=>w.status==="uploading").length,we=Math.max(0,le()-z),T=n().filter(w=>w.status==="queued").slice(0,we);if(!T.length){const w=n().some(c=>c.status==="uploading");u(w),w||(x=t.onFinish)==null||x.call(t,n().slice(),{api:K});return}u(!0),T.forEach(w=>{ce(w).finally(()=>k())})},d=(z=null)=>{(z?re(z):n().filter(T=>["queued","error","canceled"].includes(T.status))).forEach(T=>{const x=typeof T=="string"?n().find(w=>w.id===T):T;x&&x.status!=="uploading"&&x.status!=="done"&&x.status!=="rejected"&&(x.status="queued",x.progress=0,x.error=null)}),q(),k()},N=z=>d([z]),I=()=>{y()||H.click()},H=_.input({type:"file",class:"cms-upload-input",name:W(),accept:se()||null,multiple:P(),capture:t.capture||null,disabled:y(),onChange:z=>{g(z.target.files,{event:z,source:"browse"}),z.target.value=""}}),ge=_.div({class:"cms-upload-list"}),Se=_.div({class:"cms-upload-summary"}),ye=_.div({class:"cms-upload-actions"});let V=Y();const O=_.div({class:ae(["cms-upload","cms-singularity",V,fe(t.box||t.variant==="box","cms-upload-box"),fe(t.compact,"is-compact"),fe(Q(),"is-form-mode"),fe(!$(),"is-files-hidden"),t.class]),tabindex:y()?"-1":"0",role:"group","aria-disabled":y()?"true":"false"}),K={addFiles:g,browse:I,upload:d,retry:N,retryAll:()=>d(n().filter(z=>z.status==="error"||z.status==="canceled")),remove:X,clear:F,abort:a,abortAll:C,files:()=>n().slice(),state:()=>({files:n().slice(),busy:v(),dragging:o(),error:i()}),reset:F},ke=()=>{const z={api:K,files:n().slice(),busy:v(),disabled:y(),submitMode:Q()?"form":"upload"},we=[];return G()&&we.push(JSswift.ui.renderSlot(e,"browse",z,he.Btn({size:"sm",icon:"folder_open",label:t.browseText||"Browse",onClick:I}))),ie()&&we.push(JSswift.ui.renderSlot(e,"upload",z,he.Btn({size:"sm",color:"primary",icon:"upload",label:t.uploadText||"Upload",loading:v(),disabled:y()||!n().some(T=>["queued","error","canceled"].includes(T.status)),onClick:()=>d()}))),D()&&we.push(JSswift.ui.renderSlot(e,"clear",z,he.Btn({size:"sm",color:"secondary",outline:!0,icon:"delete",label:t.clearText||"Clear",disabled:y()||!n().length,onClick:()=>F()}))),E(e,"actions",z,we)},Ne=(z,we)=>{var c;const T={item:z,file:z.file,index:we,api:K,remove:()=>X(z),retry:()=>N(z),abort:()=>a(z)},x=_.div({class:ae(["cms-upload-file",`is-${z.status}`])},_.div({class:"cms-upload-file-icon"},he.Icon({name:z.status==="done"?"check_circle":z.status==="error"||z.status==="rejected"?"error":"description"})),_.div({class:"cms-upload-file-main"},_.div({class:"cms-upload-file-name"},...E(e,"fileName",T,z.name)),_.div({class:"cms-upload-file-meta"},...E(e,"fileMeta",T,z.error?String(((c=z.error)==null?void 0:c.message)||z.error):z.status==="queued"?"Queued":z.status)),_.div({class:"cms-upload-progress",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":String(z.progress||0)},_.div({class:"cms-upload-progress-bar",style:{width:`${z.progress||0}%`}}))),_.div({class:"cms-upload-file-trailing"},_.div({class:"cms-upload-file-size"},oe(z.size)),_.div({class:"cms-upload-file-actions"},...E(e,"fileActions",T,[z.status==="uploading"?he.Btn({size:"sm",outline:!0,icon:"close","aria-label":"Cancel",onClick:()=>a(z)}):null,z.status==="error"||z.status==="canceled"?he.Btn({size:"sm",outline:!0,icon:"refresh","aria-label":"Retry",onClick:()=>N(z)}):null,he.Btn({size:"sm",dense:!0,outline:!0,icon:"delete","aria-label":"Remove",onClick:()=>X(z)})])))),w=JSswift.ui.renderSlot(e,"file",T,x);return _.div({class:"cms-upload-file-wrap","data-status":z.status,"data-id":z.id},...E(null,"default",{},w))},ee=()=>{const z=n();if(ye.replaceChildren(...ke()),ge.replaceChildren(),Se.hidden=!$(),ge.hidden=!$(),z.length)z.forEach((T,x)=>ge.appendChild(Ne(T,x)));else{const T=JSswift.ui.renderSlot(e,"empty",{api:K},t.emptyText||"No files selected");ge.appendChild(_.div({class:"cms-upload-empty"},...E(null,"default",{},T)))}const we=z.filter(T=>T.status!=="rejected"&&T.status!=="removed");Se.textContent=`${we.length} file \u2022 ${oe(we.reduce((T,x)=>T+Number(x.size||0),0))}`},xe=JSswift.ui.renderSlot(e,"icon",{api:K},he.Icon({name:t.icon||"cloud_upload"})),be=JSswift.ui.renderSlot(e,"title",{api:K},t.title||"Upload files"),Ce=JSswift.ui.renderSlot(e,"subtitle",{api:K},t.subtitle||(se()?`Accepted: ${se()}`:"Drag files here or browse from your device")),pe=_.div({class:"cms-upload-dropzone",onClick:z=>{var we,T;(T=(we=z.target)==null?void 0:we.closest)!=null&&T.call(we,".cms-upload-actions, .cms-upload-list")||t.clickable!==!1&&I()},onDragenter:z=>{t.drag===!1||y()||(z.preventDefault(),r(!0),O.classList.add("is-dragging"))},onDragover:z=>{t.drag===!1||y()||z.preventDefault()},onDragleave:z=>{z.currentTarget===z.target&&(r(!1),O.classList.remove("is-dragging"))},onDrop:z=>{var we,T;t.drag===!1||y()||(z.preventDefault(),r(!1),O.classList.remove("is-dragging"),(we=t.onDrop)==null||we.call(t,z,{api:K}),g(((T=z.dataTransfer)==null?void 0:T.files)||[],{event:z,source:"drop"}))}},_.div({class:"cms-upload-head"},_.div({class:"cms-upload-icon"},...E(null,"default",{},xe)),_.div({class:"cms-upload-copy"},_.div({class:"cms-upload-title"},...E(null,"default",{},be)),_.div({class:"cms-upload-subtitle"},...E(null,"default",{},Ce))),ye),Se,ge),Ie=JSswift.ui.renderSlot(e,"header",{api:K},null);return E(null,"default",{},Ie).forEach(z=>O.appendChild(z)),O.appendChild(H),E(e,"default",{api:K,dropzone:pe},pe).forEach(z=>O.appendChild(z)),JSswift.reactive.effect(()=>{ee()},"UI.Upload:render"),JSswift.reactive.effect(()=>{O.classList.toggle("is-disabled",y()),O.classList.toggle("is-form-mode",Q()),O.classList.toggle("is-files-hidden",!$());const z=Y();z!==V&&(V&&O.classList.remove(V),z&&O.classList.add(z),V=z),O.setAttribute("aria-disabled",y()?"true":"false"),H.disabled=y(),H.multiple=P(),H.name=W()},"UI.Upload:disabled"),O._upload=K,O._addFiles=g,O._browse=I,O._uploadFiles=d,O._input=H,O._dispose=()=>{S||(S=!0,C())},(_e=JSswift._registerCleanup)==null||_e.call(JSswift,O,O._dispose),O},he.BoxUpload=(t={})=>he.Upload({...t,box:!0}),he.boxUpload=(t={})=>he.BoxUpload(t),JSswift.ui.Upload=he.Upload,JSswift.ui.BoxUpload=he.BoxUpload,JSswift.ui.boxUpload=he.boxUpload;function Nt(t,e){if(!t)return null;if(typeof t=="object"&&typeof t._bind=="function")return{get:()=>t.value,set:n=>{t.value!==n&&(t.value=n)},watch:n=>{typeof t.action=="function"&&t.action(n)}};if(Array.isArray(t)&&typeof t[0]=="function"&&typeof t[1]=="function"){const n=t[0],s=t[1];return{get:n,set:s,watch:o=>He.reactive.effect(()=>{o(n())},e||"UI:model")}}return null}const sl={classic:{side:"left",nav:"top",rows:["header","nav","body","footer"]},classicright:{side:"right",nav:"top",rows:["header","nav","body","footer"]},sidebarfullleft:{side:"left",fullSide:!0,nav:"top",rows:["header","nav","body","footer"]},sidebarfullright:{side:"right",fullSide:!0,nav:"top",rows:["header","nav","body","footer"]},appshell:{side:"left",nav:"top",rows:["header","nav","body","footer"]},dashboard:{side:"left",nav:"top",rows:["header","nav","body","footer"]},website:{side:null,nav:"top",rows:["header","nav","body","footer"]},documentation:{side:"right",nav:"left",rows:["header","body","footer"]},landing:{side:null,nav:null,rows:["header","body","footer"]}},Po=t=>{const e=l(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},Jo=(t,e)=>{if(!t||!e.main)return null;const n=t.side||(e.aside?"left":null),s=t.nav||(e.nav?"top":null),o=!!e.aside&&!!n,r=!!e.nav&&!!s,i=[r&&s==="left"?"nav":o&&n==="left"?"aside":".","main",r&&s==="right"?"nav":o&&n==="right"?"aside":"."],b=[],R=[...t.rows||[]];if(r&&s==="top"&&!R.includes("nav")){const S=R.indexOf("body");R.splice(S>=0?S:R.length,0,"nav")}for(const S of R)S==="header"&&e.header?b.push(t.fullSide&&o&&n==="left"?["aside","header","header"]:t.fullSide&&o&&n==="right"?["header","header","aside"]:["header","header","header"]):S==="nav"&&r&&s==="top"?b.push(t.fullSide&&o&&n==="left"?["aside","nav","nav"]:t.fullSide&&o&&n==="right"?["nav","nav","aside"]:["nav","nav","nav"]):S==="body"?b.push(i):S==="footer"&&e.footer&&b.push(t.fullSide&&o&&n==="left"?["aside","footer","footer"]:t.fullSide&&o&&n==="right"?["footer","footer","aside"]:["footer","footer","footer"]);return b.length?b.map(S=>`"${S.join(" ")}"`).join(" "):null};he.Layout=(...t)=>{var un,tn,nn;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(Pe,Ve)=>!!Pe&&Object.prototype.hasOwnProperty.call(Pe,Ve),r=()=>typeof window=="undefined"?1024:window.innerWidth,v=()=>{const Pe=r(),Ve=JSswift.uiResponsivePropsFor(e,pn("mobile"))||{},et=Pe>=768?JSswift.uiResponsivePropsFor(e,pn("tablet"))||{}:{},ct=Pe>=1024?JSswift.uiResponsivePropsFor(e,pn("pc"))||{}:{};return{...Ve,...et,...ct}},u=(...Pe)=>{for(const Ve of Pe)if(o(e,Ve))return e[Ve]},i=(...Pe)=>{const Ve=v();for(const et of Pe)if(o(Ve,et))return Ve[et];return u(...Pe)},b=(...Pe)=>{const Ve=JSswift.uiResponsivePropsFor(e,pn(V()))||{};for(const et of Pe)if(o(Ve,et))return Ve[et];return u(...Pe)},R=()=>Po(b("disposition","layoutDisposition","layout")),S=()=>{const Pe=l(i("mode","layoutMode"));if(Pe==null||Pe===!1||Pe==="")return"";const Ve=String(Pe).trim().toLowerCase();return Ve==="global"||Ve==="local"?Ve:""},y=(Pe,Ve=null)=>Pe==null||Pe===!1||Pe===""?Ve:typeof Pe=="number"?`${Pe}px`:String(Pe),P=(Pe,Ve=null)=>{if(Pe==null||Pe===!1||Pe==="")return Ve;if(typeof Pe=="number"&&Number.isFinite(Pe))return Pe;const et=Number.parseFloat(String(Pe));return Number.isFinite(et)?et:Ve},Q=Pe=>{const Ve=l(Pe);return Ve==null||Ve===!1||Ve===""?null:Array.isArray(Ve)?Ve.map(et=>`"${Array.isArray(et)?et.join(" "):String(et)}"`).join(" "):String(Ve)},G=(Pe,Ve=null,et=null)=>{let ct=Number.isFinite(Pe)?Pe:0;return Number.isFinite(Ve)&&(ct=Math.max(Ve,ct)),Number.isFinite(et)&&(ct=Math.min(et,ct)),ct},ie=u("header","headerContent"),D=u("aside","drawer"),$=u("nav","asideRight","drawerRight"),Y=u("page","main","content","body"),W=u("footer","footerContent"),le=()=>l(i("drawerEnabled","asideEnabled")),me=()=>l(i("navEnabled","asideRightEnabled","rightAsideEnabled")),re=()=>le()!==!1,oe=()=>me()===!0||l(i("noNav"))===!1,se=()=>l(i("noDrawer"))===!0||le()===!1||D===!1,te=()=>l(i("noNav"))===!0||me()===!1||$===!1,M=()=>l(i("drawerFloating"))===!0,Z=()=>l(i("navFloating"))===!0,q=()=>l(i("drawerResizable"))===!0,ue=()=>l(i("navResizable"))===!0,L=()=>P(l(i("drawerMinWidth")),180),f=()=>P(l(i("drawerMaxWidth")),null),m=()=>P(l(i("navMinWidth")),180),g=()=>P(l(i("navMaxWidth")),null),F=P(l(i("drawerWidth")),280),X=P((un=l(i("navWidth")))!=null?un:l(i("asideRightWidth")),280),[a,C]=JSswift.reactive.signal(G(F,L(),f())),[h,J]=JSswift.reactive.signal(G(X,m(),g())),j=Nt(e.drawerOpen,"UI.Layout:drawerOpen"),U=j?!!j.get():typeof e.drawerOpen=="boolean"?!!e.drawerOpen:!0,[ce,k]=JSswift.reactive.signal(U),d=Pe=>{const Ve=!!Pe;ce()!==Ve&&k(Ve),j==null||j.set(Ve)};(tn=j==null?void 0:j.watch)==null||tn.call(j,()=>{const Pe=!!j.get();ce()!==Pe&&k(Pe)});const N=Nt(e.navOpen,"UI.Layout:navOpen"),I=N?!!N.get():typeof e.navOpen=="boolean"?!!e.navOpen:!0,[H,ge]=JSswift.reactive.signal(I),Se=Pe=>{const Ve=!!Pe;H()!==Ve&&ge(Ve),N==null||N.set(Ve)};(nn=N==null?void 0:N.watch)==null||nn.call(N,()=>{const Pe=!!N.get();H()!==Pe&&ge(Pe)});const ye=()=>{var ct,gt,ht;const Pe=Number((ct=l(i("layoutBreakpoint")))!=null?ct:0),Ve=Number((gt=l(i("drawerBreakpoint")))!=null?gt:Pe||1024),et=Number((ht=l(i("navBreakpoint")))!=null?ht:Pe||Ve);return Math.max(Ve,et,0)},V=()=>{const Pe=r();return Pe>=1024?"pc":Pe>=768?"tablet":"mobile"},[O,K]=JSswift.reactive.signal(!1),[ke,Ne]=JSswift.reactive.signal(V()),ee=()=>{typeof window!="undefined"&&(Ne(V()),K(window.innerWidth<ye()))};typeof window!="undefined"&&(ee(),window.addEventListener("resize",ee));const xe=()=>({props:e,openAside:()=>d(!0),closeAside:()=>d(!1),toggleAside:()=>d(!ce()),openNav:()=>Se(!0),closeNav:()=>Se(!1),toggleNav:()=>Se(!H()),isDrawerOpen:()=>!!ce(),isNavOpen:()=>!!H(),isMobile:()=>!!O(),isDrawerFloating:()=>M(),isNavFloating:()=>Z()}),be=(Pe,Ve)=>{const et=xe();for(const gt of Pe){if(!o(s,gt))continue;const ht=typeof s[gt]=="function"?s[gt](et):s[gt];return E(null,"default",et,ht)}const ct=typeof Ve=="function"?Ve(et):Ve;return E(null,"default",et,ct)},Ce=Y!==void 0?Y:n,pe=ae(["cms-app","cms-layout",JSswift.uiResponsiveClasses({mobile:e},rn),JSswift.uiResponsiveClasses(e,rn),e.class]),Ie=JSswift.omit(e,["header","headerContent","aside","drawer","nav","asideRight","drawerRight","page","main","content","body","footer","footerContent","noDrawer","drawerEnabled","asideEnabled","noNav","navEnabled","asideRightEnabled","rightAsideEnabled","drawerOpen","navOpen","layoutBreakpoint","drawerBreakpoint","navBreakpoint","drawerWidth","navWidth","asideRightWidth","drawerResizable","drawerMinWidth","drawerMaxWidth","navResizable","navMinWidth","navMaxWidth","drawerPeek","navPeek","asideRightPeek","drawerFloating","navFloating","overlayClose","escClose","stickyHeader","stickyFooter","stickyAside","stickyNav","tagPage","mode","layoutMode","disposition","layoutDisposition","layout","shellClass","headerClass","asideClass","navClass","pageClass","footerClass","overlayClass","gap","headerOffset","minHeight","areas","gridTemplateAreas","templateAreas","slots"]);Ie.class=pe,Ie.style={...e.style||{}},JSswift.uiApplyResponsiveProps(Ie,e,JSswift.uiResponsiveStyleRules);const _e=_.div(Ie),we=l(i("tagPage"))===!0?{header:"header",aside:"aside",nav:"nav",page:"main",footer:"footer"}:{header:"div",aside:"div",nav:"div",page:"div",footer:"div"},T=_.div({class:ae(["cms-layout-shell-grid",e.shellClass])}),x=_[we.header]({class:ae(["cms-layout-section","cms-layout-header","header",fe(e.stickyHeader,"sticky"),e.headerClass])}),w=_[we.aside]({class:ae(["cms-layout-section","cms-layout-aside","aside",fe(e.stickyAside!==!1,"sticky"),e.asideClass]),role:"navigation","aria-hidden":"true"}),c=_.div({class:"cms-layout-panel-body cms-layout-aside-body"}),A=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-drawer","aria-hidden":"true"});w.appendChild(c),w.appendChild(A);const de=_[we.nav]({class:ae(["cms-layout-section","cms-layout-nav","nav",fe(e.stickyNav,"sticky"),e.navClass]),role:we.nav==="nav"?null:"complementary","aria-hidden":"true"}),Le=_.div({class:"cms-layout-panel-body cms-layout-nav-body"}),Je=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-nav","aria-hidden":"true"});de.appendChild(Le),de.appendChild(Je);const B=_[we.page]({class:ae(["cms-layout-section","cms-layout-main","main",e.pageClass]),role:we.page==="main"?null:"main"}),Ae=_[we.footer]({class:ae(["cms-layout-section","cms-layout-footer","footer",fe(e.stickyFooter,"sticky"),e.footerClass])});T.appendChild(x),T.appendChild(w),T.appendChild(B),T.appendChild(de),T.appendChild(Ae),_e.appendChild(T);const Me=_.div({class:ae(["cms-aside-overlay",e.overlayClass]),onClick:()=>{l(i("overlayClose"))!==!1&&(ce()&&d(!1),H()&&Se(!1))}});_e.appendChild(Me);let Ee=!1,De=!1,Ue=!1,Ye=!1,Ze=!1,Qe=null,Te=null;const je=Pe=>{!Pe||typeof Pe!="object"||(typeof Pe._dispose=="function"&&Pe._dispose(),!(!Pe.childNodes||!Pe.childNodes.length)&&Array.from(Pe.childNodes).forEach(je))},tt=Pe=>{Pe&&Array.from(Pe.childNodes).forEach(Ve=>{je(Ve),Ve.remove()})},nt=Pe=>{const Ve=xe(),et=typeof Pe=="function"?Pe(Ve):Pe;return E(null,"default",Ve,et)},ut=()=>{const Pe=Ee?x.getBoundingClientRect().height:0;_e.style.setProperty("--layout-header-height",`${Pe}px`)},dt=(Pe,Ve)=>(tt(Pe),Ve.forEach(et=>Pe.appendChild(et)),Ve.length>0),bt=()=>{var ct,gt,ht,Ct,yt,p;_e.style.setProperty("--cms-layout-drawer-width",y((ct=l(i("drawerWidth")))!=null?ct:280,"280px")),_e.style.setProperty("--cms-layout-nav-width",y((ht=(gt=l(i("navWidth")))!=null?gt:l(i("asideRightWidth")))!=null?ht:280,"280px")),_e.style.setProperty("--cms-layout-drawer-peek",y((Ct=l(i("drawerPeek")))!=null?Ct:20,"20px")),_e.style.setProperty("--cms-layout-nav-peek",y((p=(yt=l(i("navPeek")))!=null?yt:l(i("asideRightPeek")))!=null?p:20,"20px"));const Pe=y(l(i("gap")),null);Pe!=null?_e.style.setProperty("--cms-layout-gap",Pe):_e.style.removeProperty("--cms-layout-gap");const Ve=y(l(i("headerOffset")),null);Ve!=null&&_e.style.setProperty("--layout-header-height",Ve);const et=y(l(i("minHeight")),null);et!=null?_e.style.setProperty("--cms-layout-min-height",et):_e.style.removeProperty("--cms-layout-min-height")},lt=()=>{if(q()){const Pe=G(a(),L(),f());Pe!==a()&&C(Pe),_e.style.setProperty("--cms-layout-drawer-width",`${Pe}px`)}if(ue()){const Pe=G(h(),m(),g());Pe!==h()&&J(Pe),_e.style.setProperty("--cms-layout-nav-width",`${Pe}px`)}},ft=(Pe,Ve)=>{if(Ve.button!==0)return;const et=Pe==="drawer"?w:de;if(et.hidden)return;const ct=Pe==="drawer"?a:h,gt=Pe==="drawer"?C:J,ht=Pe==="drawer"?L:m,Ct=Pe==="drawer"?f:g,yt=et.getBoundingClientRect(),p=yt.width||ct(),ne=Re=>{const Fe=Pe==="drawer"?Re.clientX-yt.left:yt.right-Re.clientX;gt(G(Fe||p,ht(),Ct())),lt(),rt()},ve=()=>{_e.classList.remove("is-resizing-layout"),document.removeEventListener("pointermove",ne,!0),document.removeEventListener("pointerup",ve,!0),Te=null};_e.classList.add("is-resizing-layout"),document.addEventListener("pointermove",ne,!0),document.addEventListener("pointerup",ve,!0),Te=ve,Ve.preventDefault()},vt=Pe=>ft("drawer",Pe),_t=Pe=>ft("nav",Pe);A.addEventListener("pointerdown",vt),Je.addEventListener("pointerdown",_t);const rt=()=>{const Pe=!!O(),Ve=!!ce(),et=!!H(),ct=!se()&&re()&&De,gt=!te()&&oe()&&Ue,ht=ct&&(Pe||M()),Ct=gt&&(Pe||Z()),yt=ct&&Ve,p=gt&&et,ne=yt&&!ht,ve=p&&!Ct,Re=ne&&q(),Fe=ve&&ue(),Oe=yt&&ht||p&&Ct;bt(),lt(),_e.classList.toggle("is-mobile",Pe),_e.classList.toggle("drawer-open",yt),_e.classList.toggle("nav-open",p),_e.classList.toggle("no-drawer",!ct),_e.classList.toggle("no-nav",!gt),_e.classList.toggle("has-header",Ee),_e.classList.toggle("has-drawer",ct),_e.classList.toggle("has-nav",gt),_e.classList.toggle("has-footer",Ze),_e.classList.toggle("drawer-floating",ht),_e.classList.toggle("nav-floating",Ct);const $e=R(),Xe=$e?S():"";_e.dataset.disposition=$e||"",_e.dataset.layoutMode=Xe||"",_e.classList.toggle("has-disposition",!!$e),_e.classList.toggle("mode-local",Xe==="local"),_e.classList.toggle("mode-global",Xe==="global"),x.classList.toggle("sticky",l(i("stickyHeader"))===!0),Ae.classList.toggle("sticky",l(i("stickyFooter"))===!0),w.classList.toggle("sticky",l(i("stickyAside"))!==!1),de.classList.toggle("sticky",l(i("stickyNav"))===!0),x.hidden=!Ee,Ae.hidden=!Ze,B.hidden=!Ye,Me.hidden=!(ht||Ct),Me.classList.toggle("show",Oe),w.hidden=!ct||!yt&&!ht,w.classList.toggle("open",yt),w.classList.toggle("is-floating",ht),w.classList.toggle("is-resizable",Re),w.setAttribute("aria-hidden",yt?"false":"true"),A.hidden=!Re,de.hidden=!gt||!p&&!Ct,de.classList.toggle("open",p),de.classList.toggle("is-floating",Ct),de.classList.toggle("is-resizable",Fe),de.setAttribute("aria-hidden",p?"false":"true"),Je.hidden=!Fe;const ot=sl[$e]||null,pt=(ot==null?void 0:ot.side)||(ne&&ot?"left":null),xt=(ot==null?void 0:ot.nav)||(ve&&ot?"top":null),Bt=ne?ot?pt:"left":"",zt=ve?ot?xt==="left"||xt==="right"?xt:"":"right":"";_e.classList.toggle("drawer-left",ct&&pt==="left"),_e.classList.toggle("drawer-right",ct&&pt==="right"),_e.classList.toggle("nav-top",ve&&xt==="top"),_e.classList.toggle("nav-side",ve&&(zt==="left"||zt==="right")),T.style.gridTemplateColumns=[Bt==="left"?"minmax(0, var(--cms-layout-drawer-width))":zt==="left"?"minmax(0, var(--cms-layout-nav-width))":"0px","minmax(0, 1fr)",Bt==="right"?"minmax(0, var(--cms-layout-drawer-width))":zt==="right"?"minmax(0, var(--cms-layout-nav-width))":"0px"].join(" ");const Lt=['"header header header"',`"${ne?"aside":"."} main ${ve?"nav":"."}"`,'"footer footer footer"'].join(" "),sn=Jo(sl[$e],{header:Ee,aside:ne,nav:ve,main:Ye,footer:Ze});T.style.gridTemplateAreas=Q(b("areas","gridTemplateAreas","templateAreas"))||sn||Lt},Vt=(Pe,Ve)=>(Ee=dt(x,nt(Pe)),ut(),rt(),Ve&&JSswift.router.setURLOnly(Ve),x),Mt=(Pe,Ve)=>(De=dt(c,nt(Pe)),De||d(!1),rt(),Ve&&JSswift.router.setURLOnly(Ve),w),wt=(Pe,Ve)=>(Ue=dt(Le,nt(Pe)),Ue||Se(!1),rt(),Ve&&JSswift.router.setURLOnly(Ve),de),Kt=(Pe,Ve)=>(Ye=dt(B,nt(Pe)),rt(),Ve&&JSswift.router.setURLOnly(Ve),B),St=(Pe,Ve)=>(Ze=dt(Ae,nt(Pe)),rt(),Ve&&JSswift.router.setURLOnly(Ve),Ae);Ee=dt(x,be(["header"],ie)),De=dt(c,D===!1?[]:be(["aside","drawer"],D)),Ue=dt(Le,$===!1?[]:be(["nav","asideRight","drawerRight"],$)),Ye=dt(B,be(["page","main","default"],Ce)),Ze=dt(Ae,be(["footer"],W)),typeof ResizeObserver!="undefined"&&(Qe=new ResizeObserver(()=>ut()),Qe.observe(x)),ut(),JSswift.reactive.effect(()=>{ke(),O(),ce(),H(),rt()},"UI.Layout:state");const cn=Pe=>{l(i("escClose"))!==!1&&(!O()&&!M()&&!Z()||!ce()&&!H()||Pe.key==="Escape"&&(Pe.preventDefault(),ce()&&d(!1),H()&&Se(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",cn,!0),_e.openAside=()=>d(!0),_e.closeAside=()=>d(!1),_e.toggleAside=()=>d(!ce()),_e.openNav=()=>Se(!0),_e.closeNav=()=>Se(!1),_e.toggleNav=()=>Se(!H()),_e.isDrawerOpen=()=>!!ce(),_e.isNavOpen=()=>!!H(),_e.isMobile=()=>!!O(),_e.header=()=>x,_e.aside=()=>w,_e.drawer=()=>w,_e.nav=()=>de,_e.page=()=>B,_e.main=()=>B,_e.footer=()=>Ae,_e.headerUpdate=Vt,_e.asideUpdate=Mt,_e.drawerUpdate=Mt,_e.navUpdate=wt,_e.pageUpdate=Kt,_e.mainUpdate=Kt,_e.footerUpdate=St,_e.reflow=rt,_e._dispose=()=>{var Pe;typeof window!="undefined"&&window.removeEventListener("resize",ee),typeof document!="undefined"&&document.removeEventListener("keydown",cn,!0),A.removeEventListener("pointerdown",vt),Je.removeEventListener("pointerdown",_t),Te==null||Te(),(Pe=Qe==null?void 0:Qe.disconnect)==null||Pe.call(Qe)},Ke(_e,e),rt(),_e},he.Footer=(...t)=>{var ue,L,f;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=m=>Object.prototype.hasOwnProperty.call(e,m),r={props:e},v=(m,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(F=>v(m,F));return}if(g!=null&&g.nodeType){m.appendChild(g);return}m.appendChild(document.createTextNode(String(g)))}},u=(m,g,F=X=>X)=>{const X=JSswift.ui.getSlot(s,m);if(X!=null)return E(s,m,r,null);if(typeof g=="function"){const a=new Set(["eyebrow","title","subtitle"]),C=_[a.has(m)?"span":"div"]({class:`cms-footer-slot-${m}`});return JSswift.reactive.effect(()=>{const h=F(g(r)),J=on(JSswift.ui.slot(h));C.replaceChildren(),Array.isArray(J)?J.forEach(j=>v(C,j)):v(C,J)},`UI.Footer:${m}`),[C]}return E(s,m,r,F(g))},i=(m,g="icon",F=e.iconSize||e.size||"md")=>m==null||m===!1?null:typeof m=="string"?he.Icon({name:m,size:F}):JSswift.ui.slot(m,{as:g}),b=o("left")?e.left:e.start,R=o("right")?e.right:e.end,S=o("title")?e.title:e.label,y=(L=(ue=e.subtitle)!=null?ue:e.description)!=null?L:e.note,P=o("content")?e.content:o("body")?e.body:n!=null&&n.length?n:null,Q=[...u("left",b),...u("start",null)],G=u("icon",e.icon,i),ie=u("eyebrow",(f=e.eyebrow)!=null?f:e.kicker),D=u("title",S),$=u("subtitle",y),Y=u("meta",e.meta),W=(()=>{const m=u("content",null);return m.length?m:u("default",P)})(),le=[...u("center",null),...u("body",null)],me=[...u("right",R),...u("end",null)],re=u("actions",e.actions),oe=_.div({class:ae(["cms-footer-body",e.bodyClass,e.centerClass])},_.div({class:"cms-footer-heading"},G.length?_.div({class:"cms-footer-icon"},...G):null,_.div({class:"cms-footer-copy"},ie.length?_.div({class:ae(["cms-footer-eyebrow",e.eyebrowClass])},...ie):null,D.length?_.div({class:ae(["cms-footer-title",e.titleClass])},...D):null,$.length?_.div({class:ae(["cms-footer-subtitle",e.subtitleClass])},...$):null,W.length?_.div({class:ae(["cms-footer-content",e.contentClass])},...W):null),Y.length?_.div({class:ae(["cms-footer-meta",e.metaClass])},...Y):null)),se=[];le.length?se.push(_.div({class:ae(["cms-footer-body",e.bodyClass,e.centerClass])},...le)):(G.length||ie.length||D.length||$.length||W.length||Y.length)&&se.push(oe),(me.length||re.length)&&se.push(_.div({class:ae(["cms-footer-end",e.endClass])},...me,...re.length?[_.div({class:ae(["cms-footer-actions",e.actionsClass])},...re)]:[]));const te=JSswift.omit(e,["actions","actionsClass","align","body","bodyClass","center","centerClass","content","contentClass","dense","description","divider","elevated","end","endClass","eyebrow","eyebrowClass","gap","icon","iconSize","kicker","label","left","meta","metaClass","minHeight","note","right","slots","stack","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap","justify"]);te.class=ae(["cms-panel","cms-footer","cms-singularity",fe(e.sticky,"sticky"),fe(e.dense,"dense"),fe(e.elevated,"elevated"),fe(e.divider!==!1,"divider"),fe(e.stack,"stack"),tl(e.align,"align-"),e.class]),te.style={...e.style||{}};const M=ze(e.justify);M!=null&&(te.style.justifyContent=M);const Z=ze(e.wrap,m=>m?"wrap":"nowrap");Z!=null&&(te.style.flexWrap=Z),e.gap!=null&&(te.style["--cms-footer-gap"]=Be(l(e.gap))),e.minHeight!=null&&(te.style.minHeight=Be(l(e.minHeight))),JSswift.uiApplyResponsiveProps(te,e,JSswift.uiResponsiveStyleRules);const q=_.footer(te,...Q.length?[_.div({class:ae(["cms-footer-start",e.startClass])},...Q)]:[],...se.length?[_.div({class:"cms-footer-main"},...se)]:[]);return Ke(q,e),q};const fi=t=>{const e=[];for(const n of t||[]){const s=on(JSswift.ui.slot(n));s&&(Array.isArray(s)?e.push(...s):e.push(s))}return e},An=(t,e)=>{const n=on(JSswift.ui.slot(t,e));return n?Array.isArray(n)?n:[n]:[]},Be=t=>{var e;return typeof t=="number"?`${t}px`:typeof t=="string"&&((e=JSswift.uiSizes)!=null&&e.includes(t))?`var(--cms-size-${t})`:String(t)};he.Toolbar=(...t)=>{var g,F,X,a,C,h,J,j;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(U,ce,k={})=>{const d=Array.isArray(U)?U:[U];for(const N of d)if(JSswift.ui.getSlot(s,N)!=null)return E(s,N,k,ce);return ce==null?[]:E(null,"default",k,ce)},r=U=>(Array.isArray(U)?U:[U]).some(k=>JSswift.ui.getSlot(s,k)!=null),v={props:e},u=o(["before"],e.before,v),i=o(["start","left"],(g=e.start)!=null?g:e.left,v),b=o(["center","body","content","default"],(a=(X=(F=e.center)!=null?F:e.body)!=null?X:e.content)!=null?a:n,v),R=o(["end","right","actions"],(h=(C=e.end)!=null?C:e.right)!=null?h:e.actions,v),S=o(["after"],e.after,v),y=o(["title"],e.title,v),P=o(["subtitle"],e.subtitle,v),Q=o(["meta"],e.meta,v),G=!!(u.length||i.length||R.length||S.length||y.length||P.length||Q.length||e.before!=null||e.start!=null||e.left!=null||e.end!=null||e.right!=null||e.actions!=null||e.after!=null||e.title!=null||e.subtitle!=null||e.meta!=null||e.body!=null||e.center!=null||e.content!=null||e.beforeClass||e.startClass||e.bodyClass||e.centerClass||e.contentClass||e.endClass||e.afterClass||e.titleClass||e.subtitleClass||e.metaClass||e.copyClass||r(["before","start","left","center","body","content","end","right","actions","after","title","subtitle","meta"])),ie=ae(["cms-toolbar",fe(G,"structured"),fe(e.dense,"dense"),fe(e.divider,"divider"),fe(e.elevated,"elevated"),fe(e.sticky,"sticky"),e.class]),D=JSswift.omit(e,["actions","after","afterClass","align","before","beforeClass","body","bodyClass","center","centerClass","content","contentClass","copyClass","dense","divider","elevated","end","endClass","gap","justify","left","meta","metaClass","right","size","slots","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap"]);D.class=ie;const $={...e.style||{}};$.display=$.display||"flex";const Y=ze(e.align),W=ze(e.justify),le=ze(e.wrap,U=>typeof U=="boolean"?U?"wrap":"nowrap":String(U),"wrap"),me=ze(e.gap,Be,"var(--cms-s-md)"),re=We(e,"gap");$["--cms-toolbar-gap"]=me!=null?me:"var(--cms-s-md)",re||($.gap=$.gap||"var(--cms-toolbar-gap)");const oe={xxs:"4px 6px",xs:"6px 8px",sm:"6px 10px",md:"10px 12px",lg:"12px 16px",xl:"14px 18px",xxl:"16px 20px"},se=ze(e.size,U=>oe[U]||"");if(se!=null&&($.padding=se),G?($.flexDirection=$.flexDirection||"column",$.alignItems=$.alignItems||"stretch"):(Y!=null&&($.alignItems=Y),W!=null&&($.justifyContent=W),le!=null&&($.flexWrap=le)),Object.keys($).length&&(D.style=$),JSswift.uiApplyResponsiveProps(D,e,JSswift.uiResponsiveStyleRules),!G){const U=E(s,"default",v,n),ce=_.div(D,...U);return Ke(ce,e),ce}const te=(j=(J=e.bodyClass)!=null?J:e.centerClass)!=null?j:e.contentClass,M=qe([e.justify],()=>{const U=l(e.justify);return!U||U==="flex-start"?"auto":""}),Z={display:"flex",alignItems:"inherit",gap:"var(--cms-toolbar-gap)",flexWrap:"inherit",minWidth:0},q={};Y!=null&&(q.alignItems=Y),W!=null&&(q.justifyContent=W),le!=null&&(q.flexWrap=le);const ue=Q.length||y.length||P.length?_.div({class:ae(["cms-toolbar-copy",e.copyClass])},Q.length?_.div({class:ae(["cms-toolbar-meta",e.metaClass])},...Q):null,y.length?_.div({class:ae(["cms-toolbar-title",e.titleClass])},...y):null,P.length?_.div({class:ae(["cms-toolbar-subtitle",e.subtitleClass])},...P):null):null,L=!!(i.length||ue||b.length||R.length),f=[u.length?_.div({class:ae(["cms-toolbar-before",e.beforeClass]),style:{...Z}},...u):null,L?_.div({class:"cms-toolbar-main",style:q},i.length?_.div({class:ae(["cms-toolbar-start",e.startClass]),style:{...Z}},...i):null,ue||b.length?_.div({class:ae(["cms-toolbar-center",te]),style:{...Z,flex:"1 1 240px"}},ue,...b):null,R.length?_.div({class:ae(["cms-toolbar-end",e.endClass]),style:{...Z,justifyContent:"flex-end",marginInlineStart:M}},...R):null):null,S.length?_.div({class:ae(["cms-toolbar-after",e.afterClass]),style:{...Z}},...S):null].filter(Boolean),m=_.div(D,...f);return Ke(m,e),m};const Eo=t=>{var e;return t&&t.nodeType===1&&((e=t.classList)==null?void 0:e.contains("cms-grid-col"))};he.Grid=(...t)=>{var m,g,F,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=l(e.items),r=Array.isArray(o)?o:o==null?[]:[o],v=(a={})=>{const C=e.itemProps||{},h={...C,...a};return h.class=ae([C.class,e.itemClass,a.class]),h.style={...C.style||{},...e.itemStyle||{},...a.style||{}},h},u=(a,C={})=>{if(a==null||a===!1)return[];if(Eo(a))return[a];if(_n(a)){const h=a.children!=null?Zt(a.children):a.content!=null?Zt(a.content):a.node!=null?Zt(a.node):a.label!=null?Zt(a.label):[];return[he.GridCol(v(a),...h)]}return Array.isArray(a)?[he.GridCol(v(C),...a)]:[he.GridCol(v(C),a)]},i=(a,C,h,J=!0)=>{if(a==null||a===!1)return[];const j=_n(a)?a:{};if(J){const U={item:a,index:C,count:h,first:C===0,last:C===h-1},ce=E(s,"item",U,null);if(ce.length)return ce.flatMap(k=>u(k,j))}return u(a,j)},b=[];r.forEach((a,C)=>{b.push(...i(a,C,r.length))}),E(s,"default",{items:r,count:r.length},n).forEach(a=>{b.push(...u(a))}),b.length||E(s,"empty",{items:r,count:0},e.empty).forEach(C=>{const h=u(C,{style:{gridColumn:"1 / -1"}});b.push(...h)});const S=ae(["cms-grid",JSswift.uiResponsiveClasses({mobile:e},Zs),JSswift.uiResponsiveClasses(e,Zs),fe(e.dense,"dense"),fe(e.inline,"cms-grid-inline"),fe(e.debug,"cms-grid-debug"),e.class]),y=JSswift.omit(e,["gap","rowGap","columnGap","colGap","cols","columns","rows","areas","align","justify","alignItems","justifyItems","placeItems","placeContent","dense","flow","inline","debug","autoFit","autoFill","min","max","autoRows","items","itemClass","itemStyle","itemProps","empty","slots","full","width","minWidth","maxWidth","padding",...JSswift.uiResponsiveOmitProps]);y.class=S;const P={...e.style||{}};(m=JSswift.uiResponsiveHasConfig)!=null&&m.call(JSswift,e)&&e.display==null&&!We(e,"display")&&P.display==null&&(P.display=e.inline?"inline-grid":"grid");const Q=ze(e.gap,Be);Q!=null&&!We(e,"gap")&&(P["--cms-grid-gap"]=Q,P.gap=Q);const G=ze(e.rowGap,Be);G!=null&&!We(e,"rowGap")&&(P.rowGap=G);const ie=ze((g=e.columnGap)!=null?g:e.colGap,Be);ie!=null&&!We(e,["columnGap","colGap"])&&(P.columnGap=ie);const D=ze(e.max,Be,"1fr"),$=ze(e.min,Be);if($!=null){const a=l(e.autoFill)?"auto-fill":"auto-fit";P.gridTemplateColumns=`repeat(${a}, minmax(${$}, ${D||"1fr"}))`}else{const a=ze((F=e.columns)!=null?F:e.cols,C=>typeof C=="number"?`repeat(${C}, minmax(0, 1fr))`:String(C));a!=null&&!We(e,["cols","columns"])&&(P.gridTemplateColumns=a)}const Y=ze(e.rows,a=>typeof a=="number"?`repeat(${a}, minmax(0, auto))`:String(a));Y!=null&&(P.gridTemplateRows=Y);const W=ze(e.autoRows,Be);W!=null&&(P.gridAutoRows=W);const le=ze(e.flow,a=>{const C=String(a);return e.dense&&!C.includes("dense")?`${C} dense`:C});le!=null&&!We(e,"flow")&&(P.gridAutoFlow=le);const me=ze(e.areas,a=>Array.isArray(a)?a.map(C=>`"${Array.isArray(C)?C.join(" "):String(C)}"`).join(" "):String(a));me!=null&&(P.gridTemplateAreas=me);const re=ze((X=e.align)!=null?X:e.alignItems);re!=null&&!We(e,["align","alignItems"])&&(P.alignItems=re);const oe=ze(e.justify);oe!=null&&!We(e,"justify")&&(P.justifyContent=oe);const se=ze(e.justifyItems);se!=null&&(P.justifyItems=se);const te=ze(e.placeItems);te!=null&&(P.placeItems=te);const M=ze(e.placeContent);M!=null&&(P.placeContent=M);const Z=ze(e.width,Be);Z!=null&&!We(e,"width")&&(P.width=Z),l(e.full)===!0&&(P.width="100%");const q=ze(e.minWidth,Be);q!=null&&!We(e,"minWidth")&&(P.minWidth=q);const ue=ze(e.maxWidth,Be);ue!=null&&!We(e,"maxWidth")&&(P.maxWidth=ue);const L=ze(e.padding,Be);L!=null&&!We(e,"padding")&&(P.padding=L),Object.keys(P).length&&(y.style=P),JSswift.uiApplyResponsiveProps(y,e,JSswift.uiResponsiveStyleRules);const f=_.div(y,...b);return Ke(f,e),f},he.GridCol=(...t)=>{var Ce,pe,Ie,_e,z,we,T,x;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=w=>Object.prototype.hasOwnProperty.call(e,w),r=(w,c,A={})=>{const de=Array.isArray(w)?w:[w];for(const Le of de)if(JSswift.ui.getSlot(s,Le)!=null)return E(s,Le,A,c);return c==null?[]:E(null,"default",A,c)},v=w=>{var c;return w==null||w===!1||w===""?"":typeof w=="string"&&((c=JSswift.uiSizes)!=null&&c.includes(w))?`var(--cms-s-${w})`:Be(w)},u=w=>{var c;return w==null||w===!1||w===""?"":typeof w=="string"&&((c=JSswift.uiSizes)!=null&&c.includes(w))?ms(w,"size"):Be(w)},i={...e.style||{}},b=w=>{if(w==null||w==="")return null;if(w==="auto")return"auto";if(w==="full"||w===!0)return"1 / -1";const c=Number(w);if(Number.isFinite(c)&&c>0){const A=Math.max(1,Math.round(c));return`span ${A} / span ${A}`}return String(w)},R=w=>{if(w==null||w==="")return null;if(w==="full"||w===!0)return"1 / -1";const c=Number(w);if(Number.isFinite(c)&&c>0){const A=Math.max(1,Math.round(c));return`span ${A} / span ${A}`}return String(w)},S=o("span")?e.span:e.col,y=ze(S,b),P=ze(e.sm,b),Q=ze(e.md,b),G=ze(e.lg,b),ie=JSswift.uiResponsivePropsFor(e,pn("tablet"))||{},D=JSswift.uiResponsivePropsFor(e,pn("pc"))||{},$=(Ce=ie.span)!=null?Ce:ie.col,Y=(pe=D.span)!=null?pe:D.col,W=ze($,b),le=ze(Y,b),me=ze(e.rowSpan,R),re=ze(e.row,R),oe=ze(e.area),se=ze(e.align),te=ze(e.justify),M=ze(e.place),Z=ze(e.gap,v),q=ze(e.rowGap,v),ue=ze(e.columnGap,v),L=ze(e.padding,v),f=ze(e.width,u),m=ze(e.minHeight,u),g=ze(e.height,u),F=ze(e.maxHeight,u),X=ze(e.contentAlign),a=ze(e.contentJustify),C=ze(e.direction),h=ze(e.scroll,w=>w===!0?"auto":String(w),""),J=ze(e.fullHeight,w=>w?"100%":"",""),j=qe([e.center,e.contentAlign,e.contentJustify],()=>!!l(e.center)&&(l(e.contentAlign)==null||l(e.contentAlign)==="")&&(l(e.contentJustify)==null||l(e.contentJustify)==="")),U={props:e},ce=r(["start","top","header","before"],(z=(_e=(Ie=e.start)!=null?Ie:e.top)!=null?_e:e.header)!=null?z:e.before,U),k=o("body")?e.body:o("content")?e.content:n,d=r(["body","content","default"],k,U),N=r(["end","bottom","footer","after"],(x=(T=(we=e.end)!=null?we:e.bottom)!=null?T:e.footer)!=null?x:e.after,U),I=ce.length||N.length||o("start")||o("top")||o("header")||o("before")||o("body")||o("content")||o("end")||o("bottom")||o("footer")||o("after")||e.startClass||e.bodyClass||e.contentClass||e.endClass||e.topClass||e.headerClass||e.bottomClass||e.footerClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"top")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"content")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"bottom")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,H=qe([e.stack,e.gap,e.rowGap,e.columnGap,e.contentAlign,e.contentJustify,e.direction,e.center],()=>I||l(e.stack)||[l(e.gap),l(e.rowGap),l(e.columnGap),l(e.contentAlign),l(e.contentJustify),l(e.direction)].some(c=>c!=null&&c!==!1&&c!=="")?!0:!!l(e.center)),ge=qe([e.panel,e.color,e.clickable,e.border,e.glossy,e.glow,e.glass,e.shadow,e.outline,e.gradient,e.textGradient,e.lightShadow,e.radius],()=>!!(l(e.panel)||l(e.color)||l(e.clickable)||l(e.border)||l(e.glossy)||l(e.glow)||l(e.glass)||l(e.shadow)||l(e.outline)||l(e.gradient)||l(e.textGradient)||l(e.lightShadow)||l(e.radius))?["cms-clear-set","cms-singularity","cms-grid-col-surface"]:[]),Se=ae(["cms-grid-col",ge,JSswift.uiResponsiveClasses({mobile:e},el),JSswift.uiResponsiveClasses(e,el),fe(e.panel,"cms-grid-col-panel"),fe(e.auto,"is-auto"),fe(H,"cms-grid-col-stack"),fe(e.inline,"cms-grid-col-inline"),fe(j,"cms-grid-col-center"),e.class]),ye=JSswift.omit(e,["span","col","sm","md","lg","auto","row","rowSpan","area","align","justify","place","gap","rowGap","columnGap","padding","width","height","minHeight","maxHeight","fullHeight","stack","inline","direction","contentAlign","contentJustify","center","scroll","panel","to","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass","slots","style","clickable","dense","flat","border","glossy","glow","glass","shadow","outline","rounded","gradient","textGradient","lightShadow","color","textColor","size","radius",...JSswift.uiResponsiveOmitProps]);ye.class=Se,i["--cms-grid-col-base"]==null&&(i["--cms-grid-col-base"]="auto"),i["--cms-grid-col-tablet"]==null&&(i["--cms-grid-col-tablet"]="var(--cms-grid-col-base, auto)"),i["--cms-grid-col-pc"]==null&&(i["--cms-grid-col-pc"]="var(--cms-grid-col-tablet, var(--cms-grid-col-base, auto))"),l(e.auto)===!0?i["--cms-grid-col-base"]="auto":y!=null&&(i["--cms-grid-col-base"]=y),P!=null&&(i["--cms-grid-col-sm"]=P),Q!=null&&(i["--cms-grid-col-md"]=Q),G!=null&&(i["--cms-grid-col-lg"]=G),W!=null&&(i["--cms-grid-col-tablet"]=W),le!=null&&(i["--cms-grid-col-pc"]=le),me!=null?i.gridRow=me:re!=null&&(i.gridRow=re),oe!=null&&(i.gridArea=oe),se!=null&&!We(e,"align")&&(i.alignSelf=se),te!=null&&!We(e,"justify")&&(i.justifySelf=te),M!=null&&!We(e,"place")&&(i.placeSelf=M),Z!=null&&!We(e,"gap")&&(i.gap=Z),q!=null&&!We(e,"rowGap")&&(i.rowGap=q),ue!=null&&!We(e,"columnGap")&&(i.columnGap=ue),L!=null&&!We(e,"padding")&&(i.padding=L),f!=null&&!We(e,"width")&&(i.width=f),J!=null&&J!==""?i.height=J:g!=null&&!We(e,"height")&&(i.height=g),m!=null&&!We(e,"minHeight")&&(i.minHeight=m),F!=null&&!We(e,"maxHeight")&&(i.maxHeight=F),C!=null&&!We(e,"direction")&&(i.flexDirection=C),X!=null&&!We(e,"contentAlign")?i.alignItems=X:j!=null&&j!==""&&(i.alignItems=j?"center":""),a!=null&&!We(e,"contentJustify")?i.justifyContent=a:j!=null&&j!==""&&(i.justifyContent=j?"center":""),h!=null&&h!==""&&(i.overflow=h),Object.keys(i).length&&(ye.style=i),JSswift.uiApplyResponsiveProps(ye,e,Io);const V=e.onClick,O=e.onKeydown,K=!!(l(e.clickable)||l(e.to)),ke=w=>{var A;if(V==null||V(w),w.defaultPrevented)return;const c=l(e.to);c&&((A=JSswift.router)!=null&&A.navigate)&&(w.preventDefault(),JSswift.router.navigate(c))},Ne=w=>{O==null||O(w),!w.defaultPrevented&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),ke(w))};if(K&&(ye.onClick=ke,ye.onKeydown=Ne,ye.tabIndex==null&&(ye.tabIndex=0),ye.role==null&&(ye.role="button")),!I){const w=_.div(ye,...E(s,"default",U,n));return Ke(w,e),w}const ee={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},xe=[ce.length?_.div({class:ae(["cms-grid-col-start",e.startClass,e.topClass,e.headerClass]),style:{...ee}},...ce):null,d.length?_.div({class:ae(["cms-grid-col-body",e.bodyClass,e.contentClass]),style:{...ee,flex:"1 1 auto"}},...d):null,N.length?_.div({class:ae(["cms-grid-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...ee}},...N):null].filter(Boolean),be=_.div(ye,...xe);return Ke(be,e),be},he.Icon=(...t)=>{var re,oe;let e={},n=[],s="home",o=!1;const r=t[0],v=t[1],u=se=>se&&typeof se=="object"&&!se.nodeType&&!Array.isArray(se)&&!(se instanceof Function);typeof r=="string"?(s=r,o=!0,u(v)?(e=v,t.length>2&&(n=t.slice(2))):t.length>1&&(n=t.slice(1))):u(r)?(e=r,r.name!=null&&(s=r.name,o=!0),t.length>1&&(n=t.slice(1))):t.length&&(n=t),!o&&n.length&&(s=n.length===1?n[0]:n),Yt(e);const i=e.slots||{},b=l(e.size),R=l(e.color),S=String(s).endsWith("-fill"),y={...e.style||{}},P=qe(e.size,()=>{const se=l(e.size);return typeof se=="string"&&kn[se]?se:""}),Q=!!(e.color||e.clickable||e.border||e.glossy||e.glow||e.glass||e.shadow||e.outline||e.gradient||e.textGradient||e.lightShadow||e.radius),G={"chevron-down":{viewBox:"0 0 24 24",paths:[{d:"M6 9l6 6l6 -6",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}]}},ie=se=>{const te=G[se];return te?_.svg({width:"100%",height:"100%",viewBox:te.viewBox,fill:"none","aria-hidden":"true",focusable:"false"},...te.paths.map(M=>_.path(M))):null},D=se=>{const te=l(e.tooltip);if(te==null||te===!1||!he.Tooltip)return se;const M=u(te)?{...te}:{text:te};return u(e.tooltipProps)&&Object.assign(M,e.tooltipProps),he.Tooltip({...M,target:se})},$=ae(["cms-icon","material-icons",...Q?["cms-clear-set","cms-singularity"]:[],P,e.class]),Y=JSswift.omit(e,["name","size","class","style","label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots","spriteUrl","tooltip","tooltipProps"]);if(Y.class=$,Object.keys(y).length&&(Y.style=y),typeof s=="function"||s&&typeof s=="object"){const se=JSswift.ui.renderSlot(i,"default",{},s),te=E(null,"default",{},se),M=_.span({...Y,"data-icon":"custom"},...te);return Ke(M,e),D(M)}const W=String(s),le=W.includes("#")?W:"";let me=null;if(le){const se=e.spriteUrl||((re=JSswift.config)==null?void 0:re.iconSpriteUrl)||(typeof globalThis!="undefined"?(oe=globalThis.JSswift_setting)==null?void 0:oe.iconSpriteUrl:null),te=le.slice(le.indexOf("#")+1),M=se?_.svg({width:"100%",height:"100%"},_.use({href:se+le})):ie(te)||_.svg({width:"100%",height:"100%"},_.use({href:le}));S&&(M.style.fill="currentColor"),me=_.span({...Y,"data-icon":W},M,...n)}else me=_.span({...Y,"data-icon":W},W,...n);if(b!=null){let se=b;JSswift.uiSizes.includes(b)&&(se=`var(--cms-icon-size-${b})`),se=typeof se=="number"?se+"px":String(se),me.style.setProperty("--set-icon-size",se)}return Ke(me,e),D(me)},he.Badge=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{const G=l(e.size);return typeof G=="string"&&kn[G]?`cms-size-${G}`:""}),r=ae(["cms-clear-set","cms-badge","cms-singularity",o,fe(e.outline,"outline"),e.class]),v=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);v.class=r;const u={...e.style||{}};if(e.size){const G=l(e.size);typeof G=="string"&&kn[G]||(u.fontSize=Be(e.size))}v.style=u;const i=(G,ie,D)=>{const $=Array.isArray(G)?G:[G];for(const Y of $)if(JSswift.ui.getSlot(s,Y)!=null)return E(s,Y,ie,D);return D==null||D===!1||D===""?[]:E(null,"default",ie,D)},b=()=>{var ie;const G=l((ie=e.iconSize)!=null?ie:e.size);return typeof G=="number"?Math.max(10,Math.round(G*.85)):typeof G=="string"&&{xxs:10,xs:11,sm:12,md:13,lg:14,xl:16,xxl:18,xxxl:20}[G]||14},R=(G,ie)=>{const D=l(G);return D==null||D===!1||D===""?null:typeof D=="string"?he.Icon({name:D,size:b()}):JSswift.ui.slot(D,{as:ie})},S=(G,ie,D)=>_.dynamic(()=>{const $=R(e[ie],D),Y=i(G,{position:D},$);return Y.length?_.span({class:`cms-badge-anchor cms-badge-anchor-${D}`,"data-badge-slot":D},...Y):null}),y=_.dynamic(()=>{const G=l(e.label);let ie=i(["label"],{},G);return ie.length||(ie=i(["default"],{},n)),_.span({class:"cms-badge-content"},_.span({class:"cms-badge-label"},...ie.length?ie:[""]))}),P=_.dynamic(()=>{const G=l(e.notification),ie=G==null||G===!1||G===""?null:G,D=i(["notification"],{notification:G},ie);return D.length?_.span({class:"cms-badge-notification","data-badge-slot":"notification","aria-label":typeof G=="number"?`${G} notifications`:null},...D):null}),Q=_.span(S(["left"],"left","left"),S(["centerLeft","center-left"],"centerLeft","center-left"),v,y,S(["topLeft","top-left"],"topLeft","top-left"),S(["topRight","top-right"],"topRight","top-right"),S(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),S(["bottomRight","bottom-right"],"bottomRight","bottom-right"),S(["centerRight","center-right"],"centerRight","center-right"),S(["right"],"right","right"),P);return(e.topLeft||e.centerLeft||e.bottomLeft)&&Q.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&Q.style.setProperty("padding-right","15px"),Ke(Q,e),Q};const To=t=>{if(t==null||t===!1)return"";const e=String(t).replace(/[._-]+/g," ").replace(/\s+/g," ").trim();if(!e)return"";const n=e.split(" ").filter(Boolean);return n.length?n.length===1?n[0].replace(/[^a-z0-9]/gi,"").slice(0,2).toUpperCase():n.slice(0,2).map(s=>s.charAt(0).toUpperCase()).join(""):""},ll=(t,e)=>{const n=t==null||t===!0?e:t;if(n==null||n===!1)return mt(e);const s=String(n).toLowerCase();return s==="online"||s==="available"||s==="active"?"success":s==="away"||s==="pending"?"warning":s==="busy"||s==="dnd"||s==="blocked"?"danger":s==="offline"||s==="idle"?"secondary":mt(s)||mt(e)},ol=(t,e="cms-avatar-badge")=>t==null||t===!1?null:t instanceof Node||Array.isArray(t)||typeof t=="function"?t:t===!0?_.span({class:e}):_.span({class:e},String(t)),Ro=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=ll(null,e);return _.span({class:ae(["cms-avatar-status",s?`cms-state-${s}`:""])})}if(t instanceof Node||Array.isArray(t)||typeof t=="function")return t;const n=ll(t,e);return t===!0||n?_.span({class:ae(["cms-avatar-status",n?`cms-state-${n}`:""])}):ol(t,"cms-avatar-badge")},Bn=(t,e)=>!e||!e.length?null:_.span({class:ae(["cms-avatar-anchor",t])},...e);he.Avatar=(...t)=>{var g,F,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{var C;const a=l(e.size);return typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?`cms-size-${a}`:""}),r=qe([e.color,e.state],()=>{const a=l(e.color)||l(e.state)||"",C=mt(a);return C?`cms-state-${C}`:""}),v=ae(["cms-clear-set","cms-avatar","cms-singularity",o,r,fe(e.square,"cms-avatar-square"),fe(e.elevated,"elevated"),e.class]),u=JSswift.omit(e,["src","srcset","srcSet","sizes","alt","label","name","initials","text","size","fontSize","textSize","radius","rounded","square","elevated","icon","iconSize","media","fit","badge","notification","status","statusColor","presence","topLeft","topRight","bottomLeft","bottomRight","slots"]);u.class=v;const i={...e.style||{}},b=ze(e.size,a=>{var C;return typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?"":Be(a)},"");b!=null&&(i.width=b,i.height=b);const R=(g=e.fontSize)!=null?g:e.textSize,S=R!=null?ze(R,Be):ze(e.size,a=>{var C;return typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?"":`clamp(11px, calc(${Be(a)} * 0.34), 28px)`},"");S!=null&&(i.fontSize=S);const y=ze(e.radius,a=>{const C=so(a);return C==="xxxl"?"999px":C?`var(--cms-r-${C})`:typeof a=="number"?`${a}px`:String(a)});y!=null&&(i["--set-border-radius"]=y),u.style=i;const P={props:e},Q=qe([e.alt,e.label,e.name,e.text],()=>{const a=l(e.alt)||l(e.label)||l(e.name)||l(e.text)||"avatar";return String(a)}),G=e.icon!=null?typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,ie=qe([e.initials,e.text,e.label,e.name],()=>{var h,J;const a=(h=l(e.initials))!=null?h:l(e.text);if(a!=null)return a;const C=(J=l(e.label))!=null?J:l(e.name);return typeof C=="string"?To(C):C}),D=ol(l((F=e.badge)!=null?F:e.notification)),$=Ro(l((X=e.status)!=null?X:e.presence),l(e.statusColor));let Y=E(s,"media",P,e.media);if(!Y.length&&e.src){const a={class:"cms-avatar-img",src:e.src,alt:Q,sizes:e.sizes,style:{}};e.srcset!=null&&(a.srcset=e.srcset),e.srcSet!=null&&(a.srcset=e.srcSet);const C=ze(e.fit);C!=null&&(a.style.objectFit=C),Y=[_.img(a)]}const W=E(s,"default",P,n),le=E(s,"fallback",P,null),me=E(s,"label",P,ie),re=E(s,"icon",P,G),oe=Y.length?Y:W.length?W:le.length?le:me.length?me:re.length?re:["?"],se=Y.length?"cms-avatar-media":"cms-avatar-fallback",te=_.span({class:"cms-avatar-body"},_.span({class:se},...oe));let M=E(s,"topLeft",P,e.topLeft),Z=E(s,"topRight",P,e.topRight),q=E(s,"bottomLeft",P,e.bottomLeft),ue=E(s,"bottomRight",P,e.bottomRight);const L=E(s,"badge",P,D),f=E(s,"status",P,$);!Z.length&&L.length&&(Z=L),!ue.length&&f.length&&(ue=f);const m=_.div(u,te,Bn("cms-avatar-anchor-top-left",M),Bn("cms-avatar-anchor-top-right",Z),Bn("cms-avatar-anchor-bottom-left",q),Bn("cms-avatar-anchor-bottom-right",ue));return Ke(m,e),m},he.Chip=(...t)=>{var ie,D,$,Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{const W=l(e.size);return typeof W=="string"&&kn[W]?W:""}),r=ae(["cms-clear-set","cms-chip","cms-singularity",o,e.class]),v=JSswift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);v.class=r,v.style={...e.style||{}};const u=e.icon?typeof e.icon=="string"?he.Icon({name:e.icon,size:(ie=e==null?void 0:e.size)!=null?ie:null}):JSswift.ui.slot(e.icon,{as:"icon"}):null,i=e.iconRight?typeof e.iconRight=="string"?he.Icon({name:e.iconRight,size:(D=e==null?void 0:e.size)!=null?D:null}):JSswift.ui.slot(e.iconRight,{as:"iconRight"}):null,b=JSswift.ui.renderSlot(s,"icon",{},u),R=JSswift.ui.renderSlot(s,"iconRight",{},i),S=E(s,"label",{},e.label),y=S.length?S:E(s,"default",{},n),P=E(null,"default",{},b),Q=E(null,"default",{},R),G=_.span(v,...P,...y.length?y:[""],...Q);if(e.removable){const W=he.Btn({class:"cms-chip-remove",onClick:e.onRemove,size:($=e==null?void 0:e.size)!=null?$:null},he.Icon({size:(Y=e==null?void 0:e.size)!=null?Y:null,name:"close"}));G.appendChild(W),W.onclick=()=>{e.onRemove&&e.onRemove(),G.remove()}}return Ke(G,e),G},he.Stat=(...t)=>{var re,oe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.state)||l(e.color)||""),r=qe([e.state,e.color],()=>{const se=o();return se?`cms-state-${se}`:""}),v=qe(e.trend,()=>{const se=String(l(e.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(se)?"is-positive":["down","negative","danger","loss","decrease"].includes(se)?"is-negative":["flat","neutral","steady","stable"].includes(se)?"is-neutral":""}),u={...e},i=JSswift.omit(u,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","meta","note","slots","state","subtitle","title","trend","value"]);i.class=ae(["cms-clear-set","cms-stat","cms-singularity",r,v,u.class]),i.style={...u.style||{}};const b=(se,te,M={})=>E(s,se,M,te),R=e.icon==null?null:typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"md"}):JSswift.ui.slot(e.icon,{as:"icon"}),S=b("eyebrow",e.eyebrow),y=b("label",(re=e.label)!=null?re:e.title),P=b("value",e.value),Q=b("note",(oe=e.note)!=null?oe:e.subtitle),G=b("meta",e.meta),ie=b("delta",e.delta,{trend:e.trend}),D=b("icon",R),$=b("aside",e.aside),Y=b("footer",e.footer),W=b("actions",e.actions),le=b("default",n),me=_.article(i,_.div({class:"cms-stat-head"},_.div({class:"cms-stat-lead"},D.length?_.div({class:"cms-stat-icon"},...D):null,_.div({class:"cms-stat-copy"},S.length?_.div({class:"cms-stat-eyebrow"},...S):null,y.length?_.div({class:"cms-stat-label"},...y):null)),$.length?_.div({class:"cms-stat-aside"},...$):null),_.div({class:"cms-stat-body"},P.length?_.div({class:"cms-stat-value"},...P):null,ie.length?_.div({class:"cms-stat-delta"},...ie):null,Q.length?_.div({class:"cms-stat-note"},...Q):null,G.length?_.div({class:"cms-stat-meta"},...G):null,le.length?_.div({class:"cms-stat-extra"},...le):null),Y.length||W.length?_.div({class:"cms-stat-footer"},Y.length?_.div({class:"cms-stat-footer-copy"},...Y):null,W.length?_.div({class:"cms-stat-actions"},...W):null):null);return Ke(me,e),me},he.Kpi=(...t)=>{var re,oe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.state)||l(e.color)||""),r=qe([e.state,e.color],()=>{const se=o();return se?`cms-state-${se}`:""}),v={...e},u=JSswift.omit(v,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","media","meta","note","slots","state","subtitle","title","trend","value"]);u.class=ae(["cms-clear-set","cms-kpi","cms-singularity",r,v.class]),u.style={...v.style||{}};const i=(se,te,M={})=>E(s,se,M,te),b=e.icon==null?null:typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"lg"}):JSswift.ui.slot(e.icon,{as:"icon"}),R=i("eyebrow",e.eyebrow),S=i("title",(re=e.title)!=null?re:e.label),y=i("value",e.value),P=i("delta",e.delta,{trend:e.trend}),Q=i("note",(oe=e.note)!=null?oe:e.subtitle),G=i("meta",e.meta),ie=i("icon",b),D=i("aside",e.aside),$=i("media",e.media),Y=i("footer",e.footer),W=i("actions",e.actions),le=i("default",n),me=_.section(u,_.div({class:"cms-kpi-head"},_.div({class:"cms-kpi-title-wrap"},ie.length?_.div({class:"cms-kpi-icon"},...ie):null,_.div({class:"cms-kpi-copy"},R.length?_.div({class:"cms-kpi-eyebrow"},...R):null,S.length?_.div({class:"cms-kpi-title"},...S):null)),D.length?_.div({class:"cms-kpi-aside"},...D):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},y.length?_.div({class:"cms-kpi-value"},...y):null,P.length?_.div({class:"cms-kpi-delta"},...P):null),Q.length?_.div({class:"cms-kpi-note"},...Q):null,G.length?_.div({class:"cms-kpi-meta"},...G):null,$.length?_.div({class:"cms-kpi-media"},...$):null,le.length?_.div({class:"cms-kpi-extra"},...le):null),Y.length||W.length?_.div({class:"cms-kpi-footer"},Y.length?_.div({class:"cms-kpi-footer-copy"},...Y):null,W.length?_.div({class:"cms-kpi-actions"},...W):null):null);return Ke(me,e),me};const Mo=(t,e=180)=>{const n=getComputedStyle(t).transitionDuration;if(!n)return e;const s=n.split(",")[0].trim();if(!s)return e;const o=s.includes("ms")?parseFloat(s):parseFloat(s)*1e3;return Number.isFinite(o)?o:e},bn=t=>{!(t!=null&&t.overlay)||!(t!=null&&t.panel)||(t.overlay.classList.add("enter"),t.panel.classList.add("enter"),requestAnimationFrame(()=>{!(t!=null&&t.overlay)||!(t!=null&&t.panel)||(t.overlay.classList.add("entered"),t.panel.classList.add("entered"),t.overlay.classList.remove("enter"),t.panel.classList.remove("enter"))}))},yn=(t,e)=>{if(!(t!=null&&t.overlay)||!(t!=null&&t.panel)){e==null||e();return}if(t._closing)return;t._closing=!0,t.overlay.classList.add("leave"),t.panel.classList.add("leave");const n=()=>{t._closed||(t._closed=!0,e==null||e())},s=r=>{r.target===t.panel&&(t.panel.removeEventListener("transitionend",s),n())};t.panel.addEventListener("transitionend",s);const o=Mo(t.panel,180);setTimeout(n,o+40)};he.List=(...t)=>{var D;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=!!l((D=e.number)!=null?D:e.ordered),r=l(e.marker),v=l(e.items),u=Array.isArray(v)?v:v==null?[]:[v],i=($={})=>{const Y=e.itemProps||{},W={...Y,...$};return e.divider!=null&&W.divider==null&&(W.divider=e.divider),W.class=ae([Y.class,e.itemClass,$.class]),W.style={...Y.style||{},...e.itemStyle||{},...$.style||{}},W},b=$=>{if($==null||$===!1)return[];if(rs($))return[$];if(_n($)){const Y=$.children!=null?Zt($.children):$.content!=null?Zt($.content):Zt($.node);return[he.Item(i($),...Y)]}return Array.isArray($)?[he.Item(i(),...$)]:$!=null&&$.nodeType?[he.Item(i(),$)]:[he.Item(i(),$)]},R=($,Y,W,le=!0)=>{if($==null||$===!1)return[];if(le){const me={item:$,index:Y,count:W,first:Y===0,last:Y===W-1},re=E(s,"item",me,null);if(re.length)return re.flatMap(oe=>b(oe))}return b($)},S=[];u.forEach(($,Y)=>{S.push(...R($,Y,u.length))});const y=E(s,"default",{items:u,count:u.length},n);if(y.forEach(($,Y)=>{S.push(...R($,u.length+Y,u.length+y.length,!1))}),!S.length){const $=E(s,"empty",{items:u,count:0},e.empty);$.length&&($.length===1&&rs($[0])?S.push($[0]):S.push(he.Item({class:"cms-item-empty",flat:!0},...$)))}const P=ae(["cms-list",fe(e.dense,"dense"),fe(e.divider,"divider"),fe(r===!1||r==="none","cms-list-no-marker"),e.class]),Q=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);Q.class=P,Q.style={...e.style||{}};const G=ze(e.gap,Be);return G!=null&&(Q.style["--cms-list-gap"]=G),r!=null&&r!==!1&&r!==!0&&r!=="none"&&(Q.style.listStyleType=String(r)),_[o?"ol":"ul"](Q,...S)},he.Item=(...t)=>{var L,f,m,g,F,X,a,C;const{props:e,children:n}=JSswift.uiNormalizeArgs(t);e.state!=null&&e.color==null&&(e.color=e.state),Yt(e);const s=e.slots||{},o=qe([e.clickable,e.to],()=>!!(l(e.clickable)||l(e.to))),r=qe([e.active,e.selected],()=>!!(l(e.active)||l(e.selected))),v=!!(e.color!=null||e.outline||e.border||e.glossy||e.glow||e.glass||e.shadow||e.gradient||e.textGradient||e.lightShadow||e.radius||e.rounded||e.flat),u=(h,J,j)=>{const U=l(h);return U==null||U===!1||U===""?null:typeof U=="string"?he.Icon({name:U,size:J||"sm"}):JSswift.ui.slot(U,{as:j})},i=E(s,"icon",{},u(e.icon,e.iconSize||e.size,"icon")),b=E(s,"title",{},(L=e.title)!=null?L:e.label),R=E(s,"subtitle",{},(m=(f=e.subtitle)!=null?f:e.caption)!=null?m:e.description),S=E(s,"meta",{},(g=e.meta)!=null?g:e.eyebrow),y=E(s,"body",{},(F=e.body)!=null?F:e.content),P=E(s,"default",{},n),Q=E(s,"actions",{},(X=e.actions)!=null?X:e.footer),G=(C=(a=e.aside)!=null?a:e.trailing)!=null?C:u(e.iconRight,e.iconSize||e.size,"iconRight"),ie=E(s,"aside",{},G),D=[...y,...P],$=!(v||e.clickable||e.to||i.length||b.length||R.length||S.length||Q.length||ie.length||y.length),Y=ae(["cms-item",fe(e.divider,"divider"),fe(v,"cms-clear-set"),fe(v,"cms-singularity"),fe(v,"cms-item-surface"),fe($,"cms-item-inline"),fe(o,"cms-item-clickable"),fe(r,"is-active"),fe(e.disabled,"is-disabled"),e.class]),W=JSswift.omit(e,["divider","slots","label","title","subtitle","caption","description","meta","eyebrow","body","content","children","node","icon","iconRight","iconSize","aside","trailing","actions","footer","clickable","to","active","selected","disabled","state","color","size","outline","flat","border","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","dense"]);W.class=Y,W.style={...e.style||{}};const le=e.onClick,me=e.onKeydown,re=h=>{var j;if(le==null||le(h),h.defaultPrevented||l(e.disabled))return;const J=l(e.to);J&&((j=JSswift.router)!=null&&j.navigate)&&(h.preventDefault(),JSswift.router.navigate(J))},oe=h=>{me==null||me(h),!(h.defaultPrevented||l(e.disabled))&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),re(h))};l(e.disabled)&&(W["aria-disabled"]="true"),(l(e.clickable)||l(e.to))&&(W.onClick=re,W.onKeydown=oe,W.tabIndex==null&&(W.tabIndex=l(e.disabled)?-1:0),W.role==null&&(W.role="button"));const se=b.length?_.div({class:"cms-item-title"},...b):null,te=R.length?_.div({class:"cms-item-subtitle"},...R):null,M=S.length?_.div({class:"cms-item-meta"},...S):null,Z=D.length?_.div({class:ae(["cms-item-body",fe(!(b.length||R.length||S.length),"is-standalone")])},...D):null,q=Q.length?_.div({class:"cms-item-actions"},...Q):null,ue=_.li(W,_.div({class:"cms-item-row"},i.length?_.div({class:"cms-item-icon"},...i):null,_.div({class:"cms-item-main"},M,se,te,Z,q),ie.length?_.div({class:"cms-item-aside"},...ie):null));return Ke(ue,e),ue},he.Separator=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=ae(["cms-separator",fe(e.vertical,"vertical"),e.class]),s=JSswift.omit(e,["vertical","size","slots"]);s.class=n;const o={borderColor:"var(--cms-border)",...e.style||{}},r=l(e.size),v=l(e.vertical);if(r!=null){const u=Be(r);v?o.width=u:o.height=u}return s.style=o,_.hr(s)},he.Banner=(...t)=>{var ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.type)||l(e.state)||""),r={state:o,dismissible:()=>!!l(e.dismissible)},v=qe([e.type,e.state],()=>o()),u=qe(e.variant,()=>{const L=String(l(e.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(L)?`cms-banner-${L}`:""}),i=qe([e.actionsPlacement,e.stack],()=>String(l(e.actionsPlacement)||"").toLowerCase()==="bottom"||l(e.stack)?"cms-banner-actions-bottom":""),b=qe(e.stack,()=>l(e.stack)?"cms-banner-stack":""),R={...e},S=JSswift.omit(R,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);S.class=ae(["cms-clear-set","cms-banner","cms-singularity",v,u,i,b,R.class]),S.style={...R.style||{}};const y=L=>{if(L==null||L==="")return"";const f=l(L);if(f==null||f==="")return"";const m=String(f);return Qt(m)?`var(--cms-${m})`:m};(e.accent!=null||at(e.accent))&&(S.style["--cms-banner-accent"]=()=>y(e.accent),S.style["--cms-banner-border"]=()=>{const L=y(e.accent);return L?`color-mix(in srgb, ${L} 38%, var(--cms-border-color))`:""},S.style["--cms-banner-bg"]=()=>{const L=y(e.accent);return L?`color-mix(in srgb, ${L} 14%, var(--cms-panel))`:""},S.style["--cms-banner-color"]=()=>{const L=y(e.accent);return L?`color-mix(in srgb, ${L} 78%, white)`:""});const P={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},Q=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||e.size||"md"}):JSswift.ui.slot(e.icon,{as:"icon"});const L=o(),f=L?P[L]:null;return f?he.Icon({name:f,size:e.iconSize||e.size||"md"}):null})(),G=E(s,"title",r,e.title),ie=E(s,"message",r,e.message!=null?e.message:n),D=E(s,"description",r,(ue=e.description)!=null?ue:e.subtitle),$=E(s,"meta",r,e.meta),Y=E(s,"default",r,e.body!=null?[e.body,...n||[]]:e.message!=null?n:null),W=E(s,"icon",r,Q),le=E(s,"aside",r,e.aside),me=E(s,"actions",r,e.actions),re=E(s,"dismiss",r,e.dismiss),oe=String(l(e.actionsPlacement)||"").toLowerCase()==="bottom"||!!l(e.stack),se=!!l(e.dismissible)||!!e.onDismiss;let te=null;const M=se?he.Btn({class:"cms-banner-close",outline:!0,size:e.size||"sm","aria-label":e.closeLabel||"Chiudi banner",onClick:L=>{var f;(f=e.onDismiss)==null||f.call(e,L),!L.defaultPrevented&&(te==null||te.remove())}},he.Icon({name:"close",size:e.size||"sm"})):null,Z=[...le,...oe?[]:me,...re.length?re:M?[M]:[]];te=_.div(S,W.length?_.div({class:"cms-banner-icon"},...W):null,_.div({class:"cms-banner-body"},_.div({class:"cms-banner-copy"},G.length?_.div({class:"cms-banner-title"},...G):null,ie.length?_.div({class:"cms-banner-message"},...ie):null,D.length?_.div({class:"cms-banner-description"},...D):null,Y.length?_.div({class:"cms-banner-extra"},...Y):null,$.length?_.div({class:"cms-banner-meta"},...$):null),oe&&me.length?_.div({class:"cms-banner-actions"},...me):null),Z.length?_.div({class:"cms-banner-side"},...Z):null);const q=S.role||(()=>{const L=o();return L==="danger"||L==="warning"?"alert":"status"})();return te.setAttribute("role",q),Ke(te,e),te},he.Alert=(...t)=>{var W;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.type)||l(e.state)||l(e.color)||"warning"),r=qe([e.type,e.state,e.color],()=>{const le=o();return le?`cms-state-${le}`:""}),v={...e},u=JSswift.omit(v,["actions","aside","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","state","subtitle","title","type","variant"]);u.class=ae(["cms-clear-set","cms-alert","cms-singularity",r,fe(e.dismissible,"is-dismissible"),v.class]),u.style={...v.style||{}};const i={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},b=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"});const le=i[o()]||i.warning;return he.Icon({name:le,size:e.iconSize||"sm"})})(),R=E(s,"title",{},e.title),S=E(s,"message",{},e.message!=null?e.message:n),y=E(s,"description",{},(W=e.description)!=null?W:e.subtitle),P=E(s,"meta",{},e.meta),Q=E(s,"actions",{},e.actions),G=E(s,"aside",{},e.aside),ie=E(s,"icon",{},b),D=E(s,"dismiss",{},e.dismiss);let $=null;const Y=e.dismissible||e.onDismiss?he.Btn({class:"cms-alert-close",outline:!0,size:"sm","aria-label":e.closeLabel||"Chiudi alert",onClick:le=>{var me;(me=e.onDismiss)==null||me.call(e,le),!le.defaultPrevented&&($==null||$.remove())}},he.Icon({name:"close",size:"sm"})):null;return $=_.div(u,ie.length?_.div({class:"cms-alert-icon"},...ie):null,_.div({class:"cms-alert-body"},R.length?_.div({class:"cms-alert-title"},...R):null,S.length?_.div({class:"cms-alert-message"},...S):null,y.length?_.div({class:"cms-alert-description"},...y):null,P.length?_.div({class:"cms-alert-meta"},...P):null,Q.length?_.div({class:"cms-alert-actions"},...Q):null),G.length||D.length||Y?_.div({class:"cms-alert-side"},...G,...D.length?D:Y?[Y]:[]):null),$.setAttribute("role",o()==="danger"||o()==="warning"?"alert":"status"),Ke($,e),$},he.EmptyState=(...t)=>{var Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.state)||l(e.color)||""),r=qe([e.state,e.color],()=>{const W=o();return W?`cms-state-${W}`:""}),v={...e},u=JSswift.omit(v,["actions","description","eyebrow","icon","iconSize","illustration","media","message","meta","slots","state","title"]);u.class=ae(["cms-clear-set","cms-empty-state","cms-singularity",r,fe(e.compact,"compact"),fe(e.inline,"inline"),v.class]),u.style={...v.style||{}};const i=e.icon===!1?null:e.icon!=null?typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"xl"}):JSswift.ui.slot(e.icon,{as:"icon"}):he.Icon({name:"inbox",size:e.iconSize||"xl"}),b=E(s,"illustration",{},(Y=e.illustration)!=null?Y:e.media),R=E(s,"icon",{},i),S=E(s,"eyebrow",{},e.eyebrow),y=E(s,"title",{},e.title),P=E(s,"message",{},e.message!=null?e.message:n),Q=E(s,"description",{},e.description),G=E(s,"meta",{},e.meta),ie=E(s,"actions",{},e.actions),D=E(s,"default",{},e.message!=null?n:null),$=_.section(u,b.length?_.div({class:"cms-empty-state-illustration"},...b):null,R.length?_.div({class:"cms-empty-state-icon"},...R):null,S.length?_.div({class:"cms-empty-state-eyebrow"},...S):null,y.length?_.div({class:"cms-empty-state-title"},...y):null,P.length?_.div({class:"cms-empty-state-message"},...P):null,Q.length?_.div({class:"cms-empty-state-description"},...Q):null,G.length?_.div({class:"cms-empty-state-meta"},...G):null,D.length?_.div({class:"cms-empty-state-extra"},...D):null,ie.length?_.div({class:"cms-empty-state-actions"},...ie):null);return Ke($,e),$};let qt="jsswift:drawer-open";const il=new Set,hs=new Map,en=(t=qt)=>{const e=JSswift==null?void 0:JSswift.store;if(e!=null&&e.get){const n=e.get(t,void 0);if(typeof n=="boolean")return n}try{return localStorage.getItem(t)==="1"}catch(n){return!1}},Fo=(t,e=qt)=>{const n=JSswift==null?void 0:JSswift.store;if(n!=null&&n.set){n.set(e,!!t);return}try{localStorage.setItem(e,t?"1":"0")}catch(s){}};let Et=en();const Wt=(t,e=qt)=>{Et=!!t;const n=hs.get(e);if(n&&n.size)n.forEach(s=>s==null?void 0:s.classList.toggle("open",Et));else{const s=document.querySelector(".cms-drawer");s&&s.classList.toggle("open",Et)}return il.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(Et);return}const{el:o,openIcon:r,closeIcon:v}=s;o&&(o.textContent=Et?r:v)}),Fo(Et,e),Et};he.Tooltip=(...t)=>{var q,ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{};let o=null,r=null,v=null,u=null;const i=L=>Object.prototype.hasOwnProperty.call(e,L),b=i("target")||i("anchorEl")||i("triggerEl"),R=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),S=(L,f)=>{const m=l(L);if(m==null||m==="")return f;const g=Number(m);return Number.isFinite(g)?g:f},y=()=>{clearTimeout(r),clearTimeout(v),r=null,v=null},P=()=>S(e.delay,350),Q=()=>S(e.hideDelay,l(e.interactive)?120:0),G=()=>{if(y(),!o)return;const L=o;o=null,yn(L,()=>JSswift.overlay.close(L.id))},D=(L=>{if(L==null||L===!0)return new Set(["hover","focus"]);if(L===!1)return new Set(["manual"]);const f=Array.isArray(L)?L:String(L).split(/[\s,|/]+/),m=new Set;return f.forEach(g=>{const F=String(g||"").trim().toLowerCase();F&&(F==="mouseenter"||F==="mouseover"?m.add("hover"):F==="blur"||F==="focusin"?m.add("focus"):F==="tap"?m.add("click"):m.add(F))}),m.size?m:new Set(["manual"])})((ue=(q=e.trigger)!=null?q:e.triggers)!=null?ue:i("open")?"manual":null),$=D.has("hover"),Y=D.has("focus"),W=D.has("click"),le=D.has("manual")||!$&&!Y&&!W,me=()=>{var j,U,ce,k,d,N;const L={anchorEl:u||R||null,close:()=>G(),hide:()=>G(),isOpen:()=>!!o},f=e.icon?typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,m=E(s,"title",L,(j=e.title)!=null?j:e.heading),g=E(s,"icon",L,f),F=E(s,"footer",L,(U=e.footer)!=null?U:e.actions);let X=(N=(d=(k=(ce=e.content)!=null?ce:e.text)!=null?k:e.body)!=null?d:e.description)!=null?N:e.label;X==null&&(b?X=n:R&&n&&n.length>1?X=n.slice(1):R||(X=n));let a=E(s,"content",L,X);a.length||(a=E(s,"default",L,X));const C=a.length?_.div({class:"cms-tooltip-body"},...a):null,h=g.length||m.length?_.div({class:"cms-tooltip-head"},g.length?_.div({class:"cms-tooltip-icon"},...g):null,_.div({class:"cms-tooltip-head-main"},m.length?_.div({class:"cms-tooltip-title"},...m):null,C)):C,J=F.length?_.div({class:"cms-tooltip-footer"},...F):null;return _.div({class:"cms-tooltip-content"},...[h,J].filter(Boolean))},re=L=>{var a,C,h,J,j,U;const f=L||u;if(!f||l(e.disabled))return null;if(o&&o._anchorEl===f)return o;o&&G();const m=(a=e.closeOnOutside)!=null?a:W||l(e.interactive),g=(C=e.closeOnEsc)!=null?C:W||l(e.interactive);let F=null;if(o=JSswift.overlay.open(()=>me(),{type:"tooltip",anchorEl:f,placement:e.placement||"top",offsetX:(h=e.offsetX)!=null?h:0,offsetY:(j=(J=e.offsetY)!=null?J:e.offset)!=null?j:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:m,closeOnBackdrop:!1,closeOnEsc:g,autoFocus:!1,className:Dt(["cms-tooltip",fe(e.interactive,"interactive"),e.class,e.panelClass]),onClose:()=>{var ce,k;(ce=F==null?void 0:F._tooltipCleanup)==null||ce.call(F),o===F&&(o=null),(k=e.onClose)==null||k.call(e)}}),!(o!=null&&o.panel))return o;const X=o;if(F=X,X._anchorEl=f,X.panel.dataset.placement=String(l(e.placement||"top")),e.maxWidth!=null&&(X.panel.style.maxWidth=Be(l(e.maxWidth))),e.minWidth!=null&&(X.panel.style.minWidth=Be(l(e.minWidth))),e.width!=null&&(X.panel.style.width=Be(l(e.width))),e.style&&Object.assign(X.panel.style,e.style),Ke(X.panel,e),l(e.interactive)){const ce=()=>{clearTimeout(v),v=null},k=()=>se(),d=N=>{const I=N.target;I&&I.closest&&I.closest("[data-tooltip-close]")&&G()};X.panel.addEventListener("mouseenter",ce),X.panel.addEventListener("mouseleave",k),X.panel.addEventListener("focusin",ce),X.panel.addEventListener("focusout",k),X.panel.addEventListener("click",d),X._tooltipCleanup=()=>{var N,I,H,ge,Se;(N=X.panel)==null||N.removeEventListener("mouseenter",ce),(I=X.panel)==null||I.removeEventListener("mouseleave",k),(H=X.panel)==null||H.removeEventListener("focusin",ce),(ge=X.panel)==null||ge.removeEventListener("focusout",k),(Se=X.panel)==null||Se.removeEventListener("click",d)}}return bn(X),(U=e.onOpen)==null||U.call(e,X),X},oe=L=>{clearTimeout(v),v=null,clearTimeout(r),r=setTimeout(()=>re(L),P())},se=(L=!1)=>{if(clearTimeout(r),r=null,!!o){if(clearTimeout(v),L){G();return}v=setTimeout(()=>G(),Q())}},te=L=>{o?se(!0):re(L)},M=()=>!!o,Z=L=>{if(!L)return()=>{};u=L;const f=[],m=()=>{y(),f.forEach(g=>g())};if(i("open"))return at(e.open)?JSswift.reactive.effect(()=>{u&&(l(e.open)?re(u):se(!0))},"UI.Tooltip:open"):e.open===!0?re(L):e.open===!1&&se(!0),m;if(le||l(e.disabled))return m;if($){const g=()=>oe(L),F=()=>se();L.addEventListener("mouseenter",g),L.addEventListener("mouseleave",F),f.push(()=>{L.removeEventListener("mouseenter",g),L.removeEventListener("mouseleave",F)})}if(Y){const g=()=>oe(L),F=()=>se();L.addEventListener("focus",g),L.addEventListener("blur",F),f.push(()=>{L.removeEventListener("focus",g),L.removeEventListener("blur",F)})}if(W){const g=F=>{var X;(X=e.onTriggerClick)==null||X.call(e,F),!F.defaultPrevented&&te(L)};L.addEventListener("click",g),f.push(()=>L.removeEventListener("click",g))}return m};if(R){const L=ae(["cms-tooltip-wrap",e.wrapClass,e.targetClass]),f=JSswift.omit(e,["actions","anchorEl","body","closeOnEsc","closeOnOutside","content","delay","description","disabled","footer","heading","hideDelay","icon","iconSize","interactive","label","maxWidth","minWidth","offset","offsetX","offsetY","onClose","onOpen","onTriggerClick","open","panelClass","placement","slots","style","target","targetClass","targetStyle","text","title","trigger","triggerEl","triggers","width","wrapClass","wrapStyle"]);f.class=L,f.style={display:"inline-flex",alignItems:"center",...e.wrapStyle||e.targetStyle||{}};const m=JSswift.ui.renderSlot(s,"target",{open:()=>re(u),show:()=>oe(u),hide:()=>se(!0),toggle:()=>te(u),isOpen:M},R),g=_.span(f,...E(null,"default",{},m));return Z(g),g._tooltip={bind:Z,open:re,show:oe,hide:se,close:G,toggle:te,isOpen:M},g}return{bind:Z,open:re,show:oe,hide:se,close:G,toggle:te,isOpen:M}};const ps=(t,e,n={})=>{var L;const{props:s,children:o}=JSswift.uiNormalizeArgs(e),r=s.slots||{},v=t==="radio",u=n.appearance==="toggle",i=!v,b=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),R=Nt(s.model,n.modelName||(v?"UI.Radio:model":"UI.Checkbox:model")),S=JSswift.omit(s,["model","label","checked","class","style","dense","onChange","onInput","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","inputClass","iconSize","color","size","outline","behavior","mode","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);S.type=t,S.id=b,v&&s.name!=null&&(S.name=s.name),S.class=ae([`cms-${t}`,"cms-choice-input",s.inputClass]);const y=_.input(S),P=E(r,"label",{},s.label),Q=P.length?P:E(r,"default",{},o),G=fs(s,{className:"cms-shortcode cms-choice-shortcode"}),ie=G?[...Q,G]:Q,D=JSswift.omit(s,["model","label","checked","onChange","onInput","value","name","id","type","dense","inputClass","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","iconSize","color","size","behavior","mode","outline","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);D.class=ae(["cms-clear-set","cms-singularity-check","cms-choice-wrap",`cms-${t}-wrap`,fe(u,"cms-toggle-wrap"),fe(u&&v,"cms-toggle-radio-wrap"),fe(u&&!v,"cms-toggle-checkbox-wrap"),fe(s.dense,"dense"),s.class]),D.style={...s.style||{}};const $=l(s.size);$!=null&&!(typeof $=="string"&&((L=JSswift.uiSizes)!=null&&L.includes($)))&&(D.style["--cms-choice-size"]=Be($));const Y=_.span({class:ae(["cms-choice-mark",v?"cms-choice-radio-mark":"cms-choice-checkbox-mark",fe(u,"cms-toggle-mark")])}),W=u?_.span({class:"cms-toggle-thumb"}):Y;u&&Y.appendChild(W);const le=ie.length?_.span({class:"cms-choice-label"},...ie):null,me=_.label(D,y,Y,le);Ke(me,s);const re=s.iconSize?s.iconSize:s.size,oe=u?null:v?"radio_button_checked":"check",se=u?null:v?"radio_button_unchecked":null,te=u||v?null:"indeterminate_check_box",M=f=>{if(v)return y.checked=f==s.value,y.checked;const m=f==null?null:!!f;return y.checked=m===!0,y.indeterminate=i&&m==null,m},Z=()=>!v&&i&&y.indeterminate?null:!!y.checked,q=f=>f===!0?s.checkedIcon!=null?s.checkedIcon:s.icon!=null?s.icon:oe:f===!1?s.uncheckedIcon!=null?s.uncheckedIcon:se:s.indeterminateIcon!=null?s.indeterminateIcon:s.standbyIcon!=null?s.standbyIcon:s.iconStandby!=null?s.iconStandby:te,ue=()=>{const f=Z(),m=f===!0;for(;W.firstChild;)W.removeChild(W.firstChild);me.classList.toggle("is-checked",m),me.classList.toggle("is-indeterminate",f==null),me.classList.toggle("is-disabled",!!y.disabled),m&&(s.checkedIcon||s.icon)?me.classList.toggle("toggle-default",!1):m&&!s.checkedIcon||f==null&&!s.standbyIcon?me.classList.toggle("toggle-default",!0):f==null&&s.standbyIcon?me.classList.toggle("toggle-default",!1):y.disabled===!1&&!s.uncheckedIcon?me.classList.toggle("toggle-default",!0):me.classList.toggle("toggle-default",!1),u&&(f==null?W.style.transform="translateX(calc((var(--cms-toggle-width) - var(--cms-toggle-thumb-size) - 1px) / 2))":W.style.removeProperty("transform"));const g={checked:m,state:f,indeterminate:f==null,value:s.value,id:b,type:t};let F=null;if(f===!0?(F=JSswift.ui.renderSlot(r,"checkedIcon",g,null),F==null&&(F=JSswift.ui.renderSlot(r,"iconOn",g,null))):f===!1?(F=JSswift.ui.renderSlot(r,"uncheckedIcon",g,null),F==null&&(F=JSswift.ui.renderSlot(r,"iconOff",g,null))):(F=JSswift.ui.renderSlot(r,"indeterminateIcon",g,null),F==null&&(F=JSswift.ui.renderSlot(r,"standbyIcon",g,null)),F==null&&(F=JSswift.ui.renderSlot(r,"iconStandby",g,null))),F==null&&(F=JSswift.ui.renderSlot(r,"icon",g,null)),F==null){const X=q(f);typeof X=="string"?F=he.Icon({name:X,size:re,...u?{textColor:s.color,outline:!0}:{}}):X!=null&&(F=JSswift.ui.slot(X,{checked:m,state:f,indeterminate:f==null,as:f===!0?"checkedIcon":f===!1?"uncheckedIcon":"indeterminateIcon"}))}E(null,"default",{},F).forEach(X=>W.appendChild(X))};return R?(M(R.get()),R.watch(f=>{M(f),ue()},v?"UI.Radio:watch":"UI.Checkbox:watch"),y.addEventListener("change",f=>{var m,g;if(v)y.checked&&(R.set(s.value),(m=s.onChange)==null||m.call(s,s.value,f));else{const F=Z();R.set(F),(g=s.onChange)==null||g.call(s,F,f)}ue()})):(M(v?s.checked===!0?s.value:void 0:s.checked),y.addEventListener("change",f=>{var m,g;v?(m=s.onChange)==null||m.call(s,s.value,f):(g=s.onChange)==null||g.call(s,Z(),f),ue()})),s.onInput&&y.addEventListener("input",f=>{var m,g;v?(m=s.onInput)==null||m.call(s,s.value,f):(g=s.onInput)==null||g.call(s,Z(),f)}),ue(),an(me,s,{isEnabled:()=>!y.disabled,action:()=>{if(y.disabled)return!1;hn(y),y.click()}}),me};he.Checkbox=(...t)=>ps("checkbox",t),he.Radio=(...t)=>ps("radio",t),he.Toggle=(...t)=>{var s,o,r;const{props:e}=JSswift.uiNormalizeArgs(t),n=String((r=(o=(s=e.behavior)!=null?s:e.mode)!=null?o:e.type)!=null?r:"checkbox").toLowerCase()==="radio"?"radio":"checkbox";return ps(n,t,{appearance:"toggle",modelName:"UI.Toggle:model"})},he.Slider=(...t)=>{var H,ge,Se,ye,V;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=e.model||(At(e.value)||Jt(e.value)?e.value:null),r=Nt(o,"UI.Slider:model"),v=JSswift.omit(e,["model","value","class","style","onChange","onInput","slots","label","icon","iconRight","thumbIcon","iconThumb","pointIcon","markers","markerLabels","labelMarks","leftLabel","rightLabel","startLabel","endLabel","minLabel","maxLabel","withQItem","qitem","item","itemClass","itemStyle","showValue","thumbLabel","labelValue","selectionColor","trackColor","thumbColor","inputClass","readonly","size"]);v.type="range",v.class=ae(["cms-slider-input",e.inputClass]);const u=_.input(v),i={...e.style||{}},b=l(e.size);if(b!=null){const O=typeof b=="string"&&((H=JSswift.uiSizes)!=null&&H.includes(b))?`var(--cms-size-${b})`:Be(b);i["--cms-slider-size"]=O,i["--cms-slider-track-size"]=`max(4px, calc(${O} / 4))`,i["--cms-slider-box-height"]=`calc(${O} * 1.5)`,i["--cms-slider-marker-size"]=`max(6px, calc(${O} / 3))`}const R=_.label({class:ae(["cms-clear-set","cms-singularity-check","cms-slider-wrap",fe(e.dense,"dense"),e.class]),style:i});Ke(R,e);const S=_.div({class:"cms-slider-header"}),y=_.span({class:"cms-slider-label"}),P=_.span({class:"cms-slider-value"});S.append(y,P);const Q=_.div({class:"cms-slider-body"}),G=_.span({class:"cms-slider-icon cms-slider-icon-left"}),ie=_.span({class:"cms-slider-edge-label cms-slider-edge-label-left"}),D=_.div({class:"cms-slider-main"}),$=_.div({class:"cms-slider-box",style:{minHeight:"var(--cms-slider-box-height, 36px)"}}),Y=_.span({class:"cms-slider-rail",style:{height:"var(--cms-slider-track-size, 6px)"}}),W=_.span({class:"cms-slider-selection",style:{height:"var(--cms-slider-track-size, 6px)"}}),le=_.span({class:"cms-slider-thumb",style:{width:"var(--cms-slider-size, 24px)",height:"var(--cms-slider-size, 24px)"}}),me=_.span({class:"cms-slider-thumb-icon"}),re=_.span({class:"cms-slider-thumb-label"});le.append(re,me);const oe=_.div({class:"cms-slider-markers"}),se=_.span({class:"cms-slider-edge-label cms-slider-edge-label-right"}),te=_.span({class:"cms-slider-icon cms-slider-icon-right"});$.append(Y,W,le,u),D.append($,oe),Q.append(G,ie,D,se,te),R.append(S,Q);const M=O=>{for(;O.firstChild;)O.removeChild(O.firstChild)},Z=(O,K,ke="")=>{M(O),(K||[]).forEach(Ne=>O.appendChild(Ne)),O.style.display=O.childNodes.length?ke:"none"},q=O=>At(O)||Jt(O)?l(O):O,ue=(O,K={})=>An(q(O),K),L=(O,K,ke={})=>{var ee,xe;const Ne=q(O);return Ne==null?[]:typeof Ne=="string"?[he.Icon({name:Ne,size:(xe=(ee=e.iconSize)!=null?ee:e.size)!=null?xe:16})]:ue(Ne,{...ke,as:K})},f=(O,K)=>{const ke=Number(O);return Number.isFinite(ke)?ke:K},m=()=>f(l(e.min),0),g=()=>{const O=m(),K=f(l(e.max),100);return K<O?O:K},F=()=>{const O=l(e.step);if(O==="any")return"any";const K=f(O,1);return K>0?K:1},X=O=>{if(O==="any")return 0;const K=String(O);if(K.includes("e-"))return Number(K.split("e-")[1]||0);const ke=K.indexOf(".");return ke===-1?0:K.length-ke-1},a=O=>{const K=m(),ke=g(),Ne=F();let ee=f(O,K);if(Ne!=="any"){ee=K+Math.round((ee-K)/Ne)*Ne;const xe=X(Ne);xe>0&&(ee=Number(ee.toFixed(xe)))}return Math.min(ke,Math.max(K,ee))},C=O=>{const K=m(),Ne=g()-K;if(!Ne)return 0;const ee=(a(O)-K)/Ne,xe=l(e.reverse)?1-ee:ee;return Math.max(0,Math.min(1,xe))},[h,J]=JSswift.reactive.signal(a(r?r.get():(Se=(ge=l(e.value))!=null?ge:l(e.min))!=null?Se:0)),j=(O,K={})=>{const ke=a(O);return h()!==ke&&J(ke),String(u.value)!==String(ke)&&(u.value=String(ke)),r&&K.fromModel!==!0&&r.set(ke),ke},U=()=>{var xe;const O=l(e.markers),K=!!l((xe=e.markerLabels)!=null?xe:e.labelMarks);if(!O)return[];const ke=m(),Ne=g(),ee=(be,Ce)=>{var Ie,_e,z,we,T,x,w,c;if(be==null)return null;if(typeof be=="object"&&!Array.isArray(be)){const A=a((z=(_e=(Ie=be.value)!=null?Ie:be.position)!=null?_e:be.at)!=null?z:ke);return{key:(we=be.key)!=null?we:`marker-${Ce}-${A}`,value:A,label:(T=be.label)!=null?T:K?String(A):null,icon:(x=be.icon)!=null?x:null,className:(c=(w=be.class)!=null?w:be.className)!=null?c:""}}const pe=a(be);return{key:`marker-${Ce}-${pe}`,value:pe,label:K?String(be):null,icon:null,className:""}};if(Array.isArray(O))return O.map((be,Ce)=>ee(be,Ce)).filter(Boolean);if(typeof O=="number"&&O>1){const be=Math.floor(O),Ce=be>1?(Ne-ke)/(be-1):0;return Array.from({length:be},(pe,Ie)=>ee(ke+Ce*Ie,Ie)).filter(Boolean)}if(O===!0){const be=F();if(be==="any")return[ee(ke,0),ee(Ne,1)].filter(Boolean);const Ce=Math.floor((Ne-ke)/be)+1;return Ce>24?[ee(ke,0),ee((ke+Ne)/2,1),ee(Ne,2)].filter(Boolean):Array.from({length:Ce},(pe,Ie)=>ee(ke+be*Ie,Ie)).filter(Boolean)}return typeof O=="object"?Object.keys(O).map((be,Ce)=>ee({value:Number(be),label:O[be]},Ce)).filter(Boolean):[]},ce=()=>{M(oe);const O=U();oe.style.display=O.length?"block":"none",oe.style.minHeight=O.some(K=>K.label!=null&&K.label!=="")?"30px":"10px",O.forEach(K=>{const ke=C(K.value),Ne=l(e.reverse)?h()<=K.value:h()>=K.value,ee=_.button({type:"button",class:ae(["cms-slider-marker",K.className,fe(()=>Ne,"active")]),style:{left:`${ke*100}%`,color:Ne?l(e.color)||"var(--cms-primary)":"var(--cms-muted)",cursor:l(e.disabled)||l(e.readonly)?"default":"pointer"},disabled:!!l(e.disabled)||!!l(e.readonly),onClick:()=>{var z,we;if(l(e.disabled)||l(e.readonly))return;const _e=j(K.value);(z=e.onInput)==null||z.call(e,_e),(we=e.onChange)==null||we.call(e,_e)}}),xe={marker:K,active:Ne,value:K.value,current:h(),input:u};let be=JSswift.ui.renderSlot(s,"marker",xe,null);be==null&&K.icon!=null&&(be=typeof K.icon=="string"?he.Icon({name:K.icon,size:12}):JSswift.ui.slot(K.icon,{...xe,as:"marker"}));const Ce=_.span({class:"cms-slider-marker-tick",style:{width:"var(--cms-slider-marker-size, 8px)",height:"var(--cms-slider-marker-size, 8px)",background:Ne?l(e.color)||"var(--cms-primary)":"var(--cms-border-color)"}}),pe=be==null?[Ce]:E(null,"default",xe,be),Ie=K.label==null?E(s,"markerLabel",xe,null):E(s,"markerLabel",xe,K.label);pe.forEach(_e=>ee.appendChild(_e)),Ie.length&&ee.appendChild(_.span({class:"cms-slider-marker-label"},...Ie)),oe.appendChild(ee)})},k=()=>{var xe;const O={value:h(),input:u,props:e};let K=E(s,"label",O,q(e.label));K.length||(K=E(s,"default",O,n)),Z(y,K,"inline-flex");const ke=l(e.showValue),Ne=ke===!1?null:(xe=q(e.labelValue))!=null?xe:h(),ee=ke||q(e.labelValue)!=null?E(s,"value",O,Ne):[];Z(P,ee,"inline-flex"),S.style.display=y.childNodes.length||P.childNodes.length?"flex":"none"},d=()=>{var Ce,pe,Ie,_e;const O={value:h(),input:u,props:e},K=E(s,"icon",O,null),ke=K.length?K:L(e.icon,"icon",O);Z(G,ke,"inline-flex");const Ne=E(s,"iconRight",O,null),ee=Ne.length?Ne:L(e.iconRight,"iconRight",O);Z(te,ee,"inline-flex");const xe=q((pe=(Ce=e.startLabel)!=null?Ce:e.leftLabel)!=null?pe:e.minLabel),be=q((_e=(Ie=e.endLabel)!=null?Ie:e.rightLabel)!=null?_e:e.maxLabel);Z(ie,E(s,"startLabel",O,xe),"inline-flex"),Z(se,E(s,"endLabel",O,be),"inline-flex")},N=()=>{var xe,be,Ce,pe;const O={value:h(),input:u,props:e},K=E(s,"thumbIcon",O,null),ke=(be=(xe=e.thumbIcon)!=null?xe:e.iconThumb)!=null?be:e.pointIcon;Z(me,K.length?K:L(ke,"thumbIcon",O),"inline-flex");const Ne=(pe=(Ce=q(e.thumbLabel))!=null?Ce:q(e.labelValue))!=null?pe:l(e.showValue)?String(h()):null,ee=E(s,"thumbLabel",O,Ne);Z(re,ee,"inline-flex")},I=()=>{const O=a(h()),K=m(),ke=g(),Ne=F(),xe=`${C(O)*100}%`,be=l(e.color)||l(e.selectionColor)||"var(--cms-primary)",Ce=l(e.trackColor)||"var(--cms-border-color)",pe=l(e.thumbColor)||be,Ie=!!l(e.readonly),_e=!!l(e.disabled);u.min=String(K),u.max=String(ke),u.step=Ne==="any"?"any":String(Ne),u.disabled=_e,u.value=String(O),Y.style.background=Ce,W.style.background=be,W.style.width=xe,le.style.left=xe,le.style.borderColor=pe,le.style.color=pe,re.style.background=be,R.classList.toggle("is-disabled",_e),R.classList.toggle("is-readonly",Ie),R.classList.toggle("has-markers",oe.childNodes.length>0)};if(r?(j(r.get(),{fromModel:!0}),r.watch(O=>{j(O,{fromModel:!0})},"UI.Slider:watch")):at(e.value)?JSswift.reactive.effect(()=>{j(l(e.value),{fromModel:!0})},"UI.Slider:value"):j((V=(ye=e.value)!=null?ye:e.min)!=null?V:0,{fromModel:!0}),u.addEventListener("input",O=>{var ke;if(l(e.disabled)||l(e.readonly)){u.value=String(h());return}const K=j(u.value);(ke=e.onInput)==null||ke.call(e,K,O)}),u.addEventListener("change",O=>{var ke;if(l(e.disabled)||l(e.readonly)){u.value=String(h());return}const K=j(u.value);(ke=e.onChange)==null||ke.call(e,K,O)}),JSswift.reactive.effect(()=>{k(),d(),N(),ce(),I()},"UI.Slider:render"),R._input=u,R._getValue=h,R._setValue=O=>j(O),e.withQItem||e.qitem||e.item===!0){const O=he.Item({class:ae(["cms-slider-item",e.itemClass]),style:e.itemStyle},R);return O._input=u,O._slider=R,O._getValue=h,O._setValue=R._setValue,O}return R},he.Rating=(...t)=>{var h;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=e.model||(At(e.value)||Jt(e.value)?e.value:null),r=Nt(o,"UI.Rating:model"),v=e.id||"cms-rating-"+Math.random().toString(36).slice(2),u=JSswift.omit(e,["model","value","max","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);u.type="hidden",u.id=v,e.name!=null&&(u.name=e.name),u.class=ae(["cms-rating-input","cms-choice-input",e.inputClass]);const i=_.input(u),b=JSswift.omit(e,["model","value","max","id","name","type","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);b.class=ae(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",fe(e.dense,"dense"),e.class]),b.style={...e.style||{}};const R=l(e.size);R!=null&&!(typeof R=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(R)))&&(b.style["--cms-rating-size"]=Be(R));const S=l(e.gap);S!=null&&(b.style["--cms-rating-gap"]=Be(S));const y=_.span({class:"cms-rating-control",onMouseleave:J=>{var j;q!=null&&(q=null,a(),(j=e.onHover)==null||j.call(e,te(),J))},onKeydown:J=>{if(!se())return;const j=le()?.5:1,U=te();let ce=U;switch(J.key){case"ArrowRight":case"ArrowUp":ce=U+j;break;case"ArrowLeft":case"ArrowDown":ce=U-j;break;case"Home":ce=l(e.clearable)?0:j;break;case"End":ce=W();break;case"Delete":case"Backspace":case"0":if(!l(e.clearable))return;ce=0;break;case" ":case"Enter":ce=U||(l(e.clearable)?j:Math.max(j,1));break;default:return}J.preventDefault(),C(ce,J,{emit:!0})}}),P=_.span({class:"cms-choice-label cms-rating-label"}),Q=_.label(b,i,y,P);Ke(Q,e);const G=J=>{for(;J.firstChild;)J.removeChild(J.firstChild)},ie=(J,j,U="")=>{G(J),(j||[]).forEach(ce=>J.appendChild(ce)),J.style.display=J.childNodes.length?U:"none"},D=J=>At(J)||Jt(J)?l(J):J,$=(J,j={})=>An(D(J),j),Y=(J,j,U={})=>{var k,d;const ce=D(J);return ce==null?[]:typeof ce=="string"?[he.Icon({name:ce,color:e.color,size:(d=(k=e.iconSize)!=null?k:e.size)!=null?d:16})]:$(ce,{...U,as:j})},W=()=>{var j;const J=Number((j=l(e.max))!=null?j:5);return Number.isFinite(J)&&J>0?Math.max(1,Math.round(J)):5},le=()=>{var J;return!!l((J=e.half)!=null?J:e.allowHalf)},me=(J,j=W())=>{let U=Number(l(J));Number.isFinite(U)||(U=0),U=Math.min(j,Math.max(0,U));const ce=le()?.5:1;return Math.round(U/ce)*ce},re=()=>!!l(e.disabled),oe=()=>!!l(e.readonly),se=()=>!re()&&!oe(),te=()=>me(r?r.get():Z),M=J=>{const j=J>0?String(J):"";i.value=j,i.setAttribute("value",j),i.disabled=re()};let Z=me(r?r.get():l(e.value)),q=null,ue=0,L=[];const f=(J,j)=>{if(!le())return me(J);const U=j.currentTarget.getBoundingClientRect(),ce=j.clientX-U.left<=U.width/2;return me(ce?J-.5:J)},m=(J,j)=>J>=j?"full":le()&&J>=j-.5?"half":"empty",g=(J,j)=>{var N,I,H,ge,Se,ye,V,O,K,ke,Ne,ee,xe,be,Ce;const U=l((H=(I=(N=e.colorSelected)!=null?N:e.activeColor)!=null?I:e.color)!=null?H:e.textColor)||"var(--cms-warning, #f0b429)",ce=l((O=(V=(ye=(Se=(ge=e.colorHalf)!=null?ge:e.halfColor)!=null?Se:e.colorSelected)!=null?ye:e.activeColor)!=null?V:e.color)!=null?O:e.textColor)||U,k=l((xe=(ee=(Ne=(ke=(K=e.colorHovered)!=null?K:e.hoverColor)!=null?ke:e.colorSelected)!=null?Ne:e.activeColor)!=null?ee:e.color)!=null?xe:e.textColor)||U,d=l((Ce=(be=e.colorInactive)!=null?be:e.colorOff)!=null?Ce:e.color)||"var(--cms-muted)";return j?k:J==="full"?U:J==="half"?ce:d},F=J=>{var k,d,N,I,H,ge,Se,ye,V,O,K,ke,Ne,ee,xe;const j=[];J.hovered&&J.state!=="empty"&&j.push("hoveredIcon","iconHovered"),J.state==="full"?j.push("checkedIcon","selectedIcon","iconSelected","iconOn"):J.state==="half"?j.push("halfIcon","iconHalf"):j.push("uncheckedIcon","iconOff"),j.push("icon","item","star");for(const be of j){const Ce=E(s,be,J,null);if(Ce.length)return Ce}let U=null,ce="icon";return J.hovered&&J.state!=="empty"&&(U=(k=e.hoveredIcon)!=null?k:e.iconHovered,ce="hoveredIcon"),U==null&&J.state==="full"?(U=(H=(I=(N=(d=e.checkedIcon)!=null?d:e.iconSelected)!=null?N:e.iconOn)!=null?I:e.icon)!=null?H:"star",ce="checkedIcon"):U==null&&J.state==="half"?(U=(O=(V=(ye=(Se=(ge=e.halfIcon)!=null?ge:e.iconHalf)!=null?Se:e.checkedIcon)!=null?ye:e.iconSelected)!=null?V:e.icon)!=null?O:"star_half",ce="halfIcon"):U==null&&(U=(xe=(K=e.uncheckedIcon)!=null?K:e.iconOff)!=null?xe:l(e.noDimming)?(ee=(Ne=(ke=e.icon)!=null?ke:e.checkedIcon)!=null?Ne:e.iconSelected)!=null?ee:"star":"star_border",ce="uncheckedIcon"),Y(U,ce,J)},X=()=>{const J=W();if(ue!==J){ue=J,L=[],G(y);for(let j=1;j<=J;j++){const U=_.span({class:"cms-rating-item-icon"}),ce=_.span({class:"cms-rating-item",role:"radio",tabIndex:-1,onMousemove:k=>{var N;if(!se())return;const d=f(j,k);q!==d&&(q=d,a(),(N=e.onHover)==null||N.call(e,d,k))},onClick:k=>{if(!se())return;let d=f(j,k);l(e.clearable)&&d===te()&&(d=0),C(d,k,{emit:!0})}},U);L.push({item:ce,iconHost:U,index:j}),y.appendChild(ce)}}},a=()=>{var ge,Se;X();const J=W(),j=te(),U=q==null?j:me(q,J),ce=re(),k=oe(),d=!!l(e.clearable),N=!!l(e.noDimming);Q.classList.toggle("is-disabled",ce),Q.classList.toggle("is-readonly",k),Q.classList.toggle("is-hovering",q!=null),Q.classList.toggle("is-clearable",d),Q.classList.toggle("is-half",le()),Q.classList.toggle("no-dimming",N);const I=Number((Se=l((ge=e.tabindex)!=null?ge:e.tabIndex))!=null?Se:0);y.tabIndex=ce?-1:I,y.setAttribute("role","slider"),y.setAttribute("aria-valuemin","0"),y.setAttribute("aria-valuemax",String(J)),y.setAttribute("aria-valuenow",String(j)),y.setAttribute("aria-disabled",ce?"true":"false"),y.setAttribute("aria-readonly",k?"true":"false"),M(j);const H=E(s,"label",{value:j,max:J,disabled:ce,readonly:k,clearable:d},e.label!=null?D(e.label):n);ie(P,H,"inline-flex"),L.forEach(({item:ye,iconHost:V,index:O})=>{const K=m(U,O),ke=q!=null&&K!=="empty",Ne={index:O,max:J,value:j,displayValue:U,state:K,active:K!=="empty",checked:K==="full",half:K==="half",hovered:ke,disabled:ce,readonly:k,clearable:d,setValue:ee=>C(ee,null,{emit:!1})};ye.className=Dt(["cms-rating-item",`is-${K}`,fe(ke,"is-hovered")]),ye.style.color=g(K,ke),ye.style.opacity=K==="empty"&&!N?"0.48":"1",ye.setAttribute("aria-checked",String(j===O)),ie(V,F(Ne),"inline-flex")})},C=(J,j,U={})=>{var d,N;const ce=me(J),k=te();return Z=ce,q=null,r&&U.fromModel!==!0&&r.set(ce),M(ce),a(),U.emit!==!1&&ce!==k&&((d=e.onInput)==null||d.call(e,ce,j),(N=e.onChange)==null||N.call(e,ce,j)),ce};return Q._input=i,Q._rating=y,Q._getValue=te,Q._setValue=J=>C(J,null,{emit:!1}),r&&r.watch(J=>{const j=me(J);serializeValue(j)!==serializeValue(Z)&&(Z=j,q=null,M(Z),a())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!r&&e.value!=null&&(Z=me(l(e.value))),a()},"UI.Rating:render"),Q};const it=t=>t?{hour:Number(t.hour)||0,minute:Number(t.minute)||0,second:Number(t.second)||0}:null,Ut=t=>String(Math.max(0,Number(t)||0)).padStart(2,"0"),$t=(t,e={})=>{var u,i,b,R,S,y,P,Q,G,ie,D,$,Y,W,le;if(t==null||t==="")return null;let n=null,s=null,o=0,r=null;if(t instanceof Date&&!Number.isNaN(t.getTime()))n=t.getHours(),s=t.getMinutes(),o=t.getSeconds();else if(typeof t=="number"&&Number.isFinite(t)){const me=Math.max(0,Math.floor(t));n=Math.floor(me/3600)%24,s=Math.floor(me/60)%60,o=me%60}else if(typeof t=="object"){if(t.time!=null||t.value!=null)return $t((u=t.time)!=null?u:t.value,e);n=Number((R=(b=(i=t.hour)!=null?i:t.hours)!=null?b:t.h)!=null?R:t.hh),s=Number((Q=(P=(y=(S=t.minute)!=null?S:t.minutes)!=null?y:t.min)!=null?P:t.mm)!=null?Q:0),o=Number(($=(D=(ie=(G=t.second)!=null?G:t.seconds)!=null?ie:t.sec)!=null?D:t.ss)!=null?$:0),r=(le=(W=(Y=t.meridiem)!=null?Y:t.ampm)!=null?W:t.period)!=null?le:null}else if(typeof t=="string"){const me=t.trim();if(!me)return null;const re=me.match(/^(\d{1,2})(\d{2})(\d{2})?$/),oe=me.match(/(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?\s*([ap]m)?/i);if(oe)n=Number(oe[1]),s=Number(oe[2]),o=oe[3]!=null?Number(oe[3]):0,r=oe[4]||null;else if(re)n=Number(re[1]),s=Number(re[2]),o=re[3]!=null?Number(re[3]):0;else return null}else return null;if(!Number.isFinite(n)||!Number.isFinite(s)||!Number.isFinite(o))return null;if(r){const me=String(r).toLowerCase();me==="pm"&&n<12&&(n+=12),me==="am"&&n===12&&(n=0)}if(n<0||n>23||s<0||s>59||o<0||o>59)return null;const v={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(o)};return al(v,e)},Xt=(t,e={})=>{const n=t&&typeof t=="object"&&t.hour!=null?it(t):$t(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;return`${Ut(n.hour)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""}`},Hn=(t,e)=>{const n=Xt(t,{withSeconds:!0}),s=Xt(e,{withSeconds:!0});return!n&&!s?0:n?s?n<s?-1:n>s?1:0:1:-1};function al(t,e={}){if(!t)return null;const n=it(t),s=e.min!=null?$t(e.min,{withSeconds:!0}):null,o=e.max!=null?$t(e.max,{withSeconds:!0}):null;return s&&Hn(n,s)<0?it(s):o&&Hn(n,o)>0?it(o):n}const Tt=(t,e={})=>t==null||t===""?null:t instanceof Date?$t(t,e):typeof t=="object"?$t(t.time!=null?t.time:t,e):typeof t=="string"||typeof t=="number"?$t(t,e):null,jn=(t,e={})=>{var u;const n=$t(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;if(!!!l((u=e.use12h)!=null?u:e.ampm))return`${Ut(n.hour)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""}`;const r=n.hour>=12?"PM":"AM",v=n.hour%12||12;return`${Ut(v)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""} ${r}`},Oo=(t,e,n={})=>{if(!t)return"";const s=Xt(e,n);return s?`${t}T${s}`:t},bs=(t,e)=>{const n=Math.max(1,Math.min(e+1,Math.round(Number(t)||1))),s=[];for(let o=0;o<=e;o+=n)s.push(o);return s},rl=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:o=!1,minuteStep:r=5,secondStep:v=5,disabled:u=!1,readonly:i=!1,embedded:b=!1,className:R="",slotPrefix:S="",shortcuts:y=null,onSelect:P=null}=t,Q=$t(s,{withSeconds:o,min:e.min,max:e.max}),G=Q||$t(new Date,{withSeconds:o,min:e.min,max:e.max})||{hour:0,minute:0,second:0},ie=Q?it(Q):null,D=se=>S?`${S}${se[0].toUpperCase()}${se.slice(1)}`:null,$=(se,te,M)=>{const Z=[D(se),se].filter(Boolean);for(const q of Z){if(JSswift.ui.getSlot(n,q)==null)continue;const L=JSswift.ui.renderSlot(n,q,te,M);if(L!=null)return L}return JSswift.ui.slot(M,te)},Y=se=>{let te=$("point",se,null);return te==null&&t.pointIcon!=null&&se.selected&&(te=typeof t.pointIcon=="string"?he.Icon({name:t.pointIcon,size:b?10:12}):JSswift.ui.slot(t.pointIcon,se)),E(null,"default",se,te)},W=(se,te)=>{const M={hour:G.hour,minute:G.minute,second:o?G.second:0};return M[se]=te,M},le=_.div({class:ae(["cms-time-section",fe(b,"is-embedded"),fe(o,"has-seconds"),R])}),me=l(y)||[];if(Array.isArray(me)&&me.length){const se=_.div({class:"cms-time-shortcuts"});me.forEach((te,M)=>{var f,m,g;if(!te)return;const Z=typeof te.value=="function"?te.value({now:Xt(new Date,{withSeconds:o})}):te.value,q=$t(Z,{withSeconds:o,min:e.min,max:e.max});if(!q)return;const ue={item:te,index:M,value:Xt(q,{withSeconds:o}),displayValue:jn(q,{withSeconds:o,use12h:(f=e.use12h)!=null?f:e.ampm})},L=$("shortcut",ue,(g=(m=te.label)!=null?m:te.text)!=null?g:ue.displayValue);se.appendChild(_.button({type:"button",class:ae(["cms-time-shortcut",fe(!!ie&&Hn(q,ie)===0,"is-selected")]),disabled:u||i,onClick:()=>P==null?void 0:P(q,{shortcut:te,index:M})},...E(null,"default",ue,L)))}),se.childNodes.length&&le.appendChild(se)}const re=_.div({class:"cms-time-columns"}),oe=(se,te,M)=>{const Z=_.div({class:"cms-time-column","data-time-part":te}),q=_.div({class:"cms-time-options"});return M.forEach(ue=>{var C;const L=W(te,ue),f=al(L,{withSeconds:o,min:e.min,max:e.max}),m=u||i||Hn(f,L)!==0,g=!!ie&&ie[te]===ue,F={part:te,selected:g,disabled:m,value:ue,label:Ut(ue),timeValue:Xt(f,{withSeconds:o}),displayValue:jn(f,{withSeconds:o,use12h:(C=e.use12h)!=null?C:e.ampm})},X=$("option",F,F.label),a=g?Y(F):[];q.appendChild(_.button({type:"button",class:ae(["cms-time-option",fe(g,"is-selected"),fe(m,"is-disabled")]),disabled:m,onClick:()=>P==null?void 0:P(f,{part:te,optionValue:ue})},_.span({class:"cms-time-option-label"},...E(null,"default",F,X)),a.length?_.span({class:"cms-time-option-point"},...a):null))}),Z.appendChild(q),Z};return re.appendChild(oe(l(e.hoursLabel)||"Ore","hour",bs(1,23))),re.appendChild(oe(l(e.minutesLabel)||"Min","minute",bs(r,59))),o&&re.appendChild(oe(l(e.secondsLabel)||"Sec","second",bs(v,59))),le.appendChild(re),le},Wn=t=>{if(!t)return null;const e={};return t.querySelectorAll(".cms-time-column").forEach((n,s)=>{const o=n.getAttribute("data-time-part")||String(s);e[o]=n.scrollTop}),e},cl=(t,e={})=>{var o;if(!t)return;const n=e.scrollState||null,s=(o=e.behavior)!=null?o:"smooth";t.querySelectorAll(".cms-time-column").forEach((r,v)=>{const u=r.getAttribute("data-time-part")||String(v),i=n&&Number.isFinite(n[u])?n[u]:null;i!=null&&(r.scrollTop=i);const b=r.querySelector(".cms-time-option.is-selected");if(!b)return;const R=Math.max(0,r.scrollHeight-r.clientHeight),S=b.offsetTop-(r.clientHeight-b.offsetHeight)/2,y=Math.max(0,Math.min(R,S));if(Math.abs(r.scrollTop-y)<1){r.scrollTop=y;return}if(s&&typeof r.scrollTo=="function"){r.scrollTo({top:y,behavior:s});return}r.scrollTop=y})},ul=(t,e={})=>{var cn,un,tn,nn,Pe,Ve,et,ct,gt,ht,Ct,yt;const{props:n,children:s}=JSswift.uiNormalizeArgs(t),o=e.calendar===!0,r=n.slots||{},v=qe(n.size,()=>{const p=String(l(n.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(p)?`cms-size-${p}`:""}),u=String(l((nn=(tn=n.mode)!=null?tn:l((un=(cn=n.rangeMultiple)!=null?cn:n.multipleRange)!=null?un:n.multiRange)?"range-multiple":null)!=null?nn:n.range&&n.multiple?"range-multiple":n.range?"range":n.multiple?"multiple":"single")).toLowerCase(),i=["range-multiple","multiple-range","rangemultiple","multiplerange","range_multiple","multiple_range","multi-range","multi_range","ranges"].includes(u)?"range-multiple":u==="range"?"range":u==="multiple"?"multiple":"single",b=n.model||(At(n.value)||Jt(n.value)?n.value:null),R=Nt(b,o?"UI.Calendar:model":"UI.Datepicker:model"),S=R?R.get():l(n.value),y=l((Pe=n.rangeAs)!=null?Pe:n.rangeModel)==="array"||Array.isArray(S),P=l((Ve=n.rangeMultipleAs)!=null?Ve:n.multipleRangeAs)==="array"||Array.isArray(S)&&Array.isArray(S[0]),Q=()=>{var p,ne,ve;return i==="single"&&!!l((ve=(ne=(p=n.withTime)!=null?p:n.time)!=null?ne:n.timePicker)!=null?ve:n.enableTime)},G=()=>{var ne,ve,Re,Fe,Oe,$e,Xe,ot;const p=Xt(Tt((ve=(ne=l(n.timeValue))!=null?ne:R?R.get():l(n.value))!=null?ve:S,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!l((Fe=(Re=n.timeWithSeconds)!=null?Re:n.withSeconds)!=null?Fe:n.showSeconds)||/:\d{2}:\d{2}$/.test(p)||/:\d{2}:\d{2}$/.test(l(n.timeFormat)||""),min:l((Oe=n.timeMin)!=null?Oe:n.minTime),max:l(($e=n.timeMax)!=null?$e:n.maxTime),use12h:l((ot=(Xe=n.time12h)!=null?Xe:n.use12h)!=null?ot:n.ampm)}},ie=()=>{var ne,ve;const p=Number(l((ve=(ne=n.timeMinuteStep)!=null?ne:n.minuteStep)!=null?ve:5));return Math.max(1,Math.min(30,Number.isFinite(p)?p:5))},D=()=>{var ne,ve;const p=Number(l((ve=(ne=n.timeSecondStep)!=null?ne:n.secondStep)!=null?ve:5));return Math.max(1,Math.min(30,Number.isFinite(p)?p:5))},$=p=>String(p).padStart(2,"0"),Y=(p,ne,ve)=>{const Re=new Date(p,ne,ve);return Re.getFullYear()!==p||Re.getMonth()!==ne||Re.getDate()!==ve?null:Re},W=p=>!(p instanceof Date)||Number.isNaN(p.getTime())?null:`${p.getFullYear()}-${$(p.getMonth()+1)}-${$(p.getDate())}`,le=p=>{if(typeof p!="string")return null;const ne=p.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!ne)return null;const ve=Number(ne[1]),Re=Number(ne[2])-1,Fe=Number(ne[3]),Oe=new Date(ve,Re,Fe);return Oe.getFullYear()!==ve||Oe.getMonth()!==Re||Oe.getDate()!==Fe?null:Oe},me=(p,ne)=>{const ve=le(p);return ve?(ve.setDate(ve.getDate()+ne),W(ve)):null},re=(p,ne)=>new Date(p.getFullYear(),p.getMonth()+ne,1),oe=p=>{if(p instanceof Date&&!Number.isNaN(p.getTime()))return new Date(p.getFullYear(),p.getMonth(),1);const ne=a(p),ve=le(ne);return ve?new Date(ve.getFullYear(),ve.getMonth(),1):new Date},se=()=>W(new Date),te=(p,ne)=>!!p&&!!ne&&p===ne,M=(p,ne)=>p==null&&ne==null?0:p==null?-1:ne==null?1:p<ne?-1:p>ne?1:0,Z=(p,ne)=>{const ve=le(p),Re=le(ne);return!ve||!Re?0:Math.round((Re.getTime()-ve.getTime())/864e5)},q=p=>Array.isArray(p)?p.slice():p==null||p===""?[]:[p],ue=p=>({from:(p==null?void 0:p.from)||null,to:(p==null?void 0:p.to)||null}),L=p=>Array.isArray(p)?p.map(ue):[],f=p=>{const ne=ue(p);return y?[ne.from,ne.to]:ne},m=p=>L(p).map(ne=>P?[ne.from,ne.to]:ne),g=p=>i==="multiple"?Array.isArray(p)?p.slice():[]:i==="range"?ue(p):i==="range-multiple"?L(p):p||null,F=p=>i==="multiple"?Array.isArray(p)?p.slice():[]:i==="range"?f(p):i==="range-multiple"?m(p):p||"",X=p=>JSON.stringify(F(p)),a=p=>{if(p==null||p==="")return null;if(p instanceof Date)return W(p);if(typeof p=="number")return W(new Date(p));if(typeof p!="string")return typeof p=="object"&&p.date!=null?a(p.date):null;const ne=p.trim();if(!ne)return null;const ve=ne.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:$|[T\s])/);if(ve){const $e=Y(Number(ve[1]),Number(ve[2])-1,Number(ve[3]));return W($e)}const Re=ne.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(Re){const $e=Re[3].length===2?2e3+Number(Re[3]):Number(Re[3]),Xe=Y($e,Number(Re[2])-1,Number(Re[1]));return W(Xe)}if(/^\d{1,4}$/.test(ne))return null;const Fe=new Date(ne);if(Number.isNaN(Fe.getTime()))return null;const Oe=ne.match(/(?:^|[^\d])(\d{4})(?!\d)/);return Oe&&Fe.getFullYear()!==Number(Oe[1])?null:W(Fe)},C=p=>{var Re,Fe,Oe,$e,Xe,ot;if(p==null||p==="")return{from:null,to:null};let ne=null,ve=null;if(Array.isArray(p))ne=a(p[0]),ve=a(p[1]);else if(typeof p=="object")ne=a((Oe=(Fe=(Re=p.from)!=null?Re:p.start)!=null?Fe:p.dateFrom)!=null?Oe:p.departure),ve=a((ot=(Xe=($e=p.to)!=null?$e:p.end)!=null?Xe:p.dateTo)!=null?ot:p.return);else{const pt=String(p).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];ne=a(pt[0]),ve=a(pt[1])}return ne&&ve&&ne>ve&&([ne,ve]=[ve,ne]),{from:ne,to:ve}},h=p=>{const ne=[],ve=new Set,Re=Fe=>{const Oe=C(Fe);if(!Oe.from)return;const $e=`${Oe.from||""}|${Oe.to||""}`;ve.has($e)||(ve.add($e),ne.push(Oe))};if(p==null||p==="")return ne;if(Array.isArray(p))if(p.every(Oe=>Oe==null||typeof Oe=="string"||typeof Oe=="number"||Oe instanceof Date)){const Oe=p.map(a).filter(Boolean);for(let $e=0;$e<Oe.length;$e+=2)Re({from:Oe[$e],to:Oe[$e+1]||null})}else p.forEach(Oe=>Re(Oe));else if(typeof p=="object"&&Array.isArray(p.ranges))p.ranges.forEach(Fe=>Re(Fe));else if(typeof p=="object")Re(p);else{const Oe=(String(p).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(a).filter(Boolean);for(let $e=0;$e<Oe.length;$e+=2)Re({from:Oe[$e],to:Oe[$e+1]||null})}return ne.sort((Fe,Oe)=>M(Fe.from,Oe.from)||M(Fe.to,Oe.to))},J=p=>{const ne=[];return q(p).forEach(ve=>{const Re=a(ve);Re&&!ne.includes(Re)&&ne.push(Re)}),ne.sort()},j=p=>i==="range"?C(p):i==="range-multiple"?h(p):i==="multiple"?J(p):a(p),U=()=>{var p;return a(l((p=n.min)!=null?p:n.minDate))},ce=()=>{var p;return a(l((p=n.max)!=null?p:n.maxDate))},k=()=>l(n.locale)||void 0,d=()=>{var ne,ve;const p=Number(l((ve=(ne=n.firstDayOfWeek)!=null?ne:n.weekStart)!=null?ve:1));return Number.isFinite(p)?(p%7+7)%7:1},N=()=>{var ve;const p=i==="range"||i==="range-multiple"?2:1,ne=Number((ve=l(n.monthsToShow))!=null?ve:p);return Math.max(1,Math.min(4,Number.isFinite(ne)?ne:p))},I=()=>{const p=U(),ne=ce();let ve=a(l(n.defaultMonth))||se();return p&&ve<p&&(ve=p),ne&&ve>ne&&(ve=ne),ve||p||ne||se()},H=()=>l(n.confirm)?_e:Ie,ge=p=>{const ne=le(p);return ne?{date:p,value:p,year:ne.getFullYear(),month:ne.getMonth()+1,day:ne.getDate(),weekday:ne.getDay(),today:te(p,se())}:{date:p,value:p}},Se=(p,ne)=>p==null?!1:Array.isArray(p)?p.some(ve=>a(ve)===ne):p instanceof Set?p.has(ne):typeof p=="function"?!!p(ne,ge(ne)):typeof p=="string"||p instanceof Date||typeof p=="number"?a(p)===ne:!1,ye=p=>{var ot,pt,xt,Bt,zt,Lt,sn,dn,fn,vn,zn,Pn,Jn;if(!p)return!1;const ne=U(),ve=ce();if(ne&&p<ne||ve&&p>ve)return!1;const Re=l((pt=(ot=n.options)!=null?ot:n.enableDates)!=null?pt:n.allowedDates);if(Re!=null&&!Se(Re,p))return!1;const Fe=l((Bt=(xt=n.disableDates)!=null?xt:n.disabledDates)!=null?Bt:n.notAllowedDates);if(Fe!=null&&Se(Fe,p))return!1;const Oe=(zt=le(p))==null?void 0:zt.getDay();if(Array.isArray(l((Lt=n.allowedWeekdays)!=null?Lt:n.weekdays))&&Oe!=null&&!l((sn=n.allowedWeekdays)!=null?sn:n.weekdays).map(Cn=>Number(Cn)).includes(Oe)||l(n.weekdaysOnly)&&(Oe===0||Oe===6)||l(n.weekendsOnly)&&Oe!=null&&Oe!==0&&Oe!==6)return!1;const $e=H(),Xe=i==="range"?$e!=null&&$e.from&&!($e!=null&&$e.to)?$e:null:i==="range-multiple"&&Array.isArray($e)&&$e.length&&(dn=$e[$e.length-1])!=null&&dn.from&&!((fn=$e[$e.length-1])!=null&&fn.to)?$e[$e.length-1]:null;if(Xe!=null&&Xe.from){const Sn=Math.abs(Z(Xe.from,p)),Cn=Number(l((zn=(vn=n.minRange)!=null?vn:n.minDays)!=null?zn:n.minNights)),En=Number(l((Jn=(Pn=n.maxRange)!=null?Pn:n.maxDays)!=null?Jn:n.maxNights));if(Number.isFinite(Cn)&&Sn<Cn||Number.isFinite(En)&&Sn>En)return!1}return!0},V=p=>{var Re,Fe;if(!p)return"";const ne=le(p);return!ne||String(l((Fe=(Re=n.displayMask)!=null?Re:n.mask)!=null?Fe:"")||"").toLowerCase()==="iso"||l(n.isoDisplay)===!0?p:new Intl.DateTimeFormat(k(),{year:"numeric",month:"short",day:"2-digit"}).format(ne)},O=(p,ne=z)=>{if(i==="range-multiple")return!Array.isArray(p)||!p.length?"":p.length>2&&l(n.compactMultiple)!==!1?`${p.length} ${l(n.multipleRangeLabel)||"intervalli selezionati"}`:p.map(Fe=>{const Oe=Fe!=null&&Fe.from?V(Fe.from):"",$e=Fe!=null&&Fe.to?V(Fe.to):"";return Oe&&$e?`${Oe} -> ${$e}`:Oe||$e||""}).filter(Boolean).join("; ");if(i==="multiple")return!Array.isArray(p)||!p.length?"":p.length>3&&l(n.compactMultiple)!==!1?`${p.length} ${l(n.multipleLabel)||"date selezionate"}`:p.map(V).join(", ");if(i==="range"){const Fe=p!=null&&p.from?V(p.from):"",Oe=p!=null&&p.to?V(p.to):"";return Fe&&Oe?`${Fe} -> ${Oe}`:Fe||Oe||""}const ve=V(p);if(!Q())return ve;const Re=pe(ne);return[ve,Re].filter(Boolean).join(" \u2022 ")},K=p=>(String(p||"").match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(a).filter(Boolean),ke=p=>{if(p==null||p==="")return i==="multiple"||i==="range-multiple"?[]:i==="range"?{from:null,to:null}:null;const ne=K(p);if(i==="range-multiple"){const ve=[];for(let Re=0;Re<ne.length;Re+=2)ne[Re]&&ve.push({from:ne[Re],to:ne[Re+1]||null});return ve}return i==="multiple"?ne:i==="range"?{from:ne[0]||null,to:ne[1]||null}:ne[0]||a(p)},Ne=()=>i==="multiple"||i==="range-multiple"?[]:i==="range"?{from:null,to:null}:null,ee=(p,ne=null)=>{var $e;if(!Q())return null;const ve=G(),Re=l(n.timeValue),Fe=p!=null?p:Re,Oe=Tt(Fe,ve);return it(($e=Oe!=null?Oe:ne)!=null?$e:null)},xe=()=>l(n.confirm)?we:z,be=(p=Ie,ne=z)=>i==="single"&&Q()?Oo(p||null,ne,G()):F(p),Ce=(p=Ie,ne=z)=>JSON.stringify(be(p,ne)),pe=p=>jn(p,G());let Ie=j(S),_e=g(Ie),z=ee(S,Tt(l(n.timeValue),G())),we=it(z),T=null,x=null,w=oe(i==="range"?(Ie==null?void 0:Ie.from)||(Ie==null?void 0:Ie.to)||I():i==="range-multiple"?((et=Ie==null?void 0:Ie[Ie.length-1])==null?void 0:et.from)||((ct=Ie==null?void 0:Ie[Ie.length-1])==null?void 0:ct.to)||I():i==="multiple"?Ie[0]||I():Ie||I()),c=null,A=null;const de=p=>{const ne=p instanceof Date?p:le(a(p));if(!ne)return-1;const ve=ne.getFullYear(),Re=ne.getMonth();for(let Fe=0;Fe<N();Fe+=1){const Oe=re(w,Fe);if(Oe.getFullYear()===ve&&Oe.getMonth()===Re)return Fe}return-1},Le={...n,label:(gt=n.label)!=null?gt:n.placeholder},Je=Le.label!=null||JSswift.ui.getSlot(r,"label")!=null,B=i==="range"?"Seleziona andata e ritorno":i==="range-multiple"?"Seleziona intervalli":i==="multiple"?"Seleziona date":"Seleziona data",Ae=o?null:_.input({class:ae(["cms-input","cms-date-display",v,fe(n.manualInput,"is-manual"),n.inputClass]),type:"text",autocomplete:"off",placeholder:Je?"":(ht=n.placeholder)!=null?ht:B,readOnly:!l(n.manualInput),disabled:!!l(n.disabled),value:O(Ie,z)}),Me=_.div({style:{display:"contents"}}),Ee=o?null:_.div({class:"cms-date-control",style:{display:"contents"}},Ae,Me),De=o?null:he.FormField({...Le,iconRight:(Ct=n.iconRight)!=null?Ct:"calendar_month",control:Ee,getValue:()=>Ae.value,onClear:()=>{l(n.disabled)||l(n.readonly)||(Qe(Ne(),null),c&&St())},onFocus:()=>Ae.focus()}),Ue=(p,ne={})=>{var Fe,Oe;const ve=ne.focusIso||(i==="range"?(p==null?void 0:p.from)||(p==null?void 0:p.to)||I():i==="range-multiple"?((Fe=p==null?void 0:p[p.length-1])==null?void 0:Fe.from)||((Oe=p==null?void 0:p[p.length-1])==null?void 0:Oe.to)||I():i==="multiple"?(p==null?void 0:p[0])||I():p||I());let Re=oe(ve);if(ne.preserveMonthOffset){const $e=Number.isInteger(ne.visibleMonthOffset)?ne.visibleMonthOffset:de(ne.anchorIso||ne.focusIso||ve);$e>0&&(Re=re(Re,-$e))}w=Re},Ye=()=>{Me.replaceChildren();const p=l(n.name);if(!p)return;const ne=(Fe,Oe)=>{Me.appendChild(_.input({type:"hidden",name:Fe,value:Oe!=null?Oe:""}))},ve=Ie;if(i==="single"){ne(p,be(ve,z));return}if(i==="range"){ne(l(n.nameFrom)||`${p}_from`,(ve==null?void 0:ve.from)||""),ne(l(n.nameTo)||`${p}_to`,(ve==null?void 0:ve.to)||"");return}if(i==="range-multiple"){const Fe=Array.isArray(ve)?ve:[],Oe=/\[\]$/.test(l(n.nameFrom)||"")?l(n.nameFrom):`${l(n.nameFrom)||`${p}_from`}[]`,$e=/\[\]$/.test(l(n.nameTo)||"")?l(n.nameTo):`${l(n.nameTo)||`${p}_to`}[]`;Fe.forEach(Xe=>{ne(Oe,(Xe==null?void 0:Xe.from)||""),ne($e,(Xe==null?void 0:Xe.to)||"")});return}const Re=/\[\]$/.test(p)?p:`${p}[]`;(Array.isArray(ve)?ve:[]).forEach(Fe=>ne(Re,Fe))},Ze=()=>{var p;o||(Ae.readOnly=!l(n.manualInput),Ae.disabled=!!l(n.disabled),Ae.setAttribute("aria-expanded",c?"true":"false"),Ae.value=O(Ie,z),Ye(),(p=De==null?void 0:De._refresh)==null||p.call(De))},Qe=(p,ne,ve={})=>{var Xe,ot,pt;const Re=j(p),Fe=Q()?it((Xe=Tt(ve.timeValue!=null?ve.timeValue:ve.preserveTime?xe():p,G()))!=null?Xe:ve.preserveTime?xe():null):null,Oe=Ce(Ie,z);Ie=g(Re),_e=g(Re),Q()&&(z=it(Fe),we=it(Fe)),T=null,Ue(Re,ve),Ze(),wt(),R&&ve.fromModel!==!0&&R.set(be(Re,Fe));const $e=Ce(Re,Fe);if(ve.emit!==!1&&$e!==Oe){const xt=be(Re,Fe);(ot=n.onInput)==null||ot.call(n,xt,ne),(pt=n.onChange)==null||pt.call(n,xt,ne)}return Re},Te=(p,ne,ve={})=>{var $e,Xe;if(!Q())return null;const Re=it(Tt(p,G()));if(l(n.confirm)&&ve.commit!==!0)return we=Re,wt(),Re;const Fe=Ce(Ie,z);z=it(Re),we=it(Re),Ze(),wt(),R&&ve.fromModel!==!0&&R.set(be(Ie,Re));const Oe=Ce(Ie,Re);if(ve.emit!==!1&&Oe!==Fe){const ot=be(Ie,Re);($e=n.onInput)==null||$e.call(n,ot,ne),(Xe=n.onChange)==null||Xe.call(n,ot,ne)}return Re},je=(p,ne,ve={})=>{if(l(n.confirm)){_e=g(j(p)),Q()&&(ve.timeValue!=null||ve.preserveTime)&&(we=it(Tt(ve.timeValue!=null?ve.timeValue:xe(),G()))),T=null,Ue(_e,ve),wt();return}Qe(p,ne,ve)},tt=()=>{const p=H();if(i==="range")return!(p!=null&&p.from)||p!=null&&p.to||!T?p:M(p.from,T)<=0?{from:p.from,to:T}:{from:T,to:p.from};if(i==="range-multiple"){const ne=Array.isArray(p)&&p.length?p[p.length-1]:null;return!(ne!=null&&ne.from)||ne!=null&&ne.to||!T?ne:M(ne.from,T)<=0?{from:ne.from,to:T}:{from:T,to:ne.from}}return p},nt=()=>{if(i==="range"){const p=tt();return p!=null&&p.from?[p]:[]}if(i==="range-multiple"){const p=Array.isArray(H())?H():[];if(!p.length)return[];const ne=tt();return ne!=null&&ne.from?[...p.slice(0,-1),ne]:p}return[]},ut=p=>{const ne=H();return i==="multiple"?ne.includes(p):i==="range-multiple"?Array.isArray(ne)&&ne.some(ve=>te(ve==null?void 0:ve.from,p)||te(ve==null?void 0:ve.to,p)):i==="range"?te(ne==null?void 0:ne.from,p)||te(ne==null?void 0:ne.to,p):te(ne,p)},dt=p=>i!=="range"&&i!=="range-multiple"?!1:nt().some(ne=>(ne==null?void 0:ne.from)&&(ne==null?void 0:ne.to)&&p>=ne.from&&p<=ne.to),bt=(p,ne={})=>{const ve=H(),Re=i==="range"?ve:i==="range-multiple"&&Array.isArray(ve)&&ve.length?ve[ve.length-1]:null;!(Re!=null&&Re.from)||Re!=null&&Re.to||T===p||(T=p,ne.render!==!1&&wt())},lt=()=>o||l(n.confirm)||n.closeOnSelect===!1?!1:i==="multiple"||i==="range-multiple"?!!n.closeOnSelect:!0,ft=(p,ne,ve={})=>{var Fe;if(!ye(p)||l(n.disabled)||l(n.readonly))return;const Re={focusIso:p,anchorIso:p,preserveTime:Q(),timeValue:xe(),preserveMonthOffset:!!c&&N()>1,visibleMonthOffset:Number.isInteger(ve.visibleMonthOffset)?ve.visibleMonthOffset:null};if(i==="multiple"){const Oe=J(H()),$e=Oe.includes(p)?Oe.filter(Xe=>Xe!==p):[...Oe,p];je($e.sort(),ne,Re),lt()&&St();return}if(i==="range"){const Oe=g(H());let $e;!Oe.from||Oe.from&&Oe.to?$e={from:p,to:null}:M(p,Oe.from)<0?$e={from:p,to:Oe.from}:$e={from:Oe.from,to:p},je($e,ne,Re),$e.to&<()&&St();return}if(i==="range-multiple"){const Oe=h(H()),$e=Oe.length?Oe[Oe.length-1]:null;let Xe;!($e!=null&&$e.from)||$e!=null&&$e.to?Xe=[...Oe,{from:p,to:null}]:M(p,$e.from)<0?Xe=[...Oe.slice(0,-1),{from:p,to:$e.from}]:Xe=[...Oe.slice(0,-1),{from:$e.from,to:p}],je(Xe,ne,Re),(Fe=Xe[Xe.length-1])!=null&&Fe.to&<()&&St();return}je(p,ne,Re),lt()&&St()},vt=()=>{x=null,Qe(Ne(),null,{timeValue:null})},_t=()=>{const p=se();if(!ye(p)){Ue(p),wt();return}if(i==="range"){const ne=me(p,1),ve=ne&&ye(ne)?{from:p,to:ne}:{from:p,to:null};je(ve,null);return}if(i==="range-multiple"){const ne=me(p,1),ve=ne&&ye(ne)?[{from:p,to:ne}]:[{from:p,to:null}];je(ve,null);return}if(i==="multiple"){je([p],null);return}je(p,null,{preserveTime:Q(),timeValue:xe()})},rt=(p={})=>{cl(A,p)},Vt=()=>{if(!Q())return;const p=Wn(A);Te(new Date,null,{commit:!l(n.confirm)}),rt({scrollState:p}),!l(n.confirm)&&n.closeOnSelect===!0&&St()},Mt=()=>{l(n.confirm)&&(Qe(_e,null,{timeValue:we,preserveTime:!0}),n.closeOnSelect!==!1&&St())},wt=()=>{var xl,kl,_l,Nl,Ll,Al,Il,zl,Pl,Jl,El,Tl,Rl,Ml,Fl,Ol,Dl,$l,Vl;if(!A)return;const p=k(),ne=new Intl.DateTimeFormat(p,{month:"long",year:"numeric"}),ve=new Intl.DateTimeFormat(p,{weekday:"short"}),Re=Array.from({length:7},(Ge,st)=>{const Ft=(d()+st)%7;return ve.format(new Date(2024,0,7+Ft))}),Fe=H(),Oe=Ge=>{let st=JSswift.ui.renderSlot(r,"point",Ge,null);return st==null&&(st=JSswift.ui.renderSlot(r,"dayPoint",Ge,null)),st==null&&n.pointIcon!=null&&(Ge.selected||Ge.inRange||Ge.today)&&(st=typeof n.pointIcon=="string"?he.Icon({name:n.pointIcon,size:10}):JSswift.ui.slot(n.pointIcon,Ge)),E(null,"default",Ge,st)},$e=(Ge,st)=>{const Ft=Ge.getFullYear(),Tn=Ge.getMonth(),Rn=new Date(Ft,Tn,1),Zn=(Rn.getDay()-d()+7)%7,xs=new Date(Ft,Tn,1-Zn),es=_.div({class:"cms-date-month"});es.appendChild(_.div({class:"cms-date-month-title"},ne.format(Rn)));const Bl=_.div({class:"cms-date-weekdays"});Re.forEach(Mn=>Bl.appendChild(_.div({class:"cms-date-weekday"},Mn))),es.appendChild(Bl);const Hl=_.div({class:"cms-date-grid"});for(let Mn=0;Mn<42;Mn+=1){const ks=new Date(xs.getFullYear(),xs.getMonth(),xs.getDate()+Mn),Pt=W(ks),jl=ks.getMonth()===Tn,Wl=ut(Pt),Ul=dt(Pt),Gl=(i==="range"||i==="range-multiple")&&nt().some(It=>te(It==null?void 0:It.from,Pt)),Kl=(i==="range"||i==="range-multiple")&&nt().some(It=>te(It==null?void 0:It.to,Pt)),_s=!ye(Pt),Ns={...ge(Pt),selected:Wl,inRange:Ul,rangeStart:Gl,rangeEnd:Kl,disabled:_s,outside:!jl,value:Fe,select:()=>ft(Pt,null,{visibleMonthOffset:st})},Ls=Oe(Ns),ii=JSswift.ui.renderSlot(r,"day",Ns,String(ks.getDate())),ai=E(null,"default",Ns,ii),ri=_.button({type:"button",class:ae(["cms-date-day",fe(!jl,"is-outside"),fe(Wl,"is-selected"),fe(Ul,"is-in-range"),fe(Gl,"is-range-start"),fe(Kl,"is-range-end"),fe(_s,"is-disabled"),fe(te(Pt,se()),"is-today"),fe(Ls.length,"has-point")]),disabled:_s,onMouseDown:It=>{It.button===0&&(x=Pt,It.preventDefault(),ft(Pt,It,{visibleMonthOffset:st}))},onClick:It=>{if(x!=null&&It.detail!==0){x=null;return}x=null,ft(Pt,It,{visibleMonthOffset:st})},onMouseEnter:()=>bt(Pt),onFocus:()=>bt(Pt,{render:!1})},_.span({class:"cms-date-day-label"},...ai),Ls.length?_.span({class:"cms-date-day-point"},...Ls):null);Hl.appendChild(ri)}return es.appendChild(Hl),es},Xe=U(),ot=ce(),pt=[w.getFullYear(),(xl=le(se()))==null?void 0:xl.getFullYear(),(kl=le(Xe))==null?void 0:kl.getFullYear(),(_l=le(ot))==null?void 0:_l.getFullYear(),(Nl=le(l(n.defaultMonth)))==null?void 0:Nl.getFullYear()];i==="range"?pt.push((Ll=le(Fe==null?void 0:Fe.from))==null?void 0:Ll.getFullYear(),(Al=le(Fe==null?void 0:Fe.to))==null?void 0:Al.getFullYear()):i==="range-multiple"?Fe.forEach(Ge=>{var st,Ft;pt.push((st=le(Ge==null?void 0:Ge.from))==null?void 0:st.getFullYear(),(Ft=le(Ge==null?void 0:Ge.to))==null?void 0:Ft.getFullYear())}):i==="multiple"?Fe.forEach(Ge=>{var st;return pt.push((st=le(Ge))==null?void 0:st.getFullYear())}):pt.push((Il=le(Fe))==null?void 0:Il.getFullYear());const xt=pt.filter(Ge=>Number.isFinite(Ge)),Bt=(xt.length?Math.min(...xt):w.getFullYear())-100,zt=(xt.length?Math.max(...xt):w.getFullYear())+50,Lt=Number(l((Jl=(Pl=n.yearStart)!=null?Pl:Xe?(zl=le(Xe))==null?void 0:zl.getFullYear():null)!=null?Jl:Bt)),sn=Number(l((Rl=(Tl=n.yearEnd)!=null?Tl:ot?(El=le(ot))==null?void 0:El.getFullYear():null)!=null?Rl:zt)),dn=_.select({class:"cms-date-select",value:String(w.getMonth()),onChange:Ge=>{var st;w=new Date(w.getFullYear(),Number(Ge.currentTarget.value),1),(st=n.onNavigate)==null||st.call(n,{month:w.getMonth()+1,year:w.getFullYear()}),wt()}},...Array.from({length:12},(Ge,st)=>us({value:String(st)},new Intl.DateTimeFormat(p,{month:"long"}).format(new Date(2024,st,1))))),fn=_.select({class:"cms-date-select cms-date-select-year",value:String(w.getFullYear()),onChange:Ge=>{var st;w=new Date(Number(Ge.currentTarget.value),w.getMonth(),1),(st=n.onNavigate)==null||st.call(n,{month:w.getMonth()+1,year:w.getFullYear()}),wt()}},...Array.from({length:Math.max(1,sn-Lt+1)},(Ge,st)=>{const Ft=Lt+st;return us({value:String(Ft)},String(Ft))})),vn=_.div({class:"cms-date-header"},_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Ge;w=re(w,-1),(Ge=n.onNavigate)==null||Ge.call(n,{month:w.getMonth()+1,year:w.getFullYear()}),wt()}},he.Icon({name:"chevron_left",size:16})),_.div({class:"cms-date-header-center"},dn,fn),_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Ge;w=re(w,1),(Ge=n.onNavigate)==null||Ge.call(n,{month:w.getMonth()+1,year:w.getFullYear()}),wt()}},he.Icon({name:"chevron_right",size:16}))),zn=_.div({class:"cms-date-shortcuts"}),Pn=l((Ml=n.shortcuts)!=null?Ml:n.presets)||[];Pn.forEach((Ge,st)=>{var Rn,Zn;if(!Ge)return;const Ft=typeof Ge.value=="function"?Ge.value({today:se()}):Ge.value,Tn=(Zn=(Rn=Ge.label)!=null?Rn:Ge.text)!=null?Zn:`Preset ${st+1}`;zn.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>je(Ft,null,{preserveTime:Q(),timeValue:xe()})},Tn))});const Jn=_.div({class:"cms-date-months"});for(let Ge=0;Ge<N();Ge+=1)Jn.appendChild($e(re(w,Ge),Ge));const Sn=O(Fe,xe()),Cn=_.div({class:"cms-date-value"},...E(r,"value",{value:Fe,displayValue:Sn,mode:i,timeValue:xe()},Sn||E(r,"default",{},s))),En=_.div({class:"cms-time-header"}),ei=_.div({class:"cms-time-columns-2"},_.div({class:"cms-time-column-title"},l(n.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},l(n.minutesLabel)||"Min"));En.appendChild(ei);const ti=Q()?rl({props:{min:l((Fl=n.timeMin)!=null?Fl:n.minTime),max:l((Ol=n.timeMax)!=null?Ol:n.maxTime),use12h:l(($l=(Dl=n.time12h)!=null?Dl:n.use12h)!=null?$l:n.ampm),hoursLabel:l(n.timeHoursLabel)||"Ore",minutesLabel:l(n.timeMinutesLabel)||"Min",secondsLabel:l(n.timeSecondsLabel)||"Sec"},slots:r,slotPrefix:"time",value:xe(),withSeconds:!1,minuteStep:1,secondStep:D(),disabled:!!l(n.disabled),readonly:!!l(n.readonly),embedded:!0,pointIcon:l(n.timePointIcon),shortcuts:l((Vl=n.timeShortcuts)!=null?Vl:n.timePresets),onSelect:Ge=>{const st=Wn(A);Te(Ge,null),rt({scrollState:st})}}):null,ni=_.div({class:"cms-date-footer-info"},Cn),si=_.div({class:ae(["cms-date-footer",fe(Q(),"has-time")])},ni,_.div({class:"cms-date-actions"},_.button({type:"button",class:"cms-date-action",onClick:_t},l(n.todayLabel)||"Oggi"),l(n.clearable)!==!1?_.button({type:"button",class:"cms-date-action",onClick:vt},l(n.clearLabel)||"Reset"):null,l(n.confirm)?_.button({type:"button",class:"cms-date-action is-primary",onClick:Mt},l(n.applyLabel)||"Applica"):null)),li=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:Vt},l(n.nowLabel)||"Ora")),oi=Q()?_.div({class:"cms-date-time"},En,ti,li):null;A.replaceChildren(_.div({class:"cms-date-panel-root",onKeydown:Ge=>{var st;Ge.key==="Escape"&&(Ge.preventDefault(),o?(st=n.onEscape)==null||st.call(n,Ge):St())}},vn,Pn.length?zn:null,_.div({class:"cms-data-time"},Jn,oi),si))};function Kt(){var p,ne,ve,Re;return c||l(n.disabled)||l(n.readonly)||(_e=g(Ie),we=it(z),T=null,x=null,Ue(_e),c=JSswift.overlay.open(({close:Fe})=>{var Xe;const Oe=i==="range"||i==="range-multiple"?2:1,$e=Number((Xe=l(n.monthsToShow))!=null?Xe:Oe);return A=_.div({class:Dt(["cms-date-panel",l(v),fe($e>1,"multi-month"),n.panelClass])}),wt(),A},{type:"date",anchorEl:De._control||Ae,placement:n.placement||"bottom-start",offsetX:(p=n.offsetX)!=null?p:0,offsetY:(ve=(ne=n.offsetY)!=null?ne:n.offset)!=null?ve:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:n.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Dt(["cms-date-overlay",n.panelClass,fe(Q(),"has-time")]),onClose:()=>{var Fe;c=null,A=null,T=null,Ze(),(Fe=n.onClose)==null||Fe.call(n)}}),n.panelStyle&&Object.assign(c.panel.style,n.panelStyle),bn(c),Ze(),(Re=n.onOpen)==null||Re.call(n)),c}function St(){if(!c)return;x=null;const p=c;yn(p,()=>JSswift.overlay.close(p.id))}if(o){const p=i==="range"||i==="range-multiple"?2:1,ne=Number((yt=l(n.monthsToShow))!=null?yt:p);A=_.div({class:Dt(["cms-date-panel","cms-date-calendar",l(v),fe(ne>1,"multi-month"),n.panelClass,n.class]),style:n.style})}return o||Ae.addEventListener("focus",p=>{var ne;(ne=n.onFocus)==null||ne.call(n,p),n.openOnFocus!==!1&&Kt()}),o||Ae.addEventListener("click",p=>{var ne;(ne=n.onClick)==null||ne.call(n,p),Kt()}),o||Ae.addEventListener("keydown",p=>{if(p.key==="Escape"){c&&(p.preventDefault(),St());return}(p.key==="ArrowDown"||p.key==="Enter"||p.key===" ")&&(p.preventDefault(),Kt()),(p.key==="Backspace"||p.key==="Delete")&&!l(n.manualInput)&&l(n.clearable)!==!1&&(p.preventDefault(),vt())}),!o&&l(n.manualInput)?(Ae.addEventListener("input",p=>{var ne;(ne=n.onTyping)==null||ne.call(n,Ae.value,p)}),Ae.addEventListener("change",p=>{const ne=ke(Ae.value);Qe(ne,p,{timeValue:Tt(Ae.value,G()),preserveTime:!Tt(Ae.value,G())})}),Ae.addEventListener("blur",p=>{var ve;(ve=n.onBlur)==null||ve.call(n,p);const ne=ke(Ae.value);Ae.value===""?vt():Qe(ne,p,{timeValue:Tt(Ae.value,G()),preserveTime:!Tt(Ae.value,G())})})):o||Ae.addEventListener("blur",p=>{var ne;return(ne=n.onBlur)==null?void 0:ne.call(n,p)}),R&&R.watch(p=>{const ne=j(p),ve=ee(p);Ce(ne,ve)!==Ce(Ie,z)&&(Ie=ne,_e=g(Ie),z=it(ve),we=it(ve),T=null,Ue(Ie),Ze(),wt())},o?"UI.Calendar:watch":"UI.Datepicker:watch"),JSswift.reactive.effect(()=>{!R&&n.value!=null?(Ie=j(l(n.value)),_e=g(Ie),z=ee(l(n.value)),we=it(z)):Q()&&n.timeValue!=null&&(z=ee(l(n.timeValue)),we=it(z)),Ze(),wt(),c&&l(n.disabled)&&St()},o?"UI.Calendar:render":"UI.Datepicker:render"),o?(A._calendar=A,A._date=A,A._getValue=()=>be(Ie,z),A._setValue=p=>Qe(p,null,{emit:!1,timeValue:ee(p)}),A._clear=vt,A._select=p=>{const ne=a(p);ne&&ft(ne,null)},A._time=()=>it(z),A):(De._input=Ae,De._date=Ae,De._open=Kt,De._close=St,De._getValue=()=>be(Ie,z),De._setValue=p=>Qe(p,null,{emit:!1,timeValue:ee(p)}),De._time=()=>it(z),De._panel=()=>(c==null?void 0:c.panel)||null,De)};he.Datepicker=(...t)=>ul(t),he.Calendar=(...t)=>ul(t,{calendar:!0}),he.Date=he.Datepicker,JSswift.ui.Datepicker=he.Datepicker,JSswift.ui.Calendar=he.Calendar,JSswift.ui.Date=he.Date,he.Time=(...t)=>{var X,a,C;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{const h=String(l(e.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(h)?`cms-size-${h}`:""}),r=()=>{var J,j,U,ce,k;const h=Xt(Tt(b?b.get():(J=l(e.value))!=null?J:R,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!l((j=e.withSeconds)!=null?j:e.showSeconds)||/:\d{2}:\d{2}$/.test(h),min:l((U=e.min)!=null?U:e.minTime),max:l((ce=e.max)!=null?ce:e.maxTime),use12h:l((k=e.use12h)!=null?k:e.ampm)}},v=()=>{var J;const h=Number(l((J=e.minuteStep)!=null?J:1));return Math.max(1,Math.min(30,Number.isFinite(h)?h:5))},u=()=>{var J;const h=Number(l((J=e.secondStep)!=null?J:1));return Math.max(1,Math.min(30,Number.isFinite(h)?h:5))},i=e.model||(At(e.value)||Jt(e.value)?e.value:null),b=Nt(i,"UI.Time:model"),R=b?b.get():l(e.value),S=h=>Tt(h,r()),y=h=>jn(h,r()),P=h=>Xt(h,r()),Q=h=>JSON.stringify(P(h));let G=it(S(R)),ie=it(G),D=null,$=null;const Y={...e,label:(X=e.label)!=null?X:e.placeholder},W=Y.label!=null||JSswift.ui.getSlot(s,"label")!=null,le=_.input({class:ae(["cms-input","cms-time-display",o,fe(e.manualInput,"is-manual"),e.inputClass]),type:"text",autocomplete:"off",placeholder:W?"":(a=e.placeholder)!=null?a:"Seleziona orario",readOnly:!l(e.manualInput),disabled:!!l(e.disabled),value:y(G)});le.setAttribute("aria-haspopup","dialog");const me=_.div({style:{display:"contents"}}),re=_.div({class:"cms-time-control",style:{display:"contents"}},le,me),oe=he.FormField({...Y,iconRight:(C=e.iconRight)!=null?C:"schedule",control:re,getValue:()=>le.value,onClear:()=>{l(e.disabled)||l(e.readonly)||(Z(null,null,{commit:!0}),D&&F())},onFocus:()=>le.focus()}),se=()=>l(e.confirm)?ie:G,te=()=>{me.replaceChildren();const h=l(e.name);h&&me.appendChild(_.input({type:"hidden",name:h,value:P(G)}))},M=()=>{var h;le.readOnly=!l(e.manualInput),le.disabled=!!l(e.disabled),le.setAttribute("aria-expanded",D?"true":"false"),le.value=y(G),te(),(h=oe._refresh)==null||h.call(oe)},Z=(h,J,j={})=>{var d,N;const U=it(S(h));if(l(e.confirm)&&j.commit!==!0)return ie=it(U),m(),U;const ce=Q(G);G=it(U),ie=it(U),M(),m(),b&&j.fromModel!==!0&&b.set(P(U));const k=Q(U);if(j.emit!==!1&&k!==ce){const I=P(U);(d=e.onInput)==null||d.call(e,I,J),(N=e.onChange)==null||N.call(e,I,J)}return U},q=h=>l(e.confirm)||e.closeOnSelect!==!0?!1:r().withSeconds?(h==null?void 0:h.part)==="second":(h==null?void 0:h.part)==="minute",ue=(h={})=>{cl($,h)},L=()=>{const h=Wn($);Z(new Date,null,{commit:!l(e.confirm)}),ue({scrollState:h}),!l(e.confirm)&&e.closeOnSelect===!0&&F()},f=()=>{l(e.confirm)&&(Z(ie,null,{commit:!0}),e.closeOnSelect!==!1&&F())},m=()=>{var N,I,H,ge;if(!$)return;const h=se(),J=y(h),j=_.div({class:"cms-time-header"}),U=_.div({class:"cms-time-columns"},_.div({class:"cms-time-column-title"},l(e.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},l(e.minutesLabel)||"Min")),ce=r().withSeconds;ce&&U.appendChild(_.div({class:"cms-time-column-title"},l(e.secondsLabel)||"Sec")),j.appendChild(U);const k=rl({props:{min:l((N=e.min)!=null?N:e.minTime),max:l((I=e.max)!=null?I:e.maxTime),use12h:l((H=e.use12h)!=null?H:e.ampm),hoursLabel:l(e.hoursLabel)||"Ore",minutesLabel:l(e.minutesLabel)||"Min",secondsLabel:l(e.secondsLabel)||"Sec"},slots:s,value:h,withSeconds:ce,minuteStep:v(),secondStep:u(),disabled:!!l(e.disabled),readonly:!!l(e.readonly),pointIcon:l(e.pointIcon),shortcuts:l((ge=e.shortcuts)!=null?ge:e.presets),onSelect:(Se,ye)=>{const V=Wn($);Z(Se,null),ue({scrollState:V}),q(ye)&&F()}}),d=_.div({class:"cms-time-footer"},_.div({class:"cms-time-value"},...E(s,"value",{value:h,displayValue:J},J||E(s,"default",{},n))),_.div({class:"cms-time-actions"},_.button({type:"button",class:"cms-time-action",onClick:L},l(e.nowLabel)||"Ora"),l(e.clearable)!==!1?_.button({type:"button",class:"cms-time-action",onClick:()=>Z(null,null,{commit:!l(e.confirm)})},l(e.clearLabel)||"Reset"):null,l(e.confirm)?_.button({type:"button",class:"cms-time-action is-primary",onClick:f},l(e.applyLabel)||"Applica"):null));$.replaceChildren(_.div({class:"cms-time-panel-root",onKeydown:Se=>{Se.key==="Escape"&&(Se.preventDefault(),F())}},j,k,d))};function g(){var h,J,j,U;return D||l(e.disabled)||l(e.readonly)||(ie=it(G),D=JSswift.overlay.open(()=>($=_.div({class:Dt(["cms-time-panel",l(o),e.panelClass])}),m(),$),{type:"time",anchorEl:oe._control||le,placement:e.placement||"bottom-start",offsetX:(h=e.offsetX)!=null?h:0,offsetY:(j=(J=e.offsetY)!=null?J:e.offset)!=null?j:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:e.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Dt(["cms-time-overlay",e.panelClass]),onClose:()=>{var ce;D=null,$=null,M(),(ce=e.onClose)==null||ce.call(e)}}),e.panelStyle&&Object.assign(D.panel.style,e.panelStyle),bn(D),ue(),M(),(U=e.onOpen)==null||U.call(e)),D}function F(){if(!D)return;const h=D;yn(h,()=>JSswift.overlay.close(h.id))}return le.addEventListener("focus",h=>{var J;(J=e.onFocus)==null||J.call(e,h),e.openOnFocus!==!1&&g()}),le.addEventListener("click",h=>{var J;(J=e.onClick)==null||J.call(e,h),g()}),le.addEventListener("keydown",h=>{if(h.key==="Escape"){D&&(h.preventDefault(),F());return}(h.key==="ArrowDown"||h.key==="Enter"||h.key===" ")&&(h.preventDefault(),g()),(h.key==="Backspace"||h.key==="Delete")&&!l(e.manualInput)&&l(e.clearable)!==!1&&(h.preventDefault(),Z(null,h,{commit:!0}))}),l(e.manualInput)?(le.addEventListener("input",h=>{var J;return(J=e.onTyping)==null?void 0:J.call(e,le.value,h)}),le.addEventListener("change",h=>Z(le.value,h)),le.addEventListener("blur",h=>{var J;(J=e.onBlur)==null||J.call(e,h),le.value===""?Z(null,h):Z(le.value,h)})):le.addEventListener("blur",h=>{var J;return(J=e.onBlur)==null?void 0:J.call(e,h)}),b&&b.watch(h=>{const J=it(S(h));Q(J)!==Q(G)&&(G=it(J),ie=it(J),M(),m())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!b&&e.value!=null&&(G=it(S(l(e.value))),ie=it(G)),M(),m(),D&&l(e.disabled)&&F()},"UI.Time:render"),oe._input=le,oe._time=le,oe._open=g,oe._close=F,oe._getValue=()=>P(G),oe._setValue=h=>Z(h,null,{emit:!1,commit:!0}),oe._panel=()=>(D==null?void 0:D.panel)||null,oe},he.Tabs=(...t)=>{var N,I,H,ge,Se,ye;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(V,O)=>!!V&&Object.prototype.hasOwnProperty.call(V,O),r=V=>String(l(V)||"horizontal").toLowerCase()==="vertical"?"vertical":"horizontal",v=V=>{const O=String(l(V)||"").toLowerCase();return O==="pills"||O==="pill"?"pills":O==="soft"||O==="card"?"soft":"line"},u=V=>{var K;const O=l(V);return O==null||O===""?null:(K=JSswift.uiColors)!=null&&K.includes(O)?`var(--cms-${O})`:String(O)},i=(V,O)=>Object.is(V,O)||V!=null&&O!=null&&V==O,b=Nt(e.model,"UI.Tabs:model"),R=r(e.orientation||e.orient||e.direction),S=v(e.variant||(e.pills?"pills":e.soft?"soft":"line")),y=!!l((I=(N=e.fill)!=null?N:e.navFill)!=null?I:e.stretch),P=!!l(e.wrap),Q=!!l(e.disabled),G=e.id||"cms-tabs-"+Math.random().toString(36).slice(2,9),ie=l((H=e.tabs)!=null?H:e.items)||[],D=(Array.isArray(ie)?ie:[ie]).map((V,O)=>{var ee,xe,be,Ce,pe,Ie,_e,z,we,T,x,w,c,A;if(V==null)return null;if(typeof V!="object")return{raw:V,index:O,value:V,labelFallback:V,noteFallback:null,iconFallback:null,badgeFallback:null,disabled:!1,hidden:!1};const K=(Ie=(pe=(Ce=(be=(xe=(ee=V.value)!=null?ee:V.name)!=null?xe:V.id)!=null?be:V.key)!=null?Ce:V.label)!=null?pe:V.title)!=null?Ie:`tab-${O}`,ke=(T=(we=(z=(_e=V.label)!=null?_e:V.title)!=null?z:V.name)!=null?we:V.value)!=null?T:`Tab ${O+1}`,Ne=o(V,"badge")?V.badge:o(V,"counter")?V.counter:null;return{...V,raw:V,index:O,value:K,labelFallback:ke,noteFallback:(c=(w=(x=V.note)!=null?x:V.subtitle)!=null?w:V.description)!=null?c:null,iconFallback:(A=V.icon)!=null?A:null,badgeFallback:Ne}}).filter(Boolean).filter(V=>V.hidden!==!0&&V.visible!==!1),$=D.find(V=>!V.disabled)||null,Y=V=>D.findIndex(O=>i(O.value,V)),W=(V,O)=>{var ke;if(!D.length)return-1;let K=V;for(let Ne=0;Ne<D.length;Ne+=1)if(K+=O,K<0?K=D.length-1:K>=D.length&&(K=0),!((ke=D[K])!=null&&ke.disabled))return K;return-1},le=(V,O=!1)=>{var ke,Ne;const K=Y(V);return K>=0&&!((ke=D[K])!=null&&ke.disabled)?D[K].value:O?(Ne=$==null?void 0:$.value)!=null?Ne:null:V!=null?V:null},me=le(b?b.get():o(e,"value")?l(e.value):(ge=e.defaultValue)!=null?ge:e.default,!0),[re,oe]=JSswift.reactive.signal(me),se=ae(["cms-clear-set","cms-tabs","cms-singularity",R,`variant-${S}`,fe(e.dense,"dense"),fe(y,"fill"),fe(P,"wrap"),fe(Q,"disabled"),e.class]),te=JSswift.omit(e,["tabs","items","value","defaultValue","default","model","orientation","orient","direction","variant","pills","soft","fill","navFill","stretch","wrap","dense","disabled","slots","empty","gap","tabGap","align","justify","color","state","navClass","navStyle","barClass","barStyle","tabClass","tabStyle","itemClass","itemStyle","class","style"]);te.class=se,te.style={...e.style||{}},e.gap!=null&&(te.style["--cms-tabs-gap"]=Be(e.gap)),e.tabGap!=null&&(te.style["--cms-tabs-tab-gap"]=Be(e.tabGap));const M=u((Se=e.color)!=null?Se:e.state);M&&(te.style["--cms-tabs-accent"]=M);const Z=_.div(te),q=_.div({class:ae(["cms-tabs-bar",e.barClass]),style:{alignItems:e.align||(R==="vertical"?"stretch":"center"),justifyContent:e.justify||"flex-start",...e.barStyle||{}}}),ue=_.div({class:ae(["cms-tabs-nav",e.navClass]),style:e.navStyle||null,role:"tablist","aria-orientation":R}),L=[],f=()=>Y(re()),m=()=>{const V=f();return V>=0?D[V]:null},g=()=>({tabs:D,value:re(),active:re(),activeIndex:f(),activeTab:m(),orientation:R,variant:S,select:(V,O)=>h(V,{event:O,emit:!0}),next:()=>j(),prev:()=>U()}),F=(V,O,K)=>({...g(),tab:V,index:O,active:K,disabled:!!V.disabled,select:ke=>J(O,{event:ke,emit:!0})}),X=V=>{var K;const O=(K=L[V])==null?void 0:K.btn;!O||typeof O.focus!="function"||requestAnimationFrame(()=>O.focus())},a=V=>{const O=Y(V);Z.dataset.value=V==null?"":String(V),Z.dataset.activeIndex=O>=0?String(O):"",L.forEach(({btn:K,item:ke,tab:Ne,index:ee})=>{const xe=ee===O;ke.classList.toggle("active",xe),ke.classList.toggle("disabled",!!(Ne.disabled||Q)),K.classList.toggle("active",xe),K.setAttribute("aria-selected",xe?"true":"false"),K.setAttribute("tabindex",xe?"0":"-1")})},C=V=>{oe(V),a(V)},h=(V,O={})=>{if(Q)return null;const K=Y(V);return K<0?null:J(K,O)},J=(V,O={})=>{var xe,be;const K=D[V];if(!K||K.disabled||Q)return null;const ke=K.value,Ne=re(),ee=!i(Ne,ke);return C(ke),b&&!i(b.get(),ke)&&b.set(ke),O.focus&&X(V),O.event&&((xe=K.onClick)==null||xe.call(K,ke,O.event,K,V)),ee&&O.emit!==!1&&((be=e.onChange)==null||be.call(e,ke,K,O.event||null,V)),K},j=()=>{const V=W(f()<0?-1:f(),1);V>=0&&J(V,{emit:!0,focus:!0})},U=()=>{const V=f()<0?0:f(),O=W(V,-1);O>=0&&J(O,{emit:!0,focus:!0})},ce=(V,O)=>{var w,c,A,de,Le,Je;const K=O===f(),ke=F(V,O,K),Ne=`${G}-tab-${O}`,ee=V.iconFallback!=null?typeof V.iconFallback=="string"?he.Icon({name:V.iconFallback,size:(A=(c=(w=V.iconSize)!=null?w:V.size)!=null?c:e.size)!=null?A:null}):V.iconFallback:null,xe=E(s,"icon",ke,ee),be=E(null,"default",{},JSswift.ui.renderSlot(s,"label",ke,V.labelFallback)),Ce=E(s,"note",ke,V.noteFallback),pe=E(s,"badge",ke,V.badgeFallback),Ie=_.span({class:"cms-tabs-tab-inner"},xe.length?_.span({class:"cms-tabs-tab-icon"},...xe):null,_.span({class:"cms-tabs-tab-copy"},_.span({class:"cms-tabs-tab-label"},...be.length?be:[""]),Ce.length?_.span({class:"cms-tabs-tab-note"},...Ce):null),pe.length?_.span({class:"cms-tabs-tab-badge"},...pe):null),_e=E(s,"tab",{...ke,tabId:Ne,label:be,icon:xe,note:Ce,badge:pe},Ie),z=B=>{var De;if(V.disabled||Q)return;const Ae=B.key;if(Ae==="Enter"||Ae===" "){B.preventDefault(),J(O,{event:B,emit:!0});return}if(Ae==="Home"){B.preventDefault();const Ue=D.findIndex(Ye=>!Ye.disabled);Ue>=0&&J(Ue,{event:B,emit:!0,focus:!0});return}if(Ae==="End"){B.preventDefault();let Ue=-1;for(let Ye=D.length-1;Ye>=0;Ye-=1)if(!((De=D[Ye])!=null&&De.disabled)){Ue=Ye;break}Ue>=0&&J(Ue,{event:B,emit:!0,focus:!0});return}const Me=R==="vertical"?["ArrowUp"]:["ArrowLeft"],Ee=R==="vertical"?["ArrowDown"]:["ArrowRight"];if(Me.includes(Ae)){B.preventDefault();const Ue=W(O,-1);Ue>=0&&J(Ue,{event:B,emit:!0,focus:!0});return}if(Ee.includes(Ae)){B.preventDefault();const Ue=W(O,1);Ue>=0&&J(Ue,{event:B,emit:!0,focus:!0})}},we=u((de=V.color)!=null?de:V.state),T=_.div({class:ae(["cms-tabs-item",fe(K,"active"),fe(V.disabled||Q,"disabled"),e.itemClass,V.itemClass]),style:{...we?{"--cms-tabs-item-accent":we}:{},...e.itemStyle||{},...V.itemStyle||{}},"data-name":String(V.value)}),x=he.Btn({class:ae(["cms-tabs-tab",fe(K,"active"),fe(V.disabled||Q,"disabled"),e.tabClass,V.tabClass||V.class]),type:"button",id:Ne,role:"tab",disabled:!!(V.disabled||Q),"aria-selected":K?"true":"false",tabindex:K?"0":"-1",size:(Je=(Le=V.size)!=null?Le:e.size)!=null?Je:null,style:{...e.tabStyle||{},...V.tabStyle||{}},onClick:B=>{J(O,{event:B,emit:!0})},onKeydown:z},..._e);return T.appendChild(x),T.appendChild(_.span({class:"tab-indicator"})),L[O]={tab:V,index:O,item:T,btn:x},T};if(D.length){const V=D.map((K,ke)=>ce(K,ke)),O=JSswift.ui.renderSlot(s,"nav",{...g(),nodes:V},V);E(null,"default",{},O).forEach(K=>ue.appendChild(K))}else E(s,"empty",g(),(ye=e.empty)!=null?ye:_.div({class:"cms-tabs-empty"},"Nessuna tab disponibile.")).forEach(V=>ue.appendChild(V));const k=g(),d=[...E(null,"default",{},JSswift.ui.renderSlot(s,"extra",k,null)),...E(s,"default",k,n)];return q.appendChild(ue),d.length&&q.appendChild(_.div({class:"cms-tabs-extra"},...d)),Z.appendChild(q),C(me),b?b.watch(V=>{C(le(V,!0))},"UI.Tabs:watch"):at(e.value)&&He.reactive.effect(()=>{C(le(l(e.value),!0))},"UI.Tabs:value"),Z._getValue=()=>re(),Z._setValue=V=>h(V,{emit:!0}),Z._select=V=>h(V,{emit:!0}),Z._next=()=>j(),Z._prev=()=>U(),Z._getTabs=()=>D.slice(),Ke(Z,e),Z},he.RouteTab=(...t)=>{var X,a,C,h,J,j,U,ce,k,d,N,I,H,ge,Se;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=JSswift.router||(He==null?void 0:He.router)||null,r=ye=>Object.prototype.hasOwnProperty.call(e,ye),v=r("active")||r("selected"),u=ye=>{const V=String(l(ye)||"").toLowerCase();return V==="pill"||V==="pills"?"pills":V==="soft"||V==="card"?"soft":"line"},i=ye=>{var O;const V=l(ye);return V==null||V===""?null:(O=JSswift.uiColors)!=null&&O.includes(V)?`var(--cms-${V})`:String(V)},b=ye=>{if(ye==null||ye==="")return"";try{return new URL(String(ye),window.location.origin).pathname||""}catch(V){return String(ye).split(/[?#]/)[0]||""}},R=ye=>l(e.external)===!0?!0:ye?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(ye)):!1,S=()=>{var ye;return l((ye=e.href)!=null?ye:e.to)||"#"},y=()=>{var ye;return l((ye=e.to)!=null?ye:e.href)||""},P=()=>{try{if(o!=null&&o.current)return o.current().pathname||window.location.pathname||""}catch(ye){}return window.location.pathname||""},Q=()=>{var ee,xe,be;const ye=y();if(!ye)return!1;const V=l((xe=(ee=e.match)!=null?ee:e.activeMatch)!=null?xe:e.routeMatch),O=String(l((be=e.matchMode)!=null?be:e.startsWith?"startsWith":e.exact?"exact":"")||"").toLowerCase(),K=P();if(typeof V=="function")return!!V({currentPath:K,to:ye,href:S(),router:o,props:e});if(V instanceof RegExp)return V.test(K);const ke=b(typeof V=="string"&&!["exact","startsWith","prefix","section"].includes(V.toLowerCase())?V:ye);if(!ke)return!1;const Ne=O||(typeof V=="string"&&["startsWith","prefix","section"].includes(V.toLowerCase())?"startsWith":"exact");return Ne==="startswith"||Ne==="prefix"||Ne==="section"?K===ke||K.startsWith(`${ke}/`):o!=null&&o.isActive?!!o.isActive(ye):K===ke},G=()=>!!l(e.disabled);let ie=null;const D=()=>{var ye;return ie!=null?!!ie:v?!!l((ye=e.active)!=null?ye:e.selected):Q()},$=u(e.variant||(e.pills?"pills":e.soft?"soft":"line")),Y=!l(e.color)&&l(e.state)?mt(l(e.state)):"",W=Y?`cms-state-${Y}`:"",le=JSswift.omit(e,["active","selected","label","title","text","to","icon","iconRight","iconSize","note","subtitle","caption","description","badge","counter","count","aside","trailing","slots","state","color","dense","outline","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","variant","pills","soft","block","fill","match","matchMode","activeMatch","routeMatch","exact","startsWith","external","onNavigate"]);le.href=S(),le.class=ae(["cms-route-tab","cms-clear-set","cms-singularity",`variant-${$}`,fe((X=e.block)!=null?X:e.fill,"block"),fe(e.dense,"dense"),W,e.class]),le.style={...e.style||{}};const me=i((a=e.color)!=null?a:e.state);me&&(le.style["--cms-route-tab-accent"]=me);const re=(h=(C=e.iconSize)!=null?C:e.size)!=null?h:null,oe=(ye,V)=>{const O=l(ye);return O==null||O===!1||O===""?null:typeof O=="string"?he.Icon({name:O,size:re}):JSswift.ui.slot(O,{as:V})},se=()=>({active:D(),disabled:G(),href:S(),to:y(),external:R(S()),navigate:ye=>{var K,ke;if(G())return!1;const V=y();return!R(S())&&V&&(o!=null&&o.navigate)?(ye!=null&&ye.preventDefault&&ye.preventDefault(),o.navigate(V),(K=e.onNavigate)==null||K.call(e,V,ye||null),!0):((ke=e.onNavigate)==null||ke.call(e,V||S(),ye||null),!1)}}),te=E(s,"icon",se(),oe(e.icon,"icon")),M=E(s,"label",se(),(U=(j=(J=e.label)!=null?J:e.title)!=null?j:e.text)!=null?U:n),Z=E(s,"note",se(),(d=(k=(ce=e.note)!=null?ce:e.subtitle)!=null?k:e.caption)!=null?d:e.description),q=E(s,"badge",se(),(I=(N=e.badge)!=null?N:e.counter)!=null?I:e.count),ue=E(s,"aside",se(),(ge=(H=e.aside)!=null?H:e.trailing)!=null?ge:oe(e.iconRight,"iconRight")),L=E(s,"default",se(),(Se=e.content)!=null?Se:e.body),f=_.span({class:"cms-route-tab-inner"},te.length?_.span({class:"cms-route-tab-icon"},...te):null,_.span({class:"cms-route-tab-copy"},_.span({class:"cms-route-tab-label"},...M.length?M:[y()||S()||""]),Z.length?_.span({class:"cms-route-tab-note"},...Z):null,L.length?_.span({class:"cms-route-tab-extra"},...L):null),q.length?_.span({class:"cms-route-tab-badge"},...q):null,ue.length?_.span({class:"cms-route-tab-aside"},...ue):null),m=_.a(le,f);Ke(m,e);const g=()=>{const ye=D(),V=G(),O=S(),K=R(O);m.classList.toggle("active",ye),m.classList.toggle("is-disabled",V),m.classList.toggle("is-external",K),ye?m.setAttribute("aria-current",String(l(e.ariaCurrent)||"page")):m.removeAttribute("aria-current"),m.setAttribute("href",O||"#"),V?(m.setAttribute("aria-disabled","true"),m.tabIndex=-1):(m.removeAttribute("aria-disabled"),!r("tabIndex")&&!r("tabindex")&&m.removeAttribute("tabindex")),y()?m.dataset.to=String(y()):delete m.dataset.to,K&&m.target==="_blank"&&!m.rel&&(m.rel="noopener noreferrer")},F=e.onClick;return m.onclick=ye=>{if(F==null||F(ye),!ye.defaultPrevented){if(G()){ye.preventDefault();return}se().navigate(ye)}},!v&&y()&&(o!=null&&o.subscribe)&&o.subscribe(()=>g()),JSswift.reactive.effect(()=>{g()},"UI.RouteTab:render"),m._isActive=()=>D(),m._setActive=ye=>(ie=ye==null?null:!!ye,g(),m),m._navigate=ye=>se().navigate(ye),m},he.Breadcrumbs=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=JSswift.router||(He==null?void 0:He.router)||null,r=Nt(e.model,"UI.Breadcrumbs:model"),v=qe(e.size,()=>{var Z;const M=l(e.size);return typeof M=="string"&&((Z=JSswift.uiSizes)!=null&&Z.includes(M))?`cms-size-${M}`:""}),u=qe(e.variant,()=>{const M=String(l(e.variant||(e.pills?"pills":e.soft?"soft":"line"))||"").toLowerCase();return M==="pill"||M==="pills"?"variant-pills":M==="soft"||M==="card"?"variant-soft":"variant-line"}),i=qe([e.wrap,e.nowrap],()=>l(e.wrap)===!1||l(e.nowrap)?"no-wrap":""),b=_.nav({class:ae(["cms-breadcrumbs","cms-clear-set",v,u,i,fe(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),R=_.div({class:"cms-breadcrumbs-before"}),S=_.ol({class:"cms-breadcrumbs-list"}),y=_.div({class:"cms-breadcrumbs-after"});b.appendChild(R),b.appendChild(S),b.appendChild(y);const P=M=>{var q;const Z=l(M);return Z==null||Z===""?null:(q=JSswift.uiColors)!=null&&q.includes(Z)?`var(--cms-${Z})`:String(Z)},Q=M=>{var q;if(!M)return!1;if(l(M.external)===!0)return!0;const Z=l((q=M.href)!=null?q:M.to);return Z?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Z)):!1},G=M=>M!=null&&M.nodeType&&M.cloneNode?M.cloneNode(!0):M,ie=(M,Z)=>{M.innerHTML="",Z.forEach(q=>M.appendChild(q))},D=(M,Z,q,ue,L=null)=>{const f=JSswift.ui.getSlot(M,Z)!=null?E(M,Z,q,ue):[];return f.length?f:L&&JSswift.ui.getSlot(M,L)!=null?E(M,L,q,ue):E(null,"default",q,ue)},$=(M,Z,q)=>{const ue=l(M);return ue==null||ue===!1||ue===""?null:typeof ue=="string"?he.Icon({name:ue,size:Z}):JSswift.ui.slot(ue,{as:q})},Y=()=>{var L,f;const M=r?r.get():l((f=(L=e.items)!=null?L:e.value)!=null?f:e.breadcrumbs),Z=[],q=m=>{if(!(m==null||m===!1)){if(Array.isArray(m)){m.forEach(q);return}if(typeof m=="string"||typeof m=="number"){Z.push({label:String(m)});return}if(m!=null&&m.nodeType||typeof m=="function"){Z.push({label:m});return}Z.push(m)}},ue=l(e.home);return ue&&q(ue===!0?{label:"Home",to:"/",icon:"home"}:ue),q(M),!Z.length&&(n!=null&&n.length)&&n.forEach(m=>q(m)),Z.filter(m=>!l(m==null?void 0:m.hidden))},W=M=>{const Z=M.findIndex(q=>{var ue,L;return!!l((L=(ue=q==null?void 0:q.current)!=null?ue:q==null?void 0:q.active)!=null?L:q==null?void 0:q.selected)});return Z>-1?Z:l(e.autoCurrent)===!1?-1:M.length?M.length-1:-1},le=M=>{var g,F,X,a,C,h,J;const Z=Number(l((X=(F=(g=e.max)!=null?g:e.maxItems)!=null?F:e.collapseAfter)!=null?X:e.collapse)),q=Number.isFinite(Z)?Math.max(0,Math.trunc(Z)):0;if(!q||q<3||M.length<=q)return M.map((j,U)=>({type:"item",item:j,index:U,key:`item-${U}`}));let ue=Number(l((C=(a=e.leadingCount)!=null?a:e.keepStart)!=null?C:1)),L=Number(l((J=(h=e.trailingCount)!=null?h:e.keepEnd)!=null?J:Math.max(1,q-2)));if(ue=Number.isFinite(ue)?Math.max(1,Math.trunc(ue)):1,L=Number.isFinite(L)?Math.max(1,Math.trunc(L)):Math.max(1,q-2),ue+L+1>q&&(L=Math.max(1,q-ue-1),ue+L+1>q&&(ue=Math.max(1,q-L-1))),ue+L>=M.length)return M.map((j,U)=>({type:"item",item:j,index:U,key:`item-${U}`}));const f=[];for(let j=0;j<ue;j++)f.push({type:"item",item:M[j],index:j,key:`item-${j}`});const m=M.slice(ue,M.length-L);f.push({type:"collapsed",key:`collapsed-${ue}-${M.length-L}`,items:m,from:ue,to:M.length-L-1});for(let j=M.length-L;j<M.length;j++)f.push({type:"item",item:M[j],index:j,key:`item-${j}`});return f},me=(M,Z=null)=>{var L,f,m,g,F;if(!M)return!1;const q=l((L=M.href)!=null?L:M.to)||"",ue=l(M.to)||"";return!Q(M)&&ue&&(o!=null&&o.navigate)?(Z!=null&&Z.preventDefault&&Z.preventDefault(),o.navigate(ue),(f=M.onNavigate)==null||f.call(M,ue,Z||null),(m=e.onNavigate)==null||m.call(e,ue,M,Z||null),!0):((g=M.onNavigate)==null||g.call(M,ue||q,Z||null),(F=e.onNavigate)==null||F.call(e,ue||q,M,Z||null),!1)},re=(M,Z,q)=>{var F,X,a;const ue=M,L=q[Z+1]||null,f={index:Z,entry:M,previous:ue,next:L},m=G(l((a=(X=(M==null?void 0:M.type)==="item"?(F=M.item)==null?void 0:F.separator:null)!=null?X:e.separator)!=null?a:"/")),g=D(s,"separator",f,m);return _.li({class:"cms-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"cms-breadcrumbs-separator"},...g))},oe=(M,Z,q)=>{const ue={type:"collapsed",collapsed:!0,items:Z,hiddenItems:M.items,currentIndex:q,from:M.from,to:M.to},L=_.span({class:"cms-breadcrumb cms-breadcrumb-collapsed"},_.span({class:"cms-breadcrumb-inner"},_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},String(l(e.collapsedLabel)||"\u2026"))))),f=D(s,"collapsed",ue,L,"item");return _.li({class:"cms-breadcrumbs-entry is-collapsed"},...f)},se=(M,Z,q,ue)=>{var ee,xe,be,Ce,pe,Ie,_e,z,we,T,x,w,c,A,de,Le,Je,B,Ae,Me,Ee,De,Ue,Ye,Ze,Qe;const L=M.item||{},f=L.slots?{...s,...L.slots}:s,m=l((ee=L.href)!=null?ee:L.to)||"",g=!!l(L.disabled),F=M.index===q,X=(Ce=(be=(xe=L.iconSize)!=null?xe:e.itemSize)!=null?be:e.size)!=null?Ce:null,a=P((_e=(Ie=(pe=L.color)!=null?pe:L.state)!=null?Ie:e.color)!=null?_e:e.state),C=!l(L.color)&&l(L.state)?mt(l(L.state)):"",h=(w=(x=(T=(we=(z=L.label)!=null?z:L.title)!=null?we:L.text)!=null?T:L.to)!=null?x:L.href)!=null?w:"",J=(de=(A=(c=L.note)!=null?c:L.subtitle)!=null?A:L.caption)!=null?de:L.description,j=(Je=(Le=L.badge)!=null?Le:L.counter)!=null?Je:L.count,U=(Ae=(B=L.aside)!=null?B:L.trailing)!=null?Ae:$(L.iconRight,X,"iconRight"),ce=(Me=L.content)!=null?Me:L.body,k={item:L,index:M.index,visibleIndex:ue,total:Z.length,current:F,active:F,disabled:g,href:m,to:l(L.to)||"",external:Q(L),isFirst:M.index===0,isLast:M.index===Z.length-1,navigate:Te=>me(L,Te)},d=D(f,"icon",k,$(L.icon,X,"icon")),N=D(f,"label",k,h),I=D(f,"note",k,J),H=D(f,"badge",k,j),ge=D(f,"aside",k,U),Se=D(f,"default",k,ce),ye=_.span({class:"cms-breadcrumb-inner"},d.length?_.span({class:"cms-breadcrumb-icon"},...d):null,_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},...N.length?N:[m||""]),I.length?_.span({class:"cms-breadcrumb-note"},...I):null,Se.length?_.span({class:"cms-breadcrumb-extra"},...Se):null),H.length?_.span({class:"cms-breadcrumb-badge"},...H):null,ge.length?_.span({class:"cms-breadcrumb-aside"},...ge):null),V=!g&&(!F||!!l((Ee=L.linkCurrent)!=null?Ee:e.linkCurrent)),O={class:ae(["cms-breadcrumb","cms-clear-set","cms-singularity",fe(F,"is-current"),fe(F,"active"),fe(g,"is-disabled"),C?`cms-state-${C}`:"",L.class]),style:{...L.style||{}},"aria-current":F?String(l((De=L.ariaCurrent)!=null?De:e.ariaCurrent)||"page"):null};a&&(O.style["--cms-breadcrumb-accent"]=a);let K=null;V&&m?(K=_.a({...O,href:m,target:L.target,rel:L.rel,onClick:Te=>{var je,tt;(je=L.onClick)==null||je.call(L,Te,k),(tt=e.onItemClick)==null||tt.call(e,L,k,Te),!Te.defaultPrevented&&k.navigate(Te)}},ye),k.external&&K.target==="_blank"&&!K.rel&&(K.rel="noopener noreferrer")):V&&typeof L.onClick=="function"?K=_.button({...O,type:L.type||"button",onClick:Te=>{var je,tt;(je=L.onClick)==null||je.call(L,Te,k),(tt=e.onItemClick)==null||tt.call(e,L,k,Te)}},ye):K=_.span({...O,"aria-disabled":g?"true":null},ye),Ke(K,{size:(Ye=(Ue=L.size)!=null?Ue:e.itemSize)!=null?Ye:e.size,radius:(Ze=L.radius)!=null?Ze:e.radius,gradient:(Qe=L.gradient)!=null?Qe:e.gradient});const Ne=D(f,"item",k,K);return _.li({class:ae(["cms-breadcrumbs-entry",fe(F,"is-current"),fe(g,"is-disabled")])},...Ne)},te=()=>{var f;const M=Y(),Z=W(M),q=le(M),ue=P((f=e.color)!=null?f:e.state);b.classList.toggle("is-empty",M.length===0),ue?b.style.setProperty("--cms-breadcrumb-accent",ue):b.style.removeProperty("--cms-breadcrumb-accent");const L={items:M,visibleItems:q,currentIndex:Z,count:M.length,collapsed:q.some(m=>m.type==="collapsed")};if(ie(R,D(s,"before",L,e.before)),ie(y,D(s,"after",L,e.after)),S.innerHTML="",!M.length){const m=D(s,"empty",L,e.empty);m.length&&S.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...m));return}q.forEach((m,g)=>{g>0&&S.appendChild(re(q[g-1],g-1,q)),S.appendChild(m.type==="collapsed"?oe(m,M,Z):se(m,M,Z,g))})};return He.reactive.effect(()=>{te()},"UI.Breadcrumbs:render"),b.getItems=()=>Y(),b.getVisibleItems=()=>le(Y()),b.refresh=()=>(te(),b),b.setItems=M=>(r?r.set(M):e.items=M,te(),b),Ke(b,e),b},he.Pagination=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=e.slots||{},s=Nt(e.model,"UI.Pagination:model"),o=qe(e.size,()=>{const a=l(e.size);return typeof a=="string"&&kn[a]?`cms-size-${a}`:""}),r=_.nav({class:ae(["cms-pagination","cms-clear-set",o,fe(e.dense,"dense"),fe(e.simple,"is-simple"),fe(e.disabled,"is-disabled"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Pagination"}),v=_.div({class:"cms-pagination-controls"}),u=_.div({class:"cms-pagination-start"}),i=_.div({class:"cms-pagination-pages"}),b=_.div({class:"cms-pagination-end"}),R=_.div({class:"cms-pagination-summary"});v.appendChild(u),v.appendChild(i),v.appendChild(b),r.appendChild(v),r.appendChild(R);let S=1,y=1;const P=(a,C=0)=>{const h=l(a);if(h==null||h==="")return C;const J=Number(h);return Number.isFinite(J)?Math.trunc(J):C},Q=(a,C=G())=>{const h=Number(a),J=Number.isFinite(h)?Math.trunc(h):1;return Math.min(Math.max(J||1,1),Math.max(1,C||1))},G=()=>{var J,j,U,ce,k,d,N;const a=P((U=(j=(J=e.max)!=null?J:e.pages)!=null?j:e.pageCount)!=null?U:e.totalPages,0);if(a>0)return a;const C=P((k=(ce=e.total)!=null?ce:e.totalItems)!=null?k:e.count,0),h=P((N=(d=e.pageSize)!=null?d:e.perPage)!=null?N:e.limit,0);return C>=0&&h>0?Math.max(1,Math.ceil(C/h)):1},ie=()=>{var a,C,h;return P(s?s.get():(h=(C=(a=e.page)!=null?a:e.value)!=null?C:e.current)!=null?h:e.currentPage,1)},D=()=>{var a,C;return Math.max(0,P((C=(a=e.siblings)!=null?a:e.siblingCount)!=null?C:e.window,1))},$=()=>{var a,C;return Math.max(0,P((C=(a=e.boundaryCount)!=null?a:e.boundaries)!=null?C:e.edges,1))},Y=()=>!!l(e.disabled),W=()=>{var a;return l((a=e.showSummary)!=null?a:e.showLabel)!==!1},le=()=>l(e.showPages)!==!1&&!l(e.simple),me=()=>l(e.showPrev)!==!1,re=()=>l(e.showNext)!==!1,oe=()=>!!l(e.showEdges),se=()=>{const a=l(e.showFirst);return a==null?oe():!!a},te=()=>{const a=l(e.showLast);return a==null?oe():!!a},M=()=>!!l(e.hideOnSinglePage),Z=()=>{var h,J;const a=l((J=(h=e.total)!=null?h:e.totalItems)!=null?J:e.count);if(a==null||a==="")return null;const C=Number(a);return Number.isFinite(C)?Math.max(0,Math.trunc(C)):null},q=()=>{var h,J;const a=l((J=(h=e.pageSize)!=null?h:e.perPage)!=null?J:e.limit);if(a==null||a==="")return null;const C=Number(a);return Number.isFinite(C)&&C>0?Math.trunc(C):null},ue=(a=S,C=y)=>{const h=Z(),J=q(),j=h!=null&&J?h===0?0:(a-1)*J+1:null,U=h!=null&&J?Math.min(h,a*J):null;return{page:a,value:a,current:a,currentPage:a,pages:C,max:C,total:h,pageSize:J,from:j,to:U,disabled:Y(),isFirst:a<=1,isLast:a>=C,canPrev:a>1,canNext:a<C,setPage:(ce,k)=>X(ce,k),prev:ce=>X(a-1,ce),next:ce=>X(a+1,ce),first:ce=>X(1,ce),last:ce=>X(C,ce)}},L=(a,C)=>{if(C<=0)return[];const h=[],J=new Set,j=$(),U=D();for(let k=1;k<=Math.min(j,C);k++)J.add(k);for(let k=Math.max(1,a-U);k<=Math.min(C,a+U);k++)J.add(k);for(let k=Math.max(1,C-j+1);k<=C;k++)J.add(k);let ce=0;for(let k=1;k<=C;k++)J.has(k)&&(ce&&k-ce>1&&h.push({type:"ellipsis",key:`ellipsis-${ce}-${k}`}),h.push({type:"page",page:k,key:`page-${k}`}),ce=k);return h.length||h.push({type:"page",page:1,key:"page-1"}),h},f=(a,C,h,J=null)=>{const j=JSswift.ui.getSlot(n,a)!=null?E(n,a,h,C):[];return j.length?j:J&&JSswift.ui.getSlot(n,J)!=null?E(n,J,h,C):E(null,"default",h,C)},m=(a,C)=>{a.innerHTML="",C.forEach(h=>a.appendChild(h))},g=(a,C,h,J={})=>{var U;const j={...ue(),kind:a,active:!!J.active};return he.Btn({class:ae(["cms-pagination-btn",`cms-pagination-${a}`,fe(J.active,"active"),J.class]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:J.active?e.color||e.state||"primary":J.color||null,outline:J.active?!1:(U=J.outline)!=null?U:!0,disabled:Y()||!!J.disabled,"aria-current":J.active?"page":null,onClick:ce=>{Y()||J.disabled||h==null||h(ce)}},...f(a,C,j,a==="summary"?"label":a==="page"?"item":null))},F=(a,C)=>{S=Q(a,C),y=Math.max(1,C||1);const h=ue(S,y);r.style.display=M()&&y<=1?"none":"",R.style.display=W()?"":"none",i.style.display=le()?"":"none",u.innerHTML="",i.innerHTML="",b.innerHTML="";const J=f("start",e.start,h);J.length&&u.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-start"},...J)),se()&&u.appendChild(g("first","\xAB",ce=>X(1,ce),{disabled:S<=1})),me()&&u.appendChild(g("prev","Prev",ce=>X(S-1,ce),{disabled:S<=1})),le()&&L(S,y).forEach(ce=>{if(ce.type==="ellipsis"){const N={...h,kind:"ellipsis"},I=f("ellipsis","\u2026",N);i.appendChild(_.span({class:"cms-pagination-ellipsis","aria-hidden":"true"},...I));return}const k=ce.page,d={...h,page:k,value:k,item:ce,active:k===S};i.appendChild(he.Btn({class:ae(["cms-pagination-btn","cms-pagination-page-btn",fe(k===S,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:k===S?e.color||e.state||"primary":null,outline:k!==S,disabled:Y(),"aria-current":k===S?"page":null,onClick:N=>X(k,N)},...f("page",String(k),d,"item")))}),re()&&b.appendChild(g("next","Next",ce=>X(S+1,ce),{disabled:S>=y})),te()&&b.appendChild(g("last","\xBB",ce=>X(y,ce),{disabled:S>=y}));const j=f("end",e.end,h);j.length&&b.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...j));let U=`Pagina ${S} di ${y}`;h.total!=null&&h.pageSize&&(U=h.total===0?"0 risultati":`${h.from}-${h.to} di ${h.total}`),m(R,f("summary",U,h,"label"))},X=(a,C=null)=>{var j,U;const h=G(),J=Q(a,h);return J===S&&h===y||(F(J,h),s&&s.get()!==J&&s.set(J),(j=e.onChange)==null||j.call(e,J,ue(J,h),C),(U=e.onPageChange)==null||U.call(e,J,ue(J,h),C)),J};return He.reactive.effect(()=>{const a=G(),C=ie(),h=Q(C,a);F(h,a),s&&C!==h&&s.set(h)},"UI.Pagination:sync"),r.getPage=()=>S,r.getPages=()=>y,r.setPage=a=>X(a),r.prev=()=>X(S-1),r.next=()=>X(S+1),r.first=()=>X(1),r.last=()=>X(y),Ke(r,e),r},he.Spinner=(...t)=>{var Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(W,le,me)=>{if(at(W))return()=>{const oe=l(W);if(oe==null||oe===!1||oe==="")return me;const se=le?le(oe):oe;return se==null||se===""?me:se};if(W==null||W===!1||W==="")return me;const re=le?le(W):W;return re==null||re===""?me:re},r=W=>{if(W==null||W===!1||W===""||mt(W))return"";const me=String(W).trim();return me?me.startsWith("#")||me.startsWith("rgb(")||me.startsWith("rgba(")||me.startsWith("hsl(")||me.startsWith("hsla(")||me.startsWith("var(")?me:Qt(me)?`var(--cms-${me})`:me:""},v=qe(e.state,()=>{const W=mt(l(e.state));return W?`cms-state-${W}`:""}),u=ae(["cms-spinner",v,fe(e.vertical,"vertical"),fe(e.reverse,"reverse"),fe(e.center,"center"),fe(e.block,"block"),fe(e.pause||e.paused,"paused"),e.class]),i=JSswift.omit(e,["ariaLabel","block","center","color","indicatorClass","indicatorStyle","label","note","pause","paused","reverse","size","slots","speed","state","thickness","trackColor","vertical"]);i.class=u;const b={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(b,"backgroundColor")&&delete b.backgroundColor,i.style=b,i.role==null&&(i.role="status"),i["aria-live"]==null&&(i["aria-live"]="polite"),i["aria-busy"]==null&&(i["aria-busy"]="true");const R={props:e},S=E(s,"label",R,e.label),y=E(s,"default",R,n),P=E(s,"note",R,e.note),Q=S.length||y.length||P.length;if(!Q){const W=l((Y=e.ariaLabel)!=null?Y:e["aria-label"]);W?i["aria-label"]=W:i["aria-label"]==null&&(i["aria-label"]="Loading")}const G=_.span({class:ae(["cms-spinner-indicator",e.indicatorClass]),style:{"--cms-spinner-size":o(e.size,Be,"18px"),"--cms-spinner-thickness":o(e.thickness,Be,"2px"),"--cms-spinner-speed":o(e.speed,W=>typeof W=="number"?`${W}ms`:String(W),"900ms"),"--cms-spinner-color":o(e.color,r,"var(--set-border-color, var(--cms-primary))"),"--cms-spinner-track":o(e.trackColor,r,"color-mix(in srgb, var(--cms-spinner-color) 18%, transparent)"),...e.indicatorStyle||{}},"aria-hidden":"true"}),ie=E(s,"indicator",R,G),D=[];ie.length&&D.push(...ie),Q&&D.push(_.div({class:"cms-spinner-content"},S.length?_.div({class:"cms-spinner-label"},...S):null,y.length?_.div({class:"cms-spinner-copy"},...y):null,P.length?_.div({class:"cms-spinner-note"},...P):null));const $=_.div(i,...D);return Ke($,e),$},he.Progress=(...t)=>{var I,H,ge,Se,ye,V,O,K,ke,Ne;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=e.model||(At(e.value)||Jt(e.value)?e.value:null),r=Nt(o,"UI.Progress:model"),v=qe([e.state,e.color],()=>{const ee=mt(l(e.state)||l(e.color));return ee?`cms-state-${ee}`:""}),u=(ee,xe)=>{const be=Number(ee);return Number.isFinite(be)?be:xe},i=()=>u(l(e.min),0),b=()=>{const ee=i(),xe=u(l(e.max),100);return xe<ee?ee:xe},R=()=>{var xe,be;const ee=l((be=(xe=e.height)!=null?xe:e.thickness)!=null?be:e.size);return ee==null||ee===""?"8px":typeof ee=="number"?`${ee}px`:typeof ee=="string"?{xxs:"4px",xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px",xxl:"16px",xxxl:"18px"}[ee]||ee:"8px"},S=(ee,xe="")=>{const be=l(ee);if(be==null||be===!1||be==="")return xe;const Ce=mt(be);return Ce?`var(--cms-${Ce})`:typeof be=="string"&&Qt(be)?`var(--cms-${be})`:String(be)},y=ee=>{const xe=i(),be=b(),Ce=u(ee,xe);return Math.min(be,Math.max(xe,Ce))},P=ee=>{const xe=i(),Ce=b()-xe;if(!Ce)return 0;const pe=(y(ee)-xe)/Ce,Ie=l(e.reverse)?1-pe:pe;return Math.max(0,Math.min(1,Ie))},Q=ee=>{const xe=y(ee);return xe<le()?le():xe},G=(ee,xe,be)=>{const Ce=e.formatValue;if(typeof Ce=="function"){const pe=Ce(ee,xe,be);if(pe!=null)return pe}return`${Math.round(xe)}%`},ie=ee=>{for(;ee.firstChild;)ee.removeChild(ee.firstChild)},D=(ee,xe,be="flex")=>{ie(ee),(xe||[]).forEach(Ce=>{if(!(Ce==null||Ce===!1)){if(Ce instanceof Node){ee.appendChild(Ce);return}ee.appendChild(document.createTextNode(String(Ce)))}}),ee.style.display=ee.childNodes.length?be:"none"},$=(ee,xe={})=>An(l(ee),xe),Y=(ee,xe,be={})=>{var pe;const Ce=l(ee);return Ce==null||Ce===!1||Ce===""?[]:typeof Ce=="string"?[he.Icon({name:Ce,size:(pe=e.iconSize)!=null?pe:16})]:$(Ce,{...be,as:xe})},W=ee=>Jt(ee)||At(ee)?l(ee):typeof ee=="function"&&ee.length===0?ee():ee,[le,me]=JSswift.reactive.signal(y(r?r.get():(H=(I=l(e.value))!=null?I:l(e.min))!=null?H:0)),[re,oe]=JSswift.reactive.signal(Q((ye=l(e.buffer))!=null?ye:r?r.get():(Se=(ge=l(e.value))!=null?ge:l(e.min))!=null?Se:0)),se=(ee,xe={})=>{const be=y(ee);return le()!==be&&me(be),re()<be&&oe(be),r&&xe.fromModel!==!0&&r.set(be),be},te=ee=>{const xe=Q(ee);return re()!==xe&&oe(xe),xe},M=JSswift.omit(e,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor"]),Z={width:l(e.width)||"100%",...e.style||{}},q=l(e.color);(q!=null||at(e.color))&&!mt(q||"")&&delete Z.backgroundColor,M.class=ae(["cms-progress-wrap",fe(e.dense,"dense"),fe(e.reverse,"is-reverse"),fe(e.indeterminate,"is-indeterminate"),v,e.class]),M.style=Z;const ue=_.div({class:"cms-progress-header"}),L=_.div({class:"cms-progress-heading"}),f=_.div({class:"cms-progress-label"}),m=_.div({class:"cms-progress-note"}),g=_.div({class:"cms-progress-value"});L.append(f,m),ue.append(L,g);const F=_.div({class:"cms-progress-body"}),X=_.span({class:"cms-progress-edge-label cms-progress-edge-label-left"}),a=_.div({class:"cms-progress",role:"progressbar"}),C=_.span({class:"cms-progress-buffer"}),h=_.span({class:ae(["cms-progress-bar","cms-singularity",v,fe(e.outline,"cms-outline"),fe(e.flat,"cms-flat"),fe(e.border,"cms-border"),fe(e.glossy,"cms-glossy"),fe(e.glow,"cms-glow"),fe(e.glass,"cms-glass"),fe(e.shadow,"cms-shadow"),qe(e.shadow,()=>{const ee=Dn(l(e.shadow));return ee?`cms-shadow-${ee}`:""}),fe(e.gradient,"cms-gradient"),fe(e.textGradient,"cms-text-gradient"),fe(e.lightShadow,"cms-light-shadow"),fe(e.striped,"is-striped"),fe(e.animated||e.indeterminate,"is-animated")])}),J=_.span({class:"cms-progress-bar-label"});h.appendChild(J),a.append(C,h);const j=_.span({class:"cms-progress-edge-label cms-progress-edge-label-right"});F.append(X,a,j);const U=_.div(M,ue,F);Ke(h,e);const ce=()=>{const ee=le(),xe=P(ee)*100,be={value:ee,percent:xe,min:i(),max:b(),buffer:re(),progress:U,track:a,bar:h,props:e},Ce=E(s,"icon",be,null),pe=Ce.length?[]:Y(e.icon,"icon",be),Ie=E(s,"label",be,W(e.label)),_e=Ie.length?Ie:E(s,"default",be,n),z=E(s,"iconRight",be,null),we=z.length?[]:Y(e.iconRight,"iconRight",be),T=E(s,"note",be,W(e.note)),x=e.valueLabel!=null?W(e.valueLabel):G(ee,xe,be),w=l(e.showValue),c=w===!0||e.valueLabel!=null||JSswift.ui.getSlot(s,"value")!=null?E(s,"value",be,x):[];D(f,[...pe,...Ce,..._e,...we,...z],"inline-flex"),D(m,T,"block"),D(g,w==="inside"?[]:c,"inline-flex"),ue.style.display=f.childNodes.length||m.childNodes.length||g.childNodes.length?"flex":"none"},k=()=>{var Ie,_e;const ee=le(),xe=P(ee)*100,be={value:ee,percent:xe,min:i(),max:b(),buffer:re(),progress:U,track:a,bar:h,props:e},Ce=W((Ie=e.startLabel)!=null?Ie:e.leftLabel),pe=W((_e=e.endLabel)!=null?_e:e.rightLabel);D(X,E(s,"startLabel",be,Ce),"inline-flex"),D(j,E(s,"endLabel",be,pe),"inline-flex")},d=()=>{const ee=le(),xe=P(ee)*100,be={value:ee,percent:xe,min:i(),max:b(),buffer:re(),progress:U,track:a,bar:h,props:e},Ce=l(e.showValue),pe=e.insideLabel!=null?W(e.insideLabel):G(ee,xe,be),Ie=Ce==="inside"||e.insideLabel!=null||JSswift.ui.getSlot(s,"inside")!=null?E(s,"inside",be,pe):[];D(J,Ie,"inline-flex")},N=()=>{const ee=le(),xe=re(),be=i(),Ce=b(),pe=P(ee)*100,Ie=P(xe)*100,_e=S(e.color,""),z=S(e.trackColor,_e?`color-mix(in srgb, ${_e} 14%, transparent)`:"rgba(255,255,255,0.08)"),we=S(e.bufferColor,_e?`color-mix(in srgb, ${_e} 30%, transparent)`:"rgba(255,255,255,0.16)"),T=l(e.ariaLabel),x=l(e.ariaValueText),w=!!l(e.indeterminate),c=l(e.radius);U.style.width=l(e.width)||"100%",U.style.setProperty("--cms-progress-height",R()),c!=null?typeof c=="number"?U.style.setProperty("--cms-progress-radius",`${c}px`):typeof c=="string"&&JSswift.uiSizes.includes(c)?U.style.setProperty("--cms-progress-radius",`var(--cms-r-${c})`):U.style.setProperty("--cms-progress-radius",String(c)):U.style.removeProperty("--cms-progress-radius"),a.style.background=z,C.style.background=we,C.style.width=`${Ie}%`,_e&&!mt(l(e.state)||l(e.color))?(h.style.setProperty("--set-background-color",_e),h.style.setProperty("--set-border-color",_e),h.style.setProperty("--set-color",l(e.textColor)||"var(--cms-on-primary, #fff)")):mt(l(e.state)||l(e.color))?(h.style.removeProperty("--set-background-color"),h.style.removeProperty("--set-border-color"),h.style.removeProperty("--set-color")):(h.style.setProperty("--set-background-color","var(--cms-primary)"),h.style.setProperty("--set-border-color","var(--cms-primary)"),h.style.setProperty("--set-color",l(e.textColor)||"var(--cms-on-primary, #fff)")),w?(h.style.width="",a.removeAttribute("aria-valuenow"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuemax")):(h.style.width=`${pe}%`,a.setAttribute("aria-valuemin",String(be)),a.setAttribute("aria-valuemax",String(Ce)),a.setAttribute("aria-valuenow",String(ee))),T!=null?a.setAttribute("aria-label",String(T)):typeof l(e.label)=="string"?a.setAttribute("aria-label",String(l(e.label))):a.removeAttribute("aria-label"),x!=null?a.setAttribute("aria-valuetext",String(x)):w?a.removeAttribute("aria-valuetext"):a.setAttribute("aria-valuetext",G(ee,pe,{value:ee,percent:pe,min:be,max:Ce,buffer:xe,progress:U,track:a,bar:h,props:e})),U.classList.toggle("has-start-label",X.childNodes.length>0),U.classList.toggle("has-end-label",j.childNodes.length>0),U.classList.toggle("has-inside-label",J.childNodes.length>0)};return r?(se(r.get(),{fromModel:!0}),r.watch(ee=>{se(ee,{fromModel:!0})},"UI.Progress:watch")):at(e.value)?JSswift.reactive.effect(()=>{se(l(e.value),{fromModel:!0})},"UI.Progress:value"):se((O=(V=e.value)!=null?V:e.min)!=null?O:0,{fromModel:!0}),at(e.buffer)?JSswift.reactive.effect(()=>{te(l(e.buffer))},"UI.Progress:buffer"):te((Ne=(ke=(K=e.buffer)!=null?K:e.value)!=null?ke:e.min)!=null?Ne:0),JSswift.reactive.effect(()=>{ce(),k(),d(),N()},"UI.Progress:render"),U._track=a,U._bar=h,U._buffer=C,U._getValue=le,U._getBuffer=re,U._setValue=ee=>se(ee),U._setBuffer=ee=>te(ee),U},he.LoadingBar=function(...e){var d,N;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),o=(I,H)=>{const ge=Number(I);return Number.isFinite(ge)?ge:H},r=()=>o(l(n.min),0),v=()=>{const I=r(),H=o(l(n.max),100);return H<I?I:H},u=I=>{const H=r(),ge=v(),Se=o(I,H);return Math.min(ge,Math.max(H,Se))},i=(I,H="")=>I==null||I===!1||I===""?H:typeof I=="number"?`${I}px`:String(I),b=I=>{const H=l(I);return!H||H===document?document.body:typeof H=="string"?document.querySelector(H)||document.body:H&&H.body instanceof HTMLElement?H.body:H instanceof HTMLElement?H:document.body},R=n.model||(At(n.value)||Jt(n.value)?n.value:null),S=Nt(R,"UI.LoadingBar:model"),y=At(n.buffer)||Jt(n.buffer)?n.buffer:null,P=Nt(y,"UI.LoadingBar:buffer"),Q=S?S.get():(d=l(n.value))!=null?d:r(),G=P?P.get():(N=l(n.buffer))!=null?N:Q,[ie,D]=JSswift.reactive.signal(u(Q)),[$,Y]=JSswift.reactive.signal(Math.max(u(G),u(Q))),[W,le]=JSswift.reactive.signal(n.visible!=null?!!l(n.visible):u(Q)>r()||!!l(n.indeterminate));let me=null,re=null;const oe=()=>{me&&(clearInterval(me),me=null)},se=()=>{re&&(clearTimeout(re),re=null)},te=(I,H={})=>{const ge=!!I;return W()!==ge&&le(ge),H.fromExternal!==!0&&typeof n.onVisibleChange=="function"&&n.onVisibleChange(ge),ge},M=(I,H={})=>{const ge=u(I);return ie()!==ge&&D(ge),$()<ge&&(Y(ge),P&&H.fromExternal!==!0&&P.set(ge)),S&&H.fromExternal!==!0&&S.set(ge),ge},Z=(I,H={})=>{const ge=Math.max(M(ie(),{fromExternal:!0}),u(I));return $()!==ge&&Y(ge),P&&H.fromExternal!==!0&&P.set(ge),ge},q=(I=ie())=>{n.visible==null&&(l(n.indeterminate)||I>r()?te(!0):l(n.hideOnZero)!==!1&&te(!1))},ue=()=>{if(oe(),l(n.trickle)===!1||l(n.indeterminate))return;const I=o(l(n.trickleInterval),280);I<=0||(me=setInterval(()=>{var ye,V;const H=ie(),ge=u((V=(ye=l(n.trickleTo))!=null?ye:l(n.trickleMax))!=null?V:92);if(H>=ge)return;const Se=o(l(n.trickleStep),H<45?12:H<75?7:3);M(Math.min(ge,H+Se))},I))},L=JSswift.omit(n,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor","target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);L.class=ae(["cms-loading-bar",n.class]),L.style={...n.style||{}};const f=JSswift.omit(n,["target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);f.class=ae(["cms-loading-bar-progress",n.progressClass,f.class]),f.style={...n.progressStyle||{}},f.value=[ie,D],f.buffer=[$,Y],f.dense==null&&(f.dense=!0),f.height==null&&f.thickness==null&&f.size==null&&(f.height=3),f.width==null&&(f.width="100%");const m=_.div(L),g=he.Progress(f,...s);m.appendChild(g);const F=I=>{se();const H=M(I);return q(H),m},X=I=>{se();const H=Z(I);return q(H),m},a=(I=(H=>(H=l(n.step))!=null?H:8)())=>{se();const ge=ie(),Se=M(ge+o(I,0));return q(Se),m},C=(I=(H=>(H=l(n.startValue))!=null?H:12)())=>{se();const ge=Math.max(ie(),u(I));return M(ge),Z(Math.max($(),ge)),q(ge),ue(),m},h=(I=(H=>(H=l(n.resetValue))!=null?H:r())())=>{se(),oe();const ge=u(I);return Z(ge),M(ge),q(ge),m},J=(I=(H=>(H=l(n.doneValue))!=null?H:v())())=>{var ye;se(),oe();const ge=u(I);Z(ge),M(ge),q(ge);const Se=Math.max(0,o((ye=l(n.hideDelay))!=null?ye:l(n.doneDelay),220));return re=setTimeout(()=>{h()},Se),m},j=(...I)=>J(...I),U=()=>(te(!0),m),ce=()=>(se(),oe(),te(!1),m),k=()=>(se(),oe(),m.remove(),null);return m.el=m,m._progress=g,m.get=()=>ie(),m.getBuffer=()=>$(),m.set=F,m.setBuffer=X,m.inc=a,m.start=C,m.done=J,m.complete=J,m.stop=j,m.reset=h,m.show=U,m.hide=ce,m.destroy=k,m._dispose=k,S?S.watch(I=>{M(I,{fromExternal:!0}),q(u(I))},"UI.LoadingBar:watch"):at(n.value)&&JSswift.reactive.effect(()=>{const I=u(l(n.value));M(I,{fromExternal:!0}),q(I)},"UI.LoadingBar:value"),P?P.watch(I=>{Z(I,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):at(n.buffer)&&JSswift.reactive.effect(()=>{Z(l(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const I=r(),H=v(),ge=Math.min(H,Math.max(I,ie())),Se=Math.max(ge,Math.min(H,Math.max(I,$())));ge!==ie()&&D(ge),Se!==$()&&Y(Se)},"UI.LoadingBar:range"),JSswift.reactive.effect(()=>{n.visible!=null&&te(l(n.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),JSswift.reactive.effect(()=>{var Ne;const I=l(n.position)||"fixed",H=l(n.inset),ge=l(n.top),Se=l(n.right),ye=l(n.bottom),V=l(n.left),O=l(n.width),K=n.visible!=null?!!l(n.visible):W(),ke=I==="static"||I==="relative";m.classList.toggle("is-visible",K),m.classList.toggle("is-inline",ke),m.classList.toggle("has-track",!!l(n.trackColor)),m.style.position=I,m.style.zIndex=String((Ne=l(n.zIndex))!=null?Ne:10002),m.style.width=i(O,ke?"100%":""),H!=null&&H!==""?(m.style.inset=i(H),m.style.removeProperty("top"),m.style.removeProperty("right"),m.style.removeProperty("bottom"),m.style.removeProperty("left")):(m.style.removeProperty("inset"),!ke&&I!=="sticky"?(m.style.top=i(ge,"0px"),m.style.right=i(Se,O==null||O===""?"0px":""),m.style.bottom=i(ye,""),m.style.left=i(V,"0px")):(m.style.top=i(ge,""),m.style.right=i(Se,""),m.style.bottom=i(ye,""),m.style.left=i(V,"")))},"UI.LoadingBar:layout"),Ke(m,n),l(n.mount)!==!1&&b(n.target).appendChild(m),l(n.autoStart)&&C(),m};const dl=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),Do=new Set(["soft","solid","outline"]),$o={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},Vo={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},fl=t=>{const e=String(l(t)||"").trim().toLowerCase();return e?dl.has(e)?e:e==="top"?"top-right":e==="bottom"?"bottom-right":e==="left"?"bottom-left":e==="right"?"bottom-right":e==="center"?"bottom-center":"bottom-right":"bottom-right"},Bo=t=>{const e=String(l(t)||"").trim().toLowerCase();return Do.has(e)?e:"soft"},Ho=(t,e)=>{const n=l(t);if(n===!1||n===null)return 0;if(n===!0||n===""||n===void 0)return e==="danger"?3500:2500;const s=Number(n);return Number.isFinite(s)&&s>=0?s:e==="danger"?3500:2500},Gt=(t={},e="")=>{var u,i,b,R,S,y,P,Q,G,ie,D,$,Y,W;const n=ln(t)?{...t}:{message:t},s=mt(l(e)||l(n.type)||l(n.state)||l(n.color)||"info")||"info",o=Ho((i=(u=n.timeout)!=null?u:n.duration)!=null?i:n.delay,s),r=(S=(R=(b=n.closable)!=null?b:n.dismissible)!=null?R:n.dismiss!=null)!=null?S:o===0,v=n.title===void 0?n.label===void 0?$o[s]:n.label:n.title;return{...n,type:s,state:s,title:v,message:(Q=(P=(y=n.message)!=null?y:n.content)!=null?P:n.text)!=null?Q:null,description:(D=(ie=(G=n.description)!=null?G:n.subtitle)!=null?ie:n.note)!=null?D:null,meta:(Y=($=n.meta)!=null?$:n.caption)!=null?Y:null,body:(W=n.body)!=null?W:null,timeout:o,closable:!!r,dismissLabel:n.dismissLabel||n.closeLabel||"Chiudi notifica",position:fl(n.position),variant:Bo(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},ml=(t,e="",n="")=>{if(!t.length)return Gt(n?{type:e,title:n}:{type:e});if(ln(t[0])){const{props:u,children:i}=JSswift.uiNormalizeArgs(t),b={...u};return!b.type&&!b.state&&!b.color&&e&&(b.type=e),b.title==null&&n&&(b.title=n),i.length&&(b.message==null&&b.description==null&&b.body==null&&i.length===1?b.message=i[0]:b.body==null&&(b.body=i.length===1?i[0]:i)),Gt(b,e)}const[s,o,r]=t;let v={};return ln(o)?v={...o,message:s}:ln(r)?v={...r,message:s,title:o}:v={message:s,title:o},e&&!v.type&&!v.state&&!v.color&&(v.type=e),v.title==null&&n&&(v.title=n),Gt(v,e)},Rt=(t,e)=>(...n)=>{var s,o;return(o=(s=He.services.notify)==null?void 0:s.show)==null?void 0:o.call(s,ml(n,t,e))},Un=(t,e,n)=>{if(t===!1)return!1;if(typeof t=="function"){const s=t();return Un(s,e,n)}return ln(t)?t:t!=null?{message:t,title:n}:{message:e,title:n}};he.Notify=(...t)=>{var e,n;return(n=(e=He.services.notify)==null?void 0:e.show)==null?void 0:n.call(e,ml(t))},he.Notify.show=he.Notify,he.Notify.success=Rt("success","Success"),he.Notify.error=Rt("danger","Error"),he.Notify.warning=Rt("warning","Warning"),he.Notify.info=Rt("info","Info"),he.Notify.primary=Rt("primary","Notice"),he.Notify.secondary=Rt("secondary","Notice"),he.Notify.remove=t=>{var e,n;return(n=(e=He.services.notify)==null?void 0:e.remove)==null?void 0:n.call(e,t)},he.Notify.clear=()=>{var t,e;return(e=(t=He.services.notify)==null?void 0:t.clear)==null?void 0:e.call(t)},he.Notify.update=(t,e={})=>{var n,s;return(s=(n=He.services.notify)==null?void 0:n.update)==null?void 0:s.call(n,t,e)},he.Notify.promise=async(t,e={})=>{var o,r,v,u,i,b,R,S,y,P,Q,G,ie,D;const n=e.loading===!1?!1:Un(typeof e.loading=="function"?()=>e.loading():e.loading,"Operazione in corso...","In corso"),s=n===!1?null:(r=(o=He.services.notify)==null?void 0:o.show)==null?void 0:r.call(o,Gt({type:"info",timeout:0,closable:!1,...n},"info"));try{const Y=await(typeof t=="function"?t():t),W=Un(typeof e.success=="function"?()=>e.success(Y):e.success,"Operazione completata con successo.","Completato");return W!==!1?s!=null?(u=(v=He.services.notify)==null?void 0:v.update)==null||u.call(v,s,Gt(W,"success")):(b=(i=He.services.notify)==null?void 0:i.show)==null||b.call(i,Gt(W,"success")):s!=null&&((S=(R=He.services.notify)==null?void 0:R.remove)==null||S.call(R,s)),Y}catch($){const Y=Un(typeof e.error=="function"?()=>e.error($):e.error,($==null?void 0:$.message)||"Operazione fallita.","Errore");throw Y!==!1?s!=null?(P=(y=He.services.notify)==null?void 0:y.update)==null||P.call(y,s,Gt(Y,"danger")):(G=(Q=He.services.notify)==null?void 0:Q.show)==null||G.call(Q,Gt(Y,"danger")):s!=null&&((D=(ie=He.services.notify)==null?void 0:ie.remove)==null||D.call(ie,s)),$}},he.Header=(...t)=>{var C,h,J,j,U,ce,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e};Yt(o);const r=d=>Object.prototype.hasOwnProperty.call(e,d),v=(C=e.drawerStateKey)!=null?C:qt;v&&(qt=v,Et=en(v));const u=()=>en(v),i=()=>Wt(!0,v),b=()=>Wt(!1,v),R=()=>Wt(!u(),v),S={props:e,stateKey:v,isDrawerOpen:u,openDrawer:i,closeDrawer:b,toggleDrawer:R,toggleAside:R},y=(d,N)=>{if(!(N==null||N===!1)){if(Array.isArray(N)){N.forEach(I=>y(d,I));return}if(N!=null&&N.nodeType){d.appendChild(N);return}d.appendChild(document.createTextNode(String(N)))}},P=(d,N,I=H=>H)=>{const H=JSswift.ui.getSlot(s,d);if(H!=null)return E(s,d,S,null);if(typeof N=="function"){const ge=new Set(["eyebrow","title","subtitle"]),Se=_[ge.has(d)?"span":"div"]({class:`cms-header-slot-${d}`});return JSswift.reactive.effect(()=>{const ye=I(N(S)),V=on(JSswift.ui.slot(ye));Se.replaceChildren(),Array.isArray(V)?V.forEach(O=>y(Se,O)):y(Se,V)},`UI.Header:${d}`),[Se]}return E(s,d,S,I(N))},Q=(d,N="icon",I=e.iconSize||e.size||"md")=>d==null||d===!1?null:typeof d=="string"?he.Icon({name:d,size:I}):JSswift.ui.slot(d,{as:N}),G=d=>{var I,H;const N=d?(I=e.drawerOpenIcon)!=null?I:"\u2715":(H=e.drawerCloseIcon)!=null?H:"\u2630";return N==null||N===!1?null:typeof N=="string"?N:JSswift.ui.slot(N,{as:d?"drawerOpenIcon":"drawerCloseIcon"})},ie=_.span({class:"cms-header-toggle-icon"}),D=d=>{const N=E(null,"default",S,G(d));ie.replaceChildren(...N.length?N:[""])};D(u());const $=he.Btn({class:"cms-header-toggle",outline:!0,size:(J=(h=e.toggleSize)!=null?h:e.size)!=null?J:"sm",onClick:R,"aria-label":e.toggleLabel||"Toggle navigation"},ie);e.left==null&&e.left!==!1&&!JSswift.ui.getSlot(s,"left")&&il.add({update:D});const Y=e.left===!1?null:e.left!=null?e.left:$,W=r("title")?e.title:(j=e.label)!=null?j:"App",le=(ce=(U=e.subtitle)!=null?U:e.description)!=null?ce:"",me=r("right")?e.right:e.end,re=r("content")?e.content:r("body")?e.body:n!=null&&n.length?n:null,oe=[...P("left",Y),...P("start",null)],se=P("icon",e.icon,Q),te=P("eyebrow",(k=e.eyebrow)!=null?k:e.kicker),M=P("title",W),Z=P("subtitle",le),q=P("meta",e.meta),ue=(()=>{const d=P("content",null);return d.length?d:P("default",re)})(),L=[...P("center",null),...P("body",null)],f=[...P("right",me),...P("end",null)],m=P("actions",e.actions),g=_.div({class:ae(["cms-header-body",e.bodyClass,e.centerClass])},_.div({class:"cms-header-heading"},se.length?_.div({class:"cms-header-icon"},...se):null,_.div({class:"cms-header-copy"},te.length?_.div({class:ae(["cms-header-eyebrow",e.eyebrowClass])},...te):null,M.length?_.div({class:ae(["cms-header-title",e.titleClass])},...M):null,Z.length?_.div({class:ae(["cms-header-subtitle",e.subtitleClass])},...Z):null,ue.length?_.div({class:ae(["cms-header-content",e.contentClass])},...ue):null),q.length?_.div({class:ae(["cms-header-meta",e.metaClass])},...q):null)),F=[...f,...m.length?[_.div({class:ae(["cms-header-actions",e.actionsClass])},...m)]:[]],X=JSswift.omit(o,["actions","actionsClass","body","bodyClass","centerClass","content","contentClass","description","divider","drawerCloseIcon","drawerOpenIcon","drawerStateKey","elevated","end","eyebrow","eyebrowClass","icon","iconSize","kicker","label","left","meta","metaClass","right","slots","stack","sticky","subtitle","subtitleClass","title","titleClass","toggleLabel","toggleSize","gap","minHeight","startClass","endClass"]);X.class=ae(["cms-panel","cms-header","cms-singularity",fe(e.sticky!==!1,"sticky"),fe(e.stack,"stack"),fe(e.elevated,"elevated"),fe(e.divider!==!1,"divider"),o.class]),X.style={...o.style||{}},e.gap!=null&&(X.style["--cms-header-gap"]=Be(l(e.gap))),e.minHeight!=null&&(X.style.minHeight=Be(l(e.minHeight)));const a=_.div(X,...oe.length?[_.div({class:ae(["cms-header-start",e.startClass])},...oe)]:[],_.div({class:"cms-header-main"},...L.length?[_.div({class:ae(["cms-header-body",e.bodyClass,e.centerClass])},...L)]:[g],...F.length?[_.div({class:ae(["cms-header-end",e.endClass])},...F)]:[]));return Ke(a,e),a},he.Drawer=(...t)=>{var be,Ce,pe,Ie,_e,z,we,T,x,w;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e},r=c=>Object.prototype.hasOwnProperty.call(e,c),v=(be=e.stateKey)!=null?be:qt;v&&(qt=v,Et=en(v));const u=()=>en(v),i=()=>Wt(!0,v),b=()=>Wt(!1,v),R=()=>Wt(!u(),v),S={props:e,stateKey:v,isDrawerOpen:u,openDrawer:i,closeDrawer:b,toggleDrawer:R,toggleAside:R},y=JSswift==null?void 0:JSswift.store,P=!!(y!=null&&y.get&&(y!=null&&y.set)),Q=`${v}:groups`,G=`${v}:active`;let ie=P?y.get(Q,{})||{}:{},D=P&&(Ce=y.get(G,null))!=null?Ce:null;const $=new Map,Y=new Map,W=c=>{const A=l(c);return A==null||A===!1?[]:Array.isArray(A)?A.flat(1/0):[A]},le=(c,A,de=S)=>{const Le=Array.isArray(c)?c:[c];for(const Je of Le)if(JSswift.ui.getSlot(s,Je)!=null)return E(s,Je,de,A);return A==null?[]:E(null,"default",de,l(A))},me=c=>(Array.isArray(c)?c:[c]).some(de=>JSswift.ui.getSlot(s,de)!=null),re=c=>{if(typeof l(c.external)=="boolean")return!!l(c.external);const A=l(c.href||c.to||c.link||"");return/^(https?:)?\/\//.test(A)},oe=(pe=e.closeOnSelect)!=null?pe:!0,se=c=>!!oe&&l(c.keepOpen)!==!0,te=(_e=(Ie=e.itemIconSize)!=null?Ie:e.size)!=null?_e:"md",M=(z=e.groupOpenIcon)!=null?z:"arrow_drop_up",Z=(we=e.groupCloseIcon)!=null?we:"arrow_drop_down",q=c=>!!c&&D===c,ue=c=>!!c&&!!D&&(D===c||D.startsWith(`${c}::`)),L=()=>{$.forEach(({el:c,baseActive:A},de)=>{const Le=!!A||q(de);c.classList.toggle("active",Le),Le?c.setAttribute("aria-current","page"):c.removeAttribute("aria-current")}),Y.forEach(({wrap:c,toggle:A,baseActive:de},Le)=>{const Je=!!de||ue(Le);c.classList.toggle("active",Je),A.classList.toggle("active",Je)})},f=c=>{D=c||null,P&&y.set(G,D),L()},m=(c,A)=>{if(l(c.active)!=null)return!!l(c.active);if(l(c.current)!=null)return!!l(c.current);if(!A||re(c))return!1;try{if(A.startsWith("#"))return window.location.hash===A;const de=`${window.location.pathname}${window.location.search}${window.location.hash}`;return A===de||A===window.location.pathname}catch(de){return!1}},g=(c,A,de)=>m(c,A)||q(de),F=(c=[],A=0,de=[])=>W(c).some((Le,Je)=>{var Ye,Ze,Qe,Te,je;const B=l(Le);if(!B||typeof B!="object"||B.nodeType)return!1;const Ae=l(B.href||B.to||B.link||""),Me=(je=l((Te=(Qe=(Ze=(Ye=B.label)!=null?Ye:B.title)!=null?Ze:B.text)!=null?Qe:Ae)!=null?Te:null))!=null?je:`item-${A}-${Je}`,Ee=h(B,Me,A,Je),De=de.concat(Ee).join("::");if(g(B,Ae,De))return!0;const Ue=B.items||B.children||B.sub;return F(Ue,A+1,de.concat(Ee))}),X=(c,A={})=>{var Je;const de=l(c);if(de==null||de===!1)return[];const Le=typeof de=="string"?he.Icon({name:de,size:(Je=A.iconSize)!=null?Je:te}):JSswift.ui.slot(de,{...A,as:"icon"});return E(null,"default",A,Le)},a=(c,A,de={})=>{const Le=X(c,de);return Le.length?[_.span({class:ae(["cms-drawer-item-icon",A])},...Le)]:[]},C=c=>{const A=l(c.iconPosition)||"left",de=Object.prototype.hasOwnProperty.call(c,"iconLeft")?c.iconLeft:A!=="right"?c.icon:null,Le=Object.prototype.hasOwnProperty.call(c,"iconRight")?c.iconRight:A==="right"?c.icon:null;return{left:de,right:Le}},h=(c,A,de,Le)=>l(c.key||c.id||c.to||c.href||A||`item-${de}-${Le}`),J=(c,A)=>P&&Object.prototype.hasOwnProperty.call(ie,c)?!!ie[c]:A,j=(c,A)=>{P&&(ie={...ie,[c]:!!A},y.set(Q,ie))},U=()=>{const c={...S,area:"header"},A=le(["headerIcon","icon"],e.icon,c),de=le(["eyebrow"],e.eyebrow,c),Le=le(["title"],e.title,c),Je=le(["subtitle"],e.subtitle,c),B=le(["meta"],e.meta,c),Ae=le(["content"],e.content,c),Me=le(["actions"],e.actions,c),Ee=r("header")?E(null,"default",c,l(e.header)):[],De=A.length||de.length||Le.length||Je.length||B.length||Ae.length||Me.length;return!De&&!Ee.length?[]:De?[_.div({class:ae(["cms-drawer-header",e.headerClass])},...A.length?[_.div({class:"cms-drawer-header-icon"},...A)]:[],_.div({class:"cms-drawer-header-body"},...de.length?[_.div({class:"cms-drawer-header-eyebrow"},...de)]:[],...Le.length?[_.div({class:"cms-drawer-header-title"},...Le)]:[],...Je.length?[_.div({class:"cms-drawer-header-subtitle"},...Je)]:[],...B.length?[_.div({class:"cms-drawer-header-meta"},...B)]:[],...Ae.length?[_.div({class:"cms-drawer-header-content"},...Ae)]:[],...Ee.length?[_.div({class:"cms-drawer-header-extra"},...Ee)]:[]),...Me.length?[_.div({class:"cms-drawer-header-actions"},...Me)]:[])]:Ee},ce=(c,A,de)=>{var B,Ae;return!(((B=c.onClick)==null?void 0:B.call(c,de,A))===!1||de!=null&&de.defaultPrevented||((Ae=e.onSelect)==null?void 0:Ae.call(e,c,A,de))===!1||de!=null&&de.defaultPrevented)},k=(c,A,de={})=>{const Le=A.hasChildren?"group":"item",Je=E(s,`${Le}Label`,A,A.label),B=E(s,`${Le}Note`,A,A.note),Ae=E(s,`${Le}Badge`,A,A.badge),Me=E(s,`${Le}Aside`,A,A.aside),Ee=E(s,`${Le}Content`,A,A.content),De=[];return(Je.length||B.length||Ae.length||Me.length)&&De.push(_.div({class:"cms-drawer-item-top"},_.div({class:"cms-drawer-item-copy"},...Je.length?[_.div({class:"cms-drawer-item-label"},...Je)]:[],...B.length?[_.div({class:"cms-drawer-item-note"},...B)]:[]),...Ae.length||Me.length?[_.div({class:"cms-drawer-item-meta"},...Ae.length?[_.div({class:"cms-drawer-item-badge"},...Ae)]:[],...Me.length?[_.div({class:"cms-drawer-item-aside"},...Me)]:[])]:[])),Ee.length&&De.push(_.div({class:"cms-drawer-item-content"},...Ee)),[...de.start||[],...a(A.iconLeft,"left",A),...De.length?[_.div({class:"cms-drawer-item-main"},...De)]:[],...a(A.iconRight,"right",A),...de.end||[]]},d=(c=[],A=0,de=[])=>W(c).map((Le,Je)=>{var nn,Pe,Ve,et,ct,gt,ht,Ct,yt,p,ne;const B=l(Le);if(B==null||B===!1)return null;if(B.nodeType||typeof B!="object"||Array.isArray(B))return _.div({class:"cms-drawer-custom","data-level":String(A)},...E(null,"default",{...S,item:B,level:A,index:Je,path:de},B));if(l(B.hidden)===!0||l(B.visible)===!1)return null;const Ae=W(B.items||B.children||B.sub),Me=l(B.href||B.to||B.link||null),Ee=l((et=(Ve=(Pe=(nn=B.label)!=null?nn:B.title)!=null?Pe:B.text)!=null?Ve:Me)!=null?et:null),De=Ee!=null?Ee:`item-${A}-${Je}`,Ue=l((ht=(gt=(ct=B.note)!=null?ct:B.subtitle)!=null?gt:B.description)!=null?ht:null),Ye=l((Ct=B.badge)!=null?Ct:null),Ze=l((p=(yt=B.aside)!=null?yt:B.meta)!=null?p:null),Qe=l((ne=B.content)!=null?ne:null),Te=h(B,De,A,Je),je=de.concat(Te).join("::"),{left:tt,right:nt}=C(B),ut=mt(l(B.state)||l(B.color)||""),dt=m(B,Me),bt=dt||q(je),lt=!!l(B.disabled),ft={...S,item:B,index:Je,level:A,path:de,label:De,note:Ue,badge:Ye,aside:Ze,content:Qe,itemStateKey:je,iconLeft:tt,iconRight:nt,iconSize:l(B.iconSize)||te,active:bt,disabled:lt,hasChildren:!1},vt=l(B.divider)===!0||B.type==="divider"||B.type==="separator",_t=l(B.section)===!0||B.type==="section"||B.type==="heading"||B.type==="label",rt=B.type==="content"||B.type==="custom"||!Me&&!Ae.length&&!l(B.button)&&B.type!=="button"&&Ee==null&&Qe!=null;if(vt)return _.div({class:ae(["cms-drawer-separator",B.class]),"data-level":String(A)});if(_t){const ve=E(s,"sectionLabel",ft,De||Qe);return _.div({class:ae(["cms-drawer-section-label",B.class]),"data-level":String(A)},...ve)}if(rt){const ve=E(s,"item",ft,Qe!=null?Qe:De);return _.div({class:ae(["cms-drawer-custom",ut?`cms-drawer-tone-${ut}`:"",B.class]),style:B.style,"data-level":String(A)},...ve)}if(Ae.length){const ve=dt||F(Ae,A+1,de.concat(Te)),Re=ve||ue(je);let Fe=J(je,!!l(B.expanded)||!!l(B.open)||Re);const Oe=_.span({class:"cms-drawer-group-icon"}),$e={...ft,active:Re,hasChildren:!0,isOpen:()=>Fe,setOpen:Lt=>zt(Lt),toggle:()=>zt(!Fe)},Xe=()=>{var dn,fn;const Lt=Fe?(dn=B.openIcon)!=null?dn:M:(fn=B.closeIcon)!=null?fn:Z,sn=l(Fe?B.iconSidePosition||B.openIconSide||B.openIconPosition||"right":B.iconSidePosition||B.closeIconSide||B.closeIconPosition||"right")==="left"?"left":"right";Oe.innerHTML="",Oe.className=`cms-drawer-group-icon ${sn}`,X(Lt,{...$e,as:"toggleIcon"}).forEach(vn=>Oe.appendChild(vn))},ot=_.button({type:"button",class:ae(["cms-drawer-group-toggle","cms-drawer-entry",Fe?"open":"",Re?"active":"",lt?"is-disabled":"",ut?`cms-drawer-tone-${ut}`:"",B.class]),style:B.style,"data-level":String(A),"aria-expanded":String(Fe),"aria-disabled":lt?"true":null,onClick:Lt=>{if(lt){Lt.preventDefault();return}f(je),zt(!Fe)}},...k(B,$e,{start:l(B.iconSidePosition||B.openIconSide||B.closeIconSide||B.openIconPosition||B.closeIconPosition||"right")==="left"?[Oe]:[],end:l(B.iconSidePosition||B.openIconSide||B.closeIconSide||B.openIconPosition||B.closeIconPosition||"right")==="right"?[Oe]:[]})),pt=E(s,"group",$e,null),xt=_.div({class:"cms-drawer-group-items"},...d(Ae,A+1,de.concat(Te))),Bt=_.div({class:ae(["cms-drawer-group",Fe?"open":"",Re?"active":"",ut?`cms-drawer-tone-${ut}`:""]),"data-level":String(A)},...pt.length?pt:[ot],xt),zt=Lt=>{Fe=!!Lt,Bt.classList.toggle("open",Fe),ot.classList.toggle("open",Fe),ot.setAttribute("aria-expanded",String(Fe)),Xe(),j(je,Fe)};return Y.set(je,{wrap:Bt,toggle:ot,baseActive:ve}),Xe(),Bt}const Vt=E(s,"item",ft,null),Mt=l(B.button)===!0||B.type==="button"||!Me&&typeof B.onClick=="function",wt={class:ae(["cms-drawer-entry",Mt?"cms-drawer-btn":"cms-drawer-link",bt?"active":"",lt?"is-disabled":"",ut?`cms-drawer-tone-${ut}`:"",B.class]),style:B.style,"data-level":String(A),"aria-current":bt?"page":null,"aria-disabled":lt?"true":null},Kt=Vt.length?Vt:k(B,ft);if(Mt){const ve=_.button({...wt,type:B.buttonType||"button",disabled:lt,onClick:Re=>{if(lt){Re.preventDefault();return}ce(B,ft,Re)&&(f(je),se(B)&&b())}},...Kt);return $.set(je,{el:ve,baseActive:dt}),ve}const St=re(B),cn=St?l(B.target)||"_blank":l(B.target),un=St?l(B.rel)||"noopener noreferrer":l(B.rel),tn=_.a({...wt,href:Me||"#",target:cn||null,rel:un||null,tabIndex:lt?-1:null,onClick:ve=>{var Re;if(lt){ve.preventDefault();return}ce(B,ft,ve)&&(!St&&B.to&&((Re=He.router)!=null&&Re.navigate)&&(ve.preventDefault(),He.router.navigate(B.to)),se(B)&&b())}},...Kt);return $.set(je,{el:tn,baseActive:dt}),tn}).filter(Boolean),N=le(["before","beforeItems"],(T=e.before)!=null?T:e.beforeItems),I=me(["body"])?le(["body"],null):[],H=d(e.items||[]),ge=le(["default"],n),Se=le(["after","afterItems"],(x=e.after)!=null?x:e.afterItems),ye=I.length?I:[...N,...H,...ge,...Se],V=r("empty")||r("emptyText")?(w=e.empty)!=null?w:_.div({class:ae(["cms-drawer-empty",e.emptyClass])},e.emptyText||"Nessun contenuto"):_.div({class:ae(["cms-drawer-empty",e.emptyClass])},"Nessun contenuto"),O=le(["header"],U()),K=le(["footer"],e.footer),ke=ye.length?ye:le(["empty"],V),Ne=JSswift.omit(o,["items","header","footer","before","beforeItems","after","afterItems","title","subtitle","eyebrow","icon","content","meta","actions","empty","emptyText","closeOnSelect","groupOpenIcon","groupCloseIcon","stateKey","sticky","slots","headerClass","bodyClass","footerClass","emptyClass","itemIconSize","gap","indent","padding","minHeight","maxHeight","width","onSelect"]);Ne.class=ae(["cms-panel","cms-drawer",Et?"open":"",fe(e.sticky,"sticky"),o.class]),Ne.style={...o.style||{}},e.gap!=null&&(Ne.style["--cms-drawer-gap"]=Be(l(e.gap))),e.indent!=null&&(Ne.style["--cms-drawer-indent"]=Be(l(e.indent))),e.padding!=null&&(Ne.style["--cms-drawer-padding"]=Be(l(e.padding))),e.width!=null&&(Ne.style.width=Be(l(e.width))),e.minHeight!=null&&(Ne.style.minHeight=Be(l(e.minHeight))),e.maxHeight!=null&&(Ne.style.maxHeight=Be(l(e.maxHeight)));const ee=_.div(Ne,...O.length?O:[],_.div({class:ae(["cms-drawer-body",e.bodyClass])},...ke),...K.length?[_.div({class:ae(["cms-drawer-footer",e.footerClass])},...K)]:[]),xe=hs.get(v)||new Set;return xe.add(ee),hs.set(v,xe),Wt(Et,v),ee.isDrawerOpen=u,ee.openDrawer=i,ee.closeDrawer=b,ee.toggleDrawer=R,ee.setActiveItem=f,Ke(ee,e),L(),ee},he.Page=(...t)=>{var g,F,X,a;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e},r=(C,h)=>{var J;return!!(C&&C.nodeType===1&&((J=C.classList)!=null&&J.contains(`cms-page-${h}`)))},v=C=>C==null?null:typeof C=="string"?he.Icon({name:C,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(C,{as:"icon"}),u={dense:!!l(e.dense),flat:!!l(e.flat),centered:!!l(e.centered),narrow:!!l(e.narrow)},i=(C,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(J=>i(C,J));return}if(h!=null&&h.nodeType){C.appendChild(h);return}C.appendChild(document.createTextNode(String(h)))}},b=(C,h,J=j=>j)=>{const j=JSswift.ui.getSlot(s,C);if(j!=null)return E(s,C,u,null);if(typeof h=="function"){const U=new Set(["eyebrow","title","subtitle"]),ce=_[U.has(C)?"span":"div"]({class:`cms-page-slot-${C}`});return JSswift.reactive.effect(()=>{const k=J(h(u)),d=on(JSswift.ui.slot(k));ce.replaceChildren(),Array.isArray(d)?d.forEach(N=>i(ce,N)):i(ce,d)},`UI.Page:${C}`),[ce]}return E(s,C,u,J(h))},R=E(s,"default",u,n!=null&&n.length?n:[]),S={hero:[],header:[],body:[],footer:[],actions:[]},y=[];R.forEach(C=>{r(C,"hero")?S.hero.push(C):r(C,"header")?S.header.push(C):r(C,"body")?S.body.push(C):r(C,"footer")?S.footer.push(C):r(C,"actions")?S.actions.push(C):y.push(C)});const P=b("icon",e.icon,v),Q=b("hero",(g=e.hero)!=null?g:e.banner),G=b("eyebrow",(F=e.eyebrow)!=null?F:e.kicker),ie=b("title",e.title),D=b("subtitle",(X=e.subtitle)!=null?X:e.description),$=b("header",e.header),Y=b("aside",e.aside),W=b("body",(a=e.body)!=null?a:e.content),le=b("footer",e.footer),me=b("actions",e.actions),re=Q.length?_.div({class:ae(["cms-page-hero",e.heroClass])},...Q):null,oe=P.length||G.length||ie.length||D.length||$.length||Y.length,se=oe?_.div({class:ae(["cms-page-header",e.headerClass])},_.div({class:"cms-page-head"},P.length?_.div({class:ae(["cms-page-icon",e.iconClass])},...P):null,_.div({class:"cms-page-head-main"},G.length?_.div({class:ae(["cms-page-eyebrow",e.eyebrowClass])},...G):null,ie.length?_.div({class:ae(["cms-page-title",e.titleClass])},...ie):null,D.length?_.div({class:ae(["cms-page-subtitle",e.subtitleClass])},...D):null,$.length?_.div({class:ae(["cms-page-header-content",e.headerContentClass])},...$):null),Y.length?_.div({class:ae(["cms-page-aside",e.asideClass])},...Y):null)):null,te=[...W,...y],M=te.length?_.div({class:ae(["cms-page-body",e.bodyClass])},...te):null,Z=[...me,...S.actions],q=le.length||Z.length?_.div({class:ae(["cms-page-footer",e.footerClass])},...le,Z.length?_.div({class:"cms-page-actions"},...Z):null):null,ue=!!(Q.length||S.hero.length),L=!!(oe||S.header.length),f=JSswift.omit(o,["actions","aside","asideClass","banner","body","bodyClass","centered","content","dense","description","eyebrow","eyebrowClass","flat","footer","footerClass","gap","header","headerClass","headerContentClass","headerGap","hero","heroClass","heroPadding","icon","iconClass","iconSize","kicker","maxWidth","minHeight","narrow","padding","size","slots","subtitle","subtitleClass","title","titleClass"]);f.class=ae(["cms-panel","cms-page",fe(e.dense,"dense"),fe(e.flat,"cms-page-flat"),fe(e.centered,"cms-page-centered"),fe(e.narrow,"cms-page-narrow"),fe(ue,"cms-page-has-hero"),fe(L,"cms-page-has-header"),o.class]),f.style={...o.style||{}},(e.gap!=null||at(e.gap))&&(f.style["--cms-page-gap"]=ze(e.gap,Be)),(e.padding!=null||at(e.padding))&&(f.style["--cms-page-padding"]=ze(e.padding,Be)),(e.maxWidth!=null||at(e.maxWidth))&&(f.style["--cms-page-max-width"]=ze(e.maxWidth,Be)),(e.minHeight!=null||at(e.minHeight))&&(f.style["--cms-page-min-height"]=ze(e.minHeight,Be)),(e.headerGap!=null||at(e.headerGap))&&(f.style["--cms-page-header-gap"]=ze(e.headerGap,Be)),(e.heroPadding!=null||at(e.heroPadding))&&(f.style["--cms-page-hero-padding"]=ze(e.heroPadding,Be));const m=_.div(f,re,...S.hero,se,...S.header,M,...S.body,q,...S.footer);return Ke(m,e),m},he.AppShell=(...t)=>{var C,h;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(J,j)=>!!J&&Object.prototype.hasOwnProperty.call(J,j),r=l(e.noDrawer)===!0||e.drawer===!1,v=l(e.reverse)===!0,u=l(e.stack)===!0,i=(h=(C=e.drawerStateKey)!=null?C:e.stateKey)!=null?h:qt;i&&(qt=i,Et=en(i));const b={props:e,noDrawer:r,stateKey:i,isDrawerOpen:()=>en(i),openDrawer:()=>Wt(!0,i),closeDrawer:()=>Wt(!1,i),toggleDrawer:()=>Wt(!en(i),i)},R=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let S=e.header;!o(e,"header")&&(Object.keys(R).length||o(e,"title")||o(e,"subtitle")||o(e,"left")||o(e,"right"))&&(!o(R,"title")&&o(e,"title")&&(R.title=e.title),!o(R,"subtitle")&&o(e,"subtitle")&&(R.subtitle=e.subtitle),!o(R,"left")&&o(e,"left")&&(R.left=e.left),!o(R,"right")&&o(e,"right")&&(R.right=e.right),o(R,"drawerStateKey")||(R.drawerStateKey=i),r&&!o(R,"left")&&(R.left=!1),S=he.Header(R));const y=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},P=o(e,"drawerItems")?e.drawerItems:e.items,Q=o(e,"drawerHeader")?e.drawerHeader:void 0;let G=e.drawer;!o(e,"drawer")&&!r&&(Object.keys(y).length||P!=null||Q!=null)&&(!o(y,"items")&&P!=null&&(y.items=P),!o(y,"header")&&Q!=null&&(y.header=Q),o(y,"stateKey")||(y.stateKey=i),G=he.Drawer(y));const ie=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},D=o(e,"content")?e.content:n,$=E(s,"default",b,D);let Y=e.page;!o(e,"page")&&(Object.keys(ie).length||$.length)&&(Y=he.Page(ie,...$));const W=e.footerProps&&typeof e.footerProps=="object"?{...e.footerProps}:{},le=o(e,"footerContent")?e.footerContent:void 0;let me=e.footer;!o(e,"footer")&&(Object.keys(W).length||le!=null)&&(me=he.Footer(W,...E(null,"default",b,le)));const re=E(s,"header",b,S),oe=r?[]:E(s,"drawer",b,G),se=E(s,"page",b,Y),te=E(s,"footer",b,me),M=ae(["cms-app","cms-app-shell",fe(r,"no-drawer"),fe(v,"is-reverse"),fe(u,"is-stack"),fe(e.flush,"is-flush"),fe(e.divider,"is-divider"),e.class]),Z=JSswift.omit(e,["header","drawer","page","footer","content","title","subtitle","left","right","items","drawerItems","drawerHeader","headerProps","drawerProps","pageProps","footerProps","footerContent","noDrawer","reverse","stack","flush","divider","drawerStateKey","stateKey","drawerWidth","gap","padding","slots"]);Z.class=M,Z.style={...e.style||{}};const q=ze(e.drawerWidth,Be);q!=null&&(Z.style["--cms-app-shell-drawer-width"]=q);const ue=ze(e.gap,Be);ue!=null&&(Z.style["--cms-app-shell-gap"]=ue);const L=ze(e.padding,Be);L!=null&&(Z.style["--cms-app-shell-padding"]=L);const f=re.length?_.div({class:"cms-app-shell-header-slot"},...re):null,m=oe.length?_.div({class:"cms-app-shell-drawer-slot"},...oe):null,g=se.length?_.div({class:"cms-app-shell-page-slot"},...se):null,F=te.length?_.div({class:"cms-app-shell-footer-slot"},...te):null,X=v?[g,m]:[m,g],a=_.div(Z,...f?[f]:[],_.div({class:"cms-app-shell-body"},...X.filter(Boolean)),...F?[F]:[]);return a.openDrawer=b.openDrawer,a.closeDrawer=b.closeDrawer,a.toggleDrawer=b.toggleDrawer,a.isDrawerOpen=b.isDrawerOpen,a.header=f,a.drawer=m,a.page=g,a.footer=F,Ke(a,e),a},he.Parallax=function(...e){var J,j;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),o=n.slots||{},r={...n};r.color!=null&&r.textColor==null&&(r.textColor=r.color),delete r.color,Yt(r);const v=qe(n.state,()=>{const U=mt(l(n.state));return U?`cms-state-${U}`:""}),u=U=>{if(U==null||U===!1||U==="")return"";const ce=String(U);return Qt(ce)?`var(--cms-${ce})`:ce},i=()=>{const U=l(n.background);if(U)return String(U);const ce=l(n.image)||l(n.src)||"";if(!ce)return"linear-gradient(120deg, #1b2c5a, #2f6d8f, #2a8f5c)";const k=String(ce);return/^url\(/i.test(k)||/gradient\(/i.test(k)||/^var\(/i.test(k)?k:`url(${k})`},b=(U,ce)=>{const k=Number(l(U));return Number.isFinite(k)?k:ce},R={speed:()=>{var U;return(U=l(n.speed))!=null?U:.18},state:()=>l(n.state)||"",disabled:()=>!!l(n.disabled)},S=E(o,"badge",R,n.badge),y=E(o,"background",R,n.backgroundContent),P=E(o,"eyebrow",R,(J=n.eyebrow)!=null?J:n.kicker),Q=E(o,"title",R,n.title),G=E(o,"subtitle",R,n.subtitle),ie=E(o,"header",R,n.header),D=E(o,"aside",R,n.aside),$=E(o,"media",R,n.media),Y=E(o,"content",R,(j=n.content)!=null?j:n.body),W=E(o,"default",R,s!=null&&s.length?s:[]),le=E(o,"footer",R,n.footer),me=E(o,"actions",R,n.actions),re=[...Y,...W],oe=S.length?_.div({class:ae(["cms-parallax-badge",n.badgeClass])},...S):null,se=P.length||Q.length||G.length||ie.length||D.length,te=se?_.div({class:ae(["cms-parallax-header",n.headerClass])},_.div({class:"cms-parallax-head"},_.div({class:"cms-parallax-head-main"},P.length?_.div({class:ae(["cms-parallax-eyebrow",n.eyebrowClass])},...P):null,Q.length?_.div({class:ae(["cms-parallax-title",n.titleClass])},...Q):null,G.length?_.div({class:ae(["cms-parallax-subtitle",n.subtitleClass])},...G):null,ie.length?_.div({class:ae(["cms-parallax-header-content",n.headerContentClass])},...ie):null),D.length?_.div({class:ae(["cms-parallax-aside",n.asideClass])},...D):null)):null,M=$.length?_.div({class:ae(["cms-parallax-media",n.mediaClass])},...$):null,Z=re.length?_.div({class:ae(["cms-parallax-body",n.bodyClass])},...re):null,q=le.length||me.length?_.div({class:ae(["cms-parallax-footer",n.footerClass])},le.length?_.div({class:"cms-parallax-footer-content"},...le):null,me.length?_.div({class:"cms-parallax-actions"},...me):null):null,ue=JSswift.omit(r,["actions","align","aside","asideClass","background","backgroundContent","backgroundContentClass","badge","badgeClass","bgClass","bgPosition","bgRepeat","bgSize","body","bodyClass","color","content","contentClass","contentMaxWidth","disabled","eyebrow","eyebrowClass","footer","footerClass","gap","header","headerClass","headerContentClass","height","image","imageAlt","imageClass","innerClass","justify","kicker","maxOffset","media","mediaClass","minHeight","overlay","padding","slots","speed","src","startTop","state","subtitle","subtitleClass","textColor","title","titleClass"]);ue.class=ae(["cms-parallax","cms-singularity",v,fe(n.disabled,"cms-parallax-static"),fe(oe,"cms-parallax-has-badge"),fe(se,"cms-parallax-has-header"),r.class]),ue.style={...r.style||{}},n.height!=null&&(ue.style["--cms-parallax-height"]=ze(n.height,Be)),n.minHeight!=null&&(ue.style["--cms-parallax-min-height"]=ze(n.minHeight,Be)),n.padding!=null&&(ue.style["--cms-parallax-padding"]=ze(n.padding,Be)),n.gap!=null&&(ue.style["--cms-parallax-gap"]=ze(n.gap,Be)),n.contentMaxWidth!=null&&(ue.style["--cms-parallax-content-max-width"]=ze(n.contentMaxWidth,Be)),n.justify!=null&&(ue.style["--cms-parallax-justify"]=ze(n.justify)),n.align!=null&&(ue.style["--cms-parallax-align"]=ze(n.align)),n.color!=null&&(ue.style["--cms-parallax-color"]=ze(n.color,u)),n.overlay!=null&&(ue.style["--cms-parallax-overlay"]=ze(n.overlay)),n.bgPosition!=null&&(ue.style["--cms-parallax-position"]=ze(n.bgPosition)),n.bgSize!=null&&(ue.style["--cms-parallax-size"]=ze(n.bgSize)),n.bgRepeat!=null&&(ue.style["--cms-parallax-repeat"]=ze(n.bgRepeat)),ue.style["--cms-parallax-image"]=at(n.background)||at(n.image)||at(n.src)?()=>i():i();const L=_.div({class:ae(["cms-parallax-bg",n.bgClass])},y.length?_.div({class:ae(["cms-parallax-bg-content",n.backgroundContentClass])},...y):null),f=_.div({class:ae(["cms-parallax-content",n.contentClass,n.innerClass])},oe,te,M,Z,q),m=_.div(ue,L,f);let g=!1,F=!1,X=null;const a=()=>{var U;g||(g=!0,typeof window!="undefined"&&(window.removeEventListener("scroll",h),window.removeEventListener("resize",h)),(U=X==null?void 0:X.disconnect)==null||U.call(X),X=null)},C=()=>{if(g)return;if(!m.isConnected){a();return}if(l(n.disabled)){L.style.transform="translate3d(0, 0, 0)",m.style.setProperty("--cms-parallax-offset","0px");return}const U=m.getBoundingClientRect(),ce=b(n.speed,.18),k=Math.abs(b(n.maxOffset,96)),d=l(n.startTop),N=d!=null&&d!==""?(U.top-b(n.startTop,0))*ce:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(U.top+U.height/2))*ce,H=`${(k>0?Math.max(-k,Math.min(k,N)):N).toFixed(2)}px`;L.style.transform=`translate3d(0, ${H}, 0)`,m.style.setProperty("--cms-parallax-offset",H)};function h(){g||F||(F=!0,requestAnimationFrame(()=>{F=!1,C()}))}return typeof window!="undefined"&&(window.addEventListener("scroll",h,{passive:!0}),window.addEventListener("resize",h),typeof ResizeObserver!="undefined"&&(X=new ResizeObserver(()=>{h()}),X.observe(m)),requestAnimationFrame(()=>{h()}),setTimeout(()=>{h()},90)),m.refresh=()=>(h(),m),m.update=m.refresh,m.destroy=()=>(a(),m.remove(),null),m._dispose=a,Ke(m,n),m};const[Gn,Kn]=He.reactive.signal([]),Yn=new Map;function ys(t){const e=Yn.get(t);e&&(clearTimeout(e),Yn.delete(t))}function ws(t){return t?(ys(t),Kn(Gn().filter(e=>e.id!==t)),t):null}function jo(){for(const t of Yn.keys())ys(t);Kn([])}function gl(t){t!=null&&t.id&&(ys(t.id),t.timeout>0&&Yn.set(t.id,setTimeout(()=>{ws(t.id)},t.timeout)))}function hl(t,e={}){if(!t)return null;let n=null;return Kn(Gn().map(s=>s.id!==t?s:(n=Gt({...s,...e,id:s.id},e.type||e.state||e.color||s.type),n))),n&&gl(n),(n==null?void 0:n.id)||null}function Wo(t){const e=()=>ws(t.id),n=(ie={})=>hl(t.id,ie),s={toast:t,id:t.id,close:e,update:n},o=ie=>typeof ie=="function"?ie(s):ie,r=(()=>{if(t.icon===!1||t.icon===null)return null;if(t.icon!=null){const D=o(t.icon);return typeof D=="string"?he.Icon({name:D,size:"sm"}):JSswift.ui.slot(D,{as:"icon"})}const ie=Vo[t.type];return ie?he.Icon({name:ie,size:"sm"}):null})(),v=E(t.slots,"icon",s,r),u=E(t.slots,"title",s,o(t.title)),i=E(t.slots,"message",s,o(t.message)),b=E(t.slots,"description",s,o(t.description)),R=E(t.slots,"meta",s,o(t.meta)),S=E(t.slots,"actions",s,o(t.actions)),y=E(t.slots,"default",s,o(t.body)),P=E(t.slots,"dismiss",s,o(t.dismiss)),Q=P.length?P:t.closable?[he.Btn({class:"cms-toast-close",outline:!0,size:"xs","aria-label":t.dismissLabel,onClick:e},he.Icon({name:"close",size:"xs"}))]:[],G=_.div({class:ae(["cms-toast",`cms-toast-${t.type}`,`cms-toast-${t.variant}`,fe(t.closable,"is-closable"),t.class]),style:t.style||{},role:t.role},v.length?_.div({class:"cms-toast-icon"},...v):null,_.div({class:"cms-toast-main"},_.div({class:"cms-toast-copy"},u.length?_.div({class:"cms-toast-title"},...u):null,i.length?_.div({class:"cms-toast-message"},...i):null,b.length?_.div({class:"cms-toast-description"},...b):null,y.length?_.div({class:"cms-toast-body"},...y):null,R.length?_.div({class:"cms-toast-meta"},...R):null),S.length?_.div({class:"cms-toast-actions"},...S):null),Q.length?_.div({class:"cms-toast-dismiss"},...Q):null);return Ke(G,t),G}function Uo(){let t=document.querySelector(".cms-toast-layer");return t||(t=document.createElement("div"),t.className="cms-toast-layer",document.body.appendChild(t),He.reactive.effect(()=>{const e=Gn();t.innerHTML="";const n=new Map;for(const s of e){const o=fl(s.position);n.has(o)||n.set(o,[]),n.get(o).push(s)}for(const s of dl){const o=n.get(s);if(!(o!=null&&o.length))continue;const r=_.div({class:ae(["cms-toast-wrap",`is-${s}`])},...o.map(v=>Wo(v)));t.appendChild(r)}},"JSswiftUI:toasts"),t)}function Go(t={}){Uo();const e=Gt(t);return e.id=e.id||Math.random().toString(36).slice(2),Kn([...Gn().filter(n=>n.id!==e.id),e]),gl(e),e.id}He.services.notify.show=Go,He.services.notify.success=Rt("success","Success"),He.services.notify.error=Rt("danger","Error"),He.services.notify.warning=Rt("warning","Warning"),He.services.notify.info=Rt("info","Info"),He.services.notify.primary=Rt("primary","Notice"),He.services.notify.secondary=Rt("secondary","Notice"),He.services.notify.update=hl,He.services.notify.remove=ws,He.services.notify.clear=jo,He.services.notify.promise=he.Notify.promise,He.notify=He.services.notify,JSswift.form=JSswift.form||{},JSswift.form._isPromise=t=>t&&typeof t.then=="function",JSswift.form._normalizeRules=t=>{const e={};for(const n in t||{}){const s=t[n];e[n]=Array.isArray(s)?s:[s]}return e},JSswift.form._runRule=async(t,e,n)=>{let s=t,o=null;t&&typeof t=="object"&&typeof t.rule=="function"&&(s=t.rule,o=t.message||null);const r=s?s(e,n):!0,v=JSswift.form._isPromise(r)?await r:r;return v===!0?null:typeof v=="string"?v:v===!1?o||"Valore non valido":v?null:o||"Valore non valido"},JSswift.useForm=(t={})=>{const e=t.model||{},n=JSswift.form._normalizeRules(t.rules||{}),s=t.validateOn||"submit",o=t.initial||null,r=_.rod({}),v=_.rod({}),u=_.rod(!1),i=_.rod(null),b=()=>e&&typeof e=="object"&&"value"in e?e.value||{}:e,R=re=>{if(e&&typeof e=="object"&&"value"in e)e.value=re;else{const oe=e||{};for(const se in oe)delete oe[se];Object.assign(oe,re)}},S=re=>{const oe=b();return oe?oe[re]:void 0},y=(re,oe)=>{const se={...b()||{}};se[re]=oe,R(se)},P=(re,oe)=>{const se={...r.value||{}};oe?se[re]=oe:delete se[re],r.value=se},Q=re=>(r.value||{})[re]||null,G=re=>{v.value={...v.value||{},[re]:!0}},ie=re=>!!(v.value||{})[re],D=async re=>{const oe=n[re]||[];if(!oe.length)return P(re,null),!0;const se=S(re),te={name:re,value:se,model:b(),form:me};for(const M of oe){if(!M)continue;const Z=await JSswift.form._runRule(M,se,te);if(Z)return P(re,Z),!1}return P(re,null),!0},$=async()=>{i.value=null;const re=Object.keys(n);let oe=!0;for(const se of re)await D(se)||(oe=!1);return oe},me={model:e,errors:r,touched:v,submitting:u,submitError:i,getValue:S,setValue:y,getError:Q,setError:P,touch:G,isTouched:ie,field:(re,oe={})=>{var F;const se=_.rod("");(F=se.action)==null||F.call(se,X=>{y(re,X)});const te=()=>s==="submit"||s==="input"||s==="blur"?!0:ie(re);let M=null,Z=!1,q=!1;const ue=async()=>{Z||(Z=!0,G(re),(s==="blur"||s==="input")&&await D(re),setTimeout(()=>{Z=!1},0))},L=X=>{M&&(M===X.target||M.contains&&M.contains(X.target)||(ue(),M=null,q&&(q=!1,document.removeEventListener("pointerdown",L,!0))))},f=()=>{q||(q=!0,document.addEventListener("pointerdown",L,!0))},m=async()=>{M=document.activeElement,Z=!1,f(),s==="input"&&await D(re)},g=async()=>{await ue(),M=null,q&&(q=!1,document.removeEventListener("pointerdown",L,!0))};return{name:re,model:se,get value(){return se.value},set value(X){se.value=X},error:()=>te()?Q(re):null,success:oe.success||null,warning:oe.warning||null,note:oe.note||null,touch:()=>G(re),validate:()=>D(re),onInput:m,onBlur:g,hint:oe.hint||null}},validateField:D,validate:$,reset:()=>{i.value=null,r.value={},v.value={},o&&R({...o||{}})},submit:async re=>{u.value=!0,i.value=null;try{return await $()?{ok:!0,result:await(re==null?void 0:re(b(),me))}:{ok:!1,reason:"validation"}}catch(oe){return console.error("[useForm] submit error:",oe),i.value=oe&&oe.message?oe.message:String(oe),{ok:!1,reason:"exception",error:oe}}finally{u.value=!1}}};return me},he.Form=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.form,o=e.onSubmit,r=ae(["cms-form",e.class]),v=JSswift.omit(e,["form","onSubmit"]);v.class=r;const u=_.form({...v,onSubmit:async b=>{b.preventDefault(),s&&await s.submit(o||(async()=>{}))}}),i=[];for(const b of n||[]){const R=typeof b=="function"?b(s):b,S=JSswift.ui.slot(R);S&&(Array.isArray(S)?i.push(...S):i.push(S))}return i.forEach(b=>u.appendChild(b)),s&&s.submitting&&JSswift.reactive.effect(()=>{u.classList.toggle("is-submitting",!!s.submitting.value)},"UI.Form:submitting"),u},He.services=He.services||{},He.services.dialog=He.services.dialog||{},He.dialog=He.services.dialog;let wn=null;function pl(){return wn||(wn=document.createElement("div"),wn.setAttribute("data-cms-modal-root","true"),document.body.appendChild(wn),wn)}he.cardHeader=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=ae(["cms-card-header",fe(e.divider,"divider"),e.class]),r=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);r.class=o;const v={...e.style||{}},u=ze(e.align);u!=null&&!We(e,"align")&&(v.alignItems=u);const i=ze(e.justify);i!=null&&!We(e,"justify")&&(v.justifyContent=i);const b=ze(e.wrap,P=>P?"wrap":"nowrap");b!=null&&!We(e,"wrap")&&(v.flexWrap=b);const R=ze(e.direction);R!=null&&!We(e,"direction")&&(v.flexDirection=R);const S=ze(e.gap,Be);S!=null&&!We(e,"gap")&&(v.gap=S),Object.keys(v).length&&(r.style=v),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const y=_.div(r,...E(s,"default",{},n));return Ke(y,e),y},he.cardBody=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=ae(["cms-card-body",e.class]),r=JSswift.omit(e,["slots","display","direction","wrap","align","justify","gap","rowGap","columnGap","padding","width"]);r.class=o,JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const v=_.div(r,...E(s,"default",{},n));return Ke(v,e),v},he.cardFooter=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=ae(["cms-card-footer",fe(e.divider,"divider"),e.class]),r=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);r.class=o;const v={...e.style||{}},u=ze(e.align);u!=null&&!We(e,"align")&&(v.alignItems=u);const i=ze(e.justify);i!=null&&!We(e,"justify")&&(v.justifyContent=i);const b=ze(e.wrap,P=>P?"wrap":"nowrap");b!=null&&!We(e,"wrap")&&(v.flexWrap=b);const R=ze(e.direction);R!=null&&!We(e,"direction")&&(v.flexDirection=R);const S=ze(e.gap,Be);S!=null&&!We(e,"gap")&&(v.gap=S),Object.keys(v).length&&(r.style=v),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const y=_.div(r,...E(s,"default",{},n));return Ke(y,e),y},he.Dialog=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=["primary","secondary","warning","danger","success","info","light","dark"],r=["xs","sm","md","lg","xl","full"];let v={...e},u=null,i=null;const b=(f,m)=>typeof f=="function"?f(m):f,R=f=>String(f||"").split(/\s+/).filter(Boolean),S=(f,m,g)=>{if(!f)return;const F=f[m]||[];F.length&&f.classList.remove(...F);const X=(g||[]).filter(Boolean);X.length&&f.classList.add(...X),f[m]=X},y=(f,m,g,F=X=>X)=>{if(f){if(g==null||g===""){f.style.removeProperty(m);return}f.style.setProperty(m,F(g))}},P=()=>{var a,C,h,J,j,U;const f=window.visualViewport,m=Math.max(0,Math.round((a=f==null?void 0:f.offsetLeft)!=null?a:0)),g=Math.max(0,Math.round((C=f==null?void 0:f.offsetTop)!=null?C:0)),F=Math.max(0,Math.round((J=(h=f==null?void 0:f.width)!=null?h:window.innerWidth)!=null?J:0)),X=Math.max(0,Math.round((U=(j=f==null?void 0:f.height)!=null?j:window.innerHeight)!=null?U:0));return{left:m,top:g,width:F,height:X}},Q=f=>{if(!(f!=null&&f.panel))return;const{left:m,top:g,width:F,height:X}=P();y(f.panel,"position","fixed"),y(f.panel,"inset",0,a=>`${a}px`),y(f.panel,"top",g,a=>`${a}px`),y(f.panel,"left",m,a=>`${a}px`),y(f.panel,"right","auto"),y(f.panel,"bottom","auto"),y(f.panel,"width",F,a=>`${a}px`),y(f.panel,"height",X,a=>`${a}px`),y(f.panel,"min-height",X,a=>`${a}px`),y(f.panel,"max-width",F,a=>`${a}px`),y(f.panel,"max-height",X,a=>`${a}px`),y(f.panel,"min-width",0,a=>`${a}px`),y(f.panel,"margin",0,a=>`${a}px`),y(f.panel,"box-sizing","border-box"),y(f.panel,"border-width",0,a=>`${a}px`),y(f.panel,"border-radius",0,a=>`${a}px`),y(f.panel,"transform","none"),y(f.panel,"overflow","hidden"),y(f.panel,"--cms-dialog-fullscreen-left",m,a=>`${a}px`),y(f.panel,"--cms-dialog-fullscreen-top",g,a=>`${a}px`),y(f.panel,"--cms-dialog-fullscreen-width",F,a=>`${a}px`),y(f.panel,"--cms-dialog-fullscreen-height",X,a=>`${a}px`)},G=f=>{f!=null&&f.panel&&(y(f.panel,"position",null),y(f.panel,"inset",null),y(f.panel,"top",null),y(f.panel,"left",null),y(f.panel,"right",null),y(f.panel,"bottom",null),y(f.panel,"width",null),y(f.panel,"height",null),y(f.panel,"min-height",null),y(f.panel,"max-width",null),y(f.panel,"max-height",null),y(f.panel,"min-width",null),y(f.panel,"margin",null),y(f.panel,"box-sizing",null),y(f.panel,"border-width",null),y(f.panel,"border-radius",null),y(f.panel,"transform",null),y(f.panel,"overflow",null),y(f.panel,"--cms-dialog-fullscreen-left",null),y(f.panel,"--cms-dialog-fullscreen-top",null),y(f.panel,"--cms-dialog-fullscreen-width",null),y(f.panel,"--cms-dialog-fullscreen-height",null))},ie=(f,m)=>{var h,J,j,U,ce;if(!f)return;if((h=f._dialogViewportCleanup)==null||h.call(f),f._dialogViewportCleanup=null,!m){G(f);return}let g=null;const F=globalThis.requestAnimationFrame||(k=>setTimeout(()=>k(Date.now()),0)),X=globalThis.cancelAnimationFrame||clearTimeout,a=()=>Q(f),C=()=>{g!=null&&X(g),g=F(()=>{g=null,a()})};a(),C(),window.addEventListener("resize",a),window.addEventListener("orientationchange",C),(j=(J=window.visualViewport)==null?void 0:J.addEventListener)==null||j.call(J,"resize",a),(ce=(U=window.visualViewport)==null?void 0:U.addEventListener)==null||ce.call(U,"scroll",C),f._dialogViewportCleanup=()=>{var k,d,N,I;g!=null&&(X(g),g=null),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",C),(d=(k=window.visualViewport)==null?void 0:k.removeEventListener)==null||d.call(k,"resize",a),(I=(N=window.visualViewport)==null?void 0:N.removeEventListener)==null||I.call(N,"scroll",C)}},D=()=>v,$=f=>{var g;const m=l((g=f.state)!=null?g:f.color);return m?o.includes(m)?m:String(m):""},Y=f=>{const m=l(f.size);return typeof m=="string"&&r.includes(m)?m:""},W=f=>{var g,F,X;const m=String(l((X=(F=(g=f.actionsAlign)!=null?g:f.footerAlign)!=null?F:f.alignActions)!=null?X:"end")).toLowerCase();return["start","left"].includes(m)?"start":["center","middle"].includes(m)?"center":["between","space-between"].includes(m)?"between":["stretch","full"].includes(m)?"stretch":"end"},le=f=>{var g,F,X;const m=String(l((X=(F=(g=f.align)!=null?g:f.verticalAlign)!=null?F:f.position)!=null?X:"center")).toLowerCase();return["top","start","flex-start"].includes(m)?"cms-dialog-align-top":["bottom","end","flex-end"].includes(m)?"cms-dialog-align-bottom":""},me=f=>{var g,F;return((F=(g=f.closable)!=null?g:f.dismissible)!=null?F:f.closeButton)!==!1},re=()=>{var H,ge,Se,ye,V,O,K,ke;const f=D(),m={close:Z,dismiss:Z,open:M,toggle:ue,update:te,isOpen:q,entry:()=>u,props:f},g=f.icon!=null?typeof f.icon=="string"?he.Icon({name:f.icon,size:f.iconSize||"md"}):JSswift.ui.slot(f.icon,{as:"icon"}):null,F=E(s,"eyebrow",m,b(f.eyebrow,m)),X=E(s,"title",m,b((ge=(H=f.title)!=null?H:f.heading)!=null?ge:f.header,m)),a=E(s,"subtitle",m,b((Se=f.subtitle)!=null?Se:f.description,m)),C=E(s,"icon",m,g),h=E(s,"header",m,b((ye=f.headerContent)!=null?ye:f.head,m)),J=me(f)?E(s,"close",m,he.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":f.closeLabel||"Chiudi dialog","data-dialog-close":!0},he.Icon({name:f.closeIcon||"close",size:"sm"}))):[],j=(K=(O=(V=f.content)!=null?V:f.body)!=null?O:f.message)!=null?K:n&&n.length?n:null;let U=E(s,"content",m,b(j,m));U.length||(U=E(s,"body",m,b(j,m))),U.length||(U=E(s,"default",m,b(j,m)));const ce=b((ke=f.footer)!=null?ke:f.actions,m);let k=E(s,"footer",m,ce);k.length||(k=E(s,"actions",m,ce));let d=null;h.length?d=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...h):(F.length||X.length||a.length||C.length||J.length)&&(d=_.div({class:"cms-dialog-head"},C.length?_.div({class:"cms-dialog-icon"},...C):null,_.div({class:"cms-dialog-head-main"},F.length?_.div({class:"cms-dialog-eyebrow"},...F):null,X.length?_.div({class:"cms-dialog-title"},...X):null,a.length?_.div({class:"cms-dialog-subtitle"},...a):null),J.length?_.div({class:"cms-dialog-close-wrap"},...J):null));const N=_.div({class:ae(["cms-dialog-body",f.bodyClass])},...U),I=k.length?_.div({class:ae(["cms-dialog-actions",`is-${W(f)}`,fe(f.stackActions,"is-stacked"),f.actionsClass,f.footerClass])},...k):null;return _.div({class:ae(["cms-dialog-shell",fe(!!d,"has-head"),fe(!!I,"has-footer"),fe(f.divider!==!1,"with-divider")])},...[d,N,I].filter(Boolean))},oe=f=>{var X;if(!(f!=null&&f.panel))return;const m=D(),g=$(m),F=Y(m);S(f.panel,"_dialogClassTokens",["cms-dialog","cms-singularity","cms-clear-set",F?`cms-dialog-${F}`:"",g,g?`cms-state-${g}`:"",l(m.fullscreen)?"fullscreen":"",l(m.scrollable)?"scrollable":"",l(m.stickyHeader)?"sticky-head":"",l(m.stickyActions)?"sticky-actions":"",l(m.borderless)?"borderless":"",...R(m.class),...R(m.panelClass)]),S(f.overlay,"_dialogOverlayClassTokens",[le(m),l(m.backdropBlur)?"cms-dialog-overlay-blur":"",...R(m.overlayClass)]),y(f.panel,"--cms-dialog-width",l(m.width),Be),y(f.panel,"--cms-dialog-min-width",l(m.minWidth),Be),y(f.panel,"--cms-dialog-max-width",l(m.maxWidth),Be),y(f.panel,"--cms-dialog-max-height",l(m.maxHeight),Be),y(f.panel,"--cms-dialog-body-max-height",l((X=m.bodyMaxHeight)!=null?X:m.contentMaxHeight),Be),m.style&&Object.assign(f.panel.style,m.style),Ke(f.panel,m),ie(f,l(m.fullscreen)),f.panel.setAttribute("role",m.role||"dialog"),f.panel.setAttribute("aria-modal",m.modal===!1?"false":"true"),m.ariaLabel?f.panel.setAttribute("aria-label",m.ariaLabel):f.panel.removeAttribute("aria-label")},se=()=>{u!=null&&u.panel&&u.panel.replaceChildren(re())},te=(f={})=>(f&&typeof f=="object"&&(v={...v,...f}),u&&(oe(u),se()),L),M=(f=null)=>{var X,a,C,h,J;if(f&&typeof f=="object"&&(v={...v,...f}),u)return oe(u),se(),u;i=document.activeElement;const m=D(),g=m.persistent===!0;u=JSswift.overlay.open(()=>re(),{type:"dialog",backdrop:m.backdrop!==!1,lockScroll:m.lockScroll!==!1,trapFocus:m.trapFocus!==!1,autoFocus:m.autoFocus!==!1,closeOnOutside:(X=m.closeOnOutside)!=null?X:!g,closeOnBackdrop:(a=m.closeOnBackdrop)!=null?a:!g,closeOnEsc:(C=m.closeOnEsc)!=null?C:!g,className:Dt(["cms-dialog"]),onClose:()=>{var j,U,ce,k;(j=u==null?void 0:u._dialogViewportCleanup)==null||j.call(u),(U=u==null?void 0:u.panel)==null||U.removeEventListener("click",F),u=null,(k=(ce=D()).onClose)==null||k.call(ce),i&&typeof i.focus=="function"&&setTimeout(()=>i.focus(),0)}});const F=j=>{const U=j.target;U&&U.closest&&U.closest("[data-dialog-close]")&&Z()};return u.panel.addEventListener("click",F),oe(u),bn(u),(J=(h=D()).onOpen)==null||J.call(h,u),u},Z=()=>{if(!u)return;const f=u;yn(f,()=>JSswift.overlay.close(f.id))},q=()=>!!u,ue=(f=null)=>q()?(Z(),null):M(f),L={open:M,close:Z,toggle:ue,update:te,isOpen:q,entry:()=>u,props:()=>({...v})};return L},he.TabPanel=(...t)=>{var Ne,ee,xe,be,Ce,pe,Ie,_e,z,we,T,x,w;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=Array.isArray(e.tabs)?e.tabs:Array.isArray(e.items)?e.items:[],r=Nt(e.model,"UI.TabPanel:model"),v=e.id||"cms-tabpanel-"+Math.random().toString(36).slice(2,9),u=c=>String(l(c)||"vertical").toLowerCase()==="horizontal"?"horizontal":"vertical",i=c=>String(l(c)||"before").toLowerCase()==="after"?"after":"before",b=c=>{const A=String(l(c)||"").toLowerCase();return A==="pills"||A==="pill"?"pills":A==="soft"||A==="card"?"soft":"line"},R=c=>{const A=l(c);return A==null||A===""?null:JSswift.uiColors.includes(A)?`var(--cms-${A})`:String(A)},S=u(e.orientation||e.orient||e.direction),y=i(e.navPosition||e.barPosition||e.position),P=b(e.variant||(e.pills?"pills":e.soft?"soft":"line")),Q=!!e.wrap,G=!!e.swipeable,ie=!!e.infinite,D=!!e.animated,$=!!((ee=(Ne=e.navFill)!=null?Ne:e.fill)!=null?ee:e.stretch),Y=!!e.disabled,W=l((xe=e.transitionDuration)!=null?xe:e["transition-duration"]),le=(()=>{if(W==null)return 220;if(typeof W=="number")return W;const c=parseFloat(W);return Number.isFinite(c)?c:220})(),me=l((be=e.transitionEasing)!=null?be:e["transition-easing"])||"ease",re=(pe=(Ce=e.transitionPrev)!=null?Ce:e["transition-prev"])!=null?pe:null,oe=(_e=(Ie=e.transitionNext)!=null?Ie:e["transition-next"])!=null?_e:null,se=R((z=e.color)!=null?z:e.state),te=o.map((c,A)=>{var De,Ue,Ye,Ze,Qe,Te,je,tt,nt,ut,dt,bt,lt,ft,vt,_t;if(c==null)return null;if(typeof c!="object")return{name:c,labelFallback:c,panelFallback:null,noteFallback:null,iconFallback:null,badgeFallback:null,hidden:!1,raw:c,index:A};const de=(Te=(Qe=(Ze=(Ye=(Ue=(De=c.name)!=null?De:c.value)!=null?Ue:c.id)!=null?Ye:c.key)!=null?Ze:c.label)!=null?Qe:c.title)!=null?Te:`tab-${A}`,Le=c.label!=null||c.title!=null,Je=Le?(je=c.label)!=null?je:c.title:c.children!=null&&c.content==null&&c.panel==null?c.children:(nt=(tt=c.name)!=null?tt:c.value)!=null?nt:`Tab ${A+1}`,B=(bt=(dt=(ut=c.content)!=null?ut:c.panel)!=null?dt:c.body)!=null?bt:Le?c.children:null,Ae=(vt=(ft=(lt=c.note)!=null?lt:c.subtitle)!=null?ft:c.description)!=null?vt:null,Me=(_t=c.icon)!=null?_t:null,Ee=Object.prototype.hasOwnProperty.call(c,"badge")?c.badge:Object.prototype.hasOwnProperty.call(c,"counter")?c.counter:null;return{...c,name:de,labelFallback:Je,panelFallback:B,noteFallback:Ae,iconFallback:Me,badgeFallback:Ee,index:A}}).filter(Boolean).filter(c=>c.hidden!==!0&&c.visible!==!1),M=ae(["cms-clear-set","cms-tabpanel","cms-singularity",S,`variant-${P}`,fe(Q,"wrap"),fe(D,"animated"),fe($,"nav-fill"),fe(Y,"disabled"),fe(y==="after","nav-after"),e.class]),Z=JSswift.omit(e,["tabs","items","value","default","defaultValue","model","orientation","orient","direction","navPosition","barPosition","position","variant","pills","soft","navFill","fill","stretch","wrap","swipeable","infinite","animated","transitionDuration","transition-duration","transitionEasing","transition-easing","transitionPrev","transition-prev","transitionNext","transition-next","slots","empty","tabClass","tabStyle","panelClass","panelStyle","navClass","panelsClass","class","style"]);Z.class=M,Z.style=e.style;const q=_.div(Z);D&&(q.style.setProperty("--cms-tabpanel-duration",`${le}ms`),q.style.setProperty("--cms-tabpanel-easing",me)),se&&q.style.setProperty("--cms-tabpanel-accent",se);const ue=_.div({class:ae(["cms-tabpanel-nav",e.navClass]),role:"tablist","aria-orientation":S}),L=_.div({class:ae(["cms-tabpanel-panels",e.panelsClass])}),f=[],m=[];let g=-1;const F=()=>S==="horizontal",X=(c,A,de)=>({tab:c,name:c.name,index:A,active:de,value:c.name,select:()=>Se(A),next:()=>V(),prev:()=>O()}),a=(c,A,de=!1)=>{var Je;if(!te.length)return-1;let Le=c;for(let B=0;B<te.length;B+=1){if(Le+=A,Le>=te.length){if(!de)return-1;Le=0}else if(Le<0){if(!de)return-1;Le=te.length-1}if(!((Je=te[Le])!=null&&Je.disabled))return Le}return-1},C=c=>{var de;const A=(de=f[c])==null?void 0:de.btn;!A||typeof A.focus!="function"||requestAnimationFrame(()=>A.focus())},h=(c,A,de)=>{const Le=X(c,A,de),Je=JSswift.ui.renderSlot(s,"label",Le,c.labelFallback);return E(null,"default",{},Je)},J=(c,A)=>{var tt,nt,ut,dt,bt;const de=A===g,Le=`${v}-tab-${A}`,Je=`${v}-panel-${A}`,B=X(c,A,de),Ae=h(c,A,de),Me=c.iconFallback!=null?typeof c.iconFallback=="string"?he.Icon({name:c.iconFallback,size:(ut=(nt=(tt=c.iconSize)!=null?tt:c.size)!=null?nt:e.size)!=null?ut:null}):c.iconFallback:null,Ee=E(s,"icon",B,Me),De=E(s,"note",B,c.noteFallback),Ue=E(s,"badge",B,c.badgeFallback),Ye=_.span({class:"cms-tabpanel-tab-inner"},Ee.length?_.span({class:"cms-tabpanel-tab-icon"},...Ee):null,_.span({class:"cms-tabpanel-tab-copy"},_.span({class:"cms-tabpanel-tab-label"},...Ae.length?Ae:[""]),De.length?_.span({class:"cms-tabpanel-tab-note"},...De):null),Ue.length?_.span({class:"cms-tabpanel-tab-badge"},...Ue):null),Ze=E(s,"tab",{...B,label:Ae,icon:Ee,note:De,badge:Ue,tabId:Le,panelId:Je},Ye),Qe=lt=>{if(Y||c.disabled)return;const ft=lt.key;if(ft==="Enter"||ft===" "){lt.preventDefault(),Se(A);return}if(ft==="Home"){lt.preventDefault();const rt=te.findIndex(Vt=>!Vt.disabled);rt>=0&&(Se(rt),C(rt));return}if(ft==="End"){lt.preventDefault();const rt=(()=>{var Vt;for(let Mt=te.length-1;Mt>=0;Mt-=1)if(!((Vt=te[Mt])!=null&&Vt.disabled))return Mt;return-1})();rt>=0&&(Se(rt),C(rt));return}const vt=F()?["ArrowLeft"]:["ArrowUp"],_t=F()?["ArrowRight"]:["ArrowDown"];if(vt.includes(ft)){lt.preventDefault();const rt=a(A,-1,ie);rt>=0&&(Se(rt,{dir:"prev"}),C(rt));return}if(_t.includes(ft)){lt.preventDefault();const rt=a(A,1,ie);rt>=0&&(Se(rt,{dir:"next"}),C(rt))}},Te=he.Btn({class:ae(["cms-tabpanel-tab",fe(de,"active"),fe(c.disabled||Y,"disabled"),e.tabClass,c.tabClass||c.class]),type:"button",id:Le,role:"tab",disabled:!!(c.disabled||Y),"aria-selected":de?"true":"false","aria-controls":Je,tabindex:de?"0":"-1",outline:P==="pills"&&!de,color:P==="pills"&&de?c.color||e.color||e.state||"primary":null,size:(bt=(dt=c.size)!=null?dt:e.size)!=null?bt:null,style:{...e.tabStyle||{},...c.tabStyle||{}},onClick:()=>{c.disabled||Y||Se(A)},onKeydown:Qe},...Ze),je=_.div({class:ae(["cms-tabpanel-nav-btn",fe(de,"active"),c.navClass]),"data-name":c.name},Te,_.span({class:"tab-indicator"}));return f[A]={btn:Te,wrap:je,index:A},je},j=(c,A)=>{const de=A===g,Le=`${v}-tab-${A}`,Je=`${v}-panel-${A}`,B=X(c,A,de),Ae=JSswift.ui.renderSlot(s,"panel",B,c.panelFallback),Me=_.div({class:ae(["cms-tabpanel-panel",fe(de,"active"),e.panelClass,c.panelClass]),style:{...e.panelStyle||{},...c.panelStyle||{}},"data-name":c.name,role:"tabpanel",id:Je,tabindex:0,"aria-labelledby":Le,"aria-hidden":de?"false":"true"},...E(null,"default",{},Ae));return m[A]=Me,Me},U=te.map((c,A)=>J(c,A)),ce=JSswift.ui.renderSlot(s,"nav",{tabs:te,active:()=>{var c;return g>=0?(c=te[g])==null?void 0:c.name:null},activeIndex:()=>g,activeTab:()=>g>=0?te[g]:null,select:c=>{typeof c=="number"?Se(c):ye(c)},next:()=>V(),prev:()=>O(),nodes:U,orientation:S,position:y,variant:P},U);E(null,"default",{},ce).forEach(c=>ue.appendChild(c)),te.length?te.forEach((c,A)=>L.appendChild(j(c,A))):E(s,"empty",{tabs:te},(we=e.empty)!=null?we:_.div({class:"cms-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(A=>L.appendChild(A));const k=c=>{if(!D)return;const A=c==="next"?"18px":"-18px",de=c==="next"?"-18px":"18px";q.style.setProperty("--cms-tabpanel-enter",A),q.style.setProperty("--cms-tabpanel-leave",de)},d=()=>{const c=[];re&&c.push(...String(re).split(/\s+/)),oe&&c.push(...String(oe).split(/\s+/)),c.length&&L.classList.remove(...c.filter(Boolean))},N=c=>{d();const A=c==="prev"?re:oe;if(!A)return;const de=String(A).split(/\s+/).filter(Boolean);de.length&&(L.classList.add(...de),setTimeout(()=>L.classList.remove(...de),le+40))},I=c=>{var Le;const A=f.find(({btn:Je})=>Je.classList.contains("active")),de=(Le=A==null?void 0:A.btn.parentNode)==null?void 0:Le.getBoundingClientRect();f.forEach(({btn:Je,index:B})=>{const Ae=B===c,Me=Je.parentNode;if(!Me)return;const Ee=Me.getBoundingClientRect();Me.isConnected&&de&&(Me.style.setProperty("--nav-pos-x",de.left-Ee.left+"px"),Me.style.setProperty("--nav-pos-y",de.top-Ee.top+"px")),Me.classList.toggle("active",Ae),Je.classList.toggle("active",Ae),Je.setAttribute("aria-selected",Ae?"true":"false"),Je.setAttribute("tabindex",Ae?"0":"-1")})},H=(c,A,de)=>{k(de),m.forEach((Le,Je)=>{if(!Le)return;const B=Je===A,Ae=Je===c;B?(Le.classList.add("active"),Le.classList.remove("leaving"),Le.setAttribute("aria-hidden","false")):(Le.classList.remove("active"),Le.setAttribute("aria-hidden","true"),D&&Ae?(Le.classList.add("leaving"),setTimeout(()=>Le.classList.remove("leaving"),le+40)):Le.classList.remove("leaving"))})},ge=(c,A)=>c<0||c===A||ie&&c===te.length-1&&A===0?"next":ie&&c===0&&A===te.length-1?"prev":A>c?"next":"prev",Se=(c,A={})=>{var B,Ae;if(c==null||c<0||c>=te.length||(B=te[c])!=null&&B.disabled)return;const de=g;if(de===c)return;g=c;const Le=te[c],Je=A.dir||ge(de,c);r&&!A.fromModel&&r.set(Le.name),I(c),H(de,c,Je),N(Je),q.dataset.active=String(Le.name),(Ae=e.onChange)==null||Ae.call(e,Le.name,Le,c)},ye=(c,A={})=>{if(!te.length)return;const de=te.findIndex(Le=>Le.name==c);de!==-1&&Se(de,A)},V=()=>{if(!te.length)return;const c=g<0?te.findIndex(A=>!A.disabled):a(g,1,ie);c<0||Se(c,{dir:"next"})},O=()=>{if(!te.length)return;const c=g<0?(()=>{var A;for(let de=te.length-1;de>=0;de-=1)if(!((A=te[de])!=null&&A.disabled))return de;return-1})():a(g,-1,ie);c<0||Se(c,{dir:"prev"})};if(G){let c=0,A=0,de=!1;const Le=42;L.addEventListener("pointerdown",Je=>{Je.button!=null&&Je.button!==0||(de=!0,c=Je.clientX,A=Je.clientY)}),L.addEventListener("pointerup",Je=>{if(!de)return;de=!1;const B=Je.clientX-c,Ae=Je.clientY-A;Math.abs(B)<Le||Math.abs(B)<Math.abs(Ae)||(B<0?V():O())}),L.addEventListener("pointercancel",()=>{de=!1}),L.addEventListener("pointerleave",()=>{de=!1})}const K=r?r.get():(w=(x=(T=e.value)!=null?T:e.defaultValue)!=null?x:e.default)!=null?w:null;if(te.length){const c=te.findIndex(A=>A.name==K);if(c>=0)Se(c,{fromModel:!0});else{const A=te.findIndex(de=>!de.disabled);A>=0&&(Se(A,{fromModel:!0}),r&&r.set(te[A].name))}}return r&&r.watch(c=>ye(c,{fromModel:!0}),"UI.TabPanel:watch"),y==="after"?(q.appendChild(L),q.appendChild(ue)):(q.appendChild(ue),q.appendChild(L)),E(s,"default",{},n).forEach(c=>q.appendChild(c)),Ke(q,e),q._tabs=()=>te.slice(),q._active=()=>g>=0?te[g]:null,q._getValue=()=>{var c;return g>=0?(c=te[g])==null?void 0:c.name:null},q._setValue=c=>ye(c),q._select=c=>{typeof c=="number"?Se(c):ye(c)},q._next=V,q._prev=O,q};function Ko(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function vs({title:t,message:e,contentNode:n,okText:s,cancelText:o,showCancel:r,onOk:v,onCancel:u,persistent:i}){pl();const b=_.div({class:"cms-dialog-backdrop",onClick:G=>{G.target===b&&i!==!0&&(u==null||u())}}),R=E(null,"default",{},t),S=E(null,"default",{},e),y=E(null,"default",{},n),P=_.div({class:"cms-dialog cms-panel"},R.length?_.h3(...R):null,S.length?_.p(...S):null,...y,_.div({class:"cms-dialog-actions"},r?JSswift.ui.Btn({onClick:u},o||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:v},s||"OK")));b.appendChild(P),pl().appendChild(b);const Q=G=>{G.key==="Escape"&&(u==null||u())};return document.addEventListener("keydown",Q,{once:!0}),{backdrop:b,close:()=>Ko(b)}}He.dialog.alert=function(t,e={}){return new Promise(n=>{const{backdrop:s,close:o}=vs({title:e.title||"Info",message:t,okText:e.okText||"OK",showCancel:!1,persistent:e.persistent,onOk:()=>{o(),n(!0)},onCancel:()=>{o(),n(!0)}})})},He.dialog.confirm=function(t={}){return new Promise(e=>{const{close:n}=vs({title:t.title||"Conferma",message:t.message||"",okText:t.okText||"Conferma",cancelText:t.cancelText||"Annulla",showCancel:!0,persistent:t.persistent,onOk:()=>{n(),e(!0)},onCancel:()=>{n(),e(!1)}})})},He.dialog.prompt=function(t={}){return new Promise(e=>{const n=JSswift.ui.Input({class:"cms-dialog-input",type:t.type||"text",placeholder:t.placeholder||""});t.value!=null&&(n.value=String(t.value));const{close:s}=vs({title:t.title||"Inserisci valore",message:t.message||"",okText:t.okText||"OK",cancelText:t.cancelText||"Annulla",showCancel:!0,contentNode:_.div(n),persistent:t.persistent,onOk:()=>{const o=n.value;s(),e(o)},onCancel:()=>{s(),e(null)}});setTimeout(()=>n.focus(),0)})},He.services=He.services||{},He.services.loading=He.services.loading||{},He.loading=He.services.loading;let kt=null,In=0;function bl(){if(kt)return kt;kt=document.createElement("div"),kt.className="cms-loading-backdrop",kt.style.cssText=`
|
|
1
|
+
(function(He){var Cl;He.ui=He.ui||{},He.services=He.services||{},He.services.notify=He.services.notify||{};const ts=Symbol("cms.ui.rodPathRaw"),Fn=Symbol("cms.ui.rodPathEnhanced"),Ls=Symbol("cms.ui.rodPathPatchedH"),On=Symbol("cms.ui.rodPathWrappedUI"),xn=new WeakMap,Is=new WeakMap,zs=new WeakMap,Ht=[],Ps=t=>{if(typeof t=="number")return Number.isInteger(t)&&t>=0;if(typeof t!="string"||t===""||t[0]==="-"||t.includes("."))return!1;const e=Number(t);return Number.isInteger(e)&&e>=0&&String(e)===t},ns=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"},ln=t=>{if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};let ss=!1;const Yl=()=>{ss||(ss=!0,queueMicrotask(()=>{ss=!1,Ht.length=0}))},ql=t=>{Ht.push(t),Ht.length>128&&Ht.splice(0,Ht.length-128),Yl()},Js=()=>{if(!Ht.length)return null;const t=Ht.slice();return Ht.length=0,{items:t,index:0}},Es=(t,e)=>{if(!t)return null;const n=t.items[t.index];return!n||!Object.is(n.value,e)?null:(t.index+=1,n)},ls=t=>t&&typeof t=="object"&&t[ts]?t[ts]:t,os=(t,e)=>{const n=xn.get(t);if(!n)return;let s=n.rawGet();for(const o of e){if(s==null)return;s=s[o]}return s},Xl=(t,e,n)=>{const s=xn.get(t);if(!s)return;const o=ls(n);if(!e.length){if(Object.is(s.rawGet(),o))return;s.rawSet(o);return}let r=s.rawGet();(!r||typeof r!="object")&&(r=Ps(e[0])?[]:{});let y=r;for(let u=0;u<e.length-1;u++){const i=e[u];let b=y[i];if(!b||typeof b!="object"){const T=e[u+1];b=Ps(T)?[]:{},y[i]=b}y=b}Object.is(y[e[e.length-1]],o)||(y[e[e.length-1]]=o,s.rawSet(r))},Ts=(t,e)=>[()=>os(t,e),n=>Xl(t,e,n)],Rs=(t,e,n=[])=>{if(!e||typeof e!="object")return e;let s=Is.get(t);s||(s=new WeakMap,Is.set(t,s));const o=s.get(e);if(o)return o;const r=new Proxy(e,{get(y,u,i){if(u===ts)return y;const b=Reflect.get(y,u,i);if(typeof u=="symbol")return b;const T=n.concat(u);return b&&typeof b=="object"?Rs(t,b,T):typeof b=="function"?b.bind(i):(ns(b)&&ql({rod:t,path:T,value:b}),b)},set(y,u,i,b){const T=ls(i),S=Reflect.get(y,u,b);if(Object.is(S,T))return!0;const w=Reflect.set(y,u,T,b);if(w){const z=xn.get(t);z==null||z.rawSet(z.rawGet())}return w},deleteProperty(y,u){const i=Reflect.has(y,u),b=Reflect.deleteProperty(y,u);if(b&&i){const T=xn.get(t);T==null||T.rawSet(T.rawGet())}return b}});return s.set(e,r),r},Ms=t=>{if(!t||typeof t!="object"||t.type!=="rod"||t[Fn])return t;const e=Object.getOwnPropertyDescriptor(t,"value");if(!e||typeof e.get!="function"||typeof e.set!="function")return t;const n=()=>e.get.call(t),s=o=>e.set.call(t,ls(o));return xn.set(t,{rawGet:n,rawSet:s}),Object.defineProperty(t,"value",{get(){const o=n();return!o||typeof o!="object"?o:Rs(t,o,[])},set(o){s(o)},configurable:!0}),Object.defineProperty(t,Fn,{value:!0,configurable:!1}),t},Ql=()=>{if(typeof window._.rod!="function"||window._.rod[Fn])return;const t=window._.rod,e=function(...s){return Ms(t(...s))};Object.defineProperty(e,Fn,{value:!0,configurable:!1}),window._.rod=e};He.ui.withoutRodPathCapture=t=>{const e=Ht.length;try{return t()}finally{Ht.length=e}};const is=(t,e,n="")=>{if(Array.isArray(t)){let r=!1;const y=t.map(u=>{const i=is(u,e,"");return i!==u&&(r=!0),i});return r?y:t}if(ns(t)){const r=Es(e,t);return r?n==="model"?Ts(r.rod,r.path):()=>os(r.rod,r.path):t}if(!ln(t))return t;let s=!1;const o={};for(const r of Object.keys(t)){const y=is(t[r],e,r);o[r]=y,y!==t[r]&&(s=!0)}return s?o:t},as=(t,e,n="")=>{if(Array.isArray(t)){let r=!1;const y=t.map(u=>{const i=as(u,e,"");return i!==u&&(r=!0),i});return r?y:t}if(ns(t)){const r=Es(e,t);return r?n==="model"?Ts(r.rod,r.path):()=>os(r.rod,r.path):t}if(!ln(t))return t;let s=!1;const o={};for(const r of Object.keys(t)){const u=r==="model"||r==="children"?as(t[r],e,r):t[r];o[r]=u,u!==t[r]&&(s=!0)}return s?o:t},Fs=t=>{if(typeof t!="function"||t[On])return t;const e=zs.get(t);if(e)return e;const n=function(...o){const r=Js();if(!r)return t.apply(this,o);let y=!1;const u=o.map(i=>{const b=as(i,r,"");return b!==i&&(y=!0),b});return t.apply(this,y?u:o)};return Object.defineProperty(n,On,{value:!0,configurable:!1}),zs.set(t,n),n},Zl=()=>{const t=He.ui;if(!(!t||t[On])){Object.defineProperty(t,On,{value:!0,configurable:!1});for(const e of Object.keys(t))typeof t[e]=="function"&&(t[e]=Fs(t[e]));He.ui=new Proxy(t,{get(e,n,s){return Reflect.get(e,n,s)},set(e,n,s,o){const r=typeof s=="function"?Fs(s):s;return Reflect.set(e,n,r,o)}})}},eo=()=>{if(!window._||window._[Ls])return;Object.defineProperty(window._,Ls,{value:!0,configurable:!1});const t=new Set(["rod","rodBind","rodFromSignal"]);for(const e of Object.keys(window._)){if(t.has(e))continue;const n=window._[e];typeof n=="function"&&(window._[e]=function(...o){const r=Js();if(!r)return n.apply(this,o);let y=!1;const u=o.map(i=>{const b=is(i,r,"");return b!==i&&(y=!0),b});return n.apply(this,y?u:o)})}};Ql(),((Cl=JSswift.rod)==null?void 0:Cl._all)instanceof Set&&JSswift.rod._all.forEach(t=>Ms(t)),eo(),Zl();const Os={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},di=new Set(Object.values(Os)),to=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),no=new Set(["none","sm","md","lg"]),kn={xxs:{font:"9px",pad:"2px 5px"},xs:{font:"10px",pad:"2px 6px"},sm:{font:"11px",pad:"2px 7px"},md:{font:"12px",pad:"2px 8px"},lg:{font:"13px",pad:"3px 10px"},xl:{font:"14px",pad:"4px 12px"},xxl:{font:"15px",pad:"5px 14px"},xxxl:{font:"16px",pad:"6px 16px"}},Qt=t=>{if(t.indexOf("-")>-1)return!0},mt=t=>{if(!t)return"";const e=String(t).toLowerCase();return Os[e]||""},so=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":to.has(e)?e:null},Dn=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return no.has(e)?e:null},_n=t=>t&&typeof t=="object"&&!t.nodeType&&!Array.isArray(t)&&!(t instanceof Function),rs=t=>t&&t.nodeType===1&&String(t.tagName||"").toLowerCase()==="li",Zt=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];JSswift.isUIPlainObject=_n,JSswift.isListItemNode=rs,JSswift.asNodeArray=Zt;const mn=[{key:"mobile",aliases:["mobile","mobil"],prefix:"cms-"},{key:"tablet",aliases:["tablet"],prefix:"cms-tablet-"},{key:"pc",aliases:["pc","desktop"],prefix:"cms-pc-"}],cs=mn.flatMap(t=>t.aliases),$n=(t,e)=>Object.prototype.hasOwnProperty.call(t||{},e),Nn=(t={},e)=>{if(!e)return null;for(const n of e.aliases){if(!$n(t,n))continue;const s=l(t[n]);if(_n(s))return s}return null},Ds=(t={},e)=>{const n=Array.isArray(e)?e:[e];return mn.some(s=>{const o=Nn(t,s);return!!o&&n.some(r=>$n(o,r))})},lo=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),oo=(t={},e=[])=>{const n=[];for(const s of mn){const o=Nn(t,s);if(o)for(const r of e){const y=Array.isArray(r.prop)?r.prop:[r.prop];let u=!1,i,b="";for(const w of y)if($n(o,w)){i=l(o[w]),b=w,u=!0;break}if(!u||i==null||i===""||i===!1&&!r.allowFalse)continue;const T=typeof r.map=="function"?r.map(i,{propName:b,props:o,device:s,rule:r}):`${r.class}-${lo(i)}`,S=Array.isArray(T)?T:[T];for(const w of S)w&&n.push(String(w).startsWith("cms-")?w:`${s.prefix}${w}`)}}return n},$s=(t={})=>mn.some(e=>!!Nn(t,e)),io=(t={},e=[])=>{for(const n of e){if(!$n(t,n))continue;const s=l(t[n]);if(!(s==null||s===""))return s}},ao=(t,e={})=>{var n;return t==null||t===""||t===!1&&!e.allowFalse?"":typeof e.mapValue=="function"?e.mapValue(t,e):typeof t=="number"?e.number==="raw"?String(t):`${t}px`:e.token&&typeof t=="string"&&((n=JSswift.uiSizes)!=null&&n.includes(t))?`var(--cms-${e.token}-${t})`:String(t)},ro=(t,e,n)=>{!t||n==null||n===""||(typeof t.setProperty=="function"?t.setProperty(e,n):t[e]=n)},co=(t,e)=>t==="mobile"?`cms-rsp-${e}`:`cms-rsp-${t}-${e}`,Vs=(t,e)=>{var n;if(!(!t||!e)){if((n=t.classList)!=null&&n.add){t.classList.add(e);return}t.class=ae([t.class,e])}},Bs=(t,e={},n=[])=>{if(!t||!e||!$s(e))return t;const s=t.style||{};let o=!1;for(const r of n){const y=Array.isArray(r.prop)?r.prop:[r.prop],u=(i,b)=>{const T=io(b,y),S=ao(T,r);if(!S)return;const w=r.var||r.css,z=i==="mobile"?"--cms-rsp-":`--cms-rsp-${i}-`;ro(s,`${z}${w}`,S),Vs(t,co(i,w)),o=!0};u("mobile",e);for(const i of mn){const b=Nn(e,i);b&&u(i.key,b)}}return o&&(t.nodeType||(t.style=s),Vs(t,"cms-rsp")),t};JSswift.uiResponsiveDevices=mn,JSswift.uiResponsiveOmitProps=cs,JSswift.uiResponsivePropsFor=Nn,JSswift.uiResponsiveHasConfig=$s,JSswift.uiResponsiveHasProp=Ds,JSswift.uiResponsiveClasses=oo,JSswift.uiApplyResponsiveProps=Bs;const uo=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(cs):cs;return uo(t,n)};const Yt=(t={})=>{var s;const e=[],n={};if(e.push(fe(t.clickable,"cms-clickable"),fe(t.dense,"cms-dense"),fe(t.flat,"cms-flat"),fe(t.border,"cms-border"),fe(t.glossy,"cms-glossy"),fe(t.glow,"cms-glow"),fe(t.glass,"cms-glass"),fe(t.shadow,"cms-shadow"),fe(t.outline,"cms-outline"),fe(t.rounded,"cms-rounded"),fe(t.gradient,"cms-gradient"),fe(t.textGradient,"cms-text-gradient"),fe(t.lightShadow,"cms-light-shadow")),at(t.color))e.push(()=>{const o=l(t.color),r=mt(o);return r?`cms-state-${r}`:""}),n.backgroundColor=()=>{const o=l(t.color);return mt(o)?"":o&&Qt(String(o))?`var(--cms-${o})`:o||""};else{const o=mt(t.color);o?e.push(`cms-state-${o}`):t.color&&Qt(t.color)?n.backgroundColor=`var(--cms-${t.color})`:t.color&&(n.backgroundColor=t.color)}if(at(t.textColor)?n.color=()=>{const o=l(t.textColor);return o&&Qt(String(o))?`var(--cms-${o})`:o||""}:t.textColor&&Qt(t.textColor)?n.color=`var(--cms-${t.textColor})`:t.textColor&&(n.color=t.textColor),at(t.size))e.push(()=>{var r;const o=l(t.size);return typeof o=="string"&&((r=JSswift.uiSizes)!=null&&r.includes(o))?`cms-size-${o}`:""});else{const o=t.size;typeof o=="string"&&((s=JSswift.uiSizes)!=null&&s.includes(o))&&e.push(`cms-size-${o}`)}if(at(t.shadow))e.push(()=>{const o=l(t.shadow),r=Dn(o);return r?`cms-shadow-${r}`:""}),n.boxShadow=()=>{const o=l(t.shadow);return Dn(o)||o==null||o===!1?"":typeof o=="string"?o:""};else{const o=Dn(t.shadow);o?e.push(`cms-shadow-${o}`):t.shadow&&typeof t.shadow=="string"&&(n.boxShadow=t.shadow)}e.length&&(t.class=ae([t.class,...e])),Object.keys(n).length&&(t.style={...n,...t.style||{}})},fo=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=fo(t),n=e.props||{};if(n&&Object.prototype.hasOwnProperty.call(n,"children")){const s=n.children;(!e.children||e.children.length===0)&&(e.children=Array.isArray(s)?s:[s]),delete n.children}return Yt(n),e};const he=window._;function on(t){if(!t)return null;if(!Array.isArray(t))return t;const e=[],n=t.slice();for(;n.length;){const s=n.shift();s&&(Array.isArray(s)?n.unshift(...s):e.push(s))}return e.length?e:null}const Hs={padding:"p",paddingTop:"p",paddingRight:"p",paddingBottom:"p",paddingLeft:"p",paddingInline:"p",paddingInlineStart:"p",paddingInlineEnd:"p",paddingBlock:"p",paddingBlockStart:"p",paddingBlockEnd:"p",margin:"m",marginTop:"m",marginRight:"m",marginBottom:"m",marginLeft:"m",marginInline:"m",marginInlineStart:"m",marginInlineEnd:"m",marginBlock:"m",marginBlockStart:"m",marginBlockEnd:"m",width:"w",minWidth:"w",maxWidth:"w",height:"h",minHeight:"h",maxHeight:"h"},mo=t=>t===!0?"wrap":t===!1?"nowrap":String(t),js=t=>typeof t=="number"?`repeat(${Math.max(1,Math.round(t))}, minmax(0, 1fr))`:String(t),Ws=[{prop:"display",css:"display",var:"display"},{prop:"direction",css:"flex-direction",var:"flex-direction"},{prop:"wrap",css:"flex-wrap",var:"flex-wrap",allowFalse:!0,mapValue:mo},{prop:"align",css:"align-items",var:"align-items"},{prop:"justify",css:"justify-content",var:"justify-content"},{prop:"self",css:"align-self",var:"align-self"},{prop:"justifySelf",css:"justify-self",var:"justify-self"},{prop:"place",css:"place-items",var:"place-items"},{prop:"placeSelf",css:"place-self",var:"place-self"},{prop:["cols","columns"],css:"grid-template-columns",var:"grid-template-columns",mapValue:js},{prop:"rows",css:"grid-template-rows",var:"grid-template-rows",mapValue:js},{prop:"flow",css:"grid-auto-flow",var:"grid-auto-flow",mapValue:t=>String(t).trim().toLowerCase().replace("-"," ")},{prop:"autoRows",css:"grid-auto-rows",var:"grid-auto-rows"},{prop:["span","gridColumn"],css:"grid-column",var:"grid-column",number:"raw"},{prop:["row","rowSpan"],css:"grid-row",var:"grid-row",number:"raw"},{prop:"area",css:"grid-area",var:"grid-area"},{prop:"gap",css:"gap",var:"gap",token:"gap"},{prop:"rowGap",css:"row-gap",var:"row-gap",token:"gap"},{prop:["columnGap","colGap"],css:"column-gap",var:"column-gap",token:"gap"},{prop:"width",css:"width",var:"width",token:"w"},{prop:"minWidth",css:"min-width",var:"min-width",token:"min-w"},{prop:"maxWidth",css:"max-width",var:"max-width",token:"max-w"},{prop:"height",css:"height",var:"height",token:"h"},{prop:"minHeight",css:"min-height",var:"min-height",token:"min-h"},{prop:"maxHeight",css:"max-height",var:"max-height",token:"max-h"},{prop:"padding",css:"padding",var:"padding",token:"p"},{prop:"paddingLeft",css:"padding-left",var:"padding-left",token:"p"},{prop:"paddingRight",css:"padding-right",var:"padding-right",token:"p"},{prop:"paddingTop",css:"padding-top",var:"padding-top",token:"p"},{prop:"paddingBottom",css:"padding-bottom",var:"padding-bottom",token:"p"},{prop:"margin",css:"margin",var:"margin",token:"m"},{prop:"marginLeft",css:"margin-left",var:"margin-left",token:"m"},{prop:"marginRight",css:"margin-right",var:"margin-right",token:"m"},{prop:"marginTop",css:"margin-top",var:"margin-top",token:"m"},{prop:"marginBottom",css:"margin-bottom",var:"margin-bottom",token:"m"},{prop:"fontSize",css:"font-size",var:"font-size",token:"f"},{prop:"fontWeight",css:"font-weight",var:"font-weight",token:"fw",number:"raw"},{prop:"lineHeight",css:"line-height",var:"line-height",token:"lh",number:"raw"},{prop:"letterSpacing",css:"letter-spacing",var:"letter-spacing",token:"ls"},{prop:["borderRadius","radius"],css:"border-radius",var:"border-radius",token:"r"},{prop:"overflow",css:"overflow",var:"overflow"},{prop:"order",css:"order",var:"order",number:"raw"}],Us=Ws.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return e.some(n=>Object.prototype.hasOwnProperty.call(Hs,n))||e.includes("fontSize")||e.includes("fontWeight")||e.includes("lineHeight")||e.includes("letterSpacing")||e.includes("borderRadius")||e.includes("radius")});JSswift.uiResponsiveStyleRules=Ws,JSswift.uiResponsiveCommonStyleRules=Us;const go=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),ho=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(go(n),ms(e,s))};function Ke(t,e){e.size&&(typeof e.size=="number"?t.style.setProperty("--cms-font-size",`${e.size}px`):JSswift.uiSizes.includes(e.size)&&t.style.setProperty("--cms-font-size",`var(--cms-font-size-${e.size})`)),Object.entries(Hs).forEach(([n,s])=>{Ds(e,n)||ho(t,e[n],n,s)}),Bs(t,e,Us),e.gradient&&typeof e.gradient=="number"&&t.style.setProperty("--set-gradient-deg",`${e.gradient}deg`),e.radius&&(typeof e.radius=="number"?t.style.setProperty("--set-border-radius",`${e.radius}px`):JSswift.uiSizes.includes(e.radius)?t.style.setProperty("--set-border-radius",`var(--cms-r-${e.radius})`):t.style.setProperty("--set-border-radius",`${e.radius}`))}function us(t={},...e){const n=document.createElement("option");t&&typeof t=="object"&&(t.value!=null&&(n.value=String(t.value)),t.label!=null&&(n.label=String(t.label)),t.disabled!=null&&(n.disabled=!!t.disabled),t.selected!=null&&(n.selected=!!t.selected),t.class!=null&&(n.className=String(t.class)));const s=e.flat?e.flat(1/0):e;return s.length?s.forEach(o=>{o==null||o===!1||(o instanceof Node?n.appendChild(o):n.appendChild(document.createTextNode(String(o))))}):t&&t.text!=null&&(n.textContent=String(t.text)),n}JSswift.ui.getSlot=(t,e)=>t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:null,JSswift.ui.renderSlot=(t,e,n,s)=>{const o=JSswift.ui.getSlot(t,e),y=o!=null?typeof o=="function"?o(n||{}):o:s;return y==null?null:on(JSswift.ui.slot(y))};const J=(t,e,n,s)=>{const o=JSswift.ui.renderSlot(t,e,n,s);return o?Array.isArray(o)?o:[o]:[]},gn=new Set;let Vn=!1;const po=new Set(["ctrl","alt","shift","meta"]),bo={control:"ctrl",ctl:"ctrl",option:"alt",opt:"alt",command:"meta",cmd:"meta","\u2318":"meta","\u2303":"ctrl","\u2325":"alt","\u21E7":"shift",esc:"escape",return:"enter",plus:"+",spacebar:"space",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",del:"delete"},yo={ctrl:"Ctrl",alt:"Alt",shift:"Shift",meta:"Meta",escape:"Esc",enter:"Enter",tab:"Tab",space:"Space",backspace:"Backspace",delete:"Del",arrowup:"Up",arrowdown:"Down",arrowleft:"Left",arrowright:"Right",pageup:"PgUp",pagedown:"PgDn"},Gs=()=>{if(typeof navigator=="undefined")return!1;const t=String(navigator.platform||navigator.userAgent||"");return/(mac|iphone|ipad|ipod)/i.test(t)},ds=t=>{if(t==null)return"";const e=String(t).trim().toLowerCase();return e?bo[e]||e:""},Ks=t=>{if(t==null||t===!1)return null;const e=String(t).trim();if(!e)return null;const n=e.split("+").map(ds).filter(Boolean);if(!n.length)return null;const s={raw:e,key:"",ctrl:!1,alt:!1,shift:!1,meta:!1};return n.forEach(o=>{if(o==="mod"){Gs()?s.meta=!0:s.ctrl=!0;return}if(po.has(o)){s[o]=!0;return}s.key=o}),s.key?s:null},wo=t=>t==null||t===!1?[]:(Array.isArray(t)?t:[t]).map(n=>{var o,r,y;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const u=Ks((y=(r=(o=n.shortcode)!=null?o:n.shortcut)!=null?r:n.keys)!=null?y:n.key);return u?{...n,...u}:null}const s=Ks(n);return s?{...s}:null}).filter(Boolean),Ys=(t={})=>{var e,n,s;return wo((s=(n=(e=t.shortcode)!=null?e:t.shortcut)!=null?n:t.hotkey)!=null?s:t.keys)},vo=(t={})=>t.showShortcode===!0||t.showShortcut===!0,An=t=>{const e=ds(t);if(!e)return"";const n={...yo};return Gs()&&(n.alt="Option",n.meta="Cmd"),n[e]?n[e]:e.length===1?e.toUpperCase():e.replace(/(^|[-_ ])(\w)/g,(s,o,r)=>`${o}${r.toUpperCase()}`)},So=t=>{if(!t)return"";const e=[];return t.ctrl&&e.push(An("ctrl")),t.alt&&e.push(An("alt")),t.shift&&e.push(An("shift")),t.meta&&e.push(An("meta")),e.push(An(t.key)),e.filter(Boolean).join("+")},Co=t=>(Array.isArray(t)?t:[]).map(So).filter(Boolean).join(" / "),fs=(t={},e={})=>{const n=Ys(t);if(!vo(t)||!n.length||typeof document=="undefined")return null;const s=document.createElement("span");return s.className=e.className||"cms-shortcode",s.setAttribute("aria-hidden","true"),s.textContent=Co(n),s},xo=t=>{const e=(t==null?void 0:t.nodeType)===1?t:t==null?void 0:t.parentElement;if(!e||typeof e.closest!="function")return!1;if(e.isContentEditable)return!0;const n=e.closest("input, textarea, select, [contenteditable], [contenteditable='true'], [contenteditable='plaintext-only']");return!(!n||"disabled"in n&&n.disabled)},ko=(t,e)=>!t||!e||!!t.ctrlKey!=!!e.ctrl||!!t.altKey!=!!e.alt||!!t.shiftKey!=!!e.shift||!!t.metaKey!=!!e.meta?!1:ds(t.key)===e.key,qs=()=>{gn.size||!Vn||typeof document=="undefined"||(document.removeEventListener("keydown",Xs,!0),Vn=!1)};function Xs(t){var s,o,r,y,u,i;if(!gn.size||!t||t.defaultPrevented||t.isComposing)return;const e=xo(t.target),n=Array.from(gn);for(let b=n.length-1;b>=0;b-=1){const T=n[b],S=T==null?void 0:T.anchor;if(!S||!S.isConnected){gn.delete(T);continue}if(((s=T.isEnabled)==null?void 0:s.call(T))===!1)continue;const w=T.specs.find(ie=>{var $,Y;const D=(Y=($=ie.allowInEditable)!=null?$:T.allowInEditable)!=null?Y:!1;return e&&!D?!1:ko(t,ie)});if(!w)continue;const z=(r=(o=w.preventDefault)!=null?o:T.preventDefault)!=null?r:!0,Q=(u=(y=w.stopPropagation)!=null?y:T.stopPropagation)!=null?u:!0;if(z&&t.preventDefault(),Q&&t.stopPropagation(),((i=T.action)==null?void 0:i.call(T,t,w,S))!==!1)break}qs()}const an=(t,e={},n={})=>{var y,u;const s=Ys(e);if(!t||!s.length||typeof document=="undefined")return null;const o={anchor:t,specs:s,action:typeof n.action=="function"?n.action:()=>{var i;return(i=t.click)==null?void 0:i.call(t)},isEnabled:typeof n.isEnabled=="function"?n.isEnabled:null,allowInEditable:!!n.allowInEditable,preventDefault:(y=n.preventDefault)!=null?y:!0,stopPropagation:(u=n.stopPropagation)!=null?u:!0};gn.add(o),Vn||(document.addEventListener("keydown",Xs,!0),Vn=!0);const r=()=>{gn.delete(o),qs()};return JSswift._registerCleanup(t,r),r},hn=(t,e={})=>{var n;if(!t||typeof t.focus!="function")return!1;try{t.focus({preventScroll:(n=e.preventScroll)!=null?n:!0})}catch(s){t.focus()}if(e.selectText&&typeof t.select=="function")try{t.select()}catch(s){}return!0},ms=(t,e="size")=>typeof t=="number"?t+"px":JSswift.uiSizes.includes(t)?`var(--cms-${e}-${t})`:t,Ot=(t,e=JSswift.uiSizes)=>n=>{const s=String(n).trim();return e!=null&&e.includes(s)?`${t}-${s}`:""},jt=t=>e=>`${t}-${String(e).trim().toLowerCase().replace(/\s+/g,"-")}`,_o=t=>{if(t===!0)return"wrap-wrap";if(t===!1)return"wrap-nowrap";const e=String(t).trim().toLowerCase();return e==="false"||e==="no"||e==="none"?"wrap-nowrap":e==="reverse"?"wrap-reverse":`wrap-${e}`},gs=(t,e,n)=>t?e:n,No=t=>{const e=l(t);if(e==null||e==="")return"";if(e==="auto")return"col-auto";if(e===!0)return"col-24";const n=Number(e);if(Number.isFinite(n)&&n>0)return`col-${Math.max(1,Math.min(24,Math.round(n)))}`;if(typeof e=="string"){const s=e.trim();if(/^\d+$/.test(s))return`col-${Math.max(1,Math.min(24,Number(s)))}`}return""},Ao=t=>{const e=Number(t);return Number.isFinite(e)&&e>0?`grid-cols-${Math.max(1,Math.min(24,Math.round(e)))}`:""},We=(t,e)=>{const n=Array.isArray(e)?e:[e];return JSswift.uiResponsiveDevices.some(s=>{const o=JSswift.uiResponsivePropsFor(t,s);return!!o&&n.some(r=>Object.prototype.hasOwnProperty.call(o,r))})},pn=t=>JSswift.uiResponsiveDevices.find(e=>e.key===t),rn=[{prop:"gap",class:"gap",map:Ot("gap")},{prop:"rowGap",class:"gap-y",map:Ot("gap-y")},{prop:["columnGap","colGap"],class:"gap-x",map:Ot("gap-x")},{prop:"direction",class:"dir",map:jt("dir")},{prop:"wrap",class:"wrap",allowFalse:!0,map:_o},{prop:"align",class:"align",map:jt("align")},{prop:"justify",class:"justify",map:jt("justify")},{prop:"width",class:"w",map:Ot("w")},{prop:"minWidth",class:"min-w",map:Ot("min-w")},{prop:"maxWidth",class:"max-w",map:Ot("max-w")},{prop:"height",class:"h",map:Ot("h")},{prop:"minHeight",class:"min-h",map:Ot("min-h")},{prop:"maxHeight",class:"max-h",map:Ot("max-h")},{prop:"padding",class:"p",map:Ot("p")},{prop:"margin",class:"m",map:Ot("m")}],Lo=rn.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("align")&&!e.includes("justify")}),Qs=[{prop:["col","span"],class:"col",map:No},{prop:"auto",class:"col",map:t=>t?"col-auto":""},{prop:"inline",class:"display",allowFalse:!0,map:t=>gs(t,"display-inline-flex","display-flex")},{prop:"self",class:"self",map:jt("self")},...rn],Zs=[{prop:["cols","columns"],class:"grid-cols",map:Ao},{prop:"inline",class:"display",allowFalse:!0,map:t=>gs(t,"display-inline-grid","display-grid")},{prop:"flow",class:"grid-flow",map:t=>`grid-flow-${String(t).trim().toLowerCase().replace(/\s+/g,"-")}`},...rn],el=[{prop:"inline",class:"display",allowFalse:!0,map:t=>gs(t,"display-inline-flex","display-flex")},{prop:"direction",class:"dir",map:jt("dir")},{prop:"contentAlign",class:"align",map:jt("align")},{prop:"contentJustify",class:"justify",map:jt("justify")},{prop:"align",class:"self",map:jt("self")},{prop:"justify",class:"justify-self",map:jt("justify-self")},{prop:"place",class:"place-self",map:jt("place-self")},...Lo],Io=(JSswift.uiResponsiveStyleRules||[]).filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("span")&&!e.includes("gridColumn")});he.Row=(...t)=>{var g,d,m,F,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(a,C,h={})=>{const P=Array.isArray(a)?a:[a];for(const j of P)if(JSswift.ui.getSlot(s,j)!=null)return J(s,j,h,C);return C==null?[]:J(null,"default",h,C)},r=a=>{var C;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?`var(--cms-s-${a})`:String(a)},y=a=>{var C;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?`var(--cms-w-${a})`:String(a)},u=JSswift.omit(e,["slots","start","left","startClass","body","center","bodyClass","centerClass","end","right","endClass","align","justify","wrap","gap","rowGap","columnGap","direction","reverse","inline","full","width","minWidth","maxWidth",...JSswift.uiResponsiveOmitProps]);u.class=ae(["cms-row",JSswift.uiResponsiveClasses({mobile:e},rn),JSswift.uiResponsiveClasses(e,rn),e.class]);const i={...e.style||{}},b=qe([e.direction,e.reverse],()=>{const a=l(e.direction);return a!=null&&a!==""?String(a):l(e.reverse)?"row-reverse":""}),T=ze(e.align),S=ze(e.justify),w=ze(e.wrap,a=>typeof a=="boolean"?a?"wrap":"nowrap":String(a)),z=ze(e.gap,r),Q=ze(e.rowGap,r),G=ze(e.columnGap,r),ie=ze(e.inline,a=>a?"inline-flex":"flex"),D=ze(e.width,y),$=ze(e.minWidth,y),Y=ze(e.maxWidth,y),W=ze(e.full,a=>a?"100%":"",""),se=qe([e.inline,e.full,e.width],()=>{const a=!!l(e.inline),C=!!l(e.full),h=l(e.width)!=null&&l(e.width)!==!1&&l(e.width)!=="";return!a||C||h?"":"max-content"});b!=null&&!We(e,"direction")&&(i.flexDirection=b),T!=null&&!We(e,"align")&&(i.alignItems=T),S!=null&&!We(e,"justify")&&(i.justifyContent=S),w!=null&&!We(e,"wrap")&&(i.flexWrap=w),z!=null&&!We(e,"gap")&&(i.gap=z),Q!=null&&!We(e,"rowGap")&&(i.rowGap=Q),G!=null&&!We(e,"columnGap")&&(i.columnGap=G),ie!=null&&(i.display=ie),se!=null&&(i.width=se),D!=null&&!We(e,"width")&&(i.width=D),$!=null&&!We(e,"minWidth")&&(i.minWidth=$),Y!=null&&!We(e,"maxWidth")&&(i.maxWidth=Y),W!=null&&(i.width=W),Object.keys(i).length&&(u.style=i),JSswift.uiApplyResponsiveProps(u,e,JSswift.uiResponsiveStyleRules);const me={props:e},re=o(["start","left"],(g=e.start)!=null?g:e.left,me),oe=o(["body","center","default"],(m=(d=e.body)!=null?d:e.center)!=null?m:n,me),le=o(["end","right"],(F=e.end)!=null?F:e.right,me);if(!(re.length||le.length||e.body!=null||e.center!=null||e.startClass||e.bodyClass||e.centerClass||e.endClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"left")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"center")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"right")!=null)){const a=J(s,"default",me,n),C=_.div(u,...a);return Ke(C,e),C}const M={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},Z=(X=e.bodyClass)!=null?X:e.centerClass,q=qe([e.direction,e.reverse],()=>(l(e.direction)||(l(e.reverse)?"row-reverse":"row"))==="row"?"auto":""),ue=[re.length?_.div({class:ae(["cms-row-start",e.startClass]),style:{...M}},...re):null,oe.length?_.div({class:ae(["cms-row-body",Z]),style:{...M,flex:"1 1 auto"}},...oe):null,le.length?_.div({class:ae(["cms-row-end",e.endClass]),style:{...M,justifyContent:"flex-end",marginInlineStart:q}},...le):null].filter(Boolean),R=_.div(u,...ue);return Ke(R,e),R};function Lt(t){return Array.isArray(t)&&(t.length===2||t.length===3&&typeof t[2]=="function")&&typeof t[0]=="function"&&typeof t[1]=="function"}function Jt(t){return!!t&&t.type==="rod"}function at(t){return typeof t=="function"||Jt(t)||Lt(t)}function l(t){return typeof t=="function"?t():Jt(t)?t.value:Lt(t)?t[0]():t}function zo(t){const e=Array.isArray(t)?[...t]:[t];for(;e.length;){const n=e.pop();if(at(n))return!0;Array.isArray(n)&&e.push(...n)}return!1}function ae(t){const e=zo(t),n=()=>{const s=[],o=Array.isArray(t)?[...t]:[t];for(;o.length;){const r=o.shift();if(r==null||r===!1)continue;const y=l(r);if(!(y==null||y===!1||y==="")){if(Array.isArray(y)){o.unshift(...y);continue}s.push(y)}}return s.join(" ")};return e?n:n()}function Dt(t){const e=ae(t);return typeof e=="function"?e():e}function fe(t,e,n=""){return at(t)?()=>l(t)?e:n:t?e:n}function tl(t,e,n=""){return at(t)?()=>{const s=l(t);return s==null||s===""?"":`${e}${s}${n}`}:t==null||t===""?"":`${e}${t}${n}`}function qe(t,e){return(Array.isArray(t)?t:[t]).some(at)?()=>e():e()}function ze(t,e,n=""){return at(t)?()=>{const s=l(t);return s==null||s===!1?n:e?e(s):s}:t==null||t===!1?null:e?e(t):t}JSswift.uiIsReactive=at,JSswift.uiUnwrap=l,JSswift.uiClass=ae,JSswift.uiClassStatic=Dt,JSswift.uiWhen=fe,JSswift.uiClassValue=tl,JSswift.uiComputed=qe,JSswift.uiStyleValue=ze,he.Col=(...t)=>{var P,j,U,ce,L,f;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=k=>Object.prototype.hasOwnProperty.call(e,k),r=(k,A,H={})=>{const ge=Array.isArray(k)?k:[k];for(const Se of ge)if(JSswift.ui.getSlot(s,Se)!=null)return J(s,Se,H,A);return A==null?[]:J(null,"default",H,A)},y=k=>{var A;return k==null||k===!1||k===""?"":typeof k=="number"?`${k}px`:typeof k=="string"&&((A=JSswift.uiSizes)!=null&&A.includes(k))?`var(--cms-s-${k})`:String(k)},u=k=>{var A;return k==null||k===!1||k===""?"":typeof k=="string"&&((A=JSswift.uiSizes)!=null&&A.includes(k))?ms(k,"size"):Be(k)},i=(k,A)=>{const H=l(k);if(H==null||H===!1||H==="")return"";if(H==="auto")return A==="cms-col-"?"cms-col-auto":"";if(H===!0)return`${A}24`;const ge=Number(H);if(Number.isFinite(ge)&&ge>0)return`${A}${Math.max(1,Math.min(24,Math.round(ge)))}`;if(typeof H=="string"){const Se=H.trim();if(!Se)return"";if(Se.startsWith(A))return Se;if(/^\d+$/.test(Se))return`${A}${Math.max(1,Math.min(24,Number(Se)))}`}return""},b=()=>{const k=l(e.flex);if(k!=null&&k!==!1&&k!=="")return String(k);if(l(e.fill))return"1 1 auto";const A=o("grow"),H=o("shrink"),ge=o("basis");if(!A&&!H&&!ge)return"";const Se=A?l(e.grow):0,ye=H?l(e.shrink):1,V=ge?u(l(e.basis)):"auto";return`${Se} ${ye} ${V||"auto"}`},T=qe([e.auto,e.col,e.span],()=>{if(l(e.auto))return"cms-col-auto";const k=o("span")?e.span:e.col;return i(k,"cms-col-")||"cms-col"}),S=JSswift.omit(e,["slots","col","span","sm","md","lg","auto","size","width","minWidth","maxWidth","height","minHeight","maxHeight","gap","rowGap","columnGap","align","justify","inline","center","stack","flex","fill","grow","shrink","basis","self","order","scroll","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass",...JSswift.uiResponsiveOmitProps]),w={...e.style||{}};!We(e,"minWidth")&&w.minWidth==null&&(w.minWidth=0);const z=ze(e.gap,y),Q=ze(e.rowGap,y),G=ze(e.columnGap,y),ie=ze(e.align),D=ze(e.justify),$=o("width")?e.width:e.size,Y=ze($,u),W=ze(e.minWidth,u),se=ze(e.maxWidth,u),me=ze(e.height,u),re=ze(e.minHeight,u),oe=ze(e.maxHeight,u),le=ze(e.self),te=ze(e.order,k=>String(k)),M=ze(e.scroll,k=>k?"auto":"",""),Z=qe([e.flex,e.fill,e.grow,e.shrink,e.basis],b),q=qe([e.center,e.align,e.justify],()=>!!l(e.center)&&(l(e.align)==null||l(e.align)==="")&&(l(e.justify)==null||l(e.justify)===""));Z!=null&&Z!==""&&(w.flex=Z),le!=null&&!We(e,"self")&&(w.alignSelf=le),te!=null&&(w.order=te),M!=null&&M!==""&&(w.overflow=M),Y!=null&&Y!==""&&!We(e,["width","size"])&&(w.width=Y,!o("flex")&&!o("fill")&&!o("grow")&&!o("shrink")&&!o("basis")&&(w.flex="0 0 auto")),W!=null&&!We(e,"minWidth")&&(w.minWidth=W),se!=null&&!We(e,"maxWidth")&&(w.maxWidth=se),me!=null&&!We(e,"height")&&(w.height=me),re!=null&&!We(e,"minHeight")&&(w.minHeight=re),oe!=null&&!We(e,"maxHeight")&&(w.maxHeight=oe),Object.keys(w).length&&(S.style=w);const ue={props:e},R=r(["start","top","header","before"],(U=(j=(P=e.start)!=null?P:e.top)!=null?j:e.header)!=null?U:e.before,ue),g=o("body")?e.body:o("content")?e.content:n,d=r(["body","content","default"],g,ue),m=r(["end","bottom","footer","after"],(f=(L=(ce=e.end)!=null?ce:e.bottom)!=null?L:e.footer)!=null?f:e.after,ue),F=R.length||m.length||o("start")||o("top")||o("header")||o("before")||o("body")||o("content")||o("end")||o("bottom")||o("footer")||o("after")||e.startClass||e.bodyClass||e.contentClass||e.endClass||e.topClass||e.headerClass||e.bottomClass||e.footerClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"top")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"content")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"bottom")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,X=qe([e.stack,e.gap,e.rowGap,e.columnGap,e.align,e.justify,e.center],()=>l(e.stack)||F||[l(e.gap),l(e.rowGap),l(e.columnGap),l(e.align),l(e.justify)].some(A=>A!=null&&A!==!1&&A!=="")?!0:!!l(e.center));if(S.class=ae(["cms-col",T,qe(e.sm,()=>i(e.sm,"cms-sm-col-")),qe(e.md,()=>i(e.md,"cms-md-col-")),qe(e.lg,()=>i(e.lg,"cms-lg-col-")),JSswift.uiResponsiveClasses({mobile:e},Qs),JSswift.uiResponsiveClasses(e,Qs),fe(X,"cms-col-flex"),fe(e.inline,"cms-col-inline"),e.class]),z!=null&&!We(e,"gap")&&(w.gap=z),Q!=null&&!We(e,"rowGap")&&(w.rowGap=Q),G!=null&&!We(e,"columnGap")&&(w.columnGap=G),ie!=null&&!We(e,"align")?w.alignItems=ie:q!=null&&q!==""&&(w.alignItems=q?"center":""),D!=null&&!We(e,"justify")?w.justifyContent=D:q!=null&&q!==""&&(w.justifyContent=q?"center":""),Object.keys(w).length&&(S.style=w),JSswift.uiApplyResponsiveProps(S,e,JSswift.uiResponsiveStyleRules),!F){const k=_.div(S,...J(s,"default",ue,n));return Ke(k,e),k}const a={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},C=[R.length?_.div({class:ae(["cms-col-start",e.startClass,e.topClass,e.headerClass]),style:{...a}},...R):null,d.length?_.div({class:ae(["cms-col-body",e.bodyClass,e.contentClass]),style:{...a,flex:"1 1 auto"}},...d):null,m.length?_.div({class:ae(["cms-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...a}},...m):null].filter(Boolean),h=_.div(S,...C);return Ke(h,e),h},he.Spacer=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=JSswift.omit(e,["slots"]);o.class=ae(["cms-spacer",e.class]);const r=J(s,"default",{},n);return _.div(o,...r)},he.Container=(...t)=>{var m,F,X,a;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e},r=C=>Object.prototype.hasOwnProperty.call(e,C),y={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},u=C=>{if(C==null||C===!1||C==="")return"";if(typeof C=="number")return`${C}px`;const h=String(C).trim().toLowerCase();return h?h==="full"||h==="fluid"?"100%":y[h]||String(C):""},i=C=>{var h;return C==null||C===!1||C===""?"":typeof C=="number"?`${C}px`:typeof C=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(C))?`var(--cms-s-${C})`:String(C)},b=C=>{if(C==null||C===!1||C==="")return"";if(typeof C=="number"&&Number.isFinite(C))return`repeat(${Math.max(1,Math.floor(C))}, minmax(0, 1fr))`;const h=String(C).trim();return h?/^\d+$/.test(h)?`repeat(${Math.max(1,Number(h))}, minmax(0, 1fr))`:h:""},T=C=>C==null||C===""?"":C===!0?"wrap":C===!1?"nowrap":String(C),S={props:e},w=(C,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(P=>w(C,P));return}if(h!=null&&h.nodeType){C.appendChild(h);return}C.appendChild(document.createTextNode(String(h)))}},z=(C,h)=>{const P=JSswift.ui.getSlot(s,C);if(P!=null)return J(s,C,S,null);if(typeof h=="function"){const j=_.div({class:`cms-container-slot-${C}`});return JSswift.reactive.effect(()=>{const U=on(JSswift.ui.slot(h(S)));j.replaceChildren(),Array.isArray(U)?U.forEach(ce=>w(j,ce)):w(j,U)},`UI.Container:${C}`),[j]}return J(s,C,S,h)},Q=r("content")?e.content:n!=null&&n.length?n:null,G=z("before",(m=e.before)!=null?m:e.top),ie=z("header",e.header),D=[...z("left",e.left),...z("start",e.start)],$=z("body",r("body")?e.body:null),Y=(()=>{const C=z("content",r("content")?e.content:null);return C.length?C:z("default",Q)})(),W=[...z("right",e.right),...z("end",e.end)],se=z("footer",e.footer),me=z("after",(F=e.after)!=null?F:e.bottom),re=G.length||ie.length||D.length||W.length||se.length||me.length||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"left")!=null||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"right")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,oe=!!re||$.length>0&&(JSswift.ui.getSlot(s,"body")!=null||re),le=()=>{var h;const C=String(l((h=e.layout)!=null?h:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(C)?C:["inline","inline-flex","inlineflex"].includes(C)||l(e.inline)?"inline":l(e.grid)||l(e.cols)!=null?"grid":C==="block"?"block":l(e.direction)!=null||l(e.wrap)!=null||l(e.align)!=null||l(e.justify)!=null||l(e.gap)!=null||D.length||W.length?"flex":"block"},te=qe([e.layout,e.display,e.inline,e.grid,e.cols,e.direction,e.wrap,e.align,e.justify,e.gap],()=>{const C=le();return C==="block"?"":`is-${C}`}),M={...o.style||{}},Z=(C,h)=>{h!=null&&(M[C]=h)};Z("maxWidth",qe([e.maxWidth,e.fluid],()=>l(e.fluid)?"none":u(l(e.maxWidth))||"")),Z("width",ze(e.width,u)),Z("minWidth",ze(e.minWidth,u)),Z("--cms-container-padding",ze(e.padding,i)),Z("--cms-container-padding-x",ze((X=e.paddingX)!=null?X:e.gutter,i)),Z("--cms-container-padding-y",ze(e.paddingY,i)),Z("--cms-container-gap",ze(e.gap,i)),Z("--cms-container-section-gap",ze((a=e.sectionGap)!=null?a:e.gap,i)),Z("--cms-container-cols",ze(e.cols,b)),Z("--cms-container-align",ze(e.align,C=>String(C))),Z("--cms-container-justify",ze(e.justify,C=>String(C))),Z("--cms-container-direction",ze(e.direction,C=>String(C))),Z("--cms-container-wrap",ze(e.wrap,T));const q=JSswift.omit(o,["after","afterClass","align","as","before","beforeClass","body","bodyClass","bottom","cols","content","contentClass","direction","display","end","endClass","fluid","footer","footerClass","gap","grid","gutter","header","headerClass","inline","justify","layout","left","mainClass","maxWidth","minWidth","padding","paddingX","paddingY","right","sectionGap","slots","start","startClass","tag","top","width","wrap"]);q.class=ae(["cms-container",fe(e.fluid,"is-fluid"),fe(oe,"has-structure"),oe?"":te,o.class]),q.style=M,JSswift.uiApplyResponsiveProps(q,e,JSswift.uiResponsiveStyleRules);const ue=(C,h,P)=>h.length?_.div({class:ae(["cms-container-section",`cms-container-${C}`,P])},...h):null,R=$.length?_.div({class:ae(["cms-container-body",oe?te:"",e.bodyClass])},...$):D.length||Y.length||W.length?_.div({class:ae(["cms-container-body",oe?te:"",e.bodyClass])},ue("start",D,e.startClass),Y.length?_.div({class:ae(["cms-container-main",e.mainClass,e.contentClass])},...Y):null,ue("end",W,e.endClass)):null,g=(()=>{var h;const C=String(l((h=e.tag)!=null?h:e.as)||"div").toLowerCase();return typeof _[C]=="function"?_[C]:_.div})(),d=oe?g(q,ue("before",G,e.beforeClass),ue("header",ie,e.headerClass),R,ue("footer",se,e.footerClass),ue("after",me,e.afterClass)):g(q,...$.length?$:Y);return Ke(d,e),d},he.Card=(...t)=>{var ce,L;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e};Yt(o);const r=(f,k)=>{var A;return!!(f&&f.nodeType===1&&((A=f.classList)!=null&&A.contains(`cms-card-${k}`)))},u=(f=>f==null?null:typeof f=="string"?he.Icon({name:f,size:e.iconSize||e.size||"lg"}):JSswift.ui.slot(f,{as:"icon"}))(e.icon),i=e.image?_.img({src:e.image,alt:e.imageAlt||"",class:ae(["cms-card-cover-media",e.imageClass]),style:e.imageStyle}):e.cover,b={dense:!!l(e.dense),flat:!!l(e.flat),clickable:!!l(e.clickable),to:l(e.to)||null},T=J(s,"default",b,n!=null&&n.length?n:[]),S={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},w=[];T.forEach(f=>{r(f,"identifier")?S.identifier.push(f):r(f,"cover")?S.cover.push(f):r(f,"media")?S.media.push(f):r(f,"header")?S.header.push(f):r(f,"body")?S.body.push(f):r(f,"footer")?S.footer.push(f):r(f,"actions")?S.actions.push(f):w.push(f)});const z=J(s,"identifier",b,e.identifier),Q=J(s,"cover",b,i),G=J(s,"media",b,e.media),ie=J(s,"eyebrow",b,(ce=e.eyebrow)!=null?ce:e.kicker),D=J(s,"title",b,e.title),$=J(s,"subtitle",b,e.subtitle),Y=J(s,"header",b,e.header),W=J(s,"icon",b,u),se=J(s,"aside",b,(L=e.aside)!=null?L:e.headerAside),me=J(s,"body",b,e.body),re=J(s,"footer",b,e.footer),oe=J(s,"actions",b,e.actions),le=z.length?_.div({class:ae(["cms-card-identifier",e.identifierClass])},...z):null,te=Q.length?_.div({class:ae(["cms-card-cover",e.coverClass])},...Q):null,M=G.length?_.div({class:ae(["cms-card-media",e.mediaClass])},...G):null,q=W.length||ie.length||D.length||$.length||Y.length||se.length?_.div({class:ae(["cms-card-header",e.headerClass])},_.div({class:"cms-card-head"},W.length?_.div({class:"cms-card-icon"},...W):null,_.div({class:"cms-card-head-main"},ie.length?_.div({class:ae(["cms-card-eyebrow",e.eyebrowClass])},...ie):null,D.length?_.div({class:ae(["cms-card-title",e.titleClass])},...D):null,$.length?_.div({class:ae(["cms-card-subtitle",e.subtitleClass])},...$):null,Y.length?_.div({class:ae(["cms-card-header-content",e.headerContentClass])},...Y):null),se.length?_.div({class:ae(["cms-card-aside",e.asideClass])},...se):null)):null,ue=[...me,...w],R=ue.length?_.div({class:ae(["cms-card-body",e.bodyClass])},...ue):null,g=[...oe,...S.actions],d=re.length||g.length?_.div({class:ae(["cms-card-footer",e.footerClass])},...re,g.length?_.div({class:"cms-card-actions"},...g):null):null,m=qe([e.clickable,e.to],()=>l(e.clickable)||l(e.to)?"cms-card-clickable":""),F=z.length||S.identifier.length,X=Q.length||S.cover.length||G.length||S.media.length,a=JSswift.omit(o,["actions","aside","asideClass","body","bodyClass","clickable","cover","coverClass","coverHeight","dense","eyebrow","eyebrowClass","flat","footer","footerClass","header","headerAside","headerClass","headerContentClass","icon","iconSize","identifier","identifierClass","image","imageAlt","imageClass","imageStyle","kicker","media","mediaClass","slots","subtitle","subtitleClass","title","titleClass","to","display","direction","wrap","align","justify","gap","rowGap","columnGap","cols","columns"]);a.class=ae(["cms-panel","cms-card","cms-clear-set","cms-singularity",fe(e.flat,"cms-card-flat"),fe(e.dense,"cms-card-dense"),fe(F,"cms-card-has-identifier"),fe(X,"cms-card-has-top-visual"),m,o.class]),a.style={...o.style||{}},e.coverHeight!=null&&(a.style["--cms-card-cover-height"]=Be(l(e.coverHeight))),JSswift.uiApplyResponsiveProps(a,e,JSswift.uiResponsiveStyleRules);const C=e.onClick,h=e.onKeydown,P=f=>{var A;if(C==null||C(f),f.defaultPrevented)return;const k=l(e.to);k&&((A=JSswift.router)!=null&&A.navigate)&&(f.preventDefault(),JSswift.router.navigate(k))},j=f=>{h==null||h(f),!f.defaultPrevented&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),P(f))};(l(e.clickable)||l(e.to))&&(a.onClick=P,a.onKeydown=j,a.tabIndex==null&&(a.tabIndex=0),a.role==null&&(a.role="button"));const U=_.div(a,le,...S.identifier,te,...S.cover,M,...S.media,q,...S.header,R,...S.body,d,...S.footer);return Ke(U,e),U},he.Btn=(...t)=>{var te;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe([e.color,e.state],()=>{const M=l(e.color)||l(e.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(M)?M:l(e.state)||""}),r=ae(["cms-clear-set","cms-btn","cms-singularity","cms-clickable",o,fe(e.outline,"outline"),e.class]),y=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);y.class=r;const u=()=>!!l(e.loading),i=()=>!!l(e.disabled)||u(),b=e.icon!=null?typeof e.icon=="string"?he.Icon({name:e.icon}):e.icon:null,T=e.iconRight!=null?typeof e.iconRight=="string"?he.Icon({name:e.iconRight}):e.iconRight:null,S=JSswift.ui.renderSlot(s,"icon",{},b),w=JSswift.ui.renderSlot(s,"iconRight",{},T),z=JSswift.ui.renderSlot(s,"label",{},e.label),Q=J(s,"default",{},n),G=[],ie=M=>{M&&(Array.isArray(M)?G.push(...M):G.push(M))},D=e.iconAlign;(D==="after"||D==="right")&&!T?(ie(z),Q.length&&G.push(...Q),ie(S)):(ie(S),ie(z),Q.length&&G.push(...Q)),ie(w),ie(fs(e,{className:"cms-shortcode cms-btn-shortcode"})),G.length===0&&G.push(_.span("Button"));const Y=_.span({class:"cms-btn-loading",hidden:!0}),W=_.span({class:"cms-btn-content"},...G);let se=!1;const me=()=>{const M=he.Spinner?he.Spinner({size:e.loadingSize||e.spinnerSize||16,thickness:e.loadingThickness||2,color:e.loadingColor||"currentColor",label:e.loadingText||null,"aria-label":e.loadingText?null:"Loading"}):_.span({class:"cms-muted",style:{marginRight:"8px"}},e.loadingText||"Loading");return J(null,"default",{},JSswift.ui.renderSlot(s,"loading",{},M))},re=M=>{var g;if((g=e.onPointerDown)==null||g.call(e,M),i()||!(M!=null&&M.currentTarget))return;const Z=M.currentTarget,q=Z.getBoundingClientRect(),ue=typeof M.clientX=="number"?M.clientX-q.left:q.width/2,R=typeof M.clientY=="number"?M.clientY-q.top:q.height/2;Z.style.setProperty("--cms-burst-x",`${ue}px`),Z.style.setProperty("--cms-burst-y",`${R}px`),Z.classList.remove("cms-btn-burst"),Z.offsetWidth,Z.classList.add("cms-btn-burst")},oe=_.button({...y,disabled:i(),onClick:M=>{var Z,q;return i()?((Z=M==null?void 0:M.preventDefault)==null||Z.call(M),!1):(q=e.onClick)==null?void 0:q.call(e,M)},onPointerDown:re,"aria-disabled":i()?"true":null,"aria-busy":u()?"true":null},Y,W),le=JSswift.reactive.effect(()=>{const M=u(),Z=i();oe.disabled=Z,oe.classList.toggle("is-loading",M),oe.setAttribute("aria-disabled",Z?"true":"false"),M?oe.setAttribute("aria-busy","true"):oe.removeAttribute("aria-busy"),Y.hidden=!M,M!==se&&(Y.replaceChildren(...M?me():[]),se=M)},"UI.Btn:state");return(te=JSswift._registerCleanup)==null||te.call(JSswift,oe,le),Ke(oe,e),an(oe,e,{isEnabled:()=>!i(),action:()=>{if(i())return!1;oe.click()}}),oe},he.Button=he.Btn,JSswift.ui.Btn=he.Btn,JSswift.ui.Button=he.Button;let Po=0;he.FormField=(t={})=>{var te,M,Z,q,ue,R,g;Yt(t);const e=t.slots||{},n=qe([t.color,t.state],()=>{const d=l(t.color)||l(t.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(d)?d:l(t.state)||""}),s=_.div({class:ae(["cms-clear-field-set","cms-field","cms-singularity-field",n,fe(t.fill,"cms-field-fill"),fe(t.outline,"outline"),t.wrapClass,t.class])}),o=J(e,"topLabel",{},t.topLabel);o.length&&s.appendChild(_.div({class:"cms-field-label"},...o));const r=t.multi||t.multiple,y=typeof t.control=="function"?t.control():t.control,u=()=>{if(typeof t.hasValue=="function")return!!t.hasValue();if(t.hasValue!=null)return!!l(t.hasValue);const d=t.getValue?t.getValue():null;return!(d==null||d==="")},i=()=>JSswift.reactive.untracked(u),b=()=>{var d,m;t.disabled||t.readonly||((d=t.onClear)==null||d.call(t),(m=t.onFocus)==null||m.call(t))},T=JSswift.ui.renderSlot(e,"control",{control:y,clear:b,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:i()},null);let S=null,w=null;if(T)S=Array.isArray(T)?_.div({class:"cms-control"},...T):T;else{S=_.div({class:"cms-control"});const d=_.div({class:"cms-addon cms-addon-left"}),m=t.icon!=null?typeof t.icon=="string"?he.Icon({name:t.icon}):t.icon:null,F=JSswift.ui.renderSlot(e,"icon",{},m),X=JSswift.ui.renderSlot(e,"prefix",{},t.prefix);J(null,"default",{},F).forEach(k=>d.appendChild(k)),J(null,"default",{},X).forEach(k=>d.appendChild(k)),d.childNodes.length&&S.appendChild(d);const a=_.div({class:"cms-mid"+(d.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});y&&a.appendChild(y);const C=J(e,"label",{},t.label);if(C.length){const k=_.div({class:ae(["cms-float-label",fe(r,"cms-multiselect")])},...C);a.appendChild(k)}S.appendChild(a);const h=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:b},he.Icon({name:"close"})):null,P=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:i()},h);P&&(P.onclick=k=>{k.stopPropagation(),b()},J(null,"default",{},P).forEach(k=>S.appendChild(k))),w=h,w&&((te=t.clearable)!=null&&te.action)&&t.clearable.action(k=>k?w.classList.remove("cms-d-none"):w.classList.add("cms-d-none"));const j=_.div({class:"cms-addon cms-addon-right"}),U=t.iconRight!=null?typeof t.iconRight=="string"?he.Icon({name:t.iconRight}):t.iconRight:null,ce=JSswift.ui.renderSlot(e,"iconRight",{},U),L=JSswift.ui.renderSlot(e,"suffix",{},t.suffix),f=JSswift.ui.renderSlot(e,"shortcode",{props:t},fs(t,{className:"cms-shortcode cms-field-shortcode"}));J(null,"default",{},L).forEach(k=>j.appendChild(k)),J(null,"default",{},ce).forEach(k=>j.appendChild(k)),J(null,"default",{},f).forEach(k=>j.appendChild(k)),j.childNodes.length&&(S.appendChild(j),a.classList.add("cms-with-right"))}const z=d=>d&&(d&&typeof d.action=="function"?d.value:Array.isArray(d)&&typeof d[0]=="function"?d[0]():typeof d=="function"?d():d),Q=d=>d==null||d===!1||d===""?!1:Array.isArray(d)?d.length>0:!0;let G=null;const ie=`jsswift-field-message-${++Po}`,D=()=>{if(!(y!=null&&y.setAttribute))return;const d=[l(t.ariaDescribedBy),G==null?void 0:G.id].filter(Boolean).join(" ").trim();d?y.setAttribute("aria-describedby",[...new Set(d.split(/\s+/))].join(" ")):y.removeAttribute("aria-describedby")};s._syncDescription=D;const $=()=>{const d=[{key:"error",value:z(t.error),slot:"errorMessage",className:"cms-error"},{key:"warning",value:z(t.warning),slot:"warning",className:"cms-warning"},{key:"success",value:z(t.success),slot:"success",className:"cms-success"},{key:"note",value:z(t.note),slot:"note",className:"cms-note"},{key:"hint",value:z(t.hint),slot:"hint",className:"cms-hint"}];let m=null;for(const h of d)if(Q(h.value)){m=h;break}const F={error:d[0].value,warning:d[1].value,success:d[2].value,note:d[3].value,hint:d[4].value,props:t},X=m?J(e,m.slot,F,m.value):[],a=X.length?_.div({id:ie,class:m==null?void 0:m.className},...X):null;["error","warning","success","note"].forEach(h=>{var P;return(P=S==null?void 0:S.classList)==null?void 0:P.toggle(h,(m==null?void 0:m.key)===h)}),G?a?G.replaceWith(a):G.remove():a&&s.appendChild(a),G=a,D()},Y=()=>{var m;const d=u();(m=S==null?void 0:S.classList)==null||m.toggle("has-value",d),w&&(w.style.display=d?"":"none")};JSswift.reactive.untracked(Y),(M=S==null?void 0:S.classList)==null||M.toggle("disabled",!!t.disabled),s.appendChild(S);const W=JSswift.ui.getSlot(e,"errorMessage"),se=JSswift.ui.getSlot(e,"warning"),me=JSswift.ui.getSlot(e,"success"),re=JSswift.ui.getSlot(e,"note"),oe=JSswift.ui.getSlot(e,"hint");return!!((Z=t.error)!=null&&Z.action||(q=t.warning)!=null&&q.action||(ue=t.success)!=null&&ue.action||(R=t.note)!=null&&R.action||(g=t.hint)!=null&&g.action)||Array.isArray(t.error)&&typeof t.error[0]=="function"||Array.isArray(t.warning)&&typeof t.warning[0]=="function"||Array.isArray(t.success)&&typeof t.success[0]=="function"||Array.isArray(t.note)&&typeof t.note[0]=="function"||Array.isArray(t.hint)&&typeof t.hint[0]=="function"||typeof t.error=="function"||typeof t.warning=="function"||typeof t.success=="function"||typeof t.note=="function"||typeof t.hint=="function"||typeof W=="function"||typeof se=="function"||typeof me=="function"||typeof re=="function"||typeof oe=="function"?JSswift.reactive.effect(()=>{$()},"UI.FormField:message"):$(),s._refresh=Y,s._control=S,s._el=y,s},he.InputRaw=(t={})=>{var T;const e=_.input({class:ae(["cms-input-raw",t.class]),type:t.type||"text",name:t.name,placeholder:t.placeholder,autocomplete:t.autocomplete,value:t.value});let n=(T=e.value)!=null?T:"";const s=()=>{var w;const S=(w=e.value)!=null?w:"";S!==n&&(n=S,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let o=null,r=!1;const y=()=>{if(r)return;r=!0;let S=0;const w=()=>{if(s(),S+=1,S>=10){r=!1;return}setTimeout(w,120)};setTimeout(w,40)},u=()=>{o||(o=setInterval(()=>{if(document.activeElement!==e){clearInterval(o),o=null;return}s()},250))},i=()=>{o&&(clearInterval(o),o=null)};e.addEventListener("input",()=>{var S;n=(S=e.value)!=null?S:""}),e.addEventListener("change",()=>{var S;n=(S=e.value)!=null?S:""}),e.addEventListener("animationstart",S=>{S.animationName==="cms-autofill"&&(s(),u(),y())}),e.addEventListener("focus",()=>{u(),y(),setTimeout(s,50)}),e.addEventListener("blur",()=>{i(),setTimeout(s,0)}),setTimeout(s,0),y();const b=t.model;if(b){if(typeof b=="object"&&typeof b._bind=="function")He.rodModel(e,b);else if(Array.isArray(b)&&typeof b[0]=="function"&&typeof b[1]=="function"){const S=He.rodFromSignal(b[0],b[1]);He.rodModel(e,S)}}return an(e,t,{isEnabled:()=>!e.disabled,action:()=>hn(e,{selectText:!!t.selectOnShortcode})}),e};function nl(t,e,n,s=!1){t.focus=r=>e.focus(r);const o=(r,y)=>{y==null||y===!1?e.removeAttribute(r):e.setAttribute(r,String(y))};JSswift.reactive.effect(()=>{var i,b;const r=(i=l(n.ariaLabel))!=null?i:typeof n.label=="string"?n.label:null;o("aria-label",r),o("aria-labelledby",l(n.ariaLabelledBy)),(b=t._syncDescription)==null||b.call(t);const y=n.ariaInvalid==null?!!l(n.error):!!l(n.ariaInvalid);e.setAttribute("aria-invalid",String(y));const u=!!l(n.required);if(e.setAttribute("aria-required",String(u)),s){e.required=u;for(const T of["min","max","step","pattern","minLength","maxLength"])o(T.toLowerCase(),l(n[T]))}},"UI.Field:controlAttributes")}he.Input=(t={})=>{var G,ie,D;const e=t.slots||{},n={...t,label:(G=t.label)!=null?G:t.placeholder},s=_.input({class:ae(["cms-input",t.class]),type:t.type||"text",name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,value:(ie=t.value)!=null?ie:"",disabled:!!t.disabled,readOnly:!!t.readonly});let o=(D=s.value)!=null?D:"";const r=()=>{var Y;const $=(Y=s.value)!=null?Y:"";$!==o&&(o=$,s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})))};let y=null,u=!1;const i=()=>{if(u)return;u=!0;let $=0;const Y=()=>{if(r(),$+=1,$>=10){u=!1;return}setTimeout(Y,120)};setTimeout(Y,40)},b=()=>{y||(y=setInterval(()=>{if(document.activeElement!==s){clearInterval(y),y=null;return}r()},250))},T=()=>{y&&(clearInterval(y),y=null)};s.addEventListener("input",()=>{var $,Y;o=($=s.value)!=null?$:"",(Y=t.onInput)==null||Y.call(t,s.value)}),s.addEventListener("change",()=>{var $,Y;o=($=s.value)!=null?$:"",(Y=t.onChange)==null||Y.call(t,s.value)}),s.addEventListener("focus",$=>{var Y;(Y=t.onFocus)==null||Y.call(t,$),b(),i(),setTimeout(r,50)}),s.addEventListener("blur",$=>{var Y;(Y=t.onBlur)==null||Y.call(t,$),T(),setTimeout(r,0)}),s.addEventListener("animationstart",$=>{$.animationName==="cms-autofill"&&(r(),b(),i())}),setTimeout(r,0),i();const S=t.model;if(S){const $=Y=>{let W=!1;const se=re=>{const oe=re!=null?re:"";s.value!==oe&&(s.value=oe,o=oe)};Y.action(re=>{if(!W){W=!0;try{se(re)}finally{W=!1}}}),JSswift.reactive.untracked(()=>se(Y.value));const me=re=>{if(W||re!=null&&re.isComposing)return;const oe=s.value;if(Y.value!==oe){W=!0;try{Y.value=oe}finally{W=!1}}};s.addEventListener("input",me),s.addEventListener("compositionend",me),typeof Y.onDispose=="function"&&Y.onDispose(()=>{s.removeEventListener("input",me),s.removeEventListener("compositionend",me)})};if(typeof S=="object"&&typeof S._bind=="function")$(S);else if(Array.isArray(S)&&typeof S[0]=="function"&&typeof S[1]=="function"){const Y=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(S[0],S[1]));$(Y)}}const w=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),z=Array.isArray(w)?_.div({style:{display:"contents"}},...w):w,Q=he.FormField({...n,control:z,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var $;return($=Q._refresh)==null?void 0:$.call(Q)}),s.addEventListener("change",()=>{var $;return($=Q._refresh)==null?void 0:$.call(Q)}),Q._input=s,nl(Q,s,t,!0),an(s,t,{isEnabled:()=>!s.disabled,action:()=>hn(s,{selectText:!!t.selectOnShortcode})}),Q},he.Textarea=(t={})=>{var b,T,S,w;const e=t.slots||{},n={...t,label:(b=t.label)!=null?b:t.placeholder,wrapClass:ae(["cms-textarea-field",t.wrapClass])},s=_.textarea({class:ae(["cms-input","cms-textarea",t.class]),name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,rows:t.rows,cols:t.cols,maxLength:(T=t.maxLength)!=null?T:t.maxlength,minLength:(S=t.minLength)!=null?S:t.minlength,wrap:t.wrap,value:(w=t.value)!=null?w:"",disabled:!!t.disabled,readOnly:!!t.readonly});s.addEventListener("input",()=>{var z;(z=t.onInput)==null||z.call(t,s.value)}),s.addEventListener("change",()=>{var z;(z=t.onChange)==null||z.call(t,s.value)}),s.addEventListener("focus",z=>{var Q;(Q=t.onFocus)==null||Q.call(t,z)}),s.addEventListener("blur",z=>{var Q;(Q=t.onBlur)==null||Q.call(t,z)});const o=t.model;if(o){const z=Q=>{let G=!1;const ie=$=>{const Y=$!=null?$:"";s.value!==Y&&(s.value=Y)};Q.action($=>{if(!G){G=!0;try{ie($)}finally{G=!1}}}),JSswift.reactive.untracked(()=>ie(Q.value));const D=$=>{if(G||$!=null&&$.isComposing)return;const Y=s.value;if(Q.value!==Y){G=!0;try{Q.value=Y}finally{G=!1}}};s.addEventListener("input",D),s.addEventListener("compositionend",D),typeof Q.onDispose=="function"&&Q.onDispose(()=>{s.removeEventListener("input",D),s.removeEventListener("compositionend",D)})};if(typeof o=="object"&&typeof o._bind=="function")z(o);else if(Array.isArray(o)&&typeof o[0]=="function"&&typeof o[1]=="function"){const Q=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(o[0],o[1]));z(Q)}}const r=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",y=JSswift.ui.renderSlot(e,r,{textarea:s,input:s,props:t},s),u=Array.isArray(y)?_.div({style:{display:"contents"}},...y):y,i=he.FormField({...n,control:u,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var z;return(z=i._refresh)==null?void 0:z.call(i)}),s.addEventListener("change",()=>{var z;return(z=i._refresh)==null?void 0:z.call(i)}),i._input=s,i._textarea=s,an(s,t,{isEnabled:()=>!s.disabled,action:()=>hn(s,{selectText:!!t.selectOnShortcode})}),i},he.Search=(t={})=>{var I,we;const e=t.slots||{},n=E=>!!E&&(typeof E=="object"&&typeof E._bind=="function"||Lt(E)),s=n(t.model)?t.model:n(t.value)?t.value:null,o=s?typeof s=="object"&&typeof s._bind=="function"?s.value:s[0]():l(t.value),[r,y]=JSswift.reactive.signal(o==null?"":String(o)),[u,i]=JSswift.reactive.signal(!1),[b,T]=JSswift.reactive.signal(!1),[S,w]=JSswift.reactive.signal(null),[z,Q]=JSswift.reactive.signal([]),[G,ie]=JSswift.reactive.signal(-1),D=`cms-search-${Math.random().toString(36).slice(2,10)}`,$=new Map;let Y=null,W=null,se=null,me=0,re=0,oe=!1,le=-1,te=[];const M=(E,x)=>{const v=Number(l(E));return Number.isFinite(v)?v:x},Z=(E,x=!1)=>{const v=l(E);return v==null?x:!!v},q=()=>Z(t.disabled,!1),ue=()=>Z(t.readonly,!1),R=()=>Math.max(0,M(t.minLength,t.endpoint?1:0)),g=()=>Math.max(0,M(t.debounce,250)),d=E=>{var v,c,N,de,Ae;const x=t.getLabel||t.labelOf;return typeof x=="function"?x(E):E==null?"":typeof E=="string"||typeof E=="number"?String(E):(Ae=(de=(N=(c=(v=E.label)!=null?v:E.title)!=null?c:E.name)!=null?N:E.text)!=null?de:E.value)!=null?Ae:""},m=E=>{var v,c,N;const x=t.getValue||t.valueOf;return typeof x=="function"?x(E):E==null?"":typeof E=="string"||typeof E=="number"?E:(N=(c=(v=E.value)!=null?v:E.id)!=null?c:E.key)!=null?N:d(E)},F=E=>Array.isArray(E)?E:!E||typeof E!="object"?[]:Array.isArray(E.items)?E.items:Array.isArray(E.results)?E.results:Array.isArray(E.data)?E.data:[],X=async(E,x)=>{const v=typeof E=="function"?E(x,{props:t}):l(E);return v&&typeof v.then=="function"?await v:v},a=(E,x)=>{const v=typeof E=="function"?E(x,{props:t}):l(E);if(!v)return"";const c=String(v),N=new URL(c,window.location.href),de=l(t.queryParam)||"q";de&&N.searchParams.set(de,x);const Ae=typeof t.params=="function"?t.params(x,{props:t}):l(t.params);return Ae&&typeof Ae=="object"&&Object.keys(Ae).forEach(Je=>{const B=l(Ae[Je]);B==null||B===!1||N.searchParams.set(Je,String(B))}),N.toString()},C=(E,x={})=>{var c,N;const v=E==null?"":String(E);r()!==v&&y(v),ee.value!==v&&(ee.value=v),Y&&!x.fromModel&&Y(v),x.fromModel||(c=t.onInput)==null||c.call(t,v,x.event),(N=pe==null?void 0:pe._refresh)==null||N.call(pe)},h=()=>{i(!1),ie(-1)},P=()=>b()||S()||z().length?!0:r().trim().length>=R()?!!(t.emptyText||JSswift.ui.getSlot(e,"empty")!=null):!!(t.startText||JSswift.ui.getSlot(e,"empty")!=null),j=()=>{q()||P()&&(i(!0),Se())},U=()=>{Q([]),w(null),ie(-1)},ce=async(E,x={})=>{var B,Le,Me,Ee,De,Ue;const v=E==null?"":String(E).trim(),c=++me,N=l((B=t.endpoint)!=null?B:t.url),de=(Me=(Le=t.items)!=null?Le:t.options)!=null?Me:t.suggestions;if(se&&(se.abort(),se=null),v.length<R()){T(!1),U(),x.open&&P()?j():P()||h();return}const Ae=t.cache!==!1,Je=`${N||"local"}::${v}`;if(Ae&&$.has(Je)){Q($.get(Je)),w(null),T(!1),ie($.get(Je).length?0:-1),x.open!==!1&&j();return}T(!0),w(null),x.open!==!1&&j(),(Ee=t.onSearch)==null||Ee.call(t,v);try{let Ye;if(N){se=new AbortController;const Te=a(N,v),je=await fetch(Te,{method:"GET",headers:t.headers,credentials:t.credentials,signal:se.signal});if(!je.ok)throw new Error(`Search request failed (${je.status})`);Ye=await(t.parseResponse||(nt=>nt.json()))(je)}else if(de!=null){const Te=F(await X(de,v)),je=t.filter||((tt,nt)=>String(d(tt)).toLowerCase().includes(nt.toLowerCase()));Ye=Te.filter(tt=>je(tt,v))}else Ye=[];if(c!==me)return;const Ze=typeof t.mapResponse=="function"?t.mapResponse(Ye,v):F(Ye),Qe=F(Ze);Ae&&$.set(Je,Qe),Q(Qe),ie(Qe.length?0:-1),(De=t.onResults)==null||De.call(t,Qe,v)}catch(Ye){if((Ye==null?void 0:Ye.name)==="AbortError"||c!==me)return;w(Ye),Q([]),ie(-1),(Ue=t.onError)==null||Ue.call(t,Ye,v)}finally{c===me&&(T(!1),se=null,Se())}},L=(E,x={})=>{W&&clearTimeout(W);const v=x.immediate?0:g();W=setTimeout(()=>{W=null,ce(E,x)},v)},f=E=>{var v;const x=r();(v=t.onSubmit)==null||v.call(t,x,E),t.submitOnEnter!==!1&&L(x,{immediate:!0,open:!0})},k=(E,x)=>{var N;if(!E)return;const v=m(E),c=d(E);t.commitValue==="value"?C(v,{event:x}):t.commitValue!==!1&&C(c,{event:x}),(N=t.onSelect)==null||N.call(t,E,{value:v,label:c,query:r(),event:x}),t.closeOnSelect!==!1&&h()},A=E=>{const x=z();if(!x.length)return;const v=G(),c=v<0?E>0?0:x.length-1:Math.max(0,Math.min(x.length-1,v+E));ie(c)},H=E=>{const x=E==null?"":String(E),v=r().trim();if(!v||t.highlight===!1)return[document.createTextNode(x)];const c=x.toLowerCase().indexOf(v.toLowerCase());return c<0?[document.createTextNode(x)]:[document.createTextNode(x.slice(0,c)),_.mark({class:"cms-search-highlight"},x.slice(c,c+v.length)),document.createTextNode(x.slice(c+v.length))]},ge=E=>{var c,N;const x=d(E),v=E&&typeof E=="object"?(N=(c=E.description)!=null?c:E.subtitle)!=null?N:E.note:null;return _.div({class:"cms-search-result-content"},_.div({class:"cms-search-result-label"},...H(x)),v?_.div({class:"cms-search-result-description"},String(v)):null)},Se=()=>{!u()||be.parentNode!==document.body||re||(re=requestAnimationFrame(()=>{if(re=0,!u()||!Ce.isConnected||be.parentNode!==document.body)return;const E=Ce.getBoundingClientRect(),x=6,v=8,c=Math.max(180,window.innerWidth-v*2),N=Math.min(Math.max(E.width,M(t.minMenuWidth,260)),c),de=Math.max(v,Math.min(E.left,window.innerWidth-N-v));be.style.width=`${N}px`,be.style.left=`${de}px`,be.style.right="auto";const Ae=be.getBoundingClientRect().height||0,Je=window.innerHeight-E.bottom-x-v,B=E.top-x-v;let Me=Je<180&&B>Je?E.top-x-Ae:E.bottom+x;Me=Math.max(v,Math.min(Me,window.innerHeight-Ae-v)),be.style.top=`${Me}px`}))},ye=()=>{oe||(oe=!0,window.addEventListener("resize",Se),window.addEventListener("scroll",Se,!0))},V=()=>{oe&&(oe=!1,window.removeEventListener("resize",Se),window.removeEventListener("scroll",Se,!0))},O=()=>{be.parentNode!==document.body&&(re&&(cancelAnimationFrame(re),re=0),be.classList.add("portal"),be.style.display="block",document.body.appendChild(be),ye(),Se())},K=()=>{re&&(cancelAnimationFrame(re),re=0),V(),be.parentNode!==Ce&&Ce.appendChild(be),be.classList.remove("portal"),be.style.display="",be.style.position="",be.style.top="",be.style.left="",be.style.right="",be.style.width=""},ke=t.label!=null||JSswift.ui.getSlot(e,"label")!=null,Ne=()=>{if(!ke){ee.placeholder=l(t.placeholder)||"";return}ee.placeholder=document.activeElement===ee&&l(t.placeholder)||""},ee=_.input({id:t.id,class:ae(["cms-input","cms-search-input",t.inputClass]),type:"search",name:t.name,placeholder:ke?"":t.placeholder,autocomplete:t.autocomplete||"off",inputmode:t.inputmode,value:r(),disabled:q(),readOnly:ue(),role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-controls":`${D}-list`}),xe=_.div({id:`${D}-list`,class:"cms-search-results",role:"listbox"}),be=_.div({class:ae(["cms-search-menu","cms-singularity-menu-select",t.menuClass,fe(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:E=>E.stopPropagation()},xe),Ce=_.div({class:ae(["cms-search",t.class]),role:"presentation"},ee,be);let pe=null;if(s){if(typeof s=="object"&&typeof s._bind=="function")s.action(E=>C(E,{fromModel:!0})),Y=E=>{s.value!==E&&(s.value=E)};else if(Array.isArray(s)&&typeof s[0]=="function"&&typeof s[1]=="function"){const E=s[0],x=s[1];JSswift.reactive.effect(()=>{C(E(),{fromModel:!0})},"UI.Search:model"),Y=v=>x(v)}}else at(t.value)&&JSswift.reactive.effect(()=>{C(l(t.value),{fromModel:!0})},"UI.Search:value");ee.addEventListener("input",E=>{C(ee.value,{event:E}),t.searchOnInput!==!1&&L(ee.value,{open:!0})}),ee.addEventListener("change",E=>{var x;return(x=t.onChange)==null?void 0:x.call(t,ee.value,E)}),ee.addEventListener("focus",E=>{var x;Ne(),(x=t.onFocus)==null||x.call(t,E),t.openOnFocus!==!1&&(t.searchOnFocus&&!z().length?L(ee.value,{immediate:!0,open:!0}):j())}),ee.addEventListener("blur",E=>{var x;Ne(),(x=t.onBlur)==null||x.call(t,E)}),ee.addEventListener("keydown",E=>{if(q()||ue())return;const x=u(),v=z(),c=G();if(E.key==="Escape"){x&&(E.preventDefault(),h());return}if(E.key==="ArrowDown"){E.preventDefault(),x?A(1):(j(),v.length||L(ee.value,{immediate:!0,open:!0}));return}if(E.key==="ArrowUp"){E.preventDefault(),x?A(-1):j();return}if(E.key==="Home"&&x&&v.length&&(E.metaKey||E.ctrlKey)){E.preventDefault(),ie(0);return}if(E.key==="End"&&x&&v.length&&(E.metaKey||E.ctrlKey)){E.preventDefault(),ie(v.length-1);return}E.key==="Enter"&&(x&&c>=0&&v[c]?(E.preventDefault(),k(v[c],E)):f(E))});const Ie=E=>{if(!Ce.isConnected)return;const x=E.target;Ce.contains(x)||be.contains(x)||h()};document.addEventListener("click",Ie,!0),JSswift.reactive.effect(()=>{const E=u();Ce.classList.toggle("open",E),ee.setAttribute("aria-expanded",E?"true":"false"),E?O():K()},"UI.Search:open"),JSswift.reactive.effect(()=>{const E=q(),x=ue();Ce.classList.toggle("disabled",E),Ce.classList.toggle("readonly",x),ee.disabled=E,ee.readOnly=x},"UI.Search:disabled"),JSswift.reactive.effect(()=>{const E=b(),x=S(),v=z(),c=r();if(xe.innerHTML="",te=[],le=-1,E){const N=JSswift.ui.renderSlot(e,"loading",{query:c},t.loadingText||"Caricamento...");xe.appendChild(_.div({class:"cms-search-empty is-loading"},...J(null,"default",{},N)))}else if(x){const N=JSswift.ui.renderSlot(e,"error",{error:x,query:c},t.errorText||"Errore ricerca");xe.appendChild(_.div({class:"cms-search-empty is-error"},...J(null,"default",{},N)))}else if(v.length)v.forEach((N,de)=>{const Je=d(N),B=m(N),Le=De=>k(N,De),Me=JSswift.ui.renderSlot(e,"result",{item:N,index:de,active:!1,label:Je,value:B,query:c,select:Le},ge(N)),Ee=_.div({id:`${D}-result-${de}`,class:ae(["cms-search-result",""]),role:"option","aria-selected":"false",onMouseEnter:()=>ie(de),onMouseDown:De=>De.preventDefault(),onClick:Le},...J(null,"default",{},Me));xe.appendChild(Ee),te[de]=Ee});else{const de=c.trim().length>=R()?t.emptyText||"Nessun risultato":t.startText||"",Ae=JSswift.ui.renderSlot(e,"empty",{query:c},de);(de||JSswift.ui.getSlot(e,"empty")!=null)&&xe.appendChild(_.div({class:"cms-search-empty"},...J(null,"default",{},Ae)))}P()||h(),Se()},"UI.Search:render"),JSswift.reactive.effect(()=>{const E=G();E!==le&&(te[le]&&(te[le].classList.remove("active"),te[le].setAttribute("aria-selected","false")),te[E]?(te[E].classList.add("active"),te[E].setAttribute("aria-selected","true"),te[E].scrollIntoView({block:"nearest"}),ee.setAttribute("aria-activedescendant",`${D}-result-${E}`)):ee.removeAttribute("aria-activedescendant"),le=E)},"UI.Search:active"),pe=he.FormField({...t,icon:(I=t.icon)!=null?I:"search",wrapClass:ae(["cms-search-field",t.wrapClass]),control:Ce,getValue:()=>r(),onClear:()=>{var E;q()||ue()||(C("",{}),U(),(E=t.onClear)==null||E.call(t))},onFocus:()=>ee.focus()}),ee.addEventListener("input",()=>{var E;return(E=pe._refresh)==null?void 0:E.call(pe)}),ee.addEventListener("change",()=>{var E;return(E=pe._refresh)==null?void 0:E.call(pe)}),pe._input=ee,pe._search=Ce,pe._open=j,pe._close=h,pe._searchNow=()=>ce(r(),{immediate:!0,open:!0}),pe._getResults=z,pe._setValue=E=>C(E,{});let _e=!1;return pe._dispose=()=>{_e||(_e=!0,document.removeEventListener("click",Ie,!0),W&&clearTimeout(W),se&&se.abort(),K())},(we=JSswift._registerCleanup)==null||we.call(JSswift,pe,pe._dispose),an(ee,t,{isEnabled:()=>!ee.disabled,action:()=>hn(ee,{selectText:!!t.selectOnShortcode})}),(t.autoSearch||t.searchOnMount)&&L(r(),{immediate:!0,open:!1}),pe},he.Select=(t={})=>{var we,E;const e={...t,label:(we=t.label)!=null?we:t.placeholder},n=t.filterable,s=!!t.multiple||!!t.multi,o=!!t.allowCustom||!!t.allowCustomValue,r=t.slots||{},y=x=>!!x&&(typeof x=="object"&&typeof x._bind=="function"||Lt(x)),u=y(t.model)?t.model:y(t.value)?t.value:null,i=x=>Array.isArray(x)?x.slice():x==null||x===""?[]:[x],b=x=>s?i(x):x,T=u?JSswift.reactive.untracked(()=>typeof u=="object"&&typeof u._bind=="function"?u.value:u[0]()):t.value,[S,w]=JSswift.reactive.signal(!1),[z,Q]=JSswift.reactive.signal(""),[G,ie]=JSswift.reactive.signal(s?i(T):T!=null?T:""),[D,$]=JSswift.reactive.signal(!1),[Y,W]=JSswift.reactive.signal([]),[se,me]=JSswift.reactive.signal([]),[re,oe]=JSswift.reactive.signal(-1);let le=null;if(u){if(typeof u=="object"&&typeof u._bind=="function")JSswift.reactive.untracked(()=>ie(b(u.value))),u.action(x=>ie(b(x))),le=x=>{const v=b(x);u.value!==v&&(u.value=v)};else if(Array.isArray(u)&&typeof u[0]=="function"&&typeof u[1]=="function"){const x=u[0],v=u[1];JSswift.reactive.untracked(()=>{JSswift.reactive.effect(()=>{ie(b(x()))},"UI.Select:model")}),le=c=>v(b(c))}}function te(){var x;return typeof t.disabled=="function"?t.disabled():typeof t.disabled=="boolean"?t.disabled:(x=t==null?void 0:t.disabled)!=null&&x.action?t.disabled.value:!1}function M(x){var v,c,N,de;if(x==null)return null;if(typeof x=="string"||typeof x=="number")return{type:"option",label:String(x),value:x,disabled:!1};if(typeof x=="object"){if(Array.isArray(x.options))return{type:"group",label:String((v=x.label)!=null?v:""),options:x.options};const Ae=(c=x.label)!=null?c:x.value!=null?String(x.value):"";return{type:"option",label:String(Ae),value:(de=(N=x.value)!=null?N:x.label)!=null?de:"",disabled:!!x.disabled}}return{type:"option",label:String(x),value:x,disabled:!1}}function Z(x){const c=(Array.isArray(x)?x:[]).map(M).filter(Boolean),N=[],de=[];for(const Ae of c)if(Ae.type==="group"){N.push({type:"group",label:Ae.label});const Je=(Ae.options||[]).map(M).filter(Boolean).filter(B=>B.type==="option");for(const B of Je)N.push(B),de.push(B)}else N.push(Ae),de.push(Ae);W(N),me(de)}async function q(){const x=t.options;let v;try{const c=typeof x=="function"?JSswift.ui.withoutRodPathCapture(()=>x()):x;c&&typeof c.then=="function"?($(!0),v=await c):v=c,Z(v)}catch(c){console.error("[UI.Select] options load error:",c),Z([])}finally{$(!1)}}function ue(x){var c;const v=b(x);ie(v),le&&le(v),(c=t.onChange)==null||c.call(t,v)}function R(x){const v=i(G()),N=v.some(de=>de==x)?v.filter(de=>de!=x):[...v,x];ue(N)}function g(x,v=!1){s?(R(x),v&&d()):(ue(x),m())}function d(){Q(""),ce&&(ce.value="")}function m(){w(!1),d(),oe(-1)}async function F(){if(te())return;w(!0),await q();const x=G(),v=se();let c=-1;if(s){const N=i(x);for(const de of N)if(c=v.findIndex(Ae=>Ae.value==de&&!Ae.disabled),c>=0)break}else c=v.findIndex(N=>N.value==x&&!N.disabled);c<0&&(c=v.findIndex(N=>!N.disabled)),oe(c),ce&&setTimeout(()=>ce.focus(),0)}function X(){S()?m():F()}const a=_.div({class:ae(["cms-select",s?"multiple":"",t.class]),tabIndex:te()?-1:0,role:"combobox","aria-expanded":"false","aria-disabled":te()?"true":"false"}),C=_.div({class:ae(["cms-select-value",s?"cms-select-value-multi":""])});JSswift.reactive.effect(()=>{const x=se();if(C.innerHTML="",s){const v=i(G());for(const c of v){const N=x.find(B=>B.value==c),de=N?N.label:c==null?"":String(c);let Ae=!1;const Je=he.Chip({label:de,dense:!0,color:t.chipColor||t.color,icon:t.chipIcon||null,iconRight:t.chipIconRight||null,glossy:t.glossy,glow:t.glow,glass:t.chipGlass||t.glass,class:t.chipClass,flat:t.flat,rounded:t.rounded,outline:t.outline,shadow:t.chipShadow,lightShadow:t.lightShadow,gloss:t.gloss,border:t.border,size:t.chipSize,removable:!0,onRemove:B=>{var Le,Me,Ee;(Le=B==null?void 0:B.preventDefault)==null||Le.call(B),(Me=B==null?void 0:B.stopPropagation)==null||Me.call(B),(Ee=B==null?void 0:B.stopImmediatePropagation)==null||Ee.call(B),!Ae&&(Ae=!0,R(c))}});C.appendChild(Je)}}else{const v=G(),c=x.find(N=>N.value==v);C.textContent=c?c.label:v==null||v===""?"":String(v)}},"UI.Select:value");const h=_.div({class:"cms-select-arrow"});JSswift.reactive.effect(()=>{const x=JSswift.ui.renderSlot(r,"arrow",{open:S()},he.Icon("#chevron-down"));h.innerHTML="",J(null,"default",{},x).forEach(v=>h.appendChild(v))},"UI.Select:arrow");const P=_.div({class:"cms-select-control",onClick:X},C,h),j=_.div({class:"cms-select-options",role:"listbox","aria-multiselectable":s?"true":"false"}),U=_.div({class:"cms-select-filter cms-d-none"});let ce=null;const L=_.input({class:"cms-input",type:"text",placeholder:t.filterPlaceholder||"Cerca...",onInput:x=>Q(x.target.value||"")}),f=()=>{const x=JSswift.ui.renderSlot(r,"filter",{value:z(),setValue:c=>{const N=c==null?"":String(c);Q(N),ce&&"value"in ce&&(ce.value=N)},close:m},L);U.innerHTML="";const v=J(null,"default",{},x);v.forEach(c=>U.appendChild(c)),ce=v.length===1&&v[0]&&v[0].tagName==="INPUT"?v[0]:null,ce&&(ce.value=z()||"")};JSswift.reactive.untracked(f),JSswift.reactive.effect(()=>{const x=z()||"";ce&&"value"in ce&&ce.value!==x&&(ce.value=x)},"UI.Select:filterValue"),typeof n=="boolean"?n?U.classList.remove("cms-d-none"):U.classList.add("cms-d-none"):n!=null&&n.action&&(n.action(x=>{x?U.classList.remove("cms-d-none"):U.classList.add("cms-d-none")}),n.value?U.classList.remove("cms-d-none"):U.classList.add("cms-d-none"));const k={...t};Yt(k);const A=qe([k.color,k.state],()=>{const x=l(k.color)||l(k.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(x)?x:l(k.state)||""}),H=_.div({class:ae(["cms-select-menu","cms-singularity-menu-select",A,k.class,fe(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:x=>x.stopPropagation()},U,j);let ge=0,Se=!1;const ye=()=>{!S()||H.parentNode!==document.body||ge||(ge=requestAnimationFrame(()=>{if(ge=0,!S()||!a.isConnected||H.parentNode!==document.body)return;const x=a.getBoundingClientRect(),v=6,c=8,N=Math.max(160,window.innerWidth-c*2),de=Math.min(Math.max(x.width,180),N),Ae=Math.max(c,Math.min(x.left,window.innerWidth-de-c));H.style.width=`${de}px`,H.style.left=`${Ae}px`,H.style.right="auto",H.style.marginTop="0";const Je=H.getBoundingClientRect().height||0,B=window.innerHeight-x.bottom-v-c,Le=x.top-v-c;let Ee=B<180&&Le>B?x.top-v-Je:x.bottom+v;Ee=Math.max(c,Math.min(Ee,window.innerHeight-Je-c)),H.style.top=`${Ee}px`}))},V=()=>{Se||(Se=!0,window.addEventListener("resize",ye),window.addEventListener("scroll",ye,!0))},O=()=>{Se&&(Se=!1,window.removeEventListener("resize",ye),window.removeEventListener("scroll",ye,!0))},K=()=>{H.parentNode!==document.body&&(ge&&(cancelAnimationFrame(ge),ge=0),H.classList.add("portal"),H.style.display="block",document.body.appendChild(H),V(),ye())},ke=()=>{ge&&(cancelAnimationFrame(ge),ge=0),O(),H.parentNode!==a&&a.appendChild(H),H.classList.remove("portal"),H.style.display="",H.style.position="",H.style.top="",H.style.left="",H.style.right="",H.style.width="",H.style.marginTop=""};a.appendChild(P),a.appendChild(H),JSswift.reactive.effect(()=>{const x=S();a.classList.toggle("open",x),a.setAttribute("aria-expanded",x?"true":"false"),x?K():ke()},"UI.Select:open"),JSswift.reactive.effect(()=>{const x=te();a.classList.toggle("disabled",x),a.tabIndex=x?-1:0,a.setAttribute("aria-disabled",x?"true":"false")},"UI.Select:disabled");let Ne=[],ee=-1,xe=-1;function be(){var v;const x=re();xe=x,x!==ee&&(Ne[ee]&&Ne[ee].classList.remove("active"),Ne[x]&&Ne[x].classList.add("active"),ee=x,x>=0&&((v=Ne[x])==null||v.scrollIntoView({block:"nearest"})))}JSswift.reactive.effect(()=>{const x=Y(),v=se(),c=(z()||"").toLowerCase().trim(),N=G(),de=s?i(N):[N],Ae=D(),Je=xe;j.innerHTML="",Ne=[],ee=-1;const B=[];let Le=0;const Me=Ee=>{const De=de.some(tt=>tt==Ee.value),Ue=!!Ee.disabled,Ye=["cms-select-option",De?"selected":"",Ue?"disabled":""].filter(Boolean).join(" "),Ze=()=>{s?R(Ee.value):(ue(Ee.value),m())},Qe=JSswift.ui.renderSlot(r,"option",{opt:Ee,selected:De,active:Le===Je,disabled:Ue,select:Ze},Ee.label),Te=J(null,"default",{},Qe),je=_.div({class:Ye,"data-flat-index":String(Le),onClick:Ue?null:Ze},...Te);B.push(je),Ne[Le]=je,Le++};if(c){const Ee=v.filter(De=>De.label.toLowerCase().includes(c));if(Ee.length===0){const De=JSswift.ui.renderSlot(r,"empty",{filter:c},t.emptyText||"Nessuna opzione");j.appendChild(_.div({class:"cms-select-empty"},...J(null,"default",{},De))),S()&&ye();return}for(const De of Ee)Me(De)}else{let Ee=!1;for(const De of x)if(De.type==="group"){const Ue=JSswift.ui.renderSlot(r,"group",{label:De.label},De.label);B.push(_.div({class:"cms-select-group"},...J(null,"default",{},Ue)))}else Ee=!0,Me(De);if(!Ee){const De=JSswift.ui.renderSlot(r,"empty",{filter:c},t.emptyText||"Nessuna opzione");j.appendChild(_.div({class:"cms-select-empty"},...J(null,"default",{},De))),S()&&ye();return}}if(Ae){const Ee=JSswift.ui.renderSlot(r,"loading",{},"Caricamento...");j.appendChild(_.div({class:"cms-select-empty"},...J(null,"default",{},Ee))),S()&&ye();return}for(const Ee of B)j.appendChild(Ee);be(),S()&&ye()},"UI.Select:render"),JSswift.reactive.effect(()=>{be()},"UI.Select:paintActive");const Ce=x=>{if(!a.isConnected)return;const v=x.target;a.contains(v)||H.contains(v)||m()};document.addEventListener("click",Ce,!0);const pe=x=>{if(te())return;const v=S(),c=se(),N=re(),de=ce&&x.target===ce,Ae=(B,Le)=>{let Me=B;for(;Me>=0&&Me<c.length;){if(!c[Me].disabled)return Me;Me+=Le}return-1},Je=B=>{if(!B)return null;const Le=B.toLowerCase();let Me=c.find(Ee=>String(Ee.label).toLowerCase()===Le||String(Ee.value).toLowerCase()===Le);return Me||(Me=c.find(Ee=>String(Ee.label).toLowerCase().includes(Le))),Me&&!Me.disabled?Me:null};if(x.key==="Escape"){v&&(x.preventDefault(),m());return}if(de&&(x.key==="Enter"||x.key===" ")){const B=(z()||"").trim();if(B){const Le=Je(B);if(Le){x.preventDefault(),g(Le.value,!0);return}if(o&&x.key==="Enter"){x.preventDefault(),g(B,!0);return}if(x.key==="Enter"){x.preventDefault();return}}if(x.key===" ")return}if(x.key==="Enter"||x.key===" "){if(x.preventDefault(),!v){F();return}N>=0&&c[N]&&!c[N].disabled&&(s?R(c[N].value):(ue(c[N].value),m()));return}if(x.key==="ArrowDown"){if(x.preventDefault(),!v){F();return}const B=Ae(N<0?0:N+1,1);B>=0&&oe(B);return}if(x.key==="ArrowUp"){if(x.preventDefault(),!v){F();return}const B=Ae(N<0?c.length-1:N-1,-1);B>=0&&oe(B);return}if(x.key==="Home"){if(!v)return;x.preventDefault();const B=Ae(0,1);B>=0&&oe(B);return}if(x.key==="End"){if(!v)return;x.preventDefault();const B=Ae(c.length-1,-1);B>=0&&oe(B);return}};a.addEventListener("keydown",pe),U.addEventListener("keydown",pe);let Ie=!1;a._dispose=()=>{Ie||(Ie=!0,document.removeEventListener("click",Ce,!0),a.removeEventListener("keydown",pe),U.removeEventListener("keydown",pe),ke())};const _e=()=>{const x=G();return s?Array.isArray(x)&&x.length>0:x==null?!1:x!==""?!0:se().some(v=>v.value==="")},I=he.FormField({...e,control:a,clearable:t.clearable,disabled:te(),readonly:!1,hasValue:_e,getValue:()=>{const x=G();return s?Array.isArray(x)&&x.length?x:"":x},onClear:()=>{te()||(ue(s?[]:null),m())},onFocus:()=>{F()}});return JSswift.reactive.effect(()=>{var x;(x=I._refresh)==null||x.call(I)},"UI.Select:fieldRefresh"),nl(I,a,t),I._select=a,I._dispose=a._dispose,(E=JSswift._registerCleanup)==null||E.call(JSswift,I,I._dispose),an(I,t,{isEnabled:()=>!te(),action:()=>{if(te())return!1;hn(a),F()}}),q(),I},he.Upload=(t={})=>{var _e;Yt(t);const e=t.slots||{},[n,s]=JSswift.reactive.signal([]),[o,r]=JSswift.reactive.signal(!1),[y,u]=JSswift.reactive.signal(!1),[i,b]=JSswift.reactive.signal(null);let T=0,S=!1;const w=()=>!!l(t.disabled)||!!l(t.readonly),z=()=>t.multiple!==!1&&t.single!==!0,Q=()=>{var I,we;return["form","native","submit","external"].includes(String(l((we=(I=t.submitMode)!=null?I:t.modeSubmit)!=null?we:t.uploadMode)||"").toLowerCase())},G=()=>{var I;return l((I=t.showBrowse)!=null?I:t.browseButton)!==!1},ie=()=>{var I;return!Q()&&l((I=t.showUpload)!=null?I:t.uploadButton)!==!1},D=()=>{var I;return l((I=t.showClear)!=null?I:t.clearButton)!==!1},$=()=>{var I;return l((I=t.showFiles)!=null?I:t.files)!==!1},Y=()=>{const I=mt(l(t.state)||l(t.status));return I?`cms-state-${I}`:""},W=()=>t.fieldName||t.paramName||t.name||"file",se=()=>{var I;return Math.max(1,Number(l((I=t.parallelUploads)!=null?I:t.parallel)||1))},me=()=>{var we,E,x,v;const I=l(t.retry);return I===!0?{attempts:2,delay:350,factor:2}:I?{attempts:Math.max(0,Number((E=(we=I.attempts)!=null?we:I.retries)!=null?E:0)),delay:Math.max(0,Number((x=I.delay)!=null?x:350)),factor:Math.max(1,Number((v=I.factor)!=null?v:2))}:{attempts:0,delay:350,factor:2}},re=I=>I?Array.isArray(I)?I:Array.from(I):[],oe=I=>{const we=Number(I||0);return we<1024?`${we} B`:we<1024*1024?`${(we/1024).toFixed(1)} KB`:we<1024*1024*1024?`${(we/1024/1024).toFixed(1)} MB`:`${(we/1024/1024/1024).toFixed(1)} GB`},le=()=>{var I;return String(l((I=t.acceptedFiles)!=null?I:t.accept)||"").trim()},te=I=>{const we=le();if(!we)return!0;const E=String(I.name||"").toLowerCase(),x=String(I.type||"").toLowerCase();return we.split(",").map(v=>v.trim().toLowerCase()).filter(Boolean).some(v=>v.startsWith(".")?E.endsWith(v):v.endsWith("/*")?x.startsWith(v.slice(0,-1)):x===v)},M=()=>n().filter(I=>I.status!=="rejected"&&I.status!=="removed"),Z=(I=0)=>M().reduce((we,E)=>we+Number(E.size||0),I),q=()=>{var I;s(n().slice()),O.classList.toggle("is-busy",n().some(we=>we.status==="uploading")),O.classList.toggle("has-files",n().some(we=>we.status!=="removed")),(I=t.onChange)==null||I.call(t,n().slice(),K)},ue=(I,we,E=null)=>{var v;const x={id:`upload_${Date.now()}_${++T}`,file:I,name:(I==null?void 0:I.name)||"file",size:Number((I==null?void 0:I.size)||0),type:(I==null?void 0:I.type)||"",status:"rejected",progress:0,error:we,detail:E,attempts:0,response:null,xhr:null};return n().push(x),(v=t.onRejected)==null||v.call(t,x,{reason:we,detail:E,api:K}),x},R=async(I,we)=>{const E=t.maxFiles==null?null:Number(l(t.maxFiles)),x=t.maxFileSize==null?null:Number(l(t.maxFileSize)),v=t.minFileSize==null?null:Number(l(t.minFileSize)),c=t.maxTotalSize==null?null:Number(l(t.maxTotalSize));if(E!=null&&we>E)return"max-files";if(x!=null&&Number(I.size||0)>x)return"max-file-size";if(v!=null&&Number(I.size||0)<v)return"min-file-size";if(c!=null&&Z(Number(I.size||0))>c)return"max-total-size";if(!te(I))return"accept";const N=t.filter||t.acceptFile||t.validate;if(typeof N=="function"){const de=await N(I,{files:n().slice(),api:K});if(de===!1)return"filter";if(typeof de=="string")return de}return null},g=async()=>{for(const I of n()){if(I.status!=="rejected"||I.error!=="max-files")continue;const we=await R(I.file,M().length+1);if(we){I.error=we;continue}I.status="queued",I.progress=0,I.error=null,I.detail=null}},d=I=>({id:`upload_${Date.now()}_${++T}`,file:I,name:(I==null?void 0:I.name)||"file",size:Number((I==null?void 0:I.size)||0),type:(I==null?void 0:I.type)||"",status:"queued",progress:0,bytesUploaded:0,error:null,detail:null,attempts:0,response:null,xhr:null}),m=async(I,we={})=>{var v;if(w())return[];b(null);const E=re(I),x=[];!z()&&E.length&&F({silent:!0});for(const c of E){const N=await R(c,M().length+1);if(N){ue(c,N);continue}const de=d(c);if(n().push(de),x.push(de),(v=t.onAdded)==null||v.call(t,de,{file:c,meta:we,api:K}),!z())break}return q(),x.length&&t.autoUpload&&!Q()&&f(),x},F=(I={})=>{var we;for(const E of n())E.status==="uploading"&&a(E),E.status="removed";s([]),b(null),q(),I.silent||(we=t.onClear)==null||we.call(t,K)},X=async I=>{var x;const we=typeof I=="string"?n().find(v=>v.id===I):I;if(!we)return;we.status==="uploading"&&a(we);const E=n().filter(v=>v!==we);s(E),await g(),q(),(x=t.onRemove)==null||x.call(t,we,{api:K})},a=I=>{var E,x,v;const we=typeof I=="string"?n().find(c=>c.id===I):I;!we||we.status!=="uploading"||(we.status="canceled",we.error="canceled",(x=(E=we.xhr)==null?void 0:E.abort)==null||x.call(E),(v=t.onCancel)==null||v.call(t,we,{api:K}),q())},C=()=>n().filter(I=>I.status==="uploading").forEach(a),h=async I=>{var E,x;const we={url:l(t.url),method:l(t.method||"POST"),headers:t.headers,formFields:t.formFields||t.fields,fieldName:W(),withCredentials:!!l((E=t.withCredentials)!=null?E:t.credentials),sendRaw:!!l(t.sendRaw)};if(typeof t.factory=="function")try{const v=await t.factory(I.file,{item:I,files:n().slice(),api:K});if(v&&typeof v=="object")Object.assign(we,v);else if(v!=null)throw new Error("factory must return an object")}catch(v){throw(x=t.onFactoryFailed)==null||x.call(t,v,{item:I,api:K}),v}return we},P=(I,we,E)=>{const x=typeof we=="function"?we(E.file,{item:E,api:K}):we;x&&(x instanceof Headers?x.forEach((v,c)=>I.setRequestHeader(c,v)):Array.isArray(x)?x.forEach(v=>{Array.isArray(v)?I.setRequestHeader(v[0],v[1]):v!=null&&v.name&&I.setRequestHeader(v.name,v.value)}):typeof x=="object"&&Object.keys(x).forEach(v=>I.setRequestHeader(v,x[v])))},j=(I,we,E)=>{const x=typeof we=="function"?we(E.file,{item:E,api:K}):we;x&&(Array.isArray(x)?x.forEach(v=>{Array.isArray(v)?I.append(v[0],v[1]):v!=null&&v.name&&I.append(v.name,v.value)}):typeof x=="object"&&Object.keys(x).forEach(v=>I.append(v,x[v])))},U=(I,we)=>new Promise((E,x)=>{if(!we.url){x(new Error("UI.Upload: url is required"));return}if(typeof XMLHttpRequest!="function"){x(new Error("UI.Upload: XMLHttpRequest is not available"));return}const v=new XMLHttpRequest;I.xhr=v,v.open(String(we.method||"POST").toUpperCase(),we.url,!0),v.withCredentials=!!we.withCredentials,P(v,we.headers,I),v.upload.onprogress=N=>{var de;N.lengthComputable&&(I.bytesUploaded=N.loaded,I.progress=Math.max(0,Math.min(100,Math.round(N.loaded/N.total*100))),(de=t.onProgress)==null||de.call(t,I,{event:N,api:K}),q())},v.onload=()=>{const N=v.status>=200&&v.status<300,de={status:v.status,text:v.responseText,xhr:v};N?E(de):x(Object.assign(new Error(`HTTP error ${v.status}`),{response:de}))},v.onerror=()=>x(new Error("network-error")),v.onabort=()=>x(new Error("canceled"));const c=we.sendRaw?I.file:(()=>{const N=new FormData;return j(N,we.formFields,I),N.append(we.fieldName||"file",I.file,I.name),N})();v.send(c)}),ce=async I=>{var x,v,c,N,de,Ae;const we=me();let E=we.delay;I.status="uploading",I.error=null,I.progress=Math.max(0,I.progress||0),(x=t.onStart)==null||x.call(t,I,{api:K}),q();for(let Je=0;Je<=we.attempts;Je++){I.attempts=Je+1;try{const B=await h(I),Le=typeof t.upload=="function"||typeof t.uploader=="function"?await(t.upload||t.uploader)(I.file,{item:I,options:B,progress:Me=>{var Ee;I.progress=Math.max(0,Math.min(100,Number(Me)||0)),(Ee=t.onProgress)==null||Ee.call(t,I,{api:K}),q()},api:K}):await U(I,B);return I.status="done",I.progress=100,I.response=Le,I.xhr=null,(v=t.onSuccess)==null||v.call(t,I,{response:Le,api:K}),(c=t.onComplete)==null||c.call(t,I,{response:Le,api:K}),q(),I}catch(B){if(String((B==null?void 0:B.message)||B)==="canceled"||I.status==="canceled")return I.status="canceled",I.error="canceled",I.xhr=null,(N=t.onComplete)==null||N.call(t,I,{error:B,api:K}),q(),I;if(Je<we.attempts){await new Promise(Le=>setTimeout(Le,E)),E=Math.round(E*we.factor);continue}return I.status="error",I.error=B,I.xhr=null,b(B),(de=t.onError)==null||de.call(t,I,{error:B,api:K}),(Ae=t.onComplete)==null||Ae.call(t,I,{error:B,api:K}),q(),I}}return I},L=()=>{var x;if(S||w())return;const I=n().filter(v=>v.status==="uploading").length,we=Math.max(0,se()-I),E=n().filter(v=>v.status==="queued").slice(0,we);if(!E.length){const v=n().some(c=>c.status==="uploading");u(v),v||(x=t.onFinish)==null||x.call(t,n().slice(),{api:K});return}u(!0),E.forEach(v=>{ce(v).finally(()=>L())})},f=(I=null)=>{(I?re(I):n().filter(E=>["queued","error","canceled"].includes(E.status))).forEach(E=>{const x=typeof E=="string"?n().find(v=>v.id===E):E;x&&x.status!=="uploading"&&x.status!=="done"&&x.status!=="rejected"&&(x.status="queued",x.progress=0,x.error=null)}),q(),L()},k=I=>f([I]),A=()=>{w()||H.click()},H=_.input({type:"file",class:"cms-upload-input",name:W(),accept:le()||null,multiple:z(),capture:t.capture||null,disabled:w(),onChange:I=>{m(I.target.files,{event:I,source:"browse"}),I.target.value=""}}),ge=_.div({class:"cms-upload-list"}),Se=_.div({class:"cms-upload-summary"}),ye=_.div({class:"cms-upload-actions"});let V=Y();const O=_.div({class:ae(["cms-upload","cms-singularity",V,fe(t.box||t.variant==="box","cms-upload-box"),fe(t.compact,"is-compact"),fe(Q(),"is-form-mode"),fe(!$(),"is-files-hidden"),t.class]),tabindex:w()?"-1":"0",role:"group","aria-disabled":w()?"true":"false"}),K={addFiles:m,browse:A,upload:f,retry:k,retryAll:()=>f(n().filter(I=>I.status==="error"||I.status==="canceled")),remove:X,clear:F,abort:a,abortAll:C,files:()=>n().slice(),state:()=>({files:n().slice(),busy:y(),dragging:o(),error:i()}),reset:F},ke=()=>{const I={api:K,files:n().slice(),busy:y(),disabled:w(),submitMode:Q()?"form":"upload"},we=[];return G()&&we.push(JSswift.ui.renderSlot(e,"browse",I,he.Btn({size:"sm",icon:"folder_open",label:t.browseText||"Browse",onClick:A}))),ie()&&we.push(JSswift.ui.renderSlot(e,"upload",I,he.Btn({size:"sm",color:"primary",icon:"upload",label:t.uploadText||"Upload",loading:y(),disabled:w()||!n().some(E=>["queued","error","canceled"].includes(E.status)),onClick:()=>f()}))),D()&&we.push(JSswift.ui.renderSlot(e,"clear",I,he.Btn({size:"sm",color:"secondary",outline:!0,icon:"delete",label:t.clearText||"Clear",disabled:w()||!n().length,onClick:()=>F()}))),J(e,"actions",I,we)},Ne=(I,we)=>{var c;const E={item:I,file:I.file,index:we,api:K,remove:()=>X(I),retry:()=>k(I),abort:()=>a(I)},x=_.div({class:ae(["cms-upload-file",`is-${I.status}`])},_.div({class:"cms-upload-file-icon"},he.Icon({name:I.status==="done"?"check_circle":I.status==="error"||I.status==="rejected"?"error":"description"})),_.div({class:"cms-upload-file-main"},_.div({class:"cms-upload-file-name"},...J(e,"fileName",E,I.name)),_.div({class:"cms-upload-file-meta"},...J(e,"fileMeta",E,I.error?String(((c=I.error)==null?void 0:c.message)||I.error):I.status==="queued"?"Queued":I.status)),_.div({class:"cms-upload-progress",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":String(I.progress||0)},_.div({class:"cms-upload-progress-bar",style:{width:`${I.progress||0}%`}}))),_.div({class:"cms-upload-file-trailing"},_.div({class:"cms-upload-file-size"},oe(I.size)),_.div({class:"cms-upload-file-actions"},...J(e,"fileActions",E,[I.status==="uploading"?he.Btn({size:"sm",outline:!0,icon:"close","aria-label":"Cancel",onClick:()=>a(I)}):null,I.status==="error"||I.status==="canceled"?he.Btn({size:"sm",outline:!0,icon:"refresh","aria-label":"Retry",onClick:()=>k(I)}):null,he.Btn({size:"sm",dense:!0,outline:!0,icon:"delete","aria-label":"Remove",onClick:()=>X(I)})])))),v=JSswift.ui.renderSlot(e,"file",E,x);return _.div({class:"cms-upload-file-wrap","data-status":I.status,"data-id":I.id},...J(null,"default",{},v))},ee=()=>{const I=n();if(ye.replaceChildren(...ke()),ge.replaceChildren(),Se.hidden=!$(),ge.hidden=!$(),I.length)I.forEach((E,x)=>ge.appendChild(Ne(E,x)));else{const E=JSswift.ui.renderSlot(e,"empty",{api:K},t.emptyText||"No files selected");ge.appendChild(_.div({class:"cms-upload-empty"},...J(null,"default",{},E)))}const we=I.filter(E=>E.status!=="rejected"&&E.status!=="removed");Se.textContent=`${we.length} file \u2022 ${oe(we.reduce((E,x)=>E+Number(x.size||0),0))}`},xe=JSswift.ui.renderSlot(e,"icon",{api:K},he.Icon({name:t.icon||"cloud_upload"})),be=JSswift.ui.renderSlot(e,"title",{api:K},t.title||"Upload files"),Ce=JSswift.ui.renderSlot(e,"subtitle",{api:K},t.subtitle||(le()?`Accepted: ${le()}`:"Drag files here or browse from your device")),pe=_.div({class:"cms-upload-dropzone",onClick:I=>{var we,E;(E=(we=I.target)==null?void 0:we.closest)!=null&&E.call(we,".cms-upload-actions, .cms-upload-list")||t.clickable!==!1&&A()},onDragenter:I=>{t.drag===!1||w()||(I.preventDefault(),r(!0),O.classList.add("is-dragging"))},onDragover:I=>{t.drag===!1||w()||I.preventDefault()},onDragleave:I=>{I.currentTarget===I.target&&(r(!1),O.classList.remove("is-dragging"))},onDrop:I=>{var we,E;t.drag===!1||w()||(I.preventDefault(),r(!1),O.classList.remove("is-dragging"),(we=t.onDrop)==null||we.call(t,I,{api:K}),m(((E=I.dataTransfer)==null?void 0:E.files)||[],{event:I,source:"drop"}))}},_.div({class:"cms-upload-head"},_.div({class:"cms-upload-icon"},...J(null,"default",{},xe)),_.div({class:"cms-upload-copy"},_.div({class:"cms-upload-title"},...J(null,"default",{},be)),_.div({class:"cms-upload-subtitle"},...J(null,"default",{},Ce))),ye),Se,ge),Ie=JSswift.ui.renderSlot(e,"header",{api:K},null);return J(null,"default",{},Ie).forEach(I=>O.appendChild(I)),O.appendChild(H),J(e,"default",{api:K,dropzone:pe},pe).forEach(I=>O.appendChild(I)),JSswift.reactive.effect(()=>{ee()},"UI.Upload:render"),JSswift.reactive.effect(()=>{O.classList.toggle("is-disabled",w()),O.classList.toggle("is-form-mode",Q()),O.classList.toggle("is-files-hidden",!$());const I=Y();I!==V&&(V&&O.classList.remove(V),I&&O.classList.add(I),V=I),O.setAttribute("aria-disabled",w()?"true":"false"),H.disabled=w(),H.multiple=z(),H.name=W()},"UI.Upload:disabled"),O._upload=K,O._addFiles=m,O._browse=A,O._uploadFiles=f,O._input=H,O._dispose=()=>{S||(S=!0,C())},(_e=JSswift._registerCleanup)==null||_e.call(JSswift,O,O._dispose),O},he.BoxUpload=(t={})=>he.Upload({...t,box:!0}),he.boxUpload=(t={})=>he.BoxUpload(t),JSswift.ui.Upload=he.Upload,JSswift.ui.BoxUpload=he.BoxUpload,JSswift.ui.boxUpload=he.boxUpload;function Nt(t,e){if(!t)return null;if(typeof t=="object"&&typeof t._bind=="function")return{get:()=>t.value,set:n=>{t.value!==n&&(t.value=n)},watch:n=>{typeof t.action=="function"&&t.action(n)}};if(Array.isArray(t)&&typeof t[0]=="function"&&typeof t[1]=="function"){const n=t[0],s=t[1];return{get:n,set:s,watch:o=>He.reactive.effect(()=>{o(n())},e||"UI:model")}}return null}const sl={classic:{side:"left",nav:"top",rows:["header","nav","body","footer"]},classicright:{side:"right",nav:"top",rows:["header","nav","body","footer"]},sidebarfullleft:{side:"left",fullSide:!0,nav:"top",rows:["header","nav","body","footer"]},sidebarfullright:{side:"right",fullSide:!0,nav:"top",rows:["header","nav","body","footer"]},appshell:{side:"left",nav:"top",rows:["header","nav","body","footer"]},dashboard:{side:"left",nav:"top",rows:["header","nav","body","footer"]},website:{side:null,nav:"top",rows:["header","nav","body","footer"]},documentation:{side:"right",nav:"left",rows:["header","body","footer"]},landing:{side:null,nav:null,rows:["header","body","footer"]}},Jo=t=>{const e=l(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},Eo=(t,e)=>{if(!t||!e.main)return null;const n=t.side||(e.aside?"left":null),s=t.nav||(e.nav?"top":null),o=!!e.aside&&!!n,r=!!e.nav&&!!s,i=[r&&s==="left"?"nav":o&&n==="left"?"aside":".","main",r&&s==="right"?"nav":o&&n==="right"?"aside":"."],b=[],T=[...t.rows||[]];if(r&&s==="top"&&!T.includes("nav")){const S=T.indexOf("body");T.splice(S>=0?S:T.length,0,"nav")}for(const S of T)S==="header"&&e.header?b.push(t.fullSide&&o&&n==="left"?["aside","header","header"]:t.fullSide&&o&&n==="right"?["header","header","aside"]:["header","header","header"]):S==="nav"&&r&&s==="top"?b.push(t.fullSide&&o&&n==="left"?["aside","nav","nav"]:t.fullSide&&o&&n==="right"?["nav","nav","aside"]:["nav","nav","nav"]):S==="body"?b.push(i):S==="footer"&&e.footer&&b.push(t.fullSide&&o&&n==="left"?["aside","footer","footer"]:t.fullSide&&o&&n==="right"?["footer","footer","aside"]:["footer","footer","footer"]);return b.length?b.map(S=>`"${S.join(" ")}"`).join(" "):null};he.Layout=(...t)=>{var un,tn,nn;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(Pe,Ve)=>!!Pe&&Object.prototype.hasOwnProperty.call(Pe,Ve),r=()=>typeof window=="undefined"?1024:window.innerWidth,y=()=>{const Pe=r(),Ve=JSswift.uiResponsivePropsFor(e,pn("mobile"))||{},et=Pe>=768?JSswift.uiResponsivePropsFor(e,pn("tablet"))||{}:{},ct=Pe>=1024?JSswift.uiResponsivePropsFor(e,pn("pc"))||{}:{};return{...Ve,...et,...ct}},u=(...Pe)=>{for(const Ve of Pe)if(o(e,Ve))return e[Ve]},i=(...Pe)=>{const Ve=y();for(const et of Pe)if(o(Ve,et))return Ve[et];return u(...Pe)},b=(...Pe)=>{const Ve=JSswift.uiResponsivePropsFor(e,pn(V()))||{};for(const et of Pe)if(o(Ve,et))return Ve[et];return u(...Pe)},T=()=>Jo(b("disposition","layoutDisposition","layout")),S=()=>{const Pe=l(i("mode","layoutMode"));if(Pe==null||Pe===!1||Pe==="")return"";const Ve=String(Pe).trim().toLowerCase();return Ve==="global"||Ve==="local"?Ve:""},w=(Pe,Ve=null)=>Pe==null||Pe===!1||Pe===""?Ve:typeof Pe=="number"?`${Pe}px`:String(Pe),z=(Pe,Ve=null)=>{if(Pe==null||Pe===!1||Pe==="")return Ve;if(typeof Pe=="number"&&Number.isFinite(Pe))return Pe;const et=Number.parseFloat(String(Pe));return Number.isFinite(et)?et:Ve},Q=Pe=>{const Ve=l(Pe);return Ve==null||Ve===!1||Ve===""?null:Array.isArray(Ve)?Ve.map(et=>`"${Array.isArray(et)?et.join(" "):String(et)}"`).join(" "):String(Ve)},G=(Pe,Ve=null,et=null)=>{let ct=Number.isFinite(Pe)?Pe:0;return Number.isFinite(Ve)&&(ct=Math.max(Ve,ct)),Number.isFinite(et)&&(ct=Math.min(et,ct)),ct},ie=u("header","headerContent"),D=u("aside","drawer"),$=u("nav","asideRight","drawerRight"),Y=u("page","main","content","body"),W=u("footer","footerContent"),se=()=>l(i("drawerEnabled","asideEnabled")),me=()=>l(i("navEnabled","asideRightEnabled","rightAsideEnabled")),re=()=>se()!==!1,oe=()=>me()===!0||l(i("noNav"))===!1,le=()=>l(i("noDrawer"))===!0||se()===!1||D===!1,te=()=>l(i("noNav"))===!0||me()===!1||$===!1,M=()=>l(i("drawerFloating"))===!0,Z=()=>l(i("navFloating"))===!0,q=()=>l(i("drawerResizable"))===!0,ue=()=>l(i("navResizable"))===!0,R=()=>z(l(i("drawerMinWidth")),180),g=()=>z(l(i("drawerMaxWidth")),null),d=()=>z(l(i("navMinWidth")),180),m=()=>z(l(i("navMaxWidth")),null),F=z(l(i("drawerWidth")),280),X=z((un=l(i("navWidth")))!=null?un:l(i("asideRightWidth")),280),[a,C]=JSswift.reactive.signal(G(F,R(),g())),[h,P]=JSswift.reactive.signal(G(X,d(),m())),j=Nt(e.drawerOpen,"UI.Layout:drawerOpen"),U=j?!!j.get():typeof e.drawerOpen=="boolean"?!!e.drawerOpen:!0,[ce,L]=JSswift.reactive.signal(U),f=Pe=>{const Ve=!!Pe;ce()!==Ve&&L(Ve),j==null||j.set(Ve)};(tn=j==null?void 0:j.watch)==null||tn.call(j,()=>{const Pe=!!j.get();ce()!==Pe&&L(Pe)});const k=Nt(e.navOpen,"UI.Layout:navOpen"),A=k?!!k.get():typeof e.navOpen=="boolean"?!!e.navOpen:!0,[H,ge]=JSswift.reactive.signal(A),Se=Pe=>{const Ve=!!Pe;H()!==Ve&&ge(Ve),k==null||k.set(Ve)};(nn=k==null?void 0:k.watch)==null||nn.call(k,()=>{const Pe=!!k.get();H()!==Pe&&ge(Pe)});const ye=()=>{var ct,gt,ht;const Pe=Number((ct=l(i("layoutBreakpoint")))!=null?ct:0),Ve=Number((gt=l(i("drawerBreakpoint")))!=null?gt:Pe||1024),et=Number((ht=l(i("navBreakpoint")))!=null?ht:Pe||Ve);return Math.max(Ve,et,0)},V=()=>{const Pe=r();return Pe>=1024?"pc":Pe>=768?"tablet":"mobile"},[O,K]=JSswift.reactive.signal(!1),[ke,Ne]=JSswift.reactive.signal(V()),ee=()=>{typeof window!="undefined"&&(Ne(V()),K(window.innerWidth<ye()))};typeof window!="undefined"&&(ee(),window.addEventListener("resize",ee));const xe=()=>({props:e,openAside:()=>f(!0),closeAside:()=>f(!1),toggleAside:()=>f(!ce()),openNav:()=>Se(!0),closeNav:()=>Se(!1),toggleNav:()=>Se(!H()),isDrawerOpen:()=>!!ce(),isNavOpen:()=>!!H(),isMobile:()=>!!O(),isDrawerFloating:()=>M(),isNavFloating:()=>Z()}),be=(Pe,Ve)=>{const et=xe();for(const gt of Pe){if(!o(s,gt))continue;const ht=typeof s[gt]=="function"?s[gt](et):s[gt];return J(null,"default",et,ht)}const ct=typeof Ve=="function"?Ve(et):Ve;return J(null,"default",et,ct)},Ce=Y!==void 0?Y:n,pe=ae(["cms-app","cms-layout",JSswift.uiResponsiveClasses({mobile:e},rn),JSswift.uiResponsiveClasses(e,rn),e.class]),Ie=JSswift.omit(e,["header","headerContent","aside","drawer","nav","asideRight","drawerRight","page","main","content","body","footer","footerContent","noDrawer","drawerEnabled","asideEnabled","noNav","navEnabled","asideRightEnabled","rightAsideEnabled","drawerOpen","navOpen","layoutBreakpoint","drawerBreakpoint","navBreakpoint","drawerWidth","navWidth","asideRightWidth","drawerResizable","drawerMinWidth","drawerMaxWidth","navResizable","navMinWidth","navMaxWidth","drawerPeek","navPeek","asideRightPeek","drawerFloating","navFloating","overlayClose","escClose","stickyHeader","stickyFooter","stickyAside","stickyNav","tagPage","mode","layoutMode","disposition","layoutDisposition","layout","shellClass","headerClass","asideClass","navClass","pageClass","footerClass","overlayClass","gap","headerOffset","minHeight","areas","gridTemplateAreas","templateAreas","slots"]);Ie.class=pe,Ie.style={...e.style||{}},JSswift.uiApplyResponsiveProps(Ie,e,JSswift.uiResponsiveStyleRules);const _e=_.div(Ie),we=l(i("tagPage"))===!0?{header:"header",aside:"aside",nav:"nav",page:"main",footer:"footer"}:{header:"div",aside:"div",nav:"div",page:"div",footer:"div"},E=_.div({class:ae(["cms-layout-shell-grid",e.shellClass])}),x=_[we.header]({class:ae(["cms-layout-section","cms-layout-header","header",fe(e.stickyHeader,"sticky"),e.headerClass])}),v=_[we.aside]({class:ae(["cms-layout-section","cms-layout-aside","aside",fe(e.stickyAside!==!1,"sticky"),e.asideClass]),role:"navigation","aria-hidden":"true"}),c=_.div({class:"cms-layout-panel-body cms-layout-aside-body"}),N=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-drawer","aria-hidden":"true"});v.appendChild(c),v.appendChild(N);const de=_[we.nav]({class:ae(["cms-layout-section","cms-layout-nav","nav",fe(e.stickyNav,"sticky"),e.navClass]),role:we.nav==="nav"?null:"complementary","aria-hidden":"true"}),Ae=_.div({class:"cms-layout-panel-body cms-layout-nav-body"}),Je=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-nav","aria-hidden":"true"});de.appendChild(Ae),de.appendChild(Je);const B=_[we.page]({class:ae(["cms-layout-section","cms-layout-main","main",e.pageClass]),role:we.page==="main"?null:"main"}),Le=_[we.footer]({class:ae(["cms-layout-section","cms-layout-footer","footer",fe(e.stickyFooter,"sticky"),e.footerClass])});E.appendChild(x),E.appendChild(v),E.appendChild(B),E.appendChild(de),E.appendChild(Le),_e.appendChild(E);const Me=_.div({class:ae(["cms-aside-overlay",e.overlayClass]),onClick:()=>{l(i("overlayClose"))!==!1&&(ce()&&f(!1),H()&&Se(!1))}});_e.appendChild(Me);let Ee=!1,De=!1,Ue=!1,Ye=!1,Ze=!1,Qe=null,Te=null;const je=Pe=>{!Pe||typeof Pe!="object"||(typeof Pe._dispose=="function"&&Pe._dispose(),!(!Pe.childNodes||!Pe.childNodes.length)&&Array.from(Pe.childNodes).forEach(je))},tt=Pe=>{Pe&&Array.from(Pe.childNodes).forEach(Ve=>{je(Ve),Ve.remove()})},nt=Pe=>{const Ve=xe(),et=typeof Pe=="function"?Pe(Ve):Pe;return J(null,"default",Ve,et)},ut=()=>{const Pe=Ee?x.getBoundingClientRect().height:0;_e.style.setProperty("--layout-header-height",`${Pe}px`)},dt=(Pe,Ve)=>(tt(Pe),Ve.forEach(et=>Pe.appendChild(et)),Ve.length>0),bt=()=>{var ct,gt,ht,Ct,yt,p;_e.style.setProperty("--cms-layout-drawer-width",w((ct=l(i("drawerWidth")))!=null?ct:280,"280px")),_e.style.setProperty("--cms-layout-nav-width",w((ht=(gt=l(i("navWidth")))!=null?gt:l(i("asideRightWidth")))!=null?ht:280,"280px")),_e.style.setProperty("--cms-layout-drawer-peek",w((Ct=l(i("drawerPeek")))!=null?Ct:20,"20px")),_e.style.setProperty("--cms-layout-nav-peek",w((p=(yt=l(i("navPeek")))!=null?yt:l(i("asideRightPeek")))!=null?p:20,"20px"));const Pe=w(l(i("gap")),null);Pe!=null?_e.style.setProperty("--cms-layout-gap",Pe):_e.style.removeProperty("--cms-layout-gap");const Ve=w(l(i("headerOffset")),null);Ve!=null&&_e.style.setProperty("--layout-header-height",Ve);const et=w(l(i("minHeight")),null);et!=null?_e.style.setProperty("--cms-layout-min-height",et):_e.style.removeProperty("--cms-layout-min-height")},lt=()=>{if(q()){const Pe=G(a(),R(),g());Pe!==a()&&C(Pe),_e.style.setProperty("--cms-layout-drawer-width",`${Pe}px`)}if(ue()){const Pe=G(h(),d(),m());Pe!==h()&&P(Pe),_e.style.setProperty("--cms-layout-nav-width",`${Pe}px`)}},ft=(Pe,Ve)=>{if(Ve.button!==0)return;const et=Pe==="drawer"?v:de;if(et.hidden)return;const ct=Pe==="drawer"?a:h,gt=Pe==="drawer"?C:P,ht=Pe==="drawer"?R:d,Ct=Pe==="drawer"?g:m,yt=et.getBoundingClientRect(),p=yt.width||ct(),ne=Re=>{const Fe=Pe==="drawer"?Re.clientX-yt.left:yt.right-Re.clientX;gt(G(Fe||p,ht(),Ct())),lt(),rt()},ve=()=>{_e.classList.remove("is-resizing-layout"),document.removeEventListener("pointermove",ne,!0),document.removeEventListener("pointerup",ve,!0),Te=null};_e.classList.add("is-resizing-layout"),document.addEventListener("pointermove",ne,!0),document.addEventListener("pointerup",ve,!0),Te=ve,Ve.preventDefault()},vt=Pe=>ft("drawer",Pe),_t=Pe=>ft("nav",Pe);N.addEventListener("pointerdown",vt),Je.addEventListener("pointerdown",_t);const rt=()=>{const Pe=!!O(),Ve=!!ce(),et=!!H(),ct=!le()&&re()&&De,gt=!te()&&oe()&&Ue,ht=ct&&(Pe||M()),Ct=gt&&(Pe||Z()),yt=ct&&Ve,p=gt&&et,ne=yt&&!ht,ve=p&&!Ct,Re=ne&&q(),Fe=ve&&ue(),Oe=yt&&ht||p&&Ct;bt(),lt(),_e.classList.toggle("is-mobile",Pe),_e.classList.toggle("drawer-open",yt),_e.classList.toggle("nav-open",p),_e.classList.toggle("no-drawer",!ct),_e.classList.toggle("no-nav",!gt),_e.classList.toggle("has-header",Ee),_e.classList.toggle("has-drawer",ct),_e.classList.toggle("has-nav",gt),_e.classList.toggle("has-footer",Ze),_e.classList.toggle("drawer-floating",ht),_e.classList.toggle("nav-floating",Ct);const $e=T(),Xe=$e?S():"";_e.dataset.disposition=$e||"",_e.dataset.layoutMode=Xe||"",_e.classList.toggle("has-disposition",!!$e),_e.classList.toggle("mode-local",Xe==="local"),_e.classList.toggle("mode-global",Xe==="global"),x.classList.toggle("sticky",l(i("stickyHeader"))===!0),Le.classList.toggle("sticky",l(i("stickyFooter"))===!0),v.classList.toggle("sticky",l(i("stickyAside"))!==!1),de.classList.toggle("sticky",l(i("stickyNav"))===!0),x.hidden=!Ee,Le.hidden=!Ze,B.hidden=!Ye,Me.hidden=!(ht||Ct),Me.classList.toggle("show",Oe),v.hidden=!ct||!yt&&!ht,v.classList.toggle("open",yt),v.classList.toggle("is-floating",ht),v.classList.toggle("is-resizable",Re),v.setAttribute("aria-hidden",yt?"false":"true"),N.hidden=!Re,de.hidden=!gt||!p&&!Ct,de.classList.toggle("open",p),de.classList.toggle("is-floating",Ct),de.classList.toggle("is-resizable",Fe),de.setAttribute("aria-hidden",p?"false":"true"),Je.hidden=!Fe;const ot=sl[$e]||null,pt=(ot==null?void 0:ot.side)||(ne&&ot?"left":null),xt=(ot==null?void 0:ot.nav)||(ve&&ot?"top":null),Bt=ne?ot?pt:"left":"",zt=ve?ot?xt==="left"||xt==="right"?xt:"":"right":"";_e.classList.toggle("drawer-left",ct&&pt==="left"),_e.classList.toggle("drawer-right",ct&&pt==="right"),_e.classList.toggle("nav-top",ve&&xt==="top"),_e.classList.toggle("nav-side",ve&&(zt==="left"||zt==="right")),E.style.gridTemplateColumns=[Bt==="left"?"minmax(0, var(--cms-layout-drawer-width))":zt==="left"?"minmax(0, var(--cms-layout-nav-width))":"0px","minmax(0, 1fr)",Bt==="right"?"minmax(0, var(--cms-layout-drawer-width))":zt==="right"?"minmax(0, var(--cms-layout-nav-width))":"0px"].join(" ");const At=['"header header header"',`"${ne?"aside":"."} main ${ve?"nav":"."}"`,'"footer footer footer"'].join(" "),sn=Eo(sl[$e],{header:Ee,aside:ne,nav:ve,main:Ye,footer:Ze});E.style.gridTemplateAreas=Q(b("areas","gridTemplateAreas","templateAreas"))||sn||At},Vt=(Pe,Ve)=>(Ee=dt(x,nt(Pe)),ut(),rt(),Ve&&JSswift.router.setURLOnly(Ve),x),Mt=(Pe,Ve)=>(De=dt(c,nt(Pe)),De||f(!1),rt(),Ve&&JSswift.router.setURLOnly(Ve),v),wt=(Pe,Ve)=>(Ue=dt(Ae,nt(Pe)),Ue||Se(!1),rt(),Ve&&JSswift.router.setURLOnly(Ve),de),Kt=(Pe,Ve)=>(Ye=dt(B,nt(Pe)),rt(),Ve&&JSswift.router.setURLOnly(Ve),B),St=(Pe,Ve)=>(Ze=dt(Le,nt(Pe)),rt(),Ve&&JSswift.router.setURLOnly(Ve),Le);Ee=dt(x,be(["header"],ie)),De=dt(c,D===!1?[]:be(["aside","drawer"],D)),Ue=dt(Ae,$===!1?[]:be(["nav","asideRight","drawerRight"],$)),Ye=dt(B,be(["page","main","default"],Ce)),Ze=dt(Le,be(["footer"],W)),typeof ResizeObserver!="undefined"&&(Qe=new ResizeObserver(()=>ut()),Qe.observe(x)),ut(),JSswift.reactive.effect(()=>{ke(),O(),ce(),H(),rt()},"UI.Layout:state");const cn=Pe=>{l(i("escClose"))!==!1&&(!O()&&!M()&&!Z()||!ce()&&!H()||Pe.key==="Escape"&&(Pe.preventDefault(),ce()&&f(!1),H()&&Se(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",cn,!0),_e.openAside=()=>f(!0),_e.closeAside=()=>f(!1),_e.toggleAside=()=>f(!ce()),_e.openNav=()=>Se(!0),_e.closeNav=()=>Se(!1),_e.toggleNav=()=>Se(!H()),_e.isDrawerOpen=()=>!!ce(),_e.isNavOpen=()=>!!H(),_e.isMobile=()=>!!O(),_e.header=()=>x,_e.aside=()=>v,_e.drawer=()=>v,_e.nav=()=>de,_e.page=()=>B,_e.main=()=>B,_e.footer=()=>Le,_e.headerUpdate=Vt,_e.asideUpdate=Mt,_e.drawerUpdate=Mt,_e.navUpdate=wt,_e.pageUpdate=Kt,_e.mainUpdate=Kt,_e.footerUpdate=St,_e.reflow=rt,_e._dispose=()=>{var Pe;typeof window!="undefined"&&window.removeEventListener("resize",ee),typeof document!="undefined"&&document.removeEventListener("keydown",cn,!0),N.removeEventListener("pointerdown",vt),Je.removeEventListener("pointerdown",_t),Te==null||Te(),(Pe=Qe==null?void 0:Qe.disconnect)==null||Pe.call(Qe)},Ke(_e,e),rt(),_e},he.Footer=(...t)=>{var ue,R,g;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=d=>Object.prototype.hasOwnProperty.call(e,d),r={props:e},y=(d,m)=>{if(!(m==null||m===!1)){if(Array.isArray(m)){m.forEach(F=>y(d,F));return}if(m!=null&&m.nodeType){d.appendChild(m);return}d.appendChild(document.createTextNode(String(m)))}},u=(d,m,F=X=>X)=>{const X=JSswift.ui.getSlot(s,d);if(X!=null)return J(s,d,r,null);if(typeof m=="function"){const a=new Set(["eyebrow","title","subtitle"]),C=_[a.has(d)?"span":"div"]({class:`cms-footer-slot-${d}`});return JSswift.reactive.effect(()=>{const h=F(m(r)),P=on(JSswift.ui.slot(h));C.replaceChildren(),Array.isArray(P)?P.forEach(j=>y(C,j)):y(C,P)},`UI.Footer:${d}`),[C]}return J(s,d,r,F(m))},i=(d,m="icon",F=e.iconSize||e.size||"md")=>d==null||d===!1?null:typeof d=="string"?he.Icon({name:d,size:F}):JSswift.ui.slot(d,{as:m}),b=o("left")?e.left:e.start,T=o("right")?e.right:e.end,S=o("title")?e.title:e.label,w=(R=(ue=e.subtitle)!=null?ue:e.description)!=null?R:e.note,z=o("content")?e.content:o("body")?e.body:n!=null&&n.length?n:null,Q=[...u("left",b),...u("start",null)],G=u("icon",e.icon,i),ie=u("eyebrow",(g=e.eyebrow)!=null?g:e.kicker),D=u("title",S),$=u("subtitle",w),Y=u("meta",e.meta),W=(()=>{const d=u("content",null);return d.length?d:u("default",z)})(),se=[...u("center",null),...u("body",null)],me=[...u("right",T),...u("end",null)],re=u("actions",e.actions),oe=_.div({class:ae(["cms-footer-body",e.bodyClass,e.centerClass])},_.div({class:"cms-footer-heading"},G.length?_.div({class:"cms-footer-icon"},...G):null,_.div({class:"cms-footer-copy"},ie.length?_.div({class:ae(["cms-footer-eyebrow",e.eyebrowClass])},...ie):null,D.length?_.div({class:ae(["cms-footer-title",e.titleClass])},...D):null,$.length?_.div({class:ae(["cms-footer-subtitle",e.subtitleClass])},...$):null,W.length?_.div({class:ae(["cms-footer-content",e.contentClass])},...W):null),Y.length?_.div({class:ae(["cms-footer-meta",e.metaClass])},...Y):null)),le=[];se.length?le.push(_.div({class:ae(["cms-footer-body",e.bodyClass,e.centerClass])},...se)):(G.length||ie.length||D.length||$.length||W.length||Y.length)&&le.push(oe),(me.length||re.length)&&le.push(_.div({class:ae(["cms-footer-end",e.endClass])},...me,...re.length?[_.div({class:ae(["cms-footer-actions",e.actionsClass])},...re)]:[]));const te=JSswift.omit(e,["actions","actionsClass","align","body","bodyClass","center","centerClass","content","contentClass","dense","description","divider","elevated","end","endClass","eyebrow","eyebrowClass","gap","icon","iconSize","kicker","label","left","meta","metaClass","minHeight","note","right","slots","stack","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap","justify"]);te.class=ae(["cms-panel","cms-footer","cms-singularity",fe(e.sticky,"sticky"),fe(e.dense,"dense"),fe(e.elevated,"elevated"),fe(e.divider!==!1,"divider"),fe(e.stack,"stack"),tl(e.align,"align-"),e.class]),te.style={...e.style||{}};const M=ze(e.justify);M!=null&&(te.style.justifyContent=M);const Z=ze(e.wrap,d=>d?"wrap":"nowrap");Z!=null&&(te.style.flexWrap=Z),e.gap!=null&&(te.style["--cms-footer-gap"]=Be(l(e.gap))),e.minHeight!=null&&(te.style.minHeight=Be(l(e.minHeight))),JSswift.uiApplyResponsiveProps(te,e,JSswift.uiResponsiveStyleRules);const q=_.footer(te,...Q.length?[_.div({class:ae(["cms-footer-start",e.startClass])},...Q)]:[],...le.length?[_.div({class:"cms-footer-main"},...le)]:[]);return Ke(q,e),q};const mi=t=>{const e=[];for(const n of t||[]){const s=on(JSswift.ui.slot(n));s&&(Array.isArray(s)?e.push(...s):e.push(s))}return e},Ln=(t,e)=>{const n=on(JSswift.ui.slot(t,e));return n?Array.isArray(n)?n:[n]:[]},Be=t=>{var e;return typeof t=="number"?`${t}px`:typeof t=="string"&&((e=JSswift.uiSizes)!=null&&e.includes(t))?`var(--cms-size-${t})`:String(t)};he.Toolbar=(...t)=>{var m,F,X,a,C,h,P,j;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(U,ce,L={})=>{const f=Array.isArray(U)?U:[U];for(const k of f)if(JSswift.ui.getSlot(s,k)!=null)return J(s,k,L,ce);return ce==null?[]:J(null,"default",L,ce)},r=U=>(Array.isArray(U)?U:[U]).some(L=>JSswift.ui.getSlot(s,L)!=null),y={props:e},u=o(["before"],e.before,y),i=o(["start","left"],(m=e.start)!=null?m:e.left,y),b=o(["center","body","content","default"],(a=(X=(F=e.center)!=null?F:e.body)!=null?X:e.content)!=null?a:n,y),T=o(["end","right","actions"],(h=(C=e.end)!=null?C:e.right)!=null?h:e.actions,y),S=o(["after"],e.after,y),w=o(["title"],e.title,y),z=o(["subtitle"],e.subtitle,y),Q=o(["meta"],e.meta,y),G=!!(u.length||i.length||T.length||S.length||w.length||z.length||Q.length||e.before!=null||e.start!=null||e.left!=null||e.end!=null||e.right!=null||e.actions!=null||e.after!=null||e.title!=null||e.subtitle!=null||e.meta!=null||e.body!=null||e.center!=null||e.content!=null||e.beforeClass||e.startClass||e.bodyClass||e.centerClass||e.contentClass||e.endClass||e.afterClass||e.titleClass||e.subtitleClass||e.metaClass||e.copyClass||r(["before","start","left","center","body","content","end","right","actions","after","title","subtitle","meta"])),ie=ae(["cms-toolbar",fe(G,"structured"),fe(e.dense,"dense"),fe(e.divider,"divider"),fe(e.elevated,"elevated"),fe(e.sticky,"sticky"),e.class]),D=JSswift.omit(e,["actions","after","afterClass","align","before","beforeClass","body","bodyClass","center","centerClass","content","contentClass","copyClass","dense","divider","elevated","end","endClass","gap","justify","left","meta","metaClass","right","size","slots","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap"]);D.class=ie;const $={...e.style||{}};$.display=$.display||"flex";const Y=ze(e.align),W=ze(e.justify),se=ze(e.wrap,U=>typeof U=="boolean"?U?"wrap":"nowrap":String(U),"wrap"),me=ze(e.gap,Be,"var(--cms-s-md)"),re=We(e,"gap");$["--cms-toolbar-gap"]=me!=null?me:"var(--cms-s-md)",re||($.gap=$.gap||"var(--cms-toolbar-gap)");const oe={xxs:"4px 6px",xs:"6px 8px",sm:"6px 10px",md:"10px 12px",lg:"12px 16px",xl:"14px 18px",xxl:"16px 20px"},le=ze(e.size,U=>oe[U]||"");if(le!=null&&($.padding=le),G?($.flexDirection=$.flexDirection||"column",$.alignItems=$.alignItems||"stretch"):(Y!=null&&($.alignItems=Y),W!=null&&($.justifyContent=W),se!=null&&($.flexWrap=se)),Object.keys($).length&&(D.style=$),JSswift.uiApplyResponsiveProps(D,e,JSswift.uiResponsiveStyleRules),!G){const U=J(s,"default",y,n),ce=_.div(D,...U);return Ke(ce,e),ce}const te=(j=(P=e.bodyClass)!=null?P:e.centerClass)!=null?j:e.contentClass,M=qe([e.justify],()=>{const U=l(e.justify);return!U||U==="flex-start"?"auto":""}),Z={display:"flex",alignItems:"inherit",gap:"var(--cms-toolbar-gap)",flexWrap:"inherit",minWidth:0},q={};Y!=null&&(q.alignItems=Y),W!=null&&(q.justifyContent=W),se!=null&&(q.flexWrap=se);const ue=Q.length||w.length||z.length?_.div({class:ae(["cms-toolbar-copy",e.copyClass])},Q.length?_.div({class:ae(["cms-toolbar-meta",e.metaClass])},...Q):null,w.length?_.div({class:ae(["cms-toolbar-title",e.titleClass])},...w):null,z.length?_.div({class:ae(["cms-toolbar-subtitle",e.subtitleClass])},...z):null):null,R=!!(i.length||ue||b.length||T.length),g=[u.length?_.div({class:ae(["cms-toolbar-before",e.beforeClass]),style:{...Z}},...u):null,R?_.div({class:"cms-toolbar-main",style:q},i.length?_.div({class:ae(["cms-toolbar-start",e.startClass]),style:{...Z}},...i):null,ue||b.length?_.div({class:ae(["cms-toolbar-center",te]),style:{...Z,flex:"1 1 240px"}},ue,...b):null,T.length?_.div({class:ae(["cms-toolbar-end",e.endClass]),style:{...Z,justifyContent:"flex-end",marginInlineStart:M}},...T):null):null,S.length?_.div({class:ae(["cms-toolbar-after",e.afterClass]),style:{...Z}},...S):null].filter(Boolean),d=_.div(D,...g);return Ke(d,e),d};const To=t=>{var e;return t&&t.nodeType===1&&((e=t.classList)==null?void 0:e.contains("cms-grid-col"))};he.Grid=(...t)=>{var d,m,F,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=l(e.items),r=Array.isArray(o)?o:o==null?[]:[o],y=(a={})=>{const C=e.itemProps||{},h={...C,...a};return h.class=ae([C.class,e.itemClass,a.class]),h.style={...C.style||{},...e.itemStyle||{},...a.style||{}},h},u=(a,C={})=>{if(a==null||a===!1)return[];if(To(a))return[a];if(_n(a)){const h=a.children!=null?Zt(a.children):a.content!=null?Zt(a.content):a.node!=null?Zt(a.node):a.label!=null?Zt(a.label):[];return[he.GridCol(y(a),...h)]}return Array.isArray(a)?[he.GridCol(y(C),...a)]:[he.GridCol(y(C),a)]},i=(a,C,h,P=!0)=>{if(a==null||a===!1)return[];const j=_n(a)?a:{};if(P){const U={item:a,index:C,count:h,first:C===0,last:C===h-1},ce=J(s,"item",U,null);if(ce.length)return ce.flatMap(L=>u(L,j))}return u(a,j)},b=[];r.forEach((a,C)=>{b.push(...i(a,C,r.length))}),J(s,"default",{items:r,count:r.length},n).forEach(a=>{b.push(...u(a))}),b.length||J(s,"empty",{items:r,count:0},e.empty).forEach(C=>{const h=u(C,{style:{gridColumn:"1 / -1"}});b.push(...h)});const S=ae(["cms-grid",JSswift.uiResponsiveClasses({mobile:e},Zs),JSswift.uiResponsiveClasses(e,Zs),fe(e.dense,"dense"),fe(e.inline,"cms-grid-inline"),fe(e.debug,"cms-grid-debug"),e.class]),w=JSswift.omit(e,["gap","rowGap","columnGap","colGap","cols","columns","rows","areas","align","justify","alignItems","justifyItems","placeItems","placeContent","dense","flow","inline","debug","autoFit","autoFill","min","max","autoRows","items","itemClass","itemStyle","itemProps","empty","slots","full","width","minWidth","maxWidth","padding",...JSswift.uiResponsiveOmitProps]);w.class=S;const z={...e.style||{}};(d=JSswift.uiResponsiveHasConfig)!=null&&d.call(JSswift,e)&&e.display==null&&!We(e,"display")&&z.display==null&&(z.display=e.inline?"inline-grid":"grid");const Q=ze(e.gap,Be);Q!=null&&!We(e,"gap")&&(z["--cms-grid-gap"]=Q,z.gap=Q);const G=ze(e.rowGap,Be);G!=null&&!We(e,"rowGap")&&(z.rowGap=G);const ie=ze((m=e.columnGap)!=null?m:e.colGap,Be);ie!=null&&!We(e,["columnGap","colGap"])&&(z.columnGap=ie);const D=ze(e.max,Be,"1fr"),$=ze(e.min,Be);if($!=null){const a=l(e.autoFill)?"auto-fill":"auto-fit";z.gridTemplateColumns=`repeat(${a}, minmax(${$}, ${D||"1fr"}))`}else{const a=ze((F=e.columns)!=null?F:e.cols,C=>typeof C=="number"?`repeat(${C}, minmax(0, 1fr))`:String(C));a!=null&&!We(e,["cols","columns"])&&(z.gridTemplateColumns=a)}const Y=ze(e.rows,a=>typeof a=="number"?`repeat(${a}, minmax(0, auto))`:String(a));Y!=null&&(z.gridTemplateRows=Y);const W=ze(e.autoRows,Be);W!=null&&(z.gridAutoRows=W);const se=ze(e.flow,a=>{const C=String(a);return e.dense&&!C.includes("dense")?`${C} dense`:C});se!=null&&!We(e,"flow")&&(z.gridAutoFlow=se);const me=ze(e.areas,a=>Array.isArray(a)?a.map(C=>`"${Array.isArray(C)?C.join(" "):String(C)}"`).join(" "):String(a));me!=null&&(z.gridTemplateAreas=me);const re=ze((X=e.align)!=null?X:e.alignItems);re!=null&&!We(e,["align","alignItems"])&&(z.alignItems=re);const oe=ze(e.justify);oe!=null&&!We(e,"justify")&&(z.justifyContent=oe);const le=ze(e.justifyItems);le!=null&&(z.justifyItems=le);const te=ze(e.placeItems);te!=null&&(z.placeItems=te);const M=ze(e.placeContent);M!=null&&(z.placeContent=M);const Z=ze(e.width,Be);Z!=null&&!We(e,"width")&&(z.width=Z),l(e.full)===!0&&(z.width="100%");const q=ze(e.minWidth,Be);q!=null&&!We(e,"minWidth")&&(z.minWidth=q);const ue=ze(e.maxWidth,Be);ue!=null&&!We(e,"maxWidth")&&(z.maxWidth=ue);const R=ze(e.padding,Be);R!=null&&!We(e,"padding")&&(z.padding=R),Object.keys(z).length&&(w.style=z),JSswift.uiApplyResponsiveProps(w,e,JSswift.uiResponsiveStyleRules);const g=_.div(w,...b);return Ke(g,e),g},he.GridCol=(...t)=>{var Ce,pe,Ie,_e,I,we,E,x;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=v=>Object.prototype.hasOwnProperty.call(e,v),r=(v,c,N={})=>{const de=Array.isArray(v)?v:[v];for(const Ae of de)if(JSswift.ui.getSlot(s,Ae)!=null)return J(s,Ae,N,c);return c==null?[]:J(null,"default",N,c)},y=v=>{var c;return v==null||v===!1||v===""?"":typeof v=="string"&&((c=JSswift.uiSizes)!=null&&c.includes(v))?`var(--cms-s-${v})`:Be(v)},u=v=>{var c;return v==null||v===!1||v===""?"":typeof v=="string"&&((c=JSswift.uiSizes)!=null&&c.includes(v))?ms(v,"size"):Be(v)},i={...e.style||{}},b=v=>{if(v==null||v==="")return null;if(v==="auto")return"auto";if(v==="full"||v===!0)return"1 / -1";const c=Number(v);if(Number.isFinite(c)&&c>0){const N=Math.max(1,Math.round(c));return`span ${N} / span ${N}`}return String(v)},T=v=>{if(v==null||v==="")return null;if(v==="full"||v===!0)return"1 / -1";const c=Number(v);if(Number.isFinite(c)&&c>0){const N=Math.max(1,Math.round(c));return`span ${N} / span ${N}`}return String(v)},S=o("span")?e.span:e.col,w=ze(S,b),z=ze(e.sm,b),Q=ze(e.md,b),G=ze(e.lg,b),ie=JSswift.uiResponsivePropsFor(e,pn("tablet"))||{},D=JSswift.uiResponsivePropsFor(e,pn("pc"))||{},$=(Ce=ie.span)!=null?Ce:ie.col,Y=(pe=D.span)!=null?pe:D.col,W=ze($,b),se=ze(Y,b),me=ze(e.rowSpan,T),re=ze(e.row,T),oe=ze(e.area),le=ze(e.align),te=ze(e.justify),M=ze(e.place),Z=ze(e.gap,y),q=ze(e.rowGap,y),ue=ze(e.columnGap,y),R=ze(e.padding,y),g=ze(e.width,u),d=ze(e.minHeight,u),m=ze(e.height,u),F=ze(e.maxHeight,u),X=ze(e.contentAlign),a=ze(e.contentJustify),C=ze(e.direction),h=ze(e.scroll,v=>v===!0?"auto":String(v),""),P=ze(e.fullHeight,v=>v?"100%":"",""),j=qe([e.center,e.contentAlign,e.contentJustify],()=>!!l(e.center)&&(l(e.contentAlign)==null||l(e.contentAlign)==="")&&(l(e.contentJustify)==null||l(e.contentJustify)==="")),U={props:e},ce=r(["start","top","header","before"],(I=(_e=(Ie=e.start)!=null?Ie:e.top)!=null?_e:e.header)!=null?I:e.before,U),L=o("body")?e.body:o("content")?e.content:n,f=r(["body","content","default"],L,U),k=r(["end","bottom","footer","after"],(x=(E=(we=e.end)!=null?we:e.bottom)!=null?E:e.footer)!=null?x:e.after,U),A=ce.length||k.length||o("start")||o("top")||o("header")||o("before")||o("body")||o("content")||o("end")||o("bottom")||o("footer")||o("after")||e.startClass||e.bodyClass||e.contentClass||e.endClass||e.topClass||e.headerClass||e.bottomClass||e.footerClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"top")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"content")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"bottom")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,H=qe([e.stack,e.gap,e.rowGap,e.columnGap,e.contentAlign,e.contentJustify,e.direction,e.center],()=>A||l(e.stack)||[l(e.gap),l(e.rowGap),l(e.columnGap),l(e.contentAlign),l(e.contentJustify),l(e.direction)].some(c=>c!=null&&c!==!1&&c!=="")?!0:!!l(e.center)),ge=qe([e.panel,e.color,e.clickable,e.border,e.glossy,e.glow,e.glass,e.shadow,e.outline,e.gradient,e.textGradient,e.lightShadow,e.radius],()=>!!(l(e.panel)||l(e.color)||l(e.clickable)||l(e.border)||l(e.glossy)||l(e.glow)||l(e.glass)||l(e.shadow)||l(e.outline)||l(e.gradient)||l(e.textGradient)||l(e.lightShadow)||l(e.radius))?["cms-clear-set","cms-singularity","cms-grid-col-surface"]:[]),Se=ae(["cms-grid-col",ge,JSswift.uiResponsiveClasses({mobile:e},el),JSswift.uiResponsiveClasses(e,el),fe(e.panel,"cms-grid-col-panel"),fe(e.auto,"is-auto"),fe(H,"cms-grid-col-stack"),fe(e.inline,"cms-grid-col-inline"),fe(j,"cms-grid-col-center"),e.class]),ye=JSswift.omit(e,["span","col","sm","md","lg","auto","row","rowSpan","area","align","justify","place","gap","rowGap","columnGap","padding","width","height","minHeight","maxHeight","fullHeight","stack","inline","direction","contentAlign","contentJustify","center","scroll","panel","to","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass","slots","style","clickable","dense","flat","border","glossy","glow","glass","shadow","outline","rounded","gradient","textGradient","lightShadow","color","textColor","size","radius",...JSswift.uiResponsiveOmitProps]);ye.class=Se,i["--cms-grid-col-base"]==null&&(i["--cms-grid-col-base"]="auto"),i["--cms-grid-col-tablet"]==null&&(i["--cms-grid-col-tablet"]="var(--cms-grid-col-base, auto)"),i["--cms-grid-col-pc"]==null&&(i["--cms-grid-col-pc"]="var(--cms-grid-col-tablet, var(--cms-grid-col-base, auto))"),l(e.auto)===!0?i["--cms-grid-col-base"]="auto":w!=null&&(i["--cms-grid-col-base"]=w),z!=null&&(i["--cms-grid-col-sm"]=z),Q!=null&&(i["--cms-grid-col-md"]=Q),G!=null&&(i["--cms-grid-col-lg"]=G),W!=null&&(i["--cms-grid-col-tablet"]=W),se!=null&&(i["--cms-grid-col-pc"]=se),me!=null?i.gridRow=me:re!=null&&(i.gridRow=re),oe!=null&&(i.gridArea=oe),le!=null&&!We(e,"align")&&(i.alignSelf=le),te!=null&&!We(e,"justify")&&(i.justifySelf=te),M!=null&&!We(e,"place")&&(i.placeSelf=M),Z!=null&&!We(e,"gap")&&(i.gap=Z),q!=null&&!We(e,"rowGap")&&(i.rowGap=q),ue!=null&&!We(e,"columnGap")&&(i.columnGap=ue),R!=null&&!We(e,"padding")&&(i.padding=R),g!=null&&!We(e,"width")&&(i.width=g),P!=null&&P!==""?i.height=P:m!=null&&!We(e,"height")&&(i.height=m),d!=null&&!We(e,"minHeight")&&(i.minHeight=d),F!=null&&!We(e,"maxHeight")&&(i.maxHeight=F),C!=null&&!We(e,"direction")&&(i.flexDirection=C),X!=null&&!We(e,"contentAlign")?i.alignItems=X:j!=null&&j!==""&&(i.alignItems=j?"center":""),a!=null&&!We(e,"contentJustify")?i.justifyContent=a:j!=null&&j!==""&&(i.justifyContent=j?"center":""),h!=null&&h!==""&&(i.overflow=h),Object.keys(i).length&&(ye.style=i),JSswift.uiApplyResponsiveProps(ye,e,Io);const V=e.onClick,O=e.onKeydown,K=!!(l(e.clickable)||l(e.to)),ke=v=>{var N;if(V==null||V(v),v.defaultPrevented)return;const c=l(e.to);c&&((N=JSswift.router)!=null&&N.navigate)&&(v.preventDefault(),JSswift.router.navigate(c))},Ne=v=>{O==null||O(v),!v.defaultPrevented&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),ke(v))};if(K&&(ye.onClick=ke,ye.onKeydown=Ne,ye.tabIndex==null&&(ye.tabIndex=0),ye.role==null&&(ye.role="button")),!A){const v=_.div(ye,...J(s,"default",U,n));return Ke(v,e),v}const ee={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},xe=[ce.length?_.div({class:ae(["cms-grid-col-start",e.startClass,e.topClass,e.headerClass]),style:{...ee}},...ce):null,f.length?_.div({class:ae(["cms-grid-col-body",e.bodyClass,e.contentClass]),style:{...ee,flex:"1 1 auto"}},...f):null,k.length?_.div({class:ae(["cms-grid-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...ee}},...k):null].filter(Boolean),be=_.div(ye,...xe);return Ke(be,e),be},he.Icon=(...t)=>{var re,oe;let e={},n=[],s="home",o=!1;const r=t[0],y=t[1],u=le=>le&&typeof le=="object"&&!le.nodeType&&!Array.isArray(le)&&!(le instanceof Function);typeof r=="string"?(s=r,o=!0,u(y)?(e=y,t.length>2&&(n=t.slice(2))):t.length>1&&(n=t.slice(1))):u(r)?(e=r,r.name!=null&&(s=r.name,o=!0),t.length>1&&(n=t.slice(1))):t.length&&(n=t),!o&&n.length&&(s=n.length===1?n[0]:n),Yt(e);const i=e.slots||{},b=l(e.size),T=l(e.color),S=String(s).endsWith("-fill"),w={...e.style||{}},z=qe(e.size,()=>{const le=l(e.size);return typeof le=="string"&&kn[le]?le:""}),Q=!!(e.color||e.clickable||e.border||e.glossy||e.glow||e.glass||e.shadow||e.outline||e.gradient||e.textGradient||e.lightShadow||e.radius),G={"chevron-down":{viewBox:"0 0 24 24",paths:[{d:"M6 9l6 6l6 -6",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}]}},ie=le=>{const te=G[le];return te?_.svg({width:"100%",height:"100%",viewBox:te.viewBox,fill:"none","aria-hidden":"true",focusable:"false"},...te.paths.map(M=>_.path(M))):null},D=le=>{const te=l(e.tooltip);if(te==null||te===!1||!he.Tooltip)return le;const M=u(te)?{...te}:{text:te};return u(e.tooltipProps)&&Object.assign(M,e.tooltipProps),he.Tooltip({...M,target:le})},$=ae(["cms-icon","material-icons",...Q?["cms-clear-set","cms-singularity"]:[],z,e.class]),Y=JSswift.omit(e,["name","size","class","style","label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots","spriteUrl","tooltip","tooltipProps"]);if(Y.class=$,Object.keys(w).length&&(Y.style=w),typeof s=="function"||s&&typeof s=="object"){const le=JSswift.ui.renderSlot(i,"default",{},s),te=J(null,"default",{},le),M=_.span({...Y,"data-icon":"custom"},...te);return Ke(M,e),D(M)}const W=String(s),se=W.includes("#")?W:"";let me=null;if(se){const le=e.spriteUrl||((re=JSswift.config)==null?void 0:re.iconSpriteUrl)||(typeof globalThis!="undefined"?(oe=globalThis.JSswift_setting)==null?void 0:oe.iconSpriteUrl:null),te=se.slice(se.indexOf("#")+1),M=le?_.svg({width:"100%",height:"100%"},_.use({href:le+se})):ie(te)||_.svg({width:"100%",height:"100%"},_.use({href:se}));S&&(M.style.fill="currentColor"),me=_.span({...Y,"data-icon":W},M,...n)}else me=_.span({...Y,"data-icon":W},W,...n);if(b!=null){let le=b;JSswift.uiSizes.includes(b)&&(le=`var(--cms-icon-size-${b})`),le=typeof le=="number"?le+"px":String(le),me.style.setProperty("--set-icon-size",le)}return Ke(me,e),D(me)},he.Badge=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{const G=l(e.size);return typeof G=="string"&&kn[G]?`cms-size-${G}`:""}),r=ae(["cms-clear-set","cms-badge","cms-singularity",o,fe(e.outline,"outline"),e.class]),y=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);y.class=r;const u={...e.style||{}};if(e.size){const G=l(e.size);typeof G=="string"&&kn[G]||(u.fontSize=Be(e.size))}y.style=u;const i=(G,ie,D)=>{const $=Array.isArray(G)?G:[G];for(const Y of $)if(JSswift.ui.getSlot(s,Y)!=null)return J(s,Y,ie,D);return D==null||D===!1||D===""?[]:J(null,"default",ie,D)},b=()=>{var ie;const G=l((ie=e.iconSize)!=null?ie:e.size);return typeof G=="number"?Math.max(10,Math.round(G*.85)):typeof G=="string"&&{xxs:10,xs:11,sm:12,md:13,lg:14,xl:16,xxl:18,xxxl:20}[G]||14},T=(G,ie)=>{const D=l(G);return D==null||D===!1||D===""?null:typeof D=="string"?he.Icon({name:D,size:b()}):JSswift.ui.slot(D,{as:ie})},S=(G,ie,D)=>_.dynamic(()=>{const $=T(e[ie],D),Y=i(G,{position:D},$);return Y.length?_.span({class:`cms-badge-anchor cms-badge-anchor-${D}`,"data-badge-slot":D},...Y):null}),w=_.dynamic(()=>{const G=l(e.label);let ie=i(["label"],{},G);return ie.length||(ie=i(["default"],{},n)),_.span({class:"cms-badge-content"},_.span({class:"cms-badge-label"},...ie.length?ie:[""]))}),z=_.dynamic(()=>{const G=l(e.notification),ie=G==null||G===!1||G===""?null:G,D=i(["notification"],{notification:G},ie);return D.length?_.span({class:"cms-badge-notification","data-badge-slot":"notification","aria-label":typeof G=="number"?`${G} notifications`:null},...D):null}),Q=_.span(S(["left"],"left","left"),S(["centerLeft","center-left"],"centerLeft","center-left"),y,w,S(["topLeft","top-left"],"topLeft","top-left"),S(["topRight","top-right"],"topRight","top-right"),S(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),S(["bottomRight","bottom-right"],"bottomRight","bottom-right"),S(["centerRight","center-right"],"centerRight","center-right"),S(["right"],"right","right"),z);return(e.topLeft||e.centerLeft||e.bottomLeft)&&Q.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&Q.style.setProperty("padding-right","15px"),Ke(Q,e),Q};const Ro=t=>{if(t==null||t===!1)return"";const e=String(t).replace(/[._-]+/g," ").replace(/\s+/g," ").trim();if(!e)return"";const n=e.split(" ").filter(Boolean);return n.length?n.length===1?n[0].replace(/[^a-z0-9]/gi,"").slice(0,2).toUpperCase():n.slice(0,2).map(s=>s.charAt(0).toUpperCase()).join(""):""},ll=(t,e)=>{const n=t==null||t===!0?e:t;if(n==null||n===!1)return mt(e);const s=String(n).toLowerCase();return s==="online"||s==="available"||s==="active"?"success":s==="away"||s==="pending"?"warning":s==="busy"||s==="dnd"||s==="blocked"?"danger":s==="offline"||s==="idle"?"secondary":mt(s)||mt(e)},ol=(t,e="cms-avatar-badge")=>t==null||t===!1?null:t instanceof Node||Array.isArray(t)||typeof t=="function"?t:t===!0?_.span({class:e}):_.span({class:e},String(t)),Mo=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=ll(null,e);return _.span({class:ae(["cms-avatar-status",s?`cms-state-${s}`:""])})}if(t instanceof Node||Array.isArray(t)||typeof t=="function")return t;const n=ll(t,e);return t===!0||n?_.span({class:ae(["cms-avatar-status",n?`cms-state-${n}`:""])}):ol(t,"cms-avatar-badge")},Bn=(t,e)=>!e||!e.length?null:_.span({class:ae(["cms-avatar-anchor",t])},...e);he.Avatar=(...t)=>{var m,F,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{var C;const a=l(e.size);return typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?`cms-size-${a}`:""}),r=qe([e.color,e.state],()=>{const a=l(e.color)||l(e.state)||"",C=mt(a);return C?`cms-state-${C}`:""}),y=ae(["cms-clear-set","cms-avatar","cms-singularity",o,r,fe(e.square,"cms-avatar-square"),fe(e.elevated,"elevated"),e.class]),u=JSswift.omit(e,["src","srcset","srcSet","sizes","alt","label","name","initials","text","size","fontSize","textSize","radius","rounded","square","elevated","icon","iconSize","media","fit","badge","notification","status","statusColor","presence","topLeft","topRight","bottomLeft","bottomRight","slots"]);u.class=y;const i={...e.style||{}},b=ze(e.size,a=>{var C;return typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?"":Be(a)},"");b!=null&&(i.width=b,i.height=b);const T=(m=e.fontSize)!=null?m:e.textSize,S=T!=null?ze(T,Be):ze(e.size,a=>{var C;return typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?"":`clamp(11px, calc(${Be(a)} * 0.34), 28px)`},"");S!=null&&(i.fontSize=S);const w=ze(e.radius,a=>{const C=so(a);return C==="xxxl"?"999px":C?`var(--cms-r-${C})`:typeof a=="number"?`${a}px`:String(a)});w!=null&&(i["--set-border-radius"]=w),u.style=i;const z={props:e},Q=qe([e.alt,e.label,e.name,e.text],()=>{const a=l(e.alt)||l(e.label)||l(e.name)||l(e.text)||"avatar";return String(a)}),G=e.icon!=null?typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,ie=qe([e.initials,e.text,e.label,e.name],()=>{var h,P;const a=(h=l(e.initials))!=null?h:l(e.text);if(a!=null)return a;const C=(P=l(e.label))!=null?P:l(e.name);return typeof C=="string"?Ro(C):C}),D=ol(l((F=e.badge)!=null?F:e.notification)),$=Mo(l((X=e.status)!=null?X:e.presence),l(e.statusColor));let Y=J(s,"media",z,e.media);if(!Y.length&&e.src){const a={class:"cms-avatar-img",src:e.src,alt:Q,sizes:e.sizes,style:{}};e.srcset!=null&&(a.srcset=e.srcset),e.srcSet!=null&&(a.srcset=e.srcSet);const C=ze(e.fit);C!=null&&(a.style.objectFit=C),Y=[_.img(a)]}const W=J(s,"default",z,n),se=J(s,"fallback",z,null),me=J(s,"label",z,ie),re=J(s,"icon",z,G),oe=Y.length?Y:W.length?W:se.length?se:me.length?me:re.length?re:["?"],le=Y.length?"cms-avatar-media":"cms-avatar-fallback",te=_.span({class:"cms-avatar-body"},_.span({class:le},...oe));let M=J(s,"topLeft",z,e.topLeft),Z=J(s,"topRight",z,e.topRight),q=J(s,"bottomLeft",z,e.bottomLeft),ue=J(s,"bottomRight",z,e.bottomRight);const R=J(s,"badge",z,D),g=J(s,"status",z,$);!Z.length&&R.length&&(Z=R),!ue.length&&g.length&&(ue=g);const d=_.div(u,te,Bn("cms-avatar-anchor-top-left",M),Bn("cms-avatar-anchor-top-right",Z),Bn("cms-avatar-anchor-bottom-left",q),Bn("cms-avatar-anchor-bottom-right",ue));return Ke(d,e),d},he.Chip=(...t)=>{var ie,D,$,Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{const W=l(e.size);return typeof W=="string"&&kn[W]?W:""}),r=ae(["cms-clear-set","cms-chip","cms-singularity",o,e.class]),y=JSswift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);y.class=r,y.style={...e.style||{}};const u=e.icon?typeof e.icon=="string"?he.Icon({name:e.icon,size:(ie=e==null?void 0:e.size)!=null?ie:null}):JSswift.ui.slot(e.icon,{as:"icon"}):null,i=e.iconRight?typeof e.iconRight=="string"?he.Icon({name:e.iconRight,size:(D=e==null?void 0:e.size)!=null?D:null}):JSswift.ui.slot(e.iconRight,{as:"iconRight"}):null,b=JSswift.ui.renderSlot(s,"icon",{},u),T=JSswift.ui.renderSlot(s,"iconRight",{},i),S=J(s,"label",{},e.label),w=S.length?S:J(s,"default",{},n),z=J(null,"default",{},b),Q=J(null,"default",{},T),G=_.span(y,...z,...w.length?w:[""],...Q);if(e.removable){const W=he.Btn({class:"cms-chip-remove",onClick:e.onRemove,size:($=e==null?void 0:e.size)!=null?$:null},he.Icon({size:(Y=e==null?void 0:e.size)!=null?Y:null,name:"close"}));G.appendChild(W),W.onclick=()=>{e.onRemove&&e.onRemove(),G.remove()}}return Ke(G,e),G},he.Stat=(...t)=>{var re,oe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.state)||l(e.color)||""),r=qe([e.state,e.color],()=>{const le=o();return le?`cms-state-${le}`:""}),y=qe(e.trend,()=>{const le=String(l(e.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(le)?"is-positive":["down","negative","danger","loss","decrease"].includes(le)?"is-negative":["flat","neutral","steady","stable"].includes(le)?"is-neutral":""}),u={...e},i=JSswift.omit(u,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","meta","note","slots","state","subtitle","title","trend","value"]);i.class=ae(["cms-clear-set","cms-stat","cms-singularity",r,y,u.class]),i.style={...u.style||{}};const b=(le,te,M={})=>J(s,le,M,te),T=e.icon==null?null:typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"md"}):JSswift.ui.slot(e.icon,{as:"icon"}),S=b("eyebrow",e.eyebrow),w=b("label",(re=e.label)!=null?re:e.title),z=b("value",e.value),Q=b("note",(oe=e.note)!=null?oe:e.subtitle),G=b("meta",e.meta),ie=b("delta",e.delta,{trend:e.trend}),D=b("icon",T),$=b("aside",e.aside),Y=b("footer",e.footer),W=b("actions",e.actions),se=b("default",n),me=_.article(i,_.div({class:"cms-stat-head"},_.div({class:"cms-stat-lead"},D.length?_.div({class:"cms-stat-icon"},...D):null,_.div({class:"cms-stat-copy"},S.length?_.div({class:"cms-stat-eyebrow"},...S):null,w.length?_.div({class:"cms-stat-label"},...w):null)),$.length?_.div({class:"cms-stat-aside"},...$):null),_.div({class:"cms-stat-body"},z.length?_.div({class:"cms-stat-value"},...z):null,ie.length?_.div({class:"cms-stat-delta"},...ie):null,Q.length?_.div({class:"cms-stat-note"},...Q):null,G.length?_.div({class:"cms-stat-meta"},...G):null,se.length?_.div({class:"cms-stat-extra"},...se):null),Y.length||W.length?_.div({class:"cms-stat-footer"},Y.length?_.div({class:"cms-stat-footer-copy"},...Y):null,W.length?_.div({class:"cms-stat-actions"},...W):null):null);return Ke(me,e),me},he.Kpi=(...t)=>{var re,oe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.state)||l(e.color)||""),r=qe([e.state,e.color],()=>{const le=o();return le?`cms-state-${le}`:""}),y={...e},u=JSswift.omit(y,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","media","meta","note","slots","state","subtitle","title","trend","value"]);u.class=ae(["cms-clear-set","cms-kpi","cms-singularity",r,y.class]),u.style={...y.style||{}};const i=(le,te,M={})=>J(s,le,M,te),b=e.icon==null?null:typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"lg"}):JSswift.ui.slot(e.icon,{as:"icon"}),T=i("eyebrow",e.eyebrow),S=i("title",(re=e.title)!=null?re:e.label),w=i("value",e.value),z=i("delta",e.delta,{trend:e.trend}),Q=i("note",(oe=e.note)!=null?oe:e.subtitle),G=i("meta",e.meta),ie=i("icon",b),D=i("aside",e.aside),$=i("media",e.media),Y=i("footer",e.footer),W=i("actions",e.actions),se=i("default",n),me=_.section(u,_.div({class:"cms-kpi-head"},_.div({class:"cms-kpi-title-wrap"},ie.length?_.div({class:"cms-kpi-icon"},...ie):null,_.div({class:"cms-kpi-copy"},T.length?_.div({class:"cms-kpi-eyebrow"},...T):null,S.length?_.div({class:"cms-kpi-title"},...S):null)),D.length?_.div({class:"cms-kpi-aside"},...D):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},w.length?_.div({class:"cms-kpi-value"},...w):null,z.length?_.div({class:"cms-kpi-delta"},...z):null),Q.length?_.div({class:"cms-kpi-note"},...Q):null,G.length?_.div({class:"cms-kpi-meta"},...G):null,$.length?_.div({class:"cms-kpi-media"},...$):null,se.length?_.div({class:"cms-kpi-extra"},...se):null),Y.length||W.length?_.div({class:"cms-kpi-footer"},Y.length?_.div({class:"cms-kpi-footer-copy"},...Y):null,W.length?_.div({class:"cms-kpi-actions"},...W):null):null);return Ke(me,e),me};const Fo=(t,e=180)=>{const n=getComputedStyle(t).transitionDuration;if(!n)return e;const s=n.split(",")[0].trim();if(!s)return e;const o=s.includes("ms")?parseFloat(s):parseFloat(s)*1e3;return Number.isFinite(o)?o:e},bn=t=>{!(t!=null&&t.overlay)||!(t!=null&&t.panel)||(t.overlay.classList.add("enter"),t.panel.classList.add("enter"),requestAnimationFrame(()=>{!(t!=null&&t.overlay)||!(t!=null&&t.panel)||(t.overlay.classList.add("entered"),t.panel.classList.add("entered"),t.overlay.classList.remove("enter"),t.panel.classList.remove("enter"))}))},yn=(t,e)=>{if(!(t!=null&&t.overlay)||!(t!=null&&t.panel)){e==null||e();return}if(t._closing)return;t._closing=!0,t.overlay.classList.add("leave"),t.panel.classList.add("leave");const n=()=>{t._closed||(t._closed=!0,e==null||e())},s=r=>{r.target===t.panel&&(t.panel.removeEventListener("transitionend",s),n())};t.panel.addEventListener("transitionend",s);const o=Fo(t.panel,180);setTimeout(n,o+40)};he.List=(...t)=>{var D;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=!!l((D=e.number)!=null?D:e.ordered),r=l(e.marker),y=l(e.items),u=Array.isArray(y)?y:y==null?[]:[y],i=($={})=>{const Y=e.itemProps||{},W={...Y,...$};return e.divider!=null&&W.divider==null&&(W.divider=e.divider),W.class=ae([Y.class,e.itemClass,$.class]),W.style={...Y.style||{},...e.itemStyle||{},...$.style||{}},W},b=$=>{if($==null||$===!1)return[];if(rs($))return[$];if(_n($)){const Y=$.children!=null?Zt($.children):$.content!=null?Zt($.content):Zt($.node);return[he.Item(i($),...Y)]}return Array.isArray($)?[he.Item(i(),...$)]:$!=null&&$.nodeType?[he.Item(i(),$)]:[he.Item(i(),$)]},T=($,Y,W,se=!0)=>{if($==null||$===!1)return[];if(se){const me={item:$,index:Y,count:W,first:Y===0,last:Y===W-1},re=J(s,"item",me,null);if(re.length)return re.flatMap(oe=>b(oe))}return b($)},S=[];u.forEach(($,Y)=>{S.push(...T($,Y,u.length))});const w=J(s,"default",{items:u,count:u.length},n);if(w.forEach(($,Y)=>{S.push(...T($,u.length+Y,u.length+w.length,!1))}),!S.length){const $=J(s,"empty",{items:u,count:0},e.empty);$.length&&($.length===1&&rs($[0])?S.push($[0]):S.push(he.Item({class:"cms-item-empty",flat:!0},...$)))}const z=ae(["cms-list",fe(e.dense,"dense"),fe(e.divider,"divider"),fe(r===!1||r==="none","cms-list-no-marker"),e.class]),Q=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);Q.class=z,Q.style={...e.style||{}};const G=ze(e.gap,Be);return G!=null&&(Q.style["--cms-list-gap"]=G),r!=null&&r!==!1&&r!==!0&&r!=="none"&&(Q.style.listStyleType=String(r)),_[o?"ol":"ul"](Q,...S)},he.Item=(...t)=>{var R,g,d,m,F,X,a,C;const{props:e,children:n}=JSswift.uiNormalizeArgs(t);e.state!=null&&e.color==null&&(e.color=e.state),Yt(e);const s=e.slots||{},o=qe([e.clickable,e.to],()=>!!(l(e.clickable)||l(e.to))),r=qe([e.active,e.selected],()=>!!(l(e.active)||l(e.selected))),y=!!(e.color!=null||e.outline||e.border||e.glossy||e.glow||e.glass||e.shadow||e.gradient||e.textGradient||e.lightShadow||e.radius||e.rounded||e.flat),u=(h,P,j)=>{const U=l(h);return U==null||U===!1||U===""?null:typeof U=="string"?he.Icon({name:U,size:P||"sm"}):JSswift.ui.slot(U,{as:j})},i=J(s,"icon",{},u(e.icon,e.iconSize||e.size,"icon")),b=J(s,"title",{},(R=e.title)!=null?R:e.label),T=J(s,"subtitle",{},(d=(g=e.subtitle)!=null?g:e.caption)!=null?d:e.description),S=J(s,"meta",{},(m=e.meta)!=null?m:e.eyebrow),w=J(s,"body",{},(F=e.body)!=null?F:e.content),z=J(s,"default",{},n),Q=J(s,"actions",{},(X=e.actions)!=null?X:e.footer),G=(C=(a=e.aside)!=null?a:e.trailing)!=null?C:u(e.iconRight,e.iconSize||e.size,"iconRight"),ie=J(s,"aside",{},G),D=[...w,...z],$=!(y||e.clickable||e.to||i.length||b.length||T.length||S.length||Q.length||ie.length||w.length),Y=ae(["cms-item",fe(e.divider,"divider"),fe(y,"cms-clear-set"),fe(y,"cms-singularity"),fe(y,"cms-item-surface"),fe($,"cms-item-inline"),fe(o,"cms-item-clickable"),fe(r,"is-active"),fe(e.disabled,"is-disabled"),e.class]),W=JSswift.omit(e,["divider","slots","label","title","subtitle","caption","description","meta","eyebrow","body","content","children","node","icon","iconRight","iconSize","aside","trailing","actions","footer","clickable","to","active","selected","disabled","state","color","size","outline","flat","border","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","dense"]);W.class=Y,W.style={...e.style||{}};const se=e.onClick,me=e.onKeydown,re=h=>{var j;if(se==null||se(h),h.defaultPrevented||l(e.disabled))return;const P=l(e.to);P&&((j=JSswift.router)!=null&&j.navigate)&&(h.preventDefault(),JSswift.router.navigate(P))},oe=h=>{me==null||me(h),!(h.defaultPrevented||l(e.disabled))&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),re(h))};l(e.disabled)&&(W["aria-disabled"]="true"),(l(e.clickable)||l(e.to))&&(W.onClick=re,W.onKeydown=oe,W.tabIndex==null&&(W.tabIndex=l(e.disabled)?-1:0),W.role==null&&(W.role="button"));const le=b.length?_.div({class:"cms-item-title"},...b):null,te=T.length?_.div({class:"cms-item-subtitle"},...T):null,M=S.length?_.div({class:"cms-item-meta"},...S):null,Z=D.length?_.div({class:ae(["cms-item-body",fe(!(b.length||T.length||S.length),"is-standalone")])},...D):null,q=Q.length?_.div({class:"cms-item-actions"},...Q):null,ue=_.li(W,_.div({class:"cms-item-row"},i.length?_.div({class:"cms-item-icon"},...i):null,_.div({class:"cms-item-main"},M,le,te,Z,q),ie.length?_.div({class:"cms-item-aside"},...ie):null));return Ke(ue,e),ue},he.Separator=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=ae(["cms-separator",fe(e.vertical,"vertical"),e.class]),s=JSswift.omit(e,["vertical","size","slots"]);s.class=n;const o={borderColor:"var(--cms-border)",...e.style||{}},r=l(e.size),y=l(e.vertical);if(r!=null){const u=Be(r);y?o.width=u:o.height=u}return s.style=o,_.hr(s)},he.Banner=(...t)=>{var ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.type)||l(e.state)||""),r={state:o,dismissible:()=>!!l(e.dismissible)},y=qe([e.type,e.state],()=>o()),u=qe(e.variant,()=>{const R=String(l(e.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(R)?`cms-banner-${R}`:""}),i=qe([e.actionsPlacement,e.stack],()=>String(l(e.actionsPlacement)||"").toLowerCase()==="bottom"||l(e.stack)?"cms-banner-actions-bottom":""),b=qe(e.stack,()=>l(e.stack)?"cms-banner-stack":""),T={...e},S=JSswift.omit(T,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);S.class=ae(["cms-clear-set","cms-banner","cms-singularity",y,u,i,b,T.class]),S.style={...T.style||{}};const w=R=>{if(R==null||R==="")return"";const g=l(R);if(g==null||g==="")return"";const d=String(g);return Qt(d)?`var(--cms-${d})`:d};(e.accent!=null||at(e.accent))&&(S.style["--cms-banner-accent"]=()=>w(e.accent),S.style["--cms-banner-border"]=()=>{const R=w(e.accent);return R?`color-mix(in srgb, ${R} 38%, var(--cms-border-color))`:""},S.style["--cms-banner-bg"]=()=>{const R=w(e.accent);return R?`color-mix(in srgb, ${R} 14%, var(--cms-panel))`:""},S.style["--cms-banner-color"]=()=>{const R=w(e.accent);return R?`color-mix(in srgb, ${R} 78%, white)`:""});const z={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},Q=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||e.size||"md"}):JSswift.ui.slot(e.icon,{as:"icon"});const R=o(),g=R?z[R]:null;return g?he.Icon({name:g,size:e.iconSize||e.size||"md"}):null})(),G=J(s,"title",r,e.title),ie=J(s,"message",r,e.message!=null?e.message:n),D=J(s,"description",r,(ue=e.description)!=null?ue:e.subtitle),$=J(s,"meta",r,e.meta),Y=J(s,"default",r,e.body!=null?[e.body,...n||[]]:e.message!=null?n:null),W=J(s,"icon",r,Q),se=J(s,"aside",r,e.aside),me=J(s,"actions",r,e.actions),re=J(s,"dismiss",r,e.dismiss),oe=String(l(e.actionsPlacement)||"").toLowerCase()==="bottom"||!!l(e.stack),le=!!l(e.dismissible)||!!e.onDismiss;let te=null;const M=le?he.Btn({class:"cms-banner-close",outline:!0,size:e.size||"sm","aria-label":e.closeLabel||"Chiudi banner",onClick:R=>{var g;(g=e.onDismiss)==null||g.call(e,R),!R.defaultPrevented&&(te==null||te.remove())}},he.Icon({name:"close",size:e.size||"sm"})):null,Z=[...se,...oe?[]:me,...re.length?re:M?[M]:[]];te=_.div(S,W.length?_.div({class:"cms-banner-icon"},...W):null,_.div({class:"cms-banner-body"},_.div({class:"cms-banner-copy"},G.length?_.div({class:"cms-banner-title"},...G):null,ie.length?_.div({class:"cms-banner-message"},...ie):null,D.length?_.div({class:"cms-banner-description"},...D):null,Y.length?_.div({class:"cms-banner-extra"},...Y):null,$.length?_.div({class:"cms-banner-meta"},...$):null),oe&&me.length?_.div({class:"cms-banner-actions"},...me):null),Z.length?_.div({class:"cms-banner-side"},...Z):null);const q=S.role||(()=>{const R=o();return R==="danger"||R==="warning"?"alert":"status"})();return te.setAttribute("role",q),Ke(te,e),te},he.Alert=(...t)=>{var W;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.type)||l(e.state)||l(e.color)||"warning"),r=qe([e.type,e.state,e.color],()=>{const se=o();return se?`cms-state-${se}`:""}),y={...e},u=JSswift.omit(y,["actions","aside","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","state","subtitle","title","type","variant"]);u.class=ae(["cms-clear-set","cms-alert","cms-singularity",r,fe(e.dismissible,"is-dismissible"),y.class]),u.style={...y.style||{}};const i={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},b=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"});const se=i[o()]||i.warning;return he.Icon({name:se,size:e.iconSize||"sm"})})(),T=J(s,"title",{},e.title),S=J(s,"message",{},e.message!=null?e.message:n),w=J(s,"description",{},(W=e.description)!=null?W:e.subtitle),z=J(s,"meta",{},e.meta),Q=J(s,"actions",{},e.actions),G=J(s,"aside",{},e.aside),ie=J(s,"icon",{},b),D=J(s,"dismiss",{},e.dismiss);let $=null;const Y=e.dismissible||e.onDismiss?he.Btn({class:"cms-alert-close",outline:!0,size:"sm","aria-label":e.closeLabel||"Chiudi alert",onClick:se=>{var me;(me=e.onDismiss)==null||me.call(e,se),!se.defaultPrevented&&($==null||$.remove())}},he.Icon({name:"close",size:"sm"})):null;return $=_.div(u,ie.length?_.div({class:"cms-alert-icon"},...ie):null,_.div({class:"cms-alert-body"},T.length?_.div({class:"cms-alert-title"},...T):null,S.length?_.div({class:"cms-alert-message"},...S):null,w.length?_.div({class:"cms-alert-description"},...w):null,z.length?_.div({class:"cms-alert-meta"},...z):null,Q.length?_.div({class:"cms-alert-actions"},...Q):null),G.length||D.length||Y?_.div({class:"cms-alert-side"},...G,...D.length?D:Y?[Y]:[]):null),$.setAttribute("role",o()==="danger"||o()==="warning"?"alert":"status"),Ke($,e),$},he.EmptyState=(...t)=>{var Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.state)||l(e.color)||""),r=qe([e.state,e.color],()=>{const W=o();return W?`cms-state-${W}`:""}),y={...e},u=JSswift.omit(y,["actions","description","eyebrow","icon","iconSize","illustration","media","message","meta","slots","state","title"]);u.class=ae(["cms-clear-set","cms-empty-state","cms-singularity",r,fe(e.compact,"compact"),fe(e.inline,"inline"),y.class]),u.style={...y.style||{}};const i=e.icon===!1?null:e.icon!=null?typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"xl"}):JSswift.ui.slot(e.icon,{as:"icon"}):he.Icon({name:"inbox",size:e.iconSize||"xl"}),b=J(s,"illustration",{},(Y=e.illustration)!=null?Y:e.media),T=J(s,"icon",{},i),S=J(s,"eyebrow",{},e.eyebrow),w=J(s,"title",{},e.title),z=J(s,"message",{},e.message!=null?e.message:n),Q=J(s,"description",{},e.description),G=J(s,"meta",{},e.meta),ie=J(s,"actions",{},e.actions),D=J(s,"default",{},e.message!=null?n:null),$=_.section(u,b.length?_.div({class:"cms-empty-state-illustration"},...b):null,T.length?_.div({class:"cms-empty-state-icon"},...T):null,S.length?_.div({class:"cms-empty-state-eyebrow"},...S):null,w.length?_.div({class:"cms-empty-state-title"},...w):null,z.length?_.div({class:"cms-empty-state-message"},...z):null,Q.length?_.div({class:"cms-empty-state-description"},...Q):null,G.length?_.div({class:"cms-empty-state-meta"},...G):null,D.length?_.div({class:"cms-empty-state-extra"},...D):null,ie.length?_.div({class:"cms-empty-state-actions"},...ie):null);return Ke($,e),$};let qt="jsswift:drawer-open";const il=new Set,hs=new Map,en=(t=qt)=>{const e=JSswift==null?void 0:JSswift.store;if(e!=null&&e.get){const n=e.get(t,void 0);if(typeof n=="boolean")return n}try{return localStorage.getItem(t)==="1"}catch(n){return!1}},Oo=(t,e=qt)=>{const n=JSswift==null?void 0:JSswift.store;if(n!=null&&n.set){n.set(e,!!t);return}try{localStorage.setItem(e,t?"1":"0")}catch(s){}};let Et=en();const Wt=(t,e=qt)=>{Et=!!t;const n=hs.get(e);if(n&&n.size)n.forEach(s=>s==null?void 0:s.classList.toggle("open",Et));else{const s=document.querySelector(".cms-drawer");s&&s.classList.toggle("open",Et)}return il.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(Et);return}const{el:o,openIcon:r,closeIcon:y}=s;o&&(o.textContent=Et?r:y)}),Oo(Et,e),Et};he.Tooltip=(...t)=>{var q,ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{};let o=null,r=null,y=null,u=null;const i=R=>Object.prototype.hasOwnProperty.call(e,R),b=i("target")||i("anchorEl")||i("triggerEl"),T=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),S=(R,g)=>{const d=l(R);if(d==null||d==="")return g;const m=Number(d);return Number.isFinite(m)?m:g},w=()=>{clearTimeout(r),clearTimeout(y),r=null,y=null},z=()=>S(e.delay,350),Q=()=>S(e.hideDelay,l(e.interactive)?120:0),G=()=>{if(w(),!o)return;const R=o;o=null,yn(R,()=>JSswift.overlay.close(R.id))},D=(R=>{if(R==null||R===!0)return new Set(["hover","focus"]);if(R===!1)return new Set(["manual"]);const g=Array.isArray(R)?R:String(R).split(/[\s,|/]+/),d=new Set;return g.forEach(m=>{const F=String(m||"").trim().toLowerCase();F&&(F==="mouseenter"||F==="mouseover"?d.add("hover"):F==="blur"||F==="focusin"?d.add("focus"):F==="tap"?d.add("click"):d.add(F))}),d.size?d:new Set(["manual"])})((ue=(q=e.trigger)!=null?q:e.triggers)!=null?ue:i("open")?"manual":null),$=D.has("hover"),Y=D.has("focus"),W=D.has("click"),se=D.has("manual")||!$&&!Y&&!W,me=()=>{var j,U,ce,L,f,k;const R={anchorEl:u||T||null,close:()=>G(),hide:()=>G(),isOpen:()=>!!o},g=e.icon?typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,d=J(s,"title",R,(j=e.title)!=null?j:e.heading),m=J(s,"icon",R,g),F=J(s,"footer",R,(U=e.footer)!=null?U:e.actions);let X=(k=(f=(L=(ce=e.content)!=null?ce:e.text)!=null?L:e.body)!=null?f:e.description)!=null?k:e.label;X==null&&(b?X=n:T&&n&&n.length>1?X=n.slice(1):T||(X=n));let a=J(s,"content",R,X);a.length||(a=J(s,"default",R,X));const C=a.length?_.div({class:"cms-tooltip-body"},...a):null,h=m.length||d.length?_.div({class:"cms-tooltip-head"},m.length?_.div({class:"cms-tooltip-icon"},...m):null,_.div({class:"cms-tooltip-head-main"},d.length?_.div({class:"cms-tooltip-title"},...d):null,C)):C,P=F.length?_.div({class:"cms-tooltip-footer"},...F):null;return _.div({class:"cms-tooltip-content"},...[h,P].filter(Boolean))},re=R=>{var a,C,h,P,j,U;const g=R||u;if(!g||l(e.disabled))return null;if(o&&o._anchorEl===g)return o;o&&G();const d=(a=e.closeOnOutside)!=null?a:W||l(e.interactive),m=(C=e.closeOnEsc)!=null?C:W||l(e.interactive);let F=null;if(o=JSswift.overlay.open(()=>me(),{type:"tooltip",anchorEl:g,placement:e.placement||"top",offsetX:(h=e.offsetX)!=null?h:0,offsetY:(j=(P=e.offsetY)!=null?P:e.offset)!=null?j:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:d,closeOnBackdrop:!1,closeOnEsc:m,autoFocus:!1,className:Dt(["cms-tooltip",fe(e.interactive,"interactive"),e.class,e.panelClass]),onClose:()=>{var ce,L;(ce=F==null?void 0:F._tooltipCleanup)==null||ce.call(F),o===F&&(o=null),(L=e.onClose)==null||L.call(e)}}),!(o!=null&&o.panel))return o;const X=o;if(F=X,X._anchorEl=g,X.panel.dataset.placement=String(l(e.placement||"top")),e.maxWidth!=null&&(X.panel.style.maxWidth=Be(l(e.maxWidth))),e.minWidth!=null&&(X.panel.style.minWidth=Be(l(e.minWidth))),e.width!=null&&(X.panel.style.width=Be(l(e.width))),e.style&&Object.assign(X.panel.style,e.style),Ke(X.panel,e),l(e.interactive)){const ce=()=>{clearTimeout(y),y=null},L=()=>le(),f=k=>{const A=k.target;A&&A.closest&&A.closest("[data-tooltip-close]")&&G()};X.panel.addEventListener("mouseenter",ce),X.panel.addEventListener("mouseleave",L),X.panel.addEventListener("focusin",ce),X.panel.addEventListener("focusout",L),X.panel.addEventListener("click",f),X._tooltipCleanup=()=>{var k,A,H,ge,Se;(k=X.panel)==null||k.removeEventListener("mouseenter",ce),(A=X.panel)==null||A.removeEventListener("mouseleave",L),(H=X.panel)==null||H.removeEventListener("focusin",ce),(ge=X.panel)==null||ge.removeEventListener("focusout",L),(Se=X.panel)==null||Se.removeEventListener("click",f)}}return bn(X),(U=e.onOpen)==null||U.call(e,X),X},oe=R=>{clearTimeout(y),y=null,clearTimeout(r),r=setTimeout(()=>re(R),z())},le=(R=!1)=>{if(clearTimeout(r),r=null,!!o){if(clearTimeout(y),R){G();return}y=setTimeout(()=>G(),Q())}},te=R=>{o?le(!0):re(R)},M=()=>!!o,Z=R=>{if(!R)return()=>{};u=R;const g=[],d=()=>{w(),g.forEach(m=>m())};if(i("open"))return at(e.open)?JSswift.reactive.effect(()=>{u&&(l(e.open)?re(u):le(!0))},"UI.Tooltip:open"):e.open===!0?re(R):e.open===!1&&le(!0),d;if(se||l(e.disabled))return d;if($){const m=()=>oe(R),F=()=>le();R.addEventListener("mouseenter",m),R.addEventListener("mouseleave",F),g.push(()=>{R.removeEventListener("mouseenter",m),R.removeEventListener("mouseleave",F)})}if(Y){const m=()=>oe(R),F=()=>le();R.addEventListener("focus",m),R.addEventListener("blur",F),g.push(()=>{R.removeEventListener("focus",m),R.removeEventListener("blur",F)})}if(W){const m=F=>{var X;(X=e.onTriggerClick)==null||X.call(e,F),!F.defaultPrevented&&te(R)};R.addEventListener("click",m),g.push(()=>R.removeEventListener("click",m))}return d};if(T){const R=ae(["cms-tooltip-wrap",e.wrapClass,e.targetClass]),g=JSswift.omit(e,["actions","anchorEl","body","closeOnEsc","closeOnOutside","content","delay","description","disabled","footer","heading","hideDelay","icon","iconSize","interactive","label","maxWidth","minWidth","offset","offsetX","offsetY","onClose","onOpen","onTriggerClick","open","panelClass","placement","slots","style","target","targetClass","targetStyle","text","title","trigger","triggerEl","triggers","width","wrapClass","wrapStyle"]);g.class=R,g.style={display:"inline-flex",alignItems:"center",...e.wrapStyle||e.targetStyle||{}};const d=JSswift.ui.renderSlot(s,"target",{open:()=>re(u),show:()=>oe(u),hide:()=>le(!0),toggle:()=>te(u),isOpen:M},T),m=_.span(g,...J(null,"default",{},d));return Z(m),m._tooltip={bind:Z,open:re,show:oe,hide:le,close:G,toggle:te,isOpen:M},m}return{bind:Z,open:re,show:oe,hide:le,close:G,toggle:te,isOpen:M}};const ps=(t,e,n={})=>{var R;const{props:s,children:o}=JSswift.uiNormalizeArgs(e),r=s.slots||{},y=t==="radio",u=n.appearance==="toggle",i=!y,b=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),T=Nt(s.model,n.modelName||(y?"UI.Radio:model":"UI.Checkbox:model")),S=JSswift.omit(s,["model","label","checked","class","style","dense","onChange","onInput","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","inputClass","iconSize","color","size","outline","behavior","mode","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);S.type=t,S.id=b,y&&s.name!=null&&(S.name=s.name),S.class=ae([`cms-${t}`,"cms-choice-input",s.inputClass]);const w=_.input(S),z=J(r,"label",{},s.label),Q=z.length?z:J(r,"default",{},o),G=fs(s,{className:"cms-shortcode cms-choice-shortcode"}),ie=G?[...Q,G]:Q,D=JSswift.omit(s,["model","label","checked","onChange","onInput","value","name","id","type","dense","inputClass","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","iconSize","color","size","behavior","mode","outline","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);D.class=ae(["cms-clear-set","cms-singularity-check","cms-choice-wrap",`cms-${t}-wrap`,fe(u,"cms-toggle-wrap"),fe(u&&y,"cms-toggle-radio-wrap"),fe(u&&!y,"cms-toggle-checkbox-wrap"),fe(s.dense,"dense"),s.class]),D.style={...s.style||{}};const $=l(s.size);$!=null&&!(typeof $=="string"&&((R=JSswift.uiSizes)!=null&&R.includes($)))&&(D.style["--cms-choice-size"]=Be($));const Y=_.span({class:ae(["cms-choice-mark",y?"cms-choice-radio-mark":"cms-choice-checkbox-mark",fe(u,"cms-toggle-mark")])}),W=u?_.span({class:"cms-toggle-thumb"}):Y;u&&Y.appendChild(W);const se=ie.length?_.span({class:"cms-choice-label"},...ie):null,me=_.label(D,w,Y,se);Ke(me,s);const re=s.iconSize?s.iconSize:s.size,oe=u?null:y?"radio_button_checked":"check",le=u?null:y?"radio_button_unchecked":null,te=u||y?null:"indeterminate_check_box",M=g=>{if(y)return w.checked=g==s.value,w.checked;const d=g==null?null:!!g;return w.checked=d===!0,w.indeterminate=i&&d==null,d},Z=()=>!y&&i&&w.indeterminate?null:!!w.checked,q=g=>g===!0?s.checkedIcon!=null?s.checkedIcon:s.icon!=null?s.icon:oe:g===!1?s.uncheckedIcon!=null?s.uncheckedIcon:le:s.indeterminateIcon!=null?s.indeterminateIcon:s.standbyIcon!=null?s.standbyIcon:s.iconStandby!=null?s.iconStandby:te,ue=()=>{const g=Z(),d=g===!0;for(;W.firstChild;)W.removeChild(W.firstChild);me.classList.toggle("is-checked",d),me.classList.toggle("is-indeterminate",g==null),me.classList.toggle("is-disabled",!!w.disabled),d&&(s.checkedIcon||s.icon)?me.classList.toggle("toggle-default",!1):d&&!s.checkedIcon||g==null&&!s.standbyIcon?me.classList.toggle("toggle-default",!0):g==null&&s.standbyIcon?me.classList.toggle("toggle-default",!1):w.disabled===!1&&!s.uncheckedIcon?me.classList.toggle("toggle-default",!0):me.classList.toggle("toggle-default",!1),u&&(g==null?W.style.transform="translateX(calc((var(--cms-toggle-width) - var(--cms-toggle-thumb-size) - 1px) / 2))":W.style.removeProperty("transform"));const m={checked:d,state:g,indeterminate:g==null,value:s.value,id:b,type:t};let F=null;if(g===!0?(F=JSswift.ui.renderSlot(r,"checkedIcon",m,null),F==null&&(F=JSswift.ui.renderSlot(r,"iconOn",m,null))):g===!1?(F=JSswift.ui.renderSlot(r,"uncheckedIcon",m,null),F==null&&(F=JSswift.ui.renderSlot(r,"iconOff",m,null))):(F=JSswift.ui.renderSlot(r,"indeterminateIcon",m,null),F==null&&(F=JSswift.ui.renderSlot(r,"standbyIcon",m,null)),F==null&&(F=JSswift.ui.renderSlot(r,"iconStandby",m,null))),F==null&&(F=JSswift.ui.renderSlot(r,"icon",m,null)),F==null){const X=q(g);typeof X=="string"?F=he.Icon({name:X,size:re,...u?{textColor:s.color,outline:!0}:{}}):X!=null&&(F=JSswift.ui.slot(X,{checked:d,state:g,indeterminate:g==null,as:g===!0?"checkedIcon":g===!1?"uncheckedIcon":"indeterminateIcon"}))}J(null,"default",{},F).forEach(X=>W.appendChild(X))};return T?(M(T.get()),T.watch(g=>{M(g),ue()},y?"UI.Radio:watch":"UI.Checkbox:watch"),w.addEventListener("change",g=>{var d,m;if(y)w.checked&&(T.set(s.value),(d=s.onChange)==null||d.call(s,s.value,g));else{const F=Z();T.set(F),(m=s.onChange)==null||m.call(s,F,g)}ue()})):(M(y?s.checked===!0?s.value:void 0:s.checked),w.addEventListener("change",g=>{var d,m;y?(d=s.onChange)==null||d.call(s,s.value,g):(m=s.onChange)==null||m.call(s,Z(),g),ue()})),s.onInput&&w.addEventListener("input",g=>{var d,m;y?(d=s.onInput)==null||d.call(s,s.value,g):(m=s.onInput)==null||m.call(s,Z(),g)}),ue(),an(me,s,{isEnabled:()=>!w.disabled,action:()=>{if(w.disabled)return!1;hn(w),w.click()}}),me};he.Checkbox=(...t)=>ps("checkbox",t),he.Radio=(...t)=>ps("radio",t),he.Toggle=(...t)=>{var s,o,r;const{props:e}=JSswift.uiNormalizeArgs(t),n=String((r=(o=(s=e.behavior)!=null?s:e.mode)!=null?o:e.type)!=null?r:"checkbox").toLowerCase()==="radio"?"radio":"checkbox";return ps(n,t,{appearance:"toggle",modelName:"UI.Toggle:model"})},he.Slider=(...t)=>{var H,ge,Se,ye,V;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=e.model||(Lt(e.value)||Jt(e.value)?e.value:null),r=Nt(o,"UI.Slider:model"),y=JSswift.omit(e,["model","value","class","style","onChange","onInput","slots","label","icon","iconRight","thumbIcon","iconThumb","pointIcon","markers","markerLabels","labelMarks","leftLabel","rightLabel","startLabel","endLabel","minLabel","maxLabel","withQItem","qitem","item","itemClass","itemStyle","showValue","thumbLabel","labelValue","selectionColor","trackColor","thumbColor","inputClass","readonly","size"]);y.type="range",y.class=ae(["cms-slider-input",e.inputClass]);const u=_.input(y),i={...e.style||{}},b=l(e.size);if(b!=null){const O=typeof b=="string"&&((H=JSswift.uiSizes)!=null&&H.includes(b))?`var(--cms-size-${b})`:Be(b);i["--cms-slider-size"]=O,i["--cms-slider-track-size"]=`max(4px, calc(${O} / 4))`,i["--cms-slider-box-height"]=`calc(${O} * 1.5)`,i["--cms-slider-marker-size"]=`max(6px, calc(${O} / 3))`}const T=_.label({class:ae(["cms-clear-set","cms-singularity-check","cms-slider-wrap",fe(e.dense,"dense"),e.class]),style:i});Ke(T,e);const S=_.div({class:"cms-slider-header"}),w=_.span({class:"cms-slider-label"}),z=_.span({class:"cms-slider-value"});S.append(w,z);const Q=_.div({class:"cms-slider-body"}),G=_.span({class:"cms-slider-icon cms-slider-icon-left"}),ie=_.span({class:"cms-slider-edge-label cms-slider-edge-label-left"}),D=_.div({class:"cms-slider-main"}),$=_.div({class:"cms-slider-box",style:{minHeight:"var(--cms-slider-box-height, 36px)"}}),Y=_.span({class:"cms-slider-rail",style:{height:"var(--cms-slider-track-size, 6px)"}}),W=_.span({class:"cms-slider-selection",style:{height:"var(--cms-slider-track-size, 6px)"}}),se=_.span({class:"cms-slider-thumb",style:{width:"var(--cms-slider-size, 24px)",height:"var(--cms-slider-size, 24px)"}}),me=_.span({class:"cms-slider-thumb-icon"}),re=_.span({class:"cms-slider-thumb-label"});se.append(re,me);const oe=_.div({class:"cms-slider-markers"}),le=_.span({class:"cms-slider-edge-label cms-slider-edge-label-right"}),te=_.span({class:"cms-slider-icon cms-slider-icon-right"});$.append(Y,W,se,u),D.append($,oe),Q.append(G,ie,D,le,te),T.append(S,Q);const M=O=>{for(;O.firstChild;)O.removeChild(O.firstChild)},Z=(O,K,ke="")=>{M(O),(K||[]).forEach(Ne=>O.appendChild(Ne)),O.style.display=O.childNodes.length?ke:"none"},q=O=>Lt(O)||Jt(O)?l(O):O,ue=(O,K={})=>Ln(q(O),K),R=(O,K,ke={})=>{var ee,xe;const Ne=q(O);return Ne==null?[]:typeof Ne=="string"?[he.Icon({name:Ne,size:(xe=(ee=e.iconSize)!=null?ee:e.size)!=null?xe:16})]:ue(Ne,{...ke,as:K})},g=(O,K)=>{const ke=Number(O);return Number.isFinite(ke)?ke:K},d=()=>g(l(e.min),0),m=()=>{const O=d(),K=g(l(e.max),100);return K<O?O:K},F=()=>{const O=l(e.step);if(O==="any")return"any";const K=g(O,1);return K>0?K:1},X=O=>{if(O==="any")return 0;const K=String(O);if(K.includes("e-"))return Number(K.split("e-")[1]||0);const ke=K.indexOf(".");return ke===-1?0:K.length-ke-1},a=O=>{const K=d(),ke=m(),Ne=F();let ee=g(O,K);if(Ne!=="any"){ee=K+Math.round((ee-K)/Ne)*Ne;const xe=X(Ne);xe>0&&(ee=Number(ee.toFixed(xe)))}return Math.min(ke,Math.max(K,ee))},C=O=>{const K=d(),Ne=m()-K;if(!Ne)return 0;const ee=(a(O)-K)/Ne,xe=l(e.reverse)?1-ee:ee;return Math.max(0,Math.min(1,xe))},[h,P]=JSswift.reactive.signal(a(r?r.get():(Se=(ge=l(e.value))!=null?ge:l(e.min))!=null?Se:0)),j=(O,K={})=>{const ke=a(O);return h()!==ke&&P(ke),String(u.value)!==String(ke)&&(u.value=String(ke)),r&&K.fromModel!==!0&&r.set(ke),ke},U=()=>{var xe;const O=l(e.markers),K=!!l((xe=e.markerLabels)!=null?xe:e.labelMarks);if(!O)return[];const ke=d(),Ne=m(),ee=(be,Ce)=>{var Ie,_e,I,we,E,x,v,c;if(be==null)return null;if(typeof be=="object"&&!Array.isArray(be)){const N=a((I=(_e=(Ie=be.value)!=null?Ie:be.position)!=null?_e:be.at)!=null?I:ke);return{key:(we=be.key)!=null?we:`marker-${Ce}-${N}`,value:N,label:(E=be.label)!=null?E:K?String(N):null,icon:(x=be.icon)!=null?x:null,className:(c=(v=be.class)!=null?v:be.className)!=null?c:""}}const pe=a(be);return{key:`marker-${Ce}-${pe}`,value:pe,label:K?String(be):null,icon:null,className:""}};if(Array.isArray(O))return O.map((be,Ce)=>ee(be,Ce)).filter(Boolean);if(typeof O=="number"&&O>1){const be=Math.floor(O),Ce=be>1?(Ne-ke)/(be-1):0;return Array.from({length:be},(pe,Ie)=>ee(ke+Ce*Ie,Ie)).filter(Boolean)}if(O===!0){const be=F();if(be==="any")return[ee(ke,0),ee(Ne,1)].filter(Boolean);const Ce=Math.floor((Ne-ke)/be)+1;return Ce>24?[ee(ke,0),ee((ke+Ne)/2,1),ee(Ne,2)].filter(Boolean):Array.from({length:Ce},(pe,Ie)=>ee(ke+be*Ie,Ie)).filter(Boolean)}return typeof O=="object"?Object.keys(O).map((be,Ce)=>ee({value:Number(be),label:O[be]},Ce)).filter(Boolean):[]},ce=()=>{M(oe);const O=U();oe.style.display=O.length?"block":"none",oe.style.minHeight=O.some(K=>K.label!=null&&K.label!=="")?"30px":"10px",O.forEach(K=>{const ke=C(K.value),Ne=l(e.reverse)?h()<=K.value:h()>=K.value,ee=_.button({type:"button",class:ae(["cms-slider-marker",K.className,fe(()=>Ne,"active")]),style:{left:`${ke*100}%`,color:Ne?l(e.color)||"var(--cms-primary)":"var(--cms-muted)",cursor:l(e.disabled)||l(e.readonly)?"default":"pointer"},disabled:!!l(e.disabled)||!!l(e.readonly),onClick:()=>{var I,we;if(l(e.disabled)||l(e.readonly))return;const _e=j(K.value);(I=e.onInput)==null||I.call(e,_e),(we=e.onChange)==null||we.call(e,_e)}}),xe={marker:K,active:Ne,value:K.value,current:h(),input:u};let be=JSswift.ui.renderSlot(s,"marker",xe,null);be==null&&K.icon!=null&&(be=typeof K.icon=="string"?he.Icon({name:K.icon,size:12}):JSswift.ui.slot(K.icon,{...xe,as:"marker"}));const Ce=_.span({class:"cms-slider-marker-tick",style:{width:"var(--cms-slider-marker-size, 8px)",height:"var(--cms-slider-marker-size, 8px)",background:Ne?l(e.color)||"var(--cms-primary)":"var(--cms-border-color)"}}),pe=be==null?[Ce]:J(null,"default",xe,be),Ie=K.label==null?J(s,"markerLabel",xe,null):J(s,"markerLabel",xe,K.label);pe.forEach(_e=>ee.appendChild(_e)),Ie.length&&ee.appendChild(_.span({class:"cms-slider-marker-label"},...Ie)),oe.appendChild(ee)})},L=()=>{var xe;const O={value:h(),input:u,props:e};let K=J(s,"label",O,q(e.label));K.length||(K=J(s,"default",O,n)),Z(w,K,"inline-flex");const ke=l(e.showValue),Ne=ke===!1?null:(xe=q(e.labelValue))!=null?xe:h(),ee=ke||q(e.labelValue)!=null?J(s,"value",O,Ne):[];Z(z,ee,"inline-flex"),S.style.display=w.childNodes.length||z.childNodes.length?"flex":"none"},f=()=>{var Ce,pe,Ie,_e;const O={value:h(),input:u,props:e},K=J(s,"icon",O,null),ke=K.length?K:R(e.icon,"icon",O);Z(G,ke,"inline-flex");const Ne=J(s,"iconRight",O,null),ee=Ne.length?Ne:R(e.iconRight,"iconRight",O);Z(te,ee,"inline-flex");const xe=q((pe=(Ce=e.startLabel)!=null?Ce:e.leftLabel)!=null?pe:e.minLabel),be=q((_e=(Ie=e.endLabel)!=null?Ie:e.rightLabel)!=null?_e:e.maxLabel);Z(ie,J(s,"startLabel",O,xe),"inline-flex"),Z(le,J(s,"endLabel",O,be),"inline-flex")},k=()=>{var xe,be,Ce,pe;const O={value:h(),input:u,props:e},K=J(s,"thumbIcon",O,null),ke=(be=(xe=e.thumbIcon)!=null?xe:e.iconThumb)!=null?be:e.pointIcon;Z(me,K.length?K:R(ke,"thumbIcon",O),"inline-flex");const Ne=(pe=(Ce=q(e.thumbLabel))!=null?Ce:q(e.labelValue))!=null?pe:l(e.showValue)?String(h()):null,ee=J(s,"thumbLabel",O,Ne);Z(re,ee,"inline-flex")},A=()=>{const O=a(h()),K=d(),ke=m(),Ne=F(),xe=`${C(O)*100}%`,be=l(e.color)||l(e.selectionColor)||"var(--cms-primary)",Ce=l(e.trackColor)||"var(--cms-border-color)",pe=l(e.thumbColor)||be,Ie=!!l(e.readonly),_e=!!l(e.disabled);u.min=String(K),u.max=String(ke),u.step=Ne==="any"?"any":String(Ne),u.disabled=_e,u.value=String(O),Y.style.background=Ce,W.style.background=be,W.style.width=xe,se.style.left=xe,se.style.borderColor=pe,se.style.color=pe,re.style.background=be,T.classList.toggle("is-disabled",_e),T.classList.toggle("is-readonly",Ie),T.classList.toggle("has-markers",oe.childNodes.length>0)};if(r?(j(r.get(),{fromModel:!0}),r.watch(O=>{j(O,{fromModel:!0})},"UI.Slider:watch")):at(e.value)?JSswift.reactive.effect(()=>{j(l(e.value),{fromModel:!0})},"UI.Slider:value"):j((V=(ye=e.value)!=null?ye:e.min)!=null?V:0,{fromModel:!0}),u.addEventListener("input",O=>{var ke;if(l(e.disabled)||l(e.readonly)){u.value=String(h());return}const K=j(u.value);(ke=e.onInput)==null||ke.call(e,K,O)}),u.addEventListener("change",O=>{var ke;if(l(e.disabled)||l(e.readonly)){u.value=String(h());return}const K=j(u.value);(ke=e.onChange)==null||ke.call(e,K,O)}),JSswift.reactive.effect(()=>{L(),f(),k(),ce(),A()},"UI.Slider:render"),T._input=u,T._getValue=h,T._setValue=O=>j(O),e.withQItem||e.qitem||e.item===!0){const O=he.Item({class:ae(["cms-slider-item",e.itemClass]),style:e.itemStyle},T);return O._input=u,O._slider=T,O._getValue=h,O._setValue=T._setValue,O}return T},he.Rating=(...t)=>{var h;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=e.model||(Lt(e.value)||Jt(e.value)?e.value:null),r=Nt(o,"UI.Rating:model"),y=e.id||"cms-rating-"+Math.random().toString(36).slice(2),u=JSswift.omit(e,["model","value","max","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);u.type="hidden",u.id=y,e.name!=null&&(u.name=e.name),u.class=ae(["cms-rating-input","cms-choice-input",e.inputClass]);const i=_.input(u),b=JSswift.omit(e,["model","value","max","id","name","type","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);b.class=ae(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",fe(e.dense,"dense"),e.class]),b.style={...e.style||{}};const T=l(e.size);T!=null&&!(typeof T=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(T)))&&(b.style["--cms-rating-size"]=Be(T));const S=l(e.gap);S!=null&&(b.style["--cms-rating-gap"]=Be(S));const w=_.span({class:"cms-rating-control",onMouseleave:P=>{var j;q!=null&&(q=null,a(),(j=e.onHover)==null||j.call(e,te(),P))},onKeydown:P=>{if(!le())return;const j=se()?.5:1,U=te();let ce=U;switch(P.key){case"ArrowRight":case"ArrowUp":ce=U+j;break;case"ArrowLeft":case"ArrowDown":ce=U-j;break;case"Home":ce=l(e.clearable)?0:j;break;case"End":ce=W();break;case"Delete":case"Backspace":case"0":if(!l(e.clearable))return;ce=0;break;case" ":case"Enter":ce=U||(l(e.clearable)?j:Math.max(j,1));break;default:return}P.preventDefault(),C(ce,P,{emit:!0})}}),z=_.span({class:"cms-choice-label cms-rating-label"}),Q=_.label(b,i,w,z);Ke(Q,e);const G=P=>{for(;P.firstChild;)P.removeChild(P.firstChild)},ie=(P,j,U="")=>{G(P),(j||[]).forEach(ce=>P.appendChild(ce)),P.style.display=P.childNodes.length?U:"none"},D=P=>Lt(P)||Jt(P)?l(P):P,$=(P,j={})=>Ln(D(P),j),Y=(P,j,U={})=>{var L,f;const ce=D(P);return ce==null?[]:typeof ce=="string"?[he.Icon({name:ce,color:e.color,size:(f=(L=e.iconSize)!=null?L:e.size)!=null?f:16})]:$(ce,{...U,as:j})},W=()=>{var j;const P=Number((j=l(e.max))!=null?j:5);return Number.isFinite(P)&&P>0?Math.max(1,Math.round(P)):5},se=()=>{var P;return!!l((P=e.half)!=null?P:e.allowHalf)},me=(P,j=W())=>{let U=Number(l(P));Number.isFinite(U)||(U=0),U=Math.min(j,Math.max(0,U));const ce=se()?.5:1;return Math.round(U/ce)*ce},re=()=>!!l(e.disabled),oe=()=>!!l(e.readonly),le=()=>!re()&&!oe(),te=()=>me(r?r.get():Z),M=P=>{const j=P>0?String(P):"";i.value=j,i.setAttribute("value",j),i.disabled=re()};let Z=me(r?r.get():l(e.value)),q=null,ue=0,R=[];const g=(P,j)=>{if(!se())return me(P);const U=j.currentTarget.getBoundingClientRect(),ce=j.clientX-U.left<=U.width/2;return me(ce?P-.5:P)},d=(P,j)=>P>=j?"full":se()&&P>=j-.5?"half":"empty",m=(P,j)=>{var k,A,H,ge,Se,ye,V,O,K,ke,Ne,ee,xe,be,Ce;const U=l((H=(A=(k=e.colorSelected)!=null?k:e.activeColor)!=null?A:e.color)!=null?H:e.textColor)||"var(--cms-warning, #f0b429)",ce=l((O=(V=(ye=(Se=(ge=e.colorHalf)!=null?ge:e.halfColor)!=null?Se:e.colorSelected)!=null?ye:e.activeColor)!=null?V:e.color)!=null?O:e.textColor)||U,L=l((xe=(ee=(Ne=(ke=(K=e.colorHovered)!=null?K:e.hoverColor)!=null?ke:e.colorSelected)!=null?Ne:e.activeColor)!=null?ee:e.color)!=null?xe:e.textColor)||U,f=l((Ce=(be=e.colorInactive)!=null?be:e.colorOff)!=null?Ce:e.color)||"var(--cms-muted)";return j?L:P==="full"?U:P==="half"?ce:f},F=P=>{var L,f,k,A,H,ge,Se,ye,V,O,K,ke,Ne,ee,xe;const j=[];P.hovered&&P.state!=="empty"&&j.push("hoveredIcon","iconHovered"),P.state==="full"?j.push("checkedIcon","selectedIcon","iconSelected","iconOn"):P.state==="half"?j.push("halfIcon","iconHalf"):j.push("uncheckedIcon","iconOff"),j.push("icon","item","star");for(const be of j){const Ce=J(s,be,P,null);if(Ce.length)return Ce}let U=null,ce="icon";return P.hovered&&P.state!=="empty"&&(U=(L=e.hoveredIcon)!=null?L:e.iconHovered,ce="hoveredIcon"),U==null&&P.state==="full"?(U=(H=(A=(k=(f=e.checkedIcon)!=null?f:e.iconSelected)!=null?k:e.iconOn)!=null?A:e.icon)!=null?H:"star",ce="checkedIcon"):U==null&&P.state==="half"?(U=(O=(V=(ye=(Se=(ge=e.halfIcon)!=null?ge:e.iconHalf)!=null?Se:e.checkedIcon)!=null?ye:e.iconSelected)!=null?V:e.icon)!=null?O:"star_half",ce="halfIcon"):U==null&&(U=(xe=(K=e.uncheckedIcon)!=null?K:e.iconOff)!=null?xe:l(e.noDimming)?(ee=(Ne=(ke=e.icon)!=null?ke:e.checkedIcon)!=null?Ne:e.iconSelected)!=null?ee:"star":"star_border",ce="uncheckedIcon"),Y(U,ce,P)},X=()=>{const P=W();if(ue!==P){ue=P,R=[],G(w);for(let j=1;j<=P;j++){const U=_.span({class:"cms-rating-item-icon"}),ce=_.span({class:"cms-rating-item",role:"radio",tabIndex:-1,onMousemove:L=>{var k;if(!le())return;const f=g(j,L);q!==f&&(q=f,a(),(k=e.onHover)==null||k.call(e,f,L))},onClick:L=>{if(!le())return;let f=g(j,L);l(e.clearable)&&f===te()&&(f=0),C(f,L,{emit:!0})}},U);R.push({item:ce,iconHost:U,index:j}),w.appendChild(ce)}}},a=()=>{var ge,Se;X();const P=W(),j=te(),U=q==null?j:me(q,P),ce=re(),L=oe(),f=!!l(e.clearable),k=!!l(e.noDimming);Q.classList.toggle("is-disabled",ce),Q.classList.toggle("is-readonly",L),Q.classList.toggle("is-hovering",q!=null),Q.classList.toggle("is-clearable",f),Q.classList.toggle("is-half",se()),Q.classList.toggle("no-dimming",k);const A=Number((Se=l((ge=e.tabindex)!=null?ge:e.tabIndex))!=null?Se:0);w.tabIndex=ce?-1:A,w.setAttribute("role","slider"),w.setAttribute("aria-valuemin","0"),w.setAttribute("aria-valuemax",String(P)),w.setAttribute("aria-valuenow",String(j)),w.setAttribute("aria-disabled",ce?"true":"false"),w.setAttribute("aria-readonly",L?"true":"false"),M(j);const H=J(s,"label",{value:j,max:P,disabled:ce,readonly:L,clearable:f},e.label!=null?D(e.label):n);ie(z,H,"inline-flex"),R.forEach(({item:ye,iconHost:V,index:O})=>{const K=d(U,O),ke=q!=null&&K!=="empty",Ne={index:O,max:P,value:j,displayValue:U,state:K,active:K!=="empty",checked:K==="full",half:K==="half",hovered:ke,disabled:ce,readonly:L,clearable:f,setValue:ee=>C(ee,null,{emit:!1})};ye.className=Dt(["cms-rating-item",`is-${K}`,fe(ke,"is-hovered")]),ye.style.color=m(K,ke),ye.style.opacity=K==="empty"&&!k?"0.48":"1",ye.setAttribute("aria-checked",String(j===O)),ie(V,F(Ne),"inline-flex")})},C=(P,j,U={})=>{var f,k;const ce=me(P),L=te();return Z=ce,q=null,r&&U.fromModel!==!0&&r.set(ce),M(ce),a(),U.emit!==!1&&ce!==L&&((f=e.onInput)==null||f.call(e,ce,j),(k=e.onChange)==null||k.call(e,ce,j)),ce};return Q._input=i,Q._rating=w,Q._getValue=te,Q._setValue=P=>C(P,null,{emit:!1}),r&&r.watch(P=>{const j=me(P);serializeValue(j)!==serializeValue(Z)&&(Z=j,q=null,M(Z),a())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!r&&e.value!=null&&(Z=me(l(e.value))),a()},"UI.Rating:render"),Q};const it=t=>t?{hour:Number(t.hour)||0,minute:Number(t.minute)||0,second:Number(t.second)||0}:null,Ut=t=>String(Math.max(0,Number(t)||0)).padStart(2,"0"),$t=(t,e={})=>{var u,i,b,T,S,w,z,Q,G,ie,D,$,Y,W,se;if(t==null||t==="")return null;let n=null,s=null,o=0,r=null;if(t instanceof Date&&!Number.isNaN(t.getTime()))n=t.getHours(),s=t.getMinutes(),o=t.getSeconds();else if(typeof t=="number"&&Number.isFinite(t)){const me=Math.max(0,Math.floor(t));n=Math.floor(me/3600)%24,s=Math.floor(me/60)%60,o=me%60}else if(typeof t=="object"){if(t.time!=null||t.value!=null)return $t((u=t.time)!=null?u:t.value,e);n=Number((T=(b=(i=t.hour)!=null?i:t.hours)!=null?b:t.h)!=null?T:t.hh),s=Number((Q=(z=(w=(S=t.minute)!=null?S:t.minutes)!=null?w:t.min)!=null?z:t.mm)!=null?Q:0),o=Number(($=(D=(ie=(G=t.second)!=null?G:t.seconds)!=null?ie:t.sec)!=null?D:t.ss)!=null?$:0),r=(se=(W=(Y=t.meridiem)!=null?Y:t.ampm)!=null?W:t.period)!=null?se:null}else if(typeof t=="string"){const me=t.trim();if(!me)return null;const re=me.match(/^(\d{1,2})(\d{2})(\d{2})?$/),oe=me.match(/(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?\s*([ap]m)?/i);if(oe)n=Number(oe[1]),s=Number(oe[2]),o=oe[3]!=null?Number(oe[3]):0,r=oe[4]||null;else if(re)n=Number(re[1]),s=Number(re[2]),o=re[3]!=null?Number(re[3]):0;else return null}else return null;if(!Number.isFinite(n)||!Number.isFinite(s)||!Number.isFinite(o))return null;if(r){const me=String(r).toLowerCase();me==="pm"&&n<12&&(n+=12),me==="am"&&n===12&&(n=0)}if(n<0||n>23||s<0||s>59||o<0||o>59)return null;const y={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(o)};return al(y,e)},Xt=(t,e={})=>{const n=t&&typeof t=="object"&&t.hour!=null?it(t):$t(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;return`${Ut(n.hour)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""}`},Hn=(t,e)=>{const n=Xt(t,{withSeconds:!0}),s=Xt(e,{withSeconds:!0});return!n&&!s?0:n?s?n<s?-1:n>s?1:0:1:-1};function al(t,e={}){if(!t)return null;const n=it(t),s=e.min!=null?$t(e.min,{withSeconds:!0}):null,o=e.max!=null?$t(e.max,{withSeconds:!0}):null;return s&&Hn(n,s)<0?it(s):o&&Hn(n,o)>0?it(o):n}const Tt=(t,e={})=>t==null||t===""?null:t instanceof Date?$t(t,e):typeof t=="object"?$t(t.time!=null?t.time:t,e):typeof t=="string"||typeof t=="number"?$t(t,e):null,jn=(t,e={})=>{var u;const n=$t(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;if(!!!l((u=e.use12h)!=null?u:e.ampm))return`${Ut(n.hour)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""}`;const r=n.hour>=12?"PM":"AM",y=n.hour%12||12;return`${Ut(y)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""} ${r}`},Do=(t,e,n={})=>{if(!t)return"";const s=Xt(e,n);return s?`${t}T${s}`:t},bs=(t,e)=>{const n=Math.max(1,Math.min(e+1,Math.round(Number(t)||1))),s=[];for(let o=0;o<=e;o+=n)s.push(o);return s},rl=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:o=!1,minuteStep:r=5,secondStep:y=5,disabled:u=!1,readonly:i=!1,embedded:b=!1,className:T="",slotPrefix:S="",shortcuts:w=null,onSelect:z=null}=t,Q=$t(s,{withSeconds:o,min:e.min,max:e.max}),G=Q||$t(new Date,{withSeconds:o,min:e.min,max:e.max})||{hour:0,minute:0,second:0},ie=Q?it(Q):null,D=le=>S?`${S}${le[0].toUpperCase()}${le.slice(1)}`:null,$=(le,te,M)=>{const Z=[D(le),le].filter(Boolean);for(const q of Z){if(JSswift.ui.getSlot(n,q)==null)continue;const R=JSswift.ui.renderSlot(n,q,te,M);if(R!=null)return R}return JSswift.ui.slot(M,te)},Y=le=>{let te=$("point",le,null);return te==null&&t.pointIcon!=null&&le.selected&&(te=typeof t.pointIcon=="string"?he.Icon({name:t.pointIcon,size:b?10:12}):JSswift.ui.slot(t.pointIcon,le)),J(null,"default",le,te)},W=(le,te)=>{const M={hour:G.hour,minute:G.minute,second:o?G.second:0};return M[le]=te,M},se=_.div({class:ae(["cms-time-section",fe(b,"is-embedded"),fe(o,"has-seconds"),T])}),me=l(w)||[];if(Array.isArray(me)&&me.length){const le=_.div({class:"cms-time-shortcuts"});me.forEach((te,M)=>{var g,d,m;if(!te)return;const Z=typeof te.value=="function"?te.value({now:Xt(new Date,{withSeconds:o})}):te.value,q=$t(Z,{withSeconds:o,min:e.min,max:e.max});if(!q)return;const ue={item:te,index:M,value:Xt(q,{withSeconds:o}),displayValue:jn(q,{withSeconds:o,use12h:(g=e.use12h)!=null?g:e.ampm})},R=$("shortcut",ue,(m=(d=te.label)!=null?d:te.text)!=null?m:ue.displayValue);le.appendChild(_.button({type:"button",class:ae(["cms-time-shortcut",fe(!!ie&&Hn(q,ie)===0,"is-selected")]),disabled:u||i,onClick:()=>z==null?void 0:z(q,{shortcut:te,index:M})},...J(null,"default",ue,R)))}),le.childNodes.length&&se.appendChild(le)}const re=_.div({class:"cms-time-columns"}),oe=(le,te,M)=>{const Z=_.div({class:"cms-time-column","data-time-part":te}),q=_.div({class:"cms-time-options"});return M.forEach(ue=>{var C;const R=W(te,ue),g=al(R,{withSeconds:o,min:e.min,max:e.max}),d=u||i||Hn(g,R)!==0,m=!!ie&&ie[te]===ue,F={part:te,selected:m,disabled:d,value:ue,label:Ut(ue),timeValue:Xt(g,{withSeconds:o}),displayValue:jn(g,{withSeconds:o,use12h:(C=e.use12h)!=null?C:e.ampm})},X=$("option",F,F.label),a=m?Y(F):[];q.appendChild(_.button({type:"button",class:ae(["cms-time-option",fe(m,"is-selected"),fe(d,"is-disabled")]),disabled:d,onClick:()=>z==null?void 0:z(g,{part:te,optionValue:ue})},_.span({class:"cms-time-option-label"},...J(null,"default",F,X)),a.length?_.span({class:"cms-time-option-point"},...a):null))}),Z.appendChild(q),Z};return re.appendChild(oe(l(e.hoursLabel)||"Ore","hour",bs(1,23))),re.appendChild(oe(l(e.minutesLabel)||"Min","minute",bs(r,59))),o&&re.appendChild(oe(l(e.secondsLabel)||"Sec","second",bs(y,59))),se.appendChild(re),se},Wn=t=>{if(!t)return null;const e={};return t.querySelectorAll(".cms-time-column").forEach((n,s)=>{const o=n.getAttribute("data-time-part")||String(s);e[o]=n.scrollTop}),e},cl=(t,e={})=>{var o;if(!t)return;const n=e.scrollState||null,s=(o=e.behavior)!=null?o:"smooth";t.querySelectorAll(".cms-time-column").forEach((r,y)=>{const u=r.getAttribute("data-time-part")||String(y),i=n&&Number.isFinite(n[u])?n[u]:null;i!=null&&(r.scrollTop=i);const b=r.querySelector(".cms-time-option.is-selected");if(!b)return;const T=Math.max(0,r.scrollHeight-r.clientHeight),S=b.offsetTop-(r.clientHeight-b.offsetHeight)/2,w=Math.max(0,Math.min(T,S));if(Math.abs(r.scrollTop-w)<1){r.scrollTop=w;return}if(s&&typeof r.scrollTo=="function"){r.scrollTo({top:w,behavior:s});return}r.scrollTop=w})},ul=(t,e={})=>{var cn,un,tn,nn,Pe,Ve,et,ct,gt,ht,Ct,yt;const{props:n,children:s}=JSswift.uiNormalizeArgs(t),o=e.calendar===!0,r=n.slots||{},y=qe(n.size,()=>{const p=String(l(n.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(p)?`cms-size-${p}`:""}),u=String(l((nn=(tn=n.mode)!=null?tn:l((un=(cn=n.rangeMultiple)!=null?cn:n.multipleRange)!=null?un:n.multiRange)?"range-multiple":null)!=null?nn:n.range&&n.multiple?"range-multiple":n.range?"range":n.multiple?"multiple":"single")).toLowerCase(),i=["range-multiple","multiple-range","rangemultiple","multiplerange","range_multiple","multiple_range","multi-range","multi_range","ranges"].includes(u)?"range-multiple":u==="range"?"range":u==="multiple"?"multiple":"single",b=n.model||(Lt(n.value)||Jt(n.value)?n.value:null),T=Nt(b,o?"UI.Calendar:model":"UI.Datepicker:model"),S=T?T.get():l(n.value),w=l((Pe=n.rangeAs)!=null?Pe:n.rangeModel)==="array"||Array.isArray(S),z=l((Ve=n.rangeMultipleAs)!=null?Ve:n.multipleRangeAs)==="array"||Array.isArray(S)&&Array.isArray(S[0]),Q=()=>{var p,ne,ve;return i==="single"&&!!l((ve=(ne=(p=n.withTime)!=null?p:n.time)!=null?ne:n.timePicker)!=null?ve:n.enableTime)},G=()=>{var ne,ve,Re,Fe,Oe,$e,Xe,ot;const p=Xt(Tt((ve=(ne=l(n.timeValue))!=null?ne:T?T.get():l(n.value))!=null?ve:S,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!l((Fe=(Re=n.timeWithSeconds)!=null?Re:n.withSeconds)!=null?Fe:n.showSeconds)||/:\d{2}:\d{2}$/.test(p)||/:\d{2}:\d{2}$/.test(l(n.timeFormat)||""),min:l((Oe=n.timeMin)!=null?Oe:n.minTime),max:l(($e=n.timeMax)!=null?$e:n.maxTime),use12h:l((ot=(Xe=n.time12h)!=null?Xe:n.use12h)!=null?ot:n.ampm)}},ie=()=>{var ne,ve;const p=Number(l((ve=(ne=n.timeMinuteStep)!=null?ne:n.minuteStep)!=null?ve:5));return Math.max(1,Math.min(30,Number.isFinite(p)?p:5))},D=()=>{var ne,ve;const p=Number(l((ve=(ne=n.timeSecondStep)!=null?ne:n.secondStep)!=null?ve:5));return Math.max(1,Math.min(30,Number.isFinite(p)?p:5))},$=p=>String(p).padStart(2,"0"),Y=(p,ne,ve)=>{const Re=new Date(p,ne,ve);return Re.getFullYear()!==p||Re.getMonth()!==ne||Re.getDate()!==ve?null:Re},W=p=>!(p instanceof Date)||Number.isNaN(p.getTime())?null:`${p.getFullYear()}-${$(p.getMonth()+1)}-${$(p.getDate())}`,se=p=>{if(typeof p!="string")return null;const ne=p.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!ne)return null;const ve=Number(ne[1]),Re=Number(ne[2])-1,Fe=Number(ne[3]),Oe=new Date(ve,Re,Fe);return Oe.getFullYear()!==ve||Oe.getMonth()!==Re||Oe.getDate()!==Fe?null:Oe},me=(p,ne)=>{const ve=se(p);return ve?(ve.setDate(ve.getDate()+ne),W(ve)):null},re=(p,ne)=>new Date(p.getFullYear(),p.getMonth()+ne,1),oe=p=>{if(p instanceof Date&&!Number.isNaN(p.getTime()))return new Date(p.getFullYear(),p.getMonth(),1);const ne=a(p),ve=se(ne);return ve?new Date(ve.getFullYear(),ve.getMonth(),1):new Date},le=()=>W(new Date),te=(p,ne)=>!!p&&!!ne&&p===ne,M=(p,ne)=>p==null&&ne==null?0:p==null?-1:ne==null?1:p<ne?-1:p>ne?1:0,Z=(p,ne)=>{const ve=se(p),Re=se(ne);return!ve||!Re?0:Math.round((Re.getTime()-ve.getTime())/864e5)},q=p=>Array.isArray(p)?p.slice():p==null||p===""?[]:[p],ue=p=>({from:(p==null?void 0:p.from)||null,to:(p==null?void 0:p.to)||null}),R=p=>Array.isArray(p)?p.map(ue):[],g=p=>{const ne=ue(p);return w?[ne.from,ne.to]:ne},d=p=>R(p).map(ne=>z?[ne.from,ne.to]:ne),m=p=>i==="multiple"?Array.isArray(p)?p.slice():[]:i==="range"?ue(p):i==="range-multiple"?R(p):p||null,F=p=>i==="multiple"?Array.isArray(p)?p.slice():[]:i==="range"?g(p):i==="range-multiple"?d(p):p||"",X=p=>JSON.stringify(F(p)),a=p=>{if(p==null||p==="")return null;if(p instanceof Date)return W(p);if(typeof p=="number")return W(new Date(p));if(typeof p!="string")return typeof p=="object"&&p.date!=null?a(p.date):null;const ne=p.trim();if(!ne)return null;const ve=ne.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:$|[T\s])/);if(ve){const $e=Y(Number(ve[1]),Number(ve[2])-1,Number(ve[3]));return W($e)}const Re=ne.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(Re){const $e=Re[3].length===2?2e3+Number(Re[3]):Number(Re[3]),Xe=Y($e,Number(Re[2])-1,Number(Re[1]));return W(Xe)}if(/^\d{1,4}$/.test(ne))return null;const Fe=new Date(ne);if(Number.isNaN(Fe.getTime()))return null;const Oe=ne.match(/(?:^|[^\d])(\d{4})(?!\d)/);return Oe&&Fe.getFullYear()!==Number(Oe[1])?null:W(Fe)},C=p=>{var Re,Fe,Oe,$e,Xe,ot;if(p==null||p==="")return{from:null,to:null};let ne=null,ve=null;if(Array.isArray(p))ne=a(p[0]),ve=a(p[1]);else if(typeof p=="object")ne=a((Oe=(Fe=(Re=p.from)!=null?Re:p.start)!=null?Fe:p.dateFrom)!=null?Oe:p.departure),ve=a((ot=(Xe=($e=p.to)!=null?$e:p.end)!=null?Xe:p.dateTo)!=null?ot:p.return);else{const pt=String(p).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];ne=a(pt[0]),ve=a(pt[1])}return ne&&ve&&ne>ve&&([ne,ve]=[ve,ne]),{from:ne,to:ve}},h=p=>{const ne=[],ve=new Set,Re=Fe=>{const Oe=C(Fe);if(!Oe.from)return;const $e=`${Oe.from||""}|${Oe.to||""}`;ve.has($e)||(ve.add($e),ne.push(Oe))};if(p==null||p==="")return ne;if(Array.isArray(p))if(p.every(Oe=>Oe==null||typeof Oe=="string"||typeof Oe=="number"||Oe instanceof Date)){const Oe=p.map(a).filter(Boolean);for(let $e=0;$e<Oe.length;$e+=2)Re({from:Oe[$e],to:Oe[$e+1]||null})}else p.forEach(Oe=>Re(Oe));else if(typeof p=="object"&&Array.isArray(p.ranges))p.ranges.forEach(Fe=>Re(Fe));else if(typeof p=="object")Re(p);else{const Oe=(String(p).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(a).filter(Boolean);for(let $e=0;$e<Oe.length;$e+=2)Re({from:Oe[$e],to:Oe[$e+1]||null})}return ne.sort((Fe,Oe)=>M(Fe.from,Oe.from)||M(Fe.to,Oe.to))},P=p=>{const ne=[];return q(p).forEach(ve=>{const Re=a(ve);Re&&!ne.includes(Re)&&ne.push(Re)}),ne.sort()},j=p=>i==="range"?C(p):i==="range-multiple"?h(p):i==="multiple"?P(p):a(p),U=()=>{var p;return a(l((p=n.min)!=null?p:n.minDate))},ce=()=>{var p;return a(l((p=n.max)!=null?p:n.maxDate))},L=()=>l(n.locale)||void 0,f=()=>{var ne,ve;const p=Number(l((ve=(ne=n.firstDayOfWeek)!=null?ne:n.weekStart)!=null?ve:1));return Number.isFinite(p)?(p%7+7)%7:1},k=()=>{var ve;const p=i==="range"||i==="range-multiple"?2:1,ne=Number((ve=l(n.monthsToShow))!=null?ve:p);return Math.max(1,Math.min(4,Number.isFinite(ne)?ne:p))},A=()=>{const p=U(),ne=ce();let ve=a(l(n.defaultMonth))||le();return p&&ve<p&&(ve=p),ne&&ve>ne&&(ve=ne),ve||p||ne||le()},H=()=>l(n.confirm)?_e:Ie,ge=p=>{const ne=se(p);return ne?{date:p,value:p,year:ne.getFullYear(),month:ne.getMonth()+1,day:ne.getDate(),weekday:ne.getDay(),today:te(p,le())}:{date:p,value:p}},Se=(p,ne)=>p==null?!1:Array.isArray(p)?p.some(ve=>a(ve)===ne):p instanceof Set?p.has(ne):typeof p=="function"?!!p(ne,ge(ne)):typeof p=="string"||p instanceof Date||typeof p=="number"?a(p)===ne:!1,ye=p=>{var ot,pt,xt,Bt,zt,At,sn,dn,fn,vn,zn,Pn,Jn;if(!p)return!1;const ne=U(),ve=ce();if(ne&&p<ne||ve&&p>ve)return!1;const Re=l((pt=(ot=n.options)!=null?ot:n.enableDates)!=null?pt:n.allowedDates);if(Re!=null&&!Se(Re,p))return!1;const Fe=l((Bt=(xt=n.disableDates)!=null?xt:n.disabledDates)!=null?Bt:n.notAllowedDates);if(Fe!=null&&Se(Fe,p))return!1;const Oe=(zt=se(p))==null?void 0:zt.getDay();if(Array.isArray(l((At=n.allowedWeekdays)!=null?At:n.weekdays))&&Oe!=null&&!l((sn=n.allowedWeekdays)!=null?sn:n.weekdays).map(Cn=>Number(Cn)).includes(Oe)||l(n.weekdaysOnly)&&(Oe===0||Oe===6)||l(n.weekendsOnly)&&Oe!=null&&Oe!==0&&Oe!==6)return!1;const $e=H(),Xe=i==="range"?$e!=null&&$e.from&&!($e!=null&&$e.to)?$e:null:i==="range-multiple"&&Array.isArray($e)&&$e.length&&(dn=$e[$e.length-1])!=null&&dn.from&&!((fn=$e[$e.length-1])!=null&&fn.to)?$e[$e.length-1]:null;if(Xe!=null&&Xe.from){const Sn=Math.abs(Z(Xe.from,p)),Cn=Number(l((zn=(vn=n.minRange)!=null?vn:n.minDays)!=null?zn:n.minNights)),En=Number(l((Jn=(Pn=n.maxRange)!=null?Pn:n.maxDays)!=null?Jn:n.maxNights));if(Number.isFinite(Cn)&&Sn<Cn||Number.isFinite(En)&&Sn>En)return!1}return!0},V=p=>{var Re,Fe;if(!p)return"";const ne=se(p);return!ne||String(l((Fe=(Re=n.displayMask)!=null?Re:n.mask)!=null?Fe:"")||"").toLowerCase()==="iso"||l(n.isoDisplay)===!0?p:new Intl.DateTimeFormat(L(),{year:"numeric",month:"short",day:"2-digit"}).format(ne)},O=(p,ne=I)=>{if(i==="range-multiple")return!Array.isArray(p)||!p.length?"":p.length>2&&l(n.compactMultiple)!==!1?`${p.length} ${l(n.multipleRangeLabel)||"intervalli selezionati"}`:p.map(Fe=>{const Oe=Fe!=null&&Fe.from?V(Fe.from):"",$e=Fe!=null&&Fe.to?V(Fe.to):"";return Oe&&$e?`${Oe} -> ${$e}`:Oe||$e||""}).filter(Boolean).join("; ");if(i==="multiple")return!Array.isArray(p)||!p.length?"":p.length>3&&l(n.compactMultiple)!==!1?`${p.length} ${l(n.multipleLabel)||"date selezionate"}`:p.map(V).join(", ");if(i==="range"){const Fe=p!=null&&p.from?V(p.from):"",Oe=p!=null&&p.to?V(p.to):"";return Fe&&Oe?`${Fe} -> ${Oe}`:Fe||Oe||""}const ve=V(p);if(!Q())return ve;const Re=pe(ne);return[ve,Re].filter(Boolean).join(" \u2022 ")},K=p=>(String(p||"").match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(a).filter(Boolean),ke=p=>{if(p==null||p==="")return i==="multiple"||i==="range-multiple"?[]:i==="range"?{from:null,to:null}:null;const ne=K(p);if(i==="range-multiple"){const ve=[];for(let Re=0;Re<ne.length;Re+=2)ne[Re]&&ve.push({from:ne[Re],to:ne[Re+1]||null});return ve}return i==="multiple"?ne:i==="range"?{from:ne[0]||null,to:ne[1]||null}:ne[0]||a(p)},Ne=()=>i==="multiple"||i==="range-multiple"?[]:i==="range"?{from:null,to:null}:null,ee=(p,ne=null)=>{var $e;if(!Q())return null;const ve=G(),Re=l(n.timeValue),Fe=p!=null?p:Re,Oe=Tt(Fe,ve);return it(($e=Oe!=null?Oe:ne)!=null?$e:null)},xe=()=>l(n.confirm)?we:I,be=(p=Ie,ne=I)=>i==="single"&&Q()?Do(p||null,ne,G()):F(p),Ce=(p=Ie,ne=I)=>JSON.stringify(be(p,ne)),pe=p=>jn(p,G());let Ie=j(S),_e=m(Ie),I=ee(S,Tt(l(n.timeValue),G())),we=it(I),E=null,x=null,v=oe(i==="range"?(Ie==null?void 0:Ie.from)||(Ie==null?void 0:Ie.to)||A():i==="range-multiple"?((et=Ie==null?void 0:Ie[Ie.length-1])==null?void 0:et.from)||((ct=Ie==null?void 0:Ie[Ie.length-1])==null?void 0:ct.to)||A():i==="multiple"?Ie[0]||A():Ie||A()),c=null,N=null;const de=p=>{const ne=p instanceof Date?p:se(a(p));if(!ne)return-1;const ve=ne.getFullYear(),Re=ne.getMonth();for(let Fe=0;Fe<k();Fe+=1){const Oe=re(v,Fe);if(Oe.getFullYear()===ve&&Oe.getMonth()===Re)return Fe}return-1},Ae={...n,label:(gt=n.label)!=null?gt:n.placeholder},Je=Ae.label!=null||JSswift.ui.getSlot(r,"label")!=null,B=i==="range"?"Seleziona andata e ritorno":i==="range-multiple"?"Seleziona intervalli":i==="multiple"?"Seleziona date":"Seleziona data",Le=o?null:_.input({class:ae(["cms-input","cms-date-display",y,fe(n.manualInput,"is-manual"),n.inputClass]),type:"text",autocomplete:"off",placeholder:Je?"":(ht=n.placeholder)!=null?ht:B,readOnly:!l(n.manualInput),disabled:!!l(n.disabled),value:O(Ie,I)}),Me=_.div({style:{display:"contents"}}),Ee=o?null:_.div({class:"cms-date-control",style:{display:"contents"}},Le,Me),De=o?null:he.FormField({...Ae,iconRight:(Ct=n.iconRight)!=null?Ct:"calendar_month",control:Ee,getValue:()=>Le.value,onClear:()=>{l(n.disabled)||l(n.readonly)||(Qe(Ne(),null),c&&St())},onFocus:()=>Le.focus()}),Ue=(p,ne={})=>{var Fe,Oe;const ve=ne.focusIso||(i==="range"?(p==null?void 0:p.from)||(p==null?void 0:p.to)||A():i==="range-multiple"?((Fe=p==null?void 0:p[p.length-1])==null?void 0:Fe.from)||((Oe=p==null?void 0:p[p.length-1])==null?void 0:Oe.to)||A():i==="multiple"?(p==null?void 0:p[0])||A():p||A());let Re=oe(ve);if(ne.preserveMonthOffset){const $e=Number.isInteger(ne.visibleMonthOffset)?ne.visibleMonthOffset:de(ne.anchorIso||ne.focusIso||ve);$e>0&&(Re=re(Re,-$e))}v=Re},Ye=()=>{Me.replaceChildren();const p=l(n.name);if(!p)return;const ne=(Fe,Oe)=>{Me.appendChild(_.input({type:"hidden",name:Fe,value:Oe!=null?Oe:""}))},ve=Ie;if(i==="single"){ne(p,be(ve,I));return}if(i==="range"){ne(l(n.nameFrom)||`${p}_from`,(ve==null?void 0:ve.from)||""),ne(l(n.nameTo)||`${p}_to`,(ve==null?void 0:ve.to)||"");return}if(i==="range-multiple"){const Fe=Array.isArray(ve)?ve:[],Oe=/\[\]$/.test(l(n.nameFrom)||"")?l(n.nameFrom):`${l(n.nameFrom)||`${p}_from`}[]`,$e=/\[\]$/.test(l(n.nameTo)||"")?l(n.nameTo):`${l(n.nameTo)||`${p}_to`}[]`;Fe.forEach(Xe=>{ne(Oe,(Xe==null?void 0:Xe.from)||""),ne($e,(Xe==null?void 0:Xe.to)||"")});return}const Re=/\[\]$/.test(p)?p:`${p}[]`;(Array.isArray(ve)?ve:[]).forEach(Fe=>ne(Re,Fe))},Ze=()=>{var p;o||(Le.readOnly=!l(n.manualInput),Le.disabled=!!l(n.disabled),Le.setAttribute("aria-expanded",c?"true":"false"),Le.value=O(Ie,I),Ye(),(p=De==null?void 0:De._refresh)==null||p.call(De))},Qe=(p,ne,ve={})=>{var Xe,ot,pt;const Re=j(p),Fe=Q()?it((Xe=Tt(ve.timeValue!=null?ve.timeValue:ve.preserveTime?xe():p,G()))!=null?Xe:ve.preserveTime?xe():null):null,Oe=Ce(Ie,I);Ie=m(Re),_e=m(Re),Q()&&(I=it(Fe),we=it(Fe)),E=null,Ue(Re,ve),Ze(),wt(),T&&ve.fromModel!==!0&&T.set(be(Re,Fe));const $e=Ce(Re,Fe);if(ve.emit!==!1&&$e!==Oe){const xt=be(Re,Fe);(ot=n.onInput)==null||ot.call(n,xt,ne),(pt=n.onChange)==null||pt.call(n,xt,ne)}return Re},Te=(p,ne,ve={})=>{var $e,Xe;if(!Q())return null;const Re=it(Tt(p,G()));if(l(n.confirm)&&ve.commit!==!0)return we=Re,wt(),Re;const Fe=Ce(Ie,I);I=it(Re),we=it(Re),Ze(),wt(),T&&ve.fromModel!==!0&&T.set(be(Ie,Re));const Oe=Ce(Ie,Re);if(ve.emit!==!1&&Oe!==Fe){const ot=be(Ie,Re);($e=n.onInput)==null||$e.call(n,ot,ne),(Xe=n.onChange)==null||Xe.call(n,ot,ne)}return Re},je=(p,ne,ve={})=>{if(l(n.confirm)){_e=m(j(p)),Q()&&(ve.timeValue!=null||ve.preserveTime)&&(we=it(Tt(ve.timeValue!=null?ve.timeValue:xe(),G()))),E=null,Ue(_e,ve),wt();return}Qe(p,ne,ve)},tt=()=>{const p=H();if(i==="range")return!(p!=null&&p.from)||p!=null&&p.to||!E?p:M(p.from,E)<=0?{from:p.from,to:E}:{from:E,to:p.from};if(i==="range-multiple"){const ne=Array.isArray(p)&&p.length?p[p.length-1]:null;return!(ne!=null&&ne.from)||ne!=null&&ne.to||!E?ne:M(ne.from,E)<=0?{from:ne.from,to:E}:{from:E,to:ne.from}}return p},nt=()=>{if(i==="range"){const p=tt();return p!=null&&p.from?[p]:[]}if(i==="range-multiple"){const p=Array.isArray(H())?H():[];if(!p.length)return[];const ne=tt();return ne!=null&&ne.from?[...p.slice(0,-1),ne]:p}return[]},ut=p=>{const ne=H();return i==="multiple"?ne.includes(p):i==="range-multiple"?Array.isArray(ne)&&ne.some(ve=>te(ve==null?void 0:ve.from,p)||te(ve==null?void 0:ve.to,p)):i==="range"?te(ne==null?void 0:ne.from,p)||te(ne==null?void 0:ne.to,p):te(ne,p)},dt=p=>i!=="range"&&i!=="range-multiple"?!1:nt().some(ne=>(ne==null?void 0:ne.from)&&(ne==null?void 0:ne.to)&&p>=ne.from&&p<=ne.to),bt=(p,ne={})=>{const ve=H(),Re=i==="range"?ve:i==="range-multiple"&&Array.isArray(ve)&&ve.length?ve[ve.length-1]:null;!(Re!=null&&Re.from)||Re!=null&&Re.to||E===p||(E=p,ne.render!==!1&&wt())},lt=()=>o||l(n.confirm)||n.closeOnSelect===!1?!1:i==="multiple"||i==="range-multiple"?!!n.closeOnSelect:!0,ft=(p,ne,ve={})=>{var Fe;if(!ye(p)||l(n.disabled)||l(n.readonly))return;const Re={focusIso:p,anchorIso:p,preserveTime:Q(),timeValue:xe(),preserveMonthOffset:!!c&&k()>1,visibleMonthOffset:Number.isInteger(ve.visibleMonthOffset)?ve.visibleMonthOffset:null};if(i==="multiple"){const Oe=P(H()),$e=Oe.includes(p)?Oe.filter(Xe=>Xe!==p):[...Oe,p];je($e.sort(),ne,Re),lt()&&St();return}if(i==="range"){const Oe=m(H());let $e;!Oe.from||Oe.from&&Oe.to?$e={from:p,to:null}:M(p,Oe.from)<0?$e={from:p,to:Oe.from}:$e={from:Oe.from,to:p},je($e,ne,Re),$e.to&<()&&St();return}if(i==="range-multiple"){const Oe=h(H()),$e=Oe.length?Oe[Oe.length-1]:null;let Xe;!($e!=null&&$e.from)||$e!=null&&$e.to?Xe=[...Oe,{from:p,to:null}]:M(p,$e.from)<0?Xe=[...Oe.slice(0,-1),{from:p,to:$e.from}]:Xe=[...Oe.slice(0,-1),{from:$e.from,to:p}],je(Xe,ne,Re),(Fe=Xe[Xe.length-1])!=null&&Fe.to&<()&&St();return}je(p,ne,Re),lt()&&St()},vt=()=>{x=null,Qe(Ne(),null,{timeValue:null})},_t=()=>{const p=le();if(!ye(p)){Ue(p),wt();return}if(i==="range"){const ne=me(p,1),ve=ne&&ye(ne)?{from:p,to:ne}:{from:p,to:null};je(ve,null);return}if(i==="range-multiple"){const ne=me(p,1),ve=ne&&ye(ne)?[{from:p,to:ne}]:[{from:p,to:null}];je(ve,null);return}if(i==="multiple"){je([p],null);return}je(p,null,{preserveTime:Q(),timeValue:xe()})},rt=(p={})=>{cl(N,p)},Vt=()=>{if(!Q())return;const p=Wn(N);Te(new Date,null,{commit:!l(n.confirm)}),rt({scrollState:p}),!l(n.confirm)&&n.closeOnSelect===!0&&St()},Mt=()=>{l(n.confirm)&&(Qe(_e,null,{timeValue:we,preserveTime:!0}),n.closeOnSelect!==!1&&St())},wt=()=>{var xl,kl,_l,Nl,Al,Ll,Il,zl,Pl,Jl,El,Tl,Rl,Ml,Fl,Ol,Dl,$l,Vl;if(!N)return;const p=L(),ne=new Intl.DateTimeFormat(p,{month:"long",year:"numeric"}),ve=new Intl.DateTimeFormat(p,{weekday:"short"}),Re=Array.from({length:7},(Ge,st)=>{const Ft=(f()+st)%7;return ve.format(new Date(2024,0,7+Ft))}),Fe=H(),Oe=Ge=>{let st=JSswift.ui.renderSlot(r,"point",Ge,null);return st==null&&(st=JSswift.ui.renderSlot(r,"dayPoint",Ge,null)),st==null&&n.pointIcon!=null&&(Ge.selected||Ge.inRange||Ge.today)&&(st=typeof n.pointIcon=="string"?he.Icon({name:n.pointIcon,size:10}):JSswift.ui.slot(n.pointIcon,Ge)),J(null,"default",Ge,st)},$e=(Ge,st)=>{const Ft=Ge.getFullYear(),Tn=Ge.getMonth(),Rn=new Date(Ft,Tn,1),Zn=(Rn.getDay()-f()+7)%7,xs=new Date(Ft,Tn,1-Zn),es=_.div({class:"cms-date-month"});es.appendChild(_.div({class:"cms-date-month-title"},ne.format(Rn)));const Bl=_.div({class:"cms-date-weekdays"});Re.forEach(Mn=>Bl.appendChild(_.div({class:"cms-date-weekday"},Mn))),es.appendChild(Bl);const Hl=_.div({class:"cms-date-grid"});for(let Mn=0;Mn<42;Mn+=1){const ks=new Date(xs.getFullYear(),xs.getMonth(),xs.getDate()+Mn),Pt=W(ks),jl=ks.getMonth()===Tn,Wl=ut(Pt),Ul=dt(Pt),Gl=(i==="range"||i==="range-multiple")&&nt().some(It=>te(It==null?void 0:It.from,Pt)),Kl=(i==="range"||i==="range-multiple")&&nt().some(It=>te(It==null?void 0:It.to,Pt)),_s=!ye(Pt),Ns={...ge(Pt),selected:Wl,inRange:Ul,rangeStart:Gl,rangeEnd:Kl,disabled:_s,outside:!jl,value:Fe,select:()=>ft(Pt,null,{visibleMonthOffset:st})},As=Oe(Ns),ai=JSswift.ui.renderSlot(r,"day",Ns,String(ks.getDate())),ri=J(null,"default",Ns,ai),ci=_.button({type:"button",class:ae(["cms-date-day",fe(!jl,"is-outside"),fe(Wl,"is-selected"),fe(Ul,"is-in-range"),fe(Gl,"is-range-start"),fe(Kl,"is-range-end"),fe(_s,"is-disabled"),fe(te(Pt,le()),"is-today"),fe(As.length,"has-point")]),disabled:_s,onMouseDown:It=>{It.button===0&&(x=Pt,It.preventDefault(),ft(Pt,It,{visibleMonthOffset:st}))},onClick:It=>{if(x!=null&&It.detail!==0){x=null;return}x=null,ft(Pt,It,{visibleMonthOffset:st})},onMouseEnter:()=>bt(Pt),onFocus:()=>bt(Pt,{render:!1})},_.span({class:"cms-date-day-label"},...ri),As.length?_.span({class:"cms-date-day-point"},...As):null);Hl.appendChild(ci)}return es.appendChild(Hl),es},Xe=U(),ot=ce(),pt=[v.getFullYear(),(xl=se(le()))==null?void 0:xl.getFullYear(),(kl=se(Xe))==null?void 0:kl.getFullYear(),(_l=se(ot))==null?void 0:_l.getFullYear(),(Nl=se(l(n.defaultMonth)))==null?void 0:Nl.getFullYear()];i==="range"?pt.push((Al=se(Fe==null?void 0:Fe.from))==null?void 0:Al.getFullYear(),(Ll=se(Fe==null?void 0:Fe.to))==null?void 0:Ll.getFullYear()):i==="range-multiple"?Fe.forEach(Ge=>{var st,Ft;pt.push((st=se(Ge==null?void 0:Ge.from))==null?void 0:st.getFullYear(),(Ft=se(Ge==null?void 0:Ge.to))==null?void 0:Ft.getFullYear())}):i==="multiple"?Fe.forEach(Ge=>{var st;return pt.push((st=se(Ge))==null?void 0:st.getFullYear())}):pt.push((Il=se(Fe))==null?void 0:Il.getFullYear());const xt=pt.filter(Ge=>Number.isFinite(Ge)),Bt=(xt.length?Math.min(...xt):v.getFullYear())-100,zt=(xt.length?Math.max(...xt):v.getFullYear())+50,At=Number(l((Jl=(Pl=n.yearStart)!=null?Pl:Xe?(zl=se(Xe))==null?void 0:zl.getFullYear():null)!=null?Jl:Bt)),sn=Number(l((Rl=(Tl=n.yearEnd)!=null?Tl:ot?(El=se(ot))==null?void 0:El.getFullYear():null)!=null?Rl:zt)),dn=_.select({class:"cms-date-select",value:String(v.getMonth()),onChange:Ge=>{var st;v=new Date(v.getFullYear(),Number(Ge.currentTarget.value),1),(st=n.onNavigate)==null||st.call(n,{month:v.getMonth()+1,year:v.getFullYear()}),wt()}},...Array.from({length:12},(Ge,st)=>us({value:String(st)},new Intl.DateTimeFormat(p,{month:"long"}).format(new Date(2024,st,1))))),fn=_.select({class:"cms-date-select cms-date-select-year",value:String(v.getFullYear()),onChange:Ge=>{var st;v=new Date(Number(Ge.currentTarget.value),v.getMonth(),1),(st=n.onNavigate)==null||st.call(n,{month:v.getMonth()+1,year:v.getFullYear()}),wt()}},...Array.from({length:Math.max(1,sn-At+1)},(Ge,st)=>{const Ft=At+st;return us({value:String(Ft)},String(Ft))})),vn=_.div({class:"cms-date-header"},_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Ge;v=re(v,-1),(Ge=n.onNavigate)==null||Ge.call(n,{month:v.getMonth()+1,year:v.getFullYear()}),wt()}},he.Icon({name:"chevron_left",size:16})),_.div({class:"cms-date-header-center"},dn,fn),_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Ge;v=re(v,1),(Ge=n.onNavigate)==null||Ge.call(n,{month:v.getMonth()+1,year:v.getFullYear()}),wt()}},he.Icon({name:"chevron_right",size:16}))),zn=_.div({class:"cms-date-shortcuts"}),Pn=l((Ml=n.shortcuts)!=null?Ml:n.presets)||[];Pn.forEach((Ge,st)=>{var Rn,Zn;if(!Ge)return;const Ft=typeof Ge.value=="function"?Ge.value({today:le()}):Ge.value,Tn=(Zn=(Rn=Ge.label)!=null?Rn:Ge.text)!=null?Zn:`Preset ${st+1}`;zn.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>je(Ft,null,{preserveTime:Q(),timeValue:xe()})},Tn))});const Jn=_.div({class:"cms-date-months"});for(let Ge=0;Ge<k();Ge+=1)Jn.appendChild($e(re(v,Ge),Ge));const Sn=O(Fe,xe()),Cn=_.div({class:"cms-date-value"},...J(r,"value",{value:Fe,displayValue:Sn,mode:i,timeValue:xe()},Sn||J(r,"default",{},s))),En=_.div({class:"cms-time-header"}),ti=_.div({class:"cms-time-columns-2"},_.div({class:"cms-time-column-title"},l(n.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},l(n.minutesLabel)||"Min"));En.appendChild(ti);const ni=Q()?rl({props:{min:l((Fl=n.timeMin)!=null?Fl:n.minTime),max:l((Ol=n.timeMax)!=null?Ol:n.maxTime),use12h:l(($l=(Dl=n.time12h)!=null?Dl:n.use12h)!=null?$l:n.ampm),hoursLabel:l(n.timeHoursLabel)||"Ore",minutesLabel:l(n.timeMinutesLabel)||"Min",secondsLabel:l(n.timeSecondsLabel)||"Sec"},slots:r,slotPrefix:"time",value:xe(),withSeconds:!1,minuteStep:1,secondStep:D(),disabled:!!l(n.disabled),readonly:!!l(n.readonly),embedded:!0,pointIcon:l(n.timePointIcon),shortcuts:l((Vl=n.timeShortcuts)!=null?Vl:n.timePresets),onSelect:Ge=>{const st=Wn(N);Te(Ge,null),rt({scrollState:st})}}):null,si=_.div({class:"cms-date-footer-info"},Cn),li=_.div({class:ae(["cms-date-footer",fe(Q(),"has-time")])},si,_.div({class:"cms-date-actions"},_.button({type:"button",class:"cms-date-action",onClick:_t},l(n.todayLabel)||"Oggi"),l(n.clearable)!==!1?_.button({type:"button",class:"cms-date-action",onClick:vt},l(n.clearLabel)||"Reset"):null,l(n.confirm)?_.button({type:"button",class:"cms-date-action is-primary",onClick:Mt},l(n.applyLabel)||"Applica"):null)),oi=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:Vt},l(n.nowLabel)||"Ora")),ii=Q()?_.div({class:"cms-date-time"},En,ni,oi):null;N.replaceChildren(_.div({class:"cms-date-panel-root",onKeydown:Ge=>{var st;Ge.key==="Escape"&&(Ge.preventDefault(),o?(st=n.onEscape)==null||st.call(n,Ge):St())}},vn,Pn.length?zn:null,_.div({class:"cms-data-time"},Jn,ii),li))};function Kt(){var p,ne,ve,Re;return c||l(n.disabled)||l(n.readonly)||(_e=m(Ie),we=it(I),E=null,x=null,Ue(_e),c=JSswift.overlay.open(({close:Fe})=>{var Xe;const Oe=i==="range"||i==="range-multiple"?2:1,$e=Number((Xe=l(n.monthsToShow))!=null?Xe:Oe);return N=_.div({class:Dt(["cms-date-panel",l(y),fe($e>1,"multi-month"),n.panelClass])}),wt(),N},{type:"date",anchorEl:De._control||Le,placement:n.placement||"bottom-start",offsetX:(p=n.offsetX)!=null?p:0,offsetY:(ve=(ne=n.offsetY)!=null?ne:n.offset)!=null?ve:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:n.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Dt(["cms-date-overlay",n.panelClass,fe(Q(),"has-time")]),onClose:()=>{var Fe;c=null,N=null,E=null,Ze(),(Fe=n.onClose)==null||Fe.call(n)}}),n.panelStyle&&Object.assign(c.panel.style,n.panelStyle),bn(c),Ze(),(Re=n.onOpen)==null||Re.call(n)),c}function St(){if(!c)return;x=null;const p=c;yn(p,()=>JSswift.overlay.close(p.id))}if(o){const p=i==="range"||i==="range-multiple"?2:1,ne=Number((yt=l(n.monthsToShow))!=null?yt:p);N=_.div({class:Dt(["cms-date-panel","cms-date-calendar",l(y),fe(ne>1,"multi-month"),n.panelClass,n.class]),style:n.style})}return o||Le.addEventListener("focus",p=>{var ne;(ne=n.onFocus)==null||ne.call(n,p),n.openOnFocus!==!1&&Kt()}),o||Le.addEventListener("click",p=>{var ne;(ne=n.onClick)==null||ne.call(n,p),Kt()}),o||Le.addEventListener("keydown",p=>{if(p.key==="Escape"){c&&(p.preventDefault(),St());return}(p.key==="ArrowDown"||p.key==="Enter"||p.key===" ")&&(p.preventDefault(),Kt()),(p.key==="Backspace"||p.key==="Delete")&&!l(n.manualInput)&&l(n.clearable)!==!1&&(p.preventDefault(),vt())}),!o&&l(n.manualInput)?(Le.addEventListener("input",p=>{var ne;(ne=n.onTyping)==null||ne.call(n,Le.value,p)}),Le.addEventListener("change",p=>{const ne=ke(Le.value);Qe(ne,p,{timeValue:Tt(Le.value,G()),preserveTime:!Tt(Le.value,G())})}),Le.addEventListener("blur",p=>{var ve;(ve=n.onBlur)==null||ve.call(n,p);const ne=ke(Le.value);Le.value===""?vt():Qe(ne,p,{timeValue:Tt(Le.value,G()),preserveTime:!Tt(Le.value,G())})})):o||Le.addEventListener("blur",p=>{var ne;return(ne=n.onBlur)==null?void 0:ne.call(n,p)}),T&&T.watch(p=>{const ne=j(p),ve=ee(p);Ce(ne,ve)!==Ce(Ie,I)&&(Ie=ne,_e=m(Ie),I=it(ve),we=it(ve),E=null,Ue(Ie),Ze(),wt())},o?"UI.Calendar:watch":"UI.Datepicker:watch"),JSswift.reactive.effect(()=>{!T&&n.value!=null?(Ie=j(l(n.value)),_e=m(Ie),I=ee(l(n.value)),we=it(I)):Q()&&n.timeValue!=null&&(I=ee(l(n.timeValue)),we=it(I)),Ze(),wt(),c&&l(n.disabled)&&St()},o?"UI.Calendar:render":"UI.Datepicker:render"),o?(N._calendar=N,N._date=N,N._getValue=()=>be(Ie,I),N._setValue=p=>Qe(p,null,{emit:!1,timeValue:ee(p)}),N._clear=vt,N._select=p=>{const ne=a(p);ne&&ft(ne,null)},N._time=()=>it(I),N):(De._input=Le,De._date=Le,De._open=Kt,De._close=St,De._getValue=()=>be(Ie,I),De._setValue=p=>Qe(p,null,{emit:!1,timeValue:ee(p)}),De._time=()=>it(I),De._panel=()=>(c==null?void 0:c.panel)||null,De)};he.Datepicker=(...t)=>ul(t),he.Calendar=(...t)=>ul(t,{calendar:!0}),he.Date=he.Datepicker,JSswift.ui.Datepicker=he.Datepicker,JSswift.ui.Calendar=he.Calendar,JSswift.ui.Date=he.Date,he.Time=(...t)=>{var X,a,C;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{const h=String(l(e.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(h)?`cms-size-${h}`:""}),r=()=>{var P,j,U,ce,L;const h=Xt(Tt(b?b.get():(P=l(e.value))!=null?P:T,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!l((j=e.withSeconds)!=null?j:e.showSeconds)||/:\d{2}:\d{2}$/.test(h),min:l((U=e.min)!=null?U:e.minTime),max:l((ce=e.max)!=null?ce:e.maxTime),use12h:l((L=e.use12h)!=null?L:e.ampm)}},y=()=>{var P;const h=Number(l((P=e.minuteStep)!=null?P:1));return Math.max(1,Math.min(30,Number.isFinite(h)?h:5))},u=()=>{var P;const h=Number(l((P=e.secondStep)!=null?P:1));return Math.max(1,Math.min(30,Number.isFinite(h)?h:5))},i=e.model||(Lt(e.value)||Jt(e.value)?e.value:null),b=Nt(i,"UI.Time:model"),T=b?b.get():l(e.value),S=h=>Tt(h,r()),w=h=>jn(h,r()),z=h=>Xt(h,r()),Q=h=>JSON.stringify(z(h));let G=it(S(T)),ie=it(G),D=null,$=null;const Y={...e,label:(X=e.label)!=null?X:e.placeholder},W=Y.label!=null||JSswift.ui.getSlot(s,"label")!=null,se=_.input({class:ae(["cms-input","cms-time-display",o,fe(e.manualInput,"is-manual"),e.inputClass]),type:"text",autocomplete:"off",placeholder:W?"":(a=e.placeholder)!=null?a:"Seleziona orario",readOnly:!l(e.manualInput),disabled:!!l(e.disabled),value:w(G)});se.setAttribute("aria-haspopup","dialog");const me=_.div({style:{display:"contents"}}),re=_.div({class:"cms-time-control",style:{display:"contents"}},se,me),oe=he.FormField({...Y,iconRight:(C=e.iconRight)!=null?C:"schedule",control:re,getValue:()=>se.value,onClear:()=>{l(e.disabled)||l(e.readonly)||(Z(null,null,{commit:!0}),D&&F())},onFocus:()=>se.focus()}),le=()=>l(e.confirm)?ie:G,te=()=>{me.replaceChildren();const h=l(e.name);h&&me.appendChild(_.input({type:"hidden",name:h,value:z(G)}))},M=()=>{var h;se.readOnly=!l(e.manualInput),se.disabled=!!l(e.disabled),se.setAttribute("aria-expanded",D?"true":"false"),se.value=w(G),te(),(h=oe._refresh)==null||h.call(oe)},Z=(h,P,j={})=>{var f,k;const U=it(S(h));if(l(e.confirm)&&j.commit!==!0)return ie=it(U),d(),U;const ce=Q(G);G=it(U),ie=it(U),M(),d(),b&&j.fromModel!==!0&&b.set(z(U));const L=Q(U);if(j.emit!==!1&&L!==ce){const A=z(U);(f=e.onInput)==null||f.call(e,A,P),(k=e.onChange)==null||k.call(e,A,P)}return U},q=h=>l(e.confirm)||e.closeOnSelect!==!0?!1:r().withSeconds?(h==null?void 0:h.part)==="second":(h==null?void 0:h.part)==="minute",ue=(h={})=>{cl($,h)},R=()=>{const h=Wn($);Z(new Date,null,{commit:!l(e.confirm)}),ue({scrollState:h}),!l(e.confirm)&&e.closeOnSelect===!0&&F()},g=()=>{l(e.confirm)&&(Z(ie,null,{commit:!0}),e.closeOnSelect!==!1&&F())},d=()=>{var k,A,H,ge;if(!$)return;const h=le(),P=w(h),j=_.div({class:"cms-time-header"}),U=_.div({class:"cms-time-columns"},_.div({class:"cms-time-column-title"},l(e.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},l(e.minutesLabel)||"Min")),ce=r().withSeconds;ce&&U.appendChild(_.div({class:"cms-time-column-title"},l(e.secondsLabel)||"Sec")),j.appendChild(U);const L=rl({props:{min:l((k=e.min)!=null?k:e.minTime),max:l((A=e.max)!=null?A:e.maxTime),use12h:l((H=e.use12h)!=null?H:e.ampm),hoursLabel:l(e.hoursLabel)||"Ore",minutesLabel:l(e.minutesLabel)||"Min",secondsLabel:l(e.secondsLabel)||"Sec"},slots:s,value:h,withSeconds:ce,minuteStep:y(),secondStep:u(),disabled:!!l(e.disabled),readonly:!!l(e.readonly),pointIcon:l(e.pointIcon),shortcuts:l((ge=e.shortcuts)!=null?ge:e.presets),onSelect:(Se,ye)=>{const V=Wn($);Z(Se,null),ue({scrollState:V}),q(ye)&&F()}}),f=_.div({class:"cms-time-footer"},_.div({class:"cms-time-value"},...J(s,"value",{value:h,displayValue:P},P||J(s,"default",{},n))),_.div({class:"cms-time-actions"},_.button({type:"button",class:"cms-time-action",onClick:R},l(e.nowLabel)||"Ora"),l(e.clearable)!==!1?_.button({type:"button",class:"cms-time-action",onClick:()=>Z(null,null,{commit:!l(e.confirm)})},l(e.clearLabel)||"Reset"):null,l(e.confirm)?_.button({type:"button",class:"cms-time-action is-primary",onClick:g},l(e.applyLabel)||"Applica"):null));$.replaceChildren(_.div({class:"cms-time-panel-root",onKeydown:Se=>{Se.key==="Escape"&&(Se.preventDefault(),F())}},j,L,f))};function m(){var h,P,j,U;return D||l(e.disabled)||l(e.readonly)||(ie=it(G),D=JSswift.overlay.open(()=>($=_.div({class:Dt(["cms-time-panel",l(o),e.panelClass])}),d(),$),{type:"time",anchorEl:oe._control||se,placement:e.placement||"bottom-start",offsetX:(h=e.offsetX)!=null?h:0,offsetY:(j=(P=e.offsetY)!=null?P:e.offset)!=null?j:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:e.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Dt(["cms-time-overlay",e.panelClass]),onClose:()=>{var ce;D=null,$=null,M(),(ce=e.onClose)==null||ce.call(e)}}),e.panelStyle&&Object.assign(D.panel.style,e.panelStyle),bn(D),ue(),M(),(U=e.onOpen)==null||U.call(e)),D}function F(){if(!D)return;const h=D;yn(h,()=>JSswift.overlay.close(h.id))}return se.addEventListener("focus",h=>{var P;(P=e.onFocus)==null||P.call(e,h),e.openOnFocus!==!1&&m()}),se.addEventListener("click",h=>{var P;(P=e.onClick)==null||P.call(e,h),m()}),se.addEventListener("keydown",h=>{if(h.key==="Escape"){D&&(h.preventDefault(),F());return}(h.key==="ArrowDown"||h.key==="Enter"||h.key===" ")&&(h.preventDefault(),m()),(h.key==="Backspace"||h.key==="Delete")&&!l(e.manualInput)&&l(e.clearable)!==!1&&(h.preventDefault(),Z(null,h,{commit:!0}))}),l(e.manualInput)?(se.addEventListener("input",h=>{var P;return(P=e.onTyping)==null?void 0:P.call(e,se.value,h)}),se.addEventListener("change",h=>Z(se.value,h)),se.addEventListener("blur",h=>{var P;(P=e.onBlur)==null||P.call(e,h),se.value===""?Z(null,h):Z(se.value,h)})):se.addEventListener("blur",h=>{var P;return(P=e.onBlur)==null?void 0:P.call(e,h)}),b&&b.watch(h=>{const P=it(S(h));Q(P)!==Q(G)&&(G=it(P),ie=it(P),M(),d())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!b&&e.value!=null&&(G=it(S(l(e.value))),ie=it(G)),M(),d(),D&&l(e.disabled)&&F()},"UI.Time:render"),oe._input=se,oe._time=se,oe._open=m,oe._close=F,oe._getValue=()=>z(G),oe._setValue=h=>Z(h,null,{emit:!1,commit:!0}),oe._panel=()=>(D==null?void 0:D.panel)||null,oe},he.Tabs=(...t)=>{var k,A,H,ge,Se,ye;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(V,O)=>!!V&&Object.prototype.hasOwnProperty.call(V,O),r=V=>String(l(V)||"horizontal").toLowerCase()==="vertical"?"vertical":"horizontal",y=V=>{const O=String(l(V)||"").toLowerCase();return O==="pills"||O==="pill"?"pills":O==="soft"||O==="card"?"soft":"line"},u=V=>{var K;const O=l(V);return O==null||O===""?null:(K=JSswift.uiColors)!=null&&K.includes(O)?`var(--cms-${O})`:String(O)},i=(V,O)=>Object.is(V,O)||V!=null&&O!=null&&V==O,b=Nt(e.model,"UI.Tabs:model"),T=r(e.orientation||e.orient||e.direction),S=y(e.variant||(e.pills?"pills":e.soft?"soft":"line")),w=!!l((A=(k=e.fill)!=null?k:e.navFill)!=null?A:e.stretch),z=!!l(e.wrap),Q=!!l(e.disabled),G=e.id||"cms-tabs-"+Math.random().toString(36).slice(2,9),ie=l((H=e.tabs)!=null?H:e.items)||[],D=(Array.isArray(ie)?ie:[ie]).map((V,O)=>{var ee,xe,be,Ce,pe,Ie,_e,I,we,E,x,v,c,N;if(V==null)return null;if(typeof V!="object")return{raw:V,index:O,value:V,labelFallback:V,noteFallback:null,iconFallback:null,badgeFallback:null,disabled:!1,hidden:!1};const K=(Ie=(pe=(Ce=(be=(xe=(ee=V.value)!=null?ee:V.name)!=null?xe:V.id)!=null?be:V.key)!=null?Ce:V.label)!=null?pe:V.title)!=null?Ie:`tab-${O}`,ke=(E=(we=(I=(_e=V.label)!=null?_e:V.title)!=null?I:V.name)!=null?we:V.value)!=null?E:`Tab ${O+1}`,Ne=o(V,"badge")?V.badge:o(V,"counter")?V.counter:null;return{...V,raw:V,index:O,value:K,labelFallback:ke,noteFallback:(c=(v=(x=V.note)!=null?x:V.subtitle)!=null?v:V.description)!=null?c:null,iconFallback:(N=V.icon)!=null?N:null,badgeFallback:Ne}}).filter(Boolean).filter(V=>V.hidden!==!0&&V.visible!==!1),$=D.find(V=>!V.disabled)||null,Y=V=>D.findIndex(O=>i(O.value,V)),W=(V,O)=>{var ke;if(!D.length)return-1;let K=V;for(let Ne=0;Ne<D.length;Ne+=1)if(K+=O,K<0?K=D.length-1:K>=D.length&&(K=0),!((ke=D[K])!=null&&ke.disabled))return K;return-1},se=(V,O=!1)=>{var ke,Ne;const K=Y(V);return K>=0&&!((ke=D[K])!=null&&ke.disabled)?D[K].value:O?(Ne=$==null?void 0:$.value)!=null?Ne:null:V!=null?V:null},me=se(b?b.get():o(e,"value")?l(e.value):(ge=e.defaultValue)!=null?ge:e.default,!0),[re,oe]=JSswift.reactive.signal(me),le=ae(["cms-clear-set","cms-tabs","cms-singularity",T,`variant-${S}`,fe(e.dense,"dense"),fe(w,"fill"),fe(z,"wrap"),fe(Q,"disabled"),e.class]),te=JSswift.omit(e,["tabs","items","value","defaultValue","default","model","orientation","orient","direction","variant","pills","soft","fill","navFill","stretch","wrap","dense","disabled","slots","empty","gap","tabGap","align","justify","color","state","navClass","navStyle","barClass","barStyle","tabClass","tabStyle","itemClass","itemStyle","class","style"]);te.class=le,te.style={...e.style||{}},e.gap!=null&&(te.style["--cms-tabs-gap"]=Be(e.gap)),e.tabGap!=null&&(te.style["--cms-tabs-tab-gap"]=Be(e.tabGap));const M=u((Se=e.color)!=null?Se:e.state);M&&(te.style["--cms-tabs-accent"]=M);const Z=_.div(te),q=_.div({class:ae(["cms-tabs-bar",e.barClass]),style:{alignItems:e.align||(T==="vertical"?"stretch":"center"),justifyContent:e.justify||"flex-start",...e.barStyle||{}}}),ue=_.div({class:ae(["cms-tabs-nav",e.navClass]),style:e.navStyle||null,role:"tablist","aria-orientation":T}),R=[],g=()=>Y(re()),d=()=>{const V=g();return V>=0?D[V]:null},m=()=>({tabs:D,value:re(),active:re(),activeIndex:g(),activeTab:d(),orientation:T,variant:S,select:(V,O)=>h(V,{event:O,emit:!0}),next:()=>j(),prev:()=>U()}),F=(V,O,K)=>({...m(),tab:V,index:O,active:K,disabled:!!V.disabled,select:ke=>P(O,{event:ke,emit:!0})}),X=V=>{var K;const O=(K=R[V])==null?void 0:K.btn;!O||typeof O.focus!="function"||requestAnimationFrame(()=>O.focus())},a=V=>{const O=Y(V);Z.dataset.value=V==null?"":String(V),Z.dataset.activeIndex=O>=0?String(O):"",R.forEach(({btn:K,item:ke,tab:Ne,index:ee})=>{const xe=ee===O;ke.classList.toggle("active",xe),ke.classList.toggle("disabled",!!(Ne.disabled||Q)),K.classList.toggle("active",xe),K.setAttribute("aria-selected",xe?"true":"false"),K.setAttribute("tabindex",xe?"0":"-1")})},C=V=>{oe(V),a(V)},h=(V,O={})=>{if(Q)return null;const K=Y(V);return K<0?null:P(K,O)},P=(V,O={})=>{var xe,be;const K=D[V];if(!K||K.disabled||Q)return null;const ke=K.value,Ne=re(),ee=!i(Ne,ke);return C(ke),b&&!i(b.get(),ke)&&b.set(ke),O.focus&&X(V),O.event&&((xe=K.onClick)==null||xe.call(K,ke,O.event,K,V)),ee&&O.emit!==!1&&((be=e.onChange)==null||be.call(e,ke,K,O.event||null,V)),K},j=()=>{const V=W(g()<0?-1:g(),1);V>=0&&P(V,{emit:!0,focus:!0})},U=()=>{const V=g()<0?0:g(),O=W(V,-1);O>=0&&P(O,{emit:!0,focus:!0})},ce=(V,O)=>{var v,c,N,de,Ae,Je;const K=O===g(),ke=F(V,O,K),Ne=`${G}-tab-${O}`,ee=V.iconFallback!=null?typeof V.iconFallback=="string"?he.Icon({name:V.iconFallback,size:(N=(c=(v=V.iconSize)!=null?v:V.size)!=null?c:e.size)!=null?N:null}):V.iconFallback:null,xe=J(s,"icon",ke,ee),be=J(null,"default",{},JSswift.ui.renderSlot(s,"label",ke,V.labelFallback)),Ce=J(s,"note",ke,V.noteFallback),pe=J(s,"badge",ke,V.badgeFallback),Ie=_.span({class:"cms-tabs-tab-inner"},xe.length?_.span({class:"cms-tabs-tab-icon"},...xe):null,_.span({class:"cms-tabs-tab-copy"},_.span({class:"cms-tabs-tab-label"},...be.length?be:[""]),Ce.length?_.span({class:"cms-tabs-tab-note"},...Ce):null),pe.length?_.span({class:"cms-tabs-tab-badge"},...pe):null),_e=J(s,"tab",{...ke,tabId:Ne,label:be,icon:xe,note:Ce,badge:pe},Ie),I=B=>{var De;if(V.disabled||Q)return;const Le=B.key;if(Le==="Enter"||Le===" "){B.preventDefault(),P(O,{event:B,emit:!0});return}if(Le==="Home"){B.preventDefault();const Ue=D.findIndex(Ye=>!Ye.disabled);Ue>=0&&P(Ue,{event:B,emit:!0,focus:!0});return}if(Le==="End"){B.preventDefault();let Ue=-1;for(let Ye=D.length-1;Ye>=0;Ye-=1)if(!((De=D[Ye])!=null&&De.disabled)){Ue=Ye;break}Ue>=0&&P(Ue,{event:B,emit:!0,focus:!0});return}const Me=T==="vertical"?["ArrowUp"]:["ArrowLeft"],Ee=T==="vertical"?["ArrowDown"]:["ArrowRight"];if(Me.includes(Le)){B.preventDefault();const Ue=W(O,-1);Ue>=0&&P(Ue,{event:B,emit:!0,focus:!0});return}if(Ee.includes(Le)){B.preventDefault();const Ue=W(O,1);Ue>=0&&P(Ue,{event:B,emit:!0,focus:!0})}},we=u((de=V.color)!=null?de:V.state),E=_.div({class:ae(["cms-tabs-item",fe(K,"active"),fe(V.disabled||Q,"disabled"),e.itemClass,V.itemClass]),style:{...we?{"--cms-tabs-item-accent":we}:{},...e.itemStyle||{},...V.itemStyle||{}},"data-name":String(V.value)}),x=he.Btn({class:ae(["cms-tabs-tab",fe(K,"active"),fe(V.disabled||Q,"disabled"),e.tabClass,V.tabClass||V.class]),type:"button",id:Ne,role:"tab",disabled:!!(V.disabled||Q),"aria-selected":K?"true":"false",tabindex:K?"0":"-1",size:(Je=(Ae=V.size)!=null?Ae:e.size)!=null?Je:null,style:{...e.tabStyle||{},...V.tabStyle||{}},onClick:B=>{P(O,{event:B,emit:!0})},onKeydown:I},..._e);return E.appendChild(x),E.appendChild(_.span({class:"tab-indicator"})),R[O]={tab:V,index:O,item:E,btn:x},E};if(D.length){const V=D.map((K,ke)=>ce(K,ke)),O=JSswift.ui.renderSlot(s,"nav",{...m(),nodes:V},V);J(null,"default",{},O).forEach(K=>ue.appendChild(K))}else J(s,"empty",m(),(ye=e.empty)!=null?ye:_.div({class:"cms-tabs-empty"},"Nessuna tab disponibile.")).forEach(V=>ue.appendChild(V));const L=m(),f=[...J(null,"default",{},JSswift.ui.renderSlot(s,"extra",L,null)),...J(s,"default",L,n)];return q.appendChild(ue),f.length&&q.appendChild(_.div({class:"cms-tabs-extra"},...f)),Z.appendChild(q),C(me),b?b.watch(V=>{C(se(V,!0))},"UI.Tabs:watch"):at(e.value)&&He.reactive.effect(()=>{C(se(l(e.value),!0))},"UI.Tabs:value"),Z._getValue=()=>re(),Z._setValue=V=>h(V,{emit:!0}),Z._select=V=>h(V,{emit:!0}),Z._next=()=>j(),Z._prev=()=>U(),Z._getTabs=()=>D.slice(),Ke(Z,e),Z},he.RouteTab=(...t)=>{var X,a,C,h,P,j,U,ce,L,f,k,A,H,ge,Se;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=JSswift.router||(He==null?void 0:He.router)||null,r=ye=>Object.prototype.hasOwnProperty.call(e,ye),y=r("active")||r("selected"),u=ye=>{const V=String(l(ye)||"").toLowerCase();return V==="pill"||V==="pills"?"pills":V==="soft"||V==="card"?"soft":"line"},i=ye=>{var O;const V=l(ye);return V==null||V===""?null:(O=JSswift.uiColors)!=null&&O.includes(V)?`var(--cms-${V})`:String(V)},b=ye=>{if(ye==null||ye==="")return"";try{return new URL(String(ye),window.location.origin).pathname||""}catch(V){return String(ye).split(/[?#]/)[0]||""}},T=ye=>l(e.external)===!0?!0:ye?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(ye)):!1,S=()=>{var ye;return l((ye=e.href)!=null?ye:e.to)||"#"},w=()=>{var ye;return l((ye=e.to)!=null?ye:e.href)||""},z=()=>{try{if(o!=null&&o.current)return o.current().pathname||window.location.pathname||""}catch(ye){}return window.location.pathname||""},Q=()=>{var ee,xe,be;const ye=w();if(!ye)return!1;const V=l((xe=(ee=e.match)!=null?ee:e.activeMatch)!=null?xe:e.routeMatch),O=String(l((be=e.matchMode)!=null?be:e.startsWith?"startsWith":e.exact?"exact":"")||"").toLowerCase(),K=z();if(typeof V=="function")return!!V({currentPath:K,to:ye,href:S(),router:o,props:e});if(V instanceof RegExp)return V.test(K);const ke=b(typeof V=="string"&&!["exact","startsWith","prefix","section"].includes(V.toLowerCase())?V:ye);if(!ke)return!1;const Ne=O||(typeof V=="string"&&["startsWith","prefix","section"].includes(V.toLowerCase())?"startsWith":"exact");return Ne==="startswith"||Ne==="prefix"||Ne==="section"?K===ke||K.startsWith(`${ke}/`):o!=null&&o.isActive?!!o.isActive(ye):K===ke},G=()=>!!l(e.disabled);let ie=null;const D=()=>{var ye;return ie!=null?!!ie:y?!!l((ye=e.active)!=null?ye:e.selected):Q()},$=u(e.variant||(e.pills?"pills":e.soft?"soft":"line")),Y=!l(e.color)&&l(e.state)?mt(l(e.state)):"",W=Y?`cms-state-${Y}`:"",se=JSswift.omit(e,["active","selected","label","title","text","to","icon","iconRight","iconSize","note","subtitle","caption","description","badge","counter","count","aside","trailing","slots","state","color","dense","outline","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","variant","pills","soft","block","fill","match","matchMode","activeMatch","routeMatch","exact","startsWith","external","onNavigate"]);se.href=S(),se.class=ae(["cms-route-tab","cms-clear-set","cms-singularity",`variant-${$}`,fe((X=e.block)!=null?X:e.fill,"block"),fe(e.dense,"dense"),W,e.class]),se.style={...e.style||{}};const me=i((a=e.color)!=null?a:e.state);me&&(se.style["--cms-route-tab-accent"]=me);const re=(h=(C=e.iconSize)!=null?C:e.size)!=null?h:null,oe=(ye,V)=>{const O=l(ye);return O==null||O===!1||O===""?null:typeof O=="string"?he.Icon({name:O,size:re}):JSswift.ui.slot(O,{as:V})},le=()=>({active:D(),disabled:G(),href:S(),to:w(),external:T(S()),navigate:ye=>{var K,ke;if(G())return!1;const V=w();return!T(S())&&V&&(o!=null&&o.navigate)?(ye!=null&&ye.preventDefault&&ye.preventDefault(),o.navigate(V),(K=e.onNavigate)==null||K.call(e,V,ye||null),!0):((ke=e.onNavigate)==null||ke.call(e,V||S(),ye||null),!1)}}),te=J(s,"icon",le(),oe(e.icon,"icon")),M=J(s,"label",le(),(U=(j=(P=e.label)!=null?P:e.title)!=null?j:e.text)!=null?U:n),Z=J(s,"note",le(),(f=(L=(ce=e.note)!=null?ce:e.subtitle)!=null?L:e.caption)!=null?f:e.description),q=J(s,"badge",le(),(A=(k=e.badge)!=null?k:e.counter)!=null?A:e.count),ue=J(s,"aside",le(),(ge=(H=e.aside)!=null?H:e.trailing)!=null?ge:oe(e.iconRight,"iconRight")),R=J(s,"default",le(),(Se=e.content)!=null?Se:e.body),g=_.span({class:"cms-route-tab-inner"},te.length?_.span({class:"cms-route-tab-icon"},...te):null,_.span({class:"cms-route-tab-copy"},_.span({class:"cms-route-tab-label"},...M.length?M:[w()||S()||""]),Z.length?_.span({class:"cms-route-tab-note"},...Z):null,R.length?_.span({class:"cms-route-tab-extra"},...R):null),q.length?_.span({class:"cms-route-tab-badge"},...q):null,ue.length?_.span({class:"cms-route-tab-aside"},...ue):null),d=_.a(se,g);Ke(d,e);const m=()=>{const ye=D(),V=G(),O=S(),K=T(O);d.classList.toggle("active",ye),d.classList.toggle("is-disabled",V),d.classList.toggle("is-external",K),ye?d.setAttribute("aria-current",String(l(e.ariaCurrent)||"page")):d.removeAttribute("aria-current"),d.setAttribute("href",O||"#"),V?(d.setAttribute("aria-disabled","true"),d.tabIndex=-1):(d.removeAttribute("aria-disabled"),!r("tabIndex")&&!r("tabindex")&&d.removeAttribute("tabindex")),w()?d.dataset.to=String(w()):delete d.dataset.to,K&&d.target==="_blank"&&!d.rel&&(d.rel="noopener noreferrer")},F=e.onClick;return d.onclick=ye=>{if(F==null||F(ye),!ye.defaultPrevented){if(G()){ye.preventDefault();return}le().navigate(ye)}},!y&&w()&&(o!=null&&o.subscribe)&&o.subscribe(()=>m()),JSswift.reactive.effect(()=>{m()},"UI.RouteTab:render"),d._isActive=()=>D(),d._setActive=ye=>(ie=ye==null?null:!!ye,m(),d),d._navigate=ye=>le().navigate(ye),d},he.Breadcrumbs=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=JSswift.router||(He==null?void 0:He.router)||null,r=Nt(e.model,"UI.Breadcrumbs:model"),y=qe(e.size,()=>{var Z;const M=l(e.size);return typeof M=="string"&&((Z=JSswift.uiSizes)!=null&&Z.includes(M))?`cms-size-${M}`:""}),u=qe(e.variant,()=>{const M=String(l(e.variant||(e.pills?"pills":e.soft?"soft":"line"))||"").toLowerCase();return M==="pill"||M==="pills"?"variant-pills":M==="soft"||M==="card"?"variant-soft":"variant-line"}),i=qe([e.wrap,e.nowrap],()=>l(e.wrap)===!1||l(e.nowrap)?"no-wrap":""),b=_.nav({class:ae(["cms-breadcrumbs","cms-clear-set",y,u,i,fe(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),T=_.div({class:"cms-breadcrumbs-before"}),S=_.ol({class:"cms-breadcrumbs-list"}),w=_.div({class:"cms-breadcrumbs-after"});b.appendChild(T),b.appendChild(S),b.appendChild(w);const z=M=>{var q;const Z=l(M);return Z==null||Z===""?null:(q=JSswift.uiColors)!=null&&q.includes(Z)?`var(--cms-${Z})`:String(Z)},Q=M=>{var q;if(!M)return!1;if(l(M.external)===!0)return!0;const Z=l((q=M.href)!=null?q:M.to);return Z?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Z)):!1},G=M=>M!=null&&M.nodeType&&M.cloneNode?M.cloneNode(!0):M,ie=(M,Z)=>{M.innerHTML="",Z.forEach(q=>M.appendChild(q))},D=(M,Z,q,ue,R=null)=>{const g=JSswift.ui.getSlot(M,Z)!=null?J(M,Z,q,ue):[];return g.length?g:R&&JSswift.ui.getSlot(M,R)!=null?J(M,R,q,ue):J(null,"default",q,ue)},$=(M,Z,q)=>{const ue=l(M);return ue==null||ue===!1||ue===""?null:typeof ue=="string"?he.Icon({name:ue,size:Z}):JSswift.ui.slot(ue,{as:q})},Y=()=>{var R,g;const M=r?r.get():l((g=(R=e.items)!=null?R:e.value)!=null?g:e.breadcrumbs),Z=[],q=d=>{if(!(d==null||d===!1)){if(Array.isArray(d)){d.forEach(q);return}if(typeof d=="string"||typeof d=="number"){Z.push({label:String(d)});return}if(d!=null&&d.nodeType||typeof d=="function"){Z.push({label:d});return}Z.push(d)}},ue=l(e.home);return ue&&q(ue===!0?{label:"Home",to:"/",icon:"home"}:ue),q(M),!Z.length&&(n!=null&&n.length)&&n.forEach(d=>q(d)),Z.filter(d=>!l(d==null?void 0:d.hidden))},W=M=>{const Z=M.findIndex(q=>{var ue,R;return!!l((R=(ue=q==null?void 0:q.current)!=null?ue:q==null?void 0:q.active)!=null?R:q==null?void 0:q.selected)});return Z>-1?Z:l(e.autoCurrent)===!1?-1:M.length?M.length-1:-1},se=M=>{var m,F,X,a,C,h,P;const Z=Number(l((X=(F=(m=e.max)!=null?m:e.maxItems)!=null?F:e.collapseAfter)!=null?X:e.collapse)),q=Number.isFinite(Z)?Math.max(0,Math.trunc(Z)):0;if(!q||q<3||M.length<=q)return M.map((j,U)=>({type:"item",item:j,index:U,key:`item-${U}`}));let ue=Number(l((C=(a=e.leadingCount)!=null?a:e.keepStart)!=null?C:1)),R=Number(l((P=(h=e.trailingCount)!=null?h:e.keepEnd)!=null?P:Math.max(1,q-2)));if(ue=Number.isFinite(ue)?Math.max(1,Math.trunc(ue)):1,R=Number.isFinite(R)?Math.max(1,Math.trunc(R)):Math.max(1,q-2),ue+R+1>q&&(R=Math.max(1,q-ue-1),ue+R+1>q&&(ue=Math.max(1,q-R-1))),ue+R>=M.length)return M.map((j,U)=>({type:"item",item:j,index:U,key:`item-${U}`}));const g=[];for(let j=0;j<ue;j++)g.push({type:"item",item:M[j],index:j,key:`item-${j}`});const d=M.slice(ue,M.length-R);g.push({type:"collapsed",key:`collapsed-${ue}-${M.length-R}`,items:d,from:ue,to:M.length-R-1});for(let j=M.length-R;j<M.length;j++)g.push({type:"item",item:M[j],index:j,key:`item-${j}`});return g},me=(M,Z=null)=>{var R,g,d,m,F;if(!M)return!1;const q=l((R=M.href)!=null?R:M.to)||"",ue=l(M.to)||"";return!Q(M)&&ue&&(o!=null&&o.navigate)?(Z!=null&&Z.preventDefault&&Z.preventDefault(),o.navigate(ue),(g=M.onNavigate)==null||g.call(M,ue,Z||null),(d=e.onNavigate)==null||d.call(e,ue,M,Z||null),!0):((m=M.onNavigate)==null||m.call(M,ue||q,Z||null),(F=e.onNavigate)==null||F.call(e,ue||q,M,Z||null),!1)},re=(M,Z,q)=>{var F,X,a;const ue=M,R=q[Z+1]||null,g={index:Z,entry:M,previous:ue,next:R},d=G(l((a=(X=(M==null?void 0:M.type)==="item"?(F=M.item)==null?void 0:F.separator:null)!=null?X:e.separator)!=null?a:"/")),m=D(s,"separator",g,d);return _.li({class:"cms-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"cms-breadcrumbs-separator"},...m))},oe=(M,Z,q)=>{const ue={type:"collapsed",collapsed:!0,items:Z,hiddenItems:M.items,currentIndex:q,from:M.from,to:M.to},R=_.span({class:"cms-breadcrumb cms-breadcrumb-collapsed"},_.span({class:"cms-breadcrumb-inner"},_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},String(l(e.collapsedLabel)||"\u2026"))))),g=D(s,"collapsed",ue,R,"item");return _.li({class:"cms-breadcrumbs-entry is-collapsed"},...g)},le=(M,Z,q,ue)=>{var ee,xe,be,Ce,pe,Ie,_e,I,we,E,x,v,c,N,de,Ae,Je,B,Le,Me,Ee,De,Ue,Ye,Ze,Qe;const R=M.item||{},g=R.slots?{...s,...R.slots}:s,d=l((ee=R.href)!=null?ee:R.to)||"",m=!!l(R.disabled),F=M.index===q,X=(Ce=(be=(xe=R.iconSize)!=null?xe:e.itemSize)!=null?be:e.size)!=null?Ce:null,a=z((_e=(Ie=(pe=R.color)!=null?pe:R.state)!=null?Ie:e.color)!=null?_e:e.state),C=!l(R.color)&&l(R.state)?mt(l(R.state)):"",h=(v=(x=(E=(we=(I=R.label)!=null?I:R.title)!=null?we:R.text)!=null?E:R.to)!=null?x:R.href)!=null?v:"",P=(de=(N=(c=R.note)!=null?c:R.subtitle)!=null?N:R.caption)!=null?de:R.description,j=(Je=(Ae=R.badge)!=null?Ae:R.counter)!=null?Je:R.count,U=(Le=(B=R.aside)!=null?B:R.trailing)!=null?Le:$(R.iconRight,X,"iconRight"),ce=(Me=R.content)!=null?Me:R.body,L={item:R,index:M.index,visibleIndex:ue,total:Z.length,current:F,active:F,disabled:m,href:d,to:l(R.to)||"",external:Q(R),isFirst:M.index===0,isLast:M.index===Z.length-1,navigate:Te=>me(R,Te)},f=D(g,"icon",L,$(R.icon,X,"icon")),k=D(g,"label",L,h),A=D(g,"note",L,P),H=D(g,"badge",L,j),ge=D(g,"aside",L,U),Se=D(g,"default",L,ce),ye=_.span({class:"cms-breadcrumb-inner"},f.length?_.span({class:"cms-breadcrumb-icon"},...f):null,_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},...k.length?k:[d||""]),A.length?_.span({class:"cms-breadcrumb-note"},...A):null,Se.length?_.span({class:"cms-breadcrumb-extra"},...Se):null),H.length?_.span({class:"cms-breadcrumb-badge"},...H):null,ge.length?_.span({class:"cms-breadcrumb-aside"},...ge):null),V=!m&&(!F||!!l((Ee=R.linkCurrent)!=null?Ee:e.linkCurrent)),O={class:ae(["cms-breadcrumb","cms-clear-set","cms-singularity",fe(F,"is-current"),fe(F,"active"),fe(m,"is-disabled"),C?`cms-state-${C}`:"",R.class]),style:{...R.style||{}},"aria-current":F?String(l((De=R.ariaCurrent)!=null?De:e.ariaCurrent)||"page"):null};a&&(O.style["--cms-breadcrumb-accent"]=a);let K=null;V&&d?(K=_.a({...O,href:d,target:R.target,rel:R.rel,onClick:Te=>{var je,tt;(je=R.onClick)==null||je.call(R,Te,L),(tt=e.onItemClick)==null||tt.call(e,R,L,Te),!Te.defaultPrevented&&L.navigate(Te)}},ye),L.external&&K.target==="_blank"&&!K.rel&&(K.rel="noopener noreferrer")):V&&typeof R.onClick=="function"?K=_.button({...O,type:R.type||"button",onClick:Te=>{var je,tt;(je=R.onClick)==null||je.call(R,Te,L),(tt=e.onItemClick)==null||tt.call(e,R,L,Te)}},ye):K=_.span({...O,"aria-disabled":m?"true":null},ye),Ke(K,{size:(Ye=(Ue=R.size)!=null?Ue:e.itemSize)!=null?Ye:e.size,radius:(Ze=R.radius)!=null?Ze:e.radius,gradient:(Qe=R.gradient)!=null?Qe:e.gradient});const Ne=D(g,"item",L,K);return _.li({class:ae(["cms-breadcrumbs-entry",fe(F,"is-current"),fe(m,"is-disabled")])},...Ne)},te=()=>{var g;const M=Y(),Z=W(M),q=se(M),ue=z((g=e.color)!=null?g:e.state);b.classList.toggle("is-empty",M.length===0),ue?b.style.setProperty("--cms-breadcrumb-accent",ue):b.style.removeProperty("--cms-breadcrumb-accent");const R={items:M,visibleItems:q,currentIndex:Z,count:M.length,collapsed:q.some(d=>d.type==="collapsed")};if(ie(T,D(s,"before",R,e.before)),ie(w,D(s,"after",R,e.after)),S.innerHTML="",!M.length){const d=D(s,"empty",R,e.empty);d.length&&S.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...d));return}q.forEach((d,m)=>{m>0&&S.appendChild(re(q[m-1],m-1,q)),S.appendChild(d.type==="collapsed"?oe(d,M,Z):le(d,M,Z,m))})};return He.reactive.effect(()=>{te()},"UI.Breadcrumbs:render"),b.getItems=()=>Y(),b.getVisibleItems=()=>se(Y()),b.refresh=()=>(te(),b),b.setItems=M=>(r?r.set(M):e.items=M,te(),b),Ke(b,e),b},he.Pagination=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=e.slots||{},s=Nt(e.model,"UI.Pagination:model"),o=qe(e.size,()=>{const a=l(e.size);return typeof a=="string"&&kn[a]?`cms-size-${a}`:""}),r=_.nav({class:ae(["cms-pagination","cms-clear-set",o,fe(e.dense,"dense"),fe(e.simple,"is-simple"),fe(e.disabled,"is-disabled"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Pagination"}),y=_.div({class:"cms-pagination-controls"}),u=_.div({class:"cms-pagination-start"}),i=_.div({class:"cms-pagination-pages"}),b=_.div({class:"cms-pagination-end"}),T=_.div({class:"cms-pagination-summary"});y.appendChild(u),y.appendChild(i),y.appendChild(b),r.appendChild(y),r.appendChild(T);let S=1,w=1;const z=(a,C=0)=>{const h=l(a);if(h==null||h==="")return C;const P=Number(h);return Number.isFinite(P)?Math.trunc(P):C},Q=(a,C=G())=>{const h=Number(a),P=Number.isFinite(h)?Math.trunc(h):1;return Math.min(Math.max(P||1,1),Math.max(1,C||1))},G=()=>{var P,j,U,ce,L,f,k;const a=z((U=(j=(P=e.max)!=null?P:e.pages)!=null?j:e.pageCount)!=null?U:e.totalPages,0);if(a>0)return a;const C=z((L=(ce=e.total)!=null?ce:e.totalItems)!=null?L:e.count,0),h=z((k=(f=e.pageSize)!=null?f:e.perPage)!=null?k:e.limit,0);return C>=0&&h>0?Math.max(1,Math.ceil(C/h)):1},ie=()=>{var a,C,h;return z(s?s.get():(h=(C=(a=e.page)!=null?a:e.value)!=null?C:e.current)!=null?h:e.currentPage,1)},D=()=>{var a,C;return Math.max(0,z((C=(a=e.siblings)!=null?a:e.siblingCount)!=null?C:e.window,1))},$=()=>{var a,C;return Math.max(0,z((C=(a=e.boundaryCount)!=null?a:e.boundaries)!=null?C:e.edges,1))},Y=()=>!!l(e.disabled),W=()=>{var a;return l((a=e.showSummary)!=null?a:e.showLabel)!==!1},se=()=>l(e.showPages)!==!1&&!l(e.simple),me=()=>l(e.showPrev)!==!1,re=()=>l(e.showNext)!==!1,oe=()=>!!l(e.showEdges),le=()=>{const a=l(e.showFirst);return a==null?oe():!!a},te=()=>{const a=l(e.showLast);return a==null?oe():!!a},M=()=>!!l(e.hideOnSinglePage),Z=()=>{var h,P;const a=l((P=(h=e.total)!=null?h:e.totalItems)!=null?P:e.count);if(a==null||a==="")return null;const C=Number(a);return Number.isFinite(C)?Math.max(0,Math.trunc(C)):null},q=()=>{var h,P;const a=l((P=(h=e.pageSize)!=null?h:e.perPage)!=null?P:e.limit);if(a==null||a==="")return null;const C=Number(a);return Number.isFinite(C)&&C>0?Math.trunc(C):null},ue=(a=S,C=w)=>{const h=Z(),P=q(),j=h!=null&&P?h===0?0:(a-1)*P+1:null,U=h!=null&&P?Math.min(h,a*P):null;return{page:a,value:a,current:a,currentPage:a,pages:C,max:C,total:h,pageSize:P,from:j,to:U,disabled:Y(),isFirst:a<=1,isLast:a>=C,canPrev:a>1,canNext:a<C,setPage:(ce,L)=>X(ce,L),prev:ce=>X(a-1,ce),next:ce=>X(a+1,ce),first:ce=>X(1,ce),last:ce=>X(C,ce)}},R=(a,C)=>{if(C<=0)return[];const h=[],P=new Set,j=$(),U=D();for(let L=1;L<=Math.min(j,C);L++)P.add(L);for(let L=Math.max(1,a-U);L<=Math.min(C,a+U);L++)P.add(L);for(let L=Math.max(1,C-j+1);L<=C;L++)P.add(L);let ce=0;for(let L=1;L<=C;L++)P.has(L)&&(ce&&L-ce>1&&h.push({type:"ellipsis",key:`ellipsis-${ce}-${L}`}),h.push({type:"page",page:L,key:`page-${L}`}),ce=L);return h.length||h.push({type:"page",page:1,key:"page-1"}),h},g=(a,C,h,P=null)=>{const j=JSswift.ui.getSlot(n,a)!=null?J(n,a,h,C):[];return j.length?j:P&&JSswift.ui.getSlot(n,P)!=null?J(n,P,h,C):J(null,"default",h,C)},d=(a,C)=>{a.innerHTML="",C.forEach(h=>a.appendChild(h))},m=(a,C,h,P={})=>{var U;const j={...ue(),kind:a,active:!!P.active};return he.Btn({class:ae(["cms-pagination-btn",`cms-pagination-${a}`,fe(P.active,"active"),P.class]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:P.active?e.color||e.state||"primary":P.color||null,outline:P.active?!1:(U=P.outline)!=null?U:!0,disabled:Y()||!!P.disabled,"aria-current":P.active?"page":null,onClick:ce=>{Y()||P.disabled||h==null||h(ce)}},...g(a,C,j,a==="summary"?"label":a==="page"?"item":null))},F=(a,C)=>{S=Q(a,C),w=Math.max(1,C||1);const h=ue(S,w);r.style.display=M()&&w<=1?"none":"",T.style.display=W()?"":"none",i.style.display=se()?"":"none",u.innerHTML="",i.innerHTML="",b.innerHTML="";const P=g("start",e.start,h);P.length&&u.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-start"},...P)),le()&&u.appendChild(m("first","\xAB",ce=>X(1,ce),{disabled:S<=1})),me()&&u.appendChild(m("prev","Prev",ce=>X(S-1,ce),{disabled:S<=1})),se()&&R(S,w).forEach(ce=>{if(ce.type==="ellipsis"){const k={...h,kind:"ellipsis"},A=g("ellipsis","\u2026",k);i.appendChild(_.span({class:"cms-pagination-ellipsis","aria-hidden":"true"},...A));return}const L=ce.page,f={...h,page:L,value:L,item:ce,active:L===S};i.appendChild(he.Btn({class:ae(["cms-pagination-btn","cms-pagination-page-btn",fe(L===S,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:L===S?e.color||e.state||"primary":null,outline:L!==S,disabled:Y(),"aria-current":L===S?"page":null,onClick:k=>X(L,k)},...g("page",String(L),f,"item")))}),re()&&b.appendChild(m("next","Next",ce=>X(S+1,ce),{disabled:S>=w})),te()&&b.appendChild(m("last","\xBB",ce=>X(w,ce),{disabled:S>=w}));const j=g("end",e.end,h);j.length&&b.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...j));let U=`Pagina ${S} di ${w}`;h.total!=null&&h.pageSize&&(U=h.total===0?"0 risultati":`${h.from}-${h.to} di ${h.total}`),d(T,g("summary",U,h,"label"))},X=(a,C=null)=>{var j,U;const h=G(),P=Q(a,h);return P===S&&h===w||(F(P,h),s&&s.get()!==P&&s.set(P),(j=e.onChange)==null||j.call(e,P,ue(P,h),C),(U=e.onPageChange)==null||U.call(e,P,ue(P,h),C)),P};return He.reactive.effect(()=>{const a=G(),C=ie(),h=Q(C,a);F(h,a),s&&C!==h&&s.set(h)},"UI.Pagination:sync"),r.getPage=()=>S,r.getPages=()=>w,r.setPage=a=>X(a),r.prev=()=>X(S-1),r.next=()=>X(S+1),r.first=()=>X(1),r.last=()=>X(w),Ke(r,e),r},he.Spinner=(...t)=>{var Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(W,se,me)=>{if(at(W))return()=>{const oe=l(W);if(oe==null||oe===!1||oe==="")return me;const le=se?se(oe):oe;return le==null||le===""?me:le};if(W==null||W===!1||W==="")return me;const re=se?se(W):W;return re==null||re===""?me:re},r=W=>{if(W==null||W===!1||W===""||mt(W))return"";const me=String(W).trim();return me?me.startsWith("#")||me.startsWith("rgb(")||me.startsWith("rgba(")||me.startsWith("hsl(")||me.startsWith("hsla(")||me.startsWith("var(")?me:Qt(me)?`var(--cms-${me})`:me:""},y=qe(e.state,()=>{const W=mt(l(e.state));return W?`cms-state-${W}`:""}),u=ae(["cms-spinner",y,fe(e.vertical,"vertical"),fe(e.reverse,"reverse"),fe(e.center,"center"),fe(e.block,"block"),fe(e.pause||e.paused,"paused"),e.class]),i=JSswift.omit(e,["ariaLabel","block","center","color","indicatorClass","indicatorStyle","label","note","pause","paused","reverse","size","slots","speed","state","thickness","trackColor","vertical"]);i.class=u;const b={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(b,"backgroundColor")&&delete b.backgroundColor,i.style=b,i.role==null&&(i.role="status"),i["aria-live"]==null&&(i["aria-live"]="polite"),i["aria-busy"]==null&&(i["aria-busy"]="true");const T={props:e},S=J(s,"label",T,e.label),w=J(s,"default",T,n),z=J(s,"note",T,e.note),Q=S.length||w.length||z.length;if(!Q){const W=l((Y=e.ariaLabel)!=null?Y:e["aria-label"]);W?i["aria-label"]=W:i["aria-label"]==null&&(i["aria-label"]="Loading")}const G=_.span({class:ae(["cms-spinner-indicator",e.indicatorClass]),style:{"--cms-spinner-size":o(e.size,Be,"18px"),"--cms-spinner-thickness":o(e.thickness,Be,"2px"),"--cms-spinner-speed":o(e.speed,W=>typeof W=="number"?`${W}ms`:String(W),"900ms"),"--cms-spinner-color":o(e.color,r,"var(--set-border-color, var(--cms-primary))"),"--cms-spinner-track":o(e.trackColor,r,"color-mix(in srgb, var(--cms-spinner-color) 18%, transparent)"),...e.indicatorStyle||{}},"aria-hidden":"true"}),ie=J(s,"indicator",T,G),D=[];ie.length&&D.push(...ie),Q&&D.push(_.div({class:"cms-spinner-content"},S.length?_.div({class:"cms-spinner-label"},...S):null,w.length?_.div({class:"cms-spinner-copy"},...w):null,z.length?_.div({class:"cms-spinner-note"},...z):null));const $=_.div(i,...D);return Ke($,e),$},he.Progress=(...t)=>{var A,H,ge,Se,ye,V,O,K,ke,Ne;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=e.model||(Lt(e.value)||Jt(e.value)?e.value:null),r=Nt(o,"UI.Progress:model"),y=qe([e.state,e.color],()=>{const ee=mt(l(e.state)||l(e.color));return ee?`cms-state-${ee}`:""}),u=(ee,xe)=>{const be=Number(ee);return Number.isFinite(be)?be:xe},i=()=>u(l(e.min),0),b=()=>{const ee=i(),xe=u(l(e.max),100);return xe<ee?ee:xe},T=()=>{var xe,be;const ee=l((be=(xe=e.height)!=null?xe:e.thickness)!=null?be:e.size);return ee==null||ee===""?"8px":typeof ee=="number"?`${ee}px`:typeof ee=="string"?{xxs:"4px",xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px",xxl:"16px",xxxl:"18px"}[ee]||ee:"8px"},S=(ee,xe="")=>{const be=l(ee);if(be==null||be===!1||be==="")return xe;const Ce=mt(be);return Ce?`var(--cms-${Ce})`:typeof be=="string"&&Qt(be)?`var(--cms-${be})`:String(be)},w=ee=>{const xe=i(),be=b(),Ce=u(ee,xe);return Math.min(be,Math.max(xe,Ce))},z=ee=>{const xe=i(),Ce=b()-xe;if(!Ce)return 0;const pe=(w(ee)-xe)/Ce,Ie=l(e.reverse)?1-pe:pe;return Math.max(0,Math.min(1,Ie))},Q=ee=>{const xe=w(ee);return xe<se()?se():xe},G=(ee,xe,be)=>{const Ce=e.formatValue;if(typeof Ce=="function"){const pe=Ce(ee,xe,be);if(pe!=null)return pe}return`${Math.round(xe)}%`},ie=ee=>{for(;ee.firstChild;)ee.removeChild(ee.firstChild)},D=(ee,xe,be="flex")=>{ie(ee),(xe||[]).forEach(Ce=>{if(!(Ce==null||Ce===!1)){if(Ce instanceof Node){ee.appendChild(Ce);return}ee.appendChild(document.createTextNode(String(Ce)))}}),ee.style.display=ee.childNodes.length?be:"none"},$=(ee,xe={})=>Ln(l(ee),xe),Y=(ee,xe,be={})=>{var pe;const Ce=l(ee);return Ce==null||Ce===!1||Ce===""?[]:typeof Ce=="string"?[he.Icon({name:Ce,size:(pe=e.iconSize)!=null?pe:16})]:$(Ce,{...be,as:xe})},W=ee=>Jt(ee)||Lt(ee)?l(ee):typeof ee=="function"&&ee.length===0?ee():ee,[se,me]=JSswift.reactive.signal(w(r?r.get():(H=(A=l(e.value))!=null?A:l(e.min))!=null?H:0)),[re,oe]=JSswift.reactive.signal(Q((ye=l(e.buffer))!=null?ye:r?r.get():(Se=(ge=l(e.value))!=null?ge:l(e.min))!=null?Se:0)),le=(ee,xe={})=>{const be=w(ee);return se()!==be&&me(be),re()<be&&oe(be),r&&xe.fromModel!==!0&&r.set(be),be},te=ee=>{const xe=Q(ee);return re()!==xe&&oe(xe),xe},M=JSswift.omit(e,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor"]),Z={width:l(e.width)||"100%",...e.style||{}},q=l(e.color);(q!=null||at(e.color))&&!mt(q||"")&&delete Z.backgroundColor,M.class=ae(["cms-progress-wrap",fe(e.dense,"dense"),fe(e.reverse,"is-reverse"),fe(e.indeterminate,"is-indeterminate"),y,e.class]),M.style=Z;const ue=_.div({class:"cms-progress-header"}),R=_.div({class:"cms-progress-heading"}),g=_.div({class:"cms-progress-label"}),d=_.div({class:"cms-progress-note"}),m=_.div({class:"cms-progress-value"});R.append(g,d),ue.append(R,m);const F=_.div({class:"cms-progress-body"}),X=_.span({class:"cms-progress-edge-label cms-progress-edge-label-left"}),a=_.div({class:"cms-progress",role:"progressbar"}),C=_.span({class:"cms-progress-buffer"}),h=_.span({class:ae(["cms-progress-bar","cms-singularity",y,fe(e.outline,"cms-outline"),fe(e.flat,"cms-flat"),fe(e.border,"cms-border"),fe(e.glossy,"cms-glossy"),fe(e.glow,"cms-glow"),fe(e.glass,"cms-glass"),fe(e.shadow,"cms-shadow"),qe(e.shadow,()=>{const ee=Dn(l(e.shadow));return ee?`cms-shadow-${ee}`:""}),fe(e.gradient,"cms-gradient"),fe(e.textGradient,"cms-text-gradient"),fe(e.lightShadow,"cms-light-shadow"),fe(e.striped,"is-striped"),fe(e.animated||e.indeterminate,"is-animated")])}),P=_.span({class:"cms-progress-bar-label"});h.appendChild(P),a.append(C,h);const j=_.span({class:"cms-progress-edge-label cms-progress-edge-label-right"});F.append(X,a,j);const U=_.div(M,ue,F);Ke(h,e);const ce=()=>{const ee=se(),xe=z(ee)*100,be={value:ee,percent:xe,min:i(),max:b(),buffer:re(),progress:U,track:a,bar:h,props:e},Ce=J(s,"icon",be,null),pe=Ce.length?[]:Y(e.icon,"icon",be),Ie=J(s,"label",be,W(e.label)),_e=Ie.length?Ie:J(s,"default",be,n),I=J(s,"iconRight",be,null),we=I.length?[]:Y(e.iconRight,"iconRight",be),E=J(s,"note",be,W(e.note)),x=e.valueLabel!=null?W(e.valueLabel):G(ee,xe,be),v=l(e.showValue),c=v===!0||e.valueLabel!=null||JSswift.ui.getSlot(s,"value")!=null?J(s,"value",be,x):[];D(g,[...pe,...Ce,..._e,...we,...I],"inline-flex"),D(d,E,"block"),D(m,v==="inside"?[]:c,"inline-flex"),ue.style.display=g.childNodes.length||d.childNodes.length||m.childNodes.length?"flex":"none"},L=()=>{var Ie,_e;const ee=se(),xe=z(ee)*100,be={value:ee,percent:xe,min:i(),max:b(),buffer:re(),progress:U,track:a,bar:h,props:e},Ce=W((Ie=e.startLabel)!=null?Ie:e.leftLabel),pe=W((_e=e.endLabel)!=null?_e:e.rightLabel);D(X,J(s,"startLabel",be,Ce),"inline-flex"),D(j,J(s,"endLabel",be,pe),"inline-flex")},f=()=>{const ee=se(),xe=z(ee)*100,be={value:ee,percent:xe,min:i(),max:b(),buffer:re(),progress:U,track:a,bar:h,props:e},Ce=l(e.showValue),pe=e.insideLabel!=null?W(e.insideLabel):G(ee,xe,be),Ie=Ce==="inside"||e.insideLabel!=null||JSswift.ui.getSlot(s,"inside")!=null?J(s,"inside",be,pe):[];D(P,Ie,"inline-flex")},k=()=>{const ee=se(),xe=re(),be=i(),Ce=b(),pe=z(ee)*100,Ie=z(xe)*100,_e=S(e.color,""),I=S(e.trackColor,_e?`color-mix(in srgb, ${_e} 14%, transparent)`:"rgba(255,255,255,0.08)"),we=S(e.bufferColor,_e?`color-mix(in srgb, ${_e} 30%, transparent)`:"rgba(255,255,255,0.16)"),E=l(e.ariaLabel),x=l(e.ariaValueText),v=!!l(e.indeterminate),c=l(e.radius);U.style.width=l(e.width)||"100%",U.style.setProperty("--cms-progress-height",T()),c!=null?typeof c=="number"?U.style.setProperty("--cms-progress-radius",`${c}px`):typeof c=="string"&&JSswift.uiSizes.includes(c)?U.style.setProperty("--cms-progress-radius",`var(--cms-r-${c})`):U.style.setProperty("--cms-progress-radius",String(c)):U.style.removeProperty("--cms-progress-radius"),a.style.background=I,C.style.background=we,C.style.width=`${Ie}%`,_e&&!mt(l(e.state)||l(e.color))?(h.style.setProperty("--set-background-color",_e),h.style.setProperty("--set-border-color",_e),h.style.setProperty("--set-color",l(e.textColor)||"var(--cms-on-primary, #fff)")):mt(l(e.state)||l(e.color))?(h.style.removeProperty("--set-background-color"),h.style.removeProperty("--set-border-color"),h.style.removeProperty("--set-color")):(h.style.setProperty("--set-background-color","var(--cms-primary)"),h.style.setProperty("--set-border-color","var(--cms-primary)"),h.style.setProperty("--set-color",l(e.textColor)||"var(--cms-on-primary, #fff)")),v?(h.style.width="",a.removeAttribute("aria-valuenow"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuemax")):(h.style.width=`${pe}%`,a.setAttribute("aria-valuemin",String(be)),a.setAttribute("aria-valuemax",String(Ce)),a.setAttribute("aria-valuenow",String(ee))),E!=null?a.setAttribute("aria-label",String(E)):typeof l(e.label)=="string"?a.setAttribute("aria-label",String(l(e.label))):a.removeAttribute("aria-label"),x!=null?a.setAttribute("aria-valuetext",String(x)):v?a.removeAttribute("aria-valuetext"):a.setAttribute("aria-valuetext",G(ee,pe,{value:ee,percent:pe,min:be,max:Ce,buffer:xe,progress:U,track:a,bar:h,props:e})),U.classList.toggle("has-start-label",X.childNodes.length>0),U.classList.toggle("has-end-label",j.childNodes.length>0),U.classList.toggle("has-inside-label",P.childNodes.length>0)};return r?(le(r.get(),{fromModel:!0}),r.watch(ee=>{le(ee,{fromModel:!0})},"UI.Progress:watch")):at(e.value)?JSswift.reactive.effect(()=>{le(l(e.value),{fromModel:!0})},"UI.Progress:value"):le((O=(V=e.value)!=null?V:e.min)!=null?O:0,{fromModel:!0}),at(e.buffer)?JSswift.reactive.effect(()=>{te(l(e.buffer))},"UI.Progress:buffer"):te((Ne=(ke=(K=e.buffer)!=null?K:e.value)!=null?ke:e.min)!=null?Ne:0),JSswift.reactive.effect(()=>{ce(),L(),f(),k()},"UI.Progress:render"),U._track=a,U._bar=h,U._buffer=C,U._getValue=se,U._getBuffer=re,U._setValue=ee=>le(ee),U._setBuffer=ee=>te(ee),U},he.LoadingBar=function(...e){var f,k;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),o=(A,H)=>{const ge=Number(A);return Number.isFinite(ge)?ge:H},r=()=>o(l(n.min),0),y=()=>{const A=r(),H=o(l(n.max),100);return H<A?A:H},u=A=>{const H=r(),ge=y(),Se=o(A,H);return Math.min(ge,Math.max(H,Se))},i=(A,H="")=>A==null||A===!1||A===""?H:typeof A=="number"?`${A}px`:String(A),b=A=>{const H=l(A);return!H||H===document?document.body:typeof H=="string"?document.querySelector(H)||document.body:H&&H.body instanceof HTMLElement?H.body:H instanceof HTMLElement?H:document.body},T=n.model||(Lt(n.value)||Jt(n.value)?n.value:null),S=Nt(T,"UI.LoadingBar:model"),w=Lt(n.buffer)||Jt(n.buffer)?n.buffer:null,z=Nt(w,"UI.LoadingBar:buffer"),Q=S?S.get():(f=l(n.value))!=null?f:r(),G=z?z.get():(k=l(n.buffer))!=null?k:Q,[ie,D]=JSswift.reactive.signal(u(Q)),[$,Y]=JSswift.reactive.signal(Math.max(u(G),u(Q))),[W,se]=JSswift.reactive.signal(n.visible!=null?!!l(n.visible):u(Q)>r()||!!l(n.indeterminate));let me=null,re=null;const oe=()=>{me&&(clearInterval(me),me=null)},le=()=>{re&&(clearTimeout(re),re=null)},te=(A,H={})=>{const ge=!!A;return W()!==ge&&se(ge),H.fromExternal!==!0&&typeof n.onVisibleChange=="function"&&n.onVisibleChange(ge),ge},M=(A,H={})=>{const ge=u(A);return ie()!==ge&&D(ge),$()<ge&&(Y(ge),z&&H.fromExternal!==!0&&z.set(ge)),S&&H.fromExternal!==!0&&S.set(ge),ge},Z=(A,H={})=>{const ge=Math.max(M(ie(),{fromExternal:!0}),u(A));return $()!==ge&&Y(ge),z&&H.fromExternal!==!0&&z.set(ge),ge},q=(A=ie())=>{n.visible==null&&(l(n.indeterminate)||A>r()?te(!0):l(n.hideOnZero)!==!1&&te(!1))},ue=()=>{if(oe(),l(n.trickle)===!1||l(n.indeterminate))return;const A=o(l(n.trickleInterval),280);A<=0||(me=setInterval(()=>{var ye,V;const H=ie(),ge=u((V=(ye=l(n.trickleTo))!=null?ye:l(n.trickleMax))!=null?V:92);if(H>=ge)return;const Se=o(l(n.trickleStep),H<45?12:H<75?7:3);M(Math.min(ge,H+Se))},A))},R=JSswift.omit(n,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor","target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);R.class=ae(["cms-loading-bar",n.class]),R.style={...n.style||{}};const g=JSswift.omit(n,["target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);g.class=ae(["cms-loading-bar-progress",n.progressClass,g.class]),g.style={...n.progressStyle||{}},g.value=[ie,D],g.buffer=[$,Y],g.dense==null&&(g.dense=!0),g.height==null&&g.thickness==null&&g.size==null&&(g.height=3),g.width==null&&(g.width="100%");const d=_.div(R),m=he.Progress(g,...s);d.appendChild(m);const F=A=>{le();const H=M(A);return q(H),d},X=A=>{le();const H=Z(A);return q(H),d},a=(A=(H=>(H=l(n.step))!=null?H:8)())=>{le();const ge=ie(),Se=M(ge+o(A,0));return q(Se),d},C=(A=(H=>(H=l(n.startValue))!=null?H:12)())=>{le();const ge=Math.max(ie(),u(A));return M(ge),Z(Math.max($(),ge)),q(ge),ue(),d},h=(A=(H=>(H=l(n.resetValue))!=null?H:r())())=>{le(),oe();const ge=u(A);return Z(ge),M(ge),q(ge),d},P=(A=(H=>(H=l(n.doneValue))!=null?H:y())())=>{var ye;le(),oe();const ge=u(A);Z(ge),M(ge),q(ge);const Se=Math.max(0,o((ye=l(n.hideDelay))!=null?ye:l(n.doneDelay),220));return re=setTimeout(()=>{h()},Se),d},j=(...A)=>P(...A),U=()=>(te(!0),d),ce=()=>(le(),oe(),te(!1),d),L=()=>(le(),oe(),d.remove(),null);return d.el=d,d._progress=m,d.get=()=>ie(),d.getBuffer=()=>$(),d.set=F,d.setBuffer=X,d.inc=a,d.start=C,d.done=P,d.complete=P,d.stop=j,d.reset=h,d.show=U,d.hide=ce,d.destroy=L,d._dispose=L,S?S.watch(A=>{M(A,{fromExternal:!0}),q(u(A))},"UI.LoadingBar:watch"):at(n.value)&&JSswift.reactive.effect(()=>{const A=u(l(n.value));M(A,{fromExternal:!0}),q(A)},"UI.LoadingBar:value"),z?z.watch(A=>{Z(A,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):at(n.buffer)&&JSswift.reactive.effect(()=>{Z(l(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const A=r(),H=y(),ge=Math.min(H,Math.max(A,ie())),Se=Math.max(ge,Math.min(H,Math.max(A,$())));ge!==ie()&&D(ge),Se!==$()&&Y(Se)},"UI.LoadingBar:range"),JSswift.reactive.effect(()=>{n.visible!=null&&te(l(n.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),JSswift.reactive.effect(()=>{var Ne;const A=l(n.position)||"fixed",H=l(n.inset),ge=l(n.top),Se=l(n.right),ye=l(n.bottom),V=l(n.left),O=l(n.width),K=n.visible!=null?!!l(n.visible):W(),ke=A==="static"||A==="relative";d.classList.toggle("is-visible",K),d.classList.toggle("is-inline",ke),d.classList.toggle("has-track",!!l(n.trackColor)),d.style.position=A,d.style.zIndex=String((Ne=l(n.zIndex))!=null?Ne:10002),d.style.width=i(O,ke?"100%":""),H!=null&&H!==""?(d.style.inset=i(H),d.style.removeProperty("top"),d.style.removeProperty("right"),d.style.removeProperty("bottom"),d.style.removeProperty("left")):(d.style.removeProperty("inset"),!ke&&A!=="sticky"?(d.style.top=i(ge,"0px"),d.style.right=i(Se,O==null||O===""?"0px":""),d.style.bottom=i(ye,""),d.style.left=i(V,"0px")):(d.style.top=i(ge,""),d.style.right=i(Se,""),d.style.bottom=i(ye,""),d.style.left=i(V,"")))},"UI.LoadingBar:layout"),Ke(d,n),l(n.mount)!==!1&&b(n.target).appendChild(d),l(n.autoStart)&&C(),d};const dl=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),$o=new Set(["soft","solid","outline"]),Vo={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},Bo={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},fl=t=>{const e=String(l(t)||"").trim().toLowerCase();return e?dl.has(e)?e:e==="top"?"top-right":e==="bottom"?"bottom-right":e==="left"?"bottom-left":e==="right"?"bottom-right":e==="center"?"bottom-center":"bottom-right":"bottom-right"},Ho=t=>{const e=String(l(t)||"").trim().toLowerCase();return $o.has(e)?e:"soft"},jo=(t,e)=>{const n=l(t);if(n===!1||n===null)return 0;if(n===!0||n===""||n===void 0)return e==="danger"?3500:2500;const s=Number(n);return Number.isFinite(s)&&s>=0?s:e==="danger"?3500:2500},Gt=(t={},e="")=>{var u,i,b,T,S,w,z,Q,G,ie,D,$,Y,W;const n=ln(t)?{...t}:{message:t},s=mt(l(e)||l(n.type)||l(n.state)||l(n.color)||"info")||"info",o=jo((i=(u=n.timeout)!=null?u:n.duration)!=null?i:n.delay,s),r=(S=(T=(b=n.closable)!=null?b:n.dismissible)!=null?T:n.dismiss!=null)!=null?S:o===0,y=n.title===void 0?n.label===void 0?Vo[s]:n.label:n.title;return{...n,type:s,state:s,title:y,message:(Q=(z=(w=n.message)!=null?w:n.content)!=null?z:n.text)!=null?Q:null,description:(D=(ie=(G=n.description)!=null?G:n.subtitle)!=null?ie:n.note)!=null?D:null,meta:(Y=($=n.meta)!=null?$:n.caption)!=null?Y:null,body:(W=n.body)!=null?W:null,timeout:o,closable:!!r,dismissLabel:n.dismissLabel||n.closeLabel||"Chiudi notifica",position:fl(n.position),variant:Ho(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},ml=(t,e="",n="")=>{if(!t.length)return Gt(n?{type:e,title:n}:{type:e});if(ln(t[0])){const{props:u,children:i}=JSswift.uiNormalizeArgs(t),b={...u};return!b.type&&!b.state&&!b.color&&e&&(b.type=e),b.title==null&&n&&(b.title=n),i.length&&(b.message==null&&b.description==null&&b.body==null&&i.length===1?b.message=i[0]:b.body==null&&(b.body=i.length===1?i[0]:i)),Gt(b,e)}const[s,o,r]=t;let y={};return ln(o)?y={...o,message:s}:ln(r)?y={...r,message:s,title:o}:y={message:s,title:o},e&&!y.type&&!y.state&&!y.color&&(y.type=e),y.title==null&&n&&(y.title=n),Gt(y,e)},Rt=(t,e)=>(...n)=>{var s,o;return(o=(s=He.services.notify)==null?void 0:s.show)==null?void 0:o.call(s,ml(n,t,e))},Un=(t,e,n)=>{if(t===!1)return!1;if(typeof t=="function"){const s=t();return Un(s,e,n)}return ln(t)?t:t!=null?{message:t,title:n}:{message:e,title:n}};he.Notify=(...t)=>{var e,n;return(n=(e=He.services.notify)==null?void 0:e.show)==null?void 0:n.call(e,ml(t))},he.Notify.show=he.Notify,he.Notify.success=Rt("success","Success"),he.Notify.error=Rt("danger","Error"),he.Notify.warning=Rt("warning","Warning"),he.Notify.info=Rt("info","Info"),he.Notify.primary=Rt("primary","Notice"),he.Notify.secondary=Rt("secondary","Notice"),he.Notify.remove=t=>{var e,n;return(n=(e=He.services.notify)==null?void 0:e.remove)==null?void 0:n.call(e,t)},he.Notify.clear=()=>{var t,e;return(e=(t=He.services.notify)==null?void 0:t.clear)==null?void 0:e.call(t)},he.Notify.update=(t,e={})=>{var n,s;return(s=(n=He.services.notify)==null?void 0:n.update)==null?void 0:s.call(n,t,e)},he.Notify.promise=async(t,e={})=>{var o,r,y,u,i,b,T,S,w,z,Q,G,ie,D;const n=e.loading===!1?!1:Un(typeof e.loading=="function"?()=>e.loading():e.loading,"Operazione in corso...","In corso"),s=n===!1?null:(r=(o=He.services.notify)==null?void 0:o.show)==null?void 0:r.call(o,Gt({type:"info",timeout:0,closable:!1,...n},"info"));try{const Y=await(typeof t=="function"?t():t),W=Un(typeof e.success=="function"?()=>e.success(Y):e.success,"Operazione completata con successo.","Completato");return W!==!1?s!=null?(u=(y=He.services.notify)==null?void 0:y.update)==null||u.call(y,s,Gt(W,"success")):(b=(i=He.services.notify)==null?void 0:i.show)==null||b.call(i,Gt(W,"success")):s!=null&&((S=(T=He.services.notify)==null?void 0:T.remove)==null||S.call(T,s)),Y}catch($){const Y=Un(typeof e.error=="function"?()=>e.error($):e.error,($==null?void 0:$.message)||"Operazione fallita.","Errore");throw Y!==!1?s!=null?(z=(w=He.services.notify)==null?void 0:w.update)==null||z.call(w,s,Gt(Y,"danger")):(G=(Q=He.services.notify)==null?void 0:Q.show)==null||G.call(Q,Gt(Y,"danger")):s!=null&&((D=(ie=He.services.notify)==null?void 0:ie.remove)==null||D.call(ie,s)),$}},he.Header=(...t)=>{var C,h,P,j,U,ce,L;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e};Yt(o);const r=f=>Object.prototype.hasOwnProperty.call(e,f),y=(C=e.drawerStateKey)!=null?C:qt;y&&(qt=y,Et=en(y));const u=()=>en(y),i=()=>Wt(!0,y),b=()=>Wt(!1,y),T=()=>Wt(!u(),y),S={props:e,stateKey:y,isDrawerOpen:u,openDrawer:i,closeDrawer:b,toggleDrawer:T,toggleAside:T},w=(f,k)=>{if(!(k==null||k===!1)){if(Array.isArray(k)){k.forEach(A=>w(f,A));return}if(k!=null&&k.nodeType){f.appendChild(k);return}f.appendChild(document.createTextNode(String(k)))}},z=(f,k,A=H=>H)=>{const H=JSswift.ui.getSlot(s,f);if(H!=null)return J(s,f,S,null);if(typeof k=="function"){const ge=new Set(["eyebrow","title","subtitle"]),Se=_[ge.has(f)?"span":"div"]({class:`cms-header-slot-${f}`});return JSswift.reactive.effect(()=>{const ye=A(k(S)),V=on(JSswift.ui.slot(ye));Se.replaceChildren(),Array.isArray(V)?V.forEach(O=>w(Se,O)):w(Se,V)},`UI.Header:${f}`),[Se]}return J(s,f,S,A(k))},Q=(f,k="icon",A=e.iconSize||e.size||"md")=>f==null||f===!1?null:typeof f=="string"?he.Icon({name:f,size:A}):JSswift.ui.slot(f,{as:k}),G=f=>{var A,H;const k=f?(A=e.drawerOpenIcon)!=null?A:"\u2715":(H=e.drawerCloseIcon)!=null?H:"\u2630";return k==null||k===!1?null:typeof k=="string"?k:JSswift.ui.slot(k,{as:f?"drawerOpenIcon":"drawerCloseIcon"})},ie=_.span({class:"cms-header-toggle-icon"}),D=f=>{const k=J(null,"default",S,G(f));ie.replaceChildren(...k.length?k:[""])};D(u());const $=he.Btn({class:"cms-header-toggle",outline:!0,size:(P=(h=e.toggleSize)!=null?h:e.size)!=null?P:"sm",onClick:T,"aria-label":e.toggleLabel||"Toggle navigation"},ie);e.left==null&&e.left!==!1&&!JSswift.ui.getSlot(s,"left")&&il.add({update:D});const Y=e.left===!1?null:e.left!=null?e.left:$,W=r("title")?e.title:(j=e.label)!=null?j:"App",se=(ce=(U=e.subtitle)!=null?U:e.description)!=null?ce:"",me=r("right")?e.right:e.end,re=r("content")?e.content:r("body")?e.body:n!=null&&n.length?n:null,oe=[...z("left",Y),...z("start",null)],le=z("icon",e.icon,Q),te=z("eyebrow",(L=e.eyebrow)!=null?L:e.kicker),M=z("title",W),Z=z("subtitle",se),q=z("meta",e.meta),ue=(()=>{const f=z("content",null);return f.length?f:z("default",re)})(),R=[...z("center",null),...z("body",null)],g=[...z("right",me),...z("end",null)],d=z("actions",e.actions),m=_.div({class:ae(["cms-header-body",e.bodyClass,e.centerClass])},_.div({class:"cms-header-heading"},le.length?_.div({class:"cms-header-icon"},...le):null,_.div({class:"cms-header-copy"},te.length?_.div({class:ae(["cms-header-eyebrow",e.eyebrowClass])},...te):null,M.length?_.div({class:ae(["cms-header-title",e.titleClass])},...M):null,Z.length?_.div({class:ae(["cms-header-subtitle",e.subtitleClass])},...Z):null,ue.length?_.div({class:ae(["cms-header-content",e.contentClass])},...ue):null),q.length?_.div({class:ae(["cms-header-meta",e.metaClass])},...q):null)),F=[...g,...d.length?[_.div({class:ae(["cms-header-actions",e.actionsClass])},...d)]:[]],X=JSswift.omit(o,["actions","actionsClass","body","bodyClass","centerClass","content","contentClass","description","divider","drawerCloseIcon","drawerOpenIcon","drawerStateKey","elevated","end","eyebrow","eyebrowClass","icon","iconSize","kicker","label","left","meta","metaClass","right","slots","stack","sticky","subtitle","subtitleClass","title","titleClass","toggleLabel","toggleSize","gap","minHeight","startClass","endClass"]);X.class=ae(["cms-panel","cms-header","cms-singularity",fe(e.sticky!==!1,"sticky"),fe(e.stack,"stack"),fe(e.elevated,"elevated"),fe(e.divider!==!1,"divider"),o.class]),X.style={...o.style||{}},e.gap!=null&&(X.style["--cms-header-gap"]=Be(l(e.gap))),e.minHeight!=null&&(X.style.minHeight=Be(l(e.minHeight)));const a=_.div(X,...oe.length?[_.div({class:ae(["cms-header-start",e.startClass])},...oe)]:[],_.div({class:"cms-header-main"},...R.length?[_.div({class:ae(["cms-header-body",e.bodyClass,e.centerClass])},...R)]:[m],...F.length?[_.div({class:ae(["cms-header-end",e.endClass])},...F)]:[]));return Ke(a,e),a},he.Drawer=(...t)=>{var be,Ce,pe,Ie,_e,I,we,E,x,v;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e},r=c=>Object.prototype.hasOwnProperty.call(e,c),y=(be=e.stateKey)!=null?be:qt;y&&(qt=y,Et=en(y));const u=()=>en(y),i=()=>Wt(!0,y),b=()=>Wt(!1,y),T=()=>Wt(!u(),y),S={props:e,stateKey:y,isDrawerOpen:u,openDrawer:i,closeDrawer:b,toggleDrawer:T,toggleAside:T},w=JSswift==null?void 0:JSswift.store,z=!!(w!=null&&w.get&&(w!=null&&w.set)),Q=`${y}:groups`,G=`${y}:active`;let ie=z?w.get(Q,{})||{}:{},D=z&&(Ce=w.get(G,null))!=null?Ce:null;const $=new Map,Y=new Map,W=c=>{const N=l(c);return N==null||N===!1?[]:Array.isArray(N)?N.flat(1/0):[N]},se=(c,N,de=S)=>{const Ae=Array.isArray(c)?c:[c];for(const Je of Ae)if(JSswift.ui.getSlot(s,Je)!=null)return J(s,Je,de,N);return N==null?[]:J(null,"default",de,l(N))},me=c=>(Array.isArray(c)?c:[c]).some(de=>JSswift.ui.getSlot(s,de)!=null),re=c=>{if(typeof l(c.external)=="boolean")return!!l(c.external);const N=l(c.href||c.to||c.link||"");return/^(https?:)?\/\//.test(N)},oe=(pe=e.closeOnSelect)!=null?pe:!0,le=c=>!!oe&&l(c.keepOpen)!==!0,te=(_e=(Ie=e.itemIconSize)!=null?Ie:e.size)!=null?_e:"md",M=(I=e.groupOpenIcon)!=null?I:"arrow_drop_up",Z=(we=e.groupCloseIcon)!=null?we:"arrow_drop_down",q=c=>!!c&&D===c,ue=c=>!!c&&!!D&&(D===c||D.startsWith(`${c}::`)),R=()=>{$.forEach(({el:c,baseActive:N},de)=>{const Ae=!!N||q(de);c.classList.toggle("active",Ae),Ae?c.setAttribute("aria-current","page"):c.removeAttribute("aria-current")}),Y.forEach(({wrap:c,toggle:N,baseActive:de},Ae)=>{const Je=!!de||ue(Ae);c.classList.toggle("active",Je),N.classList.toggle("active",Je)})},g=c=>{D=c||null,z&&w.set(G,D),R()},d=(c,N)=>{if(l(c.active)!=null)return!!l(c.active);if(l(c.current)!=null)return!!l(c.current);if(!N||re(c))return!1;try{if(N.startsWith("#"))return window.location.hash===N;const de=`${window.location.pathname}${window.location.search}${window.location.hash}`;return N===de||N===window.location.pathname}catch(de){return!1}},m=(c,N,de)=>d(c,N)||q(de),F=(c=[],N=0,de=[])=>W(c).some((Ae,Je)=>{var Ye,Ze,Qe,Te,je;const B=l(Ae);if(!B||typeof B!="object"||B.nodeType)return!1;const Le=l(B.href||B.to||B.link||""),Me=(je=l((Te=(Qe=(Ze=(Ye=B.label)!=null?Ye:B.title)!=null?Ze:B.text)!=null?Qe:Le)!=null?Te:null))!=null?je:`item-${N}-${Je}`,Ee=h(B,Me,N,Je),De=de.concat(Ee).join("::");if(m(B,Le,De))return!0;const Ue=B.items||B.children||B.sub;return F(Ue,N+1,de.concat(Ee))}),X=(c,N={})=>{var Je;const de=l(c);if(de==null||de===!1)return[];const Ae=typeof de=="string"?he.Icon({name:de,size:(Je=N.iconSize)!=null?Je:te}):JSswift.ui.slot(de,{...N,as:"icon"});return J(null,"default",N,Ae)},a=(c,N,de={})=>{const Ae=X(c,de);return Ae.length?[_.span({class:ae(["cms-drawer-item-icon",N])},...Ae)]:[]},C=c=>{const N=l(c.iconPosition)||"left",de=Object.prototype.hasOwnProperty.call(c,"iconLeft")?c.iconLeft:N!=="right"?c.icon:null,Ae=Object.prototype.hasOwnProperty.call(c,"iconRight")?c.iconRight:N==="right"?c.icon:null;return{left:de,right:Ae}},h=(c,N,de,Ae)=>l(c.key||c.id||c.to||c.href||N||`item-${de}-${Ae}`),P=(c,N)=>z&&Object.prototype.hasOwnProperty.call(ie,c)?!!ie[c]:N,j=(c,N)=>{z&&(ie={...ie,[c]:!!N},w.set(Q,ie))},U=()=>{const c={...S,area:"header"},N=se(["headerIcon","icon"],e.icon,c),de=se(["eyebrow"],e.eyebrow,c),Ae=se(["title"],e.title,c),Je=se(["subtitle"],e.subtitle,c),B=se(["meta"],e.meta,c),Le=se(["content"],e.content,c),Me=se(["actions"],e.actions,c),Ee=r("header")?J(null,"default",c,l(e.header)):[],De=N.length||de.length||Ae.length||Je.length||B.length||Le.length||Me.length;return!De&&!Ee.length?[]:De?[_.div({class:ae(["cms-drawer-header",e.headerClass])},...N.length?[_.div({class:"cms-drawer-header-icon"},...N)]:[],_.div({class:"cms-drawer-header-body"},...de.length?[_.div({class:"cms-drawer-header-eyebrow"},...de)]:[],...Ae.length?[_.div({class:"cms-drawer-header-title"},...Ae)]:[],...Je.length?[_.div({class:"cms-drawer-header-subtitle"},...Je)]:[],...B.length?[_.div({class:"cms-drawer-header-meta"},...B)]:[],...Le.length?[_.div({class:"cms-drawer-header-content"},...Le)]:[],...Ee.length?[_.div({class:"cms-drawer-header-extra"},...Ee)]:[]),...Me.length?[_.div({class:"cms-drawer-header-actions"},...Me)]:[])]:Ee},ce=(c,N,de)=>{var B,Le;return!(((B=c.onClick)==null?void 0:B.call(c,de,N))===!1||de!=null&&de.defaultPrevented||((Le=e.onSelect)==null?void 0:Le.call(e,c,N,de))===!1||de!=null&&de.defaultPrevented)},L=(c,N,de={})=>{const Ae=N.hasChildren?"group":"item",Je=J(s,`${Ae}Label`,N,N.label),B=J(s,`${Ae}Note`,N,N.note),Le=J(s,`${Ae}Badge`,N,N.badge),Me=J(s,`${Ae}Aside`,N,N.aside),Ee=J(s,`${Ae}Content`,N,N.content),De=[];return(Je.length||B.length||Le.length||Me.length)&&De.push(_.div({class:"cms-drawer-item-top"},_.div({class:"cms-drawer-item-copy"},...Je.length?[_.div({class:"cms-drawer-item-label"},...Je)]:[],...B.length?[_.div({class:"cms-drawer-item-note"},...B)]:[]),...Le.length||Me.length?[_.div({class:"cms-drawer-item-meta"},...Le.length?[_.div({class:"cms-drawer-item-badge"},...Le)]:[],...Me.length?[_.div({class:"cms-drawer-item-aside"},...Me)]:[])]:[])),Ee.length&&De.push(_.div({class:"cms-drawer-item-content"},...Ee)),[...de.start||[],...a(N.iconLeft,"left",N),...De.length?[_.div({class:"cms-drawer-item-main"},...De)]:[],...a(N.iconRight,"right",N),...de.end||[]]},f=(c=[],N=0,de=[])=>W(c).map((Ae,Je)=>{var nn,Pe,Ve,et,ct,gt,ht,Ct,yt,p,ne;const B=l(Ae);if(B==null||B===!1)return null;if(B.nodeType||typeof B!="object"||Array.isArray(B))return _.div({class:"cms-drawer-custom","data-level":String(N)},...J(null,"default",{...S,item:B,level:N,index:Je,path:de},B));if(l(B.hidden)===!0||l(B.visible)===!1)return null;const Le=W(B.items||B.children||B.sub),Me=l(B.href||B.to||B.link||null),Ee=l((et=(Ve=(Pe=(nn=B.label)!=null?nn:B.title)!=null?Pe:B.text)!=null?Ve:Me)!=null?et:null),De=Ee!=null?Ee:`item-${N}-${Je}`,Ue=l((ht=(gt=(ct=B.note)!=null?ct:B.subtitle)!=null?gt:B.description)!=null?ht:null),Ye=l((Ct=B.badge)!=null?Ct:null),Ze=l((p=(yt=B.aside)!=null?yt:B.meta)!=null?p:null),Qe=l((ne=B.content)!=null?ne:null),Te=h(B,De,N,Je),je=de.concat(Te).join("::"),{left:tt,right:nt}=C(B),ut=mt(l(B.state)||l(B.color)||""),dt=d(B,Me),bt=dt||q(je),lt=!!l(B.disabled),ft={...S,item:B,index:Je,level:N,path:de,label:De,note:Ue,badge:Ye,aside:Ze,content:Qe,itemStateKey:je,iconLeft:tt,iconRight:nt,iconSize:l(B.iconSize)||te,active:bt,disabled:lt,hasChildren:!1},vt=l(B.divider)===!0||B.type==="divider"||B.type==="separator",_t=l(B.section)===!0||B.type==="section"||B.type==="heading"||B.type==="label",rt=B.type==="content"||B.type==="custom"||!Me&&!Le.length&&!l(B.button)&&B.type!=="button"&&Ee==null&&Qe!=null;if(vt)return _.div({class:ae(["cms-drawer-separator",B.class]),"data-level":String(N)});if(_t){const ve=J(s,"sectionLabel",ft,De||Qe);return _.div({class:ae(["cms-drawer-section-label",B.class]),"data-level":String(N)},...ve)}if(rt){const ve=J(s,"item",ft,Qe!=null?Qe:De);return _.div({class:ae(["cms-drawer-custom",ut?`cms-drawer-tone-${ut}`:"",B.class]),style:B.style,"data-level":String(N)},...ve)}if(Le.length){const ve=dt||F(Le,N+1,de.concat(Te)),Re=ve||ue(je);let Fe=P(je,!!l(B.expanded)||!!l(B.open)||Re);const Oe=_.span({class:"cms-drawer-group-icon"}),$e={...ft,active:Re,hasChildren:!0,isOpen:()=>Fe,setOpen:At=>zt(At),toggle:()=>zt(!Fe)},Xe=()=>{var dn,fn;const At=Fe?(dn=B.openIcon)!=null?dn:M:(fn=B.closeIcon)!=null?fn:Z,sn=l(Fe?B.iconSidePosition||B.openIconSide||B.openIconPosition||"right":B.iconSidePosition||B.closeIconSide||B.closeIconPosition||"right")==="left"?"left":"right";Oe.innerHTML="",Oe.className=`cms-drawer-group-icon ${sn}`,X(At,{...$e,as:"toggleIcon"}).forEach(vn=>Oe.appendChild(vn))},ot=_.button({type:"button",class:ae(["cms-drawer-group-toggle","cms-drawer-entry",Fe?"open":"",Re?"active":"",lt?"is-disabled":"",ut?`cms-drawer-tone-${ut}`:"",B.class]),style:B.style,"data-level":String(N),"aria-expanded":String(Fe),"aria-disabled":lt?"true":null,onClick:At=>{if(lt){At.preventDefault();return}g(je),zt(!Fe)}},...L(B,$e,{start:l(B.iconSidePosition||B.openIconSide||B.closeIconSide||B.openIconPosition||B.closeIconPosition||"right")==="left"?[Oe]:[],end:l(B.iconSidePosition||B.openIconSide||B.closeIconSide||B.openIconPosition||B.closeIconPosition||"right")==="right"?[Oe]:[]})),pt=J(s,"group",$e,null),xt=_.div({class:"cms-drawer-group-items"},...f(Le,N+1,de.concat(Te))),Bt=_.div({class:ae(["cms-drawer-group",Fe?"open":"",Re?"active":"",ut?`cms-drawer-tone-${ut}`:""]),"data-level":String(N)},...pt.length?pt:[ot],xt),zt=At=>{Fe=!!At,Bt.classList.toggle("open",Fe),ot.classList.toggle("open",Fe),ot.setAttribute("aria-expanded",String(Fe)),Xe(),j(je,Fe)};return Y.set(je,{wrap:Bt,toggle:ot,baseActive:ve}),Xe(),Bt}const Vt=J(s,"item",ft,null),Mt=l(B.button)===!0||B.type==="button"||!Me&&typeof B.onClick=="function",wt={class:ae(["cms-drawer-entry",Mt?"cms-drawer-btn":"cms-drawer-link",bt?"active":"",lt?"is-disabled":"",ut?`cms-drawer-tone-${ut}`:"",B.class]),style:B.style,"data-level":String(N),"aria-current":bt?"page":null,"aria-disabled":lt?"true":null},Kt=Vt.length?Vt:L(B,ft);if(Mt){const ve=_.button({...wt,type:B.buttonType||"button",disabled:lt,onClick:Re=>{if(lt){Re.preventDefault();return}ce(B,ft,Re)&&(g(je),le(B)&&b())}},...Kt);return $.set(je,{el:ve,baseActive:dt}),ve}const St=re(B),cn=St?l(B.target)||"_blank":l(B.target),un=St?l(B.rel)||"noopener noreferrer":l(B.rel),tn=_.a({...wt,href:Me||"#",target:cn||null,rel:un||null,tabIndex:lt?-1:null,onClick:ve=>{var Re;if(lt){ve.preventDefault();return}ce(B,ft,ve)&&(!St&&B.to&&((Re=He.router)!=null&&Re.navigate)&&(ve.preventDefault(),He.router.navigate(B.to)),le(B)&&b())}},...Kt);return $.set(je,{el:tn,baseActive:dt}),tn}).filter(Boolean),k=se(["before","beforeItems"],(E=e.before)!=null?E:e.beforeItems),A=me(["body"])?se(["body"],null):[],H=f(e.items||[]),ge=se(["default"],n),Se=se(["after","afterItems"],(x=e.after)!=null?x:e.afterItems),ye=A.length?A:[...k,...H,...ge,...Se],V=r("empty")||r("emptyText")?(v=e.empty)!=null?v:_.div({class:ae(["cms-drawer-empty",e.emptyClass])},e.emptyText||"Nessun contenuto"):_.div({class:ae(["cms-drawer-empty",e.emptyClass])},"Nessun contenuto"),O=se(["header"],U()),K=se(["footer"],e.footer),ke=ye.length?ye:se(["empty"],V),Ne=JSswift.omit(o,["items","header","footer","before","beforeItems","after","afterItems","title","subtitle","eyebrow","icon","content","meta","actions","empty","emptyText","closeOnSelect","groupOpenIcon","groupCloseIcon","stateKey","sticky","slots","headerClass","bodyClass","footerClass","emptyClass","itemIconSize","gap","indent","padding","minHeight","maxHeight","width","onSelect"]);Ne.class=ae(["cms-panel","cms-drawer",Et?"open":"",fe(e.sticky,"sticky"),o.class]),Ne.style={...o.style||{}},e.gap!=null&&(Ne.style["--cms-drawer-gap"]=Be(l(e.gap))),e.indent!=null&&(Ne.style["--cms-drawer-indent"]=Be(l(e.indent))),e.padding!=null&&(Ne.style["--cms-drawer-padding"]=Be(l(e.padding))),e.width!=null&&(Ne.style.width=Be(l(e.width))),e.minHeight!=null&&(Ne.style.minHeight=Be(l(e.minHeight))),e.maxHeight!=null&&(Ne.style.maxHeight=Be(l(e.maxHeight)));const ee=_.div(Ne,...O.length?O:[],_.div({class:ae(["cms-drawer-body",e.bodyClass])},...ke),...K.length?[_.div({class:ae(["cms-drawer-footer",e.footerClass])},...K)]:[]),xe=hs.get(y)||new Set;return xe.add(ee),hs.set(y,xe),Wt(Et,y),ee.isDrawerOpen=u,ee.openDrawer=i,ee.closeDrawer=b,ee.toggleDrawer=T,ee.setActiveItem=g,Ke(ee,e),R(),ee},he.Page=(...t)=>{var m,F,X,a;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e},r=(C,h)=>{var P;return!!(C&&C.nodeType===1&&((P=C.classList)!=null&&P.contains(`cms-page-${h}`)))},y=C=>C==null?null:typeof C=="string"?he.Icon({name:C,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(C,{as:"icon"}),u={dense:!!l(e.dense),flat:!!l(e.flat),centered:!!l(e.centered),narrow:!!l(e.narrow)},i=(C,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(P=>i(C,P));return}if(h!=null&&h.nodeType){C.appendChild(h);return}C.appendChild(document.createTextNode(String(h)))}},b=(C,h,P=j=>j)=>{const j=JSswift.ui.getSlot(s,C);if(j!=null)return J(s,C,u,null);if(typeof h=="function"){const U=new Set(["eyebrow","title","subtitle"]),ce=_[U.has(C)?"span":"div"]({class:`cms-page-slot-${C}`});return JSswift.reactive.effect(()=>{const L=P(h(u)),f=on(JSswift.ui.slot(L));ce.replaceChildren(),Array.isArray(f)?f.forEach(k=>i(ce,k)):i(ce,f)},`UI.Page:${C}`),[ce]}return J(s,C,u,P(h))},T=J(s,"default",u,n!=null&&n.length?n:[]),S={hero:[],header:[],body:[],footer:[],actions:[]},w=[];T.forEach(C=>{r(C,"hero")?S.hero.push(C):r(C,"header")?S.header.push(C):r(C,"body")?S.body.push(C):r(C,"footer")?S.footer.push(C):r(C,"actions")?S.actions.push(C):w.push(C)});const z=b("icon",e.icon,y),Q=b("hero",(m=e.hero)!=null?m:e.banner),G=b("eyebrow",(F=e.eyebrow)!=null?F:e.kicker),ie=b("title",e.title),D=b("subtitle",(X=e.subtitle)!=null?X:e.description),$=b("header",e.header),Y=b("aside",e.aside),W=b("body",(a=e.body)!=null?a:e.content),se=b("footer",e.footer),me=b("actions",e.actions),re=Q.length?_.div({class:ae(["cms-page-hero",e.heroClass])},...Q):null,oe=z.length||G.length||ie.length||D.length||$.length||Y.length,le=oe?_.div({class:ae(["cms-page-header",e.headerClass])},_.div({class:"cms-page-head"},z.length?_.div({class:ae(["cms-page-icon",e.iconClass])},...z):null,_.div({class:"cms-page-head-main"},G.length?_.div({class:ae(["cms-page-eyebrow",e.eyebrowClass])},...G):null,ie.length?_.div({class:ae(["cms-page-title",e.titleClass])},...ie):null,D.length?_.div({class:ae(["cms-page-subtitle",e.subtitleClass])},...D):null,$.length?_.div({class:ae(["cms-page-header-content",e.headerContentClass])},...$):null),Y.length?_.div({class:ae(["cms-page-aside",e.asideClass])},...Y):null)):null,te=[...W,...w],M=te.length?_.div({class:ae(["cms-page-body",e.bodyClass])},...te):null,Z=[...me,...S.actions],q=se.length||Z.length?_.div({class:ae(["cms-page-footer",e.footerClass])},...se,Z.length?_.div({class:"cms-page-actions"},...Z):null):null,ue=!!(Q.length||S.hero.length),R=!!(oe||S.header.length),g=JSswift.omit(o,["actions","aside","asideClass","banner","body","bodyClass","centered","content","dense","description","eyebrow","eyebrowClass","flat","footer","footerClass","gap","header","headerClass","headerContentClass","headerGap","hero","heroClass","heroPadding","icon","iconClass","iconSize","kicker","maxWidth","minHeight","narrow","padding","size","slots","subtitle","subtitleClass","title","titleClass"]);g.class=ae(["cms-panel","cms-page",fe(e.dense,"dense"),fe(e.flat,"cms-page-flat"),fe(e.centered,"cms-page-centered"),fe(e.narrow,"cms-page-narrow"),fe(ue,"cms-page-has-hero"),fe(R,"cms-page-has-header"),o.class]),g.style={...o.style||{}},(e.gap!=null||at(e.gap))&&(g.style["--cms-page-gap"]=ze(e.gap,Be)),(e.padding!=null||at(e.padding))&&(g.style["--cms-page-padding"]=ze(e.padding,Be)),(e.maxWidth!=null||at(e.maxWidth))&&(g.style["--cms-page-max-width"]=ze(e.maxWidth,Be)),(e.minHeight!=null||at(e.minHeight))&&(g.style["--cms-page-min-height"]=ze(e.minHeight,Be)),(e.headerGap!=null||at(e.headerGap))&&(g.style["--cms-page-header-gap"]=ze(e.headerGap,Be)),(e.heroPadding!=null||at(e.heroPadding))&&(g.style["--cms-page-hero-padding"]=ze(e.heroPadding,Be));const d=_.div(g,re,...S.hero,le,...S.header,M,...S.body,q,...S.footer);return Ke(d,e),d},he.AppShell=(...t)=>{var C,h;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(P,j)=>!!P&&Object.prototype.hasOwnProperty.call(P,j),r=l(e.noDrawer)===!0||e.drawer===!1,y=l(e.reverse)===!0,u=l(e.stack)===!0,i=(h=(C=e.drawerStateKey)!=null?C:e.stateKey)!=null?h:qt;i&&(qt=i,Et=en(i));const b={props:e,noDrawer:r,stateKey:i,isDrawerOpen:()=>en(i),openDrawer:()=>Wt(!0,i),closeDrawer:()=>Wt(!1,i),toggleDrawer:()=>Wt(!en(i),i)},T=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let S=e.header;!o(e,"header")&&(Object.keys(T).length||o(e,"title")||o(e,"subtitle")||o(e,"left")||o(e,"right"))&&(!o(T,"title")&&o(e,"title")&&(T.title=e.title),!o(T,"subtitle")&&o(e,"subtitle")&&(T.subtitle=e.subtitle),!o(T,"left")&&o(e,"left")&&(T.left=e.left),!o(T,"right")&&o(e,"right")&&(T.right=e.right),o(T,"drawerStateKey")||(T.drawerStateKey=i),r&&!o(T,"left")&&(T.left=!1),S=he.Header(T));const w=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},z=o(e,"drawerItems")?e.drawerItems:e.items,Q=o(e,"drawerHeader")?e.drawerHeader:void 0;let G=e.drawer;!o(e,"drawer")&&!r&&(Object.keys(w).length||z!=null||Q!=null)&&(!o(w,"items")&&z!=null&&(w.items=z),!o(w,"header")&&Q!=null&&(w.header=Q),o(w,"stateKey")||(w.stateKey=i),G=he.Drawer(w));const ie=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},D=o(e,"content")?e.content:n,$=J(s,"default",b,D);let Y=e.page;!o(e,"page")&&(Object.keys(ie).length||$.length)&&(Y=he.Page(ie,...$));const W=e.footerProps&&typeof e.footerProps=="object"?{...e.footerProps}:{},se=o(e,"footerContent")?e.footerContent:void 0;let me=e.footer;!o(e,"footer")&&(Object.keys(W).length||se!=null)&&(me=he.Footer(W,...J(null,"default",b,se)));const re=J(s,"header",b,S),oe=r?[]:J(s,"drawer",b,G),le=J(s,"page",b,Y),te=J(s,"footer",b,me),M=ae(["cms-app","cms-app-shell",fe(r,"no-drawer"),fe(y,"is-reverse"),fe(u,"is-stack"),fe(e.flush,"is-flush"),fe(e.divider,"is-divider"),e.class]),Z=JSswift.omit(e,["header","drawer","page","footer","content","title","subtitle","left","right","items","drawerItems","drawerHeader","headerProps","drawerProps","pageProps","footerProps","footerContent","noDrawer","reverse","stack","flush","divider","drawerStateKey","stateKey","drawerWidth","gap","padding","slots"]);Z.class=M,Z.style={...e.style||{}};const q=ze(e.drawerWidth,Be);q!=null&&(Z.style["--cms-app-shell-drawer-width"]=q);const ue=ze(e.gap,Be);ue!=null&&(Z.style["--cms-app-shell-gap"]=ue);const R=ze(e.padding,Be);R!=null&&(Z.style["--cms-app-shell-padding"]=R);const g=re.length?_.div({class:"cms-app-shell-header-slot"},...re):null,d=oe.length?_.div({class:"cms-app-shell-drawer-slot"},...oe):null,m=le.length?_.div({class:"cms-app-shell-page-slot"},...le):null,F=te.length?_.div({class:"cms-app-shell-footer-slot"},...te):null,X=y?[m,d]:[d,m],a=_.div(Z,...g?[g]:[],_.div({class:"cms-app-shell-body"},...X.filter(Boolean)),...F?[F]:[]);return a.openDrawer=b.openDrawer,a.closeDrawer=b.closeDrawer,a.toggleDrawer=b.toggleDrawer,a.isDrawerOpen=b.isDrawerOpen,a.header=g,a.drawer=d,a.page=m,a.footer=F,Ke(a,e),a},he.Parallax=function(...e){var P,j;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),o=n.slots||{},r={...n};r.color!=null&&r.textColor==null&&(r.textColor=r.color),delete r.color,Yt(r);const y=qe(n.state,()=>{const U=mt(l(n.state));return U?`cms-state-${U}`:""}),u=U=>{if(U==null||U===!1||U==="")return"";const ce=String(U);return Qt(ce)?`var(--cms-${ce})`:ce},i=()=>{const U=l(n.background);if(U)return String(U);const ce=l(n.image)||l(n.src)||"";if(!ce)return"linear-gradient(120deg, #1b2c5a, #2f6d8f, #2a8f5c)";const L=String(ce);return/^url\(/i.test(L)||/gradient\(/i.test(L)||/^var\(/i.test(L)?L:`url(${L})`},b=(U,ce)=>{const L=Number(l(U));return Number.isFinite(L)?L:ce},T={speed:()=>{var U;return(U=l(n.speed))!=null?U:.18},state:()=>l(n.state)||"",disabled:()=>!!l(n.disabled)},S=J(o,"badge",T,n.badge),w=J(o,"background",T,n.backgroundContent),z=J(o,"eyebrow",T,(P=n.eyebrow)!=null?P:n.kicker),Q=J(o,"title",T,n.title),G=J(o,"subtitle",T,n.subtitle),ie=J(o,"header",T,n.header),D=J(o,"aside",T,n.aside),$=J(o,"media",T,n.media),Y=J(o,"content",T,(j=n.content)!=null?j:n.body),W=J(o,"default",T,s!=null&&s.length?s:[]),se=J(o,"footer",T,n.footer),me=J(o,"actions",T,n.actions),re=[...Y,...W],oe=S.length?_.div({class:ae(["cms-parallax-badge",n.badgeClass])},...S):null,le=z.length||Q.length||G.length||ie.length||D.length,te=le?_.div({class:ae(["cms-parallax-header",n.headerClass])},_.div({class:"cms-parallax-head"},_.div({class:"cms-parallax-head-main"},z.length?_.div({class:ae(["cms-parallax-eyebrow",n.eyebrowClass])},...z):null,Q.length?_.div({class:ae(["cms-parallax-title",n.titleClass])},...Q):null,G.length?_.div({class:ae(["cms-parallax-subtitle",n.subtitleClass])},...G):null,ie.length?_.div({class:ae(["cms-parallax-header-content",n.headerContentClass])},...ie):null),D.length?_.div({class:ae(["cms-parallax-aside",n.asideClass])},...D):null)):null,M=$.length?_.div({class:ae(["cms-parallax-media",n.mediaClass])},...$):null,Z=re.length?_.div({class:ae(["cms-parallax-body",n.bodyClass])},...re):null,q=se.length||me.length?_.div({class:ae(["cms-parallax-footer",n.footerClass])},se.length?_.div({class:"cms-parallax-footer-content"},...se):null,me.length?_.div({class:"cms-parallax-actions"},...me):null):null,ue=JSswift.omit(r,["actions","align","aside","asideClass","background","backgroundContent","backgroundContentClass","badge","badgeClass","bgClass","bgPosition","bgRepeat","bgSize","body","bodyClass","color","content","contentClass","contentMaxWidth","disabled","eyebrow","eyebrowClass","footer","footerClass","gap","header","headerClass","headerContentClass","height","image","imageAlt","imageClass","innerClass","justify","kicker","maxOffset","media","mediaClass","minHeight","overlay","padding","slots","speed","src","startTop","state","subtitle","subtitleClass","textColor","title","titleClass"]);ue.class=ae(["cms-parallax","cms-singularity",y,fe(n.disabled,"cms-parallax-static"),fe(oe,"cms-parallax-has-badge"),fe(le,"cms-parallax-has-header"),r.class]),ue.style={...r.style||{}},n.height!=null&&(ue.style["--cms-parallax-height"]=ze(n.height,Be)),n.minHeight!=null&&(ue.style["--cms-parallax-min-height"]=ze(n.minHeight,Be)),n.padding!=null&&(ue.style["--cms-parallax-padding"]=ze(n.padding,Be)),n.gap!=null&&(ue.style["--cms-parallax-gap"]=ze(n.gap,Be)),n.contentMaxWidth!=null&&(ue.style["--cms-parallax-content-max-width"]=ze(n.contentMaxWidth,Be)),n.justify!=null&&(ue.style["--cms-parallax-justify"]=ze(n.justify)),n.align!=null&&(ue.style["--cms-parallax-align"]=ze(n.align)),n.color!=null&&(ue.style["--cms-parallax-color"]=ze(n.color,u)),n.overlay!=null&&(ue.style["--cms-parallax-overlay"]=ze(n.overlay)),n.bgPosition!=null&&(ue.style["--cms-parallax-position"]=ze(n.bgPosition)),n.bgSize!=null&&(ue.style["--cms-parallax-size"]=ze(n.bgSize)),n.bgRepeat!=null&&(ue.style["--cms-parallax-repeat"]=ze(n.bgRepeat)),ue.style["--cms-parallax-image"]=at(n.background)||at(n.image)||at(n.src)?()=>i():i();const R=_.div({class:ae(["cms-parallax-bg",n.bgClass])},w.length?_.div({class:ae(["cms-parallax-bg-content",n.backgroundContentClass])},...w):null),g=_.div({class:ae(["cms-parallax-content",n.contentClass,n.innerClass])},oe,te,M,Z,q),d=_.div(ue,R,g);let m=!1,F=!1,X=null;const a=()=>{var U;m||(m=!0,typeof window!="undefined"&&(window.removeEventListener("scroll",h),window.removeEventListener("resize",h)),(U=X==null?void 0:X.disconnect)==null||U.call(X),X=null)},C=()=>{if(m)return;if(!d.isConnected){a();return}if(l(n.disabled)){R.style.transform="translate3d(0, 0, 0)",d.style.setProperty("--cms-parallax-offset","0px");return}const U=d.getBoundingClientRect(),ce=b(n.speed,.18),L=Math.abs(b(n.maxOffset,96)),f=l(n.startTop),k=f!=null&&f!==""?(U.top-b(n.startTop,0))*ce:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(U.top+U.height/2))*ce,H=`${(L>0?Math.max(-L,Math.min(L,k)):k).toFixed(2)}px`;R.style.transform=`translate3d(0, ${H}, 0)`,d.style.setProperty("--cms-parallax-offset",H)};function h(){m||F||(F=!0,requestAnimationFrame(()=>{F=!1,C()}))}return typeof window!="undefined"&&(window.addEventListener("scroll",h,{passive:!0}),window.addEventListener("resize",h),typeof ResizeObserver!="undefined"&&(X=new ResizeObserver(()=>{h()}),X.observe(d)),requestAnimationFrame(()=>{h()}),setTimeout(()=>{h()},90)),d.refresh=()=>(h(),d),d.update=d.refresh,d.destroy=()=>(a(),d.remove(),null),d._dispose=a,Ke(d,n),d};const[Gn,Kn]=He.reactive.signal([]),Yn=new Map;function ys(t){const e=Yn.get(t);e&&(clearTimeout(e),Yn.delete(t))}function ws(t){return t?(ys(t),Kn(Gn().filter(e=>e.id!==t)),t):null}function Wo(){for(const t of Yn.keys())ys(t);Kn([])}function gl(t){t!=null&&t.id&&(ys(t.id),t.timeout>0&&Yn.set(t.id,setTimeout(()=>{ws(t.id)},t.timeout)))}function hl(t,e={}){if(!t)return null;let n=null;return Kn(Gn().map(s=>s.id!==t?s:(n=Gt({...s,...e,id:s.id},e.type||e.state||e.color||s.type),n))),n&&gl(n),(n==null?void 0:n.id)||null}function Uo(t){const e=()=>ws(t.id),n=(ie={})=>hl(t.id,ie),s={toast:t,id:t.id,close:e,update:n},o=ie=>typeof ie=="function"?ie(s):ie,r=(()=>{if(t.icon===!1||t.icon===null)return null;if(t.icon!=null){const D=o(t.icon);return typeof D=="string"?he.Icon({name:D,size:"sm"}):JSswift.ui.slot(D,{as:"icon"})}const ie=Bo[t.type];return ie?he.Icon({name:ie,size:"sm"}):null})(),y=J(t.slots,"icon",s,r),u=J(t.slots,"title",s,o(t.title)),i=J(t.slots,"message",s,o(t.message)),b=J(t.slots,"description",s,o(t.description)),T=J(t.slots,"meta",s,o(t.meta)),S=J(t.slots,"actions",s,o(t.actions)),w=J(t.slots,"default",s,o(t.body)),z=J(t.slots,"dismiss",s,o(t.dismiss)),Q=z.length?z:t.closable?[he.Btn({class:"cms-toast-close",outline:!0,size:"xs","aria-label":t.dismissLabel,onClick:e},he.Icon({name:"close",size:"xs"}))]:[],G=_.div({class:ae(["cms-toast",`cms-toast-${t.type}`,`cms-toast-${t.variant}`,fe(t.closable,"is-closable"),t.class]),style:t.style||{},role:t.role},y.length?_.div({class:"cms-toast-icon"},...y):null,_.div({class:"cms-toast-main"},_.div({class:"cms-toast-copy"},u.length?_.div({class:"cms-toast-title"},...u):null,i.length?_.div({class:"cms-toast-message"},...i):null,b.length?_.div({class:"cms-toast-description"},...b):null,w.length?_.div({class:"cms-toast-body"},...w):null,T.length?_.div({class:"cms-toast-meta"},...T):null),S.length?_.div({class:"cms-toast-actions"},...S):null),Q.length?_.div({class:"cms-toast-dismiss"},...Q):null);return Ke(G,t),G}function Go(){let t=document.querySelector(".cms-toast-layer");return t||(t=document.createElement("div"),t.className="cms-toast-layer",document.body.appendChild(t),He.reactive.effect(()=>{const e=Gn();t.innerHTML="";const n=new Map;for(const s of e){const o=fl(s.position);n.has(o)||n.set(o,[]),n.get(o).push(s)}for(const s of dl){const o=n.get(s);if(!(o!=null&&o.length))continue;const r=_.div({class:ae(["cms-toast-wrap",`is-${s}`])},...o.map(y=>Uo(y)));t.appendChild(r)}},"JSswiftUI:toasts"),t)}function Ko(t={}){Go();const e=Gt(t);return e.id=e.id||Math.random().toString(36).slice(2),Kn([...Gn().filter(n=>n.id!==e.id),e]),gl(e),e.id}He.services.notify.show=Ko,He.services.notify.success=Rt("success","Success"),He.services.notify.error=Rt("danger","Error"),He.services.notify.warning=Rt("warning","Warning"),He.services.notify.info=Rt("info","Info"),He.services.notify.primary=Rt("primary","Notice"),He.services.notify.secondary=Rt("secondary","Notice"),He.services.notify.update=hl,He.services.notify.remove=ws,He.services.notify.clear=Wo,He.services.notify.promise=he.Notify.promise,He.notify=He.services.notify,JSswift.form=JSswift.form||{},JSswift.form._isPromise=t=>t&&typeof t.then=="function",JSswift.form._normalizeRules=t=>{const e={};for(const n in t||{}){const s=t[n];e[n]=Array.isArray(s)?s:[s]}return e},JSswift.form._runRule=async(t,e,n)=>{let s=t,o=null;t&&typeof t=="object"&&typeof t.rule=="function"&&(s=t.rule,o=t.message||null);const r=s?s(e,n):!0,y=JSswift.form._isPromise(r)?await r:r;return y===!0?null:typeof y=="string"?y:y===!1?o||"Valore non valido":y?null:o||"Valore non valido"},JSswift.useForm=(t={})=>{const e=t.model||{},n=JSswift.form._normalizeRules(t.rules||{}),s=t.validateOn||"submit",o=t.initial||null,r=_.rod({}),y=_.rod({}),u=_.rod(!1),i=_.rod(null),b=()=>e&&typeof e=="object"&&"value"in e?e.value||{}:e,T=re=>{if(e&&typeof e=="object"&&"value"in e)e.value=re;else{const oe=e||{};for(const le in oe)delete oe[le];Object.assign(oe,re)}},S=re=>{const oe=b();return oe?oe[re]:void 0},w=(re,oe)=>{const le={...b()||{}};le[re]=oe,T(le)},z=(re,oe)=>{const le={...r.value||{}};oe?le[re]=oe:delete le[re],r.value=le},Q=re=>(r.value||{})[re]||null,G=re=>{y.value={...y.value||{},[re]:!0}},ie=re=>!!(y.value||{})[re],D=async re=>{const oe=n[re]||[];if(!oe.length)return z(re,null),!0;const le=S(re),te={name:re,value:le,model:b(),form:me};for(const M of oe){if(!M)continue;const Z=await JSswift.form._runRule(M,le,te);if(Z)return z(re,Z),!1}return z(re,null),!0},$=async()=>{i.value=null;const re=Object.keys(n);let oe=!0;for(const le of re)await D(le)||(oe=!1);return oe},me={model:e,errors:r,touched:y,submitting:u,submitError:i,getValue:S,setValue:w,getError:Q,setError:z,touch:G,isTouched:ie,field:(re,oe={})=>{var F;const le=_.rod("");(F=le.action)==null||F.call(le,X=>{w(re,X)});const te=()=>s==="submit"||s==="input"||s==="blur"?!0:ie(re);let M=null,Z=!1,q=!1;const ue=async()=>{Z||(Z=!0,G(re),(s==="blur"||s==="input")&&await D(re),setTimeout(()=>{Z=!1},0))},R=X=>{M&&(M===X.target||M.contains&&M.contains(X.target)||(ue(),M=null,q&&(q=!1,document.removeEventListener("pointerdown",R,!0))))},g=()=>{q||(q=!0,document.addEventListener("pointerdown",R,!0))},d=async()=>{M=document.activeElement,Z=!1,g(),s==="input"&&await D(re)},m=async()=>{await ue(),M=null,q&&(q=!1,document.removeEventListener("pointerdown",R,!0))};return{name:re,model:le,get value(){return le.value},set value(X){le.value=X},error:()=>te()?Q(re):null,success:oe.success||null,warning:oe.warning||null,note:oe.note||null,touch:()=>G(re),validate:()=>D(re),onInput:d,onBlur:m,hint:oe.hint||null}},validateField:D,validate:$,reset:()=>{i.value=null,r.value={},y.value={},o&&T({...o||{}})},submit:async re=>{u.value=!0,i.value=null;try{return await $()?{ok:!0,result:await(re==null?void 0:re(b(),me))}:{ok:!1,reason:"validation"}}catch(oe){return console.error("[useForm] submit error:",oe),i.value=oe&&oe.message?oe.message:String(oe),{ok:!1,reason:"exception",error:oe}}finally{u.value=!1}}};return me},he.Form=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.form,o=e.onSubmit,r=ae(["cms-form",e.class]),y=JSswift.omit(e,["form","onSubmit"]);y.class=r;const u=_.form({...y,onSubmit:async b=>{b.preventDefault(),s&&await s.submit(o||(async()=>{}))}}),i=[];for(const b of n||[]){const T=typeof b=="function"?b(s):b,S=JSswift.ui.slot(T);S&&(Array.isArray(S)?i.push(...S):i.push(S))}return i.forEach(b=>u.appendChild(b)),s&&s.submitting&&JSswift.reactive.effect(()=>{u.classList.toggle("is-submitting",!!s.submitting.value)},"UI.Form:submitting"),u},He.services=He.services||{},He.services.dialog=He.services.dialog||{},He.dialog=He.services.dialog;let wn=null;function pl(){return wn||(wn=document.createElement("div"),wn.setAttribute("data-cms-modal-root","true"),document.body.appendChild(wn),wn)}he.cardHeader=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=ae(["cms-card-header",fe(e.divider,"divider"),e.class]),r=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);r.class=o;const y={...e.style||{}},u=ze(e.align);u!=null&&!We(e,"align")&&(y.alignItems=u);const i=ze(e.justify);i!=null&&!We(e,"justify")&&(y.justifyContent=i);const b=ze(e.wrap,z=>z?"wrap":"nowrap");b!=null&&!We(e,"wrap")&&(y.flexWrap=b);const T=ze(e.direction);T!=null&&!We(e,"direction")&&(y.flexDirection=T);const S=ze(e.gap,Be);S!=null&&!We(e,"gap")&&(y.gap=S),Object.keys(y).length&&(r.style=y),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const w=_.div(r,...J(s,"default",{},n));return Ke(w,e),w},he.cardBody=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=ae(["cms-card-body",e.class]),r=JSswift.omit(e,["slots","display","direction","wrap","align","justify","gap","rowGap","columnGap","padding","width"]);r.class=o,JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const y=_.div(r,...J(s,"default",{},n));return Ke(y,e),y},he.cardFooter=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=ae(["cms-card-footer",fe(e.divider,"divider"),e.class]),r=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);r.class=o;const y={...e.style||{}},u=ze(e.align);u!=null&&!We(e,"align")&&(y.alignItems=u);const i=ze(e.justify);i!=null&&!We(e,"justify")&&(y.justifyContent=i);const b=ze(e.wrap,z=>z?"wrap":"nowrap");b!=null&&!We(e,"wrap")&&(y.flexWrap=b);const T=ze(e.direction);T!=null&&!We(e,"direction")&&(y.flexDirection=T);const S=ze(e.gap,Be);S!=null&&!We(e,"gap")&&(y.gap=S),Object.keys(y).length&&(r.style=y),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const w=_.div(r,...J(s,"default",{},n));return Ke(w,e),w},he.Dialog=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=["primary","secondary","warning","danger","success","info","light","dark"],r=["xs","sm","md","lg","xl","full"];let y={...e},u=null,i=null;const b=(g,d)=>typeof g=="function"?g(d):g,T=g=>String(g||"").split(/\s+/).filter(Boolean),S=(g,d,m)=>{if(!g)return;const F=g[d]||[];F.length&&g.classList.remove(...F);const X=(m||[]).filter(Boolean);X.length&&g.classList.add(...X),g[d]=X},w=(g,d,m,F=X=>X)=>{if(g){if(m==null||m===""){g.style.removeProperty(d);return}g.style.setProperty(d,F(m))}},z=()=>{var a,C,h,P,j,U;const g=window.visualViewport,d=Math.max(0,Math.round((a=g==null?void 0:g.offsetLeft)!=null?a:0)),m=Math.max(0,Math.round((C=g==null?void 0:g.offsetTop)!=null?C:0)),F=Math.max(0,Math.round((P=(h=g==null?void 0:g.width)!=null?h:window.innerWidth)!=null?P:0)),X=Math.max(0,Math.round((U=(j=g==null?void 0:g.height)!=null?j:window.innerHeight)!=null?U:0));return{left:d,top:m,width:F,height:X}},Q=g=>{if(!(g!=null&&g.panel))return;const{left:d,top:m,width:F,height:X}=z();w(g.panel,"position","fixed"),w(g.panel,"inset",0,a=>`${a}px`),w(g.panel,"top",m,a=>`${a}px`),w(g.panel,"left",d,a=>`${a}px`),w(g.panel,"right","auto"),w(g.panel,"bottom","auto"),w(g.panel,"width",F,a=>`${a}px`),w(g.panel,"height",X,a=>`${a}px`),w(g.panel,"min-height",X,a=>`${a}px`),w(g.panel,"max-width",F,a=>`${a}px`),w(g.panel,"max-height",X,a=>`${a}px`),w(g.panel,"min-width",0,a=>`${a}px`),w(g.panel,"margin",0,a=>`${a}px`),w(g.panel,"box-sizing","border-box"),w(g.panel,"border-width",0,a=>`${a}px`),w(g.panel,"border-radius",0,a=>`${a}px`),w(g.panel,"transform","none"),w(g.panel,"overflow","hidden"),w(g.panel,"--cms-dialog-fullscreen-left",d,a=>`${a}px`),w(g.panel,"--cms-dialog-fullscreen-top",m,a=>`${a}px`),w(g.panel,"--cms-dialog-fullscreen-width",F,a=>`${a}px`),w(g.panel,"--cms-dialog-fullscreen-height",X,a=>`${a}px`)},G=g=>{g!=null&&g.panel&&(w(g.panel,"position",null),w(g.panel,"inset",null),w(g.panel,"top",null),w(g.panel,"left",null),w(g.panel,"right",null),w(g.panel,"bottom",null),w(g.panel,"width",null),w(g.panel,"height",null),w(g.panel,"min-height",null),w(g.panel,"max-width",null),w(g.panel,"max-height",null),w(g.panel,"min-width",null),w(g.panel,"margin",null),w(g.panel,"box-sizing",null),w(g.panel,"border-width",null),w(g.panel,"border-radius",null),w(g.panel,"transform",null),w(g.panel,"overflow",null),w(g.panel,"--cms-dialog-fullscreen-left",null),w(g.panel,"--cms-dialog-fullscreen-top",null),w(g.panel,"--cms-dialog-fullscreen-width",null),w(g.panel,"--cms-dialog-fullscreen-height",null))},ie=(g,d)=>{var h,P,j,U,ce;if(!g)return;if((h=g._dialogViewportCleanup)==null||h.call(g),g._dialogViewportCleanup=null,!d){G(g);return}let m=null;const F=globalThis.requestAnimationFrame||(L=>setTimeout(()=>L(Date.now()),0)),X=globalThis.cancelAnimationFrame||clearTimeout,a=()=>Q(g),C=()=>{m!=null&&X(m),m=F(()=>{m=null,a()})};a(),C(),window.addEventListener("resize",a),window.addEventListener("orientationchange",C),(j=(P=window.visualViewport)==null?void 0:P.addEventListener)==null||j.call(P,"resize",a),(ce=(U=window.visualViewport)==null?void 0:U.addEventListener)==null||ce.call(U,"scroll",C),g._dialogViewportCleanup=()=>{var L,f,k,A;m!=null&&(X(m),m=null),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",C),(f=(L=window.visualViewport)==null?void 0:L.removeEventListener)==null||f.call(L,"resize",a),(A=(k=window.visualViewport)==null?void 0:k.removeEventListener)==null||A.call(k,"scroll",C)}},D=()=>y,$=g=>{var m;const d=l((m=g.state)!=null?m:g.color);return d?o.includes(d)?d:String(d):""},Y=g=>{const d=l(g.size);return typeof d=="string"&&r.includes(d)?d:""},W=g=>{var m,F,X;const d=String(l((X=(F=(m=g.actionsAlign)!=null?m:g.footerAlign)!=null?F:g.alignActions)!=null?X:"end")).toLowerCase();return["start","left"].includes(d)?"start":["center","middle"].includes(d)?"center":["between","space-between"].includes(d)?"between":["stretch","full"].includes(d)?"stretch":"end"},se=g=>{var m,F,X;const d=String(l((X=(F=(m=g.align)!=null?m:g.verticalAlign)!=null?F:g.position)!=null?X:"center")).toLowerCase();return["top","start","flex-start"].includes(d)?"cms-dialog-align-top":["bottom","end","flex-end"].includes(d)?"cms-dialog-align-bottom":""},me=g=>{var m,F;return((F=(m=g.closable)!=null?m:g.dismissible)!=null?F:g.closeButton)!==!1},re=()=>{var H,ge,Se,ye,V,O,K,ke;const g=D(),d={close:Z,dismiss:Z,open:M,toggle:ue,update:te,isOpen:q,entry:()=>u,props:g},m=g.icon!=null?typeof g.icon=="string"?he.Icon({name:g.icon,size:g.iconSize||"md"}):JSswift.ui.slot(g.icon,{as:"icon"}):null,F=J(s,"eyebrow",d,b(g.eyebrow,d)),X=J(s,"title",d,b((ge=(H=g.title)!=null?H:g.heading)!=null?ge:g.header,d)),a=J(s,"subtitle",d,b((Se=g.subtitle)!=null?Se:g.description,d)),C=J(s,"icon",d,m),h=J(s,"header",d,b((ye=g.headerContent)!=null?ye:g.head,d)),P=me(g)?J(s,"close",d,he.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":g.closeLabel||"Chiudi dialog","data-dialog-close":!0},he.Icon({name:g.closeIcon||"close",size:"sm"}))):[],j=(K=(O=(V=g.content)!=null?V:g.body)!=null?O:g.message)!=null?K:n&&n.length?n:null;let U=J(s,"content",d,b(j,d));U.length||(U=J(s,"body",d,b(j,d))),U.length||(U=J(s,"default",d,b(j,d)));const ce=b((ke=g.footer)!=null?ke:g.actions,d);let L=J(s,"footer",d,ce);L.length||(L=J(s,"actions",d,ce));let f=null;h.length?f=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...h):(F.length||X.length||a.length||C.length||P.length)&&(f=_.div({class:"cms-dialog-head"},C.length?_.div({class:"cms-dialog-icon"},...C):null,_.div({class:"cms-dialog-head-main"},F.length?_.div({class:"cms-dialog-eyebrow"},...F):null,X.length?_.div({class:"cms-dialog-title"},...X):null,a.length?_.div({class:"cms-dialog-subtitle"},...a):null),P.length?_.div({class:"cms-dialog-close-wrap"},...P):null));const k=_.div({class:ae(["cms-dialog-body",g.bodyClass])},...U),A=L.length?_.div({class:ae(["cms-dialog-actions",`is-${W(g)}`,fe(g.stackActions,"is-stacked"),g.actionsClass,g.footerClass])},...L):null;return _.div({class:ae(["cms-dialog-shell",fe(!!f,"has-head"),fe(!!A,"has-footer"),fe(g.divider!==!1,"with-divider")])},...[f,k,A].filter(Boolean))},oe=g=>{var X;if(!(g!=null&&g.panel))return;const d=D(),m=$(d),F=Y(d);S(g.panel,"_dialogClassTokens",["cms-dialog","cms-singularity","cms-clear-set",F?`cms-dialog-${F}`:"",m,m?`cms-state-${m}`:"",l(d.fullscreen)?"fullscreen":"",l(d.scrollable)?"scrollable":"",l(d.stickyHeader)?"sticky-head":"",l(d.stickyActions)?"sticky-actions":"",l(d.borderless)?"borderless":"",...T(d.class),...T(d.panelClass)]),S(g.overlay,"_dialogOverlayClassTokens",[se(d),l(d.backdropBlur)?"cms-dialog-overlay-blur":"",...T(d.overlayClass)]),w(g.panel,"--cms-dialog-width",l(d.width),Be),w(g.panel,"--cms-dialog-min-width",l(d.minWidth),Be),w(g.panel,"--cms-dialog-max-width",l(d.maxWidth),Be),w(g.panel,"--cms-dialog-max-height",l(d.maxHeight),Be),w(g.panel,"--cms-dialog-body-max-height",l((X=d.bodyMaxHeight)!=null?X:d.contentMaxHeight),Be),d.style&&Object.assign(g.panel.style,d.style),Ke(g.panel,d),ie(g,l(d.fullscreen)),g.panel.setAttribute("role",d.role||"dialog"),g.panel.setAttribute("aria-modal",d.modal===!1?"false":"true"),d.ariaLabel?g.panel.setAttribute("aria-label",d.ariaLabel):g.panel.removeAttribute("aria-label")},le=()=>{u!=null&&u.panel&&u.panel.replaceChildren(re())},te=(g={})=>(g&&typeof g=="object"&&(y={...y,...g}),u&&(oe(u),le()),R),M=(g=null)=>{var X,a,C,h,P;if(g&&typeof g=="object"&&(y={...y,...g}),u)return oe(u),le(),u;i=document.activeElement;const d=D(),m=d.persistent===!0;u=JSswift.overlay.open(()=>re(),{type:"dialog",backdrop:d.backdrop!==!1,lockScroll:d.lockScroll!==!1,trapFocus:d.trapFocus!==!1,autoFocus:d.autoFocus!==!1,closeOnOutside:(X=d.closeOnOutside)!=null?X:!m,closeOnBackdrop:(a=d.closeOnBackdrop)!=null?a:!m,closeOnEsc:(C=d.closeOnEsc)!=null?C:!m,className:Dt(["cms-dialog"]),onClose:()=>{var j,U,ce,L;(j=u==null?void 0:u._dialogViewportCleanup)==null||j.call(u),(U=u==null?void 0:u.panel)==null||U.removeEventListener("click",F),u=null,(L=(ce=D()).onClose)==null||L.call(ce),i&&typeof i.focus=="function"&&setTimeout(()=>i.focus(),0)}});const F=j=>{const U=j.target;U&&U.closest&&U.closest("[data-dialog-close]")&&Z()};return u.panel.addEventListener("click",F),oe(u),bn(u),(P=(h=D()).onOpen)==null||P.call(h,u),u},Z=()=>{if(!u)return;const g=u;yn(g,()=>JSswift.overlay.close(g.id))},q=()=>!!u,ue=(g=null)=>q()?(Z(),null):M(g),R={open:M,close:Z,toggle:ue,update:te,isOpen:q,entry:()=>u,props:()=>({...y})};return R},he.TabPanel=(...t)=>{var Ne,ee,xe,be,Ce,pe,Ie,_e,I,we,E,x,v;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=Array.isArray(e.tabs)?e.tabs:Array.isArray(e.items)?e.items:[],r=Nt(e.model,"UI.TabPanel:model"),y=e.id||"cms-tabpanel-"+Math.random().toString(36).slice(2,9),u=c=>String(l(c)||"vertical").toLowerCase()==="horizontal"?"horizontal":"vertical",i=c=>String(l(c)||"before").toLowerCase()==="after"?"after":"before",b=c=>{const N=String(l(c)||"").toLowerCase();return N==="pills"||N==="pill"?"pills":N==="soft"||N==="card"?"soft":"line"},T=c=>{const N=l(c);return N==null||N===""?null:JSswift.uiColors.includes(N)?`var(--cms-${N})`:String(N)},S=u(e.orientation||e.orient||e.direction),w=i(e.navPosition||e.barPosition||e.position),z=b(e.variant||(e.pills?"pills":e.soft?"soft":"line")),Q=!!e.wrap,G=!!e.swipeable,ie=!!e.infinite,D=!!e.animated,$=!!((ee=(Ne=e.navFill)!=null?Ne:e.fill)!=null?ee:e.stretch),Y=!!e.disabled,W=l((xe=e.transitionDuration)!=null?xe:e["transition-duration"]),se=(()=>{if(W==null)return 220;if(typeof W=="number")return W;const c=parseFloat(W);return Number.isFinite(c)?c:220})(),me=l((be=e.transitionEasing)!=null?be:e["transition-easing"])||"ease",re=(pe=(Ce=e.transitionPrev)!=null?Ce:e["transition-prev"])!=null?pe:null,oe=(_e=(Ie=e.transitionNext)!=null?Ie:e["transition-next"])!=null?_e:null,le=T((I=e.color)!=null?I:e.state),te=o.map((c,N)=>{var De,Ue,Ye,Ze,Qe,Te,je,tt,nt,ut,dt,bt,lt,ft,vt,_t;if(c==null)return null;if(typeof c!="object")return{name:c,labelFallback:c,panelFallback:null,noteFallback:null,iconFallback:null,badgeFallback:null,hidden:!1,raw:c,index:N};const de=(Te=(Qe=(Ze=(Ye=(Ue=(De=c.name)!=null?De:c.value)!=null?Ue:c.id)!=null?Ye:c.key)!=null?Ze:c.label)!=null?Qe:c.title)!=null?Te:`tab-${N}`,Ae=c.label!=null||c.title!=null,Je=Ae?(je=c.label)!=null?je:c.title:c.children!=null&&c.content==null&&c.panel==null?c.children:(nt=(tt=c.name)!=null?tt:c.value)!=null?nt:`Tab ${N+1}`,B=(bt=(dt=(ut=c.content)!=null?ut:c.panel)!=null?dt:c.body)!=null?bt:Ae?c.children:null,Le=(vt=(ft=(lt=c.note)!=null?lt:c.subtitle)!=null?ft:c.description)!=null?vt:null,Me=(_t=c.icon)!=null?_t:null,Ee=Object.prototype.hasOwnProperty.call(c,"badge")?c.badge:Object.prototype.hasOwnProperty.call(c,"counter")?c.counter:null;return{...c,name:de,labelFallback:Je,panelFallback:B,noteFallback:Le,iconFallback:Me,badgeFallback:Ee,index:N}}).filter(Boolean).filter(c=>c.hidden!==!0&&c.visible!==!1),M=ae(["cms-clear-set","cms-tabpanel","cms-singularity",S,`variant-${z}`,fe(Q,"wrap"),fe(D,"animated"),fe($,"nav-fill"),fe(Y,"disabled"),fe(w==="after","nav-after"),e.class]),Z=JSswift.omit(e,["tabs","items","value","default","defaultValue","model","orientation","orient","direction","navPosition","barPosition","position","variant","pills","soft","navFill","fill","stretch","wrap","swipeable","infinite","animated","transitionDuration","transition-duration","transitionEasing","transition-easing","transitionPrev","transition-prev","transitionNext","transition-next","slots","empty","tabClass","tabStyle","panelClass","panelStyle","navClass","panelsClass","class","style"]);Z.class=M,Z.style=e.style;const q=_.div(Z);D&&(q.style.setProperty("--cms-tabpanel-duration",`${se}ms`),q.style.setProperty("--cms-tabpanel-easing",me)),le&&q.style.setProperty("--cms-tabpanel-accent",le);const ue=_.div({class:ae(["cms-tabpanel-nav",e.navClass]),role:"tablist","aria-orientation":S}),R=_.div({class:ae(["cms-tabpanel-panels",e.panelsClass])}),g=[],d=[];let m=-1;const F=()=>S==="horizontal",X=(c,N,de)=>({tab:c,name:c.name,index:N,active:de,value:c.name,select:()=>Se(N),next:()=>V(),prev:()=>O()}),a=(c,N,de=!1)=>{var Je;if(!te.length)return-1;let Ae=c;for(let B=0;B<te.length;B+=1){if(Ae+=N,Ae>=te.length){if(!de)return-1;Ae=0}else if(Ae<0){if(!de)return-1;Ae=te.length-1}if(!((Je=te[Ae])!=null&&Je.disabled))return Ae}return-1},C=c=>{var de;const N=(de=g[c])==null?void 0:de.btn;!N||typeof N.focus!="function"||requestAnimationFrame(()=>N.focus())},h=(c,N,de)=>{const Ae=X(c,N,de),Je=JSswift.ui.renderSlot(s,"label",Ae,c.labelFallback);return J(null,"default",{},Je)},P=(c,N)=>{var tt,nt,ut,dt,bt;const de=N===m,Ae=`${y}-tab-${N}`,Je=`${y}-panel-${N}`,B=X(c,N,de),Le=h(c,N,de),Me=c.iconFallback!=null?typeof c.iconFallback=="string"?he.Icon({name:c.iconFallback,size:(ut=(nt=(tt=c.iconSize)!=null?tt:c.size)!=null?nt:e.size)!=null?ut:null}):c.iconFallback:null,Ee=J(s,"icon",B,Me),De=J(s,"note",B,c.noteFallback),Ue=J(s,"badge",B,c.badgeFallback),Ye=_.span({class:"cms-tabpanel-tab-inner"},Ee.length?_.span({class:"cms-tabpanel-tab-icon"},...Ee):null,_.span({class:"cms-tabpanel-tab-copy"},_.span({class:"cms-tabpanel-tab-label"},...Le.length?Le:[""]),De.length?_.span({class:"cms-tabpanel-tab-note"},...De):null),Ue.length?_.span({class:"cms-tabpanel-tab-badge"},...Ue):null),Ze=J(s,"tab",{...B,label:Le,icon:Ee,note:De,badge:Ue,tabId:Ae,panelId:Je},Ye),Qe=lt=>{if(Y||c.disabled)return;const ft=lt.key;if(ft==="Enter"||ft===" "){lt.preventDefault(),Se(N);return}if(ft==="Home"){lt.preventDefault();const rt=te.findIndex(Vt=>!Vt.disabled);rt>=0&&(Se(rt),C(rt));return}if(ft==="End"){lt.preventDefault();const rt=(()=>{var Vt;for(let Mt=te.length-1;Mt>=0;Mt-=1)if(!((Vt=te[Mt])!=null&&Vt.disabled))return Mt;return-1})();rt>=0&&(Se(rt),C(rt));return}const vt=F()?["ArrowLeft"]:["ArrowUp"],_t=F()?["ArrowRight"]:["ArrowDown"];if(vt.includes(ft)){lt.preventDefault();const rt=a(N,-1,ie);rt>=0&&(Se(rt,{dir:"prev"}),C(rt));return}if(_t.includes(ft)){lt.preventDefault();const rt=a(N,1,ie);rt>=0&&(Se(rt,{dir:"next"}),C(rt))}},Te=he.Btn({class:ae(["cms-tabpanel-tab",fe(de,"active"),fe(c.disabled||Y,"disabled"),e.tabClass,c.tabClass||c.class]),type:"button",id:Ae,role:"tab",disabled:!!(c.disabled||Y),"aria-selected":de?"true":"false","aria-controls":Je,tabindex:de?"0":"-1",outline:z==="pills"&&!de,color:z==="pills"&&de?c.color||e.color||e.state||"primary":null,size:(bt=(dt=c.size)!=null?dt:e.size)!=null?bt:null,style:{...e.tabStyle||{},...c.tabStyle||{}},onClick:()=>{c.disabled||Y||Se(N)},onKeydown:Qe},...Ze),je=_.div({class:ae(["cms-tabpanel-nav-btn",fe(de,"active"),c.navClass]),"data-name":c.name},Te,_.span({class:"tab-indicator"}));return g[N]={btn:Te,wrap:je,index:N},je},j=(c,N)=>{const de=N===m,Ae=`${y}-tab-${N}`,Je=`${y}-panel-${N}`,B=X(c,N,de),Le=JSswift.ui.renderSlot(s,"panel",B,c.panelFallback),Me=_.div({class:ae(["cms-tabpanel-panel",fe(de,"active"),e.panelClass,c.panelClass]),style:{...e.panelStyle||{},...c.panelStyle||{}},"data-name":c.name,role:"tabpanel",id:Je,tabindex:0,"aria-labelledby":Ae,"aria-hidden":de?"false":"true"},...J(null,"default",{},Le));return d[N]=Me,Me},U=te.map((c,N)=>P(c,N)),ce=JSswift.ui.renderSlot(s,"nav",{tabs:te,active:()=>{var c;return m>=0?(c=te[m])==null?void 0:c.name:null},activeIndex:()=>m,activeTab:()=>m>=0?te[m]:null,select:c=>{typeof c=="number"?Se(c):ye(c)},next:()=>V(),prev:()=>O(),nodes:U,orientation:S,position:w,variant:z},U);J(null,"default",{},ce).forEach(c=>ue.appendChild(c)),te.length?te.forEach((c,N)=>R.appendChild(j(c,N))):J(s,"empty",{tabs:te},(we=e.empty)!=null?we:_.div({class:"cms-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(N=>R.appendChild(N));const L=c=>{if(!D)return;const N=c==="next"?"18px":"-18px",de=c==="next"?"-18px":"18px";q.style.setProperty("--cms-tabpanel-enter",N),q.style.setProperty("--cms-tabpanel-leave",de)},f=()=>{const c=[];re&&c.push(...String(re).split(/\s+/)),oe&&c.push(...String(oe).split(/\s+/)),c.length&&R.classList.remove(...c.filter(Boolean))},k=c=>{f();const N=c==="prev"?re:oe;if(!N)return;const de=String(N).split(/\s+/).filter(Boolean);de.length&&(R.classList.add(...de),setTimeout(()=>R.classList.remove(...de),se+40))},A=c=>{var Ae;const N=g.find(({btn:Je})=>Je.classList.contains("active")),de=(Ae=N==null?void 0:N.btn.parentNode)==null?void 0:Ae.getBoundingClientRect();g.forEach(({btn:Je,index:B})=>{const Le=B===c,Me=Je.parentNode;if(!Me)return;const Ee=Me.getBoundingClientRect();Me.isConnected&&de&&(Me.style.setProperty("--nav-pos-x",de.left-Ee.left+"px"),Me.style.setProperty("--nav-pos-y",de.top-Ee.top+"px")),Me.classList.toggle("active",Le),Je.classList.toggle("active",Le),Je.setAttribute("aria-selected",Le?"true":"false"),Je.setAttribute("tabindex",Le?"0":"-1")})},H=(c,N,de)=>{L(de),d.forEach((Ae,Je)=>{if(!Ae)return;const B=Je===N,Le=Je===c;B?(Ae.classList.add("active"),Ae.classList.remove("leaving"),Ae.setAttribute("aria-hidden","false")):(Ae.classList.remove("active"),Ae.setAttribute("aria-hidden","true"),D&&Le?(Ae.classList.add("leaving"),setTimeout(()=>Ae.classList.remove("leaving"),se+40)):Ae.classList.remove("leaving"))})},ge=(c,N)=>c<0||c===N||ie&&c===te.length-1&&N===0?"next":ie&&c===0&&N===te.length-1?"prev":N>c?"next":"prev",Se=(c,N={})=>{var B,Le;if(c==null||c<0||c>=te.length||(B=te[c])!=null&&B.disabled)return;const de=m;if(de===c)return;m=c;const Ae=te[c],Je=N.dir||ge(de,c);r&&!N.fromModel&&r.set(Ae.name),A(c),H(de,c,Je),k(Je),q.dataset.active=String(Ae.name),(Le=e.onChange)==null||Le.call(e,Ae.name,Ae,c)},ye=(c,N={})=>{if(!te.length)return;const de=te.findIndex(Ae=>Ae.name==c);de!==-1&&Se(de,N)},V=()=>{if(!te.length)return;const c=m<0?te.findIndex(N=>!N.disabled):a(m,1,ie);c<0||Se(c,{dir:"next"})},O=()=>{if(!te.length)return;const c=m<0?(()=>{var N;for(let de=te.length-1;de>=0;de-=1)if(!((N=te[de])!=null&&N.disabled))return de;return-1})():a(m,-1,ie);c<0||Se(c,{dir:"prev"})};if(G){let c=0,N=0,de=!1;const Ae=42;R.addEventListener("pointerdown",Je=>{Je.button!=null&&Je.button!==0||(de=!0,c=Je.clientX,N=Je.clientY)}),R.addEventListener("pointerup",Je=>{if(!de)return;de=!1;const B=Je.clientX-c,Le=Je.clientY-N;Math.abs(B)<Ae||Math.abs(B)<Math.abs(Le)||(B<0?V():O())}),R.addEventListener("pointercancel",()=>{de=!1}),R.addEventListener("pointerleave",()=>{de=!1})}const K=r?r.get():(v=(x=(E=e.value)!=null?E:e.defaultValue)!=null?x:e.default)!=null?v:null;if(te.length){const c=te.findIndex(N=>N.name==K);if(c>=0)Se(c,{fromModel:!0});else{const N=te.findIndex(de=>!de.disabled);N>=0&&(Se(N,{fromModel:!0}),r&&r.set(te[N].name))}}return r&&r.watch(c=>ye(c,{fromModel:!0}),"UI.TabPanel:watch"),w==="after"?(q.appendChild(R),q.appendChild(ue)):(q.appendChild(ue),q.appendChild(R)),J(s,"default",{},n).forEach(c=>q.appendChild(c)),Ke(q,e),q._tabs=()=>te.slice(),q._active=()=>m>=0?te[m]:null,q._getValue=()=>{var c;return m>=0?(c=te[m])==null?void 0:c.name:null},q._setValue=c=>ye(c),q._select=c=>{typeof c=="number"?Se(c):ye(c)},q._next=V,q._prev=O,q};function Yo(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function vs({title:t,message:e,contentNode:n,okText:s,cancelText:o,showCancel:r,onOk:y,onCancel:u,persistent:i}){pl();const b=_.div({class:"cms-dialog-backdrop",onClick:G=>{G.target===b&&i!==!0&&(u==null||u())}}),T=J(null,"default",{},t),S=J(null,"default",{},e),w=J(null,"default",{},n),z=_.div({class:"cms-dialog cms-panel"},T.length?_.h3(...T):null,S.length?_.p(...S):null,...w,_.div({class:"cms-dialog-actions"},r?JSswift.ui.Btn({onClick:u},o||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:y},s||"OK")));b.appendChild(z),pl().appendChild(b);const Q=G=>{G.key==="Escape"&&(u==null||u())};return document.addEventListener("keydown",Q,{once:!0}),{backdrop:b,close:()=>Yo(b)}}He.dialog.alert=function(t,e={}){return new Promise(n=>{const{backdrop:s,close:o}=vs({title:e.title||"Info",message:t,okText:e.okText||"OK",showCancel:!1,persistent:e.persistent,onOk:()=>{o(),n(!0)},onCancel:()=>{o(),n(!0)}})})},He.dialog.confirm=function(t={}){return new Promise(e=>{const{close:n}=vs({title:t.title||"Conferma",message:t.message||"",okText:t.okText||"Conferma",cancelText:t.cancelText||"Annulla",showCancel:!0,persistent:t.persistent,onOk:()=>{n(),e(!0)},onCancel:()=>{n(),e(!1)}})})},He.dialog.prompt=function(t={}){return new Promise(e=>{const n=JSswift.ui.Input({class:"cms-dialog-input",type:t.type||"text",placeholder:t.placeholder||""});t.value!=null&&(n.value=String(t.value));const{close:s}=vs({title:t.title||"Inserisci valore",message:t.message||"",okText:t.okText||"OK",cancelText:t.cancelText||"Annulla",showCancel:!0,contentNode:_.div(n),persistent:t.persistent,onOk:()=>{const o=n.value;s(),e(o)},onCancel:()=>{s(),e(null)}});setTimeout(()=>n.focus(),0)})},He.services=He.services||{},He.services.loading=He.services.loading||{},He.loading=He.services.loading;let kt=null,In=0;function bl(){if(kt)return kt;kt=document.createElement("div"),kt.className="cms-loading-backdrop",kt.style.cssText=`
|
|
2
2
|
position: fixed; inset: 0;
|
|
3
3
|
background: rgba(0,0,0,0.45);
|
|
4
4
|
display: none;
|
|
@@ -29,6 +29,6 @@ height: 100%;
|
|
|
29
29
|
width: 0%;
|
|
30
30
|
background: var(--cms-primary);
|
|
31
31
|
transition: width 200ms ease;
|
|
32
|
-
`,s.appendChild(o);const r=document.createElement("div");r.style.cssText="display:flex; gap: 12px; align-items:center; width: 100%;",r.appendChild(e),r.appendChild(n),t.appendChild(r),t.appendChild(s),kt.appendChild(t),document.body.appendChild(kt);const
|
|
32
|
+
`,s.appendChild(o);const r=document.createElement("div");r.style.cssText="display:flex; gap: 12px; align-items:center; width: 100%;",r.appendChild(e),r.appendChild(n),t.appendChild(r),t.appendChild(s),kt.appendChild(t),document.body.appendChild(kt);const y=document.createElement("style");return y.textContent=`
|
|
33
33
|
@keyframes cmsSpin { to { transform: rotate(360deg); } }
|
|
34
|
-
`,document.head.appendChild(v),kt._textNode=n,kt._spinner=e,kt._progressWrap=s,kt._progressBar=o,kt._progressActive=!1,kt}function yl(t,e){if(typeof t=="object"&&t!==null)return{...t};const n=e&&typeof e=="object"?e:{};return typeof e=="string"&&(t==null||typeof t=="number")?{...n,message:e}:{...n,message:t}}function wl(t,e){const n=e==="progress";t._spinner.style.display=n?"none":"",t._progressWrap.style.display=n?"block":"none",t._mode=e}He.loading.show=function(t="Loading...",e={}){const n=bl(),s=yl(t,e);In++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",wl(n,"spinner"),s.spinner===!1&&(n._spinner.style.display="none"),n.style.display="flex"},He.loading.hide=function(){kt&&(In=Math.max(0,In-1),In===0&&(kt.style.display="none",kt._progressActive=!1))},He.loading.progress=function(t=0,e={}){var r;const n=bl();typeof t=="object"&&t!==null&&(e=t,t=(r=t.value)!=null?r:0);const s=yl(null,e);n._progressActive||(In++,n._progressActive=!0);const o=Math.max(0,Math.min(100,Number(t!=null?t:0)));n._textNode.textContent=s.message||"Loading...",n._progressBar.style.width=o+"%",wl(n,"progress"),n.style.display="flex"},He.loading.wrap=async function(t,e){He.loading.show(t);try{return await e()}finally{He.loading.hide()}};function Yo(t){return typeof t=="function"?t():t||[]}function Ss(t,e){if(!(t==null||e==null))return typeof e!="string"||e.indexOf(".")<0?t==null?void 0:t[e]:e.split(".").reduce((n,s)=>n==null?n:n[s],t)}function qo(t,e){return t==null&&e==null?0:t==null?-1:e==null?1:typeof t=="number"&&typeof e=="number"?t-e:String(t).localeCompare(String(e),void 0,{numeric:!0,sensitivity:"base"})}function Xo(t){const e=Yo(t);return Array.isArray(e)?e:[]}function vl(t){var e,n,s,o;return(o=(s=(n=(e=t==null?void 0:t.label)!=null?e:t==null?void 0:t.title)!=null?n:t==null?void 0:t.header)!=null?s:t==null?void 0:t.key)!=null?o:""}function Cs(t,e){var n,s;return(s=(n=t==null?void 0:t.sortKey)!=null?n:t==null?void 0:t.key)!=null?s:`__col_${e}`}function Sl(t,e){return t.find((n,s)=>Cs(n,s)===e||(n==null?void 0:n.key)===e)||null}function qn(t,e,n){return t?typeof t.get=="function"?t.get(e,{row:e,rowIndex:n,col:t}):typeof t.value=="function"?t.value(e,{row:e,rowIndex:n,col:t}):typeof t.key=="string"?Ss(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function Xn(t,e){return typeof t=="function"?t(e)||{}:t||{}}function Qn(t){if(t==null)return"";if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return t.map(Qn).filter(Boolean).join(" ");if(typeof Node!="undefined"&&t instanceof Node)return t.textContent||"";if(typeof t=="object"){if(typeof t.textContent=="string")return t.textContent;try{return JSON.stringify(t)}catch(e){return""}}return String(t)}function Qo(t,e){const s=(Array.isArray(t)?t:e).map(o=>Number(o)).filter(o=>Number.isFinite(o)&&o>0);return s.length?Array.from(new Set(s)):e}function Zo(t,e,n,s){const o=s.searchBy||s.searchPredicate;if(typeof o=="function")return!!o(t,{query:n,columns:e});const r=String(n||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(!r.length)return!0;const v=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var R;return(R=b==null?void 0:b.searchKey)!=null?R:b==null?void 0:b.key}).filter(Boolean),u=[];if(v.length)for(const b of v)if(typeof b=="function")u.push(Qn(b(t)));else{const R=e.find(S=>(S==null?void 0:S.key)===b||(S==null?void 0:S.searchKey)===b);u.push(Qn(R?qn(R,t,-1):Ss(t,b)))}else u.push(Qn(t));const i=u.join(" ").toLowerCase();return r.every(b=>i.includes(b))}he.Table=(...t)=>{var Ne,ee,xe,be;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=Array.isArray(e.columns)?e.columns:[],r=Qo(e.pageSizeOptions,[5,10,20,50]),v=Number((ee=(Ne=e.pageSize)!=null?Ne:r[0])!=null?ee:10)||10,u=Array.from(new Set([...r,v])).sort((Ce,pe)=>Ce-pe),i=e.initialSort||(e.sortBy?{key:e.sortBy,dir:e.sortDir==="desc"?"desc":"asc"}:null),b=e.searchable===!0||typeof e.searchable=="string"||e.searchPlaceholder!=null||e.search!=null||e.query!=null||!!e.searchModel||!!e.queryModel||Array.isArray(e.searchKeys)||typeof e.searchBy=="function"||typeof e.searchPredicate=="function",R=Nt(e.searchModel||e.queryModel,"UI.Table:query"),[S,y]=He.reactive.signal(Math.max(1,Number(e.page||1)||1)),[P,Q]=He.reactive.signal(v),[G,ie]=He.reactive.signal(i),[D,$]=He.reactive.signal(String((be=R?R.get():(xe=e.search)!=null?xe:e.query)!=null?be:"")),Y=Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),R&&R.set(pe),y(1)},W=Ce=>{const pe=Number(Ce)||v;Q(pe),y(1)},le=(Ce,pe)=>{const Ie=Cs(Ce,pe),_e=G();!_e||_e.key!==Ie&&_e.key!==(Ce==null?void 0:Ce.key)?ie({key:Ie,dir:"asc"}):_e.dir==="asc"?ie({key:Ie,dir:"desc"}):ie(null),y(1)};let me=null;R&&R.watch(Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),me&&me.value!==pe&&(me.value=pe),y(1)},"UI.Table:queryWatch");const re=JSswift.omit(e,["columns","rows","rowKey","loading","page","pageSize","pageSizeOptions","pagination","initialSort","sortBy","sortDir","search","query","searchable","searchPlaceholder","searchKeys","searchBy","searchPredicate","searchModel","queryModel","filter","actions","actionsLabel","emptyText","loadingText","onRowClick","onRowDblClick","tableClass","tableStyle","cardClass","dense","striped","hover","stickyHeader","toolbar","toolbarStart","toolbarEnd","caption","footer","status","rowClass","rowAttrs","minTableWidth","hideHeader","hideFooter","slots","body"]);re.class=ae(["cms-table-card",e.class,e.cardClass]),e.dense!=null&&(re.dense=e.dense);const oe=_.div({class:"cms-table-shell"}),se=E(s,"default",{},n);se.length&&oe.appendChild(_.div({class:"cms-table-lead"},...se));const te=E(s,"toolbarStart",{},e.toolbarStart),M=E(s,"toolbar",{},e.toolbar),Z=E(s,"toolbarEnd",{},e.toolbarEnd),q=_.div({class:"cms-table-toolbar"}),ue=_.div({class:"cms-table-toolbar-main"}),L=_.div({class:"cms-table-toolbar-side"});te.forEach(Ce=>ue.appendChild(Ce)),M.forEach(Ce=>ue.appendChild(Ce));const f=E(s,"search",{query:D(),getQuery:D,setQuery:Y},null);if(f.length)f.forEach(Ce=>L.appendChild(Ce));else if(b){me=_.input({type:"search",class:"cms-input",placeholder:typeof e.searchable=="string"?e.searchable:e.searchPlaceholder||"Cerca nella tabella",value:String(D()||"")}),me.addEventListener("input",()=>Y(me.value));const Ce=he.Btn({class:"cms-table-search-clear",outline:!0,onClick:()=>{me&&(me.value=""),Y("")}},"Reset");L.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),me,Ce))}Z.forEach(Ce=>L.appendChild(Ce)),(ue.childNodes.length||L.childNodes.length)&&(q.appendChild(ue),q.appendChild(L),oe.appendChild(q));const m=_.div({class:"cms-singularity cms-table-chip"},""),g=_.div({class:"cms-singularity cms-table-chip"},""),F=_.div({class:"cms-singularity cms-table-chip"},""),X=E(s,"status",{},e.status),a=_.div({class:"cms-table-status"},m,g,F,...X);oe.appendChild(a);const C=E(s,"caption",{},e.caption);C.length&&oe.appendChild(_.div({class:"cms-table-caption"},...C));const h=_.thead(),J=_.tbody(),j=!!e.actions||!!s.actions,U=ae(["cms-table",fe(e.dense,"dense"),fe(e.striped,"striped"),fe(e.hover!==!1,"hover"),fe(e.stickyHeader!==!1,"sticky-head"),e.tableClass]),ce={...e.tableStyle||{}};e.minTableWidth!=null&&(ce["--cms-table-min-width"]=Be(e.minTableWidth));const k=_.table({class:U,style:ce},h,J),d=_.div({class:"cms-singularity cms-table-wrap"},k);oe.appendChild(d);const N=_.div({class:"cms-singularity cms-table-chip"},""),I=_.div({class:"cms-singularity cms-table-chip"},""),H=he.Btn({outline:!0,onClick:()=>y(Math.max(1,S()-1))},"\u2039"),ge=he.Btn({outline:!0,onClick:()=>y(S()+1)},"\u203A"),Se=_.div({class:"cms-singularity cms-table-chip"},""),ye=_.select({class:"cms-input cms-table-size-select"},...u.map(Ce=>us({value:String(Ce)},String(Ce))));ye.value=String(P()),ye.addEventListener("change",()=>W(ye.value));const V=E(s,"footer",{},e.footer),O=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},N,I,_.label({class:"cms-table-size"},_.span("Righe"),ye)),_.div({class:"cms-table-foot-extra"},...V,_.div({class:"cms-table-pager"},H,Se,ge)));e.hideFooter!==!0&&oe.appendChild(O);const K=()=>{if(h.innerHTML="",e.hideHeader)return;const Ce=_.tr();if(o.forEach((pe,Ie)=>{var de,Le;const _e={col:pe,colIndex:Ie,sort:G()},z={...Xn(pe==null?void 0:pe.style,{..._e,header:!0}),...Xn((de=pe==null?void 0:pe.headerStyle)!=null?de:pe==null?void 0:pe.thStyle,{..._e,header:!0})};(pe==null?void 0:pe.width)!=null&&(z.width=Be(pe.width)),(pe==null?void 0:pe.minWidth)!=null&&(z.minWidth=Be(pe.minWidth)),(pe==null?void 0:pe.maxWidth)!=null&&(z.maxWidth=Be(pe.maxWidth)),pe!=null&&pe.align&&(z.textAlign=pe.align);let we=E(pe==null?void 0:pe.slots,"header",_e,null);if(!we.length){const Je=typeof(pe==null?void 0:pe.header)=="function"?pe.header(_e):(Le=pe==null?void 0:pe.header)!=null?Le:vl(pe);we=E(s,"header",_e,Je)}const T=G(),x=Cs(pe,Ie),w=(pe==null?void 0:pe.sortable)!==!1&&((pe==null?void 0:pe.key)!=null||typeof(pe==null?void 0:pe.get)=="function"||typeof(pe==null?void 0:pe.compare)=="function"),c=!!T&&(T.key===x||T.key===(pe==null?void 0:pe.key)),A=_.th({class:ae(["cms-table-head-cell",fe(pe==null?void 0:pe.nowrap,"is-nowrap"),fe(w,"cms-table-sortable"),fe(c,"is-sorted"),pe==null?void 0:pe.headerClass]),style:z});w?A.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>le(pe,Ie)},_.span({class:"cms-table-head-label"},...we),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},c?T.dir==="asc"?"\u2191":"\u2193":"\u2195"))):we.forEach(Je=>A.appendChild(Je)),Ce.appendChild(A)}),j){const pe=E(s,"actionsHeader",{},e.actionsLabel||"Azioni");Ce.appendChild(_.th({class:"cms-table-head-cell cms-table-head-actions",style:{textAlign:"right"}},...pe))}h.appendChild(Ce)},ke=(Ce,pe)=>{const Ie={columns:o,count:o.length},_e=E(s,Ce,Ie,pe),z=String(o.length+(j?1:0));J.appendChild(_.tr(_.td({colSpan:z,class:"cms-table-state"},..._e)))};return He.reactive.effect(()=>{const Ce=Xo(e.rows),pe=String(D()||"").trim(),Ie=G(),_e=typeof e.loading=="function"?!!e.loading():!!e.loading,z=e.pagination!==!1;if(K(),J.innerHTML="",me&&me.value!==D()&&(me.value=D()),ye.value!==String(P())&&(ye.value=String(P())),_e){m.textContent="Caricamento in corso",g.style.display="none",F.style.display="none",N.textContent="Loading\u2026",I.textContent="",Se.textContent="Pagina 1",H.disabled=!0,ge.disabled=!0,ke("loading",e.loadingText||"Loading...");return}let we=Ce.slice();const T=we.length;if(typeof e.filter=="function"&&(we=we.filter((B,Ae)=>e.filter(B,{row:B,index:Ae,query:pe,rows:Ce,columns:o}))),pe&&(we=we.filter(B=>Zo(B,o,pe,e))),Ie){const B=Sl(o,Ie.key);B&&we.sort((Ae,Me)=>{const Ee=qn(B,Ae,-1),De=qn(B,Me,-1),Ue=typeof B.compare=="function"?B.compare(Ee,De,Ae,Me):qo(Ee,De);return Ie.dir==="asc"?Ue:-Ue})}const x=we.length,w=Math.max(1,Number(P())||v),c=z?Math.max(1,Math.ceil(x/w)):1,A=z?Math.min(S(),c):1;A!==S()&&y(A);const de=z?(A-1)*w:0,Le=z?de+w:x,Je=we.slice(de,Le);if(m.textContent=x===T?`${x} righe`:`${x} di ${T} righe`,g.textContent=pe?`Ricerca: ${pe}`:"",g.style.display=pe?"":"none",Ie){const B=Sl(o,Ie.key);F.textContent=B?`Ordine: ${vl(B)} ${Ie.dir==="asc"?"\u2191":"\u2193"}`:"",F.style.display=B?"":"none"}else F.style.display="none";if(N.textContent=x?`${de+1}-${Math.min(Le,x)} di ${x}`:"0 risultati",I.textContent=x!==T?`Dataset totale ${T}`:`Page size ${w}`,Se.textContent=z?`Pagina ${A} / ${c}`:"Tutte le righe",H.disabled=!z||A<=1,ge.disabled=!z||A>=c,ye.disabled=!z,ye.parentNode.style.display=z?"":"none",Je.length===0){ke("empty",e.emptyText||"Nessun dato");return}for(let B=0;B<Je.length;B++){const Ae=Je[B],Me=de+B,Ee={row:Ae,rowIndex:Me,pageIndex:B},De=typeof e.rowAttrs=="function"?e.rowAttrs(Ae,Ee)||{}:e.rowAttrs||{},Ue=typeof e.rowClass=="function"?e.rowClass(Ae,Ee):e.rowClass,Ye=!!(e.onRowClick||e.onRowDblClick),Ze=_.tr({...De,class:ae(["cms-table-row",Ue,De.class,fe(Ye,"is-clickable")])});if(e.rowKey){const Te=typeof e.rowKey=="function"?e.rowKey(Ae,Ee):Ss(Ae,e.rowKey);Te!=null&&(Ze.dataset.key=String(Te))}const Qe=Te=>{const je=Te==null?void 0:Te.target;return!!(je&&je.closest&&je.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(e.onRowClick&&Ze.addEventListener("click",Te=>{Qe(Te)||e.onRowClick(Ae,Ee,Te)}),e.onRowDblClick&&Ze.addEventListener("dblclick",Te=>{Qe(Te)||e.onRowDblClick(Ae,Ee,Te)}),o.forEach((Te,je)=>{var ft,vt;const tt=qn(Te,Ae,Me),nt={...Ee,col:Te,colIndex:je,value:tt},ut={...Xn(Te==null?void 0:Te.style,nt),...Xn((ft=Te==null?void 0:Te.cellStyle)!=null?ft:Te==null?void 0:Te.tdStyle,nt)};Te!=null&&Te.align&&(ut.textAlign=Te.align),(Te==null?void 0:Te.width)!=null&&(ut.width=Be(Te.width)),(Te==null?void 0:Te.minWidth)!=null&&(ut.minWidth=Be(Te.minWidth)),(Te==null?void 0:Te.maxWidth)!=null&&(ut.maxWidth=Be(Te.maxWidth));const dt=typeof(Te==null?void 0:Te.cellClass)=="function"?Te.cellClass(Ae,nt):(Te==null?void 0:Te.cellClass)||(Te==null?void 0:Te.class),bt=_.td({class:ae(["cms-table-cell",dt,fe(Te==null?void 0:Te.nowrap,"is-nowrap")]),style:ut});let lt=E(Te==null?void 0:Te.slots,"cell",nt,null);if(!lt.length){const _t=typeof(Te==null?void 0:Te.render)=="function"?Te.render(Ae,nt):typeof(Te==null?void 0:Te.format)=="function"?Te.format(tt,Ae,nt):tt,rt=_t==null?(vt=Te==null?void 0:Te.emptyText)!=null?vt:"":_t;lt=E(s,"cell",nt,rt)}lt.length||(lt=[""]),lt.forEach(_t=>bt.appendChild(_t)),Ze.appendChild(bt)}),j){const Te={...Ee},je=typeof e.actions=="function"?e.actions(Ae,Ee):e.actions;let tt=E(s,"actions",Te,je);tt.length||(tt=E(null,"default",Te,je)),Ze.appendChild(_.td({class:"cms-table-cell cms-table-cell-actions",style:{textAlign:"right"}},_.div({class:"cms-table-actions"},...tt)))}J.appendChild(Ze)}},"UI.Table:render"),re.body=oe,he.Card(re)},he.Menu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=["primary","secondary","warning","danger","success","info","light","dark"],r=["xs","sm","md","lg","xl"];let v={...e},u=null,i=null,b=null,R=null,S=null;const y=(d,N)=>Object.prototype.hasOwnProperty.call(d||{},N),P=(d,N)=>typeof d=="function"?d(N):d,Q=d=>String(d||"").split(/\s+/).filter(Boolean),G=d=>d&&typeof d=="object"&&!d.nodeType&&!Array.isArray(d)&&!(d instanceof Function),ie=d=>!!d&&typeof d=="object"&&(d.nodeType===1||typeof d.getBoundingClientRect=="function"),D=()=>{clearTimeout(R),clearTimeout(S),R=null,S=null},$=(d,N,I)=>{if(!d)return;const H=d[N]||[];H.length&&d.classList.remove(...H);const ge=(I||[]).filter(Boolean);ge.length&&d.classList.add(...ge),d[N]=ge},Y=(d,N,I,H=ge=>ge)=>{if(d){if(I==null||I===""){d.style.removeProperty(N);return}d.style.setProperty(N,H(I))}},W=()=>v||{},le=d=>{var I;const N=String(l((I=d.state)!=null?I:d.color)||"").toLowerCase();return o.includes(N)?N:""},me=d=>{const N=String(l(d.size)||"").toLowerCase();return r.includes(N)?N:""},re=d=>{var N,I;return String(l((I=(N=d.placement)!=null?N:d.position)!=null?I:"bottom-start"))},oe=()=>{var I;const d=l((I=W().delay)!=null?I:W().showDelay),N=Number(d);return Number.isFinite(N)?Math.max(0,N):0},se=()=>{const d=l(W().hideDelay),N=Number(d);return Number.isFinite(N)?Math.max(0,N):80},te=(d=null)=>{var I,H,ge;if(d)return d;const N=W();return i||l((ge=(H=(I=N.anchorEl)!=null?I:N.triggerEl)!=null?H:N.target)!=null?ge:N.anchor)||null},M=d=>{if(d==null||d===!0)return new Set(["click"]);if(d===!1)return new Set(["manual"]);const N=Array.isArray(d)?d:String(d).split(/[\s,|/]+/),I=new Set;return N.forEach(H=>{const ge=String(H||"").trim().toLowerCase();ge&&(ge==="mouseenter"||ge==="mouseover"?I.add("hover"):ge==="blur"||ge==="focusin"?I.add("focus"):ge==="tap"?I.add("click"):I.add(ge))}),I.size?I:new Set(["manual"])},Z=(d,N)=>{var ge,Se,ye;let I=null,H=null;if(ie(d))I=d,G(N)&&(H=N);else if(G(d)){H=d;const V=(ye=(Se=(ge=d.anchorEl)!=null?ge:d.triggerEl)!=null?Se:d.target)!=null?ye:d.anchor;ie(V)&&(I=V)}else d!=null&&(I=d);return{anchorEl:I,nextProps:H}},q=(d=u==null?void 0:u.panel)=>{var N;return Array.from(((N=d==null?void 0:d.querySelectorAll)==null?void 0:N.call(d,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(I=>I.offsetParent!==null&&I.getAttribute("aria-hidden")!=="true")},ue=()=>{l(W().autoFocus)!==!1&&setTimeout(()=>{const d=q();if(!d.length)return;(d.find(I=>I.classList.contains("is-active")||I.classList.contains("is-selected")||I.classList.contains("is-checked"))||d[0]).focus()},0)},L=(d,N,I="sm")=>{const H=P(d,N);return H==null?[]:typeof H=="string"?[he.Icon({name:H,size:I})]:An(H,{...N,as:"icon"})},f=(d,N)=>{var de,Le,Je,B,Ae,Me,Ee,De,Ue,Ye,Ze,Qe,Te;const I=P(d,N);if(I==null||I===!1)return[];if(Array.isArray(I))return I.flatMap((je,tt)=>f(je,{...N,index:tt}));if(typeof I=="function")return f(I(N),N);if(I!=null&&I.nodeType)return[I];if(typeof I=="string"||typeof I=="number")return f({label:I},N);if(!G(I))return An(I,{...N,as:"item"});const H=String((Le=(de=I.type)!=null?de:I.kind)!=null?Le:"").toLowerCase();if(H==="separator"||H==="divider"||I.separator===!0||I.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ge=(Je=I.items)!=null?Je:I.children;if((H==="group"||H==="section"||Array.isArray(ge))&&ge!=null){const je={...N,item:I},tt=E(s,"groupLabel",je,P((B=I.label)!=null?B:I.title,je)),nt=f(ge,je);return nt.length?[_.div({class:ae(["cms-menu-group",I.class])},tt.length?_.div({class:"cms-menu-group-label"},...tt):null,_.div({class:"cms-menu-group-items"},...nt))]:[]}const Se={...N,item:I,close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:W()},ye=!!l(I.disabled),V=I.checked==null?null:!!l(I.checked),O=!!l((Ae=I.active)!=null?Ae:I.selected),K=le(I),ke=l(I.href),Ne=l(I.to),ee=y(I,"closeOnSelect")?!!l(I.closeOnSelect):I.keepOpen===!0?!1:W().closeOnSelect!==!1,xe=I.role||(V!=null?"menuitemcheckbox":"menuitem"),be=L(I.icon,Se),Ce=L((Me=I.iconRight)!=null?Me:I.endIcon,Se),pe=E(s,"itemTitle",Se,P((Ee=I.title)!=null?Ee:I.label,Se)),Ie=E(s,"itemSubtitle",Se,P((De=I.subtitle)!=null?De:I.description,Se)),_e=E(s,"itemShortcut",Se,P(I.shortcut,Se)),z=E(s,"itemBadge",Se,P(I.badge,Se)),we=E(s,"item",Se,P((Ye=(Ue=I.content)!=null?Ue:I.body)!=null?Ye:I.render,Se)),T=[...z,..._e,...V===!0&&!Ce.length&&!z.length?[_.span({class:"cms-menu-entry-check"},he.Icon({name:I.checkedIcon||"check",size:"sm"}))]:[],...Ce],w={class:ae(["cms-menu-entry","cms-menu-item",K?`cms-state-${K}`:"",fe(O,"is-active"),fe(V===!0,"is-checked"),fe(ye,"is-disabled"),I.class]),role:xe,tabIndex:ye?-1:(Ze=I.tabIndex)!=null?Ze:-1,"data-menu-item":!0,"data-menu-select":ee?"true":"false","data-menu-close":I.close===!0?"true":null,"data-menu-keep-open":ee?null:"true","aria-disabled":ye?"true":null,"aria-checked":V==null?null:String(V),title:(Te=(Qe=I.titleAttr)!=null?Qe:I.tooltip)!=null?Te:null,type:ke?null:"button",href:ke||null,target:I.target||null,rel:I.rel||(I.target==="_blank"?"noopener noreferrer":null),onClick:je=>{var nt,ut,dt,bt;if(ye){je.preventDefault(),je.stopPropagation();return}(ut=(nt=W()).onItemClick)==null||ut.call(nt,I,Se,je);const tt=(dt=I.onClick)==null?void 0:dt.call(I,Se,je);je.defaultPrevented||(Ne&&((bt=JSswift.router)!=null&&bt.navigate)&&(je.preventDefault(),JSswift.router.navigate(Ne)),tt!==!1&&ee&&X())}};I.attrs&&typeof I.attrs=="object"&&Object.assign(w,I.attrs);const c=ke?_.a:_.button,A=we.length?we:[pe.length?_.div({class:"cms-menu-entry-title"},...pe):null,Ie.length?_.div({class:"cms-menu-entry-subtitle"},...Ie):null].filter(Boolean);return[c(w,be.length?_.span({class:"cms-menu-entry-icon"},...be):null,_.span({class:"cms-menu-entry-main"},...A),T.length?_.span({class:"cms-menu-entry-aside"},...T):null)]},m=()=>{var pe,Ie,_e,z,we,T,x;const d=W(),N={close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:d},I=L(d.icon,N,d.iconSize||"md"),H=E(s,"eyebrow",N,P(d.eyebrow,N)),ge=E(s,"title",N,P((Ie=(pe=d.title)!=null?pe:d.heading)!=null?Ie:d.label,N)),Se=E(s,"subtitle",N,P((_e=d.subtitle)!=null?_e:d.description,N)),ye=E(s,"before",N,P(d.before,N)),V=E(s,"header",N,P(d.header,N)),O=E(s,"after",N,P(d.after,N)),K=E(s,"footer",N,P(d.footer,N)),ke=E(s,"status",N,P(d.status,N));let Ne=(z=d.content)!=null?z:d.body;Ne==null&&n&&n.length&&(Ne=n);let ee=E(s,"content",N,P(Ne,N));ee.length||(ee=E(s,"body",N,P(Ne,N))),ee.length||(ee=E(s,"default",N,P(Ne,N)));const xe=f((T=(we=d.items)!=null?we:d.actionsList)!=null?T:d.entries,N),be=xe.length?[]:E(s,"empty",N,P((x=d.empty)!=null?x:d.emptyText,N));let Ce=null;return V.length?Ce=_.div({class:ae(["cms-menu-head","cms-menu-head-custom",d.headerClass])},...V):(I.length||H.length||ge.length||Se.length)&&(Ce=_.div({class:ae(["cms-menu-head",d.headerClass])},I.length?_.div({class:"cms-menu-head-icon"},...I):null,_.div({class:"cms-menu-head-main"},H.length?_.div({class:"cms-menu-eyebrow"},...H):null,ge.length?_.div({class:"cms-menu-title"},...ge):null,Se.length?_.div({class:"cms-menu-subtitle"},...Se):null))),_.div({class:ae(["cms-menu","cms-menu-shell",fe(d.dense,"dense"),fe(xe.length>0,"has-items"),fe(K.length>0||ke.length>0,"has-footer"),d.class]),style:d.style||{},role:d.role||"menu","aria-label":d.ariaLabel||null},ye.length?_.div({class:"cms-menu-before"},...ye):null,Ce,ee.length?_.div({class:ae(["cms-menu-content",d.contentClass])},...ee):null,xe.length?_.div({class:ae(["cms-menu-items",d.itemsClass])},...xe):null,!xe.length&&be.length?_.div({class:"cms-menu-empty"},...be):null,O.length?_.div({class:"cms-menu-after"},...O):null,ke.length||K.length?_.div({class:ae(["cms-menu-footer",d.footerClass])},ke.length?_.div({class:"cms-menu-status"},...ke):null,K.length?_.div({class:"cms-menu-footer-actions"},...K):null):null)},g=d=>{var ge;if(!(d!=null&&d.panel))return;const N=W(),I=le(N),H=me(N);$(d.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",H?`cms-menu-${H}`:"",I?`cms-state-${I}`:"",l(N.outline)?"outline":"",...Q(N.panelClass)]),$(d.overlay,"_menuOverlayClassTokens",[...Q(N.overlayClass)]),d.panel.dataset.placement=re(N),Y(d.panel,"--cms-menu-width",l(N.width),Be),Y(d.panel,"--cms-menu-min-width",l(N.minWidth),Be),Y(d.panel,"--cms-menu-max-width",l(N.maxWidth),Be),Y(d.panel,"--cms-menu-max-height",l(N.maxHeight),Be),Y(d.panel,"--cms-menu-body-max-height",l((ge=N.bodyMaxHeight)!=null?ge:N.contentMaxHeight),Be),N.panelStyle&&Object.assign(d.panel.style,N.panelStyle),Ke(d.panel,N)},F=()=>{u!=null&&u.panel&&u.panel.replaceChildren(m())},X=()=>{if(D(),!u)return;const d=u;u=null,yn(d,()=>JSswift.overlay.close(d.id))},a=(d={})=>{var N,I,H,ge;if(d&&typeof d=="object"&&(v={...v,...d}),u){const Se=W();g(u),F(),(ge=u.reposition)==null||ge.call(u,{anchorEl:u._anchorEl,placement:re(Se),offsetX:(N=Se.offsetX)!=null?N:0,offsetY:(H=(I=Se.offsetY)!=null?I:Se.offset)!=null?H:8}),ue()}return k},C=(d=null,N=null)=>{var Ce,pe,Ie,_e,z,we,T,x,w,c,A,de,Le,Je,B,Ae;D();const{anchorEl:I,nextProps:H}=Z(d,N);H&&(v={...v,...H});const ge=W(),Se=te(I);if(!Se||l(ge.disabled))return null;if(u&&u._anchorEl===Se){const Me=W();return g(u),F(),(_e=u.reposition)==null||_e.call(u,{anchorEl:u._anchorEl,placement:re(Me),offsetX:(Ce=Me.offsetX)!=null?Ce:0,offsetY:(Ie=(pe=Me.offsetY)!=null?pe:Me.offset)!=null?Ie:8}),ue(),u}u&&X(),b=document.activeElement;let ye=null;if(u=JSswift.overlay.open(()=>m(),{type:"menu",anchorEl:Se,placement:re(ge),offsetX:(z=ge.offsetX)!=null?z:0,offsetY:(T=(we=ge.offsetY)!=null?we:ge.offset)!=null?T:8,backdrop:ge.backdrop===!0,lockScroll:ge.lockScroll===!0,trapFocus:ge.trapFocus===!0,autoFocus:!1,closeOnOutside:ge.closeOnOutside!==!1,closeOnBackdrop:(x=ge.closeOnBackdrop)!=null?x:ge.backdrop===!0,closeOnEsc:ge.closeOnEsc!==!1,className:Dt(["cms-menu-panel"]),onClose:()=>{var Me,Ee,De;(Me=ye==null?void 0:ye._menuCleanup)==null||Me.call(ye),(De=(Ee=W()).onClose)==null||De.call(Ee,ye),W().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const V=u;ye=V,V._anchorEl=Se;const O=()=>{clearTimeout(S),S=null},K=()=>{J()},ke=Me=>{const Ee=Me.target;if(!Ee||!Ee.closest)return;if(Ee.closest("[data-menu-close]")){X();return}if(W().closeOnSelect===!1)return;const De=Ee.closest("[data-menu-item], [data-menu-select], .cms-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");De&&(De.closest("[data-menu-keep-open]")||De.getAttribute("data-menu-select")!=="false"&&X())},Ne=Me=>{if(Me.key==="Escape"){Me.preventDefault(),X();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(Me.key))return;const Ee=q(V.panel);if(!Ee.length)return;Me.preventDefault();const De=Ee.indexOf(document.activeElement);if(Me.key==="Home"){Ee[0].focus();return}if(Me.key==="End"){Ee[Ee.length-1].focus();return}const Ue=Me.key==="ArrowDown"?1:-1,Ye=De<0?Ue>0?0:Ee.length-1:(De+Ue+Ee.length)%Ee.length;Ee[Ye].focus()};V.panel.addEventListener("click",ke),V.panel.addEventListener("keydown",Ne);const ee=M((c=(w=ge.trigger)!=null?w:ge.triggers)!=null?c:y(ge,"open")?"manual":null),xe=ee.has("hover"),be=ee.has("focus");return(xe||be)&&(V.panel.addEventListener("mouseenter",O),V.panel.addEventListener("mouseleave",K),V.panel.addEventListener("focusin",O),V.panel.addEventListener("focusout",K)),V._menuCleanup=()=>{var Me,Ee,De,Ue,Ye,Ze;(Me=V.panel)==null||Me.removeEventListener("click",ke),(Ee=V.panel)==null||Ee.removeEventListener("keydown",Ne),(De=V.panel)==null||De.removeEventListener("mouseenter",O),(Ue=V.panel)==null||Ue.removeEventListener("mouseleave",K),(Ye=V.panel)==null||Ye.removeEventListener("focusin",O),(Ze=V.panel)==null||Ze.removeEventListener("focusout",K)},g(V),(Je=V.reposition)==null||Je.call(V,{anchorEl:Se,placement:re(ge),offsetX:(A=ge.offsetX)!=null?A:0,offsetY:(Le=(de=ge.offsetY)!=null?de:ge.offset)!=null?Le:8}),bn(V),(Ae=(B=W()).onOpen)==null||Ae.call(B,V),ue(),V},h=(d,N=null)=>{clearTimeout(S),S=null,clearTimeout(R),R=setTimeout(()=>C(d,N),oe())},J=(d=!1)=>{if(clearTimeout(R),R=null,!!u){if(clearTimeout(S),d){X();return}S=setTimeout(()=>X(),se())}},j=(d=null,N=null)=>U()?(X(),null):C(d,N),U=()=>!!u,k={open:C,close:X,show:h,hide:J,toggle:j,update:a,bind:d=>{var K,ke;if(!d)return()=>{};i=d;const N=W(),I=M((ke=(K=N.trigger)!=null?K:N.triggers)!=null?ke:y(N,"open")?"manual":null),H=I.has("hover"),ge=I.has("focus"),Se=I.has("click"),ye=I.has("manual")||!H&&!ge&&!Se,V=[],O=()=>{D(),V.forEach(Ne=>Ne()),i===d&&(i=null)};if(y(N,"open"))return at(N.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?C(i):J(!0))},"UI.Menu:open"):N.open===!0?C(d):N.open===!1&&J(!0),O;if(ye||l(N.disabled))return O;if(H){const Ne=()=>h(d),ee=()=>J();d.addEventListener("mouseenter",Ne),d.addEventListener("mouseleave",ee),V.push(()=>{d.removeEventListener("mouseenter",Ne),d.removeEventListener("mouseleave",ee)})}if(ge){const Ne=()=>h(d),ee=()=>J();d.addEventListener("focus",Ne),d.addEventListener("blur",ee),V.push(()=>{d.removeEventListener("focus",Ne),d.removeEventListener("blur",ee)})}if(Se){const Ne=ee=>{var xe,be;(be=(xe=W()).onTriggerClick)==null||be.call(xe,ee),!ee.defaultPrevented&&j(d)};d.addEventListener("click",Ne),V.push(()=>d.removeEventListener("click",Ne))}return O},isOpen:U,entry:()=>u,props:()=>({...v})};return k},he.Popover=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=["primary","secondary","warning","danger","success","info","light","dark"],r=["xs","sm","md","lg","xl"];let v={...e},u=null,i=null,b=null,R=null,S=null;const y=(k,d)=>Object.prototype.hasOwnProperty.call(k||{},d),P=(k,d)=>typeof k=="function"?k(d):k,Q=k=>String(k||"").split(/\s+/).filter(Boolean),G=k=>k&&typeof k=="object"&&!k.nodeType&&!Array.isArray(k)&&!(k instanceof Function),ie=k=>!!k&&typeof k=="object"&&(k.nodeType===1||typeof k.getBoundingClientRect=="function"),D=()=>{clearTimeout(R),clearTimeout(S),R=null,S=null},$=(k,d,N)=>{if(!k)return;const I=k[d]||[];I.length&&k.classList.remove(...I);const H=(N||[]).filter(Boolean);H.length&&k.classList.add(...H),k[d]=H},Y=(k,d,N,I=H=>H)=>{if(k){if(N==null||N===""){k.style.removeProperty(d);return}k.style.setProperty(d,I(N))}},W=()=>v,le=k=>{var N;const d=l((N=k.state)!=null?N:k.color);return d?o.includes(d)?d:String(d):""},me=k=>{const d=l(k.size);return typeof d=="string"&&r.includes(d)?d:""},re=k=>{var N,I,H;const d=String(l((H=(I=(N=k.actionsAlign)!=null?N:k.footerAlign)!=null?I:k.alignActions)!=null?H:"end")).toLowerCase();return["start","left"].includes(d)?"start":["center","middle"].includes(d)?"center":["between","space-between"].includes(d)?"between":["stretch","full"].includes(d)?"stretch":"end"},oe=k=>{var d,N;return String(l((N=(d=k.placement)!=null?d:k.position)!=null?N:"bottom-start"))},se=(k,d)=>{const N=l(k);if(N==null||N==="")return d;const I=Number(N);return Number.isFinite(I)?I:d},te=()=>se(W().delay,0),M=()=>se(W().hideDelay,120),Z=k=>{var N,I;return((I=(N=k.closable)!=null?N:k.dismissible)!=null?I:k.closeButton)===!0},q=(k=null)=>{var N,I,H;if(k)return k;const d=W();return i||l((H=(I=(N=d.anchorEl)!=null?N:d.triggerEl)!=null?I:d.target)!=null?H:d.anchor)||null},ue=k=>{if(k==null||k===!0)return new Set(["click"]);if(k===!1)return new Set(["manual"]);const d=Array.isArray(k)?k:String(k).split(/[\s,|/]+/),N=new Set;return d.forEach(I=>{const H=String(I||"").trim().toLowerCase();H&&(H==="mouseenter"||H==="mouseover"?N.add("hover"):H==="blur"||H==="focusin"?N.add("focus"):H==="tap"?N.add("click"):N.add(H))}),N.size?N:new Set(["manual"])},L=(k,d)=>{var H,ge,Se;let N=null,I=null;if(ie(k))N=k,G(d)&&(I=d);else if(G(k)){I=k;const ye=(Se=(ge=(H=k.anchorEl)!=null?H:k.triggerEl)!=null?ge:k.target)!=null?Se:k.anchor;ie(ye)&&(N=ye)}else k!=null&&(N=k);return{anchorEl:N,nextProps:I}},f=()=>{var be,Ce,pe,Ie,_e,z,we,T,x;const k=W(),d={close:F,dismiss:F,open:a,toggle:J,update:X,isOpen:j,entry:()=>u,anchorEl:q(),props:k},N=k.icon!=null?typeof k.icon=="string"?he.Icon({name:k.icon,size:k.iconSize||"md"}):JSswift.ui.slot(k.icon,{as:"icon"}):null,I=E(s,"eyebrow",d,P(k.eyebrow,d)),H=E(s,"title",d,P((Ce=(be=k.title)!=null?be:k.heading)!=null?Ce:k.label,d)),ge=E(s,"subtitle",d,P((pe=k.subtitle)!=null?pe:k.description,d)),Se=E(s,"icon",d,N),ye=E(s,"header",d,P((_e=(Ie=k.headerContent)!=null?Ie:k.head)!=null?_e:k.header,d)),V=Z(k)?E(s,"close",d,he.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":k.closeLabel||"Chiudi popover","data-popover-close":!0},he.Icon({name:k.closeIcon||"close",size:"sm"}))):[];let O=(T=(we=(z=k.content)!=null?z:k.body)!=null?we:k.message)!=null?T:k.text;O==null&&n&&n.length&&(O=n);let K=E(s,"content",d,P(O,d));K.length||(K=E(s,"body",d,P(O,d))),K.length||(K=E(s,"default",d,P(O,d)));const ke=P((x=k.footer)!=null?x:k.actions,d);let Ne=E(s,"footer",d,ke);Ne.length||(Ne=E(s,"actions",d,ke));let ee=null;ye.length?ee=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...ye):(I.length||H.length||ge.length||Se.length||V.length)&&(ee=_.div({class:"cms-dialog-head"},Se.length?_.div({class:"cms-dialog-icon"},...Se):null,_.div({class:"cms-dialog-head-main"},I.length?_.div({class:"cms-dialog-eyebrow"},...I):null,H.length?_.div({class:"cms-dialog-title"},...H):null,ge.length?_.div({class:"cms-dialog-subtitle"},...ge):null),V.length?_.div({class:"cms-dialog-close-wrap"},...V):null));const xe=[];return ee&&xe.push(ee),K.length&&xe.push(_.div({class:ae(["cms-dialog-body",k.bodyClass])},...K)),Ne.length&&xe.push(_.div({class:ae(["cms-dialog-actions",`is-${re(k)}`,fe(k.stackActions,"is-stacked"),k.actionsClass,k.footerClass])},...Ne)),xe.length||xe.push(_.div({class:ae(["cms-dialog-body",k.bodyClass])})),_.div({class:ae(["cms-dialog-shell","cms-popover-shell",fe(!!ee,"has-head"),fe(Ne.length>0,"has-footer"),fe(k.divider!==!1,"with-divider")])},...xe)},m=k=>{var H;if(!(k!=null&&k.panel))return;const d=W(),N=le(d),I=me(d);$(k.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",I?`cms-dialog-${I}`:"",N,N?`cms-state-${N}`:"",l(d.scrollable)?"scrollable":"",l(d.stickyHeader)?"sticky-head":"",l(d.stickyActions)?"sticky-actions":"",l(d.borderless)?"borderless":"",...Q(d.class),...Q(d.panelClass)]),$(k.overlay,"_popoverOverlayClassTokens",[...Q(d.overlayClass)]),k.panel.dataset.placement=oe(d),Y(k.panel,"--cms-dialog-width",l(d.width),Be),Y(k.panel,"--cms-dialog-min-width",l(d.minWidth),Be),Y(k.panel,"--cms-dialog-max-width",l(d.maxWidth),Be),Y(k.panel,"--cms-dialog-max-height",l(d.maxHeight),Be),Y(k.panel,"--cms-dialog-body-max-height",l((H=d.bodyMaxHeight)!=null?H:d.contentMaxHeight),Be),d.style&&Object.assign(k.panel.style,d.style),Ke(k.panel,d),k.panel.setAttribute("role",d.role||"dialog"),k.panel.setAttribute("aria-modal",d.modal===!0?"true":"false"),d.ariaLabel?k.panel.setAttribute("aria-label",d.ariaLabel):k.panel.removeAttribute("aria-label")},g=()=>{u!=null&&u.panel&&u.panel.replaceChildren(f())},F=()=>{if(D(),!u)return;const k=u;u=null,yn(k,()=>JSswift.overlay.close(k.id))},X=(k={})=>(k&&typeof k=="object"&&(v={...v,...k}),u&&(m(u),g()),ce),a=(k=null,d=null)=>{var xe,be,Ce,pe,Ie,_e,z,we;D();const{anchorEl:N,nextProps:I}=L(k,d);I&&(v={...v,...I});const H=W(),ge=q(N);if(!ge||l(H.disabled))return null;if(u&&u._anchorEl===ge)return m(u),g(),u;u&&F(),b=document.activeElement;const Se=ue((be=(xe=H.trigger)!=null?xe:H.triggers)!=null?be:y(H,"open")?"manual":null),ye=Se.has("hover"),V=Se.has("focus");let O=null;if(u=JSswift.overlay.open(()=>f(),{type:"popover",anchorEl:ge,placement:oe(H),offsetX:(Ce=H.offsetX)!=null?Ce:0,offsetY:(Ie=(pe=H.offsetY)!=null?pe:H.offset)!=null?Ie:10,backdrop:H.backdrop===!0,lockScroll:H.lockScroll===!0,trapFocus:H.trapFocus===!0,autoFocus:H.autoFocus===!0,closeOnOutside:H.closeOnOutside!==!1,closeOnBackdrop:(_e=H.closeOnBackdrop)!=null?_e:H.backdrop===!0,closeOnEsc:H.closeOnEsc!==!1,className:Dt(["cms-dialog","cms-popover"]),onClose:()=>{var T,x,w;(T=O==null?void 0:O._popoverCleanup)==null||T.call(O),(w=(x=W()).onClose)==null||w.call(x,O),W().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const K=u;O=K,K._anchorEl=ge;const ke=()=>{clearTimeout(S),S=null},Ne=()=>{!ye&&!V||h()},ee=T=>{const x=T.target;if(!(!x||!x.closest)){if(x.closest("[data-popover-close]")||x.closest("[data-dialog-close]")){F();return}W().closeOnSelect===!0&&x.closest("[data-popover-select]")&&F()}};return K.panel.addEventListener("click",ee),(ye||V)&&(K.panel.addEventListener("mouseenter",ke),K.panel.addEventListener("mouseleave",Ne),K.panel.addEventListener("focusin",ke),K.panel.addEventListener("focusout",Ne)),K._popoverCleanup=()=>{var T,x,w,c,A;(T=K.panel)==null||T.removeEventListener("click",ee),(x=K.panel)==null||x.removeEventListener("mouseenter",ke),(w=K.panel)==null||w.removeEventListener("mouseleave",Ne),(c=K.panel)==null||c.removeEventListener("focusin",ke),(A=K.panel)==null||A.removeEventListener("focusout",Ne)},m(K),bn(K),(we=(z=W()).onOpen)==null||we.call(z,K),K},C=(k,d=null)=>{clearTimeout(S),S=null,clearTimeout(R),R=setTimeout(()=>a(k,d),te())},h=(k=!1)=>{if(clearTimeout(R),R=null,!!u){if(clearTimeout(S),k){F();return}S=setTimeout(()=>F(),M())}},J=(k=null,d=null)=>j()?(F(),null):a(k,d),j=()=>!!u,ce={open:a,close:F,show:C,hide:h,toggle:J,update:X,bind:k=>{var O,K;if(!k)return()=>{};i=k;const d=W(),N=ue((K=(O=d.trigger)!=null?O:d.triggers)!=null?K:y(d,"open")?"manual":null),I=N.has("hover"),H=N.has("focus"),ge=N.has("click"),Se=N.has("manual")||!I&&!H&&!ge,ye=[],V=()=>{D(),ye.forEach(ke=>ke()),i===k&&(i=null)};if(y(d,"open"))return at(d.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?a(i):h(!0))},"UI.Popover:open"):d.open===!0?a(k):d.open===!1&&h(!0),V;if(Se||l(d.disabled))return V;if(I){const ke=()=>C(k),Ne=()=>h();k.addEventListener("mouseenter",ke),k.addEventListener("mouseleave",Ne),ye.push(()=>{k.removeEventListener("mouseenter",ke),k.removeEventListener("mouseleave",Ne)})}if(H){const ke=()=>C(k),Ne=()=>h();k.addEventListener("focus",ke),k.addEventListener("blur",Ne),ye.push(()=>{k.removeEventListener("focus",ke),k.removeEventListener("blur",Ne)})}if(ge){const ke=Ne=>{var ee,xe;(xe=(ee=W()).onTriggerClick)==null||xe.call(ee,Ne),!Ne.defaultPrevented&&J(k)};k.addEventListener("click",ke),ye.push(()=>k.removeEventListener("click",ke))}return V},isOpen:j,entry:()=>u,props:()=>({...v})};return ce},he.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},o=null,r=null,v=null;const u=g=>g&&typeof g=="object"&&!g.nodeType&&!Array.isArray(g)&&!(g instanceof Function),i=g=>!!g&&typeof g=="object"&&(g.nodeType===1||typeof g.getBoundingClientRect=="function"),b=g=>!!g&&typeof g=="object"&&("clientX"in g||"type"in g||"target"in g||"currentTarget"in g),R=g=>!!g&&Number.isFinite(Number(g.x))&&Number.isFinite(Number(g.y)),S=()=>s,y=(g,F)=>{const X=Number(g),a=Number(F);return!Number.isFinite(X)||!Number.isFinite(a)?null:{x:X,y:a}},P=g=>g?{_cmsContextPoint:g,getBoundingClientRect:()=>({top:g.y,bottom:g.y,left:g.x,right:g.x,width:0,height:0})}:null,Q=g=>{if(!i(g))return null;const F=g.getBoundingClientRect();return y(F.left+Math.min(F.width/2,24),F.top+Math.min(F.height/2,24))},G=g=>{var F,X,a,C;return l((C=(a=(X=(F=g==null?void 0:g.anchorEl)!=null?F:g==null?void 0:g.triggerEl)!=null?X:g==null?void 0:g.target)!=null?a:g==null?void 0:g.anchor)!=null?C:null)},ie=(g,F=null)=>{if(!g)return Q(F||v);const X=y(g.clientX,g.clientY);if(X)return X;const a=G({anchorEl:F||g.currentTarget||g.target||v});return Q(a)},D=(g={})=>{if(!u(g))return{};const F={...g};return delete F.event,delete F.point,delete F.x,delete F.y,F},$=()=>{var F,X,a;const g=S();return{...g,trigger:"manual",placement:g.placement||"bottom-start",offsetX:(F=g.offsetX)!=null?F:0,offsetY:(a=(X=g.offsetY)!=null?X:g.offset)!=null?a:4,closeOnOutside:g.closeOnOutside!==!1,closeOnEsc:g.closeOnEsc!==!1,role:g.role||"menu",ariaLabel:g.ariaLabel||g.title||"Context menu",class:ae(["cms-context-menu-shell",g.class]),panelClass:ae(["cms-context-menu-panel",g.panelClass])}},Y=he.Menu($(),...n),W=(g=null,F=null,X=null)=>{let a=null,C=null,h=null;if(b(g))a=ie(g,v),h=u(F)?D(F):null;else if(typeof g=="number"||typeof F=="number")a=y(g,F),h=u(X)?D(X):null;else if(R(g))a=y(g.x,g.y),h=u(F)?D(F):null;else if(i(g))C=g,h=u(F)?D(F):null;else if(u(g)){const J=R(g.point)?g.point:R(g)?g:null,j=G(g),U=g.event;a=J?y(J.x,J.y):ie(U,j||v),C=j&&i(j)?j:null,h={...D(g),...u(F)?D(F):{}}}else o&&(a={...o});return{point:a,anchor:C,nextProps:h}},le=(g,F=null)=>{r=g||r,o=F||g&&g._cmsContextPoint||o},me=(g=null)=>{u(g)&&Object.keys(g).length&&(s={...s,...g})},re=(g=null,F=null)=>{if(F)return P(F);if(g&&i(g))return g;const X=G(S());return i(X)?X:o?P(o):i(r)?r:i(v)?v:null},oe=(g=null,F=null,X=null)=>{const{point:a,anchor:C,nextProps:h}=W(g,F,X);me(h);const J=re(C,a);return J?(le(J,a),Y.open(J,$())):null},se=(g,F,X=null)=>oe(g,F,X),te=(g,F=null)=>oe(g,F),M=()=>(Y.close(),m),Z=(g=!0)=>(g===!1?Y.hide(!1):Y.close(),m),q=(g=null,F=null,X=null)=>oe(g,F,X),ue=(g=null,F=null,X=null)=>Y.isOpen()?(M(),null):oe(g,F,X),L=(g={})=>(me(D(g)),Y.update($()),m),m={open:oe,openAt:se,openFromEvent:te,show:q,hide:Z,close:M,toggle:ue,update:L,bind:(g,F=null)=>{if(!g)return()=>{};const X=u(F)?D(F):null,a=h=>{var j,U;v=g,h.preventDefault(),!(((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:g,open:oe,close:M,update:L}))===!1||l(S().disabled))&&oe({event:h,anchorEl:g},X)},C=h=>{var j,U;h.key!=="ContextMenu"&&!(h.shiftKey&&h.key==="F10")||(v=g,h.preventDefault(),((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:g,open:oe,close:M,update:L}))===!1||l(S().disabled))||oe({event:h,anchorEl:g},X)};return g.addEventListener("contextmenu",a),g.addEventListener("keydown",C),()=>{g.removeEventListener("contextmenu",a),g.removeEventListener("keydown",C)}},isOpen:Y.isOpen,entry:Y.entry,props:()=>({...s})};return m}})(JSswift);
|
|
34
|
+
`,document.head.appendChild(y),kt._textNode=n,kt._spinner=e,kt._progressWrap=s,kt._progressBar=o,kt._progressActive=!1,kt}function yl(t,e){if(typeof t=="object"&&t!==null)return{...t};const n=e&&typeof e=="object"?e:{};return typeof e=="string"&&(t==null||typeof t=="number")?{...n,message:e}:{...n,message:t}}function wl(t,e){const n=e==="progress";t._spinner.style.display=n?"none":"",t._progressWrap.style.display=n?"block":"none",t._mode=e}He.loading.show=function(t="Loading...",e={}){const n=bl(),s=yl(t,e);In++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",wl(n,"spinner"),s.spinner===!1&&(n._spinner.style.display="none"),n.style.display="flex"},He.loading.hide=function(){kt&&(In=Math.max(0,In-1),In===0&&(kt.style.display="none",kt._progressActive=!1))},He.loading.progress=function(t=0,e={}){var r;const n=bl();typeof t=="object"&&t!==null&&(e=t,t=(r=t.value)!=null?r:0);const s=yl(null,e);n._progressActive||(In++,n._progressActive=!0);const o=Math.max(0,Math.min(100,Number(t!=null?t:0)));n._textNode.textContent=s.message||"Loading...",n._progressBar.style.width=o+"%",wl(n,"progress"),n.style.display="flex"},He.loading.wrap=async function(t,e){He.loading.show(t);try{return await e()}finally{He.loading.hide()}};function qo(t){return typeof t=="function"?t():t||[]}function Ss(t,e){if(!(t==null||e==null))return typeof e!="string"||e.indexOf(".")<0?t==null?void 0:t[e]:e.split(".").reduce((n,s)=>n==null?n:n[s],t)}function Xo(t,e){return t==null&&e==null?0:t==null?-1:e==null?1:typeof t=="number"&&typeof e=="number"?t-e:String(t).localeCompare(String(e),void 0,{numeric:!0,sensitivity:"base"})}function Qo(t){const e=qo(t);return Array.isArray(e)?e:[]}function vl(t){var e,n,s,o;return(o=(s=(n=(e=t==null?void 0:t.label)!=null?e:t==null?void 0:t.title)!=null?n:t==null?void 0:t.header)!=null?s:t==null?void 0:t.key)!=null?o:""}function Cs(t,e){var n,s;return(s=(n=t==null?void 0:t.sortKey)!=null?n:t==null?void 0:t.key)!=null?s:`__col_${e}`}function Sl(t,e){return t.find((n,s)=>Cs(n,s)===e||(n==null?void 0:n.key)===e)||null}function qn(t,e,n){return t?typeof t.get=="function"?t.get(e,{row:e,rowIndex:n,col:t}):typeof t.value=="function"?t.value(e,{row:e,rowIndex:n,col:t}):typeof t.key=="string"?Ss(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function Xn(t,e){return typeof t=="function"?t(e)||{}:t||{}}function Qn(t){if(t==null)return"";if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return t.map(Qn).filter(Boolean).join(" ");if(typeof Node!="undefined"&&t instanceof Node)return t.textContent||"";if(typeof t=="object"){if(typeof t.textContent=="string")return t.textContent;try{return JSON.stringify(t)}catch(e){return""}}return String(t)}function Zo(t,e){const s=(Array.isArray(t)?t:e).map(o=>Number(o)).filter(o=>Number.isFinite(o)&&o>0);return s.length?Array.from(new Set(s)):e}function ei(t,e,n,s){const o=s.searchBy||s.searchPredicate;if(typeof o=="function")return!!o(t,{query:n,columns:e});const r=String(n||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(!r.length)return!0;const y=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var T;return(T=b==null?void 0:b.searchKey)!=null?T:b==null?void 0:b.key}).filter(Boolean),u=[];if(y.length)for(const b of y)if(typeof b=="function")u.push(Qn(b(t)));else{const T=e.find(S=>(S==null?void 0:S.key)===b||(S==null?void 0:S.searchKey)===b);u.push(Qn(T?qn(T,t,-1):Ss(t,b)))}else u.push(Qn(t));const i=u.join(" ").toLowerCase();return r.every(b=>i.includes(b))}he.Table=(...t)=>{var Ne,ee,xe,be;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=Array.isArray(e.columns)?e.columns:[],r=Zo(e.pageSizeOptions,[5,10,20,50]),y=Number((ee=(Ne=e.pageSize)!=null?Ne:r[0])!=null?ee:10)||10,u=Array.from(new Set([...r,y])).sort((Ce,pe)=>Ce-pe),i=e.initialSort||(e.sortBy?{key:e.sortBy,dir:e.sortDir==="desc"?"desc":"asc"}:null),b=e.searchable===!0||typeof e.searchable=="string"||e.searchPlaceholder!=null||e.search!=null||e.query!=null||!!e.searchModel||!!e.queryModel||Array.isArray(e.searchKeys)||typeof e.searchBy=="function"||typeof e.searchPredicate=="function",T=Nt(e.searchModel||e.queryModel,"UI.Table:query"),[S,w]=He.reactive.signal(Math.max(1,Number(e.page||1)||1)),[z,Q]=He.reactive.signal(y),[G,ie]=He.reactive.signal(i),[D,$]=He.reactive.signal(String((be=T?T.get():(xe=e.search)!=null?xe:e.query)!=null?be:"")),Y=Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),T&&T.set(pe),w(1)},W=Ce=>{const pe=Number(Ce)||y;Q(pe),w(1)},se=(Ce,pe)=>{const Ie=Cs(Ce,pe),_e=G();!_e||_e.key!==Ie&&_e.key!==(Ce==null?void 0:Ce.key)?ie({key:Ie,dir:"asc"}):_e.dir==="asc"?ie({key:Ie,dir:"desc"}):ie(null),w(1)};let me=null;T&&T.watch(Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),me&&me.value!==pe&&(me.value=pe),w(1)},"UI.Table:queryWatch");const re=JSswift.omit(e,["columns","rows","rowKey","loading","page","pageSize","pageSizeOptions","pagination","initialSort","sortBy","sortDir","search","query","searchable","searchPlaceholder","searchKeys","searchBy","searchPredicate","searchModel","queryModel","filter","actions","actionsLabel","emptyText","loadingText","onRowClick","onRowDblClick","tableClass","tableStyle","cardClass","dense","striped","hover","stickyHeader","toolbar","toolbarStart","toolbarEnd","caption","footer","status","rowClass","rowAttrs","minTableWidth","hideHeader","hideFooter","slots","body"]);re.class=ae(["cms-table-card",e.class,e.cardClass]),e.dense!=null&&(re.dense=e.dense);const oe=_.div({class:"cms-table-shell"}),le=J(s,"default",{},n);le.length&&oe.appendChild(_.div({class:"cms-table-lead"},...le));const te=J(s,"toolbarStart",{},e.toolbarStart),M=J(s,"toolbar",{},e.toolbar),Z=J(s,"toolbarEnd",{},e.toolbarEnd),q=_.div({class:"cms-table-toolbar"}),ue=_.div({class:"cms-table-toolbar-main"}),R=_.div({class:"cms-table-toolbar-side"});te.forEach(Ce=>ue.appendChild(Ce)),M.forEach(Ce=>ue.appendChild(Ce));const g=J(s,"search",{query:D(),getQuery:D,setQuery:Y},null);if(g.length)g.forEach(Ce=>R.appendChild(Ce));else if(b){me=_.input({type:"search",class:"cms-input",placeholder:typeof e.searchable=="string"?e.searchable:e.searchPlaceholder||"Cerca nella tabella",value:String(D()||"")}),me.addEventListener("input",()=>Y(me.value));const Ce=he.Btn({class:"cms-table-search-clear",outline:!0,onClick:()=>{me&&(me.value=""),Y("")}},"Reset");R.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),me,Ce))}Z.forEach(Ce=>R.appendChild(Ce)),(ue.childNodes.length||R.childNodes.length)&&(q.appendChild(ue),q.appendChild(R),oe.appendChild(q));const d=_.div({class:"cms-singularity cms-table-chip"},""),m=_.div({class:"cms-singularity cms-table-chip"},""),F=_.div({class:"cms-singularity cms-table-chip"},""),X=J(s,"status",{},e.status),a=_.div({class:"cms-table-status"},d,m,F,...X);oe.appendChild(a);const C=J(s,"caption",{},e.caption);C.length&&oe.appendChild(_.div({class:"cms-table-caption"},...C));const h=_.thead(),P=_.tbody(),j=!!e.actions||!!s.actions,U=ae(["cms-table",fe(e.dense,"dense"),fe(e.striped,"striped"),fe(e.hover!==!1,"hover"),fe(e.stickyHeader!==!1,"sticky-head"),e.tableClass]),ce={...e.tableStyle||{}};e.minTableWidth!=null&&(ce["--cms-table-min-width"]=Be(e.minTableWidth));const L=_.table({class:U,style:ce},h,P),f=_.div({class:"cms-singularity cms-table-wrap"},L);oe.appendChild(f);const k=_.div({class:"cms-singularity cms-table-chip"},""),A=_.div({class:"cms-singularity cms-table-chip"},""),H=he.Btn({outline:!0,onClick:()=>w(Math.max(1,S()-1))},"\u2039"),ge=he.Btn({outline:!0,onClick:()=>w(S()+1)},"\u203A"),Se=_.div({class:"cms-singularity cms-table-chip"},""),ye=_.select({class:"cms-input cms-table-size-select"},...u.map(Ce=>us({value:String(Ce)},String(Ce))));ye.value=String(z()),ye.addEventListener("change",()=>W(ye.value));const V=J(s,"footer",{},e.footer),O=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},k,A,_.label({class:"cms-table-size"},_.span("Righe"),ye)),_.div({class:"cms-table-foot-extra"},...V,_.div({class:"cms-table-pager"},H,Se,ge)));e.hideFooter!==!0&&oe.appendChild(O);const K=()=>{if(h.innerHTML="",e.hideHeader)return;const Ce=_.tr();if(o.forEach((pe,Ie)=>{var de,Ae;const _e={col:pe,colIndex:Ie,sort:G()},I={...Xn(pe==null?void 0:pe.style,{..._e,header:!0}),...Xn((de=pe==null?void 0:pe.headerStyle)!=null?de:pe==null?void 0:pe.thStyle,{..._e,header:!0})};(pe==null?void 0:pe.width)!=null&&(I.width=Be(pe.width)),(pe==null?void 0:pe.minWidth)!=null&&(I.minWidth=Be(pe.minWidth)),(pe==null?void 0:pe.maxWidth)!=null&&(I.maxWidth=Be(pe.maxWidth)),pe!=null&&pe.align&&(I.textAlign=pe.align);let we=J(pe==null?void 0:pe.slots,"header",_e,null);if(!we.length){const Je=typeof(pe==null?void 0:pe.header)=="function"?pe.header(_e):(Ae=pe==null?void 0:pe.header)!=null?Ae:vl(pe);we=J(s,"header",_e,Je)}const E=G(),x=Cs(pe,Ie),v=(pe==null?void 0:pe.sortable)!==!1&&((pe==null?void 0:pe.key)!=null||typeof(pe==null?void 0:pe.get)=="function"||typeof(pe==null?void 0:pe.compare)=="function"),c=!!E&&(E.key===x||E.key===(pe==null?void 0:pe.key)),N=_.th({class:ae(["cms-table-head-cell",fe(pe==null?void 0:pe.nowrap,"is-nowrap"),fe(v,"cms-table-sortable"),fe(c,"is-sorted"),pe==null?void 0:pe.headerClass]),style:I});v?N.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>se(pe,Ie)},_.span({class:"cms-table-head-label"},...we),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},c?E.dir==="asc"?"\u2191":"\u2193":"\u2195"))):we.forEach(Je=>N.appendChild(Je)),Ce.appendChild(N)}),j){const pe=J(s,"actionsHeader",{},e.actionsLabel||"Azioni");Ce.appendChild(_.th({class:"cms-table-head-cell cms-table-head-actions",style:{textAlign:"right"}},...pe))}h.appendChild(Ce)},ke=(Ce,pe)=>{const Ie={columns:o,count:o.length},_e=J(s,Ce,Ie,pe),I=String(o.length+(j?1:0));P.appendChild(_.tr(_.td({colSpan:I,class:"cms-table-state"},..._e)))};return He.reactive.effect(()=>{const Ce=Qo(e.rows),pe=String(D()||"").trim(),Ie=G(),_e=typeof e.loading=="function"?!!e.loading():!!e.loading,I=e.pagination!==!1;if(K(),P.innerHTML="",me&&me.value!==D()&&(me.value=D()),ye.value!==String(z())&&(ye.value=String(z())),_e){d.textContent="Caricamento in corso",m.style.display="none",F.style.display="none",k.textContent="Loading\u2026",A.textContent="",Se.textContent="Pagina 1",H.disabled=!0,ge.disabled=!0,ke("loading",e.loadingText||"Loading...");return}let we=Ce.slice();const E=we.length;if(typeof e.filter=="function"&&(we=we.filter((B,Le)=>e.filter(B,{row:B,index:Le,query:pe,rows:Ce,columns:o}))),pe&&(we=we.filter(B=>ei(B,o,pe,e))),Ie){const B=Sl(o,Ie.key);B&&we.sort((Le,Me)=>{const Ee=qn(B,Le,-1),De=qn(B,Me,-1),Ue=typeof B.compare=="function"?B.compare(Ee,De,Le,Me):Xo(Ee,De);return Ie.dir==="asc"?Ue:-Ue})}const x=we.length,v=Math.max(1,Number(z())||y),c=I?Math.max(1,Math.ceil(x/v)):1,N=I?Math.min(S(),c):1;N!==S()&&w(N);const de=I?(N-1)*v:0,Ae=I?de+v:x,Je=we.slice(de,Ae);if(d.textContent=x===E?`${x} righe`:`${x} di ${E} righe`,m.textContent=pe?`Ricerca: ${pe}`:"",m.style.display=pe?"":"none",Ie){const B=Sl(o,Ie.key);F.textContent=B?`Ordine: ${vl(B)} ${Ie.dir==="asc"?"\u2191":"\u2193"}`:"",F.style.display=B?"":"none"}else F.style.display="none";if(k.textContent=x?`${de+1}-${Math.min(Ae,x)} di ${x}`:"0 risultati",A.textContent=x!==E?`Dataset totale ${E}`:`Page size ${v}`,Se.textContent=I?`Pagina ${N} / ${c}`:"Tutte le righe",H.disabled=!I||N<=1,ge.disabled=!I||N>=c,ye.disabled=!I,ye.parentNode.style.display=I?"":"none",Je.length===0){ke("empty",e.emptyText||"Nessun dato");return}for(let B=0;B<Je.length;B++){const Le=Je[B],Me=de+B,Ee={row:Le,rowIndex:Me,pageIndex:B},De=typeof e.rowAttrs=="function"?e.rowAttrs(Le,Ee)||{}:e.rowAttrs||{},Ue=typeof e.rowClass=="function"?e.rowClass(Le,Ee):e.rowClass,Ye=!!(e.onRowClick||e.onRowDblClick),Ze=_.tr({...De,class:ae(["cms-table-row",Ue,De.class,fe(Ye,"is-clickable")])});if(e.rowKey){const Te=typeof e.rowKey=="function"?e.rowKey(Le,Ee):Ss(Le,e.rowKey);Te!=null&&(Ze.dataset.key=String(Te))}const Qe=Te=>{const je=Te==null?void 0:Te.target;return!!(je&&je.closest&&je.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(e.onRowClick&&Ze.addEventListener("click",Te=>{Qe(Te)||e.onRowClick(Le,Ee,Te)}),e.onRowDblClick&&Ze.addEventListener("dblclick",Te=>{Qe(Te)||e.onRowDblClick(Le,Ee,Te)}),o.forEach((Te,je)=>{var ft,vt;const tt=qn(Te,Le,Me),nt={...Ee,col:Te,colIndex:je,value:tt},ut={...Xn(Te==null?void 0:Te.style,nt),...Xn((ft=Te==null?void 0:Te.cellStyle)!=null?ft:Te==null?void 0:Te.tdStyle,nt)};Te!=null&&Te.align&&(ut.textAlign=Te.align),(Te==null?void 0:Te.width)!=null&&(ut.width=Be(Te.width)),(Te==null?void 0:Te.minWidth)!=null&&(ut.minWidth=Be(Te.minWidth)),(Te==null?void 0:Te.maxWidth)!=null&&(ut.maxWidth=Be(Te.maxWidth));const dt=typeof(Te==null?void 0:Te.cellClass)=="function"?Te.cellClass(Le,nt):(Te==null?void 0:Te.cellClass)||(Te==null?void 0:Te.class),bt=_.td({class:ae(["cms-table-cell",dt,fe(Te==null?void 0:Te.nowrap,"is-nowrap")]),style:ut});let lt=J(Te==null?void 0:Te.slots,"cell",nt,null);if(!lt.length){const _t=typeof(Te==null?void 0:Te.render)=="function"?Te.render(Le,nt):typeof(Te==null?void 0:Te.format)=="function"?Te.format(tt,Le,nt):tt,rt=_t==null?(vt=Te==null?void 0:Te.emptyText)!=null?vt:"":_t;lt=J(s,"cell",nt,rt)}lt.length||(lt=[""]),lt.forEach(_t=>bt.appendChild(_t)),Ze.appendChild(bt)}),j){const Te={...Ee},je=typeof e.actions=="function"?e.actions(Le,Ee):e.actions;let tt=J(s,"actions",Te,je);tt.length||(tt=J(null,"default",Te,je)),Ze.appendChild(_.td({class:"cms-table-cell cms-table-cell-actions",style:{textAlign:"right"}},_.div({class:"cms-table-actions"},...tt)))}P.appendChild(Ze)}},"UI.Table:render"),re.body=oe,he.Card(re)},he.Menu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=["primary","secondary","warning","danger","success","info","light","dark"],r=["xs","sm","md","lg","xl"];let y={...e},u=null,i=null,b=null,T=null,S=null;const w=(f,k)=>Object.prototype.hasOwnProperty.call(f||{},k),z=(f,k)=>typeof f=="function"?f(k):f,Q=f=>String(f||"").split(/\s+/).filter(Boolean),G=f=>f&&typeof f=="object"&&!f.nodeType&&!Array.isArray(f)&&!(f instanceof Function),ie=f=>!!f&&typeof f=="object"&&(f.nodeType===1||typeof f.getBoundingClientRect=="function"),D=()=>{clearTimeout(T),clearTimeout(S),T=null,S=null},$=(f,k,A)=>{if(!f)return;const H=f[k]||[];H.length&&f.classList.remove(...H);const ge=(A||[]).filter(Boolean);ge.length&&f.classList.add(...ge),f[k]=ge},Y=(f,k,A,H=ge=>ge)=>{if(f){if(A==null||A===""){f.style.removeProperty(k);return}f.style.setProperty(k,H(A))}},W=()=>y||{},se=f=>{var A;const k=String(l((A=f.state)!=null?A:f.color)||"").toLowerCase();return o.includes(k)?k:""},me=f=>{const k=String(l(f.size)||"").toLowerCase();return r.includes(k)?k:""},re=f=>{var k,A;return String(l((A=(k=f.placement)!=null?k:f.position)!=null?A:"bottom-start"))},oe=()=>{var A;const f=l((A=W().delay)!=null?A:W().showDelay),k=Number(f);return Number.isFinite(k)?Math.max(0,k):0},le=()=>{const f=l(W().hideDelay),k=Number(f);return Number.isFinite(k)?Math.max(0,k):80},te=(f=null)=>{var A,H,ge;if(f)return f;const k=W();return i||l((ge=(H=(A=k.anchorEl)!=null?A:k.triggerEl)!=null?H:k.target)!=null?ge:k.anchor)||null},M=f=>{if(f==null||f===!0)return new Set(["click"]);if(f===!1)return new Set(["manual"]);const k=Array.isArray(f)?f:String(f).split(/[\s,|/]+/),A=new Set;return k.forEach(H=>{const ge=String(H||"").trim().toLowerCase();ge&&(ge==="mouseenter"||ge==="mouseover"?A.add("hover"):ge==="blur"||ge==="focusin"?A.add("focus"):ge==="tap"?A.add("click"):A.add(ge))}),A.size?A:new Set(["manual"])},Z=(f,k)=>{var ge,Se,ye;let A=null,H=null;if(ie(f))A=f,G(k)&&(H=k);else if(G(f)){H=f;const V=(ye=(Se=(ge=f.anchorEl)!=null?ge:f.triggerEl)!=null?Se:f.target)!=null?ye:f.anchor;ie(V)&&(A=V)}else f!=null&&(A=f);return{anchorEl:A,nextProps:H}},q=(f=u==null?void 0:u.panel)=>{var k;return Array.from(((k=f==null?void 0:f.querySelectorAll)==null?void 0:k.call(f,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(A=>A.offsetParent!==null&&A.getAttribute("aria-hidden")!=="true")},ue=()=>{l(W().autoFocus)!==!1&&setTimeout(()=>{const f=q();if(!f.length)return;(f.find(A=>A.classList.contains("is-active")||A.classList.contains("is-selected")||A.classList.contains("is-checked"))||f[0]).focus()},0)},R=(f,k,A="sm")=>{const H=z(f,k);return H==null?[]:typeof H=="string"?[he.Icon({name:H,size:A})]:Ln(H,{...k,as:"icon"})},g=(f,k)=>{var de,Ae,Je,B,Le,Me,Ee,De,Ue,Ye,Ze,Qe,Te;const A=z(f,k);if(A==null||A===!1)return[];if(Array.isArray(A))return A.flatMap((je,tt)=>g(je,{...k,index:tt}));if(typeof A=="function")return g(A(k),k);if(A!=null&&A.nodeType)return[A];if(typeof A=="string"||typeof A=="number")return g({label:A},k);if(!G(A))return Ln(A,{...k,as:"item"});const H=String((Ae=(de=A.type)!=null?de:A.kind)!=null?Ae:"").toLowerCase();if(H==="separator"||H==="divider"||A.separator===!0||A.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ge=(Je=A.items)!=null?Je:A.children;if((H==="group"||H==="section"||Array.isArray(ge))&&ge!=null){const je={...k,item:A},tt=J(s,"groupLabel",je,z((B=A.label)!=null?B:A.title,je)),nt=g(ge,je);return nt.length?[_.div({class:ae(["cms-menu-group",A.class])},tt.length?_.div({class:"cms-menu-group-label"},...tt):null,_.div({class:"cms-menu-group-items"},...nt))]:[]}const Se={...k,item:A,close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:W()},ye=!!l(A.disabled),V=A.checked==null?null:!!l(A.checked),O=!!l((Le=A.active)!=null?Le:A.selected),K=se(A),ke=l(A.href),Ne=l(A.to),ee=w(A,"closeOnSelect")?!!l(A.closeOnSelect):A.keepOpen===!0?!1:W().closeOnSelect!==!1,xe=A.role||(V!=null?"menuitemcheckbox":"menuitem"),be=R(A.icon,Se),Ce=R((Me=A.iconRight)!=null?Me:A.endIcon,Se),pe=J(s,"itemTitle",Se,z((Ee=A.title)!=null?Ee:A.label,Se)),Ie=J(s,"itemSubtitle",Se,z((De=A.subtitle)!=null?De:A.description,Se)),_e=J(s,"itemShortcut",Se,z(A.shortcut,Se)),I=J(s,"itemBadge",Se,z(A.badge,Se)),we=J(s,"item",Se,z((Ye=(Ue=A.content)!=null?Ue:A.body)!=null?Ye:A.render,Se)),E=[...I,..._e,...V===!0&&!Ce.length&&!I.length?[_.span({class:"cms-menu-entry-check"},he.Icon({name:A.checkedIcon||"check",size:"sm"}))]:[],...Ce],v={class:ae(["cms-menu-entry","cms-menu-item",K?`cms-state-${K}`:"",fe(O,"is-active"),fe(V===!0,"is-checked"),fe(ye,"is-disabled"),A.class]),role:xe,tabIndex:ye?-1:(Ze=A.tabIndex)!=null?Ze:-1,"data-menu-item":!0,"data-menu-select":ee?"true":"false","data-menu-close":A.close===!0?"true":null,"data-menu-keep-open":ee?null:"true","aria-disabled":ye?"true":null,"aria-checked":V==null?null:String(V),title:(Te=(Qe=A.titleAttr)!=null?Qe:A.tooltip)!=null?Te:null,type:ke?null:"button",href:ke||null,target:A.target||null,rel:A.rel||(A.target==="_blank"?"noopener noreferrer":null),onClick:je=>{var nt,ut,dt,bt;if(ye){je.preventDefault(),je.stopPropagation();return}(ut=(nt=W()).onItemClick)==null||ut.call(nt,A,Se,je);const tt=(dt=A.onClick)==null?void 0:dt.call(A,Se,je);je.defaultPrevented||(Ne&&((bt=JSswift.router)!=null&&bt.navigate)&&(je.preventDefault(),JSswift.router.navigate(Ne)),tt!==!1&&ee&&X())}};A.attrs&&typeof A.attrs=="object"&&Object.assign(v,A.attrs);const c=ke?_.a:_.button,N=we.length?we:[pe.length?_.div({class:"cms-menu-entry-title"},...pe):null,Ie.length?_.div({class:"cms-menu-entry-subtitle"},...Ie):null].filter(Boolean);return[c(v,be.length?_.span({class:"cms-menu-entry-icon"},...be):null,_.span({class:"cms-menu-entry-main"},...N),E.length?_.span({class:"cms-menu-entry-aside"},...E):null)]},d=()=>{var pe,Ie,_e,I,we,E,x;const f=W(),k={close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:f},A=R(f.icon,k,f.iconSize||"md"),H=J(s,"eyebrow",k,z(f.eyebrow,k)),ge=J(s,"title",k,z((Ie=(pe=f.title)!=null?pe:f.heading)!=null?Ie:f.label,k)),Se=J(s,"subtitle",k,z((_e=f.subtitle)!=null?_e:f.description,k)),ye=J(s,"before",k,z(f.before,k)),V=J(s,"header",k,z(f.header,k)),O=J(s,"after",k,z(f.after,k)),K=J(s,"footer",k,z(f.footer,k)),ke=J(s,"status",k,z(f.status,k));let Ne=(I=f.content)!=null?I:f.body;Ne==null&&n&&n.length&&(Ne=n);let ee=J(s,"content",k,z(Ne,k));ee.length||(ee=J(s,"body",k,z(Ne,k))),ee.length||(ee=J(s,"default",k,z(Ne,k)));const xe=g((E=(we=f.items)!=null?we:f.actionsList)!=null?E:f.entries,k),be=xe.length?[]:J(s,"empty",k,z((x=f.empty)!=null?x:f.emptyText,k));let Ce=null;return V.length?Ce=_.div({class:ae(["cms-menu-head","cms-menu-head-custom",f.headerClass])},...V):(A.length||H.length||ge.length||Se.length)&&(Ce=_.div({class:ae(["cms-menu-head",f.headerClass])},A.length?_.div({class:"cms-menu-head-icon"},...A):null,_.div({class:"cms-menu-head-main"},H.length?_.div({class:"cms-menu-eyebrow"},...H):null,ge.length?_.div({class:"cms-menu-title"},...ge):null,Se.length?_.div({class:"cms-menu-subtitle"},...Se):null))),_.div({class:ae(["cms-menu","cms-menu-shell",fe(f.dense,"dense"),fe(xe.length>0,"has-items"),fe(K.length>0||ke.length>0,"has-footer"),f.class]),style:f.style||{},role:f.role||"menu","aria-label":f.ariaLabel||null},ye.length?_.div({class:"cms-menu-before"},...ye):null,Ce,ee.length?_.div({class:ae(["cms-menu-content",f.contentClass])},...ee):null,xe.length?_.div({class:ae(["cms-menu-items",f.itemsClass])},...xe):null,!xe.length&&be.length?_.div({class:"cms-menu-empty"},...be):null,O.length?_.div({class:"cms-menu-after"},...O):null,ke.length||K.length?_.div({class:ae(["cms-menu-footer",f.footerClass])},ke.length?_.div({class:"cms-menu-status"},...ke):null,K.length?_.div({class:"cms-menu-footer-actions"},...K):null):null)},m=f=>{var ge;if(!(f!=null&&f.panel))return;const k=W(),A=se(k),H=me(k);$(f.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",H?`cms-menu-${H}`:"",A?`cms-state-${A}`:"",l(k.outline)?"outline":"",...Q(k.panelClass)]),$(f.overlay,"_menuOverlayClassTokens",[...Q(k.overlayClass)]),f.panel.dataset.placement=re(k),Y(f.panel,"--cms-menu-width",l(k.width),Be),Y(f.panel,"--cms-menu-min-width",l(k.minWidth),Be),Y(f.panel,"--cms-menu-max-width",l(k.maxWidth),Be),Y(f.panel,"--cms-menu-max-height",l(k.maxHeight),Be),Y(f.panel,"--cms-menu-body-max-height",l((ge=k.bodyMaxHeight)!=null?ge:k.contentMaxHeight),Be),k.panelStyle&&Object.assign(f.panel.style,k.panelStyle),Ke(f.panel,k)},F=()=>{u!=null&&u.panel&&u.panel.replaceChildren(d())},X=()=>{if(D(),!u)return;const f=u;u=null,yn(f,()=>JSswift.overlay.close(f.id))},a=(f={})=>{var k,A,H,ge;if(f&&typeof f=="object"&&(y={...y,...f}),u){const Se=W();m(u),F(),(ge=u.reposition)==null||ge.call(u,{anchorEl:u._anchorEl,placement:re(Se),offsetX:(k=Se.offsetX)!=null?k:0,offsetY:(H=(A=Se.offsetY)!=null?A:Se.offset)!=null?H:8}),ue()}return L},C=(f=null,k=null)=>{var Ce,pe,Ie,_e,I,we,E,x,v,c,N,de,Ae,Je,B,Le;D();const{anchorEl:A,nextProps:H}=Z(f,k);H&&(y={...y,...H});const ge=W(),Se=te(A);if(!Se||l(ge.disabled))return null;if(u&&u._anchorEl===Se){const Me=W();return m(u),F(),(_e=u.reposition)==null||_e.call(u,{anchorEl:u._anchorEl,placement:re(Me),offsetX:(Ce=Me.offsetX)!=null?Ce:0,offsetY:(Ie=(pe=Me.offsetY)!=null?pe:Me.offset)!=null?Ie:8}),ue(),u}u&&X(),b=document.activeElement;let ye=null;if(u=JSswift.overlay.open(()=>d(),{type:"menu",anchorEl:Se,placement:re(ge),offsetX:(I=ge.offsetX)!=null?I:0,offsetY:(E=(we=ge.offsetY)!=null?we:ge.offset)!=null?E:8,backdrop:ge.backdrop===!0,lockScroll:ge.lockScroll===!0,trapFocus:ge.trapFocus===!0,autoFocus:!1,closeOnOutside:ge.closeOnOutside!==!1,closeOnBackdrop:(x=ge.closeOnBackdrop)!=null?x:ge.backdrop===!0,closeOnEsc:ge.closeOnEsc!==!1,className:Dt(["cms-menu-panel"]),onClose:()=>{var Me,Ee,De;(Me=ye==null?void 0:ye._menuCleanup)==null||Me.call(ye),(De=(Ee=W()).onClose)==null||De.call(Ee,ye),W().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const V=u;ye=V,V._anchorEl=Se;const O=()=>{clearTimeout(S),S=null},K=()=>{P()},ke=Me=>{const Ee=Me.target;if(!Ee||!Ee.closest)return;if(Ee.closest("[data-menu-close]")){X();return}if(W().closeOnSelect===!1)return;const De=Ee.closest("[data-menu-item], [data-menu-select], .cms-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");De&&(De.closest("[data-menu-keep-open]")||De.getAttribute("data-menu-select")!=="false"&&X())},Ne=Me=>{if(Me.key==="Escape"){Me.preventDefault(),X();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(Me.key))return;const Ee=q(V.panel);if(!Ee.length)return;Me.preventDefault();const De=Ee.indexOf(document.activeElement);if(Me.key==="Home"){Ee[0].focus();return}if(Me.key==="End"){Ee[Ee.length-1].focus();return}const Ue=Me.key==="ArrowDown"?1:-1,Ye=De<0?Ue>0?0:Ee.length-1:(De+Ue+Ee.length)%Ee.length;Ee[Ye].focus()};V.panel.addEventListener("click",ke),V.panel.addEventListener("keydown",Ne);const ee=M((c=(v=ge.trigger)!=null?v:ge.triggers)!=null?c:w(ge,"open")?"manual":null),xe=ee.has("hover"),be=ee.has("focus");return(xe||be)&&(V.panel.addEventListener("mouseenter",O),V.panel.addEventListener("mouseleave",K),V.panel.addEventListener("focusin",O),V.panel.addEventListener("focusout",K)),V._menuCleanup=()=>{var Me,Ee,De,Ue,Ye,Ze;(Me=V.panel)==null||Me.removeEventListener("click",ke),(Ee=V.panel)==null||Ee.removeEventListener("keydown",Ne),(De=V.panel)==null||De.removeEventListener("mouseenter",O),(Ue=V.panel)==null||Ue.removeEventListener("mouseleave",K),(Ye=V.panel)==null||Ye.removeEventListener("focusin",O),(Ze=V.panel)==null||Ze.removeEventListener("focusout",K)},m(V),(Je=V.reposition)==null||Je.call(V,{anchorEl:Se,placement:re(ge),offsetX:(N=ge.offsetX)!=null?N:0,offsetY:(Ae=(de=ge.offsetY)!=null?de:ge.offset)!=null?Ae:8}),bn(V),(Le=(B=W()).onOpen)==null||Le.call(B,V),ue(),V},h=(f,k=null)=>{clearTimeout(S),S=null,clearTimeout(T),T=setTimeout(()=>C(f,k),oe())},P=(f=!1)=>{if(clearTimeout(T),T=null,!!u){if(clearTimeout(S),f){X();return}S=setTimeout(()=>X(),le())}},j=(f=null,k=null)=>U()?(X(),null):C(f,k),U=()=>!!u,L={open:C,close:X,show:h,hide:P,toggle:j,update:a,bind:f=>{var K,ke;if(!f)return()=>{};i=f;const k=W(),A=M((ke=(K=k.trigger)!=null?K:k.triggers)!=null?ke:w(k,"open")?"manual":null),H=A.has("hover"),ge=A.has("focus"),Se=A.has("click"),ye=A.has("manual")||!H&&!ge&&!Se,V=[],O=()=>{D(),V.forEach(Ne=>Ne()),i===f&&(i=null)};if(w(k,"open"))return at(k.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?C(i):P(!0))},"UI.Menu:open"):k.open===!0?C(f):k.open===!1&&P(!0),O;if(ye||l(k.disabled))return O;if(H){const Ne=()=>h(f),ee=()=>P();f.addEventListener("mouseenter",Ne),f.addEventListener("mouseleave",ee),V.push(()=>{f.removeEventListener("mouseenter",Ne),f.removeEventListener("mouseleave",ee)})}if(ge){const Ne=()=>h(f),ee=()=>P();f.addEventListener("focus",Ne),f.addEventListener("blur",ee),V.push(()=>{f.removeEventListener("focus",Ne),f.removeEventListener("blur",ee)})}if(Se){const Ne=ee=>{var xe,be;(be=(xe=W()).onTriggerClick)==null||be.call(xe,ee),!ee.defaultPrevented&&j(f)};f.addEventListener("click",Ne),V.push(()=>f.removeEventListener("click",Ne))}return O},isOpen:U,entry:()=>u,props:()=>({...y})};return L},he.Popover=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=["primary","secondary","warning","danger","success","info","light","dark"],r=["xs","sm","md","lg","xl"];let y={...e},u=null,i=null,b=null,T=null,S=null;const w=(L,f)=>Object.prototype.hasOwnProperty.call(L||{},f),z=(L,f)=>typeof L=="function"?L(f):L,Q=L=>String(L||"").split(/\s+/).filter(Boolean),G=L=>L&&typeof L=="object"&&!L.nodeType&&!Array.isArray(L)&&!(L instanceof Function),ie=L=>!!L&&typeof L=="object"&&(L.nodeType===1||typeof L.getBoundingClientRect=="function"),D=()=>{clearTimeout(T),clearTimeout(S),T=null,S=null},$=(L,f,k)=>{if(!L)return;const A=L[f]||[];A.length&&L.classList.remove(...A);const H=(k||[]).filter(Boolean);H.length&&L.classList.add(...H),L[f]=H},Y=(L,f,k,A=H=>H)=>{if(L){if(k==null||k===""){L.style.removeProperty(f);return}L.style.setProperty(f,A(k))}},W=()=>y,se=L=>{var k;const f=l((k=L.state)!=null?k:L.color);return f?o.includes(f)?f:String(f):""},me=L=>{const f=l(L.size);return typeof f=="string"&&r.includes(f)?f:""},re=L=>{var k,A,H;const f=String(l((H=(A=(k=L.actionsAlign)!=null?k:L.footerAlign)!=null?A:L.alignActions)!=null?H:"end")).toLowerCase();return["start","left"].includes(f)?"start":["center","middle"].includes(f)?"center":["between","space-between"].includes(f)?"between":["stretch","full"].includes(f)?"stretch":"end"},oe=L=>{var f,k;return String(l((k=(f=L.placement)!=null?f:L.position)!=null?k:"bottom-start"))},le=(L,f)=>{const k=l(L);if(k==null||k==="")return f;const A=Number(k);return Number.isFinite(A)?A:f},te=()=>le(W().delay,0),M=()=>le(W().hideDelay,120),Z=L=>{var k,A;return((A=(k=L.closable)!=null?k:L.dismissible)!=null?A:L.closeButton)===!0},q=(L=null)=>{var k,A,H;if(L)return L;const f=W();return i||l((H=(A=(k=f.anchorEl)!=null?k:f.triggerEl)!=null?A:f.target)!=null?H:f.anchor)||null},ue=L=>{if(L==null||L===!0)return new Set(["click"]);if(L===!1)return new Set(["manual"]);const f=Array.isArray(L)?L:String(L).split(/[\s,|/]+/),k=new Set;return f.forEach(A=>{const H=String(A||"").trim().toLowerCase();H&&(H==="mouseenter"||H==="mouseover"?k.add("hover"):H==="blur"||H==="focusin"?k.add("focus"):H==="tap"?k.add("click"):k.add(H))}),k.size?k:new Set(["manual"])},R=(L,f)=>{var H,ge,Se;let k=null,A=null;if(ie(L))k=L,G(f)&&(A=f);else if(G(L)){A=L;const ye=(Se=(ge=(H=L.anchorEl)!=null?H:L.triggerEl)!=null?ge:L.target)!=null?Se:L.anchor;ie(ye)&&(k=ye)}else L!=null&&(k=L);return{anchorEl:k,nextProps:A}},g=()=>{var be,Ce,pe,Ie,_e,I,we,E,x;const L=W(),f={close:F,dismiss:F,open:a,toggle:P,update:X,isOpen:j,entry:()=>u,anchorEl:q(),props:L},k=L.icon!=null?typeof L.icon=="string"?he.Icon({name:L.icon,size:L.iconSize||"md"}):JSswift.ui.slot(L.icon,{as:"icon"}):null,A=J(s,"eyebrow",f,z(L.eyebrow,f)),H=J(s,"title",f,z((Ce=(be=L.title)!=null?be:L.heading)!=null?Ce:L.label,f)),ge=J(s,"subtitle",f,z((pe=L.subtitle)!=null?pe:L.description,f)),Se=J(s,"icon",f,k),ye=J(s,"header",f,z((_e=(Ie=L.headerContent)!=null?Ie:L.head)!=null?_e:L.header,f)),V=Z(L)?J(s,"close",f,he.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":L.closeLabel||"Chiudi popover","data-popover-close":!0},he.Icon({name:L.closeIcon||"close",size:"sm"}))):[];let O=(E=(we=(I=L.content)!=null?I:L.body)!=null?we:L.message)!=null?E:L.text;O==null&&n&&n.length&&(O=n);let K=J(s,"content",f,z(O,f));K.length||(K=J(s,"body",f,z(O,f))),K.length||(K=J(s,"default",f,z(O,f)));const ke=z((x=L.footer)!=null?x:L.actions,f);let Ne=J(s,"footer",f,ke);Ne.length||(Ne=J(s,"actions",f,ke));let ee=null;ye.length?ee=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...ye):(A.length||H.length||ge.length||Se.length||V.length)&&(ee=_.div({class:"cms-dialog-head"},Se.length?_.div({class:"cms-dialog-icon"},...Se):null,_.div({class:"cms-dialog-head-main"},A.length?_.div({class:"cms-dialog-eyebrow"},...A):null,H.length?_.div({class:"cms-dialog-title"},...H):null,ge.length?_.div({class:"cms-dialog-subtitle"},...ge):null),V.length?_.div({class:"cms-dialog-close-wrap"},...V):null));const xe=[];return ee&&xe.push(ee),K.length&&xe.push(_.div({class:ae(["cms-dialog-body",L.bodyClass])},...K)),Ne.length&&xe.push(_.div({class:ae(["cms-dialog-actions",`is-${re(L)}`,fe(L.stackActions,"is-stacked"),L.actionsClass,L.footerClass])},...Ne)),xe.length||xe.push(_.div({class:ae(["cms-dialog-body",L.bodyClass])})),_.div({class:ae(["cms-dialog-shell","cms-popover-shell",fe(!!ee,"has-head"),fe(Ne.length>0,"has-footer"),fe(L.divider!==!1,"with-divider")])},...xe)},d=L=>{var H;if(!(L!=null&&L.panel))return;const f=W(),k=se(f),A=me(f);$(L.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",A?`cms-dialog-${A}`:"",k,k?`cms-state-${k}`:"",l(f.scrollable)?"scrollable":"",l(f.stickyHeader)?"sticky-head":"",l(f.stickyActions)?"sticky-actions":"",l(f.borderless)?"borderless":"",...Q(f.class),...Q(f.panelClass)]),$(L.overlay,"_popoverOverlayClassTokens",[...Q(f.overlayClass)]),L.panel.dataset.placement=oe(f),Y(L.panel,"--cms-dialog-width",l(f.width),Be),Y(L.panel,"--cms-dialog-min-width",l(f.minWidth),Be),Y(L.panel,"--cms-dialog-max-width",l(f.maxWidth),Be),Y(L.panel,"--cms-dialog-max-height",l(f.maxHeight),Be),Y(L.panel,"--cms-dialog-body-max-height",l((H=f.bodyMaxHeight)!=null?H:f.contentMaxHeight),Be),f.style&&Object.assign(L.panel.style,f.style),Ke(L.panel,f),L.panel.setAttribute("role",f.role||"dialog"),L.panel.setAttribute("aria-modal",f.modal===!0?"true":"false"),f.ariaLabel?L.panel.setAttribute("aria-label",f.ariaLabel):L.panel.removeAttribute("aria-label")},m=()=>{u!=null&&u.panel&&u.panel.replaceChildren(g())},F=()=>{if(D(),!u)return;const L=u;u=null,yn(L,()=>JSswift.overlay.close(L.id))},X=(L={})=>(L&&typeof L=="object"&&(y={...y,...L}),u&&(d(u),m()),ce),a=(L=null,f=null)=>{var xe,be,Ce,pe,Ie,_e,I,we;D();const{anchorEl:k,nextProps:A}=R(L,f);A&&(y={...y,...A});const H=W(),ge=q(k);if(!ge||l(H.disabled))return null;if(u&&u._anchorEl===ge)return d(u),m(),u;u&&F(),b=document.activeElement;const Se=ue((be=(xe=H.trigger)!=null?xe:H.triggers)!=null?be:w(H,"open")?"manual":null),ye=Se.has("hover"),V=Se.has("focus");let O=null;if(u=JSswift.overlay.open(()=>g(),{type:"popover",anchorEl:ge,placement:oe(H),offsetX:(Ce=H.offsetX)!=null?Ce:0,offsetY:(Ie=(pe=H.offsetY)!=null?pe:H.offset)!=null?Ie:10,backdrop:H.backdrop===!0,lockScroll:H.lockScroll===!0,trapFocus:H.trapFocus===!0,autoFocus:H.autoFocus===!0,closeOnOutside:H.closeOnOutside!==!1,closeOnBackdrop:(_e=H.closeOnBackdrop)!=null?_e:H.backdrop===!0,closeOnEsc:H.closeOnEsc!==!1,className:Dt(["cms-dialog","cms-popover"]),onClose:()=>{var E,x,v;(E=O==null?void 0:O._popoverCleanup)==null||E.call(O),(v=(x=W()).onClose)==null||v.call(x,O),W().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const K=u;O=K,K._anchorEl=ge;const ke=()=>{clearTimeout(S),S=null},Ne=()=>{!ye&&!V||h()},ee=E=>{const x=E.target;if(!(!x||!x.closest)){if(x.closest("[data-popover-close]")||x.closest("[data-dialog-close]")){F();return}W().closeOnSelect===!0&&x.closest("[data-popover-select]")&&F()}};return K.panel.addEventListener("click",ee),(ye||V)&&(K.panel.addEventListener("mouseenter",ke),K.panel.addEventListener("mouseleave",Ne),K.panel.addEventListener("focusin",ke),K.panel.addEventListener("focusout",Ne)),K._popoverCleanup=()=>{var E,x,v,c,N;(E=K.panel)==null||E.removeEventListener("click",ee),(x=K.panel)==null||x.removeEventListener("mouseenter",ke),(v=K.panel)==null||v.removeEventListener("mouseleave",Ne),(c=K.panel)==null||c.removeEventListener("focusin",ke),(N=K.panel)==null||N.removeEventListener("focusout",Ne)},d(K),bn(K),(we=(I=W()).onOpen)==null||we.call(I,K),K},C=(L,f=null)=>{clearTimeout(S),S=null,clearTimeout(T),T=setTimeout(()=>a(L,f),te())},h=(L=!1)=>{if(clearTimeout(T),T=null,!!u){if(clearTimeout(S),L){F();return}S=setTimeout(()=>F(),M())}},P=(L=null,f=null)=>j()?(F(),null):a(L,f),j=()=>!!u,ce={open:a,close:F,show:C,hide:h,toggle:P,update:X,bind:L=>{var O,K;if(!L)return()=>{};i=L;const f=W(),k=ue((K=(O=f.trigger)!=null?O:f.triggers)!=null?K:w(f,"open")?"manual":null),A=k.has("hover"),H=k.has("focus"),ge=k.has("click"),Se=k.has("manual")||!A&&!H&&!ge,ye=[],V=()=>{D(),ye.forEach(ke=>ke()),i===L&&(i=null)};if(w(f,"open"))return at(f.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?a(i):h(!0))},"UI.Popover:open"):f.open===!0?a(L):f.open===!1&&h(!0),V;if(Se||l(f.disabled))return V;if(A){const ke=()=>C(L),Ne=()=>h();L.addEventListener("mouseenter",ke),L.addEventListener("mouseleave",Ne),ye.push(()=>{L.removeEventListener("mouseenter",ke),L.removeEventListener("mouseleave",Ne)})}if(H){const ke=()=>C(L),Ne=()=>h();L.addEventListener("focus",ke),L.addEventListener("blur",Ne),ye.push(()=>{L.removeEventListener("focus",ke),L.removeEventListener("blur",Ne)})}if(ge){const ke=Ne=>{var ee,xe;(xe=(ee=W()).onTriggerClick)==null||xe.call(ee,Ne),!Ne.defaultPrevented&&P(L)};L.addEventListener("click",ke),ye.push(()=>L.removeEventListener("click",ke))}return V},isOpen:j,entry:()=>u,props:()=>({...y})};return ce},he.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},o=null,r=null,y=null;const u=m=>m&&typeof m=="object"&&!m.nodeType&&!Array.isArray(m)&&!(m instanceof Function),i=m=>!!m&&typeof m=="object"&&(m.nodeType===1||typeof m.getBoundingClientRect=="function"),b=m=>!!m&&typeof m=="object"&&("clientX"in m||"type"in m||"target"in m||"currentTarget"in m),T=m=>!!m&&Number.isFinite(Number(m.x))&&Number.isFinite(Number(m.y)),S=()=>s,w=(m,F)=>{const X=Number(m),a=Number(F);return!Number.isFinite(X)||!Number.isFinite(a)?null:{x:X,y:a}},z=m=>m?{_cmsContextPoint:m,getBoundingClientRect:()=>({top:m.y,bottom:m.y,left:m.x,right:m.x,width:0,height:0})}:null,Q=m=>{if(!i(m))return null;const F=m.getBoundingClientRect();return w(F.left+Math.min(F.width/2,24),F.top+Math.min(F.height/2,24))},G=m=>{var F,X,a,C;return l((C=(a=(X=(F=m==null?void 0:m.anchorEl)!=null?F:m==null?void 0:m.triggerEl)!=null?X:m==null?void 0:m.target)!=null?a:m==null?void 0:m.anchor)!=null?C:null)},ie=(m,F=null)=>{if(!m)return Q(F||y);const X=w(m.clientX,m.clientY);if(X)return X;const a=G({anchorEl:F||m.currentTarget||m.target||y});return Q(a)},D=(m={})=>{if(!u(m))return{};const F={...m};return delete F.event,delete F.point,delete F.x,delete F.y,F},$=()=>{var F,X,a;const m=S();return{...m,trigger:"manual",placement:m.placement||"bottom-start",offsetX:(F=m.offsetX)!=null?F:0,offsetY:(a=(X=m.offsetY)!=null?X:m.offset)!=null?a:4,closeOnOutside:m.closeOnOutside!==!1,closeOnEsc:m.closeOnEsc!==!1,role:m.role||"menu",ariaLabel:m.ariaLabel||m.title||"Context menu",class:ae(["cms-context-menu-shell",m.class]),panelClass:ae(["cms-context-menu-panel",m.panelClass])}},Y=he.Menu($(),...n),W=(m=null,F=null,X=null)=>{let a=null,C=null,h=null;if(b(m))a=ie(m,y),h=u(F)?D(F):null;else if(typeof m=="number"||typeof F=="number")a=w(m,F),h=u(X)?D(X):null;else if(T(m))a=w(m.x,m.y),h=u(F)?D(F):null;else if(i(m))C=m,h=u(F)?D(F):null;else if(u(m)){const P=T(m.point)?m.point:T(m)?m:null,j=G(m),U=m.event;a=P?w(P.x,P.y):ie(U,j||y),C=j&&i(j)?j:null,h={...D(m),...u(F)?D(F):{}}}else o&&(a={...o});return{point:a,anchor:C,nextProps:h}},se=(m,F=null)=>{r=m||r,o=F||m&&m._cmsContextPoint||o},me=(m=null)=>{u(m)&&Object.keys(m).length&&(s={...s,...m})},re=(m=null,F=null)=>{if(F)return z(F);if(m&&i(m))return m;const X=G(S());return i(X)?X:o?z(o):i(r)?r:i(y)?y:null},oe=(m=null,F=null,X=null)=>{const{point:a,anchor:C,nextProps:h}=W(m,F,X);me(h);const P=re(C,a);return P?(se(P,a),Y.open(P,$())):null},le=(m,F,X=null)=>oe(m,F,X),te=(m,F=null)=>oe(m,F),M=()=>(Y.close(),d),Z=(m=!0)=>(m===!1?Y.hide(!1):Y.close(),d),q=(m=null,F=null,X=null)=>oe(m,F,X),ue=(m=null,F=null,X=null)=>Y.isOpen()?(M(),null):oe(m,F,X),R=(m={})=>(me(D(m)),Y.update($()),d),d={open:oe,openAt:le,openFromEvent:te,show:q,hide:Z,close:M,toggle:ue,update:R,bind:(m,F=null)=>{if(!m)return()=>{};const X=u(F)?D(F):null,a=h=>{var j,U;y=m,h.preventDefault(),!(((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:m,open:oe,close:M,update:R}))===!1||l(S().disabled))&&oe({event:h,anchorEl:m},X)},C=h=>{var j,U;h.key!=="ContextMenu"&&!(h.shiftKey&&h.key==="F10")||(y=m,h.preventDefault(),((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:m,open:oe,close:M,update:R}))===!1||l(S().disabled))||oe({event:h,anchorEl:m},X)};return m.addEventListener("contextmenu",a),m.addEventListener("keydown",C),()=>{m.removeEventListener("contextmenu",a),m.removeEventListener("keydown",C)}},isOpen:Y.isOpen,entry:Y.entry,props:()=>({...s})};return d}})(JSswift);
|