jsswift 1.0.45 → 1.0.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/documentions/AI.md +85 -0
- package/dist/documentions/README.md +2 -0
- package/dist/documentions/ai-development.md +3 -1
- package/dist/documentions/components/alert.md +29 -493
- package/dist/documentions/components/app-shell.md +37 -524
- package/dist/documentions/components/avatar.md +47 -575
- package/dist/documentions/components/badge.md +27 -461
- package/dist/documentions/components/banner.md +35 -535
- package/dist/documentions/components/breadcrumbs.md +35 -518
- package/dist/documentions/components/btn.md +3 -21
- package/dist/documentions/components/button.md +3 -0
- package/dist/documentions/components/card-body.md +11 -328
- package/dist/documentions/components/card-footer.md +15 -367
- package/dist/documentions/components/card-header.md +15 -367
- package/dist/documentions/components/card.md +3 -19
- package/dist/documentions/components/checkbox.md +25 -456
- package/dist/documentions/components/chip.md +16 -393
- package/dist/documentions/components/col.md +57 -612
- package/dist/documentions/components/container.md +40 -535
- package/dist/documentions/components/context-menu.md +60 -696
- package/dist/documentions/components/date.md +56 -673
- package/dist/documentions/components/dialog.md +5 -21
- package/dist/documentions/components/drawer.md +48 -616
- package/dist/documentions/components/empty-state.md +28 -477
- package/dist/documentions/components/footer.md +42 -586
- package/dist/documentions/components/form-field.md +40 -568
- package/dist/documentions/components/form.md +7 -321
- package/dist/documentions/components/grid-col.md +42 -542
- package/dist/documentions/components/grid.md +40 -542
- package/dist/documentions/components/header.md +38 -547
- package/dist/documentions/components/icon.md +17 -370
- package/dist/documentions/components/input.md +4 -22
- package/dist/documentions/components/item.md +37 -533
- package/dist/documentions/components/kpi.md +34 -519
- package/dist/documentions/components/layout.md +81 -811
- package/dist/documentions/components/list.md +19 -405
- package/dist/documentions/components/loading-bar.md +58 -679
- package/dist/documentions/components/menu.md +62 -710
- package/dist/documentions/components/notify.md +34 -525
- package/dist/documentions/components/page.md +35 -526
- package/dist/documentions/components/pagination.md +3 -20
- package/dist/documentions/components/parallax.md +50 -633
- package/dist/documentions/components/popover.md +55 -661
- package/dist/documentions/components/progress.md +39 -554
- package/dist/documentions/components/radio.md +27 -470
- package/dist/documentions/components/rating.md +41 -574
- package/dist/documentions/components/route-tab.md +30 -491
- package/dist/documentions/components/row.md +35 -507
- package/dist/documentions/components/search.md +62 -723
- package/dist/documentions/components/select.md +17 -22
- package/dist/documentions/components/separator.md +7 -321
- package/dist/documentions/components/slider.md +49 -631
- package/dist/documentions/components/spacer.md +6 -314
- package/dist/documentions/components/spinner.md +25 -440
- package/dist/documentions/components/stat.md +32 -505
- package/dist/documentions/components/tab-panel.md +40 -563
- package/dist/documentions/components/table.md +3 -22
- package/dist/documentions/components/tabs.md +36 -538
- package/dist/documentions/components/time.md +29 -491
- package/dist/documentions/components/toggle.md +31 -498
- package/dist/documentions/components/toolbar.md +52 -640
- package/dist/documentions/components/tooltip.md +35 -535
- package/dist/documentions/knowledge-map.json +27 -2
- package/dist/documentions/reactivity.md +21 -7
- package/dist/documentions/ui/common-props.md +301 -0
- package/dist/jsswift.js +10544 -14103
- package/dist/jsswift.min.js +3 -3
- package/dist/min-jsswift.js +3 -3
- package/package.json +3 -2
package/dist/min-jsswift.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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:"docDevelop/reference/core.md",syncRule:"Quando cambia un modulo core, aggiornare sia questo meta sia docDevelop/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=`
|
|
1
|
+
(()=>{var Os,Fs,ro,ao,Nt,Cs,J,Hn,us;window.JSswift=window.JSswift||{};const ee=window.JSswift;window._=window.JSswift,ee.config=ee.config||{};const bt=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{};ee.config.debug=(Os=bt.modeDev)!=null?Os:!1,ee.isDev=function(){return ee.config.debug},ee.uiNormalizeArgs=function(l){let E={},R=l;return l.length>0&&typeof l[0]=="object"&&l[0]!==null&&!l[0].nodeType&&!Array.isArray(l[0])&&!(l[0]instanceof Function)&&(E=l[0],R=l.slice(1)),{props:E,children:R}},ee.uiSizes=["xxs","xs","sm","md","lg","xl","xxl","xxxl"],ee.uiColors=["primary","secondary","success","warning","danger","info","light","dark"],ee.meta=ee.meta||{version:"1.0.23",policy:{sourceOfTruth:"docDevelop/reference/core.md",syncRule:"Quando cambia un modulo core, aggiornare sia questo meta sia docDevelop/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."]}}},ee.omit=(l,E)=>{const R={},B=new Set(E||[]);for(const D in l||{})B.has(D)||(R[D]=l[D]);return R},ee._cleanupRegistry=new WeakMap,ee._registerCleanup=function(l,E){if(!l||typeof E!="function")return E;const R=ee._cleanupRegistry.get(l)||[];return R.push(E),ee._cleanupRegistry.set(l,R),E},ee.dom={q(l,E=document){return E.querySelector(l)},qa(l,E=document){return Array.from(E.querySelectorAll(l))},attr(l,E,R){return l?R===void 0?l.getAttribute(E):(R===null?l.removeAttribute(E):l.setAttribute(E,String(R)),l):null}},(()=>{let l=[],E=!1;function R(){if(E)return;E=!0;const B=l.slice();l.length=0;for(const D of B)try{D()}catch(ge){console.error("[JSswift.ready] error:",ge)}}ee.ready=function(B){typeof B=="function"&&(E||document.readyState==="interactive"||document.readyState==="complete"?queueMicrotask(()=>{try{B()}catch(D){console.error("[JSswift.ready] error:",D)}}):l.push(B))},document.addEventListener("DOMContentLoaded",R,{once:!0})})(),ee.reactive=(()=>{let l=null;const E=[],R=100;let B=0,D="sync",ge="sync",q=!1;const pe=new Set;function Le(ze){const je=ze==null?void 0:ze.flush;if(je==null||je==="sync")return"sync";if(je==="microtask")return"microtask";throw new Error("JSswift.reactive.batch: options.flush must be 'sync' or 'microtask'")}function we(){for(;pe.size;){const ze=Array.from(pe);pe.clear(),ze.forEach(je=>je())}}function Ce(){q||(q=!0,queueMicrotask(()=>{q=!1,ge="sync",we()}))}function Ae(ze){const je=Array.from(ze);if(B>0||ge==="microtask"){je.forEach(ct=>pe.add(ct)),B===0&&ge==="microtask"&&Ce();return}je.forEach(ct=>ct())}function Oe(ze){if(ze&&(ze._deps.size&&(ze._deps.forEach(je=>je.delete(ze._runner)),ze._deps.clear()),typeof ze._cleanup=="function")){const je=ze._cleanup;ze._cleanup=null;try{je()}catch(ct){console.error("[JSswift.reactive.effect] cleanup error:",ct)}}}function Re(ze){if(!(!ze||!ze.active)){Oe(ze),E.push(ze),l=ze;try{const je=ut=>{ze._cleanup=typeof ut=="function"?ut:null},ct=ze.fn.length>0?ze.fn(je):ze.fn();typeof ct=="function"&&(ze._cleanup=ct)}finally{E.pop(),l=E[E.length-1]||null}}}function Qe(ze){if(typeof ze!="function")return()=>{};const je={fn:ze,active:!0,_deps:new Set,_cleanup:null,_runner:null,_running:!1,_queued:!1},ct=()=>{if(!je.active)return;if(je._running){je._queued=!0;return}je._running=!0;let ut=0;try{do if(je._queued=!1,Re(je),ut++,ut>=R){je._queued=!1,console.warn("[JSswift.reactive.effect] loop guard triggered: too many synchronous reruns",{max:R,effect:ze.name||"anonymous"});break}while(je.active&&je._queued)}finally{je._running=!1}};return je._runner=ct,ct(),()=>{je.active&&(je.active=!1,Oe(je))}}function gt(ze){let je=ze;const ct=new Set;function ut(){return l&&l.active&&(ct.add(l._runner),l._deps.add(ct)),je}function kt(Wt){je=Wt,Ae(ct)}function Lt(){ct.clear()}return[ut,kt,Lt]}function ft(ze){if(typeof ze!="function")throw new Error("JSswift.reactive.computed: fn must be a function");const[je,ct,ut]=gt(void 0),kt=Qe(()=>{ct(ze())}),Lt=()=>je();return Lt.dispose=()=>{kt(),ut()},Lt.peek=()=>je(),Lt.type="computed",Lt}function it(ze){if(typeof ze!="function")throw new Error("JSswift.reactive.untracked: fn must be a function");const je=l;l=null;try{return ze()}finally{l=je}}function Fe(ze,je){if(typeof ze!="function")throw new Error("JSswift.reactive.batch: fn must be a function");const ct=Le(je);B===0?D=ct:ct==="microtask"&&(D="microtask"),B+=1;try{return ze()}finally{if(B-=1,B===0){const ut=D==="microtask"||ge==="microtask";D="sync",ut?(ge="microtask",Ce()):we()}}}return{signal:gt,effect:Qe,computed:ft,untracked:it,batch:Fe}})(),ee._overlayShared=(()=>{const l=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function E(ge,q){const pe=ge();if(pe&&pe.isConnected)return pe;let Le=document.getElementById("cms-overlay-root");return!Le&&(document!=null&&document.body)&&(Le=document.createElement("div"),Le.id="cms-overlay-root",Le.className="cms-overlay-root",document.body.appendChild(Le)),!document.body&&!Le&&ee.ready(()=>{let we=document.getElementById("cms-overlay-root");we||(we=document.createElement("div"),we.id="cms-overlay-root",we.className="cms-overlay-root",document.body.appendChild(we)),q(we)}),q(Le),Le}function R(ge){var pe;const q=ge.querySelector(l);(pe=q==null?void 0:q.focus)==null||pe.call(q)}function B(ge,q){if(ge.key!=="Tab")return;const pe=Array.from(q.querySelectorAll(l)).filter(Ae=>Ae.offsetParent!==null);if(!pe.length)return;const Le=pe[0],we=pe[pe.length-1],Ce=document.activeElement;ge.shiftKey&&Ce===Le?(ge.preventDefault(),we.focus()):!ge.shiftKey&&Ce===we&&(ge.preventDefault(),Le.focus())}function D(ge,q){var Ct,Ke,Zt,nn,Wn,co;if(!q.anchorEl)return;const pe=q.anchorEl.getBoundingClientRect(),Le=ge.getBoundingClientRect(),we=window.visualViewport||null,Ce=Math.max(0,Number(we==null?void 0:we.offsetLeft)||0),Ae=Math.max(0,Number(we==null?void 0:we.offsetTop)||0),Oe=Math.max(Number(we==null?void 0:we.width)||0,window.innerWidth||0,((Ct=document.documentElement)==null?void 0:Ct.clientWidth)||0),Re=Math.max(Number(we==null?void 0:we.height)||0,window.innerHeight||0,((Ke=document.documentElement)==null?void 0:Ke.clientHeight)||0),Qe=Number((nn=(Zt=q.viewportGutter)!=null?Zt:q.gutter)!=null?nn:8),gt=Number.isFinite(Qe)?Math.max(0,Qe):8,ft=Number((Wn=q.offsetX)!=null?Wn:0),it=Number((co=q.offsetY)!=null?co:8),Fe=Number.isFinite(ft)?ft:0,ze=Number.isFinite(it)?it:8,je=(xn,rn,mt)=>!Number.isFinite(xn)||(Number.isFinite(rn)||(rn=0),Number.isFinite(mt)||(mt=rn),mt<rn)?rn:Math.min(Math.max(xn,rn),mt),ct=String(q.placement||"bottom-start").toLowerCase(),[ut,kt]=ct.split("-"),Lt=["top","bottom","left","right"].includes(ut)?ut:"bottom",Wt=["start","end","center"].includes(kt)?kt:"start",Ze={top:"bottom",bottom:"top",left:"right",right:"left"}[Lt]||"top",xt=Lt==="top"||Lt==="bottom",_t=Le.width,Jt=Le.height,We=xn=>{let rn=pe.left+Fe,mt=pe.top+ze;return xn==="top"||xn==="bottom"?(Wt==="center"?rn=pe.left+(pe.width-_t)/2+Fe:Wt==="end"&&(rn=pe.right-_t+Fe),mt=xn==="top"?pe.top-Jt-ze:pe.bottom+ze):(Wt==="center"?mt=pe.top+(pe.height-Jt)/2+ze:Wt==="end"&&(mt=pe.bottom-Jt+ze),rn=xn==="left"?pe.left-_t-Fe:pe.right+Fe),{left:rn,top:mt}},nt=xn=>xn==="top"?pe.top-ze-gt:xn==="bottom"?Re-pe.bottom-ze-gt:xn==="left"?pe.left-Fe-gt:Oe-pe.right-Fe-gt,Et=nt(Lt),Ot=nt(Ze),yt=(xt?Jt:_t)>Et&&Ot>Et?Ze:Lt,Ye=We(yt),o=Ce+gt,zt=Ae+gt,te=Math.max(o,Ce+Oe-_t-gt),qt=Math.max(zt,Ae+Re-Jt-gt),ye=je(Ye.left,o,te),Bt=je(Ye.top,zt,qt);ge.style.position="fixed",ge.style.left=`${ye}px`,ge.style.top=`${Bt}px`}return{ensureRoot:E,focusFirst:R,trapFocus:B,applyAnchoredPosition:D}})(),ee.overlay=(()=>{let l=0;const E=new Map;let R=null;const{ensureRoot:B,focusFirst:D,trapFocus:ge,applyAnchoredPosition:q}=ee._overlayShared,pe=()=>B(()=>R,ft=>{R=ft});let Le=0;const we=()=>{Le++,Le===1&&document.documentElement.classList.add("cms-scroll-locked")},Ce=()=>{Le=Math.max(0,Le-1),Le===0&&document.documentElement.classList.remove("cms-scroll-locked")},Ae=()=>{let ft=null;for(const it of E.values())ft=it;return ft},Oe=ft=>{var Fe;let it=ft;for(;it&&it!==document;){if(it.nodeType===1&&((Fe=it.getAttribute)==null?void 0:Fe.call(it,"data-cms-overlay-portal"))==="true")return!0;it=it.parentNode}return!1},Re=(ft,it={})=>{var nt,Et,Ot,vt;const Fe=`ov_${++l}`,ze={id:Fe,opts:it,isOpen:!0,anchorEl:it.anchorEl||null,placement:it.placement||"bottom-start",onClose:typeof it.onClose=="function"?it.onClose:null,overlay:null,panel:null,backdrop:null,reposition:null,_positionCleanup:null,_positionFrame:null,_panelResizeObserver:null,_cleanup:null},je=document.createElement("div");je.className=["cms-overlay",it.type?`type-${it.type}`:""].filter(Boolean).join(" "),je.dataset.id=Fe;const ct=document.createElement("div");ct.className="cms-overlay-backdrop",it.backdrop||(ct.style.display="none");const ut=document.createElement("div");ut.className=["cms-overlay-panel",it.className].filter(Boolean).join(" "),ut.tabIndex=-1;const kt=typeof ft=="function"?ft({close:()=>Qe(Fe)}):ft,Lt=ee.ui.slot(kt);Array.isArray(Lt)?Lt.forEach(yt=>yt&&ut.appendChild(yt)):Lt&&ut.appendChild(Lt),je.appendChild(ct),je.appendChild(ut);const Wt=pe();if(!Wt)return{id:Fe,close:()=>Qe(Fe),panel:ut,overlay:je};Wt.appendChild(je),ze.overlay=je,ze.panel=ut,ze.backdrop=ct,E.set(Fe,ze),it.lockScroll&&we(),it.autoFocus!==!1&&setTimeout(()=>D(ut),0);const Ze=(yt=null)=>{yt&&typeof yt=="object"&&Object.assign(ze.opts,yt),q(ut,ze.opts)},xt=()=>{if(!it.anchorEl)return;const yt=globalThis.requestAnimationFrame||(o=>setTimeout(()=>o(Date.now()),0)),Ye=globalThis.cancelAnimationFrame||clearTimeout;ze._positionFrame!=null&&Ye(ze._positionFrame),ze._positionFrame=yt(()=>{ze._positionFrame=null,Ze()})};if(ze.reposition=Ze,it.anchorEl){Ze(),xt();const yt=()=>Ze();if(window.addEventListener("resize",yt),window.addEventListener("scroll",yt,!0),(Et=(nt=window.visualViewport)==null?void 0:nt.addEventListener)==null||Et.call(nt,"resize",yt),(vt=(Ot=window.visualViewport)==null?void 0:Ot.addEventListener)==null||vt.call(Ot,"scroll",yt),typeof ResizeObserver=="function"){const Ye=new ResizeObserver(()=>Ze());Ye.observe(ut),ze._panelResizeObserver=Ye}ze._positionCleanup=()=>{var o,zt,te,qt,ye,Bt;const Ye=globalThis.cancelAnimationFrame||clearTimeout;ze._positionFrame!=null&&(Ye(ze._positionFrame),ze._positionFrame=null),(zt=(o=ze._panelResizeObserver)==null?void 0:o.disconnect)==null||zt.call(o),ze._panelResizeObserver=null,window.removeEventListener("resize",yt),window.removeEventListener("scroll",yt,!0),(qt=(te=window.visualViewport)==null?void 0:te.removeEventListener)==null||qt.call(te,"resize",yt),(Bt=(ye=window.visualViewport)==null?void 0:ye.removeEventListener)==null||Bt.call(ye,"scroll",yt)}}const _t=yt=>{const Ye=Ae();!Ye||Ye.id!==Fe||it.closeOnOutside!==!1&&(Oe(yt.target)||ut.contains(yt.target)||Qe(Fe))};document.addEventListener("mousedown",_t,!0);const Jt=yt=>{const Ye=Ae();!Ye||Ye.id!==Fe||(it.trapFocus&&ge(yt,ut),yt.key==="Escape"&&it.closeOnEsc!==!1&&(yt.preventDefault(),Qe(Fe)))};document.addEventListener("keydown",Jt,!0),ct.addEventListener("click",()=>{it.closeOnBackdrop!==!1&&Qe(Fe)}),ze._cleanup=()=>{var yt;document.removeEventListener("mousedown",_t,!0),document.removeEventListener("keydown",Jt,!0),(yt=ze._positionCleanup)==null||yt.call(ze)};const We=1e3+E.size*10;return je.style.zIndex=String(We),{id:Fe,close:()=>Qe(Fe),panel:ut,overlay:je,reposition:Ze}},Qe=ft=>{var Fe,ze,je;const it=E.get(ft);it&&(E.delete(ft),(Fe=it._cleanup)==null||Fe.call(it),it.opts.lockScroll&&Ce(),typeof Vt=="function"&&Vt(it.overlay),(ze=it.overlay)==null||ze.remove(),(je=it.onClose)==null||je.call(it))};return{open:Re,close:Qe,closeTop:()=>{const ft=Ae();ft&&Qe(ft.id)},root:R,_stack:E}})();function ps(l,E={}){const{isSVG:R=!1,normalizeClass:B=Fe=>String(Fe!=null?Fe:""),isContentProp:D=()=>!1,autoValueTags:ge=new Set(["INPUT","TEXTAREA","SELECT"])}=E;function q(Fe){if(R||!(Fe in l))return!1;try{return typeof l[Fe]=="boolean"}catch(ze){return!1}}function pe(Fe){return R||Fe.startsWith("data-")||Fe.startsWith("aria-")||!(Fe in l)}function Le(Fe,ze){if(ze==null){l.removeAttribute(Fe);return}if(ze===!1){if(Fe.startsWith("aria-")){l.setAttribute(Fe,"false");return}l.removeAttribute(Fe);return}if(ze===!0&&!R&&!Fe.startsWith("aria-")&&!Fe.startsWith("data-")){l.setAttribute(Fe,"");return}l.setAttribute(Fe,String(ze))}function we(Fe,ze){if(Fe==null)return;const je=String(Fe),ct=je.startsWith("--")||je.includes("-");if(ze==null||ze===!1||ze===""){ct?l.style.removeProperty(je):l.style[je]="";return}if(ct){l.style.setProperty(je,String(ze));return}l.style[je]=ze}function Ce(Fe){const ze=B(Fe);if(ze==null||ze===!1||ze===""){l.removeAttribute("class");return}l.setAttribute("class",String(ze))}function Ae(Fe,ze){const je=!!ze;l[Fe]=je,je?l.setAttribute(Fe,""):l.removeAttribute(Fe)}function Oe(Fe){if(D(Fe)){l[Fe]="";return}if(Fe==="class"){l.removeAttribute("class");return}if(Fe==="style"){l.removeAttribute("style");return}if(q(Fe)){try{l[Fe]=!1}catch(ze){}l.removeAttribute(Fe);return}if(l.removeAttribute(Fe),!pe(Fe))try{typeof l[Fe]=="string"&&(l[Fe]="")}catch(ze){}}function Re(Fe){!Fe||typeof Fe!="object"||Object.entries(Fe).forEach(([ze,je])=>{we(ze,je)})}function Qe(Fe,ze){if(D(Fe)){l[Fe]=ze!=null?ze:"";return}if(Fe==="class"){Ce(ze);return}if(Fe==="style"){if(ze==null||ze===!1){Oe(Fe);return}if(typeof ze=="object"){Re(ze);return}}if(q(Fe)){Ae(Fe,ze);return}if(ze==null||ze===!1){Oe(Fe);return}if(pe(Fe)){Le(Fe,ze);return}l[Fe]=ze}function gt(Fe,ze){const je=String(Fe).split(".");let ct=l;for(let ut=0;ut<je.length-1;ut++)if(ct=ct==null?void 0:ct[je[ut]],!ct)return;ct[je[je.length-1]]=ze}function ft(Fe){return Fe?Fe==="auto"||Fe.startsWith("attr:")||Fe.startsWith("@")||Fe.startsWith("style.")||Fe.includes("."):!1}function it(Fe,ze){if(!Fe||Fe==="auto"){ge.has(l.tagName)?Qe("value",ze):l.textContent=ze!=null?ze:"";return}if(Fe.startsWith("attr:")){Le(Fe.slice(5),ze);return}if(Fe.startsWith("@")){Le(Fe.slice(1),ze);return}if(Fe.startsWith("style.")){we(Fe.slice(6),ze);return}if(Fe.includes(".")){gt(Fe,ze);return}Qe(Fe,ze)}return{isBooleanDomProp:q,isAttributeOnlyProp:pe,isBindingValueKey:ft,setAttributeValue:Le,setStyleEntry:we,setClassValue:Ce,setBooleanProp:Ae,removeProp:Oe,applyStyleObject:Re,setProp:Qe,setPathValue:gt,applyBindingValue:it}}function $n(l){const E=[],R=B=>{if(!(B==null||B===!1)){if(typeof B=="function"){R(B());return}if(B&&B.type==="rod"){R(B.value);return}if(Array.isArray(B)){B.forEach(R);return}if(typeof B=="object"){Object.entries(B).forEach(([D,ge])=>{let q=ge;typeof q=="function"?q=q():q&&q.type==="rod"&&(q=q.value),R(q?D:null)});return}B!==!0&&String(B).split(/\s+/).forEach(D=>{D&&E.push(D)})}};return R(l),E.length?Array.from(new Set(E)).join(" "):""}function gs(l){return l==null||l===!1?!1:typeof l=="function"||l&&l.type==="rod"?!0:Array.isArray(l)?l.some(gs):typeof l=="object"?Object.values(l).some(gs):!1}function ss(l,E){return l==null||l===!1?!1:typeof l=="function"||E(l)?!0:typeof l!="object"||Array.isArray(l)||l.nodeType?!1:Object.values(l).some(R=>ss(R,E))}function os(l,E){let R=l;if(typeof R=="function"?R=R():E(R)&&(R=R.value),!R||typeof R!="object"||Array.isArray(R)||R.nodeType)return null;const B={};return Object.entries(R).forEach(([D,ge])=>{let q=ge;typeof q=="function"?q=q():E(q)&&(q=q.value),B[D]=q}),B}function Is(l){let E=new Set;function R(D){E.forEach(ge=>{D.has(ge)||l(ge,null)}),E=D}function B(D,ge){const q=os(D,ge);if(!q){R(new Set);return}const pe=new Set(Object.keys(q));R(pe),Object.entries(q).forEach(([Le,we])=>{l(Le,we)})}return{apply:B}}function Gs(l){return typeof l=="string"&&(l.startsWith("on:")||l.startsWith("on")&&l.length>2)}const bn=128,Jn=[];function Es(l,E){Jn.push({rod:l,value:String(E!=null?E:"")}),Jn.length>bn&&Jn.splice(0,Jn.length-bn)}function Vn(){if(!Jn.length)return null;const l=Jn.slice();return Jn.length=0,{items:l,index:0}}function is(l,E){if(!E||!l||E.index>=E.items.length)return null;const R=[],B=String(l);let D=0,ge=E.index,q=!1;for(;ge<E.items.length;){const pe=E.items[ge],Le=pe.value;if(!Le)break;const we=B.indexOf(Le,D);if(we===-1)break;we>D&&R.push(B.slice(D,we)),R.push(pe.rod),D=we+Le.length,ge++,q=!0}return q?(D<B.length&&R.push(B.slice(D)),E.index=ge,R):null}function Ks(l){var R;let E="";for(const B of l)typeof B=="string"?E+=B:E+=(R=B==null?void 0:B.value)!=null?R:"";return E}function _o(l){if(l.startsWith("on:"))return l.slice(3);const E=l.slice(2);return E?E==="DoubleClick"?"dblclick":E.toLowerCase():""}function ls(l){return l==null||l===!1?!1:l===!0?{capture:!0}:typeof l=="boolean"?l:typeof l=="object"?{capture:!!l.capture,passive:!!l.passive,once:!!l.once}:!1}function qs(l,E){const R=ls(l),B=ls(E);return typeof R=="boolean"||typeof B=="boolean"?R===B:!!R&&!!B&&R.capture===B.capture&&R.passive===B.passive&&R.once===B.once}function Kn(l,E){return Array.isArray(l)?l.some(R=>Kn(R,E)):E(l)?!0:!l||typeof l!="object"||Array.isArray(l)||l.nodeType?!1:Array.isArray(l.handlers)?l.handlers.some(R=>Kn(R,E))||E(l.options)||typeof l.options=="function":Array.isArray(l.listeners)?l.listeners.some(R=>Kn(R,E))||E(l.options)||typeof l.options=="function":E(l.handler)||E(l.listener)||E(l.fn)||E(l.options)||typeof l.options=="function"}function qn(l,E,R){var B,D,ge,q,pe,Le,we;if(l==null||l===!1)return[];if(typeof l=="function")return[{handler:l,options:ls(R!=null?R:!1)}];if(E(l))return qn(l.value,E,R);if(Array.isArray(l))return l.flatMap(Ce=>qn(Ce,E,R));if(typeof l=="object"&&!Array.isArray(l)&&!l.nodeType){if(Array.isArray(l.handlers)||Array.isArray(l.listeners)){const Oe=l.handlers||l.listeners||[],Re=(D=(B=l.options)!=null?B:R)!=null?D:!1;return Oe.flatMap(Qe=>qn(Qe,E,Re))}let Ce=(pe=(q=(ge=l.handler)!=null?ge:l.listener)!=null?q:l.fn)!=null?pe:null,Ae=(we=(Le=l.options)!=null?Le:R)!=null?we:!1;return E(Ce)&&(Ce=Ce.value),E(Ae)&&(Ae=Ae.value),typeof Ae=="function"&&(Ae=Ae()),typeof Ce=="function"?[{handler:Ce,options:ls(Ae)}]:[]}return[]}function ko(l,E){return qn(l,E)}function Ys(l,E,R,B){const D=_o(E);if(!D)return;const ge={listeners:[]},q=()=>{ge.listeners.forEach(Le=>{l.removeEventListener(D,Le.dispatch,Le.options)}),ge.listeners=[]},pe=Le=>{const we=ko(Le,B);ge.listeners.length===we.length&&ge.listeners.every((Ae,Oe)=>{const Re=we[Oe];return Ae.handler===Re.handler&&qs(Ae.options,Re.options)})||(q(),we.forEach(Ae=>{const Oe={handler:Ae.handler,options:Ae.options,dispatch:null};Oe.dispatch=Re=>{if(typeof Oe.handler=="function"){const Qe=Oe.handler.call(l,Re);return Oe.options&&typeof Oe.options=="object"&&Oe.options.once&&(l.removeEventListener(D,Oe.dispatch,Oe.options),ge.listeners=ge.listeners.filter(gt=>gt!==Oe)),Qe}},l.addEventListener(D,Oe.dispatch,Oe.options),ge.listeners.push(Oe)}))};if(ee._registerCleanup(l,q),B(R)){const Le=ee.reactive.effect(()=>{pe(R.value)});ee._registerCleanup(l,Le);return}if(Kn(R,B)){const Le=ee.reactive.effect(()=>{pe(R)});ee._registerCleanup(l,Le);return}pe(R)}function Xs(l,E={}){const{isRod:R=()=>!1,interpolationCursor:B=null}=E;function D(Ce){const Ae=document.createTextNode(""),Oe=ee.rodBind(Ae,Ce);return ee._registerCleanup(Ae,Oe),Ae}function ge(Ce){l.appendChild(D(Ce))}function q(Ce){const Ae=document.createTextNode("");l.appendChild(Ae);const Oe=ee.reactive.effect(()=>{Ae.textContent=Ks(Ce)});ee._registerCleanup(Ae,Oe)}function pe(Ce){const Ae=[],Oe=Re=>{if(!(Re==null||Re===!1)){if(Array.isArray(Re)){Re.forEach(Oe);return}if(typeof Re=="string"){Ae.push(document.createTextNode(Re));return}if(typeof Re=="number"){Ae.push(document.createTextNode(String(Re)));return}if(typeof Re!="boolean"){if(R(Re)){Ae.push(D(Re));return}if(Re!=null&&Re.nodeType){Ae.push(Re);return}Ae.push(document.createTextNode(String(Re)))}}};return Oe(Ce),Ae}function Le(Ce){const Ae=document.createComment("dyn");l.appendChild(Ae);let Oe=[];const Re=ee.reactive.effect(()=>{Oe.forEach(it=>{Vt(it),it.parentNode&&it.parentNode.removeChild(it)}),Oe=[];const Qe=Ae.parentNode;if(!Qe)return;const gt=pe(Ce());if(!gt.length)return;const ft=document.createDocumentFragment();gt.forEach(it=>ft.appendChild(it)),Qe.insertBefore(ft,Ae.nextSibling),Oe=gt});ee._registerCleanup(Ae,()=>{Re(),Oe.forEach(Qe=>Vt(Qe)),Oe=[]})}function we(Ce){if(Ce!=null){if(Array.isArray(Ce)){for(const Ae of Ce)we(Ae);return}if(typeof Ce=="string"){const Ae=is(Ce,B);Ae?q(Ae):l.appendChild(document.createTextNode(Ce));return}if(typeof Ce=="number"){l.appendChild(document.createTextNode(String(Ce)));return}if(typeof Ce=="function"){Le(Ce);return}if(R(Ce)){ge(Ce);return}Ce.nodeType&&l.appendChild(Ce)}}return{appendRodText:ge,appendInterpolatedText:q,appendDynamicChild:Le,appendChildValue:we}}function Qs(l,E={}){const{el:R,isRod:B=()=>!1,interpolationCursor:D=null,appendChildValue:ge=()=>{},appendRodText:q=()=>{},appendInterpolatedText:pe=()=>{},appendDynamicChild:Le=()=>{},bindProp:we=()=>{}}=E;for(const Ce of l)if(Ce!=null){if(Array.isArray(Ce)){ge(Ce);continue}if(typeof Ce=="string"){const Ae=is(Ce,D);Ae?pe(Ae):R.appendChild(document.createTextNode(Ce));continue}if(typeof Ce=="number"){R.appendChild(document.createTextNode(String(Ce)));continue}if(typeof Ce=="function"){Le(Ce);continue}if(B(Ce)){q(Ce);continue}if(Ce.nodeType){R.appendChild(Ce);continue}if(typeof Ce=="object")for(const[Ae,Oe]of Object.entries(Ce)){if(typeof Oe=="string"){const Re=is(Oe,D);if(Re){we(Ae,()=>Ks(Re));continue}}if(Ae==="class"){we(Ae,Oe);continue}if(Ae==="style"&&typeof Oe=="object"&&Oe!==null&&!B(Oe)){we(Ae,Oe);continue}we(Ae,Oe)}}}const Zs="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 rs(l){return l==="innerHTML"||l==="innerText"||l==="textContent"||l==="value"}function eo(l,...E){const R=zs.has(l),B=l==="text"&&!R?document.createTextNode(""):R?document.createElementNS(Zs,l):document.createElement(l),D=We=>!!We&&We.type==="rod",ge=Vn(),q=Xs(B,{isRod:D,interpolationCursor:ge}),{appendRodText:pe,appendInterpolatedText:Le,appendDynamicChild:we,appendChildValue:Ce}=q,Ae=ps(B,{isSVG:R,normalizeClass:$n,isContentProp:rs}),{isBooleanDomProp:Oe,isBindingValueKey:Re,applyBindingValue:Qe,setStyleEntry:gt,setProp:ft,setClassValue:it}=Ae;function Fe(We){const nt=ee.reactive.effect(We);return ee._registerCleanup(B,nt),nt}function ze(We){if(String((We==null?void 0:We.tagName)||"").toLowerCase()!=="input")return!1;const nt=String((We==null?void 0:We.type)||"").toLowerCase();return nt==="range"||nt==="number"}function je(We){return String((We==null?void 0:We.tagName)||"").toLowerCase()!=="input"?"":String((We==null?void 0:We.type)||"").toLowerCase()}function ct(We){return String((We==null?void 0:We.tagName)||"").toLowerCase()==="select"&&!We.multiple}function ut(We){return String((We==null?void 0:We.tagName)||"").toLowerCase()==="input"&&String((We==null?void 0:We.type)||"").toLowerCase()==="file"}function kt(We,nt,Et){Fe(()=>{var yt;const vt=(yt=nt.value)!=null?yt:"";We.value!==String(vt)&&ft("value",vt)});const Ot=()=>{let vt=We.value;const yt=je(We),Ye=typeof nt.value=="number"||nt.value==null;if(ct(We)&&We.value==="")vt=null;else if(ze(We)&&Ye)if(yt==="number"&&We.value==="")vt=null;else{const o=typeof We.valueAsNumber=="number"&&!Number.isNaN(We.valueAsNumber)?We.valueAsNumber:Number(We.value);vt=Number.isNaN(o)?yt==="number"?null:0:o}nt.value!==vt&&(nt.value=vt)};We.addEventListener(Et,Ot),ee._registerCleanup(We,()=>{We.removeEventListener(Et,Ot)})}function Lt(We,nt){Fe(()=>{const Ot=!!nt.value;!!We.checked!==Ot&&ft("checked",Ot)});const Et=()=>{const Ot=!!We.checked;nt.value!==Ot&&(nt.value=Ot)};We.addEventListener("change",Et),ee._registerCleanup(We,()=>{We.removeEventListener("change",Et)})}function Wt(We,nt){const Et=()=>{var vt;return String((vt=We.value)!=null?vt:"on")};Fe(()=>{const yt=(nt.value==null?null:String(nt.value))===Et();!!We.checked!==yt&&ft("checked",yt)});const Ot=()=>{if(!We.checked)return;const vt=Et();nt.value!==vt&&(nt.value=vt)};We.addEventListener("change",Ot),ee._registerCleanup(We,()=>{We.removeEventListener("change",Ot)})}function Ze(We,nt){const Et=()=>{const vt=We.files;return vt==null?[]:Array.isArray(vt)?vt.slice():typeof vt.length=="number"?Array.from(vt):[vt]};Fe(()=>{const vt=nt.value;(vt==null||Array.isArray(vt)&&vt.length===0)&&(We.value!==""&&ft("value",""),Array.isArray(We.files)&&(We.files=[]))});const Ot=()=>{const vt=Et();nt.value=vt};We.addEventListener("change",Ot),ee._registerCleanup(We,()=>{We.removeEventListener("change",Ot)})}function xt(We,nt){const Et=()=>Array.from(We.childNodes||[]).filter(yt=>(yt==null?void 0:yt.tagName)==="OPTION"&&yt.selected).map(yt=>{var Ye;return String((Ye=yt.value)!=null?Ye:"")}),Ot=()=>{const yt=Array.isArray(nt.value)?nt.value.map(o=>String(o)):[],Ye=new Set(yt);Array.from(We.childNodes||[]).forEach(o=>{var te;if((o==null?void 0:o.tagName)!=="OPTION")return;const zt=Ye.has(String((te=o.value)!=null?te:""));!!o.selected!==zt&&(o.selected=zt,zt?o.setAttribute("selected",""):o.removeAttribute("selected"))})};Fe(Ot),We._cmsApplySelectedValues=Ot,queueMicrotask(Ot);const vt=()=>{const yt=Et(),Ye=Array.isArray(nt.value)?nt.value.map(o=>String(o)):[];Ye.length===yt.length&&Ye.every((o,zt)=>o===yt[zt])||(nt.value=yt)};We.addEventListener("change",vt),ee._registerCleanup(We,()=>{We.removeEventListener("change",vt)})}function _t(We,nt){Fe(()=>{const yt=!!nt.value;!!We.selected!==yt&&ft("selected",yt)});let Et=null;const Ot=()=>{const yt=!!We.selected;nt.value!==yt&&(nt.value=yt)};queueMicrotask(()=>{var yt;Et||((yt=We.parentNode)==null?void 0:yt.tagName)!=="SELECT"||(Et=We.parentNode,Et.addEventListener("change",Ot))}),ee._registerCleanup(We,()=>{Et==null||Et.removeEventListener("change",Ot)})}function Jt(We,nt){if(Gs(We)){Ys(B,We,nt,D);return}if(We==="class"){if(gs(nt)){Fe(()=>{it($n(nt))});return}it($n(nt));return}if(We==="style"&&nt&&typeof nt=="object"){const Et=Is(gt);if(ss(nt,D)){Fe(()=>{Et.apply(nt,D)});return}Et.apply(nt,D);return}if(We==="style"&&(typeof nt=="function"||D(nt))){const Et=Is(gt);Fe(()=>{Et.apply(nt,D)});return}if(Re(We)&&typeof nt=="function"){Fe(()=>{Qe(We,nt())});return}if(Re(We)&&!D(nt)){Qe(We,nt);return}if(typeof nt=="function"){Fe(()=>{ft(We,nt())});return}if(We==="value"&&D(nt)&&(l==="input"||l==="textarea"||l==="select")){if(l==="select"&&B.multiple){xt(B,nt);return}kt(B,nt,l==="select"?"change":"input");return}if(We==="checked"&&D(nt)&&l==="input"){if(String(B.type||"").toLowerCase()==="radio"){Wt(B,nt);return}Lt(B,nt);return}if(We==="files"&&D(nt)&&ut(B)){Ze(B,nt);return}if(We==="selected"&&D(nt)&&l==="option"){_t(B,nt);return}if(rs(We)&&D(nt)){Fe(()=>{ft(We,nt.value)});return}if(D(nt)){const Et=ee.rodBind(B,nt,{key:We});ee._registerCleanup(B,Et);return}ft(We,nt)}return Qs(E,{el:B,isRod:D,interpolationCursor:ge,appendChildValue:Ce,appendRodText:pe,appendInterpolatedText:Le,appendDynamicChild:we,bindProp:Jt}),l==="select"&&typeof B._cmsApplySelectedValues=="function"&&B._cmsApplySelectedValues(),B}const jo={},to=["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"];to.forEach(l=>{window._[l]=(...E)=>eo(l,...E)}),_.DOM_ELEMENTS=to,_.fragment=(...l)=>l,_.dynamic=function(l){const E=document.createComment("dyn"),R=document.createDocumentFragment();R.appendChild(E);let B=null;return ee.reactive.effect(()=>{const D=l();if(B&&B.parentNode&&B.parentNode.removeChild(B),B=null,D==null)return;let ge=D;(typeof D=="string"||typeof D=="number")&&(ge=document.createTextNode(String(D)));const q=E.parentNode;q&&ge&&ge.nodeType&&(q.insertBefore(ge,E.nextSibling),B=ge)}),R};function no(){let l=!1;const E=new Set;function R(){var D,ge,q;l=!1,(D=ee.debug)==null||D.inc("rodFlushes"),(ge=ee.perf)==null||ge.inc("rodFlushes"),(q=ee.perf)==null||q.mark("rod:flush");const B=Array.from(E);E.clear();for(const pe of B)try{pe()}catch(Le){console.error("[rod] flush error:",Le)}}return function(D){E.add(D),l||(l=!0,queueMicrotask(R))}}const Ho=no();function so(l,E,R){if(!l)return;if(l.nodeType===3){l.textContent=R!=null?R:"";return}ps(l,{isSVG:l.namespaceURI===Zs,normalizeClass:$n,isContentProp:rs}).applyBindingValue(E,R)}function No(l){return{type:"rod",value:l,_bindings:[],_actions:[],_disposeHooks:[],_disposed:!1,_silentDepth:0,_pending:!1,bindings(){return this._bindings.map(R=>({el:R.el,key:R.key}))},onDispose(R){return typeof R=="function"&&this._disposeHooks.push(R),this},_bind(R,B={key:"auto"}){var q;if(this._disposed)return()=>{};if(!R)return()=>{};const D={el:R,key:(q=B==null?void 0:B.key)!=null?q:"auto"};return this._bindings.some(pe=>pe.el===D.el&&pe.key===D.key)||this._bindings.push(D),so(D.el,D.key,this.value),()=>{this._bindings=this._bindings.filter(pe=>!(pe.el===D.el&&pe.key===D.key))}},action(R){return!this._disposed&&typeof R=="function"&&this._actions.push(R),this},_setSilent(R){this._silentDepth++;try{this.value=R}finally{this._silentDepth--}return this},_scheduleNotify(){this._disposed||this._pending||(this._pending=!0,Ho(()=>{this._pending=!1,this._notifyNow()}))},_notifyNow(){var B,D,ge,q,pe;if(this._disposed)return;const R=performance.now();(B=ee.perf)==null||B.inc("rodNotifies"),this._bindings=this._bindings.filter(Le=>{const we=Le.el;return we?we.nodeType===3?!!we.parentNode:we.isConnected!==!1:!1});for(const Le of this._bindings)so(Le.el,Le.key,this.value);if(!(this._silentDepth>0)){for(const Le of this._actions)try{Le(this.value)}catch(we){console.error("[rod] action error:",we)}(D=ee.debug)==null||D.inc("rodNotifies"),(pe=ee.perf)==null||pe.tick("rod:notify",performance.now()-R,{bindings:((ge=this._bindings)==null?void 0:ge.length)||0,actions:((q=this._actions)==null?void 0:q.length)||0})}},dispose(){if(!this._disposed){this._disposed=!0;for(const R of this._disposeHooks)try{R()}catch(B){console.error("[rod] dispose hook error:",B)}this._bindings.length=0,this._actions.length=0,this._disposeHooks.length=0}}}}function as(l,E="value"){var q;let R=l[E],B=null,D=null,ge=null;return(q=ee==null?void 0:ee.reactive)!=null&&q.signal&&([B,D,ge]=ee.reactive.signal(R),ge&&typeof l.onDispose=="function"&&l.onDispose(ge)),Object.defineProperty(l,E,{get(){return B?B():R},set(pe){D?D(pe):R=pe,l._scheduleNotify()},configurable:!0}),typeof l.val!="function"&&Object.defineProperty(l,"val",{value(pe){return arguments.length?(this.value=pe,pe):this.value},configurable:!0}),l[Symbol.toPrimitive]||Object.defineProperty(l,Symbol.toPrimitive,{value(pe){const Le=this.value;if(Le==null)return Le;const we=typeof Le;return pe==="number"?Number(Le):(we!=="symbol"&&Es(this,Le),we==="string"||we==="number"||we==="boolean"||we==="bigint"||we==="symbol"?Le:String(Le))},configurable:!0}),l.valueOf||Object.defineProperty(l,"valueOf",{value(){return this.value},configurable:!0}),l.toString||Object.defineProperty(l,"toString",{value(){return String(this.value)},configurable:!0}),l}_.rod=function(E,R="value"){const B=No(E);return as(B,R),ee.rod._all=ee.rod._all||new Set,ee.rod._all.add(B),typeof B.onDispose=="function"&&B.onDispose(()=>ee.rod._all.delete(B)),B},ee.rodBind=function(l,E,R={key:"auto"}){var B,D,ge;if((B=ee.debug)==null||B.inc("rodBinds"),!l)return(D=ee.debug)==null||D.inc("rodBindNull"),(ge=ee.debug)==null||ge.warn("rodBind: target element \xE8 null/undefined",R),()=>{};if(!E||E.type!=="rod")throw new Error("JSswift.rodBind: react must be a rod object");return E._bind(l,R)},ee.rodFromSignal=function(l,E){const R=_.rod(l());let B=!1;const D=ee.reactive.effect(()=>{const q=R.value,pe=ee.reactive.untracked(()=>l());if(!B&&pe!==q){B=!0;try{E(q)}finally{B=!1}}}),ge=ee.reactive.effect(()=>{const q=l();if(ee.reactive.untracked(()=>R.value)!==q){B=!0;try{R._setSilent(q)}finally{B=!1}}});return typeof R.onDispose=="function"&&(R.onDispose(D),R.onDispose(ge)),R};function In(l){if(!l||!l.tagName)return null;const E=l.tagName.toLowerCase();if(E==="input"){const R=(l.type||"text").toLowerCase();return R==="checkbox"?"checkbox":R==="radio"?"radio":R==="number"?"number":"text"}return E==="select"?l.multiple?"select-multiple":"select":null}ee.rodModel=function(l,E,R={}){var Ce,Ae,Oe;if(!E||E.type!=="rod")throw new Error("[JSswift.rodModel] rodObj deve essere un rod");const B=Array.isArray(l)||l instanceof NodeList?Array.from(l):[l],D=(Ce=R.event)!=null?Ce:"change",ge=(Ae=R.parse)!=null?Ae:(Re=>Re),q=(Oe=R.format)!=null?Oe:(Re=>Re);let pe=!1;const Le=[],we=Re=>{for(const Qe of B){if(!Qe)continue;switch(In(Qe)){case"checkbox":Qe.checked=!!Re;break;case"radio":Qe.checked=Qe.value==Re;break;case"select":Qe.value=Re!=null?Re:"";break;case"select-multiple":const ft=Array.isArray(Re)?Re.map(String):[];for(const it of Qe.options)it.selected=ft.includes(it.value);break;default:Qe.value=Re!=null?Re:""}}};E.action(Re=>{if(!pe){pe=!0;try{we(q(Re))}finally{pe=!1}}}),we(q(E.value));for(const Re of B){if(!Re)continue;const Qe=In(Re),gt=()=>{if(pe)return;let ft;switch(Qe){case"checkbox":ft=Re.checked;break;case"radio":if(!Re.checked)return;ft=Re.value;break;case"select":ft=Re.value;break;case"select-multiple":ft=Array.from(Re.selectedOptions).map(it=>it.value);break;case"number":ft=ge(Re.value===""?null:Number(Re.value));break;default:ft=ge(Re.value)}pe=!0;try{E.value!==ft&&(E.value=ft)}finally{pe=!1}};Re.addEventListener(D,gt),Le.push(()=>Re.removeEventListener(D,gt))}return typeof E.onDispose=="function"&&E.onDispose(()=>Le.forEach(Re=>Re())),()=>Le.forEach(Re=>Re())},ee.signalModel=function(l,E,R,B={}){const D=ee.rodFromSignal(E,R);return ee.rodModel(l,D,B)};function Vt(l){if(!l)return;const E=ee._cleanupRegistry.get(l);if(E){for(const R of E)try{R()}catch(B){console.error("[cleanup] error:",B)}ee._cleanupRegistry.delete(l)}if(l.childNodes&&l.childNodes.length)for(const R of l.childNodes)Vt(R)}function Ao(l){const E=R=>typeof R=="string"?ee.dom.q(R):R;return Array.isArray(l)?l.map(E).filter(Boolean):[E(l)].filter(Boolean)}function ys(l){const E=[],R=[],B=D=>{if(D!=null){if(typeof D=="function"){B(D());return}if(D&&typeof D=="object"&&"node"in D){typeof D.dispose=="function"&&R.push(D.dispose),B(D.node);return}if(Array.isArray(D)){for(const ge of D)B(ge);return}if(typeof D=="string"||typeof D=="number"){E.push(document.createTextNode(String(D)));return}if(D.nodeType){E.push(D);return}console.warn("[JSswift.mount] contenuto non supportato:",D)}};return B(l),{nodes:E,disposers:R}}function Yn(l=[],E="[JSswift.mount] dispose error:"){let R=!1;return()=>{if(!R){R=!0;for(const B of l)try{B()}catch(D){console.error(E,D)}}}}function bs(l=[],E=null){return Yn([...E?[E]:[],...l],"[component] dispose error:")}ee.mount=function(l,E,R={}){var Le;const B=Ao(l),D=(Le=R.clear)!=null?Le:!0,ge=B.length>1;if(B.length===0)return console.warn("[JSswift.mount] nessun target valido:",l),()=>{};const q=[];for(const we of B){if(D)for(;we.firstChild;)Vt(we.firstChild),we.removeChild(we.firstChild);const{nodes:Ce,disposers:Ae}=ys(E);let Oe=Ce;ge&&typeof E!="function"&&(Oe=Ce.map(Qe=>Qe.cloneNode(!0)),Ae.length&&console.warn("[JSswift.mount] multi-target con dispose: usa content come function per istanze separate."));const Re=Yn(Ae);for(const Qe of Oe)we.appendChild(Qe);q.push({root:we,nodes:Oe,dispose:Re});for(const Qe of Oe)!Qe||!Qe.nodeType||ee._registerCleanup(Qe,Re)}return()=>{var we;for(const Ce of q){for(const Ae of Ce.nodes)Ae&&(Vt(Ae),Ae.parentNode===Ce.root&&Ce.root.removeChild(Ae));(we=Ce.dispose)==null||we.call(Ce)}}},ee.component=function(l){if(typeof l!="function")throw new Error("JSswift.component: renderFn must be a function");return function(R={}){const B=[],ge=l(R,{onDispose(q){typeof q=="function"&&B.push(q)}});return ge&&typeof ge=="object"&&"node"in ge?{node:ge.node,dispose:bs(B,typeof ge.dispose=="function"?ge.dispose:null)}:{node:ge,dispose:bs(B)}}},ee.enableAutoCleanup=function(){if(ee._autoCleanupEnabled)return;ee._autoCleanupEnabled=!0;const l=new MutationObserver(E=>{for(const R of E)for(const B of R.removedNodes)Vt(B)});l.observe(document.body,{childList:!0,subtree:!0}),ee._cleanupObserver=l},ee.debug=(()=>{const l={rodFlushes:0,rodNotifies:0,rodBinds:0,rodBindNull:0,rodBindDup:0};function E(){return!!ee.config.debug}function R(...Le){E()&&console.log("[JSswift]",...Le)}function B(...Le){E()&&console.warn("[JSswift]",...Le)}function D(...Le){console.error("[JSswift]",...Le)}function ge(Le,we=1){l[Le]||(l[Le]=0),l[Le]+=we}function q(){return{...l}}function pe(){for(const Le of Object.keys(l))l[Le]=0}return{enabled:E,log:R,warn:B,error:D,inc:ge,stats:q,reset:pe}})(),ee.perf=(()=>{let l=!1;const E={effectsRun:0,effectsSlow:0,rodNotifies:0,rodFlushes:0,domWrites:0,httpRequests:0},R=[],B=[],D={timelineMax:200,slowEffectMs:8};function ge(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function q(je,ct=0,ut=null){l&&(R.push({t:Date.now(),type:je,ms:ct,meta:ut}),R.length>D.timelineMax&&R.shift())}function pe(je,ct=1){l&&(E[je]=(E[je]||0)+ct)}function Le(je,ct){l&&(B.push({t:Date.now(),ms:je,meta:ct}),B.length>100&&B.shift())}let we=null;function Ce(){we||(we=ee.reactive.effect,ee.reactive.effect=function(je,ct){return we((...kt)=>{const Lt=ge();pe("effectsRun");try{return je(...kt)}finally{const Wt=ge()-Lt;Wt>=D.slowEffectMs?(pe("effectsSlow"),Le(Wt,ct||je.name||"effect"),q("effect:slow",Wt,ct||je.name||null)):q("effect",Wt,ct||je.name||null)}})})}function Ae(){we&&(ee.reactive.effect=we,we=null)}function Oe(je=!0){return l=!!je,l?Ce():Ae(),l}function Re(){for(const je of Object.keys(E))E[je]=0;R.length=0,B.length=0}function Qe(){return{enabled:l,...E,slowEffectMs:D.slowEffectMs,timelineSize:R.length}}function gt(){return R.slice()}function ft(je=D.slowEffectMs){return B.filter(ct=>ct.ms>=je).slice().sort((ct,ut)=>ut.ms-ct.ms)}function it(je,ct){const ut=ge();try{return ct()}finally{const kt=ge()-ut;q("time:"+je,kt,je)}}function Fe(je,ct){q(je,0,ct)}function ze(je,ct,ut){q(je,ct,ut)}return{enable:Oe,reset:Re,stats:Qe,timeline:gt,slowEffects:ft,time:it,mark:Fe,tick:ze,inc:pe,cfg:D}})(),ee.rod=ee.rod||{},ee.rod.inspect=function(l,E="rod"){if(!l||l.type!=="rod")return console.warn("[JSswift.rod.inspect] non \xE8 un rod:",l),null;const R=typeof l.bindings=="function"?l.bindings():[],B={label:E,value:l.value,bindingsCount:R.length,bindings:R.map(D=>{var ge,q,pe,Le,we,Ce,Ae;return{key:D.key,el:((ge=D.el)==null?void 0:ge.nodeType)===3?"#text":(q=D.el)==null?void 0:q.tagName,id:((pe=D.el)==null?void 0:pe.id)||null,className:((Le=D.el)==null?void 0:Le.className)||null,isConnected:((we=D.el)==null?void 0:we.nodeType)===3?!!D.el.parentNode:(Ae=(Ce=D.el)==null?void 0:Ce.isConnected)!=null?Ae:null}}),actionsCount:Array.isArray(l._actions)?l._actions.length:null,disposed:!!l._disposed};return ee.config.debug?(console.groupCollapsed(`[JSswift.rod.inspect] ${E}`),console.log(B),console.groupEnd()):console.log(B),B},ee.rod.inspectAll=function(){const l=ee.rod._all?Array.from(ee.rod._all):[];return l.forEach((E,R)=>ee.rod.inspect(E,`rod#${R+1}`)),l.length},ee._storeShared=(()=>{function l(ge){return`${ge.storage}::${ge.prefix}`}function E(ge,q){function pe(Ae={}){var Re,Qe;const Oe={storage:(Re=Ae.storage)!=null?Re:ge.storage,prefix:(Qe=Ae.prefix)!=null?Qe:ge.prefix};return q.set(l(Oe),Oe),Oe}function Le(Ae=null){var Re;return(typeof Ae=="string"?Ae:(Re=Ae==null?void 0:Ae.storage)!=null?Re:ge.storage)==="session"?window.sessionStorage:window.localStorage}function we(Ae,Oe=null){return(Oe||pe()).prefix+Ae}function Ce(Ae,Oe=null){const Re=Oe||pe();return`${l(Re)}::${Ae}`}return{getScope:pe,getStorage:Le,fullKey:we,channelKey:Ce}}function R(ge){try{return JSON.parse(ge)}catch(q){return}}function B(ge){try{return JSON.stringify(ge)}catch(q){return}}function D(ge,...q){const pe=`${ge.storage}::${ge.prefix}::`;for(const Le of q)for(const we of Array.from(Le.keys()))we.startsWith(pe)&&Le.delete(we)}return{createScopeTools:E,safeParse:R,safeStringify:B,clearScopedMapEntries:D}})(),ee.store=(()=>{const l={prefix:"JSswift:",storage:"local",syncTabs:!0,writeDelay:0},E=new Map,R=new Map,B=new Map,D=new Map;let ge=!1;const{createScopeTools:q,safeParse:pe,safeStringify:Le,clearScopedMapEntries:we}=ee._storeShared,{getScope:Ce,getStorage:Ae,fullKey:Oe,channelKey:Re}=q(l,D);function Qe(Ze,xt,_t=null){var nt;const Jt=_t||Ce(),We=R.get(Re(Ze,Jt));if(We)for(const Et of We)try{(nt=ee.reactive)!=null&&nt.untracked?ee.reactive.untracked(()=>Et(xt)):Et(xt)}catch(Ot){console.error("[store] watcher error:",Ot)}}function gt(){ge=!1;for(const[Ze,xt]of Array.from(B.entries())){B.delete(Ze);const _t=E.get(Ze),Jt=Le(_t);if(Jt===void 0)continue;const We=Ae(xt.scope);try{We.setItem(Oe(xt.key,xt.scope),Jt)}catch(nt){console.error("[store] write error:",nt)}}}function ft(Ze,xt=null){const _t=xt||Ce();B.set(Re(Ze,_t),{key:Ze,scope:_t}),!ge&&(ge=!0,l.writeDelay>0?setTimeout(gt,l.writeDelay):queueMicrotask(gt))}function it(Ze,xt=null){const _t=xt||Ce(),We=Ae(_t).getItem(Oe(Ze,_t));if(We!=null)return pe(We)}function Fe(Ze,xt,_t=null){const Jt=_t||Ce(),We=Re(Ze,Jt);if(E.has(We))return E.get(We);const nt=it(Ze,Jt);return nt!==void 0?(E.set(We,nt),nt):xt}function ze(Ze,xt,_t=null){const Jt=_t||Ce();return E.set(Re(Ze,Jt),xt),ft(Ze,Jt),Qe(Ze,xt,Jt),xt}function je(Ze,xt=null){const _t=xt||Ce(),Jt=Re(Ze,_t);E.delete(Jt),B.delete(Jt);try{Ae(_t).removeItem(Oe(Ze,_t))}catch(We){}Qe(Ze,void 0,_t)}function ct(Ze={}){const xt=Ce(Ze),_t=Ae(xt),Jt=[];for(let We=0;We<_t.length;We++){const nt=_t.key(We);nt&&nt.startsWith(xt.prefix)&&Jt.push(nt)}for(const We of Jt)_t.removeItem(We);we(xt,E,B,R)}function ut(Ze,xt,_t=null){if(typeof xt!="function")return()=>{};const Jt=_t||Ce(),We=Re(Ze,Jt);return R.has(We)||R.set(We,new Set),R.get(We).add(xt),()=>{var nt;return(nt=R.get(We))==null?void 0:nt.delete(xt)}}function kt(Ze,xt,_t={}){const Jt=Ce({storage:_t.storage,prefix:_t.prefix}),We=Fe(Ze,xt,Jt),[nt,Et,Ot]=ee.reactive.signal(We),vt=ee.reactive.effect(()=>{const o=nt();ze(Ze,o,Jt)}),yt=ut(Ze,o=>{nt()!==o&&Et(o)},Jt);return[nt,Et,()=>{try{vt==null||vt()}catch(o){}try{yt==null||yt()}catch(o){}try{Ot==null||Ot()}catch(o){}}]}Ce(),l.syncTabs&&window.addEventListener("storage",Ze=>{if(!(!Ze.key||!Ze.storageArea))for(const xt of D.values()){if(Ae(xt)!==Ze.storageArea||!Ze.key.startsWith(xt.prefix))continue;const _t=Ze.key.slice(xt.prefix.length),Jt=Ze.newValue==null?void 0:pe(Ze.newValue),We=Re(_t,xt);Jt===void 0?E.delete(We):E.set(We,Jt),Qe(_t,Jt,xt)}});function Lt(Ze={}){Object.assign(l,Ze),Ce()}function Wt(){return{prefix:l.prefix,storage:l.storage,syncTabs:l.syncTabs,cacheSize:E.size,scopeCount:D.size}}return{configure:Lt,stats:Wt,get:Fe,set:ze,remove:je,clear:ct,watch:ut,signal:kt}})(),ee.store.computed=function(l){if(typeof l!="function")throw new Error("store.computed: fn must be a function");return ee.reactive.computed(l)},ee.store.migrate=function(l,E,R={}){var pe,Le;const B=(pe=R.versionKey)!=null?pe:"__version",D=Number((Le=ee.store.get(B,0))!=null?Le:0),ge=Number(l!=null?l:0);if(!Number.isFinite(ge)||ge<0)throw new Error("store.migrate: targetVersion non valido");if(D>=ge)return{from:D,to:ge,applied:0};let q=0;for(let we=D;we<ge;we++){const Ce=E==null?void 0:E[we];if(typeof Ce=="function")try{Ce(ee.store)}catch(Ae){console.error("[store.migrate] step error at version",we,Ae)}q++,ee.store.set(B,we+1)}return{from:D,to:ge,applied:q}},ee.store.model=function(l,E,R,B={}){if(typeof E!="string"||!E)throw new Error("store.model: key deve essere una stringa non vuota");const[D,ge,q]=ee.store.signal(E,R,{storage:B.storage,prefix:B.prefix}),pe=ee.rodFromSignal(D,ge),Le=ee.rodModel(l,pe,{event:B.event,parse:B.parse,format:B.format});return()=>{var we;try{Le==null||Le()}catch(Ce){}try{q==null||q()}catch(Ce){}try{(we=pe.dispose)==null||we.call(pe)}catch(Ce){}}},ee.store.bind=function(l,E,R,B={}){var ge;let D=l;return typeof l=="string"&&(l.includes("[")||l.includes(" ")?D=document.querySelectorAll(l):D=ee.dom.q(l)),D?ee.store.model(D,E,R,B):((ge=ee.config)!=null&&ge.debug&&console.warn("[store.bind] target non trovato:",l),()=>{})},ee.store.bindAll=function(l,E={},R={}){if(typeof l=="string"&&(l=ee.dom.q(l)),!l||!l.querySelectorAll)return console.warn("[store.bindAll] form non valido:",l),()=>{};const B=[];for(const[D,ge]of Object.entries(E)){const q=l.querySelectorAll(`[name="${D}"]`);if(!q.length)continue;const pe=ee.store.model(q.length===1?q[0]:q,D,ge,R);B.push(pe)}return()=>B.forEach(D=>D())},ee.store.inspect=function(){const l={...ee.store.stats(),keys:Array.from((function(){const E=ee.store.stats().storage==="session"?sessionStorage:localStorage,R=[];for(let B=0;B<E.length;B++){const D=E.key(B);D&&D.startsWith(ee.store.stats().prefix)&&R.push(D.replace(ee.store.stats().prefix,""))}return R})())};return console.groupCollapsed("[JSswift.store.inspect]"),console.table(l.keys),console.log(l),console.groupEnd(),l},ee.store.autoForm=function(l,E={},R={}){var D;const B=ee.store.bindAll(l,E,R);return(D=ee.config)!=null&&D.debug&&console.log("[store.autoForm] autosave attivo:",E),B},ee.useStore=function(l,E,R,B={}){const[D,ge,q]=ee.store.signal(l,E,B);return R&&typeof R.onDispose=="function"&&typeof q=="function"&&R.onDispose(q),[D,ge]},ee._plugins=new Set,ee.usePlugin=function(l,E){var R;if(l){if(ee._plugins.has(l)){(R=ee.config)!=null&&R.debug&&console.warn("[JSswift.usePlugin] plugin gi\xE0 installato:",l.name||l);return}if(typeof l=="function"){l(ee,E),ee._plugins.add(l);return}if(l&&typeof l.install=="function"){l.install(ee,E),ee._plugins.add(l);return}console.warn("[JSswift.usePlugin] plugin non valido:",l)}},ee.plugins=ee.plugins||{},ee.plugins.debug={install(l){l.config.debug=!0,console.log("[JSswift] Debug mode ON")}},ee.plugins.forms={install(l){const E={};l.forms={validate(R,B={},D={}){var Ce,Ae;if(typeof R=="string"&&(R=l.dom.q(R)),!R||!R.querySelectorAll)return console.warn("[forms.validate] form non valido:",R),null;const ge={mode:D.mode||"input",showMessages:(Ce=D.showMessages)!=null?Ce:!0,submitGuard:(Ae=D.submitGuard)!=null?Ae:!0,errorClass:D.errorClass||"is-invalid",validClass:D.validClass||"is-valid",messageClass:D.messageClass||"form-error"},q={};for(const[Oe,Re]of Object.entries(B)){const Qe=R.querySelectorAll(`[name="${Oe}"]`);if(!Qe.length)continue;const[gt,ft]=l.reactive.signal(null);q[Oe]={getErr:gt,setErr:ft,els:Qe};let it=null;ge.showMessages&&(it=document.createElement("div"),it.className=ge.messageClass,Qe[Qe.length-1].after(it));const Fe=()=>{let ze;const je=Qe[0];if(je.type==="checkbox")ze=je.checked;else if(je.type==="radio"){const kt=Array.from(Qe).find(Lt=>Lt.checked);ze=kt?kt.value:null}else ze=je.value;let ct=!0;try{ct=Re(ze)}catch(kt){ct=kt.message||"Errore di validazione"}const ut=ct===!0?null:typeof ct=="string"?ct:"Valore non valido";return ft(ut),!ut};for(const ze of Qe)ze.addEventListener(ge.mode,Fe);l.reactive.effect(()=>{const ze=gt();for(const je of Qe)je.classList.toggle(ge.errorClass,!!ze),je.classList.toggle(ge.validClass,!ze);it&&(it.textContent=ze||"",it.style.display=ze?"block":"none")}),Fe()}const pe=l.store.computed(()=>Object.values(q).every(Oe=>!Oe.getErr())),Le=Oe=>{let Re=!0;for(const Qe of Object.values(q)){const gt=Qe.els[0];gt&>.dispatchEvent(new Event(ge.mode,{bubbles:!0})),Qe.getErr()&&(Re=!1)}!Re&&ge.submitGuard&&(Oe.preventDefault(),Oe.stopPropagation())};ge.submitGuard&&R.addEventListener("submit",Le);const we=()=>{ge.submitGuard&&R.removeEventListener("submit",Le)};return E[R]={isValid:pe,dispose:we},{isValid:pe,dispose:we}}}}},ee._authShared=(()=>{function l(B){const D=()=>{var q;return((q=B())==null?void 0:q.roles)||[]},ge=()=>{var q;return((q=B())==null?void 0:q.permissions)||[]};return{roles:D,perms:ge,hasRole:q=>D().includes(q),can:q=>ge().includes(q),canAny:q=>q.some(pe=>D().includes(pe)||ge().includes(pe)),canAll:q=>q.every(pe=>D().includes(pe)||ge().includes(pe))}}function E(B,D){return D.some(ge=>typeof ge=="string"?B.startsWith(ge):ge instanceof RegExp?ge.test(B):!1)}function R(B,D){if(!B||!D)return;let ge=!1;function q(){return Date.now()}function pe(Oe){if(!Oe||typeof Oe!="string")return null;const Re=Oe.split(".");if(Re.length<2)return null;try{const Qe=Re[1].replace(/-/g,"+").replace(/_/g,"/"),gt=decodeURIComponent(atob(Qe).split("").map(ft=>"%"+ft.charCodeAt(0).toString(16).padStart(2,"0")).join(""));return JSON.parse(gt)}catch(Qe){return null}}function Le(){var Oe,Re,Qe,gt;if(typeof D._getState=="function"){const ft=D._getState();return ft&&typeof ft=="object"?ft:{user:(Re=(Oe=D.user)==null?void 0:Oe.call(D))!=null?Re:null}}return{user:(gt=(Qe=D.user)==null?void 0:Qe.call(D))!=null?gt:null}}function we(){var Fe,ze,je;const Oe=Le()||{},Re=(ze=Oe.user)!=null?ze:(Fe=D.user)==null?void 0:Fe.call(D),Qe=(Re==null?void 0:Re.name)||(Re==null?void 0:Re.email)||(Re==null?void 0:Re.id)||"anon",gt=!!((je=D.isAuth)!=null&&je.call(D)),ft=Oe.expiresAt||null,it=ft?ft-q():null;return gt?`AUTH \u2705 user=${Qe}${ft?` expiresIn=${Math.round(it/1e3)}s`:""}`:`AUTH \u274C user=${Qe}`}function Ce(Oe="auth"){var Lt,Wt,Ze;const Re=Le()||{},Qe=(Wt=Re.user)!=null?Wt:(Lt=D.user)==null?void 0:Lt.call(D),gt=(Qe==null?void 0:Qe.roles)||[],ft=(Qe==null?void 0:Qe.permissions)||[],it=Re.accessToken||null,Fe=Re.refreshToken||null,ze=it?pe(it):null,je=Re.expiresAt||(ze!=null&&ze.exp?ze.exp*1e3:null),ct=q(),ut=je?je-ct:null,kt={label:Oe,isAuth:!!((Ze=D.isAuth)!=null&&Ze.call(D)),user:Qe,roles:gt,permissions:ft,has:{role:xt=>{var _t;return!!((_t=D.hasRole)!=null&&_t.call(D,xt))},can:xt=>{var _t;return!!((_t=D.can)!=null&&_t.call(D,xt))}},token:{hasAccess:!!it,hasRefresh:!!Fe,expiresAt:je,expiresInSec:ut==null?null:Math.round(ut/1e3),decodedJWT:ze}};return console.groupCollapsed(`[JSswift.auth.inspect] ${Oe}`),console.log("status:",we()),console.log(kt),ut!=null&&(ut<=0?console.warn("\u26A0\uFE0F Access token scaduto."):ut<6e4&&console.warn("\u26A0\uFE0F Access token in scadenza (<60s).")),console.groupEnd(),kt}function Ae(Oe=!0){ge=!!Oe,console.log("[JSswift.auth.trace]",ge?"ON":"OFF")}if(typeof D.fetch=="function"&&!D._fetchWrapped){const Oe=D.fetch.bind(D);D.fetch=async(...Re)=>{const Qe=await Oe(...Re);if(ge)try{console.log("[auth.fetch]",Qe.status,Re[0])}catch(gt){}return Qe},D._fetchWrapped=!0}D.decodeJWT=pe,D.status=we,D.inspect=Ce,D.trace=Ae}return{createPermissionApi:l,matchesProtectedPath:E,attachDevTools:R}})(),ee.plugins.auth={install(l,E={}){var ct;const{createPermissionApi:R,matchesProtectedPath:B,attachDevTools:D}=ee._authShared,ge={key:E.key||"auth",loginRoute:E.loginRoute||"/login",protected:E.protected||[],autoRedirect:(ct=E.autoRedirect)!=null?ct:!0,endpoints:E.endpoints||{login:"/api/login",refresh:"/api/refresh",logout:"/api/logout"},fetchOptions:E.fetchOptions||{},tokenHeader:E.tokenHeader||"Authorization",tokenPrefix:E.tokenPrefix||"Bearer ",refreshMargin:E.refreshMargin||3e4},[q,pe]=l.store.signal(ge.key,null),Le=()=>{var ut;return((ut=q())==null?void 0:ut.user)||null},we=()=>{var ut;return!!((ut=q())!=null&&ut.accessToken)},{hasRole:Ce,can:Ae,canAny:Oe,canAll:Re}=R(Le);let Qe=!1,gt=[];function ft(){const ut=q();return ut!=null&&ut.expiresAt?Date.now()>ut.expiresAt-ge.refreshMargin:!1}async function it(){var ut;if(Qe)return new Promise((kt,Lt)=>gt.push({res:kt,rej:Lt}));Qe=!0;try{const kt=await fetch(ge.endpoints.refresh,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:(ut=q())==null?void 0:ut.refreshToken})});if(!kt.ok)throw new Error("Refresh failed");const Lt=await kt.json();return pe({...q(),...Lt}),gt.forEach(Wt=>Wt.res(!0)),gt=[],!0}catch(kt){throw gt.forEach(Lt=>Lt.rej(kt)),gt=[],pe(null),ge.autoRedirect&&l.router.navigate(ge.loginRoute),kt}finally{Qe=!1}}async function Fe(ut){const kt=await fetch(ge.endpoints.login,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(ut)});if(!kt.ok)throw new Error("Login failed");const Lt=await kt.json();return pe(Lt),Lt}async function ze(){try{await fetch(ge.endpoints.logout,{method:"POST"})}catch(ut){}pe(null),ge.autoRedirect&&l.router.navigate(ge.loginRoute)}async function je(ut,kt={}){var xt;ft()&&await it();const Lt=q(),Wt=new Headers(kt.headers||{});Lt!=null&&Lt.accessToken&&Wt.set(ge.tokenHeader,ge.tokenPrefix+Lt.accessToken);const Ze=await fetch(ut,{...ge.fetchOptions,...kt,headers:Wt});return Ze.status===401&&((xt=q())!=null&&xt.refreshToken)&&!kt._authRetried?(await it(),je(ut,{...kt,_authRetried:!0})):Ze}l.router.beforeEach(ut=>{const kt=ut.path;return B(kt,ge.protected)&&!we()?ge.loginRoute:!0}),l.auth={user:Le,isAuth:we,hasRole:Ce,can:Ae,canAny:Oe,canAll:Re,loginAsync:Fe,logoutAsync:ze,fetch:je,_getState:q},l.useAuth=function(ut){return ut&&ut.onDispose,l.auth},D(ee,l.auth)}},ee._httpShared=(()=>{function l(we){var Jt;const Ce=we.reactive,[Ae,Oe]=Ce.signal(0),[Re,Qe]=Ce.signal("idle"),[gt,ft]=Ce.signal(null),[it,Fe]=Ce.signal(null),[ze,je]=Ce.signal(null),[ct,ut]=Ce.signal(0),[kt,Lt]=Ce.signal(0);let Wt=0;function Ze(We){const nt=++Wt,Et=Date.now();return Oe(Ae()+1),Qe("pending"),je(null),Fe(null),ft({id:nt,url:We.url,method:We.method,meta:We.meta,timeout:We.timeout,retry:We.retry,startedAt:Et}),Lt(Et),nt}function xt(We,nt,Et,Ot){const vt=Date.now();Oe(Math.max(0,Ae()-1)),We===Wt&&(Et?(Qe("error"),je(Et),Fe(null)):nt?(Qe("success"),je(null),Fe({id:We,status:nt.status,ok:nt.ok,headers:nt.headers,url:nt.url,receivedAt:vt,raw:nt})):(Qe("idle"),je(null),Fe(null)),ut(Math.max(0,Number(Ot||0)))),Lt(vt)}return{state:{inFlight:Ae,status:Re,isLoading:(Jt=we.store)!=null&&Jt.computed?we.store.computed(()=>Ae()>0):()=>Ae()>0,lastRequest:gt,lastResponse:it,lastError:ze,lastDuration:ct,lastUpdated:kt,reset(){Oe(0),Qe("idle"),ft(null),Fe(null),je(null),ut(0),Lt(Date.now())}},markStart:Ze,markEnd:xt}}function E(we,Ce){if(!we||/^https?:\/\//i.test(Ce))return Ce;const Ae=we.endsWith("/")?we.slice(0,-1):we,Oe=Ce.startsWith("/")?Ce:"/"+Ce;return Ae+Oe}function R(we){return new Promise(Ce=>setTimeout(Ce,we))}function B(we,Ce){return we?!0:Ce?Ce.status===429||Ce.status>=500&&Ce.status<=599:!1}function D(we,Ce){if(!we&&!Ce)return{signal:void 0,cancel:()=>{}};const Ae=new AbortController,Oe=Ae.signal;let Re=null;we>0&&(Re=setTimeout(()=>Ae.abort(new Error("timeout")),we));const Qe=()=>Ae.abort(Ce.reason||new Error("aborted"));return Ce&&(Ce.aborted?Qe():Ce.addEventListener("abort",Qe,{once:!0})),{signal:Oe,cancel:()=>{var ft;Re&&clearTimeout(Re),Ce&&((ft=Ce.removeEventListener)==null||ft.call(Ce,"abort",Qe))}}}function ge(we,Ce,Ae={}){var gt,ft,it;const Oe=typeof Ce=="string"?E(we.baseURL,Ce):Ce,Re=(Ae.method||"GET").toUpperCase(),Qe=new Headers(we.headers);return Ae.headers&&new Headers(Ae.headers).forEach((Fe,ze)=>Qe.set(ze,Fe)),{url:Oe,method:Re,headers:Qe,body:Ae.body,credentials:(gt=Ae.credentials)!=null?gt:we.credentials,signal:Ae.signal,timeout:(ft=Ae.timeout)!=null?ft:we.timeout,retry:(it=Ae.retry)!=null?it:we.retry,meta:Ae.meta||{}}}async function q(we,...Ce){var Oe;let Ae=Ce[0];for(const Re of we)Ae=(Oe=await Re(Ae,...Ce.slice(1)))!=null?Oe:Ae;return Ae}function pe(we,Ce){return{ok:we.ok,status:we.status,headers:we.headers,raw:we,req:Ce,async json(){let Ae=null,Oe=null;try{Ae=await we.json()}catch(Re){Ae=null}return we.ok||(Oe=Ae!=null?Ae:{status:we.status}),{data:Ae,error:Oe,ok:we.ok,status:we.status}},async jsonStrict(){const{data:Ae,error:Oe}=await this.json();if(Oe){const Re=new Error(`HTTP error ${we.status} ${(Ce==null?void 0:Ce.method)||""} ${(Ce==null?void 0:Ce.url)||""}`.trim());throw Re.status=we.status,Re.data=Ae,Re.req={url:Ce==null?void 0:Ce.url,method:Ce==null?void 0:Ce.method,meta:Ce==null?void 0:Ce.meta},Re}return{data:Ae,ok:!0,status:we.status}},async text(){let Ae="";try{Ae=await we.text()}catch(Oe){}return{text:Ae,ok:we.ok,status:we.status}},async textStrict(){const Ae=await this.text();if(!Ae.ok){const Oe=new Error("HTTP error "+we.status);throw Oe.status=we.status,Oe.text=Ae.text,Oe}return Ae}}}function Le(we,Ce,Ae,Oe,Re={}){const Qe=new Headers(Re.headers||{});return Qe.has("Content-Type")||Qe.set("Content-Type","application/json"),we(Ae,{...Re,method:Ce,headers:Qe,body:Oe==null?void 0:JSON.stringify(Oe)})}return{createReactiveState:l,joinURL:E,sleep:R,isRetryable:B,makeAbort:D,normalizeRequest:ge,runHooks:q,wrapResponse:pe,withJSON:Le}})();const{createReactiveState:Rn,sleep:Bn,isRetryable:ws,makeAbort:vs,normalizeRequest:cs,runHooks:Ts,wrapResponse:oo,withJSON:Xn}=ee._httpShared,jn=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{},io={baseURL:((Fs=jn.http)==null?void 0:Fs.baseURL)||"",timeout:(ao=(ro=jn.http)==null?void 0:ro.timeout)!=null?ao:0,retry:((Nt=jn.http)==null?void 0:Nt.retry)||{attempts:0,delay:250,factor:2},headers:((Cs=jn.http)==null?void 0:Cs.headers)||{},credentials:(J=jn.http)==null?void 0:J.credentials,debug:(Hn=jn.debug)!=null?Hn:!1},Ps=Rn(ee),Ss=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now(),En={beforeRequest:new Set,afterResponse:new Set,onError:new Set};async function lo(l){const E=ee.auth&&typeof ee.auth.fetch=="function"?ee.auth.fetch.bind(ee.auth):fetch,R={method:l.method,headers:l.headers,body:l.body,credentials:l.credentials,signal:l.signal};return E(l.url,R)}async function gn(l,E={}){var Re,Qe,gt;let R=cs(io,l,E);R=await Ts(En.beforeRequest,R);const B=Ps.markStart(R),D=Ss(),ge=R.retry||{attempts:0,delay:250,factor:2},q=Math.max(0,Number(ge.attempts||0));let pe=Math.max(0,Number(ge.delay||0));const Le=Math.max(1,Number(ge.factor||2));let we=null,Ce=null,Ae=null,Oe=null;try{for(let ft=0;ft<=q;ft++){we=null,Ce=null;const{signal:it,cancel:Fe}=vs(R.timeout,E.signal),ze={...R,signal:it},je=Ss();try{io.debug&&console.log("[http.request]",ze.method,ze.url),(Re=ee.perf)==null||Re.inc("httpRequests"),(Qe=ee.perf)==null||Qe.mark("http:req",{url:R.url,method:R.method});const ct=await lo(ze);Ce=ct;const ut=await Ts(En.afterResponse,ct,ze),kt=Ss()-je;if((gt=ee.perf)==null||gt.tick("http:res",kt,{status:ct.status,url:R.url}),ft<q&&ws(null,ut)){Fe(),await Bn(pe),pe=Math.round(pe*Le);continue}return Fe(),Ae=ut,oo(ut,ze)}catch(ct){we=ct,Fe();for(const ut of En.onError)try{ut(ct,ze)}catch(kt){}if(ft<q&&ws(ct,null)){await Bn(pe),pe=Math.round(pe*Le);continue}throw Oe=ct,ct}}}finally{const ft=Ss()-D;Ps.markEnd(B,Ae,Oe,ft)}if(we)throw we;return oo(Ce,R)}ee.http={},ee.http.request=gn,ee.http.state=()=>Ps.state,ee.http.get=(l,E)=>gn(l,{...E,method:"GET"}),ee.http.del=(l,E)=>gn(l,{...E,method:"DELETE"}),ee.http.post=(l,E,R)=>Xn(gn,"POST",l,E,R),ee.http.put=(l,E,R)=>Xn(gn,"PUT",l,E,R),ee.http.patch=(l,E,R)=>Xn(gn,"PATCH",l,E,R),ee.http.getJSON=async(l,E)=>(await gn(l,{...E,method:"GET"})).jsonStrict(),ee.http.delJSON=async(l,E)=>(await gn(l,{...E,method:"DELETE"})).jsonStrict(),ee.http.postJSON=async(l,E,R)=>(await Xn(gn,"POST",l,E,R)).jsonStrict(),ee.http.putJSON=async(l,E,R)=>(await Xn(gn,"PUT",l,E,R)).jsonStrict(),ee.http.patchJSON=async(l,E,R)=>(await Xn(gn,"PATCH",l,E,R)).jsonStrict(),ee.http.onBefore=function(l){return En.beforeRequest.add(l),()=>En.beforeRequest.delete(l)},ee.http.onAfter=function(l){return En.afterResponse.add(l),()=>En.afterResponse.delete(l)},ee.http.onError=function(l){return En.onError.add(l),()=>En.onError.delete(l)},window._http=ee.http,ee.useRouter=function(l){const E=ee.router;return l&&l.onDispose,{navigate:E.navigate,back:()=>history.back(),forward:()=>history.forward(),get current(){return E}}},ee.useRoute=function(l){const[E,R]=ee.reactive.signal(""),[B,D]=ee.reactive.signal({}),[ge,q]=ee.reactive.signal({}),[pe,Le]=ee.reactive.signal(""),we=Ae=>{R(Ae.path||""),D(Ae.params||{}),q(Ae.query||{}),Le(Ae.hash||"")},Ce=ee.router.subscribe(we);return l&&typeof l.onDispose=="function"&&l.onDispose(Ce),{path:E,params:B,query:ge,hash:pe}},ee._routerShared=(()=>{function l(pe){return pe?(pe.startsWith("/")||(pe="/"+pe),pe.length>1&&pe.endsWith("/")&&(pe=pe.slice(0,-1)),pe):"/"}function E(pe,Le=""){if(Le&&pe.startsWith(Le)){const we=pe.slice(Le.length)||"/";return l(we)}return l(pe)}function R(pe){pe=l(pe);const Le=[],we=pe.replace(/([.+*?=^!${}()[\]|/\\])/g,"\\$1").replace(/\\\/:([A-Za-z0-9_]+)/g,(Ce,Ae)=>(Le.push(Ae),"\\/([^\\/]+)"));return{pattern:pe,regex:new RegExp("^"+we+"$"),keys:Le}}function B(pe){const Le={};return new URLSearchParams(pe||"").forEach((Ce,Ae)=>{Le[Ae]===void 0?Le[Ae]=Ce:Array.isArray(Le[Ae])?Le[Ae].push(Ce):Le[Ae]=[Le[Ae],Ce]}),Le}function D(pe){const Le=[];for(const we of pe)if(Le.push({...we,_parent:null}),we.children&&we.children.length)for(const Ce of we.children)Le.push({...Ce,_parent:we});return Le.sort((we,Ce)=>Ce.path.length-we.path.length),Le}function ge(pe,Le){const we=l(pe),Ce=D(Le);for(const Ae of Ce){const Oe=Ae._compiled.regex.exec(we);if(!Oe)continue;const Re={};return Ae._compiled.keys.forEach((Qe,gt)=>{Re[Qe]=decodeURIComponent(Oe[gt+1])}),{route:Ae,params:Re,parent:Ae._parent||null}}return null}function q(pe,Le,we=50){pe.push({at:Date.now(),path:Le.path,params:Le.params,query:Le.query,hash:Le.hash}),pe.length>we&&pe.shift()}return{normalizePath:l,stripBase:E,compilePattern:R,parseQuery:B,flattenRoutes:D,matchRoute:ge,pushHistoryEntry:q}})(),ee._uiMetaShared=(()=>{function l(q){return{hasTabPanel:typeof q.TabPanel=="function",Card:typeof q.Card=="function"?q.Card:(...pe)=>q.div({class:"cms-doc-card"},...pe),Chip:typeof q.Chip=="function"?q.Chip:(pe,Le)=>q.span({class:"cms-chip cms-chip-fallback"},Le)}}function E(q){return q?Array.isArray(q)?q.join(" | "):String(q):"\u2014"}function R(q,pe,Le){return q.div({class:"cms-doc-meta"},q.div({class:"cms-doc-meta-head"},q.div({class:"cms-doc-meta-name"},pe.name),q.div({class:"cms-doc-meta-types"},...pe.type?String(pe.type).split("|").map(we=>Le({color:"secondary",dense:!0,outline:!0},we)):[q.span("\u2014")])),q.div({class:"cms-doc-meta-grid"},q.div({class:"cms-doc-meta-block"},q.div({class:"cms-doc-meta-label"},"Default"),q.div({class:"cms-doc-meta-value"},pe.default==null?"\u2014":String(pe.default))),q.div({class:"cms-doc-meta-block"},q.div({class:"cms-doc-meta-label"},"Values"),q.div({class:"cms-doc-meta-value"},E(pe.values)))),q.div({class:"cms-doc-meta-block"},q.div({class:"cms-doc-meta-label"},"Description"),q.div({class:"cms-doc-meta-value"},pe.description||"\u2014")))}function B(q,pe){return q.div({class:"cms-doc-fallback"},pe.map(Le=>q.div({class:"cms-doc-fallback-item"},q.h4({class:"cms-doc-fallback-title"},Le.label||Le.name),Le.content)))}function D(q,pe){return pe?Array.isArray(pe)?pe.map(Le=>({name:Le.name,wrap:!0,label:Le.name,content:q.div({class:"cms-p-md"},Le.description)})):Object.entries(pe).map(([Le,we])=>({name:Le,wrap:!0,label:Le,content:q.div({class:"cms-p-md"},we)})):[]}function ge(q,pe){return pe?Array.isArray(pe)?pe.map(Le=>({name:Le.name,wrap:!0,label:Le.type,content:Le.description})):Object.entries(pe).map(([Le,we])=>({name:Le,wrap:!0,label:Le,content:q.div({class:"cms-doc-meta"},q.div({class:"cms-doc-meta-head"},q.div({class:"cms-doc-meta-name"},Le)),q.div({class:"cms-doc-meta-grid"},q.div({class:"cms-doc-meta-block"},q.div({class:"cms-doc-meta-label"},"Type"),q.div({class:"cms-doc-meta-value"},we.type||"\u2014"))),q.div({class:"cms-doc-meta-block"},q.div({class:"cms-doc-meta-label"},"Description"),q.div({class:"cms-doc-meta-value"},we.description||"\u2014")))})):[]}return{resolveDocComponents:l,renderMetaItem:R,renderTabGroupFallback:B,normalizeEventRows:D,normalizeSlotRows:ge}})(),ee.ui=ee.ui||{},ee.ui.meta=ee.ui.meta||{},ee.ui.slot=function(E,R={}){const B=ee.ui,{as:D="node",wrap:ge="span",iconProps:q=null,filter:pe=!0}=R,Le=Oe=>document.createTextNode(String(Oe)),we=Oe=>_.span(String(Oe)),Ce=Oe=>{if(Oe==null||Oe===!1)return null;if(typeof Oe=="function")return Oe;if(Array.isArray(Oe))return Oe.flatMap(Ce).filter(Boolean);if(Oe&&typeof Oe=="object"&&Oe.nodeType)return Oe;if(typeof Oe=="string"||typeof Oe=="number"||typeof Oe=="boolean"){const Re=String(Oe);return D==="icon"&&B.Icon?B.Icon(Re,{class:"cms-slot-icon",...q||{}}):ge==="text"?Le(Re):ge==="span"?we(Re):Re}return ge==="text"?Le(Oe):ge==="span"?we(Oe):String(Oe)},Ae=Ce(E);return pe&&Array.isArray(Ae)?Ae.filter(Boolean):Ae},ee.ui.slots=function(...E){const R=[];for(const B of E){const D=ee.ui.slot(B);D&&(Array.isArray(D)?R.push(...D):R.push(D))}return R},ee.docTable=l=>{var it;if(!ee.isDev())return _.div();const{resolveDocComponents:E,renderMetaItem:R,renderTabGroupFallback:B,normalizeEventRows:D,normalizeSlotRows:ge}=ee._uiMetaShared,q=(it=ee.ui.meta)==null?void 0:it[l];if(!q)return _.div({class:"cms-muted"},`Meta non trovata: ${l}`);const{hasTabPanel:pe,Card:Le,Chip:we}=E(_),Ce={};Object.entries(q.props||{}).forEach(([Fe,ze])=>{const je=ze.category||"general";Ce[je]||(Ce[je]=[]),Ce[je].push({name:Fe,...ze})});const Ae=Object.keys(Ce).map(Fe=>{const ze=Ce[Fe].map(je=>({name:je.name,wrap:!0,label:je.name,content:R(_,je,we)}));return{name:Fe,wrap:!0,label:Fe,content:pe?_.TabPanel({orientation:"vertical",animated:!0,radius:"0 0 0 var(--cms-r-default)",tabs:ze}):B(_,ze)}}),Oe=D(_,q.events),Re=ge(_,q.slots),Qe=_.rod(null),gt=[];Re.length&>.push({name:"Slots",wrap:!0,label:"Slots",content:pe?_.TabPanel({animated:!0,radius:"0 0 0 var(--cms-r-default)",orientation:"vertical",tabs:Re}):B(_,Re)}),Ae.length&>.push(...Ae),Oe.length&>.push({name:"Events",wrap:!0,label:"Events",content:pe?_.TabPanel({animated:!0,radius:"0 0 0 var(--cms-r-default)",orientation:"vertical",tabs:Oe}):B(_,Oe)});const ft="general";return gt.sort((Fe,ze)=>Fe.name===ft?-1:ze.name===ft?1:Fe.name.localeCompare(ze.name)),Le({class:"cms-doc-table"},_.div({class:"cms-doc-table-header"},_.div({class:"cms-doc-table-title"},`_.${l}`),q.signature?_.div({class:"cms-doc-table-signature"},String(q.signature).replaceAll("UI.","_.")):null),gt.length?_.h4({class:"cms-doc-table-section-title"},Ae.length?"Props":"Documentation"):_.p({class:"cms-muted"},"Nessuna documentazione strutturata disponibile."),gt.length?pe?_.TabPanel({border:!0,animated:!0,orientation:"horizontal",tabs:gt,model:Qe}):B(_,gt):null,q.returns?_.p({class:"cms-muted",style:{marginTop:"14px"}},`Returns: ${q.returns}`):null)},ee.ui.inspect=l=>{var E;return console.log(((E=ee.ui.meta)==null?void 0:E[l])||"meta not found")},ee.ui.can=function(l,E,R,B=null){var q,pe;const D=ee.useAuth?ee.useAuth(l):ee.auth;return D?(typeof E=="function"?!!E(D):((q=D.can)==null?void 0:q.call(D,E))||((pe=D.hasRole)==null?void 0:pe.call(D,E)))?typeof R=="function"?R():R:typeof B=="function"?B():B:typeof B=="function"?B():null},ee.ui.canAny=function(l,E,R,B=null){var q;const D=ee.useAuth?ee.useAuth(l):ee.auth;return!!((q=D==null?void 0:D.canAny)!=null&&q.call(D,E))?typeof R=="function"?R():R:typeof B=="function"?B():B},ee.ui.canAll=function(l,E,R,B=null){var q;const D=ee.useAuth?ee.useAuth(l):ee.auth;return!!((q=D==null?void 0:D.canAll)!=null&&q.call(D,E))?typeof R=="function"?R():R:typeof B=="function"?B():B},ee.Can=function(E,R){var ge,q;const B=ee.useAuth?ee.useAuth(R):ee.auth;return(()=>{var pe,Le,we,Ce;return B?E.when&&typeof E.when=="function"?!!E.when(B):E.perm?!!((pe=B.can)!=null&&pe.call(B,E.perm)):E.role?!!((Le=B.hasRole)!=null&&Le.call(B,E.role)):E.any?!!((we=B.canAny)!=null&&we.call(B,E.any)):E.all?!!((Ce=B.canAll)!=null&&Ce.call(B,E.all)):!1:!1})()?typeof E.then=="function"?E.then():(ge=E.then)!=null?ge:null:typeof E.else=="function"?E.else():(q=E.else)!=null?q:null},ee.router=(()=>{let l="history",E=[],R=null,B=null,D="",ge=null,q=null,pe=[],Le=!1;const{normalizePath:we,stripBase:Ce,compilePattern:Ae,parseQuery:Oe,matchRoute:Re,pushHistoryEntry:Qe}=ee._routerShared,gt={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 ft(Ye,{replace:o=!1}={}){const zt=typeof Ye=="string"?new URL(Ye,window.location.origin):Ye,te=zt.pathname+zt.search+zt.hash;if(l==="hash"||l==="auto"){if(history.pushState){const ye="#"+te;o?history.replaceState({},"",ye):history.pushState({},"",ye);return}const qt="#"+te;o?window.location.replace(qt):window.location.hash=qt;return}o?history.replaceState({},"",D+te):history.pushState({},"",D+te)}function it(){if(l==="hash"){const Ye=window.location.hash||"#/",o=Ye.startsWith("#")?Ye.slice(1):Ye;return new URL(o,window.location.origin)}if(l==="auto"&&window.location.hash.startsWith("#/")){const Ye=window.location.hash.slice(1);return new URL(Ye,window.location.origin)}return new URL(window.location.href)}function Fe(Ye,o=!1){if(l==="hash"||l==="auto"&&!history.pushState){const zt="#"+(Ye.pathname+Ye.search+Ye.hash);o?window.location.replace(zt):window.location.hash=zt;return}o?history.replaceState({},"",D+Ye.pathname+Ye.search+Ye.hash):history.pushState({},"",D+Ye.pathname+Ye.search+Ye.hash)}function ze(Ye){l=Ye||"history"}function je(Ye){return Ce(Ye,D)}function ct(Ye){if(!Ye)return!1;const o=q?q.path:je(it().pathname);let zt=Ye;typeof zt=="string"&&(zt.includes("?")||zt.includes("#")||zt.includes("://"))&&(zt=new URL(zt,window.location.origin).pathname);const te=je(zt);return te.includes(":")?Ae(te).regex.test(o):te===o}async function ut(Ye,{replace:o=!1}={}){if(!R){console.warn("[router] outlet non impostato. Usa JSswift.router.setOutlet('#app').");return}const zt=typeof Ye=="string"?new URL(Ye,window.location.origin):Ye;Le&&console.log("[router.navigate]",zt.toString());const te=zt.pathname+zt.search+zt.hash;Fe(zt,o);const qt=je(zt.pathname),ye=Re(qt,E),Bt={path:qt,fullPath:te,params:ye?ye.params:{},query:Oe(zt.search),hash:zt.hash||"",navigate:kt,outlet:R};if(ge){const nn=await ge(Bt);if(nn===!1)return;if(typeof nn=="string"){kt(nn,{replace:!0});return}}if(typeof B=="function"){try{B()}catch(nn){console.error("[router] unmount error:",nn)}B=null}if(!ye){const nn=E._notFound;nn?B=ee.mount(R,()=>nn(Bt),{clear:!0}):B=ee.mount(R,_.div("404"),{clear:!0}),nt(Bt),q=Bt,Qe(pe,Bt);return}const Ct=ye.route.view,Ke=ye.parent;let Zt=null;if(Bt.renderChild=nn=>{if(!Bt._child)return null;const Wn=typeof nn=="string"?Bt.outlet.querySelector(nn):nn;return Wn?(Zt=ee.mount(Wn,()=>Bt._child.view(Bt._child.ctx),{clear:!0}),Zt):(console.warn("[router] child outlet non trovato:",nn),null)},Ke){const nn=ye.route,Wn={...Bt,params:{...Bt.params}};Bt._child={view:nn.view,ctx:Wn},B=ee.mount(R,()=>Ke.view(Bt),{clear:!0})}else Bt._child=null,B=ee.mount(R,()=>Ct(Bt),{clear:!0});nt(Bt),q=Bt,Qe(pe,Bt)}function kt(Ye,o={}){const zt=new URL(Ye,window.location.origin);ut(zt,o)}function Lt(){window.addEventListener("popstate",()=>{ut(it(),{replace:!0})}),window.addEventListener("hashchange",()=>{(l==="hash"||l==="auto")&&ut(it(),{replace:!0})}),document.addEventListener("click",Ye=>{var Bt,Ct;const o=(Ct=(Bt=Ye.target)==null?void 0:Bt.closest)==null?void 0:Ct.call(Bt,"a");if(!o||Ye.defaultPrevented||Ye.button!==0||Ye.metaKey||Ye.ctrlKey||Ye.shiftKey||Ye.altKey||o.hasAttribute("download")||o.target&&o.target!=="_self")return;const zt=o.getAttribute("href");if(!zt||zt.startsWith("mailto:")||zt.startsWith("tel:"))return;const te=new URL(zt,window.location.origin);if(te.origin!==window.location.origin)return;const qt=new URL(window.location.href);te.pathname+te.search===qt.pathname+qt.search&&te.hash||(Ye.preventDefault(),kt(te.pathname+te.search+te.hash))}),ut(it(),{replace:!0})}function Wt(Ye){return R=typeof Ye=="string"?ee.dom.q(Ye):Ye,R}function Ze(Ye){D=Ye?we(Ye):"",D==="/"&&(D="")}function xt(Ye,o,zt=null){const te=Ae(Ye),qt={path:te.pattern,view:o,_compiled:te,children:[]};if(Array.isArray(zt))for(const ye of zt){const[Bt,Ct,Ke]=ye,Zt=we(te.pattern+"/"+(Bt||"").replace(/^\//,""));qt.children.push({path:Zt,view:Ct,_compiled:Ae(Zt),children:Array.isArray(Ke)?Ke:[]})}E.push(qt)}function _t(Ye){E._notFound=Ye}function Jt(Ye){ge=Ye}let We=new Set;function nt(Ye){for(const o of We)try{o(Ye)}catch(zt){console.error("[router] listener error:",zt)}}function Et(){if(!q)return"ROUTER \u23F3 not ready";const Ye=Object.keys(q.query||{}).length?"?":"";return`ROUTER ${q.path}${Ye} ${q.hash||""}`}function Ot(Ye="router"){if(!q)return console.warn("[router.inspect] nessuna route attiva"),null;const o={label:Ye,mode:typeof l!="undefined"?l:"unknown",base:D,path:q.path,params:q.params,query:q.query,hash:q.hash,outlet:R,timestamp:new Date().toISOString()};return console.groupCollapsed(`[JSswift.router.inspect] ${Ye}`),console.log(o),console.log("history:",pe.slice()),console.groupEnd(),o}function vt(Ye=!0){Le=!!Ye,console.log("[JSswift.router.trace]",Le?"ON":"OFF")}function yt(){return pe.slice()}return{meta:gt,setOutlet:Wt,setBase:Ze,add:xt,setURLOnly:ft,notFound:_t,beforeEach:Jt,start:Lt,navigate:kt,isActive:ct,subscribe(Ye){return We.add(Ye),()=>We.delete(Ye)},current(){return it?it():new URL(window.location.href)},status:Et,inspect:Ot,trace:vt,history:yt}})(),(us=ee.config)!=null&&us.debug&&(window.$router=ee.router),ee.signal=ee.reactive.signal,ee.effect=ee.reactive.effect,ee.computed=ee.reactive.computed,ee.untracked=ee.reactive.untracked,ee.batch=ee.reactive.batch;function Qn(l){return l==null?null:String(l).trim()||null}function wn(l){const E=Array.isArray(l)?l:typeof l=="string"?l.split(","):[],R=[],B=new Set;for(const D of E){const ge=Qn(D);!ge||B.has(ge)||(B.add(ge),R.push(ge))}return R}function Js(){var l;return typeof document!="undefined"&&document.documentElement?document.documentElement:(l=ee.dom)!=null&&l.q?ee.dom.q("html"):null}function Ne(){try{return typeof globalThis!="undefined"&&globalThis.localStorage||null}catch(l){return null}}function Cn(){var l;return Qn((l=ee.theme)==null?void 0:l.storageKey)||"jsswift:theme"}function Rs(){const l=Ne();if(!l)return null;try{return Qn(l.getItem(Cn()))}catch(E){return null}}function Lo(l){const E=Ne();if(E)try{l==null?E.removeItem(Cn()):E.setItem(Cn(),l)}catch(R){}}function Ms(l){var B,D,ge,q,pe;const E=Js(),R=[l,(B=ee.theme)==null?void 0:B.themes,(D=ee.config)==null?void 0:D.themes,typeof globalThis!="undefined"?(ge=globalThis.JSswift_setting)==null?void 0:ge.themes:null,typeof globalThis!="undefined"?(q=globalThis.JSswift_setting)==null?void 0:q.themeList:null,(pe=E==null?void 0:E.getAttribute)==null?void 0:pe.call(E,"data-themes")];for(const Le of R){const we=wn(Le);if(we.length)return we}return[]}ee.theme=ee.theme||{},ee.theme.storageKey=Cn(),wn(ee.theme.themes).length||(ee.theme.themes=Ms()),ee.setTheme=function(l,E={}){const R=Qn(l),B=Js();return B&&(R==null?B.removeAttribute("data-theme"):B.setAttribute("data-theme",R)),E.persist!==!1&&Lo(R),B},ee.getTheme=function(l={}){var D;const E=Js(),R=Qn((D=E==null?void 0:E.getAttribute)==null?void 0:D.call(E,"data-theme"));if(R)return R;if(l.storage===!1)return null;const B=Rs();return B&&E&&l.sync!==!1&&E.setAttribute("data-theme",B),B},ee.toggleTheme=function(l,E={}){const R=Ms(l),B=R.length?R:wn([ee.getTheme({sync:!1}),"light","dark"]),D=ee.getTheme({sync:!1}),ge=Qn(E.fallback)||B[0]||"light",q=D?B.indexOf(D):-1,pe=q>=0?B[(q+1)%B.length]:ge;return ee.theme.themes=B.slice(),ee.setTheme(pe,E),pe};const Io=Rs();Io&&ee.setTheme(Io,{persist:!1})})(),(function(bt){var ci;bt.ui=bt.ui||{},bt.services=bt.services||{},bt.services.notify=bt.services.notify||{};const ps=Symbol("cms.ui.rodPathRaw"),$n=Symbol("cms.ui.rodPathEnhanced"),gs=Symbol("cms.ui.rodPathPatchedH"),ss=Symbol("cms.ui.rodPathWrappedUI"),os=new WeakMap,Is=new WeakMap,Gs=new WeakMap,bn=[],Jn=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},Es=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"},Vn=t=>{if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};let is=!1;const Ks=()=>{is||(is=!0,queueMicrotask(()=>{is=!1,bn.length=0}))},_o=t=>{bn.push(t),bn.length>128&&bn.splice(0,bn.length-128),Ks()},ls=()=>{if(!bn.length)return null;const t=bn.slice();return bn.length=0,{items:t,index:0}},qs=(t,e)=>{if(!t)return null;const n=t.items[t.index];return!n||!Object.is(n.value,e)?null:(t.index+=1,n)},Kn=t=>t&&typeof t=="object"&&t[ps]?t[ps]:t,qn=(t,e)=>{const n=os.get(t);if(!n)return;let s=n.rawGet();for(const i of e){if(s==null)return;s=s[i]}return s},ko=(t,e,n)=>{const s=os.get(t);if(!s)return;const i=Kn(n);if(!e.length){if(Object.is(s.rawGet(),i))return;s.rawSet(i);return}let c=s.rawGet();(!c||typeof c!="object")&&(c=Jn(e[0])?[]:{});let x=c;for(let d=0;d<e.length-1;d++){const r=e[d];let w=x[r];if(!w||typeof w!="object"){const F=e[d+1];w=Jn(F)?[]:{},x[r]=w}x=w}Object.is(x[e[e.length-1]],i)||(x[e[e.length-1]]=i,s.rawSet(c))},Ys=(t,e)=>[()=>qn(t,e),n=>ko(t,e,n)],Xs=(t,e,n=[])=>{if(!e||typeof e!="object")return e;let s=Is.get(t);s||(s=new WeakMap,Is.set(t,s));const i=s.get(e);if(i)return i;const c=new Proxy(e,{get(x,d,r){if(d===ps)return x;const w=Reflect.get(x,d,r);if(typeof d=="symbol")return w;const F=n.concat(d);return w&&typeof w=="object"?Xs(t,w,F):typeof w=="function"?w.bind(r):(Es(w)&&_o({rod:t,path:F,value:w}),w)},set(x,d,r,w){const F=Kn(r),S=Reflect.get(x,d,w);if(Object.is(S,F))return!0;const b=Reflect.set(x,d,F,w);if(b){const P=os.get(t);P==null||P.rawSet(P.rawGet())}return b},deleteProperty(x,d){const r=Reflect.has(x,d),w=Reflect.deleteProperty(x,d);if(w&&r){const F=os.get(t);F==null||F.rawSet(F.rawGet())}return w}});return s.set(e,c),c},Qs=t=>{if(!t||typeof t!="object"||t.type!=="rod"||t[$n])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,Kn(i));return os.set(t,{rawGet:n,rawSet:s}),Object.defineProperty(t,"value",{get(){const i=n();return!i||typeof i!="object"?i:Xs(t,i,[])},set(i){s(i)},configurable:!0}),Object.defineProperty(t,$n,{value:!0,configurable:!1}),t},Zs=()=>{if(typeof window._.rod!="function"||window._.rod[$n])return;const t=window._.rod,e=function(...s){return Qs(t(...s))};Object.defineProperty(e,$n,{value:!0,configurable:!1}),window._.rod=e};bt.ui.withoutRodPathCapture=t=>{const e=bn.length;try{return t()}finally{bn.length=e}};const zs=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const x=t.map(d=>{const r=zs(d,e,"");return r!==d&&(c=!0),r});return c?x:t}if(Es(t)){const c=qs(e,t);return c?n==="model"?Ys(c.rod,c.path):()=>qn(c.rod,c.path):t}if(!Vn(t))return t;let s=!1;const i={};for(const c of Object.keys(t)){const x=zs(t[c],e,c);i[c]=x,x!==t[c]&&(s=!0)}return s?i:t},rs=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const x=t.map(d=>{const r=rs(d,e,"");return r!==d&&(c=!0),r});return c?x:t}if(Es(t)){const c=qs(e,t);return c?n==="model"?Ys(c.rod,c.path):()=>qn(c.rod,c.path):t}if(!Vn(t))return t;let s=!1;const i={};for(const c of Object.keys(t)){const d=c==="model"||c==="children"?rs(t[c],e,c):t[c];i[c]=d,d!==t[c]&&(s=!0)}return s?i:t},eo=t=>{if(typeof t!="function"||t[ss])return t;const e=Gs.get(t);if(e)return e;const n=function(...i){const c=ls();if(!c)return t.apply(this,i);let x=!1;const d=i.map(r=>{const w=rs(r,c,"");return w!==r&&(x=!0),w});return t.apply(this,x?d:i)};return Object.defineProperty(n,ss,{value:!0,configurable:!1}),Gs.set(t,n),n},jo=()=>{const t=bt.ui;if(!(!t||t[ss])){Object.defineProperty(t,ss,{value:!0,configurable:!1});for(const e of Object.keys(t))typeof t[e]=="function"&&(t[e]=eo(t[e]));bt.ui=new Proxy(t,{get(e,n,s){return Reflect.get(e,n,s)},set(e,n,s,i){const c=typeof s=="function"?eo(s):s;return Reflect.set(e,n,c,i)}})}},to=()=>{if(!window._||window._[gs])return;Object.defineProperty(window._,gs,{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 c=ls();if(!c)return n.apply(this,i);let x=!1;const d=i.map(r=>{const w=zs(r,c,"");return w!==r&&(x=!0),w});return n.apply(this,x?d:i)})}};Zs(),((ci=JSswift.rod)==null?void 0:ci._all)instanceof Set&&JSswift.rod._all.forEach(t=>Qs(t)),to(),jo();const no={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},Ho=new Set(Object.values(no)),so=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),No=new Set(["none","sm","md","lg"]),as={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"}},In=t=>{if(t.indexOf("-")>-1)return!0},Vt=t=>{if(!t)return"";const e=String(t).toLowerCase();return no[e]||""},Ao=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":so.has(e)?e:null},ys=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return No.has(e)?e:null},Yn=t=>t&&typeof t=="object"&&!t.nodeType&&!Array.isArray(t)&&!(t instanceof Function),bs=t=>t&&t.nodeType===1&&String(t.tagName||"").toLowerCase()==="li",Rn=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];JSswift.isUIPlainObject=Yn,JSswift.isListItemNode=bs,JSswift.asNodeArray=Rn;const Bn=[{key:"mobile",aliases:["mobile","mobil"],prefix:"cms-"},{key:"tablet",aliases:["tablet"],prefix:"cms-tablet-"},{key:"pc",aliases:["pc","desktop"],prefix:"cms-pc-"}],ws=Bn.flatMap(t=>t.aliases),vs=(t,e)=>Object.prototype.hasOwnProperty.call(t||{},e),cs=(t={},e)=>{if(!e)return null;for(const n of e.aliases){if(!vs(t,n))continue;const s=o(t[n]);if(Yn(s))return s}return null},Ts=(t={},e)=>{const n=Array.isArray(e)?e:[e];return Bn.some(s=>{const i=cs(t,s);return!!i&&n.some(c=>vs(i,c))})},oo=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),Xn=(t={},e=[])=>{const n=[];for(const s of Bn){const i=cs(t,s);if(i)for(const c of e){const x=Array.isArray(c.prop)?c.prop:[c.prop];let d=!1,r,w="";for(const b of x)if(vs(i,b)){r=o(i[b]),w=b,d=!0;break}if(!d||r==null||r===""||r===!1&&!c.allowFalse)continue;const F=typeof c.map=="function"?c.map(r,{propName:w,props:i,device:s,rule:c}):`${c.class}-${oo(r)}`,S=Array.isArray(F)?F:[F];for(const b of S)b&&n.push(String(b).startsWith("cms-")?b:`${s.prefix}${b}`)}}return n},jn=(t={})=>Bn.some(e=>!!cs(t,e)),io=(t={},e=[])=>{for(const n of e){if(!vs(t,n))continue;const s=o(t[n]);if(!(s==null||s===""))return s}},Ps=(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)},Ss=(t,e,n)=>{!t||n==null||n===""||(typeof t.setProperty=="function"?t.setProperty(e,n):t[e]=n)},En=(t,e)=>t==="mobile"?`cms-rsp-${e}`:`cms-rsp-${t}-${e}`,lo=(t,e)=>{var n;if(!(!t||!e)){if((n=t.classList)!=null&&n.add){t.classList.add(e);return}t.class=te([t.class,e])}},gn=(t,e={},n=[])=>{if(!t||!e||!jn(e))return t;const s=t.style||{};let i=!1;for(const c of n){const x=Array.isArray(c.prop)?c.prop:[c.prop],d=(r,w)=>{const F=io(w,x),S=Ps(F,c);if(!S)return;const b=c.var||c.css,P=r==="mobile"?"--cms-rsp-":`--cms-rsp-${r}-`;Ss(s,`${P}${b}`,S),lo(t,En(r,b)),i=!0};d("mobile",e);for(const r of Bn){const w=cs(e,r);w&&d(r.key,w)}}return i&&(t.nodeType||(t.style=s),lo(t,"cms-rsp")),t};JSswift.uiResponsiveDevices=Bn,JSswift.uiResponsiveOmitProps=ws,JSswift.uiResponsivePropsFor=cs,JSswift.uiResponsiveHasConfig=jn,JSswift.uiResponsiveHasProp=Ts,JSswift.uiResponsiveClasses=Xn,JSswift.uiApplyResponsiveProps=gn;const Qn=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(ws):ws;return Qn(t,n)};const wn=(t={})=>{var s;const e=[],n={};if(e.push(ye(t.clickable,"cms-clickable"),ye(t.dense,"cms-dense"),ye(t.flat,"cms-flat"),ye(t.border,"cms-border"),ye(t.glossy,"cms-glossy"),ye(t.glow,"cms-glow"),ye(t.glass,"cms-glass"),ye(t.shadow,"cms-shadow"),ye(t.outline,"cms-outline"),ye(t.rounded,"cms-rounded"),ye(t.gradient,"cms-gradient"),ye(t.textGradient,"cms-text-gradient"),ye(t.lightShadow,"cms-light-shadow")),Ye(t.color))e.push(()=>{const i=o(t.color),c=Vt(i);return c?`cms-state-${c}`:""}),n.backgroundColor=()=>{const i=o(t.color);return Vt(i)?"":i&&In(String(i))?`var(--cms-${i})`:i||""};else{const i=Vt(t.color);i?e.push(`cms-state-${i}`):t.color&&In(t.color)?n.backgroundColor=`var(--cms-${t.color})`:t.color&&(n.backgroundColor=t.color)}if(Ye(t.textColor)?n.color=()=>{const i=o(t.textColor);return i&&In(String(i))?`var(--cms-${i})`:i||""}:t.textColor&&In(t.textColor)?n.color=`var(--cms-${t.textColor})`:t.textColor&&(n.color=t.textColor),Ye(t.size))e.push(()=>{var c;const i=o(t.size);return typeof i=="string"&&((c=JSswift.uiSizes)!=null&&c.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(Ye(t.shadow))e.push(()=>{const i=o(t.shadow),c=ys(i);return c?`cms-shadow-${c}`:""}),n.boxShadow=()=>{const i=o(t.shadow);return ys(i)||i==null||i===!1?"":typeof i=="string"?i:""};else{const i=ys(t.shadow);i?e.push(`cms-shadow-${i}`):t.shadow&&typeof t.shadow=="string"&&(n.boxShadow=t.shadow)}e.length&&(t.class=te([t.class,...e])),Object.keys(n).length&&(t.style={...n,...t.style||{}})},Js=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=Js(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 wn(n),e};const Ne=window._;function Cn(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 Rs={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"},Lo=t=>t===!0?"wrap":t===!1?"nowrap":String(t),Ms=t=>typeof t=="number"?`repeat(${Math.max(1,Math.round(t))}, minmax(0, 1fr))`:String(t),Os=[{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:Lo},{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:Ms},{prop:"rows",css:"grid-template-rows",var:"grid-template-rows",mapValue:Ms},{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"}],Fs=Os.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return e.some(n=>Object.prototype.hasOwnProperty.call(Rs,n))||e.includes("fontSize")||e.includes("fontWeight")||e.includes("lineHeight")||e.includes("letterSpacing")||e.includes("borderRadius")||e.includes("radius")});JSswift.uiResponsiveStyleRules=Os,JSswift.uiResponsiveCommonStyleRules=Fs;const ro=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),ao=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(ro(n),ze(e,s))};function Nt(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(Rs).forEach(([n,s])=>{Ts(e,n)||ao(t,e[n],n,s)}),gn(t,e,Fs),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 Cs(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),x=i!=null?typeof i=="function"?i(n||{}):i:s;return x==null?null:Cn(JSswift.ui.slot(x))};const J=(t,e,n,s)=>{const i=JSswift.ui.renderSlot(t,e,n,s);return i?Array.isArray(i)?i:[i]:[]},Hn=new Set;let us=!1;const l=new Set(["ctrl","alt","shift","meta"]),E={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"},R={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"},B=()=>{if(typeof navigator=="undefined")return!1;const t=String(navigator.platform||navigator.userAgent||"");return/(mac|iphone|ipad|ipod)/i.test(t)},D=t=>{if(t==null)return"";const e=String(t).trim().toLowerCase();return e?E[e]||e:""},ge=t=>{if(t==null||t===!1)return null;const e=String(t).trim();if(!e)return null;const n=e.split("+").map(D).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"){B()?s.meta=!0:s.ctrl=!0;return}if(l.has(i)){s[i]=!0;return}s.key=i}),s.key?s:null},q=t=>t==null||t===!1?[]:(Array.isArray(t)?t:[t]).map(n=>{var i,c,x;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const d=ge((x=(c=(i=n.shortcode)!=null?i:n.shortcut)!=null?c:n.keys)!=null?x:n.key);return d?{...n,...d}:null}const s=ge(n);return s?{...s}:null}).filter(Boolean),pe=(t={})=>{var e,n,s;return q((s=(n=(e=t.shortcode)!=null?e:t.shortcut)!=null?n:t.hotkey)!=null?s:t.keys)},Le=(t={})=>t.showShortcode===!0||t.showShortcut===!0,we=t=>{const e=D(t);if(!e)return"";const n={...R};return B()&&(n.alt="Option",n.meta="Cmd"),n[e]?n[e]:e.length===1?e.toUpperCase():e.replace(/(^|[-_ ])(\w)/g,(s,i,c)=>`${i}${c.toUpperCase()}`)},Ce=t=>{if(!t)return"";const e=[];return t.ctrl&&e.push(we("ctrl")),t.alt&&e.push(we("alt")),t.shift&&e.push(we("shift")),t.meta&&e.push(we("meta")),e.push(we(t.key)),e.filter(Boolean).join("+")},Ae=t=>(Array.isArray(t)?t:[]).map(Ce).filter(Boolean).join(" / "),Oe=(t={},e={})=>{const n=pe(t);if(!Le(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=Ae(n),s},Re=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)},Qe=(t,e)=>!t||!e||!!t.ctrlKey!=!!e.ctrl||!!t.altKey!=!!e.alt||!!t.shiftKey!=!!e.shift||!!t.metaKey!=!!e.meta?!1:D(t.key)===e.key,gt=()=>{Hn.size||!us||typeof document=="undefined"||(document.removeEventListener("keydown",ft,!0),us=!1)};function ft(t){var s,i,c,x,d,r;if(!Hn.size||!t||t.defaultPrevented||t.isComposing)return;const e=Re(t.target),n=Array.from(Hn);for(let w=n.length-1;w>=0;w-=1){const F=n[w],S=F==null?void 0:F.anchor;if(!S||!S.isConnected){Hn.delete(F);continue}if(((s=F.isEnabled)==null?void 0:s.call(F))===!1)continue;const b=F.specs.find(he=>{var W,se;const H=(se=(W=he.allowInEditable)!=null?W:F.allowInEditable)!=null?se:!1;return e&&!H?!1:Qe(t,he)});if(!b)continue;const P=(c=(i=b.preventDefault)!=null?i:F.preventDefault)!=null?c:!0,re=(d=(x=b.stopPropagation)!=null?x:F.stopPropagation)!=null?d:!0;if(P&&t.preventDefault(),re&&t.stopPropagation(),((r=F.action)==null?void 0:r.call(F,t,b,S))!==!1)break}gt()}const it=(t,e={},n={})=>{var x,d;const s=pe(e);if(!t||!s.length||typeof document=="undefined")return null;const i={anchor:t,specs:s,action:typeof n.action=="function"?n.action:()=>{var r;return(r=t.click)==null?void 0:r.call(t)},isEnabled:typeof n.isEnabled=="function"?n.isEnabled:null,allowInEditable:!!n.allowInEditable,preventDefault:(x=n.preventDefault)!=null?x:!0,stopPropagation:(d=n.stopPropagation)!=null?d:!0};Hn.add(i),us||(document.addEventListener("keydown",ft,!0),us=!0);const c=()=>{Hn.delete(i),gt()};return JSswift._registerCleanup(t,c),c},Fe=(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},ze=(t,e="size")=>typeof t=="number"?t+"px":JSswift.uiSizes.includes(t)?`var(--cms-${e}-${t})`:t,je=(t,e=JSswift.uiSizes)=>n=>{const s=String(n).trim();return e!=null&&e.includes(s)?`${t}-${s}`:""},ct=t=>e=>`${t}-${String(e).trim().toLowerCase().replace(/\s+/g,"-")}`,ut=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}`},kt=(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)))}`:""},Ze=(t,e)=>{const n=Array.isArray(e)?e:[e];return JSswift.uiResponsiveDevices.some(s=>{const i=JSswift.uiResponsivePropsFor(t,s);return!!i&&n.some(c=>Object.prototype.hasOwnProperty.call(i,c))})},xt=t=>JSswift.uiResponsiveDevices.find(e=>e.key===t),_t=[{prop:"gap",class:"gap",map:je("gap")},{prop:"rowGap",class:"gap-y",map:je("gap-y")},{prop:["columnGap","colGap"],class:"gap-x",map:je("gap-x")},{prop:"direction",class:"dir",map:ct("dir")},{prop:"wrap",class:"wrap",allowFalse:!0,map:ut},{prop:"align",class:"align",map:ct("align")},{prop:"justify",class:"justify",map:ct("justify")},{prop:"width",class:"w",map:je("w")},{prop:"minWidth",class:"min-w",map:je("min-w")},{prop:"maxWidth",class:"max-w",map:je("max-w")},{prop:"height",class:"h",map:je("h")},{prop:"minHeight",class:"min-h",map:je("min-h")},{prop:"maxHeight",class:"max-h",map:je("max-h")},{prop:"padding",class:"p",map:je("p")},{prop:"margin",class:"m",map:je("m")}],Jt=_t.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("align")&&!e.includes("justify")}),We=[{prop:["col","span"],class:"col",map:Lt},{prop:"auto",class:"col",map:t=>t?"col-auto":""},{prop:"inline",class:"display",allowFalse:!0,map:t=>kt(t,"display-inline-flex","display-flex")},{prop:"self",class:"self",map:ct("self")},..._t],nt=[{prop:["cols","columns"],class:"grid-cols",map:Wt},{prop:"inline",class:"display",allowFalse:!0,map:t=>kt(t,"display-inline-grid","display-grid")},{prop:"flow",class:"grid-flow",map:t=>`grid-flow-${String(t).trim().toLowerCase().replace(/\s+/g,"-")}`},..._t],Et=[{prop:"inline",class:"display",allowFalse:!0,map:t=>kt(t,"display-inline-flex","display-flex")},{prop:"direction",class:"dir",map:ct("dir")},{prop:"contentAlign",class:"align",map:ct("align")},{prop:"contentJustify",class:"justify",map:ct("justify")},{prop:"align",class:"self",map:ct("self")},{prop:"justify",class:"justify-self",map:ct("justify-self")},{prop:"place",class:"place-self",map:ct("place-self")},...Jt],Ot=(JSswift.uiResponsiveStyleRules||[]).filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("span")&&!e.includes("gridColumn")});Ne.Row=(...t)=>{var m,h,p,V,ie;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(a,C,g={})=>{const M=Array.isArray(a)?a:[a];for(const Y of M)if(JSswift.ui.getSlot(s,Y)!=null)return J(s,Y,g,C);return C==null?[]:J(null,"default",g,C)},c=a=>{var C;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?`var(--cms-s-${a})`:String(a)},x=a=>{var C;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?`var(--cms-w-${a})`:String(a)},d=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]);d.class=te(["cms-row",JSswift.uiResponsiveClasses({mobile:e},_t),JSswift.uiResponsiveClasses(e,_t),e.class]);const r={...e.style||{}},w=Ct([e.direction,e.reverse],()=>{const a=o(e.direction);return a!=null&&a!==""?String(a):o(e.reverse)?"row-reverse":""}),F=Ke(e.align),S=Ke(e.justify),b=Ke(e.wrap,a=>typeof a=="boolean"?a?"wrap":"nowrap":String(a)),P=Ke(e.gap,c),re=Ke(e.rowGap,c),Z=Ke(e.columnGap,c),he=Ke(e.inline,a=>a?"inline-flex":"flex"),H=Ke(e.width,x),W=Ke(e.minWidth,x),se=Ke(e.maxWidth,x),X=Ke(e.full,a=>a?"100%":"",""),fe=Ct([e.inline,e.full,e.width],()=>{const a=!!o(e.inline),C=!!o(e.full),g=o(e.width)!=null&&o(e.width)!==!1&&o(e.width)!=="";return!a||C||g?"":"max-content"});w!=null&&!Ze(e,"direction")&&(r.flexDirection=w),F!=null&&!Ze(e,"align")&&(r.alignItems=F),S!=null&&!Ze(e,"justify")&&(r.justifyContent=S),b!=null&&!Ze(e,"wrap")&&(r.flexWrap=b),P!=null&&!Ze(e,"gap")&&(r.gap=P),re!=null&&!Ze(e,"rowGap")&&(r.rowGap=re),Z!=null&&!Ze(e,"columnGap")&&(r.columnGap=Z),he!=null&&(r.display=he),fe!=null&&(r.width=fe),H!=null&&!Ze(e,"width")&&(r.width=H),W!=null&&!Ze(e,"minWidth")&&(r.minWidth=W),se!=null&&!Ze(e,"maxWidth")&&(r.maxWidth=se),X!=null&&(r.width=X),Object.keys(r).length&&(d.style=r),JSswift.uiApplyResponsiveProps(d,e,JSswift.uiResponsiveStyleRules);const _e={props:e},be=i(["start","left"],(m=e.start)!=null?m:e.left,_e),me=i(["body","center","default"],(p=(h=e.body)!=null?h:e.center)!=null?p:n,_e),de=i(["end","right"],(V=e.end)!=null?V:e.right,_e);if(!(be.length||de.length||e.body!=null||e.center!=null||e.startClass||e.bodyClass||e.centerClass||e.endClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"left")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"center")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"right")!=null)){const a=J(s,"default",_e,n),C=_.div(d,...a);return Nt(C,e),C}const $={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},le=(ie=e.bodyClass)!=null?ie:e.centerClass,oe=Ct([e.direction,e.reverse],()=>(o(e.direction)||(o(e.reverse)?"row-reverse":"row"))==="row"?"auto":""),Se=[be.length?_.div({class:te(["cms-row-start",e.startClass]),style:{...$}},...be):null,me.length?_.div({class:te(["cms-row-body",le]),style:{...$,flex:"1 1 auto"}},...me):null,de.length?_.div({class:te(["cms-row-end",e.endClass]),style:{...$,justifyContent:"flex-end",marginInlineStart:oe}},...de):null].filter(Boolean),L=_.div(d,...Se);return Nt(L,e),L};function vt(t){return Array.isArray(t)&&(t.length===2||t.length===3&&typeof t[2]=="function")&&typeof t[0]=="function"&&typeof t[1]=="function"}function yt(t){return!!t&&t.type==="rod"}function Ye(t){return typeof t=="function"||yt(t)||vt(t)}function o(t){return typeof t=="function"?t():yt(t)?t.value:vt(t)?t[0]():t}function zt(t){const e=Array.isArray(t)?[...t]:[t];for(;e.length;){const n=e.pop();if(Ye(n))return!0;Array.isArray(n)&&e.push(...n)}return!1}function te(t){const e=zt(t),n=()=>{const s=[],i=Array.isArray(t)?[...t]:[t];for(;i.length;){const c=i.shift();if(c==null||c===!1)continue;const x=o(c);if(!(x==null||x===!1||x==="")){if(Array.isArray(x)){i.unshift(...x);continue}s.push(x)}}return s.join(" ")};return e?n:n()}function qt(t){const e=te(t);return typeof e=="function"?e():e}function ye(t,e,n=""){return Ye(t)?()=>o(t)?e:n:t?e:n}function Bt(t,e,n=""){return Ye(t)?()=>{const s=o(t);return s==null||s===""?"":`${e}${s}${n}`}:t==null||t===""?"":`${e}${t}${n}`}function Ct(t,e){return(Array.isArray(t)?t:[t]).some(Ye)?()=>e():e()}function Ke(t,e,n=""){return Ye(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=Ye,JSswift.uiUnwrap=o,JSswift.uiClass=te,JSswift.uiClassStatic=qt,JSswift.uiWhen=ye,JSswift.uiClassValue=Bt,JSswift.uiComputed=Ct,JSswift.uiStyleValue=Ke,Ne.Col=(...t)=>{var M,Y,Q,ve,N,f;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=A=>Object.prototype.hasOwnProperty.call(e,A),c=(A,z,K={})=>{const ke=Array.isArray(A)?A:[A];for(const Me of ke)if(JSswift.ui.getSlot(s,Me)!=null)return J(s,Me,K,z);return z==null?[]:J(null,"default",K,z)},x=A=>{var z;return A==null||A===!1||A===""?"":typeof A=="number"?`${A}px`:typeof A=="string"&&((z=JSswift.uiSizes)!=null&&z.includes(A))?`var(--cms-s-${A})`:String(A)},d=A=>{var z;return A==null||A===!1||A===""?"":typeof A=="string"&&((z=JSswift.uiSizes)!=null&&z.includes(A))?ze(A,"size"):mt(A)},r=(A,z)=>{const K=o(A);if(K==null||K===!1||K==="")return"";if(K==="auto")return z==="cms-col-"?"cms-col-auto":"";if(K===!0)return`${z}24`;const ke=Number(K);if(Number.isFinite(ke)&&ke>0)return`${z}${Math.max(1,Math.min(24,Math.round(ke)))}`;if(typeof K=="string"){const Me=K.trim();if(!Me)return"";if(Me.startsWith(z))return Me;if(/^\d+$/.test(Me))return`${z}${Math.max(1,Math.min(24,Number(Me)))}`}return""},w=()=>{const A=o(e.flex);if(A!=null&&A!==!1&&A!=="")return String(A);if(o(e.fill))return"1 1 auto";const z=i("grow"),K=i("shrink"),ke=i("basis");if(!z&&!K&&!ke)return"";const Me=z?o(e.grow):0,Te=K?o(e.shrink):1,U=ke?d(o(e.basis)):"auto";return`${Me} ${Te} ${U||"auto"}`},F=Ct([e.auto,e.col,e.span],()=>{if(o(e.auto))return"cms-col-auto";const A=i("span")?e.span:e.col;return r(A,"cms-col-")||"cms-col"}),S=JSswift.omit(e,["slots","col","span","sm","md","lg","auto","size","width","minWidth","maxWidth","height","minHeight","maxHeight","gap","rowGap","columnGap","align","justify","inline","center","stack","flex","fill","grow","shrink","basis","self","order","scroll","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass",...JSswift.uiResponsiveOmitProps]),b={...e.style||{}};!Ze(e,"minWidth")&&b.minWidth==null&&(b.minWidth=0);const P=Ke(e.gap,x),re=Ke(e.rowGap,x),Z=Ke(e.columnGap,x),he=Ke(e.align),H=Ke(e.justify),W=i("width")?e.width:e.size,se=Ke(W,d),X=Ke(e.minWidth,d),fe=Ke(e.maxWidth,d),_e=Ke(e.height,d),be=Ke(e.minHeight,d),me=Ke(e.maxHeight,d),de=Ke(e.self),ce=Ke(e.order,A=>String(A)),$=Ke(e.scroll,A=>A?"auto":"",""),le=Ct([e.flex,e.fill,e.grow,e.shrink,e.basis],w),oe=Ct([e.center,e.align,e.justify],()=>!!o(e.center)&&(o(e.align)==null||o(e.align)==="")&&(o(e.justify)==null||o(e.justify)===""));le!=null&&le!==""&&(b.flex=le),de!=null&&!Ze(e,"self")&&(b.alignSelf=de),ce!=null&&(b.order=ce),$!=null&&$!==""&&(b.overflow=$),se!=null&&se!==""&&!Ze(e,["width","size"])&&(b.width=se,!i("flex")&&!i("fill")&&!i("grow")&&!i("shrink")&&!i("basis")&&(b.flex="0 0 auto")),X!=null&&!Ze(e,"minWidth")&&(b.minWidth=X),fe!=null&&!Ze(e,"maxWidth")&&(b.maxWidth=fe),_e!=null&&!Ze(e,"height")&&(b.height=_e),be!=null&&!Ze(e,"minHeight")&&(b.minHeight=be),me!=null&&!Ze(e,"maxHeight")&&(b.maxHeight=me),Object.keys(b).length&&(S.style=b);const Se={props:e},L=c(["start","top","header","before"],(Q=(Y=(M=e.start)!=null?M:e.top)!=null?Y:e.header)!=null?Q:e.before,Se),m=i("body")?e.body:i("content")?e.content:n,h=c(["body","content","default"],m,Se),p=c(["end","bottom","footer","after"],(f=(N=(ve=e.end)!=null?ve:e.bottom)!=null?N:e.footer)!=null?f:e.after,Se),V=L.length||p.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,ie=Ct([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(z=>z!=null&&z!==!1&&z!=="")?!0:!!o(e.center));if(S.class=te(["cms-col",F,Ct(e.sm,()=>r(e.sm,"cms-sm-col-")),Ct(e.md,()=>r(e.md,"cms-md-col-")),Ct(e.lg,()=>r(e.lg,"cms-lg-col-")),JSswift.uiResponsiveClasses({mobile:e},We),JSswift.uiResponsiveClasses(e,We),ye(ie,"cms-col-flex"),ye(e.inline,"cms-col-inline"),e.class]),P!=null&&!Ze(e,"gap")&&(b.gap=P),re!=null&&!Ze(e,"rowGap")&&(b.rowGap=re),Z!=null&&!Ze(e,"columnGap")&&(b.columnGap=Z),he!=null&&!Ze(e,"align")?b.alignItems=he:oe!=null&&oe!==""&&(b.alignItems=oe?"center":""),H!=null&&!Ze(e,"justify")?b.justifyContent=H:oe!=null&&oe!==""&&(b.justifyContent=oe?"center":""),Object.keys(b).length&&(S.style=b),JSswift.uiApplyResponsiveProps(S,e,JSswift.uiResponsiveStyleRules),!V){const A=_.div(S,...J(s,"default",Se,n));return Nt(A,e),A}const a={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},C=[L.length?_.div({class:te(["cms-col-start",e.startClass,e.topClass,e.headerClass]),style:{...a}},...L):null,h.length?_.div({class:te(["cms-col-body",e.bodyClass,e.contentClass]),style:{...a,flex:"1 1 auto"}},...h):null,p.length?_.div({class:te(["cms-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...a}},...p):null].filter(Boolean),g=_.div(S,...C);return Nt(g,e),g},Ne.Spacer=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.omit(e,["slots"]);i.class=te(["cms-spacer",e.class]);const c=J(s,"default",{},n);return _.div(i,...c)},Ne.Container=(...t)=>{var p,V,ie,a;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=C=>Object.prototype.hasOwnProperty.call(e,C),x={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},d=C=>{if(C==null||C===!1||C==="")return"";if(typeof C=="number")return`${C}px`;const g=String(C).trim().toLowerCase();return g?g==="full"||g==="fluid"?"100%":x[g]||String(C):""},r=C=>{var g;return C==null||C===!1||C===""?"":typeof C=="number"?`${C}px`:typeof C=="string"&&((g=JSswift.uiSizes)!=null&&g.includes(C))?`var(--cms-s-${C})`:String(C)},w=C=>{if(C==null||C===!1||C==="")return"";if(typeof C=="number"&&Number.isFinite(C))return`repeat(${Math.max(1,Math.floor(C))}, minmax(0, 1fr))`;const g=String(C).trim();return g?/^\d+$/.test(g)?`repeat(${Math.max(1,Number(g))}, minmax(0, 1fr))`:g:""},F=C=>C==null||C===""?"":C===!0?"wrap":C===!1?"nowrap":String(C),S={props:e},b=(C,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(M=>b(C,M));return}if(g!=null&&g.nodeType){C.appendChild(g);return}C.appendChild(document.createTextNode(String(g)))}},P=(C,g)=>{const M=JSswift.ui.getSlot(s,C);if(M!=null)return J(s,C,S,null);if(typeof g=="function"){const Y=_.div({class:`cms-container-slot-${C}`});return JSswift.reactive.effect(()=>{const Q=Cn(JSswift.ui.slot(g(S)));Y.replaceChildren(),Array.isArray(Q)?Q.forEach(ve=>b(Y,ve)):b(Y,Q)},`UI.Container:${C}`),[Y]}return J(s,C,S,g)},re=c("content")?e.content:n!=null&&n.length?n:null,Z=P("before",(p=e.before)!=null?p:e.top),he=P("header",e.header),H=[...P("left",e.left),...P("start",e.start)],W=P("body",c("body")?e.body:null),se=(()=>{const C=P("content",c("content")?e.content:null);return C.length?C:P("default",re)})(),X=[...P("right",e.right),...P("end",e.end)],fe=P("footer",e.footer),_e=P("after",(V=e.after)!=null?V:e.bottom),be=Z.length||he.length||H.length||X.length||fe.length||_e.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,me=!!be||W.length>0&&(JSswift.ui.getSlot(s,"body")!=null||be),de=()=>{var g;const C=String(o((g=e.layout)!=null?g:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(C)?C:["inline","inline-flex","inlineflex"].includes(C)||o(e.inline)?"inline":o(e.grid)||o(e.cols)!=null?"grid":C==="block"?"block":o(e.direction)!=null||o(e.wrap)!=null||o(e.align)!=null||o(e.justify)!=null||o(e.gap)!=null||H.length||X.length?"flex":"block"},ce=Ct([e.layout,e.display,e.inline,e.grid,e.cols,e.direction,e.wrap,e.align,e.justify,e.gap],()=>{const C=de();return C==="block"?"":`is-${C}`}),$={...i.style||{}},le=(C,g)=>{g!=null&&($[C]=g)};le("maxWidth",Ct([e.maxWidth,e.fluid],()=>o(e.fluid)?"none":d(o(e.maxWidth))||"")),le("width",Ke(e.width,d)),le("minWidth",Ke(e.minWidth,d)),le("--cms-container-padding",Ke(e.padding,r)),le("--cms-container-padding-x",Ke((ie=e.paddingX)!=null?ie:e.gutter,r)),le("--cms-container-padding-y",Ke(e.paddingY,r)),le("--cms-container-gap",Ke(e.gap,r)),le("--cms-container-section-gap",Ke((a=e.sectionGap)!=null?a:e.gap,r)),le("--cms-container-cols",Ke(e.cols,w)),le("--cms-container-align",Ke(e.align,C=>String(C))),le("--cms-container-justify",Ke(e.justify,C=>String(C))),le("--cms-container-direction",Ke(e.direction,C=>String(C))),le("--cms-container-wrap",Ke(e.wrap,F));const oe=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"]);oe.class=te(["cms-container",ye(e.fluid,"is-fluid"),ye(me,"has-structure"),me?"":ce,i.class]),oe.style=$,JSswift.uiApplyResponsiveProps(oe,e,JSswift.uiResponsiveStyleRules);const Se=(C,g,M)=>g.length?_.div({class:te(["cms-container-section",`cms-container-${C}`,M])},...g):null,L=W.length?_.div({class:te(["cms-container-body",me?ce:"",e.bodyClass])},...W):H.length||se.length||X.length?_.div({class:te(["cms-container-body",me?ce:"",e.bodyClass])},Se("start",H,e.startClass),se.length?_.div({class:te(["cms-container-main",e.mainClass,e.contentClass])},...se):null,Se("end",X,e.endClass)):null,m=(()=>{var g;const C=String(o((g=e.tag)!=null?g:e.as)||"div").toLowerCase();return typeof _[C]=="function"?_[C]:_.div})(),h=me?m(oe,Se("before",Z,e.beforeClass),Se("header",he,e.headerClass),L,Se("footer",fe,e.footerClass),Se("after",_e,e.afterClass)):m(oe,...W.length?W:se);return Nt(h,e),h},Ne.Card=(...t)=>{var ve,N;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};wn(i);const c=(f,A)=>{var z;return!!(f&&f.nodeType===1&&((z=f.classList)!=null&&z.contains(`cms-card-${A}`)))},d=(f=>f==null?null:typeof f=="string"?Ne.Icon({name:f,size:e.iconSize||e.size||"lg"}):JSswift.ui.slot(f,{as:"icon"}))(e.icon),r=e.image?_.img({src:e.image,alt:e.imageAlt||"",class:te(["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},F=J(s,"default",w,n!=null&&n.length?n:[]),S={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},b=[];F.forEach(f=>{c(f,"identifier")?S.identifier.push(f):c(f,"cover")?S.cover.push(f):c(f,"media")?S.media.push(f):c(f,"header")?S.header.push(f):c(f,"body")?S.body.push(f):c(f,"footer")?S.footer.push(f):c(f,"actions")?S.actions.push(f):b.push(f)});const P=J(s,"identifier",w,e.identifier),re=J(s,"cover",w,r),Z=J(s,"media",w,e.media),he=J(s,"eyebrow",w,(ve=e.eyebrow)!=null?ve:e.kicker),H=J(s,"title",w,e.title),W=J(s,"subtitle",w,e.subtitle),se=J(s,"header",w,e.header),X=J(s,"icon",w,d),fe=J(s,"aside",w,(N=e.aside)!=null?N:e.headerAside),_e=J(s,"body",w,e.body),be=J(s,"footer",w,e.footer),me=J(s,"actions",w,e.actions),de=P.length?_.div({class:te(["cms-card-identifier",e.identifierClass])},...P):null,ce=re.length?_.div({class:te(["cms-card-cover",e.coverClass])},...re):null,$=Z.length?_.div({class:te(["cms-card-media",e.mediaClass])},...Z):null,oe=X.length||he.length||H.length||W.length||se.length||fe.length?_.div({class:te(["cms-card-header",e.headerClass])},_.div({class:"cms-card-head"},X.length?_.div({class:"cms-card-icon"},...X):null,_.div({class:"cms-card-head-main"},he.length?_.div({class:te(["cms-card-eyebrow",e.eyebrowClass])},...he):null,H.length?_.div({class:te(["cms-card-title",e.titleClass])},...H):null,W.length?_.div({class:te(["cms-card-subtitle",e.subtitleClass])},...W):null,se.length?_.div({class:te(["cms-card-header-content",e.headerContentClass])},...se):null),fe.length?_.div({class:te(["cms-card-aside",e.asideClass])},...fe):null)):null,Se=[..._e,...b],L=Se.length?_.div({class:te(["cms-card-body",e.bodyClass])},...Se):null,m=[...me,...S.actions],h=be.length||m.length?_.div({class:te(["cms-card-footer",e.footerClass])},...be,m.length?_.div({class:"cms-card-actions"},...m):null):null,p=Ct([e.clickable,e.to],()=>o(e.clickable)||o(e.to)?"cms-card-clickable":""),V=P.length||S.identifier.length,ie=re.length||S.cover.length||Z.length||S.media.length,a=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"]);a.class=te(["cms-panel","cms-card","cms-clear-set","cms-singularity",ye(e.flat,"cms-card-flat"),ye(e.dense,"cms-card-dense"),ye(V,"cms-card-has-identifier"),ye(ie,"cms-card-has-top-visual"),p,i.class]),a.style={...i.style||{}},e.coverHeight!=null&&(a.style["--cms-card-cover-height"]=mt(o(e.coverHeight))),JSswift.uiApplyResponsiveProps(a,e,JSswift.uiResponsiveStyleRules);const C=e.onClick,g=e.onKeydown,M=f=>{var z;if(C==null||C(f),f.defaultPrevented)return;const A=o(e.to);A&&((z=JSswift.router)!=null&&z.navigate)&&(f.preventDefault(),JSswift.router.navigate(A))},Y=f=>{g==null||g(f),!f.defaultPrevented&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),M(f))};(o(e.clickable)||o(e.to))&&(a.onClick=M,a.onKeydown=Y,a.tabIndex==null&&(a.tabIndex=0),a.role==null&&(a.role="button"));const Q=_.div(a,de,...S.identifier,ce,...S.cover,$,...S.media,oe,...S.header,L,...S.body,h,...S.footer);return Nt(Q,e),Q},Ne.Btn=(...t)=>{var ce;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Ct([e.color,e.state],()=>{const $=o(e.color)||o(e.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes($)?$:o(e.state)||""}),c=te(["cms-clear-set","cms-btn","cms-singularity","cms-clickable",i,ye(e.outline,"outline"),e.class]),x=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);x.class=c;const d=()=>!!o(e.loading),r=()=>!!o(e.disabled)||d(),w=e.icon!=null?typeof e.icon=="string"?Ne.Icon({name:e.icon}):e.icon:null,F=e.iconRight!=null?typeof e.iconRight=="string"?Ne.Icon({name:e.iconRight}):e.iconRight:null,S=JSswift.ui.renderSlot(s,"icon",{},w),b=JSswift.ui.renderSlot(s,"iconRight",{},F),P=JSswift.ui.renderSlot(s,"label",{},e.label),re=J(s,"default",{},n),Z=[],he=$=>{$&&(Array.isArray($)?Z.push(...$):Z.push($))},H=e.iconAlign;(H==="after"||H==="right")&&!F?(he(P),re.length&&Z.push(...re),he(S)):(he(S),he(P),re.length&&Z.push(...re)),he(b),he(Oe(e,{className:"cms-shortcode cms-btn-shortcode"})),Z.length===0&&Z.push(_.span("Button"));const se=_.span({class:"cms-btn-loading",hidden:!0}),X=_.span({class:"cms-btn-content"},...Z);let fe=!1;const _e=()=>{const $=Ne.Spinner?Ne.Spinner({size:e.loadingSize||e.spinnerSize||16,thickness:e.loadingThickness||2,color:e.loadingColor||"currentColor",label:e.loadingText||null,"aria-label":e.loadingText?null:"Loading"}):_.span({class:"cms-muted",style:{marginRight:"8px"}},e.loadingText||"Loading");return J(null,"default",{},JSswift.ui.renderSlot(s,"loading",{},$))},be=$=>{var m;if((m=e.onPointerDown)==null||m.call(e,$),r()||!($!=null&&$.currentTarget))return;const le=$.currentTarget,oe=le.getBoundingClientRect(),Se=typeof $.clientX=="number"?$.clientX-oe.left:oe.width/2,L=typeof $.clientY=="number"?$.clientY-oe.top:oe.height/2;le.style.setProperty("--cms-burst-x",`${Se}px`),le.style.setProperty("--cms-burst-y",`${L}px`),le.classList.remove("cms-btn-burst"),le.offsetWidth,le.classList.add("cms-btn-burst")},me=_.button({...x,disabled:r(),onClick:$=>{var le,oe;return r()?((le=$==null?void 0:$.preventDefault)==null||le.call($),!1):(oe=e.onClick)==null?void 0:oe.call(e,$)},onPointerDown:be,"aria-disabled":r()?"true":null,"aria-busy":d()?"true":null},se,X),de=JSswift.reactive.effect(()=>{const $=d(),le=r();me.disabled=le,me.classList.toggle("is-loading",$),me.setAttribute("aria-disabled",le?"true":"false"),$?me.setAttribute("aria-busy","true"):me.removeAttribute("aria-busy"),se.hidden=!$,$!==fe&&(se.replaceChildren(...$?_e():[]),fe=$)},"UI.Btn:state");return(ce=JSswift._registerCleanup)==null||ce.call(JSswift,me,de),Nt(me,e),it(me,e,{isEnabled:()=>!r(),action:()=>{if(r())return!1;me.click()}}),me},Ne.Button=Ne.Btn,JSswift.ui.Btn=Ne.Btn,JSswift.ui.Button=Ne.Button,Ne.FormField=(t={})=>{var me,de,ce,$,le,oe,Se;wn(t);const e=t.slots||{},n=Ct([t.color,t.state],()=>{const L=o(t.color)||o(t.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(L)?L:o(t.state)||""}),s=_.div({class:te(["cms-clear-field-set","cms-field","cms-singularity-field",n,ye(t.fill,"cms-field-fill"),ye(t.outline,"outline"),t.wrapClass,t.class])}),i=J(e,"topLabel",{},t.topLabel);i.length&&s.appendChild(_.div({class:"cms-field-label"},...i));const c=t.multi||t.multiple,x=typeof t.control=="function"?t.control():t.control,d=()=>{if(typeof t.hasValue=="function")return!!t.hasValue();if(t.hasValue!=null)return!!o(t.hasValue);const L=t.getValue?t.getValue():null;return!(L==null||L==="")},r=()=>JSswift.reactive.untracked(d),w=()=>{var L,m;t.disabled||t.readonly||((L=t.onClear)==null||L.call(t),(m=t.onFocus)==null||m.call(t))},F=JSswift.ui.renderSlot(e,"control",{control:x,clear:w,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:r()},null);let S=null,b=null;if(F)S=Array.isArray(F)?_.div({class:"cms-control"},...F):F;else{S=_.div({class:"cms-control"});const L=_.div({class:"cms-addon cms-addon-left"}),m=t.icon!=null?typeof t.icon=="string"?Ne.Icon({name:t.icon}):t.icon:null,h=JSswift.ui.renderSlot(e,"icon",{},m),p=JSswift.ui.renderSlot(e,"prefix",{},t.prefix);J(null,"default",{},h).forEach(N=>L.appendChild(N)),J(null,"default",{},p).forEach(N=>L.appendChild(N)),L.childNodes.length&&S.appendChild(L);const V=_.div({class:"cms-mid"+(L.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});x&&V.appendChild(x);const ie=J(e,"label",{},t.label);if(ie.length){const N=_.div({class:te(["cms-float-label",ye(c,"cms-multiselect")])},...ie);V.appendChild(N)}S.appendChild(V);const a=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:w},Ne.Icon({name:"close"})):null,C=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:r()},a);C&&(C.onclick=N=>{N.stopPropagation(),w()},J(null,"default",{},C).forEach(N=>S.appendChild(N))),b=a,b&&((me=t.clearable)!=null&&me.action)&&t.clearable.action(N=>N?b.classList.remove("cms-d-none"):b.classList.add("cms-d-none"));const g=_.div({class:"cms-addon cms-addon-right"}),M=t.iconRight!=null?typeof t.iconRight=="string"?Ne.Icon({name:t.iconRight}):t.iconRight:null,Y=JSswift.ui.renderSlot(e,"iconRight",{},M),Q=JSswift.ui.renderSlot(e,"suffix",{},t.suffix),ve=JSswift.ui.renderSlot(e,"shortcode",{props:t},Oe(t,{className:"cms-shortcode cms-field-shortcode"}));J(null,"default",{},Q).forEach(N=>g.appendChild(N)),J(null,"default",{},Y).forEach(N=>g.appendChild(N)),J(null,"default",{},ve).forEach(N=>g.appendChild(N)),g.childNodes.length&&(S.appendChild(g),V.classList.add("cms-with-right"))}const P=L=>L&&(L&&typeof L.action=="function"?L.value:Array.isArray(L)&&typeof L[0]=="function"?L[0]():typeof L=="function"?L():L),re=L=>L==null||L===!1||L===""?!1:Array.isArray(L)?L.length>0:!0;let Z=null;const he=()=>{const L=[{key:"error",value:P(t.error),slot:"errorMessage",className:"cms-error"},{key:"warning",value:P(t.warning),slot:"warning",className:"cms-warning"},{key:"success",value:P(t.success),slot:"success",className:"cms-success"},{key:"note",value:P(t.note),slot:"note",className:"cms-note"},{key:"hint",value:P(t.hint),slot:"hint",className:"cms-hint"}];let m=null;for(const a of L)if(re(a.value)){m=a;break}const h={error:L[0].value,warning:L[1].value,success:L[2].value,note:L[3].value,hint:L[4].value,props:t},p=m?J(e,m.slot,h,m.value):[],V=p.length?_.div({class:m==null?void 0:m.className},...p):null;["error","warning","success","note"].forEach(a=>{var C;return(C=S==null?void 0:S.classList)==null?void 0:C.toggle(a,(m==null?void 0:m.key)===a)}),Z?V?Z.replaceWith(V):Z.remove():V&&s.appendChild(V),Z=V},H=()=>{var m;const L=d();(m=S==null?void 0:S.classList)==null||m.toggle("has-value",L),b&&(b.style.display=L?"":"none")};JSswift.reactive.untracked(H),(de=S==null?void 0:S.classList)==null||de.toggle("disabled",!!t.disabled),s.appendChild(S);const W=JSswift.ui.getSlot(e,"errorMessage"),se=JSswift.ui.getSlot(e,"warning"),X=JSswift.ui.getSlot(e,"success"),fe=JSswift.ui.getSlot(e,"note"),_e=JSswift.ui.getSlot(e,"hint");return!!((ce=t.error)!=null&&ce.action||($=t.warning)!=null&&$.action||(le=t.success)!=null&&le.action||(oe=t.note)!=null&&oe.action||(Se=t.hint)!=null&&Se.action)||Array.isArray(t.error)&&typeof t.error[0]=="function"||Array.isArray(t.warning)&&typeof t.warning[0]=="function"||Array.isArray(t.success)&&typeof t.success[0]=="function"||Array.isArray(t.note)&&typeof t.note[0]=="function"||Array.isArray(t.hint)&&typeof t.hint[0]=="function"||typeof t.error=="function"||typeof t.warning=="function"||typeof t.success=="function"||typeof t.note=="function"||typeof t.hint=="function"||typeof W=="function"||typeof se=="function"||typeof X=="function"||typeof fe=="function"||typeof _e=="function"?JSswift.reactive.effect(()=>{he()},"UI.FormField:message"):he(),s._refresh=H,s._control=S,s._el=x,s},Ne.InputRaw=(t={})=>{var F;const e=_.input({class:te(["cms-input-raw",t.class]),type:t.type||"text",name:t.name,placeholder:t.placeholder,autocomplete:t.autocomplete,value:t.value});let n=(F=e.value)!=null?F:"";const s=()=>{var b;const S=(b=e.value)!=null?b:"";S!==n&&(n=S,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let i=null,c=!1;const x=()=>{if(c)return;c=!0;let S=0;const b=()=>{if(s(),S+=1,S>=10){c=!1;return}setTimeout(b,120)};setTimeout(b,40)},d=()=>{i||(i=setInterval(()=>{if(document.activeElement!==e){clearInterval(i),i=null;return}s()},250))},r=()=>{i&&(clearInterval(i),i=null)};e.addEventListener("input",()=>{var S;n=(S=e.value)!=null?S:""}),e.addEventListener("change",()=>{var S;n=(S=e.value)!=null?S:""}),e.addEventListener("animationstart",S=>{S.animationName==="cms-autofill"&&(s(),d(),x())}),e.addEventListener("focus",()=>{d(),x(),setTimeout(s,50)}),e.addEventListener("blur",()=>{r(),setTimeout(s,0)}),setTimeout(s,0),x();const w=t.model;if(w){if(typeof w=="object"&&typeof w._bind=="function")bt.rodModel(e,w);else if(Array.isArray(w)&&typeof w[0]=="function"&&typeof w[1]=="function"){const S=bt.rodFromSignal(w[0],w[1]);bt.rodModel(e,S)}}return it(e,t,{isEnabled:()=>!e.disabled,action:()=>Fe(e,{selectText:!!t.selectOnShortcode})}),e},Ne.Input=(t={})=>{var Z,he,H;const e=t.slots||{},n={...t,label:(Z=t.label)!=null?Z:t.placeholder},s=_.input({class:te(["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=(H=s.value)!=null?H:"";const c=()=>{var se;const W=(se=s.value)!=null?se:"";W!==i&&(i=W,s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})))};let x=null,d=!1;const r=()=>{if(d)return;d=!0;let W=0;const se=()=>{if(c(),W+=1,W>=10){d=!1;return}setTimeout(se,120)};setTimeout(se,40)},w=()=>{x||(x=setInterval(()=>{if(document.activeElement!==s){clearInterval(x),x=null;return}c()},250))},F=()=>{x&&(clearInterval(x),x=null)};s.addEventListener("input",()=>{var W,se;i=(W=s.value)!=null?W:"",(se=t.onInput)==null||se.call(t,s.value)}),s.addEventListener("change",()=>{var W,se;i=(W=s.value)!=null?W:"",(se=t.onChange)==null||se.call(t,s.value)}),s.addEventListener("focus",W=>{var se;(se=t.onFocus)==null||se.call(t,W),w(),r(),setTimeout(c,50)}),s.addEventListener("blur",W=>{var se;(se=t.onBlur)==null||se.call(t,W),F(),setTimeout(c,0)}),s.addEventListener("animationstart",W=>{W.animationName==="cms-autofill"&&(c(),w(),r())}),setTimeout(c,0),r();const S=t.model;if(S){const W=se=>{let X=!1;const fe=be=>{const me=be!=null?be:"";s.value!==me&&(s.value=me,i=me)};se.action(be=>{if(!X){X=!0;try{fe(be)}finally{X=!1}}}),JSswift.reactive.untracked(()=>fe(se.value));const _e=be=>{if(X||be!=null&&be.isComposing)return;const me=s.value;if(se.value!==me){X=!0;try{se.value=me}finally{X=!1}}};s.addEventListener("input",_e),s.addEventListener("compositionend",_e),typeof se.onDispose=="function"&&se.onDispose(()=>{s.removeEventListener("input",_e),s.removeEventListener("compositionend",_e)})};if(typeof S=="object"&&typeof S._bind=="function")W(S);else if(Array.isArray(S)&&typeof S[0]=="function"&&typeof S[1]=="function"){const se=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(S[0],S[1]));W(se)}}const b=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),P=Array.isArray(b)?_.div({style:{display:"contents"}},...b):b,re=Ne.FormField({...n,control:P,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var W;return(W=re._refresh)==null?void 0:W.call(re)}),s.addEventListener("change",()=>{var W;return(W=re._refresh)==null?void 0:W.call(re)}),re._input=s,it(s,t,{isEnabled:()=>!s.disabled,action:()=>Fe(s,{selectText:!!t.selectOnShortcode})}),re},Ne.Textarea=(t={})=>{var w,F,S,b;const e=t.slots||{},n={...t,label:(w=t.label)!=null?w:t.placeholder,wrapClass:te(["cms-textarea-field",t.wrapClass])},s=_.textarea({class:te(["cms-input","cms-textarea",t.class]),name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,rows:t.rows,cols:t.cols,maxLength:(F=t.maxLength)!=null?F:t.maxlength,minLength:(S=t.minLength)!=null?S:t.minlength,wrap:t.wrap,value:(b=t.value)!=null?b:"",disabled:!!t.disabled,readOnly:!!t.readonly});s.addEventListener("input",()=>{var P;(P=t.onInput)==null||P.call(t,s.value)}),s.addEventListener("change",()=>{var P;(P=t.onChange)==null||P.call(t,s.value)}),s.addEventListener("focus",P=>{var re;(re=t.onFocus)==null||re.call(t,P)}),s.addEventListener("blur",P=>{var re;(re=t.onBlur)==null||re.call(t,P)});const i=t.model;if(i){const P=re=>{let Z=!1;const he=W=>{const se=W!=null?W:"";s.value!==se&&(s.value=se)};re.action(W=>{if(!Z){Z=!0;try{he(W)}finally{Z=!1}}}),JSswift.reactive.untracked(()=>he(re.value));const H=W=>{if(Z||W!=null&&W.isComposing)return;const se=s.value;if(re.value!==se){Z=!0;try{re.value=se}finally{Z=!1}}};s.addEventListener("input",H),s.addEventListener("compositionend",H),typeof re.onDispose=="function"&&re.onDispose(()=>{s.removeEventListener("input",H),s.removeEventListener("compositionend",H)})};if(typeof i=="object"&&typeof i._bind=="function")P(i);else if(Array.isArray(i)&&typeof i[0]=="function"&&typeof i[1]=="function"){const re=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(i[0],i[1]));P(re)}}const c=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",x=JSswift.ui.renderSlot(e,c,{textarea:s,input:s,props:t},s),d=Array.isArray(x)?_.div({style:{display:"contents"}},...x):x,r=Ne.FormField({...n,control:d,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var P;return(P=r._refresh)==null?void 0:P.call(r)}),s.addEventListener("change",()=>{var P;return(P=r._refresh)==null?void 0:P.call(r)}),r._input=s,r._textarea=s,it(s,t,{isEnabled:()=>!s.disabled,action:()=>Fe(s,{selectText:!!t.selectOnShortcode})}),r},Ne.Search=(t={})=>{var T,Pe;const e=t.slots||{},n=O=>!!O&&(typeof O=="object"&&typeof O._bind=="function"||vt(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),[c,x]=JSswift.reactive.signal(i==null?"":String(i)),[d,r]=JSswift.reactive.signal(!1),[w,F]=JSswift.reactive.signal(!1),[S,b]=JSswift.reactive.signal(null),[P,re]=JSswift.reactive.signal([]),[Z,he]=JSswift.reactive.signal(-1),H=`cms-search-${Math.random().toString(36).slice(2,10)}`,W=new Map;let se=null,X=null,fe=null,_e=0,be=0,me=!1,de=-1,ce=[];const $=(O,k)=>{const v=Number(o(O));return Number.isFinite(v)?v:k},le=(O,k=!1)=>{const v=o(O);return v==null?k:!!v},oe=()=>le(t.disabled,!1),Se=()=>le(t.readonly,!1),L=()=>Math.max(0,$(t.minLength,t.endpoint?1:0)),m=()=>Math.max(0,$(t.debounce,250)),h=O=>{var v,u,I,xe,Ue;const k=t.getLabel||t.labelOf;return typeof k=="function"?k(O):O==null?"":typeof O=="string"||typeof O=="number"?String(O):(Ue=(xe=(I=(u=(v=O.label)!=null?v:O.title)!=null?u:O.name)!=null?I:O.text)!=null?xe:O.value)!=null?Ue:""},p=O=>{var v,u,I;const k=t.getValue||t.valueOf;return typeof k=="function"?k(O):O==null?"":typeof O=="string"||typeof O=="number"?O:(I=(u=(v=O.value)!=null?v:O.id)!=null?u:O.key)!=null?I:h(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:[],ie=async(O,k)=>{const v=typeof O=="function"?O(k,{props:t}):o(O);return v&&typeof v.then=="function"?await v:v},a=(O,k)=>{const v=typeof O=="function"?O(k,{props:t}):o(O);if(!v)return"";const u=String(v),I=new URL(u,window.location.href),xe=o(t.queryParam)||"q";xe&&I.searchParams.set(xe,k);const Ue=typeof t.params=="function"?t.params(k,{props:t}):o(t.params);return Ue&&typeof Ue=="object"&&Object.keys(Ue).forEach(et=>{const G=o(Ue[et]);G==null||G===!1||I.searchParams.set(et,String(G))}),I.toString()},C=(O,k={})=>{var u,I;const v=O==null?"":String(O);c()!==v&&x(v),ae.value!==v&&(ae.value=v),se&&!k.fromModel&&se(v),k.fromModel||(u=t.onInput)==null||u.call(t,v,k.event),(I=Ie==null?void 0:Ie._refresh)==null||I.call(Ie)},g=()=>{r(!1),he(-1)},M=()=>w()||S()||P().length?!0:c().trim().length>=L()?!!(t.emptyText||JSswift.ui.getSlot(e,"empty")!=null):!!(t.startText||JSswift.ui.getSlot(e,"empty")!=null),Y=()=>{oe()||M()&&(r(!0),Me())},Q=()=>{re([]),b(null),he(-1)},ve=async(O,k={})=>{var G,Ge,lt,tt,dt,St;const v=O==null?"":String(O).trim(),u=++_e,I=o((G=t.endpoint)!=null?G:t.url),xe=(lt=(Ge=t.items)!=null?Ge:t.options)!=null?lt:t.suggestions;if(fe&&(fe.abort(),fe=null),v.length<L()){F(!1),Q(),k.open&&M()?Y():M()||g();return}const Ue=t.cache!==!1,et=`${I||"local"}::${v}`;if(Ue&&W.has(et)){re(W.get(et)),b(null),F(!1),he(W.get(et).length?0:-1),k.open!==!1&&Y();return}F(!0),b(null),k.open!==!1&&Y(),(tt=t.onSearch)==null||tt.call(t,v);try{let It;if(I){fe=new AbortController;const st=a(I,v),wt=await fetch(st,{method:"GET",headers:t.headers,credentials:t.credentials,signal:fe.signal});if(!wt.ok)throw new Error(`Search request failed (${wt.status})`);It=await(t.parseResponse||(Dt=>Dt.json()))(wt)}else if(xe!=null){const st=V(await ie(xe,v)),wt=t.filter||((Ft,Dt)=>String(h(Ft)).toLowerCase().includes(Dt.toLowerCase()));It=st.filter(Ft=>wt(Ft,v))}else It=[];if(u!==_e)return;const Rt=typeof t.mapResponse=="function"?t.mapResponse(It,v):V(It),Pt=V(Rt);Ue&&W.set(et,Pt),re(Pt),he(Pt.length?0:-1),(dt=t.onResults)==null||dt.call(t,Pt,v)}catch(It){if((It==null?void 0:It.name)==="AbortError"||u!==_e)return;b(It),re([]),he(-1),(St=t.onError)==null||St.call(t,It,v)}finally{u===_e&&(F(!1),fe=null,Me())}},N=(O,k={})=>{X&&clearTimeout(X);const v=k.immediate?0:m();X=setTimeout(()=>{X=null,ve(O,k)},v)},f=O=>{var v;const k=c();(v=t.onSubmit)==null||v.call(t,k,O),t.submitOnEnter!==!1&&N(k,{immediate:!0,open:!0})},A=(O,k)=>{var I;if(!O)return;const v=p(O),u=h(O);t.commitValue==="value"?C(v,{event:k}):t.commitValue!==!1&&C(u,{event:k}),(I=t.onSelect)==null||I.call(t,O,{value:v,label:u,query:c(),event:k}),t.closeOnSelect!==!1&&g()},z=O=>{const k=P();if(!k.length)return;const v=Z(),u=v<0?O>0?0:k.length-1:Math.max(0,Math.min(k.length-1,v+O));he(u)},K=O=>{const k=O==null?"":String(O),v=c().trim();if(!v||t.highlight===!1)return[document.createTextNode(k)];const u=k.toLowerCase().indexOf(v.toLowerCase());return u<0?[document.createTextNode(k)]:[document.createTextNode(k.slice(0,u)),_.mark({class:"cms-search-highlight"},k.slice(u,u+v.length)),document.createTextNode(k.slice(u+v.length))]},ke=O=>{var u,I;const k=h(O),v=O&&typeof O=="object"?(I=(u=O.description)!=null?u:O.subtitle)!=null?I:O.note:null;return _.div({class:"cms-search-result-content"},_.div({class:"cms-search-result-label"},...K(k)),v?_.div({class:"cms-search-result-description"},String(v)):null)},Me=()=>{!d()||Ee.parentNode!==document.body||be||(be=requestAnimationFrame(()=>{if(be=0,!d()||!De.isConnected||Ee.parentNode!==document.body)return;const O=De.getBoundingClientRect(),k=6,v=8,u=Math.max(180,window.innerWidth-v*2),I=Math.min(Math.max(O.width,$(t.minMenuWidth,260)),u),xe=Math.max(v,Math.min(O.left,window.innerWidth-I-v));Ee.style.width=`${I}px`,Ee.style.left=`${xe}px`,Ee.style.right="auto";const Ue=Ee.getBoundingClientRect().height||0,et=window.innerHeight-O.bottom-k-v,G=O.top-k-v;let lt=et<180&&G>et?O.top-k-Ue:O.bottom+k;lt=Math.max(v,Math.min(lt,window.innerHeight-Ue-v)),Ee.style.top=`${lt}px`}))},Te=()=>{me||(me=!0,window.addEventListener("resize",Me),window.addEventListener("scroll",Me,!0))},U=()=>{me&&(me=!1,window.removeEventListener("resize",Me),window.removeEventListener("scroll",Me,!0))},j=()=>{Ee.parentNode!==document.body&&(be&&(cancelAnimationFrame(be),be=0),Ee.classList.add("portal"),Ee.style.display="block",document.body.appendChild(Ee),Te(),Me())},ne=()=>{be&&(cancelAnimationFrame(be),be=0),U(),Ee.parentNode!==De&&De.appendChild(Ee),Ee.classList.remove("portal"),Ee.style.display="",Ee.style.position="",Ee.style.top="",Ee.style.left="",Ee.style.right="",Ee.style.width=""},Ve=t.label!=null||JSswift.ui.getSlot(e,"label")!=null,He=()=>{if(!Ve){ae.placeholder=o(t.placeholder)||"";return}ae.placeholder=document.activeElement===ae&&o(t.placeholder)||""},ae=_.input({id:t.id,class:te(["cms-input","cms-search-input",t.inputClass]),type:"search",name:t.name,placeholder:Ve?"":t.placeholder,autocomplete:t.autocomplete||"off",inputmode:t.inputmode,value:c(),disabled:oe(),readOnly:Se(),role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-controls":`${H}-list`}),$e=_.div({id:`${H}-list`,class:"cms-search-results",role:"listbox"}),Ee=_.div({class:te(["cms-search-menu","cms-singularity-menu-select",t.menuClass,ye(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:O=>O.stopPropagation()},$e),De=_.div({class:te(["cms-search",t.class]),role:"presentation"},ae,Ee);let Ie=null;if(s){if(typeof s=="object"&&typeof s._bind=="function")s.action(O=>C(O,{fromModel:!0})),se=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(()=>{C(O(),{fromModel:!0})},"UI.Search:model"),se=v=>k(v)}}else Ye(t.value)&&JSswift.reactive.effect(()=>{C(o(t.value),{fromModel:!0})},"UI.Search:value");ae.addEventListener("input",O=>{C(ae.value,{event:O}),t.searchOnInput!==!1&&N(ae.value,{open:!0})}),ae.addEventListener("change",O=>{var k;return(k=t.onChange)==null?void 0:k.call(t,ae.value,O)}),ae.addEventListener("focus",O=>{var k;He(),(k=t.onFocus)==null||k.call(t,O),t.openOnFocus!==!1&&(t.searchOnFocus&&!P().length?N(ae.value,{immediate:!0,open:!0}):Y())}),ae.addEventListener("blur",O=>{var k;He(),(k=t.onBlur)==null||k.call(t,O)}),ae.addEventListener("keydown",O=>{if(oe()||Se())return;const k=d(),v=P(),u=Z();if(O.key==="Escape"){k&&(O.preventDefault(),g());return}if(O.key==="ArrowDown"){O.preventDefault(),k?z(1):(Y(),v.length||N(ae.value,{immediate:!0,open:!0}));return}if(O.key==="ArrowUp"){O.preventDefault(),k?z(-1):Y();return}if(O.key==="Home"&&k&&v.length&&(O.metaKey||O.ctrlKey)){O.preventDefault(),he(0);return}if(O.key==="End"&&k&&v.length&&(O.metaKey||O.ctrlKey)){O.preventDefault(),he(v.length-1);return}O.key==="Enter"&&(k&&u>=0&&v[u]?(O.preventDefault(),A(v[u],O)):f(O))});const qe=O=>{if(!De.isConnected)return;const k=O.target;De.contains(k)||Ee.contains(k)||g()};document.addEventListener("click",qe,!0),JSswift.reactive.effect(()=>{const O=d();De.classList.toggle("open",O),ae.setAttribute("aria-expanded",O?"true":"false"),O?j():ne()},"UI.Search:open"),JSswift.reactive.effect(()=>{const O=oe(),k=Se();De.classList.toggle("disabled",O),De.classList.toggle("readonly",k),ae.disabled=O,ae.readOnly=k},"UI.Search:disabled"),JSswift.reactive.effect(()=>{const O=w(),k=S(),v=P(),u=c();if($e.innerHTML="",ce=[],de=-1,O){const I=JSswift.ui.renderSlot(e,"loading",{query:u},t.loadingText||"Caricamento...");$e.appendChild(_.div({class:"cms-search-empty is-loading"},...J(null,"default",{},I)))}else if(k){const I=JSswift.ui.renderSlot(e,"error",{error:k,query:u},t.errorText||"Errore ricerca");$e.appendChild(_.div({class:"cms-search-empty is-error"},...J(null,"default",{},I)))}else if(v.length)v.forEach((I,xe)=>{const et=h(I),G=p(I),Ge=dt=>A(I,dt),lt=JSswift.ui.renderSlot(e,"result",{item:I,index:xe,active:!1,label:et,value:G,query:u,select:Ge},ke(I)),tt=_.div({id:`${H}-result-${xe}`,class:te(["cms-search-result",""]),role:"option","aria-selected":"false",onMouseEnter:()=>he(xe),onMouseDown:dt=>dt.preventDefault(),onClick:Ge},...J(null,"default",{},lt));$e.appendChild(tt),ce[xe]=tt});else{const xe=u.trim().length>=L()?t.emptyText||"Nessun risultato":t.startText||"",Ue=JSswift.ui.renderSlot(e,"empty",{query:u},xe);(xe||JSswift.ui.getSlot(e,"empty")!=null)&&$e.appendChild(_.div({class:"cms-search-empty"},...J(null,"default",{},Ue)))}M()||g(),Me()},"UI.Search:render"),JSswift.reactive.effect(()=>{const O=Z();O!==de&&(ce[de]&&(ce[de].classList.remove("active"),ce[de].setAttribute("aria-selected","false")),ce[O]?(ce[O].classList.add("active"),ce[O].setAttribute("aria-selected","true"),ce[O].scrollIntoView({block:"nearest"}),ae.setAttribute("aria-activedescendant",`${H}-result-${O}`)):ae.removeAttribute("aria-activedescendant"),de=O)},"UI.Search:active"),Ie=Ne.FormField({...t,icon:(T=t.icon)!=null?T:"search",wrapClass:te(["cms-search-field",t.wrapClass]),control:De,getValue:()=>c(),onClear:()=>{var O;oe()||Se()||(C("",{}),Q(),(O=t.onClear)==null||O.call(t))},onFocus:()=>ae.focus()}),ae.addEventListener("input",()=>{var O;return(O=Ie._refresh)==null?void 0:O.call(Ie)}),ae.addEventListener("change",()=>{var O;return(O=Ie._refresh)==null?void 0:O.call(Ie)}),Ie._input=ae,Ie._search=De,Ie._open=Y,Ie._close=g,Ie._searchNow=()=>ve(c(),{immediate:!0,open:!0}),Ie._getResults=P,Ie._setValue=O=>C(O,{});let Be=!1;return Ie._dispose=()=>{Be||(Be=!0,document.removeEventListener("click",qe,!0),X&&clearTimeout(X),fe&&fe.abort(),ne())},(Pe=JSswift._registerCleanup)==null||Pe.call(JSswift,Ie,Ie._dispose),it(ae,t,{isEnabled:()=>!ae.disabled,action:()=>Fe(ae,{selectText:!!t.selectOnShortcode})}),(t.autoSearch||t.searchOnMount)&&N(c(),{immediate:!0,open:!1}),Ie},Ne.Select=(t={})=>{var Pe,O;const e={...t,label:(Pe=t.label)!=null?Pe:t.placeholder},n=t.filterable,s=!!t.multiple||!!t.multi,i=!!t.allowCustom||!!t.allowCustomValue,c=t.slots||{},x=k=>!!k&&(typeof k=="object"&&typeof k._bind=="function"||vt(k)),d=x(t.model)?t.model:x(t.value)?t.value:null,r=k=>Array.isArray(k)?k.slice():k==null||k===""?[]:[k],w=k=>s?r(k):k,F=d?JSswift.reactive.untracked(()=>typeof d=="object"&&typeof d._bind=="function"?d.value:d[0]()):t.value,[S,b]=JSswift.reactive.signal(!1),[P,re]=JSswift.reactive.signal(""),[Z,he]=JSswift.reactive.signal(s?r(F):F!=null?F:""),[H,W]=JSswift.reactive.signal(!1),[se,X]=JSswift.reactive.signal([]),[fe,_e]=JSswift.reactive.signal([]),[be,me]=JSswift.reactive.signal(-1);let de=null;if(d){if(typeof d=="object"&&typeof d._bind=="function")JSswift.reactive.untracked(()=>he(w(d.value))),d.action(k=>he(w(k))),de=k=>{const v=w(k);d.value!==v&&(d.value=v)};else if(Array.isArray(d)&&typeof d[0]=="function"&&typeof d[1]=="function"){const k=d[0],v=d[1];JSswift.reactive.untracked(()=>{JSswift.reactive.effect(()=>{he(w(k()))},"UI.Select:model")}),de=u=>v(w(u))}}function ce(){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 $(k){var v,u,I,xe;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((v=k.label)!=null?v:""),options:k.options};const Ue=(u=k.label)!=null?u:k.value!=null?String(k.value):"";return{type:"option",label:String(Ue),value:(xe=(I=k.value)!=null?I:k.label)!=null?xe:"",disabled:!!k.disabled}}return{type:"option",label:String(k),value:k,disabled:!1}}function le(k){const u=(Array.isArray(k)?k:[]).map($).filter(Boolean),I=[],xe=[];for(const Ue of u)if(Ue.type==="group"){I.push({type:"group",label:Ue.label});const et=(Ue.options||[]).map($).filter(Boolean).filter(G=>G.type==="option");for(const G of et)I.push(G),xe.push(G)}else I.push(Ue),xe.push(Ue);X(I),_e(xe)}async function oe(){const k=t.options;let v;try{const u=typeof k=="function"?JSswift.ui.withoutRodPathCapture(()=>k()):k;u&&typeof u.then=="function"?(W(!0),v=await u):v=u,le(v)}catch(u){console.error("[UI.Select] options load error:",u),le([])}finally{W(!1)}}function Se(k){var u;const v=w(k);he(v),de&&de(v),(u=t.onChange)==null||u.call(t,v)}function L(k){const v=r(Z()),I=v.some(xe=>xe==k)?v.filter(xe=>xe!=k):[...v,k];Se(I)}function m(k,v=!1){s?(L(k),v&&h()):(Se(k),p())}function h(){re(""),ve&&(ve.value="")}function p(){b(!1),h(),me(-1)}async function V(){if(ce())return;b(!0),await oe();const k=Z(),v=fe();let u=-1;if(s){const I=r(k);for(const xe of I)if(u=v.findIndex(Ue=>Ue.value==xe&&!Ue.disabled),u>=0)break}else u=v.findIndex(I=>I.value==k&&!I.disabled);u<0&&(u=v.findIndex(I=>!I.disabled)),me(u),ve&&setTimeout(()=>ve.focus(),0)}function ie(){S()?p():V()}const a=_.div({class:te(["cms-select",s?"multiple":"",t.class]),tabIndex:ce()?-1:0,role:"combobox","aria-expanded":"false","aria-disabled":ce()?"true":"false"}),C=_.div({class:te(["cms-select-value",s?"cms-select-value-multi":""])});JSswift.reactive.effect(()=>{const k=fe();if(C.innerHTML="",s){const v=r(Z());for(const u of v){const I=k.find(G=>G.value==u),xe=I?I.label:u==null?"":String(u);let Ue=!1;const et=Ne.Chip({label:xe,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:G=>{var Ge,lt,tt;(Ge=G==null?void 0:G.preventDefault)==null||Ge.call(G),(lt=G==null?void 0:G.stopPropagation)==null||lt.call(G),(tt=G==null?void 0:G.stopImmediatePropagation)==null||tt.call(G),!Ue&&(Ue=!0,L(u))}});C.appendChild(et)}}else{const v=Z(),u=k.find(I=>I.value==v);C.textContent=u?u.label:v==null||v===""?"":String(v)}},"UI.Select:value");const g=_.div({class:"cms-select-arrow"});JSswift.reactive.effect(()=>{const k=JSswift.ui.renderSlot(c,"arrow",{open:S()},Ne.Icon("#chevron-down"));g.innerHTML="",J(null,"default",{},k).forEach(v=>g.appendChild(v))},"UI.Select:arrow");const M=_.div({class:"cms-select-control",onClick:ie},C,g),Y=_.div({class:"cms-select-options",role:"listbox","aria-multiselectable":s?"true":"false"}),Q=_.div({class:"cms-select-filter cms-d-none"});let ve=null;const N=_.input({class:"cms-input",type:"text",placeholder:t.filterPlaceholder||"Cerca...",onInput:k=>re(k.target.value||"")}),f=()=>{const k=JSswift.ui.renderSlot(c,"filter",{value:P(),setValue:u=>{const I=u==null?"":String(u);re(I),ve&&"value"in ve&&(ve.value=I)},close:p},N);Q.innerHTML="";const v=J(null,"default",{},k);v.forEach(u=>Q.appendChild(u)),ve=v.length===1&&v[0]&&v[0].tagName==="INPUT"?v[0]:null,ve&&(ve.value=P()||"")};JSswift.reactive.untracked(f),JSswift.reactive.effect(()=>{const k=P()||"";ve&&"value"in ve&&ve.value!==k&&(ve.value=k)},"UI.Select:filterValue"),typeof n=="boolean"?n?Q.classList.remove("cms-d-none"):Q.classList.add("cms-d-none"):n!=null&&n.action&&(n.action(k=>{k?Q.classList.remove("cms-d-none"):Q.classList.add("cms-d-none")}),n.value?Q.classList.remove("cms-d-none"):Q.classList.add("cms-d-none"));const A={...t};wn(A);const z=Ct([A.color,A.state],()=>{const k=o(A.color)||o(A.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(k)?k:o(A.state)||""}),K=_.div({class:te(["cms-select-menu","cms-singularity-menu-select",z,A.class,ye(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:k=>k.stopPropagation()},Q,Y);let ke=0,Me=!1;const Te=()=>{!S()||K.parentNode!==document.body||ke||(ke=requestAnimationFrame(()=>{if(ke=0,!S()||!a.isConnected||K.parentNode!==document.body)return;const k=a.getBoundingClientRect(),v=6,u=8,I=Math.max(160,window.innerWidth-u*2),xe=Math.min(Math.max(k.width,180),I),Ue=Math.max(u,Math.min(k.left,window.innerWidth-xe-u));K.style.width=`${xe}px`,K.style.left=`${Ue}px`,K.style.right="auto",K.style.marginTop="0";const et=K.getBoundingClientRect().height||0,G=window.innerHeight-k.bottom-v-u,Ge=k.top-v-u;let tt=G<180&&Ge>G?k.top-v-et:k.bottom+v;tt=Math.max(u,Math.min(tt,window.innerHeight-et-u)),K.style.top=`${tt}px`}))},U=()=>{Me||(Me=!0,window.addEventListener("resize",Te),window.addEventListener("scroll",Te,!0))},j=()=>{Me&&(Me=!1,window.removeEventListener("resize",Te),window.removeEventListener("scroll",Te,!0))},ne=()=>{K.parentNode!==document.body&&(ke&&(cancelAnimationFrame(ke),ke=0),K.classList.add("portal"),K.style.display="block",document.body.appendChild(K),U(),Te())},Ve=()=>{ke&&(cancelAnimationFrame(ke),ke=0),j(),K.parentNode!==a&&a.appendChild(K),K.classList.remove("portal"),K.style.display="",K.style.position="",K.style.top="",K.style.left="",K.style.right="",K.style.width="",K.style.marginTop=""};a.appendChild(M),a.appendChild(K),JSswift.reactive.effect(()=>{const k=S();a.classList.toggle("open",k),a.setAttribute("aria-expanded",k?"true":"false"),k?ne():Ve()},"UI.Select:open"),JSswift.reactive.effect(()=>{const k=ce();a.classList.toggle("disabled",k),a.tabIndex=k?-1:0,a.setAttribute("aria-disabled",k?"true":"false")},"UI.Select:disabled");let He=[],ae=-1,$e=-1;function Ee(){var v;const k=be();$e=k,k!==ae&&(He[ae]&&He[ae].classList.remove("active"),He[k]&&He[k].classList.add("active"),ae=k,k>=0&&((v=He[k])==null||v.scrollIntoView({block:"nearest"})))}JSswift.reactive.effect(()=>{const k=se(),v=fe(),u=(P()||"").toLowerCase().trim(),I=Z(),xe=s?r(I):[I],Ue=H(),et=$e;Y.innerHTML="",He=[],ae=-1;const G=[];let Ge=0;const lt=tt=>{const dt=xe.some(Ft=>Ft==tt.value),St=!!tt.disabled,It=["cms-select-option",dt?"selected":"",St?"disabled":""].filter(Boolean).join(" "),Rt=()=>{s?L(tt.value):(Se(tt.value),p())},Pt=JSswift.ui.renderSlot(c,"option",{opt:tt,selected:dt,active:Ge===et,disabled:St,select:Rt},tt.label),st=J(null,"default",{},Pt),wt=_.div({class:It,"data-flat-index":String(Ge),onClick:St?null:Rt},...st);G.push(wt),He[Ge]=wt,Ge++};if(u){const tt=v.filter(dt=>dt.label.toLowerCase().includes(u));if(tt.length===0){const dt=JSswift.ui.renderSlot(c,"empty",{filter:u},t.emptyText||"Nessuna opzione");Y.appendChild(_.div({class:"cms-select-empty"},...J(null,"default",{},dt))),S()&&Te();return}for(const dt of tt)lt(dt)}else{let tt=!1;for(const dt of k)if(dt.type==="group"){const St=JSswift.ui.renderSlot(c,"group",{label:dt.label},dt.label);G.push(_.div({class:"cms-select-group"},...J(null,"default",{},St)))}else tt=!0,lt(dt);if(!tt){const dt=JSswift.ui.renderSlot(c,"empty",{filter:u},t.emptyText||"Nessuna opzione");Y.appendChild(_.div({class:"cms-select-empty"},...J(null,"default",{},dt))),S()&&Te();return}}if(Ue){const tt=JSswift.ui.renderSlot(c,"loading",{},"Caricamento...");Y.appendChild(_.div({class:"cms-select-empty"},...J(null,"default",{},tt))),S()&&Te();return}for(const tt of G)Y.appendChild(tt);Ee(),S()&&Te()},"UI.Select:render"),JSswift.reactive.effect(()=>{Ee()},"UI.Select:paintActive");const De=k=>{if(!a.isConnected)return;const v=k.target;a.contains(v)||K.contains(v)||p()};document.addEventListener("click",De,!0);const Ie=k=>{if(ce())return;const v=S(),u=fe(),I=be(),xe=ve&&k.target===ve,Ue=(G,Ge)=>{let lt=G;for(;lt>=0&<<u.length;){if(!u[lt].disabled)return lt;lt+=Ge}return-1},et=G=>{if(!G)return null;const Ge=G.toLowerCase();let lt=u.find(tt=>String(tt.label).toLowerCase()===Ge||String(tt.value).toLowerCase()===Ge);return lt||(lt=u.find(tt=>String(tt.label).toLowerCase().includes(Ge))),lt&&!lt.disabled?lt:null};if(k.key==="Escape"){v&&(k.preventDefault(),p());return}if(xe&&(k.key==="Enter"||k.key===" ")){const G=(P()||"").trim();if(G){const Ge=et(G);if(Ge){k.preventDefault(),m(Ge.value,!0);return}if(i&&k.key==="Enter"){k.preventDefault(),m(G,!0);return}if(k.key==="Enter"){k.preventDefault();return}}if(k.key===" ")return}if(k.key==="Enter"||k.key===" "){if(k.preventDefault(),!v){V();return}I>=0&&u[I]&&!u[I].disabled&&(s?L(u[I].value):(Se(u[I].value),p()));return}if(k.key==="ArrowDown"){if(k.preventDefault(),!v){V();return}const G=Ue(I<0?0:I+1,1);G>=0&&me(G);return}if(k.key==="ArrowUp"){if(k.preventDefault(),!v){V();return}const G=Ue(I<0?u.length-1:I-1,-1);G>=0&&me(G);return}if(k.key==="Home"){if(!v)return;k.preventDefault();const G=Ue(0,1);G>=0&&me(G);return}if(k.key==="End"){if(!v)return;k.preventDefault();const G=Ue(u.length-1,-1);G>=0&&me(G);return}};a.addEventListener("keydown",Ie),Q.addEventListener("keydown",Ie);let qe=!1;a._dispose=()=>{qe||(qe=!0,document.removeEventListener("click",De,!0),a.removeEventListener("keydown",Ie),Q.removeEventListener("keydown",Ie),Ve())};const Be=()=>{const k=Z();return s?Array.isArray(k)&&k.length>0:k==null?!1:k!==""?!0:fe().some(v=>v.value==="")},T=Ne.FormField({...e,control:a,clearable:t.clearable,disabled:ce(),readonly:!1,hasValue:Be,getValue:()=>{const k=Z();return s?Array.isArray(k)&&k.length?k:"":k},onClear:()=>{ce()||(Se(s?[]:null),p())},onFocus:()=>{V()}});return JSswift.reactive.effect(()=>{var k;(k=T._refresh)==null||k.call(T)},"UI.Select:fieldRefresh"),T._select=a,T._dispose=a._dispose,(O=JSswift._registerCleanup)==null||O.call(JSswift,T,T._dispose),it(T,t,{isEnabled:()=>!ce(),action:()=>{if(ce())return!1;Fe(a),V()}}),oe(),T},Ne.Upload=(t={})=>{var Be;wn(t);const e=t.slots||{},[n,s]=JSswift.reactive.signal([]),[i,c]=JSswift.reactive.signal(!1),[x,d]=JSswift.reactive.signal(!1),[r,w]=JSswift.reactive.signal(null);let F=0,S=!1;const b=()=>!!o(t.disabled)||!!o(t.readonly),P=()=>t.multiple!==!1&&t.single!==!0,re=()=>{var T,Pe;return["form","native","submit","external"].includes(String(o((Pe=(T=t.submitMode)!=null?T:t.modeSubmit)!=null?Pe:t.uploadMode)||"").toLowerCase())},Z=()=>{var T;return o((T=t.showBrowse)!=null?T:t.browseButton)!==!1},he=()=>{var T;return!re()&&o((T=t.showUpload)!=null?T:t.uploadButton)!==!1},H=()=>{var T;return o((T=t.showClear)!=null?T:t.clearButton)!==!1},W=()=>{var T;return o((T=t.showFiles)!=null?T:t.files)!==!1},se=()=>{const T=Vt(o(t.state)||o(t.status));return T?`cms-state-${T}`:""},X=()=>t.fieldName||t.paramName||t.name||"file",fe=()=>{var T;return Math.max(1,Number(o((T=t.parallelUploads)!=null?T:t.parallel)||1))},_e=()=>{var Pe,O,k,v;const T=o(t.retry);return T===!0?{attempts:2,delay:350,factor:2}:T?{attempts:Math.max(0,Number((O=(Pe=T.attempts)!=null?Pe:T.retries)!=null?O:0)),delay:Math.max(0,Number((k=T.delay)!=null?k:350)),factor:Math.max(1,Number((v=T.factor)!=null?v:2))}:{attempts:0,delay:350,factor:2}},be=T=>T?Array.isArray(T)?T:Array.from(T):[],me=T=>{const Pe=Number(T||0);return Pe<1024?`${Pe} B`:Pe<1024*1024?`${(Pe/1024).toFixed(1)} KB`:Pe<1024*1024*1024?`${(Pe/1024/1024).toFixed(1)} MB`:`${(Pe/1024/1024/1024).toFixed(1)} GB`},de=()=>{var T;return String(o((T=t.acceptedFiles)!=null?T:t.accept)||"").trim()},ce=T=>{const Pe=de();if(!Pe)return!0;const O=String(T.name||"").toLowerCase(),k=String(T.type||"").toLowerCase();return Pe.split(",").map(v=>v.trim().toLowerCase()).filter(Boolean).some(v=>v.startsWith(".")?O.endsWith(v):v.endsWith("/*")?k.startsWith(v.slice(0,-1)):k===v)},$=()=>n().filter(T=>T.status!=="rejected"&&T.status!=="removed"),le=(T=0)=>$().reduce((Pe,O)=>Pe+Number(O.size||0),T),oe=()=>{var T;s(n().slice()),j.classList.toggle("is-busy",n().some(Pe=>Pe.status==="uploading")),j.classList.toggle("has-files",n().some(Pe=>Pe.status!=="removed")),(T=t.onChange)==null||T.call(t,n().slice(),ne)},Se=(T,Pe,O=null)=>{var v;const k={id:`upload_${Date.now()}_${++F}`,file:T,name:(T==null?void 0:T.name)||"file",size:Number((T==null?void 0:T.size)||0),type:(T==null?void 0:T.type)||"",status:"rejected",progress:0,error:Pe,detail:O,attempts:0,response:null,xhr:null};return n().push(k),(v=t.onRejected)==null||v.call(t,k,{reason:Pe,detail:O,api:ne}),k},L=async(T,Pe)=>{const O=t.maxFiles==null?null:Number(o(t.maxFiles)),k=t.maxFileSize==null?null:Number(o(t.maxFileSize)),v=t.minFileSize==null?null:Number(o(t.minFileSize)),u=t.maxTotalSize==null?null:Number(o(t.maxTotalSize));if(O!=null&&Pe>O)return"max-files";if(k!=null&&Number(T.size||0)>k)return"max-file-size";if(v!=null&&Number(T.size||0)<v)return"min-file-size";if(u!=null&&le(Number(T.size||0))>u)return"max-total-size";if(!ce(T))return"accept";const I=t.filter||t.acceptFile||t.validate;if(typeof I=="function"){const xe=await I(T,{files:n().slice(),api:ne});if(xe===!1)return"filter";if(typeof xe=="string")return xe}return null},m=async()=>{for(const T of n()){if(T.status!=="rejected"||T.error!=="max-files")continue;const Pe=await L(T.file,$().length+1);if(Pe){T.error=Pe;continue}T.status="queued",T.progress=0,T.error=null,T.detail=null}},h=T=>({id:`upload_${Date.now()}_${++F}`,file:T,name:(T==null?void 0:T.name)||"file",size:Number((T==null?void 0:T.size)||0),type:(T==null?void 0:T.type)||"",status:"queued",progress:0,bytesUploaded:0,error:null,detail:null,attempts:0,response:null,xhr:null}),p=async(T,Pe={})=>{var v;if(b())return[];w(null);const O=be(T),k=[];!P()&&O.length&&V({silent:!0});for(const u of O){const I=await L(u,$().length+1);if(I){Se(u,I);continue}const xe=h(u);if(n().push(xe),k.push(xe),(v=t.onAdded)==null||v.call(t,xe,{file:u,meta:Pe,api:ne}),!P())break}return oe(),k.length&&t.autoUpload&&!re()&&f(),k},V=(T={})=>{var Pe;for(const O of n())O.status==="uploading"&&a(O),O.status="removed";s([]),w(null),oe(),T.silent||(Pe=t.onClear)==null||Pe.call(t,ne)},ie=async T=>{var k;const Pe=typeof T=="string"?n().find(v=>v.id===T):T;if(!Pe)return;Pe.status==="uploading"&&a(Pe);const O=n().filter(v=>v!==Pe);s(O),await m(),oe(),(k=t.onRemove)==null||k.call(t,Pe,{api:ne})},a=T=>{var O,k,v;const Pe=typeof T=="string"?n().find(u=>u.id===T):T;!Pe||Pe.status!=="uploading"||(Pe.status="canceled",Pe.error="canceled",(k=(O=Pe.xhr)==null?void 0:O.abort)==null||k.call(O),(v=t.onCancel)==null||v.call(t,Pe,{api:ne}),oe())},C=()=>n().filter(T=>T.status==="uploading").forEach(a),g=async T=>{var O,k;const Pe={url:o(t.url),method:o(t.method||"POST"),headers:t.headers,formFields:t.formFields||t.fields,fieldName:X(),withCredentials:!!o((O=t.withCredentials)!=null?O:t.credentials),sendRaw:!!o(t.sendRaw)};if(typeof t.factory=="function")try{const v=await t.factory(T.file,{item:T,files:n().slice(),api:ne});if(v&&typeof v=="object")Object.assign(Pe,v);else if(v!=null)throw new Error("factory must return an object")}catch(v){throw(k=t.onFactoryFailed)==null||k.call(t,v,{item:T,api:ne}),v}return Pe},M=(T,Pe,O)=>{const k=typeof Pe=="function"?Pe(O.file,{item:O,api:ne}):Pe;k&&(k instanceof Headers?k.forEach((v,u)=>T.setRequestHeader(u,v)):Array.isArray(k)?k.forEach(v=>{Array.isArray(v)?T.setRequestHeader(v[0],v[1]):v!=null&&v.name&&T.setRequestHeader(v.name,v.value)}):typeof k=="object"&&Object.keys(k).forEach(v=>T.setRequestHeader(v,k[v])))},Y=(T,Pe,O)=>{const k=typeof Pe=="function"?Pe(O.file,{item:O,api:ne}):Pe;k&&(Array.isArray(k)?k.forEach(v=>{Array.isArray(v)?T.append(v[0],v[1]):v!=null&&v.name&&T.append(v.name,v.value)}):typeof k=="object"&&Object.keys(k).forEach(v=>T.append(v,k[v])))},Q=(T,Pe)=>new Promise((O,k)=>{if(!Pe.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 v=new XMLHttpRequest;T.xhr=v,v.open(String(Pe.method||"POST").toUpperCase(),Pe.url,!0),v.withCredentials=!!Pe.withCredentials,M(v,Pe.headers,T),v.upload.onprogress=I=>{var xe;I.lengthComputable&&(T.bytesUploaded=I.loaded,T.progress=Math.max(0,Math.min(100,Math.round(I.loaded/I.total*100))),(xe=t.onProgress)==null||xe.call(t,T,{event:I,api:ne}),oe())},v.onload=()=>{const I=v.status>=200&&v.status<300,xe={status:v.status,text:v.responseText,xhr:v};I?O(xe):k(Object.assign(new Error(`HTTP error ${v.status}`),{response:xe}))},v.onerror=()=>k(new Error("network-error")),v.onabort=()=>k(new Error("canceled"));const u=Pe.sendRaw?T.file:(()=>{const I=new FormData;return Y(I,Pe.formFields,T),I.append(Pe.fieldName||"file",T.file,T.name),I})();v.send(u)}),ve=async T=>{var k,v,u,I,xe,Ue;const Pe=_e();let O=Pe.delay;T.status="uploading",T.error=null,T.progress=Math.max(0,T.progress||0),(k=t.onStart)==null||k.call(t,T,{api:ne}),oe();for(let et=0;et<=Pe.attempts;et++){T.attempts=et+1;try{const G=await g(T),Ge=typeof t.upload=="function"||typeof t.uploader=="function"?await(t.upload||t.uploader)(T.file,{item:T,options:G,progress:lt=>{var tt;T.progress=Math.max(0,Math.min(100,Number(lt)||0)),(tt=t.onProgress)==null||tt.call(t,T,{api:ne}),oe()},api:ne}):await Q(T,G);return T.status="done",T.progress=100,T.response=Ge,T.xhr=null,(v=t.onSuccess)==null||v.call(t,T,{response:Ge,api:ne}),(u=t.onComplete)==null||u.call(t,T,{response:Ge,api:ne}),oe(),T}catch(G){if(String((G==null?void 0:G.message)||G)==="canceled"||T.status==="canceled")return T.status="canceled",T.error="canceled",T.xhr=null,(I=t.onComplete)==null||I.call(t,T,{error:G,api:ne}),oe(),T;if(et<Pe.attempts){await new Promise(Ge=>setTimeout(Ge,O)),O=Math.round(O*Pe.factor);continue}return T.status="error",T.error=G,T.xhr=null,w(G),(xe=t.onError)==null||xe.call(t,T,{error:G,api:ne}),(Ue=t.onComplete)==null||Ue.call(t,T,{error:G,api:ne}),oe(),T}}return T},N=()=>{var k;if(S||b())return;const T=n().filter(v=>v.status==="uploading").length,Pe=Math.max(0,fe()-T),O=n().filter(v=>v.status==="queued").slice(0,Pe);if(!O.length){const v=n().some(u=>u.status==="uploading");d(v),v||(k=t.onFinish)==null||k.call(t,n().slice(),{api:ne});return}d(!0),O.forEach(v=>{ve(v).finally(()=>N())})},f=(T=null)=>{(T?be(T):n().filter(O=>["queued","error","canceled"].includes(O.status))).forEach(O=>{const k=typeof O=="string"?n().find(v=>v.id===O):O;k&&k.status!=="uploading"&&k.status!=="done"&&k.status!=="rejected"&&(k.status="queued",k.progress=0,k.error=null)}),oe(),N()},A=T=>f([T]),z=()=>{b()||K.click()},K=_.input({type:"file",class:"cms-upload-input",name:X(),accept:de()||null,multiple:P(),capture:t.capture||null,disabled:b(),onChange:T=>{p(T.target.files,{event:T,source:"browse"}),T.target.value=""}}),ke=_.div({class:"cms-upload-list"}),Me=_.div({class:"cms-upload-summary"}),Te=_.div({class:"cms-upload-actions"});let U=se();const j=_.div({class:te(["cms-upload","cms-singularity",U,ye(t.box||t.variant==="box","cms-upload-box"),ye(t.compact,"is-compact"),ye(re(),"is-form-mode"),ye(!W(),"is-files-hidden"),t.class]),tabindex:b()?"-1":"0",role:"group","aria-disabled":b()?"true":"false"}),ne={addFiles:p,browse:z,upload:f,retry:A,retryAll:()=>f(n().filter(T=>T.status==="error"||T.status==="canceled")),remove:ie,clear:V,abort:a,abortAll:C,files:()=>n().slice(),state:()=>({files:n().slice(),busy:x(),dragging:i(),error:r()}),reset:V},Ve=()=>{const T={api:ne,files:n().slice(),busy:x(),disabled:b(),submitMode:re()?"form":"upload"},Pe=[];return Z()&&Pe.push(JSswift.ui.renderSlot(e,"browse",T,Ne.Btn({size:"sm",icon:"folder_open",label:t.browseText||"Browse",onClick:z}))),he()&&Pe.push(JSswift.ui.renderSlot(e,"upload",T,Ne.Btn({size:"sm",color:"primary",icon:"upload",label:t.uploadText||"Upload",loading:x(),disabled:b()||!n().some(O=>["queued","error","canceled"].includes(O.status)),onClick:()=>f()}))),H()&&Pe.push(JSswift.ui.renderSlot(e,"clear",T,Ne.Btn({size:"sm",color:"secondary",outline:!0,icon:"delete",label:t.clearText||"Clear",disabled:b()||!n().length,onClick:()=>V()}))),J(e,"actions",T,Pe)},He=(T,Pe)=>{var u;const O={item:T,file:T.file,index:Pe,api:ne,remove:()=>ie(T),retry:()=>A(T),abort:()=>a(T)},k=_.div({class:te(["cms-upload-file",`is-${T.status}`])},_.div({class:"cms-upload-file-icon"},Ne.Icon({name:T.status==="done"?"check_circle":T.status==="error"||T.status==="rejected"?"error":"description"})),_.div({class:"cms-upload-file-main"},_.div({class:"cms-upload-file-name"},...J(e,"fileName",O,T.name)),_.div({class:"cms-upload-file-meta"},...J(e,"fileMeta",O,T.error?String(((u=T.error)==null?void 0:u.message)||T.error):T.status==="queued"?"Queued":T.status)),_.div({class:"cms-upload-progress",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":String(T.progress||0)},_.div({class:"cms-upload-progress-bar",style:{width:`${T.progress||0}%`}}))),_.div({class:"cms-upload-file-trailing"},_.div({class:"cms-upload-file-size"},me(T.size)),_.div({class:"cms-upload-file-actions"},...J(e,"fileActions",O,[T.status==="uploading"?Ne.Btn({size:"sm",outline:!0,icon:"close","aria-label":"Cancel",onClick:()=>a(T)}):null,T.status==="error"||T.status==="canceled"?Ne.Btn({size:"sm",outline:!0,icon:"refresh","aria-label":"Retry",onClick:()=>A(T)}):null,Ne.Btn({size:"sm",dense:!0,outline:!0,icon:"delete","aria-label":"Remove",onClick:()=>ie(T)})])))),v=JSswift.ui.renderSlot(e,"file",O,k);return _.div({class:"cms-upload-file-wrap","data-status":T.status,"data-id":T.id},...J(null,"default",{},v))},ae=()=>{const T=n();if(Te.replaceChildren(...Ve()),ke.replaceChildren(),Me.hidden=!W(),ke.hidden=!W(),T.length)T.forEach((O,k)=>ke.appendChild(He(O,k)));else{const O=JSswift.ui.renderSlot(e,"empty",{api:ne},t.emptyText||"No files selected");ke.appendChild(_.div({class:"cms-upload-empty"},...J(null,"default",{},O)))}const Pe=T.filter(O=>O.status!=="rejected"&&O.status!=="removed");Me.textContent=`${Pe.length} file \u2022 ${me(Pe.reduce((O,k)=>O+Number(k.size||0),0))}`},$e=JSswift.ui.renderSlot(e,"icon",{api:ne},Ne.Icon({name:t.icon||"cloud_upload"})),Ee=JSswift.ui.renderSlot(e,"title",{api:ne},t.title||"Upload files"),De=JSswift.ui.renderSlot(e,"subtitle",{api:ne},t.subtitle||(de()?`Accepted: ${de()}`:"Drag files here or browse from your device")),Ie=_.div({class:"cms-upload-dropzone",onClick:T=>{var Pe,O;(O=(Pe=T.target)==null?void 0:Pe.closest)!=null&&O.call(Pe,".cms-upload-actions, .cms-upload-list")||t.clickable!==!1&&z()},onDragenter:T=>{t.drag===!1||b()||(T.preventDefault(),c(!0),j.classList.add("is-dragging"))},onDragover:T=>{t.drag===!1||b()||T.preventDefault()},onDragleave:T=>{T.currentTarget===T.target&&(c(!1),j.classList.remove("is-dragging"))},onDrop:T=>{var Pe,O;t.drag===!1||b()||(T.preventDefault(),c(!1),j.classList.remove("is-dragging"),(Pe=t.onDrop)==null||Pe.call(t,T,{api:ne}),p(((O=T.dataTransfer)==null?void 0:O.files)||[],{event:T,source:"drop"}))}},_.div({class:"cms-upload-head"},_.div({class:"cms-upload-icon"},...J(null,"default",{},$e)),_.div({class:"cms-upload-copy"},_.div({class:"cms-upload-title"},...J(null,"default",{},Ee)),_.div({class:"cms-upload-subtitle"},...J(null,"default",{},De))),Te),Me,ke),qe=JSswift.ui.renderSlot(e,"header",{api:ne},null);return J(null,"default",{},qe).forEach(T=>j.appendChild(T)),j.appendChild(K),J(e,"default",{api:ne,dropzone:Ie},Ie).forEach(T=>j.appendChild(T)),JSswift.reactive.effect(()=>{ae()},"UI.Upload:render"),JSswift.reactive.effect(()=>{j.classList.toggle("is-disabled",b()),j.classList.toggle("is-form-mode",re()),j.classList.toggle("is-files-hidden",!W());const T=se();T!==U&&(U&&j.classList.remove(U),T&&j.classList.add(T),U=T),j.setAttribute("aria-disabled",b()?"true":"false"),K.disabled=b(),K.multiple=P(),K.name=X()},"UI.Upload:disabled"),j._upload=ne,j._addFiles=p,j._browse=z,j._uploadFiles=f,j._input=K,j._dispose=()=>{S||(S=!0,C())},(Be=JSswift._registerCleanup)==null||Be.call(JSswift,j,j._dispose),j},Ne.BoxUpload=(t={})=>Ne.Upload({...t,box:!0}),Ne.boxUpload=(t={})=>Ne.BoxUpload(t),JSswift.ui.Upload=Ne.Upload,JSswift.ui.BoxUpload=Ne.BoxUpload,JSswift.ui.boxUpload=Ne.boxUpload;function Zt(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=>bt.reactive.effect(()=>{i(n())},e||"UI:model")}}return null}const nn={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"]}},Wn=t=>{const e=o(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},co=(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,c=!!e.nav&&!!s,r=[c&&s==="left"?"nav":i&&n==="left"?"aside":".","main",c&&s==="right"?"nav":i&&n==="right"?"aside":"."],w=[],F=[...t.rows||[]];if(c&&s==="top"&&!F.includes("nav")){const S=F.indexOf("body");F.splice(S>=0?S:F.length,0,"nav")}for(const S of F)S==="header"&&e.header?w.push(t.fullSide&&i&&n==="left"?["aside","header","header"]:t.fullSide&&i&&n==="right"?["header","header","aside"]:["header","header","header"]):S==="nav"&&c&&s==="top"?w.push(t.fullSide&&i&&n==="left"?["aside","nav","nav"]:t.fullSide&&i&&n==="right"?["nav","nav","aside"]:["nav","nav","nav"]):S==="body"?w.push(r):S==="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(S=>`"${S.join(" ")}"`).join(" "):null};Ne.Layout=(...t)=>{var fs,es,ts;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(Xe,pt)=>!!Xe&&Object.prototype.hasOwnProperty.call(Xe,pt),c=()=>typeof window=="undefined"?1024:window.innerWidth,x=()=>{const Xe=c(),pt=JSswift.uiResponsivePropsFor(e,xt("mobile"))||{},Mt=Xe>=768?JSswift.uiResponsivePropsFor(e,xt("tablet"))||{}:{},Kt=Xe>=1024?JSswift.uiResponsivePropsFor(e,xt("pc"))||{}:{};return{...pt,...Mt,...Kt}},d=(...Xe)=>{for(const pt of Xe)if(i(e,pt))return e[pt]},r=(...Xe)=>{const pt=x();for(const Mt of Xe)if(i(pt,Mt))return pt[Mt];return d(...Xe)},w=(...Xe)=>{const pt=JSswift.uiResponsivePropsFor(e,xt(U()))||{};for(const Mt of Xe)if(i(pt,Mt))return pt[Mt];return d(...Xe)},F=()=>Wn(w("disposition","layoutDisposition","layout")),S=()=>{const Xe=o(r("mode","layoutMode"));if(Xe==null||Xe===!1||Xe==="")return"";const pt=String(Xe).trim().toLowerCase();return pt==="global"||pt==="local"?pt:""},b=(Xe,pt=null)=>Xe==null||Xe===!1||Xe===""?pt:typeof Xe=="number"?`${Xe}px`:String(Xe),P=(Xe,pt=null)=>{if(Xe==null||Xe===!1||Xe==="")return pt;if(typeof Xe=="number"&&Number.isFinite(Xe))return Xe;const Mt=Number.parseFloat(String(Xe));return Number.isFinite(Mt)?Mt:pt},re=Xe=>{const pt=o(Xe);return pt==null||pt===!1||pt===""?null:Array.isArray(pt)?pt.map(Mt=>`"${Array.isArray(Mt)?Mt.join(" "):String(Mt)}"`).join(" "):String(pt)},Z=(Xe,pt=null,Mt=null)=>{let Kt=Number.isFinite(Xe)?Xe:0;return Number.isFinite(pt)&&(Kt=Math.max(pt,Kt)),Number.isFinite(Mt)&&(Kt=Math.min(Mt,Kt)),Kt},he=d("header","headerContent"),H=d("aside","drawer"),W=d("nav","asideRight","drawerRight"),se=d("page","main","content","body"),X=d("footer","footerContent"),fe=()=>o(r("drawerEnabled","asideEnabled")),_e=()=>o(r("navEnabled","asideRightEnabled","rightAsideEnabled")),be=()=>fe()!==!1,me=()=>_e()===!0||o(r("noNav"))===!1,de=()=>o(r("noDrawer"))===!0||fe()===!1||H===!1,ce=()=>o(r("noNav"))===!0||_e()===!1||W===!1,$=()=>o(r("drawerFloating"))===!0,le=()=>o(r("navFloating"))===!0,oe=()=>o(r("drawerResizable"))===!0,Se=()=>o(r("navResizable"))===!0,L=()=>P(o(r("drawerMinWidth")),180),m=()=>P(o(r("drawerMaxWidth")),null),h=()=>P(o(r("navMinWidth")),180),p=()=>P(o(r("navMaxWidth")),null),V=P(o(r("drawerWidth")),280),ie=P((fs=o(r("navWidth")))!=null?fs:o(r("asideRightWidth")),280),[a,C]=JSswift.reactive.signal(Z(V,L(),m())),[g,M]=JSswift.reactive.signal(Z(ie,h(),p())),Y=Zt(e.drawerOpen,"UI.Layout:drawerOpen"),Q=Y?!!Y.get():typeof e.drawerOpen=="boolean"?!!e.drawerOpen:!0,[ve,N]=JSswift.reactive.signal(Q),f=Xe=>{const pt=!!Xe;ve()!==pt&&N(pt),Y==null||Y.set(pt)};(es=Y==null?void 0:Y.watch)==null||es.call(Y,()=>{const Xe=!!Y.get();ve()!==Xe&&N(Xe)});const A=Zt(e.navOpen,"UI.Layout:navOpen"),z=A?!!A.get():typeof e.navOpen=="boolean"?!!e.navOpen:!0,[K,ke]=JSswift.reactive.signal(z),Me=Xe=>{const pt=!!Xe;K()!==pt&&ke(pt),A==null||A.set(pt)};(ts=A==null?void 0:A.watch)==null||ts.call(A,()=>{const Xe=!!A.get();K()!==Xe&&ke(Xe)});const Te=()=>{var Kt,en,tn;const Xe=Number((Kt=o(r("layoutBreakpoint")))!=null?Kt:0),pt=Number((en=o(r("drawerBreakpoint")))!=null?en:Xe||1024),Mt=Number((tn=o(r("navBreakpoint")))!=null?tn:Xe||pt);return Math.max(pt,Mt,0)},U=()=>{const Xe=c();return Xe>=1024?"pc":Xe>=768?"tablet":"mobile"},[j,ne]=JSswift.reactive.signal(!1),[Ve,He]=JSswift.reactive.signal(U()),ae=()=>{typeof window!="undefined"&&(He(U()),ne(window.innerWidth<Te()))};typeof window!="undefined"&&(ae(),window.addEventListener("resize",ae));const $e=()=>({props:e,openAside:()=>f(!0),closeAside:()=>f(!1),toggleAside:()=>f(!ve()),openNav:()=>Me(!0),closeNav:()=>Me(!1),toggleNav:()=>Me(!K()),isDrawerOpen:()=>!!ve(),isNavOpen:()=>!!K(),isMobile:()=>!!j(),isDrawerFloating:()=>$(),isNavFloating:()=>le()}),Ee=(Xe,pt)=>{const Mt=$e();for(const en of Xe){if(!i(s,en))continue;const tn=typeof s[en]=="function"?s[en](Mt):s[en];return J(null,"default",Mt,tn)}const Kt=typeof pt=="function"?pt(Mt):pt;return J(null,"default",Mt,Kt)},De=se!==void 0?se:n,Ie=te(["cms-app","cms-layout",JSswift.uiResponsiveClasses({mobile:e},_t),JSswift.uiResponsiveClasses(e,_t),e.class]),qe=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"]);qe.class=Ie,qe.style={...e.style||{}},JSswift.uiApplyResponsiveProps(qe,e,JSswift.uiResponsiveStyleRules);const Be=_.div(qe),Pe=o(r("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:te(["cms-layout-shell-grid",e.shellClass])}),k=_[Pe.header]({class:te(["cms-layout-section","cms-layout-header","header",ye(e.stickyHeader,"sticky"),e.headerClass])}),v=_[Pe.aside]({class:te(["cms-layout-section","cms-layout-aside","aside",ye(e.stickyAside!==!1,"sticky"),e.asideClass]),role:"navigation","aria-hidden":"true"}),u=_.div({class:"cms-layout-panel-body cms-layout-aside-body"}),I=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-drawer","aria-hidden":"true"});v.appendChild(u),v.appendChild(I);const xe=_[Pe.nav]({class:te(["cms-layout-section","cms-layout-nav","nav",ye(e.stickyNav,"sticky"),e.navClass]),role:Pe.nav==="nav"?null:"complementary","aria-hidden":"true"}),Ue=_.div({class:"cms-layout-panel-body cms-layout-nav-body"}),et=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-nav","aria-hidden":"true"});xe.appendChild(Ue),xe.appendChild(et);const G=_[Pe.page]({class:te(["cms-layout-section","cms-layout-main","main",e.pageClass]),role:Pe.page==="main"?null:"main"}),Ge=_[Pe.footer]({class:te(["cms-layout-section","cms-layout-footer","footer",ye(e.stickyFooter,"sticky"),e.footerClass])});O.appendChild(k),O.appendChild(v),O.appendChild(G),O.appendChild(xe),O.appendChild(Ge),Be.appendChild(O);const lt=_.div({class:te(["cms-aside-overlay",e.overlayClass]),onClick:()=>{o(r("overlayClose"))!==!1&&(ve()&&f(!1),K()&&Me(!1))}});Be.appendChild(lt);let tt=!1,dt=!1,St=!1,It=!1,Rt=!1,Pt=null,st=null;const wt=Xe=>{!Xe||typeof Xe!="object"||(typeof Xe._dispose=="function"&&Xe._dispose(),!(!Xe.childNodes||!Xe.childNodes.length)&&Array.from(Xe.childNodes).forEach(wt))},Ft=Xe=>{Xe&&Array.from(Xe.childNodes).forEach(pt=>{wt(pt),pt.remove()})},Dt=Xe=>{const pt=$e(),Mt=typeof Xe=="function"?Xe(pt):Xe;return J(null,"default",pt,Mt)},Yt=()=>{const Xe=tt?k.getBoundingClientRect().height:0;Be.style.setProperty("--layout-header-height",`${Xe}px`)},Xt=(Xe,pt)=>(Ft(Xe),pt.forEach(Mt=>Xe.appendChild(Mt)),pt.length>0),on=()=>{var Kt,en,tn,dn,ln,y;Be.style.setProperty("--cms-layout-drawer-width",b((Kt=o(r("drawerWidth")))!=null?Kt:280,"280px")),Be.style.setProperty("--cms-layout-nav-width",b((tn=(en=o(r("navWidth")))!=null?en:o(r("asideRightWidth")))!=null?tn:280,"280px")),Be.style.setProperty("--cms-layout-drawer-peek",b((dn=o(r("drawerPeek")))!=null?dn:20,"20px")),Be.style.setProperty("--cms-layout-nav-peek",b((y=(ln=o(r("navPeek")))!=null?ln:o(r("asideRightPeek")))!=null?y:20,"20px"));const Xe=b(o(r("gap")),null);Xe!=null?Be.style.setProperty("--cms-layout-gap",Xe):Be.style.removeProperty("--cms-layout-gap");const pt=b(o(r("headerOffset")),null);pt!=null&&Be.style.setProperty("--layout-header-height",pt);const Mt=b(o(r("minHeight")),null);Mt!=null?Be.style.setProperty("--cms-layout-min-height",Mt):Be.style.removeProperty("--cms-layout-min-height")},jt=()=>{if(oe()){const Xe=Z(a(),L(),m());Xe!==a()&&C(Xe),Be.style.setProperty("--cms-layout-drawer-width",`${Xe}px`)}if(Se()){const Xe=Z(g(),h(),p());Xe!==g()&&M(Xe),Be.style.setProperty("--cms-layout-nav-width",`${Xe}px`)}},Qt=(Xe,pt)=>{if(pt.button!==0)return;const Mt=Xe==="drawer"?v:xe;if(Mt.hidden)return;const Kt=Xe==="drawer"?a:g,en=Xe==="drawer"?C:M,tn=Xe==="drawer"?L:h,dn=Xe==="drawer"?m:p,ln=Mt.getBoundingClientRect(),y=ln.width||Kt(),ue=ot=>{const rt=Xe==="drawer"?ot.clientX-ln.left:ln.right-ot.clientX;en(Z(rt||y,tn(),dn())),jt(),Gt()},Je=()=>{Be.classList.remove("is-resizing-layout"),document.removeEventListener("pointermove",ue,!0),document.removeEventListener("pointerup",Je,!0),st=null};Be.classList.add("is-resizing-layout"),document.addEventListener("pointermove",ue,!0),document.addEventListener("pointerup",Je,!0),st=Je,pt.preventDefault()},cn=Xe=>Qt("drawer",Xe),hn=Xe=>Qt("nav",Xe);I.addEventListener("pointerdown",cn),et.addEventListener("pointerdown",hn);const Gt=()=>{const Xe=!!j(),pt=!!ve(),Mt=!!K(),Kt=!de()&&be()&&dt,en=!ce()&&me()&&St,tn=Kt&&(Xe||$()),dn=en&&(Xe||le()),ln=Kt&&pt,y=en&&Mt,ue=ln&&!tn,Je=y&&!dn,ot=ue&&oe(),rt=Je&&Se(),at=ln&&tn||y&&dn;on(),jt(),Be.classList.toggle("is-mobile",Xe),Be.classList.toggle("drawer-open",ln),Be.classList.toggle("nav-open",y),Be.classList.toggle("no-drawer",!Kt),Be.classList.toggle("no-nav",!en),Be.classList.toggle("has-header",tt),Be.classList.toggle("has-drawer",Kt),Be.classList.toggle("has-nav",en),Be.classList.toggle("has-footer",Rt),Be.classList.toggle("drawer-floating",tn),Be.classList.toggle("nav-floating",dn);const ht=F(),Tt=ht?S():"";Be.dataset.disposition=ht||"",Be.dataset.layoutMode=Tt||"",Be.classList.toggle("has-disposition",!!ht),Be.classList.toggle("mode-local",Tt==="local"),Be.classList.toggle("mode-global",Tt==="global"),k.classList.toggle("sticky",o(r("stickyHeader"))===!0),Ge.classList.toggle("sticky",o(r("stickyFooter"))===!0),v.classList.toggle("sticky",o(r("stickyAside"))!==!1),xe.classList.toggle("sticky",o(r("stickyNav"))===!0),k.hidden=!tt,Ge.hidden=!Rt,G.hidden=!It,lt.hidden=!(tn||dn),lt.classList.toggle("show",at),v.hidden=!Kt||!ln&&!tn,v.classList.toggle("open",ln),v.classList.toggle("is-floating",tn),v.classList.toggle("is-resizable",ot),v.setAttribute("aria-hidden",ln?"false":"true"),I.hidden=!ot,xe.hidden=!en||!y&&!dn,xe.classList.toggle("open",y),xe.classList.toggle("is-floating",dn),xe.classList.toggle("is-resizable",rt),xe.setAttribute("aria-hidden",y?"false":"true"),et.hidden=!rt;const Ht=nn[ht]||null,sn=(Ht==null?void 0:Ht.side)||(ue&&Ht?"left":null),fn=(Ht==null?void 0:Ht.nav)||(Je&&Ht?"top":null),Pn=ue?Ht?sn:"left":"",vn=Je?Ht?fn==="left"||fn==="right"?fn:"":"right":"";Be.classList.toggle("drawer-left",Kt&&sn==="left"),Be.classList.toggle("drawer-right",Kt&&sn==="right"),Be.classList.toggle("nav-top",Je&&fn==="top"),Be.classList.toggle("nav-side",Je&&(vn==="left"||vn==="right")),O.style.gridTemplateColumns=[Pn==="left"?"minmax(0, var(--cms-layout-drawer-width))":vn==="left"?"minmax(0, var(--cms-layout-nav-width))":"0px","minmax(0, 1fr)",Pn==="right"?"minmax(0, var(--cms-layout-drawer-width))":vn==="right"?"minmax(0, var(--cms-layout-nav-width))":"0px"].join(" ");const pn=['"header header header"',`"${ue?"aside":"."} main ${Je?"nav":"."}"`,'"footer footer footer"'].join(" "),ns=co(nn[ht],{header:tt,aside:ue,nav:Je,main:It,footer:Rt});O.style.gridTemplateAreas=re(w("areas","gridTemplateAreas","templateAreas"))||ns||pn},Tn=(Xe,pt)=>(tt=Xt(k,Dt(Xe)),Yt(),Gt(),pt&&JSswift.router.setURLOnly(pt),k),An=(Xe,pt)=>(dt=Xt(u,Dt(Xe)),dt||f(!1),Gt(),pt&&JSswift.router.setURLOnly(pt),v),an=(Xe,pt)=>(St=Xt(Ue,Dt(Xe)),St||Me(!1),Gt(),pt&&JSswift.router.setURLOnly(pt),xe),Dn=(Xe,pt)=>(It=Xt(G,Dt(Xe)),Gt(),pt&&JSswift.router.setURLOnly(pt),G),un=(Xe,pt)=>(Rt=Xt(Ge,Dt(Xe)),Gt(),pt&&JSswift.router.setURLOnly(pt),Ge);tt=Xt(k,Ee(["header"],he)),dt=Xt(u,H===!1?[]:Ee(["aside","drawer"],H)),St=Xt(Ue,W===!1?[]:Ee(["nav","asideRight","drawerRight"],W)),It=Xt(G,Ee(["page","main","default"],De)),Rt=Xt(Ge,Ee(["footer"],X)),typeof ResizeObserver!="undefined"&&(Pt=new ResizeObserver(()=>Yt()),Pt.observe(k)),Yt(),JSswift.reactive.effect(()=>{Ve(),j(),ve(),K(),Gt()},"UI.Layout:state");const ds=Xe=>{o(r("escClose"))!==!1&&(!j()&&!$()&&!le()||!ve()&&!K()||Xe.key==="Escape"&&(Xe.preventDefault(),ve()&&f(!1),K()&&Me(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",ds,!0),Be.openAside=()=>f(!0),Be.closeAside=()=>f(!1),Be.toggleAside=()=>f(!ve()),Be.openNav=()=>Me(!0),Be.closeNav=()=>Me(!1),Be.toggleNav=()=>Me(!K()),Be.isDrawerOpen=()=>!!ve(),Be.isNavOpen=()=>!!K(),Be.isMobile=()=>!!j(),Be.header=()=>k,Be.aside=()=>v,Be.drawer=()=>v,Be.nav=()=>xe,Be.page=()=>G,Be.main=()=>G,Be.footer=()=>Ge,Be.headerUpdate=Tn,Be.asideUpdate=An,Be.drawerUpdate=An,Be.navUpdate=an,Be.pageUpdate=Dn,Be.mainUpdate=Dn,Be.footerUpdate=un,Be.reflow=Gt,Be._dispose=()=>{var Xe;typeof window!="undefined"&&window.removeEventListener("resize",ae),typeof document!="undefined"&&document.removeEventListener("keydown",ds,!0),I.removeEventListener("pointerdown",cn),et.removeEventListener("pointerdown",hn),st==null||st(),(Xe=Pt==null?void 0:Pt.disconnect)==null||Xe.call(Pt)},Nt(Be,e),Gt(),Be},Ne.Footer=(...t)=>{var Se,L,m;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=h=>Object.prototype.hasOwnProperty.call(e,h),c={props:e},x=(h,p)=>{if(!(p==null||p===!1)){if(Array.isArray(p)){p.forEach(V=>x(h,V));return}if(p!=null&&p.nodeType){h.appendChild(p);return}h.appendChild(document.createTextNode(String(p)))}},d=(h,p,V=ie=>ie)=>{const ie=JSswift.ui.getSlot(s,h);if(ie!=null)return J(s,h,c,null);if(typeof p=="function"){const a=new Set(["eyebrow","title","subtitle"]),C=_[a.has(h)?"span":"div"]({class:`cms-footer-slot-${h}`});return JSswift.reactive.effect(()=>{const g=V(p(c)),M=Cn(JSswift.ui.slot(g));C.replaceChildren(),Array.isArray(M)?M.forEach(Y=>x(C,Y)):x(C,M)},`UI.Footer:${h}`),[C]}return J(s,h,c,V(p))},r=(h,p="icon",V=e.iconSize||e.size||"md")=>h==null||h===!1?null:typeof h=="string"?Ne.Icon({name:h,size:V}):JSswift.ui.slot(h,{as:p}),w=i("left")?e.left:e.start,F=i("right")?e.right:e.end,S=i("title")?e.title:e.label,b=(L=(Se=e.subtitle)!=null?Se:e.description)!=null?L:e.note,P=i("content")?e.content:i("body")?e.body:n!=null&&n.length?n:null,re=[...d("left",w),...d("start",null)],Z=d("icon",e.icon,r),he=d("eyebrow",(m=e.eyebrow)!=null?m:e.kicker),H=d("title",S),W=d("subtitle",b),se=d("meta",e.meta),X=(()=>{const h=d("content",null);return h.length?h:d("default",P)})(),fe=[...d("center",null),...d("body",null)],_e=[...d("right",F),...d("end",null)],be=d("actions",e.actions),me=_.div({class:te(["cms-footer-body",e.bodyClass,e.centerClass])},_.div({class:"cms-footer-heading"},Z.length?_.div({class:"cms-footer-icon"},...Z):null,_.div({class:"cms-footer-copy"},he.length?_.div({class:te(["cms-footer-eyebrow",e.eyebrowClass])},...he):null,H.length?_.div({class:te(["cms-footer-title",e.titleClass])},...H):null,W.length?_.div({class:te(["cms-footer-subtitle",e.subtitleClass])},...W):null,X.length?_.div({class:te(["cms-footer-content",e.contentClass])},...X):null),se.length?_.div({class:te(["cms-footer-meta",e.metaClass])},...se):null)),de=[];fe.length?de.push(_.div({class:te(["cms-footer-body",e.bodyClass,e.centerClass])},...fe)):(Z.length||he.length||H.length||W.length||X.length||se.length)&&de.push(me),(_e.length||be.length)&&de.push(_.div({class:te(["cms-footer-end",e.endClass])},..._e,...be.length?[_.div({class:te(["cms-footer-actions",e.actionsClass])},...be)]:[]));const ce=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"]);ce.class=te(["cms-panel","cms-footer","cms-singularity",ye(e.sticky,"sticky"),ye(e.dense,"dense"),ye(e.elevated,"elevated"),ye(e.divider!==!1,"divider"),ye(e.stack,"stack"),Bt(e.align,"align-"),e.class]),ce.style={...e.style||{}};const $=Ke(e.justify);$!=null&&(ce.style.justifyContent=$);const le=Ke(e.wrap,h=>h?"wrap":"nowrap");le!=null&&(ce.style.flexWrap=le),e.gap!=null&&(ce.style["--cms-footer-gap"]=mt(o(e.gap))),e.minHeight!=null&&(ce.style.minHeight=mt(o(e.minHeight))),JSswift.uiApplyResponsiveProps(ce,e,JSswift.uiResponsiveStyleRules);const oe=_.footer(ce,...re.length?[_.div({class:te(["cms-footer-start",e.startClass])},...re)]:[],...de.length?[_.div({class:"cms-footer-main"},...de)]:[]);return Nt(oe,e),oe};const xn=t=>{const e=[];for(const n of t||[]){const s=Cn(JSswift.ui.slot(n));s&&(Array.isArray(s)?e.push(...s):e.push(s))}return e},rn=(t,e)=>{const n=Cn(JSswift.ui.slot(t,e));return n?Array.isArray(n)?n:[n]:[]},mt=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)};Ne.Toolbar=(...t)=>{var p,V,ie,a,C,g,M,Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(Q,ve,N={})=>{const f=Array.isArray(Q)?Q:[Q];for(const A of f)if(JSswift.ui.getSlot(s,A)!=null)return J(s,A,N,ve);return ve==null?[]:J(null,"default",N,ve)},c=Q=>(Array.isArray(Q)?Q:[Q]).some(N=>JSswift.ui.getSlot(s,N)!=null),x={props:e},d=i(["before"],e.before,x),r=i(["start","left"],(p=e.start)!=null?p:e.left,x),w=i(["center","body","content","default"],(a=(ie=(V=e.center)!=null?V:e.body)!=null?ie:e.content)!=null?a:n,x),F=i(["end","right","actions"],(g=(C=e.end)!=null?C:e.right)!=null?g:e.actions,x),S=i(["after"],e.after,x),b=i(["title"],e.title,x),P=i(["subtitle"],e.subtitle,x),re=i(["meta"],e.meta,x),Z=!!(d.length||r.length||F.length||S.length||b.length||P.length||re.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||c(["before","start","left","center","body","content","end","right","actions","after","title","subtitle","meta"])),he=te(["cms-toolbar",ye(Z,"structured"),ye(e.dense,"dense"),ye(e.divider,"divider"),ye(e.elevated,"elevated"),ye(e.sticky,"sticky"),e.class]),H=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"]);H.class=he;const W={...e.style||{}};W.display=W.display||"flex";const se=Ke(e.align),X=Ke(e.justify),fe=Ke(e.wrap,Q=>typeof Q=="boolean"?Q?"wrap":"nowrap":String(Q),"wrap"),_e=Ke(e.gap,mt,"var(--cms-s-md)"),be=Ze(e,"gap");W["--cms-toolbar-gap"]=_e!=null?_e:"var(--cms-s-md)",be||(W.gap=W.gap||"var(--cms-toolbar-gap)");const me={xxs:"4px 6px",xs:"6px 8px",sm:"6px 10px",md:"10px 12px",lg:"12px 16px",xl:"14px 18px",xxl:"16px 20px"},de=Ke(e.size,Q=>me[Q]||"");if(de!=null&&(W.padding=de),Z?(W.flexDirection=W.flexDirection||"column",W.alignItems=W.alignItems||"stretch"):(se!=null&&(W.alignItems=se),X!=null&&(W.justifyContent=X),fe!=null&&(W.flexWrap=fe)),Object.keys(W).length&&(H.style=W),JSswift.uiApplyResponsiveProps(H,e,JSswift.uiResponsiveStyleRules),!Z){const Q=J(s,"default",x,n),ve=_.div(H,...Q);return Nt(ve,e),ve}const ce=(Y=(M=e.bodyClass)!=null?M:e.centerClass)!=null?Y:e.contentClass,$=Ct([e.justify],()=>{const Q=o(e.justify);return!Q||Q==="flex-start"?"auto":""}),le={display:"flex",alignItems:"inherit",gap:"var(--cms-toolbar-gap)",flexWrap:"inherit",minWidth:0},oe={};se!=null&&(oe.alignItems=se),X!=null&&(oe.justifyContent=X),fe!=null&&(oe.flexWrap=fe);const Se=re.length||b.length||P.length?_.div({class:te(["cms-toolbar-copy",e.copyClass])},re.length?_.div({class:te(["cms-toolbar-meta",e.metaClass])},...re):null,b.length?_.div({class:te(["cms-toolbar-title",e.titleClass])},...b):null,P.length?_.div({class:te(["cms-toolbar-subtitle",e.subtitleClass])},...P):null):null,L=!!(r.length||Se||w.length||F.length),m=[d.length?_.div({class:te(["cms-toolbar-before",e.beforeClass]),style:{...le}},...d):null,L?_.div({class:"cms-toolbar-main",style:oe},r.length?_.div({class:te(["cms-toolbar-start",e.startClass]),style:{...le}},...r):null,Se||w.length?_.div({class:te(["cms-toolbar-center",ce]),style:{...le,flex:"1 1 240px"}},Se,...w):null,F.length?_.div({class:te(["cms-toolbar-end",e.endClass]),style:{...le,justifyContent:"flex-end",marginInlineStart:$}},...F):null):null,S.length?_.div({class:te(["cms-toolbar-after",e.afterClass]),style:{...le}},...S):null].filter(Boolean),h=_.div(H,...m);return Nt(h,e),h};const Mi=t=>{var e;return t&&t.nodeType===1&&((e=t.classList)==null?void 0:e.contains("cms-grid-col"))};Ne.Grid=(...t)=>{var h,p,V,ie;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=o(e.items),c=Array.isArray(i)?i:i==null?[]:[i],x=(a={})=>{const C=e.itemProps||{},g={...C,...a};return g.class=te([C.class,e.itemClass,a.class]),g.style={...C.style||{},...e.itemStyle||{},...a.style||{}},g},d=(a,C={})=>{if(a==null||a===!1)return[];if(Mi(a))return[a];if(Yn(a)){const g=a.children!=null?Rn(a.children):a.content!=null?Rn(a.content):a.node!=null?Rn(a.node):a.label!=null?Rn(a.label):[];return[Ne.GridCol(x(a),...g)]}return Array.isArray(a)?[Ne.GridCol(x(C),...a)]:[Ne.GridCol(x(C),a)]},r=(a,C,g,M=!0)=>{if(a==null||a===!1)return[];const Y=Yn(a)?a:{};if(M){const Q={item:a,index:C,count:g,first:C===0,last:C===g-1},ve=J(s,"item",Q,null);if(ve.length)return ve.flatMap(N=>d(N,Y))}return d(a,Y)},w=[];c.forEach((a,C)=>{w.push(...r(a,C,c.length))}),J(s,"default",{items:c,count:c.length},n).forEach(a=>{w.push(...d(a))}),w.length||J(s,"empty",{items:c,count:0},e.empty).forEach(C=>{const g=d(C,{style:{gridColumn:"1 / -1"}});w.push(...g)});const S=te(["cms-grid",JSswift.uiResponsiveClasses({mobile:e},nt),JSswift.uiResponsiveClasses(e,nt),ye(e.dense,"dense"),ye(e.inline,"cms-grid-inline"),ye(e.debug,"cms-grid-debug"),e.class]),b=JSswift.omit(e,["gap","rowGap","columnGap","colGap","cols","columns","rows","areas","align","justify","alignItems","justifyItems","placeItems","placeContent","dense","flow","inline","debug","autoFit","autoFill","min","max","autoRows","items","itemClass","itemStyle","itemProps","empty","slots","full","width","minWidth","maxWidth","padding",...JSswift.uiResponsiveOmitProps]);b.class=S;const P={...e.style||{}};(h=JSswift.uiResponsiveHasConfig)!=null&&h.call(JSswift,e)&&e.display==null&&!Ze(e,"display")&&P.display==null&&(P.display=e.inline?"inline-grid":"grid");const re=Ke(e.gap,mt);re!=null&&!Ze(e,"gap")&&(P["--cms-grid-gap"]=re,P.gap=re);const Z=Ke(e.rowGap,mt);Z!=null&&!Ze(e,"rowGap")&&(P.rowGap=Z);const he=Ke((p=e.columnGap)!=null?p:e.colGap,mt);he!=null&&!Ze(e,["columnGap","colGap"])&&(P.columnGap=he);const H=Ke(e.max,mt,"1fr"),W=Ke(e.min,mt);if(W!=null){const a=o(e.autoFill)?"auto-fill":"auto-fit";P.gridTemplateColumns=`repeat(${a}, minmax(${W}, ${H||"1fr"}))`}else{const a=Ke((V=e.columns)!=null?V:e.cols,C=>typeof C=="number"?`repeat(${C}, minmax(0, 1fr))`:String(C));a!=null&&!Ze(e,["cols","columns"])&&(P.gridTemplateColumns=a)}const se=Ke(e.rows,a=>typeof a=="number"?`repeat(${a}, minmax(0, auto))`:String(a));se!=null&&(P.gridTemplateRows=se);const X=Ke(e.autoRows,mt);X!=null&&(P.gridAutoRows=X);const fe=Ke(e.flow,a=>{const C=String(a);return e.dense&&!C.includes("dense")?`${C} dense`:C});fe!=null&&!Ze(e,"flow")&&(P.gridAutoFlow=fe);const _e=Ke(e.areas,a=>Array.isArray(a)?a.map(C=>`"${Array.isArray(C)?C.join(" "):String(C)}"`).join(" "):String(a));_e!=null&&(P.gridTemplateAreas=_e);const be=Ke((ie=e.align)!=null?ie:e.alignItems);be!=null&&!Ze(e,["align","alignItems"])&&(P.alignItems=be);const me=Ke(e.justify);me!=null&&!Ze(e,"justify")&&(P.justifyContent=me);const de=Ke(e.justifyItems);de!=null&&(P.justifyItems=de);const ce=Ke(e.placeItems);ce!=null&&(P.placeItems=ce);const $=Ke(e.placeContent);$!=null&&(P.placeContent=$);const le=Ke(e.width,mt);le!=null&&!Ze(e,"width")&&(P.width=le),o(e.full)===!0&&(P.width="100%");const oe=Ke(e.minWidth,mt);oe!=null&&!Ze(e,"minWidth")&&(P.minWidth=oe);const Se=Ke(e.maxWidth,mt);Se!=null&&!Ze(e,"maxWidth")&&(P.maxWidth=Se);const L=Ke(e.padding,mt);L!=null&&!Ze(e,"padding")&&(P.padding=L),Object.keys(P).length&&(b.style=P),JSswift.uiApplyResponsiveProps(b,e,JSswift.uiResponsiveStyleRules);const m=_.div(b,...w);return Nt(m,e),m},Ne.GridCol=(...t)=>{var De,Ie,qe,Be,T,Pe,O,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=v=>Object.prototype.hasOwnProperty.call(e,v),c=(v,u,I={})=>{const xe=Array.isArray(v)?v:[v];for(const Ue of xe)if(JSswift.ui.getSlot(s,Ue)!=null)return J(s,Ue,I,u);return u==null?[]:J(null,"default",I,u)},x=v=>{var u;return v==null||v===!1||v===""?"":typeof v=="string"&&((u=JSswift.uiSizes)!=null&&u.includes(v))?`var(--cms-s-${v})`:mt(v)},d=v=>{var u;return v==null||v===!1||v===""?"":typeof v=="string"&&((u=JSswift.uiSizes)!=null&&u.includes(v))?ze(v,"size"):mt(v)},r={...e.style||{}},w=v=>{if(v==null||v==="")return null;if(v==="auto")return"auto";if(v==="full"||v===!0)return"1 / -1";const u=Number(v);if(Number.isFinite(u)&&u>0){const I=Math.max(1,Math.round(u));return`span ${I} / span ${I}`}return String(v)},F=v=>{if(v==null||v==="")return null;if(v==="full"||v===!0)return"1 / -1";const u=Number(v);if(Number.isFinite(u)&&u>0){const I=Math.max(1,Math.round(u));return`span ${I} / span ${I}`}return String(v)},S=i("span")?e.span:e.col,b=Ke(S,w),P=Ke(e.sm,w),re=Ke(e.md,w),Z=Ke(e.lg,w),he=JSswift.uiResponsivePropsFor(e,xt("tablet"))||{},H=JSswift.uiResponsivePropsFor(e,xt("pc"))||{},W=(De=he.span)!=null?De:he.col,se=(Ie=H.span)!=null?Ie:H.col,X=Ke(W,w),fe=Ke(se,w),_e=Ke(e.rowSpan,F),be=Ke(e.row,F),me=Ke(e.area),de=Ke(e.align),ce=Ke(e.justify),$=Ke(e.place),le=Ke(e.gap,x),oe=Ke(e.rowGap,x),Se=Ke(e.columnGap,x),L=Ke(e.padding,x),m=Ke(e.width,d),h=Ke(e.minHeight,d),p=Ke(e.height,d),V=Ke(e.maxHeight,d),ie=Ke(e.contentAlign),a=Ke(e.contentJustify),C=Ke(e.direction),g=Ke(e.scroll,v=>v===!0?"auto":String(v),""),M=Ke(e.fullHeight,v=>v?"100%":"",""),Y=Ct([e.center,e.contentAlign,e.contentJustify],()=>!!o(e.center)&&(o(e.contentAlign)==null||o(e.contentAlign)==="")&&(o(e.contentJustify)==null||o(e.contentJustify)==="")),Q={props:e},ve=c(["start","top","header","before"],(T=(Be=(qe=e.start)!=null?qe:e.top)!=null?Be:e.header)!=null?T:e.before,Q),N=i("body")?e.body:i("content")?e.content:n,f=c(["body","content","default"],N,Q),A=c(["end","bottom","footer","after"],(k=(O=(Pe=e.end)!=null?Pe:e.bottom)!=null?O:e.footer)!=null?k:e.after,Q),z=ve.length||A.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,K=Ct([e.stack,e.gap,e.rowGap,e.columnGap,e.contentAlign,e.contentJustify,e.direction,e.center],()=>z||o(e.stack)||[o(e.gap),o(e.rowGap),o(e.columnGap),o(e.contentAlign),o(e.contentJustify),o(e.direction)].some(u=>u!=null&&u!==!1&&u!=="")?!0:!!o(e.center)),ke=Ct([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"]:[]),Me=te(["cms-grid-col",ke,JSswift.uiResponsiveClasses({mobile:e},Et),JSswift.uiResponsiveClasses(e,Et),ye(e.panel,"cms-grid-col-panel"),ye(e.auto,"is-auto"),ye(K,"cms-grid-col-stack"),ye(e.inline,"cms-grid-col-inline"),ye(Y,"cms-grid-col-center"),e.class]),Te=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]);Te.class=Me,r["--cms-grid-col-base"]==null&&(r["--cms-grid-col-base"]="auto"),r["--cms-grid-col-tablet"]==null&&(r["--cms-grid-col-tablet"]="var(--cms-grid-col-base, auto)"),r["--cms-grid-col-pc"]==null&&(r["--cms-grid-col-pc"]="var(--cms-grid-col-tablet, var(--cms-grid-col-base, auto))"),o(e.auto)===!0?r["--cms-grid-col-base"]="auto":b!=null&&(r["--cms-grid-col-base"]=b),P!=null&&(r["--cms-grid-col-sm"]=P),re!=null&&(r["--cms-grid-col-md"]=re),Z!=null&&(r["--cms-grid-col-lg"]=Z),X!=null&&(r["--cms-grid-col-tablet"]=X),fe!=null&&(r["--cms-grid-col-pc"]=fe),_e!=null?r.gridRow=_e:be!=null&&(r.gridRow=be),me!=null&&(r.gridArea=me),de!=null&&!Ze(e,"align")&&(r.alignSelf=de),ce!=null&&!Ze(e,"justify")&&(r.justifySelf=ce),$!=null&&!Ze(e,"place")&&(r.placeSelf=$),le!=null&&!Ze(e,"gap")&&(r.gap=le),oe!=null&&!Ze(e,"rowGap")&&(r.rowGap=oe),Se!=null&&!Ze(e,"columnGap")&&(r.columnGap=Se),L!=null&&!Ze(e,"padding")&&(r.padding=L),m!=null&&!Ze(e,"width")&&(r.width=m),M!=null&&M!==""?r.height=M:p!=null&&!Ze(e,"height")&&(r.height=p),h!=null&&!Ze(e,"minHeight")&&(r.minHeight=h),V!=null&&!Ze(e,"maxHeight")&&(r.maxHeight=V),C!=null&&!Ze(e,"direction")&&(r.flexDirection=C),ie!=null&&!Ze(e,"contentAlign")?r.alignItems=ie:Y!=null&&Y!==""&&(r.alignItems=Y?"center":""),a!=null&&!Ze(e,"contentJustify")?r.justifyContent=a:Y!=null&&Y!==""&&(r.justifyContent=Y?"center":""),g!=null&&g!==""&&(r.overflow=g),Object.keys(r).length&&(Te.style=r),JSswift.uiApplyResponsiveProps(Te,e,Ot);const U=e.onClick,j=e.onKeydown,ne=!!(o(e.clickable)||o(e.to)),Ve=v=>{var I;if(U==null||U(v),v.defaultPrevented)return;const u=o(e.to);u&&((I=JSswift.router)!=null&&I.navigate)&&(v.preventDefault(),JSswift.router.navigate(u))},He=v=>{j==null||j(v),!v.defaultPrevented&&(v.key==="Enter"||v.key===" ")&&(v.preventDefault(),Ve(v))};if(ne&&(Te.onClick=Ve,Te.onKeydown=He,Te.tabIndex==null&&(Te.tabIndex=0),Te.role==null&&(Te.role="button")),!z){const v=_.div(Te,...J(s,"default",Q,n));return Nt(v,e),v}const ae={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},$e=[ve.length?_.div({class:te(["cms-grid-col-start",e.startClass,e.topClass,e.headerClass]),style:{...ae}},...ve):null,f.length?_.div({class:te(["cms-grid-col-body",e.bodyClass,e.contentClass]),style:{...ae,flex:"1 1 auto"}},...f):null,A.length?_.div({class:te(["cms-grid-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...ae}},...A):null].filter(Boolean),Ee=_.div(Te,...$e);return Nt(Ee,e),Ee},Ne.Icon=(...t)=>{var be,me;let e={},n=[],s="home",i=!1;const c=t[0],x=t[1],d=de=>de&&typeof de=="object"&&!de.nodeType&&!Array.isArray(de)&&!(de instanceof Function);typeof c=="string"?(s=c,i=!0,d(x)?(e=x,t.length>2&&(n=t.slice(2))):t.length>1&&(n=t.slice(1))):d(c)?(e=c,c.name!=null&&(s=c.name,i=!0),t.length>1&&(n=t.slice(1))):t.length&&(n=t),!i&&n.length&&(s=n.length===1?n[0]:n),wn(e);const r=e.slots||{},w=o(e.size),F=o(e.color),S=String(s).endsWith("-fill"),b={...e.style||{}},P=Ct(e.size,()=>{const de=o(e.size);return typeof de=="string"&&as[de]?de:""}),re=!!(e.color||e.clickable||e.border||e.glossy||e.glow||e.glass||e.shadow||e.outline||e.gradient||e.textGradient||e.lightShadow||e.radius),Z={"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=de=>{const ce=Z[de];return ce?_.svg({width:"100%",height:"100%",viewBox:ce.viewBox,fill:"none","aria-hidden":"true",focusable:"false"},...ce.paths.map($=>_.path($))):null},H=de=>{const ce=o(e.tooltip);if(ce==null||ce===!1||!Ne.Tooltip)return de;const $=d(ce)?{...ce}:{text:ce};return d(e.tooltipProps)&&Object.assign($,e.tooltipProps),Ne.Tooltip({...$,target:de})},W=te(["cms-icon","material-icons",...re?["cms-clear-set","cms-singularity"]:[],P,e.class]),se=JSswift.omit(e,["name","size","class","style","label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots","spriteUrl","tooltip","tooltipProps"]);if(se.class=W,Object.keys(b).length&&(se.style=b),typeof s=="function"||s&&typeof s=="object"){const de=JSswift.ui.renderSlot(r,"default",{},s),ce=J(null,"default",{},de),$=_.span({...se,"data-icon":"custom"},...ce);return Nt($,e),H($)}const X=String(s),fe=X.includes("#")?X:"";let _e=null;if(fe){const de=e.spriteUrl||((be=JSswift.config)==null?void 0:be.iconSpriteUrl)||(typeof globalThis!="undefined"?(me=globalThis.JSswift_setting)==null?void 0:me.iconSpriteUrl:null),ce=fe.slice(fe.indexOf("#")+1),$=de?_.svg({width:"100%",height:"100%"},_.use({href:de+fe})):he(ce)||_.svg({width:"100%",height:"100%"},_.use({href:fe}));S&&($.style.fill="currentColor"),_e=_.span({...se,"data-icon":X},$,...n)}else _e=_.span({...se,"data-icon":X},X,...n);if(w!=null){let de=w;JSswift.uiSizes.includes(w)&&(de=`var(--cms-icon-size-${w})`),de=typeof de=="number"?de+"px":String(de),_e.style.setProperty("--set-icon-size",de)}return Nt(_e,e),H(_e)},Ne.Badge=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Ct(e.size,()=>{const Z=o(e.size);return typeof Z=="string"&&as[Z]?`cms-size-${Z}`:""}),c=te(["cms-clear-set","cms-badge","cms-singularity",i,ye(e.outline,"outline"),e.class]),x=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);x.class=c;const d={...e.style||{}};if(e.size){const Z=o(e.size);typeof Z=="string"&&as[Z]||(d.fontSize=mt(e.size))}x.style=d;const r=(Z,he,H)=>{const W=Array.isArray(Z)?Z:[Z];for(const se of W)if(JSswift.ui.getSlot(s,se)!=null)return J(s,se,he,H);return H==null||H===!1||H===""?[]:J(null,"default",he,H)},w=()=>{var he;const Z=o((he=e.iconSize)!=null?he:e.size);return typeof Z=="number"?Math.max(10,Math.round(Z*.85)):typeof Z=="string"&&{xxs:10,xs:11,sm:12,md:13,lg:14,xl:16,xxl:18,xxxl:20}[Z]||14},F=(Z,he)=>{const H=o(Z);return H==null||H===!1||H===""?null:typeof H=="string"?Ne.Icon({name:H,size:w()}):JSswift.ui.slot(H,{as:he})},S=(Z,he,H)=>_.dynamic(()=>{const W=F(e[he],H),se=r(Z,{position:H},W);return se.length?_.span({class:`cms-badge-anchor cms-badge-anchor-${H}`,"data-badge-slot":H},...se):null}),b=_.dynamic(()=>{const Z=o(e.label);let he=r(["label"],{},Z);return he.length||(he=r(["default"],{},n)),_.span({class:"cms-badge-content"},_.span({class:"cms-badge-label"},...he.length?he:[""]))}),P=_.dynamic(()=>{const Z=o(e.notification),he=Z==null||Z===!1||Z===""?null:Z,H=r(["notification"],{notification:Z},he);return H.length?_.span({class:"cms-badge-notification","data-badge-slot":"notification","aria-label":typeof Z=="number"?`${Z} notifications`:null},...H):null}),re=_.span(S(["left"],"left","left"),S(["centerLeft","center-left"],"centerLeft","center-left"),x,b,S(["topLeft","top-left"],"topLeft","top-left"),S(["topRight","top-right"],"topRight","top-right"),S(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),S(["bottomRight","bottom-right"],"bottomRight","bottom-right"),S(["centerRight","center-right"],"centerRight","center-right"),S(["right"],"right","right"),P);return(e.topLeft||e.centerLeft||e.bottomLeft)&&re.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&re.style.setProperty("padding-right","15px"),Nt(re,e),re};const Oi=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(""):""},Wo=(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)},Uo=(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)),Fi=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=Wo(null,e);return _.span({class:te(["cms-avatar-status",s?`cms-state-${s}`:""])})}if(t instanceof Node||Array.isArray(t)||typeof t=="function")return t;const n=Wo(t,e);return t===!0||n?_.span({class:te(["cms-avatar-status",n?`cms-state-${n}`:""])}):Uo(t,"cms-avatar-badge")},uo=(t,e)=>!e||!e.length?null:_.span({class:te(["cms-avatar-anchor",t])},...e);Ne.Avatar=(...t)=>{var p,V,ie;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Ct(e.size,()=>{var C;const a=o(e.size);return typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?`cms-size-${a}`:""}),c=Ct([e.color,e.state],()=>{const a=o(e.color)||o(e.state)||"",C=Vt(a);return C?`cms-state-${C}`:""}),x=te(["cms-clear-set","cms-avatar","cms-singularity",i,c,ye(e.square,"cms-avatar-square"),ye(e.elevated,"elevated"),e.class]),d=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"]);d.class=x;const r={...e.style||{}},w=Ke(e.size,a=>{var C;return typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?"":mt(a)},"");w!=null&&(r.width=w,r.height=w);const F=(p=e.fontSize)!=null?p:e.textSize,S=F!=null?Ke(F,mt):Ke(e.size,a=>{var C;return typeof a=="string"&&((C=JSswift.uiSizes)!=null&&C.includes(a))?"":`clamp(11px, calc(${mt(a)} * 0.34), 28px)`},"");S!=null&&(r.fontSize=S);const b=Ke(e.radius,a=>{const C=Ao(a);return C==="xxxl"?"999px":C?`var(--cms-r-${C})`:typeof a=="number"?`${a}px`:String(a)});b!=null&&(r["--set-border-radius"]=b),d.style=r;const P={props:e},re=Ct([e.alt,e.label,e.name,e.text],()=>{const a=o(e.alt)||o(e.label)||o(e.name)||o(e.text)||"avatar";return String(a)}),Z=e.icon!=null?typeof e.icon=="string"?Ne.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,he=Ct([e.initials,e.text,e.label,e.name],()=>{var g,M;const a=(g=o(e.initials))!=null?g:o(e.text);if(a!=null)return a;const C=(M=o(e.label))!=null?M:o(e.name);return typeof C=="string"?Oi(C):C}),H=Uo(o((V=e.badge)!=null?V:e.notification)),W=Fi(o((ie=e.status)!=null?ie:e.presence),o(e.statusColor));let se=J(s,"media",P,e.media);if(!se.length&&e.src){const a={class:"cms-avatar-img",src:e.src,alt:re,sizes:e.sizes,style:{}};e.srcset!=null&&(a.srcset=e.srcset),e.srcSet!=null&&(a.srcset=e.srcSet);const C=Ke(e.fit);C!=null&&(a.style.objectFit=C),se=[_.img(a)]}const X=J(s,"default",P,n),fe=J(s,"fallback",P,null),_e=J(s,"label",P,he),be=J(s,"icon",P,Z),me=se.length?se:X.length?X:fe.length?fe:_e.length?_e:be.length?be:["?"],de=se.length?"cms-avatar-media":"cms-avatar-fallback",ce=_.span({class:"cms-avatar-body"},_.span({class:de},...me));let $=J(s,"topLeft",P,e.topLeft),le=J(s,"topRight",P,e.topRight),oe=J(s,"bottomLeft",P,e.bottomLeft),Se=J(s,"bottomRight",P,e.bottomRight);const L=J(s,"badge",P,H),m=J(s,"status",P,W);!le.length&&L.length&&(le=L),!Se.length&&m.length&&(Se=m);const h=_.div(d,ce,uo("cms-avatar-anchor-top-left",$),uo("cms-avatar-anchor-top-right",le),uo("cms-avatar-anchor-bottom-left",oe),uo("cms-avatar-anchor-bottom-right",Se));return Nt(h,e),h},Ne.Chip=(...t)=>{var he,H,W,se;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Ct(e.size,()=>{const X=o(e.size);return typeof X=="string"&&as[X]?X:""}),c=te(["cms-clear-set","cms-chip","cms-singularity",i,e.class]),x=JSswift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);x.class=c,x.style={...e.style||{}};const d=e.icon?typeof e.icon=="string"?Ne.Icon({name:e.icon,size:(he=e==null?void 0:e.size)!=null?he:null}):JSswift.ui.slot(e.icon,{as:"icon"}):null,r=e.iconRight?typeof e.iconRight=="string"?Ne.Icon({name:e.iconRight,size:(H=e==null?void 0:e.size)!=null?H:null}):JSswift.ui.slot(e.iconRight,{as:"iconRight"}):null,w=JSswift.ui.renderSlot(s,"icon",{},d),F=JSswift.ui.renderSlot(s,"iconRight",{},r),S=J(s,"label",{},e.label),b=S.length?S:J(s,"default",{},n),P=J(null,"default",{},w),re=J(null,"default",{},F),Z=_.span(x,...P,...b.length?b:[""],...re);if(e.removable){const X=Ne.Btn({class:"cms-chip-remove",onClick:e.onRemove,size:(W=e==null?void 0:e.size)!=null?W:null},Ne.Icon({size:(se=e==null?void 0:e.size)!=null?se:null,name:"close"}));Z.appendChild(X),X.onclick=()=>{e.onRemove&&e.onRemove(),Z.remove()}}return Nt(Z,e),Z},Ne.Stat=(...t)=>{var be,me;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Vt(o(e.state)||o(e.color)||""),c=Ct([e.state,e.color],()=>{const de=i();return de?`cms-state-${de}`:""}),x=Ct(e.trend,()=>{const de=String(o(e.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(de)?"is-positive":["down","negative","danger","loss","decrease"].includes(de)?"is-negative":["flat","neutral","steady","stable"].includes(de)?"is-neutral":""}),d={...e},r=JSswift.omit(d,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","meta","note","slots","state","subtitle","title","trend","value"]);r.class=te(["cms-clear-set","cms-stat","cms-singularity",c,x,d.class]),r.style={...d.style||{}};const w=(de,ce,$={})=>J(s,de,$,ce),F=e.icon==null?null:typeof e.icon=="string"?Ne.Icon({name:e.icon,size:e.iconSize||"md"}):JSswift.ui.slot(e.icon,{as:"icon"}),S=w("eyebrow",e.eyebrow),b=w("label",(be=e.label)!=null?be:e.title),P=w("value",e.value),re=w("note",(me=e.note)!=null?me:e.subtitle),Z=w("meta",e.meta),he=w("delta",e.delta,{trend:e.trend}),H=w("icon",F),W=w("aside",e.aside),se=w("footer",e.footer),X=w("actions",e.actions),fe=w("default",n),_e=_.article(r,_.div({class:"cms-stat-head"},_.div({class:"cms-stat-lead"},H.length?_.div({class:"cms-stat-icon"},...H):null,_.div({class:"cms-stat-copy"},S.length?_.div({class:"cms-stat-eyebrow"},...S):null,b.length?_.div({class:"cms-stat-label"},...b):null)),W.length?_.div({class:"cms-stat-aside"},...W):null),_.div({class:"cms-stat-body"},P.length?_.div({class:"cms-stat-value"},...P):null,he.length?_.div({class:"cms-stat-delta"},...he):null,re.length?_.div({class:"cms-stat-note"},...re):null,Z.length?_.div({class:"cms-stat-meta"},...Z):null,fe.length?_.div({class:"cms-stat-extra"},...fe):null),se.length||X.length?_.div({class:"cms-stat-footer"},se.length?_.div({class:"cms-stat-footer-copy"},...se):null,X.length?_.div({class:"cms-stat-actions"},...X):null):null);return Nt(_e,e),_e},Ne.Kpi=(...t)=>{var be,me;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Vt(o(e.state)||o(e.color)||""),c=Ct([e.state,e.color],()=>{const de=i();return de?`cms-state-${de}`:""}),x={...e},d=JSswift.omit(x,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","media","meta","note","slots","state","subtitle","title","trend","value"]);d.class=te(["cms-clear-set","cms-kpi","cms-singularity",c,x.class]),d.style={...x.style||{}};const r=(de,ce,$={})=>J(s,de,$,ce),w=e.icon==null?null:typeof e.icon=="string"?Ne.Icon({name:e.icon,size:e.iconSize||"lg"}):JSswift.ui.slot(e.icon,{as:"icon"}),F=r("eyebrow",e.eyebrow),S=r("title",(be=e.title)!=null?be:e.label),b=r("value",e.value),P=r("delta",e.delta,{trend:e.trend}),re=r("note",(me=e.note)!=null?me:e.subtitle),Z=r("meta",e.meta),he=r("icon",w),H=r("aside",e.aside),W=r("media",e.media),se=r("footer",e.footer),X=r("actions",e.actions),fe=r("default",n),_e=_.section(d,_.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"},F.length?_.div({class:"cms-kpi-eyebrow"},...F):null,S.length?_.div({class:"cms-kpi-title"},...S):null)),H.length?_.div({class:"cms-kpi-aside"},...H):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},b.length?_.div({class:"cms-kpi-value"},...b):null,P.length?_.div({class:"cms-kpi-delta"},...P):null),re.length?_.div({class:"cms-kpi-note"},...re):null,Z.length?_.div({class:"cms-kpi-meta"},...Z):null,W.length?_.div({class:"cms-kpi-media"},...W):null,fe.length?_.div({class:"cms-kpi-extra"},...fe):null),se.length||X.length?_.div({class:"cms-kpi-footer"},se.length?_.div({class:"cms-kpi-footer-copy"},...se):null,X.length?_.div({class:"cms-kpi-actions"},...X):null):null);return Nt(_e,e),_e};const Di=(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},xs=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"))}))},_s=(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=c=>{c.target===t.panel&&(t.panel.removeEventListener("transitionend",s),n())};t.panel.addEventListener("transitionend",s);const i=Di(t.panel,180);setTimeout(n,i+40)};Ne.List=(...t)=>{var H;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=!!o((H=e.number)!=null?H:e.ordered),c=o(e.marker),x=o(e.items),d=Array.isArray(x)?x:x==null?[]:[x],r=(W={})=>{const se=e.itemProps||{},X={...se,...W};return e.divider!=null&&X.divider==null&&(X.divider=e.divider),X.class=te([se.class,e.itemClass,W.class]),X.style={...se.style||{},...e.itemStyle||{},...W.style||{}},X},w=W=>{if(W==null||W===!1)return[];if(bs(W))return[W];if(Yn(W)){const se=W.children!=null?Rn(W.children):W.content!=null?Rn(W.content):Rn(W.node);return[Ne.Item(r(W),...se)]}return Array.isArray(W)?[Ne.Item(r(),...W)]:W!=null&&W.nodeType?[Ne.Item(r(),W)]:[Ne.Item(r(),W)]},F=(W,se,X,fe=!0)=>{if(W==null||W===!1)return[];if(fe){const _e={item:W,index:se,count:X,first:se===0,last:se===X-1},be=J(s,"item",_e,null);if(be.length)return be.flatMap(me=>w(me))}return w(W)},S=[];d.forEach((W,se)=>{S.push(...F(W,se,d.length))});const b=J(s,"default",{items:d,count:d.length},n);if(b.forEach((W,se)=>{S.push(...F(W,d.length+se,d.length+b.length,!1))}),!S.length){const W=J(s,"empty",{items:d,count:0},e.empty);W.length&&(W.length===1&&bs(W[0])?S.push(W[0]):S.push(Ne.Item({class:"cms-item-empty",flat:!0},...W)))}const P=te(["cms-list",ye(e.dense,"dense"),ye(e.divider,"divider"),ye(c===!1||c==="none","cms-list-no-marker"),e.class]),re=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);re.class=P,re.style={...e.style||{}};const Z=Ke(e.gap,mt);return Z!=null&&(re.style["--cms-list-gap"]=Z),c!=null&&c!==!1&&c!==!0&&c!=="none"&&(re.style.listStyleType=String(c)),_[i?"ol":"ul"](re,...S)},Ne.Item=(...t)=>{var L,m,h,p,V,ie,a,C;const{props:e,children:n}=JSswift.uiNormalizeArgs(t);e.state!=null&&e.color==null&&(e.color=e.state),wn(e);const s=e.slots||{},i=Ct([e.clickable,e.to],()=>!!(o(e.clickable)||o(e.to))),c=Ct([e.active,e.selected],()=>!!(o(e.active)||o(e.selected))),x=!!(e.color!=null||e.outline||e.border||e.glossy||e.glow||e.glass||e.shadow||e.gradient||e.textGradient||e.lightShadow||e.radius||e.rounded||e.flat),d=(g,M,Y)=>{const Q=o(g);return Q==null||Q===!1||Q===""?null:typeof Q=="string"?Ne.Icon({name:Q,size:M||"sm"}):JSswift.ui.slot(Q,{as:Y})},r=J(s,"icon",{},d(e.icon,e.iconSize||e.size,"icon")),w=J(s,"title",{},(L=e.title)!=null?L:e.label),F=J(s,"subtitle",{},(h=(m=e.subtitle)!=null?m:e.caption)!=null?h:e.description),S=J(s,"meta",{},(p=e.meta)!=null?p:e.eyebrow),b=J(s,"body",{},(V=e.body)!=null?V:e.content),P=J(s,"default",{},n),re=J(s,"actions",{},(ie=e.actions)!=null?ie:e.footer),Z=(C=(a=e.aside)!=null?a:e.trailing)!=null?C:d(e.iconRight,e.iconSize||e.size,"iconRight"),he=J(s,"aside",{},Z),H=[...b,...P],W=!(x||e.clickable||e.to||r.length||w.length||F.length||S.length||re.length||he.length||b.length),se=te(["cms-item",ye(e.divider,"divider"),ye(x,"cms-clear-set"),ye(x,"cms-singularity"),ye(x,"cms-item-surface"),ye(W,"cms-item-inline"),ye(i,"cms-item-clickable"),ye(c,"is-active"),ye(e.disabled,"is-disabled"),e.class]),X=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"]);X.class=se,X.style={...e.style||{}};const fe=e.onClick,_e=e.onKeydown,be=g=>{var Y;if(fe==null||fe(g),g.defaultPrevented||o(e.disabled))return;const M=o(e.to);M&&((Y=JSswift.router)!=null&&Y.navigate)&&(g.preventDefault(),JSswift.router.navigate(M))},me=g=>{_e==null||_e(g),!(g.defaultPrevented||o(e.disabled))&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),be(g))};o(e.disabled)&&(X["aria-disabled"]="true"),(o(e.clickable)||o(e.to))&&(X.onClick=be,X.onKeydown=me,X.tabIndex==null&&(X.tabIndex=o(e.disabled)?-1:0),X.role==null&&(X.role="button"));const de=w.length?_.div({class:"cms-item-title"},...w):null,ce=F.length?_.div({class:"cms-item-subtitle"},...F):null,$=S.length?_.div({class:"cms-item-meta"},...S):null,le=H.length?_.div({class:te(["cms-item-body",ye(!(w.length||F.length||S.length),"is-standalone")])},...H):null,oe=re.length?_.div({class:"cms-item-actions"},...re):null,Se=_.li(X,_.div({class:"cms-item-row"},r.length?_.div({class:"cms-item-icon"},...r):null,_.div({class:"cms-item-main"},$,de,ce,le,oe),he.length?_.div({class:"cms-item-aside"},...he):null));return Nt(Se,e),Se},Ne.Separator=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=te(["cms-separator",ye(e.vertical,"vertical"),e.class]),s=JSswift.omit(e,["vertical","size","slots"]);s.class=n;const i={borderColor:"var(--cms-border)",...e.style||{}},c=o(e.size),x=o(e.vertical);if(c!=null){const d=mt(c);x?i.width=d:i.height=d}return s.style=i,_.hr(s)},Ne.Banner=(...t)=>{var Se;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Vt(o(e.type)||o(e.state)||""),c={state:i,dismissible:()=>!!o(e.dismissible)},x=Ct([e.type,e.state],()=>i()),d=Ct(e.variant,()=>{const L=String(o(e.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(L)?`cms-banner-${L}`:""}),r=Ct([e.actionsPlacement,e.stack],()=>String(o(e.actionsPlacement)||"").toLowerCase()==="bottom"||o(e.stack)?"cms-banner-actions-bottom":""),w=Ct(e.stack,()=>o(e.stack)?"cms-banner-stack":""),F={...e},S=JSswift.omit(F,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);S.class=te(["cms-clear-set","cms-banner","cms-singularity",x,d,r,w,F.class]),S.style={...F.style||{}};const b=L=>{if(L==null||L==="")return"";const m=o(L);if(m==null||m==="")return"";const h=String(m);return In(h)?`var(--cms-${h})`:h};(e.accent!=null||Ye(e.accent))&&(S.style["--cms-banner-accent"]=()=>b(e.accent),S.style["--cms-banner-border"]=()=>{const L=b(e.accent);return L?`color-mix(in srgb, ${L} 38%, var(--cms-border-color))`:""},S.style["--cms-banner-bg"]=()=>{const L=b(e.accent);return L?`color-mix(in srgb, ${L} 14%, var(--cms-panel))`:""},S.style["--cms-banner-color"]=()=>{const L=b(e.accent);return L?`color-mix(in srgb, ${L} 78%, white)`:""});const P={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},re=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?Ne.Icon({name:e.icon,size:e.iconSize||e.size||"md"}):JSswift.ui.slot(e.icon,{as:"icon"});const L=i(),m=L?P[L]:null;return m?Ne.Icon({name:m,size:e.iconSize||e.size||"md"}):null})(),Z=J(s,"title",c,e.title),he=J(s,"message",c,e.message!=null?e.message:n),H=J(s,"description",c,(Se=e.description)!=null?Se:e.subtitle),W=J(s,"meta",c,e.meta),se=J(s,"default",c,e.body!=null?[e.body,...n||[]]:e.message!=null?n:null),X=J(s,"icon",c,re),fe=J(s,"aside",c,e.aside),_e=J(s,"actions",c,e.actions),be=J(s,"dismiss",c,e.dismiss),me=String(o(e.actionsPlacement)||"").toLowerCase()==="bottom"||!!o(e.stack),de=!!o(e.dismissible)||!!e.onDismiss;let ce=null;const $=de?Ne.Btn({class:"cms-banner-close",outline:!0,size:e.size||"sm","aria-label":e.closeLabel||"Chiudi banner",onClick:L=>{var m;(m=e.onDismiss)==null||m.call(e,L),!L.defaultPrevented&&(ce==null||ce.remove())}},Ne.Icon({name:"close",size:e.size||"sm"})):null,le=[...fe,...me?[]:_e,...be.length?be:$?[$]:[]];ce=_.div(S,X.length?_.div({class:"cms-banner-icon"},...X):null,_.div({class:"cms-banner-body"},_.div({class:"cms-banner-copy"},Z.length?_.div({class:"cms-banner-title"},...Z):null,he.length?_.div({class:"cms-banner-message"},...he):null,H.length?_.div({class:"cms-banner-description"},...H):null,se.length?_.div({class:"cms-banner-extra"},...se):null,W.length?_.div({class:"cms-banner-meta"},...W):null),me&&_e.length?_.div({class:"cms-banner-actions"},..._e):null),le.length?_.div({class:"cms-banner-side"},...le):null);const oe=S.role||(()=>{const L=i();return L==="danger"||L==="warning"?"alert":"status"})();return ce.setAttribute("role",oe),Nt(ce,e),ce},Ne.Alert=(...t)=>{var X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Vt(o(e.type)||o(e.state)||o(e.color)||"warning"),c=Ct([e.type,e.state,e.color],()=>{const fe=i();return fe?`cms-state-${fe}`:""}),x={...e},d=JSswift.omit(x,["actions","aside","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","state","subtitle","title","type","variant"]);d.class=te(["cms-clear-set","cms-alert","cms-singularity",c,ye(e.dismissible,"is-dismissible"),x.class]),d.style={...x.style||{}};const r={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"?Ne.Icon({name:e.icon,size:e.iconSize||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"});const fe=r[i()]||r.warning;return Ne.Icon({name:fe,size:e.iconSize||"sm"})})(),F=J(s,"title",{},e.title),S=J(s,"message",{},e.message!=null?e.message:n),b=J(s,"description",{},(X=e.description)!=null?X:e.subtitle),P=J(s,"meta",{},e.meta),re=J(s,"actions",{},e.actions),Z=J(s,"aside",{},e.aside),he=J(s,"icon",{},w),H=J(s,"dismiss",{},e.dismiss);let W=null;const se=e.dismissible||e.onDismiss?Ne.Btn({class:"cms-alert-close",outline:!0,size:"sm","aria-label":e.closeLabel||"Chiudi alert",onClick:fe=>{var _e;(_e=e.onDismiss)==null||_e.call(e,fe),!fe.defaultPrevented&&(W==null||W.remove())}},Ne.Icon({name:"close",size:"sm"})):null;return W=_.div(d,he.length?_.div({class:"cms-alert-icon"},...he):null,_.div({class:"cms-alert-body"},F.length?_.div({class:"cms-alert-title"},...F):null,S.length?_.div({class:"cms-alert-message"},...S):null,b.length?_.div({class:"cms-alert-description"},...b):null,P.length?_.div({class:"cms-alert-meta"},...P):null,re.length?_.div({class:"cms-alert-actions"},...re):null),Z.length||H.length||se?_.div({class:"cms-alert-side"},...Z,...H.length?H:se?[se]:[]):null),W.setAttribute("role",i()==="danger"||i()==="warning"?"alert":"status"),Nt(W,e),W},Ne.EmptyState=(...t)=>{var se;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Vt(o(e.state)||o(e.color)||""),c=Ct([e.state,e.color],()=>{const X=i();return X?`cms-state-${X}`:""}),x={...e},d=JSswift.omit(x,["actions","description","eyebrow","icon","iconSize","illustration","media","message","meta","slots","state","title"]);d.class=te(["cms-clear-set","cms-empty-state","cms-singularity",c,ye(e.compact,"compact"),ye(e.inline,"inline"),x.class]),d.style={...x.style||{}};const r=e.icon===!1?null:e.icon!=null?typeof e.icon=="string"?Ne.Icon({name:e.icon,size:e.iconSize||"xl"}):JSswift.ui.slot(e.icon,{as:"icon"}):Ne.Icon({name:"inbox",size:e.iconSize||"xl"}),w=J(s,"illustration",{},(se=e.illustration)!=null?se:e.media),F=J(s,"icon",{},r),S=J(s,"eyebrow",{},e.eyebrow),b=J(s,"title",{},e.title),P=J(s,"message",{},e.message!=null?e.message:n),re=J(s,"description",{},e.description),Z=J(s,"meta",{},e.meta),he=J(s,"actions",{},e.actions),H=J(s,"default",{},e.message!=null?n:null),W=_.section(d,w.length?_.div({class:"cms-empty-state-illustration"},...w):null,F.length?_.div({class:"cms-empty-state-icon"},...F):null,S.length?_.div({class:"cms-empty-state-eyebrow"},...S):null,b.length?_.div({class:"cms-empty-state-title"},...b):null,P.length?_.div({class:"cms-empty-state-message"},...P):null,re.length?_.div({class:"cms-empty-state-description"},...re):null,Z.length?_.div({class:"cms-empty-state-meta"},...Z):null,H.length?_.div({class:"cms-empty-state-extra"},...H):null,he.length?_.div({class:"cms-empty-state-actions"},...he):null);return Nt(W,e),W};let Un="jsswift:drawer-open";const Go=new Set,Eo=new Map,Zn=(t=Un)=>{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}},$i=(t,e=Un)=>{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=Zn();const Mn=(t,e=Un)=>{_n=!!t;const n=Eo.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 Go.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(_n);return}const{el:i,openIcon:c,closeIcon:x}=s;i&&(i.textContent=_n?c:x)}),$i(_n,e),_n};Ne.Tooltip=(...t)=>{var oe,Se;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{};let i=null,c=null,x=null,d=null;const r=L=>Object.prototype.hasOwnProperty.call(e,L),w=r("target")||r("anchorEl")||r("triggerEl"),F=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),S=(L,m)=>{const h=o(L);if(h==null||h==="")return m;const p=Number(h);return Number.isFinite(p)?p:m},b=()=>{clearTimeout(c),clearTimeout(x),c=null,x=null},P=()=>S(e.delay,350),re=()=>S(e.hideDelay,o(e.interactive)?120:0),Z=()=>{if(b(),!i)return;const L=i;i=null,_s(L,()=>JSswift.overlay.close(L.id))},H=(L=>{if(L==null||L===!0)return new Set(["hover","focus"]);if(L===!1)return new Set(["manual"]);const m=Array.isArray(L)?L:String(L).split(/[\s,|/]+/),h=new Set;return m.forEach(p=>{const V=String(p||"").trim().toLowerCase();V&&(V==="mouseenter"||V==="mouseover"?h.add("hover"):V==="blur"||V==="focusin"?h.add("focus"):V==="tap"?h.add("click"):h.add(V))}),h.size?h:new Set(["manual"])})((Se=(oe=e.trigger)!=null?oe:e.triggers)!=null?Se:r("open")?"manual":null),W=H.has("hover"),se=H.has("focus"),X=H.has("click"),fe=H.has("manual")||!W&&!se&&!X,_e=()=>{var Y,Q,ve,N,f,A;const L={anchorEl:d||F||null,close:()=>Z(),hide:()=>Z(),isOpen:()=>!!i},m=e.icon?typeof e.icon=="string"?Ne.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,h=J(s,"title",L,(Y=e.title)!=null?Y:e.heading),p=J(s,"icon",L,m),V=J(s,"footer",L,(Q=e.footer)!=null?Q:e.actions);let ie=(A=(f=(N=(ve=e.content)!=null?ve:e.text)!=null?N:e.body)!=null?f:e.description)!=null?A:e.label;ie==null&&(w?ie=n:F&&n&&n.length>1?ie=n.slice(1):F||(ie=n));let a=J(s,"content",L,ie);a.length||(a=J(s,"default",L,ie));const C=a.length?_.div({class:"cms-tooltip-body"},...a):null,g=p.length||h.length?_.div({class:"cms-tooltip-head"},p.length?_.div({class:"cms-tooltip-icon"},...p):null,_.div({class:"cms-tooltip-head-main"},h.length?_.div({class:"cms-tooltip-title"},...h):null,C)):C,M=V.length?_.div({class:"cms-tooltip-footer"},...V):null;return _.div({class:"cms-tooltip-content"},...[g,M].filter(Boolean))},be=L=>{var a,C,g,M,Y,Q;const m=L||d;if(!m||o(e.disabled))return null;if(i&&i._anchorEl===m)return i;i&&Z();const h=(a=e.closeOnOutside)!=null?a:X||o(e.interactive),p=(C=e.closeOnEsc)!=null?C:X||o(e.interactive);let V=null;if(i=JSswift.overlay.open(()=>_e(),{type:"tooltip",anchorEl:m,placement:e.placement||"top",offsetX:(g=e.offsetX)!=null?g:0,offsetY:(Y=(M=e.offsetY)!=null?M:e.offset)!=null?Y:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:h,closeOnBackdrop:!1,closeOnEsc:p,autoFocus:!1,className:qt(["cms-tooltip",ye(e.interactive,"interactive"),e.class,e.panelClass]),onClose:()=>{var ve,N;(ve=V==null?void 0:V._tooltipCleanup)==null||ve.call(V),i===V&&(i=null),(N=e.onClose)==null||N.call(e)}}),!(i!=null&&i.panel))return i;const ie=i;if(V=ie,ie._anchorEl=m,ie.panel.dataset.placement=String(o(e.placement||"top")),e.maxWidth!=null&&(ie.panel.style.maxWidth=mt(o(e.maxWidth))),e.minWidth!=null&&(ie.panel.style.minWidth=mt(o(e.minWidth))),e.width!=null&&(ie.panel.style.width=mt(o(e.width))),e.style&&Object.assign(ie.panel.style,e.style),Nt(ie.panel,e),o(e.interactive)){const ve=()=>{clearTimeout(x),x=null},N=()=>de(),f=A=>{const z=A.target;z&&z.closest&&z.closest("[data-tooltip-close]")&&Z()};ie.panel.addEventListener("mouseenter",ve),ie.panel.addEventListener("mouseleave",N),ie.panel.addEventListener("focusin",ve),ie.panel.addEventListener("focusout",N),ie.panel.addEventListener("click",f),ie._tooltipCleanup=()=>{var A,z,K,ke,Me;(A=ie.panel)==null||A.removeEventListener("mouseenter",ve),(z=ie.panel)==null||z.removeEventListener("mouseleave",N),(K=ie.panel)==null||K.removeEventListener("focusin",ve),(ke=ie.panel)==null||ke.removeEventListener("focusout",N),(Me=ie.panel)==null||Me.removeEventListener("click",f)}}return xs(ie),(Q=e.onOpen)==null||Q.call(e,ie),ie},me=L=>{clearTimeout(x),x=null,clearTimeout(c),c=setTimeout(()=>be(L),P())},de=(L=!1)=>{if(clearTimeout(c),c=null,!!i){if(clearTimeout(x),L){Z();return}x=setTimeout(()=>Z(),re())}},ce=L=>{i?de(!0):be(L)},$=()=>!!i,le=L=>{if(!L)return()=>{};d=L;const m=[],h=()=>{b(),m.forEach(p=>p())};if(r("open"))return Ye(e.open)?JSswift.reactive.effect(()=>{d&&(o(e.open)?be(d):de(!0))},"UI.Tooltip:open"):e.open===!0?be(L):e.open===!1&&de(!0),h;if(fe||o(e.disabled))return h;if(W){const p=()=>me(L),V=()=>de();L.addEventListener("mouseenter",p),L.addEventListener("mouseleave",V),m.push(()=>{L.removeEventListener("mouseenter",p),L.removeEventListener("mouseleave",V)})}if(se){const p=()=>me(L),V=()=>de();L.addEventListener("focus",p),L.addEventListener("blur",V),m.push(()=>{L.removeEventListener("focus",p),L.removeEventListener("blur",V)})}if(X){const p=V=>{var ie;(ie=e.onTriggerClick)==null||ie.call(e,V),!V.defaultPrevented&&ce(L)};L.addEventListener("click",p),m.push(()=>L.removeEventListener("click",p))}return h};if(F){const L=te(["cms-tooltip-wrap",e.wrapClass,e.targetClass]),m=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"]);m.class=L,m.style={display:"inline-flex",alignItems:"center",...e.wrapStyle||e.targetStyle||{}};const h=JSswift.ui.renderSlot(s,"target",{open:()=>be(d),show:()=>me(d),hide:()=>de(!0),toggle:()=>ce(d),isOpen:$},F),p=_.span(m,...J(null,"default",{},h));return le(p),p._tooltip={bind:le,open:be,show:me,hide:de,close:Z,toggle:ce,isOpen:$},p}return{bind:le,open:be,show:me,hide:de,close:Z,toggle:ce,isOpen:$}};const zo=(t,e,n={})=>{var L;const{props:s,children:i}=JSswift.uiNormalizeArgs(e),c=s.slots||{},x=t==="radio",d=n.appearance==="toggle",r=!x,w=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),F=Zt(s.model,n.modelName||(x?"UI.Radio:model":"UI.Checkbox:model")),S=JSswift.omit(s,["model","label","checked","class","style","dense","onChange","onInput","slots","icon","iconOn","iconOff","iconStandby","checkedIcon","uncheckedIcon","standbyIcon","indeterminateIcon","inputClass","iconSize","color","size","outline","behavior","mode","flat","glossy","glow","glass","gradient","textGradient","lightShadow","shadow","rounded","radius","textColor","clickable","border","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);S.type=t,S.id=w,x&&s.name!=null&&(S.name=s.name),S.class=te([`cms-${t}`,"cms-choice-input",s.inputClass]);const b=_.input(S),P=J(c,"label",{},s.label),re=P.length?P:J(c,"default",{},i),Z=Oe(s,{className:"cms-shortcode cms-choice-shortcode"}),he=Z?[...re,Z]:re,H=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"]);H.class=te(["cms-clear-set","cms-singularity-check","cms-choice-wrap",`cms-${t}-wrap`,ye(d,"cms-toggle-wrap"),ye(d&&x,"cms-toggle-radio-wrap"),ye(d&&!x,"cms-toggle-checkbox-wrap"),ye(s.dense,"dense"),s.class]),H.style={...s.style||{}};const W=o(s.size);W!=null&&!(typeof W=="string"&&((L=JSswift.uiSizes)!=null&&L.includes(W)))&&(H.style["--cms-choice-size"]=mt(W));const se=_.span({class:te(["cms-choice-mark",x?"cms-choice-radio-mark":"cms-choice-checkbox-mark",ye(d,"cms-toggle-mark")])}),X=d?_.span({class:"cms-toggle-thumb"}):se;d&&se.appendChild(X);const fe=he.length?_.span({class:"cms-choice-label"},...he):null,_e=_.label(H,b,se,fe);Nt(_e,s);const be=s.iconSize?s.iconSize:s.size,me=d?null:x?"radio_button_checked":"check",de=d?null:x?"radio_button_unchecked":null,ce=d||x?null:"indeterminate_check_box",$=m=>{if(x)return b.checked=m==s.value,b.checked;const h=m==null?null:!!m;return b.checked=h===!0,b.indeterminate=r&&h==null,h},le=()=>!x&&r&&b.indeterminate?null:!!b.checked,oe=m=>m===!0?s.checkedIcon!=null?s.checkedIcon:s.icon!=null?s.icon:me:m===!1?s.uncheckedIcon!=null?s.uncheckedIcon:de:s.indeterminateIcon!=null?s.indeterminateIcon:s.standbyIcon!=null?s.standbyIcon:s.iconStandby!=null?s.iconStandby:ce,Se=()=>{const m=le(),h=m===!0;for(;X.firstChild;)X.removeChild(X.firstChild);_e.classList.toggle("is-checked",h),_e.classList.toggle("is-indeterminate",m==null),_e.classList.toggle("is-disabled",!!b.disabled),h&&(s.checkedIcon||s.icon)?_e.classList.toggle("toggle-default",!1):h&&!s.checkedIcon||m==null&&!s.standbyIcon?_e.classList.toggle("toggle-default",!0):m==null&&s.standbyIcon?_e.classList.toggle("toggle-default",!1):b.disabled===!1&&!s.uncheckedIcon?_e.classList.toggle("toggle-default",!0):_e.classList.toggle("toggle-default",!1),d&&(m==null?X.style.transform="translateX(calc((var(--cms-toggle-width) - var(--cms-toggle-thumb-size) - 1px) / 2))":X.style.removeProperty("transform"));const p={checked:h,state:m,indeterminate:m==null,value:s.value,id:w,type:t};let V=null;if(m===!0?(V=JSswift.ui.renderSlot(c,"checkedIcon",p,null),V==null&&(V=JSswift.ui.renderSlot(c,"iconOn",p,null))):m===!1?(V=JSswift.ui.renderSlot(c,"uncheckedIcon",p,null),V==null&&(V=JSswift.ui.renderSlot(c,"iconOff",p,null))):(V=JSswift.ui.renderSlot(c,"indeterminateIcon",p,null),V==null&&(V=JSswift.ui.renderSlot(c,"standbyIcon",p,null)),V==null&&(V=JSswift.ui.renderSlot(c,"iconStandby",p,null))),V==null&&(V=JSswift.ui.renderSlot(c,"icon",p,null)),V==null){const ie=oe(m);typeof ie=="string"?V=Ne.Icon({name:ie,size:be,...d?{textColor:s.color,outline:!0}:{}}):ie!=null&&(V=JSswift.ui.slot(ie,{checked:h,state:m,indeterminate:m==null,as:m===!0?"checkedIcon":m===!1?"uncheckedIcon":"indeterminateIcon"}))}J(null,"default",{},V).forEach(ie=>X.appendChild(ie))};return F?($(F.get()),F.watch(m=>{$(m),Se()},x?"UI.Radio:watch":"UI.Checkbox:watch"),b.addEventListener("change",m=>{var h,p;if(x)b.checked&&(F.set(s.value),(h=s.onChange)==null||h.call(s,s.value,m));else{const V=le();F.set(V),(p=s.onChange)==null||p.call(s,V,m)}Se()})):($(x?s.checked===!0?s.value:void 0:s.checked),b.addEventListener("change",m=>{var h,p;x?(h=s.onChange)==null||h.call(s,s.value,m):(p=s.onChange)==null||p.call(s,le(),m),Se()})),s.onInput&&b.addEventListener("input",m=>{var h,p;x?(h=s.onInput)==null||h.call(s,s.value,m):(p=s.onInput)==null||p.call(s,le(),m)}),Se(),it(_e,s,{isEnabled:()=>!b.disabled,action:()=>{if(b.disabled)return!1;Fe(b),b.click()}}),_e};Ne.Checkbox=(...t)=>zo("checkbox",t),Ne.Radio=(...t)=>zo("radio",t),Ne.Toggle=(...t)=>{var s,i,c;const{props:e}=JSswift.uiNormalizeArgs(t),n=String((c=(i=(s=e.behavior)!=null?s:e.mode)!=null?i:e.type)!=null?c:"checkbox").toLowerCase()==="radio"?"radio":"checkbox";return zo(n,t,{appearance:"toggle",modelName:"UI.Toggle:model"})},Ne.Slider=(...t)=>{var K,ke,Me,Te,U;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(vt(e.value)||yt(e.value)?e.value:null),c=Zt(i,"UI.Slider:model"),x=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"]);x.type="range",x.class=te(["cms-slider-input",e.inputClass]);const d=_.input(x),r={...e.style||{}},w=o(e.size);if(w!=null){const j=typeof w=="string"&&((K=JSswift.uiSizes)!=null&&K.includes(w))?`var(--cms-size-${w})`:mt(w);r["--cms-slider-size"]=j,r["--cms-slider-track-size"]=`max(4px, calc(${j} / 4))`,r["--cms-slider-box-height"]=`calc(${j} * 1.5)`,r["--cms-slider-marker-size"]=`max(6px, calc(${j} / 3))`}const F=_.label({class:te(["cms-clear-set","cms-singularity-check","cms-slider-wrap",ye(e.dense,"dense"),e.class]),style:r});Nt(F,e);const S=_.div({class:"cms-slider-header"}),b=_.span({class:"cms-slider-label"}),P=_.span({class:"cms-slider-value"});S.append(b,P);const re=_.div({class:"cms-slider-body"}),Z=_.span({class:"cms-slider-icon cms-slider-icon-left"}),he=_.span({class:"cms-slider-edge-label cms-slider-edge-label-left"}),H=_.div({class:"cms-slider-main"}),W=_.div({class:"cms-slider-box",style:{minHeight:"var(--cms-slider-box-height, 36px)"}}),se=_.span({class:"cms-slider-rail",style:{height:"var(--cms-slider-track-size, 6px)"}}),X=_.span({class:"cms-slider-selection",style:{height:"var(--cms-slider-track-size, 6px)"}}),fe=_.span({class:"cms-slider-thumb",style:{width:"var(--cms-slider-size, 24px)",height:"var(--cms-slider-size, 24px)"}}),_e=_.span({class:"cms-slider-thumb-icon"}),be=_.span({class:"cms-slider-thumb-label"});fe.append(be,_e);const me=_.div({class:"cms-slider-markers"}),de=_.span({class:"cms-slider-edge-label cms-slider-edge-label-right"}),ce=_.span({class:"cms-slider-icon cms-slider-icon-right"});W.append(se,X,fe,d),H.append(W,me),re.append(Z,he,H,de,ce),F.append(S,re);const $=j=>{for(;j.firstChild;)j.removeChild(j.firstChild)},le=(j,ne,Ve="")=>{$(j),(ne||[]).forEach(He=>j.appendChild(He)),j.style.display=j.childNodes.length?Ve:"none"},oe=j=>vt(j)||yt(j)?o(j):j,Se=(j,ne={})=>rn(oe(j),ne),L=(j,ne,Ve={})=>{var ae,$e;const He=oe(j);return He==null?[]:typeof He=="string"?[Ne.Icon({name:He,size:($e=(ae=e.iconSize)!=null?ae:e.size)!=null?$e:16})]:Se(He,{...Ve,as:ne})},m=(j,ne)=>{const Ve=Number(j);return Number.isFinite(Ve)?Ve:ne},h=()=>m(o(e.min),0),p=()=>{const j=h(),ne=m(o(e.max),100);return ne<j?j:ne},V=()=>{const j=o(e.step);if(j==="any")return"any";const ne=m(j,1);return ne>0?ne:1},ie=j=>{if(j==="any")return 0;const ne=String(j);if(ne.includes("e-"))return Number(ne.split("e-")[1]||0);const Ve=ne.indexOf(".");return Ve===-1?0:ne.length-Ve-1},a=j=>{const ne=h(),Ve=p(),He=V();let ae=m(j,ne);if(He!=="any"){ae=ne+Math.round((ae-ne)/He)*He;const $e=ie(He);$e>0&&(ae=Number(ae.toFixed($e)))}return Math.min(Ve,Math.max(ne,ae))},C=j=>{const ne=h(),He=p()-ne;if(!He)return 0;const ae=(a(j)-ne)/He,$e=o(e.reverse)?1-ae:ae;return Math.max(0,Math.min(1,$e))},[g,M]=JSswift.reactive.signal(a(c?c.get():(Me=(ke=o(e.value))!=null?ke:o(e.min))!=null?Me:0)),Y=(j,ne={})=>{const Ve=a(j);return g()!==Ve&&M(Ve),String(d.value)!==String(Ve)&&(d.value=String(Ve)),c&&ne.fromModel!==!0&&c.set(Ve),Ve},Q=()=>{var $e;const j=o(e.markers),ne=!!o(($e=e.markerLabels)!=null?$e:e.labelMarks);if(!j)return[];const Ve=h(),He=p(),ae=(Ee,De)=>{var qe,Be,T,Pe,O,k,v,u;if(Ee==null)return null;if(typeof Ee=="object"&&!Array.isArray(Ee)){const I=a((T=(Be=(qe=Ee.value)!=null?qe:Ee.position)!=null?Be:Ee.at)!=null?T:Ve);return{key:(Pe=Ee.key)!=null?Pe:`marker-${De}-${I}`,value:I,label:(O=Ee.label)!=null?O:ne?String(I):null,icon:(k=Ee.icon)!=null?k:null,className:(u=(v=Ee.class)!=null?v:Ee.className)!=null?u:""}}const Ie=a(Ee);return{key:`marker-${De}-${Ie}`,value:Ie,label:ne?String(Ee):null,icon:null,className:""}};if(Array.isArray(j))return j.map((Ee,De)=>ae(Ee,De)).filter(Boolean);if(typeof j=="number"&&j>1){const Ee=Math.floor(j),De=Ee>1?(He-Ve)/(Ee-1):0;return Array.from({length:Ee},(Ie,qe)=>ae(Ve+De*qe,qe)).filter(Boolean)}if(j===!0){const Ee=V();if(Ee==="any")return[ae(Ve,0),ae(He,1)].filter(Boolean);const De=Math.floor((He-Ve)/Ee)+1;return De>24?[ae(Ve,0),ae((Ve+He)/2,1),ae(He,2)].filter(Boolean):Array.from({length:De},(Ie,qe)=>ae(Ve+Ee*qe,qe)).filter(Boolean)}return typeof j=="object"?Object.keys(j).map((Ee,De)=>ae({value:Number(Ee),label:j[Ee]},De)).filter(Boolean):[]},ve=()=>{$(me);const j=Q();me.style.display=j.length?"block":"none",me.style.minHeight=j.some(ne=>ne.label!=null&&ne.label!=="")?"30px":"10px",j.forEach(ne=>{const Ve=C(ne.value),He=o(e.reverse)?g()<=ne.value:g()>=ne.value,ae=_.button({type:"button",class:te(["cms-slider-marker",ne.className,ye(()=>He,"active")]),style:{left:`${Ve*100}%`,color:He?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 T,Pe;if(o(e.disabled)||o(e.readonly))return;const Be=Y(ne.value);(T=e.onInput)==null||T.call(e,Be),(Pe=e.onChange)==null||Pe.call(e,Be)}}),$e={marker:ne,active:He,value:ne.value,current:g(),input:d};let Ee=JSswift.ui.renderSlot(s,"marker",$e,null);Ee==null&&ne.icon!=null&&(Ee=typeof ne.icon=="string"?Ne.Icon({name:ne.icon,size:12}):JSswift.ui.slot(ne.icon,{...$e,as:"marker"}));const De=_.span({class:"cms-slider-marker-tick",style:{width:"var(--cms-slider-marker-size, 8px)",height:"var(--cms-slider-marker-size, 8px)",background:He?o(e.color)||"var(--cms-primary)":"var(--cms-border-color)"}}),Ie=Ee==null?[De]:J(null,"default",$e,Ee),qe=ne.label==null?J(s,"markerLabel",$e,null):J(s,"markerLabel",$e,ne.label);Ie.forEach(Be=>ae.appendChild(Be)),qe.length&&ae.appendChild(_.span({class:"cms-slider-marker-label"},...qe)),me.appendChild(ae)})},N=()=>{var $e;const j={value:g(),input:d,props:e};let ne=J(s,"label",j,oe(e.label));ne.length||(ne=J(s,"default",j,n)),le(b,ne,"inline-flex");const Ve=o(e.showValue),He=Ve===!1?null:($e=oe(e.labelValue))!=null?$e:g(),ae=Ve||oe(e.labelValue)!=null?J(s,"value",j,He):[];le(P,ae,"inline-flex"),S.style.display=b.childNodes.length||P.childNodes.length?"flex":"none"},f=()=>{var De,Ie,qe,Be;const j={value:g(),input:d,props:e},ne=J(s,"icon",j,null),Ve=ne.length?ne:L(e.icon,"icon",j);le(Z,Ve,"inline-flex");const He=J(s,"iconRight",j,null),ae=He.length?He:L(e.iconRight,"iconRight",j);le(ce,ae,"inline-flex");const $e=oe((Ie=(De=e.startLabel)!=null?De:e.leftLabel)!=null?Ie:e.minLabel),Ee=oe((Be=(qe=e.endLabel)!=null?qe:e.rightLabel)!=null?Be:e.maxLabel);le(he,J(s,"startLabel",j,$e),"inline-flex"),le(de,J(s,"endLabel",j,Ee),"inline-flex")},A=()=>{var $e,Ee,De,Ie;const j={value:g(),input:d,props:e},ne=J(s,"thumbIcon",j,null),Ve=(Ee=($e=e.thumbIcon)!=null?$e:e.iconThumb)!=null?Ee:e.pointIcon;le(_e,ne.length?ne:L(Ve,"thumbIcon",j),"inline-flex");const He=(Ie=(De=oe(e.thumbLabel))!=null?De:oe(e.labelValue))!=null?Ie:o(e.showValue)?String(g()):null,ae=J(s,"thumbLabel",j,He);le(be,ae,"inline-flex")},z=()=>{const j=a(g()),ne=h(),Ve=p(),He=V(),$e=`${C(j)*100}%`,Ee=o(e.color)||o(e.selectionColor)||"var(--cms-primary)",De=o(e.trackColor)||"var(--cms-border-color)",Ie=o(e.thumbColor)||Ee,qe=!!o(e.readonly),Be=!!o(e.disabled);d.min=String(ne),d.max=String(Ve),d.step=He==="any"?"any":String(He),d.disabled=Be,d.value=String(j),se.style.background=De,X.style.background=Ee,X.style.width=$e,fe.style.left=$e,fe.style.borderColor=Ie,fe.style.color=Ie,be.style.background=Ee,F.classList.toggle("is-disabled",Be),F.classList.toggle("is-readonly",qe),F.classList.toggle("has-markers",me.childNodes.length>0)};if(c?(Y(c.get(),{fromModel:!0}),c.watch(j=>{Y(j,{fromModel:!0})},"UI.Slider:watch")):Ye(e.value)?JSswift.reactive.effect(()=>{Y(o(e.value),{fromModel:!0})},"UI.Slider:value"):Y((U=(Te=e.value)!=null?Te:e.min)!=null?U:0,{fromModel:!0}),d.addEventListener("input",j=>{var Ve;if(o(e.disabled)||o(e.readonly)){d.value=String(g());return}const ne=Y(d.value);(Ve=e.onInput)==null||Ve.call(e,ne,j)}),d.addEventListener("change",j=>{var Ve;if(o(e.disabled)||o(e.readonly)){d.value=String(g());return}const ne=Y(d.value);(Ve=e.onChange)==null||Ve.call(e,ne,j)}),JSswift.reactive.effect(()=>{N(),f(),A(),ve(),z()},"UI.Slider:render"),F._input=d,F._getValue=g,F._setValue=j=>Y(j),e.withQItem||e.qitem||e.item===!0){const j=Ne.Item({class:te(["cms-slider-item",e.itemClass]),style:e.itemStyle},F);return j._input=d,j._slider=F,j._getValue=g,j._setValue=F._setValue,j}return F},Ne.Rating=(...t)=>{var g;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(vt(e.value)||yt(e.value)?e.value:null),c=Zt(i,"UI.Rating:model"),x=e.id||"cms-rating-"+Math.random().toString(36).slice(2),d=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"]);d.type="hidden",d.id=x,e.name!=null&&(d.name=e.name),d.class=te(["cms-rating-input","cms-choice-input",e.inputClass]);const r=_.input(d),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=te(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",ye(e.dense,"dense"),e.class]),w.style={...e.style||{}};const F=o(e.size);F!=null&&!(typeof F=="string"&&((g=JSswift.uiSizes)!=null&&g.includes(F)))&&(w.style["--cms-rating-size"]=mt(F));const S=o(e.gap);S!=null&&(w.style["--cms-rating-gap"]=mt(S));const b=_.span({class:"cms-rating-control",onMouseleave:M=>{var Y;oe!=null&&(oe=null,a(),(Y=e.onHover)==null||Y.call(e,ce(),M))},onKeydown:M=>{if(!de())return;const Y=fe()?.5:1,Q=ce();let ve=Q;switch(M.key){case"ArrowRight":case"ArrowUp":ve=Q+Y;break;case"ArrowLeft":case"ArrowDown":ve=Q-Y;break;case"Home":ve=o(e.clearable)?0:Y;break;case"End":ve=X();break;case"Delete":case"Backspace":case"0":if(!o(e.clearable))return;ve=0;break;case" ":case"Enter":ve=Q||(o(e.clearable)?Y:Math.max(Y,1));break;default:return}M.preventDefault(),C(ve,M,{emit:!0})}}),P=_.span({class:"cms-choice-label cms-rating-label"}),re=_.label(w,r,b,P);Nt(re,e);const Z=M=>{for(;M.firstChild;)M.removeChild(M.firstChild)},he=(M,Y,Q="")=>{Z(M),(Y||[]).forEach(ve=>M.appendChild(ve)),M.style.display=M.childNodes.length?Q:"none"},H=M=>vt(M)||yt(M)?o(M):M,W=(M,Y={})=>rn(H(M),Y),se=(M,Y,Q={})=>{var N,f;const ve=H(M);return ve==null?[]:typeof ve=="string"?[Ne.Icon({name:ve,color:e.color,size:(f=(N=e.iconSize)!=null?N:e.size)!=null?f:16})]:W(ve,{...Q,as:Y})},X=()=>{var Y;const M=Number((Y=o(e.max))!=null?Y:5);return Number.isFinite(M)&&M>0?Math.max(1,Math.round(M)):5},fe=()=>{var M;return!!o((M=e.half)!=null?M:e.allowHalf)},_e=(M,Y=X())=>{let Q=Number(o(M));Number.isFinite(Q)||(Q=0),Q=Math.min(Y,Math.max(0,Q));const ve=fe()?.5:1;return Math.round(Q/ve)*ve},be=()=>!!o(e.disabled),me=()=>!!o(e.readonly),de=()=>!be()&&!me(),ce=()=>_e(c?c.get():le),$=M=>{const Y=M>0?String(M):"";r.value=Y,r.setAttribute("value",Y),r.disabled=be()};let le=_e(c?c.get():o(e.value)),oe=null,Se=0,L=[];const m=(M,Y)=>{if(!fe())return _e(M);const Q=Y.currentTarget.getBoundingClientRect(),ve=Y.clientX-Q.left<=Q.width/2;return _e(ve?M-.5:M)},h=(M,Y)=>M>=Y?"full":fe()&&M>=Y-.5?"half":"empty",p=(M,Y)=>{var A,z,K,ke,Me,Te,U,j,ne,Ve,He,ae,$e,Ee,De;const Q=o((K=(z=(A=e.colorSelected)!=null?A:e.activeColor)!=null?z:e.color)!=null?K:e.textColor)||"var(--cms-warning, #f0b429)",ve=o((j=(U=(Te=(Me=(ke=e.colorHalf)!=null?ke:e.halfColor)!=null?Me:e.colorSelected)!=null?Te:e.activeColor)!=null?U:e.color)!=null?j:e.textColor)||Q,N=o(($e=(ae=(He=(Ve=(ne=e.colorHovered)!=null?ne:e.hoverColor)!=null?Ve:e.colorSelected)!=null?He:e.activeColor)!=null?ae:e.color)!=null?$e:e.textColor)||Q,f=o((De=(Ee=e.colorInactive)!=null?Ee:e.colorOff)!=null?De:e.color)||"var(--cms-muted)";return Y?N:M==="full"?Q:M==="half"?ve:f},V=M=>{var N,f,A,z,K,ke,Me,Te,U,j,ne,Ve,He,ae,$e;const Y=[];M.hovered&&M.state!=="empty"&&Y.push("hoveredIcon","iconHovered"),M.state==="full"?Y.push("checkedIcon","selectedIcon","iconSelected","iconOn"):M.state==="half"?Y.push("halfIcon","iconHalf"):Y.push("uncheckedIcon","iconOff"),Y.push("icon","item","star");for(const Ee of Y){const De=J(s,Ee,M,null);if(De.length)return De}let Q=null,ve="icon";return M.hovered&&M.state!=="empty"&&(Q=(N=e.hoveredIcon)!=null?N:e.iconHovered,ve="hoveredIcon"),Q==null&&M.state==="full"?(Q=(K=(z=(A=(f=e.checkedIcon)!=null?f:e.iconSelected)!=null?A:e.iconOn)!=null?z:e.icon)!=null?K:"star",ve="checkedIcon"):Q==null&&M.state==="half"?(Q=(j=(U=(Te=(Me=(ke=e.halfIcon)!=null?ke:e.iconHalf)!=null?Me:e.checkedIcon)!=null?Te:e.iconSelected)!=null?U:e.icon)!=null?j:"star_half",ve="halfIcon"):Q==null&&(Q=($e=(ne=e.uncheckedIcon)!=null?ne:e.iconOff)!=null?$e:o(e.noDimming)?(ae=(He=(Ve=e.icon)!=null?Ve:e.checkedIcon)!=null?He:e.iconSelected)!=null?ae:"star":"star_border",ve="uncheckedIcon"),se(Q,ve,M)},ie=()=>{const M=X();if(Se!==M){Se=M,L=[],Z(b);for(let Y=1;Y<=M;Y++){const Q=_.span({class:"cms-rating-item-icon"}),ve=_.span({class:"cms-rating-item",role:"radio",tabIndex:-1,onMousemove:N=>{var A;if(!de())return;const f=m(Y,N);oe!==f&&(oe=f,a(),(A=e.onHover)==null||A.call(e,f,N))},onClick:N=>{if(!de())return;let f=m(Y,N);o(e.clearable)&&f===ce()&&(f=0),C(f,N,{emit:!0})}},Q);L.push({item:ve,iconHost:Q,index:Y}),b.appendChild(ve)}}},a=()=>{var ke,Me;ie();const M=X(),Y=ce(),Q=oe==null?Y:_e(oe,M),ve=be(),N=me(),f=!!o(e.clearable),A=!!o(e.noDimming);re.classList.toggle("is-disabled",ve),re.classList.toggle("is-readonly",N),re.classList.toggle("is-hovering",oe!=null),re.classList.toggle("is-clearable",f),re.classList.toggle("is-half",fe()),re.classList.toggle("no-dimming",A);const z=Number((Me=o((ke=e.tabindex)!=null?ke:e.tabIndex))!=null?Me:0);b.tabIndex=ve?-1:z,b.setAttribute("role","slider"),b.setAttribute("aria-valuemin","0"),b.setAttribute("aria-valuemax",String(M)),b.setAttribute("aria-valuenow",String(Y)),b.setAttribute("aria-disabled",ve?"true":"false"),b.setAttribute("aria-readonly",N?"true":"false"),$(Y);const K=J(s,"label",{value:Y,max:M,disabled:ve,readonly:N,clearable:f},e.label!=null?H(e.label):n);he(P,K,"inline-flex"),L.forEach(({item:Te,iconHost:U,index:j})=>{const ne=h(Q,j),Ve=oe!=null&&ne!=="empty",He={index:j,max:M,value:Y,displayValue:Q,state:ne,active:ne!=="empty",checked:ne==="full",half:ne==="half",hovered:Ve,disabled:ve,readonly:N,clearable:f,setValue:ae=>C(ae,null,{emit:!1})};Te.className=qt(["cms-rating-item",`is-${ne}`,ye(Ve,"is-hovered")]),Te.style.color=p(ne,Ve),Te.style.opacity=ne==="empty"&&!A?"0.48":"1",Te.setAttribute("aria-checked",String(Y===j)),he(U,V(He),"inline-flex")})},C=(M,Y,Q={})=>{var f,A;const ve=_e(M),N=ce();return le=ve,oe=null,c&&Q.fromModel!==!0&&c.set(ve),$(ve),a(),Q.emit!==!1&&ve!==N&&((f=e.onInput)==null||f.call(e,ve,Y),(A=e.onChange)==null||A.call(e,ve,Y)),ve};return re._input=r,re._rating=b,re._getValue=ce,re._setValue=M=>C(M,null,{emit:!1}),c&&c.watch(M=>{const Y=_e(M);serializeValue(Y)!==serializeValue(le)&&(le=Y,oe=null,$(le),a())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!c&&e.value!=null&&(le=_e(o(e.value))),a()},"UI.Rating:render"),re};const Ut=t=>t?{hour:Number(t.hour)||0,minute:Number(t.minute)||0,second:Number(t.second)||0}:null,On=t=>String(Math.max(0,Number(t)||0)).padStart(2,"0"),zn=(t,e={})=>{var d,r,w,F,S,b,P,re,Z,he,H,W,se,X,fe;if(t==null||t==="")return null;let n=null,s=null,i=0,c=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 _e=Math.max(0,Math.floor(t));n=Math.floor(_e/3600)%24,s=Math.floor(_e/60)%60,i=_e%60}else if(typeof t=="object"){if(t.time!=null||t.value!=null)return zn((d=t.time)!=null?d:t.value,e);n=Number((F=(w=(r=t.hour)!=null?r:t.hours)!=null?w:t.h)!=null?F:t.hh),s=Number((re=(P=(b=(S=t.minute)!=null?S:t.minutes)!=null?b:t.min)!=null?P:t.mm)!=null?re:0),i=Number((W=(H=(he=(Z=t.second)!=null?Z:t.seconds)!=null?he:t.sec)!=null?H:t.ss)!=null?W:0),c=(fe=(X=(se=t.meridiem)!=null?se:t.ampm)!=null?X:t.period)!=null?fe:null}else if(typeof t=="string"){const _e=t.trim();if(!_e)return null;const be=_e.match(/^(\d{1,2})(\d{2})(\d{2})?$/),me=_e.match(/(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?\s*([ap]m)?/i);if(me)n=Number(me[1]),s=Number(me[2]),i=me[3]!=null?Number(me[3]):0,c=me[4]||null;else if(be)n=Number(be[1]),s=Number(be[2]),i=be[3]!=null?Number(be[3]):0;else return null}else return null;if(!Number.isFinite(n)||!Number.isFinite(s)||!Number.isFinite(i))return null;if(c){const _e=String(c).toLowerCase();_e==="pm"&&n<12&&(n+=12),_e==="am"&&n===12&&(n=0)}if(n<0||n>23||s<0||s>59||i<0||i>59)return null;const x={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(i)};return Ko(x,e)},Gn=(t,e={})=>{const n=t&&typeof t=="object"&&t.hour!=null?Ut(t):zn(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;return`${On(n.hour)}:${On(n.minute)}${s?`:${On(n.second)}`:""}`},fo=(t,e)=>{const n=Gn(t,{withSeconds:!0}),s=Gn(e,{withSeconds:!0});return!n&&!s?0:n?s?n<s?-1:n>s?1:0:1:-1};function Ko(t,e={}){if(!t)return null;const n=Ut(t),s=e.min!=null?zn(e.min,{withSeconds:!0}):null,i=e.max!=null?zn(e.max,{withSeconds:!0}):null;return s&&fo(n,s)<0?Ut(s):i&&fo(n,i)>0?Ut(i):n}const kn=(t,e={})=>t==null||t===""?null:t instanceof Date?zn(t,e):typeof t=="object"?zn(t.time!=null?t.time:t,e):typeof t=="string"||typeof t=="number"?zn(t,e):null,mo=(t,e={})=>{var d;const n=zn(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;if(!!!o((d=e.use12h)!=null?d:e.ampm))return`${On(n.hour)}:${On(n.minute)}${s?`:${On(n.second)}`:""}`;const c=n.hour>=12?"PM":"AM",x=n.hour%12||12;return`${On(x)}:${On(n.minute)}${s?`:${On(n.second)}`:""} ${c}`},Vi=(t,e,n={})=>{if(!t)return"";const s=Gn(e,n);return s?`${t}T${s}`:t},To=(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},qo=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:i=!1,minuteStep:c=5,secondStep:x=5,disabled:d=!1,readonly:r=!1,embedded:w=!1,className:F="",slotPrefix:S="",shortcuts:b=null,onSelect:P=null}=t,re=zn(s,{withSeconds:i,min:e.min,max:e.max}),Z=re||zn(new Date,{withSeconds:i,min:e.min,max:e.max})||{hour:0,minute:0,second:0},he=re?Ut(re):null,H=de=>S?`${S}${de[0].toUpperCase()}${de.slice(1)}`:null,W=(de,ce,$)=>{const le=[H(de),de].filter(Boolean);for(const oe of le){if(JSswift.ui.getSlot(n,oe)==null)continue;const L=JSswift.ui.renderSlot(n,oe,ce,$);if(L!=null)return L}return JSswift.ui.slot($,ce)},se=de=>{let ce=W("point",de,null);return ce==null&&t.pointIcon!=null&&de.selected&&(ce=typeof t.pointIcon=="string"?Ne.Icon({name:t.pointIcon,size:w?10:12}):JSswift.ui.slot(t.pointIcon,de)),J(null,"default",de,ce)},X=(de,ce)=>{const $={hour:Z.hour,minute:Z.minute,second:i?Z.second:0};return $[de]=ce,$},fe=_.div({class:te(["cms-time-section",ye(w,"is-embedded"),ye(i,"has-seconds"),F])}),_e=o(b)||[];if(Array.isArray(_e)&&_e.length){const de=_.div({class:"cms-time-shortcuts"});_e.forEach((ce,$)=>{var m,h,p;if(!ce)return;const le=typeof ce.value=="function"?ce.value({now:Gn(new Date,{withSeconds:i})}):ce.value,oe=zn(le,{withSeconds:i,min:e.min,max:e.max});if(!oe)return;const Se={item:ce,index:$,value:Gn(oe,{withSeconds:i}),displayValue:mo(oe,{withSeconds:i,use12h:(m=e.use12h)!=null?m:e.ampm})},L=W("shortcut",Se,(p=(h=ce.label)!=null?h:ce.text)!=null?p:Se.displayValue);de.appendChild(_.button({type:"button",class:te(["cms-time-shortcut",ye(!!he&&fo(oe,he)===0,"is-selected")]),disabled:d||r,onClick:()=>P==null?void 0:P(oe,{shortcut:ce,index:$})},...J(null,"default",Se,L)))}),de.childNodes.length&&fe.appendChild(de)}const be=_.div({class:"cms-time-columns"}),me=(de,ce,$)=>{const le=_.div({class:"cms-time-column","data-time-part":ce}),oe=_.div({class:"cms-time-options"});return $.forEach(Se=>{var C;const L=X(ce,Se),m=Ko(L,{withSeconds:i,min:e.min,max:e.max}),h=d||r||fo(m,L)!==0,p=!!he&&he[ce]===Se,V={part:ce,selected:p,disabled:h,value:Se,label:On(Se),timeValue:Gn(m,{withSeconds:i}),displayValue:mo(m,{withSeconds:i,use12h:(C=e.use12h)!=null?C:e.ampm})},ie=W("option",V,V.label),a=p?se(V):[];oe.appendChild(_.button({type:"button",class:te(["cms-time-option",ye(p,"is-selected"),ye(h,"is-disabled")]),disabled:h,onClick:()=>P==null?void 0:P(m,{part:ce,optionValue:Se})},_.span({class:"cms-time-option-label"},...J(null,"default",V,ie)),a.length?_.span({class:"cms-time-option-point"},...a):null))}),le.appendChild(oe),le};return be.appendChild(me(o(e.hoursLabel)||"Ore","hour",To(1,23))),be.appendChild(me(o(e.minutesLabel)||"Min","minute",To(c,59))),i&&be.appendChild(me(o(e.secondsLabel)||"Sec","second",To(x,59))),fe.appendChild(be),fe},ho=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},Yo=(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((c,x)=>{const d=c.getAttribute("data-time-part")||String(x),r=n&&Number.isFinite(n[d])?n[d]:null;r!=null&&(c.scrollTop=r);const w=c.querySelector(".cms-time-option.is-selected");if(!w)return;const F=Math.max(0,c.scrollHeight-c.clientHeight),S=w.offsetTop-(c.clientHeight-w.offsetHeight)/2,b=Math.max(0,Math.min(F,S));if(Math.abs(c.scrollTop-b)<1){c.scrollTop=b;return}if(s&&typeof c.scrollTo=="function"){c.scrollTo({top:b,behavior:s});return}c.scrollTop=b})},Xo=(t,e={})=>{var ds,fs,es,ts,Xe,pt,Mt,Kt,en,tn,dn,ln;const{props:n,children:s}=JSswift.uiNormalizeArgs(t),i=e.calendar===!0,c=n.slots||{},x=Ct(n.size,()=>{const y=String(o(n.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(y)?`cms-size-${y}`:""}),d=String(o((ts=(es=n.mode)!=null?es:o((fs=(ds=n.rangeMultiple)!=null?ds:n.multipleRange)!=null?fs:n.multiRange)?"range-multiple":null)!=null?ts:n.range&&n.multiple?"range-multiple":n.range?"range":n.multiple?"multiple":"single")).toLowerCase(),r=["range-multiple","multiple-range","rangemultiple","multiplerange","range_multiple","multiple_range","multi-range","multi_range","ranges"].includes(d)?"range-multiple":d==="range"?"range":d==="multiple"?"multiple":"single",w=n.model||(vt(n.value)||yt(n.value)?n.value:null),F=Zt(w,i?"UI.Calendar:model":"UI.Datepicker:model"),S=F?F.get():o(n.value),b=o((Xe=n.rangeAs)!=null?Xe:n.rangeModel)==="array"||Array.isArray(S),P=o((pt=n.rangeMultipleAs)!=null?pt:n.multipleRangeAs)==="array"||Array.isArray(S)&&Array.isArray(S[0]),re=()=>{var y,ue,Je;return r==="single"&&!!o((Je=(ue=(y=n.withTime)!=null?y:n.time)!=null?ue:n.timePicker)!=null?Je:n.enableTime)},Z=()=>{var ue,Je,ot,rt,at,ht,Tt,Ht;const y=Gn(kn((Je=(ue=o(n.timeValue))!=null?ue:F?F.get():o(n.value))!=null?Je:S,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((rt=(ot=n.timeWithSeconds)!=null?ot:n.withSeconds)!=null?rt:n.showSeconds)||/:\d{2}:\d{2}$/.test(y)||/:\d{2}:\d{2}$/.test(o(n.timeFormat)||""),min:o((at=n.timeMin)!=null?at:n.minTime),max:o((ht=n.timeMax)!=null?ht:n.maxTime),use12h:o((Ht=(Tt=n.time12h)!=null?Tt:n.use12h)!=null?Ht:n.ampm)}},he=()=>{var ue,Je;const y=Number(o((Je=(ue=n.timeMinuteStep)!=null?ue:n.minuteStep)!=null?Je:5));return Math.max(1,Math.min(30,Number.isFinite(y)?y:5))},H=()=>{var ue,Je;const y=Number(o((Je=(ue=n.timeSecondStep)!=null?ue:n.secondStep)!=null?Je:5));return Math.max(1,Math.min(30,Number.isFinite(y)?y:5))},W=y=>String(y).padStart(2,"0"),se=(y,ue,Je)=>{const ot=new Date(y,ue,Je);return ot.getFullYear()!==y||ot.getMonth()!==ue||ot.getDate()!==Je?null:ot},X=y=>!(y instanceof Date)||Number.isNaN(y.getTime())?null:`${y.getFullYear()}-${W(y.getMonth()+1)}-${W(y.getDate())}`,fe=y=>{if(typeof y!="string")return null;const ue=y.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!ue)return null;const Je=Number(ue[1]),ot=Number(ue[2])-1,rt=Number(ue[3]),at=new Date(Je,ot,rt);return at.getFullYear()!==Je||at.getMonth()!==ot||at.getDate()!==rt?null:at},_e=(y,ue)=>{const Je=fe(y);return Je?(Je.setDate(Je.getDate()+ue),X(Je)):null},be=(y,ue)=>new Date(y.getFullYear(),y.getMonth()+ue,1),me=y=>{if(y instanceof Date&&!Number.isNaN(y.getTime()))return new Date(y.getFullYear(),y.getMonth(),1);const ue=a(y),Je=fe(ue);return Je?new Date(Je.getFullYear(),Je.getMonth(),1):new Date},de=()=>X(new Date),ce=(y,ue)=>!!y&&!!ue&&y===ue,$=(y,ue)=>y==null&&ue==null?0:y==null?-1:ue==null?1:y<ue?-1:y>ue?1:0,le=(y,ue)=>{const Je=fe(y),ot=fe(ue);return!Je||!ot?0:Math.round((ot.getTime()-Je.getTime())/864e5)},oe=y=>Array.isArray(y)?y.slice():y==null||y===""?[]:[y],Se=y=>({from:(y==null?void 0:y.from)||null,to:(y==null?void 0:y.to)||null}),L=y=>Array.isArray(y)?y.map(Se):[],m=y=>{const ue=Se(y);return b?[ue.from,ue.to]:ue},h=y=>L(y).map(ue=>P?[ue.from,ue.to]:ue),p=y=>r==="multiple"?Array.isArray(y)?y.slice():[]:r==="range"?Se(y):r==="range-multiple"?L(y):y||null,V=y=>r==="multiple"?Array.isArray(y)?y.slice():[]:r==="range"?m(y):r==="range-multiple"?h(y):y||"",ie=y=>JSON.stringify(V(y)),a=y=>{if(y==null||y==="")return null;if(y instanceof Date)return X(y);if(typeof y=="number")return X(new Date(y));if(typeof y!="string")return typeof y=="object"&&y.date!=null?a(y.date):null;const ue=y.trim();if(!ue)return null;const Je=ue.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:$|[T\s])/);if(Je){const ht=se(Number(Je[1]),Number(Je[2])-1,Number(Je[3]));return X(ht)}const ot=ue.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(ot){const ht=ot[3].length===2?2e3+Number(ot[3]):Number(ot[3]),Tt=se(ht,Number(ot[2])-1,Number(ot[1]));return X(Tt)}if(/^\d{1,4}$/.test(ue))return null;const rt=new Date(ue);if(Number.isNaN(rt.getTime()))return null;const at=ue.match(/(?:^|[^\d])(\d{4})(?!\d)/);return at&&rt.getFullYear()!==Number(at[1])?null:X(rt)},C=y=>{var ot,rt,at,ht,Tt,Ht;if(y==null||y==="")return{from:null,to:null};let ue=null,Je=null;if(Array.isArray(y))ue=a(y[0]),Je=a(y[1]);else if(typeof y=="object")ue=a((at=(rt=(ot=y.from)!=null?ot:y.start)!=null?rt:y.dateFrom)!=null?at:y.departure),Je=a((Ht=(Tt=(ht=y.to)!=null?ht:y.end)!=null?Tt:y.dateTo)!=null?Ht:y.return);else{const sn=String(y).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];ue=a(sn[0]),Je=a(sn[1])}return ue&&Je&&ue>Je&&([ue,Je]=[Je,ue]),{from:ue,to:Je}},g=y=>{const ue=[],Je=new Set,ot=rt=>{const at=C(rt);if(!at.from)return;const ht=`${at.from||""}|${at.to||""}`;Je.has(ht)||(Je.add(ht),ue.push(at))};if(y==null||y==="")return ue;if(Array.isArray(y))if(y.every(at=>at==null||typeof at=="string"||typeof at=="number"||at instanceof Date)){const at=y.map(a).filter(Boolean);for(let ht=0;ht<at.length;ht+=2)ot({from:at[ht],to:at[ht+1]||null})}else y.forEach(at=>ot(at));else if(typeof y=="object"&&Array.isArray(y.ranges))y.ranges.forEach(rt=>ot(rt));else if(typeof y=="object")ot(y);else{const at=(String(y).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(a).filter(Boolean);for(let ht=0;ht<at.length;ht+=2)ot({from:at[ht],to:at[ht+1]||null})}return ue.sort((rt,at)=>$(rt.from,at.from)||$(rt.to,at.to))},M=y=>{const ue=[];return oe(y).forEach(Je=>{const ot=a(Je);ot&&!ue.includes(ot)&&ue.push(ot)}),ue.sort()},Y=y=>r==="range"?C(y):r==="range-multiple"?g(y):r==="multiple"?M(y):a(y),Q=()=>{var y;return a(o((y=n.min)!=null?y:n.minDate))},ve=()=>{var y;return a(o((y=n.max)!=null?y:n.maxDate))},N=()=>o(n.locale)||void 0,f=()=>{var ue,Je;const y=Number(o((Je=(ue=n.firstDayOfWeek)!=null?ue:n.weekStart)!=null?Je:1));return Number.isFinite(y)?(y%7+7)%7:1},A=()=>{var Je;const y=r==="range"||r==="range-multiple"?2:1,ue=Number((Je=o(n.monthsToShow))!=null?Je:y);return Math.max(1,Math.min(4,Number.isFinite(ue)?ue:y))},z=()=>{const y=Q(),ue=ve();let Je=a(o(n.defaultMonth))||de();return y&&Je<y&&(Je=y),ue&&Je>ue&&(Je=ue),Je||y||ue||de()},K=()=>o(n.confirm)?Be:qe,ke=y=>{const ue=fe(y);return ue?{date:y,value:y,year:ue.getFullYear(),month:ue.getMonth()+1,day:ue.getDate(),weekday:ue.getDay(),today:ce(y,de())}:{date:y,value:y}},Me=(y,ue)=>y==null?!1:Array.isArray(y)?y.some(Je=>a(Je)===ue):y instanceof Set?y.has(ue):typeof y=="function"?!!y(ue,ke(ue)):typeof y=="string"||y instanceof Date||typeof y=="number"?a(y)===ue:!1,Te=y=>{var Ht,sn,fn,Pn,vn,pn,ns,ms,hs,Ns,$s,Vs,Bs;if(!y)return!1;const ue=Q(),Je=ve();if(ue&&y<ue||Je&&y>Je)return!1;const ot=o((sn=(Ht=n.options)!=null?Ht:n.enableDates)!=null?sn:n.allowedDates);if(ot!=null&&!Me(ot,y))return!1;const rt=o((Pn=(fn=n.disableDates)!=null?fn:n.disabledDates)!=null?Pn:n.notAllowedDates);if(rt!=null&&Me(rt,y))return!1;const at=(vn=fe(y))==null?void 0:vn.getDay();if(Array.isArray(o((pn=n.allowedWeekdays)!=null?pn:n.weekdays))&&at!=null&&!o((ns=n.allowedWeekdays)!=null?ns:n.weekdays).map(Ls=>Number(Ls)).includes(at)||o(n.weekdaysOnly)&&(at===0||at===6)||o(n.weekendsOnly)&&at!=null&&at!==0&&at!==6)return!1;const ht=K(),Tt=r==="range"?ht!=null&&ht.from&&!(ht!=null&&ht.to)?ht:null:r==="range-multiple"&&Array.isArray(ht)&&ht.length&&(ms=ht[ht.length-1])!=null&&ms.from&&!((hs=ht[ht.length-1])!=null&&hs.to)?ht[ht.length-1]:null;if(Tt!=null&&Tt.from){const As=Math.abs(le(Tt.from,y)),Ls=Number(o(($s=(Ns=n.minRange)!=null?Ns:n.minDays)!=null?$s:n.minNights)),js=Number(o((Bs=(Vs=n.maxRange)!=null?Vs:n.maxDays)!=null?Bs:n.maxNights));if(Number.isFinite(Ls)&&As<Ls||Number.isFinite(js)&&As>js)return!1}return!0},U=y=>{var ot,rt;if(!y)return"";const ue=fe(y);return!ue||String(o((rt=(ot=n.displayMask)!=null?ot:n.mask)!=null?rt:"")||"").toLowerCase()==="iso"||o(n.isoDisplay)===!0?y:new Intl.DateTimeFormat(N(),{year:"numeric",month:"short",day:"2-digit"}).format(ue)},j=(y,ue=T)=>{if(r==="range-multiple")return!Array.isArray(y)||!y.length?"":y.length>2&&o(n.compactMultiple)!==!1?`${y.length} ${o(n.multipleRangeLabel)||"intervalli selezionati"}`:y.map(rt=>{const at=rt!=null&&rt.from?U(rt.from):"",ht=rt!=null&&rt.to?U(rt.to):"";return at&&ht?`${at} -> ${ht}`:at||ht||""}).filter(Boolean).join("; ");if(r==="multiple")return!Array.isArray(y)||!y.length?"":y.length>3&&o(n.compactMultiple)!==!1?`${y.length} ${o(n.multipleLabel)||"date selezionate"}`:y.map(U).join(", ");if(r==="range"){const rt=y!=null&&y.from?U(y.from):"",at=y!=null&&y.to?U(y.to):"";return rt&&at?`${rt} -> ${at}`:rt||at||""}const Je=U(y);if(!re())return Je;const ot=Ie(ue);return[Je,ot].filter(Boolean).join(" \u2022 ")},ne=y=>(String(y||"").match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(a).filter(Boolean),Ve=y=>{if(y==null||y==="")return r==="multiple"||r==="range-multiple"?[]:r==="range"?{from:null,to:null}:null;const ue=ne(y);if(r==="range-multiple"){const Je=[];for(let ot=0;ot<ue.length;ot+=2)ue[ot]&&Je.push({from:ue[ot],to:ue[ot+1]||null});return Je}return r==="multiple"?ue:r==="range"?{from:ue[0]||null,to:ue[1]||null}:ue[0]||a(y)},He=()=>r==="multiple"||r==="range-multiple"?[]:r==="range"?{from:null,to:null}:null,ae=(y,ue=null)=>{var ht;if(!re())return null;const Je=Z(),ot=o(n.timeValue),rt=y!=null?y:ot,at=kn(rt,Je);return Ut((ht=at!=null?at:ue)!=null?ht:null)},$e=()=>o(n.confirm)?Pe:T,Ee=(y=qe,ue=T)=>r==="single"&&re()?Vi(y||null,ue,Z()):V(y),De=(y=qe,ue=T)=>JSON.stringify(Ee(y,ue)),Ie=y=>mo(y,Z());let qe=Y(S),Be=p(qe),T=ae(S,kn(o(n.timeValue),Z())),Pe=Ut(T),O=null,k=null,v=me(r==="range"?(qe==null?void 0:qe.from)||(qe==null?void 0:qe.to)||z():r==="range-multiple"?((Mt=qe==null?void 0:qe[qe.length-1])==null?void 0:Mt.from)||((Kt=qe==null?void 0:qe[qe.length-1])==null?void 0:Kt.to)||z():r==="multiple"?qe[0]||z():qe||z()),u=null,I=null;const xe=y=>{const ue=y instanceof Date?y:fe(a(y));if(!ue)return-1;const Je=ue.getFullYear(),ot=ue.getMonth();for(let rt=0;rt<A();rt+=1){const at=be(v,rt);if(at.getFullYear()===Je&&at.getMonth()===ot)return rt}return-1},Ue={...n,label:(en=n.label)!=null?en:n.placeholder},et=Ue.label!=null||JSswift.ui.getSlot(c,"label")!=null,G=r==="range"?"Seleziona andata e ritorno":r==="range-multiple"?"Seleziona intervalli":r==="multiple"?"Seleziona date":"Seleziona data",Ge=i?null:_.input({class:te(["cms-input","cms-date-display",x,ye(n.manualInput,"is-manual"),n.inputClass]),type:"text",autocomplete:"off",placeholder:et?"":(tn=n.placeholder)!=null?tn:G,readOnly:!o(n.manualInput),disabled:!!o(n.disabled),value:j(qe,T)}),lt=_.div({style:{display:"contents"}}),tt=i?null:_.div({class:"cms-date-control",style:{display:"contents"}},Ge,lt),dt=i?null:Ne.FormField({...Ue,iconRight:(dn=n.iconRight)!=null?dn:"calendar_month",control:tt,getValue:()=>Ge.value,onClear:()=>{o(n.disabled)||o(n.readonly)||(Pt(He(),null),u&&un())},onFocus:()=>Ge.focus()}),St=(y,ue={})=>{var rt,at;const Je=ue.focusIso||(r==="range"?(y==null?void 0:y.from)||(y==null?void 0:y.to)||z():r==="range-multiple"?((rt=y==null?void 0:y[y.length-1])==null?void 0:rt.from)||((at=y==null?void 0:y[y.length-1])==null?void 0:at.to)||z():r==="multiple"?(y==null?void 0:y[0])||z():y||z());let ot=me(Je);if(ue.preserveMonthOffset){const ht=Number.isInteger(ue.visibleMonthOffset)?ue.visibleMonthOffset:xe(ue.anchorIso||ue.focusIso||Je);ht>0&&(ot=be(ot,-ht))}v=ot},It=()=>{lt.replaceChildren();const y=o(n.name);if(!y)return;const ue=(rt,at)=>{lt.appendChild(_.input({type:"hidden",name:rt,value:at!=null?at:""}))},Je=qe;if(r==="single"){ue(y,Ee(Je,T));return}if(r==="range"){ue(o(n.nameFrom)||`${y}_from`,(Je==null?void 0:Je.from)||""),ue(o(n.nameTo)||`${y}_to`,(Je==null?void 0:Je.to)||"");return}if(r==="range-multiple"){const rt=Array.isArray(Je)?Je:[],at=/\[\]$/.test(o(n.nameFrom)||"")?o(n.nameFrom):`${o(n.nameFrom)||`${y}_from`}[]`,ht=/\[\]$/.test(o(n.nameTo)||"")?o(n.nameTo):`${o(n.nameTo)||`${y}_to`}[]`;rt.forEach(Tt=>{ue(at,(Tt==null?void 0:Tt.from)||""),ue(ht,(Tt==null?void 0:Tt.to)||"")});return}const ot=/\[\]$/.test(y)?y:`${y}[]`;(Array.isArray(Je)?Je:[]).forEach(rt=>ue(ot,rt))},Rt=()=>{var y;i||(Ge.readOnly=!o(n.manualInput),Ge.disabled=!!o(n.disabled),Ge.setAttribute("aria-expanded",u?"true":"false"),Ge.value=j(qe,T),It(),(y=dt==null?void 0:dt._refresh)==null||y.call(dt))},Pt=(y,ue,Je={})=>{var Tt,Ht,sn;const ot=Y(y),rt=re()?Ut((Tt=kn(Je.timeValue!=null?Je.timeValue:Je.preserveTime?$e():y,Z()))!=null?Tt:Je.preserveTime?$e():null):null,at=De(qe,T);qe=p(ot),Be=p(ot),re()&&(T=Ut(rt),Pe=Ut(rt)),O=null,St(ot,Je),Rt(),an(),F&&Je.fromModel!==!0&&F.set(Ee(ot,rt));const ht=De(ot,rt);if(Je.emit!==!1&&ht!==at){const fn=Ee(ot,rt);(Ht=n.onInput)==null||Ht.call(n,fn,ue),(sn=n.onChange)==null||sn.call(n,fn,ue)}return ot},st=(y,ue,Je={})=>{var ht,Tt;if(!re())return null;const ot=Ut(kn(y,Z()));if(o(n.confirm)&&Je.commit!==!0)return Pe=ot,an(),ot;const rt=De(qe,T);T=Ut(ot),Pe=Ut(ot),Rt(),an(),F&&Je.fromModel!==!0&&F.set(Ee(qe,ot));const at=De(qe,ot);if(Je.emit!==!1&&at!==rt){const Ht=Ee(qe,ot);(ht=n.onInput)==null||ht.call(n,Ht,ue),(Tt=n.onChange)==null||Tt.call(n,Ht,ue)}return ot},wt=(y,ue,Je={})=>{if(o(n.confirm)){Be=p(Y(y)),re()&&(Je.timeValue!=null||Je.preserveTime)&&(Pe=Ut(kn(Je.timeValue!=null?Je.timeValue:$e(),Z()))),O=null,St(Be,Je),an();return}Pt(y,ue,Je)},Ft=()=>{const y=K();if(r==="range")return!(y!=null&&y.from)||y!=null&&y.to||!O?y:$(y.from,O)<=0?{from:y.from,to:O}:{from:O,to:y.from};if(r==="range-multiple"){const ue=Array.isArray(y)&&y.length?y[y.length-1]:null;return!(ue!=null&&ue.from)||ue!=null&&ue.to||!O?ue:$(ue.from,O)<=0?{from:ue.from,to:O}:{from:O,to:ue.from}}return y},Dt=()=>{if(r==="range"){const y=Ft();return y!=null&&y.from?[y]:[]}if(r==="range-multiple"){const y=Array.isArray(K())?K():[];if(!y.length)return[];const ue=Ft();return ue!=null&&ue.from?[...y.slice(0,-1),ue]:y}return[]},Yt=y=>{const ue=K();return r==="multiple"?ue.includes(y):r==="range-multiple"?Array.isArray(ue)&&ue.some(Je=>ce(Je==null?void 0:Je.from,y)||ce(Je==null?void 0:Je.to,y)):r==="range"?ce(ue==null?void 0:ue.from,y)||ce(ue==null?void 0:ue.to,y):ce(ue,y)},Xt=y=>r!=="range"&&r!=="range-multiple"?!1:Dt().some(ue=>(ue==null?void 0:ue.from)&&(ue==null?void 0:ue.to)&&y>=ue.from&&y<=ue.to),on=(y,ue={})=>{const Je=K(),ot=r==="range"?Je:r==="range-multiple"&&Array.isArray(Je)&&Je.length?Je[Je.length-1]:null;!(ot!=null&&ot.from)||ot!=null&&ot.to||O===y||(O=y,ue.render!==!1&&an())},jt=()=>i||o(n.confirm)||n.closeOnSelect===!1?!1:r==="multiple"||r==="range-multiple"?!!n.closeOnSelect:!0,Qt=(y,ue,Je={})=>{var rt;if(!Te(y)||o(n.disabled)||o(n.readonly))return;const ot={focusIso:y,anchorIso:y,preserveTime:re(),timeValue:$e(),preserveMonthOffset:!!u&&A()>1,visibleMonthOffset:Number.isInteger(Je.visibleMonthOffset)?Je.visibleMonthOffset:null};if(r==="multiple"){const at=M(K()),ht=at.includes(y)?at.filter(Tt=>Tt!==y):[...at,y];wt(ht.sort(),ue,ot),jt()&&un();return}if(r==="range"){const at=p(K());let ht;!at.from||at.from&&at.to?ht={from:y,to:null}:$(y,at.from)<0?ht={from:y,to:at.from}:ht={from:at.from,to:y},wt(ht,ue,ot),ht.to&&jt()&&un();return}if(r==="range-multiple"){const at=g(K()),ht=at.length?at[at.length-1]:null;let Tt;!(ht!=null&&ht.from)||ht!=null&&ht.to?Tt=[...at,{from:y,to:null}]:$(y,ht.from)<0?Tt=[...at.slice(0,-1),{from:y,to:ht.from}]:Tt=[...at.slice(0,-1),{from:ht.from,to:y}],wt(Tt,ue,ot),(rt=Tt[Tt.length-1])!=null&&rt.to&&jt()&&un();return}wt(y,ue,ot),jt()&&un()},cn=()=>{k=null,Pt(He(),null,{timeValue:null})},hn=()=>{const y=de();if(!Te(y)){St(y),an();return}if(r==="range"){const ue=_e(y,1),Je=ue&&Te(ue)?{from:y,to:ue}:{from:y,to:null};wt(Je,null);return}if(r==="range-multiple"){const ue=_e(y,1),Je=ue&&Te(ue)?[{from:y,to:ue}]:[{from:y,to:null}];wt(Je,null);return}if(r==="multiple"){wt([y],null);return}wt(y,null,{preserveTime:re(),timeValue:$e()})},Gt=(y={})=>{Yo(I,y)},Tn=()=>{if(!re())return;const y=ho(I);st(new Date,null,{commit:!o(n.confirm)}),Gt({scrollState:y}),!o(n.confirm)&&n.closeOnSelect===!0&&un()},An=()=>{o(n.confirm)&&(Pt(Be,null,{timeValue:Pe,preserveTime:!0}),n.closeOnSelect!==!1&&un())},an=()=>{var ui,di,fi,mi,hi,pi,gi,yi,bi,wi,vi,Si,Ci,xi,_i,ki,Ni,Ai,Li;if(!I)return;const y=N(),ue=new Intl.DateTimeFormat(y,{month:"long",year:"numeric"}),Je=new Intl.DateTimeFormat(y,{weekday:"short"}),ot=Array.from({length:7},(At,$t)=>{const Ln=(f()+$t)%7;return Je.format(new Date(2024,0,7+Ln))}),rt=K(),at=At=>{let $t=JSswift.ui.renderSlot(c,"point",At,null);return $t==null&&($t=JSswift.ui.renderSlot(c,"dayPoint",At,null)),$t==null&&n.pointIcon!=null&&(At.selected||At.inRange||At.today)&&($t=typeof n.pointIcon=="string"?Ne.Icon({name:n.pointIcon,size:10}):JSswift.ui.slot(n.pointIcon,At)),J(null,"default",At,$t)},ht=(At,$t)=>{const Ln=At.getFullYear(),Hs=At.getMonth(),Ws=new Date(Ln,Hs,1),Co=(Ws.getDay()-f()+7)%7,Fo=new Date(Ln,Hs,1-Co),xo=_.div({class:"cms-date-month"});xo.appendChild(_.div({class:"cms-date-month-title"},ue.format(Ws)));const Ii=_.div({class:"cms-date-weekdays"});ot.forEach(Us=>Ii.appendChild(_.div({class:"cms-date-weekday"},Us))),xo.appendChild(Ii);const Ei=_.div({class:"cms-date-grid"});for(let Us=0;Us<42;Us+=1){const Do=new Date(Fo.getFullYear(),Fo.getMonth(),Fo.getDate()+Us),Sn=X(Do),zi=Do.getMonth()===Hs,Ti=Yt(Sn),Pi=Xt(Sn),Ji=(r==="range"||r==="range-multiple")&&Dt().some(yn=>ce(yn==null?void 0:yn.from,Sn)),Ri=(r==="range"||r==="range-multiple")&&Dt().some(yn=>ce(yn==null?void 0:yn.to,Sn)),$o=!Te(Sn),Vo={...ke(Sn),selected:Ti,inRange:Pi,rangeStart:Ji,rangeEnd:Ri,disabled:$o,outside:!zi,value:rt,select:()=>Qt(Sn,null,{visibleMonthOffset:$t})},Bo=at(Vo),cl=JSswift.ui.renderSlot(c,"day",Vo,String(Do.getDate())),ul=J(null,"default",Vo,cl),dl=_.button({type:"button",class:te(["cms-date-day",ye(!zi,"is-outside"),ye(Ti,"is-selected"),ye(Pi,"is-in-range"),ye(Ji,"is-range-start"),ye(Ri,"is-range-end"),ye($o,"is-disabled"),ye(ce(Sn,de()),"is-today"),ye(Bo.length,"has-point")]),disabled:$o,onMouseDown:yn=>{yn.button===0&&(k=Sn,yn.preventDefault(),Qt(Sn,yn,{visibleMonthOffset:$t}))},onClick:yn=>{if(k!=null&&yn.detail!==0){k=null;return}k=null,Qt(Sn,yn,{visibleMonthOffset:$t})},onMouseEnter:()=>on(Sn),onFocus:()=>on(Sn,{render:!1})},_.span({class:"cms-date-day-label"},...ul),Bo.length?_.span({class:"cms-date-day-point"},...Bo):null);Ei.appendChild(dl)}return xo.appendChild(Ei),xo},Tt=Q(),Ht=ve(),sn=[v.getFullYear(),(ui=fe(de()))==null?void 0:ui.getFullYear(),(di=fe(Tt))==null?void 0:di.getFullYear(),(fi=fe(Ht))==null?void 0:fi.getFullYear(),(mi=fe(o(n.defaultMonth)))==null?void 0:mi.getFullYear()];r==="range"?sn.push((hi=fe(rt==null?void 0:rt.from))==null?void 0:hi.getFullYear(),(pi=fe(rt==null?void 0:rt.to))==null?void 0:pi.getFullYear()):r==="range-multiple"?rt.forEach(At=>{var $t,Ln;sn.push(($t=fe(At==null?void 0:At.from))==null?void 0:$t.getFullYear(),(Ln=fe(At==null?void 0:At.to))==null?void 0:Ln.getFullYear())}):r==="multiple"?rt.forEach(At=>{var $t;return sn.push(($t=fe(At))==null?void 0:$t.getFullYear())}):sn.push((gi=fe(rt))==null?void 0:gi.getFullYear());const fn=sn.filter(At=>Number.isFinite(At)),Pn=(fn.length?Math.min(...fn):v.getFullYear())-100,vn=(fn.length?Math.max(...fn):v.getFullYear())+50,pn=Number(o((wi=(bi=n.yearStart)!=null?bi:Tt?(yi=fe(Tt))==null?void 0:yi.getFullYear():null)!=null?wi:Pn)),ns=Number(o((Ci=(Si=n.yearEnd)!=null?Si:Ht?(vi=fe(Ht))==null?void 0:vi.getFullYear():null)!=null?Ci:vn)),ms=_.select({class:"cms-date-select",value:String(v.getMonth()),onChange:At=>{var $t;v=new Date(v.getFullYear(),Number(At.currentTarget.value),1),($t=n.onNavigate)==null||$t.call(n,{month:v.getMonth()+1,year:v.getFullYear()}),an()}},...Array.from({length:12},(At,$t)=>Cs({value:String($t)},new Intl.DateTimeFormat(y,{month:"long"}).format(new Date(2024,$t,1))))),hs=_.select({class:"cms-date-select cms-date-select-year",value:String(v.getFullYear()),onChange:At=>{var $t;v=new Date(Number(At.currentTarget.value),v.getMonth(),1),($t=n.onNavigate)==null||$t.call(n,{month:v.getMonth()+1,year:v.getFullYear()}),an()}},...Array.from({length:Math.max(1,ns-pn+1)},(At,$t)=>{const Ln=pn+$t;return Cs({value:String(Ln)},String(Ln))})),Ns=_.div({class:"cms-date-header"},_.button({type:"button",class:"cms-date-nav",onClick:()=>{var At;v=be(v,-1),(At=n.onNavigate)==null||At.call(n,{month:v.getMonth()+1,year:v.getFullYear()}),an()}},Ne.Icon({name:"chevron_left",size:16})),_.div({class:"cms-date-header-center"},ms,hs),_.button({type:"button",class:"cms-date-nav",onClick:()=>{var At;v=be(v,1),(At=n.onNavigate)==null||At.call(n,{month:v.getMonth()+1,year:v.getFullYear()}),an()}},Ne.Icon({name:"chevron_right",size:16}))),$s=_.div({class:"cms-date-shortcuts"}),Vs=o((xi=n.shortcuts)!=null?xi:n.presets)||[];Vs.forEach((At,$t)=>{var Ws,Co;if(!At)return;const Ln=typeof At.value=="function"?At.value({today:de()}):At.value,Hs=(Co=(Ws=At.label)!=null?Ws:At.text)!=null?Co:`Preset ${$t+1}`;$s.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>wt(Ln,null,{preserveTime:re(),timeValue:$e()})},Hs))});const Bs=_.div({class:"cms-date-months"});for(let At=0;At<A();At+=1)Bs.appendChild(ht(be(v,At),At));const As=j(rt,$e()),Ls=_.div({class:"cms-date-value"},...J(c,"value",{value:rt,displayValue:As,mode:r,timeValue:$e()},As||J(c,"default",{},s))),js=_.div({class:"cms-time-header"}),sl=_.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"));js.appendChild(sl);const ol=re()?qo({props:{min:o((_i=n.timeMin)!=null?_i:n.minTime),max:o((ki=n.timeMax)!=null?ki:n.maxTime),use12h:o((Ai=(Ni=n.time12h)!=null?Ni:n.use12h)!=null?Ai:n.ampm),hoursLabel:o(n.timeHoursLabel)||"Ore",minutesLabel:o(n.timeMinutesLabel)||"Min",secondsLabel:o(n.timeSecondsLabel)||"Sec"},slots:c,slotPrefix:"time",value:$e(),withSeconds:!1,minuteStep:1,secondStep:H(),disabled:!!o(n.disabled),readonly:!!o(n.readonly),embedded:!0,pointIcon:o(n.timePointIcon),shortcuts:o((Li=n.timeShortcuts)!=null?Li:n.timePresets),onSelect:At=>{const $t=ho(I);st(At,null),Gt({scrollState:$t})}}):null,il=_.div({class:"cms-date-footer-info"},Ls),ll=_.div({class:te(["cms-date-footer",ye(re(),"has-time")])},il,_.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:cn},o(n.clearLabel)||"Reset"):null,o(n.confirm)?_.button({type:"button",class:"cms-date-action is-primary",onClick:An},o(n.applyLabel)||"Applica"):null)),rl=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:Tn},o(n.nowLabel)||"Ora")),al=re()?_.div({class:"cms-date-time"},js,ol,rl):null;I.replaceChildren(_.div({class:"cms-date-panel-root",onKeydown:At=>{var $t;At.key==="Escape"&&(At.preventDefault(),i?($t=n.onEscape)==null||$t.call(n,At):un())}},Ns,Vs.length?$s:null,_.div({class:"cms-data-time"},Bs,al),ll))};function Dn(){var y,ue,Je,ot;return u||o(n.disabled)||o(n.readonly)||(Be=p(qe),Pe=Ut(T),O=null,k=null,St(Be),u=JSswift.overlay.open(({close:rt})=>{var Tt;const at=r==="range"||r==="range-multiple"?2:1,ht=Number((Tt=o(n.monthsToShow))!=null?Tt:at);return I=_.div({class:qt(["cms-date-panel",o(x),ye(ht>1,"multi-month"),n.panelClass])}),an(),I},{type:"date",anchorEl:dt._control||Ge,placement:n.placement||"bottom-start",offsetX:(y=n.offsetX)!=null?y:0,offsetY:(Je=(ue=n.offsetY)!=null?ue:n.offset)!=null?Je:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:n.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:qt(["cms-date-overlay",n.panelClass,ye(re(),"has-time")]),onClose:()=>{var rt;u=null,I=null,O=null,Rt(),(rt=n.onClose)==null||rt.call(n)}}),n.panelStyle&&Object.assign(u.panel.style,n.panelStyle),xs(u),Rt(),(ot=n.onOpen)==null||ot.call(n)),u}function un(){if(!u)return;k=null;const y=u;_s(y,()=>JSswift.overlay.close(y.id))}if(i){const y=r==="range"||r==="range-multiple"?2:1,ue=Number((ln=o(n.monthsToShow))!=null?ln:y);I=_.div({class:qt(["cms-date-panel","cms-date-calendar",o(x),ye(ue>1,"multi-month"),n.panelClass,n.class]),style:n.style})}return i||Ge.addEventListener("focus",y=>{var ue;(ue=n.onFocus)==null||ue.call(n,y),n.openOnFocus!==!1&&Dn()}),i||Ge.addEventListener("click",y=>{var ue;(ue=n.onClick)==null||ue.call(n,y),Dn()}),i||Ge.addEventListener("keydown",y=>{if(y.key==="Escape"){u&&(y.preventDefault(),un());return}(y.key==="ArrowDown"||y.key==="Enter"||y.key===" ")&&(y.preventDefault(),Dn()),(y.key==="Backspace"||y.key==="Delete")&&!o(n.manualInput)&&o(n.clearable)!==!1&&(y.preventDefault(),cn())}),!i&&o(n.manualInput)?(Ge.addEventListener("input",y=>{var ue;(ue=n.onTyping)==null||ue.call(n,Ge.value,y)}),Ge.addEventListener("change",y=>{const ue=Ve(Ge.value);Pt(ue,y,{timeValue:kn(Ge.value,Z()),preserveTime:!kn(Ge.value,Z())})}),Ge.addEventListener("blur",y=>{var Je;(Je=n.onBlur)==null||Je.call(n,y);const ue=Ve(Ge.value);Ge.value===""?cn():Pt(ue,y,{timeValue:kn(Ge.value,Z()),preserveTime:!kn(Ge.value,Z())})})):i||Ge.addEventListener("blur",y=>{var ue;return(ue=n.onBlur)==null?void 0:ue.call(n,y)}),F&&F.watch(y=>{const ue=Y(y),Je=ae(y);De(ue,Je)!==De(qe,T)&&(qe=ue,Be=p(qe),T=Ut(Je),Pe=Ut(Je),O=null,St(qe),Rt(),an())},i?"UI.Calendar:watch":"UI.Datepicker:watch"),JSswift.reactive.effect(()=>{!F&&n.value!=null?(qe=Y(o(n.value)),Be=p(qe),T=ae(o(n.value)),Pe=Ut(T)):re()&&n.timeValue!=null&&(T=ae(o(n.timeValue)),Pe=Ut(T)),Rt(),an(),u&&o(n.disabled)&&un()},i?"UI.Calendar:render":"UI.Datepicker:render"),i?(I._calendar=I,I._date=I,I._getValue=()=>Ee(qe,T),I._setValue=y=>Pt(y,null,{emit:!1,timeValue:ae(y)}),I._clear=cn,I._select=y=>{const ue=a(y);ue&&Qt(ue,null)},I._time=()=>Ut(T),I):(dt._input=Ge,dt._date=Ge,dt._open=Dn,dt._close=un,dt._getValue=()=>Ee(qe,T),dt._setValue=y=>Pt(y,null,{emit:!1,timeValue:ae(y)}),dt._time=()=>Ut(T),dt._panel=()=>(u==null?void 0:u.panel)||null,dt)};Ne.Datepicker=(...t)=>Xo(t),Ne.Calendar=(...t)=>Xo(t,{calendar:!0}),Ne.Date=Ne.Datepicker,JSswift.ui.Datepicker=Ne.Datepicker,JSswift.ui.Calendar=Ne.Calendar,JSswift.ui.Date=Ne.Date,Ne.Time=(...t)=>{var ie,a,C;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Ct(e.size,()=>{const g=String(o(e.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(g)?`cms-size-${g}`:""}),c=()=>{var M,Y,Q,ve,N;const g=Gn(kn(w?w.get():(M=o(e.value))!=null?M:F,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((Y=e.withSeconds)!=null?Y:e.showSeconds)||/:\d{2}:\d{2}$/.test(g),min:o((Q=e.min)!=null?Q:e.minTime),max:o((ve=e.max)!=null?ve:e.maxTime),use12h:o((N=e.use12h)!=null?N:e.ampm)}},x=()=>{var M;const g=Number(o((M=e.minuteStep)!=null?M:1));return Math.max(1,Math.min(30,Number.isFinite(g)?g:5))},d=()=>{var M;const g=Number(o((M=e.secondStep)!=null?M:1));return Math.max(1,Math.min(30,Number.isFinite(g)?g:5))},r=e.model||(vt(e.value)||yt(e.value)?e.value:null),w=Zt(r,"UI.Time:model"),F=w?w.get():o(e.value),S=g=>kn(g,c()),b=g=>mo(g,c()),P=g=>Gn(g,c()),re=g=>JSON.stringify(P(g));let Z=Ut(S(F)),he=Ut(Z),H=null,W=null;const se={...e,label:(ie=e.label)!=null?ie:e.placeholder},X=se.label!=null||JSswift.ui.getSlot(s,"label")!=null,fe=_.input({class:te(["cms-input","cms-time-display",i,ye(e.manualInput,"is-manual"),e.inputClass]),type:"text",autocomplete:"off",placeholder:X?"":(a=e.placeholder)!=null?a:"Seleziona orario",readOnly:!o(e.manualInput),disabled:!!o(e.disabled),value:b(Z)});fe.setAttribute("aria-haspopup","dialog");const _e=_.div({style:{display:"contents"}}),be=_.div({class:"cms-time-control",style:{display:"contents"}},fe,_e),me=Ne.FormField({...se,iconRight:(C=e.iconRight)!=null?C:"schedule",control:be,getValue:()=>fe.value,onClear:()=>{o(e.disabled)||o(e.readonly)||(le(null,null,{commit:!0}),H&&V())},onFocus:()=>fe.focus()}),de=()=>o(e.confirm)?he:Z,ce=()=>{_e.replaceChildren();const g=o(e.name);g&&_e.appendChild(_.input({type:"hidden",name:g,value:P(Z)}))},$=()=>{var g;fe.readOnly=!o(e.manualInput),fe.disabled=!!o(e.disabled),fe.setAttribute("aria-expanded",H?"true":"false"),fe.value=b(Z),ce(),(g=me._refresh)==null||g.call(me)},le=(g,M,Y={})=>{var f,A;const Q=Ut(S(g));if(o(e.confirm)&&Y.commit!==!0)return he=Ut(Q),h(),Q;const ve=re(Z);Z=Ut(Q),he=Ut(Q),$(),h(),w&&Y.fromModel!==!0&&w.set(P(Q));const N=re(Q);if(Y.emit!==!1&&N!==ve){const z=P(Q);(f=e.onInput)==null||f.call(e,z,M),(A=e.onChange)==null||A.call(e,z,M)}return Q},oe=g=>o(e.confirm)||e.closeOnSelect!==!0?!1:c().withSeconds?(g==null?void 0:g.part)==="second":(g==null?void 0:g.part)==="minute",Se=(g={})=>{Yo(W,g)},L=()=>{const g=ho(W);le(new Date,null,{commit:!o(e.confirm)}),Se({scrollState:g}),!o(e.confirm)&&e.closeOnSelect===!0&&V()},m=()=>{o(e.confirm)&&(le(he,null,{commit:!0}),e.closeOnSelect!==!1&&V())},h=()=>{var A,z,K,ke;if(!W)return;const g=de(),M=b(g),Y=_.div({class:"cms-time-header"}),Q=_.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")),ve=c().withSeconds;ve&&Q.appendChild(_.div({class:"cms-time-column-title"},o(e.secondsLabel)||"Sec")),Y.appendChild(Q);const N=qo({props:{min:o((A=e.min)!=null?A:e.minTime),max:o((z=e.max)!=null?z:e.maxTime),use12h:o((K=e.use12h)!=null?K:e.ampm),hoursLabel:o(e.hoursLabel)||"Ore",minutesLabel:o(e.minutesLabel)||"Min",secondsLabel:o(e.secondsLabel)||"Sec"},slots:s,value:g,withSeconds:ve,minuteStep:x(),secondStep:d(),disabled:!!o(e.disabled),readonly:!!o(e.readonly),pointIcon:o(e.pointIcon),shortcuts:o((ke=e.shortcuts)!=null?ke:e.presets),onSelect:(Me,Te)=>{const U=ho(W);le(Me,null),Se({scrollState:U}),oe(Te)&&V()}}),f=_.div({class:"cms-time-footer"},_.div({class:"cms-time-value"},...J(s,"value",{value:g,displayValue:M},M||J(s,"default",{},n))),_.div({class:"cms-time-actions"},_.button({type:"button",class:"cms-time-action",onClick:L},o(e.nowLabel)||"Ora"),o(e.clearable)!==!1?_.button({type:"button",class:"cms-time-action",onClick:()=>le(null,null,{commit:!o(e.confirm)})},o(e.clearLabel)||"Reset"):null,o(e.confirm)?_.button({type:"button",class:"cms-time-action is-primary",onClick:m},o(e.applyLabel)||"Applica"):null));W.replaceChildren(_.div({class:"cms-time-panel-root",onKeydown:Me=>{Me.key==="Escape"&&(Me.preventDefault(),V())}},Y,N,f))};function p(){var g,M,Y,Q;return H||o(e.disabled)||o(e.readonly)||(he=Ut(Z),H=JSswift.overlay.open(()=>(W=_.div({class:qt(["cms-time-panel",o(i),e.panelClass])}),h(),W),{type:"time",anchorEl:me._control||fe,placement:e.placement||"bottom-start",offsetX:(g=e.offsetX)!=null?g:0,offsetY:(Y=(M=e.offsetY)!=null?M:e.offset)!=null?Y:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:e.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:qt(["cms-time-overlay",e.panelClass]),onClose:()=>{var ve;H=null,W=null,$(),(ve=e.onClose)==null||ve.call(e)}}),e.panelStyle&&Object.assign(H.panel.style,e.panelStyle),xs(H),Se(),$(),(Q=e.onOpen)==null||Q.call(e)),H}function V(){if(!H)return;const g=H;_s(g,()=>JSswift.overlay.close(g.id))}return fe.addEventListener("focus",g=>{var M;(M=e.onFocus)==null||M.call(e,g),e.openOnFocus!==!1&&p()}),fe.addEventListener("click",g=>{var M;(M=e.onClick)==null||M.call(e,g),p()}),fe.addEventListener("keydown",g=>{if(g.key==="Escape"){H&&(g.preventDefault(),V());return}(g.key==="ArrowDown"||g.key==="Enter"||g.key===" ")&&(g.preventDefault(),p()),(g.key==="Backspace"||g.key==="Delete")&&!o(e.manualInput)&&o(e.clearable)!==!1&&(g.preventDefault(),le(null,g,{commit:!0}))}),o(e.manualInput)?(fe.addEventListener("input",g=>{var M;return(M=e.onTyping)==null?void 0:M.call(e,fe.value,g)}),fe.addEventListener("change",g=>le(fe.value,g)),fe.addEventListener("blur",g=>{var M;(M=e.onBlur)==null||M.call(e,g),fe.value===""?le(null,g):le(fe.value,g)})):fe.addEventListener("blur",g=>{var M;return(M=e.onBlur)==null?void 0:M.call(e,g)}),w&&w.watch(g=>{const M=Ut(S(g));re(M)!==re(Z)&&(Z=Ut(M),he=Ut(M),$(),h())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!w&&e.value!=null&&(Z=Ut(S(o(e.value))),he=Ut(Z)),$(),h(),H&&o(e.disabled)&&V()},"UI.Time:render"),me._input=fe,me._time=fe,me._open=p,me._close=V,me._getValue=()=>P(Z),me._setValue=g=>le(g,null,{emit:!1,commit:!0}),me._panel=()=>(H==null?void 0:H.panel)||null,me},Ne.Tabs=(...t)=>{var A,z,K,ke,Me,Te;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(U,j)=>!!U&&Object.prototype.hasOwnProperty.call(U,j),c=U=>String(o(U)||"horizontal").toLowerCase()==="vertical"?"vertical":"horizontal",x=U=>{const j=String(o(U)||"").toLowerCase();return j==="pills"||j==="pill"?"pills":j==="soft"||j==="card"?"soft":"line"},d=U=>{var ne;const j=o(U);return j==null||j===""?null:(ne=JSswift.uiColors)!=null&&ne.includes(j)?`var(--cms-${j})`:String(j)},r=(U,j)=>Object.is(U,j)||U!=null&&j!=null&&U==j,w=Zt(e.model,"UI.Tabs:model"),F=c(e.orientation||e.orient||e.direction),S=x(e.variant||(e.pills?"pills":e.soft?"soft":"line")),b=!!o((z=(A=e.fill)!=null?A:e.navFill)!=null?z:e.stretch),P=!!o(e.wrap),re=!!o(e.disabled),Z=e.id||"cms-tabs-"+Math.random().toString(36).slice(2,9),he=o((K=e.tabs)!=null?K:e.items)||[],H=(Array.isArray(he)?he:[he]).map((U,j)=>{var ae,$e,Ee,De,Ie,qe,Be,T,Pe,O,k,v,u,I;if(U==null)return null;if(typeof U!="object")return{raw:U,index:j,value:U,labelFallback:U,noteFallback:null,iconFallback:null,badgeFallback:null,disabled:!1,hidden:!1};const ne=(qe=(Ie=(De=(Ee=($e=(ae=U.value)!=null?ae:U.name)!=null?$e:U.id)!=null?Ee:U.key)!=null?De:U.label)!=null?Ie:U.title)!=null?qe:`tab-${j}`,Ve=(O=(Pe=(T=(Be=U.label)!=null?Be:U.title)!=null?T:U.name)!=null?Pe:U.value)!=null?O:`Tab ${j+1}`,He=i(U,"badge")?U.badge:i(U,"counter")?U.counter:null;return{...U,raw:U,index:j,value:ne,labelFallback:Ve,noteFallback:(u=(v=(k=U.note)!=null?k:U.subtitle)!=null?v:U.description)!=null?u:null,iconFallback:(I=U.icon)!=null?I:null,badgeFallback:He}}).filter(Boolean).filter(U=>U.hidden!==!0&&U.visible!==!1),W=H.find(U=>!U.disabled)||null,se=U=>H.findIndex(j=>r(j.value,U)),X=(U,j)=>{var Ve;if(!H.length)return-1;let ne=U;for(let He=0;He<H.length;He+=1)if(ne+=j,ne<0?ne=H.length-1:ne>=H.length&&(ne=0),!((Ve=H[ne])!=null&&Ve.disabled))return ne;return-1},fe=(U,j=!1)=>{var Ve,He;const ne=se(U);return ne>=0&&!((Ve=H[ne])!=null&&Ve.disabled)?H[ne].value:j?(He=W==null?void 0:W.value)!=null?He:null:U!=null?U:null},_e=fe(w?w.get():i(e,"value")?o(e.value):(ke=e.defaultValue)!=null?ke:e.default,!0),[be,me]=JSswift.reactive.signal(_e),de=te(["cms-clear-set","cms-tabs","cms-singularity",F,`variant-${S}`,ye(e.dense,"dense"),ye(b,"fill"),ye(P,"wrap"),ye(re,"disabled"),e.class]),ce=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"]);ce.class=de,ce.style={...e.style||{}},e.gap!=null&&(ce.style["--cms-tabs-gap"]=mt(e.gap)),e.tabGap!=null&&(ce.style["--cms-tabs-tab-gap"]=mt(e.tabGap));const $=d((Me=e.color)!=null?Me:e.state);$&&(ce.style["--cms-tabs-accent"]=$);const le=_.div(ce),oe=_.div({class:te(["cms-tabs-bar",e.barClass]),style:{alignItems:e.align||(F==="vertical"?"stretch":"center"),justifyContent:e.justify||"flex-start",...e.barStyle||{}}}),Se=_.div({class:te(["cms-tabs-nav",e.navClass]),style:e.navStyle||null,role:"tablist","aria-orientation":F}),L=[],m=()=>se(be()),h=()=>{const U=m();return U>=0?H[U]:null},p=()=>({tabs:H,value:be(),active:be(),activeIndex:m(),activeTab:h(),orientation:F,variant:S,select:(U,j)=>g(U,{event:j,emit:!0}),next:()=>Y(),prev:()=>Q()}),V=(U,j,ne)=>({...p(),tab:U,index:j,active:ne,disabled:!!U.disabled,select:Ve=>M(j,{event:Ve,emit:!0})}),ie=U=>{var ne;const j=(ne=L[U])==null?void 0:ne.btn;!j||typeof j.focus!="function"||requestAnimationFrame(()=>j.focus())},a=U=>{const j=se(U);le.dataset.value=U==null?"":String(U),le.dataset.activeIndex=j>=0?String(j):"",L.forEach(({btn:ne,item:Ve,tab:He,index:ae})=>{const $e=ae===j;Ve.classList.toggle("active",$e),Ve.classList.toggle("disabled",!!(He.disabled||re)),ne.classList.toggle("active",$e),ne.setAttribute("aria-selected",$e?"true":"false"),ne.setAttribute("tabindex",$e?"0":"-1")})},C=U=>{me(U),a(U)},g=(U,j={})=>{if(re)return null;const ne=se(U);return ne<0?null:M(ne,j)},M=(U,j={})=>{var $e,Ee;const ne=H[U];if(!ne||ne.disabled||re)return null;const Ve=ne.value,He=be(),ae=!r(He,Ve);return C(Ve),w&&!r(w.get(),Ve)&&w.set(Ve),j.focus&&ie(U),j.event&&(($e=ne.onClick)==null||$e.call(ne,Ve,j.event,ne,U)),ae&&j.emit!==!1&&((Ee=e.onChange)==null||Ee.call(e,Ve,ne,j.event||null,U)),ne},Y=()=>{const U=X(m()<0?-1:m(),1);U>=0&&M(U,{emit:!0,focus:!0})},Q=()=>{const U=m()<0?0:m(),j=X(U,-1);j>=0&&M(j,{emit:!0,focus:!0})},ve=(U,j)=>{var v,u,I,xe,Ue,et;const ne=j===m(),Ve=V(U,j,ne),He=`${Z}-tab-${j}`,ae=U.iconFallback!=null?typeof U.iconFallback=="string"?Ne.Icon({name:U.iconFallback,size:(I=(u=(v=U.iconSize)!=null?v:U.size)!=null?u:e.size)!=null?I:null}):U.iconFallback:null,$e=J(s,"icon",Ve,ae),Ee=J(null,"default",{},JSswift.ui.renderSlot(s,"label",Ve,U.labelFallback)),De=J(s,"note",Ve,U.noteFallback),Ie=J(s,"badge",Ve,U.badgeFallback),qe=_.span({class:"cms-tabs-tab-inner"},$e.length?_.span({class:"cms-tabs-tab-icon"},...$e):null,_.span({class:"cms-tabs-tab-copy"},_.span({class:"cms-tabs-tab-label"},...Ee.length?Ee:[""]),De.length?_.span({class:"cms-tabs-tab-note"},...De):null),Ie.length?_.span({class:"cms-tabs-tab-badge"},...Ie):null),Be=J(s,"tab",{...Ve,tabId:He,label:Ee,icon:$e,note:De,badge:Ie},qe),T=G=>{var dt;if(U.disabled||re)return;const Ge=G.key;if(Ge==="Enter"||Ge===" "){G.preventDefault(),M(j,{event:G,emit:!0});return}if(Ge==="Home"){G.preventDefault();const St=H.findIndex(It=>!It.disabled);St>=0&&M(St,{event:G,emit:!0,focus:!0});return}if(Ge==="End"){G.preventDefault();let St=-1;for(let It=H.length-1;It>=0;It-=1)if(!((dt=H[It])!=null&&dt.disabled)){St=It;break}St>=0&&M(St,{event:G,emit:!0,focus:!0});return}const lt=F==="vertical"?["ArrowUp"]:["ArrowLeft"],tt=F==="vertical"?["ArrowDown"]:["ArrowRight"];if(lt.includes(Ge)){G.preventDefault();const St=X(j,-1);St>=0&&M(St,{event:G,emit:!0,focus:!0});return}if(tt.includes(Ge)){G.preventDefault();const St=X(j,1);St>=0&&M(St,{event:G,emit:!0,focus:!0})}},Pe=d((xe=U.color)!=null?xe:U.state),O=_.div({class:te(["cms-tabs-item",ye(ne,"active"),ye(U.disabled||re,"disabled"),e.itemClass,U.itemClass]),style:{...Pe?{"--cms-tabs-item-accent":Pe}:{},...e.itemStyle||{},...U.itemStyle||{}},"data-name":String(U.value)}),k=Ne.Btn({class:te(["cms-tabs-tab",ye(ne,"active"),ye(U.disabled||re,"disabled"),e.tabClass,U.tabClass||U.class]),type:"button",id:He,role:"tab",disabled:!!(U.disabled||re),"aria-selected":ne?"true":"false",tabindex:ne?"0":"-1",size:(et=(Ue=U.size)!=null?Ue:e.size)!=null?et:null,style:{...e.tabStyle||{},...U.tabStyle||{}},onClick:G=>{M(j,{event:G,emit:!0})},onKeydown:T},...Be);return O.appendChild(k),O.appendChild(_.span({class:"tab-indicator"})),L[j]={tab:U,index:j,item:O,btn:k},O};if(H.length){const U=H.map((ne,Ve)=>ve(ne,Ve)),j=JSswift.ui.renderSlot(s,"nav",{...p(),nodes:U},U);J(null,"default",{},j).forEach(ne=>Se.appendChild(ne))}else J(s,"empty",p(),(Te=e.empty)!=null?Te:_.div({class:"cms-tabs-empty"},"Nessuna tab disponibile.")).forEach(U=>Se.appendChild(U));const N=p(),f=[...J(null,"default",{},JSswift.ui.renderSlot(s,"extra",N,null)),...J(s,"default",N,n)];return oe.appendChild(Se),f.length&&oe.appendChild(_.div({class:"cms-tabs-extra"},...f)),le.appendChild(oe),C(_e),w?w.watch(U=>{C(fe(U,!0))},"UI.Tabs:watch"):Ye(e.value)&&bt.reactive.effect(()=>{C(fe(o(e.value),!0))},"UI.Tabs:value"),le._getValue=()=>be(),le._setValue=U=>g(U,{emit:!0}),le._select=U=>g(U,{emit:!0}),le._next=()=>Y(),le._prev=()=>Q(),le._getTabs=()=>H.slice(),Nt(le,e),le},Ne.RouteTab=(...t)=>{var ie,a,C,g,M,Y,Q,ve,N,f,A,z,K,ke,Me;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.router||(bt==null?void 0:bt.router)||null,c=Te=>Object.prototype.hasOwnProperty.call(e,Te),x=c("active")||c("selected"),d=Te=>{const U=String(o(Te)||"").toLowerCase();return U==="pill"||U==="pills"?"pills":U==="soft"||U==="card"?"soft":"line"},r=Te=>{var j;const U=o(Te);return U==null||U===""?null:(j=JSswift.uiColors)!=null&&j.includes(U)?`var(--cms-${U})`:String(U)},w=Te=>{if(Te==null||Te==="")return"";try{return new URL(String(Te),window.location.origin).pathname||""}catch(U){return String(Te).split(/[?#]/)[0]||""}},F=Te=>o(e.external)===!0?!0:Te?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Te)):!1,S=()=>{var Te;return o((Te=e.href)!=null?Te:e.to)||"#"},b=()=>{var Te;return o((Te=e.to)!=null?Te:e.href)||""},P=()=>{try{if(i!=null&&i.current)return i.current().pathname||window.location.pathname||""}catch(Te){}return window.location.pathname||""},re=()=>{var ae,$e,Ee;const Te=b();if(!Te)return!1;const U=o(($e=(ae=e.match)!=null?ae:e.activeMatch)!=null?$e:e.routeMatch),j=String(o((Ee=e.matchMode)!=null?Ee:e.startsWith?"startsWith":e.exact?"exact":"")||"").toLowerCase(),ne=P();if(typeof U=="function")return!!U({currentPath:ne,to:Te,href:S(),router:i,props:e});if(U instanceof RegExp)return U.test(ne);const Ve=w(typeof U=="string"&&!["exact","startsWith","prefix","section"].includes(U.toLowerCase())?U:Te);if(!Ve)return!1;const He=j||(typeof U=="string"&&["startsWith","prefix","section"].includes(U.toLowerCase())?"startsWith":"exact");return He==="startswith"||He==="prefix"||He==="section"?ne===Ve||ne.startsWith(`${Ve}/`):i!=null&&i.isActive?!!i.isActive(Te):ne===Ve},Z=()=>!!o(e.disabled);let he=null;const H=()=>{var Te;return he!=null?!!he:x?!!o((Te=e.active)!=null?Te:e.selected):re()},W=d(e.variant||(e.pills?"pills":e.soft?"soft":"line")),se=!o(e.color)&&o(e.state)?Vt(o(e.state)):"",X=se?`cms-state-${se}`:"",fe=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"]);fe.href=S(),fe.class=te(["cms-route-tab","cms-clear-set","cms-singularity",`variant-${W}`,ye((ie=e.block)!=null?ie:e.fill,"block"),ye(e.dense,"dense"),X,e.class]),fe.style={...e.style||{}};const _e=r((a=e.color)!=null?a:e.state);_e&&(fe.style["--cms-route-tab-accent"]=_e);const be=(g=(C=e.iconSize)!=null?C:e.size)!=null?g:null,me=(Te,U)=>{const j=o(Te);return j==null||j===!1||j===""?null:typeof j=="string"?Ne.Icon({name:j,size:be}):JSswift.ui.slot(j,{as:U})},de=()=>({active:H(),disabled:Z(),href:S(),to:b(),external:F(S()),navigate:Te=>{var ne,Ve;if(Z())return!1;const U=b();return!F(S())&&U&&(i!=null&&i.navigate)?(Te!=null&&Te.preventDefault&&Te.preventDefault(),i.navigate(U),(ne=e.onNavigate)==null||ne.call(e,U,Te||null),!0):((Ve=e.onNavigate)==null||Ve.call(e,U||S(),Te||null),!1)}}),ce=J(s,"icon",de(),me(e.icon,"icon")),$=J(s,"label",de(),(Q=(Y=(M=e.label)!=null?M:e.title)!=null?Y:e.text)!=null?Q:n),le=J(s,"note",de(),(f=(N=(ve=e.note)!=null?ve:e.subtitle)!=null?N:e.caption)!=null?f:e.description),oe=J(s,"badge",de(),(z=(A=e.badge)!=null?A:e.counter)!=null?z:e.count),Se=J(s,"aside",de(),(ke=(K=e.aside)!=null?K:e.trailing)!=null?ke:me(e.iconRight,"iconRight")),L=J(s,"default",de(),(Me=e.content)!=null?Me:e.body),m=_.span({class:"cms-route-tab-inner"},ce.length?_.span({class:"cms-route-tab-icon"},...ce):null,_.span({class:"cms-route-tab-copy"},_.span({class:"cms-route-tab-label"},...$.length?$:[b()||S()||""]),le.length?_.span({class:"cms-route-tab-note"},...le):null,L.length?_.span({class:"cms-route-tab-extra"},...L):null),oe.length?_.span({class:"cms-route-tab-badge"},...oe):null,Se.length?_.span({class:"cms-route-tab-aside"},...Se):null),h=_.a(fe,m);Nt(h,e);const p=()=>{const Te=H(),U=Z(),j=S(),ne=F(j);h.classList.toggle("active",Te),h.classList.toggle("is-disabled",U),h.classList.toggle("is-external",ne),Te?h.setAttribute("aria-current",String(o(e.ariaCurrent)||"page")):h.removeAttribute("aria-current"),h.setAttribute("href",j||"#"),U?(h.setAttribute("aria-disabled","true"),h.tabIndex=-1):(h.removeAttribute("aria-disabled"),!c("tabIndex")&&!c("tabindex")&&h.removeAttribute("tabindex")),b()?h.dataset.to=String(b()):delete h.dataset.to,ne&&h.target==="_blank"&&!h.rel&&(h.rel="noopener noreferrer")},V=e.onClick;return h.onclick=Te=>{if(V==null||V(Te),!Te.defaultPrevented){if(Z()){Te.preventDefault();return}de().navigate(Te)}},!x&&b()&&(i!=null&&i.subscribe)&&i.subscribe(()=>p()),JSswift.reactive.effect(()=>{p()},"UI.RouteTab:render"),h._isActive=()=>H(),h._setActive=Te=>(he=Te==null?null:!!Te,p(),h),h._navigate=Te=>de().navigate(Te),h},Ne.Breadcrumbs=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.router||(bt==null?void 0:bt.router)||null,c=Zt(e.model,"UI.Breadcrumbs:model"),x=Ct(e.size,()=>{var le;const $=o(e.size);return typeof $=="string"&&((le=JSswift.uiSizes)!=null&&le.includes($))?`cms-size-${$}`:""}),d=Ct(e.variant,()=>{const $=String(o(e.variant||(e.pills?"pills":e.soft?"soft":"line"))||"").toLowerCase();return $==="pill"||$==="pills"?"variant-pills":$==="soft"||$==="card"?"variant-soft":"variant-line"}),r=Ct([e.wrap,e.nowrap],()=>o(e.wrap)===!1||o(e.nowrap)?"no-wrap":""),w=_.nav({class:te(["cms-breadcrumbs","cms-clear-set",x,d,r,ye(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),F=_.div({class:"cms-breadcrumbs-before"}),S=_.ol({class:"cms-breadcrumbs-list"}),b=_.div({class:"cms-breadcrumbs-after"});w.appendChild(F),w.appendChild(S),w.appendChild(b);const P=$=>{var oe;const le=o($);return le==null||le===""?null:(oe=JSswift.uiColors)!=null&&oe.includes(le)?`var(--cms-${le})`:String(le)},re=$=>{var oe;if(!$)return!1;if(o($.external)===!0)return!0;const le=o((oe=$.href)!=null?oe:$.to);return le?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(le)):!1},Z=$=>$!=null&&$.nodeType&&$.cloneNode?$.cloneNode(!0):$,he=($,le)=>{$.innerHTML="",le.forEach(oe=>$.appendChild(oe))},H=($,le,oe,Se,L=null)=>{const m=JSswift.ui.getSlot($,le)!=null?J($,le,oe,Se):[];return m.length?m:L&&JSswift.ui.getSlot($,L)!=null?J($,L,oe,Se):J(null,"default",oe,Se)},W=($,le,oe)=>{const Se=o($);return Se==null||Se===!1||Se===""?null:typeof Se=="string"?Ne.Icon({name:Se,size:le}):JSswift.ui.slot(Se,{as:oe})},se=()=>{var L,m;const $=c?c.get():o((m=(L=e.items)!=null?L:e.value)!=null?m:e.breadcrumbs),le=[],oe=h=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(oe);return}if(typeof h=="string"||typeof h=="number"){le.push({label:String(h)});return}if(h!=null&&h.nodeType||typeof h=="function"){le.push({label:h});return}le.push(h)}},Se=o(e.home);return Se&&oe(Se===!0?{label:"Home",to:"/",icon:"home"}:Se),oe($),!le.length&&(n!=null&&n.length)&&n.forEach(h=>oe(h)),le.filter(h=>!o(h==null?void 0:h.hidden))},X=$=>{const le=$.findIndex(oe=>{var Se,L;return!!o((L=(Se=oe==null?void 0:oe.current)!=null?Se:oe==null?void 0:oe.active)!=null?L:oe==null?void 0:oe.selected)});return le>-1?le:o(e.autoCurrent)===!1?-1:$.length?$.length-1:-1},fe=$=>{var p,V,ie,a,C,g,M;const le=Number(o((ie=(V=(p=e.max)!=null?p:e.maxItems)!=null?V:e.collapseAfter)!=null?ie:e.collapse)),oe=Number.isFinite(le)?Math.max(0,Math.trunc(le)):0;if(!oe||oe<3||$.length<=oe)return $.map((Y,Q)=>({type:"item",item:Y,index:Q,key:`item-${Q}`}));let Se=Number(o((C=(a=e.leadingCount)!=null?a:e.keepStart)!=null?C:1)),L=Number(o((M=(g=e.trailingCount)!=null?g:e.keepEnd)!=null?M:Math.max(1,oe-2)));if(Se=Number.isFinite(Se)?Math.max(1,Math.trunc(Se)):1,L=Number.isFinite(L)?Math.max(1,Math.trunc(L)):Math.max(1,oe-2),Se+L+1>oe&&(L=Math.max(1,oe-Se-1),Se+L+1>oe&&(Se=Math.max(1,oe-L-1))),Se+L>=$.length)return $.map((Y,Q)=>({type:"item",item:Y,index:Q,key:`item-${Q}`}));const m=[];for(let Y=0;Y<Se;Y++)m.push({type:"item",item:$[Y],index:Y,key:`item-${Y}`});const h=$.slice(Se,$.length-L);m.push({type:"collapsed",key:`collapsed-${Se}-${$.length-L}`,items:h,from:Se,to:$.length-L-1});for(let Y=$.length-L;Y<$.length;Y++)m.push({type:"item",item:$[Y],index:Y,key:`item-${Y}`});return m},_e=($,le=null)=>{var L,m,h,p,V;if(!$)return!1;const oe=o((L=$.href)!=null?L:$.to)||"",Se=o($.to)||"";return!re($)&&Se&&(i!=null&&i.navigate)?(le!=null&&le.preventDefault&&le.preventDefault(),i.navigate(Se),(m=$.onNavigate)==null||m.call($,Se,le||null),(h=e.onNavigate)==null||h.call(e,Se,$,le||null),!0):((p=$.onNavigate)==null||p.call($,Se||oe,le||null),(V=e.onNavigate)==null||V.call(e,Se||oe,$,le||null),!1)},be=($,le,oe)=>{var V,ie,a;const Se=$,L=oe[le+1]||null,m={index:le,entry:$,previous:Se,next:L},h=Z(o((a=(ie=($==null?void 0:$.type)==="item"?(V=$.item)==null?void 0:V.separator:null)!=null?ie:e.separator)!=null?a:"/")),p=H(s,"separator",m,h);return _.li({class:"cms-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"cms-breadcrumbs-separator"},...p))},me=($,le,oe)=>{const Se={type:"collapsed",collapsed:!0,items:le,hiddenItems:$.items,currentIndex:oe,from:$.from,to:$.to},L=_.span({class:"cms-breadcrumb cms-breadcrumb-collapsed"},_.span({class:"cms-breadcrumb-inner"},_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},String(o(e.collapsedLabel)||"\u2026"))))),m=H(s,"collapsed",Se,L,"item");return _.li({class:"cms-breadcrumbs-entry is-collapsed"},...m)},de=($,le,oe,Se)=>{var ae,$e,Ee,De,Ie,qe,Be,T,Pe,O,k,v,u,I,xe,Ue,et,G,Ge,lt,tt,dt,St,It,Rt,Pt;const L=$.item||{},m=L.slots?{...s,...L.slots}:s,h=o((ae=L.href)!=null?ae:L.to)||"",p=!!o(L.disabled),V=$.index===oe,ie=(De=(Ee=($e=L.iconSize)!=null?$e:e.itemSize)!=null?Ee:e.size)!=null?De:null,a=P((Be=(qe=(Ie=L.color)!=null?Ie:L.state)!=null?qe:e.color)!=null?Be:e.state),C=!o(L.color)&&o(L.state)?Vt(o(L.state)):"",g=(v=(k=(O=(Pe=(T=L.label)!=null?T:L.title)!=null?Pe:L.text)!=null?O:L.to)!=null?k:L.href)!=null?v:"",M=(xe=(I=(u=L.note)!=null?u:L.subtitle)!=null?I:L.caption)!=null?xe:L.description,Y=(et=(Ue=L.badge)!=null?Ue:L.counter)!=null?et:L.count,Q=(Ge=(G=L.aside)!=null?G:L.trailing)!=null?Ge:W(L.iconRight,ie,"iconRight"),ve=(lt=L.content)!=null?lt:L.body,N={item:L,index:$.index,visibleIndex:Se,total:le.length,current:V,active:V,disabled:p,href:h,to:o(L.to)||"",external:re(L),isFirst:$.index===0,isLast:$.index===le.length-1,navigate:st=>_e(L,st)},f=H(m,"icon",N,W(L.icon,ie,"icon")),A=H(m,"label",N,g),z=H(m,"note",N,M),K=H(m,"badge",N,Y),ke=H(m,"aside",N,Q),Me=H(m,"default",N,ve),Te=_.span({class:"cms-breadcrumb-inner"},f.length?_.span({class:"cms-breadcrumb-icon"},...f):null,_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},...A.length?A:[h||""]),z.length?_.span({class:"cms-breadcrumb-note"},...z):null,Me.length?_.span({class:"cms-breadcrumb-extra"},...Me):null),K.length?_.span({class:"cms-breadcrumb-badge"},...K):null,ke.length?_.span({class:"cms-breadcrumb-aside"},...ke):null),U=!p&&(!V||!!o((tt=L.linkCurrent)!=null?tt:e.linkCurrent)),j={class:te(["cms-breadcrumb","cms-clear-set","cms-singularity",ye(V,"is-current"),ye(V,"active"),ye(p,"is-disabled"),C?`cms-state-${C}`:"",L.class]),style:{...L.style||{}},"aria-current":V?String(o((dt=L.ariaCurrent)!=null?dt:e.ariaCurrent)||"page"):null};a&&(j.style["--cms-breadcrumb-accent"]=a);let ne=null;U&&h?(ne=_.a({...j,href:h,target:L.target,rel:L.rel,onClick:st=>{var wt,Ft;(wt=L.onClick)==null||wt.call(L,st,N),(Ft=e.onItemClick)==null||Ft.call(e,L,N,st),!st.defaultPrevented&&N.navigate(st)}},Te),N.external&&ne.target==="_blank"&&!ne.rel&&(ne.rel="noopener noreferrer")):U&&typeof L.onClick=="function"?ne=_.button({...j,type:L.type||"button",onClick:st=>{var wt,Ft;(wt=L.onClick)==null||wt.call(L,st,N),(Ft=e.onItemClick)==null||Ft.call(e,L,N,st)}},Te):ne=_.span({...j,"aria-disabled":p?"true":null},Te),Nt(ne,{size:(It=(St=L.size)!=null?St:e.itemSize)!=null?It:e.size,radius:(Rt=L.radius)!=null?Rt:e.radius,gradient:(Pt=L.gradient)!=null?Pt:e.gradient});const He=H(m,"item",N,ne);return _.li({class:te(["cms-breadcrumbs-entry",ye(V,"is-current"),ye(p,"is-disabled")])},...He)},ce=()=>{var m;const $=se(),le=X($),oe=fe($),Se=P((m=e.color)!=null?m:e.state);w.classList.toggle("is-empty",$.length===0),Se?w.style.setProperty("--cms-breadcrumb-accent",Se):w.style.removeProperty("--cms-breadcrumb-accent");const L={items:$,visibleItems:oe,currentIndex:le,count:$.length,collapsed:oe.some(h=>h.type==="collapsed")};if(he(F,H(s,"before",L,e.before)),he(b,H(s,"after",L,e.after)),S.innerHTML="",!$.length){const h=H(s,"empty",L,e.empty);h.length&&S.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...h));return}oe.forEach((h,p)=>{p>0&&S.appendChild(be(oe[p-1],p-1,oe)),S.appendChild(h.type==="collapsed"?me(h,$,le):de(h,$,le,p))})};return bt.reactive.effect(()=>{ce()},"UI.Breadcrumbs:render"),w.getItems=()=>se(),w.getVisibleItems=()=>fe(se()),w.refresh=()=>(ce(),w),w.setItems=$=>(c?c.set($):e.items=$,ce(),w),Nt(w,e),w},Ne.Pagination=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=e.slots||{},s=Zt(e.model,"UI.Pagination:model"),i=Ct(e.size,()=>{const a=o(e.size);return typeof a=="string"&&as[a]?`cms-size-${a}`:""}),c=_.nav({class:te(["cms-pagination","cms-clear-set",i,ye(e.dense,"dense"),ye(e.simple,"is-simple"),ye(e.disabled,"is-disabled"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Pagination"}),x=_.div({class:"cms-pagination-controls"}),d=_.div({class:"cms-pagination-start"}),r=_.div({class:"cms-pagination-pages"}),w=_.div({class:"cms-pagination-end"}),F=_.div({class:"cms-pagination-summary"});x.appendChild(d),x.appendChild(r),x.appendChild(w),c.appendChild(x),c.appendChild(F);let S=1,b=1;const P=(a,C=0)=>{const g=o(a);if(g==null||g==="")return C;const M=Number(g);return Number.isFinite(M)?Math.trunc(M):C},re=(a,C=Z())=>{const g=Number(a),M=Number.isFinite(g)?Math.trunc(g):1;return Math.min(Math.max(M||1,1),Math.max(1,C||1))},Z=()=>{var M,Y,Q,ve,N,f,A;const a=P((Q=(Y=(M=e.max)!=null?M:e.pages)!=null?Y:e.pageCount)!=null?Q:e.totalPages,0);if(a>0)return a;const C=P((N=(ve=e.total)!=null?ve:e.totalItems)!=null?N:e.count,0),g=P((A=(f=e.pageSize)!=null?f:e.perPage)!=null?A:e.limit,0);return C>=0&&g>0?Math.max(1,Math.ceil(C/g)):1},he=()=>{var a,C,g;return P(s?s.get():(g=(C=(a=e.page)!=null?a:e.value)!=null?C:e.current)!=null?g:e.currentPage,1)},H=()=>{var a,C;return Math.max(0,P((C=(a=e.siblings)!=null?a:e.siblingCount)!=null?C:e.window,1))},W=()=>{var a,C;return Math.max(0,P((C=(a=e.boundaryCount)!=null?a:e.boundaries)!=null?C:e.edges,1))},se=()=>!!o(e.disabled),X=()=>{var a;return o((a=e.showSummary)!=null?a:e.showLabel)!==!1},fe=()=>o(e.showPages)!==!1&&!o(e.simple),_e=()=>o(e.showPrev)!==!1,be=()=>o(e.showNext)!==!1,me=()=>!!o(e.showEdges),de=()=>{const a=o(e.showFirst);return a==null?me():!!a},ce=()=>{const a=o(e.showLast);return a==null?me():!!a},$=()=>!!o(e.hideOnSinglePage),le=()=>{var g,M;const a=o((M=(g=e.total)!=null?g:e.totalItems)!=null?M:e.count);if(a==null||a==="")return null;const C=Number(a);return Number.isFinite(C)?Math.max(0,Math.trunc(C)):null},oe=()=>{var g,M;const a=o((M=(g=e.pageSize)!=null?g:e.perPage)!=null?M:e.limit);if(a==null||a==="")return null;const C=Number(a);return Number.isFinite(C)&&C>0?Math.trunc(C):null},Se=(a=S,C=b)=>{const g=le(),M=oe(),Y=g!=null&&M?g===0?0:(a-1)*M+1:null,Q=g!=null&&M?Math.min(g,a*M):null;return{page:a,value:a,current:a,currentPage:a,pages:C,max:C,total:g,pageSize:M,from:Y,to:Q,disabled:se(),isFirst:a<=1,isLast:a>=C,canPrev:a>1,canNext:a<C,setPage:(ve,N)=>ie(ve,N),prev:ve=>ie(a-1,ve),next:ve=>ie(a+1,ve),first:ve=>ie(1,ve),last:ve=>ie(C,ve)}},L=(a,C)=>{if(C<=0)return[];const g=[],M=new Set,Y=W(),Q=H();for(let N=1;N<=Math.min(Y,C);N++)M.add(N);for(let N=Math.max(1,a-Q);N<=Math.min(C,a+Q);N++)M.add(N);for(let N=Math.max(1,C-Y+1);N<=C;N++)M.add(N);let ve=0;for(let N=1;N<=C;N++)M.has(N)&&(ve&&N-ve>1&&g.push({type:"ellipsis",key:`ellipsis-${ve}-${N}`}),g.push({type:"page",page:N,key:`page-${N}`}),ve=N);return g.length||g.push({type:"page",page:1,key:"page-1"}),g},m=(a,C,g,M=null)=>{const Y=JSswift.ui.getSlot(n,a)!=null?J(n,a,g,C):[];return Y.length?Y:M&&JSswift.ui.getSlot(n,M)!=null?J(n,M,g,C):J(null,"default",g,C)},h=(a,C)=>{a.innerHTML="",C.forEach(g=>a.appendChild(g))},p=(a,C,g,M={})=>{var Q;const Y={...Se(),kind:a,active:!!M.active};return Ne.Btn({class:te(["cms-pagination-btn",`cms-pagination-${a}`,ye(M.active,"active"),M.class]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:M.active?e.color||e.state||"primary":M.color||null,outline:M.active?!1:(Q=M.outline)!=null?Q:!0,disabled:se()||!!M.disabled,"aria-current":M.active?"page":null,onClick:ve=>{se()||M.disabled||g==null||g(ve)}},...m(a,C,Y,a==="summary"?"label":a==="page"?"item":null))},V=(a,C)=>{S=re(a,C),b=Math.max(1,C||1);const g=Se(S,b);c.style.display=$()&&b<=1?"none":"",F.style.display=X()?"":"none",r.style.display=fe()?"":"none",d.innerHTML="",r.innerHTML="",w.innerHTML="";const M=m("start",e.start,g);M.length&&d.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-start"},...M)),de()&&d.appendChild(p("first","\xAB",ve=>ie(1,ve),{disabled:S<=1})),_e()&&d.appendChild(p("prev","Prev",ve=>ie(S-1,ve),{disabled:S<=1})),fe()&&L(S,b).forEach(ve=>{if(ve.type==="ellipsis"){const A={...g,kind:"ellipsis"},z=m("ellipsis","\u2026",A);r.appendChild(_.span({class:"cms-pagination-ellipsis","aria-hidden":"true"},...z));return}const N=ve.page,f={...g,page:N,value:N,item:ve,active:N===S};r.appendChild(Ne.Btn({class:te(["cms-pagination-btn","cms-pagination-page-btn",ye(N===S,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:N===S?e.color||e.state||"primary":null,outline:N!==S,disabled:se(),"aria-current":N===S?"page":null,onClick:A=>ie(N,A)},...m("page",String(N),f,"item")))}),be()&&w.appendChild(p("next","Next",ve=>ie(S+1,ve),{disabled:S>=b})),ce()&&w.appendChild(p("last","\xBB",ve=>ie(b,ve),{disabled:S>=b}));const Y=m("end",e.end,g);Y.length&&w.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...Y));let Q=`Pagina ${S} di ${b}`;g.total!=null&&g.pageSize&&(Q=g.total===0?"0 risultati":`${g.from}-${g.to} di ${g.total}`),h(F,m("summary",Q,g,"label"))},ie=(a,C=null)=>{var Y,Q;const g=Z(),M=re(a,g);return M===S&&g===b||(V(M,g),s&&s.get()!==M&&s.set(M),(Y=e.onChange)==null||Y.call(e,M,Se(M,g),C),(Q=e.onPageChange)==null||Q.call(e,M,Se(M,g),C)),M};return bt.reactive.effect(()=>{const a=Z(),C=he(),g=re(C,a);V(g,a),s&&C!==g&&s.set(g)},"UI.Pagination:sync"),c.getPage=()=>S,c.getPages=()=>b,c.setPage=a=>ie(a),c.prev=()=>ie(S-1),c.next=()=>ie(S+1),c.first=()=>ie(1),c.last=()=>ie(b),Nt(c,e),c},Ne.Spinner=(...t)=>{var se;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(X,fe,_e)=>{if(Ye(X))return()=>{const me=o(X);if(me==null||me===!1||me==="")return _e;const de=fe?fe(me):me;return de==null||de===""?_e:de};if(X==null||X===!1||X==="")return _e;const be=fe?fe(X):X;return be==null||be===""?_e:be},c=X=>{if(X==null||X===!1||X===""||Vt(X))return"";const _e=String(X).trim();return _e?_e.startsWith("#")||_e.startsWith("rgb(")||_e.startsWith("rgba(")||_e.startsWith("hsl(")||_e.startsWith("hsla(")||_e.startsWith("var(")?_e:In(_e)?`var(--cms-${_e})`:_e:""},x=Ct(e.state,()=>{const X=Vt(o(e.state));return X?`cms-state-${X}`:""}),d=te(["cms-spinner",x,ye(e.vertical,"vertical"),ye(e.reverse,"reverse"),ye(e.center,"center"),ye(e.block,"block"),ye(e.pause||e.paused,"paused"),e.class]),r=JSswift.omit(e,["ariaLabel","block","center","color","indicatorClass","indicatorStyle","label","note","pause","paused","reverse","size","slots","speed","state","thickness","trackColor","vertical"]);r.class=d;const w={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(w,"backgroundColor")&&delete w.backgroundColor,r.style=w,r.role==null&&(r.role="status"),r["aria-live"]==null&&(r["aria-live"]="polite"),r["aria-busy"]==null&&(r["aria-busy"]="true");const F={props:e},S=J(s,"label",F,e.label),b=J(s,"default",F,n),P=J(s,"note",F,e.note),re=S.length||b.length||P.length;if(!re){const X=o((se=e.ariaLabel)!=null?se:e["aria-label"]);X?r["aria-label"]=X:r["aria-label"]==null&&(r["aria-label"]="Loading")}const Z=_.span({class:te(["cms-spinner-indicator",e.indicatorClass]),style:{"--cms-spinner-size":i(e.size,mt,"18px"),"--cms-spinner-thickness":i(e.thickness,mt,"2px"),"--cms-spinner-speed":i(e.speed,X=>typeof X=="number"?`${X}ms`:String(X),"900ms"),"--cms-spinner-color":i(e.color,c,"var(--set-border-color, var(--cms-primary))"),"--cms-spinner-track":i(e.trackColor,c,"color-mix(in srgb, var(--cms-spinner-color) 18%, transparent)"),...e.indicatorStyle||{}},"aria-hidden":"true"}),he=J(s,"indicator",F,Z),H=[];he.length&&H.push(...he),re&&H.push(_.div({class:"cms-spinner-content"},S.length?_.div({class:"cms-spinner-label"},...S):null,b.length?_.div({class:"cms-spinner-copy"},...b):null,P.length?_.div({class:"cms-spinner-note"},...P):null));const W=_.div(r,...H);return Nt(W,e),W},Ne.Progress=(...t)=>{var z,K,ke,Me,Te,U,j,ne,Ve,He;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(vt(e.value)||yt(e.value)?e.value:null),c=Zt(i,"UI.Progress:model"),x=Ct([e.state,e.color],()=>{const ae=Vt(o(e.state)||o(e.color));return ae?`cms-state-${ae}`:""}),d=(ae,$e)=>{const Ee=Number(ae);return Number.isFinite(Ee)?Ee:$e},r=()=>d(o(e.min),0),w=()=>{const ae=r(),$e=d(o(e.max),100);return $e<ae?ae:$e},F=()=>{var $e,Ee;const ae=o((Ee=($e=e.height)!=null?$e:e.thickness)!=null?Ee:e.size);return ae==null||ae===""?"8px":typeof ae=="number"?`${ae}px`:typeof ae=="string"?{xxs:"4px",xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px",xxl:"16px",xxxl:"18px"}[ae]||ae:"8px"},S=(ae,$e="")=>{const Ee=o(ae);if(Ee==null||Ee===!1||Ee==="")return $e;const De=Vt(Ee);return De?`var(--cms-${De})`:typeof Ee=="string"&&In(Ee)?`var(--cms-${Ee})`:String(Ee)},b=ae=>{const $e=r(),Ee=w(),De=d(ae,$e);return Math.min(Ee,Math.max($e,De))},P=ae=>{const $e=r(),De=w()-$e;if(!De)return 0;const Ie=(b(ae)-$e)/De,qe=o(e.reverse)?1-Ie:Ie;return Math.max(0,Math.min(1,qe))},re=ae=>{const $e=b(ae);return $e<fe()?fe():$e},Z=(ae,$e,Ee)=>{const De=e.formatValue;if(typeof De=="function"){const Ie=De(ae,$e,Ee);if(Ie!=null)return Ie}return`${Math.round($e)}%`},he=ae=>{for(;ae.firstChild;)ae.removeChild(ae.firstChild)},H=(ae,$e,Ee="flex")=>{he(ae),($e||[]).forEach(De=>{if(!(De==null||De===!1)){if(De instanceof Node){ae.appendChild(De);return}ae.appendChild(document.createTextNode(String(De)))}}),ae.style.display=ae.childNodes.length?Ee:"none"},W=(ae,$e={})=>rn(o(ae),$e),se=(ae,$e,Ee={})=>{var Ie;const De=o(ae);return De==null||De===!1||De===""?[]:typeof De=="string"?[Ne.Icon({name:De,size:(Ie=e.iconSize)!=null?Ie:16})]:W(De,{...Ee,as:$e})},X=ae=>yt(ae)||vt(ae)?o(ae):typeof ae=="function"&&ae.length===0?ae():ae,[fe,_e]=JSswift.reactive.signal(b(c?c.get():(K=(z=o(e.value))!=null?z:o(e.min))!=null?K:0)),[be,me]=JSswift.reactive.signal(re((Te=o(e.buffer))!=null?Te:c?c.get():(Me=(ke=o(e.value))!=null?ke:o(e.min))!=null?Me:0)),de=(ae,$e={})=>{const Ee=b(ae);return fe()!==Ee&&_e(Ee),be()<Ee&&me(Ee),c&&$e.fromModel!==!0&&c.set(Ee),Ee},ce=ae=>{const $e=re(ae);return be()!==$e&&me($e),$e},$=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"]),le={width:o(e.width)||"100%",...e.style||{}},oe=o(e.color);(oe!=null||Ye(e.color))&&!Vt(oe||"")&&delete le.backgroundColor,$.class=te(["cms-progress-wrap",ye(e.dense,"dense"),ye(e.reverse,"is-reverse"),ye(e.indeterminate,"is-indeterminate"),x,e.class]),$.style=le;const Se=_.div({class:"cms-progress-header"}),L=_.div({class:"cms-progress-heading"}),m=_.div({class:"cms-progress-label"}),h=_.div({class:"cms-progress-note"}),p=_.div({class:"cms-progress-value"});L.append(m,h),Se.append(L,p);const V=_.div({class:"cms-progress-body"}),ie=_.span({class:"cms-progress-edge-label cms-progress-edge-label-left"}),a=_.div({class:"cms-progress",role:"progressbar"}),C=_.span({class:"cms-progress-buffer"}),g=_.span({class:te(["cms-progress-bar","cms-singularity",x,ye(e.outline,"cms-outline"),ye(e.flat,"cms-flat"),ye(e.border,"cms-border"),ye(e.glossy,"cms-glossy"),ye(e.glow,"cms-glow"),ye(e.glass,"cms-glass"),ye(e.shadow,"cms-shadow"),Ct(e.shadow,()=>{const ae=ys(o(e.shadow));return ae?`cms-shadow-${ae}`:""}),ye(e.gradient,"cms-gradient"),ye(e.textGradient,"cms-text-gradient"),ye(e.lightShadow,"cms-light-shadow"),ye(e.striped,"is-striped"),ye(e.animated||e.indeterminate,"is-animated")])}),M=_.span({class:"cms-progress-bar-label"});g.appendChild(M),a.append(C,g);const Y=_.span({class:"cms-progress-edge-label cms-progress-edge-label-right"});V.append(ie,a,Y);const Q=_.div($,Se,V);Nt(g,e);const ve=()=>{const ae=fe(),$e=P(ae)*100,Ee={value:ae,percent:$e,min:r(),max:w(),buffer:be(),progress:Q,track:a,bar:g,props:e},De=J(s,"icon",Ee,null),Ie=De.length?[]:se(e.icon,"icon",Ee),qe=J(s,"label",Ee,X(e.label)),Be=qe.length?qe:J(s,"default",Ee,n),T=J(s,"iconRight",Ee,null),Pe=T.length?[]:se(e.iconRight,"iconRight",Ee),O=J(s,"note",Ee,X(e.note)),k=e.valueLabel!=null?X(e.valueLabel):Z(ae,$e,Ee),v=o(e.showValue),u=v===!0||e.valueLabel!=null||JSswift.ui.getSlot(s,"value")!=null?J(s,"value",Ee,k):[];H(m,[...Ie,...De,...Be,...Pe,...T],"inline-flex"),H(h,O,"block"),H(p,v==="inside"?[]:u,"inline-flex"),Se.style.display=m.childNodes.length||h.childNodes.length||p.childNodes.length?"flex":"none"},N=()=>{var qe,Be;const ae=fe(),$e=P(ae)*100,Ee={value:ae,percent:$e,min:r(),max:w(),buffer:be(),progress:Q,track:a,bar:g,props:e},De=X((qe=e.startLabel)!=null?qe:e.leftLabel),Ie=X((Be=e.endLabel)!=null?Be:e.rightLabel);H(ie,J(s,"startLabel",Ee,De),"inline-flex"),H(Y,J(s,"endLabel",Ee,Ie),"inline-flex")},f=()=>{const ae=fe(),$e=P(ae)*100,Ee={value:ae,percent:$e,min:r(),max:w(),buffer:be(),progress:Q,track:a,bar:g,props:e},De=o(e.showValue),Ie=e.insideLabel!=null?X(e.insideLabel):Z(ae,$e,Ee),qe=De==="inside"||e.insideLabel!=null||JSswift.ui.getSlot(s,"inside")!=null?J(s,"inside",Ee,Ie):[];H(M,qe,"inline-flex")},A=()=>{const ae=fe(),$e=be(),Ee=r(),De=w(),Ie=P(ae)*100,qe=P($e)*100,Be=S(e.color,""),T=S(e.trackColor,Be?`color-mix(in srgb, ${Be} 14%, transparent)`:"rgba(255,255,255,0.08)"),Pe=S(e.bufferColor,Be?`color-mix(in srgb, ${Be} 30%, transparent)`:"rgba(255,255,255,0.16)"),O=o(e.ariaLabel),k=o(e.ariaValueText),v=!!o(e.indeterminate),u=o(e.radius);Q.style.width=o(e.width)||"100%",Q.style.setProperty("--cms-progress-height",F()),u!=null?typeof u=="number"?Q.style.setProperty("--cms-progress-radius",`${u}px`):typeof u=="string"&&JSswift.uiSizes.includes(u)?Q.style.setProperty("--cms-progress-radius",`var(--cms-r-${u})`):Q.style.setProperty("--cms-progress-radius",String(u)):Q.style.removeProperty("--cms-progress-radius"),a.style.background=T,C.style.background=Pe,C.style.width=`${qe}%`,Be&&!Vt(o(e.state)||o(e.color))?(g.style.setProperty("--set-background-color",Be),g.style.setProperty("--set-border-color",Be),g.style.setProperty("--set-color",o(e.textColor)||"var(--cms-on-primary, #fff)")):Vt(o(e.state)||o(e.color))?(g.style.removeProperty("--set-background-color"),g.style.removeProperty("--set-border-color"),g.style.removeProperty("--set-color")):(g.style.setProperty("--set-background-color","var(--cms-primary)"),g.style.setProperty("--set-border-color","var(--cms-primary)"),g.style.setProperty("--set-color",o(e.textColor)||"var(--cms-on-primary, #fff)")),v?(g.style.width="",a.removeAttribute("aria-valuenow"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuemax")):(g.style.width=`${Ie}%`,a.setAttribute("aria-valuemin",String(Ee)),a.setAttribute("aria-valuemax",String(De)),a.setAttribute("aria-valuenow",String(ae))),O!=null?a.setAttribute("aria-label",String(O)):typeof o(e.label)=="string"?a.setAttribute("aria-label",String(o(e.label))):a.removeAttribute("aria-label"),k!=null?a.setAttribute("aria-valuetext",String(k)):v?a.removeAttribute("aria-valuetext"):a.setAttribute("aria-valuetext",Z(ae,Ie,{value:ae,percent:Ie,min:Ee,max:De,buffer:$e,progress:Q,track:a,bar:g,props:e})),Q.classList.toggle("has-start-label",ie.childNodes.length>0),Q.classList.toggle("has-end-label",Y.childNodes.length>0),Q.classList.toggle("has-inside-label",M.childNodes.length>0)};return c?(de(c.get(),{fromModel:!0}),c.watch(ae=>{de(ae,{fromModel:!0})},"UI.Progress:watch")):Ye(e.value)?JSswift.reactive.effect(()=>{de(o(e.value),{fromModel:!0})},"UI.Progress:value"):de((j=(U=e.value)!=null?U:e.min)!=null?j:0,{fromModel:!0}),Ye(e.buffer)?JSswift.reactive.effect(()=>{ce(o(e.buffer))},"UI.Progress:buffer"):ce((He=(Ve=(ne=e.buffer)!=null?ne:e.value)!=null?Ve:e.min)!=null?He:0),JSswift.reactive.effect(()=>{ve(),N(),f(),A()},"UI.Progress:render"),Q._track=a,Q._bar=g,Q._buffer=C,Q._getValue=fe,Q._getBuffer=be,Q._setValue=ae=>de(ae),Q._setBuffer=ae=>ce(ae),Q},Ne.LoadingBar=function(...e){var f,A;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),i=(z,K)=>{const ke=Number(z);return Number.isFinite(ke)?ke:K},c=()=>i(o(n.min),0),x=()=>{const z=c(),K=i(o(n.max),100);return K<z?z:K},d=z=>{const K=c(),ke=x(),Me=i(z,K);return Math.min(ke,Math.max(K,Me))},r=(z,K="")=>z==null||z===!1||z===""?K:typeof z=="number"?`${z}px`:String(z),w=z=>{const K=o(z);return!K||K===document?document.body:typeof K=="string"?document.querySelector(K)||document.body:K&&K.body instanceof HTMLElement?K.body:K instanceof HTMLElement?K:document.body},F=n.model||(vt(n.value)||yt(n.value)?n.value:null),S=Zt(F,"UI.LoadingBar:model"),b=vt(n.buffer)||yt(n.buffer)?n.buffer:null,P=Zt(b,"UI.LoadingBar:buffer"),re=S?S.get():(f=o(n.value))!=null?f:c(),Z=P?P.get():(A=o(n.buffer))!=null?A:re,[he,H]=JSswift.reactive.signal(d(re)),[W,se]=JSswift.reactive.signal(Math.max(d(Z),d(re))),[X,fe]=JSswift.reactive.signal(n.visible!=null?!!o(n.visible):d(re)>c()||!!o(n.indeterminate));let _e=null,be=null;const me=()=>{_e&&(clearInterval(_e),_e=null)},de=()=>{be&&(clearTimeout(be),be=null)},ce=(z,K={})=>{const ke=!!z;return X()!==ke&&fe(ke),K.fromExternal!==!0&&typeof n.onVisibleChange=="function"&&n.onVisibleChange(ke),ke},$=(z,K={})=>{const ke=d(z);return he()!==ke&&H(ke),W()<ke&&(se(ke),P&&K.fromExternal!==!0&&P.set(ke)),S&&K.fromExternal!==!0&&S.set(ke),ke},le=(z,K={})=>{const ke=Math.max($(he(),{fromExternal:!0}),d(z));return W()!==ke&&se(ke),P&&K.fromExternal!==!0&&P.set(ke),ke},oe=(z=he())=>{n.visible==null&&(o(n.indeterminate)||z>c()?ce(!0):o(n.hideOnZero)!==!1&&ce(!1))},Se=()=>{if(me(),o(n.trickle)===!1||o(n.indeterminate))return;const z=i(o(n.trickleInterval),280);z<=0||(_e=setInterval(()=>{var Te,U;const K=he(),ke=d((U=(Te=o(n.trickleTo))!=null?Te:o(n.trickleMax))!=null?U:92);if(K>=ke)return;const Me=i(o(n.trickleStep),K<45?12:K<75?7:3);$(Math.min(ke,K+Me))},z))},L=JSswift.omit(n,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor","target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);L.class=te(["cms-loading-bar",n.class]),L.style={...n.style||{}};const m=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"]);m.class=te(["cms-loading-bar-progress",n.progressClass,m.class]),m.style={...n.progressStyle||{}},m.value=[he,H],m.buffer=[W,se],m.dense==null&&(m.dense=!0),m.height==null&&m.thickness==null&&m.size==null&&(m.height=3),m.width==null&&(m.width="100%");const h=_.div(L),p=Ne.Progress(m,...s);h.appendChild(p);const V=z=>{de();const K=$(z);return oe(K),h},ie=z=>{de();const K=le(z);return oe(K),h},a=(z=(K=>(K=o(n.step))!=null?K:8)())=>{de();const ke=he(),Me=$(ke+i(z,0));return oe(Me),h},C=(z=(K=>(K=o(n.startValue))!=null?K:12)())=>{de();const ke=Math.max(he(),d(z));return $(ke),le(Math.max(W(),ke)),oe(ke),Se(),h},g=(z=(K=>(K=o(n.resetValue))!=null?K:c())())=>{de(),me();const ke=d(z);return le(ke),$(ke),oe(ke),h},M=(z=(K=>(K=o(n.doneValue))!=null?K:x())())=>{var Te;de(),me();const ke=d(z);le(ke),$(ke),oe(ke);const Me=Math.max(0,i((Te=o(n.hideDelay))!=null?Te:o(n.doneDelay),220));return be=setTimeout(()=>{g()},Me),h},Y=(...z)=>M(...z),Q=()=>(ce(!0),h),ve=()=>(de(),me(),ce(!1),h),N=()=>(de(),me(),h.remove(),null);return h.el=h,h._progress=p,h.get=()=>he(),h.getBuffer=()=>W(),h.set=V,h.setBuffer=ie,h.inc=a,h.start=C,h.done=M,h.complete=M,h.stop=Y,h.reset=g,h.show=Q,h.hide=ve,h.destroy=N,h._dispose=N,S?S.watch(z=>{$(z,{fromExternal:!0}),oe(d(z))},"UI.LoadingBar:watch"):Ye(n.value)&&JSswift.reactive.effect(()=>{const z=d(o(n.value));$(z,{fromExternal:!0}),oe(z)},"UI.LoadingBar:value"),P?P.watch(z=>{le(z,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):Ye(n.buffer)&&JSswift.reactive.effect(()=>{le(o(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const z=c(),K=x(),ke=Math.min(K,Math.max(z,he())),Me=Math.max(ke,Math.min(K,Math.max(z,W())));ke!==he()&&H(ke),Me!==W()&&se(Me)},"UI.LoadingBar:range"),JSswift.reactive.effect(()=>{n.visible!=null&&ce(o(n.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),JSswift.reactive.effect(()=>{var He;const z=o(n.position)||"fixed",K=o(n.inset),ke=o(n.top),Me=o(n.right),Te=o(n.bottom),U=o(n.left),j=o(n.width),ne=n.visible!=null?!!o(n.visible):X(),Ve=z==="static"||z==="relative";h.classList.toggle("is-visible",ne),h.classList.toggle("is-inline",Ve),h.classList.toggle("has-track",!!o(n.trackColor)),h.style.position=z,h.style.zIndex=String((He=o(n.zIndex))!=null?He:10002),h.style.width=r(j,Ve?"100%":""),K!=null&&K!==""?(h.style.inset=r(K),h.style.removeProperty("top"),h.style.removeProperty("right"),h.style.removeProperty("bottom"),h.style.removeProperty("left")):(h.style.removeProperty("inset"),!Ve&&z!=="sticky"?(h.style.top=r(ke,"0px"),h.style.right=r(Me,j==null||j===""?"0px":""),h.style.bottom=r(Te,""),h.style.left=r(U,"0px")):(h.style.top=r(ke,""),h.style.right=r(Me,""),h.style.bottom=r(Te,""),h.style.left=r(U,"")))},"UI.LoadingBar:layout"),Nt(h,n),o(n.mount)!==!1&&w(n.target).appendChild(h),o(n.autoStart)&&C(),h};const Qo=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),Bi=new Set(["soft","solid","outline"]),ji={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},Hi={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},Zo=t=>{const e=String(o(t)||"").trim().toLowerCase();return e?Qo.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"},Wi=t=>{const e=String(o(t)||"").trim().toLowerCase();return Bi.has(e)?e:"soft"},Ui=(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},Fn=(t={},e="")=>{var d,r,w,F,S,b,P,re,Z,he,H,W,se,X;const n=Vn(t)?{...t}:{message:t},s=Vt(o(e)||o(n.type)||o(n.state)||o(n.color)||"info")||"info",i=Ui((r=(d=n.timeout)!=null?d:n.duration)!=null?r:n.delay,s),c=(S=(F=(w=n.closable)!=null?w:n.dismissible)!=null?F:n.dismiss!=null)!=null?S:i===0,x=n.title===void 0?n.label===void 0?ji[s]:n.label:n.title;return{...n,type:s,state:s,title:x,message:(re=(P=(b=n.message)!=null?b:n.content)!=null?P:n.text)!=null?re:null,description:(H=(he=(Z=n.description)!=null?Z:n.subtitle)!=null?he:n.note)!=null?H:null,meta:(se=(W=n.meta)!=null?W:n.caption)!=null?se:null,body:(X=n.body)!=null?X:null,timeout:i,closable:!!c,dismissLabel:n.dismissLabel||n.closeLabel||"Chiudi notifica",position:Zo(n.position),variant:Wi(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},ei=(t,e="",n="")=>{if(!t.length)return Fn(n?{type:e,title:n}:{type:e});if(Vn(t[0])){const{props:d,children:r}=JSswift.uiNormalizeArgs(t),w={...d};return!w.type&&!w.state&&!w.color&&e&&(w.type=e),w.title==null&&n&&(w.title=n),r.length&&(w.message==null&&w.description==null&&w.body==null&&r.length===1?w.message=r[0]:w.body==null&&(w.body=r.length===1?r[0]:r)),Fn(w,e)}const[s,i,c]=t;let x={};return Vn(i)?x={...i,message:s}:Vn(c)?x={...c,message:s,title:i}:x={message:s,title:i},e&&!x.type&&!x.state&&!x.color&&(x.type=e),x.title==null&&n&&(x.title=n),Fn(x,e)},Nn=(t,e)=>(...n)=>{var s,i;return(i=(s=bt.services.notify)==null?void 0:s.show)==null?void 0:i.call(s,ei(n,t,e))},po=(t,e,n)=>{if(t===!1)return!1;if(typeof t=="function"){const s=t();return po(s,e,n)}return Vn(t)?t:t!=null?{message:t,title:n}:{message:e,title:n}};Ne.Notify=(...t)=>{var e,n;return(n=(e=bt.services.notify)==null?void 0:e.show)==null?void 0:n.call(e,ei(t))},Ne.Notify.show=Ne.Notify,Ne.Notify.success=Nn("success","Success"),Ne.Notify.error=Nn("danger","Error"),Ne.Notify.warning=Nn("warning","Warning"),Ne.Notify.info=Nn("info","Info"),Ne.Notify.primary=Nn("primary","Notice"),Ne.Notify.secondary=Nn("secondary","Notice"),Ne.Notify.remove=t=>{var e,n;return(n=(e=bt.services.notify)==null?void 0:e.remove)==null?void 0:n.call(e,t)},Ne.Notify.clear=()=>{var t,e;return(e=(t=bt.services.notify)==null?void 0:t.clear)==null?void 0:e.call(t)},Ne.Notify.update=(t,e={})=>{var n,s;return(s=(n=bt.services.notify)==null?void 0:n.update)==null?void 0:s.call(n,t,e)},Ne.Notify.promise=async(t,e={})=>{var i,c,x,d,r,w,F,S,b,P,re,Z,he,H;const n=e.loading===!1?!1:po(typeof e.loading=="function"?()=>e.loading():e.loading,"Operazione in corso...","In corso"),s=n===!1?null:(c=(i=bt.services.notify)==null?void 0:i.show)==null?void 0:c.call(i,Fn({type:"info",timeout:0,closable:!1,...n},"info"));try{const se=await(typeof t=="function"?t():t),X=po(typeof e.success=="function"?()=>e.success(se):e.success,"Operazione completata con successo.","Completato");return X!==!1?s!=null?(d=(x=bt.services.notify)==null?void 0:x.update)==null||d.call(x,s,Fn(X,"success")):(w=(r=bt.services.notify)==null?void 0:r.show)==null||w.call(r,Fn(X,"success")):s!=null&&((S=(F=bt.services.notify)==null?void 0:F.remove)==null||S.call(F,s)),se}catch(W){const se=po(typeof e.error=="function"?()=>e.error(W):e.error,(W==null?void 0:W.message)||"Operazione fallita.","Errore");throw se!==!1?s!=null?(P=(b=bt.services.notify)==null?void 0:b.update)==null||P.call(b,s,Fn(se,"danger")):(Z=(re=bt.services.notify)==null?void 0:re.show)==null||Z.call(re,Fn(se,"danger")):s!=null&&((H=(he=bt.services.notify)==null?void 0:he.remove)==null||H.call(he,s)),W}},Ne.Header=(...t)=>{var C,g,M,Y,Q,ve,N;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};wn(i);const c=f=>Object.prototype.hasOwnProperty.call(e,f),x=(C=e.drawerStateKey)!=null?C:Un;x&&(Un=x,_n=Zn(x));const d=()=>Zn(x),r=()=>Mn(!0,x),w=()=>Mn(!1,x),F=()=>Mn(!d(),x),S={props:e,stateKey:x,isDrawerOpen:d,openDrawer:r,closeDrawer:w,toggleDrawer:F,toggleAside:F},b=(f,A)=>{if(!(A==null||A===!1)){if(Array.isArray(A)){A.forEach(z=>b(f,z));return}if(A!=null&&A.nodeType){f.appendChild(A);return}f.appendChild(document.createTextNode(String(A)))}},P=(f,A,z=K=>K)=>{const K=JSswift.ui.getSlot(s,f);if(K!=null)return J(s,f,S,null);if(typeof A=="function"){const ke=new Set(["eyebrow","title","subtitle"]),Me=_[ke.has(f)?"span":"div"]({class:`cms-header-slot-${f}`});return JSswift.reactive.effect(()=>{const Te=z(A(S)),U=Cn(JSswift.ui.slot(Te));Me.replaceChildren(),Array.isArray(U)?U.forEach(j=>b(Me,j)):b(Me,U)},`UI.Header:${f}`),[Me]}return J(s,f,S,z(A))},re=(f,A="icon",z=e.iconSize||e.size||"md")=>f==null||f===!1?null:typeof f=="string"?Ne.Icon({name:f,size:z}):JSswift.ui.slot(f,{as:A}),Z=f=>{var z,K;const A=f?(z=e.drawerOpenIcon)!=null?z:"\u2715":(K=e.drawerCloseIcon)!=null?K:"\u2630";return A==null||A===!1?null:typeof A=="string"?A:JSswift.ui.slot(A,{as:f?"drawerOpenIcon":"drawerCloseIcon"})},he=_.span({class:"cms-header-toggle-icon"}),H=f=>{const A=J(null,"default",S,Z(f));he.replaceChildren(...A.length?A:[""])};H(d());const W=Ne.Btn({class:"cms-header-toggle",outline:!0,size:(M=(g=e.toggleSize)!=null?g:e.size)!=null?M:"sm",onClick:F,"aria-label":e.toggleLabel||"Toggle navigation"},he);e.left==null&&e.left!==!1&&!JSswift.ui.getSlot(s,"left")&&Go.add({update:H});const se=e.left===!1?null:e.left!=null?e.left:W,X=c("title")?e.title:(Y=e.label)!=null?Y:"App",fe=(ve=(Q=e.subtitle)!=null?Q:e.description)!=null?ve:"",_e=c("right")?e.right:e.end,be=c("content")?e.content:c("body")?e.body:n!=null&&n.length?n:null,me=[...P("left",se),...P("start",null)],de=P("icon",e.icon,re),ce=P("eyebrow",(N=e.eyebrow)!=null?N:e.kicker),$=P("title",X),le=P("subtitle",fe),oe=P("meta",e.meta),Se=(()=>{const f=P("content",null);return f.length?f:P("default",be)})(),L=[...P("center",null),...P("body",null)],m=[...P("right",_e),...P("end",null)],h=P("actions",e.actions),p=_.div({class:te(["cms-header-body",e.bodyClass,e.centerClass])},_.div({class:"cms-header-heading"},de.length?_.div({class:"cms-header-icon"},...de):null,_.div({class:"cms-header-copy"},ce.length?_.div({class:te(["cms-header-eyebrow",e.eyebrowClass])},...ce):null,$.length?_.div({class:te(["cms-header-title",e.titleClass])},...$):null,le.length?_.div({class:te(["cms-header-subtitle",e.subtitleClass])},...le):null,Se.length?_.div({class:te(["cms-header-content",e.contentClass])},...Se):null),oe.length?_.div({class:te(["cms-header-meta",e.metaClass])},...oe):null)),V=[...m,...h.length?[_.div({class:te(["cms-header-actions",e.actionsClass])},...h)]:[]],ie=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"]);ie.class=te(["cms-panel","cms-header","cms-singularity",ye(e.sticky!==!1,"sticky"),ye(e.stack,"stack"),ye(e.elevated,"elevated"),ye(e.divider!==!1,"divider"),i.class]),ie.style={...i.style||{}},e.gap!=null&&(ie.style["--cms-header-gap"]=mt(o(e.gap))),e.minHeight!=null&&(ie.style.minHeight=mt(o(e.minHeight)));const a=_.div(ie,...me.length?[_.div({class:te(["cms-header-start",e.startClass])},...me)]:[],_.div({class:"cms-header-main"},...L.length?[_.div({class:te(["cms-header-body",e.bodyClass,e.centerClass])},...L)]:[p],...V.length?[_.div({class:te(["cms-header-end",e.endClass])},...V)]:[]));return Nt(a,e),a},Ne.Drawer=(...t)=>{var Ee,De,Ie,qe,Be,T,Pe,O,k,v;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=u=>Object.prototype.hasOwnProperty.call(e,u),x=(Ee=e.stateKey)!=null?Ee:Un;x&&(Un=x,_n=Zn(x));const d=()=>Zn(x),r=()=>Mn(!0,x),w=()=>Mn(!1,x),F=()=>Mn(!d(),x),S={props:e,stateKey:x,isDrawerOpen:d,openDrawer:r,closeDrawer:w,toggleDrawer:F,toggleAside:F},b=JSswift==null?void 0:JSswift.store,P=!!(b!=null&&b.get&&(b!=null&&b.set)),re=`${x}:groups`,Z=`${x}:active`;let he=P?b.get(re,{})||{}:{},H=P&&(De=b.get(Z,null))!=null?De:null;const W=new Map,se=new Map,X=u=>{const I=o(u);return I==null||I===!1?[]:Array.isArray(I)?I.flat(1/0):[I]},fe=(u,I,xe=S)=>{const Ue=Array.isArray(u)?u:[u];for(const et of Ue)if(JSswift.ui.getSlot(s,et)!=null)return J(s,et,xe,I);return I==null?[]:J(null,"default",xe,o(I))},_e=u=>(Array.isArray(u)?u:[u]).some(xe=>JSswift.ui.getSlot(s,xe)!=null),be=u=>{if(typeof o(u.external)=="boolean")return!!o(u.external);const I=o(u.href||u.to||u.link||"");return/^(https?:)?\/\//.test(I)},me=(Ie=e.closeOnSelect)!=null?Ie:!0,de=u=>!!me&&o(u.keepOpen)!==!0,ce=(Be=(qe=e.itemIconSize)!=null?qe:e.size)!=null?Be:"md",$=(T=e.groupOpenIcon)!=null?T:"arrow_drop_up",le=(Pe=e.groupCloseIcon)!=null?Pe:"arrow_drop_down",oe=u=>!!u&&H===u,Se=u=>!!u&&!!H&&(H===u||H.startsWith(`${u}::`)),L=()=>{W.forEach(({el:u,baseActive:I},xe)=>{const Ue=!!I||oe(xe);u.classList.toggle("active",Ue),Ue?u.setAttribute("aria-current","page"):u.removeAttribute("aria-current")}),se.forEach(({wrap:u,toggle:I,baseActive:xe},Ue)=>{const et=!!xe||Se(Ue);u.classList.toggle("active",et),I.classList.toggle("active",et)})},m=u=>{H=u||null,P&&b.set(Z,H),L()},h=(u,I)=>{if(o(u.active)!=null)return!!o(u.active);if(o(u.current)!=null)return!!o(u.current);if(!I||be(u))return!1;try{if(I.startsWith("#"))return window.location.hash===I;const xe=`${window.location.pathname}${window.location.search}${window.location.hash}`;return I===xe||I===window.location.pathname}catch(xe){return!1}},p=(u,I,xe)=>h(u,I)||oe(xe),V=(u=[],I=0,xe=[])=>X(u).some((Ue,et)=>{var It,Rt,Pt,st,wt;const G=o(Ue);if(!G||typeof G!="object"||G.nodeType)return!1;const Ge=o(G.href||G.to||G.link||""),lt=(wt=o((st=(Pt=(Rt=(It=G.label)!=null?It:G.title)!=null?Rt:G.text)!=null?Pt:Ge)!=null?st:null))!=null?wt:`item-${I}-${et}`,tt=g(G,lt,I,et),dt=xe.concat(tt).join("::");if(p(G,Ge,dt))return!0;const St=G.items||G.children||G.sub;return V(St,I+1,xe.concat(tt))}),ie=(u,I={})=>{var et;const xe=o(u);if(xe==null||xe===!1)return[];const Ue=typeof xe=="string"?Ne.Icon({name:xe,size:(et=I.iconSize)!=null?et:ce}):JSswift.ui.slot(xe,{...I,as:"icon"});return J(null,"default",I,Ue)},a=(u,I,xe={})=>{const Ue=ie(u,xe);return Ue.length?[_.span({class:te(["cms-drawer-item-icon",I])},...Ue)]:[]},C=u=>{const I=o(u.iconPosition)||"left",xe=Object.prototype.hasOwnProperty.call(u,"iconLeft")?u.iconLeft:I!=="right"?u.icon:null,Ue=Object.prototype.hasOwnProperty.call(u,"iconRight")?u.iconRight:I==="right"?u.icon:null;return{left:xe,right:Ue}},g=(u,I,xe,Ue)=>o(u.key||u.id||u.to||u.href||I||`item-${xe}-${Ue}`),M=(u,I)=>P&&Object.prototype.hasOwnProperty.call(he,u)?!!he[u]:I,Y=(u,I)=>{P&&(he={...he,[u]:!!I},b.set(re,he))},Q=()=>{const u={...S,area:"header"},I=fe(["headerIcon","icon"],e.icon,u),xe=fe(["eyebrow"],e.eyebrow,u),Ue=fe(["title"],e.title,u),et=fe(["subtitle"],e.subtitle,u),G=fe(["meta"],e.meta,u),Ge=fe(["content"],e.content,u),lt=fe(["actions"],e.actions,u),tt=c("header")?J(null,"default",u,o(e.header)):[],dt=I.length||xe.length||Ue.length||et.length||G.length||Ge.length||lt.length;return!dt&&!tt.length?[]:dt?[_.div({class:te(["cms-drawer-header",e.headerClass])},...I.length?[_.div({class:"cms-drawer-header-icon"},...I)]:[],_.div({class:"cms-drawer-header-body"},...xe.length?[_.div({class:"cms-drawer-header-eyebrow"},...xe)]:[],...Ue.length?[_.div({class:"cms-drawer-header-title"},...Ue)]:[],...et.length?[_.div({class:"cms-drawer-header-subtitle"},...et)]:[],...G.length?[_.div({class:"cms-drawer-header-meta"},...G)]:[],...Ge.length?[_.div({class:"cms-drawer-header-content"},...Ge)]:[],...tt.length?[_.div({class:"cms-drawer-header-extra"},...tt)]:[]),...lt.length?[_.div({class:"cms-drawer-header-actions"},...lt)]:[])]:tt},ve=(u,I,xe)=>{var G,Ge;return!(((G=u.onClick)==null?void 0:G.call(u,xe,I))===!1||xe!=null&&xe.defaultPrevented||((Ge=e.onSelect)==null?void 0:Ge.call(e,u,I,xe))===!1||xe!=null&&xe.defaultPrevented)},N=(u,I,xe={})=>{const Ue=I.hasChildren?"group":"item",et=J(s,`${Ue}Label`,I,I.label),G=J(s,`${Ue}Note`,I,I.note),Ge=J(s,`${Ue}Badge`,I,I.badge),lt=J(s,`${Ue}Aside`,I,I.aside),tt=J(s,`${Ue}Content`,I,I.content),dt=[];return(et.length||G.length||Ge.length||lt.length)&&dt.push(_.div({class:"cms-drawer-item-top"},_.div({class:"cms-drawer-item-copy"},...et.length?[_.div({class:"cms-drawer-item-label"},...et)]:[],...G.length?[_.div({class:"cms-drawer-item-note"},...G)]:[]),...Ge.length||lt.length?[_.div({class:"cms-drawer-item-meta"},...Ge.length?[_.div({class:"cms-drawer-item-badge"},...Ge)]:[],...lt.length?[_.div({class:"cms-drawer-item-aside"},...lt)]:[])]:[])),tt.length&&dt.push(_.div({class:"cms-drawer-item-content"},...tt)),[...xe.start||[],...a(I.iconLeft,"left",I),...dt.length?[_.div({class:"cms-drawer-item-main"},...dt)]:[],...a(I.iconRight,"right",I),...xe.end||[]]},f=(u=[],I=0,xe=[])=>X(u).map((Ue,et)=>{var ts,Xe,pt,Mt,Kt,en,tn,dn,ln,y,ue;const G=o(Ue);if(G==null||G===!1)return null;if(G.nodeType||typeof G!="object"||Array.isArray(G))return _.div({class:"cms-drawer-custom","data-level":String(I)},...J(null,"default",{...S,item:G,level:I,index:et,path:xe},G));if(o(G.hidden)===!0||o(G.visible)===!1)return null;const Ge=X(G.items||G.children||G.sub),lt=o(G.href||G.to||G.link||null),tt=o((Mt=(pt=(Xe=(ts=G.label)!=null?ts:G.title)!=null?Xe:G.text)!=null?pt:lt)!=null?Mt:null),dt=tt!=null?tt:`item-${I}-${et}`,St=o((tn=(en=(Kt=G.note)!=null?Kt:G.subtitle)!=null?en:G.description)!=null?tn:null),It=o((dn=G.badge)!=null?dn:null),Rt=o((y=(ln=G.aside)!=null?ln:G.meta)!=null?y:null),Pt=o((ue=G.content)!=null?ue:null),st=g(G,dt,I,et),wt=xe.concat(st).join("::"),{left:Ft,right:Dt}=C(G),Yt=Vt(o(G.state)||o(G.color)||""),Xt=h(G,lt),on=Xt||oe(wt),jt=!!o(G.disabled),Qt={...S,item:G,index:et,level:I,path:xe,label:dt,note:St,badge:It,aside:Rt,content:Pt,itemStateKey:wt,iconLeft:Ft,iconRight:Dt,iconSize:o(G.iconSize)||ce,active:on,disabled:jt,hasChildren:!1},cn=o(G.divider)===!0||G.type==="divider"||G.type==="separator",hn=o(G.section)===!0||G.type==="section"||G.type==="heading"||G.type==="label",Gt=G.type==="content"||G.type==="custom"||!lt&&!Ge.length&&!o(G.button)&&G.type!=="button"&&tt==null&&Pt!=null;if(cn)return _.div({class:te(["cms-drawer-separator",G.class]),"data-level":String(I)});if(hn){const Je=J(s,"sectionLabel",Qt,dt||Pt);return _.div({class:te(["cms-drawer-section-label",G.class]),"data-level":String(I)},...Je)}if(Gt){const Je=J(s,"item",Qt,Pt!=null?Pt:dt);return _.div({class:te(["cms-drawer-custom",Yt?`cms-drawer-tone-${Yt}`:"",G.class]),style:G.style,"data-level":String(I)},...Je)}if(Ge.length){const Je=Xt||V(Ge,I+1,xe.concat(st)),ot=Je||Se(wt);let rt=M(wt,!!o(G.expanded)||!!o(G.open)||ot);const at=_.span({class:"cms-drawer-group-icon"}),ht={...Qt,active:ot,hasChildren:!0,isOpen:()=>rt,setOpen:pn=>vn(pn),toggle:()=>vn(!rt)},Tt=()=>{var ms,hs;const pn=rt?(ms=G.openIcon)!=null?ms:$:(hs=G.closeIcon)!=null?hs:le,ns=o(rt?G.iconSidePosition||G.openIconSide||G.openIconPosition||"right":G.iconSidePosition||G.closeIconSide||G.closeIconPosition||"right")==="left"?"left":"right";at.innerHTML="",at.className=`cms-drawer-group-icon ${ns}`,ie(pn,{...ht,as:"toggleIcon"}).forEach(Ns=>at.appendChild(Ns))},Ht=_.button({type:"button",class:te(["cms-drawer-group-toggle","cms-drawer-entry",rt?"open":"",ot?"active":"",jt?"is-disabled":"",Yt?`cms-drawer-tone-${Yt}`:"",G.class]),style:G.style,"data-level":String(I),"aria-expanded":String(rt),"aria-disabled":jt?"true":null,onClick:pn=>{if(jt){pn.preventDefault();return}m(wt),vn(!rt)}},...N(G,ht,{start:o(G.iconSidePosition||G.openIconSide||G.closeIconSide||G.openIconPosition||G.closeIconPosition||"right")==="left"?[at]:[],end:o(G.iconSidePosition||G.openIconSide||G.closeIconSide||G.openIconPosition||G.closeIconPosition||"right")==="right"?[at]:[]})),sn=J(s,"group",ht,null),fn=_.div({class:"cms-drawer-group-items"},...f(Ge,I+1,xe.concat(st))),Pn=_.div({class:te(["cms-drawer-group",rt?"open":"",ot?"active":"",Yt?`cms-drawer-tone-${Yt}`:""]),"data-level":String(I)},...sn.length?sn:[Ht],fn),vn=pn=>{rt=!!pn,Pn.classList.toggle("open",rt),Ht.classList.toggle("open",rt),Ht.setAttribute("aria-expanded",String(rt)),Tt(),Y(wt,rt)};return se.set(wt,{wrap:Pn,toggle:Ht,baseActive:Je}),Tt(),Pn}const Tn=J(s,"item",Qt,null),An=o(G.button)===!0||G.type==="button"||!lt&&typeof G.onClick=="function",an={class:te(["cms-drawer-entry",An?"cms-drawer-btn":"cms-drawer-link",on?"active":"",jt?"is-disabled":"",Yt?`cms-drawer-tone-${Yt}`:"",G.class]),style:G.style,"data-level":String(I),"aria-current":on?"page":null,"aria-disabled":jt?"true":null},Dn=Tn.length?Tn:N(G,Qt);if(An){const Je=_.button({...an,type:G.buttonType||"button",disabled:jt,onClick:ot=>{if(jt){ot.preventDefault();return}ve(G,Qt,ot)&&(m(wt),de(G)&&w())}},...Dn);return W.set(wt,{el:Je,baseActive:Xt}),Je}const un=be(G),ds=un?o(G.target)||"_blank":o(G.target),fs=un?o(G.rel)||"noopener noreferrer":o(G.rel),es=_.a({...an,href:lt||"#",target:ds||null,rel:fs||null,tabIndex:jt?-1:null,onClick:Je=>{var ot;if(jt){Je.preventDefault();return}ve(G,Qt,Je)&&(!un&&G.to&&((ot=bt.router)!=null&&ot.navigate)&&(Je.preventDefault(),bt.router.navigate(G.to)),de(G)&&w())}},...Dn);return W.set(wt,{el:es,baseActive:Xt}),es}).filter(Boolean),A=fe(["before","beforeItems"],(O=e.before)!=null?O:e.beforeItems),z=_e(["body"])?fe(["body"],null):[],K=f(e.items||[]),ke=fe(["default"],n),Me=fe(["after","afterItems"],(k=e.after)!=null?k:e.afterItems),Te=z.length?z:[...A,...K,...ke,...Me],U=c("empty")||c("emptyText")?(v=e.empty)!=null?v:_.div({class:te(["cms-drawer-empty",e.emptyClass])},e.emptyText||"Nessun contenuto"):_.div({class:te(["cms-drawer-empty",e.emptyClass])},"Nessun contenuto"),j=fe(["header"],Q()),ne=fe(["footer"],e.footer),Ve=Te.length?Te:fe(["empty"],U),He=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"]);He.class=te(["cms-panel","cms-drawer",_n?"open":"",ye(e.sticky,"sticky"),i.class]),He.style={...i.style||{}},e.gap!=null&&(He.style["--cms-drawer-gap"]=mt(o(e.gap))),e.indent!=null&&(He.style["--cms-drawer-indent"]=mt(o(e.indent))),e.padding!=null&&(He.style["--cms-drawer-padding"]=mt(o(e.padding))),e.width!=null&&(He.style.width=mt(o(e.width))),e.minHeight!=null&&(He.style.minHeight=mt(o(e.minHeight))),e.maxHeight!=null&&(He.style.maxHeight=mt(o(e.maxHeight)));const ae=_.div(He,...j.length?j:[],_.div({class:te(["cms-drawer-body",e.bodyClass])},...Ve),...ne.length?[_.div({class:te(["cms-drawer-footer",e.footerClass])},...ne)]:[]),$e=Eo.get(x)||new Set;return $e.add(ae),Eo.set(x,$e),Mn(_n,x),ae.isDrawerOpen=d,ae.openDrawer=r,ae.closeDrawer=w,ae.toggleDrawer=F,ae.setActiveItem=m,Nt(ae,e),L(),ae},Ne.Page=(...t)=>{var p,V,ie,a;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=(C,g)=>{var M;return!!(C&&C.nodeType===1&&((M=C.classList)!=null&&M.contains(`cms-page-${g}`)))},x=C=>C==null?null:typeof C=="string"?Ne.Icon({name:C,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(C,{as:"icon"}),d={dense:!!o(e.dense),flat:!!o(e.flat),centered:!!o(e.centered),narrow:!!o(e.narrow)},r=(C,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(M=>r(C,M));return}if(g!=null&&g.nodeType){C.appendChild(g);return}C.appendChild(document.createTextNode(String(g)))}},w=(C,g,M=Y=>Y)=>{const Y=JSswift.ui.getSlot(s,C);if(Y!=null)return J(s,C,d,null);if(typeof g=="function"){const Q=new Set(["eyebrow","title","subtitle"]),ve=_[Q.has(C)?"span":"div"]({class:`cms-page-slot-${C}`});return JSswift.reactive.effect(()=>{const N=M(g(d)),f=Cn(JSswift.ui.slot(N));ve.replaceChildren(),Array.isArray(f)?f.forEach(A=>r(ve,A)):r(ve,f)},`UI.Page:${C}`),[ve]}return J(s,C,d,M(g))},F=J(s,"default",d,n!=null&&n.length?n:[]),S={hero:[],header:[],body:[],footer:[],actions:[]},b=[];F.forEach(C=>{c(C,"hero")?S.hero.push(C):c(C,"header")?S.header.push(C):c(C,"body")?S.body.push(C):c(C,"footer")?S.footer.push(C):c(C,"actions")?S.actions.push(C):b.push(C)});const P=w("icon",e.icon,x),re=w("hero",(p=e.hero)!=null?p:e.banner),Z=w("eyebrow",(V=e.eyebrow)!=null?V:e.kicker),he=w("title",e.title),H=w("subtitle",(ie=e.subtitle)!=null?ie:e.description),W=w("header",e.header),se=w("aside",e.aside),X=w("body",(a=e.body)!=null?a:e.content),fe=w("footer",e.footer),_e=w("actions",e.actions),be=re.length?_.div({class:te(["cms-page-hero",e.heroClass])},...re):null,me=P.length||Z.length||he.length||H.length||W.length||se.length,de=me?_.div({class:te(["cms-page-header",e.headerClass])},_.div({class:"cms-page-head"},P.length?_.div({class:te(["cms-page-icon",e.iconClass])},...P):null,_.div({class:"cms-page-head-main"},Z.length?_.div({class:te(["cms-page-eyebrow",e.eyebrowClass])},...Z):null,he.length?_.div({class:te(["cms-page-title",e.titleClass])},...he):null,H.length?_.div({class:te(["cms-page-subtitle",e.subtitleClass])},...H):null,W.length?_.div({class:te(["cms-page-header-content",e.headerContentClass])},...W):null),se.length?_.div({class:te(["cms-page-aside",e.asideClass])},...se):null)):null,ce=[...X,...b],$=ce.length?_.div({class:te(["cms-page-body",e.bodyClass])},...ce):null,le=[..._e,...S.actions],oe=fe.length||le.length?_.div({class:te(["cms-page-footer",e.footerClass])},...fe,le.length?_.div({class:"cms-page-actions"},...le):null):null,Se=!!(re.length||S.hero.length),L=!!(me||S.header.length),m=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"]);m.class=te(["cms-panel","cms-page",ye(e.dense,"dense"),ye(e.flat,"cms-page-flat"),ye(e.centered,"cms-page-centered"),ye(e.narrow,"cms-page-narrow"),ye(Se,"cms-page-has-hero"),ye(L,"cms-page-has-header"),i.class]),m.style={...i.style||{}},(e.gap!=null||Ye(e.gap))&&(m.style["--cms-page-gap"]=Ke(e.gap,mt)),(e.padding!=null||Ye(e.padding))&&(m.style["--cms-page-padding"]=Ke(e.padding,mt)),(e.maxWidth!=null||Ye(e.maxWidth))&&(m.style["--cms-page-max-width"]=Ke(e.maxWidth,mt)),(e.minHeight!=null||Ye(e.minHeight))&&(m.style["--cms-page-min-height"]=Ke(e.minHeight,mt)),(e.headerGap!=null||Ye(e.headerGap))&&(m.style["--cms-page-header-gap"]=Ke(e.headerGap,mt)),(e.heroPadding!=null||Ye(e.heroPadding))&&(m.style["--cms-page-hero-padding"]=Ke(e.heroPadding,mt));const h=_.div(m,be,...S.hero,de,...S.header,$,...S.body,oe,...S.footer);return Nt(h,e),h},Ne.AppShell=(...t)=>{var C,g;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(M,Y)=>!!M&&Object.prototype.hasOwnProperty.call(M,Y),c=o(e.noDrawer)===!0||e.drawer===!1,x=o(e.reverse)===!0,d=o(e.stack)===!0,r=(g=(C=e.drawerStateKey)!=null?C:e.stateKey)!=null?g:Un;r&&(Un=r,_n=Zn(r));const w={props:e,noDrawer:c,stateKey:r,isDrawerOpen:()=>Zn(r),openDrawer:()=>Mn(!0,r),closeDrawer:()=>Mn(!1,r),toggleDrawer:()=>Mn(!Zn(r),r)},F=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let S=e.header;!i(e,"header")&&(Object.keys(F).length||i(e,"title")||i(e,"subtitle")||i(e,"left")||i(e,"right"))&&(!i(F,"title")&&i(e,"title")&&(F.title=e.title),!i(F,"subtitle")&&i(e,"subtitle")&&(F.subtitle=e.subtitle),!i(F,"left")&&i(e,"left")&&(F.left=e.left),!i(F,"right")&&i(e,"right")&&(F.right=e.right),i(F,"drawerStateKey")||(F.drawerStateKey=r),c&&!i(F,"left")&&(F.left=!1),S=Ne.Header(F));const b=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},P=i(e,"drawerItems")?e.drawerItems:e.items,re=i(e,"drawerHeader")?e.drawerHeader:void 0;let Z=e.drawer;!i(e,"drawer")&&!c&&(Object.keys(b).length||P!=null||re!=null)&&(!i(b,"items")&&P!=null&&(b.items=P),!i(b,"header")&&re!=null&&(b.header=re),i(b,"stateKey")||(b.stateKey=r),Z=Ne.Drawer(b));const he=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},H=i(e,"content")?e.content:n,W=J(s,"default",w,H);let se=e.page;!i(e,"page")&&(Object.keys(he).length||W.length)&&(se=Ne.Page(he,...W));const X=e.footerProps&&typeof e.footerProps=="object"?{...e.footerProps}:{},fe=i(e,"footerContent")?e.footerContent:void 0;let _e=e.footer;!i(e,"footer")&&(Object.keys(X).length||fe!=null)&&(_e=Ne.Footer(X,...J(null,"default",w,fe)));const be=J(s,"header",w,S),me=c?[]:J(s,"drawer",w,Z),de=J(s,"page",w,se),ce=J(s,"footer",w,_e),$=te(["cms-app","cms-app-shell",ye(c,"no-drawer"),ye(x,"is-reverse"),ye(d,"is-stack"),ye(e.flush,"is-flush"),ye(e.divider,"is-divider"),e.class]),le=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"]);le.class=$,le.style={...e.style||{}};const oe=Ke(e.drawerWidth,mt);oe!=null&&(le.style["--cms-app-shell-drawer-width"]=oe);const Se=Ke(e.gap,mt);Se!=null&&(le.style["--cms-app-shell-gap"]=Se);const L=Ke(e.padding,mt);L!=null&&(le.style["--cms-app-shell-padding"]=L);const m=be.length?_.div({class:"cms-app-shell-header-slot"},...be):null,h=me.length?_.div({class:"cms-app-shell-drawer-slot"},...me):null,p=de.length?_.div({class:"cms-app-shell-page-slot"},...de):null,V=ce.length?_.div({class:"cms-app-shell-footer-slot"},...ce):null,ie=x?[p,h]:[h,p],a=_.div(le,...m?[m]:[],_.div({class:"cms-app-shell-body"},...ie.filter(Boolean)),...V?[V]:[]);return a.openDrawer=w.openDrawer,a.closeDrawer=w.closeDrawer,a.toggleDrawer=w.toggleDrawer,a.isDrawerOpen=w.isDrawerOpen,a.header=m,a.drawer=h,a.page=p,a.footer=V,Nt(a,e),a},Ne.Parallax=function(...e){var M,Y;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),i=n.slots||{},c={...n};c.color!=null&&c.textColor==null&&(c.textColor=c.color),delete c.color,wn(c);const x=Ct(n.state,()=>{const Q=Vt(o(n.state));return Q?`cms-state-${Q}`:""}),d=Q=>{if(Q==null||Q===!1||Q==="")return"";const ve=String(Q);return In(ve)?`var(--cms-${ve})`:ve},r=()=>{const Q=o(n.background);if(Q)return String(Q);const ve=o(n.image)||o(n.src)||"";if(!ve)return"linear-gradient(120deg, #1b2c5a, #2f6d8f, #2a8f5c)";const N=String(ve);return/^url\(/i.test(N)||/gradient\(/i.test(N)||/^var\(/i.test(N)?N:`url(${N})`},w=(Q,ve)=>{const N=Number(o(Q));return Number.isFinite(N)?N:ve},F={speed:()=>{var Q;return(Q=o(n.speed))!=null?Q:.18},state:()=>o(n.state)||"",disabled:()=>!!o(n.disabled)},S=J(i,"badge",F,n.badge),b=J(i,"background",F,n.backgroundContent),P=J(i,"eyebrow",F,(M=n.eyebrow)!=null?M:n.kicker),re=J(i,"title",F,n.title),Z=J(i,"subtitle",F,n.subtitle),he=J(i,"header",F,n.header),H=J(i,"aside",F,n.aside),W=J(i,"media",F,n.media),se=J(i,"content",F,(Y=n.content)!=null?Y:n.body),X=J(i,"default",F,s!=null&&s.length?s:[]),fe=J(i,"footer",F,n.footer),_e=J(i,"actions",F,n.actions),be=[...se,...X],me=S.length?_.div({class:te(["cms-parallax-badge",n.badgeClass])},...S):null,de=P.length||re.length||Z.length||he.length||H.length,ce=de?_.div({class:te(["cms-parallax-header",n.headerClass])},_.div({class:"cms-parallax-head"},_.div({class:"cms-parallax-head-main"},P.length?_.div({class:te(["cms-parallax-eyebrow",n.eyebrowClass])},...P):null,re.length?_.div({class:te(["cms-parallax-title",n.titleClass])},...re):null,Z.length?_.div({class:te(["cms-parallax-subtitle",n.subtitleClass])},...Z):null,he.length?_.div({class:te(["cms-parallax-header-content",n.headerContentClass])},...he):null),H.length?_.div({class:te(["cms-parallax-aside",n.asideClass])},...H):null)):null,$=W.length?_.div({class:te(["cms-parallax-media",n.mediaClass])},...W):null,le=be.length?_.div({class:te(["cms-parallax-body",n.bodyClass])},...be):null,oe=fe.length||_e.length?_.div({class:te(["cms-parallax-footer",n.footerClass])},fe.length?_.div({class:"cms-parallax-footer-content"},...fe):null,_e.length?_.div({class:"cms-parallax-actions"},..._e):null):null,Se=JSswift.omit(c,["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"]);Se.class=te(["cms-parallax","cms-singularity",x,ye(n.disabled,"cms-parallax-static"),ye(me,"cms-parallax-has-badge"),ye(de,"cms-parallax-has-header"),c.class]),Se.style={...c.style||{}},n.height!=null&&(Se.style["--cms-parallax-height"]=Ke(n.height,mt)),n.minHeight!=null&&(Se.style["--cms-parallax-min-height"]=Ke(n.minHeight,mt)),n.padding!=null&&(Se.style["--cms-parallax-padding"]=Ke(n.padding,mt)),n.gap!=null&&(Se.style["--cms-parallax-gap"]=Ke(n.gap,mt)),n.contentMaxWidth!=null&&(Se.style["--cms-parallax-content-max-width"]=Ke(n.contentMaxWidth,mt)),n.justify!=null&&(Se.style["--cms-parallax-justify"]=Ke(n.justify)),n.align!=null&&(Se.style["--cms-parallax-align"]=Ke(n.align)),n.color!=null&&(Se.style["--cms-parallax-color"]=Ke(n.color,d)),n.overlay!=null&&(Se.style["--cms-parallax-overlay"]=Ke(n.overlay)),n.bgPosition!=null&&(Se.style["--cms-parallax-position"]=Ke(n.bgPosition)),n.bgSize!=null&&(Se.style["--cms-parallax-size"]=Ke(n.bgSize)),n.bgRepeat!=null&&(Se.style["--cms-parallax-repeat"]=Ke(n.bgRepeat)),Se.style["--cms-parallax-image"]=Ye(n.background)||Ye(n.image)||Ye(n.src)?()=>r():r();const L=_.div({class:te(["cms-parallax-bg",n.bgClass])},b.length?_.div({class:te(["cms-parallax-bg-content",n.backgroundContentClass])},...b):null),m=_.div({class:te(["cms-parallax-content",n.contentClass,n.innerClass])},me,ce,$,le,oe),h=_.div(Se,L,m);let p=!1,V=!1,ie=null;const a=()=>{var Q;p||(p=!0,typeof window!="undefined"&&(window.removeEventListener("scroll",g),window.removeEventListener("resize",g)),(Q=ie==null?void 0:ie.disconnect)==null||Q.call(ie),ie=null)},C=()=>{if(p)return;if(!h.isConnected){a();return}if(o(n.disabled)){L.style.transform="translate3d(0, 0, 0)",h.style.setProperty("--cms-parallax-offset","0px");return}const Q=h.getBoundingClientRect(),ve=w(n.speed,.18),N=Math.abs(w(n.maxOffset,96)),f=o(n.startTop),A=f!=null&&f!==""?(Q.top-w(n.startTop,0))*ve:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(Q.top+Q.height/2))*ve,K=`${(N>0?Math.max(-N,Math.min(N,A)):A).toFixed(2)}px`;L.style.transform=`translate3d(0, ${K}, 0)`,h.style.setProperty("--cms-parallax-offset",K)};function g(){p||V||(V=!0,requestAnimationFrame(()=>{V=!1,C()}))}return typeof window!="undefined"&&(window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g),typeof ResizeObserver!="undefined"&&(ie=new ResizeObserver(()=>{g()}),ie.observe(h)),requestAnimationFrame(()=>{g()}),setTimeout(()=>{g()},90)),h.refresh=()=>(g(),h),h.update=h.refresh,h.destroy=()=>(a(),h.remove(),null),h._dispose=a,Nt(h,n),h};const[go,yo]=bt.reactive.signal([]),bo=new Map;function Po(t){const e=bo.get(t);e&&(clearTimeout(e),bo.delete(t))}function Jo(t){return t?(Po(t),yo(go().filter(e=>e.id!==t)),t):null}function Gi(){for(const t of bo.keys())Po(t);yo([])}function ti(t){t!=null&&t.id&&(Po(t.id),t.timeout>0&&bo.set(t.id,setTimeout(()=>{Jo(t.id)},t.timeout)))}function ni(t,e={}){if(!t)return null;let n=null;return yo(go().map(s=>s.id!==t?s:(n=Fn({...s,...e,id:s.id},e.type||e.state||e.color||s.type),n))),n&&ti(n),(n==null?void 0:n.id)||null}function Ki(t){const e=()=>Jo(t.id),n=(he={})=>ni(t.id,he),s={toast:t,id:t.id,close:e,update:n},i=he=>typeof he=="function"?he(s):he,c=(()=>{if(t.icon===!1||t.icon===null)return null;if(t.icon!=null){const H=i(t.icon);return typeof H=="string"?Ne.Icon({name:H,size:"sm"}):JSswift.ui.slot(H,{as:"icon"})}const he=Hi[t.type];return he?Ne.Icon({name:he,size:"sm"}):null})(),x=J(t.slots,"icon",s,c),d=J(t.slots,"title",s,i(t.title)),r=J(t.slots,"message",s,i(t.message)),w=J(t.slots,"description",s,i(t.description)),F=J(t.slots,"meta",s,i(t.meta)),S=J(t.slots,"actions",s,i(t.actions)),b=J(t.slots,"default",s,i(t.body)),P=J(t.slots,"dismiss",s,i(t.dismiss)),re=P.length?P:t.closable?[Ne.Btn({class:"cms-toast-close",outline:!0,size:"xs","aria-label":t.dismissLabel,onClick:e},Ne.Icon({name:"close",size:"xs"}))]:[],Z=_.div({class:te(["cms-toast",`cms-toast-${t.type}`,`cms-toast-${t.variant}`,ye(t.closable,"is-closable"),t.class]),style:t.style||{},role:t.role},x.length?_.div({class:"cms-toast-icon"},...x):null,_.div({class:"cms-toast-main"},_.div({class:"cms-toast-copy"},d.length?_.div({class:"cms-toast-title"},...d):null,r.length?_.div({class:"cms-toast-message"},...r):null,w.length?_.div({class:"cms-toast-description"},...w):null,b.length?_.div({class:"cms-toast-body"},...b):null,F.length?_.div({class:"cms-toast-meta"},...F):null),S.length?_.div({class:"cms-toast-actions"},...S):null),re.length?_.div({class:"cms-toast-dismiss"},...re):null);return Nt(Z,t),Z}function qi(){let t=document.querySelector(".cms-toast-layer");return t||(t=document.createElement("div"),t.className="cms-toast-layer",document.body.appendChild(t),bt.reactive.effect(()=>{const e=go();t.innerHTML="";const n=new Map;for(const s of e){const i=Zo(s.position);n.has(i)||n.set(i,[]),n.get(i).push(s)}for(const s of Qo){const i=n.get(s);if(!(i!=null&&i.length))continue;const c=_.div({class:te(["cms-toast-wrap",`is-${s}`])},...i.map(x=>Ki(x)));t.appendChild(c)}},"JSswiftUI:toasts"),t)}function Yi(t={}){qi();const e=Fn(t);return e.id=e.id||Math.random().toString(36).slice(2),yo([...go().filter(n=>n.id!==e.id),e]),ti(e),e.id}bt.services.notify.show=Yi,bt.services.notify.success=Nn("success","Success"),bt.services.notify.error=Nn("danger","Error"),bt.services.notify.warning=Nn("warning","Warning"),bt.services.notify.info=Nn("info","Info"),bt.services.notify.primary=Nn("primary","Notice"),bt.services.notify.secondary=Nn("secondary","Notice"),bt.services.notify.update=ni,bt.services.notify.remove=Jo,bt.services.notify.clear=Gi,bt.services.notify.promise=Ne.Notify.promise,bt.notify=bt.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 c=s?s(e,n):!0,x=JSswift.form._isPromise(c)?await c:c;return x===!0?null:typeof x=="string"?x:x===!1?i||"Valore non valido":x?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,c=_.rod({}),x=_.rod({}),d=_.rod(!1),r=_.rod(null),w=()=>e&&typeof e=="object"&&"value"in e?e.value||{}:e,F=be=>{if(e&&typeof e=="object"&&"value"in e)e.value=be;else{const me=e||{};for(const de in me)delete me[de];Object.assign(me,be)}},S=be=>{const me=w();return me?me[be]:void 0},b=(be,me)=>{const de={...w()||{}};de[be]=me,F(de)},P=(be,me)=>{const de={...c.value||{}};me?de[be]=me:delete de[be],c.value=de},re=be=>(c.value||{})[be]||null,Z=be=>{x.value={...x.value||{},[be]:!0}},he=be=>!!(x.value||{})[be],H=async be=>{const me=n[be]||[];if(!me.length)return P(be,null),!0;const de=S(be),ce={name:be,value:de,model:w(),form:_e};for(const $ of me){if(!$)continue;const le=await JSswift.form._runRule($,de,ce);if(le)return P(be,le),!1}return P(be,null),!0},W=async()=>{r.value=null;const be=Object.keys(n);let me=!0;for(const de of be)await H(de)||(me=!1);return me},_e={model:e,errors:c,touched:x,submitting:d,submitError:r,getValue:S,setValue:b,getError:re,setError:P,touch:Z,isTouched:he,field:(be,me={})=>{var V;const de=_.rod("");(V=de.action)==null||V.call(de,ie=>{b(be,ie)});const ce=()=>s==="submit"||s==="input"||s==="blur"?!0:he(be);let $=null,le=!1,oe=!1;const Se=async()=>{le||(le=!0,Z(be),(s==="blur"||s==="input")&&await H(be),setTimeout(()=>{le=!1},0))},L=ie=>{$&&($===ie.target||$.contains&&$.contains(ie.target)||(Se(),$=null,oe&&(oe=!1,document.removeEventListener("pointerdown",L,!0))))},m=()=>{oe||(oe=!0,document.addEventListener("pointerdown",L,!0))},h=async()=>{$=document.activeElement,le=!1,m(),s==="input"&&await H(be)},p=async()=>{await Se(),$=null,oe&&(oe=!1,document.removeEventListener("pointerdown",L,!0))};return{name:be,model:de,get value(){return de.value},set value(ie){de.value=ie},error:()=>ce()?re(be):null,success:me.success||null,warning:me.warning||null,note:me.note||null,touch:()=>Z(be),validate:()=>H(be),onInput:h,onBlur:p,hint:me.hint||null}},validateField:H,validate:W,reset:()=>{r.value=null,c.value={},x.value={},i&&F({...i||{}})},submit:async be=>{d.value=!0,r.value=null;try{return await W()?{ok:!0,result:await(be==null?void 0:be(w(),_e))}:{ok:!1,reason:"validation"}}catch(me){return console.error("[useForm] submit error:",me),r.value=me&&me.message?me.message:String(me),{ok:!1,reason:"exception",error:me}}finally{d.value=!1}}};return _e},Ne.Form=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.form,i=e.onSubmit,c=te(["cms-form",e.class]),x=JSswift.omit(e,["form","onSubmit"]);x.class=c;const d=_.form({...x,onSubmit:async w=>{w.preventDefault(),s&&await s.submit(i||(async()=>{}))}}),r=[];for(const w of n||[]){const F=typeof w=="function"?w(s):w,S=JSswift.ui.slot(F);S&&(Array.isArray(S)?r.push(...S):r.push(S))}return r.forEach(w=>d.appendChild(w)),s&&s.submitting&&JSswift.reactive.effect(()=>{d.classList.toggle("is-submitting",!!s.submitting.value)},"UI.Form:submitting"),d},bt.services=bt.services||{},bt.services.dialog=bt.services.dialog||{},bt.dialog=bt.services.dialog;let ks=null;function si(){return ks||(ks=document.createElement("div"),ks.setAttribute("data-cms-modal-root","true"),document.body.appendChild(ks),ks)}Ne.cardHeader=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=te(["cms-card-header",ye(e.divider,"divider"),e.class]),c=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);c.class=i;const x={...e.style||{}},d=Ke(e.align);d!=null&&!Ze(e,"align")&&(x.alignItems=d);const r=Ke(e.justify);r!=null&&!Ze(e,"justify")&&(x.justifyContent=r);const w=Ke(e.wrap,P=>P?"wrap":"nowrap");w!=null&&!Ze(e,"wrap")&&(x.flexWrap=w);const F=Ke(e.direction);F!=null&&!Ze(e,"direction")&&(x.flexDirection=F);const S=Ke(e.gap,mt);S!=null&&!Ze(e,"gap")&&(x.gap=S),Object.keys(x).length&&(c.style=x),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const b=_.div(c,...J(s,"default",{},n));return Nt(b,e),b},Ne.cardBody=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=te(["cms-card-body",e.class]),c=JSswift.omit(e,["slots","display","direction","wrap","align","justify","gap","rowGap","columnGap","padding","width"]);c.class=i,JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const x=_.div(c,...J(s,"default",{},n));return Nt(x,e),x},Ne.cardFooter=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=te(["cms-card-footer",ye(e.divider,"divider"),e.class]),c=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);c.class=i;const x={...e.style||{}},d=Ke(e.align);d!=null&&!Ze(e,"align")&&(x.alignItems=d);const r=Ke(e.justify);r!=null&&!Ze(e,"justify")&&(x.justifyContent=r);const w=Ke(e.wrap,P=>P?"wrap":"nowrap");w!=null&&!Ze(e,"wrap")&&(x.flexWrap=w);const F=Ke(e.direction);F!=null&&!Ze(e,"direction")&&(x.flexDirection=F);const S=Ke(e.gap,mt);S!=null&&!Ze(e,"gap")&&(x.gap=S),Object.keys(x).length&&(c.style=x),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const b=_.div(c,...J(s,"default",{},n));return Nt(b,e),b},Ne.Dialog=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],c=["xs","sm","md","lg","xl","full"];let x={...e},d=null,r=null;const w=(m,h)=>typeof m=="function"?m(h):m,F=m=>String(m||"").split(/\s+/).filter(Boolean),S=(m,h,p)=>{if(!m)return;const V=m[h]||[];V.length&&m.classList.remove(...V);const ie=(p||[]).filter(Boolean);ie.length&&m.classList.add(...ie),m[h]=ie},b=(m,h,p,V=ie=>ie)=>{if(m){if(p==null||p===""){m.style.removeProperty(h);return}m.style.setProperty(h,V(p))}},P=()=>{var a,C,g,M,Y,Q;const m=window.visualViewport,h=Math.max(0,Math.round((a=m==null?void 0:m.offsetLeft)!=null?a:0)),p=Math.max(0,Math.round((C=m==null?void 0:m.offsetTop)!=null?C:0)),V=Math.max(0,Math.round((M=(g=m==null?void 0:m.width)!=null?g:window.innerWidth)!=null?M:0)),ie=Math.max(0,Math.round((Q=(Y=m==null?void 0:m.height)!=null?Y:window.innerHeight)!=null?Q:0));return{left:h,top:p,width:V,height:ie}},re=m=>{if(!(m!=null&&m.panel))return;const{left:h,top:p,width:V,height:ie}=P();b(m.panel,"position","fixed"),b(m.panel,"inset",0,a=>`${a}px`),b(m.panel,"top",p,a=>`${a}px`),b(m.panel,"left",h,a=>`${a}px`),b(m.panel,"right","auto"),b(m.panel,"bottom","auto"),b(m.panel,"width",V,a=>`${a}px`),b(m.panel,"height",ie,a=>`${a}px`),b(m.panel,"min-height",ie,a=>`${a}px`),b(m.panel,"max-width",V,a=>`${a}px`),b(m.panel,"max-height",ie,a=>`${a}px`),b(m.panel,"min-width",0,a=>`${a}px`),b(m.panel,"margin",0,a=>`${a}px`),b(m.panel,"box-sizing","border-box"),b(m.panel,"border-width",0,a=>`${a}px`),b(m.panel,"border-radius",0,a=>`${a}px`),b(m.panel,"transform","none"),b(m.panel,"overflow","hidden"),b(m.panel,"--cms-dialog-fullscreen-left",h,a=>`${a}px`),b(m.panel,"--cms-dialog-fullscreen-top",p,a=>`${a}px`),b(m.panel,"--cms-dialog-fullscreen-width",V,a=>`${a}px`),b(m.panel,"--cms-dialog-fullscreen-height",ie,a=>`${a}px`)},Z=m=>{m!=null&&m.panel&&(b(m.panel,"position",null),b(m.panel,"inset",null),b(m.panel,"top",null),b(m.panel,"left",null),b(m.panel,"right",null),b(m.panel,"bottom",null),b(m.panel,"width",null),b(m.panel,"height",null),b(m.panel,"min-height",null),b(m.panel,"max-width",null),b(m.panel,"max-height",null),b(m.panel,"min-width",null),b(m.panel,"margin",null),b(m.panel,"box-sizing",null),b(m.panel,"border-width",null),b(m.panel,"border-radius",null),b(m.panel,"transform",null),b(m.panel,"overflow",null),b(m.panel,"--cms-dialog-fullscreen-left",null),b(m.panel,"--cms-dialog-fullscreen-top",null),b(m.panel,"--cms-dialog-fullscreen-width",null),b(m.panel,"--cms-dialog-fullscreen-height",null))},he=(m,h)=>{var g,M,Y,Q,ve;if(!m)return;if((g=m._dialogViewportCleanup)==null||g.call(m),m._dialogViewportCleanup=null,!h){Z(m);return}let p=null;const V=globalThis.requestAnimationFrame||(N=>setTimeout(()=>N(Date.now()),0)),ie=globalThis.cancelAnimationFrame||clearTimeout,a=()=>re(m),C=()=>{p!=null&&ie(p),p=V(()=>{p=null,a()})};a(),C(),window.addEventListener("resize",a),window.addEventListener("orientationchange",C),(Y=(M=window.visualViewport)==null?void 0:M.addEventListener)==null||Y.call(M,"resize",a),(ve=(Q=window.visualViewport)==null?void 0:Q.addEventListener)==null||ve.call(Q,"scroll",C),m._dialogViewportCleanup=()=>{var N,f,A,z;p!=null&&(ie(p),p=null),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",C),(f=(N=window.visualViewport)==null?void 0:N.removeEventListener)==null||f.call(N,"resize",a),(z=(A=window.visualViewport)==null?void 0:A.removeEventListener)==null||z.call(A,"scroll",C)}},H=()=>x,W=m=>{var p;const h=o((p=m.state)!=null?p:m.color);return h?i.includes(h)?h:String(h):""},se=m=>{const h=o(m.size);return typeof h=="string"&&c.includes(h)?h:""},X=m=>{var p,V,ie;const h=String(o((ie=(V=(p=m.actionsAlign)!=null?p:m.footerAlign)!=null?V:m.alignActions)!=null?ie:"end")).toLowerCase();return["start","left"].includes(h)?"start":["center","middle"].includes(h)?"center":["between","space-between"].includes(h)?"between":["stretch","full"].includes(h)?"stretch":"end"},fe=m=>{var p,V,ie;const h=String(o((ie=(V=(p=m.align)!=null?p:m.verticalAlign)!=null?V:m.position)!=null?ie:"center")).toLowerCase();return["top","start","flex-start"].includes(h)?"cms-dialog-align-top":["bottom","end","flex-end"].includes(h)?"cms-dialog-align-bottom":""},_e=m=>{var p,V;return((V=(p=m.closable)!=null?p:m.dismissible)!=null?V:m.closeButton)!==!1},be=()=>{var K,ke,Me,Te,U,j,ne,Ve;const m=H(),h={close:le,dismiss:le,open:$,toggle:Se,update:ce,isOpen:oe,entry:()=>d,props:m},p=m.icon!=null?typeof m.icon=="string"?Ne.Icon({name:m.icon,size:m.iconSize||"md"}):JSswift.ui.slot(m.icon,{as:"icon"}):null,V=J(s,"eyebrow",h,w(m.eyebrow,h)),ie=J(s,"title",h,w((ke=(K=m.title)!=null?K:m.heading)!=null?ke:m.header,h)),a=J(s,"subtitle",h,w((Me=m.subtitle)!=null?Me:m.description,h)),C=J(s,"icon",h,p),g=J(s,"header",h,w((Te=m.headerContent)!=null?Te:m.head,h)),M=_e(m)?J(s,"close",h,Ne.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":m.closeLabel||"Chiudi dialog","data-dialog-close":!0},Ne.Icon({name:m.closeIcon||"close",size:"sm"}))):[],Y=(ne=(j=(U=m.content)!=null?U:m.body)!=null?j:m.message)!=null?ne:n&&n.length?n:null;let Q=J(s,"content",h,w(Y,h));Q.length||(Q=J(s,"body",h,w(Y,h))),Q.length||(Q=J(s,"default",h,w(Y,h)));const ve=w((Ve=m.footer)!=null?Ve:m.actions,h);let N=J(s,"footer",h,ve);N.length||(N=J(s,"actions",h,ve));let f=null;g.length?f=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...g):(V.length||ie.length||a.length||C.length||M.length)&&(f=_.div({class:"cms-dialog-head"},C.length?_.div({class:"cms-dialog-icon"},...C):null,_.div({class:"cms-dialog-head-main"},V.length?_.div({class:"cms-dialog-eyebrow"},...V):null,ie.length?_.div({class:"cms-dialog-title"},...ie):null,a.length?_.div({class:"cms-dialog-subtitle"},...a):null),M.length?_.div({class:"cms-dialog-close-wrap"},...M):null));const A=_.div({class:te(["cms-dialog-body",m.bodyClass])},...Q),z=N.length?_.div({class:te(["cms-dialog-actions",`is-${X(m)}`,ye(m.stackActions,"is-stacked"),m.actionsClass,m.footerClass])},...N):null;return _.div({class:te(["cms-dialog-shell",ye(!!f,"has-head"),ye(!!z,"has-footer"),ye(m.divider!==!1,"with-divider")])},...[f,A,z].filter(Boolean))},me=m=>{var ie;if(!(m!=null&&m.panel))return;const h=H(),p=W(h),V=se(h);S(m.panel,"_dialogClassTokens",["cms-dialog","cms-singularity","cms-clear-set",V?`cms-dialog-${V}`:"",p,p?`cms-state-${p}`:"",o(h.fullscreen)?"fullscreen":"",o(h.scrollable)?"scrollable":"",o(h.stickyHeader)?"sticky-head":"",o(h.stickyActions)?"sticky-actions":"",o(h.borderless)?"borderless":"",...F(h.class),...F(h.panelClass)]),S(m.overlay,"_dialogOverlayClassTokens",[fe(h),o(h.backdropBlur)?"cms-dialog-overlay-blur":"",...F(h.overlayClass)]),b(m.panel,"--cms-dialog-width",o(h.width),mt),b(m.panel,"--cms-dialog-min-width",o(h.minWidth),mt),b(m.panel,"--cms-dialog-max-width",o(h.maxWidth),mt),b(m.panel,"--cms-dialog-max-height",o(h.maxHeight),mt),b(m.panel,"--cms-dialog-body-max-height",o((ie=h.bodyMaxHeight)!=null?ie:h.contentMaxHeight),mt),h.style&&Object.assign(m.panel.style,h.style),Nt(m.panel,h),he(m,o(h.fullscreen)),m.panel.setAttribute("role",h.role||"dialog"),m.panel.setAttribute("aria-modal",h.modal===!1?"false":"true"),h.ariaLabel?m.panel.setAttribute("aria-label",h.ariaLabel):m.panel.removeAttribute("aria-label")},de=()=>{d!=null&&d.panel&&d.panel.replaceChildren(be())},ce=(m={})=>(m&&typeof m=="object"&&(x={...x,...m}),d&&(me(d),de()),L),$=(m=null)=>{var ie,a,C,g,M;if(m&&typeof m=="object"&&(x={...x,...m}),d)return me(d),de(),d;r=document.activeElement;const h=H(),p=h.persistent===!0;d=JSswift.overlay.open(()=>be(),{type:"dialog",backdrop:h.backdrop!==!1,lockScroll:h.lockScroll!==!1,trapFocus:h.trapFocus!==!1,autoFocus:h.autoFocus!==!1,closeOnOutside:(ie=h.closeOnOutside)!=null?ie:!p,closeOnBackdrop:(a=h.closeOnBackdrop)!=null?a:!p,closeOnEsc:(C=h.closeOnEsc)!=null?C:!p,className:qt(["cms-dialog"]),onClose:()=>{var Y,Q,ve,N;(Y=d==null?void 0:d._dialogViewportCleanup)==null||Y.call(d),(Q=d==null?void 0:d.panel)==null||Q.removeEventListener("click",V),d=null,(N=(ve=H()).onClose)==null||N.call(ve),r&&typeof r.focus=="function"&&setTimeout(()=>r.focus(),0)}});const V=Y=>{const Q=Y.target;Q&&Q.closest&&Q.closest("[data-dialog-close]")&&le()};return d.panel.addEventListener("click",V),me(d),xs(d),(M=(g=H()).onOpen)==null||M.call(g,d),d},le=()=>{if(!d)return;const m=d;_s(m,()=>JSswift.overlay.close(m.id))},oe=()=>!!d,Se=(m=null)=>oe()?(le(),null):$(m),L={open:$,close:le,toggle:Se,update:ce,isOpen:oe,entry:()=>d,props:()=>({...x})};return L},Ne.TabPanel=(...t)=>{var He,ae,$e,Ee,De,Ie,qe,Be,T,Pe,O,k,v;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Array.isArray(e.tabs)?e.tabs:Array.isArray(e.items)?e.items:[],c=Zt(e.model,"UI.TabPanel:model"),x=e.id||"cms-tabpanel-"+Math.random().toString(36).slice(2,9),d=u=>String(o(u)||"vertical").toLowerCase()==="horizontal"?"horizontal":"vertical",r=u=>String(o(u)||"before").toLowerCase()==="after"?"after":"before",w=u=>{const I=String(o(u)||"").toLowerCase();return I==="pills"||I==="pill"?"pills":I==="soft"||I==="card"?"soft":"line"},F=u=>{const I=o(u);return I==null||I===""?null:JSswift.uiColors.includes(I)?`var(--cms-${I})`:String(I)},S=d(e.orientation||e.orient||e.direction),b=r(e.navPosition||e.barPosition||e.position),P=w(e.variant||(e.pills?"pills":e.soft?"soft":"line")),re=!!e.wrap,Z=!!e.swipeable,he=!!e.infinite,H=!!e.animated,W=!!((ae=(He=e.navFill)!=null?He:e.fill)!=null?ae:e.stretch),se=!!e.disabled,X=o(($e=e.transitionDuration)!=null?$e:e["transition-duration"]),fe=(()=>{if(X==null)return 220;if(typeof X=="number")return X;const u=parseFloat(X);return Number.isFinite(u)?u:220})(),_e=o((Ee=e.transitionEasing)!=null?Ee:e["transition-easing"])||"ease",be=(Ie=(De=e.transitionPrev)!=null?De:e["transition-prev"])!=null?Ie:null,me=(Be=(qe=e.transitionNext)!=null?qe:e["transition-next"])!=null?Be:null,de=F((T=e.color)!=null?T:e.state),ce=i.map((u,I)=>{var dt,St,It,Rt,Pt,st,wt,Ft,Dt,Yt,Xt,on,jt,Qt,cn,hn;if(u==null)return null;if(typeof u!="object")return{name:u,labelFallback:u,panelFallback:null,noteFallback:null,iconFallback:null,badgeFallback:null,hidden:!1,raw:u,index:I};const xe=(st=(Pt=(Rt=(It=(St=(dt=u.name)!=null?dt:u.value)!=null?St:u.id)!=null?It:u.key)!=null?Rt:u.label)!=null?Pt:u.title)!=null?st:`tab-${I}`,Ue=u.label!=null||u.title!=null,et=Ue?(wt=u.label)!=null?wt:u.title:u.children!=null&&u.content==null&&u.panel==null?u.children:(Dt=(Ft=u.name)!=null?Ft:u.value)!=null?Dt:`Tab ${I+1}`,G=(on=(Xt=(Yt=u.content)!=null?Yt:u.panel)!=null?Xt:u.body)!=null?on:Ue?u.children:null,Ge=(cn=(Qt=(jt=u.note)!=null?jt:u.subtitle)!=null?Qt:u.description)!=null?cn:null,lt=(hn=u.icon)!=null?hn:null,tt=Object.prototype.hasOwnProperty.call(u,"badge")?u.badge:Object.prototype.hasOwnProperty.call(u,"counter")?u.counter:null;return{...u,name:xe,labelFallback:et,panelFallback:G,noteFallback:Ge,iconFallback:lt,badgeFallback:tt,index:I}}).filter(Boolean).filter(u=>u.hidden!==!0&&u.visible!==!1),$=te(["cms-clear-set","cms-tabpanel","cms-singularity",S,`variant-${P}`,ye(re,"wrap"),ye(H,"animated"),ye(W,"nav-fill"),ye(se,"disabled"),ye(b==="after","nav-after"),e.class]),le=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"]);le.class=$,le.style=e.style;const oe=_.div(le);H&&(oe.style.setProperty("--cms-tabpanel-duration",`${fe}ms`),oe.style.setProperty("--cms-tabpanel-easing",_e)),de&&oe.style.setProperty("--cms-tabpanel-accent",de);const Se=_.div({class:te(["cms-tabpanel-nav",e.navClass]),role:"tablist","aria-orientation":S}),L=_.div({class:te(["cms-tabpanel-panels",e.panelsClass])}),m=[],h=[];let p=-1;const V=()=>S==="horizontal",ie=(u,I,xe)=>({tab:u,name:u.name,index:I,active:xe,value:u.name,select:()=>Me(I),next:()=>U(),prev:()=>j()}),a=(u,I,xe=!1)=>{var et;if(!ce.length)return-1;let Ue=u;for(let G=0;G<ce.length;G+=1){if(Ue+=I,Ue>=ce.length){if(!xe)return-1;Ue=0}else if(Ue<0){if(!xe)return-1;Ue=ce.length-1}if(!((et=ce[Ue])!=null&&et.disabled))return Ue}return-1},C=u=>{var xe;const I=(xe=m[u])==null?void 0:xe.btn;!I||typeof I.focus!="function"||requestAnimationFrame(()=>I.focus())},g=(u,I,xe)=>{const Ue=ie(u,I,xe),et=JSswift.ui.renderSlot(s,"label",Ue,u.labelFallback);return J(null,"default",{},et)},M=(u,I)=>{var Ft,Dt,Yt,Xt,on;const xe=I===p,Ue=`${x}-tab-${I}`,et=`${x}-panel-${I}`,G=ie(u,I,xe),Ge=g(u,I,xe),lt=u.iconFallback!=null?typeof u.iconFallback=="string"?Ne.Icon({name:u.iconFallback,size:(Yt=(Dt=(Ft=u.iconSize)!=null?Ft:u.size)!=null?Dt:e.size)!=null?Yt:null}):u.iconFallback:null,tt=J(s,"icon",G,lt),dt=J(s,"note",G,u.noteFallback),St=J(s,"badge",G,u.badgeFallback),It=_.span({class:"cms-tabpanel-tab-inner"},tt.length?_.span({class:"cms-tabpanel-tab-icon"},...tt):null,_.span({class:"cms-tabpanel-tab-copy"},_.span({class:"cms-tabpanel-tab-label"},...Ge.length?Ge:[""]),dt.length?_.span({class:"cms-tabpanel-tab-note"},...dt):null),St.length?_.span({class:"cms-tabpanel-tab-badge"},...St):null),Rt=J(s,"tab",{...G,label:Ge,icon:tt,note:dt,badge:St,tabId:Ue,panelId:et},It),Pt=jt=>{if(se||u.disabled)return;const Qt=jt.key;if(Qt==="Enter"||Qt===" "){jt.preventDefault(),Me(I);return}if(Qt==="Home"){jt.preventDefault();const Gt=ce.findIndex(Tn=>!Tn.disabled);Gt>=0&&(Me(Gt),C(Gt));return}if(Qt==="End"){jt.preventDefault();const Gt=(()=>{var Tn;for(let An=ce.length-1;An>=0;An-=1)if(!((Tn=ce[An])!=null&&Tn.disabled))return An;return-1})();Gt>=0&&(Me(Gt),C(Gt));return}const cn=V()?["ArrowLeft"]:["ArrowUp"],hn=V()?["ArrowRight"]:["ArrowDown"];if(cn.includes(Qt)){jt.preventDefault();const Gt=a(I,-1,he);Gt>=0&&(Me(Gt,{dir:"prev"}),C(Gt));return}if(hn.includes(Qt)){jt.preventDefault();const Gt=a(I,1,he);Gt>=0&&(Me(Gt,{dir:"next"}),C(Gt))}},st=Ne.Btn({class:te(["cms-tabpanel-tab",ye(xe,"active"),ye(u.disabled||se,"disabled"),e.tabClass,u.tabClass||u.class]),type:"button",id:Ue,role:"tab",disabled:!!(u.disabled||se),"aria-selected":xe?"true":"false","aria-controls":et,tabindex:xe?"0":"-1",outline:P==="pills"&&!xe,color:P==="pills"&&xe?u.color||e.color||e.state||"primary":null,size:(on=(Xt=u.size)!=null?Xt:e.size)!=null?on:null,style:{...e.tabStyle||{},...u.tabStyle||{}},onClick:()=>{u.disabled||se||Me(I)},onKeydown:Pt},...Rt),wt=_.div({class:te(["cms-tabpanel-nav-btn",ye(xe,"active"),u.navClass]),"data-name":u.name},st,_.span({class:"tab-indicator"}));return m[I]={btn:st,wrap:wt,index:I},wt},Y=(u,I)=>{const xe=I===p,Ue=`${x}-tab-${I}`,et=`${x}-panel-${I}`,G=ie(u,I,xe),Ge=JSswift.ui.renderSlot(s,"panel",G,u.panelFallback),lt=_.div({class:te(["cms-tabpanel-panel",ye(xe,"active"),e.panelClass,u.panelClass]),style:{...e.panelStyle||{},...u.panelStyle||{}},"data-name":u.name,role:"tabpanel",id:et,tabindex:0,"aria-labelledby":Ue,"aria-hidden":xe?"false":"true"},...J(null,"default",{},Ge));return h[I]=lt,lt},Q=ce.map((u,I)=>M(u,I)),ve=JSswift.ui.renderSlot(s,"nav",{tabs:ce,active:()=>{var u;return p>=0?(u=ce[p])==null?void 0:u.name:null},activeIndex:()=>p,activeTab:()=>p>=0?ce[p]:null,select:u=>{typeof u=="number"?Me(u):Te(u)},next:()=>U(),prev:()=>j(),nodes:Q,orientation:S,position:b,variant:P},Q);J(null,"default",{},ve).forEach(u=>Se.appendChild(u)),ce.length?ce.forEach((u,I)=>L.appendChild(Y(u,I))):J(s,"empty",{tabs:ce},(Pe=e.empty)!=null?Pe:_.div({class:"cms-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(I=>L.appendChild(I));const N=u=>{if(!H)return;const I=u==="next"?"18px":"-18px",xe=u==="next"?"-18px":"18px";oe.style.setProperty("--cms-tabpanel-enter",I),oe.style.setProperty("--cms-tabpanel-leave",xe)},f=()=>{const u=[];be&&u.push(...String(be).split(/\s+/)),me&&u.push(...String(me).split(/\s+/)),u.length&&L.classList.remove(...u.filter(Boolean))},A=u=>{f();const I=u==="prev"?be:me;if(!I)return;const xe=String(I).split(/\s+/).filter(Boolean);xe.length&&(L.classList.add(...xe),setTimeout(()=>L.classList.remove(...xe),fe+40))},z=u=>{var Ue;const I=m.find(({btn:et})=>et.classList.contains("active")),xe=(Ue=I==null?void 0:I.btn.parentNode)==null?void 0:Ue.getBoundingClientRect();m.forEach(({btn:et,index:G})=>{const Ge=G===u,lt=et.parentNode;if(!lt)return;const tt=lt.getBoundingClientRect();lt.isConnected&&xe&&(lt.style.setProperty("--nav-pos-x",xe.left-tt.left+"px"),lt.style.setProperty("--nav-pos-y",xe.top-tt.top+"px")),lt.classList.toggle("active",Ge),et.classList.toggle("active",Ge),et.setAttribute("aria-selected",Ge?"true":"false"),et.setAttribute("tabindex",Ge?"0":"-1")})},K=(u,I,xe)=>{N(xe),h.forEach((Ue,et)=>{if(!Ue)return;const G=et===I,Ge=et===u;G?(Ue.classList.add("active"),Ue.classList.remove("leaving"),Ue.setAttribute("aria-hidden","false")):(Ue.classList.remove("active"),Ue.setAttribute("aria-hidden","true"),H&&Ge?(Ue.classList.add("leaving"),setTimeout(()=>Ue.classList.remove("leaving"),fe+40)):Ue.classList.remove("leaving"))})},ke=(u,I)=>u<0||u===I||he&&u===ce.length-1&&I===0?"next":he&&u===0&&I===ce.length-1?"prev":I>u?"next":"prev",Me=(u,I={})=>{var G,Ge;if(u==null||u<0||u>=ce.length||(G=ce[u])!=null&&G.disabled)return;const xe=p;if(xe===u)return;p=u;const Ue=ce[u],et=I.dir||ke(xe,u);c&&!I.fromModel&&c.set(Ue.name),z(u),K(xe,u,et),A(et),oe.dataset.active=String(Ue.name),(Ge=e.onChange)==null||Ge.call(e,Ue.name,Ue,u)},Te=(u,I={})=>{if(!ce.length)return;const xe=ce.findIndex(Ue=>Ue.name==u);xe!==-1&&Me(xe,I)},U=()=>{if(!ce.length)return;const u=p<0?ce.findIndex(I=>!I.disabled):a(p,1,he);u<0||Me(u,{dir:"next"})},j=()=>{if(!ce.length)return;const u=p<0?(()=>{var I;for(let xe=ce.length-1;xe>=0;xe-=1)if(!((I=ce[xe])!=null&&I.disabled))return xe;return-1})():a(p,-1,he);u<0||Me(u,{dir:"prev"})};if(Z){let u=0,I=0,xe=!1;const Ue=42;L.addEventListener("pointerdown",et=>{et.button!=null&&et.button!==0||(xe=!0,u=et.clientX,I=et.clientY)}),L.addEventListener("pointerup",et=>{if(!xe)return;xe=!1;const G=et.clientX-u,Ge=et.clientY-I;Math.abs(G)<Ue||Math.abs(G)<Math.abs(Ge)||(G<0?U():j())}),L.addEventListener("pointercancel",()=>{xe=!1}),L.addEventListener("pointerleave",()=>{xe=!1})}const ne=c?c.get():(v=(k=(O=e.value)!=null?O:e.defaultValue)!=null?k:e.default)!=null?v:null;if(ce.length){const u=ce.findIndex(I=>I.name==ne);if(u>=0)Me(u,{fromModel:!0});else{const I=ce.findIndex(xe=>!xe.disabled);I>=0&&(Me(I,{fromModel:!0}),c&&c.set(ce[I].name))}}return c&&c.watch(u=>Te(u,{fromModel:!0}),"UI.TabPanel:watch"),b==="after"?(oe.appendChild(L),oe.appendChild(Se)):(oe.appendChild(Se),oe.appendChild(L)),J(s,"default",{},n).forEach(u=>oe.appendChild(u)),Nt(oe,e),oe._tabs=()=>ce.slice(),oe._active=()=>p>=0?ce[p]:null,oe._getValue=()=>{var u;return p>=0?(u=ce[p])==null?void 0:u.name:null},oe._setValue=u=>Te(u),oe._select=u=>{typeof u=="number"?Me(u):Te(u)},oe._next=U,oe._prev=j,oe};function Xi(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ro({title:t,message:e,contentNode:n,okText:s,cancelText:i,showCancel:c,onOk:x,onCancel:d,persistent:r}){si();const w=_.div({class:"cms-dialog-backdrop",onClick:Z=>{Z.target===w&&r!==!0&&(d==null||d())}}),F=J(null,"default",{},t),S=J(null,"default",{},e),b=J(null,"default",{},n),P=_.div({class:"cms-dialog cms-panel"},F.length?_.h3(...F):null,S.length?_.p(...S):null,...b,_.div({class:"cms-dialog-actions"},c?JSswift.ui.Btn({onClick:d},i||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:x},s||"OK")));w.appendChild(P),si().appendChild(w);const re=Z=>{Z.key==="Escape"&&(d==null||d())};return document.addEventListener("keydown",re,{once:!0}),{backdrop:w,close:()=>Xi(w)}}bt.dialog.alert=function(t,e={}){return new Promise(n=>{const{backdrop:s,close:i}=Ro({title:e.title||"Info",message:t,okText:e.okText||"OK",showCancel:!1,persistent:e.persistent,onOk:()=>{i(),n(!0)},onCancel:()=>{i(),n(!0)}})})},bt.dialog.confirm=function(t={}){return new Promise(e=>{const{close:n}=Ro({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)}})})},bt.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}=Ro({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)})},bt.services=bt.services||{},bt.services.loading=bt.services.loading||{},bt.loading=bt.services.loading;let mn=null,Ds=0;function oi(){if(mn)return mn;mn=document.createElement("div"),mn.className="cms-loading-backdrop",mn.style.cssText=`
|
|
2
2
|
position: fixed; inset: 0;
|
|
3
3
|
background: rgba(0,0,0,0.45);
|
|
4
4
|
display: none;
|
|
@@ -29,6 +29,6 @@ height: 100%;
|
|
|
29
29
|
width: 0%;
|
|
30
30
|
background: var(--cms-primary);
|
|
31
31
|
transition: width 200ms ease;
|
|
32
|
-
`,s.appendChild(i);const
|
|
32
|
+
`,s.appendChild(i);const c=document.createElement("div");c.style.cssText="display:flex; gap: 12px; align-items:center; width: 100%;",c.appendChild(e),c.appendChild(n),t.appendChild(c),t.appendChild(s),mn.appendChild(t),document.body.appendChild(mn);const x=document.createElement("style");return x.textContent=`
|
|
33
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);
|
|
34
|
+
`,document.head.appendChild(x),mn._textNode=n,mn._spinner=e,mn._progressWrap=s,mn._progressBar=i,mn._progressActive=!1,mn}function ii(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 li(t,e){const n=e==="progress";t._spinner.style.display=n?"none":"",t._progressWrap.style.display=n?"block":"none",t._mode=e}bt.loading.show=function(t="Loading...",e={}){const n=oi(),s=ii(t,e);Ds++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",li(n,"spinner"),s.spinner===!1&&(n._spinner.style.display="none"),n.style.display="flex"},bt.loading.hide=function(){mn&&(Ds=Math.max(0,Ds-1),Ds===0&&(mn.style.display="none",mn._progressActive=!1))},bt.loading.progress=function(t=0,e={}){var c;const n=oi();typeof t=="object"&&t!==null&&(e=t,t=(c=t.value)!=null?c:0);const s=ii(null,e);n._progressActive||(Ds++,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+"%",li(n,"progress"),n.style.display="flex"},bt.loading.wrap=async function(t,e){bt.loading.show(t);try{return await e()}finally{bt.loading.hide()}};function Qi(t){return typeof t=="function"?t():t||[]}function Mo(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 Zi(t,e){return t==null&&e==null?0:t==null?-1:e==null?1:typeof t=="number"&&typeof e=="number"?t-e:String(t).localeCompare(String(e),void 0,{numeric:!0,sensitivity:"base"})}function el(t){const e=Qi(t);return Array.isArray(e)?e:[]}function ri(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 Oo(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 ai(t,e){return t.find((n,s)=>Oo(n,s)===e||(n==null?void 0:n.key)===e)||null}function wo(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"?Mo(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function vo(t,e){return typeof t=="function"?t(e)||{}:t||{}}function So(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(So).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 tl(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 nl(t,e,n,s){const i=s.searchBy||s.searchPredicate;if(typeof i=="function")return!!i(t,{query:n,columns:e});const c=String(n||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(!c.length)return!0;const x=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(w=>(w==null?void 0:w.searchable)!==!1).map(w=>{var F;return(F=w==null?void 0:w.searchKey)!=null?F:w==null?void 0:w.key}).filter(Boolean),d=[];if(x.length)for(const w of x)if(typeof w=="function")d.push(So(w(t)));else{const F=e.find(S=>(S==null?void 0:S.key)===w||(S==null?void 0:S.searchKey)===w);d.push(So(F?wo(F,t,-1):Mo(t,w)))}else d.push(So(t));const r=d.join(" ").toLowerCase();return c.every(w=>r.includes(w))}Ne.Table=(...t)=>{var He,ae,$e,Ee;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Array.isArray(e.columns)?e.columns:[],c=tl(e.pageSizeOptions,[5,10,20,50]),x=Number((ae=(He=e.pageSize)!=null?He:c[0])!=null?ae:10)||10,d=Array.from(new Set([...c,x])).sort((De,Ie)=>De-Ie),r=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",F=Zt(e.searchModel||e.queryModel,"UI.Table:query"),[S,b]=bt.reactive.signal(Math.max(1,Number(e.page||1)||1)),[P,re]=bt.reactive.signal(x),[Z,he]=bt.reactive.signal(r),[H,W]=bt.reactive.signal(String((Ee=F?F.get():($e=e.search)!=null?$e:e.query)!=null?Ee:"")),se=De=>{const Ie=String(De!=null?De:"");W(Ie),F&&F.set(Ie),b(1)},X=De=>{const Ie=Number(De)||x;re(Ie),b(1)},fe=(De,Ie)=>{const qe=Oo(De,Ie),Be=Z();!Be||Be.key!==qe&&Be.key!==(De==null?void 0:De.key)?he({key:qe,dir:"asc"}):Be.dir==="asc"?he({key:qe,dir:"desc"}):he(null),b(1)};let _e=null;F&&F.watch(De=>{const Ie=String(De!=null?De:"");W(Ie),_e&&_e.value!==Ie&&(_e.value=Ie),b(1)},"UI.Table:queryWatch");const be=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"]);be.class=te(["cms-table-card",e.class,e.cardClass]),e.dense!=null&&(be.dense=e.dense);const me=_.div({class:"cms-table-shell"}),de=J(s,"default",{},n);de.length&&me.appendChild(_.div({class:"cms-table-lead"},...de));const ce=J(s,"toolbarStart",{},e.toolbarStart),$=J(s,"toolbar",{},e.toolbar),le=J(s,"toolbarEnd",{},e.toolbarEnd),oe=_.div({class:"cms-table-toolbar"}),Se=_.div({class:"cms-table-toolbar-main"}),L=_.div({class:"cms-table-toolbar-side"});ce.forEach(De=>Se.appendChild(De)),$.forEach(De=>Se.appendChild(De));const m=J(s,"search",{query:H(),getQuery:H,setQuery:se},null);if(m.length)m.forEach(De=>L.appendChild(De));else if(w){_e=_.input({type:"search",class:"cms-input",placeholder:typeof e.searchable=="string"?e.searchable:e.searchPlaceholder||"Cerca nella tabella",value:String(H()||"")}),_e.addEventListener("input",()=>se(_e.value));const De=Ne.Btn({class:"cms-table-search-clear",outline:!0,onClick:()=>{_e&&(_e.value=""),se("")}},"Reset");L.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),_e,De))}le.forEach(De=>L.appendChild(De)),(Se.childNodes.length||L.childNodes.length)&&(oe.appendChild(Se),oe.appendChild(L),me.appendChild(oe));const h=_.div({class:"cms-singularity cms-table-chip"},""),p=_.div({class:"cms-singularity cms-table-chip"},""),V=_.div({class:"cms-singularity cms-table-chip"},""),ie=J(s,"status",{},e.status),a=_.div({class:"cms-table-status"},h,p,V,...ie);me.appendChild(a);const C=J(s,"caption",{},e.caption);C.length&&me.appendChild(_.div({class:"cms-table-caption"},...C));const g=_.thead(),M=_.tbody(),Y=!!e.actions||!!s.actions,Q=te(["cms-table",ye(e.dense,"dense"),ye(e.striped,"striped"),ye(e.hover!==!1,"hover"),ye(e.stickyHeader!==!1,"sticky-head"),e.tableClass]),ve={...e.tableStyle||{}};e.minTableWidth!=null&&(ve["--cms-table-min-width"]=mt(e.minTableWidth));const N=_.table({class:Q,style:ve},g,M),f=_.div({class:"cms-singularity cms-table-wrap"},N);me.appendChild(f);const A=_.div({class:"cms-singularity cms-table-chip"},""),z=_.div({class:"cms-singularity cms-table-chip"},""),K=Ne.Btn({outline:!0,onClick:()=>b(Math.max(1,S()-1))},"\u2039"),ke=Ne.Btn({outline:!0,onClick:()=>b(S()+1)},"\u203A"),Me=_.div({class:"cms-singularity cms-table-chip"},""),Te=_.select({class:"cms-input cms-table-size-select"},...d.map(De=>Cs({value:String(De)},String(De))));Te.value=String(P()),Te.addEventListener("change",()=>X(Te.value));const U=J(s,"footer",{},e.footer),j=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},A,z,_.label({class:"cms-table-size"},_.span("Righe"),Te)),_.div({class:"cms-table-foot-extra"},...U,_.div({class:"cms-table-pager"},K,Me,ke)));e.hideFooter!==!0&&me.appendChild(j);const ne=()=>{if(g.innerHTML="",e.hideHeader)return;const De=_.tr();if(i.forEach((Ie,qe)=>{var xe,Ue;const Be={col:Ie,colIndex:qe,sort:Z()},T={...vo(Ie==null?void 0:Ie.style,{...Be,header:!0}),...vo((xe=Ie==null?void 0:Ie.headerStyle)!=null?xe:Ie==null?void 0:Ie.thStyle,{...Be,header:!0})};(Ie==null?void 0:Ie.width)!=null&&(T.width=mt(Ie.width)),(Ie==null?void 0:Ie.minWidth)!=null&&(T.minWidth=mt(Ie.minWidth)),(Ie==null?void 0:Ie.maxWidth)!=null&&(T.maxWidth=mt(Ie.maxWidth)),Ie!=null&&Ie.align&&(T.textAlign=Ie.align);let Pe=J(Ie==null?void 0:Ie.slots,"header",Be,null);if(!Pe.length){const et=typeof(Ie==null?void 0:Ie.header)=="function"?Ie.header(Be):(Ue=Ie==null?void 0:Ie.header)!=null?Ue:ri(Ie);Pe=J(s,"header",Be,et)}const O=Z(),k=Oo(Ie,qe),v=(Ie==null?void 0:Ie.sortable)!==!1&&((Ie==null?void 0:Ie.key)!=null||typeof(Ie==null?void 0:Ie.get)=="function"||typeof(Ie==null?void 0:Ie.compare)=="function"),u=!!O&&(O.key===k||O.key===(Ie==null?void 0:Ie.key)),I=_.th({class:te(["cms-table-head-cell",ye(Ie==null?void 0:Ie.nowrap,"is-nowrap"),ye(v,"cms-table-sortable"),ye(u,"is-sorted"),Ie==null?void 0:Ie.headerClass]),style:T});v?I.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>fe(Ie,qe)},_.span({class:"cms-table-head-label"},...Pe),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},u?O.dir==="asc"?"\u2191":"\u2193":"\u2195"))):Pe.forEach(et=>I.appendChild(et)),De.appendChild(I)}),Y){const Ie=J(s,"actionsHeader",{},e.actionsLabel||"Azioni");De.appendChild(_.th({class:"cms-table-head-cell cms-table-head-actions",style:{textAlign:"right"}},...Ie))}g.appendChild(De)},Ve=(De,Ie)=>{const qe={columns:i,count:i.length},Be=J(s,De,qe,Ie),T=String(i.length+(Y?1:0));M.appendChild(_.tr(_.td({colSpan:T,class:"cms-table-state"},...Be)))};return bt.reactive.effect(()=>{const De=el(e.rows),Ie=String(H()||"").trim(),qe=Z(),Be=typeof e.loading=="function"?!!e.loading():!!e.loading,T=e.pagination!==!1;if(ne(),M.innerHTML="",_e&&_e.value!==H()&&(_e.value=H()),Te.value!==String(P())&&(Te.value=String(P())),Be){h.textContent="Caricamento in corso",p.style.display="none",V.style.display="none",A.textContent="Loading\u2026",z.textContent="",Me.textContent="Pagina 1",K.disabled=!0,ke.disabled=!0,Ve("loading",e.loadingText||"Loading...");return}let Pe=De.slice();const O=Pe.length;if(typeof e.filter=="function"&&(Pe=Pe.filter((G,Ge)=>e.filter(G,{row:G,index:Ge,query:Ie,rows:De,columns:i}))),Ie&&(Pe=Pe.filter(G=>nl(G,i,Ie,e))),qe){const G=ai(i,qe.key);G&&Pe.sort((Ge,lt)=>{const tt=wo(G,Ge,-1),dt=wo(G,lt,-1),St=typeof G.compare=="function"?G.compare(tt,dt,Ge,lt):Zi(tt,dt);return qe.dir==="asc"?St:-St})}const k=Pe.length,v=Math.max(1,Number(P())||x),u=T?Math.max(1,Math.ceil(k/v)):1,I=T?Math.min(S(),u):1;I!==S()&&b(I);const xe=T?(I-1)*v:0,Ue=T?xe+v:k,et=Pe.slice(xe,Ue);if(h.textContent=k===O?`${k} righe`:`${k} di ${O} righe`,p.textContent=Ie?`Ricerca: ${Ie}`:"",p.style.display=Ie?"":"none",qe){const G=ai(i,qe.key);V.textContent=G?`Ordine: ${ri(G)} ${qe.dir==="asc"?"\u2191":"\u2193"}`:"",V.style.display=G?"":"none"}else V.style.display="none";if(A.textContent=k?`${xe+1}-${Math.min(Ue,k)} di ${k}`:"0 risultati",z.textContent=k!==O?`Dataset totale ${O}`:`Page size ${v}`,Me.textContent=T?`Pagina ${I} / ${u}`:"Tutte le righe",K.disabled=!T||I<=1,ke.disabled=!T||I>=u,Te.disabled=!T,Te.parentNode.style.display=T?"":"none",et.length===0){Ve("empty",e.emptyText||"Nessun dato");return}for(let G=0;G<et.length;G++){const Ge=et[G],lt=xe+G,tt={row:Ge,rowIndex:lt,pageIndex:G},dt=typeof e.rowAttrs=="function"?e.rowAttrs(Ge,tt)||{}:e.rowAttrs||{},St=typeof e.rowClass=="function"?e.rowClass(Ge,tt):e.rowClass,It=!!(e.onRowClick||e.onRowDblClick),Rt=_.tr({...dt,class:te(["cms-table-row",St,dt.class,ye(It,"is-clickable")])});if(e.rowKey){const st=typeof e.rowKey=="function"?e.rowKey(Ge,tt):Mo(Ge,e.rowKey);st!=null&&(Rt.dataset.key=String(st))}const Pt=st=>{const wt=st==null?void 0:st.target;return!!(wt&&wt.closest&&wt.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(e.onRowClick&&Rt.addEventListener("click",st=>{Pt(st)||e.onRowClick(Ge,tt,st)}),e.onRowDblClick&&Rt.addEventListener("dblclick",st=>{Pt(st)||e.onRowDblClick(Ge,tt,st)}),i.forEach((st,wt)=>{var Qt,cn;const Ft=wo(st,Ge,lt),Dt={...tt,col:st,colIndex:wt,value:Ft},Yt={...vo(st==null?void 0:st.style,Dt),...vo((Qt=st==null?void 0:st.cellStyle)!=null?Qt:st==null?void 0:st.tdStyle,Dt)};st!=null&&st.align&&(Yt.textAlign=st.align),(st==null?void 0:st.width)!=null&&(Yt.width=mt(st.width)),(st==null?void 0:st.minWidth)!=null&&(Yt.minWidth=mt(st.minWidth)),(st==null?void 0:st.maxWidth)!=null&&(Yt.maxWidth=mt(st.maxWidth));const Xt=typeof(st==null?void 0:st.cellClass)=="function"?st.cellClass(Ge,Dt):(st==null?void 0:st.cellClass)||(st==null?void 0:st.class),on=_.td({class:te(["cms-table-cell",Xt,ye(st==null?void 0:st.nowrap,"is-nowrap")]),style:Yt});let jt=J(st==null?void 0:st.slots,"cell",Dt,null);if(!jt.length){const hn=typeof(st==null?void 0:st.render)=="function"?st.render(Ge,Dt):typeof(st==null?void 0:st.format)=="function"?st.format(Ft,Ge,Dt):Ft,Gt=hn==null?(cn=st==null?void 0:st.emptyText)!=null?cn:"":hn;jt=J(s,"cell",Dt,Gt)}jt.length||(jt=[""]),jt.forEach(hn=>on.appendChild(hn)),Rt.appendChild(on)}),Y){const st={...tt},wt=typeof e.actions=="function"?e.actions(Ge,tt):e.actions;let Ft=J(s,"actions",st,wt);Ft.length||(Ft=J(null,"default",st,wt)),Rt.appendChild(_.td({class:"cms-table-cell cms-table-cell-actions",style:{textAlign:"right"}},_.div({class:"cms-table-actions"},...Ft)))}M.appendChild(Rt)}},"UI.Table:render"),be.body=me,Ne.Card(be)},Ne.Menu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],c=["xs","sm","md","lg","xl"];let x={...e},d=null,r=null,w=null,F=null,S=null;const b=(f,A)=>Object.prototype.hasOwnProperty.call(f||{},A),P=(f,A)=>typeof f=="function"?f(A):f,re=f=>String(f||"").split(/\s+/).filter(Boolean),Z=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"),H=()=>{clearTimeout(F),clearTimeout(S),F=null,S=null},W=(f,A,z)=>{if(!f)return;const K=f[A]||[];K.length&&f.classList.remove(...K);const ke=(z||[]).filter(Boolean);ke.length&&f.classList.add(...ke),f[A]=ke},se=(f,A,z,K=ke=>ke)=>{if(f){if(z==null||z===""){f.style.removeProperty(A);return}f.style.setProperty(A,K(z))}},X=()=>x||{},fe=f=>{var z;const A=String(o((z=f.state)!=null?z:f.color)||"").toLowerCase();return i.includes(A)?A:""},_e=f=>{const A=String(o(f.size)||"").toLowerCase();return c.includes(A)?A:""},be=f=>{var A,z;return String(o((z=(A=f.placement)!=null?A:f.position)!=null?z:"bottom-start"))},me=()=>{var z;const f=o((z=X().delay)!=null?z:X().showDelay),A=Number(f);return Number.isFinite(A)?Math.max(0,A):0},de=()=>{const f=o(X().hideDelay),A=Number(f);return Number.isFinite(A)?Math.max(0,A):80},ce=(f=null)=>{var z,K,ke;if(f)return f;const A=X();return r||o((ke=(K=(z=A.anchorEl)!=null?z:A.triggerEl)!=null?K:A.target)!=null?ke:A.anchor)||null},$=f=>{if(f==null||f===!0)return new Set(["click"]);if(f===!1)return new Set(["manual"]);const A=Array.isArray(f)?f:String(f).split(/[\s,|/]+/),z=new Set;return A.forEach(K=>{const ke=String(K||"").trim().toLowerCase();ke&&(ke==="mouseenter"||ke==="mouseover"?z.add("hover"):ke==="blur"||ke==="focusin"?z.add("focus"):ke==="tap"?z.add("click"):z.add(ke))}),z.size?z:new Set(["manual"])},le=(f,A)=>{var ke,Me,Te;let z=null,K=null;if(he(f))z=f,Z(A)&&(K=A);else if(Z(f)){K=f;const U=(Te=(Me=(ke=f.anchorEl)!=null?ke:f.triggerEl)!=null?Me:f.target)!=null?Te:f.anchor;he(U)&&(z=U)}else f!=null&&(z=f);return{anchorEl:z,nextProps:K}},oe=(f=d==null?void 0:d.panel)=>{var A;return Array.from(((A=f==null?void 0:f.querySelectorAll)==null?void 0:A.call(f,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(z=>z.offsetParent!==null&&z.getAttribute("aria-hidden")!=="true")},Se=()=>{o(X().autoFocus)!==!1&&setTimeout(()=>{const f=oe();if(!f.length)return;(f.find(z=>z.classList.contains("is-active")||z.classList.contains("is-selected")||z.classList.contains("is-checked"))||f[0]).focus()},0)},L=(f,A,z="sm")=>{const K=P(f,A);return K==null?[]:typeof K=="string"?[Ne.Icon({name:K,size:z})]:rn(K,{...A,as:"icon"})},m=(f,A)=>{var xe,Ue,et,G,Ge,lt,tt,dt,St,It,Rt,Pt,st;const z=P(f,A);if(z==null||z===!1)return[];if(Array.isArray(z))return z.flatMap((wt,Ft)=>m(wt,{...A,index:Ft}));if(typeof z=="function")return m(z(A),A);if(z!=null&&z.nodeType)return[z];if(typeof z=="string"||typeof z=="number")return m({label:z},A);if(!Z(z))return rn(z,{...A,as:"item"});const K=String((Ue=(xe=z.type)!=null?xe:z.kind)!=null?Ue:"").toLowerCase();if(K==="separator"||K==="divider"||z.separator===!0||z.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ke=(et=z.items)!=null?et:z.children;if((K==="group"||K==="section"||Array.isArray(ke))&&ke!=null){const wt={...A,item:z},Ft=J(s,"groupLabel",wt,P((G=z.label)!=null?G:z.title,wt)),Dt=m(ke,wt);return Dt.length?[_.div({class:te(["cms-menu-group",z.class])},Ft.length?_.div({class:"cms-menu-group-label"},...Ft):null,_.div({class:"cms-menu-group-items"},...Dt))]:[]}const Me={...A,item:z,close:ie,dismiss:ie,open:C,toggle:Y,update:a,isOpen:Q,entry:()=>d,anchorEl:ce(),props:X()},Te=!!o(z.disabled),U=z.checked==null?null:!!o(z.checked),j=!!o((Ge=z.active)!=null?Ge:z.selected),ne=fe(z),Ve=o(z.href),He=o(z.to),ae=b(z,"closeOnSelect")?!!o(z.closeOnSelect):z.keepOpen===!0?!1:X().closeOnSelect!==!1,$e=z.role||(U!=null?"menuitemcheckbox":"menuitem"),Ee=L(z.icon,Me),De=L((lt=z.iconRight)!=null?lt:z.endIcon,Me),Ie=J(s,"itemTitle",Me,P((tt=z.title)!=null?tt:z.label,Me)),qe=J(s,"itemSubtitle",Me,P((dt=z.subtitle)!=null?dt:z.description,Me)),Be=J(s,"itemShortcut",Me,P(z.shortcut,Me)),T=J(s,"itemBadge",Me,P(z.badge,Me)),Pe=J(s,"item",Me,P((It=(St=z.content)!=null?St:z.body)!=null?It:z.render,Me)),O=[...T,...Be,...U===!0&&!De.length&&!T.length?[_.span({class:"cms-menu-entry-check"},Ne.Icon({name:z.checkedIcon||"check",size:"sm"}))]:[],...De],v={class:te(["cms-menu-entry","cms-menu-item",ne?`cms-state-${ne}`:"",ye(j,"is-active"),ye(U===!0,"is-checked"),ye(Te,"is-disabled"),z.class]),role:$e,tabIndex:Te?-1:(Rt=z.tabIndex)!=null?Rt:-1,"data-menu-item":!0,"data-menu-select":ae?"true":"false","data-menu-close":z.close===!0?"true":null,"data-menu-keep-open":ae?null:"true","aria-disabled":Te?"true":null,"aria-checked":U==null?null:String(U),title:(st=(Pt=z.titleAttr)!=null?Pt:z.tooltip)!=null?st:null,type:Ve?null:"button",href:Ve||null,target:z.target||null,rel:z.rel||(z.target==="_blank"?"noopener noreferrer":null),onClick:wt=>{var Dt,Yt,Xt,on;if(Te){wt.preventDefault(),wt.stopPropagation();return}(Yt=(Dt=X()).onItemClick)==null||Yt.call(Dt,z,Me,wt);const Ft=(Xt=z.onClick)==null?void 0:Xt.call(z,Me,wt);wt.defaultPrevented||(He&&((on=JSswift.router)!=null&&on.navigate)&&(wt.preventDefault(),JSswift.router.navigate(He)),Ft!==!1&&ae&&ie())}};z.attrs&&typeof z.attrs=="object"&&Object.assign(v,z.attrs);const u=Ve?_.a:_.button,I=Pe.length?Pe:[Ie.length?_.div({class:"cms-menu-entry-title"},...Ie):null,qe.length?_.div({class:"cms-menu-entry-subtitle"},...qe):null].filter(Boolean);return[u(v,Ee.length?_.span({class:"cms-menu-entry-icon"},...Ee):null,_.span({class:"cms-menu-entry-main"},...I),O.length?_.span({class:"cms-menu-entry-aside"},...O):null)]},h=()=>{var Ie,qe,Be,T,Pe,O,k;const f=X(),A={close:ie,dismiss:ie,open:C,toggle:Y,update:a,isOpen:Q,entry:()=>d,anchorEl:ce(),props:f},z=L(f.icon,A,f.iconSize||"md"),K=J(s,"eyebrow",A,P(f.eyebrow,A)),ke=J(s,"title",A,P((qe=(Ie=f.title)!=null?Ie:f.heading)!=null?qe:f.label,A)),Me=J(s,"subtitle",A,P((Be=f.subtitle)!=null?Be:f.description,A)),Te=J(s,"before",A,P(f.before,A)),U=J(s,"header",A,P(f.header,A)),j=J(s,"after",A,P(f.after,A)),ne=J(s,"footer",A,P(f.footer,A)),Ve=J(s,"status",A,P(f.status,A));let He=(T=f.content)!=null?T:f.body;He==null&&n&&n.length&&(He=n);let ae=J(s,"content",A,P(He,A));ae.length||(ae=J(s,"body",A,P(He,A))),ae.length||(ae=J(s,"default",A,P(He,A)));const $e=m((O=(Pe=f.items)!=null?Pe:f.actionsList)!=null?O:f.entries,A),Ee=$e.length?[]:J(s,"empty",A,P((k=f.empty)!=null?k:f.emptyText,A));let De=null;return U.length?De=_.div({class:te(["cms-menu-head","cms-menu-head-custom",f.headerClass])},...U):(z.length||K.length||ke.length||Me.length)&&(De=_.div({class:te(["cms-menu-head",f.headerClass])},z.length?_.div({class:"cms-menu-head-icon"},...z):null,_.div({class:"cms-menu-head-main"},K.length?_.div({class:"cms-menu-eyebrow"},...K):null,ke.length?_.div({class:"cms-menu-title"},...ke):null,Me.length?_.div({class:"cms-menu-subtitle"},...Me):null))),_.div({class:te(["cms-menu","cms-menu-shell",ye(f.dense,"dense"),ye($e.length>0,"has-items"),ye(ne.length>0||Ve.length>0,"has-footer"),f.class]),style:f.style||{},role:f.role||"menu","aria-label":f.ariaLabel||null},Te.length?_.div({class:"cms-menu-before"},...Te):null,De,ae.length?_.div({class:te(["cms-menu-content",f.contentClass])},...ae):null,$e.length?_.div({class:te(["cms-menu-items",f.itemsClass])},...$e):null,!$e.length&&Ee.length?_.div({class:"cms-menu-empty"},...Ee):null,j.length?_.div({class:"cms-menu-after"},...j):null,Ve.length||ne.length?_.div({class:te(["cms-menu-footer",f.footerClass])},Ve.length?_.div({class:"cms-menu-status"},...Ve):null,ne.length?_.div({class:"cms-menu-footer-actions"},...ne):null):null)},p=f=>{var ke;if(!(f!=null&&f.panel))return;const A=X(),z=fe(A),K=_e(A);W(f.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",K?`cms-menu-${K}`:"",z?`cms-state-${z}`:"",o(A.outline)?"outline":"",...re(A.panelClass)]),W(f.overlay,"_menuOverlayClassTokens",[...re(A.overlayClass)]),f.panel.dataset.placement=be(A),se(f.panel,"--cms-menu-width",o(A.width),mt),se(f.panel,"--cms-menu-min-width",o(A.minWidth),mt),se(f.panel,"--cms-menu-max-width",o(A.maxWidth),mt),se(f.panel,"--cms-menu-max-height",o(A.maxHeight),mt),se(f.panel,"--cms-menu-body-max-height",o((ke=A.bodyMaxHeight)!=null?ke:A.contentMaxHeight),mt),A.panelStyle&&Object.assign(f.panel.style,A.panelStyle),Nt(f.panel,A)},V=()=>{d!=null&&d.panel&&d.panel.replaceChildren(h())},ie=()=>{if(H(),!d)return;const f=d;d=null,_s(f,()=>JSswift.overlay.close(f.id))},a=(f={})=>{var A,z,K,ke;if(f&&typeof f=="object"&&(x={...x,...f}),d){const Me=X();p(d),V(),(ke=d.reposition)==null||ke.call(d,{anchorEl:d._anchorEl,placement:be(Me),offsetX:(A=Me.offsetX)!=null?A:0,offsetY:(K=(z=Me.offsetY)!=null?z:Me.offset)!=null?K:8}),Se()}return N},C=(f=null,A=null)=>{var De,Ie,qe,Be,T,Pe,O,k,v,u,I,xe,Ue,et,G,Ge;H();const{anchorEl:z,nextProps:K}=le(f,A);K&&(x={...x,...K});const ke=X(),Me=ce(z);if(!Me||o(ke.disabled))return null;if(d&&d._anchorEl===Me){const lt=X();return p(d),V(),(Be=d.reposition)==null||Be.call(d,{anchorEl:d._anchorEl,placement:be(lt),offsetX:(De=lt.offsetX)!=null?De:0,offsetY:(qe=(Ie=lt.offsetY)!=null?Ie:lt.offset)!=null?qe:8}),Se(),d}d&&ie(),w=document.activeElement;let Te=null;if(d=JSswift.overlay.open(()=>h(),{type:"menu",anchorEl:Me,placement:be(ke),offsetX:(T=ke.offsetX)!=null?T:0,offsetY:(O=(Pe=ke.offsetY)!=null?Pe:ke.offset)!=null?O:8,backdrop:ke.backdrop===!0,lockScroll:ke.lockScroll===!0,trapFocus:ke.trapFocus===!0,autoFocus:!1,closeOnOutside:ke.closeOnOutside!==!1,closeOnBackdrop:(k=ke.closeOnBackdrop)!=null?k:ke.backdrop===!0,closeOnEsc:ke.closeOnEsc!==!1,className:qt(["cms-menu-panel"]),onClose:()=>{var lt,tt,dt;(lt=Te==null?void 0:Te._menuCleanup)==null||lt.call(Te),(dt=(tt=X()).onClose)==null||dt.call(tt,Te),X().returnFocus!==!1&&w&&typeof w.focus=="function"&&setTimeout(()=>w.focus(),0)}}),!(d!=null&&d.panel))return d;const U=d;Te=U,U._anchorEl=Me;const j=()=>{clearTimeout(S),S=null},ne=()=>{M()},Ve=lt=>{const tt=lt.target;if(!tt||!tt.closest)return;if(tt.closest("[data-menu-close]")){ie();return}if(X().closeOnSelect===!1)return;const dt=tt.closest("[data-menu-item], [data-menu-select], .cms-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");dt&&(dt.closest("[data-menu-keep-open]")||dt.getAttribute("data-menu-select")!=="false"&&ie())},He=lt=>{if(lt.key==="Escape"){lt.preventDefault(),ie();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(lt.key))return;const tt=oe(U.panel);if(!tt.length)return;lt.preventDefault();const dt=tt.indexOf(document.activeElement);if(lt.key==="Home"){tt[0].focus();return}if(lt.key==="End"){tt[tt.length-1].focus();return}const St=lt.key==="ArrowDown"?1:-1,It=dt<0?St>0?0:tt.length-1:(dt+St+tt.length)%tt.length;tt[It].focus()};U.panel.addEventListener("click",Ve),U.panel.addEventListener("keydown",He);const ae=$((u=(v=ke.trigger)!=null?v:ke.triggers)!=null?u:b(ke,"open")?"manual":null),$e=ae.has("hover"),Ee=ae.has("focus");return($e||Ee)&&(U.panel.addEventListener("mouseenter",j),U.panel.addEventListener("mouseleave",ne),U.panel.addEventListener("focusin",j),U.panel.addEventListener("focusout",ne)),U._menuCleanup=()=>{var lt,tt,dt,St,It,Rt;(lt=U.panel)==null||lt.removeEventListener("click",Ve),(tt=U.panel)==null||tt.removeEventListener("keydown",He),(dt=U.panel)==null||dt.removeEventListener("mouseenter",j),(St=U.panel)==null||St.removeEventListener("mouseleave",ne),(It=U.panel)==null||It.removeEventListener("focusin",j),(Rt=U.panel)==null||Rt.removeEventListener("focusout",ne)},p(U),(et=U.reposition)==null||et.call(U,{anchorEl:Me,placement:be(ke),offsetX:(I=ke.offsetX)!=null?I:0,offsetY:(Ue=(xe=ke.offsetY)!=null?xe:ke.offset)!=null?Ue:8}),xs(U),(Ge=(G=X()).onOpen)==null||Ge.call(G,U),Se(),U},g=(f,A=null)=>{clearTimeout(S),S=null,clearTimeout(F),F=setTimeout(()=>C(f,A),me())},M=(f=!1)=>{if(clearTimeout(F),F=null,!!d){if(clearTimeout(S),f){ie();return}S=setTimeout(()=>ie(),de())}},Y=(f=null,A=null)=>Q()?(ie(),null):C(f,A),Q=()=>!!d,N={open:C,close:ie,show:g,hide:M,toggle:Y,update:a,bind:f=>{var ne,Ve;if(!f)return()=>{};r=f;const A=X(),z=$((Ve=(ne=A.trigger)!=null?ne:A.triggers)!=null?Ve:b(A,"open")?"manual":null),K=z.has("hover"),ke=z.has("focus"),Me=z.has("click"),Te=z.has("manual")||!K&&!ke&&!Me,U=[],j=()=>{H(),U.forEach(He=>He()),r===f&&(r=null)};if(b(A,"open"))return Ye(A.open)?JSswift.reactive.effect(()=>{r&&(o(X().open)?C(r):M(!0))},"UI.Menu:open"):A.open===!0?C(f):A.open===!1&&M(!0),j;if(Te||o(A.disabled))return j;if(K){const He=()=>g(f),ae=()=>M();f.addEventListener("mouseenter",He),f.addEventListener("mouseleave",ae),U.push(()=>{f.removeEventListener("mouseenter",He),f.removeEventListener("mouseleave",ae)})}if(ke){const He=()=>g(f),ae=()=>M();f.addEventListener("focus",He),f.addEventListener("blur",ae),U.push(()=>{f.removeEventListener("focus",He),f.removeEventListener("blur",ae)})}if(Me){const He=ae=>{var $e,Ee;(Ee=($e=X()).onTriggerClick)==null||Ee.call($e,ae),!ae.defaultPrevented&&Y(f)};f.addEventListener("click",He),U.push(()=>f.removeEventListener("click",He))}return j},isOpen:Q,entry:()=>d,props:()=>({...x})};return N},Ne.Popover=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],c=["xs","sm","md","lg","xl"];let x={...e},d=null,r=null,w=null,F=null,S=null;const b=(N,f)=>Object.prototype.hasOwnProperty.call(N||{},f),P=(N,f)=>typeof N=="function"?N(f):N,re=N=>String(N||"").split(/\s+/).filter(Boolean),Z=N=>N&&typeof N=="object"&&!N.nodeType&&!Array.isArray(N)&&!(N instanceof Function),he=N=>!!N&&typeof N=="object"&&(N.nodeType===1||typeof N.getBoundingClientRect=="function"),H=()=>{clearTimeout(F),clearTimeout(S),F=null,S=null},W=(N,f,A)=>{if(!N)return;const z=N[f]||[];z.length&&N.classList.remove(...z);const K=(A||[]).filter(Boolean);K.length&&N.classList.add(...K),N[f]=K},se=(N,f,A,z=K=>K)=>{if(N){if(A==null||A===""){N.style.removeProperty(f);return}N.style.setProperty(f,z(A))}},X=()=>x,fe=N=>{var A;const f=o((A=N.state)!=null?A:N.color);return f?i.includes(f)?f:String(f):""},_e=N=>{const f=o(N.size);return typeof f=="string"&&c.includes(f)?f:""},be=N=>{var A,z,K;const f=String(o((K=(z=(A=N.actionsAlign)!=null?A:N.footerAlign)!=null?z:N.alignActions)!=null?K:"end")).toLowerCase();return["start","left"].includes(f)?"start":["center","middle"].includes(f)?"center":["between","space-between"].includes(f)?"between":["stretch","full"].includes(f)?"stretch":"end"},me=N=>{var f,A;return String(o((A=(f=N.placement)!=null?f:N.position)!=null?A:"bottom-start"))},de=(N,f)=>{const A=o(N);if(A==null||A==="")return f;const z=Number(A);return Number.isFinite(z)?z:f},ce=()=>de(X().delay,0),$=()=>de(X().hideDelay,120),le=N=>{var A,z;return((z=(A=N.closable)!=null?A:N.dismissible)!=null?z:N.closeButton)===!0},oe=(N=null)=>{var A,z,K;if(N)return N;const f=X();return r||o((K=(z=(A=f.anchorEl)!=null?A:f.triggerEl)!=null?z:f.target)!=null?K:f.anchor)||null},Se=N=>{if(N==null||N===!0)return new Set(["click"]);if(N===!1)return new Set(["manual"]);const f=Array.isArray(N)?N:String(N).split(/[\s,|/]+/),A=new Set;return f.forEach(z=>{const K=String(z||"").trim().toLowerCase();K&&(K==="mouseenter"||K==="mouseover"?A.add("hover"):K==="blur"||K==="focusin"?A.add("focus"):K==="tap"?A.add("click"):A.add(K))}),A.size?A:new Set(["manual"])},L=(N,f)=>{var K,ke,Me;let A=null,z=null;if(he(N))A=N,Z(f)&&(z=f);else if(Z(N)){z=N;const Te=(Me=(ke=(K=N.anchorEl)!=null?K:N.triggerEl)!=null?ke:N.target)!=null?Me:N.anchor;he(Te)&&(A=Te)}else N!=null&&(A=N);return{anchorEl:A,nextProps:z}},m=()=>{var Ee,De,Ie,qe,Be,T,Pe,O,k;const N=X(),f={close:V,dismiss:V,open:a,toggle:M,update:ie,isOpen:Y,entry:()=>d,anchorEl:oe(),props:N},A=N.icon!=null?typeof N.icon=="string"?Ne.Icon({name:N.icon,size:N.iconSize||"md"}):JSswift.ui.slot(N.icon,{as:"icon"}):null,z=J(s,"eyebrow",f,P(N.eyebrow,f)),K=J(s,"title",f,P((De=(Ee=N.title)!=null?Ee:N.heading)!=null?De:N.label,f)),ke=J(s,"subtitle",f,P((Ie=N.subtitle)!=null?Ie:N.description,f)),Me=J(s,"icon",f,A),Te=J(s,"header",f,P((Be=(qe=N.headerContent)!=null?qe:N.head)!=null?Be:N.header,f)),U=le(N)?J(s,"close",f,Ne.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":N.closeLabel||"Chiudi popover","data-popover-close":!0},Ne.Icon({name:N.closeIcon||"close",size:"sm"}))):[];let j=(O=(Pe=(T=N.content)!=null?T:N.body)!=null?Pe:N.message)!=null?O:N.text;j==null&&n&&n.length&&(j=n);let ne=J(s,"content",f,P(j,f));ne.length||(ne=J(s,"body",f,P(j,f))),ne.length||(ne=J(s,"default",f,P(j,f)));const Ve=P((k=N.footer)!=null?k:N.actions,f);let He=J(s,"footer",f,Ve);He.length||(He=J(s,"actions",f,Ve));let ae=null;Te.length?ae=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...Te):(z.length||K.length||ke.length||Me.length||U.length)&&(ae=_.div({class:"cms-dialog-head"},Me.length?_.div({class:"cms-dialog-icon"},...Me):null,_.div({class:"cms-dialog-head-main"},z.length?_.div({class:"cms-dialog-eyebrow"},...z):null,K.length?_.div({class:"cms-dialog-title"},...K):null,ke.length?_.div({class:"cms-dialog-subtitle"},...ke):null),U.length?_.div({class:"cms-dialog-close-wrap"},...U):null));const $e=[];return ae&&$e.push(ae),ne.length&&$e.push(_.div({class:te(["cms-dialog-body",N.bodyClass])},...ne)),He.length&&$e.push(_.div({class:te(["cms-dialog-actions",`is-${be(N)}`,ye(N.stackActions,"is-stacked"),N.actionsClass,N.footerClass])},...He)),$e.length||$e.push(_.div({class:te(["cms-dialog-body",N.bodyClass])})),_.div({class:te(["cms-dialog-shell","cms-popover-shell",ye(!!ae,"has-head"),ye(He.length>0,"has-footer"),ye(N.divider!==!1,"with-divider")])},...$e)},h=N=>{var K;if(!(N!=null&&N.panel))return;const f=X(),A=fe(f),z=_e(f);W(N.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",z?`cms-dialog-${z}`:"",A,A?`cms-state-${A}`:"",o(f.scrollable)?"scrollable":"",o(f.stickyHeader)?"sticky-head":"",o(f.stickyActions)?"sticky-actions":"",o(f.borderless)?"borderless":"",...re(f.class),...re(f.panelClass)]),W(N.overlay,"_popoverOverlayClassTokens",[...re(f.overlayClass)]),N.panel.dataset.placement=me(f),se(N.panel,"--cms-dialog-width",o(f.width),mt),se(N.panel,"--cms-dialog-min-width",o(f.minWidth),mt),se(N.panel,"--cms-dialog-max-width",o(f.maxWidth),mt),se(N.panel,"--cms-dialog-max-height",o(f.maxHeight),mt),se(N.panel,"--cms-dialog-body-max-height",o((K=f.bodyMaxHeight)!=null?K:f.contentMaxHeight),mt),f.style&&Object.assign(N.panel.style,f.style),Nt(N.panel,f),N.panel.setAttribute("role",f.role||"dialog"),N.panel.setAttribute("aria-modal",f.modal===!0?"true":"false"),f.ariaLabel?N.panel.setAttribute("aria-label",f.ariaLabel):N.panel.removeAttribute("aria-label")},p=()=>{d!=null&&d.panel&&d.panel.replaceChildren(m())},V=()=>{if(H(),!d)return;const N=d;d=null,_s(N,()=>JSswift.overlay.close(N.id))},ie=(N={})=>(N&&typeof N=="object"&&(x={...x,...N}),d&&(h(d),p()),ve),a=(N=null,f=null)=>{var $e,Ee,De,Ie,qe,Be,T,Pe;H();const{anchorEl:A,nextProps:z}=L(N,f);z&&(x={...x,...z});const K=X(),ke=oe(A);if(!ke||o(K.disabled))return null;if(d&&d._anchorEl===ke)return h(d),p(),d;d&&V(),w=document.activeElement;const Me=Se((Ee=($e=K.trigger)!=null?$e:K.triggers)!=null?Ee:b(K,"open")?"manual":null),Te=Me.has("hover"),U=Me.has("focus");let j=null;if(d=JSswift.overlay.open(()=>m(),{type:"popover",anchorEl:ke,placement:me(K),offsetX:(De=K.offsetX)!=null?De:0,offsetY:(qe=(Ie=K.offsetY)!=null?Ie:K.offset)!=null?qe:10,backdrop:K.backdrop===!0,lockScroll:K.lockScroll===!0,trapFocus:K.trapFocus===!0,autoFocus:K.autoFocus===!0,closeOnOutside:K.closeOnOutside!==!1,closeOnBackdrop:(Be=K.closeOnBackdrop)!=null?Be:K.backdrop===!0,closeOnEsc:K.closeOnEsc!==!1,className:qt(["cms-dialog","cms-popover"]),onClose:()=>{var O,k,v;(O=j==null?void 0:j._popoverCleanup)==null||O.call(j),(v=(k=X()).onClose)==null||v.call(k,j),X().returnFocus!==!1&&w&&typeof w.focus=="function"&&setTimeout(()=>w.focus(),0)}}),!(d!=null&&d.panel))return d;const ne=d;j=ne,ne._anchorEl=ke;const Ve=()=>{clearTimeout(S),S=null},He=()=>{!Te&&!U||g()},ae=O=>{const k=O.target;if(!(!k||!k.closest)){if(k.closest("[data-popover-close]")||k.closest("[data-dialog-close]")){V();return}X().closeOnSelect===!0&&k.closest("[data-popover-select]")&&V()}};return ne.panel.addEventListener("click",ae),(Te||U)&&(ne.panel.addEventListener("mouseenter",Ve),ne.panel.addEventListener("mouseleave",He),ne.panel.addEventListener("focusin",Ve),ne.panel.addEventListener("focusout",He)),ne._popoverCleanup=()=>{var O,k,v,u,I;(O=ne.panel)==null||O.removeEventListener("click",ae),(k=ne.panel)==null||k.removeEventListener("mouseenter",Ve),(v=ne.panel)==null||v.removeEventListener("mouseleave",He),(u=ne.panel)==null||u.removeEventListener("focusin",Ve),(I=ne.panel)==null||I.removeEventListener("focusout",He)},h(ne),xs(ne),(Pe=(T=X()).onOpen)==null||Pe.call(T,ne),ne},C=(N,f=null)=>{clearTimeout(S),S=null,clearTimeout(F),F=setTimeout(()=>a(N,f),ce())},g=(N=!1)=>{if(clearTimeout(F),F=null,!!d){if(clearTimeout(S),N){V();return}S=setTimeout(()=>V(),$())}},M=(N=null,f=null)=>Y()?(V(),null):a(N,f),Y=()=>!!d,ve={open:a,close:V,show:C,hide:g,toggle:M,update:ie,bind:N=>{var j,ne;if(!N)return()=>{};r=N;const f=X(),A=Se((ne=(j=f.trigger)!=null?j:f.triggers)!=null?ne:b(f,"open")?"manual":null),z=A.has("hover"),K=A.has("focus"),ke=A.has("click"),Me=A.has("manual")||!z&&!K&&!ke,Te=[],U=()=>{H(),Te.forEach(Ve=>Ve()),r===N&&(r=null)};if(b(f,"open"))return Ye(f.open)?JSswift.reactive.effect(()=>{r&&(o(X().open)?a(r):g(!0))},"UI.Popover:open"):f.open===!0?a(N):f.open===!1&&g(!0),U;if(Me||o(f.disabled))return U;if(z){const Ve=()=>C(N),He=()=>g();N.addEventListener("mouseenter",Ve),N.addEventListener("mouseleave",He),Te.push(()=>{N.removeEventListener("mouseenter",Ve),N.removeEventListener("mouseleave",He)})}if(K){const Ve=()=>C(N),He=()=>g();N.addEventListener("focus",Ve),N.addEventListener("blur",He),Te.push(()=>{N.removeEventListener("focus",Ve),N.removeEventListener("blur",He)})}if(ke){const Ve=He=>{var ae,$e;($e=(ae=X()).onTriggerClick)==null||$e.call(ae,He),!He.defaultPrevented&&M(N)};N.addEventListener("click",Ve),Te.push(()=>N.removeEventListener("click",Ve))}return U},isOpen:Y,entry:()=>d,props:()=>({...x})};return ve},Ne.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},i=null,c=null,x=null;const d=p=>p&&typeof p=="object"&&!p.nodeType&&!Array.isArray(p)&&!(p instanceof Function),r=p=>!!p&&typeof p=="object"&&(p.nodeType===1||typeof p.getBoundingClientRect=="function"),w=p=>!!p&&typeof p=="object"&&("clientX"in p||"type"in p||"target"in p||"currentTarget"in p),F=p=>!!p&&Number.isFinite(Number(p.x))&&Number.isFinite(Number(p.y)),S=()=>s,b=(p,V)=>{const ie=Number(p),a=Number(V);return!Number.isFinite(ie)||!Number.isFinite(a)?null:{x:ie,y:a}},P=p=>p?{_cmsContextPoint:p,getBoundingClientRect:()=>({top:p.y,bottom:p.y,left:p.x,right:p.x,width:0,height:0})}:null,re=p=>{if(!r(p))return null;const V=p.getBoundingClientRect();return b(V.left+Math.min(V.width/2,24),V.top+Math.min(V.height/2,24))},Z=p=>{var V,ie,a,C;return o((C=(a=(ie=(V=p==null?void 0:p.anchorEl)!=null?V:p==null?void 0:p.triggerEl)!=null?ie:p==null?void 0:p.target)!=null?a:p==null?void 0:p.anchor)!=null?C:null)},he=(p,V=null)=>{if(!p)return re(V||x);const ie=b(p.clientX,p.clientY);if(ie)return ie;const a=Z({anchorEl:V||p.currentTarget||p.target||x});return re(a)},H=(p={})=>{if(!d(p))return{};const V={...p};return delete V.event,delete V.point,delete V.x,delete V.y,V},W=()=>{var V,ie,a;const p=S();return{...p,trigger:"manual",placement:p.placement||"bottom-start",offsetX:(V=p.offsetX)!=null?V:0,offsetY:(a=(ie=p.offsetY)!=null?ie:p.offset)!=null?a:4,closeOnOutside:p.closeOnOutside!==!1,closeOnEsc:p.closeOnEsc!==!1,role:p.role||"menu",ariaLabel:p.ariaLabel||p.title||"Context menu",class:te(["cms-context-menu-shell",p.class]),panelClass:te(["cms-context-menu-panel",p.panelClass])}},se=Ne.Menu(W(),...n),X=(p=null,V=null,ie=null)=>{let a=null,C=null,g=null;if(w(p))a=he(p,x),g=d(V)?H(V):null;else if(typeof p=="number"||typeof V=="number")a=b(p,V),g=d(ie)?H(ie):null;else if(F(p))a=b(p.x,p.y),g=d(V)?H(V):null;else if(r(p))C=p,g=d(V)?H(V):null;else if(d(p)){const M=F(p.point)?p.point:F(p)?p:null,Y=Z(p),Q=p.event;a=M?b(M.x,M.y):he(Q,Y||x),C=Y&&r(Y)?Y:null,g={...H(p),...d(V)?H(V):{}}}else i&&(a={...i});return{point:a,anchor:C,nextProps:g}},fe=(p,V=null)=>{c=p||c,i=V||p&&p._cmsContextPoint||i},_e=(p=null)=>{d(p)&&Object.keys(p).length&&(s={...s,...p})},be=(p=null,V=null)=>{if(V)return P(V);if(p&&r(p))return p;const ie=Z(S());return r(ie)?ie:i?P(i):r(c)?c:r(x)?x:null},me=(p=null,V=null,ie=null)=>{const{point:a,anchor:C,nextProps:g}=X(p,V,ie);_e(g);const M=be(C,a);return M?(fe(M,a),se.open(M,W())):null},de=(p,V,ie=null)=>me(p,V,ie),ce=(p,V=null)=>me(p,V),$=()=>(se.close(),h),le=(p=!0)=>(p===!1?se.hide(!1):se.close(),h),oe=(p=null,V=null,ie=null)=>me(p,V,ie),Se=(p=null,V=null,ie=null)=>se.isOpen()?($(),null):me(p,V,ie),L=(p={})=>(_e(H(p)),se.update(W()),h),h={open:me,openAt:de,openFromEvent:ce,show:oe,hide:le,close:$,toggle:Se,update:L,bind:(p,V=null)=>{if(!p)return()=>{};const ie=d(V)?H(V):null,a=g=>{var Y,Q;x=p,g.preventDefault(),!(((Q=(Y=S()).onTrigger)==null?void 0:Q.call(Y,g,{element:p,open:me,close:$,update:L}))===!1||o(S().disabled))&&me({event:g,anchorEl:p},ie)},C=g=>{var Y,Q;g.key!=="ContextMenu"&&!(g.shiftKey&&g.key==="F10")||(x=p,g.preventDefault(),((Q=(Y=S()).onTrigger)==null?void 0:Q.call(Y,g,{element:p,open:me,close:$,update:L}))===!1||o(S().disabled))||me({event:g,anchorEl:p},ie)};return p.addEventListener("contextmenu",a),p.addEventListener("keydown",C),()=>{p.removeEventListener("contextmenu",a),p.removeEventListener("keydown",C)}},isOpen:se.isOpen,entry:se.entry,props:()=>({...s})};return h}})(JSswift);
|