cmswift 1.0.1 → 1.0.3
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/cmswift.js +10 -10
- package/dist/cmswift.min.js +34 -0
- package/dist/css/min-ui.css +1 -1
- package/dist/css/ui.css +0 -19944
- package/dist/css/ui.min.css +1 -0
- package/dist/min-cmswift.js +1 -1
- package/package.json +3 -2
- package/dist/css/tabler-icons-out.css +0 -19942
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
(()=>{var Cn,Lo,Eo,zo,wt,to,E,no,Zt;window.CMSwift=window.CMSwift||{};const oe=window.CMSwift;window._=window.CMSwift,oe.config=oe.config||{};const ot=typeof globalThis!="undefined"&&globalThis.CMSwift_setting?globalThis.CMSwift_setting:{};oe.config.debug=(Cn=ot.modeDev)!=null?Cn:!1,oe.isDev=function(){return oe.config.debug},oe.uiNormalizeArgs=function(r){let S={},n=r;return r.length>0&&typeof r[0]=="object"&&r[0]!==null&&!r[0].nodeType&&!Array.isArray(r[0])&&!(r[0]instanceof Function)&&(S=r[0],n=r.slice(1)),{props:S,children:n}},oe.uiSizes=["xxs","xs","sm","md","lg","xl","xxl","xxxl"],oe.uiColors=["primary","secondary","success","warning","danger","info","light","dark"],oe.meta=oe.meta||{version:"1.0.3",policy:{sourceOfTruth:"docs/reference/core.md",syncRule:"Quando cambia un modulo core, aggiornare sia questo meta sia docs/reference/core.md."},modules:{render:{description:"Bridge props -> DOM per hyperscript _, attributi, class, style, eventi e children reattivi.",entrypoints:["createElement","setProp","bindProp"],status:"milestone-3-closed",knownLimits:["Il mini-terzo-giro e il successivo micro-giro avanzato hanno chiuso style dinamico, eventi, children e props/attr speciali, ma restano altri edge case avanzati da esplorare.","Gli eventi ora supportano composizione base di listener multipli, ma non hanno ancora delegation o diff avanzato.","Restano da esplorare edge case avanzati del renderer oltre ai giri gia coperti dai test."]},reactive:{description:"Core minimale signal/effect usato come base della reattivita.",entrypoints:["CMSwift.reactive.signal","CMSwift.reactive.effect","CMSwift.reactive.computed","CMSwift.reactive.untracked","CMSwift.reactive.batch"],status:"milestone-2-closed",knownLimits:["La protezione loop copre i loop sincroni per singolo effect, non ancora i cicli complessi tra effect multipli.","Il batching sincrono ora esiste, ma manca ancora scheduling configurabile oltre il flush immediato a fine batch.","Mancano primitive avanzate per controllare scheduling e transazioni asincrone."]},rod:{description:"Layer reattivo di alto livello per binding DOM, model e interpolazioni.",entrypoints:["_.rod","CMSwift.rodBind","CMSwift.rodModel"],status:"milestone-2-closed",knownLimits:["Va chiarito meglio il rapporto con CMSwift.reactive oltre al primo riallineamento strutturale.","Restano casi avanzati di model/binding da esplorare oltre al primo giro coperto dai test.","Il modulo e piu pulito internamente ma non e ancora il punto finale della convergenza con il renderer."]},mount:{description:"Mount, component instances e cleanup automatico del tree DOM.",entrypoints:["CMSwift.mount","CMSwift.component","CMSwift.enableAutoCleanup"],status:"milestone-2-closed",knownLimits:["Il lifecycle e piu pulito internamente ma resta da chiarire meglio la semantica su multi-mount e cloni.","Restano da esplorare edge case avanzati del cleanup automatico fuori dal primo giro gia coperto."]},platform:{description:"Moduli applicativi nel core: overlay, store, auth, http, router, UI meta.",entrypoints:["CMSwift.overlay","CMSwift.store","CMSwift.plugins.auth","CMSwift.http","CMSwift.router","CMSwift.ui.meta"],status:"milestone-2-closed",knownLimits:["Il secondo giro ha ripulito i moduli interni, ma mancano ancora demo separate per modulo e una validazione piu formale di alcune superfici pubbliche.","Esiste una demo browser aggregata del blocco platform, ma non ancora demo separate per ogni modulo.","Mancano configurazione pubblica piu coerente e confini piu netti tra auth, http e router.","Il registry UI meta non ha ancora validazione formale del suo shape."]}}},oe.omit=(r,S)=>{const n={},W=new Set(S||[]);for(const l in r||{})W.has(l)||(n[l]=r[l]);return n},oe._cleanupRegistry=new WeakMap,oe._registerCleanup=function(r,S){if(!r||typeof S!="function")return S;const n=oe._cleanupRegistry.get(r)||[];return n.push(S),oe._cleanupRegistry.set(r,n),S},oe.dom={q(r,S=document){return S.querySelector(r)},qa(r,S=document){return Array.from(S.querySelectorAll(r))},attr(r,S,n){return r?n===void 0?r.getAttribute(S):(n===null?r.removeAttribute(S):r.setAttribute(S,String(n)),r):null}},(()=>{let r=[],S=!1;function n(){if(S)return;S=!0;const W=r.slice();r.length=0;for(const l of W)try{l()}catch(ue){console.error("[CMSwift.ready] error:",ue)}}oe.ready=function(W){typeof W=="function"&&(S||document.readyState==="interactive"||document.readyState==="complete"?queueMicrotask(()=>{try{W()}catch(l){console.error("[CMSwift.ready] error:",l)}}):r.push(W))},document.addEventListener("DOMContentLoaded",n,{once:!0})})(),oe.reactive=(()=>{let r=null;const S=[],n=100;let W=0,l="sync",ue="sync",a=!1;const ge=new Set;function ee(Ie){const He=Ie==null?void 0:Ie.flush;if(He==null||He==="sync")return"sync";if(He==="microtask")return"microtask";throw new Error("CMSwift.reactive.batch: options.flush must be 'sync' or 'microtask'")}function A(){for(;ge.size;){const Ie=Array.from(ge);ge.clear(),Ie.forEach(He=>He())}}function de(){a||(a=!0,queueMicrotask(()=>{a=!1,ue="sync",A()}))}function Se(Ie){const He=Array.from(Ie);if(W>0||ue==="microtask"){He.forEach(Ke=>ge.add(Ke)),W===0&&ue==="microtask"&&de();return}He.forEach(Ke=>Ke())}function Fe(Ie){if(Ie&&(Ie._deps.size&&(Ie._deps.forEach(He=>He.delete(Ie._runner)),Ie._deps.clear()),typeof Ie._cleanup=="function")){const He=Ie._cleanup;Ie._cleanup=null;try{He()}catch(Ke){console.error("[CMSwift.reactive.effect] cleanup error:",Ke)}}}function K(Ie){if(!(!Ie||!Ie.active)){Fe(Ie),S.push(Ie),r=Ie;try{const He=nt=>{Ie._cleanup=typeof nt=="function"?nt:null},Ke=Ie.fn.length>0?Ie.fn(He):Ie.fn();typeof Ke=="function"&&(Ie._cleanup=Ke)}finally{S.pop(),r=S[S.length-1]||null}}}function Be(Ie){if(typeof Ie!="function")return()=>{};const He={fn:Ie,active:!0,_deps:new Set,_cleanup:null,_runner:null,_running:!1,_queued:!1},Ke=()=>{if(!He.active)return;if(He._running){He._queued=!0;return}He._running=!0;let nt=0;try{do if(He._queued=!1,K(He),nt++,nt>=n){He._queued=!1,console.warn("[CMSwift.reactive.effect] loop guard triggered: too many synchronous reruns",{max:n,effect:Ie.name||"anonymous"});break}while(He.active&&He._queued)}finally{He._running=!1}};return He._runner=Ke,Ke(),()=>{He.active&&(He.active=!1,Fe(He))}}function tt(Ie){let He=Ie;const Ke=new Set;function nt(){return r&&r.active&&(Ke.add(r._runner),r._deps.add(Ke)),He}function ct(Pt){He=Pt,Se(Ke)}function xt(){Ke.clear()}return[nt,ct,xt]}function Ge(Ie){if(typeof Ie!="function")throw new Error("CMSwift.reactive.computed: fn must be a function");const[He,Ke,nt]=tt(void 0),ct=Be(()=>{Ke(Ie())}),xt=()=>He();return xt.dispose=()=>{ct(),nt()},xt.peek=()=>He(),xt.type="computed",xt}function rt(Ie){if(typeof Ie!="function")throw new Error("CMSwift.reactive.untracked: fn must be a function");const He=r;r=null;try{return Ie()}finally{r=He}}function Pe(Ie,He){if(typeof Ie!="function")throw new Error("CMSwift.reactive.batch: fn must be a function");const Ke=ee(He);W===0?l=Ke:Ke==="microtask"&&(l="microtask"),W+=1;try{return Ie()}finally{if(W-=1,W===0){const nt=l==="microtask"||ue==="microtask";l="sync",nt?(ue="microtask",de()):A()}}}return{signal:tt,effect:Be,computed:Ge,untracked:rt,batch:Pe}})(),oe._overlayShared=(()=>{const r=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function S(ue,a){const ge=ue();if(ge&&ge.isConnected)return ge;let ee=document.getElementById("cms-overlay-root");return!ee&&(document!=null&&document.body)&&(ee=document.createElement("div"),ee.id="cms-overlay-root",ee.className="cms-overlay-root",document.body.appendChild(ee)),!document.body&&!ee&&oe.ready(()=>{let A=document.getElementById("cms-overlay-root");A||(A=document.createElement("div"),A.id="cms-overlay-root",A.className="cms-overlay-root",document.body.appendChild(A)),a(A)}),a(ee),ee}function n(ue){var ge;const a=ue.querySelector(r);(ge=a==null?void 0:a.focus)==null||ge.call(a)}function W(ue,a){if(ue.key!=="Tab")return;const ge=Array.from(a.querySelectorAll(r)).filter(Se=>Se.offsetParent!==null);if(!ge.length)return;const ee=ge[0],A=ge[ge.length-1],de=document.activeElement;ue.shiftKey&&de===ee?(ue.preventDefault(),A.focus()):!ue.shiftKey&&de===A&&(ue.preventDefault(),ee.focus())}function l(ue,a){var Se,Fe,K,Be,tt;if(!a.anchorEl)return;const ge=a.anchorEl.getBoundingClientRect(),ee=ue.getBoundingClientRect();let A=ge.bottom+((Se=a.offsetY)!=null?Se:8),de=ge.left+((Fe=a.offsetX)!=null?Fe:0);(K=a.placement)!=null&&K.startsWith("top")&&(A=ge.top-ee.height-((Be=a.offsetY)!=null?Be:8)),(tt=a.placement)!=null&&tt.includes("end")&&(de=ge.right-ee.width),ue.style.position="fixed",ue.style.top=`${Math.max(8,Math.min(A,window.innerHeight-ee.height-8))}px`,ue.style.left=`${Math.max(8,Math.min(de,window.innerWidth-ee.width-8))}px`}return{ensureRoot:S,focusFirst:n,trapFocus:W,applyAnchoredPosition:l}})(),oe.overlay=(()=>{let r=0;const S=new Map;let n=null;const{ensureRoot:W,focusFirst:l,trapFocus:ue,applyAnchoredPosition:a}=oe._overlayShared,ge=()=>W(()=>n,tt=>{n=tt});let ee=0;const A=()=>{ee++,ee===1&&document.documentElement.classList.add("cms-scroll-locked")},de=()=>{ee=Math.max(0,ee-1),ee===0&&document.documentElement.classList.remove("cms-scroll-locked")},Se=()=>{let tt=null;for(const Ge of S.values())tt=Ge;return tt},Fe=(tt,Ge={})=>{const rt=`ov_${++r}`,Pe={id:rt,opts:Ge,isOpen:!0,anchorEl:Ge.anchorEl||null,placement:Ge.placement||"bottom-start",onClose:typeof Ge.onClose=="function"?Ge.onClose:null,overlay:null,panel:null,backdrop:null,_positionCleanup:null,_cleanup:null},Ie=document.createElement("div");Ie.className=["cms-overlay",Ge.type?`type-${Ge.type}`:""].filter(Boolean).join(" "),Ie.dataset.id=rt;const He=document.createElement("div");He.className="cms-overlay-backdrop",Ge.backdrop||(He.style.display="none");const Ke=document.createElement("div");Ke.className=["cms-overlay-panel",Ge.className].filter(Boolean).join(" "),Ke.tabIndex=-1;const nt=typeof tt=="function"?tt({close:()=>K(rt)}):tt,ct=oe.ui.slot(nt);Array.isArray(ct)?ct.forEach(at=>at&&Ke.appendChild(at)):ct&&Ke.appendChild(ct),Ie.appendChild(He),Ie.appendChild(Ke);const xt=ge();if(!xt)return{id:rt,close:()=>K(rt),panel:Ke,overlay:Ie};xt.appendChild(Ie),Pe.overlay=Ie,Pe.panel=Ke,Pe.backdrop=He,S.set(rt,Pe),Ge.lockScroll&&A(),Ge.autoFocus!==!1&&setTimeout(()=>l(Ke),0);const Pt=()=>{a(Ke,Ge)};if(Ge.anchorEl){Pt();const at=()=>Pt();window.addEventListener("resize",at),window.addEventListener("scroll",at,!0),Pe._positionCleanup=()=>{window.removeEventListener("resize",at),window.removeEventListener("scroll",at,!0)}}const ut=at=>{const Ee=Se();!Ee||Ee.id!==rt||Ge.closeOnOutside!==!1&&(Ke.contains(at.target)||K(rt))};document.addEventListener("mousedown",ut,!0);const gt=at=>{const Ee=Se();!Ee||Ee.id!==rt||(Ge.trapFocus&&ue(at,Ke),at.key==="Escape"&&Ge.closeOnEsc!==!1&&(at.preventDefault(),K(rt)))};document.addEventListener("keydown",gt,!0),He.addEventListener("click",()=>{Ge.closeOnBackdrop!==!1&&K(rt)}),Pe._cleanup=()=>{var at;document.removeEventListener("mousedown",ut,!0),document.removeEventListener("keydown",gt,!0),(at=Pe._positionCleanup)==null||at.call(Pe)};const mt=1e3+S.size*10;return Ie.style.zIndex=String(mt),{id:rt,close:()=>K(rt),panel:Ke,overlay:Ie}},K=tt=>{var rt,Pe,Ie;const Ge=S.get(tt);Ge&&(S.delete(tt),(rt=Ge._cleanup)==null||rt.call(Ge),Ge.opts.lockScroll&&de(),(Pe=Ge.overlay)==null||Pe.remove(),(Ie=Ge.onClose)==null||Ie.call(Ge))};return{open:Fe,close:K,closeTop:()=>{const tt=Se();tt&&K(tt.id)},root:n,_stack:S}})();function Un(r,S={}){const{isSVG:n=!1,normalizeClass:W=Pe=>String(Pe!=null?Pe:""),isContentProp:l=()=>!1,autoValueTags:ue=new Set(["INPUT","TEXTAREA","SELECT"])}=S;function a(Pe){if(n||!(Pe in r))return!1;try{return typeof r[Pe]=="boolean"}catch(Ie){return!1}}function ge(Pe){return n||Pe.startsWith("data-")||Pe.startsWith("aria-")||!(Pe in r)}function ee(Pe,Ie){if(Ie==null){r.removeAttribute(Pe);return}if(Ie===!1){if(Pe.startsWith("aria-")){r.setAttribute(Pe,"false");return}r.removeAttribute(Pe);return}if(Ie===!0&&!n&&!Pe.startsWith("aria-")&&!Pe.startsWith("data-")){r.setAttribute(Pe,"");return}r.setAttribute(Pe,String(Ie))}function A(Pe,Ie){if(Pe==null)return;const He=String(Pe),Ke=He.startsWith("--")||He.includes("-");if(Ie==null||Ie===!1||Ie===""){Ke?r.style.removeProperty(He):r.style[He]="";return}if(Ke){r.style.setProperty(He,String(Ie));return}r.style[He]=Ie}function de(Pe){const Ie=W(Pe);if(Ie==null||Ie===!1||Ie===""){r.removeAttribute("class");return}r.setAttribute("class",String(Ie))}function Se(Pe,Ie){const He=!!Ie;r[Pe]=He,He?r.setAttribute(Pe,""):r.removeAttribute(Pe)}function Fe(Pe){if(l(Pe)){r[Pe]="";return}if(Pe==="class"){r.removeAttribute("class");return}if(Pe==="style"){r.removeAttribute("style");return}if(a(Pe)){try{r[Pe]=!1}catch(Ie){}r.removeAttribute(Pe);return}if(r.removeAttribute(Pe),!ge(Pe))try{typeof r[Pe]=="string"&&(r[Pe]="")}catch(Ie){}}function K(Pe){!Pe||typeof Pe!="object"||Object.entries(Pe).forEach(([Ie,He])=>{A(Ie,He)})}function Be(Pe,Ie){if(l(Pe)){r[Pe]=Ie!=null?Ie:"";return}if(Pe==="class"){de(Ie);return}if(Pe==="style"){if(Ie==null||Ie===!1){Fe(Pe);return}if(typeof Ie=="object"){K(Ie);return}}if(a(Pe)){Se(Pe,Ie);return}if(Ie==null||Ie===!1){Fe(Pe);return}if(ge(Pe)){ee(Pe,Ie);return}r[Pe]=Ie}function tt(Pe,Ie){const He=String(Pe).split(".");let Ke=r;for(let nt=0;nt<He.length-1;nt++)if(Ke=Ke==null?void 0:Ke[He[nt]],!Ke)return;Ke[He[He.length-1]]=Ie}function Ge(Pe){return Pe?Pe==="auto"||Pe.startsWith("attr:")||Pe.startsWith("@")||Pe.startsWith("style.")||Pe.includes("."):!1}function rt(Pe,Ie){if(!Pe||Pe==="auto"){ue.has(r.tagName)?Be("value",Ie):r.textContent=Ie!=null?Ie:"";return}if(Pe.startsWith("attr:")){ee(Pe.slice(5),Ie);return}if(Pe.startsWith("@")){ee(Pe.slice(1),Ie);return}if(Pe.startsWith("style.")){A(Pe.slice(6),Ie);return}if(Pe.includes(".")){tt(Pe,Ie);return}Be(Pe,Ie)}return{isBooleanDomProp:a,isAttributeOnlyProp:ge,isBindingValueKey:Ge,setAttributeValue:ee,setStyleEntry:A,setClassValue:de,setBooleanProp:Se,removeProp:Fe,applyStyleObject:K,setProp:Be,setPathValue:tt,applyBindingValue:rt}}function kn(r){const S=[],n=W=>{if(!(W==null||W===!1)){if(typeof W=="function"){n(W());return}if(W&&W.type==="rod"){n(W.value);return}if(Array.isArray(W)){W.forEach(n);return}if(typeof W=="object"){Object.entries(W).forEach(([l,ue])=>{let a=ue;typeof a=="function"?a=a():a&&a.type==="rod"&&(a=a.value),n(a?l:null)});return}W!==!0&&String(W).split(/\s+/).forEach(l=>{l&&S.push(l)})}};return n(r),S.length?Array.from(new Set(S)).join(" "):""}function Gn(r){return r==null||r===!1?!1:typeof r=="function"||r&&r.type==="rod"?!0:Array.isArray(r)?r.some(Gn):typeof r=="object"?Object.values(r).some(Gn):!1}function Hn(r,S){return r==null||r===!1?!1:typeof r=="function"||S(r)?!0:typeof r!="object"||Array.isArray(r)||r.nodeType?!1:Object.values(r).some(n=>Hn(n,S))}function jn(r,S){let n=r;if(typeof n=="function"?n=n():S(n)&&(n=n.value),!n||typeof n!="object"||Array.isArray(n)||n.nodeType)return null;const W={};return Object.entries(n).forEach(([l,ue])=>{let a=ue;typeof a=="function"?a=a():S(a)&&(a=a.value),W[l]=a}),W}function lo(r){let S=new Set;function n(l){S.forEach(ue=>{l.has(ue)||r(ue,null)}),S=l}function W(l,ue){const a=jn(l,ue);if(!a){n(new Set);return}const ge=new Set(Object.keys(a));n(ge),Object.entries(a).forEach(([ee,A])=>{r(ee,A)})}return{apply:W}}function wn(r){return typeof r=="string"&&(r.startsWith("on:")||r.startsWith("on")&&r.length>2)}const ao=128,hn=[];function Mn(r,S){hn.push({rod:r,value:String(S!=null?S:"")}),hn.length>ao&&hn.splice(0,hn.length-ao)}function co(){if(!hn.length)return null;const r=hn.slice();return hn.length=0,{items:r,index:0}}function uo(r,S){if(!S||!r||S.index>=S.items.length)return null;const n=[],W=String(r);let l=0,ue=S.index,a=!1;for(;ue<S.items.length;){const ge=S.items[ue],ee=ge.value;if(!ee)break;const A=W.indexOf(ee,l);if(A===-1)break;A>l&&n.push(W.slice(l,A)),n.push(ge.rod),l=A+ee.length,ue++,a=!0}return a?(l<W.length&&n.push(W.slice(l)),S.index=ue,n):null}function xo(r){var n;let S="";for(const W of r)typeof W=="string"?S+=W:S+=(n=W==null?void 0:W.value)!=null?n:"";return S}function Ao(r){if(r.startsWith("on:"))return r.slice(3);const S=r.slice(2);return S?S==="DoubleClick"?"dblclick":S.toLowerCase():""}function Vn(r){return r==null||r===!1?!1:r===!0?{capture:!0}:typeof r=="boolean"?r:typeof r=="object"?{capture:!!r.capture,passive:!!r.passive,once:!!r.once}:!1}function fo(r,S){const n=Vn(r),W=Vn(S);return typeof n=="boolean"||typeof W=="boolean"?n===W:!!n&&!!W&&n.capture===W.capture&&n.passive===W.passive&&n.once===W.once}function Ln(r,S){return Array.isArray(r)?r.some(n=>Ln(n,S)):S(r)?!0:!r||typeof r!="object"||Array.isArray(r)||r.nodeType?!1:Array.isArray(r.handlers)?r.handlers.some(n=>Ln(n,S))||S(r.options)||typeof r.options=="function":Array.isArray(r.listeners)?r.listeners.some(n=>Ln(n,S))||S(r.options)||typeof r.options=="function":S(r.handler)||S(r.listener)||S(r.fn)||S(r.options)||typeof r.options=="function"}function Kn(r,S,n){var W,l,ue,a,ge,ee,A;if(r==null||r===!1)return[];if(typeof r=="function")return[{handler:r,options:Vn(n!=null?n:!1)}];if(S(r))return Kn(r.value,S,n);if(Array.isArray(r))return r.flatMap(de=>Kn(de,S,n));if(typeof r=="object"&&!Array.isArray(r)&&!r.nodeType){if(Array.isArray(r.handlers)||Array.isArray(r.listeners)){const Fe=r.handlers||r.listeners||[],K=(l=(W=r.options)!=null?W:n)!=null?l:!1;return Fe.flatMap(Be=>Kn(Be,S,K))}let de=(ge=(a=(ue=r.handler)!=null?ue:r.listener)!=null?a:r.fn)!=null?ge:null,Se=(A=(ee=r.options)!=null?ee:n)!=null?A:!1;return S(de)&&(de=de.value),S(Se)&&(Se=Se.value),typeof Se=="function"&&(Se=Se()),typeof de=="function"?[{handler:de,options:Vn(Se)}]:[]}return[]}function No(r,S){return Kn(r,S)}function ko(r,S,n,W){const l=Ao(S);if(!l)return;const ue={listeners:[]},a=()=>{ue.listeners.forEach(ee=>{r.removeEventListener(l,ee.dispatch,ee.options)}),ue.listeners=[]},ge=ee=>{const A=No(ee,W);ue.listeners.length===A.length&&ue.listeners.every((Se,Fe)=>{const K=A[Fe];return Se.handler===K.handler&&fo(Se.options,K.options)})||(a(),A.forEach(Se=>{const Fe={handler:Se.handler,options:Se.options,dispatch:null};Fe.dispatch=K=>{if(typeof Fe.handler=="function"){const Be=Fe.handler.call(r,K);return Fe.options&&typeof Fe.options=="object"&&Fe.options.once&&(r.removeEventListener(l,Fe.dispatch,Fe.options),ue.listeners=ue.listeners.filter(tt=>tt!==Fe)),Be}},r.addEventListener(l,Fe.dispatch,Fe.options),ue.listeners.push(Fe)}))};if(oe._registerCleanup(r,a),W(n)){const ee=oe.reactive.effect(()=>{ge(n.value)});oe._registerCleanup(r,ee);return}if(Ln(n,W)){const ee=oe.reactive.effect(()=>{ge(n)});oe._registerCleanup(r,ee);return}ge(n)}function Mo(r,S={}){const{isRod:n=()=>!1,interpolationCursor:W=null}=S;function l(de){const Se=document.createTextNode(""),Fe=oe.rodBind(Se,de);return oe._registerCleanup(Se,Fe),Se}function ue(de){r.appendChild(l(de))}function a(de){const Se=document.createTextNode("");r.appendChild(Se);const Fe=oe.reactive.effect(()=>{Se.textContent=xo(de)});oe._registerCleanup(Se,Fe)}function ge(de){const Se=[],Fe=K=>{if(!(K==null||K===!1)){if(Array.isArray(K)){K.forEach(Fe);return}if(typeof K=="string"){Se.push(document.createTextNode(K));return}if(typeof K=="number"){Se.push(document.createTextNode(String(K)));return}if(typeof K!="boolean"){if(n(K)){Se.push(l(K));return}if(K!=null&&K.nodeType){Se.push(K);return}Se.push(document.createTextNode(String(K)))}}};return Fe(de),Se}function ee(de){const Se=document.createComment("dyn");r.appendChild(Se);let Fe=[];const K=oe.reactive.effect(()=>{Fe.forEach(rt=>{En(rt),rt.parentNode&&rt.parentNode.removeChild(rt)}),Fe=[];const Be=Se.parentNode;if(!Be)return;const tt=ge(de());if(!tt.length)return;const Ge=document.createDocumentFragment();tt.forEach(rt=>Ge.appendChild(rt)),Be.insertBefore(Ge,Se.nextSibling),Fe=tt});oe._registerCleanup(Se,()=>{K(),Fe.forEach(Be=>En(Be)),Fe=[]})}function A(de){if(de!=null){if(Array.isArray(de)){for(const Se of de)A(Se);return}if(typeof de=="string"){const Se=uo(de,W);Se?a(Se):r.appendChild(document.createTextNode(de));return}if(typeof de=="number"){r.appendChild(document.createTextNode(String(de)));return}if(typeof de=="function"){ee(de);return}if(n(de)){ue(de);return}de.nodeType&&r.appendChild(de)}}return{appendRodText:ue,appendInterpolatedText:a,appendDynamicChild:ee,appendChildValue:A}}function $o(r,S={}){const{el:n,isRod:W=()=>!1,interpolationCursor:l=null,appendChildValue:ue=()=>{},appendRodText:a=()=>{},appendInterpolatedText:ge=()=>{},appendDynamicChild:ee=()=>{},bindProp:A=()=>{}}=S;for(const de of r)if(de!=null){if(Array.isArray(de)){ue(de);continue}if(typeof de=="string"){const Se=uo(de,l);Se?ge(Se):n.appendChild(document.createTextNode(de));continue}if(typeof de=="number"){n.appendChild(document.createTextNode(String(de)));continue}if(typeof de=="function"){ee(de);continue}if(W(de)){a(de);continue}if(de.nodeType){n.appendChild(de);continue}if(typeof de=="object")for(const[Se,Fe]of Object.entries(de)){if(typeof Fe=="string"){const K=uo(Fe,l);if(K){A(Se,()=>xo(K));continue}}if(Se==="class"){A(Se,Fe);continue}if(Se==="style"&&typeof Fe=="object"&&Fe!==null&&!W(Fe)){A(Se,Fe);continue}A(Se,Fe)}}}const qn="http://www.w3.org/2000/svg",mo=new Set(["svg","g","path","circle","ellipse","line","rect","polygon","polyline","text","tspan","defs","linearGradient","radialGradient","stop","use","symbol","clipPath","mask","pattern","filter","feGaussianBlur","feOffset","feBlend","feColorMatrix"]);function Yn(r){return r==="innerHTML"||r==="innerText"||r==="textContent"||r==="value"}function Wo(r,...S){const n=mo.has(r),W=r==="text"&&!n?document.createTextNode(""):n?document.createElementNS(qn,r):document.createElement(r),l=Ee=>!!Ee&&Ee.type==="rod",ue=co(),a=Mo(W,{isRod:l,interpolationCursor:ue}),{appendRodText:ge,appendInterpolatedText:ee,appendDynamicChild:A,appendChildValue:de}=a,Se=Un(W,{isSVG:n,normalizeClass:kn,isContentProp:Yn}),{isBooleanDomProp:Fe,isBindingValueKey:K,applyBindingValue:Be,setStyleEntry:tt,setProp:Ge,setClassValue:rt}=Se;function Pe(Ee){const De=oe.reactive.effect(Ee);return oe._registerCleanup(W,De),De}function Ie(Ee){if(String((Ee==null?void 0:Ee.tagName)||"").toLowerCase()!=="input")return!1;const De=String((Ee==null?void 0:Ee.type)||"").toLowerCase();return De==="range"||De==="number"}function He(Ee){return String((Ee==null?void 0:Ee.tagName)||"").toLowerCase()!=="input"?"":String((Ee==null?void 0:Ee.type)||"").toLowerCase()}function Ke(Ee){return String((Ee==null?void 0:Ee.tagName)||"").toLowerCase()==="select"&&!Ee.multiple}function nt(Ee){return String((Ee==null?void 0:Ee.tagName)||"").toLowerCase()==="input"&&String((Ee==null?void 0:Ee.type)||"").toLowerCase()==="file"}function ct(Ee,De,ht){Pe(()=>{var kt;const bt=(kt=De.value)!=null?kt:"";Ee.value!==String(bt)&&Ge("value",bt)});const Nt=()=>{let bt=Ee.value;const kt=He(Ee),it=typeof De.value=="number"||De.value==null;if(Ke(Ee)&&Ee.value==="")bt=null;else if(Ie(Ee)&&it)if(kt==="number"&&Ee.value==="")bt=null;else{const lt=typeof Ee.valueAsNumber=="number"&&!Number.isNaN(Ee.valueAsNumber)?Ee.valueAsNumber:Number(Ee.value);bt=Number.isNaN(lt)?kt==="number"?null:0:lt}De.value!==bt&&(De.value=bt)};Ee.addEventListener(ht,Nt),oe._registerCleanup(Ee,()=>{Ee.removeEventListener(ht,Nt)})}function xt(Ee,De){Pe(()=>{const Nt=!!De.value;!!Ee.checked!==Nt&&Ge("checked",Nt)});const ht=()=>{const Nt=!!Ee.checked;De.value!==Nt&&(De.value=Nt)};Ee.addEventListener("change",ht),oe._registerCleanup(Ee,()=>{Ee.removeEventListener("change",ht)})}function Pt(Ee,De){const ht=()=>{var bt;return String((bt=Ee.value)!=null?bt:"on")};Pe(()=>{const kt=(De.value==null?null:String(De.value))===ht();!!Ee.checked!==kt&&Ge("checked",kt)});const Nt=()=>{if(!Ee.checked)return;const bt=ht();De.value!==bt&&(De.value=bt)};Ee.addEventListener("change",Nt),oe._registerCleanup(Ee,()=>{Ee.removeEventListener("change",Nt)})}function ut(Ee,De){const ht=()=>{const bt=Ee.files;return bt==null?[]:Array.isArray(bt)?bt.slice():typeof bt.length=="number"?Array.from(bt):[bt]};Pe(()=>{const bt=De.value;(bt==null||Array.isArray(bt)&&bt.length===0)&&(Ee.value!==""&&Ge("value",""),Array.isArray(Ee.files)&&(Ee.files=[]))});const Nt=()=>{const bt=ht();De.value=bt};Ee.addEventListener("change",Nt),oe._registerCleanup(Ee,()=>{Ee.removeEventListener("change",Nt)})}function gt(Ee,De){const ht=()=>Array.from(Ee.childNodes||[]).filter(kt=>(kt==null?void 0:kt.tagName)==="OPTION"&&kt.selected).map(kt=>{var it;return String((it=kt.value)!=null?it:"")}),Nt=()=>{const kt=Array.isArray(De.value)?De.value.map(lt=>String(lt)):[],it=new Set(kt);Array.from(Ee.childNodes||[]).forEach(lt=>{var Dt;if((lt==null?void 0:lt.tagName)!=="OPTION")return;const vt=it.has(String((Dt=lt.value)!=null?Dt:""));!!lt.selected!==vt&&(lt.selected=vt,vt?lt.setAttribute("selected",""):lt.removeAttribute("selected"))})};Pe(Nt),Ee._cmsApplySelectedValues=Nt,queueMicrotask(Nt);const bt=()=>{const kt=ht(),it=Array.isArray(De.value)?De.value.map(lt=>String(lt)):[];it.length===kt.length&&it.every((lt,vt)=>lt===kt[vt])||(De.value=kt)};Ee.addEventListener("change",bt),oe._registerCleanup(Ee,()=>{Ee.removeEventListener("change",bt)})}function mt(Ee,De){Pe(()=>{const kt=!!De.value;!!Ee.selected!==kt&&Ge("selected",kt)});let ht=null;const Nt=()=>{const kt=!!Ee.selected;De.value!==kt&&(De.value=kt)};queueMicrotask(()=>{var kt;ht||((kt=Ee.parentNode)==null?void 0:kt.tagName)!=="SELECT"||(ht=Ee.parentNode,ht.addEventListener("change",Nt))}),oe._registerCleanup(Ee,()=>{ht==null||ht.removeEventListener("change",Nt)})}function at(Ee,De){if(wn(Ee)){ko(W,Ee,De,l);return}if(Ee==="class"){if(Gn(De)){Pe(()=>{rt(kn(De))});return}rt(kn(De));return}if(Ee==="style"&&De&&typeof De=="object"){const ht=lo(tt);if(Hn(De,l)){Pe(()=>{ht.apply(De,l)});return}ht.apply(De,l);return}if(Ee==="style"&&(typeof De=="function"||l(De))){const ht=lo(tt);Pe(()=>{ht.apply(De,l)});return}if(K(Ee)&&typeof De=="function"){Pe(()=>{Be(Ee,De())});return}if(K(Ee)&&!l(De)){Be(Ee,De);return}if(typeof De=="function"){Pe(()=>{Ge(Ee,De())});return}if(Ee==="value"&&l(De)&&(r==="input"||r==="textarea"||r==="select")){if(r==="select"&&W.multiple){gt(W,De);return}ct(W,De,r==="select"?"change":"input");return}if(Ee==="checked"&&l(De)&&r==="input"){if(String(W.type||"").toLowerCase()==="radio"){Pt(W,De);return}xt(W,De);return}if(Ee==="files"&&l(De)&&nt(W)){ut(W,De);return}if(Ee==="selected"&&l(De)&&r==="option"){mt(W,De);return}if(Yn(Ee)&&l(De)){Pe(()=>{Ge(Ee,De.value)});return}if(l(De)){const ht=oe.rodBind(W,De,{key:Ee});oe._registerCleanup(W,ht);return}Ge(Ee,De)}return $o(S,{el:W,isRod:l,interpolationCursor:ue,appendChildValue:de,appendRodText:ge,appendInterpolatedText:ee,appendDynamicChild:A,bindProp:at}),r==="select"&&typeof W._cmsApplySelectedValues=="function"&&W._cmsApplySelectedValues(),W}const ss={},go=["html","head","title","base","link","meta","style","body","header","footer","main","section","article","aside","nav","h1","h2","h3","h4","h5","h6","p","div","span","pre","blockquote","hr","br","address","a","abbr","b","bdi","bdo","cite","code","data","dfn","em","i","kbd","mark","q","rp","rt","ruby","s","samp","small","strong","sub","sup","time","u","var","wbr","ul","ol","li","dl","dt","dd","table","caption","colgroup","col","thead","tbody","tfoot","tr","th","td","form","label","input","textarea","button","select","option","optgroup","fieldset","legend","datalist","output","progress","meter","img","picture","source","iframe","embed","object","param","audio","video","track","details","summary","dialog","script","noscript","canvas","template","slot","svg","g","path","circle","ellipse","line","rect","polygon","polyline","text","tspan","defs","linearGradient","radialGradient","stop","use","symbol","clipPath","mask","pattern","filter","feGaussianBlur","feOffset","feBlend","feColorMatrix"];go.forEach(r=>{window._[r]=(...S)=>Wo(r,...S)}),_.DOM_ELEMENTS=go,_.fragment=(...r)=>r,_.dynamic=function(r){const S=document.createComment("dyn"),n=document.createDocumentFragment();n.appendChild(S);let W=null;return oe.reactive.effect(()=>{const l=r();if(W&&W.parentNode&&W.parentNode.removeChild(W),W=null,l==null)return;let ue=l;(typeof l=="string"||typeof l=="number")&&(ue=document.createTextNode(String(l)));const a=S.parentNode;a&&ue&&ue.nodeType&&(a.insertBefore(ue,S.nextSibling),W=ue)}),n};function is(){let r=!1;const S=new Set;function n(){var l,ue,a;r=!1,(l=oe.debug)==null||l.inc("rodFlushes"),(ue=oe.perf)==null||ue.inc("rodFlushes"),(a=oe.perf)==null||a.mark("rod:flush");const W=Array.from(S);S.clear();for(const ge of W)try{ge()}catch(ee){console.error("[rod] flush error:",ee)}}return function(l){S.add(l),r||(r=!0,queueMicrotask(n))}}const Uo=is();function _o(r,S,n){if(!r)return;if(r.nodeType===3){r.textContent=n!=null?n:"";return}Un(r,{isSVG:r.namespaceURI===qn,normalizeClass:kn,isContentProp:Yn}).applyBindingValue(S,n)}function Bn(r){return{type:"rod",value:r,_bindings:[],_actions:[],_disposeHooks:[],_disposed:!1,_silentDepth:0,_pending:!1,bindings(){return this._bindings.map(n=>({el:n.el,key:n.key}))},onDispose(n){return typeof n=="function"&&this._disposeHooks.push(n),this},_bind(n,W={key:"auto"}){var a;if(this._disposed)return()=>{};if(!n)return()=>{};const l={el:n,key:(a=W==null?void 0:W.key)!=null?a:"auto"};return this._bindings.some(ge=>ge.el===l.el&&ge.key===l.key)||this._bindings.push(l),_o(l.el,l.key,this.value),()=>{this._bindings=this._bindings.filter(ge=>!(ge.el===l.el&&ge.key===l.key))}},action(n){return!this._disposed&&typeof n=="function"&&this._actions.push(n),this},_setSilent(n){this._silentDepth++;try{this.value=n}finally{this._silentDepth--}return this},_scheduleNotify(){this._disposed||this._pending||(this._pending=!0,Uo(()=>{this._pending=!1,this._notifyNow()}))},_notifyNow(){var W,l,ue,a,ge;if(this._disposed)return;const n=performance.now();(W=oe.perf)==null||W.inc("rodNotifies"),this._bindings=this._bindings.filter(ee=>{const A=ee.el;return A?A.nodeType===3?!!A.parentNode:A.isConnected!==!1:!1});for(const ee of this._bindings)_o(ee.el,ee.key,this.value);if(!(this._silentDepth>0)){for(const ee of this._actions)try{ee(this.value)}catch(A){console.error("[rod] action error:",A)}(l=oe.debug)==null||l.inc("rodNotifies"),(ge=oe.perf)==null||ge.tick("rod:notify",performance.now()-n,{bindings:((ue=this._bindings)==null?void 0:ue.length)||0,actions:((a=this._actions)==null?void 0:a.length)||0})}},dispose(){if(!this._disposed){this._disposed=!0;for(const n of this._disposeHooks)try{n()}catch(W){console.error("[rod] dispose hook error:",W)}this._bindings.length=0,this._actions.length=0,this._disposeHooks.length=0}}}}function vn(r,S="value"){var a;let n=r[S],W=null,l=null,ue=null;return(a=oe==null?void 0:oe.reactive)!=null&&a.signal&&([W,l,ue]=oe.reactive.signal(n),ue&&typeof r.onDispose=="function"&&r.onDispose(ue)),Object.defineProperty(r,S,{get(){return W?W():n},set(ge){l?l(ge):n=ge,r._scheduleNotify()},configurable:!0}),typeof r.val!="function"&&Object.defineProperty(r,"val",{value(ge){return arguments.length?(this.value=ge,ge):this.value},configurable:!0}),r[Symbol.toPrimitive]||Object.defineProperty(r,Symbol.toPrimitive,{value(ge){const ee=this.value;if(ee==null)return ee;const A=typeof ee;return ge==="number"?Number(ee):(A!=="symbol"&&Mn(this,ee),A==="string"||A==="number"||A==="boolean"||A==="bigint"||A==="symbol"?ee:String(ee))},configurable:!0}),r.valueOf||Object.defineProperty(r,"valueOf",{value(){return this.value},configurable:!0}),r.toString||Object.defineProperty(r,"toString",{value(){return String(this.value)},configurable:!0}),r}_.rod=function(S,n="value"){const W=Bn(S);return vn(W,n),oe.rod._all=oe.rod._all||new Set,oe.rod._all.add(W),typeof W.onDispose=="function"&&W.onDispose(()=>oe.rod._all.delete(W)),W},oe.rodBind=function(r,S,n={key:"auto"}){var W,l,ue;if((W=oe.debug)==null||W.inc("rodBinds"),!r)return(l=oe.debug)==null||l.inc("rodBindNull"),(ue=oe.debug)==null||ue.warn("rodBind: target element \xE8 null/undefined",n),()=>{};if(!S||S.type!=="rod")throw new Error("CMSwift.rodBind: react must be a rod object");return S._bind(r,n)},oe.rodFromSignal=function(r,S){const n=_.rod(r());let W=!1;const l=oe.reactive.effect(()=>{const a=n.value,ge=oe.reactive.untracked(()=>r());if(!W&&ge!==a){W=!0;try{S(a)}finally{W=!1}}}),ue=oe.reactive.effect(()=>{const a=r();if(oe.reactive.untracked(()=>n.value)!==a){W=!0;try{n._setSilent(a)}finally{W=!1}}});return typeof n.onDispose=="function"&&(n.onDispose(l),n.onDispose(ue)),n};function Rt(r){if(!r||!r.tagName)return null;const S=r.tagName.toLowerCase();if(S==="input"){const n=(r.type||"text").toLowerCase();return n==="checkbox"?"checkbox":n==="radio"?"radio":n==="number"?"number":"text"}return S==="select"?r.multiple?"select-multiple":"select":null}oe.rodModel=function(r,S,n={}){var de,Se,Fe;if(!S||S.type!=="rod")throw new Error("[CMSwift.rodModel] rodObj deve essere un rod");const W=Array.isArray(r)||r instanceof NodeList?Array.from(r):[r],l=(de=n.event)!=null?de:"change",ue=(Se=n.parse)!=null?Se:(K=>K),a=(Fe=n.format)!=null?Fe:(K=>K);let ge=!1;const ee=[],A=K=>{for(const Be of W){if(!Be)continue;switch(Rt(Be)){case"checkbox":Be.checked=!!K;break;case"radio":Be.checked=Be.value==K;break;case"select":Be.value=K!=null?K:"";break;case"select-multiple":const Ge=Array.isArray(K)?K.map(String):[];for(const rt of Be.options)rt.selected=Ge.includes(rt.value);break;default:Be.value=K!=null?K:""}}};S.action(K=>{if(!ge){ge=!0;try{A(a(K))}finally{ge=!1}}}),A(a(S.value));for(const K of W){if(!K)continue;const Be=Rt(K),tt=()=>{if(ge)return;let Ge;switch(Be){case"checkbox":Ge=K.checked;break;case"radio":if(!K.checked)return;Ge=K.value;break;case"select":Ge=K.value;break;case"select-multiple":Ge=Array.from(K.selectedOptions).map(rt=>rt.value);break;case"number":Ge=ue(K.value===""?null:Number(K.value));break;default:Ge=ue(K.value)}ge=!0;try{S.value!==Ge&&(S.value=Ge)}finally{ge=!1}};K.addEventListener(l,tt),ee.push(()=>K.removeEventListener(l,tt))}return typeof S.onDispose=="function"&&S.onDispose(()=>ee.forEach(K=>K())),()=>ee.forEach(K=>K())},oe.signalModel=function(r,S,n,W={}){const l=oe.rodFromSignal(S,n);return oe.rodModel(r,l,W)};function En(r){if(!r)return;const S=oe._cleanupRegistry.get(r);if(S){for(const n of S)try{n()}catch(W){console.error("[cleanup] error:",W)}oe._cleanupRegistry.delete(r)}if(r.childNodes&&r.childNodes.length)for(const n of r.childNodes)En(n)}function Xn(r){const S=n=>typeof n=="string"?oe.dom.q(n):n;return Array.isArray(r)?r.map(S).filter(Boolean):[S(r)].filter(Boolean)}function Jn(r){const S=[],n=[],W=l=>{if(l!=null){if(typeof l=="function"){W(l());return}if(l&&typeof l=="object"&&"node"in l){typeof l.dispose=="function"&&n.push(l.dispose),W(l.node);return}if(Array.isArray(l)){for(const ue of l)W(ue);return}if(typeof l=="string"||typeof l=="number"){S.push(document.createTextNode(String(l)));return}if(l.nodeType){S.push(l);return}console.warn("[CMSwift.mount] contenuto non supportato:",l)}};return W(r),{nodes:S,disposers:n}}function Qn(r=[],S="[CMSwift.mount] dispose error:"){let n=!1;return()=>{if(!n){n=!0;for(const W of r)try{W()}catch(l){console.error(S,l)}}}}function bn(r=[],S=null){return Qn([...S?[S]:[],...r],"[component] dispose error:")}oe.mount=function(r,S,n={}){var ee;const W=Xn(r),l=(ee=n.clear)!=null?ee:!0,ue=W.length>1;if(W.length===0)return console.warn("[CMSwift.mount] nessun target valido:",r),()=>{};const a=[];for(const A of W){if(l)for(;A.firstChild;)En(A.firstChild),A.removeChild(A.firstChild);const{nodes:de,disposers:Se}=Jn(S);let Fe=de;ue&&typeof S!="function"&&(Fe=de.map(Be=>Be.cloneNode(!0)),Se.length&&console.warn("[CMSwift.mount] multi-target con dispose: usa content come function per istanze separate."));const K=Qn(Se);for(const Be of Fe)A.appendChild(Be);a.push({root:A,nodes:Fe,dispose:K});for(const Be of Fe)!Be||!Be.nodeType||oe._registerCleanup(Be,K)}return()=>{var A;for(const de of a){for(const Se of de.nodes)Se&&(En(Se),Se.parentNode===de.root&&de.root.removeChild(Se));(A=de.dispose)==null||A.call(de)}}},oe.component=function(r){if(typeof r!="function")throw new Error("CMSwift.component: renderFn must be a function");return function(n={}){const W=[],ue=r(n,{onDispose(a){typeof a=="function"&&W.push(a)}});return ue&&typeof ue=="object"&&"node"in ue?{node:ue.node,dispose:bn(W,typeof ue.dispose=="function"?ue.dispose:null)}:{node:ue,dispose:bn(W)}}},oe.enableAutoCleanup=function(){if(oe._autoCleanupEnabled)return;oe._autoCleanupEnabled=!0;const r=new MutationObserver(S=>{for(const n of S)for(const W of n.removedNodes)En(W)});r.observe(document.body,{childList:!0,subtree:!0}),oe._cleanupObserver=r},oe.debug=(()=>{const r={rodFlushes:0,rodNotifies:0,rodBinds:0,rodBindNull:0,rodBindDup:0};function S(){return!!oe.config.debug}function n(...ee){S()&&console.log("[CMSwift]",...ee)}function W(...ee){S()&&console.warn("[CMSwift]",...ee)}function l(...ee){console.error("[CMSwift]",...ee)}function ue(ee,A=1){r[ee]||(r[ee]=0),r[ee]+=A}function a(){return{...r}}function ge(){for(const ee of Object.keys(r))r[ee]=0}return{enabled:S,log:n,warn:W,error:l,inc:ue,stats:a,reset:ge}})(),oe.perf=(()=>{let r=!1;const S={effectsRun:0,effectsSlow:0,rodNotifies:0,rodFlushes:0,domWrites:0,httpRequests:0},n=[],W=[],l={timelineMax:200,slowEffectMs:8};function ue(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function a(He,Ke=0,nt=null){r&&(n.push({t:Date.now(),type:He,ms:Ke,meta:nt}),n.length>l.timelineMax&&n.shift())}function ge(He,Ke=1){r&&(S[He]=(S[He]||0)+Ke)}function ee(He,Ke){r&&(W.push({t:Date.now(),ms:He,meta:Ke}),W.length>100&&W.shift())}let A=null;function de(){A||(A=oe.reactive.effect,oe.reactive.effect=function(He,Ke){return A((...ct)=>{const xt=ue();ge("effectsRun");try{return He(...ct)}finally{const Pt=ue()-xt;Pt>=l.slowEffectMs?(ge("effectsSlow"),ee(Pt,Ke||He.name||"effect"),a("effect:slow",Pt,Ke||He.name||null)):a("effect",Pt,Ke||He.name||null)}})})}function Se(){A&&(oe.reactive.effect=A,A=null)}function Fe(He=!0){return r=!!He,r?de():Se(),r}function K(){for(const He of Object.keys(S))S[He]=0;n.length=0,W.length=0}function Be(){return{enabled:r,...S,slowEffectMs:l.slowEffectMs,timelineSize:n.length}}function tt(){return n.slice()}function Ge(He=l.slowEffectMs){return W.filter(Ke=>Ke.ms>=He).slice().sort((Ke,nt)=>nt.ms-Ke.ms)}function rt(He,Ke){const nt=ue();try{return Ke()}finally{const ct=ue()-nt;a("time:"+He,ct,He)}}function Pe(He,Ke){a(He,0,Ke)}function Ie(He,Ke,nt){a(He,Ke,nt)}return{enable:Fe,reset:K,stats:Be,timeline:tt,slowEffects:Ge,time:rt,mark:Pe,tick:Ie,inc:ge,cfg:l}})(),oe.rod=oe.rod||{},oe.rod.inspect=function(r,S="rod"){if(!r||r.type!=="rod")return console.warn("[CMSwift.rod.inspect] non \xE8 un rod:",r),null;const n=typeof r.bindings=="function"?r.bindings():[],W={label:S,value:r.value,bindingsCount:n.length,bindings:n.map(l=>{var ue,a,ge,ee,A,de,Se;return{key:l.key,el:((ue=l.el)==null?void 0:ue.nodeType)===3?"#text":(a=l.el)==null?void 0:a.tagName,id:((ge=l.el)==null?void 0:ge.id)||null,className:((ee=l.el)==null?void 0:ee.className)||null,isConnected:((A=l.el)==null?void 0:A.nodeType)===3?!!l.el.parentNode:(Se=(de=l.el)==null?void 0:de.isConnected)!=null?Se:null}}),actionsCount:Array.isArray(r._actions)?r._actions.length:null,disposed:!!r._disposed};return oe.config.debug?(console.groupCollapsed(`[CMSwift.rod.inspect] ${S}`),console.log(W),console.groupEnd()):console.log(W),W},oe.rod.inspectAll=function(){const r=oe.rod._all?Array.from(oe.rod._all):[];return r.forEach((S,n)=>oe.rod.inspect(S,`rod#${n+1}`)),r.length},oe._storeShared=(()=>{function r(ue){return`${ue.storage}::${ue.prefix}`}function S(ue,a){function ge(Se={}){var K,Be;const Fe={storage:(K=Se.storage)!=null?K:ue.storage,prefix:(Be=Se.prefix)!=null?Be:ue.prefix};return a.set(r(Fe),Fe),Fe}function ee(Se=null){var K;return(typeof Se=="string"?Se:(K=Se==null?void 0:Se.storage)!=null?K:ue.storage)==="session"?window.sessionStorage:window.localStorage}function A(Se,Fe=null){return(Fe||ge()).prefix+Se}function de(Se,Fe=null){const K=Fe||ge();return`${r(K)}::${Se}`}return{getScope:ge,getStorage:ee,fullKey:A,channelKey:de}}function n(ue){try{return JSON.parse(ue)}catch(a){return}}function W(ue){try{return JSON.stringify(ue)}catch(a){return}}function l(ue,...a){const ge=`${ue.storage}::${ue.prefix}::`;for(const ee of a)for(const A of Array.from(ee.keys()))A.startsWith(ge)&&ee.delete(A)}return{createScopeTools:S,safeParse:n,safeStringify:W,clearScopedMapEntries:l}})(),oe.store=(()=>{const r={prefix:"CMSwift:",storage:"local",syncTabs:!0,writeDelay:0},S=new Map,n=new Map,W=new Map,l=new Map;let ue=!1;const{createScopeTools:a,safeParse:ge,safeStringify:ee,clearScopedMapEntries:A}=oe._storeShared,{getScope:de,getStorage:Se,fullKey:Fe,channelKey:K}=a(r,l);function Be(ut,gt,mt=null){var De;const at=mt||de(),Ee=n.get(K(ut,at));if(Ee)for(const ht of Ee)try{(De=oe.reactive)!=null&&De.untracked?oe.reactive.untracked(()=>ht(gt)):ht(gt)}catch(Nt){console.error("[store] watcher error:",Nt)}}function tt(){ue=!1;for(const[ut,gt]of Array.from(W.entries())){W.delete(ut);const mt=S.get(ut),at=ee(mt);if(at===void 0)continue;const Ee=Se(gt.scope);try{Ee.setItem(Fe(gt.key,gt.scope),at)}catch(De){console.error("[store] write error:",De)}}}function Ge(ut,gt=null){const mt=gt||de();W.set(K(ut,mt),{key:ut,scope:mt}),!ue&&(ue=!0,r.writeDelay>0?setTimeout(tt,r.writeDelay):queueMicrotask(tt))}function rt(ut,gt=null){const mt=gt||de(),Ee=Se(mt).getItem(Fe(ut,mt));if(Ee!=null)return ge(Ee)}function Pe(ut,gt,mt=null){const at=mt||de(),Ee=K(ut,at);if(S.has(Ee))return S.get(Ee);const De=rt(ut,at);return De!==void 0?(S.set(Ee,De),De):gt}function Ie(ut,gt,mt=null){const at=mt||de();return S.set(K(ut,at),gt),Ge(ut,at),Be(ut,gt,at),gt}function He(ut,gt=null){const mt=gt||de(),at=K(ut,mt);S.delete(at),W.delete(at);try{Se(mt).removeItem(Fe(ut,mt))}catch(Ee){}Be(ut,void 0,mt)}function Ke(ut={}){const gt=de(ut),mt=Se(gt),at=[];for(let Ee=0;Ee<mt.length;Ee++){const De=mt.key(Ee);De&&De.startsWith(gt.prefix)&&at.push(De)}for(const Ee of at)mt.removeItem(Ee);A(gt,S,W,n)}function nt(ut,gt,mt=null){if(typeof gt!="function")return()=>{};const at=mt||de(),Ee=K(ut,at);return n.has(Ee)||n.set(Ee,new Set),n.get(Ee).add(gt),()=>{var De;return(De=n.get(Ee))==null?void 0:De.delete(gt)}}function ct(ut,gt,mt={}){const at=de({storage:mt.storage,prefix:mt.prefix}),Ee=Pe(ut,gt,at),[De,ht,Nt]=oe.reactive.signal(Ee),bt=oe.reactive.effect(()=>{const lt=De();Ie(ut,lt,at)}),kt=nt(ut,lt=>{De()!==lt&&ht(lt)},at);return[De,ht,()=>{try{bt==null||bt()}catch(lt){}try{kt==null||kt()}catch(lt){}try{Nt==null||Nt()}catch(lt){}}]}de(),r.syncTabs&&window.addEventListener("storage",ut=>{if(!(!ut.key||!ut.storageArea))for(const gt of l.values()){if(Se(gt)!==ut.storageArea||!ut.key.startsWith(gt.prefix))continue;const mt=ut.key.slice(gt.prefix.length),at=ut.newValue==null?void 0:ge(ut.newValue),Ee=K(mt,gt);at===void 0?S.delete(Ee):S.set(Ee,at),Be(mt,at,gt)}});function xt(ut={}){Object.assign(r,ut),de()}function Pt(){return{prefix:r.prefix,storage:r.storage,syncTabs:r.syncTabs,cacheSize:S.size,scopeCount:l.size}}return{configure:xt,stats:Pt,get:Pe,set:Ie,remove:He,clear:Ke,watch:nt,signal:ct}})(),oe.store.computed=function(r){if(typeof r!="function")throw new Error("store.computed: fn must be a function");return oe.reactive.computed(r)},oe.store.migrate=function(r,S,n={}){var ge,ee;const W=(ge=n.versionKey)!=null?ge:"__version",l=Number((ee=oe.store.get(W,0))!=null?ee:0),ue=Number(r!=null?r:0);if(!Number.isFinite(ue)||ue<0)throw new Error("store.migrate: targetVersion non valido");if(l>=ue)return{from:l,to:ue,applied:0};let a=0;for(let A=l;A<ue;A++){const de=S==null?void 0:S[A];if(typeof de=="function")try{de(oe.store)}catch(Se){console.error("[store.migrate] step error at version",A,Se)}a++,oe.store.set(W,A+1)}return{from:l,to:ue,applied:a}},oe.store.model=function(r,S,n,W={}){if(typeof S!="string"||!S)throw new Error("store.model: key deve essere una stringa non vuota");const[l,ue,a]=oe.store.signal(S,n,{storage:W.storage,prefix:W.prefix}),ge=oe.rodFromSignal(l,ue),ee=oe.rodModel(r,ge,{event:W.event,parse:W.parse,format:W.format});return()=>{var A;try{ee==null||ee()}catch(de){}try{a==null||a()}catch(de){}try{(A=ge.dispose)==null||A.call(ge)}catch(de){}}},oe.store.bind=function(r,S,n,W={}){var ue;let l=r;return typeof r=="string"&&(r.includes("[")||r.includes(" ")?l=document.querySelectorAll(r):l=oe.dom.q(r)),l?oe.store.model(l,S,n,W):((ue=oe.config)!=null&&ue.debug&&console.warn("[store.bind] target non trovato:",r),()=>{})},oe.store.bindAll=function(r,S={},n={}){if(typeof r=="string"&&(r=oe.dom.q(r)),!r||!r.querySelectorAll)return console.warn("[store.bindAll] form non valido:",r),()=>{};const W=[];for(const[l,ue]of Object.entries(S)){const a=r.querySelectorAll(`[name="${l}"]`);if(!a.length)continue;const ge=oe.store.model(a.length===1?a[0]:a,l,ue,n);W.push(ge)}return()=>W.forEach(l=>l())},oe.store.inspect=function(){const r={...oe.store.stats(),keys:Array.from((function(){const S=oe.store.stats().storage==="session"?sessionStorage:localStorage,n=[];for(let W=0;W<S.length;W++){const l=S.key(W);l&&l.startsWith(oe.store.stats().prefix)&&n.push(l.replace(oe.store.stats().prefix,""))}return n})())};return console.groupCollapsed("[CMSwift.store.inspect]"),console.table(r.keys),console.log(r),console.groupEnd(),r},oe.store.autoForm=function(r,S={},n={}){var l;const W=oe.store.bindAll(r,S,n);return(l=oe.config)!=null&&l.debug&&console.log("[store.autoForm] autosave attivo:",S),W},oe.useStore=function(r,S,n,W={}){const[l,ue,a]=oe.store.signal(r,S,W);return n&&typeof n.onDispose=="function"&&typeof a=="function"&&n.onDispose(a),[l,ue]},oe._plugins=new Set,oe.usePlugin=function(r,S){var n;if(r){if(oe._plugins.has(r)){(n=oe.config)!=null&&n.debug&&console.warn("[CMSwift.usePlugin] plugin gi\xE0 installato:",r.name||r);return}if(typeof r=="function"){r(oe,S),oe._plugins.add(r);return}if(r&&typeof r.install=="function"){r.install(oe,S),oe._plugins.add(r);return}console.warn("[CMSwift.usePlugin] plugin non valido:",r)}},oe.plugins=oe.plugins||{},oe.plugins.debug={install(r){r.config.debug=!0,console.log("[CMSwift] Debug mode ON")}},oe.plugins.forms={install(r){const S={};r.forms={validate(n,W={},l={}){var de,Se;if(typeof n=="string"&&(n=r.dom.q(n)),!n||!n.querySelectorAll)return console.warn("[forms.validate] form non valido:",n),null;const ue={mode:l.mode||"input",showMessages:(de=l.showMessages)!=null?de:!0,submitGuard:(Se=l.submitGuard)!=null?Se:!0,errorClass:l.errorClass||"is-invalid",validClass:l.validClass||"is-valid",messageClass:l.messageClass||"form-error"},a={};for(const[Fe,K]of Object.entries(W)){const Be=n.querySelectorAll(`[name="${Fe}"]`);if(!Be.length)continue;const[tt,Ge]=r.reactive.signal(null);a[Fe]={getErr:tt,setErr:Ge,els:Be};let rt=null;ue.showMessages&&(rt=document.createElement("div"),rt.className=ue.messageClass,Be[Be.length-1].after(rt));const Pe=()=>{let Ie;const He=Be[0];if(He.type==="checkbox")Ie=He.checked;else if(He.type==="radio"){const ct=Array.from(Be).find(xt=>xt.checked);Ie=ct?ct.value:null}else Ie=He.value;let Ke=!0;try{Ke=K(Ie)}catch(ct){Ke=ct.message||"Errore di validazione"}const nt=Ke===!0?null:typeof Ke=="string"?Ke:"Valore non valido";return Ge(nt),!nt};for(const Ie of Be)Ie.addEventListener(ue.mode,Pe);r.reactive.effect(()=>{const Ie=tt();for(const He of Be)He.classList.toggle(ue.errorClass,!!Ie),He.classList.toggle(ue.validClass,!Ie);rt&&(rt.textContent=Ie||"",rt.style.display=Ie?"block":"none")}),Pe()}const ge=r.store.computed(()=>Object.values(a).every(Fe=>!Fe.getErr())),ee=Fe=>{let K=!0;for(const Be of Object.values(a)){const tt=Be.els[0];tt&&tt.dispatchEvent(new Event(ue.mode,{bubbles:!0})),Be.getErr()&&(K=!1)}!K&&ue.submitGuard&&(Fe.preventDefault(),Fe.stopPropagation())};ue.submitGuard&&n.addEventListener("submit",ee);const A=()=>{ue.submitGuard&&n.removeEventListener("submit",ee)};return S[n]={isValid:ge,dispose:A},{isValid:ge,dispose:A}}}}},oe._authShared=(()=>{function r(W){const l=()=>{var a;return((a=W())==null?void 0:a.roles)||[]},ue=()=>{var a;return((a=W())==null?void 0:a.permissions)||[]};return{roles:l,perms:ue,hasRole:a=>l().includes(a),can:a=>ue().includes(a),canAny:a=>a.some(ge=>l().includes(ge)||ue().includes(ge)),canAll:a=>a.every(ge=>l().includes(ge)||ue().includes(ge))}}function S(W,l){return l.some(ue=>typeof ue=="string"?W.startsWith(ue):ue instanceof RegExp?ue.test(W):!1)}function n(W,l){if(!W||!l)return;let ue=!1;function a(){return Date.now()}function ge(Fe){if(!Fe||typeof Fe!="string")return null;const K=Fe.split(".");if(K.length<2)return null;try{const Be=K[1].replace(/-/g,"+").replace(/_/g,"/"),tt=decodeURIComponent(atob(Be).split("").map(Ge=>"%"+Ge.charCodeAt(0).toString(16).padStart(2,"0")).join(""));return JSON.parse(tt)}catch(Be){return null}}function ee(){var Fe,K,Be,tt;if(typeof l._getState=="function"){const Ge=l._getState();return Ge&&typeof Ge=="object"?Ge:{user:(K=(Fe=l.user)==null?void 0:Fe.call(l))!=null?K:null}}return{user:(tt=(Be=l.user)==null?void 0:Be.call(l))!=null?tt:null}}function A(){var Pe,Ie,He;const Fe=ee()||{},K=(Ie=Fe.user)!=null?Ie:(Pe=l.user)==null?void 0:Pe.call(l),Be=(K==null?void 0:K.name)||(K==null?void 0:K.email)||(K==null?void 0:K.id)||"anon",tt=!!((He=l.isAuth)!=null&&He.call(l)),Ge=Fe.expiresAt||null,rt=Ge?Ge-a():null;return tt?`AUTH \u2705 user=${Be}${Ge?` expiresIn=${Math.round(rt/1e3)}s`:""}`:`AUTH \u274C user=${Be}`}function de(Fe="auth"){var xt,Pt,ut;const K=ee()||{},Be=(Pt=K.user)!=null?Pt:(xt=l.user)==null?void 0:xt.call(l),tt=(Be==null?void 0:Be.roles)||[],Ge=(Be==null?void 0:Be.permissions)||[],rt=K.accessToken||null,Pe=K.refreshToken||null,Ie=rt?ge(rt):null,He=K.expiresAt||(Ie!=null&&Ie.exp?Ie.exp*1e3:null),Ke=a(),nt=He?He-Ke:null,ct={label:Fe,isAuth:!!((ut=l.isAuth)!=null&&ut.call(l)),user:Be,roles:tt,permissions:Ge,has:{role:gt=>{var mt;return!!((mt=l.hasRole)!=null&&mt.call(l,gt))},can:gt=>{var mt;return!!((mt=l.can)!=null&&mt.call(l,gt))}},token:{hasAccess:!!rt,hasRefresh:!!Pe,expiresAt:He,expiresInSec:nt==null?null:Math.round(nt/1e3),decodedJWT:Ie}};return console.groupCollapsed(`[CMSwift.auth.inspect] ${Fe}`),console.log("status:",A()),console.log(ct),nt!=null&&(nt<=0?console.warn("\u26A0\uFE0F Access token scaduto."):nt<6e4&&console.warn("\u26A0\uFE0F Access token in scadenza (<60s).")),console.groupEnd(),ct}function Se(Fe=!0){ue=!!Fe,console.log("[CMSwift.auth.trace]",ue?"ON":"OFF")}if(typeof l.fetch=="function"&&!l._fetchWrapped){const Fe=l.fetch.bind(l);l.fetch=async(...K)=>{const Be=await Fe(...K);if(ue)try{console.log("[auth.fetch]",Be.status,K[0])}catch(tt){}return Be},l._fetchWrapped=!0}l.decodeJWT=ge,l.status=A,l.inspect=de,l.trace=Se}return{createPermissionApi:r,matchesProtectedPath:S,attachDevTools:n}})(),oe.plugins.auth={install(r,S={}){var Ke;const{createPermissionApi:n,matchesProtectedPath:W,attachDevTools:l}=oe._authShared,ue={key:S.key||"auth",loginRoute:S.loginRoute||"/login",protected:S.protected||[],autoRedirect:(Ke=S.autoRedirect)!=null?Ke:!0,endpoints:S.endpoints||{login:"/api/login",refresh:"/api/refresh",logout:"/api/logout"},fetchOptions:S.fetchOptions||{},tokenHeader:S.tokenHeader||"Authorization",tokenPrefix:S.tokenPrefix||"Bearer ",refreshMargin:S.refreshMargin||3e4},[a,ge]=r.store.signal(ue.key,null),ee=()=>{var nt;return((nt=a())==null?void 0:nt.user)||null},A=()=>{var nt;return!!((nt=a())!=null&&nt.accessToken)},{hasRole:de,can:Se,canAny:Fe,canAll:K}=n(ee);let Be=!1,tt=[];function Ge(){const nt=a();return nt!=null&&nt.expiresAt?Date.now()>nt.expiresAt-ue.refreshMargin:!1}async function rt(){var nt;if(Be)return new Promise((ct,xt)=>tt.push({res:ct,rej:xt}));Be=!0;try{const ct=await fetch(ue.endpoints.refresh,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:(nt=a())==null?void 0:nt.refreshToken})});if(!ct.ok)throw new Error("Refresh failed");const xt=await ct.json();return ge({...a(),...xt}),tt.forEach(Pt=>Pt.res(!0)),tt=[],!0}catch(ct){throw tt.forEach(xt=>xt.rej(ct)),tt=[],ge(null),ue.autoRedirect&&r.router.navigate(ue.loginRoute),ct}finally{Be=!1}}async function Pe(nt){const ct=await fetch(ue.endpoints.login,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(nt)});if(!ct.ok)throw new Error("Login failed");const xt=await ct.json();return ge(xt),xt}async function Ie(){try{await fetch(ue.endpoints.logout,{method:"POST"})}catch(nt){}ge(null),ue.autoRedirect&&r.router.navigate(ue.loginRoute)}async function He(nt,ct={}){var gt;Ge()&&await rt();const xt=a(),Pt=new Headers(ct.headers||{});xt!=null&&xt.accessToken&&Pt.set(ue.tokenHeader,ue.tokenPrefix+xt.accessToken);const ut=await fetch(nt,{...ue.fetchOptions,...ct,headers:Pt});return ut.status===401&&((gt=a())!=null&>.refreshToken)&&!ct._authRetried?(await rt(),He(nt,{...ct,_authRetried:!0})):ut}r.router.beforeEach(nt=>{const ct=nt.path;return W(ct,ue.protected)&&!A()?ue.loginRoute:!0}),r.auth={user:ee,isAuth:A,hasRole:de,can:Se,canAny:Fe,canAll:K,loginAsync:Pe,logoutAsync:Ie,fetch:He,_getState:a},r.useAuth=function(nt){return nt&&nt.onDispose,r.auth},l(oe,r.auth)}},oe._httpShared=(()=>{function r(A){var at;const de=A.reactive,[Se,Fe]=de.signal(0),[K,Be]=de.signal("idle"),[tt,Ge]=de.signal(null),[rt,Pe]=de.signal(null),[Ie,He]=de.signal(null),[Ke,nt]=de.signal(0),[ct,xt]=de.signal(0);let Pt=0;function ut(Ee){const De=++Pt,ht=Date.now();return Fe(Se()+1),Be("pending"),He(null),Pe(null),Ge({id:De,url:Ee.url,method:Ee.method,meta:Ee.meta,timeout:Ee.timeout,retry:Ee.retry,startedAt:ht}),xt(ht),De}function gt(Ee,De,ht,Nt){const bt=Date.now();Fe(Math.max(0,Se()-1)),Ee===Pt&&(ht?(Be("error"),He(ht),Pe(null)):De?(Be("success"),He(null),Pe({id:Ee,status:De.status,ok:De.ok,headers:De.headers,url:De.url,receivedAt:bt,raw:De})):(Be("idle"),He(null),Pe(null)),nt(Math.max(0,Number(Nt||0)))),xt(bt)}return{state:{inFlight:Se,status:K,isLoading:(at=A.store)!=null&&at.computed?A.store.computed(()=>Se()>0):()=>Se()>0,lastRequest:tt,lastResponse:rt,lastError:Ie,lastDuration:Ke,lastUpdated:ct,reset(){Fe(0),Be("idle"),Ge(null),Pe(null),He(null),nt(0),xt(Date.now())}},markStart:ut,markEnd:gt}}function S(A,de){if(!A||/^https?:\/\//i.test(de))return de;const Se=A.endsWith("/")?A.slice(0,-1):A,Fe=de.startsWith("/")?de:"/"+de;return Se+Fe}function n(A){return new Promise(de=>setTimeout(de,A))}function W(A,de){return A?!0:de?de.status===429||de.status>=500&&de.status<=599:!1}function l(A,de){if(!A&&!de)return{signal:void 0,cancel:()=>{}};const Se=new AbortController,Fe=Se.signal;let K=null;A>0&&(K=setTimeout(()=>Se.abort(new Error("timeout")),A));const Be=()=>Se.abort(de.reason||new Error("aborted"));return de&&(de.aborted?Be():de.addEventListener("abort",Be,{once:!0})),{signal:Fe,cancel:()=>{var Ge;K&&clearTimeout(K),de&&((Ge=de.removeEventListener)==null||Ge.call(de,"abort",Be))}}}function ue(A,de,Se={}){var tt,Ge,rt;const Fe=typeof de=="string"?S(A.baseURL,de):de,K=(Se.method||"GET").toUpperCase(),Be=new Headers(A.headers);return Se.headers&&new Headers(Se.headers).forEach((Pe,Ie)=>Be.set(Ie,Pe)),{url:Fe,method:K,headers:Be,body:Se.body,credentials:(tt=Se.credentials)!=null?tt:A.credentials,signal:Se.signal,timeout:(Ge=Se.timeout)!=null?Ge:A.timeout,retry:(rt=Se.retry)!=null?rt:A.retry,meta:Se.meta||{}}}async function a(A,...de){var Fe;let Se=de[0];for(const K of A)Se=(Fe=await K(Se,...de.slice(1)))!=null?Fe:Se;return Se}function ge(A,de){return{ok:A.ok,status:A.status,headers:A.headers,raw:A,req:de,async json(){let Se=null,Fe=null;try{Se=await A.json()}catch(K){Se=null}return A.ok||(Fe=Se!=null?Se:{status:A.status}),{data:Se,error:Fe,ok:A.ok,status:A.status}},async jsonStrict(){const{data:Se,error:Fe}=await this.json();if(Fe){const K=new Error(`HTTP error ${A.status} ${(de==null?void 0:de.method)||""} ${(de==null?void 0:de.url)||""}`.trim());throw K.status=A.status,K.data=Se,K.req={url:de==null?void 0:de.url,method:de==null?void 0:de.method,meta:de==null?void 0:de.meta},K}return{data:Se,ok:!0,status:A.status}},async text(){let Se="";try{Se=await A.text()}catch(Fe){}return{text:Se,ok:A.ok,status:A.status}},async textStrict(){const Se=await this.text();if(!Se.ok){const Fe=new Error("HTTP error "+A.status);throw Fe.status=A.status,Fe.text=Se.text,Fe}return Se}}}function ee(A,de,Se,Fe,K={}){const Be=new Headers(K.headers||{});return Be.has("Content-Type")||Be.set("Content-Type","application/json"),A(Se,{...K,method:de,headers:Be,body:Fe==null?void 0:JSON.stringify(Fe)})}return{createReactiveState:r,joinURL:S,sleep:n,isRetryable:W,makeAbort:l,normalizeRequest:ue,runHooks:a,wrapResponse:ge,withJSON:ee}})();const{createReactiveState:Sn,sleep:Fo,isRetryable:C,makeAbort:Go,normalizeRequest:Ko,runHooks:po,wrapResponse:Qt,withJSON:_n}=oe._httpShared,Fn=typeof globalThis!="undefined"&&globalThis.CMSwift_setting?globalThis.CMSwift_setting:{},ho={baseURL:((Lo=Fn.http)==null?void 0:Lo.baseURL)||"",timeout:(zo=(Eo=Fn.http)==null?void 0:Eo.timeout)!=null?zo:0,retry:((wt=Fn.http)==null?void 0:wt.retry)||{attempts:0,delay:250,factor:2},headers:((to=Fn.http)==null?void 0:to.headers)||{},credentials:(E=Fn.http)==null?void 0:E.credentials,debug:(no=Fn.debug)!=null?no:!1},Zn=Sn(oe),eo=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now(),dn={beforeRequest:new Set,afterResponse:new Set,onError:new Set};async function Io(r){const S=oe.auth&&typeof oe.auth.fetch=="function"?oe.auth.fetch.bind(oe.auth):fetch,n={method:r.method,headers:r.headers,body:r.body,credentials:r.credentials,signal:r.signal};return S(r.url,n)}async function ln(r,S={}){var K,Be,tt;let n=Ko(ho,r,S);n=await po(dn.beforeRequest,n);const W=Zn.markStart(n),l=eo(),ue=n.retry||{attempts:0,delay:250,factor:2},a=Math.max(0,Number(ue.attempts||0));let ge=Math.max(0,Number(ue.delay||0));const ee=Math.max(1,Number(ue.factor||2));let A=null,de=null,Se=null,Fe=null;try{for(let Ge=0;Ge<=a;Ge++){A=null,de=null;const{signal:rt,cancel:Pe}=Go(n.timeout,S.signal),Ie={...n,signal:rt},He=eo();try{ho.debug&&console.log("[http.request]",Ie.method,Ie.url),(K=oe.perf)==null||K.inc("httpRequests"),(Be=oe.perf)==null||Be.mark("http:req",{url:n.url,method:n.method});const Ke=await Io(Ie);de=Ke;const nt=await po(dn.afterResponse,Ke,Ie),ct=eo()-He;if((tt=oe.perf)==null||tt.tick("http:res",ct,{status:Ke.status,url:n.url}),Ge<a&&C(null,nt)){Pe(),await Fo(ge),ge=Math.round(ge*ee);continue}return Pe(),Se=nt,Qt(nt,Ie)}catch(Ke){A=Ke,Pe();for(const nt of dn.onError)try{nt(Ke,Ie)}catch(ct){}if(Ge<a&&C(Ke,null)){await Fo(ge),ge=Math.round(ge*ee);continue}throw Fe=Ke,Ke}}}finally{const Ge=eo()-l;Zn.markEnd(W,Se,Fe,Ge)}if(A)throw A;return Qt(de,n)}oe.http={},oe.http.request=ln,oe.http.state=()=>Zn.state,oe.http.get=(r,S)=>ln(r,{...S,method:"GET"}),oe.http.del=(r,S)=>ln(r,{...S,method:"DELETE"}),oe.http.post=(r,S,n)=>_n(ln,"POST",r,S,n),oe.http.put=(r,S,n)=>_n(ln,"PUT",r,S,n),oe.http.patch=(r,S,n)=>_n(ln,"PATCH",r,S,n),oe.http.getJSON=async(r,S)=>(await ln(r,{...S,method:"GET"})).jsonStrict(),oe.http.delJSON=async(r,S)=>(await ln(r,{...S,method:"DELETE"})).jsonStrict(),oe.http.postJSON=async(r,S,n)=>(await _n(ln,"POST",r,S,n)).jsonStrict(),oe.http.putJSON=async(r,S,n)=>(await _n(ln,"PUT",r,S,n)).jsonStrict(),oe.http.patchJSON=async(r,S,n)=>(await _n(ln,"PATCH",r,S,n)).jsonStrict(),oe.http.onBefore=function(r){return dn.beforeRequest.add(r),()=>dn.beforeRequest.delete(r)},oe.http.onAfter=function(r){return dn.afterResponse.add(r),()=>dn.afterResponse.delete(r)},oe.http.onError=function(r){return dn.onError.add(r),()=>dn.onError.delete(r)},window._http=oe.http,oe.useRouter=function(r){const S=oe.router;return r&&r.onDispose,{navigate:S.navigate,back:()=>history.back(),forward:()=>history.forward(),get current(){return S}}},oe.useRoute=function(r){const[S,n]=oe.reactive.signal(""),[W,l]=oe.reactive.signal({}),[ue,a]=oe.reactive.signal({}),[ge,ee]=oe.reactive.signal(""),A=Se=>{n(Se.path||""),l(Se.params||{}),a(Se.query||{}),ee(Se.hash||"")},de=oe.router.subscribe(A);return r&&typeof r.onDispose=="function"&&r.onDispose(de),{path:S,params:W,query:ue,hash:ge}},oe._routerShared=(()=>{function r(ge){return ge?(ge.startsWith("/")||(ge="/"+ge),ge.length>1&&ge.endsWith("/")&&(ge=ge.slice(0,-1)),ge):"/"}function S(ge,ee=""){if(ee&&ge.startsWith(ee)){const A=ge.slice(ee.length)||"/";return r(A)}return r(ge)}function n(ge){ge=r(ge);const ee=[],A=ge.replace(/([.+*?=^!${}()[\]|/\\])/g,"\\$1").replace(/\\\/:([A-Za-z0-9_]+)/g,(de,Se)=>(ee.push(Se),"\\/([^\\/]+)"));return{pattern:ge,regex:new RegExp("^"+A+"$"),keys:ee}}function W(ge){const ee={};return new URLSearchParams(ge||"").forEach((de,Se)=>{ee[Se]===void 0?ee[Se]=de:Array.isArray(ee[Se])?ee[Se].push(de):ee[Se]=[ee[Se],de]}),ee}function l(ge){const ee=[];for(const A of ge)if(ee.push({...A,_parent:null}),A.children&&A.children.length)for(const de of A.children)ee.push({...de,_parent:A});return ee.sort((A,de)=>de.path.length-A.path.length),ee}function ue(ge,ee){const A=r(ge),de=l(ee);for(const Se of de){const Fe=Se._compiled.regex.exec(A);if(!Fe)continue;const K={};return Se._compiled.keys.forEach((Be,tt)=>{K[Be]=decodeURIComponent(Fe[tt+1])}),{route:Se,params:K,parent:Se._parent||null}}return null}function a(ge,ee,A=50){ge.push({at:Date.now(),path:ee.path,params:ee.params,query:ee.query,hash:ee.hash}),ge.length>A&&ge.shift()}return{normalizePath:r,stripBase:S,compilePattern:n,parseQuery:W,flattenRoutes:l,matchRoute:ue,pushHistoryEntry:a}})(),oe._uiMetaShared=(()=>{function r(a){return{hasTabPanel:typeof a.TabPanel=="function",Card:typeof a.Card=="function"?a.Card:(...ge)=>a.div({class:"cms-doc-card"},...ge),Chip:typeof a.Chip=="function"?a.Chip:(ge,ee)=>a.span({class:"cms-chip cms-chip-fallback"},ee)}}function S(a){return a?Array.isArray(a)?a.join(" | "):String(a):"\u2014"}function n(a,ge,ee){return a.div({class:"cms-doc-meta"},a.div({class:"cms-doc-meta-head"},a.div({class:"cms-doc-meta-name"},ge.name),a.div({class:"cms-doc-meta-types"},...ge.type?String(ge.type).split("|").map(A=>ee({color:"secondary",dense:!0,outline:!0},A)):[a.span("\u2014")])),a.div({class:"cms-doc-meta-grid"},a.div({class:"cms-doc-meta-block"},a.div({class:"cms-doc-meta-label"},"Default"),a.div({class:"cms-doc-meta-value"},ge.default==null?"\u2014":String(ge.default))),a.div({class:"cms-doc-meta-block"},a.div({class:"cms-doc-meta-label"},"Values"),a.div({class:"cms-doc-meta-value"},S(ge.values)))),a.div({class:"cms-doc-meta-block"},a.div({class:"cms-doc-meta-label"},"Description"),a.div({class:"cms-doc-meta-value"},ge.description||"\u2014")))}function W(a,ge){return a.div({class:"cms-doc-fallback"},ge.map(ee=>a.div({class:"cms-doc-fallback-item"},a.h4({class:"cms-doc-fallback-title"},ee.label||ee.name),ee.content)))}function l(a,ge){return ge?Array.isArray(ge)?ge.map(ee=>({name:ee.name,wrap:!0,label:ee.name,content:a.div({class:"cms-p-md"},ee.description)})):Object.entries(ge).map(([ee,A])=>({name:ee,wrap:!0,label:ee,content:a.div({class:"cms-p-md"},A)})):[]}function ue(a,ge){return ge?Array.isArray(ge)?ge.map(ee=>({name:ee.name,wrap:!0,label:ee.type,content:ee.description})):Object.entries(ge).map(([ee,A])=>({name:ee,wrap:!0,label:ee,content:a.div({class:"cms-doc-meta"},a.div({class:"cms-doc-meta-head"},a.div({class:"cms-doc-meta-name"},ee)),a.div({class:"cms-doc-meta-grid"},a.div({class:"cms-doc-meta-block"},a.div({class:"cms-doc-meta-label"},"Type"),a.div({class:"cms-doc-meta-value"},A.type||"\u2014"))),a.div({class:"cms-doc-meta-block"},a.div({class:"cms-doc-meta-label"},"Description"),a.div({class:"cms-doc-meta-value"},A.description||"\u2014")))})):[]}return{resolveDocComponents:r,renderMetaItem:n,renderTabGroupFallback:W,normalizeEventRows:l,normalizeSlotRows:ue}})(),oe.ui=oe.ui||{},oe.ui.meta=oe.ui.meta||{},oe.ui.slot=function(S,n={}){const W=oe.ui,{as:l="node",wrap:ue="span",iconProps:a=null,filter:ge=!0}=n,ee=Fe=>document.createTextNode(String(Fe)),A=Fe=>_.span(String(Fe)),de=Fe=>{if(Fe==null||Fe===!1)return null;if(typeof Fe=="function")return Fe;if(Array.isArray(Fe))return Fe.flatMap(de).filter(Boolean);if(Fe&&typeof Fe=="object"&&Fe.nodeType)return Fe;if(typeof Fe=="string"||typeof Fe=="number"||typeof Fe=="boolean"){const K=String(Fe);return l==="icon"&&W.Icon?W.Icon(K,{class:"cms-slot-icon",...a||{}}):ue==="text"?ee(K):ue==="span"?A(K):K}return ue==="text"?ee(Fe):ue==="span"?A(Fe):String(Fe)},Se=de(S);return ge&&Array.isArray(Se)?Se.filter(Boolean):Se},oe.ui.slots=function(...S){const n=[];for(const W of S){const l=oe.ui.slot(W);l&&(Array.isArray(l)?n.push(...l):n.push(l))}return n},oe.docTable=r=>{var rt;if(!oe.isDev())return _.div();const{resolveDocComponents:S,renderMetaItem:n,renderTabGroupFallback:W,normalizeEventRows:l,normalizeSlotRows:ue}=oe._uiMetaShared,a=(rt=oe.ui.meta)==null?void 0:rt[r];if(!a)return _.div({class:"cms-muted"},`Meta non trovata: ${r}`);const{hasTabPanel:ge,Card:ee,Chip:A}=S(_),de={};Object.entries(a.props||{}).forEach(([Pe,Ie])=>{const He=Ie.category||"general";de[He]||(de[He]=[]),de[He].push({name:Pe,...Ie})});const Se=Object.keys(de).map(Pe=>{const Ie=de[Pe].map(He=>({name:He.name,wrap:!0,label:He.name,content:n(_,He,A)}));return{name:Pe,wrap:!0,label:Pe,content:ge?_.TabPanel({orientation:"vertical",animated:!0,radius:"0 0 0 var(--cms-r-default)",tabs:Ie}):W(_,Ie)}}),Fe=l(_,a.events),K=ue(_,a.slots),Be=_.rod(null),tt=[];K.length&&tt.push({name:"Slots",wrap:!0,label:"Slots",content:ge?_.TabPanel({animated:!0,radius:"0 0 0 var(--cms-r-default)",orientation:"vertical",tabs:K}):W(_,K)}),Se.length&&tt.push(...Se),Fe.length&&tt.push({name:"Events",wrap:!0,label:"Events",content:ge?_.TabPanel({animated:!0,radius:"0 0 0 var(--cms-r-default)",orientation:"vertical",tabs:Fe}):W(_,Fe)});const Ge="general";return tt.sort((Pe,Ie)=>Pe.name===Ge?-1:Ie.name===Ge?1:Pe.name.localeCompare(Ie.name)),ee({class:"cms-doc-table"},_.div({class:"cms-doc-table-header"},_.div({class:"cms-doc-table-title"},`_.${r}`),a.signature?_.div({class:"cms-doc-table-signature"},String(a.signature).replaceAll("UI.","_.")):null),tt.length?_.h4({class:"cms-doc-table-section-title"},Se.length?"Props":"Documentation"):_.p({class:"cms-muted"},"Nessuna documentazione strutturata disponibile."),tt.length?ge?_.TabPanel({border:!0,animated:!0,orientation:"horizontal",tabs:tt,model:Be}):W(_,tt):null,a.returns?_.p({class:"cms-muted",style:{marginTop:"14px"}},`Returns: ${a.returns}`):null)},oe.ui.inspect=r=>{var S;return console.log(((S=oe.ui.meta)==null?void 0:S[r])||"meta not found")},oe.ui.can=function(r,S,n,W=null){var a,ge;const l=oe.useAuth?oe.useAuth(r):oe.auth;return l?(typeof S=="function"?!!S(l):((a=l.can)==null?void 0:a.call(l,S))||((ge=l.hasRole)==null?void 0:ge.call(l,S)))?typeof n=="function"?n():n:typeof W=="function"?W():W:typeof W=="function"?W():null},oe.ui.canAny=function(r,S,n,W=null){var a;const l=oe.useAuth?oe.useAuth(r):oe.auth;return!!((a=l==null?void 0:l.canAny)!=null&&a.call(l,S))?typeof n=="function"?n():n:typeof W=="function"?W():W},oe.ui.canAll=function(r,S,n,W=null){var a;const l=oe.useAuth?oe.useAuth(r):oe.auth;return!!((a=l==null?void 0:l.canAll)!=null&&a.call(l,S))?typeof n=="function"?n():n:typeof W=="function"?W():W},oe.Can=function(S,n){var ue,a;const W=oe.useAuth?oe.useAuth(n):oe.auth;return(()=>{var ge,ee,A,de;return W?S.when&&typeof S.when=="function"?!!S.when(W):S.perm?!!((ge=W.can)!=null&&ge.call(W,S.perm)):S.role?!!((ee=W.hasRole)!=null&&ee.call(W,S.role)):S.any?!!((A=W.canAny)!=null&&A.call(W,S.any)):S.all?!!((de=W.canAll)!=null&&de.call(W,S.all)):!1:!1})()?typeof S.then=="function"?S.then():(ue=S.then)!=null?ue:null:typeof S.else=="function"?S.else():(a=S.else)!=null?a:null},oe.router=(()=>{let r="history",S=[],n=null,W=null,l="",ue=null,a=null,ge=[],ee=!1;const{normalizePath:A,stripBase:de,compilePattern:Se,parseQuery:Fe,matchRoute:K,pushHistoryEntry:Be}=oe._routerShared,tt={setOutlet:{description:"imposta il contenitore del router"},setBase:{description:"imposta il base path del router"},add:{description:"per aggiungere la route"},notFound:{description:"imposta la view 404"},beforeEach:{description:"hook prima di ogni navigazione"},start:{description:"avvia il router"},navigate:{description:"naviga verso una route"},subscribe:{description:"sottoscrive agli aggiornamenti di route"},current:{description:"ritorna l'URL corrente"},isActive:{description:"verifica se una route e\u0300 attiva"},status:{description:"stringa di stato router"},inspect:{description:"stampa info diagnostiche"},trace:{description:"abilita/disabilita tracing"},history:{description:"ritorna la history interna"},setURLOnly:{description:"aggiorna solo l'URL del browser senza render/meta"}};function Ge(it,{replace:lt=!1}={}){const vt=typeof it=="string"?new URL(it,window.location.origin):it,Dt=vt.pathname+vt.search+vt.hash;if(r==="hash"||r==="auto"){if(history.pushState){const on="#"+Dt;lt?history.replaceState({},"",on):history.pushState({},"",on);return}const en="#"+Dt;lt?window.location.replace(en):window.location.hash=en;return}lt?history.replaceState({},"",l+Dt):history.pushState({},"",l+Dt)}function rt(){if(r==="hash"){const it=window.location.hash||"#/",lt=it.startsWith("#")?it.slice(1):it;return new URL(lt,window.location.origin)}if(r==="auto"&&window.location.hash.startsWith("#/")){const it=window.location.hash.slice(1);return new URL(it,window.location.origin)}return new URL(window.location.href)}function Pe(it,lt=!1){if(r==="hash"||r==="auto"&&!history.pushState){const vt="#"+(it.pathname+it.search+it.hash);lt?window.location.replace(vt):window.location.hash=vt;return}lt?history.replaceState({},"",l+it.pathname+it.search+it.hash):history.pushState({},"",l+it.pathname+it.search+it.hash)}function Ie(it){r=it||"history"}function He(it){return de(it,l)}function Ke(it){if(!it)return!1;const lt=a?a.path:He(rt().pathname);let vt=it;typeof vt=="string"&&(vt.includes("?")||vt.includes("#")||vt.includes("://"))&&(vt=new URL(vt,window.location.origin).pathname);const Dt=He(vt);return Dt.includes(":")?Se(Dt).regex.test(lt):Dt===lt}async function nt(it,{replace:lt=!1}={}){if(!n){console.warn("[router] outlet non impostato. Usa CMSwift.router.setOutlet('#app').");return}const vt=typeof it=="string"?new URL(it,window.location.origin):it;ee&&console.log("[router.navigate]",vt.toString());const Dt=vt.pathname+vt.search+vt.hash;Pe(vt,lt);const en=He(vt.pathname),on=K(en,S),Tt={path:en,fullPath:Dt,params:on?on.params:{},query:Fe(vt.search),hash:vt.hash||"",navigate:ct,outlet:n};if(ue){const Jt=await ue(Tt);if(Jt===!1)return;if(typeof Jt=="string"){ct(Jt,{replace:!0});return}}if(typeof W=="function"){try{W()}catch(Jt){console.error("[router] unmount error:",Jt)}W=null}if(!on){const Jt=S._notFound;Jt?W=oe.mount(n,()=>Jt(Tt),{clear:!0}):W=oe.mount(n,_.div("404"),{clear:!0}),De(Tt),a=Tt,Be(ge,Tt);return}const In=on.route.view,zn=on.parent;let $n=null;if(Tt.renderChild=Jt=>{if(!Tt._child)return null;const oo=typeof Jt=="string"?Tt.outlet.querySelector(Jt):Jt;return oo?($n=oe.mount(oo,()=>Tt._child.view(Tt._child.ctx),{clear:!0}),$n):(console.warn("[router] child outlet non trovato:",Jt),null)},zn){const Jt=on.route,oo={...Tt,params:{...Tt.params}};Tt._child={view:Jt.view,ctx:oo},W=oe.mount(n,()=>zn.view(Tt),{clear:!0})}else Tt._child=null,W=oe.mount(n,()=>In(Tt),{clear:!0});De(Tt),a=Tt,Be(ge,Tt)}function ct(it,lt={}){const vt=new URL(it,window.location.origin);nt(vt,lt)}function xt(){window.addEventListener("popstate",()=>{nt(rt(),{replace:!0})}),window.addEventListener("hashchange",()=>{(r==="hash"||r==="auto")&&nt(rt(),{replace:!0})}),document.addEventListener("click",it=>{var Tt,In;const lt=(In=(Tt=it.target)==null?void 0:Tt.closest)==null?void 0:In.call(Tt,"a");if(!lt||it.defaultPrevented||it.button!==0||it.metaKey||it.ctrlKey||it.shiftKey||it.altKey||lt.hasAttribute("download")||lt.target&<.target!=="_self")return;const vt=lt.getAttribute("href");if(!vt||vt.startsWith("mailto:")||vt.startsWith("tel:"))return;const Dt=new URL(vt,window.location.origin);if(Dt.origin!==window.location.origin)return;const en=new URL(window.location.href);Dt.pathname+Dt.search===en.pathname+en.search&&Dt.hash||(it.preventDefault(),ct(Dt.pathname+Dt.search+Dt.hash))}),nt(rt(),{replace:!0})}function Pt(it){return n=typeof it=="string"?oe.dom.q(it):it,n}function ut(it){l=it?A(it):"",l==="/"&&(l="")}function gt(it,lt,vt=null){const Dt=Se(it),en={path:Dt.pattern,view:lt,_compiled:Dt,children:[]};if(Array.isArray(vt))for(const on of vt){const[Tt,In,zn]=on,$n=A(Dt.pattern+"/"+(Tt||"").replace(/^\//,""));en.children.push({path:$n,view:In,_compiled:Se($n),children:Array.isArray(zn)?zn:[]})}S.push(en)}function mt(it){S._notFound=it}function at(it){ue=it}let Ee=new Set;function De(it){for(const lt of Ee)try{lt(it)}catch(vt){console.error("[router] listener error:",vt)}}function ht(){if(!a)return"ROUTER \u23F3 not ready";const it=Object.keys(a.query||{}).length?"?":"";return`ROUTER ${a.path}${it} ${a.hash||""}`}function Nt(it="router"){if(!a)return console.warn("[router.inspect] nessuna route attiva"),null;const lt={label:it,mode:typeof r!="undefined"?r:"unknown",base:l,path:a.path,params:a.params,query:a.query,hash:a.hash,outlet:n,timestamp:new Date().toISOString()};return console.groupCollapsed(`[CMSwift.router.inspect] ${it}`),console.log(lt),console.log("history:",ge.slice()),console.groupEnd(),lt}function bt(it=!0){ee=!!it,console.log("[CMSwift.router.trace]",ee?"ON":"OFF")}function kt(){return ge.slice()}return{meta:tt,setOutlet:Pt,setBase:ut,add:gt,setURLOnly:Ge,notFound:mt,beforeEach:at,start:xt,navigate:ct,isActive:Ke,subscribe(it){return Ee.add(it),()=>Ee.delete(it)},current(){return rt?rt():new URL(window.location.href)},status:ht,inspect:Nt,trace:bt,history:kt}})(),(Zt=oe.config)!=null&&Zt.debug&&(window.$router=oe.router),oe.signal=oe.reactive.signal,oe.effect=oe.reactive.effect,oe.computed=oe.reactive.computed,oe.untracked=oe.reactive.untracked,oe.batch=oe.reactive.batch})(),(function(ot){var hs,bs,ys,ws,vs,Ss,Cs,xs,As,Ns,ks,Ms,_s,Fs,Is,Ls,Es,zs,Ts,Ps,Os,Rs,Ds,Hs,js,Vs,Bs,$s,Ws,Us,Gs,Ks,qs,Ys,Xs,Js,Qs,Zs,ei,ti,ni,oi,si,ii,ri,li,ai,ci,ui,di,fi,mi,gi,pi,hi,bi,yi;ot.ui=ot.ui||{},ot.services=ot.services||{},ot.services.notify=ot.services.notify||{};const Un=Symbol("cms.ui.rodPathRaw"),kn=Symbol("cms.ui.rodPathEnhanced"),Gn=Symbol("cms.ui.rodPathPatchedH"),Hn=Symbol("cms.ui.rodPathWrappedUI"),jn=new WeakMap,lo=new WeakMap,wn=[],ao=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},hn=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"},Mn=t=>{if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};let co=!1;const uo=()=>{co||(co=!0,queueMicrotask(()=>{co=!1,wn.length=0}))},xo=t=>{wn.push(t),wn.length>128&&wn.splice(0,wn.length-128),uo()},Ao=()=>{if(!wn.length)return null;const t=wn.slice();return wn.length=0,{items:t,index:0}},Vn=(t,e)=>{if(!t)return null;const s=t.items[t.index];return!s||!Object.is(s.value,e)?null:(t.index+=1,s)},fo=t=>t&&typeof t=="object"&&t[Un]?t[Un]:t,Ln=(t,e)=>{const s=jn.get(t);if(!s)return;let o=s.rawGet();for(const i of e){if(o==null)return;o=o[i]}return o},Kn=(t,e,s)=>{const o=jn.get(t);if(!o)return;const i=fo(s);if(!e.length){if(Object.is(o.rawGet(),i))return;o.rawSet(i);return}let f=o.rawGet();(!f||typeof f!="object")&&(f=ao(e[0])?[]:{});let c=f;for(let d=0;d<e.length-1;d++){const h=e[d];let b=c[h];if(!b||typeof b!="object"){const $=e[d+1];b=ao($)?[]:{},c[h]=b}c=b}Object.is(c[e[e.length-1]],i)||(c[e[e.length-1]]=i,o.rawSet(f))},No=(t,e)=>[()=>Ln(t,e),s=>Kn(t,e,s)],ko=(t,e,s=[])=>{if(!e||typeof e!="object")return e;let o=lo.get(t);o||(o=new WeakMap,lo.set(t,o));const i=o.get(e);if(i)return i;const f=new Proxy(e,{get(c,d,h){if(d===Un)return c;const b=Reflect.get(c,d,h);if(typeof d=="symbol")return b;const $=s.concat(d);return b&&typeof b=="object"?ko(t,b,$):typeof b=="function"?b.bind(h):(hn(b)&&xo({rod:t,path:$,value:b}),b)},set(c,d,h,b){const $=fo(h),F=Reflect.get(c,d,b);if(Object.is(F,$))return!0;const D=Reflect.set(c,d,$,b);if(D){const R=jn.get(t);R==null||R.rawSet(R.rawGet())}return D},deleteProperty(c,d){const h=Reflect.has(c,d),b=Reflect.deleteProperty(c,d);if(b&&h){const $=jn.get(t);$==null||$.rawSet($.rawGet())}return b}});return o.set(e,f),f},Mo=t=>{if(!t||typeof t!="object"||t.type!=="rod"||t[kn])return t;const e=Object.getOwnPropertyDescriptor(t,"value");if(!e||typeof e.get!="function"||typeof e.set!="function")return t;const s=()=>e.get.call(t),o=i=>e.set.call(t,fo(i));return jn.set(t,{rawGet:s,rawSet:o}),Object.defineProperty(t,"value",{get(){const i=s();return!i||typeof i!="object"?i:ko(t,i,[])},set(i){o(i)},configurable:!0}),Object.defineProperty(t,kn,{value:!0,configurable:!1}),t},$o=()=>{if(typeof window._.rod!="function"||window._.rod[kn])return;const t=window._.rod,e=function(...o){return Mo(t(...o))};Object.defineProperty(e,kn,{value:!0,configurable:!1}),window._.rod=e},qn=(t,e,s="")=>{if(Array.isArray(t)){let f=!1;const c=t.map(d=>{const h=qn(d,e,"");return h!==d&&(f=!0),h});return f?c:t}if(hn(t)){const f=Vn(e,t);return f?s==="model"?No(f.rod,f.path):()=>Ln(f.rod,f.path):t}if(!Mn(t))return t;let o=!1;const i={};for(const f of Object.keys(t)){const c=qn(t[f],e,f);i[f]=c,c!==t[f]&&(o=!0)}return o?i:t},mo=(t,e,s="")=>{if(Array.isArray(t)){let f=!1;const c=t.map(d=>{const h=mo(d,e,"");return h!==d&&(f=!0),h});return f?c:t}if(hn(t)){const f=Vn(e,t);return f?s==="model"?No(f.rod,f.path):()=>Ln(f.rod,f.path):t}if(!Mn(t))return t;let o=!1;const i={};for(const f of Object.keys(t)){const d=f==="model"||f==="children"?mo(t[f],e,f):t[f];i[f]=d,d!==t[f]&&(o=!0)}return o?i:t},Yn=t=>{if(typeof t!="function"||t[Hn])return t;const e=function(...o){const i=Ao();if(!i)return t.apply(this,o);let f=!1;const c=o.map(d=>{const h=mo(d,i,"");return h!==d&&(f=!0),h});return t.apply(this,f?c:o)};return Object.defineProperty(e,Hn,{value:!0,configurable:!1}),e},Wo=()=>{const t=ot.ui;if(!(!t||t[Hn])){Object.defineProperty(t,Hn,{value:!0,configurable:!1});for(const e of Object.keys(t))typeof t[e]=="function"&&(t[e]=Yn(t[e]));ot.ui=new Proxy(t,{get(e,s,o){return Reflect.get(e,s,o)},set(e,s,o,i){const f=typeof o=="function"?Yn(o):o;return Reflect.set(e,s,f,i)}})}},ss=()=>{if(!(!window._||window._[Gn])){Object.defineProperty(window._,Gn,{value:!0,configurable:!1});for(const t of Object.keys(window._)){const e=window._[t];typeof e=="function"&&(window._[t]=function(...o){const i=Ao();if(!i)return e.apply(this,o);let f=!1;const c=o.map(d=>{const h=qn(d,i,"");return h!==d&&(f=!0),h});return e.apply(this,f?c:o)})}}};$o(),((hs=CMSwift.rod)==null?void 0:hs._all)instanceof Set&&CMSwift.rod._all.forEach(t=>Mo(t)),ss(),Wo();const go={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},is=new Set(Object.values(go)),Uo=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),_o=new Set(["none","sm","md","lg"]),Bn={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"}},vn=t=>{if(t.indexOf("-")>-1)return!0},Rt=t=>{if(!t)return"";const e=String(t).toLowerCase();return go[e]||""},En=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":Uo.has(e)?e:null},Xn=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return _o.has(e)?e:null},Jn=t=>t&&typeof t=="object"&&!t.nodeType&&!Array.isArray(t)&&!(t instanceof Function),Qn=t=>t&&t.nodeType===1&&String(t.tagName||"").toLowerCase()==="li",bn=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];CMSwift.isUIPlainObject=Jn,CMSwift.isListItemNode=Qn,CMSwift.asNodeArray=bn;const Sn=(t={})=>{var o;const e=[],s={};if(e.push(a(t.clickable,"cms-clickable"),a(t.dense,"cms-dense"),a(t.flat,"cms-flat"),a(t.border,"cms-border"),a(t.glossy,"cms-glossy"),a(t.glow,"cms-glow"),a(t.glass,"cms-glass"),a(t.shadow,"cms-shadow"),a(t.outline,"cms-outline"),a(t.rounded,"cms-rounded"),a(t.gradient,"cms-gradient"),a(t.textGradient,"cms-text-gradient"),a(t.lightShadow,"cms-light-shadow")),S(t.color))e.push(()=>{const i=n(t.color),f=Rt(i);return f?`cms-state-${f}`:""}),s.backgroundColor=()=>{const i=n(t.color);return Rt(i)?"":i&&vn(String(i))?`var(--cms-${i})`:i||""};else{const i=Rt(t.color);i?e.push(`cms-state-${i}`):t.color&&vn(t.color)?s.backgroundColor=`var(--cms-${t.color})`:t.color&&(s.backgroundColor=t.color)}if(S(t.textColor)?s.color=()=>{const i=n(t.textColor);return i&&vn(String(i))?`var(--cms-${i})`:i||""}:t.textColor&&vn(t.textColor)?s.color=`var(--cms-${t.textColor})`:t.textColor&&(s.color=t.textColor),S(t.size))e.push(()=>{var f;const i=n(t.size);return typeof i=="string"&&((f=CMSwift.uiSizes)!=null&&f.includes(i))?`cms-size-${i}`:""});else{const i=t.size;typeof i=="string"&&((o=CMSwift.uiSizes)!=null&&o.includes(i))&&e.push(`cms-size-${i}`)}if(S(t.shadow))e.push(()=>{const i=n(t.shadow),f=Xn(i);return f?`cms-shadow-${f}`:""}),s.boxShadow=()=>{const i=n(t.shadow);return Xn(i)||i==null||i===!1?"":typeof i=="string"?i:""};else{const i=Xn(t.shadow);i?e.push(`cms-shadow-${i}`):t.shadow&&typeof t.shadow=="string"&&(s.boxShadow=t.shadow)}e.length&&(t.class=l([t.class,...e])),Object.keys(s).length&&(t.style={...s,...t.style||{}})},Fo=CMSwift.uiNormalizeArgs;CMSwift.uiNormalizeArgs=function(t){const e=Fo(t),s=e.props||{};if(s&&Object.prototype.hasOwnProperty.call(s,"children")){const o=s.children;(!e.children||e.children.length===0)&&(e.children=Array.isArray(o)?o:[o]),delete s.children}return Sn(s),e};const C=window._,Go={actions:"Content rendered in the action area, typically in a footer or trailing region.",active:"Marks the item as active/selected and applies active styling/ARIA when relevant.",align:"Alignment of content along the cross axis (e.g. left/center/right).",allowCustom:"Allows values not present in the options list.",allowCustomValue:"Accepts free-form values in addition to predefined options.",aside:"Content or configuration for the aside/secondary region.",auto:"Enables automatic sizing or layout behavior instead of fixed sizing.",autocomplete:"Native autocomplete attribute for input elements.",backdrop:"Whether to render a backdrop overlay behind the component.",bgClass:"Additional CSS classes applied to the background layer.",bgPosition:"CSS background-position value for the background image/layer.",bgSize:"CSS background-size value for the background image/layer.",cardClass:"Additional CSS classes applied to the card container.",checked:"Checked state for toggleable controls (controlled).",class:"Additional CSS classes applied to the component root element.",clearable:"Shows a clear action to reset the current value.",clickable:"Enables pointer/hover styles and click handling on the component.",closeOnEsc:"Closes the component when the Escape key is pressed.",closeOnOutside:"Closes the component when clicking outside its bounds.",closeOnSelect:"Closes the menu/popover after selecting an item.",color:"Semantic color name used to style the component.",cols:"Number of columns for grid layouts.",columns:"Column definitions for table-like components.",content:"Main content node(s) or render function for the component body.",contentClass:"Additional CSS classes applied to the content container.",control:"Custom control element or render function for the input area.",children:"Default child content (nodes, arrays, or render function).",delay:"Delay in milliseconds before showing or hiding.",dense:"Uses compact spacing and sizing.",disabled:"Disables interaction and applies disabled styling/ARIA.",divider:"Shows dividers between items or sections.",drawer:"Content or configuration for the drawer region.",drawerBreakpoint:"Viewport width where the drawer switches behavior (overlay vs persistent).",drawerCloseIcon:"Icon used for the drawer close control.",drawerOpen:"Controls whether the drawer is open (controlled).",drawerOpenIcon:"Icon used for the drawer open control.",drawerStateKey:"Storage key used to persist drawer open state.",drawerWidth:"Drawer width (number interpreted as px or CSS length).",elevated:"Applies elevated shadow/raised styling.",emptyText:"Text shown when there is no data to display.",error:"Error state or message displayed with the component.",escClose:"Alias for close-on-escape behavior.",filterPlaceholder:"Placeholder text for the filter/search input.",filterable:"Enables filtering UI for option lists.",flat:"Removes elevation/border for a flat look.",footer:"Footer content node(s) or render function.",form:"HTML form attribute to associate controls with a form.",gap:"Gap/spacing between child elements.",getValue:"Function to extract a value from an item object.",groupCloseIcon:"Icon used to collapse grouped items.",groupOpenIcon:"Icon used to expand grouped items.",header:"Header content node(s) or render function.",height:"Explicit height (number interpreted as px or CSS length).",hint:"Helper text shown near the control.",icon:"Icon name or node rendered with the component.",iconRight:"Icon name or node rendered on the right side of the component.",iconAlign:"Position of the icon relative to the label.",initialSort:"Initial sort configuration for table data.",inputmode:"Native inputmode attribute hint for virtual keyboards.",items:"Array of items or nodes to render.",justify:"Justification of items along the main axis.",label:"Label text or node for the component.",left:"Content or configuration for the left region.",lg:"Column span at large breakpoint.",loading:"Shows loading state and disables interactions where appropriate.",loadingText:"Text displayed while loading.",lockScroll:"Prevents body scroll while an overlay is open.",max:"Maximum value for range-based controls.",md:"Column span at medium breakpoint.",message:"Message text shown in banners/alerts.",min:"Minimum value for range-based controls.",model:"Two-way bound value (alias to value in some components).",multi:"Enables multi-selection behavior.",multiple:"Allows selecting multiple values.",name:"HTML name attribute for form submission.",noDrawer:"Disables rendering of the drawer region.",note:"Secondary note text.",number:"Forces numeric input/formatting where supported.",offset:"General offset for positioning.",offsetX:"Horizontal offset for overlay placement in pixels.",offsetY:"Vertical offset for overlay placement in pixels.",onBlur:"Callback fired when the control loses focus.",onChange:"Callback fired when the value or selection changes.",onClear:"Callback fired when the clear action is used.",onClose:"Callback fired when the component closes.",onFocus:"Callback fired when the control gains focus.",onInput:"Callback fired on input events or while typing.",onOpen:"Callback fired when the component opens.",onRemove:"Callback fired when an item is removed.",onSubmit:"Callback fired when a form is submitted.",open:"Controls open/visible state (controlled).",options:"Array of selectable options or option groups.",outline:"Uses outlined visual style.",overlay:"Renders content in an overlay layer or portal.",overlayClose:"Closes the overlay when the backdrop is clicked.",page:"Current page index (1-based unless documented otherwise).",pageSize:"Number of items per page.",padding:"Padding applied to the component root element.",persistent:"Prevents closing via outside click or Escape.",placeholder:"Placeholder text for inputs.",placement:"Overlay placement relative to the target/anchor.",prefix:"Content rendered before the main control.",readonly:"Prevents editing while keeping focus and selection.",removable:"Shows a remove affordance for chips/items.",right:"Content or configuration for the right region.",rowKey:"Key or function used to derive unique row IDs.",rows:"Row data array for table-like components.",margin:"Margin applied to the component root element.",maxHeight:"Maximum height constraint (number interpreted as px or CSS length).",maxWidth:"Maximum width constraint (number interpreted as px or CSS length).",minHeight:"Minimum height constraint (number interpreted as px or CSS length).",minWidth:"Minimum width constraint (number interpreted as px or CSS length).",radius:"Border radius token or CSS length applied to the component.",borderRadius:"Border radius token or CSS length applied to the component.",separator:"Separator string/node between items.",showLabel:"Whether to render the label text.",size:"Size token, number, or CSS length for sizing.",slots:"Named slots map for render overrides.",sm:"Column span at small breakpoint.",span:"Column span within a grid.",speed:"Animation speed or duration in milliseconds.",square:"Use square corners instead of rounded.",src:"Image source URL.",startTop:"Starting scroll offset for parallax effects.",stateKey:"Storage key used to persist component state.",step:"Step increment for numeric controls.",sticky:"Makes the component sticky within its container.",stickyAside:"Keeps the aside region sticky during scroll.",stickyFooter:"Keeps the footer region sticky during scroll.",stickyHeader:"Keeps the header region sticky during scroll.",striped:"Applies striped row styling.",style:"Inline styles applied to the component root element.",subtitle:"Subtitle text or node.",success:"Marks the component with success state styling.",suffix:"Content rendered after the main control.",tableClass:"Additional CSS classes applied to the table element.",tabs:"Tab definitions array.",tagPage:"Query parameter name used to read/write the current page.",target:"Target element or anchor used for positioning.",text:"Text content for simple components.",thickness:"Stroke/line thickness for progress indicators.",title:"Title text or node.",to:"Navigation target/route to open on click.",topLabel:"Label displayed above the control.",trapFocus:"Keeps focus trapped inside the dialog/popover.",type:"Variant or native input type.",value:"Current value (controlled).",vertical:"Vertical orientation instead of horizontal.",warning:"Marks the component with warning state styling.",width:"Explicit width (number interpreted as px or CSS length).",wrap:"Allows children to wrap to new lines.",wrapClass:"Additional CSS classes applied to the outer wrapper.",zIndex:"z-index for overlay stacking.",shadow:"Shadow token or CSS box-shadow string applied to the component."},Ko={actions:"Slot for action buttons or links.",arrow:"Slot for the tooltip/popover arrow element.",aside:"Slot for aside/secondary content.",center:"Slot for centered content within a toolbar/row.",clear:"Slot for the clear control/content.",content:"Slot for the main body content.",control:"Slot for custom control/input rendering.",default:"Primary content for the component.",drawer:"Slot for drawer content.",empty:"Slot for empty-state content.",errorMessage:"Slot for custom error message rendering.",filter:"Slot for custom filter/search UI.",footer:"Slot for footer content.",group:"Slot for grouped content container.",groupLabel:"Slot for group label content.",header:"Slot for header content.",hint:"Slot for helper/hint text.",icon:"Slot for icon content.",iconRight:"Slot for right-aligned icon content.",input:"Slot for custom input element/content.",item:"Slot for custom item rendering.",itemLabel:"Slot for item label rendering.",label:"Slot for label content.",left:"Slot for left-aligned content.",loading:"Slot for loading state content.",message:"Slot for message/alert content.",next:"Slot for the next-page control.",note:"Slot for note/secondary text.",option:"Slot for custom option rendering.",page:"Slot for page indicator/content.",prefix:"Slot for prefix content.",prev:"Slot for the previous-page control.",right:"Slot for right-aligned content.",separator:"Slot for separator rendering between items.",star:"Slot for custom star icon/content in rating.",subtitle:"Slot for subtitle content.",success:"Slot for success message/content.",suffix:"Slot for suffix content.",tab:"Slot for custom tab label/content.",target:"Slot for custom target/anchor element.",title:"Slot for title content.",topLabel:"Slot for top label content.",warning:"Slot for warning message/content."},po={dense:!1,disabled:!1,readonly:!1,outline:!1,clickable:!1,flat:!1,elevated:!1},Qt=[...CMSwift.uiSizes],_n=[...CMSwift.uiColors],Fn={size:["number","CSS units",...Qt],color:_n,padding:["number","CSS units",...Qt],margin:["number","CSS units",...Qt],width:["number","CSS units",...Qt],minWidth:["number","CSS units",...Qt],maxWidth:["number","CSS units",...Qt],height:["number","CSS units",...Qt],minHeight:["number","CSS units",...Qt],maxHeight:["number","CSS units",...Qt],iconAlign:["left","right","before","after"],align:["left","center","right"],justify:["start","center","end","space-between","space-around","space-evenly"],placement:["top","bottom","left","right","top-start","top-end","bottom-start","bottom-end"],type:_n,shadow:["none",...Qt],outline:["number","CSS units",...Qt],borderRadius:["number","CSS units",...Qt],radius:["number","CSS units",...Qt],icon:["#name_tabler","name_material","class"],iconRight:["#name_tabler","name_material","class"]},ho={class:"style",style:"style",size:"style",color:"style",outline:"style",shadow:"style",borderRadius:"style",radius:"style",padding:"layout",margin:"layout",width:"layout",minWidth:"layout",maxWidth:"layout",height:"layout",minHeight:"layout",maxHeight:"layout",dense:"layout",flat:"style",elevated:"style",clickable:"behavior",disabled:"state",readonly:"state",loading:"state",active:"state",error:"state",success:"state",warning:"state",note:"state",hint:"state",value:"data",model:"data",items:"data",options:"data",rows:"data",columns:"data",onClick:"events",onChange:"events",onInput:"events",onFocus:"events",onBlur:"events",onSubmit:"events"},Zn=t=>typeof t=="string"?t:!t||typeof t!="object"||Array.isArray(t)?"unknown":t.type||t.signature||t.value||"unknown",eo=(t,e)=>e==="slot"?`Slot content for "${t}". Accepts nodes, arrays, or render functions.`:`Component configuration for "${t}". When not handled internally, it is forwarded to the root element.`,dn=(t,e,s)=>{var i,f;if(!t||typeof t!="object")return t;const o={};for(const[c,d]of Object.entries(t)){const h=e[c]||eo(c,s);if(d&&typeof d=="object"&&!Array.isArray(d)){const b=Zn(d);o[c]={...d,type:b,description:d.description||h,default:Object.prototype.hasOwnProperty.call(d,"default")?d.default:(i=po[c])!=null?i:null,values:d.values||Fn[c]||null,category:d.category||ho[c]||(s==="slot"?"slot":"general")}}else{const b=Zn(d);o[c]={type:b,description:h,default:(f=po[c])!=null?f:null,values:Fn[c]||null,category:ho[c]||(s==="slot"?"slot":"general")}}}return o},Io=(t,e)=>{var o;if(!e||typeof e!="object")return e;(!e.props||typeof e.props!="object"||Array.isArray(e.props))&&(e.props=e.props&&typeof e.props=="object"&&!Array.isArray(e.props)?e.props:{}),Object.prototype.hasOwnProperty.call(e.props,"children")||(e.props.children="Node|Array|Function");const s={size:e.props.size||"string|number",color:e.props.color||"string",outline:e.props.outline||"boolean",clickable:e.props.clickable||"boolean",padding:e.props.padding||"string|number",margin:e.props.margin||"string|number",width:e.props.width||"string|number",minWidth:e.props.minWidth||"string|number",maxWidth:e.props.maxWidth||"string|number",height:e.props.height||"string|number",minHeight:e.props.minHeight||"string|number",maxHeight:e.props.maxHeight||"string|number",radius:e.props.radius||"string|number",borderRadius:e.props.borderRadius||"string|number",shadow:e.props.shadow||"string|boolean",class:e.props.class||"string",style:e.props.style||"object"};return e.props={...s,...e.props},e.props.icon&&!e.props.iconRight&&(e.props.iconRight=e.props.icon),e.props&&(e.props=dn(e.props,Go,"prop")),e.slots&&(e.slots=dn(e.slots,Ko,"slot")),e.slots&&e.slots.icon&&!e.slots.iconRight&&(e.slots.iconRight={type:((o=e.slots.icon)==null?void 0:o.type)||"Node|Array|Function",description:"Slot for right-aligned icon content."}),e.description||(e.description=`${t} component meta definition.`),e},ln=()=>{if(ot.ui._metaProxyInstalled)return;ot.ui._metaProxyInstalled=!0;const t=ot.ui.meta||{};for(const s of Object.keys(t))Io(s,t[s]);const e=new Proxy(t,{set(s,o,i){return typeof o=="symbol"?(s[o]=i,!0):(s[o]=Io(o,i),!0)}});ot.ui.meta=e,C.meta=e};(bs=ot.isDev)!=null&&bs.call(ot)&&ln();function Cn(t){if(!t)return null;if(!Array.isArray(t))return t;const e=[],s=t.slice();for(;s.length;){const o=s.shift();o&&(Array.isArray(o)?s.unshift(...o):e.push(o))}return e.length?e:null}const Lo={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"},Eo=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),zo=(t,e,s,o)=>{e==null||e===!1||e===""||t.style.setProperty(Eo(s),no(e,o))};function wt(t,e){e.size&&(typeof e.size=="number"?t.style.setProperty("--cms-font-size",`${e.size}px`):CMSwift.uiSizes.includes(e.size)&&t.style.setProperty("--cms-font-size",`var(--cms-font-size-${e.size})`)),Object.entries(Lo).forEach(([s,o])=>{zo(t,e[s],s,o)}),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`):CMSwift.uiSizes.includes(e.radius)?t.style.setProperty("--set-border-radius",`var(--cms-r-${e.radius})`):t.style.setProperty("--set-border-radius",`${e.radius}`))}function to(t={},...e){const s=document.createElement("option");t&&typeof t=="object"&&(t.value!=null&&(s.value=String(t.value)),t.label!=null&&(s.label=String(t.label)),t.disabled!=null&&(s.disabled=!!t.disabled),t.selected!=null&&(s.selected=!!t.selected),t.class!=null&&(s.className=String(t.class)));const o=e.flat?e.flat(1/0):e;return o.length?o.forEach(i=>{i==null||i===!1||(i instanceof Node?s.appendChild(i):s.appendChild(document.createTextNode(String(i))))}):t&&t.text!=null&&(s.textContent=String(t.text)),s}CMSwift.ui.getSlot=(t,e)=>t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:null,CMSwift.ui.renderSlot=(t,e,s,o)=>{const i=CMSwift.ui.getSlot(t,e),c=i!=null?typeof i=="function"?i(s||{}):i:o;return c==null?null:Cn(CMSwift.ui.slot(c))};const E=(t,e,s,o)=>{const i=CMSwift.ui.renderSlot(t,e,s,o);return i?Array.isArray(i)?i:[i]:[]},no=(t,e="size")=>typeof t=="number"?t+"px":CMSwift.uiSizes.includes(t)?`var(--cms-${e}-${t})`:t;C.Row=(...t)=>{var Y,k,v,M,x;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=(g,p,T={})=>{const V=Array.isArray(g)?g:[g];for(const ne of V)if(CMSwift.ui.getSlot(o,ne)!=null)return E(o,ne,T,p);return p==null?[]:E(null,"default",T,p)},f=g=>{var p;return g==null||g===!1||g===""?"":typeof g=="number"?`${g}px`:typeof g=="string"&&((p=CMSwift.uiSizes)!=null&&p.includes(g))?`var(--cms-s-${g})`:String(g)},c=g=>{var p;return g==null||g===!1||g===""?"":typeof g=="number"?`${g}px`:typeof g=="string"&&((p=CMSwift.uiSizes)!=null&&p.includes(g))?`var(--cms-w-${g})`:String(g)},d=CMSwift.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"]);d.class=l(["cms-row",e.class]);const h={...e.style||{}},b=ee([e.direction,e.reverse],()=>{const g=n(e.direction);return g!=null&&g!==""?String(g):n(e.reverse)?"row-reverse":""}),$=A(e.align),F=A(e.justify),D=A(e.wrap,g=>typeof g=="boolean"?g?"wrap":"nowrap":String(g)),R=A(e.gap,f),be=A(e.rowGap,f),ce=A(e.columnGap,f),ie=A(e.inline,g=>g?"inline-flex":"flex"),O=A(e.width,c),te=A(e.minWidth,c),X=A(e.maxWidth,c),U=A(e.full,g=>g?"100%":"",""),Ae=ee([e.inline,e.full,e.width],()=>{const g=!!n(e.inline),p=!!n(e.full),T=n(e.width)!=null&&n(e.width)!==!1&&n(e.width)!=="";return!g||p||T?"":"max-content"});b!=null&&(h.flexDirection=b),$!=null&&(h.alignItems=$),F!=null&&(h.justifyContent=F),D!=null&&(h.flexWrap=D),R!=null&&(h.gap=R),be!=null&&(h.rowGap=be),ce!=null&&(h.columnGap=ce),ie!=null&&(h.display=ie),Ae!=null&&(h.width=Ae),O!=null&&(h.width=O),te!=null&&(h.minWidth=te),X!=null&&(h.maxWidth=X),U!=null&&(h.width=U),Object.keys(h).length&&(d.style=h);const ye={props:e},pe=i(["start","left"],(Y=e.start)!=null?Y:e.left,ye),we=i(["body","center","default"],(v=(k=e.body)!=null?k:e.center)!=null?v:s,ye),he=i(["end","right"],(M=e.end)!=null?M:e.right,ye);if(!(pe.length||he.length||e.body!=null||e.center!=null||e.startClass||e.bodyClass||e.centerClass||e.endClass||CMSwift.ui.getSlot(o,"start")!=null||CMSwift.ui.getSlot(o,"left")!=null||CMSwift.ui.getSlot(o,"body")!=null||CMSwift.ui.getSlot(o,"center")!=null||CMSwift.ui.getSlot(o,"end")!=null||CMSwift.ui.getSlot(o,"right")!=null)){const g=E(o,"default",ye,s),p=_.div(d,...g);return wt(p,e),p}const Q={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},L=(x=e.bodyClass)!=null?x:e.centerClass,z=ee([e.direction,e.reverse],()=>(n(e.direction)||(n(e.reverse)?"row-reverse":"row"))==="row"?"auto":""),H=[pe.length?_.div({class:l(["cms-row-start",e.startClass]),style:{...Q}},...pe):null,we.length?_.div({class:l(["cms-row-body",L]),style:{...Q,flex:"1 1 auto"}},...we):null,he.length?_.div({class:l(["cms-row-end",e.endClass]),style:{...Q,justifyContent:"flex-end",marginInlineStart:z}},...he):null].filter(Boolean),y=_.div(d,...H);return wt(y,e),y},(ys=CMSwift.isDev)!=null&&ys.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Row={signature:"UI.Row(...children) | UI.Row(props, ...children)",props:{start:"Node|Function|Array",left:"Alias di start",body:"Node|Function|Array",center:"Alias di body",end:"Node|Function|Array",right:"Alias di end",align:"stretch|flex-start|center|flex-end|baseline",justify:"flex-start|center|flex-end|space-between|space-around|space-evenly",wrap:"boolean|string",direction:"row|row-reverse|column|column-reverse",reverse:"boolean",gap:"string|number",rowGap:"string|number",columnGap:"string|number",inline:"boolean",full:"boolean",width:"string|number",minWidth:"string|number",maxWidth:"string|number",startClass:"string",bodyClass:"string",centerClass:"Alias di bodyClass",endClass:"string",slots:"{ start?, left?, body?, center?, end?, right?, default? }",class:"string",style:"object"},slots:{start:"Leading content area",left:"Alias di start",body:"Main content area",center:"Alias di body",end:"Trailing content area",right:"Alias di end",default:"Fallback content / children"},returns:"HTMLDivElement",description:"Wrapper flex in riga con children, slot strutturati e props di layout per gap, allineamento, wrap e direction."});function Zt(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="function"&&typeof t[1]=="function"}function r(t){return!!t&&t.type==="rod"}function S(t){return typeof t=="function"||r(t)||Zt(t)}function n(t){return typeof t=="function"?t():r(t)?t.value:Zt(t)?t[0]():t}function W(t){const e=Array.isArray(t)?[...t]:[t];for(;e.length;){const s=e.pop();if(S(s))return!0;Array.isArray(s)&&e.push(...s)}return!1}function l(t){const e=W(t),s=()=>{const o=[],i=Array.isArray(t)?[...t]:[t];for(;i.length;){const f=i.shift();if(f==null||f===!1)continue;const c=n(f);if(!(c==null||c===!1||c==="")){if(Array.isArray(c)){i.unshift(...c);continue}o.push(c)}}return o.join(" ")};return e?s:s()}function ue(t){const e=l(t);return typeof e=="function"?e():e}function a(t,e,s=""){return S(t)?()=>n(t)?e:s:t?e:s}function ge(t,e,s=""){return S(t)?()=>{const o=n(t);return o==null||o===""?"":`${e}${o}${s}`}:t==null||t===""?"":`${e}${t}${s}`}function ee(t,e){return(Array.isArray(t)?t:[t]).some(S)?()=>e():e()}function A(t,e,s=""){return S(t)?()=>{const o=n(t);return o==null||o===!1?s:e?e(o):o}:t==null||t===!1?null:e?e(t):t}CMSwift.uiIsReactive=S,CMSwift.uiUnwrap=n,CMSwift.uiClass=l,CMSwift.uiClassStatic=ue,CMSwift.uiWhen=a,CMSwift.uiClassValue=ge,CMSwift.uiComputed=ee,CMSwift.uiStyleValue=A,C.Col=(...t)=>{var V,ne,re,ke,I,u;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=N=>Object.prototype.hasOwnProperty.call(e,N),f=(N,w,le={})=>{const Ne=Array.isArray(N)?N:[N];for(const se of Ne)if(CMSwift.ui.getSlot(o,se)!=null)return E(o,se,le,w);return w==null?[]:E(null,"default",le,w)},c=N=>{var w;return N==null||N===!1||N===""?"":typeof N=="number"?`${N}px`:typeof N=="string"&&((w=CMSwift.uiSizes)!=null&&w.includes(N))?`var(--cms-s-${N})`:String(N)},d=N=>{var w;return N==null||N===!1||N===""?"":typeof N=="string"&&((w=CMSwift.uiSizes)!=null&&w.includes(N))?no(N,"size"):K(N)},h=(N,w)=>{const le=n(N);if(le==null||le===!1||le==="")return"";if(le==="auto")return w==="cms-col-"?"cms-col-auto":"";if(le===!0)return`${w}24`;const Ne=Number(le);if(Number.isFinite(Ne)&&Ne>0)return`${w}${Math.max(1,Math.min(24,Math.round(Ne)))}`;if(typeof le=="string"){const se=le.trim();if(!se)return"";if(se.startsWith(w))return se;if(/^\d+$/.test(se))return`${w}${Math.max(1,Math.min(24,Number(se)))}`}return""},b=()=>{const N=n(e.flex);if(N!=null&&N!==!1&&N!=="")return String(N);if(n(e.fill))return"1 1 auto";const w=i("grow"),le=i("shrink"),Ne=i("basis");if(!w&&!le&&!Ne)return"";const se=w?n(e.grow):0,fe=le?n(e.shrink):1,P=Ne?d(n(e.basis)):"auto";return`${se} ${fe} ${P||"auto"}`},$=ee([e.auto,e.col,e.span],()=>{if(n(e.auto))return"cms-col-auto";const N=i("span")?e.span:e.col;return h(N,"cms-col-")||"cms-col"}),F=CMSwift.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"]),D={minWidth:0,...e.style||{}},R=A(e.gap,c),be=A(e.rowGap,c),ce=A(e.columnGap,c),ie=A(e.align),O=A(e.justify),te=i("width")?e.width:e.size,X=A(te,d),U=A(e.minWidth,d),Ae=A(e.maxWidth,d),ye=A(e.height,d),pe=A(e.minHeight,d),we=A(e.maxHeight,d),he=A(e.self),me=A(e.order,N=>String(N)),Q=A(e.scroll,N=>N?"auto":"",""),L=ee([e.flex,e.fill,e.grow,e.shrink,e.basis],b),z=ee([e.center,e.align,e.justify],()=>!!n(e.center)&&(n(e.align)==null||n(e.align)==="")&&(n(e.justify)==null||n(e.justify)===""));L!=null&&L!==""&&(D.flex=L),he!=null&&(D.alignSelf=he),me!=null&&(D.order=me),Q!=null&&Q!==""&&(D.overflow=Q),X!=null&&X!==""&&(D.width=X,!i("flex")&&!i("fill")&&!i("grow")&&!i("shrink")&&!i("basis")&&(D.flex="0 0 auto")),U!=null&&(D.minWidth=U),Ae!=null&&(D.maxWidth=Ae),ye!=null&&(D.height=ye),pe!=null&&(D.minHeight=pe),we!=null&&(D.maxHeight=we),Object.keys(D).length&&(F.style=D);const H={props:e},y=f(["start","top","header","before"],(re=(ne=(V=e.start)!=null?V:e.top)!=null?ne:e.header)!=null?re:e.before,H),Y=i("body")?e.body:i("content")?e.content:s,k=f(["body","content","default"],Y,H),v=f(["end","bottom","footer","after"],(u=(I=(ke=e.end)!=null?ke:e.bottom)!=null?I:e.footer)!=null?u:e.after,H),M=y.length||v.length||i("start")||i("top")||i("header")||i("before")||i("body")||i("content")||i("end")||i("bottom")||i("footer")||i("after")||e.startClass||e.bodyClass||e.contentClass||e.endClass||e.topClass||e.headerClass||e.bottomClass||e.footerClass||CMSwift.ui.getSlot(o,"start")!=null||CMSwift.ui.getSlot(o,"top")!=null||CMSwift.ui.getSlot(o,"header")!=null||CMSwift.ui.getSlot(o,"before")!=null||CMSwift.ui.getSlot(o,"body")!=null||CMSwift.ui.getSlot(o,"content")!=null||CMSwift.ui.getSlot(o,"end")!=null||CMSwift.ui.getSlot(o,"bottom")!=null||CMSwift.ui.getSlot(o,"footer")!=null||CMSwift.ui.getSlot(o,"after")!=null,x=ee([e.stack,e.gap,e.rowGap,e.columnGap,e.align,e.justify,e.center],()=>n(e.stack)||M||[n(e.gap),n(e.rowGap),n(e.columnGap),n(e.align),n(e.justify)].some(w=>w!=null&&w!==!1&&w!=="")?!0:!!n(e.center));if(F.class=l(["cms-col",$,ee(e.sm,()=>h(e.sm,"cms-sm-col-")),ee(e.md,()=>h(e.md,"cms-md-col-")),ee(e.lg,()=>h(e.lg,"cms-lg-col-")),a(x,"cms-col-flex"),a(e.inline,"cms-col-inline"),e.class]),R!=null&&(D.gap=R),be!=null&&(D.rowGap=be),ce!=null&&(D.columnGap=ce),ie!=null?D.alignItems=ie:z!=null&&z!==""&&(D.alignItems=z?"center":""),O!=null?D.justifyContent=O:z!=null&&z!==""&&(D.justifyContent=z?"center":""),Object.keys(D).length&&(F.style=D),!M){const N=_.div(F,...E(o,"default",H,s));return wt(N,e),N}const g={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},p=[y.length?_.div({class:l(["cms-col-start",e.startClass,e.topClass,e.headerClass]),style:{...g}},...y):null,k.length?_.div({class:l(["cms-col-body",e.bodyClass,e.contentClass]),style:{...g,flex:"1 1 auto"}},...k):null,v.length?_.div({class:l(["cms-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...g}},...v):null].filter(Boolean),T=_.div(F,...p);return wt(T,e),T},(ws=CMSwift.isDev)!=null&&ws.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Col={signature:"UI.Col(...children) | UI.Col(props, ...children)",props:{col:"number|string",span:"Alias di col",sm:"number|string",md:"number|string",lg:"number|string",auto:"boolean",gap:"number|string",rowGap:"number|string",columnGap:"number|string",align:"string",justify:"string",inline:"boolean",stack:"boolean",center:"boolean",width:"number|string",size:"Alias di width",minWidth:"number|string",maxWidth:"number|string",height:"number|string",minHeight:"number|string",maxHeight:"number|string",flex:"string",fill:"boolean",grow:"number",shrink:"number",basis:"number|string",self:"string",order:"number|string",scroll:"boolean",start:"Node|Function|Array",top:"Alias di start",header:"Alias di start",body:"Node|Function|Array",content:"Alias di body",end:"Node|Function|Array",bottom:"Alias di end",footer:"Alias di end",startClass:"string",bodyClass:"string",endClass:"string",slots:"{ start?, top?, header?, body?, content?, end?, bottom?, footer?, default? }",class:"string",style:"object"},slots:{start:"Area iniziale della colonna",top:"Alias di start",header:"Alias di start",body:"Area principale della colonna",content:"Alias di body",end:"Area finale della colonna",bottom:"Alias di end",footer:"Alias di end",default:"Contenuto fallback della colonna"},returns:"HTMLDivElement",description:"Wrapper responsive a 24 colonne. Di default si comporta come un contenitore normale e attiva il layout flex verticale quando usi gap/allineamento, regioni strutturate o `stack`."}),C.Spacer=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=CMSwift.omit(e,["slots"]);i.class=l(["cms-spacer",e.class]);const f=E(o,"default",{},s);return _.div(i,...f)},(vs=CMSwift.isDev)!=null&&vs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Spacer={signature:"UI.Spacer() | UI.Spacer(props)",props:{slots:"{ default?: Slot }",class:"string",style:"object"},slots:{default:"Optional spacer content"},returns:"HTMLDivElement",description:"Flex spacer."}),C.Container=(...t)=>{var v,M,x,g;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i={...e},f=p=>Object.prototype.hasOwnProperty.call(e,p),c={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},d=p=>{if(p==null||p===!1||p==="")return"";if(typeof p=="number")return`${p}px`;const T=String(p).trim().toLowerCase();return T?T==="full"||T==="fluid"?"100%":c[T]||String(p):""},h=p=>{var T;return p==null||p===!1||p===""?"":typeof p=="number"?`${p}px`:typeof p=="string"&&((T=CMSwift.uiSizes)!=null&&T.includes(p))?`var(--cms-s-${p})`:String(p)},b=p=>{if(p==null||p===!1||p==="")return"";if(typeof p=="number"&&Number.isFinite(p))return`repeat(${Math.max(1,Math.floor(p))}, minmax(0, 1fr))`;const T=String(p).trim();return T?/^\d+$/.test(T)?`repeat(${Math.max(1,Number(T))}, minmax(0, 1fr))`:T:""},$=p=>p==null||p===""?"":p===!0?"wrap":p===!1?"nowrap":String(p),F={props:e},D=(p,T)=>{if(!(T==null||T===!1)){if(Array.isArray(T)){T.forEach(V=>D(p,V));return}if(T!=null&&T.nodeType){p.appendChild(T);return}p.appendChild(document.createTextNode(String(T)))}},R=(p,T)=>{const V=CMSwift.ui.getSlot(o,p);if(V!=null)return E(o,p,F,null);if(typeof T=="function"){const ne=_.div({class:`cms-container-slot-${p}`});return CMSwift.reactive.effect(()=>{const re=Cn(CMSwift.ui.slot(T(F)));ne.replaceChildren(),Array.isArray(re)?re.forEach(ke=>D(ne,ke)):D(ne,re)},`UI.Container:${p}`),[ne]}return E(o,p,F,T)},be=f("content")?e.content:s!=null&&s.length?s:null,ce=R("before",(v=e.before)!=null?v:e.top),ie=R("header",e.header),O=[...R("left",e.left),...R("start",e.start)],te=R("body",f("body")?e.body:null),X=(()=>{const p=R("content",f("content")?e.content:null);return p.length?p:R("default",be)})(),U=[...R("right",e.right),...R("end",e.end)],Ae=R("footer",e.footer),ye=R("after",(M=e.after)!=null?M:e.bottom),pe=ce.length||ie.length||O.length||U.length||Ae.length||ye.length||CMSwift.ui.getSlot(o,"before")!=null||CMSwift.ui.getSlot(o,"header")!=null||CMSwift.ui.getSlot(o,"left")!=null||CMSwift.ui.getSlot(o,"start")!=null||CMSwift.ui.getSlot(o,"right")!=null||CMSwift.ui.getSlot(o,"end")!=null||CMSwift.ui.getSlot(o,"footer")!=null||CMSwift.ui.getSlot(o,"after")!=null,we=!!pe||te.length>0&&(CMSwift.ui.getSlot(o,"body")!=null||pe),he=()=>{var T;const p=String(n((T=e.layout)!=null?T:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(p)?p:["inline","inline-flex","inlineflex"].includes(p)||n(e.inline)?"inline":n(e.grid)||n(e.cols)!=null?"grid":p==="block"?"block":n(e.direction)!=null||n(e.wrap)!=null||n(e.align)!=null||n(e.justify)!=null||n(e.gap)!=null||O.length||U.length?"flex":"block"},me=ee([e.layout,e.display,e.inline,e.grid,e.cols,e.direction,e.wrap,e.align,e.justify,e.gap],()=>{const p=he();return p==="block"?"":`is-${p}`}),Q={...i.style||{}},L=(p,T)=>{T!=null&&(Q[p]=T)};L("maxWidth",ee([e.maxWidth,e.fluid],()=>n(e.fluid)?"none":d(n(e.maxWidth))||"")),L("width",A(e.width,d)),L("minWidth",A(e.minWidth,d)),L("--cms-container-padding",A(e.padding,h)),L("--cms-container-padding-x",A((x=e.paddingX)!=null?x:e.gutter,h)),L("--cms-container-padding-y",A(e.paddingY,h)),L("--cms-container-gap",A(e.gap,h)),L("--cms-container-section-gap",A((g=e.sectionGap)!=null?g:e.gap,h)),L("--cms-container-cols",A(e.cols,b)),L("--cms-container-align",A(e.align,p=>String(p))),L("--cms-container-justify",A(e.justify,p=>String(p))),L("--cms-container-direction",A(e.direction,p=>String(p))),L("--cms-container-wrap",A(e.wrap,$));const z=CMSwift.omit(i,["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"]);z.class=l(["cms-container",a(e.fluid,"is-fluid"),a(we,"has-structure"),we?"":me,i.class]),z.style=Q;const H=(p,T,V)=>T.length?_.div({class:l(["cms-container-section",`cms-container-${p}`,V])},...T):null,y=te.length?_.div({class:l(["cms-container-body",we?me:"",e.bodyClass])},...te):O.length||X.length||U.length?_.div({class:l(["cms-container-body",we?me:"",e.bodyClass])},H("start",O,e.startClass),X.length?_.div({class:l(["cms-container-main",e.mainClass,e.contentClass])},...X):null,H("end",U,e.endClass)):null,Y=(()=>{var T;const p=String(n((T=e.tag)!=null?T:e.as)||"div").toLowerCase();return typeof _[p]=="function"?_[p]:_.div})(),k=we?Y(z,H("before",ce,e.beforeClass),H("header",ie,e.headerClass),y,H("footer",Ae,e.footerClass),H("after",ye,e.afterClass)):Y(z,...te.length?te:X);return wt(k,e),k},(Ss=CMSwift.isDev)!=null&&Ss.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Container={signature:"UI.Container(...children) | UI.Container(props, ...children)",props:{tag:"string",fluid:"boolean",maxWidth:"number|string",minWidth:"number|string",width:"number|string",padding:"number|string",paddingX:"number|string",paddingY:"number|string",gap:"number|string",sectionGap:"number|string",layout:'"block|flex|grid|stack|inline"',direction:'"row|column"',wrap:"boolean|string",align:"string",justify:"string",cols:"number|string",before:"String|Node|Function|Array",header:"String|Node|Function|Array",start:"String|Node|Function|Array",body:"String|Node|Function|Array",content:"String|Node|Function|Array",end:"String|Node|Function|Array",footer:"String|Node|Function|Array",after:"String|Node|Function|Array",slots:"{ before?, header?, left?, start?, body?, content?, default?, right?, end?, footer?, after? }",class:"string",style:"object"},slots:{before:"Top content before the main container body",header:"Structured header area",left:"Alias for start",start:"Leading area inside the main body",body:"Custom body renderer overriding start/content/end wrappers",content:"Explicit main content",default:"Fallback content from children",right:"Alias for end",end:"Trailing area inside the main body",footer:"Structured footer area",after:"Bottom content after the main container body"},returns:"HTMLDivElement",description:"Container composabile con max-width, spacing, layout props e sezioni opzionali."}),C.Card=(...t)=>{var ke,I;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i={...e};Sn(i);const f=(u,N)=>{var w;return!!(u&&u.nodeType===1&&((w=u.classList)!=null&&w.contains(`cms-card-${N}`)))},d=(u=>u==null?null:typeof u=="string"?C.Icon({name:u,size:e.iconSize||e.size||"lg"}):CMSwift.ui.slot(u,{as:"icon"}))(e.icon),h=e.image?_.img({src:e.image,alt:e.imageAlt||"",class:l(["cms-card-cover-media",e.imageClass]),style:e.imageStyle}):e.cover,b={dense:!!n(e.dense),flat:!!n(e.flat),clickable:!!n(e.clickable),to:n(e.to)||null},$=E(o,"default",b,s!=null&&s.length?s:[]),F={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},D=[];$.forEach(u=>{f(u,"identifier")?F.identifier.push(u):f(u,"cover")?F.cover.push(u):f(u,"media")?F.media.push(u):f(u,"header")?F.header.push(u):f(u,"body")?F.body.push(u):f(u,"footer")?F.footer.push(u):f(u,"actions")?F.actions.push(u):D.push(u)});const R=E(o,"identifier",b,e.identifier),be=E(o,"cover",b,h),ce=E(o,"media",b,e.media),ie=E(o,"eyebrow",b,(ke=e.eyebrow)!=null?ke:e.kicker),O=E(o,"title",b,e.title),te=E(o,"subtitle",b,e.subtitle),X=E(o,"header",b,e.header),U=E(o,"icon",b,d),Ae=E(o,"aside",b,(I=e.aside)!=null?I:e.headerAside),ye=E(o,"body",b,e.body),pe=E(o,"footer",b,e.footer),we=E(o,"actions",b,e.actions),he=R.length?_.div({class:l(["cms-card-identifier",e.identifierClass])},...R):null,me=be.length?_.div({class:l(["cms-card-cover",e.coverClass])},...be):null,Q=ce.length?_.div({class:l(["cms-card-media",e.mediaClass])},...ce):null,z=U.length||ie.length||O.length||te.length||X.length||Ae.length?_.div({class:l(["cms-card-header",e.headerClass])},_.div({class:"cms-card-head"},U.length?_.div({class:"cms-card-icon"},...U):null,_.div({class:"cms-card-head-main"},ie.length?_.div({class:l(["cms-card-eyebrow",e.eyebrowClass])},...ie):null,O.length?_.div({class:l(["cms-card-title",e.titleClass])},...O):null,te.length?_.div({class:l(["cms-card-subtitle",e.subtitleClass])},...te):null,X.length?_.div({class:l(["cms-card-header-content",e.headerContentClass])},...X):null),Ae.length?_.div({class:l(["cms-card-aside",e.asideClass])},...Ae):null)):null,H=[...ye,...D],y=H.length?_.div({class:l(["cms-card-body",e.bodyClass])},...H):null,Y=[...we,...F.actions],k=pe.length||Y.length?_.div({class:l(["cms-card-footer",e.footerClass])},...pe,Y.length?_.div({class:"cms-card-actions"},...Y):null):null,v=ee([e.clickable,e.to],()=>n(e.clickable)||n(e.to)?"cms-card-clickable":""),M=R.length||F.identifier.length,x=be.length||F.cover.length||ce.length||F.media.length,g=CMSwift.omit(i,["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"]);g.class=l(["cms-panel","cms-card","cms-clear-set","cms-singularity",a(e.flat,"cms-card-flat"),a(e.dense,"cms-card-dense"),a(M,"cms-card-has-identifier"),a(x,"cms-card-has-top-visual"),v,i.class]),g.style={...i.style||{}},e.coverHeight!=null&&(g.style["--cms-card-cover-height"]=K(n(e.coverHeight)));const p=e.onClick,T=e.onKeydown,V=u=>{var w;if(p==null||p(u),u.defaultPrevented)return;const N=n(e.to);N&&((w=CMSwift.router)!=null&&w.navigate)&&(u.preventDefault(),CMSwift.router.navigate(N))},ne=u=>{T==null||T(u),!u.defaultPrevented&&(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),V(u))};(n(e.clickable)||n(e.to))&&(g.onClick=V,g.onKeydown=ne,g.tabIndex==null&&(g.tabIndex=0),g.role==null&&(g.role="button"));const re=_.div(g,he,...F.identifier,me,...F.cover,Q,...F.media,z,...F.header,y,...F.body,k,...F.footer);return wt(re,e),re},(Cs=CMSwift.isDev)!=null&&Cs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Card={signature:"UI.Card(...children) | UI.Card(props, ...children)",description:"Card a sezioni con header strutturato, cover/media, body e footer/actions.",props:{title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",eyebrow:"String|Node|Function|Array",header:"String|Node|Function|Array",body:"String|Node|Function|Array",footer:"String|Node|Function|Array",actions:"Node|Function|Array",icon:"String|Node|Function|Array",aside:"Node|Function|Array",identifier:"String|Node|Function|Array",media:"Node|Function|Array",cover:"Node|Function|Array",image:"string",imageAlt:"string",coverHeight:"string|number",clickable:"boolean",to:"string",dense:"boolean",flat:"boolean",headerClass:"string",bodyClass:"string",footerClass:"string",slots:"{ identifier?, cover?, media?, icon?, eyebrow?, title?, subtitle?, header?, aside?, body?, footer?, actions?, default? }",class:"string",style:"object"},slots:{identifier:"Badge/top identifier content",cover:"Top visual/cover content",media:"Media section above header/body",icon:"Header icon content",eyebrow:"Eyebrow/kicker content",title:"Card title content",subtitle:"Card subtitle content",header:"Header support content",aside:"Right side header content",body:"Body content",footer:"Footer content",actions:"Footer actions slot",default:"Fallback body content or raw card sections"},returns:"HTMLDivElement"}),C.Btn=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=ee([e.color,e.state],()=>{const Ae=n(e.color)||n(e.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(Ae)?Ae:n(e.state)||""}),f=l(["cms-clear-set","cms-btn","cms-singularity","cms-clickable",i,a(e.outline,"outline"),e.class]),c=CMSwift.omit(e,["icon","iconRight","label","loading","outline","iconAlign","slots"]);c.class=f;const d=e.icon!=null?typeof e.icon=="string"?C.Icon({name:e.icon}):e.icon:null,h=e.iconRight!=null?typeof e.iconRight=="string"?C.Icon({name:e.iconRight}):e.iconRight:null,b=CMSwift.ui.renderSlot(o,"icon",{},d),$=CMSwift.ui.renderSlot(o,"iconRight",{},h),F=CMSwift.ui.renderSlot(o,"label",{},e.label),D=E(o,"default",{},s),R=[],be=Ae=>{Ae&&(Array.isArray(Ae)?R.push(...Ae):R.push(Ae))},ce=e.iconAlign;(ce==="after"||ce==="right")&&!h?(be(F),D.length&&R.push(...D),be(b)):(be(b),be(F),D.length&&R.push(...D)),be($),R.length===0&&R.push(_.span("Button"));const O=!!e.disabled||!!e.loading,te=e.loading?null:e.onClick,X=Ae=>{var me;if((me=e.onPointerDown)==null||me.call(e,Ae),O||!(Ae!=null&&Ae.currentTarget))return;const ye=Ae.currentTarget,pe=ye.getBoundingClientRect(),we=typeof Ae.clientX=="number"?Ae.clientX-pe.left:pe.width/2,he=typeof Ae.clientY=="number"?Ae.clientY-pe.top:pe.height/2;ye.style.setProperty("--cms-burst-x",`${we}px`),ye.style.setProperty("--cms-burst-y",`${he}px`),ye.classList.remove("cms-btn-burst"),ye.offsetWidth,ye.classList.add("cms-btn-burst")};e.loading&&R.unshift(_.span({class:"cms-muted",style:{marginRight:"8px"}},"\u23F3"));const U=_.button({...c,disabled:O,onClick:te,onPointerDown:X,"aria-disabled":O?"true":null,"aria-busy":e.loading?"true":null},...R);return wt(U,e),U},(xs=CMSwift.isDev)!=null&&xs.call(CMSwift)&&(C.meta.Btn={signature:"UI.Btn(...children) | UI.Btn(props, ...children)",props:{label:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",iconAlign:"before|after|left|right",color:"primary|secondary|warning|danger|success|info|light|dark",outline:"boolean",loading:"boolean",disabled:"boolean",slots:"{ icon?, label?, default? }",class:"string",style:"object"},slots:{icon:"Icon slot",iconRight:"Right icon slot",label:"Label slot",default:"Button content"},events:["click","pointerdown","focus","blur"],returns:"HTMLButtonElement"}),C.FormField=(t={})=>{var pe,we,he,me,Q,L,z;Sn(t);const e=t.slots||{},s=ee([t.color,t.state],()=>{const H=n(t.color)||n(t.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(H)?H:n(t.state)||""}),o=_.div({class:l(["cms-clear-field-set","cms-field","cms-singularity-field",s,a(t.fill,"cms-field-fill"),a(t.outline,"outline"),t.wrapClass,t.class])}),i=E(e,"topLabel",{},t.topLabel);i.length&&o.appendChild(_.div({class:"cms-field-label"},...i));const f=t.multi||t.multiple,c=typeof t.control=="function"?t.control():t.control,d=()=>{const H=t.getValue?t.getValue():null;return!(H==null||H==="")},h=()=>{var H,y;t.disabled||t.readonly||((H=t.onClear)==null||H.call(t),(y=t.onFocus)==null||y.call(t))},b=CMSwift.ui.renderSlot(e,"control",{control:c,clear:h,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:d()},null);let $=null,F=null;if(b)$=Array.isArray(b)?_.div({class:"cms-control"},...b):b;else{$=_.div({class:"cms-control"});const H=_.div({class:"cms-addon cms-addon-left"}),y=t.icon!=null?typeof t.icon=="string"?C.Icon({name:t.icon}):t.icon:null,Y=CMSwift.ui.renderSlot(e,"icon",{},y),k=CMSwift.ui.renderSlot(e,"prefix",{},t.prefix);E(null,"default",{},Y).forEach(re=>H.appendChild(re)),E(null,"default",{},k).forEach(re=>H.appendChild(re)),H.childNodes.length&&$.appendChild(H);const v=_.div({class:"cms-mid"+(H.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});c&&v.appendChild(c);const M=E(e,"label",{},t.label);if(M.length){const re=_.div({class:l(["cms-float-label",a(f,"cms-multiselect")])},...M);v.appendChild(re)}$.appendChild(v);const x=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:h},C.Icon({name:"close"})):null,g=CMSwift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:d()},x);g&&(g.onclick=re=>{re.stopPropagation(),h()},E(null,"default",{},g).forEach(re=>$.appendChild(re))),F=x,F&&((pe=t.clearable)!=null&&pe.action)&&t.clearable.action(re=>re?F.classList.remove("cms-d-none"):F.classList.add("cms-d-none"));const p=_.div({class:"cms-addon cms-addon-right"}),T=t.iconRight!=null?typeof t.iconRight=="string"?C.Icon({name:t.iconRight}):t.iconRight:null,V=CMSwift.ui.renderSlot(e,"iconRight",{},T),ne=CMSwift.ui.renderSlot(e,"suffix",{},t.suffix);E(null,"default",{},ne).forEach(re=>p.appendChild(re)),E(null,"default",{},V).forEach(re=>p.appendChild(re)),p.childNodes.length&&($.appendChild(p),v.classList.add("cms-with-right"))}const D=H=>H&&(H&&typeof H.action=="function"?H.value:Array.isArray(H)&&typeof H[0]=="function"?H[0]():typeof H=="function"?H():H),R=H=>H==null||H===!1||H===""?!1:Array.isArray(H)?H.length>0:!0;let be=null;const ce=()=>{const H=[{key:"error",value:D(t.error),slot:"errorMessage",className:"cms-error"},{key:"warning",value:D(t.warning),slot:"warning",className:"cms-warning"},{key:"success",value:D(t.success),slot:"success",className:"cms-success"},{key:"note",value:D(t.note),slot:"note",className:"cms-note"},{key:"hint",value:D(t.hint),slot:"hint",className:"cms-hint"}];let y=null;for(const x of H)if(R(x.value)){y=x;break}const Y={error:H[0].value,warning:H[1].value,success:H[2].value,note:H[3].value,hint:H[4].value,props:t},k=y?E(e,y.slot,Y,y.value):[],v=k.length?_.div({class:y==null?void 0:y.className},...k):null;["error","warning","success","note"].forEach(x=>{var g;return(g=$==null?void 0:$.classList)==null?void 0:g.toggle(x,(y==null?void 0:y.key)===x)}),be?v?be.replaceWith(v):be.remove():v&&o.appendChild(v),be=v},ie=()=>{var y;const H=d();(y=$==null?void 0:$.classList)==null||y.toggle("has-value",H),F&&(F.style.display=H?"":"none")};ie(),(we=$==null?void 0:$.classList)==null||we.toggle("disabled",!!t.disabled),o.appendChild($);const O=CMSwift.ui.getSlot(e,"errorMessage"),te=CMSwift.ui.getSlot(e,"warning"),X=CMSwift.ui.getSlot(e,"success"),U=CMSwift.ui.getSlot(e,"note"),Ae=CMSwift.ui.getSlot(e,"hint");return!!((he=t.error)!=null&&he.action||(me=t.warning)!=null&&me.action||(Q=t.success)!=null&&Q.action||(L=t.note)!=null&&L.action||(z=t.hint)!=null&&z.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 O=="function"||typeof te=="function"||typeof X=="function"||typeof U=="function"||typeof Ae=="function"?CMSwift.reactive.effect(()=>{ce()},"UI.FormField:message"):ce(),o._refresh=ie,o._control=$,o._el=c,o},(As=CMSwift.isDev)!=null&&As.call(CMSwift)&&(C.meta=C.meta||{},C.meta.FormField={signature:"UI.FormField(props)",description:"Wrapper field con label floating, hint/error/success/warning/note, clear e addons slot-based.",props:{label:"String|Node|Function",topLabel:"String|Node|Function",hint:"String|Node|Function",error:"String|Node|Function",success:"String|Node|Function",warning:"String|Node|Function",note:"String|Node|Function",icon:"String|Node|Function",iconRight:"String|Node|Function",prefix:"String|Node|Function",suffix:"String|Node|Function",clearable:"boolean",disabled:"boolean",readonly:"boolean",control:"Node|Function",getValue:"() => any",onClear:"() => void",onFocus:"() => void",wrapClass:"string",slots:"{ label?, topLabel?, prefix?, suffix?, icon?, iconRight?, clear?, hint?, error?, control? }"},slots:{label:"Floating label content",topLabel:"Top label content",prefix:"Left addon content",suffix:"Right addon content",icon:"Left icon content",iconRight:"Right icon content",clear:"Clear button slot (ctx: { clear, disabled, readonly, hasValue })",hint:"Hint content",errorMessage:"Error content",success:"Success content",warning:"Warning content",note:"Note content",control:"Override control wrapper (ctx: { control, clear, disabled, readonly, hasValue })"},returns:"HTMLDivElement (wrapper) con ._refresh()"}),C.InputRaw=(t={})=>{var $;const e=_.input({class:l(["cms-input-raw",t.class]),type:t.type||"text",name:t.name,placeholder:t.placeholder,autocomplete:t.autocomplete,value:t.value});let s=($=e.value)!=null?$:"";const o=()=>{var D;const F=(D=e.value)!=null?D:"";F!==s&&(s=F,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let i=null,f=!1;const c=()=>{if(f)return;f=!0;let F=0;const D=()=>{if(o(),F+=1,F>=10){f=!1;return}setTimeout(D,120)};setTimeout(D,40)},d=()=>{i||(i=setInterval(()=>{if(document.activeElement!==e){clearInterval(i),i=null;return}o()},250))},h=()=>{i&&(clearInterval(i),i=null)};e.addEventListener("input",()=>{var F;s=(F=e.value)!=null?F:""}),e.addEventListener("change",()=>{var F;s=(F=e.value)!=null?F:""}),e.addEventListener("animationstart",F=>{F.animationName==="cms-autofill"&&(o(),d(),c())}),e.addEventListener("focus",()=>{d(),c(),setTimeout(o,50)}),e.addEventListener("blur",()=>{h(),setTimeout(o,0)}),setTimeout(o,0),c();const b=t.model;if(b){if(typeof b=="object"&&typeof b._bind=="function")ot.rodModel(e,b);else if(Array.isArray(b)&&typeof b[0]=="function"&&typeof b[1]=="function"){const F=ot.rodFromSignal(b[0],b[1]);ot.rodModel(e,F)}}return e},C.Input=(t={})=>{var be,ce;const e=t.slots||{},s=_.input({class:l(["cms-input",t.class]),type:t.type||"text",name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,value:(be=t.value)!=null?be:"",disabled:!!t.disabled,readOnly:!!t.readonly});let o=(ce=s.value)!=null?ce:"";const i=()=>{var O;const ie=(O=s.value)!=null?O:"";ie!==o&&(o=ie,s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})))};let f=null,c=!1;const d=()=>{if(c)return;c=!0;let ie=0;const O=()=>{if(i(),ie+=1,ie>=10){c=!1;return}setTimeout(O,120)};setTimeout(O,40)},h=()=>{f||(f=setInterval(()=>{if(document.activeElement!==s){clearInterval(f),f=null;return}i()},250))},b=()=>{f&&(clearInterval(f),f=null)};s.addEventListener("input",()=>{var ie,O;o=(ie=s.value)!=null?ie:"",(O=t.onInput)==null||O.call(t,s.value)}),s.addEventListener("change",()=>{var ie,O;o=(ie=s.value)!=null?ie:"",(O=t.onChange)==null||O.call(t,s.value)}),s.addEventListener("focus",ie=>{var O;(O=t.onFocus)==null||O.call(t,ie),h(),d(),setTimeout(i,50)}),s.addEventListener("blur",ie=>{var O;(O=t.onBlur)==null||O.call(t,ie),b(),setTimeout(i,0)}),s.addEventListener("animationstart",ie=>{ie.animationName==="cms-autofill"&&(i(),h(),d())}),setTimeout(i,0),d();const $=t.model;if($){const ie=O=>{let te=!1;const X=Ae=>{const ye=Ae!=null?Ae:"";s.value!==ye&&(s.value=ye,o=ye)};O.action(Ae=>{if(!te){te=!0;try{X(Ae)}finally{te=!1}}}),X(O.value);const U=Ae=>{if(te||Ae!=null&&Ae.isComposing)return;const ye=s.value;if(O.value!==ye){te=!0;try{O.value=ye}finally{te=!1}}};s.addEventListener("input",U),s.addEventListener("compositionend",U),typeof O.onDispose=="function"&&O.onDispose(()=>{s.removeEventListener("input",U),s.removeEventListener("compositionend",U)})};if(typeof $=="object"&&typeof $._bind=="function")ie($);else if(Array.isArray($)&&typeof $[0]=="function"&&typeof $[1]=="function"){const O=CMSwift.rodFromSignal($[0],$[1]);ie(O)}}const F=CMSwift.ui.renderSlot(e,"input",{input:s,props:t},s),D=Array.isArray(F)?_.div({style:{display:"contents"}},...F):F,R=C.FormField({...t,control:D,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 ie;return(ie=R._refresh)==null?void 0:ie.call(R)}),s.addEventListener("change",()=>{var ie;return(ie=R._refresh)==null?void 0:ie.call(R)}),R._input=s,R},(Ns=CMSwift.isDev)!=null&&Ns.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Input={signature:"UI.Input(props)",description:"Field input con floating label, hint/error/success/warning/note, clearable, icon, prefix/suffix e supporto reattivo (rod/signal).",props:{model:"rod | [get,set] signal",value:"string",type:"string (default: 'text')",name:"string",autocomplete:"string",inputmode:"string",disabled:"boolean",readonly:"boolean",label:"String|Node|Function (floating label)",topLabel:"String|Node|Function (label sopra, non floating)",placeholder:"string (fallback se non usi label)",hint:"String|Node|Function",error:"String|Node|Function",success:"String|Node|Function",warning:"String|Node|Function",note:"String|Node|Function",clearable:"boolean",icon:"String|Node|Function",iconRight:"String|Node|Function",prefix:"String|Node|Function",suffix:"String|Node|Function",class:"string (applicata all'input)",wrapClass:"string (applicata al field wrapper)",style:"object",onInput:"(value:string) => void",onChange:"(value:string) => void",onFocus:"(event) => void",onBlur:"(event) => void"},slots:{label:"Floating label (via FormField slots.label)",topLabel:"Top label (via FormField slots.topLabel)",prefix:"Addon a sinistra (via FormField slots.prefix)",suffix:"Addon a destra (via FormField slots.suffix)",icon:"Icona a sinistra (via FormField slots.icon)",iconRight:"Icona a destra (via FormField slots.iconRight)",clear:"Clear button (via FormField slots.clear)",hint:"Hint content (via FormField slots.hint)",errorMessage:"Error content (via FormField slots.errorMessage)",success:"Success content (via FormField slots.success)",warning:"Warning content (via FormField slots.warning)",note:"Note content (via FormField slots.note)",input:"Custom input node (ctx: { input, props })"},returns:"HTMLDivElement (field wrapper) con ._input = HTMLInputElement"}),C.Select=(t={})=>{const e=t.filterable,s=!!t.multiple||!!t.multi,o=!!t.allowCustom||!!t.allowCustomValue,i=t.slots||{},f=q=>!!q&&(typeof q=="object"&&typeof q._bind=="function"||Zt(q)),c=f(t.model)?t.model:f(t.value)?t.value:null,d=q=>Array.isArray(q)?q.slice():q==null||q===""?[]:[q],h=q=>s?d(q):q,b=c?typeof c=="object"&&typeof c._bind=="function"?c.value:c[0]():t.value,[$,F]=CMSwift.reactive.signal(!1),[D,R]=CMSwift.reactive.signal(""),[be,ce]=CMSwift.reactive.signal(s?d(b):b!=null?b:""),[ie,O]=CMSwift.reactive.signal(!1),[te,X]=CMSwift.reactive.signal([]),[U,Ae]=CMSwift.reactive.signal([]),[ye,pe]=CMSwift.reactive.signal(-1);let we=null;if(c){if(typeof c=="object"&&typeof c._bind=="function")ce(h(c.value)),c.action(q=>ce(h(q))),we=q=>{const Le=h(q);c.value!==Le&&(c.value=Le)};else if(Array.isArray(c)&&typeof c[0]=="function"&&typeof c[1]=="function"){const q=c[0],Le=c[1];CMSwift.reactive.effect(()=>{ce(h(q()))},"UI.Select:model"),we=Z=>Le(h(Z))}}function he(){var q;return typeof t.disabled=="function"?t.disabled():typeof t.disabled=="boolean"?t.disabled:(q=t==null?void 0:t.disabled)!=null&&q.action?t.disabled.value:!1}function me(q){var Le,Z,Ve,je;if(q==null)return null;if(typeof q=="string"||typeof q=="number")return{type:"option",label:String(q),value:q,disabled:!1};if(typeof q=="object"){if(Array.isArray(q.options))return{type:"group",label:String((Le=q.label)!=null?Le:""),options:q.options};const $e=(Z=q.label)!=null?Z:q.value!=null?String(q.value):"";return{type:"option",label:String($e),value:(je=(Ve=q.value)!=null?Ve:q.label)!=null?je:"",disabled:!!q.disabled}}return{type:"option",label:String(q),value:q,disabled:!1}}function Q(q){const Z=(Array.isArray(q)?q:[]).map(me).filter(Boolean),Ve=[],je=[];for(const $e of Z)if($e.type==="group"){Ve.push({type:"group",label:$e.label});const et=($e.options||[]).map(me).filter(Boolean).filter(j=>j.type==="option");for(const j of et)Ve.push(j),je.push(j)}else Ve.push($e),je.push($e);X(Ve),Ae(je)}async function L(){const q=t.options;let Le;try{const Z=typeof q=="function"?q():q;Z&&typeof Z.then=="function"?(O(!0),Le=await Z):Le=Z,Q(Le)}catch(Z){console.error("[UI.Select] options load error:",Z),Q([])}finally{O(!1)}}function z(q){var Z;const Le=h(q);ce(Le),we&&we(Le),(Z=t.onChange)==null||Z.call(t,Le)}function H(q){const Le=d(be()),Ve=Le.some(je=>je==q)?Le.filter(je=>je!=q):[...Le,q];z(Ve)}function y(q,Le=!1){s?(H(q),Le&&Y()):(z(q),k())}function Y(){R(""),re&&(re.value="")}function k(){F(!1),Y(),pe(-1)}async function v(){if(he())return;F(!0),await L();const q=be(),Le=U();let Z=-1;if(s){const Ve=d(q);for(const je of Ve)if(Z=Le.findIndex($e=>$e.value==je&&!$e.disabled),Z>=0)break}else Z=Le.findIndex(Ve=>Ve.value==q&&!Ve.disabled);Z<0&&(Z=Le.findIndex(Ve=>!Ve.disabled)),pe(Z),re&&setTimeout(()=>re.focus(),0)}function M(){$()?k():v()}const x=_.div({class:l(["cms-select",s?"multiple":"",t.class]),tabIndex:he()?-1:0,role:"combobox","aria-expanded":"false","aria-disabled":he()?"true":"false"}),g=_.div({class:l(["cms-select-value",s?"cms-select-value-multi":""])});CMSwift.reactive.effect(()=>{const q=U();if(g.innerHTML="",s){const Le=d(be());for(const Z of Le){const Ve=q.find(j=>j.value==Z),je=Ve?Ve.label:Z==null?"":String(Z);let $e=!1;const et=C.Chip({label:je,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:j=>{var Me,We,Ue;(Me=j==null?void 0:j.preventDefault)==null||Me.call(j),(We=j==null?void 0:j.stopPropagation)==null||We.call(j),(Ue=j==null?void 0:j.stopImmediatePropagation)==null||Ue.call(j),!$e&&($e=!0,H(Z))}});g.appendChild(et)}}else{const Le=be(),Z=q.find(Ve=>Ve.value==Le);g.textContent=Z?Z.label:Le==null||Le===""?"":String(Le)}},"UI.Select:value");const p=_.div({class:"cms-select-arrow"});CMSwift.reactive.effect(()=>{const q=CMSwift.ui.renderSlot(i,"arrow",{open:$()},C.Icon("#chevron-down"));p.innerHTML="",E(null,"default",{},q).forEach(Le=>p.appendChild(Le))},"UI.Select:arrow");const T=_.div({class:"cms-select-control",onClick:M},g,p),V=_.div({class:"cms-select-options",role:"listbox","aria-multiselectable":s?"true":"false"}),ne=_.div({class:"cms-select-filter cms-d-none"});let re=null;const ke=_.input({class:"cms-input",type:"text",placeholder:t.filterPlaceholder||"Cerca...",onInput:q=>R(q.target.value||"")});(()=>{const q=CMSwift.ui.renderSlot(i,"filter",{value:D(),setValue:Z=>{const Ve=Z==null?"":String(Z);R(Ve),re&&"value"in re&&(re.value=Ve)},close:k},ke);ne.innerHTML="";const Le=E(null,"default",{},q);Le.forEach(Z=>ne.appendChild(Z)),re=Le.length===1&&Le[0]&&Le[0].tagName==="INPUT"?Le[0]:null,re&&(re.value=D()||"")})(),CMSwift.reactive.effect(()=>{const q=D()||"";re&&"value"in re&&re.value!==q&&(re.value=q)},"UI.Select:filterValue"),typeof e=="boolean"?e?ne.classList.remove("cms-d-none"):ne.classList.add("cms-d-none"):e!=null&&e.action&&(e.action(q=>{q?ne.classList.remove("cms-d-none"):ne.classList.add("cms-d-none")}),e.value?ne.classList.remove("cms-d-none"):ne.classList.add("cms-d-none"));const u={...t};Sn(u);const N=ee([u.color,u.state],()=>{const q=n(u.color)||n(u.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(q)?q:n(u.state)||""}),w=_.div({class:l(["cms-select-menu","cms-singularity-menu-select",N,u.class,a(t.fill,"cms-select-menu-fill")]),onClick:q=>q.stopPropagation()},ne,V);let le=0,Ne=!1;const se=()=>{!$()||w.parentNode!==document.body||le||(le=requestAnimationFrame(()=>{if(le=0,!$()||!x.isConnected||w.parentNode!==document.body)return;const q=x.getBoundingClientRect(),Le=6,Z=8,Ve=Math.max(160,window.innerWidth-Z*2),je=Math.min(Math.max(q.width,180),Ve),$e=Math.max(Z,Math.min(q.left,window.innerWidth-je-Z));w.style.width=`${je}px`,w.style.left=`${$e}px`,w.style.right="auto",w.style.marginTop="0";const et=w.getBoundingClientRect().height||0,j=window.innerHeight-q.bottom-Le-Z,Me=q.top-Le-Z;let Ue=j<180&&Me>j?q.top-Le-et:q.bottom+Le;Ue=Math.max(Z,Math.min(Ue,window.innerHeight-et-Z)),w.style.top=`${Ue}px`}))},fe=()=>{Ne||(Ne=!0,window.addEventListener("resize",se),window.addEventListener("scroll",se,!0))},P=()=>{Ne&&(Ne=!1,window.removeEventListener("resize",se),window.removeEventListener("scroll",se,!0))},ve=()=>{w.parentNode!==document.body&&(le&&(cancelAnimationFrame(le),le=0),w.classList.add("portal"),w.style.display="block",document.body.appendChild(w),fe(),se())},xe=()=>{le&&(cancelAnimationFrame(le),le=0),P(),w.parentNode!==x&&x.appendChild(w),w.classList.remove("portal"),w.style.display="",w.style.position="",w.style.top="",w.style.left="",w.style.right="",w.style.width="",w.style.marginTop=""};x.appendChild(T),x.appendChild(w),CMSwift.reactive.effect(()=>{const q=$();x.classList.toggle("open",q),x.setAttribute("aria-expanded",q?"true":"false"),q?ve():xe()},"UI.Select:open"),CMSwift.reactive.effect(()=>{const q=he();x.classList.toggle("disabled",q),x.tabIndex=q?-1:0,x.setAttribute("aria-disabled",q?"true":"false")},"UI.Select:disabled");let Oe=[],ze=-1,Ce=-1;function Re(){var Le;const q=ye();Ce=q,q!==ze&&(Oe[ze]&&Oe[ze].classList.remove("active"),Oe[q]&&Oe[q].classList.add("active"),ze=q,q>=0&&((Le=Oe[q])==null||Le.scrollIntoView({block:"nearest"})))}CMSwift.reactive.effect(()=>{const q=te(),Le=U(),Z=(D()||"").toLowerCase().trim(),Ve=be(),je=s?d(Ve):[Ve],$e=ie(),et=Ce;V.innerHTML="",Oe=[],ze=-1;const j=[];let Me=0;const We=Ue=>{const Qe=je.some(Mt=>Mt==Ue.value),st=!!Ue.disabled,dt=["cms-select-option",Qe?"selected":"",st?"disabled":""].filter(Boolean).join(" "),At=()=>{s?H(Ue.value):(z(Ue.value),k())},pt=CMSwift.ui.renderSlot(i,"option",{opt:Ue,selected:Qe,active:Me===et,disabled:st,select:At},Ue.label),It=E(null,"default",{},pt),ft=_.div({class:dt,"data-flat-index":String(Me),onClick:st?null:At},...It);j.push(ft),Oe[Me]=ft,Me++};if(Z){const Ue=Le.filter(Qe=>Qe.label.toLowerCase().includes(Z));if(Ue.length===0){const Qe=CMSwift.ui.renderSlot(i,"empty",{filter:Z},t.emptyText||"Nessuna opzione");V.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},Qe))),$()&&se();return}for(const Qe of Ue)We(Qe)}else{let Ue=!1;for(const Qe of q)if(Qe.type==="group"){const st=CMSwift.ui.renderSlot(i,"group",{label:Qe.label},Qe.label);j.push(_.div({class:"cms-select-group"},...E(null,"default",{},st)))}else Ue=!0,We(Qe);if(!Ue){const Qe=CMSwift.ui.renderSlot(i,"empty",{filter:Z},t.emptyText||"Nessuna opzione");V.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},Qe))),$()&&se();return}}if($e){const Ue=CMSwift.ui.renderSlot(i,"loading",{},"Caricamento...");V.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},Ue))),$()&&se();return}for(const Ue of j)V.appendChild(Ue);Re(),$()&&se()},"UI.Select:render"),CMSwift.reactive.effect(()=>{Re()},"UI.Select:paintActive");const J=q=>{if(!x.isConnected)return;const Le=q.target;x.contains(Le)||w.contains(Le)||k()};document.addEventListener("click",J,!0);const B=q=>{if(he())return;const Le=$(),Z=U(),Ve=ye(),je=re&&q.target===re,$e=(j,Me)=>{let We=j;for(;We>=0&&We<Z.length;){if(!Z[We].disabled)return We;We+=Me}return-1},et=j=>{if(!j)return null;const Me=j.toLowerCase();let We=Z.find(Ue=>String(Ue.label).toLowerCase()===Me||String(Ue.value).toLowerCase()===Me);return We||(We=Z.find(Ue=>String(Ue.label).toLowerCase().includes(Me))),We&&!We.disabled?We:null};if(q.key==="Escape"){Le&&(q.preventDefault(),k());return}if(je&&(q.key==="Enter"||q.key===" ")){const j=(D()||"").trim();if(j){const Me=et(j);if(Me){q.preventDefault(),y(Me.value,!0);return}if(o&&q.key==="Enter"){q.preventDefault(),y(j,!0);return}if(q.key==="Enter"){q.preventDefault();return}}if(q.key===" ")return}if(q.key==="Enter"||q.key===" "){if(q.preventDefault(),!Le){v();return}Ve>=0&&Z[Ve]&&!Z[Ve].disabled&&(s?H(Z[Ve].value):(z(Z[Ve].value),k()));return}if(q.key==="ArrowDown"){if(q.preventDefault(),!Le){v();return}const j=$e(Ve<0?0:Ve+1,1);j>=0&&pe(j);return}if(q.key==="ArrowUp"){if(q.preventDefault(),!Le){v();return}const j=$e(Ve<0?Z.length-1:Ve-1,-1);j>=0&&pe(j);return}if(q.key==="Home"){if(!Le)return;q.preventDefault();const j=$e(0,1);j>=0&&pe(j);return}if(q.key==="End"){if(!Le)return;q.preventDefault();const j=$e(Z.length-1,-1);j>=0&&pe(j);return}};x.addEventListener("keydown",B),ne.addEventListener("keydown",B),x._dispose=()=>{document.removeEventListener("click",J,!0),x.removeEventListener("keydown",B),ne.removeEventListener("keydown",B),xe()};const G=C.FormField({...t,control:x,clearable:t.clearable,disabled:he(),readonly:!1,getValue:()=>{const q=be();return s?Array.isArray(q)&&q.length?q:"":q},onClear:()=>{he()||(z(s?[]:null),k())},onFocus:()=>{v()}});return CMSwift.reactive.effect(()=>{var q;(q=G._refresh)==null||q.call(G)},"UI.Select:fieldRefresh"),G._select=x,G._dispose=x._dispose,L(),G},(ks=CMSwift.isDev)!=null&&ks.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Select={signature:"UI.Select(props)",description:"Select premium: keyboard nav, option groups, async options, filter, clearable, multi select, valori custom da filtro. Wrappato in UI.FormField.",props:{options:"Array<option|group> | () => Array<option|group> | async () => Promise<Array<option|group>>",value:"any",model:"rod | [get,set] signal",label:"String|Node|Function (floating)",topLabel:"String|Node|Function",hint:"String|Node|Function",error:"String|Node|Function",success:"String|Node|Function",warning:"String|Node|Function",note:"String|Node|Function",clearable:"boolean",filterable:"boolean",multiple:"boolean",multi:"boolean (alias multiple)",allowCustom:"boolean (consenti valori custom dal filtro)",allowCustomValue:"boolean (alias allowCustom)",filterPlaceholder:"string",emptyText:"string",icon:"String|Node|Function",iconRight:"String|Node|Function",prefix:"String|Node|Function",suffix:"String|Node|Function",disabled:"boolean | () => boolean",dense:"boolean",class:"string",wrapClass:"string",slots:"{ clear?, arrow?, filter?, option?, group?, empty?, loading? }",onChange:"(value:any) => void"},slots:{clear:"Clear button (via FormField slots.clear)",arrow:"Arrow slot (ctx: { open })",filter:"Filter input slot (ctx: { value, setValue, close })",option:"Option renderer (ctx: { opt, selected, active, disabled, select })",group:"Group header (ctx: { label })",empty:"Empty state (ctx: { filter })",loading:"Loading state (ctx: {})",label:"Floating label (via FormField slots.label)",topLabel:"Top label (via FormField slots.topLabel)",prefix:"Left addon (via FormField slots.prefix)",suffix:"Right addon (via FormField slots.suffix)",icon:"Left icon (via FormField slots.icon)",iconRight:"Right icon (via FormField slots.iconRight)",hint:"Hint content (via FormField slots.hint)",errorMessage:"Error content (via FormField slots.errorMessage)",success:"Success content (via FormField slots.success)",warning:"Warning content (via FormField slots.warning)",note:"Note content (via FormField slots.note)"},keyboard:["Enter/Space","ArrowUp","ArrowDown","Home","End","Escape"],returns:"HTMLDivElement (wrapper field) con ._select, ._dispose()"});function de(t,e){if(!t)return null;if(typeof t=="object"&&typeof t._bind=="function")return{get:()=>t.value,set:s=>{t.value!==s&&(t.value=s)},watch:s=>{typeof t.action=="function"&&t.action(s)}};if(Array.isArray(t)&&typeof t[0]=="function"&&typeof t[1]=="function"){const s=t[0],o=t[1];return{get:s,set:o,watch:i=>ot.reactive.effect(()=>{i(s())},e||"UI:model")}}return null}C.Layout=(...t)=>{var Pn,On,Rn,Dn,Ut,Wt,m,ae,Te,Xe,Ze,qe;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=(_e,Ye)=>!!_e&&Object.prototype.hasOwnProperty.call(_e,Ye),f=(..._e)=>{for(const Ye of _e)if(i(e,Ye))return e[Ye]},c=(_e,Ye=null)=>_e==null||_e===!1||_e===""?Ye:typeof _e=="number"?`${_e}px`:String(_e),d=(_e,Ye=null)=>{if(_e==null||_e===!1||_e==="")return Ye;if(typeof _e=="number"&&Number.isFinite(_e))return _e;const St=Number.parseFloat(String(_e));return Number.isFinite(St)?St:Ye},h=(_e,Ye=null,St=null)=>{let Et=Number.isFinite(_e)?_e:0;return Number.isFinite(Ye)&&(Et=Math.max(Ye,Et)),Number.isFinite(St)&&(Et=Math.min(St,Et)),Et},b=f("header","headerContent"),$=f("aside","drawer"),F=f("nav","asideRight","drawerRight"),D=f("page","main","content","body"),R=f("footer","footerContent"),be=f("drawerEnabled","asideEnabled"),ce=f("navEnabled","asideRightEnabled","rightAsideEnabled"),ie=n(be),O=n(ce),te=ie!==!1,X=O===!0||n(e.noNav)===!1,U=n(e.noDrawer)===!0||ie===!1||$===!1,Ae=n(e.noNav)===!0||O===!1||F===!1,ye=()=>n(e.drawerFloating)===!0,pe=()=>n(e.navFloating)===!0,we=()=>n(e.drawerResizable)===!0,he=()=>n(e.navResizable)===!0,me=()=>d(n(e.drawerMinWidth),180),Q=()=>d(n(e.drawerMaxWidth),null),L=()=>d(n(e.navMinWidth),180),z=()=>d(n(e.navMaxWidth),null),H=d(n(e.drawerWidth),280),y=d((Pn=n(e.navWidth))!=null?Pn:n(e.asideRightWidth),280),[Y,k]=CMSwift.reactive.signal(h(H,me(),Q())),[v,M]=CMSwift.reactive.signal(h(y,L(),z())),x=de(e.drawerOpen,"UI.Layout:drawerOpen"),g=x?!!x.get():typeof e.drawerOpen=="boolean"?!!e.drawerOpen:!0,[p,T]=CMSwift.reactive.signal(g),V=_e=>{const Ye=!!_e;p()!==Ye&&T(Ye),x==null||x.set(Ye)};(On=x==null?void 0:x.watch)==null||On.call(x,()=>{const _e=!!x.get();p()!==_e&&T(_e)});const ne=de(e.navOpen,"UI.Layout:navOpen"),re=ne?!!ne.get():typeof e.navOpen=="boolean"?!!e.navOpen:!0,[ke,I]=CMSwift.reactive.signal(re),u=_e=>{const Ye=!!_e;ke()!==Ye&&I(Ye),ne==null||ne.set(Ye)};(Rn=ne==null?void 0:ne.watch)==null||Rn.call(ne,()=>{const _e=!!ne.get();ke()!==_e&&I(_e)});const N=Number((Dn=n(e.layoutBreakpoint))!=null?Dn:0),w=Number((Ut=n(e.drawerBreakpoint))!=null?Ut:N||1024),le=Number((Wt=n(e.navBreakpoint))!=null?Wt:N||w),Ne=Math.max(w,le,0),[se,fe]=CMSwift.reactive.signal(!1),P=()=>{typeof window!="undefined"&&fe(window.innerWidth<Ne)};typeof window!="undefined"&&(P(),window.addEventListener("resize",P));const ve=()=>({props:e,openAside:()=>V(!0),closeAside:()=>V(!1),toggleAside:()=>V(!p()),openNav:()=>u(!0),closeNav:()=>u(!1),toggleNav:()=>u(!ke()),isDrawerOpen:()=>!!p(),isNavOpen:()=>!!ke(),isMobile:()=>!!se(),isDrawerFloating:()=>ye(),isNavFloating:()=>pe()}),xe=(_e,Ye)=>{const St=ve();for(const Vt of _e){if(!i(o,Vt))continue;const Xt=typeof o[Vt]=="function"?o[Vt](St):o[Vt];return E(null,"default",St,Xt)}const Et=typeof Ye=="function"?Ye(St):Ye;return E(null,"default",St,Et)},Oe=D!==void 0?D:s,ze=l(["cms-app","cms-layout",e.class]),Ce=CMSwift.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","shellClass","headerClass","asideClass","navClass","pageClass","footerClass","overlayClass","gap","headerOffset","minHeight","slots"]);Ce.class=ze,Ce.style={...e.style||{}},Ce.style["--cms-layout-drawer-width"]=c((m=n(e.drawerWidth))!=null?m:280,"280px"),Ce.style["--cms-layout-nav-width"]=c((Te=(ae=n(e.navWidth))!=null?ae:n(e.asideRightWidth))!=null?Te:280,"280px"),Ce.style["--cms-layout-drawer-peek"]=c((Xe=n(e.drawerPeek))!=null?Xe:20,"20px"),Ce.style["--cms-layout-nav-peek"]=c((qe=(Ze=n(e.navPeek))!=null?Ze:n(e.asideRightPeek))!=null?qe:20,"20px");const Re=c(n(e.gap),null);Re!=null&&(Ce.style["--cms-layout-gap"]=Re);const J=c(n(e.headerOffset),null);J!=null&&(Ce.style["--layout-header-height"]=J);const B=c(n(e.minHeight),null);B!=null&&(Ce.style["--cms-layout-min-height"]=B);const G=_.div(Ce),Le=n(e.tagPage)===!0?{header:"header",aside:"aside",nav:"nav",page:"main",footer:"footer"}:{header:"div",aside:"div",nav:"div",page:"div",footer:"div"},Z=_.div({class:l(["cms-layout-shell-grid",e.shellClass])}),Ve=_[Le.header]({class:l(["cms-layout-section","cms-layout-header","header",a(e.stickyHeader,"sticky"),e.headerClass])}),je=_[Le.aside]({class:l(["cms-layout-section","cms-layout-aside","aside",a(e.stickyAside!==!1,"sticky"),e.asideClass]),role:"navigation","aria-hidden":"true"}),$e=_.div({class:"cms-layout-panel-body cms-layout-aside-body"}),et=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-drawer","aria-hidden":"true"});je.appendChild($e),je.appendChild(et);const j=_[Le.nav]({class:l(["cms-layout-section","cms-layout-nav","nav",a(e.stickyNav,"sticky"),e.navClass]),role:Le.nav==="nav"?null:"complementary","aria-hidden":"true"}),Me=_.div({class:"cms-layout-panel-body cms-layout-nav-body"}),We=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-nav","aria-hidden":"true"});j.appendChild(Me),j.appendChild(We);const Ue=_[Le.page]({class:l(["cms-layout-section","cms-layout-main","main",e.pageClass]),role:Le.page==="main"?null:"main"}),Qe=_[Le.footer]({class:l(["cms-layout-section","cms-layout-footer","footer",a(e.stickyFooter,"sticky"),e.footerClass])});Z.appendChild(Ve),Z.appendChild(je),Z.appendChild(Ue),Z.appendChild(j),Z.appendChild(Qe),G.appendChild(Z);const st=_.div({class:l(["cms-aside-overlay",e.overlayClass]),onClick:()=>{n(e.overlayClose)!==!1&&(p()&&V(!1),ke()&&u(!1))}});G.appendChild(st);let dt=!1,At=!1,pt=!1,It=!1,ft=!1,Mt=null,Ot=null;const Gt=_e=>{!_e||typeof _e!="object"||(typeof _e._dispose=="function"&&_e._dispose(),!(!_e.childNodes||!_e.childNodes.length)&&Array.from(_e.childNodes).forEach(Gt))},Je=_e=>{_e&&Array.from(_e.childNodes).forEach(Ye=>{Gt(Ye),Ye.remove()})},Ct=_e=>{const Ye=ve(),St=typeof _e=="function"?_e(Ye):_e;return E(null,"default",Ye,St)},_t=()=>{const _e=dt?Ve.getBoundingClientRect().height:0;G.style.setProperty("--layout-header-height",`${_e}px`)},Ft=(_e,Ye)=>(Je(_e),Ye.forEach(St=>_e.appendChild(St)),Ye.length>0),Bt=()=>{if(we()){const _e=h(Y(),me(),Q());_e!==Y()&&k(_e),G.style.setProperty("--cms-layout-drawer-width",`${_e}px`)}if(he()){const _e=h(v(),L(),z());_e!==v()&&M(_e),G.style.setProperty("--cms-layout-nav-width",`${_e}px`)}},qt=(_e,Ye)=>{if(Ye.button!==0)return;const St=_e==="drawer"?je:j;if(St.hidden)return;const Et=_e==="drawer"?Y:v,Vt=_e==="drawer"?k:M,Xt=_e==="drawer"?me:L,sn=_e==="drawer"?Q:z,nn=St.getBoundingClientRect(),cn=nn.width||Et(),yn=An=>{const Nn=_e==="drawer"?An.clientX-nn.left:nn.right-An.clientX;Vt(h(Nn||cn,Xt(),sn())),Bt(),Ht()},gn=()=>{G.classList.remove("is-resizing-layout"),document.removeEventListener("pointermove",yn,!0),document.removeEventListener("pointerup",gn,!0),Ot=null};G.classList.add("is-resizing-layout"),document.addEventListener("pointermove",yn,!0),document.addEventListener("pointerup",gn,!0),Ot=gn,Ye.preventDefault()},Yt=_e=>qt("drawer",_e),$t=_e=>qt("nav",_e);et.addEventListener("pointerdown",Yt),We.addEventListener("pointerdown",$t);const Ht=()=>{const _e=!!se(),Ye=!!p(),St=!!ke(),Et=!U&&te&&At,Vt=!Ae&&X&&pt,Xt=Et&&(_e||ye()),sn=Vt&&(_e||pe()),nn=Et&&Ye,cn=Vt&&St,yn=nn&&!Xt,gn=cn&&!sn,An=yn&&we(),Nn=gn&&he(),Wn=nn&&Xt||cn&&sn;Bt(),G.classList.toggle("is-mobile",_e),G.classList.toggle("drawer-open",nn),G.classList.toggle("nav-open",cn),G.classList.toggle("no-drawer",!Et),G.classList.toggle("no-nav",!Vt),G.classList.toggle("has-header",dt),G.classList.toggle("has-drawer",Et),G.classList.toggle("has-nav",Vt),G.classList.toggle("has-footer",ft),G.classList.toggle("drawer-floating",Xt),G.classList.toggle("nav-floating",sn),Ve.hidden=!dt,Qe.hidden=!ft,Ue.hidden=!It,st.hidden=!(Xt||sn),st.classList.toggle("show",Wn),je.hidden=!Et||!nn&&!Xt,je.classList.toggle("open",nn),je.classList.toggle("is-floating",Xt),je.classList.toggle("is-resizable",An),je.setAttribute("aria-hidden",nn?"false":"true"),et.hidden=!An,j.hidden=!Vt||!cn&&!sn,j.classList.toggle("open",cn),j.classList.toggle("is-floating",sn),j.classList.toggle("is-resizable",Nn),j.setAttribute("aria-hidden",cn?"false":"true"),We.hidden=!Nn,Z.style.gridTemplateColumns=[yn?"minmax(0, var(--cms-layout-drawer-width))":"0px","minmax(0, 1fr)",gn?"minmax(0, var(--cms-layout-nav-width))":"0px"].join(" "),Z.style.gridTemplateAreas=['"header header header"',`"${yn?"aside":"."} main ${gn?"nav":"."}"`,'"footer footer footer"'].join(" ")},jt=(_e,Ye)=>(dt=Ft(Ve,Ct(_e)),_t(),Ht(),Ye&&CMSwift.router.setURLOnly(Ye),Ve),Kt=(_e,Ye)=>(At=Ft($e,Ct(_e)),At||V(!1),Ht(),Ye&&CMSwift.router.setURLOnly(Ye),je),Lt=(_e,Ye)=>(pt=Ft(Me,Ct(_e)),pt||u(!1),Ht(),Ye&&CMSwift.router.setURLOnly(Ye),j),an=(_e,Ye)=>(It=Ft(Ue,Ct(_e)),Ht(),Ye&&CMSwift.router.setURLOnly(Ye),Ue),mn=(_e,Ye)=>(ft=Ft(Qe,Ct(_e)),Ht(),Ye&&CMSwift.router.setURLOnly(Ye),Qe);dt=Ft(Ve,xe(["header"],b)),At=Ft($e,U?[]:xe(["aside","drawer"],$)),pt=Ft(Me,Ae?[]:xe(["nav","asideRight","drawerRight"],F)),It=Ft(Ue,xe(["page","main","default"],Oe)),ft=Ft(Qe,xe(["footer"],R)),typeof ResizeObserver!="undefined"&&(Mt=new ResizeObserver(()=>_t()),Mt.observe(Ve)),_t(),CMSwift.reactive.effect(()=>{se(),p(),ke(),Ht()},"UI.Layout:state");const Tn=_e=>{n(e.escClose)!==!1&&(!se()&&!ye()&&!pe()||!p()&&!ke()||_e.key==="Escape"&&(_e.preventDefault(),p()&&V(!1),ke()&&u(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",Tn,!0),G.openAside=()=>V(!0),G.closeAside=()=>V(!1),G.toggleAside=()=>V(!p()),G.openNav=()=>u(!0),G.closeNav=()=>u(!1),G.toggleNav=()=>u(!ke()),G.isDrawerOpen=()=>!!p(),G.isNavOpen=()=>!!ke(),G.isMobile=()=>!!se(),G.header=()=>Ve,G.aside=()=>je,G.drawer=()=>je,G.nav=()=>j,G.page=()=>Ue,G.main=()=>Ue,G.footer=()=>Qe,G.headerUpdate=jt,G.asideUpdate=Kt,G.drawerUpdate=Kt,G.navUpdate=Lt,G.pageUpdate=an,G.mainUpdate=an,G.footerUpdate=mn,G.reflow=Ht,G._dispose=()=>{var _e;typeof window!="undefined"&&window.removeEventListener("resize",P),typeof document!="undefined"&&document.removeEventListener("keydown",Tn,!0),et.removeEventListener("pointerdown",Yt),We.removeEventListener("pointerdown",$t),Ot==null||Ot(),(_e=Mt==null?void 0:Mt.disconnect)==null||_e.call(Mt)},wt(G,e),Ht(),G},(Ms=CMSwift.isDev)!=null&&Ms.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Layout={signature:"UI.Layout(...children) | UI.Layout(props, ...children)",props:{header:"Node|Function|Array",headerContent:"Node|Function|Array",aside:"Node|Function|Array|false",drawer:"Node|Function|Array|false",nav:"Node|Function|Array|false",asideRight:"Node|Function|Array|false",drawerRight:"Node|Function|Array|false",page:"Node|Function|Array",main:"Node|Function|Array",content:"Node|Function|Array",body:"Node|Function|Array",footer:"Node|Function|Array",footerContent:"Node|Function|Array",noDrawer:"boolean",drawerEnabled:"boolean",asideEnabled:"boolean",noNav:"boolean",navEnabled:"boolean",asideRightEnabled:"boolean",drawerOpen:"rod | [get,set] signal | boolean",navOpen:"rod | [get,set] signal | boolean",layoutBreakpoint:"number(px)",drawerBreakpoint:"number(px)",navBreakpoint:"number(px)",drawerWidth:"number|string",drawerResizable:"boolean",drawerMinWidth:"number|string",drawerMaxWidth:"number|string",navWidth:"number|string",navResizable:"boolean",navMinWidth:"number|string",navMaxWidth:"number|string",asideRightWidth:"number|string",drawerPeek:"number|string",navPeek:"number|string",asideRightPeek:"number|string",drawerFloating:"boolean",navFloating:"boolean",overlayClose:"boolean",escClose:"boolean",stickyHeader:"boolean",stickyFooter:"boolean",stickyAside:"boolean",stickyNav:"boolean",tagPage:"boolean",gap:"number|string",headerOffset:"number|string",minHeight:"number|string",shellClass:"string",headerClass:"string",asideClass:"string",navClass:"string",pageClass:"string",footerClass:"string",overlayClass:"string",slots:"{ header?, aside?, drawer?, nav?, asideRight?, drawerRight?, page?, main?, footer?, default? }",class:"string",style:"object"},slots:{header:"Header content",aside:"Aside / drawer content",drawer:"Alias di aside",nav:"Right-side panel content",asideRight:"Alias di nav",drawerRight:"Alias di nav",page:"Page content",main:"Alias di page",footer:"Footer content",default:"Fallback page content"},returns:"HTMLDivElement con methods openAside/closeAside/toggleAside/openNav/closeNav/toggleNav, isDrawerOpen/isNavOpen/isMobile/reflow, header()/aside()/nav()/page()/footer(), headerUpdate/asideUpdate/navUpdate/pageUpdate/mainUpdate/footerUpdate e _dispose()",description:"Shell layout composabile con drawer sinistro e nav destro indipendenti, width configurabili, resize opzionale con min/max, modalita floating opzionale e update runtime delle sezioni."}),C.Footer=(...t)=>{var H,y,Y;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=k=>Object.prototype.hasOwnProperty.call(e,k),f={props:e},c=(k,v)=>{if(!(v==null||v===!1)){if(Array.isArray(v)){v.forEach(M=>c(k,M));return}if(v!=null&&v.nodeType){k.appendChild(v);return}k.appendChild(document.createTextNode(String(v)))}},d=(k,v,M=x=>x)=>{const x=CMSwift.ui.getSlot(o,k);if(x!=null)return E(o,k,f,null);if(typeof v=="function"){const g=new Set(["eyebrow","title","subtitle"]),p=_[g.has(k)?"span":"div"]({class:`cms-footer-slot-${k}`});return CMSwift.reactive.effect(()=>{const T=M(v(f)),V=Cn(CMSwift.ui.slot(T));p.replaceChildren(),Array.isArray(V)?V.forEach(ne=>c(p,ne)):c(p,V)},`UI.Footer:${k}`),[p]}return E(o,k,f,M(v))},h=(k,v="icon",M=e.iconSize||e.size||"md")=>k==null||k===!1?null:typeof k=="string"?C.Icon({name:k,size:M}):CMSwift.ui.slot(k,{as:v}),b=i("left")?e.left:e.start,$=i("right")?e.right:e.end,F=i("title")?e.title:e.label,D=(y=(H=e.subtitle)!=null?H:e.description)!=null?y:e.note,R=i("content")?e.content:i("body")?e.body:s!=null&&s.length?s:null,be=[...d("left",b),...d("start",null)],ce=d("icon",e.icon,h),ie=d("eyebrow",(Y=e.eyebrow)!=null?Y:e.kicker),O=d("title",F),te=d("subtitle",D),X=d("meta",e.meta),U=(()=>{const k=d("content",null);return k.length?k:d("default",R)})(),Ae=[...d("center",null),...d("body",null)],ye=[...d("right",$),...d("end",null)],pe=d("actions",e.actions),we=_.div({class:l(["cms-footer-body",e.bodyClass,e.centerClass])},_.div({class:"cms-footer-heading"},ce.length?_.div({class:"cms-footer-icon"},...ce):null,_.div({class:"cms-footer-copy"},ie.length?_.div({class:l(["cms-footer-eyebrow",e.eyebrowClass])},...ie):null,O.length?_.div({class:l(["cms-footer-title",e.titleClass])},...O):null,te.length?_.div({class:l(["cms-footer-subtitle",e.subtitleClass])},...te):null,U.length?_.div({class:l(["cms-footer-content",e.contentClass])},...U):null),X.length?_.div({class:l(["cms-footer-meta",e.metaClass])},...X):null)),he=[];Ae.length?he.push(_.div({class:l(["cms-footer-body",e.bodyClass,e.centerClass])},...Ae)):(ce.length||ie.length||O.length||te.length||U.length||X.length)&&he.push(we),(ye.length||pe.length)&&he.push(_.div({class:l(["cms-footer-end",e.endClass])},...ye,...pe.length?[_.div({class:l(["cms-footer-actions",e.actionsClass])},...pe)]:[]));const me=CMSwift.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"]);me.class=l(["cms-panel","cms-footer","cms-singularity",a(e.sticky,"sticky"),a(e.dense,"dense"),a(e.elevated,"elevated"),a(e.divider!==!1,"divider"),a(e.stack,"stack"),ge(e.align,"align-"),e.class]),me.style={...e.style||{}};const Q=A(e.justify);Q!=null&&(me.style.justifyContent=Q);const L=A(e.wrap,k=>k?"wrap":"nowrap");L!=null&&(me.style.flexWrap=L),e.gap!=null&&(me.style["--cms-footer-gap"]=K(n(e.gap))),e.minHeight!=null&&(me.style.minHeight=K(n(e.minHeight)));const z=_.footer(me,...be.length?[_.div({class:l(["cms-footer-start",e.startClass])},...be)]:[],...he.length?[_.div({class:"cms-footer-main"},...he)]:[]);return wt(z,e),z},(_s=CMSwift.isDev)!=null&&_s.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Footer={signature:"UI.Footer(...children) | UI.Footer(props, ...children)",props:{title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",eyebrow:"String|Node|Function|Array",content:"Node|Function|Array",meta:"Node|Function|Array",icon:"String|Node|Function|Array",left:"Node|Function|Array",start:"Alias di left",right:"Node|Function|Array",end:"Alias di right",body:"Alias di content",actions:"Node|Function|Array",sticky:"boolean",dense:"boolean",elevated:"boolean",divider:"boolean",align:"left|center|right",justify:"flex-start|center|flex-end|space-between|space-around|space-evenly",wrap:"boolean",stack:"boolean",gap:"string|number",minHeight:"string|number",slots:"{ left?, start?, right?, end?, center?, body?, icon?, eyebrow?, title?, subtitle?, meta?, content?, actions?, default? }",class:"string",style:"object"},slots:{left:"Area iniziale del footer",start:"Alias/addon area iniziale",right:"Area finale del footer",end:"Alias/addon area finale",center:"Override completo del body centrale",body:"Alias di center",icon:"Icona leading",eyebrow:"Eyebrow / kicker",title:"Titolo principale",subtitle:"Sottotitolo o nota",meta:"Meta info accanto al contenuto centrale",content:"Contenuto extra o fallback dei children",actions:"Azioni raggruppate nella zona finale",default:"Fallback content per la body area"},returns:"HTMLElement <footer>",description:"Footer strutturato con regioni start/body/end, copy opzionale, azioni e slot composabili."});const Se=t=>{const e=[];for(const s of t||[]){const o=Cn(CMSwift.ui.slot(s));o&&(Array.isArray(o)?e.push(...o):e.push(o))}return e},Fe=(t,e)=>{const s=Cn(CMSwift.ui.slot(t,e));return s?Array.isArray(s)?s:[s]:[]},K=t=>{var e;return typeof t=="number"?`${t}px`:typeof t=="string"&&((e=CMSwift.uiSizes)!=null&&e.includes(t))?`var(--cms-size-${t})`:String(t)};C.Toolbar=(...t)=>{var k,v,M,x,g,p,T,V;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=(ne,re,ke={})=>{const I=Array.isArray(ne)?ne:[ne];for(const u of I)if(CMSwift.ui.getSlot(o,u)!=null)return E(o,u,ke,re);return re==null?[]:E(null,"default",ke,re)},f=ne=>(Array.isArray(ne)?ne:[ne]).some(ke=>CMSwift.ui.getSlot(o,ke)!=null),c={props:e},d=i(["before"],e.before,c),h=i(["start","left"],(k=e.start)!=null?k:e.left,c),b=i(["center","body","content","default"],(x=(M=(v=e.center)!=null?v:e.body)!=null?M:e.content)!=null?x:s,c),$=i(["end","right","actions"],(p=(g=e.end)!=null?g:e.right)!=null?p:e.actions,c),F=i(["after"],e.after,c),D=i(["title"],e.title,c),R=i(["subtitle"],e.subtitle,c),be=i(["meta"],e.meta,c),ce=!!(d.length||h.length||$.length||F.length||D.length||R.length||be.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||f(["before","start","left","center","body","content","end","right","actions","after","title","subtitle","meta"])),ie=l(["cms-toolbar",a(ce,"structured"),a(e.dense,"dense"),a(e.divider,"divider"),a(e.elevated,"elevated"),a(e.sticky,"sticky"),e.class]),O=CMSwift.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"]);O.class=ie;const te={...e.style||{}};te.display=te.display||"flex";const X=A(e.align),U=A(e.justify),Ae=A(e.wrap,ne=>typeof ne=="boolean"?ne?"wrap":"nowrap":String(ne),"wrap"),ye=A(e.gap,K,"var(--cms-s-md)");te["--cms-toolbar-gap"]=ye!=null?ye:"var(--cms-s-md)",te.gap=te.gap||"var(--cms-toolbar-gap)";const pe={xxs:"4px 6px",xs:"6px 8px",sm:"6px 10px",md:"10px 12px",lg:"12px 16px",xl:"14px 18px",xxl:"16px 20px"},we=A(e.size,ne=>pe[ne]||"");if(we!=null&&(te.padding=we),ce?(te.flexDirection=te.flexDirection||"column",te.alignItems=te.alignItems||"stretch"):(X!=null&&(te.alignItems=X),U!=null&&(te.justifyContent=U),Ae!=null&&(te.flexWrap=Ae)),Object.keys(te).length&&(O.style=te),!ce){const ne=E(o,"default",c,s),re=_.div(O,...ne);return wt(re,e),re}const he=(V=(T=e.bodyClass)!=null?T:e.centerClass)!=null?V:e.contentClass,me=ee([e.justify],()=>{const ne=n(e.justify);return!ne||ne==="flex-start"?"auto":""}),Q={display:"flex",alignItems:"inherit",gap:"var(--cms-toolbar-gap)",flexWrap:"inherit",minWidth:0},L={};X!=null&&(L.alignItems=X),U!=null&&(L.justifyContent=U),Ae!=null&&(L.flexWrap=Ae);const z=be.length||D.length||R.length?_.div({class:l(["cms-toolbar-copy",e.copyClass])},be.length?_.div({class:l(["cms-toolbar-meta",e.metaClass])},...be):null,D.length?_.div({class:l(["cms-toolbar-title",e.titleClass])},...D):null,R.length?_.div({class:l(["cms-toolbar-subtitle",e.subtitleClass])},...R):null):null,H=!!(h.length||z||b.length||$.length),y=[d.length?_.div({class:l(["cms-toolbar-before",e.beforeClass]),style:{...Q}},...d):null,H?_.div({class:"cms-toolbar-main",style:L},h.length?_.div({class:l(["cms-toolbar-start",e.startClass]),style:{...Q}},...h):null,z||b.length?_.div({class:l(["cms-toolbar-center",he]),style:{...Q,flex:"1 1 240px"}},z,...b):null,$.length?_.div({class:l(["cms-toolbar-end",e.endClass]),style:{...Q,justifyContent:"flex-end",marginInlineStart:me}},...$):null):null,F.length?_.div({class:l(["cms-toolbar-after",e.afterClass]),style:{...Q}},...F):null].filter(Boolean),Y=_.div(O,...y);return wt(Y,e),Y},(Fs=CMSwift.isDev)!=null&&Fs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Toolbar={signature:"UI.Toolbar(...children) | UI.Toolbar(props, ...children)",props:{before:"Node|Function|Array",start:"Node|Function|Array",left:"Alias di start",center:"Node|Function|Array",body:"Alias di center",content:"Alias di center",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",meta:"String|Node|Function|Array",end:"Node|Function|Array",right:"Alias di end",actions:"Alias di end",after:"Node|Function|Array",dense:"boolean",divider:"boolean",elevated:"boolean",sticky:"boolean",wrap:"boolean|string",align:"stretch|flex-start|center|flex-end|baseline",justify:"flex-start|center|flex-end|space-between|space-around|space-evenly",gap:"string|number (es: '8px' o 'var(--cms-s-md)')",size:"xxs|xs|sm|md|lg|xl|xxl",beforeClass:"string",startClass:"string",bodyClass:"string",centerClass:"Alias di bodyClass",contentClass:"Alias di bodyClass",copyClass:"string",titleClass:"string",subtitleClass:"string",metaClass:"string",endClass:"string",afterClass:"string",slots:"{ before?, start?, left?, center?, body?, content?, title?, subtitle?, meta?, end?, right?, actions?, after?, default? }",class:"string",style:"object"},slots:{before:"Row superiore opzionale",start:"Leading content area",left:"Alias di start",center:"Main content area",body:"Alias di center",content:"Alias di center",title:"Titolo principale della toolbar",subtitle:"Sottotitolo o nota operativa",meta:"Meta info/chips sopra o accanto al titolo",end:"Trailing actions area",right:"Alias di end",actions:"Alias di end",after:"Row inferiore opzionale",default:"Fallback content / children"},events:{onClick:"MouseEvent"},description:"Toolbar composabile con regioni before/start/center/end/after, copy opzionale e fallback compatibile con l'uso flex semplice.",returns:"HTMLDivElement"});const Be=t=>{var e;return t&&t.nodeType===1&&((e=t.classList)==null?void 0:e.contains("cms-grid-col"))};C.Grid=(...t)=>{var k,v,M;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=n(e.items),f=Array.isArray(i)?i:i==null?[]:[i],c=(x={})=>{const g=e.itemProps||{},p={...g,...x};return p.class=l([g.class,e.itemClass,x.class]),p.style={...g.style||{},...e.itemStyle||{},...x.style||{}},p},d=(x,g={})=>{if(x==null||x===!1)return[];if(Be(x))return[x];if(Jn(x)){const p=x.children!=null?bn(x.children):x.content!=null?bn(x.content):x.node!=null?bn(x.node):x.label!=null?bn(x.label):[];return[C.GridCol(c(x),...p)]}return Array.isArray(x)?[C.GridCol(c(g),...x)]:[C.GridCol(c(g),x)]},h=(x,g,p,T=!0)=>{if(x==null||x===!1)return[];const V=Jn(x)?x:{};if(T){const ne={item:x,index:g,count:p,first:g===0,last:g===p-1},re=E(o,"item",ne,null);if(re.length)return re.flatMap(ke=>d(ke,V))}return d(x,V)},b=[];f.forEach((x,g)=>{b.push(...h(x,g,f.length))}),E(o,"default",{items:f,count:f.length},s).forEach(x=>{b.push(...d(x))}),b.length||E(o,"empty",{items:f,count:0},e.empty).forEach(g=>{const p=d(g,{style:{gridColumn:"1 / -1"}});b.push(...p)});const F=l(["cms-grid",a(e.dense,"dense"),a(e.inline,"cms-grid-inline"),a(e.debug,"cms-grid-debug"),e.class]),D=CMSwift.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"]);D.class=F;const R={...e.style||{}},be=A(e.gap,K);be!=null&&(R["--cms-grid-gap"]=be,R.gap=be);const ce=A(e.rowGap,K);ce!=null&&(R.rowGap=ce);const ie=A((k=e.columnGap)!=null?k:e.colGap,K);ie!=null&&(R.columnGap=ie);const O=A(e.max,K,"1fr"),te=A(e.min,K);if(te!=null){const x=n(e.autoFill)?"auto-fill":"auto-fit";R.gridTemplateColumns=`repeat(${x}, minmax(${te}, ${O||"1fr"}))`}else{const x=A((v=e.columns)!=null?v:e.cols,g=>typeof g=="number"?`repeat(${g}, minmax(0, 1fr))`:String(g));x!=null&&(R.gridTemplateColumns=x)}const X=A(e.rows,x=>typeof x=="number"?`repeat(${x}, minmax(0, auto))`:String(x));X!=null&&(R.gridTemplateRows=X);const U=A(e.autoRows,K);U!=null&&(R.gridAutoRows=U);const Ae=A(e.flow,x=>{const g=String(x);return e.dense&&!g.includes("dense")?`${g} dense`:g});Ae!=null&&(R.gridAutoFlow=Ae);const ye=A(e.areas,x=>Array.isArray(x)?x.map(g=>`"${Array.isArray(g)?g.join(" "):String(g)}"`).join(" "):String(x));ye!=null&&(R.gridTemplateAreas=ye);const pe=A((M=e.align)!=null?M:e.alignItems);pe!=null&&(R.alignItems=pe);const we=A(e.justify);we!=null&&(R.justifyContent=we);const he=A(e.justifyItems);he!=null&&(R.justifyItems=he);const me=A(e.placeItems);me!=null&&(R.placeItems=me);const Q=A(e.placeContent);Q!=null&&(R.placeContent=Q);const L=A(e.width,K);L!=null&&(R.width=L),n(e.full)===!0&&(R.width="100%");const z=A(e.minWidth,K);z!=null&&(R.minWidth=z);const H=A(e.maxWidth,K);H!=null&&(R.maxWidth=H);const y=A(e.padding,K);y!=null&&(R.padding=y),Object.keys(R).length&&(D.style=R);const Y=_.div(D,...b);return wt(Y,e),Y},(Is=CMSwift.isDev)!=null&&Is.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Grid={signature:"UI.Grid(...children) | UI.Grid(props, ...children)",props:{cols:"number|string",columns:"alias di cols",min:"string|number (auto-fit/auto-fill min width)",max:"string|number (max track size, default 1fr)",gap:"string|number",rowGap:"string|number",columnGap:"string|number",colGap:"alias di columnGap",rows:"number|string",autoRows:"string|number",areas:"string|array",flow:"row|column|dense|row dense|column dense",align:"stretch|start|center|end",alignItems:"alias di align",justify:"start|center|end|space-between|space-around|space-evenly",justifyItems:"stretch|start|center|end",placeItems:"string",placeContent:"string",dense:"boolean",inline:"boolean",debug:"boolean",autoFit:"boolean",autoFill:"boolean",full:"boolean",width:"string|number",minWidth:"string|number",maxWidth:"string|number",padding:"string|number",items:"Array<Node|Object|string>",itemClass:"string",itemStyle:"object",itemProps:"object",empty:"String|Node|Function|Array",slots:"{ default?, item?, empty? }",class:"string",style:"object"},slots:{default:"Grid content fallback",item:"Render custom di ogni item ({ item, index, count, first, last })",empty:"Empty state della griglia"},returns:"HTMLDivElement",description:"Griglia dichiarativa per layout responsive: supporta children, items/slot item, auto-fit, template custom e empty state."}),C.GridCol=(...t)=>{var ve,xe,Oe,ze,Ce,Re;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=J=>Object.prototype.hasOwnProperty.call(e,J),f=(J,B,G={})=>{const q=Array.isArray(J)?J:[J];for(const Le of q)if(CMSwift.ui.getSlot(o,Le)!=null)return E(o,Le,G,B);return B==null?[]:E(null,"default",G,B)},c=J=>{var B;return J==null||J===!1||J===""?"":typeof J=="string"&&((B=CMSwift.uiSizes)!=null&&B.includes(J))?`var(--cms-s-${J})`:K(J)},d=J=>{var B;return J==null||J===!1||J===""?"":typeof J=="string"&&((B=CMSwift.uiSizes)!=null&&B.includes(J))?no(J,"size"):K(J)},h={...e.style||{}},b=J=>{if(J==null||J==="")return null;if(J==="auto")return"auto";if(J==="full"||J===!0)return"1 / -1";const B=Number(J);if(Number.isFinite(B)&&B>0){const G=Math.max(1,Math.round(B));return`span ${G} / span ${G}`}return String(J)},$=J=>{if(J==null||J==="")return null;if(J==="full"||J===!0)return"1 / -1";const B=Number(J);if(Number.isFinite(B)&&B>0){const G=Math.max(1,Math.round(B));return`span ${G} / span ${G}`}return String(J)},F=A(e.span,b),D=A(e.sm,b),R=A(e.md,b),be=A(e.lg,b),ce=A(e.rowSpan,$),ie=A(e.row,$),O=A(e.area),te=A(e.align),X=A(e.justify),U=A(e.place),Ae=A(e.gap,c),ye=A(e.rowGap,c),pe=A(e.columnGap,c),we=A(e.padding,c),he=A(e.width,d),me=A(e.minHeight,d),Q=A(e.height,d),L=A(e.maxHeight,d),z=A(e.contentAlign),H=A(e.contentJustify),y=A(e.direction),Y=A(e.scroll,J=>J===!0?"auto":String(J),""),k=A(e.fullHeight,J=>J?"100%":"",""),v=ee([e.center,e.contentAlign,e.contentJustify],()=>!!n(e.center)&&(n(e.contentAlign)==null||n(e.contentAlign)==="")&&(n(e.contentJustify)==null||n(e.contentJustify)==="")),M={props:e},x=f(["start","top","header","before"],(Oe=(xe=(ve=e.start)!=null?ve:e.top)!=null?xe:e.header)!=null?Oe:e.before,M),g=i("body")?e.body:i("content")?e.content:s,p=f(["body","content","default"],g,M),T=f(["end","bottom","footer","after"],(Re=(Ce=(ze=e.end)!=null?ze:e.bottom)!=null?Ce:e.footer)!=null?Re:e.after,M),V=x.length||T.length||i("start")||i("top")||i("header")||i("before")||i("body")||i("content")||i("end")||i("bottom")||i("footer")||i("after")||e.startClass||e.bodyClass||e.contentClass||e.endClass||e.topClass||e.headerClass||e.bottomClass||e.footerClass||CMSwift.ui.getSlot(o,"start")!=null||CMSwift.ui.getSlot(o,"top")!=null||CMSwift.ui.getSlot(o,"header")!=null||CMSwift.ui.getSlot(o,"before")!=null||CMSwift.ui.getSlot(o,"body")!=null||CMSwift.ui.getSlot(o,"content")!=null||CMSwift.ui.getSlot(o,"end")!=null||CMSwift.ui.getSlot(o,"bottom")!=null||CMSwift.ui.getSlot(o,"footer")!=null||CMSwift.ui.getSlot(o,"after")!=null,ne=ee([e.stack,e.gap,e.rowGap,e.columnGap,e.contentAlign,e.contentJustify,e.direction,e.center],()=>V||n(e.stack)||[n(e.gap),n(e.rowGap),n(e.columnGap),n(e.contentAlign),n(e.contentJustify),n(e.direction)].some(B=>B!=null&&B!==!1&&B!=="")?!0:!!n(e.center)),re=ee([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],()=>!!(n(e.panel)||n(e.color)||n(e.clickable)||n(e.border)||n(e.glossy)||n(e.glow)||n(e.glass)||n(e.shadow)||n(e.outline)||n(e.gradient)||n(e.textGradient)||n(e.lightShadow)||n(e.radius))?["cms-clear-set","cms-singularity","cms-grid-col-surface"]:[]),ke=l(["cms-grid-col",re,a(e.panel,"cms-grid-col-panel"),a(e.auto,"is-auto"),a(ne,"cms-grid-col-stack"),a(e.inline,"cms-grid-col-inline"),a(v,"cms-grid-col-center"),e.class]),I=CMSwift.omit(e,["span","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"]);I.class=ke,n(e.auto)===!0?h["--cms-grid-col-base"]="auto":F!=null&&(h["--cms-grid-col-base"]=F),D!=null&&(h["--cms-grid-col-sm"]=D),R!=null&&(h["--cms-grid-col-md"]=R),be!=null&&(h["--cms-grid-col-lg"]=be),ce!=null?h.gridRow=ce:ie!=null&&(h.gridRow=ie),O!=null&&(h.gridArea=O),te!=null&&(h.alignSelf=te),X!=null&&(h.justifySelf=X),U!=null&&(h.placeSelf=U),Ae!=null&&(h.gap=Ae),ye!=null&&(h.rowGap=ye),pe!=null&&(h.columnGap=pe),we!=null&&(h.padding=we),he!=null&&(h.width=he),k!=null&&k!==""?h.height=k:Q!=null&&(h.height=Q),me!=null&&(h.minHeight=me),L!=null&&(h.maxHeight=L),y!=null&&(h.flexDirection=y),z!=null?h.alignItems=z:v!=null&&v!==""&&(h.alignItems=v?"center":""),H!=null?h.justifyContent=H:v!=null&&v!==""&&(h.justifyContent=v?"center":""),Y!=null&&Y!==""&&(h.overflow=Y),Object.keys(h).length&&(I.style=h);const u=e.onClick,N=e.onKeydown,w=!!(n(e.clickable)||n(e.to)),le=J=>{var G;if(u==null||u(J),J.defaultPrevented)return;const B=n(e.to);B&&((G=CMSwift.router)!=null&&G.navigate)&&(J.preventDefault(),CMSwift.router.navigate(B))},Ne=J=>{N==null||N(J),!J.defaultPrevented&&(J.key==="Enter"||J.key===" ")&&(J.preventDefault(),le(J))};if(w&&(I.onClick=le,I.onKeydown=Ne,I.tabIndex==null&&(I.tabIndex=0),I.role==null&&(I.role="button")),!V){const J=_.div(I,...E(o,"default",M,s));return wt(J,e),J}const se={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},fe=[x.length?_.div({class:l(["cms-grid-col-start",e.startClass,e.topClass,e.headerClass]),style:{...se}},...x):null,p.length?_.div({class:l(["cms-grid-col-body",e.bodyClass,e.contentClass]),style:{...se,flex:"1 1 auto"}},...p):null,T.length?_.div({class:l(["cms-grid-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...se}},...T):null].filter(Boolean),P=_.div(I,...fe);return wt(P,e),P},(Ls=CMSwift.isDev)!=null&&Ls.call(CMSwift)&&(C.meta=C.meta||{},C.meta.GridCol={signature:"UI.GridCol(...children) | UI.GridCol(props, ...children)",props:{span:"number|string",sm:"number|string",md:"number|string",lg:"number|string",auto:"boolean",row:"number|string",rowSpan:"number|string",area:"string",align:"string (align-self)",justify:"string (justify-self)",place:"string (place-self)",gap:"string|number",rowGap:"string|number",columnGap:"string|number",padding:"string|number",width:"string|number",height:"string|number",minHeight:"string|number",maxHeight:"string|number",fullHeight:"boolean",stack:"boolean",inline:"boolean",direction:"column|row|string",contentAlign:"string",contentJustify:"string",center:"boolean",scroll:"boolean|string",panel:"boolean",clickable:"boolean",to:"string",start:"Node|Function|Array",body:"Node|Function|Array",end:"Node|Function|Array",color:"string",outline:"boolean",shadow:"boolean|string",radius:"number|string",slots:"{ start?, body?, end?, default? }",class:"string",style:"object"},slots:{start:"Top/header region",body:"Main body region",end:"Bottom/footer region",default:"Fallback content"},events:{onClick:"MouseEvent",onKeydown:"KeyboardEvent"},returns:"HTMLDivElement",description:"Item per CSS Grid con span responsive, layout interno opzionale a stack, regioni start/body/end e varianti visuali leggere."}),C.Icon=(...t)=>{let e={},s=[],o="home",i=!1;const f=t[0],c=t[1],d=U=>U&&typeof U=="object"&&!U.nodeType&&!Array.isArray(U)&&!(U instanceof Function);typeof f=="string"?(o=f,i=!0,d(c)?(e=c,t.length>2&&(s=t.slice(2))):t.length>1&&(s=t.slice(1))):d(f)?(e=f,f.name!=null&&(o=f.name,i=!0),t.length>1&&(s=t.slice(1))):t.length&&(s=t),!i&&s.length&&(o=s.length===1?s[0]:s),Sn(e);const h=e.slots||{},b=n(e.size),$=n(e.color),F=String(o).endsWith("-fill"),D={...e.style||{}},R=ee(e.size,()=>{const U=n(e.size);return typeof U=="string"&&Bn[U]?U:""}),be=!!(e.color||e.clickable||e.border||e.glossy||e.glow||e.glass||e.shadow||e.outline||e.gradient||e.textGradient||e.lightShadow||e.radius),ce=l(["cms-icon","material-icons",...be?["cms-clear-set","cms-singularity"]:[],R,e.class]),ie=CMSwift.omit(e,["name","size","class","style","label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);if(ie.class=ce,Object.keys(D).length&&(ie.style=D),typeof o=="function"||o&&typeof o=="object"){const U=CMSwift.ui.renderSlot(h,"default",{},o),Ae=E(null,"default",{},U);return _.span({...ie,"data-icon":"custom"},...Ae)}const O=String(o),te=O.includes("#")?O:"";let X=null;if(te){const U=_.svg({width:"100%",height:"100%"},_.use({href:"/_cmswift-fe/img/svg/tabler-icons-sprite.svg"+te}));F&&(U.style.fill="currentColor"),X=_.span({...ie,"data-icon":O},U,...s)}else X=_.span({...ie,"data-icon":O},O,...s);if(b!=null){let U=b;CMSwift.uiSizes.includes(b)&&(U=`var(--cms-icon-size-${b})`),U=typeof U=="number"?U+"px":String(U),X.style.setProperty("--set-icon-size",U)}return wt(X,e),X},(Es=CMSwift.isDev)!=null&&Es.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Icon={signature:"UI.Icon(name) | UI.Icon(props) | UI.Icon(props, ...children)",props:{name:"string|Node|Function",size:"number|string",color:"string",shadow:"boolean|string",lightShadow:"boolean",clickable:"boolean",border:"boolean",glossy:"boolean",glow:"boolean",glass:"boolean",gradient:"boolean|number",outline:"boolean",textGradient:"boolean",radius:"number|string",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Custom icon content"},returns:"HTMLSpanElement",description:"Icona basata su sprite o testo, con size/color configurabili."}),C.Badge=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=ee(e.size,()=>{const ce=n(e.size);return typeof ce=="string"&&Bn[ce]?`cms-size-${ce}`:""}),f=l(["cms-clear-set","cms-badge","cms-singularity",i,a(e.outline,"outline"),e.class]),c=CMSwift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);c.class=f;const d={...e.style||{}};if(e.size){const ce=n(e.size);typeof ce=="string"&&Bn[ce]||(d.fontSize=K(e.size))}c.style=d;const h=(ce,ie,O)=>{const te=Array.isArray(ce)?ce:[ce];for(const X of te)if(CMSwift.ui.getSlot(o,X)!=null)return E(o,X,ie,O);return O==null||O===!1||O===""?[]:E(null,"default",ie,O)},b=()=>{var ie;const ce=n((ie=e.iconSize)!=null?ie:e.size);return typeof ce=="number"?Math.max(10,Math.round(ce*.85)):typeof ce=="string"&&{xxs:10,xs:11,sm:12,md:13,lg:14,xl:16,xxl:18,xxxl:20}[ce]||14},$=(ce,ie)=>{const O=n(ce);return O==null||O===!1||O===""?null:typeof O=="string"?C.Icon({name:O,size:b()}):CMSwift.ui.slot(O,{as:ie})},F=(ce,ie,O)=>_.dynamic(()=>{const te=$(e[ie],O),X=h(ce,{position:O},te);return X.length?_.span({class:`cms-badge-anchor cms-badge-anchor-${O}`,"data-badge-slot":O},...X):null}),D=_.dynamic(()=>{const ce=n(e.label);let ie=h(["label"],{},ce);return ie.length||(ie=h(["default"],{},s)),_.span({class:"cms-badge-content"},_.span({class:"cms-badge-label"},...ie.length?ie:[""]))}),R=_.dynamic(()=>{const ce=n(e.notification),ie=ce==null||ce===!1||ce===""?null:ce,O=h(["notification"],{notification:ce},ie);return O.length?_.span({class:"cms-badge-notification","data-badge-slot":"notification","aria-label":typeof ce=="number"?`${ce} notifications`:null},...O):null}),be=_.span(F(["left"],"left","left"),F(["centerLeft","center-left"],"centerLeft","center-left"),c,D,F(["topLeft","top-left"],"topLeft","top-left"),F(["topRight","top-right"],"topRight","top-right"),F(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),F(["bottomRight","bottom-right"],"bottomRight","bottom-right"),F(["centerRight","center-right"],"centerRight","center-right"),F(["right"],"right","right"),R);return(e.topLeft||e.centerLeft||e.bottomLeft)&&be.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&be.style.setProperty("padding-right","15px"),wt(be,e),be},(zs=CMSwift.isDev)!=null&&zs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Badge={signature:"UI.Badge(...children) | UI.Badge(props, ...children)",props:{label:"String|Node|Function|Array",color:"string",size:"string|number",outline:"boolean",notification:"string|number|Node|Function|[get,set] signal",iconSize:"string|number",topLeft:"String|Node|Function|Array",topRight:"String|Node|Function|Array",bottomLeft:"String|Node|Function|Array",bottomRight:"String|Node|Function|Array",centerLeft:"String|Node|Function|Array",centerRight:"String|Node|Function|Array",left:"String|Node|Function|Array",right:"String|Node|Function|Array",slots:"{ label?, default?, notification?, topLeft?, topRight?, bottomLeft?, bottomRight?, left?, right? }",class:"string",style:"object"},slots:{label:"Badge label content",default:"Fallback content",notification:"Notification badge content",topLeft:"Icon anchored top-left",topRight:"Icon anchored top-right",bottomLeft:"Icon anchored bottom-left",bottomRight:"Icon anchored bottom-right",centerLeft:"Icon anchored center-left",centerRight:"Icon anchored center-right",left:"Icon anchored left",right:"Icon anchored right"},returns:"HTMLSpanElement",description:"Badge inline con notification reattiva e 6 slot icona posizionabili."});const tt=t=>{if(t==null||t===!1)return"";const e=String(t).replace(/[._-]+/g," ").replace(/\s+/g," ").trim();if(!e)return"";const s=e.split(" ").filter(Boolean);return s.length?s.length===1?s[0].replace(/[^a-z0-9]/gi,"").slice(0,2).toUpperCase():s.slice(0,2).map(o=>o.charAt(0).toUpperCase()).join(""):""},Ge=(t,e)=>{const s=t==null||t===!0?e:t;if(s==null||s===!1)return Rt(e);const o=String(s).toLowerCase();return o==="online"||o==="available"||o==="active"?"success":o==="away"||o==="pending"?"warning":o==="busy"||o==="dnd"||o==="blocked"?"danger":o==="offline"||o==="idle"?"secondary":Rt(o)||Rt(e)},rt=(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)),Pe=(t,e)=>{if(t==null||t===!1){if(!e)return null;const o=Ge(null,e);return _.span({class:l(["cms-avatar-status",o?`cms-state-${o}`:""])})}if(t instanceof Node||Array.isArray(t)||typeof t=="function")return t;const s=Ge(t,e);return t===!0||s?_.span({class:l(["cms-avatar-status",s?`cms-state-${s}`:""])}):rt(t,"cms-avatar-badge")},Ie=(t,e)=>!e||!e.length?null:_.span({class:l(["cms-avatar-anchor",t])},...e);C.Avatar=(...t)=>{var v,M,x;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=ee(e.size,()=>{var p;const g=n(e.size);return typeof g=="string"&&((p=CMSwift.uiSizes)!=null&&p.includes(g))?`cms-size-${g}`:""}),f=ee([e.color,e.state],()=>{const g=n(e.color)||n(e.state)||"",p=Rt(g);return p?`cms-state-${p}`:""}),c=l(["cms-clear-set","cms-avatar","cms-singularity",i,f,a(e.square,"cms-avatar-square"),a(e.elevated,"elevated"),e.class]),d=CMSwift.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"]);d.class=c;const h={...e.style||{}},b=A(e.size,g=>{var p;return typeof g=="string"&&((p=CMSwift.uiSizes)!=null&&p.includes(g))?"":K(g)},"");b!=null&&(h.width=b,h.height=b);const $=(v=e.fontSize)!=null?v:e.textSize,F=$!=null?A($,K):A(e.size,g=>{var p;return typeof g=="string"&&((p=CMSwift.uiSizes)!=null&&p.includes(g))?"":`clamp(11px, calc(${K(g)} * 0.34), 28px)`},"");F!=null&&(h.fontSize=F);const D=A(e.radius,g=>{const p=En(g);return p==="xxxl"?"999px":p?`var(--cms-r-${p})`:typeof g=="number"?`${g}px`:String(g)});D!=null&&(h["--set-border-radius"]=D),d.style=h;const R={props:e},be=ee([e.alt,e.label,e.name,e.text],()=>{const g=n(e.alt)||n(e.label)||n(e.name)||n(e.text)||"avatar";return String(g)}),ce=e.icon!=null?typeof e.icon=="string"?C.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):CMSwift.ui.slot(e.icon,{as:"icon"}):null,ie=ee([e.initials,e.text,e.label,e.name],()=>{var T,V;const g=(T=n(e.initials))!=null?T:n(e.text);if(g!=null)return g;const p=(V=n(e.label))!=null?V:n(e.name);return typeof p=="string"?tt(p):p}),O=rt(n((M=e.badge)!=null?M:e.notification)),te=Pe(n((x=e.status)!=null?x:e.presence),n(e.statusColor));let X=E(o,"media",R,e.media);if(!X.length&&e.src){const g={class:"cms-avatar-img",src:e.src,alt:be,sizes:e.sizes,style:{}};e.srcset!=null&&(g.srcset=e.srcset),e.srcSet!=null&&(g.srcset=e.srcSet);const p=A(e.fit);p!=null&&(g.style.objectFit=p),X=[_.img(g)]}const U=E(o,"default",R,s),Ae=E(o,"fallback",R,null),ye=E(o,"label",R,ie),pe=E(o,"icon",R,ce),we=X.length?X:U.length?U:Ae.length?Ae:ye.length?ye:pe.length?pe:["?"],he=X.length?"cms-avatar-media":"cms-avatar-fallback",me=_.span({class:"cms-avatar-body"},_.span({class:he},...we));let Q=E(o,"topLeft",R,e.topLeft),L=E(o,"topRight",R,e.topRight),z=E(o,"bottomLeft",R,e.bottomLeft),H=E(o,"bottomRight",R,e.bottomRight);const y=E(o,"badge",R,O),Y=E(o,"status",R,te);return!L.length&&y.length&&(L=y),!H.length&&Y.length&&(H=Y),_.div(d,me,Ie("cms-avatar-anchor-top-left",Q),Ie("cms-avatar-anchor-top-right",L),Ie("cms-avatar-anchor-bottom-left",z),Ie("cms-avatar-anchor-bottom-right",H))},(Ts=CMSwift.isDev)!=null&&Ts.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Avatar={signature:"UI.Avatar(...children) | UI.Avatar(props, ...children)",props:{src:"string",srcset:"string",sizes:"string",alt:"string",label:"String|Node|Function|Array",name:"string",initials:"string|Node|Function|Array",text:"string|Node|Function|Array",size:"number|string",fontSize:"number|string",radius:"number|string",square:"boolean",elevated:"boolean",color:"string",state:"string",icon:"string|Node|Function|Array",iconSize:"number|string",media:"Node|Function|Array",fit:"cover|contain|fill|scale-down|none",badge:"string|number|Node|Function|Array",notification:"string|number|Node|Function|Array",status:"boolean|string|number|Node|Function|Array",statusColor:"success|warning|danger|info|primary|secondary|dark|light|string",topLeft:"Node|Function|Array",topRight:"Node|Function|Array",bottomLeft:"Node|Function|Array",bottomRight:"Node|Function|Array",slots:"{ media?, default?, fallback?, label?, icon?, badge?, status?, topLeft?, topRight?, bottomLeft?, bottomRight? }",class:"string",style:"object"},slots:{media:"Media principale custom",default:"Contenuto principale custom al posto di immagine o fallback",fallback:"Fallback custom quando non c'e immagine",label:"Fallback testuale / initials",icon:"Icona fallback",badge:"Badge overlay, di default top-right",status:"Presence dot o contenuto overlay, di default bottom-right",topLeft:"Contenuto overlay top-left",topRight:"Contenuto overlay top-right",bottomLeft:"Contenuto overlay bottom-left",bottomRight:"Contenuto overlay bottom-right"},returns:"HTMLDivElement",description:"Avatar flessibile con immagine, fallback intelligenti, stati, badge e slot overlay."}),C.Chip=(...t)=>{var ie,O,te,X;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=ee(e.size,()=>{const U=n(e.size);return typeof U=="string"&&Bn[U]?U:""}),f=l(["cms-clear-set","cms-chip","cms-singularity",i,e.class]),c=CMSwift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);c.class=f,c.style={...e.style||{}};const d=e.icon?typeof e.icon=="string"?C.Icon({name:e.icon,size:(ie=e==null?void 0:e.size)!=null?ie:null}):CMSwift.ui.slot(e.icon,{as:"icon"}):null,h=e.iconRight?typeof e.iconRight=="string"?C.Icon({name:e.iconRight,size:(O=e==null?void 0:e.size)!=null?O:null}):CMSwift.ui.slot(e.iconRight,{as:"iconRight"}):null,b=CMSwift.ui.renderSlot(o,"icon",{},d),$=CMSwift.ui.renderSlot(o,"iconRight",{},h),F=E(o,"label",{},e.label),D=F.length?F:E(o,"default",{},s),R=E(null,"default",{},b),be=E(null,"default",{},$),ce=_.span(c,...R,...D.length?D:[""],...be);if(e.removable){const U=C.Btn({class:"cms-chip-remove",onClick:e.onRemove,size:(te=e==null?void 0:e.size)!=null?te:null},C.Icon({size:(X=e==null?void 0:e.size)!=null?X:null,name:"close"}));ce.appendChild(U),U.onclick=()=>{e.onRemove&&e.onRemove(),ce.remove()}}return wt(ce,e),ce},(Ps=CMSwift.isDev)!=null&&Ps.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Chip={signature:"UI.Chip(...children) | UI.Chip(props, ...children)",props:{label:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",removable:"boolean",onRemove:"function",dense:"boolean",outline:"boolean|string|number",slots:"{ icon?, label?, default? }",class:"string",style:"object"},slots:{icon:"Chip icon content",iconRight:"Chip right icon content",label:"Chip label content",default:"Fallback content"},events:{onRemove:"MouseEvent"},returns:"HTMLSpanElement",description:"Chip con icona opzionale e rimozione."}),C.Stat=(...t)=>{var pe,we;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=()=>Rt(n(e.state)||n(e.color)||""),f=ee([e.state,e.color],()=>{const he=i();return he?`cms-state-${he}`:""}),c=ee(e.trend,()=>{const he=String(n(e.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(he)?"is-positive":["down","negative","danger","loss","decrease"].includes(he)?"is-negative":["flat","neutral","steady","stable"].includes(he)?"is-neutral":""}),d={...e},h=CMSwift.omit(d,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","meta","note","slots","state","subtitle","title","trend","value"]);h.class=l(["cms-clear-set","cms-stat","cms-singularity",f,c,d.class]),h.style={...d.style||{}};const b=(he,me,Q={})=>E(o,he,Q,me),$=e.icon==null?null:typeof e.icon=="string"?C.Icon({name:e.icon,size:e.iconSize||"md"}):CMSwift.ui.slot(e.icon,{as:"icon"}),F=b("eyebrow",e.eyebrow),D=b("label",(pe=e.label)!=null?pe:e.title),R=b("value",e.value),be=b("note",(we=e.note)!=null?we:e.subtitle),ce=b("meta",e.meta),ie=b("delta",e.delta,{trend:e.trend}),O=b("icon",$),te=b("aside",e.aside),X=b("footer",e.footer),U=b("actions",e.actions),Ae=b("default",s),ye=_.article(h,_.div({class:"cms-stat-head"},_.div({class:"cms-stat-lead"},O.length?_.div({class:"cms-stat-icon"},...O):null,_.div({class:"cms-stat-copy"},F.length?_.div({class:"cms-stat-eyebrow"},...F):null,D.length?_.div({class:"cms-stat-label"},...D):null)),te.length?_.div({class:"cms-stat-aside"},...te):null),_.div({class:"cms-stat-body"},R.length?_.div({class:"cms-stat-value"},...R):null,ie.length?_.div({class:"cms-stat-delta"},...ie):null,be.length?_.div({class:"cms-stat-note"},...be):null,ce.length?_.div({class:"cms-stat-meta"},...ce):null,Ae.length?_.div({class:"cms-stat-extra"},...Ae):null),X.length||U.length?_.div({class:"cms-stat-footer"},X.length?_.div({class:"cms-stat-footer-copy"},...X):null,U.length?_.div({class:"cms-stat-actions"},...U):null):null);return wt(ye,e),ye},(Os=CMSwift.isDev)!=null&&Os.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Stat={signature:"UI.Stat(...children) | UI.Stat(props, ...children)",props:{eyebrow:"String|Node|Function|Array",label:"String|Node|Function|Array",title:"Alias of label",value:"String|Number|Node|Function|Array",delta:"String|Node|Function|Array",trend:"up|down|flat|positive|negative|neutral",note:"String|Node|Function|Array",subtitle:"Alias of note",meta:"Node|Function|Array",icon:"String|Node|Function|Array",aside:"Node|Function|Array",footer:"Node|Function|Array",actions:"Node|Function|Array",state:"primary|secondary|success|warning|danger|info|light|dark",slots:"{ eyebrow?, label?, value?, delta?, note?, meta?, icon?, aside?, footer?, actions?, default? }",class:"string",style:"object"},slots:{eyebrow:"Small kicker above the stat label",label:"Main stat label",value:"Primary metric value",delta:"Trend / delta content",note:"Supporting note",meta:"Extra meta badges or info",icon:"Leading icon or avatar",aside:"Right-side support content",footer:"Footer/supporting bottom content",actions:"Footer actions cluster",default:"Extra body content"},returns:"HTMLElement",description:"Surface compatta per metriche singole, trend e metadata operative."}),C.Kpi=(...t)=>{var pe,we;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=()=>Rt(n(e.state)||n(e.color)||""),f=ee([e.state,e.color],()=>{const he=i();return he?`cms-state-${he}`:""}),c={...e},d=CMSwift.omit(c,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","media","meta","note","slots","state","subtitle","title","trend","value"]);d.class=l(["cms-clear-set","cms-kpi","cms-singularity",f,c.class]),d.style={...c.style||{}};const h=(he,me,Q={})=>E(o,he,Q,me),b=e.icon==null?null:typeof e.icon=="string"?C.Icon({name:e.icon,size:e.iconSize||"lg"}):CMSwift.ui.slot(e.icon,{as:"icon"}),$=h("eyebrow",e.eyebrow),F=h("title",(pe=e.title)!=null?pe:e.label),D=h("value",e.value),R=h("delta",e.delta,{trend:e.trend}),be=h("note",(we=e.note)!=null?we:e.subtitle),ce=h("meta",e.meta),ie=h("icon",b),O=h("aside",e.aside),te=h("media",e.media),X=h("footer",e.footer),U=h("actions",e.actions),Ae=h("default",s),ye=_.section(d,_.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"},$.length?_.div({class:"cms-kpi-eyebrow"},...$):null,F.length?_.div({class:"cms-kpi-title"},...F):null)),O.length?_.div({class:"cms-kpi-aside"},...O):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},D.length?_.div({class:"cms-kpi-value"},...D):null,R.length?_.div({class:"cms-kpi-delta"},...R):null),be.length?_.div({class:"cms-kpi-note"},...be):null,ce.length?_.div({class:"cms-kpi-meta"},...ce):null,te.length?_.div({class:"cms-kpi-media"},...te):null,Ae.length?_.div({class:"cms-kpi-extra"},...Ae):null),X.length||U.length?_.div({class:"cms-kpi-footer"},X.length?_.div({class:"cms-kpi-footer-copy"},...X):null,U.length?_.div({class:"cms-kpi-actions"},...U):null):null);return wt(ye,e),ye},(Rs=CMSwift.isDev)!=null&&Rs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Kpi={signature:"UI.Kpi(...children) | UI.Kpi(props, ...children)",props:{eyebrow:"String|Node|Function|Array",title:"String|Node|Function|Array",label:"Alias of title",value:"String|Number|Node|Function|Array",delta:"String|Node|Function|Array",trend:"up|down|flat|positive|negative|neutral",note:"String|Node|Function|Array",subtitle:"Alias of note",meta:"Node|Function|Array",media:"Node|Function|Array",icon:"String|Node|Function|Array",aside:"Node|Function|Array",footer:"Node|Function|Array",actions:"Node|Function|Array",state:"primary|secondary|success|warning|danger|info|light|dark",slots:"{ eyebrow?, title?, value?, delta?, note?, meta?, media?, icon?, aside?, footer?, actions?, default? }",class:"string",style:"object"},slots:{eyebrow:"Kicker content",title:"KPI title content",value:"Primary KPI value",delta:"Delta/trend content",note:"Supporting note",meta:"Extra meta badges or inline info",media:"Secondary data view or mini-visual content",icon:"Leading icon or avatar",aside:"Top-right support content",footer:"Bottom support content",actions:"Footer actions cluster",default:"Extra body content"},returns:"HTMLElement",description:"Surface piu ricca per KPI, metriche headline e mini dashboard summary."});const He=(t,e=180)=>{const s=getComputedStyle(t).transitionDuration;if(!s)return e;const o=s.split(",")[0].trim();if(!o)return e;const i=o.includes("ms")?parseFloat(o):parseFloat(o)*1e3;return Number.isFinite(i)?i:e},Ke=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"))}))},nt=(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 s=()=>{t._closed||(t._closed=!0,e==null||e())},o=f=>{f.target===t.panel&&(t.panel.removeEventListener("transitionend",o),s())};t.panel.addEventListener("transitionend",o);const i=He(t.panel,180);setTimeout(s,i+40)};C.List=(...t)=>{var O;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=!!n((O=e.number)!=null?O:e.ordered),f=n(e.marker),c=n(e.items),d=Array.isArray(c)?c:c==null?[]:[c],h=(te={})=>{const X=e.itemProps||{},U={...X,...te};return e.divider!=null&&U.divider==null&&(U.divider=e.divider),U.class=l([X.class,e.itemClass,te.class]),U.style={...X.style||{},...e.itemStyle||{},...te.style||{}},U},b=te=>{if(te==null||te===!1)return[];if(Qn(te))return[te];if(Jn(te)){const X=te.children!=null?bn(te.children):te.content!=null?bn(te.content):bn(te.node);return[C.Item(h(te),...X)]}return Array.isArray(te)?[C.Item(h(),...te)]:te!=null&&te.nodeType?[C.Item(h(),te)]:[C.Item(h(),te)]},$=(te,X,U,Ae=!0)=>{if(te==null||te===!1)return[];if(Ae){const ye={item:te,index:X,count:U,first:X===0,last:X===U-1},pe=E(o,"item",ye,null);if(pe.length)return pe.flatMap(we=>b(we))}return b(te)},F=[];d.forEach((te,X)=>{F.push(...$(te,X,d.length))});const D=E(o,"default",{items:d,count:d.length},s);if(D.forEach((te,X)=>{F.push(...$(te,d.length+X,d.length+D.length,!1))}),!F.length){const te=E(o,"empty",{items:d,count:0},e.empty);te.length&&(te.length===1&&Qn(te[0])?F.push(te[0]):F.push(C.Item({class:"cms-item-empty",flat:!0},...te)))}const R=l(["cms-list",a(e.dense,"dense"),a(e.divider,"divider"),a(f===!1||f==="none","cms-list-no-marker"),e.class]),be=CMSwift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);be.class=R,be.style={...e.style||{}};const ce=A(e.gap,K);return ce!=null&&(be.style["--cms-list-gap"]=ce),f!=null&&f!==!1&&f!==!0&&f!=="none"&&(be.style.listStyleType=String(f)),_[i?"ol":"ul"](be,...F)},(Ds=CMSwift.isDev)!=null&&Ds.call(CMSwift)&&(C.meta=C.meta||{},C.meta.List={signature:"UI.List(...children) | UI.List(props, ...children)",props:{items:"Array<Node|Object|string>",ordered:"boolean",number:"boolean",marker:"boolean|string",dense:"boolean",divider:"boolean",gap:"string|number",empty:"String|Node|Function|Array",itemClass:"string",itemStyle:"object",itemProps:"object",slots:"{ default?, item?, empty? }",class:"string",style:"object"},slots:{default:"List content fallback",item:"Render custom di ogni item ({ item, index, count, first, last })",empty:"Empty state content"},returns:"HTMLUListElement|HTMLOListElement",description:"Lista dichiarativa con supporto items, slot item, ordered/marker ed empty state."}),C.Item=(...t)=>{var y,Y,k,v,M,x,g,p;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t);e.state!=null&&e.color==null&&(e.color=e.state),Sn(e);const o=e.slots||{},i=ee([e.clickable,e.to],()=>!!(n(e.clickable)||n(e.to))),f=ee([e.active,e.selected],()=>!!(n(e.active)||n(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),d=(T,V,ne)=>{const re=n(T);return re==null||re===!1||re===""?null:typeof re=="string"?C.Icon({name:re,size:V||"sm"}):CMSwift.ui.slot(re,{as:ne})},h=E(o,"icon",{},d(e.icon,e.iconSize||e.size,"icon")),b=E(o,"title",{},(y=e.title)!=null?y:e.label),$=E(o,"subtitle",{},(k=(Y=e.subtitle)!=null?Y:e.caption)!=null?k:e.description),F=E(o,"meta",{},(v=e.meta)!=null?v:e.eyebrow),D=E(o,"body",{},(M=e.body)!=null?M:e.content),R=E(o,"default",{},s),be=E(o,"actions",{},(x=e.actions)!=null?x:e.footer),ce=(p=(g=e.aside)!=null?g:e.trailing)!=null?p:d(e.iconRight,e.iconSize||e.size,"iconRight"),ie=E(o,"aside",{},ce),O=[...D,...R],te=!(c||e.clickable||e.to||h.length||b.length||$.length||F.length||be.length||ie.length||D.length),X=l(["cms-item",a(e.divider,"divider"),a(c,"cms-clear-set"),a(c,"cms-singularity"),a(c,"cms-item-surface"),a(te,"cms-item-inline"),a(i,"cms-item-clickable"),a(f,"is-active"),a(e.disabled,"is-disabled"),e.class]),U=CMSwift.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"]);U.class=X,U.style={...e.style||{}};const Ae=e.onClick,ye=e.onKeydown,pe=T=>{var ne;if(Ae==null||Ae(T),T.defaultPrevented||n(e.disabled))return;const V=n(e.to);V&&((ne=CMSwift.router)!=null&&ne.navigate)&&(T.preventDefault(),CMSwift.router.navigate(V))},we=T=>{ye==null||ye(T),!(T.defaultPrevented||n(e.disabled))&&(T.key==="Enter"||T.key===" ")&&(T.preventDefault(),pe(T))};n(e.disabled)&&(U["aria-disabled"]="true"),(n(e.clickable)||n(e.to))&&(U.onClick=pe,U.onKeydown=we,U.tabIndex==null&&(U.tabIndex=n(e.disabled)?-1:0),U.role==null&&(U.role="button"));const he=b.length?_.div({class:"cms-item-title"},...b):null,me=$.length?_.div({class:"cms-item-subtitle"},...$):null,Q=F.length?_.div({class:"cms-item-meta"},...F):null,L=O.length?_.div({class:l(["cms-item-body",a(!(b.length||$.length||F.length),"is-standalone")])},...O):null,z=be.length?_.div({class:"cms-item-actions"},...be):null,H=_.li(U,_.div({class:"cms-item-row"},h.length?_.div({class:"cms-item-icon"},...h):null,_.div({class:"cms-item-main"},Q,he,me,L,z),ie.length?_.div({class:"cms-item-aside"},...ie):null));return wt(H,e),H},(Hs=CMSwift.isDev)!=null&&Hs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Item={signature:"UI.Item(...children) | UI.Item(props, ...children)",props:{label:"String|Node|Function|Array",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",meta:"String|Node|Function|Array",body:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",aside:"Node|Function|Array",actions:"Node|Function|Array",clickable:"boolean",to:"string",active:"boolean",selected:"boolean",disabled:"boolean",color:"string",state:"Alias di color",size:"string|number",outline:"boolean",shadow:"boolean|string",lightShadow:"boolean",border:"boolean",glossy:"boolean",glow:"boolean",glass:"boolean",gradient:"boolean|number",textGradient:"boolean",radius:"string|number",divider:"boolean",slots:"{ icon?, title?, subtitle?, meta?, body?, aside?, actions?, default? }",class:"string",style:"object"},slots:{icon:"Leading visual/icon",title:"Main title content",subtitle:"Secondary text",meta:"Top meta content",body:"Body content",aside:"Trailing content",actions:"Actions row",default:"Fallback body content"},returns:"HTMLLIElement",description:"Item strutturato per liste semplici, feed, task list e righe cliccabili."}),C.Separator=(...t)=>{const{props:e}=CMSwift.uiNormalizeArgs(t),s=l(["cms-separator",a(e.vertical,"vertical"),e.class]),o=CMSwift.omit(e,["vertical","size","slots"]);o.class=s;const i={borderColor:"var(--cms-border)",...e.style||{}},f=n(e.size),c=n(e.vertical);if(f!=null){const d=K(f);c?i.width=d:i.height=d}return o.style=i,_.hr(o)},(js=CMSwift.isDev)!=null&&js.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Separator={signature:"UI.Separator() | UI.Separator(props)",props:{vertical:"boolean",size:"string|number",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Unused (separator has no content)"},returns:"HTMLHRElement",description:"Separatore orizzontale o verticale."}),C.Banner=(...t)=>{var H;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=()=>Rt(n(e.type)||n(e.state)||""),f={state:i,dismissible:()=>!!n(e.dismissible)},c=ee([e.type,e.state],()=>i()),d=ee(e.variant,()=>{const y=String(n(e.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(y)?`cms-banner-${y}`:""}),h=ee([e.actionsPlacement,e.stack],()=>String(n(e.actionsPlacement)||"").toLowerCase()==="bottom"||n(e.stack)?"cms-banner-actions-bottom":""),b=ee(e.stack,()=>n(e.stack)?"cms-banner-stack":""),$={...e},F=CMSwift.omit($,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);F.class=l(["cms-clear-set","cms-banner","cms-singularity",c,d,h,b,$.class]),F.style={...$.style||{}};const D=y=>{if(y==null||y==="")return"";const Y=n(y);if(Y==null||Y==="")return"";const k=String(Y);return vn(k)?`var(--cms-${k})`:k};(e.accent!=null||S(e.accent))&&(F.style["--cms-banner-accent"]=()=>D(e.accent),F.style["--cms-banner-border"]=()=>{const y=D(e.accent);return y?`color-mix(in srgb, ${y} 38%, var(--cms-border-color))`:""},F.style["--cms-banner-bg"]=()=>{const y=D(e.accent);return y?`color-mix(in srgb, ${y} 14%, var(--cms-panel))`:""},F.style["--cms-banner-color"]=()=>{const y=D(e.accent);return y?`color-mix(in srgb, ${y} 78%, white)`:""});const R={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},be=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?C.Icon({name:e.icon,size:e.iconSize||e.size||"md"}):CMSwift.ui.slot(e.icon,{as:"icon"});const y=i(),Y=y?R[y]:null;return Y?C.Icon({name:Y,size:e.iconSize||e.size||"md"}):null})(),ce=E(o,"title",f,e.title),ie=E(o,"message",f,e.message!=null?e.message:s),O=E(o,"description",f,(H=e.description)!=null?H:e.subtitle),te=E(o,"meta",f,e.meta),X=E(o,"default",f,e.body!=null?[e.body,...s||[]]:e.message!=null?s:null),U=E(o,"icon",f,be),Ae=E(o,"aside",f,e.aside),ye=E(o,"actions",f,e.actions),pe=E(o,"dismiss",f,e.dismiss),we=String(n(e.actionsPlacement)||"").toLowerCase()==="bottom"||!!n(e.stack),he=!!n(e.dismissible)||!!e.onDismiss;let me=null;const Q=he?C.Btn({class:"cms-banner-close",outline:!0,size:e.size||"sm","aria-label":e.closeLabel||"Chiudi banner",onClick:y=>{var Y;(Y=e.onDismiss)==null||Y.call(e,y),!y.defaultPrevented&&(me==null||me.remove())}},C.Icon({name:"close",size:e.size||"sm"})):null,L=[...Ae,...we?[]:ye,...pe.length?pe:Q?[Q]:[]];me=_.div(F,U.length?_.div({class:"cms-banner-icon"},...U):null,_.div({class:"cms-banner-body"},_.div({class:"cms-banner-copy"},ce.length?_.div({class:"cms-banner-title"},...ce):null,ie.length?_.div({class:"cms-banner-message"},...ie):null,O.length?_.div({class:"cms-banner-description"},...O):null,X.length?_.div({class:"cms-banner-extra"},...X):null,te.length?_.div({class:"cms-banner-meta"},...te):null),we&&ye.length?_.div({class:"cms-banner-actions"},...ye):null),L.length?_.div({class:"cms-banner-side"},...L):null);const z=F.role||(()=>{const y=i();return y==="danger"||y==="warning"?"alert":"status"})();return me.setAttribute("role",z),wt(me,e),me},(Vs=CMSwift.isDev)!=null&&Vs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Banner={signature:"UI.Banner(...children) | UI.Banner(props, ...children)",props:{title:"String|Node|Function|Array",message:"String|Node|Function|Array",description:"String|Node|Function|Array",meta:"String|Node|Function|Array",icon:"String|Node|Function|Array|false",actions:"Node|Function|Array",aside:"Node|Function|Array",body:"Node|Function|Array",dismissible:"boolean",dismiss:"Node|Function|Array",onDismiss:"function",closeLabel:"string",type:"success|warning|danger|error|info|primary|secondary|light|dark",state:"success|warning|danger|error|info|primary|secondary|light|dark",accent:"string",variant:"soft|solid|outline|ghost",actionsPlacement:"end|bottom",dense:"boolean",stack:"boolean",slots:"{ icon?, title?, message?, description?, meta?, actions?, aside?, dismiss?, default? }",class:"string",style:"object"},slots:{icon:"Leading visual/icon content",title:"Banner title content",message:"Primary message content",description:"Secondary/supporting text",meta:"Meta information content",actions:"Actions area content",aside:"Right side support content",dismiss:"Custom dismiss control",default:"Extra banner body content"},returns:"HTMLDivElement",description:"Banner strutturato con tono, azioni, dismiss e slots composabili."}),C.Alert=(...t)=>{var U;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=()=>Rt(n(e.type)||n(e.state)||n(e.color)||"warning"),f=ee([e.type,e.state,e.color],()=>{const Ae=i();return Ae?`cms-state-${Ae}`:""}),c={...e},d=CMSwift.omit(c,["actions","aside","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","state","subtitle","title","type","variant"]);d.class=l(["cms-clear-set","cms-alert","cms-singularity",f,a(e.dismissible,"is-dismissible"),c.class]),d.style={...c.style||{}};const h={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},b=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?C.Icon({name:e.icon,size:e.iconSize||"sm"}):CMSwift.ui.slot(e.icon,{as:"icon"});const Ae=h[i()]||h.warning;return C.Icon({name:Ae,size:e.iconSize||"sm"})})(),$=E(o,"title",{},e.title),F=E(o,"message",{},e.message!=null?e.message:s),D=E(o,"description",{},(U=e.description)!=null?U:e.subtitle),R=E(o,"meta",{},e.meta),be=E(o,"actions",{},e.actions),ce=E(o,"aside",{},e.aside),ie=E(o,"icon",{},b),O=E(o,"dismiss",{},e.dismiss);let te=null;const X=e.dismissible||e.onDismiss?C.Btn({class:"cms-alert-close",outline:!0,size:"sm","aria-label":e.closeLabel||"Chiudi alert",onClick:Ae=>{var ye;(ye=e.onDismiss)==null||ye.call(e,Ae),!Ae.defaultPrevented&&(te==null||te.remove())}},C.Icon({name:"close",size:"sm"})):null;return te=_.div(d,ie.length?_.div({class:"cms-alert-icon"},...ie):null,_.div({class:"cms-alert-body"},$.length?_.div({class:"cms-alert-title"},...$):null,F.length?_.div({class:"cms-alert-message"},...F):null,D.length?_.div({class:"cms-alert-description"},...D):null,R.length?_.div({class:"cms-alert-meta"},...R):null,be.length?_.div({class:"cms-alert-actions"},...be):null),ce.length||O.length||X?_.div({class:"cms-alert-side"},...ce,...O.length?O:X?[X]:[]):null),te.setAttribute("role",i()==="danger"||i()==="warning"?"alert":"status"),wt(te,e),te},(Bs=CMSwift.isDev)!=null&&Bs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Alert={signature:"UI.Alert(...children) | UI.Alert(props, ...children)",props:{title:"String|Node|Function|Array",message:"String|Node|Function|Array",description:"String|Node|Function|Array",meta:"Node|Function|Array",icon:"String|Node|Function|Array|false",actions:"Node|Function|Array",aside:"Node|Function|Array",dismissible:"boolean",dismiss:"Node|Function|Array",onDismiss:"function",closeLabel:"string",type:"success|warning|danger|error|info|primary|secondary|light|dark",state:"success|warning|danger|error|info|primary|secondary|light|dark",slots:"{ icon?, title?, message?, description?, meta?, actions?, aside?, dismiss?, default? }",class:"string",style:"object"},slots:{icon:"Leading alert icon content",title:"Alert title content",message:"Primary alert copy",description:"Secondary/supporting text",meta:"Inline meta content",actions:"Alert actions cluster",aside:"Right side support content",dismiss:"Custom dismiss control",default:"Fallback alert message content"},returns:"HTMLDivElement",description:"Alert compatto per warning inline, policy note e feedback persistente dentro page o card."}),C.EmptyState=(...t)=>{var X;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=()=>Rt(n(e.state)||n(e.color)||""),f=ee([e.state,e.color],()=>{const U=i();return U?`cms-state-${U}`:""}),c={...e},d=CMSwift.omit(c,["actions","description","eyebrow","icon","iconSize","illustration","media","message","meta","slots","state","title"]);d.class=l(["cms-clear-set","cms-empty-state","cms-singularity",f,a(e.compact,"compact"),a(e.inline,"inline"),c.class]),d.style={...c.style||{}};const h=e.icon===!1?null:e.icon!=null?typeof e.icon=="string"?C.Icon({name:e.icon,size:e.iconSize||"xl"}):CMSwift.ui.slot(e.icon,{as:"icon"}):C.Icon({name:"inbox",size:e.iconSize||"xl"}),b=E(o,"illustration",{},(X=e.illustration)!=null?X:e.media),$=E(o,"icon",{},h),F=E(o,"eyebrow",{},e.eyebrow),D=E(o,"title",{},e.title),R=E(o,"message",{},e.message!=null?e.message:s),be=E(o,"description",{},e.description),ce=E(o,"meta",{},e.meta),ie=E(o,"actions",{},e.actions),O=E(o,"default",{},e.message!=null?s:null),te=_.section(d,b.length?_.div({class:"cms-empty-state-illustration"},...b):null,$.length?_.div({class:"cms-empty-state-icon"},...$):null,F.length?_.div({class:"cms-empty-state-eyebrow"},...F):null,D.length?_.div({class:"cms-empty-state-title"},...D):null,R.length?_.div({class:"cms-empty-state-message"},...R):null,be.length?_.div({class:"cms-empty-state-description"},...be):null,ce.length?_.div({class:"cms-empty-state-meta"},...ce):null,O.length?_.div({class:"cms-empty-state-extra"},...O):null,ie.length?_.div({class:"cms-empty-state-actions"},...ie):null);return wt(te,e),te},($s=CMSwift.isDev)!=null&&$s.call(CMSwift)&&(C.meta=C.meta||{},C.meta.EmptyState={signature:"UI.EmptyState(...children) | UI.EmptyState(props, ...children)",props:{eyebrow:"String|Node|Function|Array",title:"String|Node|Function|Array",message:"String|Node|Function|Array",description:"String|Node|Function|Array",meta:"Node|Function|Array",icon:"String|Node|Function|Array|false",illustration:"Node|Function|Array",media:"Alias of illustration",actions:"Node|Function|Array",compact:"boolean",inline:"boolean",state:"primary|secondary|success|warning|danger|info|light|dark",slots:"{ illustration?, icon?, eyebrow?, title?, message?, description?, meta?, actions?, default? }",class:"string",style:"object"},slots:{illustration:"Top visual / illustration content",icon:"Leading empty-state icon",eyebrow:"Small kicker content",title:"Primary empty-state heading",message:"Primary message content",description:"Secondary supporting text",meta:"Meta badges or summary content",actions:"Actions cluster",default:"Extra empty-state body content"},returns:"HTMLElement",description:"Surface per zero-results, onboarding vuoti e pannelli senza dati con CTA di recupero."});let ct="cmswift:drawer-open";const xt=new Set,Pt=new Map,ut=(t=ct)=>{const e=CMSwift==null?void 0:CMSwift.store;if(e!=null&&e.get){const s=e.get(t,void 0);if(typeof s=="boolean")return s}try{return localStorage.getItem(t)==="1"}catch(s){return!1}},gt=(t,e=ct)=>{const s=CMSwift==null?void 0:CMSwift.store;if(s!=null&&s.set){s.set(e,!!t);return}try{localStorage.setItem(e,t?"1":"0")}catch(o){}};let mt=ut();const at=(t,e=ct)=>{mt=!!t;const s=Pt.get(e);if(s&&s.size)s.forEach(o=>o==null?void 0:o.classList.toggle("open",mt));else{const o=document.querySelector(".cms-drawer");o&&o.classList.toggle("open",mt)}return xt.forEach(o=>{if(!o)return;if(typeof o.update=="function"){o.update(mt);return}const{el:i,openIcon:f,closeIcon:c}=o;i&&(i.textContent=mt?f:c)}),gt(mt,e),mt};C.Tooltip=(...t)=>{var z,H;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{};let i=null,f=null,c=null,d=null;const h=y=>Object.prototype.hasOwnProperty.call(e,y),b=h("target")||h("anchorEl")||h("triggerEl"),$=e.target||e.anchorEl||e.triggerEl||(s&&s.length?s[0]:null),F=(y,Y)=>{const k=n(y);if(k==null||k==="")return Y;const v=Number(k);return Number.isFinite(v)?v:Y},D=()=>{clearTimeout(f),clearTimeout(c),f=null,c=null},R=()=>F(e.delay,350),be=()=>F(e.hideDelay,n(e.interactive)?120:0),ce=()=>{if(D(),!i)return;const y=i;i=null,nt(y,()=>CMSwift.overlay.close(y.id))},O=(y=>{if(y==null||y===!0)return new Set(["hover","focus"]);if(y===!1)return new Set(["manual"]);const Y=Array.isArray(y)?y:String(y).split(/[\s,|/]+/),k=new Set;return Y.forEach(v=>{const M=String(v||"").trim().toLowerCase();M&&(M==="mouseenter"||M==="mouseover"?k.add("hover"):M==="blur"||M==="focusin"?k.add("focus"):M==="tap"?k.add("click"):k.add(M))}),k.size?k:new Set(["manual"])})((H=(z=e.trigger)!=null?z:e.triggers)!=null?H:h("open")?"manual":null),te=O.has("hover"),X=O.has("focus"),U=O.has("click"),Ae=O.has("manual")||!te&&!X&&!U,ye=()=>{var ne,re,ke,I,u,N;const y={anchorEl:d||$||null,close:()=>ce(),hide:()=>ce(),isOpen:()=>!!i},Y=e.icon?typeof e.icon=="string"?C.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):CMSwift.ui.slot(e.icon,{as:"icon"}):null,k=E(o,"title",y,(ne=e.title)!=null?ne:e.heading),v=E(o,"icon",y,Y),M=E(o,"footer",y,(re=e.footer)!=null?re:e.actions);let x=(N=(u=(I=(ke=e.content)!=null?ke:e.text)!=null?I:e.body)!=null?u:e.description)!=null?N:e.label;x==null&&(b?x=s:$&&s&&s.length>1?x=s.slice(1):$||(x=s));let g=E(o,"content",y,x);g.length||(g=E(o,"default",y,x));const p=g.length?_.div({class:"cms-tooltip-body"},...g):null,T=v.length||k.length?_.div({class:"cms-tooltip-head"},v.length?_.div({class:"cms-tooltip-icon"},...v):null,_.div({class:"cms-tooltip-head-main"},k.length?_.div({class:"cms-tooltip-title"},...k):null,p)):p,V=M.length?_.div({class:"cms-tooltip-footer"},...M):null;return _.div({class:"cms-tooltip-content"},...[T,V].filter(Boolean))},pe=y=>{var g,p,T,V,ne,re;const Y=y||d;if(!Y||n(e.disabled))return null;if(i&&i._anchorEl===Y)return i;i&&ce();const k=(g=e.closeOnOutside)!=null?g:U||n(e.interactive),v=(p=e.closeOnEsc)!=null?p:U||n(e.interactive);let M=null;if(i=CMSwift.overlay.open(()=>ye(),{type:"tooltip",anchorEl:Y,placement:e.placement||"top",offsetX:(T=e.offsetX)!=null?T:0,offsetY:(ne=(V=e.offsetY)!=null?V:e.offset)!=null?ne:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:k,closeOnBackdrop:!1,closeOnEsc:v,autoFocus:!1,className:ue(["cms-tooltip",a(e.interactive,"interactive"),e.class,e.panelClass]),onClose:()=>{var ke,I;(ke=M==null?void 0:M._tooltipCleanup)==null||ke.call(M),i===M&&(i=null),(I=e.onClose)==null||I.call(e)}}),!(i!=null&&i.panel))return i;const x=i;if(M=x,x._anchorEl=Y,x.panel.dataset.placement=String(n(e.placement||"top")),e.maxWidth!=null&&(x.panel.style.maxWidth=K(n(e.maxWidth))),e.minWidth!=null&&(x.panel.style.minWidth=K(n(e.minWidth))),e.width!=null&&(x.panel.style.width=K(n(e.width))),e.style&&Object.assign(x.panel.style,e.style),wt(x.panel,e),n(e.interactive)){const ke=()=>{clearTimeout(c),c=null},I=()=>he(),u=N=>{const w=N.target;w&&w.closest&&w.closest("[data-tooltip-close]")&&ce()};x.panel.addEventListener("mouseenter",ke),x.panel.addEventListener("mouseleave",I),x.panel.addEventListener("focusin",ke),x.panel.addEventListener("focusout",I),x.panel.addEventListener("click",u),x._tooltipCleanup=()=>{var N,w,le,Ne,se;(N=x.panel)==null||N.removeEventListener("mouseenter",ke),(w=x.panel)==null||w.removeEventListener("mouseleave",I),(le=x.panel)==null||le.removeEventListener("focusin",ke),(Ne=x.panel)==null||Ne.removeEventListener("focusout",I),(se=x.panel)==null||se.removeEventListener("click",u)}}return Ke(x),(re=e.onOpen)==null||re.call(e,x),x},we=y=>{clearTimeout(c),c=null,clearTimeout(f),f=setTimeout(()=>pe(y),R())},he=(y=!1)=>{if(clearTimeout(f),f=null,!!i){if(clearTimeout(c),y){ce();return}c=setTimeout(()=>ce(),be())}},me=y=>{i?he(!0):pe(y)},Q=()=>!!i,L=y=>{if(!y)return()=>{};d=y;const Y=[],k=()=>{D(),Y.forEach(v=>v())};if(h("open"))return S(e.open)?CMSwift.reactive.effect(()=>{d&&(n(e.open)?pe(d):he(!0))},"UI.Tooltip:open"):e.open===!0?pe(y):e.open===!1&&he(!0),k;if(Ae||n(e.disabled))return k;if(te){const v=()=>we(y),M=()=>he();y.addEventListener("mouseenter",v),y.addEventListener("mouseleave",M),Y.push(()=>{y.removeEventListener("mouseenter",v),y.removeEventListener("mouseleave",M)})}if(X){const v=()=>we(y),M=()=>he();y.addEventListener("focus",v),y.addEventListener("blur",M),Y.push(()=>{y.removeEventListener("focus",v),y.removeEventListener("blur",M)})}if(U){const v=M=>{var x;(x=e.onTriggerClick)==null||x.call(e,M),!M.defaultPrevented&&me(y)};y.addEventListener("click",v),Y.push(()=>y.removeEventListener("click",v))}return k};if($){const y=l(["cms-tooltip-wrap",e.wrapClass,e.targetClass]),Y=CMSwift.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"]);Y.class=y,Y.style={display:"inline-flex",alignItems:"center",...e.wrapStyle||e.targetStyle||{}};const k=CMSwift.ui.renderSlot(o,"target",{open:()=>pe(d),show:()=>we(d),hide:()=>he(!0),toggle:()=>me(d),isOpen:Q},$),v=_.span(Y,...E(null,"default",{},k));return L(v),v._tooltip={bind:L,open:pe,show:we,hide:he,close:ce,toggle:me,isOpen:Q},v}return{bind:L,open:pe,show:we,hide:he,close:ce,toggle:me,isOpen:Q}},(Ws=CMSwift.isDev)!=null&&Ws.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Tooltip={signature:"UI.Tooltip(props, target?) | UI.Tooltip(target, content)",props:{title:"String|Node|Function|Array",content:"String|Node|Function|Array",text:"String|Node|Function|Array",body:"String|Node|Function|Array",footer:"String|Node|Function|Array",icon:"String|Node|Function|Array",target:"Node|Function|Array",trigger:'"hover focus" | "click" | "manual" | Array',interactive:"boolean",disabled:"boolean",open:"boolean | reactive",placement:"string",delay:"number",hideDelay:"number",offset:"number (legacy)",offsetX:"number",offsetY:"number",closeOnOutside:"boolean",closeOnEsc:"boolean",maxWidth:"string|number",minWidth:"string|number",width:"string|number",slots:"{ target?, icon?, title?, content?, footer?, default? }",class:"string",panelClass:"string",wrapClass:"string",style:"object",targetStyle:"object"},slots:{target:"Tooltip trigger content ({ open, show, hide, toggle, isOpen })",icon:"Tooltip icon content",title:"Tooltip title content",content:"Tooltip body content ({ close, hide, isOpen, anchorEl })",footer:"Tooltip footer content ({ close, hide, isOpen, anchorEl })",default:"Fallback tooltip body content"},events:{onOpen:"(entry) => void",onClose:"() => void",onTriggerClick:"(event) => void"},returns:"Object { bind(), open(), show(), hide(), close(), toggle(), isOpen() } | HTMLSpanElement",description:"Tooltip ancorato con trigger hover/focus/click, contenuto ricco e API imperativa."});const Ee=(t,e,s={})=>{var z;const{props:o,children:i}=CMSwift.uiNormalizeArgs(e),f=o.slots||{},c=t==="radio",d=s.appearance==="toggle",h=!c,b=o.id||`cms-${t}-`+Math.random().toString(36).slice(2),$=de(o.model,s.modelName||(c?"UI.Radio:model":"UI.Checkbox:model")),F=CMSwift.omit(o,["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"]);F.type=t,F.id=b,c&&o.name!=null&&(F.name=o.name),F.class=l([`cms-${t}`,"cms-choice-input",o.inputClass]);const D=_.input(F),R=E(f,"label",{},o.label),be=R.length?R:E(f,"default",{},i),ce=CMSwift.omit(o,["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"]);ce.class=l(["cms-clear-set","cms-singularity-check","cms-choice-wrap",`cms-${t}-wrap`,a(d,"cms-toggle-wrap"),a(d&&c,"cms-toggle-radio-wrap"),a(d&&!c,"cms-toggle-checkbox-wrap"),a(o.dense,"dense"),o.class]),ce.style={...o.style||{}};const ie=n(o.size);ie!=null&&!(typeof ie=="string"&&((z=CMSwift.uiSizes)!=null&&z.includes(ie)))&&(ce.style["--cms-choice-size"]=K(ie));const O=_.span({class:l(["cms-choice-mark",c?"cms-choice-radio-mark":"cms-choice-checkbox-mark",a(d,"cms-toggle-mark")])}),te=d?_.span({class:"cms-toggle-thumb"}):O;d&&O.appendChild(te);const X=be.length?_.span({class:"cms-choice-label"},...be):null,U=_.label(ce,D,O,X);wt(U,o);const Ae=o.iconSize?o.iconSize:o.size,ye=d?null:c?"radio_button_checked":"check",pe=d?null:c?"radio_button_unchecked":null,we=d||c?null:"indeterminate_check_box",he=H=>{if(c)return D.checked=H==o.value,D.checked;const y=H==null?null:!!H;return D.checked=y===!0,D.indeterminate=h&&y==null,y},me=()=>!c&&h&&D.indeterminate?null:!!D.checked,Q=H=>H===!0?o.checkedIcon!=null?o.checkedIcon:o.icon!=null?o.icon:ye:H===!1?o.uncheckedIcon!=null?o.uncheckedIcon:pe:o.indeterminateIcon!=null?o.indeterminateIcon:o.standbyIcon!=null?o.standbyIcon:o.iconStandby!=null?o.iconStandby:we,L=()=>{const H=me(),y=H===!0;for(;te.firstChild;)te.removeChild(te.firstChild);U.classList.toggle("is-checked",y),U.classList.toggle("is-indeterminate",H==null),U.classList.toggle("is-disabled",!!D.disabled),y&&(o.checkedIcon||o.icon)?U.classList.toggle("toggle-default",!1):y&&!o.checkedIcon||H==null&&!o.standbyIcon?U.classList.toggle("toggle-default",!0):H==null&&o.standbyIcon?U.classList.toggle("toggle-default",!1):D.disabled===!1&&!o.uncheckedIcon?U.classList.toggle("toggle-default",!0):U.classList.toggle("toggle-default",!1),d&&(H==null?te.style.transform="translateX(calc((var(--cms-toggle-width) - var(--cms-toggle-thumb-size) - 1px) / 2))":te.style.removeProperty("transform"));const Y={checked:y,state:H,indeterminate:H==null,value:o.value,id:b,type:t};let k=null;if(H===!0?(k=CMSwift.ui.renderSlot(f,"checkedIcon",Y,null),k==null&&(k=CMSwift.ui.renderSlot(f,"iconOn",Y,null))):H===!1?(k=CMSwift.ui.renderSlot(f,"uncheckedIcon",Y,null),k==null&&(k=CMSwift.ui.renderSlot(f,"iconOff",Y,null))):(k=CMSwift.ui.renderSlot(f,"indeterminateIcon",Y,null),k==null&&(k=CMSwift.ui.renderSlot(f,"standbyIcon",Y,null)),k==null&&(k=CMSwift.ui.renderSlot(f,"iconStandby",Y,null))),k==null&&(k=CMSwift.ui.renderSlot(f,"icon",Y,null)),k==null){const v=Q(H);typeof v=="string"?k=C.Icon({name:v,size:Ae,...d?{textColor:o.color,outline:!0}:{}}):v!=null&&(k=CMSwift.ui.slot(v,{checked:y,state:H,indeterminate:H==null,as:H===!0?"checkedIcon":H===!1?"uncheckedIcon":"indeterminateIcon"}))}E(null,"default",{},k).forEach(v=>te.appendChild(v))};return $?(he($.get()),$.watch(H=>{he(H),L()},c?"UI.Radio:watch":"UI.Checkbox:watch"),D.addEventListener("change",H=>{var y,Y;if(c)D.checked&&($.set(o.value),(y=o.onChange)==null||y.call(o,o.value,H));else{const k=me();$.set(k),(Y=o.onChange)==null||Y.call(o,k,H)}L()})):(he(c?o.checked===!0?o.value:void 0:o.checked),D.addEventListener("change",H=>{var y,Y;c?(y=o.onChange)==null||y.call(o,o.value,H):(Y=o.onChange)==null||Y.call(o,me(),H),L()})),o.onInput&&D.addEventListener("input",H=>{var y,Y;c?(y=o.onInput)==null||y.call(o,o.value,H):(Y=o.onInput)==null||Y.call(o,me(),H)}),L(),U};C.Checkbox=(...t)=>Ee("checkbox",t),(Us=CMSwift.isDev)!=null&&Us.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Checkbox={signature:"UI.Checkbox(...children) | UI.Checkbox(props, ...children)",props:{label:"String|Node|Function|Array",checked:"boolean|null",model:"[get,set] signal",icon:"String|Node|Function|Array",iconOn:"Alias di icon/checkedIcon",iconOff:"Alias di uncheckedIcon",iconStandby:"Icona per stato null/indeterminate",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",color:"string",size:"string|number",outline:"boolean",dense:"boolean",slots:"{ label?, default? }",class:"string",style:"object"},slots:{label:"Checkbox label",icon:"Base icon content",iconStandby:"Slot for null/indeterminate icon",checkedIcon:"Icon when checked",uncheckedIcon:"Icon when unchecked",default:"Fallback label content"},events:{onChange:"(checked|null, event)",onInput:"(checked|null, event)"},returns:"HTMLLabelElement",description:"Checkbox con label e supporto model."}),C.Radio=(...t)=>Ee("radio",t),(Gs=CMSwift.isDev)!=null&&Gs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Radio={signature:"UI.Radio(...children) | UI.Radio(props, ...children)",props:{label:"String|Node|Function|Array",value:"any",name:"string",checked:"boolean|null",model:"[get,set] signal",icon:"String|Node|Function|Array",iconOn:"Alias di icon/checkedIcon",iconOff:"Alias di uncheckedIcon",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",color:"string",size:"string|number",outline:"boolean",dense:"boolean",slots:"{ label?, default? }",class:"string",style:"object"},slots:{label:"Radio label",icon:"Base icon content",iconOn:"Alias slot for checked icon",iconOff:"Alias slot for unchecked icon",checkedIcon:"Icon when checked",uncheckedIcon:"Icon when unchecked",default:"Fallback label content"},events:{onChange:"(value, event)",onInput:"(value, event)"},returns:"HTMLLabelElement",description:"Radio con label e supporto model."}),C.Toggle=(...t)=>{var o,i,f;const{props:e}=CMSwift.uiNormalizeArgs(t),s=String((f=(i=(o=e.behavior)!=null?o:e.mode)!=null?i:e.type)!=null?f:"checkbox").toLowerCase()==="radio"?"radio":"checkbox";return Ee(s,t,{appearance:"toggle",modelName:"UI.Toggle:model"})},(Ks=CMSwift.isDev)!=null&&Ks.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Toggle={signature:"UI.Toggle(...children) | UI.Toggle(props, ...children)",props:{label:"String|Node|Function|Array",behavior:'"checkbox"|"radio"',mode:"Alias di behavior",value:"any",name:"string",checked:"boolean",model:"[get,set] signal",icon:"String|Node|Function|Array",iconOn:"Alias di icon/checkedIcon",iconOff:"Alias di uncheckedIcon",iconStandby:"Icona per stato null/indeterminate",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",color:"string",size:"string|number",dense:"boolean",slots:"{ label?, default? }",class:"string",style:"object"},slots:{label:"Toggle label",icon:"Base icon content",iconOn:"Alias slot for checked icon",iconOff:"Alias slot for unchecked icon",iconStandby:"Slot for null/indeterminate icon",checkedIcon:"Icon when checked",uncheckedIcon:"Icon when unchecked",default:"Fallback label content"},events:{onChange:"(checked|value, event)",onInput:"(checked|value, event)"},returns:"HTMLLabelElement",description:"Toggle switch con supporto model e comportamento checkbox/radio."}),C.Slider=(...t)=>{var N,w,le,Ne;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=e.model||(Zt(e.value)||r(e.value)?e.value:null),f=de(i,"UI.Slider:model"),c=CMSwift.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"]);c.type="range",c.class=l(["cms-slider-input",e.inputClass]);const d=_.input(c),h=_.label({class:l(["cms-clear-set","cms-singularity-check","cms-slider-wrap",a(e.dense,"dense"),e.class]),style:e.style});wt(h,e);const b=_.div({class:"cms-slider-header"}),$=_.span({class:"cms-slider-label"}),F=_.span({class:"cms-slider-value"});b.append($,F);const D=_.div({class:"cms-slider-body"}),R=_.span({class:"cms-slider-icon cms-slider-icon-left"}),be=_.span({class:"cms-slider-edge-label cms-slider-edge-label-left"}),ce=_.div({class:"cms-slider-main"}),ie=_.div({class:"cms-slider-box"}),O=_.span({class:"cms-slider-rail"}),te=_.span({class:"cms-slider-selection"}),X=_.span({class:"cms-slider-thumb"}),U=_.span({class:"cms-slider-thumb-icon"}),Ae=_.span({class:"cms-slider-thumb-label"});X.append(Ae,U);const ye=_.div({class:"cms-slider-markers"}),pe=_.span({class:"cms-slider-edge-label cms-slider-edge-label-right"}),we=_.span({class:"cms-slider-icon cms-slider-icon-right"});ie.append(O,te,X,d),ce.append(ie,ye),D.append(R,be,ce,pe,we),h.append(b,D);const he=se=>{for(;se.firstChild;)se.removeChild(se.firstChild)},me=(se,fe,P="")=>{he(se),(fe||[]).forEach(ve=>se.appendChild(ve)),se.style.display=se.childNodes.length?P:"none"},Q=se=>Zt(se)||r(se)?n(se):se,L=(se,fe={})=>Fe(Q(se),fe),z=(se,fe,P={})=>{var xe,Oe;const ve=Q(se);return ve==null?[]:typeof ve=="string"?[C.Icon({name:ve,size:(Oe=(xe=e.iconSize)!=null?xe:e.size)!=null?Oe:16})]:L(ve,{...P,as:fe})},H=(se,fe)=>{const P=Number(se);return Number.isFinite(P)?P:fe},y=()=>H(n(e.min),0),Y=()=>{const se=y(),fe=H(n(e.max),100);return fe<se?se:fe},k=()=>{const se=n(e.step);if(se==="any")return"any";const fe=H(se,1);return fe>0?fe:1},v=se=>{if(se==="any")return 0;const fe=String(se);if(fe.includes("e-"))return Number(fe.split("e-")[1]||0);const P=fe.indexOf(".");return P===-1?0:fe.length-P-1},M=se=>{const fe=y(),P=Y(),ve=k();let xe=H(se,fe);if(ve!=="any"){xe=fe+Math.round((xe-fe)/ve)*ve;const Oe=v(ve);Oe>0&&(xe=Number(xe.toFixed(Oe)))}return Math.min(P,Math.max(fe,xe))},x=se=>{const fe=y(),ve=Y()-fe;if(!ve)return 0;const xe=(M(se)-fe)/ve,Oe=n(e.reverse)?1-xe:xe;return Math.max(0,Math.min(1,Oe))},[g,p]=CMSwift.reactive.signal(M(f?f.get():(w=(N=n(e.value))!=null?N:n(e.min))!=null?w:0)),T=(se,fe={})=>{const P=M(se);return g()!==P&&p(P),String(d.value)!==String(P)&&(d.value=String(P)),f&&fe.fromModel!==!0&&f.set(P),P},V=()=>{var Oe;const se=n(e.markers),fe=!!n((Oe=e.markerLabels)!=null?Oe:e.labelMarks);if(!se)return[];const P=y(),ve=Y(),xe=(ze,Ce)=>{var J,B,G,q,Le,Z,Ve,je;if(ze==null)return null;if(typeof ze=="object"&&!Array.isArray(ze)){const $e=M((G=(B=(J=ze.value)!=null?J:ze.position)!=null?B:ze.at)!=null?G:P);return{key:(q=ze.key)!=null?q:`marker-${Ce}-${$e}`,value:$e,label:(Le=ze.label)!=null?Le:fe?String($e):null,icon:(Z=ze.icon)!=null?Z:null,className:(je=(Ve=ze.class)!=null?Ve:ze.className)!=null?je:""}}const Re=M(ze);return{key:`marker-${Ce}-${Re}`,value:Re,label:fe?String(ze):null,icon:null,className:""}};if(Array.isArray(se))return se.map((ze,Ce)=>xe(ze,Ce)).filter(Boolean);if(typeof se=="number"&&se>1){const ze=Math.floor(se),Ce=ze>1?(ve-P)/(ze-1):0;return Array.from({length:ze},(Re,J)=>xe(P+Ce*J,J)).filter(Boolean)}if(se===!0){const ze=k();if(ze==="any")return[xe(P,0),xe(ve,1)].filter(Boolean);const Ce=Math.floor((ve-P)/ze)+1;return Ce>24?[xe(P,0),xe((P+ve)/2,1),xe(ve,2)].filter(Boolean):Array.from({length:Ce},(Re,J)=>xe(P+ze*J,J)).filter(Boolean)}return typeof se=="object"?Object.keys(se).map((ze,Ce)=>xe({value:Number(ze),label:se[ze]},Ce)).filter(Boolean):[]},ne=()=>{he(ye);const se=V();ye.style.display=se.length?"block":"none",ye.style.minHeight=se.some(fe=>fe.label!=null&&fe.label!=="")?"30px":"10px",se.forEach(fe=>{const P=x(fe.value),ve=n(e.reverse)?g()<=fe.value:g()>=fe.value,xe=_.button({type:"button",class:l(["cms-slider-marker",fe.className,a(()=>ve,"active")]),style:{left:`${P*100}%`,color:ve?n(e.color)||"var(--cms-primary)":"var(--cms-muted)",cursor:n(e.disabled)||n(e.readonly)?"default":"pointer"},disabled:!!n(e.disabled)||!!n(e.readonly),onClick:()=>{var G,q;if(n(e.disabled)||n(e.readonly))return;const B=T(fe.value);(G=e.onInput)==null||G.call(e,B),(q=e.onChange)==null||q.call(e,B)}}),Oe={marker:fe,active:ve,value:fe.value,current:g(),input:d};let ze=CMSwift.ui.renderSlot(o,"marker",Oe,null);ze==null&&fe.icon!=null&&(ze=typeof fe.icon=="string"?C.Icon({name:fe.icon,size:12}):CMSwift.ui.slot(fe.icon,{...Oe,as:"marker"}));const Ce=_.span({class:"cms-slider-marker-tick",style:{background:ve?n(e.color)||"var(--cms-primary)":"var(--cms-border-color)"}}),Re=ze==null?[Ce]:E(null,"default",Oe,ze),J=fe.label==null?E(o,"markerLabel",Oe,null):E(o,"markerLabel",Oe,fe.label);Re.forEach(B=>xe.appendChild(B)),J.length&&xe.appendChild(_.span({class:"cms-slider-marker-label"},...J)),ye.appendChild(xe)})},re=()=>{var Oe;const se={value:g(),input:d,props:e};let fe=E(o,"label",se,Q(e.label));fe.length||(fe=E(o,"default",se,s)),me($,fe,"inline-flex");const P=n(e.showValue),ve=P===!1?null:(Oe=Q(e.labelValue))!=null?Oe:g(),xe=P||Q(e.labelValue)!=null?E(o,"value",se,ve):[];me(F,xe,"inline-flex"),b.style.display=$.childNodes.length||F.childNodes.length?"flex":"none"},ke=()=>{var Ce,Re,J,B;const se={value:g(),input:d,props:e},fe=E(o,"icon",se,null),P=fe.length?fe:z(e.icon,"icon",se);me(R,P,"inline-flex");const ve=E(o,"iconRight",se,null),xe=ve.length?ve:z(e.iconRight,"iconRight",se);me(we,xe,"inline-flex");const Oe=Q((Re=(Ce=e.startLabel)!=null?Ce:e.leftLabel)!=null?Re:e.minLabel),ze=Q((B=(J=e.endLabel)!=null?J:e.rightLabel)!=null?B:e.maxLabel);me(be,E(o,"startLabel",se,Oe),"inline-flex"),me(pe,E(o,"endLabel",se,ze),"inline-flex")},I=()=>{var Oe,ze,Ce,Re;const se={value:g(),input:d,props:e},fe=E(o,"thumbIcon",se,null),P=(ze=(Oe=e.thumbIcon)!=null?Oe:e.iconThumb)!=null?ze:e.pointIcon;me(U,fe.length?fe:z(P,"thumbIcon",se),"inline-flex");const ve=(Re=(Ce=Q(e.thumbLabel))!=null?Ce:Q(e.labelValue))!=null?Re:n(e.showValue)?String(g()):null,xe=E(o,"thumbLabel",se,ve);me(Ae,xe,"inline-flex")},u=()=>{const se=M(g()),fe=y(),P=Y(),ve=k(),Oe=`${x(se)*100}%`,ze=n(e.color)||n(e.selectionColor)||"var(--cms-primary)",Ce=n(e.trackColor)||"var(--cms-border-color)",Re=n(e.thumbColor)||ze,J=!!n(e.readonly),B=!!n(e.disabled);d.min=String(fe),d.max=String(P),d.step=ve==="any"?"any":String(ve),d.disabled=B,d.value=String(se),O.style.background=Ce,te.style.background=ze,te.style.width=Oe,X.style.left=Oe,X.style.borderColor=Re,X.style.color=Re,Ae.style.background=ze,h.classList.toggle("is-disabled",B),h.classList.toggle("is-readonly",J),h.classList.toggle("has-markers",ye.childNodes.length>0)};if(f?(T(f.get(),{fromModel:!0}),f.watch(se=>{T(se,{fromModel:!0})},"UI.Slider:watch")):S(e.value)?CMSwift.reactive.effect(()=>{T(n(e.value),{fromModel:!0})},"UI.Slider:value"):T((Ne=(le=e.value)!=null?le:e.min)!=null?Ne:0,{fromModel:!0}),d.addEventListener("input",se=>{var P;if(n(e.disabled)||n(e.readonly)){d.value=String(g());return}const fe=T(d.value);(P=e.onInput)==null||P.call(e,fe,se)}),d.addEventListener("change",se=>{var P;if(n(e.disabled)||n(e.readonly)){d.value=String(g());return}const fe=T(d.value);(P=e.onChange)==null||P.call(e,fe,se)}),CMSwift.reactive.effect(()=>{re(),ke(),I(),ne(),u()},"UI.Slider:render"),h._input=d,h._getValue=g,h._setValue=se=>T(se),e.withQItem||e.qitem||e.item===!0){const se=C.Item({class:l(["cms-slider-item",e.itemClass]),style:e.itemStyle},h);return se._input=d,se._slider=h,se._getValue=g,se._setValue=h._setValue,se}return h},(qs=CMSwift.isDev)!=null&&qs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Slider={signature:"UI.Slider(...children) | UI.Slider(props, ...children)",props:{min:"number",max:"number",step:'number|"any"',value:"number | rod | [get,set] signal",model:"rod | [get,set] signal",label:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",thumbIcon:"String|Node|Function|Array",iconThumb:"Alias di thumbIcon",pointIcon:"Alias di thumbIcon",thumbLabel:"String|Node|Function|Array",showValue:"boolean",labelValue:"String|Node|Function|Array",markers:"boolean|number|Array|Object",markerLabels:"boolean",labelMarks:"Alias di markerLabels",startLabel:"String|Node|Function|Array",endLabel:"String|Node|Function|Array",leftLabel:"Alias di startLabel",rightLabel:"Alias di endLabel",minLabel:"Alias di startLabel",maxLabel:"Alias di endLabel",withQItem:"boolean",qitem:"Alias di withQItem",item:"boolean",itemClass:"string",itemStyle:"object",selectionColor:"string",trackColor:"string",thumbColor:"string",readonly:"boolean",inputClass:"string",slots:"{ label?, default?, value?, icon?, iconRight?, thumbIcon?, thumbLabel?, marker?, markerLabel?, startLabel?, endLabel? }",class:"string",style:"object"},slots:{label:"Label content",default:"Fallback label content",value:"Header value content",icon:"Left icon content",iconRight:"Right icon content",thumbIcon:"Thumb icon content",thumbLabel:"Thumb label content",marker:"Marker content",markerLabel:"Marker label content",startLabel:"Label a sinistra/inizio track",endLabel:"Label a destra/fine track"},events:{onChange:"(value, event)",onInput:"(value, event)"},returns:"HTMLLabelElement | HTMLLIElement (with ._input = HTMLInputElement)",description:"Slider reattivo con label, icone, thumb custom, markers e supporto model/QItem."}),C.Rating=(...t)=>{var T;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=e.model||(Zt(e.value)||r(e.value)?e.value:null),f=de(i,"UI.Rating:model"),c=e.id||"cms-rating-"+Math.random().toString(36).slice(2),d=CMSwift.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"]);d.type="hidden",d.id=c,e.name!=null&&(d.name=e.name),d.class=l(["cms-rating-input","cms-choice-input",e.inputClass]);const h=_.input(d),b=CMSwift.omit(e,["model","value","max","id","name","type","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);b.class=l(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",a(e.dense,"dense"),e.class]),b.style={...e.style||{}};const $=n(e.size);$!=null&&!(typeof $=="string"&&((T=CMSwift.uiSizes)!=null&&T.includes($)))&&(b.style["--cms-rating-size"]=K($));const F=n(e.gap);F!=null&&(b.style["--cms-rating-gap"]=K(F));const D=_.span({class:"cms-rating-control",onMouseleave:V=>{var ne;z!=null&&(z=null,g(),(ne=e.onHover)==null||ne.call(e,me(),V))},onKeydown:V=>{if(!he())return;const ne=Ae()?.5:1,re=me();let ke=re;switch(V.key){case"ArrowRight":case"ArrowUp":ke=re+ne;break;case"ArrowLeft":case"ArrowDown":ke=re-ne;break;case"Home":ke=n(e.clearable)?0:ne;break;case"End":ke=U();break;case"Delete":case"Backspace":case"0":if(!n(e.clearable))return;ke=0;break;case" ":case"Enter":ke=re||(n(e.clearable)?ne:Math.max(ne,1));break;default:return}V.preventDefault(),p(ke,V,{emit:!0})}}),R=_.span({class:"cms-choice-label cms-rating-label"}),be=_.label(b,h,D,R);wt(be,e);const ce=V=>{for(;V.firstChild;)V.removeChild(V.firstChild)},ie=(V,ne,re="")=>{ce(V),(ne||[]).forEach(ke=>V.appendChild(ke)),V.style.display=V.childNodes.length?re:"none"},O=V=>Zt(V)||r(V)?n(V):V,te=(V,ne={})=>Fe(O(V),ne),X=(V,ne,re={})=>{var I,u;const ke=O(V);return ke==null?[]:typeof ke=="string"?[C.Icon({name:ke,color:e.color,size:(u=(I=e.iconSize)!=null?I:e.size)!=null?u:16})]:te(ke,{...re,as:ne})},U=()=>{var ne;const V=Number((ne=n(e.max))!=null?ne:5);return Number.isFinite(V)&&V>0?Math.max(1,Math.round(V)):5},Ae=()=>{var V;return!!n((V=e.half)!=null?V:e.allowHalf)},ye=(V,ne=U())=>{let re=Number(n(V));Number.isFinite(re)||(re=0),re=Math.min(ne,Math.max(0,re));const ke=Ae()?.5:1;return Math.round(re/ke)*ke},pe=()=>!!n(e.disabled),we=()=>!!n(e.readonly),he=()=>!pe()&&!we(),me=()=>ye(f?f.get():L),Q=V=>{const ne=V>0?String(V):"";h.value=ne,h.setAttribute("value",ne),h.disabled=pe()};let L=ye(f?f.get():n(e.value)),z=null,H=0,y=[];const Y=(V,ne)=>{if(!Ae())return ye(V);const re=ne.currentTarget.getBoundingClientRect(),ke=ne.clientX-re.left<=re.width/2;return ye(ke?V-.5:V)},k=(V,ne)=>V>=ne?"full":Ae()&&V>=ne-.5?"half":"empty",v=(V,ne)=>{var N,w,le,Ne,se,fe,P,ve,xe,Oe,ze,Ce,Re,J,B;const re=n((le=(w=(N=e.colorSelected)!=null?N:e.activeColor)!=null?w:e.color)!=null?le:e.textColor)||"var(--cms-warning, #f0b429)",ke=n((ve=(P=(fe=(se=(Ne=e.colorHalf)!=null?Ne:e.halfColor)!=null?se:e.colorSelected)!=null?fe:e.activeColor)!=null?P:e.color)!=null?ve:e.textColor)||re,I=n((Re=(Ce=(ze=(Oe=(xe=e.colorHovered)!=null?xe:e.hoverColor)!=null?Oe:e.colorSelected)!=null?ze:e.activeColor)!=null?Ce:e.color)!=null?Re:e.textColor)||re,u=n((B=(J=e.colorInactive)!=null?J:e.colorOff)!=null?B:e.color)||"var(--cms-muted)";return ne?I:V==="full"?re:V==="half"?ke:u},M=V=>{var I,u,N,w,le,Ne,se,fe,P,ve,xe,Oe,ze,Ce,Re;const ne=[];V.hovered&&V.state!=="empty"&&ne.push("hoveredIcon","iconHovered"),V.state==="full"?ne.push("checkedIcon","selectedIcon","iconSelected","iconOn"):V.state==="half"?ne.push("halfIcon","iconHalf"):ne.push("uncheckedIcon","iconOff"),ne.push("icon","item","star");for(const J of ne){const B=E(o,J,V,null);if(B.length)return B}let re=null,ke="icon";return V.hovered&&V.state!=="empty"&&(re=(I=e.hoveredIcon)!=null?I:e.iconHovered,ke="hoveredIcon"),re==null&&V.state==="full"?(re=(le=(w=(N=(u=e.checkedIcon)!=null?u:e.iconSelected)!=null?N:e.iconOn)!=null?w:e.icon)!=null?le:"star",ke="checkedIcon"):re==null&&V.state==="half"?(re=(ve=(P=(fe=(se=(Ne=e.halfIcon)!=null?Ne:e.iconHalf)!=null?se:e.checkedIcon)!=null?fe:e.iconSelected)!=null?P:e.icon)!=null?ve:"star_half",ke="halfIcon"):re==null&&(re=(Re=(xe=e.uncheckedIcon)!=null?xe:e.iconOff)!=null?Re:n(e.noDimming)?(Ce=(ze=(Oe=e.icon)!=null?Oe:e.checkedIcon)!=null?ze:e.iconSelected)!=null?Ce:"star":"star_border",ke="uncheckedIcon"),X(re,ke,V)},x=()=>{const V=U();if(H!==V){H=V,y=[],ce(D);for(let ne=1;ne<=V;ne++){const re=_.span({class:"cms-rating-item-icon"}),ke=_.span({class:"cms-rating-item",role:"radio",tabIndex:-1,onMousemove:I=>{var N;if(!he())return;const u=Y(ne,I);z!==u&&(z=u,g(),(N=e.onHover)==null||N.call(e,u,I))},onClick:I=>{if(!he())return;let u=Y(ne,I);n(e.clearable)&&u===me()&&(u=0),p(u,I,{emit:!0})}},re);y.push({item:ke,iconHost:re,index:ne}),D.appendChild(ke)}}},g=()=>{var Ne,se;x();const V=U(),ne=me(),re=z==null?ne:ye(z,V),ke=pe(),I=we(),u=!!n(e.clearable),N=!!n(e.noDimming);be.classList.toggle("is-disabled",ke),be.classList.toggle("is-readonly",I),be.classList.toggle("is-hovering",z!=null),be.classList.toggle("is-clearable",u),be.classList.toggle("is-half",Ae()),be.classList.toggle("no-dimming",N);const w=Number((se=n((Ne=e.tabindex)!=null?Ne:e.tabIndex))!=null?se:0);D.tabIndex=ke?-1:w,D.setAttribute("role","slider"),D.setAttribute("aria-valuemin","0"),D.setAttribute("aria-valuemax",String(V)),D.setAttribute("aria-valuenow",String(ne)),D.setAttribute("aria-disabled",ke?"true":"false"),D.setAttribute("aria-readonly",I?"true":"false"),Q(ne);const le=E(o,"label",{value:ne,max:V,disabled:ke,readonly:I,clearable:u},e.label!=null?O(e.label):s);ie(R,le,"inline-flex"),y.forEach(({item:fe,iconHost:P,index:ve})=>{const xe=k(re,ve),Oe=z!=null&&xe!=="empty",ze={index:ve,max:V,value:ne,displayValue:re,state:xe,active:xe!=="empty",checked:xe==="full",half:xe==="half",hovered:Oe,disabled:ke,readonly:I,clearable:u,setValue:Ce=>p(Ce,null,{emit:!1})};fe.className=ue(["cms-rating-item",`is-${xe}`,a(Oe,"is-hovered")]),fe.style.color=v(xe,Oe),fe.style.opacity=xe==="empty"&&!N?"0.48":"1",fe.setAttribute("aria-checked",String(ne===ve)),ie(P,M(ze),"inline-flex")})},p=(V,ne,re={})=>{var u,N;const ke=ye(V),I=me();return L=ke,z=null,f&&re.fromModel!==!0&&f.set(ke),Q(ke),g(),re.emit!==!1&&ke!==I&&((u=e.onInput)==null||u.call(e,ke,ne),(N=e.onChange)==null||N.call(e,ke,ne)),ke};return be._input=h,be._rating=D,be._getValue=me,be._setValue=V=>p(V,null,{emit:!1}),f&&f.watch(V=>{const ne=ye(V);serializeValue(ne)!==serializeValue(L)&&(L=ne,z=null,Q(L),g())},"UI.Rating:watch"),CMSwift.reactive.effect(()=>{!f&&e.value!=null&&(L=ye(n(e.value))),g()},"UI.Rating:render"),be},(Ys=CMSwift.isDev)!=null&&Ys.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Rating={signature:"UI.Rating(...children) | UI.Rating(props, ...children)",props:{max:"number",value:"number | rod | [get,set] signal",model:"rod | [get,set] signal",name:"string",label:"String|Node|Function|Array",clearable:"boolean",half:"boolean",allowHalf:"Alias di half",noDimming:"boolean",readonly:"boolean",disabled:"boolean",icon:"String|Node|Function|Array",iconSelected:"Alias di checkedIcon",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",iconHalf:"Alias di halfIcon",halfIcon:"String|Node|Function|Array",iconHovered:"Alias di hoveredIcon",hoveredIcon:"String|Node|Function|Array",color:"string",colorSelected:"string",colorHalf:"string",colorHovered:"string",colorInactive:"string",iconSize:"string|number",size:"string|number",gap:"string|number",slots:"{ label?, icon?, checkedIcon?, uncheckedIcon?, halfIcon?, hoveredIcon?, item?, star? }",class:"string",style:"object"},slots:{label:"Label content",icon:"Base icon content per item",checkedIcon:"Icon when item is selected",uncheckedIcon:"Icon when item is empty",halfIcon:"Icon when item is half-selected",hoveredIcon:"Icon while hovering selected items",item:"Custom item renderer",star:"Alias di item/icon"},events:{onChange:"(value, event)",onInput:"(value, event)",onHover:"(value, event)"},keyboard:["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","Enter","Space","Delete","Backspace","0"],returns:"HTMLLabelElement (with ._input, ._rating, ._getValue(), ._setValue(value))",description:"Rating reattivo con label, icone custom, half rating, clearable e supporto model."});const De=t=>t?{hour:Number(t.hour)||0,minute:Number(t.minute)||0,second:Number(t.second)||0}:null,ht=t=>String(Math.max(0,Number(t)||0)).padStart(2,"0"),Nt=(t,e={})=>{var d,h,b,$,F,D,R,be,ce,ie,O,te,X,U,Ae;if(t==null||t==="")return null;let s=null,o=null,i=0,f=null;if(t instanceof Date&&!Number.isNaN(t.getTime()))s=t.getHours(),o=t.getMinutes(),i=t.getSeconds();else if(typeof t=="number"&&Number.isFinite(t)){const ye=Math.max(0,Math.floor(t));s=Math.floor(ye/3600)%24,o=Math.floor(ye/60)%60,i=ye%60}else if(typeof t=="object"){if(t.time!=null||t.value!=null)return Nt((d=t.time)!=null?d:t.value,e);s=Number(($=(b=(h=t.hour)!=null?h:t.hours)!=null?b:t.h)!=null?$:t.hh),o=Number((be=(R=(D=(F=t.minute)!=null?F:t.minutes)!=null?D:t.min)!=null?R:t.mm)!=null?be:0),i=Number((te=(O=(ie=(ce=t.second)!=null?ce:t.seconds)!=null?ie:t.sec)!=null?O:t.ss)!=null?te:0),f=(Ae=(U=(X=t.meridiem)!=null?X:t.ampm)!=null?U:t.period)!=null?Ae:null}else if(typeof t=="string"){const ye=t.trim();if(!ye)return null;const pe=ye.match(/^(\d{1,2})(\d{2})(\d{2})?$/),we=ye.match(/(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?\s*([ap]m)?/i);if(we)s=Number(we[1]),o=Number(we[2]),i=we[3]!=null?Number(we[3]):0,f=we[4]||null;else if(pe)s=Number(pe[1]),o=Number(pe[2]),i=pe[3]!=null?Number(pe[3]):0;else return null}else return null;if(!Number.isFinite(s)||!Number.isFinite(o)||!Number.isFinite(i))return null;if(f){const ye=String(f).toLowerCase();ye==="pm"&&s<12&&(s+=12),ye==="am"&&s===12&&(s=0)}if(s<0||s>23||o<0||o>59||i<0||i>59)return null;const c={hour:Math.floor(s),minute:Math.floor(o),second:Math.floor(i)};return it(c,e)},bt=(t,e={})=>{const s=t&&typeof t=="object"&&t.hour!=null?De(t):Nt(t,e);if(!s)return"";const o=e.withSeconds===!0||Number(s.second||0)>0;return`${ht(s.hour)}:${ht(s.minute)}${o?`:${ht(s.second)}`:""}`},kt=(t,e)=>{const s=bt(t,{withSeconds:!0}),o=bt(e,{withSeconds:!0});return!s&&!o?0:s?o?s<o?-1:s>o?1:0:1:-1};function it(t,e={}){if(!t)return null;const s=De(t),o=e.min!=null?Nt(e.min,{withSeconds:!0}):null,i=e.max!=null?Nt(e.max,{withSeconds:!0}):null;return o&&kt(s,o)<0?De(o):i&&kt(s,i)>0?De(i):s}const lt=(t,e={})=>t==null||t===""?null:t instanceof Date?Nt(t,e):typeof t=="object"?Nt(t.time!=null?t.time:t,e):typeof t=="string"||typeof t=="number"?Nt(t,e):null,vt=(t,e={})=>{var d;const s=Nt(t,e);if(!s)return"";const o=e.withSeconds===!0||Number(s.second||0)>0;if(!!!n((d=e.use12h)!=null?d:e.ampm))return`${ht(s.hour)}:${ht(s.minute)}${o?`:${ht(s.second)}`:""}`;const f=s.hour>=12?"PM":"AM",c=s.hour%12||12;return`${ht(c)}:${ht(s.minute)}${o?`:${ht(s.second)}`:""} ${f}`},Dt=(t,e,s={})=>{if(!t)return"";const o=bt(e,s);return o?`${t}T${o}`:t},en=(t,e)=>{const s=Math.max(1,Math.min(e+1,Math.round(Number(t)||1))),o=[];for(let i=0;i<=e;i+=s)o.push(i);return o},on=(t={})=>{const{props:e={},slots:s={},value:o=null,withSeconds:i=!1,minuteStep:f=5,secondStep:c=5,disabled:d=!1,readonly:h=!1,embedded:b=!1,className:$="",slotPrefix:F="",shortcuts:D=null,onSelect:R=null}=t,be=Nt(o,{withSeconds:i,min:e.min,max:e.max}),ce=be||Nt(new Date,{withSeconds:i,min:e.min,max:e.max})||{hour:0,minute:0,second:0},ie=be?De(be):null,O=he=>F?`${F}${he[0].toUpperCase()}${he.slice(1)}`:null,te=(he,me,Q)=>{const L=[O(he),he].filter(Boolean);for(const z of L){if(CMSwift.ui.getSlot(s,z)==null)continue;const y=CMSwift.ui.renderSlot(s,z,me,Q);if(y!=null)return y}return CMSwift.ui.slot(Q,me)},X=he=>{let me=te("point",he,null);return me==null&&t.pointIcon!=null&&he.selected&&(me=typeof t.pointIcon=="string"?C.Icon({name:t.pointIcon,size:b?10:12}):CMSwift.ui.slot(t.pointIcon,he)),E(null,"default",he,me)},U=(he,me)=>{const Q={hour:ce.hour,minute:ce.minute,second:i?ce.second:0};return Q[he]=me,Q},Ae=_.div({class:l(["cms-time-section",a(b,"is-embedded"),a(i,"has-seconds"),$])}),ye=n(D)||[];if(Array.isArray(ye)&&ye.length){const he=_.div({class:"cms-time-shortcuts"});ye.forEach((me,Q)=>{var Y,k,v;if(!me)return;const L=typeof me.value=="function"?me.value({now:bt(new Date,{withSeconds:i})}):me.value,z=Nt(L,{withSeconds:i,min:e.min,max:e.max});if(!z)return;const H={item:me,index:Q,value:bt(z,{withSeconds:i}),displayValue:vt(z,{withSeconds:i,use12h:(Y=e.use12h)!=null?Y:e.ampm})},y=te("shortcut",H,(v=(k=me.label)!=null?k:me.text)!=null?v:H.displayValue);he.appendChild(_.button({type:"button",class:l(["cms-time-shortcut",a(!!ie&&kt(z,ie)===0,"is-selected")]),disabled:d||h,onClick:()=>R==null?void 0:R(z,{shortcut:me,index:Q})},...E(null,"default",H,y)))}),he.childNodes.length&&Ae.appendChild(he)}const pe=_.div({class:"cms-time-columns"}),we=(he,me,Q)=>{const L=_.div({class:"cms-time-column","data-time-part":me}),z=_.div({class:"cms-time-options"});return Q.forEach(H=>{var p;const y=U(me,H),Y=it(y,{withSeconds:i,min:e.min,max:e.max}),k=d||h||kt(Y,y)!==0,v=!!ie&&ie[me]===H,M={part:me,selected:v,disabled:k,value:H,label:ht(H),timeValue:bt(Y,{withSeconds:i}),displayValue:vt(Y,{withSeconds:i,use12h:(p=e.use12h)!=null?p:e.ampm})},x=te("option",M,M.label),g=v?X(M):[];z.appendChild(_.button({type:"button",class:l(["cms-time-option",a(v,"is-selected"),a(k,"is-disabled")]),disabled:k,onClick:()=>R==null?void 0:R(Y,{part:me,optionValue:H})},_.span({class:"cms-time-option-label"},...E(null,"default",M,x)),g.length?_.span({class:"cms-time-option-point"},...g):null))}),L.appendChild(z),L};return pe.appendChild(we(n(e.hoursLabel)||"Ore","hour",en(1,23))),pe.appendChild(we(n(e.minutesLabel)||"Min","minute",en(f,59))),i&&pe.appendChild(we(n(e.secondsLabel)||"Sec","second",en(c,59))),Ae.appendChild(pe),Ae},Tt=t=>{if(!t)return null;const e={};return t.querySelectorAll(".cms-time-column").forEach((s,o)=>{const i=s.getAttribute("data-time-part")||String(o);e[i]=s.scrollTop}),e},In=(t,e={})=>{var i;if(!t)return;const s=e.scrollState||null,o=(i=e.behavior)!=null?i:"smooth";t.querySelectorAll(".cms-time-column").forEach((f,c)=>{const d=f.getAttribute("data-time-part")||String(c),h=s&&Number.isFinite(s[d])?s[d]:null;h!=null&&(f.scrollTop=h);const b=f.querySelector(".cms-time-option.is-selected");if(!b)return;const $=Math.max(0,f.scrollHeight-f.clientHeight),F=b.offsetTop-(f.clientHeight-b.offsetHeight)/2,D=Math.max(0,Math.min($,F));if(Math.abs(f.scrollTop-D)<1){f.scrollTop=D;return}if(o&&typeof f.scrollTo=="function"){f.scrollTo({top:D,behavior:o});return}f.scrollTop=D})};C.Date=(...t)=>{var an,mn,Tn,Pn,On,Rn,Dn,Ut,Wt;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=ee(e.size,()=>{const m=String(n(e.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(m)?`cms-size-${m}`:""}),f=String(n((Pn=(Tn=e.mode)!=null?Tn:n((mn=(an=e.rangeMultiple)!=null?an:e.multipleRange)!=null?mn:e.multiRange)?"range-multiple":null)!=null?Pn:e.range&&e.multiple?"range-multiple":e.range?"range":e.multiple?"multiple":"single")).toLowerCase(),c=["range-multiple","multiple-range","rangemultiple","multiplerange","range_multiple","multiple_range","multi-range","multi_range","ranges"].includes(f)?"range-multiple":f==="range"?"range":f==="multiple"?"multiple":"single",d=e.model||(Zt(e.value)||r(e.value)?e.value:null),h=de(d,"UI.Date:model"),b=h?h.get():n(e.value),$=n((On=e.rangeAs)!=null?On:e.rangeModel)==="array"||Array.isArray(b),F=n((Rn=e.rangeMultipleAs)!=null?Rn:e.multipleRangeAs)==="array"||Array.isArray(b)&&Array.isArray(b[0]),D=()=>{var m,ae,Te;return c==="single"&&!!n((Te=(ae=(m=e.withTime)!=null?m:e.time)!=null?ae:e.timePicker)!=null?Te:e.enableTime)},R=()=>{var ae,Te,Xe,Ze,qe,_e,Ye,St;const m=bt(lt((Te=(ae=n(e.timeValue))!=null?ae:h?h.get():n(e.value))!=null?Te:b,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!n((Ze=(Xe=e.timeWithSeconds)!=null?Xe:e.withSeconds)!=null?Ze:e.showSeconds)||/:\d{2}:\d{2}$/.test(m)||/:\d{2}:\d{2}$/.test(n(e.timeFormat)||""),min:n((qe=e.timeMin)!=null?qe:e.minTime),max:n((_e=e.timeMax)!=null?_e:e.maxTime),use12h:n((St=(Ye=e.time12h)!=null?Ye:e.use12h)!=null?St:e.ampm)}},be=()=>{var ae,Te;const m=Number(n((Te=(ae=e.timeMinuteStep)!=null?ae:e.minuteStep)!=null?Te:5));return Math.max(1,Math.min(30,Number.isFinite(m)?m:5))},ce=()=>{var ae,Te;const m=Number(n((Te=(ae=e.timeSecondStep)!=null?ae:e.secondStep)!=null?Te:5));return Math.max(1,Math.min(30,Number.isFinite(m)?m:5))},ie=m=>String(m).padStart(2,"0"),O=(m,ae,Te)=>{const Xe=new Date(m,ae,Te);return Xe.getFullYear()!==m||Xe.getMonth()!==ae||Xe.getDate()!==Te?null:Xe},te=m=>!(m instanceof Date)||Number.isNaN(m.getTime())?null:`${m.getFullYear()}-${ie(m.getMonth()+1)}-${ie(m.getDate())}`,X=m=>{if(typeof m!="string")return null;const ae=m.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!ae)return null;const Te=Number(ae[1]),Xe=Number(ae[2])-1,Ze=Number(ae[3]),qe=new Date(Te,Xe,Ze);return qe.getFullYear()!==Te||qe.getMonth()!==Xe||qe.getDate()!==Ze?null:qe},U=(m,ae)=>{const Te=X(m);return Te?(Te.setDate(Te.getDate()+ae),te(Te)):null},Ae=(m,ae)=>new Date(m.getFullYear(),m.getMonth()+ae,1),ye=m=>{if(m instanceof Date&&!Number.isNaN(m.getTime()))return new Date(m.getFullYear(),m.getMonth(),1);const ae=M(m),Te=X(ae);return Te?new Date(Te.getFullYear(),Te.getMonth(),1):new Date},pe=()=>te(new Date),we=(m,ae)=>!!m&&!!ae&&m===ae,he=(m,ae)=>m==null&&ae==null?0:m==null?-1:ae==null?1:m<ae?-1:m>ae?1:0,me=(m,ae)=>{const Te=X(m),Xe=X(ae);return!Te||!Xe?0:Math.round((Xe.getTime()-Te.getTime())/864e5)},Q=m=>Array.isArray(m)?m.slice():m==null||m===""?[]:[m],L=m=>({from:(m==null?void 0:m.from)||null,to:(m==null?void 0:m.to)||null}),z=m=>Array.isArray(m)?m.map(L):[],H=m=>{const ae=L(m);return $?[ae.from,ae.to]:ae},y=m=>z(m).map(ae=>F?[ae.from,ae.to]:ae),Y=m=>c==="multiple"?Array.isArray(m)?m.slice():[]:c==="range"?L(m):c==="range-multiple"?z(m):m||null,k=m=>c==="multiple"?Array.isArray(m)?m.slice():[]:c==="range"?H(m):c==="range-multiple"?y(m):m||"",v=m=>JSON.stringify(k(m)),M=m=>{if(m==null||m==="")return null;if(m instanceof Date)return te(m);if(typeof m=="number")return te(new Date(m));if(typeof m!="string")return typeof m=="object"&&m.date!=null?M(m.date):null;const ae=m.trim();if(!ae)return null;const Te=ae.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:$|[T\s])/);if(Te){const _e=O(Number(Te[1]),Number(Te[2])-1,Number(Te[3]));return te(_e)}const Xe=ae.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(Xe){const _e=Xe[3].length===2?2e3+Number(Xe[3]):Number(Xe[3]),Ye=O(_e,Number(Xe[2])-1,Number(Xe[1]));return te(Ye)}if(/^\d{1,4}$/.test(ae))return null;const Ze=new Date(ae);if(Number.isNaN(Ze.getTime()))return null;const qe=ae.match(/(?:^|[^\d])(\d{4})(?!\d)/);return qe&&Ze.getFullYear()!==Number(qe[1])?null:te(Ze)},x=m=>{var Xe,Ze,qe,_e,Ye,St;if(m==null||m==="")return{from:null,to:null};let ae=null,Te=null;if(Array.isArray(m))ae=M(m[0]),Te=M(m[1]);else if(typeof m=="object")ae=M((qe=(Ze=(Xe=m.from)!=null?Xe:m.start)!=null?Ze:m.dateFrom)!=null?qe:m.departure),Te=M((St=(Ye=(_e=m.to)!=null?_e:m.end)!=null?Ye:m.dateTo)!=null?St:m.return);else{const Et=String(m).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];ae=M(Et[0]),Te=M(Et[1])}return ae&&Te&&ae>Te&&([ae,Te]=[Te,ae]),{from:ae,to:Te}},g=m=>{const ae=[],Te=new Set,Xe=Ze=>{const qe=x(Ze);if(!qe.from)return;const _e=`${qe.from||""}|${qe.to||""}`;Te.has(_e)||(Te.add(_e),ae.push(qe))};if(m==null||m==="")return ae;if(Array.isArray(m))if(m.every(qe=>qe==null||typeof qe=="string"||typeof qe=="number"||qe instanceof Date)){const qe=m.map(M).filter(Boolean);for(let _e=0;_e<qe.length;_e+=2)Xe({from:qe[_e],to:qe[_e+1]||null})}else m.forEach(qe=>Xe(qe));else if(typeof m=="object"&&Array.isArray(m.ranges))m.ranges.forEach(Ze=>Xe(Ze));else if(typeof m=="object")Xe(m);else{const qe=(String(m).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(M).filter(Boolean);for(let _e=0;_e<qe.length;_e+=2)Xe({from:qe[_e],to:qe[_e+1]||null})}return ae.sort((Ze,qe)=>he(Ze.from,qe.from)||he(Ze.to,qe.to))},p=m=>{const ae=[];return Q(m).forEach(Te=>{const Xe=M(Te);Xe&&!ae.includes(Xe)&&ae.push(Xe)}),ae.sort()},T=m=>c==="range"?x(m):c==="range-multiple"?g(m):c==="multiple"?p(m):M(m),V=()=>{var m;return M(n((m=e.min)!=null?m:e.minDate))},ne=()=>{var m;return M(n((m=e.max)!=null?m:e.maxDate))},re=()=>n(e.locale)||void 0,ke=()=>{var ae,Te;const m=Number(n((Te=(ae=e.firstDayOfWeek)!=null?ae:e.weekStart)!=null?Te:1));return Number.isFinite(m)?(m%7+7)%7:1},I=()=>{var Te;const m=c==="range"||c==="range-multiple"?2:1,ae=Number((Te=n(e.monthsToShow))!=null?Te:m);return Math.max(1,Math.min(4,Number.isFinite(ae)?ae:m))},u=()=>{const m=V(),ae=ne();let Te=M(n(e.defaultMonth))||pe();return m&&Te<m&&(Te=m),ae&&Te>ae&&(Te=ae),Te||m||ae||pe()},N=()=>n(e.confirm)?G:B,w=m=>{const ae=X(m);return ae?{date:m,value:m,year:ae.getFullYear(),month:ae.getMonth()+1,day:ae.getDate(),weekday:ae.getDay(),today:we(m,pe())}:{date:m,value:m}},le=(m,ae)=>m==null?!1:Array.isArray(m)?m.some(Te=>M(Te)===ae):m instanceof Set?m.has(ae):typeof m=="function"?!!m(ae,w(ae)):typeof m=="string"||m instanceof Date||typeof m=="number"?M(m)===ae:!1,Ne=m=>{var St,Et,Vt,Xt,sn,nn,cn,yn,gn,An,Nn,Wn,yo;if(!m)return!1;const ae=V(),Te=ne();if(ae&&m<ae||Te&&m>Te)return!1;const Xe=n((Et=(St=e.options)!=null?St:e.enableDates)!=null?Et:e.allowedDates);if(Xe!=null&&!le(Xe,m))return!1;const Ze=n((Xt=(Vt=e.disableDates)!=null?Vt:e.disabledDates)!=null?Xt:e.notAllowedDates);if(Ze!=null&&le(Ze,m))return!1;const qe=(sn=X(m))==null?void 0:sn.getDay();if(Array.isArray(n((nn=e.allowedWeekdays)!=null?nn:e.weekdays))&&qe!=null&&!n((cn=e.allowedWeekdays)!=null?cn:e.weekdays).map(ro=>Number(ro)).includes(qe)||n(e.weekdaysOnly)&&(qe===0||qe===6)||n(e.weekendsOnly)&&qe!=null&&qe!==0&&qe!==6)return!1;const _e=N(),Ye=c==="range"?_e!=null&&_e.from&&!(_e!=null&&_e.to)?_e:null:c==="range-multiple"&&Array.isArray(_e)&&_e.length&&(yn=_e[_e.length-1])!=null&&yn.from&&!((gn=_e[_e.length-1])!=null&&gn.to)?_e[_e.length-1]:null;if(Ye!=null&&Ye.from){const io=Math.abs(me(Ye.from,m)),ro=Number(n((Nn=(An=e.minRange)!=null?An:e.minDays)!=null?Nn:e.minNights)),wo=Number(n((yo=(Wn=e.maxRange)!=null?Wn:e.maxDays)!=null?yo:e.maxNights));if(Number.isFinite(ro)&&io<ro||Number.isFinite(wo)&&io>wo)return!1}return!0},se=m=>{var Xe,Ze;if(!m)return"";const ae=X(m);return!ae||String(n((Ze=(Xe=e.displayMask)!=null?Xe:e.mask)!=null?Ze:"")||"").toLowerCase()==="iso"||n(e.isoDisplay)===!0?m:new Intl.DateTimeFormat(re(),{year:"numeric",month:"short",day:"2-digit"}).format(ae)},fe=(m,ae=q)=>{if(c==="range-multiple")return!Array.isArray(m)||!m.length?"":m.length>2&&n(e.compactMultiple)!==!1?`${m.length} ${n(e.multipleRangeLabel)||"intervalli selezionati"}`:m.map(Ze=>{const qe=Ze!=null&&Ze.from?se(Ze.from):"",_e=Ze!=null&&Ze.to?se(Ze.to):"";return qe&&_e?`${qe} -> ${_e}`:qe||_e||""}).filter(Boolean).join("; ");if(c==="multiple")return!Array.isArray(m)||!m.length?"":m.length>3&&n(e.compactMultiple)!==!1?`${m.length} ${n(e.multipleLabel)||"date selezionate"}`:m.map(se).join(", ");if(c==="range"){const Ze=m!=null&&m.from?se(m.from):"",qe=m!=null&&m.to?se(m.to):"";return Ze&&qe?`${Ze} -> ${qe}`:Ze||qe||""}const Te=se(m);if(!D())return Te;const Xe=J(ae);return[Te,Xe].filter(Boolean).join(" \u2022 ")},P=m=>(String(m||"").match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(M).filter(Boolean),ve=m=>{if(m==null||m==="")return c==="multiple"||c==="range-multiple"?[]:c==="range"?{from:null,to:null}:null;const ae=P(m);if(c==="range-multiple"){const Te=[];for(let Xe=0;Xe<ae.length;Xe+=2)ae[Xe]&&Te.push({from:ae[Xe],to:ae[Xe+1]||null});return Te}return c==="multiple"?ae:c==="range"?{from:ae[0]||null,to:ae[1]||null}:ae[0]||M(m)},xe=()=>c==="multiple"||c==="range-multiple"?[]:c==="range"?{from:null,to:null}:null,Oe=(m,ae=null)=>{var _e;if(!D())return null;const Te=R(),Xe=n(e.timeValue),Ze=m!=null?m:Xe,qe=lt(Ze,Te);return De((_e=qe!=null?qe:ae)!=null?_e:null)},ze=()=>n(e.confirm)?Le:q,Ce=(m=B,ae=q)=>c==="single"&&D()?Dt(m||null,ae,R()):k(m),Re=(m=B,ae=q)=>JSON.stringify(Ce(m,ae)),J=m=>vt(m,R());let B=T(b),G=Y(B),q=Oe(b,lt(n(e.timeValue),R())),Le=De(q),Z=null,Ve=null,je=ye(c==="range"?(B==null?void 0:B.from)||(B==null?void 0:B.to)||u():c==="range-multiple"?((Dn=B==null?void 0:B[B.length-1])==null?void 0:Dn.from)||((Ut=B==null?void 0:B[B.length-1])==null?void 0:Ut.to)||u():c==="multiple"?B[0]||u():B||u()),$e=null,et=null;const j=m=>{const ae=m instanceof Date?m:X(M(m));if(!ae)return-1;const Te=ae.getFullYear(),Xe=ae.getMonth();for(let Ze=0;Ze<I();Ze+=1){const qe=Ae(je,Ze);if(qe.getFullYear()===Te&&qe.getMonth()===Xe)return Ze}return-1},Me=_.input({class:l(["cms-input","cms-date-display",i,a(e.manualInput,"is-manual"),e.inputClass]),type:"text",autocomplete:"off",placeholder:e.placeholder||(c==="range"?"Seleziona andata e ritorno":c==="range-multiple"?"Seleziona intervalli":c==="multiple"?"Seleziona date":"Seleziona data"),readOnly:!n(e.manualInput),disabled:!!n(e.disabled),value:fe(B,q)}),We=_.div({style:{display:"contents"}}),Ue=_.div({class:"cms-date-control",style:{display:"contents"}},Me,We),Qe=C.FormField({...e,iconRight:(Wt=e.iconRight)!=null?Wt:"calendar_month",control:Ue,getValue:()=>Me.value,onClear:()=>{n(e.disabled)||n(e.readonly)||(pt(xe(),null),$e&&Lt())},onFocus:()=>Me.focus()}),st=(m,ae={})=>{var Ze,qe;const Te=ae.focusIso||(c==="range"?(m==null?void 0:m.from)||(m==null?void 0:m.to)||u():c==="range-multiple"?((Ze=m==null?void 0:m[m.length-1])==null?void 0:Ze.from)||((qe=m==null?void 0:m[m.length-1])==null?void 0:qe.to)||u():c==="multiple"?(m==null?void 0:m[0])||u():m||u());let Xe=ye(Te);if(ae.preserveMonthOffset){const _e=Number.isInteger(ae.visibleMonthOffset)?ae.visibleMonthOffset:j(ae.anchorIso||ae.focusIso||Te);_e>0&&(Xe=Ae(Xe,-_e))}je=Xe},dt=()=>{We.replaceChildren();const m=n(e.name);if(!m)return;const ae=(Ze,qe)=>{We.appendChild(_.input({type:"hidden",name:Ze,value:qe!=null?qe:""}))},Te=B;if(c==="single"){ae(m,Ce(Te,q));return}if(c==="range"){ae(n(e.nameFrom)||`${m}_from`,(Te==null?void 0:Te.from)||""),ae(n(e.nameTo)||`${m}_to`,(Te==null?void 0:Te.to)||"");return}if(c==="range-multiple"){const Ze=Array.isArray(Te)?Te:[],qe=/\[\]$/.test(n(e.nameFrom)||"")?n(e.nameFrom):`${n(e.nameFrom)||`${m}_from`}[]`,_e=/\[\]$/.test(n(e.nameTo)||"")?n(e.nameTo):`${n(e.nameTo)||`${m}_to`}[]`;Ze.forEach(Ye=>{ae(qe,(Ye==null?void 0:Ye.from)||""),ae(_e,(Ye==null?void 0:Ye.to)||"")});return}const Xe=/\[\]$/.test(m)?m:`${m}[]`;(Array.isArray(Te)?Te:[]).forEach(Ze=>ae(Xe,Ze))},At=()=>{var m;Me.readOnly=!n(e.manualInput),Me.disabled=!!n(e.disabled),Me.setAttribute("aria-expanded",$e?"true":"false"),Me.value=fe(B,q),dt(),(m=Qe._refresh)==null||m.call(Qe)},pt=(m,ae,Te={})=>{var Ye,St,Et;const Xe=T(m),Ze=D()?De((Ye=lt(Te.timeValue!=null?Te.timeValue:Te.preserveTime?ze():m,R()))!=null?Ye:Te.preserveTime?ze():null):null,qe=Re(B,q);B=Y(Xe),G=Y(Xe),D()&&(q=De(Ze),Le=De(Ze)),Z=null,st(Xe,Te),At(),jt(),h&&Te.fromModel!==!0&&h.set(Ce(Xe,Ze));const _e=Re(Xe,Ze);if(Te.emit!==!1&&_e!==qe){const Vt=Ce(Xe,Ze);(St=e.onInput)==null||St.call(e,Vt,ae),(Et=e.onChange)==null||Et.call(e,Vt,ae)}return Xe},It=(m,ae,Te={})=>{var _e,Ye;if(!D())return null;const Xe=De(lt(m,R()));if(n(e.confirm)&&Te.commit!==!0)return Le=Xe,jt(),Xe;const Ze=Re(B,q);q=De(Xe),Le=De(Xe),At(),jt(),h&&Te.fromModel!==!0&&h.set(Ce(B,Xe));const qe=Re(B,Xe);if(Te.emit!==!1&&qe!==Ze){const St=Ce(B,Xe);(_e=e.onInput)==null||_e.call(e,St,ae),(Ye=e.onChange)==null||Ye.call(e,St,ae)}return Xe},ft=(m,ae,Te={})=>{if(n(e.confirm)){G=Y(T(m)),D()&&(Te.timeValue!=null||Te.preserveTime)&&(Le=De(lt(Te.timeValue!=null?Te.timeValue:ze(),R()))),Z=null,st(G,Te),jt();return}pt(m,ae,Te)},Mt=()=>{const m=N();if(c==="range")return!(m!=null&&m.from)||m!=null&&m.to||!Z?m:he(m.from,Z)<=0?{from:m.from,to:Z}:{from:Z,to:m.from};if(c==="range-multiple"){const ae=Array.isArray(m)&&m.length?m[m.length-1]:null;return!(ae!=null&&ae.from)||ae!=null&&ae.to||!Z?ae:he(ae.from,Z)<=0?{from:ae.from,to:Z}:{from:Z,to:ae.from}}return m},Ot=()=>{if(c==="range"){const m=Mt();return m!=null&&m.from?[m]:[]}if(c==="range-multiple"){const m=Array.isArray(N())?N():[];if(!m.length)return[];const ae=Mt();return ae!=null&&ae.from?[...m.slice(0,-1),ae]:m}return[]},Gt=m=>{const ae=N();return c==="multiple"?ae.includes(m):c==="range-multiple"?Array.isArray(ae)&&ae.some(Te=>we(Te==null?void 0:Te.from,m)||we(Te==null?void 0:Te.to,m)):c==="range"?we(ae==null?void 0:ae.from,m)||we(ae==null?void 0:ae.to,m):we(ae,m)},Je=m=>c!=="range"&&c!=="range-multiple"?!1:Ot().some(ae=>(ae==null?void 0:ae.from)&&(ae==null?void 0:ae.to)&&m>=ae.from&&m<=ae.to),Ct=(m,ae={})=>{const Te=N(),Xe=c==="range"?Te:c==="range-multiple"&&Array.isArray(Te)&&Te.length?Te[Te.length-1]:null;!(Xe!=null&&Xe.from)||Xe!=null&&Xe.to||Z===m||(Z=m,ae.render!==!1&&jt())},_t=()=>n(e.confirm)||e.closeOnSelect===!1?!1:c==="multiple"||c==="range-multiple"?!!e.closeOnSelect:!0,Ft=(m,ae,Te={})=>{var Ze;if(!Ne(m)||n(e.disabled)||n(e.readonly))return;const Xe={focusIso:m,anchorIso:m,preserveTime:D(),timeValue:ze(),preserveMonthOffset:!!$e&&I()>1,visibleMonthOffset:Number.isInteger(Te.visibleMonthOffset)?Te.visibleMonthOffset:null};if(c==="multiple"){const qe=p(N()),_e=qe.includes(m)?qe.filter(Ye=>Ye!==m):[...qe,m];ft(_e.sort(),ae,Xe),_t()&&Lt();return}if(c==="range"){const qe=Y(N());let _e;!qe.from||qe.from&&qe.to?_e={from:m,to:null}:he(m,qe.from)<0?_e={from:m,to:qe.from}:_e={from:qe.from,to:m},ft(_e,ae,Xe),_e.to&&_t()&&Lt();return}if(c==="range-multiple"){const qe=g(N()),_e=qe.length?qe[qe.length-1]:null;let Ye;!(_e!=null&&_e.from)||_e!=null&&_e.to?Ye=[...qe,{from:m,to:null}]:he(m,_e.from)<0?Ye=[...qe.slice(0,-1),{from:m,to:_e.from}]:Ye=[...qe.slice(0,-1),{from:_e.from,to:m}],ft(Ye,ae,Xe),(Ze=Ye[Ye.length-1])!=null&&Ze.to&&_t()&&Lt();return}ft(m,ae,Xe),_t()&&Lt()},Bt=()=>{Ve=null,pt(xe(),null,{timeValue:null})},qt=()=>{const m=pe();if(!Ne(m)){st(m),jt();return}if(c==="range"){const ae=U(m,1),Te=ae&&Ne(ae)?{from:m,to:ae}:{from:m,to:null};ft(Te,null);return}if(c==="range-multiple"){const ae=U(m,1),Te=ae&&Ne(ae)?[{from:m,to:ae}]:[{from:m,to:null}];ft(Te,null);return}if(c==="multiple"){ft([m],null);return}ft(m,null,{preserveTime:D(),timeValue:ze()})},Yt=(m={})=>{In(et,m)},$t=()=>{if(!D())return;const m=Tt(et);It(new Date,null,{commit:!n(e.confirm)}),Yt({scrollState:m}),!n(e.confirm)&&e.closeOnSelect===!0&&Lt()},Ht=()=>{n(e.confirm)&&(pt(G,null,{timeValue:Le,preserveTime:!0}),e.closeOnSelect!==!1&&Lt())},jt=()=>{var wi,vi,Si,Ci,xi,Ai,Ni,ki,Mi,_i,Fi,Ii,Li,Ei,zi,Ti,Pi,Oi,Ri;if(!et)return;const m=re(),ae=new Intl.DateTimeFormat(m,{month:"long",year:"numeric"}),Te=new Intl.DateTimeFormat(m,{weekday:"short"}),Xe=Array.from({length:7},(yt,zt)=>{const pn=(ke()+zt)%7;return Te.format(new Date(2024,0,7+pn))}),Ze=N(),qe=yt=>{let zt=CMSwift.ui.renderSlot(o,"point",yt,null);return zt==null&&(zt=CMSwift.ui.renderSlot(o,"dayPoint",yt,null)),zt==null&&e.pointIcon!=null&&(yt.selected||yt.inRange||yt.today)&&(zt=typeof e.pointIcon=="string"?C.Icon({name:e.pointIcon,size:10}):CMSwift.ui.slot(e.pointIcon,yt)),E(null,"default",yt,zt)},_e=(yt,zt)=>{const pn=yt.getFullYear(),vo=yt.getMonth(),So=new Date(pn,vo,1),Vo=(So.getDay()-ke()+7)%7,Zo=new Date(pn,vo,1-Vo),Bo=_.div({class:"cms-date-month"});Bo.appendChild(_.div({class:"cms-date-month-title"},ae.format(So)));const Di=_.div({class:"cms-date-weekdays"});Xe.forEach(Co=>Di.appendChild(_.div({class:"cms-date-weekday"},Co))),Bo.appendChild(Di);const Hi=_.div({class:"cms-date-grid"});for(let Co=0;Co<42;Co+=1){const es=new Date(Zo.getFullYear(),Zo.getMonth(),Zo.getDate()+Co),un=te(es),ji=es.getMonth()===vo,Vi=Gt(un),Bi=Je(un),$i=(c==="range"||c==="range-multiple")&&Ot().some(rn=>we(rn==null?void 0:rn.from,un)),Wi=(c==="range"||c==="range-multiple")&&Ot().some(rn=>we(rn==null?void 0:rn.to,un)),ts=!Ne(un),ns={...w(un),selected:Vi,inRange:Bi,rangeStart:$i,rangeEnd:Wi,disabled:ts,outside:!ji,value:Ze,select:()=>Ft(un,null,{visibleMonthOffset:zt})},os=qe(ns),cr=CMSwift.ui.renderSlot(o,"day",ns,String(es.getDate())),ur=E(null,"default",ns,cr),dr=_.button({type:"button",class:l(["cms-date-day",a(!ji,"is-outside"),a(Vi,"is-selected"),a(Bi,"is-in-range"),a($i,"is-range-start"),a(Wi,"is-range-end"),a(ts,"is-disabled"),a(we(un,pe()),"is-today"),a(os.length,"has-point")]),disabled:ts,onMouseDown:rn=>{rn.button===0&&(Ve=un,rn.preventDefault(),Ft(un,rn,{visibleMonthOffset:zt}))},onClick:rn=>{if(Ve!=null&&rn.detail!==0){Ve=null;return}Ve=null,Ft(un,rn,{visibleMonthOffset:zt})},onMouseEnter:()=>Ct(un),onFocus:()=>Ct(un,{render:!1})},_.span({class:"cms-date-day-label"},...ur),os.length?_.span({class:"cms-date-day-point"},...os):null);Hi.appendChild(dr)}return Bo.appendChild(Hi),Bo},Ye=V(),St=ne(),Et=[je.getFullYear(),(wi=X(pe()))==null?void 0:wi.getFullYear(),(vi=X(Ye))==null?void 0:vi.getFullYear(),(Si=X(St))==null?void 0:Si.getFullYear(),(Ci=X(n(e.defaultMonth)))==null?void 0:Ci.getFullYear()];c==="range"?Et.push((xi=X(Ze==null?void 0:Ze.from))==null?void 0:xi.getFullYear(),(Ai=X(Ze==null?void 0:Ze.to))==null?void 0:Ai.getFullYear()):c==="range-multiple"?Ze.forEach(yt=>{var zt,pn;Et.push((zt=X(yt==null?void 0:yt.from))==null?void 0:zt.getFullYear(),(pn=X(yt==null?void 0:yt.to))==null?void 0:pn.getFullYear())}):c==="multiple"?Ze.forEach(yt=>{var zt;return Et.push((zt=X(yt))==null?void 0:zt.getFullYear())}):Et.push((Ni=X(Ze))==null?void 0:Ni.getFullYear());const Vt=Et.filter(yt=>Number.isFinite(yt)),Xt=(Vt.length?Math.min(...Vt):je.getFullYear())-100,sn=(Vt.length?Math.max(...Vt):je.getFullYear())+50,nn=Number(n((_i=(Mi=e.yearStart)!=null?Mi:Ye?(ki=X(Ye))==null?void 0:ki.getFullYear():null)!=null?_i:Xt)),cn=Number(n((Li=(Ii=e.yearEnd)!=null?Ii:St?(Fi=X(St))==null?void 0:Fi.getFullYear():null)!=null?Li:sn)),yn=_.select({class:"cms-date-select",value:String(je.getMonth()),onChange:yt=>{var zt;je=new Date(je.getFullYear(),Number(yt.currentTarget.value),1),(zt=e.onNavigate)==null||zt.call(e,{month:je.getMonth()+1,year:je.getFullYear()}),jt()}},...Array.from({length:12},(yt,zt)=>to({value:String(zt)},new Intl.DateTimeFormat(m,{month:"long"}).format(new Date(2024,zt,1))))),gn=_.select({class:"cms-date-select cms-date-select-year",value:String(je.getFullYear()),onChange:yt=>{var zt;je=new Date(Number(yt.currentTarget.value),je.getMonth(),1),(zt=e.onNavigate)==null||zt.call(e,{month:je.getMonth()+1,year:je.getFullYear()}),jt()}},...Array.from({length:Math.max(1,cn-nn+1)},(yt,zt)=>{const pn=nn+zt;return to({value:String(pn)},String(pn))})),An=_.div({class:"cms-date-header"},_.button({type:"button",class:"cms-date-nav",onClick:()=>{var yt;je=Ae(je,-1),(yt=e.onNavigate)==null||yt.call(e,{month:je.getMonth()+1,year:je.getFullYear()}),jt()}},C.Icon({name:"chevron_left",size:16})),_.div({class:"cms-date-header-center"},yn,gn),_.button({type:"button",class:"cms-date-nav",onClick:()=>{var yt;je=Ae(je,1),(yt=e.onNavigate)==null||yt.call(e,{month:je.getMonth()+1,year:je.getFullYear()}),jt()}},C.Icon({name:"chevron_right",size:16}))),Nn=_.div({class:"cms-date-shortcuts"}),Wn=n((Ei=e.shortcuts)!=null?Ei:e.presets)||[];Wn.forEach((yt,zt)=>{var So,Vo;if(!yt)return;const pn=typeof yt.value=="function"?yt.value({today:pe()}):yt.value,vo=(Vo=(So=yt.label)!=null?So:yt.text)!=null?Vo:`Preset ${zt+1}`;Nn.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>ft(pn,null,{preserveTime:D(),timeValue:ze()})},vo))});const yo=_.div({class:"cms-date-months"});for(let yt=0;yt<I();yt+=1)yo.appendChild(_e(Ae(je,yt),yt));const io=fe(Ze,ze()),ro=_.div({class:"cms-date-value"},...E(o,"value",{value:Ze,displayValue:io,mode:c,timeValue:ze()},io||E(o,"default",{},s))),wo=_.div({class:"cms-time-header"}),or=_.div({class:"cms-time-columns-2"},_.div({class:"cms-time-column-title"},n(e.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},n(e.minutesLabel)||"Min"));wo.appendChild(or);const sr=D()?on({props:{min:n((zi=e.timeMin)!=null?zi:e.minTime),max:n((Ti=e.timeMax)!=null?Ti:e.maxTime),use12h:n((Oi=(Pi=e.time12h)!=null?Pi:e.use12h)!=null?Oi:e.ampm),hoursLabel:n(e.timeHoursLabel)||"Ore",minutesLabel:n(e.timeMinutesLabel)||"Min",secondsLabel:n(e.timeSecondsLabel)||"Sec"},slots:o,slotPrefix:"time",value:ze(),withSeconds:!1,minuteStep:1,secondStep:ce(),disabled:!!n(e.disabled),readonly:!!n(e.readonly),embedded:!0,pointIcon:n(e.timePointIcon),shortcuts:n((Ri=e.timeShortcuts)!=null?Ri:e.timePresets),onSelect:yt=>{const zt=Tt(et);It(yt,null),Yt({scrollState:zt})}}):null,ir=_.div({class:"cms-date-footer-info"},ro),rr=_.div({class:l(["cms-date-footer",a(D(),"has-time")])},ir,_.div({class:"cms-date-actions"},_.button({type:"button",class:"cms-date-action",onClick:qt},n(e.todayLabel)||"Oggi"),n(e.clearable)!==!1?_.button({type:"button",class:"cms-date-action",onClick:Bt},n(e.clearLabel)||"Reset"):null,n(e.confirm)?_.button({type:"button",class:"cms-date-action is-primary",onClick:Ht},n(e.applyLabel)||"Applica"):null)),lr=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:$t},n(e.nowLabel)||"Ora")),ar=D()?_.div({class:"cms-date-time"},wo,sr,lr):null;et.replaceChildren(_.div({class:"cms-date-panel-root",onKeydown:yt=>{yt.key==="Escape"&&(yt.preventDefault(),Lt())}},An,Wn.length?Nn:null,_.div({class:"cms-data-time"},yo,ar),rr))};function Kt(){var m,ae,Te,Xe;return $e||n(e.disabled)||n(e.readonly)||(G=Y(B),Le=De(q),Z=null,Ve=null,st(G),$e=CMSwift.overlay.open(({close:Ze})=>{var Ye;const qe=c==="range"||c==="range-multiple"?2:1,_e=Number((Ye=n(e.monthsToShow))!=null?Ye:qe);return et=_.div({class:ue(["cms-date-panel",n(i),a(_e>1,"multi-month"),e.panelClass])}),jt(),et},{type:"date",anchorEl:Qe._control||Me,placement:e.placement||"bottom-start",offsetX:(m=e.offsetX)!=null?m:0,offsetY:(Te=(ae=e.offsetY)!=null?ae:e.offset)!=null?Te:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:e.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:ue(["cms-date-overlay",e.panelClass,a(D(),"has-time")]),onClose:()=>{var Ze;$e=null,et=null,Z=null,At(),(Ze=e.onClose)==null||Ze.call(e)}}),e.panelStyle&&Object.assign($e.panel.style,e.panelStyle),Ke($e),At(),(Xe=e.onOpen)==null||Xe.call(e)),$e}function Lt(){if(!$e)return;Ve=null;const m=$e;nt(m,()=>CMSwift.overlay.close(m.id))}return Me.addEventListener("focus",m=>{var ae;(ae=e.onFocus)==null||ae.call(e,m),e.openOnFocus!==!1&&Kt()}),Me.addEventListener("click",m=>{var ae;(ae=e.onClick)==null||ae.call(e,m),Kt()}),Me.addEventListener("keydown",m=>{if(m.key==="Escape"){$e&&(m.preventDefault(),Lt());return}(m.key==="ArrowDown"||m.key==="Enter"||m.key===" ")&&(m.preventDefault(),Kt()),(m.key==="Backspace"||m.key==="Delete")&&!n(e.manualInput)&&n(e.clearable)!==!1&&(m.preventDefault(),Bt())}),n(e.manualInput)?(Me.addEventListener("input",m=>{var ae;(ae=e.onTyping)==null||ae.call(e,Me.value,m)}),Me.addEventListener("change",m=>{const ae=ve(Me.value);pt(ae,m,{timeValue:lt(Me.value,R()),preserveTime:!lt(Me.value,R())})}),Me.addEventListener("blur",m=>{var Te;(Te=e.onBlur)==null||Te.call(e,m);const ae=ve(Me.value);Me.value===""?Bt():pt(ae,m,{timeValue:lt(Me.value,R()),preserveTime:!lt(Me.value,R())})})):Me.addEventListener("blur",m=>{var ae;return(ae=e.onBlur)==null?void 0:ae.call(e,m)}),h&&h.watch(m=>{const ae=T(m),Te=Oe(m);Re(ae,Te)!==Re(B,q)&&(B=ae,G=Y(B),q=De(Te),Le=De(Te),Z=null,st(B),At(),jt())},"UI.Date:watch"),CMSwift.reactive.effect(()=>{!h&&e.value!=null?(B=T(n(e.value)),G=Y(B),q=Oe(n(e.value)),Le=De(q)):D()&&e.timeValue!=null&&(q=Oe(n(e.timeValue)),Le=De(q)),At(),jt(),$e&&n(e.disabled)&&Lt()},"UI.Date:render"),Qe._input=Me,Qe._date=Me,Qe._open=Kt,Qe._close=Lt,Qe._getValue=()=>Ce(B,q),Qe._setValue=m=>pt(m,null,{emit:!1,timeValue:Oe(m)}),Qe._time=()=>De(q),Qe._panel=()=>($e==null?void 0:$e.panel)||null,Qe},(Xs=CMSwift.isDev)!=null&&Xs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Date={signature:"UI.Date(props)",props:{value:"string | { from, to } | string[] | Array<{ from, to }> | Array<[from, to]>",model:"rod | [get,set] signal",mode:'"single"|"range"|"multiple"|"range-multiple"',range:"boolean",multiple:"boolean",rangeMultiple:"boolean",multipleRange:"Alias di rangeMultiple",min:"string",max:"string",minDate:"Alias di min",maxDate:"Alias di max",minRange:"number",maxRange:"number",manualInput:"boolean",firstDayOfWeek:"number",monthsToShow:"number",locale:"string",shortcuts:"Array<{ label, value }>",options:"Array|string|Function",enableDates:"Alias di options",disableDates:"Array|string|Function",label:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",pointIcon:"String|Node|Function|Array",withTime:"boolean",timeValue:"string|Date",timeMin:"string",timeMax:"string",timeMinuteStep:"number",timeSecondStep:"number",timeWithSeconds:"boolean",timeShortcuts:"Array<{ label, value }>",timePointIcon:"String|Node|Function|Array",clearable:"boolean",confirm:"boolean",name:"string",nameFrom:"string",nameTo:"string",size:'"xs"|"sm"|"md"|"lg"|"xl"',class:"string",style:"object"},slots:{day:"Contenuto del giorno ({ date, selected, inRange, disabled, outside })",point:"Punto/icona nel giorno",dayPoint:"Alias di point",value:"Footer value renderer ({ value, displayValue, mode })",timeOption:"Renderer per opzione oraria nel footer integrato",timePoint:"Punto/icona nella time option del footer",timeShortcut:"Renderer scorciatoia oraria integrata",label:"Floating label",topLabel:"Top label",icon:"Left icon",iconRight:"Right icon",default:"Fallback value content"},events:{onChange:"(value, event)",onInput:"(value, event)",onOpen:"void",onClose:"void",onNavigate:"({ month, year })"},returns:"HTMLDivElement (field wrapper) con ._input, ._open(), ._close(), ._getValue(), ._setValue(value)",description:"Date picker reattivo con overlay fixed, single/range/multiple/multi-range, model, min/max, presets, size xs-xl e supporto opzionale al tempo in interfaccia unificata."}),C.Time=(...t)=>{var v;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=ee(e.size,()=>{const M=String(n(e.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(M)?`cms-size-${M}`:""}),f=()=>{var x,g,p,T,V;const M=bt(lt(b?b.get():(x=n(e.value))!=null?x:$,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!n((g=e.withSeconds)!=null?g:e.showSeconds)||/:\d{2}:\d{2}$/.test(M),min:n((p=e.min)!=null?p:e.minTime),max:n((T=e.max)!=null?T:e.maxTime),use12h:n((V=e.use12h)!=null?V:e.ampm)}},c=()=>{var x;const M=Number(n((x=e.minuteStep)!=null?x:1));return Math.max(1,Math.min(30,Number.isFinite(M)?M:5))},d=()=>{var x;const M=Number(n((x=e.secondStep)!=null?x:1));return Math.max(1,Math.min(30,Number.isFinite(M)?M:5))},h=e.model||(Zt(e.value)||r(e.value)?e.value:null),b=de(h,"UI.Time:model"),$=b?b.get():n(e.value),F=M=>lt(M,f()),D=M=>vt(M,f()),R=M=>bt(M,f()),be=M=>JSON.stringify(R(M));let ce=De(F($)),ie=De(ce),O=null,te=null;const X=_.input({class:l(["cms-input","cms-time-display",i,a(e.manualInput,"is-manual"),e.inputClass]),type:"text",autocomplete:"off",placeholder:e.placeholder||"Seleziona orario",readOnly:!n(e.manualInput),disabled:!!n(e.disabled),value:D(ce)});X.setAttribute("aria-haspopup","dialog");const U=_.div({style:{display:"contents"}}),Ae=_.div({class:"cms-time-control",style:{display:"contents"}},X,U),ye=C.FormField({...e,iconRight:(v=e.iconRight)!=null?v:"schedule",control:Ae,getValue:()=>X.value,onClear:()=>{n(e.disabled)||n(e.readonly)||(me(null,null,{commit:!0}),O&&k())},onFocus:()=>X.focus()}),pe=()=>n(e.confirm)?ie:ce,we=()=>{U.replaceChildren();const M=n(e.name);M&&U.appendChild(_.input({type:"hidden",name:M,value:R(ce)}))},he=()=>{var M;X.readOnly=!n(e.manualInput),X.disabled=!!n(e.disabled),X.setAttribute("aria-expanded",O?"true":"false"),X.value=D(ce),we(),(M=ye._refresh)==null||M.call(ye)},me=(M,x,g={})=>{var ne,re;const p=De(F(M));if(n(e.confirm)&&g.commit!==!0)return ie=De(p),y(),p;const T=be(ce);ce=De(p),ie=De(p),he(),y(),b&&g.fromModel!==!0&&b.set(R(p));const V=be(p);if(g.emit!==!1&&V!==T){const ke=R(p);(ne=e.onInput)==null||ne.call(e,ke,x),(re=e.onChange)==null||re.call(e,ke,x)}return p},Q=M=>n(e.confirm)||e.closeOnSelect!==!0?!1:f().withSeconds?(M==null?void 0:M.part)==="second":(M==null?void 0:M.part)==="minute",L=(M={})=>{In(te,M)},z=()=>{const M=Tt(te);me(new Date,null,{commit:!n(e.confirm)}),L({scrollState:M}),!n(e.confirm)&&e.closeOnSelect===!0&&k()},H=()=>{n(e.confirm)&&(me(ie,null,{commit:!0}),e.closeOnSelect!==!1&&k())},y=()=>{var re,ke,I,u;if(!te)return;const M=pe(),x=D(M),g=_.div({class:"cms-time-header"}),p=_.div({class:"cms-time-columns"},_.div({class:"cms-time-column-title"},n(e.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},n(e.minutesLabel)||"Min")),T=f().withSeconds;T&&p.appendChild(_.div({class:"cms-time-column-title"},n(e.secondsLabel)||"Sec")),g.appendChild(p);const V=on({props:{min:n((re=e.min)!=null?re:e.minTime),max:n((ke=e.max)!=null?ke:e.maxTime),use12h:n((I=e.use12h)!=null?I:e.ampm),hoursLabel:n(e.hoursLabel)||"Ore",minutesLabel:n(e.minutesLabel)||"Min",secondsLabel:n(e.secondsLabel)||"Sec"},slots:o,value:M,withSeconds:T,minuteStep:c(),secondStep:d(),disabled:!!n(e.disabled),readonly:!!n(e.readonly),pointIcon:n(e.pointIcon),shortcuts:n((u=e.shortcuts)!=null?u:e.presets),onSelect:(N,w)=>{const le=Tt(te);me(N,null),L({scrollState:le}),Q(w)&&k()}}),ne=_.div({class:"cms-time-footer"},_.div({class:"cms-time-value"},...E(o,"value",{value:M,displayValue:x},x||E(o,"default",{},s))),_.div({class:"cms-time-actions"},_.button({type:"button",class:"cms-time-action",onClick:z},n(e.nowLabel)||"Ora"),n(e.clearable)!==!1?_.button({type:"button",class:"cms-time-action",onClick:()=>me(null,null,{commit:!n(e.confirm)})},n(e.clearLabel)||"Reset"):null,n(e.confirm)?_.button({type:"button",class:"cms-time-action is-primary",onClick:H},n(e.applyLabel)||"Applica"):null));te.replaceChildren(_.div({class:"cms-time-panel-root",onKeydown:N=>{N.key==="Escape"&&(N.preventDefault(),k())}},g,V,ne))};function Y(){var M,x,g,p;return O||n(e.disabled)||n(e.readonly)||(ie=De(ce),O=CMSwift.overlay.open(()=>(te=_.div({class:ue(["cms-time-panel",n(i),e.panelClass])}),y(),te),{type:"time",anchorEl:ye._control||X,placement:e.placement||"bottom-start",offsetX:(M=e.offsetX)!=null?M:0,offsetY:(g=(x=e.offsetY)!=null?x:e.offset)!=null?g:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:e.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:ue(["cms-time-overlay",e.panelClass]),onClose:()=>{var T;O=null,te=null,he(),(T=e.onClose)==null||T.call(e)}}),e.panelStyle&&Object.assign(O.panel.style,e.panelStyle),Ke(O),L(),he(),(p=e.onOpen)==null||p.call(e)),O}function k(){if(!O)return;const M=O;nt(M,()=>CMSwift.overlay.close(M.id))}return X.addEventListener("focus",M=>{var x;(x=e.onFocus)==null||x.call(e,M),e.openOnFocus!==!1&&Y()}),X.addEventListener("click",M=>{var x;(x=e.onClick)==null||x.call(e,M),Y()}),X.addEventListener("keydown",M=>{if(M.key==="Escape"){O&&(M.preventDefault(),k());return}(M.key==="ArrowDown"||M.key==="Enter"||M.key===" ")&&(M.preventDefault(),Y()),(M.key==="Backspace"||M.key==="Delete")&&!n(e.manualInput)&&n(e.clearable)!==!1&&(M.preventDefault(),me(null,M,{commit:!0}))}),n(e.manualInput)?(X.addEventListener("input",M=>{var x;return(x=e.onTyping)==null?void 0:x.call(e,X.value,M)}),X.addEventListener("change",M=>me(X.value,M)),X.addEventListener("blur",M=>{var x;(x=e.onBlur)==null||x.call(e,M),X.value===""?me(null,M):me(X.value,M)})):X.addEventListener("blur",M=>{var x;return(x=e.onBlur)==null?void 0:x.call(e,M)}),b&&b.watch(M=>{const x=De(F(M));be(x)!==be(ce)&&(ce=De(x),ie=De(x),he(),y())},"UI.Time:watch"),CMSwift.reactive.effect(()=>{!b&&e.value!=null&&(ce=De(F(n(e.value))),ie=De(ce)),he(),y(),O&&n(e.disabled)&&k()},"UI.Time:render"),ye._input=X,ye._time=X,ye._open=Y,ye._close=k,ye._getValue=()=>R(ce),ye._setValue=M=>me(M,null,{emit:!1,commit:!0}),ye._panel=()=>(O==null?void 0:O.panel)||null,ye},(Js=CMSwift.isDev)!=null&&Js.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Time={signature:"UI.Time(props)",props:{value:"string|Date",model:"rod | [get,set] signal",min:"string",max:"string",minuteStep:"number",secondStep:"number",withSeconds:"boolean",manualInput:"boolean",clearable:"boolean",confirm:"boolean",label:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",pointIcon:"String|Node|Function|Array",shortcuts:"Array<{ label, value }>",name:"string",class:"string",style:"object"},slots:{option:"Renderer per opzione oraria ({ part, value, label, selected, timeValue })",point:"Punto/icona nella time option selezionata",shortcut:"Renderer scorciatoia",value:"Footer value renderer ({ value, displayValue })",label:"Floating label",topLabel:"Top label",icon:"Left icon",iconRight:"Right icon",default:"Fallback value content"},events:{onChange:"(value, event)",onInput:"(value, event)",onOpen:"void",onClose:"void"},returns:"HTMLDivElement (field wrapper) con ._input, ._open(), ._close(), ._getValue(), ._setValue(value)",description:"Time picker reattivo con overlay fixed, label/icon slots, point icon, shortcuts, confirm e model."}),C.Tabs=(...t)=>{var N,w,le,Ne,se,fe;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=(P,ve)=>!!P&&Object.prototype.hasOwnProperty.call(P,ve),f=P=>String(n(P)||"horizontal").toLowerCase()==="vertical"?"vertical":"horizontal",c=P=>{const ve=String(n(P)||"").toLowerCase();return ve==="pills"||ve==="pill"?"pills":ve==="soft"||ve==="card"?"soft":"line"},d=P=>{var xe;const ve=n(P);return ve==null||ve===""?null:(xe=CMSwift.uiColors)!=null&&xe.includes(ve)?`var(--cms-${ve})`:String(ve)},h=(P,ve)=>Object.is(P,ve)||P!=null&&ve!=null&&P==ve,b=de(e.model,"UI.Tabs:model"),$=f(e.orientation||e.orient||e.direction),F=c(e.variant||(e.pills?"pills":e.soft?"soft":"line")),D=!!n((w=(N=e.fill)!=null?N:e.navFill)!=null?w:e.stretch),R=!!n(e.wrap),be=!!n(e.disabled),ce=e.id||"cms-tabs-"+Math.random().toString(36).slice(2,9),ie=n((le=e.tabs)!=null?le:e.items)||[],O=(Array.isArray(ie)?ie:[ie]).map((P,ve)=>{var Ce,Re,J,B,G,q,Le,Z,Ve,je,$e,et,j,Me;if(P==null)return null;if(typeof P!="object")return{raw:P,index:ve,value:P,labelFallback:P,noteFallback:null,iconFallback:null,badgeFallback:null,disabled:!1,hidden:!1};const xe=(q=(G=(B=(J=(Re=(Ce=P.value)!=null?Ce:P.name)!=null?Re:P.id)!=null?J:P.key)!=null?B:P.label)!=null?G:P.title)!=null?q:`tab-${ve}`,Oe=(je=(Ve=(Z=(Le=P.label)!=null?Le:P.title)!=null?Z:P.name)!=null?Ve:P.value)!=null?je:`Tab ${ve+1}`,ze=i(P,"badge")?P.badge:i(P,"counter")?P.counter:null;return{...P,raw:P,index:ve,value:xe,labelFallback:Oe,noteFallback:(j=(et=($e=P.note)!=null?$e:P.subtitle)!=null?et:P.description)!=null?j:null,iconFallback:(Me=P.icon)!=null?Me:null,badgeFallback:ze}}).filter(Boolean).filter(P=>P.hidden!==!0&&P.visible!==!1),te=O.find(P=>!P.disabled)||null,X=P=>O.findIndex(ve=>h(ve.value,P)),U=(P,ve)=>{var Oe;if(!O.length)return-1;let xe=P;for(let ze=0;ze<O.length;ze+=1)if(xe+=ve,xe<0?xe=O.length-1:xe>=O.length&&(xe=0),!((Oe=O[xe])!=null&&Oe.disabled))return xe;return-1},Ae=(P,ve=!1)=>{var Oe,ze;const xe=X(P);return xe>=0&&!((Oe=O[xe])!=null&&Oe.disabled)?O[xe].value:ve?(ze=te==null?void 0:te.value)!=null?ze:null:P!=null?P:null},ye=Ae(b?b.get():i(e,"value")?n(e.value):(Ne=e.defaultValue)!=null?Ne:e.default,!0),[pe,we]=CMSwift.reactive.signal(ye),he=l(["cms-clear-set","cms-tabs","cms-singularity",$,`variant-${F}`,a(e.dense,"dense"),a(D,"fill"),a(R,"wrap"),a(be,"disabled"),e.class]),me=CMSwift.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"]);me.class=he,me.style={...e.style||{}},e.gap!=null&&(me.style["--cms-tabs-gap"]=K(e.gap)),e.tabGap!=null&&(me.style["--cms-tabs-tab-gap"]=K(e.tabGap));const Q=d((se=e.color)!=null?se:e.state);Q&&(me.style["--cms-tabs-accent"]=Q);const L=_.div(me),z=_.div({class:l(["cms-tabs-bar",e.barClass]),style:{alignItems:e.align||($==="vertical"?"stretch":"center"),justifyContent:e.justify||"flex-start",...e.barStyle||{}}}),H=_.div({class:l(["cms-tabs-nav",e.navClass]),style:e.navStyle||null,role:"tablist","aria-orientation":$}),y=[],Y=()=>X(pe()),k=()=>{const P=Y();return P>=0?O[P]:null},v=()=>({tabs:O,value:pe(),active:pe(),activeIndex:Y(),activeTab:k(),orientation:$,variant:F,select:(P,ve)=>T(P,{event:ve,emit:!0}),next:()=>ne(),prev:()=>re()}),M=(P,ve,xe)=>({...v(),tab:P,index:ve,active:xe,disabled:!!P.disabled,select:Oe=>V(ve,{event:Oe,emit:!0})}),x=P=>{var xe;const ve=(xe=y[P])==null?void 0:xe.btn;!ve||typeof ve.focus!="function"||requestAnimationFrame(()=>ve.focus())},g=P=>{const ve=X(P);L.dataset.value=P==null?"":String(P),L.dataset.activeIndex=ve>=0?String(ve):"",y.forEach(({btn:xe,item:Oe,tab:ze,index:Ce})=>{const Re=Ce===ve;Oe.classList.toggle("active",Re),Oe.classList.toggle("disabled",!!(ze.disabled||be)),xe.classList.toggle("active",Re),xe.setAttribute("aria-selected",Re?"true":"false"),xe.setAttribute("tabindex",Re?"0":"-1")})},p=P=>{we(P),g(P)},T=(P,ve={})=>{if(be)return null;const xe=X(P);return xe<0?null:V(xe,ve)},V=(P,ve={})=>{var Re,J;const xe=O[P];if(!xe||xe.disabled||be)return null;const Oe=xe.value,ze=pe(),Ce=!h(ze,Oe);return p(Oe),b&&!h(b.get(),Oe)&&b.set(Oe),ve.focus&&x(P),ve.event&&((Re=xe.onClick)==null||Re.call(xe,Oe,ve.event,xe,P)),Ce&&ve.emit!==!1&&((J=e.onChange)==null||J.call(e,Oe,xe,ve.event||null,P)),xe},ne=()=>{const P=U(Y()<0?-1:Y(),1);P>=0&&V(P,{emit:!0,focus:!0})},re=()=>{const P=Y()<0?0:Y(),ve=U(P,-1);ve>=0&&V(ve,{emit:!0,focus:!0})},ke=(P,ve)=>{var et,j,Me,We,Ue,Qe;const xe=ve===Y(),Oe=M(P,ve,xe),ze=`${ce}-tab-${ve}`,Ce=P.iconFallback!=null?typeof P.iconFallback=="string"?C.Icon({name:P.iconFallback,size:(Me=(j=(et=P.iconSize)!=null?et:P.size)!=null?j:e.size)!=null?Me:null}):P.iconFallback:null,Re=E(o,"icon",Oe,Ce),J=E(null,"default",{},CMSwift.ui.renderSlot(o,"label",Oe,P.labelFallback)),B=E(o,"note",Oe,P.noteFallback),G=E(o,"badge",Oe,P.badgeFallback),q=_.span({class:"cms-tabs-tab-inner"},Re.length?_.span({class:"cms-tabs-tab-icon"},...Re):null,_.span({class:"cms-tabs-tab-copy"},_.span({class:"cms-tabs-tab-label"},...J.length?J:[""]),B.length?_.span({class:"cms-tabs-tab-note"},...B):null),G.length?_.span({class:"cms-tabs-tab-badge"},...G):null),Le=E(o,"tab",{...Oe,tabId:ze,label:J,icon:Re,note:B,badge:G},q),Z=st=>{var It;if(P.disabled||be)return;const dt=st.key;if(dt==="Enter"||dt===" "){st.preventDefault(),V(ve,{event:st,emit:!0});return}if(dt==="Home"){st.preventDefault();const ft=O.findIndex(Mt=>!Mt.disabled);ft>=0&&V(ft,{event:st,emit:!0,focus:!0});return}if(dt==="End"){st.preventDefault();let ft=-1;for(let Mt=O.length-1;Mt>=0;Mt-=1)if(!((It=O[Mt])!=null&&It.disabled)){ft=Mt;break}ft>=0&&V(ft,{event:st,emit:!0,focus:!0});return}const At=$==="vertical"?["ArrowUp"]:["ArrowLeft"],pt=$==="vertical"?["ArrowDown"]:["ArrowRight"];if(At.includes(dt)){st.preventDefault();const ft=U(ve,-1);ft>=0&&V(ft,{event:st,emit:!0,focus:!0});return}if(pt.includes(dt)){st.preventDefault();const ft=U(ve,1);ft>=0&&V(ft,{event:st,emit:!0,focus:!0})}},Ve=d((We=P.color)!=null?We:P.state),je=_.div({class:l(["cms-tabs-item",a(xe,"active"),a(P.disabled||be,"disabled"),e.itemClass,P.itemClass]),style:{...Ve?{"--cms-tabs-item-accent":Ve}:{},...e.itemStyle||{},...P.itemStyle||{}},"data-name":String(P.value)}),$e=C.Btn({class:l(["cms-tabs-tab",a(xe,"active"),a(P.disabled||be,"disabled"),e.tabClass,P.tabClass||P.class]),type:"button",id:ze,role:"tab",disabled:!!(P.disabled||be),"aria-selected":xe?"true":"false",tabindex:xe?"0":"-1",size:(Qe=(Ue=P.size)!=null?Ue:e.size)!=null?Qe:null,style:{...e.tabStyle||{},...P.tabStyle||{}},onClick:st=>{V(ve,{event:st,emit:!0})},onKeydown:Z},...Le);return je.appendChild($e),je.appendChild(_.span({class:"tab-indicator"})),y[ve]={tab:P,index:ve,item:je,btn:$e},je};if(O.length){const P=O.map((xe,Oe)=>ke(xe,Oe)),ve=CMSwift.ui.renderSlot(o,"nav",{...v(),nodes:P},P);E(null,"default",{},ve).forEach(xe=>H.appendChild(xe))}else E(o,"empty",v(),(fe=e.empty)!=null?fe:_.div({class:"cms-tabs-empty"},"Nessuna tab disponibile.")).forEach(P=>H.appendChild(P));const I=v(),u=[...E(null,"default",{},CMSwift.ui.renderSlot(o,"extra",I,null)),...E(o,"default",I,s)];return z.appendChild(H),u.length&&z.appendChild(_.div({class:"cms-tabs-extra"},...u)),L.appendChild(z),p(ye),b?b.watch(P=>{p(Ae(P,!0))},"UI.Tabs:watch"):S(e.value)&&ot.reactive.effect(()=>{p(Ae(n(e.value),!0))},"UI.Tabs:value"),L._getValue=()=>pe(),L._setValue=P=>T(P,{emit:!0}),L._select=P=>T(P,{emit:!0}),L._next=()=>ne(),L._prev=()=>re(),L._getTabs=()=>O.slice(),wt(L,e),L},(Qs=CMSwift.isDev)!=null&&Qs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Tabs={signature:"UI.Tabs(props) | UI.Tabs(props, ...children)",props:{tabs:"Array<{ value|name|id|key, label|title, note|subtitle|description, icon, badge|counter, disabled, hidden, onClick }>",items:"Alias di tabs",value:"any",defaultValue:"any",default:"Alias di defaultValue",model:"[get,set] signal",orientation:"horizontal|vertical",variant:"line|pills|soft",fill:"boolean",wrap:"boolean",disabled:"boolean",color:"string",state:"string",gap:"string|number",tabGap:"string|number",align:"string",justify:"string",size:"string|number",dense:"boolean",navClass:"string",tabClass:"string",itemClass:"string",slots:"{ nav?, tab?, label?, icon?, note?, badge?, extra?, empty?, default? }",class:"string",style:"object"},slots:{nav:"Renderer della nav completa",tab:"Renderer del singolo tab",label:"Renderer della label",icon:"Renderer dell'icona",note:"Renderer della nota",badge:"Renderer del badge/counter",extra:"Area extra accanto alla nav",empty:"Fallback quando tabs/items e vuoto",default:"Children / extra content fallback"},events:{onChange:"(value, tab, event, index)"},keyboard:["Enter/Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],returns:"HTMLDivElement con ._getValue(), ._setValue(value), ._select(value), ._next(), ._prev(), ._getTabs()",description:"Tab bar standardizzata con supporto controlled/uncontrolled, slot strutturati, badge/note/icon e navigazione tastiera."}),C.RouteTab=(...t)=>{var x,g,p,T,V,ne,re,ke,I,u,N,w,le,Ne,se;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=CMSwift.router||(ot==null?void 0:ot.router)||null,f=fe=>Object.prototype.hasOwnProperty.call(e,fe),c=f("active")||f("selected"),d=fe=>{const P=String(n(fe)||"").toLowerCase();return P==="pill"||P==="pills"?"pills":P==="soft"||P==="card"?"soft":"line"},h=fe=>{var ve;const P=n(fe);return P==null||P===""?null:(ve=CMSwift.uiColors)!=null&&ve.includes(P)?`var(--cms-${P})`:String(P)},b=fe=>{if(fe==null||fe==="")return"";try{return new URL(String(fe),window.location.origin).pathname||""}catch(P){return String(fe).split(/[?#]/)[0]||""}},$=fe=>n(e.external)===!0?!0:fe?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(fe)):!1,F=()=>{var fe;return n((fe=e.href)!=null?fe:e.to)||"#"},D=()=>{var fe;return n((fe=e.to)!=null?fe:e.href)||""},R=()=>{try{if(i!=null&&i.current)return i.current().pathname||window.location.pathname||""}catch(fe){}return window.location.pathname||""},be=()=>{var Ce,Re,J;const fe=D();if(!fe)return!1;const P=n((Re=(Ce=e.match)!=null?Ce:e.activeMatch)!=null?Re:e.routeMatch),ve=String(n((J=e.matchMode)!=null?J:e.startsWith?"startsWith":e.exact?"exact":"")||"").toLowerCase(),xe=R();if(typeof P=="function")return!!P({currentPath:xe,to:fe,href:F(),router:i,props:e});if(P instanceof RegExp)return P.test(xe);const Oe=b(typeof P=="string"&&!["exact","startsWith","prefix","section"].includes(P.toLowerCase())?P:fe);if(!Oe)return!1;const ze=ve||(typeof P=="string"&&["startsWith","prefix","section"].includes(P.toLowerCase())?"startsWith":"exact");return ze==="startswith"||ze==="prefix"||ze==="section"?xe===Oe||xe.startsWith(`${Oe}/`):i!=null&&i.isActive?!!i.isActive(fe):xe===Oe},ce=()=>!!n(e.disabled);let ie=null;const O=()=>{var fe;return ie!=null?!!ie:c?!!n((fe=e.active)!=null?fe:e.selected):be()},te=d(e.variant||(e.pills?"pills":e.soft?"soft":"line")),X=!n(e.color)&&n(e.state)?Rt(n(e.state)):"",U=X?`cms-state-${X}`:"",Ae=CMSwift.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"]);Ae.href=F(),Ae.class=l(["cms-route-tab","cms-clear-set","cms-singularity",`variant-${te}`,a((x=e.block)!=null?x:e.fill,"block"),a(e.dense,"dense"),U,e.class]),Ae.style={...e.style||{}};const ye=h((g=e.color)!=null?g:e.state);ye&&(Ae.style["--cms-route-tab-accent"]=ye);const pe=(T=(p=e.iconSize)!=null?p:e.size)!=null?T:null,we=(fe,P)=>{const ve=n(fe);return ve==null||ve===!1||ve===""?null:typeof ve=="string"?C.Icon({name:ve,size:pe}):CMSwift.ui.slot(ve,{as:P})},he=()=>({active:O(),disabled:ce(),href:F(),to:D(),external:$(F()),navigate:fe=>{var xe,Oe;if(ce())return!1;const P=D();return!$(F())&&P&&(i!=null&&i.navigate)?(fe!=null&&fe.preventDefault&&fe.preventDefault(),i.navigate(P),(xe=e.onNavigate)==null||xe.call(e,P,fe||null),!0):((Oe=e.onNavigate)==null||Oe.call(e,P||F(),fe||null),!1)}}),me=E(o,"icon",he(),we(e.icon,"icon")),Q=E(o,"label",he(),(re=(ne=(V=e.label)!=null?V:e.title)!=null?ne:e.text)!=null?re:s),L=E(o,"note",he(),(u=(I=(ke=e.note)!=null?ke:e.subtitle)!=null?I:e.caption)!=null?u:e.description),z=E(o,"badge",he(),(w=(N=e.badge)!=null?N:e.counter)!=null?w:e.count),H=E(o,"aside",he(),(Ne=(le=e.aside)!=null?le:e.trailing)!=null?Ne:we(e.iconRight,"iconRight")),y=E(o,"default",he(),(se=e.content)!=null?se:e.body),Y=_.span({class:"cms-route-tab-inner"},me.length?_.span({class:"cms-route-tab-icon"},...me):null,_.span({class:"cms-route-tab-copy"},_.span({class:"cms-route-tab-label"},...Q.length?Q:[D()||F()||""]),L.length?_.span({class:"cms-route-tab-note"},...L):null,y.length?_.span({class:"cms-route-tab-extra"},...y):null),z.length?_.span({class:"cms-route-tab-badge"},...z):null,H.length?_.span({class:"cms-route-tab-aside"},...H):null),k=_.a(Ae,Y);wt(k,e);const v=()=>{const fe=O(),P=ce(),ve=F(),xe=$(ve);k.classList.toggle("active",fe),k.classList.toggle("is-disabled",P),k.classList.toggle("is-external",xe),fe?k.setAttribute("aria-current",String(n(e.ariaCurrent)||"page")):k.removeAttribute("aria-current"),k.setAttribute("href",ve||"#"),P?(k.setAttribute("aria-disabled","true"),k.tabIndex=-1):(k.removeAttribute("aria-disabled"),!f("tabIndex")&&!f("tabindex")&&k.removeAttribute("tabindex")),D()?k.dataset.to=String(D()):delete k.dataset.to,xe&&k.target==="_blank"&&!k.rel&&(k.rel="noopener noreferrer")},M=e.onClick;return k.onclick=fe=>{if(M==null||M(fe),!fe.defaultPrevented){if(ce()){fe.preventDefault();return}he().navigate(fe)}},!c&&D()&&(i!=null&&i.subscribe)&&i.subscribe(()=>v()),CMSwift.reactive.effect(()=>{v()},"UI.RouteTab:render"),k._isActive=()=>O(),k._setActive=fe=>(ie=fe==null?null:!!fe,v(),k),k._navigate=fe=>he().navigate(fe),k},(Zs=CMSwift.isDev)!=null&&Zs.call(CMSwift)&&(C.meta=C.meta||{},C.meta.RouteTab={signature:"UI.RouteTab(...children) | UI.RouteTab(props, ...children)",props:{label:"String|Node|Function|Array",to:"string",href:"string",active:"boolean",selected:"Alias di active",match:'"exact"|"startsWith"|RegExp|Function|string',matchMode:'"exact"|"startsWith"',exact:"boolean",startsWith:"boolean",note:"String|Node|Function|Array",badge:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",aside:"Node|Function|Array",variant:'"line"|"pills"|"soft"',disabled:"boolean",block:"boolean",state:"string",color:"string",slots:"{ icon?, label?, note?, badge?, aside?, default? }",class:"string",style:"object"},slots:{icon:"Leading icon content",label:"Main label content",note:"Secondary note/caption",badge:"Badge / counter area",aside:"Trailing visual/action area",default:"Extra content under the note"},events:{onClick:"MouseEvent",onNavigate:"(to, event)"},returns:"HTMLAnchorElement con ._isActive(), ._setActive(boolean|null), ._navigate(event?)",description:"Tab/link standardizzato per navigazione router o href, con slot strutturati, stati e badge."}),C.Breadcrumbs=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=CMSwift.router||(ot==null?void 0:ot.router)||null,f=de(e.model,"UI.Breadcrumbs:model"),c=ee(e.size,()=>{var L;const Q=n(e.size);return typeof Q=="string"&&((L=CMSwift.uiSizes)!=null&&L.includes(Q))?`cms-size-${Q}`:""}),d=ee(e.variant,()=>{const Q=String(n(e.variant||(e.pills?"pills":e.soft?"soft":"line"))||"").toLowerCase();return Q==="pill"||Q==="pills"?"variant-pills":Q==="soft"||Q==="card"?"variant-soft":"variant-line"}),h=ee([e.wrap,e.nowrap],()=>n(e.wrap)===!1||n(e.nowrap)?"no-wrap":""),b=_.nav({class:l(["cms-breadcrumbs","cms-clear-set",c,d,h,a(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),$=_.div({class:"cms-breadcrumbs-before"}),F=_.ol({class:"cms-breadcrumbs-list"}),D=_.div({class:"cms-breadcrumbs-after"});b.appendChild($),b.appendChild(F),b.appendChild(D);const R=Q=>{var z;const L=n(Q);return L==null||L===""?null:(z=CMSwift.uiColors)!=null&&z.includes(L)?`var(--cms-${L})`:String(L)},be=Q=>{var z;if(!Q)return!1;if(n(Q.external)===!0)return!0;const L=n((z=Q.href)!=null?z:Q.to);return L?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(L)):!1},ce=Q=>Q!=null&&Q.nodeType&&Q.cloneNode?Q.cloneNode(!0):Q,ie=(Q,L)=>{Q.innerHTML="",L.forEach(z=>Q.appendChild(z))},O=(Q,L,z,H,y=null)=>{const Y=CMSwift.ui.getSlot(Q,L)!=null?E(Q,L,z,H):[];return Y.length?Y:y&&CMSwift.ui.getSlot(Q,y)!=null?E(Q,y,z,H):E(null,"default",z,H)},te=(Q,L,z)=>{const H=n(Q);return H==null||H===!1||H===""?null:typeof H=="string"?C.Icon({name:H,size:L}):CMSwift.ui.slot(H,{as:z})},X=()=>{var y,Y;const Q=f?f.get():n((Y=(y=e.items)!=null?y:e.value)!=null?Y:e.breadcrumbs),L=[],z=k=>{if(!(k==null||k===!1)){if(Array.isArray(k)){k.forEach(z);return}if(typeof k=="string"||typeof k=="number"){L.push({label:String(k)});return}if(k!=null&&k.nodeType||typeof k=="function"){L.push({label:k});return}L.push(k)}},H=n(e.home);return H&&z(H===!0?{label:"Home",to:"/",icon:"home"}:H),z(Q),!L.length&&(s!=null&&s.length)&&s.forEach(k=>z(k)),L.filter(k=>!n(k==null?void 0:k.hidden))},U=Q=>{const L=Q.findIndex(z=>{var H,y;return!!n((y=(H=z==null?void 0:z.current)!=null?H:z==null?void 0:z.active)!=null?y:z==null?void 0:z.selected)});return L>-1?L:n(e.autoCurrent)===!1?-1:Q.length?Q.length-1:-1},Ae=Q=>{var v,M,x,g,p,T,V;const L=Number(n((x=(M=(v=e.max)!=null?v:e.maxItems)!=null?M:e.collapseAfter)!=null?x:e.collapse)),z=Number.isFinite(L)?Math.max(0,Math.trunc(L)):0;if(!z||z<3||Q.length<=z)return Q.map((ne,re)=>({type:"item",item:ne,index:re,key:`item-${re}`}));let H=Number(n((p=(g=e.leadingCount)!=null?g:e.keepStart)!=null?p:1)),y=Number(n((V=(T=e.trailingCount)!=null?T:e.keepEnd)!=null?V:Math.max(1,z-2)));if(H=Number.isFinite(H)?Math.max(1,Math.trunc(H)):1,y=Number.isFinite(y)?Math.max(1,Math.trunc(y)):Math.max(1,z-2),H+y+1>z&&(y=Math.max(1,z-H-1),H+y+1>z&&(H=Math.max(1,z-y-1))),H+y>=Q.length)return Q.map((ne,re)=>({type:"item",item:ne,index:re,key:`item-${re}`}));const Y=[];for(let ne=0;ne<H;ne++)Y.push({type:"item",item:Q[ne],index:ne,key:`item-${ne}`});const k=Q.slice(H,Q.length-y);Y.push({type:"collapsed",key:`collapsed-${H}-${Q.length-y}`,items:k,from:H,to:Q.length-y-1});for(let ne=Q.length-y;ne<Q.length;ne++)Y.push({type:"item",item:Q[ne],index:ne,key:`item-${ne}`});return Y},ye=(Q,L=null)=>{var y,Y,k,v,M;if(!Q)return!1;const z=n((y=Q.href)!=null?y:Q.to)||"",H=n(Q.to)||"";return!be(Q)&&H&&(i!=null&&i.navigate)?(L!=null&&L.preventDefault&&L.preventDefault(),i.navigate(H),(Y=Q.onNavigate)==null||Y.call(Q,H,L||null),(k=e.onNavigate)==null||k.call(e,H,Q,L||null),!0):((v=Q.onNavigate)==null||v.call(Q,H||z,L||null),(M=e.onNavigate)==null||M.call(e,H||z,Q,L||null),!1)},pe=(Q,L,z)=>{var M,x,g;const H=Q,y=z[L+1]||null,Y={index:L,entry:Q,previous:H,next:y},k=ce(n((g=(x=(Q==null?void 0:Q.type)==="item"?(M=Q.item)==null?void 0:M.separator:null)!=null?x:e.separator)!=null?g:"/")),v=O(o,"separator",Y,k);return _.li({class:"cms-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"cms-breadcrumbs-separator"},...v))},we=(Q,L,z)=>{const H={type:"collapsed",collapsed:!0,items:L,hiddenItems:Q.items,currentIndex:z,from:Q.from,to:Q.to},y=_.span({class:"cms-breadcrumb cms-breadcrumb-collapsed"},_.span({class:"cms-breadcrumb-inner"},_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},String(n(e.collapsedLabel)||"\u2026"))))),Y=O(o,"collapsed",H,y,"item");return _.li({class:"cms-breadcrumbs-entry is-collapsed"},...Y)},he=(Q,L,z,H)=>{var Ce,Re,J,B,G,q,Le,Z,Ve,je,$e,et,j,Me,We,Ue,Qe,st,dt,At,pt,It,ft,Mt,Ot,Gt;const y=Q.item||{},Y=y.slots?{...o,...y.slots}:o,k=n((Ce=y.href)!=null?Ce:y.to)||"",v=!!n(y.disabled),M=Q.index===z,x=(B=(J=(Re=y.iconSize)!=null?Re:e.itemSize)!=null?J:e.size)!=null?B:null,g=R((Le=(q=(G=y.color)!=null?G:y.state)!=null?q:e.color)!=null?Le:e.state),p=!n(y.color)&&n(y.state)?Rt(n(y.state)):"",T=(et=($e=(je=(Ve=(Z=y.label)!=null?Z:y.title)!=null?Ve:y.text)!=null?je:y.to)!=null?$e:y.href)!=null?et:"",V=(We=(Me=(j=y.note)!=null?j:y.subtitle)!=null?Me:y.caption)!=null?We:y.description,ne=(Qe=(Ue=y.badge)!=null?Ue:y.counter)!=null?Qe:y.count,re=(dt=(st=y.aside)!=null?st:y.trailing)!=null?dt:te(y.iconRight,x,"iconRight"),ke=(At=y.content)!=null?At:y.body,I={item:y,index:Q.index,visibleIndex:H,total:L.length,current:M,active:M,disabled:v,href:k,to:n(y.to)||"",external:be(y),isFirst:Q.index===0,isLast:Q.index===L.length-1,navigate:Je=>ye(y,Je)},u=O(Y,"icon",I,te(y.icon,x,"icon")),N=O(Y,"label",I,T),w=O(Y,"note",I,V),le=O(Y,"badge",I,ne),Ne=O(Y,"aside",I,re),se=O(Y,"default",I,ke),fe=_.span({class:"cms-breadcrumb-inner"},u.length?_.span({class:"cms-breadcrumb-icon"},...u):null,_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},...N.length?N:[k||""]),w.length?_.span({class:"cms-breadcrumb-note"},...w):null,se.length?_.span({class:"cms-breadcrumb-extra"},...se):null),le.length?_.span({class:"cms-breadcrumb-badge"},...le):null,Ne.length?_.span({class:"cms-breadcrumb-aside"},...Ne):null),P=!v&&(!M||!!n((pt=y.linkCurrent)!=null?pt:e.linkCurrent)),ve={class:l(["cms-breadcrumb","cms-clear-set","cms-singularity",a(M,"is-current"),a(M,"active"),a(v,"is-disabled"),p?`cms-state-${p}`:"",y.class]),style:{...y.style||{}},"aria-current":M?String(n((It=y.ariaCurrent)!=null?It:e.ariaCurrent)||"page"):null};g&&(ve.style["--cms-breadcrumb-accent"]=g);let xe=null;P&&k?(xe=_.a({...ve,href:k,target:y.target,rel:y.rel,onClick:Je=>{var Ct,_t;(Ct=y.onClick)==null||Ct.call(y,Je,I),(_t=e.onItemClick)==null||_t.call(e,y,I,Je),!Je.defaultPrevented&&I.navigate(Je)}},fe),I.external&&xe.target==="_blank"&&!xe.rel&&(xe.rel="noopener noreferrer")):P&&typeof y.onClick=="function"?xe=_.button({...ve,type:y.type||"button",onClick:Je=>{var Ct,_t;(Ct=y.onClick)==null||Ct.call(y,Je,I),(_t=e.onItemClick)==null||_t.call(e,y,I,Je)}},fe):xe=_.span({...ve,"aria-disabled":v?"true":null},fe),wt(xe,{size:(Mt=(ft=y.size)!=null?ft:e.itemSize)!=null?Mt:e.size,radius:(Ot=y.radius)!=null?Ot:e.radius,gradient:(Gt=y.gradient)!=null?Gt:e.gradient});const ze=O(Y,"item",I,xe);return _.li({class:l(["cms-breadcrumbs-entry",a(M,"is-current"),a(v,"is-disabled")])},...ze)},me=()=>{var Y;const Q=X(),L=U(Q),z=Ae(Q),H=R((Y=e.color)!=null?Y:e.state);b.classList.toggle("is-empty",Q.length===0),H?b.style.setProperty("--cms-breadcrumb-accent",H):b.style.removeProperty("--cms-breadcrumb-accent");const y={items:Q,visibleItems:z,currentIndex:L,count:Q.length,collapsed:z.some(k=>k.type==="collapsed")};if(ie($,O(o,"before",y,e.before)),ie(D,O(o,"after",y,e.after)),F.innerHTML="",!Q.length){const k=O(o,"empty",y,e.empty);k.length&&F.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...k));return}z.forEach((k,v)=>{v>0&&F.appendChild(pe(z[v-1],v-1,z)),F.appendChild(k.type==="collapsed"?we(k,Q,L):he(k,Q,L,v))})};return ot.reactive.effect(()=>{me()},"UI.Breadcrumbs:render"),b.getItems=()=>X(),b.getVisibleItems=()=>Ae(X()),b.refresh=()=>(me(),b),b.setItems=Q=>(f?f.set(Q):e.items=Q,me(),b),wt(b,e),b},(ei=CMSwift.isDev)!=null&&ei.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Breadcrumbs={signature:"UI.Breadcrumbs(props)",props:{items:"Array<string|number|Node|Function|{ label?, to?, href?, icon?, note?, badge?, current?, disabled?, hidden?, slots? }>",model:"[get,set] signal|Array",home:"boolean|Object",separator:"string|Node|Function",before:"Node|Function|Array",after:"Node|Function|Array",empty:"Node|Function|Array",variant:'"line"|"pills"|"soft"',max:"number",leadingCount:"number",trailingCount:"number",dense:"boolean",wrap:"boolean",nowrap:"boolean",linkCurrent:"boolean",color:"string",state:"string",itemSize:"string|number",ariaLabel:"string",class:"string",style:"object"},slots:{before:"Content before breadcrumb list",after:"Content after breadcrumb list",item:"Full renderer for a breadcrumb entry",icon:"Leading icon for each breadcrumb",label:"Main breadcrumb label",note:"Secondary line for the breadcrumb",badge:"Badge/counter area",aside:"Trailing area",default:"Extra content under note",separator:"Separator renderer",collapsed:"Renderer for collapsed middle items",empty:"Renderer for empty state"},events:{onItemClick:"(item, ctx, event)",onNavigate:"(toOrHref, item, event)"},returns:"HTMLElement <nav> con .getItems(), .getVisibleItems(), .refresh(), .setItems(items)",description:"Breadcrumbs standardizzati con item strutturati, slot completi, collapse automatico e supporto a link/router."}),C.Pagination=(...t)=>{const{props:e}=CMSwift.uiNormalizeArgs(t),s=e.slots||{},o=de(e.model,"UI.Pagination:model"),i=ee(e.size,()=>{const g=n(e.size);return typeof g=="string"&&Bn[g]?`cms-size-${g}`:""}),f=_.nav({class:l(["cms-pagination","cms-clear-set",i,a(e.dense,"dense"),a(e.simple,"is-simple"),a(e.disabled,"is-disabled"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Pagination"}),c=_.div({class:"cms-pagination-controls"}),d=_.div({class:"cms-pagination-start"}),h=_.div({class:"cms-pagination-pages"}),b=_.div({class:"cms-pagination-end"}),$=_.div({class:"cms-pagination-summary"});c.appendChild(d),c.appendChild(h),c.appendChild(b),f.appendChild(c),f.appendChild($);let F=1,D=1;const R=(g,p=0)=>{const T=n(g);if(T==null||T==="")return p;const V=Number(T);return Number.isFinite(V)?Math.trunc(V):p},be=(g,p=ce())=>{const T=Number(g),V=Number.isFinite(T)?Math.trunc(T):1;return Math.min(Math.max(V||1,1),Math.max(1,p||1))},ce=()=>{var V,ne,re,ke,I,u,N;const g=R((re=(ne=(V=e.max)!=null?V:e.pages)!=null?ne:e.pageCount)!=null?re:e.totalPages,0);if(g>0)return g;const p=R((I=(ke=e.total)!=null?ke:e.totalItems)!=null?I:e.count,0),T=R((N=(u=e.pageSize)!=null?u:e.perPage)!=null?N:e.limit,0);return p>=0&&T>0?Math.max(1,Math.ceil(p/T)):1},ie=()=>{var g,p,T;return R(o?o.get():(T=(p=(g=e.page)!=null?g:e.value)!=null?p:e.current)!=null?T:e.currentPage,1)},O=()=>{var g,p;return Math.max(0,R((p=(g=e.siblings)!=null?g:e.siblingCount)!=null?p:e.window,1))},te=()=>{var g,p;return Math.max(0,R((p=(g=e.boundaryCount)!=null?g:e.boundaries)!=null?p:e.edges,1))},X=()=>!!n(e.disabled),U=()=>{var g;return n((g=e.showSummary)!=null?g:e.showLabel)!==!1},Ae=()=>n(e.showPages)!==!1&&!n(e.simple),ye=()=>n(e.showPrev)!==!1,pe=()=>n(e.showNext)!==!1,we=()=>!!n(e.showEdges),he=()=>{const g=n(e.showFirst);return g==null?we():!!g},me=()=>{const g=n(e.showLast);return g==null?we():!!g},Q=()=>!!n(e.hideOnSinglePage),L=()=>{var T,V;const g=n((V=(T=e.total)!=null?T:e.totalItems)!=null?V:e.count);if(g==null||g==="")return null;const p=Number(g);return Number.isFinite(p)?Math.max(0,Math.trunc(p)):null},z=()=>{var T,V;const g=n((V=(T=e.pageSize)!=null?T:e.perPage)!=null?V:e.limit);if(g==null||g==="")return null;const p=Number(g);return Number.isFinite(p)&&p>0?Math.trunc(p):null},H=(g=F,p=D)=>{const T=L(),V=z(),ne=T!=null&&V?T===0?0:(g-1)*V+1:null,re=T!=null&&V?Math.min(T,g*V):null;return{page:g,value:g,current:g,currentPage:g,pages:p,max:p,total:T,pageSize:V,from:ne,to:re,disabled:X(),isFirst:g<=1,isLast:g>=p,canPrev:g>1,canNext:g<p,setPage:(ke,I)=>x(ke,I),prev:ke=>x(g-1,ke),next:ke=>x(g+1,ke),first:ke=>x(1,ke),last:ke=>x(p,ke)}},y=(g,p)=>{if(p<=0)return[];const T=[],V=new Set,ne=te(),re=O();for(let I=1;I<=Math.min(ne,p);I++)V.add(I);for(let I=Math.max(1,g-re);I<=Math.min(p,g+re);I++)V.add(I);for(let I=Math.max(1,p-ne+1);I<=p;I++)V.add(I);let ke=0;for(let I=1;I<=p;I++)V.has(I)&&(ke&&I-ke>1&&T.push({type:"ellipsis",key:`ellipsis-${ke}-${I}`}),T.push({type:"page",page:I,key:`page-${I}`}),ke=I);return T.length||T.push({type:"page",page:1,key:"page-1"}),T},Y=(g,p,T,V=null)=>{const ne=CMSwift.ui.getSlot(s,g)!=null?E(s,g,T,p):[];return ne.length?ne:V&&CMSwift.ui.getSlot(s,V)!=null?E(s,V,T,p):E(null,"default",T,p)},k=(g,p)=>{g.innerHTML="",p.forEach(T=>g.appendChild(T))},v=(g,p,T,V={})=>{var re;const ne={...H(),kind:g,active:!!V.active};return C.Btn({class:l(["cms-pagination-btn",`cms-pagination-${g}`,a(V.active,"active"),V.class]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:V.active?e.color||e.state||"primary":V.color||null,outline:V.active?!1:(re=V.outline)!=null?re:!0,disabled:X()||!!V.disabled,"aria-current":V.active?"page":null,onClick:ke=>{X()||V.disabled||T==null||T(ke)}},...Y(g,p,ne,g==="summary"?"label":g==="page"?"item":null))},M=(g,p)=>{F=be(g,p),D=Math.max(1,p||1);const T=H(F,D);f.style.display=Q()&&D<=1?"none":"",$.style.display=U()?"":"none",h.style.display=Ae()?"":"none",d.innerHTML="",h.innerHTML="",b.innerHTML="";const V=Y("start",e.start,T);V.length&&d.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-start"},...V)),he()&&d.appendChild(v("first","\xAB",ke=>x(1,ke),{disabled:F<=1})),ye()&&d.appendChild(v("prev","Prev",ke=>x(F-1,ke),{disabled:F<=1})),Ae()&&y(F,D).forEach(ke=>{if(ke.type==="ellipsis"){const N={...T,kind:"ellipsis"},w=Y("ellipsis","\u2026",N);h.appendChild(_.span({class:"cms-pagination-ellipsis","aria-hidden":"true"},...w));return}const I=ke.page,u={...T,page:I,value:I,item:ke,active:I===F};h.appendChild(C.Btn({class:l(["cms-pagination-btn","cms-pagination-page-btn",a(I===F,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:I===F?e.color||e.state||"primary":null,outline:I!==F,disabled:X(),"aria-current":I===F?"page":null,onClick:N=>x(I,N)},...Y("page",String(I),u,"item")))}),pe()&&b.appendChild(v("next","Next",ke=>x(F+1,ke),{disabled:F>=D})),me()&&b.appendChild(v("last","\xBB",ke=>x(D,ke),{disabled:F>=D}));const ne=Y("end",e.end,T);ne.length&&b.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...ne));let re=`Pagina ${F} di ${D}`;T.total!=null&&T.pageSize&&(re=T.total===0?"0 risultati":`${T.from}-${T.to} di ${T.total}`),k($,Y("summary",re,T,"label"))},x=(g,p=null)=>{var ne,re;const T=ce(),V=be(g,T);return V===F&&T===D||(M(V,T),o&&o.get()!==V&&o.set(V),(ne=e.onChange)==null||ne.call(e,V,H(V,T),p),(re=e.onPageChange)==null||re.call(e,V,H(V,T),p)),V};return ot.reactive.effect(()=>{const g=ce(),p=ie(),T=be(p,g);M(T,g),o&&p!==T&&o.set(T)},"UI.Pagination:sync"),f.getPage=()=>F,f.getPages=()=>D,f.setPage=g=>x(g),f.prev=()=>x(F-1),f.next=()=>x(F+1),f.first=()=>x(1),f.last=()=>x(D),wt(f,e),f},(ti=CMSwift.isDev)!=null&&ti.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Pagination={signature:"UI.Pagination(props)",props:{max:"number",pages:"number",total:"number",pageSize:"number",value:"number",page:"number",model:"[get,set] signal",showPages:"boolean",showSummary:"boolean",showLabel:"boolean",showPrev:"boolean",showNext:"boolean",showFirst:"boolean",showLast:"boolean",showEdges:"boolean",siblings:"number",boundaryCount:"number",hideOnSinglePage:"boolean",size:"xxs|xs|sm|md|lg|xl|xxl|xxxl",dense:"boolean",simple:"boolean",color:"primary|secondary|warning|danger|success|info|light|dark",state:"primary|secondary|warning|danger|success|info|light|dark",slots:"{ start?, end?, first?, prev?, page?, item?, ellipsis?, next?, last?, summary?, label? }",class:"string",style:"object"},slots:{start:"Contenuto prima dei controlli",end:"Contenuto dopo i controlli",first:"First button content",prev:"Prev button content",page:"Page item content (ctx: { page, active, pages })",item:"Alias di page",ellipsis:"Ellipsis content",next:"Next button content",last:"Last button content",summary:"Summary content",label:"Alias legacy di summary"},events:{onChange:"(page, ctx, event)",onPageChange:"(page, ctx, event)"},returns:"HTMLElement <nav>",description:"Paginazione standard con controlli edge, numeri, ellissi, summary e supporto total/pageSize."}),C.Spinner=(...t)=>{var X;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=(U,Ae,ye)=>{if(S(U))return()=>{const we=n(U);if(we==null||we===!1||we==="")return ye;const he=Ae?Ae(we):we;return he==null||he===""?ye:he};if(U==null||U===!1||U==="")return ye;const pe=Ae?Ae(U):U;return pe==null||pe===""?ye:pe},f=U=>{if(U==null||U===!1||U===""||Rt(U))return"";const ye=String(U).trim();return ye?ye.startsWith("#")||ye.startsWith("rgb(")||ye.startsWith("rgba(")||ye.startsWith("hsl(")||ye.startsWith("hsla(")||ye.startsWith("var(")?ye:vn(ye)?`var(--cms-${ye})`:ye:""},c=ee(e.state,()=>{const U=Rt(n(e.state));return U?`cms-state-${U}`:""}),d=l(["cms-spinner",c,a(e.vertical,"vertical"),a(e.reverse,"reverse"),a(e.center,"center"),a(e.block,"block"),a(e.pause||e.paused,"paused"),e.class]),h=CMSwift.omit(e,["ariaLabel","block","center","color","indicatorClass","indicatorStyle","label","note","pause","paused","reverse","size","slots","speed","state","thickness","trackColor","vertical"]);h.class=d;const b={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(b,"backgroundColor")&&delete b.backgroundColor,h.style=b,h.role==null&&(h.role="status"),h["aria-live"]==null&&(h["aria-live"]="polite"),h["aria-busy"]==null&&(h["aria-busy"]="true");const $={props:e},F=E(o,"label",$,e.label),D=E(o,"default",$,s),R=E(o,"note",$,e.note),be=F.length||D.length||R.length;if(!be){const U=n((X=e.ariaLabel)!=null?X:e["aria-label"]);U?h["aria-label"]=U:h["aria-label"]==null&&(h["aria-label"]="Loading")}const ce=_.span({class:l(["cms-spinner-indicator",e.indicatorClass]),style:{"--cms-spinner-size":i(e.size,K,"18px"),"--cms-spinner-thickness":i(e.thickness,K,"2px"),"--cms-spinner-speed":i(e.speed,U=>typeof U=="number"?`${U}ms`:String(U),"900ms"),"--cms-spinner-color":i(e.color,f,"var(--set-border-color, var(--cms-primary))"),"--cms-spinner-track":i(e.trackColor,f,"color-mix(in srgb, var(--cms-spinner-color) 18%, transparent)"),...e.indicatorStyle||{}},"aria-hidden":"true"}),ie=E(o,"indicator",$,ce),O=[];ie.length&&O.push(...ie),be&&O.push(_.div({class:"cms-spinner-content"},F.length?_.div({class:"cms-spinner-label"},...F):null,D.length?_.div({class:"cms-spinner-copy"},...D):null,R.length?_.div({class:"cms-spinner-note"},...R):null));const te=_.div(h,...O);return wt(te,e),te},(ni=CMSwift.isDev)!=null&&ni.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Spinner={signature:"UI.Spinner(...children) | UI.Spinner(props, ...children)",props:{size:"number|string",color:"string",thickness:"number|string",trackColor:"string",speed:"number|string",state:"primary|secondary|success|warning|danger|info|light|dark",label:"String|Node|Function|Array",note:"String|Node|Function|Array",vertical:"boolean",reverse:"boolean",center:"boolean",block:"boolean",pause:"boolean",paused:"boolean",ariaLabel:"string",indicatorClass:"string",indicatorStyle:"object",slots:"{ indicator?, label?, note?, default? }",class:"string",style:"object"},slots:{indicator:"Custom spinner indicator",label:"Primary label/content near the spinner",note:"Secondary supporting text",default:"Extra content rendered near the spinner"},returns:"HTMLDivElement",description:"Spinner animato con layout flessibile, contenuti opzionali e controllo di dimensioni, velocita e traccia."}),C.Progress=(...t)=>{var w,le,Ne,se,fe,P,ve,xe,Oe,ze;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=e.model||(Zt(e.value)||r(e.value)?e.value:null),f=de(i,"UI.Progress:model"),c=ee([e.state,e.color],()=>{const Ce=Rt(n(e.state)||n(e.color));return Ce?`cms-state-${Ce}`:""}),d=(Ce,Re)=>{const J=Number(Ce);return Number.isFinite(J)?J:Re},h=()=>d(n(e.min),0),b=()=>{const Ce=h(),Re=d(n(e.max),100);return Re<Ce?Ce:Re},$=()=>{var Re,J;const Ce=n((J=(Re=e.height)!=null?Re:e.thickness)!=null?J:e.size);return Ce==null||Ce===""?"8px":typeof Ce=="number"?`${Ce}px`:typeof Ce=="string"?{xxs:"4px",xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px",xxl:"16px",xxxl:"18px"}[Ce]||Ce:"8px"},F=(Ce,Re="")=>{const J=n(Ce);if(J==null||J===!1||J==="")return Re;const B=Rt(J);return B?`var(--cms-${B})`:typeof J=="string"&&vn(J)?`var(--cms-${J})`:String(J)},D=Ce=>{const Re=h(),J=b(),B=d(Ce,Re);return Math.min(J,Math.max(Re,B))},R=Ce=>{const Re=h(),B=b()-Re;if(!B)return 0;const G=(D(Ce)-Re)/B,q=n(e.reverse)?1-G:G;return Math.max(0,Math.min(1,q))},be=Ce=>{const Re=D(Ce);return Re<Ae()?Ae():Re},ce=(Ce,Re,J)=>{const B=e.formatValue;if(typeof B=="function"){const G=B(Ce,Re,J);if(G!=null)return G}return`${Math.round(Re)}%`},ie=Ce=>{for(;Ce.firstChild;)Ce.removeChild(Ce.firstChild)},O=(Ce,Re,J="flex")=>{ie(Ce),(Re||[]).forEach(B=>{if(!(B==null||B===!1)){if(B instanceof Node){Ce.appendChild(B);return}Ce.appendChild(document.createTextNode(String(B)))}}),Ce.style.display=Ce.childNodes.length?J:"none"},te=(Ce,Re={})=>Fe(n(Ce),Re),X=(Ce,Re,J={})=>{var G;const B=n(Ce);return B==null||B===!1||B===""?[]:typeof B=="string"?[C.Icon({name:B,size:(G=e.iconSize)!=null?G:16})]:te(B,{...J,as:Re})},U=Ce=>r(Ce)||Zt(Ce)?n(Ce):typeof Ce=="function"&&Ce.length===0?Ce():Ce,[Ae,ye]=CMSwift.reactive.signal(D(f?f.get():(le=(w=n(e.value))!=null?w:n(e.min))!=null?le:0)),[pe,we]=CMSwift.reactive.signal(be((fe=n(e.buffer))!=null?fe:f?f.get():(se=(Ne=n(e.value))!=null?Ne:n(e.min))!=null?se:0)),he=(Ce,Re={})=>{const J=D(Ce);return Ae()!==J&&ye(J),pe()<J&&we(J),f&&Re.fromModel!==!0&&f.set(J),J},me=Ce=>{const Re=be(Ce);return pe()!==Re&&we(Re),Re},Q=CMSwift.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"]),L={width:n(e.width)||"100%",...e.style||{}},z=n(e.color);(z!=null||S(e.color))&&!Rt(z||"")&&delete L.backgroundColor,Q.class=l(["cms-progress-wrap",a(e.dense,"dense"),a(e.reverse,"is-reverse"),a(e.indeterminate,"is-indeterminate"),c,e.class]),Q.style=L;const H=_.div({class:"cms-progress-header"}),y=_.div({class:"cms-progress-heading"}),Y=_.div({class:"cms-progress-label"}),k=_.div({class:"cms-progress-note"}),v=_.div({class:"cms-progress-value"});y.append(Y,k),H.append(y,v);const M=_.div({class:"cms-progress-body"}),x=_.span({class:"cms-progress-edge-label cms-progress-edge-label-left"}),g=_.div({class:"cms-progress",role:"progressbar"}),p=_.span({class:"cms-progress-buffer"}),T=_.span({class:l(["cms-progress-bar","cms-singularity",c,a(e.outline,"cms-outline"),a(e.flat,"cms-flat"),a(e.border,"cms-border"),a(e.glossy,"cms-glossy"),a(e.glow,"cms-glow"),a(e.glass,"cms-glass"),a(e.shadow,"cms-shadow"),ee(e.shadow,()=>{const Ce=Xn(n(e.shadow));return Ce?`cms-shadow-${Ce}`:""}),a(e.gradient,"cms-gradient"),a(e.textGradient,"cms-text-gradient"),a(e.lightShadow,"cms-light-shadow"),a(e.striped,"is-striped"),a(e.animated||e.indeterminate,"is-animated")])}),V=_.span({class:"cms-progress-bar-label"});T.appendChild(V),g.append(p,T);const ne=_.span({class:"cms-progress-edge-label cms-progress-edge-label-right"});M.append(x,g,ne);const re=_.div(Q,H,M);wt(T,e);const ke=()=>{const Ce=Ae(),Re=R(Ce)*100,J={value:Ce,percent:Re,min:h(),max:b(),buffer:pe(),progress:re,track:g,bar:T,props:e},B=E(o,"icon",J,null),G=B.length?[]:X(e.icon,"icon",J),q=E(o,"label",J,U(e.label)),Le=q.length?q:E(o,"default",J,s),Z=E(o,"iconRight",J,null),Ve=Z.length?[]:X(e.iconRight,"iconRight",J),je=E(o,"note",J,U(e.note)),$e=e.valueLabel!=null?U(e.valueLabel):ce(Ce,Re,J),et=n(e.showValue),j=et===!0||e.valueLabel!=null||CMSwift.ui.getSlot(o,"value")!=null?E(o,"value",J,$e):[];O(Y,[...G,...B,...Le,...Ve,...Z],"inline-flex"),O(k,je,"block"),O(v,et==="inside"?[]:j,"inline-flex"),H.style.display=Y.childNodes.length||k.childNodes.length||v.childNodes.length?"flex":"none"},I=()=>{var q,Le;const Ce=Ae(),Re=R(Ce)*100,J={value:Ce,percent:Re,min:h(),max:b(),buffer:pe(),progress:re,track:g,bar:T,props:e},B=U((q=e.startLabel)!=null?q:e.leftLabel),G=U((Le=e.endLabel)!=null?Le:e.rightLabel);O(x,E(o,"startLabel",J,B),"inline-flex"),O(ne,E(o,"endLabel",J,G),"inline-flex")},u=()=>{const Ce=Ae(),Re=R(Ce)*100,J={value:Ce,percent:Re,min:h(),max:b(),buffer:pe(),progress:re,track:g,bar:T,props:e},B=n(e.showValue),G=e.insideLabel!=null?U(e.insideLabel):ce(Ce,Re,J),q=B==="inside"||e.insideLabel!=null||CMSwift.ui.getSlot(o,"inside")!=null?E(o,"inside",J,G):[];O(V,q,"inline-flex")},N=()=>{const Ce=Ae(),Re=pe(),J=h(),B=b(),G=R(Ce)*100,q=R(Re)*100,Le=F(e.color,""),Z=F(e.trackColor,Le?`color-mix(in srgb, ${Le} 14%, transparent)`:"rgba(255,255,255,0.08)"),Ve=F(e.bufferColor,Le?`color-mix(in srgb, ${Le} 30%, transparent)`:"rgba(255,255,255,0.16)"),je=n(e.ariaLabel),$e=n(e.ariaValueText),et=!!n(e.indeterminate),j=n(e.radius);re.style.width=n(e.width)||"100%",re.style.setProperty("--cms-progress-height",$()),j!=null?typeof j=="number"?re.style.setProperty("--cms-progress-radius",`${j}px`):typeof j=="string"&&CMSwift.uiSizes.includes(j)?re.style.setProperty("--cms-progress-radius",`var(--cms-r-${j})`):re.style.setProperty("--cms-progress-radius",String(j)):re.style.removeProperty("--cms-progress-radius"),g.style.background=Z,p.style.background=Ve,p.style.width=`${q}%`,Le&&!Rt(n(e.state)||n(e.color))?(T.style.setProperty("--set-background-color",Le),T.style.setProperty("--set-border-color",Le),T.style.setProperty("--set-color",n(e.textColor)||"var(--cms-on-primary, #fff)")):Rt(n(e.state)||n(e.color))?(T.style.removeProperty("--set-background-color"),T.style.removeProperty("--set-border-color"),T.style.removeProperty("--set-color")):(T.style.setProperty("--set-background-color","var(--cms-primary)"),T.style.setProperty("--set-border-color","var(--cms-primary)"),T.style.setProperty("--set-color",n(e.textColor)||"var(--cms-on-primary, #fff)")),et?(T.style.width="",g.removeAttribute("aria-valuenow"),g.removeAttribute("aria-valuemin"),g.removeAttribute("aria-valuemax")):(T.style.width=`${G}%`,g.setAttribute("aria-valuemin",String(J)),g.setAttribute("aria-valuemax",String(B)),g.setAttribute("aria-valuenow",String(Ce))),je!=null?g.setAttribute("aria-label",String(je)):typeof n(e.label)=="string"?g.setAttribute("aria-label",String(n(e.label))):g.removeAttribute("aria-label"),$e!=null?g.setAttribute("aria-valuetext",String($e)):et?g.removeAttribute("aria-valuetext"):g.setAttribute("aria-valuetext",ce(Ce,G,{value:Ce,percent:G,min:J,max:B,buffer:Re,progress:re,track:g,bar:T,props:e})),re.classList.toggle("has-start-label",x.childNodes.length>0),re.classList.toggle("has-end-label",ne.childNodes.length>0),re.classList.toggle("has-inside-label",V.childNodes.length>0)};return f?(he(f.get(),{fromModel:!0}),f.watch(Ce=>{he(Ce,{fromModel:!0})},"UI.Progress:watch")):S(e.value)?CMSwift.reactive.effect(()=>{he(n(e.value),{fromModel:!0})},"UI.Progress:value"):he((ve=(P=e.value)!=null?P:e.min)!=null?ve:0,{fromModel:!0}),S(e.buffer)?CMSwift.reactive.effect(()=>{me(n(e.buffer))},"UI.Progress:buffer"):me((ze=(Oe=(xe=e.buffer)!=null?xe:e.value)!=null?Oe:e.min)!=null?ze:0),CMSwift.reactive.effect(()=>{ke(),I(),u(),N()},"UI.Progress:render"),re._track=g,re._bar=T,re._buffer=p,re._getValue=Ae,re._getBuffer=pe,re._setValue=Ce=>he(Ce),re._setBuffer=Ce=>me(Ce),re},(oi=CMSwift.isDev)!=null&&oi.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Progress={signature:"UI.Progress(...children) | UI.Progress(props, ...children)",props:{value:"number|rod|[get,set] signal",model:"rod|[get,set] signal",min:"number",max:"number",buffer:"number|rod|[get,set] signal",label:"String|Node|Function|Array",note:"String|Node|Function|Array",showValue:'boolean|"inside"',valueLabel:"String|Node|Function|Array",insideLabel:"String|Node|Function|Array",formatValue:"function(value, percent, ctx)",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",startLabel:"String|Node|Function|Array",endLabel:"String|Node|Function|Array",leftLabel:"Alias di startLabel",rightLabel:"Alias di endLabel",width:"string|number",size:"string|number",height:"string|number",thickness:"Alias di height",color:"string",state:"primary|secondary|success|warning|danger|info|light|dark",trackColor:"string",bufferColor:"string",striped:"boolean",animated:"boolean",indeterminate:"boolean",reverse:"boolean",slots:"{ icon?, label?, note?, value?, inside?, startLabel?, endLabel?, default? }",class:"string",style:"object"},slots:{icon:"Icona prima della label",label:"Contenuto principale del progress",note:"Contenuto secondario sotto la label",value:"Valore esterno a destra",inside:"Contenuto dentro la barra",startLabel:"Label a sinistra della barra",endLabel:"Label a destra della barra",default:"Fallback label content"},returns:"HTMLDivElement",description:"Progress bar standardizzata con header opzionale, buffer, stato semantico e supporto reattivo."}),C.LoadingBar=function(...e){var u,N;const{props:s,children:o}=CMSwift.uiNormalizeArgs(e),i=(w,le)=>{const Ne=Number(w);return Number.isFinite(Ne)?Ne:le},f=()=>i(n(s.min),0),c=()=>{const w=f(),le=i(n(s.max),100);return le<w?w:le},d=w=>{const le=f(),Ne=c(),se=i(w,le);return Math.min(Ne,Math.max(le,se))},h=(w,le="")=>w==null||w===!1||w===""?le:typeof w=="number"?`${w}px`:String(w),b=w=>{const le=n(w);return!le||le===document?document.body:typeof le=="string"?document.querySelector(le)||document.body:le&&le.body instanceof HTMLElement?le.body:le instanceof HTMLElement?le:document.body},$=s.model||(Zt(s.value)||r(s.value)?s.value:null),F=de($,"UI.LoadingBar:model"),D=Zt(s.buffer)||r(s.buffer)?s.buffer:null,R=de(D,"UI.LoadingBar:buffer"),be=F?F.get():(u=n(s.value))!=null?u:f(),ce=R?R.get():(N=n(s.buffer))!=null?N:be,[ie,O]=CMSwift.reactive.signal(d(be)),[te,X]=CMSwift.reactive.signal(Math.max(d(ce),d(be))),[U,Ae]=CMSwift.reactive.signal(s.visible!=null?!!n(s.visible):d(be)>f()||!!n(s.indeterminate));let ye=null,pe=null;const we=()=>{ye&&(clearInterval(ye),ye=null)},he=()=>{pe&&(clearTimeout(pe),pe=null)},me=(w,le={})=>{const Ne=!!w;return U()!==Ne&&Ae(Ne),le.fromExternal!==!0&&typeof s.onVisibleChange=="function"&&s.onVisibleChange(Ne),Ne},Q=(w,le={})=>{const Ne=d(w);return ie()!==Ne&&O(Ne),te()<Ne&&(X(Ne),R&&le.fromExternal!==!0&&R.set(Ne)),F&&le.fromExternal!==!0&&F.set(Ne),Ne},L=(w,le={})=>{const Ne=Math.max(Q(ie(),{fromExternal:!0}),d(w));return te()!==Ne&&X(Ne),R&&le.fromExternal!==!0&&R.set(Ne),Ne},z=(w=ie())=>{s.visible==null&&(n(s.indeterminate)||w>f()?me(!0):n(s.hideOnZero)!==!1&&me(!1))},H=()=>{if(we(),n(s.trickle)===!1||n(s.indeterminate))return;const w=i(n(s.trickleInterval),280);w<=0||(ye=setInterval(()=>{var fe,P;const le=ie(),Ne=d((P=(fe=n(s.trickleTo))!=null?fe:n(s.trickleMax))!=null?P:92);if(le>=Ne)return;const se=i(n(s.trickleStep),le<45?12:le<75?7:3);Q(Math.min(Ne,le+se))},w))},y=CMSwift.omit(s,["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"]);y.class=l(["cms-loading-bar",s.class]),y.style={...s.style||{}};const Y=CMSwift.omit(s,["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"]);Y.class=l(["cms-loading-bar-progress",s.progressClass,Y.class]),Y.style={...s.progressStyle||{}},Y.value=[ie,O],Y.buffer=[te,X],Y.dense==null&&(Y.dense=!0),Y.height==null&&Y.thickness==null&&Y.size==null&&(Y.height=3),Y.width==null&&(Y.width="100%");const k=_.div(y),v=C.Progress(Y,...o);k.appendChild(v);const M=w=>{he();const le=Q(w);return z(le),k},x=w=>{he();const le=L(w);return z(le),k},g=(w=(le=>(le=n(s.step))!=null?le:8)())=>{he();const Ne=ie(),se=Q(Ne+i(w,0));return z(se),k},p=(w=(le=>(le=n(s.startValue))!=null?le:12)())=>{he();const Ne=Math.max(ie(),d(w));return Q(Ne),L(Math.max(te(),Ne)),z(Ne),H(),k},T=(w=(le=>(le=n(s.resetValue))!=null?le:f())())=>{he(),we();const Ne=d(w);return L(Ne),Q(Ne),z(Ne),k},V=(w=(le=>(le=n(s.doneValue))!=null?le:c())())=>{var fe;he(),we();const Ne=d(w);L(Ne),Q(Ne),z(Ne);const se=Math.max(0,i((fe=n(s.hideDelay))!=null?fe:n(s.doneDelay),220));return pe=setTimeout(()=>{T()},se),k},ne=(...w)=>V(...w),re=()=>(me(!0),k),ke=()=>(he(),we(),me(!1),k),I=()=>(he(),we(),k.remove(),null);return k.el=k,k._progress=v,k.get=()=>ie(),k.getBuffer=()=>te(),k.set=M,k.setBuffer=x,k.inc=g,k.start=p,k.done=V,k.complete=V,k.stop=ne,k.reset=T,k.show=re,k.hide=ke,k.destroy=I,k._dispose=I,F?F.watch(w=>{Q(w,{fromExternal:!0}),z(d(w))},"UI.LoadingBar:watch"):S(s.value)&&CMSwift.reactive.effect(()=>{const w=d(n(s.value));Q(w,{fromExternal:!0}),z(w)},"UI.LoadingBar:value"),R?R.watch(w=>{L(w,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):S(s.buffer)&&CMSwift.reactive.effect(()=>{L(n(s.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),CMSwift.reactive.effect(()=>{const w=f(),le=c(),Ne=Math.min(le,Math.max(w,ie())),se=Math.max(Ne,Math.min(le,Math.max(w,te())));Ne!==ie()&&O(Ne),se!==te()&&X(se)},"UI.LoadingBar:range"),CMSwift.reactive.effect(()=>{s.visible!=null&&me(n(s.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),CMSwift.reactive.effect(()=>{var ze;const w=n(s.position)||"fixed",le=n(s.inset),Ne=n(s.top),se=n(s.right),fe=n(s.bottom),P=n(s.left),ve=n(s.width),xe=s.visible!=null?!!n(s.visible):U(),Oe=w==="static"||w==="relative";k.classList.toggle("is-visible",xe),k.classList.toggle("is-inline",Oe),k.classList.toggle("has-track",!!n(s.trackColor)),k.style.position=w,k.style.zIndex=String((ze=n(s.zIndex))!=null?ze:10002),k.style.width=h(ve,Oe?"100%":""),le!=null&&le!==""?(k.style.inset=h(le),k.style.removeProperty("top"),k.style.removeProperty("right"),k.style.removeProperty("bottom"),k.style.removeProperty("left")):(k.style.removeProperty("inset"),!Oe&&w!=="sticky"?(k.style.top=h(Ne,"0px"),k.style.right=h(se,ve==null||ve===""?"0px":""),k.style.bottom=h(fe,""),k.style.left=h(P,"0px")):(k.style.top=h(Ne,""),k.style.right=h(se,""),k.style.bottom=h(fe,""),k.style.left=h(P,"")))},"UI.LoadingBar:layout"),wt(k,s),n(s.mount)!==!1&&b(s.target).appendChild(k),n(s.autoStart)&&p(),k},(si=CMSwift.isDev)!=null&&si.call(CMSwift)&&(C.meta=C.meta||{},C.meta.LoadingBar={signature:"UI.LoadingBar(...children) | UI.LoadingBar(props, ...children)",props:{value:"number|rod|[get,set] signal",model:"rod|[get,set] signal",buffer:"number|rod|[get,set] signal",min:"number",max:"number",height:"string|number",thickness:"Alias di height",size:"string|number",color:"string",state:"primary|secondary|success|warning|danger|info|light|dark",trackColor:"string",bufferColor:"string",striped:"boolean",animated:"boolean",indeterminate:"boolean",reverse:"boolean",width:"string|number",target:"HTMLElement|string",mount:"boolean",position:"fixed|absolute|relative|static|sticky",inset:"string|number",top:"string|number",right:"string|number",bottom:"string|number",left:"string|number",zIndex:"number",visible:"boolean",autoStart:"boolean",startValue:"number",step:"number",trickle:"boolean",trickleStep:"number",trickleInterval:"number",trickleMax:"number",trickleTo:"Alias di trickleMax",doneValue:"number",doneDelay:"Alias di hideDelay",hideDelay:"number",resetValue:"number",label:"String|Node|Function|Array",note:"String|Node|Function|Array",showValue:'boolean|"inside"',valueLabel:"String|Node|Function|Array",insideLabel:"String|Node|Function|Array",startLabel:"String|Node|Function|Array",endLabel:"String|Node|Function|Array",progressClass:"string",progressStyle:"object",slots:"{ icon?, label?, note?, value?, inside?, startLabel?, endLabel?, default? }",class:"string",style:"object"},slots:{icon:"Icona prima della label",label:"Contenuto principale",note:"Contenuto secondario",value:"Valore esterno a destra",inside:"Contenuto dentro la barra",startLabel:"Label a sinistra della barra",endLabel:"Label a destra della barra",default:"Fallback content"},returns:"HTMLDivElement con API imperativa: .set(), .setBuffer(), .inc(), .start(), .done(), .stop(), .reset(), .show(), .hide(), .destroy()",description:"Loading bar basata su UI.Progress, montabile su body o container custom, controllabile via model o API imperativa."});const zn=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),$n=new Set(["soft","solid","outline"]),Jt={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},oo={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},rs=t=>{const e=String(n(t)||"").trim().toLowerCase();return e?zn.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"},Ui=t=>{const e=String(n(t)||"").trim().toLowerCase();return $n.has(e)?e:"soft"},Gi=(t,e)=>{const s=n(t);if(s===!1||s===null)return 0;if(s===!0||s===""||s===void 0)return e==="danger"?3500:2500;const o=Number(s);return Number.isFinite(o)&&o>=0?o:e==="danger"?3500:2500},xn=(t={},e="")=>{var d,h,b,$,F,D,R,be,ce,ie,O,te,X,U;const s=Mn(t)?{...t}:{message:t},o=Rt(n(e)||n(s.type)||n(s.state)||n(s.color)||"info")||"info",i=Gi((h=(d=s.timeout)!=null?d:s.duration)!=null?h:s.delay,o),f=(F=($=(b=s.closable)!=null?b:s.dismissible)!=null?$:s.dismiss!=null)!=null?F:i===0,c=s.title===void 0?s.label===void 0?Jt[o]:s.label:s.title;return{...s,type:o,state:o,title:c,message:(be=(R=(D=s.message)!=null?D:s.content)!=null?R:s.text)!=null?be:null,description:(O=(ie=(ce=s.description)!=null?ce:s.subtitle)!=null?ie:s.note)!=null?O:null,meta:(X=(te=s.meta)!=null?te:s.caption)!=null?X:null,body:(U=s.body)!=null?U:null,timeout:i,closable:!!f,dismissLabel:s.dismissLabel||s.closeLabel||"Chiudi notifica",position:rs(s.position),variant:Ui(s.variant),slots:s.slots||{},role:s.role||(o==="danger"||o==="warning"?"alert":"status")}},ls=(t,e="",s="")=>{if(!t.length)return xn(s?{type:e,title:s}:{type:e});if(Mn(t[0])){const{props:d,children:h}=CMSwift.uiNormalizeArgs(t),b={...d};return!b.type&&!b.state&&!b.color&&e&&(b.type=e),b.title==null&&s&&(b.title=s),h.length&&(b.message==null&&b.description==null&&b.body==null&&h.length===1?b.message=h[0]:b.body==null&&(b.body=h.length===1?h[0]:h)),xn(b,e)}const[o,i,f]=t;let c={};return Mn(i)?c={...i,message:o}:Mn(f)?c={...f,message:o,title:i}:c={message:o,title:i},e&&!c.type&&!c.state&&!c.color&&(c.type=e),c.title==null&&s&&(c.title=s),xn(c,e)},fn=(t,e)=>(...s)=>{var o,i;return(i=(o=ot.services.notify)==null?void 0:o.show)==null?void 0:i.call(o,ls(s,t,e))},To=(t,e,s)=>{if(t===!1)return!1;if(typeof t=="function"){const o=t();return To(o,e,s)}return Mn(t)?t:t!=null?{message:t,title:s}:{message:e,title:s}};C.Notify=(...t)=>{var e,s;return(s=(e=ot.services.notify)==null?void 0:e.show)==null?void 0:s.call(e,ls(t))},C.Notify.show=C.Notify,C.Notify.success=fn("success","Success"),C.Notify.error=fn("danger","Error"),C.Notify.warning=fn("warning","Warning"),C.Notify.info=fn("info","Info"),C.Notify.primary=fn("primary","Notice"),C.Notify.secondary=fn("secondary","Notice"),C.Notify.remove=t=>{var e,s;return(s=(e=ot.services.notify)==null?void 0:e.remove)==null?void 0:s.call(e,t)},C.Notify.clear=()=>{var t,e;return(e=(t=ot.services.notify)==null?void 0:t.clear)==null?void 0:e.call(t)},C.Notify.update=(t,e={})=>{var s,o;return(o=(s=ot.services.notify)==null?void 0:s.update)==null?void 0:o.call(s,t,e)},C.Notify.promise=async(t,e={})=>{var i,f,c,d,h,b,$,F,D,R,be,ce,ie,O;const s=e.loading===!1?!1:To(typeof e.loading=="function"?()=>e.loading():e.loading,"Operazione in corso...","In corso"),o=s===!1?null:(f=(i=ot.services.notify)==null?void 0:i.show)==null?void 0:f.call(i,xn({type:"info",timeout:0,closable:!1,...s},"info"));try{const X=await(typeof t=="function"?t():t),U=To(typeof e.success=="function"?()=>e.success(X):e.success,"Operazione completata con successo.","Completato");return U!==!1?o!=null?(d=(c=ot.services.notify)==null?void 0:c.update)==null||d.call(c,o,xn(U,"success")):(b=(h=ot.services.notify)==null?void 0:h.show)==null||b.call(h,xn(U,"success")):o!=null&&((F=($=ot.services.notify)==null?void 0:$.remove)==null||F.call($,o)),X}catch(te){const X=To(typeof e.error=="function"?()=>e.error(te):e.error,(te==null?void 0:te.message)||"Operazione fallita.","Errore");throw X!==!1?o!=null?(R=(D=ot.services.notify)==null?void 0:D.update)==null||R.call(D,o,xn(X,"danger")):(ce=(be=ot.services.notify)==null?void 0:be.show)==null||ce.call(be,xn(X,"danger")):o!=null&&((O=(ie=ot.services.notify)==null?void 0:ie.remove)==null||O.call(ie,o)),te}},(ii=CMSwift.isDev)!=null&&ii.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Notify={signature:"UI.Notify(message, title?, opts?) | UI.Notify(opts, ...children)",props:{id:"string",type:"success|warning|danger|error|info|primary|secondary|light|dark",state:"Alias di type",color:"Alias di type",title:"String|Node|Function|Array|false",message:"String|Node|Function|Array",description:"String|Node|Function|Array",meta:"String|Node|Function|Array",body:"Node|Function|Array",icon:"String|Node|Function|Array|false",actions:"Node|Function|Array",dismiss:"Node|Function|Array",timeout:"number|false",duration:"Alias di timeout",closable:"boolean",dismissLabel:"string",position:"top-left|top-center|top-right|bottom-left|bottom-center|bottom-right",variant:"soft|solid|outline",slots:"{ icon?, title?, message?, description?, meta?, actions?, dismiss?, default? }",class:"string",style:"object"},slots:{icon:"Leading visual/icon content",title:"Toast title content",message:"Primary message content",description:"Secondary/supporting text",meta:"Meta info or badges",actions:"Actions area content",dismiss:"Custom dismiss control",default:"Extra body content under the message"},methods:{show:"Alias di UI.Notify(...)",success:"UI.Notify.success(message|opts, title?)",error:"UI.Notify.error(message|opts, title?)",warning:"UI.Notify.warning(message|opts, title?)",info:"UI.Notify.info(message|opts, title?)",update:"UI.Notify.update(id, patch)",remove:"UI.Notify.remove(id)",clear:"UI.Notify.clear()",promise:"UI.Notify.promise(promise|fn, { loading?, success?, error? })"},returns:"string|null (toast id)",description:"Notify standardizzato con payload strutturato, shortcut semantiche, update/remove/clear e supporto promise."}),C.Header=(...t)=>{var p,T,V,ne,re,ke,I;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i={...e};Sn(i);const f=u=>Object.prototype.hasOwnProperty.call(e,u),c=(p=e.drawerStateKey)!=null?p:ct;c&&(ct=c,mt=ut(c));const d=()=>ut(c),h=()=>at(!0,c),b=()=>at(!1,c),$=()=>at(!d(),c),F={props:e,stateKey:c,isDrawerOpen:d,openDrawer:h,closeDrawer:b,toggleDrawer:$,toggleAside:$},D=(u,N)=>{if(!(N==null||N===!1)){if(Array.isArray(N)){N.forEach(w=>D(u,w));return}if(N!=null&&N.nodeType){u.appendChild(N);return}u.appendChild(document.createTextNode(String(N)))}},R=(u,N,w=le=>le)=>{const le=CMSwift.ui.getSlot(o,u);if(le!=null)return E(o,u,F,null);if(typeof N=="function"){const Ne=new Set(["eyebrow","title","subtitle"]),se=_[Ne.has(u)?"span":"div"]({class:`cms-header-slot-${u}`});return CMSwift.reactive.effect(()=>{const fe=w(N(F)),P=Cn(CMSwift.ui.slot(fe));se.replaceChildren(),Array.isArray(P)?P.forEach(ve=>D(se,ve)):D(se,P)},`UI.Header:${u}`),[se]}return E(o,u,F,w(N))},be=(u,N="icon",w=e.iconSize||e.size||"md")=>u==null||u===!1?null:typeof u=="string"?C.Icon({name:u,size:w}):CMSwift.ui.slot(u,{as:N}),ce=u=>{var w,le;const N=u?(w=e.drawerOpenIcon)!=null?w:"\u2715":(le=e.drawerCloseIcon)!=null?le:"\u2630";return N==null||N===!1?null:typeof N=="string"?N:CMSwift.ui.slot(N,{as:u?"drawerOpenIcon":"drawerCloseIcon"})},ie=_.span({class:"cms-header-toggle-icon"}),O=u=>{const N=E(null,"default",F,ce(u));ie.replaceChildren(...N.length?N:[""])};O(d());const te=C.Btn({class:"cms-header-toggle",outline:!0,size:(V=(T=e.toggleSize)!=null?T:e.size)!=null?V:"sm",onClick:$,"aria-label":e.toggleLabel||"Toggle navigation"},ie);e.left==null&&e.left!==!1&&!CMSwift.ui.getSlot(o,"left")&&xt.add({update:O});const X=e.left===!1?null:e.left!=null?e.left:te,U=f("title")?e.title:(ne=e.label)!=null?ne:"App",Ae=(ke=(re=e.subtitle)!=null?re:e.description)!=null?ke:"",ye=f("right")?e.right:e.end,pe=f("content")?e.content:f("body")?e.body:s!=null&&s.length?s:null,we=[...R("left",X),...R("start",null)],he=R("icon",e.icon,be),me=R("eyebrow",(I=e.eyebrow)!=null?I:e.kicker),Q=R("title",U),L=R("subtitle",Ae),z=R("meta",e.meta),H=(()=>{const u=R("content",null);return u.length?u:R("default",pe)})(),y=[...R("center",null),...R("body",null)],Y=[...R("right",ye),...R("end",null)],k=R("actions",e.actions),v=_.div({class:l(["cms-header-body",e.bodyClass,e.centerClass])},_.div({class:"cms-header-heading"},he.length?_.div({class:"cms-header-icon"},...he):null,_.div({class:"cms-header-copy"},me.length?_.div({class:l(["cms-header-eyebrow",e.eyebrowClass])},...me):null,Q.length?_.div({class:l(["cms-header-title",e.titleClass])},...Q):null,L.length?_.div({class:l(["cms-header-subtitle",e.subtitleClass])},...L):null,H.length?_.div({class:l(["cms-header-content",e.contentClass])},...H):null),z.length?_.div({class:l(["cms-header-meta",e.metaClass])},...z):null)),M=[...Y,...k.length?[_.div({class:l(["cms-header-actions",e.actionsClass])},...k)]:[]],x=CMSwift.omit(i,["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=l(["cms-panel","cms-header","cms-singularity",a(e.sticky!==!1,"sticky"),a(e.stack,"stack"),a(e.elevated,"elevated"),a(e.divider!==!1,"divider"),i.class]),x.style={...i.style||{}},e.gap!=null&&(x.style["--cms-header-gap"]=K(n(e.gap))),e.minHeight!=null&&(x.style.minHeight=K(n(e.minHeight)));const g=_.div(x,...we.length?[_.div({class:l(["cms-header-start",e.startClass])},...we)]:[],_.div({class:"cms-header-main"},...y.length?[_.div({class:l(["cms-header-body",e.bodyClass,e.centerClass])},...y)]:[v],...M.length?[_.div({class:l(["cms-header-end",e.endClass])},...M)]:[]));return wt(g,e),g},(ri=CMSwift.isDev)!=null&&ri.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Header={signature:"UI.Header(...children) | UI.Header(props, ...children)",props:{title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",eyebrow:"String|Node|Function|Array",content:"Node|Function|Array",meta:"Node|Function|Array",icon:"String|Node|Function|Array",left:"Node|Function|Array|false",right:"Node|Function|Array",actions:"Node|Function|Array",drawerOpenIcon:"string|Node",drawerCloseIcon:"string|Node",drawerStateKey:"string",sticky:"boolean",stack:"boolean",dense:"boolean",elevated:"boolean",divider:"boolean",gap:"string|number",minHeight:"string|number",slots:"{ left?, start?, right?, end?, center?, body?, icon?, eyebrow?, title?, subtitle?, meta?, content?, actions? }",class:"string",style:"object"},slots:{left:"Area sinistra, fallback al toggle drawer",start:"Alias/addon area sinistra",right:"Area destra principale",end:"Alias/addon area destra",center:"Override completo del body centrale",body:"Alias di center",icon:"Icona leading",eyebrow:"Eyebrow / kicker",title:"Titolo",subtitle:"Sottotitolo",meta:"Meta info accanto al contenuto centrale",content:"Contenuto extra sotto il sottotitolo",actions:"Azioni raggruppate nella zona destra"},returns:"HTMLDivElement",description:"Header strutturato con regioni start/body/end, toggle drawer integrato, metadata e slot composabili."}),C.Drawer=(...t)=>{var se,fe,P,ve,xe,Oe,ze,Ce,Re;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i={...e},f=J=>Object.prototype.hasOwnProperty.call(e,J),c=(se=e.stateKey)!=null?se:ct;c&&(ct=c,mt=ut(c));const d=()=>ut(c),h=()=>at(!0,c),b=()=>at(!1,c),$=()=>at(!d(),c),F={props:e,stateKey:c,isDrawerOpen:d,openDrawer:h,closeDrawer:b,toggleDrawer:$,toggleAside:$},D=CMSwift==null?void 0:CMSwift.store,R=!!(D!=null&&D.get&&(D!=null&&D.set)),be=`${c}:groups`;let ce=R?D.get(be,{})||{}:{};const ie=J=>{const B=n(J);return B==null||B===!1?[]:Array.isArray(B)?B.flat(1/0):[B]},O=(J,B,G=F)=>{const q=Array.isArray(J)?J:[J];for(const Le of q)if(CMSwift.ui.getSlot(o,Le)!=null)return E(o,Le,G,B);return B==null?[]:E(null,"default",G,n(B))},te=J=>(Array.isArray(J)?J:[J]).some(G=>CMSwift.ui.getSlot(o,G)!=null),X=J=>{if(typeof n(J.external)=="boolean")return!!n(J.external);const B=n(J.href||J.to||J.link||"");return/^(https?:)?\/\//.test(B)},U=(fe=e.closeOnSelect)!=null?fe:!0,Ae=J=>!!U&&n(J.keepOpen)!==!0,ye=(ve=(P=e.itemIconSize)!=null?P:e.size)!=null?ve:"md",pe=(xe=e.groupOpenIcon)!=null?xe:"arrow_drop_up",we=(Oe=e.groupCloseIcon)!=null?Oe:"arrow_drop_down",he=(J,B)=>{if(n(J.active)!=null)return!!n(J.active);if(n(J.current)!=null)return!!n(J.current);if(!B||X(J))return!1;try{if(B.startsWith("#"))return window.location.hash===B;const G=`${window.location.pathname}${window.location.search}${window.location.hash}`;return B===G||B===window.location.pathname}catch(G){return!1}},me=(J=[])=>ie(J).some(B=>{if(!B||typeof B!="object"||B.nodeType)return!1;const G=n(B.href||B.to||B.link||"");if(he(B,G))return!0;const q=B.items||B.children||B.sub;return me(q)}),Q=(J,B={})=>{var Le;const G=n(J);if(G==null||G===!1)return[];const q=typeof G=="string"?C.Icon({name:G,size:(Le=B.iconSize)!=null?Le:ye}):CMSwift.ui.slot(G,{...B,as:"icon"});return E(null,"default",B,q)},L=(J,B,G={})=>{const q=Q(J,G);return q.length?[_.span({class:l(["cms-drawer-item-icon",B])},...q)]:[]},z=J=>{const B=n(J.iconPosition)||"left",G=Object.prototype.hasOwnProperty.call(J,"iconLeft")?J.iconLeft:B!=="right"?J.icon:null,q=Object.prototype.hasOwnProperty.call(J,"iconRight")?J.iconRight:B==="right"?J.icon:null;return{left:G,right:q}},H=(J,B,G,q)=>n(J.key||J.id||J.to||J.href||B||`item-${G}-${q}`),y=(J,B)=>R&&Object.prototype.hasOwnProperty.call(ce,J)?!!ce[J]:B,Y=(J,B)=>{R&&(ce={...ce,[J]:!!B},D.set(be,ce))},k=()=>{const J={...F,area:"header"},B=O(["headerIcon","icon"],e.icon,J),G=O(["eyebrow"],e.eyebrow,J),q=O(["title"],e.title,J),Le=O(["subtitle"],e.subtitle,J),Z=O(["meta"],e.meta,J),Ve=O(["content"],e.content,J),je=O(["actions"],e.actions,J),$e=f("header")?E(null,"default",J,n(e.header)):[],et=B.length||G.length||q.length||Le.length||Z.length||Ve.length||je.length;return!et&&!$e.length?[]:et?[_.div({class:l(["cms-drawer-header",e.headerClass])},...B.length?[_.div({class:"cms-drawer-header-icon"},...B)]:[],_.div({class:"cms-drawer-header-body"},...G.length?[_.div({class:"cms-drawer-header-eyebrow"},...G)]:[],...q.length?[_.div({class:"cms-drawer-header-title"},...q)]:[],...Le.length?[_.div({class:"cms-drawer-header-subtitle"},...Le)]:[],...Z.length?[_.div({class:"cms-drawer-header-meta"},...Z)]:[],...Ve.length?[_.div({class:"cms-drawer-header-content"},...Ve)]:[],...$e.length?[_.div({class:"cms-drawer-header-extra"},...$e)]:[]),...je.length?[_.div({class:"cms-drawer-header-actions"},...je)]:[])]:$e},v=(J,B,G)=>{var Z,Ve;return!(((Z=J.onClick)==null?void 0:Z.call(J,G,B))===!1||G!=null&&G.defaultPrevented||((Ve=e.onSelect)==null?void 0:Ve.call(e,J,B,G))===!1||G!=null&&G.defaultPrevented)},M=(J,B,G={})=>{const q=B.hasChildren?"group":"item",Le=E(o,`${q}Label`,B,B.label),Z=E(o,`${q}Note`,B,B.note),Ve=E(o,`${q}Badge`,B,B.badge),je=E(o,`${q}Aside`,B,B.aside),$e=E(o,`${q}Content`,B,B.content),et=[];return(Le.length||Z.length||Ve.length||je.length)&&et.push(_.div({class:"cms-drawer-item-top"},_.div({class:"cms-drawer-item-copy"},...Le.length?[_.div({class:"cms-drawer-item-label"},...Le)]:[],...Z.length?[_.div({class:"cms-drawer-item-note"},...Z)]:[]),...Ve.length||je.length?[_.div({class:"cms-drawer-item-meta"},...Ve.length?[_.div({class:"cms-drawer-item-badge"},...Ve)]:[],...je.length?[_.div({class:"cms-drawer-item-aside"},...je)]:[])]:[])),$e.length&&et.push(_.div({class:"cms-drawer-item-content"},...$e)),[...G.start||[],...L(B.iconLeft,"left",B),...et.length?[_.div({class:"cms-drawer-item-main"},...et)]:[],...L(B.iconRight,"right",B),...G.end||[]]},x=(J=[],B=0,G=[])=>ie(J).map((q,Le)=>{var Ht,jt,Kt,Lt,an,mn,Tn,Pn,On,Rn,Dn;const Z=n(q);if(Z==null||Z===!1)return null;if(Z.nodeType||typeof Z!="object"||Array.isArray(Z))return _.div({class:"cms-drawer-custom","data-level":String(B)},...E(null,"default",{...F,item:Z,level:B,index:Le,path:G},Z));if(n(Z.hidden)===!0||n(Z.visible)===!1)return null;const Ve=ie(Z.items||Z.children||Z.sub),je=n(Z.href||Z.to||Z.link||null),$e=n((Lt=(Kt=(jt=(Ht=Z.label)!=null?Ht:Z.title)!=null?jt:Z.text)!=null?Kt:je)!=null?Lt:null),et=$e!=null?$e:`item-${B}-${Le}`,j=n((Tn=(mn=(an=Z.note)!=null?an:Z.subtitle)!=null?mn:Z.description)!=null?Tn:null),Me=n((Pn=Z.badge)!=null?Pn:null),We=n((Rn=(On=Z.aside)!=null?On:Z.meta)!=null?Rn:null),Ue=n((Dn=Z.content)!=null?Dn:null),Qe=H(Z,et,B,Le),st=G.concat(Qe).join("::"),{left:dt,right:At}=z(Z),pt=Rt(n(Z.state)||n(Z.color)||""),It=he(Z,je),ft=!!n(Z.disabled),Mt={...F,item:Z,index:Le,level:B,path:G,label:et,note:j,badge:Me,aside:We,content:Ue,itemStateKey:st,iconLeft:dt,iconRight:At,iconSize:n(Z.iconSize)||ye,active:It,disabled:ft,hasChildren:!1},Ot=n(Z.divider)===!0||Z.type==="divider"||Z.type==="separator",Gt=n(Z.section)===!0||Z.type==="section"||Z.type==="heading"||Z.type==="label",Je=Z.type==="content"||Z.type==="custom"||!je&&!Ve.length&&!n(Z.button)&&Z.type!=="button"&&$e==null&&Ue!=null;if(Ot)return _.div({class:l(["cms-drawer-separator",Z.class]),"data-level":String(B)});if(Gt){const Ut=E(o,"sectionLabel",Mt,et||Ue);return _.div({class:l(["cms-drawer-section-label",Z.class]),"data-level":String(B)},...Ut)}if(Je){const Ut=E(o,"item",Mt,Ue!=null?Ue:et);return _.div({class:l(["cms-drawer-custom",pt?`cms-drawer-tone-${pt}`:"",Z.class]),style:Z.style,"data-level":String(B)},...Ut)}if(Ve.length){const Ut=It||me(Ve);let Wt=y(st,!!n(Z.expanded)||!!n(Z.open)||Ut);const m=_.span({class:"cms-drawer-group-icon"}),ae={...Mt,active:Ut,hasChildren:!0,isOpen:()=>Wt,setOpen:St=>Ye(St),toggle:()=>Ye(!Wt)},Te=()=>{var Vt,Xt;const St=Wt?(Vt=Z.openIcon)!=null?Vt:pe:(Xt=Z.closeIcon)!=null?Xt:we,Et=n(Wt?Z.iconSidePosition||Z.openIconSide||Z.openIconPosition||"right":Z.iconSidePosition||Z.closeIconSide||Z.closeIconPosition||"right")==="left"?"left":"right";m.innerHTML="",m.className=`cms-drawer-group-icon ${Et}`,Q(St,{...ae,as:"toggleIcon"}).forEach(sn=>m.appendChild(sn))},Xe=_.button({type:"button",class:l(["cms-drawer-group-toggle","cms-drawer-entry",Wt?"open":"",Ut?"active":"",ft?"is-disabled":"",pt?`cms-drawer-tone-${pt}`:"",Z.class]),style:Z.style,"data-level":String(B),"aria-expanded":String(Wt),"aria-disabled":ft?"true":null,onClick:St=>{if(ft){St.preventDefault();return}Ye(!Wt)}},...M(Z,ae,{start:n(Z.iconSidePosition||Z.openIconSide||Z.closeIconSide||Z.openIconPosition||Z.closeIconPosition||"right")==="left"?[m]:[],end:n(Z.iconSidePosition||Z.openIconSide||Z.closeIconSide||Z.openIconPosition||Z.closeIconPosition||"right")==="right"?[m]:[]})),Ze=E(o,"group",ae,null),qe=_.div({class:"cms-drawer-group-items"},...x(Ve,B+1,G.concat(Qe))),_e=_.div({class:l(["cms-drawer-group",Wt?"open":"",Ut?"active":"",pt?`cms-drawer-tone-${pt}`:""]),"data-level":String(B)},...Ze.length?Ze:[Xe],qe),Ye=St=>{Wt=!!St,_e.classList.toggle("open",Wt),Xe.classList.toggle("open",Wt),Xe.setAttribute("aria-expanded",String(Wt)),Te(),Y(st,Wt)};return Te(),_e}const Ct=E(o,"item",Mt,null),_t=n(Z.button)===!0||Z.type==="button"||!je&&typeof Z.onClick=="function",Ft={class:l(["cms-drawer-entry",_t?"cms-drawer-btn":"cms-drawer-link",It?"active":"",ft?"is-disabled":"",pt?`cms-drawer-tone-${pt}`:"",Z.class]),style:Z.style,"data-level":String(B),"aria-current":It?"page":null,"aria-disabled":ft?"true":null},Bt=Ct.length?Ct:M(Z,Mt);if(_t)return _.button({...Ft,type:Z.buttonType||"button",disabled:ft,onClick:Ut=>{if(ft){Ut.preventDefault();return}v(Z,Mt,Ut)&&Ae(Z)&&b()}},...Bt);const qt=X(Z),Yt=qt?n(Z.target)||"_blank":n(Z.target),$t=qt?n(Z.rel)||"noopener noreferrer":n(Z.rel);return _.a({...Ft,href:je||"#",target:Yt||null,rel:$t||null,tabIndex:ft?-1:null,onClick:Ut=>{var Wt;if(ft){Ut.preventDefault();return}v(Z,Mt,Ut)&&(!qt&&Z.to&&((Wt=ot.router)!=null&&Wt.navigate)&&(Ut.preventDefault(),ot.router.navigate(Z.to)),Ae(Z)&&b())}},...Bt)}).filter(Boolean),g=O(["before","beforeItems"],(ze=e.before)!=null?ze:e.beforeItems),p=te(["body"])?O(["body"],null):[],T=x(e.items||[]),V=O(["default"],s),ne=O(["after","afterItems"],(Ce=e.after)!=null?Ce:e.afterItems),re=p.length?p:[...g,...T,...V,...ne],ke=f("empty")||f("emptyText")?(Re=e.empty)!=null?Re:_.div({class:l(["cms-drawer-empty",e.emptyClass])},e.emptyText||"Nessun contenuto"):_.div({class:l(["cms-drawer-empty",e.emptyClass])},"Nessun contenuto"),I=O(["header"],k()),u=O(["footer"],e.footer),N=re.length?re:O(["empty"],ke),w=CMSwift.omit(i,["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"]);w.class=l(["cms-panel","cms-drawer",mt?"open":"",a(e.sticky,"sticky"),i.class]),w.style={...i.style||{}},e.gap!=null&&(w.style["--cms-drawer-gap"]=K(n(e.gap))),e.indent!=null&&(w.style["--cms-drawer-indent"]=K(n(e.indent))),e.padding!=null&&(w.style["--cms-drawer-padding"]=K(n(e.padding))),e.width!=null&&(w.style.width=K(n(e.width))),e.minHeight!=null&&(w.style.minHeight=K(n(e.minHeight))),e.maxHeight!=null&&(w.style.maxHeight=K(n(e.maxHeight)));const le=_.div(w,...I.length?I:[],_.div({class:l(["cms-drawer-body",e.bodyClass])},...N),...u.length?[_.div({class:l(["cms-drawer-footer",e.footerClass])},...u)]:[]),Ne=Pt.get(c)||new Set;return Ne.add(le),Pt.set(c,Ne),at(mt,c),le.isDrawerOpen=d,le.openDrawer=h,le.closeDrawer=b,le.toggleDrawer=$,wt(le,e),le},(li=CMSwift.isDev)!=null&&li.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Drawer={signature:"UI.Drawer(props)",props:{items:"Array",header:"Node|Function|Array",footer:"Node|Function|Array",before:"Node|Function|Array",after:"Node|Function|Array",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",eyebrow:"String|Node|Function|Array",icon:"String|Node|Function|Array",content:"Node|Function|Array",meta:"Node|Function|Array",actions:"Node|Function|Array",empty:"Node|Function|Array",emptyText:"string",stateKey:"string",closeOnSelect:"boolean",groupOpenIcon:"String|Node|Function|Array",groupCloseIcon:"String|Node|Function|Array",itemIconSize:"string|number",gap:"string|number",indent:"string|number",padding:"string|number",width:"string|number",minHeight:"string|number",maxHeight:"string|number",onSelect:"function(item, ctx, event)",sticky:"boolean",slots:"{ header?, body?, footer?, before?, after?, empty?, item?, itemLabel?, itemNote?, itemBadge?, itemAside?, itemContent?, group?, groupLabel?, groupNote?, groupBadge?, groupAside?, groupContent?, sectionLabel? }",class:"string",style:"object"},slots:{header:"Header del drawer, override completo",body:"Override completo del body",footer:"Footer del drawer",before:"Contenuto prima della lista items",after:"Contenuto dopo la lista items",empty:"Empty state quando non ci sono contenuti",item:"Override completo di un item semplice",itemLabel:"Label item (ctx: { item, label, note, badge, aside, content })",itemNote:"Note/subtitle item",itemBadge:"Badge item",itemAside:"Aside/meta item",itemContent:"Contenuto extra item",group:"Override completo header di un gruppo (ctx include toggle/isOpen)",groupLabel:"Label gruppo",groupNote:"Note gruppo",groupBadge:"Badge gruppo",groupAside:"Aside/meta gruppo",groupContent:"Contenuto extra gruppo",sectionLabel:"Label per elementi section/heading"},returns:"HTMLDivElement con methods openDrawer/closeDrawer/toggleDrawer/isDrawerOpen",description:"Drawer strutturato e retro compatibile con header/footer, gruppi, slot estesi, empty state e stato persistente."}),C.Page=(...t)=>{var v,M,x,g;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i={...e},f=(p,T)=>{var V;return!!(p&&p.nodeType===1&&((V=p.classList)!=null&&V.contains(`cms-page-${T}`)))},c=p=>p==null?null:typeof p=="string"?C.Icon({name:p,size:e.iconSize||e.size||"xl"}):CMSwift.ui.slot(p,{as:"icon"}),d={dense:!!n(e.dense),flat:!!n(e.flat),centered:!!n(e.centered),narrow:!!n(e.narrow)},h=(p,T)=>{if(!(T==null||T===!1)){if(Array.isArray(T)){T.forEach(V=>h(p,V));return}if(T!=null&&T.nodeType){p.appendChild(T);return}p.appendChild(document.createTextNode(String(T)))}},b=(p,T,V=ne=>ne)=>{const ne=CMSwift.ui.getSlot(o,p);if(ne!=null)return E(o,p,d,null);if(typeof T=="function"){const re=new Set(["eyebrow","title","subtitle"]),ke=_[re.has(p)?"span":"div"]({class:`cms-page-slot-${p}`});return CMSwift.reactive.effect(()=>{const I=V(T(d)),u=Cn(CMSwift.ui.slot(I));ke.replaceChildren(),Array.isArray(u)?u.forEach(N=>h(ke,N)):h(ke,u)},`UI.Page:${p}`),[ke]}return E(o,p,d,V(T))},$=E(o,"default",d,s!=null&&s.length?s:[]),F={hero:[],header:[],body:[],footer:[],actions:[]},D=[];$.forEach(p=>{f(p,"hero")?F.hero.push(p):f(p,"header")?F.header.push(p):f(p,"body")?F.body.push(p):f(p,"footer")?F.footer.push(p):f(p,"actions")?F.actions.push(p):D.push(p)});const R=b("icon",e.icon,c),be=b("hero",(v=e.hero)!=null?v:e.banner),ce=b("eyebrow",(M=e.eyebrow)!=null?M:e.kicker),ie=b("title",e.title),O=b("subtitle",(x=e.subtitle)!=null?x:e.description),te=b("header",e.header),X=b("aside",e.aside),U=b("body",(g=e.body)!=null?g:e.content),Ae=b("footer",e.footer),ye=b("actions",e.actions),pe=be.length?_.div({class:l(["cms-page-hero",e.heroClass])},...be):null,we=R.length||ce.length||ie.length||O.length||te.length||X.length,he=we?_.div({class:l(["cms-page-header",e.headerClass])},_.div({class:"cms-page-head"},R.length?_.div({class:l(["cms-page-icon",e.iconClass])},...R):null,_.div({class:"cms-page-head-main"},ce.length?_.div({class:l(["cms-page-eyebrow",e.eyebrowClass])},...ce):null,ie.length?_.div({class:l(["cms-page-title",e.titleClass])},...ie):null,O.length?_.div({class:l(["cms-page-subtitle",e.subtitleClass])},...O):null,te.length?_.div({class:l(["cms-page-header-content",e.headerContentClass])},...te):null),X.length?_.div({class:l(["cms-page-aside",e.asideClass])},...X):null)):null,me=[...U,...D],Q=me.length?_.div({class:l(["cms-page-body",e.bodyClass])},...me):null,L=[...ye,...F.actions],z=Ae.length||L.length?_.div({class:l(["cms-page-footer",e.footerClass])},...Ae,L.length?_.div({class:"cms-page-actions"},...L):null):null,H=!!(be.length||F.hero.length),y=!!(we||F.header.length),Y=CMSwift.omit(i,["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"]);Y.class=l(["cms-panel","cms-page",a(e.dense,"dense"),a(e.flat,"cms-page-flat"),a(e.centered,"cms-page-centered"),a(e.narrow,"cms-page-narrow"),a(H,"cms-page-has-hero"),a(y,"cms-page-has-header"),i.class]),Y.style={...i.style||{}},(e.gap!=null||S(e.gap))&&(Y.style["--cms-page-gap"]=A(e.gap,K)),(e.padding!=null||S(e.padding))&&(Y.style["--cms-page-padding"]=A(e.padding,K)),(e.maxWidth!=null||S(e.maxWidth))&&(Y.style["--cms-page-max-width"]=A(e.maxWidth,K)),(e.minHeight!=null||S(e.minHeight))&&(Y.style["--cms-page-min-height"]=A(e.minHeight,K)),(e.headerGap!=null||S(e.headerGap))&&(Y.style["--cms-page-header-gap"]=A(e.headerGap,K)),(e.heroPadding!=null||S(e.heroPadding))&&(Y.style["--cms-page-hero-padding"]=A(e.heroPadding,K));const k=_.div(Y,pe,...F.hero,he,...F.header,Q,...F.body,z,...F.footer);return wt(k,e),k},(ai=CMSwift.isDev)!=null&&ai.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Page={signature:"UI.Page(...children) | UI.Page(props, ...children)",props:{hero:"Node|Function|Array",icon:"String|Node|Function|Array",eyebrow:"String|Node|Function|Array",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",header:"String|Node|Function|Array",aside:"Node|Function|Array",body:"Node|Function|Array",footer:"Node|Function|Array",actions:"Node|Function|Array",dense:"boolean",flat:"boolean",centered:"boolean",narrow:"boolean",gap:"string|number",padding:"string|number",maxWidth:"string|number",minHeight:"string|number",heroPadding:"string|number",headerGap:"string|number",slots:"{ hero?, icon?, eyebrow?, title?, subtitle?, header?, aside?, body?, footer?, actions?, default? }",class:"string",style:"object"},slots:{hero:"Top hero/banner area",icon:"Page icon/visual",eyebrow:"Eyebrow/kicker content",title:"Page title content",subtitle:"Page subtitle/description content",header:"Header support content under title",aside:"Top-right header content",body:"Structured body content",footer:"Footer meta/content",actions:"Footer actions content",default:"Fallback body content"},returns:"HTMLDivElement",description:"Contenitore pagina strutturato con hero, header, body, footer e layout configurabile."}),C.AppShell=(...t)=>{var p,T;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=(V,ne)=>!!V&&Object.prototype.hasOwnProperty.call(V,ne),f=n(e.noDrawer)===!0||e.drawer===!1,c=n(e.reverse)===!0,d=n(e.stack)===!0,h=(T=(p=e.drawerStateKey)!=null?p:e.stateKey)!=null?T:ct;h&&(ct=h,mt=ut(h));const b={props:e,noDrawer:f,stateKey:h,isDrawerOpen:()=>ut(h),openDrawer:()=>at(!0,h),closeDrawer:()=>at(!1,h),toggleDrawer:()=>at(!ut(h),h)},$=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let F=e.header;!i(e,"header")&&(Object.keys($).length||i(e,"title")||i(e,"subtitle")||i(e,"left")||i(e,"right"))&&(!i($,"title")&&i(e,"title")&&($.title=e.title),!i($,"subtitle")&&i(e,"subtitle")&&($.subtitle=e.subtitle),!i($,"left")&&i(e,"left")&&($.left=e.left),!i($,"right")&&i(e,"right")&&($.right=e.right),i($,"drawerStateKey")||($.drawerStateKey=h),f&&!i($,"left")&&($.left=!1),F=C.Header($));const D=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},R=i(e,"drawerItems")?e.drawerItems:e.items,be=i(e,"drawerHeader")?e.drawerHeader:void 0;let ce=e.drawer;!i(e,"drawer")&&!f&&(Object.keys(D).length||R!=null||be!=null)&&(!i(D,"items")&&R!=null&&(D.items=R),!i(D,"header")&&be!=null&&(D.header=be),i(D,"stateKey")||(D.stateKey=h),ce=C.Drawer(D));const ie=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},O=i(e,"content")?e.content:s,te=E(o,"default",b,O);let X=e.page;!i(e,"page")&&(Object.keys(ie).length||te.length)&&(X=C.Page(ie,...te));const U=e.footerProps&&typeof e.footerProps=="object"?{...e.footerProps}:{},Ae=i(e,"footerContent")?e.footerContent:void 0;let ye=e.footer;!i(e,"footer")&&(Object.keys(U).length||Ae!=null)&&(ye=C.Footer(U,...E(null,"default",b,Ae)));const pe=E(o,"header",b,F),we=f?[]:E(o,"drawer",b,ce),he=E(o,"page",b,X),me=E(o,"footer",b,ye),Q=l(["cms-app","cms-app-shell",a(f,"no-drawer"),a(c,"is-reverse"),a(d,"is-stack"),a(e.flush,"is-flush"),a(e.divider,"is-divider"),e.class]),L=CMSwift.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"]);L.class=Q,L.style={...e.style||{}};const z=A(e.drawerWidth,K);z!=null&&(L.style["--cms-app-shell-drawer-width"]=z);const H=A(e.gap,K);H!=null&&(L.style["--cms-app-shell-gap"]=H);const y=A(e.padding,K);y!=null&&(L.style["--cms-app-shell-padding"]=y);const Y=pe.length?_.div({class:"cms-app-shell-header-slot"},...pe):null,k=we.length?_.div({class:"cms-app-shell-drawer-slot"},...we):null,v=he.length?_.div({class:"cms-app-shell-page-slot"},...he):null,M=me.length?_.div({class:"cms-app-shell-footer-slot"},...me):null,x=c?[v,k]:[k,v],g=_.div(L,...Y?[Y]:[],_.div({class:"cms-app-shell-body"},...x.filter(Boolean)),...M?[M]:[]);return g.openDrawer=b.openDrawer,g.closeDrawer=b.closeDrawer,g.toggleDrawer=b.toggleDrawer,g.isDrawerOpen=b.isDrawerOpen,g.header=Y,g.drawer=k,g.page=v,g.footer=M,wt(g,e),g},(ci=CMSwift.isDev)!=null&&ci.call(CMSwift)&&(C.meta=C.meta||{},C.meta.AppShell={signature:"UI.AppShell(...children) | UI.AppShell(props, ...children)",props:{header:"Node|Function|Array|false",drawer:"Node|Function|Array|false",page:"Node|Function|Array|false",footer:"Node|Function|Array|false",title:"string|Node|Function|Array",subtitle:"string|Node|Function|Array",left:"Node|Function|Array|false",right:"Node|Function|Array",items:"Array",drawerItems:"Array",drawerHeader:"Node|Function|Array",content:"Node|Function|Array",headerProps:"object",drawerProps:"object",pageProps:"object",footerProps:"object",footerContent:"Node|Function|Array",noDrawer:"boolean",reverse:"boolean",stack:"boolean",flush:"boolean",divider:"boolean",drawerStateKey:"string",stateKey:"string",drawerWidth:"number|string",gap:"number|string",padding:"number|string",slots:"{ header?, drawer?, page?, footer?, default? }",class:"string",style:"object"},slots:{header:"Header content",drawer:"Drawer content",page:"Page content",footer:"Footer content",default:"Fallback page content"},returns:"HTMLDivElement con methods openDrawer/closeDrawer/toggleDrawer/isDrawerOpen",description:"Shell applicazione composabile con shortcut per Header/Drawer/Page/Footer e gestione drawer."}),C.Parallax=function(...e){var V,ne;const{props:s,children:o}=CMSwift.uiNormalizeArgs(e),i=s.slots||{},f={...s};f.color!=null&&f.textColor==null&&(f.textColor=f.color),delete f.color,Sn(f);const c=ee(s.state,()=>{const re=Rt(n(s.state));return re?`cms-state-${re}`:""}),d=re=>{if(re==null||re===!1||re==="")return"";const ke=String(re);return vn(ke)?`var(--cms-${ke})`:ke},h=()=>{const re=n(s.background);if(re)return String(re);const ke=n(s.image)||n(s.src)||"";if(!ke)return"linear-gradient(120deg, #1b2c5a, #2f6d8f, #2a8f5c)";const I=String(ke);return/^url\(/i.test(I)||/gradient\(/i.test(I)||/^var\(/i.test(I)?I:`url(${I})`},b=(re,ke)=>{const I=Number(n(re));return Number.isFinite(I)?I:ke},$={speed:()=>{var re;return(re=n(s.speed))!=null?re:.18},state:()=>n(s.state)||"",disabled:()=>!!n(s.disabled)},F=E(i,"badge",$,s.badge),D=E(i,"background",$,s.backgroundContent),R=E(i,"eyebrow",$,(V=s.eyebrow)!=null?V:s.kicker),be=E(i,"title",$,s.title),ce=E(i,"subtitle",$,s.subtitle),ie=E(i,"header",$,s.header),O=E(i,"aside",$,s.aside),te=E(i,"media",$,s.media),X=E(i,"content",$,(ne=s.content)!=null?ne:s.body),U=E(i,"default",$,o!=null&&o.length?o:[]),Ae=E(i,"footer",$,s.footer),ye=E(i,"actions",$,s.actions),pe=[...X,...U],we=F.length?_.div({class:l(["cms-parallax-badge",s.badgeClass])},...F):null,he=R.length||be.length||ce.length||ie.length||O.length,me=he?_.div({class:l(["cms-parallax-header",s.headerClass])},_.div({class:"cms-parallax-head"},_.div({class:"cms-parallax-head-main"},R.length?_.div({class:l(["cms-parallax-eyebrow",s.eyebrowClass])},...R):null,be.length?_.div({class:l(["cms-parallax-title",s.titleClass])},...be):null,ce.length?_.div({class:l(["cms-parallax-subtitle",s.subtitleClass])},...ce):null,ie.length?_.div({class:l(["cms-parallax-header-content",s.headerContentClass])},...ie):null),O.length?_.div({class:l(["cms-parallax-aside",s.asideClass])},...O):null)):null,Q=te.length?_.div({class:l(["cms-parallax-media",s.mediaClass])},...te):null,L=pe.length?_.div({class:l(["cms-parallax-body",s.bodyClass])},...pe):null,z=Ae.length||ye.length?_.div({class:l(["cms-parallax-footer",s.footerClass])},Ae.length?_.div({class:"cms-parallax-footer-content"},...Ae):null,ye.length?_.div({class:"cms-parallax-actions"},...ye):null):null,H=CMSwift.omit(f,["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"]);H.class=l(["cms-parallax","cms-singularity",c,a(s.disabled,"cms-parallax-static"),a(we,"cms-parallax-has-badge"),a(he,"cms-parallax-has-header"),f.class]),H.style={...f.style||{}},s.height!=null&&(H.style["--cms-parallax-height"]=A(s.height,K)),s.minHeight!=null&&(H.style["--cms-parallax-min-height"]=A(s.minHeight,K)),s.padding!=null&&(H.style["--cms-parallax-padding"]=A(s.padding,K)),s.gap!=null&&(H.style["--cms-parallax-gap"]=A(s.gap,K)),s.contentMaxWidth!=null&&(H.style["--cms-parallax-content-max-width"]=A(s.contentMaxWidth,K)),s.justify!=null&&(H.style["--cms-parallax-justify"]=A(s.justify)),s.align!=null&&(H.style["--cms-parallax-align"]=A(s.align)),s.color!=null&&(H.style["--cms-parallax-color"]=A(s.color,d)),s.overlay!=null&&(H.style["--cms-parallax-overlay"]=A(s.overlay)),s.bgPosition!=null&&(H.style["--cms-parallax-position"]=A(s.bgPosition)),s.bgSize!=null&&(H.style["--cms-parallax-size"]=A(s.bgSize)),s.bgRepeat!=null&&(H.style["--cms-parallax-repeat"]=A(s.bgRepeat)),H.style["--cms-parallax-image"]=S(s.background)||S(s.image)||S(s.src)?()=>h():h();const y=_.div({class:l(["cms-parallax-bg",s.bgClass])},D.length?_.div({class:l(["cms-parallax-bg-content",s.backgroundContentClass])},...D):null),Y=_.div({class:l(["cms-parallax-content",s.contentClass,s.innerClass])},we,me,Q,L,z),k=_.div(H,y,Y);let v=!1,M=!1,x=null;const g=()=>{var re;v||(v=!0,typeof window!="undefined"&&(window.removeEventListener("scroll",T),window.removeEventListener("resize",T)),(re=x==null?void 0:x.disconnect)==null||re.call(x),x=null)},p=()=>{if(v)return;if(!k.isConnected){g();return}if(n(s.disabled)){y.style.transform="translate3d(0, 0, 0)",k.style.setProperty("--cms-parallax-offset","0px");return}const re=k.getBoundingClientRect(),ke=b(s.speed,.18),I=Math.abs(b(s.maxOffset,96)),u=n(s.startTop),N=u!=null&&u!==""?(re.top-b(s.startTop,0))*ke:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(re.top+re.height/2))*ke,le=`${(I>0?Math.max(-I,Math.min(I,N)):N).toFixed(2)}px`;y.style.transform=`translate3d(0, ${le}, 0)`,k.style.setProperty("--cms-parallax-offset",le)};function T(){v||M||(M=!0,requestAnimationFrame(()=>{M=!1,p()}))}return typeof window!="undefined"&&(window.addEventListener("scroll",T,{passive:!0}),window.addEventListener("resize",T),typeof ResizeObserver!="undefined"&&(x=new ResizeObserver(()=>{T()}),x.observe(k)),requestAnimationFrame(()=>{T()}),setTimeout(()=>{T()},90)),k.refresh=()=>(T(),k),k.update=k.refresh,k.destroy=()=>(g(),k.remove(),null),k._dispose=g,wt(k,s),k},(ui=CMSwift.isDev)!=null&&ui.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Parallax={signature:"UI.Parallax(...children) | UI.Parallax(props, ...children)",props:{src:"string",image:"string",background:"string",backgroundContent:"Node|Function|Array",height:"string|number",minHeight:"string|number",speed:"number",maxOffset:"number",startTop:"number",state:"success|warning|danger|info|primary|secondary|dark|light|string",overlay:"string",color:"string",bgPosition:"string",bgSize:"string",bgRepeat:"string",padding:"string|number",gap:"string|number",justify:"string",align:"string",contentMaxWidth:"string|number",disabled:"boolean",badge:"Node|Function|Array",eyebrow:"String|Node|Function|Array",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",header:"Node|Function|Array",aside:"Node|Function|Array",media:"Node|Function|Array",content:"Node|Function|Array",footer:"Node|Function|Array",actions:"Node|Function|Array",bgClass:"string",badgeClass:"string",headerClass:"string",bodyClass:"string",footerClass:"string",contentClass:"string",slots:"{ background?, badge?, eyebrow?, title?, subtitle?, header?, aside?, media?, content?, footer?, actions?, default? }",class:"string",style:"object"},slots:{background:"Contenuto decorativo dentro il layer di sfondo",badge:"Meta badge/chip sopra il contenuto principale",eyebrow:"Eyebrow/kicker",title:"Titolo principale",subtitle:"Sottotitolo o testo di supporto",header:"Contenuto aggiuntivo in header",aside:"Area laterale header",media:"Contenuto multimediale o card in foreground",content:"Body principale",footer:"Footer informativo",actions:"Area azioni",default:"Fallback body content"},returns:"HTMLDivElement con methods refresh/update/destroy",description:"Hero/section parallax standardizzato con header strutturato, body, actions, slots e API minima di refresh."});const[Po,Oo]=ot.reactive.signal([]),Ro=new Map;function qo(t){const e=Ro.get(t);e&&(clearTimeout(e),Ro.delete(t))}function Yo(t){return t?(qo(t),Oo(Po().filter(e=>e.id!==t)),t):null}function Ki(){for(const t of Ro.keys())qo(t);Oo([])}function as(t){t!=null&&t.id&&(qo(t.id),t.timeout>0&&Ro.set(t.id,setTimeout(()=>{Yo(t.id)},t.timeout)))}function cs(t,e={}){if(!t)return null;let s=null;return Oo(Po().map(o=>o.id!==t?o:(s=xn({...o,...e,id:o.id},e.type||e.state||e.color||o.type),s))),s&&as(s),(s==null?void 0:s.id)||null}function qi(t){const e=()=>Yo(t.id),s=(ie={})=>cs(t.id,ie),o={toast:t,id:t.id,close:e,update:s},i=ie=>typeof ie=="function"?ie(o):ie,f=(()=>{if(t.icon===!1||t.icon===null)return null;if(t.icon!=null){const O=i(t.icon);return typeof O=="string"?C.Icon({name:O,size:"sm"}):CMSwift.ui.slot(O,{as:"icon"})}const ie=oo[t.type];return ie?C.Icon({name:ie,size:"sm"}):null})(),c=E(t.slots,"icon",o,f),d=E(t.slots,"title",o,i(t.title)),h=E(t.slots,"message",o,i(t.message)),b=E(t.slots,"description",o,i(t.description)),$=E(t.slots,"meta",o,i(t.meta)),F=E(t.slots,"actions",o,i(t.actions)),D=E(t.slots,"default",o,i(t.body)),R=E(t.slots,"dismiss",o,i(t.dismiss)),be=R.length?R:t.closable?[C.Btn({class:"cms-toast-close",outline:!0,size:"xs","aria-label":t.dismissLabel,onClick:e},C.Icon({name:"close",size:"xs"}))]:[],ce=_.div({class:l(["cms-toast",`cms-toast-${t.type}`,`cms-toast-${t.variant}`,a(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"},d.length?_.div({class:"cms-toast-title"},...d):null,h.length?_.div({class:"cms-toast-message"},...h):null,b.length?_.div({class:"cms-toast-description"},...b):null,D.length?_.div({class:"cms-toast-body"},...D):null,$.length?_.div({class:"cms-toast-meta"},...$):null),F.length?_.div({class:"cms-toast-actions"},...F):null),be.length?_.div({class:"cms-toast-dismiss"},...be):null);return wt(ce,t),ce}function Yi(){let t=document.querySelector(".cms-toast-layer");return t||(t=document.createElement("div"),t.className="cms-toast-layer",document.body.appendChild(t),ot.reactive.effect(()=>{const e=Po();t.innerHTML="";const s=new Map;for(const o of e){const i=rs(o.position);s.has(i)||s.set(i,[]),s.get(i).push(o)}for(const o of zn){const i=s.get(o);if(!(i!=null&&i.length))continue;const f=_.div({class:l(["cms-toast-wrap",`is-${o}`])},...i.map(c=>qi(c)));t.appendChild(f)}},"CMSwiftUI:toasts"),t)}function Xi(t={}){Yi();const e=xn(t);return e.id=e.id||Math.random().toString(36).slice(2),Oo([...Po().filter(s=>s.id!==e.id),e]),as(e),e.id}ot.services.notify.show=Xi,ot.services.notify.success=fn("success","Success"),ot.services.notify.error=fn("danger","Error"),ot.services.notify.warning=fn("warning","Warning"),ot.services.notify.info=fn("info","Info"),ot.services.notify.primary=fn("primary","Notice"),ot.services.notify.secondary=fn("secondary","Notice"),ot.services.notify.update=cs,ot.services.notify.remove=Yo,ot.services.notify.clear=Ki,ot.services.notify.promise=C.Notify.promise,ot.notify=ot.services.notify,CMSwift.form=CMSwift.form||{},CMSwift.form._isPromise=t=>t&&typeof t.then=="function",CMSwift.form._normalizeRules=t=>{const e={};for(const s in t||{}){const o=t[s];e[s]=Array.isArray(o)?o:[o]}return e},CMSwift.form._runRule=async(t,e,s)=>{let o=t,i=null;t&&typeof t=="object"&&typeof t.rule=="function"&&(o=t.rule,i=t.message||null);const f=o?o(e,s):!0,c=CMSwift.form._isPromise(f)?await f:f;return c===!0?null:typeof c=="string"?c:c===!1?i||"Valore non valido":c?null:i||"Valore non valido"},CMSwift.useForm=(t={})=>{const e=t.model||{},s=CMSwift.form._normalizeRules(t.rules||{}),o=t.validateOn||"submit",i=t.initial||null,f=_.rod({}),c=_.rod({}),d=_.rod(!1),h=_.rod(null),b=()=>e&&typeof e=="object"&&"value"in e?e.value||{}:e,$=pe=>{if(e&&typeof e=="object"&&"value"in e)e.value=pe;else{const we=e||{};for(const he in we)delete we[he];Object.assign(we,pe)}},F=pe=>{const we=b();return we?we[pe]:void 0},D=(pe,we)=>{const he={...b()||{}};he[pe]=we,$(he)},R=(pe,we)=>{const he={...f.value||{}};we?he[pe]=we:delete he[pe],f.value=he},be=pe=>(f.value||{})[pe]||null,ce=pe=>{c.value={...c.value||{},[pe]:!0}},ie=pe=>!!(c.value||{})[pe],O=async pe=>{const we=s[pe]||[];if(!we.length)return R(pe,null),!0;const he=F(pe),me={name:pe,value:he,model:b(),form:ye};for(const Q of we){if(!Q)continue;const L=await CMSwift.form._runRule(Q,he,me);if(L)return R(pe,L),!1}return R(pe,null),!0},te=async()=>{h.value=null;const pe=Object.keys(s);let we=!0;for(const he of pe)await O(he)||(we=!1);return we},ye={model:e,errors:f,touched:c,submitting:d,submitError:h,getValue:F,setValue:D,getError:be,setError:R,touch:ce,isTouched:ie,field:(pe,we={})=>{var M;const he=_.rod("");(M=he.action)==null||M.call(he,x=>{D(pe,x)});const me=()=>o==="submit"||o==="input"||o==="blur"?!0:ie(pe);let Q=null,L=!1,z=!1;const H=async()=>{L||(L=!0,ce(pe),(o==="blur"||o==="input")&&await O(pe),setTimeout(()=>{L=!1},0))},y=x=>{Q&&(Q===x.target||Q.contains&&Q.contains(x.target)||(H(),Q=null,z&&(z=!1,document.removeEventListener("pointerdown",y,!0))))},Y=()=>{z||(z=!0,document.addEventListener("pointerdown",y,!0))},k=async()=>{Q=document.activeElement,L=!1,Y(),o==="input"&&await O(pe)},v=async()=>{await H(),Q=null,z&&(z=!1,document.removeEventListener("pointerdown",y,!0))};return{name:pe,model:he,get value(){return he.value},set value(x){he.value=x},error:()=>me()?be(pe):null,success:we.success||null,warning:we.warning||null,note:we.note||null,touch:()=>ce(pe),validate:()=>O(pe),onInput:k,onBlur:v,hint:we.hint||null}},validateField:O,validate:te,reset:()=>{h.value=null,f.value={},c.value={},i&&$({...i||{}})},submit:async pe=>{d.value=!0,h.value=null;try{return await te()?{ok:!0,result:await(pe==null?void 0:pe(b(),ye))}:{ok:!1,reason:"validation"}}catch(we){return console.error("[useForm] submit error:",we),h.value=we&&we.message?we.message:String(we),{ok:!1,reason:"exception",error:we}}finally{d.value=!1}}};return ye},C.Form=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.form,i=e.onSubmit,f=l(["cms-form",e.class]),c=CMSwift.omit(e,["form","onSubmit"]);c.class=f;const d=_.form({...c,onSubmit:async b=>{b.preventDefault(),o&&await o.submit(i||(async()=>{}))}}),h=[];for(const b of s||[]){const $=typeof b=="function"?b(o):b,F=CMSwift.ui.slot($);F&&(Array.isArray(F)?h.push(...F):h.push(F))}return h.forEach(b=>d.appendChild(b)),o&&o.submitting&&CMSwift.reactive.effect(()=>{d.classList.toggle("is-submitting",!!o.submitting.value)},"UI.Form:submitting"),d},(di=CMSwift.isDev)!=null&&di.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Form={signature:"UI.Form({ form, onSubmit, ...props }, ...children)",props:{form:"useForm() instance",onSubmit:"async (model, form) => any",class:"string",style:"object"},slots:{default:"(form) => Node|Array|Node"},returns:"HTMLFormElement"}),ot.services=ot.services||{},ot.services.dialog=ot.services.dialog||{},ot.dialog=ot.services.dialog;let so=null;function us(){return so||(so=document.createElement("div"),so.setAttribute("data-cms-modal-root","true"),document.body.appendChild(so),so)}C.cardHeader=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=l(["cms-card-header",a(e.divider,"divider"),e.class]),f=CMSwift.omit(e,["divider","align","justify","gap","wrap","slots"]);f.class=i;const c={...e.style||{}},d=A(e.align);d!=null&&(c.alignItems=d);const h=A(e.justify);h!=null&&(c.justifyContent=h);const b=A(e.wrap,F=>F?"wrap":"nowrap");b!=null&&(c.flexWrap=b);const $=A(e.gap,K);return $!=null&&(c.gap=$),Object.keys(c).length&&(f.style=c),_.div(f,...E(o,"default",{},s))},C.cardBody=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=l(["cms-card-body",e.class]),f=CMSwift.omit(e,["slots"]);return f.class=i,_.div(f,...E(o,"default",{},s))},C.cardFooter=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=l(["cms-card-footer",a(e.divider,"divider"),e.class]),f=CMSwift.omit(e,["divider","align","justify","gap","wrap","slots"]);f.class=i;const c={...e.style||{}},d=A(e.align);d!=null&&(c.alignItems=d);const h=A(e.justify);h!=null&&(c.justifyContent=h);const b=A(e.wrap,F=>F?"wrap":"nowrap");b!=null&&(c.flexWrap=b);const $=A(e.gap,K);return $!=null&&(c.gap=$),Object.keys(c).length&&(f.style=c),_.div(f,...E(o,"default",{},s))},(fi=CMSwift.isDev)!=null&&fi.call(CMSwift)&&(C.meta=C.meta||{},C.meta.cardHeader={signature:"UI.cardHeader(...children) | UI.cardHeader(props, ...children)",props:{divider:"boolean",align:"stretch|flex-start|center|flex-end|baseline",justify:"flex-start|center|flex-end|space-between|space-around|space-evenly",wrap:"boolean",gap:"string|number",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Card header content"},returns:"HTMLDivElement",description:"Header della card con supporto layout flex."},C.meta.cardBody={signature:"UI.cardBody(...children) | UI.cardBody(props, ...children)",props:{slots:"{ default? }",class:"string",style:"object"},slots:{default:"Card body content"},returns:"HTMLDivElement",description:"Body della card."},C.meta.cardFooter={signature:"UI.cardFooter(...children) | UI.cardFooter(props, ...children)",props:{divider:"boolean",align:"stretch|flex-start|center|flex-end|baseline",justify:"flex-start|center|flex-end|space-between|space-around|space-evenly",wrap:"boolean",gap:"string|number",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Card footer content"},returns:"HTMLDivElement",description:"Footer della card con supporto layout flex."}),C.Dialog=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],f=["xs","sm","md","lg","xl","full"];let c={...e},d=null,h=null;const b=(L,z)=>typeof L=="function"?L(z):L,$=L=>String(L||"").split(/\s+/).filter(Boolean),F=(L,z,H)=>{if(!L)return;const y=L[z]||[];y.length&&L.classList.remove(...y);const Y=(H||[]).filter(Boolean);Y.length&&L.classList.add(...Y),L[z]=Y},D=(L,z,H,y=Y=>Y)=>{if(L){if(H==null||H===""){L.style.removeProperty(z);return}L.style.setProperty(z,y(H))}},R=()=>c,be=L=>{var H;const z=n((H=L.state)!=null?H:L.color);return z?i.includes(z)?z:String(z):""},ce=L=>{const z=n(L.size);return typeof z=="string"&&f.includes(z)?z:""},ie=L=>{var H,y,Y;const z=String(n((Y=(y=(H=L.actionsAlign)!=null?H:L.footerAlign)!=null?y:L.alignActions)!=null?Y:"end")).toLowerCase();return["start","left"].includes(z)?"start":["center","middle"].includes(z)?"center":["between","space-between"].includes(z)?"between":["stretch","full"].includes(z)?"stretch":"end"},O=L=>{var H,y,Y;const z=String(n((Y=(y=(H=L.align)!=null?H:L.verticalAlign)!=null?y:L.position)!=null?Y:"center")).toLowerCase();return["top","start","flex-start"].includes(z)?"cms-dialog-align-top":["bottom","end","flex-end"].includes(z)?"cms-dialog-align-bottom":""},te=L=>{var H,y;return((y=(H=L.closable)!=null?H:L.dismissible)!=null?y:L.closeButton)!==!1},X=()=>{var I,u,N,w,le,Ne,se,fe;const L=R(),z={close:we,dismiss:we,open:pe,toggle:me,update:ye,isOpen:he,entry:()=>d,props:L},H=L.icon!=null?typeof L.icon=="string"?C.Icon({name:L.icon,size:L.iconSize||"md"}):CMSwift.ui.slot(L.icon,{as:"icon"}):null,y=E(o,"eyebrow",z,b(L.eyebrow,z)),Y=E(o,"title",z,b((u=(I=L.title)!=null?I:L.heading)!=null?u:L.header,z)),k=E(o,"subtitle",z,b((N=L.subtitle)!=null?N:L.description,z)),v=E(o,"icon",z,H),M=E(o,"header",z,b((w=L.headerContent)!=null?w:L.head,z)),x=te(L)?E(o,"close",z,C.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":L.closeLabel||"Chiudi dialog","data-dialog-close":!0},C.Icon({name:L.closeIcon||"close",size:"sm"}))):[],g=(se=(Ne=(le=L.content)!=null?le:L.body)!=null?Ne:L.message)!=null?se:s&&s.length?s:null;let p=E(o,"content",z,b(g,z));p.length||(p=E(o,"body",z,b(g,z))),p.length||(p=E(o,"default",z,b(g,z)));const T=b((fe=L.footer)!=null?fe:L.actions,z);let V=E(o,"footer",z,T);V.length||(V=E(o,"actions",z,T));let ne=null;M.length?ne=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...M):(y.length||Y.length||k.length||v.length||x.length)&&(ne=_.div({class:"cms-dialog-head"},v.length?_.div({class:"cms-dialog-icon"},...v):null,_.div({class:"cms-dialog-head-main"},y.length?_.div({class:"cms-dialog-eyebrow"},...y):null,Y.length?_.div({class:"cms-dialog-title"},...Y):null,k.length?_.div({class:"cms-dialog-subtitle"},...k):null),x.length?_.div({class:"cms-dialog-close-wrap"},...x):null));const re=_.div({class:l(["cms-dialog-body",L.bodyClass])},...p),ke=V.length?_.div({class:l(["cms-dialog-actions",`is-${ie(L)}`,a(L.stackActions,"is-stacked"),L.actionsClass,L.footerClass])},...V):null;return _.div({class:l(["cms-dialog-shell",a(!!ne,"has-head"),a(!!ke,"has-footer"),a(L.divider!==!1,"with-divider")])},...[ne,re,ke].filter(Boolean))},U=L=>{var Y;if(!(L!=null&&L.panel))return;const z=R(),H=be(z),y=ce(z);F(L.panel,"_dialogClassTokens",["cms-dialog","cms-singularity","cms-clear-set",y?`cms-dialog-${y}`:"",H,H?`cms-state-${H}`:"",n(z.fullscreen)?"fullscreen":"",n(z.scrollable)?"scrollable":"",n(z.stickyHeader)?"sticky-head":"",n(z.stickyActions)?"sticky-actions":"",n(z.borderless)?"borderless":"",...$(z.class),...$(z.panelClass)]),F(L.overlay,"_dialogOverlayClassTokens",[O(z),n(z.backdropBlur)?"cms-dialog-overlay-blur":"",...$(z.overlayClass)]),D(L.panel,"--cms-dialog-width",n(z.width),K),D(L.panel,"--cms-dialog-min-width",n(z.minWidth),K),D(L.panel,"--cms-dialog-max-width",n(z.maxWidth),K),D(L.panel,"--cms-dialog-max-height",n(z.maxHeight),K),D(L.panel,"--cms-dialog-body-max-height",n((Y=z.bodyMaxHeight)!=null?Y:z.contentMaxHeight),K),z.style&&Object.assign(L.panel.style,z.style),wt(L.panel,z),L.panel.setAttribute("role",z.role||"dialog"),L.panel.setAttribute("aria-modal",z.modal===!1?"false":"true"),z.ariaLabel?L.panel.setAttribute("aria-label",z.ariaLabel):L.panel.removeAttribute("aria-label")},Ae=()=>{d!=null&&d.panel&&d.panel.replaceChildren(X())},ye=(L={})=>(L&&typeof L=="object"&&(c={...c,...L}),d&&(U(d),Ae()),Q),pe=(L=null)=>{var Y,k,v,M,x;if(L&&typeof L=="object"&&(c={...c,...L}),d)return U(d),Ae(),d;h=document.activeElement;const z=R(),H=z.persistent===!0;d=CMSwift.overlay.open(()=>X(),{type:"dialog",backdrop:z.backdrop!==!1,lockScroll:z.lockScroll!==!1,trapFocus:z.trapFocus!==!1,autoFocus:z.autoFocus!==!1,closeOnOutside:(Y=z.closeOnOutside)!=null?Y:!H,closeOnBackdrop:(k=z.closeOnBackdrop)!=null?k:!H,closeOnEsc:(v=z.closeOnEsc)!=null?v:!H,className:ue(["cms-dialog"]),onClose:()=>{var g,p,T;(g=d==null?void 0:d.panel)==null||g.removeEventListener("click",y),d=null,(T=(p=R()).onClose)==null||T.call(p),h&&typeof h.focus=="function"&&setTimeout(()=>h.focus(),0)}});const y=g=>{const p=g.target;p&&p.closest&&p.closest("[data-dialog-close]")&&we()};return d.panel.addEventListener("click",y),U(d),Ke(d),(x=(M=R()).onOpen)==null||x.call(M,d),d},we=()=>{if(!d)return;const L=d;nt(L,()=>CMSwift.overlay.close(L.id))},he=()=>!!d,me=(L=null)=>he()?(we(),null):pe(L),Q={open:pe,close:we,toggle:me,update:ye,isOpen:he,entry:()=>d,props:()=>({...c})};return Q},(mi=CMSwift.isDev)!=null&&mi.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Dialog={signature:"UI.Dialog(props) | UI.Dialog(props, ...children) -> { open, close, toggle, update, isOpen }",props:{title:"String|Node|Function|Array|({ close })=>Node",subtitle:"String|Node|Function|Array|({ close })=>Node",eyebrow:"String|Node|Function|Array|({ close })=>Node",icon:"String|Node|Function|Array",content:"Node|Function|Array|({ close })=>Node",body:"Alias di content",actions:"Node|Function|Array|({ close })=>Node",footer:"Alias di actions",size:"xs|sm|md|lg|xl|full",state:"primary|secondary|warning|danger|success|info|light|dark",color:"Alias di state",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",persistent:"boolean",closable:"boolean",closeButton:"boolean",closeIcon:"string",align:"top|center|bottom",actionsAlign:"start|center|end|between|stretch",stickyHeader:"boolean",stickyActions:"boolean",scrollable:"boolean",stackActions:"boolean",fullscreen:"boolean",backdrop:"boolean",backdropBlur:"boolean",lockScroll:"boolean",trapFocus:"boolean",autoFocus:"boolean",closeOnOutside:"boolean",closeOnBackdrop:"boolean",closeOnEsc:"boolean",slots:"{ icon?, eyebrow?, title?, subtitle?, header?, content?, body?, footer?, actions?, close?, default? }",class:"string",panelClass:"string",overlayClass:"string",style:"object"},events:{onOpen:"(entry)",onClose:"void"},slots:{icon:"Dialog icon ({ close })",eyebrow:"Eyebrow sopra il titolo ({ close })",title:"Dialog title ({ close })",subtitle:"Dialog subtitle ({ close })",header:"Header personalizzato ({ close })",content:"Dialog body ({ close })",body:"Alias di content ({ close })",footer:"Footer personalizzato ({ close })",actions:"Dialog actions ({ close })",close:"Close action ({ close })",default:"Fallback body content ({ close })"},description:"Dialog overlay standardizzato con varianti, animazioni, slots strutturati e API imperativa.",returns:"Object { open(overrides?), close(), toggle(overrides?), update(props), isOpen(), entry(), props() }"}),C.TabPanel=(...t)=>{var ze,Ce,Re,J,B,G,q,Le,Z,Ve,je,$e,et;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=Array.isArray(e.tabs)?e.tabs:Array.isArray(e.items)?e.items:[],f=de(e.model,"UI.TabPanel:model"),c=e.id||"cms-tabpanel-"+Math.random().toString(36).slice(2,9),d=j=>String(n(j)||"vertical").toLowerCase()==="horizontal"?"horizontal":"vertical",h=j=>String(n(j)||"before").toLowerCase()==="after"?"after":"before",b=j=>{const Me=String(n(j)||"").toLowerCase();return Me==="pills"||Me==="pill"?"pills":Me==="soft"||Me==="card"?"soft":"line"},$=j=>{const Me=n(j);return Me==null||Me===""?null:CMSwift.uiColors.includes(Me)?`var(--cms-${Me})`:String(Me)},F=d(e.orientation||e.orient||e.direction),D=h(e.navPosition||e.barPosition||e.position),R=b(e.variant||(e.pills?"pills":e.soft?"soft":"line")),be=!!e.wrap,ce=!!e.swipeable,ie=!!e.infinite,O=!!e.animated,te=!!((Ce=(ze=e.navFill)!=null?ze:e.fill)!=null?Ce:e.stretch),X=!!e.disabled,U=n((Re=e.transitionDuration)!=null?Re:e["transition-duration"]),Ae=(()=>{if(U==null)return 220;if(typeof U=="number")return U;const j=parseFloat(U);return Number.isFinite(j)?j:220})(),ye=n((J=e.transitionEasing)!=null?J:e["transition-easing"])||"ease",pe=(G=(B=e.transitionPrev)!=null?B:e["transition-prev"])!=null?G:null,we=(Le=(q=e.transitionNext)!=null?q:e["transition-next"])!=null?Le:null,he=$((Z=e.color)!=null?Z:e.state),me=i.map((j,Me)=>{var It,ft,Mt,Ot,Gt,Je,Ct,_t,Ft,Bt,qt,Yt,$t,Ht,jt,Kt;if(j==null)return null;if(typeof j!="object")return{name:j,labelFallback:j,panelFallback:null,noteFallback:null,iconFallback:null,badgeFallback:null,hidden:!1,raw:j,index:Me};const We=(Je=(Gt=(Ot=(Mt=(ft=(It=j.name)!=null?It:j.value)!=null?ft:j.id)!=null?Mt:j.key)!=null?Ot:j.label)!=null?Gt:j.title)!=null?Je:`tab-${Me}`,Ue=j.label!=null||j.title!=null,Qe=Ue?(Ct=j.label)!=null?Ct:j.title:j.children!=null&&j.content==null&&j.panel==null?j.children:(Ft=(_t=j.name)!=null?_t:j.value)!=null?Ft:`Tab ${Me+1}`,st=(Yt=(qt=(Bt=j.content)!=null?Bt:j.panel)!=null?qt:j.body)!=null?Yt:Ue?j.children:null,dt=(jt=(Ht=($t=j.note)!=null?$t:j.subtitle)!=null?Ht:j.description)!=null?jt:null,At=(Kt=j.icon)!=null?Kt:null,pt=Object.prototype.hasOwnProperty.call(j,"badge")?j.badge:Object.prototype.hasOwnProperty.call(j,"counter")?j.counter:null;return{...j,name:We,labelFallback:Qe,panelFallback:st,noteFallback:dt,iconFallback:At,badgeFallback:pt,index:Me}}).filter(Boolean).filter(j=>j.hidden!==!0&&j.visible!==!1),Q=l(["cms-clear-set","cms-tabpanel","cms-singularity",F,`variant-${R}`,a(be,"wrap"),a(O,"animated"),a(te,"nav-fill"),a(X,"disabled"),a(D==="after","nav-after"),e.class]),L=CMSwift.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"]);L.class=Q,L.style=e.style;const z=_.div(L);O&&(z.style.setProperty("--cms-tabpanel-duration",`${Ae}ms`),z.style.setProperty("--cms-tabpanel-easing",ye)),he&&z.style.setProperty("--cms-tabpanel-accent",he);const H=_.div({class:l(["cms-tabpanel-nav",e.navClass]),role:"tablist","aria-orientation":F}),y=_.div({class:l(["cms-tabpanel-panels",e.panelsClass])}),Y=[],k=[];let v=-1;const M=()=>F==="horizontal",x=(j,Me,We)=>({tab:j,name:j.name,index:Me,active:We,value:j.name,select:()=>se(Me),next:()=>P(),prev:()=>ve()}),g=(j,Me,We=!1)=>{var Qe;if(!me.length)return-1;let Ue=j;for(let st=0;st<me.length;st+=1){if(Ue+=Me,Ue>=me.length){if(!We)return-1;Ue=0}else if(Ue<0){if(!We)return-1;Ue=me.length-1}if(!((Qe=me[Ue])!=null&&Qe.disabled))return Ue}return-1},p=j=>{var We;const Me=(We=Y[j])==null?void 0:We.btn;!Me||typeof Me.focus!="function"||requestAnimationFrame(()=>Me.focus())},T=(j,Me,We)=>{const Ue=x(j,Me,We),Qe=CMSwift.ui.renderSlot(o,"label",Ue,j.labelFallback);return E(null,"default",{},Qe)},V=(j,Me)=>{var _t,Ft,Bt,qt,Yt;const We=Me===v,Ue=`${c}-tab-${Me}`,Qe=`${c}-panel-${Me}`,st=x(j,Me,We),dt=T(j,Me,We),At=j.iconFallback!=null?typeof j.iconFallback=="string"?C.Icon({name:j.iconFallback,size:(Bt=(Ft=(_t=j.iconSize)!=null?_t:j.size)!=null?Ft:e.size)!=null?Bt:null}):j.iconFallback:null,pt=E(o,"icon",st,At),It=E(o,"note",st,j.noteFallback),ft=E(o,"badge",st,j.badgeFallback),Mt=_.span({class:"cms-tabpanel-tab-inner"},pt.length?_.span({class:"cms-tabpanel-tab-icon"},...pt):null,_.span({class:"cms-tabpanel-tab-copy"},_.span({class:"cms-tabpanel-tab-label"},...dt.length?dt:[""]),It.length?_.span({class:"cms-tabpanel-tab-note"},...It):null),ft.length?_.span({class:"cms-tabpanel-tab-badge"},...ft):null),Ot=E(o,"tab",{...st,label:dt,icon:pt,note:It,badge:ft,tabId:Ue,panelId:Qe},Mt),Gt=$t=>{if(X||j.disabled)return;const Ht=$t.key;if(Ht==="Enter"||Ht===" "){$t.preventDefault(),se(Me);return}if(Ht==="Home"){$t.preventDefault();const Lt=me.findIndex(an=>!an.disabled);Lt>=0&&(se(Lt),p(Lt));return}if(Ht==="End"){$t.preventDefault();const Lt=(()=>{var an;for(let mn=me.length-1;mn>=0;mn-=1)if(!((an=me[mn])!=null&&an.disabled))return mn;return-1})();Lt>=0&&(se(Lt),p(Lt));return}const jt=M()?["ArrowLeft"]:["ArrowUp"],Kt=M()?["ArrowRight"]:["ArrowDown"];if(jt.includes(Ht)){$t.preventDefault();const Lt=g(Me,-1,ie);Lt>=0&&(se(Lt,{dir:"prev"}),p(Lt));return}if(Kt.includes(Ht)){$t.preventDefault();const Lt=g(Me,1,ie);Lt>=0&&(se(Lt,{dir:"next"}),p(Lt))}},Je=C.Btn({class:l(["cms-tabpanel-tab",a(We,"active"),a(j.disabled||X,"disabled"),e.tabClass,j.tabClass||j.class]),type:"button",id:Ue,role:"tab",disabled:!!(j.disabled||X),"aria-selected":We?"true":"false","aria-controls":Qe,tabindex:We?"0":"-1",outline:R==="pills"&&!We,color:R==="pills"&&We?j.color||e.color||e.state||"primary":null,size:(Yt=(qt=j.size)!=null?qt:e.size)!=null?Yt:null,style:{...e.tabStyle||{},...j.tabStyle||{}},onClick:()=>{j.disabled||X||se(Me)},onKeydown:Gt},...Ot),Ct=_.div({class:l(["cms-tabpanel-nav-btn",a(We,"active"),j.navClass]),"data-name":j.name},Je,_.span({class:"tab-indicator"}));return Y[Me]={btn:Je,wrap:Ct,index:Me},Ct},ne=(j,Me)=>{const We=Me===v,Ue=`${c}-tab-${Me}`,Qe=`${c}-panel-${Me}`,st=x(j,Me,We),dt=CMSwift.ui.renderSlot(o,"panel",st,j.panelFallback),At=_.div({class:l(["cms-tabpanel-panel",a(We,"active"),e.panelClass,j.panelClass]),style:{...e.panelStyle||{},...j.panelStyle||{}},"data-name":j.name,role:"tabpanel",id:Qe,tabindex:0,"aria-labelledby":Ue,"aria-hidden":We?"false":"true"},...E(null,"default",{},dt));return k[Me]=At,At},re=me.map((j,Me)=>V(j,Me)),ke=CMSwift.ui.renderSlot(o,"nav",{tabs:me,active:()=>{var j;return v>=0?(j=me[v])==null?void 0:j.name:null},activeIndex:()=>v,activeTab:()=>v>=0?me[v]:null,select:j=>{typeof j=="number"?se(j):fe(j)},next:()=>P(),prev:()=>ve(),nodes:re,orientation:F,position:D,variant:R},re);E(null,"default",{},ke).forEach(j=>H.appendChild(j)),me.length?me.forEach((j,Me)=>y.appendChild(ne(j,Me))):E(o,"empty",{tabs:me},(Ve=e.empty)!=null?Ve:_.div({class:"cms-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(Me=>y.appendChild(Me));const I=j=>{if(!O)return;const Me=j==="next"?"18px":"-18px",We=j==="next"?"-18px":"18px";z.style.setProperty("--cms-tabpanel-enter",Me),z.style.setProperty("--cms-tabpanel-leave",We)},u=()=>{const j=[];pe&&j.push(...String(pe).split(/\s+/)),we&&j.push(...String(we).split(/\s+/)),j.length&&y.classList.remove(...j.filter(Boolean))},N=j=>{u();const Me=j==="prev"?pe:we;if(!Me)return;const We=String(Me).split(/\s+/).filter(Boolean);We.length&&(y.classList.add(...We),setTimeout(()=>y.classList.remove(...We),Ae+40))},w=j=>{var Ue;const Me=Y.find(({btn:Qe})=>Qe.classList.contains("active")),We=(Ue=Me==null?void 0:Me.btn.parentNode)==null?void 0:Ue.getBoundingClientRect();Y.forEach(({btn:Qe,index:st})=>{const dt=st===j,At=Qe.parentNode;if(!At)return;const pt=At.getBoundingClientRect();At.isConnected&&We&&(At.style.setProperty("--nav-pos-x",We.left-pt.left+"px"),At.style.setProperty("--nav-pos-y",We.top-pt.top+"px")),At.classList.toggle("active",dt),Qe.classList.toggle("active",dt),Qe.setAttribute("aria-selected",dt?"true":"false"),Qe.setAttribute("tabindex",dt?"0":"-1")})},le=(j,Me,We)=>{I(We),k.forEach((Ue,Qe)=>{if(!Ue)return;const st=Qe===Me,dt=Qe===j;st?(Ue.classList.add("active"),Ue.classList.remove("leaving"),Ue.setAttribute("aria-hidden","false")):(Ue.classList.remove("active"),Ue.setAttribute("aria-hidden","true"),O&&dt?(Ue.classList.add("leaving"),setTimeout(()=>Ue.classList.remove("leaving"),Ae+40)):Ue.classList.remove("leaving"))})},Ne=(j,Me)=>j<0||j===Me||ie&&j===me.length-1&&Me===0?"next":ie&&j===0&&Me===me.length-1?"prev":Me>j?"next":"prev",se=(j,Me={})=>{var st,dt;if(j==null||j<0||j>=me.length||(st=me[j])!=null&&st.disabled)return;const We=v;if(We===j)return;v=j;const Ue=me[j],Qe=Me.dir||Ne(We,j);f&&!Me.fromModel&&f.set(Ue.name),w(j),le(We,j,Qe),N(Qe),z.dataset.active=String(Ue.name),(dt=e.onChange)==null||dt.call(e,Ue.name,Ue,j)},fe=(j,Me={})=>{if(!me.length)return;const We=me.findIndex(Ue=>Ue.name==j);We!==-1&&se(We,Me)},P=()=>{if(!me.length)return;const j=v<0?me.findIndex(Me=>!Me.disabled):g(v,1,ie);j<0||se(j,{dir:"next"})},ve=()=>{if(!me.length)return;const j=v<0?(()=>{var Me;for(let We=me.length-1;We>=0;We-=1)if(!((Me=me[We])!=null&&Me.disabled))return We;return-1})():g(v,-1,ie);j<0||se(j,{dir:"prev"})};if(ce){let j=0,Me=0,We=!1;const Ue=42;y.addEventListener("pointerdown",Qe=>{Qe.button!=null&&Qe.button!==0||(We=!0,j=Qe.clientX,Me=Qe.clientY)}),y.addEventListener("pointerup",Qe=>{if(!We)return;We=!1;const st=Qe.clientX-j,dt=Qe.clientY-Me;Math.abs(st)<Ue||Math.abs(st)<Math.abs(dt)||(st<0?P():ve())}),y.addEventListener("pointercancel",()=>{We=!1}),y.addEventListener("pointerleave",()=>{We=!1})}const xe=f?f.get():(et=($e=(je=e.value)!=null?je:e.defaultValue)!=null?$e:e.default)!=null?et:null;if(me.length){const j=me.findIndex(Me=>Me.name==xe);if(j>=0)se(j,{fromModel:!0});else{const Me=me.findIndex(We=>!We.disabled);Me>=0&&(se(Me,{fromModel:!0}),f&&f.set(me[Me].name))}}return f&&f.watch(j=>fe(j,{fromModel:!0}),"UI.TabPanel:watch"),D==="after"?(z.appendChild(y),z.appendChild(H)):(z.appendChild(H),z.appendChild(y)),E(o,"default",{},s).forEach(j=>z.appendChild(j)),wt(z,e),z._tabs=()=>me.slice(),z._active=()=>v>=0?me[v]:null,z._getValue=()=>{var j;return v>=0?(j=me[v])==null?void 0:j.name:null},z._setValue=j=>fe(j),z._select=j=>{typeof j=="number"?se(j):fe(j)},z._next=P,z._prev=ve,z},(gi=CMSwift.isDev)!=null&&gi.call(CMSwift)&&(C.meta=C.meta||{},C.meta.TabPanel={signature:"UI.TabPanel(props) | UI.TabPanel(props, ...children)",props:{tabs:{type:"Array<{ name?, value?, label?, title?, note?, subtitle?, icon?, badge?, content?, panel?, body?, children?, disabled?, hidden?, tabClass?, panelClass? }>",description:"Definizione dei tab. Supporta alias multipli per label e contenuto.",category:"data"},items:{type:"Array",description:"Alias di `tabs`.",category:"data"},value:{type:"any",description:"Valore iniziale o controllato del tab attivo.",category:"data"},defaultValue:{type:"any",description:"Alias esplicito per il tab iniziale quando non usi `model`.",category:"data"},model:{type:"[get,set] signal",description:"Binding reattivo del tab attivo.",category:"data"},orientation:{type:"vertical|horizontal",description:"Orientamento della navigazione.",values:["vertical","horizontal"],default:"vertical",category:"layout"},navPosition:{type:"before|after",description:"Posizione della barra tab rispetto ai pannelli.",values:["before","after"],default:"before",category:"layout"},variant:{type:"line|pills|soft",description:"Stile visivo della navigazione tab.",values:["line","pills","soft"],default:"line",category:"style"},wrap:{type:"boolean",description:"Permette al nav di andare a capo quando lo spazio non basta.",default:!1,category:"layout"},navFill:{type:"boolean",description:"Distribuisce i tab sulla larghezza disponibile.",default:!1,category:"layout"},swipeable:{type:"boolean",description:"Abilita swipe sui pannelli.",default:!1,category:"behavior"},infinite:{type:"boolean",description:"Quando attivo, next/prev cicla dal primo all'ultimo tab.",default:!1,category:"behavior"},animated:{type:"boolean",description:"Abilita la transizione fra pannelli.",default:!1,category:"behavior"},transitionDuration:{type:"number",description:"Durata animazione in millisecondi.",default:220,category:"behavior"},transitionEasing:{type:"string",description:"Timing function CSS dell'animazione.",default:"ease",category:"behavior"},transitionPrev:{type:"string",description:"Classi custom applicate durante la transizione verso il tab precedente.",category:"behavior"},transitionNext:{type:"string",description:"Classi custom applicate durante la transizione verso il tab successivo.",category:"behavior"},tabClass:{type:"string",description:"Classi aggiuntive per tutti i bottoni tab.",category:"style"},tabStyle:{type:"object",description:"Style inline applicato a tutti i bottoni tab.",category:"style"},navClass:{type:"string",description:"Classi aggiuntive per il wrapper della nav.",category:"style"},panelsClass:{type:"string",description:"Classi aggiuntive per il wrapper dei pannelli.",category:"style"},panelClass:{type:"string",description:"Classi aggiuntive comuni per ogni pannello.",category:"style"},panelStyle:{type:"object",description:"Style inline comune per ogni pannello.",category:"style"},empty:{type:"Node|Function|Array",description:"Fallback visuale quando `tabs` e `items` sono vuoti.",category:"state"},disabled:{type:"boolean",description:"Disabilita l'intero componente.",default:!1,category:"state"},slots:{type:"{ nav?, tab?, label?, icon?, note?, badge?, panel?, empty?, default? }",description:"Slot strutturati per personalizzare nav, label, badge e contenuto.",category:"general"}},slots:{nav:{type:"Function|Node|Array",description:"Renderer completo della navigazione. Riceve `tabs`, `active()`, `activeTab()`, `select()`, `next()`, `prev()`, `nodes`, `orientation`, `position`, `variant`."},tab:{type:"Function|Node|Array",description:"Contenuto interno del bottone tab. Riceve `tab`, `name`, `index`, `active`, `label`, `icon`, `note`, `badge`, `select()`."},label:{type:"Function|Node|Array",description:"Label del tab."},icon:{type:"Function|Node|Array",description:"Icona del tab."},note:{type:"Function|Node|Array",description:"Nota, subtitle o descrizione breve sotto la label."},badge:{type:"Function|Node|Array",description:"Badge o counter allineato a destra del tab."},panel:{type:"Function|Node|Array",description:"Renderer del pannello attivo/inattivo. Riceve `tab`, `name`, `index`, `active`, `select()`, `next()`, `prev()`."},empty:{type:"Function|Node|Array",description:"Fallback quando non ci sono tab."},default:{type:"Node|Array|Function",description:"Contenuto extra appendato dopo il componente."}},events:{onChange:"(name, tab, index)"},returns:"HTMLDivElement con API `_getValue()`, `_setValue(value)`, `_select(value)`, `_next()`, `_prev()`, `_active()`, `_tabs()`",description:"Tab panel standardizzato con nav accessibile, slot strutturati, model reattivo, swipe e animazioni."});function Ji(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Xo({title:t,message:e,contentNode:s,okText:o,cancelText:i,showCancel:f,onOk:c,onCancel:d,persistent:h}){us();const b=_.div({class:"cms-dialog-backdrop",onClick:ce=>{ce.target===b&&h!==!0&&(d==null||d())}}),$=E(null,"default",{},t),F=E(null,"default",{},e),D=E(null,"default",{},s),R=_.div({class:"cms-dialog cms-panel"},$.length?_.h3(...$):null,F.length?_.p(...F):null,...D,_.div({class:"cms-dialog-actions"},f?CMSwift.ui.Btn({onClick:d},i||"Annulla"):null,CMSwift.ui.Btn({color:"primary",onClick:c},o||"OK")));b.appendChild(R),us().appendChild(b);const be=ce=>{ce.key==="Escape"&&(d==null||d())};return document.addEventListener("keydown",be,{once:!0}),{backdrop:b,close:()=>Ji(b)}}ot.dialog.alert=function(t,e={}){return new Promise(s=>{const{backdrop:o,close:i}=Xo({title:e.title||"Info",message:t,okText:e.okText||"OK",showCancel:!1,persistent:e.persistent,onOk:()=>{i(),s(!0)},onCancel:()=>{i(),s(!0)}})})},ot.dialog.confirm=function(t={}){return new Promise(e=>{const{close:s}=Xo({title:t.title||"Conferma",message:t.message||"",okText:t.okText||"Conferma",cancelText:t.cancelText||"Annulla",showCancel:!0,persistent:t.persistent,onOk:()=>{s(),e(!0)},onCancel:()=>{s(),e(!1)}})})},ot.dialog.prompt=function(t={}){return new Promise(e=>{const s=CMSwift.ui.Input({class:"cms-dialog-input",type:t.type||"text",placeholder:t.placeholder||""});t.value!=null&&(s.value=String(t.value));const{close:o}=Xo({title:t.title||"Inserisci valore",message:t.message||"",okText:t.okText||"OK",cancelText:t.cancelText||"Annulla",showCancel:!0,contentNode:_.div(s),persistent:t.persistent,onOk:()=>{const i=s.value;o(),e(i)},onCancel:()=>{o(),e(null)}});setTimeout(()=>s.focus(),0)})},ot.services=ot.services||{},ot.services.loading=ot.services.loading||{},ot.loading=ot.services.loading;let tn=null,bo=0;function ds(){if(tn)return tn;tn=document.createElement("div"),tn.className="cms-loading-backdrop",tn.style.cssText=`
|
|
2
|
+
position: fixed; inset: 0;
|
|
3
|
+
background: rgba(0,0,0,0.45);
|
|
4
|
+
display: none;
|
|
5
|
+
align-items: center; justify-content: center;
|
|
6
|
+
z-index: 10001;
|
|
7
|
+
padding: 14px;
|
|
8
|
+
`;const t=document.createElement("div");t.className="cms-panel cms-loading-card",t.style.cssText=`
|
|
9
|
+
padding: 14px 16px;
|
|
10
|
+
border-radius: var(--cms-r-lg);
|
|
11
|
+
min-width: 260px;
|
|
12
|
+
display:flex; gap: 12px; align-items:center;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
`;const e=document.createElement("div");e.className="cms-loading-spinner",e.style.cssText=`
|
|
15
|
+
width: 18px; height: 18px;
|
|
16
|
+
border-radius: 50%;
|
|
17
|
+
border: 2px solid rgba(255,255,255,0.25);
|
|
18
|
+
border-top-color: var(--cms-primary);
|
|
19
|
+
animation: cmsSpin 0.9s linear infinite;
|
|
20
|
+
`;const s=document.createElement("div");s.className="cms-muted cms-loading-text",s.textContent="Loading...";const o=document.createElement("div");o.className="cms-loading-progress",o.style.cssText=`
|
|
21
|
+
width: 100%;
|
|
22
|
+
height: 6px;
|
|
23
|
+
border-radius: 999px;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
background: rgba(255,255,255,0.08);
|
|
26
|
+
display: none;
|
|
27
|
+
`;const i=document.createElement("div");i.className="cms-loading-progress-bar",i.style.cssText=`
|
|
28
|
+
height: 100%;
|
|
29
|
+
width: 0%;
|
|
30
|
+
background: var(--cms-primary);
|
|
31
|
+
transition: width 200ms ease;
|
|
32
|
+
`,o.appendChild(i);const f=document.createElement("div");f.style.cssText="display:flex; gap: 12px; align-items:center; width: 100%;",f.appendChild(e),f.appendChild(s),t.appendChild(f),t.appendChild(o),tn.appendChild(t),document.body.appendChild(tn);const c=document.createElement("style");return c.textContent=`
|
|
33
|
+
@keyframes cmsSpin { to { transform: rotate(360deg); } }
|
|
34
|
+
`,document.head.appendChild(c),tn._textNode=s,tn._spinner=e,tn._progressWrap=o,tn._progressBar=i,tn._progressActive=!1,tn}function fs(t,e){if(typeof t=="object"&&t!==null)return{...t};const s=e&&typeof e=="object"?e:{};return typeof e=="string"&&(t==null||typeof t=="number")?{...s,message:e}:{...s,message:t}}function ms(t,e){const s=e==="progress";t._spinner.style.display=s?"none":"",t._progressWrap.style.display=s?"block":"none",t._mode=e}ot.loading.show=function(t="Loading...",e={}){const s=ds(),o=fs(t,e);bo++,s._progressActive=!1,s._textNode.textContent=o.message||"Loading...",ms(s,"spinner"),o.spinner===!1&&(s._spinner.style.display="none"),s.style.display="flex"},ot.loading.hide=function(){tn&&(bo=Math.max(0,bo-1),bo===0&&(tn.style.display="none",tn._progressActive=!1))},ot.loading.progress=function(t=0,e={}){var f;const s=ds();typeof t=="object"&&t!==null&&(e=t,t=(f=t.value)!=null?f:0);const o=fs(null,e);s._progressActive||(bo++,s._progressActive=!0);const i=Math.max(0,Math.min(100,Number(t!=null?t:0)));s._textNode.textContent=o.message||"Loading...",s._progressBar.style.width=i+"%",ms(s,"progress"),s.style.display="flex"},ot.loading.wrap=async function(t,e){ot.loading.show(t);try{return await e()}finally{ot.loading.hide()}};function Qi(t){return typeof t=="function"?t():t||[]}function Jo(t,e){if(!(t==null||e==null))return typeof e!="string"||e.indexOf(".")<0?t==null?void 0:t[e]:e.split(".").reduce((s,o)=>s==null?s:s[o],t)}function Zi(t,e){return t==null&&e==null?0:t==null?-1:e==null?1:typeof t=="number"&&typeof e=="number"?t-e:String(t).localeCompare(String(e),void 0,{numeric:!0,sensitivity:"base"})}function er(t){const e=Qi(t);return Array.isArray(e)?e:[]}function gs(t){var e,s,o,i;return(i=(o=(s=(e=t==null?void 0:t.label)!=null?e:t==null?void 0:t.title)!=null?s:t==null?void 0:t.header)!=null?o:t==null?void 0:t.key)!=null?i:""}function Qo(t,e){var s,o;return(o=(s=t==null?void 0:t.sortKey)!=null?s:t==null?void 0:t.key)!=null?o:`__col_${e}`}function ps(t,e){return t.find((s,o)=>Qo(s,o)===e||(s==null?void 0:s.key)===e)||null}function Do(t,e,s){return t?typeof t.get=="function"?t.get(e,{row:e,rowIndex:s,col:t}):typeof t.value=="function"?t.value(e,{row:e,rowIndex:s,col:t}):typeof t.key=="string"?Jo(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function Ho(t,e){return typeof t=="function"?t(e)||{}:t||{}}function jo(t){if(t==null)return"";if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return String(t);if(Array.isArray(t))return t.map(jo).filter(Boolean).join(" ");if(typeof Node!="undefined"&&t instanceof Node)return t.textContent||"";if(typeof t=="object"){if(typeof t.textContent=="string")return t.textContent;try{return JSON.stringify(t)}catch(e){return""}}return String(t)}function tr(t,e){const o=(Array.isArray(t)?t:e).map(i=>Number(i)).filter(i=>Number.isFinite(i)&&i>0);return o.length?Array.from(new Set(o)):e}function nr(t,e,s,o){const i=o.searchBy||o.searchPredicate;if(typeof i=="function")return!!i(t,{query:s,columns:e});const f=String(s||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(!f.length)return!0;const c=Array.isArray(o.searchKeys)&&o.searchKeys.length?o.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var $;return($=b==null?void 0:b.searchKey)!=null?$:b==null?void 0:b.key}).filter(Boolean),d=[];if(c.length)for(const b of c)if(typeof b=="function")d.push(jo(b(t)));else{const $=e.find(F=>(F==null?void 0:F.key)===b||(F==null?void 0:F.searchKey)===b);d.push(jo($?Do($,t,-1):Jo(t,b)))}else d.push(jo(t));const h=d.join(" ").toLowerCase();return f.every(b=>h.includes(b))}C.Table=(...t)=>{var ze,Ce,Re,J;const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=Array.isArray(e.columns)?e.columns:[],f=tr(e.pageSizeOptions,[5,10,20,50]),c=Number((Ce=(ze=e.pageSize)!=null?ze:f[0])!=null?Ce:10)||10,d=Array.from(new Set([...f,c])).sort((B,G)=>B-G),h=e.initialSort||(e.sortBy?{key:e.sortBy,dir:e.sortDir==="desc"?"desc":"asc"}:null),b=e.searchable===!0||typeof e.searchable=="string"||e.searchPlaceholder!=null||e.search!=null||e.query!=null||!!e.searchModel||!!e.queryModel||Array.isArray(e.searchKeys)||typeof e.searchBy=="function"||typeof e.searchPredicate=="function",$=de(e.searchModel||e.queryModel,"UI.Table:query"),[F,D]=ot.reactive.signal(Math.max(1,Number(e.page||1)||1)),[R,be]=ot.reactive.signal(c),[ce,ie]=ot.reactive.signal(h),[O,te]=ot.reactive.signal(String((J=$?$.get():(Re=e.search)!=null?Re:e.query)!=null?J:"")),X=B=>{const G=String(B!=null?B:"");te(G),$&&$.set(G),D(1)},U=B=>{const G=Number(B)||c;be(G),D(1)},Ae=(B,G)=>{const q=Qo(B,G),Le=ce();!Le||Le.key!==q&&Le.key!==(B==null?void 0:B.key)?ie({key:q,dir:"asc"}):Le.dir==="asc"?ie({key:q,dir:"desc"}):ie(null),D(1)};let ye=null;$&&$.watch(B=>{const G=String(B!=null?B:"");te(G),ye&&ye.value!==G&&(ye.value=G),D(1)},"UI.Table:queryWatch");const pe=CMSwift.omit(e,["columns","rows","rowKey","loading","page","pageSize","pageSizeOptions","pagination","initialSort","sortBy","sortDir","search","query","searchable","searchPlaceholder","searchKeys","searchBy","searchPredicate","searchModel","queryModel","filter","actions","actionsLabel","emptyText","loadingText","onRowClick","onRowDblClick","tableClass","tableStyle","cardClass","dense","striped","hover","stickyHeader","toolbar","toolbarStart","toolbarEnd","caption","footer","status","rowClass","rowAttrs","minTableWidth","hideHeader","hideFooter","slots","body"]);pe.class=l(["cms-table-card",e.class,e.cardClass]),e.dense!=null&&(pe.dense=e.dense);const we=_.div({class:"cms-table-shell"}),he=E(o,"default",{},s);he.length&&we.appendChild(_.div({class:"cms-table-lead"},...he));const me=E(o,"toolbarStart",{},e.toolbarStart),Q=E(o,"toolbar",{},e.toolbar),L=E(o,"toolbarEnd",{},e.toolbarEnd),z=_.div({class:"cms-table-toolbar"}),H=_.div({class:"cms-table-toolbar-main"}),y=_.div({class:"cms-table-toolbar-side"});me.forEach(B=>H.appendChild(B)),Q.forEach(B=>H.appendChild(B));const Y=E(o,"search",{query:O(),getQuery:O,setQuery:X},null);if(Y.length)Y.forEach(B=>y.appendChild(B));else if(b){ye=_.input({type:"search",class:"cms-input",placeholder:typeof e.searchable=="string"?e.searchable:e.searchPlaceholder||"Cerca nella tabella",value:String(O()||"")}),ye.addEventListener("input",()=>X(ye.value));const B=C.Btn({class:"cms-table-search-clear",outline:!0,onClick:()=>{ye&&(ye.value=""),X("")}},"Reset");y.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),ye,B))}L.forEach(B=>y.appendChild(B)),(H.childNodes.length||y.childNodes.length)&&(z.appendChild(H),z.appendChild(y),we.appendChild(z));const k=_.div({class:"cms-singularity cms-table-chip"},""),v=_.div({class:"cms-singularity cms-table-chip"},""),M=_.div({class:"cms-singularity cms-table-chip"},""),x=E(o,"status",{},e.status),g=_.div({class:"cms-table-status"},k,v,M,...x);we.appendChild(g);const p=E(o,"caption",{},e.caption);p.length&&we.appendChild(_.div({class:"cms-table-caption"},...p));const T=_.thead(),V=_.tbody(),ne=!!e.actions||!!o.actions,re=l(["cms-table",a(e.dense,"dense"),a(e.striped,"striped"),a(e.hover!==!1,"hover"),a(e.stickyHeader!==!1,"sticky-head"),e.tableClass]),ke={...e.tableStyle||{}};e.minTableWidth!=null&&(ke["--cms-table-min-width"]=K(e.minTableWidth));const I=_.table({class:re,style:ke},T,V),u=_.div({class:"cms-singularity cms-table-wrap"},I);we.appendChild(u);const N=_.div({class:"cms-singularity cms-table-chip"},""),w=_.div({class:"cms-singularity cms-table-chip"},""),le=C.Btn({outline:!0,onClick:()=>D(Math.max(1,F()-1))},"\u2039"),Ne=C.Btn({outline:!0,onClick:()=>D(F()+1)},"\u203A"),se=_.div({class:"cms-singularity cms-table-chip"},""),fe=_.select({class:"cms-input cms-table-size-select"},...d.map(B=>to({value:String(B)},String(B))));fe.value=String(R()),fe.addEventListener("change",()=>U(fe.value));const P=E(o,"footer",{},e.footer),ve=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},N,w,_.label({class:"cms-table-size"},_.span("Righe"),fe)),_.div({class:"cms-table-foot-extra"},...P,_.div({class:"cms-table-pager"},le,se,Ne)));e.hideFooter!==!0&&we.appendChild(ve);const xe=()=>{if(T.innerHTML="",e.hideHeader)return;const B=_.tr();if(i.forEach((G,q)=>{var We,Ue;const Le={col:G,colIndex:q,sort:ce()},Z={...Ho(G==null?void 0:G.style,{...Le,header:!0}),...Ho((We=G==null?void 0:G.headerStyle)!=null?We:G==null?void 0:G.thStyle,{...Le,header:!0})};(G==null?void 0:G.width)!=null&&(Z.width=K(G.width)),(G==null?void 0:G.minWidth)!=null&&(Z.minWidth=K(G.minWidth)),(G==null?void 0:G.maxWidth)!=null&&(Z.maxWidth=K(G.maxWidth)),G!=null&&G.align&&(Z.textAlign=G.align);let Ve=E(G==null?void 0:G.slots,"header",Le,null);if(!Ve.length){const Qe=typeof(G==null?void 0:G.header)=="function"?G.header(Le):(Ue=G==null?void 0:G.header)!=null?Ue:gs(G);Ve=E(o,"header",Le,Qe)}const je=ce(),$e=Qo(G,q),et=(G==null?void 0:G.sortable)!==!1&&((G==null?void 0:G.key)!=null||typeof(G==null?void 0:G.get)=="function"||typeof(G==null?void 0:G.compare)=="function"),j=!!je&&(je.key===$e||je.key===(G==null?void 0:G.key)),Me=_.th({class:l(["cms-table-head-cell",a(G==null?void 0:G.nowrap,"is-nowrap"),a(et,"cms-table-sortable"),a(j,"is-sorted"),G==null?void 0:G.headerClass]),style:Z});et?Me.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>Ae(G,q)},_.span({class:"cms-table-head-label"},...Ve),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},j?je.dir==="asc"?"\u2191":"\u2193":"\u2195"))):Ve.forEach(Qe=>Me.appendChild(Qe)),B.appendChild(Me)}),ne){const G=E(o,"actionsHeader",{},e.actionsLabel||"Azioni");B.appendChild(_.th({class:"cms-table-head-cell cms-table-head-actions",style:{textAlign:"right"}},...G))}T.appendChild(B)},Oe=(B,G)=>{const q={columns:i,count:i.length},Le=E(o,B,q,G),Z=String(i.length+(ne?1:0));V.appendChild(_.tr(_.td({colSpan:Z,class:"cms-table-state"},...Le)))};return ot.reactive.effect(()=>{const B=er(e.rows),G=String(O()||"").trim(),q=ce(),Le=typeof e.loading=="function"?!!e.loading():!!e.loading,Z=e.pagination!==!1;if(xe(),V.innerHTML="",ye&&ye.value!==O()&&(ye.value=O()),fe.value!==String(R())&&(fe.value=String(R())),Le){k.textContent="Caricamento in corso",v.style.display="none",M.style.display="none",N.textContent="Loading\u2026",w.textContent="",se.textContent="Pagina 1",le.disabled=!0,Ne.disabled=!0,Oe("loading",e.loadingText||"Loading...");return}let Ve=B.slice();const je=Ve.length;if(typeof e.filter=="function"&&(Ve=Ve.filter((st,dt)=>e.filter(st,{row:st,index:dt,query:G,rows:B,columns:i}))),G&&(Ve=Ve.filter(st=>nr(st,i,G,e))),q){const st=ps(i,q.key);st&&Ve.sort((dt,At)=>{const pt=Do(st,dt,-1),It=Do(st,At,-1),ft=typeof st.compare=="function"?st.compare(pt,It,dt,At):Zi(pt,It);return q.dir==="asc"?ft:-ft})}const $e=Ve.length,et=Math.max(1,Number(R())||c),j=Z?Math.max(1,Math.ceil($e/et)):1,Me=Z?Math.min(F(),j):1;Me!==F()&&D(Me);const We=Z?(Me-1)*et:0,Ue=Z?We+et:$e,Qe=Ve.slice(We,Ue);if(k.textContent=$e===je?`${$e} righe`:`${$e} di ${je} righe`,v.textContent=G?`Ricerca: ${G}`:"",v.style.display=G?"":"none",q){const st=ps(i,q.key);M.textContent=st?`Ordine: ${gs(st)} ${q.dir==="asc"?"\u2191":"\u2193"}`:"",M.style.display=st?"":"none"}else M.style.display="none";if(N.textContent=$e?`${We+1}-${Math.min(Ue,$e)} di ${$e}`:"0 risultati",w.textContent=$e!==je?`Dataset totale ${je}`:`Page size ${et}`,se.textContent=Z?`Pagina ${Me} / ${j}`:"Tutte le righe",le.disabled=!Z||Me<=1,Ne.disabled=!Z||Me>=j,fe.disabled=!Z,fe.parentNode.style.display=Z?"":"none",Qe.length===0){Oe("empty",e.emptyText||"Nessun dato");return}for(let st=0;st<Qe.length;st++){const dt=Qe[st],At=We+st,pt={row:dt,rowIndex:At,pageIndex:st},It=typeof e.rowAttrs=="function"?e.rowAttrs(dt,pt)||{}:e.rowAttrs||{},ft=typeof e.rowClass=="function"?e.rowClass(dt,pt):e.rowClass,Mt=!!(e.onRowClick||e.onRowDblClick),Ot=_.tr({...It,class:l(["cms-table-row",ft,It.class,a(Mt,"is-clickable")])});if(e.rowKey){const Je=typeof e.rowKey=="function"?e.rowKey(dt,pt):Jo(dt,e.rowKey);Je!=null&&(Ot.dataset.key=String(Je))}const Gt=Je=>{const Ct=Je==null?void 0:Je.target;return!!(Ct&&Ct.closest&&Ct.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(e.onRowClick&&Ot.addEventListener("click",Je=>{Gt(Je)||e.onRowClick(dt,pt,Je)}),e.onRowDblClick&&Ot.addEventListener("dblclick",Je=>{Gt(Je)||e.onRowDblClick(dt,pt,Je)}),i.forEach((Je,Ct)=>{var Ht,jt;const _t=Do(Je,dt,At),Ft={...pt,col:Je,colIndex:Ct,value:_t},Bt={...Ho(Je==null?void 0:Je.style,Ft),...Ho((Ht=Je==null?void 0:Je.cellStyle)!=null?Ht:Je==null?void 0:Je.tdStyle,Ft)};Je!=null&&Je.align&&(Bt.textAlign=Je.align),(Je==null?void 0:Je.width)!=null&&(Bt.width=K(Je.width)),(Je==null?void 0:Je.minWidth)!=null&&(Bt.minWidth=K(Je.minWidth)),(Je==null?void 0:Je.maxWidth)!=null&&(Bt.maxWidth=K(Je.maxWidth));const qt=typeof(Je==null?void 0:Je.cellClass)=="function"?Je.cellClass(dt,Ft):(Je==null?void 0:Je.cellClass)||(Je==null?void 0:Je.class),Yt=_.td({class:l(["cms-table-cell",qt,a(Je==null?void 0:Je.nowrap,"is-nowrap")]),style:Bt});let $t=E(Je==null?void 0:Je.slots,"cell",Ft,null);if(!$t.length){const Kt=typeof(Je==null?void 0:Je.render)=="function"?Je.render(dt,Ft):typeof(Je==null?void 0:Je.format)=="function"?Je.format(_t,dt,Ft):_t,Lt=Kt==null?(jt=Je==null?void 0:Je.emptyText)!=null?jt:"":Kt;$t=E(o,"cell",Ft,Lt)}$t.length||($t=[""]),$t.forEach(Kt=>Yt.appendChild(Kt)),Ot.appendChild(Yt)}),ne){const Je={...pt},Ct=typeof e.actions=="function"?e.actions(dt,pt):e.actions;let _t=E(o,"actions",Je,Ct);_t.length||(_t=E(null,"default",Je,Ct)),Ot.appendChild(_.td({class:"cms-table-cell cms-table-cell-actions",style:{textAlign:"right"}},_.div({class:"cms-table-actions"},..._t)))}V.appendChild(Ot)}},"UI.Table:render"),pe.body=we,C.Card(pe)},(pi=CMSwift.isDev)!=null&&pi.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Table={signature:"UI.Table(props)",props:{columns:"Array<{ key, label?, sortable?, get?, value?, render?, format?, width?, minWidth?, maxWidth?, align?, compare?, style?, headerStyle?, thStyle?, cellStyle?, tdStyle?, cellClass?, headerClass?, nowrap?, searchable? }>",rows:"Array|() => Array",rowKey:"string|((row)=>string)",loading:"boolean|() => boolean",page:"number",pageSize:"number",pageSizeOptions:"number[]",pagination:"boolean",initialSort:"{ key, dir: 'asc'|'desc' }",search:"string",query:"string",searchable:"boolean|string",searchPlaceholder:"string",searchKeys:"Array<string|function>",searchModel:"[get,set] signal",filter:"(row, ctx)=>boolean",actions:"(row, ctx)=>Node|Array",actionsLabel:"string|Node|Function|Array",emptyText:"string|Node|Function|Array",loadingText:"string|Node|Function|Array",toolbar:"Node|Function|Array",toolbarStart:"Node|Function|Array",toolbarEnd:"Node|Function|Array",caption:"string|Node|Function|Array",footer:"Node|Function|Array",status:"string|Node|Function|Array",rowClass:"string|((row,ctx)=>string)",rowAttrs:"object|((row,ctx)=>object)",minTableWidth:"string|number",stickyHeader:"boolean",hideHeader:"boolean",hideFooter:"boolean",dense:"boolean",striped:"boolean",hover:"boolean",tableClass:"string",cardClass:"string",class:"string",style:"object"},slots:{default:"Contenuto introduttivo sopra la tabella",toolbarStart:"Area sinistra toolbar",toolbar:"Toolbar centrale/custom",toolbarEnd:"Area destra toolbar",search:"Sostituisce la search box built-in",header:"Header custom per colonna",cell:"Render globale celle",actions:"Render globale azioni riga",actionsHeader:"Header colonna azioni",caption:"Caption sopra la tabella",status:"Contenuto extra nella status row",loading:"Stato loading",empty:"Stato empty",footer:"Contenuto extra nel footer"},events:{onRowClick:"(row, ctx, event) => void",onRowDblClick:"(row, ctx, event) => void"},returns:"HTMLDivElement",description:"Tabella standardizzata con toolbar, ricerca, sorting, paginazione, stati e rendering flessibile."}),C.Menu=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],f=["xs","sm","md","lg","xl"];let c={...e},d=null,h=null,b=null,$=null,F=null;const D=(u,N)=>Object.prototype.hasOwnProperty.call(u||{},N),R=(u,N)=>typeof u=="function"?u(N):u,be=u=>String(u||"").split(/\s+/).filter(Boolean),ce=u=>u&&typeof u=="object"&&!u.nodeType&&!Array.isArray(u)&&!(u instanceof Function),ie=u=>!!u&&typeof u=="object"&&(u.nodeType===1||typeof u.getBoundingClientRect=="function"),O=()=>{clearTimeout($),clearTimeout(F),$=null,F=null},te=(u,N,w)=>{if(!u)return;const le=u[N]||[];le.length&&u.classList.remove(...le);const Ne=(w||[]).filter(Boolean);Ne.length&&u.classList.add(...Ne),u[N]=Ne},X=(u,N,w,le=Ne=>Ne)=>{if(u){if(w==null||w===""){u.style.removeProperty(N);return}u.style.setProperty(N,le(w))}},U=()=>c||{},Ae=u=>{var w;const N=String(n((w=u.state)!=null?w:u.color)||"").toLowerCase();return i.includes(N)?N:""},ye=u=>{const N=String(n(u.size)||"").toLowerCase();return f.includes(N)?N:""},pe=u=>{var N,w;return String(n((w=(N=u.placement)!=null?N:u.position)!=null?w:"bottom-start"))},we=()=>{var w;const u=n((w=U().delay)!=null?w:U().showDelay),N=Number(u);return Number.isFinite(N)?Math.max(0,N):0},he=()=>{const u=n(U().hideDelay),N=Number(u);return Number.isFinite(N)?Math.max(0,N):80},me=(u=null)=>{var w,le,Ne;if(u)return u;const N=U();return h||n((Ne=(le=(w=N.anchorEl)!=null?w:N.triggerEl)!=null?le:N.target)!=null?Ne:N.anchor)||null},Q=u=>{if(u==null||u===!0)return new Set(["click"]);if(u===!1)return new Set(["manual"]);const N=Array.isArray(u)?u:String(u).split(/[\s,|/]+/),w=new Set;return N.forEach(le=>{const Ne=String(le||"").trim().toLowerCase();Ne&&(Ne==="mouseenter"||Ne==="mouseover"?w.add("hover"):Ne==="blur"||Ne==="focusin"?w.add("focus"):Ne==="tap"?w.add("click"):w.add(Ne))}),w.size?w:new Set(["manual"])},L=(u,N)=>{var Ne,se,fe;let w=null,le=null;if(ie(u))w=u,ce(N)&&(le=N);else if(ce(u)){le=u;const P=(fe=(se=(Ne=u.anchorEl)!=null?Ne:u.triggerEl)!=null?se:u.target)!=null?fe:u.anchor;ie(P)&&(w=P)}else u!=null&&(w=u);return{anchorEl:w,nextProps:le}},z=(u=d==null?void 0:d.panel)=>{var N;return Array.from(((N=u==null?void 0:u.querySelectorAll)==null?void 0:N.call(u,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(w=>w.offsetParent!==null&&w.getAttribute("aria-hidden")!=="true")},H=()=>{n(U().autoFocus)!==!1&&setTimeout(()=>{const u=z();if(!u.length)return;(u.find(w=>w.classList.contains("is-active")||w.classList.contains("is-selected")||w.classList.contains("is-checked"))||u[0]).focus()},0)},y=(u,N,w="sm")=>{const le=R(u,N);return le==null?[]:typeof le=="string"?[C.Icon({name:le,size:w})]:Fe(le,{...N,as:"icon"})},Y=(u,N)=>{var We,Ue,Qe,st,dt,At,pt,It,ft,Mt,Ot,Gt,Je;const w=R(u,N);if(w==null||w===!1)return[];if(Array.isArray(w))return w.flatMap((Ct,_t)=>Y(Ct,{...N,index:_t}));if(typeof w=="function")return Y(w(N),N);if(w!=null&&w.nodeType)return[w];if(typeof w=="string"||typeof w=="number")return Y({label:w},N);if(!ce(w))return Fe(w,{...N,as:"item"});const le=String((Ue=(We=w.type)!=null?We:w.kind)!=null?Ue:"").toLowerCase();if(le==="separator"||le==="divider"||w.separator===!0||w.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const Ne=(Qe=w.items)!=null?Qe:w.children;if((le==="group"||le==="section"||Array.isArray(Ne))&&Ne!=null){const Ct={...N,item:w},_t=E(o,"groupLabel",Ct,R((st=w.label)!=null?st:w.title,Ct)),Ft=Y(Ne,Ct);return Ft.length?[_.div({class:l(["cms-menu-group",w.class])},_t.length?_.div({class:"cms-menu-group-label"},..._t):null,_.div({class:"cms-menu-group-items"},...Ft))]:[]}const se={...N,item:w,close:x,dismiss:x,open:p,toggle:ne,update:g,isOpen:re,entry:()=>d,anchorEl:me(),props:U()},fe=!!n(w.disabled),P=w.checked==null?null:!!n(w.checked),ve=!!n((dt=w.active)!=null?dt:w.selected),xe=Ae(w),Oe=n(w.href),ze=n(w.to),Ce=D(w,"closeOnSelect")?!!n(w.closeOnSelect):w.keepOpen===!0?!1:U().closeOnSelect!==!1,Re=w.role||(P!=null?"menuitemcheckbox":"menuitem"),J=y(w.icon,se),B=y((At=w.iconRight)!=null?At:w.endIcon,se),G=E(o,"itemTitle",se,R((pt=w.title)!=null?pt:w.label,se)),q=E(o,"itemSubtitle",se,R((It=w.subtitle)!=null?It:w.description,se)),Le=E(o,"itemShortcut",se,R(w.shortcut,se)),Z=E(o,"itemBadge",se,R(w.badge,se)),Ve=E(o,"item",se,R((Mt=(ft=w.content)!=null?ft:w.body)!=null?Mt:w.render,se)),je=[...Z,...Le,...P===!0&&!B.length&&!Z.length?[_.span({class:"cms-menu-entry-check"},C.Icon({name:w.checkedIcon||"check",size:"sm"}))]:[],...B],et={class:l(["cms-menu-entry","cms-menu-item",xe?`cms-state-${xe}`:"",a(ve,"is-active"),a(P===!0,"is-checked"),a(fe,"is-disabled"),w.class]),role:Re,tabIndex:fe?-1:(Ot=w.tabIndex)!=null?Ot:-1,"data-menu-item":!0,"data-menu-select":Ce?"true":"false","data-menu-close":w.close===!0?"true":null,"data-menu-keep-open":Ce?null:"true","aria-disabled":fe?"true":null,"aria-checked":P==null?null:String(P),title:(Je=(Gt=w.titleAttr)!=null?Gt:w.tooltip)!=null?Je:null,type:Oe?null:"button",href:Oe||null,target:w.target||null,rel:w.rel||(w.target==="_blank"?"noopener noreferrer":null),onClick:Ct=>{var Ft,Bt,qt,Yt;if(fe){Ct.preventDefault(),Ct.stopPropagation();return}(Bt=(Ft=U()).onItemClick)==null||Bt.call(Ft,w,se,Ct);const _t=(qt=w.onClick)==null?void 0:qt.call(w,se,Ct);Ct.defaultPrevented||(ze&&((Yt=CMSwift.router)!=null&&Yt.navigate)&&(Ct.preventDefault(),CMSwift.router.navigate(ze)),_t!==!1&&Ce&&x())}};w.attrs&&typeof w.attrs=="object"&&Object.assign(et,w.attrs);const j=Oe?_.a:_.button,Me=Ve.length?Ve:[G.length?_.div({class:"cms-menu-entry-title"},...G):null,q.length?_.div({class:"cms-menu-entry-subtitle"},...q):null].filter(Boolean);return[j(et,J.length?_.span({class:"cms-menu-entry-icon"},...J):null,_.span({class:"cms-menu-entry-main"},...Me),je.length?_.span({class:"cms-menu-entry-aside"},...je):null)]},k=()=>{var G,q,Le,Z,Ve,je,$e;const u=U(),N={close:x,dismiss:x,open:p,toggle:ne,update:g,isOpen:re,entry:()=>d,anchorEl:me(),props:u},w=y(u.icon,N,u.iconSize||"md"),le=E(o,"eyebrow",N,R(u.eyebrow,N)),Ne=E(o,"title",N,R((q=(G=u.title)!=null?G:u.heading)!=null?q:u.label,N)),se=E(o,"subtitle",N,R((Le=u.subtitle)!=null?Le:u.description,N)),fe=E(o,"before",N,R(u.before,N)),P=E(o,"header",N,R(u.header,N)),ve=E(o,"after",N,R(u.after,N)),xe=E(o,"footer",N,R(u.footer,N)),Oe=E(o,"status",N,R(u.status,N));let ze=(Z=u.content)!=null?Z:u.body;ze==null&&s&&s.length&&(ze=s);let Ce=E(o,"content",N,R(ze,N));Ce.length||(Ce=E(o,"body",N,R(ze,N))),Ce.length||(Ce=E(o,"default",N,R(ze,N)));const Re=Y((je=(Ve=u.items)!=null?Ve:u.actionsList)!=null?je:u.entries,N),J=Re.length?[]:E(o,"empty",N,R(($e=u.empty)!=null?$e:u.emptyText,N));let B=null;return P.length?B=_.div({class:l(["cms-menu-head","cms-menu-head-custom",u.headerClass])},...P):(w.length||le.length||Ne.length||se.length)&&(B=_.div({class:l(["cms-menu-head",u.headerClass])},w.length?_.div({class:"cms-menu-head-icon"},...w):null,_.div({class:"cms-menu-head-main"},le.length?_.div({class:"cms-menu-eyebrow"},...le):null,Ne.length?_.div({class:"cms-menu-title"},...Ne):null,se.length?_.div({class:"cms-menu-subtitle"},...se):null))),_.div({class:l(["cms-menu","cms-menu-shell",a(u.dense,"dense"),a(Re.length>0,"has-items"),a(xe.length>0||Oe.length>0,"has-footer"),u.class]),style:u.style||{},role:u.role||"menu","aria-label":u.ariaLabel||null},fe.length?_.div({class:"cms-menu-before"},...fe):null,B,Ce.length?_.div({class:l(["cms-menu-content",u.contentClass])},...Ce):null,Re.length?_.div({class:l(["cms-menu-items",u.itemsClass])},...Re):null,!Re.length&&J.length?_.div({class:"cms-menu-empty"},...J):null,ve.length?_.div({class:"cms-menu-after"},...ve):null,Oe.length||xe.length?_.div({class:l(["cms-menu-footer",u.footerClass])},Oe.length?_.div({class:"cms-menu-status"},...Oe):null,xe.length?_.div({class:"cms-menu-footer-actions"},...xe):null):null)},v=u=>{var Ne;if(!(u!=null&&u.panel))return;const N=U(),w=Ae(N),le=ye(N);te(u.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",le?`cms-menu-${le}`:"",w?`cms-state-${w}`:"",n(N.outline)?"outline":"",...be(N.panelClass)]),te(u.overlay,"_menuOverlayClassTokens",[...be(N.overlayClass)]),u.panel.dataset.placement=pe(N),X(u.panel,"--cms-menu-width",n(N.width),K),X(u.panel,"--cms-menu-min-width",n(N.minWidth),K),X(u.panel,"--cms-menu-max-width",n(N.maxWidth),K),X(u.panel,"--cms-menu-max-height",n(N.maxHeight),K),X(u.panel,"--cms-menu-body-max-height",n((Ne=N.bodyMaxHeight)!=null?Ne:N.contentMaxHeight),K),N.panelStyle&&Object.assign(u.panel.style,N.panelStyle),wt(u.panel,N)},M=()=>{d!=null&&d.panel&&d.panel.replaceChildren(k())},x=()=>{if(O(),!d)return;const u=d;d=null,nt(u,()=>CMSwift.overlay.close(u.id))},g=(u={})=>(u&&typeof u=="object"&&(c={...c,...u}),d&&(v(d),M(),H()),I),p=(u=null,N=null)=>{var B,G,q,Le,Z,Ve,je,$e;O();const{anchorEl:w,nextProps:le}=L(u,N);le&&(c={...c,...le});const Ne=U(),se=me(w);if(!se||n(Ne.disabled))return null;if(d&&d._anchorEl===se)return v(d),M(),H(),d;d&&x(),b=document.activeElement;let fe=null;if(d=CMSwift.overlay.open(()=>k(),{type:"menu",anchorEl:se,placement:pe(Ne),offsetX:(B=Ne.offsetX)!=null?B:0,offsetY:(q=(G=Ne.offsetY)!=null?G:Ne.offset)!=null?q:8,backdrop:Ne.backdrop===!0,lockScroll:Ne.lockScroll===!0,trapFocus:Ne.trapFocus===!0,autoFocus:!1,closeOnOutside:Ne.closeOnOutside!==!1,closeOnBackdrop:(Le=Ne.closeOnBackdrop)!=null?Le:Ne.backdrop===!0,closeOnEsc:Ne.closeOnEsc!==!1,className:ue(["cms-menu-panel"]),onClose:()=>{var et,j,Me;(et=fe==null?void 0:fe._menuCleanup)==null||et.call(fe),(Me=(j=U()).onClose)==null||Me.call(j,fe),U().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(d!=null&&d.panel))return d;const P=d;fe=P,P._anchorEl=se;const ve=()=>{clearTimeout(F),F=null},xe=()=>{V()},Oe=et=>{const j=et.target;if(!j||!j.closest)return;if(j.closest("[data-menu-close]")){x();return}if(U().closeOnSelect===!1)return;const Me=j.closest("[data-menu-item], [data-menu-select], .cms-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");Me&&(Me.closest("[data-menu-keep-open]")||Me.getAttribute("data-menu-select")!=="false"&&x())},ze=et=>{if(et.key==="Escape"){et.preventDefault(),x();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(et.key))return;const j=z(P.panel);if(!j.length)return;et.preventDefault();const Me=j.indexOf(document.activeElement);if(et.key==="Home"){j[0].focus();return}if(et.key==="End"){j[j.length-1].focus();return}const We=et.key==="ArrowDown"?1:-1,Ue=Me<0?We>0?0:j.length-1:(Me+We+j.length)%j.length;j[Ue].focus()};P.panel.addEventListener("click",Oe),P.panel.addEventListener("keydown",ze);const Ce=Q((Ve=(Z=Ne.trigger)!=null?Z:Ne.triggers)!=null?Ve:D(Ne,"open")?"manual":null),Re=Ce.has("hover"),J=Ce.has("focus");return(Re||J)&&(P.panel.addEventListener("mouseenter",ve),P.panel.addEventListener("mouseleave",xe),P.panel.addEventListener("focusin",ve),P.panel.addEventListener("focusout",xe)),P._menuCleanup=()=>{var et,j,Me,We,Ue,Qe;(et=P.panel)==null||et.removeEventListener("click",Oe),(j=P.panel)==null||j.removeEventListener("keydown",ze),(Me=P.panel)==null||Me.removeEventListener("mouseenter",ve),(We=P.panel)==null||We.removeEventListener("mouseleave",xe),(Ue=P.panel)==null||Ue.removeEventListener("focusin",ve),(Qe=P.panel)==null||Qe.removeEventListener("focusout",xe)},v(P),Ke(P),($e=(je=U()).onOpen)==null||$e.call(je,P),H(),P},T=(u,N=null)=>{clearTimeout(F),F=null,clearTimeout($),$=setTimeout(()=>p(u,N),we())},V=(u=!1)=>{if(clearTimeout($),$=null,!!d){if(clearTimeout(F),u){x();return}F=setTimeout(()=>x(),he())}},ne=(u=null,N=null)=>re()?(x(),null):p(u,N),re=()=>!!d,I={open:p,close:x,show:T,hide:V,toggle:ne,update:g,bind:u=>{var xe,Oe;if(!u)return()=>{};h=u;const N=U(),w=Q((Oe=(xe=N.trigger)!=null?xe:N.triggers)!=null?Oe:D(N,"open")?"manual":null),le=w.has("hover"),Ne=w.has("focus"),se=w.has("click"),fe=w.has("manual")||!le&&!Ne&&!se,P=[],ve=()=>{O(),P.forEach(ze=>ze()),h===u&&(h=null)};if(D(N,"open"))return S(N.open)?CMSwift.reactive.effect(()=>{h&&(n(U().open)?p(h):V(!0))},"UI.Menu:open"):N.open===!0?p(u):N.open===!1&&V(!0),ve;if(fe||n(N.disabled))return ve;if(le){const ze=()=>T(u),Ce=()=>V();u.addEventListener("mouseenter",ze),u.addEventListener("mouseleave",Ce),P.push(()=>{u.removeEventListener("mouseenter",ze),u.removeEventListener("mouseleave",Ce)})}if(Ne){const ze=()=>T(u),Ce=()=>V();u.addEventListener("focus",ze),u.addEventListener("blur",Ce),P.push(()=>{u.removeEventListener("focus",ze),u.removeEventListener("blur",Ce)})}if(se){const ze=Ce=>{var Re,J;(J=(Re=U()).onTriggerClick)==null||J.call(Re,Ce),!Ce.defaultPrevented&&ne(u)};u.addEventListener("click",ze),P.push(()=>u.removeEventListener("click",ze))}return ve},isOpen:re,entry:()=>d,props:()=>({...c})};return I},(hi=CMSwift.isDev)!=null&&hi.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Menu={signature:"UI.Menu(props) | UI.Menu(props, ...children) -> { open, close, show, hide, toggle, update, bind, isOpen }",props:{title:"String|Node|Function|Array|({ close })=>Node",subtitle:"String|Node|Function|Array|({ close })=>Node",eyebrow:"String|Node|Function|Array|({ close })=>Node",icon:"String|Node|Function|Array",content:"Node|Function|Array|({ close })=>Node",body:"Alias di content",items:"Array<string|object>|Function|Array",before:"Node|Function|Array",after:"Node|Function|Array",footer:"Node|Function|Array",status:"Node|Function|Array",empty:"Node|Function|Array",size:"xs|sm|md|lg|xl",state:"primary|secondary|warning|danger|success|info|light|dark",color:"Alias di state",trigger:"click|hover|focus|manual|Array",placement:"string",offsetX:"number",offsetY:"number",offset:"Alias di offsetY",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",contentMaxHeight:"Alias di bodyMaxHeight",closeOnSelect:"boolean",closeOnOutside:"boolean",closeOnEsc:"boolean",autoFocus:"boolean",anchorEl:"HTMLElement|VirtualAnchor",triggerEl:"Alias di anchorEl",target:"Alias di anchorEl",slots:"{ before?, icon?, eyebrow?, title?, subtitle?, header?, content?, body?, item?, itemTitle?, itemSubtitle?, itemBadge?, itemShortcut?, groupLabel?, empty?, status?, footer?, after?, default? }",class:"string",panelClass:"string",overlayClass:"string",style:"object",panelStyle:"object",onOpen:"function",onClose:"function",onItemClick:"(item, ctx, event) => void",onTriggerClick:"function"},slots:{before:"Area sopra header/body ({ close })",icon:"Menu icon",eyebrow:"Menu eyebrow ({ close })",title:"Menu title ({ close })",subtitle:"Menu subtitle ({ close })",header:"Header custom ({ close })",content:"Custom content ({ close })",body:"Alias di content ({ close })",item:"Custom item body ({ item, close })",itemTitle:"Item title ({ item, close })",itemSubtitle:"Item subtitle ({ item, close })",itemBadge:"Item badge ({ item, close })",itemShortcut:"Item shortcut ({ item, close })",groupLabel:"Label gruppi ({ item, close })",empty:"Empty state ({ close })",status:"Status row ({ close })",footer:"Footer actions ({ close })",after:"Area sotto body/footer ({ close })",default:"Fallback content ({ close })"},events:{onOpen:"void",onClose:"void",onItemClick:"item click"},returns:"Object { open(), close(), show(), hide(), toggle(), update(), bind(), isOpen() }",description:"Menu overlay standardizzato con item model, slot ricchi, trigger bindabili, header/footer e API imperativa."}),C.Popover=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t),o=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],f=["xs","sm","md","lg","xl"];let c={...e},d=null,h=null,b=null,$=null,F=null;const D=(I,u)=>Object.prototype.hasOwnProperty.call(I||{},u),R=(I,u)=>typeof I=="function"?I(u):I,be=I=>String(I||"").split(/\s+/).filter(Boolean),ce=I=>I&&typeof I=="object"&&!I.nodeType&&!Array.isArray(I)&&!(I instanceof Function),ie=I=>!!I&&typeof I=="object"&&(I.nodeType===1||typeof I.getBoundingClientRect=="function"),O=()=>{clearTimeout($),clearTimeout(F),$=null,F=null},te=(I,u,N)=>{if(!I)return;const w=I[u]||[];w.length&&I.classList.remove(...w);const le=(N||[]).filter(Boolean);le.length&&I.classList.add(...le),I[u]=le},X=(I,u,N,w=le=>le)=>{if(I){if(N==null||N===""){I.style.removeProperty(u);return}I.style.setProperty(u,w(N))}},U=()=>c,Ae=I=>{var N;const u=n((N=I.state)!=null?N:I.color);return u?i.includes(u)?u:String(u):""},ye=I=>{const u=n(I.size);return typeof u=="string"&&f.includes(u)?u:""},pe=I=>{var N,w,le;const u=String(n((le=(w=(N=I.actionsAlign)!=null?N:I.footerAlign)!=null?w:I.alignActions)!=null?le:"end")).toLowerCase();return["start","left"].includes(u)?"start":["center","middle"].includes(u)?"center":["between","space-between"].includes(u)?"between":["stretch","full"].includes(u)?"stretch":"end"},we=I=>{var u,N;return String(n((N=(u=I.placement)!=null?u:I.position)!=null?N:"bottom-start"))},he=(I,u)=>{const N=n(I);if(N==null||N==="")return u;const w=Number(N);return Number.isFinite(w)?w:u},me=()=>he(U().delay,0),Q=()=>he(U().hideDelay,120),L=I=>{var N,w;return((w=(N=I.closable)!=null?N:I.dismissible)!=null?w:I.closeButton)===!0},z=(I=null)=>{var N,w,le;if(I)return I;const u=U();return h||n((le=(w=(N=u.anchorEl)!=null?N:u.triggerEl)!=null?w:u.target)!=null?le:u.anchor)||null},H=I=>{if(I==null||I===!0)return new Set(["click"]);if(I===!1)return new Set(["manual"]);const u=Array.isArray(I)?I:String(I).split(/[\s,|/]+/),N=new Set;return u.forEach(w=>{const le=String(w||"").trim().toLowerCase();le&&(le==="mouseenter"||le==="mouseover"?N.add("hover"):le==="blur"||le==="focusin"?N.add("focus"):le==="tap"?N.add("click"):N.add(le))}),N.size?N:new Set(["manual"])},y=(I,u)=>{var le,Ne,se;let N=null,w=null;if(ie(I))N=I,ce(u)&&(w=u);else if(ce(I)){w=I;const fe=(se=(Ne=(le=I.anchorEl)!=null?le:I.triggerEl)!=null?Ne:I.target)!=null?se:I.anchor;ie(fe)&&(N=fe)}else I!=null&&(N=I);return{anchorEl:N,nextProps:w}},Y=()=>{var J,B,G,q,Le,Z,Ve,je,$e;const I=U(),u={close:M,dismiss:M,open:g,toggle:V,update:x,isOpen:ne,entry:()=>d,anchorEl:z(),props:I},N=I.icon!=null?typeof I.icon=="string"?C.Icon({name:I.icon,size:I.iconSize||"md"}):CMSwift.ui.slot(I.icon,{as:"icon"}):null,w=E(o,"eyebrow",u,R(I.eyebrow,u)),le=E(o,"title",u,R((B=(J=I.title)!=null?J:I.heading)!=null?B:I.label,u)),Ne=E(o,"subtitle",u,R((G=I.subtitle)!=null?G:I.description,u)),se=E(o,"icon",u,N),fe=E(o,"header",u,R((Le=(q=I.headerContent)!=null?q:I.head)!=null?Le:I.header,u)),P=L(I)?E(o,"close",u,C.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":I.closeLabel||"Chiudi popover","data-popover-close":!0},C.Icon({name:I.closeIcon||"close",size:"sm"}))):[];let ve=(je=(Ve=(Z=I.content)!=null?Z:I.body)!=null?Ve:I.message)!=null?je:I.text;ve==null&&s&&s.length&&(ve=s);let xe=E(o,"content",u,R(ve,u));xe.length||(xe=E(o,"body",u,R(ve,u))),xe.length||(xe=E(o,"default",u,R(ve,u)));const Oe=R(($e=I.footer)!=null?$e:I.actions,u);let ze=E(o,"footer",u,Oe);ze.length||(ze=E(o,"actions",u,Oe));let Ce=null;fe.length?Ce=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...fe):(w.length||le.length||Ne.length||se.length||P.length)&&(Ce=_.div({class:"cms-dialog-head"},se.length?_.div({class:"cms-dialog-icon"},...se):null,_.div({class:"cms-dialog-head-main"},w.length?_.div({class:"cms-dialog-eyebrow"},...w):null,le.length?_.div({class:"cms-dialog-title"},...le):null,Ne.length?_.div({class:"cms-dialog-subtitle"},...Ne):null),P.length?_.div({class:"cms-dialog-close-wrap"},...P):null));const Re=[];return Ce&&Re.push(Ce),xe.length&&Re.push(_.div({class:l(["cms-dialog-body",I.bodyClass])},...xe)),ze.length&&Re.push(_.div({class:l(["cms-dialog-actions",`is-${pe(I)}`,a(I.stackActions,"is-stacked"),I.actionsClass,I.footerClass])},...ze)),Re.length||Re.push(_.div({class:l(["cms-dialog-body",I.bodyClass])})),_.div({class:l(["cms-dialog-shell","cms-popover-shell",a(!!Ce,"has-head"),a(ze.length>0,"has-footer"),a(I.divider!==!1,"with-divider")])},...Re)},k=I=>{var le;if(!(I!=null&&I.panel))return;const u=U(),N=Ae(u),w=ye(u);te(I.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",w?`cms-dialog-${w}`:"",N,N?`cms-state-${N}`:"",n(u.scrollable)?"scrollable":"",n(u.stickyHeader)?"sticky-head":"",n(u.stickyActions)?"sticky-actions":"",n(u.borderless)?"borderless":"",...be(u.class),...be(u.panelClass)]),te(I.overlay,"_popoverOverlayClassTokens",[...be(u.overlayClass)]),I.panel.dataset.placement=we(u),X(I.panel,"--cms-dialog-width",n(u.width),K),X(I.panel,"--cms-dialog-min-width",n(u.minWidth),K),X(I.panel,"--cms-dialog-max-width",n(u.maxWidth),K),X(I.panel,"--cms-dialog-max-height",n(u.maxHeight),K),X(I.panel,"--cms-dialog-body-max-height",n((le=u.bodyMaxHeight)!=null?le:u.contentMaxHeight),K),u.style&&Object.assign(I.panel.style,u.style),wt(I.panel,u),I.panel.setAttribute("role",u.role||"dialog"),I.panel.setAttribute("aria-modal",u.modal===!0?"true":"false"),u.ariaLabel?I.panel.setAttribute("aria-label",u.ariaLabel):I.panel.removeAttribute("aria-label")},v=()=>{d!=null&&d.panel&&d.panel.replaceChildren(Y())},M=()=>{if(O(),!d)return;const I=d;d=null,nt(I,()=>CMSwift.overlay.close(I.id))},x=(I={})=>(I&&typeof I=="object"&&(c={...c,...I}),d&&(k(d),v()),ke),g=(I=null,u=null)=>{var Re,J,B,G,q,Le,Z,Ve;O();const{anchorEl:N,nextProps:w}=y(I,u);w&&(c={...c,...w});const le=U(),Ne=z(N);if(!Ne||n(le.disabled))return null;if(d&&d._anchorEl===Ne)return k(d),v(),d;d&&M(),b=document.activeElement;const se=H((J=(Re=le.trigger)!=null?Re:le.triggers)!=null?J:D(le,"open")?"manual":null),fe=se.has("hover"),P=se.has("focus");let ve=null;if(d=CMSwift.overlay.open(()=>Y(),{type:"popover",anchorEl:Ne,placement:we(le),offsetX:(B=le.offsetX)!=null?B:0,offsetY:(q=(G=le.offsetY)!=null?G:le.offset)!=null?q:10,backdrop:le.backdrop===!0,lockScroll:le.lockScroll===!0,trapFocus:le.trapFocus===!0,autoFocus:le.autoFocus===!0,closeOnOutside:le.closeOnOutside!==!1,closeOnBackdrop:(Le=le.closeOnBackdrop)!=null?Le:le.backdrop===!0,closeOnEsc:le.closeOnEsc!==!1,className:ue(["cms-dialog","cms-popover"]),onClose:()=>{var je,$e,et;(je=ve==null?void 0:ve._popoverCleanup)==null||je.call(ve),(et=($e=U()).onClose)==null||et.call($e,ve),U().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(d!=null&&d.panel))return d;const xe=d;ve=xe,xe._anchorEl=Ne;const Oe=()=>{clearTimeout(F),F=null},ze=()=>{!fe&&!P||T()},Ce=je=>{const $e=je.target;if(!(!$e||!$e.closest)){if($e.closest("[data-popover-close]")||$e.closest("[data-dialog-close]")){M();return}U().closeOnSelect===!0&&$e.closest("[data-popover-select]")&&M()}};return xe.panel.addEventListener("click",Ce),(fe||P)&&(xe.panel.addEventListener("mouseenter",Oe),xe.panel.addEventListener("mouseleave",ze),xe.panel.addEventListener("focusin",Oe),xe.panel.addEventListener("focusout",ze)),xe._popoverCleanup=()=>{var je,$e,et,j,Me;(je=xe.panel)==null||je.removeEventListener("click",Ce),($e=xe.panel)==null||$e.removeEventListener("mouseenter",Oe),(et=xe.panel)==null||et.removeEventListener("mouseleave",ze),(j=xe.panel)==null||j.removeEventListener("focusin",Oe),(Me=xe.panel)==null||Me.removeEventListener("focusout",ze)},k(xe),Ke(xe),(Ve=(Z=U()).onOpen)==null||Ve.call(Z,xe),xe},p=(I,u=null)=>{clearTimeout(F),F=null,clearTimeout($),$=setTimeout(()=>g(I,u),me())},T=(I=!1)=>{if(clearTimeout($),$=null,!!d){if(clearTimeout(F),I){M();return}F=setTimeout(()=>M(),Q())}},V=(I=null,u=null)=>ne()?(M(),null):g(I,u),ne=()=>!!d,ke={open:g,close:M,show:p,hide:T,toggle:V,update:x,bind:I=>{var ve,xe;if(!I)return()=>{};h=I;const u=U(),N=H((xe=(ve=u.trigger)!=null?ve:u.triggers)!=null?xe:D(u,"open")?"manual":null),w=N.has("hover"),le=N.has("focus"),Ne=N.has("click"),se=N.has("manual")||!w&&!le&&!Ne,fe=[],P=()=>{O(),fe.forEach(Oe=>Oe()),h===I&&(h=null)};if(D(u,"open"))return S(u.open)?CMSwift.reactive.effect(()=>{h&&(n(U().open)?g(h):T(!0))},"UI.Popover:open"):u.open===!0?g(I):u.open===!1&&T(!0),P;if(se||n(u.disabled))return P;if(w){const Oe=()=>p(I),ze=()=>T();I.addEventListener("mouseenter",Oe),I.addEventListener("mouseleave",ze),fe.push(()=>{I.removeEventListener("mouseenter",Oe),I.removeEventListener("mouseleave",ze)})}if(le){const Oe=()=>p(I),ze=()=>T();I.addEventListener("focus",Oe),I.addEventListener("blur",ze),fe.push(()=>{I.removeEventListener("focus",Oe),I.removeEventListener("blur",ze)})}if(Ne){const Oe=ze=>{var Ce,Re;(Re=(Ce=U()).onTriggerClick)==null||Re.call(Ce,ze),!ze.defaultPrevented&&V(I)};I.addEventListener("click",Oe),fe.push(()=>I.removeEventListener("click",Oe))}return P},isOpen:ne,entry:()=>d,props:()=>({...c})};return ke},(bi=CMSwift.isDev)!=null&&bi.call(CMSwift)&&(C.meta=C.meta||{},C.meta.Popover={signature:"UI.Popover(props) | UI.Popover(props, ...children) -> { open, close, show, hide, toggle, update, bind, isOpen }",props:{title:"String|Node|Function|Array|({ close })=>Node",subtitle:"String|Node|Function|Array|({ close })=>Node",eyebrow:"String|Node|Function|Array|({ close })=>Node",icon:"String|Node|Function|Array",content:"Node|Function|Array|({ close })=>Node",body:"Alias di content",actions:"Node|Function|Array|({ close })=>Node",footer:"Alias di actions",size:"xs|sm|md|lg|xl",state:"primary|secondary|warning|danger|success|info|light|dark",color:"Alias di state",trigger:"click|hover|focus|manual|Array",placement:"string",offsetX:"number",offsetY:"number",offset:"Alias di offsetY",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",contentMaxHeight:"Alias di bodyMaxHeight",backdrop:"boolean",lockScroll:"boolean",trapFocus:"boolean",autoFocus:"boolean",closeButton:"boolean",closable:"boolean",closeOnSelect:"boolean",closeOnOutside:"boolean",closeOnBackdrop:"boolean",closeOnEsc:"boolean",open:"boolean|rod|signal",anchorEl:"HTMLElement|VirtualAnchor",triggerEl:"Alias di anchorEl",target:"Alias di anchorEl",slots:"{ icon?, eyebrow?, title?, subtitle?, header?, content?, body?, footer?, actions?, close?, default? }",class:"string",panelClass:"string",overlayClass:"string",style:"object",onOpen:"function",onClose:"function",onTriggerClick:"function"},slots:{icon:"Popover icon",eyebrow:"Popover eyebrow ({ close })",title:"Popover title ({ close })",subtitle:"Popover subtitle ({ close })",header:"Header custom ({ close })",content:"Popover body ({ close })",body:"Alias di content ({ close })",footer:"Popover footer ({ close })",actions:"Alias di footer ({ close })",close:"Close button slot ({ close })",default:"Fallback body ({ close })"},events:{onOpen:"void",onClose:"void"},returns:"Object { open(), close(), show(), hide(), toggle(), update(), bind(), isOpen() }",description:"Popover ancorato standardizzato con layout ricco, slot completi, trigger bindabili e API imperativa."}),C.ContextMenu=(...t)=>{const{props:e,children:s}=CMSwift.uiNormalizeArgs(t);let o={...e},i=null,f=null,c=null;const d=v=>v&&typeof v=="object"&&!v.nodeType&&!Array.isArray(v)&&!(v instanceof Function),h=v=>!!v&&typeof v=="object"&&(v.nodeType===1||typeof v.getBoundingClientRect=="function"),b=v=>!!v&&typeof v=="object"&&("clientX"in v||"type"in v||"target"in v||"currentTarget"in v),$=v=>!!v&&Number.isFinite(Number(v.x))&&Number.isFinite(Number(v.y)),F=()=>o,D=(v,M)=>{const x=Number(v),g=Number(M);return!Number.isFinite(x)||!Number.isFinite(g)?null:{x,y:g}},R=v=>v?{_cmsContextPoint:v,getBoundingClientRect:()=>({top:v.y,bottom:v.y,left:v.x,right:v.x,width:0,height:0})}:null,be=v=>{if(!h(v))return null;const M=v.getBoundingClientRect();return D(M.left+Math.min(M.width/2,24),M.top+Math.min(M.height/2,24))},ce=v=>{var M,x,g,p;return n((p=(g=(x=(M=v==null?void 0:v.anchorEl)!=null?M:v==null?void 0:v.triggerEl)!=null?x:v==null?void 0:v.target)!=null?g:v==null?void 0:v.anchor)!=null?p:null)},ie=(v,M=null)=>{if(!v)return be(M||c);const x=D(v.clientX,v.clientY);if(x)return x;const g=ce({anchorEl:M||v.currentTarget||v.target||c});return be(g)},O=(v={})=>{if(!d(v))return{};const M={...v};return delete M.event,delete M.point,delete M.x,delete M.y,M},te=()=>{var M,x,g;const v=F();return{...v,trigger:"manual",placement:v.placement||"bottom-start",offsetX:(M=v.offsetX)!=null?M:0,offsetY:(g=(x=v.offsetY)!=null?x:v.offset)!=null?g:4,closeOnOutside:v.closeOnOutside!==!1,closeOnEsc:v.closeOnEsc!==!1,role:v.role||"menu",ariaLabel:v.ariaLabel||v.title||"Context menu",class:l(["cms-context-menu-shell",v.class]),panelClass:l(["cms-context-menu-panel",v.panelClass])}},X=C.Menu(te(),...s),U=(v=null,M=null,x=null)=>{let g=null,p=null,T=null;if(b(v))g=ie(v,c),T=d(M)?O(M):null;else if(typeof v=="number"||typeof M=="number")g=D(v,M),T=d(x)?O(x):null;else if($(v))g=D(v.x,v.y),T=d(M)?O(M):null;else if(h(v))p=v,T=d(M)?O(M):null;else if(d(v)){const V=$(v.point)?v.point:$(v)?v:null,ne=ce(v),re=v.event;g=V?D(V.x,V.y):ie(re,ne||c),p=ne&&h(ne)?ne:null,T={...O(v),...d(M)?O(M):{}}}else i&&(g={...i});return{point:g,anchor:p,nextProps:T}},Ae=(v,M=null)=>{f=v||f,i=M||v&&v._cmsContextPoint||i},ye=(v=null)=>{d(v)&&Object.keys(v).length&&(o={...o,...v})},pe=(v=null,M=null)=>{if(M)return R(M);if(v&&h(v))return v;const x=ce(F());return h(x)?x:i?R(i):h(f)?f:h(c)?c:null},we=(v=null,M=null,x=null)=>{const{point:g,anchor:p,nextProps:T}=U(v,M,x);ye(T);const V=pe(p,g);return V?(Ae(V,g),X.open(V,te())):null},he=(v,M,x=null)=>we(v,M,x),me=(v,M=null)=>we(v,M),Q=()=>(X.close(),k),L=(v=!0)=>(v===!1?X.hide(!1):X.close(),k),z=(v=null,M=null,x=null)=>we(v,M,x),H=(v=null,M=null,x=null)=>X.isOpen()?(Q(),null):we(v,M,x),y=(v={})=>(ye(O(v)),X.update(te()),k),k={open:we,openAt:he,openFromEvent:me,show:z,hide:L,close:Q,toggle:H,update:y,bind:(v,M=null)=>{if(!v)return()=>{};const x=d(M)?O(M):null,g=T=>{var ne,re;c=v,T.preventDefault(),!(((re=(ne=F()).onTrigger)==null?void 0:re.call(ne,T,{element:v,open:we,close:Q,update:y}))===!1||n(F().disabled))&&we({event:T,anchorEl:v},x)},p=T=>{var ne,re;T.key!=="ContextMenu"&&!(T.shiftKey&&T.key==="F10")||(c=v,T.preventDefault(),((re=(ne=F()).onTrigger)==null?void 0:re.call(ne,T,{element:v,open:we,close:Q,update:y}))===!1||n(F().disabled))||we({event:T,anchorEl:v},x)};return v.addEventListener("contextmenu",g),v.addEventListener("keydown",p),()=>{v.removeEventListener("contextmenu",g),v.removeEventListener("keydown",p)}},isOpen:X.isOpen,entry:X.entry,props:()=>({...o})};return k},(yi=CMSwift.isDev)!=null&&yi.call(CMSwift)&&(C.meta=C.meta||{},C.meta.ContextMenu={signature:"UI.ContextMenu(props) | UI.ContextMenu(props, ...children) -> { open, openAt, openFromEvent, show, hide, close, toggle, update, bind, isOpen }",props:{title:"String|Node|Function|Array|({ close })=>Node",subtitle:"String|Node|Function|Array|({ close })=>Node",eyebrow:"String|Node|Function|Array|({ close })=>Node",icon:"String|Node|Function|Array",content:"Node|Function|Array|({ close })=>Node",body:"Alias di content",items:"Array<string|object>|Function|Array",before:"Node|Function|Array",after:"Node|Function|Array",footer:"Node|Function|Array",status:"Node|Function|Array",empty:"Node|Function|Array",size:"xs|sm|md|lg|xl",state:"primary|secondary|warning|danger|success|info|light|dark",color:"Alias di state",placement:"string",offsetX:"number",offsetY:"number",offset:"Alias di offsetY",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",contentMaxHeight:"Alias di bodyMaxHeight",closeOnSelect:"boolean",closeOnOutside:"boolean",closeOnEsc:"boolean",anchorEl:"HTMLElement|VirtualAnchor",triggerEl:"Alias di anchorEl",target:"Alias di anchorEl",slots:"{ before?, icon?, eyebrow?, title?, subtitle?, header?, content?, body?, item?, itemTitle?, itemSubtitle?, itemBadge?, itemShortcut?, groupLabel?, empty?, status?, footer?, after?, default? }",class:"string",panelClass:"string",overlayClass:"string",style:"object",panelStyle:"object",onOpen:"function",onClose:"function",onItemClick:"(item, ctx, event) => void",onTrigger:"(event, ctx) => boolean|void"},slots:{before:"Area sopra header/body ({ close })",icon:"Context icon",eyebrow:"Context eyebrow ({ close })",title:"Context title ({ close })",subtitle:"Context subtitle ({ close })",header:"Header custom ({ close })",content:"Context menu content ({ close })",body:"Alias di content ({ close })",item:"Custom item body ({ item, close })",itemTitle:"Item title ({ item, close })",itemSubtitle:"Item subtitle ({ item, close })",itemBadge:"Item badge ({ item, close })",itemShortcut:"Item shortcut ({ item, close })",groupLabel:"Label gruppi ({ item, close })",empty:"Empty state ({ close })",status:"Status row ({ close })",footer:"Footer actions ({ close })",after:"Area sotto body/footer ({ close })",default:"Fallback content ({ close })"},events:{onOpen:"void",onClose:"void",onItemClick:"item click",onTrigger:"trigger contextmenu / tastiera"},returns:"Object { open(), openAt(), openFromEvent(), show(), hide(), close(), toggle(), update(), bind(), isOpen() }",description:"Specializzazione di Menu per click destro e tasto context menu, con items, slot ricchi, runtime overrides e posizionamento su coordinate."})})(CMSwift);
|