jsswift 1.0.48 → 1.0.49
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/AI.md +4 -2
- package/dist/documentions/AI.md +4 -2
- package/dist/documentions/components/input.md +448 -45
- package/dist/documentions/components/select.md +439 -51
- package/dist/documentions/examples/crud.md +62 -0
- package/dist/documentions/knowledge-map.json +16 -1
- package/dist/jsswift.js +26 -0
- package/dist/jsswift.min.js +3 -3
- package/dist/min-jsswift.js +3 -3
- package/package.json +1 -1
package/dist/jsswift.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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=`
|
|
1
|
+
(()=>{var Fs,Ds,ao,co,Nt,xs,J,Un,ds;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=(Fs=bt.modeDev)!=null?Fs:!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 pt(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(Ut){je=Ut,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]=pt(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:pt,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,zn,jt,On,uo;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((jt=(zn=q.viewportGutter)!=null?zn:q.gutter)!=null?jt:8),pt=Number.isFinite(Qe)?Math.max(0,Qe):8,ft=Number((On=q.offsetX)!=null?On:0),it=Number((uo=q.offsetY)!=null?uo:8),Fe=Number.isFinite(ft)?ft:0,ze=Number.isFinite(it)?it:8,je=(wn,vn,mn)=>!Number.isFinite(wn)||(Number.isFinite(vn)||(vn=0),Number.isFinite(mn)||(mn=vn),mn<vn)?vn:Math.min(Math.max(wn,vn),mn),ct=String(q.placement||"bottom-start").toLowerCase(),[ut,kt]=ct.split("-"),Lt=["top","bottom","left","right"].includes(ut)?ut:"bottom",Ut=["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=wn=>{let vn=pe.left+Fe,mn=pe.top+ze;return wn==="top"||wn==="bottom"?(Ut==="center"?vn=pe.left+(pe.width-_t)/2+Fe:Ut==="end"&&(vn=pe.right-_t+Fe),mn=wn==="top"?pe.top-Jt-ze:pe.bottom+ze):(Ut==="center"?mn=pe.top+(pe.height-Jt)/2+ze:Ut==="end"&&(mn=pe.bottom-Jt+ze),vn=wn==="left"?pe.left-_t-Fe:pe.right+Fe),{left:vn,top:mn}},nt=wn=>wn==="top"?pe.top-ze-pt:wn==="bottom"?Re-pe.bottom-ze-pt:wn==="left"?pe.left-Fe-pt:Oe-pe.right-Fe-pt,Et=nt(Lt),Ot=nt(Ze),gt=(xt?Jt:_t)>Et&&Ot>Et?Ze:Lt,Ye=We(gt),o=Ce+pt,zt=Ae+pt,te=Math.max(o,Ce+Oe-_t-pt),Yt=Math.max(zt,Ae+Re-Jt-pt),ye=je(Ye.left,o,te),Bt=je(Ye.top,zt,Yt);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(gt=>gt&&ut.appendChild(gt)):Lt&&ut.appendChild(Lt),je.appendChild(ct),je.appendChild(ut);const Ut=pe();if(!Ut)return{id:Fe,close:()=>Qe(Fe),panel:ut,overlay:je};Ut.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=(gt=null)=>{gt&&typeof gt=="object"&&Object.assign(ze.opts,gt),q(ut,ze.opts)},xt=()=>{if(!it.anchorEl)return;const gt=globalThis.requestAnimationFrame||(o=>setTimeout(()=>o(Date.now()),0)),Ye=globalThis.cancelAnimationFrame||clearTimeout;ze._positionFrame!=null&&Ye(ze._positionFrame),ze._positionFrame=gt(()=>{ze._positionFrame=null,Ze()})};if(ze.reposition=Ze,it.anchorEl){Ze(),xt();const gt=()=>Ze();if(window.addEventListener("resize",gt),window.addEventListener("scroll",gt,!0),(Et=(nt=window.visualViewport)==null?void 0:nt.addEventListener)==null||Et.call(nt,"resize",gt),(vt=(Ot=window.visualViewport)==null?void 0:Ot.addEventListener)==null||vt.call(Ot,"scroll",gt),typeof ResizeObserver=="function"){const Ye=new ResizeObserver(()=>Ze());Ye.observe(ut),ze._panelResizeObserver=Ye}ze._positionCleanup=()=>{var o,zt,te,Yt,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",gt),window.removeEventListener("scroll",gt,!0),(Yt=(te=window.visualViewport)==null?void 0:te.removeEventListener)==null||Yt.call(te,"resize",gt),(Bt=(ye=window.visualViewport)==null?void 0:ye.removeEventListener)==null||Bt.call(ye,"scroll",gt)}}const _t=gt=>{const Ye=Ae();!Ye||Ye.id!==Fe||it.closeOnOutside!==!1&&(Oe(gt.target)||ut.contains(gt.target)||Qe(Fe))};document.addEventListener("mousedown",_t,!0);const Jt=gt=>{const Ye=Ae();!Ye||Ye.id!==Fe||(it.trapFocus&&ge(gt,ut),gt.key==="Escape"&&it.closeOnEsc!==!1&&(gt.preventDefault(),Qe(Fe)))};document.addEventListener("keydown",Jt,!0),ct.addEventListener("click",()=>{it.closeOnBackdrop!==!1&&Qe(Fe)}),ze._cleanup=()=>{var gt;document.removeEventListener("mousedown",_t,!0),document.removeEventListener("keydown",Jt,!0),(gt=ze._positionCleanup)==null||gt.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 gs(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 pt(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(".")){pt(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:pt,applyBindingValue:it}}function Bn(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 ys(l){return l==null||l===!1?!1:typeof l=="function"||l&&l.type==="rod"?!0:Array.isArray(l)?l.some(ys):typeof l=="object"?Object.values(l).some(ys):!1}function os(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=>os(R,E))}function is(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 Es(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=is(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 Ks(l){return typeof l=="string"&&(l.startsWith("on:")||l.startsWith("on")&&l.length>2)}const yn=128,Rn=[];function zs(l,E){Rn.push({rod:l,value:String(E!=null?E:"")}),Rn.length>yn&&Rn.splice(0,Rn.length-yn)}function jn(){if(!Rn.length)return null;const l=Rn.slice();return Rn.length=0,{items:l,index:0}}function ls(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 qs(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 ko(l){if(l.startsWith("on:"))return l.slice(3);const E=l.slice(2);return E?E==="DoubleClick"?"dblclick":E.toLowerCase():""}function rs(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 Ys(l,E){const R=rs(l),B=rs(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 qn(l,E){return Array.isArray(l)?l.some(R=>qn(R,E)):E(l)?!0:!l||typeof l!="object"||Array.isArray(l)||l.nodeType?!1:Array.isArray(l.handlers)?l.handlers.some(R=>qn(R,E))||E(l.options)||typeof l.options=="function":Array.isArray(l.listeners)?l.listeners.some(R=>qn(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 Yn(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:rs(R!=null?R:!1)}];if(E(l))return Yn(l.value,E,R);if(Array.isArray(l))return l.flatMap(Ce=>Yn(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=>Yn(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:rs(Ae)}]:[]}return[]}function No(l,E){return Yn(l,E)}function Xs(l,E,R,B){const D=ko(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=No(Le,B);ge.listeners.length===we.length&&ge.listeners.every((Ae,Oe)=>{const Re=we[Oe];return Ae.handler===Re.handler&&Ys(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(pt=>pt!==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(qn(R,B)){const Le=ee.reactive.effect(()=>{pe(R)});ee._registerCleanup(l,Le);return}pe(R)}function Qs(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=qs(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 pt=pe(Ce());if(!pt.length)return;const ft=document.createDocumentFragment();pt.forEach(it=>ft.appendChild(it)),Qe.insertBefore(ft,Ae.nextSibling),Oe=pt});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=ls(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 Zs(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=ls(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=ls(Oe,D);if(Re){we(Ae,()=>qs(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 eo="http://www.w3.org/2000/svg",Ts=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 as(l){return l==="innerHTML"||l==="innerText"||l==="textContent"||l==="value"}function to(l,...E){const R=Ts.has(l),B=l==="text"&&!R?document.createTextNode(""):R?document.createElementNS(eo,l):document.createElement(l),D=We=>!!We&&We.type==="rod",ge=jn(),q=Qs(B,{isRod:D,interpolationCursor:ge}),{appendRodText:pe,appendInterpolatedText:Le,appendDynamicChild:we,appendChildValue:Ce}=q,Ae=gs(B,{isSVG:R,normalizeClass:Bn,isContentProp:as}),{isBooleanDomProp:Oe,isBindingValueKey:Re,applyBindingValue:Qe,setStyleEntry:pt,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 gt;const vt=(gt=nt.value)!=null?gt:"";We.value!==String(vt)&&ft("value",vt)});const Ot=()=>{let vt=We.value;const gt=je(We),Ye=typeof nt.value=="number"||nt.value==null;if(ct(We)&&We.value==="")vt=null;else if(ze(We)&&Ye)if(gt==="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)?gt==="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 Ut(We,nt){const Et=()=>{var vt;return String((vt=We.value)!=null?vt:"on")};Fe(()=>{const gt=(nt.value==null?null:String(nt.value))===Et();!!We.checked!==gt&&ft("checked",gt)});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(gt=>(gt==null?void 0:gt.tagName)==="OPTION"&>.selected).map(gt=>{var Ye;return String((Ye=gt.value)!=null?Ye:"")}),Ot=()=>{const gt=Array.isArray(nt.value)?nt.value.map(o=>String(o)):[],Ye=new Set(gt);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 gt=Et(),Ye=Array.isArray(nt.value)?nt.value.map(o=>String(o)):[];Ye.length===gt.length&&Ye.every((o,zt)=>o===gt[zt])||(nt.value=gt)};We.addEventListener("change",vt),ee._registerCleanup(We,()=>{We.removeEventListener("change",vt)})}function _t(We,nt){Fe(()=>{const gt=!!nt.value;!!We.selected!==gt&&ft("selected",gt)});let Et=null;const Ot=()=>{const gt=!!We.selected;nt.value!==gt&&(nt.value=gt)};queueMicrotask(()=>{var gt;Et||((gt=We.parentNode)==null?void 0:gt.tagName)!=="SELECT"||(Et=We.parentNode,Et.addEventListener("change",Ot))}),ee._registerCleanup(We,()=>{Et==null||Et.removeEventListener("change",Ot)})}function Jt(We,nt){if(Ks(We)){Xs(B,We,nt,D);return}if(We==="class"){if(ys(nt)){Fe(()=>{it(Bn(nt))});return}it(Bn(nt));return}if(We==="style"&&nt&&typeof nt=="object"){const Et=Es(pt);if(os(nt,D)){Fe(()=>{Et.apply(nt,D)});return}Et.apply(nt,D);return}if(We==="style"&&(typeof nt=="function"||D(nt))){const Et=Es(pt);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"){Ut(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(as(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 Zs(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 Ho={},no=["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"];no.forEach(l=>{window._[l]=(...E)=>to(l,...E)}),_.DOM_ELEMENTS=no,_.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 so(){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 Wo=so();function oo(l,E,R){if(!l)return;if(l.nodeType===3){l.textContent=R!=null?R:"";return}gs(l,{isSVG:l.namespaceURI===eo,normalizeClass:Bn,isContentProp:as}).applyBindingValue(E,R)}function Ao(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),oo(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,Wo(()=>{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)oo(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 cs(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"&&zs(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=Ao(E);return cs(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),pt=()=>{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,pt),Le.push(()=>Re.removeEventListener(D,pt))}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 Lo(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 bs(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 Xn(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 ws(l=[],E=null){return Xn([...E?[E]:[],...l],"[component] dispose error:")}ee.mount=function(l,E,R={}){var Le;const B=Lo(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}=bs(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=Xn(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:ws(B,typeof ge.dispose=="function"?ge.dispose:null)}:{node:ge,dispose:ws(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 Ut=ge()-Lt;Ut>=D.slowEffectMs?(pe("effectsSlow"),Le(Ut,ct||je.name||"effect"),q("effect:slow",Ut,ct||je.name||null)):q("effect",Ut,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 pt(){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:pt,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 pt(){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(pt,l.writeDelay):queueMicrotask(pt))}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)}),gt=ut(Ze,o=>{nt()!==o&&Et(o)},Jt);return[nt,Et,()=>{try{vt==null||vt()}catch(o){}try{gt==null||gt()}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 Ut(){return{prefix:l.prefix,storage:l.storage,syncTabs:l.syncTabs,cacheSize:E.size,scopeCount:D.size}}return{configure:Lt,stats:Ut,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[pt,ft]=l.reactive.signal(null);q[Oe]={getErr:pt,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=pt();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 pt=Qe.els[0];pt&&pt.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,"/"),pt=decodeURIComponent(atob(Qe).split("").map(ft=>"%"+ft.charCodeAt(0).toString(16).padStart(2,"0")).join(""));return JSON.parse(pt)}catch(Qe){return null}}function Le(){var Oe,Re,Qe,pt;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:(pt=(Qe=D.user)==null?void 0:Qe.call(D))!=null?pt: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",pt=!!((je=D.isAuth)!=null&&je.call(D)),ft=Oe.expiresAt||null,it=ft?ft-q():null;return pt?`AUTH \u2705 user=${Qe}${ft?` expiresIn=${Math.round(it/1e3)}s`:""}`:`AUTH \u274C user=${Qe}`}function Ce(Oe="auth"){var Lt,Ut,Ze;const Re=Le()||{},Qe=(Ut=Re.user)!=null?Ut:(Lt=D.user)==null?void 0:Lt.call(D),pt=(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:pt,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(pt){}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,pt=[];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)=>pt.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}),pt.forEach(Ut=>Ut.res(!0)),pt=[],!0}catch(kt){throw pt.forEach(Lt=>Lt.rej(kt)),pt=[],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(),Ut=new Headers(kt.headers||{});Lt!=null&&Lt.accessToken&&Ut.set(ge.tokenHeader,ge.tokenPrefix+Lt.accessToken);const Ze=await fetch(ut,{...ge.fetchOptions,...kt,headers:Ut});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"),[pt,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 Ut=0;function Ze(We){const nt=++Ut,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===Ut&&(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:pt,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 pt,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:(pt=Ae.credentials)!=null?pt: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:Mn,sleep:Hn,isRetryable:vs,makeAbort:Ss,normalizeRequest:us,runHooks:Ps,wrapResponse:io,withJSON:Qn}=ee._httpShared,Wn=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{},lo={baseURL:((Ds=Wn.http)==null?void 0:Ds.baseURL)||"",timeout:(co=(ao=Wn.http)==null?void 0:ao.timeout)!=null?co:0,retry:((Nt=Wn.http)==null?void 0:Nt.retry)||{attempts:0,delay:250,factor:2},headers:((xs=Wn.http)==null?void 0:xs.headers)||{},credentials:(J=Wn.http)==null?void 0:J.credentials,debug:(Un=Wn.debug)!=null?Un:!1},Js=Mn(ee),Cs=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now(),En={beforeRequest:new Set,afterResponse:new Set,onError:new Set};async function ro(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 pn(l,E={}){var Re,Qe,pt;let R=us(lo,l,E);R=await Ps(En.beforeRequest,R);const B=Js.markStart(R),D=Cs(),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}=Ss(R.timeout,E.signal),ze={...R,signal:it},je=Cs();try{lo.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 ro(ze);Ce=ct;const ut=await Ps(En.afterResponse,ct,ze),kt=Cs()-je;if((pt=ee.perf)==null||pt.tick("http:res",kt,{status:ct.status,url:R.url}),ft<q&&vs(null,ut)){Fe(),await Hn(pe),pe=Math.round(pe*Le);continue}return Fe(),Ae=ut,io(ut,ze)}catch(ct){we=ct,Fe();for(const ut of En.onError)try{ut(ct,ze)}catch(kt){}if(ft<q&&vs(ct,null)){await Hn(pe),pe=Math.round(pe*Le);continue}throw Oe=ct,ct}}}finally{const ft=Cs()-D;Js.markEnd(B,Ae,Oe,ft)}if(we)throw we;return io(Ce,R)}ee.http={},ee.http.request=pn,ee.http.state=()=>Js.state,ee.http.get=(l,E)=>pn(l,{...E,method:"GET"}),ee.http.del=(l,E)=>pn(l,{...E,method:"DELETE"}),ee.http.post=(l,E,R)=>Qn(pn,"POST",l,E,R),ee.http.put=(l,E,R)=>Qn(pn,"PUT",l,E,R),ee.http.patch=(l,E,R)=>Qn(pn,"PATCH",l,E,R),ee.http.getJSON=async(l,E)=>(await pn(l,{...E,method:"GET"})).jsonStrict(),ee.http.delJSON=async(l,E)=>(await pn(l,{...E,method:"DELETE"})).jsonStrict(),ee.http.postJSON=async(l,E,R)=>(await Qn(pn,"POST",l,E,R)).jsonStrict(),ee.http.putJSON=async(l,E,R)=>(await Qn(pn,"PUT",l,E,R)).jsonStrict(),ee.http.patchJSON=async(l,E,R)=>(await Qn(pn,"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,pt)=>{Re[Qe]=decodeURIComponent(Oe[pt+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),pt=[];Re.length&&pt.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&&pt.push(...Ae),Oe.length&&pt.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 pt.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),pt.length?_.h4({class:"cms-doc-table-section-title"},Ae.length?"Props":"Documentation"):_.p({class:"cms-muted"},"Nessuna documentazione strutturata disponibile."),pt.length?pe?_.TabPanel({border:!0,animated:!0,orientation:"horizontal",tabs:pt,model:Qe}):B(_,pt):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,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 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 Yt="#"+te;o?window.location.replace(Yt):window.location.hash=Yt;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 Yt=je(zt.pathname),ye=Re(Yt,E),Bt={path:Yt,fullPath:te,params:ye?ye.params:{},query:Oe(zt.search),hash:zt.hash||"",navigate:kt,outlet:R};if(ge){const jt=await ge(Bt);if(jt===!1)return;if(typeof jt=="string"){kt(jt,{replace:!0});return}}if(typeof B=="function"){try{B()}catch(jt){console.error("[router] unmount error:",jt)}B=null}if(!ye){const jt=E._notFound;jt?B=ee.mount(R,()=>jt(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 zn=null;if(Bt.renderChild=jt=>{if(!Bt._child)return null;const On=typeof jt=="string"?Bt.outlet.querySelector(jt):jt;return On?(zn=ee.mount(On,()=>Bt._child.view(Bt._child.ctx),{clear:!0}),zn):(console.warn("[router] child outlet non trovato:",jt),null)},Ke){const jt=ye.route,On={...Bt,params:{...Bt.params}};Bt._child={view:jt.view,ctx:On},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 Yt=new URL(window.location.href);te.pathname+te.search===Yt.pathname+Yt.search&&te.hash||(Ye.preventDefault(),kt(te.pathname+te.search+te.hash))}),ut(it(),{replace:!0})}function Ut(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),Yt={path:te.pattern,view:o,_compiled:te,children:[]};if(Array.isArray(zt))for(const ye of zt){const[Bt,Ct,Ke]=ye,zn=we(te.pattern+"/"+(Bt||"").replace(/^\//,""));Yt.children.push({path:zn,view:Ct,_compiled:Ae(zn),children:Array.isArray(Ke)?Ke:[]})}E.push(Yt)}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 gt(){return pe.slice()}return{meta:pt,setOutlet:Ut,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:gt}})(),(ds=ee.config)!=null&&ds.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 Zn(l){return l==null?null:String(l).trim()||null}function bn(l){const E=Array.isArray(l)?l:typeof l=="string"?l.split(","):[],R=[],B=new Set;for(const D of E){const ge=Zn(D);!ge||B.has(ge)||(B.add(ge),R.push(ge))}return R}function Rs(){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 xn(){var l;return Zn((l=ee.theme)==null?void 0:l.storageKey)||"jsswift:theme"}function Ms(){const l=Ne();if(!l)return null;try{return Zn(l.getItem(xn()))}catch(E){return null}}function Io(l){const E=Ne();if(E)try{l==null?E.removeItem(xn()):E.setItem(xn(),l)}catch(R){}}function Os(l){var B,D,ge,q,pe;const E=Rs(),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=bn(Le);if(we.length)return we}return[]}ee.theme=ee.theme||{},ee.theme.storageKey=xn(),bn(ee.theme.themes).length||(ee.theme.themes=Os()),ee.setTheme=function(l,E={}){const R=Zn(l),B=Rs();return B&&(R==null?B.removeAttribute("data-theme"):B.setAttribute("data-theme",R)),E.persist!==!1&&Io(R),B},ee.getTheme=function(l={}){var D;const E=Rs(),R=Zn((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=Ms();return B&&E&&l.sync!==!1&&E.setAttribute("data-theme",B),B},ee.toggleTheme=function(l,E={}){const R=Os(l),B=R.length?R:bn([ee.getTheme({sync:!1}),"light","dark"]),D=ee.getTheme({sync:!1}),ge=Zn(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 Eo=Ms();Eo&&ee.setTheme(Eo,{persist:!1})})(),(function(bt){var ui;bt.ui=bt.ui||{},bt.services=bt.services||{},bt.services.notify=bt.services.notify||{};const gs=Symbol("cms.ui.rodPathRaw"),Bn=Symbol("cms.ui.rodPathEnhanced"),ys=Symbol("cms.ui.rodPathPatchedH"),os=Symbol("cms.ui.rodPathWrappedUI"),is=new WeakMap,Es=new WeakMap,Ks=new WeakMap,yn=[],Rn=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},zs=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"},jn=t=>{if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};let ls=!1;const qs=()=>{ls||(ls=!0,queueMicrotask(()=>{ls=!1,yn.length=0}))},ko=t=>{yn.push(t),yn.length>128&&yn.splice(0,yn.length-128),qs()},rs=()=>{if(!yn.length)return null;const t=yn.slice();return yn.length=0,{items:t,index:0}},Ys=(t,e)=>{if(!t)return null;const n=t.items[t.index];return!n||!Object.is(n.value,e)?null:(t.index+=1,n)},qn=t=>t&&typeof t=="object"&&t[gs]?t[gs]:t,Yn=(t,e)=>{const n=is.get(t);if(!n)return;let s=n.rawGet();for(const i of e){if(s==null)return;s=s[i]}return s},No=(t,e,n)=>{const s=is.get(t);if(!s)return;const i=qn(n);if(!e.length){if(Object.is(s.rawGet(),i))return;s.rawSet(i);return}let c=s.rawGet();(!c||typeof c!="object")&&(c=Rn(e[0])?[]:{});let S=c;for(let d=0;d<e.length-1;d++){const r=e[d];let b=S[r];if(!b||typeof b!="object"){const F=e[d+1];b=Rn(F)?[]:{},S[r]=b}S=b}Object.is(S[e[e.length-1]],i)||(S[e[e.length-1]]=i,s.rawSet(c))},Xs=(t,e)=>[()=>Yn(t,e),n=>No(t,e,n)],Qs=(t,e,n=[])=>{if(!e||typeof e!="object")return e;let s=Es.get(t);s||(s=new WeakMap,Es.set(t,s));const i=s.get(e);if(i)return i;const c=new Proxy(e,{get(S,d,r){if(d===gs)return S;const b=Reflect.get(S,d,r);if(typeof d=="symbol")return b;const F=n.concat(d);return b&&typeof b=="object"?Qs(t,b,F):typeof b=="function"?b.bind(r):(zs(b)&&ko({rod:t,path:F,value:b}),b)},set(S,d,r,b){const F=qn(r),C=Reflect.get(S,d,b);if(Object.is(C,F))return!0;const w=Reflect.set(S,d,F,b);if(w){const P=is.get(t);P==null||P.rawSet(P.rawGet())}return w},deleteProperty(S,d){const r=Reflect.has(S,d),b=Reflect.deleteProperty(S,d);if(b&&r){const F=is.get(t);F==null||F.rawSet(F.rawGet())}return b}});return s.set(e,c),c},Zs=t=>{if(!t||typeof t!="object"||t.type!=="rod"||t[Bn])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,qn(i));return is.set(t,{rawGet:n,rawSet:s}),Object.defineProperty(t,"value",{get(){const i=n();return!i||typeof i!="object"?i:Qs(t,i,[])},set(i){s(i)},configurable:!0}),Object.defineProperty(t,Bn,{value:!0,configurable:!1}),t},eo=()=>{if(typeof window._.rod!="function"||window._.rod[Bn])return;const t=window._.rod,e=function(...s){return Zs(t(...s))};Object.defineProperty(e,Bn,{value:!0,configurable:!1}),window._.rod=e};bt.ui.withoutRodPathCapture=t=>{const e=yn.length;try{return t()}finally{yn.length=e}};const Ts=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const S=t.map(d=>{const r=Ts(d,e,"");return r!==d&&(c=!0),r});return c?S:t}if(zs(t)){const c=Ys(e,t);return c?n==="model"?Xs(c.rod,c.path):()=>Yn(c.rod,c.path):t}if(!jn(t))return t;let s=!1;const i={};for(const c of Object.keys(t)){const S=Ts(t[c],e,c);i[c]=S,S!==t[c]&&(s=!0)}return s?i:t},as=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const S=t.map(d=>{const r=as(d,e,"");return r!==d&&(c=!0),r});return c?S:t}if(zs(t)){const c=Ys(e,t);return c?n==="model"?Xs(c.rod,c.path):()=>Yn(c.rod,c.path):t}if(!jn(t))return t;let s=!1;const i={};for(const c of Object.keys(t)){const d=c==="model"||c==="children"?as(t[c],e,c):t[c];i[c]=d,d!==t[c]&&(s=!0)}return s?i:t},to=t=>{if(typeof t!="function"||t[os])return t;const e=Ks.get(t);if(e)return e;const n=function(...i){const c=rs();if(!c)return t.apply(this,i);let S=!1;const d=i.map(r=>{const b=as(r,c,"");return b!==r&&(S=!0),b});return t.apply(this,S?d:i)};return Object.defineProperty(n,os,{value:!0,configurable:!1}),Ks.set(t,n),n},Ho=()=>{const t=bt.ui;if(!(!t||t[os])){Object.defineProperty(t,os,{value:!0,configurable:!1});for(const e of Object.keys(t))typeof t[e]=="function"&&(t[e]=to(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"?to(s):s;return Reflect.set(e,n,c,i)}})}},no=()=>{if(!window._||window._[ys])return;Object.defineProperty(window._,ys,{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=rs();if(!c)return n.apply(this,i);let S=!1;const d=i.map(r=>{const b=Ts(r,c,"");return b!==r&&(S=!0),b});return n.apply(this,S?d:i)})}};eo(),((ui=JSswift.rod)==null?void 0:ui._all)instanceof Set&&JSswift.rod._all.forEach(t=>Zs(t)),no(),Ho();const so={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},Wo=new Set(Object.values(so)),oo=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),Ao=new Set(["none","sm","md","lg"]),cs={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 so[e]||""},Lo=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":oo.has(e)?e:null},bs=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return Ao.has(e)?e:null},Xn=t=>t&&typeof t=="object"&&!t.nodeType&&!Array.isArray(t)&&!(t instanceof Function),ws=t=>t&&t.nodeType===1&&String(t.tagName||"").toLowerCase()==="li",Mn=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];JSswift.isUIPlainObject=Xn,JSswift.isListItemNode=ws,JSswift.asNodeArray=Mn;const Hn=[{key:"mobile",aliases:["mobile","mobil"],prefix:"cms-"},{key:"tablet",aliases:["tablet"],prefix:"cms-tablet-"},{key:"pc",aliases:["pc","desktop"],prefix:"cms-pc-"}],vs=Hn.flatMap(t=>t.aliases),Ss=(t,e)=>Object.prototype.hasOwnProperty.call(t||{},e),us=(t={},e)=>{if(!e)return null;for(const n of e.aliases){if(!Ss(t,n))continue;const s=o(t[n]);if(Xn(s))return s}return null},Ps=(t={},e)=>{const n=Array.isArray(e)?e:[e];return Hn.some(s=>{const i=us(t,s);return!!i&&n.some(c=>Ss(i,c))})},io=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),Qn=(t={},e=[])=>{const n=[];for(const s of Hn){const i=us(t,s);if(i)for(const c of e){const S=Array.isArray(c.prop)?c.prop:[c.prop];let d=!1,r,b="";for(const w of S)if(Ss(i,w)){r=o(i[w]),b=w,d=!0;break}if(!d||r==null||r===""||r===!1&&!c.allowFalse)continue;const F=typeof c.map=="function"?c.map(r,{propName:b,props:i,device:s,rule:c}):`${c.class}-${io(r)}`,C=Array.isArray(F)?F:[F];for(const w of C)w&&n.push(String(w).startsWith("cms-")?w:`${s.prefix}${w}`)}}return n},Wn=(t={})=>Hn.some(e=>!!us(t,e)),lo=(t={},e=[])=>{for(const n of e){if(!Ss(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)},Cs=(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}`,ro=(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])}},pn=(t,e={},n=[])=>{if(!t||!e||!Wn(e))return t;const s=t.style||{};let i=!1;for(const c of n){const S=Array.isArray(c.prop)?c.prop:[c.prop],d=(r,b)=>{const F=lo(b,S),C=Js(F,c);if(!C)return;const w=c.var||c.css,P=r==="mobile"?"--cms-rsp-":`--cms-rsp-${r}-`;Cs(s,`${P}${w}`,C),ro(t,En(r,w)),i=!0};d("mobile",e);for(const r of Hn){const b=us(e,r);b&&d(r.key,b)}}return i&&(t.nodeType||(t.style=s),ro(t,"cms-rsp")),t};JSswift.uiResponsiveDevices=Hn,JSswift.uiResponsiveOmitProps=vs,JSswift.uiResponsivePropsFor=us,JSswift.uiResponsiveHasConfig=Wn,JSswift.uiResponsiveHasProp=Ps,JSswift.uiResponsiveClasses=Qn,JSswift.uiApplyResponsiveProps=pn;const Zn=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(vs):vs;return Zn(t,n)};const bn=(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=bs(i);return c?`cms-shadow-${c}`:""}),n.boxShadow=()=>{const i=o(t.shadow);return bs(i)||i==null||i===!1?"":typeof i=="string"?i:""};else{const i=bs(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||{}})},Rs=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=Rs(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 bn(n),e};const Ne=window._;function xn(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 Ms={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"},Io=t=>t===!0?"wrap":t===!1?"nowrap":String(t),Os=t=>typeof t=="number"?`repeat(${Math.max(1,Math.round(t))}, minmax(0, 1fr))`:String(t),Fs=[{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:Io},{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:Os},{prop:"rows",css:"grid-template-rows",var:"grid-template-rows",mapValue:Os},{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"}],Ds=Fs.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return e.some(n=>Object.prototype.hasOwnProperty.call(Ms,n))||e.includes("fontSize")||e.includes("fontWeight")||e.includes("lineHeight")||e.includes("letterSpacing")||e.includes("borderRadius")||e.includes("radius")});JSswift.uiResponsiveStyleRules=Fs,JSswift.uiResponsiveCommonStyleRules=Ds;const ao=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),co=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(ao(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(Ms).forEach(([n,s])=>{Ps(e,n)||co(t,e[n],n,s)}),pn(t,e,Ds),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 xs(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:xn(JSswift.ui.slot(S))};const J=(t,e,n,s)=>{const i=JSswift.ui.renderSlot(t,e,n,s);return i?Array.isArray(i)?i:[i]:[]},Un=new Set;let ds=!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,S;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const d=ge((S=(c=(i=n.shortcode)!=null?i:n.shortcut)!=null?c:n.keys)!=null?S: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,pt=()=>{Un.size||!ds||typeof document=="undefined"||(document.removeEventListener("keydown",ft,!0),ds=!1)};function ft(t){var s,i,c,S,d,r;if(!Un.size||!t||t.defaultPrevented||t.isComposing)return;const e=Re(t.target),n=Array.from(Un);for(let b=n.length-1;b>=0;b-=1){const F=n[b],C=F==null?void 0:F.anchor;if(!C||!C.isConnected){Un.delete(F);continue}if(((s=F.isEnabled)==null?void 0:s.call(F))===!1)continue;const w=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(!w)continue;const P=(c=(i=w.preventDefault)!=null?i:F.preventDefault)!=null?c:!0,le=(d=(S=w.stopPropagation)!=null?S:F.stopPropagation)!=null?d:!0;if(P&&t.preventDefault(),le&&t.stopPropagation(),((r=F.action)==null?void 0:r.call(F,t,w,C))!==!1)break}pt()}const it=(t,e={},n={})=>{var S,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:(S=n.preventDefault)!=null?S:!0,stopPropagation:(d=n.stopPropagation)!=null?d:!0};Un.add(i),ds||(document.addEventListener("keydown",ft,!0),ds=!0);const c=()=>{Un.delete(i),pt()};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""},Ut=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:Ut},{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,x,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,x);return x==null?[]:J(null,"default",g,x)},c=a=>{var x;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((x=JSswift.uiSizes)!=null&&x.includes(a))?`var(--cms-s-${a})`:String(a)},S=a=>{var x;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((x=JSswift.uiSizes)!=null&&x.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||{}},b=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),C=Ke(e.justify),w=Ke(e.wrap,a=>typeof a=="boolean"?a?"wrap":"nowrap":String(a)),P=Ke(e.gap,c),le=Ke(e.rowGap,c),Z=Ke(e.columnGap,c),he=Ke(e.inline,a=>a?"inline-flex":"flex"),H=Ke(e.width,S),W=Ke(e.minWidth,S),se=Ke(e.maxWidth,S),X=Ke(e.full,a=>a?"100%":"",""),fe=Ct([e.inline,e.full,e.width],()=>{const a=!!o(e.inline),x=!!o(e.full),g=o(e.width)!=null&&o(e.width)!==!1&&o(e.width)!=="";return!a||x||g?"":"max-content"});b!=null&&!Ze(e,"direction")&&(r.flexDirection=b),F!=null&&!Ze(e,"align")&&(r.alignItems=F),C!=null&&!Ze(e,"justify")&&(r.justifyContent=C),w!=null&&!Ze(e,"wrap")&&(r.flexWrap=w),P!=null&&!Ze(e,"gap")&&(r.gap=P),le!=null&&!Ze(e,"rowGap")&&(r.rowGap=le),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),x=_.div(d,...a);return Nt(x,e),x}const $={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},re=(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",re]),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 gt(t){return!!t&&t.type==="rod"}function Ye(t){return typeof t=="function"||gt(t)||vt(t)}function o(t){return typeof t=="function"?t():gt(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 S=o(c);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 Yt(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=Yt,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)},S=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"):yt(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""},b=()=>{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"}),C=JSswift.omit(e,["slots","col","span","sm","md","lg","auto","size","width","minWidth","maxWidth","height","minHeight","maxHeight","gap","rowGap","columnGap","align","justify","inline","center","stack","flex","fill","grow","shrink","basis","self","order","scroll","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass",...JSswift.uiResponsiveOmitProps]),w={...e.style||{}};!Ze(e,"minWidth")&&w.minWidth==null&&(w.minWidth=0);const P=Ke(e.gap,S),le=Ke(e.rowGap,S),Z=Ke(e.columnGap,S),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":"",""),re=Ct([e.flex,e.fill,e.grow,e.shrink,e.basis],b),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)===""));re!=null&&re!==""&&(w.flex=re),de!=null&&!Ze(e,"self")&&(w.alignSelf=de),ce!=null&&(w.order=ce),$!=null&&$!==""&&(w.overflow=$),se!=null&&se!==""&&!Ze(e,["width","size"])&&(w.width=se,!i("flex")&&!i("fill")&&!i("grow")&&!i("shrink")&&!i("basis")&&(w.flex="0 0 auto")),X!=null&&!Ze(e,"minWidth")&&(w.minWidth=X),fe!=null&&!Ze(e,"maxWidth")&&(w.maxWidth=fe),_e!=null&&!Ze(e,"height")&&(w.height=_e),be!=null&&!Ze(e,"minHeight")&&(w.minHeight=be),me!=null&&!Ze(e,"maxHeight")&&(w.maxHeight=me),Object.keys(w).length&&(C.style=w);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(C.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")&&(w.gap=P),le!=null&&!Ze(e,"rowGap")&&(w.rowGap=le),Z!=null&&!Ze(e,"columnGap")&&(w.columnGap=Z),he!=null&&!Ze(e,"align")?w.alignItems=he:oe!=null&&oe!==""&&(w.alignItems=oe?"center":""),H!=null&&!Ze(e,"justify")?w.justifyContent=H:oe!=null&&oe!==""&&(w.justifyContent=oe?"center":""),Object.keys(w).length&&(C.style=w),JSswift.uiApplyResponsiveProps(C,e,JSswift.uiResponsiveStyleRules),!V){const A=_.div(C,...J(s,"default",Se,n));return Nt(A,e),A}const a={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},x=[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(C,...x);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=x=>Object.prototype.hasOwnProperty.call(e,x),S={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},d=x=>{if(x==null||x===!1||x==="")return"";if(typeof x=="number")return`${x}px`;const g=String(x).trim().toLowerCase();return g?g==="full"||g==="fluid"?"100%":S[g]||String(x):""},r=x=>{var g;return x==null||x===!1||x===""?"":typeof x=="number"?`${x}px`:typeof x=="string"&&((g=JSswift.uiSizes)!=null&&g.includes(x))?`var(--cms-s-${x})`:String(x)},b=x=>{if(x==null||x===!1||x==="")return"";if(typeof x=="number"&&Number.isFinite(x))return`repeat(${Math.max(1,Math.floor(x))}, minmax(0, 1fr))`;const g=String(x).trim();return g?/^\d+$/.test(g)?`repeat(${Math.max(1,Number(g))}, minmax(0, 1fr))`:g:""},F=x=>x==null||x===""?"":x===!0?"wrap":x===!1?"nowrap":String(x),C={props:e},w=(x,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(M=>w(x,M));return}if(g!=null&&g.nodeType){x.appendChild(g);return}x.appendChild(document.createTextNode(String(g)))}},P=(x,g)=>{const M=JSswift.ui.getSlot(s,x);if(M!=null)return J(s,x,C,null);if(typeof g=="function"){const Y=_.div({class:`cms-container-slot-${x}`});return JSswift.reactive.effect(()=>{const Q=xn(JSswift.ui.slot(g(C)));Y.replaceChildren(),Array.isArray(Q)?Q.forEach(ve=>w(Y,ve)):w(Y,Q)},`UI.Container:${x}`),[Y]}return J(s,x,C,g)},le=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 x=P("content",c("content")?e.content:null);return x.length?x:P("default",le)})(),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 x=String(o((g=e.layout)!=null?g:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(x)?x:["inline","inline-flex","inlineflex"].includes(x)||o(e.inline)?"inline":o(e.grid)||o(e.cols)!=null?"grid":x==="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 x=de();return x==="block"?"":`is-${x}`}),$={...i.style||{}},re=(x,g)=>{g!=null&&($[x]=g)};re("maxWidth",Ct([e.maxWidth,e.fluid],()=>o(e.fluid)?"none":d(o(e.maxWidth))||"")),re("width",Ke(e.width,d)),re("minWidth",Ke(e.minWidth,d)),re("--cms-container-padding",Ke(e.padding,r)),re("--cms-container-padding-x",Ke((ie=e.paddingX)!=null?ie:e.gutter,r)),re("--cms-container-padding-y",Ke(e.paddingY,r)),re("--cms-container-gap",Ke(e.gap,r)),re("--cms-container-section-gap",Ke((a=e.sectionGap)!=null?a:e.gap,r)),re("--cms-container-cols",Ke(e.cols,b)),re("--cms-container-align",Ke(e.align,x=>String(x))),re("--cms-container-justify",Ke(e.justify,x=>String(x))),re("--cms-container-direction",Ke(e.direction,x=>String(x))),re("--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=(x,g,M)=>g.length?_.div({class:te(["cms-container-section",`cms-container-${x}`,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 x=String(o((g=e.tag)!=null?g:e.as)||"div").toLowerCase();return typeof _[x]=="function"?_[x]:_.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};bn(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,b={dense:!!o(e.dense),flat:!!o(e.flat),clickable:!!o(e.clickable),to:o(e.to)||null},F=J(s,"default",b,n!=null&&n.length?n:[]),C={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},w=[];F.forEach(f=>{c(f,"identifier")?C.identifier.push(f):c(f,"cover")?C.cover.push(f):c(f,"media")?C.media.push(f):c(f,"header")?C.header.push(f):c(f,"body")?C.body.push(f):c(f,"footer")?C.footer.push(f):c(f,"actions")?C.actions.push(f):w.push(f)});const P=J(s,"identifier",b,e.identifier),le=J(s,"cover",b,r),Z=J(s,"media",b,e.media),he=J(s,"eyebrow",b,(ve=e.eyebrow)!=null?ve:e.kicker),H=J(s,"title",b,e.title),W=J(s,"subtitle",b,e.subtitle),se=J(s,"header",b,e.header),X=J(s,"icon",b,d),fe=J(s,"aside",b,(N=e.aside)!=null?N:e.headerAside),_e=J(s,"body",b,e.body),be=J(s,"footer",b,e.footer),me=J(s,"actions",b,e.actions),de=P.length?_.div({class:te(["cms-card-identifier",e.identifierClass])},...P):null,ce=le.length?_.div({class:te(["cms-card-cover",e.coverClass])},...le):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,...w],L=Se.length?_.div({class:te(["cms-card-body",e.bodyClass])},...Se):null,m=[...me,...C.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||C.identifier.length,ie=le.length||C.cover.length||Z.length||C.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"]=yt(o(e.coverHeight))),JSswift.uiApplyResponsiveProps(a,e,JSswift.uiResponsiveStyleRules);const x=e.onClick,g=e.onKeydown,M=f=>{var z;if(x==null||x(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,...C.identifier,ce,...C.cover,$,...C.media,oe,...C.header,L,...C.body,h,...C.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]),S=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);S.class=c;const d=()=>!!o(e.loading),r=()=>!!o(e.disabled)||d(),b=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,C=JSswift.ui.renderSlot(s,"icon",{},b),w=JSswift.ui.renderSlot(s,"iconRight",{},F),P=JSswift.ui.renderSlot(s,"label",{},e.label),le=J(s,"default",{},n),Z=[],he=$=>{$&&(Array.isArray($)?Z.push(...$):Z.push($))},H=e.iconAlign;(H==="after"||H==="right")&&!F?(he(P),le.length&&Z.push(...le),he(C)):(he(C),he(P),le.length&&Z.push(...le)),he(w),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 re=$.currentTarget,oe=re.getBoundingClientRect(),Se=typeof $.clientX=="number"?$.clientX-oe.left:oe.width/2,L=typeof $.clientY=="number"?$.clientY-oe.top:oe.height/2;re.style.setProperty("--cms-burst-x",`${Se}px`),re.style.setProperty("--cms-burst-y",`${L}px`),re.classList.remove("cms-btn-burst"),re.offsetWidth,re.classList.add("cms-btn-burst")},me=_.button({...S,disabled:r(),onClick:$=>{var re,oe;return r()?((re=$==null?void 0:$.preventDefault)==null||re.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(),re=r();me.disabled=re,me.classList.toggle("is-loading",$),me.setAttribute("aria-disabled",re?"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,$,re,oe,Se;bn(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,S=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),b=()=>{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:S,clear:b,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:r()},null);let C=null,w=null;if(F)C=Array.isArray(F)?_.div({class:"cms-control"},...F):F;else{C=_.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&&C.appendChild(L);const V=_.div({class:"cms-mid"+(L.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});S&&V.appendChild(S);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)}C.appendChild(V);const a=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:b},Ne.Icon({name:"close"})):null,x=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:r()},a);x&&(x.onclick=N=>{N.stopPropagation(),b()},J(null,"default",{},x).forEach(N=>C.appendChild(N))),w=a,w&&((me=t.clearable)!=null&&me.action)&&t.clearable.action(N=>N?w.classList.remove("cms-d-none"):w.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&&(C.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),le=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(le(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 x;return(x=C==null?void 0:C.classList)==null?void 0:x.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=C==null?void 0:C.classList)==null||m.toggle("has-value",L),w&&(w.style.display=L?"":"none")};JSswift.reactive.untracked(H),(de=C==null?void 0:C.classList)==null||de.toggle("disabled",!!t.disabled),s.appendChild(C);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||(re=t.success)!=null&&re.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=C,s._el=S,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 w;const C=(w=e.value)!=null?w:"";C!==n&&(n=C,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let i=null,c=!1;const S=()=>{if(c)return;c=!0;let C=0;const w=()=>{if(s(),C+=1,C>=10){c=!1;return}setTimeout(w,120)};setTimeout(w,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 C;n=(C=e.value)!=null?C:""}),e.addEventListener("change",()=>{var C;n=(C=e.value)!=null?C:""}),e.addEventListener("animationstart",C=>{C.animationName==="cms-autofill"&&(s(),d(),S())}),e.addEventListener("focus",()=>{d(),S(),setTimeout(s,50)}),e.addEventListener("blur",()=>{r(),setTimeout(s,0)}),setTimeout(s,0),S();const b=t.model;if(b){if(typeof b=="object"&&typeof b._bind=="function")bt.rodModel(e,b);else if(Array.isArray(b)&&typeof b[0]=="function"&&typeof b[1]=="function"){const C=bt.rodFromSignal(b[0],b[1]);bt.rodModel(e,C)}}return it(e,t,{isEnabled:()=>!e.disabled,action:()=>Fe(e,{selectText:!!t.selectOnShortcode})}),e};function zn(t,e,n,s=!1){t.focus=c=>e.focus(c);const i=(c,S)=>{S==null||S===!1?e.removeAttribute(c):e.setAttribute(c,String(S))};JSswift.reactive.effect(()=>{var r;const c=(r=o(n.ariaLabel))!=null?r:typeof n.label=="string"?n.label:null;i("aria-label",c),i("aria-labelledby",o(n.ariaLabelledBy)),i("aria-describedby",o(n.ariaDescribedBy));const S=n.ariaInvalid==null?!!o(n.error):!!o(n.ariaInvalid);e.setAttribute("aria-invalid",String(S));const d=!!o(n.required);if(e.setAttribute("aria-required",String(d)),s){e.required=d;for(const b of["min","max","step","pattern","minLength","maxLength"])i(b.toLowerCase(),o(n[b]))}},"UI.Field:controlAttributes")}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 S=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)},b=()=>{S||(S=setInterval(()=>{if(document.activeElement!==s){clearInterval(S),S=null;return}c()},250))},F=()=>{S&&(clearInterval(S),S=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),b(),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(),b(),r())}),setTimeout(c,0),r();const C=t.model;if(C){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 C=="object"&&typeof C._bind=="function")W(C);else if(Array.isArray(C)&&typeof C[0]=="function"&&typeof C[1]=="function"){const se=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(C[0],C[1]));W(se)}}const w=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),P=Array.isArray(w)?_.div({style:{display:"contents"}},...w):w,le=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=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,zn(le,s,t,!0),it(s,t,{isEnabled:()=>!s.disabled,action:()=>Fe(s,{selectText:!!t.selectOnShortcode})}),le},Ne.Textarea=(t={})=>{var b,F,C,w;const e=t.slots||{},n={...t,label:(b=t.label)!=null?b: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:(C=t.minLength)!=null?C:t.minlength,wrap:t.wrap,value:(w=t.value)!=null?w:"",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 le;(le=t.onFocus)==null||le.call(t,P)}),s.addEventListener("blur",P=>{var le;(le=t.onBlur)==null||le.call(t,P)});const i=t.model;if(i){const P=le=>{let Z=!1;const he=W=>{const se=W!=null?W:"";s.value!==se&&(s.value=se)};le.action(W=>{if(!Z){Z=!0;try{he(W)}finally{Z=!1}}}),JSswift.reactive.untracked(()=>he(le.value));const H=W=>{if(Z||W!=null&&W.isComposing)return;const se=s.value;if(le.value!==se){Z=!0;try{le.value=se}finally{Z=!1}}};s.addEventListener("input",H),s.addEventListener("compositionend",H),typeof le.onDispose=="function"&&le.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 le=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(i[0],i[1]));P(le)}}const c=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",S=JSswift.ui.renderSlot(e,c,{textarea:s,input:s,props:t},s),d=Array.isArray(S)?_.div({style:{display:"contents"}},...S):S,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,S]=JSswift.reactive.signal(i==null?"":String(i)),[d,r]=JSswift.reactive.signal(!1),[b,F]=JSswift.reactive.signal(!1),[C,w]=JSswift.reactive.signal(null),[P,le]=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},re=(O,k=!1)=>{const v=o(O);return v==null?k:!!v},oe=()=>re(t.disabled,!1),Se=()=>re(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()},x=(O,k={})=>{var u,I;const v=O==null?"":String(O);c()!==v&&S(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=()=>b()||C()||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=()=>{le([]),w(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)){le(W.get(et)),w(null),F(!1),he(W.get(et).length?0:-1),k.open!==!1&&Y();return}F(!0),w(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),le(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;w(It),le([]),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"?x(v,{event:k}):t.commitValue!==!1&&x(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=>x(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(()=>{x(O(),{fromModel:!0})},"UI.Search:model"),se=v=>k(v)}}else Ye(t.value)&&JSswift.reactive.effect(()=>{x(o(t.value),{fromModel:!0})},"UI.Search:value");ae.addEventListener("input",O=>{x(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=b(),k=C(),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()||(x("",{}),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=>x(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||{},S=k=>!!k&&(typeof k=="object"&&typeof k._bind=="function"||vt(k)),d=S(t.model)?t.model:S(t.value)?t.value:null,r=k=>Array.isArray(k)?k.slice():k==null||k===""?[]:[k],b=k=>s?r(k):k,F=d?JSswift.reactive.untracked(()=>typeof d=="object"&&typeof d._bind=="function"?d.value:d[0]()):t.value,[C,w]=JSswift.reactive.signal(!1),[P,le]=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(b(d.value))),d.action(k=>he(b(k))),de=k=>{const v=b(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(b(k()))},"UI.Select:model")}),de=u=>v(b(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 re(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,re(v)}catch(u){console.error("[UI.Select] options load error:",u),re([])}finally{W(!1)}}function Se(k){var u;const v=b(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(){le(""),ve&&(ve.value="")}function p(){w(!1),h(),me(-1)}async function V(){if(ce())return;w(!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(){C()?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"}),x=_.div({class:te(["cms-select-value",s?"cms-select-value-multi":""])});JSswift.reactive.effect(()=>{const k=fe();if(x.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))}});x.appendChild(et)}}else{const v=Z(),u=k.find(I=>I.value==v);x.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:C()},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},x,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=>le(k.target.value||"")}),f=()=>{const k=JSswift.ui.renderSlot(c,"filter",{value:P(),setValue:u=>{const I=u==null?"":String(u);le(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};bn(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=()=>{!C()||K.parentNode!==document.body||ke||(ke=requestAnimationFrame(()=>{if(ke=0,!C()||!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=C();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))),C()&&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))),C()&&Te();return}}if(Ue){const tt=JSswift.ui.renderSlot(c,"loading",{},"Caricamento...");Y.appendChild(_.div({class:"cms-select-empty"},...J(null,"default",{},tt))),C()&&Te();return}for(const tt of G)Y.appendChild(tt);Ee(),C()&&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=C(),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"),zn(T,a,t),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;bn(t);const e=t.slots||{},[n,s]=JSswift.reactive.signal([]),[i,c]=JSswift.reactive.signal(!1),[S,d]=JSswift.reactive.signal(!1),[r,b]=JSswift.reactive.signal(null);let F=0,C=!1;const w=()=>!!o(t.disabled)||!!o(t.readonly),P=()=>t.multiple!==!1&&t.single!==!0,le=()=>{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!le()&&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"),re=(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&&re(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(w())return[];b(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&&!le()&&f(),k},V=(T={})=>{var Pe;for(const O of n())O.status==="uploading"&&a(O),O.status="removed";s([]),b(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())},x=()=>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,b(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(C||w())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=()=>{w()||K.click()},K=_.input({type:"file",class:"cms-upload-input",name:X(),accept:de()||null,multiple:P(),capture:t.capture||null,disabled:w(),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(le(),"is-form-mode"),ye(!W(),"is-files-hidden"),t.class]),tabindex:w()?"-1":"0",role:"group","aria-disabled":w()?"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:x,files:()=>n().slice(),state:()=>({files:n().slice(),busy:S(),dragging:i(),error:r()}),reset:V},Ve=()=>{const T={api:ne,files:n().slice(),busy:S(),disabled:w(),submitMode:le()?"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:S(),disabled:w()||!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:w()||!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||w()||(T.preventDefault(),c(!0),j.classList.add("is-dragging"))},onDragover:T=>{t.drag===!1||w()||T.preventDefault()},onDragleave:T=>{T.currentTarget===T.target&&(c(!1),j.classList.remove("is-dragging"))},onDrop:T=>{var Pe,O;t.drag===!1||w()||(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",w()),j.classList.toggle("is-form-mode",le()),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",w()?"true":"false"),K.disabled=w(),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=()=>{C||(C=!0,x())},(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 jt(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 On={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"]}},uo=t=>{const e=o(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},wn=(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":"."],b=[],F=[...t.rows||[]];if(c&&s==="top"&&!F.includes("nav")){const C=F.indexOf("body");F.splice(C>=0?C:F.length,0,"nav")}for(const C of F)C==="header"&&e.header?b.push(t.fullSide&&i&&n==="left"?["aside","header","header"]:t.fullSide&&i&&n==="right"?["header","header","aside"]:["header","header","header"]):C==="nav"&&c&&s==="top"?b.push(t.fullSide&&i&&n==="left"?["aside","nav","nav"]:t.fullSide&&i&&n==="right"?["nav","nav","aside"]:["nav","nav","nav"]):C==="body"?b.push(r):C==="footer"&&e.footer&&b.push(t.fullSide&&i&&n==="left"?["aside","footer","footer"]:t.fullSide&&i&&n==="right"?["footer","footer","aside"]:["footer","footer","footer"]);return b.length?b.map(C=>`"${C.join(" ")}"`).join(" "):null};Ne.Layout=(...t)=>{var ms,ts,ns;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(Xe,ht)=>!!Xe&&Object.prototype.hasOwnProperty.call(Xe,ht),c=()=>typeof window=="undefined"?1024:window.innerWidth,S=()=>{const Xe=c(),ht=JSswift.uiResponsivePropsFor(e,xt("mobile"))||{},Mt=Xe>=768?JSswift.uiResponsivePropsFor(e,xt("tablet"))||{}:{},qt=Xe>=1024?JSswift.uiResponsivePropsFor(e,xt("pc"))||{}:{};return{...ht,...Mt,...qt}},d=(...Xe)=>{for(const ht of Xe)if(i(e,ht))return e[ht]},r=(...Xe)=>{const ht=S();for(const Mt of Xe)if(i(ht,Mt))return ht[Mt];return d(...Xe)},b=(...Xe)=>{const ht=JSswift.uiResponsivePropsFor(e,xt(U()))||{};for(const Mt of Xe)if(i(ht,Mt))return ht[Mt];return d(...Xe)},F=()=>uo(b("disposition","layoutDisposition","layout")),C=()=>{const Xe=o(r("mode","layoutMode"));if(Xe==null||Xe===!1||Xe==="")return"";const ht=String(Xe).trim().toLowerCase();return ht==="global"||ht==="local"?ht:""},w=(Xe,ht=null)=>Xe==null||Xe===!1||Xe===""?ht:typeof Xe=="number"?`${Xe}px`:String(Xe),P=(Xe,ht=null)=>{if(Xe==null||Xe===!1||Xe==="")return ht;if(typeof Xe=="number"&&Number.isFinite(Xe))return Xe;const Mt=Number.parseFloat(String(Xe));return Number.isFinite(Mt)?Mt:ht},le=Xe=>{const ht=o(Xe);return ht==null||ht===!1||ht===""?null:Array.isArray(ht)?ht.map(Mt=>`"${Array.isArray(Mt)?Mt.join(" "):String(Mt)}"`).join(" "):String(ht)},Z=(Xe,ht=null,Mt=null)=>{let qt=Number.isFinite(Xe)?Xe:0;return Number.isFinite(ht)&&(qt=Math.max(ht,qt)),Number.isFinite(Mt)&&(qt=Math.min(Mt,qt)),qt},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,re=()=>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((ms=o(r("navWidth")))!=null?ms:o(r("asideRightWidth")),280),[a,x]=JSswift.reactive.signal(Z(V,L(),m())),[g,M]=JSswift.reactive.signal(Z(ie,h(),p())),Y=jt(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 ht=!!Xe;ve()!==ht&&N(ht),Y==null||Y.set(ht)};(ts=Y==null?void 0:Y.watch)==null||ts.call(Y,()=>{const Xe=!!Y.get();ve()!==Xe&&N(Xe)});const A=jt(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 ht=!!Xe;K()!==ht&&ke(ht),A==null||A.set(ht)};(ns=A==null?void 0:A.watch)==null||ns.call(A,()=>{const Xe=!!A.get();K()!==Xe&&ke(Xe)});const Te=()=>{var qt,en,tn;const Xe=Number((qt=o(r("layoutBreakpoint")))!=null?qt:0),ht=Number((en=o(r("drawerBreakpoint")))!=null?en:Xe||1024),Mt=Number((tn=o(r("navBreakpoint")))!=null?tn:Xe||ht);return Math.max(ht,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:()=>re()}),Ee=(Xe,ht)=>{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 qt=typeof ht=="function"?ht(Mt):ht;return J(null,"default",Mt,qt)},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(ht=>{wt(ht),ht.remove()})},Dt=Xe=>{const ht=$e(),Mt=typeof Xe=="function"?Xe(ht):Xe;return J(null,"default",ht,Mt)},Xt=()=>{const Xe=tt?k.getBoundingClientRect().height:0;Be.style.setProperty("--layout-header-height",`${Xe}px`)},Qt=(Xe,ht)=>(Ft(Xe),ht.forEach(Mt=>Xe.appendChild(Mt)),ht.length>0),sn=()=>{var qt,en,tn,cn,on,y;Be.style.setProperty("--cms-layout-drawer-width",w((qt=o(r("drawerWidth")))!=null?qt:280,"280px")),Be.style.setProperty("--cms-layout-nav-width",w((tn=(en=o(r("navWidth")))!=null?en:o(r("asideRightWidth")))!=null?tn:280,"280px")),Be.style.setProperty("--cms-layout-drawer-peek",w((cn=o(r("drawerPeek")))!=null?cn:20,"20px")),Be.style.setProperty("--cms-layout-nav-peek",w((y=(on=o(r("navPeek")))!=null?on:o(r("asideRightPeek")))!=null?y:20,"20px"));const Xe=w(o(r("gap")),null);Xe!=null?Be.style.setProperty("--cms-layout-gap",Xe):Be.style.removeProperty("--cms-layout-gap");const ht=w(o(r("headerOffset")),null);ht!=null&&Be.style.setProperty("--layout-header-height",ht);const Mt=w(o(r("minHeight")),null);Mt!=null?Be.style.setProperty("--cms-layout-min-height",Mt):Be.style.removeProperty("--cms-layout-min-height")},Ht=()=>{if(oe()){const Xe=Z(a(),L(),m());Xe!==a()&&x(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`)}},Zt=(Xe,ht)=>{if(ht.button!==0)return;const Mt=Xe==="drawer"?v:xe;if(Mt.hidden)return;const qt=Xe==="drawer"?a:g,en=Xe==="drawer"?x:M,tn=Xe==="drawer"?L:h,cn=Xe==="drawer"?m:p,on=Mt.getBoundingClientRect(),y=on.width||qt(),ue=ot=>{const rt=Xe==="drawer"?ot.clientX-on.left:on.right-ot.clientX;en(Z(rt||y,tn(),cn())),Ht(),Kt()},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,ht.preventDefault()},rn=Xe=>Zt("drawer",Xe),fn=Xe=>Zt("nav",Xe);I.addEventListener("pointerdown",rn),et.addEventListener("pointerdown",fn);const Kt=()=>{const Xe=!!j(),ht=!!ve(),Mt=!!K(),qt=!de()&&be()&&dt,en=!ce()&&me()&&St,tn=qt&&(Xe||$()),cn=en&&(Xe||re()),on=qt&&ht,y=en&&Mt,ue=on&&!tn,Je=y&&!cn,ot=ue&&oe(),rt=Je&&Se(),at=on&&tn||y&&cn;sn(),Ht(),Be.classList.toggle("is-mobile",Xe),Be.classList.toggle("drawer-open",on),Be.classList.toggle("nav-open",y),Be.classList.toggle("no-drawer",!qt),Be.classList.toggle("no-nav",!en),Be.classList.toggle("has-header",tt),Be.classList.toggle("has-drawer",qt),Be.classList.toggle("has-nav",en),Be.classList.toggle("has-footer",Rt),Be.classList.toggle("drawer-floating",tn),Be.classList.toggle("nav-floating",cn);const mt=F(),Tt=mt?C():"";Be.dataset.disposition=mt||"",Be.dataset.layoutMode=Tt||"",Be.classList.toggle("has-disposition",!!mt),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||cn),lt.classList.toggle("show",at),v.hidden=!qt||!on&&!tn,v.classList.toggle("open",on),v.classList.toggle("is-floating",tn),v.classList.toggle("is-resizable",ot),v.setAttribute("aria-hidden",on?"false":"true"),I.hidden=!ot,xe.hidden=!en||!y&&!cn,xe.classList.toggle("open",y),xe.classList.toggle("is-floating",cn),xe.classList.toggle("is-resizable",rt),xe.setAttribute("aria-hidden",y?"false":"true"),et.hidden=!rt;const Wt=On[mt]||null,nn=(Wt==null?void 0:Wt.side)||(ue&&Wt?"left":null),un=(Wt==null?void 0:Wt.nav)||(Je&&Wt?"top":null),Jn=ue?Wt?nn:"left":"",Sn=Je?Wt?un==="left"||un==="right"?un:"":"right":"";Be.classList.toggle("drawer-left",qt&&nn==="left"),Be.classList.toggle("drawer-right",qt&&nn==="right"),Be.classList.toggle("nav-top",Je&&un==="top"),Be.classList.toggle("nav-side",Je&&(Sn==="left"||Sn==="right")),O.style.gridTemplateColumns=[Jn==="left"?"minmax(0, var(--cms-layout-drawer-width))":Sn==="left"?"minmax(0, var(--cms-layout-nav-width))":"0px","minmax(0, 1fr)",Jn==="right"?"minmax(0, var(--cms-layout-drawer-width))":Sn==="right"?"minmax(0, var(--cms-layout-nav-width))":"0px"].join(" ");const hn=['"header header header"',`"${ue?"aside":"."} main ${Je?"nav":"."}"`,'"footer footer footer"'].join(" "),ss=wn(On[mt],{header:tt,aside:ue,nav:Je,main:It,footer:Rt});O.style.gridTemplateAreas=le(b("areas","gridTemplateAreas","templateAreas"))||ss||hn},Pn=(Xe,ht)=>(tt=Qt(k,Dt(Xe)),Xt(),Kt(),ht&&JSswift.router.setURLOnly(ht),k),An=(Xe,ht)=>(dt=Qt(u,Dt(Xe)),dt||f(!1),Kt(),ht&&JSswift.router.setURLOnly(ht),v),ln=(Xe,ht)=>(St=Qt(Ue,Dt(Xe)),St||Me(!1),Kt(),ht&&JSswift.router.setURLOnly(ht),xe),Vn=(Xe,ht)=>(It=Qt(G,Dt(Xe)),Kt(),ht&&JSswift.router.setURLOnly(ht),G),an=(Xe,ht)=>(Rt=Qt(Ge,Dt(Xe)),Kt(),ht&&JSswift.router.setURLOnly(ht),Ge);tt=Qt(k,Ee(["header"],he)),dt=Qt(u,H===!1?[]:Ee(["aside","drawer"],H)),St=Qt(Ue,W===!1?[]:Ee(["nav","asideRight","drawerRight"],W)),It=Qt(G,Ee(["page","main","default"],De)),Rt=Qt(Ge,Ee(["footer"],X)),typeof ResizeObserver!="undefined"&&(Pt=new ResizeObserver(()=>Xt()),Pt.observe(k)),Xt(),JSswift.reactive.effect(()=>{Ve(),j(),ve(),K(),Kt()},"UI.Layout:state");const fs=Xe=>{o(r("escClose"))!==!1&&(!j()&&!$()&&!re()||!ve()&&!K()||Xe.key==="Escape"&&(Xe.preventDefault(),ve()&&f(!1),K()&&Me(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",fs,!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=Pn,Be.asideUpdate=An,Be.drawerUpdate=An,Be.navUpdate=ln,Be.pageUpdate=Vn,Be.mainUpdate=Vn,Be.footerUpdate=an,Be.reflow=Kt,Be._dispose=()=>{var Xe;typeof window!="undefined"&&window.removeEventListener("resize",ae),typeof document!="undefined"&&document.removeEventListener("keydown",fs,!0),I.removeEventListener("pointerdown",rn),et.removeEventListener("pointerdown",fn),st==null||st(),(Xe=Pt==null?void 0:Pt.disconnect)==null||Xe.call(Pt)},Nt(Be,e),Kt(),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},S=(h,p)=>{if(!(p==null||p===!1)){if(Array.isArray(p)){p.forEach(V=>S(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"]),x=_[a.has(h)?"span":"div"]({class:`cms-footer-slot-${h}`});return JSswift.reactive.effect(()=>{const g=V(p(c)),M=xn(JSswift.ui.slot(g));x.replaceChildren(),Array.isArray(M)?M.forEach(Y=>S(x,Y)):S(x,M)},`UI.Footer:${h}`),[x]}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}),b=i("left")?e.left:e.start,F=i("right")?e.right:e.end,C=i("title")?e.title:e.label,w=(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,le=[...d("left",b),...d("start",null)],Z=d("icon",e.icon,r),he=d("eyebrow",(m=e.eyebrow)!=null?m:e.kicker),H=d("title",C),W=d("subtitle",w),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 re=Ke(e.wrap,h=>h?"wrap":"nowrap");re!=null&&(ce.style.flexWrap=re),e.gap!=null&&(ce.style["--cms-footer-gap"]=yt(o(e.gap))),e.minHeight!=null&&(ce.style.minHeight=yt(o(e.minHeight))),JSswift.uiApplyResponsiveProps(ce,e,JSswift.uiResponsiveStyleRules);const oe=_.footer(ce,...le.length?[_.div({class:te(["cms-footer-start",e.startClass])},...le)]:[],...de.length?[_.div({class:"cms-footer-main"},...de)]:[]);return Nt(oe,e),oe};const vn=t=>{const e=[];for(const n of t||[]){const s=xn(JSswift.ui.slot(n));s&&(Array.isArray(s)?e.push(...s):e.push(s))}return e},mn=(t,e)=>{const n=xn(JSswift.ui.slot(t,e));return n?Array.isArray(n)?n:[n]:[]},yt=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,x,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),S={props:e},d=i(["before"],e.before,S),r=i(["start","left"],(p=e.start)!=null?p:e.left,S),b=i(["center","body","content","default"],(a=(ie=(V=e.center)!=null?V:e.body)!=null?ie:e.content)!=null?a:n,S),F=i(["end","right","actions"],(g=(x=e.end)!=null?x:e.right)!=null?g:e.actions,S),C=i(["after"],e.after,S),w=i(["title"],e.title,S),P=i(["subtitle"],e.subtitle,S),le=i(["meta"],e.meta,S),Z=!!(d.length||r.length||F.length||C.length||w.length||P.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||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,yt,"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",S,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":""}),re={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=le.length||w.length||P.length?_.div({class:te(["cms-toolbar-copy",e.copyClass])},le.length?_.div({class:te(["cms-toolbar-meta",e.metaClass])},...le):null,w.length?_.div({class:te(["cms-toolbar-title",e.titleClass])},...w):null,P.length?_.div({class:te(["cms-toolbar-subtitle",e.subtitleClass])},...P):null):null,L=!!(r.length||Se||b.length||F.length),m=[d.length?_.div({class:te(["cms-toolbar-before",e.beforeClass]),style:{...re}},...d):null,L?_.div({class:"cms-toolbar-main",style:oe},r.length?_.div({class:te(["cms-toolbar-start",e.startClass]),style:{...re}},...r):null,Se||b.length?_.div({class:te(["cms-toolbar-center",ce]),style:{...re,flex:"1 1 240px"}},Se,...b):null,F.length?_.div({class:te(["cms-toolbar-end",e.endClass]),style:{...re,justifyContent:"flex-end",marginInlineStart:$}},...F):null):null,C.length?_.div({class:te(["cms-toolbar-after",e.afterClass]),style:{...re}},...C):null].filter(Boolean),h=_.div(H,...m);return Nt(h,e),h};const Oi=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],S=(a={})=>{const x=e.itemProps||{},g={...x,...a};return g.class=te([x.class,e.itemClass,a.class]),g.style={...x.style||{},...e.itemStyle||{},...a.style||{}},g},d=(a,x={})=>{if(a==null||a===!1)return[];if(Oi(a))return[a];if(Xn(a)){const g=a.children!=null?Mn(a.children):a.content!=null?Mn(a.content):a.node!=null?Mn(a.node):a.label!=null?Mn(a.label):[];return[Ne.GridCol(S(a),...g)]}return Array.isArray(a)?[Ne.GridCol(S(x),...a)]:[Ne.GridCol(S(x),a)]},r=(a,x,g,M=!0)=>{if(a==null||a===!1)return[];const Y=Xn(a)?a:{};if(M){const Q={item:a,index:x,count:g,first:x===0,last:x===g-1},ve=J(s,"item",Q,null);if(ve.length)return ve.flatMap(N=>d(N,Y))}return d(a,Y)},b=[];c.forEach((a,x)=>{b.push(...r(a,x,c.length))}),J(s,"default",{items:c,count:c.length},n).forEach(a=>{b.push(...d(a))}),b.length||J(s,"empty",{items:c,count:0},e.empty).forEach(x=>{const g=d(x,{style:{gridColumn:"1 / -1"}});b.push(...g)});const C=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]),w=JSswift.omit(e,["gap","rowGap","columnGap","colGap","cols","columns","rows","areas","align","justify","alignItems","justifyItems","placeItems","placeContent","dense","flow","inline","debug","autoFit","autoFill","min","max","autoRows","items","itemClass","itemStyle","itemProps","empty","slots","full","width","minWidth","maxWidth","padding",...JSswift.uiResponsiveOmitProps]);w.class=C;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 le=Ke(e.gap,yt);le!=null&&!Ze(e,"gap")&&(P["--cms-grid-gap"]=le,P.gap=le);const Z=Ke(e.rowGap,yt);Z!=null&&!Ze(e,"rowGap")&&(P.rowGap=Z);const he=Ke((p=e.columnGap)!=null?p:e.colGap,yt);he!=null&&!Ze(e,["columnGap","colGap"])&&(P.columnGap=he);const H=Ke(e.max,yt,"1fr"),W=Ke(e.min,yt);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,x=>typeof x=="number"?`repeat(${x}, minmax(0, 1fr))`:String(x));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,yt);X!=null&&(P.gridAutoRows=X);const fe=Ke(e.flow,a=>{const x=String(a);return e.dense&&!x.includes("dense")?`${x} dense`:x});fe!=null&&!Ze(e,"flow")&&(P.gridAutoFlow=fe);const _e=Ke(e.areas,a=>Array.isArray(a)?a.map(x=>`"${Array.isArray(x)?x.join(" "):String(x)}"`).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 re=Ke(e.width,yt);re!=null&&!Ze(e,"width")&&(P.width=re),o(e.full)===!0&&(P.width="100%");const oe=Ke(e.minWidth,yt);oe!=null&&!Ze(e,"minWidth")&&(P.minWidth=oe);const Se=Ke(e.maxWidth,yt);Se!=null&&!Ze(e,"maxWidth")&&(P.maxWidth=Se);const L=Ke(e.padding,yt);L!=null&&!Ze(e,"padding")&&(P.padding=L),Object.keys(P).length&&(w.style=P),JSswift.uiApplyResponsiveProps(w,e,JSswift.uiResponsiveStyleRules);const m=_.div(w,...b);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)},S=v=>{var u;return v==null||v===!1||v===""?"":typeof v=="string"&&((u=JSswift.uiSizes)!=null&&u.includes(v))?`var(--cms-s-${v})`:yt(v)},d=v=>{var u;return v==null||v===!1||v===""?"":typeof v=="string"&&((u=JSswift.uiSizes)!=null&&u.includes(v))?ze(v,"size"):yt(v)},r={...e.style||{}},b=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)},C=i("span")?e.span:e.col,w=Ke(C,b),P=Ke(e.sm,b),le=Ke(e.md,b),Z=Ke(e.lg,b),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,b),fe=Ke(se,b),_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),re=Ke(e.gap,S),oe=Ke(e.rowGap,S),Se=Ke(e.columnGap,S),L=Ke(e.padding,S),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),x=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":w!=null&&(r["--cms-grid-col-base"]=w),P!=null&&(r["--cms-grid-col-sm"]=P),le!=null&&(r["--cms-grid-col-md"]=le),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=$),re!=null&&!Ze(e,"gap")&&(r.gap=re),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),x!=null&&!Ze(e,"direction")&&(r.flexDirection=x),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],S=t[1],d=de=>de&&typeof de=="object"&&!de.nodeType&&!Array.isArray(de)&&!(de instanceof Function);typeof c=="string"?(s=c,i=!0,d(S)?(e=S,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),bn(e);const r=e.slots||{},b=o(e.size),F=o(e.color),C=String(s).endsWith("-fill"),w={...e.style||{}},P=Ct(e.size,()=>{const de=o(e.size);return typeof de=="string"&&cs[de]?de:""}),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),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",...le?["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(w).length&&(se.style=w),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}));C&&($.style.fill="currentColor"),_e=_.span({...se,"data-icon":X},$,...n)}else _e=_.span({...se,"data-icon":X},X,...n);if(b!=null){let de=b;JSswift.uiSizes.includes(b)&&(de=`var(--cms-icon-size-${b})`),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"&&cs[Z]?`cms-size-${Z}`:""}),c=te(["cms-clear-set","cms-badge","cms-singularity",i,ye(e.outline,"outline"),e.class]),S=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);S.class=c;const d={...e.style||{}};if(e.size){const Z=o(e.size);typeof Z=="string"&&cs[Z]||(d.fontSize=yt(e.size))}S.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)},b=()=>{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:b()}):JSswift.ui.slot(H,{as:he})},C=(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}),w=_.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}),le=_.span(C(["left"],"left","left"),C(["centerLeft","center-left"],"centerLeft","center-left"),S,w,C(["topLeft","top-left"],"topLeft","top-left"),C(["topRight","top-right"],"topRight","top-right"),C(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),C(["bottomRight","bottom-right"],"bottomRight","bottom-right"),C(["centerRight","center-right"],"centerRight","center-right"),C(["right"],"right","right"),P);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"),Nt(le,e),le};const Fi=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(""):""},Uo=(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)},Go=(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)),Di=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=Uo(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=Uo(t,e);return t===!0||n?_.span({class:te(["cms-avatar-status",n?`cms-state-${n}`:""])}):Go(t,"cms-avatar-badge")},fo=(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 x;const a=o(e.size);return typeof a=="string"&&((x=JSswift.uiSizes)!=null&&x.includes(a))?`cms-size-${a}`:""}),c=Ct([e.color,e.state],()=>{const a=o(e.color)||o(e.state)||"",x=Vt(a);return x?`cms-state-${x}`:""}),S=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=S;const r={...e.style||{}},b=Ke(e.size,a=>{var x;return typeof a=="string"&&((x=JSswift.uiSizes)!=null&&x.includes(a))?"":yt(a)},"");b!=null&&(r.width=b,r.height=b);const F=(p=e.fontSize)!=null?p:e.textSize,C=F!=null?Ke(F,yt):Ke(e.size,a=>{var x;return typeof a=="string"&&((x=JSswift.uiSizes)!=null&&x.includes(a))?"":`clamp(11px, calc(${yt(a)} * 0.34), 28px)`},"");C!=null&&(r.fontSize=C);const w=Ke(e.radius,a=>{const x=Lo(a);return x==="xxxl"?"999px":x?`var(--cms-r-${x})`:typeof a=="number"?`${a}px`:String(a)});w!=null&&(r["--set-border-radius"]=w),d.style=r;const P={props:e},le=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 x=(M=o(e.label))!=null?M:o(e.name);return typeof x=="string"?Fi(x):x}),H=Go(o((V=e.badge)!=null?V:e.notification)),W=Di(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:le,sizes:e.sizes,style:{}};e.srcset!=null&&(a.srcset=e.srcset),e.srcSet!=null&&(a.srcset=e.srcSet);const x=Ke(e.fit);x!=null&&(a.style.objectFit=x),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),re=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);!re.length&&L.length&&(re=L),!Se.length&&m.length&&(Se=m);const h=_.div(d,ce,fo("cms-avatar-anchor-top-left",$),fo("cms-avatar-anchor-top-right",re),fo("cms-avatar-anchor-bottom-left",oe),fo("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"&&cs[X]?X:""}),c=te(["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=c,S.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,b=JSswift.ui.renderSlot(s,"icon",{},d),F=JSswift.ui.renderSlot(s,"iconRight",{},r),C=J(s,"label",{},e.label),w=C.length?C:J(s,"default",{},n),P=J(null,"default",{},b),le=J(null,"default",{},F),Z=_.span(S,...P,...w.length?w:[""],...le);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}`:""}),S=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,S,d.class]),r.style={...d.style||{}};const b=(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"}),C=b("eyebrow",e.eyebrow),w=b("label",(be=e.label)!=null?be:e.title),P=b("value",e.value),le=b("note",(me=e.note)!=null?me:e.subtitle),Z=b("meta",e.meta),he=b("delta",e.delta,{trend:e.trend}),H=b("icon",F),W=b("aside",e.aside),se=b("footer",e.footer),X=b("actions",e.actions),fe=b("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"},C.length?_.div({class:"cms-stat-eyebrow"},...C):null,w.length?_.div({class:"cms-stat-label"},...w):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,le.length?_.div({class:"cms-stat-note"},...le):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}`:""}),S={...e},d=JSswift.omit(S,["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,S.class]),d.style={...S.style||{}};const r=(de,ce,$={})=>J(s,de,$,ce),b=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),C=r("title",(be=e.title)!=null?be:e.label),w=r("value",e.value),P=r("delta",e.delta,{trend:e.trend}),le=r("note",(me=e.note)!=null?me:e.subtitle),Z=r("meta",e.meta),he=r("icon",b),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,C.length?_.div({class:"cms-kpi-title"},...C):null)),H.length?_.div({class:"cms-kpi-aside"},...H):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},w.length?_.div({class:"cms-kpi-value"},...w):null,P.length?_.div({class:"cms-kpi-delta"},...P):null),le.length?_.div({class:"cms-kpi-note"},...le):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 $i=(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"))}))},ks=(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=$i(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),S=o(e.items),d=Array.isArray(S)?S:S==null?[]:[S],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},b=W=>{if(W==null||W===!1)return[];if(ws(W))return[W];if(Xn(W)){const se=W.children!=null?Mn(W.children):W.content!=null?Mn(W.content):Mn(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=>b(me))}return b(W)},C=[];d.forEach((W,se)=>{C.push(...F(W,se,d.length))});const w=J(s,"default",{items:d,count:d.length},n);if(w.forEach((W,se)=>{C.push(...F(W,d.length+se,d.length+w.length,!1))}),!C.length){const W=J(s,"empty",{items:d,count:0},e.empty);W.length&&(W.length===1&&ws(W[0])?C.push(W[0]):C.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]),le=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);le.class=P,le.style={...e.style||{}};const Z=Ke(e.gap,yt);return Z!=null&&(le.style["--cms-list-gap"]=Z),c!=null&&c!==!1&&c!==!0&&c!=="none"&&(le.style.listStyleType=String(c)),_[i?"ol":"ul"](le,...C)},Ne.Item=(...t)=>{var L,m,h,p,V,ie,a,x;const{props:e,children:n}=JSswift.uiNormalizeArgs(t);e.state!=null&&e.color==null&&(e.color=e.state),bn(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))),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),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")),b=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),C=J(s,"meta",{},(p=e.meta)!=null?p:e.eyebrow),w=J(s,"body",{},(V=e.body)!=null?V:e.content),P=J(s,"default",{},n),le=J(s,"actions",{},(ie=e.actions)!=null?ie:e.footer),Z=(x=(a=e.aside)!=null?a:e.trailing)!=null?x:d(e.iconRight,e.iconSize||e.size,"iconRight"),he=J(s,"aside",{},Z),H=[...w,...P],W=!(S||e.clickable||e.to||r.length||b.length||F.length||C.length||le.length||he.length||w.length),se=te(["cms-item",ye(e.divider,"divider"),ye(S,"cms-clear-set"),ye(S,"cms-singularity"),ye(S,"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=b.length?_.div({class:"cms-item-title"},...b):null,ce=F.length?_.div({class:"cms-item-subtitle"},...F):null,$=C.length?_.div({class:"cms-item-meta"},...C):null,re=H.length?_.div({class:te(["cms-item-body",ye(!(b.length||F.length||C.length),"is-standalone")])},...H):null,oe=le.length?_.div({class:"cms-item-actions"},...le):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,re,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),S=o(e.vertical);if(c!=null){const d=yt(c);S?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)},S=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":""),b=Ct(e.stack,()=>o(e.stack)?"cms-banner-stack":""),F={...e},C=JSswift.omit(F,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);C.class=te(["cms-clear-set","cms-banner","cms-singularity",S,d,r,b,F.class]),C.style={...F.style||{}};const w=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))&&(C.style["--cms-banner-accent"]=()=>w(e.accent),C.style["--cms-banner-border"]=()=>{const L=w(e.accent);return L?`color-mix(in srgb, ${L} 38%, var(--cms-border-color))`:""},C.style["--cms-banner-bg"]=()=>{const L=w(e.accent);return L?`color-mix(in srgb, ${L} 14%, var(--cms-panel))`:""},C.style["--cms-banner-color"]=()=>{const L=w(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"},le=(()=>{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,le),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,re=[...fe,...me?[]:_e,...be.length?be:$?[$]:[]];ce=_.div(C,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),re.length?_.div({class:"cms-banner-side"},...re):null);const oe=C.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}`:""}),S={...e},d=JSswift.omit(S,["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"),S.class]),d.style={...S.style||{}};const r={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},b=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?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),C=J(s,"message",{},e.message!=null?e.message:n),w=J(s,"description",{},(X=e.description)!=null?X:e.subtitle),P=J(s,"meta",{},e.meta),le=J(s,"actions",{},e.actions),Z=J(s,"aside",{},e.aside),he=J(s,"icon",{},b),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,C.length?_.div({class:"cms-alert-message"},...C):null,w.length?_.div({class:"cms-alert-description"},...w):null,P.length?_.div({class:"cms-alert-meta"},...P):null,le.length?_.div({class:"cms-alert-actions"},...le):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}`:""}),S={...e},d=JSswift.omit(S,["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"),S.class]),d.style={...S.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"}),b=J(s,"illustration",{},(se=e.illustration)!=null?se:e.media),F=J(s,"icon",{},r),C=J(s,"eyebrow",{},e.eyebrow),w=J(s,"title",{},e.title),P=J(s,"message",{},e.message!=null?e.message:n),le=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,b.length?_.div({class:"cms-empty-state-illustration"},...b):null,F.length?_.div({class:"cms-empty-state-icon"},...F):null,C.length?_.div({class:"cms-empty-state-eyebrow"},...C):null,w.length?_.div({class:"cms-empty-state-title"},...w):null,P.length?_.div({class:"cms-empty-state-message"},...P):null,le.length?_.div({class:"cms-empty-state-description"},...le):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 Gn="jsswift:drawer-open";const Ko=new Set,zo=new Map,es=(t=Gn)=>{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}},Vi=(t,e=Gn)=>{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=es();const Fn=(t,e=Gn)=>{_n=!!t;const n=zo.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 Ko.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(_n);return}const{el:i,openIcon:c,closeIcon:S}=s;i&&(i.textContent=_n?c:S)}),Vi(_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,S=null,d=null;const r=L=>Object.prototype.hasOwnProperty.call(e,L),b=r("target")||r("anchorEl")||r("triggerEl"),F=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),C=(L,m)=>{const h=o(L);if(h==null||h==="")return m;const p=Number(h);return Number.isFinite(p)?p:m},w=()=>{clearTimeout(c),clearTimeout(S),c=null,S=null},P=()=>C(e.delay,350),le=()=>C(e.hideDelay,o(e.interactive)?120:0),Z=()=>{if(w(),!i)return;const L=i;i=null,ks(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&&(b?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 x=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,x)):x,M=V.length?_.div({class:"cms-tooltip-footer"},...V):null;return _.div({class:"cms-tooltip-content"},...[g,M].filter(Boolean))},be=L=>{var a,x,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=(x=e.closeOnEsc)!=null?x: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:Yt(["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=yt(o(e.maxWidth))),e.minWidth!=null&&(ie.panel.style.minWidth=yt(o(e.minWidth))),e.width!=null&&(ie.panel.style.width=yt(o(e.width))),e.style&&Object.assign(ie.panel.style,e.style),Nt(ie.panel,e),o(e.interactive)){const ve=()=>{clearTimeout(S),S=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 _s(ie),(Q=e.onOpen)==null||Q.call(e,ie),ie},me=L=>{clearTimeout(S),S=null,clearTimeout(c),c=setTimeout(()=>be(L),P())},de=(L=!1)=>{if(clearTimeout(c),c=null,!!i){if(clearTimeout(S),L){Z();return}S=setTimeout(()=>Z(),le())}},ce=L=>{i?de(!0):be(L)},$=()=>!!i,re=L=>{if(!L)return()=>{};d=L;const m=[],h=()=>{w(),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 re(p),p._tooltip={bind:re,open:be,show:me,hide:de,close:Z,toggle:ce,isOpen:$},p}return{bind:re,open:be,show:me,hide:de,close:Z,toggle:ce,isOpen:$}};const To=(t,e,n={})=>{var L;const{props:s,children:i}=JSswift.uiNormalizeArgs(e),c=s.slots||{},S=t==="radio",d=n.appearance==="toggle",r=!S,b=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),F=jt(s.model,n.modelName||(S?"UI.Radio:model":"UI.Checkbox:model")),C=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"]);C.type=t,C.id=b,S&&s.name!=null&&(C.name=s.name),C.class=te([`cms-${t}`,"cms-choice-input",s.inputClass]);const w=_.input(C),P=J(c,"label",{},s.label),le=P.length?P:J(c,"default",{},i),Z=Oe(s,{className:"cms-shortcode cms-choice-shortcode"}),he=Z?[...le,Z]:le,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&&S,"cms-toggle-radio-wrap"),ye(d&&!S,"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"]=yt(W));const se=_.span({class:te(["cms-choice-mark",S?"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,w,se,fe);Nt(_e,s);const be=s.iconSize?s.iconSize:s.size,me=d?null:S?"radio_button_checked":"check",de=d?null:S?"radio_button_unchecked":null,ce=d||S?null:"indeterminate_check_box",$=m=>{if(S)return w.checked=m==s.value,w.checked;const h=m==null?null:!!m;return w.checked=h===!0,w.indeterminate=r&&h==null,h},re=()=>!S&&r&&w.indeterminate?null:!!w.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=re(),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",!!w.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):w.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:b,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()},S?"UI.Radio:watch":"UI.Checkbox:watch"),w.addEventListener("change",m=>{var h,p;if(S)w.checked&&(F.set(s.value),(h=s.onChange)==null||h.call(s,s.value,m));else{const V=re();F.set(V),(p=s.onChange)==null||p.call(s,V,m)}Se()})):($(S?s.checked===!0?s.value:void 0:s.checked),w.addEventListener("change",m=>{var h,p;S?(h=s.onChange)==null||h.call(s,s.value,m):(p=s.onChange)==null||p.call(s,re(),m),Se()})),s.onInput&&w.addEventListener("input",m=>{var h,p;S?(h=s.onInput)==null||h.call(s,s.value,m):(p=s.onInput)==null||p.call(s,re(),m)}),Se(),it(_e,s,{isEnabled:()=>!w.disabled,action:()=>{if(w.disabled)return!1;Fe(w),w.click()}}),_e};Ne.Checkbox=(...t)=>To("checkbox",t),Ne.Radio=(...t)=>To("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 To(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)||gt(e.value)?e.value:null),c=jt(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=te(["cms-slider-input",e.inputClass]);const d=_.input(S),r={...e.style||{}},b=o(e.size);if(b!=null){const j=typeof b=="string"&&((K=JSswift.uiSizes)!=null&&K.includes(b))?`var(--cms-size-${b})`:yt(b);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 C=_.div({class:"cms-slider-header"}),w=_.span({class:"cms-slider-label"}),P=_.span({class:"cms-slider-value"});C.append(w,P);const le=_.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),le.append(Z,he,H,de,ce),F.append(C,le);const $=j=>{for(;j.firstChild;)j.removeChild(j.firstChild)},re=(j,ne,Ve="")=>{$(j),(ne||[]).forEach(He=>j.appendChild(He)),j.style.display=j.childNodes.length?Ve:"none"},oe=j=>vt(j)||gt(j)?o(j):j,Se=(j,ne={})=>mn(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))},x=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=x(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)),re(w,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):[];re(P,ae,"inline-flex"),C.style.display=w.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);re(Z,Ve,"inline-flex");const He=J(s,"iconRight",j,null),ae=He.length?He:L(e.iconRight,"iconRight",j);re(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);re(he,J(s,"startLabel",j,$e),"inline-flex"),re(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;re(_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);re(be,ae,"inline-flex")},z=()=>{const j=a(g()),ne=h(),Ve=p(),He=V(),$e=`${x(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)||gt(e.value)?e.value:null),c=jt(i,"UI.Rating:model"),S=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=S,e.name!=null&&(d.name=e.name),d.class=te(["cms-rating-input","cms-choice-input",e.inputClass]);const r=_.input(d),b=JSswift.omit(e,["model","value","max","id","name","type","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);b.class=te(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",ye(e.dense,"dense"),e.class]),b.style={...e.style||{}};const F=o(e.size);F!=null&&!(typeof F=="string"&&((g=JSswift.uiSizes)!=null&&g.includes(F)))&&(b.style["--cms-rating-size"]=yt(F));const C=o(e.gap);C!=null&&(b.style["--cms-rating-gap"]=yt(C));const w=_.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(),x(ve,M,{emit:!0})}}),P=_.span({class:"cms-choice-label cms-rating-label"}),le=_.label(b,r,w,P);Nt(le,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)||gt(M)?o(M):M,W=(M,Y={})=>mn(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():re),$=M=>{const Y=M>0?String(M):"";r.value=Y,r.setAttribute("value",Y),r.disabled=be()};let re=_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(w);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),x(f,N,{emit:!0})}},Q);L.push({item:ve,iconHost:Q,index:Y}),w.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);le.classList.toggle("is-disabled",ve),le.classList.toggle("is-readonly",N),le.classList.toggle("is-hovering",oe!=null),le.classList.toggle("is-clearable",f),le.classList.toggle("is-half",fe()),le.classList.toggle("no-dimming",A);const z=Number((Me=o((ke=e.tabindex)!=null?ke:e.tabIndex))!=null?Me:0);w.tabIndex=ve?-1:z,w.setAttribute("role","slider"),w.setAttribute("aria-valuemin","0"),w.setAttribute("aria-valuemax",String(M)),w.setAttribute("aria-valuenow",String(Y)),w.setAttribute("aria-disabled",ve?"true":"false"),w.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=>x(ae,null,{emit:!1})};Te.className=Yt(["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")})},x=(M,Y,Q={})=>{var f,A;const ve=_e(M),N=ce();return re=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 le._input=r,le._rating=w,le._getValue=ce,le._setValue=M=>x(M,null,{emit:!1}),c&&c.watch(M=>{const Y=_e(M);serializeValue(Y)!==serializeValue(re)&&(re=Y,oe=null,$(re),a())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!c&&e.value!=null&&(re=_e(o(e.value))),a()},"UI.Rating:render"),le};const Gt=t=>t?{hour:Number(t.hour)||0,minute:Number(t.minute)||0,second:Number(t.second)||0}:null,Dn=t=>String(Math.max(0,Number(t)||0)).padStart(2,"0"),Tn=(t,e={})=>{var d,r,b,F,C,w,P,le,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 Tn((d=t.time)!=null?d:t.value,e);n=Number((F=(b=(r=t.hour)!=null?r:t.hours)!=null?b:t.h)!=null?F:t.hh),s=Number((le=(P=(w=(C=t.minute)!=null?C:t.minutes)!=null?w:t.min)!=null?P:t.mm)!=null?le: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 S={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(i)};return qo(S,e)},Kn=(t,e={})=>{const n=t&&typeof t=="object"&&t.hour!=null?Gt(t):Tn(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;return`${Dn(n.hour)}:${Dn(n.minute)}${s?`:${Dn(n.second)}`:""}`},mo=(t,e)=>{const n=Kn(t,{withSeconds:!0}),s=Kn(e,{withSeconds:!0});return!n&&!s?0:n?s?n<s?-1:n>s?1:0:1:-1};function qo(t,e={}){if(!t)return null;const n=Gt(t),s=e.min!=null?Tn(e.min,{withSeconds:!0}):null,i=e.max!=null?Tn(e.max,{withSeconds:!0}):null;return s&&mo(n,s)<0?Gt(s):i&&mo(n,i)>0?Gt(i):n}const kn=(t,e={})=>t==null||t===""?null:t instanceof Date?Tn(t,e):typeof t=="object"?Tn(t.time!=null?t.time:t,e):typeof t=="string"||typeof t=="number"?Tn(t,e):null,ho=(t,e={})=>{var d;const n=Tn(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`${Dn(n.hour)}:${Dn(n.minute)}${s?`:${Dn(n.second)}`:""}`;const c=n.hour>=12?"PM":"AM",S=n.hour%12||12;return`${Dn(S)}:${Dn(n.minute)}${s?`:${Dn(n.second)}`:""} ${c}`},Bi=(t,e,n={})=>{if(!t)return"";const s=Kn(e,n);return s?`${t}T${s}`:t},Po=(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},Yo=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:i=!1,minuteStep:c=5,secondStep:S=5,disabled:d=!1,readonly:r=!1,embedded:b=!1,className:F="",slotPrefix:C="",shortcuts:w=null,onSelect:P=null}=t,le=Tn(s,{withSeconds:i,min:e.min,max:e.max}),Z=le||Tn(new Date,{withSeconds:i,min:e.min,max:e.max})||{hour:0,minute:0,second:0},he=le?Gt(le):null,H=de=>C?`${C}${de[0].toUpperCase()}${de.slice(1)}`:null,W=(de,ce,$)=>{const re=[H(de),de].filter(Boolean);for(const oe of re){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:b?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(b,"is-embedded"),ye(i,"has-seconds"),F])}),_e=o(w)||[];if(Array.isArray(_e)&&_e.length){const de=_.div({class:"cms-time-shortcuts"});_e.forEach((ce,$)=>{var m,h,p;if(!ce)return;const re=typeof ce.value=="function"?ce.value({now:Kn(new Date,{withSeconds:i})}):ce.value,oe=Tn(re,{withSeconds:i,min:e.min,max:e.max});if(!oe)return;const Se={item:ce,index:$,value:Kn(oe,{withSeconds:i}),displayValue:ho(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&&mo(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 re=_.div({class:"cms-time-column","data-time-part":ce}),oe=_.div({class:"cms-time-options"});return $.forEach(Se=>{var x;const L=X(ce,Se),m=qo(L,{withSeconds:i,min:e.min,max:e.max}),h=d||r||mo(m,L)!==0,p=!!he&&he[ce]===Se,V={part:ce,selected:p,disabled:h,value:Se,label:Dn(Se),timeValue:Kn(m,{withSeconds:i}),displayValue:ho(m,{withSeconds:i,use12h:(x=e.use12h)!=null?x: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))}),re.appendChild(oe),re};return be.appendChild(me(o(e.hoursLabel)||"Ore","hour",Po(1,23))),be.appendChild(me(o(e.minutesLabel)||"Min","minute",Po(c,59))),i&&be.appendChild(me(o(e.secondsLabel)||"Sec","second",Po(S,59))),fe.appendChild(be),fe},po=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},Xo=(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,S)=>{const d=c.getAttribute("data-time-part")||String(S),r=n&&Number.isFinite(n[d])?n[d]:null;r!=null&&(c.scrollTop=r);const b=c.querySelector(".cms-time-option.is-selected");if(!b)return;const F=Math.max(0,c.scrollHeight-c.clientHeight),C=b.offsetTop-(c.clientHeight-b.offsetHeight)/2,w=Math.max(0,Math.min(F,C));if(Math.abs(c.scrollTop-w)<1){c.scrollTop=w;return}if(s&&typeof c.scrollTo=="function"){c.scrollTo({top:w,behavior:s});return}c.scrollTop=w})},Qo=(t,e={})=>{var fs,ms,ts,ns,Xe,ht,Mt,qt,en,tn,cn,on;const{props:n,children:s}=JSswift.uiNormalizeArgs(t),i=e.calendar===!0,c=n.slots||{},S=Ct(n.size,()=>{const y=String(o(n.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(y)?`cms-size-${y}`:""}),d=String(o((ns=(ts=n.mode)!=null?ts:o((ms=(fs=n.rangeMultiple)!=null?fs:n.multipleRange)!=null?ms:n.multiRange)?"range-multiple":null)!=null?ns: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",b=n.model||(vt(n.value)||gt(n.value)?n.value:null),F=jt(b,i?"UI.Calendar:model":"UI.Datepicker:model"),C=F?F.get():o(n.value),w=o((Xe=n.rangeAs)!=null?Xe:n.rangeModel)==="array"||Array.isArray(C),P=o((ht=n.rangeMultipleAs)!=null?ht:n.multipleRangeAs)==="array"||Array.isArray(C)&&Array.isArray(C[0]),le=()=>{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,mt,Tt,Wt;const y=Kn(kn((Je=(ue=o(n.timeValue))!=null?ue:F?F.get():o(n.value))!=null?Je:C,{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((mt=n.timeMax)!=null?mt:n.maxTime),use12h:o((Wt=(Tt=n.time12h)!=null?Tt:n.use12h)!=null?Wt: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,re=(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 w?[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 mt=se(Number(Je[1]),Number(Je[2])-1,Number(Je[3]));return X(mt)}const ot=ue.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(ot){const mt=ot[3].length===2?2e3+Number(ot[3]):Number(ot[3]),Tt=se(mt,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)},x=y=>{var ot,rt,at,mt,Tt,Wt;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((Wt=(Tt=(mt=y.to)!=null?mt:y.end)!=null?Tt:y.dateTo)!=null?Wt:y.return);else{const nn=String(y).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];ue=a(nn[0]),Je=a(nn[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=x(rt);if(!at.from)return;const mt=`${at.from||""}|${at.to||""}`;Je.has(mt)||(Je.add(mt),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 mt=0;mt<at.length;mt+=2)ot({from:at[mt],to:at[mt+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 mt=0;mt<at.length;mt+=2)ot({from:at[mt],to:at[mt+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"?x(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 Wt,nn,un,Jn,Sn,hn,ss,hs,ps,As,Vs,Bs,js;if(!y)return!1;const ue=Q(),Je=ve();if(ue&&y<ue||Je&&y>Je)return!1;const ot=o((nn=(Wt=n.options)!=null?Wt:n.enableDates)!=null?nn:n.allowedDates);if(ot!=null&&!Me(ot,y))return!1;const rt=o((Jn=(un=n.disableDates)!=null?un:n.disabledDates)!=null?Jn:n.notAllowedDates);if(rt!=null&&Me(rt,y))return!1;const at=(Sn=fe(y))==null?void 0:Sn.getDay();if(Array.isArray(o((hn=n.allowedWeekdays)!=null?hn:n.weekdays))&&at!=null&&!o((ss=n.allowedWeekdays)!=null?ss:n.weekdays).map(Is=>Number(Is)).includes(at)||o(n.weekdaysOnly)&&(at===0||at===6)||o(n.weekendsOnly)&&at!=null&&at!==0&&at!==6)return!1;const mt=K(),Tt=r==="range"?mt!=null&&mt.from&&!(mt!=null&&mt.to)?mt:null:r==="range-multiple"&&Array.isArray(mt)&&mt.length&&(hs=mt[mt.length-1])!=null&&hs.from&&!((ps=mt[mt.length-1])!=null&&ps.to)?mt[mt.length-1]:null;if(Tt!=null&&Tt.from){const Ls=Math.abs(re(Tt.from,y)),Is=Number(o((Vs=(As=n.minRange)!=null?As:n.minDays)!=null?Vs:n.minNights)),Hs=Number(o((js=(Bs=n.maxRange)!=null?Bs:n.maxDays)!=null?js:n.maxNights));if(Number.isFinite(Is)&&Ls<Is||Number.isFinite(Hs)&&Ls>Hs)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):"",mt=rt!=null&&rt.to?U(rt.to):"";return at&&mt?`${at} -> ${mt}`:at||mt||""}).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(!le())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 mt;if(!le())return null;const Je=Z(),ot=o(n.timeValue),rt=y!=null?y:ot,at=kn(rt,Je);return Gt((mt=at!=null?at:ue)!=null?mt:null)},$e=()=>o(n.confirm)?Pe:T,Ee=(y=qe,ue=T)=>r==="single"&&le()?Bi(y||null,ue,Z()):V(y),De=(y=qe,ue=T)=>JSON.stringify(Ee(y,ue)),Ie=y=>ho(y,Z());let qe=Y(C),Be=p(qe),T=ae(C,kn(o(n.timeValue),Z())),Pe=Gt(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)||((qt=qe==null?void 0:qe[qe.length-1])==null?void 0:qt.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",S,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:(cn=n.iconRight)!=null?cn:"calendar_month",control:tt,getValue:()=>Ge.value,onClear:()=>{o(n.disabled)||o(n.readonly)||(Pt(He(),null),u&&an())},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 mt=Number.isInteger(ue.visibleMonthOffset)?ue.visibleMonthOffset:xe(ue.anchorIso||ue.focusIso||Je);mt>0&&(ot=be(ot,-mt))}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`}[]`,mt=/\[\]$/.test(o(n.nameTo)||"")?o(n.nameTo):`${o(n.nameTo)||`${y}_to`}[]`;rt.forEach(Tt=>{ue(at,(Tt==null?void 0:Tt.from)||""),ue(mt,(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,Wt,nn;const ot=Y(y),rt=le()?Gt((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),le()&&(T=Gt(rt),Pe=Gt(rt)),O=null,St(ot,Je),Rt(),ln(),F&&Je.fromModel!==!0&&F.set(Ee(ot,rt));const mt=De(ot,rt);if(Je.emit!==!1&&mt!==at){const un=Ee(ot,rt);(Wt=n.onInput)==null||Wt.call(n,un,ue),(nn=n.onChange)==null||nn.call(n,un,ue)}return ot},st=(y,ue,Je={})=>{var mt,Tt;if(!le())return null;const ot=Gt(kn(y,Z()));if(o(n.confirm)&&Je.commit!==!0)return Pe=ot,ln(),ot;const rt=De(qe,T);T=Gt(ot),Pe=Gt(ot),Rt(),ln(),F&&Je.fromModel!==!0&&F.set(Ee(qe,ot));const at=De(qe,ot);if(Je.emit!==!1&&at!==rt){const Wt=Ee(qe,ot);(mt=n.onInput)==null||mt.call(n,Wt,ue),(Tt=n.onChange)==null||Tt.call(n,Wt,ue)}return ot},wt=(y,ue,Je={})=>{if(o(n.confirm)){Be=p(Y(y)),le()&&(Je.timeValue!=null||Je.preserveTime)&&(Pe=Gt(kn(Je.timeValue!=null?Je.timeValue:$e(),Z()))),O=null,St(Be,Je),ln();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[]},Xt=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)},Qt=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),sn=(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&&ln())},Ht=()=>i||o(n.confirm)||n.closeOnSelect===!1?!1:r==="multiple"||r==="range-multiple"?!!n.closeOnSelect:!0,Zt=(y,ue,Je={})=>{var rt;if(!Te(y)||o(n.disabled)||o(n.readonly))return;const ot={focusIso:y,anchorIso:y,preserveTime:le(),timeValue:$e(),preserveMonthOffset:!!u&&A()>1,visibleMonthOffset:Number.isInteger(Je.visibleMonthOffset)?Je.visibleMonthOffset:null};if(r==="multiple"){const at=M(K()),mt=at.includes(y)?at.filter(Tt=>Tt!==y):[...at,y];wt(mt.sort(),ue,ot),Ht()&&an();return}if(r==="range"){const at=p(K());let mt;!at.from||at.from&&at.to?mt={from:y,to:null}:$(y,at.from)<0?mt={from:y,to:at.from}:mt={from:at.from,to:y},wt(mt,ue,ot),mt.to&&Ht()&&an();return}if(r==="range-multiple"){const at=g(K()),mt=at.length?at[at.length-1]:null;let Tt;!(mt!=null&&mt.from)||mt!=null&&mt.to?Tt=[...at,{from:y,to:null}]:$(y,mt.from)<0?Tt=[...at.slice(0,-1),{from:y,to:mt.from}]:Tt=[...at.slice(0,-1),{from:mt.from,to:y}],wt(Tt,ue,ot),(rt=Tt[Tt.length-1])!=null&&rt.to&&Ht()&&an();return}wt(y,ue,ot),Ht()&&an()},rn=()=>{k=null,Pt(He(),null,{timeValue:null})},fn=()=>{const y=de();if(!Te(y)){St(y),ln();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:le(),timeValue:$e()})},Kt=(y={})=>{Xo(I,y)},Pn=()=>{if(!le())return;const y=po(I);st(new Date,null,{commit:!o(n.confirm)}),Kt({scrollState:y}),!o(n.confirm)&&n.closeOnSelect===!0&&an()},An=()=>{o(n.confirm)&&(Pt(Be,null,{timeValue:Pe,preserveTime:!0}),n.closeOnSelect!==!1&&an())},ln=()=>{var di,fi,mi,hi,pi,gi,yi,bi,wi,vi,Si,Ci,xi,_i,ki,Ni,Ai,Li,Ii;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)},mt=(At,$t)=>{const Ln=At.getFullYear(),Ws=At.getMonth(),Us=new Date(Ln,Ws,1),xo=(Us.getDay()-f()+7)%7,Do=new Date(Ln,Ws,1-xo),_o=_.div({class:"cms-date-month"});_o.appendChild(_.div({class:"cms-date-month-title"},ue.format(Us)));const Ei=_.div({class:"cms-date-weekdays"});ot.forEach(Gs=>Ei.appendChild(_.div({class:"cms-date-weekday"},Gs))),_o.appendChild(Ei);const zi=_.div({class:"cms-date-grid"});for(let Gs=0;Gs<42;Gs+=1){const $o=new Date(Do.getFullYear(),Do.getMonth(),Do.getDate()+Gs),Cn=X($o),Ti=$o.getMonth()===Ws,Pi=Xt(Cn),Ji=Qt(Cn),Ri=(r==="range"||r==="range-multiple")&&Dt().some(gn=>ce(gn==null?void 0:gn.from,Cn)),Mi=(r==="range"||r==="range-multiple")&&Dt().some(gn=>ce(gn==null?void 0:gn.to,Cn)),Vo=!Te(Cn),Bo={...ke(Cn),selected:Pi,inRange:Ji,rangeStart:Ri,rangeEnd:Mi,disabled:Vo,outside:!Ti,value:rt,select:()=>Zt(Cn,null,{visibleMonthOffset:$t})},jo=at(Bo),ul=JSswift.ui.renderSlot(c,"day",Bo,String($o.getDate())),dl=J(null,"default",Bo,ul),fl=_.button({type:"button",class:te(["cms-date-day",ye(!Ti,"is-outside"),ye(Pi,"is-selected"),ye(Ji,"is-in-range"),ye(Ri,"is-range-start"),ye(Mi,"is-range-end"),ye(Vo,"is-disabled"),ye(ce(Cn,de()),"is-today"),ye(jo.length,"has-point")]),disabled:Vo,onMouseDown:gn=>{gn.button===0&&(k=Cn,gn.preventDefault(),Zt(Cn,gn,{visibleMonthOffset:$t}))},onClick:gn=>{if(k!=null&&gn.detail!==0){k=null;return}k=null,Zt(Cn,gn,{visibleMonthOffset:$t})},onMouseEnter:()=>sn(Cn),onFocus:()=>sn(Cn,{render:!1})},_.span({class:"cms-date-day-label"},...dl),jo.length?_.span({class:"cms-date-day-point"},...jo):null);zi.appendChild(fl)}return _o.appendChild(zi),_o},Tt=Q(),Wt=ve(),nn=[v.getFullYear(),(di=fe(de()))==null?void 0:di.getFullYear(),(fi=fe(Tt))==null?void 0:fi.getFullYear(),(mi=fe(Wt))==null?void 0:mi.getFullYear(),(hi=fe(o(n.defaultMonth)))==null?void 0:hi.getFullYear()];r==="range"?nn.push((pi=fe(rt==null?void 0:rt.from))==null?void 0:pi.getFullYear(),(gi=fe(rt==null?void 0:rt.to))==null?void 0:gi.getFullYear()):r==="range-multiple"?rt.forEach(At=>{var $t,Ln;nn.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 nn.push(($t=fe(At))==null?void 0:$t.getFullYear())}):nn.push((yi=fe(rt))==null?void 0:yi.getFullYear());const un=nn.filter(At=>Number.isFinite(At)),Jn=(un.length?Math.min(...un):v.getFullYear())-100,Sn=(un.length?Math.max(...un):v.getFullYear())+50,hn=Number(o((vi=(wi=n.yearStart)!=null?wi:Tt?(bi=fe(Tt))==null?void 0:bi.getFullYear():null)!=null?vi:Jn)),ss=Number(o((xi=(Ci=n.yearEnd)!=null?Ci:Wt?(Si=fe(Wt))==null?void 0:Si.getFullYear():null)!=null?xi:Sn)),hs=_.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()}),ln()}},...Array.from({length:12},(At,$t)=>xs({value:String($t)},new Intl.DateTimeFormat(y,{month:"long"}).format(new Date(2024,$t,1))))),ps=_.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()}),ln()}},...Array.from({length:Math.max(1,ss-hn+1)},(At,$t)=>{const Ln=hn+$t;return xs({value:String(Ln)},String(Ln))})),As=_.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()}),ln()}},Ne.Icon({name:"chevron_left",size:16})),_.div({class:"cms-date-header-center"},hs,ps),_.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()}),ln()}},Ne.Icon({name:"chevron_right",size:16}))),Vs=_.div({class:"cms-date-shortcuts"}),Bs=o((_i=n.shortcuts)!=null?_i:n.presets)||[];Bs.forEach((At,$t)=>{var Us,xo;if(!At)return;const Ln=typeof At.value=="function"?At.value({today:de()}):At.value,Ws=(xo=(Us=At.label)!=null?Us:At.text)!=null?xo:`Preset ${$t+1}`;Vs.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>wt(Ln,null,{preserveTime:le(),timeValue:$e()})},Ws))});const js=_.div({class:"cms-date-months"});for(let At=0;At<A();At+=1)js.appendChild(mt(be(v,At),At));const Ls=j(rt,$e()),Is=_.div({class:"cms-date-value"},...J(c,"value",{value:rt,displayValue:Ls,mode:r,timeValue:$e()},Ls||J(c,"default",{},s))),Hs=_.div({class:"cms-time-header"}),ol=_.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"));Hs.appendChild(ol);const il=le()?Yo({props:{min:o((ki=n.timeMin)!=null?ki:n.minTime),max:o((Ni=n.timeMax)!=null?Ni:n.maxTime),use12h:o((Li=(Ai=n.time12h)!=null?Ai:n.use12h)!=null?Li: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((Ii=n.timeShortcuts)!=null?Ii:n.timePresets),onSelect:At=>{const $t=po(I);st(At,null),Kt({scrollState:$t})}}):null,ll=_.div({class:"cms-date-footer-info"},Is),rl=_.div({class:te(["cms-date-footer",ye(le(),"has-time")])},ll,_.div({class:"cms-date-actions"},_.button({type:"button",class:"cms-date-action",onClick:fn},o(n.todayLabel)||"Oggi"),o(n.clearable)!==!1?_.button({type:"button",class:"cms-date-action",onClick:rn},o(n.clearLabel)||"Reset"):null,o(n.confirm)?_.button({type:"button",class:"cms-date-action is-primary",onClick:An},o(n.applyLabel)||"Applica"):null)),al=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:Pn},o(n.nowLabel)||"Ora")),cl=le()?_.div({class:"cms-date-time"},Hs,il,al):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):an())}},As,Bs.length?Vs:null,_.div({class:"cms-data-time"},js,cl),rl))};function Vn(){var y,ue,Je,ot;return u||o(n.disabled)||o(n.readonly)||(Be=p(qe),Pe=Gt(T),O=null,k=null,St(Be),u=JSswift.overlay.open(({close:rt})=>{var Tt;const at=r==="range"||r==="range-multiple"?2:1,mt=Number((Tt=o(n.monthsToShow))!=null?Tt:at);return I=_.div({class:Yt(["cms-date-panel",o(S),ye(mt>1,"multi-month"),n.panelClass])}),ln(),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:Yt(["cms-date-overlay",n.panelClass,ye(le(),"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),_s(u),Rt(),(ot=n.onOpen)==null||ot.call(n)),u}function an(){if(!u)return;k=null;const y=u;ks(y,()=>JSswift.overlay.close(y.id))}if(i){const y=r==="range"||r==="range-multiple"?2:1,ue=Number((on=o(n.monthsToShow))!=null?on:y);I=_.div({class:Yt(["cms-date-panel","cms-date-calendar",o(S),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&&Vn()}),i||Ge.addEventListener("click",y=>{var ue;(ue=n.onClick)==null||ue.call(n,y),Vn()}),i||Ge.addEventListener("keydown",y=>{if(y.key==="Escape"){u&&(y.preventDefault(),an());return}(y.key==="ArrowDown"||y.key==="Enter"||y.key===" ")&&(y.preventDefault(),Vn()),(y.key==="Backspace"||y.key==="Delete")&&!o(n.manualInput)&&o(n.clearable)!==!1&&(y.preventDefault(),rn())}),!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===""?rn():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=Gt(Je),Pe=Gt(Je),O=null,St(qe),Rt(),ln())},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=Gt(T)):le()&&n.timeValue!=null&&(T=ae(o(n.timeValue)),Pe=Gt(T)),Rt(),ln(),u&&o(n.disabled)&&an()},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=rn,I._select=y=>{const ue=a(y);ue&&Zt(ue,null)},I._time=()=>Gt(T),I):(dt._input=Ge,dt._date=Ge,dt._open=Vn,dt._close=an,dt._getValue=()=>Ee(qe,T),dt._setValue=y=>Pt(y,null,{emit:!1,timeValue:ae(y)}),dt._time=()=>Gt(T),dt._panel=()=>(u==null?void 0:u.panel)||null,dt)};Ne.Datepicker=(...t)=>Qo(t),Ne.Calendar=(...t)=>Qo(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,x;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=Kn(kn(b?b.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)}},S=()=>{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)||gt(e.value)?e.value:null),b=jt(r,"UI.Time:model"),F=b?b.get():o(e.value),C=g=>kn(g,c()),w=g=>ho(g,c()),P=g=>Kn(g,c()),le=g=>JSON.stringify(P(g));let Z=Gt(C(F)),he=Gt(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:w(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:(x=e.iconRight)!=null?x:"schedule",control:be,getValue:()=>fe.value,onClear:()=>{o(e.disabled)||o(e.readonly)||(re(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=w(Z),ce(),(g=me._refresh)==null||g.call(me)},re=(g,M,Y={})=>{var f,A;const Q=Gt(C(g));if(o(e.confirm)&&Y.commit!==!0)return he=Gt(Q),h(),Q;const ve=le(Z);Z=Gt(Q),he=Gt(Q),$(),h(),b&&Y.fromModel!==!0&&b.set(P(Q));const N=le(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={})=>{Xo(W,g)},L=()=>{const g=po(W);re(new Date,null,{commit:!o(e.confirm)}),Se({scrollState:g}),!o(e.confirm)&&e.closeOnSelect===!0&&V()},m=()=>{o(e.confirm)&&(re(he,null,{commit:!0}),e.closeOnSelect!==!1&&V())},h=()=>{var A,z,K,ke;if(!W)return;const g=de(),M=w(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=Yo({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:S(),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=po(W);re(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:()=>re(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=Gt(Z),H=JSswift.overlay.open(()=>(W=_.div({class:Yt(["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:Yt(["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),_s(H),Se(),$(),(Q=e.onOpen)==null||Q.call(e)),H}function V(){if(!H)return;const g=H;ks(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(),re(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=>re(fe.value,g)),fe.addEventListener("blur",g=>{var M;(M=e.onBlur)==null||M.call(e,g),fe.value===""?re(null,g):re(fe.value,g)})):fe.addEventListener("blur",g=>{var M;return(M=e.onBlur)==null?void 0:M.call(e,g)}),b&&b.watch(g=>{const M=Gt(C(g));le(M)!==le(Z)&&(Z=Gt(M),he=Gt(M),$(),h())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!b&&e.value!=null&&(Z=Gt(C(o(e.value))),he=Gt(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=>re(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",S=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,b=jt(e.model,"UI.Tabs:model"),F=c(e.orientation||e.orient||e.direction),C=S(e.variant||(e.pills?"pills":e.soft?"soft":"line")),w=!!o((z=(A=e.fill)!=null?A:e.navFill)!=null?z:e.stretch),P=!!o(e.wrap),le=!!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(b?b.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-${C}`,ye(e.dense,"dense"),ye(w,"fill"),ye(P,"wrap"),ye(le,"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"]=yt(e.gap)),e.tabGap!=null&&(ce.style["--cms-tabs-tab-gap"]=yt(e.tabGap));const $=d((Me=e.color)!=null?Me:e.state);$&&(ce.style["--cms-tabs-accent"]=$);const re=_.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:C,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);re.dataset.value=U==null?"":String(U),re.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||le)),ne.classList.toggle("active",$e),ne.setAttribute("aria-selected",$e?"true":"false"),ne.setAttribute("tabindex",$e?"0":"-1")})},x=U=>{me(U),a(U)},g=(U,j={})=>{if(le)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||le)return null;const Ve=ne.value,He=be(),ae=!r(He,Ve);return x(Ve),b&&!r(b.get(),Ve)&&b.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||le)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||le,"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||le,"disabled"),e.tabClass,U.tabClass||U.class]),type:"button",id:He,role:"tab",disabled:!!(U.disabled||le),"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)),re.appendChild(oe),x(_e),b?b.watch(U=>{x(fe(U,!0))},"UI.Tabs:watch"):Ye(e.value)&&bt.reactive.effect(()=>{x(fe(o(e.value),!0))},"UI.Tabs:value"),re._getValue=()=>be(),re._setValue=U=>g(U,{emit:!0}),re._select=U=>g(U,{emit:!0}),re._next=()=>Y(),re._prev=()=>Q(),re._getTabs=()=>H.slice(),Nt(re,e),re},Ne.RouteTab=(...t)=>{var ie,a,x,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),S=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)},b=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,C=()=>{var Te;return o((Te=e.href)!=null?Te:e.to)||"#"},w=()=>{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||""},le=()=>{var ae,$e,Ee;const Te=w();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:C(),router:i,props:e});if(U instanceof RegExp)return U.test(ne);const Ve=b(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:S?!!o((Te=e.active)!=null?Te:e.selected):le()},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=C(),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=(x=e.iconSize)!=null?x: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:C(),to:w(),external:F(C()),navigate:Te=>{var ne,Ve;if(Z())return!1;const U=w();return!F(C())&&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||C(),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),re=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?$:[w()||C()||""]),re.length?_.span({class:"cms-route-tab-note"},...re):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=C(),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")),w()?h.dataset.to=String(w()):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)}},!S&&w()&&(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=jt(e.model,"UI.Breadcrumbs:model"),S=Ct(e.size,()=>{var re;const $=o(e.size);return typeof $=="string"&&((re=JSswift.uiSizes)!=null&&re.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":""),b=_.nav({class:te(["cms-breadcrumbs","cms-clear-set",S,d,r,ye(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),F=_.div({class:"cms-breadcrumbs-before"}),C=_.ol({class:"cms-breadcrumbs-list"}),w=_.div({class:"cms-breadcrumbs-after"});b.appendChild(F),b.appendChild(C),b.appendChild(w);const P=$=>{var oe;const re=o($);return re==null||re===""?null:(oe=JSswift.uiColors)!=null&&oe.includes(re)?`var(--cms-${re})`:String(re)},le=$=>{var oe;if(!$)return!1;if(o($.external)===!0)return!0;const re=o((oe=$.href)!=null?oe:$.to);return re?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(re)):!1},Z=$=>$!=null&&$.nodeType&&$.cloneNode?$.cloneNode(!0):$,he=($,re)=>{$.innerHTML="",re.forEach(oe=>$.appendChild(oe))},H=($,re,oe,Se,L=null)=>{const m=JSswift.ui.getSlot($,re)!=null?J($,re,oe,Se):[];return m.length?m:L&&JSswift.ui.getSlot($,L)!=null?J($,L,oe,Se):J(null,"default",oe,Se)},W=($,re,oe)=>{const Se=o($);return Se==null||Se===!1||Se===""?null:typeof Se=="string"?Ne.Icon({name:Se,size:re}):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),re=[],oe=h=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(oe);return}if(typeof h=="string"||typeof h=="number"){re.push({label:String(h)});return}if(h!=null&&h.nodeType||typeof h=="function"){re.push({label:h});return}re.push(h)}},Se=o(e.home);return Se&&oe(Se===!0?{label:"Home",to:"/",icon:"home"}:Se),oe($),!re.length&&(n!=null&&n.length)&&n.forEach(h=>oe(h)),re.filter(h=>!o(h==null?void 0:h.hidden))},X=$=>{const re=$.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 re>-1?re:o(e.autoCurrent)===!1?-1:$.length?$.length-1:-1},fe=$=>{var p,V,ie,a,x,g,M;const re=Number(o((ie=(V=(p=e.max)!=null?p:e.maxItems)!=null?V:e.collapseAfter)!=null?ie:e.collapse)),oe=Number.isFinite(re)?Math.max(0,Math.trunc(re)):0;if(!oe||oe<3||$.length<=oe)return $.map((Y,Q)=>({type:"item",item:Y,index:Q,key:`item-${Q}`}));let Se=Number(o((x=(a=e.leadingCount)!=null?a:e.keepStart)!=null?x: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=($,re=null)=>{var L,m,h,p,V;if(!$)return!1;const oe=o((L=$.href)!=null?L:$.to)||"",Se=o($.to)||"";return!le($)&&Se&&(i!=null&&i.navigate)?(re!=null&&re.preventDefault&&re.preventDefault(),i.navigate(Se),(m=$.onNavigate)==null||m.call($,Se,re||null),(h=e.onNavigate)==null||h.call(e,Se,$,re||null),!0):((p=$.onNavigate)==null||p.call($,Se||oe,re||null),(V=e.onNavigate)==null||V.call(e,Se||oe,$,re||null),!1)},be=($,re,oe)=>{var V,ie,a;const Se=$,L=oe[re+1]||null,m={index:re,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=($,re,oe)=>{const Se={type:"collapsed",collapsed:!0,items:re,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=($,re,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),x=!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:re.length,current:V,active:V,disabled:p,href:h,to:o(L.to)||"",external:le(L),isFirst:$.index===0,isLast:$.index===re.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"),x?`cms-state-${x}`:"",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(),re=X($),oe=fe($),Se=P((m=e.color)!=null?m:e.state);b.classList.toggle("is-empty",$.length===0),Se?b.style.setProperty("--cms-breadcrumb-accent",Se):b.style.removeProperty("--cms-breadcrumb-accent");const L={items:$,visibleItems:oe,currentIndex:re,count:$.length,collapsed:oe.some(h=>h.type==="collapsed")};if(he(F,H(s,"before",L,e.before)),he(w,H(s,"after",L,e.after)),C.innerHTML="",!$.length){const h=H(s,"empty",L,e.empty);h.length&&C.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...h));return}oe.forEach((h,p)=>{p>0&&C.appendChild(be(oe[p-1],p-1,oe)),C.appendChild(h.type==="collapsed"?me(h,$,re):de(h,$,re,p))})};return bt.reactive.effect(()=>{ce()},"UI.Breadcrumbs:render"),b.getItems=()=>se(),b.getVisibleItems=()=>fe(se()),b.refresh=()=>(ce(),b),b.setItems=$=>(c?c.set($):e.items=$,ce(),b),Nt(b,e),b},Ne.Pagination=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=e.slots||{},s=jt(e.model,"UI.Pagination:model"),i=Ct(e.size,()=>{const a=o(e.size);return typeof a=="string"&&cs[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"}),S=_.div({class:"cms-pagination-controls"}),d=_.div({class:"cms-pagination-start"}),r=_.div({class:"cms-pagination-pages"}),b=_.div({class:"cms-pagination-end"}),F=_.div({class:"cms-pagination-summary"});S.appendChild(d),S.appendChild(r),S.appendChild(b),c.appendChild(S),c.appendChild(F);let C=1,w=1;const P=(a,x=0)=>{const g=o(a);if(g==null||g==="")return x;const M=Number(g);return Number.isFinite(M)?Math.trunc(M):x},le=(a,x=Z())=>{const g=Number(a),M=Number.isFinite(g)?Math.trunc(g):1;return Math.min(Math.max(M||1,1),Math.max(1,x||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 x=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 x>=0&&g>0?Math.max(1,Math.ceil(x/g)):1},he=()=>{var a,x,g;return P(s?s.get():(g=(x=(a=e.page)!=null?a:e.value)!=null?x:e.current)!=null?g:e.currentPage,1)},H=()=>{var a,x;return Math.max(0,P((x=(a=e.siblings)!=null?a:e.siblingCount)!=null?x:e.window,1))},W=()=>{var a,x;return Math.max(0,P((x=(a=e.boundaryCount)!=null?a:e.boundaries)!=null?x: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),re=()=>{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 x=Number(a);return Number.isFinite(x)?Math.max(0,Math.trunc(x)):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 x=Number(a);return Number.isFinite(x)&&x>0?Math.trunc(x):null},Se=(a=C,x=w)=>{const g=re(),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:x,max:x,total:g,pageSize:M,from:Y,to:Q,disabled:se(),isFirst:a<=1,isLast:a>=x,canPrev:a>1,canNext:a<x,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(x,ve)}},L=(a,x)=>{if(x<=0)return[];const g=[],M=new Set,Y=W(),Q=H();for(let N=1;N<=Math.min(Y,x);N++)M.add(N);for(let N=Math.max(1,a-Q);N<=Math.min(x,a+Q);N++)M.add(N);for(let N=Math.max(1,x-Y+1);N<=x;N++)M.add(N);let ve=0;for(let N=1;N<=x;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,x,g,M=null)=>{const Y=JSswift.ui.getSlot(n,a)!=null?J(n,a,g,x):[];return Y.length?Y:M&&JSswift.ui.getSlot(n,M)!=null?J(n,M,g,x):J(null,"default",g,x)},h=(a,x)=>{a.innerHTML="",x.forEach(g=>a.appendChild(g))},p=(a,x,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,x,Y,a==="summary"?"label":a==="page"?"item":null))},V=(a,x)=>{C=le(a,x),w=Math.max(1,x||1);const g=Se(C,w);c.style.display=$()&&w<=1?"none":"",F.style.display=X()?"":"none",r.style.display=fe()?"":"none",d.innerHTML="",r.innerHTML="",b.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:C<=1})),_e()&&d.appendChild(p("prev","Prev",ve=>ie(C-1,ve),{disabled:C<=1})),fe()&&L(C,w).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===C};r.appendChild(Ne.Btn({class:te(["cms-pagination-btn","cms-pagination-page-btn",ye(N===C,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:N===C?e.color||e.state||"primary":null,outline:N!==C,disabled:se(),"aria-current":N===C?"page":null,onClick:A=>ie(N,A)},...m("page",String(N),f,"item")))}),be()&&b.appendChild(p("next","Next",ve=>ie(C+1,ve),{disabled:C>=w})),ce()&&b.appendChild(p("last","\xBB",ve=>ie(w,ve),{disabled:C>=w}));const Y=m("end",e.end,g);Y.length&&b.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...Y));let Q=`Pagina ${C} di ${w}`;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,x=null)=>{var Y,Q;const g=Z(),M=le(a,g);return M===C&&g===w||(V(M,g),s&&s.get()!==M&&s.set(M),(Y=e.onChange)==null||Y.call(e,M,Se(M,g),x),(Q=e.onPageChange)==null||Q.call(e,M,Se(M,g),x)),M};return bt.reactive.effect(()=>{const a=Z(),x=he(),g=le(x,a);V(g,a),s&&x!==g&&s.set(g)},"UI.Pagination:sync"),c.getPage=()=>C,c.getPages=()=>w,c.setPage=a=>ie(a),c.prev=()=>ie(C-1),c.next=()=>ie(C+1),c.first=()=>ie(1),c.last=()=>ie(w),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:""},S=Ct(e.state,()=>{const X=Vt(o(e.state));return X?`cms-state-${X}`:""}),d=te(["cms-spinner",S,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 b={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(b,"backgroundColor")&&delete b.backgroundColor,r.style=b,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},C=J(s,"label",F,e.label),w=J(s,"default",F,n),P=J(s,"note",F,e.note),le=C.length||w.length||P.length;if(!le){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,yt,"18px"),"--cms-spinner-thickness":i(e.thickness,yt,"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),le&&H.push(_.div({class:"cms-spinner-content"},C.length?_.div({class:"cms-spinner-label"},...C):null,w.length?_.div({class:"cms-spinner-copy"},...w):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)||gt(e.value)?e.value:null),c=jt(i,"UI.Progress:model"),S=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),b=()=>{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"},C=(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)},w=ae=>{const $e=r(),Ee=b(),De=d(ae,$e);return Math.min(Ee,Math.max($e,De))},P=ae=>{const $e=r(),De=b()-$e;if(!De)return 0;const Ie=(w(ae)-$e)/De,qe=o(e.reverse)?1-Ie:Ie;return Math.max(0,Math.min(1,qe))},le=ae=>{const $e=w(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={})=>mn(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=>gt(ae)||vt(ae)?o(ae):typeof ae=="function"&&ae.length===0?ae():ae,[fe,_e]=JSswift.reactive.signal(w(c?c.get():(K=(z=o(e.value))!=null?z:o(e.min))!=null?K:0)),[be,me]=JSswift.reactive.signal(le((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=w(ae);return fe()!==Ee&&_e(Ee),be()<Ee&&me(Ee),c&&$e.fromModel!==!0&&c.set(Ee),Ee},ce=ae=>{const $e=le(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"]),re={width:o(e.width)||"100%",...e.style||{}},oe=o(e.color);(oe!=null||Ye(e.color))&&!Vt(oe||"")&&delete re.backgroundColor,$.class=te(["cms-progress-wrap",ye(e.dense,"dense"),ye(e.reverse,"is-reverse"),ye(e.indeterminate,"is-indeterminate"),S,e.class]),$.style=re;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"}),x=_.span({class:"cms-progress-buffer"}),g=_.span({class:te(["cms-progress-bar","cms-singularity",S,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=bs(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(x,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:b(),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:b(),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:b(),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=b(),Ie=P(ae)*100,qe=P($e)*100,Be=C(e.color,""),T=C(e.trackColor,Be?`color-mix(in srgb, ${Be} 14%, transparent)`:"rgba(255,255,255,0.08)"),Pe=C(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,x.style.background=Pe,x.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=x,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),S=()=>{const z=c(),K=i(o(n.max),100);return K<z?z:K},d=z=>{const K=c(),ke=S(),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),b=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)||gt(n.value)?n.value:null),C=jt(F,"UI.LoadingBar:model"),w=vt(n.buffer)||gt(n.buffer)?n.buffer:null,P=jt(w,"UI.LoadingBar:buffer"),le=C?C.get():(f=o(n.value))!=null?f:c(),Z=P?P.get():(A=o(n.buffer))!=null?A:le,[he,H]=JSswift.reactive.signal(d(le)),[W,se]=JSswift.reactive.signal(Math.max(d(Z),d(le))),[X,fe]=JSswift.reactive.signal(n.visible!=null?!!o(n.visible):d(le)>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)),C&&K.fromExternal!==!0&&C.set(ke),ke},re=(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=re(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},x=(z=(K=>(K=o(n.startValue))!=null?K:12)())=>{de();const ke=Math.max(he(),d(z));return $(ke),re(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 re(ke),$(ke),oe(ke),h},M=(z=(K=>(K=o(n.doneValue))!=null?K:S())())=>{var Te;de(),me();const ke=d(z);re(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=x,h.done=M,h.complete=M,h.stop=Y,h.reset=g,h.show=Q,h.hide=ve,h.destroy=N,h._dispose=N,C?C.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=>{re(z,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):Ye(n.buffer)&&JSswift.reactive.effect(()=>{re(o(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const z=c(),K=S(),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&&b(n.target).appendChild(h),o(n.autoStart)&&x(),h};const Zo=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),ji=new Set(["soft","solid","outline"]),Hi={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},Wi={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},ei=t=>{const e=String(o(t)||"").trim().toLowerCase();return e?Zo.has(e)?e:e==="top"?"top-right":e==="bottom"?"bottom-right":e==="left"?"bottom-left":e==="right"?"bottom-right":e==="center"?"bottom-center":"bottom-right":"bottom-right"},Ui=t=>{const e=String(o(t)||"").trim().toLowerCase();return ji.has(e)?e:"soft"},Gi=(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},$n=(t={},e="")=>{var d,r,b,F,C,w,P,le,Z,he,H,W,se,X;const n=jn(t)?{...t}:{message:t},s=Vt(o(e)||o(n.type)||o(n.state)||o(n.color)||"info")||"info",i=Gi((r=(d=n.timeout)!=null?d:n.duration)!=null?r:n.delay,s),c=(C=(F=(b=n.closable)!=null?b:n.dismissible)!=null?F:n.dismiss!=null)!=null?C:i===0,S=n.title===void 0?n.label===void 0?Hi[s]:n.label:n.title;return{...n,type:s,state:s,title:S,message:(le=(P=(w=n.message)!=null?w:n.content)!=null?P:n.text)!=null?le: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:ei(n.position),variant:Ui(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},ti=(t,e="",n="")=>{if(!t.length)return $n(n?{type:e,title:n}:{type:e});if(jn(t[0])){const{props:d,children:r}=JSswift.uiNormalizeArgs(t),b={...d};return!b.type&&!b.state&&!b.color&&e&&(b.type=e),b.title==null&&n&&(b.title=n),r.length&&(b.message==null&&b.description==null&&b.body==null&&r.length===1?b.message=r[0]:b.body==null&&(b.body=r.length===1?r[0]:r)),$n(b,e)}const[s,i,c]=t;let S={};return jn(i)?S={...i,message:s}:jn(c)?S={...c,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),$n(S,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,ti(n,t,e))},go=(t,e,n)=>{if(t===!1)return!1;if(typeof t=="function"){const s=t();return go(s,e,n)}return jn(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,ti(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,S,d,r,b,F,C,w,P,le,Z,he,H;const n=e.loading===!1?!1:go(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,$n({type:"info",timeout:0,closable:!1,...n},"info"));try{const se=await(typeof t=="function"?t():t),X=go(typeof e.success=="function"?()=>e.success(se):e.success,"Operazione completata con successo.","Completato");return X!==!1?s!=null?(d=(S=bt.services.notify)==null?void 0:S.update)==null||d.call(S,s,$n(X,"success")):(b=(r=bt.services.notify)==null?void 0:r.show)==null||b.call(r,$n(X,"success")):s!=null&&((C=(F=bt.services.notify)==null?void 0:F.remove)==null||C.call(F,s)),se}catch(W){const se=go(typeof e.error=="function"?()=>e.error(W):e.error,(W==null?void 0:W.message)||"Operazione fallita.","Errore");throw se!==!1?s!=null?(P=(w=bt.services.notify)==null?void 0:w.update)==null||P.call(w,s,$n(se,"danger")):(Z=(le=bt.services.notify)==null?void 0:le.show)==null||Z.call(le,$n(se,"danger")):s!=null&&((H=(he=bt.services.notify)==null?void 0:he.remove)==null||H.call(he,s)),W}},Ne.Header=(...t)=>{var x,g,M,Y,Q,ve,N;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};bn(i);const c=f=>Object.prototype.hasOwnProperty.call(e,f),S=(x=e.drawerStateKey)!=null?x:Gn;S&&(Gn=S,_n=es(S));const d=()=>es(S),r=()=>Fn(!0,S),b=()=>Fn(!1,S),F=()=>Fn(!d(),S),C={props:e,stateKey:S,isDrawerOpen:d,openDrawer:r,closeDrawer:b,toggleDrawer:F,toggleAside:F},w=(f,A)=>{if(!(A==null||A===!1)){if(Array.isArray(A)){A.forEach(z=>w(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,C,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(C)),U=xn(JSswift.ui.slot(Te));Me.replaceChildren(),Array.isArray(U)?U.forEach(j=>w(Me,j)):w(Me,U)},`UI.Header:${f}`),[Me]}return J(s,f,C,z(A))},le=(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",C,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")&&Ko.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,le),ce=P("eyebrow",(N=e.eyebrow)!=null?N:e.kicker),$=P("title",X),re=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,re.length?_.div({class:te(["cms-header-subtitle",e.subtitleClass])},...re):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"]=yt(o(e.gap))),e.minHeight!=null&&(ie.style.minHeight=yt(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),S=(Ee=e.stateKey)!=null?Ee:Gn;S&&(Gn=S,_n=es(S));const d=()=>es(S),r=()=>Fn(!0,S),b=()=>Fn(!1,S),F=()=>Fn(!d(),S),C={props:e,stateKey:S,isDrawerOpen:d,openDrawer:r,closeDrawer:b,toggleDrawer:F,toggleAside:F},w=JSswift==null?void 0:JSswift.store,P=!!(w!=null&&w.get&&(w!=null&&w.set)),le=`${S}:groups`,Z=`${S}:active`;let he=P?w.get(le,{})||{}:{},H=P&&(De=w.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=C)=>{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",re=(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&&w.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)]:[]},x=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},w.set(le,he))},Q=()=>{const u={...C,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 ns,Xe,ht,Mt,qt,en,tn,cn,on,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",{...C,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=(ht=(Xe=(ns=G.label)!=null?ns:G.title)!=null?Xe:G.text)!=null?ht:lt)!=null?Mt:null),dt=tt!=null?tt:`item-${I}-${et}`,St=o((tn=(en=(qt=G.note)!=null?qt:G.subtitle)!=null?en:G.description)!=null?tn:null),It=o((cn=G.badge)!=null?cn:null),Rt=o((y=(on=G.aside)!=null?on: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}=x(G),Xt=Vt(o(G.state)||o(G.color)||""),Qt=h(G,lt),sn=Qt||oe(wt),Ht=!!o(G.disabled),Zt={...C,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:sn,disabled:Ht,hasChildren:!1},rn=o(G.divider)===!0||G.type==="divider"||G.type==="separator",fn=o(G.section)===!0||G.type==="section"||G.type==="heading"||G.type==="label",Kt=G.type==="content"||G.type==="custom"||!lt&&!Ge.length&&!o(G.button)&&G.type!=="button"&&tt==null&&Pt!=null;if(rn)return _.div({class:te(["cms-drawer-separator",G.class]),"data-level":String(I)});if(fn){const Je=J(s,"sectionLabel",Zt,dt||Pt);return _.div({class:te(["cms-drawer-section-label",G.class]),"data-level":String(I)},...Je)}if(Kt){const Je=J(s,"item",Zt,Pt!=null?Pt:dt);return _.div({class:te(["cms-drawer-custom",Xt?`cms-drawer-tone-${Xt}`:"",G.class]),style:G.style,"data-level":String(I)},...Je)}if(Ge.length){const Je=Qt||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"}),mt={...Zt,active:ot,hasChildren:!0,isOpen:()=>rt,setOpen:hn=>Sn(hn),toggle:()=>Sn(!rt)},Tt=()=>{var hs,ps;const hn=rt?(hs=G.openIcon)!=null?hs:$:(ps=G.closeIcon)!=null?ps:re,ss=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 ${ss}`,ie(hn,{...mt,as:"toggleIcon"}).forEach(As=>at.appendChild(As))},Wt=_.button({type:"button",class:te(["cms-drawer-group-toggle","cms-drawer-entry",rt?"open":"",ot?"active":"",Ht?"is-disabled":"",Xt?`cms-drawer-tone-${Xt}`:"",G.class]),style:G.style,"data-level":String(I),"aria-expanded":String(rt),"aria-disabled":Ht?"true":null,onClick:hn=>{if(Ht){hn.preventDefault();return}m(wt),Sn(!rt)}},...N(G,mt,{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]:[]})),nn=J(s,"group",mt,null),un=_.div({class:"cms-drawer-group-items"},...f(Ge,I+1,xe.concat(st))),Jn=_.div({class:te(["cms-drawer-group",rt?"open":"",ot?"active":"",Xt?`cms-drawer-tone-${Xt}`:""]),"data-level":String(I)},...nn.length?nn:[Wt],un),Sn=hn=>{rt=!!hn,Jn.classList.toggle("open",rt),Wt.classList.toggle("open",rt),Wt.setAttribute("aria-expanded",String(rt)),Tt(),Y(wt,rt)};return se.set(wt,{wrap:Jn,toggle:Wt,baseActive:Je}),Tt(),Jn}const Pn=J(s,"item",Zt,null),An=o(G.button)===!0||G.type==="button"||!lt&&typeof G.onClick=="function",ln={class:te(["cms-drawer-entry",An?"cms-drawer-btn":"cms-drawer-link",sn?"active":"",Ht?"is-disabled":"",Xt?`cms-drawer-tone-${Xt}`:"",G.class]),style:G.style,"data-level":String(I),"aria-current":sn?"page":null,"aria-disabled":Ht?"true":null},Vn=Pn.length?Pn:N(G,Zt);if(An){const Je=_.button({...ln,type:G.buttonType||"button",disabled:Ht,onClick:ot=>{if(Ht){ot.preventDefault();return}ve(G,Zt,ot)&&(m(wt),de(G)&&b())}},...Vn);return W.set(wt,{el:Je,baseActive:Qt}),Je}const an=be(G),fs=an?o(G.target)||"_blank":o(G.target),ms=an?o(G.rel)||"noopener noreferrer":o(G.rel),ts=_.a({...ln,href:lt||"#",target:fs||null,rel:ms||null,tabIndex:Ht?-1:null,onClick:Je=>{var ot;if(Ht){Je.preventDefault();return}ve(G,Zt,Je)&&(!an&&G.to&&((ot=bt.router)!=null&&ot.navigate)&&(Je.preventDefault(),bt.router.navigate(G.to)),de(G)&&b())}},...Vn);return W.set(wt,{el:ts,baseActive:Qt}),ts}).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"]=yt(o(e.gap))),e.indent!=null&&(He.style["--cms-drawer-indent"]=yt(o(e.indent))),e.padding!=null&&(He.style["--cms-drawer-padding"]=yt(o(e.padding))),e.width!=null&&(He.style.width=yt(o(e.width))),e.minHeight!=null&&(He.style.minHeight=yt(o(e.minHeight))),e.maxHeight!=null&&(He.style.maxHeight=yt(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=zo.get(S)||new Set;return $e.add(ae),zo.set(S,$e),Fn(_n,S),ae.isDrawerOpen=d,ae.openDrawer=r,ae.closeDrawer=b,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=(x,g)=>{var M;return!!(x&&x.nodeType===1&&((M=x.classList)!=null&&M.contains(`cms-page-${g}`)))},S=x=>x==null?null:typeof x=="string"?Ne.Icon({name:x,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(x,{as:"icon"}),d={dense:!!o(e.dense),flat:!!o(e.flat),centered:!!o(e.centered),narrow:!!o(e.narrow)},r=(x,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(M=>r(x,M));return}if(g!=null&&g.nodeType){x.appendChild(g);return}x.appendChild(document.createTextNode(String(g)))}},b=(x,g,M=Y=>Y)=>{const Y=JSswift.ui.getSlot(s,x);if(Y!=null)return J(s,x,d,null);if(typeof g=="function"){const Q=new Set(["eyebrow","title","subtitle"]),ve=_[Q.has(x)?"span":"div"]({class:`cms-page-slot-${x}`});return JSswift.reactive.effect(()=>{const N=M(g(d)),f=xn(JSswift.ui.slot(N));ve.replaceChildren(),Array.isArray(f)?f.forEach(A=>r(ve,A)):r(ve,f)},`UI.Page:${x}`),[ve]}return J(s,x,d,M(g))},F=J(s,"default",d,n!=null&&n.length?n:[]),C={hero:[],header:[],body:[],footer:[],actions:[]},w=[];F.forEach(x=>{c(x,"hero")?C.hero.push(x):c(x,"header")?C.header.push(x):c(x,"body")?C.body.push(x):c(x,"footer")?C.footer.push(x):c(x,"actions")?C.actions.push(x):w.push(x)});const P=b("icon",e.icon,S),le=b("hero",(p=e.hero)!=null?p:e.banner),Z=b("eyebrow",(V=e.eyebrow)!=null?V:e.kicker),he=b("title",e.title),H=b("subtitle",(ie=e.subtitle)!=null?ie:e.description),W=b("header",e.header),se=b("aside",e.aside),X=b("body",(a=e.body)!=null?a:e.content),fe=b("footer",e.footer),_e=b("actions",e.actions),be=le.length?_.div({class:te(["cms-page-hero",e.heroClass])},...le):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,...w],$=ce.length?_.div({class:te(["cms-page-body",e.bodyClass])},...ce):null,re=[..._e,...C.actions],oe=fe.length||re.length?_.div({class:te(["cms-page-footer",e.footerClass])},...fe,re.length?_.div({class:"cms-page-actions"},...re):null):null,Se=!!(le.length||C.hero.length),L=!!(me||C.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,yt)),(e.padding!=null||Ye(e.padding))&&(m.style["--cms-page-padding"]=Ke(e.padding,yt)),(e.maxWidth!=null||Ye(e.maxWidth))&&(m.style["--cms-page-max-width"]=Ke(e.maxWidth,yt)),(e.minHeight!=null||Ye(e.minHeight))&&(m.style["--cms-page-min-height"]=Ke(e.minHeight,yt)),(e.headerGap!=null||Ye(e.headerGap))&&(m.style["--cms-page-header-gap"]=Ke(e.headerGap,yt)),(e.heroPadding!=null||Ye(e.heroPadding))&&(m.style["--cms-page-hero-padding"]=Ke(e.heroPadding,yt));const h=_.div(m,be,...C.hero,de,...C.header,$,...C.body,oe,...C.footer);return Nt(h,e),h},Ne.AppShell=(...t)=>{var x,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,S=o(e.reverse)===!0,d=o(e.stack)===!0,r=(g=(x=e.drawerStateKey)!=null?x:e.stateKey)!=null?g:Gn;r&&(Gn=r,_n=es(r));const b={props:e,noDrawer:c,stateKey:r,isDrawerOpen:()=>es(r),openDrawer:()=>Fn(!0,r),closeDrawer:()=>Fn(!1,r),toggleDrawer:()=>Fn(!es(r),r)},F=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let C=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),C=Ne.Header(F));const w=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},P=i(e,"drawerItems")?e.drawerItems:e.items,le=i(e,"drawerHeader")?e.drawerHeader:void 0;let Z=e.drawer;!i(e,"drawer")&&!c&&(Object.keys(w).length||P!=null||le!=null)&&(!i(w,"items")&&P!=null&&(w.items=P),!i(w,"header")&&le!=null&&(w.header=le),i(w,"stateKey")||(w.stateKey=r),Z=Ne.Drawer(w));const he=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},H=i(e,"content")?e.content:n,W=J(s,"default",b,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",b,fe)));const be=J(s,"header",b,C),me=c?[]:J(s,"drawer",b,Z),de=J(s,"page",b,se),ce=J(s,"footer",b,_e),$=te(["cms-app","cms-app-shell",ye(c,"no-drawer"),ye(S,"is-reverse"),ye(d,"is-stack"),ye(e.flush,"is-flush"),ye(e.divider,"is-divider"),e.class]),re=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"]);re.class=$,re.style={...e.style||{}};const oe=Ke(e.drawerWidth,yt);oe!=null&&(re.style["--cms-app-shell-drawer-width"]=oe);const Se=Ke(e.gap,yt);Se!=null&&(re.style["--cms-app-shell-gap"]=Se);const L=Ke(e.padding,yt);L!=null&&(re.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=S?[p,h]:[h,p],a=_.div(re,...m?[m]:[],_.div({class:"cms-app-shell-body"},...ie.filter(Boolean)),...V?[V]:[]);return a.openDrawer=b.openDrawer,a.closeDrawer=b.closeDrawer,a.toggleDrawer=b.toggleDrawer,a.isDrawerOpen=b.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,bn(c);const S=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})`},b=(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)},C=J(i,"badge",F,n.badge),w=J(i,"background",F,n.backgroundContent),P=J(i,"eyebrow",F,(M=n.eyebrow)!=null?M:n.kicker),le=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=C.length?_.div({class:te(["cms-parallax-badge",n.badgeClass])},...C):null,de=P.length||le.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,le.length?_.div({class:te(["cms-parallax-title",n.titleClass])},...le):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,re=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",S,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,yt)),n.minHeight!=null&&(Se.style["--cms-parallax-min-height"]=Ke(n.minHeight,yt)),n.padding!=null&&(Se.style["--cms-parallax-padding"]=Ke(n.padding,yt)),n.gap!=null&&(Se.style["--cms-parallax-gap"]=Ke(n.gap,yt)),n.contentMaxWidth!=null&&(Se.style["--cms-parallax-content-max-width"]=Ke(n.contentMaxWidth,yt)),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])},w.length?_.div({class:te(["cms-parallax-bg-content",n.backgroundContentClass])},...w):null),m=_.div({class:te(["cms-parallax-content",n.contentClass,n.innerClass])},me,ce,$,re,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)},x=()=>{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=b(n.speed,.18),N=Math.abs(b(n.maxOffset,96)),f=o(n.startTop),A=f!=null&&f!==""?(Q.top-b(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,x()}))}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[yo,bo]=bt.reactive.signal([]),wo=new Map;function Jo(t){const e=wo.get(t);e&&(clearTimeout(e),wo.delete(t))}function Ro(t){return t?(Jo(t),bo(yo().filter(e=>e.id!==t)),t):null}function Ki(){for(const t of wo.keys())Jo(t);bo([])}function ni(t){t!=null&&t.id&&(Jo(t.id),t.timeout>0&&wo.set(t.id,setTimeout(()=>{Ro(t.id)},t.timeout)))}function si(t,e={}){if(!t)return null;let n=null;return bo(yo().map(s=>s.id!==t?s:(n=$n({...s,...e,id:s.id},e.type||e.state||e.color||s.type),n))),n&&ni(n),(n==null?void 0:n.id)||null}function qi(t){const e=()=>Ro(t.id),n=(he={})=>si(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=Wi[t.type];return he?Ne.Icon({name:he,size:"sm"}):null})(),S=J(t.slots,"icon",s,c),d=J(t.slots,"title",s,i(t.title)),r=J(t.slots,"message",s,i(t.message)),b=J(t.slots,"description",s,i(t.description)),F=J(t.slots,"meta",s,i(t.meta)),C=J(t.slots,"actions",s,i(t.actions)),w=J(t.slots,"default",s,i(t.body)),P=J(t.slots,"dismiss",s,i(t.dismiss)),le=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},S.length?_.div({class:"cms-toast-icon"},...S):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,b.length?_.div({class:"cms-toast-description"},...b):null,w.length?_.div({class:"cms-toast-body"},...w):null,F.length?_.div({class:"cms-toast-meta"},...F):null),C.length?_.div({class:"cms-toast-actions"},...C):null),le.length?_.div({class:"cms-toast-dismiss"},...le):null);return Nt(Z,t),Z}function Yi(){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=yo();t.innerHTML="";const n=new Map;for(const s of e){const i=ei(s.position);n.has(i)||n.set(i,[]),n.get(i).push(s)}for(const s of Zo){const i=n.get(s);if(!(i!=null&&i.length))continue;const c=_.div({class:te(["cms-toast-wrap",`is-${s}`])},...i.map(S=>qi(S)));t.appendChild(c)}},"JSswiftUI:toasts"),t)}function Xi(t={}){Yi();const e=$n(t);return e.id=e.id||Math.random().toString(36).slice(2),bo([...yo().filter(n=>n.id!==e.id),e]),ni(e),e.id}bt.services.notify.show=Xi,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=si,bt.services.notify.remove=Ro,bt.services.notify.clear=Ki,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,S=JSswift.form._isPromise(c)?await c:c;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,c=_.rod({}),S=_.rod({}),d=_.rod(!1),r=_.rod(null),b=()=>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)}},C=be=>{const me=b();return me?me[be]:void 0},w=(be,me)=>{const de={...b()||{}};de[be]=me,F(de)},P=(be,me)=>{const de={...c.value||{}};me?de[be]=me:delete de[be],c.value=de},le=be=>(c.value||{})[be]||null,Z=be=>{S.value={...S.value||{},[be]:!0}},he=be=>!!(S.value||{})[be],H=async be=>{const me=n[be]||[];if(!me.length)return P(be,null),!0;const de=C(be),ce={name:be,value:de,model:b(),form:_e};for(const $ of me){if(!$)continue;const re=await JSswift.form._runRule($,de,ce);if(re)return P(be,re),!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:S,submitting:d,submitError:r,getValue:C,setValue:w,getError:le,setError:P,touch:Z,isTouched:he,field:(be,me={})=>{var V;const de=_.rod("");(V=de.action)==null||V.call(de,ie=>{w(be,ie)});const ce=()=>s==="submit"||s==="input"||s==="blur"?!0:he(be);let $=null,re=!1,oe=!1;const Se=async()=>{re||(re=!0,Z(be),(s==="blur"||s==="input")&&await H(be),setTimeout(()=>{re=!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,re=!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()?le(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={},S.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(b(),_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]),S=JSswift.omit(e,["form","onSubmit"]);S.class=c;const d=_.form({...S,onSubmit:async b=>{b.preventDefault(),s&&await s.submit(i||(async()=>{}))}}),r=[];for(const b of n||[]){const F=typeof b=="function"?b(s):b,C=JSswift.ui.slot(F);C&&(Array.isArray(C)?r.push(...C):r.push(C))}return r.forEach(b=>d.appendChild(b)),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 Ns=null;function oi(){return Ns||(Ns=document.createElement("div"),Ns.setAttribute("data-cms-modal-root","true"),document.body.appendChild(Ns),Ns)}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 S={...e.style||{}},d=Ke(e.align);d!=null&&!Ze(e,"align")&&(S.alignItems=d);const r=Ke(e.justify);r!=null&&!Ze(e,"justify")&&(S.justifyContent=r);const b=Ke(e.wrap,P=>P?"wrap":"nowrap");b!=null&&!Ze(e,"wrap")&&(S.flexWrap=b);const F=Ke(e.direction);F!=null&&!Ze(e,"direction")&&(S.flexDirection=F);const C=Ke(e.gap,yt);C!=null&&!Ze(e,"gap")&&(S.gap=C),Object.keys(S).length&&(c.style=S),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const w=_.div(c,...J(s,"default",{},n));return Nt(w,e),w},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 S=_.div(c,...J(s,"default",{},n));return Nt(S,e),S},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 S={...e.style||{}},d=Ke(e.align);d!=null&&!Ze(e,"align")&&(S.alignItems=d);const r=Ke(e.justify);r!=null&&!Ze(e,"justify")&&(S.justifyContent=r);const b=Ke(e.wrap,P=>P?"wrap":"nowrap");b!=null&&!Ze(e,"wrap")&&(S.flexWrap=b);const F=Ke(e.direction);F!=null&&!Ze(e,"direction")&&(S.flexDirection=F);const C=Ke(e.gap,yt);C!=null&&!Ze(e,"gap")&&(S.gap=C),Object.keys(S).length&&(c.style=S),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const w=_.div(c,...J(s,"default",{},n));return Nt(w,e),w},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 S={...e},d=null,r=null;const b=(m,h)=>typeof m=="function"?m(h):m,F=m=>String(m||"").split(/\s+/).filter(Boolean),C=(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},w=(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,x,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((x=m==null?void 0:m.offsetTop)!=null?x: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}},le=m=>{if(!(m!=null&&m.panel))return;const{left:h,top:p,width:V,height:ie}=P();w(m.panel,"position","fixed"),w(m.panel,"inset",0,a=>`${a}px`),w(m.panel,"top",p,a=>`${a}px`),w(m.panel,"left",h,a=>`${a}px`),w(m.panel,"right","auto"),w(m.panel,"bottom","auto"),w(m.panel,"width",V,a=>`${a}px`),w(m.panel,"height",ie,a=>`${a}px`),w(m.panel,"min-height",ie,a=>`${a}px`),w(m.panel,"max-width",V,a=>`${a}px`),w(m.panel,"max-height",ie,a=>`${a}px`),w(m.panel,"min-width",0,a=>`${a}px`),w(m.panel,"margin",0,a=>`${a}px`),w(m.panel,"box-sizing","border-box"),w(m.panel,"border-width",0,a=>`${a}px`),w(m.panel,"border-radius",0,a=>`${a}px`),w(m.panel,"transform","none"),w(m.panel,"overflow","hidden"),w(m.panel,"--cms-dialog-fullscreen-left",h,a=>`${a}px`),w(m.panel,"--cms-dialog-fullscreen-top",p,a=>`${a}px`),w(m.panel,"--cms-dialog-fullscreen-width",V,a=>`${a}px`),w(m.panel,"--cms-dialog-fullscreen-height",ie,a=>`${a}px`)},Z=m=>{m!=null&&m.panel&&(w(m.panel,"position",null),w(m.panel,"inset",null),w(m.panel,"top",null),w(m.panel,"left",null),w(m.panel,"right",null),w(m.panel,"bottom",null),w(m.panel,"width",null),w(m.panel,"height",null),w(m.panel,"min-height",null),w(m.panel,"max-width",null),w(m.panel,"max-height",null),w(m.panel,"min-width",null),w(m.panel,"margin",null),w(m.panel,"box-sizing",null),w(m.panel,"border-width",null),w(m.panel,"border-radius",null),w(m.panel,"transform",null),w(m.panel,"overflow",null),w(m.panel,"--cms-dialog-fullscreen-left",null),w(m.panel,"--cms-dialog-fullscreen-top",null),w(m.panel,"--cms-dialog-fullscreen-width",null),w(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=()=>le(m),x=()=>{p!=null&&ie(p),p=V(()=>{p=null,a()})};a(),x(),window.addEventListener("resize",a),window.addEventListener("orientationchange",x),(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",x),m._dialogViewportCleanup=()=>{var N,f,A,z;p!=null&&(ie(p),p=null),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",x),(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",x)}},H=()=>S,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:re,dismiss:re,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,b(m.eyebrow,h)),ie=J(s,"title",h,b((ke=(K=m.title)!=null?K:m.heading)!=null?ke:m.header,h)),a=J(s,"subtitle",h,b((Me=m.subtitle)!=null?Me:m.description,h)),x=J(s,"icon",h,p),g=J(s,"header",h,b((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,b(Y,h));Q.length||(Q=J(s,"body",h,b(Y,h))),Q.length||(Q=J(s,"default",h,b(Y,h)));const ve=b((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||x.length||M.length)&&(f=_.div({class:"cms-dialog-head"},x.length?_.div({class:"cms-dialog-icon"},...x):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);C(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)]),C(m.overlay,"_dialogOverlayClassTokens",[fe(h),o(h.backdropBlur)?"cms-dialog-overlay-blur":"",...F(h.overlayClass)]),w(m.panel,"--cms-dialog-width",o(h.width),yt),w(m.panel,"--cms-dialog-min-width",o(h.minWidth),yt),w(m.panel,"--cms-dialog-max-width",o(h.maxWidth),yt),w(m.panel,"--cms-dialog-max-height",o(h.maxHeight),yt),w(m.panel,"--cms-dialog-body-max-height",o((ie=h.bodyMaxHeight)!=null?ie:h.contentMaxHeight),yt),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"&&(S={...S,...m}),d&&(me(d),de()),L),$=(m=null)=>{var ie,a,x,g,M;if(m&&typeof m=="object"&&(S={...S,...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:(x=h.closeOnEsc)!=null?x:!p,className:Yt(["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]")&&re()};return d.panel.addEventListener("click",V),me(d),_s(d),(M=(g=H()).onOpen)==null||M.call(g,d),d},re=()=>{if(!d)return;const m=d;ks(m,()=>JSswift.overlay.close(m.id))},oe=()=>!!d,Se=(m=null)=>oe()?(re(),null):$(m),L={open:$,close:re,toggle:Se,update:ce,isOpen:oe,entry:()=>d,props:()=>({...S})};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=jt(e.model,"UI.TabPanel:model"),S=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",b=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)},C=d(e.orientation||e.orient||e.direction),w=r(e.navPosition||e.barPosition||e.position),P=b(e.variant||(e.pills?"pills":e.soft?"soft":"line")),le=!!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,Xt,Qt,sn,Ht,Zt,rn,fn;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=(sn=(Qt=(Xt=u.content)!=null?Xt:u.panel)!=null?Qt:u.body)!=null?sn:Ue?u.children:null,Ge=(rn=(Zt=(Ht=u.note)!=null?Ht:u.subtitle)!=null?Zt:u.description)!=null?rn:null,lt=(fn=u.icon)!=null?fn: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",C,`variant-${P}`,ye(le,"wrap"),ye(H,"animated"),ye(W,"nav-fill"),ye(se,"disabled"),ye(w==="after","nav-after"),e.class]),re=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"]);re.class=$,re.style=e.style;const oe=_.div(re);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":C}),L=_.div({class:te(["cms-tabpanel-panels",e.panelsClass])}),m=[],h=[];let p=-1;const V=()=>C==="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},x=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,Xt,Qt,sn;const xe=I===p,Ue=`${S}-tab-${I}`,et=`${S}-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:(Xt=(Dt=(Ft=u.iconSize)!=null?Ft:u.size)!=null?Dt:e.size)!=null?Xt: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=Ht=>{if(se||u.disabled)return;const Zt=Ht.key;if(Zt==="Enter"||Zt===" "){Ht.preventDefault(),Me(I);return}if(Zt==="Home"){Ht.preventDefault();const Kt=ce.findIndex(Pn=>!Pn.disabled);Kt>=0&&(Me(Kt),x(Kt));return}if(Zt==="End"){Ht.preventDefault();const Kt=(()=>{var Pn;for(let An=ce.length-1;An>=0;An-=1)if(!((Pn=ce[An])!=null&&Pn.disabled))return An;return-1})();Kt>=0&&(Me(Kt),x(Kt));return}const rn=V()?["ArrowLeft"]:["ArrowUp"],fn=V()?["ArrowRight"]:["ArrowDown"];if(rn.includes(Zt)){Ht.preventDefault();const Kt=a(I,-1,he);Kt>=0&&(Me(Kt,{dir:"prev"}),x(Kt));return}if(fn.includes(Zt)){Ht.preventDefault();const Kt=a(I,1,he);Kt>=0&&(Me(Kt,{dir:"next"}),x(Kt))}},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:(sn=(Qt=u.size)!=null?Qt:e.size)!=null?sn: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=`${S}-tab-${I}`,et=`${S}-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:C,position:w,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"),w==="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 Qi(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Mo({title:t,message:e,contentNode:n,okText:s,cancelText:i,showCancel:c,onOk:S,onCancel:d,persistent:r}){oi();const b=_.div({class:"cms-dialog-backdrop",onClick:Z=>{Z.target===b&&r!==!0&&(d==null||d())}}),F=J(null,"default",{},t),C=J(null,"default",{},e),w=J(null,"default",{},n),P=_.div({class:"cms-dialog cms-panel"},F.length?_.h3(...F):null,C.length?_.p(...C):null,...w,_.div({class:"cms-dialog-actions"},c?JSswift.ui.Btn({onClick:d},i||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:S},s||"OK")));b.appendChild(P),oi().appendChild(b);const le=Z=>{Z.key==="Escape"&&(d==null||d())};return document.addEventListener("keydown",le,{once:!0}),{backdrop:b,close:()=>Qi(b)}}bt.dialog.alert=function(t,e={}){return new Promise(n=>{const{backdrop:s,close:i}=Mo({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}=Mo({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}=Mo({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 dn=null,$s=0;function ii(){if(dn)return dn;dn=document.createElement("div"),dn.className="cms-loading-backdrop",dn.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 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),
|
|
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),dn.appendChild(t),document.body.appendChild(dn);const S=document.createElement("style");return S.textContent=`
|
|
33
33
|
@keyframes cmsSpin { to { transform: rotate(360deg); } }
|
|
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);
|
|
34
|
+
`,document.head.appendChild(S),dn._textNode=n,dn._spinner=e,dn._progressWrap=s,dn._progressBar=i,dn._progressActive=!1,dn}function li(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 ri(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=ii(),s=li(t,e);$s++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",ri(n,"spinner"),s.spinner===!1&&(n._spinner.style.display="none"),n.style.display="flex"},bt.loading.hide=function(){dn&&($s=Math.max(0,$s-1),$s===0&&(dn.style.display="none",dn._progressActive=!1))},bt.loading.progress=function(t=0,e={}){var c;const n=ii();typeof t=="object"&&t!==null&&(e=t,t=(c=t.value)!=null?c:0);const s=li(null,e);n._progressActive||($s++,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+"%",ri(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 Zi(t){return typeof t=="function"?t():t||[]}function Oo(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 el(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 tl(t){const e=Zi(t);return Array.isArray(e)?e:[]}function ai(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 Fo(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 ci(t,e){return t.find((n,s)=>Fo(n,s)===e||(n==null?void 0:n.key)===e)||null}function vo(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"?Oo(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function So(t,e){return typeof t=="function"?t(e)||{}:t||{}}function Co(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(Co).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 nl(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 sl(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 S=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var F;return(F=b==null?void 0:b.searchKey)!=null?F:b==null?void 0:b.key}).filter(Boolean),d=[];if(S.length)for(const b of S)if(typeof b=="function")d.push(Co(b(t)));else{const F=e.find(C=>(C==null?void 0:C.key)===b||(C==null?void 0:C.searchKey)===b);d.push(Co(F?vo(F,t,-1):Oo(t,b)))}else d.push(Co(t));const r=d.join(" ").toLowerCase();return c.every(b=>r.includes(b))}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=nl(e.pageSizeOptions,[5,10,20,50]),S=Number((ae=(He=e.pageSize)!=null?He:c[0])!=null?ae:10)||10,d=Array.from(new Set([...c,S])).sort((De,Ie)=>De-Ie),r=e.initialSort||(e.sortBy?{key:e.sortBy,dir:e.sortDir==="desc"?"desc":"asc"}:null),b=e.searchable===!0||typeof e.searchable=="string"||e.searchPlaceholder!=null||e.search!=null||e.query!=null||!!e.searchModel||!!e.queryModel||Array.isArray(e.searchKeys)||typeof e.searchBy=="function"||typeof e.searchPredicate=="function",F=jt(e.searchModel||e.queryModel,"UI.Table:query"),[C,w]=bt.reactive.signal(Math.max(1,Number(e.page||1)||1)),[P,le]=bt.reactive.signal(S),[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),w(1)},X=De=>{const Ie=Number(De)||S;le(Ie),w(1)},fe=(De,Ie)=>{const qe=Fo(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),w(1)};let _e=null;F&&F.watch(De=>{const Ie=String(De!=null?De:"");W(Ie),_e&&_e.value!==Ie&&(_e.value=Ie),w(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),re=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(b){_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))}re.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 x=J(s,"caption",{},e.caption);x.length&&me.appendChild(_.div({class:"cms-table-caption"},...x));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"]=yt(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:()=>w(Math.max(1,C()-1))},"\u2039"),ke=Ne.Btn({outline:!0,onClick:()=>w(C()+1)},"\u203A"),Me=_.div({class:"cms-singularity cms-table-chip"},""),Te=_.select({class:"cms-input cms-table-size-select"},...d.map(De=>xs({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={...So(Ie==null?void 0:Ie.style,{...Be,header:!0}),...So((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=yt(Ie.width)),(Ie==null?void 0:Ie.minWidth)!=null&&(T.minWidth=yt(Ie.minWidth)),(Ie==null?void 0:Ie.maxWidth)!=null&&(T.maxWidth=yt(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:ai(Ie);Pe=J(s,"header",Be,et)}const O=Z(),k=Fo(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=tl(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=>sl(G,i,Ie,e))),qe){const G=ci(i,qe.key);G&&Pe.sort((Ge,lt)=>{const tt=vo(G,Ge,-1),dt=vo(G,lt,-1),St=typeof G.compare=="function"?G.compare(tt,dt,Ge,lt):el(tt,dt);return qe.dir==="asc"?St:-St})}const k=Pe.length,v=Math.max(1,Number(P())||S),u=T?Math.max(1,Math.ceil(k/v)):1,I=T?Math.min(C(),u):1;I!==C()&&w(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=ci(i,qe.key);V.textContent=G?`Ordine: ${ai(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):Oo(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 Zt,rn;const Ft=vo(st,Ge,lt),Dt={...tt,col:st,colIndex:wt,value:Ft},Xt={...So(st==null?void 0:st.style,Dt),...So((Zt=st==null?void 0:st.cellStyle)!=null?Zt:st==null?void 0:st.tdStyle,Dt)};st!=null&&st.align&&(Xt.textAlign=st.align),(st==null?void 0:st.width)!=null&&(Xt.width=yt(st.width)),(st==null?void 0:st.minWidth)!=null&&(Xt.minWidth=yt(st.minWidth)),(st==null?void 0:st.maxWidth)!=null&&(Xt.maxWidth=yt(st.maxWidth));const Qt=typeof(st==null?void 0:st.cellClass)=="function"?st.cellClass(Ge,Dt):(st==null?void 0:st.cellClass)||(st==null?void 0:st.class),sn=_.td({class:te(["cms-table-cell",Qt,ye(st==null?void 0:st.nowrap,"is-nowrap")]),style:Xt});let Ht=J(st==null?void 0:st.slots,"cell",Dt,null);if(!Ht.length){const fn=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,Kt=fn==null?(rn=st==null?void 0:st.emptyText)!=null?rn:"":fn;Ht=J(s,"cell",Dt,Kt)}Ht.length||(Ht=[""]),Ht.forEach(fn=>sn.appendChild(fn)),Rt.appendChild(sn)}),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 S={...e},d=null,r=null,b=null,F=null,C=null;const w=(f,A)=>Object.prototype.hasOwnProperty.call(f||{},A),P=(f,A)=>typeof f=="function"?f(A):f,le=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(C),F=null,C=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=()=>S||{},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"])},re=(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})]:mn(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 mn(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:x,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=w(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,Xt,Qt,sn;if(Te){wt.preventDefault(),wt.stopPropagation();return}(Xt=(Dt=X()).onItemClick)==null||Xt.call(Dt,z,Me,wt);const Ft=(Qt=z.onClick)==null?void 0:Qt.call(z,Me,wt);wt.defaultPrevented||(He&&((sn=JSswift.router)!=null&&sn.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:x,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":"",...le(A.panelClass)]),W(f.overlay,"_menuOverlayClassTokens",[...le(A.overlayClass)]),f.panel.dataset.placement=be(A),se(f.panel,"--cms-menu-width",o(A.width),yt),se(f.panel,"--cms-menu-min-width",o(A.minWidth),yt),se(f.panel,"--cms-menu-max-width",o(A.maxWidth),yt),se(f.panel,"--cms-menu-max-height",o(A.maxHeight),yt),se(f.panel,"--cms-menu-body-max-height",o((ke=A.bodyMaxHeight)!=null?ke:A.contentMaxHeight),yt),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,ks(f,()=>JSswift.overlay.close(f.id))},a=(f={})=>{var A,z,K,ke;if(f&&typeof f=="object"&&(S={...S,...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},x=(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}=re(f,A);K&&(S={...S,...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(),b=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:Yt(["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&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(d!=null&&d.panel))return d;const U=d;Te=U,U._anchorEl=Me;const j=()=>{clearTimeout(C),C=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:w(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}),_s(U),(Ge=(G=X()).onOpen)==null||Ge.call(G,U),Se(),U},g=(f,A=null)=>{clearTimeout(C),C=null,clearTimeout(F),F=setTimeout(()=>x(f,A),me())},M=(f=!1)=>{if(clearTimeout(F),F=null,!!d){if(clearTimeout(C),f){ie();return}C=setTimeout(()=>ie(),de())}},Y=(f=null,A=null)=>Q()?(ie(),null):x(f,A),Q=()=>!!d,N={open:x,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:w(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(w(A,"open"))return Ye(A.open)?JSswift.reactive.effect(()=>{r&&(o(X().open)?x(r):M(!0))},"UI.Menu:open"):A.open===!0?x(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:()=>({...S})};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 S={...e},d=null,r=null,b=null,F=null,C=null;const w=(N,f)=>Object.prototype.hasOwnProperty.call(N||{},f),P=(N,f)=>typeof N=="function"?N(f):N,le=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(C),F=null,C=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=()=>S,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),re=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=re(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":"",...le(f.class),...le(f.panelClass)]),W(N.overlay,"_popoverOverlayClassTokens",[...le(f.overlayClass)]),N.panel.dataset.placement=me(f),se(N.panel,"--cms-dialog-width",o(f.width),yt),se(N.panel,"--cms-dialog-min-width",o(f.minWidth),yt),se(N.panel,"--cms-dialog-max-width",o(f.maxWidth),yt),se(N.panel,"--cms-dialog-max-height",o(f.maxHeight),yt),se(N.panel,"--cms-dialog-body-max-height",o((K=f.bodyMaxHeight)!=null?K:f.contentMaxHeight),yt),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,ks(N,()=>JSswift.overlay.close(N.id))},ie=(N={})=>(N&&typeof N=="object"&&(S={...S,...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&&(S={...S,...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(),b=document.activeElement;const Me=Se((Ee=($e=K.trigger)!=null?$e:K.triggers)!=null?Ee:w(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:Yt(["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&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(d!=null&&d.panel))return d;const ne=d;j=ne,ne._anchorEl=ke;const Ve=()=>{clearTimeout(C),C=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),_s(ne),(Pe=(T=X()).onOpen)==null||Pe.call(T,ne),ne},x=(N,f=null)=>{clearTimeout(C),C=null,clearTimeout(F),F=setTimeout(()=>a(N,f),ce())},g=(N=!1)=>{if(clearTimeout(F),F=null,!!d){if(clearTimeout(C),N){V();return}C=setTimeout(()=>V(),$())}},M=(N=null,f=null)=>Y()?(V(),null):a(N,f),Y=()=>!!d,ve={open:a,close:V,show:x,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:w(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(w(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=()=>x(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=()=>x(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:()=>({...S})};return ve},Ne.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},i=null,c=null,S=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"),b=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)),C=()=>s,w=(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,le=p=>{if(!r(p))return null;const V=p.getBoundingClientRect();return w(V.left+Math.min(V.width/2,24),V.top+Math.min(V.height/2,24))},Z=p=>{var V,ie,a,x;return o((x=(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?x:null)},he=(p,V=null)=>{if(!p)return le(V||S);const ie=w(p.clientX,p.clientY);if(ie)return ie;const a=Z({anchorEl:V||p.currentTarget||p.target||S});return le(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=C();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,x=null,g=null;if(b(p))a=he(p,S),g=d(V)?H(V):null;else if(typeof p=="number"||typeof V=="number")a=w(p,V),g=d(ie)?H(ie):null;else if(F(p))a=w(p.x,p.y),g=d(V)?H(V):null;else if(r(p))x=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?w(M.x,M.y):he(Q,Y||S),x=Y&&r(Y)?Y:null,g={...H(p),...d(V)?H(V):{}}}else i&&(a={...i});return{point:a,anchor:x,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(C());return r(ie)?ie:i?P(i):r(c)?c:r(S)?S:null},me=(p=null,V=null,ie=null)=>{const{point:a,anchor:x,nextProps:g}=X(p,V,ie);_e(g);const M=be(x,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),re=(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:re,close:$,toggle:Se,update:L,bind:(p,V=null)=>{if(!p)return()=>{};const ie=d(V)?H(V):null,a=g=>{var Y,Q;S=p,g.preventDefault(),!(((Q=(Y=C()).onTrigger)==null?void 0:Q.call(Y,g,{element:p,open:me,close:$,update:L}))===!1||o(C().disabled))&&me({event:g,anchorEl:p},ie)},x=g=>{var Y,Q;g.key!=="ContextMenu"&&!(g.shiftKey&&g.key==="F10")||(S=p,g.preventDefault(),((Q=(Y=C()).onTrigger)==null?void 0:Q.call(Y,g,{element:p,open:me,close:$,update:L}))===!1||o(C().disabled))||me({event:g,anchorEl:p},ie)};return p.addEventListener("contextmenu",a),p.addEventListener("keydown",x),()=>{p.removeEventListener("contextmenu",a),p.removeEventListener("keydown",x)}},isOpen:se.isOpen,entry:se.entry,props:()=>({...s})};return h}})(JSswift);
|