@jsswift/ui 1.0.46 → 1.0.47

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 CHANGED
@@ -1,4 +1,4 @@
1
- (function(He){var Sl;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 Kl=()=>{ss||(ss=!0,queueMicrotask(()=>{ss=!1,Ht.length=0}))},Yl=t=>{Ht.push(t),Ht.length>128&&Ht.splice(0,Ht.length-128),Kl()},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},ql=(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 C=r;for(let u=0;u<e.length-1;u++){const i=e[u];let y=C[i];if(!y||typeof y!="object"){const R=e[u+1];y=Ps(R)?[]:{},C[i]=y}C=y}Object.is(C[e[e.length-1]],o)||(C[e[e.length-1]]=o,s.rawSet(r))},Ts=(t,e)=>[()=>os(t,e),n=>ql(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(C,u,i){if(u===ts)return C;const y=Reflect.get(C,u,i);if(typeof u=="symbol")return y;const R=n.concat(u);return y&&typeof y=="object"?Rs(t,y,R):typeof y=="function"?y.bind(i):(ns(y)&&Yl({rod:t,path:R,value:y}),y)},set(C,u,i,y){const R=ls(i),v=Reflect.get(C,u,y);if(Object.is(v,R))return!0;const b=Reflect.set(C,u,R,y);if(b){const P=xn.get(t);P==null||P.rawSet(P.rawGet())}return b},deleteProperty(C,u){const i=Reflect.has(C,u),y=Reflect.deleteProperty(C,u);if(y&&i){const R=xn.get(t);R==null||R.rawSet(R.rawGet())}return y}});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},Xl=()=>{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 C=t.map(u=>{const i=is(u,e,"");return i!==u&&(r=!0),i});return r?C: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 C=is(t[r],e,r);o[r]=C,C!==t[r]&&(s=!0)}return s?o:t},as=(t,e,n="")=>{if(Array.isArray(t)){let r=!1;const C=t.map(u=>{const i=as(u,e,"");return i!==u&&(r=!0),i});return r?C: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 C=!1;const u=o.map(i=>{const y=as(i,r,"");return y!==i&&(C=!0),y});return t.apply(this,C?u:o)};return Object.defineProperty(n,On,{value:!0,configurable:!1}),zs.set(t,n),n},Ql=()=>{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)}})}},Zl=()=>{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 C=!1;const u=o.map(i=>{const y=is(i,r,"");return y!==i&&(C=!0),y});return n.apply(this,C?u:o)})}};Xl(),((Sl=JSswift.rod)==null?void 0:Sl._all)instanceof Set&&JSswift.rod._all.forEach(t=>Ms(t)),Zl(),Ql();const Os={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},ci=new Set(Object.values(Os)),eo=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),to=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]||""},no=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":eo.has(e)?e:null},Dn=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return to.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))})},so=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),lo=(t={},e=[])=>{const n=[];for(const s of mn){const o=Nn(t,s);if(o)for(const r of e){const C=Array.isArray(r.prop)?r.prop:[r.prop];let u=!1,i,y="";for(const b of C)if($n(o,b)){i=l(o[b]),y=b,u=!0;break}if(!u||i==null||i===""||i===!1&&!r.allowFalse)continue;const R=typeof r.map=="function"?r.map(i,{propName:y,props:o,device:s,rule:r}):`${r.class}-${so(i)}`,v=Array.isArray(R)?R:[R];for(const b of v)b&&n.push(String(b).startsWith("cms-")?b:`${s.prefix}${b}`)}}return n},$s=(t={})=>mn.some(e=>!!Nn(t,e)),oo=(t={},e=[])=>{for(const n of e){if(!$n(t,n))continue;const s=l(t[n]);if(!(s==null||s===""))return s}},io=(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)},ao=(t,e,n)=>{!t||n==null||n===""||(typeof t.setProperty=="function"?t.setProperty(e,n):t[e]=n)},ro=(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 C=Array.isArray(r.prop)?r.prop:[r.prop],u=(i,y)=>{const R=oo(y,C),v=io(R,r);if(!v)return;const b=r.var||r.css,P=i==="mobile"?"--cms-rsp-":`--cms-rsp-${i}-`;ao(s,`${P}${b}`,v),Vs(t,ro(i,b)),o=!0};u("mobile",e);for(const i of mn){const y=Nn(e,i);y&&u(i.key,y)}}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=lo,JSswift.uiApplyResponsiveProps=Bs;const co=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(cs):cs;return co(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||{}})},uo=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=uo(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"},fo=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:fo},{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 mo=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),go=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(mo(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)||go(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),C=o!=null?typeof o=="function"?o(n||{}):o:s;return C==null?null:on(JSswift.ui.slot(C))};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 ho=new Set(["ctrl","alt","shift","meta"]),po={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"},bo={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?po[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(ho.has(o)){s[o]=!0;return}s.key=o}),s.key?s:null},yo=t=>t==null||t===!1?[]:(Array.isArray(t)?t:[t]).map(n=>{var o,r,C;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const u=Ks((C=(r=(o=n.shortcode)!=null?o:n.shortcut)!=null?r:n.keys)!=null?C:n.key);return u?{...n,...u}:null}const s=Ks(n);return s?{...s}:null}).filter(Boolean),Ys=(t={})=>{var e,n,s;return yo((s=(n=(e=t.shortcode)!=null?e:t.shortcut)!=null?n:t.hotkey)!=null?s:t.keys)},wo=(t={})=>t.showShortcode===!0||t.showShortcut===!0,Ln=t=>{const e=ds(t);if(!e)return"";const n={...bo};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()}`)},vo=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("+")},So=t=>(Array.isArray(t)?t:[]).map(vo).filter(Boolean).join(" / "),fs=(t={},e={})=>{const n=Ys(t);if(!wo(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=So(n),s},Co=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)},xo=(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,C,u,i;if(!gn.size||!t||t.defaultPrevented||t.isComposing)return;const e=Co(t.target),n=Array.from(gn);for(let y=n.length-1;y>=0;y-=1){const R=n[y],v=R==null?void 0:R.anchor;if(!v||!v.isConnected){gn.delete(R);continue}if(((s=R.isEnabled)==null?void 0:s.call(R))===!1)continue;const b=R.specs.find(ie=>{var $,Y;const D=(Y=($=ie.allowInEditable)!=null?$:R.allowInEditable)!=null?Y:!1;return e&&!D?!1:xo(t,ie)});if(!b)continue;const P=(r=(o=b.preventDefault)!=null?o:R.preventDefault)!=null?r:!0,Z=(u=(C=b.stopPropagation)!=null?C:R.stopPropagation)!=null?u:!0;if(P&&t.preventDefault(),Z&&t.stopPropagation(),((i=R.action)==null?void 0:i.call(R,t,b,v))!==!1)break}qs()}const an=(t,e={},n={})=>{var C,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:(C=n.preventDefault)!=null?C:!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,"-")}`,ko=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,_o=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""},No=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:ko},{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:_o},{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:No},{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],Ao=(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,S,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,S);return S==null?[]:E(null,"default",h,S)},r=a=>{var S;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?`var(--cms-s-${a})`:String(a)},C=a=>{var S;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.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||{}},y=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),v=ze(e.justify),b=ze(e.wrap,a=>typeof a=="boolean"?a?"wrap":"nowrap":String(a)),P=ze(e.gap,r),Z=ze(e.rowGap,r),G=ze(e.columnGap,r),ie=ze(e.inline,a=>a?"inline-flex":"flex"),D=ze(e.width,C),$=ze(e.minWidth,C),Y=ze(e.maxWidth,C),W=ze(e.full,a=>a?"100%":"",""),le=qe([e.inline,e.full,e.width],()=>{const a=!!l(e.inline),S=!!l(e.full),h=l(e.width)!=null&&l(e.width)!==!1&&l(e.width)!=="";return!a||S||h?"":"max-content"});y!=null&&!We(e,"direction")&&(i.flexDirection=y),R!=null&&!We(e,"align")&&(i.alignItems=R),v!=null&&!We(e,"justify")&&(i.justifyContent=v),b!=null&&!We(e,"wrap")&&(i.flexWrap=b),P!=null&&!We(e,"gap")&&(i.gap=P),Z!=null&&!We(e,"rowGap")&&(i.rowGap=Z),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),S=_.div(u,...a);return Ke(S,e),S}const M={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},Q=(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",Q]),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&&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 Io(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=Io(t),n=()=>{const s=[],o=Array.isArray(t)?[...t]:[t];for(;o.length;){const r=o.shift();if(r==null||r===!1)continue;const C=l(r);if(!(C==null||C===!1||C==="")){if(Array.isArray(C)){o.unshift(...C);continue}s.push(C)}}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)},C=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""},y=()=>{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"}),v=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]),b={...e.style||{}};!We(e,"minWidth")&&b.minWidth==null&&(b.minWidth=0);const P=ze(e.gap,C),Z=ze(e.rowGap,C),G=ze(e.columnGap,C),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":"",""),Q=qe([e.flex,e.fill,e.grow,e.shrink,e.basis],y),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)===""));Q!=null&&Q!==""&&(b.flex=Q),se!=null&&!We(e,"self")&&(b.alignSelf=se),te!=null&&(b.order=te),M!=null&&M!==""&&(b.overflow=M),Y!=null&&Y!==""&&!We(e,["width","size"])&&(b.width=Y,!o("flex")&&!o("fill")&&!o("grow")&&!o("shrink")&&!o("basis")&&(b.flex="0 0 auto")),W!=null&&!We(e,"minWidth")&&(b.minWidth=W),le!=null&&!We(e,"maxWidth")&&(b.maxWidth=le),me!=null&&!We(e,"height")&&(b.height=me),re!=null&&!We(e,"minHeight")&&(b.minHeight=re),oe!=null&&!We(e,"maxHeight")&&(b.maxHeight=oe),Object.keys(b).length&&(v.style=b);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(v.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")&&(b.gap=P),Z!=null&&!We(e,"rowGap")&&(b.rowGap=Z),G!=null&&!We(e,"columnGap")&&(b.columnGap=G),ie!=null&&!We(e,"align")?b.alignItems=ie:q!=null&&q!==""&&(b.alignItems=q?"center":""),D!=null&&!We(e,"justify")?b.justifyContent=D:q!=null&&q!==""&&(b.justifyContent=q?"center":""),Object.keys(b).length&&(v.style=b),JSswift.uiApplyResponsiveProps(v,e,JSswift.uiResponsiveStyleRules),!F){const N=_.div(v,...E(s,"default",ue,n));return Ke(N,e),N}const a={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},S=[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(v,...S);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=S=>Object.prototype.hasOwnProperty.call(e,S),C={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},u=S=>{if(S==null||S===!1||S==="")return"";if(typeof S=="number")return`${S}px`;const h=String(S).trim().toLowerCase();return h?h==="full"||h==="fluid"?"100%":C[h]||String(S):""},i=S=>{var h;return S==null||S===!1||S===""?"":typeof S=="number"?`${S}px`:typeof S=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(S))?`var(--cms-s-${S})`:String(S)},y=S=>{if(S==null||S===!1||S==="")return"";if(typeof S=="number"&&Number.isFinite(S))return`repeat(${Math.max(1,Math.floor(S))}, minmax(0, 1fr))`;const h=String(S).trim();return h?/^\d+$/.test(h)?`repeat(${Math.max(1,Number(h))}, minmax(0, 1fr))`:h:""},R=S=>S==null||S===""?"":S===!0?"wrap":S===!1?"nowrap":String(S),v={props:e},b=(S,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(J=>b(S,J));return}if(h!=null&&h.nodeType){S.appendChild(h);return}S.appendChild(document.createTextNode(String(h)))}},P=(S,h)=>{const J=JSswift.ui.getSlot(s,S);if(J!=null)return E(s,S,v,null);if(typeof h=="function"){const j=_.div({class:`cms-container-slot-${S}`});return JSswift.reactive.effect(()=>{const U=on(JSswift.ui.slot(h(v)));j.replaceChildren(),Array.isArray(U)?U.forEach(ce=>b(j,ce)):b(j,U)},`UI.Container:${S}`),[j]}return E(s,S,v,h)},Z=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 S=P("content",r("content")?e.content:null);return S.length?S:P("default",Z)})(),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 S=String(l((h=e.layout)!=null?h:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(S)?S:["inline","inline-flex","inlineflex"].includes(S)||l(e.inline)?"inline":l(e.grid)||l(e.cols)!=null?"grid":S==="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 S=se();return S==="block"?"":`is-${S}`}),M={...o.style||{}},Q=(S,h)=>{h!=null&&(M[S]=h)};Q("maxWidth",qe([e.maxWidth,e.fluid],()=>l(e.fluid)?"none":u(l(e.maxWidth))||"")),Q("width",ze(e.width,u)),Q("minWidth",ze(e.minWidth,u)),Q("--cms-container-padding",ze(e.padding,i)),Q("--cms-container-padding-x",ze((X=e.paddingX)!=null?X:e.gutter,i)),Q("--cms-container-padding-y",ze(e.paddingY,i)),Q("--cms-container-gap",ze(e.gap,i)),Q("--cms-container-section-gap",ze((a=e.sectionGap)!=null?a:e.gap,i)),Q("--cms-container-cols",ze(e.cols,y)),Q("--cms-container-align",ze(e.align,S=>String(S))),Q("--cms-container-justify",ze(e.justify,S=>String(S))),Q("--cms-container-direction",ze(e.direction,S=>String(S))),Q("--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=(S,h,J)=>h.length?_.div({class:ae(["cms-container-section",`cms-container-${S}`,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 S=String(l((h=e.tag)!=null?h:e.as)||"div").toLowerCase();return typeof _[S]=="function"?_[S]:_.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,y={dense:!!l(e.dense),flat:!!l(e.flat),clickable:!!l(e.clickable),to:l(e.to)||null},R=E(s,"default",y,n!=null&&n.length?n:[]),v={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},b=[];R.forEach(d=>{r(d,"identifier")?v.identifier.push(d):r(d,"cover")?v.cover.push(d):r(d,"media")?v.media.push(d):r(d,"header")?v.header.push(d):r(d,"body")?v.body.push(d):r(d,"footer")?v.footer.push(d):r(d,"actions")?v.actions.push(d):b.push(d)});const P=E(s,"identifier",y,e.identifier),Z=E(s,"cover",y,i),G=E(s,"media",y,e.media),ie=E(s,"eyebrow",y,(ce=e.eyebrow)!=null?ce:e.kicker),D=E(s,"title",y,e.title),$=E(s,"subtitle",y,e.subtitle),Y=E(s,"header",y,e.header),W=E(s,"icon",y,u),le=E(s,"aside",y,(k=e.aside)!=null?k:e.headerAside),me=E(s,"body",y,e.body),re=E(s,"footer",y,e.footer),oe=E(s,"actions",y,e.actions),se=P.length?_.div({class:ae(["cms-card-identifier",e.identifierClass])},...P):null,te=Z.length?_.div({class:ae(["cms-card-cover",e.coverClass])},...Z):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,...b],L=ue.length?_.div({class:ae(["cms-card-body",e.bodyClass])},...ue):null,f=[...oe,...v.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||v.identifier.length,X=Z.length||v.cover.length||G.length||v.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 S=e.onClick,h=e.onKeydown,J=d=>{var I;if(S==null||S(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,...v.identifier,te,...v.cover,M,...v.media,q,...v.header,L,...v.body,m,...v.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]),C=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);C.class=r;const u=()=>!!l(e.loading),i=()=>!!l(e.disabled)||u(),y=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,v=JSswift.ui.renderSlot(s,"icon",{},y),b=JSswift.ui.renderSlot(s,"iconRight",{},R),P=JSswift.ui.renderSlot(s,"label",{},e.label),Z=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),Z.length&&G.push(...Z),ie(v)):(ie(v),ie(P),Z.length&&G.push(...Z)),ie(b),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 Q=M.currentTarget,q=Q.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;Q.style.setProperty("--cms-burst-x",`${ue}px`),Q.style.setProperty("--cms-burst-y",`${L}px`),Q.classList.remove("cms-btn-burst"),Q.offsetWidth,Q.classList.add("cms-btn-burst")},oe=_.button({...C,disabled:i(),onClick:M=>{var Q,q;return i()?((Q=M==null?void 0:M.preventDefault)==null||Q.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(),Q=i();oe.disabled=Q,oe.classList.toggle("is-loading",M),oe.setAttribute("aria-disabled",Q?"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,Q,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,C=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),y=()=>{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:C,clear:y,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:i()},null);let v=null,b=null;if(R)v=Array.isArray(R)?_.div({class:"cms-control"},...R):R;else{v=_.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&&v.appendChild(L);const F=_.div({class:"cms-mid"+(L.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});C&&F.appendChild(C);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)}v.appendChild(F);const a=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:y},he.Icon({name:"close"})):null,S=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:i()},a);S&&(S.onclick=k=>{k.stopPropagation(),y()},E(null,"default",{},S).forEach(k=>v.appendChild(k))),b=a,b&&((oe=t.clearable)!=null&&oe.action)&&t.clearable.action(k=>k?b.classList.remove("cms-d-none"):b.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&&(v.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),Z=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(Z(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 S;return(S=v==null?void 0:v.classList)==null?void 0:S.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=v==null?void 0:v.classList)==null||f.toggle("has-value",L),b&&(b.style.display=L?"":"none")};JSswift.reactive.untracked(D),(se=v==null?void 0:v.classList)==null||se.toggle("disabled",!!t.disabled),s.appendChild(v);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||(Q=t.success)!=null&&Q.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=v,s._el=C,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 b;const v=(b=e.value)!=null?b:"";v!==n&&(n=v,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let o=null,r=!1;const C=()=>{if(r)return;r=!0;let v=0;const b=()=>{if(s(),v+=1,v>=10){r=!1;return}setTimeout(b,120)};setTimeout(b,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 v;n=(v=e.value)!=null?v:""}),e.addEventListener("change",()=>{var v;n=(v=e.value)!=null?v:""}),e.addEventListener("animationstart",v=>{v.animationName==="cms-autofill"&&(s(),u(),C())}),e.addEventListener("focus",()=>{u(),C(),setTimeout(s,50)}),e.addEventListener("blur",()=>{i(),setTimeout(s,0)}),setTimeout(s,0),C();const y=t.model;if(y){if(typeof y=="object"&&typeof y._bind=="function")He.rodModel(e,y);else if(Array.isArray(y)&&typeof y[0]=="function"&&typeof y[1]=="function"){const v=He.rodFromSignal(y[0],y[1]);He.rodModel(e,v)}}return an(e,t,{isEnabled:()=>!e.disabled,action:()=>hn(e,{selectText:!!t.selectOnShortcode})}),e},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 C=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)},y=()=>{C||(C=setInterval(()=>{if(document.activeElement!==s){clearInterval(C),C=null;return}r()},250))},R=()=>{C&&(clearInterval(C),C=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,$),y(),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(),y(),i())}),setTimeout(r,0),i();const v=t.model;if(v){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 v=="object"&&typeof v._bind=="function")$(v);else if(Array.isArray(v)&&typeof v[0]=="function"&&typeof v[1]=="function"){const Y=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(v[0],v[1]));$(Y)}}const b=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),P=Array.isArray(b)?_.div({style:{display:"contents"}},...b):b,Z=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($=Z._refresh)==null?void 0:$.call(Z)}),s.addEventListener("change",()=>{var $;return($=Z._refresh)==null?void 0:$.call(Z)}),Z._input=s,an(s,t,{isEnabled:()=>!s.disabled,action:()=>hn(s,{selectText:!!t.selectOnShortcode})}),Z},he.Textarea=(t={})=>{var y,R,v,b;const e=t.slots||{},n={...t,label:(y=t.label)!=null?y: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:(v=t.minLength)!=null?v:t.minlength,wrap:t.wrap,value:(b=t.value)!=null?b:"",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 Z;(Z=t.onFocus)==null||Z.call(t,P)}),s.addEventListener("blur",P=>{var Z;(Z=t.onBlur)==null||Z.call(t,P)});const o=t.model;if(o){const P=Z=>{let G=!1;const ie=$=>{const Y=$!=null?$:"";s.value!==Y&&(s.value=Y)};Z.action($=>{if(!G){G=!0;try{ie($)}finally{G=!1}}}),JSswift.reactive.untracked(()=>ie(Z.value));const D=$=>{if(G||$!=null&&$.isComposing)return;const Y=s.value;if(Z.value!==Y){G=!0;try{Z.value=Y}finally{G=!1}}};s.addEventListener("input",D),s.addEventListener("compositionend",D),typeof Z.onDispose=="function"&&Z.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 Z=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(o[0],o[1]));P(Z)}}const r=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",C=JSswift.ui.renderSlot(e,r,{textarea:s,input:s,props:t},s),u=Array.isArray(C)?_.div({style:{display:"contents"}},...C):C,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,C]=JSswift.reactive.signal(o==null?"":String(o)),[u,i]=JSswift.reactive.signal(!1),[y,R]=JSswift.reactive.signal(!1),[v,b]=JSswift.reactive.signal(null),[P,Z]=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},Q=(T,x=!1)=>{const w=l(T);return w==null?x:!!w},q=()=>Q(t.disabled,!1),ue=()=>Q(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()},S=(T,x={})=>{var c,A;const w=T==null?"":String(T);r()!==w&&C(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=()=>y()||v()||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=()=>{Z([]),b(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)){Z($.get(Je)),b(null),R(!1),ie($.get(Je).length?0:-1),x.open!==!1&&j();return}R(!0),b(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),Z(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;b(Ye),Z([]),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"?S(w,{event:x}):t.commitValue!==!1&&S(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=>S(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(()=>{S(T(),{fromModel:!0})},"UI.Search:model"),Y=w=>x(w)}}else at(t.value)&&JSswift.reactive.effect(()=>{S(l(t.value),{fromModel:!0})},"UI.Search:value");ee.addEventListener("input",T=>{S(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=y(),x=v(),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()||(S("",{}),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=>S(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||{},C=x=>!!x&&(typeof x=="object"&&typeof x._bind=="function"||At(x)),u=C(t.model)?t.model:C(t.value)?t.value:null,i=x=>Array.isArray(x)?x.slice():x==null||x===""?[]:[x],y=x=>s?i(x):x,R=u?JSswift.reactive.untracked(()=>typeof u=="object"&&typeof u._bind=="function"?u.value:u[0]()):t.value,[v,b]=JSswift.reactive.signal(!1),[P,Z]=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(y(u.value))),u.action(x=>ie(y(x))),se=x=>{const w=y(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(y(x()))},"UI.Select:model")}),se=c=>w(y(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 Q(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,Q(w)}catch(c){console.error("[UI.Select] options load error:",c),Q([])}finally{$(!1)}}function ue(x){var c;const w=y(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(){Z(""),ce&&(ce.value="")}function g(){b(!1),m(),oe(-1)}async function F(){if(te())return;b(!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(){v()?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"}),S=_.div({class:ae(["cms-select-value",s?"cms-select-value-multi":""])});JSswift.reactive.effect(()=>{const x=le();if(S.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))}});S.appendChild(Je)}}else{const w=G(),c=x.find(A=>A.value==w);S.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:v()},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},S,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=>Z(x.target.value||"")}),d=()=>{const x=JSswift.ui.renderSlot(r,"filter",{value:P(),setValue:c=>{const A=c==null?"":String(c);Z(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=()=>{!v()||H.parentNode!==document.body||ge||(ge=requestAnimationFrame(()=>{if(ge=0,!v()||!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=v();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))),v()&&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))),v()&&ye();return}}if(Le){const Ee=JSswift.ui.renderSlot(r,"loading",{},"Caricamento...");j.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},Ee))),v()&&ye();return}for(const Ee of B)j.appendChild(Ee);be(),v()&&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=v(),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"),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),[C,u]=JSswift.reactive.signal(!1),[i,y]=JSswift.reactive.signal(null);let R=0,v=!1;const b=()=>!!l(t.disabled)||!!l(t.readonly),P=()=>t.multiple!==!1&&t.single!==!0,Z=()=>{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!Z()&&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"),Q=(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&&Q(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(b())return[];y(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&&!Z()&&d(),x},F=(z={})=>{var we;for(const T of n())T.status==="uploading"&&a(T),T.status="removed";s([]),y(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())},S=()=>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,y(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(v||b())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=()=>{b()||H.click()},H=_.input({type:"file",class:"cms-upload-input",name:W(),accept:se()||null,multiple:P(),capture:t.capture||null,disabled:b(),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(Z(),"is-form-mode"),fe(!$(),"is-files-hidden"),t.class]),tabindex:b()?"-1":"0",role:"group","aria-disabled":b()?"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:S,files:()=>n().slice(),state:()=>({files:n().slice(),busy:C(),dragging:o(),error:i()}),reset:F},ke=()=>{const z={api:K,files:n().slice(),busy:C(),disabled:b(),submitMode:Z()?"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:C(),disabled:b()||!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:b()||!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||b()||(z.preventDefault(),r(!0),O.classList.add("is-dragging"))},onDragover:z=>{t.drag===!1||b()||z.preventDefault()},onDragleave:z=>{z.currentTarget===z.target&&(r(!1),O.classList.remove("is-dragging"))},onDrop:z=>{var we,T;t.drag===!1||b()||(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",b()),O.classList.toggle("is-form-mode",Z()),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",b()?"true":"false"),H.disabled=b(),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=()=>{v||(v=!0,S())},(_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 nl={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"]}},zo=t=>{const e=l(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},Po=(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":"."],y=[],R=[...t.rows||[]];if(r&&s==="top"&&!R.includes("nav")){const v=R.indexOf("body");R.splice(v>=0?v:R.length,0,"nav")}for(const v of R)v==="header"&&e.header?y.push(t.fullSide&&o&&n==="left"?["aside","header","header"]:t.fullSide&&o&&n==="right"?["header","header","aside"]:["header","header","header"]):v==="nav"&&r&&s==="top"?y.push(t.fullSide&&o&&n==="left"?["aside","nav","nav"]:t.fullSide&&o&&n==="right"?["nav","nav","aside"]:["nav","nav","nav"]):v==="body"?y.push(i):v==="footer"&&e.footer&&y.push(t.fullSide&&o&&n==="left"?["aside","footer","footer"]:t.fullSide&&o&&n==="right"?["footer","footer","aside"]:["footer","footer","footer"]);return y.length?y.map(v=>`"${v.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,C=()=>{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=C();for(const et of Pe)if(o(Ve,et))return Ve[et];return u(...Pe)},y=(...Pe)=>{const Ve=JSswift.uiResponsivePropsFor(e,pn(V()))||{};for(const et of Pe)if(o(Ve,et))return Ve[et];return u(...Pe)},R=()=>zo(y("disposition","layoutDisposition","layout")),v=()=>{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:""},b=(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},Z=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,Q=()=>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,S]=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:()=>Q()}),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",b((ct=l(i("drawerWidth")))!=null?ct:280,"280px")),_e.style.setProperty("--cms-layout-nav-width",b((ht=(gt=l(i("navWidth")))!=null?gt:l(i("asideRightWidth")))!=null?ht:280,"280px")),_e.style.setProperty("--cms-layout-drawer-peek",b((Ct=l(i("drawerPeek")))!=null?Ct:20,"20px")),_e.style.setProperty("--cms-layout-nav-peek",b((p=(yt=l(i("navPeek")))!=null?yt:l(i("asideRightPeek")))!=null?p:20,"20px"));const Pe=b(l(i("gap")),null);Pe!=null?_e.style.setProperty("--cms-layout-gap",Pe):_e.style.removeProperty("--cms-layout-gap");const Ve=b(l(i("headerOffset")),null);Ve!=null&&_e.style.setProperty("--layout-header-height",Ve);const et=b(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()&&S(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"?S: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||Q()),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?v():"";_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=nl[$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=Po(nl[$e],{header:Ee,aside:ne,nav:ve,main:Ye,footer:Ze});T.style.gridTemplateAreas=Z(y("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()&&!Q()||!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},C=(m,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(F=>C(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"]),S=_[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));S.replaceChildren(),Array.isArray(J)?J.forEach(j=>C(S,j)):C(S,J)},`UI.Footer:${m}`),[S]}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}),y=o("left")?e.left:e.start,R=o("right")?e.right:e.end,v=o("title")?e.title:e.label,b=(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,Z=[...u("left",y),...u("start",null)],G=u("icon",e.icon,i),ie=u("eyebrow",(f=e.eyebrow)!=null?f:e.kicker),D=u("title",v),$=u("subtitle",b),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 Q=ze(e.wrap,m=>m?"wrap":"nowrap");Q!=null&&(te.style.flexWrap=Q),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,...Z.length?[_.div({class:ae(["cms-footer-start",e.startClass])},...Z)]:[],...se.length?[_.div({class:"cms-footer-main"},...se)]:[]);return Ke(q,e),q};const di=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,S,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),C={props:e},u=o(["before"],e.before,C),i=o(["start","left"],(g=e.start)!=null?g:e.left,C),y=o(["center","body","content","default"],(a=(X=(F=e.center)!=null?F:e.body)!=null?X:e.content)!=null?a:n,C),R=o(["end","right","actions"],(h=(S=e.end)!=null?S:e.right)!=null?h:e.actions,C),v=o(["after"],e.after,C),b=o(["title"],e.title,C),P=o(["subtitle"],e.subtitle,C),Z=o(["meta"],e.meta,C),G=!!(u.length||i.length||R.length||v.length||b.length||P.length||Z.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",C,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":""}),Q={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=Z.length||b.length||P.length?_.div({class:ae(["cms-toolbar-copy",e.copyClass])},Z.length?_.div({class:ae(["cms-toolbar-meta",e.metaClass])},...Z):null,b.length?_.div({class:ae(["cms-toolbar-title",e.titleClass])},...b):null,P.length?_.div({class:ae(["cms-toolbar-subtitle",e.subtitleClass])},...P):null):null,L=!!(i.length||ue||y.length||R.length),f=[u.length?_.div({class:ae(["cms-toolbar-before",e.beforeClass]),style:{...Q}},...u):null,L?_.div({class:"cms-toolbar-main",style:q},i.length?_.div({class:ae(["cms-toolbar-start",e.startClass]),style:{...Q}},...i):null,ue||y.length?_.div({class:ae(["cms-toolbar-center",te]),style:{...Q,flex:"1 1 240px"}},ue,...y):null,R.length?_.div({class:ae(["cms-toolbar-end",e.endClass]),style:{...Q,justifyContent:"flex-end",marginInlineStart:M}},...R):null):null,v.length?_.div({class:ae(["cms-toolbar-after",e.afterClass]),style:{...Q}},...v):null].filter(Boolean),m=_.div(D,...f);return Ke(m,e),m};const Jo=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],C=(a={})=>{const S=e.itemProps||{},h={...S,...a};return h.class=ae([S.class,e.itemClass,a.class]),h.style={...S.style||{},...e.itemStyle||{},...a.style||{}},h},u=(a,S={})=>{if(a==null||a===!1)return[];if(Jo(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(C(a),...h)]}return Array.isArray(a)?[he.GridCol(C(S),...a)]:[he.GridCol(C(S),a)]},i=(a,S,h,J=!0)=>{if(a==null||a===!1)return[];const j=_n(a)?a:{};if(J){const U={item:a,index:S,count:h,first:S===0,last:S===h-1},ce=E(s,"item",U,null);if(ce.length)return ce.flatMap(k=>u(k,j))}return u(a,j)},y=[];r.forEach((a,S)=>{y.push(...i(a,S,r.length))}),E(s,"default",{items:r,count:r.length},n).forEach(a=>{y.push(...u(a))}),y.length||E(s,"empty",{items:r,count:0},e.empty).forEach(S=>{const h=u(S,{style:{gridColumn:"1 / -1"}});y.push(...h)});const v=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]),b=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]);b.class=v;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 Z=ze(e.gap,Be);Z!=null&&!We(e,"gap")&&(P["--cms-grid-gap"]=Z,P.gap=Z);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,S=>typeof S=="number"?`repeat(${S}, minmax(0, 1fr))`:String(S));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 S=String(a);return e.dense&&!S.includes("dense")?`${S} dense`:S});le!=null&&!We(e,"flow")&&(P.gridAutoFlow=le);const me=ze(e.areas,a=>Array.isArray(a)?a.map(S=>`"${Array.isArray(S)?S.join(" "):String(S)}"`).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 Q=ze(e.width,Be);Q!=null&&!We(e,"width")&&(P.width=Q),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&&(b.style=P),JSswift.uiApplyResponsiveProps(b,e,JSswift.uiResponsiveStyleRules);const f=_.div(b,...y);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)},C=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||{}},y=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)},v=o("span")?e.span:e.col,b=ze(v,y),P=ze(e.sm,y),Z=ze(e.md,y),G=ze(e.lg,y),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($,y),le=ze(Y,y),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),Q=ze(e.gap,C),q=ze(e.rowGap,C),ue=ze(e.columnGap,C),L=ze(e.padding,C),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),S=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":b!=null&&(i["--cms-grid-col-base"]=b),P!=null&&(i["--cms-grid-col-sm"]=P),Z!=null&&(i["--cms-grid-col-md"]=Z),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),Q!=null&&!We(e,"gap")&&(i.gap=Q),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),S!=null&&!We(e,"direction")&&(i.flexDirection=S),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,Ao);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],C=t[1],u=se=>se&&typeof se=="object"&&!se.nodeType&&!Array.isArray(se)&&!(se instanceof Function);typeof r=="string"?(s=r,o=!0,u(C)?(e=C,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||{},y=l(e.size),R=l(e.color),v=String(s).endsWith("-fill"),b={...e.style||{}},P=qe(e.size,()=>{const se=l(e.size);return typeof se=="string"&&kn[se]?se:""}),Z=!!(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",...Z?["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(b).length&&(Y.style=b),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}));v&&(M.style.fill="currentColor"),me=_.span({...Y,"data-icon":W},M,...n)}else me=_.span({...Y,"data-icon":W},W,...n);if(y!=null){let se=y;JSswift.uiSizes.includes(y)&&(se=`var(--cms-icon-size-${y})`),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]),C=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);C.class=r;const u={...e.style||{}};if(e.size){const G=l(e.size);typeof G=="string"&&kn[G]||(u.fontSize=Be(e.size))}C.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)},y=()=>{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:y()}):JSswift.ui.slot(D,{as:ie})},v=(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}),b=_.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}),Z=_.span(v(["left"],"left","left"),v(["centerLeft","center-left"],"centerLeft","center-left"),C,b,v(["topLeft","top-left"],"topLeft","top-left"),v(["topRight","top-right"],"topRight","top-right"),v(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),v(["bottomRight","bottom-right"],"bottomRight","bottom-right"),v(["centerRight","center-right"],"centerRight","center-right"),v(["right"],"right","right"),P);return(e.topLeft||e.centerLeft||e.bottomLeft)&&Z.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&Z.style.setProperty("padding-right","15px"),Ke(Z,e),Z};const Eo=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(""):""},sl=(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)},ll=(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)),To=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=sl(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=sl(t,e);return t===!0||n?_.span({class:ae(["cms-avatar-status",n?`cms-state-${n}`:""])}):ll(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 S;const a=l(e.size);return typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?`cms-size-${a}`:""}),r=qe([e.color,e.state],()=>{const a=l(e.color)||l(e.state)||"",S=mt(a);return S?`cms-state-${S}`:""}),C=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=C;const i={...e.style||{}},y=ze(e.size,a=>{var S;return typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?"":Be(a)},"");y!=null&&(i.width=y,i.height=y);const R=(g=e.fontSize)!=null?g:e.textSize,v=R!=null?ze(R,Be):ze(e.size,a=>{var S;return typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?"":`clamp(11px, calc(${Be(a)} * 0.34), 28px)`},"");v!=null&&(i.fontSize=v);const b=ze(e.radius,a=>{const S=no(a);return S==="xxxl"?"999px":S?`var(--cms-r-${S})`:typeof a=="number"?`${a}px`:String(a)});b!=null&&(i["--set-border-radius"]=b),u.style=i;const P={props:e},Z=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 S=(J=l(e.label))!=null?J:l(e.name);return typeof S=="string"?Eo(S):S}),D=ll(l((F=e.badge)!=null?F:e.notification)),$=To(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:Z,sizes:e.sizes,style:{}};e.srcset!=null&&(a.srcset=e.srcset),e.srcSet!=null&&(a.srcset=e.srcSet);const S=ze(e.fit);S!=null&&(a.style.objectFit=S),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),Q=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,$);!Q.length&&L.length&&(Q=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",Q),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]),C=JSswift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);C.class=r,C.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,y=JSswift.ui.renderSlot(s,"icon",{},u),R=JSswift.ui.renderSlot(s,"iconRight",{},i),v=E(s,"label",{},e.label),b=v.length?v:E(s,"default",{},n),P=E(null,"default",{},y),Z=E(null,"default",{},R),G=_.span(C,...P,...b.length?b:[""],...Z);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}`:""}),C=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,C,u.class]),i.style={...u.style||{}};const y=(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"}),v=y("eyebrow",e.eyebrow),b=y("label",(re=e.label)!=null?re:e.title),P=y("value",e.value),Z=y("note",(oe=e.note)!=null?oe:e.subtitle),G=y("meta",e.meta),ie=y("delta",e.delta,{trend:e.trend}),D=y("icon",R),$=y("aside",e.aside),Y=y("footer",e.footer),W=y("actions",e.actions),le=y("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"},v.length?_.div({class:"cms-stat-eyebrow"},...v):null,b.length?_.div({class:"cms-stat-label"},...b):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,Z.length?_.div({class:"cms-stat-note"},...Z):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}`:""}),C={...e},u=JSswift.omit(C,["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,C.class]),u.style={...C.style||{}};const i=(se,te,M={})=>E(s,se,M,te),y=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),v=i("title",(re=e.title)!=null?re:e.label),b=i("value",e.value),P=i("delta",e.delta,{trend:e.trend}),Z=i("note",(oe=e.note)!=null?oe:e.subtitle),G=i("meta",e.meta),ie=i("icon",y),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,v.length?_.div({class:"cms-kpi-title"},...v):null)),D.length?_.div({class:"cms-kpi-aside"},...D):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},b.length?_.div({class:"cms-kpi-value"},...b):null,P.length?_.div({class:"cms-kpi-delta"},...P):null),Z.length?_.div({class:"cms-kpi-note"},...Z):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 Ro=(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=Ro(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),C=l(e.items),u=Array.isArray(C)?C:C==null?[]:[C],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},y=$=>{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=>y(oe))}return y($)},v=[];u.forEach(($,Y)=>{v.push(...R($,Y,u.length))});const b=E(s,"default",{items:u,count:u.length},n);if(b.forEach(($,Y)=>{v.push(...R($,u.length+Y,u.length+b.length,!1))}),!v.length){const $=E(s,"empty",{items:u,count:0},e.empty);$.length&&($.length===1&&rs($[0])?v.push($[0]):v.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]),Z=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);Z.class=P,Z.style={...e.style||{}};const G=ze(e.gap,Be);return G!=null&&(Z.style["--cms-list-gap"]=G),r!=null&&r!==!1&&r!==!0&&r!=="none"&&(Z.style.listStyleType=String(r)),_[o?"ol":"ul"](Z,...v)},he.Item=(...t)=>{var L,f,m,g,F,X,a,S;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))),C=!!(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")),y=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),v=E(s,"meta",{},(g=e.meta)!=null?g:e.eyebrow),b=E(s,"body",{},(F=e.body)!=null?F:e.content),P=E(s,"default",{},n),Z=E(s,"actions",{},(X=e.actions)!=null?X:e.footer),G=(S=(a=e.aside)!=null?a:e.trailing)!=null?S:u(e.iconRight,e.iconSize||e.size,"iconRight"),ie=E(s,"aside",{},G),D=[...b,...P],$=!(C||e.clickable||e.to||i.length||y.length||R.length||v.length||Z.length||ie.length||b.length),Y=ae(["cms-item",fe(e.divider,"divider"),fe(C,"cms-clear-set"),fe(C,"cms-singularity"),fe(C,"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=y.length?_.div({class:"cms-item-title"},...y):null,te=R.length?_.div({class:"cms-item-subtitle"},...R):null,M=v.length?_.div({class:"cms-item-meta"},...v):null,Q=D.length?_.div({class:ae(["cms-item-body",fe(!(y.length||R.length||v.length),"is-standalone")])},...D):null,q=Z.length?_.div({class:"cms-item-actions"},...Z):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,Q,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),C=l(e.vertical);if(r!=null){const u=Be(r);C?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)},C=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":""),y=qe(e.stack,()=>l(e.stack)?"cms-banner-stack":""),R={...e},v=JSswift.omit(R,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);v.class=ae(["cms-clear-set","cms-banner","cms-singularity",C,u,i,y,R.class]),v.style={...R.style||{}};const b=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))&&(v.style["--cms-banner-accent"]=()=>b(e.accent),v.style["--cms-banner-border"]=()=>{const L=b(e.accent);return L?`color-mix(in srgb, ${L} 38%, var(--cms-border-color))`:""},v.style["--cms-banner-bg"]=()=>{const L=b(e.accent);return L?`color-mix(in srgb, ${L} 14%, var(--cms-panel))`:""},v.style["--cms-banner-color"]=()=>{const L=b(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"},Z=(()=>{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,Z),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,Q=[...le,...oe?[]:me,...re.length?re:M?[M]:[]];te=_.div(v,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),Q.length?_.div({class:"cms-banner-side"},...Q):null);const q=v.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}`:""}),C={...e},u=JSswift.omit(C,["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"),C.class]),u.style={...C.style||{}};const i={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},y=(()=>{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),v=E(s,"message",{},e.message!=null?e.message:n),b=E(s,"description",{},(W=e.description)!=null?W:e.subtitle),P=E(s,"meta",{},e.meta),Z=E(s,"actions",{},e.actions),G=E(s,"aside",{},e.aside),ie=E(s,"icon",{},y),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,v.length?_.div({class:"cms-alert-message"},...v):null,b.length?_.div({class:"cms-alert-description"},...b):null,P.length?_.div({class:"cms-alert-meta"},...P):null,Z.length?_.div({class:"cms-alert-actions"},...Z):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}`:""}),C={...e},u=JSswift.omit(C,["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"),C.class]),u.style={...C.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"}),y=E(s,"illustration",{},(Y=e.illustration)!=null?Y:e.media),R=E(s,"icon",{},i),v=E(s,"eyebrow",{},e.eyebrow),b=E(s,"title",{},e.title),P=E(s,"message",{},e.message!=null?e.message:n),Z=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,y.length?_.div({class:"cms-empty-state-illustration"},...y):null,R.length?_.div({class:"cms-empty-state-icon"},...R):null,v.length?_.div({class:"cms-empty-state-eyebrow"},...v):null,b.length?_.div({class:"cms-empty-state-title"},...b):null,P.length?_.div({class:"cms-empty-state-message"},...P):null,Z.length?_.div({class:"cms-empty-state-description"},...Z):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 ol=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}},Mo=(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 ol.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(Et);return}const{el:o,openIcon:r,closeIcon:C}=s;o&&(o.textContent=Et?r:C)}),Mo(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,C=null,u=null;const i=L=>Object.prototype.hasOwnProperty.call(e,L),y=i("target")||i("anchorEl")||i("triggerEl"),R=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),v=(L,f)=>{const m=l(L);if(m==null||m==="")return f;const g=Number(m);return Number.isFinite(g)?g:f},b=()=>{clearTimeout(r),clearTimeout(C),r=null,C=null},P=()=>v(e.delay,350),Z=()=>v(e.hideDelay,l(e.interactive)?120:0),G=()=>{if(b(),!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&&(y?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 S=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,S)):S,J=F.length?_.div({class:"cms-tooltip-footer"},...F):null;return _.div({class:"cms-tooltip-content"},...[h,J].filter(Boolean))},re=L=>{var a,S,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=(S=e.closeOnEsc)!=null?S: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(C),C=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(C),C=null,clearTimeout(r),r=setTimeout(()=>re(L),P())},se=(L=!1)=>{if(clearTimeout(r),r=null,!!o){if(clearTimeout(C),L){G();return}C=setTimeout(()=>G(),Z())}},te=L=>{o?se(!0):re(L)},M=()=>!!o,Q=L=>{if(!L)return()=>{};u=L;const f=[],m=()=>{b(),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 Q(g),g._tooltip={bind:Q,open:re,show:oe,hide:se,close:G,toggle:te,isOpen:M},g}return{bind:Q,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||{},C=t==="radio",u=n.appearance==="toggle",i=!C,y=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),R=Nt(s.model,n.modelName||(C?"UI.Radio:model":"UI.Checkbox:model")),v=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"]);v.type=t,v.id=y,C&&s.name!=null&&(v.name=s.name),v.class=ae([`cms-${t}`,"cms-choice-input",s.inputClass]);const b=_.input(v),P=E(r,"label",{},s.label),Z=P.length?P:E(r,"default",{},o),G=fs(s,{className:"cms-shortcode cms-choice-shortcode"}),ie=G?[...Z,G]:Z,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&&C,"cms-toggle-radio-wrap"),fe(u&&!C,"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",C?"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,b,Y,le);Ke(me,s);const re=s.iconSize?s.iconSize:s.size,oe=u?null:C?"radio_button_checked":"check",se=u?null:C?"radio_button_unchecked":null,te=u||C?null:"indeterminate_check_box",M=f=>{if(C)return b.checked=f==s.value,b.checked;const m=f==null?null:!!f;return b.checked=m===!0,b.indeterminate=i&&m==null,m},Q=()=>!C&&i&&b.indeterminate?null:!!b.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=Q(),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",!!b.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):b.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:y,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()},C?"UI.Radio:watch":"UI.Checkbox:watch"),b.addEventListener("change",f=>{var m,g;if(C)b.checked&&(R.set(s.value),(m=s.onChange)==null||m.call(s,s.value,f));else{const F=Q();R.set(F),(g=s.onChange)==null||g.call(s,F,f)}ue()})):(M(C?s.checked===!0?s.value:void 0:s.checked),b.addEventListener("change",f=>{var m,g;C?(m=s.onChange)==null||m.call(s,s.value,f):(g=s.onChange)==null||g.call(s,Q(),f),ue()})),s.onInput&&b.addEventListener("input",f=>{var m,g;C?(m=s.onInput)==null||m.call(s,s.value,f):(g=s.onInput)==null||g.call(s,Q(),f)}),ue(),an(me,s,{isEnabled:()=>!b.disabled,action:()=>{if(b.disabled)return!1;hn(b),b.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"),C=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"]);C.type="range",C.class=ae(["cms-slider-input",e.inputClass]);const u=_.input(C),i={...e.style||{}},y=l(e.size);if(y!=null){const O=typeof y=="string"&&((H=JSswift.uiSizes)!=null&&H.includes(y))?`var(--cms-size-${y})`:Be(y);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 v=_.div({class:"cms-slider-header"}),b=_.span({class:"cms-slider-label"}),P=_.span({class:"cms-slider-value"});v.append(b,P);const Z=_.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),Z.append(G,ie,D,se,te),R.append(v,Z);const M=O=>{for(;O.firstChild;)O.removeChild(O.firstChild)},Q=(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))},S=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=S(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)),Q(b,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):[];Q(P,ee,"inline-flex"),v.style.display=b.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);Q(G,ke,"inline-flex");const Ne=E(s,"iconRight",O,null),ee=Ne.length?Ne:L(e.iconRight,"iconRight",O);Q(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);Q(ie,E(s,"startLabel",O,xe),"inline-flex"),Q(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;Q(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);Q(re,ee,"inline-flex")},I=()=>{const O=a(h()),K=m(),ke=g(),Ne=F(),xe=`${S(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"),C=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=C,e.name!=null&&(u.name=e.name),u.class=ae(["cms-rating-input","cms-choice-input",e.inputClass]);const i=_.input(u),y=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"]);y.class=ae(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",fe(e.dense,"dense"),e.class]),y.style={...e.style||{}};const R=l(e.size);R!=null&&!(typeof R=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(R)))&&(y.style["--cms-rating-size"]=Be(R));const v=l(e.gap);v!=null&&(y.style["--cms-rating-gap"]=Be(v));const b=_.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(),S(ce,J,{emit:!0})}}),P=_.span({class:"cms-choice-label cms-rating-label"}),Z=_.label(y,i,b,P);Ke(Z,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():Q),M=J=>{const j=J>0?String(J):"";i.value=j,i.setAttribute("value",j),i.disabled=re()};let Q=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(b);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),S(d,k,{emit:!0})}},U);L.push({item:ce,iconHost:U,index:j}),b.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);Z.classList.toggle("is-disabled",ce),Z.classList.toggle("is-readonly",k),Z.classList.toggle("is-hovering",q!=null),Z.classList.toggle("is-clearable",d),Z.classList.toggle("is-half",le()),Z.classList.toggle("no-dimming",N);const I=Number((Se=l((ge=e.tabindex)!=null?ge:e.tabIndex))!=null?Se:0);b.tabIndex=ce?-1:I,b.setAttribute("role","slider"),b.setAttribute("aria-valuemin","0"),b.setAttribute("aria-valuemax",String(J)),b.setAttribute("aria-valuenow",String(j)),b.setAttribute("aria-disabled",ce?"true":"false"),b.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=>S(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")})},S=(J,j,U={})=>{var d,N;const ce=me(J),k=te();return Q=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 Z._input=i,Z._rating=b,Z._getValue=te,Z._setValue=J=>S(J,null,{emit:!1}),r&&r.watch(J=>{const j=me(J);serializeValue(j)!==serializeValue(Q)&&(Q=j,q=null,M(Q),a())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!r&&e.value!=null&&(Q=me(l(e.value))),a()},"UI.Rating:render"),Z};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,y,R,v,b,P,Z,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=(y=(i=t.hour)!=null?i:t.hours)!=null?y:t.h)!=null?R:t.hh),s=Number((Z=(P=(b=(v=t.minute)!=null?v:t.minutes)!=null?b:t.min)!=null?P:t.mm)!=null?Z: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 C={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(o)};return il(C,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 il(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",C=n.hour%12||12;return`${Ut(C)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""} ${r}`},Fo=(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},al=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:o=!1,minuteStep:r=5,secondStep:C=5,disabled:u=!1,readonly:i=!1,embedded:y=!1,className:R="",slotPrefix:v="",shortcuts:b=null,onSelect:P=null}=t,Z=$t(s,{withSeconds:o,min:e.min,max:e.max}),G=Z||$t(new Date,{withSeconds:o,min:e.min,max:e.max})||{hour:0,minute:0,second:0},ie=Z?it(Z):null,D=se=>v?`${v}${se[0].toUpperCase()}${se.slice(1)}`:null,$=(se,te,M)=>{const Q=[D(se),se].filter(Boolean);for(const q of Q){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:y?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(y,"is-embedded"),fe(o,"has-seconds"),R])}),me=l(b)||[];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 Q=typeof te.value=="function"?te.value({now:Xt(new Date,{withSeconds:o})}):te.value,q=$t(Q,{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 Q=_.div({class:"cms-time-column","data-time-part":te}),q=_.div({class:"cms-time-options"});return M.forEach(ue=>{var S;const L=W(te,ue),f=il(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:(S=e.use12h)!=null?S: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))}),Q.appendChild(q),Q};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(C,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},rl=(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,C)=>{const u=r.getAttribute("data-time-part")||String(C),i=n&&Number.isFinite(n[u])?n[u]:null;i!=null&&(r.scrollTop=i);const y=r.querySelector(".cms-time-option.is-selected");if(!y)return;const R=Math.max(0,r.scrollHeight-r.clientHeight),v=y.offsetTop-(r.clientHeight-y.offsetHeight)/2,b=Math.max(0,Math.min(R,v));if(Math.abs(r.scrollTop-b)<1){r.scrollTop=b;return}if(s&&typeof r.scrollTo=="function"){r.scrollTo({top:b,behavior:s});return}r.scrollTop=b})},cl=(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||{},C=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",y=n.model||(At(n.value)||Jt(n.value)?n.value:null),R=Nt(y,o?"UI.Calendar:model":"UI.Datepicker:model"),v=R?R.get():l(n.value),b=l((Pe=n.rangeAs)!=null?Pe:n.rangeModel)==="array"||Array.isArray(v),P=l((Ve=n.rangeMultipleAs)!=null?Ve:n.multipleRangeAs)==="array"||Array.isArray(v)&&Array.isArray(v[0]),Z=()=>{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:v,{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,Q=(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 b?[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)},S=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=S(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"?S(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(Q(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(!Z())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(!Z())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"&&Z()?Fo(p||null,ne,G()):F(p),Ce=(p=Ie,ne=z)=>JSON.stringify(be(p,ne)),pe=p=>jn(p,G());let Ie=j(v),_e=g(Ie),z=ee(v,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",C,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=Z()?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),Z()&&(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(!Z())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)),Z()&&(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:Z(),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&&lt()&&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&&lt()&&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:Z(),timeValue:xe()})},rt=(p={})=>{rl(A,p)},Vt=()=>{if(!Z())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 Cl,xl,kl,_l,Nl,Ll,Al,Il,zl,Pl,Jl,El,Tl,Rl,Ml,Fl,Ol,Dl,$l;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 Vl=_.div({class:"cms-date-weekdays"});Re.forEach(Mn=>Vl.appendChild(_.div({class:"cms-date-weekday"},Mn))),es.appendChild(Vl);const Bl=_.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),Hl=ks.getMonth()===Tn,jl=ut(Pt),Wl=dt(Pt),Ul=(i==="range"||i==="range-multiple")&&nt().some(It=>te(It==null?void 0:It.from,Pt)),Gl=(i==="range"||i==="range-multiple")&&nt().some(It=>te(It==null?void 0:It.to,Pt)),_s=!ye(Pt),Ns={...ge(Pt),selected:jl,inRange:Wl,rangeStart:Ul,rangeEnd:Gl,disabled:_s,outside:!Hl,value:Fe,select:()=>ft(Pt,null,{visibleMonthOffset:st})},Ls=Oe(Ns),oi=JSswift.ui.renderSlot(r,"day",Ns,String(ks.getDate())),ii=E(null,"default",Ns,oi),ai=_.button({type:"button",class:ae(["cms-date-day",fe(!Hl,"is-outside"),fe(jl,"is-selected"),fe(Wl,"is-in-range"),fe(Ul,"is-range-start"),fe(Gl,"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"},...ii),Ls.length?_.span({class:"cms-date-day-point"},...Ls):null);Bl.appendChild(ai)}return es.appendChild(Bl),es},Xe=U(),ot=ce(),pt=[w.getFullYear(),(Cl=le(se()))==null?void 0:Cl.getFullYear(),(xl=le(Xe))==null?void 0:xl.getFullYear(),(kl=le(ot))==null?void 0:kl.getFullYear(),(_l=le(l(n.defaultMonth)))==null?void 0:_l.getFullYear()];i==="range"?pt.push((Nl=le(Fe==null?void 0:Fe.from))==null?void 0:Nl.getFullYear(),(Ll=le(Fe==null?void 0:Fe.to))==null?void 0:Ll.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((Al=le(Fe))==null?void 0:Al.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((Pl=(zl=n.yearStart)!=null?zl:Xe?(Il=le(Xe))==null?void 0:Il.getFullYear():null)!=null?Pl:Bt)),sn=Number(l((Tl=(El=n.yearEnd)!=null?El:ot?(Jl=le(ot))==null?void 0:Jl.getFullYear():null)!=null?Tl: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((Rl=n.shortcuts)!=null?Rl: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:Z(),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"}),Zo=_.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(Zo);const ei=Z()?al({props:{min:l((Ml=n.timeMin)!=null?Ml:n.minTime),max:l((Fl=n.timeMax)!=null?Fl:n.maxTime),use12h:l((Dl=(Ol=n.time12h)!=null?Ol:n.use12h)!=null?Dl: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(($l=n.timeShortcuts)!=null?$l:n.timePresets),onSelect:Ge=>{const st=Wn(A);Te(Ge,null),rt({scrollState:st})}}):null,ti=_.div({class:"cms-date-footer-info"},Cn),ni=_.div({class:ae(["cms-date-footer",fe(Z(),"has-time")])},ti,_.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)),si=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:Vt},l(n.nowLabel)||"Ora")),li=Z()?_.div({class:"cms-date-time"},En,ei,si):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,li),ni))};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(C),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(Z(),"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(C),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)):Z()&&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)=>cl(t),he.Calendar=(...t)=>cl(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,S;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(y?y.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)}},C=()=>{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),y=Nt(i,"UI.Time:model"),R=y?y.get():l(e.value),v=h=>Tt(h,r()),b=h=>jn(h,r()),P=h=>Xt(h,r()),Z=h=>JSON.stringify(P(h));let G=it(v(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:b(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:(S=e.iconRight)!=null?S:"schedule",control:re,getValue:()=>le.value,onClear:()=>{l(e.disabled)||l(e.readonly)||(Q(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=b(G),te(),(h=oe._refresh)==null||h.call(oe)},Q=(h,J,j={})=>{var d,N;const U=it(v(h));if(l(e.confirm)&&j.commit!==!0)return ie=it(U),m(),U;const ce=Z(G);G=it(U),ie=it(U),M(),m(),y&&j.fromModel!==!0&&y.set(P(U));const k=Z(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={})=>{rl($,h)},L=()=>{const h=Wn($);Q(new Date,null,{commit:!l(e.confirm)}),ue({scrollState:h}),!l(e.confirm)&&e.closeOnSelect===!0&&F()},f=()=>{l(e.confirm)&&(Q(ie,null,{commit:!0}),e.closeOnSelect!==!1&&F())},m=()=>{var N,I,H,ge;if(!$)return;const h=se(),J=b(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=al({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:C(),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($);Q(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:()=>Q(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(),Q(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=>Q(le.value,h)),le.addEventListener("blur",h=>{var J;(J=e.onBlur)==null||J.call(e,h),le.value===""?Q(null,h):Q(le.value,h)})):le.addEventListener("blur",h=>{var J;return(J=e.onBlur)==null?void 0:J.call(e,h)}),y&&y.watch(h=>{const J=it(v(h));Z(J)!==Z(G)&&(G=it(J),ie=it(J),M(),m())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!y&&e.value!=null&&(G=it(v(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=>Q(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",C=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,y=Nt(e.model,"UI.Tabs:model"),R=r(e.orientation||e.orient||e.direction),v=C(e.variant||(e.pills?"pills":e.soft?"soft":"line")),b=!!l((I=(N=e.fill)!=null?N:e.navFill)!=null?I:e.stretch),P=!!l(e.wrap),Z=!!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(y?y.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-${v}`,fe(e.dense,"dense"),fe(b,"fill"),fe(P,"wrap"),fe(Z,"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 Q=_.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:v,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);Q.dataset.value=V==null?"":String(V),Q.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||Z)),K.classList.toggle("active",xe),K.setAttribute("aria-selected",xe?"true":"false"),K.setAttribute("tabindex",xe?"0":"-1")})},S=V=>{oe(V),a(V)},h=(V,O={})=>{if(Z)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||Z)return null;const ke=K.value,Ne=re(),ee=!i(Ne,ke);return S(ke),y&&!i(y.get(),ke)&&y.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||Z)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||Z,"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||Z,"disabled"),e.tabClass,V.tabClass||V.class]),type:"button",id:Ne,role:"tab",disabled:!!(V.disabled||Z),"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)),Q.appendChild(q),S(me),y?y.watch(V=>{S(le(V,!0))},"UI.Tabs:watch"):at(e.value)&&He.reactive.effect(()=>{S(le(l(e.value),!0))},"UI.Tabs:value"),Q._getValue=()=>re(),Q._setValue=V=>h(V,{emit:!0}),Q._select=V=>h(V,{emit:!0}),Q._next=()=>j(),Q._prev=()=>U(),Q._getTabs=()=>D.slice(),Ke(Q,e),Q},he.RouteTab=(...t)=>{var X,a,S,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),C=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)},y=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,v=()=>{var ye;return l((ye=e.href)!=null?ye:e.to)||"#"},b=()=>{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||""},Z=()=>{var ee,xe,be;const ye=b();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:v(),router:o,props:e});if(V instanceof RegExp)return V.test(K);const ke=y(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:C?!!l((ye=e.active)!=null?ye:e.selected):Z()},$=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=v(),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=(S=e.iconSize)!=null?S: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:v(),to:b(),external:R(v()),navigate:ye=>{var K,ke;if(G())return!1;const V=b();return!R(v())&&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||v(),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),Q=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:[b()||v()||""]),Q.length?_.span({class:"cms-route-tab-note"},...Q):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=v(),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")),b()?m.dataset.to=String(b()):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)}},!C&&b()&&(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"),C=qe(e.size,()=>{var Q;const M=l(e.size);return typeof M=="string"&&((Q=JSswift.uiSizes)!=null&&Q.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":""),y=_.nav({class:ae(["cms-breadcrumbs","cms-clear-set",C,u,i,fe(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),R=_.div({class:"cms-breadcrumbs-before"}),v=_.ol({class:"cms-breadcrumbs-list"}),b=_.div({class:"cms-breadcrumbs-after"});y.appendChild(R),y.appendChild(v),y.appendChild(b);const P=M=>{var q;const Q=l(M);return Q==null||Q===""?null:(q=JSswift.uiColors)!=null&&q.includes(Q)?`var(--cms-${Q})`:String(Q)},Z=M=>{var q;if(!M)return!1;if(l(M.external)===!0)return!0;const Q=l((q=M.href)!=null?q:M.to);return Q?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Q)):!1},G=M=>M!=null&&M.nodeType&&M.cloneNode?M.cloneNode(!0):M,ie=(M,Q)=>{M.innerHTML="",Q.forEach(q=>M.appendChild(q))},D=(M,Q,q,ue,L=null)=>{const f=JSswift.ui.getSlot(M,Q)!=null?E(M,Q,q,ue):[];return f.length?f:L&&JSswift.ui.getSlot(M,L)!=null?E(M,L,q,ue):E(null,"default",q,ue)},$=(M,Q,q)=>{const ue=l(M);return ue==null||ue===!1||ue===""?null:typeof ue=="string"?he.Icon({name:ue,size:Q}):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),Q=[],q=m=>{if(!(m==null||m===!1)){if(Array.isArray(m)){m.forEach(q);return}if(typeof m=="string"||typeof m=="number"){Q.push({label:String(m)});return}if(m!=null&&m.nodeType||typeof m=="function"){Q.push({label:m});return}Q.push(m)}},ue=l(e.home);return ue&&q(ue===!0?{label:"Home",to:"/",icon:"home"}:ue),q(M),!Q.length&&(n!=null&&n.length)&&n.forEach(m=>q(m)),Q.filter(m=>!l(m==null?void 0:m.hidden))},W=M=>{const Q=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 Q>-1?Q:l(e.autoCurrent)===!1?-1:M.length?M.length-1:-1},le=M=>{var g,F,X,a,S,h,J;const Q=Number(l((X=(F=(g=e.max)!=null?g:e.maxItems)!=null?F:e.collapseAfter)!=null?X:e.collapse)),q=Number.isFinite(Q)?Math.max(0,Math.trunc(Q)):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((S=(a=e.leadingCount)!=null?a:e.keepStart)!=null?S: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,Q=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!Z(M)&&ue&&(o!=null&&o.navigate)?(Q!=null&&Q.preventDefault&&Q.preventDefault(),o.navigate(ue),(f=M.onNavigate)==null||f.call(M,ue,Q||null),(m=e.onNavigate)==null||m.call(e,ue,M,Q||null),!0):((g=M.onNavigate)==null||g.call(M,ue||q,Q||null),(F=e.onNavigate)==null||F.call(e,ue||q,M,Q||null),!1)},re=(M,Q,q)=>{var F,X,a;const ue=M,L=q[Q+1]||null,f={index:Q,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,Q,q)=>{const ue={type:"collapsed",collapsed:!0,items:Q,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,Q,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),S=!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:Q.length,current:F,active:F,disabled:g,href:m,to:l(L.to)||"",external:Z(L),isFirst:M.index===0,isLast:M.index===Q.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"),S?`cms-state-${S}`:"",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(),Q=W(M),q=le(M),ue=P((f=e.color)!=null?f:e.state);y.classList.toggle("is-empty",M.length===0),ue?y.style.setProperty("--cms-breadcrumb-accent",ue):y.style.removeProperty("--cms-breadcrumb-accent");const L={items:M,visibleItems:q,currentIndex:Q,count:M.length,collapsed:q.some(m=>m.type==="collapsed")};if(ie(R,D(s,"before",L,e.before)),ie(b,D(s,"after",L,e.after)),v.innerHTML="",!M.length){const m=D(s,"empty",L,e.empty);m.length&&v.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...m));return}q.forEach((m,g)=>{g>0&&v.appendChild(re(q[g-1],g-1,q)),v.appendChild(m.type==="collapsed"?oe(m,M,Q):se(m,M,Q,g))})};return He.reactive.effect(()=>{te()},"UI.Breadcrumbs:render"),y.getItems=()=>Y(),y.getVisibleItems=()=>le(Y()),y.refresh=()=>(te(),y),y.setItems=M=>(r?r.set(M):e.items=M,te(),y),Ke(y,e),y},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"}),C=_.div({class:"cms-pagination-controls"}),u=_.div({class:"cms-pagination-start"}),i=_.div({class:"cms-pagination-pages"}),y=_.div({class:"cms-pagination-end"}),R=_.div({class:"cms-pagination-summary"});C.appendChild(u),C.appendChild(i),C.appendChild(y),r.appendChild(C),r.appendChild(R);let v=1,b=1;const P=(a,S=0)=>{const h=l(a);if(h==null||h==="")return S;const J=Number(h);return Number.isFinite(J)?Math.trunc(J):S},Z=(a,S=G())=>{const h=Number(a),J=Number.isFinite(h)?Math.trunc(h):1;return Math.min(Math.max(J||1,1),Math.max(1,S||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 S=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 S>=0&&h>0?Math.max(1,Math.ceil(S/h)):1},ie=()=>{var a,S,h;return P(s?s.get():(h=(S=(a=e.page)!=null?a:e.value)!=null?S:e.current)!=null?h:e.currentPage,1)},D=()=>{var a,S;return Math.max(0,P((S=(a=e.siblings)!=null?a:e.siblingCount)!=null?S:e.window,1))},$=()=>{var a,S;return Math.max(0,P((S=(a=e.boundaryCount)!=null?a:e.boundaries)!=null?S: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),Q=()=>{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 S=Number(a);return Number.isFinite(S)?Math.max(0,Math.trunc(S)):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 S=Number(a);return Number.isFinite(S)&&S>0?Math.trunc(S):null},ue=(a=v,S=b)=>{const h=Q(),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:S,max:S,total:h,pageSize:J,from:j,to:U,disabled:Y(),isFirst:a<=1,isLast:a>=S,canPrev:a>1,canNext:a<S,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(S,ce)}},L=(a,S)=>{if(S<=0)return[];const h=[],J=new Set,j=$(),U=D();for(let k=1;k<=Math.min(j,S);k++)J.add(k);for(let k=Math.max(1,a-U);k<=Math.min(S,a+U);k++)J.add(k);for(let k=Math.max(1,S-j+1);k<=S;k++)J.add(k);let ce=0;for(let k=1;k<=S;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,S,h,J=null)=>{const j=JSswift.ui.getSlot(n,a)!=null?E(n,a,h,S):[];return j.length?j:J&&JSswift.ui.getSlot(n,J)!=null?E(n,J,h,S):E(null,"default",h,S)},m=(a,S)=>{a.innerHTML="",S.forEach(h=>a.appendChild(h))},g=(a,S,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,S,j,a==="summary"?"label":a==="page"?"item":null))},F=(a,S)=>{v=Z(a,S),b=Math.max(1,S||1);const h=ue(v,b);r.style.display=M()&&b<=1?"none":"",R.style.display=W()?"":"none",i.style.display=le()?"":"none",u.innerHTML="",i.innerHTML="",y.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:v<=1})),me()&&u.appendChild(g("prev","Prev",ce=>X(v-1,ce),{disabled:v<=1})),le()&&L(v,b).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===v};i.appendChild(he.Btn({class:ae(["cms-pagination-btn","cms-pagination-page-btn",fe(k===v,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:k===v?e.color||e.state||"primary":null,outline:k!==v,disabled:Y(),"aria-current":k===v?"page":null,onClick:N=>X(k,N)},...f("page",String(k),d,"item")))}),re()&&y.appendChild(g("next","Next",ce=>X(v+1,ce),{disabled:v>=b})),te()&&y.appendChild(g("last","\xBB",ce=>X(b,ce),{disabled:v>=b}));const j=f("end",e.end,h);j.length&&y.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...j));let U=`Pagina ${v} di ${b}`;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,S=null)=>{var j,U;const h=G(),J=Z(a,h);return J===v&&h===b||(F(J,h),s&&s.get()!==J&&s.set(J),(j=e.onChange)==null||j.call(e,J,ue(J,h),S),(U=e.onPageChange)==null||U.call(e,J,ue(J,h),S)),J};return He.reactive.effect(()=>{const a=G(),S=ie(),h=Z(S,a);F(h,a),s&&S!==h&&s.set(h)},"UI.Pagination:sync"),r.getPage=()=>v,r.getPages=()=>b,r.setPage=a=>X(a),r.prev=()=>X(v-1),r.next=()=>X(v+1),r.first=()=>X(1),r.last=()=>X(b),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:""},C=qe(e.state,()=>{const W=mt(l(e.state));return W?`cms-state-${W}`:""}),u=ae(["cms-spinner",C,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 y={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(y,"backgroundColor")&&delete y.backgroundColor,i.style=y,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},v=E(s,"label",R,e.label),b=E(s,"default",R,n),P=E(s,"note",R,e.note),Z=v.length||b.length||P.length;if(!Z){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),Z&&D.push(_.div({class:"cms-spinner-content"},v.length?_.div({class:"cms-spinner-label"},...v):null,b.length?_.div({class:"cms-spinner-copy"},...b):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"),C=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),y=()=>{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"},v=(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)},b=ee=>{const xe=i(),be=y(),Ce=u(ee,xe);return Math.min(be,Math.max(xe,Ce))},P=ee=>{const xe=i(),Ce=y()-xe;if(!Ce)return 0;const pe=(b(ee)-xe)/Ce,Ie=l(e.reverse)?1-pe:pe;return Math.max(0,Math.min(1,Ie))},Z=ee=>{const xe=b(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(b(r?r.get():(H=(I=l(e.value))!=null?I:l(e.min))!=null?H:0)),[re,oe]=JSswift.reactive.signal(Z((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=b(ee);return le()!==be&&me(be),re()<be&&oe(be),r&&xe.fromModel!==!0&&r.set(be),be},te=ee=>{const xe=Z(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"]),Q={width:l(e.width)||"100%",...e.style||{}},q=l(e.color);(q!=null||at(e.color))&&!mt(q||"")&&delete Q.backgroundColor,M.class=ae(["cms-progress-wrap",fe(e.dense,"dense"),fe(e.reverse,"is-reverse"),fe(e.indeterminate,"is-indeterminate"),C,e.class]),M.style=Q;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"}),S=_.span({class:"cms-progress-buffer"}),h=_.span({class:ae(["cms-progress-bar","cms-singularity",C,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(S,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:y(),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:y(),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:y(),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=y(),pe=P(ee)*100,Ie=P(xe)*100,_e=v(e.color,""),z=v(e.trackColor,_e?`color-mix(in srgb, ${_e} 14%, transparent)`:"rgba(255,255,255,0.08)"),we=v(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,S.style.background=we,S.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=S,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),C=()=>{const I=r(),H=o(l(n.max),100);return H<I?I:H},u=I=>{const H=r(),ge=C(),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),y=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),v=Nt(R,"UI.LoadingBar:model"),b=At(n.buffer)||Jt(n.buffer)?n.buffer:null,P=Nt(b,"UI.LoadingBar:buffer"),Z=v?v.get():(d=l(n.value))!=null?d:r(),G=P?P.get():(N=l(n.buffer))!=null?N:Z,[ie,D]=JSswift.reactive.signal(u(Z)),[$,Y]=JSswift.reactive.signal(Math.max(u(G),u(Z))),[W,le]=JSswift.reactive.signal(n.visible!=null?!!l(n.visible):u(Z)>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)),v&&H.fromExternal!==!0&&v.set(ge),ge},Q=(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=Q(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},S=(I=(H=>(H=l(n.startValue))!=null?H:12)())=>{se();const ge=Math.max(ie(),u(I));return M(ge),Q(Math.max($(),ge)),q(ge),ue(),m},h=(I=(H=>(H=l(n.resetValue))!=null?H:r())())=>{se(),oe();const ge=u(I);return Q(ge),M(ge),q(ge),m},J=(I=(H=>(H=l(n.doneValue))!=null?H:C())())=>{var ye;se(),oe();const ge=u(I);Q(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=S,m.done=J,m.complete=J,m.stop=j,m.reset=h,m.show=U,m.hide=ce,m.destroy=k,m._dispose=k,v?v.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=>{Q(I,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):at(n.buffer)&&JSswift.reactive.effect(()=>{Q(l(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const I=r(),H=C(),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&&y(n.target).appendChild(m),l(n.autoStart)&&S(),m};const ul=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),Oo=new Set(["soft","solid","outline"]),Do={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},$o={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},dl=t=>{const e=String(l(t)||"").trim().toLowerCase();return e?ul.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"},Vo=t=>{const e=String(l(t)||"").trim().toLowerCase();return Oo.has(e)?e:"soft"},Bo=(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,y,R,v,b,P,Z,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=Bo((i=(u=n.timeout)!=null?u:n.duration)!=null?i:n.delay,s),r=(v=(R=(y=n.closable)!=null?y:n.dismissible)!=null?R:n.dismiss!=null)!=null?v:o===0,C=n.title===void 0?n.label===void 0?Do[s]:n.label:n.title;return{...n,type:s,state:s,title:C,message:(Z=(P=(b=n.message)!=null?b:n.content)!=null?P:n.text)!=null?Z: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:dl(n.position),variant:Vo(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},fl=(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),y={...u};return!y.type&&!y.state&&!y.color&&e&&(y.type=e),y.title==null&&n&&(y.title=n),i.length&&(y.message==null&&y.description==null&&y.body==null&&i.length===1?y.message=i[0]:y.body==null&&(y.body=i.length===1?i[0]:i)),Gt(y,e)}const[s,o,r]=t;let C={};return ln(o)?C={...o,message:s}:ln(r)?C={...r,message:s,title:o}:C={message:s,title:o},e&&!C.type&&!C.state&&!C.color&&(C.type=e),C.title==null&&n&&(C.title=n),Gt(C,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,fl(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,fl(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,C,u,i,y,R,v,b,P,Z,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=(C=He.services.notify)==null?void 0:C.update)==null||u.call(C,s,Gt(W,"success")):(y=(i=He.services.notify)==null?void 0:i.show)==null||y.call(i,Gt(W,"success")):s!=null&&((v=(R=He.services.notify)==null?void 0:R.remove)==null||v.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=(b=He.services.notify)==null?void 0:b.update)==null||P.call(b,s,Gt(Y,"danger")):(G=(Z=He.services.notify)==null?void 0:Z.show)==null||G.call(Z,Gt(Y,"danger")):s!=null&&((D=(ie=He.services.notify)==null?void 0:ie.remove)==null||D.call(ie,s)),$}},he.Header=(...t)=>{var S,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),C=(S=e.drawerStateKey)!=null?S:qt;C&&(qt=C,Et=en(C));const u=()=>en(C),i=()=>Wt(!0,C),y=()=>Wt(!1,C),R=()=>Wt(!u(),C),v={props:e,stateKey:C,isDrawerOpen:u,openDrawer:i,closeDrawer:y,toggleDrawer:R,toggleAside:R},b=(d,N)=>{if(!(N==null||N===!1)){if(Array.isArray(N)){N.forEach(I=>b(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,v,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(v)),V=on(JSswift.ui.slot(ye));Se.replaceChildren(),Array.isArray(V)?V.forEach(O=>b(Se,O)):b(Se,V)},`UI.Header:${d}`),[Se]}return E(s,d,v,I(N))},Z=(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",v,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")&&ol.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,Z),te=P("eyebrow",(k=e.eyebrow)!=null?k:e.kicker),M=P("title",W),Q=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,Q.length?_.div({class:ae(["cms-header-subtitle",e.subtitleClass])},...Q):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),C=(be=e.stateKey)!=null?be:qt;C&&(qt=C,Et=en(C));const u=()=>en(C),i=()=>Wt(!0,C),y=()=>Wt(!1,C),R=()=>Wt(!u(),C),v={props:e,stateKey:C,isDrawerOpen:u,openDrawer:i,closeDrawer:y,toggleDrawer:R,toggleAside:R},b=JSswift==null?void 0:JSswift.store,P=!!(b!=null&&b.get&&(b!=null&&b.set)),Z=`${C}:groups`,G=`${C}:active`;let ie=P?b.get(Z,{})||{}:{},D=P&&(Ce=b.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=v)=>{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",Q=(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&&b.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)]:[]},S=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},b.set(Z,ie))},U=()=>{const c={...v,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",{...v,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}=S(B),ut=mt(l(B.state)||l(B.color)||""),dt=m(B,Me),bt=dt||q(je),lt=!!l(B.disabled),ft={...v,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:Q,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)&&y())}},...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)&&y())}},...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(C)||new Set;return xe.add(ee),hs.set(C,xe),Wt(Et,C),ee.isDrawerOpen=u,ee.openDrawer=i,ee.closeDrawer=y,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=(S,h)=>{var J;return!!(S&&S.nodeType===1&&((J=S.classList)!=null&&J.contains(`cms-page-${h}`)))},C=S=>S==null?null:typeof S=="string"?he.Icon({name:S,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(S,{as:"icon"}),u={dense:!!l(e.dense),flat:!!l(e.flat),centered:!!l(e.centered),narrow:!!l(e.narrow)},i=(S,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(J=>i(S,J));return}if(h!=null&&h.nodeType){S.appendChild(h);return}S.appendChild(document.createTextNode(String(h)))}},y=(S,h,J=j=>j)=>{const j=JSswift.ui.getSlot(s,S);if(j!=null)return E(s,S,u,null);if(typeof h=="function"){const U=new Set(["eyebrow","title","subtitle"]),ce=_[U.has(S)?"span":"div"]({class:`cms-page-slot-${S}`});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:${S}`),[ce]}return E(s,S,u,J(h))},R=E(s,"default",u,n!=null&&n.length?n:[]),v={hero:[],header:[],body:[],footer:[],actions:[]},b=[];R.forEach(S=>{r(S,"hero")?v.hero.push(S):r(S,"header")?v.header.push(S):r(S,"body")?v.body.push(S):r(S,"footer")?v.footer.push(S):r(S,"actions")?v.actions.push(S):b.push(S)});const P=y("icon",e.icon,C),Z=y("hero",(g=e.hero)!=null?g:e.banner),G=y("eyebrow",(F=e.eyebrow)!=null?F:e.kicker),ie=y("title",e.title),D=y("subtitle",(X=e.subtitle)!=null?X:e.description),$=y("header",e.header),Y=y("aside",e.aside),W=y("body",(a=e.body)!=null?a:e.content),le=y("footer",e.footer),me=y("actions",e.actions),re=Z.length?_.div({class:ae(["cms-page-hero",e.heroClass])},...Z):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,...b],M=te.length?_.div({class:ae(["cms-page-body",e.bodyClass])},...te):null,Q=[...me,...v.actions],q=le.length||Q.length?_.div({class:ae(["cms-page-footer",e.footerClass])},...le,Q.length?_.div({class:"cms-page-actions"},...Q):null):null,ue=!!(Z.length||v.hero.length),L=!!(oe||v.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,...v.hero,se,...v.header,M,...v.body,q,...v.footer);return Ke(m,e),m},he.AppShell=(...t)=>{var S,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,C=l(e.reverse)===!0,u=l(e.stack)===!0,i=(h=(S=e.drawerStateKey)!=null?S:e.stateKey)!=null?h:qt;i&&(qt=i,Et=en(i));const y={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 v=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),v=he.Header(R));const b=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},P=o(e,"drawerItems")?e.drawerItems:e.items,Z=o(e,"drawerHeader")?e.drawerHeader:void 0;let G=e.drawer;!o(e,"drawer")&&!r&&(Object.keys(b).length||P!=null||Z!=null)&&(!o(b,"items")&&P!=null&&(b.items=P),!o(b,"header")&&Z!=null&&(b.header=Z),o(b,"stateKey")||(b.stateKey=i),G=he.Drawer(b));const ie=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},D=o(e,"content")?e.content:n,$=E(s,"default",y,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",y,le)));const re=E(s,"header",y,v),oe=r?[]:E(s,"drawer",y,G),se=E(s,"page",y,Y),te=E(s,"footer",y,me),M=ae(["cms-app","cms-app-shell",fe(r,"no-drawer"),fe(C,"is-reverse"),fe(u,"is-stack"),fe(e.flush,"is-flush"),fe(e.divider,"is-divider"),e.class]),Q=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"]);Q.class=M,Q.style={...e.style||{}};const q=ze(e.drawerWidth,Be);q!=null&&(Q.style["--cms-app-shell-drawer-width"]=q);const ue=ze(e.gap,Be);ue!=null&&(Q.style["--cms-app-shell-gap"]=ue);const L=ze(e.padding,Be);L!=null&&(Q.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=C?[g,m]:[m,g],a=_.div(Q,...f?[f]:[],_.div({class:"cms-app-shell-body"},...X.filter(Boolean)),...F?[F]:[]);return a.openDrawer=y.openDrawer,a.closeDrawer=y.closeDrawer,a.toggleDrawer=y.toggleDrawer,a.isDrawerOpen=y.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 C=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})`},y=(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)},v=E(o,"badge",R,n.badge),b=E(o,"background",R,n.backgroundContent),P=E(o,"eyebrow",R,(J=n.eyebrow)!=null?J:n.kicker),Z=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=v.length?_.div({class:ae(["cms-parallax-badge",n.badgeClass])},...v):null,se=P.length||Z.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,Z.length?_.div({class:ae(["cms-parallax-title",n.titleClass])},...Z):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,Q=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",C,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])},b.length?_.div({class:ae(["cms-parallax-bg-content",n.backgroundContentClass])},...b):null),f=_.div({class:ae(["cms-parallax-content",n.contentClass,n.innerClass])},oe,te,M,Q,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)},S=()=>{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=y(n.speed,.18),k=Math.abs(y(n.maxOffset,96)),d=l(n.startTop),N=d!=null&&d!==""?(U.top-y(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,S()}))}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 Ho(){for(const t of Yn.keys())ys(t);Kn([])}function ml(t){t!=null&&t.id&&(ys(t.id),t.timeout>0&&Yn.set(t.id,setTimeout(()=>{ws(t.id)},t.timeout)))}function gl(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&&ml(n),(n==null?void 0:n.id)||null}function jo(t){const e=()=>ws(t.id),n=(ie={})=>gl(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=$o[t.type];return ie?he.Icon({name:ie,size:"sm"}):null})(),C=E(t.slots,"icon",s,r),u=E(t.slots,"title",s,o(t.title)),i=E(t.slots,"message",s,o(t.message)),y=E(t.slots,"description",s,o(t.description)),R=E(t.slots,"meta",s,o(t.meta)),v=E(t.slots,"actions",s,o(t.actions)),b=E(t.slots,"default",s,o(t.body)),P=E(t.slots,"dismiss",s,o(t.dismiss)),Z=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},C.length?_.div({class:"cms-toast-icon"},...C):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,y.length?_.div({class:"cms-toast-description"},...y):null,b.length?_.div({class:"cms-toast-body"},...b):null,R.length?_.div({class:"cms-toast-meta"},...R):null),v.length?_.div({class:"cms-toast-actions"},...v):null),Z.length?_.div({class:"cms-toast-dismiss"},...Z):null);return Ke(G,t),G}function Wo(){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=dl(s.position);n.has(o)||n.set(o,[]),n.get(o).push(s)}for(const s of ul){const o=n.get(s);if(!(o!=null&&o.length))continue;const r=_.div({class:ae(["cms-toast-wrap",`is-${s}`])},...o.map(C=>jo(C)));t.appendChild(r)}},"JSswiftUI:toasts"),t)}function Uo(t={}){Wo();const e=Gt(t);return e.id=e.id||Math.random().toString(36).slice(2),Kn([...Gn().filter(n=>n.id!==e.id),e]),ml(e),e.id}He.services.notify.show=Uo,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=gl,He.services.notify.remove=ws,He.services.notify.clear=Ho,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,C=JSswift.form._isPromise(r)?await r:r;return C===!0?null:typeof C=="string"?C:C===!1?o||"Valore non valido":C?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({}),C=_.rod({}),u=_.rod(!1),i=_.rod(null),y=()=>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)}},v=re=>{const oe=y();return oe?oe[re]:void 0},b=(re,oe)=>{const se={...y()||{}};se[re]=oe,R(se)},P=(re,oe)=>{const se={...r.value||{}};oe?se[re]=oe:delete se[re],r.value=se},Z=re=>(r.value||{})[re]||null,G=re=>{C.value={...C.value||{},[re]:!0}},ie=re=>!!(C.value||{})[re],D=async re=>{const oe=n[re]||[];if(!oe.length)return P(re,null),!0;const se=v(re),te={name:re,value:se,model:y(),form:me};for(const M of oe){if(!M)continue;const Q=await JSswift.form._runRule(M,se,te);if(Q)return P(re,Q),!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:C,submitting:u,submitError:i,getValue:v,setValue:b,getError:Z,setError:P,touch:G,isTouched:ie,field:(re,oe={})=>{var F;const se=_.rod("");(F=se.action)==null||F.call(se,X=>{b(re,X)});const te=()=>s==="submit"||s==="input"||s==="blur"?!0:ie(re);let M=null,Q=!1,q=!1;const ue=async()=>{Q||(Q=!0,G(re),(s==="blur"||s==="input")&&await D(re),setTimeout(()=>{Q=!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,Q=!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()?Z(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={},C.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(y(),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]),C=JSswift.omit(e,["form","onSubmit"]);C.class=r;const u=_.form({...C,onSubmit:async y=>{y.preventDefault(),s&&await s.submit(o||(async()=>{}))}}),i=[];for(const y of n||[]){const R=typeof y=="function"?y(s):y,v=JSswift.ui.slot(R);v&&(Array.isArray(v)?i.push(...v):i.push(v))}return i.forEach(y=>u.appendChild(y)),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 hl(){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 C={...e.style||{}},u=ze(e.align);u!=null&&!We(e,"align")&&(C.alignItems=u);const i=ze(e.justify);i!=null&&!We(e,"justify")&&(C.justifyContent=i);const y=ze(e.wrap,P=>P?"wrap":"nowrap");y!=null&&!We(e,"wrap")&&(C.flexWrap=y);const R=ze(e.direction);R!=null&&!We(e,"direction")&&(C.flexDirection=R);const v=ze(e.gap,Be);v!=null&&!We(e,"gap")&&(C.gap=v),Object.keys(C).length&&(r.style=C),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const b=_.div(r,...E(s,"default",{},n));return Ke(b,e),b},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 C=_.div(r,...E(s,"default",{},n));return Ke(C,e),C},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 C={...e.style||{}},u=ze(e.align);u!=null&&!We(e,"align")&&(C.alignItems=u);const i=ze(e.justify);i!=null&&!We(e,"justify")&&(C.justifyContent=i);const y=ze(e.wrap,P=>P?"wrap":"nowrap");y!=null&&!We(e,"wrap")&&(C.flexWrap=y);const R=ze(e.direction);R!=null&&!We(e,"direction")&&(C.flexDirection=R);const v=ze(e.gap,Be);v!=null&&!We(e,"gap")&&(C.gap=v),Object.keys(C).length&&(r.style=C),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const b=_.div(r,...E(s,"default",{},n));return Ke(b,e),b},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 C={...e},u=null,i=null;const y=(f,m)=>typeof f=="function"?f(m):f,R=f=>String(f||"").split(/\s+/).filter(Boolean),v=(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},b=(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,S,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((S=f==null?void 0:f.offsetTop)!=null?S: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}},Z=f=>{if(!(f!=null&&f.panel))return;const{left:m,top:g,width:F,height:X}=P();b(f.panel,"position","fixed"),b(f.panel,"inset",0,a=>`${a}px`),b(f.panel,"top",g,a=>`${a}px`),b(f.panel,"left",m,a=>`${a}px`),b(f.panel,"right","auto"),b(f.panel,"bottom","auto"),b(f.panel,"width",F,a=>`${a}px`),b(f.panel,"height",X,a=>`${a}px`),b(f.panel,"min-height",X,a=>`${a}px`),b(f.panel,"max-width",F,a=>`${a}px`),b(f.panel,"max-height",X,a=>`${a}px`),b(f.panel,"min-width",0,a=>`${a}px`),b(f.panel,"margin",0,a=>`${a}px`),b(f.panel,"box-sizing","border-box"),b(f.panel,"border-width",0,a=>`${a}px`),b(f.panel,"border-radius",0,a=>`${a}px`),b(f.panel,"transform","none"),b(f.panel,"overflow","hidden"),b(f.panel,"--cms-dialog-fullscreen-left",m,a=>`${a}px`),b(f.panel,"--cms-dialog-fullscreen-top",g,a=>`${a}px`),b(f.panel,"--cms-dialog-fullscreen-width",F,a=>`${a}px`),b(f.panel,"--cms-dialog-fullscreen-height",X,a=>`${a}px`)},G=f=>{f!=null&&f.panel&&(b(f.panel,"position",null),b(f.panel,"inset",null),b(f.panel,"top",null),b(f.panel,"left",null),b(f.panel,"right",null),b(f.panel,"bottom",null),b(f.panel,"width",null),b(f.panel,"height",null),b(f.panel,"min-height",null),b(f.panel,"max-width",null),b(f.panel,"max-height",null),b(f.panel,"min-width",null),b(f.panel,"margin",null),b(f.panel,"box-sizing",null),b(f.panel,"border-width",null),b(f.panel,"border-radius",null),b(f.panel,"transform",null),b(f.panel,"overflow",null),b(f.panel,"--cms-dialog-fullscreen-left",null),b(f.panel,"--cms-dialog-fullscreen-top",null),b(f.panel,"--cms-dialog-fullscreen-width",null),b(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=()=>Z(f),S=()=>{g!=null&&X(g),g=F(()=>{g=null,a()})};a(),S(),window.addEventListener("resize",a),window.addEventListener("orientationchange",S),(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",S),f._dialogViewportCleanup=()=>{var k,d,N,I;g!=null&&(X(g),g=null),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",S),(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",S)}},D=()=>C,$=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:Q,dismiss:Q,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,y(f.eyebrow,m)),X=E(s,"title",m,y((ge=(H=f.title)!=null?H:f.heading)!=null?ge:f.header,m)),a=E(s,"subtitle",m,y((Se=f.subtitle)!=null?Se:f.description,m)),S=E(s,"icon",m,g),h=E(s,"header",m,y((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,y(j,m));U.length||(U=E(s,"body",m,y(j,m))),U.length||(U=E(s,"default",m,y(j,m)));const ce=y((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||S.length||J.length)&&(d=_.div({class:"cms-dialog-head"},S.length?_.div({class:"cms-dialog-icon"},...S):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);v(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)]),v(f.overlay,"_dialogOverlayClassTokens",[le(m),l(m.backdropBlur)?"cms-dialog-overlay-blur":"",...R(m.overlayClass)]),b(f.panel,"--cms-dialog-width",l(m.width),Be),b(f.panel,"--cms-dialog-min-width",l(m.minWidth),Be),b(f.panel,"--cms-dialog-max-width",l(m.maxWidth),Be),b(f.panel,"--cms-dialog-max-height",l(m.maxHeight),Be),b(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"&&(C={...C,...f}),u&&(oe(u),se()),L),M=(f=null)=>{var X,a,S,h,J;if(f&&typeof f=="object"&&(C={...C,...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:(S=m.closeOnEsc)!=null?S:!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]")&&Q()};return u.panel.addEventListener("click",F),oe(u),bn(u),(J=(h=D()).onOpen)==null||J.call(h,u),u},Q=()=>{if(!u)return;const f=u;yn(f,()=>JSswift.overlay.close(f.id))},q=()=>!!u,ue=(f=null)=>q()?(Q(),null):M(f),L={open:M,close:Q,toggle:ue,update:te,isOpen:q,entry:()=>u,props:()=>({...C})};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"),C=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",y=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)},v=u(e.orientation||e.orient||e.direction),b=i(e.navPosition||e.barPosition||e.position),P=y(e.variant||(e.pills?"pills":e.soft?"soft":"line")),Z=!!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",v,`variant-${P}`,fe(Z,"wrap"),fe(D,"animated"),fe($,"nav-fill"),fe(Y,"disabled"),fe(b==="after","nav-after"),e.class]),Q=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"]);Q.class=M,Q.style=e.style;const q=_.div(Q);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":v}),L=_.div({class:ae(["cms-tabpanel-panels",e.panelsClass])}),f=[],m=[];let g=-1;const F=()=>v==="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},S=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=`${C}-tab-${A}`,Je=`${C}-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),S(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),S(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"}),S(rt));return}if(_t.includes(ft)){lt.preventDefault();const rt=a(A,1,ie);rt>=0&&(Se(rt,{dir:"next"}),S(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=`${C}-tab-${A}`,Je=`${C}-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:v,position:b,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"),b==="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 Go(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function vs({title:t,message:e,contentNode:n,okText:s,cancelText:o,showCancel:r,onOk:C,onCancel:u,persistent:i}){hl();const y=_.div({class:"cms-dialog-backdrop",onClick:G=>{G.target===y&&i!==!0&&(u==null||u())}}),R=E(null,"default",{},t),v=E(null,"default",{},e),b=E(null,"default",{},n),P=_.div({class:"cms-dialog cms-panel"},R.length?_.h3(...R):null,v.length?_.p(...v):null,...b,_.div({class:"cms-dialog-actions"},r?JSswift.ui.Btn({onClick:u},o||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:C},s||"OK")));y.appendChild(P),hl().appendChild(y);const Z=G=>{G.key==="Escape"&&(u==null||u())};return document.addEventListener("keydown",Z,{once:!0}),{backdrop:y,close:()=>Go(y)}}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 pl(){if(kt)return kt;kt=document.createElement("div"),kt.className="cms-loading-backdrop",kt.style.cssText=`
1
+ (function(He){var Sl;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 Kl=()=>{ss||(ss=!0,queueMicrotask(()=>{ss=!1,Ht.length=0}))},Yl=t=>{Ht.push(t),Ht.length>128&&Ht.splice(0,Ht.length-128),Kl()},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},ql=(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 C=r;for(let u=0;u<e.length-1;u++){const i=e[u];let y=C[i];if(!y||typeof y!="object"){const R=e[u+1];y=Ps(R)?[]:{},C[i]=y}C=y}Object.is(C[e[e.length-1]],o)||(C[e[e.length-1]]=o,s.rawSet(r))},Ts=(t,e)=>[()=>os(t,e),n=>ql(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(C,u,i){if(u===ts)return C;const y=Reflect.get(C,u,i);if(typeof u=="symbol")return y;const R=n.concat(u);return y&&typeof y=="object"?Rs(t,y,R):typeof y=="function"?y.bind(i):(ns(y)&&Yl({rod:t,path:R,value:y}),y)},set(C,u,i,y){const R=ls(i),v=Reflect.get(C,u,y);if(Object.is(v,R))return!0;const b=Reflect.set(C,u,R,y);if(b){const P=xn.get(t);P==null||P.rawSet(P.rawGet())}return b},deleteProperty(C,u){const i=Reflect.has(C,u),y=Reflect.deleteProperty(C,u);if(y&&i){const R=xn.get(t);R==null||R.rawSet(R.rawGet())}return y}});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},Xl=()=>{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 C=t.map(u=>{const i=is(u,e,"");return i!==u&&(r=!0),i});return r?C: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 C=is(t[r],e,r);o[r]=C,C!==t[r]&&(s=!0)}return s?o:t},as=(t,e,n="")=>{if(Array.isArray(t)){let r=!1;const C=t.map(u=>{const i=as(u,e,"");return i!==u&&(r=!0),i});return r?C: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 C=!1;const u=o.map(i=>{const y=as(i,r,"");return y!==i&&(C=!0),y});return t.apply(this,C?u:o)};return Object.defineProperty(n,On,{value:!0,configurable:!1}),zs.set(t,n),n},Ql=()=>{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)}})}},Zl=()=>{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 C=!1;const u=o.map(i=>{const y=is(i,r,"");return y!==i&&(C=!0),y});return n.apply(this,C?u:o)})}};Xl(),((Sl=JSswift.rod)==null?void 0:Sl._all)instanceof Set&&JSswift.rod._all.forEach(t=>Ms(t)),Zl(),Ql();const Os={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},ci=new Set(Object.values(Os)),eo=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),to=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]||""},no=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":eo.has(e)?e:null},Dn=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return to.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))})},so=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),lo=(t={},e=[])=>{const n=[];for(const s of mn){const o=Nn(t,s);if(o)for(const r of e){const C=Array.isArray(r.prop)?r.prop:[r.prop];let u=!1,i,y="";for(const b of C)if($n(o,b)){i=l(o[b]),y=b,u=!0;break}if(!u||i==null||i===""||i===!1&&!r.allowFalse)continue;const R=typeof r.map=="function"?r.map(i,{propName:y,props:o,device:s,rule:r}):`${r.class}-${so(i)}`,v=Array.isArray(R)?R:[R];for(const b of v)b&&n.push(String(b).startsWith("cms-")?b:`${s.prefix}${b}`)}}return n},$s=(t={})=>mn.some(e=>!!Nn(t,e)),oo=(t={},e=[])=>{for(const n of e){if(!$n(t,n))continue;const s=l(t[n]);if(!(s==null||s===""))return s}},io=(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)},ao=(t,e,n)=>{!t||n==null||n===""||(typeof t.setProperty=="function"?t.setProperty(e,n):t[e]=n)},ro=(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 C=Array.isArray(r.prop)?r.prop:[r.prop],u=(i,y)=>{const R=oo(y,C),v=io(R,r);if(!v)return;const b=r.var||r.css,P=i==="mobile"?"--cms-rsp-":`--cms-rsp-${i}-`;ao(s,`${P}${b}`,v),Vs(t,ro(i,b)),o=!0};u("mobile",e);for(const i of mn){const y=Nn(e,i);y&&u(i.key,y)}}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=lo,JSswift.uiApplyResponsiveProps=Bs;const co=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(cs):cs;return co(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||{}})},uo=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=uo(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"},fo=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:fo},{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 mo=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),go=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(mo(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)||go(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),C=o!=null?typeof o=="function"?o(n||{}):o:s;return C==null?null:on(JSswift.ui.slot(C))};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 ho=new Set(["ctrl","alt","shift","meta"]),po={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"},bo={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?po[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(ho.has(o)){s[o]=!0;return}s.key=o}),s.key?s:null},yo=t=>t==null||t===!1?[]:(Array.isArray(t)?t:[t]).map(n=>{var o,r,C;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const u=Ks((C=(r=(o=n.shortcode)!=null?o:n.shortcut)!=null?r:n.keys)!=null?C:n.key);return u?{...n,...u}:null}const s=Ks(n);return s?{...s}:null}).filter(Boolean),Ys=(t={})=>{var e,n,s;return yo((s=(n=(e=t.shortcode)!=null?e:t.shortcut)!=null?n:t.hotkey)!=null?s:t.keys)},wo=(t={})=>t.showShortcode===!0||t.showShortcut===!0,Ln=t=>{const e=ds(t);if(!e)return"";const n={...bo};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()}`)},vo=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("+")},So=t=>(Array.isArray(t)?t:[]).map(vo).filter(Boolean).join(" / "),fs=(t={},e={})=>{const n=Ys(t);if(!wo(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=So(n),s},Co=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)},xo=(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,C,u,i;if(!gn.size||!t||t.defaultPrevented||t.isComposing)return;const e=Co(t.target),n=Array.from(gn);for(let y=n.length-1;y>=0;y-=1){const R=n[y],v=R==null?void 0:R.anchor;if(!v||!v.isConnected){gn.delete(R);continue}if(((s=R.isEnabled)==null?void 0:s.call(R))===!1)continue;const b=R.specs.find(ie=>{var $,Y;const D=(Y=($=ie.allowInEditable)!=null?$:R.allowInEditable)!=null?Y:!1;return e&&!D?!1:xo(t,ie)});if(!b)continue;const P=(r=(o=b.preventDefault)!=null?o:R.preventDefault)!=null?r:!0,Z=(u=(C=b.stopPropagation)!=null?C:R.stopPropagation)!=null?u:!0;if(P&&t.preventDefault(),Z&&t.stopPropagation(),((i=R.action)==null?void 0:i.call(R,t,b,v))!==!1)break}qs()}const an=(t,e={},n={})=>{var C,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:(C=n.preventDefault)!=null?C:!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,"-")}`,ko=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,_o=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""},No=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:ko},{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:_o},{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:No},{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],Ao=(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,S,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,S);return S==null?[]:E(null,"default",h,S)},r=a=>{var S;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?`var(--cms-s-${a})`:String(a)},C=a=>{var S;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.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||{}},y=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),v=ze(e.justify),b=ze(e.wrap,a=>typeof a=="boolean"?a?"wrap":"nowrap":String(a)),P=ze(e.gap,r),Z=ze(e.rowGap,r),G=ze(e.columnGap,r),ie=ze(e.inline,a=>a?"inline-flex":"flex"),D=ze(e.width,C),$=ze(e.minWidth,C),Y=ze(e.maxWidth,C),W=ze(e.full,a=>a?"100%":"",""),le=qe([e.inline,e.full,e.width],()=>{const a=!!l(e.inline),S=!!l(e.full),h=l(e.width)!=null&&l(e.width)!==!1&&l(e.width)!=="";return!a||S||h?"":"max-content"});y!=null&&!We(e,"direction")&&(i.flexDirection=y),R!=null&&!We(e,"align")&&(i.alignItems=R),v!=null&&!We(e,"justify")&&(i.justifyContent=v),b!=null&&!We(e,"wrap")&&(i.flexWrap=b),P!=null&&!We(e,"gap")&&(i.gap=P),Z!=null&&!We(e,"rowGap")&&(i.rowGap=Z),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),S=_.div(u,...a);return Ke(S,e),S}const M={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},Q=(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",Q]),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 Io(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=Io(t),n=()=>{const s=[],o=Array.isArray(t)?[...t]:[t];for(;o.length;){const r=o.shift();if(r==null||r===!1)continue;const C=l(r);if(!(C==null||C===!1||C==="")){if(Array.isArray(C)){o.unshift(...C);continue}s.push(C)}}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)},C=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""},y=()=>{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"}),v=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]),b={...e.style||{}};!We(e,"minWidth")&&b.minWidth==null&&(b.minWidth=0);const P=ze(e.gap,C),Z=ze(e.rowGap,C),G=ze(e.columnGap,C),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":"",""),Q=qe([e.flex,e.fill,e.grow,e.shrink,e.basis],y),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)===""));Q!=null&&Q!==""&&(b.flex=Q),se!=null&&!We(e,"self")&&(b.alignSelf=se),te!=null&&(b.order=te),M!=null&&M!==""&&(b.overflow=M),Y!=null&&Y!==""&&!We(e,["width","size"])&&(b.width=Y,!o("flex")&&!o("fill")&&!o("grow")&&!o("shrink")&&!o("basis")&&(b.flex="0 0 auto")),W!=null&&!We(e,"minWidth")&&(b.minWidth=W),le!=null&&!We(e,"maxWidth")&&(b.maxWidth=le),me!=null&&!We(e,"height")&&(b.height=me),re!=null&&!We(e,"minHeight")&&(b.minHeight=re),oe!=null&&!We(e,"maxHeight")&&(b.maxHeight=oe),Object.keys(b).length&&(v.style=b);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(v.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")&&(b.gap=P),Z!=null&&!We(e,"rowGap")&&(b.rowGap=Z),G!=null&&!We(e,"columnGap")&&(b.columnGap=G),ie!=null&&!We(e,"align")?b.alignItems=ie:q!=null&&q!==""&&(b.alignItems=q?"center":""),D!=null&&!We(e,"justify")?b.justifyContent=D:q!=null&&q!==""&&(b.justifyContent=q?"center":""),Object.keys(b).length&&(v.style=b),JSswift.uiApplyResponsiveProps(v,e,JSswift.uiResponsiveStyleRules),!F){const N=_.div(v,...E(s,"default",ue,n));return Ke(N,e),N}const a={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},S=[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(v,...S);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=S=>Object.prototype.hasOwnProperty.call(e,S),C={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},u=S=>{if(S==null||S===!1||S==="")return"";if(typeof S=="number")return`${S}px`;const h=String(S).trim().toLowerCase();return h?h==="full"||h==="fluid"?"100%":C[h]||String(S):""},i=S=>{var h;return S==null||S===!1||S===""?"":typeof S=="number"?`${S}px`:typeof S=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(S))?`var(--cms-s-${S})`:String(S)},y=S=>{if(S==null||S===!1||S==="")return"";if(typeof S=="number"&&Number.isFinite(S))return`repeat(${Math.max(1,Math.floor(S))}, minmax(0, 1fr))`;const h=String(S).trim();return h?/^\d+$/.test(h)?`repeat(${Math.max(1,Number(h))}, minmax(0, 1fr))`:h:""},R=S=>S==null||S===""?"":S===!0?"wrap":S===!1?"nowrap":String(S),v={props:e},b=(S,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(J=>b(S,J));return}if(h!=null&&h.nodeType){S.appendChild(h);return}S.appendChild(document.createTextNode(String(h)))}},P=(S,h)=>{const J=JSswift.ui.getSlot(s,S);if(J!=null)return E(s,S,v,null);if(typeof h=="function"){const j=_.div({class:`cms-container-slot-${S}`});return JSswift.reactive.effect(()=>{const U=on(JSswift.ui.slot(h(v)));j.replaceChildren(),Array.isArray(U)?U.forEach(ce=>b(j,ce)):b(j,U)},`UI.Container:${S}`),[j]}return E(s,S,v,h)},Z=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 S=P("content",r("content")?e.content:null);return S.length?S:P("default",Z)})(),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 S=String(l((h=e.layout)!=null?h:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(S)?S:["inline","inline-flex","inlineflex"].includes(S)||l(e.inline)?"inline":l(e.grid)||l(e.cols)!=null?"grid":S==="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 S=se();return S==="block"?"":`is-${S}`}),M={...o.style||{}},Q=(S,h)=>{h!=null&&(M[S]=h)};Q("maxWidth",qe([e.maxWidth,e.fluid],()=>l(e.fluid)?"none":u(l(e.maxWidth))||"")),Q("width",ze(e.width,u)),Q("minWidth",ze(e.minWidth,u)),Q("--cms-container-padding",ze(e.padding,i)),Q("--cms-container-padding-x",ze((X=e.paddingX)!=null?X:e.gutter,i)),Q("--cms-container-padding-y",ze(e.paddingY,i)),Q("--cms-container-gap",ze(e.gap,i)),Q("--cms-container-section-gap",ze((a=e.sectionGap)!=null?a:e.gap,i)),Q("--cms-container-cols",ze(e.cols,y)),Q("--cms-container-align",ze(e.align,S=>String(S))),Q("--cms-container-justify",ze(e.justify,S=>String(S))),Q("--cms-container-direction",ze(e.direction,S=>String(S))),Q("--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=(S,h,J)=>h.length?_.div({class:ae(["cms-container-section",`cms-container-${S}`,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 S=String(l((h=e.tag)!=null?h:e.as)||"div").toLowerCase();return typeof _[S]=="function"?_[S]:_.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,y={dense:!!l(e.dense),flat:!!l(e.flat),clickable:!!l(e.clickable),to:l(e.to)||null},R=E(s,"default",y,n!=null&&n.length?n:[]),v={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},b=[];R.forEach(d=>{r(d,"identifier")?v.identifier.push(d):r(d,"cover")?v.cover.push(d):r(d,"media")?v.media.push(d):r(d,"header")?v.header.push(d):r(d,"body")?v.body.push(d):r(d,"footer")?v.footer.push(d):r(d,"actions")?v.actions.push(d):b.push(d)});const P=E(s,"identifier",y,e.identifier),Z=E(s,"cover",y,i),G=E(s,"media",y,e.media),ie=E(s,"eyebrow",y,(ce=e.eyebrow)!=null?ce:e.kicker),D=E(s,"title",y,e.title),$=E(s,"subtitle",y,e.subtitle),Y=E(s,"header",y,e.header),W=E(s,"icon",y,u),le=E(s,"aside",y,(k=e.aside)!=null?k:e.headerAside),me=E(s,"body",y,e.body),re=E(s,"footer",y,e.footer),oe=E(s,"actions",y,e.actions),se=P.length?_.div({class:ae(["cms-card-identifier",e.identifierClass])},...P):null,te=Z.length?_.div({class:ae(["cms-card-cover",e.coverClass])},...Z):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,...b],L=ue.length?_.div({class:ae(["cms-card-body",e.bodyClass])},...ue):null,f=[...oe,...v.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||v.identifier.length,X=Z.length||v.cover.length||G.length||v.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 S=e.onClick,h=e.onKeydown,J=d=>{var I;if(S==null||S(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,...v.identifier,te,...v.cover,M,...v.media,q,...v.header,L,...v.body,m,...v.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]),C=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);C.class=r;const u=()=>!!l(e.loading),i=()=>!!l(e.disabled)||u(),y=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,v=JSswift.ui.renderSlot(s,"icon",{},y),b=JSswift.ui.renderSlot(s,"iconRight",{},R),P=JSswift.ui.renderSlot(s,"label",{},e.label),Z=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),Z.length&&G.push(...Z),ie(v)):(ie(v),ie(P),Z.length&&G.push(...Z)),ie(b),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 Q=M.currentTarget,q=Q.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;Q.style.setProperty("--cms-burst-x",`${ue}px`),Q.style.setProperty("--cms-burst-y",`${L}px`),Q.classList.remove("cms-btn-burst"),Q.offsetWidth,Q.classList.add("cms-btn-burst")},oe=_.button({...C,disabled:i(),onClick:M=>{var Q,q;return i()?((Q=M==null?void 0:M.preventDefault)==null||Q.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(),Q=i();oe.disabled=Q,oe.classList.toggle("is-loading",M),oe.setAttribute("aria-disabled",Q?"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,Q,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,C=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),y=()=>{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:C,clear:y,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:i()},null);let v=null,b=null;if(R)v=Array.isArray(R)?_.div({class:"cms-control"},...R):R;else{v=_.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&&v.appendChild(L);const F=_.div({class:"cms-mid"+(L.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});C&&F.appendChild(C);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)}v.appendChild(F);const a=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:y},he.Icon({name:"close"})):null,S=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:i()},a);S&&(S.onclick=k=>{k.stopPropagation(),y()},E(null,"default",{},S).forEach(k=>v.appendChild(k))),b=a,b&&((oe=t.clearable)!=null&&oe.action)&&t.clearable.action(k=>k?b.classList.remove("cms-d-none"):b.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&&(v.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),Z=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(Z(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 S;return(S=v==null?void 0:v.classList)==null?void 0:S.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=v==null?void 0:v.classList)==null||f.toggle("has-value",L),b&&(b.style.display=L?"":"none")};JSswift.reactive.untracked(D),(se=v==null?void 0:v.classList)==null||se.toggle("disabled",!!t.disabled),s.appendChild(v);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||(Q=t.success)!=null&&Q.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=v,s._el=C,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 b;const v=(b=e.value)!=null?b:"";v!==n&&(n=v,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let o=null,r=!1;const C=()=>{if(r)return;r=!0;let v=0;const b=()=>{if(s(),v+=1,v>=10){r=!1;return}setTimeout(b,120)};setTimeout(b,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 v;n=(v=e.value)!=null?v:""}),e.addEventListener("change",()=>{var v;n=(v=e.value)!=null?v:""}),e.addEventListener("animationstart",v=>{v.animationName==="cms-autofill"&&(s(),u(),C())}),e.addEventListener("focus",()=>{u(),C(),setTimeout(s,50)}),e.addEventListener("blur",()=>{i(),setTimeout(s,0)}),setTimeout(s,0),C();const y=t.model;if(y){if(typeof y=="object"&&typeof y._bind=="function")He.rodModel(e,y);else if(Array.isArray(y)&&typeof y[0]=="function"&&typeof y[1]=="function"){const v=He.rodFromSignal(y[0],y[1]);He.rodModel(e,v)}}return an(e,t,{isEnabled:()=>!e.disabled,action:()=>hn(e,{selectText:!!t.selectOnShortcode})}),e},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 C=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)},y=()=>{C||(C=setInterval(()=>{if(document.activeElement!==s){clearInterval(C),C=null;return}r()},250))},R=()=>{C&&(clearInterval(C),C=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,$),y(),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(),y(),i())}),setTimeout(r,0),i();const v=t.model;if(v){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 v=="object"&&typeof v._bind=="function")$(v);else if(Array.isArray(v)&&typeof v[0]=="function"&&typeof v[1]=="function"){const Y=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(v[0],v[1]));$(Y)}}const b=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),P=Array.isArray(b)?_.div({style:{display:"contents"}},...b):b,Z=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($=Z._refresh)==null?void 0:$.call(Z)}),s.addEventListener("change",()=>{var $;return($=Z._refresh)==null?void 0:$.call(Z)}),Z._input=s,an(s,t,{isEnabled:()=>!s.disabled,action:()=>hn(s,{selectText:!!t.selectOnShortcode})}),Z},he.Textarea=(t={})=>{var y,R,v,b;const e=t.slots||{},n={...t,label:(y=t.label)!=null?y: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:(v=t.minLength)!=null?v:t.minlength,wrap:t.wrap,value:(b=t.value)!=null?b:"",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 Z;(Z=t.onFocus)==null||Z.call(t,P)}),s.addEventListener("blur",P=>{var Z;(Z=t.onBlur)==null||Z.call(t,P)});const o=t.model;if(o){const P=Z=>{let G=!1;const ie=$=>{const Y=$!=null?$:"";s.value!==Y&&(s.value=Y)};Z.action($=>{if(!G){G=!0;try{ie($)}finally{G=!1}}}),JSswift.reactive.untracked(()=>ie(Z.value));const D=$=>{if(G||$!=null&&$.isComposing)return;const Y=s.value;if(Z.value!==Y){G=!0;try{Z.value=Y}finally{G=!1}}};s.addEventListener("input",D),s.addEventListener("compositionend",D),typeof Z.onDispose=="function"&&Z.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 Z=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(o[0],o[1]));P(Z)}}const r=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",C=JSswift.ui.renderSlot(e,r,{textarea:s,input:s,props:t},s),u=Array.isArray(C)?_.div({style:{display:"contents"}},...C):C,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,C]=JSswift.reactive.signal(o==null?"":String(o)),[u,i]=JSswift.reactive.signal(!1),[y,R]=JSswift.reactive.signal(!1),[v,b]=JSswift.reactive.signal(null),[P,Z]=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},Q=(T,x=!1)=>{const w=l(T);return w==null?x:!!w},q=()=>Q(t.disabled,!1),ue=()=>Q(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()},S=(T,x={})=>{var c,A;const w=T==null?"":String(T);r()!==w&&C(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=()=>y()||v()||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=()=>{Z([]),b(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)){Z($.get(Je)),b(null),R(!1),ie($.get(Je).length?0:-1),x.open!==!1&&j();return}R(!0),b(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),Z(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;b(Ye),Z([]),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"?S(w,{event:x}):t.commitValue!==!1&&S(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=>S(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(()=>{S(T(),{fromModel:!0})},"UI.Search:model"),Y=w=>x(w)}}else at(t.value)&&JSswift.reactive.effect(()=>{S(l(t.value),{fromModel:!0})},"UI.Search:value");ee.addEventListener("input",T=>{S(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=y(),x=v(),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()||(S("",{}),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=>S(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||{},C=x=>!!x&&(typeof x=="object"&&typeof x._bind=="function"||At(x)),u=C(t.model)?t.model:C(t.value)?t.value:null,i=x=>Array.isArray(x)?x.slice():x==null||x===""?[]:[x],y=x=>s?i(x):x,R=u?JSswift.reactive.untracked(()=>typeof u=="object"&&typeof u._bind=="function"?u.value:u[0]()):t.value,[v,b]=JSswift.reactive.signal(!1),[P,Z]=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(y(u.value))),u.action(x=>ie(y(x))),se=x=>{const w=y(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(y(x()))},"UI.Select:model")}),se=c=>w(y(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 Q(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,Q(w)}catch(c){console.error("[UI.Select] options load error:",c),Q([])}finally{$(!1)}}function ue(x){var c;const w=y(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(){Z(""),ce&&(ce.value="")}function g(){b(!1),m(),oe(-1)}async function F(){if(te())return;b(!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(){v()?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"}),S=_.div({class:ae(["cms-select-value",s?"cms-select-value-multi":""])});JSswift.reactive.effect(()=>{const x=le();if(S.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))}});S.appendChild(Je)}}else{const w=G(),c=x.find(A=>A.value==w);S.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:v()},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},S,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=>Z(x.target.value||"")}),d=()=>{const x=JSswift.ui.renderSlot(r,"filter",{value:P(),setValue:c=>{const A=c==null?"":String(c);Z(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=()=>{!v()||H.parentNode!==document.body||ge||(ge=requestAnimationFrame(()=>{if(ge=0,!v()||!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=v();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))),v()&&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))),v()&&ye();return}}if(Le){const Ee=JSswift.ui.renderSlot(r,"loading",{},"Caricamento...");j.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},Ee))),v()&&ye();return}for(const Ee of B)j.appendChild(Ee);be(),v()&&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=v(),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"),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),[C,u]=JSswift.reactive.signal(!1),[i,y]=JSswift.reactive.signal(null);let R=0,v=!1;const b=()=>!!l(t.disabled)||!!l(t.readonly),P=()=>t.multiple!==!1&&t.single!==!0,Z=()=>{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!Z()&&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"),Q=(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&&Q(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(b())return[];y(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&&!Z()&&d(),x},F=(z={})=>{var we;for(const T of n())T.status==="uploading"&&a(T),T.status="removed";s([]),y(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())},S=()=>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,y(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(v||b())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=()=>{b()||H.click()},H=_.input({type:"file",class:"cms-upload-input",name:W(),accept:se()||null,multiple:P(),capture:t.capture||null,disabled:b(),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(Z(),"is-form-mode"),fe(!$(),"is-files-hidden"),t.class]),tabindex:b()?"-1":"0",role:"group","aria-disabled":b()?"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:S,files:()=>n().slice(),state:()=>({files:n().slice(),busy:C(),dragging:o(),error:i()}),reset:F},ke=()=>{const z={api:K,files:n().slice(),busy:C(),disabled:b(),submitMode:Z()?"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:C(),disabled:b()||!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:b()||!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||b()||(z.preventDefault(),r(!0),O.classList.add("is-dragging"))},onDragover:z=>{t.drag===!1||b()||z.preventDefault()},onDragleave:z=>{z.currentTarget===z.target&&(r(!1),O.classList.remove("is-dragging"))},onDrop:z=>{var we,T;t.drag===!1||b()||(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",b()),O.classList.toggle("is-form-mode",Z()),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",b()?"true":"false"),H.disabled=b(),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=()=>{v||(v=!0,S())},(_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 nl={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"]}},zo=t=>{const e=l(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},Po=(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":"."],y=[],R=[...t.rows||[]];if(r&&s==="top"&&!R.includes("nav")){const v=R.indexOf("body");R.splice(v>=0?v:R.length,0,"nav")}for(const v of R)v==="header"&&e.header?y.push(t.fullSide&&o&&n==="left"?["aside","header","header"]:t.fullSide&&o&&n==="right"?["header","header","aside"]:["header","header","header"]):v==="nav"&&r&&s==="top"?y.push(t.fullSide&&o&&n==="left"?["aside","nav","nav"]:t.fullSide&&o&&n==="right"?["nav","nav","aside"]:["nav","nav","nav"]):v==="body"?y.push(i):v==="footer"&&e.footer&&y.push(t.fullSide&&o&&n==="left"?["aside","footer","footer"]:t.fullSide&&o&&n==="right"?["footer","footer","aside"]:["footer","footer","footer"]);return y.length?y.map(v=>`"${v.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,C=()=>{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=C();for(const et of Pe)if(o(Ve,et))return Ve[et];return u(...Pe)},y=(...Pe)=>{const Ve=JSswift.uiResponsivePropsFor(e,pn(V()))||{};for(const et of Pe)if(o(Ve,et))return Ve[et];return u(...Pe)},R=()=>zo(y("disposition","layoutDisposition","layout")),v=()=>{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:""},b=(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},Z=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,Q=()=>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,S]=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:()=>Q()}),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",b((ct=l(i("drawerWidth")))!=null?ct:280,"280px")),_e.style.setProperty("--cms-layout-nav-width",b((ht=(gt=l(i("navWidth")))!=null?gt:l(i("asideRightWidth")))!=null?ht:280,"280px")),_e.style.setProperty("--cms-layout-drawer-peek",b((Ct=l(i("drawerPeek")))!=null?Ct:20,"20px")),_e.style.setProperty("--cms-layout-nav-peek",b((p=(yt=l(i("navPeek")))!=null?yt:l(i("asideRightPeek")))!=null?p:20,"20px"));const Pe=b(l(i("gap")),null);Pe!=null?_e.style.setProperty("--cms-layout-gap",Pe):_e.style.removeProperty("--cms-layout-gap");const Ve=b(l(i("headerOffset")),null);Ve!=null&&_e.style.setProperty("--layout-header-height",Ve);const et=b(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()&&S(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"?S: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||Q()),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?v():"";_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=nl[$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=Po(nl[$e],{header:Ee,aside:ne,nav:ve,main:Ye,footer:Ze});T.style.gridTemplateAreas=Z(y("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()&&!Q()||!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},C=(m,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(F=>C(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"]),S=_[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));S.replaceChildren(),Array.isArray(J)?J.forEach(j=>C(S,j)):C(S,J)},`UI.Footer:${m}`),[S]}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}),y=o("left")?e.left:e.start,R=o("right")?e.right:e.end,v=o("title")?e.title:e.label,b=(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,Z=[...u("left",y),...u("start",null)],G=u("icon",e.icon,i),ie=u("eyebrow",(f=e.eyebrow)!=null?f:e.kicker),D=u("title",v),$=u("subtitle",b),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 Q=ze(e.wrap,m=>m?"wrap":"nowrap");Q!=null&&(te.style.flexWrap=Q),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,...Z.length?[_.div({class:ae(["cms-footer-start",e.startClass])},...Z)]:[],...se.length?[_.div({class:"cms-footer-main"},...se)]:[]);return Ke(q,e),q};const di=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,S,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),C={props:e},u=o(["before"],e.before,C),i=o(["start","left"],(g=e.start)!=null?g:e.left,C),y=o(["center","body","content","default"],(a=(X=(F=e.center)!=null?F:e.body)!=null?X:e.content)!=null?a:n,C),R=o(["end","right","actions"],(h=(S=e.end)!=null?S:e.right)!=null?h:e.actions,C),v=o(["after"],e.after,C),b=o(["title"],e.title,C),P=o(["subtitle"],e.subtitle,C),Z=o(["meta"],e.meta,C),G=!!(u.length||i.length||R.length||v.length||b.length||P.length||Z.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",C,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":""}),Q={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=Z.length||b.length||P.length?_.div({class:ae(["cms-toolbar-copy",e.copyClass])},Z.length?_.div({class:ae(["cms-toolbar-meta",e.metaClass])},...Z):null,b.length?_.div({class:ae(["cms-toolbar-title",e.titleClass])},...b):null,P.length?_.div({class:ae(["cms-toolbar-subtitle",e.subtitleClass])},...P):null):null,L=!!(i.length||ue||y.length||R.length),f=[u.length?_.div({class:ae(["cms-toolbar-before",e.beforeClass]),style:{...Q}},...u):null,L?_.div({class:"cms-toolbar-main",style:q},i.length?_.div({class:ae(["cms-toolbar-start",e.startClass]),style:{...Q}},...i):null,ue||y.length?_.div({class:ae(["cms-toolbar-center",te]),style:{...Q,flex:"1 1 240px"}},ue,...y):null,R.length?_.div({class:ae(["cms-toolbar-end",e.endClass]),style:{...Q,justifyContent:"flex-end",marginInlineStart:M}},...R):null):null,v.length?_.div({class:ae(["cms-toolbar-after",e.afterClass]),style:{...Q}},...v):null].filter(Boolean),m=_.div(D,...f);return Ke(m,e),m};const Jo=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],C=(a={})=>{const S=e.itemProps||{},h={...S,...a};return h.class=ae([S.class,e.itemClass,a.class]),h.style={...S.style||{},...e.itemStyle||{},...a.style||{}},h},u=(a,S={})=>{if(a==null||a===!1)return[];if(Jo(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(C(a),...h)]}return Array.isArray(a)?[he.GridCol(C(S),...a)]:[he.GridCol(C(S),a)]},i=(a,S,h,J=!0)=>{if(a==null||a===!1)return[];const j=_n(a)?a:{};if(J){const U={item:a,index:S,count:h,first:S===0,last:S===h-1},ce=E(s,"item",U,null);if(ce.length)return ce.flatMap(k=>u(k,j))}return u(a,j)},y=[];r.forEach((a,S)=>{y.push(...i(a,S,r.length))}),E(s,"default",{items:r,count:r.length},n).forEach(a=>{y.push(...u(a))}),y.length||E(s,"empty",{items:r,count:0},e.empty).forEach(S=>{const h=u(S,{style:{gridColumn:"1 / -1"}});y.push(...h)});const v=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]),b=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]);b.class=v;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 Z=ze(e.gap,Be);Z!=null&&!We(e,"gap")&&(P["--cms-grid-gap"]=Z,P.gap=Z);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,S=>typeof S=="number"?`repeat(${S}, minmax(0, 1fr))`:String(S));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 S=String(a);return e.dense&&!S.includes("dense")?`${S} dense`:S});le!=null&&!We(e,"flow")&&(P.gridAutoFlow=le);const me=ze(e.areas,a=>Array.isArray(a)?a.map(S=>`"${Array.isArray(S)?S.join(" "):String(S)}"`).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 Q=ze(e.width,Be);Q!=null&&!We(e,"width")&&(P.width=Q),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&&(b.style=P),JSswift.uiApplyResponsiveProps(b,e,JSswift.uiResponsiveStyleRules);const f=_.div(b,...y);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)},C=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||{}},y=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)},v=o("span")?e.span:e.col,b=ze(v,y),P=ze(e.sm,y),Z=ze(e.md,y),G=ze(e.lg,y),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($,y),le=ze(Y,y),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),Q=ze(e.gap,C),q=ze(e.rowGap,C),ue=ze(e.columnGap,C),L=ze(e.padding,C),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),S=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":b!=null&&(i["--cms-grid-col-base"]=b),P!=null&&(i["--cms-grid-col-sm"]=P),Z!=null&&(i["--cms-grid-col-md"]=Z),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),Q!=null&&!We(e,"gap")&&(i.gap=Q),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),S!=null&&!We(e,"direction")&&(i.flexDirection=S),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,Ao);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],C=t[1],u=se=>se&&typeof se=="object"&&!se.nodeType&&!Array.isArray(se)&&!(se instanceof Function);typeof r=="string"?(s=r,o=!0,u(C)?(e=C,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||{},y=l(e.size),R=l(e.color),v=String(s).endsWith("-fill"),b={...e.style||{}},P=qe(e.size,()=>{const se=l(e.size);return typeof se=="string"&&kn[se]?se:""}),Z=!!(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",...Z?["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(b).length&&(Y.style=b),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}));v&&(M.style.fill="currentColor"),me=_.span({...Y,"data-icon":W},M,...n)}else me=_.span({...Y,"data-icon":W},W,...n);if(y!=null){let se=y;JSswift.uiSizes.includes(y)&&(se=`var(--cms-icon-size-${y})`),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]),C=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);C.class=r;const u={...e.style||{}};if(e.size){const G=l(e.size);typeof G=="string"&&kn[G]||(u.fontSize=Be(e.size))}C.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)},y=()=>{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:y()}):JSswift.ui.slot(D,{as:ie})},v=(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}),b=_.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}),Z=_.span(v(["left"],"left","left"),v(["centerLeft","center-left"],"centerLeft","center-left"),C,b,v(["topLeft","top-left"],"topLeft","top-left"),v(["topRight","top-right"],"topRight","top-right"),v(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),v(["bottomRight","bottom-right"],"bottomRight","bottom-right"),v(["centerRight","center-right"],"centerRight","center-right"),v(["right"],"right","right"),P);return(e.topLeft||e.centerLeft||e.bottomLeft)&&Z.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&Z.style.setProperty("padding-right","15px"),Ke(Z,e),Z};const Eo=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(""):""},sl=(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)},ll=(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)),To=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=sl(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=sl(t,e);return t===!0||n?_.span({class:ae(["cms-avatar-status",n?`cms-state-${n}`:""])}):ll(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 S;const a=l(e.size);return typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?`cms-size-${a}`:""}),r=qe([e.color,e.state],()=>{const a=l(e.color)||l(e.state)||"",S=mt(a);return S?`cms-state-${S}`:""}),C=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=C;const i={...e.style||{}},y=ze(e.size,a=>{var S;return typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?"":Be(a)},"");y!=null&&(i.width=y,i.height=y);const R=(g=e.fontSize)!=null?g:e.textSize,v=R!=null?ze(R,Be):ze(e.size,a=>{var S;return typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?"":`clamp(11px, calc(${Be(a)} * 0.34), 28px)`},"");v!=null&&(i.fontSize=v);const b=ze(e.radius,a=>{const S=no(a);return S==="xxxl"?"999px":S?`var(--cms-r-${S})`:typeof a=="number"?`${a}px`:String(a)});b!=null&&(i["--set-border-radius"]=b),u.style=i;const P={props:e},Z=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 S=(J=l(e.label))!=null?J:l(e.name);return typeof S=="string"?Eo(S):S}),D=ll(l((F=e.badge)!=null?F:e.notification)),$=To(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:Z,sizes:e.sizes,style:{}};e.srcset!=null&&(a.srcset=e.srcset),e.srcSet!=null&&(a.srcset=e.srcSet);const S=ze(e.fit);S!=null&&(a.style.objectFit=S),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),Q=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,$);!Q.length&&L.length&&(Q=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",Q),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]),C=JSswift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);C.class=r,C.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,y=JSswift.ui.renderSlot(s,"icon",{},u),R=JSswift.ui.renderSlot(s,"iconRight",{},i),v=E(s,"label",{},e.label),b=v.length?v:E(s,"default",{},n),P=E(null,"default",{},y),Z=E(null,"default",{},R),G=_.span(C,...P,...b.length?b:[""],...Z);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}`:""}),C=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,C,u.class]),i.style={...u.style||{}};const y=(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"}),v=y("eyebrow",e.eyebrow),b=y("label",(re=e.label)!=null?re:e.title),P=y("value",e.value),Z=y("note",(oe=e.note)!=null?oe:e.subtitle),G=y("meta",e.meta),ie=y("delta",e.delta,{trend:e.trend}),D=y("icon",R),$=y("aside",e.aside),Y=y("footer",e.footer),W=y("actions",e.actions),le=y("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"},v.length?_.div({class:"cms-stat-eyebrow"},...v):null,b.length?_.div({class:"cms-stat-label"},...b):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,Z.length?_.div({class:"cms-stat-note"},...Z):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}`:""}),C={...e},u=JSswift.omit(C,["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,C.class]),u.style={...C.style||{}};const i=(se,te,M={})=>E(s,se,M,te),y=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),v=i("title",(re=e.title)!=null?re:e.label),b=i("value",e.value),P=i("delta",e.delta,{trend:e.trend}),Z=i("note",(oe=e.note)!=null?oe:e.subtitle),G=i("meta",e.meta),ie=i("icon",y),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,v.length?_.div({class:"cms-kpi-title"},...v):null)),D.length?_.div({class:"cms-kpi-aside"},...D):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},b.length?_.div({class:"cms-kpi-value"},...b):null,P.length?_.div({class:"cms-kpi-delta"},...P):null),Z.length?_.div({class:"cms-kpi-note"},...Z):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 Ro=(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=Ro(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),C=l(e.items),u=Array.isArray(C)?C:C==null?[]:[C],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},y=$=>{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=>y(oe))}return y($)},v=[];u.forEach(($,Y)=>{v.push(...R($,Y,u.length))});const b=E(s,"default",{items:u,count:u.length},n);if(b.forEach(($,Y)=>{v.push(...R($,u.length+Y,u.length+b.length,!1))}),!v.length){const $=E(s,"empty",{items:u,count:0},e.empty);$.length&&($.length===1&&rs($[0])?v.push($[0]):v.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]),Z=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);Z.class=P,Z.style={...e.style||{}};const G=ze(e.gap,Be);return G!=null&&(Z.style["--cms-list-gap"]=G),r!=null&&r!==!1&&r!==!0&&r!=="none"&&(Z.style.listStyleType=String(r)),_[o?"ol":"ul"](Z,...v)},he.Item=(...t)=>{var L,f,m,g,F,X,a,S;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))),C=!!(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")),y=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),v=E(s,"meta",{},(g=e.meta)!=null?g:e.eyebrow),b=E(s,"body",{},(F=e.body)!=null?F:e.content),P=E(s,"default",{},n),Z=E(s,"actions",{},(X=e.actions)!=null?X:e.footer),G=(S=(a=e.aside)!=null?a:e.trailing)!=null?S:u(e.iconRight,e.iconSize||e.size,"iconRight"),ie=E(s,"aside",{},G),D=[...b,...P],$=!(C||e.clickable||e.to||i.length||y.length||R.length||v.length||Z.length||ie.length||b.length),Y=ae(["cms-item",fe(e.divider,"divider"),fe(C,"cms-clear-set"),fe(C,"cms-singularity"),fe(C,"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=y.length?_.div({class:"cms-item-title"},...y):null,te=R.length?_.div({class:"cms-item-subtitle"},...R):null,M=v.length?_.div({class:"cms-item-meta"},...v):null,Q=D.length?_.div({class:ae(["cms-item-body",fe(!(y.length||R.length||v.length),"is-standalone")])},...D):null,q=Z.length?_.div({class:"cms-item-actions"},...Z):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,Q,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),C=l(e.vertical);if(r!=null){const u=Be(r);C?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)},C=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":""),y=qe(e.stack,()=>l(e.stack)?"cms-banner-stack":""),R={...e},v=JSswift.omit(R,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);v.class=ae(["cms-clear-set","cms-banner","cms-singularity",C,u,i,y,R.class]),v.style={...R.style||{}};const b=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))&&(v.style["--cms-banner-accent"]=()=>b(e.accent),v.style["--cms-banner-border"]=()=>{const L=b(e.accent);return L?`color-mix(in srgb, ${L} 38%, var(--cms-border-color))`:""},v.style["--cms-banner-bg"]=()=>{const L=b(e.accent);return L?`color-mix(in srgb, ${L} 14%, var(--cms-panel))`:""},v.style["--cms-banner-color"]=()=>{const L=b(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"},Z=(()=>{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,Z),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,Q=[...le,...oe?[]:me,...re.length?re:M?[M]:[]];te=_.div(v,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),Q.length?_.div({class:"cms-banner-side"},...Q):null);const q=v.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}`:""}),C={...e},u=JSswift.omit(C,["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"),C.class]),u.style={...C.style||{}};const i={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},y=(()=>{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),v=E(s,"message",{},e.message!=null?e.message:n),b=E(s,"description",{},(W=e.description)!=null?W:e.subtitle),P=E(s,"meta",{},e.meta),Z=E(s,"actions",{},e.actions),G=E(s,"aside",{},e.aside),ie=E(s,"icon",{},y),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,v.length?_.div({class:"cms-alert-message"},...v):null,b.length?_.div({class:"cms-alert-description"},...b):null,P.length?_.div({class:"cms-alert-meta"},...P):null,Z.length?_.div({class:"cms-alert-actions"},...Z):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}`:""}),C={...e},u=JSswift.omit(C,["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"),C.class]),u.style={...C.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"}),y=E(s,"illustration",{},(Y=e.illustration)!=null?Y:e.media),R=E(s,"icon",{},i),v=E(s,"eyebrow",{},e.eyebrow),b=E(s,"title",{},e.title),P=E(s,"message",{},e.message!=null?e.message:n),Z=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,y.length?_.div({class:"cms-empty-state-illustration"},...y):null,R.length?_.div({class:"cms-empty-state-icon"},...R):null,v.length?_.div({class:"cms-empty-state-eyebrow"},...v):null,b.length?_.div({class:"cms-empty-state-title"},...b):null,P.length?_.div({class:"cms-empty-state-message"},...P):null,Z.length?_.div({class:"cms-empty-state-description"},...Z):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 ol=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}},Mo=(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 ol.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(Et);return}const{el:o,openIcon:r,closeIcon:C}=s;o&&(o.textContent=Et?r:C)}),Mo(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,C=null,u=null;const i=L=>Object.prototype.hasOwnProperty.call(e,L),y=i("target")||i("anchorEl")||i("triggerEl"),R=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),v=(L,f)=>{const m=l(L);if(m==null||m==="")return f;const g=Number(m);return Number.isFinite(g)?g:f},b=()=>{clearTimeout(r),clearTimeout(C),r=null,C=null},P=()=>v(e.delay,350),Z=()=>v(e.hideDelay,l(e.interactive)?120:0),G=()=>{if(b(),!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&&(y?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 S=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,S)):S,J=F.length?_.div({class:"cms-tooltip-footer"},...F):null;return _.div({class:"cms-tooltip-content"},...[h,J].filter(Boolean))},re=L=>{var a,S,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=(S=e.closeOnEsc)!=null?S: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(C),C=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(C),C=null,clearTimeout(r),r=setTimeout(()=>re(L),P())},se=(L=!1)=>{if(clearTimeout(r),r=null,!!o){if(clearTimeout(C),L){G();return}C=setTimeout(()=>G(),Z())}},te=L=>{o?se(!0):re(L)},M=()=>!!o,Q=L=>{if(!L)return()=>{};u=L;const f=[],m=()=>{b(),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 Q(g),g._tooltip={bind:Q,open:re,show:oe,hide:se,close:G,toggle:te,isOpen:M},g}return{bind:Q,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||{},C=t==="radio",u=n.appearance==="toggle",i=!C,y=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),R=Nt(s.model,n.modelName||(C?"UI.Radio:model":"UI.Checkbox:model")),v=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"]);v.type=t,v.id=y,C&&s.name!=null&&(v.name=s.name),v.class=ae([`cms-${t}`,"cms-choice-input",s.inputClass]);const b=_.input(v),P=E(r,"label",{},s.label),Z=P.length?P:E(r,"default",{},o),G=fs(s,{className:"cms-shortcode cms-choice-shortcode"}),ie=G?[...Z,G]:Z,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&&C,"cms-toggle-radio-wrap"),fe(u&&!C,"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",C?"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,b,Y,le);Ke(me,s);const re=s.iconSize?s.iconSize:s.size,oe=u?null:C?"radio_button_checked":"check",se=u?null:C?"radio_button_unchecked":null,te=u||C?null:"indeterminate_check_box",M=f=>{if(C)return b.checked=f==s.value,b.checked;const m=f==null?null:!!f;return b.checked=m===!0,b.indeterminate=i&&m==null,m},Q=()=>!C&&i&&b.indeterminate?null:!!b.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=Q(),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",!!b.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):b.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:y,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()},C?"UI.Radio:watch":"UI.Checkbox:watch"),b.addEventListener("change",f=>{var m,g;if(C)b.checked&&(R.set(s.value),(m=s.onChange)==null||m.call(s,s.value,f));else{const F=Q();R.set(F),(g=s.onChange)==null||g.call(s,F,f)}ue()})):(M(C?s.checked===!0?s.value:void 0:s.checked),b.addEventListener("change",f=>{var m,g;C?(m=s.onChange)==null||m.call(s,s.value,f):(g=s.onChange)==null||g.call(s,Q(),f),ue()})),s.onInput&&b.addEventListener("input",f=>{var m,g;C?(m=s.onInput)==null||m.call(s,s.value,f):(g=s.onInput)==null||g.call(s,Q(),f)}),ue(),an(me,s,{isEnabled:()=>!b.disabled,action:()=>{if(b.disabled)return!1;hn(b),b.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"),C=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"]);C.type="range",C.class=ae(["cms-slider-input",e.inputClass]);const u=_.input(C),i={...e.style||{}},y=l(e.size);if(y!=null){const O=typeof y=="string"&&((H=JSswift.uiSizes)!=null&&H.includes(y))?`var(--cms-size-${y})`:Be(y);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 v=_.div({class:"cms-slider-header"}),b=_.span({class:"cms-slider-label"}),P=_.span({class:"cms-slider-value"});v.append(b,P);const Z=_.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),Z.append(G,ie,D,se,te),R.append(v,Z);const M=O=>{for(;O.firstChild;)O.removeChild(O.firstChild)},Q=(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))},S=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=S(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)),Q(b,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):[];Q(P,ee,"inline-flex"),v.style.display=b.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);Q(G,ke,"inline-flex");const Ne=E(s,"iconRight",O,null),ee=Ne.length?Ne:L(e.iconRight,"iconRight",O);Q(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);Q(ie,E(s,"startLabel",O,xe),"inline-flex"),Q(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;Q(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);Q(re,ee,"inline-flex")},I=()=>{const O=a(h()),K=m(),ke=g(),Ne=F(),xe=`${S(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"),C=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=C,e.name!=null&&(u.name=e.name),u.class=ae(["cms-rating-input","cms-choice-input",e.inputClass]);const i=_.input(u),y=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"]);y.class=ae(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",fe(e.dense,"dense"),e.class]),y.style={...e.style||{}};const R=l(e.size);R!=null&&!(typeof R=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(R)))&&(y.style["--cms-rating-size"]=Be(R));const v=l(e.gap);v!=null&&(y.style["--cms-rating-gap"]=Be(v));const b=_.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(),S(ce,J,{emit:!0})}}),P=_.span({class:"cms-choice-label cms-rating-label"}),Z=_.label(y,i,b,P);Ke(Z,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():Q),M=J=>{const j=J>0?String(J):"";i.value=j,i.setAttribute("value",j),i.disabled=re()};let Q=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(b);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),S(d,k,{emit:!0})}},U);L.push({item:ce,iconHost:U,index:j}),b.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);Z.classList.toggle("is-disabled",ce),Z.classList.toggle("is-readonly",k),Z.classList.toggle("is-hovering",q!=null),Z.classList.toggle("is-clearable",d),Z.classList.toggle("is-half",le()),Z.classList.toggle("no-dimming",N);const I=Number((Se=l((ge=e.tabindex)!=null?ge:e.tabIndex))!=null?Se:0);b.tabIndex=ce?-1:I,b.setAttribute("role","slider"),b.setAttribute("aria-valuemin","0"),b.setAttribute("aria-valuemax",String(J)),b.setAttribute("aria-valuenow",String(j)),b.setAttribute("aria-disabled",ce?"true":"false"),b.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=>S(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")})},S=(J,j,U={})=>{var d,N;const ce=me(J),k=te();return Q=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 Z._input=i,Z._rating=b,Z._getValue=te,Z._setValue=J=>S(J,null,{emit:!1}),r&&r.watch(J=>{const j=me(J);serializeValue(j)!==serializeValue(Q)&&(Q=j,q=null,M(Q),a())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!r&&e.value!=null&&(Q=me(l(e.value))),a()},"UI.Rating:render"),Z};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,y,R,v,b,P,Z,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=(y=(i=t.hour)!=null?i:t.hours)!=null?y:t.h)!=null?R:t.hh),s=Number((Z=(P=(b=(v=t.minute)!=null?v:t.minutes)!=null?b:t.min)!=null?P:t.mm)!=null?Z: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 C={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(o)};return il(C,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 il(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",C=n.hour%12||12;return`${Ut(C)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""} ${r}`},Fo=(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},al=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:o=!1,minuteStep:r=5,secondStep:C=5,disabled:u=!1,readonly:i=!1,embedded:y=!1,className:R="",slotPrefix:v="",shortcuts:b=null,onSelect:P=null}=t,Z=$t(s,{withSeconds:o,min:e.min,max:e.max}),G=Z||$t(new Date,{withSeconds:o,min:e.min,max:e.max})||{hour:0,minute:0,second:0},ie=Z?it(Z):null,D=se=>v?`${v}${se[0].toUpperCase()}${se.slice(1)}`:null,$=(se,te,M)=>{const Q=[D(se),se].filter(Boolean);for(const q of Q){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:y?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(y,"is-embedded"),fe(o,"has-seconds"),R])}),me=l(b)||[];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 Q=typeof te.value=="function"?te.value({now:Xt(new Date,{withSeconds:o})}):te.value,q=$t(Q,{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 Q=_.div({class:"cms-time-column","data-time-part":te}),q=_.div({class:"cms-time-options"});return M.forEach(ue=>{var S;const L=W(te,ue),f=il(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:(S=e.use12h)!=null?S: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))}),Q.appendChild(q),Q};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(C,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},rl=(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,C)=>{const u=r.getAttribute("data-time-part")||String(C),i=n&&Number.isFinite(n[u])?n[u]:null;i!=null&&(r.scrollTop=i);const y=r.querySelector(".cms-time-option.is-selected");if(!y)return;const R=Math.max(0,r.scrollHeight-r.clientHeight),v=y.offsetTop-(r.clientHeight-y.offsetHeight)/2,b=Math.max(0,Math.min(R,v));if(Math.abs(r.scrollTop-b)<1){r.scrollTop=b;return}if(s&&typeof r.scrollTo=="function"){r.scrollTo({top:b,behavior:s});return}r.scrollTop=b})},cl=(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||{},C=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",y=n.model||(At(n.value)||Jt(n.value)?n.value:null),R=Nt(y,o?"UI.Calendar:model":"UI.Datepicker:model"),v=R?R.get():l(n.value),b=l((Pe=n.rangeAs)!=null?Pe:n.rangeModel)==="array"||Array.isArray(v),P=l((Ve=n.rangeMultipleAs)!=null?Ve:n.multipleRangeAs)==="array"||Array.isArray(v)&&Array.isArray(v[0]),Z=()=>{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:v,{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,Q=(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 b?[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)},S=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=S(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"?S(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(Q(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(!Z())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(!Z())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"&&Z()?Fo(p||null,ne,G()):F(p),Ce=(p=Ie,ne=z)=>JSON.stringify(be(p,ne)),pe=p=>jn(p,G());let Ie=j(v),_e=g(Ie),z=ee(v,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",C,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=Z()?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),Z()&&(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(!Z())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)),Z()&&(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:Z(),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&&lt()&&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&&lt()&&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:Z(),timeValue:xe()})},rt=(p={})=>{rl(A,p)},Vt=()=>{if(!Z())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 Cl,xl,kl,_l,Nl,Ll,Al,Il,zl,Pl,Jl,El,Tl,Rl,Ml,Fl,Ol,Dl,$l;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 Vl=_.div({class:"cms-date-weekdays"});Re.forEach(Mn=>Vl.appendChild(_.div({class:"cms-date-weekday"},Mn))),es.appendChild(Vl);const Bl=_.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),Hl=ks.getMonth()===Tn,jl=ut(Pt),Wl=dt(Pt),Ul=(i==="range"||i==="range-multiple")&&nt().some(It=>te(It==null?void 0:It.from,Pt)),Gl=(i==="range"||i==="range-multiple")&&nt().some(It=>te(It==null?void 0:It.to,Pt)),_s=!ye(Pt),Ns={...ge(Pt),selected:jl,inRange:Wl,rangeStart:Ul,rangeEnd:Gl,disabled:_s,outside:!Hl,value:Fe,select:()=>ft(Pt,null,{visibleMonthOffset:st})},Ls=Oe(Ns),oi=JSswift.ui.renderSlot(r,"day",Ns,String(ks.getDate())),ii=E(null,"default",Ns,oi),ai=_.button({type:"button",class:ae(["cms-date-day",fe(!Hl,"is-outside"),fe(jl,"is-selected"),fe(Wl,"is-in-range"),fe(Ul,"is-range-start"),fe(Gl,"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"},...ii),Ls.length?_.span({class:"cms-date-day-point"},...Ls):null);Bl.appendChild(ai)}return es.appendChild(Bl),es},Xe=U(),ot=ce(),pt=[w.getFullYear(),(Cl=le(se()))==null?void 0:Cl.getFullYear(),(xl=le(Xe))==null?void 0:xl.getFullYear(),(kl=le(ot))==null?void 0:kl.getFullYear(),(_l=le(l(n.defaultMonth)))==null?void 0:_l.getFullYear()];i==="range"?pt.push((Nl=le(Fe==null?void 0:Fe.from))==null?void 0:Nl.getFullYear(),(Ll=le(Fe==null?void 0:Fe.to))==null?void 0:Ll.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((Al=le(Fe))==null?void 0:Al.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((Pl=(zl=n.yearStart)!=null?zl:Xe?(Il=le(Xe))==null?void 0:Il.getFullYear():null)!=null?Pl:Bt)),sn=Number(l((Tl=(El=n.yearEnd)!=null?El:ot?(Jl=le(ot))==null?void 0:Jl.getFullYear():null)!=null?Tl: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((Rl=n.shortcuts)!=null?Rl: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:Z(),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"}),Zo=_.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(Zo);const ei=Z()?al({props:{min:l((Ml=n.timeMin)!=null?Ml:n.minTime),max:l((Fl=n.timeMax)!=null?Fl:n.maxTime),use12h:l((Dl=(Ol=n.time12h)!=null?Ol:n.use12h)!=null?Dl: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(($l=n.timeShortcuts)!=null?$l:n.timePresets),onSelect:Ge=>{const st=Wn(A);Te(Ge,null),rt({scrollState:st})}}):null,ti=_.div({class:"cms-date-footer-info"},Cn),ni=_.div({class:ae(["cms-date-footer",fe(Z(),"has-time")])},ti,_.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)),si=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:Vt},l(n.nowLabel)||"Ora")),li=Z()?_.div({class:"cms-date-time"},En,ei,si):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,li),ni))};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(C),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(Z(),"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(C),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)):Z()&&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)=>cl(t),he.Calendar=(...t)=>cl(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,S;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(y?y.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)}},C=()=>{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),y=Nt(i,"UI.Time:model"),R=y?y.get():l(e.value),v=h=>Tt(h,r()),b=h=>jn(h,r()),P=h=>Xt(h,r()),Z=h=>JSON.stringify(P(h));let G=it(v(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:b(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:(S=e.iconRight)!=null?S:"schedule",control:re,getValue:()=>le.value,onClear:()=>{l(e.disabled)||l(e.readonly)||(Q(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=b(G),te(),(h=oe._refresh)==null||h.call(oe)},Q=(h,J,j={})=>{var d,N;const U=it(v(h));if(l(e.confirm)&&j.commit!==!0)return ie=it(U),m(),U;const ce=Z(G);G=it(U),ie=it(U),M(),m(),y&&j.fromModel!==!0&&y.set(P(U));const k=Z(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={})=>{rl($,h)},L=()=>{const h=Wn($);Q(new Date,null,{commit:!l(e.confirm)}),ue({scrollState:h}),!l(e.confirm)&&e.closeOnSelect===!0&&F()},f=()=>{l(e.confirm)&&(Q(ie,null,{commit:!0}),e.closeOnSelect!==!1&&F())},m=()=>{var N,I,H,ge;if(!$)return;const h=se(),J=b(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=al({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:C(),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($);Q(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:()=>Q(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(),Q(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=>Q(le.value,h)),le.addEventListener("blur",h=>{var J;(J=e.onBlur)==null||J.call(e,h),le.value===""?Q(null,h):Q(le.value,h)})):le.addEventListener("blur",h=>{var J;return(J=e.onBlur)==null?void 0:J.call(e,h)}),y&&y.watch(h=>{const J=it(v(h));Z(J)!==Z(G)&&(G=it(J),ie=it(J),M(),m())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!y&&e.value!=null&&(G=it(v(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=>Q(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",C=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,y=Nt(e.model,"UI.Tabs:model"),R=r(e.orientation||e.orient||e.direction),v=C(e.variant||(e.pills?"pills":e.soft?"soft":"line")),b=!!l((I=(N=e.fill)!=null?N:e.navFill)!=null?I:e.stretch),P=!!l(e.wrap),Z=!!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(y?y.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-${v}`,fe(e.dense,"dense"),fe(b,"fill"),fe(P,"wrap"),fe(Z,"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 Q=_.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:v,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);Q.dataset.value=V==null?"":String(V),Q.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||Z)),K.classList.toggle("active",xe),K.setAttribute("aria-selected",xe?"true":"false"),K.setAttribute("tabindex",xe?"0":"-1")})},S=V=>{oe(V),a(V)},h=(V,O={})=>{if(Z)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||Z)return null;const ke=K.value,Ne=re(),ee=!i(Ne,ke);return S(ke),y&&!i(y.get(),ke)&&y.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||Z)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||Z,"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||Z,"disabled"),e.tabClass,V.tabClass||V.class]),type:"button",id:Ne,role:"tab",disabled:!!(V.disabled||Z),"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)),Q.appendChild(q),S(me),y?y.watch(V=>{S(le(V,!0))},"UI.Tabs:watch"):at(e.value)&&He.reactive.effect(()=>{S(le(l(e.value),!0))},"UI.Tabs:value"),Q._getValue=()=>re(),Q._setValue=V=>h(V,{emit:!0}),Q._select=V=>h(V,{emit:!0}),Q._next=()=>j(),Q._prev=()=>U(),Q._getTabs=()=>D.slice(),Ke(Q,e),Q},he.RouteTab=(...t)=>{var X,a,S,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),C=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)},y=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,v=()=>{var ye;return l((ye=e.href)!=null?ye:e.to)||"#"},b=()=>{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||""},Z=()=>{var ee,xe,be;const ye=b();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:v(),router:o,props:e});if(V instanceof RegExp)return V.test(K);const ke=y(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:C?!!l((ye=e.active)!=null?ye:e.selected):Z()},$=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=v(),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=(S=e.iconSize)!=null?S: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:v(),to:b(),external:R(v()),navigate:ye=>{var K,ke;if(G())return!1;const V=b();return!R(v())&&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||v(),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),Q=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:[b()||v()||""]),Q.length?_.span({class:"cms-route-tab-note"},...Q):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=v(),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")),b()?m.dataset.to=String(b()):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)}},!C&&b()&&(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"),C=qe(e.size,()=>{var Q;const M=l(e.size);return typeof M=="string"&&((Q=JSswift.uiSizes)!=null&&Q.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":""),y=_.nav({class:ae(["cms-breadcrumbs","cms-clear-set",C,u,i,fe(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),R=_.div({class:"cms-breadcrumbs-before"}),v=_.ol({class:"cms-breadcrumbs-list"}),b=_.div({class:"cms-breadcrumbs-after"});y.appendChild(R),y.appendChild(v),y.appendChild(b);const P=M=>{var q;const Q=l(M);return Q==null||Q===""?null:(q=JSswift.uiColors)!=null&&q.includes(Q)?`var(--cms-${Q})`:String(Q)},Z=M=>{var q;if(!M)return!1;if(l(M.external)===!0)return!0;const Q=l((q=M.href)!=null?q:M.to);return Q?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Q)):!1},G=M=>M!=null&&M.nodeType&&M.cloneNode?M.cloneNode(!0):M,ie=(M,Q)=>{M.innerHTML="",Q.forEach(q=>M.appendChild(q))},D=(M,Q,q,ue,L=null)=>{const f=JSswift.ui.getSlot(M,Q)!=null?E(M,Q,q,ue):[];return f.length?f:L&&JSswift.ui.getSlot(M,L)!=null?E(M,L,q,ue):E(null,"default",q,ue)},$=(M,Q,q)=>{const ue=l(M);return ue==null||ue===!1||ue===""?null:typeof ue=="string"?he.Icon({name:ue,size:Q}):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),Q=[],q=m=>{if(!(m==null||m===!1)){if(Array.isArray(m)){m.forEach(q);return}if(typeof m=="string"||typeof m=="number"){Q.push({label:String(m)});return}if(m!=null&&m.nodeType||typeof m=="function"){Q.push({label:m});return}Q.push(m)}},ue=l(e.home);return ue&&q(ue===!0?{label:"Home",to:"/",icon:"home"}:ue),q(M),!Q.length&&(n!=null&&n.length)&&n.forEach(m=>q(m)),Q.filter(m=>!l(m==null?void 0:m.hidden))},W=M=>{const Q=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 Q>-1?Q:l(e.autoCurrent)===!1?-1:M.length?M.length-1:-1},le=M=>{var g,F,X,a,S,h,J;const Q=Number(l((X=(F=(g=e.max)!=null?g:e.maxItems)!=null?F:e.collapseAfter)!=null?X:e.collapse)),q=Number.isFinite(Q)?Math.max(0,Math.trunc(Q)):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((S=(a=e.leadingCount)!=null?a:e.keepStart)!=null?S: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,Q=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!Z(M)&&ue&&(o!=null&&o.navigate)?(Q!=null&&Q.preventDefault&&Q.preventDefault(),o.navigate(ue),(f=M.onNavigate)==null||f.call(M,ue,Q||null),(m=e.onNavigate)==null||m.call(e,ue,M,Q||null),!0):((g=M.onNavigate)==null||g.call(M,ue||q,Q||null),(F=e.onNavigate)==null||F.call(e,ue||q,M,Q||null),!1)},re=(M,Q,q)=>{var F,X,a;const ue=M,L=q[Q+1]||null,f={index:Q,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,Q,q)=>{const ue={type:"collapsed",collapsed:!0,items:Q,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,Q,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),S=!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:Q.length,current:F,active:F,disabled:g,href:m,to:l(L.to)||"",external:Z(L),isFirst:M.index===0,isLast:M.index===Q.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"),S?`cms-state-${S}`:"",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(),Q=W(M),q=le(M),ue=P((f=e.color)!=null?f:e.state);y.classList.toggle("is-empty",M.length===0),ue?y.style.setProperty("--cms-breadcrumb-accent",ue):y.style.removeProperty("--cms-breadcrumb-accent");const L={items:M,visibleItems:q,currentIndex:Q,count:M.length,collapsed:q.some(m=>m.type==="collapsed")};if(ie(R,D(s,"before",L,e.before)),ie(b,D(s,"after",L,e.after)),v.innerHTML="",!M.length){const m=D(s,"empty",L,e.empty);m.length&&v.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...m));return}q.forEach((m,g)=>{g>0&&v.appendChild(re(q[g-1],g-1,q)),v.appendChild(m.type==="collapsed"?oe(m,M,Q):se(m,M,Q,g))})};return He.reactive.effect(()=>{te()},"UI.Breadcrumbs:render"),y.getItems=()=>Y(),y.getVisibleItems=()=>le(Y()),y.refresh=()=>(te(),y),y.setItems=M=>(r?r.set(M):e.items=M,te(),y),Ke(y,e),y},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"}),C=_.div({class:"cms-pagination-controls"}),u=_.div({class:"cms-pagination-start"}),i=_.div({class:"cms-pagination-pages"}),y=_.div({class:"cms-pagination-end"}),R=_.div({class:"cms-pagination-summary"});C.appendChild(u),C.appendChild(i),C.appendChild(y),r.appendChild(C),r.appendChild(R);let v=1,b=1;const P=(a,S=0)=>{const h=l(a);if(h==null||h==="")return S;const J=Number(h);return Number.isFinite(J)?Math.trunc(J):S},Z=(a,S=G())=>{const h=Number(a),J=Number.isFinite(h)?Math.trunc(h):1;return Math.min(Math.max(J||1,1),Math.max(1,S||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 S=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 S>=0&&h>0?Math.max(1,Math.ceil(S/h)):1},ie=()=>{var a,S,h;return P(s?s.get():(h=(S=(a=e.page)!=null?a:e.value)!=null?S:e.current)!=null?h:e.currentPage,1)},D=()=>{var a,S;return Math.max(0,P((S=(a=e.siblings)!=null?a:e.siblingCount)!=null?S:e.window,1))},$=()=>{var a,S;return Math.max(0,P((S=(a=e.boundaryCount)!=null?a:e.boundaries)!=null?S: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),Q=()=>{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 S=Number(a);return Number.isFinite(S)?Math.max(0,Math.trunc(S)):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 S=Number(a);return Number.isFinite(S)&&S>0?Math.trunc(S):null},ue=(a=v,S=b)=>{const h=Q(),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:S,max:S,total:h,pageSize:J,from:j,to:U,disabled:Y(),isFirst:a<=1,isLast:a>=S,canPrev:a>1,canNext:a<S,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(S,ce)}},L=(a,S)=>{if(S<=0)return[];const h=[],J=new Set,j=$(),U=D();for(let k=1;k<=Math.min(j,S);k++)J.add(k);for(let k=Math.max(1,a-U);k<=Math.min(S,a+U);k++)J.add(k);for(let k=Math.max(1,S-j+1);k<=S;k++)J.add(k);let ce=0;for(let k=1;k<=S;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,S,h,J=null)=>{const j=JSswift.ui.getSlot(n,a)!=null?E(n,a,h,S):[];return j.length?j:J&&JSswift.ui.getSlot(n,J)!=null?E(n,J,h,S):E(null,"default",h,S)},m=(a,S)=>{a.innerHTML="",S.forEach(h=>a.appendChild(h))},g=(a,S,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,S,j,a==="summary"?"label":a==="page"?"item":null))},F=(a,S)=>{v=Z(a,S),b=Math.max(1,S||1);const h=ue(v,b);r.style.display=M()&&b<=1?"none":"",R.style.display=W()?"":"none",i.style.display=le()?"":"none",u.innerHTML="",i.innerHTML="",y.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:v<=1})),me()&&u.appendChild(g("prev","Prev",ce=>X(v-1,ce),{disabled:v<=1})),le()&&L(v,b).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===v};i.appendChild(he.Btn({class:ae(["cms-pagination-btn","cms-pagination-page-btn",fe(k===v,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:k===v?e.color||e.state||"primary":null,outline:k!==v,disabled:Y(),"aria-current":k===v?"page":null,onClick:N=>X(k,N)},...f("page",String(k),d,"item")))}),re()&&y.appendChild(g("next","Next",ce=>X(v+1,ce),{disabled:v>=b})),te()&&y.appendChild(g("last","\xBB",ce=>X(b,ce),{disabled:v>=b}));const j=f("end",e.end,h);j.length&&y.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...j));let U=`Pagina ${v} di ${b}`;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,S=null)=>{var j,U;const h=G(),J=Z(a,h);return J===v&&h===b||(F(J,h),s&&s.get()!==J&&s.set(J),(j=e.onChange)==null||j.call(e,J,ue(J,h),S),(U=e.onPageChange)==null||U.call(e,J,ue(J,h),S)),J};return He.reactive.effect(()=>{const a=G(),S=ie(),h=Z(S,a);F(h,a),s&&S!==h&&s.set(h)},"UI.Pagination:sync"),r.getPage=()=>v,r.getPages=()=>b,r.setPage=a=>X(a),r.prev=()=>X(v-1),r.next=()=>X(v+1),r.first=()=>X(1),r.last=()=>X(b),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:""},C=qe(e.state,()=>{const W=mt(l(e.state));return W?`cms-state-${W}`:""}),u=ae(["cms-spinner",C,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 y={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(y,"backgroundColor")&&delete y.backgroundColor,i.style=y,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},v=E(s,"label",R,e.label),b=E(s,"default",R,n),P=E(s,"note",R,e.note),Z=v.length||b.length||P.length;if(!Z){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),Z&&D.push(_.div({class:"cms-spinner-content"},v.length?_.div({class:"cms-spinner-label"},...v):null,b.length?_.div({class:"cms-spinner-copy"},...b):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"),C=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),y=()=>{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"},v=(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)},b=ee=>{const xe=i(),be=y(),Ce=u(ee,xe);return Math.min(be,Math.max(xe,Ce))},P=ee=>{const xe=i(),Ce=y()-xe;if(!Ce)return 0;const pe=(b(ee)-xe)/Ce,Ie=l(e.reverse)?1-pe:pe;return Math.max(0,Math.min(1,Ie))},Z=ee=>{const xe=b(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(b(r?r.get():(H=(I=l(e.value))!=null?I:l(e.min))!=null?H:0)),[re,oe]=JSswift.reactive.signal(Z((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=b(ee);return le()!==be&&me(be),re()<be&&oe(be),r&&xe.fromModel!==!0&&r.set(be),be},te=ee=>{const xe=Z(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"]),Q={width:l(e.width)||"100%",...e.style||{}},q=l(e.color);(q!=null||at(e.color))&&!mt(q||"")&&delete Q.backgroundColor,M.class=ae(["cms-progress-wrap",fe(e.dense,"dense"),fe(e.reverse,"is-reverse"),fe(e.indeterminate,"is-indeterminate"),C,e.class]),M.style=Q;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"}),S=_.span({class:"cms-progress-buffer"}),h=_.span({class:ae(["cms-progress-bar","cms-singularity",C,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(S,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:y(),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:y(),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:y(),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=y(),pe=P(ee)*100,Ie=P(xe)*100,_e=v(e.color,""),z=v(e.trackColor,_e?`color-mix(in srgb, ${_e} 14%, transparent)`:"rgba(255,255,255,0.08)"),we=v(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,S.style.background=we,S.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=S,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),C=()=>{const I=r(),H=o(l(n.max),100);return H<I?I:H},u=I=>{const H=r(),ge=C(),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),y=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),v=Nt(R,"UI.LoadingBar:model"),b=At(n.buffer)||Jt(n.buffer)?n.buffer:null,P=Nt(b,"UI.LoadingBar:buffer"),Z=v?v.get():(d=l(n.value))!=null?d:r(),G=P?P.get():(N=l(n.buffer))!=null?N:Z,[ie,D]=JSswift.reactive.signal(u(Z)),[$,Y]=JSswift.reactive.signal(Math.max(u(G),u(Z))),[W,le]=JSswift.reactive.signal(n.visible!=null?!!l(n.visible):u(Z)>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)),v&&H.fromExternal!==!0&&v.set(ge),ge},Q=(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=Q(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},S=(I=(H=>(H=l(n.startValue))!=null?H:12)())=>{se();const ge=Math.max(ie(),u(I));return M(ge),Q(Math.max($(),ge)),q(ge),ue(),m},h=(I=(H=>(H=l(n.resetValue))!=null?H:r())())=>{se(),oe();const ge=u(I);return Q(ge),M(ge),q(ge),m},J=(I=(H=>(H=l(n.doneValue))!=null?H:C())())=>{var ye;se(),oe();const ge=u(I);Q(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=S,m.done=J,m.complete=J,m.stop=j,m.reset=h,m.show=U,m.hide=ce,m.destroy=k,m._dispose=k,v?v.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=>{Q(I,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):at(n.buffer)&&JSswift.reactive.effect(()=>{Q(l(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const I=r(),H=C(),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&&y(n.target).appendChild(m),l(n.autoStart)&&S(),m};const ul=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),Oo=new Set(["soft","solid","outline"]),Do={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},$o={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},dl=t=>{const e=String(l(t)||"").trim().toLowerCase();return e?ul.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"},Vo=t=>{const e=String(l(t)||"").trim().toLowerCase();return Oo.has(e)?e:"soft"},Bo=(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,y,R,v,b,P,Z,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=Bo((i=(u=n.timeout)!=null?u:n.duration)!=null?i:n.delay,s),r=(v=(R=(y=n.closable)!=null?y:n.dismissible)!=null?R:n.dismiss!=null)!=null?v:o===0,C=n.title===void 0?n.label===void 0?Do[s]:n.label:n.title;return{...n,type:s,state:s,title:C,message:(Z=(P=(b=n.message)!=null?b:n.content)!=null?P:n.text)!=null?Z: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:dl(n.position),variant:Vo(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},fl=(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),y={...u};return!y.type&&!y.state&&!y.color&&e&&(y.type=e),y.title==null&&n&&(y.title=n),i.length&&(y.message==null&&y.description==null&&y.body==null&&i.length===1?y.message=i[0]:y.body==null&&(y.body=i.length===1?i[0]:i)),Gt(y,e)}const[s,o,r]=t;let C={};return ln(o)?C={...o,message:s}:ln(r)?C={...r,message:s,title:o}:C={message:s,title:o},e&&!C.type&&!C.state&&!C.color&&(C.type=e),C.title==null&&n&&(C.title=n),Gt(C,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,fl(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,fl(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,C,u,i,y,R,v,b,P,Z,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=(C=He.services.notify)==null?void 0:C.update)==null||u.call(C,s,Gt(W,"success")):(y=(i=He.services.notify)==null?void 0:i.show)==null||y.call(i,Gt(W,"success")):s!=null&&((v=(R=He.services.notify)==null?void 0:R.remove)==null||v.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=(b=He.services.notify)==null?void 0:b.update)==null||P.call(b,s,Gt(Y,"danger")):(G=(Z=He.services.notify)==null?void 0:Z.show)==null||G.call(Z,Gt(Y,"danger")):s!=null&&((D=(ie=He.services.notify)==null?void 0:ie.remove)==null||D.call(ie,s)),$}},he.Header=(...t)=>{var S,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),C=(S=e.drawerStateKey)!=null?S:qt;C&&(qt=C,Et=en(C));const u=()=>en(C),i=()=>Wt(!0,C),y=()=>Wt(!1,C),R=()=>Wt(!u(),C),v={props:e,stateKey:C,isDrawerOpen:u,openDrawer:i,closeDrawer:y,toggleDrawer:R,toggleAside:R},b=(d,N)=>{if(!(N==null||N===!1)){if(Array.isArray(N)){N.forEach(I=>b(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,v,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(v)),V=on(JSswift.ui.slot(ye));Se.replaceChildren(),Array.isArray(V)?V.forEach(O=>b(Se,O)):b(Se,V)},`UI.Header:${d}`),[Se]}return E(s,d,v,I(N))},Z=(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",v,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")&&ol.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,Z),te=P("eyebrow",(k=e.eyebrow)!=null?k:e.kicker),M=P("title",W),Q=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,Q.length?_.div({class:ae(["cms-header-subtitle",e.subtitleClass])},...Q):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),C=(be=e.stateKey)!=null?be:qt;C&&(qt=C,Et=en(C));const u=()=>en(C),i=()=>Wt(!0,C),y=()=>Wt(!1,C),R=()=>Wt(!u(),C),v={props:e,stateKey:C,isDrawerOpen:u,openDrawer:i,closeDrawer:y,toggleDrawer:R,toggleAside:R},b=JSswift==null?void 0:JSswift.store,P=!!(b!=null&&b.get&&(b!=null&&b.set)),Z=`${C}:groups`,G=`${C}:active`;let ie=P?b.get(Z,{})||{}:{},D=P&&(Ce=b.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=v)=>{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",Q=(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&&b.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)]:[]},S=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},b.set(Z,ie))},U=()=>{const c={...v,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",{...v,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}=S(B),ut=mt(l(B.state)||l(B.color)||""),dt=m(B,Me),bt=dt||q(je),lt=!!l(B.disabled),ft={...v,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:Q,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)&&y())}},...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)&&y())}},...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(C)||new Set;return xe.add(ee),hs.set(C,xe),Wt(Et,C),ee.isDrawerOpen=u,ee.openDrawer=i,ee.closeDrawer=y,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=(S,h)=>{var J;return!!(S&&S.nodeType===1&&((J=S.classList)!=null&&J.contains(`cms-page-${h}`)))},C=S=>S==null?null:typeof S=="string"?he.Icon({name:S,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(S,{as:"icon"}),u={dense:!!l(e.dense),flat:!!l(e.flat),centered:!!l(e.centered),narrow:!!l(e.narrow)},i=(S,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(J=>i(S,J));return}if(h!=null&&h.nodeType){S.appendChild(h);return}S.appendChild(document.createTextNode(String(h)))}},y=(S,h,J=j=>j)=>{const j=JSswift.ui.getSlot(s,S);if(j!=null)return E(s,S,u,null);if(typeof h=="function"){const U=new Set(["eyebrow","title","subtitle"]),ce=_[U.has(S)?"span":"div"]({class:`cms-page-slot-${S}`});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:${S}`),[ce]}return E(s,S,u,J(h))},R=E(s,"default",u,n!=null&&n.length?n:[]),v={hero:[],header:[],body:[],footer:[],actions:[]},b=[];R.forEach(S=>{r(S,"hero")?v.hero.push(S):r(S,"header")?v.header.push(S):r(S,"body")?v.body.push(S):r(S,"footer")?v.footer.push(S):r(S,"actions")?v.actions.push(S):b.push(S)});const P=y("icon",e.icon,C),Z=y("hero",(g=e.hero)!=null?g:e.banner),G=y("eyebrow",(F=e.eyebrow)!=null?F:e.kicker),ie=y("title",e.title),D=y("subtitle",(X=e.subtitle)!=null?X:e.description),$=y("header",e.header),Y=y("aside",e.aside),W=y("body",(a=e.body)!=null?a:e.content),le=y("footer",e.footer),me=y("actions",e.actions),re=Z.length?_.div({class:ae(["cms-page-hero",e.heroClass])},...Z):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,...b],M=te.length?_.div({class:ae(["cms-page-body",e.bodyClass])},...te):null,Q=[...me,...v.actions],q=le.length||Q.length?_.div({class:ae(["cms-page-footer",e.footerClass])},...le,Q.length?_.div({class:"cms-page-actions"},...Q):null):null,ue=!!(Z.length||v.hero.length),L=!!(oe||v.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,...v.hero,se,...v.header,M,...v.body,q,...v.footer);return Ke(m,e),m},he.AppShell=(...t)=>{var S,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,C=l(e.reverse)===!0,u=l(e.stack)===!0,i=(h=(S=e.drawerStateKey)!=null?S:e.stateKey)!=null?h:qt;i&&(qt=i,Et=en(i));const y={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 v=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),v=he.Header(R));const b=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},P=o(e,"drawerItems")?e.drawerItems:e.items,Z=o(e,"drawerHeader")?e.drawerHeader:void 0;let G=e.drawer;!o(e,"drawer")&&!r&&(Object.keys(b).length||P!=null||Z!=null)&&(!o(b,"items")&&P!=null&&(b.items=P),!o(b,"header")&&Z!=null&&(b.header=Z),o(b,"stateKey")||(b.stateKey=i),G=he.Drawer(b));const ie=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},D=o(e,"content")?e.content:n,$=E(s,"default",y,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",y,le)));const re=E(s,"header",y,v),oe=r?[]:E(s,"drawer",y,G),se=E(s,"page",y,Y),te=E(s,"footer",y,me),M=ae(["cms-app","cms-app-shell",fe(r,"no-drawer"),fe(C,"is-reverse"),fe(u,"is-stack"),fe(e.flush,"is-flush"),fe(e.divider,"is-divider"),e.class]),Q=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"]);Q.class=M,Q.style={...e.style||{}};const q=ze(e.drawerWidth,Be);q!=null&&(Q.style["--cms-app-shell-drawer-width"]=q);const ue=ze(e.gap,Be);ue!=null&&(Q.style["--cms-app-shell-gap"]=ue);const L=ze(e.padding,Be);L!=null&&(Q.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=C?[g,m]:[m,g],a=_.div(Q,...f?[f]:[],_.div({class:"cms-app-shell-body"},...X.filter(Boolean)),...F?[F]:[]);return a.openDrawer=y.openDrawer,a.closeDrawer=y.closeDrawer,a.toggleDrawer=y.toggleDrawer,a.isDrawerOpen=y.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 C=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})`},y=(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)},v=E(o,"badge",R,n.badge),b=E(o,"background",R,n.backgroundContent),P=E(o,"eyebrow",R,(J=n.eyebrow)!=null?J:n.kicker),Z=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=v.length?_.div({class:ae(["cms-parallax-badge",n.badgeClass])},...v):null,se=P.length||Z.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,Z.length?_.div({class:ae(["cms-parallax-title",n.titleClass])},...Z):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,Q=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",C,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])},b.length?_.div({class:ae(["cms-parallax-bg-content",n.backgroundContentClass])},...b):null),f=_.div({class:ae(["cms-parallax-content",n.contentClass,n.innerClass])},oe,te,M,Q,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)},S=()=>{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=y(n.speed,.18),k=Math.abs(y(n.maxOffset,96)),d=l(n.startTop),N=d!=null&&d!==""?(U.top-y(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,S()}))}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 Ho(){for(const t of Yn.keys())ys(t);Kn([])}function ml(t){t!=null&&t.id&&(ys(t.id),t.timeout>0&&Yn.set(t.id,setTimeout(()=>{ws(t.id)},t.timeout)))}function gl(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&&ml(n),(n==null?void 0:n.id)||null}function jo(t){const e=()=>ws(t.id),n=(ie={})=>gl(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=$o[t.type];return ie?he.Icon({name:ie,size:"sm"}):null})(),C=E(t.slots,"icon",s,r),u=E(t.slots,"title",s,o(t.title)),i=E(t.slots,"message",s,o(t.message)),y=E(t.slots,"description",s,o(t.description)),R=E(t.slots,"meta",s,o(t.meta)),v=E(t.slots,"actions",s,o(t.actions)),b=E(t.slots,"default",s,o(t.body)),P=E(t.slots,"dismiss",s,o(t.dismiss)),Z=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},C.length?_.div({class:"cms-toast-icon"},...C):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,y.length?_.div({class:"cms-toast-description"},...y):null,b.length?_.div({class:"cms-toast-body"},...b):null,R.length?_.div({class:"cms-toast-meta"},...R):null),v.length?_.div({class:"cms-toast-actions"},...v):null),Z.length?_.div({class:"cms-toast-dismiss"},...Z):null);return Ke(G,t),G}function Wo(){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=dl(s.position);n.has(o)||n.set(o,[]),n.get(o).push(s)}for(const s of ul){const o=n.get(s);if(!(o!=null&&o.length))continue;const r=_.div({class:ae(["cms-toast-wrap",`is-${s}`])},...o.map(C=>jo(C)));t.appendChild(r)}},"JSswiftUI:toasts"),t)}function Uo(t={}){Wo();const e=Gt(t);return e.id=e.id||Math.random().toString(36).slice(2),Kn([...Gn().filter(n=>n.id!==e.id),e]),ml(e),e.id}He.services.notify.show=Uo,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=gl,He.services.notify.remove=ws,He.services.notify.clear=Ho,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,C=JSswift.form._isPromise(r)?await r:r;return C===!0?null:typeof C=="string"?C:C===!1?o||"Valore non valido":C?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({}),C=_.rod({}),u=_.rod(!1),i=_.rod(null),y=()=>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)}},v=re=>{const oe=y();return oe?oe[re]:void 0},b=(re,oe)=>{const se={...y()||{}};se[re]=oe,R(se)},P=(re,oe)=>{const se={...r.value||{}};oe?se[re]=oe:delete se[re],r.value=se},Z=re=>(r.value||{})[re]||null,G=re=>{C.value={...C.value||{},[re]:!0}},ie=re=>!!(C.value||{})[re],D=async re=>{const oe=n[re]||[];if(!oe.length)return P(re,null),!0;const se=v(re),te={name:re,value:se,model:y(),form:me};for(const M of oe){if(!M)continue;const Q=await JSswift.form._runRule(M,se,te);if(Q)return P(re,Q),!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:C,submitting:u,submitError:i,getValue:v,setValue:b,getError:Z,setError:P,touch:G,isTouched:ie,field:(re,oe={})=>{var F;const se=_.rod("");(F=se.action)==null||F.call(se,X=>{b(re,X)});const te=()=>s==="submit"||s==="input"||s==="blur"?!0:ie(re);let M=null,Q=!1,q=!1;const ue=async()=>{Q||(Q=!0,G(re),(s==="blur"||s==="input")&&await D(re),setTimeout(()=>{Q=!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,Q=!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()?Z(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={},C.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(y(),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]),C=JSswift.omit(e,["form","onSubmit"]);C.class=r;const u=_.form({...C,onSubmit:async y=>{y.preventDefault(),s&&await s.submit(o||(async()=>{}))}}),i=[];for(const y of n||[]){const R=typeof y=="function"?y(s):y,v=JSswift.ui.slot(R);v&&(Array.isArray(v)?i.push(...v):i.push(v))}return i.forEach(y=>u.appendChild(y)),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 hl(){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 C={...e.style||{}},u=ze(e.align);u!=null&&!We(e,"align")&&(C.alignItems=u);const i=ze(e.justify);i!=null&&!We(e,"justify")&&(C.justifyContent=i);const y=ze(e.wrap,P=>P?"wrap":"nowrap");y!=null&&!We(e,"wrap")&&(C.flexWrap=y);const R=ze(e.direction);R!=null&&!We(e,"direction")&&(C.flexDirection=R);const v=ze(e.gap,Be);v!=null&&!We(e,"gap")&&(C.gap=v),Object.keys(C).length&&(r.style=C),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const b=_.div(r,...E(s,"default",{},n));return Ke(b,e),b},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 C=_.div(r,...E(s,"default",{},n));return Ke(C,e),C},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 C={...e.style||{}},u=ze(e.align);u!=null&&!We(e,"align")&&(C.alignItems=u);const i=ze(e.justify);i!=null&&!We(e,"justify")&&(C.justifyContent=i);const y=ze(e.wrap,P=>P?"wrap":"nowrap");y!=null&&!We(e,"wrap")&&(C.flexWrap=y);const R=ze(e.direction);R!=null&&!We(e,"direction")&&(C.flexDirection=R);const v=ze(e.gap,Be);v!=null&&!We(e,"gap")&&(C.gap=v),Object.keys(C).length&&(r.style=C),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const b=_.div(r,...E(s,"default",{},n));return Ke(b,e),b},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 C={...e},u=null,i=null;const y=(f,m)=>typeof f=="function"?f(m):f,R=f=>String(f||"").split(/\s+/).filter(Boolean),v=(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},b=(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,S,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((S=f==null?void 0:f.offsetTop)!=null?S: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}},Z=f=>{if(!(f!=null&&f.panel))return;const{left:m,top:g,width:F,height:X}=P();b(f.panel,"position","fixed"),b(f.panel,"inset",0,a=>`${a}px`),b(f.panel,"top",g,a=>`${a}px`),b(f.panel,"left",m,a=>`${a}px`),b(f.panel,"right","auto"),b(f.panel,"bottom","auto"),b(f.panel,"width",F,a=>`${a}px`),b(f.panel,"height",X,a=>`${a}px`),b(f.panel,"min-height",X,a=>`${a}px`),b(f.panel,"max-width",F,a=>`${a}px`),b(f.panel,"max-height",X,a=>`${a}px`),b(f.panel,"min-width",0,a=>`${a}px`),b(f.panel,"margin",0,a=>`${a}px`),b(f.panel,"box-sizing","border-box"),b(f.panel,"border-width",0,a=>`${a}px`),b(f.panel,"border-radius",0,a=>`${a}px`),b(f.panel,"transform","none"),b(f.panel,"overflow","hidden"),b(f.panel,"--cms-dialog-fullscreen-left",m,a=>`${a}px`),b(f.panel,"--cms-dialog-fullscreen-top",g,a=>`${a}px`),b(f.panel,"--cms-dialog-fullscreen-width",F,a=>`${a}px`),b(f.panel,"--cms-dialog-fullscreen-height",X,a=>`${a}px`)},G=f=>{f!=null&&f.panel&&(b(f.panel,"position",null),b(f.panel,"inset",null),b(f.panel,"top",null),b(f.panel,"left",null),b(f.panel,"right",null),b(f.panel,"bottom",null),b(f.panel,"width",null),b(f.panel,"height",null),b(f.panel,"min-height",null),b(f.panel,"max-width",null),b(f.panel,"max-height",null),b(f.panel,"min-width",null),b(f.panel,"margin",null),b(f.panel,"box-sizing",null),b(f.panel,"border-width",null),b(f.panel,"border-radius",null),b(f.panel,"transform",null),b(f.panel,"overflow",null),b(f.panel,"--cms-dialog-fullscreen-left",null),b(f.panel,"--cms-dialog-fullscreen-top",null),b(f.panel,"--cms-dialog-fullscreen-width",null),b(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=()=>Z(f),S=()=>{g!=null&&X(g),g=F(()=>{g=null,a()})};a(),S(),window.addEventListener("resize",a),window.addEventListener("orientationchange",S),(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",S),f._dialogViewportCleanup=()=>{var k,d,N,I;g!=null&&(X(g),g=null),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",S),(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",S)}},D=()=>C,$=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:Q,dismiss:Q,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,y(f.eyebrow,m)),X=E(s,"title",m,y((ge=(H=f.title)!=null?H:f.heading)!=null?ge:f.header,m)),a=E(s,"subtitle",m,y((Se=f.subtitle)!=null?Se:f.description,m)),S=E(s,"icon",m,g),h=E(s,"header",m,y((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,y(j,m));U.length||(U=E(s,"body",m,y(j,m))),U.length||(U=E(s,"default",m,y(j,m)));const ce=y((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||S.length||J.length)&&(d=_.div({class:"cms-dialog-head"},S.length?_.div({class:"cms-dialog-icon"},...S):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);v(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)]),v(f.overlay,"_dialogOverlayClassTokens",[le(m),l(m.backdropBlur)?"cms-dialog-overlay-blur":"",...R(m.overlayClass)]),b(f.panel,"--cms-dialog-width",l(m.width),Be),b(f.panel,"--cms-dialog-min-width",l(m.minWidth),Be),b(f.panel,"--cms-dialog-max-width",l(m.maxWidth),Be),b(f.panel,"--cms-dialog-max-height",l(m.maxHeight),Be),b(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"&&(C={...C,...f}),u&&(oe(u),se()),L),M=(f=null)=>{var X,a,S,h,J;if(f&&typeof f=="object"&&(C={...C,...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:(S=m.closeOnEsc)!=null?S:!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]")&&Q()};return u.panel.addEventListener("click",F),oe(u),bn(u),(J=(h=D()).onOpen)==null||J.call(h,u),u},Q=()=>{if(!u)return;const f=u;yn(f,()=>JSswift.overlay.close(f.id))},q=()=>!!u,ue=(f=null)=>q()?(Q(),null):M(f),L={open:M,close:Q,toggle:ue,update:te,isOpen:q,entry:()=>u,props:()=>({...C})};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"),C=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",y=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)},v=u(e.orientation||e.orient||e.direction),b=i(e.navPosition||e.barPosition||e.position),P=y(e.variant||(e.pills?"pills":e.soft?"soft":"line")),Z=!!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",v,`variant-${P}`,fe(Z,"wrap"),fe(D,"animated"),fe($,"nav-fill"),fe(Y,"disabled"),fe(b==="after","nav-after"),e.class]),Q=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"]);Q.class=M,Q.style=e.style;const q=_.div(Q);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":v}),L=_.div({class:ae(["cms-tabpanel-panels",e.panelsClass])}),f=[],m=[];let g=-1;const F=()=>v==="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},S=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=`${C}-tab-${A}`,Je=`${C}-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),S(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),S(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"}),S(rt));return}if(_t.includes(ft)){lt.preventDefault();const rt=a(A,1,ie);rt>=0&&(Se(rt,{dir:"next"}),S(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=`${C}-tab-${A}`,Je=`${C}-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:v,position:b,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"),b==="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 Go(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function vs({title:t,message:e,contentNode:n,okText:s,cancelText:o,showCancel:r,onOk:C,onCancel:u,persistent:i}){hl();const y=_.div({class:"cms-dialog-backdrop",onClick:G=>{G.target===y&&i!==!0&&(u==null||u())}}),R=E(null,"default",{},t),v=E(null,"default",{},e),b=E(null,"default",{},n),P=_.div({class:"cms-dialog cms-panel"},R.length?_.h3(...R):null,v.length?_.p(...v):null,...b,_.div({class:"cms-dialog-actions"},r?JSswift.ui.Btn({onClick:u},o||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:C},s||"OK")));y.appendChild(P),hl().appendChild(y);const Z=G=>{G.key==="Escape"&&(u==null||u())};return document.addEventListener("keydown",Z,{once:!0}),{backdrop:y,close:()=>Go(y)}}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 pl(){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;