jsswift 1.0.41
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/css/animation.css +121 -0
- package/dist/css/base.css +621 -0
- package/dist/css/docs.css +216 -0
- package/dist/css/min-ui.css +1 -0
- package/dist/css/responsive.css +3259 -0
- package/dist/css/ui-components.css +8757 -0
- package/dist/css/ui.css +12765 -0
- package/dist/css/ui.min.css +1 -0
- package/dist/fonts/Nunito-Black.ttf +0 -0
- package/dist/fonts/Nunito-BlackItalic.ttf +0 -0
- package/dist/fonts/Nunito-Bold.ttf +0 -0
- package/dist/fonts/Nunito-BoldItalic.ttf +0 -0
- package/dist/fonts/Nunito-ExtraBold.ttf +0 -0
- package/dist/fonts/Nunito-ExtraBoldItalic.ttf +0 -0
- package/dist/fonts/Nunito-ExtraLight.ttf +0 -0
- package/dist/fonts/Nunito-ExtraLightItalic.ttf +0 -0
- package/dist/fonts/Nunito-Italic.ttf +0 -0
- package/dist/fonts/Nunito-Light.ttf +0 -0
- package/dist/fonts/Nunito-LightItalic.ttf +0 -0
- package/dist/fonts/Nunito-Medium.ttf +0 -0
- package/dist/fonts/Nunito-MediumItalic.ttf +0 -0
- package/dist/fonts/Nunito-Regular.ttf +0 -0
- package/dist/fonts/Nunito-SemiBold.ttf +0 -0
- package/dist/fonts/Nunito-SemiBoldItalic.ttf +0 -0
- package/dist/img/logo.svg +131 -0
- package/dist/img/svg/tabler-icons-sprite.svg +39534 -0
- package/dist/jsswift.js +26310 -0
- package/dist/jsswift.min.js +34 -0
- package/dist/min-jsswift.js +34 -0
- package/package.json +36 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
(()=>{var js,Hs,Vs,yo,Bs,$s,wo,Hn,Us;window.JSswift=window.JSswift||{};const ne=window.JSswift;window._=window.JSswift,ne.config=ne.config||{};const mt=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{};ne.config.debug=(js=mt.modeDev)!=null?js:!1,ne.isDev=function(){return ne.config.debug},ne.uiNormalizeArgs=function(a){let T={},M=a;return a.length>0&&typeof a[0]=="object"&&a[0]!==null&&!a[0].nodeType&&!Array.isArray(a[0])&&!(a[0]instanceof Function)&&(T=a[0],M=a.slice(1)),{props:T,children:M}},ne.uiSizes=["xxs","xs","sm","md","lg","xl","xxl","xxxl"],ne.uiColors=["primary","secondary","success","warning","danger","info","light","dark"],ne.meta=ne.meta||{version:"1.0.23",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:["JSswift.reactive.signal","JSswift.reactive.effect","JSswift.reactive.computed","JSswift.reactive.untracked","JSswift.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","JSswift.rodBind","JSswift.rodModel"],status:"milestone-2-closed",knownLimits:["Va chiarito meglio il rapporto con JSswift.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:["JSswift.mount","JSswift.component","JSswift.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:["JSswift.overlay","JSswift.store","JSswift.plugins.auth","JSswift.http","JSswift.router","JSswift.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."]}}},ne.omit=(a,T)=>{const M={},B=new Set(T||[]);for(const j in a||{})B.has(j)||(M[j]=a[j]);return M},ne._cleanupRegistry=new WeakMap,ne._registerCleanup=function(a,T){if(!a||typeof T!="function")return T;const M=ne._cleanupRegistry.get(a)||[];return M.push(T),ne._cleanupRegistry.set(a,M),T},ne.dom={q(a,T=document){return T.querySelector(a)},qa(a,T=document){return Array.from(T.querySelectorAll(a))},attr(a,T,M){return a?M===void 0?a.getAttribute(T):(M===null?a.removeAttribute(T):a.setAttribute(T,String(M)),a):null}},(()=>{let a=[],T=!1;function M(){if(T)return;T=!0;const B=a.slice();a.length=0;for(const j of B)try{j()}catch(be){console.error("[JSswift.ready] error:",be)}}ne.ready=function(B){typeof B=="function"&&(T||document.readyState==="interactive"||document.readyState==="complete"?queueMicrotask(()=>{try{B()}catch(j){console.error("[JSswift.ready] error:",j)}}):a.push(B))},document.addEventListener("DOMContentLoaded",M,{once:!0})})(),ne.reactive=(()=>{let a=null;const T=[],M=100;let B=0,j="sync",be="sync",X=!1;const G=new Set;function _e(Ie){const $e=Ie==null?void 0:Ie.flush;if($e==null||$e==="sync")return"sync";if($e==="microtask")return"microtask";throw new Error("JSswift.reactive.batch: options.flush must be 'sync' or 'microtask'")}function r(){for(;G.size;){const Ie=Array.from(G);G.clear(),Ie.forEach($e=>$e())}}function Se(){X||(X=!0,queueMicrotask(()=>{X=!1,be="sync",r()}))}function ke(Ie){const $e=Array.from(Ie);if(B>0||be==="microtask"){$e.forEach(ct=>G.add(ct)),B===0&&be==="microtask"&&Se();return}$e.forEach(ct=>ct())}function Me(Ie){if(Ie&&(Ie._deps.size&&(Ie._deps.forEach($e=>$e.delete(Ie._runner)),Ie._deps.clear()),typeof Ie._cleanup=="function")){const $e=Ie._cleanup;Ie._cleanup=null;try{$e()}catch(ct){console.error("[JSswift.reactive.effect] cleanup error:",ct)}}}function Re(Ie){if(!(!Ie||!Ie.active)){Me(Ie),T.push(Ie),a=Ie;try{const $e=at=>{Ie._cleanup=typeof at=="function"?at:null},ct=Ie.fn.length>0?Ie.fn($e):Ie.fn();typeof ct=="function"&&(Ie._cleanup=ct)}finally{T.pop(),a=T[T.length-1]||null}}}function Ye(Ie){if(typeof Ie!="function")return()=>{};const $e={fn:Ie,active:!0,_deps:new Set,_cleanup:null,_runner:null,_running:!1,_queued:!1},ct=()=>{if(!$e.active)return;if($e._running){$e._queued=!0;return}$e._running=!0;let at=0;try{do if($e._queued=!1,Re($e),at++,at>=M){$e._queued=!1,console.warn("[JSswift.reactive.effect] loop guard triggered: too many synchronous reruns",{max:M,effect:Ie.name||"anonymous"});break}while($e.active&&$e._queued)}finally{$e._running=!1}};return $e._runner=ct,ct(),()=>{$e.active&&($e.active=!1,Me($e))}}function pt(Ie){let $e=Ie;const ct=new Set;function at(){return a&&a.active&&(ct.add(a._runner),a._deps.add(ct)),$e}function xt(Wt){$e=Wt,ke(ct)}function Nt(){ct.clear()}return[at,xt,Nt]}function dt(Ie){if(typeof Ie!="function")throw new Error("JSswift.reactive.computed: fn must be a function");const[$e,ct,at]=pt(void 0),xt=Ye(()=>{ct(Ie())}),Nt=()=>$e();return Nt.dispose=()=>{xt(),at()},Nt.peek=()=>$e(),Nt.type="computed",Nt}function rt(Ie){if(typeof Ie!="function")throw new Error("JSswift.reactive.untracked: fn must be a function");const $e=a;a=null;try{return Ie()}finally{a=$e}}function De(Ie,$e){if(typeof Ie!="function")throw new Error("JSswift.reactive.batch: fn must be a function");const ct=_e($e);B===0?j=ct:ct==="microtask"&&(j="microtask"),B+=1;try{return Ie()}finally{if(B-=1,B===0){const at=j==="microtask"||be==="microtask";j="sync",at?(be="microtask",Se()):r()}}}return{signal:pt,effect:Ye,computed:dt,untracked:rt,batch:De}})(),ne._overlayShared=(()=>{const a=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function T(be,X){const G=be();if(G&&G.isConnected)return G;let _e=document.getElementById("cms-overlay-root");return!_e&&(document!=null&&document.body)&&(_e=document.createElement("div"),_e.id="cms-overlay-root",_e.className="cms-overlay-root",document.body.appendChild(_e)),!document.body&&!_e&&ne.ready(()=>{let r=document.getElementById("cms-overlay-root");r||(r=document.createElement("div"),r.id="cms-overlay-root",r.className="cms-overlay-root",document.body.appendChild(r)),X(r)}),X(_e),_e}function M(be){var G;const X=be.querySelector(a);(G=X==null?void 0:X.focus)==null||G.call(X)}function B(be,X){if(be.key!=="Tab")return;const G=Array.from(X.querySelectorAll(a)).filter(ke=>ke.offsetParent!==null);if(!G.length)return;const _e=G[0],r=G[G.length-1],Se=document.activeElement;be.shiftKey&&Se===_e?(be.preventDefault(),r.focus()):!be.shiftKey&&Se===r&&(be.preventDefault(),_e.focus())}function j(be,X){var kn,Rn,Vn,Gt,rn,Dt;if(!X.anchorEl)return;const G=X.anchorEl.getBoundingClientRect(),_e=be.getBoundingClientRect(),r=window.visualViewport||null,Se=Math.max(0,Number(r==null?void 0:r.offsetLeft)||0),ke=Math.max(0,Number(r==null?void 0:r.offsetTop)||0),Me=Math.max(Number(r==null?void 0:r.width)||0,window.innerWidth||0,((kn=document.documentElement)==null?void 0:kn.clientWidth)||0),Re=Math.max(Number(r==null?void 0:r.height)||0,window.innerHeight||0,((Rn=document.documentElement)==null?void 0:Rn.clientHeight)||0),Ye=Number((Gt=(Vn=X.viewportGutter)!=null?Vn:X.gutter)!=null?Gt:8),pt=Number.isFinite(Ye)?Math.max(0,Ye):8,dt=Number((rn=X.offsetX)!=null?rn:0),rt=Number((Dt=X.offsetY)!=null?Dt:8),De=Number.isFinite(dt)?dt:0,Ie=Number.isFinite(rt)?rt:8,$e=(o,vn,fe)=>!Number.isFinite(o)||(Number.isFinite(vn)||(vn=0),Number.isFinite(fe)||(fe=vn),fe<vn)?vn:Math.min(Math.max(o,vn),fe),ct=String(X.placement||"bottom-start").toLowerCase(),[at,xt]=ct.split("-"),Nt=["top","bottom","left","right"].includes(at)?at:"bottom",Wt=["start","end","center"].includes(xt)?xt:"start",vt={top:"bottom",bottom:"top",left:"right",right:"left"}[Nt]||"top",At=Nt==="top"||Nt==="bottom",kt=_e.width,_t=_e.height,Ve=o=>{let vn=G.left+De,fe=G.top+Ie;return o==="top"||o==="bottom"?(Wt==="center"?vn=G.left+(G.width-kt)/2+De:Wt==="end"&&(vn=G.right-kt+De),fe=o==="top"?G.top-_t-Ie:G.bottom+Ie):(Wt==="center"?fe=G.top+(G.height-_t)/2+Ie:Wt==="end"&&(fe=G.bottom-_t+Ie),vn=o==="left"?G.left-kt-De:G.right+De),{left:vn,top:fe}},Qe=o=>o==="top"?G.top-Ie-pt:o==="bottom"?Re-G.bottom-Ie-pt:o==="left"?G.left-De-pt:Me-G.right-De-pt,Ct=Qe(Nt),It=Qe(vt),bt=(At?_t:kt)>Ct&&It>Ct?vt:Nt,lt=Ve(bt),wt=Se+pt,tt=ke+pt,Ot=Math.max(wt,Se+Me-kt-pt),en=Math.max(tt,ke+Re-_t-pt),sn=$e(lt.left,wt,Ot),Bt=$e(lt.top,tt,en);be.style.position="fixed",be.style.left=`${sn}px`,be.style.top=`${Bt}px`}return{ensureRoot:T,focusFirst:M,trapFocus:B,applyAnchoredPosition:j}})(),ne.overlay=(()=>{let a=0;const T=new Map;let M=null;const{ensureRoot:B,focusFirst:j,trapFocus:be,applyAnchoredPosition:X}=ne._overlayShared,G=()=>B(()=>M,dt=>{M=dt});let _e=0;const r=()=>{_e++,_e===1&&document.documentElement.classList.add("cms-scroll-locked")},Se=()=>{_e=Math.max(0,_e-1),_e===0&&document.documentElement.classList.remove("cms-scroll-locked")},ke=()=>{let dt=null;for(const rt of T.values())dt=rt;return dt},Me=dt=>{var De;let rt=dt;for(;rt&&rt!==document;){if(rt.nodeType===1&&((De=rt.getAttribute)==null?void 0:De.call(rt,"data-cms-overlay-portal"))==="true")return!0;rt=rt.parentNode}return!1},Re=(dt,rt={})=>{var Qe,Ct,It,Pt;const De=`ov_${++a}`,Ie={id:De,opts:rt,isOpen:!0,anchorEl:rt.anchorEl||null,placement:rt.placement||"bottom-start",onClose:typeof rt.onClose=="function"?rt.onClose:null,overlay:null,panel:null,backdrop:null,reposition:null,_positionCleanup:null,_positionFrame:null,_panelResizeObserver:null,_cleanup:null},$e=document.createElement("div");$e.className=["cms-overlay",rt.type?`type-${rt.type}`:""].filter(Boolean).join(" "),$e.dataset.id=De;const ct=document.createElement("div");ct.className="cms-overlay-backdrop",rt.backdrop||(ct.style.display="none");const at=document.createElement("div");at.className=["cms-overlay-panel",rt.className].filter(Boolean).join(" "),at.tabIndex=-1;const xt=typeof dt=="function"?dt({close:()=>Ye(De)}):dt,Nt=ne.ui.slot(xt);Array.isArray(Nt)?Nt.forEach(bt=>bt&&at.appendChild(bt)):Nt&&at.appendChild(Nt),$e.appendChild(ct),$e.appendChild(at);const Wt=G();if(!Wt)return{id:De,close:()=>Ye(De),panel:at,overlay:$e};Wt.appendChild($e),Ie.overlay=$e,Ie.panel=at,Ie.backdrop=ct,T.set(De,Ie),rt.lockScroll&&r(),rt.autoFocus!==!1&&setTimeout(()=>j(at),0);const vt=(bt=null)=>{bt&&typeof bt=="object"&&Object.assign(Ie.opts,bt),X(at,Ie.opts)},At=()=>{if(!rt.anchorEl)return;const bt=globalThis.requestAnimationFrame||(wt=>setTimeout(()=>wt(Date.now()),0)),lt=globalThis.cancelAnimationFrame||clearTimeout;Ie._positionFrame!=null&<(Ie._positionFrame),Ie._positionFrame=bt(()=>{Ie._positionFrame=null,vt()})};if(Ie.reposition=vt,rt.anchorEl){vt(),At();const bt=()=>vt();if(window.addEventListener("resize",bt),window.addEventListener("scroll",bt,!0),(Ct=(Qe=window.visualViewport)==null?void 0:Qe.addEventListener)==null||Ct.call(Qe,"resize",bt),(Pt=(It=window.visualViewport)==null?void 0:It.addEventListener)==null||Pt.call(It,"scroll",bt),typeof ResizeObserver=="function"){const lt=new ResizeObserver(()=>vt());lt.observe(at),Ie._panelResizeObserver=lt}Ie._positionCleanup=()=>{var wt,tt,Ot,en,sn,Bt;const lt=globalThis.cancelAnimationFrame||clearTimeout;Ie._positionFrame!=null&&(lt(Ie._positionFrame),Ie._positionFrame=null),(tt=(wt=Ie._panelResizeObserver)==null?void 0:wt.disconnect)==null||tt.call(wt),Ie._panelResizeObserver=null,window.removeEventListener("resize",bt),window.removeEventListener("scroll",bt,!0),(en=(Ot=window.visualViewport)==null?void 0:Ot.removeEventListener)==null||en.call(Ot,"resize",bt),(Bt=(sn=window.visualViewport)==null?void 0:sn.removeEventListener)==null||Bt.call(sn,"scroll",bt)}}const kt=bt=>{const lt=ke();!lt||lt.id!==De||rt.closeOnOutside!==!1&&(Me(bt.target)||at.contains(bt.target)||Ye(De))};document.addEventListener("mousedown",kt,!0);const _t=bt=>{const lt=ke();!lt||lt.id!==De||(rt.trapFocus&&be(bt,at),bt.key==="Escape"&&rt.closeOnEsc!==!1&&(bt.preventDefault(),Ye(De)))};document.addEventListener("keydown",_t,!0),ct.addEventListener("click",()=>{rt.closeOnBackdrop!==!1&&Ye(De)}),Ie._cleanup=()=>{var bt;document.removeEventListener("mousedown",kt,!0),document.removeEventListener("keydown",_t,!0),(bt=Ie._positionCleanup)==null||bt.call(Ie)};const Ve=1e3+T.size*10;return $e.style.zIndex=String(Ve),{id:De,close:()=>Ye(De),panel:at,overlay:$e,reposition:vt}},Ye=dt=>{var De,Ie,$e;const rt=T.get(dt);rt&&(T.delete(dt),(De=rt._cleanup)==null||De.call(rt),rt.opts.lockScroll&&Se(),typeof Vt=="function"&&Vt(rt.overlay),(Ie=rt.overlay)==null||Ie.remove(),($e=rt.onClose)==null||$e.call(rt))};return{open:Re,close:Ye,closeTop:()=>{const dt=ke();dt&&Ye(dt.id)},root:M,_stack:T}})();function ws(a,T={}){const{isSVG:M=!1,normalizeClass:B=De=>String(De!=null?De:""),isContentProp:j=()=>!1,autoValueTags:be=new Set(["INPUT","TEXTAREA","SELECT"])}=T;function X(De){if(M||!(De in a))return!1;try{return typeof a[De]=="boolean"}catch(Ie){return!1}}function G(De){return M||De.startsWith("data-")||De.startsWith("aria-")||!(De in a)}function _e(De,Ie){if(Ie==null){a.removeAttribute(De);return}if(Ie===!1){if(De.startsWith("aria-")){a.setAttribute(De,"false");return}a.removeAttribute(De);return}if(Ie===!0&&!M&&!De.startsWith("aria-")&&!De.startsWith("data-")){a.setAttribute(De,"");return}a.setAttribute(De,String(Ie))}function r(De,Ie){if(De==null)return;const $e=String(De),ct=$e.startsWith("--")||$e.includes("-");if(Ie==null||Ie===!1||Ie===""){ct?a.style.removeProperty($e):a.style[$e]="";return}if(ct){a.style.setProperty($e,String(Ie));return}a.style[$e]=Ie}function Se(De){const Ie=B(De);if(Ie==null||Ie===!1||Ie===""){a.removeAttribute("class");return}a.setAttribute("class",String(Ie))}function ke(De,Ie){const $e=!!Ie;a[De]=$e,$e?a.setAttribute(De,""):a.removeAttribute(De)}function Me(De){if(j(De)){a[De]="";return}if(De==="class"){a.removeAttribute("class");return}if(De==="style"){a.removeAttribute("style");return}if(X(De)){try{a[De]=!1}catch(Ie){}a.removeAttribute(De);return}if(a.removeAttribute(De),!G(De))try{typeof a[De]=="string"&&(a[De]="")}catch(Ie){}}function Re(De){!De||typeof De!="object"||Object.entries(De).forEach(([Ie,$e])=>{r(Ie,$e)})}function Ye(De,Ie){if(j(De)){a[De]=Ie!=null?Ie:"";return}if(De==="class"){Se(Ie);return}if(De==="style"){if(Ie==null||Ie===!1){Me(De);return}if(typeof Ie=="object"){Re(Ie);return}}if(X(De)){ke(De,Ie);return}if(Ie==null||Ie===!1){Me(De);return}if(G(De)){_e(De,Ie);return}a[De]=Ie}function pt(De,Ie){const $e=String(De).split(".");let ct=a;for(let at=0;at<$e.length-1;at++)if(ct=ct==null?void 0:ct[$e[at]],!ct)return;ct[$e[$e.length-1]]=Ie}function dt(De){return De?De==="auto"||De.startsWith("attr:")||De.startsWith("@")||De.startsWith("style.")||De.includes("."):!1}function rt(De,Ie){if(!De||De==="auto"){be.has(a.tagName)?Ye("value",Ie):a.textContent=Ie!=null?Ie:"";return}if(De.startsWith("attr:")){_e(De.slice(5),Ie);return}if(De.startsWith("@")){_e(De.slice(1),Ie);return}if(De.startsWith("style.")){r(De.slice(6),Ie);return}if(De.includes(".")){pt(De,Ie);return}Ye(De,Ie)}return{isBooleanDomProp:X,isAttributeOnlyProp:G,isBindingValueKey:dt,setAttributeValue:_e,setStyleEntry:r,setClassValue:Se,setBooleanProp:ke,removeProp:Me,applyStyleObject:Re,setProp:Ye,setPathValue:pt,applyBindingValue:rt}}function Gn(a){const T=[],M=B=>{if(!(B==null||B===!1)){if(typeof B=="function"){M(B());return}if(B&&B.type==="rod"){M(B.value);return}if(Array.isArray(B)){B.forEach(M);return}if(typeof B=="object"){Object.entries(B).forEach(([j,be])=>{let X=be;typeof X=="function"?X=X():X&&X.type==="rod"&&(X=X.value),M(X?j:null)});return}B!==!0&&String(B).split(/\s+/).forEach(j=>{j&&T.push(j)})}};return M(a),T.length?Array.from(new Set(T)).join(" "):""}function vs(a){return a==null||a===!1?!1:typeof a=="function"||a&&a.type==="rod"?!0:Array.isArray(a)?a.some(vs):typeof a=="object"?Object.values(a).some(vs):!1}function ls(a,T){return a==null||a===!1?!1:typeof a=="function"||T(a)?!0:typeof a!="object"||Array.isArray(a)||a.nodeType?!1:Object.values(a).some(M=>ls(M,T))}function cs(a,T){let M=a;if(typeof M=="function"?M=M():T(M)&&(M=M.value),!M||typeof M!="object"||Array.isArray(M)||M.nodeType)return null;const B={};return Object.entries(M).forEach(([j,be])=>{let X=be;typeof X=="function"?X=X():T(X)&&(X=X.value),B[j]=X}),B}function Ps(a){let T=new Set;function M(j){T.forEach(be=>{j.has(be)||a(be,null)}),T=j}function B(j,be){const X=cs(j,be);if(!X){M(new Set);return}const G=new Set(Object.keys(X));M(G),Object.entries(X).forEach(([_e,r])=>{a(_e,r)})}return{apply:B}}function to(a){return typeof a=="string"&&(a.startsWith("on:")||a.startsWith("on")&&a.length>2)}const Cn=128,Dn=[];function Rs(a,T){Dn.push({rod:a,value:String(T!=null?T:"")}),Dn.length>Cn&&Dn.splice(0,Dn.length-Cn)}function Kn(){if(!Dn.length)return null;const a=Dn.slice();return Dn.length=0,{items:a,index:0}}function us(a,T){if(!T||!a||T.index>=T.items.length)return null;const M=[],B=String(a);let j=0,be=T.index,X=!1;for(;be<T.items.length;){const G=T.items[be],_e=G.value;if(!_e)break;const r=B.indexOf(_e,j);if(r===-1)break;r>j&&M.push(B.slice(j,r)),M.push(G.rod),j=r+_e.length,be++,X=!0}return X?(j<B.length&&M.push(B.slice(j)),T.index=be,M):null}function no(a){var M;let T="";for(const B of a)typeof B=="string"?T+=B:T+=(M=B==null?void 0:B.value)!=null?M:"";return T}function Po(a){if(a.startsWith("on:"))return a.slice(3);const T=a.slice(2);return T?T==="DoubleClick"?"dblclick":T.toLowerCase():""}function ds(a){return a==null||a===!1?!1:a===!0?{capture:!0}:typeof a=="boolean"?a:typeof a=="object"?{capture:!!a.capture,passive:!!a.passive,once:!!a.once}:!1}function so(a,T){const M=ds(a),B=ds(T);return typeof M=="boolean"||typeof B=="boolean"?M===B:!!M&&!!B&&M.capture===B.capture&&M.passive===B.passive&&M.once===B.once}function Zn(a,T){return Array.isArray(a)?a.some(M=>Zn(M,T)):T(a)?!0:!a||typeof a!="object"||Array.isArray(a)||a.nodeType?!1:Array.isArray(a.handlers)?a.handlers.some(M=>Zn(M,T))||T(a.options)||typeof a.options=="function":Array.isArray(a.listeners)?a.listeners.some(M=>Zn(M,T))||T(a.options)||typeof a.options=="function":T(a.handler)||T(a.listener)||T(a.fn)||T(a.options)||typeof a.options=="function"}function es(a,T,M){var B,j,be,X,G,_e,r;if(a==null||a===!1)return[];if(typeof a=="function")return[{handler:a,options:ds(M!=null?M:!1)}];if(T(a))return es(a.value,T,M);if(Array.isArray(a))return a.flatMap(Se=>es(Se,T,M));if(typeof a=="object"&&!Array.isArray(a)&&!a.nodeType){if(Array.isArray(a.handlers)||Array.isArray(a.listeners)){const Me=a.handlers||a.listeners||[],Re=(j=(B=a.options)!=null?B:M)!=null?j:!1;return Me.flatMap(Ye=>es(Ye,T,Re))}let Se=(G=(X=(be=a.handler)!=null?be:a.listener)!=null?X:a.fn)!=null?G:null,ke=(r=(_e=a.options)!=null?_e:M)!=null?r:!1;return T(Se)&&(Se=Se.value),T(ke)&&(ke=ke.value),typeof ke=="function"&&(ke=ke()),typeof Se=="function"?[{handler:Se,options:ds(ke)}]:[]}return[]}function Ro(a,T){return es(a,T)}function oo(a,T,M,B){const j=Po(T);if(!j)return;const be={listeners:[]},X=()=>{be.listeners.forEach(_e=>{a.removeEventListener(j,_e.dispatch,_e.options)}),be.listeners=[]},G=_e=>{const r=Ro(_e,B);be.listeners.length===r.length&&be.listeners.every((ke,Me)=>{const Re=r[Me];return ke.handler===Re.handler&&so(ke.options,Re.options)})||(X(),r.forEach(ke=>{const Me={handler:ke.handler,options:ke.options,dispatch:null};Me.dispatch=Re=>{if(typeof Me.handler=="function"){const Ye=Me.handler.call(a,Re);return Me.options&&typeof Me.options=="object"&&Me.options.once&&(a.removeEventListener(j,Me.dispatch,Me.options),be.listeners=be.listeners.filter(pt=>pt!==Me)),Ye}},a.addEventListener(j,Me.dispatch,Me.options),be.listeners.push(Me)}))};if(ne._registerCleanup(a,X),B(M)){const _e=ne.reactive.effect(()=>{G(M.value)});ne._registerCleanup(a,_e);return}if(Zn(M,B)){const _e=ne.reactive.effect(()=>{G(M)});ne._registerCleanup(a,_e);return}G(M)}function io(a,T={}){const{isRod:M=()=>!1,interpolationCursor:B=null}=T;function j(Se){const ke=document.createTextNode(""),Me=ne.rodBind(ke,Se);return ne._registerCleanup(ke,Me),ke}function be(Se){a.appendChild(j(Se))}function X(Se){const ke=document.createTextNode("");a.appendChild(ke);const Me=ne.reactive.effect(()=>{ke.textContent=no(Se)});ne._registerCleanup(ke,Me)}function G(Se){const ke=[],Me=Re=>{if(!(Re==null||Re===!1)){if(Array.isArray(Re)){Re.forEach(Me);return}if(typeof Re=="string"){ke.push(document.createTextNode(Re));return}if(typeof Re=="number"){ke.push(document.createTextNode(String(Re)));return}if(typeof Re!="boolean"){if(M(Re)){ke.push(j(Re));return}if(Re!=null&&Re.nodeType){ke.push(Re);return}ke.push(document.createTextNode(String(Re)))}}};return Me(Se),ke}function _e(Se){const ke=document.createComment("dyn");a.appendChild(ke);let Me=[];const Re=ne.reactive.effect(()=>{Me.forEach(rt=>{Vt(rt),rt.parentNode&&rt.parentNode.removeChild(rt)}),Me=[];const Ye=ke.parentNode;if(!Ye)return;const pt=G(Se());if(!pt.length)return;const dt=document.createDocumentFragment();pt.forEach(rt=>dt.appendChild(rt)),Ye.insertBefore(dt,ke.nextSibling),Me=pt});ne._registerCleanup(ke,()=>{Re(),Me.forEach(Ye=>Vt(Ye)),Me=[]})}function r(Se){if(Se!=null){if(Array.isArray(Se)){for(const ke of Se)r(ke);return}if(typeof Se=="string"){const ke=us(Se,B);ke?X(ke):a.appendChild(document.createTextNode(Se));return}if(typeof Se=="number"){a.appendChild(document.createTextNode(String(Se)));return}if(typeof Se=="function"){_e(Se);return}if(M(Se)){be(Se);return}Se.nodeType&&a.appendChild(Se)}}return{appendRodText:be,appendInterpolatedText:X,appendDynamicChild:_e,appendChildValue:r}}function ro(a,T={}){const{el:M,isRod:B=()=>!1,interpolationCursor:j=null,appendChildValue:be=()=>{},appendRodText:X=()=>{},appendInterpolatedText:G=()=>{},appendDynamicChild:_e=()=>{},bindProp:r=()=>{}}=T;for(const Se of a)if(Se!=null){if(Array.isArray(Se)){be(Se);continue}if(typeof Se=="string"){const ke=us(Se,j);ke?G(ke):M.appendChild(document.createTextNode(Se));continue}if(typeof Se=="number"){M.appendChild(document.createTextNode(String(Se)));continue}if(typeof Se=="function"){_e(Se);continue}if(B(Se)){X(Se);continue}if(Se.nodeType){M.appendChild(Se);continue}if(typeof Se=="object")for(const[ke,Me]of Object.entries(Se)){if(typeof Me=="string"){const Re=us(Me,j);if(Re){r(ke,()=>no(Re));continue}}if(ke==="class"){r(ke,Me);continue}if(ke==="style"&&typeof Me=="object"&&Me!==null&&!B(Me)){r(ke,Me);continue}r(ke,Me)}}}const ao="http://www.w3.org/2000/svg",zs=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 fs(a){return a==="innerHTML"||a==="innerText"||a==="textContent"||a==="value"}function lo(a,...T){const M=zs.has(a),B=a==="text"&&!M?document.createTextNode(""):M?document.createElementNS(ao,a):document.createElement(a),j=Ve=>!!Ve&&Ve.type==="rod",be=Kn(),X=io(B,{isRod:j,interpolationCursor:be}),{appendRodText:G,appendInterpolatedText:_e,appendDynamicChild:r,appendChildValue:Se}=X,ke=ws(B,{isSVG:M,normalizeClass:Gn,isContentProp:fs}),{isBooleanDomProp:Me,isBindingValueKey:Re,applyBindingValue:Ye,setStyleEntry:pt,setProp:dt,setClassValue:rt}=ke;function De(Ve){const Qe=ne.reactive.effect(Ve);return ne._registerCleanup(B,Qe),Qe}function Ie(Ve){if(String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()!=="input")return!1;const Qe=String((Ve==null?void 0:Ve.type)||"").toLowerCase();return Qe==="range"||Qe==="number"}function $e(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()!=="input"?"":String((Ve==null?void 0:Ve.type)||"").toLowerCase()}function ct(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()==="select"&&!Ve.multiple}function at(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()==="input"&&String((Ve==null?void 0:Ve.type)||"").toLowerCase()==="file"}function xt(Ve,Qe,Ct){De(()=>{var bt;const Pt=(bt=Qe.value)!=null?bt:"";Ve.value!==String(Pt)&&dt("value",Pt)});const It=()=>{let Pt=Ve.value;const bt=$e(Ve),lt=typeof Qe.value=="number"||Qe.value==null;if(ct(Ve)&&Ve.value==="")Pt=null;else if(Ie(Ve)&<)if(bt==="number"&&Ve.value==="")Pt=null;else{const wt=typeof Ve.valueAsNumber=="number"&&!Number.isNaN(Ve.valueAsNumber)?Ve.valueAsNumber:Number(Ve.value);Pt=Number.isNaN(wt)?bt==="number"?null:0:wt}Qe.value!==Pt&&(Qe.value=Pt)};Ve.addEventListener(Ct,It),ne._registerCleanup(Ve,()=>{Ve.removeEventListener(Ct,It)})}function Nt(Ve,Qe){De(()=>{const It=!!Qe.value;!!Ve.checked!==It&&dt("checked",It)});const Ct=()=>{const It=!!Ve.checked;Qe.value!==It&&(Qe.value=It)};Ve.addEventListener("change",Ct),ne._registerCleanup(Ve,()=>{Ve.removeEventListener("change",Ct)})}function Wt(Ve,Qe){const Ct=()=>{var Pt;return String((Pt=Ve.value)!=null?Pt:"on")};De(()=>{const bt=(Qe.value==null?null:String(Qe.value))===Ct();!!Ve.checked!==bt&&dt("checked",bt)});const It=()=>{if(!Ve.checked)return;const Pt=Ct();Qe.value!==Pt&&(Qe.value=Pt)};Ve.addEventListener("change",It),ne._registerCleanup(Ve,()=>{Ve.removeEventListener("change",It)})}function vt(Ve,Qe){const Ct=()=>{const Pt=Ve.files;return Pt==null?[]:Array.isArray(Pt)?Pt.slice():typeof Pt.length=="number"?Array.from(Pt):[Pt]};De(()=>{const Pt=Qe.value;(Pt==null||Array.isArray(Pt)&&Pt.length===0)&&(Ve.value!==""&&dt("value",""),Array.isArray(Ve.files)&&(Ve.files=[]))});const It=()=>{const Pt=Ct();Qe.value=Pt};Ve.addEventListener("change",It),ne._registerCleanup(Ve,()=>{Ve.removeEventListener("change",It)})}function At(Ve,Qe){const Ct=()=>Array.from(Ve.childNodes||[]).filter(bt=>(bt==null?void 0:bt.tagName)==="OPTION"&&bt.selected).map(bt=>{var lt;return String((lt=bt.value)!=null?lt:"")}),It=()=>{const bt=Array.isArray(Qe.value)?Qe.value.map(wt=>String(wt)):[],lt=new Set(bt);Array.from(Ve.childNodes||[]).forEach(wt=>{var Ot;if((wt==null?void 0:wt.tagName)!=="OPTION")return;const tt=lt.has(String((Ot=wt.value)!=null?Ot:""));!!wt.selected!==tt&&(wt.selected=tt,tt?wt.setAttribute("selected",""):wt.removeAttribute("selected"))})};De(It),Ve._cmsApplySelectedValues=It,queueMicrotask(It);const Pt=()=>{const bt=Ct(),lt=Array.isArray(Qe.value)?Qe.value.map(wt=>String(wt)):[];lt.length===bt.length&<.every((wt,tt)=>wt===bt[tt])||(Qe.value=bt)};Ve.addEventListener("change",Pt),ne._registerCleanup(Ve,()=>{Ve.removeEventListener("change",Pt)})}function kt(Ve,Qe){De(()=>{const bt=!!Qe.value;!!Ve.selected!==bt&&dt("selected",bt)});let Ct=null;const It=()=>{const bt=!!Ve.selected;Qe.value!==bt&&(Qe.value=bt)};queueMicrotask(()=>{var bt;Ct||((bt=Ve.parentNode)==null?void 0:bt.tagName)!=="SELECT"||(Ct=Ve.parentNode,Ct.addEventListener("change",It))}),ne._registerCleanup(Ve,()=>{Ct==null||Ct.removeEventListener("change",It)})}function _t(Ve,Qe){if(to(Ve)){oo(B,Ve,Qe,j);return}if(Ve==="class"){if(vs(Qe)){De(()=>{rt(Gn(Qe))});return}rt(Gn(Qe));return}if(Ve==="style"&&Qe&&typeof Qe=="object"){const Ct=Ps(pt);if(ls(Qe,j)){De(()=>{Ct.apply(Qe,j)});return}Ct.apply(Qe,j);return}if(Ve==="style"&&(typeof Qe=="function"||j(Qe))){const Ct=Ps(pt);De(()=>{Ct.apply(Qe,j)});return}if(Re(Ve)&&typeof Qe=="function"){De(()=>{Ye(Ve,Qe())});return}if(Re(Ve)&&!j(Qe)){Ye(Ve,Qe);return}if(typeof Qe=="function"){De(()=>{dt(Ve,Qe())});return}if(Ve==="value"&&j(Qe)&&(a==="input"||a==="textarea"||a==="select")){if(a==="select"&&B.multiple){At(B,Qe);return}xt(B,Qe,a==="select"?"change":"input");return}if(Ve==="checked"&&j(Qe)&&a==="input"){if(String(B.type||"").toLowerCase()==="radio"){Wt(B,Qe);return}Nt(B,Qe);return}if(Ve==="files"&&j(Qe)&&at(B)){vt(B,Qe);return}if(Ve==="selected"&&j(Qe)&&a==="option"){kt(B,Qe);return}if(fs(Ve)&&j(Qe)){De(()=>{dt(Ve,Qe.value)});return}if(j(Qe)){const Ct=ne.rodBind(B,Qe,{key:Ve});ne._registerCleanup(B,Ct);return}dt(Ve,Qe)}return ro(T,{el:B,isRod:j,interpolationCursor:be,appendChildValue:Se,appendRodText:G,appendInterpolatedText:_e,appendDynamicChild:r,bindProp:_t}),a==="select"&&typeof B._cmsApplySelectedValues=="function"&&B._cmsApplySelectedValues(),B}const Yo={},co=["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"];co.forEach(a=>{window._[a]=(...T)=>lo(a,...T)}),_.DOM_ELEMENTS=co,_.fragment=(...a)=>a,_.dynamic=function(a){const T=document.createComment("dyn"),M=document.createDocumentFragment();M.appendChild(T);let B=null;return ne.reactive.effect(()=>{const j=a();if(B&&B.parentNode&&B.parentNode.removeChild(B),B=null,j==null)return;let be=j;(typeof j=="string"||typeof j=="number")&&(be=document.createTextNode(String(j)));const X=T.parentNode;X&&be&&be.nodeType&&(X.insertBefore(be,T.nextSibling),B=be)}),M};function uo(){let a=!1;const T=new Set;function M(){var j,be,X;a=!1,(j=ne.debug)==null||j.inc("rodFlushes"),(be=ne.perf)==null||be.inc("rodFlushes"),(X=ne.perf)==null||X.mark("rod:flush");const B=Array.from(T);T.clear();for(const G of B)try{G()}catch(_e){console.error("[rod] flush error:",_e)}}return function(j){T.add(j),a||(a=!0,queueMicrotask(M))}}const Xo=uo();function fo(a,T,M){if(!a)return;if(a.nodeType===3){a.textContent=M!=null?M:"";return}ws(a,{isSVG:a.namespaceURI===ao,normalizeClass:Gn,isContentProp:fs}).applyBindingValue(T,M)}function zo(a){return{type:"rod",value:a,_bindings:[],_actions:[],_disposeHooks:[],_disposed:!1,_silentDepth:0,_pending:!1,bindings(){return this._bindings.map(M=>({el:M.el,key:M.key}))},onDispose(M){return typeof M=="function"&&this._disposeHooks.push(M),this},_bind(M,B={key:"auto"}){var X;if(this._disposed)return()=>{};if(!M)return()=>{};const j={el:M,key:(X=B==null?void 0:B.key)!=null?X:"auto"};return this._bindings.some(G=>G.el===j.el&&G.key===j.key)||this._bindings.push(j),fo(j.el,j.key,this.value),()=>{this._bindings=this._bindings.filter(G=>!(G.el===j.el&&G.key===j.key))}},action(M){return!this._disposed&&typeof M=="function"&&this._actions.push(M),this},_setSilent(M){this._silentDepth++;try{this.value=M}finally{this._silentDepth--}return this},_scheduleNotify(){this._disposed||this._pending||(this._pending=!0,Xo(()=>{this._pending=!1,this._notifyNow()}))},_notifyNow(){var B,j,be,X,G;if(this._disposed)return;const M=performance.now();(B=ne.perf)==null||B.inc("rodNotifies"),this._bindings=this._bindings.filter(_e=>{const r=_e.el;return r?r.nodeType===3?!!r.parentNode:r.isConnected!==!1:!1});for(const _e of this._bindings)fo(_e.el,_e.key,this.value);if(!(this._silentDepth>0)){for(const _e of this._actions)try{_e(this.value)}catch(r){console.error("[rod] action error:",r)}(j=ne.debug)==null||j.inc("rodNotifies"),(G=ne.perf)==null||G.tick("rod:notify",performance.now()-M,{bindings:((be=this._bindings)==null?void 0:be.length)||0,actions:((X=this._actions)==null?void 0:X.length)||0})}},dispose(){if(!this._disposed){this._disposed=!0;for(const M of this._disposeHooks)try{M()}catch(B){console.error("[rod] dispose hook error:",B)}this._bindings.length=0,this._actions.length=0,this._disposeHooks.length=0}}}}function ms(a,T="value"){var X;let M=a[T],B=null,j=null,be=null;return(X=ne==null?void 0:ne.reactive)!=null&&X.signal&&([B,j,be]=ne.reactive.signal(M),be&&typeof a.onDispose=="function"&&a.onDispose(be)),Object.defineProperty(a,T,{get(){return B?B():M},set(G){j?j(G):M=G,a._scheduleNotify()},configurable:!0}),typeof a.val!="function"&&Object.defineProperty(a,"val",{value(G){return arguments.length?(this.value=G,G):this.value},configurable:!0}),a[Symbol.toPrimitive]||Object.defineProperty(a,Symbol.toPrimitive,{value(G){const _e=this.value;if(_e==null)return _e;const r=typeof _e;return G==="number"?Number(_e):(r!=="symbol"&&Rs(this,_e),r==="string"||r==="number"||r==="boolean"||r==="bigint"||r==="symbol"?_e:String(_e))},configurable:!0}),a.valueOf||Object.defineProperty(a,"valueOf",{value(){return this.value},configurable:!0}),a.toString||Object.defineProperty(a,"toString",{value(){return String(this.value)},configurable:!0}),a}_.rod=function(T,M="value"){const B=zo(T);return ms(B,M),ne.rod._all=ne.rod._all||new Set,ne.rod._all.add(B),typeof B.onDispose=="function"&&B.onDispose(()=>ne.rod._all.delete(B)),B},ne.rodBind=function(a,T,M={key:"auto"}){var B,j,be;if((B=ne.debug)==null||B.inc("rodBinds"),!a)return(j=ne.debug)==null||j.inc("rodBindNull"),(be=ne.debug)==null||be.warn("rodBind: target element \xE8 null/undefined",M),()=>{};if(!T||T.type!=="rod")throw new Error("JSswift.rodBind: react must be a rod object");return T._bind(a,M)},ne.rodFromSignal=function(a,T){const M=_.rod(a());let B=!1;const j=ne.reactive.effect(()=>{const X=M.value,G=ne.reactive.untracked(()=>a());if(!B&&G!==X){B=!0;try{T(X)}finally{B=!1}}}),be=ne.reactive.effect(()=>{const X=a();if(ne.reactive.untracked(()=>M.value)!==X){B=!0;try{M._setSilent(X)}finally{B=!1}}});return typeof M.onDispose=="function"&&(M.onDispose(j),M.onDispose(be)),M};function Tn(a){if(!a||!a.tagName)return null;const T=a.tagName.toLowerCase();if(T==="input"){const M=(a.type||"text").toLowerCase();return M==="checkbox"?"checkbox":M==="radio"?"radio":M==="number"?"number":"text"}return T==="select"?a.multiple?"select-multiple":"select":null}ne.rodModel=function(a,T,M={}){var Se,ke,Me;if(!T||T.type!=="rod")throw new Error("[JSswift.rodModel] rodObj deve essere un rod");const B=Array.isArray(a)||a instanceof NodeList?Array.from(a):[a],j=(Se=M.event)!=null?Se:"change",be=(ke=M.parse)!=null?ke:(Re=>Re),X=(Me=M.format)!=null?Me:(Re=>Re);let G=!1;const _e=[],r=Re=>{for(const Ye of B){if(!Ye)continue;switch(Tn(Ye)){case"checkbox":Ye.checked=!!Re;break;case"radio":Ye.checked=Ye.value==Re;break;case"select":Ye.value=Re!=null?Re:"";break;case"select-multiple":const dt=Array.isArray(Re)?Re.map(String):[];for(const rt of Ye.options)rt.selected=dt.includes(rt.value);break;default:Ye.value=Re!=null?Re:""}}};T.action(Re=>{if(!G){G=!0;try{r(X(Re))}finally{G=!1}}}),r(X(T.value));for(const Re of B){if(!Re)continue;const Ye=Tn(Re),pt=()=>{if(G)return;let dt;switch(Ye){case"checkbox":dt=Re.checked;break;case"radio":if(!Re.checked)return;dt=Re.value;break;case"select":dt=Re.value;break;case"select-multiple":dt=Array.from(Re.selectedOptions).map(rt=>rt.value);break;case"number":dt=be(Re.value===""?null:Number(Re.value));break;default:dt=be(Re.value)}G=!0;try{T.value!==dt&&(T.value=dt)}finally{G=!1}};Re.addEventListener(j,pt),_e.push(()=>Re.removeEventListener(j,pt))}return typeof T.onDispose=="function"&&T.onDispose(()=>_e.forEach(Re=>Re())),()=>_e.forEach(Re=>Re())},ne.signalModel=function(a,T,M,B={}){const j=ne.rodFromSignal(T,M);return ne.rodModel(a,j,B)};function Vt(a){if(!a)return;const T=ne._cleanupRegistry.get(a);if(T){for(const M of T)try{M()}catch(B){console.error("[cleanup] error:",B)}ne._cleanupRegistry.delete(a)}if(a.childNodes&&a.childNodes.length)for(const M of a.childNodes)Vt(M)}function Mo(a){const T=M=>typeof M=="string"?ne.dom.q(M):M;return Array.isArray(a)?a.map(T).filter(Boolean):[T(a)].filter(Boolean)}function Ss(a){const T=[],M=[],B=j=>{if(j!=null){if(typeof j=="function"){B(j());return}if(j&&typeof j=="object"&&"node"in j){typeof j.dispose=="function"&&M.push(j.dispose),B(j.node);return}if(Array.isArray(j)){for(const be of j)B(be);return}if(typeof j=="string"||typeof j=="number"){T.push(document.createTextNode(String(j)));return}if(j.nodeType){T.push(j);return}console.warn("[JSswift.mount] contenuto non supportato:",j)}};return B(a),{nodes:T,disposers:M}}function ts(a=[],T="[JSswift.mount] dispose error:"){let M=!1;return()=>{if(!M){M=!0;for(const B of a)try{B()}catch(j){console.error(T,j)}}}}function Cs(a=[],T=null){return ts([...T?[T]:[],...a],"[component] dispose error:")}ne.mount=function(a,T,M={}){var _e;const B=Mo(a),j=(_e=M.clear)!=null?_e:!0,be=B.length>1;if(B.length===0)return console.warn("[JSswift.mount] nessun target valido:",a),()=>{};const X=[];for(const r of B){if(j)for(;r.firstChild;)Vt(r.firstChild),r.removeChild(r.firstChild);const{nodes:Se,disposers:ke}=Ss(T);let Me=Se;be&&typeof T!="function"&&(Me=Se.map(Ye=>Ye.cloneNode(!0)),ke.length&&console.warn("[JSswift.mount] multi-target con dispose: usa content come function per istanze separate."));const Re=ts(ke);for(const Ye of Me)r.appendChild(Ye);X.push({root:r,nodes:Me,dispose:Re});for(const Ye of Me)!Ye||!Ye.nodeType||ne._registerCleanup(Ye,Re)}return()=>{var r;for(const Se of X){for(const ke of Se.nodes)ke&&(Vt(ke),ke.parentNode===Se.root&&Se.root.removeChild(ke));(r=Se.dispose)==null||r.call(Se)}}},ne.component=function(a){if(typeof a!="function")throw new Error("JSswift.component: renderFn must be a function");return function(M={}){const B=[],be=a(M,{onDispose(X){typeof X=="function"&&B.push(X)}});return be&&typeof be=="object"&&"node"in be?{node:be.node,dispose:Cs(B,typeof be.dispose=="function"?be.dispose:null)}:{node:be,dispose:Cs(B)}}},ne.enableAutoCleanup=function(){if(ne._autoCleanupEnabled)return;ne._autoCleanupEnabled=!0;const a=new MutationObserver(T=>{for(const M of T)for(const B of M.removedNodes)Vt(B)});a.observe(document.body,{childList:!0,subtree:!0}),ne._cleanupObserver=a},ne.debug=(()=>{const a={rodFlushes:0,rodNotifies:0,rodBinds:0,rodBindNull:0,rodBindDup:0};function T(){return!!ne.config.debug}function M(..._e){T()&&console.log("[JSswift]",..._e)}function B(..._e){T()&&console.warn("[JSswift]",..._e)}function j(..._e){console.error("[JSswift]",..._e)}function be(_e,r=1){a[_e]||(a[_e]=0),a[_e]+=r}function X(){return{...a}}function G(){for(const _e of Object.keys(a))a[_e]=0}return{enabled:T,log:M,warn:B,error:j,inc:be,stats:X,reset:G}})(),ne.perf=(()=>{let a=!1;const T={effectsRun:0,effectsSlow:0,rodNotifies:0,rodFlushes:0,domWrites:0,httpRequests:0},M=[],B=[],j={timelineMax:200,slowEffectMs:8};function be(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function X($e,ct=0,at=null){a&&(M.push({t:Date.now(),type:$e,ms:ct,meta:at}),M.length>j.timelineMax&&M.shift())}function G($e,ct=1){a&&(T[$e]=(T[$e]||0)+ct)}function _e($e,ct){a&&(B.push({t:Date.now(),ms:$e,meta:ct}),B.length>100&&B.shift())}let r=null;function Se(){r||(r=ne.reactive.effect,ne.reactive.effect=function($e,ct){return r((...xt)=>{const Nt=be();G("effectsRun");try{return $e(...xt)}finally{const Wt=be()-Nt;Wt>=j.slowEffectMs?(G("effectsSlow"),_e(Wt,ct||$e.name||"effect"),X("effect:slow",Wt,ct||$e.name||null)):X("effect",Wt,ct||$e.name||null)}})})}function ke(){r&&(ne.reactive.effect=r,r=null)}function Me($e=!0){return a=!!$e,a?Se():ke(),a}function Re(){for(const $e of Object.keys(T))T[$e]=0;M.length=0,B.length=0}function Ye(){return{enabled:a,...T,slowEffectMs:j.slowEffectMs,timelineSize:M.length}}function pt(){return M.slice()}function dt($e=j.slowEffectMs){return B.filter(ct=>ct.ms>=$e).slice().sort((ct,at)=>at.ms-ct.ms)}function rt($e,ct){const at=be();try{return ct()}finally{const xt=be()-at;X("time:"+$e,xt,$e)}}function De($e,ct){X($e,0,ct)}function Ie($e,ct,at){X($e,ct,at)}return{enable:Me,reset:Re,stats:Ye,timeline:pt,slowEffects:dt,time:rt,mark:De,tick:Ie,inc:G,cfg:j}})(),ne.rod=ne.rod||{},ne.rod.inspect=function(a,T="rod"){if(!a||a.type!=="rod")return console.warn("[JSswift.rod.inspect] non \xE8 un rod:",a),null;const M=typeof a.bindings=="function"?a.bindings():[],B={label:T,value:a.value,bindingsCount:M.length,bindings:M.map(j=>{var be,X,G,_e,r,Se,ke;return{key:j.key,el:((be=j.el)==null?void 0:be.nodeType)===3?"#text":(X=j.el)==null?void 0:X.tagName,id:((G=j.el)==null?void 0:G.id)||null,className:((_e=j.el)==null?void 0:_e.className)||null,isConnected:((r=j.el)==null?void 0:r.nodeType)===3?!!j.el.parentNode:(ke=(Se=j.el)==null?void 0:Se.isConnected)!=null?ke:null}}),actionsCount:Array.isArray(a._actions)?a._actions.length:null,disposed:!!a._disposed};return ne.config.debug?(console.groupCollapsed(`[JSswift.rod.inspect] ${T}`),console.log(B),console.groupEnd()):console.log(B),B},ne.rod.inspectAll=function(){const a=ne.rod._all?Array.from(ne.rod._all):[];return a.forEach((T,M)=>ne.rod.inspect(T,`rod#${M+1}`)),a.length},ne._storeShared=(()=>{function a(be){return`${be.storage}::${be.prefix}`}function T(be,X){function G(ke={}){var Re,Ye;const Me={storage:(Re=ke.storage)!=null?Re:be.storage,prefix:(Ye=ke.prefix)!=null?Ye:be.prefix};return X.set(a(Me),Me),Me}function _e(ke=null){var Re;return(typeof ke=="string"?ke:(Re=ke==null?void 0:ke.storage)!=null?Re:be.storage)==="session"?window.sessionStorage:window.localStorage}function r(ke,Me=null){return(Me||G()).prefix+ke}function Se(ke,Me=null){const Re=Me||G();return`${a(Re)}::${ke}`}return{getScope:G,getStorage:_e,fullKey:r,channelKey:Se}}function M(be){try{return JSON.parse(be)}catch(X){return}}function B(be){try{return JSON.stringify(be)}catch(X){return}}function j(be,...X){const G=`${be.storage}::${be.prefix}::`;for(const _e of X)for(const r of Array.from(_e.keys()))r.startsWith(G)&&_e.delete(r)}return{createScopeTools:T,safeParse:M,safeStringify:B,clearScopedMapEntries:j}})(),ne.store=(()=>{const a={prefix:"JSswift:",storage:"local",syncTabs:!0,writeDelay:0},T=new Map,M=new Map,B=new Map,j=new Map;let be=!1;const{createScopeTools:X,safeParse:G,safeStringify:_e,clearScopedMapEntries:r}=ne._storeShared,{getScope:Se,getStorage:ke,fullKey:Me,channelKey:Re}=X(a,j);function Ye(vt,At,kt=null){var Qe;const _t=kt||Se(),Ve=M.get(Re(vt,_t));if(Ve)for(const Ct of Ve)try{(Qe=ne.reactive)!=null&&Qe.untracked?ne.reactive.untracked(()=>Ct(At)):Ct(At)}catch(It){console.error("[store] watcher error:",It)}}function pt(){be=!1;for(const[vt,At]of Array.from(B.entries())){B.delete(vt);const kt=T.get(vt),_t=_e(kt);if(_t===void 0)continue;const Ve=ke(At.scope);try{Ve.setItem(Me(At.key,At.scope),_t)}catch(Qe){console.error("[store] write error:",Qe)}}}function dt(vt,At=null){const kt=At||Se();B.set(Re(vt,kt),{key:vt,scope:kt}),!be&&(be=!0,a.writeDelay>0?setTimeout(pt,a.writeDelay):queueMicrotask(pt))}function rt(vt,At=null){const kt=At||Se(),Ve=ke(kt).getItem(Me(vt,kt));if(Ve!=null)return G(Ve)}function De(vt,At,kt=null){const _t=kt||Se(),Ve=Re(vt,_t);if(T.has(Ve))return T.get(Ve);const Qe=rt(vt,_t);return Qe!==void 0?(T.set(Ve,Qe),Qe):At}function Ie(vt,At,kt=null){const _t=kt||Se();return T.set(Re(vt,_t),At),dt(vt,_t),Ye(vt,At,_t),At}function $e(vt,At=null){const kt=At||Se(),_t=Re(vt,kt);T.delete(_t),B.delete(_t);try{ke(kt).removeItem(Me(vt,kt))}catch(Ve){}Ye(vt,void 0,kt)}function ct(vt={}){const At=Se(vt),kt=ke(At),_t=[];for(let Ve=0;Ve<kt.length;Ve++){const Qe=kt.key(Ve);Qe&&Qe.startsWith(At.prefix)&&_t.push(Qe)}for(const Ve of _t)kt.removeItem(Ve);r(At,T,B,M)}function at(vt,At,kt=null){if(typeof At!="function")return()=>{};const _t=kt||Se(),Ve=Re(vt,_t);return M.has(Ve)||M.set(Ve,new Set),M.get(Ve).add(At),()=>{var Qe;return(Qe=M.get(Ve))==null?void 0:Qe.delete(At)}}function xt(vt,At,kt={}){const _t=Se({storage:kt.storage,prefix:kt.prefix}),Ve=De(vt,At,_t),[Qe,Ct,It]=ne.reactive.signal(Ve),Pt=ne.reactive.effect(()=>{const wt=Qe();Ie(vt,wt,_t)}),bt=at(vt,wt=>{Qe()!==wt&&Ct(wt)},_t);return[Qe,Ct,()=>{try{Pt==null||Pt()}catch(wt){}try{bt==null||bt()}catch(wt){}try{It==null||It()}catch(wt){}}]}Se(),a.syncTabs&&window.addEventListener("storage",vt=>{if(!(!vt.key||!vt.storageArea))for(const At of j.values()){if(ke(At)!==vt.storageArea||!vt.key.startsWith(At.prefix))continue;const kt=vt.key.slice(At.prefix.length),_t=vt.newValue==null?void 0:G(vt.newValue),Ve=Re(kt,At);_t===void 0?T.delete(Ve):T.set(Ve,_t),Ye(kt,_t,At)}});function Nt(vt={}){Object.assign(a,vt),Se()}function Wt(){return{prefix:a.prefix,storage:a.storage,syncTabs:a.syncTabs,cacheSize:T.size,scopeCount:j.size}}return{configure:Nt,stats:Wt,get:De,set:Ie,remove:$e,clear:ct,watch:at,signal:xt}})(),ne.store.computed=function(a){if(typeof a!="function")throw new Error("store.computed: fn must be a function");return ne.reactive.computed(a)},ne.store.migrate=function(a,T,M={}){var G,_e;const B=(G=M.versionKey)!=null?G:"__version",j=Number((_e=ne.store.get(B,0))!=null?_e:0),be=Number(a!=null?a:0);if(!Number.isFinite(be)||be<0)throw new Error("store.migrate: targetVersion non valido");if(j>=be)return{from:j,to:be,applied:0};let X=0;for(let r=j;r<be;r++){const Se=T==null?void 0:T[r];if(typeof Se=="function")try{Se(ne.store)}catch(ke){console.error("[store.migrate] step error at version",r,ke)}X++,ne.store.set(B,r+1)}return{from:j,to:be,applied:X}},ne.store.model=function(a,T,M,B={}){if(typeof T!="string"||!T)throw new Error("store.model: key deve essere una stringa non vuota");const[j,be,X]=ne.store.signal(T,M,{storage:B.storage,prefix:B.prefix}),G=ne.rodFromSignal(j,be),_e=ne.rodModel(a,G,{event:B.event,parse:B.parse,format:B.format});return()=>{var r;try{_e==null||_e()}catch(Se){}try{X==null||X()}catch(Se){}try{(r=G.dispose)==null||r.call(G)}catch(Se){}}},ne.store.bind=function(a,T,M,B={}){var be;let j=a;return typeof a=="string"&&(a.includes("[")||a.includes(" ")?j=document.querySelectorAll(a):j=ne.dom.q(a)),j?ne.store.model(j,T,M,B):((be=ne.config)!=null&&be.debug&&console.warn("[store.bind] target non trovato:",a),()=>{})},ne.store.bindAll=function(a,T={},M={}){if(typeof a=="string"&&(a=ne.dom.q(a)),!a||!a.querySelectorAll)return console.warn("[store.bindAll] form non valido:",a),()=>{};const B=[];for(const[j,be]of Object.entries(T)){const X=a.querySelectorAll(`[name="${j}"]`);if(!X.length)continue;const G=ne.store.model(X.length===1?X[0]:X,j,be,M);B.push(G)}return()=>B.forEach(j=>j())},ne.store.inspect=function(){const a={...ne.store.stats(),keys:Array.from((function(){const T=ne.store.stats().storage==="session"?sessionStorage:localStorage,M=[];for(let B=0;B<T.length;B++){const j=T.key(B);j&&j.startsWith(ne.store.stats().prefix)&&M.push(j.replace(ne.store.stats().prefix,""))}return M})())};return console.groupCollapsed("[JSswift.store.inspect]"),console.table(a.keys),console.log(a),console.groupEnd(),a},ne.store.autoForm=function(a,T={},M={}){var j;const B=ne.store.bindAll(a,T,M);return(j=ne.config)!=null&&j.debug&&console.log("[store.autoForm] autosave attivo:",T),B},ne.useStore=function(a,T,M,B={}){const[j,be,X]=ne.store.signal(a,T,B);return M&&typeof M.onDispose=="function"&&typeof X=="function"&&M.onDispose(X),[j,be]},ne._plugins=new Set,ne.usePlugin=function(a,T){var M;if(a){if(ne._plugins.has(a)){(M=ne.config)!=null&&M.debug&&console.warn("[JSswift.usePlugin] plugin gi\xE0 installato:",a.name||a);return}if(typeof a=="function"){a(ne,T),ne._plugins.add(a);return}if(a&&typeof a.install=="function"){a.install(ne,T),ne._plugins.add(a);return}console.warn("[JSswift.usePlugin] plugin non valido:",a)}},ne.plugins=ne.plugins||{},ne.plugins.debug={install(a){a.config.debug=!0,console.log("[JSswift] Debug mode ON")}},ne.plugins.forms={install(a){const T={};a.forms={validate(M,B={},j={}){var Se,ke;if(typeof M=="string"&&(M=a.dom.q(M)),!M||!M.querySelectorAll)return console.warn("[forms.validate] form non valido:",M),null;const be={mode:j.mode||"input",showMessages:(Se=j.showMessages)!=null?Se:!0,submitGuard:(ke=j.submitGuard)!=null?ke:!0,errorClass:j.errorClass||"is-invalid",validClass:j.validClass||"is-valid",messageClass:j.messageClass||"form-error"},X={};for(const[Me,Re]of Object.entries(B)){const Ye=M.querySelectorAll(`[name="${Me}"]`);if(!Ye.length)continue;const[pt,dt]=a.reactive.signal(null);X[Me]={getErr:pt,setErr:dt,els:Ye};let rt=null;be.showMessages&&(rt=document.createElement("div"),rt.className=be.messageClass,Ye[Ye.length-1].after(rt));const De=()=>{let Ie;const $e=Ye[0];if($e.type==="checkbox")Ie=$e.checked;else if($e.type==="radio"){const xt=Array.from(Ye).find(Nt=>Nt.checked);Ie=xt?xt.value:null}else Ie=$e.value;let ct=!0;try{ct=Re(Ie)}catch(xt){ct=xt.message||"Errore di validazione"}const at=ct===!0?null:typeof ct=="string"?ct:"Valore non valido";return dt(at),!at};for(const Ie of Ye)Ie.addEventListener(be.mode,De);a.reactive.effect(()=>{const Ie=pt();for(const $e of Ye)$e.classList.toggle(be.errorClass,!!Ie),$e.classList.toggle(be.validClass,!Ie);rt&&(rt.textContent=Ie||"",rt.style.display=Ie?"block":"none")}),De()}const G=a.store.computed(()=>Object.values(X).every(Me=>!Me.getErr())),_e=Me=>{let Re=!0;for(const Ye of Object.values(X)){const pt=Ye.els[0];pt&&pt.dispatchEvent(new Event(be.mode,{bubbles:!0})),Ye.getErr()&&(Re=!1)}!Re&&be.submitGuard&&(Me.preventDefault(),Me.stopPropagation())};be.submitGuard&&M.addEventListener("submit",_e);const r=()=>{be.submitGuard&&M.removeEventListener("submit",_e)};return T[M]={isValid:G,dispose:r},{isValid:G,dispose:r}}}}},ne._authShared=(()=>{function a(B){const j=()=>{var X;return((X=B())==null?void 0:X.roles)||[]},be=()=>{var X;return((X=B())==null?void 0:X.permissions)||[]};return{roles:j,perms:be,hasRole:X=>j().includes(X),can:X=>be().includes(X),canAny:X=>X.some(G=>j().includes(G)||be().includes(G)),canAll:X=>X.every(G=>j().includes(G)||be().includes(G))}}function T(B,j){return j.some(be=>typeof be=="string"?B.startsWith(be):be instanceof RegExp?be.test(B):!1)}function M(B,j){if(!B||!j)return;let be=!1;function X(){return Date.now()}function G(Me){if(!Me||typeof Me!="string")return null;const Re=Me.split(".");if(Re.length<2)return null;try{const Ye=Re[1].replace(/-/g,"+").replace(/_/g,"/"),pt=decodeURIComponent(atob(Ye).split("").map(dt=>"%"+dt.charCodeAt(0).toString(16).padStart(2,"0")).join(""));return JSON.parse(pt)}catch(Ye){return null}}function _e(){var Me,Re,Ye,pt;if(typeof j._getState=="function"){const dt=j._getState();return dt&&typeof dt=="object"?dt:{user:(Re=(Me=j.user)==null?void 0:Me.call(j))!=null?Re:null}}return{user:(pt=(Ye=j.user)==null?void 0:Ye.call(j))!=null?pt:null}}function r(){var De,Ie,$e;const Me=_e()||{},Re=(Ie=Me.user)!=null?Ie:(De=j.user)==null?void 0:De.call(j),Ye=(Re==null?void 0:Re.name)||(Re==null?void 0:Re.email)||(Re==null?void 0:Re.id)||"anon",pt=!!(($e=j.isAuth)!=null&&$e.call(j)),dt=Me.expiresAt||null,rt=dt?dt-X():null;return pt?`AUTH \u2705 user=${Ye}${dt?` expiresIn=${Math.round(rt/1e3)}s`:""}`:`AUTH \u274C user=${Ye}`}function Se(Me="auth"){var Nt,Wt,vt;const Re=_e()||{},Ye=(Wt=Re.user)!=null?Wt:(Nt=j.user)==null?void 0:Nt.call(j),pt=(Ye==null?void 0:Ye.roles)||[],dt=(Ye==null?void 0:Ye.permissions)||[],rt=Re.accessToken||null,De=Re.refreshToken||null,Ie=rt?G(rt):null,$e=Re.expiresAt||(Ie!=null&&Ie.exp?Ie.exp*1e3:null),ct=X(),at=$e?$e-ct:null,xt={label:Me,isAuth:!!((vt=j.isAuth)!=null&&vt.call(j)),user:Ye,roles:pt,permissions:dt,has:{role:At=>{var kt;return!!((kt=j.hasRole)!=null&&kt.call(j,At))},can:At=>{var kt;return!!((kt=j.can)!=null&&kt.call(j,At))}},token:{hasAccess:!!rt,hasRefresh:!!De,expiresAt:$e,expiresInSec:at==null?null:Math.round(at/1e3),decodedJWT:Ie}};return console.groupCollapsed(`[JSswift.auth.inspect] ${Me}`),console.log("status:",r()),console.log(xt),at!=null&&(at<=0?console.warn("\u26A0\uFE0F Access token scaduto."):at<6e4&&console.warn("\u26A0\uFE0F Access token in scadenza (<60s).")),console.groupEnd(),xt}function ke(Me=!0){be=!!Me,console.log("[JSswift.auth.trace]",be?"ON":"OFF")}if(typeof j.fetch=="function"&&!j._fetchWrapped){const Me=j.fetch.bind(j);j.fetch=async(...Re)=>{const Ye=await Me(...Re);if(be)try{console.log("[auth.fetch]",Ye.status,Re[0])}catch(pt){}return Ye},j._fetchWrapped=!0}j.decodeJWT=G,j.status=r,j.inspect=Se,j.trace=ke}return{createPermissionApi:a,matchesProtectedPath:T,attachDevTools:M}})(),ne.plugins.auth={install(a,T={}){var ct;const{createPermissionApi:M,matchesProtectedPath:B,attachDevTools:j}=ne._authShared,be={key:T.key||"auth",loginRoute:T.loginRoute||"/login",protected:T.protected||[],autoRedirect:(ct=T.autoRedirect)!=null?ct:!0,endpoints:T.endpoints||{login:"/api/login",refresh:"/api/refresh",logout:"/api/logout"},fetchOptions:T.fetchOptions||{},tokenHeader:T.tokenHeader||"Authorization",tokenPrefix:T.tokenPrefix||"Bearer ",refreshMargin:T.refreshMargin||3e4},[X,G]=a.store.signal(be.key,null),_e=()=>{var at;return((at=X())==null?void 0:at.user)||null},r=()=>{var at;return!!((at=X())!=null&&at.accessToken)},{hasRole:Se,can:ke,canAny:Me,canAll:Re}=M(_e);let Ye=!1,pt=[];function dt(){const at=X();return at!=null&&at.expiresAt?Date.now()>at.expiresAt-be.refreshMargin:!1}async function rt(){var at;if(Ye)return new Promise((xt,Nt)=>pt.push({res:xt,rej:Nt}));Ye=!0;try{const xt=await fetch(be.endpoints.refresh,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:(at=X())==null?void 0:at.refreshToken})});if(!xt.ok)throw new Error("Refresh failed");const Nt=await xt.json();return G({...X(),...Nt}),pt.forEach(Wt=>Wt.res(!0)),pt=[],!0}catch(xt){throw pt.forEach(Nt=>Nt.rej(xt)),pt=[],G(null),be.autoRedirect&&a.router.navigate(be.loginRoute),xt}finally{Ye=!1}}async function De(at){const xt=await fetch(be.endpoints.login,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(at)});if(!xt.ok)throw new Error("Login failed");const Nt=await xt.json();return G(Nt),Nt}async function Ie(){try{await fetch(be.endpoints.logout,{method:"POST"})}catch(at){}G(null),be.autoRedirect&&a.router.navigate(be.loginRoute)}async function $e(at,xt={}){var At;dt()&&await rt();const Nt=X(),Wt=new Headers(xt.headers||{});Nt!=null&&Nt.accessToken&&Wt.set(be.tokenHeader,be.tokenPrefix+Nt.accessToken);const vt=await fetch(at,{...be.fetchOptions,...xt,headers:Wt});return vt.status===401&&((At=X())!=null&&At.refreshToken)&&!xt._authRetried?(await rt(),$e(at,{...xt,_authRetried:!0})):vt}a.router.beforeEach(at=>{const xt=at.path;return B(xt,be.protected)&&!r()?be.loginRoute:!0}),a.auth={user:_e,isAuth:r,hasRole:Se,can:ke,canAny:Me,canAll:Re,loginAsync:De,logoutAsync:Ie,fetch:$e,_getState:X},a.useAuth=function(at){return at&&at.onDispose,a.auth},j(ne,a.auth)}},ne._httpShared=(()=>{function a(r){var _t;const Se=r.reactive,[ke,Me]=Se.signal(0),[Re,Ye]=Se.signal("idle"),[pt,dt]=Se.signal(null),[rt,De]=Se.signal(null),[Ie,$e]=Se.signal(null),[ct,at]=Se.signal(0),[xt,Nt]=Se.signal(0);let Wt=0;function vt(Ve){const Qe=++Wt,Ct=Date.now();return Me(ke()+1),Ye("pending"),$e(null),De(null),dt({id:Qe,url:Ve.url,method:Ve.method,meta:Ve.meta,timeout:Ve.timeout,retry:Ve.retry,startedAt:Ct}),Nt(Ct),Qe}function At(Ve,Qe,Ct,It){const Pt=Date.now();Me(Math.max(0,ke()-1)),Ve===Wt&&(Ct?(Ye("error"),$e(Ct),De(null)):Qe?(Ye("success"),$e(null),De({id:Ve,status:Qe.status,ok:Qe.ok,headers:Qe.headers,url:Qe.url,receivedAt:Pt,raw:Qe})):(Ye("idle"),$e(null),De(null)),at(Math.max(0,Number(It||0)))),Nt(Pt)}return{state:{inFlight:ke,status:Re,isLoading:(_t=r.store)!=null&&_t.computed?r.store.computed(()=>ke()>0):()=>ke()>0,lastRequest:pt,lastResponse:rt,lastError:Ie,lastDuration:ct,lastUpdated:xt,reset(){Me(0),Ye("idle"),dt(null),De(null),$e(null),at(0),Nt(Date.now())}},markStart:vt,markEnd:At}}function T(r,Se){if(!r||/^https?:\/\//i.test(Se))return Se;const ke=r.endsWith("/")?r.slice(0,-1):r,Me=Se.startsWith("/")?Se:"/"+Se;return ke+Me}function M(r){return new Promise(Se=>setTimeout(Se,r))}function B(r,Se){return r?!0:Se?Se.status===429||Se.status>=500&&Se.status<=599:!1}function j(r,Se){if(!r&&!Se)return{signal:void 0,cancel:()=>{}};const ke=new AbortController,Me=ke.signal;let Re=null;r>0&&(Re=setTimeout(()=>ke.abort(new Error("timeout")),r));const Ye=()=>ke.abort(Se.reason||new Error("aborted"));return Se&&(Se.aborted?Ye():Se.addEventListener("abort",Ye,{once:!0})),{signal:Me,cancel:()=>{var dt;Re&&clearTimeout(Re),Se&&((dt=Se.removeEventListener)==null||dt.call(Se,"abort",Ye))}}}function be(r,Se,ke={}){var pt,dt,rt;const Me=typeof Se=="string"?T(r.baseURL,Se):Se,Re=(ke.method||"GET").toUpperCase(),Ye=new Headers(r.headers);return ke.headers&&new Headers(ke.headers).forEach((De,Ie)=>Ye.set(Ie,De)),{url:Me,method:Re,headers:Ye,body:ke.body,credentials:(pt=ke.credentials)!=null?pt:r.credentials,signal:ke.signal,timeout:(dt=ke.timeout)!=null?dt:r.timeout,retry:(rt=ke.retry)!=null?rt:r.retry,meta:ke.meta||{}}}async function X(r,...Se){var Me;let ke=Se[0];for(const Re of r)ke=(Me=await Re(ke,...Se.slice(1)))!=null?Me:ke;return ke}function G(r,Se){return{ok:r.ok,status:r.status,headers:r.headers,raw:r,req:Se,async json(){let ke=null,Me=null;try{ke=await r.json()}catch(Re){ke=null}return r.ok||(Me=ke!=null?ke:{status:r.status}),{data:ke,error:Me,ok:r.ok,status:r.status}},async jsonStrict(){const{data:ke,error:Me}=await this.json();if(Me){const Re=new Error(`HTTP error ${r.status} ${(Se==null?void 0:Se.method)||""} ${(Se==null?void 0:Se.url)||""}`.trim());throw Re.status=r.status,Re.data=ke,Re.req={url:Se==null?void 0:Se.url,method:Se==null?void 0:Se.method,meta:Se==null?void 0:Se.meta},Re}return{data:ke,ok:!0,status:r.status}},async text(){let ke="";try{ke=await r.text()}catch(Me){}return{text:ke,ok:r.ok,status:r.status}},async textStrict(){const ke=await this.text();if(!ke.ok){const Me=new Error("HTTP error "+r.status);throw Me.status=r.status,Me.text=ke.text,Me}return ke}}}function _e(r,Se,ke,Me,Re={}){const Ye=new Headers(Re.headers||{});return Ye.has("Content-Type")||Ye.set("Content-Type","application/json"),r(ke,{...Re,method:Se,headers:Ye,body:Me==null?void 0:JSON.stringify(Me)})}return{createReactiveState:a,joinURL:T,sleep:M,isRetryable:B,makeAbort:j,normalizeRequest:be,runHooks:X,wrapResponse:G,withJSON:_e}})();const{createReactiveState:jn,sleep:qn,isRetryable:xs,makeAbort:As,normalizeRequest:gs,runHooks:Ms,wrapResponse:mo,withJSON:ns}=ne._httpShared,Yn=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{},go={baseURL:((Hs=Yn.http)==null?void 0:Hs.baseURL)||"",timeout:(yo=(Vs=Yn.http)==null?void 0:Vs.timeout)!=null?yo:0,retry:((Bs=Yn.http)==null?void 0:Bs.retry)||{attempts:0,delay:250,factor:2},headers:(($s=Yn.http)==null?void 0:$s.headers)||{},credentials:(wo=Yn.http)==null?void 0:wo.credentials,debug:(Hn=Yn.debug)!=null?Hn:!1},Js=jn(ne),Ns=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now(),Pn={beforeRequest:new Set,afterResponse:new Set,onError:new Set};async function po(a){const T=ne.auth&&typeof ne.auth.fetch=="function"?ne.auth.fetch.bind(ne.auth):fetch,M={method:a.method,headers:a.headers,body:a.body,credentials:a.credentials,signal:a.signal};return T(a.url,M)}async function wn(a,T={}){var Re,Ye,pt;let M=gs(go,a,T);M=await Ms(Pn.beforeRequest,M);const B=Js.markStart(M),j=Ns(),be=M.retry||{attempts:0,delay:250,factor:2},X=Math.max(0,Number(be.attempts||0));let G=Math.max(0,Number(be.delay||0));const _e=Math.max(1,Number(be.factor||2));let r=null,Se=null,ke=null,Me=null;try{for(let dt=0;dt<=X;dt++){r=null,Se=null;const{signal:rt,cancel:De}=As(M.timeout,T.signal),Ie={...M,signal:rt},$e=Ns();try{go.debug&&console.log("[http.request]",Ie.method,Ie.url),(Re=ne.perf)==null||Re.inc("httpRequests"),(Ye=ne.perf)==null||Ye.mark("http:req",{url:M.url,method:M.method});const ct=await po(Ie);Se=ct;const at=await Ms(Pn.afterResponse,ct,Ie),xt=Ns()-$e;if((pt=ne.perf)==null||pt.tick("http:res",xt,{status:ct.status,url:M.url}),dt<X&&xs(null,at)){De(),await qn(G),G=Math.round(G*_e);continue}return De(),ke=at,mo(at,Ie)}catch(ct){r=ct,De();for(const at of Pn.onError)try{at(ct,Ie)}catch(xt){}if(dt<X&&xs(ct,null)){await qn(G),G=Math.round(G*_e);continue}throw Me=ct,ct}}}finally{const dt=Ns()-j;Js.markEnd(B,ke,Me,dt)}if(r)throw r;return mo(Se,M)}ne.http={},ne.http.request=wn,ne.http.state=()=>Js.state,ne.http.get=(a,T)=>wn(a,{...T,method:"GET"}),ne.http.del=(a,T)=>wn(a,{...T,method:"DELETE"}),ne.http.post=(a,T,M)=>ns(wn,"POST",a,T,M),ne.http.put=(a,T,M)=>ns(wn,"PUT",a,T,M),ne.http.patch=(a,T,M)=>ns(wn,"PATCH",a,T,M),ne.http.getJSON=async(a,T)=>(await wn(a,{...T,method:"GET"})).jsonStrict(),ne.http.delJSON=async(a,T)=>(await wn(a,{...T,method:"DELETE"})).jsonStrict(),ne.http.postJSON=async(a,T,M)=>(await ns(wn,"POST",a,T,M)).jsonStrict(),ne.http.putJSON=async(a,T,M)=>(await ns(wn,"PUT",a,T,M)).jsonStrict(),ne.http.patchJSON=async(a,T,M)=>(await ns(wn,"PATCH",a,T,M)).jsonStrict(),ne.http.onBefore=function(a){return Pn.beforeRequest.add(a),()=>Pn.beforeRequest.delete(a)},ne.http.onAfter=function(a){return Pn.afterResponse.add(a),()=>Pn.afterResponse.delete(a)},ne.http.onError=function(a){return Pn.onError.add(a),()=>Pn.onError.delete(a)},window._http=ne.http,ne.useRouter=function(a){const T=ne.router;return a&&a.onDispose,{navigate:T.navigate,back:()=>history.back(),forward:()=>history.forward(),get current(){return T}}},ne.useRoute=function(a){const[T,M]=ne.reactive.signal(""),[B,j]=ne.reactive.signal({}),[be,X]=ne.reactive.signal({}),[G,_e]=ne.reactive.signal(""),r=ke=>{M(ke.path||""),j(ke.params||{}),X(ke.query||{}),_e(ke.hash||"")},Se=ne.router.subscribe(r);return a&&typeof a.onDispose=="function"&&a.onDispose(Se),{path:T,params:B,query:be,hash:G}},ne._routerShared=(()=>{function a(G){return G?(G.startsWith("/")||(G="/"+G),G.length>1&&G.endsWith("/")&&(G=G.slice(0,-1)),G):"/"}function T(G,_e=""){if(_e&&G.startsWith(_e)){const r=G.slice(_e.length)||"/";return a(r)}return a(G)}function M(G){G=a(G);const _e=[],r=G.replace(/([.+*?=^!${}()[\]|/\\])/g,"\\$1").replace(/\\\/:([A-Za-z0-9_]+)/g,(Se,ke)=>(_e.push(ke),"\\/([^\\/]+)"));return{pattern:G,regex:new RegExp("^"+r+"$"),keys:_e}}function B(G){const _e={};return new URLSearchParams(G||"").forEach((Se,ke)=>{_e[ke]===void 0?_e[ke]=Se:Array.isArray(_e[ke])?_e[ke].push(Se):_e[ke]=[_e[ke],Se]}),_e}function j(G){const _e=[];for(const r of G)if(_e.push({...r,_parent:null}),r.children&&r.children.length)for(const Se of r.children)_e.push({...Se,_parent:r});return _e.sort((r,Se)=>Se.path.length-r.path.length),_e}function be(G,_e){const r=a(G),Se=j(_e);for(const ke of Se){const Me=ke._compiled.regex.exec(r);if(!Me)continue;const Re={};return ke._compiled.keys.forEach((Ye,pt)=>{Re[Ye]=decodeURIComponent(Me[pt+1])}),{route:ke,params:Re,parent:ke._parent||null}}return null}function X(G,_e,r=50){G.push({at:Date.now(),path:_e.path,params:_e.params,query:_e.query,hash:_e.hash}),G.length>r&&G.shift()}return{normalizePath:a,stripBase:T,compilePattern:M,parseQuery:B,flattenRoutes:j,matchRoute:be,pushHistoryEntry:X}})(),ne._uiMetaShared=(()=>{function a(X){return{hasTabPanel:typeof X.TabPanel=="function",Card:typeof X.Card=="function"?X.Card:(...G)=>X.div({class:"cms-doc-card"},...G),Chip:typeof X.Chip=="function"?X.Chip:(G,_e)=>X.span({class:"cms-chip cms-chip-fallback"},_e)}}function T(X){return X?Array.isArray(X)?X.join(" | "):String(X):"\u2014"}function M(X,G,_e){return X.div({class:"cms-doc-meta"},X.div({class:"cms-doc-meta-head"},X.div({class:"cms-doc-meta-name"},G.name),X.div({class:"cms-doc-meta-types"},...G.type?String(G.type).split("|").map(r=>_e({color:"secondary",dense:!0,outline:!0},r)):[X.span("\u2014")])),X.div({class:"cms-doc-meta-grid"},X.div({class:"cms-doc-meta-block"},X.div({class:"cms-doc-meta-label"},"Default"),X.div({class:"cms-doc-meta-value"},G.default==null?"\u2014":String(G.default))),X.div({class:"cms-doc-meta-block"},X.div({class:"cms-doc-meta-label"},"Values"),X.div({class:"cms-doc-meta-value"},T(G.values)))),X.div({class:"cms-doc-meta-block"},X.div({class:"cms-doc-meta-label"},"Description"),X.div({class:"cms-doc-meta-value"},G.description||"\u2014")))}function B(X,G){return X.div({class:"cms-doc-fallback"},G.map(_e=>X.div({class:"cms-doc-fallback-item"},X.h4({class:"cms-doc-fallback-title"},_e.label||_e.name),_e.content)))}function j(X,G){return G?Array.isArray(G)?G.map(_e=>({name:_e.name,wrap:!0,label:_e.name,content:X.div({class:"cms-p-md"},_e.description)})):Object.entries(G).map(([_e,r])=>({name:_e,wrap:!0,label:_e,content:X.div({class:"cms-p-md"},r)})):[]}function be(X,G){return G?Array.isArray(G)?G.map(_e=>({name:_e.name,wrap:!0,label:_e.type,content:_e.description})):Object.entries(G).map(([_e,r])=>({name:_e,wrap:!0,label:_e,content:X.div({class:"cms-doc-meta"},X.div({class:"cms-doc-meta-head"},X.div({class:"cms-doc-meta-name"},_e)),X.div({class:"cms-doc-meta-grid"},X.div({class:"cms-doc-meta-block"},X.div({class:"cms-doc-meta-label"},"Type"),X.div({class:"cms-doc-meta-value"},r.type||"\u2014"))),X.div({class:"cms-doc-meta-block"},X.div({class:"cms-doc-meta-label"},"Description"),X.div({class:"cms-doc-meta-value"},r.description||"\u2014")))})):[]}return{resolveDocComponents:a,renderMetaItem:M,renderTabGroupFallback:B,normalizeEventRows:j,normalizeSlotRows:be}})(),ne.ui=ne.ui||{},ne.ui.meta=ne.ui.meta||{},ne.ui.slot=function(T,M={}){const B=ne.ui,{as:j="node",wrap:be="span",iconProps:X=null,filter:G=!0}=M,_e=Me=>document.createTextNode(String(Me)),r=Me=>_.span(String(Me)),Se=Me=>{if(Me==null||Me===!1)return null;if(typeof Me=="function")return Me;if(Array.isArray(Me))return Me.flatMap(Se).filter(Boolean);if(Me&&typeof Me=="object"&&Me.nodeType)return Me;if(typeof Me=="string"||typeof Me=="number"||typeof Me=="boolean"){const Re=String(Me);return j==="icon"&&B.Icon?B.Icon(Re,{class:"cms-slot-icon",...X||{}}):be==="text"?_e(Re):be==="span"?r(Re):Re}return be==="text"?_e(Me):be==="span"?r(Me):String(Me)},ke=Se(T);return G&&Array.isArray(ke)?ke.filter(Boolean):ke},ne.ui.slots=function(...T){const M=[];for(const B of T){const j=ne.ui.slot(B);j&&(Array.isArray(j)?M.push(...j):M.push(j))}return M},ne.docTable=a=>{var rt;if(!ne.isDev())return _.div();const{resolveDocComponents:T,renderMetaItem:M,renderTabGroupFallback:B,normalizeEventRows:j,normalizeSlotRows:be}=ne._uiMetaShared,X=(rt=ne.ui.meta)==null?void 0:rt[a];if(!X)return _.div({class:"cms-muted"},`Meta non trovata: ${a}`);const{hasTabPanel:G,Card:_e,Chip:r}=T(_),Se={};Object.entries(X.props||{}).forEach(([De,Ie])=>{const $e=Ie.category||"general";Se[$e]||(Se[$e]=[]),Se[$e].push({name:De,...Ie})});const ke=Object.keys(Se).map(De=>{const Ie=Se[De].map($e=>({name:$e.name,wrap:!0,label:$e.name,content:M(_,$e,r)}));return{name:De,wrap:!0,label:De,content:G?_.TabPanel({orientation:"vertical",animated:!0,radius:"0 0 0 var(--cms-r-default)",tabs:Ie}):B(_,Ie)}}),Me=j(_,X.events),Re=be(_,X.slots),Ye=_.rod(null),pt=[];Re.length&&pt.push({name:"Slots",wrap:!0,label:"Slots",content:G?_.TabPanel({animated:!0,radius:"0 0 0 var(--cms-r-default)",orientation:"vertical",tabs:Re}):B(_,Re)}),ke.length&&pt.push(...ke),Me.length&&pt.push({name:"Events",wrap:!0,label:"Events",content:G?_.TabPanel({animated:!0,radius:"0 0 0 var(--cms-r-default)",orientation:"vertical",tabs:Me}):B(_,Me)});const dt="general";return pt.sort((De,Ie)=>De.name===dt?-1:Ie.name===dt?1:De.name.localeCompare(Ie.name)),_e({class:"cms-doc-table"},_.div({class:"cms-doc-table-header"},_.div({class:"cms-doc-table-title"},`_.${a}`),X.signature?_.div({class:"cms-doc-table-signature"},String(X.signature).replaceAll("UI.","_.")):null),pt.length?_.h4({class:"cms-doc-table-section-title"},ke.length?"Props":"Documentation"):_.p({class:"cms-muted"},"Nessuna documentazione strutturata disponibile."),pt.length?G?_.TabPanel({border:!0,animated:!0,orientation:"horizontal",tabs:pt,model:Ye}):B(_,pt):null,X.returns?_.p({class:"cms-muted",style:{marginTop:"14px"}},`Returns: ${X.returns}`):null)},ne.ui.inspect=a=>{var T;return console.log(((T=ne.ui.meta)==null?void 0:T[a])||"meta not found")},ne.ui.can=function(a,T,M,B=null){var X,G;const j=ne.useAuth?ne.useAuth(a):ne.auth;return j?(typeof T=="function"?!!T(j):((X=j.can)==null?void 0:X.call(j,T))||((G=j.hasRole)==null?void 0:G.call(j,T)))?typeof M=="function"?M():M:typeof B=="function"?B():B:typeof B=="function"?B():null},ne.ui.canAny=function(a,T,M,B=null){var X;const j=ne.useAuth?ne.useAuth(a):ne.auth;return!!((X=j==null?void 0:j.canAny)!=null&&X.call(j,T))?typeof M=="function"?M():M:typeof B=="function"?B():B},ne.ui.canAll=function(a,T,M,B=null){var X;const j=ne.useAuth?ne.useAuth(a):ne.auth;return!!((X=j==null?void 0:j.canAll)!=null&&X.call(j,T))?typeof M=="function"?M():M:typeof B=="function"?B():B},ne.Can=function(T,M){var be,X;const B=ne.useAuth?ne.useAuth(M):ne.auth;return(()=>{var G,_e,r,Se;return B?T.when&&typeof T.when=="function"?!!T.when(B):T.perm?!!((G=B.can)!=null&&G.call(B,T.perm)):T.role?!!((_e=B.hasRole)!=null&&_e.call(B,T.role)):T.any?!!((r=B.canAny)!=null&&r.call(B,T.any)):T.all?!!((Se=B.canAll)!=null&&Se.call(B,T.all)):!1:!1})()?typeof T.then=="function"?T.then():(be=T.then)!=null?be:null:typeof T.else=="function"?T.else():(X=T.else)!=null?X:null},ne.router=(()=>{let a="history",T=[],M=null,B=null,j="",be=null,X=null,G=[],_e=!1;const{normalizePath:r,stripBase:Se,compilePattern:ke,parseQuery:Me,matchRoute:Re,pushHistoryEntry:Ye}=ne._routerShared,pt={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 dt(lt,{replace:wt=!1}={}){const tt=typeof lt=="string"?new URL(lt,window.location.origin):lt,Ot=tt.pathname+tt.search+tt.hash;if(a==="hash"||a==="auto"){if(history.pushState){const sn="#"+Ot;wt?history.replaceState({},"",sn):history.pushState({},"",sn);return}const en="#"+Ot;wt?window.location.replace(en):window.location.hash=en;return}wt?history.replaceState({},"",j+Ot):history.pushState({},"",j+Ot)}function rt(){if(a==="hash"){const lt=window.location.hash||"#/",wt=lt.startsWith("#")?lt.slice(1):lt;return new URL(wt,window.location.origin)}if(a==="auto"&&window.location.hash.startsWith("#/")){const lt=window.location.hash.slice(1);return new URL(lt,window.location.origin)}return new URL(window.location.href)}function De(lt,wt=!1){if(a==="hash"||a==="auto"&&!history.pushState){const tt="#"+(lt.pathname+lt.search+lt.hash);wt?window.location.replace(tt):window.location.hash=tt;return}wt?history.replaceState({},"",j+lt.pathname+lt.search+lt.hash):history.pushState({},"",j+lt.pathname+lt.search+lt.hash)}function Ie(lt){a=lt||"history"}function $e(lt){return Se(lt,j)}function ct(lt){if(!lt)return!1;const wt=X?X.path:$e(rt().pathname);let tt=lt;typeof tt=="string"&&(tt.includes("?")||tt.includes("#")||tt.includes("://"))&&(tt=new URL(tt,window.location.origin).pathname);const Ot=$e(tt);return Ot.includes(":")?ke(Ot).regex.test(wt):Ot===wt}async function at(lt,{replace:wt=!1}={}){if(!M){console.warn("[router] outlet non impostato. Usa JSswift.router.setOutlet('#app').");return}const tt=typeof lt=="string"?new URL(lt,window.location.origin):lt;_e&&console.log("[router.navigate]",tt.toString());const Ot=tt.pathname+tt.search+tt.hash;De(tt,wt);const en=$e(tt.pathname),sn=Re(en,T),Bt={path:en,fullPath:Ot,params:sn?sn.params:{},query:Me(tt.search),hash:tt.hash||"",navigate:xt,outlet:M};if(be){const Gt=await be(Bt);if(Gt===!1)return;if(typeof Gt=="string"){xt(Gt,{replace:!0});return}}if(typeof B=="function"){try{B()}catch(Gt){console.error("[router] unmount error:",Gt)}B=null}if(!sn){const Gt=T._notFound;Gt?B=ne.mount(M,()=>Gt(Bt),{clear:!0}):B=ne.mount(M,_.div("404"),{clear:!0}),Qe(Bt),X=Bt,Ye(G,Bt);return}const kn=sn.route.view,Rn=sn.parent;let Vn=null;if(Bt.renderChild=Gt=>{if(!Bt._child)return null;const rn=typeof Gt=="string"?Bt.outlet.querySelector(Gt):Gt;return rn?(Vn=ne.mount(rn,()=>Bt._child.view(Bt._child.ctx),{clear:!0}),Vn):(console.warn("[router] child outlet non trovato:",Gt),null)},Rn){const Gt=sn.route,rn={...Bt,params:{...Bt.params}};Bt._child={view:Gt.view,ctx:rn},B=ne.mount(M,()=>Rn.view(Bt),{clear:!0})}else Bt._child=null,B=ne.mount(M,()=>kn(Bt),{clear:!0});Qe(Bt),X=Bt,Ye(G,Bt)}function xt(lt,wt={}){const tt=new URL(lt,window.location.origin);at(tt,wt)}function Nt(){window.addEventListener("popstate",()=>{at(rt(),{replace:!0})}),window.addEventListener("hashchange",()=>{(a==="hash"||a==="auto")&&at(rt(),{replace:!0})}),document.addEventListener("click",lt=>{var Bt,kn;const wt=(kn=(Bt=lt.target)==null?void 0:Bt.closest)==null?void 0:kn.call(Bt,"a");if(!wt||lt.defaultPrevented||lt.button!==0||lt.metaKey||lt.ctrlKey||lt.shiftKey||lt.altKey||wt.hasAttribute("download")||wt.target&&wt.target!=="_self")return;const tt=wt.getAttribute("href");if(!tt||tt.startsWith("mailto:")||tt.startsWith("tel:"))return;const Ot=new URL(tt,window.location.origin);if(Ot.origin!==window.location.origin)return;const en=new URL(window.location.href);Ot.pathname+Ot.search===en.pathname+en.search&&Ot.hash||(lt.preventDefault(),xt(Ot.pathname+Ot.search+Ot.hash))}),at(rt(),{replace:!0})}function Wt(lt){return M=typeof lt=="string"?ne.dom.q(lt):lt,M}function vt(lt){j=lt?r(lt):"",j==="/"&&(j="")}function At(lt,wt,tt=null){const Ot=ke(lt),en={path:Ot.pattern,view:wt,_compiled:Ot,children:[]};if(Array.isArray(tt))for(const sn of tt){const[Bt,kn,Rn]=sn,Vn=r(Ot.pattern+"/"+(Bt||"").replace(/^\//,""));en.children.push({path:Vn,view:kn,_compiled:ke(Vn),children:Array.isArray(Rn)?Rn:[]})}T.push(en)}function kt(lt){T._notFound=lt}function _t(lt){be=lt}let Ve=new Set;function Qe(lt){for(const wt of Ve)try{wt(lt)}catch(tt){console.error("[router] listener error:",tt)}}function Ct(){if(!X)return"ROUTER \u23F3 not ready";const lt=Object.keys(X.query||{}).length?"?":"";return`ROUTER ${X.path}${lt} ${X.hash||""}`}function It(lt="router"){if(!X)return console.warn("[router.inspect] nessuna route attiva"),null;const wt={label:lt,mode:typeof a!="undefined"?a:"unknown",base:j,path:X.path,params:X.params,query:X.query,hash:X.hash,outlet:M,timestamp:new Date().toISOString()};return console.groupCollapsed(`[JSswift.router.inspect] ${lt}`),console.log(wt),console.log("history:",G.slice()),console.groupEnd(),wt}function Pt(lt=!0){_e=!!lt,console.log("[JSswift.router.trace]",_e?"ON":"OFF")}function bt(){return G.slice()}return{meta:pt,setOutlet:Wt,setBase:vt,add:At,setURLOnly:dt,notFound:kt,beforeEach:_t,start:Nt,navigate:xt,isActive:ct,subscribe(lt){return Ve.add(lt),()=>Ve.delete(lt)},current(){return rt?rt():new URL(window.location.href)},status:Ct,inspect:It,trace:Pt,history:bt}})(),(Us=ne.config)!=null&&Us.debug&&(window.$router=ne.router),ne.signal=ne.reactive.signal,ne.effect=ne.reactive.effect,ne.computed=ne.reactive.computed,ne.untracked=ne.reactive.untracked,ne.batch=ne.reactive.batch;function ss(a){return a==null?null:String(a).trim()||null}function xn(a){const T=Array.isArray(a)?a:typeof a=="string"?a.split(","):[],M=[],B=new Set;for(const j of T){const be=ss(j);!be||B.has(be)||(B.add(be),M.push(be))}return M}function Os(){var a;return typeof document!="undefined"&&document.documentElement?document.documentElement:(a=ne.dom)!=null&&a.q?ne.dom.q("html"):null}function v(){try{return typeof globalThis!="undefined"&&globalThis.localStorage||null}catch(a){return null}}function ks(){var a;return ss((a=ne.theme)==null?void 0:a.storageKey)||"jsswift:theme"}function ho(){const a=v();if(!a)return null;try{return ss(a.getItem(ks()))}catch(T){return null}}function bo(a){const T=v();if(T)try{a==null?T.removeItem(ks()):T.setItem(ks(),a)}catch(M){}}function gn(a){var B,j,be,X,G;const T=Os(),M=[a,(B=ne.theme)==null?void 0:B.themes,(j=ne.config)==null?void 0:j.themes,typeof globalThis!="undefined"?(be=globalThis.JSswift_setting)==null?void 0:be.themes:null,typeof globalThis!="undefined"?(X=globalThis.JSswift_setting)==null?void 0:X.themeList:null,(G=T==null?void 0:T.getAttribute)==null?void 0:G.call(T,"data-themes")];for(const _e of M){const r=xn(_e);if(r.length)return r}return[]}ne.theme=ne.theme||{},ne.theme.storageKey=ks(),xn(ne.theme.themes).length||(ne.theme.themes=gn()),ne.setTheme=function(a,T={}){const M=ss(a),B=Os();return B&&(M==null?B.removeAttribute("data-theme"):B.setAttribute("data-theme",M)),T.persist!==!1&&bo(M),B},ne.getTheme=function(a={}){var j;const T=Os(),M=ss((j=T==null?void 0:T.getAttribute)==null?void 0:j.call(T,"data-theme"));if(M)return M;if(a.storage===!1)return null;const B=ho();return B&&T&&a.sync!==!1&&T.setAttribute("data-theme",B),B},ne.toggleTheme=function(a,T={}){const M=gn(a),B=M.length?M:xn([ne.getTheme({sync:!1}),"light","dark"]),j=ne.getTheme({sync:!1}),be=ss(T.fallback)||B[0]||"light",X=j?B.indexOf(j):-1,G=X>=0?B[(X+1)%B.length]:be;return ne.theme.themes=B.slice(),ne.setTheme(G,T),G};const Ds=ho();Ds&&ne.setTheme(Ds,{persist:!1})})(),(function(mt){var yi,wi,vi,Si,Ci,xi,Ai,Ni,ki,_i,Fi,Li,Ii,Ei,Ti,Pi,Ri,zi,Mi,Ji,Oi,Di,ji,Hi,Vi,Bi,$i,Ui,Wi,Gi,Ki,qi,Yi,Xi,Qi,Zi,er,tr,nr,sr,or,ir,rr,ar,lr,cr,ur,dr,fr,mr,gr,pr,hr,br,yr,wr,vr,Sr,Cr,xr;mt.ui=mt.ui||{},mt.services=mt.services||{},mt.services.notify=mt.services.notify||{};const ws=Symbol("cms.ui.rodPathRaw"),Gn=Symbol("cms.ui.rodPathEnhanced"),vs=Symbol("cms.ui.rodPathPatchedH"),ls=Symbol("cms.ui.rodPathWrappedUI"),cs=new WeakMap,Ps=new WeakMap,to=new WeakMap,Cn=[],Dn=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},Rs=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"},Kn=t=>{if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};let us=!1;const no=()=>{us||(us=!0,queueMicrotask(()=>{us=!1,Cn.length=0}))},Po=t=>{Cn.push(t),Cn.length>128&&Cn.splice(0,Cn.length-128),no()},ds=()=>{if(!Cn.length)return null;const t=Cn.slice();return Cn.length=0,{items:t,index:0}},so=(t,e)=>{if(!t)return null;const n=t.items[t.index];return!n||!Object.is(n.value,e)?null:(t.index+=1,n)},Zn=t=>t&&typeof t=="object"&&t[ws]?t[ws]:t,es=(t,e)=>{const n=cs.get(t);if(!n)return;let s=n.rawGet();for(const i of e){if(s==null)return;s=s[i]}return s},Ro=(t,e,n)=>{const s=cs.get(t);if(!s)return;const i=Zn(n);if(!e.length){if(Object.is(s.rawGet(),i))return;s.rawSet(i);return}let d=s.rawGet();(!d||typeof d!="object")&&(d=Dn(e[0])?[]:{});let S=d;for(let u=0;u<e.length-1;u++){const l=e[u];let w=S[l];if(!w||typeof w!="object"){const D=e[u+1];w=Dn(D)?[]:{},S[l]=w}S=w}Object.is(S[e[e.length-1]],i)||(S[e[e.length-1]]=i,s.rawSet(d))},oo=(t,e)=>[()=>es(t,e),n=>Ro(t,e,n)],io=(t,e,n=[])=>{if(!e||typeof e!="object")return e;let s=Ps.get(t);s||(s=new WeakMap,Ps.set(t,s));const i=s.get(e);if(i)return i;const d=new Proxy(e,{get(S,u,l){if(u===ws)return S;const w=Reflect.get(S,u,l);if(typeof u=="symbol")return w;const D=n.concat(u);return w&&typeof w=="object"?io(t,w,D):typeof w=="function"?w.bind(l):(Rs(w)&&Po({rod:t,path:D,value:w}),w)},set(S,u,l,w){const D=Zn(l),A=Reflect.get(S,u,w);if(Object.is(A,D))return!0;const C=Reflect.set(S,u,D,w);if(C){const z=cs.get(t);z==null||z.rawSet(z.rawGet())}return C},deleteProperty(S,u){const l=Reflect.has(S,u),w=Reflect.deleteProperty(S,u);if(w&&l){const D=cs.get(t);D==null||D.rawSet(D.rawGet())}return w}});return s.set(e,d),d},ro=t=>{if(!t||typeof t!="object"||t.type!=="rod"||t[Gn])return t;const e=Object.getOwnPropertyDescriptor(t,"value");if(!e||typeof e.get!="function"||typeof e.set!="function")return t;const n=()=>e.get.call(t),s=i=>e.set.call(t,Zn(i));return cs.set(t,{rawGet:n,rawSet:s}),Object.defineProperty(t,"value",{get(){const i=n();return!i||typeof i!="object"?i:io(t,i,[])},set(i){s(i)},configurable:!0}),Object.defineProperty(t,Gn,{value:!0,configurable:!1}),t},ao=()=>{if(typeof window._.rod!="function"||window._.rod[Gn])return;const t=window._.rod,e=function(...s){return ro(t(...s))};Object.defineProperty(e,Gn,{value:!0,configurable:!1}),window._.rod=e};mt.ui.withoutRodPathCapture=t=>{const e=Cn.length;try{return t()}finally{Cn.length=e}};const zs=(t,e,n="")=>{if(Array.isArray(t)){let d=!1;const S=t.map(u=>{const l=zs(u,e,"");return l!==u&&(d=!0),l});return d?S:t}if(Rs(t)){const d=so(e,t);return d?n==="model"?oo(d.rod,d.path):()=>es(d.rod,d.path):t}if(!Kn(t))return t;let s=!1;const i={};for(const d of Object.keys(t)){const S=zs(t[d],e,d);i[d]=S,S!==t[d]&&(s=!0)}return s?i:t},fs=(t,e,n="")=>{if(Array.isArray(t)){let d=!1;const S=t.map(u=>{const l=fs(u,e,"");return l!==u&&(d=!0),l});return d?S:t}if(Rs(t)){const d=so(e,t);return d?n==="model"?oo(d.rod,d.path):()=>es(d.rod,d.path):t}if(!Kn(t))return t;let s=!1;const i={};for(const d of Object.keys(t)){const u=d==="model"||d==="children"?fs(t[d],e,d):t[d];i[d]=u,u!==t[d]&&(s=!0)}return s?i:t},lo=t=>{if(typeof t!="function"||t[ls])return t;const e=to.get(t);if(e)return e;const n=function(...i){const d=ds();if(!d)return t.apply(this,i);let S=!1;const u=i.map(l=>{const w=fs(l,d,"");return w!==l&&(S=!0),w});return t.apply(this,S?u:i)};return Object.defineProperty(n,ls,{value:!0,configurable:!1}),to.set(t,n),n},Yo=()=>{const t=mt.ui;if(!(!t||t[ls])){Object.defineProperty(t,ls,{value:!0,configurable:!1});for(const e of Object.keys(t))typeof t[e]=="function"&&(t[e]=lo(t[e]));mt.ui=new Proxy(t,{get(e,n,s){return Reflect.get(e,n,s)},set(e,n,s,i){const d=typeof s=="function"?lo(s):s;return Reflect.set(e,n,d,i)}})}},co=()=>{if(!window._||window._[vs])return;Object.defineProperty(window._,vs,{value:!0,configurable:!1});const t=new Set(["rod","rodBind","rodFromSignal"]);for(const e of Object.keys(window._)){if(t.has(e))continue;const n=window._[e];typeof n=="function"&&(window._[e]=function(...i){const d=ds();if(!d)return n.apply(this,i);let S=!1;const u=i.map(l=>{const w=zs(l,d,"");return w!==l&&(S=!0),w});return n.apply(this,S?u:i)})}};ao(),((yi=JSswift.rod)==null?void 0:yi._all)instanceof Set&&JSswift.rod._all.forEach(t=>ro(t)),co(),Yo();const uo={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},Xo=new Set(Object.values(uo)),fo=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),zo=new Set(["none","sm","md","lg"]),ms={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"}},Tn=t=>{if(t.indexOf("-")>-1)return!0},Vt=t=>{if(!t)return"";const e=String(t).toLowerCase();return uo[e]||""},Mo=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":fo.has(e)?e:null},Ss=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return zo.has(e)?e:null},ts=t=>t&&typeof t=="object"&&!t.nodeType&&!Array.isArray(t)&&!(t instanceof Function),Cs=t=>t&&t.nodeType===1&&String(t.tagName||"").toLowerCase()==="li",jn=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];JSswift.isUIPlainObject=ts,JSswift.isListItemNode=Cs,JSswift.asNodeArray=jn;const qn=[{key:"mobile",aliases:["mobile","mobil"],prefix:"cms-"},{key:"tablet",aliases:["tablet"],prefix:"cms-tablet-"},{key:"pc",aliases:["pc","desktop"],prefix:"cms-pc-"}],xs=qn.flatMap(t=>t.aliases),As=(t,e)=>Object.prototype.hasOwnProperty.call(t||{},e),gs=(t={},e)=>{if(!e)return null;for(const n of e.aliases){if(!As(t,n))continue;const s=o(t[n]);if(ts(s))return s}return null},Ms=(t={},e)=>{const n=Array.isArray(e)?e:[e];return qn.some(s=>{const i=gs(t,s);return!!i&&n.some(d=>As(i,d))})},mo=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),ns=(t={},e=[])=>{const n=[];for(const s of qn){const i=gs(t,s);if(i)for(const d of e){const S=Array.isArray(d.prop)?d.prop:[d.prop];let u=!1,l,w="";for(const C of S)if(As(i,C)){l=o(i[C]),w=C,u=!0;break}if(!u||l==null||l===""||l===!1&&!d.allowFalse)continue;const D=typeof d.map=="function"?d.map(l,{propName:w,props:i,device:s,rule:d}):`${d.class}-${mo(l)}`,A=Array.isArray(D)?D:[D];for(const C of A)C&&n.push(String(C).startsWith("cms-")?C:`${s.prefix}${C}`)}}return n},Yn=(t={})=>qn.some(e=>!!gs(t,e)),go=(t={},e=[])=>{for(const n of e){if(!As(t,n))continue;const s=o(t[n]);if(!(s==null||s===""))return s}},Js=(t,e={})=>{var n;return t==null||t===""||t===!1&&!e.allowFalse?"":typeof e.mapValue=="function"?e.mapValue(t,e):typeof t=="number"?e.number==="raw"?String(t):`${t}px`:e.token&&typeof t=="string"&&((n=JSswift.uiSizes)!=null&&n.includes(t))?`var(--cms-${e.token}-${t})`:String(t)},Ns=(t,e,n)=>{!t||n==null||n===""||(typeof t.setProperty=="function"?t.setProperty(e,n):t[e]=n)},Pn=(t,e)=>t==="mobile"?`cms-rsp-${e}`:`cms-rsp-${t}-${e}`,po=(t,e)=>{var n;if(!(!t||!e)){if((n=t.classList)!=null&&n.add){t.classList.add(e);return}t.class=fe([t.class,e])}},wn=(t,e={},n=[])=>{if(!t||!e||!Yn(e))return t;const s=t.style||{};let i=!1;for(const d of n){const S=Array.isArray(d.prop)?d.prop:[d.prop],u=(l,w)=>{const D=go(w,S),A=Js(D,d);if(!A)return;const C=d.var||d.css,z=l==="mobile"?"--cms-rsp-":`--cms-rsp-${l}-`;Ns(s,`${z}${C}`,A),po(t,Pn(l,C)),i=!0};u("mobile",e);for(const l of qn){const w=gs(e,l);w&&u(l.key,w)}}return i&&(t.nodeType||(t.style=s),po(t,"cms-rsp")),t};JSswift.uiResponsiveDevices=qn,JSswift.uiResponsiveOmitProps=xs,JSswift.uiResponsivePropsFor=gs,JSswift.uiResponsiveHasConfig=Yn,JSswift.uiResponsiveHasProp=Ms,JSswift.uiResponsiveClasses=ns,JSswift.uiApplyResponsiveProps=wn;const ss=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(xs):xs;return ss(t,n)};const xn=(t={})=>{var s;const e=[],n={};if(e.push(xe(t.clickable,"cms-clickable"),xe(t.dense,"cms-dense"),xe(t.flat,"cms-flat"),xe(t.border,"cms-border"),xe(t.glossy,"cms-glossy"),xe(t.glow,"cms-glow"),xe(t.glass,"cms-glass"),xe(t.shadow,"cms-shadow"),xe(t.outline,"cms-outline"),xe(t.rounded,"cms-rounded"),xe(t.gradient,"cms-gradient"),xe(t.textGradient,"cms-text-gradient"),xe(t.lightShadow,"cms-light-shadow")),Dt(t.color))e.push(()=>{const i=o(t.color),d=Vt(i);return d?`cms-state-${d}`:""}),n.backgroundColor=()=>{const i=o(t.color);return Vt(i)?"":i&&Tn(String(i))?`var(--cms-${i})`:i||""};else{const i=Vt(t.color);i?e.push(`cms-state-${i}`):t.color&&Tn(t.color)?n.backgroundColor=`var(--cms-${t.color})`:t.color&&(n.backgroundColor=t.color)}if(Dt(t.textColor)?n.color=()=>{const i=o(t.textColor);return i&&Tn(String(i))?`var(--cms-${i})`:i||""}:t.textColor&&Tn(t.textColor)?n.color=`var(--cms-${t.textColor})`:t.textColor&&(n.color=t.textColor),Dt(t.size))e.push(()=>{var d;const i=o(t.size);return typeof i=="string"&&((d=JSswift.uiSizes)!=null&&d.includes(i))?`cms-size-${i}`:""});else{const i=t.size;typeof i=="string"&&((s=JSswift.uiSizes)!=null&&s.includes(i))&&e.push(`cms-size-${i}`)}if(Dt(t.shadow))e.push(()=>{const i=o(t.shadow),d=Ss(i);return d?`cms-shadow-${d}`:""}),n.boxShadow=()=>{const i=o(t.shadow);return Ss(i)||i==null||i===!1?"":typeof i=="string"?i:""};else{const i=Ss(t.shadow);i?e.push(`cms-shadow-${i}`):t.shadow&&typeof t.shadow=="string"&&(n.boxShadow=t.shadow)}e.length&&(t.class=fe([t.class,...e])),Object.keys(n).length&&(t.style={...n,...t.style||{}})},Os=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=Os(t),n=e.props||{};if(n&&Object.prototype.hasOwnProperty.call(n,"children")){const s=n.children;(!e.children||e.children.length===0)&&(e.children=Array.isArray(s)?s:[s]),delete n.children}return xn(n),e};const v=window._,ks={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.",mobile:"Responsive overrides applied at the base/mobile viewport.",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.",pc:"Responsive overrides applied from the desktop breakpoint upward.",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.",shortcode:"Keyboard shortcut string, object, or array bound to the component action.",showShortcode:"Displays the configured keyboard shortcut badge when the component supports it.",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.",tablet:"Responsive overrides applied from the tablet breakpoint upward.",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."},ho={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."},bo={dense:!1,disabled:!1,readonly:!1,outline:!1,clickable:!1,flat:!1,elevated:!1},gn=[...JSswift.uiSizes],Ds=[...JSswift.uiColors],js={size:["number","CSS units",...gn],color:Ds,padding:["number","CSS units",...gn],margin:["number","CSS units",...gn],width:["number","CSS units",...gn],minWidth:["number","CSS units",...gn],maxWidth:["number","CSS units",...gn],height:["number","CSS units",...gn],minHeight:["number","CSS units",...gn],maxHeight:["number","CSS units",...gn],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:Ds,shadow:["none",...gn],outline:["number","CSS units",...gn],borderRadius:["number","CSS units",...gn],radius:["number","CSS units",...gn],icon:["#name_tabler","name_material","class"],iconRight:["#name_tabler","name_material","class"]},Hs={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",mobile:"layout",tablet:"layout",pc:"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"},Vs=t=>typeof t=="string"?t:!t||typeof t!="object"||Array.isArray(t)?"unknown":t.type||t.signature||t.value||"unknown",yo=(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.`,Bs=(t,e,n)=>{var i,d;if(!t||typeof t!="object")return t;const s={};for(const[S,u]of Object.entries(t)){const l=e[S]||yo(S,n);if(u&&typeof u=="object"&&!Array.isArray(u)){const w=Vs(u);s[S]={...u,type:w,description:u.description||l,default:Object.prototype.hasOwnProperty.call(u,"default")?u.default:(i=bo[S])!=null?i:null,values:u.values||js[S]||null,category:u.category||Hs[S]||(n==="slot"?"slot":"general")}}else{const w=Vs(u);s[S]={type:w,description:l,default:(d=bo[S])!=null?d:null,values:js[S]||null,category:Hs[S]||(n==="slot"?"slot":"general")}}}return s},$s=(t,e)=>{var s;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 n={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",mobile:e.props.mobile||"object",tablet:e.props.tablet||"object",pc:e.props.pc||"object",class:e.props.class||"string",style:e.props.style||"object"};return e.props={...n,...e.props},e.props.icon&&!e.props.iconRight&&(e.props.iconRight=e.props.icon),e.props&&(e.props=Bs(e.props,ks,"prop")),e.slots&&(e.slots=Bs(e.slots,ho,"slot")),e.slots&&e.slots.icon&&!e.slots.iconRight&&(e.slots.iconRight={type:((s=e.slots.icon)==null?void 0:s.type)||"Node|Array|Function",description:"Slot for right-aligned icon content."}),e.description||(e.description=`${t} component meta definition.`),e},wo=()=>{if(mt.ui._metaProxyInstalled)return;mt.ui._metaProxyInstalled=!0;const t=mt.ui.meta||{};for(const n of Object.keys(t))$s(n,t[n]);const e=new Proxy(t,{set(n,s,i){return typeof s=="symbol"?(n[s]=i,!0):(n[s]=$s(s,i),!0)}});mt.ui.meta=e,v.meta=e};(wi=mt.isDev)!=null&&wi.call(mt)&&wo();function Hn(t){if(!t)return null;if(!Array.isArray(t))return t;const e=[],n=t.slice();for(;n.length;){const s=n.shift();s&&(Array.isArray(s)?n.unshift(...s):e.push(s))}return e.length?e:null}const Us={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"},a=t=>t===!0?"wrap":t===!1?"nowrap":String(t),T=t=>typeof t=="number"?`repeat(${Math.max(1,Math.round(t))}, minmax(0, 1fr))`:String(t),B=[{prop:"display",css:"display",var:"display"},{prop:"direction",css:"flex-direction",var:"flex-direction"},{prop:"wrap",css:"flex-wrap",var:"flex-wrap",allowFalse:!0,mapValue:a},{prop:"align",css:"align-items",var:"align-items"},{prop:"justify",css:"justify-content",var:"justify-content"},{prop:"self",css:"align-self",var:"align-self"},{prop:"justifySelf",css:"justify-self",var:"justify-self"},{prop:"place",css:"place-items",var:"place-items"},{prop:"placeSelf",css:"place-self",var:"place-self"},{prop:["cols","columns"],css:"grid-template-columns",var:"grid-template-columns",mapValue:T},{prop:"rows",css:"grid-template-rows",var:"grid-template-rows",mapValue:T},{prop:"flow",css:"grid-auto-flow",var:"grid-auto-flow",mapValue:t=>String(t).trim().toLowerCase().replace("-"," ")},{prop:"autoRows",css:"grid-auto-rows",var:"grid-auto-rows"},{prop:["span","gridColumn"],css:"grid-column",var:"grid-column",number:"raw"},{prop:["row","rowSpan"],css:"grid-row",var:"grid-row",number:"raw"},{prop:"area",css:"grid-area",var:"grid-area"},{prop:"gap",css:"gap",var:"gap",token:"gap"},{prop:"rowGap",css:"row-gap",var:"row-gap",token:"gap"},{prop:["columnGap","colGap"],css:"column-gap",var:"column-gap",token:"gap"},{prop:"width",css:"width",var:"width",token:"w"},{prop:"minWidth",css:"min-width",var:"min-width",token:"min-w"},{prop:"maxWidth",css:"max-width",var:"max-width",token:"max-w"},{prop:"height",css:"height",var:"height",token:"h"},{prop:"minHeight",css:"min-height",var:"min-height",token:"min-h"},{prop:"maxHeight",css:"max-height",var:"max-height",token:"max-h"},{prop:"padding",css:"padding",var:"padding",token:"p"},{prop:"paddingLeft",css:"padding-left",var:"padding-left",token:"p"},{prop:"paddingRight",css:"padding-right",var:"padding-right",token:"p"},{prop:"paddingTop",css:"padding-top",var:"padding-top",token:"p"},{prop:"paddingBottom",css:"padding-bottom",var:"padding-bottom",token:"p"},{prop:"margin",css:"margin",var:"margin",token:"m"},{prop:"marginLeft",css:"margin-left",var:"margin-left",token:"m"},{prop:"marginRight",css:"margin-right",var:"margin-right",token:"m"},{prop:"marginTop",css:"margin-top",var:"margin-top",token:"m"},{prop:"marginBottom",css:"margin-bottom",var:"margin-bottom",token:"m"},{prop:"fontSize",css:"font-size",var:"font-size",token:"f"},{prop:"fontWeight",css:"font-weight",var:"font-weight",token:"fw",number:"raw"},{prop:"lineHeight",css:"line-height",var:"line-height",token:"lh",number:"raw"},{prop:"letterSpacing",css:"letter-spacing",var:"letter-spacing",token:"ls"},{prop:["borderRadius","radius"],css:"border-radius",var:"border-radius",token:"r"},{prop:"overflow",css:"overflow",var:"overflow"},{prop:"order",css:"order",var:"order",number:"raw"}],j=B.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return e.some(n=>Object.prototype.hasOwnProperty.call(Us,n))||e.includes("fontSize")||e.includes("fontWeight")||e.includes("lineHeight")||e.includes("letterSpacing")||e.includes("borderRadius")||e.includes("radius")});JSswift.uiResponsiveStyleRules=B,JSswift.uiResponsiveCommonStyleRules=j;const be=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),X=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(be(n),Qe(e,s))};function G(t,e){e.size&&(typeof e.size=="number"?t.style.setProperty("--cms-font-size",`${e.size}px`):JSswift.uiSizes.includes(e.size)&&t.style.setProperty("--cms-font-size",`var(--cms-font-size-${e.size})`)),Object.entries(Us).forEach(([n,s])=>{Ms(e,n)||X(t,e[n],n,s)}),wn(t,e,j),e.gradient&&typeof e.gradient=="number"&&t.style.setProperty("--set-gradient-deg",`${e.gradient}deg`),e.radius&&(typeof e.radius=="number"?t.style.setProperty("--set-border-radius",`${e.radius}px`):JSswift.uiSizes.includes(e.radius)?t.style.setProperty("--set-border-radius",`var(--cms-r-${e.radius})`):t.style.setProperty("--set-border-radius",`${e.radius}`))}function _e(t={},...e){const n=document.createElement("option");t&&typeof t=="object"&&(t.value!=null&&(n.value=String(t.value)),t.label!=null&&(n.label=String(t.label)),t.disabled!=null&&(n.disabled=!!t.disabled),t.selected!=null&&(n.selected=!!t.selected),t.class!=null&&(n.className=String(t.class)));const s=e.flat?e.flat(1/0):e;return s.length?s.forEach(i=>{i==null||i===!1||(i instanceof Node?n.appendChild(i):n.appendChild(document.createTextNode(String(i))))}):t&&t.text!=null&&(n.textContent=String(t.text)),n}JSswift.ui.getSlot=(t,e)=>t&&Object.prototype.hasOwnProperty.call(t,e)?t[e]:null,JSswift.ui.renderSlot=(t,e,n,s)=>{const i=JSswift.ui.getSlot(t,e),S=i!=null?typeof i=="function"?i(n||{}):i:s;return S==null?null:Hn(JSswift.ui.slot(S))};const r=(t,e,n,s)=>{const i=JSswift.ui.renderSlot(t,e,n,s);return i?Array.isArray(i)?i:[i]:[]},Se=new Set;let ke=!1;const Me=new Set(["ctrl","alt","shift","meta"]),Re={control:"ctrl",ctl:"ctrl",option:"alt",opt:"alt",command:"meta",cmd:"meta","\u2318":"meta","\u2303":"ctrl","\u2325":"alt","\u21E7":"shift",esc:"escape",return:"enter",plus:"+",spacebar:"space",up:"arrowup",down:"arrowdown",left:"arrowleft",right:"arrowright",del:"delete"},Ye={ctrl:"Ctrl",alt:"Alt",shift:"Shift",meta:"Meta",escape:"Esc",enter:"Enter",tab:"Tab",space:"Space",backspace:"Backspace",delete:"Del",arrowup:"Up",arrowdown:"Down",arrowleft:"Left",arrowright:"Right",pageup:"PgUp",pagedown:"PgDn"},pt=()=>{if(typeof navigator=="undefined")return!1;const t=String(navigator.platform||navigator.userAgent||"");return/(mac|iphone|ipad|ipod)/i.test(t)},dt=t=>{if(t==null)return"";const e=String(t).trim().toLowerCase();return e?Re[e]||e:""},rt=t=>{if(t==null||t===!1)return null;const e=String(t).trim();if(!e)return null;const n=e.split("+").map(dt).filter(Boolean);if(!n.length)return null;const s={raw:e,key:"",ctrl:!1,alt:!1,shift:!1,meta:!1};return n.forEach(i=>{if(i==="mod"){pt()?s.meta=!0:s.ctrl=!0;return}if(Me.has(i)){s[i]=!0;return}s.key=i}),s.key?s:null},De=t=>t==null||t===!1?[]:(Array.isArray(t)?t:[t]).map(n=>{var i,d,S;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const u=rt((S=(d=(i=n.shortcode)!=null?i:n.shortcut)!=null?d:n.keys)!=null?S:n.key);return u?{...n,...u}:null}const s=rt(n);return s?{...s}:null}).filter(Boolean),Ie=(t={})=>{var e,n,s;return De((s=(n=(e=t.shortcode)!=null?e:t.shortcut)!=null?n:t.hotkey)!=null?s:t.keys)},$e=(t={})=>t.showShortcode===!0||t.showShortcut===!0,ct=t=>{const e=dt(t);if(!e)return"";const n={...Ye};return pt()&&(n.alt="Option",n.meta="Cmd"),n[e]?n[e]:e.length===1?e.toUpperCase():e.replace(/(^|[-_ ])(\w)/g,(s,i,d)=>`${i}${d.toUpperCase()}`)},at=t=>{if(!t)return"";const e=[];return t.ctrl&&e.push(ct("ctrl")),t.alt&&e.push(ct("alt")),t.shift&&e.push(ct("shift")),t.meta&&e.push(ct("meta")),e.push(ct(t.key)),e.filter(Boolean).join("+")},xt=t=>(Array.isArray(t)?t:[]).map(at).filter(Boolean).join(" / "),Nt=(t={},e={})=>{const n=Ie(t);if(!$e(t)||!n.length||typeof document=="undefined")return null;const s=document.createElement("span");return s.className=e.className||"cms-shortcode",s.setAttribute("aria-hidden","true"),s.textContent=xt(n),s},Wt=t=>{const e=(t==null?void 0:t.nodeType)===1?t:t==null?void 0:t.parentElement;if(!e||typeof e.closest!="function")return!1;if(e.isContentEditable)return!0;const n=e.closest("input, textarea, select, [contenteditable], [contenteditable='true'], [contenteditable='plaintext-only']");return!(!n||"disabled"in n&&n.disabled)},vt=(t,e)=>!t||!e||!!t.ctrlKey!=!!e.ctrl||!!t.altKey!=!!e.alt||!!t.shiftKey!=!!e.shift||!!t.metaKey!=!!e.meta?!1:dt(t.key)===e.key,At=()=>{Se.size||!ke||typeof document=="undefined"||(document.removeEventListener("keydown",kt,!0),ke=!1)};function kt(t){var s,i,d,S,u,l;if(!Se.size||!t||t.defaultPrevented||t.isComposing)return;const e=Wt(t.target),n=Array.from(Se);for(let w=n.length-1;w>=0;w-=1){const D=n[w],A=D==null?void 0:D.anchor;if(!A||!A.isConnected){Se.delete(D);continue}if(((s=D.isEnabled)==null?void 0:s.call(D))===!1)continue;const C=D.specs.find(he=>{var W,oe;const U=(oe=(W=he.allowInEditable)!=null?W:D.allowInEditable)!=null?oe:!1;return e&&!U?!1:vt(t,he)});if(!C)continue;const z=(d=(i=C.preventDefault)!=null?i:D.preventDefault)!=null?d:!0,le=(u=(S=C.stopPropagation)!=null?S:D.stopPropagation)!=null?u:!0;if(z&&t.preventDefault(),le&&t.stopPropagation(),((l=D.action)==null?void 0:l.call(D,t,C,A))!==!1)break}At()}const _t=(t,e={},n={})=>{var S,u;const s=Ie(e);if(!t||!s.length||typeof document=="undefined")return null;const i={anchor:t,specs:s,action:typeof n.action=="function"?n.action:()=>{var l;return(l=t.click)==null?void 0:l.call(t)},isEnabled:typeof n.isEnabled=="function"?n.isEnabled:null,allowInEditable:!!n.allowInEditable,preventDefault:(S=n.preventDefault)!=null?S:!0,stopPropagation:(u=n.stopPropagation)!=null?u:!0};Se.add(i),ke||(document.addEventListener("keydown",kt,!0),ke=!0);const d=()=>{Se.delete(i),At()};return JSswift._registerCleanup(t,d),d},Ve=(t,e={})=>{var n;if(!t||typeof t.focus!="function")return!1;try{t.focus({preventScroll:(n=e.preventScroll)!=null?n:!0})}catch(s){t.focus()}if(e.selectText&&typeof t.select=="function")try{t.select()}catch(s){}return!0},Qe=(t,e="size")=>typeof t=="number"?t+"px":JSswift.uiSizes.includes(t)?`var(--cms-${e}-${t})`:t,Ct=(t,e=JSswift.uiSizes)=>n=>{const s=String(n).trim();return e!=null&&e.includes(s)?`${t}-${s}`:""},It=t=>e=>`${t}-${String(e).trim().toLowerCase().replace(/\s+/g,"-")}`,Pt=t=>{if(t===!0)return"wrap-wrap";if(t===!1)return"wrap-nowrap";const e=String(t).trim().toLowerCase();return e==="false"||e==="no"||e==="none"?"wrap-nowrap":e==="reverse"?"wrap-reverse":`wrap-${e}`},bt=(t,e,n)=>t?e:n,lt=t=>{const e=o(t);if(e==null||e==="")return"";if(e==="auto")return"col-auto";if(e===!0)return"col-24";const n=Number(e);if(Number.isFinite(n)&&n>0)return`col-${Math.max(1,Math.min(24,Math.round(n)))}`;if(typeof e=="string"){const s=e.trim();if(/^\d+$/.test(s))return`col-${Math.max(1,Math.min(24,Number(s)))}`}return""},wt=t=>{const e=Number(t);return Number.isFinite(e)&&e>0?`grid-cols-${Math.max(1,Math.min(24,Math.round(e)))}`:""},tt=(t,e)=>{const n=Array.isArray(e)?e:[e];return JSswift.uiResponsiveDevices.some(s=>{const i=JSswift.uiResponsivePropsFor(t,s);return!!i&&n.some(d=>Object.prototype.hasOwnProperty.call(i,d))})},Ot=t=>JSswift.uiResponsiveDevices.find(e=>e.key===t),en=[{prop:"gap",class:"gap",map:Ct("gap")},{prop:"rowGap",class:"gap-y",map:Ct("gap-y")},{prop:["columnGap","colGap"],class:"gap-x",map:Ct("gap-x")},{prop:"direction",class:"dir",map:It("dir")},{prop:"wrap",class:"wrap",allowFalse:!0,map:Pt},{prop:"align",class:"align",map:It("align")},{prop:"justify",class:"justify",map:It("justify")},{prop:"width",class:"w",map:Ct("w")},{prop:"minWidth",class:"min-w",map:Ct("min-w")},{prop:"maxWidth",class:"max-w",map:Ct("max-w")},{prop:"height",class:"h",map:Ct("h")},{prop:"minHeight",class:"min-h",map:Ct("min-h")},{prop:"maxHeight",class:"max-h",map:Ct("max-h")},{prop:"padding",class:"p",map:Ct("p")},{prop:"margin",class:"m",map:Ct("m")}],sn=en.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("align")&&!e.includes("justify")}),Bt=[{prop:["col","span"],class:"col",map:lt},{prop:"auto",class:"col",map:t=>t?"col-auto":""},{prop:"inline",class:"display",allowFalse:!0,map:t=>bt(t,"display-inline-flex","display-flex")},{prop:"self",class:"self",map:It("self")},...en],kn=[{prop:["cols","columns"],class:"grid-cols",map:wt},{prop:"inline",class:"display",allowFalse:!0,map:t=>bt(t,"display-inline-grid","display-grid")},{prop:"flow",class:"grid-flow",map:t=>`grid-flow-${String(t).trim().toLowerCase().replace(/\s+/g,"-")}`},...en],Rn=[{prop:"inline",class:"display",allowFalse:!0,map:t=>bt(t,"display-inline-flex","display-flex")},{prop:"direction",class:"dir",map:It("dir")},{prop:"contentAlign",class:"align",map:It("align")},{prop:"contentJustify",class:"justify",map:It("justify")},{prop:"align",class:"self",map:It("self")},{prop:"justify",class:"justify-self",map:It("justify-self")},{prop:"place",class:"place-self",map:It("place-self")},...sn],Vn=(JSswift.uiResponsiveStyleRules||[]).filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("span")&&!e.includes("gridColumn")});v.Row=(...t)=>{var g,p,h,V,re;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(c,N,b={})=>{const J=Array.isArray(c)?c:[c];for(const Q of J)if(JSswift.ui.getSlot(s,Q)!=null)return r(s,Q,b,N);return N==null?[]:r(null,"default",b,N)},d=c=>{var N;return c==null||c===!1||c===""?"":typeof c=="number"?`${c}px`:typeof c=="string"&&((N=JSswift.uiSizes)!=null&&N.includes(c))?`var(--cms-s-${c})`:String(c)},S=c=>{var N;return c==null||c===!1||c===""?"":typeof c=="number"?`${c}px`:typeof c=="string"&&((N=JSswift.uiSizes)!=null&&N.includes(c))?`var(--cms-w-${c})`:String(c)},u=JSswift.omit(e,["slots","start","left","startClass","body","center","bodyClass","centerClass","end","right","endClass","align","justify","wrap","gap","rowGap","columnGap","direction","reverse","inline","full","width","minWidth","maxWidth",...JSswift.uiResponsiveOmitProps]);u.class=fe(["cms-row",JSswift.uiResponsiveClasses({mobile:e},en),JSswift.uiResponsiveClasses(e,en),e.class]);const l={...e.style||{}},w=Et([e.direction,e.reverse],()=>{const c=o(e.direction);return c!=null&&c!==""?String(c):o(e.reverse)?"row-reverse":""}),D=Ke(e.align),A=Ke(e.justify),C=Ke(e.wrap,c=>typeof c=="boolean"?c?"wrap":"nowrap":String(c)),z=Ke(e.gap,d),le=Ke(e.rowGap,d),te=Ke(e.columnGap,d),he=Ke(e.inline,c=>c?"inline-flex":"flex"),U=Ke(e.width,S),W=Ke(e.minWidth,S),oe=Ke(e.maxWidth,S),Z=Ke(e.full,c=>c?"100%":"",""),ge=Et([e.inline,e.full,e.width],()=>{const c=!!o(e.inline),N=!!o(e.full),b=o(e.width)!=null&&o(e.width)!==!1&&o(e.width)!=="";return!c||N||b?"":"max-content"});w!=null&&!tt(e,"direction")&&(l.flexDirection=w),D!=null&&!tt(e,"align")&&(l.alignItems=D),A!=null&&!tt(e,"justify")&&(l.justifyContent=A),C!=null&&!tt(e,"wrap")&&(l.flexWrap=C),z!=null&&!tt(e,"gap")&&(l.gap=z),le!=null&&!tt(e,"rowGap")&&(l.rowGap=le),te!=null&&!tt(e,"columnGap")&&(l.columnGap=te),he!=null&&(l.display=he),ge!=null&&(l.width=ge),U!=null&&!tt(e,"width")&&(l.width=U),W!=null&&!tt(e,"minWidth")&&(l.minWidth=W),oe!=null&&!tt(e,"maxWidth")&&(l.maxWidth=oe),Z!=null&&(l.width=Z),Object.keys(l).length&&(u.style=l),JSswift.uiApplyResponsiveProps(u,e,JSswift.uiResponsiveStyleRules);const Ae={props:e},ye=i(["start","left"],(g=e.start)!=null?g:e.left,Ae),pe=i(["body","center","default"],(h=(p=e.body)!=null?p:e.center)!=null?h:n,Ae),me=i(["end","right"],(V=e.end)!=null?V:e.right,Ae);if(!(ye.length||me.length||e.body!=null||e.center!=null||e.startClass||e.bodyClass||e.centerClass||e.endClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"left")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"center")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"right")!=null)){const c=r(s,"default",Ae,n),N=_.div(u,...c);return G(N,e),N}const H={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},ae=(re=e.bodyClass)!=null?re:e.centerClass,ie=Et([e.direction,e.reverse],()=>(o(e.direction)||(o(e.reverse)?"row-reverse":"row"))==="row"?"auto":""),ve=[ye.length?_.div({class:fe(["cms-row-start",e.startClass]),style:{...H}},...ye):null,pe.length?_.div({class:fe(["cms-row-body",ae]),style:{...H,flex:"1 1 auto"}},...pe):null,me.length?_.div({class:fe(["cms-row-end",e.endClass]),style:{...H,justifyContent:"flex-end",marginInlineStart:ie}},...me):null].filter(Boolean),I=_.div(u,...ve);return G(I,e),I},(vi=JSswift.isDev)!=null&&vi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Row={signature:"UI.Row(...children) | UI.Row(props, ...children)",props:{start:"Node|Function|Array",left:"Alias of start",body:"Node|Function|Array",center:"Alias of body",end:"Node|Function|Array",right:"Alias of 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",mobile:"{ gap?, direction?, wrap?, align?, justify?, width?, minWidth?, maxWidth? }",tablet:"{ gap?, direction?, wrap?, align?, justify?, width?, minWidth?, maxWidth? }",pc:"{ gap?, direction?, wrap?, align?, justify?, width?, minWidth?, maxWidth? }",startClass:"string",bodyClass:"string",centerClass:"Alias of bodyClass",endClass:"string",slots:"{ start?, left?, body?, center?, end?, right?, default? }",class:"string",style:"object"},slots:{start:"Leading content area",left:"Alias of start",body:"Main content area",center:"Alias of body",end:"Trailing content area",right:"Alias of 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 Gt(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="function"&&typeof t[1]=="function"}function rn(t){return!!t&&t.type==="rod"}function Dt(t){return typeof t=="function"||rn(t)||Gt(t)}function o(t){return typeof t=="function"?t():rn(t)?t.value:Gt(t)?t[0]():t}function vn(t){const e=Array.isArray(t)?[...t]:[t];for(;e.length;){const n=e.pop();if(Dt(n))return!0;Array.isArray(n)&&e.push(...n)}return!1}function fe(t){const e=vn(t),n=()=>{const s=[],i=Array.isArray(t)?[...t]:[t];for(;i.length;){const d=i.shift();if(d==null||d===!1)continue;const S=o(d);if(!(S==null||S===!1||S==="")){if(Array.isArray(S)){i.unshift(...S);continue}s.push(S)}}return s.join(" ")};return e?n:n()}function zn(t){const e=fe(t);return typeof e=="function"?e():e}function xe(t,e,n=""){return Dt(t)?()=>o(t)?e:n:t?e:n}function Qo(t,e,n=""){return Dt(t)?()=>{const s=o(t);return s==null||s===""?"":`${e}${s}${n}`}:t==null||t===""?"":`${e}${t}${n}`}function Et(t,e){return(Array.isArray(t)?t:[t]).some(Dt)?()=>e():e()}function Ke(t,e,n=""){return Dt(t)?()=>{const s=o(t);return s==null||s===!1?n:e?e(s):s}:t==null||t===!1?null:e?e(t):t}JSswift.uiIsReactive=Dt,JSswift.uiUnwrap=o,JSswift.uiClass=fe,JSswift.uiClassStatic=zn,JSswift.uiWhen=xe,JSswift.uiClassValue=Qo,JSswift.uiComputed=Et,JSswift.uiStyleValue=Ke,v.Col=(...t)=>{var J,Q,ee,we,F,m;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=L=>Object.prototype.hasOwnProperty.call(e,L),d=(L,P,Y={})=>{const Ne=Array.isArray(L)?L:[L];for(const ze of Ne)if(JSswift.ui.getSlot(s,ze)!=null)return r(s,ze,Y,P);return P==null?[]:r(null,"default",Y,P)},S=L=>{var P;return L==null||L===!1||L===""?"":typeof L=="number"?`${L}px`:typeof L=="string"&&((P=JSswift.uiSizes)!=null&&P.includes(L))?`var(--cms-s-${L})`:String(L)},u=L=>{var P;return L==null||L===!1||L===""?"":typeof L=="string"&&((P=JSswift.uiSizes)!=null&&P.includes(L))?Qe(L,"size"):ht(L)},l=(L,P)=>{const Y=o(L);if(Y==null||Y===!1||Y==="")return"";if(Y==="auto")return P==="cms-col-"?"cms-col-auto":"";if(Y===!0)return`${P}24`;const Ne=Number(Y);if(Number.isFinite(Ne)&&Ne>0)return`${P}${Math.max(1,Math.min(24,Math.round(Ne)))}`;if(typeof Y=="string"){const ze=Y.trim();if(!ze)return"";if(ze.startsWith(P))return ze;if(/^\d+$/.test(ze))return`${P}${Math.max(1,Math.min(24,Number(ze)))}`}return""},w=()=>{const L=o(e.flex);if(L!=null&&L!==!1&&L!=="")return String(L);if(o(e.fill))return"1 1 auto";const P=i("grow"),Y=i("shrink"),Ne=i("basis");if(!P&&!Y&&!Ne)return"";const ze=P?o(e.grow):0,Ee=Y?o(e.shrink):1,K=Ne?u(o(e.basis)):"auto";return`${ze} ${Ee} ${K||"auto"}`},D=Et([e.auto,e.col,e.span],()=>{if(o(e.auto))return"cms-col-auto";const L=i("span")?e.span:e.col;return l(L,"cms-col-")||"cms-col"}),A=JSswift.omit(e,["slots","col","span","sm","md","lg","auto","size","width","minWidth","maxWidth","height","minHeight","maxHeight","gap","rowGap","columnGap","align","justify","inline","center","stack","flex","fill","grow","shrink","basis","self","order","scroll","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass",...JSswift.uiResponsiveOmitProps]),C={...e.style||{}};!tt(e,"minWidth")&&C.minWidth==null&&(C.minWidth=0);const z=Ke(e.gap,S),le=Ke(e.rowGap,S),te=Ke(e.columnGap,S),he=Ke(e.align),U=Ke(e.justify),W=i("width")?e.width:e.size,oe=Ke(W,u),Z=Ke(e.minWidth,u),ge=Ke(e.maxWidth,u),Ae=Ke(e.height,u),ye=Ke(e.minHeight,u),pe=Ke(e.maxHeight,u),me=Ke(e.self),ue=Ke(e.order,L=>String(L)),H=Ke(e.scroll,L=>L?"auto":"",""),ae=Et([e.flex,e.fill,e.grow,e.shrink,e.basis],w),ie=Et([e.center,e.align,e.justify],()=>!!o(e.center)&&(o(e.align)==null||o(e.align)==="")&&(o(e.justify)==null||o(e.justify)===""));ae!=null&&ae!==""&&(C.flex=ae),me!=null&&!tt(e,"self")&&(C.alignSelf=me),ue!=null&&(C.order=ue),H!=null&&H!==""&&(C.overflow=H),oe!=null&&oe!==""&&!tt(e,["width","size"])&&(C.width=oe,!i("flex")&&!i("fill")&&!i("grow")&&!i("shrink")&&!i("basis")&&(C.flex="0 0 auto")),Z!=null&&!tt(e,"minWidth")&&(C.minWidth=Z),ge!=null&&!tt(e,"maxWidth")&&(C.maxWidth=ge),Ae!=null&&!tt(e,"height")&&(C.height=Ae),ye!=null&&!tt(e,"minHeight")&&(C.minHeight=ye),pe!=null&&!tt(e,"maxHeight")&&(C.maxHeight=pe),Object.keys(C).length&&(A.style=C);const ve={props:e},I=d(["start","top","header","before"],(ee=(Q=(J=e.start)!=null?J:e.top)!=null?Q:e.header)!=null?ee:e.before,ve),g=i("body")?e.body:i("content")?e.content:n,p=d(["body","content","default"],g,ve),h=d(["end","bottom","footer","after"],(m=(F=(we=e.end)!=null?we:e.bottom)!=null?F:e.footer)!=null?m:e.after,ve),V=I.length||h.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||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"top")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"content")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"bottom")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,re=Et([e.stack,e.gap,e.rowGap,e.columnGap,e.align,e.justify,e.center],()=>o(e.stack)||V||[o(e.gap),o(e.rowGap),o(e.columnGap),o(e.align),o(e.justify)].some(P=>P!=null&&P!==!1&&P!=="")?!0:!!o(e.center));if(A.class=fe(["cms-col",D,Et(e.sm,()=>l(e.sm,"cms-sm-col-")),Et(e.md,()=>l(e.md,"cms-md-col-")),Et(e.lg,()=>l(e.lg,"cms-lg-col-")),JSswift.uiResponsiveClasses({mobile:e},Bt),JSswift.uiResponsiveClasses(e,Bt),xe(re,"cms-col-flex"),xe(e.inline,"cms-col-inline"),e.class]),z!=null&&!tt(e,"gap")&&(C.gap=z),le!=null&&!tt(e,"rowGap")&&(C.rowGap=le),te!=null&&!tt(e,"columnGap")&&(C.columnGap=te),he!=null&&!tt(e,"align")?C.alignItems=he:ie!=null&&ie!==""&&(C.alignItems=ie?"center":""),U!=null&&!tt(e,"justify")?C.justifyContent=U:ie!=null&&ie!==""&&(C.justifyContent=ie?"center":""),Object.keys(C).length&&(A.style=C),JSswift.uiApplyResponsiveProps(A,e,JSswift.uiResponsiveStyleRules),!V){const L=_.div(A,...r(s,"default",ve,n));return G(L,e),L}const c={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},N=[I.length?_.div({class:fe(["cms-col-start",e.startClass,e.topClass,e.headerClass]),style:{...c}},...I):null,p.length?_.div({class:fe(["cms-col-body",e.bodyClass,e.contentClass]),style:{...c,flex:"1 1 auto"}},...p):null,h.length?_.div({class:fe(["cms-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...c}},...h):null].filter(Boolean),b=_.div(A,...N);return G(b,e),b},(Si=JSswift.isDev)!=null&&Si.call(JSswift)&&(v.meta=v.meta||{},v.meta.Col={signature:"UI.Col(...children) | UI.Col(props, ...children)",props:{col:"number|string",span:"Alias of 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 of 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",mobile:"{ col?, span?, gap?, direction?, align?, justify?, width?, height? }",tablet:"{ col?, span?, gap?, direction?, align?, justify?, width?, height? }",pc:"{ col?, span?, gap?, direction?, align?, justify?, width?, height? }",start:"Node|Function|Array",top:"Alias of start",header:"Alias of start",body:"Node|Function|Array",content:"Alias of body",end:"Node|Function|Array",bottom:"Alias of end",footer:"Alias of end",startClass:"string",bodyClass:"string",endClass:"string",slots:"{ start?, top?, header?, body?, content?, end?, bottom?, footer?, default? }",class:"string",style:"object"},slots:{start:"Column leading area",top:"Alias of start",header:"Alias of start",body:"Column main area",content:"Alias of body",end:"Column trailing area",bottom:"Alias of end",footer:"Alias of end",default:"Column fallback content"},returns:"HTMLDivElement",description:"Responsive 24-column wrapper. By default it behaves like a regular container and enables vertical flex layout when using gap/alignment, structured regions, or `stack`."}),v.Spacer=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.omit(e,["slots"]);i.class=fe(["cms-spacer",e.class]);const d=r(s,"default",{},n);return _.div(i,...d)},(Ci=JSswift.isDev)!=null&&Ci.call(JSswift)&&(v.meta=v.meta||{},v.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."}),v.Container=(...t)=>{var h,V,re,c;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},d=N=>Object.prototype.hasOwnProperty.call(e,N),S={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},u=N=>{if(N==null||N===!1||N==="")return"";if(typeof N=="number")return`${N}px`;const b=String(N).trim().toLowerCase();return b?b==="full"||b==="fluid"?"100%":S[b]||String(N):""},l=N=>{var b;return N==null||N===!1||N===""?"":typeof N=="number"?`${N}px`:typeof N=="string"&&((b=JSswift.uiSizes)!=null&&b.includes(N))?`var(--cms-s-${N})`:String(N)},w=N=>{if(N==null||N===!1||N==="")return"";if(typeof N=="number"&&Number.isFinite(N))return`repeat(${Math.max(1,Math.floor(N))}, minmax(0, 1fr))`;const b=String(N).trim();return b?/^\d+$/.test(b)?`repeat(${Math.max(1,Number(b))}, minmax(0, 1fr))`:b:""},D=N=>N==null||N===""?"":N===!0?"wrap":N===!1?"nowrap":String(N),A={props:e},C=(N,b)=>{if(!(b==null||b===!1)){if(Array.isArray(b)){b.forEach(J=>C(N,J));return}if(b!=null&&b.nodeType){N.appendChild(b);return}N.appendChild(document.createTextNode(String(b)))}},z=(N,b)=>{const J=JSswift.ui.getSlot(s,N);if(J!=null)return r(s,N,A,null);if(typeof b=="function"){const Q=_.div({class:`cms-container-slot-${N}`});return JSswift.reactive.effect(()=>{const ee=Hn(JSswift.ui.slot(b(A)));Q.replaceChildren(),Array.isArray(ee)?ee.forEach(we=>C(Q,we)):C(Q,ee)},`UI.Container:${N}`),[Q]}return r(s,N,A,b)},le=d("content")?e.content:n!=null&&n.length?n:null,te=z("before",(h=e.before)!=null?h:e.top),he=z("header",e.header),U=[...z("left",e.left),...z("start",e.start)],W=z("body",d("body")?e.body:null),oe=(()=>{const N=z("content",d("content")?e.content:null);return N.length?N:z("default",le)})(),Z=[...z("right",e.right),...z("end",e.end)],ge=z("footer",e.footer),Ae=z("after",(V=e.after)!=null?V:e.bottom),ye=te.length||he.length||U.length||Z.length||ge.length||Ae.length||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"left")!=null||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"right")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,pe=!!ye||W.length>0&&(JSswift.ui.getSlot(s,"body")!=null||ye),me=()=>{var b;const N=String(o((b=e.layout)!=null?b:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(N)?N:["inline","inline-flex","inlineflex"].includes(N)||o(e.inline)?"inline":o(e.grid)||o(e.cols)!=null?"grid":N==="block"?"block":o(e.direction)!=null||o(e.wrap)!=null||o(e.align)!=null||o(e.justify)!=null||o(e.gap)!=null||U.length||Z.length?"flex":"block"},ue=Et([e.layout,e.display,e.inline,e.grid,e.cols,e.direction,e.wrap,e.align,e.justify,e.gap],()=>{const N=me();return N==="block"?"":`is-${N}`}),H={...i.style||{}},ae=(N,b)=>{b!=null&&(H[N]=b)};ae("maxWidth",Et([e.maxWidth,e.fluid],()=>o(e.fluid)?"none":u(o(e.maxWidth))||"")),ae("width",Ke(e.width,u)),ae("minWidth",Ke(e.minWidth,u)),ae("--cms-container-padding",Ke(e.padding,l)),ae("--cms-container-padding-x",Ke((re=e.paddingX)!=null?re:e.gutter,l)),ae("--cms-container-padding-y",Ke(e.paddingY,l)),ae("--cms-container-gap",Ke(e.gap,l)),ae("--cms-container-section-gap",Ke((c=e.sectionGap)!=null?c:e.gap,l)),ae("--cms-container-cols",Ke(e.cols,w)),ae("--cms-container-align",Ke(e.align,N=>String(N))),ae("--cms-container-justify",Ke(e.justify,N=>String(N))),ae("--cms-container-direction",Ke(e.direction,N=>String(N))),ae("--cms-container-wrap",Ke(e.wrap,D));const ie=JSswift.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"]);ie.class=fe(["cms-container",xe(e.fluid,"is-fluid"),xe(pe,"has-structure"),pe?"":ue,i.class]),ie.style=H,JSswift.uiApplyResponsiveProps(ie,e,JSswift.uiResponsiveStyleRules);const ve=(N,b,J)=>b.length?_.div({class:fe(["cms-container-section",`cms-container-${N}`,J])},...b):null,I=W.length?_.div({class:fe(["cms-container-body",pe?ue:"",e.bodyClass])},...W):U.length||oe.length||Z.length?_.div({class:fe(["cms-container-body",pe?ue:"",e.bodyClass])},ve("start",U,e.startClass),oe.length?_.div({class:fe(["cms-container-main",e.mainClass,e.contentClass])},...oe):null,ve("end",Z,e.endClass)):null,g=(()=>{var b;const N=String(o((b=e.tag)!=null?b:e.as)||"div").toLowerCase();return typeof _[N]=="function"?_[N]:_.div})(),p=pe?g(ie,ve("before",te,e.beforeClass),ve("header",he,e.headerClass),I,ve("footer",ge,e.footerClass),ve("after",Ae,e.afterClass)):g(ie,...W.length?W:oe);return G(p,e),p},(xi=JSswift.isDev)!=null&&xi.call(JSswift)&&(v.meta=v.meta||{},v.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:"Composable container with max-width, spacing, layout props, and optional sections."}),v.Card=(...t)=>{var we,F;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};xn(i);const d=(m,L)=>{var P;return!!(m&&m.nodeType===1&&((P=m.classList)!=null&&P.contains(`cms-card-${L}`)))},u=(m=>m==null?null:typeof m=="string"?v.Icon({name:m,size:e.iconSize||e.size||"lg"}):JSswift.ui.slot(m,{as:"icon"}))(e.icon),l=e.image?_.img({src:e.image,alt:e.imageAlt||"",class:fe(["cms-card-cover-media",e.imageClass]),style:e.imageStyle}):e.cover,w={dense:!!o(e.dense),flat:!!o(e.flat),clickable:!!o(e.clickable),to:o(e.to)||null},D=r(s,"default",w,n!=null&&n.length?n:[]),A={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},C=[];D.forEach(m=>{d(m,"identifier")?A.identifier.push(m):d(m,"cover")?A.cover.push(m):d(m,"media")?A.media.push(m):d(m,"header")?A.header.push(m):d(m,"body")?A.body.push(m):d(m,"footer")?A.footer.push(m):d(m,"actions")?A.actions.push(m):C.push(m)});const z=r(s,"identifier",w,e.identifier),le=r(s,"cover",w,l),te=r(s,"media",w,e.media),he=r(s,"eyebrow",w,(we=e.eyebrow)!=null?we:e.kicker),U=r(s,"title",w,e.title),W=r(s,"subtitle",w,e.subtitle),oe=r(s,"header",w,e.header),Z=r(s,"icon",w,u),ge=r(s,"aside",w,(F=e.aside)!=null?F:e.headerAside),Ae=r(s,"body",w,e.body),ye=r(s,"footer",w,e.footer),pe=r(s,"actions",w,e.actions),me=z.length?_.div({class:fe(["cms-card-identifier",e.identifierClass])},...z):null,ue=le.length?_.div({class:fe(["cms-card-cover",e.coverClass])},...le):null,H=te.length?_.div({class:fe(["cms-card-media",e.mediaClass])},...te):null,ie=Z.length||he.length||U.length||W.length||oe.length||ge.length?_.div({class:fe(["cms-card-header",e.headerClass])},_.div({class:"cms-card-head"},Z.length?_.div({class:"cms-card-icon"},...Z):null,_.div({class:"cms-card-head-main"},he.length?_.div({class:fe(["cms-card-eyebrow",e.eyebrowClass])},...he):null,U.length?_.div({class:fe(["cms-card-title",e.titleClass])},...U):null,W.length?_.div({class:fe(["cms-card-subtitle",e.subtitleClass])},...W):null,oe.length?_.div({class:fe(["cms-card-header-content",e.headerContentClass])},...oe):null),ge.length?_.div({class:fe(["cms-card-aside",e.asideClass])},...ge):null)):null,ve=[...Ae,...C],I=ve.length?_.div({class:fe(["cms-card-body",e.bodyClass])},...ve):null,g=[...pe,...A.actions],p=ye.length||g.length?_.div({class:fe(["cms-card-footer",e.footerClass])},...ye,g.length?_.div({class:"cms-card-actions"},...g):null):null,h=Et([e.clickable,e.to],()=>o(e.clickable)||o(e.to)?"cms-card-clickable":""),V=z.length||A.identifier.length,re=le.length||A.cover.length||te.length||A.media.length,c=JSswift.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","display","direction","wrap","align","justify","gap","rowGap","columnGap","cols","columns"]);c.class=fe(["cms-panel","cms-card","cms-clear-set","cms-singularity",xe(e.flat,"cms-card-flat"),xe(e.dense,"cms-card-dense"),xe(V,"cms-card-has-identifier"),xe(re,"cms-card-has-top-visual"),h,i.class]),c.style={...i.style||{}},e.coverHeight!=null&&(c.style["--cms-card-cover-height"]=ht(o(e.coverHeight))),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const N=e.onClick,b=e.onKeydown,J=m=>{var P;if(N==null||N(m),m.defaultPrevented)return;const L=o(e.to);L&&((P=JSswift.router)!=null&&P.navigate)&&(m.preventDefault(),JSswift.router.navigate(L))},Q=m=>{b==null||b(m),!m.defaultPrevented&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),J(m))};(o(e.clickable)||o(e.to))&&(c.onClick=J,c.onKeydown=Q,c.tabIndex==null&&(c.tabIndex=0),c.role==null&&(c.role="button"));const ee=_.div(c,me,...A.identifier,ue,...A.cover,H,...A.media,ie,...A.header,I,...A.body,p,...A.footer);return G(ee,e),ee},(Ai=JSswift.isDev)!=null&&Ai.call(JSswift)&&(v.meta=v.meta||{},v.meta.Card={signature:"UI.Card(...children) | UI.Card(props, ...children)",description:"Sectioned card with structured header, cover/media, body, and 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",display:"string",direction:"row|column|string",gap:"string|number",cols:"number|string",mobile:"{ display?, direction?, gap?, cols? }",tablet:"{ display?, direction?, gap?, cols? }",pc:"{ display?, direction?, gap?, cols? }",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"}),v.Btn=(...t)=>{var ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Et([e.color,e.state],()=>{const H=o(e.color)||o(e.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(H)?H:o(e.state)||""}),d=fe(["cms-clear-set","cms-btn","cms-singularity","cms-clickable",i,xe(e.outline,"outline"),e.class]),S=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);S.class=d;const u=()=>!!o(e.loading),l=()=>!!o(e.disabled)||u(),w=e.icon!=null?typeof e.icon=="string"?v.Icon({name:e.icon}):e.icon:null,D=e.iconRight!=null?typeof e.iconRight=="string"?v.Icon({name:e.iconRight}):e.iconRight:null,A=JSswift.ui.renderSlot(s,"icon",{},w),C=JSswift.ui.renderSlot(s,"iconRight",{},D),z=JSswift.ui.renderSlot(s,"label",{},e.label),le=r(s,"default",{},n),te=[],he=H=>{H&&(Array.isArray(H)?te.push(...H):te.push(H))},U=e.iconAlign;(U==="after"||U==="right")&&!D?(he(z),le.length&&te.push(...le),he(A)):(he(A),he(z),le.length&&te.push(...le)),he(C),he(Nt(e,{className:"cms-shortcode cms-btn-shortcode"})),te.length===0&&te.push(_.span("Button"));const oe=_.span({class:"cms-btn-loading",hidden:!0}),Z=_.span({class:"cms-btn-content"},...te);let ge=!1;const Ae=()=>{const H=v.Spinner?v.Spinner({size:e.loadingSize||e.spinnerSize||16,thickness:e.loadingThickness||2,color:e.loadingColor||"currentColor",label:e.loadingText||null,"aria-label":e.loadingText?null:"Loading"}):_.span({class:"cms-muted",style:{marginRight:"8px"}},e.loadingText||"Loading");return r(null,"default",{},JSswift.ui.renderSlot(s,"loading",{},H))},ye=H=>{var g;if((g=e.onPointerDown)==null||g.call(e,H),l()||!(H!=null&&H.currentTarget))return;const ae=H.currentTarget,ie=ae.getBoundingClientRect(),ve=typeof H.clientX=="number"?H.clientX-ie.left:ie.width/2,I=typeof H.clientY=="number"?H.clientY-ie.top:ie.height/2;ae.style.setProperty("--cms-burst-x",`${ve}px`),ae.style.setProperty("--cms-burst-y",`${I}px`),ae.classList.remove("cms-btn-burst"),ae.offsetWidth,ae.classList.add("cms-btn-burst")},pe=_.button({...S,disabled:l(),onClick:H=>{var ae,ie;return l()?((ae=H==null?void 0:H.preventDefault)==null||ae.call(H),!1):(ie=e.onClick)==null?void 0:ie.call(e,H)},onPointerDown:ye,"aria-disabled":l()?"true":null,"aria-busy":u()?"true":null},oe,Z),me=JSswift.reactive.effect(()=>{const H=u(),ae=l();pe.disabled=ae,pe.classList.toggle("is-loading",H),pe.setAttribute("aria-disabled",ae?"true":"false"),H?pe.setAttribute("aria-busy","true"):pe.removeAttribute("aria-busy"),oe.hidden=!H,H!==ge&&(oe.replaceChildren(...H?Ae():[]),ge=H)},"UI.Btn:state");return(ue=JSswift._registerCleanup)==null||ue.call(JSswift,pe,me),G(pe,e),_t(pe,e,{isEnabled:()=>!l(),action:()=>{if(l())return!1;pe.click()}}),pe},v.Button=v.Btn,JSswift.ui.Btn=v.Btn,JSswift.ui.Button=v.Button,(Ni=JSswift.isDev)!=null&&Ni.call(JSswift)&&(v.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",loadingText:"string|Node|Function|Array",loadingSize:"number|string",loadingColor:"string",loadingThickness:"number|string",disabled:"boolean",shortcode:"string|Array<string>|object",showShortcode:"boolean",slots:"{ icon?, iconRight?, label?, loading?, 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"},v.meta.Button=v.meta.Btn),v.FormField=(t={})=>{var pe,me,ue,H,ae,ie,ve;xn(t);const e=t.slots||{},n=Et([t.color,t.state],()=>{const I=o(t.color)||o(t.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(I)?I:o(t.state)||""}),s=_.div({class:fe(["cms-clear-field-set","cms-field","cms-singularity-field",n,xe(t.fill,"cms-field-fill"),xe(t.outline,"outline"),t.wrapClass,t.class])}),i=r(e,"topLabel",{},t.topLabel);i.length&&s.appendChild(_.div({class:"cms-field-label"},...i));const d=t.multi||t.multiple,S=typeof t.control=="function"?t.control():t.control,u=()=>{if(typeof t.hasValue=="function")return!!t.hasValue();if(t.hasValue!=null)return!!o(t.hasValue);const I=t.getValue?t.getValue():null;return!(I==null||I==="")},l=()=>JSswift.reactive.untracked(u),w=()=>{var I,g;t.disabled||t.readonly||((I=t.onClear)==null||I.call(t),(g=t.onFocus)==null||g.call(t))},D=JSswift.ui.renderSlot(e,"control",{control:S,clear:w,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:l()},null);let A=null,C=null;if(D)A=Array.isArray(D)?_.div({class:"cms-control"},...D):D;else{A=_.div({class:"cms-control"});const I=_.div({class:"cms-addon cms-addon-left"}),g=t.icon!=null?typeof t.icon=="string"?v.Icon({name:t.icon}):t.icon:null,p=JSswift.ui.renderSlot(e,"icon",{},g),h=JSswift.ui.renderSlot(e,"prefix",{},t.prefix);r(null,"default",{},p).forEach(F=>I.appendChild(F)),r(null,"default",{},h).forEach(F=>I.appendChild(F)),I.childNodes.length&&A.appendChild(I);const V=_.div({class:"cms-mid"+(I.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});S&&V.appendChild(S);const re=r(e,"label",{},t.label);if(re.length){const F=_.div({class:fe(["cms-float-label",xe(d,"cms-multiselect")])},...re);V.appendChild(F)}A.appendChild(V);const c=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:w},v.Icon({name:"close"})):null,N=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:l()},c);N&&(N.onclick=F=>{F.stopPropagation(),w()},r(null,"default",{},N).forEach(F=>A.appendChild(F))),C=c,C&&((pe=t.clearable)!=null&&pe.action)&&t.clearable.action(F=>F?C.classList.remove("cms-d-none"):C.classList.add("cms-d-none"));const b=_.div({class:"cms-addon cms-addon-right"}),J=t.iconRight!=null?typeof t.iconRight=="string"?v.Icon({name:t.iconRight}):t.iconRight:null,Q=JSswift.ui.renderSlot(e,"iconRight",{},J),ee=JSswift.ui.renderSlot(e,"suffix",{},t.suffix),we=JSswift.ui.renderSlot(e,"shortcode",{props:t},Nt(t,{className:"cms-shortcode cms-field-shortcode"}));r(null,"default",{},ee).forEach(F=>b.appendChild(F)),r(null,"default",{},Q).forEach(F=>b.appendChild(F)),r(null,"default",{},we).forEach(F=>b.appendChild(F)),b.childNodes.length&&(A.appendChild(b),V.classList.add("cms-with-right"))}const z=I=>I&&(I&&typeof I.action=="function"?I.value:Array.isArray(I)&&typeof I[0]=="function"?I[0]():typeof I=="function"?I():I),le=I=>I==null||I===!1||I===""?!1:Array.isArray(I)?I.length>0:!0;let te=null;const he=()=>{const I=[{key:"error",value:z(t.error),slot:"errorMessage",className:"cms-error"},{key:"warning",value:z(t.warning),slot:"warning",className:"cms-warning"},{key:"success",value:z(t.success),slot:"success",className:"cms-success"},{key:"note",value:z(t.note),slot:"note",className:"cms-note"},{key:"hint",value:z(t.hint),slot:"hint",className:"cms-hint"}];let g=null;for(const c of I)if(le(c.value)){g=c;break}const p={error:I[0].value,warning:I[1].value,success:I[2].value,note:I[3].value,hint:I[4].value,props:t},h=g?r(e,g.slot,p,g.value):[],V=h.length?_.div({class:g==null?void 0:g.className},...h):null;["error","warning","success","note"].forEach(c=>{var N;return(N=A==null?void 0:A.classList)==null?void 0:N.toggle(c,(g==null?void 0:g.key)===c)}),te?V?te.replaceWith(V):te.remove():V&&s.appendChild(V),te=V},U=()=>{var g;const I=u();(g=A==null?void 0:A.classList)==null||g.toggle("has-value",I),C&&(C.style.display=I?"":"none")};JSswift.reactive.untracked(U),(me=A==null?void 0:A.classList)==null||me.toggle("disabled",!!t.disabled),s.appendChild(A);const W=JSswift.ui.getSlot(e,"errorMessage"),oe=JSswift.ui.getSlot(e,"warning"),Z=JSswift.ui.getSlot(e,"success"),ge=JSswift.ui.getSlot(e,"note"),Ae=JSswift.ui.getSlot(e,"hint");return!!((ue=t.error)!=null&&ue.action||(H=t.warning)!=null&&H.action||(ae=t.success)!=null&&ae.action||(ie=t.note)!=null&&ie.action||(ve=t.hint)!=null&&ve.action)||Array.isArray(t.error)&&typeof t.error[0]=="function"||Array.isArray(t.warning)&&typeof t.warning[0]=="function"||Array.isArray(t.success)&&typeof t.success[0]=="function"||Array.isArray(t.note)&&typeof t.note[0]=="function"||Array.isArray(t.hint)&&typeof t.hint[0]=="function"||typeof t.error=="function"||typeof t.warning=="function"||typeof t.success=="function"||typeof t.note=="function"||typeof t.hint=="function"||typeof W=="function"||typeof oe=="function"||typeof Z=="function"||typeof ge=="function"||typeof Ae=="function"?JSswift.reactive.effect(()=>{he()},"UI.FormField:message"):he(),s._refresh=U,s._control=A,s._el=S,s},(ki=JSswift.isDev)!=null&&ki.call(JSswift)&&(v.meta=v.meta||{},v.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",shortcode:"string|Array<string>|object",showShortcode:"boolean",disabled:"boolean",readonly:"boolean",control:"Node|Function",getValue:"() => any",onClear:"() => void",onFocus:"() => void",wrapClass:"string",slots:"{ label?, topLabel?, prefix?, suffix?, shortcode?, 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",shortcode:"Shortcut badge 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()"}),v.InputRaw=(t={})=>{var D;const e=_.input({class:fe(["cms-input-raw",t.class]),type:t.type||"text",name:t.name,placeholder:t.placeholder,autocomplete:t.autocomplete,value:t.value});let n=(D=e.value)!=null?D:"";const s=()=>{var C;const A=(C=e.value)!=null?C:"";A!==n&&(n=A,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let i=null,d=!1;const S=()=>{if(d)return;d=!0;let A=0;const C=()=>{if(s(),A+=1,A>=10){d=!1;return}setTimeout(C,120)};setTimeout(C,40)},u=()=>{i||(i=setInterval(()=>{if(document.activeElement!==e){clearInterval(i),i=null;return}s()},250))},l=()=>{i&&(clearInterval(i),i=null)};e.addEventListener("input",()=>{var A;n=(A=e.value)!=null?A:""}),e.addEventListener("change",()=>{var A;n=(A=e.value)!=null?A:""}),e.addEventListener("animationstart",A=>{A.animationName==="cms-autofill"&&(s(),u(),S())}),e.addEventListener("focus",()=>{u(),S(),setTimeout(s,50)}),e.addEventListener("blur",()=>{l(),setTimeout(s,0)}),setTimeout(s,0),S();const w=t.model;if(w){if(typeof w=="object"&&typeof w._bind=="function")mt.rodModel(e,w);else if(Array.isArray(w)&&typeof w[0]=="function"&&typeof w[1]=="function"){const A=mt.rodFromSignal(w[0],w[1]);mt.rodModel(e,A)}}return _t(e,t,{isEnabled:()=>!e.disabled,action:()=>Ve(e,{selectText:!!t.selectOnShortcode})}),e},v.Input=(t={})=>{var te,he,U;const e=t.slots||{},n={...t,label:(te=t.label)!=null?te:t.placeholder},s=_.input({class:fe(["cms-input",t.class]),type:t.type||"text",name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,value:(he=t.value)!=null?he:"",disabled:!!t.disabled,readOnly:!!t.readonly});let i=(U=s.value)!=null?U:"";const d=()=>{var oe;const W=(oe=s.value)!=null?oe:"";W!==i&&(i=W,s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})))};let S=null,u=!1;const l=()=>{if(u)return;u=!0;let W=0;const oe=()=>{if(d(),W+=1,W>=10){u=!1;return}setTimeout(oe,120)};setTimeout(oe,40)},w=()=>{S||(S=setInterval(()=>{if(document.activeElement!==s){clearInterval(S),S=null;return}d()},250))},D=()=>{S&&(clearInterval(S),S=null)};s.addEventListener("input",()=>{var W,oe;i=(W=s.value)!=null?W:"",(oe=t.onInput)==null||oe.call(t,s.value)}),s.addEventListener("change",()=>{var W,oe;i=(W=s.value)!=null?W:"",(oe=t.onChange)==null||oe.call(t,s.value)}),s.addEventListener("focus",W=>{var oe;(oe=t.onFocus)==null||oe.call(t,W),w(),l(),setTimeout(d,50)}),s.addEventListener("blur",W=>{var oe;(oe=t.onBlur)==null||oe.call(t,W),D(),setTimeout(d,0)}),s.addEventListener("animationstart",W=>{W.animationName==="cms-autofill"&&(d(),w(),l())}),setTimeout(d,0),l();const A=t.model;if(A){const W=oe=>{let Z=!1;const ge=ye=>{const pe=ye!=null?ye:"";s.value!==pe&&(s.value=pe,i=pe)};oe.action(ye=>{if(!Z){Z=!0;try{ge(ye)}finally{Z=!1}}}),JSswift.reactive.untracked(()=>ge(oe.value));const Ae=ye=>{if(Z||ye!=null&&ye.isComposing)return;const pe=s.value;if(oe.value!==pe){Z=!0;try{oe.value=pe}finally{Z=!1}}};s.addEventListener("input",Ae),s.addEventListener("compositionend",Ae),typeof oe.onDispose=="function"&&oe.onDispose(()=>{s.removeEventListener("input",Ae),s.removeEventListener("compositionend",Ae)})};if(typeof A=="object"&&typeof A._bind=="function")W(A);else if(Array.isArray(A)&&typeof A[0]=="function"&&typeof A[1]=="function"){const oe=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(A[0],A[1]));W(oe)}}const C=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),z=Array.isArray(C)?_.div({style:{display:"contents"}},...C):C,le=v.FormField({...n,control:z,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var W;return(W=le._refresh)==null?void 0:W.call(le)}),s.addEventListener("change",()=>{var W;return(W=le._refresh)==null?void 0:W.call(le)}),le._input=s,_t(s,t,{isEnabled:()=>!s.disabled,action:()=>Ve(s,{selectText:!!t.selectOnShortcode})}),le},(_i=JSswift.isDev)!=null&&_i.call(JSswift)&&(v.meta=v.meta||{},v.meta.Input={signature:"UI.Input(props)",description:"Input field with floating label, hint/error/success/warning/note, clearable control, icon, prefix/suffix, and reactive support (rod/signal).",props:{model:"rod | [get,set] signal",value:"string",type:"string (default: 'text')",name:"string",autocomplete:"string",inputmode:"string",disabled:"boolean",readonly:"boolean",shortcode:"string|Array<string>|object",showShortcode:"boolean",label:"String|Node|Function (floating label)",topLabel:"String|Node|Function (label above, not floating)",placeholder:"String|Node|Function (alias of label when label is not set)",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:"Left addon (via FormField slots.prefix)",suffix:"Right addon (via FormField slots.suffix)",shortcode:"Shortcut badge (via FormField slots.shortcode)",icon:"Left icon (via FormField slots.icon)",iconRight:"Right icon (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"}),v.Textarea=(t={})=>{var w,D,A,C;const e=t.slots||{},n={...t,label:(w=t.label)!=null?w:t.placeholder,wrapClass:fe(["cms-textarea-field",t.wrapClass])},s=_.textarea({class:fe(["cms-input","cms-textarea",t.class]),name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,rows:t.rows,cols:t.cols,maxLength:(D=t.maxLength)!=null?D:t.maxlength,minLength:(A=t.minLength)!=null?A:t.minlength,wrap:t.wrap,value:(C=t.value)!=null?C:"",disabled:!!t.disabled,readOnly:!!t.readonly});s.addEventListener("input",()=>{var z;(z=t.onInput)==null||z.call(t,s.value)}),s.addEventListener("change",()=>{var z;(z=t.onChange)==null||z.call(t,s.value)}),s.addEventListener("focus",z=>{var le;(le=t.onFocus)==null||le.call(t,z)}),s.addEventListener("blur",z=>{var le;(le=t.onBlur)==null||le.call(t,z)});const i=t.model;if(i){const z=le=>{let te=!1;const he=W=>{const oe=W!=null?W:"";s.value!==oe&&(s.value=oe)};le.action(W=>{if(!te){te=!0;try{he(W)}finally{te=!1}}}),JSswift.reactive.untracked(()=>he(le.value));const U=W=>{if(te||W!=null&&W.isComposing)return;const oe=s.value;if(le.value!==oe){te=!0;try{le.value=oe}finally{te=!1}}};s.addEventListener("input",U),s.addEventListener("compositionend",U),typeof le.onDispose=="function"&&le.onDispose(()=>{s.removeEventListener("input",U),s.removeEventListener("compositionend",U)})};if(typeof i=="object"&&typeof i._bind=="function")z(i);else if(Array.isArray(i)&&typeof i[0]=="function"&&typeof i[1]=="function"){const le=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(i[0],i[1]));z(le)}}const d=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",S=JSswift.ui.renderSlot(e,d,{textarea:s,input:s,props:t},s),u=Array.isArray(S)?_.div({style:{display:"contents"}},...S):S,l=v.FormField({...n,control:u,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var z;return(z=l._refresh)==null?void 0:z.call(l)}),s.addEventListener("change",()=>{var z;return(z=l._refresh)==null?void 0:z.call(l)}),l._input=s,l._textarea=s,_t(s,t,{isEnabled:()=>!s.disabled,action:()=>Ve(s,{selectText:!!t.selectOnShortcode})}),l},(Fi=JSswift.isDev)!=null&&Fi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Textarea={signature:"UI.Textarea(props)",description:"Textarea field with floating label, hint/error/success/warning/note, clearable control, icon, prefix/suffix, and reactive support (rod/signal).",props:{model:"rod | [get,set] signal",value:"string",name:"string",autocomplete:"string",inputmode:"string",rows:"number|string",cols:"number|string",maxLength:"number|string",minLength:"number|string",wrap:"string",disabled:"boolean",readonly:"boolean",shortcode:"string|Array<string>|object",showShortcode:"boolean",label:"String|Node|Function (floating label)",topLabel:"String|Node|Function (label above, not floating)",placeholder:"String|Node|Function (alias of label when label is not set)",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 alla textarea)",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:"Left addon (via FormField slots.prefix)",suffix:"Right addon (via FormField slots.suffix)",shortcode:"Shortcut badge (via FormField slots.shortcode)",icon:"Left icon (via FormField slots.icon)",iconRight:"Right icon (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)",textarea:"Custom textarea node (ctx: { textarea, input, props })",input:"Alias slot for custom textarea node (ctx: { textarea, input, props })"},returns:"HTMLDivElement (field wrapper) con ._textarea = HTMLTextAreaElement"}),v.Search=(t={})=>{var R,Te;const e=t.slots||{},n=O=>!!O&&(typeof O=="object"&&typeof O._bind=="function"||Gt(O)),s=n(t.model)?t.model:n(t.value)?t.value:null,i=s?typeof s=="object"&&typeof s._bind=="function"?s.value:s[0]():o(t.value),[d,S]=JSswift.reactive.signal(i==null?"":String(i)),[u,l]=JSswift.reactive.signal(!1),[w,D]=JSswift.reactive.signal(!1),[A,C]=JSswift.reactive.signal(null),[z,le]=JSswift.reactive.signal([]),[te,he]=JSswift.reactive.signal(-1),U=`cms-search-${Math.random().toString(36).slice(2,10)}`,W=new Map;let oe=null,Z=null,ge=null,Ae=0,ye=0,pe=!1,me=-1,ue=[];const H=(O,k)=>{const x=Number(o(O));return Number.isFinite(x)?x:k},ae=(O,k=!1)=>{const x=o(O);return x==null?k:!!x},ie=()=>ae(t.disabled,!1),ve=()=>ae(t.readonly,!1),I=()=>Math.max(0,H(t.minLength,t.endpoint?1:0)),g=()=>Math.max(0,H(t.debounce,250)),p=O=>{var x,f,E,Ce,Ue;const k=t.getLabel||t.labelOf;return typeof k=="function"?k(O):O==null?"":typeof O=="string"||typeof O=="number"?String(O):(Ue=(Ce=(E=(f=(x=O.label)!=null?x:O.title)!=null?f:O.name)!=null?E:O.text)!=null?Ce:O.value)!=null?Ue:""},h=O=>{var x,f,E;const k=t.getValue||t.valueOf;return typeof k=="function"?k(O):O==null?"":typeof O=="string"||typeof O=="number"?O:(E=(f=(x=O.value)!=null?x:O.id)!=null?f:O.key)!=null?E:p(O)},V=O=>Array.isArray(O)?O:!O||typeof O!="object"?[]:Array.isArray(O.items)?O.items:Array.isArray(O.results)?O.results:Array.isArray(O.data)?O.data:[],re=async(O,k)=>{const x=typeof O=="function"?O(k,{props:t}):o(O);return x&&typeof x.then=="function"?await x:x},c=(O,k)=>{const x=typeof O=="function"?O(k,{props:t}):o(O);if(!x)return"";const f=String(x),E=new URL(f,window.location.href),Ce=o(t.queryParam)||"q";Ce&&E.searchParams.set(Ce,k);const Ue=typeof t.params=="function"?t.params(k,{props:t}):o(t.params);return Ue&&typeof Ue=="object"&&Object.keys(Ue).forEach(Xe=>{const q=o(Ue[Xe]);q==null||q===!1||E.searchParams.set(Xe,String(q))}),E.toString()},N=(O,k={})=>{var f,E;const x=O==null?"":String(O);d()!==x&&S(x),ce.value!==x&&(ce.value=x),oe&&!k.fromModel&&oe(x),k.fromModel||(f=t.onInput)==null||f.call(t,x,k.event),(E=Fe==null?void 0:Fe._refresh)==null||E.call(Fe)},b=()=>{l(!1),he(-1)},J=()=>w()||A()||z().length?!0:d().trim().length>=I()?!!(t.emptyText||JSswift.ui.getSlot(e,"empty")!=null):!!(t.startText||JSswift.ui.getSlot(e,"empty")!=null),Q=()=>{ie()||J()&&(l(!0),ze())},ee=()=>{le([]),C(null),he(-1)},we=async(O,k={})=>{var q,We,st,Ze,ut,St;const x=O==null?"":String(O).trim(),f=++Ae,E=o((q=t.endpoint)!=null?q:t.url),Ce=(st=(We=t.items)!=null?We:t.options)!=null?st:t.suggestions;if(ge&&(ge.abort(),ge=null),x.length<I()){D(!1),ee(),k.open&&J()?Q():J()||b();return}const Ue=t.cache!==!1,Xe=`${E||"local"}::${x}`;if(Ue&&W.has(Xe)){le(W.get(Xe)),C(null),D(!1),he(W.get(Xe).length?0:-1),k.open!==!1&&Q();return}D(!0),C(null),k.open!==!1&&Q(),(Ze=t.onSearch)==null||Ze.call(t,x);try{let Lt;if(E){ge=new AbortController;const et=c(E,x),yt=await fetch(et,{method:"GET",headers:t.headers,credentials:t.credentials,signal:ge.signal});if(!yt.ok)throw new Error(`Search request failed (${yt.status})`);Lt=await(t.parseResponse||(jt=>jt.json()))(yt)}else if(Ce!=null){const et=V(await re(Ce,x)),yt=t.filter||((Jt,jt)=>String(p(Jt)).toLowerCase().includes(jt.toLowerCase()));Lt=et.filter(Jt=>yt(Jt,x))}else Lt=[];if(f!==Ae)return;const zt=typeof t.mapResponse=="function"?t.mapResponse(Lt,x):V(Lt),Rt=V(zt);Ue&&W.set(Xe,Rt),le(Rt),he(Rt.length?0:-1),(ut=t.onResults)==null||ut.call(t,Rt,x)}catch(Lt){if((Lt==null?void 0:Lt.name)==="AbortError"||f!==Ae)return;C(Lt),le([]),he(-1),(St=t.onError)==null||St.call(t,Lt,x)}finally{f===Ae&&(D(!1),ge=null,ze())}},F=(O,k={})=>{Z&&clearTimeout(Z);const x=k.immediate?0:g();Z=setTimeout(()=>{Z=null,we(O,k)},x)},m=O=>{var x;const k=d();(x=t.onSubmit)==null||x.call(t,k,O),t.submitOnEnter!==!1&&F(k,{immediate:!0,open:!0})},L=(O,k)=>{var E;if(!O)return;const x=h(O),f=p(O);t.commitValue==="value"?N(x,{event:k}):t.commitValue!==!1&&N(f,{event:k}),(E=t.onSelect)==null||E.call(t,O,{value:x,label:f,query:d(),event:k}),t.closeOnSelect!==!1&&b()},P=O=>{const k=z();if(!k.length)return;const x=te(),f=x<0?O>0?0:k.length-1:Math.max(0,Math.min(k.length-1,x+O));he(f)},Y=O=>{const k=O==null?"":String(O),x=d().trim();if(!x||t.highlight===!1)return[document.createTextNode(k)];const f=k.toLowerCase().indexOf(x.toLowerCase());return f<0?[document.createTextNode(k)]:[document.createTextNode(k.slice(0,f)),_.mark({class:"cms-search-highlight"},k.slice(f,f+x.length)),document.createTextNode(k.slice(f+x.length))]},Ne=O=>{var f,E;const k=p(O),x=O&&typeof O=="object"?(E=(f=O.description)!=null?f:O.subtitle)!=null?E:O.note:null;return _.div({class:"cms-search-result-content"},_.div({class:"cms-search-result-label"},...Y(k)),x?_.div({class:"cms-search-result-description"},String(x)):null)},ze=()=>{!u()||Le.parentNode!==document.body||ye||(ye=requestAnimationFrame(()=>{if(ye=0,!u()||!Je.isConnected||Le.parentNode!==document.body)return;const O=Je.getBoundingClientRect(),k=6,x=8,f=Math.max(180,window.innerWidth-x*2),E=Math.min(Math.max(O.width,H(t.minMenuWidth,260)),f),Ce=Math.max(x,Math.min(O.left,window.innerWidth-E-x));Le.style.width=`${E}px`,Le.style.left=`${Ce}px`,Le.style.right="auto";const Ue=Le.getBoundingClientRect().height||0,Xe=window.innerHeight-O.bottom-k-x,q=O.top-k-x;let st=Xe<180&&q>Xe?O.top-k-Ue:O.bottom+k;st=Math.max(x,Math.min(st,window.innerHeight-Ue-x)),Le.style.top=`${st}px`}))},Ee=()=>{pe||(pe=!0,window.addEventListener("resize",ze),window.addEventListener("scroll",ze,!0))},K=()=>{pe&&(pe=!1,window.removeEventListener("resize",ze),window.removeEventListener("scroll",ze,!0))},$=()=>{Le.parentNode!==document.body&&(ye&&(cancelAnimationFrame(ye),ye=0),Le.classList.add("portal"),Le.style.display="block",document.body.appendChild(Le),Ee(),ze())},se=()=>{ye&&(cancelAnimationFrame(ye),ye=0),K(),Le.parentNode!==Je&&Je.appendChild(Le),Le.classList.remove("portal"),Le.style.display="",Le.style.position="",Le.style.top="",Le.style.left="",Le.style.right="",Le.style.width=""},je=t.label!=null||JSswift.ui.getSlot(e,"label")!=null,Be=()=>{if(!je){ce.placeholder=o(t.placeholder)||"";return}ce.placeholder=document.activeElement===ce&&o(t.placeholder)||""},ce=_.input({id:t.id,class:fe(["cms-input","cms-search-input",t.inputClass]),type:"search",name:t.name,placeholder:je?"":t.placeholder,autocomplete:t.autocomplete||"off",inputmode:t.inputmode,value:d(),disabled:ie(),readOnly:ve(),role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-controls":`${U}-list`}),Oe=_.div({id:`${U}-list`,class:"cms-search-results",role:"listbox"}),Le=_.div({class:fe(["cms-search-menu","cms-singularity-menu-select",t.menuClass,xe(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:O=>O.stopPropagation()},Oe),Je=_.div({class:fe(["cms-search",t.class]),role:"presentation"},ce,Le);let Fe=null;if(s){if(typeof s=="object"&&typeof s._bind=="function")s.action(O=>N(O,{fromModel:!0})),oe=O=>{s.value!==O&&(s.value=O)};else if(Array.isArray(s)&&typeof s[0]=="function"&&typeof s[1]=="function"){const O=s[0],k=s[1];JSswift.reactive.effect(()=>{N(O(),{fromModel:!0})},"UI.Search:model"),oe=x=>k(x)}}else Dt(t.value)&&JSswift.reactive.effect(()=>{N(o(t.value),{fromModel:!0})},"UI.Search:value");ce.addEventListener("input",O=>{N(ce.value,{event:O}),t.searchOnInput!==!1&&F(ce.value,{open:!0})}),ce.addEventListener("change",O=>{var k;return(k=t.onChange)==null?void 0:k.call(t,ce.value,O)}),ce.addEventListener("focus",O=>{var k;Be(),(k=t.onFocus)==null||k.call(t,O),t.openOnFocus!==!1&&(t.searchOnFocus&&!z().length?F(ce.value,{immediate:!0,open:!0}):Q())}),ce.addEventListener("blur",O=>{var k;Be(),(k=t.onBlur)==null||k.call(t,O)}),ce.addEventListener("keydown",O=>{if(ie()||ve())return;const k=u(),x=z(),f=te();if(O.key==="Escape"){k&&(O.preventDefault(),b());return}if(O.key==="ArrowDown"){O.preventDefault(),k?P(1):(Q(),x.length||F(ce.value,{immediate:!0,open:!0}));return}if(O.key==="ArrowUp"){O.preventDefault(),k?P(-1):Q();return}if(O.key==="Home"&&k&&x.length&&(O.metaKey||O.ctrlKey)){O.preventDefault(),he(0);return}if(O.key==="End"&&k&&x.length&&(O.metaKey||O.ctrlKey)){O.preventDefault(),he(x.length-1);return}O.key==="Enter"&&(k&&f>=0&&x[f]?(O.preventDefault(),L(x[f],O)):m(O))});const Ge=O=>{if(!Je.isConnected)return;const k=O.target;Je.contains(k)||Le.contains(k)||b()};document.addEventListener("click",Ge,!0),JSswift.reactive.effect(()=>{const O=u();Je.classList.toggle("open",O),ce.setAttribute("aria-expanded",O?"true":"false"),O?$():se()},"UI.Search:open"),JSswift.reactive.effect(()=>{const O=ie(),k=ve();Je.classList.toggle("disabled",O),Je.classList.toggle("readonly",k),ce.disabled=O,ce.readOnly=k},"UI.Search:disabled"),JSswift.reactive.effect(()=>{const O=w(),k=A(),x=z(),f=d();if(Oe.innerHTML="",ue=[],me=-1,O){const E=JSswift.ui.renderSlot(e,"loading",{query:f},t.loadingText||"Caricamento...");Oe.appendChild(_.div({class:"cms-search-empty is-loading"},...r(null,"default",{},E)))}else if(k){const E=JSswift.ui.renderSlot(e,"error",{error:k,query:f},t.errorText||"Errore ricerca");Oe.appendChild(_.div({class:"cms-search-empty is-error"},...r(null,"default",{},E)))}else if(x.length)x.forEach((E,Ce)=>{const Xe=p(E),q=h(E),We=ut=>L(E,ut),st=JSswift.ui.renderSlot(e,"result",{item:E,index:Ce,active:!1,label:Xe,value:q,query:f,select:We},Ne(E)),Ze=_.div({id:`${U}-result-${Ce}`,class:fe(["cms-search-result",""]),role:"option","aria-selected":"false",onMouseEnter:()=>he(Ce),onMouseDown:ut=>ut.preventDefault(),onClick:We},...r(null,"default",{},st));Oe.appendChild(Ze),ue[Ce]=Ze});else{const Ce=f.trim().length>=I()?t.emptyText||"Nessun risultato":t.startText||"",Ue=JSswift.ui.renderSlot(e,"empty",{query:f},Ce);(Ce||JSswift.ui.getSlot(e,"empty")!=null)&&Oe.appendChild(_.div({class:"cms-search-empty"},...r(null,"default",{},Ue)))}J()||b(),ze()},"UI.Search:render"),JSswift.reactive.effect(()=>{const O=te();O!==me&&(ue[me]&&(ue[me].classList.remove("active"),ue[me].setAttribute("aria-selected","false")),ue[O]?(ue[O].classList.add("active"),ue[O].setAttribute("aria-selected","true"),ue[O].scrollIntoView({block:"nearest"}),ce.setAttribute("aria-activedescendant",`${U}-result-${O}`)):ce.removeAttribute("aria-activedescendant"),me=O)},"UI.Search:active"),Fe=v.FormField({...t,icon:(R=t.icon)!=null?R:"search",wrapClass:fe(["cms-search-field",t.wrapClass]),control:Je,getValue:()=>d(),onClear:()=>{var O;ie()||ve()||(N("",{}),ee(),(O=t.onClear)==null||O.call(t))},onFocus:()=>ce.focus()}),ce.addEventListener("input",()=>{var O;return(O=Fe._refresh)==null?void 0:O.call(Fe)}),ce.addEventListener("change",()=>{var O;return(O=Fe._refresh)==null?void 0:O.call(Fe)}),Fe._input=ce,Fe._search=Je,Fe._open=Q,Fe._close=b,Fe._searchNow=()=>we(d(),{immediate:!0,open:!0}),Fe._getResults=z,Fe._setValue=O=>N(O,{});let He=!1;return Fe._dispose=()=>{He||(He=!0,document.removeEventListener("click",Ge,!0),Z&&clearTimeout(Z),ge&&ge.abort(),se())},(Te=JSswift._registerCleanup)==null||Te.call(JSswift,Fe,Fe._dispose),_t(ce,t,{isEnabled:()=>!ce.disabled,action:()=>Ve(ce,{selectText:!!t.selectOnShortcode})}),(t.autoSearch||t.searchOnMount)&&F(d(),{immediate:!0,open:!1}),Fe},(Li=JSswift.isDev)!=null&&Li.call(JSswift)&&(v.meta=v.meta||{},v.meta.Search={signature:"UI.Search(props)",description:"Professional search with FormField, GET fetch, debounce, AbortController, overlay results, optional cache, reactive binding, and keyboard navigation.",props:{model:"rod | [get,set] signal",value:"string | rod | [get,set] signal",endpoint:"string | (query, ctx) => string",url:"Alias of endpoint",method:"'GET' (internal)",queryParam:"string (default: 'q')",params:"object | (query, ctx) => object",headers:"object",credentials:"RequestCredentials",parseResponse:"(Response) => Promise<any>",mapResponse:"(payload, query) => Array",items:"Array | (query, ctx) => Array|Promise<Array>",options:"Local alias of items",suggestions:"Local alias of items",filter:"(item, query) => boolean",getLabel:"(item) => string",getValue:"(item) => any",minLength:"number (default: endpoint ? 1 : 0)",debounce:"number ms (default: 250)",cache:"boolean (default: true)",highlight:"boolean (default: true)",clearable:"boolean",label:"String|Node|Function",topLabel:"String|Node|Function",placeholder:"string",icon:"String|Node|Function (default: 'search')",iconRight:"String|Node|Function",shortcode:"string|Array<string>|object",showShortcode:"boolean",openOnFocus:"boolean",searchOnFocus:"boolean",searchOnInput:"boolean",searchOnMount:"boolean",autoSearch:"Alias of searchOnMount",closeOnSelect:"boolean",commitValue:"'label'|'value'|false",disabled:"boolean|Function|rod",readonly:"boolean|Function|rod",loadingText:"string",emptyText:"string",errorText:"string",startText:"string",class:"string",inputClass:"string",menuClass:"string",wrapClass:"string",style:"object"},slots:{result:"Result renderer ({ item, index, active, label, value, query, select })",empty:"Empty state ({ query })",loading:"Loading state ({ query })",error:"Error state ({ error, query })",label:"Floating label",topLabel:"Top label",prefix:"Left addon",suffix:"Right addon",icon:"Left icon",iconRight:"Right icon",shortcode:"Shortcut badge",clear:"Clear button"},events:{onInput:"(query, event)",onChange:"(query, event)",onSearch:"(query)",onResults:"(results, query)",onSelect:"(item, { value, label, query, event })",onSubmit:"(query, event)",onClear:"()",onError:"(error, query)",onFocus:"(event)",onBlur:"(event)"},keyboard:{ArrowDown:"Opens/moves to the next result",ArrowUp:"Moves to the previous result",Enter:"Selects the active result or submits the query",Escape:"Closes the overlay","Cmd/Ctrl+Home":"First result","Cmd/Ctrl+End":"Last result"},returns:"HTMLDivElement (field wrapper) with ._input, ._open(), ._close(), ._searchNow(), ._getResults(), ._setValue(value), ._dispose()"}),v.Select=(t={})=>{var Te,O;const e={...t,label:(Te=t.label)!=null?Te:t.placeholder},n=t.filterable,s=!!t.multiple||!!t.multi,i=!!t.allowCustom||!!t.allowCustomValue,d=t.slots||{},S=k=>!!k&&(typeof k=="object"&&typeof k._bind=="function"||Gt(k)),u=S(t.model)?t.model:S(t.value)?t.value:null,l=k=>Array.isArray(k)?k.slice():k==null||k===""?[]:[k],w=k=>s?l(k):k,D=u?JSswift.reactive.untracked(()=>typeof u=="object"&&typeof u._bind=="function"?u.value:u[0]()):t.value,[A,C]=JSswift.reactive.signal(!1),[z,le]=JSswift.reactive.signal(""),[te,he]=JSswift.reactive.signal(s?l(D):D!=null?D:""),[U,W]=JSswift.reactive.signal(!1),[oe,Z]=JSswift.reactive.signal([]),[ge,Ae]=JSswift.reactive.signal([]),[ye,pe]=JSswift.reactive.signal(-1);let me=null;if(u){if(typeof u=="object"&&typeof u._bind=="function")JSswift.reactive.untracked(()=>he(w(u.value))),u.action(k=>he(w(k))),me=k=>{const x=w(k);u.value!==x&&(u.value=x)};else if(Array.isArray(u)&&typeof u[0]=="function"&&typeof u[1]=="function"){const k=u[0],x=u[1];JSswift.reactive.untracked(()=>{JSswift.reactive.effect(()=>{he(w(k()))},"UI.Select:model")}),me=f=>x(w(f))}}function ue(){var k;return typeof t.disabled=="function"?t.disabled():typeof t.disabled=="boolean"?t.disabled:(k=t==null?void 0:t.disabled)!=null&&k.action?t.disabled.value:!1}function H(k){var x,f,E,Ce;if(k==null)return null;if(typeof k=="string"||typeof k=="number")return{type:"option",label:String(k),value:k,disabled:!1};if(typeof k=="object"){if(Array.isArray(k.options))return{type:"group",label:String((x=k.label)!=null?x:""),options:k.options};const Ue=(f=k.label)!=null?f:k.value!=null?String(k.value):"";return{type:"option",label:String(Ue),value:(Ce=(E=k.value)!=null?E:k.label)!=null?Ce:"",disabled:!!k.disabled}}return{type:"option",label:String(k),value:k,disabled:!1}}function ae(k){const f=(Array.isArray(k)?k:[]).map(H).filter(Boolean),E=[],Ce=[];for(const Ue of f)if(Ue.type==="group"){E.push({type:"group",label:Ue.label});const Xe=(Ue.options||[]).map(H).filter(Boolean).filter(q=>q.type==="option");for(const q of Xe)E.push(q),Ce.push(q)}else E.push(Ue),Ce.push(Ue);Z(E),Ae(Ce)}async function ie(){const k=t.options;let x;try{const f=typeof k=="function"?JSswift.ui.withoutRodPathCapture(()=>k()):k;f&&typeof f.then=="function"?(W(!0),x=await f):x=f,ae(x)}catch(f){console.error("[UI.Select] options load error:",f),ae([])}finally{W(!1)}}function ve(k){var f;const x=w(k);he(x),me&&me(x),(f=t.onChange)==null||f.call(t,x)}function I(k){const x=l(te()),E=x.some(Ce=>Ce==k)?x.filter(Ce=>Ce!=k):[...x,k];ve(E)}function g(k,x=!1){s?(I(k),x&&p()):(ve(k),h())}function p(){le(""),we&&(we.value="")}function h(){C(!1),p(),pe(-1)}async function V(){if(ue())return;C(!0),await ie();const k=te(),x=ge();let f=-1;if(s){const E=l(k);for(const Ce of E)if(f=x.findIndex(Ue=>Ue.value==Ce&&!Ue.disabled),f>=0)break}else f=x.findIndex(E=>E.value==k&&!E.disabled);f<0&&(f=x.findIndex(E=>!E.disabled)),pe(f),we&&setTimeout(()=>we.focus(),0)}function re(){A()?h():V()}const c=_.div({class:fe(["cms-select",s?"multiple":"",t.class]),tabIndex:ue()?-1:0,role:"combobox","aria-expanded":"false","aria-disabled":ue()?"true":"false"}),N=_.div({class:fe(["cms-select-value",s?"cms-select-value-multi":""])});JSswift.reactive.effect(()=>{const k=ge();if(N.innerHTML="",s){const x=l(te());for(const f of x){const E=k.find(q=>q.value==f),Ce=E?E.label:f==null?"":String(f);let Ue=!1;const Xe=v.Chip({label:Ce,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:q=>{var We,st,Ze;(We=q==null?void 0:q.preventDefault)==null||We.call(q),(st=q==null?void 0:q.stopPropagation)==null||st.call(q),(Ze=q==null?void 0:q.stopImmediatePropagation)==null||Ze.call(q),!Ue&&(Ue=!0,I(f))}});N.appendChild(Xe)}}else{const x=te(),f=k.find(E=>E.value==x);N.textContent=f?f.label:x==null||x===""?"":String(x)}},"UI.Select:value");const b=_.div({class:"cms-select-arrow"});JSswift.reactive.effect(()=>{const k=JSswift.ui.renderSlot(d,"arrow",{open:A()},v.Icon("#chevron-down"));b.innerHTML="",r(null,"default",{},k).forEach(x=>b.appendChild(x))},"UI.Select:arrow");const J=_.div({class:"cms-select-control",onClick:re},N,b),Q=_.div({class:"cms-select-options",role:"listbox","aria-multiselectable":s?"true":"false"}),ee=_.div({class:"cms-select-filter cms-d-none"});let we=null;const F=_.input({class:"cms-input",type:"text",placeholder:t.filterPlaceholder||"Cerca...",onInput:k=>le(k.target.value||"")}),m=()=>{const k=JSswift.ui.renderSlot(d,"filter",{value:z(),setValue:f=>{const E=f==null?"":String(f);le(E),we&&"value"in we&&(we.value=E)},close:h},F);ee.innerHTML="";const x=r(null,"default",{},k);x.forEach(f=>ee.appendChild(f)),we=x.length===1&&x[0]&&x[0].tagName==="INPUT"?x[0]:null,we&&(we.value=z()||"")};JSswift.reactive.untracked(m),JSswift.reactive.effect(()=>{const k=z()||"";we&&"value"in we&&we.value!==k&&(we.value=k)},"UI.Select:filterValue"),typeof n=="boolean"?n?ee.classList.remove("cms-d-none"):ee.classList.add("cms-d-none"):n!=null&&n.action&&(n.action(k=>{k?ee.classList.remove("cms-d-none"):ee.classList.add("cms-d-none")}),n.value?ee.classList.remove("cms-d-none"):ee.classList.add("cms-d-none"));const L={...t};xn(L);const P=Et([L.color,L.state],()=>{const k=o(L.color)||o(L.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(k)?k:o(L.state)||""}),Y=_.div({class:fe(["cms-select-menu","cms-singularity-menu-select",P,L.class,xe(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:k=>k.stopPropagation()},ee,Q);let Ne=0,ze=!1;const Ee=()=>{!A()||Y.parentNode!==document.body||Ne||(Ne=requestAnimationFrame(()=>{if(Ne=0,!A()||!c.isConnected||Y.parentNode!==document.body)return;const k=c.getBoundingClientRect(),x=6,f=8,E=Math.max(160,window.innerWidth-f*2),Ce=Math.min(Math.max(k.width,180),E),Ue=Math.max(f,Math.min(k.left,window.innerWidth-Ce-f));Y.style.width=`${Ce}px`,Y.style.left=`${Ue}px`,Y.style.right="auto",Y.style.marginTop="0";const Xe=Y.getBoundingClientRect().height||0,q=window.innerHeight-k.bottom-x-f,We=k.top-x-f;let Ze=q<180&&We>q?k.top-x-Xe:k.bottom+x;Ze=Math.max(f,Math.min(Ze,window.innerHeight-Xe-f)),Y.style.top=`${Ze}px`}))},K=()=>{ze||(ze=!0,window.addEventListener("resize",Ee),window.addEventListener("scroll",Ee,!0))},$=()=>{ze&&(ze=!1,window.removeEventListener("resize",Ee),window.removeEventListener("scroll",Ee,!0))},se=()=>{Y.parentNode!==document.body&&(Ne&&(cancelAnimationFrame(Ne),Ne=0),Y.classList.add("portal"),Y.style.display="block",document.body.appendChild(Y),K(),Ee())},je=()=>{Ne&&(cancelAnimationFrame(Ne),Ne=0),$(),Y.parentNode!==c&&c.appendChild(Y),Y.classList.remove("portal"),Y.style.display="",Y.style.position="",Y.style.top="",Y.style.left="",Y.style.right="",Y.style.width="",Y.style.marginTop=""};c.appendChild(J),c.appendChild(Y),JSswift.reactive.effect(()=>{const k=A();c.classList.toggle("open",k),c.setAttribute("aria-expanded",k?"true":"false"),k?se():je()},"UI.Select:open"),JSswift.reactive.effect(()=>{const k=ue();c.classList.toggle("disabled",k),c.tabIndex=k?-1:0,c.setAttribute("aria-disabled",k?"true":"false")},"UI.Select:disabled");let Be=[],ce=-1,Oe=-1;function Le(){var x;const k=ye();Oe=k,k!==ce&&(Be[ce]&&Be[ce].classList.remove("active"),Be[k]&&Be[k].classList.add("active"),ce=k,k>=0&&((x=Be[k])==null||x.scrollIntoView({block:"nearest"})))}JSswift.reactive.effect(()=>{const k=oe(),x=ge(),f=(z()||"").toLowerCase().trim(),E=te(),Ce=s?l(E):[E],Ue=U(),Xe=Oe;Q.innerHTML="",Be=[],ce=-1;const q=[];let We=0;const st=Ze=>{const ut=Ce.some(Jt=>Jt==Ze.value),St=!!Ze.disabled,Lt=["cms-select-option",ut?"selected":"",St?"disabled":""].filter(Boolean).join(" "),zt=()=>{s?I(Ze.value):(ve(Ze.value),h())},Rt=JSswift.ui.renderSlot(d,"option",{opt:Ze,selected:ut,active:We===Xe,disabled:St,select:zt},Ze.label),et=r(null,"default",{},Rt),yt=_.div({class:Lt,"data-flat-index":String(We),onClick:St?null:zt},...et);q.push(yt),Be[We]=yt,We++};if(f){const Ze=x.filter(ut=>ut.label.toLowerCase().includes(f));if(Ze.length===0){const ut=JSswift.ui.renderSlot(d,"empty",{filter:f},t.emptyText||"Nessuna opzione");Q.appendChild(_.div({class:"cms-select-empty"},...r(null,"default",{},ut))),A()&&Ee();return}for(const ut of Ze)st(ut)}else{let Ze=!1;for(const ut of k)if(ut.type==="group"){const St=JSswift.ui.renderSlot(d,"group",{label:ut.label},ut.label);q.push(_.div({class:"cms-select-group"},...r(null,"default",{},St)))}else Ze=!0,st(ut);if(!Ze){const ut=JSswift.ui.renderSlot(d,"empty",{filter:f},t.emptyText||"Nessuna opzione");Q.appendChild(_.div({class:"cms-select-empty"},...r(null,"default",{},ut))),A()&&Ee();return}}if(Ue){const Ze=JSswift.ui.renderSlot(d,"loading",{},"Caricamento...");Q.appendChild(_.div({class:"cms-select-empty"},...r(null,"default",{},Ze))),A()&&Ee();return}for(const Ze of q)Q.appendChild(Ze);Le(),A()&&Ee()},"UI.Select:render"),JSswift.reactive.effect(()=>{Le()},"UI.Select:paintActive");const Je=k=>{if(!c.isConnected)return;const x=k.target;c.contains(x)||Y.contains(x)||h()};document.addEventListener("click",Je,!0);const Fe=k=>{if(ue())return;const x=A(),f=ge(),E=ye(),Ce=we&&k.target===we,Ue=(q,We)=>{let st=q;for(;st>=0&&st<f.length;){if(!f[st].disabled)return st;st+=We}return-1},Xe=q=>{if(!q)return null;const We=q.toLowerCase();let st=f.find(Ze=>String(Ze.label).toLowerCase()===We||String(Ze.value).toLowerCase()===We);return st||(st=f.find(Ze=>String(Ze.label).toLowerCase().includes(We))),st&&!st.disabled?st:null};if(k.key==="Escape"){x&&(k.preventDefault(),h());return}if(Ce&&(k.key==="Enter"||k.key===" ")){const q=(z()||"").trim();if(q){const We=Xe(q);if(We){k.preventDefault(),g(We.value,!0);return}if(i&&k.key==="Enter"){k.preventDefault(),g(q,!0);return}if(k.key==="Enter"){k.preventDefault();return}}if(k.key===" ")return}if(k.key==="Enter"||k.key===" "){if(k.preventDefault(),!x){V();return}E>=0&&f[E]&&!f[E].disabled&&(s?I(f[E].value):(ve(f[E].value),h()));return}if(k.key==="ArrowDown"){if(k.preventDefault(),!x){V();return}const q=Ue(E<0?0:E+1,1);q>=0&&pe(q);return}if(k.key==="ArrowUp"){if(k.preventDefault(),!x){V();return}const q=Ue(E<0?f.length-1:E-1,-1);q>=0&&pe(q);return}if(k.key==="Home"){if(!x)return;k.preventDefault();const q=Ue(0,1);q>=0&&pe(q);return}if(k.key==="End"){if(!x)return;k.preventDefault();const q=Ue(f.length-1,-1);q>=0&&pe(q);return}};c.addEventListener("keydown",Fe),ee.addEventListener("keydown",Fe);let Ge=!1;c._dispose=()=>{Ge||(Ge=!0,document.removeEventListener("click",Je,!0),c.removeEventListener("keydown",Fe),ee.removeEventListener("keydown",Fe),je())};const He=()=>{const k=te();return s?Array.isArray(k)&&k.length>0:k==null?!1:k!==""?!0:ge().some(x=>x.value==="")},R=v.FormField({...e,control:c,clearable:t.clearable,disabled:ue(),readonly:!1,hasValue:He,getValue:()=>{const k=te();return s?Array.isArray(k)&&k.length?k:"":k},onClear:()=>{ue()||(ve(s?[]:null),h())},onFocus:()=>{V()}});return JSswift.reactive.effect(()=>{var k;(k=R._refresh)==null||k.call(R)},"UI.Select:fieldRefresh"),R._select=c,R._dispose=c._dispose,(O=JSswift._registerCleanup)==null||O.call(JSswift,R,R._dispose),_t(R,t,{isEnabled:()=>!ue(),action:()=>{if(ue())return!1;Ve(c),V()}}),ie(),R},(Ii=JSswift.isDev)!=null&&Ii.call(JSswift)&&(v.meta=v.meta||{},v.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)",placeholder:"String|Node|Function (alias of label when label is not set)",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",shortcode:"string|Array<string>|object",showShortcode:"boolean",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)",shortcode:"Shortcut badge (via FormField slots.shortcode)",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()"}),v.Upload=(t={})=>{var He;xn(t);const e=t.slots||{},[n,s]=JSswift.reactive.signal([]),[i,d]=JSswift.reactive.signal(!1),[S,u]=JSswift.reactive.signal(!1),[l,w]=JSswift.reactive.signal(null);let D=0,A=!1;const C=()=>!!o(t.disabled)||!!o(t.readonly),z=()=>t.multiple!==!1&&t.single!==!0,le=()=>{var R,Te;return["form","native","submit","external"].includes(String(o((Te=(R=t.submitMode)!=null?R:t.modeSubmit)!=null?Te:t.uploadMode)||"").toLowerCase())},te=()=>{var R;return o((R=t.showBrowse)!=null?R:t.browseButton)!==!1},he=()=>{var R;return!le()&&o((R=t.showUpload)!=null?R:t.uploadButton)!==!1},U=()=>{var R;return o((R=t.showClear)!=null?R:t.clearButton)!==!1},W=()=>{var R;return o((R=t.showFiles)!=null?R:t.files)!==!1},oe=()=>{const R=Vt(o(t.state)||o(t.status));return R?`cms-state-${R}`:""},Z=()=>t.fieldName||t.paramName||t.name||"file",ge=()=>{var R;return Math.max(1,Number(o((R=t.parallelUploads)!=null?R:t.parallel)||1))},Ae=()=>{var Te,O,k,x;const R=o(t.retry);return R===!0?{attempts:2,delay:350,factor:2}:R?{attempts:Math.max(0,Number((O=(Te=R.attempts)!=null?Te:R.retries)!=null?O:0)),delay:Math.max(0,Number((k=R.delay)!=null?k:350)),factor:Math.max(1,Number((x=R.factor)!=null?x:2))}:{attempts:0,delay:350,factor:2}},ye=R=>R?Array.isArray(R)?R:Array.from(R):[],pe=R=>{const Te=Number(R||0);return Te<1024?`${Te} B`:Te<1024*1024?`${(Te/1024).toFixed(1)} KB`:Te<1024*1024*1024?`${(Te/1024/1024).toFixed(1)} MB`:`${(Te/1024/1024/1024).toFixed(1)} GB`},me=()=>{var R;return String(o((R=t.acceptedFiles)!=null?R:t.accept)||"").trim()},ue=R=>{const Te=me();if(!Te)return!0;const O=String(R.name||"").toLowerCase(),k=String(R.type||"").toLowerCase();return Te.split(",").map(x=>x.trim().toLowerCase()).filter(Boolean).some(x=>x.startsWith(".")?O.endsWith(x):x.endsWith("/*")?k.startsWith(x.slice(0,-1)):k===x)},H=()=>n().filter(R=>R.status!=="rejected"&&R.status!=="removed"),ae=(R=0)=>H().reduce((Te,O)=>Te+Number(O.size||0),R),ie=()=>{var R;s(n().slice()),$.classList.toggle("is-busy",n().some(Te=>Te.status==="uploading")),$.classList.toggle("has-files",n().some(Te=>Te.status!=="removed")),(R=t.onChange)==null||R.call(t,n().slice(),se)},ve=(R,Te,O=null)=>{var x;const k={id:`upload_${Date.now()}_${++D}`,file:R,name:(R==null?void 0:R.name)||"file",size:Number((R==null?void 0:R.size)||0),type:(R==null?void 0:R.type)||"",status:"rejected",progress:0,error:Te,detail:O,attempts:0,response:null,xhr:null};return n().push(k),(x=t.onRejected)==null||x.call(t,k,{reason:Te,detail:O,api:se}),k},I=async(R,Te)=>{const O=t.maxFiles==null?null:Number(o(t.maxFiles)),k=t.maxFileSize==null?null:Number(o(t.maxFileSize)),x=t.minFileSize==null?null:Number(o(t.minFileSize)),f=t.maxTotalSize==null?null:Number(o(t.maxTotalSize));if(O!=null&&Te>O)return"max-files";if(k!=null&&Number(R.size||0)>k)return"max-file-size";if(x!=null&&Number(R.size||0)<x)return"min-file-size";if(f!=null&&ae(Number(R.size||0))>f)return"max-total-size";if(!ue(R))return"accept";const E=t.filter||t.acceptFile||t.validate;if(typeof E=="function"){const Ce=await E(R,{files:n().slice(),api:se});if(Ce===!1)return"filter";if(typeof Ce=="string")return Ce}return null},g=async()=>{for(const R of n()){if(R.status!=="rejected"||R.error!=="max-files")continue;const Te=await I(R.file,H().length+1);if(Te){R.error=Te;continue}R.status="queued",R.progress=0,R.error=null,R.detail=null}},p=R=>({id:`upload_${Date.now()}_${++D}`,file:R,name:(R==null?void 0:R.name)||"file",size:Number((R==null?void 0:R.size)||0),type:(R==null?void 0:R.type)||"",status:"queued",progress:0,bytesUploaded:0,error:null,detail:null,attempts:0,response:null,xhr:null}),h=async(R,Te={})=>{var x;if(C())return[];w(null);const O=ye(R),k=[];!z()&&O.length&&V({silent:!0});for(const f of O){const E=await I(f,H().length+1);if(E){ve(f,E);continue}const Ce=p(f);if(n().push(Ce),k.push(Ce),(x=t.onAdded)==null||x.call(t,Ce,{file:f,meta:Te,api:se}),!z())break}return ie(),k.length&&t.autoUpload&&!le()&&m(),k},V=(R={})=>{var Te;for(const O of n())O.status==="uploading"&&c(O),O.status="removed";s([]),w(null),ie(),R.silent||(Te=t.onClear)==null||Te.call(t,se)},re=async R=>{var k;const Te=typeof R=="string"?n().find(x=>x.id===R):R;if(!Te)return;Te.status==="uploading"&&c(Te);const O=n().filter(x=>x!==Te);s(O),await g(),ie(),(k=t.onRemove)==null||k.call(t,Te,{api:se})},c=R=>{var O,k,x;const Te=typeof R=="string"?n().find(f=>f.id===R):R;!Te||Te.status!=="uploading"||(Te.status="canceled",Te.error="canceled",(k=(O=Te.xhr)==null?void 0:O.abort)==null||k.call(O),(x=t.onCancel)==null||x.call(t,Te,{api:se}),ie())},N=()=>n().filter(R=>R.status==="uploading").forEach(c),b=async R=>{var O,k;const Te={url:o(t.url),method:o(t.method||"POST"),headers:t.headers,formFields:t.formFields||t.fields,fieldName:Z(),withCredentials:!!o((O=t.withCredentials)!=null?O:t.credentials),sendRaw:!!o(t.sendRaw)};if(typeof t.factory=="function")try{const x=await t.factory(R.file,{item:R,files:n().slice(),api:se});if(x&&typeof x=="object")Object.assign(Te,x);else if(x!=null)throw new Error("factory must return an object")}catch(x){throw(k=t.onFactoryFailed)==null||k.call(t,x,{item:R,api:se}),x}return Te},J=(R,Te,O)=>{const k=typeof Te=="function"?Te(O.file,{item:O,api:se}):Te;k&&(k instanceof Headers?k.forEach((x,f)=>R.setRequestHeader(f,x)):Array.isArray(k)?k.forEach(x=>{Array.isArray(x)?R.setRequestHeader(x[0],x[1]):x!=null&&x.name&&R.setRequestHeader(x.name,x.value)}):typeof k=="object"&&Object.keys(k).forEach(x=>R.setRequestHeader(x,k[x])))},Q=(R,Te,O)=>{const k=typeof Te=="function"?Te(O.file,{item:O,api:se}):Te;k&&(Array.isArray(k)?k.forEach(x=>{Array.isArray(x)?R.append(x[0],x[1]):x!=null&&x.name&&R.append(x.name,x.value)}):typeof k=="object"&&Object.keys(k).forEach(x=>R.append(x,k[x])))},ee=(R,Te)=>new Promise((O,k)=>{if(!Te.url){k(new Error("UI.Upload: url is required"));return}if(typeof XMLHttpRequest!="function"){k(new Error("UI.Upload: XMLHttpRequest is not available"));return}const x=new XMLHttpRequest;R.xhr=x,x.open(String(Te.method||"POST").toUpperCase(),Te.url,!0),x.withCredentials=!!Te.withCredentials,J(x,Te.headers,R),x.upload.onprogress=E=>{var Ce;E.lengthComputable&&(R.bytesUploaded=E.loaded,R.progress=Math.max(0,Math.min(100,Math.round(E.loaded/E.total*100))),(Ce=t.onProgress)==null||Ce.call(t,R,{event:E,api:se}),ie())},x.onload=()=>{const E=x.status>=200&&x.status<300,Ce={status:x.status,text:x.responseText,xhr:x};E?O(Ce):k(Object.assign(new Error(`HTTP error ${x.status}`),{response:Ce}))},x.onerror=()=>k(new Error("network-error")),x.onabort=()=>k(new Error("canceled"));const f=Te.sendRaw?R.file:(()=>{const E=new FormData;return Q(E,Te.formFields,R),E.append(Te.fieldName||"file",R.file,R.name),E})();x.send(f)}),we=async R=>{var k,x,f,E,Ce,Ue;const Te=Ae();let O=Te.delay;R.status="uploading",R.error=null,R.progress=Math.max(0,R.progress||0),(k=t.onStart)==null||k.call(t,R,{api:se}),ie();for(let Xe=0;Xe<=Te.attempts;Xe++){R.attempts=Xe+1;try{const q=await b(R),We=typeof t.upload=="function"||typeof t.uploader=="function"?await(t.upload||t.uploader)(R.file,{item:R,options:q,progress:st=>{var Ze;R.progress=Math.max(0,Math.min(100,Number(st)||0)),(Ze=t.onProgress)==null||Ze.call(t,R,{api:se}),ie()},api:se}):await ee(R,q);return R.status="done",R.progress=100,R.response=We,R.xhr=null,(x=t.onSuccess)==null||x.call(t,R,{response:We,api:se}),(f=t.onComplete)==null||f.call(t,R,{response:We,api:se}),ie(),R}catch(q){if(String((q==null?void 0:q.message)||q)==="canceled"||R.status==="canceled")return R.status="canceled",R.error="canceled",R.xhr=null,(E=t.onComplete)==null||E.call(t,R,{error:q,api:se}),ie(),R;if(Xe<Te.attempts){await new Promise(We=>setTimeout(We,O)),O=Math.round(O*Te.factor);continue}return R.status="error",R.error=q,R.xhr=null,w(q),(Ce=t.onError)==null||Ce.call(t,R,{error:q,api:se}),(Ue=t.onComplete)==null||Ue.call(t,R,{error:q,api:se}),ie(),R}}return R},F=()=>{var k;if(A||C())return;const R=n().filter(x=>x.status==="uploading").length,Te=Math.max(0,ge()-R),O=n().filter(x=>x.status==="queued").slice(0,Te);if(!O.length){const x=n().some(f=>f.status==="uploading");u(x),x||(k=t.onFinish)==null||k.call(t,n().slice(),{api:se});return}u(!0),O.forEach(x=>{we(x).finally(()=>F())})},m=(R=null)=>{(R?ye(R):n().filter(O=>["queued","error","canceled"].includes(O.status))).forEach(O=>{const k=typeof O=="string"?n().find(x=>x.id===O):O;k&&k.status!=="uploading"&&k.status!=="done"&&k.status!=="rejected"&&(k.status="queued",k.progress=0,k.error=null)}),ie(),F()},L=R=>m([R]),P=()=>{C()||Y.click()},Y=_.input({type:"file",class:"cms-upload-input",name:Z(),accept:me()||null,multiple:z(),capture:t.capture||null,disabled:C(),onChange:R=>{h(R.target.files,{event:R,source:"browse"}),R.target.value=""}}),Ne=_.div({class:"cms-upload-list"}),ze=_.div({class:"cms-upload-summary"}),Ee=_.div({class:"cms-upload-actions"});let K=oe();const $=_.div({class:fe(["cms-upload","cms-singularity",K,xe(t.box||t.variant==="box","cms-upload-box"),xe(t.compact,"is-compact"),xe(le(),"is-form-mode"),xe(!W(),"is-files-hidden"),t.class]),tabindex:C()?"-1":"0",role:"group","aria-disabled":C()?"true":"false"}),se={addFiles:h,browse:P,upload:m,retry:L,retryAll:()=>m(n().filter(R=>R.status==="error"||R.status==="canceled")),remove:re,clear:V,abort:c,abortAll:N,files:()=>n().slice(),state:()=>({files:n().slice(),busy:S(),dragging:i(),error:l()}),reset:V},je=()=>{const R={api:se,files:n().slice(),busy:S(),disabled:C(),submitMode:le()?"form":"upload"},Te=[];return te()&&Te.push(JSswift.ui.renderSlot(e,"browse",R,v.Btn({size:"sm",icon:"folder_open",label:t.browseText||"Browse",onClick:P}))),he()&&Te.push(JSswift.ui.renderSlot(e,"upload",R,v.Btn({size:"sm",color:"primary",icon:"upload",label:t.uploadText||"Upload",loading:S(),disabled:C()||!n().some(O=>["queued","error","canceled"].includes(O.status)),onClick:()=>m()}))),U()&&Te.push(JSswift.ui.renderSlot(e,"clear",R,v.Btn({size:"sm",color:"secondary",outline:!0,icon:"delete",label:t.clearText||"Clear",disabled:C()||!n().length,onClick:()=>V()}))),r(e,"actions",R,Te)},Be=(R,Te)=>{var f;const O={item:R,file:R.file,index:Te,api:se,remove:()=>re(R),retry:()=>L(R),abort:()=>c(R)},k=_.div({class:fe(["cms-upload-file",`is-${R.status}`])},_.div({class:"cms-upload-file-icon"},v.Icon({name:R.status==="done"?"check_circle":R.status==="error"||R.status==="rejected"?"error":"description"})),_.div({class:"cms-upload-file-main"},_.div({class:"cms-upload-file-name"},...r(e,"fileName",O,R.name)),_.div({class:"cms-upload-file-meta"},...r(e,"fileMeta",O,R.error?String(((f=R.error)==null?void 0:f.message)||R.error):R.status==="queued"?"Queued":R.status)),_.div({class:"cms-upload-progress",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":String(R.progress||0)},_.div({class:"cms-upload-progress-bar",style:{width:`${R.progress||0}%`}}))),_.div({class:"cms-upload-file-trailing"},_.div({class:"cms-upload-file-size"},pe(R.size)),_.div({class:"cms-upload-file-actions"},...r(e,"fileActions",O,[R.status==="uploading"?v.Btn({size:"sm",outline:!0,icon:"close","aria-label":"Cancel",onClick:()=>c(R)}):null,R.status==="error"||R.status==="canceled"?v.Btn({size:"sm",outline:!0,icon:"refresh","aria-label":"Retry",onClick:()=>L(R)}):null,v.Btn({size:"sm",dense:!0,outline:!0,icon:"delete","aria-label":"Remove",onClick:()=>re(R)})])))),x=JSswift.ui.renderSlot(e,"file",O,k);return _.div({class:"cms-upload-file-wrap","data-status":R.status,"data-id":R.id},...r(null,"default",{},x))},ce=()=>{const R=n();if(Ee.replaceChildren(...je()),Ne.replaceChildren(),ze.hidden=!W(),Ne.hidden=!W(),R.length)R.forEach((O,k)=>Ne.appendChild(Be(O,k)));else{const O=JSswift.ui.renderSlot(e,"empty",{api:se},t.emptyText||"No files selected");Ne.appendChild(_.div({class:"cms-upload-empty"},...r(null,"default",{},O)))}const Te=R.filter(O=>O.status!=="rejected"&&O.status!=="removed");ze.textContent=`${Te.length} file \u2022 ${pe(Te.reduce((O,k)=>O+Number(k.size||0),0))}`},Oe=JSswift.ui.renderSlot(e,"icon",{api:se},v.Icon({name:t.icon||"cloud_upload"})),Le=JSswift.ui.renderSlot(e,"title",{api:se},t.title||"Upload files"),Je=JSswift.ui.renderSlot(e,"subtitle",{api:se},t.subtitle||(me()?`Accepted: ${me()}`:"Drag files here or browse from your device")),Fe=_.div({class:"cms-upload-dropzone",onClick:R=>{var Te,O;(O=(Te=R.target)==null?void 0:Te.closest)!=null&&O.call(Te,".cms-upload-actions, .cms-upload-list")||t.clickable!==!1&&P()},onDragenter:R=>{t.drag===!1||C()||(R.preventDefault(),d(!0),$.classList.add("is-dragging"))},onDragover:R=>{t.drag===!1||C()||R.preventDefault()},onDragleave:R=>{R.currentTarget===R.target&&(d(!1),$.classList.remove("is-dragging"))},onDrop:R=>{var Te,O;t.drag===!1||C()||(R.preventDefault(),d(!1),$.classList.remove("is-dragging"),(Te=t.onDrop)==null||Te.call(t,R,{api:se}),h(((O=R.dataTransfer)==null?void 0:O.files)||[],{event:R,source:"drop"}))}},_.div({class:"cms-upload-head"},_.div({class:"cms-upload-icon"},...r(null,"default",{},Oe)),_.div({class:"cms-upload-copy"},_.div({class:"cms-upload-title"},...r(null,"default",{},Le)),_.div({class:"cms-upload-subtitle"},...r(null,"default",{},Je))),Ee),ze,Ne),Ge=JSswift.ui.renderSlot(e,"header",{api:se},null);return r(null,"default",{},Ge).forEach(R=>$.appendChild(R)),$.appendChild(Y),r(e,"default",{api:se,dropzone:Fe},Fe).forEach(R=>$.appendChild(R)),JSswift.reactive.effect(()=>{ce()},"UI.Upload:render"),JSswift.reactive.effect(()=>{$.classList.toggle("is-disabled",C()),$.classList.toggle("is-form-mode",le()),$.classList.toggle("is-files-hidden",!W());const R=oe();R!==K&&(K&&$.classList.remove(K),R&&$.classList.add(R),K=R),$.setAttribute("aria-disabled",C()?"true":"false"),Y.disabled=C(),Y.multiple=z(),Y.name=Z()},"UI.Upload:disabled"),$._upload=se,$._addFiles=h,$._browse=P,$._uploadFiles=m,$._input=Y,$._dispose=()=>{A||(A=!0,N())},(He=JSswift._registerCleanup)==null||He.call(JSswift,$,$._dispose),$},v.BoxUpload=(t={})=>v.Upload({...t,box:!0}),v.boxUpload=(t={})=>v.BoxUpload(t),JSswift.ui.Upload=v.Upload,JSswift.ui.BoxUpload=v.BoxUpload,JSswift.ui.boxUpload=v.boxUpload,(Ei=JSswift.isDev)!=null&&Ei.call(JSswift)&&(v.meta=v.meta||{},v.meta.Upload={signature:"UI.Upload(props)",description:"Professional uploader with drag/drop, validation, queue, retry, factory options, XHR progress, custom upload and slot-based rendering.",props:{url:"string",method:"POST|PUT|PATCH|string",fieldName:"string",paramName:"Alias of fieldName",headers:"object|Array|Headers|(file, ctx)=>headers",formFields:"object|Array|(file, ctx)=>fields",factory:"(file, ctx)=>object|Promise<object>",upload:"(file, ctx)=>Promise<any> custom uploader",multiple:"boolean",accept:"string",acceptedFiles:"Alias of accept",maxFiles:"number",maxFileSize:"number bytes",maxTotalSize:"number bytes",autoUpload:"boolean",parallelUploads:"number",retry:"boolean|{ attempts, delay, factor }",withCredentials:"boolean",sendRaw:"boolean",submitMode:'"upload"|"form"',uploadMode:"Alias of submitMode",showBrowse:"boolean",showUpload:"boolean",showClear:"boolean",showFiles:"boolean",browseButton:"Alias of showBrowse",uploadButton:"Alias of showUpload",clearButton:"Alias of showClear",drag:"boolean",clickable:"boolean",box:"boolean",compact:"boolean",color:"semantic state or CSS color",status:"semantic state alias",state:"semantic state alias",title:"String|Node|Function",subtitle:"String|Node|Function",emptyText:"string",slots:"{ header?, default?, icon?, title?, subtitle?, actions?, browse?, upload?, clear?, file?, fileName?, fileMeta?, fileActions?, empty? }"},slots:{header:"Content before the uploader",default:"Dropzone override (ctx: { api, dropzone })",icon:"Main icon",title:"Title content",subtitle:"Subtitle content",actions:"Actions area",browse:"Browse button",upload:"Upload button",clear:"Clear button",file:"Full file row renderer",fileName:"File name slot",fileMeta:"Status/error slot",fileActions:"Per-file actions",empty:"Empty list state"},events:["change","added","rejected","remove","start","progress","success","error","complete","finish","cancel","drop","factoryFailed"],returns:"HTMLDivElement with ._upload API, ._addFiles(files), ._uploadFiles(), ._browse(), ._dispose()"},v.meta.BoxUpload={...v.meta.Upload,signature:"UI.BoxUpload(props)",description:"Box-styled variant of UI.Upload."},v.meta.boxUpload=v.meta.BoxUpload);function bn(t,e){if(!t)return null;if(typeof t=="object"&&typeof t._bind=="function")return{get:()=>t.value,set:n=>{t.value!==n&&(t.value=n)},watch:n=>{typeof t.action=="function"&&t.action(n)}};if(Array.isArray(t)&&typeof t[0]=="function"&&typeof t[1]=="function"){const n=t[0],s=t[1];return{get:n,set:s,watch:i=>mt.reactive.effect(()=>{i(n())},e||"UI:model")}}return null}const Zo={classic:{side:"left",nav:"top",rows:["header","nav","body","footer"]},classicright:{side:"right",nav:"top",rows:["header","nav","body","footer"]},sidebarfullleft:{side:"left",fullSide:!0,nav:"top",rows:["header","nav","body","footer"]},sidebarfullright:{side:"right",fullSide:!0,nav:"top",rows:["header","nav","body","footer"]},appshell:{side:"left",nav:"top",rows:["header","nav","body","footer"]},dashboard:{side:"left",nav:"top",rows:["header","nav","body","footer"]},website:{side:null,nav:"top",rows:["header","nav","body","footer"]},documentation:{side:"right",nav:"left",rows:["header","body","footer"]},landing:{side:null,nav:null,rows:["header","body","footer"]}},Yr=t=>{const e=o(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},Xr=(t,e)=>{if(!t||!e.main)return null;const n=t.side||(e.aside?"left":null),s=t.nav||(e.nav?"top":null),i=!!e.aside&&!!n,d=!!e.nav&&!!s,l=[d&&s==="left"?"nav":i&&n==="left"?"aside":".","main",d&&s==="right"?"nav":i&&n==="right"?"aside":"."],w=[],D=[...t.rows||[]];if(d&&s==="top"&&!D.includes("nav")){const A=D.indexOf("body");D.splice(A>=0?A:D.length,0,"nav")}for(const A of D)A==="header"&&e.header?w.push(t.fullSide&&i&&n==="left"?["aside","header","header"]:t.fullSide&&i&&n==="right"?["header","header","aside"]:["header","header","header"]):A==="nav"&&d&&s==="top"?w.push(t.fullSide&&i&&n==="left"?["aside","nav","nav"]:t.fullSide&&i&&n==="right"?["nav","nav","aside"]:["nav","nav","nav"]):A==="body"?w.push(l):A==="footer"&&e.footer&&w.push(t.fullSide&&i&&n==="left"?["aside","footer","footer"]:t.fullSide&&i&&n==="right"?["footer","footer","aside"]:["footer","footer","footer"]);return w.length?w.map(A=>`"${A.join(" ")}"`).join(" "):null};v.Layout=(...t)=>{var hs,is,rs;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(qe,gt)=>!!qe&&Object.prototype.hasOwnProperty.call(qe,gt),d=()=>typeof window=="undefined"?1024:window.innerWidth,S=()=>{const qe=d(),gt=JSswift.uiResponsivePropsFor(e,Ot("mobile"))||{},Mt=qe>=768?JSswift.uiResponsivePropsFor(e,Ot("tablet"))||{}:{},Yt=qe>=1024?JSswift.uiResponsivePropsFor(e,Ot("pc"))||{}:{};return{...gt,...Mt,...Yt}},u=(...qe)=>{for(const gt of qe)if(i(e,gt))return e[gt]},l=(...qe)=>{const gt=S();for(const Mt of qe)if(i(gt,Mt))return gt[Mt];return u(...qe)},w=(...qe)=>{const gt=JSswift.uiResponsivePropsFor(e,Ot(K()))||{};for(const Mt of qe)if(i(gt,Mt))return gt[Mt];return u(...qe)},D=()=>Yr(w("disposition","layoutDisposition","layout")),A=()=>{const qe=o(l("mode","layoutMode"));if(qe==null||qe===!1||qe==="")return"";const gt=String(qe).trim().toLowerCase();return gt==="global"||gt==="local"?gt:""},C=(qe,gt=null)=>qe==null||qe===!1||qe===""?gt:typeof qe=="number"?`${qe}px`:String(qe),z=(qe,gt=null)=>{if(qe==null||qe===!1||qe==="")return gt;if(typeof qe=="number"&&Number.isFinite(qe))return qe;const Mt=Number.parseFloat(String(qe));return Number.isFinite(Mt)?Mt:gt},le=qe=>{const gt=o(qe);return gt==null||gt===!1||gt===""?null:Array.isArray(gt)?gt.map(Mt=>`"${Array.isArray(Mt)?Mt.join(" "):String(Mt)}"`).join(" "):String(gt)},te=(qe,gt=null,Mt=null)=>{let Yt=Number.isFinite(qe)?qe:0;return Number.isFinite(gt)&&(Yt=Math.max(gt,Yt)),Number.isFinite(Mt)&&(Yt=Math.min(Mt,Yt)),Yt},he=u("header","headerContent"),U=u("aside","drawer"),W=u("nav","asideRight","drawerRight"),oe=u("page","main","content","body"),Z=u("footer","footerContent"),ge=()=>o(l("drawerEnabled","asideEnabled")),Ae=()=>o(l("navEnabled","asideRightEnabled","rightAsideEnabled")),ye=()=>ge()!==!1,pe=()=>Ae()===!0||o(l("noNav"))===!1,me=()=>o(l("noDrawer"))===!0||ge()===!1||U===!1,ue=()=>o(l("noNav"))===!0||Ae()===!1||W===!1,H=()=>o(l("drawerFloating"))===!0,ae=()=>o(l("navFloating"))===!0,ie=()=>o(l("drawerResizable"))===!0,ve=()=>o(l("navResizable"))===!0,I=()=>z(o(l("drawerMinWidth")),180),g=()=>z(o(l("drawerMaxWidth")),null),p=()=>z(o(l("navMinWidth")),180),h=()=>z(o(l("navMaxWidth")),null),V=z(o(l("drawerWidth")),280),re=z((hs=o(l("navWidth")))!=null?hs:o(l("asideRightWidth")),280),[c,N]=JSswift.reactive.signal(te(V,I(),g())),[b,J]=JSswift.reactive.signal(te(re,p(),h())),Q=bn(e.drawerOpen,"UI.Layout:drawerOpen"),ee=Q?!!Q.get():typeof e.drawerOpen=="boolean"?!!e.drawerOpen:!0,[we,F]=JSswift.reactive.signal(ee),m=qe=>{const gt=!!qe;we()!==gt&&F(gt),Q==null||Q.set(gt)};(is=Q==null?void 0:Q.watch)==null||is.call(Q,()=>{const qe=!!Q.get();we()!==qe&&F(qe)});const L=bn(e.navOpen,"UI.Layout:navOpen"),P=L?!!L.get():typeof e.navOpen=="boolean"?!!e.navOpen:!0,[Y,Ne]=JSswift.reactive.signal(P),ze=qe=>{const gt=!!qe;Y()!==gt&&Ne(gt),L==null||L.set(gt)};(rs=L==null?void 0:L.watch)==null||rs.call(L,()=>{const qe=!!L.get();Y()!==qe&&Ne(qe)});const Ee=()=>{var Yt,tn,nn;const qe=Number((Yt=o(l("layoutBreakpoint")))!=null?Yt:0),gt=Number((tn=o(l("drawerBreakpoint")))!=null?tn:qe||1024),Mt=Number((nn=o(l("navBreakpoint")))!=null?nn:qe||gt);return Math.max(gt,Mt,0)},K=()=>{const qe=d();return qe>=1024?"pc":qe>=768?"tablet":"mobile"},[$,se]=JSswift.reactive.signal(!1),[je,Be]=JSswift.reactive.signal(K()),ce=()=>{typeof window!="undefined"&&(Be(K()),se(window.innerWidth<Ee()))};typeof window!="undefined"&&(ce(),window.addEventListener("resize",ce));const Oe=()=>({props:e,openAside:()=>m(!0),closeAside:()=>m(!1),toggleAside:()=>m(!we()),openNav:()=>ze(!0),closeNav:()=>ze(!1),toggleNav:()=>ze(!Y()),isDrawerOpen:()=>!!we(),isNavOpen:()=>!!Y(),isMobile:()=>!!$(),isDrawerFloating:()=>H(),isNavFloating:()=>ae()}),Le=(qe,gt)=>{const Mt=Oe();for(const tn of qe){if(!i(s,tn))continue;const nn=typeof s[tn]=="function"?s[tn](Mt):s[tn];return r(null,"default",Mt,nn)}const Yt=typeof gt=="function"?gt(Mt):gt;return r(null,"default",Mt,Yt)},Je=oe!==void 0?oe:n,Fe=fe(["cms-app","cms-layout",JSswift.uiResponsiveClasses({mobile:e},en),JSswift.uiResponsiveClasses(e,en),e.class]),Ge=JSswift.omit(e,["header","headerContent","aside","drawer","nav","asideRight","drawerRight","page","main","content","body","footer","footerContent","noDrawer","drawerEnabled","asideEnabled","noNav","navEnabled","asideRightEnabled","rightAsideEnabled","drawerOpen","navOpen","layoutBreakpoint","drawerBreakpoint","navBreakpoint","drawerWidth","navWidth","asideRightWidth","drawerResizable","drawerMinWidth","drawerMaxWidth","navResizable","navMinWidth","navMaxWidth","drawerPeek","navPeek","asideRightPeek","drawerFloating","navFloating","overlayClose","escClose","stickyHeader","stickyFooter","stickyAside","stickyNav","tagPage","mode","layoutMode","disposition","layoutDisposition","layout","shellClass","headerClass","asideClass","navClass","pageClass","footerClass","overlayClass","gap","headerOffset","minHeight","areas","gridTemplateAreas","templateAreas","slots"]);Ge.class=Fe,Ge.style={...e.style||{}},JSswift.uiApplyResponsiveProps(Ge,e,JSswift.uiResponsiveStyleRules);const He=_.div(Ge),Te=o(l("tagPage"))===!0?{header:"header",aside:"aside",nav:"nav",page:"main",footer:"footer"}:{header:"div",aside:"div",nav:"div",page:"div",footer:"div"},O=_.div({class:fe(["cms-layout-shell-grid",e.shellClass])}),k=_[Te.header]({class:fe(["cms-layout-section","cms-layout-header","header",xe(e.stickyHeader,"sticky"),e.headerClass])}),x=_[Te.aside]({class:fe(["cms-layout-section","cms-layout-aside","aside",xe(e.stickyAside!==!1,"sticky"),e.asideClass]),role:"navigation","aria-hidden":"true"}),f=_.div({class:"cms-layout-panel-body cms-layout-aside-body"}),E=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-drawer","aria-hidden":"true"});x.appendChild(f),x.appendChild(E);const Ce=_[Te.nav]({class:fe(["cms-layout-section","cms-layout-nav","nav",xe(e.stickyNav,"sticky"),e.navClass]),role:Te.nav==="nav"?null:"complementary","aria-hidden":"true"}),Ue=_.div({class:"cms-layout-panel-body cms-layout-nav-body"}),Xe=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-nav","aria-hidden":"true"});Ce.appendChild(Ue),Ce.appendChild(Xe);const q=_[Te.page]({class:fe(["cms-layout-section","cms-layout-main","main",e.pageClass]),role:Te.page==="main"?null:"main"}),We=_[Te.footer]({class:fe(["cms-layout-section","cms-layout-footer","footer",xe(e.stickyFooter,"sticky"),e.footerClass])});O.appendChild(k),O.appendChild(x),O.appendChild(q),O.appendChild(Ce),O.appendChild(We),He.appendChild(O);const st=_.div({class:fe(["cms-aside-overlay",e.overlayClass]),onClick:()=>{o(l("overlayClose"))!==!1&&(we()&&m(!1),Y()&&ze(!1))}});He.appendChild(st);let Ze=!1,ut=!1,St=!1,Lt=!1,zt=!1,Rt=null,et=null;const yt=qe=>{!qe||typeof qe!="object"||(typeof qe._dispose=="function"&&qe._dispose(),!(!qe.childNodes||!qe.childNodes.length)&&Array.from(qe.childNodes).forEach(yt))},Jt=qe=>{qe&&Array.from(qe.childNodes).forEach(gt=>{yt(gt),gt.remove()})},jt=qe=>{const gt=Oe(),Mt=typeof qe=="function"?qe(gt):qe;return r(null,"default",gt,Mt)},Xt=()=>{const qe=Ze?k.getBoundingClientRect().height:0;He.style.setProperty("--layout-header-height",`${qe}px`)},Qt=(qe,gt)=>(Jt(qe),gt.forEach(Mt=>qe.appendChild(Mt)),gt.length>0),an=()=>{var Yt,tn,nn,fn,ln,y;He.style.setProperty("--cms-layout-drawer-width",C((Yt=o(l("drawerWidth")))!=null?Yt:280,"280px")),He.style.setProperty("--cms-layout-nav-width",C((nn=(tn=o(l("navWidth")))!=null?tn:o(l("asideRightWidth")))!=null?nn:280,"280px")),He.style.setProperty("--cms-layout-drawer-peek",C((fn=o(l("drawerPeek")))!=null?fn:20,"20px")),He.style.setProperty("--cms-layout-nav-peek",C((y=(ln=o(l("navPeek")))!=null?ln:o(l("asideRightPeek")))!=null?y:20,"20px"));const qe=C(o(l("gap")),null);qe!=null?He.style.setProperty("--cms-layout-gap",qe):He.style.removeProperty("--cms-layout-gap");const gt=C(o(l("headerOffset")),null);gt!=null&&He.style.setProperty("--layout-header-height",gt);const Mt=C(o(l("minHeight")),null);Mt!=null?He.style.setProperty("--cms-layout-min-height",Mt):He.style.removeProperty("--cms-layout-min-height")},$t=()=>{if(ie()){const qe=te(c(),I(),g());qe!==c()&&N(qe),He.style.setProperty("--cms-layout-drawer-width",`${qe}px`)}if(ve()){const qe=te(b(),p(),h());qe!==b()&&J(qe),He.style.setProperty("--cms-layout-nav-width",`${qe}px`)}},Zt=(qe,gt)=>{if(gt.button!==0)return;const Mt=qe==="drawer"?x:Ce;if(Mt.hidden)return;const Yt=qe==="drawer"?c:b,tn=qe==="drawer"?N:J,nn=qe==="drawer"?I:p,fn=qe==="drawer"?g:h,ln=Mt.getBoundingClientRect(),y=ln.width||Yt(),de=nt=>{const ot=qe==="drawer"?nt.clientX-ln.left:ln.right-nt.clientX;tn(te(ot||y,nn(),fn())),$t(),qt()},Pe=()=>{He.classList.remove("is-resizing-layout"),document.removeEventListener("pointermove",de,!0),document.removeEventListener("pointerup",Pe,!0),et=null};He.classList.add("is-resizing-layout"),document.addEventListener("pointermove",de,!0),document.addEventListener("pointerup",Pe,!0),et=Pe,gt.preventDefault()},un=qe=>Zt("drawer",qe),hn=qe=>Zt("nav",qe);E.addEventListener("pointerdown",un),Xe.addEventListener("pointerdown",hn);const qt=()=>{const qe=!!$(),gt=!!we(),Mt=!!Y(),Yt=!me()&&ye()&&ut,tn=!ue()&&pe()&&St,nn=Yt&&(qe||H()),fn=tn&&(qe||ae()),ln=Yt&>,y=tn&&Mt,de=ln&&!nn,Pe=y&&!fn,nt=de&&ie(),ot=Pe&&ve(),it=ln&&nn||y&&fn;an(),$t(),He.classList.toggle("is-mobile",qe),He.classList.toggle("drawer-open",ln),He.classList.toggle("nav-open",y),He.classList.toggle("no-drawer",!Yt),He.classList.toggle("no-nav",!tn),He.classList.toggle("has-header",Ze),He.classList.toggle("has-drawer",Yt),He.classList.toggle("has-nav",tn),He.classList.toggle("has-footer",zt),He.classList.toggle("drawer-floating",nn),He.classList.toggle("nav-floating",fn);const ft=D(),Tt=ft?A():"";He.dataset.disposition=ft||"",He.dataset.layoutMode=Tt||"",He.classList.toggle("has-disposition",!!ft),He.classList.toggle("mode-local",Tt==="local"),He.classList.toggle("mode-global",Tt==="global"),k.classList.toggle("sticky",o(l("stickyHeader"))===!0),We.classList.toggle("sticky",o(l("stickyFooter"))===!0),x.classList.toggle("sticky",o(l("stickyAside"))!==!1),Ce.classList.toggle("sticky",o(l("stickyNav"))===!0),k.hidden=!Ze,We.hidden=!zt,q.hidden=!Lt,st.hidden=!(nn||fn),st.classList.toggle("show",it),x.hidden=!Yt||!ln&&!nn,x.classList.toggle("open",ln),x.classList.toggle("is-floating",nn),x.classList.toggle("is-resizable",nt),x.setAttribute("aria-hidden",ln?"false":"true"),E.hidden=!nt,Ce.hidden=!tn||!y&&!fn,Ce.classList.toggle("open",y),Ce.classList.toggle("is-floating",fn),Ce.classList.toggle("is-resizable",ot),Ce.setAttribute("aria-hidden",y?"false":"true"),Xe.hidden=!ot;const Ut=Zo[ft]||null,on=(Ut==null?void 0:Ut.side)||(de&&Ut?"left":null),mn=(Ut==null?void 0:Ut.nav)||(Pe&&Ut?"top":null),On=de?Ut?on:"left":"",An=Pe?Ut?mn==="left"||mn==="right"?mn:"":"right":"";He.classList.toggle("drawer-left",Yt&&on==="left"),He.classList.toggle("drawer-right",Yt&&on==="right"),He.classList.toggle("nav-top",Pe&&mn==="top"),He.classList.toggle("nav-side",Pe&&(An==="left"||An==="right")),O.style.gridTemplateColumns=[On==="left"?"minmax(0, var(--cms-layout-drawer-width))":An==="left"?"minmax(0, var(--cms-layout-nav-width))":"0px","minmax(0, 1fr)",On==="right"?"minmax(0, var(--cms-layout-drawer-width))":An==="right"?"minmax(0, var(--cms-layout-nav-width))":"0px"].join(" ");const yn=['"header header header"',`"${de?"aside":"."} main ${Pe?"nav":"."}"`,'"footer footer footer"'].join(" "),as=Xr(Zo[ft],{header:Ze,aside:de,nav:Pe,main:Lt,footer:zt});O.style.gridTemplateAreas=le(w("areas","gridTemplateAreas","templateAreas"))||as||yn},Jn=(qe,gt)=>(Ze=Qt(k,jt(qe)),Xt(),qt(),gt&&JSswift.router.setURLOnly(gt),k),In=(qe,gt)=>(ut=Qt(f,jt(qe)),ut||m(!1),qt(),gt&&JSswift.router.setURLOnly(gt),x),cn=(qe,gt)=>(St=Qt(Ue,jt(qe)),St||ze(!1),qt(),gt&&JSswift.router.setURLOnly(gt),Ce),Wn=(qe,gt)=>(Lt=Qt(q,jt(qe)),qt(),gt&&JSswift.router.setURLOnly(gt),q),dn=(qe,gt)=>(zt=Qt(We,jt(qe)),qt(),gt&&JSswift.router.setURLOnly(gt),We);Ze=Qt(k,Le(["header"],he)),ut=Qt(f,U===!1?[]:Le(["aside","drawer"],U)),St=Qt(Ue,W===!1?[]:Le(["nav","asideRight","drawerRight"],W)),Lt=Qt(q,Le(["page","main","default"],Je)),zt=Qt(We,Le(["footer"],Z)),typeof ResizeObserver!="undefined"&&(Rt=new ResizeObserver(()=>Xt()),Rt.observe(k)),Xt(),JSswift.reactive.effect(()=>{je(),$(),we(),Y(),qt()},"UI.Layout:state");const ps=qe=>{o(l("escClose"))!==!1&&(!$()&&!H()&&!ae()||!we()&&!Y()||qe.key==="Escape"&&(qe.preventDefault(),we()&&m(!1),Y()&&ze(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",ps,!0),He.openAside=()=>m(!0),He.closeAside=()=>m(!1),He.toggleAside=()=>m(!we()),He.openNav=()=>ze(!0),He.closeNav=()=>ze(!1),He.toggleNav=()=>ze(!Y()),He.isDrawerOpen=()=>!!we(),He.isNavOpen=()=>!!Y(),He.isMobile=()=>!!$(),He.header=()=>k,He.aside=()=>x,He.drawer=()=>x,He.nav=()=>Ce,He.page=()=>q,He.main=()=>q,He.footer=()=>We,He.headerUpdate=Jn,He.asideUpdate=In,He.drawerUpdate=In,He.navUpdate=cn,He.pageUpdate=Wn,He.mainUpdate=Wn,He.footerUpdate=dn,He.reflow=qt,He._dispose=()=>{var qe;typeof window!="undefined"&&window.removeEventListener("resize",ce),typeof document!="undefined"&&document.removeEventListener("keydown",ps,!0),E.removeEventListener("pointerdown",un),Xe.removeEventListener("pointerdown",hn),et==null||et(),(qe=Rt==null?void 0:Rt.disconnect)==null||qe.call(Rt)},G(He,e),qt(),He},(Ti=JSswift.isDev)!=null&&Ti.call(JSswift)&&(v.meta=v.meta||{},v.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",mode:"local|global",layoutMode:"alias di mode",disposition:"classic|classicRight|sidebarFullLeft|sidebarFullRight|appShell|dashboard|website|documentation|landing",layoutDisposition:"alias di disposition",layout:"alias di disposition",gap:"number|string",headerOffset:"number|string",minHeight:"number|string",areas:"string|array",gridTemplateAreas:"string|array",templateAreas:"string|array",mobile:"{ disposition?, mode?, gap?, minHeight?, areas?, gridTemplateAreas?, drawerWidth?, navWidth?, drawerFloating?, navFloating?, noDrawer?, noNav? }",tablet:"{ disposition?, mode?, gap?, minHeight?, areas?, gridTemplateAreas?, drawerWidth?, navWidth?, drawerFloating?, navFloating?, noDrawer?, noNav? }",pc:"{ disposition?, mode?, gap?, minHeight?, areas?, gridTemplateAreas?, drawerWidth?, navWidth?, drawerFloating?, navFloating?, noDrawer?, noNav? }",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 of aside",nav:"Right-side panel content",asideRight:"Alias of nav",drawerRight:"Alias of nav",page:"Page content",main:"Alias of page",footer:"Footer content",default:"Fallback page content"},returns:"HTMLDivElement with openAside/closeAside/toggleAside/openNav/closeNav/toggleNav methods, isDrawerOpen/isNavOpen/isMobile/reflow, header()/aside()/nav()/page()/footer(), headerUpdate/asideUpdate/navUpdate/pageUpdate/mainUpdate/footerUpdate and _dispose()",description:"Composable shell layout with independent left drawer and right nav, configurable widths, optional resize with min/max, optional floating mode, and runtime section updates."}),v.Footer=(...t)=>{var ve,I,g;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=p=>Object.prototype.hasOwnProperty.call(e,p),d={props:e},S=(p,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(V=>S(p,V));return}if(h!=null&&h.nodeType){p.appendChild(h);return}p.appendChild(document.createTextNode(String(h)))}},u=(p,h,V=re=>re)=>{const re=JSswift.ui.getSlot(s,p);if(re!=null)return r(s,p,d,null);if(typeof h=="function"){const c=new Set(["eyebrow","title","subtitle"]),N=_[c.has(p)?"span":"div"]({class:`cms-footer-slot-${p}`});return JSswift.reactive.effect(()=>{const b=V(h(d)),J=Hn(JSswift.ui.slot(b));N.replaceChildren(),Array.isArray(J)?J.forEach(Q=>S(N,Q)):S(N,J)},`UI.Footer:${p}`),[N]}return r(s,p,d,V(h))},l=(p,h="icon",V=e.iconSize||e.size||"md")=>p==null||p===!1?null:typeof p=="string"?v.Icon({name:p,size:V}):JSswift.ui.slot(p,{as:h}),w=i("left")?e.left:e.start,D=i("right")?e.right:e.end,A=i("title")?e.title:e.label,C=(I=(ve=e.subtitle)!=null?ve:e.description)!=null?I:e.note,z=i("content")?e.content:i("body")?e.body:n!=null&&n.length?n:null,le=[...u("left",w),...u("start",null)],te=u("icon",e.icon,l),he=u("eyebrow",(g=e.eyebrow)!=null?g:e.kicker),U=u("title",A),W=u("subtitle",C),oe=u("meta",e.meta),Z=(()=>{const p=u("content",null);return p.length?p:u("default",z)})(),ge=[...u("center",null),...u("body",null)],Ae=[...u("right",D),...u("end",null)],ye=u("actions",e.actions),pe=_.div({class:fe(["cms-footer-body",e.bodyClass,e.centerClass])},_.div({class:"cms-footer-heading"},te.length?_.div({class:"cms-footer-icon"},...te):null,_.div({class:"cms-footer-copy"},he.length?_.div({class:fe(["cms-footer-eyebrow",e.eyebrowClass])},...he):null,U.length?_.div({class:fe(["cms-footer-title",e.titleClass])},...U):null,W.length?_.div({class:fe(["cms-footer-subtitle",e.subtitleClass])},...W):null,Z.length?_.div({class:fe(["cms-footer-content",e.contentClass])},...Z):null),oe.length?_.div({class:fe(["cms-footer-meta",e.metaClass])},...oe):null)),me=[];ge.length?me.push(_.div({class:fe(["cms-footer-body",e.bodyClass,e.centerClass])},...ge)):(te.length||he.length||U.length||W.length||Z.length||oe.length)&&me.push(pe),(Ae.length||ye.length)&&me.push(_.div({class:fe(["cms-footer-end",e.endClass])},...Ae,...ye.length?[_.div({class:fe(["cms-footer-actions",e.actionsClass])},...ye)]:[]));const ue=JSswift.omit(e,["actions","actionsClass","align","body","bodyClass","center","centerClass","content","contentClass","dense","description","divider","elevated","end","endClass","eyebrow","eyebrowClass","gap","icon","iconSize","kicker","label","left","meta","metaClass","minHeight","note","right","slots","stack","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap","justify"]);ue.class=fe(["cms-panel","cms-footer","cms-singularity",xe(e.sticky,"sticky"),xe(e.dense,"dense"),xe(e.elevated,"elevated"),xe(e.divider!==!1,"divider"),xe(e.stack,"stack"),Qo(e.align,"align-"),e.class]),ue.style={...e.style||{}};const H=Ke(e.justify);H!=null&&(ue.style.justifyContent=H);const ae=Ke(e.wrap,p=>p?"wrap":"nowrap");ae!=null&&(ue.style.flexWrap=ae),e.gap!=null&&(ue.style["--cms-footer-gap"]=ht(o(e.gap))),e.minHeight!=null&&(ue.style.minHeight=ht(o(e.minHeight))),JSswift.uiApplyResponsiveProps(ue,e,JSswift.uiResponsiveStyleRules);const ie=_.footer(ue,...le.length?[_.div({class:fe(["cms-footer-start",e.startClass])},...le)]:[],...me.length?[_.div({class:"cms-footer-main"},...me)]:[]);return G(ie,e),ie},(Pi=JSswift.isDev)!=null&&Pi.call(JSswift)&&(v.meta=v.meta||{},v.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 of left",right:"Node|Function|Array",end:"Alias of right",body:"Alias of 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:"Footer leading area",start:"Alias/addon for the leading area",right:"Footer trailing area",end:"Alias/addon for the trailing area",center:"Full override for the central body",body:"Alias of center",icon:"Leading icon",eyebrow:"Eyebrow / kicker",title:"Main title",subtitle:"Subtitle or note",meta:"Meta info next to the central content",content:"Extra content or children fallback",actions:"Actions grouped in the trailing area",default:"Fallback content for the body area"},returns:"HTMLElement <footer>",description:"Structured footer with start/body/end regions, optional copy, actions, and composable slots."});const Fa=t=>{const e=[];for(const n of t||[]){const s=Hn(JSswift.ui.slot(n));s&&(Array.isArray(s)?e.push(...s):e.push(s))}return e},Ws=(t,e)=>{const n=Hn(JSswift.ui.slot(t,e));return n?Array.isArray(n)?n:[n]:[]},ht=t=>{var e;return typeof t=="number"?`${t}px`:typeof t=="string"&&((e=JSswift.uiSizes)!=null&&e.includes(t))?`var(--cms-size-${t})`:String(t)};v.Toolbar=(...t)=>{var h,V,re,c,N,b,J,Q;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(ee,we,F={})=>{const m=Array.isArray(ee)?ee:[ee];for(const L of m)if(JSswift.ui.getSlot(s,L)!=null)return r(s,L,F,we);return we==null?[]:r(null,"default",F,we)},d=ee=>(Array.isArray(ee)?ee:[ee]).some(F=>JSswift.ui.getSlot(s,F)!=null),S={props:e},u=i(["before"],e.before,S),l=i(["start","left"],(h=e.start)!=null?h:e.left,S),w=i(["center","body","content","default"],(c=(re=(V=e.center)!=null?V:e.body)!=null?re:e.content)!=null?c:n,S),D=i(["end","right","actions"],(b=(N=e.end)!=null?N:e.right)!=null?b:e.actions,S),A=i(["after"],e.after,S),C=i(["title"],e.title,S),z=i(["subtitle"],e.subtitle,S),le=i(["meta"],e.meta,S),te=!!(u.length||l.length||D.length||A.length||C.length||z.length||le.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||d(["before","start","left","center","body","content","end","right","actions","after","title","subtitle","meta"])),he=fe(["cms-toolbar",xe(te,"structured"),xe(e.dense,"dense"),xe(e.divider,"divider"),xe(e.elevated,"elevated"),xe(e.sticky,"sticky"),e.class]),U=JSswift.omit(e,["actions","after","afterClass","align","before","beforeClass","body","bodyClass","center","centerClass","content","contentClass","copyClass","dense","divider","elevated","end","endClass","gap","justify","left","meta","metaClass","right","size","slots","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap"]);U.class=he;const W={...e.style||{}};W.display=W.display||"flex";const oe=Ke(e.align),Z=Ke(e.justify),ge=Ke(e.wrap,ee=>typeof ee=="boolean"?ee?"wrap":"nowrap":String(ee),"wrap"),Ae=Ke(e.gap,ht,"var(--cms-s-md)"),ye=tt(e,"gap");W["--cms-toolbar-gap"]=Ae!=null?Ae:"var(--cms-s-md)",ye||(W.gap=W.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"},me=Ke(e.size,ee=>pe[ee]||"");if(me!=null&&(W.padding=me),te?(W.flexDirection=W.flexDirection||"column",W.alignItems=W.alignItems||"stretch"):(oe!=null&&(W.alignItems=oe),Z!=null&&(W.justifyContent=Z),ge!=null&&(W.flexWrap=ge)),Object.keys(W).length&&(U.style=W),JSswift.uiApplyResponsiveProps(U,e,JSswift.uiResponsiveStyleRules),!te){const ee=r(s,"default",S,n),we=_.div(U,...ee);return G(we,e),we}const ue=(Q=(J=e.bodyClass)!=null?J:e.centerClass)!=null?Q:e.contentClass,H=Et([e.justify],()=>{const ee=o(e.justify);return!ee||ee==="flex-start"?"auto":""}),ae={display:"flex",alignItems:"inherit",gap:"var(--cms-toolbar-gap)",flexWrap:"inherit",minWidth:0},ie={};oe!=null&&(ie.alignItems=oe),Z!=null&&(ie.justifyContent=Z),ge!=null&&(ie.flexWrap=ge);const ve=le.length||C.length||z.length?_.div({class:fe(["cms-toolbar-copy",e.copyClass])},le.length?_.div({class:fe(["cms-toolbar-meta",e.metaClass])},...le):null,C.length?_.div({class:fe(["cms-toolbar-title",e.titleClass])},...C):null,z.length?_.div({class:fe(["cms-toolbar-subtitle",e.subtitleClass])},...z):null):null,I=!!(l.length||ve||w.length||D.length),g=[u.length?_.div({class:fe(["cms-toolbar-before",e.beforeClass]),style:{...ae}},...u):null,I?_.div({class:"cms-toolbar-main",style:ie},l.length?_.div({class:fe(["cms-toolbar-start",e.startClass]),style:{...ae}},...l):null,ve||w.length?_.div({class:fe(["cms-toolbar-center",ue]),style:{...ae,flex:"1 1 240px"}},ve,...w):null,D.length?_.div({class:fe(["cms-toolbar-end",e.endClass]),style:{...ae,justifyContent:"flex-end",marginInlineStart:H}},...D):null):null,A.length?_.div({class:fe(["cms-toolbar-after",e.afterClass]),style:{...ae}},...A):null].filter(Boolean),p=_.div(U,...g);return G(p,e),p},(Ri=JSswift.isDev)!=null&&Ri.call(JSswift)&&(v.meta=v.meta||{},v.meta.Toolbar={signature:"UI.Toolbar(...children) | UI.Toolbar(props, ...children)",props:{before:"Node|Function|Array",start:"Node|Function|Array",left:"Alias of start",center:"Node|Function|Array",body:"Alias of center",content:"Alias of center",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",meta:"String|Node|Function|Array",end:"Node|Function|Array",right:"Alias of end",actions:"Alias of 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 (e.g. '8px' or 'var(--cms-s-md)')",size:"xxs|xs|sm|md|lg|xl|xxl",beforeClass:"string",startClass:"string",bodyClass:"string",centerClass:"Alias of bodyClass",contentClass:"Alias of 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:"Optional top row",start:"Leading content area",left:"Alias of start",center:"Main content area",body:"Alias of center",content:"Alias of center",title:"Toolbar main title",subtitle:"Subtitle or operational note",meta:"Meta info/chips above or next to the title",end:"Trailing actions area",right:"Alias of end",actions:"Alias of end",after:"Optional bottom row",default:"Fallback content / children"},events:{onClick:"MouseEvent"},description:"Composable toolbar with before/start/center/end/after regions, optional copy, and fallback compatible with simple flex usage.",returns:"HTMLDivElement"});const Qr=t=>{var e;return t&&t.nodeType===1&&((e=t.classList)==null?void 0:e.contains("cms-grid-col"))};v.Grid=(...t)=>{var p,h,V,re;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=o(e.items),d=Array.isArray(i)?i:i==null?[]:[i],S=(c={})=>{const N=e.itemProps||{},b={...N,...c};return b.class=fe([N.class,e.itemClass,c.class]),b.style={...N.style||{},...e.itemStyle||{},...c.style||{}},b},u=(c,N={})=>{if(c==null||c===!1)return[];if(Qr(c))return[c];if(ts(c)){const b=c.children!=null?jn(c.children):c.content!=null?jn(c.content):c.node!=null?jn(c.node):c.label!=null?jn(c.label):[];return[v.GridCol(S(c),...b)]}return Array.isArray(c)?[v.GridCol(S(N),...c)]:[v.GridCol(S(N),c)]},l=(c,N,b,J=!0)=>{if(c==null||c===!1)return[];const Q=ts(c)?c:{};if(J){const ee={item:c,index:N,count:b,first:N===0,last:N===b-1},we=r(s,"item",ee,null);if(we.length)return we.flatMap(F=>u(F,Q))}return u(c,Q)},w=[];d.forEach((c,N)=>{w.push(...l(c,N,d.length))}),r(s,"default",{items:d,count:d.length},n).forEach(c=>{w.push(...u(c))}),w.length||r(s,"empty",{items:d,count:0},e.empty).forEach(N=>{const b=u(N,{style:{gridColumn:"1 / -1"}});w.push(...b)});const A=fe(["cms-grid",JSswift.uiResponsiveClasses({mobile:e},kn),JSswift.uiResponsiveClasses(e,kn),xe(e.dense,"dense"),xe(e.inline,"cms-grid-inline"),xe(e.debug,"cms-grid-debug"),e.class]),C=JSswift.omit(e,["gap","rowGap","columnGap","colGap","cols","columns","rows","areas","align","justify","alignItems","justifyItems","placeItems","placeContent","dense","flow","inline","debug","autoFit","autoFill","min","max","autoRows","items","itemClass","itemStyle","itemProps","empty","slots","full","width","minWidth","maxWidth","padding",...JSswift.uiResponsiveOmitProps]);C.class=A;const z={...e.style||{}};(p=JSswift.uiResponsiveHasConfig)!=null&&p.call(JSswift,e)&&e.display==null&&!tt(e,"display")&&z.display==null&&(z.display=e.inline?"inline-grid":"grid");const le=Ke(e.gap,ht);le!=null&&!tt(e,"gap")&&(z["--cms-grid-gap"]=le,z.gap=le);const te=Ke(e.rowGap,ht);te!=null&&!tt(e,"rowGap")&&(z.rowGap=te);const he=Ke((h=e.columnGap)!=null?h:e.colGap,ht);he!=null&&!tt(e,["columnGap","colGap"])&&(z.columnGap=he);const U=Ke(e.max,ht,"1fr"),W=Ke(e.min,ht);if(W!=null){const c=o(e.autoFill)?"auto-fill":"auto-fit";z.gridTemplateColumns=`repeat(${c}, minmax(${W}, ${U||"1fr"}))`}else{const c=Ke((V=e.columns)!=null?V:e.cols,N=>typeof N=="number"?`repeat(${N}, minmax(0, 1fr))`:String(N));c!=null&&!tt(e,["cols","columns"])&&(z.gridTemplateColumns=c)}const oe=Ke(e.rows,c=>typeof c=="number"?`repeat(${c}, minmax(0, auto))`:String(c));oe!=null&&(z.gridTemplateRows=oe);const Z=Ke(e.autoRows,ht);Z!=null&&(z.gridAutoRows=Z);const ge=Ke(e.flow,c=>{const N=String(c);return e.dense&&!N.includes("dense")?`${N} dense`:N});ge!=null&&!tt(e,"flow")&&(z.gridAutoFlow=ge);const Ae=Ke(e.areas,c=>Array.isArray(c)?c.map(N=>`"${Array.isArray(N)?N.join(" "):String(N)}"`).join(" "):String(c));Ae!=null&&(z.gridTemplateAreas=Ae);const ye=Ke((re=e.align)!=null?re:e.alignItems);ye!=null&&!tt(e,["align","alignItems"])&&(z.alignItems=ye);const pe=Ke(e.justify);pe!=null&&!tt(e,"justify")&&(z.justifyContent=pe);const me=Ke(e.justifyItems);me!=null&&(z.justifyItems=me);const ue=Ke(e.placeItems);ue!=null&&(z.placeItems=ue);const H=Ke(e.placeContent);H!=null&&(z.placeContent=H);const ae=Ke(e.width,ht);ae!=null&&!tt(e,"width")&&(z.width=ae),o(e.full)===!0&&(z.width="100%");const ie=Ke(e.minWidth,ht);ie!=null&&!tt(e,"minWidth")&&(z.minWidth=ie);const ve=Ke(e.maxWidth,ht);ve!=null&&!tt(e,"maxWidth")&&(z.maxWidth=ve);const I=Ke(e.padding,ht);I!=null&&!tt(e,"padding")&&(z.padding=I),Object.keys(z).length&&(C.style=z),JSswift.uiApplyResponsiveProps(C,e,JSswift.uiResponsiveStyleRules);const g=_.div(C,...w);return G(g,e),g},(zi=JSswift.isDev)!=null&&zi.call(JSswift)&&(v.meta=v.meta||{},v.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",mobile:"{ cols?, gap?, flow?, width?, padding? }",tablet:"{ cols?, gap?, flow?, width?, padding? }",pc:"{ cols?, gap?, flow?, width?, padding? }",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."}),v.GridCol=(...t)=>{var Je,Fe,Ge,He,R,Te,O,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=x=>Object.prototype.hasOwnProperty.call(e,x),d=(x,f,E={})=>{const Ce=Array.isArray(x)?x:[x];for(const Ue of Ce)if(JSswift.ui.getSlot(s,Ue)!=null)return r(s,Ue,E,f);return f==null?[]:r(null,"default",E,f)},S=x=>{var f;return x==null||x===!1||x===""?"":typeof x=="string"&&((f=JSswift.uiSizes)!=null&&f.includes(x))?`var(--cms-s-${x})`:ht(x)},u=x=>{var f;return x==null||x===!1||x===""?"":typeof x=="string"&&((f=JSswift.uiSizes)!=null&&f.includes(x))?Qe(x,"size"):ht(x)},l={...e.style||{}},w=x=>{if(x==null||x==="")return null;if(x==="auto")return"auto";if(x==="full"||x===!0)return"1 / -1";const f=Number(x);if(Number.isFinite(f)&&f>0){const E=Math.max(1,Math.round(f));return`span ${E} / span ${E}`}return String(x)},D=x=>{if(x==null||x==="")return null;if(x==="full"||x===!0)return"1 / -1";const f=Number(x);if(Number.isFinite(f)&&f>0){const E=Math.max(1,Math.round(f));return`span ${E} / span ${E}`}return String(x)},A=i("span")?e.span:e.col,C=Ke(A,w),z=Ke(e.sm,w),le=Ke(e.md,w),te=Ke(e.lg,w),he=JSswift.uiResponsivePropsFor(e,Ot("tablet"))||{},U=JSswift.uiResponsivePropsFor(e,Ot("pc"))||{},W=(Je=he.span)!=null?Je:he.col,oe=(Fe=U.span)!=null?Fe:U.col,Z=Ke(W,w),ge=Ke(oe,w),Ae=Ke(e.rowSpan,D),ye=Ke(e.row,D),pe=Ke(e.area),me=Ke(e.align),ue=Ke(e.justify),H=Ke(e.place),ae=Ke(e.gap,S),ie=Ke(e.rowGap,S),ve=Ke(e.columnGap,S),I=Ke(e.padding,S),g=Ke(e.width,u),p=Ke(e.minHeight,u),h=Ke(e.height,u),V=Ke(e.maxHeight,u),re=Ke(e.contentAlign),c=Ke(e.contentJustify),N=Ke(e.direction),b=Ke(e.scroll,x=>x===!0?"auto":String(x),""),J=Ke(e.fullHeight,x=>x?"100%":"",""),Q=Et([e.center,e.contentAlign,e.contentJustify],()=>!!o(e.center)&&(o(e.contentAlign)==null||o(e.contentAlign)==="")&&(o(e.contentJustify)==null||o(e.contentJustify)==="")),ee={props:e},we=d(["start","top","header","before"],(R=(He=(Ge=e.start)!=null?Ge:e.top)!=null?He:e.header)!=null?R:e.before,ee),F=i("body")?e.body:i("content")?e.content:n,m=d(["body","content","default"],F,ee),L=d(["end","bottom","footer","after"],(k=(O=(Te=e.end)!=null?Te:e.bottom)!=null?O:e.footer)!=null?k:e.after,ee),P=we.length||L.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||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"top")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"content")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"bottom")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,Y=Et([e.stack,e.gap,e.rowGap,e.columnGap,e.contentAlign,e.contentJustify,e.direction,e.center],()=>P||o(e.stack)||[o(e.gap),o(e.rowGap),o(e.columnGap),o(e.contentAlign),o(e.contentJustify),o(e.direction)].some(f=>f!=null&&f!==!1&&f!=="")?!0:!!o(e.center)),Ne=Et([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],()=>!!(o(e.panel)||o(e.color)||o(e.clickable)||o(e.border)||o(e.glossy)||o(e.glow)||o(e.glass)||o(e.shadow)||o(e.outline)||o(e.gradient)||o(e.textGradient)||o(e.lightShadow)||o(e.radius))?["cms-clear-set","cms-singularity","cms-grid-col-surface"]:[]),ze=fe(["cms-grid-col",Ne,JSswift.uiResponsiveClasses({mobile:e},Rn),JSswift.uiResponsiveClasses(e,Rn),xe(e.panel,"cms-grid-col-panel"),xe(e.auto,"is-auto"),xe(Y,"cms-grid-col-stack"),xe(e.inline,"cms-grid-col-inline"),xe(Q,"cms-grid-col-center"),e.class]),Ee=JSswift.omit(e,["span","col","sm","md","lg","auto","row","rowSpan","area","align","justify","place","gap","rowGap","columnGap","padding","width","height","minHeight","maxHeight","fullHeight","stack","inline","direction","contentAlign","contentJustify","center","scroll","panel","to","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass","slots","style","clickable","dense","flat","border","glossy","glow","glass","shadow","outline","rounded","gradient","textGradient","lightShadow","color","textColor","size","radius",...JSswift.uiResponsiveOmitProps]);Ee.class=ze,l["--cms-grid-col-base"]==null&&(l["--cms-grid-col-base"]="auto"),l["--cms-grid-col-tablet"]==null&&(l["--cms-grid-col-tablet"]="var(--cms-grid-col-base, auto)"),l["--cms-grid-col-pc"]==null&&(l["--cms-grid-col-pc"]="var(--cms-grid-col-tablet, var(--cms-grid-col-base, auto))"),o(e.auto)===!0?l["--cms-grid-col-base"]="auto":C!=null&&(l["--cms-grid-col-base"]=C),z!=null&&(l["--cms-grid-col-sm"]=z),le!=null&&(l["--cms-grid-col-md"]=le),te!=null&&(l["--cms-grid-col-lg"]=te),Z!=null&&(l["--cms-grid-col-tablet"]=Z),ge!=null&&(l["--cms-grid-col-pc"]=ge),Ae!=null?l.gridRow=Ae:ye!=null&&(l.gridRow=ye),pe!=null&&(l.gridArea=pe),me!=null&&!tt(e,"align")&&(l.alignSelf=me),ue!=null&&!tt(e,"justify")&&(l.justifySelf=ue),H!=null&&!tt(e,"place")&&(l.placeSelf=H),ae!=null&&!tt(e,"gap")&&(l.gap=ae),ie!=null&&!tt(e,"rowGap")&&(l.rowGap=ie),ve!=null&&!tt(e,"columnGap")&&(l.columnGap=ve),I!=null&&!tt(e,"padding")&&(l.padding=I),g!=null&&!tt(e,"width")&&(l.width=g),J!=null&&J!==""?l.height=J:h!=null&&!tt(e,"height")&&(l.height=h),p!=null&&!tt(e,"minHeight")&&(l.minHeight=p),V!=null&&!tt(e,"maxHeight")&&(l.maxHeight=V),N!=null&&!tt(e,"direction")&&(l.flexDirection=N),re!=null&&!tt(e,"contentAlign")?l.alignItems=re:Q!=null&&Q!==""&&(l.alignItems=Q?"center":""),c!=null&&!tt(e,"contentJustify")?l.justifyContent=c:Q!=null&&Q!==""&&(l.justifyContent=Q?"center":""),b!=null&&b!==""&&(l.overflow=b),Object.keys(l).length&&(Ee.style=l),JSswift.uiApplyResponsiveProps(Ee,e,Vn);const K=e.onClick,$=e.onKeydown,se=!!(o(e.clickable)||o(e.to)),je=x=>{var E;if(K==null||K(x),x.defaultPrevented)return;const f=o(e.to);f&&((E=JSswift.router)!=null&&E.navigate)&&(x.preventDefault(),JSswift.router.navigate(f))},Be=x=>{$==null||$(x),!x.defaultPrevented&&(x.key==="Enter"||x.key===" ")&&(x.preventDefault(),je(x))};if(se&&(Ee.onClick=je,Ee.onKeydown=Be,Ee.tabIndex==null&&(Ee.tabIndex=0),Ee.role==null&&(Ee.role="button")),!P){const x=_.div(Ee,...r(s,"default",ee,n));return G(x,e),x}const ce={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},Oe=[we.length?_.div({class:fe(["cms-grid-col-start",e.startClass,e.topClass,e.headerClass]),style:{...ce}},...we):null,m.length?_.div({class:fe(["cms-grid-col-body",e.bodyClass,e.contentClass]),style:{...ce,flex:"1 1 auto"}},...m):null,L.length?_.div({class:fe(["cms-grid-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...ce}},...L):null].filter(Boolean),Le=_.div(Ee,...Oe);return G(Le,e),Le},(Mi=JSswift.isDev)!=null&&Mi.call(JSswift)&&(v.meta=v.meta||{},v.meta.GridCol={signature:"UI.GridCol(...children) | UI.GridCol(props, ...children)",props:{span:"number|string",col:"alias di span",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",mobile:"{ span?, col?, gap?, direction?, contentAlign?, contentJustify? }",tablet:"{ span?, col?, gap?, direction?, contentAlign?, contentJustify? }",pc:"{ span?, col?, gap?, direction?, contentAlign?, contentJustify? }",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:"CSS Grid item with responsive spans, optional internal stack layout, start/body/end regions, and lightweight visual variants."}),v.Icon=(...t)=>{var ye,pe;let e={},n=[],s="home",i=!1;const d=t[0],S=t[1],u=me=>me&&typeof me=="object"&&!me.nodeType&&!Array.isArray(me)&&!(me instanceof Function);typeof d=="string"?(s=d,i=!0,u(S)?(e=S,t.length>2&&(n=t.slice(2))):t.length>1&&(n=t.slice(1))):u(d)?(e=d,d.name!=null&&(s=d.name,i=!0),t.length>1&&(n=t.slice(1))):t.length&&(n=t),!i&&n.length&&(s=n.length===1?n[0]:n),xn(e);const l=e.slots||{},w=o(e.size),D=o(e.color),A=String(s).endsWith("-fill"),C={...e.style||{}},z=Et(e.size,()=>{const me=o(e.size);return typeof me=="string"&&ms[me]?me:""}),le=!!(e.color||e.clickable||e.border||e.glossy||e.glow||e.glass||e.shadow||e.outline||e.gradient||e.textGradient||e.lightShadow||e.radius),te={"chevron-down":{viewBox:"0 0 24 24",paths:[{d:"M6 9l6 6l6 -6",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"}]}},he=me=>{const ue=te[me];return ue?_.svg({width:"100%",height:"100%",viewBox:ue.viewBox,fill:"none","aria-hidden":"true",focusable:"false"},...ue.paths.map(H=>_.path(H))):null},U=me=>{const ue=o(e.tooltip);if(ue==null||ue===!1||!v.Tooltip)return me;const H=u(ue)?{...ue}:{text:ue};return u(e.tooltipProps)&&Object.assign(H,e.tooltipProps),v.Tooltip({...H,target:me})},W=fe(["cms-icon","material-icons",...le?["cms-clear-set","cms-singularity"]:[],z,e.class]),oe=JSswift.omit(e,["name","size","class","style","label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots","spriteUrl","tooltip","tooltipProps"]);if(oe.class=W,Object.keys(C).length&&(oe.style=C),typeof s=="function"||s&&typeof s=="object"){const me=JSswift.ui.renderSlot(l,"default",{},s),ue=r(null,"default",{},me),H=_.span({...oe,"data-icon":"custom"},...ue);return G(H,e),U(H)}const Z=String(s),ge=Z.includes("#")?Z:"";let Ae=null;if(ge){const me=e.spriteUrl||((ye=JSswift.config)==null?void 0:ye.iconSpriteUrl)||(typeof globalThis!="undefined"?(pe=globalThis.JSswift_setting)==null?void 0:pe.iconSpriteUrl:null),ue=ge.slice(ge.indexOf("#")+1),H=me?_.svg({width:"100%",height:"100%"},_.use({href:me+ge})):he(ue)||_.svg({width:"100%",height:"100%"},_.use({href:ge}));A&&(H.style.fill="currentColor"),Ae=_.span({...oe,"data-icon":Z},H,...n)}else Ae=_.span({...oe,"data-icon":Z},Z,...n);if(w!=null){let me=w;JSswift.uiSizes.includes(w)&&(me=`var(--cms-icon-size-${w})`),me=typeof me=="number"?me+"px":String(me),Ae.style.setProperty("--set-icon-size",me)}return G(Ae,e),U(Ae)},(Ji=JSswift.isDev)!=null&&Ji.call(JSswift)&&(v.meta=v.meta||{},v.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",spriteUrl:"string",tooltip:"String|Node|Function|Object",tooltipProps:"object",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Custom icon content"},returns:"HTMLSpanElement",description:"Sprite- or text-based icon with configurable size/color."}),v.Badge=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Et(e.size,()=>{const te=o(e.size);return typeof te=="string"&&ms[te]?`cms-size-${te}`:""}),d=fe(["cms-clear-set","cms-badge","cms-singularity",i,xe(e.outline,"outline"),e.class]),S=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);S.class=d;const u={...e.style||{}};if(e.size){const te=o(e.size);typeof te=="string"&&ms[te]||(u.fontSize=ht(e.size))}S.style=u;const l=(te,he,U)=>{const W=Array.isArray(te)?te:[te];for(const oe of W)if(JSswift.ui.getSlot(s,oe)!=null)return r(s,oe,he,U);return U==null||U===!1||U===""?[]:r(null,"default",he,U)},w=()=>{var he;const te=o((he=e.iconSize)!=null?he:e.size);return typeof te=="number"?Math.max(10,Math.round(te*.85)):typeof te=="string"&&{xxs:10,xs:11,sm:12,md:13,lg:14,xl:16,xxl:18,xxxl:20}[te]||14},D=(te,he)=>{const U=o(te);return U==null||U===!1||U===""?null:typeof U=="string"?v.Icon({name:U,size:w()}):JSswift.ui.slot(U,{as:he})},A=(te,he,U)=>_.dynamic(()=>{const W=D(e[he],U),oe=l(te,{position:U},W);return oe.length?_.span({class:`cms-badge-anchor cms-badge-anchor-${U}`,"data-badge-slot":U},...oe):null}),C=_.dynamic(()=>{const te=o(e.label);let he=l(["label"],{},te);return he.length||(he=l(["default"],{},n)),_.span({class:"cms-badge-content"},_.span({class:"cms-badge-label"},...he.length?he:[""]))}),z=_.dynamic(()=>{const te=o(e.notification),he=te==null||te===!1||te===""?null:te,U=l(["notification"],{notification:te},he);return U.length?_.span({class:"cms-badge-notification","data-badge-slot":"notification","aria-label":typeof te=="number"?`${te} notifications`:null},...U):null}),le=_.span(A(["left"],"left","left"),A(["centerLeft","center-left"],"centerLeft","center-left"),S,C,A(["topLeft","top-left"],"topLeft","top-left"),A(["topRight","top-right"],"topRight","top-right"),A(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),A(["bottomRight","bottom-right"],"bottomRight","bottom-right"),A(["centerRight","center-right"],"centerRight","center-right"),A(["right"],"right","right"),z);return(e.topLeft||e.centerLeft||e.bottomLeft)&&le.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&le.style.setProperty("padding-right","15px"),G(le,e),le},(Oi=JSswift.isDev)!=null&&Oi.call(JSswift)&&(v.meta=v.meta||{},v.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:"Inline badge with reactive notification and 6 positionable icon slots."});const Zr=t=>{if(t==null||t===!1)return"";const e=String(t).replace(/[._-]+/g," ").replace(/\s+/g," ").trim();if(!e)return"";const n=e.split(" ").filter(Boolean);return n.length?n.length===1?n[0].replace(/[^a-z0-9]/gi,"").slice(0,2).toUpperCase():n.slice(0,2).map(s=>s.charAt(0).toUpperCase()).join(""):""},ei=(t,e)=>{const n=t==null||t===!0?e:t;if(n==null||n===!1)return Vt(e);const s=String(n).toLowerCase();return s==="online"||s==="available"||s==="active"?"success":s==="away"||s==="pending"?"warning":s==="busy"||s==="dnd"||s==="blocked"?"danger":s==="offline"||s==="idle"?"secondary":Vt(s)||Vt(e)},ti=(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)),ea=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=ei(null,e);return _.span({class:fe(["cms-avatar-status",s?`cms-state-${s}`:""])})}if(t instanceof Node||Array.isArray(t)||typeof t=="function")return t;const n=ei(t,e);return t===!0||n?_.span({class:fe(["cms-avatar-status",n?`cms-state-${n}`:""])}):ti(t,"cms-avatar-badge")},vo=(t,e)=>!e||!e.length?null:_.span({class:fe(["cms-avatar-anchor",t])},...e);v.Avatar=(...t)=>{var h,V,re;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Et(e.size,()=>{var N;const c=o(e.size);return typeof c=="string"&&((N=JSswift.uiSizes)!=null&&N.includes(c))?`cms-size-${c}`:""}),d=Et([e.color,e.state],()=>{const c=o(e.color)||o(e.state)||"",N=Vt(c);return N?`cms-state-${N}`:""}),S=fe(["cms-clear-set","cms-avatar","cms-singularity",i,d,xe(e.square,"cms-avatar-square"),xe(e.elevated,"elevated"),e.class]),u=JSswift.omit(e,["src","srcset","srcSet","sizes","alt","label","name","initials","text","size","fontSize","textSize","radius","rounded","square","elevated","icon","iconSize","media","fit","badge","notification","status","statusColor","presence","topLeft","topRight","bottomLeft","bottomRight","slots"]);u.class=S;const l={...e.style||{}},w=Ke(e.size,c=>{var N;return typeof c=="string"&&((N=JSswift.uiSizes)!=null&&N.includes(c))?"":ht(c)},"");w!=null&&(l.width=w,l.height=w);const D=(h=e.fontSize)!=null?h:e.textSize,A=D!=null?Ke(D,ht):Ke(e.size,c=>{var N;return typeof c=="string"&&((N=JSswift.uiSizes)!=null&&N.includes(c))?"":`clamp(11px, calc(${ht(c)} * 0.34), 28px)`},"");A!=null&&(l.fontSize=A);const C=Ke(e.radius,c=>{const N=Mo(c);return N==="xxxl"?"999px":N?`var(--cms-r-${N})`:typeof c=="number"?`${c}px`:String(c)});C!=null&&(l["--set-border-radius"]=C),u.style=l;const z={props:e},le=Et([e.alt,e.label,e.name,e.text],()=>{const c=o(e.alt)||o(e.label)||o(e.name)||o(e.text)||"avatar";return String(c)}),te=e.icon!=null?typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,he=Et([e.initials,e.text,e.label,e.name],()=>{var b,J;const c=(b=o(e.initials))!=null?b:o(e.text);if(c!=null)return c;const N=(J=o(e.label))!=null?J:o(e.name);return typeof N=="string"?Zr(N):N}),U=ti(o((V=e.badge)!=null?V:e.notification)),W=ea(o((re=e.status)!=null?re:e.presence),o(e.statusColor));let oe=r(s,"media",z,e.media);if(!oe.length&&e.src){const c={class:"cms-avatar-img",src:e.src,alt:le,sizes:e.sizes,style:{}};e.srcset!=null&&(c.srcset=e.srcset),e.srcSet!=null&&(c.srcset=e.srcSet);const N=Ke(e.fit);N!=null&&(c.style.objectFit=N),oe=[_.img(c)]}const Z=r(s,"default",z,n),ge=r(s,"fallback",z,null),Ae=r(s,"label",z,he),ye=r(s,"icon",z,te),pe=oe.length?oe:Z.length?Z:ge.length?ge:Ae.length?Ae:ye.length?ye:["?"],me=oe.length?"cms-avatar-media":"cms-avatar-fallback",ue=_.span({class:"cms-avatar-body"},_.span({class:me},...pe));let H=r(s,"topLeft",z,e.topLeft),ae=r(s,"topRight",z,e.topRight),ie=r(s,"bottomLeft",z,e.bottomLeft),ve=r(s,"bottomRight",z,e.bottomRight);const I=r(s,"badge",z,U),g=r(s,"status",z,W);!ae.length&&I.length&&(ae=I),!ve.length&&g.length&&(ve=g);const p=_.div(u,ue,vo("cms-avatar-anchor-top-left",H),vo("cms-avatar-anchor-top-right",ae),vo("cms-avatar-anchor-bottom-left",ie),vo("cms-avatar-anchor-bottom-right",ve));return G(p,e),p},(Di=JSswift.isDev)!=null&&Di.call(JSswift)&&(v.meta=v.meta||{},v.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? }",mobile:"{ width?, height?, minWidth?, maxWidth?, padding?, margin?, radius? }",tablet:"{ width?, height?, minWidth?, maxWidth?, padding?, margin?, radius? }",pc:"{ width?, height?, minWidth?, maxWidth?, padding?, margin?, radius? }",class:"string",style:"object"},slots:{media:"Custom main media",default:"Custom main content instead of image or fallback",fallback:"Fallback custom quando non c'e immagine",label:"Fallback testuale / initials",icon:"Fallback icon",badge:"Badge overlay, di default top-right",status:"Presence dot or overlay content, bottom-right by default",topLeft:"Top-left overlay content",topRight:"Top-right overlay content",bottomLeft:"Bottom-left overlay content",bottomRight:"Bottom-right overlay content"},returns:"HTMLDivElement",description:"Flexible avatar with image, smart fallbacks, states, badge, and overlay slots."}),v.Chip=(...t)=>{var he,U,W,oe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Et(e.size,()=>{const Z=o(e.size);return typeof Z=="string"&&ms[Z]?Z:""}),d=fe(["cms-clear-set","cms-chip","cms-singularity",i,e.class]),S=JSswift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);S.class=d,S.style={...e.style||{}};const u=e.icon?typeof e.icon=="string"?v.Icon({name:e.icon,size:(he=e==null?void 0:e.size)!=null?he:null}):JSswift.ui.slot(e.icon,{as:"icon"}):null,l=e.iconRight?typeof e.iconRight=="string"?v.Icon({name:e.iconRight,size:(U=e==null?void 0:e.size)!=null?U:null}):JSswift.ui.slot(e.iconRight,{as:"iconRight"}):null,w=JSswift.ui.renderSlot(s,"icon",{},u),D=JSswift.ui.renderSlot(s,"iconRight",{},l),A=r(s,"label",{},e.label),C=A.length?A:r(s,"default",{},n),z=r(null,"default",{},w),le=r(null,"default",{},D),te=_.span(S,...z,...C.length?C:[""],...le);if(e.removable){const Z=v.Btn({class:"cms-chip-remove",onClick:e.onRemove,size:(W=e==null?void 0:e.size)!=null?W:null},v.Icon({size:(oe=e==null?void 0:e.size)!=null?oe:null,name:"close"}));te.appendChild(Z),Z.onclick=()=>{e.onRemove&&e.onRemove(),te.remove()}}return G(te,e),te},(ji=JSswift.isDev)!=null&&ji.call(JSswift)&&(v.meta=v.meta||{},v.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 with optional icon and removal."}),v.Stat=(...t)=>{var ye,pe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Vt(o(e.state)||o(e.color)||""),d=Et([e.state,e.color],()=>{const me=i();return me?`cms-state-${me}`:""}),S=Et(e.trend,()=>{const me=String(o(e.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(me)?"is-positive":["down","negative","danger","loss","decrease"].includes(me)?"is-negative":["flat","neutral","steady","stable"].includes(me)?"is-neutral":""}),u={...e},l=JSswift.omit(u,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","meta","note","slots","state","subtitle","title","trend","value"]);l.class=fe(["cms-clear-set","cms-stat","cms-singularity",d,S,u.class]),l.style={...u.style||{}};const w=(me,ue,H={})=>r(s,me,H,ue),D=e.icon==null?null:typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||"md"}):JSswift.ui.slot(e.icon,{as:"icon"}),A=w("eyebrow",e.eyebrow),C=w("label",(ye=e.label)!=null?ye:e.title),z=w("value",e.value),le=w("note",(pe=e.note)!=null?pe:e.subtitle),te=w("meta",e.meta),he=w("delta",e.delta,{trend:e.trend}),U=w("icon",D),W=w("aside",e.aside),oe=w("footer",e.footer),Z=w("actions",e.actions),ge=w("default",n),Ae=_.article(l,_.div({class:"cms-stat-head"},_.div({class:"cms-stat-lead"},U.length?_.div({class:"cms-stat-icon"},...U):null,_.div({class:"cms-stat-copy"},A.length?_.div({class:"cms-stat-eyebrow"},...A):null,C.length?_.div({class:"cms-stat-label"},...C):null)),W.length?_.div({class:"cms-stat-aside"},...W):null),_.div({class:"cms-stat-body"},z.length?_.div({class:"cms-stat-value"},...z):null,he.length?_.div({class:"cms-stat-delta"},...he):null,le.length?_.div({class:"cms-stat-note"},...le):null,te.length?_.div({class:"cms-stat-meta"},...te):null,ge.length?_.div({class:"cms-stat-extra"},...ge):null),oe.length||Z.length?_.div({class:"cms-stat-footer"},oe.length?_.div({class:"cms-stat-footer-copy"},...oe):null,Z.length?_.div({class:"cms-stat-actions"},...Z):null):null);return G(Ae,e),Ae},(Hi=JSswift.isDev)!=null&&Hi.call(JSswift)&&(v.meta=v.meta||{},v.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:"Compact surface for single metrics, trends, and operational metadata."}),v.Kpi=(...t)=>{var ye,pe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Vt(o(e.state)||o(e.color)||""),d=Et([e.state,e.color],()=>{const me=i();return me?`cms-state-${me}`:""}),S={...e},u=JSswift.omit(S,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","media","meta","note","slots","state","subtitle","title","trend","value"]);u.class=fe(["cms-clear-set","cms-kpi","cms-singularity",d,S.class]),u.style={...S.style||{}};const l=(me,ue,H={})=>r(s,me,H,ue),w=e.icon==null?null:typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||"lg"}):JSswift.ui.slot(e.icon,{as:"icon"}),D=l("eyebrow",e.eyebrow),A=l("title",(ye=e.title)!=null?ye:e.label),C=l("value",e.value),z=l("delta",e.delta,{trend:e.trend}),le=l("note",(pe=e.note)!=null?pe:e.subtitle),te=l("meta",e.meta),he=l("icon",w),U=l("aside",e.aside),W=l("media",e.media),oe=l("footer",e.footer),Z=l("actions",e.actions),ge=l("default",n),Ae=_.section(u,_.div({class:"cms-kpi-head"},_.div({class:"cms-kpi-title-wrap"},he.length?_.div({class:"cms-kpi-icon"},...he):null,_.div({class:"cms-kpi-copy"},D.length?_.div({class:"cms-kpi-eyebrow"},...D):null,A.length?_.div({class:"cms-kpi-title"},...A):null)),U.length?_.div({class:"cms-kpi-aside"},...U):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},C.length?_.div({class:"cms-kpi-value"},...C):null,z.length?_.div({class:"cms-kpi-delta"},...z):null),le.length?_.div({class:"cms-kpi-note"},...le):null,te.length?_.div({class:"cms-kpi-meta"},...te):null,W.length?_.div({class:"cms-kpi-media"},...W):null,ge.length?_.div({class:"cms-kpi-extra"},...ge):null),oe.length||Z.length?_.div({class:"cms-kpi-footer"},oe.length?_.div({class:"cms-kpi-footer-copy"},...oe):null,Z.length?_.div({class:"cms-kpi-actions"},...Z):null):null);return G(Ae,e),Ae},(Vi=JSswift.isDev)!=null&&Vi.call(JSswift)&&(v.meta=v.meta||{},v.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:"Richer surface for KPIs, headline metrics, and mini dashboard summaries."});const ta=(t,e=180)=>{const n=getComputedStyle(t).transitionDuration;if(!n)return e;const s=n.split(",")[0].trim();if(!s)return e;const i=s.includes("ms")?parseFloat(s):parseFloat(s)*1e3;return Number.isFinite(i)?i:e},_s=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"))}))},Fs=(t,e)=>{if(!(t!=null&&t.overlay)||!(t!=null&&t.panel)){e==null||e();return}if(t._closing)return;t._closing=!0,t.overlay.classList.add("leave"),t.panel.classList.add("leave");const n=()=>{t._closed||(t._closed=!0,e==null||e())},s=d=>{d.target===t.panel&&(t.panel.removeEventListener("transitionend",s),n())};t.panel.addEventListener("transitionend",s);const i=ta(t.panel,180);setTimeout(n,i+40)};v.List=(...t)=>{var U;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=!!o((U=e.number)!=null?U:e.ordered),d=o(e.marker),S=o(e.items),u=Array.isArray(S)?S:S==null?[]:[S],l=(W={})=>{const oe=e.itemProps||{},Z={...oe,...W};return e.divider!=null&&Z.divider==null&&(Z.divider=e.divider),Z.class=fe([oe.class,e.itemClass,W.class]),Z.style={...oe.style||{},...e.itemStyle||{},...W.style||{}},Z},w=W=>{if(W==null||W===!1)return[];if(Cs(W))return[W];if(ts(W)){const oe=W.children!=null?jn(W.children):W.content!=null?jn(W.content):jn(W.node);return[v.Item(l(W),...oe)]}return Array.isArray(W)?[v.Item(l(),...W)]:W!=null&&W.nodeType?[v.Item(l(),W)]:[v.Item(l(),W)]},D=(W,oe,Z,ge=!0)=>{if(W==null||W===!1)return[];if(ge){const Ae={item:W,index:oe,count:Z,first:oe===0,last:oe===Z-1},ye=r(s,"item",Ae,null);if(ye.length)return ye.flatMap(pe=>w(pe))}return w(W)},A=[];u.forEach((W,oe)=>{A.push(...D(W,oe,u.length))});const C=r(s,"default",{items:u,count:u.length},n);if(C.forEach((W,oe)=>{A.push(...D(W,u.length+oe,u.length+C.length,!1))}),!A.length){const W=r(s,"empty",{items:u,count:0},e.empty);W.length&&(W.length===1&&Cs(W[0])?A.push(W[0]):A.push(v.Item({class:"cms-item-empty",flat:!0},...W)))}const z=fe(["cms-list",xe(e.dense,"dense"),xe(e.divider,"divider"),xe(d===!1||d==="none","cms-list-no-marker"),e.class]),le=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);le.class=z,le.style={...e.style||{}};const te=Ke(e.gap,ht);return te!=null&&(le.style["--cms-list-gap"]=te),d!=null&&d!==!1&&d!==!0&&d!=="none"&&(le.style.listStyleType=String(d)),_[i?"ol":"ul"](le,...A)},(Bi=JSswift.isDev)!=null&&Bi.call(JSswift)&&(v.meta=v.meta||{},v.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."}),v.Item=(...t)=>{var I,g,p,h,V,re,c,N;const{props:e,children:n}=JSswift.uiNormalizeArgs(t);e.state!=null&&e.color==null&&(e.color=e.state),xn(e);const s=e.slots||{},i=Et([e.clickable,e.to],()=>!!(o(e.clickable)||o(e.to))),d=Et([e.active,e.selected],()=>!!(o(e.active)||o(e.selected))),S=!!(e.color!=null||e.outline||e.border||e.glossy||e.glow||e.glass||e.shadow||e.gradient||e.textGradient||e.lightShadow||e.radius||e.rounded||e.flat),u=(b,J,Q)=>{const ee=o(b);return ee==null||ee===!1||ee===""?null:typeof ee=="string"?v.Icon({name:ee,size:J||"sm"}):JSswift.ui.slot(ee,{as:Q})},l=r(s,"icon",{},u(e.icon,e.iconSize||e.size,"icon")),w=r(s,"title",{},(I=e.title)!=null?I:e.label),D=r(s,"subtitle",{},(p=(g=e.subtitle)!=null?g:e.caption)!=null?p:e.description),A=r(s,"meta",{},(h=e.meta)!=null?h:e.eyebrow),C=r(s,"body",{},(V=e.body)!=null?V:e.content),z=r(s,"default",{},n),le=r(s,"actions",{},(re=e.actions)!=null?re:e.footer),te=(N=(c=e.aside)!=null?c:e.trailing)!=null?N:u(e.iconRight,e.iconSize||e.size,"iconRight"),he=r(s,"aside",{},te),U=[...C,...z],W=!(S||e.clickable||e.to||l.length||w.length||D.length||A.length||le.length||he.length||C.length),oe=fe(["cms-item",xe(e.divider,"divider"),xe(S,"cms-clear-set"),xe(S,"cms-singularity"),xe(S,"cms-item-surface"),xe(W,"cms-item-inline"),xe(i,"cms-item-clickable"),xe(d,"is-active"),xe(e.disabled,"is-disabled"),e.class]),Z=JSswift.omit(e,["divider","slots","label","title","subtitle","caption","description","meta","eyebrow","body","content","children","node","icon","iconRight","iconSize","aside","trailing","actions","footer","clickable","to","active","selected","disabled","state","color","size","outline","flat","border","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","dense"]);Z.class=oe,Z.style={...e.style||{}};const ge=e.onClick,Ae=e.onKeydown,ye=b=>{var Q;if(ge==null||ge(b),b.defaultPrevented||o(e.disabled))return;const J=o(e.to);J&&((Q=JSswift.router)!=null&&Q.navigate)&&(b.preventDefault(),JSswift.router.navigate(J))},pe=b=>{Ae==null||Ae(b),!(b.defaultPrevented||o(e.disabled))&&(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),ye(b))};o(e.disabled)&&(Z["aria-disabled"]="true"),(o(e.clickable)||o(e.to))&&(Z.onClick=ye,Z.onKeydown=pe,Z.tabIndex==null&&(Z.tabIndex=o(e.disabled)?-1:0),Z.role==null&&(Z.role="button"));const me=w.length?_.div({class:"cms-item-title"},...w):null,ue=D.length?_.div({class:"cms-item-subtitle"},...D):null,H=A.length?_.div({class:"cms-item-meta"},...A):null,ae=U.length?_.div({class:fe(["cms-item-body",xe(!(w.length||D.length||A.length),"is-standalone")])},...U):null,ie=le.length?_.div({class:"cms-item-actions"},...le):null,ve=_.li(Z,_.div({class:"cms-item-row"},l.length?_.div({class:"cms-item-icon"},...l):null,_.div({class:"cms-item-main"},H,me,ue,ae,ie),he.length?_.div({class:"cms-item-aside"},...he):null));return G(ve,e),ve},($i=JSswift.isDev)!=null&&$i.call(JSswift)&&(v.meta=v.meta||{},v.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 of 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:"Structured item for simple lists, feeds, task lists, and clickable rows."}),v.Separator=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=fe(["cms-separator",xe(e.vertical,"vertical"),e.class]),s=JSswift.omit(e,["vertical","size","slots"]);s.class=n;const i={borderColor:"var(--cms-border)",...e.style||{}},d=o(e.size),S=o(e.vertical);if(d!=null){const u=ht(d);S?i.width=u:i.height=u}return s.style=i,_.hr(s)},(Ui=JSswift.isDev)!=null&&Ui.call(JSswift)&&(v.meta=v.meta||{},v.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."}),v.Banner=(...t)=>{var ve;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Vt(o(e.type)||o(e.state)||""),d={state:i,dismissible:()=>!!o(e.dismissible)},S=Et([e.type,e.state],()=>i()),u=Et(e.variant,()=>{const I=String(o(e.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(I)?`cms-banner-${I}`:""}),l=Et([e.actionsPlacement,e.stack],()=>String(o(e.actionsPlacement)||"").toLowerCase()==="bottom"||o(e.stack)?"cms-banner-actions-bottom":""),w=Et(e.stack,()=>o(e.stack)?"cms-banner-stack":""),D={...e},A=JSswift.omit(D,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);A.class=fe(["cms-clear-set","cms-banner","cms-singularity",S,u,l,w,D.class]),A.style={...D.style||{}};const C=I=>{if(I==null||I==="")return"";const g=o(I);if(g==null||g==="")return"";const p=String(g);return Tn(p)?`var(--cms-${p})`:p};(e.accent!=null||Dt(e.accent))&&(A.style["--cms-banner-accent"]=()=>C(e.accent),A.style["--cms-banner-border"]=()=>{const I=C(e.accent);return I?`color-mix(in srgb, ${I} 38%, var(--cms-border-color))`:""},A.style["--cms-banner-bg"]=()=>{const I=C(e.accent);return I?`color-mix(in srgb, ${I} 14%, var(--cms-panel))`:""},A.style["--cms-banner-color"]=()=>{const I=C(e.accent);return I?`color-mix(in srgb, ${I} 78%, white)`:""});const z={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},le=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||e.size||"md"}):JSswift.ui.slot(e.icon,{as:"icon"});const I=i(),g=I?z[I]:null;return g?v.Icon({name:g,size:e.iconSize||e.size||"md"}):null})(),te=r(s,"title",d,e.title),he=r(s,"message",d,e.message!=null?e.message:n),U=r(s,"description",d,(ve=e.description)!=null?ve:e.subtitle),W=r(s,"meta",d,e.meta),oe=r(s,"default",d,e.body!=null?[e.body,...n||[]]:e.message!=null?n:null),Z=r(s,"icon",d,le),ge=r(s,"aside",d,e.aside),Ae=r(s,"actions",d,e.actions),ye=r(s,"dismiss",d,e.dismiss),pe=String(o(e.actionsPlacement)||"").toLowerCase()==="bottom"||!!o(e.stack),me=!!o(e.dismissible)||!!e.onDismiss;let ue=null;const H=me?v.Btn({class:"cms-banner-close",outline:!0,size:e.size||"sm","aria-label":e.closeLabel||"Chiudi banner",onClick:I=>{var g;(g=e.onDismiss)==null||g.call(e,I),!I.defaultPrevented&&(ue==null||ue.remove())}},v.Icon({name:"close",size:e.size||"sm"})):null,ae=[...ge,...pe?[]:Ae,...ye.length?ye:H?[H]:[]];ue=_.div(A,Z.length?_.div({class:"cms-banner-icon"},...Z):null,_.div({class:"cms-banner-body"},_.div({class:"cms-banner-copy"},te.length?_.div({class:"cms-banner-title"},...te):null,he.length?_.div({class:"cms-banner-message"},...he):null,U.length?_.div({class:"cms-banner-description"},...U):null,oe.length?_.div({class:"cms-banner-extra"},...oe):null,W.length?_.div({class:"cms-banner-meta"},...W):null),pe&&Ae.length?_.div({class:"cms-banner-actions"},...Ae):null),ae.length?_.div({class:"cms-banner-side"},...ae):null);const ie=A.role||(()=>{const I=i();return I==="danger"||I==="warning"?"alert":"status"})();return ue.setAttribute("role",ie),G(ue,e),ue},(Wi=JSswift.isDev)!=null&&Wi.call(JSswift)&&(v.meta=v.meta||{},v.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:"Structured banner with tone, actions, dismiss, and composable slots."}),v.Alert=(...t)=>{var Z;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Vt(o(e.type)||o(e.state)||o(e.color)||"warning"),d=Et([e.type,e.state,e.color],()=>{const ge=i();return ge?`cms-state-${ge}`:""}),S={...e},u=JSswift.omit(S,["actions","aside","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","state","subtitle","title","type","variant"]);u.class=fe(["cms-clear-set","cms-alert","cms-singularity",d,xe(e.dismissible,"is-dismissible"),S.class]),u.style={...S.style||{}};const l={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},w=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"});const ge=l[i()]||l.warning;return v.Icon({name:ge,size:e.iconSize||"sm"})})(),D=r(s,"title",{},e.title),A=r(s,"message",{},e.message!=null?e.message:n),C=r(s,"description",{},(Z=e.description)!=null?Z:e.subtitle),z=r(s,"meta",{},e.meta),le=r(s,"actions",{},e.actions),te=r(s,"aside",{},e.aside),he=r(s,"icon",{},w),U=r(s,"dismiss",{},e.dismiss);let W=null;const oe=e.dismissible||e.onDismiss?v.Btn({class:"cms-alert-close",outline:!0,size:"sm","aria-label":e.closeLabel||"Chiudi alert",onClick:ge=>{var Ae;(Ae=e.onDismiss)==null||Ae.call(e,ge),!ge.defaultPrevented&&(W==null||W.remove())}},v.Icon({name:"close",size:"sm"})):null;return W=_.div(u,he.length?_.div({class:"cms-alert-icon"},...he):null,_.div({class:"cms-alert-body"},D.length?_.div({class:"cms-alert-title"},...D):null,A.length?_.div({class:"cms-alert-message"},...A):null,C.length?_.div({class:"cms-alert-description"},...C):null,z.length?_.div({class:"cms-alert-meta"},...z):null,le.length?_.div({class:"cms-alert-actions"},...le):null),te.length||U.length||oe?_.div({class:"cms-alert-side"},...te,...U.length?U:oe?[oe]:[]):null),W.setAttribute("role",i()==="danger"||i()==="warning"?"alert":"status"),G(W,e),W},(Gi=JSswift.isDev)!=null&&Gi.call(JSswift)&&(v.meta=v.meta||{},v.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."}),v.EmptyState=(...t)=>{var oe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Vt(o(e.state)||o(e.color)||""),d=Et([e.state,e.color],()=>{const Z=i();return Z?`cms-state-${Z}`:""}),S={...e},u=JSswift.omit(S,["actions","description","eyebrow","icon","iconSize","illustration","media","message","meta","slots","state","title"]);u.class=fe(["cms-clear-set","cms-empty-state","cms-singularity",d,xe(e.compact,"compact"),xe(e.inline,"inline"),S.class]),u.style={...S.style||{}};const l=e.icon===!1?null:e.icon!=null?typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||"xl"}):JSswift.ui.slot(e.icon,{as:"icon"}):v.Icon({name:"inbox",size:e.iconSize||"xl"}),w=r(s,"illustration",{},(oe=e.illustration)!=null?oe:e.media),D=r(s,"icon",{},l),A=r(s,"eyebrow",{},e.eyebrow),C=r(s,"title",{},e.title),z=r(s,"message",{},e.message!=null?e.message:n),le=r(s,"description",{},e.description),te=r(s,"meta",{},e.meta),he=r(s,"actions",{},e.actions),U=r(s,"default",{},e.message!=null?n:null),W=_.section(u,w.length?_.div({class:"cms-empty-state-illustration"},...w):null,D.length?_.div({class:"cms-empty-state-icon"},...D):null,A.length?_.div({class:"cms-empty-state-eyebrow"},...A):null,C.length?_.div({class:"cms-empty-state-title"},...C):null,z.length?_.div({class:"cms-empty-state-message"},...z):null,le.length?_.div({class:"cms-empty-state-description"},...le):null,te.length?_.div({class:"cms-empty-state-meta"},...te):null,U.length?_.div({class:"cms-empty-state-extra"},...U):null,he.length?_.div({class:"cms-empty-state-actions"},...he):null);return G(W,e),W},(Ki=JSswift.isDev)!=null&&Ki.call(JSswift)&&(v.meta=v.meta||{},v.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 Xn="jsswift:drawer-open";const ni=new Set,Jo=new Map,os=(t=Xn)=>{const e=JSswift==null?void 0:JSswift.store;if(e!=null&&e.get){const n=e.get(t,void 0);if(typeof n=="boolean")return n}try{return localStorage.getItem(t)==="1"}catch(n){return!1}},na=(t,e=Xn)=>{const n=JSswift==null?void 0:JSswift.store;if(n!=null&&n.set){n.set(e,!!t);return}try{localStorage.setItem(e,t?"1":"0")}catch(s){}};let _n=os();const Bn=(t,e=Xn)=>{_n=!!t;const n=Jo.get(e);if(n&&n.size)n.forEach(s=>s==null?void 0:s.classList.toggle("open",_n));else{const s=document.querySelector(".cms-drawer");s&&s.classList.toggle("open",_n)}return ni.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(_n);return}const{el:i,openIcon:d,closeIcon:S}=s;i&&(i.textContent=_n?d:S)}),na(_n,e),_n};v.Tooltip=(...t)=>{var ie,ve;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{};let i=null,d=null,S=null,u=null;const l=I=>Object.prototype.hasOwnProperty.call(e,I),w=l("target")||l("anchorEl")||l("triggerEl"),D=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),A=(I,g)=>{const p=o(I);if(p==null||p==="")return g;const h=Number(p);return Number.isFinite(h)?h:g},C=()=>{clearTimeout(d),clearTimeout(S),d=null,S=null},z=()=>A(e.delay,350),le=()=>A(e.hideDelay,o(e.interactive)?120:0),te=()=>{if(C(),!i)return;const I=i;i=null,Fs(I,()=>JSswift.overlay.close(I.id))},U=(I=>{if(I==null||I===!0)return new Set(["hover","focus"]);if(I===!1)return new Set(["manual"]);const g=Array.isArray(I)?I:String(I).split(/[\s,|/]+/),p=new Set;return g.forEach(h=>{const V=String(h||"").trim().toLowerCase();V&&(V==="mouseenter"||V==="mouseover"?p.add("hover"):V==="blur"||V==="focusin"?p.add("focus"):V==="tap"?p.add("click"):p.add(V))}),p.size?p:new Set(["manual"])})((ve=(ie=e.trigger)!=null?ie:e.triggers)!=null?ve:l("open")?"manual":null),W=U.has("hover"),oe=U.has("focus"),Z=U.has("click"),ge=U.has("manual")||!W&&!oe&&!Z,Ae=()=>{var Q,ee,we,F,m,L;const I={anchorEl:u||D||null,close:()=>te(),hide:()=>te(),isOpen:()=>!!i},g=e.icon?typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,p=r(s,"title",I,(Q=e.title)!=null?Q:e.heading),h=r(s,"icon",I,g),V=r(s,"footer",I,(ee=e.footer)!=null?ee:e.actions);let re=(L=(m=(F=(we=e.content)!=null?we:e.text)!=null?F:e.body)!=null?m:e.description)!=null?L:e.label;re==null&&(w?re=n:D&&n&&n.length>1?re=n.slice(1):D||(re=n));let c=r(s,"content",I,re);c.length||(c=r(s,"default",I,re));const N=c.length?_.div({class:"cms-tooltip-body"},...c):null,b=h.length||p.length?_.div({class:"cms-tooltip-head"},h.length?_.div({class:"cms-tooltip-icon"},...h):null,_.div({class:"cms-tooltip-head-main"},p.length?_.div({class:"cms-tooltip-title"},...p):null,N)):N,J=V.length?_.div({class:"cms-tooltip-footer"},...V):null;return _.div({class:"cms-tooltip-content"},...[b,J].filter(Boolean))},ye=I=>{var c,N,b,J,Q,ee;const g=I||u;if(!g||o(e.disabled))return null;if(i&&i._anchorEl===g)return i;i&&te();const p=(c=e.closeOnOutside)!=null?c:Z||o(e.interactive),h=(N=e.closeOnEsc)!=null?N:Z||o(e.interactive);let V=null;if(i=JSswift.overlay.open(()=>Ae(),{type:"tooltip",anchorEl:g,placement:e.placement||"top",offsetX:(b=e.offsetX)!=null?b:0,offsetY:(Q=(J=e.offsetY)!=null?J:e.offset)!=null?Q:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:p,closeOnBackdrop:!1,closeOnEsc:h,autoFocus:!1,className:zn(["cms-tooltip",xe(e.interactive,"interactive"),e.class,e.panelClass]),onClose:()=>{var we,F;(we=V==null?void 0:V._tooltipCleanup)==null||we.call(V),i===V&&(i=null),(F=e.onClose)==null||F.call(e)}}),!(i!=null&&i.panel))return i;const re=i;if(V=re,re._anchorEl=g,re.panel.dataset.placement=String(o(e.placement||"top")),e.maxWidth!=null&&(re.panel.style.maxWidth=ht(o(e.maxWidth))),e.minWidth!=null&&(re.panel.style.minWidth=ht(o(e.minWidth))),e.width!=null&&(re.panel.style.width=ht(o(e.width))),e.style&&Object.assign(re.panel.style,e.style),G(re.panel,e),o(e.interactive)){const we=()=>{clearTimeout(S),S=null},F=()=>me(),m=L=>{const P=L.target;P&&P.closest&&P.closest("[data-tooltip-close]")&&te()};re.panel.addEventListener("mouseenter",we),re.panel.addEventListener("mouseleave",F),re.panel.addEventListener("focusin",we),re.panel.addEventListener("focusout",F),re.panel.addEventListener("click",m),re._tooltipCleanup=()=>{var L,P,Y,Ne,ze;(L=re.panel)==null||L.removeEventListener("mouseenter",we),(P=re.panel)==null||P.removeEventListener("mouseleave",F),(Y=re.panel)==null||Y.removeEventListener("focusin",we),(Ne=re.panel)==null||Ne.removeEventListener("focusout",F),(ze=re.panel)==null||ze.removeEventListener("click",m)}}return _s(re),(ee=e.onOpen)==null||ee.call(e,re),re},pe=I=>{clearTimeout(S),S=null,clearTimeout(d),d=setTimeout(()=>ye(I),z())},me=(I=!1)=>{if(clearTimeout(d),d=null,!!i){if(clearTimeout(S),I){te();return}S=setTimeout(()=>te(),le())}},ue=I=>{i?me(!0):ye(I)},H=()=>!!i,ae=I=>{if(!I)return()=>{};u=I;const g=[],p=()=>{C(),g.forEach(h=>h())};if(l("open"))return Dt(e.open)?JSswift.reactive.effect(()=>{u&&(o(e.open)?ye(u):me(!0))},"UI.Tooltip:open"):e.open===!0?ye(I):e.open===!1&&me(!0),p;if(ge||o(e.disabled))return p;if(W){const h=()=>pe(I),V=()=>me();I.addEventListener("mouseenter",h),I.addEventListener("mouseleave",V),g.push(()=>{I.removeEventListener("mouseenter",h),I.removeEventListener("mouseleave",V)})}if(oe){const h=()=>pe(I),V=()=>me();I.addEventListener("focus",h),I.addEventListener("blur",V),g.push(()=>{I.removeEventListener("focus",h),I.removeEventListener("blur",V)})}if(Z){const h=V=>{var re;(re=e.onTriggerClick)==null||re.call(e,V),!V.defaultPrevented&&ue(I)};I.addEventListener("click",h),g.push(()=>I.removeEventListener("click",h))}return p};if(D){const I=fe(["cms-tooltip-wrap",e.wrapClass,e.targetClass]),g=JSswift.omit(e,["actions","anchorEl","body","closeOnEsc","closeOnOutside","content","delay","description","disabled","footer","heading","hideDelay","icon","iconSize","interactive","label","maxWidth","minWidth","offset","offsetX","offsetY","onClose","onOpen","onTriggerClick","open","panelClass","placement","slots","style","target","targetClass","targetStyle","text","title","trigger","triggerEl","triggers","width","wrapClass","wrapStyle"]);g.class=I,g.style={display:"inline-flex",alignItems:"center",...e.wrapStyle||e.targetStyle||{}};const p=JSswift.ui.renderSlot(s,"target",{open:()=>ye(u),show:()=>pe(u),hide:()=>me(!0),toggle:()=>ue(u),isOpen:H},D),h=_.span(g,...r(null,"default",{},p));return ae(h),h._tooltip={bind:ae,open:ye,show:pe,hide:me,close:te,toggle:ue,isOpen:H},h}return{bind:ae,open:ye,show:pe,hide:me,close:te,toggle:ue,isOpen:H}},(qi=JSswift.isDev)!=null&&qi.call(JSswift)&&(v.meta=v.meta||{},v.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:"Anchored tooltip with hover/focus/click triggers, rich content, and imperative API."});const Oo=(t,e,n={})=>{var I;const{props:s,children:i}=JSswift.uiNormalizeArgs(e),d=s.slots||{},S=t==="radio",u=n.appearance==="toggle",l=!S,w=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),D=bn(s.model,n.modelName||(S?"UI.Radio:model":"UI.Checkbox:model")),A=JSswift.omit(s,["model","label","checked","class","style","dense","onChange","onInput","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","inputClass","iconSize","color","size","outline","behavior","mode","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);A.type=t,A.id=w,S&&s.name!=null&&(A.name=s.name),A.class=fe([`cms-${t}`,"cms-choice-input",s.inputClass]);const C=_.input(A),z=r(d,"label",{},s.label),le=z.length?z:r(d,"default",{},i),te=Nt(s,{className:"cms-shortcode cms-choice-shortcode"}),he=te?[...le,te]:le,U=JSswift.omit(s,["model","label","checked","onChange","onInput","value","name","id","type","dense","inputClass","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","iconSize","color","size","behavior","mode","outline","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);U.class=fe(["cms-clear-set","cms-singularity-check","cms-choice-wrap",`cms-${t}-wrap`,xe(u,"cms-toggle-wrap"),xe(u&&S,"cms-toggle-radio-wrap"),xe(u&&!S,"cms-toggle-checkbox-wrap"),xe(s.dense,"dense"),s.class]),U.style={...s.style||{}};const W=o(s.size);W!=null&&!(typeof W=="string"&&((I=JSswift.uiSizes)!=null&&I.includes(W)))&&(U.style["--cms-choice-size"]=ht(W));const oe=_.span({class:fe(["cms-choice-mark",S?"cms-choice-radio-mark":"cms-choice-checkbox-mark",xe(u,"cms-toggle-mark")])}),Z=u?_.span({class:"cms-toggle-thumb"}):oe;u&&oe.appendChild(Z);const ge=he.length?_.span({class:"cms-choice-label"},...he):null,Ae=_.label(U,C,oe,ge);G(Ae,s);const ye=s.iconSize?s.iconSize:s.size,pe=u?null:S?"radio_button_checked":"check",me=u?null:S?"radio_button_unchecked":null,ue=u||S?null:"indeterminate_check_box",H=g=>{if(S)return C.checked=g==s.value,C.checked;const p=g==null?null:!!g;return C.checked=p===!0,C.indeterminate=l&&p==null,p},ae=()=>!S&&l&&C.indeterminate?null:!!C.checked,ie=g=>g===!0?s.checkedIcon!=null?s.checkedIcon:s.icon!=null?s.icon:pe:g===!1?s.uncheckedIcon!=null?s.uncheckedIcon:me:s.indeterminateIcon!=null?s.indeterminateIcon:s.standbyIcon!=null?s.standbyIcon:s.iconStandby!=null?s.iconStandby:ue,ve=()=>{const g=ae(),p=g===!0;for(;Z.firstChild;)Z.removeChild(Z.firstChild);Ae.classList.toggle("is-checked",p),Ae.classList.toggle("is-indeterminate",g==null),Ae.classList.toggle("is-disabled",!!C.disabled),p&&(s.checkedIcon||s.icon)?Ae.classList.toggle("toggle-default",!1):p&&!s.checkedIcon||g==null&&!s.standbyIcon?Ae.classList.toggle("toggle-default",!0):g==null&&s.standbyIcon?Ae.classList.toggle("toggle-default",!1):C.disabled===!1&&!s.uncheckedIcon?Ae.classList.toggle("toggle-default",!0):Ae.classList.toggle("toggle-default",!1),u&&(g==null?Z.style.transform="translateX(calc((var(--cms-toggle-width) - var(--cms-toggle-thumb-size) - 1px) / 2))":Z.style.removeProperty("transform"));const h={checked:p,state:g,indeterminate:g==null,value:s.value,id:w,type:t};let V=null;if(g===!0?(V=JSswift.ui.renderSlot(d,"checkedIcon",h,null),V==null&&(V=JSswift.ui.renderSlot(d,"iconOn",h,null))):g===!1?(V=JSswift.ui.renderSlot(d,"uncheckedIcon",h,null),V==null&&(V=JSswift.ui.renderSlot(d,"iconOff",h,null))):(V=JSswift.ui.renderSlot(d,"indeterminateIcon",h,null),V==null&&(V=JSswift.ui.renderSlot(d,"standbyIcon",h,null)),V==null&&(V=JSswift.ui.renderSlot(d,"iconStandby",h,null))),V==null&&(V=JSswift.ui.renderSlot(d,"icon",h,null)),V==null){const re=ie(g);typeof re=="string"?V=v.Icon({name:re,size:ye,...u?{textColor:s.color,outline:!0}:{}}):re!=null&&(V=JSswift.ui.slot(re,{checked:p,state:g,indeterminate:g==null,as:g===!0?"checkedIcon":g===!1?"uncheckedIcon":"indeterminateIcon"}))}r(null,"default",{},V).forEach(re=>Z.appendChild(re))};return D?(H(D.get()),D.watch(g=>{H(g),ve()},S?"UI.Radio:watch":"UI.Checkbox:watch"),C.addEventListener("change",g=>{var p,h;if(S)C.checked&&(D.set(s.value),(p=s.onChange)==null||p.call(s,s.value,g));else{const V=ae();D.set(V),(h=s.onChange)==null||h.call(s,V,g)}ve()})):(H(S?s.checked===!0?s.value:void 0:s.checked),C.addEventListener("change",g=>{var p,h;S?(p=s.onChange)==null||p.call(s,s.value,g):(h=s.onChange)==null||h.call(s,ae(),g),ve()})),s.onInput&&C.addEventListener("input",g=>{var p,h;S?(p=s.onInput)==null||p.call(s,s.value,g):(h=s.onInput)==null||h.call(s,ae(),g)}),ve(),_t(Ae,s,{isEnabled:()=>!C.disabled,action:()=>{if(C.disabled)return!1;Ve(C),C.click()}}),Ae};v.Checkbox=(...t)=>Oo("checkbox",t),(Yi=JSswift.isDev)!=null&&Yi.call(JSswift)&&(v.meta=v.meta||{},v.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 of icon/checkedIcon",iconOff:"Alias of uncheckedIcon",iconStandby:"Icon for null/indeterminate state",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",color:"string",size:"string|number",outline:"boolean",dense:"boolean",shortcode:"string|Array<string>|object",showShortcode:"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."}),v.Radio=(...t)=>Oo("radio",t),(Xi=JSswift.isDev)!=null&&Xi.call(JSswift)&&(v.meta=v.meta||{},v.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 of icon/checkedIcon",iconOff:"Alias of uncheckedIcon",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",color:"string",size:"string|number",outline:"boolean",dense:"boolean",shortcode:"string|Array<string>|object",showShortcode:"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."}),v.Toggle=(...t)=>{var s,i,d;const{props:e}=JSswift.uiNormalizeArgs(t),n=String((d=(i=(s=e.behavior)!=null?s:e.mode)!=null?i:e.type)!=null?d:"checkbox").toLowerCase()==="radio"?"radio":"checkbox";return Oo(n,t,{appearance:"toggle",modelName:"UI.Toggle:model"})},(Qi=JSswift.isDev)!=null&&Qi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Toggle={signature:"UI.Toggle(...children) | UI.Toggle(props, ...children)",props:{label:"String|Node|Function|Array",behavior:'"checkbox"|"radio"',mode:"Alias of behavior",value:"any",name:"string",checked:"boolean",model:"[get,set] signal",icon:"String|Node|Function|Array",iconOn:"Alias of icon/checkedIcon",iconOff:"Alias of uncheckedIcon",iconStandby:"Icon for null/indeterminate state",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",color:"string",size:"string|number",dense:"boolean",shortcode:"string|Array<string>|object",showShortcode:"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."}),v.Slider=(...t)=>{var Y,Ne,ze,Ee,K;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(Gt(e.value)||rn(e.value)?e.value:null),d=bn(i,"UI.Slider:model"),S=JSswift.omit(e,["model","value","class","style","onChange","onInput","slots","label","icon","iconRight","thumbIcon","iconThumb","pointIcon","markers","markerLabels","labelMarks","leftLabel","rightLabel","startLabel","endLabel","minLabel","maxLabel","withQItem","qitem","item","itemClass","itemStyle","showValue","thumbLabel","labelValue","selectionColor","trackColor","thumbColor","inputClass","readonly","size"]);S.type="range",S.class=fe(["cms-slider-input",e.inputClass]);const u=_.input(S),l={...e.style||{}},w=o(e.size);if(w!=null){const $=typeof w=="string"&&((Y=JSswift.uiSizes)!=null&&Y.includes(w))?`var(--cms-size-${w})`:ht(w);l["--cms-slider-size"]=$,l["--cms-slider-track-size"]=`max(4px, calc(${$} / 4))`,l["--cms-slider-box-height"]=`calc(${$} * 1.5)`,l["--cms-slider-marker-size"]=`max(6px, calc(${$} / 3))`}const D=_.label({class:fe(["cms-clear-set","cms-singularity-check","cms-slider-wrap",xe(e.dense,"dense"),e.class]),style:l});G(D,e);const A=_.div({class:"cms-slider-header"}),C=_.span({class:"cms-slider-label"}),z=_.span({class:"cms-slider-value"});A.append(C,z);const le=_.div({class:"cms-slider-body"}),te=_.span({class:"cms-slider-icon cms-slider-icon-left"}),he=_.span({class:"cms-slider-edge-label cms-slider-edge-label-left"}),U=_.div({class:"cms-slider-main"}),W=_.div({class:"cms-slider-box",style:{minHeight:"var(--cms-slider-box-height, 36px)"}}),oe=_.span({class:"cms-slider-rail",style:{height:"var(--cms-slider-track-size, 6px)"}}),Z=_.span({class:"cms-slider-selection",style:{height:"var(--cms-slider-track-size, 6px)"}}),ge=_.span({class:"cms-slider-thumb",style:{width:"var(--cms-slider-size, 24px)",height:"var(--cms-slider-size, 24px)"}}),Ae=_.span({class:"cms-slider-thumb-icon"}),ye=_.span({class:"cms-slider-thumb-label"});ge.append(ye,Ae);const pe=_.div({class:"cms-slider-markers"}),me=_.span({class:"cms-slider-edge-label cms-slider-edge-label-right"}),ue=_.span({class:"cms-slider-icon cms-slider-icon-right"});W.append(oe,Z,ge,u),U.append(W,pe),le.append(te,he,U,me,ue),D.append(A,le);const H=$=>{for(;$.firstChild;)$.removeChild($.firstChild)},ae=($,se,je="")=>{H($),(se||[]).forEach(Be=>$.appendChild(Be)),$.style.display=$.childNodes.length?je:"none"},ie=$=>Gt($)||rn($)?o($):$,ve=($,se={})=>Ws(ie($),se),I=($,se,je={})=>{var ce,Oe;const Be=ie($);return Be==null?[]:typeof Be=="string"?[v.Icon({name:Be,size:(Oe=(ce=e.iconSize)!=null?ce:e.size)!=null?Oe:16})]:ve(Be,{...je,as:se})},g=($,se)=>{const je=Number($);return Number.isFinite(je)?je:se},p=()=>g(o(e.min),0),h=()=>{const $=p(),se=g(o(e.max),100);return se<$?$:se},V=()=>{const $=o(e.step);if($==="any")return"any";const se=g($,1);return se>0?se:1},re=$=>{if($==="any")return 0;const se=String($);if(se.includes("e-"))return Number(se.split("e-")[1]||0);const je=se.indexOf(".");return je===-1?0:se.length-je-1},c=$=>{const se=p(),je=h(),Be=V();let ce=g($,se);if(Be!=="any"){ce=se+Math.round((ce-se)/Be)*Be;const Oe=re(Be);Oe>0&&(ce=Number(ce.toFixed(Oe)))}return Math.min(je,Math.max(se,ce))},N=$=>{const se=p(),Be=h()-se;if(!Be)return 0;const ce=(c($)-se)/Be,Oe=o(e.reverse)?1-ce:ce;return Math.max(0,Math.min(1,Oe))},[b,J]=JSswift.reactive.signal(c(d?d.get():(ze=(Ne=o(e.value))!=null?Ne:o(e.min))!=null?ze:0)),Q=($,se={})=>{const je=c($);return b()!==je&&J(je),String(u.value)!==String(je)&&(u.value=String(je)),d&&se.fromModel!==!0&&d.set(je),je},ee=()=>{var Oe;const $=o(e.markers),se=!!o((Oe=e.markerLabels)!=null?Oe:e.labelMarks);if(!$)return[];const je=p(),Be=h(),ce=(Le,Je)=>{var Ge,He,R,Te,O,k,x,f;if(Le==null)return null;if(typeof Le=="object"&&!Array.isArray(Le)){const E=c((R=(He=(Ge=Le.value)!=null?Ge:Le.position)!=null?He:Le.at)!=null?R:je);return{key:(Te=Le.key)!=null?Te:`marker-${Je}-${E}`,value:E,label:(O=Le.label)!=null?O:se?String(E):null,icon:(k=Le.icon)!=null?k:null,className:(f=(x=Le.class)!=null?x:Le.className)!=null?f:""}}const Fe=c(Le);return{key:`marker-${Je}-${Fe}`,value:Fe,label:se?String(Le):null,icon:null,className:""}};if(Array.isArray($))return $.map((Le,Je)=>ce(Le,Je)).filter(Boolean);if(typeof $=="number"&&$>1){const Le=Math.floor($),Je=Le>1?(Be-je)/(Le-1):0;return Array.from({length:Le},(Fe,Ge)=>ce(je+Je*Ge,Ge)).filter(Boolean)}if($===!0){const Le=V();if(Le==="any")return[ce(je,0),ce(Be,1)].filter(Boolean);const Je=Math.floor((Be-je)/Le)+1;return Je>24?[ce(je,0),ce((je+Be)/2,1),ce(Be,2)].filter(Boolean):Array.from({length:Je},(Fe,Ge)=>ce(je+Le*Ge,Ge)).filter(Boolean)}return typeof $=="object"?Object.keys($).map((Le,Je)=>ce({value:Number(Le),label:$[Le]},Je)).filter(Boolean):[]},we=()=>{H(pe);const $=ee();pe.style.display=$.length?"block":"none",pe.style.minHeight=$.some(se=>se.label!=null&&se.label!=="")?"30px":"10px",$.forEach(se=>{const je=N(se.value),Be=o(e.reverse)?b()<=se.value:b()>=se.value,ce=_.button({type:"button",class:fe(["cms-slider-marker",se.className,xe(()=>Be,"active")]),style:{left:`${je*100}%`,color:Be?o(e.color)||"var(--cms-primary)":"var(--cms-muted)",cursor:o(e.disabled)||o(e.readonly)?"default":"pointer"},disabled:!!o(e.disabled)||!!o(e.readonly),onClick:()=>{var R,Te;if(o(e.disabled)||o(e.readonly))return;const He=Q(se.value);(R=e.onInput)==null||R.call(e,He),(Te=e.onChange)==null||Te.call(e,He)}}),Oe={marker:se,active:Be,value:se.value,current:b(),input:u};let Le=JSswift.ui.renderSlot(s,"marker",Oe,null);Le==null&&se.icon!=null&&(Le=typeof se.icon=="string"?v.Icon({name:se.icon,size:12}):JSswift.ui.slot(se.icon,{...Oe,as:"marker"}));const Je=_.span({class:"cms-slider-marker-tick",style:{width:"var(--cms-slider-marker-size, 8px)",height:"var(--cms-slider-marker-size, 8px)",background:Be?o(e.color)||"var(--cms-primary)":"var(--cms-border-color)"}}),Fe=Le==null?[Je]:r(null,"default",Oe,Le),Ge=se.label==null?r(s,"markerLabel",Oe,null):r(s,"markerLabel",Oe,se.label);Fe.forEach(He=>ce.appendChild(He)),Ge.length&&ce.appendChild(_.span({class:"cms-slider-marker-label"},...Ge)),pe.appendChild(ce)})},F=()=>{var Oe;const $={value:b(),input:u,props:e};let se=r(s,"label",$,ie(e.label));se.length||(se=r(s,"default",$,n)),ae(C,se,"inline-flex");const je=o(e.showValue),Be=je===!1?null:(Oe=ie(e.labelValue))!=null?Oe:b(),ce=je||ie(e.labelValue)!=null?r(s,"value",$,Be):[];ae(z,ce,"inline-flex"),A.style.display=C.childNodes.length||z.childNodes.length?"flex":"none"},m=()=>{var Je,Fe,Ge,He;const $={value:b(),input:u,props:e},se=r(s,"icon",$,null),je=se.length?se:I(e.icon,"icon",$);ae(te,je,"inline-flex");const Be=r(s,"iconRight",$,null),ce=Be.length?Be:I(e.iconRight,"iconRight",$);ae(ue,ce,"inline-flex");const Oe=ie((Fe=(Je=e.startLabel)!=null?Je:e.leftLabel)!=null?Fe:e.minLabel),Le=ie((He=(Ge=e.endLabel)!=null?Ge:e.rightLabel)!=null?He:e.maxLabel);ae(he,r(s,"startLabel",$,Oe),"inline-flex"),ae(me,r(s,"endLabel",$,Le),"inline-flex")},L=()=>{var Oe,Le,Je,Fe;const $={value:b(),input:u,props:e},se=r(s,"thumbIcon",$,null),je=(Le=(Oe=e.thumbIcon)!=null?Oe:e.iconThumb)!=null?Le:e.pointIcon;ae(Ae,se.length?se:I(je,"thumbIcon",$),"inline-flex");const Be=(Fe=(Je=ie(e.thumbLabel))!=null?Je:ie(e.labelValue))!=null?Fe:o(e.showValue)?String(b()):null,ce=r(s,"thumbLabel",$,Be);ae(ye,ce,"inline-flex")},P=()=>{const $=c(b()),se=p(),je=h(),Be=V(),Oe=`${N($)*100}%`,Le=o(e.color)||o(e.selectionColor)||"var(--cms-primary)",Je=o(e.trackColor)||"var(--cms-border-color)",Fe=o(e.thumbColor)||Le,Ge=!!o(e.readonly),He=!!o(e.disabled);u.min=String(se),u.max=String(je),u.step=Be==="any"?"any":String(Be),u.disabled=He,u.value=String($),oe.style.background=Je,Z.style.background=Le,Z.style.width=Oe,ge.style.left=Oe,ge.style.borderColor=Fe,ge.style.color=Fe,ye.style.background=Le,D.classList.toggle("is-disabled",He),D.classList.toggle("is-readonly",Ge),D.classList.toggle("has-markers",pe.childNodes.length>0)};if(d?(Q(d.get(),{fromModel:!0}),d.watch($=>{Q($,{fromModel:!0})},"UI.Slider:watch")):Dt(e.value)?JSswift.reactive.effect(()=>{Q(o(e.value),{fromModel:!0})},"UI.Slider:value"):Q((K=(Ee=e.value)!=null?Ee:e.min)!=null?K:0,{fromModel:!0}),u.addEventListener("input",$=>{var je;if(o(e.disabled)||o(e.readonly)){u.value=String(b());return}const se=Q(u.value);(je=e.onInput)==null||je.call(e,se,$)}),u.addEventListener("change",$=>{var je;if(o(e.disabled)||o(e.readonly)){u.value=String(b());return}const se=Q(u.value);(je=e.onChange)==null||je.call(e,se,$)}),JSswift.reactive.effect(()=>{F(),m(),L(),we(),P()},"UI.Slider:render"),D._input=u,D._getValue=b,D._setValue=$=>Q($),e.withQItem||e.qitem||e.item===!0){const $=v.Item({class:fe(["cms-slider-item",e.itemClass]),style:e.itemStyle},D);return $._input=u,$._slider=D,$._getValue=b,$._setValue=D._setValue,$}return D},(Zi=JSswift.isDev)!=null&&Zi.call(JSswift)&&(v.meta=v.meta||{},v.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 of thumbIcon",pointIcon:"Alias of thumbIcon",thumbLabel:"String|Node|Function|Array",showValue:"boolean",labelValue:"String|Node|Function|Array",markers:"boolean|number|Array|Object",markerLabels:"boolean",labelMarks:"Alias of markerLabels",startLabel:"String|Node|Function|Array",endLabel:"String|Node|Function|Array",leftLabel:"Alias of startLabel",rightLabel:"Alias of endLabel",minLabel:"Alias of startLabel",maxLabel:"Alias of endLabel",withQItem:"boolean",qitem:"Alias of withQItem",item:"boolean",itemClass:"string",itemStyle:"object",selectionColor:"string",trackColor:"string",thumbColor:"string",size:"string|number",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 on the left/start of the track",endLabel:"Label on the right/end of the track"},events:{onChange:"(value, event)",onInput:"(value, event)"},returns:"HTMLLabelElement | HTMLLIElement (with ._input = HTMLInputElement)",description:"Reactive slider with label, icons, custom thumb, markers, and model/QItem support."}),v.Rating=(...t)=>{var b;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(Gt(e.value)||rn(e.value)?e.value:null),d=bn(i,"UI.Rating:model"),S=e.id||"cms-rating-"+Math.random().toString(36).slice(2),u=JSswift.omit(e,["model","value","max","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);u.type="hidden",u.id=S,e.name!=null&&(u.name=e.name),u.class=fe(["cms-rating-input","cms-choice-input",e.inputClass]);const l=_.input(u),w=JSswift.omit(e,["model","value","max","id","name","type","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);w.class=fe(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",xe(e.dense,"dense"),e.class]),w.style={...e.style||{}};const D=o(e.size);D!=null&&!(typeof D=="string"&&((b=JSswift.uiSizes)!=null&&b.includes(D)))&&(w.style["--cms-rating-size"]=ht(D));const A=o(e.gap);A!=null&&(w.style["--cms-rating-gap"]=ht(A));const C=_.span({class:"cms-rating-control",onMouseleave:J=>{var Q;ie!=null&&(ie=null,c(),(Q=e.onHover)==null||Q.call(e,ue(),J))},onKeydown:J=>{if(!me())return;const Q=ge()?.5:1,ee=ue();let we=ee;switch(J.key){case"ArrowRight":case"ArrowUp":we=ee+Q;break;case"ArrowLeft":case"ArrowDown":we=ee-Q;break;case"Home":we=o(e.clearable)?0:Q;break;case"End":we=Z();break;case"Delete":case"Backspace":case"0":if(!o(e.clearable))return;we=0;break;case" ":case"Enter":we=ee||(o(e.clearable)?Q:Math.max(Q,1));break;default:return}J.preventDefault(),N(we,J,{emit:!0})}}),z=_.span({class:"cms-choice-label cms-rating-label"}),le=_.label(w,l,C,z);G(le,e);const te=J=>{for(;J.firstChild;)J.removeChild(J.firstChild)},he=(J,Q,ee="")=>{te(J),(Q||[]).forEach(we=>J.appendChild(we)),J.style.display=J.childNodes.length?ee:"none"},U=J=>Gt(J)||rn(J)?o(J):J,W=(J,Q={})=>Ws(U(J),Q),oe=(J,Q,ee={})=>{var F,m;const we=U(J);return we==null?[]:typeof we=="string"?[v.Icon({name:we,color:e.color,size:(m=(F=e.iconSize)!=null?F:e.size)!=null?m:16})]:W(we,{...ee,as:Q})},Z=()=>{var Q;const J=Number((Q=o(e.max))!=null?Q:5);return Number.isFinite(J)&&J>0?Math.max(1,Math.round(J)):5},ge=()=>{var J;return!!o((J=e.half)!=null?J:e.allowHalf)},Ae=(J,Q=Z())=>{let ee=Number(o(J));Number.isFinite(ee)||(ee=0),ee=Math.min(Q,Math.max(0,ee));const we=ge()?.5:1;return Math.round(ee/we)*we},ye=()=>!!o(e.disabled),pe=()=>!!o(e.readonly),me=()=>!ye()&&!pe(),ue=()=>Ae(d?d.get():ae),H=J=>{const Q=J>0?String(J):"";l.value=Q,l.setAttribute("value",Q),l.disabled=ye()};let ae=Ae(d?d.get():o(e.value)),ie=null,ve=0,I=[];const g=(J,Q)=>{if(!ge())return Ae(J);const ee=Q.currentTarget.getBoundingClientRect(),we=Q.clientX-ee.left<=ee.width/2;return Ae(we?J-.5:J)},p=(J,Q)=>J>=Q?"full":ge()&&J>=Q-.5?"half":"empty",h=(J,Q)=>{var L,P,Y,Ne,ze,Ee,K,$,se,je,Be,ce,Oe,Le,Je;const ee=o((Y=(P=(L=e.colorSelected)!=null?L:e.activeColor)!=null?P:e.color)!=null?Y:e.textColor)||"var(--cms-warning, #f0b429)",we=o(($=(K=(Ee=(ze=(Ne=e.colorHalf)!=null?Ne:e.halfColor)!=null?ze:e.colorSelected)!=null?Ee:e.activeColor)!=null?K:e.color)!=null?$:e.textColor)||ee,F=o((Oe=(ce=(Be=(je=(se=e.colorHovered)!=null?se:e.hoverColor)!=null?je:e.colorSelected)!=null?Be:e.activeColor)!=null?ce:e.color)!=null?Oe:e.textColor)||ee,m=o((Je=(Le=e.colorInactive)!=null?Le:e.colorOff)!=null?Je:e.color)||"var(--cms-muted)";return Q?F:J==="full"?ee:J==="half"?we:m},V=J=>{var F,m,L,P,Y,Ne,ze,Ee,K,$,se,je,Be,ce,Oe;const Q=[];J.hovered&&J.state!=="empty"&&Q.push("hoveredIcon","iconHovered"),J.state==="full"?Q.push("checkedIcon","selectedIcon","iconSelected","iconOn"):J.state==="half"?Q.push("halfIcon","iconHalf"):Q.push("uncheckedIcon","iconOff"),Q.push("icon","item","star");for(const Le of Q){const Je=r(s,Le,J,null);if(Je.length)return Je}let ee=null,we="icon";return J.hovered&&J.state!=="empty"&&(ee=(F=e.hoveredIcon)!=null?F:e.iconHovered,we="hoveredIcon"),ee==null&&J.state==="full"?(ee=(Y=(P=(L=(m=e.checkedIcon)!=null?m:e.iconSelected)!=null?L:e.iconOn)!=null?P:e.icon)!=null?Y:"star",we="checkedIcon"):ee==null&&J.state==="half"?(ee=($=(K=(Ee=(ze=(Ne=e.halfIcon)!=null?Ne:e.iconHalf)!=null?ze:e.checkedIcon)!=null?Ee:e.iconSelected)!=null?K:e.icon)!=null?$:"star_half",we="halfIcon"):ee==null&&(ee=(Oe=(se=e.uncheckedIcon)!=null?se:e.iconOff)!=null?Oe:o(e.noDimming)?(ce=(Be=(je=e.icon)!=null?je:e.checkedIcon)!=null?Be:e.iconSelected)!=null?ce:"star":"star_border",we="uncheckedIcon"),oe(ee,we,J)},re=()=>{const J=Z();if(ve!==J){ve=J,I=[],te(C);for(let Q=1;Q<=J;Q++){const ee=_.span({class:"cms-rating-item-icon"}),we=_.span({class:"cms-rating-item",role:"radio",tabIndex:-1,onMousemove:F=>{var L;if(!me())return;const m=g(Q,F);ie!==m&&(ie=m,c(),(L=e.onHover)==null||L.call(e,m,F))},onClick:F=>{if(!me())return;let m=g(Q,F);o(e.clearable)&&m===ue()&&(m=0),N(m,F,{emit:!0})}},ee);I.push({item:we,iconHost:ee,index:Q}),C.appendChild(we)}}},c=()=>{var Ne,ze;re();const J=Z(),Q=ue(),ee=ie==null?Q:Ae(ie,J),we=ye(),F=pe(),m=!!o(e.clearable),L=!!o(e.noDimming);le.classList.toggle("is-disabled",we),le.classList.toggle("is-readonly",F),le.classList.toggle("is-hovering",ie!=null),le.classList.toggle("is-clearable",m),le.classList.toggle("is-half",ge()),le.classList.toggle("no-dimming",L);const P=Number((ze=o((Ne=e.tabindex)!=null?Ne:e.tabIndex))!=null?ze:0);C.tabIndex=we?-1:P,C.setAttribute("role","slider"),C.setAttribute("aria-valuemin","0"),C.setAttribute("aria-valuemax",String(J)),C.setAttribute("aria-valuenow",String(Q)),C.setAttribute("aria-disabled",we?"true":"false"),C.setAttribute("aria-readonly",F?"true":"false"),H(Q);const Y=r(s,"label",{value:Q,max:J,disabled:we,readonly:F,clearable:m},e.label!=null?U(e.label):n);he(z,Y,"inline-flex"),I.forEach(({item:Ee,iconHost:K,index:$})=>{const se=p(ee,$),je=ie!=null&&se!=="empty",Be={index:$,max:J,value:Q,displayValue:ee,state:se,active:se!=="empty",checked:se==="full",half:se==="half",hovered:je,disabled:we,readonly:F,clearable:m,setValue:ce=>N(ce,null,{emit:!1})};Ee.className=zn(["cms-rating-item",`is-${se}`,xe(je,"is-hovered")]),Ee.style.color=h(se,je),Ee.style.opacity=se==="empty"&&!L?"0.48":"1",Ee.setAttribute("aria-checked",String(Q===$)),he(K,V(Be),"inline-flex")})},N=(J,Q,ee={})=>{var m,L;const we=Ae(J),F=ue();return ae=we,ie=null,d&&ee.fromModel!==!0&&d.set(we),H(we),c(),ee.emit!==!1&&we!==F&&((m=e.onInput)==null||m.call(e,we,Q),(L=e.onChange)==null||L.call(e,we,Q)),we};return le._input=l,le._rating=C,le._getValue=ue,le._setValue=J=>N(J,null,{emit:!1}),d&&d.watch(J=>{const Q=Ae(J);serializeValue(Q)!==serializeValue(ae)&&(ae=Q,ie=null,H(ae),c())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!d&&e.value!=null&&(ae=Ae(o(e.value))),c()},"UI.Rating:render"),le},(er=JSswift.isDev)!=null&&er.call(JSswift)&&(v.meta=v.meta||{},v.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 of half",noDimming:"boolean",readonly:"boolean",disabled:"boolean",icon:"String|Node|Function|Array",iconSelected:"Alias of checkedIcon",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",iconHalf:"Alias of halfIcon",halfIcon:"String|Node|Function|Array",iconHovered:"Alias of 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 of 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:"Reactive rating with label, custom icons, half rating, clearable behavior, and model support."});const Kt=t=>t?{hour:Number(t.hour)||0,minute:Number(t.minute)||0,second:Number(t.second)||0}:null,$n=t=>String(Math.max(0,Number(t)||0)).padStart(2,"0"),Mn=(t,e={})=>{var u,l,w,D,A,C,z,le,te,he,U,W,oe,Z,ge;if(t==null||t==="")return null;let n=null,s=null,i=0,d=null;if(t instanceof Date&&!Number.isNaN(t.getTime()))n=t.getHours(),s=t.getMinutes(),i=t.getSeconds();else if(typeof t=="number"&&Number.isFinite(t)){const Ae=Math.max(0,Math.floor(t));n=Math.floor(Ae/3600)%24,s=Math.floor(Ae/60)%60,i=Ae%60}else if(typeof t=="object"){if(t.time!=null||t.value!=null)return Mn((u=t.time)!=null?u:t.value,e);n=Number((D=(w=(l=t.hour)!=null?l:t.hours)!=null?w:t.h)!=null?D:t.hh),s=Number((le=(z=(C=(A=t.minute)!=null?A:t.minutes)!=null?C:t.min)!=null?z:t.mm)!=null?le:0),i=Number((W=(U=(he=(te=t.second)!=null?te:t.seconds)!=null?he:t.sec)!=null?U:t.ss)!=null?W:0),d=(ge=(Z=(oe=t.meridiem)!=null?oe:t.ampm)!=null?Z:t.period)!=null?ge:null}else if(typeof t=="string"){const Ae=t.trim();if(!Ae)return null;const ye=Ae.match(/^(\d{1,2})(\d{2})(\d{2})?$/),pe=Ae.match(/(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?\s*([ap]m)?/i);if(pe)n=Number(pe[1]),s=Number(pe[2]),i=pe[3]!=null?Number(pe[3]):0,d=pe[4]||null;else if(ye)n=Number(ye[1]),s=Number(ye[2]),i=ye[3]!=null?Number(ye[3]):0;else return null}else return null;if(!Number.isFinite(n)||!Number.isFinite(s)||!Number.isFinite(i))return null;if(d){const Ae=String(d).toLowerCase();Ae==="pm"&&n<12&&(n+=12),Ae==="am"&&n===12&&(n=0)}if(n<0||n>23||s<0||s>59||i<0||i>59)return null;const S={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(i)};return si(S,e)},Qn=(t,e={})=>{const n=t&&typeof t=="object"&&t.hour!=null?Kt(t):Mn(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;return`${$n(n.hour)}:${$n(n.minute)}${s?`:${$n(n.second)}`:""}`},So=(t,e)=>{const n=Qn(t,{withSeconds:!0}),s=Qn(e,{withSeconds:!0});return!n&&!s?0:n?s?n<s?-1:n>s?1:0:1:-1};function si(t,e={}){if(!t)return null;const n=Kt(t),s=e.min!=null?Mn(e.min,{withSeconds:!0}):null,i=e.max!=null?Mn(e.max,{withSeconds:!0}):null;return s&&So(n,s)<0?Kt(s):i&&So(n,i)>0?Kt(i):n}const Fn=(t,e={})=>t==null||t===""?null:t instanceof Date?Mn(t,e):typeof t=="object"?Mn(t.time!=null?t.time:t,e):typeof t=="string"||typeof t=="number"?Mn(t,e):null,Co=(t,e={})=>{var u;const n=Mn(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;if(!!!o((u=e.use12h)!=null?u:e.ampm))return`${$n(n.hour)}:${$n(n.minute)}${s?`:${$n(n.second)}`:""}`;const d=n.hour>=12?"PM":"AM",S=n.hour%12||12;return`${$n(S)}:${$n(n.minute)}${s?`:${$n(n.second)}`:""} ${d}`},sa=(t,e,n={})=>{if(!t)return"";const s=Qn(e,n);return s?`${t}T${s}`:t},Do=(t,e)=>{const n=Math.max(1,Math.min(e+1,Math.round(Number(t)||1))),s=[];for(let i=0;i<=e;i+=n)s.push(i);return s},oi=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:i=!1,minuteStep:d=5,secondStep:S=5,disabled:u=!1,readonly:l=!1,embedded:w=!1,className:D="",slotPrefix:A="",shortcuts:C=null,onSelect:z=null}=t,le=Mn(s,{withSeconds:i,min:e.min,max:e.max}),te=le||Mn(new Date,{withSeconds:i,min:e.min,max:e.max})||{hour:0,minute:0,second:0},he=le?Kt(le):null,U=me=>A?`${A}${me[0].toUpperCase()}${me.slice(1)}`:null,W=(me,ue,H)=>{const ae=[U(me),me].filter(Boolean);for(const ie of ae){if(JSswift.ui.getSlot(n,ie)==null)continue;const I=JSswift.ui.renderSlot(n,ie,ue,H);if(I!=null)return I}return JSswift.ui.slot(H,ue)},oe=me=>{let ue=W("point",me,null);return ue==null&&t.pointIcon!=null&&me.selected&&(ue=typeof t.pointIcon=="string"?v.Icon({name:t.pointIcon,size:w?10:12}):JSswift.ui.slot(t.pointIcon,me)),r(null,"default",me,ue)},Z=(me,ue)=>{const H={hour:te.hour,minute:te.minute,second:i?te.second:0};return H[me]=ue,H},ge=_.div({class:fe(["cms-time-section",xe(w,"is-embedded"),xe(i,"has-seconds"),D])}),Ae=o(C)||[];if(Array.isArray(Ae)&&Ae.length){const me=_.div({class:"cms-time-shortcuts"});Ae.forEach((ue,H)=>{var g,p,h;if(!ue)return;const ae=typeof ue.value=="function"?ue.value({now:Qn(new Date,{withSeconds:i})}):ue.value,ie=Mn(ae,{withSeconds:i,min:e.min,max:e.max});if(!ie)return;const ve={item:ue,index:H,value:Qn(ie,{withSeconds:i}),displayValue:Co(ie,{withSeconds:i,use12h:(g=e.use12h)!=null?g:e.ampm})},I=W("shortcut",ve,(h=(p=ue.label)!=null?p:ue.text)!=null?h:ve.displayValue);me.appendChild(_.button({type:"button",class:fe(["cms-time-shortcut",xe(!!he&&So(ie,he)===0,"is-selected")]),disabled:u||l,onClick:()=>z==null?void 0:z(ie,{shortcut:ue,index:H})},...r(null,"default",ve,I)))}),me.childNodes.length&&ge.appendChild(me)}const ye=_.div({class:"cms-time-columns"}),pe=(me,ue,H)=>{const ae=_.div({class:"cms-time-column","data-time-part":ue}),ie=_.div({class:"cms-time-options"});return H.forEach(ve=>{var N;const I=Z(ue,ve),g=si(I,{withSeconds:i,min:e.min,max:e.max}),p=u||l||So(g,I)!==0,h=!!he&&he[ue]===ve,V={part:ue,selected:h,disabled:p,value:ve,label:$n(ve),timeValue:Qn(g,{withSeconds:i}),displayValue:Co(g,{withSeconds:i,use12h:(N=e.use12h)!=null?N:e.ampm})},re=W("option",V,V.label),c=h?oe(V):[];ie.appendChild(_.button({type:"button",class:fe(["cms-time-option",xe(h,"is-selected"),xe(p,"is-disabled")]),disabled:p,onClick:()=>z==null?void 0:z(g,{part:ue,optionValue:ve})},_.span({class:"cms-time-option-label"},...r(null,"default",V,re)),c.length?_.span({class:"cms-time-option-point"},...c):null))}),ae.appendChild(ie),ae};return ye.appendChild(pe(o(e.hoursLabel)||"Ore","hour",Do(1,23))),ye.appendChild(pe(o(e.minutesLabel)||"Min","minute",Do(d,59))),i&&ye.appendChild(pe(o(e.secondsLabel)||"Sec","second",Do(S,59))),ge.appendChild(ye),ge},xo=t=>{if(!t)return null;const e={};return t.querySelectorAll(".cms-time-column").forEach((n,s)=>{const i=n.getAttribute("data-time-part")||String(s);e[i]=n.scrollTop}),e},ii=(t,e={})=>{var i;if(!t)return;const n=e.scrollState||null,s=(i=e.behavior)!=null?i:"smooth";t.querySelectorAll(".cms-time-column").forEach((d,S)=>{const u=d.getAttribute("data-time-part")||String(S),l=n&&Number.isFinite(n[u])?n[u]:null;l!=null&&(d.scrollTop=l);const w=d.querySelector(".cms-time-option.is-selected");if(!w)return;const D=Math.max(0,d.scrollHeight-d.clientHeight),A=w.offsetTop-(d.clientHeight-w.offsetHeight)/2,C=Math.max(0,Math.min(D,A));if(Math.abs(d.scrollTop-C)<1){d.scrollTop=C;return}if(s&&typeof d.scrollTo=="function"){d.scrollTo({top:C,behavior:s});return}d.scrollTop=C})},ri=(t,e={})=>{var ps,hs,is,rs,qe,gt,Mt,Yt,tn,nn,fn,ln;const{props:n,children:s}=JSswift.uiNormalizeArgs(t),i=e.calendar===!0,d=n.slots||{},S=Et(n.size,()=>{const y=String(o(n.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(y)?`cms-size-${y}`:""}),u=String(o((rs=(is=n.mode)!=null?is:o((hs=(ps=n.rangeMultiple)!=null?ps:n.multipleRange)!=null?hs:n.multiRange)?"range-multiple":null)!=null?rs:n.range&&n.multiple?"range-multiple":n.range?"range":n.multiple?"multiple":"single")).toLowerCase(),l=["range-multiple","multiple-range","rangemultiple","multiplerange","range_multiple","multiple_range","multi-range","multi_range","ranges"].includes(u)?"range-multiple":u==="range"?"range":u==="multiple"?"multiple":"single",w=n.model||(Gt(n.value)||rn(n.value)?n.value:null),D=bn(w,i?"UI.Calendar:model":"UI.Datepicker:model"),A=D?D.get():o(n.value),C=o((qe=n.rangeAs)!=null?qe:n.rangeModel)==="array"||Array.isArray(A),z=o((gt=n.rangeMultipleAs)!=null?gt:n.multipleRangeAs)==="array"||Array.isArray(A)&&Array.isArray(A[0]),le=()=>{var y,de,Pe;return l==="single"&&!!o((Pe=(de=(y=n.withTime)!=null?y:n.time)!=null?de:n.timePicker)!=null?Pe:n.enableTime)},te=()=>{var de,Pe,nt,ot,it,ft,Tt,Ut;const y=Qn(Fn((Pe=(de=o(n.timeValue))!=null?de:D?D.get():o(n.value))!=null?Pe:A,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((ot=(nt=n.timeWithSeconds)!=null?nt:n.withSeconds)!=null?ot:n.showSeconds)||/:\d{2}:\d{2}$/.test(y)||/:\d{2}:\d{2}$/.test(o(n.timeFormat)||""),min:o((it=n.timeMin)!=null?it:n.minTime),max:o((ft=n.timeMax)!=null?ft:n.maxTime),use12h:o((Ut=(Tt=n.time12h)!=null?Tt:n.use12h)!=null?Ut:n.ampm)}},he=()=>{var de,Pe;const y=Number(o((Pe=(de=n.timeMinuteStep)!=null?de:n.minuteStep)!=null?Pe:5));return Math.max(1,Math.min(30,Number.isFinite(y)?y:5))},U=()=>{var de,Pe;const y=Number(o((Pe=(de=n.timeSecondStep)!=null?de:n.secondStep)!=null?Pe:5));return Math.max(1,Math.min(30,Number.isFinite(y)?y:5))},W=y=>String(y).padStart(2,"0"),oe=(y,de,Pe)=>{const nt=new Date(y,de,Pe);return nt.getFullYear()!==y||nt.getMonth()!==de||nt.getDate()!==Pe?null:nt},Z=y=>!(y instanceof Date)||Number.isNaN(y.getTime())?null:`${y.getFullYear()}-${W(y.getMonth()+1)}-${W(y.getDate())}`,ge=y=>{if(typeof y!="string")return null;const de=y.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!de)return null;const Pe=Number(de[1]),nt=Number(de[2])-1,ot=Number(de[3]),it=new Date(Pe,nt,ot);return it.getFullYear()!==Pe||it.getMonth()!==nt||it.getDate()!==ot?null:it},Ae=(y,de)=>{const Pe=ge(y);return Pe?(Pe.setDate(Pe.getDate()+de),Z(Pe)):null},ye=(y,de)=>new Date(y.getFullYear(),y.getMonth()+de,1),pe=y=>{if(y instanceof Date&&!Number.isNaN(y.getTime()))return new Date(y.getFullYear(),y.getMonth(),1);const de=c(y),Pe=ge(de);return Pe?new Date(Pe.getFullYear(),Pe.getMonth(),1):new Date},me=()=>Z(new Date),ue=(y,de)=>!!y&&!!de&&y===de,H=(y,de)=>y==null&&de==null?0:y==null?-1:de==null?1:y<de?-1:y>de?1:0,ae=(y,de)=>{const Pe=ge(y),nt=ge(de);return!Pe||!nt?0:Math.round((nt.getTime()-Pe.getTime())/864e5)},ie=y=>Array.isArray(y)?y.slice():y==null||y===""?[]:[y],ve=y=>({from:(y==null?void 0:y.from)||null,to:(y==null?void 0:y.to)||null}),I=y=>Array.isArray(y)?y.map(ve):[],g=y=>{const de=ve(y);return C?[de.from,de.to]:de},p=y=>I(y).map(de=>z?[de.from,de.to]:de),h=y=>l==="multiple"?Array.isArray(y)?y.slice():[]:l==="range"?ve(y):l==="range-multiple"?I(y):y||null,V=y=>l==="multiple"?Array.isArray(y)?y.slice():[]:l==="range"?g(y):l==="range-multiple"?p(y):y||"",re=y=>JSON.stringify(V(y)),c=y=>{if(y==null||y==="")return null;if(y instanceof Date)return Z(y);if(typeof y=="number")return Z(new Date(y));if(typeof y!="string")return typeof y=="object"&&y.date!=null?c(y.date):null;const de=y.trim();if(!de)return null;const Pe=de.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:$|[T\s])/);if(Pe){const ft=oe(Number(Pe[1]),Number(Pe[2])-1,Number(Pe[3]));return Z(ft)}const nt=de.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(nt){const ft=nt[3].length===2?2e3+Number(nt[3]):Number(nt[3]),Tt=oe(ft,Number(nt[2])-1,Number(nt[1]));return Z(Tt)}if(/^\d{1,4}$/.test(de))return null;const ot=new Date(de);if(Number.isNaN(ot.getTime()))return null;const it=de.match(/(?:^|[^\d])(\d{4})(?!\d)/);return it&&ot.getFullYear()!==Number(it[1])?null:Z(ot)},N=y=>{var nt,ot,it,ft,Tt,Ut;if(y==null||y==="")return{from:null,to:null};let de=null,Pe=null;if(Array.isArray(y))de=c(y[0]),Pe=c(y[1]);else if(typeof y=="object")de=c((it=(ot=(nt=y.from)!=null?nt:y.start)!=null?ot:y.dateFrom)!=null?it:y.departure),Pe=c((Ut=(Tt=(ft=y.to)!=null?ft:y.end)!=null?Tt:y.dateTo)!=null?Ut:y.return);else{const on=String(y).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];de=c(on[0]),Pe=c(on[1])}return de&&Pe&&de>Pe&&([de,Pe]=[Pe,de]),{from:de,to:Pe}},b=y=>{const de=[],Pe=new Set,nt=ot=>{const it=N(ot);if(!it.from)return;const ft=`${it.from||""}|${it.to||""}`;Pe.has(ft)||(Pe.add(ft),de.push(it))};if(y==null||y==="")return de;if(Array.isArray(y))if(y.every(it=>it==null||typeof it=="string"||typeof it=="number"||it instanceof Date)){const it=y.map(c).filter(Boolean);for(let ft=0;ft<it.length;ft+=2)nt({from:it[ft],to:it[ft+1]||null})}else y.forEach(it=>nt(it));else if(typeof y=="object"&&Array.isArray(y.ranges))y.ranges.forEach(ot=>nt(ot));else if(typeof y=="object")nt(y);else{const it=(String(y).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(c).filter(Boolean);for(let ft=0;ft<it.length;ft+=2)nt({from:it[ft],to:it[ft+1]||null})}return de.sort((ot,it)=>H(ot.from,it.from)||H(ot.to,it.to))},J=y=>{const de=[];return ie(y).forEach(Pe=>{const nt=c(Pe);nt&&!de.includes(nt)&&de.push(nt)}),de.sort()},Q=y=>l==="range"?N(y):l==="range-multiple"?b(y):l==="multiple"?J(y):c(y),ee=()=>{var y;return c(o((y=n.min)!=null?y:n.minDate))},we=()=>{var y;return c(o((y=n.max)!=null?y:n.maxDate))},F=()=>o(n.locale)||void 0,m=()=>{var de,Pe;const y=Number(o((Pe=(de=n.firstDayOfWeek)!=null?de:n.weekStart)!=null?Pe:1));return Number.isFinite(y)?(y%7+7)%7:1},L=()=>{var Pe;const y=l==="range"||l==="range-multiple"?2:1,de=Number((Pe=o(n.monthsToShow))!=null?Pe:y);return Math.max(1,Math.min(4,Number.isFinite(de)?de:y))},P=()=>{const y=ee(),de=we();let Pe=c(o(n.defaultMonth))||me();return y&&Pe<y&&(Pe=y),de&&Pe>de&&(Pe=de),Pe||y||de||me()},Y=()=>o(n.confirm)?He:Ge,Ne=y=>{const de=ge(y);return de?{date:y,value:y,year:de.getFullYear(),month:de.getMonth()+1,day:de.getDate(),weekday:de.getDay(),today:ue(y,me())}:{date:y,value:y}},ze=(y,de)=>y==null?!1:Array.isArray(y)?y.some(Pe=>c(Pe)===de):y instanceof Set?y.has(de):typeof y=="function"?!!y(de,Ne(de)):typeof y=="string"||y instanceof Date||typeof y=="number"?c(y)===de:!1,Ee=y=>{var Ut,on,mn,On,An,yn,as,bs,ys,Is,Ks,qs,Ys;if(!y)return!1;const de=ee(),Pe=we();if(de&&y<de||Pe&&y>Pe)return!1;const nt=o((on=(Ut=n.options)!=null?Ut:n.enableDates)!=null?on:n.allowedDates);if(nt!=null&&!ze(nt,y))return!1;const ot=o((On=(mn=n.disableDates)!=null?mn:n.disabledDates)!=null?On:n.notAllowedDates);if(ot!=null&&ze(ot,y))return!1;const it=(An=ge(y))==null?void 0:An.getDay();if(Array.isArray(o((yn=n.allowedWeekdays)!=null?yn:n.weekdays))&&it!=null&&!o((as=n.allowedWeekdays)!=null?as:n.weekdays).map(Ts=>Number(Ts)).includes(it)||o(n.weekdaysOnly)&&(it===0||it===6)||o(n.weekendsOnly)&&it!=null&&it!==0&&it!==6)return!1;const ft=Y(),Tt=l==="range"?ft!=null&&ft.from&&!(ft!=null&&ft.to)?ft:null:l==="range-multiple"&&Array.isArray(ft)&&ft.length&&(bs=ft[ft.length-1])!=null&&bs.from&&!((ys=ft[ft.length-1])!=null&&ys.to)?ft[ft.length-1]:null;if(Tt!=null&&Tt.from){const Es=Math.abs(ae(Tt.from,y)),Ts=Number(o((Ks=(Is=n.minRange)!=null?Is:n.minDays)!=null?Ks:n.minNights)),Xs=Number(o((Ys=(qs=n.maxRange)!=null?qs:n.maxDays)!=null?Ys:n.maxNights));if(Number.isFinite(Ts)&&Es<Ts||Number.isFinite(Xs)&&Es>Xs)return!1}return!0},K=y=>{var nt,ot;if(!y)return"";const de=ge(y);return!de||String(o((ot=(nt=n.displayMask)!=null?nt:n.mask)!=null?ot:"")||"").toLowerCase()==="iso"||o(n.isoDisplay)===!0?y:new Intl.DateTimeFormat(F(),{year:"numeric",month:"short",day:"2-digit"}).format(de)},$=(y,de=R)=>{if(l==="range-multiple")return!Array.isArray(y)||!y.length?"":y.length>2&&o(n.compactMultiple)!==!1?`${y.length} ${o(n.multipleRangeLabel)||"intervalli selezionati"}`:y.map(ot=>{const it=ot!=null&&ot.from?K(ot.from):"",ft=ot!=null&&ot.to?K(ot.to):"";return it&&ft?`${it} -> ${ft}`:it||ft||""}).filter(Boolean).join("; ");if(l==="multiple")return!Array.isArray(y)||!y.length?"":y.length>3&&o(n.compactMultiple)!==!1?`${y.length} ${o(n.multipleLabel)||"date selezionate"}`:y.map(K).join(", ");if(l==="range"){const ot=y!=null&&y.from?K(y.from):"",it=y!=null&&y.to?K(y.to):"";return ot&&it?`${ot} -> ${it}`:ot||it||""}const Pe=K(y);if(!le())return Pe;const nt=Fe(de);return[Pe,nt].filter(Boolean).join(" \u2022 ")},se=y=>(String(y||"").match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(c).filter(Boolean),je=y=>{if(y==null||y==="")return l==="multiple"||l==="range-multiple"?[]:l==="range"?{from:null,to:null}:null;const de=se(y);if(l==="range-multiple"){const Pe=[];for(let nt=0;nt<de.length;nt+=2)de[nt]&&Pe.push({from:de[nt],to:de[nt+1]||null});return Pe}return l==="multiple"?de:l==="range"?{from:de[0]||null,to:de[1]||null}:de[0]||c(y)},Be=()=>l==="multiple"||l==="range-multiple"?[]:l==="range"?{from:null,to:null}:null,ce=(y,de=null)=>{var ft;if(!le())return null;const Pe=te(),nt=o(n.timeValue),ot=y!=null?y:nt,it=Fn(ot,Pe);return Kt((ft=it!=null?it:de)!=null?ft:null)},Oe=()=>o(n.confirm)?Te:R,Le=(y=Ge,de=R)=>l==="single"&&le()?sa(y||null,de,te()):V(y),Je=(y=Ge,de=R)=>JSON.stringify(Le(y,de)),Fe=y=>Co(y,te());let Ge=Q(A),He=h(Ge),R=ce(A,Fn(o(n.timeValue),te())),Te=Kt(R),O=null,k=null,x=pe(l==="range"?(Ge==null?void 0:Ge.from)||(Ge==null?void 0:Ge.to)||P():l==="range-multiple"?((Mt=Ge==null?void 0:Ge[Ge.length-1])==null?void 0:Mt.from)||((Yt=Ge==null?void 0:Ge[Ge.length-1])==null?void 0:Yt.to)||P():l==="multiple"?Ge[0]||P():Ge||P()),f=null,E=null;const Ce=y=>{const de=y instanceof Date?y:ge(c(y));if(!de)return-1;const Pe=de.getFullYear(),nt=de.getMonth();for(let ot=0;ot<L();ot+=1){const it=ye(x,ot);if(it.getFullYear()===Pe&&it.getMonth()===nt)return ot}return-1},Ue={...n,label:(tn=n.label)!=null?tn:n.placeholder},Xe=Ue.label!=null||JSswift.ui.getSlot(d,"label")!=null,q=l==="range"?"Seleziona andata e ritorno":l==="range-multiple"?"Seleziona intervalli":l==="multiple"?"Seleziona date":"Seleziona data",We=i?null:_.input({class:fe(["cms-input","cms-date-display",S,xe(n.manualInput,"is-manual"),n.inputClass]),type:"text",autocomplete:"off",placeholder:Xe?"":(nn=n.placeholder)!=null?nn:q,readOnly:!o(n.manualInput),disabled:!!o(n.disabled),value:$(Ge,R)}),st=_.div({style:{display:"contents"}}),Ze=i?null:_.div({class:"cms-date-control",style:{display:"contents"}},We,st),ut=i?null:v.FormField({...Ue,iconRight:(fn=n.iconRight)!=null?fn:"calendar_month",control:Ze,getValue:()=>We.value,onClear:()=>{o(n.disabled)||o(n.readonly)||(Rt(Be(),null),f&&dn())},onFocus:()=>We.focus()}),St=(y,de={})=>{var ot,it;const Pe=de.focusIso||(l==="range"?(y==null?void 0:y.from)||(y==null?void 0:y.to)||P():l==="range-multiple"?((ot=y==null?void 0:y[y.length-1])==null?void 0:ot.from)||((it=y==null?void 0:y[y.length-1])==null?void 0:it.to)||P():l==="multiple"?(y==null?void 0:y[0])||P():y||P());let nt=pe(Pe);if(de.preserveMonthOffset){const ft=Number.isInteger(de.visibleMonthOffset)?de.visibleMonthOffset:Ce(de.anchorIso||de.focusIso||Pe);ft>0&&(nt=ye(nt,-ft))}x=nt},Lt=()=>{st.replaceChildren();const y=o(n.name);if(!y)return;const de=(ot,it)=>{st.appendChild(_.input({type:"hidden",name:ot,value:it!=null?it:""}))},Pe=Ge;if(l==="single"){de(y,Le(Pe,R));return}if(l==="range"){de(o(n.nameFrom)||`${y}_from`,(Pe==null?void 0:Pe.from)||""),de(o(n.nameTo)||`${y}_to`,(Pe==null?void 0:Pe.to)||"");return}if(l==="range-multiple"){const ot=Array.isArray(Pe)?Pe:[],it=/\[\]$/.test(o(n.nameFrom)||"")?o(n.nameFrom):`${o(n.nameFrom)||`${y}_from`}[]`,ft=/\[\]$/.test(o(n.nameTo)||"")?o(n.nameTo):`${o(n.nameTo)||`${y}_to`}[]`;ot.forEach(Tt=>{de(it,(Tt==null?void 0:Tt.from)||""),de(ft,(Tt==null?void 0:Tt.to)||"")});return}const nt=/\[\]$/.test(y)?y:`${y}[]`;(Array.isArray(Pe)?Pe:[]).forEach(ot=>de(nt,ot))},zt=()=>{var y;i||(We.readOnly=!o(n.manualInput),We.disabled=!!o(n.disabled),We.setAttribute("aria-expanded",f?"true":"false"),We.value=$(Ge,R),Lt(),(y=ut==null?void 0:ut._refresh)==null||y.call(ut))},Rt=(y,de,Pe={})=>{var Tt,Ut,on;const nt=Q(y),ot=le()?Kt((Tt=Fn(Pe.timeValue!=null?Pe.timeValue:Pe.preserveTime?Oe():y,te()))!=null?Tt:Pe.preserveTime?Oe():null):null,it=Je(Ge,R);Ge=h(nt),He=h(nt),le()&&(R=Kt(ot),Te=Kt(ot)),O=null,St(nt,Pe),zt(),cn(),D&&Pe.fromModel!==!0&&D.set(Le(nt,ot));const ft=Je(nt,ot);if(Pe.emit!==!1&&ft!==it){const mn=Le(nt,ot);(Ut=n.onInput)==null||Ut.call(n,mn,de),(on=n.onChange)==null||on.call(n,mn,de)}return nt},et=(y,de,Pe={})=>{var ft,Tt;if(!le())return null;const nt=Kt(Fn(y,te()));if(o(n.confirm)&&Pe.commit!==!0)return Te=nt,cn(),nt;const ot=Je(Ge,R);R=Kt(nt),Te=Kt(nt),zt(),cn(),D&&Pe.fromModel!==!0&&D.set(Le(Ge,nt));const it=Je(Ge,nt);if(Pe.emit!==!1&&it!==ot){const Ut=Le(Ge,nt);(ft=n.onInput)==null||ft.call(n,Ut,de),(Tt=n.onChange)==null||Tt.call(n,Ut,de)}return nt},yt=(y,de,Pe={})=>{if(o(n.confirm)){He=h(Q(y)),le()&&(Pe.timeValue!=null||Pe.preserveTime)&&(Te=Kt(Fn(Pe.timeValue!=null?Pe.timeValue:Oe(),te()))),O=null,St(He,Pe),cn();return}Rt(y,de,Pe)},Jt=()=>{const y=Y();if(l==="range")return!(y!=null&&y.from)||y!=null&&y.to||!O?y:H(y.from,O)<=0?{from:y.from,to:O}:{from:O,to:y.from};if(l==="range-multiple"){const de=Array.isArray(y)&&y.length?y[y.length-1]:null;return!(de!=null&&de.from)||de!=null&&de.to||!O?de:H(de.from,O)<=0?{from:de.from,to:O}:{from:O,to:de.from}}return y},jt=()=>{if(l==="range"){const y=Jt();return y!=null&&y.from?[y]:[]}if(l==="range-multiple"){const y=Array.isArray(Y())?Y():[];if(!y.length)return[];const de=Jt();return de!=null&&de.from?[...y.slice(0,-1),de]:y}return[]},Xt=y=>{const de=Y();return l==="multiple"?de.includes(y):l==="range-multiple"?Array.isArray(de)&&de.some(Pe=>ue(Pe==null?void 0:Pe.from,y)||ue(Pe==null?void 0:Pe.to,y)):l==="range"?ue(de==null?void 0:de.from,y)||ue(de==null?void 0:de.to,y):ue(de,y)},Qt=y=>l!=="range"&&l!=="range-multiple"?!1:jt().some(de=>(de==null?void 0:de.from)&&(de==null?void 0:de.to)&&y>=de.from&&y<=de.to),an=(y,de={})=>{const Pe=Y(),nt=l==="range"?Pe:l==="range-multiple"&&Array.isArray(Pe)&&Pe.length?Pe[Pe.length-1]:null;!(nt!=null&&nt.from)||nt!=null&&nt.to||O===y||(O=y,de.render!==!1&&cn())},$t=()=>i||o(n.confirm)||n.closeOnSelect===!1?!1:l==="multiple"||l==="range-multiple"?!!n.closeOnSelect:!0,Zt=(y,de,Pe={})=>{var ot;if(!Ee(y)||o(n.disabled)||o(n.readonly))return;const nt={focusIso:y,anchorIso:y,preserveTime:le(),timeValue:Oe(),preserveMonthOffset:!!f&&L()>1,visibleMonthOffset:Number.isInteger(Pe.visibleMonthOffset)?Pe.visibleMonthOffset:null};if(l==="multiple"){const it=J(Y()),ft=it.includes(y)?it.filter(Tt=>Tt!==y):[...it,y];yt(ft.sort(),de,nt),$t()&&dn();return}if(l==="range"){const it=h(Y());let ft;!it.from||it.from&&it.to?ft={from:y,to:null}:H(y,it.from)<0?ft={from:y,to:it.from}:ft={from:it.from,to:y},yt(ft,de,nt),ft.to&&$t()&&dn();return}if(l==="range-multiple"){const it=b(Y()),ft=it.length?it[it.length-1]:null;let Tt;!(ft!=null&&ft.from)||ft!=null&&ft.to?Tt=[...it,{from:y,to:null}]:H(y,ft.from)<0?Tt=[...it.slice(0,-1),{from:y,to:ft.from}]:Tt=[...it.slice(0,-1),{from:ft.from,to:y}],yt(Tt,de,nt),(ot=Tt[Tt.length-1])!=null&&ot.to&&$t()&&dn();return}yt(y,de,nt),$t()&&dn()},un=()=>{k=null,Rt(Be(),null,{timeValue:null})},hn=()=>{const y=me();if(!Ee(y)){St(y),cn();return}if(l==="range"){const de=Ae(y,1),Pe=de&&Ee(de)?{from:y,to:de}:{from:y,to:null};yt(Pe,null);return}if(l==="range-multiple"){const de=Ae(y,1),Pe=de&&Ee(de)?[{from:y,to:de}]:[{from:y,to:null}];yt(Pe,null);return}if(l==="multiple"){yt([y],null);return}yt(y,null,{preserveTime:le(),timeValue:Oe()})},qt=(y={})=>{ii(E,y)},Jn=()=>{if(!le())return;const y=xo(E);et(new Date,null,{commit:!o(n.confirm)}),qt({scrollState:y}),!o(n.confirm)&&n.closeOnSelect===!0&&dn()},In=()=>{o(n.confirm)&&(Rt(He,null,{timeValue:Te,preserveTime:!0}),n.closeOnSelect!==!1&&dn())},cn=()=>{var Ar,Nr,kr,_r,Fr,Lr,Ir,Er,Tr,Pr,Rr,zr,Mr,Jr,Or,Dr,jr,Hr,Vr;if(!E)return;const y=F(),de=new Intl.DateTimeFormat(y,{month:"long",year:"numeric"}),Pe=new Intl.DateTimeFormat(y,{weekday:"short"}),nt=Array.from({length:7},(Ft,Ht)=>{const En=(m()+Ht)%7;return Pe.format(new Date(2024,0,7+En))}),ot=Y(),it=Ft=>{let Ht=JSswift.ui.renderSlot(d,"point",Ft,null);return Ht==null&&(Ht=JSswift.ui.renderSlot(d,"dayPoint",Ft,null)),Ht==null&&n.pointIcon!=null&&(Ft.selected||Ft.inRange||Ft.today)&&(Ht=typeof n.pointIcon=="string"?v.Icon({name:n.pointIcon,size:10}):JSswift.ui.slot(n.pointIcon,Ft)),r(null,"default",Ft,Ht)},ft=(Ft,Ht)=>{const En=Ft.getFullYear(),Qs=Ft.getMonth(),Zs=new Date(En,Qs,1),Eo=(Zs.getDay()-m()+7)%7,Uo=new Date(En,Qs,1-Eo),To=_.div({class:"cms-date-month"});To.appendChild(_.div({class:"cms-date-month-title"},de.format(Zs)));const Br=_.div({class:"cms-date-weekdays"});nt.forEach(eo=>Br.appendChild(_.div({class:"cms-date-weekday"},eo))),To.appendChild(Br);const $r=_.div({class:"cms-date-grid"});for(let eo=0;eo<42;eo+=1){const Wo=new Date(Uo.getFullYear(),Uo.getMonth(),Uo.getDate()+eo),Nn=Z(Wo),Ur=Wo.getMonth()===Qs,Wr=Xt(Nn),Gr=Qt(Nn),Kr=(l==="range"||l==="range-multiple")&&jt().some(Sn=>ue(Sn==null?void 0:Sn.from,Nn)),qr=(l==="range"||l==="range-multiple")&&jt().some(Sn=>ue(Sn==null?void 0:Sn.to,Nn)),Go=!Ee(Nn),Ko={...Ne(Nn),selected:Wr,inRange:Gr,rangeStart:Kr,rangeEnd:qr,disabled:Go,outside:!Ur,value:ot,select:()=>Zt(Nn,null,{visibleMonthOffset:Ht})},qo=it(Ko),Na=JSswift.ui.renderSlot(d,"day",Ko,String(Wo.getDate())),ka=r(null,"default",Ko,Na),_a=_.button({type:"button",class:fe(["cms-date-day",xe(!Ur,"is-outside"),xe(Wr,"is-selected"),xe(Gr,"is-in-range"),xe(Kr,"is-range-start"),xe(qr,"is-range-end"),xe(Go,"is-disabled"),xe(ue(Nn,me()),"is-today"),xe(qo.length,"has-point")]),disabled:Go,onMouseDown:Sn=>{Sn.button===0&&(k=Nn,Sn.preventDefault(),Zt(Nn,Sn,{visibleMonthOffset:Ht}))},onClick:Sn=>{if(k!=null&&Sn.detail!==0){k=null;return}k=null,Zt(Nn,Sn,{visibleMonthOffset:Ht})},onMouseEnter:()=>an(Nn),onFocus:()=>an(Nn,{render:!1})},_.span({class:"cms-date-day-label"},...ka),qo.length?_.span({class:"cms-date-day-point"},...qo):null);$r.appendChild(_a)}return To.appendChild($r),To},Tt=ee(),Ut=we(),on=[x.getFullYear(),(Ar=ge(me()))==null?void 0:Ar.getFullYear(),(Nr=ge(Tt))==null?void 0:Nr.getFullYear(),(kr=ge(Ut))==null?void 0:kr.getFullYear(),(_r=ge(o(n.defaultMonth)))==null?void 0:_r.getFullYear()];l==="range"?on.push((Fr=ge(ot==null?void 0:ot.from))==null?void 0:Fr.getFullYear(),(Lr=ge(ot==null?void 0:ot.to))==null?void 0:Lr.getFullYear()):l==="range-multiple"?ot.forEach(Ft=>{var Ht,En;on.push((Ht=ge(Ft==null?void 0:Ft.from))==null?void 0:Ht.getFullYear(),(En=ge(Ft==null?void 0:Ft.to))==null?void 0:En.getFullYear())}):l==="multiple"?ot.forEach(Ft=>{var Ht;return on.push((Ht=ge(Ft))==null?void 0:Ht.getFullYear())}):on.push((Ir=ge(ot))==null?void 0:Ir.getFullYear());const mn=on.filter(Ft=>Number.isFinite(Ft)),On=(mn.length?Math.min(...mn):x.getFullYear())-100,An=(mn.length?Math.max(...mn):x.getFullYear())+50,yn=Number(o((Pr=(Tr=n.yearStart)!=null?Tr:Tt?(Er=ge(Tt))==null?void 0:Er.getFullYear():null)!=null?Pr:On)),as=Number(o((Mr=(zr=n.yearEnd)!=null?zr:Ut?(Rr=ge(Ut))==null?void 0:Rr.getFullYear():null)!=null?Mr:An)),bs=_.select({class:"cms-date-select",value:String(x.getMonth()),onChange:Ft=>{var Ht;x=new Date(x.getFullYear(),Number(Ft.currentTarget.value),1),(Ht=n.onNavigate)==null||Ht.call(n,{month:x.getMonth()+1,year:x.getFullYear()}),cn()}},...Array.from({length:12},(Ft,Ht)=>_e({value:String(Ht)},new Intl.DateTimeFormat(y,{month:"long"}).format(new Date(2024,Ht,1))))),ys=_.select({class:"cms-date-select cms-date-select-year",value:String(x.getFullYear()),onChange:Ft=>{var Ht;x=new Date(Number(Ft.currentTarget.value),x.getMonth(),1),(Ht=n.onNavigate)==null||Ht.call(n,{month:x.getMonth()+1,year:x.getFullYear()}),cn()}},...Array.from({length:Math.max(1,as-yn+1)},(Ft,Ht)=>{const En=yn+Ht;return _e({value:String(En)},String(En))})),Is=_.div({class:"cms-date-header"},_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Ft;x=ye(x,-1),(Ft=n.onNavigate)==null||Ft.call(n,{month:x.getMonth()+1,year:x.getFullYear()}),cn()}},v.Icon({name:"chevron_left",size:16})),_.div({class:"cms-date-header-center"},bs,ys),_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Ft;x=ye(x,1),(Ft=n.onNavigate)==null||Ft.call(n,{month:x.getMonth()+1,year:x.getFullYear()}),cn()}},v.Icon({name:"chevron_right",size:16}))),Ks=_.div({class:"cms-date-shortcuts"}),qs=o((Jr=n.shortcuts)!=null?Jr:n.presets)||[];qs.forEach((Ft,Ht)=>{var Zs,Eo;if(!Ft)return;const En=typeof Ft.value=="function"?Ft.value({today:me()}):Ft.value,Qs=(Eo=(Zs=Ft.label)!=null?Zs:Ft.text)!=null?Eo:`Preset ${Ht+1}`;Ks.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>yt(En,null,{preserveTime:le(),timeValue:Oe()})},Qs))});const Ys=_.div({class:"cms-date-months"});for(let Ft=0;Ft<L();Ft+=1)Ys.appendChild(ft(ye(x,Ft),Ft));const Es=$(ot,Oe()),Ts=_.div({class:"cms-date-value"},...r(d,"value",{value:ot,displayValue:Es,mode:l,timeValue:Oe()},Es||r(d,"default",{},s))),Xs=_.div({class:"cms-time-header"}),wa=_.div({class:"cms-time-columns-2"},_.div({class:"cms-time-column-title"},o(n.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},o(n.minutesLabel)||"Min"));Xs.appendChild(wa);const va=le()?oi({props:{min:o((Or=n.timeMin)!=null?Or:n.minTime),max:o((Dr=n.timeMax)!=null?Dr:n.maxTime),use12h:o((Hr=(jr=n.time12h)!=null?jr:n.use12h)!=null?Hr:n.ampm),hoursLabel:o(n.timeHoursLabel)||"Ore",minutesLabel:o(n.timeMinutesLabel)||"Min",secondsLabel:o(n.timeSecondsLabel)||"Sec"},slots:d,slotPrefix:"time",value:Oe(),withSeconds:!1,minuteStep:1,secondStep:U(),disabled:!!o(n.disabled),readonly:!!o(n.readonly),embedded:!0,pointIcon:o(n.timePointIcon),shortcuts:o((Vr=n.timeShortcuts)!=null?Vr:n.timePresets),onSelect:Ft=>{const Ht=xo(E);et(Ft,null),qt({scrollState:Ht})}}):null,Sa=_.div({class:"cms-date-footer-info"},Ts),Ca=_.div({class:fe(["cms-date-footer",xe(le(),"has-time")])},Sa,_.div({class:"cms-date-actions"},_.button({type:"button",class:"cms-date-action",onClick:hn},o(n.todayLabel)||"Oggi"),o(n.clearable)!==!1?_.button({type:"button",class:"cms-date-action",onClick:un},o(n.clearLabel)||"Reset"):null,o(n.confirm)?_.button({type:"button",class:"cms-date-action is-primary",onClick:In},o(n.applyLabel)||"Applica"):null)),xa=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:Jn},o(n.nowLabel)||"Ora")),Aa=le()?_.div({class:"cms-date-time"},Xs,va,xa):null;E.replaceChildren(_.div({class:"cms-date-panel-root",onKeydown:Ft=>{var Ht;Ft.key==="Escape"&&(Ft.preventDefault(),i?(Ht=n.onEscape)==null||Ht.call(n,Ft):dn())}},Is,qs.length?Ks:null,_.div({class:"cms-data-time"},Ys,Aa),Ca))};function Wn(){var y,de,Pe,nt;return f||o(n.disabled)||o(n.readonly)||(He=h(Ge),Te=Kt(R),O=null,k=null,St(He),f=JSswift.overlay.open(({close:ot})=>{var Tt;const it=l==="range"||l==="range-multiple"?2:1,ft=Number((Tt=o(n.monthsToShow))!=null?Tt:it);return E=_.div({class:zn(["cms-date-panel",o(S),xe(ft>1,"multi-month"),n.panelClass])}),cn(),E},{type:"date",anchorEl:ut._control||We,placement:n.placement||"bottom-start",offsetX:(y=n.offsetX)!=null?y:0,offsetY:(Pe=(de=n.offsetY)!=null?de:n.offset)!=null?Pe:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:n.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:zn(["cms-date-overlay",n.panelClass,xe(le(),"has-time")]),onClose:()=>{var ot;f=null,E=null,O=null,zt(),(ot=n.onClose)==null||ot.call(n)}}),n.panelStyle&&Object.assign(f.panel.style,n.panelStyle),_s(f),zt(),(nt=n.onOpen)==null||nt.call(n)),f}function dn(){if(!f)return;k=null;const y=f;Fs(y,()=>JSswift.overlay.close(y.id))}if(i){const y=l==="range"||l==="range-multiple"?2:1,de=Number((ln=o(n.monthsToShow))!=null?ln:y);E=_.div({class:zn(["cms-date-panel","cms-date-calendar",o(S),xe(de>1,"multi-month"),n.panelClass,n.class]),style:n.style})}return i||We.addEventListener("focus",y=>{var de;(de=n.onFocus)==null||de.call(n,y),n.openOnFocus!==!1&&Wn()}),i||We.addEventListener("click",y=>{var de;(de=n.onClick)==null||de.call(n,y),Wn()}),i||We.addEventListener("keydown",y=>{if(y.key==="Escape"){f&&(y.preventDefault(),dn());return}(y.key==="ArrowDown"||y.key==="Enter"||y.key===" ")&&(y.preventDefault(),Wn()),(y.key==="Backspace"||y.key==="Delete")&&!o(n.manualInput)&&o(n.clearable)!==!1&&(y.preventDefault(),un())}),!i&&o(n.manualInput)?(We.addEventListener("input",y=>{var de;(de=n.onTyping)==null||de.call(n,We.value,y)}),We.addEventListener("change",y=>{const de=je(We.value);Rt(de,y,{timeValue:Fn(We.value,te()),preserveTime:!Fn(We.value,te())})}),We.addEventListener("blur",y=>{var Pe;(Pe=n.onBlur)==null||Pe.call(n,y);const de=je(We.value);We.value===""?un():Rt(de,y,{timeValue:Fn(We.value,te()),preserveTime:!Fn(We.value,te())})})):i||We.addEventListener("blur",y=>{var de;return(de=n.onBlur)==null?void 0:de.call(n,y)}),D&&D.watch(y=>{const de=Q(y),Pe=ce(y);Je(de,Pe)!==Je(Ge,R)&&(Ge=de,He=h(Ge),R=Kt(Pe),Te=Kt(Pe),O=null,St(Ge),zt(),cn())},i?"UI.Calendar:watch":"UI.Datepicker:watch"),JSswift.reactive.effect(()=>{!D&&n.value!=null?(Ge=Q(o(n.value)),He=h(Ge),R=ce(o(n.value)),Te=Kt(R)):le()&&n.timeValue!=null&&(R=ce(o(n.timeValue)),Te=Kt(R)),zt(),cn(),f&&o(n.disabled)&&dn()},i?"UI.Calendar:render":"UI.Datepicker:render"),i?(E._calendar=E,E._date=E,E._getValue=()=>Le(Ge,R),E._setValue=y=>Rt(y,null,{emit:!1,timeValue:ce(y)}),E._clear=un,E._select=y=>{const de=c(y);de&&Zt(de,null)},E._time=()=>Kt(R),E):(ut._input=We,ut._date=We,ut._open=Wn,ut._close=dn,ut._getValue=()=>Le(Ge,R),ut._setValue=y=>Rt(y,null,{emit:!1,timeValue:ce(y)}),ut._time=()=>Kt(R),ut._panel=()=>(f==null?void 0:f.panel)||null,ut)};v.Datepicker=(...t)=>ri(t),v.Calendar=(...t)=>ri(t,{calendar:!0}),v.Date=v.Datepicker,JSswift.ui.Datepicker=v.Datepicker,JSswift.ui.Calendar=v.Calendar,JSswift.ui.Date=v.Date,(tr=JSswift.isDev)!=null&&tr.call(JSswift)&&(v.meta=v.meta||{},v.meta.Datepicker={signature:"UI.Datepicker(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 of rangeMultiple",min:"string",max:"string",minDate:"Alias of min",maxDate:"Alias of max",minRange:"number",maxRange:"number",manualInput:"boolean",firstDayOfWeek:"number",monthsToShow:"number",locale:"string",shortcuts:"Array<{ label, value }>",options:"Array|string|Function",enableDates:"Alias of 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:"Day content ({ date, selected, inRange, disabled, outside })",point:"Point/icon in the day",dayPoint:"Alias of point",value:"Footer value renderer ({ value, displayValue, mode })",timeOption:"Renderer for a time option in the integrated footer",timePoint:"Point/icon in the footer time option",timeShortcut:"Integrated time shortcut renderer",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:"Reactive datepicker input with fixed overlay, single/range/multiple/multi-range modes, model, min/max, presets, xs-xl sizes, and optional time support in a unified interface."},v.meta.Calendar={...v.meta.Datepicker,signature:"UI.Calendar(props)",returns:"HTMLDivElement calendar panel con ._getValue(), ._setValue(value), ._clear(), ._select(value)",description:"Standalone interactive calendar panel using the same engine and styling as UI.Datepicker, with direct model persistence."},v.meta.Date=v.meta.Datepicker),v.Time=(...t)=>{var re,c,N;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Et(e.size,()=>{const b=String(o(e.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(b)?`cms-size-${b}`:""}),d=()=>{var J,Q,ee,we,F;const b=Qn(Fn(w?w.get():(J=o(e.value))!=null?J:D,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((Q=e.withSeconds)!=null?Q:e.showSeconds)||/:\d{2}:\d{2}$/.test(b),min:o((ee=e.min)!=null?ee:e.minTime),max:o((we=e.max)!=null?we:e.maxTime),use12h:o((F=e.use12h)!=null?F:e.ampm)}},S=()=>{var J;const b=Number(o((J=e.minuteStep)!=null?J:1));return Math.max(1,Math.min(30,Number.isFinite(b)?b:5))},u=()=>{var J;const b=Number(o((J=e.secondStep)!=null?J:1));return Math.max(1,Math.min(30,Number.isFinite(b)?b:5))},l=e.model||(Gt(e.value)||rn(e.value)?e.value:null),w=bn(l,"UI.Time:model"),D=w?w.get():o(e.value),A=b=>Fn(b,d()),C=b=>Co(b,d()),z=b=>Qn(b,d()),le=b=>JSON.stringify(z(b));let te=Kt(A(D)),he=Kt(te),U=null,W=null;const oe={...e,label:(re=e.label)!=null?re:e.placeholder},Z=oe.label!=null||JSswift.ui.getSlot(s,"label")!=null,ge=_.input({class:fe(["cms-input","cms-time-display",i,xe(e.manualInput,"is-manual"),e.inputClass]),type:"text",autocomplete:"off",placeholder:Z?"":(c=e.placeholder)!=null?c:"Seleziona orario",readOnly:!o(e.manualInput),disabled:!!o(e.disabled),value:C(te)});ge.setAttribute("aria-haspopup","dialog");const Ae=_.div({style:{display:"contents"}}),ye=_.div({class:"cms-time-control",style:{display:"contents"}},ge,Ae),pe=v.FormField({...oe,iconRight:(N=e.iconRight)!=null?N:"schedule",control:ye,getValue:()=>ge.value,onClear:()=>{o(e.disabled)||o(e.readonly)||(ae(null,null,{commit:!0}),U&&V())},onFocus:()=>ge.focus()}),me=()=>o(e.confirm)?he:te,ue=()=>{Ae.replaceChildren();const b=o(e.name);b&&Ae.appendChild(_.input({type:"hidden",name:b,value:z(te)}))},H=()=>{var b;ge.readOnly=!o(e.manualInput),ge.disabled=!!o(e.disabled),ge.setAttribute("aria-expanded",U?"true":"false"),ge.value=C(te),ue(),(b=pe._refresh)==null||b.call(pe)},ae=(b,J,Q={})=>{var m,L;const ee=Kt(A(b));if(o(e.confirm)&&Q.commit!==!0)return he=Kt(ee),p(),ee;const we=le(te);te=Kt(ee),he=Kt(ee),H(),p(),w&&Q.fromModel!==!0&&w.set(z(ee));const F=le(ee);if(Q.emit!==!1&&F!==we){const P=z(ee);(m=e.onInput)==null||m.call(e,P,J),(L=e.onChange)==null||L.call(e,P,J)}return ee},ie=b=>o(e.confirm)||e.closeOnSelect!==!0?!1:d().withSeconds?(b==null?void 0:b.part)==="second":(b==null?void 0:b.part)==="minute",ve=(b={})=>{ii(W,b)},I=()=>{const b=xo(W);ae(new Date,null,{commit:!o(e.confirm)}),ve({scrollState:b}),!o(e.confirm)&&e.closeOnSelect===!0&&V()},g=()=>{o(e.confirm)&&(ae(he,null,{commit:!0}),e.closeOnSelect!==!1&&V())},p=()=>{var L,P,Y,Ne;if(!W)return;const b=me(),J=C(b),Q=_.div({class:"cms-time-header"}),ee=_.div({class:"cms-time-columns"},_.div({class:"cms-time-column-title"},o(e.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},o(e.minutesLabel)||"Min")),we=d().withSeconds;we&&ee.appendChild(_.div({class:"cms-time-column-title"},o(e.secondsLabel)||"Sec")),Q.appendChild(ee);const F=oi({props:{min:o((L=e.min)!=null?L:e.minTime),max:o((P=e.max)!=null?P:e.maxTime),use12h:o((Y=e.use12h)!=null?Y:e.ampm),hoursLabel:o(e.hoursLabel)||"Ore",minutesLabel:o(e.minutesLabel)||"Min",secondsLabel:o(e.secondsLabel)||"Sec"},slots:s,value:b,withSeconds:we,minuteStep:S(),secondStep:u(),disabled:!!o(e.disabled),readonly:!!o(e.readonly),pointIcon:o(e.pointIcon),shortcuts:o((Ne=e.shortcuts)!=null?Ne:e.presets),onSelect:(ze,Ee)=>{const K=xo(W);ae(ze,null),ve({scrollState:K}),ie(Ee)&&V()}}),m=_.div({class:"cms-time-footer"},_.div({class:"cms-time-value"},...r(s,"value",{value:b,displayValue:J},J||r(s,"default",{},n))),_.div({class:"cms-time-actions"},_.button({type:"button",class:"cms-time-action",onClick:I},o(e.nowLabel)||"Ora"),o(e.clearable)!==!1?_.button({type:"button",class:"cms-time-action",onClick:()=>ae(null,null,{commit:!o(e.confirm)})},o(e.clearLabel)||"Reset"):null,o(e.confirm)?_.button({type:"button",class:"cms-time-action is-primary",onClick:g},o(e.applyLabel)||"Applica"):null));W.replaceChildren(_.div({class:"cms-time-panel-root",onKeydown:ze=>{ze.key==="Escape"&&(ze.preventDefault(),V())}},Q,F,m))};function h(){var b,J,Q,ee;return U||o(e.disabled)||o(e.readonly)||(he=Kt(te),U=JSswift.overlay.open(()=>(W=_.div({class:zn(["cms-time-panel",o(i),e.panelClass])}),p(),W),{type:"time",anchorEl:pe._control||ge,placement:e.placement||"bottom-start",offsetX:(b=e.offsetX)!=null?b:0,offsetY:(Q=(J=e.offsetY)!=null?J:e.offset)!=null?Q:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:e.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:zn(["cms-time-overlay",e.panelClass]),onClose:()=>{var we;U=null,W=null,H(),(we=e.onClose)==null||we.call(e)}}),e.panelStyle&&Object.assign(U.panel.style,e.panelStyle),_s(U),ve(),H(),(ee=e.onOpen)==null||ee.call(e)),U}function V(){if(!U)return;const b=U;Fs(b,()=>JSswift.overlay.close(b.id))}return ge.addEventListener("focus",b=>{var J;(J=e.onFocus)==null||J.call(e,b),e.openOnFocus!==!1&&h()}),ge.addEventListener("click",b=>{var J;(J=e.onClick)==null||J.call(e,b),h()}),ge.addEventListener("keydown",b=>{if(b.key==="Escape"){U&&(b.preventDefault(),V());return}(b.key==="ArrowDown"||b.key==="Enter"||b.key===" ")&&(b.preventDefault(),h()),(b.key==="Backspace"||b.key==="Delete")&&!o(e.manualInput)&&o(e.clearable)!==!1&&(b.preventDefault(),ae(null,b,{commit:!0}))}),o(e.manualInput)?(ge.addEventListener("input",b=>{var J;return(J=e.onTyping)==null?void 0:J.call(e,ge.value,b)}),ge.addEventListener("change",b=>ae(ge.value,b)),ge.addEventListener("blur",b=>{var J;(J=e.onBlur)==null||J.call(e,b),ge.value===""?ae(null,b):ae(ge.value,b)})):ge.addEventListener("blur",b=>{var J;return(J=e.onBlur)==null?void 0:J.call(e,b)}),w&&w.watch(b=>{const J=Kt(A(b));le(J)!==le(te)&&(te=Kt(J),he=Kt(J),H(),p())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!w&&e.value!=null&&(te=Kt(A(o(e.value))),he=Kt(te)),H(),p(),U&&o(e.disabled)&&V()},"UI.Time:render"),pe._input=ge,pe._time=ge,pe._open=h,pe._close=V,pe._getValue=()=>z(te),pe._setValue=b=>ae(b,null,{emit:!1,commit:!0}),pe._panel=()=>(U==null?void 0:U.panel)||null,pe},(nr=JSswift.isDev)!=null&&nr.call(JSswift)&&(v.meta=v.meta||{},v.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 for a time option ({ part, value, label, selected, timeValue })",point:"Point/icon in the selected time option",shortcut:"Shortcut renderer",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:"Reactive time picker with fixed overlay, label/icon slots, point icon, shortcuts, confirm, and model."}),v.Tabs=(...t)=>{var L,P,Y,Ne,ze,Ee;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(K,$)=>!!K&&Object.prototype.hasOwnProperty.call(K,$),d=K=>String(o(K)||"horizontal").toLowerCase()==="vertical"?"vertical":"horizontal",S=K=>{const $=String(o(K)||"").toLowerCase();return $==="pills"||$==="pill"?"pills":$==="soft"||$==="card"?"soft":"line"},u=K=>{var se;const $=o(K);return $==null||$===""?null:(se=JSswift.uiColors)!=null&&se.includes($)?`var(--cms-${$})`:String($)},l=(K,$)=>Object.is(K,$)||K!=null&&$!=null&&K==$,w=bn(e.model,"UI.Tabs:model"),D=d(e.orientation||e.orient||e.direction),A=S(e.variant||(e.pills?"pills":e.soft?"soft":"line")),C=!!o((P=(L=e.fill)!=null?L:e.navFill)!=null?P:e.stretch),z=!!o(e.wrap),le=!!o(e.disabled),te=e.id||"cms-tabs-"+Math.random().toString(36).slice(2,9),he=o((Y=e.tabs)!=null?Y:e.items)||[],U=(Array.isArray(he)?he:[he]).map((K,$)=>{var ce,Oe,Le,Je,Fe,Ge,He,R,Te,O,k,x,f,E;if(K==null)return null;if(typeof K!="object")return{raw:K,index:$,value:K,labelFallback:K,noteFallback:null,iconFallback:null,badgeFallback:null,disabled:!1,hidden:!1};const se=(Ge=(Fe=(Je=(Le=(Oe=(ce=K.value)!=null?ce:K.name)!=null?Oe:K.id)!=null?Le:K.key)!=null?Je:K.label)!=null?Fe:K.title)!=null?Ge:`tab-${$}`,je=(O=(Te=(R=(He=K.label)!=null?He:K.title)!=null?R:K.name)!=null?Te:K.value)!=null?O:`Tab ${$+1}`,Be=i(K,"badge")?K.badge:i(K,"counter")?K.counter:null;return{...K,raw:K,index:$,value:se,labelFallback:je,noteFallback:(f=(x=(k=K.note)!=null?k:K.subtitle)!=null?x:K.description)!=null?f:null,iconFallback:(E=K.icon)!=null?E:null,badgeFallback:Be}}).filter(Boolean).filter(K=>K.hidden!==!0&&K.visible!==!1),W=U.find(K=>!K.disabled)||null,oe=K=>U.findIndex($=>l($.value,K)),Z=(K,$)=>{var je;if(!U.length)return-1;let se=K;for(let Be=0;Be<U.length;Be+=1)if(se+=$,se<0?se=U.length-1:se>=U.length&&(se=0),!((je=U[se])!=null&&je.disabled))return se;return-1},ge=(K,$=!1)=>{var je,Be;const se=oe(K);return se>=0&&!((je=U[se])!=null&&je.disabled)?U[se].value:$?(Be=W==null?void 0:W.value)!=null?Be:null:K!=null?K:null},Ae=ge(w?w.get():i(e,"value")?o(e.value):(Ne=e.defaultValue)!=null?Ne:e.default,!0),[ye,pe]=JSswift.reactive.signal(Ae),me=fe(["cms-clear-set","cms-tabs","cms-singularity",D,`variant-${A}`,xe(e.dense,"dense"),xe(C,"fill"),xe(z,"wrap"),xe(le,"disabled"),e.class]),ue=JSswift.omit(e,["tabs","items","value","defaultValue","default","model","orientation","orient","direction","variant","pills","soft","fill","navFill","stretch","wrap","dense","disabled","slots","empty","gap","tabGap","align","justify","color","state","navClass","navStyle","barClass","barStyle","tabClass","tabStyle","itemClass","itemStyle","class","style"]);ue.class=me,ue.style={...e.style||{}},e.gap!=null&&(ue.style["--cms-tabs-gap"]=ht(e.gap)),e.tabGap!=null&&(ue.style["--cms-tabs-tab-gap"]=ht(e.tabGap));const H=u((ze=e.color)!=null?ze:e.state);H&&(ue.style["--cms-tabs-accent"]=H);const ae=_.div(ue),ie=_.div({class:fe(["cms-tabs-bar",e.barClass]),style:{alignItems:e.align||(D==="vertical"?"stretch":"center"),justifyContent:e.justify||"flex-start",...e.barStyle||{}}}),ve=_.div({class:fe(["cms-tabs-nav",e.navClass]),style:e.navStyle||null,role:"tablist","aria-orientation":D}),I=[],g=()=>oe(ye()),p=()=>{const K=g();return K>=0?U[K]:null},h=()=>({tabs:U,value:ye(),active:ye(),activeIndex:g(),activeTab:p(),orientation:D,variant:A,select:(K,$)=>b(K,{event:$,emit:!0}),next:()=>Q(),prev:()=>ee()}),V=(K,$,se)=>({...h(),tab:K,index:$,active:se,disabled:!!K.disabled,select:je=>J($,{event:je,emit:!0})}),re=K=>{var se;const $=(se=I[K])==null?void 0:se.btn;!$||typeof $.focus!="function"||requestAnimationFrame(()=>$.focus())},c=K=>{const $=oe(K);ae.dataset.value=K==null?"":String(K),ae.dataset.activeIndex=$>=0?String($):"",I.forEach(({btn:se,item:je,tab:Be,index:ce})=>{const Oe=ce===$;je.classList.toggle("active",Oe),je.classList.toggle("disabled",!!(Be.disabled||le)),se.classList.toggle("active",Oe),se.setAttribute("aria-selected",Oe?"true":"false"),se.setAttribute("tabindex",Oe?"0":"-1")})},N=K=>{pe(K),c(K)},b=(K,$={})=>{if(le)return null;const se=oe(K);return se<0?null:J(se,$)},J=(K,$={})=>{var Oe,Le;const se=U[K];if(!se||se.disabled||le)return null;const je=se.value,Be=ye(),ce=!l(Be,je);return N(je),w&&!l(w.get(),je)&&w.set(je),$.focus&&re(K),$.event&&((Oe=se.onClick)==null||Oe.call(se,je,$.event,se,K)),ce&&$.emit!==!1&&((Le=e.onChange)==null||Le.call(e,je,se,$.event||null,K)),se},Q=()=>{const K=Z(g()<0?-1:g(),1);K>=0&&J(K,{emit:!0,focus:!0})},ee=()=>{const K=g()<0?0:g(),$=Z(K,-1);$>=0&&J($,{emit:!0,focus:!0})},we=(K,$)=>{var x,f,E,Ce,Ue,Xe;const se=$===g(),je=V(K,$,se),Be=`${te}-tab-${$}`,ce=K.iconFallback!=null?typeof K.iconFallback=="string"?v.Icon({name:K.iconFallback,size:(E=(f=(x=K.iconSize)!=null?x:K.size)!=null?f:e.size)!=null?E:null}):K.iconFallback:null,Oe=r(s,"icon",je,ce),Le=r(null,"default",{},JSswift.ui.renderSlot(s,"label",je,K.labelFallback)),Je=r(s,"note",je,K.noteFallback),Fe=r(s,"badge",je,K.badgeFallback),Ge=_.span({class:"cms-tabs-tab-inner"},Oe.length?_.span({class:"cms-tabs-tab-icon"},...Oe):null,_.span({class:"cms-tabs-tab-copy"},_.span({class:"cms-tabs-tab-label"},...Le.length?Le:[""]),Je.length?_.span({class:"cms-tabs-tab-note"},...Je):null),Fe.length?_.span({class:"cms-tabs-tab-badge"},...Fe):null),He=r(s,"tab",{...je,tabId:Be,label:Le,icon:Oe,note:Je,badge:Fe},Ge),R=q=>{var ut;if(K.disabled||le)return;const We=q.key;if(We==="Enter"||We===" "){q.preventDefault(),J($,{event:q,emit:!0});return}if(We==="Home"){q.preventDefault();const St=U.findIndex(Lt=>!Lt.disabled);St>=0&&J(St,{event:q,emit:!0,focus:!0});return}if(We==="End"){q.preventDefault();let St=-1;for(let Lt=U.length-1;Lt>=0;Lt-=1)if(!((ut=U[Lt])!=null&&ut.disabled)){St=Lt;break}St>=0&&J(St,{event:q,emit:!0,focus:!0});return}const st=D==="vertical"?["ArrowUp"]:["ArrowLeft"],Ze=D==="vertical"?["ArrowDown"]:["ArrowRight"];if(st.includes(We)){q.preventDefault();const St=Z($,-1);St>=0&&J(St,{event:q,emit:!0,focus:!0});return}if(Ze.includes(We)){q.preventDefault();const St=Z($,1);St>=0&&J(St,{event:q,emit:!0,focus:!0})}},Te=u((Ce=K.color)!=null?Ce:K.state),O=_.div({class:fe(["cms-tabs-item",xe(se,"active"),xe(K.disabled||le,"disabled"),e.itemClass,K.itemClass]),style:{...Te?{"--cms-tabs-item-accent":Te}:{},...e.itemStyle||{},...K.itemStyle||{}},"data-name":String(K.value)}),k=v.Btn({class:fe(["cms-tabs-tab",xe(se,"active"),xe(K.disabled||le,"disabled"),e.tabClass,K.tabClass||K.class]),type:"button",id:Be,role:"tab",disabled:!!(K.disabled||le),"aria-selected":se?"true":"false",tabindex:se?"0":"-1",size:(Xe=(Ue=K.size)!=null?Ue:e.size)!=null?Xe:null,style:{...e.tabStyle||{},...K.tabStyle||{}},onClick:q=>{J($,{event:q,emit:!0})},onKeydown:R},...He);return O.appendChild(k),O.appendChild(_.span({class:"tab-indicator"})),I[$]={tab:K,index:$,item:O,btn:k},O};if(U.length){const K=U.map((se,je)=>we(se,je)),$=JSswift.ui.renderSlot(s,"nav",{...h(),nodes:K},K);r(null,"default",{},$).forEach(se=>ve.appendChild(se))}else r(s,"empty",h(),(Ee=e.empty)!=null?Ee:_.div({class:"cms-tabs-empty"},"Nessuna tab disponibile.")).forEach(K=>ve.appendChild(K));const F=h(),m=[...r(null,"default",{},JSswift.ui.renderSlot(s,"extra",F,null)),...r(s,"default",F,n)];return ie.appendChild(ve),m.length&&ie.appendChild(_.div({class:"cms-tabs-extra"},...m)),ae.appendChild(ie),N(Ae),w?w.watch(K=>{N(ge(K,!0))},"UI.Tabs:watch"):Dt(e.value)&&mt.reactive.effect(()=>{N(ge(o(e.value),!0))},"UI.Tabs:value"),ae._getValue=()=>ye(),ae._setValue=K=>b(K,{emit:!0}),ae._select=K=>b(K,{emit:!0}),ae._next=()=>Q(),ae._prev=()=>ee(),ae._getTabs=()=>U.slice(),G(ae,e),ae},(sr=JSswift.isDev)!=null&&sr.call(JSswift)&&(v.meta=v.meta||{},v.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 of tabs",value:"any",defaultValue:"any",default:"Alias of 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:"Full nav renderer",tab:"Single tab renderer",label:"Label renderer",icon:"Icon renderer",note:"Note renderer",badge:"Badge/counter renderer",extra:"Extra area next to the nav",empty:"Fallback when tabs/items are empty",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:"Standardized tab bar with controlled/uncontrolled support, structured slots, badge/note/icon, and keyboard navigation."}),v.RouteTab=(...t)=>{var re,c,N,b,J,Q,ee,we,F,m,L,P,Y,Ne,ze;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.router||(mt==null?void 0:mt.router)||null,d=Ee=>Object.prototype.hasOwnProperty.call(e,Ee),S=d("active")||d("selected"),u=Ee=>{const K=String(o(Ee)||"").toLowerCase();return K==="pill"||K==="pills"?"pills":K==="soft"||K==="card"?"soft":"line"},l=Ee=>{var $;const K=o(Ee);return K==null||K===""?null:($=JSswift.uiColors)!=null&&$.includes(K)?`var(--cms-${K})`:String(K)},w=Ee=>{if(Ee==null||Ee==="")return"";try{return new URL(String(Ee),window.location.origin).pathname||""}catch(K){return String(Ee).split(/[?#]/)[0]||""}},D=Ee=>o(e.external)===!0?!0:Ee?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Ee)):!1,A=()=>{var Ee;return o((Ee=e.href)!=null?Ee:e.to)||"#"},C=()=>{var Ee;return o((Ee=e.to)!=null?Ee:e.href)||""},z=()=>{try{if(i!=null&&i.current)return i.current().pathname||window.location.pathname||""}catch(Ee){}return window.location.pathname||""},le=()=>{var ce,Oe,Le;const Ee=C();if(!Ee)return!1;const K=o((Oe=(ce=e.match)!=null?ce:e.activeMatch)!=null?Oe:e.routeMatch),$=String(o((Le=e.matchMode)!=null?Le:e.startsWith?"startsWith":e.exact?"exact":"")||"").toLowerCase(),se=z();if(typeof K=="function")return!!K({currentPath:se,to:Ee,href:A(),router:i,props:e});if(K instanceof RegExp)return K.test(se);const je=w(typeof K=="string"&&!["exact","startsWith","prefix","section"].includes(K.toLowerCase())?K:Ee);if(!je)return!1;const Be=$||(typeof K=="string"&&["startsWith","prefix","section"].includes(K.toLowerCase())?"startsWith":"exact");return Be==="startswith"||Be==="prefix"||Be==="section"?se===je||se.startsWith(`${je}/`):i!=null&&i.isActive?!!i.isActive(Ee):se===je},te=()=>!!o(e.disabled);let he=null;const U=()=>{var Ee;return he!=null?!!he:S?!!o((Ee=e.active)!=null?Ee:e.selected):le()},W=u(e.variant||(e.pills?"pills":e.soft?"soft":"line")),oe=!o(e.color)&&o(e.state)?Vt(o(e.state)):"",Z=oe?`cms-state-${oe}`:"",ge=JSswift.omit(e,["active","selected","label","title","text","to","icon","iconRight","iconSize","note","subtitle","caption","description","badge","counter","count","aside","trailing","slots","state","color","dense","outline","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","variant","pills","soft","block","fill","match","matchMode","activeMatch","routeMatch","exact","startsWith","external","onNavigate"]);ge.href=A(),ge.class=fe(["cms-route-tab","cms-clear-set","cms-singularity",`variant-${W}`,xe((re=e.block)!=null?re:e.fill,"block"),xe(e.dense,"dense"),Z,e.class]),ge.style={...e.style||{}};const Ae=l((c=e.color)!=null?c:e.state);Ae&&(ge.style["--cms-route-tab-accent"]=Ae);const ye=(b=(N=e.iconSize)!=null?N:e.size)!=null?b:null,pe=(Ee,K)=>{const $=o(Ee);return $==null||$===!1||$===""?null:typeof $=="string"?v.Icon({name:$,size:ye}):JSswift.ui.slot($,{as:K})},me=()=>({active:U(),disabled:te(),href:A(),to:C(),external:D(A()),navigate:Ee=>{var se,je;if(te())return!1;const K=C();return!D(A())&&K&&(i!=null&&i.navigate)?(Ee!=null&&Ee.preventDefault&&Ee.preventDefault(),i.navigate(K),(se=e.onNavigate)==null||se.call(e,K,Ee||null),!0):((je=e.onNavigate)==null||je.call(e,K||A(),Ee||null),!1)}}),ue=r(s,"icon",me(),pe(e.icon,"icon")),H=r(s,"label",me(),(ee=(Q=(J=e.label)!=null?J:e.title)!=null?Q:e.text)!=null?ee:n),ae=r(s,"note",me(),(m=(F=(we=e.note)!=null?we:e.subtitle)!=null?F:e.caption)!=null?m:e.description),ie=r(s,"badge",me(),(P=(L=e.badge)!=null?L:e.counter)!=null?P:e.count),ve=r(s,"aside",me(),(Ne=(Y=e.aside)!=null?Y:e.trailing)!=null?Ne:pe(e.iconRight,"iconRight")),I=r(s,"default",me(),(ze=e.content)!=null?ze:e.body),g=_.span({class:"cms-route-tab-inner"},ue.length?_.span({class:"cms-route-tab-icon"},...ue):null,_.span({class:"cms-route-tab-copy"},_.span({class:"cms-route-tab-label"},...H.length?H:[C()||A()||""]),ae.length?_.span({class:"cms-route-tab-note"},...ae):null,I.length?_.span({class:"cms-route-tab-extra"},...I):null),ie.length?_.span({class:"cms-route-tab-badge"},...ie):null,ve.length?_.span({class:"cms-route-tab-aside"},...ve):null),p=_.a(ge,g);G(p,e);const h=()=>{const Ee=U(),K=te(),$=A(),se=D($);p.classList.toggle("active",Ee),p.classList.toggle("is-disabled",K),p.classList.toggle("is-external",se),Ee?p.setAttribute("aria-current",String(o(e.ariaCurrent)||"page")):p.removeAttribute("aria-current"),p.setAttribute("href",$||"#"),K?(p.setAttribute("aria-disabled","true"),p.tabIndex=-1):(p.removeAttribute("aria-disabled"),!d("tabIndex")&&!d("tabindex")&&p.removeAttribute("tabindex")),C()?p.dataset.to=String(C()):delete p.dataset.to,se&&p.target==="_blank"&&!p.rel&&(p.rel="noopener noreferrer")},V=e.onClick;return p.onclick=Ee=>{if(V==null||V(Ee),!Ee.defaultPrevented){if(te()){Ee.preventDefault();return}me().navigate(Ee)}},!S&&C()&&(i!=null&&i.subscribe)&&i.subscribe(()=>h()),JSswift.reactive.effect(()=>{h()},"UI.RouteTab:render"),p._isActive=()=>U(),p._setActive=Ee=>(he=Ee==null?null:!!Ee,h(),p),p._navigate=Ee=>me().navigate(Ee),p},(or=JSswift.isDev)!=null&&or.call(JSswift)&&(v.meta=v.meta||{},v.meta.RouteTab={signature:"UI.RouteTab(...children) | UI.RouteTab(props, ...children)",props:{label:"String|Node|Function|Array",to:"string",href:"string",active:"boolean",selected:"Alias of 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:"Standardized tab/link for router or href navigation, with structured slots, states, and badges."}),v.Breadcrumbs=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.router||(mt==null?void 0:mt.router)||null,d=bn(e.model,"UI.Breadcrumbs:model"),S=Et(e.size,()=>{var ae;const H=o(e.size);return typeof H=="string"&&((ae=JSswift.uiSizes)!=null&&ae.includes(H))?`cms-size-${H}`:""}),u=Et(e.variant,()=>{const H=String(o(e.variant||(e.pills?"pills":e.soft?"soft":"line"))||"").toLowerCase();return H==="pill"||H==="pills"?"variant-pills":H==="soft"||H==="card"?"variant-soft":"variant-line"}),l=Et([e.wrap,e.nowrap],()=>o(e.wrap)===!1||o(e.nowrap)?"no-wrap":""),w=_.nav({class:fe(["cms-breadcrumbs","cms-clear-set",S,u,l,xe(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),D=_.div({class:"cms-breadcrumbs-before"}),A=_.ol({class:"cms-breadcrumbs-list"}),C=_.div({class:"cms-breadcrumbs-after"});w.appendChild(D),w.appendChild(A),w.appendChild(C);const z=H=>{var ie;const ae=o(H);return ae==null||ae===""?null:(ie=JSswift.uiColors)!=null&&ie.includes(ae)?`var(--cms-${ae})`:String(ae)},le=H=>{var ie;if(!H)return!1;if(o(H.external)===!0)return!0;const ae=o((ie=H.href)!=null?ie:H.to);return ae?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(ae)):!1},te=H=>H!=null&&H.nodeType&&H.cloneNode?H.cloneNode(!0):H,he=(H,ae)=>{H.innerHTML="",ae.forEach(ie=>H.appendChild(ie))},U=(H,ae,ie,ve,I=null)=>{const g=JSswift.ui.getSlot(H,ae)!=null?r(H,ae,ie,ve):[];return g.length?g:I&&JSswift.ui.getSlot(H,I)!=null?r(H,I,ie,ve):r(null,"default",ie,ve)},W=(H,ae,ie)=>{const ve=o(H);return ve==null||ve===!1||ve===""?null:typeof ve=="string"?v.Icon({name:ve,size:ae}):JSswift.ui.slot(ve,{as:ie})},oe=()=>{var I,g;const H=d?d.get():o((g=(I=e.items)!=null?I:e.value)!=null?g:e.breadcrumbs),ae=[],ie=p=>{if(!(p==null||p===!1)){if(Array.isArray(p)){p.forEach(ie);return}if(typeof p=="string"||typeof p=="number"){ae.push({label:String(p)});return}if(p!=null&&p.nodeType||typeof p=="function"){ae.push({label:p});return}ae.push(p)}},ve=o(e.home);return ve&&ie(ve===!0?{label:"Home",to:"/",icon:"home"}:ve),ie(H),!ae.length&&(n!=null&&n.length)&&n.forEach(p=>ie(p)),ae.filter(p=>!o(p==null?void 0:p.hidden))},Z=H=>{const ae=H.findIndex(ie=>{var ve,I;return!!o((I=(ve=ie==null?void 0:ie.current)!=null?ve:ie==null?void 0:ie.active)!=null?I:ie==null?void 0:ie.selected)});return ae>-1?ae:o(e.autoCurrent)===!1?-1:H.length?H.length-1:-1},ge=H=>{var h,V,re,c,N,b,J;const ae=Number(o((re=(V=(h=e.max)!=null?h:e.maxItems)!=null?V:e.collapseAfter)!=null?re:e.collapse)),ie=Number.isFinite(ae)?Math.max(0,Math.trunc(ae)):0;if(!ie||ie<3||H.length<=ie)return H.map((Q,ee)=>({type:"item",item:Q,index:ee,key:`item-${ee}`}));let ve=Number(o((N=(c=e.leadingCount)!=null?c:e.keepStart)!=null?N:1)),I=Number(o((J=(b=e.trailingCount)!=null?b:e.keepEnd)!=null?J:Math.max(1,ie-2)));if(ve=Number.isFinite(ve)?Math.max(1,Math.trunc(ve)):1,I=Number.isFinite(I)?Math.max(1,Math.trunc(I)):Math.max(1,ie-2),ve+I+1>ie&&(I=Math.max(1,ie-ve-1),ve+I+1>ie&&(ve=Math.max(1,ie-I-1))),ve+I>=H.length)return H.map((Q,ee)=>({type:"item",item:Q,index:ee,key:`item-${ee}`}));const g=[];for(let Q=0;Q<ve;Q++)g.push({type:"item",item:H[Q],index:Q,key:`item-${Q}`});const p=H.slice(ve,H.length-I);g.push({type:"collapsed",key:`collapsed-${ve}-${H.length-I}`,items:p,from:ve,to:H.length-I-1});for(let Q=H.length-I;Q<H.length;Q++)g.push({type:"item",item:H[Q],index:Q,key:`item-${Q}`});return g},Ae=(H,ae=null)=>{var I,g,p,h,V;if(!H)return!1;const ie=o((I=H.href)!=null?I:H.to)||"",ve=o(H.to)||"";return!le(H)&&ve&&(i!=null&&i.navigate)?(ae!=null&&ae.preventDefault&&ae.preventDefault(),i.navigate(ve),(g=H.onNavigate)==null||g.call(H,ve,ae||null),(p=e.onNavigate)==null||p.call(e,ve,H,ae||null),!0):((h=H.onNavigate)==null||h.call(H,ve||ie,ae||null),(V=e.onNavigate)==null||V.call(e,ve||ie,H,ae||null),!1)},ye=(H,ae,ie)=>{var V,re,c;const ve=H,I=ie[ae+1]||null,g={index:ae,entry:H,previous:ve,next:I},p=te(o((c=(re=(H==null?void 0:H.type)==="item"?(V=H.item)==null?void 0:V.separator:null)!=null?re:e.separator)!=null?c:"/")),h=U(s,"separator",g,p);return _.li({class:"cms-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"cms-breadcrumbs-separator"},...h))},pe=(H,ae,ie)=>{const ve={type:"collapsed",collapsed:!0,items:ae,hiddenItems:H.items,currentIndex:ie,from:H.from,to:H.to},I=_.span({class:"cms-breadcrumb cms-breadcrumb-collapsed"},_.span({class:"cms-breadcrumb-inner"},_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},String(o(e.collapsedLabel)||"\u2026"))))),g=U(s,"collapsed",ve,I,"item");return _.li({class:"cms-breadcrumbs-entry is-collapsed"},...g)},me=(H,ae,ie,ve)=>{var ce,Oe,Le,Je,Fe,Ge,He,R,Te,O,k,x,f,E,Ce,Ue,Xe,q,We,st,Ze,ut,St,Lt,zt,Rt;const I=H.item||{},g=I.slots?{...s,...I.slots}:s,p=o((ce=I.href)!=null?ce:I.to)||"",h=!!o(I.disabled),V=H.index===ie,re=(Je=(Le=(Oe=I.iconSize)!=null?Oe:e.itemSize)!=null?Le:e.size)!=null?Je:null,c=z((He=(Ge=(Fe=I.color)!=null?Fe:I.state)!=null?Ge:e.color)!=null?He:e.state),N=!o(I.color)&&o(I.state)?Vt(o(I.state)):"",b=(x=(k=(O=(Te=(R=I.label)!=null?R:I.title)!=null?Te:I.text)!=null?O:I.to)!=null?k:I.href)!=null?x:"",J=(Ce=(E=(f=I.note)!=null?f:I.subtitle)!=null?E:I.caption)!=null?Ce:I.description,Q=(Xe=(Ue=I.badge)!=null?Ue:I.counter)!=null?Xe:I.count,ee=(We=(q=I.aside)!=null?q:I.trailing)!=null?We:W(I.iconRight,re,"iconRight"),we=(st=I.content)!=null?st:I.body,F={item:I,index:H.index,visibleIndex:ve,total:ae.length,current:V,active:V,disabled:h,href:p,to:o(I.to)||"",external:le(I),isFirst:H.index===0,isLast:H.index===ae.length-1,navigate:et=>Ae(I,et)},m=U(g,"icon",F,W(I.icon,re,"icon")),L=U(g,"label",F,b),P=U(g,"note",F,J),Y=U(g,"badge",F,Q),Ne=U(g,"aside",F,ee),ze=U(g,"default",F,we),Ee=_.span({class:"cms-breadcrumb-inner"},m.length?_.span({class:"cms-breadcrumb-icon"},...m):null,_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},...L.length?L:[p||""]),P.length?_.span({class:"cms-breadcrumb-note"},...P):null,ze.length?_.span({class:"cms-breadcrumb-extra"},...ze):null),Y.length?_.span({class:"cms-breadcrumb-badge"},...Y):null,Ne.length?_.span({class:"cms-breadcrumb-aside"},...Ne):null),K=!h&&(!V||!!o((Ze=I.linkCurrent)!=null?Ze:e.linkCurrent)),$={class:fe(["cms-breadcrumb","cms-clear-set","cms-singularity",xe(V,"is-current"),xe(V,"active"),xe(h,"is-disabled"),N?`cms-state-${N}`:"",I.class]),style:{...I.style||{}},"aria-current":V?String(o((ut=I.ariaCurrent)!=null?ut:e.ariaCurrent)||"page"):null};c&&($.style["--cms-breadcrumb-accent"]=c);let se=null;K&&p?(se=_.a({...$,href:p,target:I.target,rel:I.rel,onClick:et=>{var yt,Jt;(yt=I.onClick)==null||yt.call(I,et,F),(Jt=e.onItemClick)==null||Jt.call(e,I,F,et),!et.defaultPrevented&&F.navigate(et)}},Ee),F.external&&se.target==="_blank"&&!se.rel&&(se.rel="noopener noreferrer")):K&&typeof I.onClick=="function"?se=_.button({...$,type:I.type||"button",onClick:et=>{var yt,Jt;(yt=I.onClick)==null||yt.call(I,et,F),(Jt=e.onItemClick)==null||Jt.call(e,I,F,et)}},Ee):se=_.span({...$,"aria-disabled":h?"true":null},Ee),G(se,{size:(Lt=(St=I.size)!=null?St:e.itemSize)!=null?Lt:e.size,radius:(zt=I.radius)!=null?zt:e.radius,gradient:(Rt=I.gradient)!=null?Rt:e.gradient});const Be=U(g,"item",F,se);return _.li({class:fe(["cms-breadcrumbs-entry",xe(V,"is-current"),xe(h,"is-disabled")])},...Be)},ue=()=>{var g;const H=oe(),ae=Z(H),ie=ge(H),ve=z((g=e.color)!=null?g:e.state);w.classList.toggle("is-empty",H.length===0),ve?w.style.setProperty("--cms-breadcrumb-accent",ve):w.style.removeProperty("--cms-breadcrumb-accent");const I={items:H,visibleItems:ie,currentIndex:ae,count:H.length,collapsed:ie.some(p=>p.type==="collapsed")};if(he(D,U(s,"before",I,e.before)),he(C,U(s,"after",I,e.after)),A.innerHTML="",!H.length){const p=U(s,"empty",I,e.empty);p.length&&A.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...p));return}ie.forEach((p,h)=>{h>0&&A.appendChild(ye(ie[h-1],h-1,ie)),A.appendChild(p.type==="collapsed"?pe(p,H,ae):me(p,H,ae,h))})};return mt.reactive.effect(()=>{ue()},"UI.Breadcrumbs:render"),w.getItems=()=>oe(),w.getVisibleItems=()=>ge(oe()),w.refresh=()=>(ue(),w),w.setItems=H=>(d?d.set(H):e.items=H,ue(),w),G(w,e),w},(ir=JSswift.isDev)!=null&&ir.call(JSswift)&&(v.meta=v.meta||{},v.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."}),v.Pagination=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=e.slots||{},s=bn(e.model,"UI.Pagination:model"),i=Et(e.size,()=>{const c=o(e.size);return typeof c=="string"&&ms[c]?`cms-size-${c}`:""}),d=_.nav({class:fe(["cms-pagination","cms-clear-set",i,xe(e.dense,"dense"),xe(e.simple,"is-simple"),xe(e.disabled,"is-disabled"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Pagination"}),S=_.div({class:"cms-pagination-controls"}),u=_.div({class:"cms-pagination-start"}),l=_.div({class:"cms-pagination-pages"}),w=_.div({class:"cms-pagination-end"}),D=_.div({class:"cms-pagination-summary"});S.appendChild(u),S.appendChild(l),S.appendChild(w),d.appendChild(S),d.appendChild(D);let A=1,C=1;const z=(c,N=0)=>{const b=o(c);if(b==null||b==="")return N;const J=Number(b);return Number.isFinite(J)?Math.trunc(J):N},le=(c,N=te())=>{const b=Number(c),J=Number.isFinite(b)?Math.trunc(b):1;return Math.min(Math.max(J||1,1),Math.max(1,N||1))},te=()=>{var J,Q,ee,we,F,m,L;const c=z((ee=(Q=(J=e.max)!=null?J:e.pages)!=null?Q:e.pageCount)!=null?ee:e.totalPages,0);if(c>0)return c;const N=z((F=(we=e.total)!=null?we:e.totalItems)!=null?F:e.count,0),b=z((L=(m=e.pageSize)!=null?m:e.perPage)!=null?L:e.limit,0);return N>=0&&b>0?Math.max(1,Math.ceil(N/b)):1},he=()=>{var c,N,b;return z(s?s.get():(b=(N=(c=e.page)!=null?c:e.value)!=null?N:e.current)!=null?b:e.currentPage,1)},U=()=>{var c,N;return Math.max(0,z((N=(c=e.siblings)!=null?c:e.siblingCount)!=null?N:e.window,1))},W=()=>{var c,N;return Math.max(0,z((N=(c=e.boundaryCount)!=null?c:e.boundaries)!=null?N:e.edges,1))},oe=()=>!!o(e.disabled),Z=()=>{var c;return o((c=e.showSummary)!=null?c:e.showLabel)!==!1},ge=()=>o(e.showPages)!==!1&&!o(e.simple),Ae=()=>o(e.showPrev)!==!1,ye=()=>o(e.showNext)!==!1,pe=()=>!!o(e.showEdges),me=()=>{const c=o(e.showFirst);return c==null?pe():!!c},ue=()=>{const c=o(e.showLast);return c==null?pe():!!c},H=()=>!!o(e.hideOnSinglePage),ae=()=>{var b,J;const c=o((J=(b=e.total)!=null?b:e.totalItems)!=null?J:e.count);if(c==null||c==="")return null;const N=Number(c);return Number.isFinite(N)?Math.max(0,Math.trunc(N)):null},ie=()=>{var b,J;const c=o((J=(b=e.pageSize)!=null?b:e.perPage)!=null?J:e.limit);if(c==null||c==="")return null;const N=Number(c);return Number.isFinite(N)&&N>0?Math.trunc(N):null},ve=(c=A,N=C)=>{const b=ae(),J=ie(),Q=b!=null&&J?b===0?0:(c-1)*J+1:null,ee=b!=null&&J?Math.min(b,c*J):null;return{page:c,value:c,current:c,currentPage:c,pages:N,max:N,total:b,pageSize:J,from:Q,to:ee,disabled:oe(),isFirst:c<=1,isLast:c>=N,canPrev:c>1,canNext:c<N,setPage:(we,F)=>re(we,F),prev:we=>re(c-1,we),next:we=>re(c+1,we),first:we=>re(1,we),last:we=>re(N,we)}},I=(c,N)=>{if(N<=0)return[];const b=[],J=new Set,Q=W(),ee=U();for(let F=1;F<=Math.min(Q,N);F++)J.add(F);for(let F=Math.max(1,c-ee);F<=Math.min(N,c+ee);F++)J.add(F);for(let F=Math.max(1,N-Q+1);F<=N;F++)J.add(F);let we=0;for(let F=1;F<=N;F++)J.has(F)&&(we&&F-we>1&&b.push({type:"ellipsis",key:`ellipsis-${we}-${F}`}),b.push({type:"page",page:F,key:`page-${F}`}),we=F);return b.length||b.push({type:"page",page:1,key:"page-1"}),b},g=(c,N,b,J=null)=>{const Q=JSswift.ui.getSlot(n,c)!=null?r(n,c,b,N):[];return Q.length?Q:J&&JSswift.ui.getSlot(n,J)!=null?r(n,J,b,N):r(null,"default",b,N)},p=(c,N)=>{c.innerHTML="",N.forEach(b=>c.appendChild(b))},h=(c,N,b,J={})=>{var ee;const Q={...ve(),kind:c,active:!!J.active};return v.Btn({class:fe(["cms-pagination-btn",`cms-pagination-${c}`,xe(J.active,"active"),J.class]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:J.active?e.color||e.state||"primary":J.color||null,outline:J.active?!1:(ee=J.outline)!=null?ee:!0,disabled:oe()||!!J.disabled,"aria-current":J.active?"page":null,onClick:we=>{oe()||J.disabled||b==null||b(we)}},...g(c,N,Q,c==="summary"?"label":c==="page"?"item":null))},V=(c,N)=>{A=le(c,N),C=Math.max(1,N||1);const b=ve(A,C);d.style.display=H()&&C<=1?"none":"",D.style.display=Z()?"":"none",l.style.display=ge()?"":"none",u.innerHTML="",l.innerHTML="",w.innerHTML="";const J=g("start",e.start,b);J.length&&u.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-start"},...J)),me()&&u.appendChild(h("first","\xAB",we=>re(1,we),{disabled:A<=1})),Ae()&&u.appendChild(h("prev","Prev",we=>re(A-1,we),{disabled:A<=1})),ge()&&I(A,C).forEach(we=>{if(we.type==="ellipsis"){const L={...b,kind:"ellipsis"},P=g("ellipsis","\u2026",L);l.appendChild(_.span({class:"cms-pagination-ellipsis","aria-hidden":"true"},...P));return}const F=we.page,m={...b,page:F,value:F,item:we,active:F===A};l.appendChild(v.Btn({class:fe(["cms-pagination-btn","cms-pagination-page-btn",xe(F===A,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:F===A?e.color||e.state||"primary":null,outline:F!==A,disabled:oe(),"aria-current":F===A?"page":null,onClick:L=>re(F,L)},...g("page",String(F),m,"item")))}),ye()&&w.appendChild(h("next","Next",we=>re(A+1,we),{disabled:A>=C})),ue()&&w.appendChild(h("last","\xBB",we=>re(C,we),{disabled:A>=C}));const Q=g("end",e.end,b);Q.length&&w.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...Q));let ee=`Pagina ${A} di ${C}`;b.total!=null&&b.pageSize&&(ee=b.total===0?"0 risultati":`${b.from}-${b.to} di ${b.total}`),p(D,g("summary",ee,b,"label"))},re=(c,N=null)=>{var Q,ee;const b=te(),J=le(c,b);return J===A&&b===C||(V(J,b),s&&s.get()!==J&&s.set(J),(Q=e.onChange)==null||Q.call(e,J,ve(J,b),N),(ee=e.onPageChange)==null||ee.call(e,J,ve(J,b),N)),J};return mt.reactive.effect(()=>{const c=te(),N=he(),b=le(N,c);V(b,c),s&&N!==b&&s.set(b)},"UI.Pagination:sync"),d.getPage=()=>A,d.getPages=()=>C,d.setPage=c=>re(c),d.prev=()=>re(A-1),d.next=()=>re(A+1),d.first=()=>re(1),d.last=()=>re(C),G(d,e),d},(rr=JSswift.isDev)!=null&&rr.call(JSswift)&&(v.meta=v.meta||{},v.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:"Content before the controls",end:"Content after the controls",first:"First button content",prev:"Prev button content",page:"Page item content (ctx: { page, active, pages })",item:"Alias of 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."}),v.Spinner=(...t)=>{var oe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(Z,ge,Ae)=>{if(Dt(Z))return()=>{const pe=o(Z);if(pe==null||pe===!1||pe==="")return Ae;const me=ge?ge(pe):pe;return me==null||me===""?Ae:me};if(Z==null||Z===!1||Z==="")return Ae;const ye=ge?ge(Z):Z;return ye==null||ye===""?Ae:ye},d=Z=>{if(Z==null||Z===!1||Z===""||Vt(Z))return"";const Ae=String(Z).trim();return Ae?Ae.startsWith("#")||Ae.startsWith("rgb(")||Ae.startsWith("rgba(")||Ae.startsWith("hsl(")||Ae.startsWith("hsla(")||Ae.startsWith("var(")?Ae:Tn(Ae)?`var(--cms-${Ae})`:Ae:""},S=Et(e.state,()=>{const Z=Vt(o(e.state));return Z?`cms-state-${Z}`:""}),u=fe(["cms-spinner",S,xe(e.vertical,"vertical"),xe(e.reverse,"reverse"),xe(e.center,"center"),xe(e.block,"block"),xe(e.pause||e.paused,"paused"),e.class]),l=JSswift.omit(e,["ariaLabel","block","center","color","indicatorClass","indicatorStyle","label","note","pause","paused","reverse","size","slots","speed","state","thickness","trackColor","vertical"]);l.class=u;const w={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(w,"backgroundColor")&&delete w.backgroundColor,l.style=w,l.role==null&&(l.role="status"),l["aria-live"]==null&&(l["aria-live"]="polite"),l["aria-busy"]==null&&(l["aria-busy"]="true");const D={props:e},A=r(s,"label",D,e.label),C=r(s,"default",D,n),z=r(s,"note",D,e.note),le=A.length||C.length||z.length;if(!le){const Z=o((oe=e.ariaLabel)!=null?oe:e["aria-label"]);Z?l["aria-label"]=Z:l["aria-label"]==null&&(l["aria-label"]="Loading")}const te=_.span({class:fe(["cms-spinner-indicator",e.indicatorClass]),style:{"--cms-spinner-size":i(e.size,ht,"18px"),"--cms-spinner-thickness":i(e.thickness,ht,"2px"),"--cms-spinner-speed":i(e.speed,Z=>typeof Z=="number"?`${Z}ms`:String(Z),"900ms"),"--cms-spinner-color":i(e.color,d,"var(--set-border-color, var(--cms-primary))"),"--cms-spinner-track":i(e.trackColor,d,"color-mix(in srgb, var(--cms-spinner-color) 18%, transparent)"),...e.indicatorStyle||{}},"aria-hidden":"true"}),he=r(s,"indicator",D,te),U=[];he.length&&U.push(...he),le&&U.push(_.div({class:"cms-spinner-content"},A.length?_.div({class:"cms-spinner-label"},...A):null,C.length?_.div({class:"cms-spinner-copy"},...C):null,z.length?_.div({class:"cms-spinner-note"},...z):null));const W=_.div(l,...U);return G(W,e),W},(ar=JSswift.isDev)!=null&&ar.call(JSswift)&&(v.meta=v.meta||{},v.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:"Animated spinner with flexible layout, optional content, and controls for size, speed, and track."}),v.Progress=(...t)=>{var P,Y,Ne,ze,Ee,K,$,se,je,Be;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(Gt(e.value)||rn(e.value)?e.value:null),d=bn(i,"UI.Progress:model"),S=Et([e.state,e.color],()=>{const ce=Vt(o(e.state)||o(e.color));return ce?`cms-state-${ce}`:""}),u=(ce,Oe)=>{const Le=Number(ce);return Number.isFinite(Le)?Le:Oe},l=()=>u(o(e.min),0),w=()=>{const ce=l(),Oe=u(o(e.max),100);return Oe<ce?ce:Oe},D=()=>{var Oe,Le;const ce=o((Le=(Oe=e.height)!=null?Oe:e.thickness)!=null?Le: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"},A=(ce,Oe="")=>{const Le=o(ce);if(Le==null||Le===!1||Le==="")return Oe;const Je=Vt(Le);return Je?`var(--cms-${Je})`:typeof Le=="string"&&Tn(Le)?`var(--cms-${Le})`:String(Le)},C=ce=>{const Oe=l(),Le=w(),Je=u(ce,Oe);return Math.min(Le,Math.max(Oe,Je))},z=ce=>{const Oe=l(),Je=w()-Oe;if(!Je)return 0;const Fe=(C(ce)-Oe)/Je,Ge=o(e.reverse)?1-Fe:Fe;return Math.max(0,Math.min(1,Ge))},le=ce=>{const Oe=C(ce);return Oe<ge()?ge():Oe},te=(ce,Oe,Le)=>{const Je=e.formatValue;if(typeof Je=="function"){const Fe=Je(ce,Oe,Le);if(Fe!=null)return Fe}return`${Math.round(Oe)}%`},he=ce=>{for(;ce.firstChild;)ce.removeChild(ce.firstChild)},U=(ce,Oe,Le="flex")=>{he(ce),(Oe||[]).forEach(Je=>{if(!(Je==null||Je===!1)){if(Je instanceof Node){ce.appendChild(Je);return}ce.appendChild(document.createTextNode(String(Je)))}}),ce.style.display=ce.childNodes.length?Le:"none"},W=(ce,Oe={})=>Ws(o(ce),Oe),oe=(ce,Oe,Le={})=>{var Fe;const Je=o(ce);return Je==null||Je===!1||Je===""?[]:typeof Je=="string"?[v.Icon({name:Je,size:(Fe=e.iconSize)!=null?Fe:16})]:W(Je,{...Le,as:Oe})},Z=ce=>rn(ce)||Gt(ce)?o(ce):typeof ce=="function"&&ce.length===0?ce():ce,[ge,Ae]=JSswift.reactive.signal(C(d?d.get():(Y=(P=o(e.value))!=null?P:o(e.min))!=null?Y:0)),[ye,pe]=JSswift.reactive.signal(le((Ee=o(e.buffer))!=null?Ee:d?d.get():(ze=(Ne=o(e.value))!=null?Ne:o(e.min))!=null?ze:0)),me=(ce,Oe={})=>{const Le=C(ce);return ge()!==Le&&Ae(Le),ye()<Le&&pe(Le),d&&Oe.fromModel!==!0&&d.set(Le),Le},ue=ce=>{const Oe=le(ce);return ye()!==Oe&&pe(Oe),Oe},H=JSswift.omit(e,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor"]),ae={width:o(e.width)||"100%",...e.style||{}},ie=o(e.color);(ie!=null||Dt(e.color))&&!Vt(ie||"")&&delete ae.backgroundColor,H.class=fe(["cms-progress-wrap",xe(e.dense,"dense"),xe(e.reverse,"is-reverse"),xe(e.indeterminate,"is-indeterminate"),S,e.class]),H.style=ae;const ve=_.div({class:"cms-progress-header"}),I=_.div({class:"cms-progress-heading"}),g=_.div({class:"cms-progress-label"}),p=_.div({class:"cms-progress-note"}),h=_.div({class:"cms-progress-value"});I.append(g,p),ve.append(I,h);const V=_.div({class:"cms-progress-body"}),re=_.span({class:"cms-progress-edge-label cms-progress-edge-label-left"}),c=_.div({class:"cms-progress",role:"progressbar"}),N=_.span({class:"cms-progress-buffer"}),b=_.span({class:fe(["cms-progress-bar","cms-singularity",S,xe(e.outline,"cms-outline"),xe(e.flat,"cms-flat"),xe(e.border,"cms-border"),xe(e.glossy,"cms-glossy"),xe(e.glow,"cms-glow"),xe(e.glass,"cms-glass"),xe(e.shadow,"cms-shadow"),Et(e.shadow,()=>{const ce=Ss(o(e.shadow));return ce?`cms-shadow-${ce}`:""}),xe(e.gradient,"cms-gradient"),xe(e.textGradient,"cms-text-gradient"),xe(e.lightShadow,"cms-light-shadow"),xe(e.striped,"is-striped"),xe(e.animated||e.indeterminate,"is-animated")])}),J=_.span({class:"cms-progress-bar-label"});b.appendChild(J),c.append(N,b);const Q=_.span({class:"cms-progress-edge-label cms-progress-edge-label-right"});V.append(re,c,Q);const ee=_.div(H,ve,V);G(b,e);const we=()=>{const ce=ge(),Oe=z(ce)*100,Le={value:ce,percent:Oe,min:l(),max:w(),buffer:ye(),progress:ee,track:c,bar:b,props:e},Je=r(s,"icon",Le,null),Fe=Je.length?[]:oe(e.icon,"icon",Le),Ge=r(s,"label",Le,Z(e.label)),He=Ge.length?Ge:r(s,"default",Le,n),R=r(s,"iconRight",Le,null),Te=R.length?[]:oe(e.iconRight,"iconRight",Le),O=r(s,"note",Le,Z(e.note)),k=e.valueLabel!=null?Z(e.valueLabel):te(ce,Oe,Le),x=o(e.showValue),f=x===!0||e.valueLabel!=null||JSswift.ui.getSlot(s,"value")!=null?r(s,"value",Le,k):[];U(g,[...Fe,...Je,...He,...Te,...R],"inline-flex"),U(p,O,"block"),U(h,x==="inside"?[]:f,"inline-flex"),ve.style.display=g.childNodes.length||p.childNodes.length||h.childNodes.length?"flex":"none"},F=()=>{var Ge,He;const ce=ge(),Oe=z(ce)*100,Le={value:ce,percent:Oe,min:l(),max:w(),buffer:ye(),progress:ee,track:c,bar:b,props:e},Je=Z((Ge=e.startLabel)!=null?Ge:e.leftLabel),Fe=Z((He=e.endLabel)!=null?He:e.rightLabel);U(re,r(s,"startLabel",Le,Je),"inline-flex"),U(Q,r(s,"endLabel",Le,Fe),"inline-flex")},m=()=>{const ce=ge(),Oe=z(ce)*100,Le={value:ce,percent:Oe,min:l(),max:w(),buffer:ye(),progress:ee,track:c,bar:b,props:e},Je=o(e.showValue),Fe=e.insideLabel!=null?Z(e.insideLabel):te(ce,Oe,Le),Ge=Je==="inside"||e.insideLabel!=null||JSswift.ui.getSlot(s,"inside")!=null?r(s,"inside",Le,Fe):[];U(J,Ge,"inline-flex")},L=()=>{const ce=ge(),Oe=ye(),Le=l(),Je=w(),Fe=z(ce)*100,Ge=z(Oe)*100,He=A(e.color,""),R=A(e.trackColor,He?`color-mix(in srgb, ${He} 14%, transparent)`:"rgba(255,255,255,0.08)"),Te=A(e.bufferColor,He?`color-mix(in srgb, ${He} 30%, transparent)`:"rgba(255,255,255,0.16)"),O=o(e.ariaLabel),k=o(e.ariaValueText),x=!!o(e.indeterminate),f=o(e.radius);ee.style.width=o(e.width)||"100%",ee.style.setProperty("--cms-progress-height",D()),f!=null?typeof f=="number"?ee.style.setProperty("--cms-progress-radius",`${f}px`):typeof f=="string"&&JSswift.uiSizes.includes(f)?ee.style.setProperty("--cms-progress-radius",`var(--cms-r-${f})`):ee.style.setProperty("--cms-progress-radius",String(f)):ee.style.removeProperty("--cms-progress-radius"),c.style.background=R,N.style.background=Te,N.style.width=`${Ge}%`,He&&!Vt(o(e.state)||o(e.color))?(b.style.setProperty("--set-background-color",He),b.style.setProperty("--set-border-color",He),b.style.setProperty("--set-color",o(e.textColor)||"var(--cms-on-primary, #fff)")):Vt(o(e.state)||o(e.color))?(b.style.removeProperty("--set-background-color"),b.style.removeProperty("--set-border-color"),b.style.removeProperty("--set-color")):(b.style.setProperty("--set-background-color","var(--cms-primary)"),b.style.setProperty("--set-border-color","var(--cms-primary)"),b.style.setProperty("--set-color",o(e.textColor)||"var(--cms-on-primary, #fff)")),x?(b.style.width="",c.removeAttribute("aria-valuenow"),c.removeAttribute("aria-valuemin"),c.removeAttribute("aria-valuemax")):(b.style.width=`${Fe}%`,c.setAttribute("aria-valuemin",String(Le)),c.setAttribute("aria-valuemax",String(Je)),c.setAttribute("aria-valuenow",String(ce))),O!=null?c.setAttribute("aria-label",String(O)):typeof o(e.label)=="string"?c.setAttribute("aria-label",String(o(e.label))):c.removeAttribute("aria-label"),k!=null?c.setAttribute("aria-valuetext",String(k)):x?c.removeAttribute("aria-valuetext"):c.setAttribute("aria-valuetext",te(ce,Fe,{value:ce,percent:Fe,min:Le,max:Je,buffer:Oe,progress:ee,track:c,bar:b,props:e})),ee.classList.toggle("has-start-label",re.childNodes.length>0),ee.classList.toggle("has-end-label",Q.childNodes.length>0),ee.classList.toggle("has-inside-label",J.childNodes.length>0)};return d?(me(d.get(),{fromModel:!0}),d.watch(ce=>{me(ce,{fromModel:!0})},"UI.Progress:watch")):Dt(e.value)?JSswift.reactive.effect(()=>{me(o(e.value),{fromModel:!0})},"UI.Progress:value"):me(($=(K=e.value)!=null?K:e.min)!=null?$:0,{fromModel:!0}),Dt(e.buffer)?JSswift.reactive.effect(()=>{ue(o(e.buffer))},"UI.Progress:buffer"):ue((Be=(je=(se=e.buffer)!=null?se:e.value)!=null?je:e.min)!=null?Be:0),JSswift.reactive.effect(()=>{we(),F(),m(),L()},"UI.Progress:render"),ee._track=c,ee._bar=b,ee._buffer=N,ee._getValue=ge,ee._getBuffer=ye,ee._setValue=ce=>me(ce),ee._setBuffer=ce=>ue(ce),ee},(lr=JSswift.isDev)!=null&&lr.call(JSswift)&&(v.meta=v.meta||{},v.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 of startLabel",rightLabel:"Alias of endLabel",width:"string|number",size:"string|number",height:"string|number",thickness:"Alias of 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:"Icon before the label",label:"Main progress content",note:"Secondary content below the label",value:"External value on the right",inside:"Content inside the bar",startLabel:"Label on the left of the bar",endLabel:"Label on the right of the bar",default:"Fallback label content"},returns:"HTMLDivElement",description:"Standardized progress bar with optional header, buffer, semantic state, and reactive support."}),v.LoadingBar=function(...e){var m,L;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),i=(P,Y)=>{const Ne=Number(P);return Number.isFinite(Ne)?Ne:Y},d=()=>i(o(n.min),0),S=()=>{const P=d(),Y=i(o(n.max),100);return Y<P?P:Y},u=P=>{const Y=d(),Ne=S(),ze=i(P,Y);return Math.min(Ne,Math.max(Y,ze))},l=(P,Y="")=>P==null||P===!1||P===""?Y:typeof P=="number"?`${P}px`:String(P),w=P=>{const Y=o(P);return!Y||Y===document?document.body:typeof Y=="string"?document.querySelector(Y)||document.body:Y&&Y.body instanceof HTMLElement?Y.body:Y instanceof HTMLElement?Y:document.body},D=n.model||(Gt(n.value)||rn(n.value)?n.value:null),A=bn(D,"UI.LoadingBar:model"),C=Gt(n.buffer)||rn(n.buffer)?n.buffer:null,z=bn(C,"UI.LoadingBar:buffer"),le=A?A.get():(m=o(n.value))!=null?m:d(),te=z?z.get():(L=o(n.buffer))!=null?L:le,[he,U]=JSswift.reactive.signal(u(le)),[W,oe]=JSswift.reactive.signal(Math.max(u(te),u(le))),[Z,ge]=JSswift.reactive.signal(n.visible!=null?!!o(n.visible):u(le)>d()||!!o(n.indeterminate));let Ae=null,ye=null;const pe=()=>{Ae&&(clearInterval(Ae),Ae=null)},me=()=>{ye&&(clearTimeout(ye),ye=null)},ue=(P,Y={})=>{const Ne=!!P;return Z()!==Ne&&ge(Ne),Y.fromExternal!==!0&&typeof n.onVisibleChange=="function"&&n.onVisibleChange(Ne),Ne},H=(P,Y={})=>{const Ne=u(P);return he()!==Ne&&U(Ne),W()<Ne&&(oe(Ne),z&&Y.fromExternal!==!0&&z.set(Ne)),A&&Y.fromExternal!==!0&&A.set(Ne),Ne},ae=(P,Y={})=>{const Ne=Math.max(H(he(),{fromExternal:!0}),u(P));return W()!==Ne&&oe(Ne),z&&Y.fromExternal!==!0&&z.set(Ne),Ne},ie=(P=he())=>{n.visible==null&&(o(n.indeterminate)||P>d()?ue(!0):o(n.hideOnZero)!==!1&&ue(!1))},ve=()=>{if(pe(),o(n.trickle)===!1||o(n.indeterminate))return;const P=i(o(n.trickleInterval),280);P<=0||(Ae=setInterval(()=>{var Ee,K;const Y=he(),Ne=u((K=(Ee=o(n.trickleTo))!=null?Ee:o(n.trickleMax))!=null?K:92);if(Y>=Ne)return;const ze=i(o(n.trickleStep),Y<45?12:Y<75?7:3);H(Math.min(Ne,Y+ze))},P))},I=JSswift.omit(n,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor","target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);I.class=fe(["cms-loading-bar",n.class]),I.style={...n.style||{}};const g=JSswift.omit(n,["target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);g.class=fe(["cms-loading-bar-progress",n.progressClass,g.class]),g.style={...n.progressStyle||{}},g.value=[he,U],g.buffer=[W,oe],g.dense==null&&(g.dense=!0),g.height==null&&g.thickness==null&&g.size==null&&(g.height=3),g.width==null&&(g.width="100%");const p=_.div(I),h=v.Progress(g,...s);p.appendChild(h);const V=P=>{me();const Y=H(P);return ie(Y),p},re=P=>{me();const Y=ae(P);return ie(Y),p},c=(P=(Y=>(Y=o(n.step))!=null?Y:8)())=>{me();const Ne=he(),ze=H(Ne+i(P,0));return ie(ze),p},N=(P=(Y=>(Y=o(n.startValue))!=null?Y:12)())=>{me();const Ne=Math.max(he(),u(P));return H(Ne),ae(Math.max(W(),Ne)),ie(Ne),ve(),p},b=(P=(Y=>(Y=o(n.resetValue))!=null?Y:d())())=>{me(),pe();const Ne=u(P);return ae(Ne),H(Ne),ie(Ne),p},J=(P=(Y=>(Y=o(n.doneValue))!=null?Y:S())())=>{var Ee;me(),pe();const Ne=u(P);ae(Ne),H(Ne),ie(Ne);const ze=Math.max(0,i((Ee=o(n.hideDelay))!=null?Ee:o(n.doneDelay),220));return ye=setTimeout(()=>{b()},ze),p},Q=(...P)=>J(...P),ee=()=>(ue(!0),p),we=()=>(me(),pe(),ue(!1),p),F=()=>(me(),pe(),p.remove(),null);return p.el=p,p._progress=h,p.get=()=>he(),p.getBuffer=()=>W(),p.set=V,p.setBuffer=re,p.inc=c,p.start=N,p.done=J,p.complete=J,p.stop=Q,p.reset=b,p.show=ee,p.hide=we,p.destroy=F,p._dispose=F,A?A.watch(P=>{H(P,{fromExternal:!0}),ie(u(P))},"UI.LoadingBar:watch"):Dt(n.value)&&JSswift.reactive.effect(()=>{const P=u(o(n.value));H(P,{fromExternal:!0}),ie(P)},"UI.LoadingBar:value"),z?z.watch(P=>{ae(P,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):Dt(n.buffer)&&JSswift.reactive.effect(()=>{ae(o(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const P=d(),Y=S(),Ne=Math.min(Y,Math.max(P,he())),ze=Math.max(Ne,Math.min(Y,Math.max(P,W())));Ne!==he()&&U(Ne),ze!==W()&&oe(ze)},"UI.LoadingBar:range"),JSswift.reactive.effect(()=>{n.visible!=null&&ue(o(n.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),JSswift.reactive.effect(()=>{var Be;const P=o(n.position)||"fixed",Y=o(n.inset),Ne=o(n.top),ze=o(n.right),Ee=o(n.bottom),K=o(n.left),$=o(n.width),se=n.visible!=null?!!o(n.visible):Z(),je=P==="static"||P==="relative";p.classList.toggle("is-visible",se),p.classList.toggle("is-inline",je),p.classList.toggle("has-track",!!o(n.trackColor)),p.style.position=P,p.style.zIndex=String((Be=o(n.zIndex))!=null?Be:10002),p.style.width=l($,je?"100%":""),Y!=null&&Y!==""?(p.style.inset=l(Y),p.style.removeProperty("top"),p.style.removeProperty("right"),p.style.removeProperty("bottom"),p.style.removeProperty("left")):(p.style.removeProperty("inset"),!je&&P!=="sticky"?(p.style.top=l(Ne,"0px"),p.style.right=l(ze,$==null||$===""?"0px":""),p.style.bottom=l(Ee,""),p.style.left=l(K,"0px")):(p.style.top=l(Ne,""),p.style.right=l(ze,""),p.style.bottom=l(Ee,""),p.style.left=l(K,"")))},"UI.LoadingBar:layout"),G(p,n),o(n.mount)!==!1&&w(n.target).appendChild(p),o(n.autoStart)&&N(),p},(cr=JSswift.isDev)!=null&&cr.call(JSswift)&&(v.meta=v.meta||{},v.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 of 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 of trickleMax",doneValue:"number",doneDelay:"Alias of 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:"Icon before the label",label:"Main content",note:"Secondary content",value:"External value on the right",inside:"Content inside the bar",startLabel:"Label on the left of the bar",endLabel:"Label on the right of the bar",default:"Fallback content"},returns:"HTMLDivElement with imperative API: .set(), .setBuffer(), .inc(), .start(), .done(), .stop(), .reset(), .show(), .hide(), .destroy()",description:"Loading bar based on UI.Progress, mountable on body or a custom container, controllable via model or imperative API."});const ai=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),oa=new Set(["soft","solid","outline"]),ia={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},ra={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},li=t=>{const e=String(o(t)||"").trim().toLowerCase();return e?ai.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"},aa=t=>{const e=String(o(t)||"").trim().toLowerCase();return oa.has(e)?e:"soft"},la=(t,e)=>{const n=o(t);if(n===!1||n===null)return 0;if(n===!0||n===""||n===void 0)return e==="danger"?3500:2500;const s=Number(n);return Number.isFinite(s)&&s>=0?s:e==="danger"?3500:2500},Un=(t={},e="")=>{var u,l,w,D,A,C,z,le,te,he,U,W,oe,Z;const n=Kn(t)?{...t}:{message:t},s=Vt(o(e)||o(n.type)||o(n.state)||o(n.color)||"info")||"info",i=la((l=(u=n.timeout)!=null?u:n.duration)!=null?l:n.delay,s),d=(A=(D=(w=n.closable)!=null?w:n.dismissible)!=null?D:n.dismiss!=null)!=null?A:i===0,S=n.title===void 0?n.label===void 0?ia[s]:n.label:n.title;return{...n,type:s,state:s,title:S,message:(le=(z=(C=n.message)!=null?C:n.content)!=null?z:n.text)!=null?le:null,description:(U=(he=(te=n.description)!=null?te:n.subtitle)!=null?he:n.note)!=null?U:null,meta:(oe=(W=n.meta)!=null?W:n.caption)!=null?oe:null,body:(Z=n.body)!=null?Z:null,timeout:i,closable:!!d,dismissLabel:n.dismissLabel||n.closeLabel||"Chiudi notifica",position:li(n.position),variant:aa(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},ci=(t,e="",n="")=>{if(!t.length)return Un(n?{type:e,title:n}:{type:e});if(Kn(t[0])){const{props:u,children:l}=JSswift.uiNormalizeArgs(t),w={...u};return!w.type&&!w.state&&!w.color&&e&&(w.type=e),w.title==null&&n&&(w.title=n),l.length&&(w.message==null&&w.description==null&&w.body==null&&l.length===1?w.message=l[0]:w.body==null&&(w.body=l.length===1?l[0]:l)),Un(w,e)}const[s,i,d]=t;let S={};return Kn(i)?S={...i,message:s}:Kn(d)?S={...d,message:s,title:i}:S={message:s,title:i},e&&!S.type&&!S.state&&!S.color&&(S.type=e),S.title==null&&n&&(S.title=n),Un(S,e)},Ln=(t,e)=>(...n)=>{var s,i;return(i=(s=mt.services.notify)==null?void 0:s.show)==null?void 0:i.call(s,ci(n,t,e))},Ao=(t,e,n)=>{if(t===!1)return!1;if(typeof t=="function"){const s=t();return Ao(s,e,n)}return Kn(t)?t:t!=null?{message:t,title:n}:{message:e,title:n}};v.Notify=(...t)=>{var e,n;return(n=(e=mt.services.notify)==null?void 0:e.show)==null?void 0:n.call(e,ci(t))},v.Notify.show=v.Notify,v.Notify.success=Ln("success","Success"),v.Notify.error=Ln("danger","Error"),v.Notify.warning=Ln("warning","Warning"),v.Notify.info=Ln("info","Info"),v.Notify.primary=Ln("primary","Notice"),v.Notify.secondary=Ln("secondary","Notice"),v.Notify.remove=t=>{var e,n;return(n=(e=mt.services.notify)==null?void 0:e.remove)==null?void 0:n.call(e,t)},v.Notify.clear=()=>{var t,e;return(e=(t=mt.services.notify)==null?void 0:t.clear)==null?void 0:e.call(t)},v.Notify.update=(t,e={})=>{var n,s;return(s=(n=mt.services.notify)==null?void 0:n.update)==null?void 0:s.call(n,t,e)},v.Notify.promise=async(t,e={})=>{var i,d,S,u,l,w,D,A,C,z,le,te,he,U;const n=e.loading===!1?!1:Ao(typeof e.loading=="function"?()=>e.loading():e.loading,"Operazione in corso...","In corso"),s=n===!1?null:(d=(i=mt.services.notify)==null?void 0:i.show)==null?void 0:d.call(i,Un({type:"info",timeout:0,closable:!1,...n},"info"));try{const oe=await(typeof t=="function"?t():t),Z=Ao(typeof e.success=="function"?()=>e.success(oe):e.success,"Operazione completata con successo.","Completato");return Z!==!1?s!=null?(u=(S=mt.services.notify)==null?void 0:S.update)==null||u.call(S,s,Un(Z,"success")):(w=(l=mt.services.notify)==null?void 0:l.show)==null||w.call(l,Un(Z,"success")):s!=null&&((A=(D=mt.services.notify)==null?void 0:D.remove)==null||A.call(D,s)),oe}catch(W){const oe=Ao(typeof e.error=="function"?()=>e.error(W):e.error,(W==null?void 0:W.message)||"Operazione fallita.","Errore");throw oe!==!1?s!=null?(z=(C=mt.services.notify)==null?void 0:C.update)==null||z.call(C,s,Un(oe,"danger")):(te=(le=mt.services.notify)==null?void 0:le.show)==null||te.call(le,Un(oe,"danger")):s!=null&&((U=(he=mt.services.notify)==null?void 0:he.remove)==null||U.call(he,s)),W}},(ur=JSswift.isDev)!=null&&ur.call(JSswift)&&(v.meta=v.meta||{},v.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 of type",color:"Alias of 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 of 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 of 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:"Standardized notify service with structured payloads, semantic shortcuts, update/remove/clear, and promise support."}),v.Header=(...t)=>{var N,b,J,Q,ee,we,F;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};xn(i);const d=m=>Object.prototype.hasOwnProperty.call(e,m),S=(N=e.drawerStateKey)!=null?N:Xn;S&&(Xn=S,_n=os(S));const u=()=>os(S),l=()=>Bn(!0,S),w=()=>Bn(!1,S),D=()=>Bn(!u(),S),A={props:e,stateKey:S,isDrawerOpen:u,openDrawer:l,closeDrawer:w,toggleDrawer:D,toggleAside:D},C=(m,L)=>{if(!(L==null||L===!1)){if(Array.isArray(L)){L.forEach(P=>C(m,P));return}if(L!=null&&L.nodeType){m.appendChild(L);return}m.appendChild(document.createTextNode(String(L)))}},z=(m,L,P=Y=>Y)=>{const Y=JSswift.ui.getSlot(s,m);if(Y!=null)return r(s,m,A,null);if(typeof L=="function"){const Ne=new Set(["eyebrow","title","subtitle"]),ze=_[Ne.has(m)?"span":"div"]({class:`cms-header-slot-${m}`});return JSswift.reactive.effect(()=>{const Ee=P(L(A)),K=Hn(JSswift.ui.slot(Ee));ze.replaceChildren(),Array.isArray(K)?K.forEach($=>C(ze,$)):C(ze,K)},`UI.Header:${m}`),[ze]}return r(s,m,A,P(L))},le=(m,L="icon",P=e.iconSize||e.size||"md")=>m==null||m===!1?null:typeof m=="string"?v.Icon({name:m,size:P}):JSswift.ui.slot(m,{as:L}),te=m=>{var P,Y;const L=m?(P=e.drawerOpenIcon)!=null?P:"\u2715":(Y=e.drawerCloseIcon)!=null?Y:"\u2630";return L==null||L===!1?null:typeof L=="string"?L:JSswift.ui.slot(L,{as:m?"drawerOpenIcon":"drawerCloseIcon"})},he=_.span({class:"cms-header-toggle-icon"}),U=m=>{const L=r(null,"default",A,te(m));he.replaceChildren(...L.length?L:[""])};U(u());const W=v.Btn({class:"cms-header-toggle",outline:!0,size:(J=(b=e.toggleSize)!=null?b:e.size)!=null?J:"sm",onClick:D,"aria-label":e.toggleLabel||"Toggle navigation"},he);e.left==null&&e.left!==!1&&!JSswift.ui.getSlot(s,"left")&&ni.add({update:U});const oe=e.left===!1?null:e.left!=null?e.left:W,Z=d("title")?e.title:(Q=e.label)!=null?Q:"App",ge=(we=(ee=e.subtitle)!=null?ee:e.description)!=null?we:"",Ae=d("right")?e.right:e.end,ye=d("content")?e.content:d("body")?e.body:n!=null&&n.length?n:null,pe=[...z("left",oe),...z("start",null)],me=z("icon",e.icon,le),ue=z("eyebrow",(F=e.eyebrow)!=null?F:e.kicker),H=z("title",Z),ae=z("subtitle",ge),ie=z("meta",e.meta),ve=(()=>{const m=z("content",null);return m.length?m:z("default",ye)})(),I=[...z("center",null),...z("body",null)],g=[...z("right",Ae),...z("end",null)],p=z("actions",e.actions),h=_.div({class:fe(["cms-header-body",e.bodyClass,e.centerClass])},_.div({class:"cms-header-heading"},me.length?_.div({class:"cms-header-icon"},...me):null,_.div({class:"cms-header-copy"},ue.length?_.div({class:fe(["cms-header-eyebrow",e.eyebrowClass])},...ue):null,H.length?_.div({class:fe(["cms-header-title",e.titleClass])},...H):null,ae.length?_.div({class:fe(["cms-header-subtitle",e.subtitleClass])},...ae):null,ve.length?_.div({class:fe(["cms-header-content",e.contentClass])},...ve):null),ie.length?_.div({class:fe(["cms-header-meta",e.metaClass])},...ie):null)),V=[...g,...p.length?[_.div({class:fe(["cms-header-actions",e.actionsClass])},...p)]:[]],re=JSswift.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"]);re.class=fe(["cms-panel","cms-header","cms-singularity",xe(e.sticky!==!1,"sticky"),xe(e.stack,"stack"),xe(e.elevated,"elevated"),xe(e.divider!==!1,"divider"),i.class]),re.style={...i.style||{}},e.gap!=null&&(re.style["--cms-header-gap"]=ht(o(e.gap))),e.minHeight!=null&&(re.style.minHeight=ht(o(e.minHeight)));const c=_.div(re,...pe.length?[_.div({class:fe(["cms-header-start",e.startClass])},...pe)]:[],_.div({class:"cms-header-main"},...I.length?[_.div({class:fe(["cms-header-body",e.bodyClass,e.centerClass])},...I)]:[h],...V.length?[_.div({class:fe(["cms-header-end",e.endClass])},...V)]:[]));return G(c,e),c},(dr=JSswift.isDev)!=null&&dr.call(JSswift)&&(v.meta=v.meta||{},v.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:"Left area, falls back to the drawer toggle",start:"Alias/addon for the left area",right:"Main right area",end:"Alias/addon for the right area",center:"Full override for the central body",body:"Alias of center",icon:"Leading icon",eyebrow:"Eyebrow / kicker",title:"Title",subtitle:"Subtitle",meta:"Meta info next to the central content",content:"Extra content below the subtitle",actions:"Actions grouped in the right area"},returns:"HTMLDivElement",description:"Structured header with start/body/end regions, integrated drawer toggle, metadata, and composable slots."}),v.Drawer=(...t)=>{var Le,Je,Fe,Ge,He,R,Te,O,k,x;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},d=f=>Object.prototype.hasOwnProperty.call(e,f),S=(Le=e.stateKey)!=null?Le:Xn;S&&(Xn=S,_n=os(S));const u=()=>os(S),l=()=>Bn(!0,S),w=()=>Bn(!1,S),D=()=>Bn(!u(),S),A={props:e,stateKey:S,isDrawerOpen:u,openDrawer:l,closeDrawer:w,toggleDrawer:D,toggleAside:D},C=JSswift==null?void 0:JSswift.store,z=!!(C!=null&&C.get&&(C!=null&&C.set)),le=`${S}:groups`,te=`${S}:active`;let he=z?C.get(le,{})||{}:{},U=z&&(Je=C.get(te,null))!=null?Je:null;const W=new Map,oe=new Map,Z=f=>{const E=o(f);return E==null||E===!1?[]:Array.isArray(E)?E.flat(1/0):[E]},ge=(f,E,Ce=A)=>{const Ue=Array.isArray(f)?f:[f];for(const Xe of Ue)if(JSswift.ui.getSlot(s,Xe)!=null)return r(s,Xe,Ce,E);return E==null?[]:r(null,"default",Ce,o(E))},Ae=f=>(Array.isArray(f)?f:[f]).some(Ce=>JSswift.ui.getSlot(s,Ce)!=null),ye=f=>{if(typeof o(f.external)=="boolean")return!!o(f.external);const E=o(f.href||f.to||f.link||"");return/^(https?:)?\/\//.test(E)},pe=(Fe=e.closeOnSelect)!=null?Fe:!0,me=f=>!!pe&&o(f.keepOpen)!==!0,ue=(He=(Ge=e.itemIconSize)!=null?Ge:e.size)!=null?He:"md",H=(R=e.groupOpenIcon)!=null?R:"arrow_drop_up",ae=(Te=e.groupCloseIcon)!=null?Te:"arrow_drop_down",ie=f=>!!f&&U===f,ve=f=>!!f&&!!U&&(U===f||U.startsWith(`${f}::`)),I=()=>{W.forEach(({el:f,baseActive:E},Ce)=>{const Ue=!!E||ie(Ce);f.classList.toggle("active",Ue),Ue?f.setAttribute("aria-current","page"):f.removeAttribute("aria-current")}),oe.forEach(({wrap:f,toggle:E,baseActive:Ce},Ue)=>{const Xe=!!Ce||ve(Ue);f.classList.toggle("active",Xe),E.classList.toggle("active",Xe)})},g=f=>{U=f||null,z&&C.set(te,U),I()},p=(f,E)=>{if(o(f.active)!=null)return!!o(f.active);if(o(f.current)!=null)return!!o(f.current);if(!E||ye(f))return!1;try{if(E.startsWith("#"))return window.location.hash===E;const Ce=`${window.location.pathname}${window.location.search}${window.location.hash}`;return E===Ce||E===window.location.pathname}catch(Ce){return!1}},h=(f,E,Ce)=>p(f,E)||ie(Ce),V=(f=[],E=0,Ce=[])=>Z(f).some((Ue,Xe)=>{var Lt,zt,Rt,et,yt;const q=o(Ue);if(!q||typeof q!="object"||q.nodeType)return!1;const We=o(q.href||q.to||q.link||""),st=(yt=o((et=(Rt=(zt=(Lt=q.label)!=null?Lt:q.title)!=null?zt:q.text)!=null?Rt:We)!=null?et:null))!=null?yt:`item-${E}-${Xe}`,Ze=b(q,st,E,Xe),ut=Ce.concat(Ze).join("::");if(h(q,We,ut))return!0;const St=q.items||q.children||q.sub;return V(St,E+1,Ce.concat(Ze))}),re=(f,E={})=>{var Xe;const Ce=o(f);if(Ce==null||Ce===!1)return[];const Ue=typeof Ce=="string"?v.Icon({name:Ce,size:(Xe=E.iconSize)!=null?Xe:ue}):JSswift.ui.slot(Ce,{...E,as:"icon"});return r(null,"default",E,Ue)},c=(f,E,Ce={})=>{const Ue=re(f,Ce);return Ue.length?[_.span({class:fe(["cms-drawer-item-icon",E])},...Ue)]:[]},N=f=>{const E=o(f.iconPosition)||"left",Ce=Object.prototype.hasOwnProperty.call(f,"iconLeft")?f.iconLeft:E!=="right"?f.icon:null,Ue=Object.prototype.hasOwnProperty.call(f,"iconRight")?f.iconRight:E==="right"?f.icon:null;return{left:Ce,right:Ue}},b=(f,E,Ce,Ue)=>o(f.key||f.id||f.to||f.href||E||`item-${Ce}-${Ue}`),J=(f,E)=>z&&Object.prototype.hasOwnProperty.call(he,f)?!!he[f]:E,Q=(f,E)=>{z&&(he={...he,[f]:!!E},C.set(le,he))},ee=()=>{const f={...A,area:"header"},E=ge(["headerIcon","icon"],e.icon,f),Ce=ge(["eyebrow"],e.eyebrow,f),Ue=ge(["title"],e.title,f),Xe=ge(["subtitle"],e.subtitle,f),q=ge(["meta"],e.meta,f),We=ge(["content"],e.content,f),st=ge(["actions"],e.actions,f),Ze=d("header")?r(null,"default",f,o(e.header)):[],ut=E.length||Ce.length||Ue.length||Xe.length||q.length||We.length||st.length;return!ut&&!Ze.length?[]:ut?[_.div({class:fe(["cms-drawer-header",e.headerClass])},...E.length?[_.div({class:"cms-drawer-header-icon"},...E)]:[],_.div({class:"cms-drawer-header-body"},...Ce.length?[_.div({class:"cms-drawer-header-eyebrow"},...Ce)]:[],...Ue.length?[_.div({class:"cms-drawer-header-title"},...Ue)]:[],...Xe.length?[_.div({class:"cms-drawer-header-subtitle"},...Xe)]:[],...q.length?[_.div({class:"cms-drawer-header-meta"},...q)]:[],...We.length?[_.div({class:"cms-drawer-header-content"},...We)]:[],...Ze.length?[_.div({class:"cms-drawer-header-extra"},...Ze)]:[]),...st.length?[_.div({class:"cms-drawer-header-actions"},...st)]:[])]:Ze},we=(f,E,Ce)=>{var q,We;return!(((q=f.onClick)==null?void 0:q.call(f,Ce,E))===!1||Ce!=null&&Ce.defaultPrevented||((We=e.onSelect)==null?void 0:We.call(e,f,E,Ce))===!1||Ce!=null&&Ce.defaultPrevented)},F=(f,E,Ce={})=>{const Ue=E.hasChildren?"group":"item",Xe=r(s,`${Ue}Label`,E,E.label),q=r(s,`${Ue}Note`,E,E.note),We=r(s,`${Ue}Badge`,E,E.badge),st=r(s,`${Ue}Aside`,E,E.aside),Ze=r(s,`${Ue}Content`,E,E.content),ut=[];return(Xe.length||q.length||We.length||st.length)&&ut.push(_.div({class:"cms-drawer-item-top"},_.div({class:"cms-drawer-item-copy"},...Xe.length?[_.div({class:"cms-drawer-item-label"},...Xe)]:[],...q.length?[_.div({class:"cms-drawer-item-note"},...q)]:[]),...We.length||st.length?[_.div({class:"cms-drawer-item-meta"},...We.length?[_.div({class:"cms-drawer-item-badge"},...We)]:[],...st.length?[_.div({class:"cms-drawer-item-aside"},...st)]:[])]:[])),Ze.length&&ut.push(_.div({class:"cms-drawer-item-content"},...Ze)),[...Ce.start||[],...c(E.iconLeft,"left",E),...ut.length?[_.div({class:"cms-drawer-item-main"},...ut)]:[],...c(E.iconRight,"right",E),...Ce.end||[]]},m=(f=[],E=0,Ce=[])=>Z(f).map((Ue,Xe)=>{var rs,qe,gt,Mt,Yt,tn,nn,fn,ln,y,de;const q=o(Ue);if(q==null||q===!1)return null;if(q.nodeType||typeof q!="object"||Array.isArray(q))return _.div({class:"cms-drawer-custom","data-level":String(E)},...r(null,"default",{...A,item:q,level:E,index:Xe,path:Ce},q));if(o(q.hidden)===!0||o(q.visible)===!1)return null;const We=Z(q.items||q.children||q.sub),st=o(q.href||q.to||q.link||null),Ze=o((Mt=(gt=(qe=(rs=q.label)!=null?rs:q.title)!=null?qe:q.text)!=null?gt:st)!=null?Mt:null),ut=Ze!=null?Ze:`item-${E}-${Xe}`,St=o((nn=(tn=(Yt=q.note)!=null?Yt:q.subtitle)!=null?tn:q.description)!=null?nn:null),Lt=o((fn=q.badge)!=null?fn:null),zt=o((y=(ln=q.aside)!=null?ln:q.meta)!=null?y:null),Rt=o((de=q.content)!=null?de:null),et=b(q,ut,E,Xe),yt=Ce.concat(et).join("::"),{left:Jt,right:jt}=N(q),Xt=Vt(o(q.state)||o(q.color)||""),Qt=p(q,st),an=Qt||ie(yt),$t=!!o(q.disabled),Zt={...A,item:q,index:Xe,level:E,path:Ce,label:ut,note:St,badge:Lt,aside:zt,content:Rt,itemStateKey:yt,iconLeft:Jt,iconRight:jt,iconSize:o(q.iconSize)||ue,active:an,disabled:$t,hasChildren:!1},un=o(q.divider)===!0||q.type==="divider"||q.type==="separator",hn=o(q.section)===!0||q.type==="section"||q.type==="heading"||q.type==="label",qt=q.type==="content"||q.type==="custom"||!st&&!We.length&&!o(q.button)&&q.type!=="button"&&Ze==null&&Rt!=null;if(un)return _.div({class:fe(["cms-drawer-separator",q.class]),"data-level":String(E)});if(hn){const Pe=r(s,"sectionLabel",Zt,ut||Rt);return _.div({class:fe(["cms-drawer-section-label",q.class]),"data-level":String(E)},...Pe)}if(qt){const Pe=r(s,"item",Zt,Rt!=null?Rt:ut);return _.div({class:fe(["cms-drawer-custom",Xt?`cms-drawer-tone-${Xt}`:"",q.class]),style:q.style,"data-level":String(E)},...Pe)}if(We.length){const Pe=Qt||V(We,E+1,Ce.concat(et)),nt=Pe||ve(yt);let ot=J(yt,!!o(q.expanded)||!!o(q.open)||nt);const it=_.span({class:"cms-drawer-group-icon"}),ft={...Zt,active:nt,hasChildren:!0,isOpen:()=>ot,setOpen:yn=>An(yn),toggle:()=>An(!ot)},Tt=()=>{var bs,ys;const yn=ot?(bs=q.openIcon)!=null?bs:H:(ys=q.closeIcon)!=null?ys:ae,as=o(ot?q.iconSidePosition||q.openIconSide||q.openIconPosition||"right":q.iconSidePosition||q.closeIconSide||q.closeIconPosition||"right")==="left"?"left":"right";it.innerHTML="",it.className=`cms-drawer-group-icon ${as}`,re(yn,{...ft,as:"toggleIcon"}).forEach(Is=>it.appendChild(Is))},Ut=_.button({type:"button",class:fe(["cms-drawer-group-toggle","cms-drawer-entry",ot?"open":"",nt?"active":"",$t?"is-disabled":"",Xt?`cms-drawer-tone-${Xt}`:"",q.class]),style:q.style,"data-level":String(E),"aria-expanded":String(ot),"aria-disabled":$t?"true":null,onClick:yn=>{if($t){yn.preventDefault();return}g(yt),An(!ot)}},...F(q,ft,{start:o(q.iconSidePosition||q.openIconSide||q.closeIconSide||q.openIconPosition||q.closeIconPosition||"right")==="left"?[it]:[],end:o(q.iconSidePosition||q.openIconSide||q.closeIconSide||q.openIconPosition||q.closeIconPosition||"right")==="right"?[it]:[]})),on=r(s,"group",ft,null),mn=_.div({class:"cms-drawer-group-items"},...m(We,E+1,Ce.concat(et))),On=_.div({class:fe(["cms-drawer-group",ot?"open":"",nt?"active":"",Xt?`cms-drawer-tone-${Xt}`:""]),"data-level":String(E)},...on.length?on:[Ut],mn),An=yn=>{ot=!!yn,On.classList.toggle("open",ot),Ut.classList.toggle("open",ot),Ut.setAttribute("aria-expanded",String(ot)),Tt(),Q(yt,ot)};return oe.set(yt,{wrap:On,toggle:Ut,baseActive:Pe}),Tt(),On}const Jn=r(s,"item",Zt,null),In=o(q.button)===!0||q.type==="button"||!st&&typeof q.onClick=="function",cn={class:fe(["cms-drawer-entry",In?"cms-drawer-btn":"cms-drawer-link",an?"active":"",$t?"is-disabled":"",Xt?`cms-drawer-tone-${Xt}`:"",q.class]),style:q.style,"data-level":String(E),"aria-current":an?"page":null,"aria-disabled":$t?"true":null},Wn=Jn.length?Jn:F(q,Zt);if(In){const Pe=_.button({...cn,type:q.buttonType||"button",disabled:$t,onClick:nt=>{if($t){nt.preventDefault();return}we(q,Zt,nt)&&(g(yt),me(q)&&w())}},...Wn);return W.set(yt,{el:Pe,baseActive:Qt}),Pe}const dn=ye(q),ps=dn?o(q.target)||"_blank":o(q.target),hs=dn?o(q.rel)||"noopener noreferrer":o(q.rel),is=_.a({...cn,href:st||"#",target:ps||null,rel:hs||null,tabIndex:$t?-1:null,onClick:Pe=>{var nt;if($t){Pe.preventDefault();return}we(q,Zt,Pe)&&(!dn&&q.to&&((nt=mt.router)!=null&&nt.navigate)&&(Pe.preventDefault(),mt.router.navigate(q.to)),me(q)&&w())}},...Wn);return W.set(yt,{el:is,baseActive:Qt}),is}).filter(Boolean),L=ge(["before","beforeItems"],(O=e.before)!=null?O:e.beforeItems),P=Ae(["body"])?ge(["body"],null):[],Y=m(e.items||[]),Ne=ge(["default"],n),ze=ge(["after","afterItems"],(k=e.after)!=null?k:e.afterItems),Ee=P.length?P:[...L,...Y,...Ne,...ze],K=d("empty")||d("emptyText")?(x=e.empty)!=null?x:_.div({class:fe(["cms-drawer-empty",e.emptyClass])},e.emptyText||"Nessun contenuto"):_.div({class:fe(["cms-drawer-empty",e.emptyClass])},"Nessun contenuto"),$=ge(["header"],ee()),se=ge(["footer"],e.footer),je=Ee.length?Ee:ge(["empty"],K),Be=JSswift.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"]);Be.class=fe(["cms-panel","cms-drawer",_n?"open":"",xe(e.sticky,"sticky"),i.class]),Be.style={...i.style||{}},e.gap!=null&&(Be.style["--cms-drawer-gap"]=ht(o(e.gap))),e.indent!=null&&(Be.style["--cms-drawer-indent"]=ht(o(e.indent))),e.padding!=null&&(Be.style["--cms-drawer-padding"]=ht(o(e.padding))),e.width!=null&&(Be.style.width=ht(o(e.width))),e.minHeight!=null&&(Be.style.minHeight=ht(o(e.minHeight))),e.maxHeight!=null&&(Be.style.maxHeight=ht(o(e.maxHeight)));const ce=_.div(Be,...$.length?$:[],_.div({class:fe(["cms-drawer-body",e.bodyClass])},...je),...se.length?[_.div({class:fe(["cms-drawer-footer",e.footerClass])},...se)]:[]),Oe=Jo.get(S)||new Set;return Oe.add(ce),Jo.set(S,Oe),Bn(_n,S),ce.isDrawerOpen=u,ce.openDrawer=l,ce.closeDrawer=w,ce.toggleDrawer=D,ce.setActiveItem=g,G(ce,e),I(),ce},(fr=JSswift.isDev)!=null&&fr.call(JSswift)&&(v.meta=v.meta||{},v.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:"Drawer header, full override",body:"Full body override",footer:"Drawer footer",before:"Content before the item list",after:"Content after the item list",empty:"Empty state when there is no content",item:"Full override for a simple item",itemLabel:"Item label (ctx: { item, label, note, badge, aside, content })",itemNote:"Item note/subtitle",itemBadge:"Item badge",itemAside:"Item aside/meta",itemContent:"Extra item content",group:"Full override for a group header (ctx includes toggle/isOpen)",groupLabel:"Group label",groupNote:"Group note",groupBadge:"Group badge",groupAside:"Group aside/meta",groupContent:"Extra group content",sectionLabel:"Label for section/heading items"},returns:"HTMLDivElement with openDrawer/closeDrawer/toggleDrawer/isDrawerOpen methods",description:"Structured, backward-compatible drawer with header/footer, groups, extended slots, empty state, and persistent state."}),v.Page=(...t)=>{var h,V,re,c;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},d=(N,b)=>{var J;return!!(N&&N.nodeType===1&&((J=N.classList)!=null&&J.contains(`cms-page-${b}`)))},S=N=>N==null?null:typeof N=="string"?v.Icon({name:N,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(N,{as:"icon"}),u={dense:!!o(e.dense),flat:!!o(e.flat),centered:!!o(e.centered),narrow:!!o(e.narrow)},l=(N,b)=>{if(!(b==null||b===!1)){if(Array.isArray(b)){b.forEach(J=>l(N,J));return}if(b!=null&&b.nodeType){N.appendChild(b);return}N.appendChild(document.createTextNode(String(b)))}},w=(N,b,J=Q=>Q)=>{const Q=JSswift.ui.getSlot(s,N);if(Q!=null)return r(s,N,u,null);if(typeof b=="function"){const ee=new Set(["eyebrow","title","subtitle"]),we=_[ee.has(N)?"span":"div"]({class:`cms-page-slot-${N}`});return JSswift.reactive.effect(()=>{const F=J(b(u)),m=Hn(JSswift.ui.slot(F));we.replaceChildren(),Array.isArray(m)?m.forEach(L=>l(we,L)):l(we,m)},`UI.Page:${N}`),[we]}return r(s,N,u,J(b))},D=r(s,"default",u,n!=null&&n.length?n:[]),A={hero:[],header:[],body:[],footer:[],actions:[]},C=[];D.forEach(N=>{d(N,"hero")?A.hero.push(N):d(N,"header")?A.header.push(N):d(N,"body")?A.body.push(N):d(N,"footer")?A.footer.push(N):d(N,"actions")?A.actions.push(N):C.push(N)});const z=w("icon",e.icon,S),le=w("hero",(h=e.hero)!=null?h:e.banner),te=w("eyebrow",(V=e.eyebrow)!=null?V:e.kicker),he=w("title",e.title),U=w("subtitle",(re=e.subtitle)!=null?re:e.description),W=w("header",e.header),oe=w("aside",e.aside),Z=w("body",(c=e.body)!=null?c:e.content),ge=w("footer",e.footer),Ae=w("actions",e.actions),ye=le.length?_.div({class:fe(["cms-page-hero",e.heroClass])},...le):null,pe=z.length||te.length||he.length||U.length||W.length||oe.length,me=pe?_.div({class:fe(["cms-page-header",e.headerClass])},_.div({class:"cms-page-head"},z.length?_.div({class:fe(["cms-page-icon",e.iconClass])},...z):null,_.div({class:"cms-page-head-main"},te.length?_.div({class:fe(["cms-page-eyebrow",e.eyebrowClass])},...te):null,he.length?_.div({class:fe(["cms-page-title",e.titleClass])},...he):null,U.length?_.div({class:fe(["cms-page-subtitle",e.subtitleClass])},...U):null,W.length?_.div({class:fe(["cms-page-header-content",e.headerContentClass])},...W):null),oe.length?_.div({class:fe(["cms-page-aside",e.asideClass])},...oe):null)):null,ue=[...Z,...C],H=ue.length?_.div({class:fe(["cms-page-body",e.bodyClass])},...ue):null,ae=[...Ae,...A.actions],ie=ge.length||ae.length?_.div({class:fe(["cms-page-footer",e.footerClass])},...ge,ae.length?_.div({class:"cms-page-actions"},...ae):null):null,ve=!!(le.length||A.hero.length),I=!!(pe||A.header.length),g=JSswift.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"]);g.class=fe(["cms-panel","cms-page",xe(e.dense,"dense"),xe(e.flat,"cms-page-flat"),xe(e.centered,"cms-page-centered"),xe(e.narrow,"cms-page-narrow"),xe(ve,"cms-page-has-hero"),xe(I,"cms-page-has-header"),i.class]),g.style={...i.style||{}},(e.gap!=null||Dt(e.gap))&&(g.style["--cms-page-gap"]=Ke(e.gap,ht)),(e.padding!=null||Dt(e.padding))&&(g.style["--cms-page-padding"]=Ke(e.padding,ht)),(e.maxWidth!=null||Dt(e.maxWidth))&&(g.style["--cms-page-max-width"]=Ke(e.maxWidth,ht)),(e.minHeight!=null||Dt(e.minHeight))&&(g.style["--cms-page-min-height"]=Ke(e.minHeight,ht)),(e.headerGap!=null||Dt(e.headerGap))&&(g.style["--cms-page-header-gap"]=Ke(e.headerGap,ht)),(e.heroPadding!=null||Dt(e.heroPadding))&&(g.style["--cms-page-hero-padding"]=Ke(e.heroPadding,ht));const p=_.div(g,ye,...A.hero,me,...A.header,H,...A.body,ie,...A.footer);return G(p,e),p},(mr=JSswift.isDev)!=null&&mr.call(JSswift)&&(v.meta=v.meta||{},v.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:"Structured page container with hero, header, body, footer, and configurable layout."}),v.AppShell=(...t)=>{var N,b;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(J,Q)=>!!J&&Object.prototype.hasOwnProperty.call(J,Q),d=o(e.noDrawer)===!0||e.drawer===!1,S=o(e.reverse)===!0,u=o(e.stack)===!0,l=(b=(N=e.drawerStateKey)!=null?N:e.stateKey)!=null?b:Xn;l&&(Xn=l,_n=os(l));const w={props:e,noDrawer:d,stateKey:l,isDrawerOpen:()=>os(l),openDrawer:()=>Bn(!0,l),closeDrawer:()=>Bn(!1,l),toggleDrawer:()=>Bn(!os(l),l)},D=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let A=e.header;!i(e,"header")&&(Object.keys(D).length||i(e,"title")||i(e,"subtitle")||i(e,"left")||i(e,"right"))&&(!i(D,"title")&&i(e,"title")&&(D.title=e.title),!i(D,"subtitle")&&i(e,"subtitle")&&(D.subtitle=e.subtitle),!i(D,"left")&&i(e,"left")&&(D.left=e.left),!i(D,"right")&&i(e,"right")&&(D.right=e.right),i(D,"drawerStateKey")||(D.drawerStateKey=l),d&&!i(D,"left")&&(D.left=!1),A=v.Header(D));const C=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},z=i(e,"drawerItems")?e.drawerItems:e.items,le=i(e,"drawerHeader")?e.drawerHeader:void 0;let te=e.drawer;!i(e,"drawer")&&!d&&(Object.keys(C).length||z!=null||le!=null)&&(!i(C,"items")&&z!=null&&(C.items=z),!i(C,"header")&&le!=null&&(C.header=le),i(C,"stateKey")||(C.stateKey=l),te=v.Drawer(C));const he=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},U=i(e,"content")?e.content:n,W=r(s,"default",w,U);let oe=e.page;!i(e,"page")&&(Object.keys(he).length||W.length)&&(oe=v.Page(he,...W));const Z=e.footerProps&&typeof e.footerProps=="object"?{...e.footerProps}:{},ge=i(e,"footerContent")?e.footerContent:void 0;let Ae=e.footer;!i(e,"footer")&&(Object.keys(Z).length||ge!=null)&&(Ae=v.Footer(Z,...r(null,"default",w,ge)));const ye=r(s,"header",w,A),pe=d?[]:r(s,"drawer",w,te),me=r(s,"page",w,oe),ue=r(s,"footer",w,Ae),H=fe(["cms-app","cms-app-shell",xe(d,"no-drawer"),xe(S,"is-reverse"),xe(u,"is-stack"),xe(e.flush,"is-flush"),xe(e.divider,"is-divider"),e.class]),ae=JSswift.omit(e,["header","drawer","page","footer","content","title","subtitle","left","right","items","drawerItems","drawerHeader","headerProps","drawerProps","pageProps","footerProps","footerContent","noDrawer","reverse","stack","flush","divider","drawerStateKey","stateKey","drawerWidth","gap","padding","slots"]);ae.class=H,ae.style={...e.style||{}};const ie=Ke(e.drawerWidth,ht);ie!=null&&(ae.style["--cms-app-shell-drawer-width"]=ie);const ve=Ke(e.gap,ht);ve!=null&&(ae.style["--cms-app-shell-gap"]=ve);const I=Ke(e.padding,ht);I!=null&&(ae.style["--cms-app-shell-padding"]=I);const g=ye.length?_.div({class:"cms-app-shell-header-slot"},...ye):null,p=pe.length?_.div({class:"cms-app-shell-drawer-slot"},...pe):null,h=me.length?_.div({class:"cms-app-shell-page-slot"},...me):null,V=ue.length?_.div({class:"cms-app-shell-footer-slot"},...ue):null,re=S?[h,p]:[p,h],c=_.div(ae,...g?[g]:[],_.div({class:"cms-app-shell-body"},...re.filter(Boolean)),...V?[V]:[]);return c.openDrawer=w.openDrawer,c.closeDrawer=w.closeDrawer,c.toggleDrawer=w.toggleDrawer,c.isDrawerOpen=w.isDrawerOpen,c.header=g,c.drawer=p,c.page=h,c.footer=V,G(c,e),c},(gr=JSswift.isDev)!=null&&gr.call(JSswift)&&(v.meta=v.meta||{},v.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."}),v.Parallax=function(...e){var J,Q;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),i=n.slots||{},d={...n};d.color!=null&&d.textColor==null&&(d.textColor=d.color),delete d.color,xn(d);const S=Et(n.state,()=>{const ee=Vt(o(n.state));return ee?`cms-state-${ee}`:""}),u=ee=>{if(ee==null||ee===!1||ee==="")return"";const we=String(ee);return Tn(we)?`var(--cms-${we})`:we},l=()=>{const ee=o(n.background);if(ee)return String(ee);const we=o(n.image)||o(n.src)||"";if(!we)return"linear-gradient(120deg, #1b2c5a, #2f6d8f, #2a8f5c)";const F=String(we);return/^url\(/i.test(F)||/gradient\(/i.test(F)||/^var\(/i.test(F)?F:`url(${F})`},w=(ee,we)=>{const F=Number(o(ee));return Number.isFinite(F)?F:we},D={speed:()=>{var ee;return(ee=o(n.speed))!=null?ee:.18},state:()=>o(n.state)||"",disabled:()=>!!o(n.disabled)},A=r(i,"badge",D,n.badge),C=r(i,"background",D,n.backgroundContent),z=r(i,"eyebrow",D,(J=n.eyebrow)!=null?J:n.kicker),le=r(i,"title",D,n.title),te=r(i,"subtitle",D,n.subtitle),he=r(i,"header",D,n.header),U=r(i,"aside",D,n.aside),W=r(i,"media",D,n.media),oe=r(i,"content",D,(Q=n.content)!=null?Q:n.body),Z=r(i,"default",D,s!=null&&s.length?s:[]),ge=r(i,"footer",D,n.footer),Ae=r(i,"actions",D,n.actions),ye=[...oe,...Z],pe=A.length?_.div({class:fe(["cms-parallax-badge",n.badgeClass])},...A):null,me=z.length||le.length||te.length||he.length||U.length,ue=me?_.div({class:fe(["cms-parallax-header",n.headerClass])},_.div({class:"cms-parallax-head"},_.div({class:"cms-parallax-head-main"},z.length?_.div({class:fe(["cms-parallax-eyebrow",n.eyebrowClass])},...z):null,le.length?_.div({class:fe(["cms-parallax-title",n.titleClass])},...le):null,te.length?_.div({class:fe(["cms-parallax-subtitle",n.subtitleClass])},...te):null,he.length?_.div({class:fe(["cms-parallax-header-content",n.headerContentClass])},...he):null),U.length?_.div({class:fe(["cms-parallax-aside",n.asideClass])},...U):null)):null,H=W.length?_.div({class:fe(["cms-parallax-media",n.mediaClass])},...W):null,ae=ye.length?_.div({class:fe(["cms-parallax-body",n.bodyClass])},...ye):null,ie=ge.length||Ae.length?_.div({class:fe(["cms-parallax-footer",n.footerClass])},ge.length?_.div({class:"cms-parallax-footer-content"},...ge):null,Ae.length?_.div({class:"cms-parallax-actions"},...Ae):null):null,ve=JSswift.omit(d,["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"]);ve.class=fe(["cms-parallax","cms-singularity",S,xe(n.disabled,"cms-parallax-static"),xe(pe,"cms-parallax-has-badge"),xe(me,"cms-parallax-has-header"),d.class]),ve.style={...d.style||{}},n.height!=null&&(ve.style["--cms-parallax-height"]=Ke(n.height,ht)),n.minHeight!=null&&(ve.style["--cms-parallax-min-height"]=Ke(n.minHeight,ht)),n.padding!=null&&(ve.style["--cms-parallax-padding"]=Ke(n.padding,ht)),n.gap!=null&&(ve.style["--cms-parallax-gap"]=Ke(n.gap,ht)),n.contentMaxWidth!=null&&(ve.style["--cms-parallax-content-max-width"]=Ke(n.contentMaxWidth,ht)),n.justify!=null&&(ve.style["--cms-parallax-justify"]=Ke(n.justify)),n.align!=null&&(ve.style["--cms-parallax-align"]=Ke(n.align)),n.color!=null&&(ve.style["--cms-parallax-color"]=Ke(n.color,u)),n.overlay!=null&&(ve.style["--cms-parallax-overlay"]=Ke(n.overlay)),n.bgPosition!=null&&(ve.style["--cms-parallax-position"]=Ke(n.bgPosition)),n.bgSize!=null&&(ve.style["--cms-parallax-size"]=Ke(n.bgSize)),n.bgRepeat!=null&&(ve.style["--cms-parallax-repeat"]=Ke(n.bgRepeat)),ve.style["--cms-parallax-image"]=Dt(n.background)||Dt(n.image)||Dt(n.src)?()=>l():l();const I=_.div({class:fe(["cms-parallax-bg",n.bgClass])},C.length?_.div({class:fe(["cms-parallax-bg-content",n.backgroundContentClass])},...C):null),g=_.div({class:fe(["cms-parallax-content",n.contentClass,n.innerClass])},pe,ue,H,ae,ie),p=_.div(ve,I,g);let h=!1,V=!1,re=null;const c=()=>{var ee;h||(h=!0,typeof window!="undefined"&&(window.removeEventListener("scroll",b),window.removeEventListener("resize",b)),(ee=re==null?void 0:re.disconnect)==null||ee.call(re),re=null)},N=()=>{if(h)return;if(!p.isConnected){c();return}if(o(n.disabled)){I.style.transform="translate3d(0, 0, 0)",p.style.setProperty("--cms-parallax-offset","0px");return}const ee=p.getBoundingClientRect(),we=w(n.speed,.18),F=Math.abs(w(n.maxOffset,96)),m=o(n.startTop),L=m!=null&&m!==""?(ee.top-w(n.startTop,0))*we:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(ee.top+ee.height/2))*we,Y=`${(F>0?Math.max(-F,Math.min(F,L)):L).toFixed(2)}px`;I.style.transform=`translate3d(0, ${Y}, 0)`,p.style.setProperty("--cms-parallax-offset",Y)};function b(){h||V||(V=!0,requestAnimationFrame(()=>{V=!1,N()}))}return typeof window!="undefined"&&(window.addEventListener("scroll",b,{passive:!0}),window.addEventListener("resize",b),typeof ResizeObserver!="undefined"&&(re=new ResizeObserver(()=>{b()}),re.observe(p)),requestAnimationFrame(()=>{b()}),setTimeout(()=>{b()},90)),p.refresh=()=>(b(),p),p.update=p.refresh,p.destroy=()=>(c(),p.remove(),null),p._dispose=c,G(p,n),p},(pr=JSswift.isDev)!=null&&pr.call(JSswift)&&(v.meta=v.meta||{},v.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:"Decorative content inside the background layer",badge:"Meta badge/chip above the main content",eyebrow:"Eyebrow/kicker",title:"Main title",subtitle:"Subtitle or supporting text",header:"Additional header content",aside:"Header side area",media:"Media content or foreground card",content:"Main body",footer:"Informational footer",actions:"Actions area",default:"Fallback body content"},returns:"HTMLDivElement with refresh/update/destroy methods",description:"Standardized parallax hero/section with structured header, body, actions, slots, and minimal refresh API."});const[No,ko]=mt.reactive.signal([]),_o=new Map;function jo(t){const e=_o.get(t);e&&(clearTimeout(e),_o.delete(t))}function Ho(t){return t?(jo(t),ko(No().filter(e=>e.id!==t)),t):null}function ca(){for(const t of _o.keys())jo(t);ko([])}function ui(t){t!=null&&t.id&&(jo(t.id),t.timeout>0&&_o.set(t.id,setTimeout(()=>{Ho(t.id)},t.timeout)))}function di(t,e={}){if(!t)return null;let n=null;return ko(No().map(s=>s.id!==t?s:(n=Un({...s,...e,id:s.id},e.type||e.state||e.color||s.type),n))),n&&ui(n),(n==null?void 0:n.id)||null}function ua(t){const e=()=>Ho(t.id),n=(he={})=>di(t.id,he),s={toast:t,id:t.id,close:e,update:n},i=he=>typeof he=="function"?he(s):he,d=(()=>{if(t.icon===!1||t.icon===null)return null;if(t.icon!=null){const U=i(t.icon);return typeof U=="string"?v.Icon({name:U,size:"sm"}):JSswift.ui.slot(U,{as:"icon"})}const he=ra[t.type];return he?v.Icon({name:he,size:"sm"}):null})(),S=r(t.slots,"icon",s,d),u=r(t.slots,"title",s,i(t.title)),l=r(t.slots,"message",s,i(t.message)),w=r(t.slots,"description",s,i(t.description)),D=r(t.slots,"meta",s,i(t.meta)),A=r(t.slots,"actions",s,i(t.actions)),C=r(t.slots,"default",s,i(t.body)),z=r(t.slots,"dismiss",s,i(t.dismiss)),le=z.length?z:t.closable?[v.Btn({class:"cms-toast-close",outline:!0,size:"xs","aria-label":t.dismissLabel,onClick:e},v.Icon({name:"close",size:"xs"}))]:[],te=_.div({class:fe(["cms-toast",`cms-toast-${t.type}`,`cms-toast-${t.variant}`,xe(t.closable,"is-closable"),t.class]),style:t.style||{},role:t.role},S.length?_.div({class:"cms-toast-icon"},...S):null,_.div({class:"cms-toast-main"},_.div({class:"cms-toast-copy"},u.length?_.div({class:"cms-toast-title"},...u):null,l.length?_.div({class:"cms-toast-message"},...l):null,w.length?_.div({class:"cms-toast-description"},...w):null,C.length?_.div({class:"cms-toast-body"},...C):null,D.length?_.div({class:"cms-toast-meta"},...D):null),A.length?_.div({class:"cms-toast-actions"},...A):null),le.length?_.div({class:"cms-toast-dismiss"},...le):null);return G(te,t),te}function da(){let t=document.querySelector(".cms-toast-layer");return t||(t=document.createElement("div"),t.className="cms-toast-layer",document.body.appendChild(t),mt.reactive.effect(()=>{const e=No();t.innerHTML="";const n=new Map;for(const s of e){const i=li(s.position);n.has(i)||n.set(i,[]),n.get(i).push(s)}for(const s of ai){const i=n.get(s);if(!(i!=null&&i.length))continue;const d=_.div({class:fe(["cms-toast-wrap",`is-${s}`])},...i.map(S=>ua(S)));t.appendChild(d)}},"JSswiftUI:toasts"),t)}function fa(t={}){da();const e=Un(t);return e.id=e.id||Math.random().toString(36).slice(2),ko([...No().filter(n=>n.id!==e.id),e]),ui(e),e.id}mt.services.notify.show=fa,mt.services.notify.success=Ln("success","Success"),mt.services.notify.error=Ln("danger","Error"),mt.services.notify.warning=Ln("warning","Warning"),mt.services.notify.info=Ln("info","Info"),mt.services.notify.primary=Ln("primary","Notice"),mt.services.notify.secondary=Ln("secondary","Notice"),mt.services.notify.update=di,mt.services.notify.remove=Ho,mt.services.notify.clear=ca,mt.services.notify.promise=v.Notify.promise,mt.notify=mt.services.notify,JSswift.form=JSswift.form||{},JSswift.form._isPromise=t=>t&&typeof t.then=="function",JSswift.form._normalizeRules=t=>{const e={};for(const n in t||{}){const s=t[n];e[n]=Array.isArray(s)?s:[s]}return e},JSswift.form._runRule=async(t,e,n)=>{let s=t,i=null;t&&typeof t=="object"&&typeof t.rule=="function"&&(s=t.rule,i=t.message||null);const d=s?s(e,n):!0,S=JSswift.form._isPromise(d)?await d:d;return S===!0?null:typeof S=="string"?S:S===!1?i||"Valore non valido":S?null:i||"Valore non valido"},JSswift.useForm=(t={})=>{const e=t.model||{},n=JSswift.form._normalizeRules(t.rules||{}),s=t.validateOn||"submit",i=t.initial||null,d=_.rod({}),S=_.rod({}),u=_.rod(!1),l=_.rod(null),w=()=>e&&typeof e=="object"&&"value"in e?e.value||{}:e,D=ye=>{if(e&&typeof e=="object"&&"value"in e)e.value=ye;else{const pe=e||{};for(const me in pe)delete pe[me];Object.assign(pe,ye)}},A=ye=>{const pe=w();return pe?pe[ye]:void 0},C=(ye,pe)=>{const me={...w()||{}};me[ye]=pe,D(me)},z=(ye,pe)=>{const me={...d.value||{}};pe?me[ye]=pe:delete me[ye],d.value=me},le=ye=>(d.value||{})[ye]||null,te=ye=>{S.value={...S.value||{},[ye]:!0}},he=ye=>!!(S.value||{})[ye],U=async ye=>{const pe=n[ye]||[];if(!pe.length)return z(ye,null),!0;const me=A(ye),ue={name:ye,value:me,model:w(),form:Ae};for(const H of pe){if(!H)continue;const ae=await JSswift.form._runRule(H,me,ue);if(ae)return z(ye,ae),!1}return z(ye,null),!0},W=async()=>{l.value=null;const ye=Object.keys(n);let pe=!0;for(const me of ye)await U(me)||(pe=!1);return pe},Ae={model:e,errors:d,touched:S,submitting:u,submitError:l,getValue:A,setValue:C,getError:le,setError:z,touch:te,isTouched:he,field:(ye,pe={})=>{var V;const me=_.rod("");(V=me.action)==null||V.call(me,re=>{C(ye,re)});const ue=()=>s==="submit"||s==="input"||s==="blur"?!0:he(ye);let H=null,ae=!1,ie=!1;const ve=async()=>{ae||(ae=!0,te(ye),(s==="blur"||s==="input")&&await U(ye),setTimeout(()=>{ae=!1},0))},I=re=>{H&&(H===re.target||H.contains&&H.contains(re.target)||(ve(),H=null,ie&&(ie=!1,document.removeEventListener("pointerdown",I,!0))))},g=()=>{ie||(ie=!0,document.addEventListener("pointerdown",I,!0))},p=async()=>{H=document.activeElement,ae=!1,g(),s==="input"&&await U(ye)},h=async()=>{await ve(),H=null,ie&&(ie=!1,document.removeEventListener("pointerdown",I,!0))};return{name:ye,model:me,get value(){return me.value},set value(re){me.value=re},error:()=>ue()?le(ye):null,success:pe.success||null,warning:pe.warning||null,note:pe.note||null,touch:()=>te(ye),validate:()=>U(ye),onInput:p,onBlur:h,hint:pe.hint||null}},validateField:U,validate:W,reset:()=>{l.value=null,d.value={},S.value={},i&&D({...i||{}})},submit:async ye=>{u.value=!0,l.value=null;try{return await W()?{ok:!0,result:await(ye==null?void 0:ye(w(),Ae))}:{ok:!1,reason:"validation"}}catch(pe){return console.error("[useForm] submit error:",pe),l.value=pe&&pe.message?pe.message:String(pe),{ok:!1,reason:"exception",error:pe}}finally{u.value=!1}}};return Ae},v.Form=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.form,i=e.onSubmit,d=fe(["cms-form",e.class]),S=JSswift.omit(e,["form","onSubmit"]);S.class=d;const u=_.form({...S,onSubmit:async w=>{w.preventDefault(),s&&await s.submit(i||(async()=>{}))}}),l=[];for(const w of n||[]){const D=typeof w=="function"?w(s):w,A=JSswift.ui.slot(D);A&&(Array.isArray(A)?l.push(...A):l.push(A))}return l.forEach(w=>u.appendChild(w)),s&&s.submitting&&JSswift.reactive.effect(()=>{u.classList.toggle("is-submitting",!!s.submitting.value)},"UI.Form:submitting"),u},(hr=JSswift.isDev)!=null&&hr.call(JSswift)&&(v.meta=v.meta||{},v.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"}),mt.services=mt.services||{},mt.services.dialog=mt.services.dialog||{},mt.dialog=mt.services.dialog;let Ls=null;function fi(){return Ls||(Ls=document.createElement("div"),Ls.setAttribute("data-cms-modal-root","true"),document.body.appendChild(Ls),Ls)}v.cardHeader=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=fe(["cms-card-header",xe(e.divider,"divider"),e.class]),d=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);d.class=i;const S={...e.style||{}},u=Ke(e.align);u!=null&&!tt(e,"align")&&(S.alignItems=u);const l=Ke(e.justify);l!=null&&!tt(e,"justify")&&(S.justifyContent=l);const w=Ke(e.wrap,z=>z?"wrap":"nowrap");w!=null&&!tt(e,"wrap")&&(S.flexWrap=w);const D=Ke(e.direction);D!=null&&!tt(e,"direction")&&(S.flexDirection=D);const A=Ke(e.gap,ht);A!=null&&!tt(e,"gap")&&(S.gap=A),Object.keys(S).length&&(d.style=S),JSswift.uiApplyResponsiveProps(d,e,JSswift.uiResponsiveStyleRules);const C=_.div(d,...r(s,"default",{},n));return G(C,e),C},v.cardBody=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=fe(["cms-card-body",e.class]),d=JSswift.omit(e,["slots","display","direction","wrap","align","justify","gap","rowGap","columnGap","padding","width"]);d.class=i,JSswift.uiApplyResponsiveProps(d,e,JSswift.uiResponsiveStyleRules);const S=_.div(d,...r(s,"default",{},n));return G(S,e),S},v.cardFooter=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=fe(["cms-card-footer",xe(e.divider,"divider"),e.class]),d=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);d.class=i;const S={...e.style||{}},u=Ke(e.align);u!=null&&!tt(e,"align")&&(S.alignItems=u);const l=Ke(e.justify);l!=null&&!tt(e,"justify")&&(S.justifyContent=l);const w=Ke(e.wrap,z=>z?"wrap":"nowrap");w!=null&&!tt(e,"wrap")&&(S.flexWrap=w);const D=Ke(e.direction);D!=null&&!tt(e,"direction")&&(S.flexDirection=D);const A=Ke(e.gap,ht);A!=null&&!tt(e,"gap")&&(S.gap=A),Object.keys(S).length&&(d.style=S),JSswift.uiApplyResponsiveProps(d,e,JSswift.uiResponsiveStyleRules);const C=_.div(d,...r(s,"default",{},n));return G(C,e),C},(br=JSswift.isDev)!=null&&br.call(JSswift)&&(v.meta=v.meta||{},v.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",direction:"row|column|string",gap:"string|number",mobile:"{ gap?, align?, justify?, wrap?, direction? }",tablet:"{ gap?, align?, justify?, wrap?, direction? }",pc:"{ gap?, align?, justify?, wrap?, direction? }",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Card header content"},returns:"HTMLDivElement",description:"Header della card con supporto layout flex."},v.meta.cardBody={signature:"UI.cardBody(...children) | UI.cardBody(props, ...children)",props:{padding:"string|number",gap:"string|number",direction:"row|column|string",mobile:"{ padding?, gap?, direction?, width? }",tablet:"{ padding?, gap?, direction?, width? }",pc:"{ padding?, gap?, direction?, width? }",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Card body content"},returns:"HTMLDivElement",description:"Body della card."},v.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",direction:"row|column|string",gap:"string|number",mobile:"{ gap?, align?, justify?, wrap?, direction? }",tablet:"{ gap?, align?, justify?, wrap?, direction? }",pc:"{ gap?, align?, justify?, wrap?, direction? }",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Card footer content"},returns:"HTMLDivElement",description:"Footer della card con supporto layout flex."}),v.Dialog=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],d=["xs","sm","md","lg","xl","full"];let S={...e},u=null,l=null;const w=(g,p)=>typeof g=="function"?g(p):g,D=g=>String(g||"").split(/\s+/).filter(Boolean),A=(g,p,h)=>{if(!g)return;const V=g[p]||[];V.length&&g.classList.remove(...V);const re=(h||[]).filter(Boolean);re.length&&g.classList.add(...re),g[p]=re},C=(g,p,h,V=re=>re)=>{if(g){if(h==null||h===""){g.style.removeProperty(p);return}g.style.setProperty(p,V(h))}},z=()=>{var c,N,b,J,Q,ee;const g=window.visualViewport,p=Math.max(0,Math.round((c=g==null?void 0:g.offsetLeft)!=null?c:0)),h=Math.max(0,Math.round((N=g==null?void 0:g.offsetTop)!=null?N:0)),V=Math.max(0,Math.round((J=(b=g==null?void 0:g.width)!=null?b:window.innerWidth)!=null?J:0)),re=Math.max(0,Math.round((ee=(Q=g==null?void 0:g.height)!=null?Q:window.innerHeight)!=null?ee:0));return{left:p,top:h,width:V,height:re}},le=g=>{if(!(g!=null&&g.panel))return;const{left:p,top:h,width:V,height:re}=z();C(g.panel,"position","fixed"),C(g.panel,"inset",0,c=>`${c}px`),C(g.panel,"top",h,c=>`${c}px`),C(g.panel,"left",p,c=>`${c}px`),C(g.panel,"right","auto"),C(g.panel,"bottom","auto"),C(g.panel,"width",V,c=>`${c}px`),C(g.panel,"height",re,c=>`${c}px`),C(g.panel,"min-height",re,c=>`${c}px`),C(g.panel,"max-width",V,c=>`${c}px`),C(g.panel,"max-height",re,c=>`${c}px`),C(g.panel,"min-width",0,c=>`${c}px`),C(g.panel,"margin",0,c=>`${c}px`),C(g.panel,"box-sizing","border-box"),C(g.panel,"border-width",0,c=>`${c}px`),C(g.panel,"border-radius",0,c=>`${c}px`),C(g.panel,"transform","none"),C(g.panel,"overflow","hidden"),C(g.panel,"--cms-dialog-fullscreen-left",p,c=>`${c}px`),C(g.panel,"--cms-dialog-fullscreen-top",h,c=>`${c}px`),C(g.panel,"--cms-dialog-fullscreen-width",V,c=>`${c}px`),C(g.panel,"--cms-dialog-fullscreen-height",re,c=>`${c}px`)},te=g=>{g!=null&&g.panel&&(C(g.panel,"position",null),C(g.panel,"inset",null),C(g.panel,"top",null),C(g.panel,"left",null),C(g.panel,"right",null),C(g.panel,"bottom",null),C(g.panel,"width",null),C(g.panel,"height",null),C(g.panel,"min-height",null),C(g.panel,"max-width",null),C(g.panel,"max-height",null),C(g.panel,"min-width",null),C(g.panel,"margin",null),C(g.panel,"box-sizing",null),C(g.panel,"border-width",null),C(g.panel,"border-radius",null),C(g.panel,"transform",null),C(g.panel,"overflow",null),C(g.panel,"--cms-dialog-fullscreen-left",null),C(g.panel,"--cms-dialog-fullscreen-top",null),C(g.panel,"--cms-dialog-fullscreen-width",null),C(g.panel,"--cms-dialog-fullscreen-height",null))},he=(g,p)=>{var b,J,Q,ee,we;if(!g)return;if((b=g._dialogViewportCleanup)==null||b.call(g),g._dialogViewportCleanup=null,!p){te(g);return}let h=null;const V=globalThis.requestAnimationFrame||(F=>setTimeout(()=>F(Date.now()),0)),re=globalThis.cancelAnimationFrame||clearTimeout,c=()=>le(g),N=()=>{h!=null&&re(h),h=V(()=>{h=null,c()})};c(),N(),window.addEventListener("resize",c),window.addEventListener("orientationchange",N),(Q=(J=window.visualViewport)==null?void 0:J.addEventListener)==null||Q.call(J,"resize",c),(we=(ee=window.visualViewport)==null?void 0:ee.addEventListener)==null||we.call(ee,"scroll",N),g._dialogViewportCleanup=()=>{var F,m,L,P;h!=null&&(re(h),h=null),window.removeEventListener("resize",c),window.removeEventListener("orientationchange",N),(m=(F=window.visualViewport)==null?void 0:F.removeEventListener)==null||m.call(F,"resize",c),(P=(L=window.visualViewport)==null?void 0:L.removeEventListener)==null||P.call(L,"scroll",N)}},U=()=>S,W=g=>{var h;const p=o((h=g.state)!=null?h:g.color);return p?i.includes(p)?p:String(p):""},oe=g=>{const p=o(g.size);return typeof p=="string"&&d.includes(p)?p:""},Z=g=>{var h,V,re;const p=String(o((re=(V=(h=g.actionsAlign)!=null?h:g.footerAlign)!=null?V:g.alignActions)!=null?re:"end")).toLowerCase();return["start","left"].includes(p)?"start":["center","middle"].includes(p)?"center":["between","space-between"].includes(p)?"between":["stretch","full"].includes(p)?"stretch":"end"},ge=g=>{var h,V,re;const p=String(o((re=(V=(h=g.align)!=null?h:g.verticalAlign)!=null?V:g.position)!=null?re:"center")).toLowerCase();return["top","start","flex-start"].includes(p)?"cms-dialog-align-top":["bottom","end","flex-end"].includes(p)?"cms-dialog-align-bottom":""},Ae=g=>{var h,V;return((V=(h=g.closable)!=null?h:g.dismissible)!=null?V:g.closeButton)!==!1},ye=()=>{var Y,Ne,ze,Ee,K,$,se,je;const g=U(),p={close:ae,dismiss:ae,open:H,toggle:ve,update:ue,isOpen:ie,entry:()=>u,props:g},h=g.icon!=null?typeof g.icon=="string"?v.Icon({name:g.icon,size:g.iconSize||"md"}):JSswift.ui.slot(g.icon,{as:"icon"}):null,V=r(s,"eyebrow",p,w(g.eyebrow,p)),re=r(s,"title",p,w((Ne=(Y=g.title)!=null?Y:g.heading)!=null?Ne:g.header,p)),c=r(s,"subtitle",p,w((ze=g.subtitle)!=null?ze:g.description,p)),N=r(s,"icon",p,h),b=r(s,"header",p,w((Ee=g.headerContent)!=null?Ee:g.head,p)),J=Ae(g)?r(s,"close",p,v.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":g.closeLabel||"Chiudi dialog","data-dialog-close":!0},v.Icon({name:g.closeIcon||"close",size:"sm"}))):[],Q=(se=($=(K=g.content)!=null?K:g.body)!=null?$:g.message)!=null?se:n&&n.length?n:null;let ee=r(s,"content",p,w(Q,p));ee.length||(ee=r(s,"body",p,w(Q,p))),ee.length||(ee=r(s,"default",p,w(Q,p)));const we=w((je=g.footer)!=null?je:g.actions,p);let F=r(s,"footer",p,we);F.length||(F=r(s,"actions",p,we));let m=null;b.length?m=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...b):(V.length||re.length||c.length||N.length||J.length)&&(m=_.div({class:"cms-dialog-head"},N.length?_.div({class:"cms-dialog-icon"},...N):null,_.div({class:"cms-dialog-head-main"},V.length?_.div({class:"cms-dialog-eyebrow"},...V):null,re.length?_.div({class:"cms-dialog-title"},...re):null,c.length?_.div({class:"cms-dialog-subtitle"},...c):null),J.length?_.div({class:"cms-dialog-close-wrap"},...J):null));const L=_.div({class:fe(["cms-dialog-body",g.bodyClass])},...ee),P=F.length?_.div({class:fe(["cms-dialog-actions",`is-${Z(g)}`,xe(g.stackActions,"is-stacked"),g.actionsClass,g.footerClass])},...F):null;return _.div({class:fe(["cms-dialog-shell",xe(!!m,"has-head"),xe(!!P,"has-footer"),xe(g.divider!==!1,"with-divider")])},...[m,L,P].filter(Boolean))},pe=g=>{var re;if(!(g!=null&&g.panel))return;const p=U(),h=W(p),V=oe(p);A(g.panel,"_dialogClassTokens",["cms-dialog","cms-singularity","cms-clear-set",V?`cms-dialog-${V}`:"",h,h?`cms-state-${h}`:"",o(p.fullscreen)?"fullscreen":"",o(p.scrollable)?"scrollable":"",o(p.stickyHeader)?"sticky-head":"",o(p.stickyActions)?"sticky-actions":"",o(p.borderless)?"borderless":"",...D(p.class),...D(p.panelClass)]),A(g.overlay,"_dialogOverlayClassTokens",[ge(p),o(p.backdropBlur)?"cms-dialog-overlay-blur":"",...D(p.overlayClass)]),C(g.panel,"--cms-dialog-width",o(p.width),ht),C(g.panel,"--cms-dialog-min-width",o(p.minWidth),ht),C(g.panel,"--cms-dialog-max-width",o(p.maxWidth),ht),C(g.panel,"--cms-dialog-max-height",o(p.maxHeight),ht),C(g.panel,"--cms-dialog-body-max-height",o((re=p.bodyMaxHeight)!=null?re:p.contentMaxHeight),ht),p.style&&Object.assign(g.panel.style,p.style),G(g.panel,p),he(g,o(p.fullscreen)),g.panel.setAttribute("role",p.role||"dialog"),g.panel.setAttribute("aria-modal",p.modal===!1?"false":"true"),p.ariaLabel?g.panel.setAttribute("aria-label",p.ariaLabel):g.panel.removeAttribute("aria-label")},me=()=>{u!=null&&u.panel&&u.panel.replaceChildren(ye())},ue=(g={})=>(g&&typeof g=="object"&&(S={...S,...g}),u&&(pe(u),me()),I),H=(g=null)=>{var re,c,N,b,J;if(g&&typeof g=="object"&&(S={...S,...g}),u)return pe(u),me(),u;l=document.activeElement;const p=U(),h=p.persistent===!0;u=JSswift.overlay.open(()=>ye(),{type:"dialog",backdrop:p.backdrop!==!1,lockScroll:p.lockScroll!==!1,trapFocus:p.trapFocus!==!1,autoFocus:p.autoFocus!==!1,closeOnOutside:(re=p.closeOnOutside)!=null?re:!h,closeOnBackdrop:(c=p.closeOnBackdrop)!=null?c:!h,closeOnEsc:(N=p.closeOnEsc)!=null?N:!h,className:zn(["cms-dialog"]),onClose:()=>{var Q,ee,we,F;(Q=u==null?void 0:u._dialogViewportCleanup)==null||Q.call(u),(ee=u==null?void 0:u.panel)==null||ee.removeEventListener("click",V),u=null,(F=(we=U()).onClose)==null||F.call(we),l&&typeof l.focus=="function"&&setTimeout(()=>l.focus(),0)}});const V=Q=>{const ee=Q.target;ee&&ee.closest&&ee.closest("[data-dialog-close]")&&ae()};return u.panel.addEventListener("click",V),pe(u),_s(u),(J=(b=U()).onOpen)==null||J.call(b,u),u},ae=()=>{if(!u)return;const g=u;Fs(g,()=>JSswift.overlay.close(g.id))},ie=()=>!!u,ve=(g=null)=>ie()?(ae(),null):H(g),I={open:H,close:ae,toggle:ve,update:ue,isOpen:ie,entry:()=>u,props:()=>({...S})};return I},(yr=JSswift.isDev)!=null&&yr.call(JSswift)&&(v.meta=v.meta||{},v.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 of content",actions:"Node|Function|Array|({ close })=>Node",footer:"Alias of actions",size:"xs|sm|md|lg|xl|full",state:"primary|secondary|warning|danger|success|info|light|dark",color:"Alias of 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 above the title ({ close })",title:"Dialog title ({ close })",subtitle:"Dialog subtitle ({ close })",header:"Custom header ({ close })",content:"Dialog body ({ close })",body:"Alias of content ({ close })",footer:"Custom footer ({ close })",actions:"Dialog actions ({ close })",close:"Close action ({ close })",default:"Fallback body content ({ close })"},description:"Standardized dialog overlay with variants, animations, structured slots, and imperative API.",returns:"Object { open(overrides?), close(), toggle(overrides?), update(props), isOpen(), entry(), props() }"}),v.TabPanel=(...t)=>{var Be,ce,Oe,Le,Je,Fe,Ge,He,R,Te,O,k,x;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Array.isArray(e.tabs)?e.tabs:Array.isArray(e.items)?e.items:[],d=bn(e.model,"UI.TabPanel:model"),S=e.id||"cms-tabpanel-"+Math.random().toString(36).slice(2,9),u=f=>String(o(f)||"vertical").toLowerCase()==="horizontal"?"horizontal":"vertical",l=f=>String(o(f)||"before").toLowerCase()==="after"?"after":"before",w=f=>{const E=String(o(f)||"").toLowerCase();return E==="pills"||E==="pill"?"pills":E==="soft"||E==="card"?"soft":"line"},D=f=>{const E=o(f);return E==null||E===""?null:JSswift.uiColors.includes(E)?`var(--cms-${E})`:String(E)},A=u(e.orientation||e.orient||e.direction),C=l(e.navPosition||e.barPosition||e.position),z=w(e.variant||(e.pills?"pills":e.soft?"soft":"line")),le=!!e.wrap,te=!!e.swipeable,he=!!e.infinite,U=!!e.animated,W=!!((ce=(Be=e.navFill)!=null?Be:e.fill)!=null?ce:e.stretch),oe=!!e.disabled,Z=o((Oe=e.transitionDuration)!=null?Oe:e["transition-duration"]),ge=(()=>{if(Z==null)return 220;if(typeof Z=="number")return Z;const f=parseFloat(Z);return Number.isFinite(f)?f:220})(),Ae=o((Le=e.transitionEasing)!=null?Le:e["transition-easing"])||"ease",ye=(Fe=(Je=e.transitionPrev)!=null?Je:e["transition-prev"])!=null?Fe:null,pe=(He=(Ge=e.transitionNext)!=null?Ge:e["transition-next"])!=null?He:null,me=D((R=e.color)!=null?R:e.state),ue=i.map((f,E)=>{var ut,St,Lt,zt,Rt,et,yt,Jt,jt,Xt,Qt,an,$t,Zt,un,hn;if(f==null)return null;if(typeof f!="object")return{name:f,labelFallback:f,panelFallback:null,noteFallback:null,iconFallback:null,badgeFallback:null,hidden:!1,raw:f,index:E};const Ce=(et=(Rt=(zt=(Lt=(St=(ut=f.name)!=null?ut:f.value)!=null?St:f.id)!=null?Lt:f.key)!=null?zt:f.label)!=null?Rt:f.title)!=null?et:`tab-${E}`,Ue=f.label!=null||f.title!=null,Xe=Ue?(yt=f.label)!=null?yt:f.title:f.children!=null&&f.content==null&&f.panel==null?f.children:(jt=(Jt=f.name)!=null?Jt:f.value)!=null?jt:`Tab ${E+1}`,q=(an=(Qt=(Xt=f.content)!=null?Xt:f.panel)!=null?Qt:f.body)!=null?an:Ue?f.children:null,We=(un=(Zt=($t=f.note)!=null?$t:f.subtitle)!=null?Zt:f.description)!=null?un:null,st=(hn=f.icon)!=null?hn:null,Ze=Object.prototype.hasOwnProperty.call(f,"badge")?f.badge:Object.prototype.hasOwnProperty.call(f,"counter")?f.counter:null;return{...f,name:Ce,labelFallback:Xe,panelFallback:q,noteFallback:We,iconFallback:st,badgeFallback:Ze,index:E}}).filter(Boolean).filter(f=>f.hidden!==!0&&f.visible!==!1),H=fe(["cms-clear-set","cms-tabpanel","cms-singularity",A,`variant-${z}`,xe(le,"wrap"),xe(U,"animated"),xe(W,"nav-fill"),xe(oe,"disabled"),xe(C==="after","nav-after"),e.class]),ae=JSswift.omit(e,["tabs","items","value","default","defaultValue","model","orientation","orient","direction","navPosition","barPosition","position","variant","pills","soft","navFill","fill","stretch","wrap","swipeable","infinite","animated","transitionDuration","transition-duration","transitionEasing","transition-easing","transitionPrev","transition-prev","transitionNext","transition-next","slots","empty","tabClass","tabStyle","panelClass","panelStyle","navClass","panelsClass","class","style"]);ae.class=H,ae.style=e.style;const ie=_.div(ae);U&&(ie.style.setProperty("--cms-tabpanel-duration",`${ge}ms`),ie.style.setProperty("--cms-tabpanel-easing",Ae)),me&&ie.style.setProperty("--cms-tabpanel-accent",me);const ve=_.div({class:fe(["cms-tabpanel-nav",e.navClass]),role:"tablist","aria-orientation":A}),I=_.div({class:fe(["cms-tabpanel-panels",e.panelsClass])}),g=[],p=[];let h=-1;const V=()=>A==="horizontal",re=(f,E,Ce)=>({tab:f,name:f.name,index:E,active:Ce,value:f.name,select:()=>ze(E),next:()=>K(),prev:()=>$()}),c=(f,E,Ce=!1)=>{var Xe;if(!ue.length)return-1;let Ue=f;for(let q=0;q<ue.length;q+=1){if(Ue+=E,Ue>=ue.length){if(!Ce)return-1;Ue=0}else if(Ue<0){if(!Ce)return-1;Ue=ue.length-1}if(!((Xe=ue[Ue])!=null&&Xe.disabled))return Ue}return-1},N=f=>{var Ce;const E=(Ce=g[f])==null?void 0:Ce.btn;!E||typeof E.focus!="function"||requestAnimationFrame(()=>E.focus())},b=(f,E,Ce)=>{const Ue=re(f,E,Ce),Xe=JSswift.ui.renderSlot(s,"label",Ue,f.labelFallback);return r(null,"default",{},Xe)},J=(f,E)=>{var Jt,jt,Xt,Qt,an;const Ce=E===h,Ue=`${S}-tab-${E}`,Xe=`${S}-panel-${E}`,q=re(f,E,Ce),We=b(f,E,Ce),st=f.iconFallback!=null?typeof f.iconFallback=="string"?v.Icon({name:f.iconFallback,size:(Xt=(jt=(Jt=f.iconSize)!=null?Jt:f.size)!=null?jt:e.size)!=null?Xt:null}):f.iconFallback:null,Ze=r(s,"icon",q,st),ut=r(s,"note",q,f.noteFallback),St=r(s,"badge",q,f.badgeFallback),Lt=_.span({class:"cms-tabpanel-tab-inner"},Ze.length?_.span({class:"cms-tabpanel-tab-icon"},...Ze):null,_.span({class:"cms-tabpanel-tab-copy"},_.span({class:"cms-tabpanel-tab-label"},...We.length?We:[""]),ut.length?_.span({class:"cms-tabpanel-tab-note"},...ut):null),St.length?_.span({class:"cms-tabpanel-tab-badge"},...St):null),zt=r(s,"tab",{...q,label:We,icon:Ze,note:ut,badge:St,tabId:Ue,panelId:Xe},Lt),Rt=$t=>{if(oe||f.disabled)return;const Zt=$t.key;if(Zt==="Enter"||Zt===" "){$t.preventDefault(),ze(E);return}if(Zt==="Home"){$t.preventDefault();const qt=ue.findIndex(Jn=>!Jn.disabled);qt>=0&&(ze(qt),N(qt));return}if(Zt==="End"){$t.preventDefault();const qt=(()=>{var Jn;for(let In=ue.length-1;In>=0;In-=1)if(!((Jn=ue[In])!=null&&Jn.disabled))return In;return-1})();qt>=0&&(ze(qt),N(qt));return}const un=V()?["ArrowLeft"]:["ArrowUp"],hn=V()?["ArrowRight"]:["ArrowDown"];if(un.includes(Zt)){$t.preventDefault();const qt=c(E,-1,he);qt>=0&&(ze(qt,{dir:"prev"}),N(qt));return}if(hn.includes(Zt)){$t.preventDefault();const qt=c(E,1,he);qt>=0&&(ze(qt,{dir:"next"}),N(qt))}},et=v.Btn({class:fe(["cms-tabpanel-tab",xe(Ce,"active"),xe(f.disabled||oe,"disabled"),e.tabClass,f.tabClass||f.class]),type:"button",id:Ue,role:"tab",disabled:!!(f.disabled||oe),"aria-selected":Ce?"true":"false","aria-controls":Xe,tabindex:Ce?"0":"-1",outline:z==="pills"&&!Ce,color:z==="pills"&&Ce?f.color||e.color||e.state||"primary":null,size:(an=(Qt=f.size)!=null?Qt:e.size)!=null?an:null,style:{...e.tabStyle||{},...f.tabStyle||{}},onClick:()=>{f.disabled||oe||ze(E)},onKeydown:Rt},...zt),yt=_.div({class:fe(["cms-tabpanel-nav-btn",xe(Ce,"active"),f.navClass]),"data-name":f.name},et,_.span({class:"tab-indicator"}));return g[E]={btn:et,wrap:yt,index:E},yt},Q=(f,E)=>{const Ce=E===h,Ue=`${S}-tab-${E}`,Xe=`${S}-panel-${E}`,q=re(f,E,Ce),We=JSswift.ui.renderSlot(s,"panel",q,f.panelFallback),st=_.div({class:fe(["cms-tabpanel-panel",xe(Ce,"active"),e.panelClass,f.panelClass]),style:{...e.panelStyle||{},...f.panelStyle||{}},"data-name":f.name,role:"tabpanel",id:Xe,tabindex:0,"aria-labelledby":Ue,"aria-hidden":Ce?"false":"true"},...r(null,"default",{},We));return p[E]=st,st},ee=ue.map((f,E)=>J(f,E)),we=JSswift.ui.renderSlot(s,"nav",{tabs:ue,active:()=>{var f;return h>=0?(f=ue[h])==null?void 0:f.name:null},activeIndex:()=>h,activeTab:()=>h>=0?ue[h]:null,select:f=>{typeof f=="number"?ze(f):Ee(f)},next:()=>K(),prev:()=>$(),nodes:ee,orientation:A,position:C,variant:z},ee);r(null,"default",{},we).forEach(f=>ve.appendChild(f)),ue.length?ue.forEach((f,E)=>I.appendChild(Q(f,E))):r(s,"empty",{tabs:ue},(Te=e.empty)!=null?Te:_.div({class:"cms-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(E=>I.appendChild(E));const F=f=>{if(!U)return;const E=f==="next"?"18px":"-18px",Ce=f==="next"?"-18px":"18px";ie.style.setProperty("--cms-tabpanel-enter",E),ie.style.setProperty("--cms-tabpanel-leave",Ce)},m=()=>{const f=[];ye&&f.push(...String(ye).split(/\s+/)),pe&&f.push(...String(pe).split(/\s+/)),f.length&&I.classList.remove(...f.filter(Boolean))},L=f=>{m();const E=f==="prev"?ye:pe;if(!E)return;const Ce=String(E).split(/\s+/).filter(Boolean);Ce.length&&(I.classList.add(...Ce),setTimeout(()=>I.classList.remove(...Ce),ge+40))},P=f=>{var Ue;const E=g.find(({btn:Xe})=>Xe.classList.contains("active")),Ce=(Ue=E==null?void 0:E.btn.parentNode)==null?void 0:Ue.getBoundingClientRect();g.forEach(({btn:Xe,index:q})=>{const We=q===f,st=Xe.parentNode;if(!st)return;const Ze=st.getBoundingClientRect();st.isConnected&&Ce&&(st.style.setProperty("--nav-pos-x",Ce.left-Ze.left+"px"),st.style.setProperty("--nav-pos-y",Ce.top-Ze.top+"px")),st.classList.toggle("active",We),Xe.classList.toggle("active",We),Xe.setAttribute("aria-selected",We?"true":"false"),Xe.setAttribute("tabindex",We?"0":"-1")})},Y=(f,E,Ce)=>{F(Ce),p.forEach((Ue,Xe)=>{if(!Ue)return;const q=Xe===E,We=Xe===f;q?(Ue.classList.add("active"),Ue.classList.remove("leaving"),Ue.setAttribute("aria-hidden","false")):(Ue.classList.remove("active"),Ue.setAttribute("aria-hidden","true"),U&&We?(Ue.classList.add("leaving"),setTimeout(()=>Ue.classList.remove("leaving"),ge+40)):Ue.classList.remove("leaving"))})},Ne=(f,E)=>f<0||f===E||he&&f===ue.length-1&&E===0?"next":he&&f===0&&E===ue.length-1?"prev":E>f?"next":"prev",ze=(f,E={})=>{var q,We;if(f==null||f<0||f>=ue.length||(q=ue[f])!=null&&q.disabled)return;const Ce=h;if(Ce===f)return;h=f;const Ue=ue[f],Xe=E.dir||Ne(Ce,f);d&&!E.fromModel&&d.set(Ue.name),P(f),Y(Ce,f,Xe),L(Xe),ie.dataset.active=String(Ue.name),(We=e.onChange)==null||We.call(e,Ue.name,Ue,f)},Ee=(f,E={})=>{if(!ue.length)return;const Ce=ue.findIndex(Ue=>Ue.name==f);Ce!==-1&&ze(Ce,E)},K=()=>{if(!ue.length)return;const f=h<0?ue.findIndex(E=>!E.disabled):c(h,1,he);f<0||ze(f,{dir:"next"})},$=()=>{if(!ue.length)return;const f=h<0?(()=>{var E;for(let Ce=ue.length-1;Ce>=0;Ce-=1)if(!((E=ue[Ce])!=null&&E.disabled))return Ce;return-1})():c(h,-1,he);f<0||ze(f,{dir:"prev"})};if(te){let f=0,E=0,Ce=!1;const Ue=42;I.addEventListener("pointerdown",Xe=>{Xe.button!=null&&Xe.button!==0||(Ce=!0,f=Xe.clientX,E=Xe.clientY)}),I.addEventListener("pointerup",Xe=>{if(!Ce)return;Ce=!1;const q=Xe.clientX-f,We=Xe.clientY-E;Math.abs(q)<Ue||Math.abs(q)<Math.abs(We)||(q<0?K():$())}),I.addEventListener("pointercancel",()=>{Ce=!1}),I.addEventListener("pointerleave",()=>{Ce=!1})}const se=d?d.get():(x=(k=(O=e.value)!=null?O:e.defaultValue)!=null?k:e.default)!=null?x:null;if(ue.length){const f=ue.findIndex(E=>E.name==se);if(f>=0)ze(f,{fromModel:!0});else{const E=ue.findIndex(Ce=>!Ce.disabled);E>=0&&(ze(E,{fromModel:!0}),d&&d.set(ue[E].name))}}return d&&d.watch(f=>Ee(f,{fromModel:!0}),"UI.TabPanel:watch"),C==="after"?(ie.appendChild(I),ie.appendChild(ve)):(ie.appendChild(ve),ie.appendChild(I)),r(s,"default",{},n).forEach(f=>ie.appendChild(f)),G(ie,e),ie._tabs=()=>ue.slice(),ie._active=()=>h>=0?ue[h]:null,ie._getValue=()=>{var f;return h>=0?(f=ue[h])==null?void 0:f.name:null},ie._setValue=f=>Ee(f),ie._select=f=>{typeof f=="number"?ze(f):Ee(f)},ie._next=K,ie._prev=$,ie},(wr=JSswift.isDev)!=null&&wr.call(JSswift)&&(v.meta=v.meta||{},v.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:"Tab definition. Supports multiple aliases for label and content.",category:"data"},items:{type:"Array",description:"Alias of `tabs`.",category:"data"},value:{type:"any",description:"Initial or controlled value of the active tab.",category:"data"},defaultValue:{type:"any",description:"Explicit alias for the initial tab when `model` is not used.",category:"data"},model:{type:"[get,set] signal",description:"Reactive binding for the active tab.",category:"data"},orientation:{type:"vertical|horizontal",description:"Navigation orientation.",values:["vertical","horizontal"],default:"vertical",category:"layout"},navPosition:{type:"before|after",description:"Tab bar position relative to the panels.",values:["before","after"],default:"before",category:"layout"},variant:{type:"line|pills|soft",description:"Visual style of the tab navigation.",values:["line","pills","soft"],default:"line",category:"style"},wrap:{type:"boolean",description:"Allows the nav to wrap when space is limited.",default:!1,category:"layout"},navFill:{type:"boolean",description:"Distributes tabs across the available width.",default:!1,category:"layout"},swipeable:{type:"boolean",description:"Enables swipe gestures on panels.",default:!1,category:"behavior"},infinite:{type:"boolean",description:"When enabled, next/prev cycles from the first to the last tab.",default:!1,category:"behavior"},animated:{type:"boolean",description:"Enables the transition between panels.",default:!1,category:"behavior"},transitionDuration:{type:"number",description:"Animation duration in milliseconds.",default:220,category:"behavior"},transitionEasing:{type:"string",description:"CSS timing function for the animation.",default:"ease",category:"behavior"},transitionPrev:{type:"string",description:"Custom classes applied during the transition to the previous tab.",category:"behavior"},transitionNext:{type:"string",description:"Custom classes applied during the transition to the next tab.",category:"behavior"},tabClass:{type:"string",description:"Additional classes for all tab buttons.",category:"style"},tabStyle:{type:"object",description:"Inline style applied to all tab buttons.",category:"style"},navClass:{type:"string",description:"Additional classes for the nav wrapper.",category:"style"},panelsClass:{type:"string",description:"Additional classes for the panels wrapper.",category:"style"},panelClass:{type:"string",description:"Common additional classes for each panel.",category:"style"},panelStyle:{type:"object",description:"Common inline style for each panel.",category:"style"},empty:{type:"Node|Function|Array",description:"Visual fallback when `tabs` and `items` are empty.",category:"state"},disabled:{type:"boolean",description:"Disables the entire component.",default:!1,category:"state"},slots:{type:"{ nav?, tab?, label?, icon?, note?, badge?, panel?, empty?, default? }",description:"Structured slots for customizing nav, label, badge, and content.",category:"general"}},slots:{nav:{type:"Function|Node|Array",description:"Full navigation renderer. Receives `tabs`, `active()`, `activeTab()`, `select()`, `next()`, `prev()`, `nodes`, `orientation`, `position`, `variant`."},tab:{type:"Function|Node|Array",description:"Inner content of the tab button. Receives `tab`, `name`, `index`, `active`, `label`, `icon`, `note`, `badge`, `select()`."},label:{type:"Function|Node|Array",description:"Tab label."},icon:{type:"Function|Node|Array",description:"Tab icon."},note:{type:"Function|Node|Array",description:"Note, subtitle, or short description below the label."},badge:{type:"Function|Node|Array",description:"Badge or counter aligned to the right of the tab."},panel:{type:"Function|Node|Array",description:"Active/inactive panel renderer. Receives `tab`, `name`, `index`, `active`, `select()`, `next()`, `prev()`."},empty:{type:"Function|Node|Array",description:"Fallback when there are no tabs."},default:{type:"Node|Array|Function",description:"Extra content appended after the component."}},events:{onChange:"(name, tab, index)"},returns:"HTMLDivElement with API `_getValue()`, `_setValue(value)`, `_select(value)`, `_next()`, `_prev()`, `_active()`, `_tabs()`",description:"Standardized tab panel with accessible nav, structured slots, reactive model, swipe, and animations."});function ma(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Vo({title:t,message:e,contentNode:n,okText:s,cancelText:i,showCancel:d,onOk:S,onCancel:u,persistent:l}){fi();const w=_.div({class:"cms-dialog-backdrop",onClick:te=>{te.target===w&&l!==!0&&(u==null||u())}}),D=r(null,"default",{},t),A=r(null,"default",{},e),C=r(null,"default",{},n),z=_.div({class:"cms-dialog cms-panel"},D.length?_.h3(...D):null,A.length?_.p(...A):null,...C,_.div({class:"cms-dialog-actions"},d?JSswift.ui.Btn({onClick:u},i||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:S},s||"OK")));w.appendChild(z),fi().appendChild(w);const le=te=>{te.key==="Escape"&&(u==null||u())};return document.addEventListener("keydown",le,{once:!0}),{backdrop:w,close:()=>ma(w)}}mt.dialog.alert=function(t,e={}){return new Promise(n=>{const{backdrop:s,close:i}=Vo({title:e.title||"Info",message:t,okText:e.okText||"OK",showCancel:!1,persistent:e.persistent,onOk:()=>{i(),n(!0)},onCancel:()=>{i(),n(!0)}})})},mt.dialog.confirm=function(t={}){return new Promise(e=>{const{close:n}=Vo({title:t.title||"Conferma",message:t.message||"",okText:t.okText||"Conferma",cancelText:t.cancelText||"Annulla",showCancel:!0,persistent:t.persistent,onOk:()=>{n(),e(!0)},onCancel:()=>{n(),e(!1)}})})},mt.dialog.prompt=function(t={}){return new Promise(e=>{const n=JSswift.ui.Input({class:"cms-dialog-input",type:t.type||"text",placeholder:t.placeholder||""});t.value!=null&&(n.value=String(t.value));const{close:s}=Vo({title:t.title||"Inserisci valore",message:t.message||"",okText:t.okText||"OK",cancelText:t.cancelText||"Annulla",showCancel:!0,contentNode:_.div(n),persistent:t.persistent,onOk:()=>{const i=n.value;s(),e(i)},onCancel:()=>{s(),e(null)}});setTimeout(()=>n.focus(),0)})},mt.services=mt.services||{},mt.services.loading=mt.services.loading||{},mt.loading=mt.services.loading;let pn=null,Gs=0;function mi(){if(pn)return pn;pn=document.createElement("div"),pn.className="cms-loading-backdrop",pn.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 n=document.createElement("div");n.className="cms-muted cms-loading-text",n.textContent="Loading...";const s=document.createElement("div");s.className="cms-loading-progress",s.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
|
+
`,s.appendChild(i);const d=document.createElement("div");d.style.cssText="display:flex; gap: 12px; align-items:center; width: 100%;",d.appendChild(e),d.appendChild(n),t.appendChild(d),t.appendChild(s),pn.appendChild(t),document.body.appendChild(pn);const S=document.createElement("style");return S.textContent=`
|
|
33
|
+
@keyframes cmsSpin { to { transform: rotate(360deg); } }
|
|
34
|
+
`,document.head.appendChild(S),pn._textNode=n,pn._spinner=e,pn._progressWrap=s,pn._progressBar=i,pn._progressActive=!1,pn}function gi(t,e){if(typeof t=="object"&&t!==null)return{...t};const n=e&&typeof e=="object"?e:{};return typeof e=="string"&&(t==null||typeof t=="number")?{...n,message:e}:{...n,message:t}}function pi(t,e){const n=e==="progress";t._spinner.style.display=n?"none":"",t._progressWrap.style.display=n?"block":"none",t._mode=e}mt.loading.show=function(t="Loading...",e={}){const n=mi(),s=gi(t,e);Gs++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",pi(n,"spinner"),s.spinner===!1&&(n._spinner.style.display="none"),n.style.display="flex"},mt.loading.hide=function(){pn&&(Gs=Math.max(0,Gs-1),Gs===0&&(pn.style.display="none",pn._progressActive=!1))},mt.loading.progress=function(t=0,e={}){var d;const n=mi();typeof t=="object"&&t!==null&&(e=t,t=(d=t.value)!=null?d:0);const s=gi(null,e);n._progressActive||(Gs++,n._progressActive=!0);const i=Math.max(0,Math.min(100,Number(t!=null?t:0)));n._textNode.textContent=s.message||"Loading...",n._progressBar.style.width=i+"%",pi(n,"progress"),n.style.display="flex"},mt.loading.wrap=async function(t,e){mt.loading.show(t);try{return await e()}finally{mt.loading.hide()}};function ga(t){return typeof t=="function"?t():t||[]}function Bo(t,e){if(!(t==null||e==null))return typeof e!="string"||e.indexOf(".")<0?t==null?void 0:t[e]:e.split(".").reduce((n,s)=>n==null?n:n[s],t)}function pa(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 ha(t){const e=ga(t);return Array.isArray(e)?e:[]}function hi(t){var e,n,s,i;return(i=(s=(n=(e=t==null?void 0:t.label)!=null?e:t==null?void 0:t.title)!=null?n:t==null?void 0:t.header)!=null?s:t==null?void 0:t.key)!=null?i:""}function $o(t,e){var n,s;return(s=(n=t==null?void 0:t.sortKey)!=null?n:t==null?void 0:t.key)!=null?s:`__col_${e}`}function bi(t,e){return t.find((n,s)=>$o(n,s)===e||(n==null?void 0:n.key)===e)||null}function Fo(t,e,n){return t?typeof t.get=="function"?t.get(e,{row:e,rowIndex:n,col:t}):typeof t.value=="function"?t.value(e,{row:e,rowIndex:n,col:t}):typeof t.key=="string"?Bo(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function Lo(t,e){return typeof t=="function"?t(e)||{}:t||{}}function Io(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(Io).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 ba(t,e){const s=(Array.isArray(t)?t:e).map(i=>Number(i)).filter(i=>Number.isFinite(i)&&i>0);return s.length?Array.from(new Set(s)):e}function ya(t,e,n,s){const i=s.searchBy||s.searchPredicate;if(typeof i=="function")return!!i(t,{query:n,columns:e});const d=String(n||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(!d.length)return!0;const S=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(w=>(w==null?void 0:w.searchable)!==!1).map(w=>{var D;return(D=w==null?void 0:w.searchKey)!=null?D:w==null?void 0:w.key}).filter(Boolean),u=[];if(S.length)for(const w of S)if(typeof w=="function")u.push(Io(w(t)));else{const D=e.find(A=>(A==null?void 0:A.key)===w||(A==null?void 0:A.searchKey)===w);u.push(Io(D?Fo(D,t,-1):Bo(t,w)))}else u.push(Io(t));const l=u.join(" ").toLowerCase();return d.every(w=>l.includes(w))}v.Table=(...t)=>{var Be,ce,Oe,Le;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Array.isArray(e.columns)?e.columns:[],d=ba(e.pageSizeOptions,[5,10,20,50]),S=Number((ce=(Be=e.pageSize)!=null?Be:d[0])!=null?ce:10)||10,u=Array.from(new Set([...d,S])).sort((Je,Fe)=>Je-Fe),l=e.initialSort||(e.sortBy?{key:e.sortBy,dir:e.sortDir==="desc"?"desc":"asc"}:null),w=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",D=bn(e.searchModel||e.queryModel,"UI.Table:query"),[A,C]=mt.reactive.signal(Math.max(1,Number(e.page||1)||1)),[z,le]=mt.reactive.signal(S),[te,he]=mt.reactive.signal(l),[U,W]=mt.reactive.signal(String((Le=D?D.get():(Oe=e.search)!=null?Oe:e.query)!=null?Le:"")),oe=Je=>{const Fe=String(Je!=null?Je:"");W(Fe),D&&D.set(Fe),C(1)},Z=Je=>{const Fe=Number(Je)||S;le(Fe),C(1)},ge=(Je,Fe)=>{const Ge=$o(Je,Fe),He=te();!He||He.key!==Ge&&He.key!==(Je==null?void 0:Je.key)?he({key:Ge,dir:"asc"}):He.dir==="asc"?he({key:Ge,dir:"desc"}):he(null),C(1)};let Ae=null;D&&D.watch(Je=>{const Fe=String(Je!=null?Je:"");W(Fe),Ae&&Ae.value!==Fe&&(Ae.value=Fe),C(1)},"UI.Table:queryWatch");const ye=JSswift.omit(e,["columns","rows","rowKey","loading","page","pageSize","pageSizeOptions","pagination","initialSort","sortBy","sortDir","search","query","searchable","searchPlaceholder","searchKeys","searchBy","searchPredicate","searchModel","queryModel","filter","actions","actionsLabel","emptyText","loadingText","onRowClick","onRowDblClick","tableClass","tableStyle","cardClass","dense","striped","hover","stickyHeader","toolbar","toolbarStart","toolbarEnd","caption","footer","status","rowClass","rowAttrs","minTableWidth","hideHeader","hideFooter","slots","body"]);ye.class=fe(["cms-table-card",e.class,e.cardClass]),e.dense!=null&&(ye.dense=e.dense);const pe=_.div({class:"cms-table-shell"}),me=r(s,"default",{},n);me.length&&pe.appendChild(_.div({class:"cms-table-lead"},...me));const ue=r(s,"toolbarStart",{},e.toolbarStart),H=r(s,"toolbar",{},e.toolbar),ae=r(s,"toolbarEnd",{},e.toolbarEnd),ie=_.div({class:"cms-table-toolbar"}),ve=_.div({class:"cms-table-toolbar-main"}),I=_.div({class:"cms-table-toolbar-side"});ue.forEach(Je=>ve.appendChild(Je)),H.forEach(Je=>ve.appendChild(Je));const g=r(s,"search",{query:U(),getQuery:U,setQuery:oe},null);if(g.length)g.forEach(Je=>I.appendChild(Je));else if(w){Ae=_.input({type:"search",class:"cms-input",placeholder:typeof e.searchable=="string"?e.searchable:e.searchPlaceholder||"Cerca nella tabella",value:String(U()||"")}),Ae.addEventListener("input",()=>oe(Ae.value));const Je=v.Btn({class:"cms-table-search-clear",outline:!0,onClick:()=>{Ae&&(Ae.value=""),oe("")}},"Reset");I.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),Ae,Je))}ae.forEach(Je=>I.appendChild(Je)),(ve.childNodes.length||I.childNodes.length)&&(ie.appendChild(ve),ie.appendChild(I),pe.appendChild(ie));const p=_.div({class:"cms-singularity cms-table-chip"},""),h=_.div({class:"cms-singularity cms-table-chip"},""),V=_.div({class:"cms-singularity cms-table-chip"},""),re=r(s,"status",{},e.status),c=_.div({class:"cms-table-status"},p,h,V,...re);pe.appendChild(c);const N=r(s,"caption",{},e.caption);N.length&&pe.appendChild(_.div({class:"cms-table-caption"},...N));const b=_.thead(),J=_.tbody(),Q=!!e.actions||!!s.actions,ee=fe(["cms-table",xe(e.dense,"dense"),xe(e.striped,"striped"),xe(e.hover!==!1,"hover"),xe(e.stickyHeader!==!1,"sticky-head"),e.tableClass]),we={...e.tableStyle||{}};e.minTableWidth!=null&&(we["--cms-table-min-width"]=ht(e.minTableWidth));const F=_.table({class:ee,style:we},b,J),m=_.div({class:"cms-singularity cms-table-wrap"},F);pe.appendChild(m);const L=_.div({class:"cms-singularity cms-table-chip"},""),P=_.div({class:"cms-singularity cms-table-chip"},""),Y=v.Btn({outline:!0,onClick:()=>C(Math.max(1,A()-1))},"\u2039"),Ne=v.Btn({outline:!0,onClick:()=>C(A()+1)},"\u203A"),ze=_.div({class:"cms-singularity cms-table-chip"},""),Ee=_.select({class:"cms-input cms-table-size-select"},...u.map(Je=>_e({value:String(Je)},String(Je))));Ee.value=String(z()),Ee.addEventListener("change",()=>Z(Ee.value));const K=r(s,"footer",{},e.footer),$=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},L,P,_.label({class:"cms-table-size"},_.span("Righe"),Ee)),_.div({class:"cms-table-foot-extra"},...K,_.div({class:"cms-table-pager"},Y,ze,Ne)));e.hideFooter!==!0&&pe.appendChild($);const se=()=>{if(b.innerHTML="",e.hideHeader)return;const Je=_.tr();if(i.forEach((Fe,Ge)=>{var Ce,Ue;const He={col:Fe,colIndex:Ge,sort:te()},R={...Lo(Fe==null?void 0:Fe.style,{...He,header:!0}),...Lo((Ce=Fe==null?void 0:Fe.headerStyle)!=null?Ce:Fe==null?void 0:Fe.thStyle,{...He,header:!0})};(Fe==null?void 0:Fe.width)!=null&&(R.width=ht(Fe.width)),(Fe==null?void 0:Fe.minWidth)!=null&&(R.minWidth=ht(Fe.minWidth)),(Fe==null?void 0:Fe.maxWidth)!=null&&(R.maxWidth=ht(Fe.maxWidth)),Fe!=null&&Fe.align&&(R.textAlign=Fe.align);let Te=r(Fe==null?void 0:Fe.slots,"header",He,null);if(!Te.length){const Xe=typeof(Fe==null?void 0:Fe.header)=="function"?Fe.header(He):(Ue=Fe==null?void 0:Fe.header)!=null?Ue:hi(Fe);Te=r(s,"header",He,Xe)}const O=te(),k=$o(Fe,Ge),x=(Fe==null?void 0:Fe.sortable)!==!1&&((Fe==null?void 0:Fe.key)!=null||typeof(Fe==null?void 0:Fe.get)=="function"||typeof(Fe==null?void 0:Fe.compare)=="function"),f=!!O&&(O.key===k||O.key===(Fe==null?void 0:Fe.key)),E=_.th({class:fe(["cms-table-head-cell",xe(Fe==null?void 0:Fe.nowrap,"is-nowrap"),xe(x,"cms-table-sortable"),xe(f,"is-sorted"),Fe==null?void 0:Fe.headerClass]),style:R});x?E.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>ge(Fe,Ge)},_.span({class:"cms-table-head-label"},...Te),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},f?O.dir==="asc"?"\u2191":"\u2193":"\u2195"))):Te.forEach(Xe=>E.appendChild(Xe)),Je.appendChild(E)}),Q){const Fe=r(s,"actionsHeader",{},e.actionsLabel||"Azioni");Je.appendChild(_.th({class:"cms-table-head-cell cms-table-head-actions",style:{textAlign:"right"}},...Fe))}b.appendChild(Je)},je=(Je,Fe)=>{const Ge={columns:i,count:i.length},He=r(s,Je,Ge,Fe),R=String(i.length+(Q?1:0));J.appendChild(_.tr(_.td({colSpan:R,class:"cms-table-state"},...He)))};return mt.reactive.effect(()=>{const Je=ha(e.rows),Fe=String(U()||"").trim(),Ge=te(),He=typeof e.loading=="function"?!!e.loading():!!e.loading,R=e.pagination!==!1;if(se(),J.innerHTML="",Ae&&Ae.value!==U()&&(Ae.value=U()),Ee.value!==String(z())&&(Ee.value=String(z())),He){p.textContent="Caricamento in corso",h.style.display="none",V.style.display="none",L.textContent="Loading\u2026",P.textContent="",ze.textContent="Pagina 1",Y.disabled=!0,Ne.disabled=!0,je("loading",e.loadingText||"Loading...");return}let Te=Je.slice();const O=Te.length;if(typeof e.filter=="function"&&(Te=Te.filter((q,We)=>e.filter(q,{row:q,index:We,query:Fe,rows:Je,columns:i}))),Fe&&(Te=Te.filter(q=>ya(q,i,Fe,e))),Ge){const q=bi(i,Ge.key);q&&Te.sort((We,st)=>{const Ze=Fo(q,We,-1),ut=Fo(q,st,-1),St=typeof q.compare=="function"?q.compare(Ze,ut,We,st):pa(Ze,ut);return Ge.dir==="asc"?St:-St})}const k=Te.length,x=Math.max(1,Number(z())||S),f=R?Math.max(1,Math.ceil(k/x)):1,E=R?Math.min(A(),f):1;E!==A()&&C(E);const Ce=R?(E-1)*x:0,Ue=R?Ce+x:k,Xe=Te.slice(Ce,Ue);if(p.textContent=k===O?`${k} righe`:`${k} di ${O} righe`,h.textContent=Fe?`Ricerca: ${Fe}`:"",h.style.display=Fe?"":"none",Ge){const q=bi(i,Ge.key);V.textContent=q?`Ordine: ${hi(q)} ${Ge.dir==="asc"?"\u2191":"\u2193"}`:"",V.style.display=q?"":"none"}else V.style.display="none";if(L.textContent=k?`${Ce+1}-${Math.min(Ue,k)} di ${k}`:"0 risultati",P.textContent=k!==O?`Dataset totale ${O}`:`Page size ${x}`,ze.textContent=R?`Pagina ${E} / ${f}`:"Tutte le righe",Y.disabled=!R||E<=1,Ne.disabled=!R||E>=f,Ee.disabled=!R,Ee.parentNode.style.display=R?"":"none",Xe.length===0){je("empty",e.emptyText||"Nessun dato");return}for(let q=0;q<Xe.length;q++){const We=Xe[q],st=Ce+q,Ze={row:We,rowIndex:st,pageIndex:q},ut=typeof e.rowAttrs=="function"?e.rowAttrs(We,Ze)||{}:e.rowAttrs||{},St=typeof e.rowClass=="function"?e.rowClass(We,Ze):e.rowClass,Lt=!!(e.onRowClick||e.onRowDblClick),zt=_.tr({...ut,class:fe(["cms-table-row",St,ut.class,xe(Lt,"is-clickable")])});if(e.rowKey){const et=typeof e.rowKey=="function"?e.rowKey(We,Ze):Bo(We,e.rowKey);et!=null&&(zt.dataset.key=String(et))}const Rt=et=>{const yt=et==null?void 0:et.target;return!!(yt&&yt.closest&&yt.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(e.onRowClick&&zt.addEventListener("click",et=>{Rt(et)||e.onRowClick(We,Ze,et)}),e.onRowDblClick&&zt.addEventListener("dblclick",et=>{Rt(et)||e.onRowDblClick(We,Ze,et)}),i.forEach((et,yt)=>{var Zt,un;const Jt=Fo(et,We,st),jt={...Ze,col:et,colIndex:yt,value:Jt},Xt={...Lo(et==null?void 0:et.style,jt),...Lo((Zt=et==null?void 0:et.cellStyle)!=null?Zt:et==null?void 0:et.tdStyle,jt)};et!=null&&et.align&&(Xt.textAlign=et.align),(et==null?void 0:et.width)!=null&&(Xt.width=ht(et.width)),(et==null?void 0:et.minWidth)!=null&&(Xt.minWidth=ht(et.minWidth)),(et==null?void 0:et.maxWidth)!=null&&(Xt.maxWidth=ht(et.maxWidth));const Qt=typeof(et==null?void 0:et.cellClass)=="function"?et.cellClass(We,jt):(et==null?void 0:et.cellClass)||(et==null?void 0:et.class),an=_.td({class:fe(["cms-table-cell",Qt,xe(et==null?void 0:et.nowrap,"is-nowrap")]),style:Xt});let $t=r(et==null?void 0:et.slots,"cell",jt,null);if(!$t.length){const hn=typeof(et==null?void 0:et.render)=="function"?et.render(We,jt):typeof(et==null?void 0:et.format)=="function"?et.format(Jt,We,jt):Jt,qt=hn==null?(un=et==null?void 0:et.emptyText)!=null?un:"":hn;$t=r(s,"cell",jt,qt)}$t.length||($t=[""]),$t.forEach(hn=>an.appendChild(hn)),zt.appendChild(an)}),Q){const et={...Ze},yt=typeof e.actions=="function"?e.actions(We,Ze):e.actions;let Jt=r(s,"actions",et,yt);Jt.length||(Jt=r(null,"default",et,yt)),zt.appendChild(_.td({class:"cms-table-cell cms-table-cell-actions",style:{textAlign:"right"}},_.div({class:"cms-table-actions"},...Jt)))}J.appendChild(zt)}},"UI.Table:render"),ye.body=pe,v.Card(ye)},(vr=JSswift.isDev)!=null&&vr.call(JSswift)&&(v.meta=v.meta||{},v.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:"Introductory content above the table",toolbarStart:"Toolbar left area",toolbar:"Central/custom toolbar",toolbarEnd:"Toolbar right area",search:"Replaces the built-in search box",header:"Custom column header",cell:"Global cell renderer",actions:"Global row actions renderer",actionsHeader:"Actions column header",caption:"Caption above the table",status:"Extra content in the status row",loading:"Loading state",empty:"Empty state",footer:"Extra content in the footer"},events:{onRowClick:"(row, ctx, event) => void",onRowDblClick:"(row, ctx, event) => void"},returns:"HTMLDivElement",description:"Standardized table with toolbar, search, sorting, pagination, states, and flexible rendering."}),v.Menu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],d=["xs","sm","md","lg","xl"];let S={...e},u=null,l=null,w=null,D=null,A=null;const C=(m,L)=>Object.prototype.hasOwnProperty.call(m||{},L),z=(m,L)=>typeof m=="function"?m(L):m,le=m=>String(m||"").split(/\s+/).filter(Boolean),te=m=>m&&typeof m=="object"&&!m.nodeType&&!Array.isArray(m)&&!(m instanceof Function),he=m=>!!m&&typeof m=="object"&&(m.nodeType===1||typeof m.getBoundingClientRect=="function"),U=()=>{clearTimeout(D),clearTimeout(A),D=null,A=null},W=(m,L,P)=>{if(!m)return;const Y=m[L]||[];Y.length&&m.classList.remove(...Y);const Ne=(P||[]).filter(Boolean);Ne.length&&m.classList.add(...Ne),m[L]=Ne},oe=(m,L,P,Y=Ne=>Ne)=>{if(m){if(P==null||P===""){m.style.removeProperty(L);return}m.style.setProperty(L,Y(P))}},Z=()=>S||{},ge=m=>{var P;const L=String(o((P=m.state)!=null?P:m.color)||"").toLowerCase();return i.includes(L)?L:""},Ae=m=>{const L=String(o(m.size)||"").toLowerCase();return d.includes(L)?L:""},ye=m=>{var L,P;return String(o((P=(L=m.placement)!=null?L:m.position)!=null?P:"bottom-start"))},pe=()=>{var P;const m=o((P=Z().delay)!=null?P:Z().showDelay),L=Number(m);return Number.isFinite(L)?Math.max(0,L):0},me=()=>{const m=o(Z().hideDelay),L=Number(m);return Number.isFinite(L)?Math.max(0,L):80},ue=(m=null)=>{var P,Y,Ne;if(m)return m;const L=Z();return l||o((Ne=(Y=(P=L.anchorEl)!=null?P:L.triggerEl)!=null?Y:L.target)!=null?Ne:L.anchor)||null},H=m=>{if(m==null||m===!0)return new Set(["click"]);if(m===!1)return new Set(["manual"]);const L=Array.isArray(m)?m:String(m).split(/[\s,|/]+/),P=new Set;return L.forEach(Y=>{const Ne=String(Y||"").trim().toLowerCase();Ne&&(Ne==="mouseenter"||Ne==="mouseover"?P.add("hover"):Ne==="blur"||Ne==="focusin"?P.add("focus"):Ne==="tap"?P.add("click"):P.add(Ne))}),P.size?P:new Set(["manual"])},ae=(m,L)=>{var Ne,ze,Ee;let P=null,Y=null;if(he(m))P=m,te(L)&&(Y=L);else if(te(m)){Y=m;const K=(Ee=(ze=(Ne=m.anchorEl)!=null?Ne:m.triggerEl)!=null?ze:m.target)!=null?Ee:m.anchor;he(K)&&(P=K)}else m!=null&&(P=m);return{anchorEl:P,nextProps:Y}},ie=(m=u==null?void 0:u.panel)=>{var L;return Array.from(((L=m==null?void 0:m.querySelectorAll)==null?void 0:L.call(m,"[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(P=>P.offsetParent!==null&&P.getAttribute("aria-hidden")!=="true")},ve=()=>{o(Z().autoFocus)!==!1&&setTimeout(()=>{const m=ie();if(!m.length)return;(m.find(P=>P.classList.contains("is-active")||P.classList.contains("is-selected")||P.classList.contains("is-checked"))||m[0]).focus()},0)},I=(m,L,P="sm")=>{const Y=z(m,L);return Y==null?[]:typeof Y=="string"?[v.Icon({name:Y,size:P})]:Ws(Y,{...L,as:"icon"})},g=(m,L)=>{var Ce,Ue,Xe,q,We,st,Ze,ut,St,Lt,zt,Rt,et;const P=z(m,L);if(P==null||P===!1)return[];if(Array.isArray(P))return P.flatMap((yt,Jt)=>g(yt,{...L,index:Jt}));if(typeof P=="function")return g(P(L),L);if(P!=null&&P.nodeType)return[P];if(typeof P=="string"||typeof P=="number")return g({label:P},L);if(!te(P))return Ws(P,{...L,as:"item"});const Y=String((Ue=(Ce=P.type)!=null?Ce:P.kind)!=null?Ue:"").toLowerCase();if(Y==="separator"||Y==="divider"||P.separator===!0||P.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const Ne=(Xe=P.items)!=null?Xe:P.children;if((Y==="group"||Y==="section"||Array.isArray(Ne))&&Ne!=null){const yt={...L,item:P},Jt=r(s,"groupLabel",yt,z((q=P.label)!=null?q:P.title,yt)),jt=g(Ne,yt);return jt.length?[_.div({class:fe(["cms-menu-group",P.class])},Jt.length?_.div({class:"cms-menu-group-label"},...Jt):null,_.div({class:"cms-menu-group-items"},...jt))]:[]}const ze={...L,item:P,close:re,dismiss:re,open:N,toggle:Q,update:c,isOpen:ee,entry:()=>u,anchorEl:ue(),props:Z()},Ee=!!o(P.disabled),K=P.checked==null?null:!!o(P.checked),$=!!o((We=P.active)!=null?We:P.selected),se=ge(P),je=o(P.href),Be=o(P.to),ce=C(P,"closeOnSelect")?!!o(P.closeOnSelect):P.keepOpen===!0?!1:Z().closeOnSelect!==!1,Oe=P.role||(K!=null?"menuitemcheckbox":"menuitem"),Le=I(P.icon,ze),Je=I((st=P.iconRight)!=null?st:P.endIcon,ze),Fe=r(s,"itemTitle",ze,z((Ze=P.title)!=null?Ze:P.label,ze)),Ge=r(s,"itemSubtitle",ze,z((ut=P.subtitle)!=null?ut:P.description,ze)),He=r(s,"itemShortcut",ze,z(P.shortcut,ze)),R=r(s,"itemBadge",ze,z(P.badge,ze)),Te=r(s,"item",ze,z((Lt=(St=P.content)!=null?St:P.body)!=null?Lt:P.render,ze)),O=[...R,...He,...K===!0&&!Je.length&&!R.length?[_.span({class:"cms-menu-entry-check"},v.Icon({name:P.checkedIcon||"check",size:"sm"}))]:[],...Je],x={class:fe(["cms-menu-entry","cms-menu-item",se?`cms-state-${se}`:"",xe($,"is-active"),xe(K===!0,"is-checked"),xe(Ee,"is-disabled"),P.class]),role:Oe,tabIndex:Ee?-1:(zt=P.tabIndex)!=null?zt:-1,"data-menu-item":!0,"data-menu-select":ce?"true":"false","data-menu-close":P.close===!0?"true":null,"data-menu-keep-open":ce?null:"true","aria-disabled":Ee?"true":null,"aria-checked":K==null?null:String(K),title:(et=(Rt=P.titleAttr)!=null?Rt:P.tooltip)!=null?et:null,type:je?null:"button",href:je||null,target:P.target||null,rel:P.rel||(P.target==="_blank"?"noopener noreferrer":null),onClick:yt=>{var jt,Xt,Qt,an;if(Ee){yt.preventDefault(),yt.stopPropagation();return}(Xt=(jt=Z()).onItemClick)==null||Xt.call(jt,P,ze,yt);const Jt=(Qt=P.onClick)==null?void 0:Qt.call(P,ze,yt);yt.defaultPrevented||(Be&&((an=JSswift.router)!=null&&an.navigate)&&(yt.preventDefault(),JSswift.router.navigate(Be)),Jt!==!1&&ce&&re())}};P.attrs&&typeof P.attrs=="object"&&Object.assign(x,P.attrs);const f=je?_.a:_.button,E=Te.length?Te:[Fe.length?_.div({class:"cms-menu-entry-title"},...Fe):null,Ge.length?_.div({class:"cms-menu-entry-subtitle"},...Ge):null].filter(Boolean);return[f(x,Le.length?_.span({class:"cms-menu-entry-icon"},...Le):null,_.span({class:"cms-menu-entry-main"},...E),O.length?_.span({class:"cms-menu-entry-aside"},...O):null)]},p=()=>{var Fe,Ge,He,R,Te,O,k;const m=Z(),L={close:re,dismiss:re,open:N,toggle:Q,update:c,isOpen:ee,entry:()=>u,anchorEl:ue(),props:m},P=I(m.icon,L,m.iconSize||"md"),Y=r(s,"eyebrow",L,z(m.eyebrow,L)),Ne=r(s,"title",L,z((Ge=(Fe=m.title)!=null?Fe:m.heading)!=null?Ge:m.label,L)),ze=r(s,"subtitle",L,z((He=m.subtitle)!=null?He:m.description,L)),Ee=r(s,"before",L,z(m.before,L)),K=r(s,"header",L,z(m.header,L)),$=r(s,"after",L,z(m.after,L)),se=r(s,"footer",L,z(m.footer,L)),je=r(s,"status",L,z(m.status,L));let Be=(R=m.content)!=null?R:m.body;Be==null&&n&&n.length&&(Be=n);let ce=r(s,"content",L,z(Be,L));ce.length||(ce=r(s,"body",L,z(Be,L))),ce.length||(ce=r(s,"default",L,z(Be,L)));const Oe=g((O=(Te=m.items)!=null?Te:m.actionsList)!=null?O:m.entries,L),Le=Oe.length?[]:r(s,"empty",L,z((k=m.empty)!=null?k:m.emptyText,L));let Je=null;return K.length?Je=_.div({class:fe(["cms-menu-head","cms-menu-head-custom",m.headerClass])},...K):(P.length||Y.length||Ne.length||ze.length)&&(Je=_.div({class:fe(["cms-menu-head",m.headerClass])},P.length?_.div({class:"cms-menu-head-icon"},...P):null,_.div({class:"cms-menu-head-main"},Y.length?_.div({class:"cms-menu-eyebrow"},...Y):null,Ne.length?_.div({class:"cms-menu-title"},...Ne):null,ze.length?_.div({class:"cms-menu-subtitle"},...ze):null))),_.div({class:fe(["cms-menu","cms-menu-shell",xe(m.dense,"dense"),xe(Oe.length>0,"has-items"),xe(se.length>0||je.length>0,"has-footer"),m.class]),style:m.style||{},role:m.role||"menu","aria-label":m.ariaLabel||null},Ee.length?_.div({class:"cms-menu-before"},...Ee):null,Je,ce.length?_.div({class:fe(["cms-menu-content",m.contentClass])},...ce):null,Oe.length?_.div({class:fe(["cms-menu-items",m.itemsClass])},...Oe):null,!Oe.length&&Le.length?_.div({class:"cms-menu-empty"},...Le):null,$.length?_.div({class:"cms-menu-after"},...$):null,je.length||se.length?_.div({class:fe(["cms-menu-footer",m.footerClass])},je.length?_.div({class:"cms-menu-status"},...je):null,se.length?_.div({class:"cms-menu-footer-actions"},...se):null):null)},h=m=>{var Ne;if(!(m!=null&&m.panel))return;const L=Z(),P=ge(L),Y=Ae(L);W(m.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",Y?`cms-menu-${Y}`:"",P?`cms-state-${P}`:"",o(L.outline)?"outline":"",...le(L.panelClass)]),W(m.overlay,"_menuOverlayClassTokens",[...le(L.overlayClass)]),m.panel.dataset.placement=ye(L),oe(m.panel,"--cms-menu-width",o(L.width),ht),oe(m.panel,"--cms-menu-min-width",o(L.minWidth),ht),oe(m.panel,"--cms-menu-max-width",o(L.maxWidth),ht),oe(m.panel,"--cms-menu-max-height",o(L.maxHeight),ht),oe(m.panel,"--cms-menu-body-max-height",o((Ne=L.bodyMaxHeight)!=null?Ne:L.contentMaxHeight),ht),L.panelStyle&&Object.assign(m.panel.style,L.panelStyle),G(m.panel,L)},V=()=>{u!=null&&u.panel&&u.panel.replaceChildren(p())},re=()=>{if(U(),!u)return;const m=u;u=null,Fs(m,()=>JSswift.overlay.close(m.id))},c=(m={})=>{var L,P,Y,Ne;if(m&&typeof m=="object"&&(S={...S,...m}),u){const ze=Z();h(u),V(),(Ne=u.reposition)==null||Ne.call(u,{anchorEl:u._anchorEl,placement:ye(ze),offsetX:(L=ze.offsetX)!=null?L:0,offsetY:(Y=(P=ze.offsetY)!=null?P:ze.offset)!=null?Y:8}),ve()}return F},N=(m=null,L=null)=>{var Je,Fe,Ge,He,R,Te,O,k,x,f,E,Ce,Ue,Xe,q,We;U();const{anchorEl:P,nextProps:Y}=ae(m,L);Y&&(S={...S,...Y});const Ne=Z(),ze=ue(P);if(!ze||o(Ne.disabled))return null;if(u&&u._anchorEl===ze){const st=Z();return h(u),V(),(He=u.reposition)==null||He.call(u,{anchorEl:u._anchorEl,placement:ye(st),offsetX:(Je=st.offsetX)!=null?Je:0,offsetY:(Ge=(Fe=st.offsetY)!=null?Fe:st.offset)!=null?Ge:8}),ve(),u}u&&re(),w=document.activeElement;let Ee=null;if(u=JSswift.overlay.open(()=>p(),{type:"menu",anchorEl:ze,placement:ye(Ne),offsetX:(R=Ne.offsetX)!=null?R:0,offsetY:(O=(Te=Ne.offsetY)!=null?Te:Ne.offset)!=null?O:8,backdrop:Ne.backdrop===!0,lockScroll:Ne.lockScroll===!0,trapFocus:Ne.trapFocus===!0,autoFocus:!1,closeOnOutside:Ne.closeOnOutside!==!1,closeOnBackdrop:(k=Ne.closeOnBackdrop)!=null?k:Ne.backdrop===!0,closeOnEsc:Ne.closeOnEsc!==!1,className:zn(["cms-menu-panel"]),onClose:()=>{var st,Ze,ut;(st=Ee==null?void 0:Ee._menuCleanup)==null||st.call(Ee),(ut=(Ze=Z()).onClose)==null||ut.call(Ze,Ee),Z().returnFocus!==!1&&w&&typeof w.focus=="function"&&setTimeout(()=>w.focus(),0)}}),!(u!=null&&u.panel))return u;const K=u;Ee=K,K._anchorEl=ze;const $=()=>{clearTimeout(A),A=null},se=()=>{J()},je=st=>{const Ze=st.target;if(!Ze||!Ze.closest)return;if(Ze.closest("[data-menu-close]")){re();return}if(Z().closeOnSelect===!1)return;const ut=Ze.closest("[data-menu-item], [data-menu-select], .cms-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");ut&&(ut.closest("[data-menu-keep-open]")||ut.getAttribute("data-menu-select")!=="false"&&re())},Be=st=>{if(st.key==="Escape"){st.preventDefault(),re();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(st.key))return;const Ze=ie(K.panel);if(!Ze.length)return;st.preventDefault();const ut=Ze.indexOf(document.activeElement);if(st.key==="Home"){Ze[0].focus();return}if(st.key==="End"){Ze[Ze.length-1].focus();return}const St=st.key==="ArrowDown"?1:-1,Lt=ut<0?St>0?0:Ze.length-1:(ut+St+Ze.length)%Ze.length;Ze[Lt].focus()};K.panel.addEventListener("click",je),K.panel.addEventListener("keydown",Be);const ce=H((f=(x=Ne.trigger)!=null?x:Ne.triggers)!=null?f:C(Ne,"open")?"manual":null),Oe=ce.has("hover"),Le=ce.has("focus");return(Oe||Le)&&(K.panel.addEventListener("mouseenter",$),K.panel.addEventListener("mouseleave",se),K.panel.addEventListener("focusin",$),K.panel.addEventListener("focusout",se)),K._menuCleanup=()=>{var st,Ze,ut,St,Lt,zt;(st=K.panel)==null||st.removeEventListener("click",je),(Ze=K.panel)==null||Ze.removeEventListener("keydown",Be),(ut=K.panel)==null||ut.removeEventListener("mouseenter",$),(St=K.panel)==null||St.removeEventListener("mouseleave",se),(Lt=K.panel)==null||Lt.removeEventListener("focusin",$),(zt=K.panel)==null||zt.removeEventListener("focusout",se)},h(K),(Xe=K.reposition)==null||Xe.call(K,{anchorEl:ze,placement:ye(Ne),offsetX:(E=Ne.offsetX)!=null?E:0,offsetY:(Ue=(Ce=Ne.offsetY)!=null?Ce:Ne.offset)!=null?Ue:8}),_s(K),(We=(q=Z()).onOpen)==null||We.call(q,K),ve(),K},b=(m,L=null)=>{clearTimeout(A),A=null,clearTimeout(D),D=setTimeout(()=>N(m,L),pe())},J=(m=!1)=>{if(clearTimeout(D),D=null,!!u){if(clearTimeout(A),m){re();return}A=setTimeout(()=>re(),me())}},Q=(m=null,L=null)=>ee()?(re(),null):N(m,L),ee=()=>!!u,F={open:N,close:re,show:b,hide:J,toggle:Q,update:c,bind:m=>{var se,je;if(!m)return()=>{};l=m;const L=Z(),P=H((je=(se=L.trigger)!=null?se:L.triggers)!=null?je:C(L,"open")?"manual":null),Y=P.has("hover"),Ne=P.has("focus"),ze=P.has("click"),Ee=P.has("manual")||!Y&&!Ne&&!ze,K=[],$=()=>{U(),K.forEach(Be=>Be()),l===m&&(l=null)};if(C(L,"open"))return Dt(L.open)?JSswift.reactive.effect(()=>{l&&(o(Z().open)?N(l):J(!0))},"UI.Menu:open"):L.open===!0?N(m):L.open===!1&&J(!0),$;if(Ee||o(L.disabled))return $;if(Y){const Be=()=>b(m),ce=()=>J();m.addEventListener("mouseenter",Be),m.addEventListener("mouseleave",ce),K.push(()=>{m.removeEventListener("mouseenter",Be),m.removeEventListener("mouseleave",ce)})}if(Ne){const Be=()=>b(m),ce=()=>J();m.addEventListener("focus",Be),m.addEventListener("blur",ce),K.push(()=>{m.removeEventListener("focus",Be),m.removeEventListener("blur",ce)})}if(ze){const Be=ce=>{var Oe,Le;(Le=(Oe=Z()).onTriggerClick)==null||Le.call(Oe,ce),!ce.defaultPrevented&&Q(m)};m.addEventListener("click",Be),K.push(()=>m.removeEventListener("click",Be))}return $},isOpen:ee,entry:()=>u,props:()=>({...S})};return F},(Sr=JSswift.isDev)!=null&&Sr.call(JSswift)&&(v.meta=v.meta||{},v.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 of 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 of state",trigger:"click|hover|focus|manual|Array",placement:"string",offsetX:"number",offsetY:"number",offset:"Alias of offsetY",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",contentMaxHeight:"Alias of bodyMaxHeight",closeOnSelect:"boolean",closeOnOutside:"boolean",closeOnEsc:"boolean",autoFocus:"boolean",anchorEl:"HTMLElement|VirtualAnchor",triggerEl:"Alias of anchorEl",target:"Alias of 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:"Region above 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 of 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:"Group label ({ item, close })",empty:"Empty state ({ close })",status:"Status row ({ close })",footer:"Footer actions ({ close })",after:"Region below 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:"Standardized menu overlay with item model, rich slots, bindable triggers, header/footer, and imperative API."}),v.Popover=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],d=["xs","sm","md","lg","xl"];let S={...e},u=null,l=null,w=null,D=null,A=null;const C=(F,m)=>Object.prototype.hasOwnProperty.call(F||{},m),z=(F,m)=>typeof F=="function"?F(m):F,le=F=>String(F||"").split(/\s+/).filter(Boolean),te=F=>F&&typeof F=="object"&&!F.nodeType&&!Array.isArray(F)&&!(F instanceof Function),he=F=>!!F&&typeof F=="object"&&(F.nodeType===1||typeof F.getBoundingClientRect=="function"),U=()=>{clearTimeout(D),clearTimeout(A),D=null,A=null},W=(F,m,L)=>{if(!F)return;const P=F[m]||[];P.length&&F.classList.remove(...P);const Y=(L||[]).filter(Boolean);Y.length&&F.classList.add(...Y),F[m]=Y},oe=(F,m,L,P=Y=>Y)=>{if(F){if(L==null||L===""){F.style.removeProperty(m);return}F.style.setProperty(m,P(L))}},Z=()=>S,ge=F=>{var L;const m=o((L=F.state)!=null?L:F.color);return m?i.includes(m)?m:String(m):""},Ae=F=>{const m=o(F.size);return typeof m=="string"&&d.includes(m)?m:""},ye=F=>{var L,P,Y;const m=String(o((Y=(P=(L=F.actionsAlign)!=null?L:F.footerAlign)!=null?P:F.alignActions)!=null?Y:"end")).toLowerCase();return["start","left"].includes(m)?"start":["center","middle"].includes(m)?"center":["between","space-between"].includes(m)?"between":["stretch","full"].includes(m)?"stretch":"end"},pe=F=>{var m,L;return String(o((L=(m=F.placement)!=null?m:F.position)!=null?L:"bottom-start"))},me=(F,m)=>{const L=o(F);if(L==null||L==="")return m;const P=Number(L);return Number.isFinite(P)?P:m},ue=()=>me(Z().delay,0),H=()=>me(Z().hideDelay,120),ae=F=>{var L,P;return((P=(L=F.closable)!=null?L:F.dismissible)!=null?P:F.closeButton)===!0},ie=(F=null)=>{var L,P,Y;if(F)return F;const m=Z();return l||o((Y=(P=(L=m.anchorEl)!=null?L:m.triggerEl)!=null?P:m.target)!=null?Y:m.anchor)||null},ve=F=>{if(F==null||F===!0)return new Set(["click"]);if(F===!1)return new Set(["manual"]);const m=Array.isArray(F)?F:String(F).split(/[\s,|/]+/),L=new Set;return m.forEach(P=>{const Y=String(P||"").trim().toLowerCase();Y&&(Y==="mouseenter"||Y==="mouseover"?L.add("hover"):Y==="blur"||Y==="focusin"?L.add("focus"):Y==="tap"?L.add("click"):L.add(Y))}),L.size?L:new Set(["manual"])},I=(F,m)=>{var Y,Ne,ze;let L=null,P=null;if(he(F))L=F,te(m)&&(P=m);else if(te(F)){P=F;const Ee=(ze=(Ne=(Y=F.anchorEl)!=null?Y:F.triggerEl)!=null?Ne:F.target)!=null?ze:F.anchor;he(Ee)&&(L=Ee)}else F!=null&&(L=F);return{anchorEl:L,nextProps:P}},g=()=>{var Le,Je,Fe,Ge,He,R,Te,O,k;const F=Z(),m={close:V,dismiss:V,open:c,toggle:J,update:re,isOpen:Q,entry:()=>u,anchorEl:ie(),props:F},L=F.icon!=null?typeof F.icon=="string"?v.Icon({name:F.icon,size:F.iconSize||"md"}):JSswift.ui.slot(F.icon,{as:"icon"}):null,P=r(s,"eyebrow",m,z(F.eyebrow,m)),Y=r(s,"title",m,z((Je=(Le=F.title)!=null?Le:F.heading)!=null?Je:F.label,m)),Ne=r(s,"subtitle",m,z((Fe=F.subtitle)!=null?Fe:F.description,m)),ze=r(s,"icon",m,L),Ee=r(s,"header",m,z((He=(Ge=F.headerContent)!=null?Ge:F.head)!=null?He:F.header,m)),K=ae(F)?r(s,"close",m,v.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":F.closeLabel||"Chiudi popover","data-popover-close":!0},v.Icon({name:F.closeIcon||"close",size:"sm"}))):[];let $=(O=(Te=(R=F.content)!=null?R:F.body)!=null?Te:F.message)!=null?O:F.text;$==null&&n&&n.length&&($=n);let se=r(s,"content",m,z($,m));se.length||(se=r(s,"body",m,z($,m))),se.length||(se=r(s,"default",m,z($,m)));const je=z((k=F.footer)!=null?k:F.actions,m);let Be=r(s,"footer",m,je);Be.length||(Be=r(s,"actions",m,je));let ce=null;Ee.length?ce=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...Ee):(P.length||Y.length||Ne.length||ze.length||K.length)&&(ce=_.div({class:"cms-dialog-head"},ze.length?_.div({class:"cms-dialog-icon"},...ze):null,_.div({class:"cms-dialog-head-main"},P.length?_.div({class:"cms-dialog-eyebrow"},...P):null,Y.length?_.div({class:"cms-dialog-title"},...Y):null,Ne.length?_.div({class:"cms-dialog-subtitle"},...Ne):null),K.length?_.div({class:"cms-dialog-close-wrap"},...K):null));const Oe=[];return ce&&Oe.push(ce),se.length&&Oe.push(_.div({class:fe(["cms-dialog-body",F.bodyClass])},...se)),Be.length&&Oe.push(_.div({class:fe(["cms-dialog-actions",`is-${ye(F)}`,xe(F.stackActions,"is-stacked"),F.actionsClass,F.footerClass])},...Be)),Oe.length||Oe.push(_.div({class:fe(["cms-dialog-body",F.bodyClass])})),_.div({class:fe(["cms-dialog-shell","cms-popover-shell",xe(!!ce,"has-head"),xe(Be.length>0,"has-footer"),xe(F.divider!==!1,"with-divider")])},...Oe)},p=F=>{var Y;if(!(F!=null&&F.panel))return;const m=Z(),L=ge(m),P=Ae(m);W(F.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",P?`cms-dialog-${P}`:"",L,L?`cms-state-${L}`:"",o(m.scrollable)?"scrollable":"",o(m.stickyHeader)?"sticky-head":"",o(m.stickyActions)?"sticky-actions":"",o(m.borderless)?"borderless":"",...le(m.class),...le(m.panelClass)]),W(F.overlay,"_popoverOverlayClassTokens",[...le(m.overlayClass)]),F.panel.dataset.placement=pe(m),oe(F.panel,"--cms-dialog-width",o(m.width),ht),oe(F.panel,"--cms-dialog-min-width",o(m.minWidth),ht),oe(F.panel,"--cms-dialog-max-width",o(m.maxWidth),ht),oe(F.panel,"--cms-dialog-max-height",o(m.maxHeight),ht),oe(F.panel,"--cms-dialog-body-max-height",o((Y=m.bodyMaxHeight)!=null?Y:m.contentMaxHeight),ht),m.style&&Object.assign(F.panel.style,m.style),G(F.panel,m),F.panel.setAttribute("role",m.role||"dialog"),F.panel.setAttribute("aria-modal",m.modal===!0?"true":"false"),m.ariaLabel?F.panel.setAttribute("aria-label",m.ariaLabel):F.panel.removeAttribute("aria-label")},h=()=>{u!=null&&u.panel&&u.panel.replaceChildren(g())},V=()=>{if(U(),!u)return;const F=u;u=null,Fs(F,()=>JSswift.overlay.close(F.id))},re=(F={})=>(F&&typeof F=="object"&&(S={...S,...F}),u&&(p(u),h()),we),c=(F=null,m=null)=>{var Oe,Le,Je,Fe,Ge,He,R,Te;U();const{anchorEl:L,nextProps:P}=I(F,m);P&&(S={...S,...P});const Y=Z(),Ne=ie(L);if(!Ne||o(Y.disabled))return null;if(u&&u._anchorEl===Ne)return p(u),h(),u;u&&V(),w=document.activeElement;const ze=ve((Le=(Oe=Y.trigger)!=null?Oe:Y.triggers)!=null?Le:C(Y,"open")?"manual":null),Ee=ze.has("hover"),K=ze.has("focus");let $=null;if(u=JSswift.overlay.open(()=>g(),{type:"popover",anchorEl:Ne,placement:pe(Y),offsetX:(Je=Y.offsetX)!=null?Je:0,offsetY:(Ge=(Fe=Y.offsetY)!=null?Fe:Y.offset)!=null?Ge:10,backdrop:Y.backdrop===!0,lockScroll:Y.lockScroll===!0,trapFocus:Y.trapFocus===!0,autoFocus:Y.autoFocus===!0,closeOnOutside:Y.closeOnOutside!==!1,closeOnBackdrop:(He=Y.closeOnBackdrop)!=null?He:Y.backdrop===!0,closeOnEsc:Y.closeOnEsc!==!1,className:zn(["cms-dialog","cms-popover"]),onClose:()=>{var O,k,x;(O=$==null?void 0:$._popoverCleanup)==null||O.call($),(x=(k=Z()).onClose)==null||x.call(k,$),Z().returnFocus!==!1&&w&&typeof w.focus=="function"&&setTimeout(()=>w.focus(),0)}}),!(u!=null&&u.panel))return u;const se=u;$=se,se._anchorEl=Ne;const je=()=>{clearTimeout(A),A=null},Be=()=>{!Ee&&!K||b()},ce=O=>{const k=O.target;if(!(!k||!k.closest)){if(k.closest("[data-popover-close]")||k.closest("[data-dialog-close]")){V();return}Z().closeOnSelect===!0&&k.closest("[data-popover-select]")&&V()}};return se.panel.addEventListener("click",ce),(Ee||K)&&(se.panel.addEventListener("mouseenter",je),se.panel.addEventListener("mouseleave",Be),se.panel.addEventListener("focusin",je),se.panel.addEventListener("focusout",Be)),se._popoverCleanup=()=>{var O,k,x,f,E;(O=se.panel)==null||O.removeEventListener("click",ce),(k=se.panel)==null||k.removeEventListener("mouseenter",je),(x=se.panel)==null||x.removeEventListener("mouseleave",Be),(f=se.panel)==null||f.removeEventListener("focusin",je),(E=se.panel)==null||E.removeEventListener("focusout",Be)},p(se),_s(se),(Te=(R=Z()).onOpen)==null||Te.call(R,se),se},N=(F,m=null)=>{clearTimeout(A),A=null,clearTimeout(D),D=setTimeout(()=>c(F,m),ue())},b=(F=!1)=>{if(clearTimeout(D),D=null,!!u){if(clearTimeout(A),F){V();return}A=setTimeout(()=>V(),H())}},J=(F=null,m=null)=>Q()?(V(),null):c(F,m),Q=()=>!!u,we={open:c,close:V,show:N,hide:b,toggle:J,update:re,bind:F=>{var $,se;if(!F)return()=>{};l=F;const m=Z(),L=ve((se=($=m.trigger)!=null?$:m.triggers)!=null?se:C(m,"open")?"manual":null),P=L.has("hover"),Y=L.has("focus"),Ne=L.has("click"),ze=L.has("manual")||!P&&!Y&&!Ne,Ee=[],K=()=>{U(),Ee.forEach(je=>je()),l===F&&(l=null)};if(C(m,"open"))return Dt(m.open)?JSswift.reactive.effect(()=>{l&&(o(Z().open)?c(l):b(!0))},"UI.Popover:open"):m.open===!0?c(F):m.open===!1&&b(!0),K;if(ze||o(m.disabled))return K;if(P){const je=()=>N(F),Be=()=>b();F.addEventListener("mouseenter",je),F.addEventListener("mouseleave",Be),Ee.push(()=>{F.removeEventListener("mouseenter",je),F.removeEventListener("mouseleave",Be)})}if(Y){const je=()=>N(F),Be=()=>b();F.addEventListener("focus",je),F.addEventListener("blur",Be),Ee.push(()=>{F.removeEventListener("focus",je),F.removeEventListener("blur",Be)})}if(Ne){const je=Be=>{var ce,Oe;(Oe=(ce=Z()).onTriggerClick)==null||Oe.call(ce,Be),!Be.defaultPrevented&&J(F)};F.addEventListener("click",je),Ee.push(()=>F.removeEventListener("click",je))}return K},isOpen:Q,entry:()=>u,props:()=>({...S})};return we},(Cr=JSswift.isDev)!=null&&Cr.call(JSswift)&&(v.meta=v.meta||{},v.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 of content",actions:"Node|Function|Array|({ close })=>Node",footer:"Alias of actions",size:"xs|sm|md|lg|xl",state:"primary|secondary|warning|danger|success|info|light|dark",color:"Alias of state",trigger:"click|hover|focus|manual|Array",placement:"string",offsetX:"number",offsetY:"number",offset:"Alias of offsetY",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",contentMaxHeight:"Alias of 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 of anchorEl",target:"Alias of 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 of content ({ close })",footer:"Popover footer ({ close })",actions:"Alias of 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:"Standardized anchored popover with rich layout, complete slots, bindable triggers, and imperative API."}),v.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},i=null,d=null,S=null;const u=h=>h&&typeof h=="object"&&!h.nodeType&&!Array.isArray(h)&&!(h instanceof Function),l=h=>!!h&&typeof h=="object"&&(h.nodeType===1||typeof h.getBoundingClientRect=="function"),w=h=>!!h&&typeof h=="object"&&("clientX"in h||"type"in h||"target"in h||"currentTarget"in h),D=h=>!!h&&Number.isFinite(Number(h.x))&&Number.isFinite(Number(h.y)),A=()=>s,C=(h,V)=>{const re=Number(h),c=Number(V);return!Number.isFinite(re)||!Number.isFinite(c)?null:{x:re,y:c}},z=h=>h?{_cmsContextPoint:h,getBoundingClientRect:()=>({top:h.y,bottom:h.y,left:h.x,right:h.x,width:0,height:0})}:null,le=h=>{if(!l(h))return null;const V=h.getBoundingClientRect();return C(V.left+Math.min(V.width/2,24),V.top+Math.min(V.height/2,24))},te=h=>{var V,re,c,N;return o((N=(c=(re=(V=h==null?void 0:h.anchorEl)!=null?V:h==null?void 0:h.triggerEl)!=null?re:h==null?void 0:h.target)!=null?c:h==null?void 0:h.anchor)!=null?N:null)},he=(h,V=null)=>{if(!h)return le(V||S);const re=C(h.clientX,h.clientY);if(re)return re;const c=te({anchorEl:V||h.currentTarget||h.target||S});return le(c)},U=(h={})=>{if(!u(h))return{};const V={...h};return delete V.event,delete V.point,delete V.x,delete V.y,V},W=()=>{var V,re,c;const h=A();return{...h,trigger:"manual",placement:h.placement||"bottom-start",offsetX:(V=h.offsetX)!=null?V:0,offsetY:(c=(re=h.offsetY)!=null?re:h.offset)!=null?c:4,closeOnOutside:h.closeOnOutside!==!1,closeOnEsc:h.closeOnEsc!==!1,role:h.role||"menu",ariaLabel:h.ariaLabel||h.title||"Context menu",class:fe(["cms-context-menu-shell",h.class]),panelClass:fe(["cms-context-menu-panel",h.panelClass])}},oe=v.Menu(W(),...n),Z=(h=null,V=null,re=null)=>{let c=null,N=null,b=null;if(w(h))c=he(h,S),b=u(V)?U(V):null;else if(typeof h=="number"||typeof V=="number")c=C(h,V),b=u(re)?U(re):null;else if(D(h))c=C(h.x,h.y),b=u(V)?U(V):null;else if(l(h))N=h,b=u(V)?U(V):null;else if(u(h)){const J=D(h.point)?h.point:D(h)?h:null,Q=te(h),ee=h.event;c=J?C(J.x,J.y):he(ee,Q||S),N=Q&&l(Q)?Q:null,b={...U(h),...u(V)?U(V):{}}}else i&&(c={...i});return{point:c,anchor:N,nextProps:b}},ge=(h,V=null)=>{d=h||d,i=V||h&&h._cmsContextPoint||i},Ae=(h=null)=>{u(h)&&Object.keys(h).length&&(s={...s,...h})},ye=(h=null,V=null)=>{if(V)return z(V);if(h&&l(h))return h;const re=te(A());return l(re)?re:i?z(i):l(d)?d:l(S)?S:null},pe=(h=null,V=null,re=null)=>{const{point:c,anchor:N,nextProps:b}=Z(h,V,re);Ae(b);const J=ye(N,c);return J?(ge(J,c),oe.open(J,W())):null},me=(h,V,re=null)=>pe(h,V,re),ue=(h,V=null)=>pe(h,V),H=()=>(oe.close(),p),ae=(h=!0)=>(h===!1?oe.hide(!1):oe.close(),p),ie=(h=null,V=null,re=null)=>pe(h,V,re),ve=(h=null,V=null,re=null)=>oe.isOpen()?(H(),null):pe(h,V,re),I=(h={})=>(Ae(U(h)),oe.update(W()),p),p={open:pe,openAt:me,openFromEvent:ue,show:ie,hide:ae,close:H,toggle:ve,update:I,bind:(h,V=null)=>{if(!h)return()=>{};const re=u(V)?U(V):null,c=b=>{var Q,ee;S=h,b.preventDefault(),!(((ee=(Q=A()).onTrigger)==null?void 0:ee.call(Q,b,{element:h,open:pe,close:H,update:I}))===!1||o(A().disabled))&&pe({event:b,anchorEl:h},re)},N=b=>{var Q,ee;b.key!=="ContextMenu"&&!(b.shiftKey&&b.key==="F10")||(S=h,b.preventDefault(),((ee=(Q=A()).onTrigger)==null?void 0:ee.call(Q,b,{element:h,open:pe,close:H,update:I}))===!1||o(A().disabled))||pe({event:b,anchorEl:h},re)};return h.addEventListener("contextmenu",c),h.addEventListener("keydown",N),()=>{h.removeEventListener("contextmenu",c),h.removeEventListener("keydown",N)}},isOpen:oe.isOpen,entry:oe.entry,props:()=>({...s})};return p},(xr=JSswift.isDev)!=null&&xr.call(JSswift)&&(v.meta=v.meta||{},v.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 of 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 of state",placement:"string",offsetX:"number",offsetY:"number",offset:"Alias of offsetY",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",contentMaxHeight:"Alias of bodyMaxHeight",closeOnSelect:"boolean",closeOnOutside:"boolean",closeOnEsc:"boolean",anchorEl:"HTMLElement|VirtualAnchor",triggerEl:"Alias of anchorEl",target:"Alias of 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:"Region above 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 of 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:"Group label ({ item, close })",empty:"Empty state ({ close })",status:"Status row ({ close })",footer:"Footer actions ({ close })",after:"Region below body/footer ({ close })",default:"Fallback content ({ close })"},events:{onOpen:"void",onClose:"void",onItemClick:"item click",onTrigger:"contextmenu / keyboard trigger"},returns:"Object { open(), openAt(), openFromEvent(), show(), hide(), close(), toggle(), update(), bind(), isOpen() }",description:"Menu specialization for right-click and context-menu key interactions, with items, rich slots, runtime overrides, and coordinate-based positioning."})})(JSswift);
|