jsswift 1.0.52 → 1.0.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/documentions/knowledge-map.json +1 -1
- package/dist/jsswift.js +326 -229
- package/dist/jsswift.min.js +3 -3
- package/dist/min-jsswift.js +3 -3
- package/package.json +1 -1
package/dist/min-jsswift.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(()=>{var Fs,Ds,uo,fo,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 L={},R=l;return l.length>0&&typeof l[0]=="object"&&l[0]!==null&&!l[0].nodeType&&!Array.isArray(l[0])&&!(l[0]instanceof Function)&&(L=l[0],R=l.slice(1)),{props:L,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,L)=>{const R={},V=new Set(L||[]);for(const D in l||{})V.has(D)||(R[D]=l[D]);return R},ee._cleanupRegistry=new WeakMap,ee._registerCleanup=function(l,L){if(!l||typeof L!="function")return L;const R=ee._cleanupRegistry.get(l)||[];return R.push(L),ee._cleanupRegistry.set(l,R),L},ee.dom={q(l,L=document){return L.querySelector(l)},qa(l,L=document){return Array.from(L.querySelectorAll(l))},attr(l,L,R){return l?R===void 0?l.getAttribute(L):(R===null?l.removeAttribute(L):l.setAttribute(L,String(R)),l):null}},(()=>{let l=[],L=!1;function R(){if(L)return;L=!0;const V=l.slice();l.length=0;for(const D of V)try{D()}catch(ge){console.error("[JSswift.ready] error:",ge)}}ee.ready=function(V){typeof V=="function"&&(L||document.readyState==="interactive"||document.readyState==="complete"?queueMicrotask(()=>{try{V()}catch(D){console.error("[JSswift.ready] error:",D)}}):l.push(V))},document.addEventListener("DOMContentLoaded",R,{once:!0})})(),ee.reactive=(()=>{let l=null;const L=[],R=100;let V=0,D="sync",ge="sync",Y=!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(){Y||(Y=!0,queueMicrotask(()=>{Y=!1,ge="sync",we()}))}function Ae(ze){const je=Array.from(ze);if(V>0||ge==="microtask"){je.forEach(ct=>pe.add(ct)),V===0&&ge==="microtask"&&Ce();return}je.forEach(ct=>ct())}function Fe(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)){Fe(ze),L.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{L.pop(),l=L[L.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,Fe(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(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]=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 Me(ze,je){if(typeof ze!="function")throw new Error("JSswift.reactive.batch: fn must be a function");const ct=Le(je);V===0?D=ct:ct==="microtask"&&(D="microtask"),V+=1;try{return ze()}finally{if(V-=1,V===0){const ut=D==="microtask"||ge==="microtask";D="sync",ut?(ge="microtask",Ce()):we()}}}return{signal:pt,effect:Qe,computed:ft,untracked:it,batch:Me}})(),ee._overlayShared=(()=>{const l=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function L(ge,Y){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)),Y(we)}),Y(Le),Le}function R(ge){var pe;const Y=ge.querySelector(l);(pe=Y==null?void 0:Y.focus)==null||pe.call(Y)}function V(ge,Y){if(ge.key!=="Tab")return;const pe=Array.from(Y.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,Y){var Ct,Ke,Mn,nn,en,$s;if(!Y.anchorEl)return;const pe=Y.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),Fe=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=(Mn=Y.viewportGutter)!=null?Mn:Y.gutter)!=null?nn:8),pt=Number.isFinite(Qe)?Math.max(0,Qe):8,ft=Number((en=Y.offsetX)!=null?en:0),it=Number(($s=Y.offsetY)!=null?$s:8),Me=Number.isFinite(ft)?ft:0,ze=Number.isFinite(it)?it:8,je=(vn,gn,On)=>!Number.isFinite(vn)||(Number.isFinite(gn)||(gn=0),Number.isFinite(On)||(On=gn),On<gn)?gn:Math.min(Math.max(vn,gn),On),ct=String(Y.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=vn=>{let gn=pe.left+Me,On=pe.top+ze;return vn==="top"||vn==="bottom"?(Wt==="center"?gn=pe.left+(pe.width-_t)/2+Me:Wt==="end"&&(gn=pe.right-_t+Me),On=vn==="top"?pe.top-Jt-ze:pe.bottom+ze):(Wt==="center"?On=pe.top+(pe.height-Jt)/2+ze:Wt==="end"&&(On=pe.bottom-Jt+ze),gn=vn==="left"?pe.left-_t-Me:pe.right+Me),{left:gn,top:On}},nt=vn=>vn==="top"?pe.top-ze-pt:vn==="bottom"?Re-pe.bottom-ze-pt:vn==="left"?pe.left-Me-pt:Fe-pe.right-Me-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+Fe-_t-pt),qt=Math.max(zt,Ae+Re-Jt-pt),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:L,focusFirst:R,trapFocus:V,applyAnchoredPosition:D}})(),ee.overlay=(()=>{let l=0;const L=new Map;let R=null;const{ensureRoot:V,focusFirst:D,trapFocus:ge,applyAnchoredPosition:Y}=ee._overlayShared,pe=()=>V(()=>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 L.values())ft=it;return ft},Fe=ft=>{var Me;let it=ft;for(;it&&it!==document;){if(it.nodeType===1&&((Me=it.getAttribute)==null?void 0:Me.call(it,"data-cms-overlay-portal"))==="true")return!0;it=it.parentNode}return!1},Re=(ft,it={})=>{var nt,Et,Ot,vt;const Me=`ov_${++l}`,ze={id:Me,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=Me;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(Me)}):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 Wt=pe();if(!Wt)return{id:Me,close:()=>Qe(Me),panel:ut,overlay:je};Wt.appendChild(je),ze.overlay=je,ze.panel=ut,ze.backdrop=ct,L.set(Me,ze),it.lockScroll&&we(),it.autoFocus!==!1&&setTimeout(()=>{ut.isConnected&&L.get(Me)===ze&&!ut.contains(document.activeElement)&&D(ut)},0);const Ze=(gt=null)=>{gt&&typeof gt=="object"&&Object.assign(ze.opts,gt),Y(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,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",gt),window.removeEventListener("scroll",gt,!0),(qt=(te=window.visualViewport)==null?void 0:te.removeEventListener)==null||qt.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!==Me||it.closeOnOutside!==!1&&(Fe(gt.target)||ut.contains(gt.target)||Qe(Me))};document.addEventListener("mousedown",_t,!0);const Jt=gt=>{const Ye=Ae();!Ye||Ye.id!==Me||(it.trapFocus&&ge(gt,ut),gt.key==="Escape"&&it.closeOnEsc!==!1&&(gt.preventDefault(),Qe(Me)))};document.addEventListener("keydown",Jt,!0),ct.addEventListener("click",()=>{it.closeOnBackdrop!==!1&&Qe(Me)}),ze._cleanup=()=>{var gt;document.removeEventListener("mousedown",_t,!0),document.removeEventListener("keydown",Jt,!0),(gt=ze._positionCleanup)==null||gt.call(ze)};const We=1e3+L.size*10;return je.style.zIndex=String(We),{id:Me,close:()=>Qe(Me),panel:ut,overlay:je,reposition:Ze}},Qe=ft=>{var Me,ze,je;const it=L.get(ft);it&&(L.delete(ft),(Me=it._cleanup)==null||Me.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:L}})();function gs(l,L={}){const{isSVG:R=!1,normalizeClass:V=Me=>String(Me!=null?Me:""),isContentProp:D=()=>!1,autoValueTags:ge=new Set(["INPUT","TEXTAREA","SELECT"])}=L;function Y(Me){if(R||!(Me in l))return!1;try{return typeof l[Me]=="boolean"}catch(ze){return!1}}function pe(Me){return R||Me.startsWith("data-")||Me.startsWith("aria-")||!(Me in l)}function Le(Me,ze){if(ze==null){l.removeAttribute(Me);return}if(ze===!1){if(Me.startsWith("aria-")){l.setAttribute(Me,"false");return}l.removeAttribute(Me);return}if(ze===!0&&!R&&!Me.startsWith("aria-")&&!Me.startsWith("data-")){l.setAttribute(Me,"");return}l.setAttribute(Me,String(ze))}function we(Me,ze){if(Me==null)return;const je=String(Me),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(Me){const ze=V(Me);if(ze==null||ze===!1||ze===""){l.removeAttribute("class");return}l.setAttribute("class",String(ze))}function Ae(Me,ze){const je=!!ze;l[Me]=je,je?l.setAttribute(Me,""):l.removeAttribute(Me)}function Fe(Me){if(D(Me)){l[Me]="";return}if(Me==="class"){l.removeAttribute("class");return}if(Me==="style"){l.removeAttribute("style");return}if(Y(Me)){try{l[Me]=!1}catch(ze){}l.removeAttribute(Me);return}if(l.removeAttribute(Me),!pe(Me))try{typeof l[Me]=="string"&&(l[Me]="")}catch(ze){}}function Re(Me){!Me||typeof Me!="object"||Object.entries(Me).forEach(([ze,je])=>{we(ze,je)})}function Qe(Me,ze){if(D(Me)){l[Me]=ze!=null?ze:"";return}if(Me==="class"){Ce(ze);return}if(Me==="style"){if(ze==null||ze===!1){Fe(Me);return}if(typeof ze=="object"){Re(ze);return}}if(Y(Me)){Ae(Me,ze);return}if(ze==null||ze===!1){Fe(Me);return}if(pe(Me)){Le(Me,ze);return}l[Me]=ze}function pt(Me,ze){const je=String(Me).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(Me){return Me?Me==="auto"||Me.startsWith("attr:")||Me.startsWith("@")||Me.startsWith("style.")||Me.includes("."):!1}function it(Me,ze){if(!Me||Me==="auto"){ge.has(l.tagName)?Qe("value",ze):l.textContent=ze!=null?ze:"";return}if(Me.startsWith("attr:")){Le(Me.slice(5),ze);return}if(Me.startsWith("@")){Le(Me.slice(1),ze);return}if(Me.startsWith("style.")){we(Me.slice(6),ze);return}if(Me.includes(".")){pt(Me,ze);return}Qe(Me,ze)}return{isBooleanDomProp:Y,isAttributeOnlyProp:pe,isBindingValueKey:ft,setAttributeValue:Le,setStyleEntry:we,setClassValue:Ce,setBooleanProp:Ae,removeProp:Fe,applyStyleObject:Re,setProp:Qe,setPathValue:pt,applyBindingValue:it}}function Bn(l){const L=[],R=V=>{if(!(V==null||V===!1)){if(typeof V=="function"){R(V());return}if(V&&V.type==="rod"){R(V.value);return}if(Array.isArray(V)){V.forEach(R);return}if(typeof V=="object"){Object.entries(V).forEach(([D,ge])=>{let Y=ge;typeof Y=="function"?Y=Y():Y&&Y.type==="rod"&&(Y=Y.value),R(Y?D:null)});return}V!==!0&&String(V).split(/\s+/).forEach(D=>{D&&L.push(D)})}};return R(l),L.length?Array.from(new Set(L)).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,L){return l==null||l===!1?!1:typeof l=="function"||L(l)?!0:typeof l!="object"||Array.isArray(l)||l.nodeType?!1:Object.values(l).some(R=>os(R,L))}function is(l,L){let R=l;if(typeof R=="function"?R=R():L(R)&&(R=R.value),!R||typeof R!="object"||Array.isArray(R)||R.nodeType)return null;const V={};return Object.entries(R).forEach(([D,ge])=>{let Y=ge;typeof Y=="function"?Y=Y():L(Y)&&(Y=Y.value),V[D]=Y}),V}function Es(l){let L=new Set;function R(D){L.forEach(ge=>{D.has(ge)||l(ge,null)}),L=D}function V(D,ge){const Y=is(D,ge);if(!Y){R(new Set);return}const pe=new Set(Object.keys(Y));R(pe),Object.entries(Y).forEach(([Le,we])=>{l(Le,we)})}return{apply:V}}function Ys(l){return typeof l=="string"&&(l.startsWith("on:")||l.startsWith("on")&&l.length>2)}const bn=128,Jn=[];function zs(l,L){Jn.push({rod:l,value:String(L!=null?L:"")}),Jn.length>bn&&Jn.splice(0,Jn.length-bn)}function jn(){if(!Jn.length)return null;const l=Jn.slice();return Jn.length=0,{items:l,index:0}}function ls(l,L){if(!L||!l||L.index>=L.items.length)return null;const R=[],V=String(l);let D=0,ge=L.index,Y=!1;for(;ge<L.items.length;){const pe=L.items[ge],Le=pe.value;if(!Le)break;const we=V.indexOf(Le,D);if(we===-1)break;we>D&&R.push(V.slice(D,we)),R.push(pe.rod),D=we+Le.length,ge++,Y=!0}return Y?(D<V.length&&R.push(V.slice(D)),L.index=ge,R):null}function Xs(l){var R;let L="";for(const V of l)typeof V=="string"?L+=V:L+=(R=V==null?void 0:V.value)!=null?R:"";return L}function No(l){if(l.startsWith("on:"))return l.slice(3);const L=l.slice(2);return L?L==="DoubleClick"?"dblclick":L.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 Qs(l,L){const R=rs(l),V=rs(L);return typeof R=="boolean"||typeof V=="boolean"?R===V:!!R&&!!V&&R.capture===V.capture&&R.passive===V.passive&&R.once===V.once}function qn(l,L){return Array.isArray(l)?l.some(R=>qn(R,L)):L(l)?!0:!l||typeof l!="object"||Array.isArray(l)||l.nodeType?!1:Array.isArray(l.handlers)?l.handlers.some(R=>qn(R,L))||L(l.options)||typeof l.options=="function":Array.isArray(l.listeners)?l.listeners.some(R=>qn(R,L))||L(l.options)||typeof l.options=="function":L(l.handler)||L(l.listener)||L(l.fn)||L(l.options)||typeof l.options=="function"}function Yn(l,L,R){var V,D,ge,Y,pe,Le,we;if(l==null||l===!1)return[];if(typeof l=="function")return[{handler:l,options:rs(R!=null?R:!1)}];if(L(l))return Yn(l.value,L,R);if(Array.isArray(l))return l.flatMap(Ce=>Yn(Ce,L,R));if(typeof l=="object"&&!Array.isArray(l)&&!l.nodeType){if(Array.isArray(l.handlers)||Array.isArray(l.listeners)){const Fe=l.handlers||l.listeners||[],Re=(D=(V=l.options)!=null?V:R)!=null?D:!1;return Fe.flatMap(Qe=>Yn(Qe,L,Re))}let Ce=(pe=(Y=(ge=l.handler)!=null?ge:l.listener)!=null?Y:l.fn)!=null?pe:null,Ae=(we=(Le=l.options)!=null?Le:R)!=null?we:!1;return L(Ce)&&(Ce=Ce.value),L(Ae)&&(Ae=Ae.value),typeof Ae=="function"&&(Ae=Ae()),typeof Ce=="function"?[{handler:Ce,options:rs(Ae)}]:[]}return[]}function Ao(l,L){return Yn(l,L)}function Zs(l,L,R,V){const D=No(L);if(!D)return;const ge={listeners:[]},Y=()=>{ge.listeners.forEach(Le=>{l.removeEventListener(D,Le.dispatch,Le.options)}),ge.listeners=[]},pe=Le=>{const we=Ao(Le,V);ge.listeners.length===we.length&&ge.listeners.every((Ae,Fe)=>{const Re=we[Fe];return Ae.handler===Re.handler&&Qs(Ae.options,Re.options)})||(Y(),we.forEach(Ae=>{const Fe={handler:Ae.handler,options:Ae.options,dispatch:null};Fe.dispatch=Re=>{if(typeof Fe.handler=="function"){const Qe=Fe.handler.call(l,Re);return Fe.options&&typeof Fe.options=="object"&&Fe.options.once&&(l.removeEventListener(D,Fe.dispatch,Fe.options),ge.listeners=ge.listeners.filter(pt=>pt!==Fe)),Qe}},l.addEventListener(D,Fe.dispatch,Fe.options),ge.listeners.push(Fe)}))};if(ee._registerCleanup(l,Y),V(R)){const Le=ee.reactive.effect(()=>{pe(R.value)});ee._registerCleanup(l,Le);return}if(qn(R,V)){const Le=ee.reactive.effect(()=>{pe(R)});ee._registerCleanup(l,Le);return}pe(R)}function eo(l,L={}){const{isRod:R=()=>!1,interpolationCursor:V=null}=L;function D(Ce){const Ae=document.createTextNode(""),Fe=ee.rodBind(Ae,Ce);return ee._registerCleanup(Ae,Fe),Ae}function ge(Ce){l.appendChild(D(Ce))}function Y(Ce){const Ae=document.createTextNode("");l.appendChild(Ae);const Fe=ee.reactive.effect(()=>{Ae.textContent=Xs(Ce)});ee._registerCleanup(Ae,Fe)}function pe(Ce){const Ae=[],Fe=Re=>{if(!(Re==null||Re===!1)){if(Array.isArray(Re)){Re.forEach(Fe);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 Fe(Ce),Ae}function Le(Ce){const Ae=document.createComment("dyn");l.appendChild(Ae);let Fe=[];const Re=ee.reactive.effect(()=>{Fe.forEach(it=>{Vt(it),it.parentNode&&it.parentNode.removeChild(it)}),Fe=[];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),Fe=pt});ee._registerCleanup(Ae,()=>{Re(),Fe.forEach(Qe=>Vt(Qe)),Fe=[]})}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,V);Ae?Y(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:Y,appendDynamicChild:Le,appendChildValue:we}}function to(l,L={}){const{el:R,isRod:V=()=>!1,interpolationCursor:D=null,appendChildValue:ge=()=>{},appendRodText:Y=()=>{},appendInterpolatedText:pe=()=>{},appendDynamicChild:Le=()=>{},bindProp:we=()=>{}}=L;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(V(Ce)){Y(Ce);continue}if(Ce.nodeType){R.appendChild(Ce);continue}if(typeof Ce=="object")for(const[Ae,Fe]of Object.entries(Ce)){if(typeof Fe=="string"){const Re=ls(Fe,D);if(Re){we(Ae,()=>Xs(Re));continue}}if(Ae==="class"){we(Ae,Fe);continue}if(Ae==="style"&&typeof Fe=="object"&&Fe!==null&&!V(Fe)){we(Ae,Fe);continue}we(Ae,Fe)}}}const no="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 so(l,...L){const R=Ts.has(l),V=l==="text"&&!R?document.createTextNode(""):R?document.createElementNS(no,l):document.createElement(l),D=We=>!!We&&We.type==="rod",ge=jn(),Y=eo(V,{isRod:D,interpolationCursor:ge}),{appendRodText:pe,appendInterpolatedText:Le,appendDynamicChild:we,appendChildValue:Ce}=Y,Ae=gs(V,{isSVG:R,normalizeClass:Bn,isContentProp:as}),{isBooleanDomProp:Fe,isBindingValueKey:Re,applyBindingValue:Qe,setStyleEntry:pt,setProp:ft,setClassValue:it}=Ae;function Me(We){const nt=ee.reactive.effect(We);return ee._registerCleanup(V,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){Me(()=>{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){Me(()=>{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")};Me(()=>{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]};Me(()=>{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"))})};Me(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){Me(()=>{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(Ys(We)){Zs(V,We,nt,D);return}if(We==="class"){if(ys(nt)){Me(()=>{it(Bn(nt))});return}it(Bn(nt));return}if(We==="style"&&nt&&typeof nt=="object"){const Et=Es(pt);if(os(nt,D)){Me(()=>{Et.apply(nt,D)});return}Et.apply(nt,D);return}if(We==="style"&&(typeof nt=="function"||D(nt))){const Et=Es(pt);Me(()=>{Et.apply(nt,D)});return}if(Re(We)&&typeof nt=="function"){Me(()=>{Qe(We,nt())});return}if(Re(We)&&!D(nt)){Qe(We,nt);return}if(typeof nt=="function"){Me(()=>{ft(We,nt())});return}if(We==="value"&&D(nt)&&(l==="input"||l==="textarea"||l==="select")){if(l==="select"&&V.multiple){xt(V,nt);return}kt(V,nt,l==="select"?"change":"input");return}if(We==="checked"&&D(nt)&&l==="input"){if(String(V.type||"").toLowerCase()==="radio"){Wt(V,nt);return}Lt(V,nt);return}if(We==="files"&&D(nt)&&ut(V)){Ze(V,nt);return}if(We==="selected"&&D(nt)&&l==="option"){_t(V,nt);return}if(as(We)&&D(nt)){Me(()=>{ft(We,nt.value)});return}if(D(nt)){const Et=ee.rodBind(V,nt,{key:We});ee._registerCleanup(V,Et);return}ft(We,nt)}return to(L,{el:V,isRod:D,interpolationCursor:ge,appendChildValue:Ce,appendRodText:pe,appendInterpolatedText:Le,appendDynamicChild:we,bindProp:Jt}),l==="select"&&typeof V._cmsApplySelectedValues=="function"&&V._cmsApplySelectedValues(),V}const Wo={},oo=["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"];oo.forEach(l=>{window._[l]=(...L)=>so(l,...L)}),_.DOM_ELEMENTS=oo,_.fragment=(...l)=>l,_.dynamic=function(l){const L=document.createComment("dyn"),R=document.createDocumentFragment();R.appendChild(L);let V=null;return ee.reactive.effect(()=>{const D=l();if(V&&V.parentNode&&V.parentNode.removeChild(V),V=null,D==null)return;let ge=D;(typeof D=="string"||typeof D=="number")&&(ge=document.createTextNode(String(D)));const Y=L.parentNode;Y&&ge&&ge.nodeType&&(Y.insertBefore(ge,L.nextSibling),V=ge)}),R};function io(){let l=!1;const L=new Set;function R(){var D,ge,Y;l=!1,(D=ee.debug)==null||D.inc("rodFlushes"),(ge=ee.perf)==null||ge.inc("rodFlushes"),(Y=ee.perf)==null||Y.mark("rod:flush");const V=Array.from(L);L.clear();for(const pe of V)try{pe()}catch(Le){console.error("[rod] flush error:",Le)}}return function(D){L.add(D),l||(l=!0,queueMicrotask(R))}}const Uo=io();function lo(l,L,R){if(!l)return;if(l.nodeType===3){l.textContent=R!=null?R:"";return}gs(l,{isSVG:l.namespaceURI===no,normalizeClass:Bn,isContentProp:as}).applyBindingValue(L,R)}function Lo(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,V={key:"auto"}){var Y;if(this._disposed)return()=>{};if(!R)return()=>{};const D={el:R,key:(Y=V==null?void 0:V.key)!=null?Y:"auto"};return this._bindings.some(pe=>pe.el===D.el&&pe.key===D.key)||this._bindings.push(D),lo(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,Uo(()=>{this._pending=!1,this._notifyNow()}))},_notifyNow(){var V,D,ge,Y,pe;if(this._disposed)return;const R=performance.now();(V=ee.perf)==null||V.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)lo(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:((Y=this._actions)==null?void 0:Y.length)||0})}},dispose(){if(!this._disposed){this._disposed=!0;for(const R of this._disposeHooks)try{R()}catch(V){console.error("[rod] dispose hook error:",V)}this._bindings.length=0,this._actions.length=0,this._disposeHooks.length=0}}}}function cs(l,L="value"){var Y;let R=l[L],V=null,D=null,ge=null;return(Y=ee==null?void 0:ee.reactive)!=null&&Y.signal&&([V,D,ge]=ee.reactive.signal(R),ge&&typeof l.onDispose=="function"&&l.onDispose(ge)),Object.defineProperty(l,L,{get(){return V?V():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(L,R="value"){const V=Lo(L);return cs(V,R),ee.rod._all=ee.rod._all||new Set,ee.rod._all.add(V),typeof V.onDispose=="function"&&V.onDispose(()=>ee.rod._all.delete(V)),V},ee.rodBind=function(l,L,R={key:"auto"}){var V,D,ge;if((V=ee.debug)==null||V.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(!L||L.type!=="rod")throw new Error("JSswift.rodBind: react must be a rod object");return L._bind(l,R)},ee.rodFromSignal=function(l,L){const R=_.rod(l());let V=!1;const D=ee.reactive.effect(()=>{const Y=R.value,pe=ee.reactive.untracked(()=>l());if(!V&&pe!==Y){V=!0;try{L(Y)}finally{V=!1}}}),ge=ee.reactive.effect(()=>{const Y=l();if(ee.reactive.untracked(()=>R.value)!==Y){V=!0;try{R._setSilent(Y)}finally{V=!1}}});return typeof R.onDispose=="function"&&(R.onDispose(D),R.onDispose(ge)),R};function In(l){if(!l||!l.tagName)return null;const L=l.tagName.toLowerCase();if(L==="input"){const R=(l.type||"text").toLowerCase();return R==="checkbox"?"checkbox":R==="radio"?"radio":R==="number"?"number":"text"}return L==="select"?l.multiple?"select-multiple":"select":null}ee.rodModel=function(l,L,R={}){var Ce,Ae,Fe;if(!L||L.type!=="rod")throw new Error("[JSswift.rodModel] rodObj deve essere un rod");const V=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),Y=(Fe=R.format)!=null?Fe:(Re=>Re);let pe=!1;const Le=[],we=Re=>{for(const Qe of V){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:""}}};L.action(Re=>{if(!pe){pe=!0;try{we(Y(Re))}finally{pe=!1}}}),we(Y(L.value));for(const Re of V){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{L.value!==ft&&(L.value=ft)}finally{pe=!1}};Re.addEventListener(D,pt),Le.push(()=>Re.removeEventListener(D,pt))}return typeof L.onDispose=="function"&&L.onDispose(()=>Le.forEach(Re=>Re())),()=>Le.forEach(Re=>Re())},ee.signalModel=function(l,L,R,V={}){const D=ee.rodFromSignal(L,R);return ee.rodModel(l,D,V)};function Vt(l){if(!l)return;const L=ee._cleanupRegistry.get(l);if(L){for(const R of L)try{R()}catch(V){console.error("[cleanup] error:",V)}ee._cleanupRegistry.delete(l)}if(l.childNodes&&l.childNodes.length)for(const R of l.childNodes)Vt(R)}function Io(l){const L=R=>typeof R=="string"?ee.dom.q(R):R;return Array.isArray(l)?l.map(L).filter(Boolean):[L(l)].filter(Boolean)}function bs(l){const L=[],R=[],V=D=>{if(D!=null){if(typeof D=="function"){V(D());return}if(D&&typeof D=="object"&&"node"in D){typeof D.dispose=="function"&&R.push(D.dispose),V(D.node);return}if(Array.isArray(D)){for(const ge of D)V(ge);return}if(typeof D=="string"||typeof D=="number"){L.push(document.createTextNode(String(D)));return}if(D.nodeType){L.push(D);return}console.warn("[JSswift.mount] contenuto non supportato:",D)}};return V(l),{nodes:L,disposers:R}}function Xn(l=[],L="[JSswift.mount] dispose error:"){let R=!1;return()=>{if(!R){R=!0;for(const V of l)try{V()}catch(D){console.error(L,D)}}}}function ws(l=[],L=null){return Xn([...L?[L]:[],...l],"[component] dispose error:")}ee.mount=function(l,L,R={}){var Le;const V=Io(l),D=(Le=R.clear)!=null?Le:!0,ge=V.length>1;if(V.length===0)return console.warn("[JSswift.mount] nessun target valido:",l),()=>{};const Y=[];for(const we of V){if(D)for(;we.firstChild;)Vt(we.firstChild),we.removeChild(we.firstChild);const{nodes:Ce,disposers:Ae}=bs(L);let Fe=Ce;ge&&typeof L!="function"&&(Fe=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 Fe)we.appendChild(Qe);Y.push({root:we,nodes:Fe,dispose:Re});for(const Qe of Fe)!Qe||!Qe.nodeType||ee._registerCleanup(Qe,Re)}return()=>{var we;for(const Ce of Y){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 V=[],ge=l(R,{onDispose(Y){typeof Y=="function"&&V.push(Y)}});return ge&&typeof ge=="object"&&"node"in ge?{node:ge.node,dispose:ws(V,typeof ge.dispose=="function"?ge.dispose:null)}:{node:ge,dispose:ws(V)}}},ee.enableAutoCleanup=function(){if(ee._autoCleanupEnabled)return;ee._autoCleanupEnabled=!0;const l=new MutationObserver(L=>{for(const R of L)for(const V of R.removedNodes)Vt(V)});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 L(){return!!ee.config.debug}function R(...Le){L()&&console.log("[JSswift]",...Le)}function V(...Le){L()&&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 Y(){return{...l}}function pe(){for(const Le of Object.keys(l))l[Le]=0}return{enabled:L,log:R,warn:V,error:D,inc:ge,stats:Y,reset:pe}})(),ee.perf=(()=>{let l=!1;const L={effectsRun:0,effectsSlow:0,rodNotifies:0,rodFlushes:0,domWrites:0,httpRequests:0},R=[],V=[],D={timelineMax:200,slowEffectMs:8};function ge(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function Y(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&&(L[je]=(L[je]||0)+ct)}function Le(je,ct){l&&(V.push({t:Date.now(),ms:je,meta:ct}),V.length>100&&V.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"),Y("effect:slow",Wt,ct||je.name||null)):Y("effect",Wt,ct||je.name||null)}})})}function Ae(){we&&(ee.reactive.effect=we,we=null)}function Fe(je=!0){return l=!!je,l?Ce():Ae(),l}function Re(){for(const je of Object.keys(L))L[je]=0;R.length=0,V.length=0}function Qe(){return{enabled:l,...L,slowEffectMs:D.slowEffectMs,timelineSize:R.length}}function pt(){return R.slice()}function ft(je=D.slowEffectMs){return V.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;Y("time:"+je,kt,je)}}function Me(je,ct){Y(je,0,ct)}function ze(je,ct,ut){Y(je,ct,ut)}return{enable:Fe,reset:Re,stats:Qe,timeline:pt,slowEffects:ft,time:it,mark:Me,tick:ze,inc:pe,cfg:D}})(),ee.rod=ee.rod||{},ee.rod.inspect=function(l,L="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():[],V={label:L,value:l.value,bindingsCount:R.length,bindings:R.map(D=>{var ge,Y,pe,Le,we,Ce,Ae;return{key:D.key,el:((ge=D.el)==null?void 0:ge.nodeType)===3?"#text":(Y=D.el)==null?void 0:Y.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] ${L}`),console.log(V),console.groupEnd()):console.log(V),V},ee.rod.inspectAll=function(){const l=ee.rod._all?Array.from(ee.rod._all):[];return l.forEach((L,R)=>ee.rod.inspect(L,`rod#${R+1}`)),l.length},ee._storeShared=(()=>{function l(ge){return`${ge.storage}::${ge.prefix}`}function L(ge,Y){function pe(Ae={}){var Re,Qe;const Fe={storage:(Re=Ae.storage)!=null?Re:ge.storage,prefix:(Qe=Ae.prefix)!=null?Qe:ge.prefix};return Y.set(l(Fe),Fe),Fe}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,Fe=null){return(Fe||pe()).prefix+Ae}function Ce(Ae,Fe=null){const Re=Fe||pe();return`${l(Re)}::${Ae}`}return{getScope:pe,getStorage:Le,fullKey:we,channelKey:Ce}}function R(ge){try{return JSON.parse(ge)}catch(Y){return}}function V(ge){try{return JSON.stringify(ge)}catch(Y){return}}function D(ge,...Y){const pe=`${ge.storage}::${ge.prefix}::`;for(const Le of Y)for(const we of Array.from(Le.keys()))we.startsWith(pe)&&Le.delete(we)}return{createScopeTools:L,safeParse:R,safeStringify:V,clearScopedMapEntries:D}})(),ee.store=(()=>{const l={prefix:"JSswift:",storage:"local",syncTabs:!0,writeDelay:0},L=new Map,R=new Map,V=new Map,D=new Map;let ge=!1;const{createScopeTools:Y,safeParse:pe,safeStringify:Le,clearScopedMapEntries:we}=ee._storeShared,{getScope:Ce,getStorage:Ae,fullKey:Fe,channelKey:Re}=Y(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(V.entries())){V.delete(Ze);const _t=L.get(Ze),Jt=Le(_t);if(Jt===void 0)continue;const We=Ae(xt.scope);try{We.setItem(Fe(xt.key,xt.scope),Jt)}catch(nt){console.error("[store] write error:",nt)}}}function ft(Ze,xt=null){const _t=xt||Ce();V.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(Fe(Ze,_t));if(We!=null)return pe(We)}function Me(Ze,xt,_t=null){const Jt=_t||Ce(),We=Re(Ze,Jt);if(L.has(We))return L.get(We);const nt=it(Ze,Jt);return nt!==void 0?(L.set(We,nt),nt):xt}function ze(Ze,xt,_t=null){const Jt=_t||Ce();return L.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);L.delete(Jt),V.delete(Jt);try{Ae(_t).removeItem(Fe(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,L,V,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=Me(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?L.delete(We):L.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:L.size,scopeCount:D.size}}return{configure:Lt,stats:Wt,get:Me,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,L,R={}){var pe,Le;const V=(pe=R.versionKey)!=null?pe:"__version",D=Number((Le=ee.store.get(V,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 Y=0;for(let we=D;we<ge;we++){const Ce=L==null?void 0:L[we];if(typeof Ce=="function")try{Ce(ee.store)}catch(Ae){console.error("[store.migrate] step error at version",we,Ae)}Y++,ee.store.set(V,we+1)}return{from:D,to:ge,applied:Y}},ee.store.model=function(l,L,R,V={}){if(typeof L!="string"||!L)throw new Error("store.model: key deve essere una stringa non vuota");const[D,ge,Y]=ee.store.signal(L,R,{storage:V.storage,prefix:V.prefix}),pe=ee.rodFromSignal(D,ge),Le=ee.rodModel(l,pe,{event:V.event,parse:V.parse,format:V.format});return()=>{var we;try{Le==null||Le()}catch(Ce){}try{Y==null||Y()}catch(Ce){}try{(we=pe.dispose)==null||we.call(pe)}catch(Ce){}}},ee.store.bind=function(l,L,R,V={}){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,L,R,V):((ge=ee.config)!=null&&ge.debug&&console.warn("[store.bind] target non trovato:",l),()=>{})},ee.store.bindAll=function(l,L={},R={}){if(typeof l=="string"&&(l=ee.dom.q(l)),!l||!l.querySelectorAll)return console.warn("[store.bindAll] form non valido:",l),()=>{};const V=[];for(const[D,ge]of Object.entries(L)){const Y=l.querySelectorAll(`[name="${D}"]`);if(!Y.length)continue;const pe=ee.store.model(Y.length===1?Y[0]:Y,D,ge,R);V.push(pe)}return()=>V.forEach(D=>D())},ee.store.inspect=function(){const l={...ee.store.stats(),keys:Array.from((function(){const L=ee.store.stats().storage==="session"?sessionStorage:localStorage,R=[];for(let V=0;V<L.length;V++){const D=L.key(V);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,L={},R={}){var D;const V=ee.store.bindAll(l,L,R);return(D=ee.config)!=null&&D.debug&&console.log("[store.autoForm] autosave attivo:",L),V},ee.useStore=function(l,L,R,V={}){const[D,ge,Y]=ee.store.signal(l,L,V);return R&&typeof R.onDispose=="function"&&typeof Y=="function"&&R.onDispose(Y),[D,ge]},ee._plugins=new Set,ee.usePlugin=function(l,L){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,L),ee._plugins.add(l);return}if(l&&typeof l.install=="function"){l.install(ee,L),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 L={};l.forms={validate(R,V={},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"},Y={};for(const[Fe,Re]of Object.entries(V)){const Qe=R.querySelectorAll(`[name="${Fe}"]`);if(!Qe.length)continue;const[pt,ft]=l.reactive.signal(null);Y[Fe]={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 Me=()=>{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,Me);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")}),Me()}const pe=l.store.computed(()=>Object.values(Y).every(Fe=>!Fe.getErr())),Le=Fe=>{let Re=!0;for(const Qe of Object.values(Y)){const pt=Qe.els[0];pt&&pt.dispatchEvent(new Event(ge.mode,{bubbles:!0})),Qe.getErr()&&(Re=!1)}!Re&&ge.submitGuard&&(Fe.preventDefault(),Fe.stopPropagation())};ge.submitGuard&&R.addEventListener("submit",Le);const we=()=>{ge.submitGuard&&R.removeEventListener("submit",Le)};return L[R]={isValid:pe,dispose:we},{isValid:pe,dispose:we}}}}},ee._authShared=(()=>{function l(V){const D=()=>{var Y;return((Y=V())==null?void 0:Y.roles)||[]},ge=()=>{var Y;return((Y=V())==null?void 0:Y.permissions)||[]};return{roles:D,perms:ge,hasRole:Y=>D().includes(Y),can:Y=>ge().includes(Y),canAny:Y=>Y.some(pe=>D().includes(pe)||ge().includes(pe)),canAll:Y=>Y.every(pe=>D().includes(pe)||ge().includes(pe))}}function L(V,D){return D.some(ge=>typeof ge=="string"?V.startsWith(ge):ge instanceof RegExp?ge.test(V):!1)}function R(V,D){if(!V||!D)return;let ge=!1;function Y(){return Date.now()}function pe(Fe){if(!Fe||typeof Fe!="string")return null;const Re=Fe.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 Fe,Re,Qe,pt;if(typeof D._getState=="function"){const ft=D._getState();return ft&&typeof ft=="object"?ft:{user:(Re=(Fe=D.user)==null?void 0:Fe.call(D))!=null?Re:null}}return{user:(pt=(Qe=D.user)==null?void 0:Qe.call(D))!=null?pt:null}}function we(){var Me,ze,je;const Fe=Le()||{},Re=(ze=Fe.user)!=null?ze:(Me=D.user)==null?void 0:Me.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=Fe.expiresAt||null,it=ft?ft-Y():null;return pt?`AUTH \u2705 user=${Qe}${ft?` expiresIn=${Math.round(it/1e3)}s`:""}`:`AUTH \u274C user=${Qe}`}function Ce(Fe="auth"){var Lt,Wt,Ze;const Re=Le()||{},Qe=(Wt=Re.user)!=null?Wt:(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,Me=Re.refreshToken||null,ze=it?pe(it):null,je=Re.expiresAt||(ze!=null&&ze.exp?ze.exp*1e3:null),ct=Y(),ut=je?je-ct:null,kt={label:Fe,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:!!Me,expiresAt:je,expiresInSec:ut==null?null:Math.round(ut/1e3),decodedJWT:ze}};return console.groupCollapsed(`[JSswift.auth.inspect] ${Fe}`),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(Fe=!0){ge=!!Fe,console.log("[JSswift.auth.trace]",ge?"ON":"OFF")}if(typeof D.fetch=="function"&&!D._fetchWrapped){const Fe=D.fetch.bind(D);D.fetch=async(...Re)=>{const Qe=await Fe(...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:L,attachDevTools:R}})(),ee.plugins.auth={install(l,L={}){var ct;const{createPermissionApi:R,matchesProtectedPath:V,attachDevTools:D}=ee._authShared,ge={key:L.key||"auth",loginRoute:L.loginRoute||"/login",protected:L.protected||[],autoRedirect:(ct=L.autoRedirect)!=null?ct:!0,endpoints:L.endpoints||{login:"/api/login",refresh:"/api/refresh",logout:"/api/logout"},fetchOptions:L.fetchOptions||{},tokenHeader:L.tokenHeader||"Authorization",tokenPrefix:L.tokenPrefix||"Bearer ",refreshMargin:L.refreshMargin||3e4},[Y,pe]=l.store.signal(ge.key,null),Le=()=>{var ut;return((ut=Y())==null?void 0:ut.user)||null},we=()=>{var ut;return!!((ut=Y())!=null&&ut.accessToken)},{hasRole:Ce,can:Ae,canAny:Fe,canAll:Re}=R(Le);let Qe=!1,pt=[];function ft(){const ut=Y();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=Y())==null?void 0:ut.refreshToken})});if(!kt.ok)throw new Error("Refresh failed");const Lt=await kt.json();return pe({...Y(),...Lt}),pt.forEach(Wt=>Wt.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 Me(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=Y(),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=Y())!=null&&xt.refreshToken)&&!kt._authRetried?(await it(),je(ut,{...kt,_authRetried:!0})):Ze}l.router.beforeEach(ut=>{const kt=ut.path;return V(kt,ge.protected)&&!we()?ge.loginRoute:!0}),l.auth={user:Le,isAuth:we,hasRole:Ce,can:Ae,canAny:Fe,canAll:Re,loginAsync:Me,logoutAsync:ze,fetch:je,_getState:Y},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,Fe]=Ce.signal(0),[Re,Qe]=Ce.signal("idle"),[pt,ft]=Ce.signal(null),[it,Me]=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 Fe(Ae()+1),Qe("pending"),je(null),Me(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();Fe(Math.max(0,Ae()-1)),We===Wt&&(Et?(Qe("error"),je(Et),Me(null)):nt?(Qe("success"),je(null),Me({id:We,status:nt.status,ok:nt.ok,headers:nt.headers,url:nt.url,receivedAt:vt,raw:nt})):(Qe("idle"),je(null),Me(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(){Fe(0),Qe("idle"),ft(null),Me(null),je(null),ut(0),Lt(Date.now())}},markStart:Ze,markEnd:xt}}function L(we,Ce){if(!we||/^https?:\/\//i.test(Ce))return Ce;const Ae=we.endsWith("/")?we.slice(0,-1):we,Fe=Ce.startsWith("/")?Ce:"/"+Ce;return Ae+Fe}function R(we){return new Promise(Ce=>setTimeout(Ce,we))}function V(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,Fe=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:Fe,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 Fe=typeof Ce=="string"?L(we.baseURL,Ce):Ce,Re=(Ae.method||"GET").toUpperCase(),Qe=new Headers(we.headers);return Ae.headers&&new Headers(Ae.headers).forEach((Me,ze)=>Qe.set(ze,Me)),{url:Fe,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 Y(we,...Ce){var Fe;let Ae=Ce[0];for(const Re of we)Ae=(Fe=await Re(Ae,...Ce.slice(1)))!=null?Fe: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,Fe=null;try{Ae=await we.json()}catch(Re){Ae=null}return we.ok||(Fe=Ae!=null?Ae:{status:we.status}),{data:Ae,error:Fe,ok:we.ok,status:we.status}},async jsonStrict(){const{data:Ae,error:Fe}=await this.json();if(Fe){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(Fe){}return{text:Ae,ok:we.ok,status:we.status}},async textStrict(){const Ae=await this.text();if(!Ae.ok){const Fe=new Error("HTTP error "+we.status);throw Fe.status=we.status,Fe.text=Ae.text,Fe}return Ae}}}function Le(we,Ce,Ae,Fe,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:Fe==null?void 0:JSON.stringify(Fe)})}return{createReactiveState:l,joinURL:L,sleep:R,isRetryable:V,makeAbort:D,normalizeRequest:ge,runHooks:Y,wrapResponse:pe,withJSON:Le}})();const{createReactiveState:Rn,sleep:Hn,isRetryable:vs,makeAbort:Ss,normalizeRequest:us,runHooks:Ps,wrapResponse:ro,withJSON:Qn}=ee._httpShared,Wn=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{},ao={baseURL:((Ds=Wn.http)==null?void 0:Ds.baseURL)||"",timeout:(fo=(uo=Wn.http)==null?void 0:uo.timeout)!=null?fo: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=Rn(ee),Cs=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now(),En={beforeRequest:new Set,afterResponse:new Set,onError:new Set};async function co(l){const L=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 L(l.url,R)}async function pn(l,L={}){var Re,Qe,pt;let R=us(ao,l,L);R=await Ps(En.beforeRequest,R);const V=Js.markStart(R),D=Cs(),ge=R.retry||{attempts:0,delay:250,factor:2},Y=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,Fe=null;try{for(let ft=0;ft<=Y;ft++){we=null,Ce=null;const{signal:it,cancel:Me}=Ss(R.timeout,L.signal),ze={...R,signal:it},je=Cs();try{ao.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 co(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<Y&&vs(null,ut)){Me(),await Hn(pe),pe=Math.round(pe*Le);continue}return Me(),Ae=ut,ro(ut,ze)}catch(ct){we=ct,Me();for(const ut of En.onError)try{ut(ct,ze)}catch(kt){}if(ft<Y&&vs(ct,null)){await Hn(pe),pe=Math.round(pe*Le);continue}throw Fe=ct,ct}}}finally{const ft=Cs()-D;Js.markEnd(V,Ae,Fe,ft)}if(we)throw we;return ro(Ce,R)}ee.http={},ee.http.request=pn,ee.http.state=()=>Js.state,ee.http.get=(l,L)=>pn(l,{...L,method:"GET"}),ee.http.del=(l,L)=>pn(l,{...L,method:"DELETE"}),ee.http.post=(l,L,R)=>Qn(pn,"POST",l,L,R),ee.http.put=(l,L,R)=>Qn(pn,"PUT",l,L,R),ee.http.patch=(l,L,R)=>Qn(pn,"PATCH",l,L,R),ee.http.getJSON=async(l,L)=>(await pn(l,{...L,method:"GET"})).jsonStrict(),ee.http.delJSON=async(l,L)=>(await pn(l,{...L,method:"DELETE"})).jsonStrict(),ee.http.postJSON=async(l,L,R)=>(await Qn(pn,"POST",l,L,R)).jsonStrict(),ee.http.putJSON=async(l,L,R)=>(await Qn(pn,"PUT",l,L,R)).jsonStrict(),ee.http.patchJSON=async(l,L,R)=>(await Qn(pn,"PATCH",l,L,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 L=ee.router;return l&&l.onDispose,{navigate:L.navigate,back:()=>history.back(),forward:()=>history.forward(),get current(){return L}}},ee.useRoute=function(l){const[L,R]=ee.reactive.signal(""),[V,D]=ee.reactive.signal({}),[ge,Y]=ee.reactive.signal({}),[pe,Le]=ee.reactive.signal(""),we=Ae=>{R(Ae.path||""),D(Ae.params||{}),Y(Ae.query||{}),Le(Ae.hash||"")},Ce=ee.router.subscribe(we);return l&&typeof l.onDispose=="function"&&l.onDispose(Ce),{path:L,params:V,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 L(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 V(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 Fe=Ae._compiled.regex.exec(we);if(!Fe)continue;const Re={};return Ae._compiled.keys.forEach((Qe,pt)=>{Re[Qe]=decodeURIComponent(Fe[pt+1])}),{route:Ae,params:Re,parent:Ae._parent||null}}return null}function Y(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:L,compilePattern:R,parseQuery:V,flattenRoutes:D,matchRoute:ge,pushHistoryEntry:Y}})(),ee._uiMetaShared=(()=>{function l(Y){return{hasTabPanel:typeof Y.TabPanel=="function",Card:typeof Y.Card=="function"?Y.Card:(...pe)=>Y.div({class:"cms-doc-card"},...pe),Chip:typeof Y.Chip=="function"?Y.Chip:(pe,Le)=>Y.span({class:"cms-chip cms-chip-fallback"},Le)}}function L(Y){return Y?Array.isArray(Y)?Y.join(" | "):String(Y):"\u2014"}function R(Y,pe,Le){return Y.div({class:"cms-doc-meta"},Y.div({class:"cms-doc-meta-head"},Y.div({class:"cms-doc-meta-name"},pe.name),Y.div({class:"cms-doc-meta-types"},...pe.type?String(pe.type).split("|").map(we=>Le({color:"secondary",dense:!0,outline:!0},we)):[Y.span("\u2014")])),Y.div({class:"cms-doc-meta-grid"},Y.div({class:"cms-doc-meta-block"},Y.div({class:"cms-doc-meta-label"},"Default"),Y.div({class:"cms-doc-meta-value"},pe.default==null?"\u2014":String(pe.default))),Y.div({class:"cms-doc-meta-block"},Y.div({class:"cms-doc-meta-label"},"Values"),Y.div({class:"cms-doc-meta-value"},L(pe.values)))),Y.div({class:"cms-doc-meta-block"},Y.div({class:"cms-doc-meta-label"},"Description"),Y.div({class:"cms-doc-meta-value"},pe.description||"\u2014")))}function V(Y,pe){return Y.div({class:"cms-doc-fallback"},pe.map(Le=>Y.div({class:"cms-doc-fallback-item"},Y.h4({class:"cms-doc-fallback-title"},Le.label||Le.name),Le.content)))}function D(Y,pe){return pe?Array.isArray(pe)?pe.map(Le=>({name:Le.name,wrap:!0,label:Le.name,content:Y.div({class:"cms-p-md"},Le.description)})):Object.entries(pe).map(([Le,we])=>({name:Le,wrap:!0,label:Le,content:Y.div({class:"cms-p-md"},we)})):[]}function ge(Y,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:Y.div({class:"cms-doc-meta"},Y.div({class:"cms-doc-meta-head"},Y.div({class:"cms-doc-meta-name"},Le)),Y.div({class:"cms-doc-meta-grid"},Y.div({class:"cms-doc-meta-block"},Y.div({class:"cms-doc-meta-label"},"Type"),Y.div({class:"cms-doc-meta-value"},we.type||"\u2014"))),Y.div({class:"cms-doc-meta-block"},Y.div({class:"cms-doc-meta-label"},"Description"),Y.div({class:"cms-doc-meta-value"},we.description||"\u2014")))})):[]}return{resolveDocComponents:l,renderMetaItem:R,renderTabGroupFallback:V,normalizeEventRows:D,normalizeSlotRows:ge}})(),ee.ui=ee.ui||{},ee.ui.meta=ee.ui.meta||{},ee.ui.slot=function(L,R={}){const V=ee.ui,{as:D="node",wrap:ge="span",iconProps:Y=null,filter:pe=!0}=R,Le=Fe=>document.createTextNode(String(Fe)),we=Fe=>_.span(String(Fe)),Ce=Fe=>{if(Fe==null||Fe===!1)return null;if(typeof Fe=="function")return Fe;if(Array.isArray(Fe))return Fe.flatMap(Ce).filter(Boolean);if(Fe&&typeof Fe=="object"&&Fe.nodeType)return Fe;if(typeof Fe=="string"||typeof Fe=="number"||typeof Fe=="boolean"){const Re=String(Fe);return D==="icon"&&V.Icon?V.Icon(Re,{class:"cms-slot-icon",...Y||{}}):ge==="text"?Le(Re):ge==="span"?we(Re):Re}return ge==="text"?Le(Fe):ge==="span"?we(Fe):String(Fe)},Ae=Ce(L);return pe&&Array.isArray(Ae)?Ae.filter(Boolean):Ae},ee.ui.slots=function(...L){const R=[];for(const V of L){const D=ee.ui.slot(V);D&&(Array.isArray(D)?R.push(...D):R.push(D))}return R},ee.docTable=l=>{var it;if(!ee.isDev())return _.div();const{resolveDocComponents:L,renderMetaItem:R,renderTabGroupFallback:V,normalizeEventRows:D,normalizeSlotRows:ge}=ee._uiMetaShared,Y=(it=ee.ui.meta)==null?void 0:it[l];if(!Y)return _.div({class:"cms-muted"},`Meta non trovata: ${l}`);const{hasTabPanel:pe,Card:Le,Chip:we}=L(_),Ce={};Object.entries(Y.props||{}).forEach(([Me,ze])=>{const je=ze.category||"general";Ce[je]||(Ce[je]=[]),Ce[je].push({name:Me,...ze})});const Ae=Object.keys(Ce).map(Me=>{const ze=Ce[Me].map(je=>({name:je.name,wrap:!0,label:je.name,content:R(_,je,we)}));return{name:Me,wrap:!0,label:Me,content:pe?_.TabPanel({orientation:"vertical",animated:!0,radius:"0 0 0 var(--cms-r-default)",tabs:ze}):V(_,ze)}}),Fe=D(_,Y.events),Re=ge(_,Y.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}):V(_,Re)}),Ae.length&&pt.push(...Ae),Fe.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:Fe}):V(_,Fe)});const ft="general";return pt.sort((Me,ze)=>Me.name===ft?-1:ze.name===ft?1:Me.name.localeCompare(ze.name)),Le({class:"cms-doc-table"},_.div({class:"cms-doc-table-header"},_.div({class:"cms-doc-table-title"},`_.${l}`),Y.signature?_.div({class:"cms-doc-table-signature"},String(Y.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}):V(_,pt):null,Y.returns?_.p({class:"cms-muted",style:{marginTop:"14px"}},`Returns: ${Y.returns}`):null)},ee.ui.inspect=l=>{var L;return console.log(((L=ee.ui.meta)==null?void 0:L[l])||"meta not found")},ee.ui.can=function(l,L,R,V=null){var Y,pe;const D=ee.useAuth?ee.useAuth(l):ee.auth;return D?(typeof L=="function"?!!L(D):((Y=D.can)==null?void 0:Y.call(D,L))||((pe=D.hasRole)==null?void 0:pe.call(D,L)))?typeof R=="function"?R():R:typeof V=="function"?V():V:typeof V=="function"?V():null},ee.ui.canAny=function(l,L,R,V=null){var Y;const D=ee.useAuth?ee.useAuth(l):ee.auth;return!!((Y=D==null?void 0:D.canAny)!=null&&Y.call(D,L))?typeof R=="function"?R():R:typeof V=="function"?V():V},ee.ui.canAll=function(l,L,R,V=null){var Y;const D=ee.useAuth?ee.useAuth(l):ee.auth;return!!((Y=D==null?void 0:D.canAll)!=null&&Y.call(D,L))?typeof R=="function"?R():R:typeof V=="function"?V():V},ee.Can=function(L,R){var ge,Y;const V=ee.useAuth?ee.useAuth(R):ee.auth;return(()=>{var pe,Le,we,Ce;return V?L.when&&typeof L.when=="function"?!!L.when(V):L.perm?!!((pe=V.can)!=null&&pe.call(V,L.perm)):L.role?!!((Le=V.hasRole)!=null&&Le.call(V,L.role)):L.any?!!((we=V.canAny)!=null&&we.call(V,L.any)):L.all?!!((Ce=V.canAll)!=null&&Ce.call(V,L.all)):!1:!1})()?typeof L.then=="function"?L.then():(ge=L.then)!=null?ge:null:typeof L.else=="function"?L.else():(Y=L.else)!=null?Y:null},ee.router=(()=>{let l="history",L=[],R=null,V=null,D="",ge=null,Y=null,pe=[],Le=!1;const{normalizePath:we,stripBase:Ce,compilePattern:Ae,parseQuery:Fe,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 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 Me(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=Y?Y.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;Me(zt,o);const qt=je(zt.pathname),ye=Re(qt,L),Bt={path:qt,fullPath:te,params:ye?ye.params:{},query:Fe(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 V=="function"){try{V()}catch(nn){console.error("[router] unmount error:",nn)}V=null}if(!ye){const nn=L._notFound;nn?V=ee.mount(R,()=>nn(Bt),{clear:!0}):V=ee.mount(R,_.div("404"),{clear:!0}),nt(Bt),Y=Bt,Qe(pe,Bt);return}const Ct=ye.route.view,Ke=ye.parent;let Mn=null;if(Bt.renderChild=nn=>{if(!Bt._child)return null;const en=typeof nn=="string"?Bt.outlet.querySelector(nn):nn;return en?(Mn=ee.mount(en,()=>Bt._child.view(Bt._child.ctx),{clear:!0}),Mn):(console.warn("[router] child outlet non trovato:",nn),null)},Ke){const nn=ye.route,en={...Bt,params:{...Bt.params}};Bt._child={view:nn.view,ctx:en},V=ee.mount(R,()=>Ke.view(Bt),{clear:!0})}else Bt._child=null,V=ee.mount(R,()=>Ct(Bt),{clear:!0});nt(Bt),Y=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,Mn=we(te.pattern+"/"+(Bt||"").replace(/^\//,""));qt.children.push({path:Mn,view:Ct,_compiled:Ae(Mn),children:Array.isArray(Ke)?Ke:[]})}L.push(qt)}function _t(Ye){L._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(!Y)return"ROUTER \u23F3 not ready";const Ye=Object.keys(Y.query||{}).length?"?":"";return`ROUTER ${Y.path}${Ye} ${Y.hash||""}`}function Ot(Ye="router"){if(!Y)return console.warn("[router.inspect] nessuna route attiva"),null;const o={label:Ye,mode:typeof l!="undefined"?l:"unknown",base:D,path:Y.path,params:Y.params,query:Y.query,hash:Y.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: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: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 wn(l){const L=Array.isArray(l)?l:typeof l=="string"?l.split(","):[],R=[],V=new Set;for(const D of L){const ge=Zn(D);!ge||V.has(ge)||(V.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(L){return null}}function Eo(l){const L=Ne();if(L)try{l==null?L.removeItem(xn()):L.setItem(xn(),l)}catch(R){}}function Os(l){var V,D,ge,Y,pe;const L=Rs(),R=[l,(V=ee.theme)==null?void 0:V.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"?(Y=globalThis.JSswift_setting)==null?void 0:Y.themeList:null,(pe=L==null?void 0:L.getAttribute)==null?void 0:pe.call(L,"data-themes")];for(const Le of R){const we=wn(Le);if(we.length)return we}return[]}ee.theme=ee.theme||{},ee.theme.storageKey=xn(),wn(ee.theme.themes).length||(ee.theme.themes=Os()),ee.setTheme=function(l,L={}){const R=Zn(l),V=Rs();return V&&(R==null?V.removeAttribute("data-theme"):V.setAttribute("data-theme",R)),L.persist!==!1&&Eo(R),V},ee.getTheme=function(l={}){var D;const L=Rs(),R=Zn((D=L==null?void 0:L.getAttribute)==null?void 0:D.call(L,"data-theme"));if(R)return R;if(l.storage===!1)return null;const V=Ms();return V&&L&&l.sync!==!1&&L.setAttribute("data-theme",V),V},ee.toggleTheme=function(l,L={}){const R=Os(l),V=R.length?R:wn([ee.getTheme({sync:!1}),"light","dark"]),D=ee.getTheme({sync:!1}),ge=Zn(L.fallback)||V[0]||"light",Y=D?V.indexOf(D):-1,pe=Y>=0?V[(Y+1)%V.length]:ge;return ee.theme.themes=V.slice(),ee.setTheme(pe,L),pe};const zo=Ms();zo&&ee.setTheme(zo,{persist:!1})})(),(function(bt){var di;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,Ys=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},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 Xs=()=>{ls||(ls=!0,queueMicrotask(()=>{ls=!1,bn.length=0}))},No=t=>{bn.push(t),bn.length>128&&bn.splice(0,bn.length-128),Xs()},rs=()=>{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)},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},Ao=(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=Jn(e[0])?[]:{});let w=c;for(let d=0;d<e.length-1;d++){const r=e[d];let b=w[r];if(!b||typeof b!="object"){const O=e[d+1];b=Jn(O)?[]:{},w[r]=b}w=b}Object.is(w[e[e.length-1]],i)||(w[e[e.length-1]]=i,s.rawSet(c))},Zs=(t,e)=>[()=>Yn(t,e),n=>Ao(t,e,n)],eo=(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(w,d,r){if(d===gs)return w;const b=Reflect.get(w,d,r);if(typeof d=="symbol")return b;const O=n.concat(d);return b&&typeof b=="object"?eo(t,b,O):typeof b=="function"?b.bind(r):(zs(b)&&No({rod:t,path:O,value:b}),b)},set(w,d,r,b){const O=qn(r),C=Reflect.get(w,d,b);if(Object.is(C,O))return!0;const v=Reflect.set(w,d,O,b);if(v){const T=is.get(t);T==null||T.rawSet(T.rawGet())}return v},deleteProperty(w,d){const r=Reflect.has(w,d),b=Reflect.deleteProperty(w,d);if(b&&r){const O=is.get(t);O==null||O.rawSet(O.rawGet())}return b}});return s.set(e,c),c},to=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:eo(t,i,[])},set(i){s(i)},configurable:!0}),Object.defineProperty(t,Bn,{value:!0,configurable:!1}),t},no=()=>{if(typeof window._.rod!="function"||window._.rod[Bn])return;const t=window._.rod,e=function(...s){return to(t(...s))};Object.defineProperty(e,Bn,{value:!0,configurable:!1}),window._.rod=e};bt.ui.withoutRodPathCapture=t=>{const e=bn.length;try{return t()}finally{bn.length=e}};const Ts=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const w=t.map(d=>{const r=Ts(d,e,"");return r!==d&&(c=!0),r});return c?w:t}if(zs(t)){const c=Qs(e,t);return c?n==="model"?Zs(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 w=Ts(t[c],e,c);i[c]=w,w!==t[c]&&(s=!0)}return s?i:t},as=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const w=t.map(d=>{const r=as(d,e,"");return r!==d&&(c=!0),r});return c?w:t}if(zs(t)){const c=Qs(e,t);return c?n==="model"?Zs(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},so=t=>{if(typeof t!="function"||t[os])return t;const e=Ys.get(t);if(e)return e;const n=function(...i){const c=rs();if(!c)return t.apply(this,i);let w=!1;const d=i.map(r=>{const b=as(r,c,"");return b!==r&&(w=!0),b});return t.apply(this,w?d:i)};return Object.defineProperty(n,os,{value:!0,configurable:!1}),Ys.set(t,n),n},Wo=()=>{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]=so(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"?so(s):s;return Reflect.set(e,n,c,i)}})}},oo=()=>{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 w=!1;const d=i.map(r=>{const b=Ts(r,c,"");return b!==r&&(w=!0),b});return n.apply(this,w?d:i)})}};no(),((di=JSswift.rod)==null?void 0:di._all)instanceof Set&&JSswift.rod._all.forEach(t=>to(t)),oo(),Wo();const io={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},Uo=new Set(Object.values(io)),lo=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),Lo=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 io[e]||""},Io=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":lo.has(e)?e:null},bs=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return Lo.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",Rn=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];JSswift.isUIPlainObject=Xn,JSswift.isListItemNode=ws,JSswift.asNodeArray=Rn;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))})},ro=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 w=Array.isArray(c.prop)?c.prop:[c.prop];let d=!1,r,b="";for(const v of w)if(Ss(i,v)){r=o(i[v]),b=v,d=!0;break}if(!d||r==null||r===""||r===!1&&!c.allowFalse)continue;const O=typeof c.map=="function"?c.map(r,{propName:b,props:i,device:s,rule:c}):`${c.class}-${ro(r)}`,C=Array.isArray(O)?O:[O];for(const v of C)v&&n.push(String(v).startsWith("cms-")?v:`${s.prefix}${v}`)}}return n},Wn=(t={})=>Hn.some(e=>!!us(t,e)),ao=(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}`,co=(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 w=Array.isArray(c.prop)?c.prop:[c.prop],d=(r,b)=>{const O=ao(b,w),C=Js(O,c);if(!C)return;const v=c.var||c.css,T=r==="mobile"?"--cms-rsp-":`--cms-rsp-${r}-`;Cs(s,`${T}${v}`,C),co(t,En(r,v)),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),co(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 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=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 wn(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"},Eo=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:Eo},{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 uo=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),fo=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(uo(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)||fo(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),w=i!=null?typeof i=="function"?i(n||{}):i:s;return w==null?null:xn(JSswift.ui.slot(w))};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"]),L={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"},V=()=>{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?L[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"){V()?s.meta=!0:s.ctrl=!0;return}if(l.has(i)){s[i]=!0;return}s.key=i}),s.key?s:null},Y=t=>t==null||t===!1?[]:(Array.isArray(t)?t:[t]).map(n=>{var i,c,w;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const d=ge((w=(c=(i=n.shortcode)!=null?i:n.shortcut)!=null?c:n.keys)!=null?w:n.key);return d?{...n,...d}:null}const s=ge(n);return s?{...s}:null}).filter(Boolean),pe=(t={})=>{var e,n,s;return Y((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 V()&&(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(" / "),Fe=(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,w,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 O=n[b],C=O==null?void 0:O.anchor;if(!C||!C.isConnected){Un.delete(O);continue}if(((s=O.isEnabled)==null?void 0:s.call(O))===!1)continue;const v=O.specs.find(he=>{var W,se;const H=(se=(W=he.allowInEditable)!=null?W:O.allowInEditable)!=null?se:!1;return e&&!H?!1:Qe(t,he)});if(!v)continue;const T=(c=(i=v.preventDefault)!=null?i:O.preventDefault)!=null?c:!0,le=(d=(w=v.stopPropagation)!=null?w:O.stopPropagation)!=null?d:!0;if(T&&t.preventDefault(),le&&t.stopPropagation(),((r=O.action)==null?void 0:r.call(O,t,v,C))!==!1)break}pt()}const it=(t,e={},n={})=>{var w,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:(w=n.preventDefault)!=null?w:!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},Me=(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 p,f,h,B,ie;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(a,x,g={})=>{const P=Array.isArray(a)?a:[a];for(const q of P)if(JSswift.ui.getSlot(s,q)!=null)return J(s,q,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)},w=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":""}),O=Ke(e.align),C=Ke(e.justify),v=Ke(e.wrap,a=>typeof a=="boolean"?a?"wrap":"nowrap":String(a)),T=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,w),W=Ke(e.minWidth,w),se=Ke(e.maxWidth,w),X=Ke(e.full,a=>a?"100%":"",""),de=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),O!=null&&!Ze(e,"align")&&(r.alignItems=O),C!=null&&!Ze(e,"justify")&&(r.justifyContent=C),v!=null&&!Ze(e,"wrap")&&(r.flexWrap=v),T!=null&&!Ze(e,"gap")&&(r.gap=T),le!=null&&!Ze(e,"rowGap")&&(r.rowGap=le),Z!=null&&!Ze(e,"columnGap")&&(r.columnGap=Z),he!=null&&(r.display=he),de!=null&&(r.width=de),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"],(p=e.start)!=null?p:e.left,_e),me=i(["body","center","default"],(h=(f=e.body)!=null?f:e.center)!=null?h:n,_e),fe=i(["end","right"],(B=e.end)!=null?B:e.right,_e);if(!(be.length||fe.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,fe.length?_.div({class:te(["cms-row-end",e.endClass]),style:{...$,justifyContent:"flex-end",marginInlineStart:oe}},...fe):null].filter(Boolean),F=_.div(d,...Se);return Nt(F,e),F};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 w=o(c);if(!(w==null||w===!1||w==="")){if(Array.isArray(w)){i.unshift(...w);continue}s.push(w)}}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 P,q,Q,ve,E,m;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=N=>Object.prototype.hasOwnProperty.call(e,N),c=(N,I,K={})=>{const ke=Array.isArray(N)?N:[N];for(const Oe of ke)if(JSswift.ui.getSlot(s,Oe)!=null)return J(s,Oe,K,I);return I==null?[]:J(null,"default",K,I)},w=N=>{var I;return N==null||N===!1||N===""?"":typeof N=="number"?`${N}px`:typeof N=="string"&&((I=JSswift.uiSizes)!=null&&I.includes(N))?`var(--cms-s-${N})`:String(N)},d=N=>{var I;return N==null||N===!1||N===""?"":typeof N=="string"&&((I=JSswift.uiSizes)!=null&&I.includes(N))?ze(N,"size"):yt(N)},r=(N,I)=>{const K=o(N);if(K==null||K===!1||K==="")return"";if(K==="auto")return I==="cms-col-"?"cms-col-auto":"";if(K===!0)return`${I}24`;const ke=Number(K);if(Number.isFinite(ke)&&ke>0)return`${I}${Math.max(1,Math.min(24,Math.round(ke)))}`;if(typeof K=="string"){const Oe=K.trim();if(!Oe)return"";if(Oe.startsWith(I))return Oe;if(/^\d+$/.test(Oe))return`${I}${Math.max(1,Math.min(24,Number(Oe)))}`}return""},b=()=>{const N=o(e.flex);if(N!=null&&N!==!1&&N!=="")return String(N);if(o(e.fill))return"1 1 auto";const I=i("grow"),K=i("shrink"),ke=i("basis");if(!I&&!K&&!ke)return"";const Oe=I?o(e.grow):0,Te=K?o(e.shrink):1,U=ke?d(o(e.basis)):"auto";return`${Oe} ${Te} ${U||"auto"}`},O=Ct([e.auto,e.col,e.span],()=>{if(o(e.auto))return"cms-col-auto";const N=i("span")?e.span:e.col;return r(N,"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]),v={...e.style||{}};!Ze(e,"minWidth")&&v.minWidth==null&&(v.minWidth=0);const T=Ke(e.gap,w),le=Ke(e.rowGap,w),Z=Ke(e.columnGap,w),he=Ke(e.align),H=Ke(e.justify),W=i("width")?e.width:e.size,se=Ke(W,d),X=Ke(e.minWidth,d),de=Ke(e.maxWidth,d),_e=Ke(e.height,d),be=Ke(e.minHeight,d),me=Ke(e.maxHeight,d),fe=Ke(e.self),ce=Ke(e.order,N=>String(N)),$=Ke(e.scroll,N=>N?"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!==""&&(v.flex=re),fe!=null&&!Ze(e,"self")&&(v.alignSelf=fe),ce!=null&&(v.order=ce),$!=null&&$!==""&&(v.overflow=$),se!=null&&se!==""&&!Ze(e,["width","size"])&&(v.width=se,!i("flex")&&!i("fill")&&!i("grow")&&!i("shrink")&&!i("basis")&&(v.flex="0 0 auto")),X!=null&&!Ze(e,"minWidth")&&(v.minWidth=X),de!=null&&!Ze(e,"maxWidth")&&(v.maxWidth=de),_e!=null&&!Ze(e,"height")&&(v.height=_e),be!=null&&!Ze(e,"minHeight")&&(v.minHeight=be),me!=null&&!Ze(e,"maxHeight")&&(v.maxHeight=me),Object.keys(v).length&&(C.style=v);const Se={props:e},F=c(["start","top","header","before"],(Q=(q=(P=e.start)!=null?P:e.top)!=null?q:e.header)!=null?Q:e.before,Se),p=i("body")?e.body:i("content")?e.content:n,f=c(["body","content","default"],p,Se),h=c(["end","bottom","footer","after"],(m=(E=(ve=e.end)!=null?ve:e.bottom)!=null?E:e.footer)!=null?m:e.after,Se),B=F.length||h.length||i("start")||i("top")||i("header")||i("before")||i("body")||i("content")||i("end")||i("bottom")||i("footer")||i("after")||e.startClass||e.bodyClass||e.contentClass||e.endClass||e.topClass||e.headerClass||e.bottomClass||e.footerClass||JSswift.ui.getSlot(s,"start")!=null||JSswift.ui.getSlot(s,"top")!=null||JSswift.ui.getSlot(s,"header")!=null||JSswift.ui.getSlot(s,"before")!=null||JSswift.ui.getSlot(s,"body")!=null||JSswift.ui.getSlot(s,"content")!=null||JSswift.ui.getSlot(s,"end")!=null||JSswift.ui.getSlot(s,"bottom")!=null||JSswift.ui.getSlot(s,"footer")!=null||JSswift.ui.getSlot(s,"after")!=null,ie=Ct([e.stack,e.gap,e.rowGap,e.columnGap,e.align,e.justify,e.center],()=>o(e.stack)||B||[o(e.gap),o(e.rowGap),o(e.columnGap),o(e.align),o(e.justify)].some(I=>I!=null&&I!==!1&&I!=="")?!0:!!o(e.center));if(C.class=te(["cms-col",O,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]),T!=null&&!Ze(e,"gap")&&(v.gap=T),le!=null&&!Ze(e,"rowGap")&&(v.rowGap=le),Z!=null&&!Ze(e,"columnGap")&&(v.columnGap=Z),he!=null&&!Ze(e,"align")?v.alignItems=he:oe!=null&&oe!==""&&(v.alignItems=oe?"center":""),H!=null&&!Ze(e,"justify")?v.justifyContent=H:oe!=null&&oe!==""&&(v.justifyContent=oe?"center":""),Object.keys(v).length&&(C.style=v),JSswift.uiApplyResponsiveProps(C,e,JSswift.uiResponsiveStyleRules),!B){const N=_.div(C,...J(s,"default",Se,n));return Nt(N,e),N}const a={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},x=[F.length?_.div({class:te(["cms-col-start",e.startClass,e.topClass,e.headerClass]),style:{...a}},...F):null,f.length?_.div({class:te(["cms-col-body",e.bodyClass,e.contentClass]),style:{...a,flex:"1 1 auto"}},...f):null,h.length?_.div({class:te(["cms-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...a}},...h):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 h,B,ie,a;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=x=>Object.prototype.hasOwnProperty.call(e,x),w={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%":w[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:""},O=x=>x==null||x===""?"":x===!0?"wrap":x===!1?"nowrap":String(x),C={props:e},v=(x,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(P=>v(x,P));return}if(g!=null&&g.nodeType){x.appendChild(g);return}x.appendChild(document.createTextNode(String(g)))}},T=(x,g)=>{const P=JSswift.ui.getSlot(s,x);if(P!=null)return J(s,x,C,null);if(typeof g=="function"){const q=_.div({class:`cms-container-slot-${x}`});return JSswift.reactive.effect(()=>{const Q=xn(JSswift.ui.slot(g(C)));q.replaceChildren(),Array.isArray(Q)?Q.forEach(ve=>v(q,ve)):v(q,Q)},`UI.Container:${x}`),[q]}return J(s,x,C,g)},le=c("content")?e.content:n!=null&&n.length?n:null,Z=T("before",(h=e.before)!=null?h:e.top),he=T("header",e.header),H=[...T("left",e.left),...T("start",e.start)],W=T("body",c("body")?e.body:null),se=(()=>{const x=T("content",c("content")?e.content:null);return x.length?x:T("default",le)})(),X=[...T("right",e.right),...T("end",e.end)],de=T("footer",e.footer),_e=T("after",(B=e.after)!=null?B:e.bottom),be=Z.length||he.length||H.length||X.length||de.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),fe=()=>{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=fe();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,O));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,P)=>g.length?_.div({class:te(["cms-container-section",`cms-container-${x}`,P])},...g):null,F=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,p=(()=>{var g;const x=String(o((g=e.tag)!=null?g:e.as)||"div").toLowerCase();return typeof _[x]=="function"?_[x]:_.div})(),f=me?p(oe,Se("before",Z,e.beforeClass),Se("header",he,e.headerClass),F,Se("footer",de,e.footerClass),Se("after",_e,e.afterClass)):p(oe,...W.length?W:se);return Nt(f,e),f},Ne.Card=(...t)=>{var ve,E;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};wn(i);const c=(m,N)=>{var I;return!!(m&&m.nodeType===1&&((I=m.classList)!=null&&I.contains(`cms-card-${N}`)))},d=(m=>m==null?null:typeof m=="string"?Ne.Icon({name:m,size:e.iconSize||e.size||"lg"}):JSswift.ui.slot(m,{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},O=J(s,"default",b,n!=null&&n.length?n:[]),C={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},v=[];O.forEach(m=>{c(m,"identifier")?C.identifier.push(m):c(m,"cover")?C.cover.push(m):c(m,"media")?C.media.push(m):c(m,"header")?C.header.push(m):c(m,"body")?C.body.push(m):c(m,"footer")?C.footer.push(m):c(m,"actions")?C.actions.push(m):v.push(m)});const T=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),de=J(s,"aside",b,(E=e.aside)!=null?E:e.headerAside),_e=J(s,"body",b,e.body),be=J(s,"footer",b,e.footer),me=J(s,"actions",b,e.actions),fe=T.length?_.div({class:te(["cms-card-identifier",e.identifierClass])},...T):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||de.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),de.length?_.div({class:te(["cms-card-aside",e.asideClass])},...de):null)):null,Se=[..._e,...v],F=Se.length?_.div({class:te(["cms-card-body",e.bodyClass])},...Se):null,p=[...me,...C.actions],f=be.length||p.length?_.div({class:te(["cms-card-footer",e.footerClass])},...be,p.length?_.div({class:"cms-card-actions"},...p):null):null,h=Ct([e.clickable,e.to],()=>o(e.clickable)||o(e.to)?"cms-card-clickable":""),B=T.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(B,"cms-card-has-identifier"),ye(ie,"cms-card-has-top-visual"),h,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,P=m=>{var I;if(x==null||x(m),m.defaultPrevented)return;const N=o(e.to);N&&((I=JSswift.router)!=null&&I.navigate)&&(m.preventDefault(),JSswift.router.navigate(N))},q=m=>{g==null||g(m),!m.defaultPrevented&&(m.key==="Enter"||m.key===" ")&&(m.preventDefault(),P(m))};(o(e.clickable)||o(e.to))&&(a.onClick=P,a.onKeydown=q,a.tabIndex==null&&(a.tabIndex=0),a.role==null&&(a.role="button"));const Q=_.div(a,fe,...C.identifier,ce,...C.cover,$,...C.media,oe,...C.header,F,...C.body,f,...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]),w=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);w.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,O=e.iconRight!=null?typeof e.iconRight=="string"?Ne.Icon({name:e.iconRight}):e.iconRight:null,C=JSswift.ui.renderSlot(s,"icon",{},b),v=JSswift.ui.renderSlot(s,"iconRight",{},O),T=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")&&!O?(he(T),le.length&&Z.push(...le),he(C)):(he(C),he(T),le.length&&Z.push(...le)),he(v),he(Fe(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 de=!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 p;if((p=e.onPointerDown)==null||p.call(e,$),r()||!($!=null&&$.currentTarget))return;const re=$.currentTarget,oe=re.getBoundingClientRect(),Se=typeof $.clientX=="number"?$.clientX-oe.left:oe.width/2,F=typeof $.clientY=="number"?$.clientY-oe.top:oe.height/2;re.style.setProperty("--cms-burst-x",`${Se}px`),re.style.setProperty("--cms-burst-y",`${F}px`),re.classList.remove("cms-btn-burst"),re.offsetWidth,re.classList.add("cms-btn-burst")},me=_.button({...w,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),fe=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=!$,$!==de&&(se.replaceChildren(...$?_e():[]),de=$)},"UI.Btn:state");return(ce=JSswift._registerCleanup)==null||ce.call(JSswift,me,fe),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;let Mn=0;Ne.FormField=(t={})=>{var ce,$,re,oe,Se,F,p;wn(t);const e=t.slots||{},n=Ct([t.color,t.state],()=>{const f=o(t.color)||o(t.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(f)?f: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,w=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 f=t.getValue?t.getValue():null;return!(f==null||f==="")},r=()=>JSswift.reactive.untracked(d),b=()=>{var f,h;t.disabled||t.readonly||((f=t.onClear)==null||f.call(t),(h=t.onFocus)==null||h.call(t))},O=JSswift.ui.renderSlot(e,"control",{control:w,clear:b,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:r()},null);let C=null,v=null;if(O)C=Array.isArray(O)?_.div({class:"cms-control"},...O):O;else{C=_.div({class:"cms-control"});const f=_.div({class:"cms-addon cms-addon-left"}),h=t.icon!=null?typeof t.icon=="string"?Ne.Icon({name:t.icon}):t.icon:null,B=JSswift.ui.renderSlot(e,"icon",{},h),ie=JSswift.ui.renderSlot(e,"prefix",{},t.prefix);J(null,"default",{},B).forEach(N=>f.appendChild(N)),J(null,"default",{},ie).forEach(N=>f.appendChild(N)),f.childNodes.length&&C.appendChild(f);const a=_.div({class:"cms-mid"+(f.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});w&&a.appendChild(w);const x=J(e,"label",{},t.label);if(x.length){const N=_.div({class:te(["cms-float-label",ye(c,"cms-multiselect")])},...x);a.appendChild(N)}C.appendChild(a);const g=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:b},Ne.Icon({name:"close"})):null,P=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:r()},g);P&&(P.onclick=N=>{N.stopPropagation(),b()},J(null,"default",{},P).forEach(N=>C.appendChild(N))),v=g,v&&((ce=t.clearable)!=null&&ce.action)&&t.clearable.action(N=>N?v.classList.remove("cms-d-none"):v.classList.add("cms-d-none"));const q=_.div({class:"cms-addon cms-addon-right"}),Q=t.iconRight!=null?typeof t.iconRight=="string"?Ne.Icon({name:t.iconRight}):t.iconRight:null,ve=JSswift.ui.renderSlot(e,"iconRight",{},Q),E=JSswift.ui.renderSlot(e,"suffix",{},t.suffix),m=JSswift.ui.renderSlot(e,"shortcode",{props:t},Fe(t,{className:"cms-shortcode cms-field-shortcode"}));J(null,"default",{},E).forEach(N=>q.appendChild(N)),J(null,"default",{},ve).forEach(N=>q.appendChild(N)),J(null,"default",{},m).forEach(N=>q.appendChild(N)),q.childNodes.length&&(C.appendChild(q),a.classList.add("cms-with-right"))}const T=f=>f&&(f&&typeof f.action=="function"?f.value:Array.isArray(f)&&typeof f[0]=="function"?f[0]():typeof f=="function"?f():f),le=f=>f==null||f===!1||f===""?!1:Array.isArray(f)?f.length>0:!0;let Z=null;const he=`jsswift-field-message-${++Mn}`,H=()=>{if(!(w!=null&&w.setAttribute))return;const f=[o(t.ariaDescribedBy),Z==null?void 0:Z.id].filter(Boolean).join(" ").trim();f?w.setAttribute("aria-describedby",[...new Set(f.split(/\s+/))].join(" ")):w.removeAttribute("aria-describedby")};s._syncDescription=H;const W=()=>{const f=[{key:"error",value:T(t.error),slot:"errorMessage",className:"cms-error"},{key:"warning",value:T(t.warning),slot:"warning",className:"cms-warning"},{key:"success",value:T(t.success),slot:"success",className:"cms-success"},{key:"note",value:T(t.note),slot:"note",className:"cms-note"},{key:"hint",value:T(t.hint),slot:"hint",className:"cms-hint"}];let h=null;for(const g of f)if(le(g.value)){h=g;break}const B={error:f[0].value,warning:f[1].value,success:f[2].value,note:f[3].value,hint:f[4].value,props:t},ie=h?J(e,h.slot,B,h.value):[],a=ie.length?_.div({id:he,class:h==null?void 0:h.className},...ie):null;["error","warning","success","note"].forEach(g=>{var P;return(P=C==null?void 0:C.classList)==null?void 0:P.toggle(g,(h==null?void 0:h.key)===g)}),Z?a?Z.replaceWith(a):Z.remove():a&&s.appendChild(a),Z=a,H()},se=()=>{var h;const f=d();(h=C==null?void 0:C.classList)==null||h.toggle("has-value",f),v&&(v.style.display=f?"":"none")};JSswift.reactive.untracked(se),($=C==null?void 0:C.classList)==null||$.toggle("disabled",!!t.disabled),s.appendChild(C);const X=JSswift.ui.getSlot(e,"errorMessage"),de=JSswift.ui.getSlot(e,"warning"),_e=JSswift.ui.getSlot(e,"success"),be=JSswift.ui.getSlot(e,"note"),me=JSswift.ui.getSlot(e,"hint");return!!((re=t.error)!=null&&re.action||(oe=t.warning)!=null&&oe.action||(Se=t.success)!=null&&Se.action||(F=t.note)!=null&&F.action||(p=t.hint)!=null&&p.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 X=="function"||typeof de=="function"||typeof _e=="function"||typeof be=="function"||typeof me=="function"?JSswift.reactive.effect(()=>{W()},"UI.FormField:message"):W(),s._refresh=se,s._control=C,s._el=w,s},Ne.InputRaw=(t={})=>{var O;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=(O=e.value)!=null?O:"";const s=()=>{var v;const C=(v=e.value)!=null?v:"";C!==n&&(n=C,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let i=null,c=!1;const w=()=>{if(c)return;c=!0;let C=0;const v=()=>{if(s(),C+=1,C>=10){c=!1;return}setTimeout(v,120)};setTimeout(v,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(),w())}),e.addEventListener("focus",()=>{d(),w(),setTimeout(s,50)}),e.addEventListener("blur",()=>{r(),setTimeout(s,0)}),setTimeout(s,0),w();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:()=>Me(e,{selectText:!!t.selectOnShortcode})}),e};function nn(t,e,n,s=!1){t.focus=c=>e.focus(c);const i=(c,w)=>{w==null||w===!1?e.removeAttribute(c):e.setAttribute(c,String(w))};JSswift.reactive.effect(()=>{var r,b;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)),(b=t._syncDescription)==null||b.call(t);const w=n.ariaInvalid==null?!!o(n.error):!!o(n.ariaInvalid);e.setAttribute("aria-invalid",String(w));const d=!!o(n.required);if(e.setAttribute("aria-required",String(d)),s){e.required=d;for(const O of["min","max","step","pattern","minLength","maxLength"])i(O.toLowerCase(),o(n[O]))}},"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 w=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=()=>{w||(w=setInterval(()=>{if(document.activeElement!==s){clearInterval(w),w=null;return}c()},250))},O=()=>{w&&(clearInterval(w),w=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),O(),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 de=be=>{const me=be!=null?be:"";s.value!==me&&(s.value=me,i=me)};se.action(be=>{if(!X){X=!0;try{de(be)}finally{X=!1}}}),JSswift.reactive.untracked(()=>de(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 v=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),T=Array.isArray(v)?_.div({style:{display:"contents"}},...v):v,le=Ne.FormField({...n,control:T,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,nn(le,s,t,!0),it(s,t,{isEnabled:()=>!s.disabled,action:()=>Me(s,{selectText:!!t.selectOnShortcode})}),le},Ne.Textarea=(t={})=>{var b,O,C,v;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:(O=t.maxLength)!=null?O:t.maxlength,minLength:(C=t.minLength)!=null?C:t.minlength,wrap:t.wrap,value:(v=t.value)!=null?v:"",disabled:!!t.disabled,readOnly:!!t.readonly});s.addEventListener("input",()=>{var T;(T=t.onInput)==null||T.call(t,s.value)}),s.addEventListener("change",()=>{var T;(T=t.onChange)==null||T.call(t,s.value)}),s.addEventListener("focus",T=>{var le;(le=t.onFocus)==null||le.call(t,T)}),s.addEventListener("blur",T=>{var le;(le=t.onBlur)==null||le.call(t,T)});const i=t.model;if(i){const T=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")T(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]));T(le)}}const c=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",w=JSswift.ui.renderSlot(e,c,{textarea:s,input:s,props:t},s),d=Array.isArray(w)?_.div({style:{display:"contents"}},...w):w,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 T;return(T=r._refresh)==null?void 0:T.call(r)}),s.addEventListener("change",()=>{var T;return(T=r._refresh)==null?void 0:T.call(r)}),r._input=s,r._textarea=s,it(s,t,{isEnabled:()=>!s.disabled,action:()=>Me(s,{selectText:!!t.selectOnShortcode})}),r},Ne.Search=(t={})=>{var z,Pe;const e=t.slots||{},n=M=>!!M&&(typeof M=="object"&&typeof M._bind=="function"||vt(M)),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,w]=JSswift.reactive.signal(i==null?"":String(i)),[d,r]=JSswift.reactive.signal(!1),[b,O]=JSswift.reactive.signal(!1),[C,v]=JSswift.reactive.signal(null),[T,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,de=null,_e=0,be=0,me=!1,fe=-1,ce=[];const $=(M,k)=>{const S=Number(o(M));return Number.isFinite(S)?S:k},re=(M,k=!1)=>{const S=o(M);return S==null?k:!!S},oe=()=>re(t.disabled,!1),Se=()=>re(t.readonly,!1),F=()=>Math.max(0,$(t.minLength,t.endpoint?1:0)),p=()=>Math.max(0,$(t.debounce,250)),f=M=>{var S,u,A,xe,Ue;const k=t.getLabel||t.labelOf;return typeof k=="function"?k(M):M==null?"":typeof M=="string"||typeof M=="number"?String(M):(Ue=(xe=(A=(u=(S=M.label)!=null?S:M.title)!=null?u:M.name)!=null?A:M.text)!=null?xe:M.value)!=null?Ue:""},h=M=>{var S,u,A;const k=t.getValue||t.valueOf;return typeof k=="function"?k(M):M==null?"":typeof M=="string"||typeof M=="number"?M:(A=(u=(S=M.value)!=null?S:M.id)!=null?u:M.key)!=null?A:f(M)},B=M=>Array.isArray(M)?M:!M||typeof M!="object"?[]:Array.isArray(M.items)?M.items:Array.isArray(M.results)?M.results:Array.isArray(M.data)?M.data:[],ie=async(M,k)=>{const S=typeof M=="function"?M(k,{props:t}):o(M);return S&&typeof S.then=="function"?await S:S},a=(M,k)=>{const S=typeof M=="function"?M(k,{props:t}):o(M);if(!S)return"";const u=String(S),A=new URL(u,window.location.href),xe=o(t.queryParam)||"q";xe&&A.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||A.searchParams.set(et,String(G))}),A.toString()},x=(M,k={})=>{var u,A;const S=M==null?"":String(M);c()!==S&&w(S),ae.value!==S&&(ae.value=S),se&&!k.fromModel&&se(S),k.fromModel||(u=t.onInput)==null||u.call(t,S,k.event),(A=Ie==null?void 0:Ie._refresh)==null||A.call(Ie)},g=()=>{r(!1),he(-1)},P=()=>b()||C()||T().length?!0:c().trim().length>=F()?!!(t.emptyText||JSswift.ui.getSlot(e,"empty")!=null):!!(t.startText||JSswift.ui.getSlot(e,"empty")!=null),q=()=>{oe()||P()&&(r(!0),Oe())},Q=()=>{le([]),v(null),he(-1)},ve=async(M,k={})=>{var G,Ge,lt,tt,dt,St;const S=M==null?"":String(M).trim(),u=++_e,A=o((G=t.endpoint)!=null?G:t.url),xe=(lt=(Ge=t.items)!=null?Ge:t.options)!=null?lt:t.suggestions;if(de&&(de.abort(),de=null),S.length<F()){O(!1),Q(),k.open&&P()?q():P()||g();return}const Ue=t.cache!==!1,et=`${A||"local"}::${S}`;if(Ue&&W.has(et)){le(W.get(et)),v(null),O(!1),he(W.get(et).length?0:-1),k.open!==!1&&q();return}O(!0),v(null),k.open!==!1&&q(),(tt=t.onSearch)==null||tt.call(t,S);try{let It;if(A){de=new AbortController;const st=a(A,S),wt=await fetch(st,{method:"GET",headers:t.headers,credentials:t.credentials,signal:de.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=B(await ie(xe,S)),wt=t.filter||((Ft,Dt)=>String(f(Ft)).toLowerCase().includes(Dt.toLowerCase()));It=st.filter(Ft=>wt(Ft,S))}else It=[];if(u!==_e)return;const Rt=typeof t.mapResponse=="function"?t.mapResponse(It,S):B(It),Pt=B(Rt);Ue&&W.set(et,Pt),le(Pt),he(Pt.length?0:-1),(dt=t.onResults)==null||dt.call(t,Pt,S)}catch(It){if((It==null?void 0:It.name)==="AbortError"||u!==_e)return;v(It),le([]),he(-1),(St=t.onError)==null||St.call(t,It,S)}finally{u===_e&&(O(!1),de=null,Oe())}},E=(M,k={})=>{X&&clearTimeout(X);const S=k.immediate?0:p();X=setTimeout(()=>{X=null,ve(M,k)},S)},m=M=>{var S;const k=c();(S=t.onSubmit)==null||S.call(t,k,M),t.submitOnEnter!==!1&&E(k,{immediate:!0,open:!0})},N=(M,k)=>{var A;if(!M)return;const S=h(M),u=f(M);t.commitValue==="value"?x(S,{event:k}):t.commitValue!==!1&&x(u,{event:k}),(A=t.onSelect)==null||A.call(t,M,{value:S,label:u,query:c(),event:k}),t.closeOnSelect!==!1&&g()},I=M=>{const k=T();if(!k.length)return;const S=Z(),u=S<0?M>0?0:k.length-1:Math.max(0,Math.min(k.length-1,S+M));he(u)},K=M=>{const k=M==null?"":String(M),S=c().trim();if(!S||t.highlight===!1)return[document.createTextNode(k)];const u=k.toLowerCase().indexOf(S.toLowerCase());return u<0?[document.createTextNode(k)]:[document.createTextNode(k.slice(0,u)),_.mark({class:"cms-search-highlight"},k.slice(u,u+S.length)),document.createTextNode(k.slice(u+S.length))]},ke=M=>{var u,A;const k=f(M),S=M&&typeof M=="object"?(A=(u=M.description)!=null?u:M.subtitle)!=null?A:M.note:null;return _.div({class:"cms-search-result-content"},_.div({class:"cms-search-result-label"},...K(k)),S?_.div({class:"cms-search-result-description"},String(S)):null)},Oe=()=>{!d()||Ee.parentNode!==document.body||be||(be=requestAnimationFrame(()=>{if(be=0,!d()||!De.isConnected||Ee.parentNode!==document.body)return;const M=De.getBoundingClientRect(),k=6,S=8,u=Math.max(180,window.innerWidth-S*2),A=Math.min(Math.max(M.width,$(t.minMenuWidth,260)),u),xe=Math.max(S,Math.min(M.left,window.innerWidth-A-S));Ee.style.width=`${A}px`,Ee.style.left=`${xe}px`,Ee.style.right="auto";const Ue=Ee.getBoundingClientRect().height||0,et=window.innerHeight-M.bottom-k-S,G=M.top-k-S;let lt=et<180&&G>et?M.top-k-Ue:M.bottom+k;lt=Math.max(S,Math.min(lt,window.innerHeight-Ue-S)),Ee.style.top=`${lt}px`}))},Te=()=>{me||(me=!0,window.addEventListener("resize",Oe),window.addEventListener("scroll",Oe,!0))},U=()=>{me&&(me=!1,window.removeEventListener("resize",Oe),window.removeEventListener("scroll",Oe,!0))},j=()=>{Ee.parentNode!==document.body&&(be&&(cancelAnimationFrame(be),be=0),Ee.classList.add("portal"),Ee.style.display="block",document.body.appendChild(Ee),Te(),Oe())},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:M=>M.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(M=>x(M,{fromModel:!0})),se=M=>{s.value!==M&&(s.value=M)};else if(Array.isArray(s)&&typeof s[0]=="function"&&typeof s[1]=="function"){const M=s[0],k=s[1];JSswift.reactive.effect(()=>{x(M(),{fromModel:!0})},"UI.Search:model"),se=S=>k(S)}}else Ye(t.value)&&JSswift.reactive.effect(()=>{x(o(t.value),{fromModel:!0})},"UI.Search:value");ae.addEventListener("input",M=>{x(ae.value,{event:M}),t.searchOnInput!==!1&&E(ae.value,{open:!0})}),ae.addEventListener("change",M=>{var k;return(k=t.onChange)==null?void 0:k.call(t,ae.value,M)}),ae.addEventListener("focus",M=>{var k;He(),(k=t.onFocus)==null||k.call(t,M),t.openOnFocus!==!1&&(t.searchOnFocus&&!T().length?E(ae.value,{immediate:!0,open:!0}):q())}),ae.addEventListener("blur",M=>{var k;He(),(k=t.onBlur)==null||k.call(t,M)}),ae.addEventListener("keydown",M=>{if(oe()||Se())return;const k=d(),S=T(),u=Z();if(M.key==="Escape"){k&&(M.preventDefault(),g());return}if(M.key==="ArrowDown"){M.preventDefault(),k?I(1):(q(),S.length||E(ae.value,{immediate:!0,open:!0}));return}if(M.key==="ArrowUp"){M.preventDefault(),k?I(-1):q();return}if(M.key==="Home"&&k&&S.length&&(M.metaKey||M.ctrlKey)){M.preventDefault(),he(0);return}if(M.key==="End"&&k&&S.length&&(M.metaKey||M.ctrlKey)){M.preventDefault(),he(S.length-1);return}M.key==="Enter"&&(k&&u>=0&&S[u]?(M.preventDefault(),N(S[u],M)):m(M))});const qe=M=>{if(!De.isConnected)return;const k=M.target;De.contains(k)||Ee.contains(k)||g()};document.addEventListener("click",qe,!0),JSswift.reactive.effect(()=>{const M=d();De.classList.toggle("open",M),ae.setAttribute("aria-expanded",M?"true":"false"),M?j():ne()},"UI.Search:open"),JSswift.reactive.effect(()=>{const M=oe(),k=Se();De.classList.toggle("disabled",M),De.classList.toggle("readonly",k),ae.disabled=M,ae.readOnly=k},"UI.Search:disabled"),JSswift.reactive.effect(()=>{const M=b(),k=C(),S=T(),u=c();if($e.innerHTML="",ce=[],fe=-1,M){const A=JSswift.ui.renderSlot(e,"loading",{query:u},t.loadingText||"Caricamento...");$e.appendChild(_.div({class:"cms-search-empty is-loading"},...J(null,"default",{},A)))}else if(k){const A=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",{},A)))}else if(S.length)S.forEach((A,xe)=>{const et=f(A),G=h(A),Ge=dt=>N(A,dt),lt=JSswift.ui.renderSlot(e,"result",{item:A,index:xe,active:!1,label:et,value:G,query:u,select:Ge},ke(A)),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>=F()?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)))}P()||g(),Oe()},"UI.Search:render"),JSswift.reactive.effect(()=>{const M=Z();M!==fe&&(ce[fe]&&(ce[fe].classList.remove("active"),ce[fe].setAttribute("aria-selected","false")),ce[M]?(ce[M].classList.add("active"),ce[M].setAttribute("aria-selected","true"),ce[M].scrollIntoView({block:"nearest"}),ae.setAttribute("aria-activedescendant",`${H}-result-${M}`)):ae.removeAttribute("aria-activedescendant"),fe=M)},"UI.Search:active"),Ie=Ne.FormField({...t,icon:(z=t.icon)!=null?z:"search",wrapClass:te(["cms-search-field",t.wrapClass]),control:De,getValue:()=>c(),onClear:()=>{var M;oe()||Se()||(x("",{}),Q(),(M=t.onClear)==null||M.call(t))},onFocus:()=>ae.focus()}),ae.addEventListener("input",()=>{var M;return(M=Ie._refresh)==null?void 0:M.call(Ie)}),ae.addEventListener("change",()=>{var M;return(M=Ie._refresh)==null?void 0:M.call(Ie)}),Ie._input=ae,Ie._search=De,Ie._open=q,Ie._close=g,Ie._searchNow=()=>ve(c(),{immediate:!0,open:!0}),Ie._getResults=T,Ie._setValue=M=>x(M,{});let Be=!1;return Ie._dispose=()=>{Be||(Be=!0,document.removeEventListener("click",qe,!0),X&&clearTimeout(X),de&&de.abort(),ne())},(Pe=JSswift._registerCleanup)==null||Pe.call(JSswift,Ie,Ie._dispose),it(ae,t,{isEnabled:()=>!ae.disabled,action:()=>Me(ae,{selectText:!!t.selectOnShortcode})}),(t.autoSearch||t.searchOnMount)&&E(c(),{immediate:!0,open:!1}),Ie},Ne.Select=(t={})=>{var Pe,M;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||{},w=k=>!!k&&(typeof k=="object"&&typeof k._bind=="function"||vt(k)),d=w(t.model)?t.model:w(t.value)?t.value:null,r=k=>Array.isArray(k)?k.slice():k==null||k===""?[]:[k],b=k=>s?r(k):k,O=d?JSswift.reactive.untracked(()=>typeof d=="object"&&typeof d._bind=="function"?d.value:d[0]()):t.value,[C,v]=JSswift.reactive.signal(!1),[T,le]=JSswift.reactive.signal(""),[Z,he]=JSswift.reactive.signal(s?r(O):O!=null?O:""),[H,W]=JSswift.reactive.signal(!1),[se,X]=JSswift.reactive.signal([]),[de,_e]=JSswift.reactive.signal([]),[be,me]=JSswift.reactive.signal(-1);let fe=null;if(d){if(typeof d=="object"&&typeof d._bind=="function")JSswift.reactive.untracked(()=>he(b(d.value))),d.action(k=>he(b(k))),fe=k=>{const S=b(k);d.value!==S&&(d.value=S)};else if(Array.isArray(d)&&typeof d[0]=="function"&&typeof d[1]=="function"){const k=d[0],S=d[1];JSswift.reactive.untracked(()=>{JSswift.reactive.effect(()=>{he(b(k()))},"UI.Select:model")}),fe=u=>S(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 S,u,A,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((S=k.label)!=null?S:""),options:k.options};const Ue=(u=k.label)!=null?u:k.value!=null?String(k.value):"";return{type:"option",label:String(Ue),value:(xe=(A=k.value)!=null?A: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),A=[],xe=[];for(const Ue of u)if(Ue.type==="group"){A.push({type:"group",label:Ue.label});const et=(Ue.options||[]).map($).filter(Boolean).filter(G=>G.type==="option");for(const G of et)A.push(G),xe.push(G)}else A.push(Ue),xe.push(Ue);X(A),_e(xe)}async function oe(){const k=t.options;let S;try{const u=typeof k=="function"?JSswift.ui.withoutRodPathCapture(()=>k()):k;u&&typeof u.then=="function"?(W(!0),S=await u):S=u,re(S)}catch(u){console.error("[UI.Select] options load error:",u),re([])}finally{W(!1)}}function Se(k){var u;const S=b(k);he(S),fe&&fe(S),(u=t.onChange)==null||u.call(t,S)}function F(k){const S=r(Z()),A=S.some(xe=>xe==k)?S.filter(xe=>xe!=k):[...S,k];Se(A)}function p(k,S=!1){s?(F(k),S&&f()):(Se(k),h())}function f(){le(""),ve&&(ve.value="")}function h(){v(!1),f(),me(-1)}async function B(){if(ce())return;v(!0),await oe();const k=Z(),S=de();let u=-1;if(s){const A=r(k);for(const xe of A)if(u=S.findIndex(Ue=>Ue.value==xe&&!Ue.disabled),u>=0)break}else u=S.findIndex(A=>A.value==k&&!A.disabled);u<0&&(u=S.findIndex(A=>!A.disabled)),me(u),ve&&setTimeout(()=>ve.focus(),0)}function ie(){C()?h():B()}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=de();if(x.innerHTML="",s){const S=r(Z());for(const u of S){const A=k.find(G=>G.value==u),xe=A?A.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,F(u))}});x.appendChild(et)}}else{const S=Z(),u=k.find(A=>A.value==S);x.textContent=u?u.label:S==null||S===""?"":String(S)}},"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(S=>g.appendChild(S))},"UI.Select:arrow");const P=_.div({class:"cms-select-control",onClick:ie},x,g),q=_.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 E=_.input({class:"cms-input",type:"text",placeholder:t.filterPlaceholder||"Cerca...",onInput:k=>le(k.target.value||"")}),m=()=>{const k=JSswift.ui.renderSlot(c,"filter",{value:T(),setValue:u=>{const A=u==null?"":String(u);le(A),ve&&"value"in ve&&(ve.value=A)},close:h},E);Q.innerHTML="";const S=J(null,"default",{},k);S.forEach(u=>Q.appendChild(u)),ve=S.length===1&&S[0]&&S[0].tagName==="INPUT"?S[0]:null,ve&&(ve.value=T()||"")};JSswift.reactive.untracked(m),JSswift.reactive.effect(()=>{const k=T()||"";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 N={...t};wn(N);const I=Ct([N.color,N.state],()=>{const k=o(N.color)||o(N.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(k)?k:o(N.state)||""}),K=_.div({class:te(["cms-select-menu","cms-singularity-menu-select",I,N.class,ye(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:k=>k.stopPropagation()},Q,q);let ke=0,Oe=!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(),S=6,u=8,A=Math.max(160,window.innerWidth-u*2),xe=Math.min(Math.max(k.width,180),A),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-S-u,Ge=k.top-S-u;let tt=G<180&&Ge>G?k.top-S-et:k.bottom+S;tt=Math.max(u,Math.min(tt,window.innerHeight-et-u)),K.style.top=`${tt}px`}))},U=()=>{Oe||(Oe=!0,window.addEventListener("resize",Te),window.addEventListener("scroll",Te,!0))},j=()=>{Oe&&(Oe=!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(P),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 S;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&&((S=He[k])==null||S.scrollIntoView({block:"nearest"})))}JSswift.reactive.effect(()=>{const k=se(),S=de(),u=(T()||"").toLowerCase().trim(),A=Z(),xe=s?r(A):[A],Ue=H(),et=$e;q.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?F(tt.value):(Se(tt.value),h())},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=S.filter(dt=>dt.label.toLowerCase().includes(u));if(tt.length===0){const dt=JSswift.ui.renderSlot(c,"empty",{filter:u},t.emptyText||"Nessuna opzione");q.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");q.appendChild(_.div({class:"cms-select-empty"},...J(null,"default",{},dt))),C()&&Te();return}}if(Ue){const tt=JSswift.ui.renderSlot(c,"loading",{},"Caricamento...");q.appendChild(_.div({class:"cms-select-empty"},...J(null,"default",{},tt))),C()&&Te();return}for(const tt of G)q.appendChild(tt);Ee(),C()&&Te()},"UI.Select:render"),JSswift.reactive.effect(()=>{Ee()},"UI.Select:paintActive");const De=k=>{if(!a.isConnected)return;const S=k.target;a.contains(S)||K.contains(S)||h()};document.addEventListener("click",De,!0);const Ie=k=>{if(ce())return;const S=C(),u=de(),A=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"){S&&(k.preventDefault(),h());return}if(xe&&(k.key==="Enter"||k.key===" ")){const G=(T()||"").trim();if(G){const Ge=et(G);if(Ge){k.preventDefault(),p(Ge.value,!0);return}if(i&&k.key==="Enter"){k.preventDefault(),p(G,!0);return}if(k.key==="Enter"){k.preventDefault();return}}if(k.key===" ")return}if(k.key==="Enter"||k.key===" "){if(k.preventDefault(),!S){B();return}A>=0&&u[A]&&!u[A].disabled&&(s?F(u[A].value):(Se(u[A].value),h()));return}if(k.key==="ArrowDown"){if(k.preventDefault(),!S){B();return}const G=Ue(A<0?0:A+1,1);G>=0&&me(G);return}if(k.key==="ArrowUp"){if(k.preventDefault(),!S){B();return}const G=Ue(A<0?u.length-1:A-1,-1);G>=0&&me(G);return}if(k.key==="Home"){if(!S)return;k.preventDefault();const G=Ue(0,1);G>=0&&me(G);return}if(k.key==="End"){if(!S)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:de().some(S=>S.value==="")},z=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),h())},onFocus:()=>{B()}});return JSswift.reactive.effect(()=>{var k;(k=z._refresh)==null||k.call(z)},"UI.Select:fieldRefresh"),nn(z,a,t),z._select=a,z._dispose=a._dispose,(M=JSswift._registerCleanup)==null||M.call(JSswift,z,z._dispose),it(z,t,{isEnabled:()=>!ce(),action:()=>{if(ce())return!1;Me(a),B()}}),oe(),z},Ne.Upload=(t={})=>{var Be;wn(t);const e=t.slots||{},[n,s]=JSswift.reactive.signal([]),[i,c]=JSswift.reactive.signal(!1),[w,d]=JSswift.reactive.signal(!1),[r,b]=JSswift.reactive.signal(null);let O=0,C=!1;const v=()=>!!o(t.disabled)||!!o(t.readonly),T=()=>t.multiple!==!1&&t.single!==!0,le=()=>{var z,Pe;return["form","native","submit","external"].includes(String(o((Pe=(z=t.submitMode)!=null?z:t.modeSubmit)!=null?Pe:t.uploadMode)||"").toLowerCase())},Z=()=>{var z;return o((z=t.showBrowse)!=null?z:t.browseButton)!==!1},he=()=>{var z;return!le()&&o((z=t.showUpload)!=null?z:t.uploadButton)!==!1},H=()=>{var z;return o((z=t.showClear)!=null?z:t.clearButton)!==!1},W=()=>{var z;return o((z=t.showFiles)!=null?z:t.files)!==!1},se=()=>{const z=Vt(o(t.state)||o(t.status));return z?`cms-state-${z}`:""},X=()=>t.fieldName||t.paramName||t.name||"file",de=()=>{var z;return Math.max(1,Number(o((z=t.parallelUploads)!=null?z:t.parallel)||1))},_e=()=>{var Pe,M,k,S;const z=o(t.retry);return z===!0?{attempts:2,delay:350,factor:2}:z?{attempts:Math.max(0,Number((M=(Pe=z.attempts)!=null?Pe:z.retries)!=null?M:0)),delay:Math.max(0,Number((k=z.delay)!=null?k:350)),factor:Math.max(1,Number((S=z.factor)!=null?S:2))}:{attempts:0,delay:350,factor:2}},be=z=>z?Array.isArray(z)?z:Array.from(z):[],me=z=>{const Pe=Number(z||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`},fe=()=>{var z;return String(o((z=t.acceptedFiles)!=null?z:t.accept)||"").trim()},ce=z=>{const Pe=fe();if(!Pe)return!0;const M=String(z.name||"").toLowerCase(),k=String(z.type||"").toLowerCase();return Pe.split(",").map(S=>S.trim().toLowerCase()).filter(Boolean).some(S=>S.startsWith(".")?M.endsWith(S):S.endsWith("/*")?k.startsWith(S.slice(0,-1)):k===S)},$=()=>n().filter(z=>z.status!=="rejected"&&z.status!=="removed"),re=(z=0)=>$().reduce((Pe,M)=>Pe+Number(M.size||0),z),oe=()=>{var z;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")),(z=t.onChange)==null||z.call(t,n().slice(),ne)},Se=(z,Pe,M=null)=>{var S;const k={id:`upload_${Date.now()}_${++O}`,file:z,name:(z==null?void 0:z.name)||"file",size:Number((z==null?void 0:z.size)||0),type:(z==null?void 0:z.type)||"",status:"rejected",progress:0,error:Pe,detail:M,attempts:0,response:null,xhr:null};return n().push(k),(S=t.onRejected)==null||S.call(t,k,{reason:Pe,detail:M,api:ne}),k},F=async(z,Pe)=>{const M=t.maxFiles==null?null:Number(o(t.maxFiles)),k=t.maxFileSize==null?null:Number(o(t.maxFileSize)),S=t.minFileSize==null?null:Number(o(t.minFileSize)),u=t.maxTotalSize==null?null:Number(o(t.maxTotalSize));if(M!=null&&Pe>M)return"max-files";if(k!=null&&Number(z.size||0)>k)return"max-file-size";if(S!=null&&Number(z.size||0)<S)return"min-file-size";if(u!=null&&re(Number(z.size||0))>u)return"max-total-size";if(!ce(z))return"accept";const A=t.filter||t.acceptFile||t.validate;if(typeof A=="function"){const xe=await A(z,{files:n().slice(),api:ne});if(xe===!1)return"filter";if(typeof xe=="string")return xe}return null},p=async()=>{for(const z of n()){if(z.status!=="rejected"||z.error!=="max-files")continue;const Pe=await F(z.file,$().length+1);if(Pe){z.error=Pe;continue}z.status="queued",z.progress=0,z.error=null,z.detail=null}},f=z=>({id:`upload_${Date.now()}_${++O}`,file:z,name:(z==null?void 0:z.name)||"file",size:Number((z==null?void 0:z.size)||0),type:(z==null?void 0:z.type)||"",status:"queued",progress:0,bytesUploaded:0,error:null,detail:null,attempts:0,response:null,xhr:null}),h=async(z,Pe={})=>{var S;if(v())return[];b(null);const M=be(z),k=[];!T()&&M.length&&B({silent:!0});for(const u of M){const A=await F(u,$().length+1);if(A){Se(u,A);continue}const xe=f(u);if(n().push(xe),k.push(xe),(S=t.onAdded)==null||S.call(t,xe,{file:u,meta:Pe,api:ne}),!T())break}return oe(),k.length&&t.autoUpload&&!le()&&m(),k},B=(z={})=>{var Pe;for(const M of n())M.status==="uploading"&&a(M),M.status="removed";s([]),b(null),oe(),z.silent||(Pe=t.onClear)==null||Pe.call(t,ne)},ie=async z=>{var k;const Pe=typeof z=="string"?n().find(S=>S.id===z):z;if(!Pe)return;Pe.status==="uploading"&&a(Pe);const M=n().filter(S=>S!==Pe);s(M),await p(),oe(),(k=t.onRemove)==null||k.call(t,Pe,{api:ne})},a=z=>{var M,k,S;const Pe=typeof z=="string"?n().find(u=>u.id===z):z;!Pe||Pe.status!=="uploading"||(Pe.status="canceled",Pe.error="canceled",(k=(M=Pe.xhr)==null?void 0:M.abort)==null||k.call(M),(S=t.onCancel)==null||S.call(t,Pe,{api:ne}),oe())},x=()=>n().filter(z=>z.status==="uploading").forEach(a),g=async z=>{var M,k;const Pe={url:o(t.url),method:o(t.method||"POST"),headers:t.headers,formFields:t.formFields||t.fields,fieldName:X(),withCredentials:!!o((M=t.withCredentials)!=null?M:t.credentials),sendRaw:!!o(t.sendRaw)};if(typeof t.factory=="function")try{const S=await t.factory(z.file,{item:z,files:n().slice(),api:ne});if(S&&typeof S=="object")Object.assign(Pe,S);else if(S!=null)throw new Error("factory must return an object")}catch(S){throw(k=t.onFactoryFailed)==null||k.call(t,S,{item:z,api:ne}),S}return Pe},P=(z,Pe,M)=>{const k=typeof Pe=="function"?Pe(M.file,{item:M,api:ne}):Pe;k&&(k instanceof Headers?k.forEach((S,u)=>z.setRequestHeader(u,S)):Array.isArray(k)?k.forEach(S=>{Array.isArray(S)?z.setRequestHeader(S[0],S[1]):S!=null&&S.name&&z.setRequestHeader(S.name,S.value)}):typeof k=="object"&&Object.keys(k).forEach(S=>z.setRequestHeader(S,k[S])))},q=(z,Pe,M)=>{const k=typeof Pe=="function"?Pe(M.file,{item:M,api:ne}):Pe;k&&(Array.isArray(k)?k.forEach(S=>{Array.isArray(S)?z.append(S[0],S[1]):S!=null&&S.name&&z.append(S.name,S.value)}):typeof k=="object"&&Object.keys(k).forEach(S=>z.append(S,k[S])))},Q=(z,Pe)=>new Promise((M,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 S=new XMLHttpRequest;z.xhr=S,S.open(String(Pe.method||"POST").toUpperCase(),Pe.url,!0),S.withCredentials=!!Pe.withCredentials,P(S,Pe.headers,z),S.upload.onprogress=A=>{var xe;A.lengthComputable&&(z.bytesUploaded=A.loaded,z.progress=Math.max(0,Math.min(100,Math.round(A.loaded/A.total*100))),(xe=t.onProgress)==null||xe.call(t,z,{event:A,api:ne}),oe())},S.onload=()=>{const A=S.status>=200&&S.status<300,xe={status:S.status,text:S.responseText,xhr:S};A?M(xe):k(Object.assign(new Error(`HTTP error ${S.status}`),{response:xe}))},S.onerror=()=>k(new Error("network-error")),S.onabort=()=>k(new Error("canceled"));const u=Pe.sendRaw?z.file:(()=>{const A=new FormData;return q(A,Pe.formFields,z),A.append(Pe.fieldName||"file",z.file,z.name),A})();S.send(u)}),ve=async z=>{var k,S,u,A,xe,Ue;const Pe=_e();let M=Pe.delay;z.status="uploading",z.error=null,z.progress=Math.max(0,z.progress||0),(k=t.onStart)==null||k.call(t,z,{api:ne}),oe();for(let et=0;et<=Pe.attempts;et++){z.attempts=et+1;try{const G=await g(z),Ge=typeof t.upload=="function"||typeof t.uploader=="function"?await(t.upload||t.uploader)(z.file,{item:z,options:G,progress:lt=>{var tt;z.progress=Math.max(0,Math.min(100,Number(lt)||0)),(tt=t.onProgress)==null||tt.call(t,z,{api:ne}),oe()},api:ne}):await Q(z,G);return z.status="done",z.progress=100,z.response=Ge,z.xhr=null,(S=t.onSuccess)==null||S.call(t,z,{response:Ge,api:ne}),(u=t.onComplete)==null||u.call(t,z,{response:Ge,api:ne}),oe(),z}catch(G){if(String((G==null?void 0:G.message)||G)==="canceled"||z.status==="canceled")return z.status="canceled",z.error="canceled",z.xhr=null,(A=t.onComplete)==null||A.call(t,z,{error:G,api:ne}),oe(),z;if(et<Pe.attempts){await new Promise(Ge=>setTimeout(Ge,M)),M=Math.round(M*Pe.factor);continue}return z.status="error",z.error=G,z.xhr=null,b(G),(xe=t.onError)==null||xe.call(t,z,{error:G,api:ne}),(Ue=t.onComplete)==null||Ue.call(t,z,{error:G,api:ne}),oe(),z}}return z},E=()=>{var k;if(C||v())return;const z=n().filter(S=>S.status==="uploading").length,Pe=Math.max(0,de()-z),M=n().filter(S=>S.status==="queued").slice(0,Pe);if(!M.length){const S=n().some(u=>u.status==="uploading");d(S),S||(k=t.onFinish)==null||k.call(t,n().slice(),{api:ne});return}d(!0),M.forEach(S=>{ve(S).finally(()=>E())})},m=(z=null)=>{(z?be(z):n().filter(M=>["queued","error","canceled"].includes(M.status))).forEach(M=>{const k=typeof M=="string"?n().find(S=>S.id===M):M;k&&k.status!=="uploading"&&k.status!=="done"&&k.status!=="rejected"&&(k.status="queued",k.progress=0,k.error=null)}),oe(),E()},N=z=>m([z]),I=()=>{v()||K.click()},K=_.input({type:"file",class:"cms-upload-input",name:X(),accept:fe()||null,multiple:T(),capture:t.capture||null,disabled:v(),onChange:z=>{h(z.target.files,{event:z,source:"browse"}),z.target.value=""}}),ke=_.div({class:"cms-upload-list"}),Oe=_.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:v()?"-1":"0",role:"group","aria-disabled":v()?"true":"false"}),ne={addFiles:h,browse:I,upload:m,retry:N,retryAll:()=>m(n().filter(z=>z.status==="error"||z.status==="canceled")),remove:ie,clear:B,abort:a,abortAll:x,files:()=>n().slice(),state:()=>({files:n().slice(),busy:w(),dragging:i(),error:r()}),reset:B},Ve=()=>{const z={api:ne,files:n().slice(),busy:w(),disabled:v(),submitMode:le()?"form":"upload"},Pe=[];return Z()&&Pe.push(JSswift.ui.renderSlot(e,"browse",z,Ne.Btn({size:"sm",icon:"folder_open",label:t.browseText||"Browse",onClick:I}))),he()&&Pe.push(JSswift.ui.renderSlot(e,"upload",z,Ne.Btn({size:"sm",color:"primary",icon:"upload",label:t.uploadText||"Upload",loading:w(),disabled:v()||!n().some(M=>["queued","error","canceled"].includes(M.status)),onClick:()=>m()}))),H()&&Pe.push(JSswift.ui.renderSlot(e,"clear",z,Ne.Btn({size:"sm",color:"secondary",outline:!0,icon:"delete",label:t.clearText||"Clear",disabled:v()||!n().length,onClick:()=>B()}))),J(e,"actions",z,Pe)},He=(z,Pe)=>{var u;const M={item:z,file:z.file,index:Pe,api:ne,remove:()=>ie(z),retry:()=>N(z),abort:()=>a(z)},k=_.div({class:te(["cms-upload-file",`is-${z.status}`])},_.div({class:"cms-upload-file-icon"},Ne.Icon({name:z.status==="done"?"check_circle":z.status==="error"||z.status==="rejected"?"error":"description"})),_.div({class:"cms-upload-file-main"},_.div({class:"cms-upload-file-name"},...J(e,"fileName",M,z.name)),_.div({class:"cms-upload-file-meta"},...J(e,"fileMeta",M,z.error?String(((u=z.error)==null?void 0:u.message)||z.error):z.status==="queued"?"Queued":z.status)),_.div({class:"cms-upload-progress",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":String(z.progress||0)},_.div({class:"cms-upload-progress-bar",style:{width:`${z.progress||0}%`}}))),_.div({class:"cms-upload-file-trailing"},_.div({class:"cms-upload-file-size"},me(z.size)),_.div({class:"cms-upload-file-actions"},...J(e,"fileActions",M,[z.status==="uploading"?Ne.Btn({size:"sm",outline:!0,icon:"close","aria-label":"Cancel",onClick:()=>a(z)}):null,z.status==="error"||z.status==="canceled"?Ne.Btn({size:"sm",outline:!0,icon:"refresh","aria-label":"Retry",onClick:()=>N(z)}):null,Ne.Btn({size:"sm",dense:!0,outline:!0,icon:"delete","aria-label":"Remove",onClick:()=>ie(z)})])))),S=JSswift.ui.renderSlot(e,"file",M,k);return _.div({class:"cms-upload-file-wrap","data-status":z.status,"data-id":z.id},...J(null,"default",{},S))},ae=()=>{const z=n();if(Te.replaceChildren(...Ve()),ke.replaceChildren(),Oe.hidden=!W(),ke.hidden=!W(),z.length)z.forEach((M,k)=>ke.appendChild(He(M,k)));else{const M=JSswift.ui.renderSlot(e,"empty",{api:ne},t.emptyText||"No files selected");ke.appendChild(_.div({class:"cms-upload-empty"},...J(null,"default",{},M)))}const Pe=z.filter(M=>M.status!=="rejected"&&M.status!=="removed");Oe.textContent=`${Pe.length} file \u2022 ${me(Pe.reduce((M,k)=>M+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||(fe()?`Accepted: ${fe()}`:"Drag files here or browse from your device")),Ie=_.div({class:"cms-upload-dropzone",onClick:z=>{var Pe,M;(M=(Pe=z.target)==null?void 0:Pe.closest)!=null&&M.call(Pe,".cms-upload-actions, .cms-upload-list")||t.clickable!==!1&&I()},onDragenter:z=>{t.drag===!1||v()||(z.preventDefault(),c(!0),j.classList.add("is-dragging"))},onDragover:z=>{t.drag===!1||v()||z.preventDefault()},onDragleave:z=>{z.currentTarget===z.target&&(c(!1),j.classList.remove("is-dragging"))},onDrop:z=>{var Pe,M;t.drag===!1||v()||(z.preventDefault(),c(!1),j.classList.remove("is-dragging"),(Pe=t.onDrop)==null||Pe.call(t,z,{api:ne}),h(((M=z.dataTransfer)==null?void 0:M.files)||[],{event:z,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),Oe,ke),qe=JSswift.ui.renderSlot(e,"header",{api:ne},null);return J(null,"default",{},qe).forEach(z=>j.appendChild(z)),j.appendChild(K),J(e,"default",{api:ne,dropzone:Ie},Ie).forEach(z=>j.appendChild(z)),JSswift.reactive.effect(()=>{ae()},"UI.Upload:render"),JSswift.reactive.effect(()=>{j.classList.toggle("is-disabled",v()),j.classList.toggle("is-form-mode",le()),j.classList.toggle("is-files-hidden",!W());const z=se();z!==U&&(U&&j.classList.remove(U),z&&j.classList.add(z),U=z),j.setAttribute("aria-disabled",v()?"true":"false"),K.disabled=v(),K.multiple=T(),K.name=X()},"UI.Upload:disabled"),j._upload=ne,j._addFiles=h,j._browse=I,j._uploadFiles=m,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 en(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 $s={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"]}},vn=t=>{const e=o(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},gn=(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=[],O=[...t.rows||[]];if(c&&s==="top"&&!O.includes("nav")){const C=O.indexOf("body");O.splice(C>=0?C:O.length,0,"nav")}for(const C of O)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,w=()=>{const Xe=c(),ht=JSswift.uiResponsivePropsFor(e,xt("mobile"))||{},Mt=Xe>=768?JSswift.uiResponsivePropsFor(e,xt("tablet"))||{}:{},Kt=Xe>=1024?JSswift.uiResponsivePropsFor(e,xt("pc"))||{}:{};return{...ht,...Mt,...Kt}},d=(...Xe)=>{for(const ht of Xe)if(i(e,ht))return e[ht]},r=(...Xe)=>{const ht=w();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)},O=()=>vn(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:""},v=(Xe,ht=null)=>Xe==null||Xe===!1||Xe===""?ht:typeof Xe=="number"?`${Xe}px`:String(Xe),T=(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 Kt=Number.isFinite(Xe)?Xe:0;return Number.isFinite(ht)&&(Kt=Math.max(ht,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"),de=()=>o(r("drawerEnabled","asideEnabled")),_e=()=>o(r("navEnabled","asideRightEnabled","rightAsideEnabled")),be=()=>de()!==!1,me=()=>_e()===!0||o(r("noNav"))===!1,fe=()=>o(r("noDrawer"))===!0||de()===!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,F=()=>T(o(r("drawerMinWidth")),180),p=()=>T(o(r("drawerMaxWidth")),null),f=()=>T(o(r("navMinWidth")),180),h=()=>T(o(r("navMaxWidth")),null),B=T(o(r("drawerWidth")),280),ie=T((ms=o(r("navWidth")))!=null?ms:o(r("asideRightWidth")),280),[a,x]=JSswift.reactive.signal(Z(B,F(),p())),[g,P]=JSswift.reactive.signal(Z(ie,f(),h())),q=en(e.drawerOpen,"UI.Layout:drawerOpen"),Q=q?!!q.get():typeof e.drawerOpen=="boolean"?!!e.drawerOpen:!0,[ve,E]=JSswift.reactive.signal(Q),m=Xe=>{const ht=!!Xe;ve()!==ht&&E(ht),q==null||q.set(ht)};(ts=q==null?void 0:q.watch)==null||ts.call(q,()=>{const Xe=!!q.get();ve()!==Xe&&E(Xe)});const N=en(e.navOpen,"UI.Layout:navOpen"),I=N?!!N.get():typeof e.navOpen=="boolean"?!!e.navOpen:!0,[K,ke]=JSswift.reactive.signal(I),Oe=Xe=>{const ht=!!Xe;K()!==ht&&ke(ht),N==null||N.set(ht)};(ns=N==null?void 0:N.watch)==null||ns.call(N,()=>{const Xe=!!N.get();K()!==Xe&&ke(Xe)});const Te=()=>{var Kt,Zt,tn;const Xe=Number((Kt=o(r("layoutBreakpoint")))!=null?Kt:0),ht=Number((Zt=o(r("drawerBreakpoint")))!=null?Zt: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:()=>m(!0),closeAside:()=>m(!1),toggleAside:()=>m(!ve()),openNav:()=>Oe(!0),closeNav:()=>Oe(!1),toggleNav:()=>Oe(!K()),isDrawerOpen:()=>!!ve(),isNavOpen:()=>!!K(),isMobile:()=>!!j(),isDrawerFloating:()=>$(),isNavFloating:()=>re()}),Ee=(Xe,ht)=>{const Mt=$e();for(const Zt of Xe){if(!i(s,Zt))continue;const tn=typeof s[Zt]=="function"?s[Zt](Mt):s[Zt];return J(null,"default",Mt,tn)}const Kt=typeof ht=="function"?ht(Mt):ht;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"},M=_.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])}),S=_[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"}),A=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-drawer","aria-hidden":"true"});S.appendChild(u),S.appendChild(A);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])});M.appendChild(k),M.appendChild(S),M.appendChild(G),M.appendChild(xe),M.appendChild(Ge),Be.appendChild(M);const lt=_.div({class:te(["cms-aside-overlay",e.overlayClass]),onClick:()=>{o(r("overlayClose"))!==!1&&(ve()&&m(!1),K()&&Oe(!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)},Yt=()=>{const Xe=tt?k.getBoundingClientRect().height:0;Be.style.setProperty("--layout-header-height",`${Xe}px`)},Xt=(Xe,ht)=>(Ft(Xe),ht.forEach(Mt=>Xe.appendChild(Mt)),ht.length>0),on=()=>{var Kt,Zt,tn,un,ln,y;Be.style.setProperty("--cms-layout-drawer-width",v((Kt=o(r("drawerWidth")))!=null?Kt:280,"280px")),Be.style.setProperty("--cms-layout-nav-width",v((tn=(Zt=o(r("navWidth")))!=null?Zt:o(r("asideRightWidth")))!=null?tn:280,"280px")),Be.style.setProperty("--cms-layout-drawer-peek",v((un=o(r("drawerPeek")))!=null?un:20,"20px")),Be.style.setProperty("--cms-layout-nav-peek",v((y=(ln=o(r("navPeek")))!=null?ln:o(r("asideRightPeek")))!=null?y:20,"20px"));const Xe=v(o(r("gap")),null);Xe!=null?Be.style.setProperty("--cms-layout-gap",Xe):Be.style.removeProperty("--cms-layout-gap");const ht=v(o(r("headerOffset")),null);ht!=null&&Be.style.setProperty("--layout-header-height",ht);const Mt=v(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(),F(),p());Xe!==a()&&x(Xe),Be.style.setProperty("--cms-layout-drawer-width",`${Xe}px`)}if(Se()){const Xe=Z(g(),f(),h());Xe!==g()&&P(Xe),Be.style.setProperty("--cms-layout-nav-width",`${Xe}px`)}},Qt=(Xe,ht)=>{if(ht.button!==0)return;const Mt=Xe==="drawer"?S:xe;if(Mt.hidden)return;const Kt=Xe==="drawer"?a:g,Zt=Xe==="drawer"?x:P,tn=Xe==="drawer"?F:f,un=Xe==="drawer"?p:h,ln=Mt.getBoundingClientRect(),y=ln.width||Kt(),ue=ot=>{const rt=Xe==="drawer"?ot.clientX-ln.left:ln.right-ot.clientX;Zt(Z(rt||y,tn(),un())),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,ht.preventDefault()},an=Xe=>Qt("drawer",Xe),mn=Xe=>Qt("nav",Xe);A.addEventListener("pointerdown",an),et.addEventListener("pointerdown",mn);const Gt=()=>{const Xe=!!j(),ht=!!ve(),Mt=!!K(),Kt=!fe()&&be()&&dt,Zt=!ce()&&me()&&St,tn=Kt&&(Xe||$()),un=Zt&&(Xe||re()),ln=Kt&&ht,y=Zt&&Mt,ue=ln&&!tn,Je=y&&!un,ot=ue&&oe(),rt=Je&&Se(),at=ln&&tn||y&&un;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",!Zt),Be.classList.toggle("has-header",tt),Be.classList.toggle("has-drawer",Kt),Be.classList.toggle("has-nav",Zt),Be.classList.toggle("has-footer",Rt),Be.classList.toggle("drawer-floating",tn),Be.classList.toggle("nav-floating",un);const mt=O(),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),S.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||un),lt.classList.toggle("show",at),S.hidden=!Kt||!ln&&!tn,S.classList.toggle("open",ln),S.classList.toggle("is-floating",tn),S.classList.toggle("is-resizable",ot),S.setAttribute("aria-hidden",ln?"false":"true"),A.hidden=!ot,xe.hidden=!Zt||!y&&!un,xe.classList.toggle("open",y),xe.classList.toggle("is-floating",un),xe.classList.toggle("is-resizable",rt),xe.setAttribute("aria-hidden",y?"false":"true"),et.hidden=!rt;const Ht=$s[mt]||null,sn=(Ht==null?void 0:Ht.side)||(ue&&Ht?"left":null),dn=(Ht==null?void 0:Ht.nav)||(Je&&Ht?"top":null),Pn=ue?Ht?sn:"left":"",Sn=Je?Ht?dn==="left"||dn==="right"?dn:"":"right":"";Be.classList.toggle("drawer-left",Kt&&sn==="left"),Be.classList.toggle("drawer-right",Kt&&sn==="right"),Be.classList.toggle("nav-top",Je&&dn==="top"),Be.classList.toggle("nav-side",Je&&(Sn==="left"||Sn==="right")),M.style.gridTemplateColumns=[Pn==="left"?"minmax(0, var(--cms-layout-drawer-width))":Sn==="left"?"minmax(0, var(--cms-layout-nav-width))":"0px","minmax(0, 1fr)",Pn==="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=gn($s[mt],{header:tt,aside:ue,nav:Je,main:It,footer:Rt});M.style.gridTemplateAreas=le(b("areas","gridTemplateAreas","templateAreas"))||ss||hn},Tn=(Xe,ht)=>(tt=Xt(k,Dt(Xe)),Yt(),Gt(),ht&&JSswift.router.setURLOnly(ht),k),An=(Xe,ht)=>(dt=Xt(u,Dt(Xe)),dt||m(!1),Gt(),ht&&JSswift.router.setURLOnly(ht),S),rn=(Xe,ht)=>(St=Xt(Ue,Dt(Xe)),St||Oe(!1),Gt(),ht&&JSswift.router.setURLOnly(ht),xe),Vn=(Xe,ht)=>(It=Xt(G,Dt(Xe)),Gt(),ht&&JSswift.router.setURLOnly(ht),G),cn=(Xe,ht)=>(Rt=Xt(Ge,Dt(Xe)),Gt(),ht&&JSswift.router.setURLOnly(ht),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 fs=Xe=>{o(r("escClose"))!==!1&&(!j()&&!$()&&!re()||!ve()&&!K()||Xe.key==="Escape"&&(Xe.preventDefault(),ve()&&m(!1),K()&&Oe(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",fs,!0),Be.openAside=()=>m(!0),Be.closeAside=()=>m(!1),Be.toggleAside=()=>m(!ve()),Be.openNav=()=>Oe(!0),Be.closeNav=()=>Oe(!1),Be.toggleNav=()=>Oe(!K()),Be.isDrawerOpen=()=>!!ve(),Be.isNavOpen=()=>!!K(),Be.isMobile=()=>!!j(),Be.header=()=>k,Be.aside=()=>S,Be.drawer=()=>S,Be.nav=()=>xe,Be.page=()=>G,Be.main=()=>G,Be.footer=()=>Ge,Be.headerUpdate=Tn,Be.asideUpdate=An,Be.drawerUpdate=An,Be.navUpdate=rn,Be.pageUpdate=Vn,Be.mainUpdate=Vn,Be.footerUpdate=cn,Be.reflow=Gt,Be._dispose=()=>{var Xe;typeof window!="undefined"&&window.removeEventListener("resize",ae),typeof document!="undefined"&&document.removeEventListener("keydown",fs,!0),A.removeEventListener("pointerdown",an),et.removeEventListener("pointerdown",mn),st==null||st(),(Xe=Pt==null?void 0:Pt.disconnect)==null||Xe.call(Pt)},Nt(Be,e),Gt(),Be},Ne.Footer=(...t)=>{var Se,F,p;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=f=>Object.prototype.hasOwnProperty.call(e,f),c={props:e},w=(f,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(B=>w(f,B));return}if(h!=null&&h.nodeType){f.appendChild(h);return}f.appendChild(document.createTextNode(String(h)))}},d=(f,h,B=ie=>ie)=>{const ie=JSswift.ui.getSlot(s,f);if(ie!=null)return J(s,f,c,null);if(typeof h=="function"){const a=new Set(["eyebrow","title","subtitle"]),x=_[a.has(f)?"span":"div"]({class:`cms-footer-slot-${f}`});return JSswift.reactive.effect(()=>{const g=B(h(c)),P=xn(JSswift.ui.slot(g));x.replaceChildren(),Array.isArray(P)?P.forEach(q=>w(x,q)):w(x,P)},`UI.Footer:${f}`),[x]}return J(s,f,c,B(h))},r=(f,h="icon",B=e.iconSize||e.size||"md")=>f==null||f===!1?null:typeof f=="string"?Ne.Icon({name:f,size:B}):JSswift.ui.slot(f,{as:h}),b=i("left")?e.left:e.start,O=i("right")?e.right:e.end,C=i("title")?e.title:e.label,v=(F=(Se=e.subtitle)!=null?Se:e.description)!=null?F:e.note,T=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",(p=e.eyebrow)!=null?p:e.kicker),H=d("title",C),W=d("subtitle",v),se=d("meta",e.meta),X=(()=>{const f=d("content",null);return f.length?f:d("default",T)})(),de=[...d("center",null),...d("body",null)],_e=[...d("right",O),...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)),fe=[];de.length?fe.push(_.div({class:te(["cms-footer-body",e.bodyClass,e.centerClass])},...de)):(Z.length||he.length||H.length||W.length||X.length||se.length)&&fe.push(me),(_e.length||be.length)&&fe.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,f=>f?"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)]:[],...fe.length?[_.div({class:"cms-footer-main"},...fe)]:[]);return Nt(oe,e),oe};const On=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},Vs=(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 h,B,ie,a,x,g,P,q;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(Q,ve,E={})=>{const m=Array.isArray(Q)?Q:[Q];for(const N of m)if(JSswift.ui.getSlot(s,N)!=null)return J(s,N,E,ve);return ve==null?[]:J(null,"default",E,ve)},c=Q=>(Array.isArray(Q)?Q:[Q]).some(E=>JSswift.ui.getSlot(s,E)!=null),w={props:e},d=i(["before"],e.before,w),r=i(["start","left"],(h=e.start)!=null?h:e.left,w),b=i(["center","body","content","default"],(a=(ie=(B=e.center)!=null?B:e.body)!=null?ie:e.content)!=null?a:n,w),O=i(["end","right","actions"],(g=(x=e.end)!=null?x:e.right)!=null?g:e.actions,w),C=i(["after"],e.after,w),v=i(["title"],e.title,w),T=i(["subtitle"],e.subtitle,w),le=i(["meta"],e.meta,w),Z=!!(d.length||r.length||O.length||C.length||v.length||T.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),de=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"},fe=Ke(e.size,Q=>me[Q]||"");if(fe!=null&&(W.padding=fe),Z?(W.flexDirection=W.flexDirection||"column",W.alignItems=W.alignItems||"stretch"):(se!=null&&(W.alignItems=se),X!=null&&(W.justifyContent=X),de!=null&&(W.flexWrap=de)),Object.keys(W).length&&(H.style=W),JSswift.uiApplyResponsiveProps(H,e,JSswift.uiResponsiveStyleRules),!Z){const Q=J(s,"default",w,n),ve=_.div(H,...Q);return Nt(ve,e),ve}const ce=(q=(P=e.bodyClass)!=null?P:e.centerClass)!=null?q: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),de!=null&&(oe.flexWrap=de);const Se=le.length||v.length||T.length?_.div({class:te(["cms-toolbar-copy",e.copyClass])},le.length?_.div({class:te(["cms-toolbar-meta",e.metaClass])},...le):null,v.length?_.div({class:te(["cms-toolbar-title",e.titleClass])},...v):null,T.length?_.div({class:te(["cms-toolbar-subtitle",e.subtitleClass])},...T):null):null,F=!!(r.length||Se||b.length||O.length),p=[d.length?_.div({class:te(["cms-toolbar-before",e.beforeClass]),style:{...re}},...d):null,F?_.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,O.length?_.div({class:te(["cms-toolbar-end",e.endClass]),style:{...re,justifyContent:"flex-end",marginInlineStart:$}},...O):null):null,C.length?_.div({class:te(["cms-toolbar-after",e.afterClass]),style:{...re}},...C):null].filter(Boolean),f=_.div(H,...p);return Nt(f,e),f};const Fi=t=>{var e;return t&&t.nodeType===1&&((e=t.classList)==null?void 0:e.contains("cms-grid-col"))};Ne.Grid=(...t)=>{var f,h,B,ie;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=o(e.items),c=Array.isArray(i)?i:i==null?[]:[i],w=(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(Fi(a))return[a];if(Xn(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(w(a),...g)]}return Array.isArray(a)?[Ne.GridCol(w(x),...a)]:[Ne.GridCol(w(x),a)]},r=(a,x,g,P=!0)=>{if(a==null||a===!1)return[];const q=Xn(a)?a:{};if(P){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(E=>d(E,q))}return d(a,q)},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]),v=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]);v.class=C;const T={...e.style||{}};(f=JSswift.uiResponsiveHasConfig)!=null&&f.call(JSswift,e)&&e.display==null&&!Ze(e,"display")&&T.display==null&&(T.display=e.inline?"inline-grid":"grid");const le=Ke(e.gap,yt);le!=null&&!Ze(e,"gap")&&(T["--cms-grid-gap"]=le,T.gap=le);const Z=Ke(e.rowGap,yt);Z!=null&&!Ze(e,"rowGap")&&(T.rowGap=Z);const he=Ke((h=e.columnGap)!=null?h:e.colGap,yt);he!=null&&!Ze(e,["columnGap","colGap"])&&(T.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";T.gridTemplateColumns=`repeat(${a}, minmax(${W}, ${H||"1fr"}))`}else{const a=Ke((B=e.columns)!=null?B:e.cols,x=>typeof x=="number"?`repeat(${x}, minmax(0, 1fr))`:String(x));a!=null&&!Ze(e,["cols","columns"])&&(T.gridTemplateColumns=a)}const se=Ke(e.rows,a=>typeof a=="number"?`repeat(${a}, minmax(0, auto))`:String(a));se!=null&&(T.gridTemplateRows=se);const X=Ke(e.autoRows,yt);X!=null&&(T.gridAutoRows=X);const de=Ke(e.flow,a=>{const x=String(a);return e.dense&&!x.includes("dense")?`${x} dense`:x});de!=null&&!Ze(e,"flow")&&(T.gridAutoFlow=de);const _e=Ke(e.areas,a=>Array.isArray(a)?a.map(x=>`"${Array.isArray(x)?x.join(" "):String(x)}"`).join(" "):String(a));_e!=null&&(T.gridTemplateAreas=_e);const be=Ke((ie=e.align)!=null?ie:e.alignItems);be!=null&&!Ze(e,["align","alignItems"])&&(T.alignItems=be);const me=Ke(e.justify);me!=null&&!Ze(e,"justify")&&(T.justifyContent=me);const fe=Ke(e.justifyItems);fe!=null&&(T.justifyItems=fe);const ce=Ke(e.placeItems);ce!=null&&(T.placeItems=ce);const $=Ke(e.placeContent);$!=null&&(T.placeContent=$);const re=Ke(e.width,yt);re!=null&&!Ze(e,"width")&&(T.width=re),o(e.full)===!0&&(T.width="100%");const oe=Ke(e.minWidth,yt);oe!=null&&!Ze(e,"minWidth")&&(T.minWidth=oe);const Se=Ke(e.maxWidth,yt);Se!=null&&!Ze(e,"maxWidth")&&(T.maxWidth=Se);const F=Ke(e.padding,yt);F!=null&&!Ze(e,"padding")&&(T.padding=F),Object.keys(T).length&&(v.style=T),JSswift.uiApplyResponsiveProps(v,e,JSswift.uiResponsiveStyleRules);const p=_.div(v,...b);return Nt(p,e),p},Ne.GridCol=(...t)=>{var De,Ie,qe,Be,z,Pe,M,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=S=>Object.prototype.hasOwnProperty.call(e,S),c=(S,u,A={})=>{const xe=Array.isArray(S)?S:[S];for(const Ue of xe)if(JSswift.ui.getSlot(s,Ue)!=null)return J(s,Ue,A,u);return u==null?[]:J(null,"default",A,u)},w=S=>{var u;return S==null||S===!1||S===""?"":typeof S=="string"&&((u=JSswift.uiSizes)!=null&&u.includes(S))?`var(--cms-s-${S})`:yt(S)},d=S=>{var u;return S==null||S===!1||S===""?"":typeof S=="string"&&((u=JSswift.uiSizes)!=null&&u.includes(S))?ze(S,"size"):yt(S)},r={...e.style||{}},b=S=>{if(S==null||S==="")return null;if(S==="auto")return"auto";if(S==="full"||S===!0)return"1 / -1";const u=Number(S);if(Number.isFinite(u)&&u>0){const A=Math.max(1,Math.round(u));return`span ${A} / span ${A}`}return String(S)},O=S=>{if(S==null||S==="")return null;if(S==="full"||S===!0)return"1 / -1";const u=Number(S);if(Number.isFinite(u)&&u>0){const A=Math.max(1,Math.round(u));return`span ${A} / span ${A}`}return String(S)},C=i("span")?e.span:e.col,v=Ke(C,b),T=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),de=Ke(se,b),_e=Ke(e.rowSpan,O),be=Ke(e.row,O),me=Ke(e.area),fe=Ke(e.align),ce=Ke(e.justify),$=Ke(e.place),re=Ke(e.gap,w),oe=Ke(e.rowGap,w),Se=Ke(e.columnGap,w),F=Ke(e.padding,w),p=Ke(e.width,d),f=Ke(e.minHeight,d),h=Ke(e.height,d),B=Ke(e.maxHeight,d),ie=Ke(e.contentAlign),a=Ke(e.contentJustify),x=Ke(e.direction),g=Ke(e.scroll,S=>S===!0?"auto":String(S),""),P=Ke(e.fullHeight,S=>S?"100%":"",""),q=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"],(z=(Be=(qe=e.start)!=null?qe:e.top)!=null?Be:e.header)!=null?z:e.before,Q),E=i("body")?e.body:i("content")?e.content:n,m=c(["body","content","default"],E,Q),N=c(["end","bottom","footer","after"],(k=(M=(Pe=e.end)!=null?Pe:e.bottom)!=null?M:e.footer)!=null?k:e.after,Q),I=ve.length||N.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],()=>I||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"]:[]),Oe=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(q,"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=Oe,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":v!=null&&(r["--cms-grid-col-base"]=v),T!=null&&(r["--cms-grid-col-sm"]=T),le!=null&&(r["--cms-grid-col-md"]=le),Z!=null&&(r["--cms-grid-col-lg"]=Z),X!=null&&(r["--cms-grid-col-tablet"]=X),de!=null&&(r["--cms-grid-col-pc"]=de),_e!=null?r.gridRow=_e:be!=null&&(r.gridRow=be),me!=null&&(r.gridArea=me),fe!=null&&!Ze(e,"align")&&(r.alignSelf=fe),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),F!=null&&!Ze(e,"padding")&&(r.padding=F),p!=null&&!Ze(e,"width")&&(r.width=p),P!=null&&P!==""?r.height=P:h!=null&&!Ze(e,"height")&&(r.height=h),f!=null&&!Ze(e,"minHeight")&&(r.minHeight=f),B!=null&&!Ze(e,"maxHeight")&&(r.maxHeight=B),x!=null&&!Ze(e,"direction")&&(r.flexDirection=x),ie!=null&&!Ze(e,"contentAlign")?r.alignItems=ie:q!=null&&q!==""&&(r.alignItems=q?"center":""),a!=null&&!Ze(e,"contentJustify")?r.justifyContent=a:q!=null&&q!==""&&(r.justifyContent=q?"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=S=>{var A;if(U==null||U(S),S.defaultPrevented)return;const u=o(e.to);u&&((A=JSswift.router)!=null&&A.navigate)&&(S.preventDefault(),JSswift.router.navigate(u))},He=S=>{j==null||j(S),!S.defaultPrevented&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),Ve(S))};if(ne&&(Te.onClick=Ve,Te.onKeydown=He,Te.tabIndex==null&&(Te.tabIndex=0),Te.role==null&&(Te.role="button")),!I){const S=_.div(Te,...J(s,"default",Q,n));return Nt(S,e),S}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,m.length?_.div({class:te(["cms-grid-col-body",e.bodyClass,e.contentClass]),style:{...ae,flex:"1 1 auto"}},...m):null,N.length?_.div({class:te(["cms-grid-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...ae}},...N):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],w=t[1],d=fe=>fe&&typeof fe=="object"&&!fe.nodeType&&!Array.isArray(fe)&&!(fe instanceof Function);typeof c=="string"?(s=c,i=!0,d(w)?(e=w,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||{},b=o(e.size),O=o(e.color),C=String(s).endsWith("-fill"),v={...e.style||{}},T=Ct(e.size,()=>{const fe=o(e.size);return typeof fe=="string"&&cs[fe]?fe:""}),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=fe=>{const ce=Z[fe];return ce?_.svg({width:"100%",height:"100%",viewBox:ce.viewBox,fill:"none","aria-hidden":"true",focusable:"false"},...ce.paths.map($=>_.path($))):null},H=fe=>{const ce=o(e.tooltip);if(ce==null||ce===!1||!Ne.Tooltip)return fe;const $=d(ce)?{...ce}:{text:ce};return d(e.tooltipProps)&&Object.assign($,e.tooltipProps),Ne.Tooltip({...$,target:fe})},W=te(["cms-icon","material-icons",...le?["cms-clear-set","cms-singularity"]:[],T,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(v).length&&(se.style=v),typeof s=="function"||s&&typeof s=="object"){const fe=JSswift.ui.renderSlot(r,"default",{},s),ce=J(null,"default",{},fe),$=_.span({...se,"data-icon":"custom"},...ce);return Nt($,e),H($)}const X=String(s),de=X.includes("#")?X:"";let _e=null;if(de){const fe=e.spriteUrl||((be=JSswift.config)==null?void 0:be.iconSpriteUrl)||(typeof globalThis!="undefined"?(me=globalThis.JSswift_setting)==null?void 0:me.iconSpriteUrl:null),ce=de.slice(de.indexOf("#")+1),$=fe?_.svg({width:"100%",height:"100%"},_.use({href:fe+de})):he(ce)||_.svg({width:"100%",height:"100%"},_.use({href:de}));C&&($.style.fill="currentColor"),_e=_.span({...se,"data-icon":X},$,...n)}else _e=_.span({...se,"data-icon":X},X,...n);if(b!=null){let fe=b;JSswift.uiSizes.includes(b)&&(fe=`var(--cms-icon-size-${b})`),fe=typeof fe=="number"?fe+"px":String(fe),_e.style.setProperty("--set-icon-size",fe)}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]),w=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);w.class=c;const d={...e.style||{}};if(e.size){const Z=o(e.size);typeof Z=="string"&&cs[Z]||(d.fontSize=yt(e.size))}w.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},O=(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=O(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}),v=_.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:[""]))}),T=_.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"),w,v,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"),T);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 Di=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(""):""},Go=(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)},Ko=(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)),$i=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=Go(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=Go(t,e);return t===!0||n?_.span({class:te(["cms-avatar-status",n?`cms-state-${n}`:""])}):Ko(t,"cms-avatar-badge")},mo=(t,e)=>!e||!e.length?null:_.span({class:te(["cms-avatar-anchor",t])},...e);Ne.Avatar=(...t)=>{var h,B,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}`:""}),w=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=w;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 O=(h=e.fontSize)!=null?h:e.textSize,C=O!=null?Ke(O,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 v=Ke(e.radius,a=>{const x=Io(a);return x==="xxxl"?"999px":x?`var(--cms-r-${x})`:typeof a=="number"?`${a}px`:String(a)});v!=null&&(r["--set-border-radius"]=v),d.style=r;const T={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,P;const a=(g=o(e.initials))!=null?g:o(e.text);if(a!=null)return a;const x=(P=o(e.label))!=null?P:o(e.name);return typeof x=="string"?Di(x):x}),H=Ko(o((B=e.badge)!=null?B:e.notification)),W=$i(o((ie=e.status)!=null?ie:e.presence),o(e.statusColor));let se=J(s,"media",T,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",T,n),de=J(s,"fallback",T,null),_e=J(s,"label",T,he),be=J(s,"icon",T,Z),me=se.length?se:X.length?X:de.length?de:_e.length?_e:be.length?be:["?"],fe=se.length?"cms-avatar-media":"cms-avatar-fallback",ce=_.span({class:"cms-avatar-body"},_.span({class:fe},...me));let $=J(s,"topLeft",T,e.topLeft),re=J(s,"topRight",T,e.topRight),oe=J(s,"bottomLeft",T,e.bottomLeft),Se=J(s,"bottomRight",T,e.bottomRight);const F=J(s,"badge",T,H),p=J(s,"status",T,W);!re.length&&F.length&&(re=F),!Se.length&&p.length&&(Se=p);const f=_.div(d,ce,mo("cms-avatar-anchor-top-left",$),mo("cms-avatar-anchor-top-right",re),mo("cms-avatar-anchor-bottom-left",oe),mo("cms-avatar-anchor-bottom-right",Se));return Nt(f,e),f},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]),w=JSswift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);w.class=c,w.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),O=JSswift.ui.renderSlot(s,"iconRight",{},r),C=J(s,"label",{},e.label),v=C.length?C:J(s,"default",{},n),T=J(null,"default",{},b),le=J(null,"default",{},O),Z=_.span(w,...T,...v.length?v:[""],...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 fe=i();return fe?`cms-state-${fe}`:""}),w=Ct(e.trend,()=>{const fe=String(o(e.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(fe)?"is-positive":["down","negative","danger","loss","decrease"].includes(fe)?"is-negative":["flat","neutral","steady","stable"].includes(fe)?"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,w,d.class]),r.style={...d.style||{}};const b=(fe,ce,$={})=>J(s,fe,$,ce),O=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),v=b("label",(be=e.label)!=null?be:e.title),T=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",O),W=b("aside",e.aside),se=b("footer",e.footer),X=b("actions",e.actions),de=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,v.length?_.div({class:"cms-stat-label"},...v):null)),W.length?_.div({class:"cms-stat-aside"},...W):null),_.div({class:"cms-stat-body"},T.length?_.div({class:"cms-stat-value"},...T):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,de.length?_.div({class:"cms-stat-extra"},...de):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 fe=i();return fe?`cms-state-${fe}`:""}),w={...e},d=JSswift.omit(w,["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,w.class]),d.style={...w.style||{}};const r=(fe,ce,$={})=>J(s,fe,$,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"}),O=r("eyebrow",e.eyebrow),C=r("title",(be=e.title)!=null?be:e.label),v=r("value",e.value),T=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),de=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"},O.length?_.div({class:"cms-kpi-eyebrow"},...O):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"},v.length?_.div({class:"cms-kpi-value"},...v):null,T.length?_.div({class:"cms-kpi-delta"},...T):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,de.length?_.div({class:"cms-kpi-extra"},...de):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 Vi=(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=Vi(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),w=o(e.items),d=Array.isArray(w)?w:w==null?[]:[w],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?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)]},O=(W,se,X,de=!0)=>{if(W==null||W===!1)return[];if(de){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(...O(W,se,d.length))});const v=J(s,"default",{items:d,count:d.length},n);if(v.forEach((W,se)=>{C.push(...O(W,d.length+se,d.length+v.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 T=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=T,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 F,p,f,h,B,ie,a,x;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))),w=!!(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,P,q)=>{const Q=o(g);return Q==null||Q===!1||Q===""?null:typeof Q=="string"?Ne.Icon({name:Q,size:P||"sm"}):JSswift.ui.slot(Q,{as:q})},r=J(s,"icon",{},d(e.icon,e.iconSize||e.size,"icon")),b=J(s,"title",{},(F=e.title)!=null?F:e.label),O=J(s,"subtitle",{},(f=(p=e.subtitle)!=null?p:e.caption)!=null?f:e.description),C=J(s,"meta",{},(h=e.meta)!=null?h:e.eyebrow),v=J(s,"body",{},(B=e.body)!=null?B:e.content),T=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=[...v,...T],W=!(w||e.clickable||e.to||r.length||b.length||O.length||C.length||le.length||he.length||v.length),se=te(["cms-item",ye(e.divider,"divider"),ye(w,"cms-clear-set"),ye(w,"cms-singularity"),ye(w,"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 de=e.onClick,_e=e.onKeydown,be=g=>{var q;if(de==null||de(g),g.defaultPrevented||o(e.disabled))return;const P=o(e.to);P&&((q=JSswift.router)!=null&&q.navigate)&&(g.preventDefault(),JSswift.router.navigate(P))},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 fe=b.length?_.div({class:"cms-item-title"},...b):null,ce=O.length?_.div({class:"cms-item-subtitle"},...O):null,$=C.length?_.div({class:"cms-item-meta"},...C):null,re=H.length?_.div({class:te(["cms-item-body",ye(!(b.length||O.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"},$,fe,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),w=o(e.vertical);if(c!=null){const d=yt(c);w?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)},w=Ct([e.type,e.state],()=>i()),d=Ct(e.variant,()=>{const F=String(o(e.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(F)?`cms-banner-${F}`:""}),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":""),O={...e},C=JSswift.omit(O,["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",w,d,r,b,O.class]),C.style={...O.style||{}};const v=F=>{if(F==null||F==="")return"";const p=o(F);if(p==null||p==="")return"";const f=String(p);return In(f)?`var(--cms-${f})`:f};(e.accent!=null||Ye(e.accent))&&(C.style["--cms-banner-accent"]=()=>v(e.accent),C.style["--cms-banner-border"]=()=>{const F=v(e.accent);return F?`color-mix(in srgb, ${F} 38%, var(--cms-border-color))`:""},C.style["--cms-banner-bg"]=()=>{const F=v(e.accent);return F?`color-mix(in srgb, ${F} 14%, var(--cms-panel))`:""},C.style["--cms-banner-color"]=()=>{const F=v(e.accent);return F?`color-mix(in srgb, ${F} 78%, white)`:""});const T={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 F=i(),p=F?T[F]:null;return p?Ne.Icon({name:p,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),de=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),fe=!!o(e.dismissible)||!!e.onDismiss;let ce=null;const $=fe?Ne.Btn({class:"cms-banner-close",outline:!0,size:e.size||"sm","aria-label":e.closeLabel||"Chiudi banner",onClick:F=>{var p;(p=e.onDismiss)==null||p.call(e,F),!F.defaultPrevented&&(ce==null||ce.remove())}},Ne.Icon({name:"close",size:e.size||"sm"})):null,re=[...de,...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 F=i();return F==="danger"||F==="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 de=i();return de?`cms-state-${de}`:""}),w={...e},d=JSswift.omit(w,["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"),w.class]),d.style={...w.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 de=r[i()]||r.warning;return Ne.Icon({name:de,size:e.iconSize||"sm"})})(),O=J(s,"title",{},e.title),C=J(s,"message",{},e.message!=null?e.message:n),v=J(s,"description",{},(X=e.description)!=null?X:e.subtitle),T=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:de=>{var _e;(_e=e.onDismiss)==null||_e.call(e,de),!de.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"},O.length?_.div({class:"cms-alert-title"},...O):null,C.length?_.div({class:"cms-alert-message"},...C):null,v.length?_.div({class:"cms-alert-description"},...v):null,T.length?_.div({class:"cms-alert-meta"},...T):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}`:""}),w={...e},d=JSswift.omit(w,["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"),w.class]),d.style={...w.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),O=J(s,"icon",{},r),C=J(s,"eyebrow",{},e.eyebrow),v=J(s,"title",{},e.title),T=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,O.length?_.div({class:"cms-empty-state-icon"},...O):null,C.length?_.div({class:"cms-empty-state-eyebrow"},...C):null,v.length?_.div({class:"cms-empty-state-title"},...v):null,T.length?_.div({class:"cms-empty-state-message"},...T):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 qo=new Set,To=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}},Bi=(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=To.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 qo.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(_n);return}const{el:i,openIcon:c,closeIcon:w}=s;i&&(i.textContent=_n?c:w)}),Bi(_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,w=null,d=null;const r=F=>Object.prototype.hasOwnProperty.call(e,F),b=r("target")||r("anchorEl")||r("triggerEl"),O=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),C=(F,p)=>{const f=o(F);if(f==null||f==="")return p;const h=Number(f);return Number.isFinite(h)?h:p},v=()=>{clearTimeout(c),clearTimeout(w),c=null,w=null},T=()=>C(e.delay,350),le=()=>C(e.hideDelay,o(e.interactive)?120:0),Z=()=>{if(v(),!i)return;const F=i;i=null,ks(F,()=>JSswift.overlay.close(F.id))},H=(F=>{if(F==null||F===!0)return new Set(["hover","focus"]);if(F===!1)return new Set(["manual"]);const p=Array.isArray(F)?F:String(F).split(/[\s,|/]+/),f=new Set;return p.forEach(h=>{const B=String(h||"").trim().toLowerCase();B&&(B==="mouseenter"||B==="mouseover"?f.add("hover"):B==="blur"||B==="focusin"?f.add("focus"):B==="tap"?f.add("click"):f.add(B))}),f.size?f: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"),de=H.has("manual")||!W&&!se&&!X,_e=()=>{var q,Q,ve,E,m,N;const F={anchorEl:d||O||null,close:()=>Z(),hide:()=>Z(),isOpen:()=>!!i},p=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,f=J(s,"title",F,(q=e.title)!=null?q:e.heading),h=J(s,"icon",F,p),B=J(s,"footer",F,(Q=e.footer)!=null?Q:e.actions);let ie=(N=(m=(E=(ve=e.content)!=null?ve:e.text)!=null?E:e.body)!=null?m:e.description)!=null?N:e.label;ie==null&&(b?ie=n:O&&n&&n.length>1?ie=n.slice(1):O||(ie=n));let a=J(s,"content",F,ie);a.length||(a=J(s,"default",F,ie));const x=a.length?_.div({class:"cms-tooltip-body"},...a):null,g=h.length||f.length?_.div({class:"cms-tooltip-head"},h.length?_.div({class:"cms-tooltip-icon"},...h):null,_.div({class:"cms-tooltip-head-main"},f.length?_.div({class:"cms-tooltip-title"},...f):null,x)):x,P=B.length?_.div({class:"cms-tooltip-footer"},...B):null;return _.div({class:"cms-tooltip-content"},...[g,P].filter(Boolean))},be=F=>{var a,x,g,P,q,Q;const p=F||d;if(!p||o(e.disabled))return null;if(i&&i._anchorEl===p)return i;i&&Z();const f=(a=e.closeOnOutside)!=null?a:X||o(e.interactive),h=(x=e.closeOnEsc)!=null?x:X||o(e.interactive);let B=null;if(i=JSswift.overlay.open(()=>_e(),{type:"tooltip",anchorEl:p,placement:e.placement||"top",offsetX:(g=e.offsetX)!=null?g:0,offsetY:(q=(P=e.offsetY)!=null?P:e.offset)!=null?q:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:f,closeOnBackdrop:!1,closeOnEsc:h,autoFocus:!1,className:qt(["cms-tooltip",ye(e.interactive,"interactive"),e.class,e.panelClass]),onClose:()=>{var ve,E;(ve=B==null?void 0:B._tooltipCleanup)==null||ve.call(B),i===B&&(i=null),(E=e.onClose)==null||E.call(e)}}),!(i!=null&&i.panel))return i;const ie=i;if(B=ie,ie._anchorEl=p,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(w),w=null},E=()=>fe(),m=N=>{const I=N.target;I&&I.closest&&I.closest("[data-tooltip-close]")&&Z()};ie.panel.addEventListener("mouseenter",ve),ie.panel.addEventListener("mouseleave",E),ie.panel.addEventListener("focusin",ve),ie.panel.addEventListener("focusout",E),ie.panel.addEventListener("click",m),ie._tooltipCleanup=()=>{var N,I,K,ke,Oe;(N=ie.panel)==null||N.removeEventListener("mouseenter",ve),(I=ie.panel)==null||I.removeEventListener("mouseleave",E),(K=ie.panel)==null||K.removeEventListener("focusin",ve),(ke=ie.panel)==null||ke.removeEventListener("focusout",E),(Oe=ie.panel)==null||Oe.removeEventListener("click",m)}}return _s(ie),(Q=e.onOpen)==null||Q.call(e,ie),ie},me=F=>{clearTimeout(w),w=null,clearTimeout(c),c=setTimeout(()=>be(F),T())},fe=(F=!1)=>{if(clearTimeout(c),c=null,!!i){if(clearTimeout(w),F){Z();return}w=setTimeout(()=>Z(),le())}},ce=F=>{i?fe(!0):be(F)},$=()=>!!i,re=F=>{if(!F)return()=>{};d=F;const p=[],f=()=>{v(),p.forEach(h=>h())};if(r("open"))return Ye(e.open)?JSswift.reactive.effect(()=>{d&&(o(e.open)?be(d):fe(!0))},"UI.Tooltip:open"):e.open===!0?be(F):e.open===!1&&fe(!0),f;if(de||o(e.disabled))return f;if(W){const h=()=>me(F),B=()=>fe();F.addEventListener("mouseenter",h),F.addEventListener("mouseleave",B),p.push(()=>{F.removeEventListener("mouseenter",h),F.removeEventListener("mouseleave",B)})}if(se){const h=()=>me(F),B=()=>fe();F.addEventListener("focus",h),F.addEventListener("blur",B),p.push(()=>{F.removeEventListener("focus",h),F.removeEventListener("blur",B)})}if(X){const h=B=>{var ie;(ie=e.onTriggerClick)==null||ie.call(e,B),!B.defaultPrevented&&ce(F)};F.addEventListener("click",h),p.push(()=>F.removeEventListener("click",h))}return f};if(O){const F=te(["cms-tooltip-wrap",e.wrapClass,e.targetClass]),p=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"]);p.class=F,p.style={display:"inline-flex",alignItems:"center",...e.wrapStyle||e.targetStyle||{}};const f=JSswift.ui.renderSlot(s,"target",{open:()=>be(d),show:()=>me(d),hide:()=>fe(!0),toggle:()=>ce(d),isOpen:$},O),h=_.span(p,...J(null,"default",{},f));return re(h),h._tooltip={bind:re,open:be,show:me,hide:fe,close:Z,toggle:ce,isOpen:$},h}return{bind:re,open:be,show:me,hide:fe,close:Z,toggle:ce,isOpen:$}};const Po=(t,e,n={})=>{var F;const{props:s,children:i}=JSswift.uiNormalizeArgs(e),c=s.slots||{},w=t==="radio",d=n.appearance==="toggle",r=!w,b=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),O=en(s.model,n.modelName||(w?"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,w&&s.name!=null&&(C.name=s.name),C.class=te([`cms-${t}`,"cms-choice-input",s.inputClass]);const v=_.input(C),T=J(c,"label",{},s.label),le=T.length?T:J(c,"default",{},i),Z=Fe(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&&w,"cms-toggle-radio-wrap"),ye(d&&!w,"cms-toggle-checkbox-wrap"),ye(s.dense,"dense"),s.class]),H.style={...s.style||{}};const W=o(s.size);W!=null&&!(typeof W=="string"&&((F=JSswift.uiSizes)!=null&&F.includes(W)))&&(H.style["--cms-choice-size"]=yt(W));const se=_.span({class:te(["cms-choice-mark",w?"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 de=he.length?_.span({class:"cms-choice-label"},...he):null,_e=_.label(H,v,se,de);Nt(_e,s);const be=s.iconSize?s.iconSize:s.size,me=d?null:w?"radio_button_checked":"check",fe=d?null:w?"radio_button_unchecked":null,ce=d||w?null:"indeterminate_check_box",$=p=>{if(w)return v.checked=p==s.value,v.checked;const f=p==null?null:!!p;return v.checked=f===!0,v.indeterminate=r&&f==null,f},re=()=>!w&&r&&v.indeterminate?null:!!v.checked,oe=p=>p===!0?s.checkedIcon!=null?s.checkedIcon:s.icon!=null?s.icon:me:p===!1?s.uncheckedIcon!=null?s.uncheckedIcon:fe:s.indeterminateIcon!=null?s.indeterminateIcon:s.standbyIcon!=null?s.standbyIcon:s.iconStandby!=null?s.iconStandby:ce,Se=()=>{const p=re(),f=p===!0;for(;X.firstChild;)X.removeChild(X.firstChild);_e.classList.toggle("is-checked",f),_e.classList.toggle("is-indeterminate",p==null),_e.classList.toggle("is-disabled",!!v.disabled),f&&(s.checkedIcon||s.icon)?_e.classList.toggle("toggle-default",!1):f&&!s.checkedIcon||p==null&&!s.standbyIcon?_e.classList.toggle("toggle-default",!0):p==null&&s.standbyIcon?_e.classList.toggle("toggle-default",!1):v.disabled===!1&&!s.uncheckedIcon?_e.classList.toggle("toggle-default",!0):_e.classList.toggle("toggle-default",!1),d&&(p==null?X.style.transform="translateX(calc((var(--cms-toggle-width) - var(--cms-toggle-thumb-size) - 1px) / 2))":X.style.removeProperty("transform"));const h={checked:f,state:p,indeterminate:p==null,value:s.value,id:b,type:t};let B=null;if(p===!0?(B=JSswift.ui.renderSlot(c,"checkedIcon",h,null),B==null&&(B=JSswift.ui.renderSlot(c,"iconOn",h,null))):p===!1?(B=JSswift.ui.renderSlot(c,"uncheckedIcon",h,null),B==null&&(B=JSswift.ui.renderSlot(c,"iconOff",h,null))):(B=JSswift.ui.renderSlot(c,"indeterminateIcon",h,null),B==null&&(B=JSswift.ui.renderSlot(c,"standbyIcon",h,null)),B==null&&(B=JSswift.ui.renderSlot(c,"iconStandby",h,null))),B==null&&(B=JSswift.ui.renderSlot(c,"icon",h,null)),B==null){const ie=oe(p);typeof ie=="string"?B=Ne.Icon({name:ie,size:be,...d?{textColor:s.color,outline:!0}:{}}):ie!=null&&(B=JSswift.ui.slot(ie,{checked:f,state:p,indeterminate:p==null,as:p===!0?"checkedIcon":p===!1?"uncheckedIcon":"indeterminateIcon"}))}J(null,"default",{},B).forEach(ie=>X.appendChild(ie))};return O?($(O.get()),O.watch(p=>{$(p),Se()},w?"UI.Radio:watch":"UI.Checkbox:watch"),v.addEventListener("change",p=>{var f,h;if(w)v.checked&&(O.set(s.value),(f=s.onChange)==null||f.call(s,s.value,p));else{const B=re();O.set(B),(h=s.onChange)==null||h.call(s,B,p)}Se()})):($(w?s.checked===!0?s.value:void 0:s.checked),v.addEventListener("change",p=>{var f,h;w?(f=s.onChange)==null||f.call(s,s.value,p):(h=s.onChange)==null||h.call(s,re(),p),Se()})),s.onInput&&v.addEventListener("input",p=>{var f,h;w?(f=s.onInput)==null||f.call(s,s.value,p):(h=s.onInput)==null||h.call(s,re(),p)}),Se(),it(_e,s,{isEnabled:()=>!v.disabled,action:()=>{if(v.disabled)return!1;Me(v),v.click()}}),_e};Ne.Checkbox=(...t)=>Po("checkbox",t),Ne.Radio=(...t)=>Po("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 Po(n,t,{appearance:"toggle",modelName:"UI.Toggle:model"})},Ne.Slider=(...t)=>{var K,ke,Oe,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=en(i,"UI.Slider:model"),w=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"]);w.type="range",w.class=te(["cms-slider-input",e.inputClass]);const d=_.input(w),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 O=_.label({class:te(["cms-clear-set","cms-singularity-check","cms-slider-wrap",ye(e.dense,"dense"),e.class]),style:r});Nt(O,e);const C=_.div({class:"cms-slider-header"}),v=_.span({class:"cms-slider-label"}),T=_.span({class:"cms-slider-value"});C.append(v,T);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)"}}),de=_.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"});de.append(be,_e);const me=_.div({class:"cms-slider-markers"}),fe=_.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,de,d),H.append(W,me),le.append(Z,he,H,fe,ce),O.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={})=>Vs(oe(j),ne),F=(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})},p=(j,ne)=>{const Ve=Number(j);return Number.isFinite(Ve)?Ve:ne},f=()=>p(o(e.min),0),h=()=>{const j=f(),ne=p(o(e.max),100);return ne<j?j:ne},B=()=>{const j=o(e.step);if(j==="any")return"any";const ne=p(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=f(),Ve=h(),He=B();let ae=p(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=f(),He=h()-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,P]=JSswift.reactive.signal(a(c?c.get():(Oe=(ke=o(e.value))!=null?ke:o(e.min))!=null?Oe:0)),q=(j,ne={})=>{const Ve=a(j);return g()!==Ve&&P(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=f(),He=h(),ae=(Ee,De)=>{var qe,Be,z,Pe,M,k,S,u;if(Ee==null)return null;if(typeof Ee=="object"&&!Array.isArray(Ee)){const A=a((z=(Be=(qe=Ee.value)!=null?qe:Ee.position)!=null?Be:Ee.at)!=null?z:Ve);return{key:(Pe=Ee.key)!=null?Pe:`marker-${De}-${A}`,value:A,label:(M=Ee.label)!=null?M:ne?String(A):null,icon:(k=Ee.icon)!=null?k:null,className:(u=(S=Ee.class)!=null?S: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=B();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 z,Pe;if(o(e.disabled)||o(e.readonly))return;const Be=q(ne.value);(z=e.onInput)==null||z.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)})},E=()=>{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(v,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(T,ae,"inline-flex"),C.style.display=v.childNodes.length||T.childNodes.length?"flex":"none"},m=()=>{var De,Ie,qe,Be;const j={value:g(),input:d,props:e},ne=J(s,"icon",j,null),Ve=ne.length?ne:F(e.icon,"icon",j);re(Z,Ve,"inline-flex");const He=J(s,"iconRight",j,null),ae=He.length?He:F(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(fe,J(s,"endLabel",j,Ee),"inline-flex")},N=()=>{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:F(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")},I=()=>{const j=a(g()),ne=f(),Ve=h(),He=B(),$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,de.style.left=$e,de.style.borderColor=Ie,de.style.color=Ie,be.style.background=Ee,O.classList.toggle("is-disabled",Be),O.classList.toggle("is-readonly",qe),O.classList.toggle("has-markers",me.childNodes.length>0)};if(c?(q(c.get(),{fromModel:!0}),c.watch(j=>{q(j,{fromModel:!0})},"UI.Slider:watch")):Ye(e.value)?JSswift.reactive.effect(()=>{q(o(e.value),{fromModel:!0})},"UI.Slider:value"):q((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=q(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=q(d.value);(Ve=e.onChange)==null||Ve.call(e,ne,j)}),JSswift.reactive.effect(()=>{E(),m(),N(),ve(),I()},"UI.Slider:render"),O._input=d,O._getValue=g,O._setValue=j=>q(j),e.withQItem||e.qitem||e.item===!0){const j=Ne.Item({class:te(["cms-slider-item",e.itemClass]),style:e.itemStyle},O);return j._input=d,j._slider=O,j._getValue=g,j._setValue=O._setValue,j}return O},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=en(i,"UI.Rating:model"),w=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=w,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 O=o(e.size);O!=null&&!(typeof O=="string"&&((g=JSswift.uiSizes)!=null&&g.includes(O)))&&(b.style["--cms-rating-size"]=yt(O));const C=o(e.gap);C!=null&&(b.style["--cms-rating-gap"]=yt(C));const v=_.span({class:"cms-rating-control",onMouseleave:P=>{var q;oe!=null&&(oe=null,a(),(q=e.onHover)==null||q.call(e,ce(),P))},onKeydown:P=>{if(!fe())return;const q=de()?.5:1,Q=ce();let ve=Q;switch(P.key){case"ArrowRight":case"ArrowUp":ve=Q+q;break;case"ArrowLeft":case"ArrowDown":ve=Q-q;break;case"Home":ve=o(e.clearable)?0:q;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)?q:Math.max(q,1));break;default:return}P.preventDefault(),x(ve,P,{emit:!0})}}),T=_.span({class:"cms-choice-label cms-rating-label"}),le=_.label(b,r,v,T);Nt(le,e);const Z=P=>{for(;P.firstChild;)P.removeChild(P.firstChild)},he=(P,q,Q="")=>{Z(P),(q||[]).forEach(ve=>P.appendChild(ve)),P.style.display=P.childNodes.length?Q:"none"},H=P=>vt(P)||gt(P)?o(P):P,W=(P,q={})=>Vs(H(P),q),se=(P,q,Q={})=>{var E,m;const ve=H(P);return ve==null?[]:typeof ve=="string"?[Ne.Icon({name:ve,color:e.color,size:(m=(E=e.iconSize)!=null?E:e.size)!=null?m:16})]:W(ve,{...Q,as:q})},X=()=>{var q;const P=Number((q=o(e.max))!=null?q:5);return Number.isFinite(P)&&P>0?Math.max(1,Math.round(P)):5},de=()=>{var P;return!!o((P=e.half)!=null?P:e.allowHalf)},_e=(P,q=X())=>{let Q=Number(o(P));Number.isFinite(Q)||(Q=0),Q=Math.min(q,Math.max(0,Q));const ve=de()?.5:1;return Math.round(Q/ve)*ve},be=()=>!!o(e.disabled),me=()=>!!o(e.readonly),fe=()=>!be()&&!me(),ce=()=>_e(c?c.get():re),$=P=>{const q=P>0?String(P):"";r.value=q,r.setAttribute("value",q),r.disabled=be()};let re=_e(c?c.get():o(e.value)),oe=null,Se=0,F=[];const p=(P,q)=>{if(!de())return _e(P);const Q=q.currentTarget.getBoundingClientRect(),ve=q.clientX-Q.left<=Q.width/2;return _e(ve?P-.5:P)},f=(P,q)=>P>=q?"full":de()&&P>=q-.5?"half":"empty",h=(P,q)=>{var N,I,K,ke,Oe,Te,U,j,ne,Ve,He,ae,$e,Ee,De;const Q=o((K=(I=(N=e.colorSelected)!=null?N:e.activeColor)!=null?I:e.color)!=null?K:e.textColor)||"var(--cms-warning, #f0b429)",ve=o((j=(U=(Te=(Oe=(ke=e.colorHalf)!=null?ke:e.halfColor)!=null?Oe:e.colorSelected)!=null?Te:e.activeColor)!=null?U:e.color)!=null?j:e.textColor)||Q,E=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,m=o((De=(Ee=e.colorInactive)!=null?Ee:e.colorOff)!=null?De:e.color)||"var(--cms-muted)";return q?E:P==="full"?Q:P==="half"?ve:m},B=P=>{var E,m,N,I,K,ke,Oe,Te,U,j,ne,Ve,He,ae,$e;const q=[];P.hovered&&P.state!=="empty"&&q.push("hoveredIcon","iconHovered"),P.state==="full"?q.push("checkedIcon","selectedIcon","iconSelected","iconOn"):P.state==="half"?q.push("halfIcon","iconHalf"):q.push("uncheckedIcon","iconOff"),q.push("icon","item","star");for(const Ee of q){const De=J(s,Ee,P,null);if(De.length)return De}let Q=null,ve="icon";return P.hovered&&P.state!=="empty"&&(Q=(E=e.hoveredIcon)!=null?E:e.iconHovered,ve="hoveredIcon"),Q==null&&P.state==="full"?(Q=(K=(I=(N=(m=e.checkedIcon)!=null?m:e.iconSelected)!=null?N:e.iconOn)!=null?I:e.icon)!=null?K:"star",ve="checkedIcon"):Q==null&&P.state==="half"?(Q=(j=(U=(Te=(Oe=(ke=e.halfIcon)!=null?ke:e.iconHalf)!=null?Oe: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,P)},ie=()=>{const P=X();if(Se!==P){Se=P,F=[],Z(v);for(let q=1;q<=P;q++){const Q=_.span({class:"cms-rating-item-icon"}),ve=_.span({class:"cms-rating-item",role:"radio",tabIndex:-1,onMousemove:E=>{var N;if(!fe())return;const m=p(q,E);oe!==m&&(oe=m,a(),(N=e.onHover)==null||N.call(e,m,E))},onClick:E=>{if(!fe())return;let m=p(q,E);o(e.clearable)&&m===ce()&&(m=0),x(m,E,{emit:!0})}},Q);F.push({item:ve,iconHost:Q,index:q}),v.appendChild(ve)}}},a=()=>{var ke,Oe;ie();const P=X(),q=ce(),Q=oe==null?q:_e(oe,P),ve=be(),E=me(),m=!!o(e.clearable),N=!!o(e.noDimming);le.classList.toggle("is-disabled",ve),le.classList.toggle("is-readonly",E),le.classList.toggle("is-hovering",oe!=null),le.classList.toggle("is-clearable",m),le.classList.toggle("is-half",de()),le.classList.toggle("no-dimming",N);const I=Number((Oe=o((ke=e.tabindex)!=null?ke:e.tabIndex))!=null?Oe:0);v.tabIndex=ve?-1:I,v.setAttribute("role","slider"),v.setAttribute("aria-valuemin","0"),v.setAttribute("aria-valuemax",String(P)),v.setAttribute("aria-valuenow",String(q)),v.setAttribute("aria-disabled",ve?"true":"false"),v.setAttribute("aria-readonly",E?"true":"false"),$(q);const K=J(s,"label",{value:q,max:P,disabled:ve,readonly:E,clearable:m},e.label!=null?H(e.label):n);he(T,K,"inline-flex"),F.forEach(({item:Te,iconHost:U,index:j})=>{const ne=f(Q,j),Ve=oe!=null&&ne!=="empty",He={index:j,max:P,value:q,displayValue:Q,state:ne,active:ne!=="empty",checked:ne==="full",half:ne==="half",hovered:Ve,disabled:ve,readonly:E,clearable:m,setValue:ae=>x(ae,null,{emit:!1})};Te.className=qt(["cms-rating-item",`is-${ne}`,ye(Ve,"is-hovered")]),Te.style.color=h(ne,Ve),Te.style.opacity=ne==="empty"&&!N?"0.48":"1",Te.setAttribute("aria-checked",String(q===j)),he(U,B(He),"inline-flex")})},x=(P,q,Q={})=>{var m,N;const ve=_e(P),E=ce();return re=ve,oe=null,c&&Q.fromModel!==!0&&c.set(ve),$(ve),a(),Q.emit!==!1&&ve!==E&&((m=e.onInput)==null||m.call(e,ve,q),(N=e.onChange)==null||N.call(e,ve,q)),ve};return le._input=r,le._rating=v,le._getValue=ce,le._setValue=P=>x(P,null,{emit:!1}),c&&c.watch(P=>{const q=_e(P);serializeValue(q)!==serializeValue(re)&&(re=q,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 Ut=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"),zn=(t,e={})=>{var d,r,b,O,C,v,T,le,Z,he,H,W,se,X,de;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((O=(b=(r=t.hour)!=null?r:t.hours)!=null?b:t.h)!=null?O:t.hh),s=Number((le=(T=(v=(C=t.minute)!=null?C:t.minutes)!=null?v:t.min)!=null?T: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=(de=(X=(se=t.meridiem)!=null?se:t.ampm)!=null?X:t.period)!=null?de: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 w={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(i)};return Yo(w,e)},Kn=(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`${Dn(n.hour)}:${Dn(n.minute)}${s?`:${Dn(n.second)}`:""}`},ho=(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 Yo(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&&ho(n,s)<0?Ut(s):i&&ho(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,po=(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`${Dn(n.hour)}:${Dn(n.minute)}${s?`:${Dn(n.second)}`:""}`;const c=n.hour>=12?"PM":"AM",w=n.hour%12||12;return`${Dn(w)}:${Dn(n.minute)}${s?`:${Dn(n.second)}`:""} ${c}`},ji=(t,e,n={})=>{if(!t)return"";const s=Kn(e,n);return s?`${t}T${s}`:t},Jo=(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},Xo=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:i=!1,minuteStep:c=5,secondStep:w=5,disabled:d=!1,readonly:r=!1,embedded:b=!1,className:O="",slotPrefix:C="",shortcuts:v=null,onSelect:T=null}=t,le=zn(s,{withSeconds:i,min:e.min,max:e.max}),Z=le||zn(new Date,{withSeconds:i,min:e.min,max:e.max})||{hour:0,minute:0,second:0},he=le?Ut(le):null,H=fe=>C?`${C}${fe[0].toUpperCase()}${fe.slice(1)}`:null,W=(fe,ce,$)=>{const re=[H(fe),fe].filter(Boolean);for(const oe of re){if(JSswift.ui.getSlot(n,oe)==null)continue;const F=JSswift.ui.renderSlot(n,oe,ce,$);if(F!=null)return F}return JSswift.ui.slot($,ce)},se=fe=>{let ce=W("point",fe,null);return ce==null&&t.pointIcon!=null&&fe.selected&&(ce=typeof t.pointIcon=="string"?Ne.Icon({name:t.pointIcon,size:b?10:12}):JSswift.ui.slot(t.pointIcon,fe)),J(null,"default",fe,ce)},X=(fe,ce)=>{const $={hour:Z.hour,minute:Z.minute,second:i?Z.second:0};return $[fe]=ce,$},de=_.div({class:te(["cms-time-section",ye(b,"is-embedded"),ye(i,"has-seconds"),O])}),_e=o(v)||[];if(Array.isArray(_e)&&_e.length){const fe=_.div({class:"cms-time-shortcuts"});_e.forEach((ce,$)=>{var p,f,h;if(!ce)return;const re=typeof ce.value=="function"?ce.value({now:Kn(new Date,{withSeconds:i})}):ce.value,oe=zn(re,{withSeconds:i,min:e.min,max:e.max});if(!oe)return;const Se={item:ce,index:$,value:Kn(oe,{withSeconds:i}),displayValue:po(oe,{withSeconds:i,use12h:(p=e.use12h)!=null?p:e.ampm})},F=W("shortcut",Se,(h=(f=ce.label)!=null?f:ce.text)!=null?h:Se.displayValue);fe.appendChild(_.button({type:"button",class:te(["cms-time-shortcut",ye(!!he&&ho(oe,he)===0,"is-selected")]),disabled:d||r,onClick:()=>T==null?void 0:T(oe,{shortcut:ce,index:$})},...J(null,"default",Se,F)))}),fe.childNodes.length&&de.appendChild(fe)}const be=_.div({class:"cms-time-columns"}),me=(fe,ce,$)=>{const re=_.div({class:"cms-time-column","data-time-part":ce}),oe=_.div({class:"cms-time-options"});return $.forEach(Se=>{var x;const F=X(ce,Se),p=Yo(F,{withSeconds:i,min:e.min,max:e.max}),f=d||r||ho(p,F)!==0,h=!!he&&he[ce]===Se,B={part:ce,selected:h,disabled:f,value:Se,label:Dn(Se),timeValue:Kn(p,{withSeconds:i}),displayValue:po(p,{withSeconds:i,use12h:(x=e.use12h)!=null?x:e.ampm})},ie=W("option",B,B.label),a=h?se(B):[];oe.appendChild(_.button({type:"button",class:te(["cms-time-option",ye(h,"is-selected"),ye(f,"is-disabled")]),disabled:f,onClick:()=>T==null?void 0:T(p,{part:ce,optionValue:Se})},_.span({class:"cms-time-option-label"},...J(null,"default",B,ie)),a.length?_.span({class:"cms-time-option-point"},...a):null))}),re.appendChild(oe),re};return be.appendChild(me(o(e.hoursLabel)||"Ore","hour",Jo(1,23))),be.appendChild(me(o(e.minutesLabel)||"Min","minute",Jo(c,59))),i&&be.appendChild(me(o(e.secondsLabel)||"Sec","second",Jo(w,59))),de.appendChild(be),de},go=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},Qo=(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,w)=>{const d=c.getAttribute("data-time-part")||String(w),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 O=Math.max(0,c.scrollHeight-c.clientHeight),C=b.offsetTop-(c.clientHeight-b.offsetHeight)/2,v=Math.max(0,Math.min(O,C));if(Math.abs(c.scrollTop-v)<1){c.scrollTop=v;return}if(s&&typeof c.scrollTo=="function"){c.scrollTo({top:v,behavior:s});return}c.scrollTop=v})},Zo=(t,e={})=>{var fs,ms,ts,ns,Xe,ht,Mt,Kt,Zt,tn,un,ln;const{props:n,children:s}=JSswift.uiNormalizeArgs(t),i=e.calendar===!0,c=n.slots||{},w=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),O=en(b,i?"UI.Calendar:model":"UI.Datepicker:model"),C=O?O.get():o(n.value),v=o((Xe=n.rangeAs)!=null?Xe:n.rangeModel)==="array"||Array.isArray(C),T=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,Ht;const y=Kn(kn((Je=(ue=o(n.timeValue))!=null?ue:O?O.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((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())}`,de=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=de(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=de(ue);return Je?new Date(Je.getFullYear(),Je.getMonth(),1):new Date},fe=()=>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=de(y),ot=de(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}),F=y=>Array.isArray(y)?y.map(Se):[],p=y=>{const ue=Se(y);return v?[ue.from,ue.to]:ue},f=y=>F(y).map(ue=>T?[ue.from,ue.to]:ue),h=y=>r==="multiple"?Array.isArray(y)?y.slice():[]:r==="range"?Se(y):r==="range-multiple"?F(y):y||null,B=y=>r==="multiple"?Array.isArray(y)?y.slice():[]:r==="range"?p(y):r==="range-multiple"?f(y):y||"",ie=y=>JSON.stringify(B(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,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=(mt=y.to)!=null?mt: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=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))},P=y=>{const ue=[];return oe(y).forEach(Je=>{const ot=a(Je);ot&&!ue.includes(ot)&&ue.push(ot)}),ue.sort()},q=y=>r==="range"?x(y):r==="range-multiple"?g(y):r==="multiple"?P(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))},E=()=>o(n.locale)||void 0,m=()=>{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},N=()=>{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))},I=()=>{const y=Q(),ue=ve();let Je=a(o(n.defaultMonth))||fe();return y&&Je<y&&(Je=y),ue&&Je>ue&&(Je=ue),Je||y||ue||fe()},K=()=>o(n.confirm)?Be:qe,ke=y=>{const ue=de(y);return ue?{date:y,value:y,year:ue.getFullYear(),month:ue.getMonth()+1,day:ue.getDate(),weekday:ue.getDay(),today:ce(y,fe())}:{date:y,value:y}},Oe=(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,dn,Pn,Sn,hn,ss,hs,ps,As,js,Hs,Ws;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&&!Oe(ot,y))return!1;const rt=o((Pn=(dn=n.disableDates)!=null?dn:n.disabledDates)!=null?Pn:n.notAllowedDates);if(rt!=null&&Oe(rt,y))return!1;const at=(Sn=de(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((js=(As=n.minRange)!=null?As:n.minDays)!=null?js:n.minNights)),Us=Number(o((Ws=(Hs=n.maxRange)!=null?Hs:n.maxDays)!=null?Ws:n.maxNights));if(Number.isFinite(Is)&&Ls<Is||Number.isFinite(Us)&&Ls>Us)return!1}return!0},U=y=>{var ot,rt;if(!y)return"";const ue=de(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(E(),{year:"numeric",month:"short",day:"2-digit"}).format(ue)},j=(y,ue=z)=>{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 Ut((mt=at!=null?at:ue)!=null?mt:null)},$e=()=>o(n.confirm)?Pe:z,Ee=(y=qe,ue=z)=>r==="single"&&le()?ji(y||null,ue,Z()):B(y),De=(y=qe,ue=z)=>JSON.stringify(Ee(y,ue)),Ie=y=>po(y,Z());let qe=q(C),Be=h(qe),z=ae(C,kn(o(n.timeValue),Z())),Pe=Ut(z),M=null,k=null,S=me(r==="range"?(qe==null?void 0:qe.from)||(qe==null?void 0:qe.to)||I():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)||I():r==="multiple"?qe[0]||I():qe||I()),u=null,A=null;const xe=y=>{const ue=y instanceof Date?y:de(a(y));if(!ue)return-1;const Je=ue.getFullYear(),ot=ue.getMonth();for(let rt=0;rt<N();rt+=1){const at=be(S,rt);if(at.getFullYear()===Je&&at.getMonth()===ot)return rt}return-1},Ue={...n,label:(Zt=n.label)!=null?Zt: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",w,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,z)}),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:(un=n.iconRight)!=null?un:"calendar_month",control:tt,getValue:()=>Ge.value,onClear:()=>{o(n.disabled)||o(n.readonly)||(Pt(He(),null),u&&cn())},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)||I():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)||I():r==="multiple"?(y==null?void 0:y[0])||I():y||I());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))}S=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,z));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,z),It(),(y=dt==null?void 0:dt._refresh)==null||y.call(dt))},Pt=(y,ue,Je={})=>{var Tt,Ht,sn;const ot=q(y),rt=le()?Ut((Tt=kn(Je.timeValue!=null?Je.timeValue:Je.preserveTime?$e():y,Z()))!=null?Tt:Je.preserveTime?$e():null):null,at=De(qe,z);qe=h(ot),Be=h(ot),le()&&(z=Ut(rt),Pe=Ut(rt)),M=null,St(ot,Je),Rt(),rn(),O&&Je.fromModel!==!0&&O.set(Ee(ot,rt));const mt=De(ot,rt);if(Je.emit!==!1&&mt!==at){const dn=Ee(ot,rt);(Ht=n.onInput)==null||Ht.call(n,dn,ue),(sn=n.onChange)==null||sn.call(n,dn,ue)}return ot},st=(y,ue,Je={})=>{var mt,Tt;if(!le())return null;const ot=Ut(kn(y,Z()));if(o(n.confirm)&&Je.commit!==!0)return Pe=ot,rn(),ot;const rt=De(qe,z);z=Ut(ot),Pe=Ut(ot),Rt(),rn(),O&&Je.fromModel!==!0&&O.set(Ee(qe,ot));const at=De(qe,ot);if(Je.emit!==!1&&at!==rt){const Ht=Ee(qe,ot);(mt=n.onInput)==null||mt.call(n,Ht,ue),(Tt=n.onChange)==null||Tt.call(n,Ht,ue)}return ot},wt=(y,ue,Je={})=>{if(o(n.confirm)){Be=h(q(y)),le()&&(Je.timeValue!=null||Je.preserveTime)&&(Pe=Ut(kn(Je.timeValue!=null?Je.timeValue:$e(),Z()))),M=null,St(Be,Je),rn();return}Pt(y,ue,Je)},Ft=()=>{const y=K();if(r==="range")return!(y!=null&&y.from)||y!=null&&y.to||!M?y:$(y.from,M)<=0?{from:y.from,to:M}:{from:M,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||!M?ue:$(ue.from,M)<=0?{from:ue.from,to:M}:{from:M,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||M===y||(M=y,ue.render!==!1&&rn())},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:le(),timeValue:$e(),preserveMonthOffset:!!u&&N()>1,visibleMonthOffset:Number.isInteger(Je.visibleMonthOffset)?Je.visibleMonthOffset:null};if(r==="multiple"){const at=P(K()),mt=at.includes(y)?at.filter(Tt=>Tt!==y):[...at,y];wt(mt.sort(),ue,ot),jt()&&cn();return}if(r==="range"){const at=h(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&&jt()&&cn();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&&jt()&&cn();return}wt(y,ue,ot),jt()&&cn()},an=()=>{k=null,Pt(He(),null,{timeValue:null})},mn=()=>{const y=fe();if(!Te(y)){St(y),rn();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()})},Gt=(y={})=>{Qo(A,y)},Tn=()=>{if(!le())return;const y=go(A);st(new Date,null,{commit:!o(n.confirm)}),Gt({scrollState:y}),!o(n.confirm)&&n.closeOnSelect===!0&&cn()},An=()=>{o(n.confirm)&&(Pt(Be,null,{timeValue:Pe,preserveTime:!0}),n.closeOnSelect!==!1&&cn())},rn=()=>{var fi,mi,hi,pi,gi,yi,bi,wi,vi,Si,Ci,xi,_i,ki,Ni,Ai,Li,Ii,Ei;if(!A)return;const y=E(),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=(m()+$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(),Gs=At.getMonth(),Ks=new Date(Ln,Gs,1),_o=(Ks.getDay()-m()+7)%7,$o=new Date(Ln,Gs,1-_o),ko=_.div({class:"cms-date-month"});ko.appendChild(_.div({class:"cms-date-month-title"},ue.format(Ks)));const zi=_.div({class:"cms-date-weekdays"});ot.forEach(qs=>zi.appendChild(_.div({class:"cms-date-weekday"},qs))),ko.appendChild(zi);const Ti=_.div({class:"cms-date-grid"});for(let qs=0;qs<42;qs+=1){const Vo=new Date($o.getFullYear(),$o.getMonth(),$o.getDate()+qs),Cn=X(Vo),Pi=Vo.getMonth()===Gs,Ji=Yt(Cn),Ri=Xt(Cn),Mi=(r==="range"||r==="range-multiple")&&Dt().some(yn=>ce(yn==null?void 0:yn.from,Cn)),Oi=(r==="range"||r==="range-multiple")&&Dt().some(yn=>ce(yn==null?void 0:yn.to,Cn)),Bo=!Te(Cn),jo={...ke(Cn),selected:Ji,inRange:Ri,rangeStart:Mi,rangeEnd:Oi,disabled:Bo,outside:!Pi,value:rt,select:()=>Qt(Cn,null,{visibleMonthOffset:$t})},Ho=at(jo),dl=JSswift.ui.renderSlot(c,"day",jo,String(Vo.getDate())),fl=J(null,"default",jo,dl),ml=_.button({type:"button",class:te(["cms-date-day",ye(!Pi,"is-outside"),ye(Ji,"is-selected"),ye(Ri,"is-in-range"),ye(Mi,"is-range-start"),ye(Oi,"is-range-end"),ye(Bo,"is-disabled"),ye(ce(Cn,fe()),"is-today"),ye(Ho.length,"has-point")]),disabled:Bo,onMouseDown:yn=>{yn.button===0&&(k=Cn,yn.preventDefault(),Qt(Cn,yn,{visibleMonthOffset:$t}))},onClick:yn=>{if(k!=null&&yn.detail!==0){k=null;return}k=null,Qt(Cn,yn,{visibleMonthOffset:$t})},onMouseEnter:()=>on(Cn),onFocus:()=>on(Cn,{render:!1})},_.span({class:"cms-date-day-label"},...fl),Ho.length?_.span({class:"cms-date-day-point"},...Ho):null);Ti.appendChild(ml)}return ko.appendChild(Ti),ko},Tt=Q(),Ht=ve(),sn=[S.getFullYear(),(fi=de(fe()))==null?void 0:fi.getFullYear(),(mi=de(Tt))==null?void 0:mi.getFullYear(),(hi=de(Ht))==null?void 0:hi.getFullYear(),(pi=de(o(n.defaultMonth)))==null?void 0:pi.getFullYear()];r==="range"?sn.push((gi=de(rt==null?void 0:rt.from))==null?void 0:gi.getFullYear(),(yi=de(rt==null?void 0:rt.to))==null?void 0:yi.getFullYear()):r==="range-multiple"?rt.forEach(At=>{var $t,Ln;sn.push(($t=de(At==null?void 0:At.from))==null?void 0:$t.getFullYear(),(Ln=de(At==null?void 0:At.to))==null?void 0:Ln.getFullYear())}):r==="multiple"?rt.forEach(At=>{var $t;return sn.push(($t=de(At))==null?void 0:$t.getFullYear())}):sn.push((bi=de(rt))==null?void 0:bi.getFullYear());const dn=sn.filter(At=>Number.isFinite(At)),Pn=(dn.length?Math.min(...dn):S.getFullYear())-100,Sn=(dn.length?Math.max(...dn):S.getFullYear())+50,hn=Number(o((Si=(vi=n.yearStart)!=null?vi:Tt?(wi=de(Tt))==null?void 0:wi.getFullYear():null)!=null?Si:Pn)),ss=Number(o((_i=(xi=n.yearEnd)!=null?xi:Ht?(Ci=de(Ht))==null?void 0:Ci.getFullYear():null)!=null?_i:Sn)),hs=_.select({class:"cms-date-select",value:String(S.getMonth()),onChange:At=>{var $t;S=new Date(S.getFullYear(),Number(At.currentTarget.value),1),($t=n.onNavigate)==null||$t.call(n,{month:S.getMonth()+1,year:S.getFullYear()}),rn()}},...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(S.getFullYear()),onChange:At=>{var $t;S=new Date(Number(At.currentTarget.value),S.getMonth(),1),($t=n.onNavigate)==null||$t.call(n,{month:S.getMonth()+1,year:S.getFullYear()}),rn()}},...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;S=be(S,-1),(At=n.onNavigate)==null||At.call(n,{month:S.getMonth()+1,year:S.getFullYear()}),rn()}},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;S=be(S,1),(At=n.onNavigate)==null||At.call(n,{month:S.getMonth()+1,year:S.getFullYear()}),rn()}},Ne.Icon({name:"chevron_right",size:16}))),js=_.div({class:"cms-date-shortcuts"}),Hs=o((ki=n.shortcuts)!=null?ki:n.presets)||[];Hs.forEach((At,$t)=>{var Ks,_o;if(!At)return;const Ln=typeof At.value=="function"?At.value({today:fe()}):At.value,Gs=(_o=(Ks=At.label)!=null?Ks:At.text)!=null?_o:`Preset ${$t+1}`;js.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>wt(Ln,null,{preserveTime:le(),timeValue:$e()})},Gs))});const Ws=_.div({class:"cms-date-months"});for(let At=0;At<N();At+=1)Ws.appendChild(mt(be(S,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))),Us=_.div({class:"cms-time-header"}),il=_.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"));Us.appendChild(il);const ll=le()?Xo({props:{min:o((Ni=n.timeMin)!=null?Ni:n.minTime),max:o((Ai=n.timeMax)!=null?Ai:n.maxTime),use12h:o((Ii=(Li=n.time12h)!=null?Li:n.use12h)!=null?Ii: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((Ei=n.timeShortcuts)!=null?Ei:n.timePresets),onSelect:At=>{const $t=go(A);st(At,null),Gt({scrollState:$t})}}):null,rl=_.div({class:"cms-date-footer-info"},Is),al=_.div({class:te(["cms-date-footer",ye(le(),"has-time")])},rl,_.div({class:"cms-date-actions"},_.button({type:"button",class:"cms-date-action",onClick:mn},o(n.todayLabel)||"Oggi"),o(n.clearable)!==!1?_.button({type:"button",class:"cms-date-action",onClick:an},o(n.clearLabel)||"Reset"):null,o(n.confirm)?_.button({type:"button",class:"cms-date-action is-primary",onClick:An},o(n.applyLabel)||"Applica"):null)),cl=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:Tn},o(n.nowLabel)||"Ora")),ul=le()?_.div({class:"cms-date-time"},Us,ll,cl):null;A.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):cn())}},As,Hs.length?js:null,_.div({class:"cms-data-time"},Ws,ul),al))};function Vn(){var y,ue,Je,ot;return u||o(n.disabled)||o(n.readonly)||(Be=h(qe),Pe=Ut(z),M=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 A=_.div({class:qt(["cms-date-panel",o(w),ye(mt>1,"multi-month"),n.panelClass])}),rn(),A},{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(le(),"has-time")]),onClose:()=>{var rt;u=null,A=null,M=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 cn(){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((ln=o(n.monthsToShow))!=null?ln:y);A=_.div({class:qt(["cms-date-panel","cms-date-calendar",o(w),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(),cn());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(),an())}),!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===""?an():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)}),O&&O.watch(y=>{const ue=q(y),Je=ae(y);De(ue,Je)!==De(qe,z)&&(qe=ue,Be=h(qe),z=Ut(Je),Pe=Ut(Je),M=null,St(qe),Rt(),rn())},i?"UI.Calendar:watch":"UI.Datepicker:watch"),JSswift.reactive.effect(()=>{!O&&n.value!=null?(qe=q(o(n.value)),Be=h(qe),z=ae(o(n.value)),Pe=Ut(z)):le()&&n.timeValue!=null&&(z=ae(o(n.timeValue)),Pe=Ut(z)),Rt(),rn(),u&&o(n.disabled)&&cn()},i?"UI.Calendar:render":"UI.Datepicker:render"),i?(A._calendar=A,A._date=A,A._getValue=()=>Ee(qe,z),A._setValue=y=>Pt(y,null,{emit:!1,timeValue:ae(y)}),A._clear=an,A._select=y=>{const ue=a(y);ue&&Qt(ue,null)},A._time=()=>Ut(z),A):(dt._input=Ge,dt._date=Ge,dt._open=Vn,dt._close=cn,dt._getValue=()=>Ee(qe,z),dt._setValue=y=>Pt(y,null,{emit:!1,timeValue:ae(y)}),dt._time=()=>Ut(z),dt._panel=()=>(u==null?void 0:u.panel)||null,dt)};Ne.Datepicker=(...t)=>Zo(t),Ne.Calendar=(...t)=>Zo(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 P,q,Q,ve,E;const g=Kn(kn(b?b.get():(P=o(e.value))!=null?P:O,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((q=e.withSeconds)!=null?q: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((E=e.use12h)!=null?E:e.ampm)}},w=()=>{var P;const g=Number(o((P=e.minuteStep)!=null?P:1));return Math.max(1,Math.min(30,Number.isFinite(g)?g:5))},d=()=>{var P;const g=Number(o((P=e.secondStep)!=null?P: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=en(r,"UI.Time:model"),O=b?b.get():o(e.value),C=g=>kn(g,c()),v=g=>po(g,c()),T=g=>Kn(g,c()),le=g=>JSON.stringify(T(g));let Z=Ut(C(O)),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,de=_.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:v(Z)});de.setAttribute("aria-haspopup","dialog");const _e=_.div({style:{display:"contents"}}),be=_.div({class:"cms-time-control",style:{display:"contents"}},de,_e),me=Ne.FormField({...se,iconRight:(x=e.iconRight)!=null?x:"schedule",control:be,getValue:()=>de.value,onClear:()=>{o(e.disabled)||o(e.readonly)||(re(null,null,{commit:!0}),H&&B())},onFocus:()=>de.focus()}),fe=()=>o(e.confirm)?he:Z,ce=()=>{_e.replaceChildren();const g=o(e.name);g&&_e.appendChild(_.input({type:"hidden",name:g,value:T(Z)}))},$=()=>{var g;de.readOnly=!o(e.manualInput),de.disabled=!!o(e.disabled),de.setAttribute("aria-expanded",H?"true":"false"),de.value=v(Z),ce(),(g=me._refresh)==null||g.call(me)},re=(g,P,q={})=>{var m,N;const Q=Ut(C(g));if(o(e.confirm)&&q.commit!==!0)return he=Ut(Q),f(),Q;const ve=le(Z);Z=Ut(Q),he=Ut(Q),$(),f(),b&&q.fromModel!==!0&&b.set(T(Q));const E=le(Q);if(q.emit!==!1&&E!==ve){const I=T(Q);(m=e.onInput)==null||m.call(e,I,P),(N=e.onChange)==null||N.call(e,I,P)}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={})=>{Qo(W,g)},F=()=>{const g=go(W);re(new Date,null,{commit:!o(e.confirm)}),Se({scrollState:g}),!o(e.confirm)&&e.closeOnSelect===!0&&B()},p=()=>{o(e.confirm)&&(re(he,null,{commit:!0}),e.closeOnSelect!==!1&&B())},f=()=>{var N,I,K,ke;if(!W)return;const g=fe(),P=v(g),q=_.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")),q.appendChild(Q);const E=Xo({props:{min:o((N=e.min)!=null?N:e.minTime),max:o((I=e.max)!=null?I: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:w(),secondStep:d(),disabled:!!o(e.disabled),readonly:!!o(e.readonly),pointIcon:o(e.pointIcon),shortcuts:o((ke=e.shortcuts)!=null?ke:e.presets),onSelect:(Oe,Te)=>{const U=go(W);re(Oe,null),Se({scrollState:U}),oe(Te)&&B()}}),m=_.div({class:"cms-time-footer"},_.div({class:"cms-time-value"},...J(s,"value",{value:g,displayValue:P},P||J(s,"default",{},n))),_.div({class:"cms-time-actions"},_.button({type:"button",class:"cms-time-action",onClick:F},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:p},o(e.applyLabel)||"Applica"):null));W.replaceChildren(_.div({class:"cms-time-panel-root",onKeydown:Oe=>{Oe.key==="Escape"&&(Oe.preventDefault(),B())}},q,E,m))};function h(){var g,P,q,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])}),f(),W),{type:"time",anchorEl:me._control||de,placement:e.placement||"bottom-start",offsetX:(g=e.offsetX)!=null?g:0,offsetY:(q=(P=e.offsetY)!=null?P:e.offset)!=null?q: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),_s(H),Se(),$(),(Q=e.onOpen)==null||Q.call(e)),H}function B(){if(!H)return;const g=H;ks(g,()=>JSswift.overlay.close(g.id))}return de.addEventListener("focus",g=>{var P;(P=e.onFocus)==null||P.call(e,g),e.openOnFocus!==!1&&h()}),de.addEventListener("click",g=>{var P;(P=e.onClick)==null||P.call(e,g),h()}),de.addEventListener("keydown",g=>{if(g.key==="Escape"){H&&(g.preventDefault(),B());return}(g.key==="ArrowDown"||g.key==="Enter"||g.key===" ")&&(g.preventDefault(),h()),(g.key==="Backspace"||g.key==="Delete")&&!o(e.manualInput)&&o(e.clearable)!==!1&&(g.preventDefault(),re(null,g,{commit:!0}))}),o(e.manualInput)?(de.addEventListener("input",g=>{var P;return(P=e.onTyping)==null?void 0:P.call(e,de.value,g)}),de.addEventListener("change",g=>re(de.value,g)),de.addEventListener("blur",g=>{var P;(P=e.onBlur)==null||P.call(e,g),de.value===""?re(null,g):re(de.value,g)})):de.addEventListener("blur",g=>{var P;return(P=e.onBlur)==null?void 0:P.call(e,g)}),b&&b.watch(g=>{const P=Ut(C(g));le(P)!==le(Z)&&(Z=Ut(P),he=Ut(P),$(),f())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!b&&e.value!=null&&(Z=Ut(C(o(e.value))),he=Ut(Z)),$(),f(),H&&o(e.disabled)&&B()},"UI.Time:render"),me._input=de,me._time=de,me._open=h,me._close=B,me._getValue=()=>T(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 N,I,K,ke,Oe,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",w=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=en(e.model,"UI.Tabs:model"),O=c(e.orientation||e.orient||e.direction),C=w(e.variant||(e.pills?"pills":e.soft?"soft":"line")),v=!!o((I=(N=e.fill)!=null?N:e.navFill)!=null?I:e.stretch),T=!!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,z,Pe,M,k,S,u,A;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=(M=(Pe=(z=(Be=U.label)!=null?Be:U.title)!=null?z:U.name)!=null?Pe:U.value)!=null?M:`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=(S=(k=U.note)!=null?k:U.subtitle)!=null?S:U.description)!=null?u:null,iconFallback:(A=U.icon)!=null?A: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},de=(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=de(b?b.get():i(e,"value")?o(e.value):(ke=e.defaultValue)!=null?ke:e.default,!0),[be,me]=JSswift.reactive.signal(_e),fe=te(["cms-clear-set","cms-tabs","cms-singularity",O,`variant-${C}`,ye(e.dense,"dense"),ye(v,"fill"),ye(T,"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=fe,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((Oe=e.color)!=null?Oe:e.state);$&&(ce.style["--cms-tabs-accent"]=$);const re=_.div(ce),oe=_.div({class:te(["cms-tabs-bar",e.barClass]),style:{alignItems:e.align||(O==="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":O}),F=[],p=()=>se(be()),f=()=>{const U=p();return U>=0?H[U]:null},h=()=>({tabs:H,value:be(),active:be(),activeIndex:p(),activeTab:f(),orientation:O,variant:C,select:(U,j)=>g(U,{event:j,emit:!0}),next:()=>q(),prev:()=>Q()}),B=(U,j,ne)=>({...h(),tab:U,index:j,active:ne,disabled:!!U.disabled,select:Ve=>P(j,{event:Ve,emit:!0})}),ie=U=>{var ne;const j=(ne=F[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):"",F.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:P(ne,j)},P=(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},q=()=>{const U=X(p()<0?-1:p(),1);U>=0&&P(U,{emit:!0,focus:!0})},Q=()=>{const U=p()<0?0:p(),j=X(U,-1);j>=0&&P(j,{emit:!0,focus:!0})},ve=(U,j)=>{var S,u,A,xe,Ue,et;const ne=j===p(),Ve=B(U,j,ne),He=`${Z}-tab-${j}`,ae=U.iconFallback!=null?typeof U.iconFallback=="string"?Ne.Icon({name:U.iconFallback,size:(A=(u=(S=U.iconSize)!=null?S:U.size)!=null?u:e.size)!=null?A: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),z=G=>{var dt;if(U.disabled||le)return;const Ge=G.key;if(Ge==="Enter"||Ge===" "){G.preventDefault(),P(j,{event:G,emit:!0});return}if(Ge==="Home"){G.preventDefault();const St=H.findIndex(It=>!It.disabled);St>=0&&P(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&&P(St,{event:G,emit:!0,focus:!0});return}const lt=O==="vertical"?["ArrowUp"]:["ArrowLeft"],tt=O==="vertical"?["ArrowDown"]:["ArrowRight"];if(lt.includes(Ge)){G.preventDefault();const St=X(j,-1);St>=0&&P(St,{event:G,emit:!0,focus:!0});return}if(tt.includes(Ge)){G.preventDefault();const St=X(j,1);St>=0&&P(St,{event:G,emit:!0,focus:!0})}},Pe=d((xe=U.color)!=null?xe:U.state),M=_.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=>{P(j,{event:G,emit:!0})},onKeydown:z},...Be);return M.appendChild(k),M.appendChild(_.span({class:"tab-indicator"})),F[j]={tab:U,index:j,item:M,btn:k},M};if(H.length){const U=H.map((ne,Ve)=>ve(ne,Ve)),j=JSswift.ui.renderSlot(s,"nav",{...h(),nodes:U},U);J(null,"default",{},j).forEach(ne=>Se.appendChild(ne))}else J(s,"empty",h(),(Te=e.empty)!=null?Te:_.div({class:"cms-tabs-empty"},"Nessuna tab disponibile.")).forEach(U=>Se.appendChild(U));const E=h(),m=[...J(null,"default",{},JSswift.ui.renderSlot(s,"extra",E,null)),...J(s,"default",E,n)];return oe.appendChild(Se),m.length&&oe.appendChild(_.div({class:"cms-tabs-extra"},...m)),re.appendChild(oe),x(_e),b?b.watch(U=>{x(de(U,!0))},"UI.Tabs:watch"):Ye(e.value)&&bt.reactive.effect(()=>{x(de(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=()=>q(),re._prev=()=>Q(),re._getTabs=()=>H.slice(),Nt(re,e),re},Ne.RouteTab=(...t)=>{var ie,a,x,g,P,q,Q,ve,E,m,N,I,K,ke,Oe;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),w=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]||""}},O=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)||"#"},v=()=>{var Te;return o((Te=e.to)!=null?Te:e.href)||""},T=()=>{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=v();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=T();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:w?!!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}`:"",de=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"]);de.href=C(),de.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]),de.style={...e.style||{}};const _e=r((a=e.color)!=null?a:e.state);_e&&(de.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})},fe=()=>({active:H(),disabled:Z(),href:C(),to:v(),external:O(C()),navigate:Te=>{var ne,Ve;if(Z())return!1;const U=v();return!O(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",fe(),me(e.icon,"icon")),$=J(s,"label",fe(),(Q=(q=(P=e.label)!=null?P:e.title)!=null?q:e.text)!=null?Q:n),re=J(s,"note",fe(),(m=(E=(ve=e.note)!=null?ve:e.subtitle)!=null?E:e.caption)!=null?m:e.description),oe=J(s,"badge",fe(),(I=(N=e.badge)!=null?N:e.counter)!=null?I:e.count),Se=J(s,"aside",fe(),(ke=(K=e.aside)!=null?K:e.trailing)!=null?ke:me(e.iconRight,"iconRight")),F=J(s,"default",fe(),(Oe=e.content)!=null?Oe:e.body),p=_.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?$:[v()||C()||""]),re.length?_.span({class:"cms-route-tab-note"},...re):null,F.length?_.span({class:"cms-route-tab-extra"},...F):null),oe.length?_.span({class:"cms-route-tab-badge"},...oe):null,Se.length?_.span({class:"cms-route-tab-aside"},...Se):null),f=_.a(de,p);Nt(f,e);const h=()=>{const Te=H(),U=Z(),j=C(),ne=O(j);f.classList.toggle("active",Te),f.classList.toggle("is-disabled",U),f.classList.toggle("is-external",ne),Te?f.setAttribute("aria-current",String(o(e.ariaCurrent)||"page")):f.removeAttribute("aria-current"),f.setAttribute("href",j||"#"),U?(f.setAttribute("aria-disabled","true"),f.tabIndex=-1):(f.removeAttribute("aria-disabled"),!c("tabIndex")&&!c("tabindex")&&f.removeAttribute("tabindex")),v()?f.dataset.to=String(v()):delete f.dataset.to,ne&&f.target==="_blank"&&!f.rel&&(f.rel="noopener noreferrer")},B=e.onClick;return f.onclick=Te=>{if(B==null||B(Te),!Te.defaultPrevented){if(Z()){Te.preventDefault();return}fe().navigate(Te)}},!w&&v()&&(i!=null&&i.subscribe)&&i.subscribe(()=>h()),JSswift.reactive.effect(()=>{h()},"UI.RouteTab:render"),f._isActive=()=>H(),f._setActive=Te=>(he=Te==null?null:!!Te,h(),f),f._navigate=Te=>fe().navigate(Te),f},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=en(e.model,"UI.Breadcrumbs:model"),w=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",w,d,r,ye(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),O=_.div({class:"cms-breadcrumbs-before"}),C=_.ol({class:"cms-breadcrumbs-list"}),v=_.div({class:"cms-breadcrumbs-after"});b.appendChild(O),b.appendChild(C),b.appendChild(v);const T=$=>{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,F=null)=>{const p=JSswift.ui.getSlot($,re)!=null?J($,re,oe,Se):[];return p.length?p:F&&JSswift.ui.getSlot($,F)!=null?J($,F,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 F,p;const $=c?c.get():o((p=(F=e.items)!=null?F:e.value)!=null?p:e.breadcrumbs),re=[],oe=f=>{if(!(f==null||f===!1)){if(Array.isArray(f)){f.forEach(oe);return}if(typeof f=="string"||typeof f=="number"){re.push({label:String(f)});return}if(f!=null&&f.nodeType||typeof f=="function"){re.push({label:f});return}re.push(f)}},Se=o(e.home);return Se&&oe(Se===!0?{label:"Home",to:"/",icon:"home"}:Se),oe($),!re.length&&(n!=null&&n.length)&&n.forEach(f=>oe(f)),re.filter(f=>!o(f==null?void 0:f.hidden))},X=$=>{const re=$.findIndex(oe=>{var Se,F;return!!o((F=(Se=oe==null?void 0:oe.current)!=null?Se:oe==null?void 0:oe.active)!=null?F:oe==null?void 0:oe.selected)});return re>-1?re:o(e.autoCurrent)===!1?-1:$.length?$.length-1:-1},de=$=>{var h,B,ie,a,x,g,P;const re=Number(o((ie=(B=(h=e.max)!=null?h:e.maxItems)!=null?B: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((q,Q)=>({type:"item",item:q,index:Q,key:`item-${Q}`}));let Se=Number(o((x=(a=e.leadingCount)!=null?a:e.keepStart)!=null?x:1)),F=Number(o((P=(g=e.trailingCount)!=null?g:e.keepEnd)!=null?P:Math.max(1,oe-2)));if(Se=Number.isFinite(Se)?Math.max(1,Math.trunc(Se)):1,F=Number.isFinite(F)?Math.max(1,Math.trunc(F)):Math.max(1,oe-2),Se+F+1>oe&&(F=Math.max(1,oe-Se-1),Se+F+1>oe&&(Se=Math.max(1,oe-F-1))),Se+F>=$.length)return $.map((q,Q)=>({type:"item",item:q,index:Q,key:`item-${Q}`}));const p=[];for(let q=0;q<Se;q++)p.push({type:"item",item:$[q],index:q,key:`item-${q}`});const f=$.slice(Se,$.length-F);p.push({type:"collapsed",key:`collapsed-${Se}-${$.length-F}`,items:f,from:Se,to:$.length-F-1});for(let q=$.length-F;q<$.length;q++)p.push({type:"item",item:$[q],index:q,key:`item-${q}`});return p},_e=($,re=null)=>{var F,p,f,h,B;if(!$)return!1;const oe=o((F=$.href)!=null?F:$.to)||"",Se=o($.to)||"";return!le($)&&Se&&(i!=null&&i.navigate)?(re!=null&&re.preventDefault&&re.preventDefault(),i.navigate(Se),(p=$.onNavigate)==null||p.call($,Se,re||null),(f=e.onNavigate)==null||f.call(e,Se,$,re||null),!0):((h=$.onNavigate)==null||h.call($,Se||oe,re||null),(B=e.onNavigate)==null||B.call(e,Se||oe,$,re||null),!1)},be=($,re,oe)=>{var B,ie,a;const Se=$,F=oe[re+1]||null,p={index:re,entry:$,previous:Se,next:F},f=Z(o((a=(ie=($==null?void 0:$.type)==="item"?(B=$.item)==null?void 0:B.separator:null)!=null?ie:e.separator)!=null?a:"/")),h=H(s,"separator",p,f);return _.li({class:"cms-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"cms-breadcrumbs-separator"},...h))},me=($,re,oe)=>{const Se={type:"collapsed",collapsed:!0,items:re,hiddenItems:$.items,currentIndex:oe,from:$.from,to:$.to},F=_.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"))))),p=H(s,"collapsed",Se,F,"item");return _.li({class:"cms-breadcrumbs-entry is-collapsed"},...p)},fe=($,re,oe,Se)=>{var ae,$e,Ee,De,Ie,qe,Be,z,Pe,M,k,S,u,A,xe,Ue,et,G,Ge,lt,tt,dt,St,It,Rt,Pt;const F=$.item||{},p=F.slots?{...s,...F.slots}:s,f=o((ae=F.href)!=null?ae:F.to)||"",h=!!o(F.disabled),B=$.index===oe,ie=(De=(Ee=($e=F.iconSize)!=null?$e:e.itemSize)!=null?Ee:e.size)!=null?De:null,a=T((Be=(qe=(Ie=F.color)!=null?Ie:F.state)!=null?qe:e.color)!=null?Be:e.state),x=!o(F.color)&&o(F.state)?Vt(o(F.state)):"",g=(S=(k=(M=(Pe=(z=F.label)!=null?z:F.title)!=null?Pe:F.text)!=null?M:F.to)!=null?k:F.href)!=null?S:"",P=(xe=(A=(u=F.note)!=null?u:F.subtitle)!=null?A:F.caption)!=null?xe:F.description,q=(et=(Ue=F.badge)!=null?Ue:F.counter)!=null?et:F.count,Q=(Ge=(G=F.aside)!=null?G:F.trailing)!=null?Ge:W(F.iconRight,ie,"iconRight"),ve=(lt=F.content)!=null?lt:F.body,E={item:F,index:$.index,visibleIndex:Se,total:re.length,current:B,active:B,disabled:h,href:f,to:o(F.to)||"",external:le(F),isFirst:$.index===0,isLast:$.index===re.length-1,navigate:st=>_e(F,st)},m=H(p,"icon",E,W(F.icon,ie,"icon")),N=H(p,"label",E,g),I=H(p,"note",E,P),K=H(p,"badge",E,q),ke=H(p,"aside",E,Q),Oe=H(p,"default",E,ve),Te=_.span({class:"cms-breadcrumb-inner"},m.length?_.span({class:"cms-breadcrumb-icon"},...m):null,_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},...N.length?N:[f||""]),I.length?_.span({class:"cms-breadcrumb-note"},...I):null,Oe.length?_.span({class:"cms-breadcrumb-extra"},...Oe):null),K.length?_.span({class:"cms-breadcrumb-badge"},...K):null,ke.length?_.span({class:"cms-breadcrumb-aside"},...ke):null),U=!h&&(!B||!!o((tt=F.linkCurrent)!=null?tt:e.linkCurrent)),j={class:te(["cms-breadcrumb","cms-clear-set","cms-singularity",ye(B,"is-current"),ye(B,"active"),ye(h,"is-disabled"),x?`cms-state-${x}`:"",F.class]),style:{...F.style||{}},"aria-current":B?String(o((dt=F.ariaCurrent)!=null?dt:e.ariaCurrent)||"page"):null};a&&(j.style["--cms-breadcrumb-accent"]=a);let ne=null;U&&f?(ne=_.a({...j,href:f,target:F.target,rel:F.rel,onClick:st=>{var wt,Ft;(wt=F.onClick)==null||wt.call(F,st,E),(Ft=e.onItemClick)==null||Ft.call(e,F,E,st),!st.defaultPrevented&&E.navigate(st)}},Te),E.external&&ne.target==="_blank"&&!ne.rel&&(ne.rel="noopener noreferrer")):U&&typeof F.onClick=="function"?ne=_.button({...j,type:F.type||"button",onClick:st=>{var wt,Ft;(wt=F.onClick)==null||wt.call(F,st,E),(Ft=e.onItemClick)==null||Ft.call(e,F,E,st)}},Te):ne=_.span({...j,"aria-disabled":h?"true":null},Te),Nt(ne,{size:(It=(St=F.size)!=null?St:e.itemSize)!=null?It:e.size,radius:(Rt=F.radius)!=null?Rt:e.radius,gradient:(Pt=F.gradient)!=null?Pt:e.gradient});const He=H(p,"item",E,ne);return _.li({class:te(["cms-breadcrumbs-entry",ye(B,"is-current"),ye(h,"is-disabled")])},...He)},ce=()=>{var p;const $=se(),re=X($),oe=de($),Se=T((p=e.color)!=null?p:e.state);b.classList.toggle("is-empty",$.length===0),Se?b.style.setProperty("--cms-breadcrumb-accent",Se):b.style.removeProperty("--cms-breadcrumb-accent");const F={items:$,visibleItems:oe,currentIndex:re,count:$.length,collapsed:oe.some(f=>f.type==="collapsed")};if(he(O,H(s,"before",F,e.before)),he(v,H(s,"after",F,e.after)),C.innerHTML="",!$.length){const f=H(s,"empty",F,e.empty);f.length&&C.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...f));return}oe.forEach((f,h)=>{h>0&&C.appendChild(be(oe[h-1],h-1,oe)),C.appendChild(f.type==="collapsed"?me(f,$,re):fe(f,$,re,h))})};return bt.reactive.effect(()=>{ce()},"UI.Breadcrumbs:render"),b.getItems=()=>se(),b.getVisibleItems=()=>de(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=en(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"}),w=_.div({class:"cms-pagination-controls"}),d=_.div({class:"cms-pagination-start"}),r=_.div({class:"cms-pagination-pages"}),b=_.div({class:"cms-pagination-end"}),O=_.div({class:"cms-pagination-summary"});w.appendChild(d),w.appendChild(r),w.appendChild(b),c.appendChild(w),c.appendChild(O);let C=1,v=1;const T=(a,x=0)=>{const g=o(a);if(g==null||g==="")return x;const P=Number(g);return Number.isFinite(P)?Math.trunc(P):x},le=(a,x=Z())=>{const g=Number(a),P=Number.isFinite(g)?Math.trunc(g):1;return Math.min(Math.max(P||1,1),Math.max(1,x||1))},Z=()=>{var P,q,Q,ve,E,m,N;const a=T((Q=(q=(P=e.max)!=null?P:e.pages)!=null?q:e.pageCount)!=null?Q:e.totalPages,0);if(a>0)return a;const x=T((E=(ve=e.total)!=null?ve:e.totalItems)!=null?E:e.count,0),g=T((N=(m=e.pageSize)!=null?m:e.perPage)!=null?N:e.limit,0);return x>=0&&g>0?Math.max(1,Math.ceil(x/g)):1},he=()=>{var a,x,g;return T(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,T((x=(a=e.siblings)!=null?a:e.siblingCount)!=null?x:e.window,1))},W=()=>{var a,x;return Math.max(0,T((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},de=()=>o(e.showPages)!==!1&&!o(e.simple),_e=()=>o(e.showPrev)!==!1,be=()=>o(e.showNext)!==!1,me=()=>!!o(e.showEdges),fe=()=>{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,P;const a=o((P=(g=e.total)!=null?g:e.totalItems)!=null?P: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,P;const a=o((P=(g=e.pageSize)!=null?g:e.perPage)!=null?P: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=v)=>{const g=re(),P=oe(),q=g!=null&&P?g===0?0:(a-1)*P+1:null,Q=g!=null&&P?Math.min(g,a*P):null;return{page:a,value:a,current:a,currentPage:a,pages:x,max:x,total:g,pageSize:P,from:q,to:Q,disabled:se(),isFirst:a<=1,isLast:a>=x,canPrev:a>1,canNext:a<x,setPage:(ve,E)=>ie(ve,E),prev:ve=>ie(a-1,ve),next:ve=>ie(a+1,ve),first:ve=>ie(1,ve),last:ve=>ie(x,ve)}},F=(a,x)=>{if(x<=0)return[];const g=[],P=new Set,q=W(),Q=H();for(let E=1;E<=Math.min(q,x);E++)P.add(E);for(let E=Math.max(1,a-Q);E<=Math.min(x,a+Q);E++)P.add(E);for(let E=Math.max(1,x-q+1);E<=x;E++)P.add(E);let ve=0;for(let E=1;E<=x;E++)P.has(E)&&(ve&&E-ve>1&&g.push({type:"ellipsis",key:`ellipsis-${ve}-${E}`}),g.push({type:"page",page:E,key:`page-${E}`}),ve=E);return g.length||g.push({type:"page",page:1,key:"page-1"}),g},p=(a,x,g,P=null)=>{const q=JSswift.ui.getSlot(n,a)!=null?J(n,a,g,x):[];return q.length?q:P&&JSswift.ui.getSlot(n,P)!=null?J(n,P,g,x):J(null,"default",g,x)},f=(a,x)=>{a.innerHTML="",x.forEach(g=>a.appendChild(g))},h=(a,x,g,P={})=>{var Q;const q={...Se(),kind:a,active:!!P.active};return Ne.Btn({class:te(["cms-pagination-btn",`cms-pagination-${a}`,ye(P.active,"active"),P.class]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:P.active?e.color||e.state||"primary":P.color||null,outline:P.active?!1:(Q=P.outline)!=null?Q:!0,disabled:se()||!!P.disabled,"aria-current":P.active?"page":null,onClick:ve=>{se()||P.disabled||g==null||g(ve)}},...p(a,x,q,a==="summary"?"label":a==="page"?"item":null))},B=(a,x)=>{C=le(a,x),v=Math.max(1,x||1);const g=Se(C,v);c.style.display=$()&&v<=1?"none":"",O.style.display=X()?"":"none",r.style.display=de()?"":"none",d.innerHTML="",r.innerHTML="",b.innerHTML="";const P=p("start",e.start,g);P.length&&d.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-start"},...P)),fe()&&d.appendChild(h("first","\xAB",ve=>ie(1,ve),{disabled:C<=1})),_e()&&d.appendChild(h("prev","Prev",ve=>ie(C-1,ve),{disabled:C<=1})),de()&&F(C,v).forEach(ve=>{if(ve.type==="ellipsis"){const N={...g,kind:"ellipsis"},I=p("ellipsis","\u2026",N);r.appendChild(_.span({class:"cms-pagination-ellipsis","aria-hidden":"true"},...I));return}const E=ve.page,m={...g,page:E,value:E,item:ve,active:E===C};r.appendChild(Ne.Btn({class:te(["cms-pagination-btn","cms-pagination-page-btn",ye(E===C,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:E===C?e.color||e.state||"primary":null,outline:E!==C,disabled:se(),"aria-current":E===C?"page":null,onClick:N=>ie(E,N)},...p("page",String(E),m,"item")))}),be()&&b.appendChild(h("next","Next",ve=>ie(C+1,ve),{disabled:C>=v})),ce()&&b.appendChild(h("last","\xBB",ve=>ie(v,ve),{disabled:C>=v}));const q=p("end",e.end,g);q.length&&b.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...q));let Q=`Pagina ${C} di ${v}`;g.total!=null&&g.pageSize&&(Q=g.total===0?"0 risultati":`${g.from}-${g.to} di ${g.total}`),f(O,p("summary",Q,g,"label"))},ie=(a,x=null)=>{var q,Q;const g=Z(),P=le(a,g);return P===C&&g===v||(B(P,g),s&&s.get()!==P&&s.set(P),(q=e.onChange)==null||q.call(e,P,Se(P,g),x),(Q=e.onPageChange)==null||Q.call(e,P,Se(P,g),x)),P};return bt.reactive.effect(()=>{const a=Z(),x=he(),g=le(x,a);B(g,a),s&&x!==g&&s.set(g)},"UI.Pagination:sync"),c.getPage=()=>C,c.getPages=()=>v,c.setPage=a=>ie(a),c.prev=()=>ie(C-1),c.next=()=>ie(C+1),c.first=()=>ie(1),c.last=()=>ie(v),Nt(c,e),c},Ne.Spinner=(...t)=>{var se;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(X,de,_e)=>{if(Ye(X))return()=>{const me=o(X);if(me==null||me===!1||me==="")return _e;const fe=de?de(me):me;return fe==null||fe===""?_e:fe};if(X==null||X===!1||X==="")return _e;const be=de?de(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:""},w=Ct(e.state,()=>{const X=Vt(o(e.state));return X?`cms-state-${X}`:""}),d=te(["cms-spinner",w,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 O={props:e},C=J(s,"label",O,e.label),v=J(s,"default",O,n),T=J(s,"note",O,e.note),le=C.length||v.length||T.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",O,Z),H=[];he.length&&H.push(...he),le&&H.push(_.div({class:"cms-spinner-content"},C.length?_.div({class:"cms-spinner-label"},...C):null,v.length?_.div({class:"cms-spinner-copy"},...v):null,T.length?_.div({class:"cms-spinner-note"},...T):null));const W=_.div(r,...H);return Nt(W,e),W},Ne.Progress=(...t)=>{var I,K,ke,Oe,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=en(i,"UI.Progress:model"),w=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},O=()=>{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)},v=ae=>{const $e=r(),Ee=b(),De=d(ae,$e);return Math.min(Ee,Math.max($e,De))},T=ae=>{const $e=r(),De=b()-$e;if(!De)return 0;const Ie=(v(ae)-$e)/De,qe=o(e.reverse)?1-Ie:Ie;return Math.max(0,Math.min(1,qe))},le=ae=>{const $e=v(ae);return $e<de()?de():$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={})=>Vs(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,[de,_e]=JSswift.reactive.signal(v(c?c.get():(K=(I=o(e.value))!=null?I:o(e.min))!=null?K:0)),[be,me]=JSswift.reactive.signal(le((Te=o(e.buffer))!=null?Te:c?c.get():(Oe=(ke=o(e.value))!=null?ke:o(e.min))!=null?Oe:0)),fe=(ae,$e={})=>{const Ee=v(ae);return de()!==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"),w,e.class]),$.style=re;const Se=_.div({class:"cms-progress-header"}),F=_.div({class:"cms-progress-heading"}),p=_.div({class:"cms-progress-label"}),f=_.div({class:"cms-progress-note"}),h=_.div({class:"cms-progress-value"});F.append(p,f),Se.append(F,h);const B=_.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",w,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")])}),P=_.span({class:"cms-progress-bar-label"});g.appendChild(P),a.append(x,g);const q=_.span({class:"cms-progress-edge-label cms-progress-edge-label-right"});B.append(ie,a,q);const Q=_.div($,Se,B);Nt(g,e);const ve=()=>{const ae=de(),$e=T(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),z=J(s,"iconRight",Ee,null),Pe=z.length?[]:se(e.iconRight,"iconRight",Ee),M=J(s,"note",Ee,X(e.note)),k=e.valueLabel!=null?X(e.valueLabel):Z(ae,$e,Ee),S=o(e.showValue),u=S===!0||e.valueLabel!=null||JSswift.ui.getSlot(s,"value")!=null?J(s,"value",Ee,k):[];H(p,[...Ie,...De,...Be,...Pe,...z],"inline-flex"),H(f,M,"block"),H(h,S==="inside"?[]:u,"inline-flex"),Se.style.display=p.childNodes.length||f.childNodes.length||h.childNodes.length?"flex":"none"},E=()=>{var qe,Be;const ae=de(),$e=T(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(q,J(s,"endLabel",Ee,Ie),"inline-flex")},m=()=>{const ae=de(),$e=T(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(P,qe,"inline-flex")},N=()=>{const ae=de(),$e=be(),Ee=r(),De=b(),Ie=T(ae)*100,qe=T($e)*100,Be=C(e.color,""),z=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)"),M=o(e.ariaLabel),k=o(e.ariaValueText),S=!!o(e.indeterminate),u=o(e.radius);Q.style.width=o(e.width)||"100%",Q.style.setProperty("--cms-progress-height",O()),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=z,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)")),S?(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))),M!=null?a.setAttribute("aria-label",String(M)):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)):S?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",q.childNodes.length>0),Q.classList.toggle("has-inside-label",P.childNodes.length>0)};return c?(fe(c.get(),{fromModel:!0}),c.watch(ae=>{fe(ae,{fromModel:!0})},"UI.Progress:watch")):Ye(e.value)?JSswift.reactive.effect(()=>{fe(o(e.value),{fromModel:!0})},"UI.Progress:value"):fe((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(),E(),m(),N()},"UI.Progress:render"),Q._track=a,Q._bar=g,Q._buffer=x,Q._getValue=de,Q._getBuffer=be,Q._setValue=ae=>fe(ae),Q._setBuffer=ae=>ce(ae),Q},Ne.LoadingBar=function(...e){var m,N;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),i=(I,K)=>{const ke=Number(I);return Number.isFinite(ke)?ke:K},c=()=>i(o(n.min),0),w=()=>{const I=c(),K=i(o(n.max),100);return K<I?I:K},d=I=>{const K=c(),ke=w(),Oe=i(I,K);return Math.min(ke,Math.max(K,Oe))},r=(I,K="")=>I==null||I===!1||I===""?K:typeof I=="number"?`${I}px`:String(I),b=I=>{const K=o(I);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},O=n.model||(vt(n.value)||gt(n.value)?n.value:null),C=en(O,"UI.LoadingBar:model"),v=vt(n.buffer)||gt(n.buffer)?n.buffer:null,T=en(v,"UI.LoadingBar:buffer"),le=C?C.get():(m=o(n.value))!=null?m:c(),Z=T?T.get():(N=o(n.buffer))!=null?N:le,[he,H]=JSswift.reactive.signal(d(le)),[W,se]=JSswift.reactive.signal(Math.max(d(Z),d(le))),[X,de]=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)},fe=()=>{be&&(clearTimeout(be),be=null)},ce=(I,K={})=>{const ke=!!I;return X()!==ke&&de(ke),K.fromExternal!==!0&&typeof n.onVisibleChange=="function"&&n.onVisibleChange(ke),ke},$=(I,K={})=>{const ke=d(I);return he()!==ke&&H(ke),W()<ke&&(se(ke),T&&K.fromExternal!==!0&&T.set(ke)),C&&K.fromExternal!==!0&&C.set(ke),ke},re=(I,K={})=>{const ke=Math.max($(he(),{fromExternal:!0}),d(I));return W()!==ke&&se(ke),T&&K.fromExternal!==!0&&T.set(ke),ke},oe=(I=he())=>{n.visible==null&&(o(n.indeterminate)||I>c()?ce(!0):o(n.hideOnZero)!==!1&&ce(!1))},Se=()=>{if(me(),o(n.trickle)===!1||o(n.indeterminate))return;const I=i(o(n.trickleInterval),280);I<=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 Oe=i(o(n.trickleStep),K<45?12:K<75?7:3);$(Math.min(ke,K+Oe))},I))},F=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"]);F.class=te(["cms-loading-bar",n.class]),F.style={...n.style||{}};const p=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"]);p.class=te(["cms-loading-bar-progress",n.progressClass,p.class]),p.style={...n.progressStyle||{}},p.value=[he,H],p.buffer=[W,se],p.dense==null&&(p.dense=!0),p.height==null&&p.thickness==null&&p.size==null&&(p.height=3),p.width==null&&(p.width="100%");const f=_.div(F),h=Ne.Progress(p,...s);f.appendChild(h);const B=I=>{fe();const K=$(I);return oe(K),f},ie=I=>{fe();const K=re(I);return oe(K),f},a=(I=(K=>(K=o(n.step))!=null?K:8)())=>{fe();const ke=he(),Oe=$(ke+i(I,0));return oe(Oe),f},x=(I=(K=>(K=o(n.startValue))!=null?K:12)())=>{fe();const ke=Math.max(he(),d(I));return $(ke),re(Math.max(W(),ke)),oe(ke),Se(),f},g=(I=(K=>(K=o(n.resetValue))!=null?K:c())())=>{fe(),me();const ke=d(I);return re(ke),$(ke),oe(ke),f},P=(I=(K=>(K=o(n.doneValue))!=null?K:w())())=>{var Te;fe(),me();const ke=d(I);re(ke),$(ke),oe(ke);const Oe=Math.max(0,i((Te=o(n.hideDelay))!=null?Te:o(n.doneDelay),220));return be=setTimeout(()=>{g()},Oe),f},q=(...I)=>P(...I),Q=()=>(ce(!0),f),ve=()=>(fe(),me(),ce(!1),f),E=()=>(fe(),me(),f.remove(),null);return f.el=f,f._progress=h,f.get=()=>he(),f.getBuffer=()=>W(),f.set=B,f.setBuffer=ie,f.inc=a,f.start=x,f.done=P,f.complete=P,f.stop=q,f.reset=g,f.show=Q,f.hide=ve,f.destroy=E,f._dispose=E,C?C.watch(I=>{$(I,{fromExternal:!0}),oe(d(I))},"UI.LoadingBar:watch"):Ye(n.value)&&JSswift.reactive.effect(()=>{const I=d(o(n.value));$(I,{fromExternal:!0}),oe(I)},"UI.LoadingBar:value"),T?T.watch(I=>{re(I,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):Ye(n.buffer)&&JSswift.reactive.effect(()=>{re(o(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const I=c(),K=w(),ke=Math.min(K,Math.max(I,he())),Oe=Math.max(ke,Math.min(K,Math.max(I,W())));ke!==he()&&H(ke),Oe!==W()&&se(Oe)},"UI.LoadingBar:range"),JSswift.reactive.effect(()=>{n.visible!=null&&ce(o(n.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),JSswift.reactive.effect(()=>{var He;const I=o(n.position)||"fixed",K=o(n.inset),ke=o(n.top),Oe=o(n.right),Te=o(n.bottom),U=o(n.left),j=o(n.width),ne=n.visible!=null?!!o(n.visible):X(),Ve=I==="static"||I==="relative";f.classList.toggle("is-visible",ne),f.classList.toggle("is-inline",Ve),f.classList.toggle("has-track",!!o(n.trackColor)),f.style.position=I,f.style.zIndex=String((He=o(n.zIndex))!=null?He:10002),f.style.width=r(j,Ve?"100%":""),K!=null&&K!==""?(f.style.inset=r(K),f.style.removeProperty("top"),f.style.removeProperty("right"),f.style.removeProperty("bottom"),f.style.removeProperty("left")):(f.style.removeProperty("inset"),!Ve&&I!=="sticky"?(f.style.top=r(ke,"0px"),f.style.right=r(Oe,j==null||j===""?"0px":""),f.style.bottom=r(Te,""),f.style.left=r(U,"0px")):(f.style.top=r(ke,""),f.style.right=r(Oe,""),f.style.bottom=r(Te,""),f.style.left=r(U,"")))},"UI.LoadingBar:layout"),Nt(f,n),o(n.mount)!==!1&&b(n.target).appendChild(f),o(n.autoStart)&&x(),f};const ei=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),Hi=new Set(["soft","solid","outline"]),Wi={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},Ui={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},ti=t=>{const e=String(o(t)||"").trim().toLowerCase();return e?ei.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"},Gi=t=>{const e=String(o(t)||"").trim().toLowerCase();return Hi.has(e)?e:"soft"},Ki=(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,O,C,v,T,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=Ki((r=(d=n.timeout)!=null?d:n.duration)!=null?r:n.delay,s),c=(C=(O=(b=n.closable)!=null?b:n.dismissible)!=null?O:n.dismiss!=null)!=null?C:i===0,w=n.title===void 0?n.label===void 0?Wi[s]:n.label:n.title;return{...n,type:s,state:s,title:w,message:(le=(T=(v=n.message)!=null?v:n.content)!=null?T: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:ti(n.position),variant:Gi(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},ni=(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 w={};return jn(i)?w={...i,message:s}:jn(c)?w={...c,message:s,title:i}:w={message:s,title:i},e&&!w.type&&!w.state&&!w.color&&(w.type=e),w.title==null&&n&&(w.title=n),$n(w,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,ni(n,t,e))},yo=(t,e,n)=>{if(t===!1)return!1;if(typeof t=="function"){const s=t();return yo(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,ni(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,w,d,r,b,O,C,v,T,le,Z,he,H;const n=e.loading===!1?!1:yo(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=yo(typeof e.success=="function"?()=>e.success(se):e.success,"Operazione completata con successo.","Completato");return X!==!1?s!=null?(d=(w=bt.services.notify)==null?void 0:w.update)==null||d.call(w,s,$n(X,"success")):(b=(r=bt.services.notify)==null?void 0:r.show)==null||b.call(r,$n(X,"success")):s!=null&&((C=(O=bt.services.notify)==null?void 0:O.remove)==null||C.call(O,s)),se}catch(W){const se=yo(typeof e.error=="function"?()=>e.error(W):e.error,(W==null?void 0:W.message)||"Operazione fallita.","Errore");throw se!==!1?s!=null?(T=(v=bt.services.notify)==null?void 0:v.update)==null||T.call(v,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,P,q,Q,ve,E;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};wn(i);const c=m=>Object.prototype.hasOwnProperty.call(e,m),w=(x=e.drawerStateKey)!=null?x:Gn;w&&(Gn=w,_n=es(w));const d=()=>es(w),r=()=>Fn(!0,w),b=()=>Fn(!1,w),O=()=>Fn(!d(),w),C={props:e,stateKey:w,isDrawerOpen:d,openDrawer:r,closeDrawer:b,toggleDrawer:O,toggleAside:O},v=(m,N)=>{if(!(N==null||N===!1)){if(Array.isArray(N)){N.forEach(I=>v(m,I));return}if(N!=null&&N.nodeType){m.appendChild(N);return}m.appendChild(document.createTextNode(String(N)))}},T=(m,N,I=K=>K)=>{const K=JSswift.ui.getSlot(s,m);if(K!=null)return J(s,m,C,null);if(typeof N=="function"){const ke=new Set(["eyebrow","title","subtitle"]),Oe=_[ke.has(m)?"span":"div"]({class:`cms-header-slot-${m}`});return JSswift.reactive.effect(()=>{const Te=I(N(C)),U=xn(JSswift.ui.slot(Te));Oe.replaceChildren(),Array.isArray(U)?U.forEach(j=>v(Oe,j)):v(Oe,U)},`UI.Header:${m}`),[Oe]}return J(s,m,C,I(N))},le=(m,N="icon",I=e.iconSize||e.size||"md")=>m==null||m===!1?null:typeof m=="string"?Ne.Icon({name:m,size:I}):JSswift.ui.slot(m,{as:N}),Z=m=>{var I,K;const N=m?(I=e.drawerOpenIcon)!=null?I:"\u2715":(K=e.drawerCloseIcon)!=null?K:"\u2630";return N==null||N===!1?null:typeof N=="string"?N:JSswift.ui.slot(N,{as:m?"drawerOpenIcon":"drawerCloseIcon"})},he=_.span({class:"cms-header-toggle-icon"}),H=m=>{const N=J(null,"default",C,Z(m));he.replaceChildren(...N.length?N:[""])};H(d());const W=Ne.Btn({class:"cms-header-toggle",outline:!0,size:(P=(g=e.toggleSize)!=null?g:e.size)!=null?P:"sm",onClick:O,"aria-label":e.toggleLabel||"Toggle navigation"},he);e.left==null&&e.left!==!1&&!JSswift.ui.getSlot(s,"left")&&qo.add({update:H});const se=e.left===!1?null:e.left!=null?e.left:W,X=c("title")?e.title:(q=e.label)!=null?q:"App",de=(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=[...T("left",se),...T("start",null)],fe=T("icon",e.icon,le),ce=T("eyebrow",(E=e.eyebrow)!=null?E:e.kicker),$=T("title",X),re=T("subtitle",de),oe=T("meta",e.meta),Se=(()=>{const m=T("content",null);return m.length?m:T("default",be)})(),F=[...T("center",null),...T("body",null)],p=[...T("right",_e),...T("end",null)],f=T("actions",e.actions),h=_.div({class:te(["cms-header-body",e.bodyClass,e.centerClass])},_.div({class:"cms-header-heading"},fe.length?_.div({class:"cms-header-icon"},...fe):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)),B=[...p,...f.length?[_.div({class:te(["cms-header-actions",e.actionsClass])},...f)]:[]],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"},...F.length?[_.div({class:te(["cms-header-body",e.bodyClass,e.centerClass])},...F)]:[h],...B.length?[_.div({class:te(["cms-header-end",e.endClass])},...B)]:[]));return Nt(a,e),a},Ne.Drawer=(...t)=>{var Ee,De,Ie,qe,Be,z,Pe,M,k,S;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=u=>Object.prototype.hasOwnProperty.call(e,u),w=(Ee=e.stateKey)!=null?Ee:Gn;w&&(Gn=w,_n=es(w));const d=()=>es(w),r=()=>Fn(!0,w),b=()=>Fn(!1,w),O=()=>Fn(!d(),w),C={props:e,stateKey:w,isDrawerOpen:d,openDrawer:r,closeDrawer:b,toggleDrawer:O,toggleAside:O},v=JSswift==null?void 0:JSswift.store,T=!!(v!=null&&v.get&&(v!=null&&v.set)),le=`${w}:groups`,Z=`${w}:active`;let he=T?v.get(le,{})||{}:{},H=T&&(De=v.get(Z,null))!=null?De:null;const W=new Map,se=new Map,X=u=>{const A=o(u);return A==null||A===!1?[]:Array.isArray(A)?A.flat(1/0):[A]},de=(u,A,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,A);return A==null?[]:J(null,"default",xe,o(A))},_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 A=o(u.href||u.to||u.link||"");return/^(https?:)?\/\//.test(A)},me=(Ie=e.closeOnSelect)!=null?Ie:!0,fe=u=>!!me&&o(u.keepOpen)!==!0,ce=(Be=(qe=e.itemIconSize)!=null?qe:e.size)!=null?Be:"md",$=(z=e.groupOpenIcon)!=null?z:"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}::`)),F=()=>{W.forEach(({el:u,baseActive:A},xe)=>{const Ue=!!A||oe(xe);u.classList.toggle("active",Ue),Ue?u.setAttribute("aria-current","page"):u.removeAttribute("aria-current")}),se.forEach(({wrap:u,toggle:A,baseActive:xe},Ue)=>{const et=!!xe||Se(Ue);u.classList.toggle("active",et),A.classList.toggle("active",et)})},p=u=>{H=u||null,T&&v.set(Z,H),F()},f=(u,A)=>{if(o(u.active)!=null)return!!o(u.active);if(o(u.current)!=null)return!!o(u.current);if(!A||be(u))return!1;try{if(A.startsWith("#"))return window.location.hash===A;const xe=`${window.location.pathname}${window.location.search}${window.location.hash}`;return A===xe||A===window.location.pathname}catch(xe){return!1}},h=(u,A,xe)=>f(u,A)||oe(xe),B=(u=[],A=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-${A}-${et}`,tt=g(G,lt,A,et),dt=xe.concat(tt).join("::");if(h(G,Ge,dt))return!0;const St=G.items||G.children||G.sub;return B(St,A+1,xe.concat(tt))}),ie=(u,A={})=>{var et;const xe=o(u);if(xe==null||xe===!1)return[];const Ue=typeof xe=="string"?Ne.Icon({name:xe,size:(et=A.iconSize)!=null?et:ce}):JSswift.ui.slot(xe,{...A,as:"icon"});return J(null,"default",A,Ue)},a=(u,A,xe={})=>{const Ue=ie(u,xe);return Ue.length?[_.span({class:te(["cms-drawer-item-icon",A])},...Ue)]:[]},x=u=>{const A=o(u.iconPosition)||"left",xe=Object.prototype.hasOwnProperty.call(u,"iconLeft")?u.iconLeft:A!=="right"?u.icon:null,Ue=Object.prototype.hasOwnProperty.call(u,"iconRight")?u.iconRight:A==="right"?u.icon:null;return{left:xe,right:Ue}},g=(u,A,xe,Ue)=>o(u.key||u.id||u.to||u.href||A||`item-${xe}-${Ue}`),P=(u,A)=>T&&Object.prototype.hasOwnProperty.call(he,u)?!!he[u]:A,q=(u,A)=>{T&&(he={...he,[u]:!!A},v.set(le,he))},Q=()=>{const u={...C,area:"header"},A=de(["headerIcon","icon"],e.icon,u),xe=de(["eyebrow"],e.eyebrow,u),Ue=de(["title"],e.title,u),et=de(["subtitle"],e.subtitle,u),G=de(["meta"],e.meta,u),Ge=de(["content"],e.content,u),lt=de(["actions"],e.actions,u),tt=c("header")?J(null,"default",u,o(e.header)):[],dt=A.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])},...A.length?[_.div({class:"cms-drawer-header-icon"},...A)]:[],_.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,A,xe)=>{var G,Ge;return!(((G=u.onClick)==null?void 0:G.call(u,xe,A))===!1||xe!=null&&xe.defaultPrevented||((Ge=e.onSelect)==null?void 0:Ge.call(e,u,A,xe))===!1||xe!=null&&xe.defaultPrevented)},E=(u,A,xe={})=>{const Ue=A.hasChildren?"group":"item",et=J(s,`${Ue}Label`,A,A.label),G=J(s,`${Ue}Note`,A,A.note),Ge=J(s,`${Ue}Badge`,A,A.badge),lt=J(s,`${Ue}Aside`,A,A.aside),tt=J(s,`${Ue}Content`,A,A.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(A.iconLeft,"left",A),...dt.length?[_.div({class:"cms-drawer-item-main"},...dt)]:[],...a(A.iconRight,"right",A),...xe.end||[]]},m=(u=[],A=0,xe=[])=>X(u).map((Ue,et)=>{var ns,Xe,ht,Mt,Kt,Zt,tn,un,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(A)},...J(null,"default",{...C,item:G,level:A,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-${A}-${et}`,St=o((tn=(Zt=(Kt=G.note)!=null?Kt:G.subtitle)!=null?Zt:G.description)!=null?tn:null),It=o((un=G.badge)!=null?un: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,A,et),wt=xe.concat(st).join("::"),{left:Ft,right:Dt}=x(G),Yt=Vt(o(G.state)||o(G.color)||""),Xt=f(G,lt),on=Xt||oe(wt),jt=!!o(G.disabled),Qt={...C,item:G,index:et,level:A,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},an=o(G.divider)===!0||G.type==="divider"||G.type==="separator",mn=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(an)return _.div({class:te(["cms-drawer-separator",G.class]),"data-level":String(A)});if(mn){const Je=J(s,"sectionLabel",Qt,dt||Pt);return _.div({class:te(["cms-drawer-section-label",G.class]),"data-level":String(A)},...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(A)},...Je)}if(Ge.length){const Je=Xt||B(Ge,A+1,xe.concat(st)),ot=Je||Se(wt);let rt=P(wt,!!o(G.expanded)||!!o(G.open)||ot);const at=_.span({class:"cms-drawer-group-icon"}),mt={...Qt,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))},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(A),"aria-expanded":String(rt),"aria-disabled":jt?"true":null,onClick:hn=>{if(jt){hn.preventDefault();return}p(wt),Sn(!rt)}},...E(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]:[]})),sn=J(s,"group",mt,null),dn=_.div({class:"cms-drawer-group-items"},...m(Ge,A+1,xe.concat(st))),Pn=_.div({class:te(["cms-drawer-group",rt?"open":"",ot?"active":"",Yt?`cms-drawer-tone-${Yt}`:""]),"data-level":String(A)},...sn.length?sn:[Ht],dn),Sn=hn=>{rt=!!hn,Pn.classList.toggle("open",rt),Ht.classList.toggle("open",rt),Ht.setAttribute("aria-expanded",String(rt)),Tt(),q(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",rn={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(A),"aria-current":on?"page":null,"aria-disabled":jt?"true":null},Vn=Tn.length?Tn:E(G,Qt);if(An){const Je=_.button({...rn,type:G.buttonType||"button",disabled:jt,onClick:ot=>{if(jt){ot.preventDefault();return}ve(G,Qt,ot)&&(p(wt),fe(G)&&b())}},...Vn);return W.set(wt,{el:Je,baseActive:Xt}),Je}const cn=be(G),fs=cn?o(G.target)||"_blank":o(G.target),ms=cn?o(G.rel)||"noopener noreferrer":o(G.rel),ts=_.a({...rn,href:lt||"#",target:fs||null,rel:ms||null,tabIndex:jt?-1:null,onClick:Je=>{var ot;if(jt){Je.preventDefault();return}ve(G,Qt,Je)&&(!cn&&G.to&&((ot=bt.router)!=null&&ot.navigate)&&(Je.preventDefault(),bt.router.navigate(G.to)),fe(G)&&b())}},...Vn);return W.set(wt,{el:ts,baseActive:Xt}),ts}).filter(Boolean),N=de(["before","beforeItems"],(M=e.before)!=null?M:e.beforeItems),I=_e(["body"])?de(["body"],null):[],K=m(e.items||[]),ke=de(["default"],n),Oe=de(["after","afterItems"],(k=e.after)!=null?k:e.afterItems),Te=I.length?I:[...N,...K,...ke,...Oe],U=c("empty")||c("emptyText")?(S=e.empty)!=null?S:_.div({class:te(["cms-drawer-empty",e.emptyClass])},e.emptyText||"Nessun contenuto"):_.div({class:te(["cms-drawer-empty",e.emptyClass])},"Nessun contenuto"),j=de(["header"],Q()),ne=de(["footer"],e.footer),Ve=Te.length?Te:de(["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=To.get(w)||new Set;return $e.add(ae),To.set(w,$e),Fn(_n,w),ae.isDrawerOpen=d,ae.openDrawer=r,ae.closeDrawer=b,ae.toggleDrawer=O,ae.setActiveItem=p,Nt(ae,e),F(),ae},Ne.Page=(...t)=>{var h,B,ie,a;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=(x,g)=>{var P;return!!(x&&x.nodeType===1&&((P=x.classList)!=null&&P.contains(`cms-page-${g}`)))},w=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(P=>r(x,P));return}if(g!=null&&g.nodeType){x.appendChild(g);return}x.appendChild(document.createTextNode(String(g)))}},b=(x,g,P=q=>q)=>{const q=JSswift.ui.getSlot(s,x);if(q!=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 E=P(g(d)),m=xn(JSswift.ui.slot(E));ve.replaceChildren(),Array.isArray(m)?m.forEach(N=>r(ve,N)):r(ve,m)},`UI.Page:${x}`),[ve]}return J(s,x,d,P(g))},O=J(s,"default",d,n!=null&&n.length?n:[]),C={hero:[],header:[],body:[],footer:[],actions:[]},v=[];O.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):v.push(x)});const T=b("icon",e.icon,w),le=b("hero",(h=e.hero)!=null?h:e.banner),Z=b("eyebrow",(B=e.eyebrow)!=null?B: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),de=b("footer",e.footer),_e=b("actions",e.actions),be=le.length?_.div({class:te(["cms-page-hero",e.heroClass])},...le):null,me=T.length||Z.length||he.length||H.length||W.length||se.length,fe=me?_.div({class:te(["cms-page-header",e.headerClass])},_.div({class:"cms-page-head"},T.length?_.div({class:te(["cms-page-icon",e.iconClass])},...T):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,...v],$=ce.length?_.div({class:te(["cms-page-body",e.bodyClass])},...ce):null,re=[..._e,...C.actions],oe=de.length||re.length?_.div({class:te(["cms-page-footer",e.footerClass])},...de,re.length?_.div({class:"cms-page-actions"},...re):null):null,Se=!!(le.length||C.hero.length),F=!!(me||C.header.length),p=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"]);p.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(F,"cms-page-has-header"),i.class]),p.style={...i.style||{}},(e.gap!=null||Ye(e.gap))&&(p.style["--cms-page-gap"]=Ke(e.gap,yt)),(e.padding!=null||Ye(e.padding))&&(p.style["--cms-page-padding"]=Ke(e.padding,yt)),(e.maxWidth!=null||Ye(e.maxWidth))&&(p.style["--cms-page-max-width"]=Ke(e.maxWidth,yt)),(e.minHeight!=null||Ye(e.minHeight))&&(p.style["--cms-page-min-height"]=Ke(e.minHeight,yt)),(e.headerGap!=null||Ye(e.headerGap))&&(p.style["--cms-page-header-gap"]=Ke(e.headerGap,yt)),(e.heroPadding!=null||Ye(e.heroPadding))&&(p.style["--cms-page-hero-padding"]=Ke(e.heroPadding,yt));const f=_.div(p,be,...C.hero,fe,...C.header,$,...C.body,oe,...C.footer);return Nt(f,e),f},Ne.AppShell=(...t)=>{var x,g;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(P,q)=>!!P&&Object.prototype.hasOwnProperty.call(P,q),c=o(e.noDrawer)===!0||e.drawer===!1,w=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)},O=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let C=e.header;!i(e,"header")&&(Object.keys(O).length||i(e,"title")||i(e,"subtitle")||i(e,"left")||i(e,"right"))&&(!i(O,"title")&&i(e,"title")&&(O.title=e.title),!i(O,"subtitle")&&i(e,"subtitle")&&(O.subtitle=e.subtitle),!i(O,"left")&&i(e,"left")&&(O.left=e.left),!i(O,"right")&&i(e,"right")&&(O.right=e.right),i(O,"drawerStateKey")||(O.drawerStateKey=r),c&&!i(O,"left")&&(O.left=!1),C=Ne.Header(O));const v=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},T=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(v).length||T!=null||le!=null)&&(!i(v,"items")&&T!=null&&(v.items=T),!i(v,"header")&&le!=null&&(v.header=le),i(v,"stateKey")||(v.stateKey=r),Z=Ne.Drawer(v));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}:{},de=i(e,"footerContent")?e.footerContent:void 0;let _e=e.footer;!i(e,"footer")&&(Object.keys(X).length||de!=null)&&(_e=Ne.Footer(X,...J(null,"default",b,de)));const be=J(s,"header",b,C),me=c?[]:J(s,"drawer",b,Z),fe=J(s,"page",b,se),ce=J(s,"footer",b,_e),$=te(["cms-app","cms-app-shell",ye(c,"no-drawer"),ye(w,"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 F=Ke(e.padding,yt);F!=null&&(re.style["--cms-app-shell-padding"]=F);const p=be.length?_.div({class:"cms-app-shell-header-slot"},...be):null,f=me.length?_.div({class:"cms-app-shell-drawer-slot"},...me):null,h=fe.length?_.div({class:"cms-app-shell-page-slot"},...fe):null,B=ce.length?_.div({class:"cms-app-shell-footer-slot"},...ce):null,ie=w?[h,f]:[f,h],a=_.div(re,...p?[p]:[],_.div({class:"cms-app-shell-body"},...ie.filter(Boolean)),...B?[B]:[]);return a.openDrawer=b.openDrawer,a.closeDrawer=b.closeDrawer,a.toggleDrawer=b.toggleDrawer,a.isDrawerOpen=b.isDrawerOpen,a.header=p,a.drawer=f,a.page=h,a.footer=B,Nt(a,e),a},Ne.Parallax=function(...e){var P,q;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 w=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 E=String(ve);return/^url\(/i.test(E)||/gradient\(/i.test(E)||/^var\(/i.test(E)?E:`url(${E})`},b=(Q,ve)=>{const E=Number(o(Q));return Number.isFinite(E)?E:ve},O={speed:()=>{var Q;return(Q=o(n.speed))!=null?Q:.18},state:()=>o(n.state)||"",disabled:()=>!!o(n.disabled)},C=J(i,"badge",O,n.badge),v=J(i,"background",O,n.backgroundContent),T=J(i,"eyebrow",O,(P=n.eyebrow)!=null?P:n.kicker),le=J(i,"title",O,n.title),Z=J(i,"subtitle",O,n.subtitle),he=J(i,"header",O,n.header),H=J(i,"aside",O,n.aside),W=J(i,"media",O,n.media),se=J(i,"content",O,(q=n.content)!=null?q:n.body),X=J(i,"default",O,s!=null&&s.length?s:[]),de=J(i,"footer",O,n.footer),_e=J(i,"actions",O,n.actions),be=[...se,...X],me=C.length?_.div({class:te(["cms-parallax-badge",n.badgeClass])},...C):null,fe=T.length||le.length||Z.length||he.length||H.length,ce=fe?_.div({class:te(["cms-parallax-header",n.headerClass])},_.div({class:"cms-parallax-head"},_.div({class:"cms-parallax-head-main"},T.length?_.div({class:te(["cms-parallax-eyebrow",n.eyebrowClass])},...T):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=de.length||_e.length?_.div({class:te(["cms-parallax-footer",n.footerClass])},de.length?_.div({class:"cms-parallax-footer-content"},...de):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",w,ye(n.disabled,"cms-parallax-static"),ye(me,"cms-parallax-has-badge"),ye(fe,"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 F=_.div({class:te(["cms-parallax-bg",n.bgClass])},v.length?_.div({class:te(["cms-parallax-bg-content",n.backgroundContentClass])},...v):null),p=_.div({class:te(["cms-parallax-content",n.contentClass,n.innerClass])},me,ce,$,re,oe),f=_.div(Se,F,p);let h=!1,B=!1,ie=null;const a=()=>{var Q;h||(h=!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(h)return;if(!f.isConnected){a();return}if(o(n.disabled)){F.style.transform="translate3d(0, 0, 0)",f.style.setProperty("--cms-parallax-offset","0px");return}const Q=f.getBoundingClientRect(),ve=b(n.speed,.18),E=Math.abs(b(n.maxOffset,96)),m=o(n.startTop),N=m!=null&&m!==""?(Q.top-b(n.startTop,0))*ve:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(Q.top+Q.height/2))*ve,K=`${(E>0?Math.max(-E,Math.min(E,N)):N).toFixed(2)}px`;F.style.transform=`translate3d(0, ${K}, 0)`,f.style.setProperty("--cms-parallax-offset",K)};function g(){h||B||(B=!0,requestAnimationFrame(()=>{B=!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(f)),requestAnimationFrame(()=>{g()}),setTimeout(()=>{g()},90)),f.refresh=()=>(g(),f),f.update=f.refresh,f.destroy=()=>(a(),f.remove(),null),f._dispose=a,Nt(f,n),f};const[bo,wo]=bt.reactive.signal([]),vo=new Map;function Ro(t){const e=vo.get(t);e&&(clearTimeout(e),vo.delete(t))}function Mo(t){return t?(Ro(t),wo(bo().filter(e=>e.id!==t)),t):null}function qi(){for(const t of vo.keys())Ro(t);wo([])}function si(t){t!=null&&t.id&&(Ro(t.id),t.timeout>0&&vo.set(t.id,setTimeout(()=>{Mo(t.id)},t.timeout)))}function oi(t,e={}){if(!t)return null;let n=null;return wo(bo().map(s=>s.id!==t?s:(n=$n({...s,...e,id:s.id},e.type||e.state||e.color||s.type),n))),n&&si(n),(n==null?void 0:n.id)||null}function Yi(t){const e=()=>Mo(t.id),n=(he={})=>oi(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=Ui[t.type];return he?Ne.Icon({name:he,size:"sm"}):null})(),w=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)),O=J(t.slots,"meta",s,i(t.meta)),C=J(t.slots,"actions",s,i(t.actions)),v=J(t.slots,"default",s,i(t.body)),T=J(t.slots,"dismiss",s,i(t.dismiss)),le=T.length?T: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},w.length?_.div({class:"cms-toast-icon"},...w):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,v.length?_.div({class:"cms-toast-body"},...v):null,O.length?_.div({class:"cms-toast-meta"},...O):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 Xi(){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=bo();t.innerHTML="";const n=new Map;for(const s of e){const i=ti(s.position);n.has(i)||n.set(i,[]),n.get(i).push(s)}for(const s of ei){const i=n.get(s);if(!(i!=null&&i.length))continue;const c=_.div({class:te(["cms-toast-wrap",`is-${s}`])},...i.map(w=>Yi(w)));t.appendChild(c)}},"JSswiftUI:toasts"),t)}function Qi(t={}){Xi();const e=$n(t);return e.id=e.id||Math.random().toString(36).slice(2),wo([...bo().filter(n=>n.id!==e.id),e]),si(e),e.id}bt.services.notify.show=Qi,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=oi,bt.services.notify.remove=Mo,bt.services.notify.clear=qi,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,w=JSswift.form._isPromise(c)?await c:c;return w===!0?null:typeof w=="string"?w:w===!1?i||"Valore non valido":w?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({}),w=_.rod({}),d=_.rod(!1),r=_.rod(null),b=()=>e&&typeof e=="object"&&"value"in e?e.value||{}:e,O=be=>{if(e&&typeof e=="object"&&"value"in e)e.value=be;else{const me=e||{};for(const fe in me)delete me[fe];Object.assign(me,be)}},C=be=>{const me=b();return me?me[be]:void 0},v=(be,me)=>{const fe={...b()||{}};fe[be]=me,O(fe)},T=(be,me)=>{const fe={...c.value||{}};me?fe[be]=me:delete fe[be],c.value=fe},le=be=>(c.value||{})[be]||null,Z=be=>{w.value={...w.value||{},[be]:!0}},he=be=>!!(w.value||{})[be],H=async be=>{const me=n[be]||[];if(!me.length)return T(be,null),!0;const fe=C(be),ce={name:be,value:fe,model:b(),form:_e};for(const $ of me){if(!$)continue;const re=await JSswift.form._runRule($,fe,ce);if(re)return T(be,re),!1}return T(be,null),!0},W=async()=>{r.value=null;const be=Object.keys(n);let me=!0;for(const fe of be)await H(fe)||(me=!1);return me},_e={model:e,errors:c,touched:w,submitting:d,submitError:r,getValue:C,setValue:v,getError:le,setError:T,touch:Z,isTouched:he,field:(be,me={})=>{var B;const fe=_.rod("");(B=fe.action)==null||B.call(fe,ie=>{v(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))},F=ie=>{$&&($===ie.target||$.contains&&$.contains(ie.target)||(Se(),$=null,oe&&(oe=!1,document.removeEventListener("pointerdown",F,!0))))},p=()=>{oe||(oe=!0,document.addEventListener("pointerdown",F,!0))},f=async()=>{$=document.activeElement,re=!1,p(),s==="input"&&await H(be)},h=async()=>{await Se(),$=null,oe&&(oe=!1,document.removeEventListener("pointerdown",F,!0))};return{name:be,model:fe,get value(){return fe.value},set value(ie){fe.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:f,onBlur:h,hint:me.hint||null}},validateField:H,validate:W,reset:()=>{r.value=null,c.value={},w.value={},i&&O({...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]),w=JSswift.omit(e,["form","onSubmit"]);w.class=c;const d=_.form({...w,onSubmit:async b=>{b.preventDefault(),s&&await s.submit(i||(async()=>{}))}}),r=[];for(const b of n||[]){const O=typeof b=="function"?b(s):b,C=JSswift.ui.slot(O);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 ii(){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 w={...e.style||{}},d=Ke(e.align);d!=null&&!Ze(e,"align")&&(w.alignItems=d);const r=Ke(e.justify);r!=null&&!Ze(e,"justify")&&(w.justifyContent=r);const b=Ke(e.wrap,T=>T?"wrap":"nowrap");b!=null&&!Ze(e,"wrap")&&(w.flexWrap=b);const O=Ke(e.direction);O!=null&&!Ze(e,"direction")&&(w.flexDirection=O);const C=Ke(e.gap,yt);C!=null&&!Ze(e,"gap")&&(w.gap=C),Object.keys(w).length&&(c.style=w),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const v=_.div(c,...J(s,"default",{},n));return Nt(v,e),v},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 w=_.div(c,...J(s,"default",{},n));return Nt(w,e),w},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 w={...e.style||{}},d=Ke(e.align);d!=null&&!Ze(e,"align")&&(w.alignItems=d);const r=Ke(e.justify);r!=null&&!Ze(e,"justify")&&(w.justifyContent=r);const b=Ke(e.wrap,T=>T?"wrap":"nowrap");b!=null&&!Ze(e,"wrap")&&(w.flexWrap=b);const O=Ke(e.direction);O!=null&&!Ze(e,"direction")&&(w.flexDirection=O);const C=Ke(e.gap,yt);C!=null&&!Ze(e,"gap")&&(w.gap=C),Object.keys(w).length&&(c.style=w),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const v=_.div(c,...J(s,"default",{},n));return Nt(v,e),v},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 w={...e},d=null,r=null;const b=(p,f)=>typeof p=="function"?p(f):p,O=p=>String(p||"").split(/\s+/).filter(Boolean),C=(p,f,h)=>{if(!p)return;const B=p[f]||[];B.length&&p.classList.remove(...B);const ie=(h||[]).filter(Boolean);ie.length&&p.classList.add(...ie),p[f]=ie},v=(p,f,h,B=ie=>ie)=>{if(p){if(h==null||h===""){p.style.removeProperty(f);return}p.style.setProperty(f,B(h))}},T=()=>{var a,x,g,P,q,Q;const p=window.visualViewport,f=Math.max(0,Math.round((a=p==null?void 0:p.offsetLeft)!=null?a:0)),h=Math.max(0,Math.round((x=p==null?void 0:p.offsetTop)!=null?x:0)),B=Math.max(0,Math.round((P=(g=p==null?void 0:p.width)!=null?g:window.innerWidth)!=null?P:0)),ie=Math.max(0,Math.round((Q=(q=p==null?void 0:p.height)!=null?q:window.innerHeight)!=null?Q:0));return{left:f,top:h,width:B,height:ie}},le=p=>{if(!(p!=null&&p.panel))return;const{left:f,top:h,width:B,height:ie}=T();v(p.panel,"position","fixed"),v(p.panel,"inset",0,a=>`${a}px`),v(p.panel,"top",h,a=>`${a}px`),v(p.panel,"left",f,a=>`${a}px`),v(p.panel,"right","auto"),v(p.panel,"bottom","auto"),v(p.panel,"width",B,a=>`${a}px`),v(p.panel,"height",ie,a=>`${a}px`),v(p.panel,"min-height",ie,a=>`${a}px`),v(p.panel,"max-width",B,a=>`${a}px`),v(p.panel,"max-height",ie,a=>`${a}px`),v(p.panel,"min-width",0,a=>`${a}px`),v(p.panel,"margin",0,a=>`${a}px`),v(p.panel,"box-sizing","border-box"),v(p.panel,"border-width",0,a=>`${a}px`),v(p.panel,"border-radius",0,a=>`${a}px`),v(p.panel,"transform","none"),v(p.panel,"overflow","hidden"),v(p.panel,"--cms-dialog-fullscreen-left",f,a=>`${a}px`),v(p.panel,"--cms-dialog-fullscreen-top",h,a=>`${a}px`),v(p.panel,"--cms-dialog-fullscreen-width",B,a=>`${a}px`),v(p.panel,"--cms-dialog-fullscreen-height",ie,a=>`${a}px`)},Z=p=>{p!=null&&p.panel&&(v(p.panel,"position",null),v(p.panel,"inset",null),v(p.panel,"top",null),v(p.panel,"left",null),v(p.panel,"right",null),v(p.panel,"bottom",null),v(p.panel,"width",null),v(p.panel,"height",null),v(p.panel,"min-height",null),v(p.panel,"max-width",null),v(p.panel,"max-height",null),v(p.panel,"min-width",null),v(p.panel,"margin",null),v(p.panel,"box-sizing",null),v(p.panel,"border-width",null),v(p.panel,"border-radius",null),v(p.panel,"transform",null),v(p.panel,"overflow",null),v(p.panel,"--cms-dialog-fullscreen-left",null),v(p.panel,"--cms-dialog-fullscreen-top",null),v(p.panel,"--cms-dialog-fullscreen-width",null),v(p.panel,"--cms-dialog-fullscreen-height",null))},he=(p,f)=>{var g,P,q,Q,ve;if(!p)return;if((g=p._dialogViewportCleanup)==null||g.call(p),p._dialogViewportCleanup=null,!f){Z(p);return}let h=null;const B=globalThis.requestAnimationFrame||(E=>setTimeout(()=>E(Date.now()),0)),ie=globalThis.cancelAnimationFrame||clearTimeout,a=()=>le(p),x=()=>{h!=null&&ie(h),h=B(()=>{h=null,a()})};a(),x(),window.addEventListener("resize",a),window.addEventListener("orientationchange",x),(q=(P=window.visualViewport)==null?void 0:P.addEventListener)==null||q.call(P,"resize",a),(ve=(Q=window.visualViewport)==null?void 0:Q.addEventListener)==null||ve.call(Q,"scroll",x),p._dialogViewportCleanup=()=>{var E,m,N,I;h!=null&&(ie(h),h=null),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",x),(m=(E=window.visualViewport)==null?void 0:E.removeEventListener)==null||m.call(E,"resize",a),(I=(N=window.visualViewport)==null?void 0:N.removeEventListener)==null||I.call(N,"scroll",x)}},H=()=>w,W=p=>{var h;const f=o((h=p.state)!=null?h:p.color);return f?i.includes(f)?f:String(f):""},se=p=>{const f=o(p.size);return typeof f=="string"&&c.includes(f)?f:""},X=p=>{var h,B,ie;const f=String(o((ie=(B=(h=p.actionsAlign)!=null?h:p.footerAlign)!=null?B:p.alignActions)!=null?ie:"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"},de=p=>{var h,B,ie;const f=String(o((ie=(B=(h=p.align)!=null?h:p.verticalAlign)!=null?B:p.position)!=null?ie:"center")).toLowerCase();return["top","start","flex-start"].includes(f)?"cms-dialog-align-top":["bottom","end","flex-end"].includes(f)?"cms-dialog-align-bottom":""},_e=p=>{var h,B;return((B=(h=p.closable)!=null?h:p.dismissible)!=null?B:p.closeButton)!==!1},be=()=>{var K,ke,Oe,Te,U,j,ne,Ve;const p=H(),f={close:re,dismiss:re,open:$,toggle:Se,update:ce,isOpen:oe,entry:()=>d,props:p},h=p.icon!=null?typeof p.icon=="string"?Ne.Icon({name:p.icon,size:p.iconSize||"md"}):JSswift.ui.slot(p.icon,{as:"icon"}):null,B=J(s,"eyebrow",f,b(p.eyebrow,f)),ie=J(s,"title",f,b((ke=(K=p.title)!=null?K:p.heading)!=null?ke:p.header,f)),a=J(s,"subtitle",f,b((Oe=p.subtitle)!=null?Oe:p.description,f)),x=J(s,"icon",f,h),g=J(s,"header",f,b((Te=p.headerContent)!=null?Te:p.head,f)),P=_e(p)?J(s,"close",f,Ne.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":p.closeLabel||"Chiudi dialog","data-dialog-close":!0},Ne.Icon({name:p.closeIcon||"close",size:"sm"}))):[],q=(ne=(j=(U=p.content)!=null?U:p.body)!=null?j:p.message)!=null?ne:n&&n.length?n:null;let Q=J(s,"content",f,b(q,f));Q.length||(Q=J(s,"body",f,b(q,f))),Q.length||(Q=J(s,"default",f,b(q,f)));const ve=b((Ve=p.footer)!=null?Ve:p.actions,f);let E=J(s,"footer",f,ve);E.length||(E=J(s,"actions",f,ve));let m=null;g.length?m=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...g):(B.length||ie.length||a.length||x.length||P.length)&&(m=_.div({class:"cms-dialog-head"},x.length?_.div({class:"cms-dialog-icon"},...x):null,_.div({class:"cms-dialog-head-main"},B.length?_.div({class:"cms-dialog-eyebrow"},...B):null,ie.length?_.div({class:"cms-dialog-title"},...ie):null,a.length?_.div({class:"cms-dialog-subtitle"},...a):null),P.length?_.div({class:"cms-dialog-close-wrap"},...P):null));const N=_.div({class:te(["cms-dialog-body",p.bodyClass])},...Q),I=E.length?_.div({class:te(["cms-dialog-actions",`is-${X(p)}`,ye(p.stackActions,"is-stacked"),p.actionsClass,p.footerClass])},...E):null;return _.div({class:te(["cms-dialog-shell",ye(!!m,"has-head"),ye(!!I,"has-footer"),ye(p.divider!==!1,"with-divider")])},...[m,N,I].filter(Boolean))},me=p=>{var ie;if(!(p!=null&&p.panel))return;const f=H(),h=W(f),B=se(f);C(p.panel,"_dialogClassTokens",["cms-dialog","cms-singularity","cms-clear-set",B?`cms-dialog-${B}`:"",h,h?`cms-state-${h}`:"",o(f.fullscreen)?"fullscreen":"",o(f.scrollable)?"scrollable":"",o(f.stickyHeader)?"sticky-head":"",o(f.stickyActions)?"sticky-actions":"",o(f.borderless)?"borderless":"",...O(f.class),...O(f.panelClass)]),C(p.overlay,"_dialogOverlayClassTokens",[de(f),o(f.backdropBlur)?"cms-dialog-overlay-blur":"",...O(f.overlayClass)]),v(p.panel,"--cms-dialog-width",o(f.width),yt),v(p.panel,"--cms-dialog-min-width",o(f.minWidth),yt),v(p.panel,"--cms-dialog-max-width",o(f.maxWidth),yt),v(p.panel,"--cms-dialog-max-height",o(f.maxHeight),yt),v(p.panel,"--cms-dialog-body-max-height",o((ie=f.bodyMaxHeight)!=null?ie:f.contentMaxHeight),yt),f.style&&Object.assign(p.panel.style,f.style),Nt(p.panel,f),he(p,o(f.fullscreen)),p.panel.setAttribute("role",f.role||"dialog"),p.panel.setAttribute("aria-modal",f.modal===!1?"false":"true"),f.ariaLabel?p.panel.setAttribute("aria-label",f.ariaLabel):p.panel.removeAttribute("aria-label")},fe=()=>{d!=null&&d.panel&&d.panel.replaceChildren(be())},ce=(p={})=>(p&&typeof p=="object"&&(w={...w,...p}),d&&(me(d),fe()),F),$=(p=null)=>{var ie,a,x,g,P;if(p&&typeof p=="object"&&(w={...w,...p}),d)return me(d),fe(),d;r=document.activeElement;const f=H(),h=f.persistent===!0;d=JSswift.overlay.open(()=>be(),{type:"dialog",backdrop:f.backdrop!==!1,lockScroll:f.lockScroll!==!1,trapFocus:f.trapFocus!==!1,autoFocus:f.autoFocus!==!1,closeOnOutside:(ie=f.closeOnOutside)!=null?ie:!h,closeOnBackdrop:(a=f.closeOnBackdrop)!=null?a:!h,closeOnEsc:(x=f.closeOnEsc)!=null?x:!h,className:qt(["cms-dialog"]),onClose:()=>{var q,Q,ve,E;(q=d==null?void 0:d._dialogViewportCleanup)==null||q.call(d),(Q=d==null?void 0:d.panel)==null||Q.removeEventListener("click",B),d=null,(E=(ve=H()).onClose)==null||E.call(ve),r&&typeof r.focus=="function"&&setTimeout(()=>r.focus(),0)}});const B=q=>{const Q=q.target;Q&&Q.closest&&Q.closest("[data-dialog-close]")&&re()};return d.panel.addEventListener("click",B),me(d),_s(d),(P=(g=H()).onOpen)==null||P.call(g,d),d},re=()=>{if(!d)return;const p=d;ks(p,()=>JSswift.overlay.close(p.id))},oe=()=>!!d,Se=(p=null)=>oe()?(re(),null):$(p),F={open:$,close:re,toggle:Se,update:ce,isOpen:oe,entry:()=>d,props:()=>({...w})};return F},Ne.TabPanel=(...t)=>{var He,ae,$e,Ee,De,Ie,qe,Be,z,Pe,M,k,S;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=en(e.model,"UI.TabPanel:model"),w=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 A=String(o(u)||"").toLowerCase();return A==="pills"||A==="pill"?"pills":A==="soft"||A==="card"?"soft":"line"},O=u=>{const A=o(u);return A==null||A===""?null:JSswift.uiColors.includes(A)?`var(--cms-${A})`:String(A)},C=d(e.orientation||e.orient||e.direction),v=r(e.navPosition||e.barPosition||e.position),T=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"]),de=(()=>{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,fe=O((z=e.color)!=null?z:e.state),ce=i.map((u,A)=>{var dt,St,It,Rt,Pt,st,wt,Ft,Dt,Yt,Xt,on,jt,Qt,an,mn;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:A};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-${A}`,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 ${A+1}`,G=(on=(Xt=(Yt=u.content)!=null?Yt:u.panel)!=null?Xt:u.body)!=null?on:Ue?u.children:null,Ge=(an=(Qt=(jt=u.note)!=null?jt:u.subtitle)!=null?Qt:u.description)!=null?an:null,lt=(mn=u.icon)!=null?mn: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:A}}).filter(Boolean).filter(u=>u.hidden!==!0&&u.visible!==!1),$=te(["cms-clear-set","cms-tabpanel","cms-singularity",C,`variant-${T}`,ye(le,"wrap"),ye(H,"animated"),ye(W,"nav-fill"),ye(se,"disabled"),ye(v==="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",`${de}ms`),oe.style.setProperty("--cms-tabpanel-easing",_e)),fe&&oe.style.setProperty("--cms-tabpanel-accent",fe);const Se=_.div({class:te(["cms-tabpanel-nav",e.navClass]),role:"tablist","aria-orientation":C}),F=_.div({class:te(["cms-tabpanel-panels",e.panelsClass])}),p=[],f=[];let h=-1;const B=()=>C==="horizontal",ie=(u,A,xe)=>({tab:u,name:u.name,index:A,active:xe,value:u.name,select:()=>Oe(A),next:()=>U(),prev:()=>j()}),a=(u,A,xe=!1)=>{var et;if(!ce.length)return-1;let Ue=u;for(let G=0;G<ce.length;G+=1){if(Ue+=A,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 A=(xe=p[u])==null?void 0:xe.btn;!A||typeof A.focus!="function"||requestAnimationFrame(()=>A.focus())},g=(u,A,xe)=>{const Ue=ie(u,A,xe),et=JSswift.ui.renderSlot(s,"label",Ue,u.labelFallback);return J(null,"default",{},et)},P=(u,A)=>{var Ft,Dt,Yt,Xt,on;const xe=A===h,Ue=`${w}-tab-${A}`,et=`${w}-panel-${A}`,G=ie(u,A,xe),Ge=g(u,A,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(),Oe(A);return}if(Qt==="Home"){jt.preventDefault();const Gt=ce.findIndex(Tn=>!Tn.disabled);Gt>=0&&(Oe(Gt),x(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&&(Oe(Gt),x(Gt));return}const an=B()?["ArrowLeft"]:["ArrowUp"],mn=B()?["ArrowRight"]:["ArrowDown"];if(an.includes(Qt)){jt.preventDefault();const Gt=a(A,-1,he);Gt>=0&&(Oe(Gt,{dir:"prev"}),x(Gt));return}if(mn.includes(Qt)){jt.preventDefault();const Gt=a(A,1,he);Gt>=0&&(Oe(Gt,{dir:"next"}),x(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:T==="pills"&&!xe,color:T==="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||Oe(A)},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 p[A]={btn:st,wrap:wt,index:A},wt},q=(u,A)=>{const xe=A===h,Ue=`${w}-tab-${A}`,et=`${w}-panel-${A}`,G=ie(u,A,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 f[A]=lt,lt},Q=ce.map((u,A)=>P(u,A)),ve=JSswift.ui.renderSlot(s,"nav",{tabs:ce,active:()=>{var u;return h>=0?(u=ce[h])==null?void 0:u.name:null},activeIndex:()=>h,activeTab:()=>h>=0?ce[h]:null,select:u=>{typeof u=="number"?Oe(u):Te(u)},next:()=>U(),prev:()=>j(),nodes:Q,orientation:C,position:v,variant:T},Q);J(null,"default",{},ve).forEach(u=>Se.appendChild(u)),ce.length?ce.forEach((u,A)=>F.appendChild(q(u,A))):J(s,"empty",{tabs:ce},(Pe=e.empty)!=null?Pe:_.div({class:"cms-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(A=>F.appendChild(A));const E=u=>{if(!H)return;const A=u==="next"?"18px":"-18px",xe=u==="next"?"-18px":"18px";oe.style.setProperty("--cms-tabpanel-enter",A),oe.style.setProperty("--cms-tabpanel-leave",xe)},m=()=>{const u=[];be&&u.push(...String(be).split(/\s+/)),me&&u.push(...String(me).split(/\s+/)),u.length&&F.classList.remove(...u.filter(Boolean))},N=u=>{m();const A=u==="prev"?be:me;if(!A)return;const xe=String(A).split(/\s+/).filter(Boolean);xe.length&&(F.classList.add(...xe),setTimeout(()=>F.classList.remove(...xe),de+40))},I=u=>{var Ue;const A=p.find(({btn:et})=>et.classList.contains("active")),xe=(Ue=A==null?void 0:A.btn.parentNode)==null?void 0:Ue.getBoundingClientRect();p.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,A,xe)=>{E(xe),f.forEach((Ue,et)=>{if(!Ue)return;const G=et===A,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"),de+40)):Ue.classList.remove("leaving"))})},ke=(u,A)=>u<0||u===A||he&&u===ce.length-1&&A===0?"next":he&&u===0&&A===ce.length-1?"prev":A>u?"next":"prev",Oe=(u,A={})=>{var G,Ge;if(u==null||u<0||u>=ce.length||(G=ce[u])!=null&&G.disabled)return;const xe=h;if(xe===u)return;h=u;const Ue=ce[u],et=A.dir||ke(xe,u);c&&!A.fromModel&&c.set(Ue.name),I(u),K(xe,u,et),N(et),oe.dataset.active=String(Ue.name),(Ge=e.onChange)==null||Ge.call(e,Ue.name,Ue,u)},Te=(u,A={})=>{if(!ce.length)return;const xe=ce.findIndex(Ue=>Ue.name==u);xe!==-1&&Oe(xe,A)},U=()=>{if(!ce.length)return;const u=h<0?ce.findIndex(A=>!A.disabled):a(h,1,he);u<0||Oe(u,{dir:"next"})},j=()=>{if(!ce.length)return;const u=h<0?(()=>{var A;for(let xe=ce.length-1;xe>=0;xe-=1)if(!((A=ce[xe])!=null&&A.disabled))return xe;return-1})():a(h,-1,he);u<0||Oe(u,{dir:"prev"})};if(Z){let u=0,A=0,xe=!1;const Ue=42;F.addEventListener("pointerdown",et=>{et.button!=null&&et.button!==0||(xe=!0,u=et.clientX,A=et.clientY)}),F.addEventListener("pointerup",et=>{if(!xe)return;xe=!1;const G=et.clientX-u,Ge=et.clientY-A;Math.abs(G)<Ue||Math.abs(G)<Math.abs(Ge)||(G<0?U():j())}),F.addEventListener("pointercancel",()=>{xe=!1}),F.addEventListener("pointerleave",()=>{xe=!1})}const ne=c?c.get():(S=(k=(M=e.value)!=null?M:e.defaultValue)!=null?k:e.default)!=null?S:null;if(ce.length){const u=ce.findIndex(A=>A.name==ne);if(u>=0)Oe(u,{fromModel:!0});else{const A=ce.findIndex(xe=>!xe.disabled);A>=0&&(Oe(A,{fromModel:!0}),c&&c.set(ce[A].name))}}return c&&c.watch(u=>Te(u,{fromModel:!0}),"UI.TabPanel:watch"),v==="after"?(oe.appendChild(F),oe.appendChild(Se)):(oe.appendChild(Se),oe.appendChild(F)),J(s,"default",{},n).forEach(u=>oe.appendChild(u)),Nt(oe,e),oe._tabs=()=>ce.slice(),oe._active=()=>h>=0?ce[h]:null,oe._getValue=()=>{var u;return h>=0?(u=ce[h])==null?void 0:u.name:null},oe._setValue=u=>Te(u),oe._select=u=>{typeof u=="number"?Oe(u):Te(u)},oe._next=U,oe._prev=j,oe};function Zi(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Oo({title:t,message:e,contentNode:n,okText:s,cancelText:i,showCancel:c,onOk:w,onCancel:d,persistent:r}){ii();const b=_.div({class:"cms-dialog-backdrop",onClick:Z=>{Z.target===b&&r!==!0&&(d==null||d())}}),O=J(null,"default",{},t),C=J(null,"default",{},e),v=J(null,"default",{},n),T=_.div({class:"cms-dialog cms-panel"},O.length?_.h3(...O):null,C.length?_.p(...C):null,...v,_.div({class:"cms-dialog-actions"},c?JSswift.ui.Btn({onClick:d},i||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:w},s||"OK")));b.appendChild(T),ii().appendChild(b);const le=Z=>{Z.key==="Escape"&&(d==null||d())};return document.addEventListener("keydown",le,{once:!0}),{backdrop:b,close:()=>Zi(b)}}bt.dialog.alert=function(t,e={}){return new Promise(n=>{const{backdrop:s,close:i}=Oo({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}=Oo({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}=Oo({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 fn=null,Bs=0;function li(){if(fn)return fn;fn=document.createElement("div"),fn.className="cms-loading-backdrop",fn.style.cssText=`
|
|
1
|
+
(()=>{var Ds,$s,uo,fo,At,xs,T,Un,ps;window.JSswift=window.JSswift||{};const Q=window.JSswift;window._=window.JSswift,Q.config=Q.config||{};const bt=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{};Q.config.debug=(Ds=bt.modeDev)!=null?Ds:!1,Q.isDev=function(){return Q.config.debug},Q.uiNormalizeArgs=function(l){let I={},J=l;return l.length>0&&typeof l[0]=="object"&&l[0]!==null&&!l[0].nodeType&&!Array.isArray(l[0])&&!(l[0]instanceof Function)&&(I=l[0],J=l.slice(1)),{props:I,children:J}},Q.uiSizes=["xxs","xs","sm","md","lg","xl","xxl","xxxl"],Q.uiColors=["primary","secondary","success","warning","danger","info","light","dark"],Q.meta=Q.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."]}}},Q.omit=(l,I)=>{const J={},$=new Set(I||[]);for(const D in l||{})$.has(D)||(J[D]=l[D]);return J},Q._cleanupRegistry=new WeakMap,Q._registerCleanup=function(l,I){if(!l||typeof I!="function")return I;const J=Q._cleanupRegistry.get(l)||[];return J.push(I),Q._cleanupRegistry.set(l,J),I},Q.dom={q(l,I=document){return I.querySelector(l)},qa(l,I=document){return Array.from(I.querySelectorAll(l))},attr(l,I,J){return l?J===void 0?l.getAttribute(I):(J===null?l.removeAttribute(I):l.setAttribute(I,String(J)),l):null}},(()=>{let l=[],I=!1;function J(){if(I)return;I=!0;const $=l.slice();l.length=0;for(const D of $)try{D()}catch(me){console.error("[JSswift.ready] error:",me)}}Q.ready=function($){typeof $=="function"&&(I||document.readyState==="interactive"||document.readyState==="complete"?queueMicrotask(()=>{try{$()}catch(D){console.error("[JSswift.ready] error:",D)}}):l.push($))},document.addEventListener("DOMContentLoaded",J,{once:!0})})(),Q.reactive=(()=>{let l=null;const I=[],J=100;let $=0,D="sync",me="sync",G=!1;const pe=new Set;function Ee(Ne){const Fe=Ne==null?void 0:Ne.flush;if(Fe==null||Fe==="sync")return"sync";if(Fe==="microtask")return"microtask";throw new Error("JSswift.reactive.batch: options.flush must be 'sync' or 'microtask'")}function ve(){for(;pe.size;){const Ne=Array.from(pe);pe.clear(),Ne.forEach(Fe=>Fe())}}function xe(){G||(G=!0,queueMicrotask(()=>{G=!1,me="sync",ve()}))}function Le(Ne){const Fe=Array.from(Ne);if($>0||me==="microtask"){Fe.forEach(ut=>pe.add(ut)),$===0&&me==="microtask"&&xe();return}Fe.forEach(ut=>ut())}function Re(Ne){if(Ne&&(Ne._deps.size&&(Ne._deps.forEach(Fe=>Fe.delete(Ne._runner)),Ne._deps.clear()),typeof Ne._cleanup=="function")){const Fe=Ne._cleanup;Ne._cleanup=null;try{Fe()}catch(ut){console.error("[JSswift.reactive.effect] cleanup error:",ut)}}}function Ue(Ne){if(!(!Ne||!Ne.active)){Re(Ne),I.push(Ne),l=Ne;try{const Fe=dt=>{Ne._cleanup=typeof dt=="function"?dt:null},ut=Ne.fn.length>0?Ne.fn(Fe):Ne.fn();typeof ut=="function"&&(Ne._cleanup=ut)}finally{I.pop(),l=I[I.length-1]||null}}}function et(Ne){if(typeof Ne!="function")return()=>{};const Fe={fn:Ne,active:!0,_deps:new Set,_cleanup:null,_runner:null,_running:!1,_queued:!1},ut=()=>{if(!Fe.active)return;if(Fe._running){Fe._queued=!0;return}Fe._running=!0;let dt=0;try{do if(Fe._queued=!1,Ue(Fe),dt++,dt>=J){Fe._queued=!1,console.warn("[JSswift.reactive.effect] loop guard triggered: too many synchronous reruns",{max:J,effect:Ne.name||"anonymous"});break}while(Fe.active&&Fe._queued)}finally{Fe._running=!1}};return Fe._runner=ut,ut(),()=>{Fe.active&&(Fe.active=!1,Re(Fe))}}function yt(Ne){let Fe=Ne;const ut=new Set;function dt(){return l&&l.active&&(ut.add(l._runner),l._deps.add(ut)),Fe}function kt(Wt){Fe=Wt,Le(ut)}function It(){ut.clear()}return[dt,kt,It]}function st(Ne){if(typeof Ne!="function")throw new Error("JSswift.reactive.computed: fn must be a function");const[Fe,ut,dt]=yt(void 0),kt=et(()=>{ut(Ne())}),It=()=>Fe();return It.dispose=()=>{kt(),dt()},It.peek=()=>Fe(),It.type="computed",It}function tt(Ne){if(typeof Ne!="function")throw new Error("JSswift.reactive.untracked: fn must be a function");const Fe=l;l=null;try{return Ne()}finally{l=Fe}}function Pe(Ne,Fe){if(typeof Ne!="function")throw new Error("JSswift.reactive.batch: fn must be a function");const ut=Ee(Fe);$===0?D=ut:ut==="microtask"&&(D="microtask"),$+=1;try{return Ne()}finally{if($-=1,$===0){const dt=D==="microtask"||me==="microtask";D="sync",dt?(me="microtask",xe()):ve()}}}return{signal:yt,effect:et,computed:st,untracked:tt,batch:Pe}})(),Q._overlayShared=(()=>{const l=["button:not([disabled])","[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function I(me,G){const pe=me();if(pe&&pe.isConnected)return pe;let Ee=document.getElementById("cms-overlay-root");return!Ee&&(document!=null&&document.body)&&(Ee=document.createElement("div"),Ee.id="cms-overlay-root",Ee.className="cms-overlay-root",document.body.appendChild(Ee)),!document.body&&!Ee&&Q.ready(()=>{let ve=document.getElementById("cms-overlay-root");ve||(ve=document.createElement("div"),ve.id="cms-overlay-root",ve.className="cms-overlay-root",document.body.appendChild(ve)),G(ve)}),G(Ee),Ee}function J(me){var pe;const G=me.querySelector(l);(pe=G==null?void 0:G.focus)==null||pe.call(G)}function $(me,G){if(me.key!=="Tab")return;const pe=Array.from(G.querySelectorAll(l)).filter(Le=>Le.offsetParent!==null);if(!pe.length)return;const Ee=pe[0],ve=pe[pe.length-1],xe=document.activeElement;me.shiftKey&&xe===Ee?(me.preventDefault(),ve.focus()):!me.shiftKey&&xe===ve&&(me.preventDefault(),Ee.focus())}function D(me,G){var xt,Ge,Mn,on,On,an;if(!G.anchorEl)return;const pe=G.anchorEl.getBoundingClientRect(),Ee=me.getBoundingClientRect(),ve=window.visualViewport||null,xe=Math.max(0,Number(ve==null?void 0:ve.offsetLeft)||0),Le=Math.max(0,Number(ve==null?void 0:ve.offsetTop)||0),Re=Math.max(Number(ve==null?void 0:ve.width)||0,window.innerWidth||0,((xt=document.documentElement)==null?void 0:xt.clientWidth)||0),Ue=Math.max(Number(ve==null?void 0:ve.height)||0,window.innerHeight||0,((Ge=document.documentElement)==null?void 0:Ge.clientHeight)||0),et=Number((on=(Mn=G.viewportGutter)!=null?Mn:G.gutter)!=null?on:8),yt=Number.isFinite(et)?Math.max(0,et):8,st=Number((On=G.offsetX)!=null?On:0),tt=Number((an=G.offsetY)!=null?an:8),Pe=Number.isFinite(st)?st:0,Ne=Number.isFinite(tt)?tt:8,Fe=(gn,yn,zn)=>!Number.isFinite(gn)||(Number.isFinite(yn)||(yn=0),Number.isFinite(zn)||(zn=yn),zn<yn)?yn:Math.min(Math.max(gn,yn),zn),ut=String(G.placement||"bottom-start").toLowerCase(),[dt,kt]=ut.split("-"),It=["top","bottom","left","right"].includes(dt)?dt:"bottom",Wt=["start","end","center"].includes(kt)?kt:"start",Qe={top:"bottom",bottom:"top",left:"right",right:"left"}[It]||"top",St=It==="top"||It==="bottom",_t=Ee.width,Tt=Ee.height,Ve=gn=>{let yn=pe.left+Pe,zn=pe.top+Ne;return gn==="top"||gn==="bottom"?(Wt==="center"?yn=pe.left+(pe.width-_t)/2+Pe:Wt==="end"&&(yn=pe.right-_t+Pe),zn=gn==="top"?pe.top-Tt-Ne:pe.bottom+Ne):(Wt==="center"?zn=pe.top+(pe.height-Tt)/2+Ne:Wt==="end"&&(zn=pe.bottom-Tt+Ne),yn=gn==="left"?pe.left-_t-Pe:pe.right+Pe),{left:yn,top:zn}},ot=gn=>gn==="top"?pe.top-Ne-yt:gn==="bottom"?Ue-pe.bottom-Ne-yt:gn==="left"?pe.left-Pe-yt:Re-pe.right-Pe-yt,zt=ot(It),$t=ot(Qe),ht=(St?Tt:_t)>zt&&$t>zt?Qe:It,Ke=Ve(ht),o=xe+yt,Pt=Le+yt,Z=Math.max(o,xe+Re-_t-yt),Kt=Math.max(Pt,Le+Ue-Tt-yt),ye=Fe(Ke.left,o,Z),jt=Fe(Ke.top,Pt,Kt);me.style.position="fixed",me.style.left=`${ye}px`,me.style.top=`${jt}px`}return{ensureRoot:I,focusFirst:J,trapFocus:$,applyAnchoredPosition:D}})(),Q.overlay=(()=>{let l=0;const I=new Map;let J=null;const{ensureRoot:$,focusFirst:D,trapFocus:me,applyAnchoredPosition:G}=Q._overlayShared,pe=()=>$(()=>J,st=>{J=st});let Ee=0;const ve=()=>{Ee++,Ee===1&&document.documentElement.classList.add("cms-scroll-locked")},xe=()=>{Ee=Math.max(0,Ee-1),Ee===0&&document.documentElement.classList.remove("cms-scroll-locked")},Le=()=>{let st=null;for(const tt of I.values())st=tt;return st},Re=st=>{var Pe;let tt=st;for(;tt&&tt!==document;){if(tt.nodeType===1&&((Pe=tt.getAttribute)==null?void 0:Pe.call(tt,"data-cms-overlay-portal"))==="true")return!0;tt=tt.parentNode}return!1},Ue=(st,tt={})=>{var ot,zt,$t,Ct;const Pe=`ov_${++l}`,Ne={id:Pe,opts:tt,isOpen:!0,anchorEl:tt.anchorEl||null,placement:tt.placement||"bottom-start",onClose:typeof tt.onClose=="function"?tt.onClose:null,overlay:null,panel:null,backdrop:null,reposition:null,_positionCleanup:null,_positionFrame:null,_panelResizeObserver:null,_cleanup:null},Fe=document.createElement("div");Fe.className=["cms-overlay",tt.type?`type-${tt.type}`:""].filter(Boolean).join(" "),Fe.dataset.id=Pe;const ut=document.createElement("div");ut.className="cms-overlay-backdrop",tt.backdrop||(ut.style.display="none");const dt=document.createElement("div");dt.className=["cms-overlay-panel",tt.className].filter(Boolean).join(" "),dt.tabIndex=-1;const kt=typeof st=="function"?st({close:()=>et(Pe)}):st,It=Q.ui.slot(kt);Array.isArray(It)?It.forEach(ht=>ht&&dt.appendChild(ht)):It&&dt.appendChild(It),Fe.appendChild(ut),Fe.appendChild(dt);const Wt=pe();if(!Wt)return{id:Pe,close:()=>et(Pe),panel:dt,overlay:Fe};Wt.appendChild(Fe),Ne.overlay=Fe,Ne.panel=dt,Ne.backdrop=ut,I.set(Pe,Ne),tt.lockScroll&&ve(),tt.autoFocus!==!1&&setTimeout(()=>{dt.isConnected&&I.get(Pe)===Ne&&!dt.contains(document.activeElement)&&D(dt)},0);const Qe=(ht=null)=>{ht&&typeof ht=="object"&&Object.assign(Ne.opts,ht),G(dt,Ne.opts)},St=()=>{if(!tt.anchorEl)return;const ht=globalThis.requestAnimationFrame||(Ke=>setTimeout(()=>Ke(Date.now()),0));Ne._positionFrame==null&&(Ne._positionFrame=ht(()=>{Ne._positionFrame=null,Qe()}))};if(Ne.reposition=Qe,tt.anchorEl){Qe(),St();const ht=St;if(window.addEventListener("resize",ht),window.addEventListener("scroll",ht,!0),(zt=(ot=window.visualViewport)==null?void 0:ot.addEventListener)==null||zt.call(ot,"resize",ht),(Ct=($t=window.visualViewport)==null?void 0:$t.addEventListener)==null||Ct.call($t,"scroll",ht),typeof ResizeObserver=="function"){const Ke=new ResizeObserver(St);Ke.observe(dt),Ne._panelResizeObserver=Ke}Ne._positionCleanup=()=>{var o,Pt,Z,Kt,ye,jt;const Ke=globalThis.cancelAnimationFrame||clearTimeout;Ne._positionFrame!=null&&(Ke(Ne._positionFrame),Ne._positionFrame=null),(Pt=(o=Ne._panelResizeObserver)==null?void 0:o.disconnect)==null||Pt.call(o),Ne._panelResizeObserver=null,window.removeEventListener("resize",ht),window.removeEventListener("scroll",ht,!0),(Kt=(Z=window.visualViewport)==null?void 0:Z.removeEventListener)==null||Kt.call(Z,"resize",ht),(jt=(ye=window.visualViewport)==null?void 0:ye.removeEventListener)==null||jt.call(ye,"scroll",ht)}}const _t=ht=>{const Ke=Le();!Ke||Ke.id!==Pe||tt.closeOnOutside!==!1&&(Re(ht.target)||dt.contains(ht.target)||et(Pe))};document.addEventListener("mousedown",_t,!0);const Tt=ht=>{const Ke=Le();!Ke||Ke.id!==Pe||(tt.trapFocus&&me(ht,dt),ht.key==="Escape"&&tt.closeOnEsc!==!1&&(ht.preventDefault(),et(Pe)))};document.addEventListener("keydown",Tt,!0),ut.addEventListener("click",()=>{tt.closeOnBackdrop!==!1&&et(Pe)}),Ne._cleanup=()=>{var ht;document.removeEventListener("mousedown",_t,!0),document.removeEventListener("keydown",Tt,!0),(ht=Ne._positionCleanup)==null||ht.call(Ne)};const Ve=1e3+I.size*10;return Fe.style.zIndex=String(Ve),{id:Pe,close:()=>et(Pe),panel:dt,overlay:Fe,reposition:Qe}},et=st=>{var Pe,Ne,Fe;const tt=I.get(st);tt&&(I.delete(st),(Pe=tt._cleanup)==null||Pe.call(tt),tt.opts.lockScroll&&xe(),typeof Bt=="function"&&Bt(tt.overlay),(Ne=tt.overlay)==null||Ne.remove(),(Fe=tt.onClose)==null||Fe.call(tt))};return{open:Ue,close:et,closeTop:()=>{const st=Le();st&&et(st.id)},root:J,_stack:I}})();function gs(l,I={}){const{isSVG:J=!1,normalizeClass:$=Pe=>String(Pe!=null?Pe:""),isContentProp:D=()=>!1,autoValueTags:me=new Set(["INPUT","TEXTAREA","SELECT"])}=I;function G(Pe){if(J||!(Pe in l))return!1;try{return typeof l[Pe]=="boolean"}catch(Ne){return!1}}function pe(Pe){return J||Pe.startsWith("data-")||Pe.startsWith("aria-")||!(Pe in l)}function Ee(Pe,Ne){if(Ne==null){l.removeAttribute(Pe);return}if(Ne===!1){if(Pe.startsWith("aria-")){l.setAttribute(Pe,"false");return}l.removeAttribute(Pe);return}if(Ne===!0&&!J&&!Pe.startsWith("aria-")&&!Pe.startsWith("data-")){l.setAttribute(Pe,"");return}l.setAttribute(Pe,String(Ne))}function ve(Pe,Ne){if(Pe==null)return;const Fe=String(Pe),ut=Fe.startsWith("--")||Fe.includes("-");if(Ne==null||Ne===!1||Ne===""){ut?l.style.removeProperty(Fe):l.style[Fe]="";return}if(ut){l.style.setProperty(Fe,String(Ne));return}l.style[Fe]=Ne}function xe(Pe){const Ne=$(Pe);if(Ne==null||Ne===!1||Ne===""){l.removeAttribute("class");return}l.setAttribute("class",String(Ne))}function Le(Pe,Ne){const Fe=!!Ne;l[Pe]=Fe,Fe?l.setAttribute(Pe,""):l.removeAttribute(Pe)}function Re(Pe){if(D(Pe)){l[Pe]="";return}if(Pe==="class"){l.removeAttribute("class");return}if(Pe==="style"){l.removeAttribute("style");return}if(G(Pe)){try{l[Pe]=!1}catch(Ne){}l.removeAttribute(Pe);return}if(l.removeAttribute(Pe),!pe(Pe))try{typeof l[Pe]=="string"&&(l[Pe]="")}catch(Ne){}}function Ue(Pe){!Pe||typeof Pe!="object"||Object.entries(Pe).forEach(([Ne,Fe])=>{ve(Ne,Fe)})}function et(Pe,Ne){if(D(Pe)){l[Pe]=Ne!=null?Ne:"";return}if(Pe==="class"){xe(Ne);return}if(Pe==="style"){if(Ne==null||Ne===!1){Re(Pe);return}if(typeof Ne=="object"){Ue(Ne);return}}if(G(Pe)){Le(Pe,Ne);return}if(Ne==null||Ne===!1){Re(Pe);return}if(pe(Pe)){Ee(Pe,Ne);return}l[Pe]=Ne}function yt(Pe,Ne){const Fe=String(Pe).split(".");let ut=l;for(let dt=0;dt<Fe.length-1;dt++)if(ut=ut==null?void 0:ut[Fe[dt]],!ut)return;ut[Fe[Fe.length-1]]=Ne}function st(Pe){return Pe?Pe==="auto"||Pe.startsWith("attr:")||Pe.startsWith("@")||Pe.startsWith("style.")||Pe.includes("."):!1}function tt(Pe,Ne){if(!Pe||Pe==="auto"){me.has(l.tagName)?et("value",Ne):l.textContent=Ne!=null?Ne:"";return}if(Pe.startsWith("attr:")){Ee(Pe.slice(5),Ne);return}if(Pe.startsWith("@")){Ee(Pe.slice(1),Ne);return}if(Pe.startsWith("style.")){ve(Pe.slice(6),Ne);return}if(Pe.includes(".")){yt(Pe,Ne);return}et(Pe,Ne)}return{isBooleanDomProp:G,isAttributeOnlyProp:pe,isBindingValueKey:st,setAttributeValue:Ee,setStyleEntry:ve,setClassValue:xe,setBooleanProp:Le,removeProp:Re,applyStyleObject:Ue,setProp:et,setPathValue:yt,applyBindingValue:tt}}function Bn(l){const I=[],J=$=>{if(!($==null||$===!1)){if(typeof $=="function"){J($());return}if($&&$.type==="rod"){J($.value);return}if(Array.isArray($)){$.forEach(J);return}if(typeof $=="object"){Object.entries($).forEach(([D,me])=>{let G=me;typeof G=="function"?G=G():G&&G.type==="rod"&&(G=G.value),J(G?D:null)});return}$!==!0&&String($).split(/\s+/).forEach(D=>{D&&I.push(D)})}};return J(l),I.length?Array.from(new Set(I)).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 rs(l,I){return l==null||l===!1?!1:typeof l=="function"||I(l)?!0:typeof l!="object"||Array.isArray(l)||l.nodeType?!1:Object.values(l).some(J=>rs(J,I))}function as(l,I){let J=l;if(typeof J=="function"?J=J():I(J)&&(J=J.value),!J||typeof J!="object"||Array.isArray(J)||J.nodeType)return null;const $={};return Object.entries(J).forEach(([D,me])=>{let G=me;typeof G=="function"?G=G():I(G)&&(G=G.value),$[D]=G}),$}function zs(l){let I=new Set;function J(D){I.forEach(me=>{D.has(me)||l(me,null)}),I=D}function $(D,me){const G=as(D,me);if(!G){J(new Set);return}const pe=new Set(Object.keys(G));J(pe),Object.entries(G).forEach(([Ee,ve])=>{l(Ee,ve)})}return{apply:$}}function Ys(l){return typeof l=="string"&&(l.startsWith("on:")||l.startsWith("on")&&l.length>2)}const wn=128,Jn=[];function Ps(l,I){Jn.push({rod:l,value:String(I!=null?I:"")}),Jn.length>wn&&Jn.splice(0,Jn.length-wn)}function jn(){if(!Jn.length)return null;const l=Jn.slice();return Jn.length=0,{items:l,index:0}}function cs(l,I){if(!I||!l||I.index>=I.items.length)return null;const J=[],$=String(l);let D=0,me=I.index,G=!1;for(;me<I.items.length;){const pe=I.items[me],Ee=pe.value;if(!Ee)break;const ve=$.indexOf(Ee,D);if(ve===-1)break;ve>D&&J.push($.slice(D,ve)),J.push(pe.rod),D=ve+Ee.length,me++,G=!0}return G?(D<$.length&&J.push($.slice(D)),I.index=me,J):null}function Xs(l){var J;let I="";for(const $ of l)typeof $=="string"?I+=$:I+=(J=$==null?void 0:$.value)!=null?J:"";return I}function No(l){if(l.startsWith("on:"))return l.slice(3);const I=l.slice(2);return I?I==="DoubleClick"?"dblclick":I.toLowerCase():""}function us(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,I){const J=us(l),$=us(I);return typeof J=="boolean"||typeof $=="boolean"?J===$:!!J&&!!$&&J.capture===$.capture&&J.passive===$.passive&&J.once===$.once}function Xn(l,I){return Array.isArray(l)?l.some(J=>Xn(J,I)):I(l)?!0:!l||typeof l!="object"||Array.isArray(l)||l.nodeType?!1:Array.isArray(l.handlers)?l.handlers.some(J=>Xn(J,I))||I(l.options)||typeof l.options=="function":Array.isArray(l.listeners)?l.listeners.some(J=>Xn(J,I))||I(l.options)||typeof l.options=="function":I(l.handler)||I(l.listener)||I(l.fn)||I(l.options)||typeof l.options=="function"}function Qn(l,I,J){var $,D,me,G,pe,Ee,ve;if(l==null||l===!1)return[];if(typeof l=="function")return[{handler:l,options:us(J!=null?J:!1)}];if(I(l))return Qn(l.value,I,J);if(Array.isArray(l))return l.flatMap(xe=>Qn(xe,I,J));if(typeof l=="object"&&!Array.isArray(l)&&!l.nodeType){if(Array.isArray(l.handlers)||Array.isArray(l.listeners)){const Re=l.handlers||l.listeners||[],Ue=(D=($=l.options)!=null?$:J)!=null?D:!1;return Re.flatMap(et=>Qn(et,I,Ue))}let xe=(pe=(G=(me=l.handler)!=null?me:l.listener)!=null?G:l.fn)!=null?pe:null,Le=(ve=(Ee=l.options)!=null?Ee:J)!=null?ve:!1;return I(xe)&&(xe=xe.value),I(Le)&&(Le=Le.value),typeof Le=="function"&&(Le=Le()),typeof xe=="function"?[{handler:xe,options:us(Le)}]:[]}return[]}function Ao(l,I){return Qn(l,I)}function Zs(l,I,J,$){const D=No(I);if(!D)return;const me={listeners:[]},G=()=>{me.listeners.forEach(Ee=>{l.removeEventListener(D,Ee.dispatch,Ee.options)}),me.listeners=[]},pe=Ee=>{const ve=Ao(Ee,$);me.listeners.length===ve.length&&me.listeners.every((Le,Re)=>{const Ue=ve[Re];return Le.handler===Ue.handler&&Qs(Le.options,Ue.options)})||(G(),ve.forEach(Le=>{const Re={handler:Le.handler,options:Le.options,dispatch:null};Re.dispatch=Ue=>{if(typeof Re.handler=="function"){const et=Re.handler.call(l,Ue);return Re.options&&typeof Re.options=="object"&&Re.options.once&&(l.removeEventListener(D,Re.dispatch,Re.options),me.listeners=me.listeners.filter(yt=>yt!==Re)),et}},l.addEventListener(D,Re.dispatch,Re.options),me.listeners.push(Re)}))};if(Q._registerCleanup(l,G),$(J)){const Ee=Q.reactive.effect(()=>{pe(J.value)});Q._registerCleanup(l,Ee);return}if(Xn(J,$)){const Ee=Q.reactive.effect(()=>{pe(J)});Q._registerCleanup(l,Ee);return}pe(J)}function eo(l,I={}){const{isRod:J=()=>!1,interpolationCursor:$=null}=I;function D(xe){const Le=document.createTextNode(""),Re=Q.rodBind(Le,xe);return Q._registerCleanup(Le,Re),Le}function me(xe){l.appendChild(D(xe))}function G(xe){const Le=document.createTextNode("");l.appendChild(Le);const Re=Q.reactive.effect(()=>{Le.textContent=Xs(xe)});Q._registerCleanup(Le,Re)}function pe(xe){const Le=[],Re=Ue=>{if(!(Ue==null||Ue===!1)){if(Array.isArray(Ue)){Ue.forEach(Re);return}if(typeof Ue=="string"){Le.push(document.createTextNode(Ue));return}if(typeof Ue=="number"){Le.push(document.createTextNode(String(Ue)));return}if(typeof Ue!="boolean"){if(J(Ue)){Le.push(D(Ue));return}if(Ue!=null&&Ue.nodeType){Le.push(Ue);return}Le.push(document.createTextNode(String(Ue)))}}};return Re(xe),Le}function Ee(xe){const Le=document.createComment("dyn");l.appendChild(Le);let Re=[];const Ue=Q.reactive.effect(()=>{Re.forEach(tt=>{Bt(tt),tt.parentNode&&tt.parentNode.removeChild(tt)}),Re=[];const et=Le.parentNode;if(!et)return;const yt=pe(xe());if(!yt.length)return;const st=document.createDocumentFragment();yt.forEach(tt=>st.appendChild(tt)),et.insertBefore(st,Le.nextSibling),Re=yt});Q._registerCleanup(Le,()=>{Ue(),Re.forEach(et=>Bt(et)),Re=[]})}function ve(xe){if(xe!=null){if(Array.isArray(xe)){for(const Le of xe)ve(Le);return}if(typeof xe=="string"){const Le=cs(xe,$);Le?G(Le):l.appendChild(document.createTextNode(xe));return}if(typeof xe=="number"){l.appendChild(document.createTextNode(String(xe)));return}if(typeof xe=="function"){Ee(xe);return}if(J(xe)){me(xe);return}xe.nodeType&&l.appendChild(xe)}}return{appendRodText:me,appendInterpolatedText:G,appendDynamicChild:Ee,appendChildValue:ve}}function to(l,I={}){const{el:J,isRod:$=()=>!1,interpolationCursor:D=null,appendChildValue:me=()=>{},appendRodText:G=()=>{},appendInterpolatedText:pe=()=>{},appendDynamicChild:Ee=()=>{},bindProp:ve=()=>{}}=I;for(const xe of l)if(xe!=null){if(Array.isArray(xe)){me(xe);continue}if(typeof xe=="string"){const Le=cs(xe,D);Le?pe(Le):J.appendChild(document.createTextNode(xe));continue}if(typeof xe=="number"){J.appendChild(document.createTextNode(String(xe)));continue}if(typeof xe=="function"){Ee(xe);continue}if($(xe)){G(xe);continue}if(xe.nodeType){J.appendChild(xe);continue}if(typeof xe=="object")for(const[Le,Re]of Object.entries(xe)){if(typeof Re=="string"){const Ue=cs(Re,D);if(Ue){ve(Le,()=>Xs(Ue));continue}}if(Le==="class"){ve(Le,Re);continue}if(Le==="style"&&typeof Re=="object"&&Re!==null&&!$(Re)){ve(Le,Re);continue}ve(Le,Re)}}}const no="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 ds(l){return l==="innerHTML"||l==="innerText"||l==="textContent"||l==="value"}function so(l,...I){const J=Ts.has(l),$=l==="text"&&!J?document.createTextNode(""):J?document.createElementNS(no,l):document.createElement(l),D=Ve=>!!Ve&&Ve.type==="rod",me=jn(),G=eo($,{isRod:D,interpolationCursor:me}),{appendRodText:pe,appendInterpolatedText:Ee,appendDynamicChild:ve,appendChildValue:xe}=G,Le=gs($,{isSVG:J,normalizeClass:Bn,isContentProp:ds}),{isBooleanDomProp:Re,isBindingValueKey:Ue,applyBindingValue:et,setStyleEntry:yt,setProp:st,setClassValue:tt}=Le;function Pe(Ve){const ot=Q.reactive.effect(Ve);return Q._registerCleanup($,ot),ot}function Ne(Ve){if(String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()!=="input")return!1;const ot=String((Ve==null?void 0:Ve.type)||"").toLowerCase();return ot==="range"||ot==="number"}function Fe(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()!=="input"?"":String((Ve==null?void 0:Ve.type)||"").toLowerCase()}function ut(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()==="select"&&!Ve.multiple}function dt(Ve){return String((Ve==null?void 0:Ve.tagName)||"").toLowerCase()==="input"&&String((Ve==null?void 0:Ve.type)||"").toLowerCase()==="file"}function kt(Ve,ot,zt){Pe(()=>{var ht;const Ct=(ht=ot.value)!=null?ht:"";Ve.value!==String(Ct)&&st("value",Ct)});const $t=()=>{let Ct=Ve.value;const ht=Fe(Ve),Ke=typeof ot.value=="number"||ot.value==null;if(ut(Ve)&&Ve.value==="")Ct=null;else if(Ne(Ve)&&Ke)if(ht==="number"&&Ve.value==="")Ct=null;else{const o=typeof Ve.valueAsNumber=="number"&&!Number.isNaN(Ve.valueAsNumber)?Ve.valueAsNumber:Number(Ve.value);Ct=Number.isNaN(o)?ht==="number"?null:0:o}ot.value!==Ct&&(ot.value=Ct)};Ve.addEventListener(zt,$t),Q._registerCleanup(Ve,()=>{Ve.removeEventListener(zt,$t)})}function It(Ve,ot){Pe(()=>{const $t=!!ot.value;!!Ve.checked!==$t&&st("checked",$t)});const zt=()=>{const $t=!!Ve.checked;ot.value!==$t&&(ot.value=$t)};Ve.addEventListener("change",zt),Q._registerCleanup(Ve,()=>{Ve.removeEventListener("change",zt)})}function Wt(Ve,ot){const zt=()=>{var Ct;return String((Ct=Ve.value)!=null?Ct:"on")};Pe(()=>{const ht=(ot.value==null?null:String(ot.value))===zt();!!Ve.checked!==ht&&st("checked",ht)});const $t=()=>{if(!Ve.checked)return;const Ct=zt();ot.value!==Ct&&(ot.value=Ct)};Ve.addEventListener("change",$t),Q._registerCleanup(Ve,()=>{Ve.removeEventListener("change",$t)})}function Qe(Ve,ot){const zt=()=>{const Ct=Ve.files;return Ct==null?[]:Array.isArray(Ct)?Ct.slice():typeof Ct.length=="number"?Array.from(Ct):[Ct]};Pe(()=>{const Ct=ot.value;(Ct==null||Array.isArray(Ct)&&Ct.length===0)&&(Ve.value!==""&&st("value",""),Array.isArray(Ve.files)&&(Ve.files=[]))});const $t=()=>{const Ct=zt();ot.value=Ct};Ve.addEventListener("change",$t),Q._registerCleanup(Ve,()=>{Ve.removeEventListener("change",$t)})}function St(Ve,ot){const zt=()=>Array.from(Ve.childNodes||[]).filter(ht=>(ht==null?void 0:ht.tagName)==="OPTION"&&ht.selected).map(ht=>{var Ke;return String((Ke=ht.value)!=null?Ke:"")}),$t=()=>{const ht=Array.isArray(ot.value)?ot.value.map(o=>String(o)):[],Ke=new Set(ht);Array.from(Ve.childNodes||[]).forEach(o=>{var Z;if((o==null?void 0:o.tagName)!=="OPTION")return;const Pt=Ke.has(String((Z=o.value)!=null?Z:""));!!o.selected!==Pt&&(o.selected=Pt,Pt?o.setAttribute("selected",""):o.removeAttribute("selected"))})};Pe($t),Ve._cmsApplySelectedValues=$t,queueMicrotask($t);const Ct=()=>{const ht=zt(),Ke=Array.isArray(ot.value)?ot.value.map(o=>String(o)):[];Ke.length===ht.length&&Ke.every((o,Pt)=>o===ht[Pt])||(ot.value=ht)};Ve.addEventListener("change",Ct),Q._registerCleanup(Ve,()=>{Ve.removeEventListener("change",Ct)})}function _t(Ve,ot){Pe(()=>{const ht=!!ot.value;!!Ve.selected!==ht&&st("selected",ht)});let zt=null;const $t=()=>{const ht=!!Ve.selected;ot.value!==ht&&(ot.value=ht)};queueMicrotask(()=>{var ht;zt||((ht=Ve.parentNode)==null?void 0:ht.tagName)!=="SELECT"||(zt=Ve.parentNode,zt.addEventListener("change",$t))}),Q._registerCleanup(Ve,()=>{zt==null||zt.removeEventListener("change",$t)})}function Tt(Ve,ot){if(Ys(Ve)){Zs($,Ve,ot,D);return}if(Ve==="class"){if(ys(ot)){Pe(()=>{tt(Bn(ot))});return}tt(Bn(ot));return}if(Ve==="style"&&ot&&typeof ot=="object"){const zt=zs(yt);if(rs(ot,D)){Pe(()=>{zt.apply(ot,D)});return}zt.apply(ot,D);return}if(Ve==="style"&&(typeof ot=="function"||D(ot))){const zt=zs(yt);Pe(()=>{zt.apply(ot,D)});return}if(Ue(Ve)&&typeof ot=="function"){Pe(()=>{et(Ve,ot())});return}if(Ue(Ve)&&!D(ot)){et(Ve,ot);return}if(typeof ot=="function"){Pe(()=>{st(Ve,ot())});return}if(Ve==="value"&&D(ot)&&(l==="input"||l==="textarea"||l==="select")){if(l==="select"&&$.multiple){St($,ot);return}kt($,ot,l==="select"?"change":"input");return}if(Ve==="checked"&&D(ot)&&l==="input"){if(String($.type||"").toLowerCase()==="radio"){Wt($,ot);return}It($,ot);return}if(Ve==="files"&&D(ot)&&dt($)){Qe($,ot);return}if(Ve==="selected"&&D(ot)&&l==="option"){_t($,ot);return}if(ds(Ve)&&D(ot)){Pe(()=>{st(Ve,ot.value)});return}if(D(ot)){const zt=Q.rodBind($,ot,{key:Ve});Q._registerCleanup($,zt);return}st(Ve,ot)}return to(I,{el:$,isRod:D,interpolationCursor:me,appendChildValue:xe,appendRodText:pe,appendInterpolatedText:Ee,appendDynamicChild:ve,bindProp:Tt}),l==="select"&&typeof $._cmsApplySelectedValues=="function"&&$._cmsApplySelectedValues(),$}const Wo={},oo=["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"];oo.forEach(l=>{window._[l]=(...I)=>so(l,...I)}),_.DOM_ELEMENTS=oo,_.fragment=(...l)=>l,_.dynamic=function(l){const I=document.createComment("dyn"),J=document.createDocumentFragment();J.appendChild(I);let $=null;return Q.reactive.effect(()=>{const D=l();if($&&$.parentNode&&$.parentNode.removeChild($),$=null,D==null)return;let me=D;(typeof D=="string"||typeof D=="number")&&(me=document.createTextNode(String(D)));const G=I.parentNode;G&&me&&me.nodeType&&(G.insertBefore(me,I.nextSibling),$=me)}),J};function io(){let l=!1;const I=new Set;function J(){var D,me,G;l=!1,(D=Q.debug)==null||D.inc("rodFlushes"),(me=Q.perf)==null||me.inc("rodFlushes"),(G=Q.perf)==null||G.mark("rod:flush");const $=Array.from(I);I.clear();for(const pe of $)try{pe()}catch(Ee){console.error("[rod] flush error:",Ee)}}return function(D){I.add(D),l||(l=!0,queueMicrotask(J))}}const Uo=io();function lo(l,I,J){if(!l)return;if(l.nodeType===3){l.textContent=J!=null?J:"";return}gs(l,{isSVG:l.namespaceURI===no,normalizeClass:Bn,isContentProp:ds}).applyBindingValue(I,J)}function Lo(l){return{type:"rod",value:l,_bindings:[],_actions:[],_disposeHooks:[],_disposed:!1,_silentDepth:0,_pending:!1,bindings(){return this._bindings.map(J=>({el:J.el,key:J.key}))},onDispose(J){return typeof J=="function"&&this._disposeHooks.push(J),this},_bind(J,$={key:"auto"}){var G;if(this._disposed)return()=>{};if(!J)return()=>{};const D={el:J,key:(G=$==null?void 0:$.key)!=null?G:"auto"};return this._bindings.some(pe=>pe.el===D.el&&pe.key===D.key)||this._bindings.push(D),lo(D.el,D.key,this.value),()=>{this._bindings=this._bindings.filter(pe=>!(pe.el===D.el&&pe.key===D.key))}},action(J){return!this._disposed&&typeof J=="function"&&this._actions.push(J),this},_setSilent(J){this._silentDepth++;try{this.value=J}finally{this._silentDepth--}return this},_scheduleNotify(){this._disposed||this._pending||(this._pending=!0,Uo(()=>{this._pending=!1,this._notifyNow()}))},_notifyNow(){var $,D,me,G,pe;if(this._disposed)return;const J=performance.now();($=Q.perf)==null||$.inc("rodNotifies"),this._bindings=this._bindings.filter(Ee=>{const ve=Ee.el;return ve?ve.nodeType===3?!!ve.parentNode:ve.isConnected!==!1:!1});for(const Ee of this._bindings)lo(Ee.el,Ee.key,this.value);if(!(this._silentDepth>0)){for(const Ee of this._actions)try{Ee(this.value)}catch(ve){console.error("[rod] action error:",ve)}(D=Q.debug)==null||D.inc("rodNotifies"),(pe=Q.perf)==null||pe.tick("rod:notify",performance.now()-J,{bindings:((me=this._bindings)==null?void 0:me.length)||0,actions:((G=this._actions)==null?void 0:G.length)||0})}},dispose(){if(!this._disposed){this._disposed=!0;for(const J of this._disposeHooks)try{J()}catch($){console.error("[rod] dispose hook error:",$)}this._bindings.length=0,this._actions.length=0,this._disposeHooks.length=0}}}}function fs(l,I="value"){var G;let J=l[I],$=null,D=null,me=null;return(G=Q==null?void 0:Q.reactive)!=null&&G.signal&&([$,D,me]=Q.reactive.signal(J),me&&typeof l.onDispose=="function"&&l.onDispose(me)),Object.defineProperty(l,I,{get(){return $?$():J},set(pe){D?D(pe):J=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 Ee=this.value;if(Ee==null)return Ee;const ve=typeof Ee;return pe==="number"?Number(Ee):(ve!=="symbol"&&Ps(this,Ee),ve==="string"||ve==="number"||ve==="boolean"||ve==="bigint"||ve==="symbol"?Ee:String(Ee))},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(I,J="value"){const $=Lo(I);return fs($,J),Q.rod._all=Q.rod._all||new Set,Q.rod._all.add($),typeof $.onDispose=="function"&&$.onDispose(()=>Q.rod._all.delete($)),$},Q.rodBind=function(l,I,J={key:"auto"}){var $,D,me;if(($=Q.debug)==null||$.inc("rodBinds"),!l)return(D=Q.debug)==null||D.inc("rodBindNull"),(me=Q.debug)==null||me.warn("rodBind: target element \xE8 null/undefined",J),()=>{};if(!I||I.type!=="rod")throw new Error("JSswift.rodBind: react must be a rod object");return I._bind(l,J)},Q.rodFromSignal=function(l,I){const J=_.rod(l());let $=!1;const D=Q.reactive.effect(()=>{const G=J.value,pe=Q.reactive.untracked(()=>l());if(!$&&pe!==G){$=!0;try{I(G)}finally{$=!1}}}),me=Q.reactive.effect(()=>{const G=l();if(Q.reactive.untracked(()=>J.value)!==G){$=!0;try{J._setSilent(G)}finally{$=!1}}});return typeof J.onDispose=="function"&&(J.onDispose(D),J.onDispose(me)),J};function In(l){if(!l||!l.tagName)return null;const I=l.tagName.toLowerCase();if(I==="input"){const J=(l.type||"text").toLowerCase();return J==="checkbox"?"checkbox":J==="radio"?"radio":J==="number"?"number":"text"}return I==="select"?l.multiple?"select-multiple":"select":null}Q.rodModel=function(l,I,J={}){var Ue,et,yt;if(!I||I.type!=="rod")throw new Error("[JSswift.rodModel] rodObj deve essere un rod");const $=Array.isArray(l)||l instanceof NodeList?Array.from(l):[l],D=(Ue=J.event)!=null?Ue:"change",me=(et=J.parse)!=null?et:(st=>st),G=(yt=J.format)!=null?yt:(st=>st);let pe=!1;const Ee=[],ve=st=>{for(const tt of $){if(!tt)continue;switch(In(tt)){case"checkbox":tt.checked=!!st;break;case"radio":tt.checked=tt.value==st;break;case"select":tt.value=st!=null?st:"";break;case"select-multiple":const Ne=Array.isArray(st)?st.map(String):[];for(const Fe of tt.options)Fe.selected=Ne.includes(Fe.value);break;default:tt.value=st!=null?st:""}}},xe=st=>{if(!pe){pe=!0;try{ve(G(st))}finally{pe=!1}}};I.action(xe),ve(G(I.value));for(const st of $){if(!st)continue;const tt=In(st),Pe=()=>{if(pe)return;let Ne;switch(tt){case"checkbox":Ne=st.checked;break;case"radio":if(!st.checked)return;Ne=st.value;break;case"select":Ne=st.value;break;case"select-multiple":Ne=Array.from(st.selectedOptions).map(Fe=>Fe.value);break;case"number":Ne=me(st.value===""?null:Number(st.value));break;default:Ne=me(st.value)}pe=!0;try{I.value!==Ne&&(I.value=Ne)}finally{pe=!1}};st.addEventListener(D,Pe),Ee.push(()=>st.removeEventListener(D,Pe))}let Le=!1;const Re=()=>{var Pe,Ne,Fe,ut;if(Le)return;Le=!0,Ee.splice(0).forEach(dt=>dt());const st=(Ne=(Pe=I._actions)==null?void 0:Pe.indexOf(xe))!=null?Ne:-1;st>=0&&I._actions.splice(st,1);const tt=(ut=(Fe=I._disposeHooks)==null?void 0:Fe.indexOf(Re))!=null?ut:-1;tt>=0&&!I._disposed&&I._disposeHooks.splice(tt,1)};return typeof I.onDispose=="function"&&I.onDispose(Re),Re},Q.signalModel=function(l,I,J,$={}){const D=Q.rodFromSignal(I,J),me=Q.rodModel(l,D,$);return()=>{me(),D.dispose()}};function Bt(l){if(!l)return;const I=Q._cleanupRegistry.get(l);if(I){for(const J of I)try{J()}catch($){console.error("[cleanup] error:",$)}Q._cleanupRegistry.delete(l)}if(l.childNodes&&l.childNodes.length)for(const J of l.childNodes)Bt(J)}function Io(l){const I=J=>typeof J=="string"?Q.dom.q(J):J;return Array.isArray(l)?l.map(I).filter(Boolean):[I(l)].filter(Boolean)}function bs(l){const I=[],J=[],$=D=>{if(D!=null){if(typeof D=="function"){$(D());return}if(D&&typeof D=="object"&&"node"in D){typeof D.dispose=="function"&&J.push(D.dispose),$(D.node);return}if(Array.isArray(D)){for(const me of D)$(me);return}if(typeof D=="string"||typeof D=="number"){I.push(document.createTextNode(String(D)));return}if(D.nodeType){I.push(D);return}console.warn("[JSswift.mount] contenuto non supportato:",D)}};return $(l),{nodes:I,disposers:J}}function Zn(l=[],I="[JSswift.mount] dispose error:"){let J=!1;return()=>{if(!J){J=!0;for(const $ of l)try{$()}catch(D){console.error(I,D)}}}}function ws(l=[],I=null){return Zn([...I?[I]:[],...l],"[component] dispose error:")}Q.mount=function(l,I,J={}){var Ee;const $=Io(l),D=(Ee=J.clear)!=null?Ee:!0,me=$.length>1;if($.length===0)return console.warn("[JSswift.mount] nessun target valido:",l),()=>{};const G=[];for(const ve of $){if(D)for(;ve.firstChild;)Bt(ve.firstChild),ve.removeChild(ve.firstChild);const{nodes:xe,disposers:Le}=bs(I);let Re=xe;me&&typeof I!="function"&&(Re=xe.map(et=>et.cloneNode(!0)),Le.length&&console.warn("[JSswift.mount] multi-target con dispose: usa content come function per istanze separate."));const Ue=Zn(Le);for(const et of Re)ve.appendChild(et);G.push({root:ve,nodes:Re,dispose:Ue});for(const et of Re)!et||!et.nodeType||Q._registerCleanup(et,Ue)}return()=>{var ve;for(const xe of G){for(const Le of xe.nodes)Le&&(Bt(Le),Le.parentNode===xe.root&&xe.root.removeChild(Le));(ve=xe.dispose)==null||ve.call(xe)}}},Q.component=function(l){if(typeof l!="function")throw new Error("JSswift.component: renderFn must be a function");return function(J={}){const $=[],me=l(J,{onDispose(G){typeof G=="function"&&$.push(G)}});return me&&typeof me=="object"&&"node"in me?{node:me.node,dispose:ws($,typeof me.dispose=="function"?me.dispose:null)}:{node:me,dispose:ws($)}}},Q.enableAutoCleanup=function(){if(Q._autoCleanupEnabled)return;Q._autoCleanupEnabled=!0;const l=new MutationObserver(I=>{for(const J of I)for(const $ of J.removedNodes)Bt($)});l.observe(document.body,{childList:!0,subtree:!0}),Q._cleanupObserver=l},Q.debug=(()=>{const l={rodFlushes:0,rodNotifies:0,rodBinds:0,rodBindNull:0,rodBindDup:0};function I(){return!!Q.config.debug}function J(...Ee){I()&&console.log("[JSswift]",...Ee)}function $(...Ee){I()&&console.warn("[JSswift]",...Ee)}function D(...Ee){console.error("[JSswift]",...Ee)}function me(Ee,ve=1){l[Ee]||(l[Ee]=0),l[Ee]+=ve}function G(){return{...l}}function pe(){for(const Ee of Object.keys(l))l[Ee]=0}return{enabled:I,log:J,warn:$,error:D,inc:me,stats:G,reset:pe}})(),Q.perf=(()=>{let l=!1;const I={effectsRun:0,effectsSlow:0,rodNotifies:0,rodFlushes:0,domWrites:0,httpRequests:0},J=[],$=[],D={timelineMax:200,slowEffectMs:8};function me(){return typeof performance!="undefined"&&performance.now?performance.now():Date.now()}function G(Fe,ut=0,dt=null){l&&(J.push({t:Date.now(),type:Fe,ms:ut,meta:dt}),J.length>D.timelineMax&&J.shift())}function pe(Fe,ut=1){l&&(I[Fe]=(I[Fe]||0)+ut)}function Ee(Fe,ut){l&&($.push({t:Date.now(),ms:Fe,meta:ut}),$.length>100&&$.shift())}let ve=null;function xe(){ve||(ve=Q.reactive.effect,Q.reactive.effect=function(Fe,ut){return ve((...kt)=>{const It=me();pe("effectsRun");try{return Fe(...kt)}finally{const Wt=me()-It;Wt>=D.slowEffectMs?(pe("effectsSlow"),Ee(Wt,ut||Fe.name||"effect"),G("effect:slow",Wt,ut||Fe.name||null)):G("effect",Wt,ut||Fe.name||null)}})})}function Le(){ve&&(Q.reactive.effect=ve,ve=null)}function Re(Fe=!0){return l=!!Fe,l?xe():Le(),l}function Ue(){for(const Fe of Object.keys(I))I[Fe]=0;J.length=0,$.length=0}function et(){return{enabled:l,...I,slowEffectMs:D.slowEffectMs,timelineSize:J.length}}function yt(){return J.slice()}function st(Fe=D.slowEffectMs){return $.filter(ut=>ut.ms>=Fe).slice().sort((ut,dt)=>dt.ms-ut.ms)}function tt(Fe,ut){const dt=me();try{return ut()}finally{const kt=me()-dt;G("time:"+Fe,kt,Fe)}}function Pe(Fe,ut){G(Fe,0,ut)}function Ne(Fe,ut,dt){G(Fe,ut,dt)}return{enable:Re,reset:Ue,stats:et,timeline:yt,slowEffects:st,time:tt,mark:Pe,tick:Ne,inc:pe,cfg:D}})(),Q.rod=Q.rod||{},Q.rod.inspect=function(l,I="rod"){if(!l||l.type!=="rod")return console.warn("[JSswift.rod.inspect] non \xE8 un rod:",l),null;const J=typeof l.bindings=="function"?l.bindings():[],$={label:I,value:l.value,bindingsCount:J.length,bindings:J.map(D=>{var me,G,pe,Ee,ve,xe,Le;return{key:D.key,el:((me=D.el)==null?void 0:me.nodeType)===3?"#text":(G=D.el)==null?void 0:G.tagName,id:((pe=D.el)==null?void 0:pe.id)||null,className:((Ee=D.el)==null?void 0:Ee.className)||null,isConnected:((ve=D.el)==null?void 0:ve.nodeType)===3?!!D.el.parentNode:(Le=(xe=D.el)==null?void 0:xe.isConnected)!=null?Le:null}}),actionsCount:Array.isArray(l._actions)?l._actions.length:null,disposed:!!l._disposed};return Q.config.debug?(console.groupCollapsed(`[JSswift.rod.inspect] ${I}`),console.log($),console.groupEnd()):console.log($),$},Q.rod.inspectAll=function(){const l=Q.rod._all?Array.from(Q.rod._all):[];return l.forEach((I,J)=>Q.rod.inspect(I,`rod#${J+1}`)),l.length},Q._storeShared=(()=>{function l(me){return`${me.storage}::${me.prefix}`}function I(me,G){function pe(Le={}){var Ue,et;const Re={storage:(Ue=Le.storage)!=null?Ue:me.storage,prefix:(et=Le.prefix)!=null?et:me.prefix};return G.set(l(Re),Re),Re}function Ee(Le=null){var Ue;return(typeof Le=="string"?Le:(Ue=Le==null?void 0:Le.storage)!=null?Ue:me.storage)==="session"?window.sessionStorage:window.localStorage}function ve(Le,Re=null){return(Re||pe()).prefix+Le}function xe(Le,Re=null){const Ue=Re||pe();return`${l(Ue)}::${Le}`}return{getScope:pe,getStorage:Ee,fullKey:ve,channelKey:xe}}function J(me){try{return JSON.parse(me)}catch(G){return}}function $(me){try{return JSON.stringify(me)}catch(G){return}}function D(me,...G){const pe=`${me.storage}::${me.prefix}::`;for(const Ee of G)for(const ve of Array.from(Ee.keys()))ve.startsWith(pe)&&Ee.delete(ve)}return{createScopeTools:I,safeParse:J,safeStringify:$,clearScopedMapEntries:D}})(),Q.store=(()=>{const l={prefix:"JSswift:",storage:"local",syncTabs:!0,writeDelay:0},I=new Map,J=new Map,$=new Map,D=new Map;let me=!1;const{createScopeTools:G,safeParse:pe,safeStringify:Ee,clearScopedMapEntries:ve}=Q._storeShared,{getScope:xe,getStorage:Le,fullKey:Re,channelKey:Ue}=G(l,D);function et(Qe,St,_t=null){var ot;const Tt=_t||xe(),Ve=J.get(Ue(Qe,Tt));if(Ve)for(const zt of Ve)try{(ot=Q.reactive)!=null&&ot.untracked?Q.reactive.untracked(()=>zt(St)):zt(St)}catch($t){console.error("[store] watcher error:",$t)}}function yt(){me=!1;for(const[Qe,St]of Array.from($.entries())){$.delete(Qe);const _t=I.get(Qe),Tt=Ee(_t);if(Tt===void 0)continue;const Ve=Le(St.scope);try{Ve.setItem(Re(St.key,St.scope),Tt)}catch(ot){console.error("[store] write error:",ot)}}}function st(Qe,St=null){const _t=St||xe();$.set(Ue(Qe,_t),{key:Qe,scope:_t}),!me&&(me=!0,l.writeDelay>0?setTimeout(yt,l.writeDelay):queueMicrotask(yt))}function tt(Qe,St=null){const _t=St||xe(),Ve=Le(_t).getItem(Re(Qe,_t));if(Ve!=null)return pe(Ve)}function Pe(Qe,St,_t=null){const Tt=_t||xe(),Ve=Ue(Qe,Tt);if(I.has(Ve))return I.get(Ve);const ot=tt(Qe,Tt);return ot!==void 0?(I.set(Ve,ot),ot):St}function Ne(Qe,St,_t=null){const Tt=_t||xe();return I.set(Ue(Qe,Tt),St),st(Qe,Tt),et(Qe,St,Tt),St}function Fe(Qe,St=null){const _t=St||xe(),Tt=Ue(Qe,_t);I.delete(Tt),$.delete(Tt);try{Le(_t).removeItem(Re(Qe,_t))}catch(Ve){}et(Qe,void 0,_t)}function ut(Qe={}){const St=xe(Qe),_t=Le(St),Tt=[];for(let Ve=0;Ve<_t.length;Ve++){const ot=_t.key(Ve);ot&&ot.startsWith(St.prefix)&&Tt.push(ot)}for(const Ve of Tt)_t.removeItem(Ve);ve(St,I,$,J)}function dt(Qe,St,_t=null){if(typeof St!="function")return()=>{};const Tt=_t||xe(),Ve=Ue(Qe,Tt);return J.has(Ve)||J.set(Ve,new Set),J.get(Ve).add(St),()=>{var ot;return(ot=J.get(Ve))==null?void 0:ot.delete(St)}}function kt(Qe,St,_t={}){const Tt=xe({storage:_t.storage,prefix:_t.prefix}),Ve=Pe(Qe,St,Tt),[ot,zt,$t]=Q.reactive.signal(Ve),Ct=Q.reactive.effect(()=>{const o=ot();Ne(Qe,o,Tt)}),ht=dt(Qe,o=>{ot()!==o&&zt(o)},Tt);return[ot,zt,()=>{try{Ct==null||Ct()}catch(o){}try{ht==null||ht()}catch(o){}try{$t==null||$t()}catch(o){}}]}xe(),l.syncTabs&&window.addEventListener("storage",Qe=>{if(!(!Qe.key||!Qe.storageArea))for(const St of D.values()){if(Le(St)!==Qe.storageArea||!Qe.key.startsWith(St.prefix))continue;const _t=Qe.key.slice(St.prefix.length),Tt=Qe.newValue==null?void 0:pe(Qe.newValue),Ve=Ue(_t,St);Tt===void 0?I.delete(Ve):I.set(Ve,Tt),et(_t,Tt,St)}});function It(Qe={}){Object.assign(l,Qe),xe()}function Wt(){return{prefix:l.prefix,storage:l.storage,syncTabs:l.syncTabs,cacheSize:I.size,scopeCount:D.size}}return{configure:It,stats:Wt,get:Pe,set:Ne,remove:Fe,clear:ut,watch:dt,signal:kt}})(),Q.store.computed=function(l){if(typeof l!="function")throw new Error("store.computed: fn must be a function");return Q.reactive.computed(l)},Q.store.migrate=function(l,I,J={}){var pe,Ee;const $=(pe=J.versionKey)!=null?pe:"__version",D=Number((Ee=Q.store.get($,0))!=null?Ee:0),me=Number(l!=null?l:0);if(!Number.isFinite(me)||me<0)throw new Error("store.migrate: targetVersion non valido");if(D>=me)return{from:D,to:me,applied:0};let G=0;for(let ve=D;ve<me;ve++){const xe=I==null?void 0:I[ve];if(typeof xe=="function")try{xe(Q.store)}catch(Le){console.error("[store.migrate] step error at version",ve,Le)}G++,Q.store.set($,ve+1)}return{from:D,to:me,applied:G}},Q.store.model=function(l,I,J,$={}){if(typeof I!="string"||!I)throw new Error("store.model: key deve essere una stringa non vuota");const[D,me,G]=Q.store.signal(I,J,{storage:$.storage,prefix:$.prefix}),pe=Q.rodFromSignal(D,me),Ee=Q.rodModel(l,pe,{event:$.event,parse:$.parse,format:$.format});return()=>{var ve;try{Ee==null||Ee()}catch(xe){}try{G==null||G()}catch(xe){}try{(ve=pe.dispose)==null||ve.call(pe)}catch(xe){}}},Q.store.bind=function(l,I,J,$={}){var me;let D=l;return typeof l=="string"&&(l.includes("[")||l.includes(" ")?D=document.querySelectorAll(l):D=Q.dom.q(l)),D?Q.store.model(D,I,J,$):((me=Q.config)!=null&&me.debug&&console.warn("[store.bind] target non trovato:",l),()=>{})},Q.store.bindAll=function(l,I={},J={}){if(typeof l=="string"&&(l=Q.dom.q(l)),!l||!l.querySelectorAll)return console.warn("[store.bindAll] form non valido:",l),()=>{};const $=[];for(const[D,me]of Object.entries(I)){const G=l.querySelectorAll(`[name="${D}"]`);if(!G.length)continue;const pe=Q.store.model(G.length===1?G[0]:G,D,me,J);$.push(pe)}return()=>$.forEach(D=>D())},Q.store.inspect=function(){const l={...Q.store.stats(),keys:Array.from((function(){const I=Q.store.stats().storage==="session"?sessionStorage:localStorage,J=[];for(let $=0;$<I.length;$++){const D=I.key($);D&&D.startsWith(Q.store.stats().prefix)&&J.push(D.replace(Q.store.stats().prefix,""))}return J})())};return console.groupCollapsed("[JSswift.store.inspect]"),console.table(l.keys),console.log(l),console.groupEnd(),l},Q.store.autoForm=function(l,I={},J={}){var D;const $=Q.store.bindAll(l,I,J);return(D=Q.config)!=null&&D.debug&&console.log("[store.autoForm] autosave attivo:",I),$},Q.useStore=function(l,I,J,$={}){const[D,me,G]=Q.store.signal(l,I,$);return J&&typeof J.onDispose=="function"&&typeof G=="function"&&J.onDispose(G),[D,me]},Q._plugins=new Set,Q.usePlugin=function(l,I){var J;if(l){if(Q._plugins.has(l)){(J=Q.config)!=null&&J.debug&&console.warn("[JSswift.usePlugin] plugin gi\xE0 installato:",l.name||l);return}if(typeof l=="function"){l(Q,I),Q._plugins.add(l);return}if(l&&typeof l.install=="function"){l.install(Q,I),Q._plugins.add(l);return}console.warn("[JSswift.usePlugin] plugin non valido:",l)}},Q.plugins=Q.plugins||{},Q.plugins.debug={install(l){l.config.debug=!0,console.log("[JSswift] Debug mode ON")}},Q.plugins.forms={install(l){const I={};l.forms={validate(J,$={},D={}){var xe,Le;if(typeof J=="string"&&(J=l.dom.q(J)),!J||!J.querySelectorAll)return console.warn("[forms.validate] form non valido:",J),null;const me={mode:D.mode||"input",showMessages:(xe=D.showMessages)!=null?xe:!0,submitGuard:(Le=D.submitGuard)!=null?Le:!0,errorClass:D.errorClass||"is-invalid",validClass:D.validClass||"is-valid",messageClass:D.messageClass||"form-error"},G={};for(const[Re,Ue]of Object.entries($)){const et=J.querySelectorAll(`[name="${Re}"]`);if(!et.length)continue;const[yt,st]=l.reactive.signal(null);G[Re]={getErr:yt,setErr:st,els:et};let tt=null;me.showMessages&&(tt=document.createElement("div"),tt.className=me.messageClass,et[et.length-1].after(tt));const Pe=()=>{let Ne;const Fe=et[0];if(Fe.type==="checkbox")Ne=Fe.checked;else if(Fe.type==="radio"){const kt=Array.from(et).find(It=>It.checked);Ne=kt?kt.value:null}else Ne=Fe.value;let ut=!0;try{ut=Ue(Ne)}catch(kt){ut=kt.message||"Errore di validazione"}const dt=ut===!0?null:typeof ut=="string"?ut:"Valore non valido";return st(dt),!dt};for(const Ne of et)Ne.addEventListener(me.mode,Pe);l.reactive.effect(()=>{const Ne=yt();for(const Fe of et)Fe.classList.toggle(me.errorClass,!!Ne),Fe.classList.toggle(me.validClass,!Ne);tt&&(tt.textContent=Ne||"",tt.style.display=Ne?"block":"none")}),Pe()}const pe=l.store.computed(()=>Object.values(G).every(Re=>!Re.getErr())),Ee=Re=>{let Ue=!0;for(const et of Object.values(G)){const yt=et.els[0];yt&&yt.dispatchEvent(new Event(me.mode,{bubbles:!0})),et.getErr()&&(Ue=!1)}!Ue&&me.submitGuard&&(Re.preventDefault(),Re.stopPropagation())};me.submitGuard&&J.addEventListener("submit",Ee);const ve=()=>{me.submitGuard&&J.removeEventListener("submit",Ee)};return I[J]={isValid:pe,dispose:ve},{isValid:pe,dispose:ve}}}}},Q._authShared=(()=>{function l($){const D=()=>{var G;return((G=$())==null?void 0:G.roles)||[]},me=()=>{var G;return((G=$())==null?void 0:G.permissions)||[]};return{roles:D,perms:me,hasRole:G=>D().includes(G),can:G=>me().includes(G),canAny:G=>G.some(pe=>D().includes(pe)||me().includes(pe)),canAll:G=>G.every(pe=>D().includes(pe)||me().includes(pe))}}function I($,D){return D.some(me=>typeof me=="string"?$.startsWith(me):me instanceof RegExp?me.test($):!1)}function J($,D){if(!$||!D)return;let me=!1;function G(){return Date.now()}function pe(Re){if(!Re||typeof Re!="string")return null;const Ue=Re.split(".");if(Ue.length<2)return null;try{const et=Ue[1].replace(/-/g,"+").replace(/_/g,"/"),yt=decodeURIComponent(atob(et).split("").map(st=>"%"+st.charCodeAt(0).toString(16).padStart(2,"0")).join(""));return JSON.parse(yt)}catch(et){return null}}function Ee(){var Re,Ue,et,yt;if(typeof D._getState=="function"){const st=D._getState();return st&&typeof st=="object"?st:{user:(Ue=(Re=D.user)==null?void 0:Re.call(D))!=null?Ue:null}}return{user:(yt=(et=D.user)==null?void 0:et.call(D))!=null?yt:null}}function ve(){var Pe,Ne,Fe;const Re=Ee()||{},Ue=(Ne=Re.user)!=null?Ne:(Pe=D.user)==null?void 0:Pe.call(D),et=(Ue==null?void 0:Ue.name)||(Ue==null?void 0:Ue.email)||(Ue==null?void 0:Ue.id)||"anon",yt=!!((Fe=D.isAuth)!=null&&Fe.call(D)),st=Re.expiresAt||null,tt=st?st-G():null;return yt?`AUTH \u2705 user=${et}${st?` expiresIn=${Math.round(tt/1e3)}s`:""}`:`AUTH \u274C user=${et}`}function xe(Re="auth"){var It,Wt,Qe;const Ue=Ee()||{},et=(Wt=Ue.user)!=null?Wt:(It=D.user)==null?void 0:It.call(D),yt=(et==null?void 0:et.roles)||[],st=(et==null?void 0:et.permissions)||[],tt=Ue.accessToken||null,Pe=Ue.refreshToken||null,Ne=tt?pe(tt):null,Fe=Ue.expiresAt||(Ne!=null&&Ne.exp?Ne.exp*1e3:null),ut=G(),dt=Fe?Fe-ut:null,kt={label:Re,isAuth:!!((Qe=D.isAuth)!=null&&Qe.call(D)),user:et,roles:yt,permissions:st,has:{role:St=>{var _t;return!!((_t=D.hasRole)!=null&&_t.call(D,St))},can:St=>{var _t;return!!((_t=D.can)!=null&&_t.call(D,St))}},token:{hasAccess:!!tt,hasRefresh:!!Pe,expiresAt:Fe,expiresInSec:dt==null?null:Math.round(dt/1e3),decodedJWT:Ne}};return console.groupCollapsed(`[JSswift.auth.inspect] ${Re}`),console.log("status:",ve()),console.log(kt),dt!=null&&(dt<=0?console.warn("\u26A0\uFE0F Access token scaduto."):dt<6e4&&console.warn("\u26A0\uFE0F Access token in scadenza (<60s).")),console.groupEnd(),kt}function Le(Re=!0){me=!!Re,console.log("[JSswift.auth.trace]",me?"ON":"OFF")}if(typeof D.fetch=="function"&&!D._fetchWrapped){const Re=D.fetch.bind(D);D.fetch=async(...Ue)=>{const et=await Re(...Ue);if(me)try{console.log("[auth.fetch]",et.status,Ue[0])}catch(yt){}return et},D._fetchWrapped=!0}D.decodeJWT=pe,D.status=ve,D.inspect=xe,D.trace=Le}return{createPermissionApi:l,matchesProtectedPath:I,attachDevTools:J}})(),Q.plugins.auth={install(l,I={}){var ut;const{createPermissionApi:J,matchesProtectedPath:$,attachDevTools:D}=Q._authShared,me={key:I.key||"auth",loginRoute:I.loginRoute||"/login",protected:I.protected||[],autoRedirect:(ut=I.autoRedirect)!=null?ut:!0,endpoints:I.endpoints||{login:"/api/login",refresh:"/api/refresh",logout:"/api/logout"},fetchOptions:I.fetchOptions||{},tokenHeader:I.tokenHeader||"Authorization",tokenPrefix:I.tokenPrefix||"Bearer ",refreshMargin:I.refreshMargin||3e4},[G,pe]=l.store.signal(me.key,null),Ee=()=>{var dt;return((dt=G())==null?void 0:dt.user)||null},ve=()=>{var dt;return!!((dt=G())!=null&&dt.accessToken)},{hasRole:xe,can:Le,canAny:Re,canAll:Ue}=J(Ee);let et=!1,yt=[];function st(){const dt=G();return dt!=null&&dt.expiresAt?Date.now()>dt.expiresAt-me.refreshMargin:!1}async function tt(){var dt;if(et)return new Promise((kt,It)=>yt.push({res:kt,rej:It}));et=!0;try{const kt=await fetch(me.endpoints.refresh,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:(dt=G())==null?void 0:dt.refreshToken})});if(!kt.ok)throw new Error("Refresh failed");const It=await kt.json();return pe({...G(),...It}),yt.forEach(Wt=>Wt.res(!0)),yt=[],!0}catch(kt){throw yt.forEach(It=>It.rej(kt)),yt=[],pe(null),me.autoRedirect&&l.router.navigate(me.loginRoute),kt}finally{et=!1}}async function Pe(dt){const kt=await fetch(me.endpoints.login,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(dt)});if(!kt.ok)throw new Error("Login failed");const It=await kt.json();return pe(It),It}async function Ne(){try{await fetch(me.endpoints.logout,{method:"POST"})}catch(dt){}pe(null),me.autoRedirect&&l.router.navigate(me.loginRoute)}async function Fe(dt,kt={}){var St;st()&&await tt();const It=G(),Wt=new Headers(kt.headers||{});It!=null&&It.accessToken&&Wt.set(me.tokenHeader,me.tokenPrefix+It.accessToken);const Qe=await fetch(dt,{...me.fetchOptions,...kt,headers:Wt});return Qe.status===401&&((St=G())!=null&&St.refreshToken)&&!kt._authRetried?(await tt(),Fe(dt,{...kt,_authRetried:!0})):Qe}l.router.beforeEach(dt=>{const kt=dt.path;return $(kt,me.protected)&&!ve()?me.loginRoute:!0}),l.auth={user:Ee,isAuth:ve,hasRole:xe,can:Le,canAny:Re,canAll:Ue,loginAsync:Pe,logoutAsync:Ne,fetch:Fe,_getState:G},l.useAuth=function(dt){return dt&&dt.onDispose,l.auth},D(Q,l.auth)}},Q._httpShared=(()=>{function l(ve){var Tt;const xe=ve.reactive,[Le,Re]=xe.signal(0),[Ue,et]=xe.signal("idle"),[yt,st]=xe.signal(null),[tt,Pe]=xe.signal(null),[Ne,Fe]=xe.signal(null),[ut,dt]=xe.signal(0),[kt,It]=xe.signal(0);let Wt=0;function Qe(Ve){const ot=++Wt,zt=Date.now();return Re(Le()+1),et("pending"),Fe(null),Pe(null),st({id:ot,url:Ve.url,method:Ve.method,meta:Ve.meta,timeout:Ve.timeout,retry:Ve.retry,startedAt:zt}),It(zt),ot}function St(Ve,ot,zt,$t){const Ct=Date.now();Re(Math.max(0,Le()-1)),Ve===Wt&&(zt?(et("error"),Fe(zt),Pe(null)):ot?(et("success"),Fe(null),Pe({id:Ve,status:ot.status,ok:ot.ok,headers:ot.headers,url:ot.url,receivedAt:Ct,raw:ot})):(et("idle"),Fe(null),Pe(null)),dt(Math.max(0,Number($t||0)))),It(Ct)}return{state:{inFlight:Le,status:Ue,isLoading:(Tt=ve.store)!=null&&Tt.computed?ve.store.computed(()=>Le()>0):()=>Le()>0,lastRequest:yt,lastResponse:tt,lastError:Ne,lastDuration:ut,lastUpdated:kt,reset(){Re(0),et("idle"),st(null),Pe(null),Fe(null),dt(0),It(Date.now())}},markStart:Qe,markEnd:St}}function I(ve,xe){if(!ve||/^https?:\/\//i.test(xe))return xe;const Le=ve.endsWith("/")?ve.slice(0,-1):ve,Re=xe.startsWith("/")?xe:"/"+xe;return Le+Re}function J(ve){return new Promise(xe=>setTimeout(xe,ve))}function $(ve,xe){return ve?!0:xe?xe.status===429||xe.status>=500&&xe.status<=599:!1}function D(ve,xe){if(!ve&&!xe)return{signal:void 0,cancel:()=>{}};const Le=new AbortController,Re=Le.signal;let Ue=null;ve>0&&(Ue=setTimeout(()=>Le.abort(new Error("timeout")),ve));const et=()=>Le.abort(xe.reason||new Error("aborted"));return xe&&(xe.aborted?et():xe.addEventListener("abort",et,{once:!0})),{signal:Re,cancel:()=>{var st;Ue&&clearTimeout(Ue),xe&&((st=xe.removeEventListener)==null||st.call(xe,"abort",et))}}}function me(ve,xe,Le={}){var yt,st,tt;const Re=typeof xe=="string"?I(ve.baseURL,xe):xe,Ue=(Le.method||"GET").toUpperCase(),et=new Headers(ve.headers);return Le.headers&&new Headers(Le.headers).forEach((Pe,Ne)=>et.set(Ne,Pe)),{url:Re,method:Ue,headers:et,body:Le.body,credentials:(yt=Le.credentials)!=null?yt:ve.credentials,signal:Le.signal,timeout:(st=Le.timeout)!=null?st:ve.timeout,retry:(tt=Le.retry)!=null?tt:ve.retry,meta:Le.meta||{}}}async function G(ve,...xe){var Re;let Le=xe[0];for(const Ue of ve)Le=(Re=await Ue(Le,...xe.slice(1)))!=null?Re:Le;return Le}function pe(ve,xe){return{ok:ve.ok,status:ve.status,headers:ve.headers,raw:ve,req:xe,async json(){let Le=null,Re=null;try{Le=await ve.json()}catch(Ue){Le=null}return ve.ok||(Re=Le!=null?Le:{status:ve.status}),{data:Le,error:Re,ok:ve.ok,status:ve.status}},async jsonStrict(){const{data:Le,error:Re}=await this.json();if(Re){const Ue=new Error(`HTTP error ${ve.status} ${(xe==null?void 0:xe.method)||""} ${(xe==null?void 0:xe.url)||""}`.trim());throw Ue.status=ve.status,Ue.data=Le,Ue.req={url:xe==null?void 0:xe.url,method:xe==null?void 0:xe.method,meta:xe==null?void 0:xe.meta},Ue}return{data:Le,ok:!0,status:ve.status}},async text(){let Le="";try{Le=await ve.text()}catch(Re){}return{text:Le,ok:ve.ok,status:ve.status}},async textStrict(){const Le=await this.text();if(!Le.ok){const Re=new Error("HTTP error "+ve.status);throw Re.status=ve.status,Re.text=Le.text,Re}return Le}}}function Ee(ve,xe,Le,Re,Ue={}){const et=new Headers(Ue.headers||{});return et.has("Content-Type")||et.set("Content-Type","application/json"),ve(Le,{...Ue,method:xe,headers:et,body:Re==null?void 0:JSON.stringify(Re)})}return{createReactiveState:l,joinURL:I,sleep:J,isRetryable:$,makeAbort:D,normalizeRequest:me,runHooks:G,wrapResponse:pe,withJSON:Ee}})();const{createReactiveState:Rn,sleep:Hn,isRetryable:vs,makeAbort:Ss,normalizeRequest:ms,runHooks:Js,wrapResponse:ro,withJSON:es}=Q._httpShared,Wn=typeof globalThis!="undefined"&&globalThis.JSswift_setting?globalThis.JSswift_setting:{},ao={baseURL:(($s=Wn.http)==null?void 0:$s.baseURL)||"",timeout:(fo=(uo=Wn.http)==null?void 0:uo.timeout)!=null?fo:0,retry:((At=Wn.http)==null?void 0:At.retry)||{attempts:0,delay:250,factor:2},headers:((xs=Wn.http)==null?void 0:xs.headers)||{},credentials:(T=Wn.http)==null?void 0:T.credentials,debug:(Un=Wn.debug)!=null?Un:!1},Rs=Rn(Q),Cs=()=>typeof performance!="undefined"&&performance.now?performance.now():Date.now(),En={beforeRequest:new Set,afterResponse:new Set,onError:new Set};async function co(l){const I=Q.auth&&typeof Q.auth.fetch=="function"?Q.auth.fetch.bind(Q.auth):fetch,J={method:l.method,headers:l.headers,body:l.body,credentials:l.credentials,signal:l.signal};return I(l.url,J)}async function hn(l,I={}){var Ue,et,yt;let J=ms(ao,l,I);J=await Js(En.beforeRequest,J);const $=Rs.markStart(J),D=Cs(),me=J.retry||{attempts:0,delay:250,factor:2},G=Math.max(0,Number(me.attempts||0));let pe=Math.max(0,Number(me.delay||0));const Ee=Math.max(1,Number(me.factor||2));let ve=null,xe=null,Le=null,Re=null;try{for(let st=0;st<=G;st++){ve=null,xe=null;const{signal:tt,cancel:Pe}=Ss(J.timeout,I.signal),Ne={...J,signal:tt},Fe=Cs();try{ao.debug&&console.log("[http.request]",Ne.method,Ne.url),(Ue=Q.perf)==null||Ue.inc("httpRequests"),(et=Q.perf)==null||et.mark("http:req",{url:J.url,method:J.method});const ut=await co(Ne);xe=ut;const dt=await Js(En.afterResponse,ut,Ne),kt=Cs()-Fe;if((yt=Q.perf)==null||yt.tick("http:res",kt,{status:ut.status,url:J.url}),st<G&&vs(null,dt)){Pe(),await Hn(pe),pe=Math.round(pe*Ee);continue}return Pe(),Le=dt,ro(dt,Ne)}catch(ut){ve=ut,Pe();for(const dt of En.onError)try{dt(ut,Ne)}catch(kt){}if(st<G&&vs(ut,null)){await Hn(pe),pe=Math.round(pe*Ee);continue}throw Re=ut,ut}}}finally{const st=Cs()-D;Rs.markEnd($,Le,Re,st)}if(ve)throw ve;return ro(xe,J)}Q.http={},Q.http.request=hn,Q.http.state=()=>Rs.state,Q.http.get=(l,I)=>hn(l,{...I,method:"GET"}),Q.http.del=(l,I)=>hn(l,{...I,method:"DELETE"}),Q.http.post=(l,I,J)=>es(hn,"POST",l,I,J),Q.http.put=(l,I,J)=>es(hn,"PUT",l,I,J),Q.http.patch=(l,I,J)=>es(hn,"PATCH",l,I,J),Q.http.getJSON=async(l,I)=>(await hn(l,{...I,method:"GET"})).jsonStrict(),Q.http.delJSON=async(l,I)=>(await hn(l,{...I,method:"DELETE"})).jsonStrict(),Q.http.postJSON=async(l,I,J)=>(await es(hn,"POST",l,I,J)).jsonStrict(),Q.http.putJSON=async(l,I,J)=>(await es(hn,"PUT",l,I,J)).jsonStrict(),Q.http.patchJSON=async(l,I,J)=>(await es(hn,"PATCH",l,I,J)).jsonStrict(),Q.http.onBefore=function(l){return En.beforeRequest.add(l),()=>En.beforeRequest.delete(l)},Q.http.onAfter=function(l){return En.afterResponse.add(l),()=>En.afterResponse.delete(l)},Q.http.onError=function(l){return En.onError.add(l),()=>En.onError.delete(l)},window._http=Q.http,Q.useRouter=function(l){const I=Q.router;return l&&l.onDispose,{navigate:I.navigate,back:()=>history.back(),forward:()=>history.forward(),get current(){return I}}},Q.useRoute=function(l){const[I,J]=Q.reactive.signal(""),[$,D]=Q.reactive.signal({}),[me,G]=Q.reactive.signal({}),[pe,Ee]=Q.reactive.signal(""),ve=Le=>{J(Le.path||""),D(Le.params||{}),G(Le.query||{}),Ee(Le.hash||"")},xe=Q.router.subscribe(ve);return l&&typeof l.onDispose=="function"&&l.onDispose(xe),{path:I,params:$,query:me,hash:pe}},Q._routerShared=(()=>{function l(pe){return pe?(pe.startsWith("/")||(pe="/"+pe),pe.length>1&&pe.endsWith("/")&&(pe=pe.slice(0,-1)),pe):"/"}function I(pe,Ee=""){if(Ee&&pe.startsWith(Ee)){const ve=pe.slice(Ee.length)||"/";return l(ve)}return l(pe)}function J(pe){pe=l(pe);const Ee=[],ve=pe.replace(/([.+*?=^!${}()[\]|/\\])/g,"\\$1").replace(/\\\/:([A-Za-z0-9_]+)/g,(xe,Le)=>(Ee.push(Le),"\\/([^\\/]+)"));return{pattern:pe,regex:new RegExp("^"+ve+"$"),keys:Ee}}function $(pe){const Ee={};return new URLSearchParams(pe||"").forEach((xe,Le)=>{Ee[Le]===void 0?Ee[Le]=xe:Array.isArray(Ee[Le])?Ee[Le].push(xe):Ee[Le]=[Ee[Le],xe]}),Ee}function D(pe){const Ee=[];for(const ve of pe)if(Ee.push({...ve,_parent:null}),ve.children&&ve.children.length)for(const xe of ve.children)Ee.push({...xe,_parent:ve});return Ee.sort((ve,xe)=>xe.path.length-ve.path.length),Ee}function me(pe,Ee){const ve=l(pe),xe=D(Ee);for(const Le of xe){const Re=Le._compiled.regex.exec(ve);if(!Re)continue;const Ue={};return Le._compiled.keys.forEach((et,yt)=>{Ue[et]=decodeURIComponent(Re[yt+1])}),{route:Le,params:Ue,parent:Le._parent||null}}return null}function G(pe,Ee,ve=50){pe.push({at:Date.now(),path:Ee.path,params:Ee.params,query:Ee.query,hash:Ee.hash}),pe.length>ve&&pe.shift()}return{normalizePath:l,stripBase:I,compilePattern:J,parseQuery:$,flattenRoutes:D,matchRoute:me,pushHistoryEntry:G}})(),Q._uiMetaShared=(()=>{function l(G){return{hasTabPanel:typeof G.TabPanel=="function",Card:typeof G.Card=="function"?G.Card:(...pe)=>G.div({class:"cms-doc-card"},...pe),Chip:typeof G.Chip=="function"?G.Chip:(pe,Ee)=>G.span({class:"cms-chip cms-chip-fallback"},Ee)}}function I(G){return G?Array.isArray(G)?G.join(" | "):String(G):"\u2014"}function J(G,pe,Ee){return G.div({class:"cms-doc-meta"},G.div({class:"cms-doc-meta-head"},G.div({class:"cms-doc-meta-name"},pe.name),G.div({class:"cms-doc-meta-types"},...pe.type?String(pe.type).split("|").map(ve=>Ee({color:"secondary",dense:!0,outline:!0},ve)):[G.span("\u2014")])),G.div({class:"cms-doc-meta-grid"},G.div({class:"cms-doc-meta-block"},G.div({class:"cms-doc-meta-label"},"Default"),G.div({class:"cms-doc-meta-value"},pe.default==null?"\u2014":String(pe.default))),G.div({class:"cms-doc-meta-block"},G.div({class:"cms-doc-meta-label"},"Values"),G.div({class:"cms-doc-meta-value"},I(pe.values)))),G.div({class:"cms-doc-meta-block"},G.div({class:"cms-doc-meta-label"},"Description"),G.div({class:"cms-doc-meta-value"},pe.description||"\u2014")))}function $(G,pe){return G.div({class:"cms-doc-fallback"},pe.map(Ee=>G.div({class:"cms-doc-fallback-item"},G.h4({class:"cms-doc-fallback-title"},Ee.label||Ee.name),Ee.content)))}function D(G,pe){return pe?Array.isArray(pe)?pe.map(Ee=>({name:Ee.name,wrap:!0,label:Ee.name,content:G.div({class:"cms-p-md"},Ee.description)})):Object.entries(pe).map(([Ee,ve])=>({name:Ee,wrap:!0,label:Ee,content:G.div({class:"cms-p-md"},ve)})):[]}function me(G,pe){return pe?Array.isArray(pe)?pe.map(Ee=>({name:Ee.name,wrap:!0,label:Ee.type,content:Ee.description})):Object.entries(pe).map(([Ee,ve])=>({name:Ee,wrap:!0,label:Ee,content:G.div({class:"cms-doc-meta"},G.div({class:"cms-doc-meta-head"},G.div({class:"cms-doc-meta-name"},Ee)),G.div({class:"cms-doc-meta-grid"},G.div({class:"cms-doc-meta-block"},G.div({class:"cms-doc-meta-label"},"Type"),G.div({class:"cms-doc-meta-value"},ve.type||"\u2014"))),G.div({class:"cms-doc-meta-block"},G.div({class:"cms-doc-meta-label"},"Description"),G.div({class:"cms-doc-meta-value"},ve.description||"\u2014")))})):[]}return{resolveDocComponents:l,renderMetaItem:J,renderTabGroupFallback:$,normalizeEventRows:D,normalizeSlotRows:me}})(),Q.ui=Q.ui||{},Q.ui.meta=Q.ui.meta||{},Q.ui.slot=function(I,J={}){const $=Q.ui,{as:D="node",wrap:me="span",iconProps:G=null,filter:pe=!0}=J,Ee=Re=>document.createTextNode(String(Re)),ve=Re=>_.span(String(Re)),xe=Re=>{if(Re==null||Re===!1)return null;if(typeof Re=="function")return Re;if(Array.isArray(Re))return Re.flatMap(xe).filter(Boolean);if(Re&&typeof Re=="object"&&Re.nodeType)return Re;if(typeof Re=="string"||typeof Re=="number"||typeof Re=="boolean"){const Ue=String(Re);return D==="icon"&&$.Icon?$.Icon(Ue,{class:"cms-slot-icon",...G||{}}):me==="text"?Ee(Ue):me==="span"?ve(Ue):Ue}return me==="text"?Ee(Re):me==="span"?ve(Re):String(Re)},Le=xe(I);return pe&&Array.isArray(Le)?Le.filter(Boolean):Le},Q.ui.slots=function(...I){const J=[];for(const $ of I){const D=Q.ui.slot($);D&&(Array.isArray(D)?J.push(...D):J.push(D))}return J},Q.docTable=l=>{var tt;if(!Q.isDev())return _.div();const{resolveDocComponents:I,renderMetaItem:J,renderTabGroupFallback:$,normalizeEventRows:D,normalizeSlotRows:me}=Q._uiMetaShared,G=(tt=Q.ui.meta)==null?void 0:tt[l];if(!G)return _.div({class:"cms-muted"},`Meta non trovata: ${l}`);const{hasTabPanel:pe,Card:Ee,Chip:ve}=I(_),xe={};Object.entries(G.props||{}).forEach(([Pe,Ne])=>{const Fe=Ne.category||"general";xe[Fe]||(xe[Fe]=[]),xe[Fe].push({name:Pe,...Ne})});const Le=Object.keys(xe).map(Pe=>{const Ne=xe[Pe].map(Fe=>({name:Fe.name,wrap:!0,label:Fe.name,content:J(_,Fe,ve)}));return{name:Pe,wrap:!0,label:Pe,content:pe?_.TabPanel({orientation:"vertical",animated:!0,radius:"0 0 0 var(--cms-r-default)",tabs:Ne}):$(_,Ne)}}),Re=D(_,G.events),Ue=me(_,G.slots),et=_.rod(null),yt=[];Ue.length&&yt.push({name:"Slots",wrap:!0,label:"Slots",content:pe?_.TabPanel({animated:!0,radius:"0 0 0 var(--cms-r-default)",orientation:"vertical",tabs:Ue}):$(_,Ue)}),Le.length&&yt.push(...Le),Re.length&&yt.push({name:"Events",wrap:!0,label:"Events",content:pe?_.TabPanel({animated:!0,radius:"0 0 0 var(--cms-r-default)",orientation:"vertical",tabs:Re}):$(_,Re)});const st="general";return yt.sort((Pe,Ne)=>Pe.name===st?-1:Ne.name===st?1:Pe.name.localeCompare(Ne.name)),Ee({class:"cms-doc-table"},_.div({class:"cms-doc-table-header"},_.div({class:"cms-doc-table-title"},`_.${l}`),G.signature?_.div({class:"cms-doc-table-signature"},String(G.signature).replaceAll("UI.","_.")):null),yt.length?_.h4({class:"cms-doc-table-section-title"},Le.length?"Props":"Documentation"):_.p({class:"cms-muted"},"Nessuna documentazione strutturata disponibile."),yt.length?pe?_.TabPanel({border:!0,animated:!0,orientation:"horizontal",tabs:yt,model:et}):$(_,yt):null,G.returns?_.p({class:"cms-muted",style:{marginTop:"14px"}},`Returns: ${G.returns}`):null)},Q.ui.inspect=l=>{var I;return console.log(((I=Q.ui.meta)==null?void 0:I[l])||"meta not found")},Q.ui.can=function(l,I,J,$=null){var G,pe;const D=Q.useAuth?Q.useAuth(l):Q.auth;return D?(typeof I=="function"?!!I(D):((G=D.can)==null?void 0:G.call(D,I))||((pe=D.hasRole)==null?void 0:pe.call(D,I)))?typeof J=="function"?J():J:typeof $=="function"?$():$:typeof $=="function"?$():null},Q.ui.canAny=function(l,I,J,$=null){var G;const D=Q.useAuth?Q.useAuth(l):Q.auth;return!!((G=D==null?void 0:D.canAny)!=null&&G.call(D,I))?typeof J=="function"?J():J:typeof $=="function"?$():$},Q.ui.canAll=function(l,I,J,$=null){var G;const D=Q.useAuth?Q.useAuth(l):Q.auth;return!!((G=D==null?void 0:D.canAll)!=null&&G.call(D,I))?typeof J=="function"?J():J:typeof $=="function"?$():$},Q.Can=function(I,J){var me,G;const $=Q.useAuth?Q.useAuth(J):Q.auth;return(()=>{var pe,Ee,ve,xe;return $?I.when&&typeof I.when=="function"?!!I.when($):I.perm?!!((pe=$.can)!=null&&pe.call($,I.perm)):I.role?!!((Ee=$.hasRole)!=null&&Ee.call($,I.role)):I.any?!!((ve=$.canAny)!=null&&ve.call($,I.any)):I.all?!!((xe=$.canAll)!=null&&xe.call($,I.all)):!1:!1})()?typeof I.then=="function"?I.then():(me=I.then)!=null?me:null:typeof I.else=="function"?I.else():(G=I.else)!=null?G:null},Q.router=(()=>{let l="history",I=[],J=null,$=null,D="",me=null,G=null,pe=[],Ee=!1;const{normalizePath:ve,stripBase:xe,compilePattern:Le,parseQuery:Re,matchRoute:Ue,pushHistoryEntry:et}=Q._routerShared,yt={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 st(Ke,{replace:o=!1}={}){const Pt=typeof Ke=="string"?new URL(Ke,window.location.origin):Ke,Z=Pt.pathname+Pt.search+Pt.hash;if(l==="hash"||l==="auto"){if(history.pushState){const ye="#"+Z;o?history.replaceState({},"",ye):history.pushState({},"",ye);return}const Kt="#"+Z;o?window.location.replace(Kt):window.location.hash=Kt;return}o?history.replaceState({},"",D+Z):history.pushState({},"",D+Z)}function tt(){if(l==="hash"){const Ke=window.location.hash||"#/",o=Ke.startsWith("#")?Ke.slice(1):Ke;return new URL(o,window.location.origin)}if(l==="auto"&&window.location.hash.startsWith("#/")){const Ke=window.location.hash.slice(1);return new URL(Ke,window.location.origin)}return new URL(window.location.href)}function Pe(Ke,o=!1){if(l==="hash"||l==="auto"&&!history.pushState){const Pt="#"+(Ke.pathname+Ke.search+Ke.hash);o?window.location.replace(Pt):window.location.hash=Pt;return}o?history.replaceState({},"",D+Ke.pathname+Ke.search+Ke.hash):history.pushState({},"",D+Ke.pathname+Ke.search+Ke.hash)}function Ne(Ke){l=Ke||"history"}function Fe(Ke){return xe(Ke,D)}function ut(Ke){if(!Ke)return!1;const o=G?G.path:Fe(tt().pathname);let Pt=Ke;typeof Pt=="string"&&(Pt.includes("?")||Pt.includes("#")||Pt.includes("://"))&&(Pt=new URL(Pt,window.location.origin).pathname);const Z=Fe(Pt);return Z.includes(":")?Le(Z).regex.test(o):Z===o}async function dt(Ke,{replace:o=!1}={}){if(!J){console.warn("[router] outlet non impostato. Usa JSswift.router.setOutlet('#app').");return}const Pt=typeof Ke=="string"?new URL(Ke,window.location.origin):Ke;Ee&&console.log("[router.navigate]",Pt.toString());const Z=Pt.pathname+Pt.search+Pt.hash;Pe(Pt,o);const Kt=Fe(Pt.pathname),ye=Ue(Kt,I),jt={path:Kt,fullPath:Z,params:ye?ye.params:{},query:Re(Pt.search),hash:Pt.hash||"",navigate:kt,outlet:J};if(me){const on=await me(jt);if(on===!1)return;if(typeof on=="string"){kt(on,{replace:!0});return}}if(typeof $=="function"){try{$()}catch(on){console.error("[router] unmount error:",on)}$=null}if(!ye){const on=I._notFound;on?$=Q.mount(J,()=>on(jt),{clear:!0}):$=Q.mount(J,_.div("404"),{clear:!0}),ot(jt),G=jt,et(pe,jt);return}const xt=ye.route.view,Ge=ye.parent;let Mn=null;if(jt.renderChild=on=>{if(!jt._child)return null;const On=typeof on=="string"?jt.outlet.querySelector(on):on;return On?(Mn=Q.mount(On,()=>jt._child.view(jt._child.ctx),{clear:!0}),Mn):(console.warn("[router] child outlet non trovato:",on),null)},Ge){const on=ye.route,On={...jt,params:{...jt.params}};jt._child={view:on.view,ctx:On},$=Q.mount(J,()=>Ge.view(jt),{clear:!0})}else jt._child=null,$=Q.mount(J,()=>xt(jt),{clear:!0});ot(jt),G=jt,et(pe,jt)}function kt(Ke,o={}){const Pt=new URL(Ke,window.location.origin);dt(Pt,o)}function It(){window.addEventListener("popstate",()=>{dt(tt(),{replace:!0})}),window.addEventListener("hashchange",()=>{(l==="hash"||l==="auto")&&dt(tt(),{replace:!0})}),document.addEventListener("click",Ke=>{var jt,xt;const o=(xt=(jt=Ke.target)==null?void 0:jt.closest)==null?void 0:xt.call(jt,"a");if(!o||Ke.defaultPrevented||Ke.button!==0||Ke.metaKey||Ke.ctrlKey||Ke.shiftKey||Ke.altKey||o.hasAttribute("download")||o.target&&o.target!=="_self")return;const Pt=o.getAttribute("href");if(!Pt||Pt.startsWith("mailto:")||Pt.startsWith("tel:"))return;const Z=new URL(Pt,window.location.origin);if(Z.origin!==window.location.origin)return;const Kt=new URL(window.location.href);Z.pathname+Z.search===Kt.pathname+Kt.search&&Z.hash||(Ke.preventDefault(),kt(Z.pathname+Z.search+Z.hash))}),dt(tt(),{replace:!0})}function Wt(Ke){return J=typeof Ke=="string"?Q.dom.q(Ke):Ke,J}function Qe(Ke){D=Ke?ve(Ke):"",D==="/"&&(D="")}function St(Ke,o,Pt=null){const Z=Le(Ke),Kt={path:Z.pattern,view:o,_compiled:Z,children:[]};if(Array.isArray(Pt))for(const ye of Pt){const[jt,xt,Ge]=ye,Mn=ve(Z.pattern+"/"+(jt||"").replace(/^\//,""));Kt.children.push({path:Mn,view:xt,_compiled:Le(Mn),children:Array.isArray(Ge)?Ge:[]})}I.push(Kt)}function _t(Ke){I._notFound=Ke}function Tt(Ke){me=Ke}let Ve=new Set;function ot(Ke){for(const o of Ve)try{o(Ke)}catch(Pt){console.error("[router] listener error:",Pt)}}function zt(){if(!G)return"ROUTER \u23F3 not ready";const Ke=Object.keys(G.query||{}).length?"?":"";return`ROUTER ${G.path}${Ke} ${G.hash||""}`}function $t(Ke="router"){if(!G)return console.warn("[router.inspect] nessuna route attiva"),null;const o={label:Ke,mode:typeof l!="undefined"?l:"unknown",base:D,path:G.path,params:G.params,query:G.query,hash:G.hash,outlet:J,timestamp:new Date().toISOString()};return console.groupCollapsed(`[JSswift.router.inspect] ${Ke}`),console.log(o),console.log("history:",pe.slice()),console.groupEnd(),o}function Ct(Ke=!0){Ee=!!Ke,console.log("[JSswift.router.trace]",Ee?"ON":"OFF")}function ht(){return pe.slice()}return{meta:yt,setOutlet:Wt,setBase:Qe,add:St,setURLOnly:st,notFound:_t,beforeEach:Tt,start:It,navigate:kt,isActive:ut,subscribe(Ke){return Ve.add(Ke),()=>Ve.delete(Ke)},current(){return tt?tt():new URL(window.location.href)},status:zt,inspect:$t,trace:Ct,history:ht}})(),(ps=Q.config)!=null&&ps.debug&&(window.$router=Q.router),Q.signal=Q.reactive.signal,Q.effect=Q.reactive.effect,Q.computed=Q.reactive.computed,Q.untracked=Q.reactive.untracked,Q.batch=Q.reactive.batch;function ts(l){return l==null?null:String(l).trim()||null}function vn(l){const I=Array.isArray(l)?l:typeof l=="string"?l.split(","):[],J=[],$=new Set;for(const D of I){const me=ts(D);!me||$.has(me)||($.add(me),J.push(me))}return J}function Ms(){var l;return typeof document!="undefined"&&document.documentElement?document.documentElement:(l=Q.dom)!=null&&l.q?Q.dom.q("html"):null}function Ae(){try{return typeof globalThis!="undefined"&&globalThis.localStorage||null}catch(l){return null}}function xn(){var l;return ts((l=Q.theme)==null?void 0:l.storageKey)||"jsswift:theme"}function Os(){const l=Ae();if(!l)return null;try{return ts(l.getItem(xn()))}catch(I){return null}}function Eo(l){const I=Ae();if(I)try{l==null?I.removeItem(xn()):I.setItem(xn(),l)}catch(J){}}function Fs(l){var $,D,me,G,pe;const I=Ms(),J=[l,($=Q.theme)==null?void 0:$.themes,(D=Q.config)==null?void 0:D.themes,typeof globalThis!="undefined"?(me=globalThis.JSswift_setting)==null?void 0:me.themes:null,typeof globalThis!="undefined"?(G=globalThis.JSswift_setting)==null?void 0:G.themeList:null,(pe=I==null?void 0:I.getAttribute)==null?void 0:pe.call(I,"data-themes")];for(const Ee of J){const ve=vn(Ee);if(ve.length)return ve}return[]}Q.theme=Q.theme||{},Q.theme.storageKey=xn(),vn(Q.theme.themes).length||(Q.theme.themes=Fs()),Q.setTheme=function(l,I={}){const J=ts(l),$=Ms();return $&&(J==null?$.removeAttribute("data-theme"):$.setAttribute("data-theme",J)),I.persist!==!1&&Eo(J),$},Q.getTheme=function(l={}){var D;const I=Ms(),J=ts((D=I==null?void 0:I.getAttribute)==null?void 0:D.call(I,"data-theme"));if(J)return J;if(l.storage===!1)return null;const $=Os();return $&&I&&l.sync!==!1&&I.setAttribute("data-theme",$),$},Q.toggleTheme=function(l,I={}){const J=Fs(l),$=J.length?J:vn([Q.getTheme({sync:!1}),"light","dark"]),D=Q.getTheme({sync:!1}),me=ts(I.fallback)||$[0]||"light",G=D?$.indexOf(D):-1,pe=G>=0?$[(G+1)%$.length]:me;return Q.theme.themes=$.slice(),Q.setTheme(pe,I),pe};const zo=Os();zo&&Q.setTheme(zo,{persist:!1})})(),(function(bt){var di;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"),rs=Symbol("cms.ui.rodPathWrappedUI"),as=new WeakMap,zs=new WeakMap,Ys=new WeakMap,wn=[],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},Ps=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 cs=!1;const Xs=()=>{cs||(cs=!0,queueMicrotask(()=>{cs=!1,wn.length=0}))},No=t=>{wn.push(t),wn.length>128&&wn.splice(0,wn.length-128),Xs()},us=()=>{if(!wn.length)return null;const t=wn.slice();return wn.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)},Xn=t=>t&&typeof t=="object"&&t[gs]?t[gs]:t,Qn=(t,e)=>{const n=as.get(t);if(!n)return;let s=n.rawGet();for(const i of e){if(s==null)return;s=s[i]}return s},Ao=(t,e,n)=>{const s=as.get(t);if(!s)return;const i=Xn(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 S=c;for(let u=0;u<e.length-1;u++){const a=e[u];let b=S[a];if(!b||typeof b!="object"){const M=e[u+1];b=Jn(M)?[]:{},S[a]=b}S=b}Object.is(S[e[e.length-1]],i)||(S[e[e.length-1]]=i,s.rawSet(c))},Zs=(t,e)=>[()=>Qn(t,e),n=>Ao(t,e,n)],eo=(t,e,n=[])=>{if(!e||typeof e!="object")return e;let s=zs.get(t);s||(s=new WeakMap,zs.set(t,s));const i=s.get(e);if(i)return i;const c=new Proxy(e,{get(S,u,a){if(u===gs)return S;const b=Reflect.get(S,u,a);if(typeof u=="symbol")return b;const M=n.concat(u);return b&&typeof b=="object"?eo(t,b,M):typeof b=="function"?b.bind(a):(Ps(b)&&No({rod:t,path:M,value:b}),b)},set(S,u,a,b){const M=Xn(a),N=Reflect.get(S,u,b);if(Object.is(N,M))return!0;const C=Reflect.set(S,u,M,b);if(C){const z=as.get(t);z==null||z.rawSet(z.rawGet())}return C},deleteProperty(S,u){const a=Reflect.has(S,u),b=Reflect.deleteProperty(S,u);if(b&&a){const M=as.get(t);M==null||M.rawSet(M.rawGet())}return b}});return s.set(e,c),c},to=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,Xn(i));return as.set(t,{rawGet:n,rawSet:s}),Object.defineProperty(t,"value",{get(){const i=n();return!i||typeof i!="object"?i:eo(t,i,[])},set(i){s(i)},configurable:!0}),Object.defineProperty(t,Bn,{value:!0,configurable:!1}),t},no=()=>{if(typeof window._.rod!="function"||window._.rod[Bn])return;const t=window._.rod,e=function(...s){return to(t(...s))};Object.defineProperty(e,Bn,{value:!0,configurable:!1}),window._.rod=e};bt.ui.withoutRodPathCapture=t=>{const e=wn.length;try{return t()}finally{wn.length=e}};const Ts=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const S=t.map(u=>{const a=Ts(u,e,"");return a!==u&&(c=!0),a});return c?S:t}if(Ps(t)){const c=Qs(e,t);return c?n==="model"?Zs(c.rod,c.path):()=>Qn(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},ds=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const S=t.map(u=>{const a=ds(u,e,"");return a!==u&&(c=!0),a});return c?S:t}if(Ps(t)){const c=Qs(e,t);return c?n==="model"?Zs(c.rod,c.path):()=>Qn(c.rod,c.path):t}if(!jn(t))return t;let s=!1;const i={};for(const c of Object.keys(t)){const u=c==="model"||c==="children"?ds(t[c],e,c):t[c];i[c]=u,u!==t[c]&&(s=!0)}return s?i:t},so=t=>{if(typeof t!="function"||t[rs])return t;const e=Ys.get(t);if(e)return e;const n=function(...i){const c=us();if(!c)return t.apply(this,i);let S=!1;const u=i.map(a=>{const b=ds(a,c,"");return b!==a&&(S=!0),b});return t.apply(this,S?u:i)};return Object.defineProperty(n,rs,{value:!0,configurable:!1}),Ys.set(t,n),n},Wo=()=>{const t=bt.ui;if(!(!t||t[rs])){Object.defineProperty(t,rs,{value:!0,configurable:!1});for(const e of Object.keys(t))typeof t[e]=="function"&&(t[e]=so(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"?so(s):s;return Reflect.set(e,n,c,i)}})}},oo=()=>{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=us();if(!c)return n.apply(this,i);let S=!1;const u=i.map(a=>{const b=Ts(a,c,"");return b!==a&&(S=!0),b});return n.apply(this,S?u:i)})}};no(),((di=JSswift.rod)==null?void 0:di._all)instanceof Set&&JSswift.rod._all.forEach(t=>to(t)),oo(),Wo();const io={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},Uo=new Set(Object.values(io)),lo=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),Lo=new Set(["none","sm","md","lg"]),fs={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},Bt=t=>{if(!t)return"";const e=String(t).toLowerCase();return io[e]||""},Io=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":lo.has(e)?e:null},bs=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return Lo.has(e)?e:null},Zn=t=>t&&typeof t=="object"&&!t.nodeType&&!Array.isArray(t)&&!(t instanceof Function),ws=t=>t&&t.nodeType===1&&String(t.tagName||"").toLowerCase()==="li",Rn=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];JSswift.isUIPlainObject=Zn,JSswift.isListItemNode=ws,JSswift.asNodeArray=Rn;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),ms=(t={},e)=>{if(!e)return null;for(const n of e.aliases){if(!Ss(t,n))continue;const s=o(t[n]);if(Zn(s))return s}return null},Js=(t={},e)=>{const n=Array.isArray(e)?e:[e];return Hn.some(s=>{const i=ms(t,s);return!!i&&n.some(c=>Ss(i,c))})},ro=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),es=(t={},e=[])=>{const n=[];for(const s of Hn){const i=ms(t,s);if(i)for(const c of e){const S=Array.isArray(c.prop)?c.prop:[c.prop];let u=!1,a,b="";for(const C of S)if(Ss(i,C)){a=o(i[C]),b=C,u=!0;break}if(!u||a==null||a===""||a===!1&&!c.allowFalse)continue;const M=typeof c.map=="function"?c.map(a,{propName:b,props:i,device:s,rule:c}):`${c.class}-${ro(a)}`,N=Array.isArray(M)?M:[M];for(const C of N)C&&n.push(String(C).startsWith("cms-")?C:`${s.prefix}${C}`)}}return n},Wn=(t={})=>Hn.some(e=>!!ms(t,e)),ao=(t={},e=[])=>{for(const n of e){if(!Ss(t,n))continue;const s=o(t[n]);if(!(s==null||s===""))return s}},Rs=(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}`,co=(t,e)=>{var n;if(!(!t||!e)){if((n=t.classList)!=null&&n.add){t.classList.add(e);return}t.class=Z([t.class,e])}},hn=(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],u=(a,b)=>{const M=ao(b,S),N=Rs(M,c);if(!N)return;const C=c.var||c.css,z=a==="mobile"?"--cms-rsp-":`--cms-rsp-${a}-`;Cs(s,`${z}${C}`,N),co(t,En(a,C)),i=!0};u("mobile",e);for(const a of Hn){const b=ms(e,a);b&&u(a.key,b)}}return i&&(t.nodeType||(t.style=s),co(t,"cms-rsp")),t};JSswift.uiResponsiveDevices=Hn,JSswift.uiResponsiveOmitProps=vs,JSswift.uiResponsivePropsFor=ms,JSswift.uiResponsiveHasConfig=Wn,JSswift.uiResponsiveHasProp=Js,JSswift.uiResponsiveClasses=es,JSswift.uiApplyResponsiveProps=hn;const ts=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(vs):vs;return ts(t,n)};const vn=(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")),Ke(t.color))e.push(()=>{const i=o(t.color),c=Bt(i);return c?`cms-state-${c}`:""}),n.backgroundColor=()=>{const i=o(t.color);return Bt(i)?"":i&&In(String(i))?`var(--cms-${i})`:i||""};else{const i=Bt(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(Ke(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),Ke(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(Ke(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=Z([t.class,...e])),Object.keys(n).length&&(t.style={...n,...t.style||{}})},Ms=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=Ms(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 vn(n),e};const Ae=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 Os={padding:"p",paddingTop:"p",paddingRight:"p",paddingBottom:"p",paddingLeft:"p",paddingInline:"p",paddingInlineStart:"p",paddingInlineEnd:"p",paddingBlock:"p",paddingBlockStart:"p",paddingBlockEnd:"p",margin:"m",marginTop:"m",marginRight:"m",marginBottom:"m",marginLeft:"m",marginInline:"m",marginInlineStart:"m",marginInlineEnd:"m",marginBlock:"m",marginBlockStart:"m",marginBlockEnd:"m",width:"w",minWidth:"w",maxWidth:"w",height:"h",minHeight:"h",maxHeight:"h"},Eo=t=>t===!0?"wrap":t===!1?"nowrap":String(t),Fs=t=>typeof t=="number"?`repeat(${Math.max(1,Math.round(t))}, minmax(0, 1fr))`:String(t),Ds=[{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:Eo},{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:Fs},{prop:"rows",css:"grid-template-rows",var:"grid-template-rows",mapValue:Fs},{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"}],$s=Ds.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return e.some(n=>Object.prototype.hasOwnProperty.call(Os,n))||e.includes("fontSize")||e.includes("fontWeight")||e.includes("lineHeight")||e.includes("letterSpacing")||e.includes("borderRadius")||e.includes("radius")});JSswift.uiResponsiveStyleRules=Ds,JSswift.uiResponsiveCommonStyleRules=$s;const uo=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),fo=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(uo(n),Ne(e,s))};function At(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(Os).forEach(([n,s])=>{Js(e,n)||fo(t,e[n],n,s)}),hn(t,e,$s),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 T=(t,e,n,s)=>{const i=JSswift.ui.renderSlot(t,e,n,s);return i?Array.isArray(i)?i:[i]:[]},Un=new Set;let ps=!1;const l=new Set(["ctrl","alt","shift","meta"]),I={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"},J={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"},$=()=>{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?I[e]||e:""},me=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"){$()?s.meta=!0:s.ctrl=!0;return}if(l.has(i)){s[i]=!0;return}s.key=i}),s.key?s:null},G=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 u=me((S=(c=(i=n.shortcode)!=null?i:n.shortcut)!=null?c:n.keys)!=null?S:n.key);return u?{...n,...u}:null}const s=me(n);return s?{...s}:null}).filter(Boolean),pe=(t={})=>{var e,n,s;return G((s=(n=(e=t.shortcode)!=null?e:t.shortcut)!=null?n:t.hotkey)!=null?s:t.keys)},Ee=(t={})=>t.showShortcode===!0||t.showShortcut===!0,ve=t=>{const e=D(t);if(!e)return"";const n={...J};return $()&&(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()}`)},xe=t=>{if(!t)return"";const e=[];return t.ctrl&&e.push(ve("ctrl")),t.alt&&e.push(ve("alt")),t.shift&&e.push(ve("shift")),t.meta&&e.push(ve("meta")),e.push(ve(t.key)),e.filter(Boolean).join("+")},Le=t=>(Array.isArray(t)?t:[]).map(xe).filter(Boolean).join(" / "),Re=(t={},e={})=>{const n=pe(t);if(!Ee(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=Le(n),s},Ue=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)},et=(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,yt=()=>{Un.size||!ps||typeof document=="undefined"||(document.removeEventListener("keydown",st,!0),ps=!1)};function st(t){var s,i,c,S,u,a;if(!Un.size||!t||t.defaultPrevented||t.isComposing)return;const e=Ue(t.target),n=Array.from(Un);for(let b=n.length-1;b>=0;b-=1){const M=n[b],N=M==null?void 0:M.anchor;if(!N||!N.isConnected){Un.delete(M);continue}if(((s=M.isEnabled)==null?void 0:s.call(M))===!1)continue;const C=M.specs.find(ge=>{var ne,he;const B=(he=(ne=ge.allowInEditable)!=null?ne:M.allowInEditable)!=null?he:!1;return e&&!B?!1:et(t,ge)});if(!C)continue;const z=(c=(i=C.preventDefault)!=null?i:M.preventDefault)!=null?c:!0,U=(u=(S=C.stopPropagation)!=null?S:M.stopPropagation)!=null?u:!0;if(z&&t.preventDefault(),U&&t.stopPropagation(),((a=M.action)==null?void 0:a.call(M,t,C,N))!==!1)break}yt()}const tt=(t,e={},n={})=>{var S,u;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 a;return(a=t.click)==null?void 0:a.call(t)},isEnabled:typeof n.isEnabled=="function"?n.isEnabled:null,allowInEditable:!!n.allowInEditable,preventDefault:(S=n.preventDefault)!=null?S:!0,stopPropagation:(u=n.stopPropagation)!=null?u:!0};Un.add(i),ps||(document.addEventListener("keydown",st,!0),ps=!0);const c=()=>{Un.delete(i),yt()};return JSswift._registerCleanup(t,c),c},Pe=(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},Ne=(t,e="size")=>typeof t=="number"?t+"px":JSswift.uiSizes.includes(t)?`var(--cms-${e}-${t})`:t,Fe=(t,e=JSswift.uiSizes)=>n=>{const s=String(n).trim();return e!=null&&e.includes(s)?`${t}-${s}`:""},ut=t=>e=>`${t}-${String(e).trim().toLowerCase().replace(/\s+/g,"-")}`,dt=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,It=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)))}`:""},Qe=(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))})},St=t=>JSswift.uiResponsiveDevices.find(e=>e.key===t),_t=[{prop:"gap",class:"gap",map:Fe("gap")},{prop:"rowGap",class:"gap-y",map:Fe("gap-y")},{prop:["columnGap","colGap"],class:"gap-x",map:Fe("gap-x")},{prop:"direction",class:"dir",map:ut("dir")},{prop:"wrap",class:"wrap",allowFalse:!0,map:dt},{prop:"align",class:"align",map:ut("align")},{prop:"justify",class:"justify",map:ut("justify")},{prop:"width",class:"w",map:Fe("w")},{prop:"minWidth",class:"min-w",map:Fe("min-w")},{prop:"maxWidth",class:"max-w",map:Fe("max-w")},{prop:"height",class:"h",map:Fe("h")},{prop:"minHeight",class:"min-h",map:Fe("min-h")},{prop:"maxHeight",class:"max-h",map:Fe("max-h")},{prop:"padding",class:"p",map:Fe("p")},{prop:"margin",class:"m",map:Fe("m")}],Tt=_t.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("align")&&!e.includes("justify")}),Ve=[{prop:["col","span"],class:"col",map:It},{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:ut("self")},..._t],ot=[{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],zt=[{prop:"inline",class:"display",allowFalse:!0,map:t=>kt(t,"display-inline-flex","display-flex")},{prop:"direction",class:"dir",map:ut("dir")},{prop:"contentAlign",class:"align",map:ut("align")},{prop:"contentJustify",class:"justify",map:ut("justify")},{prop:"align",class:"self",map:ut("self")},{prop:"justify",class:"justify-self",map:ut("justify-self")},{prop:"place",class:"place-self",map:ut("place-self")},...Tt],$t=(JSswift.uiResponsiveStyleRules||[]).filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("span")&&!e.includes("gridColumn")});Ae.Row=(...t)=>{var h,m,y,j,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(d,k,g={})=>{const P=Array.isArray(d)?d:[d];for(const K of P)if(JSswift.ui.getSlot(s,K)!=null)return T(s,K,g,k);return k==null?[]:T(null,"default",g,k)},c=d=>{var k;return d==null||d===!1||d===""?"":typeof d=="number"?`${d}px`:typeof d=="string"&&((k=JSswift.uiSizes)!=null&&k.includes(d))?`var(--cms-s-${d})`:String(d)},S=d=>{var k;return d==null||d===!1||d===""?"":typeof d=="number"?`${d}px`:typeof d=="string"&&((k=JSswift.uiSizes)!=null&&k.includes(d))?`var(--cms-w-${d})`:String(d)},u=JSswift.omit(e,["slots","start","left","startClass","body","center","bodyClass","centerClass","end","right","endClass","align","justify","wrap","gap","rowGap","columnGap","direction","reverse","inline","full","width","minWidth","maxWidth",...JSswift.uiResponsiveOmitProps]);u.class=Z(["cms-row",JSswift.uiResponsiveClasses({mobile:e},_t),JSswift.uiResponsiveClasses(e,_t),e.class]);const a={...e.style||{}},b=xt([e.direction,e.reverse],()=>{const d=o(e.direction);return d!=null&&d!==""?String(d):o(e.reverse)?"row-reverse":""}),M=Ge(e.align),N=Ge(e.justify),C=Ge(e.wrap,d=>typeof d=="boolean"?d?"wrap":"nowrap":String(d)),z=Ge(e.gap,c),U=Ge(e.rowGap,c),W=Ge(e.columnGap,c),ge=Ge(e.inline,d=>d?"inline-flex":"flex"),B=Ge(e.width,S),ne=Ge(e.minWidth,S),he=Ge(e.maxWidth,S),q=Ge(e.full,d=>d?"100%":"",""),se=xt([e.inline,e.full,e.width],()=>{const d=!!o(e.inline),k=!!o(e.full),g=o(e.width)!=null&&o(e.width)!==!1&&o(e.width)!=="";return!d||k||g?"":"max-content"});b!=null&&!Qe(e,"direction")&&(a.flexDirection=b),M!=null&&!Qe(e,"align")&&(a.alignItems=M),N!=null&&!Qe(e,"justify")&&(a.justifyContent=N),C!=null&&!Qe(e,"wrap")&&(a.flexWrap=C),z!=null&&!Qe(e,"gap")&&(a.gap=z),U!=null&&!Qe(e,"rowGap")&&(a.rowGap=U),W!=null&&!Qe(e,"columnGap")&&(a.columnGap=W),ge!=null&&(a.display=ge),se!=null&&(a.width=se),B!=null&&!Qe(e,"width")&&(a.width=B),ne!=null&&!Qe(e,"minWidth")&&(a.minWidth=ne),he!=null&&!Qe(e,"maxWidth")&&(a.maxWidth=he),q!=null&&(a.width=q),Object.keys(a).length&&(u.style=a),JSswift.uiApplyResponsiveProps(u,e,JSswift.uiResponsiveStyleRules);const le={props:e},fe=i(["start","left"],(h=e.start)!=null?h:e.left,le),be=i(["body","center","default"],(y=(m=e.body)!=null?m:e.center)!=null?y:n,le),re=i(["end","right"],(j=e.end)!=null?j:e.right,le);if(!(fe.length||re.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 d=T(s,"default",le,n),k=_.div(u,...d);return At(k,e),k}const O={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},Y=(X=e.bodyClass)!=null?X:e.centerClass,oe=xt([e.direction,e.reverse],()=>(o(e.direction)||(o(e.reverse)?"row-reverse":"row"))==="row"?"auto":""),we=[fe.length?_.div({class:Z(["cms-row-start",e.startClass]),style:{...O}},...fe):null,be.length?_.div({class:Z(["cms-row-body",Y]),style:{...O,flex:"1 1 auto"}},...be):null,re.length?_.div({class:Z(["cms-row-end",e.endClass]),style:{...O,justifyContent:"flex-end",marginInlineStart:oe}},...re):null].filter(Boolean),R=_.div(u,...we);return At(R,e),R};function Ct(t){return Array.isArray(t)&&(t.length===2||t.length===3&&typeof t[2]=="function")&&typeof t[0]=="function"&&typeof t[1]=="function"}function ht(t){return!!t&&t.type==="rod"}function Ke(t){return typeof t=="function"||ht(t)||Ct(t)}function o(t){return typeof t=="function"?t():ht(t)?t.value:Ct(t)?t[0]():t}function Pt(t){const e=Array.isArray(t)?[...t]:[t];for(;e.length;){const n=e.pop();if(Ke(n))return!0;Array.isArray(n)&&e.push(...n)}return!1}function Z(t){const e=Pt(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 Kt(t){const e=Z(t);return typeof e=="function"?e():e}function ye(t,e,n=""){return Ke(t)?()=>o(t)?e:n:t?e:n}function jt(t,e,n=""){return Ke(t)?()=>{const s=o(t);return s==null||s===""?"":`${e}${s}${n}`}:t==null||t===""?"":`${e}${t}${n}`}function xt(t,e){return(Array.isArray(t)?t:[t]).some(Ke)?()=>e():e()}function Ge(t,e,n=""){return Ke(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=Ke,JSswift.uiUnwrap=o,JSswift.uiClass=Z,JSswift.uiClassStatic=Kt,JSswift.uiWhen=ye,JSswift.uiClassValue=jt,JSswift.uiComputed=xt,JSswift.uiStyleValue=Ge,Ae.Col=(...t)=>{var P,K,ee,Ce,E,p;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=A=>Object.prototype.hasOwnProperty.call(e,A),c=(A,L,ae={})=>{const ke=Array.isArray(A)?A:[A];for(const Te of ke)if(JSswift.ui.getSlot(s,Te)!=null)return T(s,Te,ae,L);return L==null?[]:T(null,"default",ae,L)},S=A=>{var L;return A==null||A===!1||A===""?"":typeof A=="number"?`${A}px`:typeof A=="string"&&((L=JSswift.uiSizes)!=null&&L.includes(A))?`var(--cms-s-${A})`:String(A)},u=A=>{var L;return A==null||A===!1||A===""?"":typeof A=="string"&&((L=JSswift.uiSizes)!=null&&L.includes(A))?Ne(A,"size"):gt(A)},a=(A,L)=>{const ae=o(A);if(ae==null||ae===!1||ae==="")return"";if(ae==="auto")return L==="cms-col-"?"cms-col-auto":"";if(ae===!0)return`${L}24`;const ke=Number(ae);if(Number.isFinite(ke)&&ke>0)return`${L}${Math.max(1,Math.min(24,Math.round(ke)))}`;if(typeof ae=="string"){const Te=ae.trim();if(!Te)return"";if(Te.startsWith(L))return Te;if(/^\d+$/.test(Te))return`${L}${Math.max(1,Math.min(24,Number(Te)))}`}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 L=i("grow"),ae=i("shrink"),ke=i("basis");if(!L&&!ae&&!ke)return"";const Te=L?o(e.grow):0,ze=ae?o(e.shrink):1,V=ke?u(o(e.basis)):"auto";return`${Te} ${ze} ${V||"auto"}`},M=xt([e.auto,e.col,e.span],()=>{if(o(e.auto))return"cms-col-auto";const A=i("span")?e.span:e.col;return a(A,"cms-col-")||"cms-col"}),N=JSswift.omit(e,["slots","col","span","sm","md","lg","auto","size","width","minWidth","maxWidth","height","minHeight","maxHeight","gap","rowGap","columnGap","align","justify","inline","center","stack","flex","fill","grow","shrink","basis","self","order","scroll","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass",...JSswift.uiResponsiveOmitProps]),C={...e.style||{}};!Qe(e,"minWidth")&&C.minWidth==null&&(C.minWidth=0);const z=Ge(e.gap,S),U=Ge(e.rowGap,S),W=Ge(e.columnGap,S),ge=Ge(e.align),B=Ge(e.justify),ne=i("width")?e.width:e.size,he=Ge(ne,u),q=Ge(e.minWidth,u),se=Ge(e.maxWidth,u),le=Ge(e.height,u),fe=Ge(e.minHeight,u),be=Ge(e.maxHeight,u),re=Ge(e.self),ue=Ge(e.order,A=>String(A)),O=Ge(e.scroll,A=>A?"auto":"",""),Y=xt([e.flex,e.fill,e.grow,e.shrink,e.basis],b),oe=xt([e.center,e.align,e.justify],()=>!!o(e.center)&&(o(e.align)==null||o(e.align)==="")&&(o(e.justify)==null||o(e.justify)===""));Y!=null&&Y!==""&&(C.flex=Y),re!=null&&!Qe(e,"self")&&(C.alignSelf=re),ue!=null&&(C.order=ue),O!=null&&O!==""&&(C.overflow=O),he!=null&&he!==""&&!Qe(e,["width","size"])&&(C.width=he,!i("flex")&&!i("fill")&&!i("grow")&&!i("shrink")&&!i("basis")&&(C.flex="0 0 auto")),q!=null&&!Qe(e,"minWidth")&&(C.minWidth=q),se!=null&&!Qe(e,"maxWidth")&&(C.maxWidth=se),le!=null&&!Qe(e,"height")&&(C.height=le),fe!=null&&!Qe(e,"minHeight")&&(C.minHeight=fe),be!=null&&!Qe(e,"maxHeight")&&(C.maxHeight=be),Object.keys(C).length&&(N.style=C);const we={props:e},R=c(["start","top","header","before"],(ee=(K=(P=e.start)!=null?P:e.top)!=null?K:e.header)!=null?ee:e.before,we),h=i("body")?e.body:i("content")?e.content:n,m=c(["body","content","default"],h,we),y=c(["end","bottom","footer","after"],(p=(E=(Ce=e.end)!=null?Ce:e.bottom)!=null?E:e.footer)!=null?p:e.after,we),j=R.length||y.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,X=xt([e.stack,e.gap,e.rowGap,e.columnGap,e.align,e.justify,e.center],()=>o(e.stack)||j||[o(e.gap),o(e.rowGap),o(e.columnGap),o(e.align),o(e.justify)].some(L=>L!=null&&L!==!1&&L!=="")?!0:!!o(e.center));if(N.class=Z(["cms-col",M,xt(e.sm,()=>a(e.sm,"cms-sm-col-")),xt(e.md,()=>a(e.md,"cms-md-col-")),xt(e.lg,()=>a(e.lg,"cms-lg-col-")),JSswift.uiResponsiveClasses({mobile:e},Ve),JSswift.uiResponsiveClasses(e,Ve),ye(X,"cms-col-flex"),ye(e.inline,"cms-col-inline"),e.class]),z!=null&&!Qe(e,"gap")&&(C.gap=z),U!=null&&!Qe(e,"rowGap")&&(C.rowGap=U),W!=null&&!Qe(e,"columnGap")&&(C.columnGap=W),ge!=null&&!Qe(e,"align")?C.alignItems=ge:oe!=null&&oe!==""&&(C.alignItems=oe?"center":""),B!=null&&!Qe(e,"justify")?C.justifyContent=B:oe!=null&&oe!==""&&(C.justifyContent=oe?"center":""),Object.keys(C).length&&(N.style=C),JSswift.uiApplyResponsiveProps(N,e,JSswift.uiResponsiveStyleRules),!j){const A=_.div(N,...T(s,"default",we,n));return At(A,e),A}const d={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},k=[R.length?_.div({class:Z(["cms-col-start",e.startClass,e.topClass,e.headerClass]),style:{...d}},...R):null,m.length?_.div({class:Z(["cms-col-body",e.bodyClass,e.contentClass]),style:{...d,flex:"1 1 auto"}},...m):null,y.length?_.div({class:Z(["cms-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...d}},...y):null].filter(Boolean),g=_.div(N,...k);return At(g,e),g},Ae.Spacer=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.omit(e,["slots"]);i.class=Z(["cms-spacer",e.class]);const c=T(s,"default",{},n);return _.div(i,...c)},Ae.Container=(...t)=>{var y,j,X,d;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=k=>Object.prototype.hasOwnProperty.call(e,k),S={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},u=k=>{if(k==null||k===!1||k==="")return"";if(typeof k=="number")return`${k}px`;const g=String(k).trim().toLowerCase();return g?g==="full"||g==="fluid"?"100%":S[g]||String(k):""},a=k=>{var g;return k==null||k===!1||k===""?"":typeof k=="number"?`${k}px`:typeof k=="string"&&((g=JSswift.uiSizes)!=null&&g.includes(k))?`var(--cms-s-${k})`:String(k)},b=k=>{if(k==null||k===!1||k==="")return"";if(typeof k=="number"&&Number.isFinite(k))return`repeat(${Math.max(1,Math.floor(k))}, minmax(0, 1fr))`;const g=String(k).trim();return g?/^\d+$/.test(g)?`repeat(${Math.max(1,Number(g))}, minmax(0, 1fr))`:g:""},M=k=>k==null||k===""?"":k===!0?"wrap":k===!1?"nowrap":String(k),N={props:e},C=(k,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(P=>C(k,P));return}if(g!=null&&g.nodeType){k.appendChild(g);return}k.appendChild(document.createTextNode(String(g)))}},z=(k,g)=>{const P=JSswift.ui.getSlot(s,k);if(P!=null)return T(s,k,N,null);if(typeof g=="function"){const K=_.div({class:`cms-container-slot-${k}`});return JSswift.reactive.effect(()=>{const ee=xn(JSswift.ui.slot(g(N)));K.replaceChildren(),Array.isArray(ee)?ee.forEach(Ce=>C(K,Ce)):C(K,ee)},`UI.Container:${k}`),[K]}return T(s,k,N,g)},U=c("content")?e.content:n!=null&&n.length?n:null,W=z("before",(y=e.before)!=null?y:e.top),ge=z("header",e.header),B=[...z("left",e.left),...z("start",e.start)],ne=z("body",c("body")?e.body:null),he=(()=>{const k=z("content",c("content")?e.content:null);return k.length?k:z("default",U)})(),q=[...z("right",e.right),...z("end",e.end)],se=z("footer",e.footer),le=z("after",(j=e.after)!=null?j:e.bottom),fe=W.length||ge.length||B.length||q.length||se.length||le.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,be=!!fe||ne.length>0&&(JSswift.ui.getSlot(s,"body")!=null||fe),re=()=>{var g;const k=String(o((g=e.layout)!=null?g:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(k)?k:["inline","inline-flex","inlineflex"].includes(k)||o(e.inline)?"inline":o(e.grid)||o(e.cols)!=null?"grid":k==="block"?"block":o(e.direction)!=null||o(e.wrap)!=null||o(e.align)!=null||o(e.justify)!=null||o(e.gap)!=null||B.length||q.length?"flex":"block"},ue=xt([e.layout,e.display,e.inline,e.grid,e.cols,e.direction,e.wrap,e.align,e.justify,e.gap],()=>{const k=re();return k==="block"?"":`is-${k}`}),O={...i.style||{}},Y=(k,g)=>{g!=null&&(O[k]=g)};Y("maxWidth",xt([e.maxWidth,e.fluid],()=>o(e.fluid)?"none":u(o(e.maxWidth))||"")),Y("width",Ge(e.width,u)),Y("minWidth",Ge(e.minWidth,u)),Y("--cms-container-padding",Ge(e.padding,a)),Y("--cms-container-padding-x",Ge((X=e.paddingX)!=null?X:e.gutter,a)),Y("--cms-container-padding-y",Ge(e.paddingY,a)),Y("--cms-container-gap",Ge(e.gap,a)),Y("--cms-container-section-gap",Ge((d=e.sectionGap)!=null?d:e.gap,a)),Y("--cms-container-cols",Ge(e.cols,b)),Y("--cms-container-align",Ge(e.align,k=>String(k))),Y("--cms-container-justify",Ge(e.justify,k=>String(k))),Y("--cms-container-direction",Ge(e.direction,k=>String(k))),Y("--cms-container-wrap",Ge(e.wrap,M));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=Z(["cms-container",ye(e.fluid,"is-fluid"),ye(be,"has-structure"),be?"":ue,i.class]),oe.style=O,JSswift.uiApplyResponsiveProps(oe,e,JSswift.uiResponsiveStyleRules);const we=(k,g,P)=>g.length?_.div({class:Z(["cms-container-section",`cms-container-${k}`,P])},...g):null,R=ne.length?_.div({class:Z(["cms-container-body",be?ue:"",e.bodyClass])},...ne):B.length||he.length||q.length?_.div({class:Z(["cms-container-body",be?ue:"",e.bodyClass])},we("start",B,e.startClass),he.length?_.div({class:Z(["cms-container-main",e.mainClass,e.contentClass])},...he):null,we("end",q,e.endClass)):null,h=(()=>{var g;const k=String(o((g=e.tag)!=null?g:e.as)||"div").toLowerCase();return typeof _[k]=="function"?_[k]:_.div})(),m=be?h(oe,we("before",W,e.beforeClass),we("header",ge,e.headerClass),R,we("footer",se,e.footerClass),we("after",le,e.afterClass)):h(oe,...ne.length?ne:he);return At(m,e),m},Ae.Card=(...t)=>{var Ce,E;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};vn(i);const c=(p,A)=>{var L;return!!(p&&p.nodeType===1&&((L=p.classList)!=null&&L.contains(`cms-card-${A}`)))},u=(p=>p==null?null:typeof p=="string"?Ae.Icon({name:p,size:e.iconSize||e.size||"lg"}):JSswift.ui.slot(p,{as:"icon"}))(e.icon),a=e.image?_.img({src:e.image,alt:e.imageAlt||"",class:Z(["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},M=T(s,"default",b,n!=null&&n.length?n:[]),N={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},C=[];M.forEach(p=>{c(p,"identifier")?N.identifier.push(p):c(p,"cover")?N.cover.push(p):c(p,"media")?N.media.push(p):c(p,"header")?N.header.push(p):c(p,"body")?N.body.push(p):c(p,"footer")?N.footer.push(p):c(p,"actions")?N.actions.push(p):C.push(p)});const z=T(s,"identifier",b,e.identifier),U=T(s,"cover",b,a),W=T(s,"media",b,e.media),ge=T(s,"eyebrow",b,(Ce=e.eyebrow)!=null?Ce:e.kicker),B=T(s,"title",b,e.title),ne=T(s,"subtitle",b,e.subtitle),he=T(s,"header",b,e.header),q=T(s,"icon",b,u),se=T(s,"aside",b,(E=e.aside)!=null?E:e.headerAside),le=T(s,"body",b,e.body),fe=T(s,"footer",b,e.footer),be=T(s,"actions",b,e.actions),re=z.length?_.div({class:Z(["cms-card-identifier",e.identifierClass])},...z):null,ue=U.length?_.div({class:Z(["cms-card-cover",e.coverClass])},...U):null,O=W.length?_.div({class:Z(["cms-card-media",e.mediaClass])},...W):null,oe=q.length||ge.length||B.length||ne.length||he.length||se.length?_.div({class:Z(["cms-card-header",e.headerClass])},_.div({class:"cms-card-head"},q.length?_.div({class:"cms-card-icon"},...q):null,_.div({class:"cms-card-head-main"},ge.length?_.div({class:Z(["cms-card-eyebrow",e.eyebrowClass])},...ge):null,B.length?_.div({class:Z(["cms-card-title",e.titleClass])},...B):null,ne.length?_.div({class:Z(["cms-card-subtitle",e.subtitleClass])},...ne):null,he.length?_.div({class:Z(["cms-card-header-content",e.headerContentClass])},...he):null),se.length?_.div({class:Z(["cms-card-aside",e.asideClass])},...se):null)):null,we=[...le,...C],R=we.length?_.div({class:Z(["cms-card-body",e.bodyClass])},...we):null,h=[...be,...N.actions],m=fe.length||h.length?_.div({class:Z(["cms-card-footer",e.footerClass])},...fe,h.length?_.div({class:"cms-card-actions"},...h):null):null,y=xt([e.clickable,e.to],()=>o(e.clickable)||o(e.to)?"cms-card-clickable":""),j=z.length||N.identifier.length,X=U.length||N.cover.length||W.length||N.media.length,d=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"]);d.class=Z(["cms-panel","cms-card","cms-clear-set","cms-singularity",ye(e.flat,"cms-card-flat"),ye(e.dense,"cms-card-dense"),ye(j,"cms-card-has-identifier"),ye(X,"cms-card-has-top-visual"),y,i.class]),d.style={...i.style||{}},e.coverHeight!=null&&(d.style["--cms-card-cover-height"]=gt(o(e.coverHeight))),JSswift.uiApplyResponsiveProps(d,e,JSswift.uiResponsiveStyleRules);const k=e.onClick,g=e.onKeydown,P=p=>{var L;if(k==null||k(p),p.defaultPrevented)return;const A=o(e.to);A&&((L=JSswift.router)!=null&&L.navigate)&&(p.preventDefault(),JSswift.router.navigate(A))},K=p=>{g==null||g(p),!p.defaultPrevented&&(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),P(p))};(o(e.clickable)||o(e.to))&&(d.onClick=P,d.onKeydown=K,d.tabIndex==null&&(d.tabIndex=0),d.role==null&&(d.role="button"));const ee=_.div(d,re,...N.identifier,ue,...N.cover,O,...N.media,oe,...N.header,R,...N.body,m,...N.footer);return At(ee,e),ee},Ae.Btn=(...t)=>{var ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=xt([e.color,e.state],()=>{const O=o(e.color)||o(e.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(O)?O:o(e.state)||""}),c=Z(["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 u=()=>!!o(e.loading),a=()=>!!o(e.disabled)||u(),b=e.icon!=null?typeof e.icon=="string"?Ae.Icon({name:e.icon}):e.icon:null,M=e.iconRight!=null?typeof e.iconRight=="string"?Ae.Icon({name:e.iconRight}):e.iconRight:null,N=JSswift.ui.renderSlot(s,"icon",{},b),C=JSswift.ui.renderSlot(s,"iconRight",{},M),z=JSswift.ui.renderSlot(s,"label",{},e.label),U=T(s,"default",{},n),W=[],ge=O=>{O&&(Array.isArray(O)?W.push(...O):W.push(O))},B=e.iconAlign;(B==="after"||B==="right")&&!M?(ge(z),U.length&&W.push(...U),ge(N)):(ge(N),ge(z),U.length&&W.push(...U)),ge(C),ge(Re(e,{className:"cms-shortcode cms-btn-shortcode"})),W.length===0&&W.push(_.span("Button"));const he=_.span({class:"cms-btn-loading",hidden:!0}),q=_.span({class:"cms-btn-content"},...W);let se=!1;const le=()=>{const O=Ae.Spinner?Ae.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 T(null,"default",{},JSswift.ui.renderSlot(s,"loading",{},O))},fe=O=>{var h;if((h=e.onPointerDown)==null||h.call(e,O),a()||!(O!=null&&O.currentTarget))return;const Y=O.currentTarget,oe=Y.getBoundingClientRect(),we=typeof O.clientX=="number"?O.clientX-oe.left:oe.width/2,R=typeof O.clientY=="number"?O.clientY-oe.top:oe.height/2;Y.style.setProperty("--cms-burst-x",`${we}px`),Y.style.setProperty("--cms-burst-y",`${R}px`),Y.classList.remove("cms-btn-burst"),Y.offsetWidth,Y.classList.add("cms-btn-burst")},be=_.button({...S,disabled:a(),onClick:O=>{var Y,oe;return a()?((Y=O==null?void 0:O.preventDefault)==null||Y.call(O),!1):(oe=e.onClick)==null?void 0:oe.call(e,O)},onPointerDown:fe,"aria-disabled":a()?"true":null,"aria-busy":u()?"true":null},he,q),re=JSswift.reactive.effect(()=>{const O=u(),Y=a();be.disabled=Y,be.classList.toggle("is-loading",O),be.setAttribute("aria-disabled",Y?"true":"false"),O?be.setAttribute("aria-busy","true"):be.removeAttribute("aria-busy"),he.hidden=!O,O!==se&&(he.replaceChildren(...O?le():[]),se=O)},"UI.Btn:state");return(ue=JSswift._registerCleanup)==null||ue.call(JSswift,be,re),At(be,e),tt(be,e,{isEnabled:()=>!a(),action:()=>{if(a())return!1;be.click()}}),be},Ae.Button=Ae.Btn,JSswift.ui.Btn=Ae.Btn,JSswift.ui.Button=Ae.Button;let Mn=0;Ae.FormField=(t={})=>{var ue,O,Y,oe,we,R,h;vn(t);const e=t.slots||{},n=xt([t.color,t.state],()=>{const m=o(t.color)||o(t.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(m)?m:o(t.state)||""}),s=_.div({class:Z(["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=T(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,u=()=>{if(typeof t.hasValue=="function")return!!t.hasValue();if(t.hasValue!=null)return!!o(t.hasValue);const m=t.getValue?t.getValue():null;return!(m==null||m==="")},a=()=>JSswift.reactive.untracked(u),b=()=>{var m,y;t.disabled||t.readonly||((m=t.onClear)==null||m.call(t),(y=t.onFocus)==null||y.call(t))},M=JSswift.ui.renderSlot(e,"control",{control:S,clear:b,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:a()},null);let N=null,C=null;if(M)N=Array.isArray(M)?_.div({class:"cms-control"},...M):M;else{N=_.div({class:"cms-control"});const m=_.div({class:"cms-addon cms-addon-left"}),y=t.icon!=null?typeof t.icon=="string"?Ae.Icon({name:t.icon}):t.icon:null,j=JSswift.ui.renderSlot(e,"icon",{},y),X=JSswift.ui.renderSlot(e,"prefix",{},t.prefix);T(null,"default",{},j).forEach(A=>m.appendChild(A)),T(null,"default",{},X).forEach(A=>m.appendChild(A)),m.childNodes.length&&N.appendChild(m);const d=_.div({class:"cms-mid"+(m.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});S&&d.appendChild(S);const k=T(e,"label",{},t.label);if(k.length){const A=_.div({class:Z(["cms-float-label",ye(c,"cms-multiselect")])},...k);d.appendChild(A)}N.appendChild(d);const g=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:b},Ae.Icon({name:"close"})):null,P=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:a()},g);P&&(P.onclick=A=>{A.stopPropagation(),b()},T(null,"default",{},P).forEach(A=>N.appendChild(A))),C=g,C&&((ue=t.clearable)!=null&&ue.action)&&t.clearable.action(A=>A?C.classList.remove("cms-d-none"):C.classList.add("cms-d-none"));const K=_.div({class:"cms-addon cms-addon-right"}),ee=t.iconRight!=null?typeof t.iconRight=="string"?Ae.Icon({name:t.iconRight}):t.iconRight:null,Ce=JSswift.ui.renderSlot(e,"iconRight",{},ee),E=JSswift.ui.renderSlot(e,"suffix",{},t.suffix),p=JSswift.ui.renderSlot(e,"shortcode",{props:t},Re(t,{className:"cms-shortcode cms-field-shortcode"}));T(null,"default",{},E).forEach(A=>K.appendChild(A)),T(null,"default",{},Ce).forEach(A=>K.appendChild(A)),T(null,"default",{},p).forEach(A=>K.appendChild(A)),K.childNodes.length&&(N.appendChild(K),d.classList.add("cms-with-right"))}const z=m=>m&&(m&&typeof m.action=="function"?m.value:Array.isArray(m)&&typeof m[0]=="function"?m[0]():typeof m=="function"?m():m),U=m=>m==null||m===!1||m===""?!1:Array.isArray(m)?m.length>0:!0;let W=null;const ge=`jsswift-field-message-${++Mn}`,B=()=>{if(!(S!=null&&S.setAttribute))return;const m=[o(t.ariaDescribedBy),W==null?void 0:W.id].filter(Boolean).join(" ").trim();m?S.setAttribute("aria-describedby",[...new Set(m.split(/\s+/))].join(" ")):S.removeAttribute("aria-describedby")};s._syncDescription=B;const ne=()=>{const m=[{key:"error",value:z(t.error),slot:"errorMessage",className:"cms-error"},{key:"warning",value:z(t.warning),slot:"warning",className:"cms-warning"},{key:"success",value:z(t.success),slot:"success",className:"cms-success"},{key:"note",value:z(t.note),slot:"note",className:"cms-note"},{key:"hint",value:z(t.hint),slot:"hint",className:"cms-hint"}];let y=null;for(const g of m)if(U(g.value)){y=g;break}const j={error:m[0].value,warning:m[1].value,success:m[2].value,note:m[3].value,hint:m[4].value,props:t},X=y?T(e,y.slot,j,y.value):[],d=X.length?_.div({id:ge,class:y==null?void 0:y.className},...X):null;["error","warning","success","note"].forEach(g=>{var P;return(P=N==null?void 0:N.classList)==null?void 0:P.toggle(g,(y==null?void 0:y.key)===g)}),W?d?W.replaceWith(d):W.remove():d&&s.appendChild(d),W=d,B()},he=()=>{var y;const m=u();(y=N==null?void 0:N.classList)==null||y.toggle("has-value",m),C&&(C.style.display=m?"":"none")};JSswift.reactive.untracked(he),(O=N==null?void 0:N.classList)==null||O.toggle("disabled",!!t.disabled),s.appendChild(N);const q=JSswift.ui.getSlot(e,"errorMessage"),se=JSswift.ui.getSlot(e,"warning"),le=JSswift.ui.getSlot(e,"success"),fe=JSswift.ui.getSlot(e,"note"),be=JSswift.ui.getSlot(e,"hint");if(!!((Y=t.error)!=null&&Y.action||(oe=t.warning)!=null&&oe.action||(we=t.success)!=null&&we.action||(R=t.note)!=null&&R.action||(h=t.hint)!=null&&h.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 q=="function"||typeof se=="function"||typeof le=="function"||typeof fe=="function"||typeof be=="function"){const m=JSswift.reactive.effect(()=>{ne()},"UI.FormField:message");JSswift._registerCleanup(s,m)}else ne();return s._refresh=he,s._control=N,s._el=S,s},Ae.InputRaw=(t={})=>{var z;const e=_.input({class:Z(["cms-input-raw",t.class]),type:t.type||"text",name:t.name,placeholder:t.placeholder,autocomplete:t.autocomplete,value:t.value});let n=!1;const s=new Set,i=(U,W)=>{if(n)return;const ge=setTimeout(()=>{s.delete(ge),n||U()},W);s.add(ge)};let c=(z=e.value)!=null?z:"";const S=()=>{var W;const U=(W=e.value)!=null?W:"";U!==c&&(c=U,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let u=null,a=!1;const b=()=>{if(n||a)return;a=!0;let U=0;const W=()=>{if(S(),U+=1,U>=10){a=!1;return}i(W,120)};i(W,40)},M=()=>{n||u||(u=setInterval(()=>{if(document.activeElement!==e){clearInterval(u),u=null;return}S()},250))},N=()=>{u&&(clearInterval(u),u=null)};e.addEventListener("input",()=>{var U;c=(U=e.value)!=null?U:""}),e.addEventListener("change",()=>{var U;c=(U=e.value)!=null?U:""}),e.addEventListener("animationstart",U=>{U.animationName==="cms-autofill"&&(S(),M(),b())}),e.addEventListener("focus",()=>{M(),b(),i(S,50)}),e.addEventListener("blur",()=>{N(),i(S,0)}),i(S,0),b(),JSswift._registerCleanup(e,()=>{n=!0,N(),s.forEach(clearTimeout),s.clear()});const C=t.model;if(C){if(typeof C=="object"&&typeof C._bind=="function")JSswift._registerCleanup(e,bt.rodModel(e,C));else if(Array.isArray(C)&&typeof C[0]=="function"&&typeof C[1]=="function"){const U=JSswift.reactive.untracked(()=>bt.signalModel(e,C[0],C[1]));JSswift._registerCleanup(e,U)}}return tt(e,t,{isEnabled:()=>!e.disabled,action:()=>Pe(e,{selectText:!!t.selectOnShortcode})}),e};function on(t,e,n,s=!1){t.focus=S=>e.focus(S);const i=(S,u)=>{u==null||u===!1?e.removeAttribute(S):e.setAttribute(S,String(u))},c=JSswift.reactive.effect(()=>{var b,M;const S=(b=o(n.ariaLabel))!=null?b:typeof n.label=="string"?n.label:null;i("aria-label",S),i("aria-labelledby",o(n.ariaLabelledBy)),(M=t._syncDescription)==null||M.call(t);const u=n.ariaInvalid==null?!!o(n.error):!!o(n.ariaInvalid);e.setAttribute("aria-invalid",String(u));const a=!!o(n.required);if(e.setAttribute("aria-required",String(a)),s){e.required=a;for(const N of["min","max","step","pattern","minLength","maxLength"])i(N.toLowerCase(),o(n[N]))}},"UI.Field:controlAttributes");JSswift._registerCleanup(t,c)}Ae.Input=(t={})=>{var ne,he,q;const e=t.slots||{},n={...t,label:(ne=t.label)!=null?ne:t.placeholder},s=_.input({class:Z(["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=!1;const c=new Set,S=(se,le)=>{if(i)return;const fe=setTimeout(()=>{c.delete(fe),i||se()},le);c.add(fe)};let u=(q=s.value)!=null?q:"";const a=()=>{var le;const se=(le=s.value)!=null?le:"";se!==u&&(u=se,s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})))};let b=null,M=!1;const N=()=>{if(i||M)return;M=!0;let se=0;const le=()=>{if(a(),se+=1,se>=10){M=!1;return}S(le,120)};S(le,40)},C=()=>{i||b||(b=setInterval(()=>{if(document.activeElement!==s){clearInterval(b),b=null;return}a()},250))},z=()=>{b&&(clearInterval(b),b=null)};s.addEventListener("input",()=>{var se,le;u=(se=s.value)!=null?se:"",(le=t.onInput)==null||le.call(t,s.value)}),s.addEventListener("change",()=>{var se,le;u=(se=s.value)!=null?se:"",(le=t.onChange)==null||le.call(t,s.value)}),s.addEventListener("focus",se=>{var le;(le=t.onFocus)==null||le.call(t,se),C(),N(),S(a,50)}),s.addEventListener("blur",se=>{var le;(le=t.onBlur)==null||le.call(t,se),z(),S(a,0)}),s.addEventListener("animationstart",se=>{se.animationName==="cms-autofill"&&(a(),C(),N())}),S(a,0),N(),JSswift._registerCleanup(s,()=>{i=!0,z(),c.forEach(clearTimeout),c.clear()});const U=t.model;if(U){const se=le=>{var oe;let fe=!1;const be=we=>{const R=we!=null?we:"";s.value!==R&&(s.value=R,u=R)},re=we=>{if(!fe){fe=!0;try{be(we)}finally{fe=!1}}};le.action(re),JSswift.reactive.untracked(()=>be(le.value));const ue=we=>{if(fe||we!=null&&we.isComposing)return;const R=s.value;if(le.value!==R){fe=!0;try{le.value=R}finally{fe=!1}}};s.addEventListener("input",ue),s.addEventListener("compositionend",ue);let O=!1;const Y=()=>{var h,m,y,j;if(O)return;O=!0,s.removeEventListener("input",ue),s.removeEventListener("compositionend",ue);const we=(m=(h=le._actions)==null?void 0:h.indexOf(re))!=null?m:-1;we>=0&&le._actions.splice(we,1);const R=(j=(y=le._disposeHooks)==null?void 0:y.indexOf(Y))!=null?j:-1;R>=0&&!le._disposed&&le._disposeHooks.splice(R,1)};(oe=le.onDispose)==null||oe.call(le,Y),JSswift._registerCleanup(s,Y)};if(typeof U=="object"&&typeof U._bind=="function")se(U);else if(Array.isArray(U)&&typeof U[0]=="function"&&typeof U[1]=="function"){const le=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(U[0],U[1]));se(le),JSswift._registerCleanup(s,()=>le.dispose())}}const W=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),ge=Array.isArray(W)?_.div({style:{display:"contents"}},...W):W,B=Ae.FormField({...n,control:ge,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 se;return(se=B._refresh)==null?void 0:se.call(B)}),s.addEventListener("change",()=>{var se;return(se=B._refresh)==null?void 0:se.call(B)}),B._input=s,on(B,s,t,!0),tt(s,t,{isEnabled:()=>!s.disabled,action:()=>Pe(s,{selectText:!!t.selectOnShortcode})}),B},Ae.Textarea=(t={})=>{var b,M,N,C;const e=t.slots||{},n={...t,label:(b=t.label)!=null?b:t.placeholder,wrapClass:Z(["cms-textarea-field",t.wrapClass])},s=_.textarea({class:Z(["cms-input","cms-textarea",t.class]),name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,rows:t.rows,cols:t.cols,maxLength:(M=t.maxLength)!=null?M:t.maxlength,minLength:(N=t.minLength)!=null?N:t.minlength,wrap:t.wrap,value:(C=t.value)!=null?C:"",disabled:!!t.disabled,readOnly:!!t.readonly});s.addEventListener("input",()=>{var z;(z=t.onInput)==null||z.call(t,s.value)}),s.addEventListener("change",()=>{var z;(z=t.onChange)==null||z.call(t,s.value)}),s.addEventListener("focus",z=>{var U;(U=t.onFocus)==null||U.call(t,z)}),s.addEventListener("blur",z=>{var U;(U=t.onBlur)==null||U.call(t,z)});const i=t.model;if(i){const z=U=>{var se;let W=!1;const ge=le=>{const fe=le!=null?le:"";s.value!==fe&&(s.value=fe)},B=le=>{if(!W){W=!0;try{ge(le)}finally{W=!1}}};U.action(B),JSswift.reactive.untracked(()=>ge(U.value));const ne=le=>{if(W||le!=null&&le.isComposing)return;const fe=s.value;if(U.value!==fe){W=!0;try{U.value=fe}finally{W=!1}}};s.addEventListener("input",ne),s.addEventListener("compositionend",ne);let he=!1;const q=()=>{var be,re,ue,O;if(he)return;he=!0,s.removeEventListener("input",ne),s.removeEventListener("compositionend",ne);const le=(re=(be=U._actions)==null?void 0:be.indexOf(B))!=null?re:-1;le>=0&&U._actions.splice(le,1);const fe=(O=(ue=U._disposeHooks)==null?void 0:ue.indexOf(q))!=null?O:-1;fe>=0&&!U._disposed&&U._disposeHooks.splice(fe,1)};(se=U.onDispose)==null||se.call(U,q),JSswift._registerCleanup(s,q)};if(typeof i=="object"&&typeof i._bind=="function")z(i);else if(Array.isArray(i)&&typeof i[0]=="function"&&typeof i[1]=="function"){const U=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(i[0],i[1]));z(U),JSswift._registerCleanup(s,()=>U.dispose())}}const c=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",S=JSswift.ui.renderSlot(e,c,{textarea:s,input:s,props:t},s),u=Array.isArray(S)?_.div({style:{display:"contents"}},...S):S,a=Ae.FormField({...n,control:u,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var z;return(z=a._refresh)==null?void 0:z.call(a)}),s.addEventListener("change",()=>{var z;return(z=a._refresh)==null?void 0:z.call(a)}),a._input=s,a._textarea=s,tt(s,t,{isEnabled:()=>!s.disabled,action:()=>Pe(s,{selectText:!!t.selectOnShortcode})}),a};function On(){const t=[];return{effect:(e,n)=>{const s=JSswift.reactive.effect(e,n);return t.push(s),s},action:(e,n)=>{e.action(n),t.push(()=>{var i,c;const s=(c=(i=e._actions)==null?void 0:i.indexOf(n))!=null?c:-1;s>=0&&e._actions.splice(s,1)})},dispose:()=>t.splice(0).forEach(e=>e())}}Ae.Search=(t={})=>{var ie,$e;const e=On();let n=!1;const s=t.slots||{},i=F=>!!F&&(typeof F=="object"&&typeof F._bind=="function"||Ct(F)),c=i(t.model)?t.model:i(t.value)?t.value:null,S=c?typeof c=="object"&&typeof c._bind=="function"?c.value:c[0]():o(t.value),[u,a]=JSswift.reactive.signal(S==null?"":String(S)),[b,M]=JSswift.reactive.signal(!1),[N,C]=JSswift.reactive.signal(!1),[z,U]=JSswift.reactive.signal(null),[W,ge]=JSswift.reactive.signal([]),[B,ne]=JSswift.reactive.signal(-1),he=`cms-search-${Math.random().toString(36).slice(2,10)}`,q=new Map;let se=null,le=null,fe=null,be=0,re=0,ue=!1,O=-1,Y=[];const oe=(F,f)=>{const r=Number(o(F));return Number.isFinite(r)?r:f},we=(F,f=!1)=>{const r=o(F);return r==null?f:!!r},R=()=>we(t.disabled,!1),h=()=>we(t.readonly,!1),m=()=>Math.max(0,oe(t.minLength,t.endpoint?1:0)),y=()=>Math.max(0,oe(t.debounce,250)),j=F=>{var r,x,de,Be,He;const f=t.getLabel||t.labelOf;return typeof f=="function"?f(F):F==null?"":typeof F=="string"||typeof F=="number"?String(F):(He=(Be=(de=(x=(r=F.label)!=null?r:F.title)!=null?x:F.name)!=null?de:F.text)!=null?Be:F.value)!=null?He:""},X=F=>{var r,x,de;const f=t.getValue||t.valueOf;return typeof f=="function"?f(F):F==null?"":typeof F=="string"||typeof F=="number"?F:(de=(x=(r=F.value)!=null?r:F.id)!=null?x:F.key)!=null?de:j(F)},d=F=>Array.isArray(F)?F:!F||typeof F!="object"?[]:Array.isArray(F.items)?F.items:Array.isArray(F.results)?F.results:Array.isArray(F.data)?F.data:[],k=async(F,f)=>{const r=typeof F=="function"?F(f,{props:t}):o(F);return r&&typeof r.then=="function"?await r:r},g=(F,f)=>{const r=typeof F=="function"?F(f,{props:t}):o(F);if(!r)return"";const x=String(r),de=new URL(x,window.location.href),Be=o(t.queryParam)||"q";Be&&de.searchParams.set(Be,f);const He=typeof t.params=="function"?t.params(f,{props:t}):o(t.params);return He&&typeof He=="object"&&Object.keys(He).forEach(Se=>{const Oe=o(He[Se]);Oe==null||Oe===!1||de.searchParams.set(Se,String(Oe))}),de.toString()},P=(F,f={})=>{var x,de;const r=F==null?"":String(F);u()!==r&&a(r),Ie.value!==r&&(Ie.value=r),se&&!f.fromModel&&se(r),f.fromModel||(x=t.onInput)==null||x.call(t,r,f.event),(de=We==null?void 0:We._refresh)==null||de.call(We)},K=()=>{M(!1),ne(-1)},ee=()=>N()||z()||W().length?!0:u().trim().length>=m()?!!(t.emptyText||JSswift.ui.getSlot(s,"empty")!=null):!!(t.startText||JSswift.ui.getSlot(s,"empty")!=null),Ce=()=>{R()||ee()&&(M(!0),V())},E=()=>{ge([]),U(null),ne(-1)},p=async(F,f={})=>{var Oe,at,nt,Ze,wt,Nt;if(n)return;const r=F==null?"":String(F).trim(),x=++be,de=o((Oe=t.endpoint)!=null?Oe:t.url),Be=(nt=(at=t.items)!=null?at:t.options)!=null?nt:t.suggestions;if(fe&&(fe.abort(),fe=null),r.length<m()){C(!1),E(),f.open&&ee()?Ce():ee()||K();return}const He=t.cache!==!1,Se=`${de||"local"}::${r}`;if(He&&q.has(Se)){ge(q.get(Se)),U(null),C(!1),ne(q.get(Se).length?0:-1),f.open!==!1&&Ce();return}C(!0),U(null),f.open!==!1&&Ce(),(Ze=t.onSearch)==null||Ze.call(t,r);try{let Et;if(de){fe=new AbortController;const vt=g(de,r),Dt=await fetch(vt,{method:"GET",headers:t.headers,credentials:t.credentials,signal:fe.signal});if(!Dt.ok)throw new Error(`Search request failed (${Dt.status})`);Et=await(t.parseResponse||(Ht=>Ht.json()))(Dt)}else if(Be!=null){const vt=d(await k(Be,r)),Dt=t.filter||((ft,Ht)=>String(j(ft)).toLowerCase().includes(Ht.toLowerCase()));Et=vt.filter(ft=>Dt(ft,r))}else Et=[];if(n||x!==be)return;const Rt=typeof t.mapResponse=="function"?t.mapResponse(Et,r):d(Et),Mt=d(Rt);He&&q.set(Se,Mt),ge(Mt),ne(Mt.length?0:-1),(wt=t.onResults)==null||wt.call(t,Mt,r)}catch(Et){if((Et==null?void 0:Et.name)==="AbortError"||n||x!==be)return;U(Et),ge([]),ne(-1),(Nt=t.onError)==null||Nt.call(t,Et,r)}finally{!n&&x===be&&(C(!1),fe=null,V())}},A=(F,f={})=>{if(n)return;le&&clearTimeout(le);const r=f.immediate?0:y();le=setTimeout(()=>{le=null,p(F,f)},r)},L=F=>{var r;const f=u();(r=t.onSubmit)==null||r.call(t,f,F),t.submitOnEnter!==!1&&A(f,{immediate:!0,open:!0})},ae=(F,f)=>{var de;if(!F)return;const r=X(F),x=j(F);t.commitValue==="value"?P(r,{event:f}):t.commitValue!==!1&&P(x,{event:f}),(de=t.onSelect)==null||de.call(t,F,{value:r,label:x,query:u(),event:f}),t.closeOnSelect!==!1&&K()},ke=F=>{const f=W();if(!f.length)return;const r=B(),x=r<0?F>0?0:f.length-1:Math.max(0,Math.min(f.length-1,r+F));ne(x)},Te=F=>{const f=F==null?"":String(F),r=u().trim();if(!r||t.highlight===!1)return[document.createTextNode(f)];const x=f.toLowerCase().indexOf(r.toLowerCase());return x<0?[document.createTextNode(f)]:[document.createTextNode(f.slice(0,x)),_.mark({class:"cms-search-highlight"},f.slice(x,x+r.length)),document.createTextNode(f.slice(x+r.length))]},ze=F=>{var x,de;const f=j(F),r=F&&typeof F=="object"?(de=(x=F.description)!=null?x:F.subtitle)!=null?de:F.note:null;return _.div({class:"cms-search-result-content"},_.div({class:"cms-search-result-label"},...Te(f)),r?_.div({class:"cms-search-result-description"},String(r)):null)},V=()=>{!b()||rt.parentNode!==document.body||re||(re=requestAnimationFrame(()=>{if(re=0,!b()||!Xe.isConnected||rt.parentNode!==document.body)return;const F=Xe.getBoundingClientRect(),f=6,r=8,x=Math.max(180,window.innerWidth-r*2),de=Math.min(Math.max(F.width,oe(t.minMenuWidth,260)),x),Be=Math.max(r,Math.min(F.left,window.innerWidth-de-r));rt.style.width=`${de}px`,rt.style.left=`${Be}px`,rt.style.right="auto";const He=rt.getBoundingClientRect().height||0,Se=window.innerHeight-F.bottom-f-r,Oe=F.top-f-r;let nt=Se<180&&Oe>Se?F.top-f-He:F.bottom+f;nt=Math.max(r,Math.min(nt,window.innerHeight-He-r)),rt.style.top=`${nt}px`}))},H=()=>{ue||(ue=!0,window.addEventListener("resize",V),window.addEventListener("scroll",V,!0))},te=()=>{ue&&(ue=!1,window.removeEventListener("resize",V),window.removeEventListener("scroll",V,!0))},De=()=>{rt.parentNode!==document.body&&(re&&(cancelAnimationFrame(re),re=0),rt.classList.add("portal"),rt.style.display="block",document.body.appendChild(rt),H(),V())},je=()=>{re&&(cancelAnimationFrame(re),re=0),te(),rt.parentNode!==Xe&&Xe.appendChild(rt),rt.classList.remove("portal"),rt.style.display="",rt.style.position="",rt.style.top="",rt.style.left="",rt.style.right="",rt.style.width=""},_e=t.label!=null||JSswift.ui.getSlot(s,"label")!=null,Me=()=>{if(!_e){Ie.placeholder=o(t.placeholder)||"";return}Ie.placeholder=document.activeElement===Ie&&o(t.placeholder)||""},Ie=_.input({id:t.id,class:Z(["cms-input","cms-search-input",t.inputClass]),type:"search",name:t.name,placeholder:_e?"":t.placeholder,autocomplete:t.autocomplete||"off",inputmode:t.inputmode,value:u(),disabled:R(),readOnly:h(),role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-controls":`${he}-list`}),Ye=_.div({id:`${he}-list`,class:"cms-search-results",role:"listbox"}),rt=_.div({class:Z(["cms-search-menu","cms-singularity-menu-select",t.menuClass,ye(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:F=>F.stopPropagation()},Ye),Xe=_.div({class:Z(["cms-search",t.class]),role:"presentation"},Ie,rt);let We=null;if(c){if(typeof c=="object"&&typeof c._bind=="function")e.action(c,F=>P(F,{fromModel:!0})),se=F=>{c.value!==F&&(c.value=F)};else if(Array.isArray(c)&&typeof c[0]=="function"&&typeof c[1]=="function"){const F=c[0],f=c[1];e.effect(()=>{P(F(),{fromModel:!0})},"UI.Search:model"),se=r=>f(r)}}else Ke(t.value)&&e.effect(()=>{P(o(t.value),{fromModel:!0})},"UI.Search:value");Ie.addEventListener("input",F=>{P(Ie.value,{event:F}),t.searchOnInput!==!1&&A(Ie.value,{open:!0})}),Ie.addEventListener("change",F=>{var f;return(f=t.onChange)==null?void 0:f.call(t,Ie.value,F)}),Ie.addEventListener("focus",F=>{var f;Me(),(f=t.onFocus)==null||f.call(t,F),t.openOnFocus!==!1&&(t.searchOnFocus&&!W().length?A(Ie.value,{immediate:!0,open:!0}):Ce())}),Ie.addEventListener("blur",F=>{var f;Me(),(f=t.onBlur)==null||f.call(t,F)}),Ie.addEventListener("keydown",F=>{if(R()||h())return;const f=b(),r=W(),x=B();if(F.key==="Escape"){f&&(F.preventDefault(),K());return}if(F.key==="ArrowDown"){F.preventDefault(),f?ke(1):(Ce(),r.length||A(Ie.value,{immediate:!0,open:!0}));return}if(F.key==="ArrowUp"){F.preventDefault(),f?ke(-1):Ce();return}if(F.key==="Home"&&f&&r.length&&(F.metaKey||F.ctrlKey)){F.preventDefault(),ne(0);return}if(F.key==="End"&&f&&r.length&&(F.metaKey||F.ctrlKey)){F.preventDefault(),ne(r.length-1);return}F.key==="Enter"&&(f&&x>=0&&r[x]?(F.preventDefault(),ae(r[x],F)):L(F))});const w=F=>{if(!Xe.isConnected)return;const f=F.target;Xe.contains(f)||rt.contains(f)||K()};return document.addEventListener("click",w,!0),e.effect(()=>{const F=b();Xe.classList.toggle("open",F),Ie.setAttribute("aria-expanded",F?"true":"false"),F?De():je()},"UI.Search:open"),e.effect(()=>{const F=R(),f=h();Xe.classList.toggle("disabled",F),Xe.classList.toggle("readonly",f),Ie.disabled=F,Ie.readOnly=f},"UI.Search:disabled"),e.effect(()=>{const F=N(),f=z(),r=W(),x=u();if(Ye.innerHTML="",Y=[],O=-1,F){const de=JSswift.ui.renderSlot(s,"loading",{query:x},t.loadingText||"Caricamento...");Ye.appendChild(_.div({class:"cms-search-empty is-loading"},...T(null,"default",{},de)))}else if(f){const de=JSswift.ui.renderSlot(s,"error",{error:f,query:x},t.errorText||"Errore ricerca");Ye.appendChild(_.div({class:"cms-search-empty is-error"},...T(null,"default",{},de)))}else if(r.length)r.forEach((de,Be)=>{const Se=j(de),Oe=X(de),at=wt=>ae(de,wt),nt=JSswift.ui.renderSlot(s,"result",{item:de,index:Be,active:!1,label:Se,value:Oe,query:x,select:at},ze(de)),Ze=_.div({id:`${he}-result-${Be}`,class:Z(["cms-search-result",""]),role:"option","aria-selected":"false",onMouseEnter:()=>ne(Be),onMouseDown:wt=>wt.preventDefault(),onClick:at},...T(null,"default",{},nt));Ye.appendChild(Ze),Y[Be]=Ze});else{const Be=x.trim().length>=m()?t.emptyText||"Nessun risultato":t.startText||"",He=JSswift.ui.renderSlot(s,"empty",{query:x},Be);(Be||JSswift.ui.getSlot(s,"empty")!=null)&&Ye.appendChild(_.div({class:"cms-search-empty"},...T(null,"default",{},He)))}ee()||K(),V()},"UI.Search:render"),e.effect(()=>{const F=B();F!==O&&(Y[O]&&(Y[O].classList.remove("active"),Y[O].setAttribute("aria-selected","false")),Y[F]?(Y[F].classList.add("active"),Y[F].setAttribute("aria-selected","true"),Y[F].scrollIntoView({block:"nearest"}),Ie.setAttribute("aria-activedescendant",`${he}-result-${F}`)):Ie.removeAttribute("aria-activedescendant"),O=F)},"UI.Search:active"),We=Ae.FormField({...t,icon:(ie=t.icon)!=null?ie:"search",wrapClass:Z(["cms-search-field",t.wrapClass]),control:Xe,getValue:()=>u(),onClear:()=>{var F;R()||h()||(P("",{}),E(),(F=t.onClear)==null||F.call(t))},onFocus:()=>Ie.focus()}),Ie.addEventListener("input",()=>{var F;return(F=We._refresh)==null?void 0:F.call(We)}),Ie.addEventListener("change",()=>{var F;return(F=We._refresh)==null?void 0:F.call(We)}),We._input=Ie,We._search=Xe,We._open=Ce,We._close=K,We._searchNow=()=>p(u(),{immediate:!0,open:!0}),We._getResults=W,We._setValue=F=>P(F,{}),We._dispose=()=>{n||(n=!0,e.dispose(),be++,q.clear(),document.removeEventListener("click",w,!0),le&&clearTimeout(le),fe&&fe.abort(),je())},($e=JSswift._registerCleanup)==null||$e.call(JSswift,We,We._dispose),tt(Ie,t,{isEnabled:()=>!Ie.disabled,action:()=>Pe(Ie,{selectText:!!t.selectOnShortcode})}),(t.autoSearch||t.searchOnMount)&&A(u(),{immediate:!0,open:!1}),We},Ae.Select=(t={})=>{var $e,F;const e=On();let n=!1;const s={...t,label:($e=t.label)!=null?$e:t.placeholder},i=t.filterable,c=!!t.multiple||!!t.multi,S=!!t.allowCustom||!!t.allowCustomValue,u=t.slots||{},a=f=>!!f&&(typeof f=="object"&&typeof f._bind=="function"||Ct(f)),b=a(t.model)?t.model:a(t.value)?t.value:null,M=f=>Array.isArray(f)?f.slice():f==null||f===""?[]:[f],N=f=>c?M(f):f,C=b?JSswift.reactive.untracked(()=>typeof b=="object"&&typeof b._bind=="function"?b.value:b[0]()):t.value,[z,U]=JSswift.reactive.signal(!1),[W,ge]=JSswift.reactive.signal(""),[B,ne]=JSswift.reactive.signal(c?M(C):C!=null?C:""),[he,q]=JSswift.reactive.signal(!1),[se,le]=JSswift.reactive.signal([]),[fe,be]=JSswift.reactive.signal([]),[re,ue]=JSswift.reactive.signal(-1);let O=null;if(b){if(typeof b=="object"&&typeof b._bind=="function")JSswift.reactive.untracked(()=>ne(N(b.value))),e.action(b,f=>ne(N(f))),O=f=>{const r=N(f);b.value!==r&&(b.value=r)};else if(Array.isArray(b)&&typeof b[0]=="function"&&typeof b[1]=="function"){const f=b[0],r=b[1];JSswift.reactive.untracked(()=>{e.effect(()=>{ne(N(f()))},"UI.Select:model")}),O=x=>r(N(x))}}function Y(){var f;return typeof t.disabled=="function"?t.disabled():typeof t.disabled=="boolean"?t.disabled:(f=t==null?void 0:t.disabled)!=null&&f.action?t.disabled.value:!1}function oe(f){var r,x,de,Be;if(f==null)return null;if(typeof f=="string"||typeof f=="number")return{type:"option",label:String(f),value:f,disabled:!1};if(typeof f=="object"){if(Array.isArray(f.options))return{type:"group",label:String((r=f.label)!=null?r:""),options:f.options};const He=(x=f.label)!=null?x:f.value!=null?String(f.value):"";return{type:"option",label:String(He),value:(Be=(de=f.value)!=null?de:f.label)!=null?Be:"",disabled:!!f.disabled}}return{type:"option",label:String(f),value:f,disabled:!1}}function we(f){const x=(Array.isArray(f)?f:[]).map(oe).filter(Boolean),de=[],Be=[];for(const He of x)if(He.type==="group"){de.push({type:"group",label:He.label});const Se=(He.options||[]).map(oe).filter(Boolean).filter(Oe=>Oe.type==="option");for(const Oe of Se)de.push(Oe),Be.push(Oe)}else de.push(He),Be.push(He);le(de),be(Be)}async function R(){if(n)return;const f=t.options;let r;try{const x=typeof f=="function"?JSswift.ui.withoutRodPathCapture(()=>f()):f;x&&typeof x.then=="function"?(q(!0),r=await x):r=x,n||we(r)}catch(x){if(n)return;console.error("[UI.Select] options load error:",x),we([])}finally{n||q(!1)}}function h(f){var x;const r=N(f);ne(r),O&&O(r),(x=t.onChange)==null||x.call(t,r)}function m(f){const r=M(B()),de=r.some(Be=>Be==f)?r.filter(Be=>Be!=f):[...r,f];h(de)}function y(f,r=!1){c?(m(f),r&&j()):(h(f),X())}function j(){ge(""),p&&(p.value="")}function X(){U(!1),j(),ue(-1)}async function d(){if(n||Y()||(U(!0),await R(),n))return;const f=B(),r=fe();let x=-1;if(c){const de=M(f);for(const Be of de)if(x=r.findIndex(He=>He.value==Be&&!He.disabled),x>=0)break}else x=r.findIndex(de=>de.value==f&&!de.disabled);x<0&&(x=r.findIndex(de=>!de.disabled)),ue(x),p&&setTimeout(()=>p.focus(),0)}function k(){z()?X():d()}const g=_.div({class:Z(["cms-select",c?"multiple":"",t.class]),tabIndex:Y()?-1:0,role:"combobox","aria-expanded":"false","aria-disabled":Y()?"true":"false"}),P=_.div({class:Z(["cms-select-value",c?"cms-select-value-multi":""])});e.effect(()=>{const f=fe();if(P.innerHTML="",c){const r=M(B());for(const x of r){const de=f.find(Oe=>Oe.value==x),Be=de?de.label:x==null?"":String(x);let He=!1;const Se=Ae.Chip({label:Be,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:Oe=>{var at,nt,Ze;(at=Oe==null?void 0:Oe.preventDefault)==null||at.call(Oe),(nt=Oe==null?void 0:Oe.stopPropagation)==null||nt.call(Oe),(Ze=Oe==null?void 0:Oe.stopImmediatePropagation)==null||Ze.call(Oe),!He&&(He=!0,m(x))}});P.appendChild(Se)}}else{const r=B(),x=f.find(de=>de.value==r);P.textContent=x?x.label:r==null||r===""?"":String(r)}},"UI.Select:value");const K=_.div({class:"cms-select-arrow"});e.effect(()=>{const f=JSswift.ui.renderSlot(u,"arrow",{open:z()},Ae.Icon("#chevron-down"));K.innerHTML="",T(null,"default",{},f).forEach(r=>K.appendChild(r))},"UI.Select:arrow");const ee=_.div({class:"cms-select-control",onClick:k},P,K),Ce=_.div({class:"cms-select-options",role:"listbox","aria-multiselectable":c?"true":"false"}),E=_.div({class:"cms-select-filter cms-d-none"});let p=null;const A=_.input({class:"cms-input",type:"text",placeholder:t.filterPlaceholder||"Cerca...",onInput:f=>ge(f.target.value||"")}),L=()=>{const f=JSswift.ui.renderSlot(u,"filter",{value:W(),setValue:x=>{const de=x==null?"":String(x);ge(de),p&&"value"in p&&(p.value=de)},close:X},A);E.innerHTML="";const r=T(null,"default",{},f);r.forEach(x=>E.appendChild(x)),p=r.length===1&&r[0]&&r[0].tagName==="INPUT"?r[0]:null,p&&(p.value=W()||"")};JSswift.reactive.untracked(L),e.effect(()=>{const f=W()||"";p&&"value"in p&&p.value!==f&&(p.value=f)},"UI.Select:filterValue"),typeof i=="boolean"?i?E.classList.remove("cms-d-none"):E.classList.add("cms-d-none"):i!=null&&i.action&&(e.action(i,f=>{f?E.classList.remove("cms-d-none"):E.classList.add("cms-d-none")}),i.value?E.classList.remove("cms-d-none"):E.classList.add("cms-d-none"));const ae={...t};vn(ae);const ke=xt([ae.color,ae.state],()=>{const f=o(ae.color)||o(ae.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(f)?f:o(ae.state)||""}),Te=_.div({class:Z(["cms-select-menu","cms-singularity-menu-select",ke,ae.class,ye(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:f=>f.stopPropagation()},E,Ce);let ze=0,V=!1;const H=()=>{!z()||Te.parentNode!==document.body||ze||(ze=requestAnimationFrame(()=>{if(ze=0,!z()||!g.isConnected||Te.parentNode!==document.body)return;const f=g.getBoundingClientRect(),r=6,x=8,de=Math.max(160,window.innerWidth-x*2),Be=Math.min(Math.max(f.width,180),de),He=Math.max(x,Math.min(f.left,window.innerWidth-Be-x));Te.style.width=`${Be}px`,Te.style.left=`${He}px`,Te.style.right="auto",Te.style.marginTop="0";const Se=Te.getBoundingClientRect().height||0,Oe=window.innerHeight-f.bottom-r-x,at=f.top-r-x;let Ze=Oe<180&&at>Oe?f.top-r-Se:f.bottom+r;Ze=Math.max(x,Math.min(Ze,window.innerHeight-Se-x)),Te.style.top=`${Ze}px`}))},te=()=>{V||(V=!0,window.addEventListener("resize",H),window.addEventListener("scroll",H,!0))},De=()=>{V&&(V=!1,window.removeEventListener("resize",H),window.removeEventListener("scroll",H,!0))},je=()=>{Te.parentNode!==document.body&&(ze&&(cancelAnimationFrame(ze),ze=0),Te.classList.add("portal"),Te.style.display="block",document.body.appendChild(Te),te(),H())},_e=()=>{ze&&(cancelAnimationFrame(ze),ze=0),De(),Te.parentNode!==g&&g.appendChild(Te),Te.classList.remove("portal"),Te.style.display="",Te.style.position="",Te.style.top="",Te.style.left="",Te.style.right="",Te.style.width="",Te.style.marginTop=""};g.appendChild(ee),g.appendChild(Te),e.effect(()=>{const f=z();g.classList.toggle("open",f),g.setAttribute("aria-expanded",f?"true":"false"),f?je():_e()},"UI.Select:open"),e.effect(()=>{const f=Y();g.classList.toggle("disabled",f),g.tabIndex=f?-1:0,g.setAttribute("aria-disabled",f?"true":"false")},"UI.Select:disabled");let Me=[],Ie=-1,Ye=-1;function rt(){var r;const f=re();Ye=f,f!==Ie&&(Me[Ie]&&Me[Ie].classList.remove("active"),Me[f]&&Me[f].classList.add("active"),Ie=f,f>=0&&((r=Me[f])==null||r.scrollIntoView({block:"nearest"})))}e.effect(()=>{const f=se(),r=fe(),x=(W()||"").toLowerCase().trim(),de=B(),Be=c?M(de):[de],He=he(),Se=Ye;Ce.innerHTML="",Me=[],Ie=-1;const Oe=[];let at=0;const nt=Ze=>{const wt=Be.some(ft=>ft==Ze.value),Nt=!!Ze.disabled,Et=["cms-select-option",wt?"selected":"",Nt?"disabled":""].filter(Boolean).join(" "),Rt=()=>{c?m(Ze.value):(h(Ze.value),X())},Mt=JSswift.ui.renderSlot(u,"option",{opt:Ze,selected:wt,active:at===Se,disabled:Nt,select:Rt},Ze.label),vt=T(null,"default",{},Mt),Dt=_.div({class:Et,"data-flat-index":String(at),onClick:Nt?null:Rt},...vt);Oe.push(Dt),Me[at]=Dt,at++};if(x){const Ze=r.filter(wt=>wt.label.toLowerCase().includes(x));if(Ze.length===0){const wt=JSswift.ui.renderSlot(u,"empty",{filter:x},t.emptyText||"Nessuna opzione");Ce.appendChild(_.div({class:"cms-select-empty"},...T(null,"default",{},wt))),z()&&H();return}for(const wt of Ze)nt(wt)}else{let Ze=!1;for(const wt of f)if(wt.type==="group"){const Nt=JSswift.ui.renderSlot(u,"group",{label:wt.label},wt.label);Oe.push(_.div({class:"cms-select-group"},...T(null,"default",{},Nt)))}else Ze=!0,nt(wt);if(!Ze){const wt=JSswift.ui.renderSlot(u,"empty",{filter:x},t.emptyText||"Nessuna opzione");Ce.appendChild(_.div({class:"cms-select-empty"},...T(null,"default",{},wt))),z()&&H();return}}if(He){const Ze=JSswift.ui.renderSlot(u,"loading",{},"Caricamento...");Ce.appendChild(_.div({class:"cms-select-empty"},...T(null,"default",{},Ze))),z()&&H();return}for(const Ze of Oe)Ce.appendChild(Ze);rt(),z()&&H()},"UI.Select:render"),e.effect(()=>{rt()},"UI.Select:paintActive");const Xe=f=>{if(!g.isConnected)return;const r=f.target;g.contains(r)||Te.contains(r)||X()};document.addEventListener("click",Xe,!0);const We=f=>{if(Y())return;const r=z(),x=fe(),de=re(),Be=p&&f.target===p,He=(Oe,at)=>{let nt=Oe;for(;nt>=0&&nt<x.length;){if(!x[nt].disabled)return nt;nt+=at}return-1},Se=Oe=>{if(!Oe)return null;const at=Oe.toLowerCase();let nt=x.find(Ze=>String(Ze.label).toLowerCase()===at||String(Ze.value).toLowerCase()===at);return nt||(nt=x.find(Ze=>String(Ze.label).toLowerCase().includes(at))),nt&&!nt.disabled?nt:null};if(f.key==="Escape"){r&&(f.preventDefault(),X());return}if(Be&&(f.key==="Enter"||f.key===" ")){const Oe=(W()||"").trim();if(Oe){const at=Se(Oe);if(at){f.preventDefault(),y(at.value,!0);return}if(S&&f.key==="Enter"){f.preventDefault(),y(Oe,!0);return}if(f.key==="Enter"){f.preventDefault();return}}if(f.key===" ")return}if(f.key==="Enter"||f.key===" "){if(f.preventDefault(),!r){d();return}de>=0&&x[de]&&!x[de].disabled&&(c?m(x[de].value):(h(x[de].value),X()));return}if(f.key==="ArrowDown"){if(f.preventDefault(),!r){d();return}const Oe=He(de<0?0:de+1,1);Oe>=0&&ue(Oe);return}if(f.key==="ArrowUp"){if(f.preventDefault(),!r){d();return}const Oe=He(de<0?x.length-1:de-1,-1);Oe>=0&&ue(Oe);return}if(f.key==="Home"){if(!r)return;f.preventDefault();const Oe=He(0,1);Oe>=0&&ue(Oe);return}if(f.key==="End"){if(!r)return;f.preventDefault();const Oe=He(x.length-1,-1);Oe>=0&&ue(Oe);return}};g.addEventListener("keydown",We),E.addEventListener("keydown",We),g._dispose=()=>{n||(n=!0,e.dispose(),document.removeEventListener("click",Xe,!0),g.removeEventListener("keydown",We),E.removeEventListener("keydown",We),_e())};const w=()=>{const f=B();return c?Array.isArray(f)&&f.length>0:f==null?!1:f!==""?!0:fe().some(r=>r.value==="")},ie=Ae.FormField({...s,control:g,clearable:t.clearable,disabled:Y(),readonly:!1,hasValue:w,getValue:()=>{const f=B();return c?Array.isArray(f)&&f.length?f:"":f},onClear:()=>{Y()||(h(c?[]:null),X())},onFocus:()=>{d()}});return e.effect(()=>{var f;(f=ie._refresh)==null||f.call(ie)},"UI.Select:fieldRefresh"),on(ie,g,t),ie._select=g,ie._dispose=g._dispose,(F=JSswift._registerCleanup)==null||F.call(JSswift,ie,ie._dispose),tt(ie,t,{isEnabled:()=>!Y(),action:()=>{if(Y())return!1;Pe(g),d()}}),R(),ie},Ae.Upload=(t={})=>{var We;vn(t);const e=t.slots||{},[n,s]=JSswift.reactive.signal([]),[i,c]=JSswift.reactive.signal(!1),[S,u]=JSswift.reactive.signal(!1),[a,b]=JSswift.reactive.signal(null);let M=0,N=!1;const C=()=>!!o(t.disabled)||!!o(t.readonly),z=()=>t.multiple!==!1&&t.single!==!0,U=()=>{var w,ie;return["form","native","submit","external"].includes(String(o((ie=(w=t.submitMode)!=null?w:t.modeSubmit)!=null?ie:t.uploadMode)||"").toLowerCase())},W=()=>{var w;return o((w=t.showBrowse)!=null?w:t.browseButton)!==!1},ge=()=>{var w;return!U()&&o((w=t.showUpload)!=null?w:t.uploadButton)!==!1},B=()=>{var w;return o((w=t.showClear)!=null?w:t.clearButton)!==!1},ne=()=>{var w;return o((w=t.showFiles)!=null?w:t.files)!==!1},he=()=>{const w=Bt(o(t.state)||o(t.status));return w?`cms-state-${w}`:""},q=()=>t.fieldName||t.paramName||t.name||"file",se=()=>{var w;return Math.max(1,Number(o((w=t.parallelUploads)!=null?w:t.parallel)||1))},le=()=>{var ie,$e,F,f;const w=o(t.retry);return w===!0?{attempts:2,delay:350,factor:2}:w?{attempts:Math.max(0,Number(($e=(ie=w.attempts)!=null?ie:w.retries)!=null?$e:0)),delay:Math.max(0,Number((F=w.delay)!=null?F:350)),factor:Math.max(1,Number((f=w.factor)!=null?f:2))}:{attempts:0,delay:350,factor:2}},fe=w=>w?Array.isArray(w)?w:Array.from(w):[],be=w=>{const ie=Number(w||0);return ie<1024?`${ie} B`:ie<1024*1024?`${(ie/1024).toFixed(1)} KB`:ie<1024*1024*1024?`${(ie/1024/1024).toFixed(1)} MB`:`${(ie/1024/1024/1024).toFixed(1)} GB`},re=()=>{var w;return String(o((w=t.acceptedFiles)!=null?w:t.accept)||"").trim()},ue=w=>{const ie=re();if(!ie)return!0;const $e=String(w.name||"").toLowerCase(),F=String(w.type||"").toLowerCase();return ie.split(",").map(f=>f.trim().toLowerCase()).filter(Boolean).some(f=>f.startsWith(".")?$e.endsWith(f):f.endsWith("/*")?F.startsWith(f.slice(0,-1)):F===f)},O=()=>n().filter(w=>w.status!=="rejected"&&w.status!=="removed"),Y=(w=0)=>O().reduce((ie,$e)=>ie+Number($e.size||0),w),oe=()=>{var w;s(n().slice()),H.classList.toggle("is-busy",n().some(ie=>ie.status==="uploading")),H.classList.toggle("has-files",n().some(ie=>ie.status!=="removed")),(w=t.onChange)==null||w.call(t,n().slice(),te)},we=(w,ie,$e=null)=>{var f;const F={id:`upload_${Date.now()}_${++M}`,file:w,name:(w==null?void 0:w.name)||"file",size:Number((w==null?void 0:w.size)||0),type:(w==null?void 0:w.type)||"",status:"rejected",progress:0,error:ie,detail:$e,attempts:0,response:null,xhr:null};return n().push(F),(f=t.onRejected)==null||f.call(t,F,{reason:ie,detail:$e,api:te}),F},R=async(w,ie)=>{const $e=t.maxFiles==null?null:Number(o(t.maxFiles)),F=t.maxFileSize==null?null:Number(o(t.maxFileSize)),f=t.minFileSize==null?null:Number(o(t.minFileSize)),r=t.maxTotalSize==null?null:Number(o(t.maxTotalSize));if($e!=null&&ie>$e)return"max-files";if(F!=null&&Number(w.size||0)>F)return"max-file-size";if(f!=null&&Number(w.size||0)<f)return"min-file-size";if(r!=null&&Y(Number(w.size||0))>r)return"max-total-size";if(!ue(w))return"accept";const x=t.filter||t.acceptFile||t.validate;if(typeof x=="function"){const de=await x(w,{files:n().slice(),api:te});if(de===!1)return"filter";if(typeof de=="string")return de}return null},h=async()=>{for(const w of n()){if(w.status!=="rejected"||w.error!=="max-files")continue;const ie=await R(w.file,O().length+1);if(ie){w.error=ie;continue}w.status="queued",w.progress=0,w.error=null,w.detail=null}},m=w=>({id:`upload_${Date.now()}_${++M}`,file:w,name:(w==null?void 0:w.name)||"file",size:Number((w==null?void 0:w.size)||0),type:(w==null?void 0:w.type)||"",status:"queued",progress:0,bytesUploaded:0,error:null,detail:null,attempts:0,response:null,xhr:null}),y=async(w,ie={})=>{var f;if(C())return[];b(null);const $e=fe(w),F=[];!z()&&$e.length&&j({silent:!0});for(const r of $e){const x=await R(r,O().length+1);if(x){we(r,x);continue}const de=m(r);if(n().push(de),F.push(de),(f=t.onAdded)==null||f.call(t,de,{file:r,meta:ie,api:te}),!z())break}return oe(),F.length&&t.autoUpload&&!U()&&p(),F},j=(w={})=>{var ie;for(const $e of n())$e.status==="uploading"&&d($e),$e.status="removed";s([]),b(null),oe(),w.silent||(ie=t.onClear)==null||ie.call(t,te)},X=async w=>{var F;const ie=typeof w=="string"?n().find(f=>f.id===w):w;if(!ie)return;ie.status==="uploading"&&d(ie);const $e=n().filter(f=>f!==ie);s($e),await h(),oe(),(F=t.onRemove)==null||F.call(t,ie,{api:te})},d=w=>{var $e,F,f;const ie=typeof w=="string"?n().find(r=>r.id===w):w;!ie||ie.status!=="uploading"||(ie.status="canceled",ie.error="canceled",(F=($e=ie.xhr)==null?void 0:$e.abort)==null||F.call($e),(f=t.onCancel)==null||f.call(t,ie,{api:te}),oe())},k=()=>n().filter(w=>w.status==="uploading").forEach(d),g=async w=>{var $e,F;const ie={url:o(t.url),method:o(t.method||"POST"),headers:t.headers,formFields:t.formFields||t.fields,fieldName:q(),withCredentials:!!o(($e=t.withCredentials)!=null?$e:t.credentials),sendRaw:!!o(t.sendRaw)};if(typeof t.factory=="function")try{const f=await t.factory(w.file,{item:w,files:n().slice(),api:te});if(f&&typeof f=="object")Object.assign(ie,f);else if(f!=null)throw new Error("factory must return an object")}catch(f){throw(F=t.onFactoryFailed)==null||F.call(t,f,{item:w,api:te}),f}return ie},P=(w,ie,$e)=>{const F=typeof ie=="function"?ie($e.file,{item:$e,api:te}):ie;F&&(F instanceof Headers?F.forEach((f,r)=>w.setRequestHeader(r,f)):Array.isArray(F)?F.forEach(f=>{Array.isArray(f)?w.setRequestHeader(f[0],f[1]):f!=null&&f.name&&w.setRequestHeader(f.name,f.value)}):typeof F=="object"&&Object.keys(F).forEach(f=>w.setRequestHeader(f,F[f])))},K=(w,ie,$e)=>{const F=typeof ie=="function"?ie($e.file,{item:$e,api:te}):ie;F&&(Array.isArray(F)?F.forEach(f=>{Array.isArray(f)?w.append(f[0],f[1]):f!=null&&f.name&&w.append(f.name,f.value)}):typeof F=="object"&&Object.keys(F).forEach(f=>w.append(f,F[f])))},ee=(w,ie)=>new Promise(($e,F)=>{if(!ie.url){F(new Error("UI.Upload: url is required"));return}if(typeof XMLHttpRequest!="function"){F(new Error("UI.Upload: XMLHttpRequest is not available"));return}const f=new XMLHttpRequest;w.xhr=f,f.open(String(ie.method||"POST").toUpperCase(),ie.url,!0),f.withCredentials=!!ie.withCredentials,P(f,ie.headers,w),f.upload.onprogress=x=>{var de;x.lengthComputable&&(w.bytesUploaded=x.loaded,w.progress=Math.max(0,Math.min(100,Math.round(x.loaded/x.total*100))),(de=t.onProgress)==null||de.call(t,w,{event:x,api:te}),oe())},f.onload=()=>{const x=f.status>=200&&f.status<300,de={status:f.status,text:f.responseText,xhr:f};x?$e(de):F(Object.assign(new Error(`HTTP error ${f.status}`),{response:de}))},f.onerror=()=>F(new Error("network-error")),f.onabort=()=>F(new Error("canceled"));const r=ie.sendRaw?w.file:(()=>{const x=new FormData;return K(x,ie.formFields,w),x.append(ie.fieldName||"file",w.file,w.name),x})();f.send(r)}),Ce=async w=>{var F,f,r,x,de,Be;const ie=le();let $e=ie.delay;w.status="uploading",w.error=null,w.progress=Math.max(0,w.progress||0),(F=t.onStart)==null||F.call(t,w,{api:te}),oe();for(let He=0;He<=ie.attempts;He++){w.attempts=He+1;try{const Se=await g(w),Oe=typeof t.upload=="function"||typeof t.uploader=="function"?await(t.upload||t.uploader)(w.file,{item:w,options:Se,progress:at=>{var nt;w.progress=Math.max(0,Math.min(100,Number(at)||0)),(nt=t.onProgress)==null||nt.call(t,w,{api:te}),oe()},api:te}):await ee(w,Se);return w.status="done",w.progress=100,w.response=Oe,w.xhr=null,(f=t.onSuccess)==null||f.call(t,w,{response:Oe,api:te}),(r=t.onComplete)==null||r.call(t,w,{response:Oe,api:te}),oe(),w}catch(Se){if(String((Se==null?void 0:Se.message)||Se)==="canceled"||w.status==="canceled")return w.status="canceled",w.error="canceled",w.xhr=null,(x=t.onComplete)==null||x.call(t,w,{error:Se,api:te}),oe(),w;if(He<ie.attempts){await new Promise(Oe=>setTimeout(Oe,$e)),$e=Math.round($e*ie.factor);continue}return w.status="error",w.error=Se,w.xhr=null,b(Se),(de=t.onError)==null||de.call(t,w,{error:Se,api:te}),(Be=t.onComplete)==null||Be.call(t,w,{error:Se,api:te}),oe(),w}}return w},E=()=>{var F;if(N||C())return;const w=n().filter(f=>f.status==="uploading").length,ie=Math.max(0,se()-w),$e=n().filter(f=>f.status==="queued").slice(0,ie);if(!$e.length){const f=n().some(r=>r.status==="uploading");u(f),f||(F=t.onFinish)==null||F.call(t,n().slice(),{api:te});return}u(!0),$e.forEach(f=>{Ce(f).finally(()=>E())})},p=(w=null)=>{(w?fe(w):n().filter($e=>["queued","error","canceled"].includes($e.status))).forEach($e=>{const F=typeof $e=="string"?n().find(f=>f.id===$e):$e;F&&F.status!=="uploading"&&F.status!=="done"&&F.status!=="rejected"&&(F.status="queued",F.progress=0,F.error=null)}),oe(),E()},A=w=>p([w]),L=()=>{C()||ae.click()},ae=_.input({type:"file",class:"cms-upload-input",name:q(),accept:re()||null,multiple:z(),capture:t.capture||null,disabled:C(),onChange:w=>{y(w.target.files,{event:w,source:"browse"}),w.target.value=""}}),ke=_.div({class:"cms-upload-list"}),Te=_.div({class:"cms-upload-summary"}),ze=_.div({class:"cms-upload-actions"});let V=he();const H=_.div({class:Z(["cms-upload","cms-singularity",V,ye(t.box||t.variant==="box","cms-upload-box"),ye(t.compact,"is-compact"),ye(U(),"is-form-mode"),ye(!ne(),"is-files-hidden"),t.class]),tabindex:C()?"-1":"0",role:"group","aria-disabled":C()?"true":"false"}),te={addFiles:y,browse:L,upload:p,retry:A,retryAll:()=>p(n().filter(w=>w.status==="error"||w.status==="canceled")),remove:X,clear:j,abort:d,abortAll:k,files:()=>n().slice(),state:()=>({files:n().slice(),busy:S(),dragging:i(),error:a()}),reset:j},De=()=>{const w={api:te,files:n().slice(),busy:S(),disabled:C(),submitMode:U()?"form":"upload"},ie=[];return W()&&ie.push(JSswift.ui.renderSlot(e,"browse",w,Ae.Btn({size:"sm",icon:"folder_open",label:t.browseText||"Browse",onClick:L}))),ge()&&ie.push(JSswift.ui.renderSlot(e,"upload",w,Ae.Btn({size:"sm",color:"primary",icon:"upload",label:t.uploadText||"Upload",loading:S(),disabled:C()||!n().some($e=>["queued","error","canceled"].includes($e.status)),onClick:()=>p()}))),B()&&ie.push(JSswift.ui.renderSlot(e,"clear",w,Ae.Btn({size:"sm",color:"secondary",outline:!0,icon:"delete",label:t.clearText||"Clear",disabled:C()||!n().length,onClick:()=>j()}))),T(e,"actions",w,ie)},je=(w,ie)=>{var r;const $e={item:w,file:w.file,index:ie,api:te,remove:()=>X(w),retry:()=>A(w),abort:()=>d(w)},F=_.div({class:Z(["cms-upload-file",`is-${w.status}`])},_.div({class:"cms-upload-file-icon"},Ae.Icon({name:w.status==="done"?"check_circle":w.status==="error"||w.status==="rejected"?"error":"description"})),_.div({class:"cms-upload-file-main"},_.div({class:"cms-upload-file-name"},...T(e,"fileName",$e,w.name)),_.div({class:"cms-upload-file-meta"},...T(e,"fileMeta",$e,w.error?String(((r=w.error)==null?void 0:r.message)||w.error):w.status==="queued"?"Queued":w.status)),_.div({class:"cms-upload-progress",role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":String(w.progress||0)},_.div({class:"cms-upload-progress-bar",style:{width:`${w.progress||0}%`}}))),_.div({class:"cms-upload-file-trailing"},_.div({class:"cms-upload-file-size"},be(w.size)),_.div({class:"cms-upload-file-actions"},...T(e,"fileActions",$e,[w.status==="uploading"?Ae.Btn({size:"sm",outline:!0,icon:"close","aria-label":"Cancel",onClick:()=>d(w)}):null,w.status==="error"||w.status==="canceled"?Ae.Btn({size:"sm",outline:!0,icon:"refresh","aria-label":"Retry",onClick:()=>A(w)}):null,Ae.Btn({size:"sm",dense:!0,outline:!0,icon:"delete","aria-label":"Remove",onClick:()=>X(w)})])))),f=JSswift.ui.renderSlot(e,"file",$e,F);return _.div({class:"cms-upload-file-wrap","data-status":w.status,"data-id":w.id},...T(null,"default",{},f))},_e=()=>{const w=n();if(ze.replaceChildren(...De()),ke.replaceChildren(),Te.hidden=!ne(),ke.hidden=!ne(),w.length)w.forEach(($e,F)=>ke.appendChild(je($e,F)));else{const $e=JSswift.ui.renderSlot(e,"empty",{api:te},t.emptyText||"No files selected");ke.appendChild(_.div({class:"cms-upload-empty"},...T(null,"default",{},$e)))}const ie=w.filter($e=>$e.status!=="rejected"&&$e.status!=="removed");Te.textContent=`${ie.length} file \u2022 ${be(ie.reduce(($e,F)=>$e+Number(F.size||0),0))}`},Me=JSswift.ui.renderSlot(e,"icon",{api:te},Ae.Icon({name:t.icon||"cloud_upload"})),Ie=JSswift.ui.renderSlot(e,"title",{api:te},t.title||"Upload files"),Ye=JSswift.ui.renderSlot(e,"subtitle",{api:te},t.subtitle||(re()?`Accepted: ${re()}`:"Drag files here or browse from your device")),rt=_.div({class:"cms-upload-dropzone",onClick:w=>{var ie,$e;($e=(ie=w.target)==null?void 0:ie.closest)!=null&&$e.call(ie,".cms-upload-actions, .cms-upload-list")||t.clickable!==!1&&L()},onDragenter:w=>{t.drag===!1||C()||(w.preventDefault(),c(!0),H.classList.add("is-dragging"))},onDragover:w=>{t.drag===!1||C()||w.preventDefault()},onDragleave:w=>{w.currentTarget===w.target&&(c(!1),H.classList.remove("is-dragging"))},onDrop:w=>{var ie,$e;t.drag===!1||C()||(w.preventDefault(),c(!1),H.classList.remove("is-dragging"),(ie=t.onDrop)==null||ie.call(t,w,{api:te}),y((($e=w.dataTransfer)==null?void 0:$e.files)||[],{event:w,source:"drop"}))}},_.div({class:"cms-upload-head"},_.div({class:"cms-upload-icon"},...T(null,"default",{},Me)),_.div({class:"cms-upload-copy"},_.div({class:"cms-upload-title"},...T(null,"default",{},Ie)),_.div({class:"cms-upload-subtitle"},...T(null,"default",{},Ye))),ze),Te,ke),Xe=JSswift.ui.renderSlot(e,"header",{api:te},null);return T(null,"default",{},Xe).forEach(w=>H.appendChild(w)),H.appendChild(ae),T(e,"default",{api:te,dropzone:rt},rt).forEach(w=>H.appendChild(w)),JSswift.reactive.effect(()=>{_e()},"UI.Upload:render"),JSswift.reactive.effect(()=>{H.classList.toggle("is-disabled",C()),H.classList.toggle("is-form-mode",U()),H.classList.toggle("is-files-hidden",!ne());const w=he();w!==V&&(V&&H.classList.remove(V),w&&H.classList.add(w),V=w),H.setAttribute("aria-disabled",C()?"true":"false"),ae.disabled=C(),ae.multiple=z(),ae.name=q()},"UI.Upload:disabled"),H._upload=te,H._addFiles=y,H._browse=L,H._uploadFiles=p,H._input=ae,H._dispose=()=>{N||(N=!0,k())},(We=JSswift._registerCleanup)==null||We.call(JSswift,H,H._dispose),H},Ae.BoxUpload=(t={})=>Ae.Upload({...t,box:!0}),Ae.boxUpload=(t={})=>Ae.BoxUpload(t),JSswift.ui.Upload=Ae.Upload,JSswift.ui.BoxUpload=Ae.BoxUpload,JSswift.ui.boxUpload=Ae.boxUpload;function an(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=>{var s;return(s=t.action)==null||s.call(t,n),()=>{var c,S;const i=(S=(c=t._actions)==null?void 0:c.indexOf(n))!=null?S:-1;i>=0&&t._actions.splice(i,1)}}};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 gn={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"]}},yn=t=>{const e=o(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},zn=(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,a=[c&&s==="left"?"nav":i&&n==="left"?"aside":".","main",c&&s==="right"?"nav":i&&n==="right"?"aside":"."],b=[],M=[...t.rows||[]];if(c&&s==="top"&&!M.includes("nav")){const N=M.indexOf("body");M.splice(N>=0?N:M.length,0,"nav")}for(const N of M)N==="header"&&e.header?b.push(t.fullSide&&i&&n==="left"?["aside","header","header"]:t.fullSide&&i&&n==="right"?["header","header","aside"]:["header","header","header"]):N==="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"]):N==="body"?b.push(a):N==="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(N=>`"${N.join(" ")}"`).join(" "):null};Ae.Layout=(...t)=>{var os,is,ls;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(qe,pt)=>!!qe&&Object.prototype.hasOwnProperty.call(qe,pt),c=()=>typeof window=="undefined"?1024:window.innerWidth,S=()=>{const qe=c(),pt=JSswift.uiResponsivePropsFor(e,St("mobile"))||{},Ft=qe>=768?JSswift.uiResponsivePropsFor(e,St("tablet"))||{}:{},Gt=qe>=1024?JSswift.uiResponsivePropsFor(e,St("pc"))||{}:{};return{...pt,...Ft,...Gt}},u=(...qe)=>{for(const pt of qe)if(i(e,pt))return e[pt]},a=(...qe)=>{const pt=S();for(const Ft of qe)if(i(pt,Ft))return pt[Ft];return u(...qe)},b=(...qe)=>{const pt=JSswift.uiResponsivePropsFor(e,St(te()))||{};for(const Ft of qe)if(i(pt,Ft))return pt[Ft];return u(...qe)},M=()=>yn(b("disposition","layoutDisposition","layout")),N=()=>{const qe=o(a("mode","layoutMode"));if(qe==null||qe===!1||qe==="")return"";const pt=String(qe).trim().toLowerCase();return pt==="global"||pt==="local"?pt:""},C=(qe,pt=null)=>qe==null||qe===!1||qe===""?pt:typeof qe=="number"?`${qe}px`:String(qe),z=(qe,pt=null)=>{if(qe==null||qe===!1||qe==="")return pt;if(typeof qe=="number"&&Number.isFinite(qe))return qe;const Ft=Number.parseFloat(String(qe));return Number.isFinite(Ft)?Ft:pt},U=qe=>{const pt=o(qe);return pt==null||pt===!1||pt===""?null:Array.isArray(pt)?pt.map(Ft=>`"${Array.isArray(Ft)?Ft.join(" "):String(Ft)}"`).join(" "):String(pt)},W=(qe,pt=null,Ft=null)=>{let Gt=Number.isFinite(qe)?qe:0;return Number.isFinite(pt)&&(Gt=Math.max(pt,Gt)),Number.isFinite(Ft)&&(Gt=Math.min(Ft,Gt)),Gt},ge=u("header","headerContent"),B=u("aside","drawer"),ne=u("nav","asideRight","drawerRight"),he=u("page","main","content","body"),q=u("footer","footerContent"),se=()=>o(a("drawerEnabled","asideEnabled")),le=()=>o(a("navEnabled","asideRightEnabled","rightAsideEnabled")),fe=()=>se()!==!1,be=()=>le()===!0||o(a("noNav"))===!1,re=()=>o(a("noDrawer"))===!0||se()===!1||B===!1,ue=()=>o(a("noNav"))===!0||le()===!1||ne===!1,O=()=>o(a("drawerFloating"))===!0,Y=()=>o(a("navFloating"))===!0,oe=()=>o(a("drawerResizable"))===!0,we=()=>o(a("navResizable"))===!0,R=()=>z(o(a("drawerMinWidth")),180),h=()=>z(o(a("drawerMaxWidth")),null),m=()=>z(o(a("navMinWidth")),180),y=()=>z(o(a("navMaxWidth")),null),j=z(o(a("drawerWidth")),280),X=z((os=o(a("navWidth")))!=null?os:o(a("asideRightWidth")),280),[d,k]=JSswift.reactive.signal(W(j,R(),h())),[g,P]=JSswift.reactive.signal(W(X,m(),y())),K=an(e.drawerOpen,"UI.Layout:drawerOpen"),ee=K?!!K.get():typeof e.drawerOpen=="boolean"?!!e.drawerOpen:!0,[Ce,E]=JSswift.reactive.signal(ee),p=qe=>{const pt=!!qe;Ce()!==pt&&E(pt),K==null||K.set(pt)},A=(is=K==null?void 0:K.watch)==null?void 0:is.call(K,()=>{const qe=!!K.get();Ce()!==qe&&E(qe)}),L=an(e.navOpen,"UI.Layout:navOpen"),ae=L?!!L.get():typeof e.navOpen=="boolean"?!!e.navOpen:!0,[ke,Te]=JSswift.reactive.signal(ae),ze=qe=>{const pt=!!qe;ke()!==pt&&Te(pt),L==null||L.set(pt)},V=(ls=L==null?void 0:L.watch)==null?void 0:ls.call(L,()=>{const qe=!!L.get();ke()!==qe&&Te(qe)}),H=()=>{var Gt,tn,sn;const qe=Number((Gt=o(a("layoutBreakpoint")))!=null?Gt:0),pt=Number((tn=o(a("drawerBreakpoint")))!=null?tn:qe||1024),Ft=Number((sn=o(a("navBreakpoint")))!=null?sn:qe||pt);return Math.max(pt,Ft,0)},te=()=>{const qe=c();return qe>=1024?"pc":qe>=768?"tablet":"mobile"},[De,je]=JSswift.reactive.signal(!1),[_e,Me]=JSswift.reactive.signal(te()),Ie=()=>{typeof window!="undefined"&&(Me(te()),je(window.innerWidth<H()))};typeof window!="undefined"&&(Ie(),window.addEventListener("resize",Ie));const Ye=()=>({props:e,openAside:()=>p(!0),closeAside:()=>p(!1),toggleAside:()=>p(!Ce()),openNav:()=>ze(!0),closeNav:()=>ze(!1),toggleNav:()=>ze(!ke()),isDrawerOpen:()=>!!Ce(),isNavOpen:()=>!!ke(),isMobile:()=>!!De(),isDrawerFloating:()=>O(),isNavFloating:()=>Y()}),rt=(qe,pt)=>{const Ft=Ye();for(const tn of qe){if(!i(s,tn))continue;const sn=typeof s[tn]=="function"?s[tn](Ft):s[tn];return T(null,"default",Ft,sn)}const Gt=typeof pt=="function"?pt(Ft):pt;return T(null,"default",Ft,Gt)},Xe=he!==void 0?he:n,We=Z(["cms-app","cms-layout",JSswift.uiResponsiveClasses({mobile:e},_t),JSswift.uiResponsiveClasses(e,_t),e.class]),w=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"]);w.class=We,w.style={...e.style||{}},JSswift.uiApplyResponsiveProps(w,e,JSswift.uiResponsiveStyleRules);const ie=_.div(w);A&&JSswift._registerCleanup(ie,A),V&&JSswift._registerCleanup(ie,V);const F=o(a("tagPage"))===!0?{header:"header",aside:"aside",nav:"nav",page:"main",footer:"footer"}:{header:"div",aside:"div",nav:"div",page:"div",footer:"div"},f=_.div({class:Z(["cms-layout-shell-grid",e.shellClass])}),r=_[F.header]({class:Z(["cms-layout-section","cms-layout-header","header",ye(e.stickyHeader,"sticky"),e.headerClass])}),x=_[F.aside]({class:Z(["cms-layout-section","cms-layout-aside","aside",ye(e.stickyAside!==!1,"sticky"),e.asideClass]),role:"navigation","aria-hidden":"true"}),de=_.div({class:"cms-layout-panel-body cms-layout-aside-body"}),Be=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-drawer","aria-hidden":"true"});x.appendChild(de),x.appendChild(Be);const He=_[F.nav]({class:Z(["cms-layout-section","cms-layout-nav","nav",ye(e.stickyNav,"sticky"),e.navClass]),role:F.nav==="nav"?null:"complementary","aria-hidden":"true"}),Se=_.div({class:"cms-layout-panel-body cms-layout-nav-body"}),Oe=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-nav","aria-hidden":"true"});He.appendChild(Se),He.appendChild(Oe);const at=_[F.page]({class:Z(["cms-layout-section","cms-layout-main","main",e.pageClass]),role:F.page==="main"?null:"main"}),nt=_[F.footer]({class:Z(["cms-layout-section","cms-layout-footer","footer",ye(e.stickyFooter,"sticky"),e.footerClass])});f.appendChild(r),f.appendChild(x),f.appendChild(at),f.appendChild(He),f.appendChild(nt),ie.appendChild(f);const Ze=_.div({class:Z(["cms-aside-overlay",e.overlayClass]),onClick:()=>{o(a("overlayClose"))!==!1&&(Ce()&&p(!1),ke()&&ze(!1))}});ie.appendChild(Ze);let wt=!1,Nt=!1,Et=!1,Rt=!1,Mt=!1,vt=null,Dt=null;const ft=qe=>{!qe||typeof qe!="object"||(typeof qe._dispose=="function"&&qe._dispose(),!(!qe.childNodes||!qe.childNodes.length)&&Array.from(qe.childNodes).forEach(ft))},Ht=qe=>{qe&&Array.from(qe.childNodes).forEach(pt=>{ft(pt),pt.remove()})},qt=qe=>{const pt=Ye(),Ft=typeof qe=="function"?qe(pt):qe;return T(null,"default",pt,Ft)},Xt=()=>{const qe=wt?r.getBoundingClientRect().height:0;ie.style.setProperty("--layout-header-height",`${qe}px`)},Ot=(qe,pt)=>(Ht(qe),pt.forEach(Ft=>qe.appendChild(Ft)),pt.length>0),Qt=()=>{var Gt,tn,sn,v,ce,Je;ie.style.setProperty("--cms-layout-drawer-width",C((Gt=o(a("drawerWidth")))!=null?Gt:280,"280px")),ie.style.setProperty("--cms-layout-nav-width",C((sn=(tn=o(a("navWidth")))!=null?tn:o(a("asideRightWidth")))!=null?sn:280,"280px")),ie.style.setProperty("--cms-layout-drawer-peek",C((v=o(a("drawerPeek")))!=null?v:20,"20px")),ie.style.setProperty("--cms-layout-nav-peek",C((Je=(ce=o(a("navPeek")))!=null?ce:o(a("asideRightPeek")))!=null?Je:20,"20px"));const qe=C(o(a("gap")),null);qe!=null?ie.style.setProperty("--cms-layout-gap",qe):ie.style.removeProperty("--cms-layout-gap");const pt=C(o(a("headerOffset")),null);pt!=null&&ie.style.setProperty("--layout-header-height",pt);const Ft=C(o(a("minHeight")),null);Ft!=null?ie.style.setProperty("--cms-layout-min-height",Ft):ie.style.removeProperty("--cms-layout-min-height")},cn=()=>{if(oe()){const qe=W(d(),R(),h());qe!==d()&&k(qe),ie.style.setProperty("--cms-layout-drawer-width",`${qe}px`)}if(we()){const qe=W(g(),m(),y());qe!==g()&&P(qe),ie.style.setProperty("--cms-layout-nav-width",`${qe}px`)}},un=(qe,pt)=>{if(pt.button!==0)return;const Ft=qe==="drawer"?x:He;if(Ft.hidden)return;const Gt=qe==="drawer"?d:g,tn=qe==="drawer"?k:P,sn=qe==="drawer"?R:m,v=qe==="drawer"?h:y,ce=Ft.getBoundingClientRect(),Je=ce.width||Gt(),it=ct=>{const mt=qe==="drawer"?ct.clientX-ce.left:ce.right-ct.clientX;tn(W(mt||Je,sn(),v())),cn(),en()},lt=()=>{ie.classList.remove("is-resizing-layout"),document.removeEventListener("pointermove",it,!0),document.removeEventListener("pointerup",lt,!0),Dt=null};ie.classList.add("is-resizing-layout"),document.addEventListener("pointermove",it,!0),document.addEventListener("pointerup",lt,!0),Dt=lt,pt.preventDefault()},Zt=qe=>un("drawer",qe),pn=qe=>un("nav",qe);Be.addEventListener("pointerdown",Zt),Oe.addEventListener("pointerdown",pn);const en=()=>{const qe=!!De(),pt=!!Ce(),Ft=!!ke(),Gt=!re()&&fe()&&Nt,tn=!ue()&&be()&&Et,sn=Gt&&(qe||O()),v=tn&&(qe||Y()),ce=Gt&&pt,Je=tn&&Ft,it=ce&&!sn,lt=Je&&!v,ct=it&&oe(),mt=lt&&we(),Jt=ce&&sn||Je&&v;Qt(),cn(),ie.classList.toggle("is-mobile",qe),ie.classList.toggle("drawer-open",ce),ie.classList.toggle("nav-open",Je),ie.classList.toggle("no-drawer",!Gt),ie.classList.toggle("no-nav",!tn),ie.classList.toggle("has-header",wt),ie.classList.toggle("has-drawer",Gt),ie.classList.toggle("has-nav",tn),ie.classList.toggle("has-footer",Mt),ie.classList.toggle("drawer-floating",sn),ie.classList.toggle("nav-floating",v);const Yt=M(),ln=Yt?N():"";ie.dataset.disposition=Yt||"",ie.dataset.layoutMode=ln||"",ie.classList.toggle("has-disposition",!!Yt),ie.classList.toggle("mode-local",ln==="local"),ie.classList.toggle("mode-global",ln==="global"),r.classList.toggle("sticky",o(a("stickyHeader"))===!0),nt.classList.toggle("sticky",o(a("stickyFooter"))===!0),x.classList.toggle("sticky",o(a("stickyAside"))!==!1),He.classList.toggle("sticky",o(a("stickyNav"))===!0),r.hidden=!wt,nt.hidden=!Mt,at.hidden=!Rt,Ze.hidden=!(sn||v),Ze.classList.toggle("show",Jt),x.hidden=!Gt||!ce&&!sn,x.classList.toggle("open",ce),x.classList.toggle("is-floating",sn),x.classList.toggle("is-resizable",ct),x.setAttribute("aria-hidden",ce?"false":"true"),Be.hidden=!ct,He.hidden=!tn||!Je&&!v,He.classList.toggle("open",Je),He.classList.toggle("is-floating",v),He.classList.toggle("is-resizable",mt),He.setAttribute("aria-hidden",Je?"false":"true"),Oe.hidden=!mt;const nn=gn[Yt]||null,An=(nn==null?void 0:nn.side)||(it&&nn?"left":null),Sn=(nn==null?void 0:nn.nav)||(lt&&nn?"top":null),mn=it?nn?An:"left":"",Tn=lt?nn?Sn==="left"||Sn==="right"?Sn:"":"right":"";ie.classList.toggle("drawer-left",Gt&&An==="left"),ie.classList.toggle("drawer-right",Gt&&An==="right"),ie.classList.toggle("nav-top",lt&&Sn==="top"),ie.classList.toggle("nav-side",lt&&(Tn==="left"||Tn==="right")),f.style.gridTemplateColumns=[mn==="left"?"minmax(0, var(--cms-layout-drawer-width))":Tn==="left"?"minmax(0, var(--cms-layout-nav-width))":"0px","minmax(0, 1fr)",mn==="right"?"minmax(0, var(--cms-layout-drawer-width))":Tn==="right"?"minmax(0, var(--cms-layout-nav-width))":"0px"].join(" ");const qn=['"header header header"',`"${it?"aside":"."} main ${lt?"nav":"."}"`,'"footer footer footer"'].join(" "),Yn=zn(gn[Yt],{header:wt,aside:it,nav:lt,main:Rt,footer:Mt});f.style.gridTemplateAreas=U(b("areas","gridTemplateAreas","templateAreas"))||Yn||qn},rn=(qe,pt)=>(wt=Ot(r,qt(qe)),Xt(),en(),pt&&JSswift.router.setURLOnly(pt),r),Vn=(qe,pt)=>(Nt=Ot(de,qt(qe)),Nt||p(!1),en(),pt&&JSswift.router.setURLOnly(pt),x),dn=(qe,pt)=>(Et=Ot(Se,qt(qe)),Et||ze(!1),en(),pt&&JSswift.router.setURLOnly(pt),He),hs=(qe,pt)=>(Rt=Ot(at,qt(qe)),en(),pt&&JSswift.router.setURLOnly(pt),at),As=(qe,pt)=>(Mt=Ot(nt,qt(qe)),en(),pt&&JSswift.router.setURLOnly(pt),nt);wt=Ot(r,rt(["header"],ge)),Nt=Ot(de,B===!1?[]:rt(["aside","drawer"],B)),Et=Ot(Se,ne===!1?[]:rt(["nav","asideRight","drawerRight"],ne)),Rt=Ot(at,rt(["page","main","default"],Xe)),Mt=Ot(nt,rt(["footer"],q)),typeof ResizeObserver!="undefined"&&(vt=new ResizeObserver(()=>Xt()),vt.observe(r)),Xt(),JSswift.reactive.effect(()=>{_e(),De(),Ce(),ke(),en()},"UI.Layout:state");const ss=qe=>{o(a("escClose"))!==!1&&(!De()&&!O()&&!Y()||!Ce()&&!ke()||qe.key==="Escape"&&(qe.preventDefault(),Ce()&&p(!1),ke()&&ze(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",ss,!0),ie.openAside=()=>p(!0),ie.closeAside=()=>p(!1),ie.toggleAside=()=>p(!Ce()),ie.openNav=()=>ze(!0),ie.closeNav=()=>ze(!1),ie.toggleNav=()=>ze(!ke()),ie.isDrawerOpen=()=>!!Ce(),ie.isNavOpen=()=>!!ke(),ie.isMobile=()=>!!De(),ie.header=()=>r,ie.aside=()=>x,ie.drawer=()=>x,ie.nav=()=>He,ie.page=()=>at,ie.main=()=>at,ie.footer=()=>nt,ie.headerUpdate=rn,ie.asideUpdate=Vn,ie.drawerUpdate=Vn,ie.navUpdate=dn,ie.pageUpdate=hs,ie.mainUpdate=hs,ie.footerUpdate=As,ie.reflow=en,ie._dispose=()=>{var qe;typeof window!="undefined"&&window.removeEventListener("resize",Ie),typeof document!="undefined"&&document.removeEventListener("keydown",ss,!0),Be.removeEventListener("pointerdown",Zt),Oe.removeEventListener("pointerdown",pn),Dt==null||Dt(),(qe=vt==null?void 0:vt.disconnect)==null||qe.call(vt)},At(ie,e),en(),ie},Ae.Footer=(...t)=>{var we,R,h;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=m=>Object.prototype.hasOwnProperty.call(e,m),c={props:e},S=(m,y)=>{if(!(y==null||y===!1)){if(Array.isArray(y)){y.forEach(j=>S(m,j));return}if(y!=null&&y.nodeType){m.appendChild(y);return}m.appendChild(document.createTextNode(String(y)))}},u=(m,y,j=X=>X)=>{const X=JSswift.ui.getSlot(s,m);if(X!=null)return T(s,m,c,null);if(typeof y=="function"){const d=new Set(["eyebrow","title","subtitle"]),k=_[d.has(m)?"span":"div"]({class:`cms-footer-slot-${m}`});return JSswift.reactive.effect(()=>{const g=j(y(c)),P=xn(JSswift.ui.slot(g));k.replaceChildren(),Array.isArray(P)?P.forEach(K=>S(k,K)):S(k,P)},`UI.Footer:${m}`),[k]}return T(s,m,c,j(y))},a=(m,y="icon",j=e.iconSize||e.size||"md")=>m==null||m===!1?null:typeof m=="string"?Ae.Icon({name:m,size:j}):JSswift.ui.slot(m,{as:y}),b=i("left")?e.left:e.start,M=i("right")?e.right:e.end,N=i("title")?e.title:e.label,C=(R=(we=e.subtitle)!=null?we:e.description)!=null?R:e.note,z=i("content")?e.content:i("body")?e.body:n!=null&&n.length?n:null,U=[...u("left",b),...u("start",null)],W=u("icon",e.icon,a),ge=u("eyebrow",(h=e.eyebrow)!=null?h:e.kicker),B=u("title",N),ne=u("subtitle",C),he=u("meta",e.meta),q=(()=>{const m=u("content",null);return m.length?m:u("default",z)})(),se=[...u("center",null),...u("body",null)],le=[...u("right",M),...u("end",null)],fe=u("actions",e.actions),be=_.div({class:Z(["cms-footer-body",e.bodyClass,e.centerClass])},_.div({class:"cms-footer-heading"},W.length?_.div({class:"cms-footer-icon"},...W):null,_.div({class:"cms-footer-copy"},ge.length?_.div({class:Z(["cms-footer-eyebrow",e.eyebrowClass])},...ge):null,B.length?_.div({class:Z(["cms-footer-title",e.titleClass])},...B):null,ne.length?_.div({class:Z(["cms-footer-subtitle",e.subtitleClass])},...ne):null,q.length?_.div({class:Z(["cms-footer-content",e.contentClass])},...q):null),he.length?_.div({class:Z(["cms-footer-meta",e.metaClass])},...he):null)),re=[];se.length?re.push(_.div({class:Z(["cms-footer-body",e.bodyClass,e.centerClass])},...se)):(W.length||ge.length||B.length||ne.length||q.length||he.length)&&re.push(be),(le.length||fe.length)&&re.push(_.div({class:Z(["cms-footer-end",e.endClass])},...le,...fe.length?[_.div({class:Z(["cms-footer-actions",e.actionsClass])},...fe)]:[]));const ue=JSswift.omit(e,["actions","actionsClass","align","body","bodyClass","center","centerClass","content","contentClass","dense","description","divider","elevated","end","endClass","eyebrow","eyebrowClass","gap","icon","iconSize","kicker","label","left","meta","metaClass","minHeight","note","right","slots","stack","start","startClass","sticky","subtitle","subtitleClass","title","titleClass","wrap","justify"]);ue.class=Z(["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"),jt(e.align,"align-"),e.class]),ue.style={...e.style||{}};const O=Ge(e.justify);O!=null&&(ue.style.justifyContent=O);const Y=Ge(e.wrap,m=>m?"wrap":"nowrap");Y!=null&&(ue.style.flexWrap=Y),e.gap!=null&&(ue.style["--cms-footer-gap"]=gt(o(e.gap))),e.minHeight!=null&&(ue.style.minHeight=gt(o(e.minHeight))),JSswift.uiApplyResponsiveProps(ue,e,JSswift.uiResponsiveStyleRules);const oe=_.footer(ue,...U.length?[_.div({class:Z(["cms-footer-start",e.startClass])},...U)]:[],...re.length?[_.div({class:"cms-footer-main"},...re)]:[]);return At(oe,e),oe};const pl=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},Vs=(t,e)=>{const n=xn(JSswift.ui.slot(t,e));return n?Array.isArray(n)?n:[n]:[]},gt=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)};Ae.Toolbar=(...t)=>{var y,j,X,d,k,g,P,K;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(ee,Ce,E={})=>{const p=Array.isArray(ee)?ee:[ee];for(const A of p)if(JSswift.ui.getSlot(s,A)!=null)return T(s,A,E,Ce);return Ce==null?[]:T(null,"default",E,Ce)},c=ee=>(Array.isArray(ee)?ee:[ee]).some(E=>JSswift.ui.getSlot(s,E)!=null),S={props:e},u=i(["before"],e.before,S),a=i(["start","left"],(y=e.start)!=null?y:e.left,S),b=i(["center","body","content","default"],(d=(X=(j=e.center)!=null?j:e.body)!=null?X:e.content)!=null?d:n,S),M=i(["end","right","actions"],(g=(k=e.end)!=null?k:e.right)!=null?g:e.actions,S),N=i(["after"],e.after,S),C=i(["title"],e.title,S),z=i(["subtitle"],e.subtitle,S),U=i(["meta"],e.meta,S),W=!!(u.length||a.length||M.length||N.length||C.length||z.length||U.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"])),ge=Z(["cms-toolbar",ye(W,"structured"),ye(e.dense,"dense"),ye(e.divider,"divider"),ye(e.elevated,"elevated"),ye(e.sticky,"sticky"),e.class]),B=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"]);B.class=ge;const ne={...e.style||{}};ne.display=ne.display||"flex";const he=Ge(e.align),q=Ge(e.justify),se=Ge(e.wrap,ee=>typeof ee=="boolean"?ee?"wrap":"nowrap":String(ee),"wrap"),le=Ge(e.gap,gt,"var(--cms-s-md)"),fe=Qe(e,"gap");ne["--cms-toolbar-gap"]=le!=null?le:"var(--cms-s-md)",fe||(ne.gap=ne.gap||"var(--cms-toolbar-gap)");const be={xxs:"4px 6px",xs:"6px 8px",sm:"6px 10px",md:"10px 12px",lg:"12px 16px",xl:"14px 18px",xxl:"16px 20px"},re=Ge(e.size,ee=>be[ee]||"");if(re!=null&&(ne.padding=re),W?(ne.flexDirection=ne.flexDirection||"column",ne.alignItems=ne.alignItems||"stretch"):(he!=null&&(ne.alignItems=he),q!=null&&(ne.justifyContent=q),se!=null&&(ne.flexWrap=se)),Object.keys(ne).length&&(B.style=ne),JSswift.uiApplyResponsiveProps(B,e,JSswift.uiResponsiveStyleRules),!W){const ee=T(s,"default",S,n),Ce=_.div(B,...ee);return At(Ce,e),Ce}const ue=(K=(P=e.bodyClass)!=null?P:e.centerClass)!=null?K:e.contentClass,O=xt([e.justify],()=>{const ee=o(e.justify);return!ee||ee==="flex-start"?"auto":""}),Y={display:"flex",alignItems:"inherit",gap:"var(--cms-toolbar-gap)",flexWrap:"inherit",minWidth:0},oe={};he!=null&&(oe.alignItems=he),q!=null&&(oe.justifyContent=q),se!=null&&(oe.flexWrap=se);const we=U.length||C.length||z.length?_.div({class:Z(["cms-toolbar-copy",e.copyClass])},U.length?_.div({class:Z(["cms-toolbar-meta",e.metaClass])},...U):null,C.length?_.div({class:Z(["cms-toolbar-title",e.titleClass])},...C):null,z.length?_.div({class:Z(["cms-toolbar-subtitle",e.subtitleClass])},...z):null):null,R=!!(a.length||we||b.length||M.length),h=[u.length?_.div({class:Z(["cms-toolbar-before",e.beforeClass]),style:{...Y}},...u):null,R?_.div({class:"cms-toolbar-main",style:oe},a.length?_.div({class:Z(["cms-toolbar-start",e.startClass]),style:{...Y}},...a):null,we||b.length?_.div({class:Z(["cms-toolbar-center",ue]),style:{...Y,flex:"1 1 240px"}},we,...b):null,M.length?_.div({class:Z(["cms-toolbar-end",e.endClass]),style:{...Y,justifyContent:"flex-end",marginInlineStart:O}},...M):null):null,N.length?_.div({class:Z(["cms-toolbar-after",e.afterClass]),style:{...Y}},...N):null].filter(Boolean),m=_.div(B,...h);return At(m,e),m};const Fi=t=>{var e;return t&&t.nodeType===1&&((e=t.classList)==null?void 0:e.contains("cms-grid-col"))};Ae.Grid=(...t)=>{var m,y,j,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=o(e.items),c=Array.isArray(i)?i:i==null?[]:[i],S=(d={})=>{const k=e.itemProps||{},g={...k,...d};return g.class=Z([k.class,e.itemClass,d.class]),g.style={...k.style||{},...e.itemStyle||{},...d.style||{}},g},u=(d,k={})=>{if(d==null||d===!1)return[];if(Fi(d))return[d];if(Zn(d)){const g=d.children!=null?Rn(d.children):d.content!=null?Rn(d.content):d.node!=null?Rn(d.node):d.label!=null?Rn(d.label):[];return[Ae.GridCol(S(d),...g)]}return Array.isArray(d)?[Ae.GridCol(S(k),...d)]:[Ae.GridCol(S(k),d)]},a=(d,k,g,P=!0)=>{if(d==null||d===!1)return[];const K=Zn(d)?d:{};if(P){const ee={item:d,index:k,count:g,first:k===0,last:k===g-1},Ce=T(s,"item",ee,null);if(Ce.length)return Ce.flatMap(E=>u(E,K))}return u(d,K)},b=[];c.forEach((d,k)=>{b.push(...a(d,k,c.length))}),T(s,"default",{items:c,count:c.length},n).forEach(d=>{b.push(...u(d))}),b.length||T(s,"empty",{items:c,count:0},e.empty).forEach(k=>{const g=u(k,{style:{gridColumn:"1 / -1"}});b.push(...g)});const N=Z(["cms-grid",JSswift.uiResponsiveClasses({mobile:e},ot),JSswift.uiResponsiveClasses(e,ot),ye(e.dense,"dense"),ye(e.inline,"cms-grid-inline"),ye(e.debug,"cms-grid-debug"),e.class]),C=JSswift.omit(e,["gap","rowGap","columnGap","colGap","cols","columns","rows","areas","align","justify","alignItems","justifyItems","placeItems","placeContent","dense","flow","inline","debug","autoFit","autoFill","min","max","autoRows","items","itemClass","itemStyle","itemProps","empty","slots","full","width","minWidth","maxWidth","padding",...JSswift.uiResponsiveOmitProps]);C.class=N;const z={...e.style||{}};(m=JSswift.uiResponsiveHasConfig)!=null&&m.call(JSswift,e)&&e.display==null&&!Qe(e,"display")&&z.display==null&&(z.display=e.inline?"inline-grid":"grid");const U=Ge(e.gap,gt);U!=null&&!Qe(e,"gap")&&(z["--cms-grid-gap"]=U,z.gap=U);const W=Ge(e.rowGap,gt);W!=null&&!Qe(e,"rowGap")&&(z.rowGap=W);const ge=Ge((y=e.columnGap)!=null?y:e.colGap,gt);ge!=null&&!Qe(e,["columnGap","colGap"])&&(z.columnGap=ge);const B=Ge(e.max,gt,"1fr"),ne=Ge(e.min,gt);if(ne!=null){const d=o(e.autoFill)?"auto-fill":"auto-fit";z.gridTemplateColumns=`repeat(${d}, minmax(${ne}, ${B||"1fr"}))`}else{const d=Ge((j=e.columns)!=null?j:e.cols,k=>typeof k=="number"?`repeat(${k}, minmax(0, 1fr))`:String(k));d!=null&&!Qe(e,["cols","columns"])&&(z.gridTemplateColumns=d)}const he=Ge(e.rows,d=>typeof d=="number"?`repeat(${d}, minmax(0, auto))`:String(d));he!=null&&(z.gridTemplateRows=he);const q=Ge(e.autoRows,gt);q!=null&&(z.gridAutoRows=q);const se=Ge(e.flow,d=>{const k=String(d);return e.dense&&!k.includes("dense")?`${k} dense`:k});se!=null&&!Qe(e,"flow")&&(z.gridAutoFlow=se);const le=Ge(e.areas,d=>Array.isArray(d)?d.map(k=>`"${Array.isArray(k)?k.join(" "):String(k)}"`).join(" "):String(d));le!=null&&(z.gridTemplateAreas=le);const fe=Ge((X=e.align)!=null?X:e.alignItems);fe!=null&&!Qe(e,["align","alignItems"])&&(z.alignItems=fe);const be=Ge(e.justify);be!=null&&!Qe(e,"justify")&&(z.justifyContent=be);const re=Ge(e.justifyItems);re!=null&&(z.justifyItems=re);const ue=Ge(e.placeItems);ue!=null&&(z.placeItems=ue);const O=Ge(e.placeContent);O!=null&&(z.placeContent=O);const Y=Ge(e.width,gt);Y!=null&&!Qe(e,"width")&&(z.width=Y),o(e.full)===!0&&(z.width="100%");const oe=Ge(e.minWidth,gt);oe!=null&&!Qe(e,"minWidth")&&(z.minWidth=oe);const we=Ge(e.maxWidth,gt);we!=null&&!Qe(e,"maxWidth")&&(z.maxWidth=we);const R=Ge(e.padding,gt);R!=null&&!Qe(e,"padding")&&(z.padding=R),Object.keys(z).length&&(C.style=z),JSswift.uiApplyResponsiveProps(C,e,JSswift.uiResponsiveStyleRules);const h=_.div(C,...b);return At(h,e),h},Ae.GridCol=(...t)=>{var Ye,rt,Xe,We,w,ie,$e,F;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=f=>Object.prototype.hasOwnProperty.call(e,f),c=(f,r,x={})=>{const de=Array.isArray(f)?f:[f];for(const Be of de)if(JSswift.ui.getSlot(s,Be)!=null)return T(s,Be,x,r);return r==null?[]:T(null,"default",x,r)},S=f=>{var r;return f==null||f===!1||f===""?"":typeof f=="string"&&((r=JSswift.uiSizes)!=null&&r.includes(f))?`var(--cms-s-${f})`:gt(f)},u=f=>{var r;return f==null||f===!1||f===""?"":typeof f=="string"&&((r=JSswift.uiSizes)!=null&&r.includes(f))?Ne(f,"size"):gt(f)},a={...e.style||{}},b=f=>{if(f==null||f==="")return null;if(f==="auto")return"auto";if(f==="full"||f===!0)return"1 / -1";const r=Number(f);if(Number.isFinite(r)&&r>0){const x=Math.max(1,Math.round(r));return`span ${x} / span ${x}`}return String(f)},M=f=>{if(f==null||f==="")return null;if(f==="full"||f===!0)return"1 / -1";const r=Number(f);if(Number.isFinite(r)&&r>0){const x=Math.max(1,Math.round(r));return`span ${x} / span ${x}`}return String(f)},N=i("span")?e.span:e.col,C=Ge(N,b),z=Ge(e.sm,b),U=Ge(e.md,b),W=Ge(e.lg,b),ge=JSswift.uiResponsivePropsFor(e,St("tablet"))||{},B=JSswift.uiResponsivePropsFor(e,St("pc"))||{},ne=(Ye=ge.span)!=null?Ye:ge.col,he=(rt=B.span)!=null?rt:B.col,q=Ge(ne,b),se=Ge(he,b),le=Ge(e.rowSpan,M),fe=Ge(e.row,M),be=Ge(e.area),re=Ge(e.align),ue=Ge(e.justify),O=Ge(e.place),Y=Ge(e.gap,S),oe=Ge(e.rowGap,S),we=Ge(e.columnGap,S),R=Ge(e.padding,S),h=Ge(e.width,u),m=Ge(e.minHeight,u),y=Ge(e.height,u),j=Ge(e.maxHeight,u),X=Ge(e.contentAlign),d=Ge(e.contentJustify),k=Ge(e.direction),g=Ge(e.scroll,f=>f===!0?"auto":String(f),""),P=Ge(e.fullHeight,f=>f?"100%":"",""),K=xt([e.center,e.contentAlign,e.contentJustify],()=>!!o(e.center)&&(o(e.contentAlign)==null||o(e.contentAlign)==="")&&(o(e.contentJustify)==null||o(e.contentJustify)==="")),ee={props:e},Ce=c(["start","top","header","before"],(w=(We=(Xe=e.start)!=null?Xe:e.top)!=null?We:e.header)!=null?w:e.before,ee),E=i("body")?e.body:i("content")?e.content:n,p=c(["body","content","default"],E,ee),A=c(["end","bottom","footer","after"],(F=($e=(ie=e.end)!=null?ie:e.bottom)!=null?$e:e.footer)!=null?F:e.after,ee),L=Ce.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,ae=xt([e.stack,e.gap,e.rowGap,e.columnGap,e.contentAlign,e.contentJustify,e.direction,e.center],()=>L||o(e.stack)||[o(e.gap),o(e.rowGap),o(e.columnGap),o(e.contentAlign),o(e.contentJustify),o(e.direction)].some(r=>r!=null&&r!==!1&&r!=="")?!0:!!o(e.center)),ke=xt([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"]:[]),Te=Z(["cms-grid-col",ke,JSswift.uiResponsiveClasses({mobile:e},zt),JSswift.uiResponsiveClasses(e,zt),ye(e.panel,"cms-grid-col-panel"),ye(e.auto,"is-auto"),ye(ae,"cms-grid-col-stack"),ye(e.inline,"cms-grid-col-inline"),ye(K,"cms-grid-col-center"),e.class]),ze=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]);ze.class=Te,a["--cms-grid-col-base"]==null&&(a["--cms-grid-col-base"]="auto"),a["--cms-grid-col-tablet"]==null&&(a["--cms-grid-col-tablet"]="var(--cms-grid-col-base, auto)"),a["--cms-grid-col-pc"]==null&&(a["--cms-grid-col-pc"]="var(--cms-grid-col-tablet, var(--cms-grid-col-base, auto))"),o(e.auto)===!0?a["--cms-grid-col-base"]="auto":C!=null&&(a["--cms-grid-col-base"]=C),z!=null&&(a["--cms-grid-col-sm"]=z),U!=null&&(a["--cms-grid-col-md"]=U),W!=null&&(a["--cms-grid-col-lg"]=W),q!=null&&(a["--cms-grid-col-tablet"]=q),se!=null&&(a["--cms-grid-col-pc"]=se),le!=null?a.gridRow=le:fe!=null&&(a.gridRow=fe),be!=null&&(a.gridArea=be),re!=null&&!Qe(e,"align")&&(a.alignSelf=re),ue!=null&&!Qe(e,"justify")&&(a.justifySelf=ue),O!=null&&!Qe(e,"place")&&(a.placeSelf=O),Y!=null&&!Qe(e,"gap")&&(a.gap=Y),oe!=null&&!Qe(e,"rowGap")&&(a.rowGap=oe),we!=null&&!Qe(e,"columnGap")&&(a.columnGap=we),R!=null&&!Qe(e,"padding")&&(a.padding=R),h!=null&&!Qe(e,"width")&&(a.width=h),P!=null&&P!==""?a.height=P:y!=null&&!Qe(e,"height")&&(a.height=y),m!=null&&!Qe(e,"minHeight")&&(a.minHeight=m),j!=null&&!Qe(e,"maxHeight")&&(a.maxHeight=j),k!=null&&!Qe(e,"direction")&&(a.flexDirection=k),X!=null&&!Qe(e,"contentAlign")?a.alignItems=X:K!=null&&K!==""&&(a.alignItems=K?"center":""),d!=null&&!Qe(e,"contentJustify")?a.justifyContent=d:K!=null&&K!==""&&(a.justifyContent=K?"center":""),g!=null&&g!==""&&(a.overflow=g),Object.keys(a).length&&(ze.style=a),JSswift.uiApplyResponsiveProps(ze,e,$t);const V=e.onClick,H=e.onKeydown,te=!!(o(e.clickable)||o(e.to)),De=f=>{var x;if(V==null||V(f),f.defaultPrevented)return;const r=o(e.to);r&&((x=JSswift.router)!=null&&x.navigate)&&(f.preventDefault(),JSswift.router.navigate(r))},je=f=>{H==null||H(f),!f.defaultPrevented&&(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),De(f))};if(te&&(ze.onClick=De,ze.onKeydown=je,ze.tabIndex==null&&(ze.tabIndex=0),ze.role==null&&(ze.role="button")),!L){const f=_.div(ze,...T(s,"default",ee,n));return At(f,e),f}const _e={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},Me=[Ce.length?_.div({class:Z(["cms-grid-col-start",e.startClass,e.topClass,e.headerClass]),style:{..._e}},...Ce):null,p.length?_.div({class:Z(["cms-grid-col-body",e.bodyClass,e.contentClass]),style:{..._e,flex:"1 1 auto"}},...p):null,A.length?_.div({class:Z(["cms-grid-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{..._e}},...A):null].filter(Boolean),Ie=_.div(ze,...Me);return At(Ie,e),Ie},Ae.Icon=(...t)=>{var fe,be;let e={},n=[],s="home",i=!1;const c=t[0],S=t[1],u=re=>re&&typeof re=="object"&&!re.nodeType&&!Array.isArray(re)&&!(re instanceof Function);typeof c=="string"?(s=c,i=!0,u(S)?(e=S,t.length>2&&(n=t.slice(2))):t.length>1&&(n=t.slice(1))):u(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),vn(e);const a=e.slots||{},b=o(e.size),M=o(e.color),N=String(s).endsWith("-fill"),C={...e.style||{}},z=xt(e.size,()=>{const re=o(e.size);return typeof re=="string"&&fs[re]?re:""}),U=!!(e.color||e.clickable||e.border||e.glossy||e.glow||e.glass||e.shadow||e.outline||e.gradient||e.textGradient||e.lightShadow||e.radius),W={"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"}]}},ge=re=>{const ue=W[re];return ue?_.svg({width:"100%",height:"100%",viewBox:ue.viewBox,fill:"none","aria-hidden":"true",focusable:"false"},...ue.paths.map(O=>_.path(O))):null},B=re=>{const ue=o(e.tooltip);if(ue==null||ue===!1||!Ae.Tooltip)return re;const O=u(ue)?{...ue}:{text:ue};return u(e.tooltipProps)&&Object.assign(O,e.tooltipProps),Ae.Tooltip({...O,target:re})},ne=Z(["cms-icon","material-icons",...U?["cms-clear-set","cms-singularity"]:[],z,e.class]),he=JSswift.omit(e,["name","size","class","style","label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots","spriteUrl","tooltip","tooltipProps"]);if(he.class=ne,Object.keys(C).length&&(he.style=C),typeof s=="function"||s&&typeof s=="object"){const re=JSswift.ui.renderSlot(a,"default",{},s),ue=T(null,"default",{},re),O=_.span({...he,"data-icon":"custom"},...ue);return At(O,e),B(O)}const q=String(s),se=q.includes("#")?q:"";let le=null;if(se){const re=e.spriteUrl||((fe=JSswift.config)==null?void 0:fe.iconSpriteUrl)||(typeof globalThis!="undefined"?(be=globalThis.JSswift_setting)==null?void 0:be.iconSpriteUrl:null),ue=se.slice(se.indexOf("#")+1),O=re?_.svg({width:"100%",height:"100%"},_.use({href:re+se})):ge(ue)||_.svg({width:"100%",height:"100%"},_.use({href:se}));N&&(O.style.fill="currentColor"),le=_.span({...he,"data-icon":q},O,...n)}else le=_.span({...he,"data-icon":q},q,...n);if(b!=null){let re=b;JSswift.uiSizes.includes(b)&&(re=`var(--cms-icon-size-${b})`),re=typeof re=="number"?re+"px":String(re),le.style.setProperty("--set-icon-size",re)}return At(le,e),B(le)},Ae.Badge=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=xt(e.size,()=>{const W=o(e.size);return typeof W=="string"&&fs[W]?`cms-size-${W}`:""}),c=Z(["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 u={...e.style||{}};if(e.size){const W=o(e.size);typeof W=="string"&&fs[W]||(u.fontSize=gt(e.size))}S.style=u;const a=(W,ge,B)=>{const ne=Array.isArray(W)?W:[W];for(const he of ne)if(JSswift.ui.getSlot(s,he)!=null)return T(s,he,ge,B);return B==null||B===!1||B===""?[]:T(null,"default",ge,B)},b=()=>{var ge;const W=o((ge=e.iconSize)!=null?ge:e.size);return typeof W=="number"?Math.max(10,Math.round(W*.85)):typeof W=="string"&&{xxs:10,xs:11,sm:12,md:13,lg:14,xl:16,xxl:18,xxxl:20}[W]||14},M=(W,ge)=>{const B=o(W);return B==null||B===!1||B===""?null:typeof B=="string"?Ae.Icon({name:B,size:b()}):JSswift.ui.slot(B,{as:ge})},N=(W,ge,B)=>_.dynamic(()=>{const ne=M(e[ge],B),he=a(W,{position:B},ne);return he.length?_.span({class:`cms-badge-anchor cms-badge-anchor-${B}`,"data-badge-slot":B},...he):null}),C=_.dynamic(()=>{const W=o(e.label);let ge=a(["label"],{},W);return ge.length||(ge=a(["default"],{},n)),_.span({class:"cms-badge-content"},_.span({class:"cms-badge-label"},...ge.length?ge:[""]))}),z=_.dynamic(()=>{const W=o(e.notification),ge=W==null||W===!1||W===""?null:W,B=a(["notification"],{notification:W},ge);return B.length?_.span({class:"cms-badge-notification","data-badge-slot":"notification","aria-label":typeof W=="number"?`${W} notifications`:null},...B):null}),U=_.span(N(["left"],"left","left"),N(["centerLeft","center-left"],"centerLeft","center-left"),S,C,N(["topLeft","top-left"],"topLeft","top-left"),N(["topRight","top-right"],"topRight","top-right"),N(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),N(["bottomRight","bottom-right"],"bottomRight","bottom-right"),N(["centerRight","center-right"],"centerRight","center-right"),N(["right"],"right","right"),z);return(e.topLeft||e.centerLeft||e.bottomLeft)&&U.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&U.style.setProperty("padding-right","15px"),At(U,e),U};const Di=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(""):""},Go=(t,e)=>{const n=t==null||t===!0?e:t;if(n==null||n===!1)return Bt(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":Bt(s)||Bt(e)},Ko=(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)),$i=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=Go(null,e);return _.span({class:Z(["cms-avatar-status",s?`cms-state-${s}`:""])})}if(t instanceof Node||Array.isArray(t)||typeof t=="function")return t;const n=Go(t,e);return t===!0||n?_.span({class:Z(["cms-avatar-status",n?`cms-state-${n}`:""])}):Ko(t,"cms-avatar-badge")},mo=(t,e)=>!e||!e.length?null:_.span({class:Z(["cms-avatar-anchor",t])},...e);Ae.Avatar=(...t)=>{var y,j,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=xt(e.size,()=>{var k;const d=o(e.size);return typeof d=="string"&&((k=JSswift.uiSizes)!=null&&k.includes(d))?`cms-size-${d}`:""}),c=xt([e.color,e.state],()=>{const d=o(e.color)||o(e.state)||"",k=Bt(d);return k?`cms-state-${k}`:""}),S=Z(["cms-clear-set","cms-avatar","cms-singularity",i,c,ye(e.square,"cms-avatar-square"),ye(e.elevated,"elevated"),e.class]),u=JSswift.omit(e,["src","srcset","srcSet","sizes","alt","label","name","initials","text","size","fontSize","textSize","radius","rounded","square","elevated","icon","iconSize","media","fit","badge","notification","status","statusColor","presence","topLeft","topRight","bottomLeft","bottomRight","slots"]);u.class=S;const a={...e.style||{}},b=Ge(e.size,d=>{var k;return typeof d=="string"&&((k=JSswift.uiSizes)!=null&&k.includes(d))?"":gt(d)},"");b!=null&&(a.width=b,a.height=b);const M=(y=e.fontSize)!=null?y:e.textSize,N=M!=null?Ge(M,gt):Ge(e.size,d=>{var k;return typeof d=="string"&&((k=JSswift.uiSizes)!=null&&k.includes(d))?"":`clamp(11px, calc(${gt(d)} * 0.34), 28px)`},"");N!=null&&(a.fontSize=N);const C=Ge(e.radius,d=>{const k=Io(d);return k==="xxxl"?"999px":k?`var(--cms-r-${k})`:typeof d=="number"?`${d}px`:String(d)});C!=null&&(a["--set-border-radius"]=C),u.style=a;const z={props:e},U=xt([e.alt,e.label,e.name,e.text],()=>{const d=o(e.alt)||o(e.label)||o(e.name)||o(e.text)||"avatar";return String(d)}),W=e.icon!=null?typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,ge=xt([e.initials,e.text,e.label,e.name],()=>{var g,P;const d=(g=o(e.initials))!=null?g:o(e.text);if(d!=null)return d;const k=(P=o(e.label))!=null?P:o(e.name);return typeof k=="string"?Di(k):k}),B=Ko(o((j=e.badge)!=null?j:e.notification)),ne=$i(o((X=e.status)!=null?X:e.presence),o(e.statusColor));let he=T(s,"media",z,e.media);if(!he.length&&e.src){const d={class:"cms-avatar-img",src:e.src,alt:U,sizes:e.sizes,style:{}};e.srcset!=null&&(d.srcset=e.srcset),e.srcSet!=null&&(d.srcset=e.srcSet);const k=Ge(e.fit);k!=null&&(d.style.objectFit=k),he=[_.img(d)]}const q=T(s,"default",z,n),se=T(s,"fallback",z,null),le=T(s,"label",z,ge),fe=T(s,"icon",z,W),be=he.length?he:q.length?q:se.length?se:le.length?le:fe.length?fe:["?"],re=he.length?"cms-avatar-media":"cms-avatar-fallback",ue=_.span({class:"cms-avatar-body"},_.span({class:re},...be));let O=T(s,"topLeft",z,e.topLeft),Y=T(s,"topRight",z,e.topRight),oe=T(s,"bottomLeft",z,e.bottomLeft),we=T(s,"bottomRight",z,e.bottomRight);const R=T(s,"badge",z,B),h=T(s,"status",z,ne);!Y.length&&R.length&&(Y=R),!we.length&&h.length&&(we=h);const m=_.div(u,ue,mo("cms-avatar-anchor-top-left",O),mo("cms-avatar-anchor-top-right",Y),mo("cms-avatar-anchor-bottom-left",oe),mo("cms-avatar-anchor-bottom-right",we));return At(m,e),m},Ae.Chip=(...t)=>{var ge,B,ne,he;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=xt(e.size,()=>{const q=o(e.size);return typeof q=="string"&&fs[q]?q:""}),c=Z(["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 u=e.icon?typeof e.icon=="string"?Ae.Icon({name:e.icon,size:(ge=e==null?void 0:e.size)!=null?ge:null}):JSswift.ui.slot(e.icon,{as:"icon"}):null,a=e.iconRight?typeof e.iconRight=="string"?Ae.Icon({name:e.iconRight,size:(B=e==null?void 0:e.size)!=null?B:null}):JSswift.ui.slot(e.iconRight,{as:"iconRight"}):null,b=JSswift.ui.renderSlot(s,"icon",{},u),M=JSswift.ui.renderSlot(s,"iconRight",{},a),N=T(s,"label",{},e.label),C=N.length?N:T(s,"default",{},n),z=T(null,"default",{},b),U=T(null,"default",{},M),W=_.span(S,...z,...C.length?C:[""],...U);if(e.removable){const q=Ae.Btn({class:"cms-chip-remove",onClick:e.onRemove,size:(ne=e==null?void 0:e.size)!=null?ne:null},Ae.Icon({size:(he=e==null?void 0:e.size)!=null?he:null,name:"close"}));W.appendChild(q),q.onclick=()=>{e.onRemove&&e.onRemove(),W.remove()}}return At(W,e),W},Ae.Stat=(...t)=>{var fe,be;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Bt(o(e.state)||o(e.color)||""),c=xt([e.state,e.color],()=>{const re=i();return re?`cms-state-${re}`:""}),S=xt(e.trend,()=>{const re=String(o(e.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(re)?"is-positive":["down","negative","danger","loss","decrease"].includes(re)?"is-negative":["flat","neutral","steady","stable"].includes(re)?"is-neutral":""}),u={...e},a=JSswift.omit(u,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","meta","note","slots","state","subtitle","title","trend","value"]);a.class=Z(["cms-clear-set","cms-stat","cms-singularity",c,S,u.class]),a.style={...u.style||{}};const b=(re,ue,O={})=>T(s,re,O,ue),M=e.icon==null?null:typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||"md"}):JSswift.ui.slot(e.icon,{as:"icon"}),N=b("eyebrow",e.eyebrow),C=b("label",(fe=e.label)!=null?fe:e.title),z=b("value",e.value),U=b("note",(be=e.note)!=null?be:e.subtitle),W=b("meta",e.meta),ge=b("delta",e.delta,{trend:e.trend}),B=b("icon",M),ne=b("aside",e.aside),he=b("footer",e.footer),q=b("actions",e.actions),se=b("default",n),le=_.article(a,_.div({class:"cms-stat-head"},_.div({class:"cms-stat-lead"},B.length?_.div({class:"cms-stat-icon"},...B):null,_.div({class:"cms-stat-copy"},N.length?_.div({class:"cms-stat-eyebrow"},...N):null,C.length?_.div({class:"cms-stat-label"},...C):null)),ne.length?_.div({class:"cms-stat-aside"},...ne):null),_.div({class:"cms-stat-body"},z.length?_.div({class:"cms-stat-value"},...z):null,ge.length?_.div({class:"cms-stat-delta"},...ge):null,U.length?_.div({class:"cms-stat-note"},...U):null,W.length?_.div({class:"cms-stat-meta"},...W):null,se.length?_.div({class:"cms-stat-extra"},...se):null),he.length||q.length?_.div({class:"cms-stat-footer"},he.length?_.div({class:"cms-stat-footer-copy"},...he):null,q.length?_.div({class:"cms-stat-actions"},...q):null):null);return At(le,e),le},Ae.Kpi=(...t)=>{var fe,be;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Bt(o(e.state)||o(e.color)||""),c=xt([e.state,e.color],()=>{const re=i();return re?`cms-state-${re}`:""}),S={...e},u=JSswift.omit(S,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","media","meta","note","slots","state","subtitle","title","trend","value"]);u.class=Z(["cms-clear-set","cms-kpi","cms-singularity",c,S.class]),u.style={...S.style||{}};const a=(re,ue,O={})=>T(s,re,O,ue),b=e.icon==null?null:typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||"lg"}):JSswift.ui.slot(e.icon,{as:"icon"}),M=a("eyebrow",e.eyebrow),N=a("title",(fe=e.title)!=null?fe:e.label),C=a("value",e.value),z=a("delta",e.delta,{trend:e.trend}),U=a("note",(be=e.note)!=null?be:e.subtitle),W=a("meta",e.meta),ge=a("icon",b),B=a("aside",e.aside),ne=a("media",e.media),he=a("footer",e.footer),q=a("actions",e.actions),se=a("default",n),le=_.section(u,_.div({class:"cms-kpi-head"},_.div({class:"cms-kpi-title-wrap"},ge.length?_.div({class:"cms-kpi-icon"},...ge):null,_.div({class:"cms-kpi-copy"},M.length?_.div({class:"cms-kpi-eyebrow"},...M):null,N.length?_.div({class:"cms-kpi-title"},...N):null)),B.length?_.div({class:"cms-kpi-aside"},...B):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},C.length?_.div({class:"cms-kpi-value"},...C):null,z.length?_.div({class:"cms-kpi-delta"},...z):null),U.length?_.div({class:"cms-kpi-note"},...U):null,W.length?_.div({class:"cms-kpi-meta"},...W):null,ne.length?_.div({class:"cms-kpi-media"},...ne):null,se.length?_.div({class:"cms-kpi-extra"},...se):null),he.length||q.length?_.div({class:"cms-kpi-footer"},he.length?_.div({class:"cms-kpi-footer-copy"},...he):null,q.length?_.div({class:"cms-kpi-actions"},...q):null):null);return At(le,e),le};const Vi=(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=Vi(t.panel,180);setTimeout(n,i+40)};Ae.List=(...t)=>{var B;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=!!o((B=e.number)!=null?B:e.ordered),c=o(e.marker),S=o(e.items),u=Array.isArray(S)?S:S==null?[]:[S],a=(ne={})=>{const he=e.itemProps||{},q={...he,...ne};return e.divider!=null&&q.divider==null&&(q.divider=e.divider),q.class=Z([he.class,e.itemClass,ne.class]),q.style={...he.style||{},...e.itemStyle||{},...ne.style||{}},q},b=ne=>{if(ne==null||ne===!1)return[];if(ws(ne))return[ne];if(Zn(ne)){const he=ne.children!=null?Rn(ne.children):ne.content!=null?Rn(ne.content):Rn(ne.node);return[Ae.Item(a(ne),...he)]}return Array.isArray(ne)?[Ae.Item(a(),...ne)]:ne!=null&&ne.nodeType?[Ae.Item(a(),ne)]:[Ae.Item(a(),ne)]},M=(ne,he,q,se=!0)=>{if(ne==null||ne===!1)return[];if(se){const le={item:ne,index:he,count:q,first:he===0,last:he===q-1},fe=T(s,"item",le,null);if(fe.length)return fe.flatMap(be=>b(be))}return b(ne)},N=[];u.forEach((ne,he)=>{N.push(...M(ne,he,u.length))});const C=T(s,"default",{items:u,count:u.length},n);if(C.forEach((ne,he)=>{N.push(...M(ne,u.length+he,u.length+C.length,!1))}),!N.length){const ne=T(s,"empty",{items:u,count:0},e.empty);ne.length&&(ne.length===1&&ws(ne[0])?N.push(ne[0]):N.push(Ae.Item({class:"cms-item-empty",flat:!0},...ne)))}const z=Z(["cms-list",ye(e.dense,"dense"),ye(e.divider,"divider"),ye(c===!1||c==="none","cms-list-no-marker"),e.class]),U=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);U.class=z,U.style={...e.style||{}};const W=Ge(e.gap,gt);return W!=null&&(U.style["--cms-list-gap"]=W),c!=null&&c!==!1&&c!==!0&&c!=="none"&&(U.style.listStyleType=String(c)),_[i?"ol":"ul"](U,...N)},Ae.Item=(...t)=>{var R,h,m,y,j,X,d,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t);e.state!=null&&e.color==null&&(e.color=e.state),vn(e);const s=e.slots||{},i=xt([e.clickable,e.to],()=>!!(o(e.clickable)||o(e.to))),c=xt([e.active,e.selected],()=>!!(o(e.active)||o(e.selected))),S=!!(e.color!=null||e.outline||e.border||e.glossy||e.glow||e.glass||e.shadow||e.gradient||e.textGradient||e.lightShadow||e.radius||e.rounded||e.flat),u=(g,P,K)=>{const ee=o(g);return ee==null||ee===!1||ee===""?null:typeof ee=="string"?Ae.Icon({name:ee,size:P||"sm"}):JSswift.ui.slot(ee,{as:K})},a=T(s,"icon",{},u(e.icon,e.iconSize||e.size,"icon")),b=T(s,"title",{},(R=e.title)!=null?R:e.label),M=T(s,"subtitle",{},(m=(h=e.subtitle)!=null?h:e.caption)!=null?m:e.description),N=T(s,"meta",{},(y=e.meta)!=null?y:e.eyebrow),C=T(s,"body",{},(j=e.body)!=null?j:e.content),z=T(s,"default",{},n),U=T(s,"actions",{},(X=e.actions)!=null?X:e.footer),W=(k=(d=e.aside)!=null?d:e.trailing)!=null?k:u(e.iconRight,e.iconSize||e.size,"iconRight"),ge=T(s,"aside",{},W),B=[...C,...z],ne=!(S||e.clickable||e.to||a.length||b.length||M.length||N.length||U.length||ge.length||C.length),he=Z(["cms-item",ye(e.divider,"divider"),ye(S,"cms-clear-set"),ye(S,"cms-singularity"),ye(S,"cms-item-surface"),ye(ne,"cms-item-inline"),ye(i,"cms-item-clickable"),ye(c,"is-active"),ye(e.disabled,"is-disabled"),e.class]),q=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"]);q.class=he,q.style={...e.style||{}};const se=e.onClick,le=e.onKeydown,fe=g=>{var K;if(se==null||se(g),g.defaultPrevented||o(e.disabled))return;const P=o(e.to);P&&((K=JSswift.router)!=null&&K.navigate)&&(g.preventDefault(),JSswift.router.navigate(P))},be=g=>{le==null||le(g),!(g.defaultPrevented||o(e.disabled))&&(g.key==="Enter"||g.key===" ")&&(g.preventDefault(),fe(g))};o(e.disabled)&&(q["aria-disabled"]="true"),(o(e.clickable)||o(e.to))&&(q.onClick=fe,q.onKeydown=be,q.tabIndex==null&&(q.tabIndex=o(e.disabled)?-1:0),q.role==null&&(q.role="button"));const re=b.length?_.div({class:"cms-item-title"},...b):null,ue=M.length?_.div({class:"cms-item-subtitle"},...M):null,O=N.length?_.div({class:"cms-item-meta"},...N):null,Y=B.length?_.div({class:Z(["cms-item-body",ye(!(b.length||M.length||N.length),"is-standalone")])},...B):null,oe=U.length?_.div({class:"cms-item-actions"},...U):null,we=_.li(q,_.div({class:"cms-item-row"},a.length?_.div({class:"cms-item-icon"},...a):null,_.div({class:"cms-item-main"},O,re,ue,Y,oe),ge.length?_.div({class:"cms-item-aside"},...ge):null));return At(we,e),we},Ae.Separator=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=Z(["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 u=gt(c);S?i.width=u:i.height=u}return s.style=i,_.hr(s)},Ae.Banner=(...t)=>{var we;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Bt(o(e.type)||o(e.state)||""),c={state:i,dismissible:()=>!!o(e.dismissible)},S=xt([e.type,e.state],()=>i()),u=xt(e.variant,()=>{const R=String(o(e.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(R)?`cms-banner-${R}`:""}),a=xt([e.actionsPlacement,e.stack],()=>String(o(e.actionsPlacement)||"").toLowerCase()==="bottom"||o(e.stack)?"cms-banner-actions-bottom":""),b=xt(e.stack,()=>o(e.stack)?"cms-banner-stack":""),M={...e},N=JSswift.omit(M,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);N.class=Z(["cms-clear-set","cms-banner","cms-singularity",S,u,a,b,M.class]),N.style={...M.style||{}};const C=R=>{if(R==null||R==="")return"";const h=o(R);if(h==null||h==="")return"";const m=String(h);return In(m)?`var(--cms-${m})`:m};(e.accent!=null||Ke(e.accent))&&(N.style["--cms-banner-accent"]=()=>C(e.accent),N.style["--cms-banner-border"]=()=>{const R=C(e.accent);return R?`color-mix(in srgb, ${R} 38%, var(--cms-border-color))`:""},N.style["--cms-banner-bg"]=()=>{const R=C(e.accent);return R?`color-mix(in srgb, ${R} 14%, var(--cms-panel))`:""},N.style["--cms-banner-color"]=()=>{const R=C(e.accent);return R?`color-mix(in srgb, ${R} 78%, white)`:""});const z={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},U=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||e.size||"md"}):JSswift.ui.slot(e.icon,{as:"icon"});const R=i(),h=R?z[R]:null;return h?Ae.Icon({name:h,size:e.iconSize||e.size||"md"}):null})(),W=T(s,"title",c,e.title),ge=T(s,"message",c,e.message!=null?e.message:n),B=T(s,"description",c,(we=e.description)!=null?we:e.subtitle),ne=T(s,"meta",c,e.meta),he=T(s,"default",c,e.body!=null?[e.body,...n||[]]:e.message!=null?n:null),q=T(s,"icon",c,U),se=T(s,"aside",c,e.aside),le=T(s,"actions",c,e.actions),fe=T(s,"dismiss",c,e.dismiss),be=String(o(e.actionsPlacement)||"").toLowerCase()==="bottom"||!!o(e.stack),re=!!o(e.dismissible)||!!e.onDismiss;let ue=null;const O=re?Ae.Btn({class:"cms-banner-close",outline:!0,size:e.size||"sm","aria-label":e.closeLabel||"Chiudi banner",onClick:R=>{var h;(h=e.onDismiss)==null||h.call(e,R),!R.defaultPrevented&&(ue==null||ue.remove())}},Ae.Icon({name:"close",size:e.size||"sm"})):null,Y=[...se,...be?[]:le,...fe.length?fe:O?[O]:[]];ue=_.div(N,q.length?_.div({class:"cms-banner-icon"},...q):null,_.div({class:"cms-banner-body"},_.div({class:"cms-banner-copy"},W.length?_.div({class:"cms-banner-title"},...W):null,ge.length?_.div({class:"cms-banner-message"},...ge):null,B.length?_.div({class:"cms-banner-description"},...B):null,he.length?_.div({class:"cms-banner-extra"},...he):null,ne.length?_.div({class:"cms-banner-meta"},...ne):null),be&&le.length?_.div({class:"cms-banner-actions"},...le):null),Y.length?_.div({class:"cms-banner-side"},...Y):null);const oe=N.role||(()=>{const R=i();return R==="danger"||R==="warning"?"alert":"status"})();return ue.setAttribute("role",oe),At(ue,e),ue},Ae.Alert=(...t)=>{var q;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Bt(o(e.type)||o(e.state)||o(e.color)||"warning"),c=xt([e.type,e.state,e.color],()=>{const se=i();return se?`cms-state-${se}`:""}),S={...e},u=JSswift.omit(S,["actions","aside","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","state","subtitle","title","type","variant"]);u.class=Z(["cms-clear-set","cms-alert","cms-singularity",c,ye(e.dismissible,"is-dismissible"),S.class]),u.style={...S.style||{}};const a={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"?Ae.Icon({name:e.icon,size:e.iconSize||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"});const se=a[i()]||a.warning;return Ae.Icon({name:se,size:e.iconSize||"sm"})})(),M=T(s,"title",{},e.title),N=T(s,"message",{},e.message!=null?e.message:n),C=T(s,"description",{},(q=e.description)!=null?q:e.subtitle),z=T(s,"meta",{},e.meta),U=T(s,"actions",{},e.actions),W=T(s,"aside",{},e.aside),ge=T(s,"icon",{},b),B=T(s,"dismiss",{},e.dismiss);let ne=null;const he=e.dismissible||e.onDismiss?Ae.Btn({class:"cms-alert-close",outline:!0,size:"sm","aria-label":e.closeLabel||"Chiudi alert",onClick:se=>{var le;(le=e.onDismiss)==null||le.call(e,se),!se.defaultPrevented&&(ne==null||ne.remove())}},Ae.Icon({name:"close",size:"sm"})):null;return ne=_.div(u,ge.length?_.div({class:"cms-alert-icon"},...ge):null,_.div({class:"cms-alert-body"},M.length?_.div({class:"cms-alert-title"},...M):null,N.length?_.div({class:"cms-alert-message"},...N):null,C.length?_.div({class:"cms-alert-description"},...C):null,z.length?_.div({class:"cms-alert-meta"},...z):null,U.length?_.div({class:"cms-alert-actions"},...U):null),W.length||B.length||he?_.div({class:"cms-alert-side"},...W,...B.length?B:he?[he]:[]):null),ne.setAttribute("role",i()==="danger"||i()==="warning"?"alert":"status"),At(ne,e),ne},Ae.EmptyState=(...t)=>{var he;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>Bt(o(e.state)||o(e.color)||""),c=xt([e.state,e.color],()=>{const q=i();return q?`cms-state-${q}`:""}),S={...e},u=JSswift.omit(S,["actions","description","eyebrow","icon","iconSize","illustration","media","message","meta","slots","state","title"]);u.class=Z(["cms-clear-set","cms-empty-state","cms-singularity",c,ye(e.compact,"compact"),ye(e.inline,"inline"),S.class]),u.style={...S.style||{}};const a=e.icon===!1?null:e.icon!=null?typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||"xl"}):JSswift.ui.slot(e.icon,{as:"icon"}):Ae.Icon({name:"inbox",size:e.iconSize||"xl"}),b=T(s,"illustration",{},(he=e.illustration)!=null?he:e.media),M=T(s,"icon",{},a),N=T(s,"eyebrow",{},e.eyebrow),C=T(s,"title",{},e.title),z=T(s,"message",{},e.message!=null?e.message:n),U=T(s,"description",{},e.description),W=T(s,"meta",{},e.meta),ge=T(s,"actions",{},e.actions),B=T(s,"default",{},e.message!=null?n:null),ne=_.section(u,b.length?_.div({class:"cms-empty-state-illustration"},...b):null,M.length?_.div({class:"cms-empty-state-icon"},...M):null,N.length?_.div({class:"cms-empty-state-eyebrow"},...N):null,C.length?_.div({class:"cms-empty-state-title"},...C):null,z.length?_.div({class:"cms-empty-state-message"},...z):null,U.length?_.div({class:"cms-empty-state-description"},...U):null,W.length?_.div({class:"cms-empty-state-meta"},...W):null,B.length?_.div({class:"cms-empty-state-extra"},...B):null,ge.length?_.div({class:"cms-empty-state-actions"},...ge):null);return At(ne,e),ne};let Gn="jsswift:drawer-open";const qo=new Set,Po=new Map,ns=(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}},Bi=(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=ns();const Fn=(t,e=Gn)=>{_n=!!t;const n=Po.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 qo.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)}),Bi(_n,e),_n};Ae.Tooltip=(...t)=>{var oe,we;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{};let i=null,c=null,S=null,u=null;const a=R=>Object.prototype.hasOwnProperty.call(e,R),b=a("target")||a("anchorEl")||a("triggerEl"),M=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),N=(R,h)=>{const m=o(R);if(m==null||m==="")return h;const y=Number(m);return Number.isFinite(y)?y:h},C=()=>{clearTimeout(c),clearTimeout(S),c=null,S=null},z=()=>N(e.delay,350),U=()=>N(e.hideDelay,o(e.interactive)?120:0),W=()=>{if(C(),!i)return;const R=i;i=null,ks(R,()=>JSswift.overlay.close(R.id))},B=(R=>{if(R==null||R===!0)return new Set(["hover","focus"]);if(R===!1)return new Set(["manual"]);const h=Array.isArray(R)?R:String(R).split(/[\s,|/]+/),m=new Set;return h.forEach(y=>{const j=String(y||"").trim().toLowerCase();j&&(j==="mouseenter"||j==="mouseover"?m.add("hover"):j==="blur"||j==="focusin"?m.add("focus"):j==="tap"?m.add("click"):m.add(j))}),m.size?m:new Set(["manual"])})((we=(oe=e.trigger)!=null?oe:e.triggers)!=null?we:a("open")?"manual":null),ne=B.has("hover"),he=B.has("focus"),q=B.has("click"),se=B.has("manual")||!ne&&!he&&!q,le=()=>{var K,ee,Ce,E,p,A;const R={anchorEl:u||M||null,close:()=>W(),hide:()=>W(),isOpen:()=>!!i},h=e.icon?typeof e.icon=="string"?Ae.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,m=T(s,"title",R,(K=e.title)!=null?K:e.heading),y=T(s,"icon",R,h),j=T(s,"footer",R,(ee=e.footer)!=null?ee:e.actions);let X=(A=(p=(E=(Ce=e.content)!=null?Ce:e.text)!=null?E:e.body)!=null?p:e.description)!=null?A:e.label;X==null&&(b?X=n:M&&n&&n.length>1?X=n.slice(1):M||(X=n));let d=T(s,"content",R,X);d.length||(d=T(s,"default",R,X));const k=d.length?_.div({class:"cms-tooltip-body"},...d):null,g=y.length||m.length?_.div({class:"cms-tooltip-head"},y.length?_.div({class:"cms-tooltip-icon"},...y):null,_.div({class:"cms-tooltip-head-main"},m.length?_.div({class:"cms-tooltip-title"},...m):null,k)):k,P=j.length?_.div({class:"cms-tooltip-footer"},...j):null;return _.div({class:"cms-tooltip-content"},...[g,P].filter(Boolean))},fe=R=>{var d,k,g,P,K,ee;const h=R||u;if(!h||o(e.disabled))return null;if(i&&i._anchorEl===h)return i;i&&W();const m=(d=e.closeOnOutside)!=null?d:q||o(e.interactive),y=(k=e.closeOnEsc)!=null?k:q||o(e.interactive);let j=null;if(i=JSswift.overlay.open(()=>le(),{type:"tooltip",anchorEl:h,placement:e.placement||"top",offsetX:(g=e.offsetX)!=null?g:0,offsetY:(K=(P=e.offsetY)!=null?P:e.offset)!=null?K:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:m,closeOnBackdrop:!1,closeOnEsc:y,autoFocus:!1,className:Kt(["cms-tooltip",ye(e.interactive,"interactive"),e.class,e.panelClass]),onClose:()=>{var Ce,E;(Ce=j==null?void 0:j._tooltipCleanup)==null||Ce.call(j),i===j&&(i=null),(E=e.onClose)==null||E.call(e)}}),!(i!=null&&i.panel))return i;const X=i;if(j=X,X._anchorEl=h,X.panel.dataset.placement=String(o(e.placement||"top")),e.maxWidth!=null&&(X.panel.style.maxWidth=gt(o(e.maxWidth))),e.minWidth!=null&&(X.panel.style.minWidth=gt(o(e.minWidth))),e.width!=null&&(X.panel.style.width=gt(o(e.width))),e.style&&Object.assign(X.panel.style,e.style),At(X.panel,e),o(e.interactive)){const Ce=()=>{clearTimeout(S),S=null},E=()=>re(),p=A=>{const L=A.target;L&&L.closest&&L.closest("[data-tooltip-close]")&&W()};X.panel.addEventListener("mouseenter",Ce),X.panel.addEventListener("mouseleave",E),X.panel.addEventListener("focusin",Ce),X.panel.addEventListener("focusout",E),X.panel.addEventListener("click",p),X._tooltipCleanup=()=>{var A,L,ae,ke,Te;(A=X.panel)==null||A.removeEventListener("mouseenter",Ce),(L=X.panel)==null||L.removeEventListener("mouseleave",E),(ae=X.panel)==null||ae.removeEventListener("focusin",Ce),(ke=X.panel)==null||ke.removeEventListener("focusout",E),(Te=X.panel)==null||Te.removeEventListener("click",p)}}return _s(X),(ee=e.onOpen)==null||ee.call(e,X),X},be=R=>{clearTimeout(S),S=null,clearTimeout(c),c=setTimeout(()=>fe(R),z())},re=(R=!1)=>{if(clearTimeout(c),c=null,!!i){if(clearTimeout(S),R){W();return}S=setTimeout(()=>W(),U())}},ue=R=>{i?re(!0):fe(R)},O=()=>!!i,Y=R=>{if(!R)return()=>{};u=R;const h=[],m=()=>{C(),h.forEach(y=>y())};if(a("open"))return Ke(e.open)?JSswift.reactive.effect(()=>{u&&(o(e.open)?fe(u):re(!0))},"UI.Tooltip:open"):e.open===!0?fe(R):e.open===!1&&re(!0),m;if(se||o(e.disabled))return m;if(ne){const y=()=>be(R),j=()=>re();R.addEventListener("mouseenter",y),R.addEventListener("mouseleave",j),h.push(()=>{R.removeEventListener("mouseenter",y),R.removeEventListener("mouseleave",j)})}if(he){const y=()=>be(R),j=()=>re();R.addEventListener("focus",y),R.addEventListener("blur",j),h.push(()=>{R.removeEventListener("focus",y),R.removeEventListener("blur",j)})}if(q){const y=j=>{var X;(X=e.onTriggerClick)==null||X.call(e,j),!j.defaultPrevented&&ue(R)};R.addEventListener("click",y),h.push(()=>R.removeEventListener("click",y))}return m};if(M){const R=Z(["cms-tooltip-wrap",e.wrapClass,e.targetClass]),h=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"]);h.class=R,h.style={display:"inline-flex",alignItems:"center",...e.wrapStyle||e.targetStyle||{}};const m=JSswift.ui.renderSlot(s,"target",{open:()=>fe(u),show:()=>be(u),hide:()=>re(!0),toggle:()=>ue(u),isOpen:O},M),y=_.span(h,...T(null,"default",{},m));return Y(y),y._tooltip={bind:Y,open:fe,show:be,hide:re,close:W,toggle:ue,isOpen:O},y}return{bind:Y,open:fe,show:be,hide:re,close:W,toggle:ue,isOpen:O}};const To=(t,e,n={})=>{var R;const{props:s,children:i}=JSswift.uiNormalizeArgs(e),c=s.slots||{},S=t==="radio",u=n.appearance==="toggle",a=!S,b=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),M=an(s.model,n.modelName||(S?"UI.Radio:model":"UI.Checkbox:model")),N=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"]);N.type=t,N.id=b,S&&s.name!=null&&(N.name=s.name),N.class=Z([`cms-${t}`,"cms-choice-input",s.inputClass]);const C=_.input(N),z=T(c,"label",{},s.label),U=z.length?z:T(c,"default",{},i),W=Re(s,{className:"cms-shortcode cms-choice-shortcode"}),ge=W?[...U,W]:U,B=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"]);B.class=Z(["cms-clear-set","cms-singularity-check","cms-choice-wrap",`cms-${t}-wrap`,ye(u,"cms-toggle-wrap"),ye(u&&S,"cms-toggle-radio-wrap"),ye(u&&!S,"cms-toggle-checkbox-wrap"),ye(s.dense,"dense"),s.class]),B.style={...s.style||{}};const ne=o(s.size);ne!=null&&!(typeof ne=="string"&&((R=JSswift.uiSizes)!=null&&R.includes(ne)))&&(B.style["--cms-choice-size"]=gt(ne));const he=_.span({class:Z(["cms-choice-mark",S?"cms-choice-radio-mark":"cms-choice-checkbox-mark",ye(u,"cms-toggle-mark")])}),q=u?_.span({class:"cms-toggle-thumb"}):he;u&&he.appendChild(q);const se=ge.length?_.span({class:"cms-choice-label"},...ge):null,le=_.label(B,C,he,se);At(le,s);const fe=s.iconSize?s.iconSize:s.size,be=u?null:S?"radio_button_checked":"check",re=u?null:S?"radio_button_unchecked":null,ue=u||S?null:"indeterminate_check_box",O=h=>{if(S)return C.checked=h==s.value,C.checked;const m=h==null?null:!!h;return C.checked=m===!0,C.indeterminate=a&&m==null,m},Y=()=>!S&&a&&C.indeterminate?null:!!C.checked,oe=h=>h===!0?s.checkedIcon!=null?s.checkedIcon:s.icon!=null?s.icon:be:h===!1?s.uncheckedIcon!=null?s.uncheckedIcon:re:s.indeterminateIcon!=null?s.indeterminateIcon:s.standbyIcon!=null?s.standbyIcon:s.iconStandby!=null?s.iconStandby:ue,we=()=>{const h=Y(),m=h===!0;for(;q.firstChild;)q.removeChild(q.firstChild);le.classList.toggle("is-checked",m),le.classList.toggle("is-indeterminate",h==null),le.classList.toggle("is-disabled",!!C.disabled),m&&(s.checkedIcon||s.icon)?le.classList.toggle("toggle-default",!1):m&&!s.checkedIcon||h==null&&!s.standbyIcon?le.classList.toggle("toggle-default",!0):h==null&&s.standbyIcon?le.classList.toggle("toggle-default",!1):C.disabled===!1&&!s.uncheckedIcon?le.classList.toggle("toggle-default",!0):le.classList.toggle("toggle-default",!1),u&&(h==null?q.style.transform="translateX(calc((var(--cms-toggle-width) - var(--cms-toggle-thumb-size) - 1px) / 2))":q.style.removeProperty("transform"));const y={checked:m,state:h,indeterminate:h==null,value:s.value,id:b,type:t};let j=null;if(h===!0?(j=JSswift.ui.renderSlot(c,"checkedIcon",y,null),j==null&&(j=JSswift.ui.renderSlot(c,"iconOn",y,null))):h===!1?(j=JSswift.ui.renderSlot(c,"uncheckedIcon",y,null),j==null&&(j=JSswift.ui.renderSlot(c,"iconOff",y,null))):(j=JSswift.ui.renderSlot(c,"indeterminateIcon",y,null),j==null&&(j=JSswift.ui.renderSlot(c,"standbyIcon",y,null)),j==null&&(j=JSswift.ui.renderSlot(c,"iconStandby",y,null))),j==null&&(j=JSswift.ui.renderSlot(c,"icon",y,null)),j==null){const X=oe(h);typeof X=="string"?j=Ae.Icon({name:X,size:fe,...u?{textColor:s.color,outline:!0}:{}}):X!=null&&(j=JSswift.ui.slot(X,{checked:m,state:h,indeterminate:h==null,as:h===!0?"checkedIcon":h===!1?"uncheckedIcon":"indeterminateIcon"}))}T(null,"default",{},j).forEach(X=>q.appendChild(X))};return M?(O(M.get()),M.watch(h=>{O(h),we()},S?"UI.Radio:watch":"UI.Checkbox:watch"),C.addEventListener("change",h=>{var m,y;if(S)C.checked&&(M.set(s.value),(m=s.onChange)==null||m.call(s,s.value,h));else{const j=Y();M.set(j),(y=s.onChange)==null||y.call(s,j,h)}we()})):(O(S?s.checked===!0?s.value:void 0:s.checked),C.addEventListener("change",h=>{var m,y;S?(m=s.onChange)==null||m.call(s,s.value,h):(y=s.onChange)==null||y.call(s,Y(),h),we()})),s.onInput&&C.addEventListener("input",h=>{var m,y;S?(m=s.onInput)==null||m.call(s,s.value,h):(y=s.onInput)==null||y.call(s,Y(),h)}),we(),tt(le,s,{isEnabled:()=>!C.disabled,action:()=>{if(C.disabled)return!1;Pe(C),C.click()}}),le};Ae.Checkbox=(...t)=>To("checkbox",t),Ae.Radio=(...t)=>To("radio",t),Ae.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"})},Ae.Slider=(...t)=>{var ae,ke,Te,ze,V;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(Ct(e.value)||ht(e.value)?e.value:null),c=an(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=Z(["cms-slider-input",e.inputClass]);const u=_.input(S),a={...e.style||{}},b=o(e.size);if(b!=null){const H=typeof b=="string"&&((ae=JSswift.uiSizes)!=null&&ae.includes(b))?`var(--cms-size-${b})`:gt(b);a["--cms-slider-size"]=H,a["--cms-slider-track-size"]=`max(4px, calc(${H} / 4))`,a["--cms-slider-box-height"]=`calc(${H} * 1.5)`,a["--cms-slider-marker-size"]=`max(6px, calc(${H} / 3))`}const M=_.label({class:Z(["cms-clear-set","cms-singularity-check","cms-slider-wrap",ye(e.dense,"dense"),e.class]),style:a});At(M,e);const N=_.div({class:"cms-slider-header"}),C=_.span({class:"cms-slider-label"}),z=_.span({class:"cms-slider-value"});N.append(C,z);const U=_.div({class:"cms-slider-body"}),W=_.span({class:"cms-slider-icon cms-slider-icon-left"}),ge=_.span({class:"cms-slider-edge-label cms-slider-edge-label-left"}),B=_.div({class:"cms-slider-main"}),ne=_.div({class:"cms-slider-box",style:{minHeight:"var(--cms-slider-box-height, 36px)"}}),he=_.span({class:"cms-slider-rail",style:{height:"var(--cms-slider-track-size, 6px)"}}),q=_.span({class:"cms-slider-selection",style:{height:"var(--cms-slider-track-size, 6px)"}}),se=_.span({class:"cms-slider-thumb",style:{width:"var(--cms-slider-size, 24px)",height:"var(--cms-slider-size, 24px)"}}),le=_.span({class:"cms-slider-thumb-icon"}),fe=_.span({class:"cms-slider-thumb-label"});se.append(fe,le);const be=_.div({class:"cms-slider-markers"}),re=_.span({class:"cms-slider-edge-label cms-slider-edge-label-right"}),ue=_.span({class:"cms-slider-icon cms-slider-icon-right"});ne.append(he,q,se,u),B.append(ne,be),U.append(W,ge,B,re,ue),M.append(N,U);const O=H=>{for(;H.firstChild;)H.removeChild(H.firstChild)},Y=(H,te,De="")=>{O(H),(te||[]).forEach(je=>H.appendChild(je)),H.style.display=H.childNodes.length?De:"none"},oe=H=>Ct(H)||ht(H)?o(H):H,we=(H,te={})=>Vs(oe(H),te),R=(H,te,De={})=>{var _e,Me;const je=oe(H);return je==null?[]:typeof je=="string"?[Ae.Icon({name:je,size:(Me=(_e=e.iconSize)!=null?_e:e.size)!=null?Me:16})]:we(je,{...De,as:te})},h=(H,te)=>{const De=Number(H);return Number.isFinite(De)?De:te},m=()=>h(o(e.min),0),y=()=>{const H=m(),te=h(o(e.max),100);return te<H?H:te},j=()=>{const H=o(e.step);if(H==="any")return"any";const te=h(H,1);return te>0?te:1},X=H=>{if(H==="any")return 0;const te=String(H);if(te.includes("e-"))return Number(te.split("e-")[1]||0);const De=te.indexOf(".");return De===-1?0:te.length-De-1},d=H=>{const te=m(),De=y(),je=j();let _e=h(H,te);if(je!=="any"){_e=te+Math.round((_e-te)/je)*je;const Me=X(je);Me>0&&(_e=Number(_e.toFixed(Me)))}return Math.min(De,Math.max(te,_e))},k=H=>{const te=m(),je=y()-te;if(!je)return 0;const _e=(d(H)-te)/je,Me=o(e.reverse)?1-_e:_e;return Math.max(0,Math.min(1,Me))},[g,P]=JSswift.reactive.signal(d(c?c.get():(Te=(ke=o(e.value))!=null?ke:o(e.min))!=null?Te:0)),K=(H,te={})=>{const De=d(H);return g()!==De&&P(De),String(u.value)!==String(De)&&(u.value=String(De)),c&&te.fromModel!==!0&&c.set(De),De},ee=()=>{var Me;const H=o(e.markers),te=!!o((Me=e.markerLabels)!=null?Me:e.labelMarks);if(!H)return[];const De=m(),je=y(),_e=(Ie,Ye)=>{var Xe,We,w,ie,$e,F,f,r;if(Ie==null)return null;if(typeof Ie=="object"&&!Array.isArray(Ie)){const x=d((w=(We=(Xe=Ie.value)!=null?Xe:Ie.position)!=null?We:Ie.at)!=null?w:De);return{key:(ie=Ie.key)!=null?ie:`marker-${Ye}-${x}`,value:x,label:($e=Ie.label)!=null?$e:te?String(x):null,icon:(F=Ie.icon)!=null?F:null,className:(r=(f=Ie.class)!=null?f:Ie.className)!=null?r:""}}const rt=d(Ie);return{key:`marker-${Ye}-${rt}`,value:rt,label:te?String(Ie):null,icon:null,className:""}};if(Array.isArray(H))return H.map((Ie,Ye)=>_e(Ie,Ye)).filter(Boolean);if(typeof H=="number"&&H>1){const Ie=Math.floor(H),Ye=Ie>1?(je-De)/(Ie-1):0;return Array.from({length:Ie},(rt,Xe)=>_e(De+Ye*Xe,Xe)).filter(Boolean)}if(H===!0){const Ie=j();if(Ie==="any")return[_e(De,0),_e(je,1)].filter(Boolean);const Ye=Math.floor((je-De)/Ie)+1;return Ye>24?[_e(De,0),_e((De+je)/2,1),_e(je,2)].filter(Boolean):Array.from({length:Ye},(rt,Xe)=>_e(De+Ie*Xe,Xe)).filter(Boolean)}return typeof H=="object"?Object.keys(H).map((Ie,Ye)=>_e({value:Number(Ie),label:H[Ie]},Ye)).filter(Boolean):[]},Ce=()=>{O(be);const H=ee();be.style.display=H.length?"block":"none",be.style.minHeight=H.some(te=>te.label!=null&&te.label!=="")?"30px":"10px",H.forEach(te=>{const De=k(te.value),je=o(e.reverse)?g()<=te.value:g()>=te.value,_e=_.button({type:"button",class:Z(["cms-slider-marker",te.className,ye(()=>je,"active")]),style:{left:`${De*100}%`,color:je?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 w,ie;if(o(e.disabled)||o(e.readonly))return;const We=K(te.value);(w=e.onInput)==null||w.call(e,We),(ie=e.onChange)==null||ie.call(e,We)}}),Me={marker:te,active:je,value:te.value,current:g(),input:u};let Ie=JSswift.ui.renderSlot(s,"marker",Me,null);Ie==null&&te.icon!=null&&(Ie=typeof te.icon=="string"?Ae.Icon({name:te.icon,size:12}):JSswift.ui.slot(te.icon,{...Me,as:"marker"}));const Ye=_.span({class:"cms-slider-marker-tick",style:{width:"var(--cms-slider-marker-size, 8px)",height:"var(--cms-slider-marker-size, 8px)",background:je?o(e.color)||"var(--cms-primary)":"var(--cms-border-color)"}}),rt=Ie==null?[Ye]:T(null,"default",Me,Ie),Xe=te.label==null?T(s,"markerLabel",Me,null):T(s,"markerLabel",Me,te.label);rt.forEach(We=>_e.appendChild(We)),Xe.length&&_e.appendChild(_.span({class:"cms-slider-marker-label"},...Xe)),be.appendChild(_e)})},E=()=>{var Me;const H={value:g(),input:u,props:e};let te=T(s,"label",H,oe(e.label));te.length||(te=T(s,"default",H,n)),Y(C,te,"inline-flex");const De=o(e.showValue),je=De===!1?null:(Me=oe(e.labelValue))!=null?Me:g(),_e=De||oe(e.labelValue)!=null?T(s,"value",H,je):[];Y(z,_e,"inline-flex"),N.style.display=C.childNodes.length||z.childNodes.length?"flex":"none"},p=()=>{var Ye,rt,Xe,We;const H={value:g(),input:u,props:e},te=T(s,"icon",H,null),De=te.length?te:R(e.icon,"icon",H);Y(W,De,"inline-flex");const je=T(s,"iconRight",H,null),_e=je.length?je:R(e.iconRight,"iconRight",H);Y(ue,_e,"inline-flex");const Me=oe((rt=(Ye=e.startLabel)!=null?Ye:e.leftLabel)!=null?rt:e.minLabel),Ie=oe((We=(Xe=e.endLabel)!=null?Xe:e.rightLabel)!=null?We:e.maxLabel);Y(ge,T(s,"startLabel",H,Me),"inline-flex"),Y(re,T(s,"endLabel",H,Ie),"inline-flex")},A=()=>{var Me,Ie,Ye,rt;const H={value:g(),input:u,props:e},te=T(s,"thumbIcon",H,null),De=(Ie=(Me=e.thumbIcon)!=null?Me:e.iconThumb)!=null?Ie:e.pointIcon;Y(le,te.length?te:R(De,"thumbIcon",H),"inline-flex");const je=(rt=(Ye=oe(e.thumbLabel))!=null?Ye:oe(e.labelValue))!=null?rt:o(e.showValue)?String(g()):null,_e=T(s,"thumbLabel",H,je);Y(fe,_e,"inline-flex")},L=()=>{const H=d(g()),te=m(),De=y(),je=j(),Me=`${k(H)*100}%`,Ie=o(e.color)||o(e.selectionColor)||"var(--cms-primary)",Ye=o(e.trackColor)||"var(--cms-border-color)",rt=o(e.thumbColor)||Ie,Xe=!!o(e.readonly),We=!!o(e.disabled);u.min=String(te),u.max=String(De),u.step=je==="any"?"any":String(je),u.disabled=We,u.value=String(H),he.style.background=Ye,q.style.background=Ie,q.style.width=Me,se.style.left=Me,se.style.borderColor=rt,se.style.color=rt,fe.style.background=Ie,M.classList.toggle("is-disabled",We),M.classList.toggle("is-readonly",Xe),M.classList.toggle("has-markers",be.childNodes.length>0)};if(c?(K(c.get(),{fromModel:!0}),c.watch(H=>{K(H,{fromModel:!0})},"UI.Slider:watch")):Ke(e.value)?JSswift.reactive.effect(()=>{K(o(e.value),{fromModel:!0})},"UI.Slider:value"):K((V=(ze=e.value)!=null?ze:e.min)!=null?V:0,{fromModel:!0}),u.addEventListener("input",H=>{var De;if(o(e.disabled)||o(e.readonly)){u.value=String(g());return}const te=K(u.value);(De=e.onInput)==null||De.call(e,te,H)}),u.addEventListener("change",H=>{var De;if(o(e.disabled)||o(e.readonly)){u.value=String(g());return}const te=K(u.value);(De=e.onChange)==null||De.call(e,te,H)}),JSswift.reactive.effect(()=>{E(),p(),A(),Ce(),L()},"UI.Slider:render"),M._input=u,M._getValue=g,M._setValue=H=>K(H),e.withQItem||e.qitem||e.item===!0){const H=Ae.Item({class:Z(["cms-slider-item",e.itemClass]),style:e.itemStyle},M);return H._input=u,H._slider=M,H._getValue=g,H._setValue=M._setValue,H}return M},Ae.Rating=(...t)=>{var g;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(Ct(e.value)||ht(e.value)?e.value:null),c=an(i,"UI.Rating:model"),S=e.id||"cms-rating-"+Math.random().toString(36).slice(2),u=JSswift.omit(e,["model","value","max","class","style","dense","readonly","disabled","clearable","half","allowHalf","noDimming","label","slots","onChange","onInput","onHover","icon","checkedIcon","uncheckedIcon","halfIcon","hoveredIcon","iconSelected","iconHalf","iconHovered","iconOn","iconOff","iconSize","color","colorSelected","colorHalf","colorHovered","colorInactive","activeColor","halfColor","hoverColor","size","gap","tabindex","tabIndex","inputClass"]);u.type="hidden",u.id=S,e.name!=null&&(u.name=e.name),u.class=Z(["cms-rating-input","cms-choice-input",e.inputClass]);const a=_.input(u),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=Z(["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 M=o(e.size);M!=null&&!(typeof M=="string"&&((g=JSswift.uiSizes)!=null&&g.includes(M)))&&(b.style["--cms-rating-size"]=gt(M));const N=o(e.gap);N!=null&&(b.style["--cms-rating-gap"]=gt(N));const C=_.span({class:"cms-rating-control",onMouseleave:P=>{var K;oe!=null&&(oe=null,d(),(K=e.onHover)==null||K.call(e,ue(),P))},onKeydown:P=>{if(!re())return;const K=se()?.5:1,ee=ue();let Ce=ee;switch(P.key){case"ArrowRight":case"ArrowUp":Ce=ee+K;break;case"ArrowLeft":case"ArrowDown":Ce=ee-K;break;case"Home":Ce=o(e.clearable)?0:K;break;case"End":Ce=q();break;case"Delete":case"Backspace":case"0":if(!o(e.clearable))return;Ce=0;break;case" ":case"Enter":Ce=ee||(o(e.clearable)?K:Math.max(K,1));break;default:return}P.preventDefault(),k(Ce,P,{emit:!0})}}),z=_.span({class:"cms-choice-label cms-rating-label"}),U=_.label(b,a,C,z);At(U,e);const W=P=>{for(;P.firstChild;)P.removeChild(P.firstChild)},ge=(P,K,ee="")=>{W(P),(K||[]).forEach(Ce=>P.appendChild(Ce)),P.style.display=P.childNodes.length?ee:"none"},B=P=>Ct(P)||ht(P)?o(P):P,ne=(P,K={})=>Vs(B(P),K),he=(P,K,ee={})=>{var E,p;const Ce=B(P);return Ce==null?[]:typeof Ce=="string"?[Ae.Icon({name:Ce,color:e.color,size:(p=(E=e.iconSize)!=null?E:e.size)!=null?p:16})]:ne(Ce,{...ee,as:K})},q=()=>{var K;const P=Number((K=o(e.max))!=null?K:5);return Number.isFinite(P)&&P>0?Math.max(1,Math.round(P)):5},se=()=>{var P;return!!o((P=e.half)!=null?P:e.allowHalf)},le=(P,K=q())=>{let ee=Number(o(P));Number.isFinite(ee)||(ee=0),ee=Math.min(K,Math.max(0,ee));const Ce=se()?.5:1;return Math.round(ee/Ce)*Ce},fe=()=>!!o(e.disabled),be=()=>!!o(e.readonly),re=()=>!fe()&&!be(),ue=()=>le(c?c.get():Y),O=P=>{const K=P>0?String(P):"";a.value=K,a.setAttribute("value",K),a.disabled=fe()};let Y=le(c?c.get():o(e.value)),oe=null,we=0,R=[];const h=(P,K)=>{if(!se())return le(P);const ee=K.currentTarget.getBoundingClientRect(),Ce=K.clientX-ee.left<=ee.width/2;return le(Ce?P-.5:P)},m=(P,K)=>P>=K?"full":se()&&P>=K-.5?"half":"empty",y=(P,K)=>{var A,L,ae,ke,Te,ze,V,H,te,De,je,_e,Me,Ie,Ye;const ee=o((ae=(L=(A=e.colorSelected)!=null?A:e.activeColor)!=null?L:e.color)!=null?ae:e.textColor)||"var(--cms-warning, #f0b429)",Ce=o((H=(V=(ze=(Te=(ke=e.colorHalf)!=null?ke:e.halfColor)!=null?Te:e.colorSelected)!=null?ze:e.activeColor)!=null?V:e.color)!=null?H:e.textColor)||ee,E=o((Me=(_e=(je=(De=(te=e.colorHovered)!=null?te:e.hoverColor)!=null?De:e.colorSelected)!=null?je:e.activeColor)!=null?_e:e.color)!=null?Me:e.textColor)||ee,p=o((Ye=(Ie=e.colorInactive)!=null?Ie:e.colorOff)!=null?Ye:e.color)||"var(--cms-muted)";return K?E:P==="full"?ee:P==="half"?Ce:p},j=P=>{var E,p,A,L,ae,ke,Te,ze,V,H,te,De,je,_e,Me;const K=[];P.hovered&&P.state!=="empty"&&K.push("hoveredIcon","iconHovered"),P.state==="full"?K.push("checkedIcon","selectedIcon","iconSelected","iconOn"):P.state==="half"?K.push("halfIcon","iconHalf"):K.push("uncheckedIcon","iconOff"),K.push("icon","item","star");for(const Ie of K){const Ye=T(s,Ie,P,null);if(Ye.length)return Ye}let ee=null,Ce="icon";return P.hovered&&P.state!=="empty"&&(ee=(E=e.hoveredIcon)!=null?E:e.iconHovered,Ce="hoveredIcon"),ee==null&&P.state==="full"?(ee=(ae=(L=(A=(p=e.checkedIcon)!=null?p:e.iconSelected)!=null?A:e.iconOn)!=null?L:e.icon)!=null?ae:"star",Ce="checkedIcon"):ee==null&&P.state==="half"?(ee=(H=(V=(ze=(Te=(ke=e.halfIcon)!=null?ke:e.iconHalf)!=null?Te:e.checkedIcon)!=null?ze:e.iconSelected)!=null?V:e.icon)!=null?H:"star_half",Ce="halfIcon"):ee==null&&(ee=(Me=(te=e.uncheckedIcon)!=null?te:e.iconOff)!=null?Me:o(e.noDimming)?(_e=(je=(De=e.icon)!=null?De:e.checkedIcon)!=null?je:e.iconSelected)!=null?_e:"star":"star_border",Ce="uncheckedIcon"),he(ee,Ce,P)},X=()=>{const P=q();if(we!==P){we=P,R=[],W(C);for(let K=1;K<=P;K++){const ee=_.span({class:"cms-rating-item-icon"}),Ce=_.span({class:"cms-rating-item",role:"radio",tabIndex:-1,onMousemove:E=>{var A;if(!re())return;const p=h(K,E);oe!==p&&(oe=p,d(),(A=e.onHover)==null||A.call(e,p,E))},onClick:E=>{if(!re())return;let p=h(K,E);o(e.clearable)&&p===ue()&&(p=0),k(p,E,{emit:!0})}},ee);R.push({item:Ce,iconHost:ee,index:K}),C.appendChild(Ce)}}},d=()=>{var ke,Te;X();const P=q(),K=ue(),ee=oe==null?K:le(oe,P),Ce=fe(),E=be(),p=!!o(e.clearable),A=!!o(e.noDimming);U.classList.toggle("is-disabled",Ce),U.classList.toggle("is-readonly",E),U.classList.toggle("is-hovering",oe!=null),U.classList.toggle("is-clearable",p),U.classList.toggle("is-half",se()),U.classList.toggle("no-dimming",A);const L=Number((Te=o((ke=e.tabindex)!=null?ke:e.tabIndex))!=null?Te:0);C.tabIndex=Ce?-1:L,C.setAttribute("role","slider"),C.setAttribute("aria-valuemin","0"),C.setAttribute("aria-valuemax",String(P)),C.setAttribute("aria-valuenow",String(K)),C.setAttribute("aria-disabled",Ce?"true":"false"),C.setAttribute("aria-readonly",E?"true":"false"),O(K);const ae=T(s,"label",{value:K,max:P,disabled:Ce,readonly:E,clearable:p},e.label!=null?B(e.label):n);ge(z,ae,"inline-flex"),R.forEach(({item:ze,iconHost:V,index:H})=>{const te=m(ee,H),De=oe!=null&&te!=="empty",je={index:H,max:P,value:K,displayValue:ee,state:te,active:te!=="empty",checked:te==="full",half:te==="half",hovered:De,disabled:Ce,readonly:E,clearable:p,setValue:_e=>k(_e,null,{emit:!1})};ze.className=Kt(["cms-rating-item",`is-${te}`,ye(De,"is-hovered")]),ze.style.color=y(te,De),ze.style.opacity=te==="empty"&&!A?"0.48":"1",ze.setAttribute("aria-checked",String(K===H)),ge(V,j(je),"inline-flex")})},k=(P,K,ee={})=>{var p,A;const Ce=le(P),E=ue();return Y=Ce,oe=null,c&&ee.fromModel!==!0&&c.set(Ce),O(Ce),d(),ee.emit!==!1&&Ce!==E&&((p=e.onInput)==null||p.call(e,Ce,K),(A=e.onChange)==null||A.call(e,Ce,K)),Ce};return U._input=a,U._rating=C,U._getValue=ue,U._setValue=P=>k(P,null,{emit:!1}),c&&c.watch(P=>{const K=le(P);serializeValue(K)!==serializeValue(Y)&&(Y=K,oe=null,O(Y),d())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!c&&e.value!=null&&(Y=le(o(e.value))),d()},"UI.Rating:render"),U};const Ut=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"),Pn=(t,e={})=>{var u,a,b,M,N,C,z,U,W,ge,B,ne,he,q,se;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 le=Math.max(0,Math.floor(t));n=Math.floor(le/3600)%24,s=Math.floor(le/60)%60,i=le%60}else if(typeof t=="object"){if(t.time!=null||t.value!=null)return Pn((u=t.time)!=null?u:t.value,e);n=Number((M=(b=(a=t.hour)!=null?a:t.hours)!=null?b:t.h)!=null?M:t.hh),s=Number((U=(z=(C=(N=t.minute)!=null?N:t.minutes)!=null?C:t.min)!=null?z:t.mm)!=null?U:0),i=Number((ne=(B=(ge=(W=t.second)!=null?W:t.seconds)!=null?ge:t.sec)!=null?B:t.ss)!=null?ne:0),c=(se=(q=(he=t.meridiem)!=null?he:t.ampm)!=null?q:t.period)!=null?se:null}else if(typeof t=="string"){const le=t.trim();if(!le)return null;const fe=le.match(/^(\d{1,2})(\d{2})(\d{2})?$/),be=le.match(/(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?\s*([ap]m)?/i);if(be)n=Number(be[1]),s=Number(be[2]),i=be[3]!=null?Number(be[3]):0,c=be[4]||null;else if(fe)n=Number(fe[1]),s=Number(fe[2]),i=fe[3]!=null?Number(fe[3]):0;else return null}else return null;if(!Number.isFinite(n)||!Number.isFinite(s)||!Number.isFinite(i))return null;if(c){const le=String(c).toLowerCase();le==="pm"&&n<12&&(n+=12),le==="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 Yo(S,e)},Kn=(t,e={})=>{const n=t&&typeof t=="object"&&t.hour!=null?Ut(t):Pn(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)}`:""}`},po=(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 Yo(t,e={}){if(!t)return null;const n=Ut(t),s=e.min!=null?Pn(e.min,{withSeconds:!0}):null,i=e.max!=null?Pn(e.max,{withSeconds:!0}):null;return s&&po(n,s)<0?Ut(s):i&&po(n,i)>0?Ut(i):n}const kn=(t,e={})=>t==null||t===""?null:t instanceof Date?Pn(t,e):typeof t=="object"?Pn(t.time!=null?t.time:t,e):typeof t=="string"||typeof t=="number"?Pn(t,e):null,ho=(t,e={})=>{var u;const n=Pn(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;if(!!!o((u=e.use12h)!=null?u:e.ampm))return`${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}`},ji=(t,e,n={})=>{if(!t)return"";const s=Kn(e,n);return s?`${t}T${s}`:t},Jo=(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},Xo=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:i=!1,minuteStep:c=5,secondStep:S=5,disabled:u=!1,readonly:a=!1,embedded:b=!1,className:M="",slotPrefix:N="",shortcuts:C=null,onSelect:z=null}=t,U=Pn(s,{withSeconds:i,min:e.min,max:e.max}),W=U||Pn(new Date,{withSeconds:i,min:e.min,max:e.max})||{hour:0,minute:0,second:0},ge=U?Ut(U):null,B=re=>N?`${N}${re[0].toUpperCase()}${re.slice(1)}`:null,ne=(re,ue,O)=>{const Y=[B(re),re].filter(Boolean);for(const oe of Y){if(JSswift.ui.getSlot(n,oe)==null)continue;const R=JSswift.ui.renderSlot(n,oe,ue,O);if(R!=null)return R}return JSswift.ui.slot(O,ue)},he=re=>{let ue=ne("point",re,null);return ue==null&&t.pointIcon!=null&&re.selected&&(ue=typeof t.pointIcon=="string"?Ae.Icon({name:t.pointIcon,size:b?10:12}):JSswift.ui.slot(t.pointIcon,re)),T(null,"default",re,ue)},q=(re,ue)=>{const O={hour:W.hour,minute:W.minute,second:i?W.second:0};return O[re]=ue,O},se=_.div({class:Z(["cms-time-section",ye(b,"is-embedded"),ye(i,"has-seconds"),M])}),le=o(C)||[];if(Array.isArray(le)&&le.length){const re=_.div({class:"cms-time-shortcuts"});le.forEach((ue,O)=>{var h,m,y;if(!ue)return;const Y=typeof ue.value=="function"?ue.value({now:Kn(new Date,{withSeconds:i})}):ue.value,oe=Pn(Y,{withSeconds:i,min:e.min,max:e.max});if(!oe)return;const we={item:ue,index:O,value:Kn(oe,{withSeconds:i}),displayValue:ho(oe,{withSeconds:i,use12h:(h=e.use12h)!=null?h:e.ampm})},R=ne("shortcut",we,(y=(m=ue.label)!=null?m:ue.text)!=null?y:we.displayValue);re.appendChild(_.button({type:"button",class:Z(["cms-time-shortcut",ye(!!ge&&po(oe,ge)===0,"is-selected")]),disabled:u||a,onClick:()=>z==null?void 0:z(oe,{shortcut:ue,index:O})},...T(null,"default",we,R)))}),re.childNodes.length&&se.appendChild(re)}const fe=_.div({class:"cms-time-columns"}),be=(re,ue,O)=>{const Y=_.div({class:"cms-time-column","data-time-part":ue}),oe=_.div({class:"cms-time-options"});return O.forEach(we=>{var k;const R=q(ue,we),h=Yo(R,{withSeconds:i,min:e.min,max:e.max}),m=u||a||po(h,R)!==0,y=!!ge&&ge[ue]===we,j={part:ue,selected:y,disabled:m,value:we,label:Dn(we),timeValue:Kn(h,{withSeconds:i}),displayValue:ho(h,{withSeconds:i,use12h:(k=e.use12h)!=null?k:e.ampm})},X=ne("option",j,j.label),d=y?he(j):[];oe.appendChild(_.button({type:"button",class:Z(["cms-time-option",ye(y,"is-selected"),ye(m,"is-disabled")]),disabled:m,onClick:()=>z==null?void 0:z(h,{part:ue,optionValue:we})},_.span({class:"cms-time-option-label"},...T(null,"default",j,X)),d.length?_.span({class:"cms-time-option-point"},...d):null))}),Y.appendChild(oe),Y};return fe.appendChild(be(o(e.hoursLabel)||"Ore","hour",Jo(1,23))),fe.appendChild(be(o(e.minutesLabel)||"Min","minute",Jo(c,59))),i&&fe.appendChild(be(o(e.secondsLabel)||"Sec","second",Jo(S,59))),se.appendChild(fe),se},go=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},Qo=(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 u=c.getAttribute("data-time-part")||String(S),a=n&&Number.isFinite(n[u])?n[u]:null;a!=null&&(c.scrollTop=a);const b=c.querySelector(".cms-time-option.is-selected");if(!b)return;const M=Math.max(0,c.scrollHeight-c.clientHeight),N=b.offsetTop-(c.clientHeight-b.offsetHeight)/2,C=Math.max(0,Math.min(M,N));if(Math.abs(c.scrollTop-C)<1){c.scrollTop=C;return}if(s&&typeof c.scrollTo=="function"){c.scrollTo({top:C,behavior:s});return}c.scrollTop=C})},Zo=(t,e={})=>{var hs,As,ss,os,is,ls,qe,pt,Ft,Gt,tn,sn;const{props:n,children:s}=JSswift.uiNormalizeArgs(t),i=e.calendar===!0,c=n.slots||{},S=xt(n.size,()=>{const v=String(o(n.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(v)?`cms-size-${v}`:""}),u=String(o((os=(ss=n.mode)!=null?ss:o((As=(hs=n.rangeMultiple)!=null?hs:n.multipleRange)!=null?As:n.multiRange)?"range-multiple":null)!=null?os:n.range&&n.multiple?"range-multiple":n.range?"range":n.multiple?"multiple":"single")).toLowerCase(),a=["range-multiple","multiple-range","rangemultiple","multiplerange","range_multiple","multiple_range","multi-range","multi_range","ranges"].includes(u)?"range-multiple":u==="range"?"range":u==="multiple"?"multiple":"single",b=n.model||(Ct(n.value)||ht(n.value)?n.value:null),M=an(b,i?"UI.Calendar:model":"UI.Datepicker:model"),N=M?M.get():o(n.value),C=o((is=n.rangeAs)!=null?is:n.rangeModel)==="array"||Array.isArray(N),z=o((ls=n.rangeMultipleAs)!=null?ls:n.multipleRangeAs)==="array"||Array.isArray(N)&&Array.isArray(N[0]),U=()=>{var v,ce,Je;return a==="single"&&!!o((Je=(ce=(v=n.withTime)!=null?v:n.time)!=null?ce:n.timePicker)!=null?Je:n.enableTime)},W=()=>{var ce,Je,it,lt,ct,mt,Jt,Yt;const v=Kn(kn((Je=(ce=o(n.timeValue))!=null?ce:M?M.get():o(n.value))!=null?Je:N,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((lt=(it=n.timeWithSeconds)!=null?it:n.withSeconds)!=null?lt:n.showSeconds)||/:\d{2}:\d{2}$/.test(v)||/:\d{2}:\d{2}$/.test(o(n.timeFormat)||""),min:o((ct=n.timeMin)!=null?ct:n.minTime),max:o((mt=n.timeMax)!=null?mt:n.maxTime),use12h:o((Yt=(Jt=n.time12h)!=null?Jt:n.use12h)!=null?Yt:n.ampm)}},ge=()=>{var ce,Je;const v=Number(o((Je=(ce=n.timeMinuteStep)!=null?ce:n.minuteStep)!=null?Je:5));return Math.max(1,Math.min(30,Number.isFinite(v)?v:5))},B=()=>{var ce,Je;const v=Number(o((Je=(ce=n.timeSecondStep)!=null?ce:n.secondStep)!=null?Je:5));return Math.max(1,Math.min(30,Number.isFinite(v)?v:5))},ne=v=>String(v).padStart(2,"0"),he=(v,ce,Je)=>{const it=new Date(v,ce,Je);return it.getFullYear()!==v||it.getMonth()!==ce||it.getDate()!==Je?null:it},q=v=>!(v instanceof Date)||Number.isNaN(v.getTime())?null:`${v.getFullYear()}-${ne(v.getMonth()+1)}-${ne(v.getDate())}`,se=v=>{if(typeof v!="string")return null;const ce=v.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!ce)return null;const Je=Number(ce[1]),it=Number(ce[2])-1,lt=Number(ce[3]),ct=new Date(Je,it,lt);return ct.getFullYear()!==Je||ct.getMonth()!==it||ct.getDate()!==lt?null:ct},le=(v,ce)=>{const Je=se(v);return Je?(Je.setDate(Je.getDate()+ce),q(Je)):null},fe=(v,ce)=>new Date(v.getFullYear(),v.getMonth()+ce,1),be=v=>{if(v instanceof Date&&!Number.isNaN(v.getTime()))return new Date(v.getFullYear(),v.getMonth(),1);const ce=d(v),Je=se(ce);return Je?new Date(Je.getFullYear(),Je.getMonth(),1):new Date},re=()=>q(new Date),ue=(v,ce)=>!!v&&!!ce&&v===ce,O=(v,ce)=>v==null&&ce==null?0:v==null?-1:ce==null?1:v<ce?-1:v>ce?1:0,Y=(v,ce)=>{const Je=se(v),it=se(ce);return!Je||!it?0:Math.round((it.getTime()-Je.getTime())/864e5)},oe=v=>Array.isArray(v)?v.slice():v==null||v===""?[]:[v],we=v=>({from:(v==null?void 0:v.from)||null,to:(v==null?void 0:v.to)||null}),R=v=>Array.isArray(v)?v.map(we):[],h=v=>{const ce=we(v);return C?[ce.from,ce.to]:ce},m=v=>R(v).map(ce=>z?[ce.from,ce.to]:ce),y=v=>a==="multiple"?Array.isArray(v)?v.slice():[]:a==="range"?we(v):a==="range-multiple"?R(v):v||null,j=v=>a==="multiple"?Array.isArray(v)?v.slice():[]:a==="range"?h(v):a==="range-multiple"?m(v):v||"",X=v=>JSON.stringify(j(v)),d=v=>{if(v==null||v==="")return null;if(v instanceof Date)return q(v);if(typeof v=="number")return q(new Date(v));if(typeof v!="string")return typeof v=="object"&&v.date!=null?d(v.date):null;const ce=v.trim();if(!ce)return null;const Je=ce.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:$|[T\s])/);if(Je){const mt=he(Number(Je[1]),Number(Je[2])-1,Number(Je[3]));return q(mt)}const it=ce.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(it){const mt=it[3].length===2?2e3+Number(it[3]):Number(it[3]),Jt=he(mt,Number(it[2])-1,Number(it[1]));return q(Jt)}if(/^\d{1,4}$/.test(ce))return null;const lt=new Date(ce);if(Number.isNaN(lt.getTime()))return null;const ct=ce.match(/(?:^|[^\d])(\d{4})(?!\d)/);return ct&<.getFullYear()!==Number(ct[1])?null:q(lt)},k=v=>{var it,lt,ct,mt,Jt,Yt;if(v==null||v==="")return{from:null,to:null};let ce=null,Je=null;if(Array.isArray(v))ce=d(v[0]),Je=d(v[1]);else if(typeof v=="object")ce=d((ct=(lt=(it=v.from)!=null?it:v.start)!=null?lt:v.dateFrom)!=null?ct:v.departure),Je=d((Yt=(Jt=(mt=v.to)!=null?mt:v.end)!=null?Jt:v.dateTo)!=null?Yt:v.return);else{const ln=String(v).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];ce=d(ln[0]),Je=d(ln[1])}return ce&&Je&&ce>Je&&([ce,Je]=[Je,ce]),{from:ce,to:Je}},g=v=>{const ce=[],Je=new Set,it=lt=>{const ct=k(lt);if(!ct.from)return;const mt=`${ct.from||""}|${ct.to||""}`;Je.has(mt)||(Je.add(mt),ce.push(ct))};if(v==null||v==="")return ce;if(Array.isArray(v))if(v.every(ct=>ct==null||typeof ct=="string"||typeof ct=="number"||ct instanceof Date)){const ct=v.map(d).filter(Boolean);for(let mt=0;mt<ct.length;mt+=2)it({from:ct[mt],to:ct[mt+1]||null})}else v.forEach(ct=>it(ct));else if(typeof v=="object"&&Array.isArray(v.ranges))v.ranges.forEach(lt=>it(lt));else if(typeof v=="object")it(v);else{const ct=(String(v).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(d).filter(Boolean);for(let mt=0;mt<ct.length;mt+=2)it({from:ct[mt],to:ct[mt+1]||null})}return ce.sort((lt,ct)=>O(lt.from,ct.from)||O(lt.to,ct.to))},P=v=>{const ce=[];return oe(v).forEach(Je=>{const it=d(Je);it&&!ce.includes(it)&&ce.push(it)}),ce.sort()},K=v=>a==="range"?k(v):a==="range-multiple"?g(v):a==="multiple"?P(v):d(v),ee=()=>{var v;return d(o((v=n.min)!=null?v:n.minDate))},Ce=()=>{var v;return d(o((v=n.max)!=null?v:n.maxDate))},E=()=>o(n.locale)||void 0,p=()=>{var ce,Je;const v=Number(o((Je=(ce=n.firstDayOfWeek)!=null?ce:n.weekStart)!=null?Je:1));return Number.isFinite(v)?(v%7+7)%7:1},A=()=>{var Je;const v=a==="range"||a==="range-multiple"?2:1,ce=Number((Je=o(n.monthsToShow))!=null?Je:v);return Math.max(1,Math.min(4,Number.isFinite(ce)?ce:v))},L=()=>{const v=ee(),ce=Ce();let Je=d(o(n.defaultMonth))||re();return v&&Je<v&&(Je=v),ce&&Je>ce&&(Je=ce),Je||v||ce||re()},ae=()=>o(n.confirm)?We:Xe,ke=v=>{const ce=se(v);return ce?{date:v,value:v,year:ce.getFullYear(),month:ce.getMonth()+1,day:ce.getDate(),weekday:ce.getDay(),today:ue(v,re())}:{date:v,value:v}},Te=(v,ce)=>v==null?!1:Array.isArray(v)?v.some(Je=>d(Je)===ce):v instanceof Set?v.has(ce):typeof v=="function"?!!v(ce,ke(ce)):typeof v=="string"||v instanceof Date||typeof v=="number"?d(v)===ce:!1,ze=v=>{var Yt,ln,nn,An,Sn,mn,Tn,qn,Yn,Ls,js,Hs,Ws;if(!v)return!1;const ce=ee(),Je=Ce();if(ce&&v<ce||Je&&v>Je)return!1;const it=o((ln=(Yt=n.options)!=null?Yt:n.enableDates)!=null?ln:n.allowedDates);if(it!=null&&!Te(it,v))return!1;const lt=o((An=(nn=n.disableDates)!=null?nn:n.disabledDates)!=null?An:n.notAllowedDates);if(lt!=null&&Te(lt,v))return!1;const ct=(Sn=se(v))==null?void 0:Sn.getDay();if(Array.isArray(o((mn=n.allowedWeekdays)!=null?mn:n.weekdays))&&ct!=null&&!o((Tn=n.allowedWeekdays)!=null?Tn:n.weekdays).map(Es=>Number(Es)).includes(ct)||o(n.weekdaysOnly)&&(ct===0||ct===6)||o(n.weekendsOnly)&&ct!=null&&ct!==0&&ct!==6)return!1;const mt=ae(),Jt=a==="range"?mt!=null&&mt.from&&!(mt!=null&&mt.to)?mt:null:a==="range-multiple"&&Array.isArray(mt)&&mt.length&&(qn=mt[mt.length-1])!=null&&qn.from&&!((Yn=mt[mt.length-1])!=null&&Yn.to)?mt[mt.length-1]:null;if(Jt!=null&&Jt.from){const Is=Math.abs(Y(Jt.from,v)),Es=Number(o((js=(Ls=n.minRange)!=null?Ls:n.minDays)!=null?js:n.minNights)),Us=Number(o((Ws=(Hs=n.maxRange)!=null?Hs:n.maxDays)!=null?Ws:n.maxNights));if(Number.isFinite(Es)&&Is<Es||Number.isFinite(Us)&&Is>Us)return!1}return!0},V=v=>{var it,lt;if(!v)return"";const ce=se(v);return!ce||String(o((lt=(it=n.displayMask)!=null?it:n.mask)!=null?lt:"")||"").toLowerCase()==="iso"||o(n.isoDisplay)===!0?v:new Intl.DateTimeFormat(E(),{year:"numeric",month:"short",day:"2-digit"}).format(ce)},H=(v,ce=w)=>{if(a==="range-multiple")return!Array.isArray(v)||!v.length?"":v.length>2&&o(n.compactMultiple)!==!1?`${v.length} ${o(n.multipleRangeLabel)||"intervalli selezionati"}`:v.map(lt=>{const ct=lt!=null&<.from?V(lt.from):"",mt=lt!=null&<.to?V(lt.to):"";return ct&&mt?`${ct} -> ${mt}`:ct||mt||""}).filter(Boolean).join("; ");if(a==="multiple")return!Array.isArray(v)||!v.length?"":v.length>3&&o(n.compactMultiple)!==!1?`${v.length} ${o(n.multipleLabel)||"date selezionate"}`:v.map(V).join(", ");if(a==="range"){const lt=v!=null&&v.from?V(v.from):"",ct=v!=null&&v.to?V(v.to):"";return lt&&ct?`${lt} -> ${ct}`:lt||ct||""}const Je=V(v);if(!U())return Je;const it=rt(ce);return[Je,it].filter(Boolean).join(" \u2022 ")},te=v=>(String(v||"").match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(d).filter(Boolean),De=v=>{if(v==null||v==="")return a==="multiple"||a==="range-multiple"?[]:a==="range"?{from:null,to:null}:null;const ce=te(v);if(a==="range-multiple"){const Je=[];for(let it=0;it<ce.length;it+=2)ce[it]&&Je.push({from:ce[it],to:ce[it+1]||null});return Je}return a==="multiple"?ce:a==="range"?{from:ce[0]||null,to:ce[1]||null}:ce[0]||d(v)},je=()=>a==="multiple"||a==="range-multiple"?[]:a==="range"?{from:null,to:null}:null,_e=(v,ce=null)=>{var mt;if(!U())return null;const Je=W(),it=o(n.timeValue),lt=v!=null?v:it,ct=kn(lt,Je);return Ut((mt=ct!=null?ct:ce)!=null?mt:null)},Me=()=>o(n.confirm)?ie:w,Ie=(v=Xe,ce=w)=>a==="single"&&U()?ji(v||null,ce,W()):j(v),Ye=(v=Xe,ce=w)=>JSON.stringify(Ie(v,ce)),rt=v=>ho(v,W());let Xe=K(N),We=y(Xe),w=_e(N,kn(o(n.timeValue),W())),ie=Ut(w),$e=null,F=null,f=be(a==="range"?(Xe==null?void 0:Xe.from)||(Xe==null?void 0:Xe.to)||L():a==="range-multiple"?((qe=Xe==null?void 0:Xe[Xe.length-1])==null?void 0:qe.from)||((pt=Xe==null?void 0:Xe[Xe.length-1])==null?void 0:pt.to)||L():a==="multiple"?Xe[0]||L():Xe||L()),r=null,x=null;const de=v=>{const ce=v instanceof Date?v:se(d(v));if(!ce)return-1;const Je=ce.getFullYear(),it=ce.getMonth();for(let lt=0;lt<A();lt+=1){const ct=fe(f,lt);if(ct.getFullYear()===Je&&ct.getMonth()===it)return lt}return-1},Be={...n,label:(Ft=n.label)!=null?Ft:n.placeholder},He=Be.label!=null||JSswift.ui.getSlot(c,"label")!=null,Se=a==="range"?"Seleziona andata e ritorno":a==="range-multiple"?"Seleziona intervalli":a==="multiple"?"Seleziona date":"Seleziona data",Oe=i?null:_.input({class:Z(["cms-input","cms-date-display",S,ye(n.manualInput,"is-manual"),n.inputClass]),type:"text",autocomplete:"off",placeholder:He?"":(Gt=n.placeholder)!=null?Gt:Se,readOnly:!o(n.manualInput),disabled:!!o(n.disabled),value:H(Xe,w)}),at=_.div({style:{display:"contents"}}),nt=i?null:_.div({class:"cms-date-control",style:{display:"contents"}},Oe,at),Ze=i?null:Ae.FormField({...Be,iconRight:(tn=n.iconRight)!=null?tn:"calendar_month",control:nt,getValue:()=>Oe.value,onClear:()=>{o(n.disabled)||o(n.readonly)||(Rt(je(),null),r&&dn())},onFocus:()=>Oe.focus()}),wt=(v,ce={})=>{var lt,ct;const Je=ce.focusIso||(a==="range"?(v==null?void 0:v.from)||(v==null?void 0:v.to)||L():a==="range-multiple"?((lt=v==null?void 0:v[v.length-1])==null?void 0:lt.from)||((ct=v==null?void 0:v[v.length-1])==null?void 0:ct.to)||L():a==="multiple"?(v==null?void 0:v[0])||L():v||L());let it=be(Je);if(ce.preserveMonthOffset){const mt=Number.isInteger(ce.visibleMonthOffset)?ce.visibleMonthOffset:de(ce.anchorIso||ce.focusIso||Je);mt>0&&(it=fe(it,-mt))}f=it},Nt=()=>{at.replaceChildren();const v=o(n.name);if(!v)return;const ce=(lt,ct)=>{at.appendChild(_.input({type:"hidden",name:lt,value:ct!=null?ct:""}))},Je=Xe;if(a==="single"){ce(v,Ie(Je,w));return}if(a==="range"){ce(o(n.nameFrom)||`${v}_from`,(Je==null?void 0:Je.from)||""),ce(o(n.nameTo)||`${v}_to`,(Je==null?void 0:Je.to)||"");return}if(a==="range-multiple"){const lt=Array.isArray(Je)?Je:[],ct=/\[\]$/.test(o(n.nameFrom)||"")?o(n.nameFrom):`${o(n.nameFrom)||`${v}_from`}[]`,mt=/\[\]$/.test(o(n.nameTo)||"")?o(n.nameTo):`${o(n.nameTo)||`${v}_to`}[]`;lt.forEach(Jt=>{ce(ct,(Jt==null?void 0:Jt.from)||""),ce(mt,(Jt==null?void 0:Jt.to)||"")});return}const it=/\[\]$/.test(v)?v:`${v}[]`;(Array.isArray(Je)?Je:[]).forEach(lt=>ce(it,lt))},Et=()=>{var v;i||(Oe.readOnly=!o(n.manualInput),Oe.disabled=!!o(n.disabled),Oe.setAttribute("aria-expanded",r?"true":"false"),Oe.value=H(Xe,w),Nt(),(v=Ze==null?void 0:Ze._refresh)==null||v.call(Ze))},Rt=(v,ce,Je={})=>{var Jt,Yt,ln;const it=K(v),lt=U()?Ut((Jt=kn(Je.timeValue!=null?Je.timeValue:Je.preserveTime?Me():v,W()))!=null?Jt:Je.preserveTime?Me():null):null,ct=Ye(Xe,w);Xe=y(it),We=y(it),U()&&(w=Ut(lt),ie=Ut(lt)),$e=null,wt(it,Je),Et(),rn(),M&&Je.fromModel!==!0&&M.set(Ie(it,lt));const mt=Ye(it,lt);if(Je.emit!==!1&&mt!==ct){const nn=Ie(it,lt);(Yt=n.onInput)==null||Yt.call(n,nn,ce),(ln=n.onChange)==null||ln.call(n,nn,ce)}return it},Mt=(v,ce,Je={})=>{var mt,Jt;if(!U())return null;const it=Ut(kn(v,W()));if(o(n.confirm)&&Je.commit!==!0)return ie=it,rn(),it;const lt=Ye(Xe,w);w=Ut(it),ie=Ut(it),Et(),rn(),M&&Je.fromModel!==!0&&M.set(Ie(Xe,it));const ct=Ye(Xe,it);if(Je.emit!==!1&&ct!==lt){const Yt=Ie(Xe,it);(mt=n.onInput)==null||mt.call(n,Yt,ce),(Jt=n.onChange)==null||Jt.call(n,Yt,ce)}return it},vt=(v,ce,Je={})=>{if(o(n.confirm)){We=y(K(v)),U()&&(Je.timeValue!=null||Je.preserveTime)&&(ie=Ut(kn(Je.timeValue!=null?Je.timeValue:Me(),W()))),$e=null,wt(We,Je),rn();return}Rt(v,ce,Je)},Dt=()=>{const v=ae();if(a==="range")return!(v!=null&&v.from)||v!=null&&v.to||!$e?v:O(v.from,$e)<=0?{from:v.from,to:$e}:{from:$e,to:v.from};if(a==="range-multiple"){const ce=Array.isArray(v)&&v.length?v[v.length-1]:null;return!(ce!=null&&ce.from)||ce!=null&&ce.to||!$e?ce:O(ce.from,$e)<=0?{from:ce.from,to:$e}:{from:$e,to:ce.from}}return v},ft=()=>{if(a==="range"){const v=Dt();return v!=null&&v.from?[v]:[]}if(a==="range-multiple"){const v=Array.isArray(ae())?ae():[];if(!v.length)return[];const ce=Dt();return ce!=null&&ce.from?[...v.slice(0,-1),ce]:v}return[]},Ht=v=>{const ce=ae();return a==="multiple"?ce.includes(v):a==="range-multiple"?Array.isArray(ce)&&ce.some(Je=>ue(Je==null?void 0:Je.from,v)||ue(Je==null?void 0:Je.to,v)):a==="range"?ue(ce==null?void 0:ce.from,v)||ue(ce==null?void 0:ce.to,v):ue(ce,v)},qt=v=>a!=="range"&&a!=="range-multiple"?!1:ft().some(ce=>(ce==null?void 0:ce.from)&&(ce==null?void 0:ce.to)&&v>=ce.from&&v<=ce.to),Xt=(v,ce={})=>{const Je=ae(),it=a==="range"?Je:a==="range-multiple"&&Array.isArray(Je)&&Je.length?Je[Je.length-1]:null;!(it!=null&&it.from)||it!=null&&it.to||$e===v||($e=v,ce.render!==!1&&rn())},Ot=()=>i||o(n.confirm)||n.closeOnSelect===!1?!1:a==="multiple"||a==="range-multiple"?!!n.closeOnSelect:!0,Qt=(v,ce,Je={})=>{var lt;if(!ze(v)||o(n.disabled)||o(n.readonly))return;const it={focusIso:v,anchorIso:v,preserveTime:U(),timeValue:Me(),preserveMonthOffset:!!r&&A()>1,visibleMonthOffset:Number.isInteger(Je.visibleMonthOffset)?Je.visibleMonthOffset:null};if(a==="multiple"){const ct=P(ae()),mt=ct.includes(v)?ct.filter(Jt=>Jt!==v):[...ct,v];vt(mt.sort(),ce,it),Ot()&&dn();return}if(a==="range"){const ct=y(ae());let mt;!ct.from||ct.from&&ct.to?mt={from:v,to:null}:O(v,ct.from)<0?mt={from:v,to:ct.from}:mt={from:ct.from,to:v},vt(mt,ce,it),mt.to&&Ot()&&dn();return}if(a==="range-multiple"){const ct=g(ae()),mt=ct.length?ct[ct.length-1]:null;let Jt;!(mt!=null&&mt.from)||mt!=null&&mt.to?Jt=[...ct,{from:v,to:null}]:O(v,mt.from)<0?Jt=[...ct.slice(0,-1),{from:v,to:mt.from}]:Jt=[...ct.slice(0,-1),{from:mt.from,to:v}],vt(Jt,ce,it),(lt=Jt[Jt.length-1])!=null&<.to&&Ot()&&dn();return}vt(v,ce,it),Ot()&&dn()},cn=()=>{F=null,Rt(je(),null,{timeValue:null})},un=()=>{const v=re();if(!ze(v)){wt(v),rn();return}if(a==="range"){const ce=le(v,1),Je=ce&&ze(ce)?{from:v,to:ce}:{from:v,to:null};vt(Je,null);return}if(a==="range-multiple"){const ce=le(v,1),Je=ce&&ze(ce)?[{from:v,to:ce}]:[{from:v,to:null}];vt(Je,null);return}if(a==="multiple"){vt([v],null);return}vt(v,null,{preserveTime:U(),timeValue:Me()})},Zt=(v={})=>{Qo(x,v)},pn=()=>{if(!U())return;const v=go(x);Mt(new Date,null,{commit:!o(n.confirm)}),Zt({scrollState:v}),!o(n.confirm)&&n.closeOnSelect===!0&&dn()},en=()=>{o(n.confirm)&&(Rt(We,null,{timeValue:ie,preserveTime:!0}),n.closeOnSelect!==!1&&dn())},rn=()=>{var fi,mi,pi,hi,gi,yi,bi,wi,vi,Si,Ci,xi,_i,ki,Ni,Ai,Li,Ii,Ei;if(!x)return;const v=E(),ce=new Intl.DateTimeFormat(v,{month:"long",year:"numeric"}),Je=new Intl.DateTimeFormat(v,{weekday:"short"}),it=Array.from({length:7},(Lt,Vt)=>{const Ln=(p()+Vt)%7;return Je.format(new Date(2024,0,7+Ln))}),lt=ae(),ct=Lt=>{let Vt=JSswift.ui.renderSlot(c,"point",Lt,null);return Vt==null&&(Vt=JSswift.ui.renderSlot(c,"dayPoint",Lt,null)),Vt==null&&n.pointIcon!=null&&(Lt.selected||Lt.inRange||Lt.today)&&(Vt=typeof n.pointIcon=="string"?Ae.Icon({name:n.pointIcon,size:10}):JSswift.ui.slot(n.pointIcon,Lt)),T(null,"default",Lt,Vt)},mt=(Lt,Vt)=>{const Ln=Lt.getFullYear(),Gs=Lt.getMonth(),Ks=new Date(Ln,Gs,1),_o=(Ks.getDay()-p()+7)%7,$o=new Date(Ln,Gs,1-_o),ko=_.div({class:"cms-date-month"});ko.appendChild(_.div({class:"cms-date-month-title"},ce.format(Ks)));const zi=_.div({class:"cms-date-weekdays"});it.forEach(qs=>zi.appendChild(_.div({class:"cms-date-weekday"},qs))),ko.appendChild(zi);const Pi=_.div({class:"cms-date-grid"});for(let qs=0;qs<42;qs+=1){const Vo=new Date($o.getFullYear(),$o.getMonth(),$o.getDate()+qs),Cn=q(Vo),Ti=Vo.getMonth()===Gs,Ji=Ht(Cn),Ri=qt(Cn),Mi=(a==="range"||a==="range-multiple")&&ft().some(bn=>ue(bn==null?void 0:bn.from,Cn)),Oi=(a==="range"||a==="range-multiple")&&ft().some(bn=>ue(bn==null?void 0:bn.to,Cn)),Bo=!ze(Cn),jo={...ke(Cn),selected:Ji,inRange:Ri,rangeStart:Mi,rangeEnd:Oi,disabled:Bo,outside:!Ti,value:lt,select:()=>Qt(Cn,null,{visibleMonthOffset:Vt})},Ho=ct(jo),dl=JSswift.ui.renderSlot(c,"day",jo,String(Vo.getDate())),fl=T(null,"default",jo,dl),ml=_.button({type:"button",class:Z(["cms-date-day",ye(!Ti,"is-outside"),ye(Ji,"is-selected"),ye(Ri,"is-in-range"),ye(Mi,"is-range-start"),ye(Oi,"is-range-end"),ye(Bo,"is-disabled"),ye(ue(Cn,re()),"is-today"),ye(Ho.length,"has-point")]),disabled:Bo,onMouseDown:bn=>{bn.button===0&&(F=Cn,bn.preventDefault(),Qt(Cn,bn,{visibleMonthOffset:Vt}))},onClick:bn=>{if(F!=null&&bn.detail!==0){F=null;return}F=null,Qt(Cn,bn,{visibleMonthOffset:Vt})},onMouseEnter:()=>Xt(Cn),onFocus:()=>Xt(Cn,{render:!1})},_.span({class:"cms-date-day-label"},...fl),Ho.length?_.span({class:"cms-date-day-point"},...Ho):null);Pi.appendChild(ml)}return ko.appendChild(Pi),ko},Jt=ee(),Yt=Ce(),ln=[f.getFullYear(),(fi=se(re()))==null?void 0:fi.getFullYear(),(mi=se(Jt))==null?void 0:mi.getFullYear(),(pi=se(Yt))==null?void 0:pi.getFullYear(),(hi=se(o(n.defaultMonth)))==null?void 0:hi.getFullYear()];a==="range"?ln.push((gi=se(lt==null?void 0:lt.from))==null?void 0:gi.getFullYear(),(yi=se(lt==null?void 0:lt.to))==null?void 0:yi.getFullYear()):a==="range-multiple"?lt.forEach(Lt=>{var Vt,Ln;ln.push((Vt=se(Lt==null?void 0:Lt.from))==null?void 0:Vt.getFullYear(),(Ln=se(Lt==null?void 0:Lt.to))==null?void 0:Ln.getFullYear())}):a==="multiple"?lt.forEach(Lt=>{var Vt;return ln.push((Vt=se(Lt))==null?void 0:Vt.getFullYear())}):ln.push((bi=se(lt))==null?void 0:bi.getFullYear());const nn=ln.filter(Lt=>Number.isFinite(Lt)),An=(nn.length?Math.min(...nn):f.getFullYear())-100,Sn=(nn.length?Math.max(...nn):f.getFullYear())+50,mn=Number(o((Si=(vi=n.yearStart)!=null?vi:Jt?(wi=se(Jt))==null?void 0:wi.getFullYear():null)!=null?Si:An)),Tn=Number(o((_i=(xi=n.yearEnd)!=null?xi:Yt?(Ci=se(Yt))==null?void 0:Ci.getFullYear():null)!=null?_i:Sn)),qn=_.select({class:"cms-date-select",value:String(f.getMonth()),onChange:Lt=>{var Vt;f=new Date(f.getFullYear(),Number(Lt.currentTarget.value),1),(Vt=n.onNavigate)==null||Vt.call(n,{month:f.getMonth()+1,year:f.getFullYear()}),rn()}},...Array.from({length:12},(Lt,Vt)=>xs({value:String(Vt)},new Intl.DateTimeFormat(v,{month:"long"}).format(new Date(2024,Vt,1))))),Yn=_.select({class:"cms-date-select cms-date-select-year",value:String(f.getFullYear()),onChange:Lt=>{var Vt;f=new Date(Number(Lt.currentTarget.value),f.getMonth(),1),(Vt=n.onNavigate)==null||Vt.call(n,{month:f.getMonth()+1,year:f.getFullYear()}),rn()}},...Array.from({length:Math.max(1,Tn-mn+1)},(Lt,Vt)=>{const Ln=mn+Vt;return xs({value:String(Ln)},String(Ln))})),Ls=_.div({class:"cms-date-header"},_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Lt;f=fe(f,-1),(Lt=n.onNavigate)==null||Lt.call(n,{month:f.getMonth()+1,year:f.getFullYear()}),rn()}},Ae.Icon({name:"chevron_left",size:16})),_.div({class:"cms-date-header-center"},qn,Yn),_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Lt;f=fe(f,1),(Lt=n.onNavigate)==null||Lt.call(n,{month:f.getMonth()+1,year:f.getFullYear()}),rn()}},Ae.Icon({name:"chevron_right",size:16}))),js=_.div({class:"cms-date-shortcuts"}),Hs=o((ki=n.shortcuts)!=null?ki:n.presets)||[];Hs.forEach((Lt,Vt)=>{var Ks,_o;if(!Lt)return;const Ln=typeof Lt.value=="function"?Lt.value({today:re()}):Lt.value,Gs=(_o=(Ks=Lt.label)!=null?Ks:Lt.text)!=null?_o:`Preset ${Vt+1}`;js.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>vt(Ln,null,{preserveTime:U(),timeValue:Me()})},Gs))});const Ws=_.div({class:"cms-date-months"});for(let Lt=0;Lt<A();Lt+=1)Ws.appendChild(mt(fe(f,Lt),Lt));const Is=H(lt,Me()),Es=_.div({class:"cms-date-value"},...T(c,"value",{value:lt,displayValue:Is,mode:a,timeValue:Me()},Is||T(c,"default",{},s))),Us=_.div({class:"cms-time-header"}),il=_.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"));Us.appendChild(il);const ll=U()?Xo({props:{min:o((Ni=n.timeMin)!=null?Ni:n.minTime),max:o((Ai=n.timeMax)!=null?Ai:n.maxTime),use12h:o((Ii=(Li=n.time12h)!=null?Li:n.use12h)!=null?Ii:n.ampm),hoursLabel:o(n.timeHoursLabel)||"Ore",minutesLabel:o(n.timeMinutesLabel)||"Min",secondsLabel:o(n.timeSecondsLabel)||"Sec"},slots:c,slotPrefix:"time",value:Me(),withSeconds:!1,minuteStep:1,secondStep:B(),disabled:!!o(n.disabled),readonly:!!o(n.readonly),embedded:!0,pointIcon:o(n.timePointIcon),shortcuts:o((Ei=n.timeShortcuts)!=null?Ei:n.timePresets),onSelect:Lt=>{const Vt=go(x);Mt(Lt,null),Zt({scrollState:Vt})}}):null,rl=_.div({class:"cms-date-footer-info"},Es),al=_.div({class:Z(["cms-date-footer",ye(U(),"has-time")])},rl,_.div({class:"cms-date-actions"},_.button({type:"button",class:"cms-date-action",onClick:un},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:en},o(n.applyLabel)||"Applica"):null)),cl=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:pn},o(n.nowLabel)||"Ora")),ul=U()?_.div({class:"cms-date-time"},Us,ll,cl):null;x.replaceChildren(_.div({class:"cms-date-panel-root",onKeydown:Lt=>{var Vt;Lt.key==="Escape"&&(Lt.preventDefault(),i?(Vt=n.onEscape)==null||Vt.call(n,Lt):dn())}},Ls,Hs.length?js:null,_.div({class:"cms-data-time"},Ws,ul),al))};function Vn(){var v,ce,Je,it;return r||o(n.disabled)||o(n.readonly)||(We=y(Xe),ie=Ut(w),$e=null,F=null,wt(We),r=JSswift.overlay.open(({close:lt})=>{var Jt;const ct=a==="range"||a==="range-multiple"?2:1,mt=Number((Jt=o(n.monthsToShow))!=null?Jt:ct);return x=_.div({class:Kt(["cms-date-panel",o(S),ye(mt>1,"multi-month"),n.panelClass])}),rn(),x},{type:"date",anchorEl:Ze._control||Oe,placement:n.placement||"bottom-start",offsetX:(v=n.offsetX)!=null?v:0,offsetY:(Je=(ce=n.offsetY)!=null?ce:n.offset)!=null?Je:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:n.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Kt(["cms-date-overlay",n.panelClass,ye(U(),"has-time")]),onClose:()=>{var lt;r=null,x=null,$e=null,Et(),(lt=n.onClose)==null||lt.call(n)}}),n.panelStyle&&Object.assign(r.panel.style,n.panelStyle),_s(r),Et(),(it=n.onOpen)==null||it.call(n)),r}function dn(){if(!r)return;F=null;const v=r;ks(v,()=>JSswift.overlay.close(v.id))}if(i){const v=a==="range"||a==="range-multiple"?2:1,ce=Number((sn=o(n.monthsToShow))!=null?sn:v);x=_.div({class:Kt(["cms-date-panel","cms-date-calendar",o(S),ye(ce>1,"multi-month"),n.panelClass,n.class]),style:n.style})}return i||Oe.addEventListener("focus",v=>{var ce;(ce=n.onFocus)==null||ce.call(n,v),n.openOnFocus!==!1&&Vn()}),i||Oe.addEventListener("click",v=>{var ce;(ce=n.onClick)==null||ce.call(n,v),Vn()}),i||Oe.addEventListener("keydown",v=>{if(v.key==="Escape"){r&&(v.preventDefault(),dn());return}(v.key==="ArrowDown"||v.key==="Enter"||v.key===" ")&&(v.preventDefault(),Vn()),(v.key==="Backspace"||v.key==="Delete")&&!o(n.manualInput)&&o(n.clearable)!==!1&&(v.preventDefault(),cn())}),!i&&o(n.manualInput)?(Oe.addEventListener("input",v=>{var ce;(ce=n.onTyping)==null||ce.call(n,Oe.value,v)}),Oe.addEventListener("change",v=>{const ce=De(Oe.value);Rt(ce,v,{timeValue:kn(Oe.value,W()),preserveTime:!kn(Oe.value,W())})}),Oe.addEventListener("blur",v=>{var Je;(Je=n.onBlur)==null||Je.call(n,v);const ce=De(Oe.value);Oe.value===""?cn():Rt(ce,v,{timeValue:kn(Oe.value,W()),preserveTime:!kn(Oe.value,W())})})):i||Oe.addEventListener("blur",v=>{var ce;return(ce=n.onBlur)==null?void 0:ce.call(n,v)}),M&&M.watch(v=>{const ce=K(v),Je=_e(v);Ye(ce,Je)!==Ye(Xe,w)&&(Xe=ce,We=y(Xe),w=Ut(Je),ie=Ut(Je),$e=null,wt(Xe),Et(),rn())},i?"UI.Calendar:watch":"UI.Datepicker:watch"),JSswift.reactive.effect(()=>{!M&&n.value!=null?(Xe=K(o(n.value)),We=y(Xe),w=_e(o(n.value)),ie=Ut(w)):U()&&n.timeValue!=null&&(w=_e(o(n.timeValue)),ie=Ut(w)),Et(),rn(),r&&o(n.disabled)&&dn()},i?"UI.Calendar:render":"UI.Datepicker:render"),i?(x._calendar=x,x._date=x,x._getValue=()=>Ie(Xe,w),x._setValue=v=>Rt(v,null,{emit:!1,timeValue:_e(v)}),x._clear=cn,x._select=v=>{const ce=d(v);ce&&Qt(ce,null)},x._time=()=>Ut(w),x):(Ze._input=Oe,Ze._date=Oe,Ze._open=Vn,Ze._close=dn,Ze._getValue=()=>Ie(Xe,w),Ze._setValue=v=>Rt(v,null,{emit:!1,timeValue:_e(v)}),Ze._time=()=>Ut(w),Ze._panel=()=>(r==null?void 0:r.panel)||null,Ze)};Ae.Datepicker=(...t)=>Zo(t),Ae.Calendar=(...t)=>Zo(t,{calendar:!0}),Ae.Date=Ae.Datepicker,JSswift.ui.Datepicker=Ae.Datepicker,JSswift.ui.Calendar=Ae.Calendar,JSswift.ui.Date=Ae.Date,Ae.Time=(...t)=>{var X,d,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=xt(e.size,()=>{const g=String(o(e.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(g)?`cms-size-${g}`:""}),c=()=>{var P,K,ee,Ce,E;const g=Kn(kn(b?b.get():(P=o(e.value))!=null?P:M,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((K=e.withSeconds)!=null?K:e.showSeconds)||/:\d{2}:\d{2}$/.test(g),min:o((ee=e.min)!=null?ee:e.minTime),max:o((Ce=e.max)!=null?Ce:e.maxTime),use12h:o((E=e.use12h)!=null?E:e.ampm)}},S=()=>{var P;const g=Number(o((P=e.minuteStep)!=null?P:1));return Math.max(1,Math.min(30,Number.isFinite(g)?g:5))},u=()=>{var P;const g=Number(o((P=e.secondStep)!=null?P:1));return Math.max(1,Math.min(30,Number.isFinite(g)?g:5))},a=e.model||(Ct(e.value)||ht(e.value)?e.value:null),b=an(a,"UI.Time:model"),M=b?b.get():o(e.value),N=g=>kn(g,c()),C=g=>ho(g,c()),z=g=>Kn(g,c()),U=g=>JSON.stringify(z(g));let W=Ut(N(M)),ge=Ut(W),B=null,ne=null;const he={...e,label:(X=e.label)!=null?X:e.placeholder},q=he.label!=null||JSswift.ui.getSlot(s,"label")!=null,se=_.input({class:Z(["cms-input","cms-time-display",i,ye(e.manualInput,"is-manual"),e.inputClass]),type:"text",autocomplete:"off",placeholder:q?"":(d=e.placeholder)!=null?d:"Seleziona orario",readOnly:!o(e.manualInput),disabled:!!o(e.disabled),value:C(W)});se.setAttribute("aria-haspopup","dialog");const le=_.div({style:{display:"contents"}}),fe=_.div({class:"cms-time-control",style:{display:"contents"}},se,le),be=Ae.FormField({...he,iconRight:(k=e.iconRight)!=null?k:"schedule",control:fe,getValue:()=>se.value,onClear:()=>{o(e.disabled)||o(e.readonly)||(Y(null,null,{commit:!0}),B&&j())},onFocus:()=>se.focus()}),re=()=>o(e.confirm)?ge:W,ue=()=>{le.replaceChildren();const g=o(e.name);g&&le.appendChild(_.input({type:"hidden",name:g,value:z(W)}))},O=()=>{var g;se.readOnly=!o(e.manualInput),se.disabled=!!o(e.disabled),se.setAttribute("aria-expanded",B?"true":"false"),se.value=C(W),ue(),(g=be._refresh)==null||g.call(be)},Y=(g,P,K={})=>{var p,A;const ee=Ut(N(g));if(o(e.confirm)&&K.commit!==!0)return ge=Ut(ee),m(),ee;const Ce=U(W);W=Ut(ee),ge=Ut(ee),O(),m(),b&&K.fromModel!==!0&&b.set(z(ee));const E=U(ee);if(K.emit!==!1&&E!==Ce){const L=z(ee);(p=e.onInput)==null||p.call(e,L,P),(A=e.onChange)==null||A.call(e,L,P)}return ee},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",we=(g={})=>{Qo(ne,g)},R=()=>{const g=go(ne);Y(new Date,null,{commit:!o(e.confirm)}),we({scrollState:g}),!o(e.confirm)&&e.closeOnSelect===!0&&j()},h=()=>{o(e.confirm)&&(Y(ge,null,{commit:!0}),e.closeOnSelect!==!1&&j())},m=()=>{var A,L,ae,ke;if(!ne)return;const g=re(),P=C(g),K=_.div({class:"cms-time-header"}),ee=_.div({class:"cms-time-columns"},_.div({class:"cms-time-column-title"},o(e.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},o(e.minutesLabel)||"Min")),Ce=c().withSeconds;Ce&&ee.appendChild(_.div({class:"cms-time-column-title"},o(e.secondsLabel)||"Sec")),K.appendChild(ee);const E=Xo({props:{min:o((A=e.min)!=null?A:e.minTime),max:o((L=e.max)!=null?L:e.maxTime),use12h:o((ae=e.use12h)!=null?ae:e.ampm),hoursLabel:o(e.hoursLabel)||"Ore",minutesLabel:o(e.minutesLabel)||"Min",secondsLabel:o(e.secondsLabel)||"Sec"},slots:s,value:g,withSeconds:Ce,minuteStep:S(),secondStep:u(),disabled:!!o(e.disabled),readonly:!!o(e.readonly),pointIcon:o(e.pointIcon),shortcuts:o((ke=e.shortcuts)!=null?ke:e.presets),onSelect:(Te,ze)=>{const V=go(ne);Y(Te,null),we({scrollState:V}),oe(ze)&&j()}}),p=_.div({class:"cms-time-footer"},_.div({class:"cms-time-value"},...T(s,"value",{value:g,displayValue:P},P||T(s,"default",{},n))),_.div({class:"cms-time-actions"},_.button({type:"button",class:"cms-time-action",onClick:R},o(e.nowLabel)||"Ora"),o(e.clearable)!==!1?_.button({type:"button",class:"cms-time-action",onClick:()=>Y(null,null,{commit:!o(e.confirm)})},o(e.clearLabel)||"Reset"):null,o(e.confirm)?_.button({type:"button",class:"cms-time-action is-primary",onClick:h},o(e.applyLabel)||"Applica"):null));ne.replaceChildren(_.div({class:"cms-time-panel-root",onKeydown:Te=>{Te.key==="Escape"&&(Te.preventDefault(),j())}},K,E,p))};function y(){var g,P,K,ee;return B||o(e.disabled)||o(e.readonly)||(ge=Ut(W),B=JSswift.overlay.open(()=>(ne=_.div({class:Kt(["cms-time-panel",o(i),e.panelClass])}),m(),ne),{type:"time",anchorEl:be._control||se,placement:e.placement||"bottom-start",offsetX:(g=e.offsetX)!=null?g:0,offsetY:(K=(P=e.offsetY)!=null?P:e.offset)!=null?K:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:e.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Kt(["cms-time-overlay",e.panelClass]),onClose:()=>{var Ce;B=null,ne=null,O(),(Ce=e.onClose)==null||Ce.call(e)}}),e.panelStyle&&Object.assign(B.panel.style,e.panelStyle),_s(B),we(),O(),(ee=e.onOpen)==null||ee.call(e)),B}function j(){if(!B)return;const g=B;ks(g,()=>JSswift.overlay.close(g.id))}return se.addEventListener("focus",g=>{var P;(P=e.onFocus)==null||P.call(e,g),e.openOnFocus!==!1&&y()}),se.addEventListener("click",g=>{var P;(P=e.onClick)==null||P.call(e,g),y()}),se.addEventListener("keydown",g=>{if(g.key==="Escape"){B&&(g.preventDefault(),j());return}(g.key==="ArrowDown"||g.key==="Enter"||g.key===" ")&&(g.preventDefault(),y()),(g.key==="Backspace"||g.key==="Delete")&&!o(e.manualInput)&&o(e.clearable)!==!1&&(g.preventDefault(),Y(null,g,{commit:!0}))}),o(e.manualInput)?(se.addEventListener("input",g=>{var P;return(P=e.onTyping)==null?void 0:P.call(e,se.value,g)}),se.addEventListener("change",g=>Y(se.value,g)),se.addEventListener("blur",g=>{var P;(P=e.onBlur)==null||P.call(e,g),se.value===""?Y(null,g):Y(se.value,g)})):se.addEventListener("blur",g=>{var P;return(P=e.onBlur)==null?void 0:P.call(e,g)}),b&&b.watch(g=>{const P=Ut(N(g));U(P)!==U(W)&&(W=Ut(P),ge=Ut(P),O(),m())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!b&&e.value!=null&&(W=Ut(N(o(e.value))),ge=Ut(W)),O(),m(),B&&o(e.disabled)&&j()},"UI.Time:render"),be._input=se,be._time=se,be._open=y,be._close=j,be._getValue=()=>z(W),be._setValue=g=>Y(g,null,{emit:!1,commit:!0}),be._panel=()=>(B==null?void 0:B.panel)||null,be},Ae.Tabs=(...t)=>{var A,L,ae,ke,Te,ze;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(V,H)=>!!V&&Object.prototype.hasOwnProperty.call(V,H),c=V=>String(o(V)||"horizontal").toLowerCase()==="vertical"?"vertical":"horizontal",S=V=>{const H=String(o(V)||"").toLowerCase();return H==="pills"||H==="pill"?"pills":H==="soft"||H==="card"?"soft":"line"},u=V=>{var te;const H=o(V);return H==null||H===""?null:(te=JSswift.uiColors)!=null&&te.includes(H)?`var(--cms-${H})`:String(H)},a=(V,H)=>Object.is(V,H)||V!=null&&H!=null&&V==H,b=an(e.model,"UI.Tabs:model"),M=c(e.orientation||e.orient||e.direction),N=S(e.variant||(e.pills?"pills":e.soft?"soft":"line")),C=!!o((L=(A=e.fill)!=null?A:e.navFill)!=null?L:e.stretch),z=!!o(e.wrap),U=!!o(e.disabled),W=e.id||"cms-tabs-"+Math.random().toString(36).slice(2,9),ge=o((ae=e.tabs)!=null?ae:e.items)||[],B=(Array.isArray(ge)?ge:[ge]).map((V,H)=>{var _e,Me,Ie,Ye,rt,Xe,We,w,ie,$e,F,f,r,x;if(V==null)return null;if(typeof V!="object")return{raw:V,index:H,value:V,labelFallback:V,noteFallback:null,iconFallback:null,badgeFallback:null,disabled:!1,hidden:!1};const te=(Xe=(rt=(Ye=(Ie=(Me=(_e=V.value)!=null?_e:V.name)!=null?Me:V.id)!=null?Ie:V.key)!=null?Ye:V.label)!=null?rt:V.title)!=null?Xe:`tab-${H}`,De=($e=(ie=(w=(We=V.label)!=null?We:V.title)!=null?w:V.name)!=null?ie:V.value)!=null?$e:`Tab ${H+1}`,je=i(V,"badge")?V.badge:i(V,"counter")?V.counter:null;return{...V,raw:V,index:H,value:te,labelFallback:De,noteFallback:(r=(f=(F=V.note)!=null?F:V.subtitle)!=null?f:V.description)!=null?r:null,iconFallback:(x=V.icon)!=null?x:null,badgeFallback:je}}).filter(Boolean).filter(V=>V.hidden!==!0&&V.visible!==!1),ne=B.find(V=>!V.disabled)||null,he=V=>B.findIndex(H=>a(H.value,V)),q=(V,H)=>{var De;if(!B.length)return-1;let te=V;for(let je=0;je<B.length;je+=1)if(te+=H,te<0?te=B.length-1:te>=B.length&&(te=0),!((De=B[te])!=null&&De.disabled))return te;return-1},se=(V,H=!1)=>{var De,je;const te=he(V);return te>=0&&!((De=B[te])!=null&&De.disabled)?B[te].value:H?(je=ne==null?void 0:ne.value)!=null?je:null:V!=null?V:null},le=se(b?b.get():i(e,"value")?o(e.value):(ke=e.defaultValue)!=null?ke:e.default,!0),[fe,be]=JSswift.reactive.signal(le),re=Z(["cms-clear-set","cms-tabs","cms-singularity",M,`variant-${N}`,ye(e.dense,"dense"),ye(C,"fill"),ye(z,"wrap"),ye(U,"disabled"),e.class]),ue=JSswift.omit(e,["tabs","items","value","defaultValue","default","model","orientation","orient","direction","variant","pills","soft","fill","navFill","stretch","wrap","dense","disabled","slots","empty","gap","tabGap","align","justify","color","state","navClass","navStyle","barClass","barStyle","tabClass","tabStyle","itemClass","itemStyle","class","style"]);ue.class=re,ue.style={...e.style||{}},e.gap!=null&&(ue.style["--cms-tabs-gap"]=gt(e.gap)),e.tabGap!=null&&(ue.style["--cms-tabs-tab-gap"]=gt(e.tabGap));const O=u((Te=e.color)!=null?Te:e.state);O&&(ue.style["--cms-tabs-accent"]=O);const Y=_.div(ue),oe=_.div({class:Z(["cms-tabs-bar",e.barClass]),style:{alignItems:e.align||(M==="vertical"?"stretch":"center"),justifyContent:e.justify||"flex-start",...e.barStyle||{}}}),we=_.div({class:Z(["cms-tabs-nav",e.navClass]),style:e.navStyle||null,role:"tablist","aria-orientation":M}),R=[],h=()=>he(fe()),m=()=>{const V=h();return V>=0?B[V]:null},y=()=>({tabs:B,value:fe(),active:fe(),activeIndex:h(),activeTab:m(),orientation:M,variant:N,select:(V,H)=>g(V,{event:H,emit:!0}),next:()=>K(),prev:()=>ee()}),j=(V,H,te)=>({...y(),tab:V,index:H,active:te,disabled:!!V.disabled,select:De=>P(H,{event:De,emit:!0})}),X=V=>{var te;const H=(te=R[V])==null?void 0:te.btn;!H||typeof H.focus!="function"||requestAnimationFrame(()=>H.focus())},d=V=>{const H=he(V);Y.dataset.value=V==null?"":String(V),Y.dataset.activeIndex=H>=0?String(H):"",R.forEach(({btn:te,item:De,tab:je,index:_e})=>{const Me=_e===H;De.classList.toggle("active",Me),De.classList.toggle("disabled",!!(je.disabled||U)),te.classList.toggle("active",Me),te.setAttribute("aria-selected",Me?"true":"false"),te.setAttribute("tabindex",Me?"0":"-1")})},k=V=>{be(V),d(V)},g=(V,H={})=>{if(U)return null;const te=he(V);return te<0?null:P(te,H)},P=(V,H={})=>{var Me,Ie;const te=B[V];if(!te||te.disabled||U)return null;const De=te.value,je=fe(),_e=!a(je,De);return k(De),b&&!a(b.get(),De)&&b.set(De),H.focus&&X(V),H.event&&((Me=te.onClick)==null||Me.call(te,De,H.event,te,V)),_e&&H.emit!==!1&&((Ie=e.onChange)==null||Ie.call(e,De,te,H.event||null,V)),te},K=()=>{const V=q(h()<0?-1:h(),1);V>=0&&P(V,{emit:!0,focus:!0})},ee=()=>{const V=h()<0?0:h(),H=q(V,-1);H>=0&&P(H,{emit:!0,focus:!0})},Ce=(V,H)=>{var f,r,x,de,Be,He;const te=H===h(),De=j(V,H,te),je=`${W}-tab-${H}`,_e=V.iconFallback!=null?typeof V.iconFallback=="string"?Ae.Icon({name:V.iconFallback,size:(x=(r=(f=V.iconSize)!=null?f:V.size)!=null?r:e.size)!=null?x:null}):V.iconFallback:null,Me=T(s,"icon",De,_e),Ie=T(null,"default",{},JSswift.ui.renderSlot(s,"label",De,V.labelFallback)),Ye=T(s,"note",De,V.noteFallback),rt=T(s,"badge",De,V.badgeFallback),Xe=_.span({class:"cms-tabs-tab-inner"},Me.length?_.span({class:"cms-tabs-tab-icon"},...Me):null,_.span({class:"cms-tabs-tab-copy"},_.span({class:"cms-tabs-tab-label"},...Ie.length?Ie:[""]),Ye.length?_.span({class:"cms-tabs-tab-note"},...Ye):null),rt.length?_.span({class:"cms-tabs-tab-badge"},...rt):null),We=T(s,"tab",{...De,tabId:je,label:Ie,icon:Me,note:Ye,badge:rt},Xe),w=Se=>{var Ze;if(V.disabled||U)return;const Oe=Se.key;if(Oe==="Enter"||Oe===" "){Se.preventDefault(),P(H,{event:Se,emit:!0});return}if(Oe==="Home"){Se.preventDefault();const wt=B.findIndex(Nt=>!Nt.disabled);wt>=0&&P(wt,{event:Se,emit:!0,focus:!0});return}if(Oe==="End"){Se.preventDefault();let wt=-1;for(let Nt=B.length-1;Nt>=0;Nt-=1)if(!((Ze=B[Nt])!=null&&Ze.disabled)){wt=Nt;break}wt>=0&&P(wt,{event:Se,emit:!0,focus:!0});return}const at=M==="vertical"?["ArrowUp"]:["ArrowLeft"],nt=M==="vertical"?["ArrowDown"]:["ArrowRight"];if(at.includes(Oe)){Se.preventDefault();const wt=q(H,-1);wt>=0&&P(wt,{event:Se,emit:!0,focus:!0});return}if(nt.includes(Oe)){Se.preventDefault();const wt=q(H,1);wt>=0&&P(wt,{event:Se,emit:!0,focus:!0})}},ie=u((de=V.color)!=null?de:V.state),$e=_.div({class:Z(["cms-tabs-item",ye(te,"active"),ye(V.disabled||U,"disabled"),e.itemClass,V.itemClass]),style:{...ie?{"--cms-tabs-item-accent":ie}:{},...e.itemStyle||{},...V.itemStyle||{}},"data-name":String(V.value)}),F=Ae.Btn({class:Z(["cms-tabs-tab",ye(te,"active"),ye(V.disabled||U,"disabled"),e.tabClass,V.tabClass||V.class]),type:"button",id:je,role:"tab",disabled:!!(V.disabled||U),"aria-selected":te?"true":"false",tabindex:te?"0":"-1",size:(He=(Be=V.size)!=null?Be:e.size)!=null?He:null,style:{...e.tabStyle||{},...V.tabStyle||{}},onClick:Se=>{P(H,{event:Se,emit:!0})},onKeydown:w},...We);return $e.appendChild(F),$e.appendChild(_.span({class:"tab-indicator"})),R[H]={tab:V,index:H,item:$e,btn:F},$e};if(B.length){const V=B.map((te,De)=>Ce(te,De)),H=JSswift.ui.renderSlot(s,"nav",{...y(),nodes:V},V);T(null,"default",{},H).forEach(te=>we.appendChild(te))}else T(s,"empty",y(),(ze=e.empty)!=null?ze:_.div({class:"cms-tabs-empty"},"Nessuna tab disponibile.")).forEach(V=>we.appendChild(V));const E=y(),p=[...T(null,"default",{},JSswift.ui.renderSlot(s,"extra",E,null)),...T(s,"default",E,n)];return oe.appendChild(we),p.length&&oe.appendChild(_.div({class:"cms-tabs-extra"},...p)),Y.appendChild(oe),k(le),b?b.watch(V=>{k(se(V,!0))},"UI.Tabs:watch"):Ke(e.value)&&bt.reactive.effect(()=>{k(se(o(e.value),!0))},"UI.Tabs:value"),Y._getValue=()=>fe(),Y._setValue=V=>g(V,{emit:!0}),Y._select=V=>g(V,{emit:!0}),Y._next=()=>K(),Y._prev=()=>ee(),Y._getTabs=()=>B.slice(),At(Y,e),Y},Ae.RouteTab=(...t)=>{var X,d,k,g,P,K,ee,Ce,E,p,A,L,ae,ke,Te;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.router||(bt==null?void 0:bt.router)||null,c=ze=>Object.prototype.hasOwnProperty.call(e,ze),S=c("active")||c("selected"),u=ze=>{const V=String(o(ze)||"").toLowerCase();return V==="pill"||V==="pills"?"pills":V==="soft"||V==="card"?"soft":"line"},a=ze=>{var H;const V=o(ze);return V==null||V===""?null:(H=JSswift.uiColors)!=null&&H.includes(V)?`var(--cms-${V})`:String(V)},b=ze=>{if(ze==null||ze==="")return"";try{return new URL(String(ze),window.location.origin).pathname||""}catch(V){return String(ze).split(/[?#]/)[0]||""}},M=ze=>o(e.external)===!0?!0:ze?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(ze)):!1,N=()=>{var ze;return o((ze=e.href)!=null?ze:e.to)||"#"},C=()=>{var ze;return o((ze=e.to)!=null?ze:e.href)||""},z=()=>{try{if(i!=null&&i.current)return i.current().pathname||window.location.pathname||""}catch(ze){}return window.location.pathname||""},U=()=>{var _e,Me,Ie;const ze=C();if(!ze)return!1;const V=o((Me=(_e=e.match)!=null?_e:e.activeMatch)!=null?Me:e.routeMatch),H=String(o((Ie=e.matchMode)!=null?Ie:e.startsWith?"startsWith":e.exact?"exact":"")||"").toLowerCase(),te=z();if(typeof V=="function")return!!V({currentPath:te,to:ze,href:N(),router:i,props:e});if(V instanceof RegExp)return V.test(te);const De=b(typeof V=="string"&&!["exact","startsWith","prefix","section"].includes(V.toLowerCase())?V:ze);if(!De)return!1;const je=H||(typeof V=="string"&&["startsWith","prefix","section"].includes(V.toLowerCase())?"startsWith":"exact");return je==="startswith"||je==="prefix"||je==="section"?te===De||te.startsWith(`${De}/`):i!=null&&i.isActive?!!i.isActive(ze):te===De},W=()=>!!o(e.disabled);let ge=null;const B=()=>{var ze;return ge!=null?!!ge:S?!!o((ze=e.active)!=null?ze:e.selected):U()},ne=u(e.variant||(e.pills?"pills":e.soft?"soft":"line")),he=!o(e.color)&&o(e.state)?Bt(o(e.state)):"",q=he?`cms-state-${he}`:"",se=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"]);se.href=N(),se.class=Z(["cms-route-tab","cms-clear-set","cms-singularity",`variant-${ne}`,ye((X=e.block)!=null?X:e.fill,"block"),ye(e.dense,"dense"),q,e.class]),se.style={...e.style||{}};const le=a((d=e.color)!=null?d:e.state);le&&(se.style["--cms-route-tab-accent"]=le);const fe=(g=(k=e.iconSize)!=null?k:e.size)!=null?g:null,be=(ze,V)=>{const H=o(ze);return H==null||H===!1||H===""?null:typeof H=="string"?Ae.Icon({name:H,size:fe}):JSswift.ui.slot(H,{as:V})},re=()=>({active:B(),disabled:W(),href:N(),to:C(),external:M(N()),navigate:ze=>{var te,De;if(W())return!1;const V=C();return!M(N())&&V&&(i!=null&&i.navigate)?(ze!=null&&ze.preventDefault&&ze.preventDefault(),i.navigate(V),(te=e.onNavigate)==null||te.call(e,V,ze||null),!0):((De=e.onNavigate)==null||De.call(e,V||N(),ze||null),!1)}}),ue=T(s,"icon",re(),be(e.icon,"icon")),O=T(s,"label",re(),(ee=(K=(P=e.label)!=null?P:e.title)!=null?K:e.text)!=null?ee:n),Y=T(s,"note",re(),(p=(E=(Ce=e.note)!=null?Ce:e.subtitle)!=null?E:e.caption)!=null?p:e.description),oe=T(s,"badge",re(),(L=(A=e.badge)!=null?A:e.counter)!=null?L:e.count),we=T(s,"aside",re(),(ke=(ae=e.aside)!=null?ae:e.trailing)!=null?ke:be(e.iconRight,"iconRight")),R=T(s,"default",re(),(Te=e.content)!=null?Te:e.body),h=_.span({class:"cms-route-tab-inner"},ue.length?_.span({class:"cms-route-tab-icon"},...ue):null,_.span({class:"cms-route-tab-copy"},_.span({class:"cms-route-tab-label"},...O.length?O:[C()||N()||""]),Y.length?_.span({class:"cms-route-tab-note"},...Y):null,R.length?_.span({class:"cms-route-tab-extra"},...R):null),oe.length?_.span({class:"cms-route-tab-badge"},...oe):null,we.length?_.span({class:"cms-route-tab-aside"},...we):null),m=_.a(se,h);At(m,e);const y=()=>{const ze=B(),V=W(),H=N(),te=M(H);m.classList.toggle("active",ze),m.classList.toggle("is-disabled",V),m.classList.toggle("is-external",te),ze?m.setAttribute("aria-current",String(o(e.ariaCurrent)||"page")):m.removeAttribute("aria-current"),m.setAttribute("href",H||"#"),V?(m.setAttribute("aria-disabled","true"),m.tabIndex=-1):(m.removeAttribute("aria-disabled"),!c("tabIndex")&&!c("tabindex")&&m.removeAttribute("tabindex")),C()?m.dataset.to=String(C()):delete m.dataset.to,te&&m.target==="_blank"&&!m.rel&&(m.rel="noopener noreferrer")},j=e.onClick;return m.onclick=ze=>{if(j==null||j(ze),!ze.defaultPrevented){if(W()){ze.preventDefault();return}re().navigate(ze)}},!S&&C()&&(i!=null&&i.subscribe)&&i.subscribe(()=>y()),JSswift.reactive.effect(()=>{y()},"UI.RouteTab:render"),m._isActive=()=>B(),m._setActive=ze=>(ge=ze==null?null:!!ze,y(),m),m._navigate=ze=>re().navigate(ze),m},Ae.Breadcrumbs=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.router||(bt==null?void 0:bt.router)||null,c=an(e.model,"UI.Breadcrumbs:model"),S=xt(e.size,()=>{var Y;const O=o(e.size);return typeof O=="string"&&((Y=JSswift.uiSizes)!=null&&Y.includes(O))?`cms-size-${O}`:""}),u=xt(e.variant,()=>{const O=String(o(e.variant||(e.pills?"pills":e.soft?"soft":"line"))||"").toLowerCase();return O==="pill"||O==="pills"?"variant-pills":O==="soft"||O==="card"?"variant-soft":"variant-line"}),a=xt([e.wrap,e.nowrap],()=>o(e.wrap)===!1||o(e.nowrap)?"no-wrap":""),b=_.nav({class:Z(["cms-breadcrumbs","cms-clear-set",S,u,a,ye(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),M=_.div({class:"cms-breadcrumbs-before"}),N=_.ol({class:"cms-breadcrumbs-list"}),C=_.div({class:"cms-breadcrumbs-after"});b.appendChild(M),b.appendChild(N),b.appendChild(C);const z=O=>{var oe;const Y=o(O);return Y==null||Y===""?null:(oe=JSswift.uiColors)!=null&&oe.includes(Y)?`var(--cms-${Y})`:String(Y)},U=O=>{var oe;if(!O)return!1;if(o(O.external)===!0)return!0;const Y=o((oe=O.href)!=null?oe:O.to);return Y?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Y)):!1},W=O=>O!=null&&O.nodeType&&O.cloneNode?O.cloneNode(!0):O,ge=(O,Y)=>{O.innerHTML="",Y.forEach(oe=>O.appendChild(oe))},B=(O,Y,oe,we,R=null)=>{const h=JSswift.ui.getSlot(O,Y)!=null?T(O,Y,oe,we):[];return h.length?h:R&&JSswift.ui.getSlot(O,R)!=null?T(O,R,oe,we):T(null,"default",oe,we)},ne=(O,Y,oe)=>{const we=o(O);return we==null||we===!1||we===""?null:typeof we=="string"?Ae.Icon({name:we,size:Y}):JSswift.ui.slot(we,{as:oe})},he=()=>{var R,h;const O=c?c.get():o((h=(R=e.items)!=null?R:e.value)!=null?h:e.breadcrumbs),Y=[],oe=m=>{if(!(m==null||m===!1)){if(Array.isArray(m)){m.forEach(oe);return}if(typeof m=="string"||typeof m=="number"){Y.push({label:String(m)});return}if(m!=null&&m.nodeType||typeof m=="function"){Y.push({label:m});return}Y.push(m)}},we=o(e.home);return we&&oe(we===!0?{label:"Home",to:"/",icon:"home"}:we),oe(O),!Y.length&&(n!=null&&n.length)&&n.forEach(m=>oe(m)),Y.filter(m=>!o(m==null?void 0:m.hidden))},q=O=>{const Y=O.findIndex(oe=>{var we,R;return!!o((R=(we=oe==null?void 0:oe.current)!=null?we:oe==null?void 0:oe.active)!=null?R:oe==null?void 0:oe.selected)});return Y>-1?Y:o(e.autoCurrent)===!1?-1:O.length?O.length-1:-1},se=O=>{var y,j,X,d,k,g,P;const Y=Number(o((X=(j=(y=e.max)!=null?y:e.maxItems)!=null?j:e.collapseAfter)!=null?X:e.collapse)),oe=Number.isFinite(Y)?Math.max(0,Math.trunc(Y)):0;if(!oe||oe<3||O.length<=oe)return O.map((K,ee)=>({type:"item",item:K,index:ee,key:`item-${ee}`}));let we=Number(o((k=(d=e.leadingCount)!=null?d:e.keepStart)!=null?k:1)),R=Number(o((P=(g=e.trailingCount)!=null?g:e.keepEnd)!=null?P:Math.max(1,oe-2)));if(we=Number.isFinite(we)?Math.max(1,Math.trunc(we)):1,R=Number.isFinite(R)?Math.max(1,Math.trunc(R)):Math.max(1,oe-2),we+R+1>oe&&(R=Math.max(1,oe-we-1),we+R+1>oe&&(we=Math.max(1,oe-R-1))),we+R>=O.length)return O.map((K,ee)=>({type:"item",item:K,index:ee,key:`item-${ee}`}));const h=[];for(let K=0;K<we;K++)h.push({type:"item",item:O[K],index:K,key:`item-${K}`});const m=O.slice(we,O.length-R);h.push({type:"collapsed",key:`collapsed-${we}-${O.length-R}`,items:m,from:we,to:O.length-R-1});for(let K=O.length-R;K<O.length;K++)h.push({type:"item",item:O[K],index:K,key:`item-${K}`});return h},le=(O,Y=null)=>{var R,h,m,y,j;if(!O)return!1;const oe=o((R=O.href)!=null?R:O.to)||"",we=o(O.to)||"";return!U(O)&&we&&(i!=null&&i.navigate)?(Y!=null&&Y.preventDefault&&Y.preventDefault(),i.navigate(we),(h=O.onNavigate)==null||h.call(O,we,Y||null),(m=e.onNavigate)==null||m.call(e,we,O,Y||null),!0):((y=O.onNavigate)==null||y.call(O,we||oe,Y||null),(j=e.onNavigate)==null||j.call(e,we||oe,O,Y||null),!1)},fe=(O,Y,oe)=>{var j,X,d;const we=O,R=oe[Y+1]||null,h={index:Y,entry:O,previous:we,next:R},m=W(o((d=(X=(O==null?void 0:O.type)==="item"?(j=O.item)==null?void 0:j.separator:null)!=null?X:e.separator)!=null?d:"/")),y=B(s,"separator",h,m);return _.li({class:"cms-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"cms-breadcrumbs-separator"},...y))},be=(O,Y,oe)=>{const we={type:"collapsed",collapsed:!0,items:Y,hiddenItems:O.items,currentIndex:oe,from:O.from,to:O.to},R=_.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"))))),h=B(s,"collapsed",we,R,"item");return _.li({class:"cms-breadcrumbs-entry is-collapsed"},...h)},re=(O,Y,oe,we)=>{var _e,Me,Ie,Ye,rt,Xe,We,w,ie,$e,F,f,r,x,de,Be,He,Se,Oe,at,nt,Ze,wt,Nt,Et,Rt;const R=O.item||{},h=R.slots?{...s,...R.slots}:s,m=o((_e=R.href)!=null?_e:R.to)||"",y=!!o(R.disabled),j=O.index===oe,X=(Ye=(Ie=(Me=R.iconSize)!=null?Me:e.itemSize)!=null?Ie:e.size)!=null?Ye:null,d=z((We=(Xe=(rt=R.color)!=null?rt:R.state)!=null?Xe:e.color)!=null?We:e.state),k=!o(R.color)&&o(R.state)?Bt(o(R.state)):"",g=(f=(F=($e=(ie=(w=R.label)!=null?w:R.title)!=null?ie:R.text)!=null?$e:R.to)!=null?F:R.href)!=null?f:"",P=(de=(x=(r=R.note)!=null?r:R.subtitle)!=null?x:R.caption)!=null?de:R.description,K=(He=(Be=R.badge)!=null?Be:R.counter)!=null?He:R.count,ee=(Oe=(Se=R.aside)!=null?Se:R.trailing)!=null?Oe:ne(R.iconRight,X,"iconRight"),Ce=(at=R.content)!=null?at:R.body,E={item:R,index:O.index,visibleIndex:we,total:Y.length,current:j,active:j,disabled:y,href:m,to:o(R.to)||"",external:U(R),isFirst:O.index===0,isLast:O.index===Y.length-1,navigate:Mt=>le(R,Mt)},p=B(h,"icon",E,ne(R.icon,X,"icon")),A=B(h,"label",E,g),L=B(h,"note",E,P),ae=B(h,"badge",E,K),ke=B(h,"aside",E,ee),Te=B(h,"default",E,Ce),ze=_.span({class:"cms-breadcrumb-inner"},p.length?_.span({class:"cms-breadcrumb-icon"},...p):null,_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},...A.length?A:[m||""]),L.length?_.span({class:"cms-breadcrumb-note"},...L):null,Te.length?_.span({class:"cms-breadcrumb-extra"},...Te):null),ae.length?_.span({class:"cms-breadcrumb-badge"},...ae):null,ke.length?_.span({class:"cms-breadcrumb-aside"},...ke):null),V=!y&&(!j||!!o((nt=R.linkCurrent)!=null?nt:e.linkCurrent)),H={class:Z(["cms-breadcrumb","cms-clear-set","cms-singularity",ye(j,"is-current"),ye(j,"active"),ye(y,"is-disabled"),k?`cms-state-${k}`:"",R.class]),style:{...R.style||{}},"aria-current":j?String(o((Ze=R.ariaCurrent)!=null?Ze:e.ariaCurrent)||"page"):null};d&&(H.style["--cms-breadcrumb-accent"]=d);let te=null;V&&m?(te=_.a({...H,href:m,target:R.target,rel:R.rel,onClick:Mt=>{var vt,Dt;(vt=R.onClick)==null||vt.call(R,Mt,E),(Dt=e.onItemClick)==null||Dt.call(e,R,E,Mt),!Mt.defaultPrevented&&E.navigate(Mt)}},ze),E.external&&te.target==="_blank"&&!te.rel&&(te.rel="noopener noreferrer")):V&&typeof R.onClick=="function"?te=_.button({...H,type:R.type||"button",onClick:Mt=>{var vt,Dt;(vt=R.onClick)==null||vt.call(R,Mt,E),(Dt=e.onItemClick)==null||Dt.call(e,R,E,Mt)}},ze):te=_.span({...H,"aria-disabled":y?"true":null},ze),At(te,{size:(Nt=(wt=R.size)!=null?wt:e.itemSize)!=null?Nt:e.size,radius:(Et=R.radius)!=null?Et:e.radius,gradient:(Rt=R.gradient)!=null?Rt:e.gradient});const je=B(h,"item",E,te);return _.li({class:Z(["cms-breadcrumbs-entry",ye(j,"is-current"),ye(y,"is-disabled")])},...je)},ue=()=>{var h;const O=he(),Y=q(O),oe=se(O),we=z((h=e.color)!=null?h:e.state);b.classList.toggle("is-empty",O.length===0),we?b.style.setProperty("--cms-breadcrumb-accent",we):b.style.removeProperty("--cms-breadcrumb-accent");const R={items:O,visibleItems:oe,currentIndex:Y,count:O.length,collapsed:oe.some(m=>m.type==="collapsed")};if(ge(M,B(s,"before",R,e.before)),ge(C,B(s,"after",R,e.after)),N.innerHTML="",!O.length){const m=B(s,"empty",R,e.empty);m.length&&N.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...m));return}oe.forEach((m,y)=>{y>0&&N.appendChild(fe(oe[y-1],y-1,oe)),N.appendChild(m.type==="collapsed"?be(m,O,Y):re(m,O,Y,y))})};return bt.reactive.effect(()=>{ue()},"UI.Breadcrumbs:render"),b.getItems=()=>he(),b.getVisibleItems=()=>se(he()),b.refresh=()=>(ue(),b),b.setItems=O=>(c?c.set(O):e.items=O,ue(),b),At(b,e),b},Ae.Pagination=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=e.slots||{},s=an(e.model,"UI.Pagination:model"),i=xt(e.size,()=>{const d=o(e.size);return typeof d=="string"&&fs[d]?`cms-size-${d}`:""}),c=_.nav({class:Z(["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"}),u=_.div({class:"cms-pagination-start"}),a=_.div({class:"cms-pagination-pages"}),b=_.div({class:"cms-pagination-end"}),M=_.div({class:"cms-pagination-summary"});S.appendChild(u),S.appendChild(a),S.appendChild(b),c.appendChild(S),c.appendChild(M);let N=1,C=1;const z=(d,k=0)=>{const g=o(d);if(g==null||g==="")return k;const P=Number(g);return Number.isFinite(P)?Math.trunc(P):k},U=(d,k=W())=>{const g=Number(d),P=Number.isFinite(g)?Math.trunc(g):1;return Math.min(Math.max(P||1,1),Math.max(1,k||1))},W=()=>{var P,K,ee,Ce,E,p,A;const d=z((ee=(K=(P=e.max)!=null?P:e.pages)!=null?K:e.pageCount)!=null?ee:e.totalPages,0);if(d>0)return d;const k=z((E=(Ce=e.total)!=null?Ce:e.totalItems)!=null?E:e.count,0),g=z((A=(p=e.pageSize)!=null?p:e.perPage)!=null?A:e.limit,0);return k>=0&&g>0?Math.max(1,Math.ceil(k/g)):1},ge=()=>{var d,k,g;return z(s?s.get():(g=(k=(d=e.page)!=null?d:e.value)!=null?k:e.current)!=null?g:e.currentPage,1)},B=()=>{var d,k;return Math.max(0,z((k=(d=e.siblings)!=null?d:e.siblingCount)!=null?k:e.window,1))},ne=()=>{var d,k;return Math.max(0,z((k=(d=e.boundaryCount)!=null?d:e.boundaries)!=null?k:e.edges,1))},he=()=>!!o(e.disabled),q=()=>{var d;return o((d=e.showSummary)!=null?d:e.showLabel)!==!1},se=()=>o(e.showPages)!==!1&&!o(e.simple),le=()=>o(e.showPrev)!==!1,fe=()=>o(e.showNext)!==!1,be=()=>!!o(e.showEdges),re=()=>{const d=o(e.showFirst);return d==null?be():!!d},ue=()=>{const d=o(e.showLast);return d==null?be():!!d},O=()=>!!o(e.hideOnSinglePage),Y=()=>{var g,P;const d=o((P=(g=e.total)!=null?g:e.totalItems)!=null?P:e.count);if(d==null||d==="")return null;const k=Number(d);return Number.isFinite(k)?Math.max(0,Math.trunc(k)):null},oe=()=>{var g,P;const d=o((P=(g=e.pageSize)!=null?g:e.perPage)!=null?P:e.limit);if(d==null||d==="")return null;const k=Number(d);return Number.isFinite(k)&&k>0?Math.trunc(k):null},we=(d=N,k=C)=>{const g=Y(),P=oe(),K=g!=null&&P?g===0?0:(d-1)*P+1:null,ee=g!=null&&P?Math.min(g,d*P):null;return{page:d,value:d,current:d,currentPage:d,pages:k,max:k,total:g,pageSize:P,from:K,to:ee,disabled:he(),isFirst:d<=1,isLast:d>=k,canPrev:d>1,canNext:d<k,setPage:(Ce,E)=>X(Ce,E),prev:Ce=>X(d-1,Ce),next:Ce=>X(d+1,Ce),first:Ce=>X(1,Ce),last:Ce=>X(k,Ce)}},R=(d,k)=>{if(k<=0)return[];const g=[],P=new Set,K=ne(),ee=B();for(let E=1;E<=Math.min(K,k);E++)P.add(E);for(let E=Math.max(1,d-ee);E<=Math.min(k,d+ee);E++)P.add(E);for(let E=Math.max(1,k-K+1);E<=k;E++)P.add(E);let Ce=0;for(let E=1;E<=k;E++)P.has(E)&&(Ce&&E-Ce>1&&g.push({type:"ellipsis",key:`ellipsis-${Ce}-${E}`}),g.push({type:"page",page:E,key:`page-${E}`}),Ce=E);return g.length||g.push({type:"page",page:1,key:"page-1"}),g},h=(d,k,g,P=null)=>{const K=JSswift.ui.getSlot(n,d)!=null?T(n,d,g,k):[];return K.length?K:P&&JSswift.ui.getSlot(n,P)!=null?T(n,P,g,k):T(null,"default",g,k)},m=(d,k)=>{d.innerHTML="",k.forEach(g=>d.appendChild(g))},y=(d,k,g,P={})=>{var ee;const K={...we(),kind:d,active:!!P.active};return Ae.Btn({class:Z(["cms-pagination-btn",`cms-pagination-${d}`,ye(P.active,"active"),P.class]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:P.active?e.color||e.state||"primary":P.color||null,outline:P.active?!1:(ee=P.outline)!=null?ee:!0,disabled:he()||!!P.disabled,"aria-current":P.active?"page":null,onClick:Ce=>{he()||P.disabled||g==null||g(Ce)}},...h(d,k,K,d==="summary"?"label":d==="page"?"item":null))},j=(d,k)=>{N=U(d,k),C=Math.max(1,k||1);const g=we(N,C);c.style.display=O()&&C<=1?"none":"",M.style.display=q()?"":"none",a.style.display=se()?"":"none",u.innerHTML="",a.innerHTML="",b.innerHTML="";const P=h("start",e.start,g);P.length&&u.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-start"},...P)),re()&&u.appendChild(y("first","\xAB",Ce=>X(1,Ce),{disabled:N<=1})),le()&&u.appendChild(y("prev","Prev",Ce=>X(N-1,Ce),{disabled:N<=1})),se()&&R(N,C).forEach(Ce=>{if(Ce.type==="ellipsis"){const A={...g,kind:"ellipsis"},L=h("ellipsis","\u2026",A);a.appendChild(_.span({class:"cms-pagination-ellipsis","aria-hidden":"true"},...L));return}const E=Ce.page,p={...g,page:E,value:E,item:Ce,active:E===N};a.appendChild(Ae.Btn({class:Z(["cms-pagination-btn","cms-pagination-page-btn",ye(E===N,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:E===N?e.color||e.state||"primary":null,outline:E!==N,disabled:he(),"aria-current":E===N?"page":null,onClick:A=>X(E,A)},...h("page",String(E),p,"item")))}),fe()&&b.appendChild(y("next","Next",Ce=>X(N+1,Ce),{disabled:N>=C})),ue()&&b.appendChild(y("last","\xBB",Ce=>X(C,Ce),{disabled:N>=C}));const K=h("end",e.end,g);K.length&&b.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...K));let ee=`Pagina ${N} di ${C}`;g.total!=null&&g.pageSize&&(ee=g.total===0?"0 risultati":`${g.from}-${g.to} di ${g.total}`),m(M,h("summary",ee,g,"label"))},X=(d,k=null)=>{var K,ee;const g=W(),P=U(d,g);return P===N&&g===C||(j(P,g),s&&s.get()!==P&&s.set(P),(K=e.onChange)==null||K.call(e,P,we(P,g),k),(ee=e.onPageChange)==null||ee.call(e,P,we(P,g),k)),P};return bt.reactive.effect(()=>{const d=W(),k=ge(),g=U(k,d);j(g,d),s&&k!==g&&s.set(g)},"UI.Pagination:sync"),c.getPage=()=>N,c.getPages=()=>C,c.setPage=d=>X(d),c.prev=()=>X(N-1),c.next=()=>X(N+1),c.first=()=>X(1),c.last=()=>X(C),At(c,e),c},Ae.Spinner=(...t)=>{var he;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(q,se,le)=>{if(Ke(q))return()=>{const be=o(q);if(be==null||be===!1||be==="")return le;const re=se?se(be):be;return re==null||re===""?le:re};if(q==null||q===!1||q==="")return le;const fe=se?se(q):q;return fe==null||fe===""?le:fe},c=q=>{if(q==null||q===!1||q===""||Bt(q))return"";const le=String(q).trim();return le?le.startsWith("#")||le.startsWith("rgb(")||le.startsWith("rgba(")||le.startsWith("hsl(")||le.startsWith("hsla(")||le.startsWith("var(")?le:In(le)?`var(--cms-${le})`:le:""},S=xt(e.state,()=>{const q=Bt(o(e.state));return q?`cms-state-${q}`:""}),u=Z(["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]),a=JSswift.omit(e,["ariaLabel","block","center","color","indicatorClass","indicatorStyle","label","note","pause","paused","reverse","size","slots","speed","state","thickness","trackColor","vertical"]);a.class=u;const b={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(b,"backgroundColor")&&delete b.backgroundColor,a.style=b,a.role==null&&(a.role="status"),a["aria-live"]==null&&(a["aria-live"]="polite"),a["aria-busy"]==null&&(a["aria-busy"]="true");const M={props:e},N=T(s,"label",M,e.label),C=T(s,"default",M,n),z=T(s,"note",M,e.note),U=N.length||C.length||z.length;if(!U){const q=o((he=e.ariaLabel)!=null?he:e["aria-label"]);q?a["aria-label"]=q:a["aria-label"]==null&&(a["aria-label"]="Loading")}const W=_.span({class:Z(["cms-spinner-indicator",e.indicatorClass]),style:{"--cms-spinner-size":i(e.size,gt,"18px"),"--cms-spinner-thickness":i(e.thickness,gt,"2px"),"--cms-spinner-speed":i(e.speed,q=>typeof q=="number"?`${q}ms`:String(q),"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"}),ge=T(s,"indicator",M,W),B=[];ge.length&&B.push(...ge),U&&B.push(_.div({class:"cms-spinner-content"},N.length?_.div({class:"cms-spinner-label"},...N):null,C.length?_.div({class:"cms-spinner-copy"},...C):null,z.length?_.div({class:"cms-spinner-note"},...z):null));const ne=_.div(a,...B);return At(ne,e),ne},Ae.Progress=(...t)=>{var L,ae,ke,Te,ze,V,H,te,De,je;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(Ct(e.value)||ht(e.value)?e.value:null),c=an(i,"UI.Progress:model"),S=xt([e.state,e.color],()=>{const _e=Bt(o(e.state)||o(e.color));return _e?`cms-state-${_e}`:""}),u=(_e,Me)=>{const Ie=Number(_e);return Number.isFinite(Ie)?Ie:Me},a=()=>u(o(e.min),0),b=()=>{const _e=a(),Me=u(o(e.max),100);return Me<_e?_e:Me},M=()=>{var Me,Ie;const _e=o((Ie=(Me=e.height)!=null?Me:e.thickness)!=null?Ie:e.size);return _e==null||_e===""?"8px":typeof _e=="number"?`${_e}px`:typeof _e=="string"?{xxs:"4px",xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px",xxl:"16px",xxxl:"18px"}[_e]||_e:"8px"},N=(_e,Me="")=>{const Ie=o(_e);if(Ie==null||Ie===!1||Ie==="")return Me;const Ye=Bt(Ie);return Ye?`var(--cms-${Ye})`:typeof Ie=="string"&&In(Ie)?`var(--cms-${Ie})`:String(Ie)},C=_e=>{const Me=a(),Ie=b(),Ye=u(_e,Me);return Math.min(Ie,Math.max(Me,Ye))},z=_e=>{const Me=a(),Ye=b()-Me;if(!Ye)return 0;const rt=(C(_e)-Me)/Ye,Xe=o(e.reverse)?1-rt:rt;return Math.max(0,Math.min(1,Xe))},U=_e=>{const Me=C(_e);return Me<se()?se():Me},W=(_e,Me,Ie)=>{const Ye=e.formatValue;if(typeof Ye=="function"){const rt=Ye(_e,Me,Ie);if(rt!=null)return rt}return`${Math.round(Me)}%`},ge=_e=>{for(;_e.firstChild;)_e.removeChild(_e.firstChild)},B=(_e,Me,Ie="flex")=>{ge(_e),(Me||[]).forEach(Ye=>{if(!(Ye==null||Ye===!1)){if(Ye instanceof Node){_e.appendChild(Ye);return}_e.appendChild(document.createTextNode(String(Ye)))}}),_e.style.display=_e.childNodes.length?Ie:"none"},ne=(_e,Me={})=>Vs(o(_e),Me),he=(_e,Me,Ie={})=>{var rt;const Ye=o(_e);return Ye==null||Ye===!1||Ye===""?[]:typeof Ye=="string"?[Ae.Icon({name:Ye,size:(rt=e.iconSize)!=null?rt:16})]:ne(Ye,{...Ie,as:Me})},q=_e=>ht(_e)||Ct(_e)?o(_e):typeof _e=="function"&&_e.length===0?_e():_e,[se,le]=JSswift.reactive.signal(C(c?c.get():(ae=(L=o(e.value))!=null?L:o(e.min))!=null?ae:0)),[fe,be]=JSswift.reactive.signal(U((ze=o(e.buffer))!=null?ze:c?c.get():(Te=(ke=o(e.value))!=null?ke:o(e.min))!=null?Te:0)),re=(_e,Me={})=>{const Ie=C(_e);return se()!==Ie&&le(Ie),fe()<Ie&&be(Ie),c&&Me.fromModel!==!0&&c.set(Ie),Ie},ue=_e=>{const Me=U(_e);return fe()!==Me&&be(Me),Me},O=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"]),Y={width:o(e.width)||"100%",...e.style||{}},oe=o(e.color);(oe!=null||Ke(e.color))&&!Bt(oe||"")&&delete Y.backgroundColor,O.class=Z(["cms-progress-wrap",ye(e.dense,"dense"),ye(e.reverse,"is-reverse"),ye(e.indeterminate,"is-indeterminate"),S,e.class]),O.style=Y;const we=_.div({class:"cms-progress-header"}),R=_.div({class:"cms-progress-heading"}),h=_.div({class:"cms-progress-label"}),m=_.div({class:"cms-progress-note"}),y=_.div({class:"cms-progress-value"});R.append(h,m),we.append(R,y);const j=_.div({class:"cms-progress-body"}),X=_.span({class:"cms-progress-edge-label cms-progress-edge-label-left"}),d=_.div({class:"cms-progress",role:"progressbar"}),k=_.span({class:"cms-progress-buffer"}),g=_.span({class:Z(["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"),xt(e.shadow,()=>{const _e=bs(o(e.shadow));return _e?`cms-shadow-${_e}`:""}),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")])}),P=_.span({class:"cms-progress-bar-label"});g.appendChild(P),d.append(k,g);const K=_.span({class:"cms-progress-edge-label cms-progress-edge-label-right"});j.append(X,d,K);const ee=_.div(O,we,j);At(g,e);const Ce=()=>{const _e=se(),Me=z(_e)*100,Ie={value:_e,percent:Me,min:a(),max:b(),buffer:fe(),progress:ee,track:d,bar:g,props:e},Ye=T(s,"icon",Ie,null),rt=Ye.length?[]:he(e.icon,"icon",Ie),Xe=T(s,"label",Ie,q(e.label)),We=Xe.length?Xe:T(s,"default",Ie,n),w=T(s,"iconRight",Ie,null),ie=w.length?[]:he(e.iconRight,"iconRight",Ie),$e=T(s,"note",Ie,q(e.note)),F=e.valueLabel!=null?q(e.valueLabel):W(_e,Me,Ie),f=o(e.showValue),r=f===!0||e.valueLabel!=null||JSswift.ui.getSlot(s,"value")!=null?T(s,"value",Ie,F):[];B(h,[...rt,...Ye,...We,...ie,...w],"inline-flex"),B(m,$e,"block"),B(y,f==="inside"?[]:r,"inline-flex"),we.style.display=h.childNodes.length||m.childNodes.length||y.childNodes.length?"flex":"none"},E=()=>{var Xe,We;const _e=se(),Me=z(_e)*100,Ie={value:_e,percent:Me,min:a(),max:b(),buffer:fe(),progress:ee,track:d,bar:g,props:e},Ye=q((Xe=e.startLabel)!=null?Xe:e.leftLabel),rt=q((We=e.endLabel)!=null?We:e.rightLabel);B(X,T(s,"startLabel",Ie,Ye),"inline-flex"),B(K,T(s,"endLabel",Ie,rt),"inline-flex")},p=()=>{const _e=se(),Me=z(_e)*100,Ie={value:_e,percent:Me,min:a(),max:b(),buffer:fe(),progress:ee,track:d,bar:g,props:e},Ye=o(e.showValue),rt=e.insideLabel!=null?q(e.insideLabel):W(_e,Me,Ie),Xe=Ye==="inside"||e.insideLabel!=null||JSswift.ui.getSlot(s,"inside")!=null?T(s,"inside",Ie,rt):[];B(P,Xe,"inline-flex")},A=()=>{const _e=se(),Me=fe(),Ie=a(),Ye=b(),rt=z(_e)*100,Xe=z(Me)*100,We=N(e.color,""),w=N(e.trackColor,We?`color-mix(in srgb, ${We} 14%, transparent)`:"rgba(255,255,255,0.08)"),ie=N(e.bufferColor,We?`color-mix(in srgb, ${We} 30%, transparent)`:"rgba(255,255,255,0.16)"),$e=o(e.ariaLabel),F=o(e.ariaValueText),f=!!o(e.indeterminate),r=o(e.radius);ee.style.width=o(e.width)||"100%",ee.style.setProperty("--cms-progress-height",M()),r!=null?typeof r=="number"?ee.style.setProperty("--cms-progress-radius",`${r}px`):typeof r=="string"&&JSswift.uiSizes.includes(r)?ee.style.setProperty("--cms-progress-radius",`var(--cms-r-${r})`):ee.style.setProperty("--cms-progress-radius",String(r)):ee.style.removeProperty("--cms-progress-radius"),d.style.background=w,k.style.background=ie,k.style.width=`${Xe}%`,We&&!Bt(o(e.state)||o(e.color))?(g.style.setProperty("--set-background-color",We),g.style.setProperty("--set-border-color",We),g.style.setProperty("--set-color",o(e.textColor)||"var(--cms-on-primary, #fff)")):Bt(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)")),f?(g.style.width="",d.removeAttribute("aria-valuenow"),d.removeAttribute("aria-valuemin"),d.removeAttribute("aria-valuemax")):(g.style.width=`${rt}%`,d.setAttribute("aria-valuemin",String(Ie)),d.setAttribute("aria-valuemax",String(Ye)),d.setAttribute("aria-valuenow",String(_e))),$e!=null?d.setAttribute("aria-label",String($e)):typeof o(e.label)=="string"?d.setAttribute("aria-label",String(o(e.label))):d.removeAttribute("aria-label"),F!=null?d.setAttribute("aria-valuetext",String(F)):f?d.removeAttribute("aria-valuetext"):d.setAttribute("aria-valuetext",W(_e,rt,{value:_e,percent:rt,min:Ie,max:Ye,buffer:Me,progress:ee,track:d,bar:g,props:e})),ee.classList.toggle("has-start-label",X.childNodes.length>0),ee.classList.toggle("has-end-label",K.childNodes.length>0),ee.classList.toggle("has-inside-label",P.childNodes.length>0)};return c?(re(c.get(),{fromModel:!0}),c.watch(_e=>{re(_e,{fromModel:!0})},"UI.Progress:watch")):Ke(e.value)?JSswift.reactive.effect(()=>{re(o(e.value),{fromModel:!0})},"UI.Progress:value"):re((H=(V=e.value)!=null?V:e.min)!=null?H:0,{fromModel:!0}),Ke(e.buffer)?JSswift.reactive.effect(()=>{ue(o(e.buffer))},"UI.Progress:buffer"):ue((je=(De=(te=e.buffer)!=null?te:e.value)!=null?De:e.min)!=null?je:0),JSswift.reactive.effect(()=>{Ce(),E(),p(),A()},"UI.Progress:render"),ee._track=d,ee._bar=g,ee._buffer=k,ee._getValue=se,ee._getBuffer=fe,ee._setValue=_e=>re(_e),ee._setBuffer=_e=>ue(_e),ee},Ae.LoadingBar=function(...e){var p,A;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),i=(L,ae)=>{const ke=Number(L);return Number.isFinite(ke)?ke:ae},c=()=>i(o(n.min),0),S=()=>{const L=c(),ae=i(o(n.max),100);return ae<L?L:ae},u=L=>{const ae=c(),ke=S(),Te=i(L,ae);return Math.min(ke,Math.max(ae,Te))},a=(L,ae="")=>L==null||L===!1||L===""?ae:typeof L=="number"?`${L}px`:String(L),b=L=>{const ae=o(L);return!ae||ae===document?document.body:typeof ae=="string"?document.querySelector(ae)||document.body:ae&&ae.body instanceof HTMLElement?ae.body:ae instanceof HTMLElement?ae:document.body},M=n.model||(Ct(n.value)||ht(n.value)?n.value:null),N=an(M,"UI.LoadingBar:model"),C=Ct(n.buffer)||ht(n.buffer)?n.buffer:null,z=an(C,"UI.LoadingBar:buffer"),U=N?N.get():(p=o(n.value))!=null?p:c(),W=z?z.get():(A=o(n.buffer))!=null?A:U,[ge,B]=JSswift.reactive.signal(u(U)),[ne,he]=JSswift.reactive.signal(Math.max(u(W),u(U))),[q,se]=JSswift.reactive.signal(n.visible!=null?!!o(n.visible):u(U)>c()||!!o(n.indeterminate));let le=null,fe=null;const be=()=>{le&&(clearInterval(le),le=null)},re=()=>{fe&&(clearTimeout(fe),fe=null)},ue=(L,ae={})=>{const ke=!!L;return q()!==ke&&se(ke),ae.fromExternal!==!0&&typeof n.onVisibleChange=="function"&&n.onVisibleChange(ke),ke},O=(L,ae={})=>{const ke=u(L);return ge()!==ke&&B(ke),ne()<ke&&(he(ke),z&&ae.fromExternal!==!0&&z.set(ke)),N&&ae.fromExternal!==!0&&N.set(ke),ke},Y=(L,ae={})=>{const ke=Math.max(O(ge(),{fromExternal:!0}),u(L));return ne()!==ke&&he(ke),z&&ae.fromExternal!==!0&&z.set(ke),ke},oe=(L=ge())=>{n.visible==null&&(o(n.indeterminate)||L>c()?ue(!0):o(n.hideOnZero)!==!1&&ue(!1))},we=()=>{if(be(),o(n.trickle)===!1||o(n.indeterminate))return;const L=i(o(n.trickleInterval),280);L<=0||(le=setInterval(()=>{var ze,V;const ae=ge(),ke=u((V=(ze=o(n.trickleTo))!=null?ze:o(n.trickleMax))!=null?V:92);if(ae>=ke)return;const Te=i(o(n.trickleStep),ae<45?12:ae<75?7:3);O(Math.min(ke,ae+Te))},L))},R=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"]);R.class=Z(["cms-loading-bar",n.class]),R.style={...n.style||{}};const h=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"]);h.class=Z(["cms-loading-bar-progress",n.progressClass,h.class]),h.style={...n.progressStyle||{}},h.value=[ge,B],h.buffer=[ne,he],h.dense==null&&(h.dense=!0),h.height==null&&h.thickness==null&&h.size==null&&(h.height=3),h.width==null&&(h.width="100%");const m=_.div(R),y=Ae.Progress(h,...s);m.appendChild(y);const j=L=>{re();const ae=O(L);return oe(ae),m},X=L=>{re();const ae=Y(L);return oe(ae),m},d=(L=(ae=>(ae=o(n.step))!=null?ae:8)())=>{re();const ke=ge(),Te=O(ke+i(L,0));return oe(Te),m},k=(L=(ae=>(ae=o(n.startValue))!=null?ae:12)())=>{re();const ke=Math.max(ge(),u(L));return O(ke),Y(Math.max(ne(),ke)),oe(ke),we(),m},g=(L=(ae=>(ae=o(n.resetValue))!=null?ae:c())())=>{re(),be();const ke=u(L);return Y(ke),O(ke),oe(ke),m},P=(L=(ae=>(ae=o(n.doneValue))!=null?ae:S())())=>{var ze;re(),be();const ke=u(L);Y(ke),O(ke),oe(ke);const Te=Math.max(0,i((ze=o(n.hideDelay))!=null?ze:o(n.doneDelay),220));return fe=setTimeout(()=>{g()},Te),m},K=(...L)=>P(...L),ee=()=>(ue(!0),m),Ce=()=>(re(),be(),ue(!1),m),E=()=>(re(),be(),m.remove(),null);return m.el=m,m._progress=y,m.get=()=>ge(),m.getBuffer=()=>ne(),m.set=j,m.setBuffer=X,m.inc=d,m.start=k,m.done=P,m.complete=P,m.stop=K,m.reset=g,m.show=ee,m.hide=Ce,m.destroy=E,m._dispose=E,N?N.watch(L=>{O(L,{fromExternal:!0}),oe(u(L))},"UI.LoadingBar:watch"):Ke(n.value)&&JSswift.reactive.effect(()=>{const L=u(o(n.value));O(L,{fromExternal:!0}),oe(L)},"UI.LoadingBar:value"),z?z.watch(L=>{Y(L,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):Ke(n.buffer)&&JSswift.reactive.effect(()=>{Y(o(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const L=c(),ae=S(),ke=Math.min(ae,Math.max(L,ge())),Te=Math.max(ke,Math.min(ae,Math.max(L,ne())));ke!==ge()&&B(ke),Te!==ne()&&he(Te)},"UI.LoadingBar:range"),JSswift.reactive.effect(()=>{n.visible!=null&&ue(o(n.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),JSswift.reactive.effect(()=>{var je;const L=o(n.position)||"fixed",ae=o(n.inset),ke=o(n.top),Te=o(n.right),ze=o(n.bottom),V=o(n.left),H=o(n.width),te=n.visible!=null?!!o(n.visible):q(),De=L==="static"||L==="relative";m.classList.toggle("is-visible",te),m.classList.toggle("is-inline",De),m.classList.toggle("has-track",!!o(n.trackColor)),m.style.position=L,m.style.zIndex=String((je=o(n.zIndex))!=null?je:10002),m.style.width=a(H,De?"100%":""),ae!=null&&ae!==""?(m.style.inset=a(ae),m.style.removeProperty("top"),m.style.removeProperty("right"),m.style.removeProperty("bottom"),m.style.removeProperty("left")):(m.style.removeProperty("inset"),!De&&L!=="sticky"?(m.style.top=a(ke,"0px"),m.style.right=a(Te,H==null||H===""?"0px":""),m.style.bottom=a(ze,""),m.style.left=a(V,"0px")):(m.style.top=a(ke,""),m.style.right=a(Te,""),m.style.bottom=a(ze,""),m.style.left=a(V,"")))},"UI.LoadingBar:layout"),At(m,n),o(n.mount)!==!1&&b(n.target).appendChild(m),o(n.autoStart)&&k(),m};const ei=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),Hi=new Set(["soft","solid","outline"]),Wi={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},Ui={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},ti=t=>{const e=String(o(t)||"").trim().toLowerCase();return e?ei.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"},Gi=t=>{const e=String(o(t)||"").trim().toLowerCase();return Hi.has(e)?e:"soft"},Ki=(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 u,a,b,M,N,C,z,U,W,ge,B,ne,he,q;const n=jn(t)?{...t}:{message:t},s=Bt(o(e)||o(n.type)||o(n.state)||o(n.color)||"info")||"info",i=Ki((a=(u=n.timeout)!=null?u:n.duration)!=null?a:n.delay,s),c=(N=(M=(b=n.closable)!=null?b:n.dismissible)!=null?M:n.dismiss!=null)!=null?N:i===0,S=n.title===void 0?n.label===void 0?Wi[s]:n.label:n.title;return{...n,type:s,state:s,title:S,message:(U=(z=(C=n.message)!=null?C:n.content)!=null?z:n.text)!=null?U:null,description:(B=(ge=(W=n.description)!=null?W:n.subtitle)!=null?ge:n.note)!=null?B:null,meta:(he=(ne=n.meta)!=null?ne:n.caption)!=null?he:null,body:(q=n.body)!=null?q:null,timeout:i,closable:!!c,dismissLabel:n.dismissLabel||n.closeLabel||"Chiudi notifica",position:ti(n.position),variant:Gi(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},ni=(t,e="",n="")=>{if(!t.length)return $n(n?{type:e,title:n}:{type:e});if(jn(t[0])){const{props:u,children:a}=JSswift.uiNormalizeArgs(t),b={...u};return!b.type&&!b.state&&!b.color&&e&&(b.type=e),b.title==null&&n&&(b.title=n),a.length&&(b.message==null&&b.description==null&&b.body==null&&a.length===1?b.message=a[0]:b.body==null&&(b.body=a.length===1?a[0]:a)),$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,ni(n,t,e))},yo=(t,e,n)=>{if(t===!1)return!1;if(typeof t=="function"){const s=t();return yo(s,e,n)}return jn(t)?t:t!=null?{message:t,title:n}:{message:e,title:n}};Ae.Notify=(...t)=>{var e,n;return(n=(e=bt.services.notify)==null?void 0:e.show)==null?void 0:n.call(e,ni(t))},Ae.Notify.show=Ae.Notify,Ae.Notify.success=Nn("success","Success"),Ae.Notify.error=Nn("danger","Error"),Ae.Notify.warning=Nn("warning","Warning"),Ae.Notify.info=Nn("info","Info"),Ae.Notify.primary=Nn("primary","Notice"),Ae.Notify.secondary=Nn("secondary","Notice"),Ae.Notify.remove=t=>{var e,n;return(n=(e=bt.services.notify)==null?void 0:e.remove)==null?void 0:n.call(e,t)},Ae.Notify.clear=()=>{var t,e;return(e=(t=bt.services.notify)==null?void 0:t.clear)==null?void 0:e.call(t)},Ae.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)},Ae.Notify.promise=async(t,e={})=>{var i,c,S,u,a,b,M,N,C,z,U,W,ge,B;const n=e.loading===!1?!1:yo(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 he=await(typeof t=="function"?t():t),q=yo(typeof e.success=="function"?()=>e.success(he):e.success,"Operazione completata con successo.","Completato");return q!==!1?s!=null?(u=(S=bt.services.notify)==null?void 0:S.update)==null||u.call(S,s,$n(q,"success")):(b=(a=bt.services.notify)==null?void 0:a.show)==null||b.call(a,$n(q,"success")):s!=null&&((N=(M=bt.services.notify)==null?void 0:M.remove)==null||N.call(M,s)),he}catch(ne){const he=yo(typeof e.error=="function"?()=>e.error(ne):e.error,(ne==null?void 0:ne.message)||"Operazione fallita.","Errore");throw he!==!1?s!=null?(z=(C=bt.services.notify)==null?void 0:C.update)==null||z.call(C,s,$n(he,"danger")):(W=(U=bt.services.notify)==null?void 0:U.show)==null||W.call(U,$n(he,"danger")):s!=null&&((B=(ge=bt.services.notify)==null?void 0:ge.remove)==null||B.call(ge,s)),ne}},Ae.Header=(...t)=>{var k,g,P,K,ee,Ce,E;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};vn(i);const c=p=>Object.prototype.hasOwnProperty.call(e,p),S=(k=e.drawerStateKey)!=null?k:Gn;S&&(Gn=S,_n=ns(S));const u=()=>ns(S),a=()=>Fn(!0,S),b=()=>Fn(!1,S),M=()=>Fn(!u(),S),N={props:e,stateKey:S,isDrawerOpen:u,openDrawer:a,closeDrawer:b,toggleDrawer:M,toggleAside:M},C=(p,A)=>{if(!(A==null||A===!1)){if(Array.isArray(A)){A.forEach(L=>C(p,L));return}if(A!=null&&A.nodeType){p.appendChild(A);return}p.appendChild(document.createTextNode(String(A)))}},z=(p,A,L=ae=>ae)=>{const ae=JSswift.ui.getSlot(s,p);if(ae!=null)return T(s,p,N,null);if(typeof A=="function"){const ke=new Set(["eyebrow","title","subtitle"]),Te=_[ke.has(p)?"span":"div"]({class:`cms-header-slot-${p}`});return JSswift.reactive.effect(()=>{const ze=L(A(N)),V=xn(JSswift.ui.slot(ze));Te.replaceChildren(),Array.isArray(V)?V.forEach(H=>C(Te,H)):C(Te,V)},`UI.Header:${p}`),[Te]}return T(s,p,N,L(A))},U=(p,A="icon",L=e.iconSize||e.size||"md")=>p==null||p===!1?null:typeof p=="string"?Ae.Icon({name:p,size:L}):JSswift.ui.slot(p,{as:A}),W=p=>{var L,ae;const A=p?(L=e.drawerOpenIcon)!=null?L:"\u2715":(ae=e.drawerCloseIcon)!=null?ae:"\u2630";return A==null||A===!1?null:typeof A=="string"?A:JSswift.ui.slot(A,{as:p?"drawerOpenIcon":"drawerCloseIcon"})},ge=_.span({class:"cms-header-toggle-icon"}),B=p=>{const A=T(null,"default",N,W(p));ge.replaceChildren(...A.length?A:[""])};B(u());const ne=Ae.Btn({class:"cms-header-toggle",outline:!0,size:(P=(g=e.toggleSize)!=null?g:e.size)!=null?P:"sm",onClick:M,"aria-label":e.toggleLabel||"Toggle navigation"},ge);e.left==null&&e.left!==!1&&!JSswift.ui.getSlot(s,"left")&&qo.add({update:B});const he=e.left===!1?null:e.left!=null?e.left:ne,q=c("title")?e.title:(K=e.label)!=null?K:"App",se=(Ce=(ee=e.subtitle)!=null?ee:e.description)!=null?Ce:"",le=c("right")?e.right:e.end,fe=c("content")?e.content:c("body")?e.body:n!=null&&n.length?n:null,be=[...z("left",he),...z("start",null)],re=z("icon",e.icon,U),ue=z("eyebrow",(E=e.eyebrow)!=null?E:e.kicker),O=z("title",q),Y=z("subtitle",se),oe=z("meta",e.meta),we=(()=>{const p=z("content",null);return p.length?p:z("default",fe)})(),R=[...z("center",null),...z("body",null)],h=[...z("right",le),...z("end",null)],m=z("actions",e.actions),y=_.div({class:Z(["cms-header-body",e.bodyClass,e.centerClass])},_.div({class:"cms-header-heading"},re.length?_.div({class:"cms-header-icon"},...re):null,_.div({class:"cms-header-copy"},ue.length?_.div({class:Z(["cms-header-eyebrow",e.eyebrowClass])},...ue):null,O.length?_.div({class:Z(["cms-header-title",e.titleClass])},...O):null,Y.length?_.div({class:Z(["cms-header-subtitle",e.subtitleClass])},...Y):null,we.length?_.div({class:Z(["cms-header-content",e.contentClass])},...we):null),oe.length?_.div({class:Z(["cms-header-meta",e.metaClass])},...oe):null)),j=[...h,...m.length?[_.div({class:Z(["cms-header-actions",e.actionsClass])},...m)]:[]],X=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"]);X.class=Z(["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]),X.style={...i.style||{}},e.gap!=null&&(X.style["--cms-header-gap"]=gt(o(e.gap))),e.minHeight!=null&&(X.style.minHeight=gt(o(e.minHeight)));const d=_.div(X,...be.length?[_.div({class:Z(["cms-header-start",e.startClass])},...be)]:[],_.div({class:"cms-header-main"},...R.length?[_.div({class:Z(["cms-header-body",e.bodyClass,e.centerClass])},...R)]:[y],...j.length?[_.div({class:Z(["cms-header-end",e.endClass])},...j)]:[]));return At(d,e),d},Ae.Drawer=(...t)=>{var Ie,Ye,rt,Xe,We,w,ie,$e,F,f;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=r=>Object.prototype.hasOwnProperty.call(e,r),S=(Ie=e.stateKey)!=null?Ie:Gn;S&&(Gn=S,_n=ns(S));const u=()=>ns(S),a=()=>Fn(!0,S),b=()=>Fn(!1,S),M=()=>Fn(!u(),S),N={props:e,stateKey:S,isDrawerOpen:u,openDrawer:a,closeDrawer:b,toggleDrawer:M,toggleAside:M},C=JSswift==null?void 0:JSswift.store,z=!!(C!=null&&C.get&&(C!=null&&C.set)),U=`${S}:groups`,W=`${S}:active`;let ge=z?C.get(U,{})||{}:{},B=z&&(Ye=C.get(W,null))!=null?Ye:null;const ne=new Map,he=new Map,q=r=>{const x=o(r);return x==null||x===!1?[]:Array.isArray(x)?x.flat(1/0):[x]},se=(r,x,de=N)=>{const Be=Array.isArray(r)?r:[r];for(const He of Be)if(JSswift.ui.getSlot(s,He)!=null)return T(s,He,de,x);return x==null?[]:T(null,"default",de,o(x))},le=r=>(Array.isArray(r)?r:[r]).some(de=>JSswift.ui.getSlot(s,de)!=null),fe=r=>{if(typeof o(r.external)=="boolean")return!!o(r.external);const x=o(r.href||r.to||r.link||"");return/^(https?:)?\/\//.test(x)},be=(rt=e.closeOnSelect)!=null?rt:!0,re=r=>!!be&&o(r.keepOpen)!==!0,ue=(We=(Xe=e.itemIconSize)!=null?Xe:e.size)!=null?We:"md",O=(w=e.groupOpenIcon)!=null?w:"arrow_drop_up",Y=(ie=e.groupCloseIcon)!=null?ie:"arrow_drop_down",oe=r=>!!r&&B===r,we=r=>!!r&&!!B&&(B===r||B.startsWith(`${r}::`)),R=()=>{ne.forEach(({el:r,baseActive:x},de)=>{const Be=!!x||oe(de);r.classList.toggle("active",Be),Be?r.setAttribute("aria-current","page"):r.removeAttribute("aria-current")}),he.forEach(({wrap:r,toggle:x,baseActive:de},Be)=>{const He=!!de||we(Be);r.classList.toggle("active",He),x.classList.toggle("active",He)})},h=r=>{B=r||null,z&&C.set(W,B),R()},m=(r,x)=>{if(o(r.active)!=null)return!!o(r.active);if(o(r.current)!=null)return!!o(r.current);if(!x||fe(r))return!1;try{if(x.startsWith("#"))return window.location.hash===x;const de=`${window.location.pathname}${window.location.search}${window.location.hash}`;return x===de||x===window.location.pathname}catch(de){return!1}},y=(r,x,de)=>m(r,x)||oe(de),j=(r=[],x=0,de=[])=>q(r).some((Be,He)=>{var Nt,Et,Rt,Mt,vt;const Se=o(Be);if(!Se||typeof Se!="object"||Se.nodeType)return!1;const Oe=o(Se.href||Se.to||Se.link||""),at=(vt=o((Mt=(Rt=(Et=(Nt=Se.label)!=null?Nt:Se.title)!=null?Et:Se.text)!=null?Rt:Oe)!=null?Mt:null))!=null?vt:`item-${x}-${He}`,nt=g(Se,at,x,He),Ze=de.concat(nt).join("::");if(y(Se,Oe,Ze))return!0;const wt=Se.items||Se.children||Se.sub;return j(wt,x+1,de.concat(nt))}),X=(r,x={})=>{var He;const de=o(r);if(de==null||de===!1)return[];const Be=typeof de=="string"?Ae.Icon({name:de,size:(He=x.iconSize)!=null?He:ue}):JSswift.ui.slot(de,{...x,as:"icon"});return T(null,"default",x,Be)},d=(r,x,de={})=>{const Be=X(r,de);return Be.length?[_.span({class:Z(["cms-drawer-item-icon",x])},...Be)]:[]},k=r=>{const x=o(r.iconPosition)||"left",de=Object.prototype.hasOwnProperty.call(r,"iconLeft")?r.iconLeft:x!=="right"?r.icon:null,Be=Object.prototype.hasOwnProperty.call(r,"iconRight")?r.iconRight:x==="right"?r.icon:null;return{left:de,right:Be}},g=(r,x,de,Be)=>o(r.key||r.id||r.to||r.href||x||`item-${de}-${Be}`),P=(r,x)=>z&&Object.prototype.hasOwnProperty.call(ge,r)?!!ge[r]:x,K=(r,x)=>{z&&(ge={...ge,[r]:!!x},C.set(U,ge))},ee=()=>{const r={...N,area:"header"},x=se(["headerIcon","icon"],e.icon,r),de=se(["eyebrow"],e.eyebrow,r),Be=se(["title"],e.title,r),He=se(["subtitle"],e.subtitle,r),Se=se(["meta"],e.meta,r),Oe=se(["content"],e.content,r),at=se(["actions"],e.actions,r),nt=c("header")?T(null,"default",r,o(e.header)):[],Ze=x.length||de.length||Be.length||He.length||Se.length||Oe.length||at.length;return!Ze&&!nt.length?[]:Ze?[_.div({class:Z(["cms-drawer-header",e.headerClass])},...x.length?[_.div({class:"cms-drawer-header-icon"},...x)]:[],_.div({class:"cms-drawer-header-body"},...de.length?[_.div({class:"cms-drawer-header-eyebrow"},...de)]:[],...Be.length?[_.div({class:"cms-drawer-header-title"},...Be)]:[],...He.length?[_.div({class:"cms-drawer-header-subtitle"},...He)]:[],...Se.length?[_.div({class:"cms-drawer-header-meta"},...Se)]:[],...Oe.length?[_.div({class:"cms-drawer-header-content"},...Oe)]:[],...nt.length?[_.div({class:"cms-drawer-header-extra"},...nt)]:[]),...at.length?[_.div({class:"cms-drawer-header-actions"},...at)]:[])]:nt},Ce=(r,x,de)=>{var Se,Oe;return!(((Se=r.onClick)==null?void 0:Se.call(r,de,x))===!1||de!=null&&de.defaultPrevented||((Oe=e.onSelect)==null?void 0:Oe.call(e,r,x,de))===!1||de!=null&&de.defaultPrevented)},E=(r,x,de={})=>{const Be=x.hasChildren?"group":"item",He=T(s,`${Be}Label`,x,x.label),Se=T(s,`${Be}Note`,x,x.note),Oe=T(s,`${Be}Badge`,x,x.badge),at=T(s,`${Be}Aside`,x,x.aside),nt=T(s,`${Be}Content`,x,x.content),Ze=[];return(He.length||Se.length||Oe.length||at.length)&&Ze.push(_.div({class:"cms-drawer-item-top"},_.div({class:"cms-drawer-item-copy"},...He.length?[_.div({class:"cms-drawer-item-label"},...He)]:[],...Se.length?[_.div({class:"cms-drawer-item-note"},...Se)]:[]),...Oe.length||at.length?[_.div({class:"cms-drawer-item-meta"},...Oe.length?[_.div({class:"cms-drawer-item-badge"},...Oe)]:[],...at.length?[_.div({class:"cms-drawer-item-aside"},...at)]:[])]:[])),nt.length&&Ze.push(_.div({class:"cms-drawer-item-content"},...nt)),[...de.start||[],...d(x.iconLeft,"left",x),...Ze.length?[_.div({class:"cms-drawer-item-main"},...Ze)]:[],...d(x.iconRight,"right",x),...de.end||[]]},p=(r=[],x=0,de=[])=>q(r).map((Be,He)=>{var os,is,ls,qe,pt,Ft,Gt,tn,sn,v,ce;const Se=o(Be);if(Se==null||Se===!1)return null;if(Se.nodeType||typeof Se!="object"||Array.isArray(Se))return _.div({class:"cms-drawer-custom","data-level":String(x)},...T(null,"default",{...N,item:Se,level:x,index:He,path:de},Se));if(o(Se.hidden)===!0||o(Se.visible)===!1)return null;const Oe=q(Se.items||Se.children||Se.sub),at=o(Se.href||Se.to||Se.link||null),nt=o((qe=(ls=(is=(os=Se.label)!=null?os:Se.title)!=null?is:Se.text)!=null?ls:at)!=null?qe:null),Ze=nt!=null?nt:`item-${x}-${He}`,wt=o((Gt=(Ft=(pt=Se.note)!=null?pt:Se.subtitle)!=null?Ft:Se.description)!=null?Gt:null),Nt=o((tn=Se.badge)!=null?tn:null),Et=o((v=(sn=Se.aside)!=null?sn:Se.meta)!=null?v:null),Rt=o((ce=Se.content)!=null?ce:null),Mt=g(Se,Ze,x,He),vt=de.concat(Mt).join("::"),{left:Dt,right:ft}=k(Se),Ht=Bt(o(Se.state)||o(Se.color)||""),qt=m(Se,at),Xt=qt||oe(vt),Ot=!!o(Se.disabled),Qt={...N,item:Se,index:He,level:x,path:de,label:Ze,note:wt,badge:Nt,aside:Et,content:Rt,itemStateKey:vt,iconLeft:Dt,iconRight:ft,iconSize:o(Se.iconSize)||ue,active:Xt,disabled:Ot,hasChildren:!1},cn=o(Se.divider)===!0||Se.type==="divider"||Se.type==="separator",un=o(Se.section)===!0||Se.type==="section"||Se.type==="heading"||Se.type==="label",Zt=Se.type==="content"||Se.type==="custom"||!at&&!Oe.length&&!o(Se.button)&&Se.type!=="button"&&nt==null&&Rt!=null;if(cn)return _.div({class:Z(["cms-drawer-separator",Se.class]),"data-level":String(x)});if(un){const Je=T(s,"sectionLabel",Qt,Ze||Rt);return _.div({class:Z(["cms-drawer-section-label",Se.class]),"data-level":String(x)},...Je)}if(Zt){const Je=T(s,"item",Qt,Rt!=null?Rt:Ze);return _.div({class:Z(["cms-drawer-custom",Ht?`cms-drawer-tone-${Ht}`:"",Se.class]),style:Se.style,"data-level":String(x)},...Je)}if(Oe.length){const Je=qt||j(Oe,x+1,de.concat(Mt)),it=Je||we(vt);let lt=P(vt,!!o(Se.expanded)||!!o(Se.open)||it);const ct=_.span({class:"cms-drawer-group-icon"}),mt={...Qt,active:it,hasChildren:!0,isOpen:()=>lt,setOpen:mn=>Sn(mn),toggle:()=>Sn(!lt)},Jt=()=>{var qn,Yn;const mn=lt?(qn=Se.openIcon)!=null?qn:O:(Yn=Se.closeIcon)!=null?Yn:Y,Tn=o(lt?Se.iconSidePosition||Se.openIconSide||Se.openIconPosition||"right":Se.iconSidePosition||Se.closeIconSide||Se.closeIconPosition||"right")==="left"?"left":"right";ct.innerHTML="",ct.className=`cms-drawer-group-icon ${Tn}`,X(mn,{...mt,as:"toggleIcon"}).forEach(Ls=>ct.appendChild(Ls))},Yt=_.button({type:"button",class:Z(["cms-drawer-group-toggle","cms-drawer-entry",lt?"open":"",it?"active":"",Ot?"is-disabled":"",Ht?`cms-drawer-tone-${Ht}`:"",Se.class]),style:Se.style,"data-level":String(x),"aria-expanded":String(lt),"aria-disabled":Ot?"true":null,onClick:mn=>{if(Ot){mn.preventDefault();return}h(vt),Sn(!lt)}},...E(Se,mt,{start:o(Se.iconSidePosition||Se.openIconSide||Se.closeIconSide||Se.openIconPosition||Se.closeIconPosition||"right")==="left"?[ct]:[],end:o(Se.iconSidePosition||Se.openIconSide||Se.closeIconSide||Se.openIconPosition||Se.closeIconPosition||"right")==="right"?[ct]:[]})),ln=T(s,"group",mt,null),nn=_.div({class:"cms-drawer-group-items"},...p(Oe,x+1,de.concat(Mt))),An=_.div({class:Z(["cms-drawer-group",lt?"open":"",it?"active":"",Ht?`cms-drawer-tone-${Ht}`:""]),"data-level":String(x)},...ln.length?ln:[Yt],nn),Sn=mn=>{lt=!!mn,An.classList.toggle("open",lt),Yt.classList.toggle("open",lt),Yt.setAttribute("aria-expanded",String(lt)),Jt(),K(vt,lt)};return he.set(vt,{wrap:An,toggle:Yt,baseActive:Je}),Jt(),An}const pn=T(s,"item",Qt,null),en=o(Se.button)===!0||Se.type==="button"||!at&&typeof Se.onClick=="function",rn={class:Z(["cms-drawer-entry",en?"cms-drawer-btn":"cms-drawer-link",Xt?"active":"",Ot?"is-disabled":"",Ht?`cms-drawer-tone-${Ht}`:"",Se.class]),style:Se.style,"data-level":String(x),"aria-current":Xt?"page":null,"aria-disabled":Ot?"true":null},Vn=pn.length?pn:E(Se,Qt);if(en){const Je=_.button({...rn,type:Se.buttonType||"button",disabled:Ot,onClick:it=>{if(Ot){it.preventDefault();return}Ce(Se,Qt,it)&&(h(vt),re(Se)&&b())}},...Vn);return ne.set(vt,{el:Je,baseActive:qt}),Je}const dn=fe(Se),hs=dn?o(Se.target)||"_blank":o(Se.target),As=dn?o(Se.rel)||"noopener noreferrer":o(Se.rel),ss=_.a({...rn,href:at||"#",target:hs||null,rel:As||null,tabIndex:Ot?-1:null,onClick:Je=>{var it;if(Ot){Je.preventDefault();return}Ce(Se,Qt,Je)&&(!dn&&Se.to&&((it=bt.router)!=null&&it.navigate)&&(Je.preventDefault(),bt.router.navigate(Se.to)),re(Se)&&b())}},...Vn);return ne.set(vt,{el:ss,baseActive:qt}),ss}).filter(Boolean),A=se(["before","beforeItems"],($e=e.before)!=null?$e:e.beforeItems),L=le(["body"])?se(["body"],null):[],ae=p(e.items||[]),ke=se(["default"],n),Te=se(["after","afterItems"],(F=e.after)!=null?F:e.afterItems),ze=L.length?L:[...A,...ae,...ke,...Te],V=c("empty")||c("emptyText")?(f=e.empty)!=null?f:_.div({class:Z(["cms-drawer-empty",e.emptyClass])},e.emptyText||"Nessun contenuto"):_.div({class:Z(["cms-drawer-empty",e.emptyClass])},"Nessun contenuto"),H=se(["header"],ee()),te=se(["footer"],e.footer),De=ze.length?ze:se(["empty"],V),je=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"]);je.class=Z(["cms-panel","cms-drawer",_n?"open":"",ye(e.sticky,"sticky"),i.class]),je.style={...i.style||{}},e.gap!=null&&(je.style["--cms-drawer-gap"]=gt(o(e.gap))),e.indent!=null&&(je.style["--cms-drawer-indent"]=gt(o(e.indent))),e.padding!=null&&(je.style["--cms-drawer-padding"]=gt(o(e.padding))),e.width!=null&&(je.style.width=gt(o(e.width))),e.minHeight!=null&&(je.style.minHeight=gt(o(e.minHeight))),e.maxHeight!=null&&(je.style.maxHeight=gt(o(e.maxHeight)));const _e=_.div(je,...H.length?H:[],_.div({class:Z(["cms-drawer-body",e.bodyClass])},...De),...te.length?[_.div({class:Z(["cms-drawer-footer",e.footerClass])},...te)]:[]),Me=Po.get(S)||new Set;return Me.add(_e),Po.set(S,Me),Fn(_n,S),_e.isDrawerOpen=u,_e.openDrawer=a,_e.closeDrawer=b,_e.toggleDrawer=M,_e.setActiveItem=h,At(_e,e),R(),_e},Ae.Page=(...t)=>{var y,j,X,d;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=(k,g)=>{var P;return!!(k&&k.nodeType===1&&((P=k.classList)!=null&&P.contains(`cms-page-${g}`)))},S=k=>k==null?null:typeof k=="string"?Ae.Icon({name:k,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(k,{as:"icon"}),u={dense:!!o(e.dense),flat:!!o(e.flat),centered:!!o(e.centered),narrow:!!o(e.narrow)},a=(k,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(P=>a(k,P));return}if(g!=null&&g.nodeType){k.appendChild(g);return}k.appendChild(document.createTextNode(String(g)))}},b=(k,g,P=K=>K)=>{const K=JSswift.ui.getSlot(s,k);if(K!=null)return T(s,k,u,null);if(typeof g=="function"){const ee=new Set(["eyebrow","title","subtitle"]),Ce=_[ee.has(k)?"span":"div"]({class:`cms-page-slot-${k}`});return JSswift.reactive.effect(()=>{const E=P(g(u)),p=xn(JSswift.ui.slot(E));Ce.replaceChildren(),Array.isArray(p)?p.forEach(A=>a(Ce,A)):a(Ce,p)},`UI.Page:${k}`),[Ce]}return T(s,k,u,P(g))},M=T(s,"default",u,n!=null&&n.length?n:[]),N={hero:[],header:[],body:[],footer:[],actions:[]},C=[];M.forEach(k=>{c(k,"hero")?N.hero.push(k):c(k,"header")?N.header.push(k):c(k,"body")?N.body.push(k):c(k,"footer")?N.footer.push(k):c(k,"actions")?N.actions.push(k):C.push(k)});const z=b("icon",e.icon,S),U=b("hero",(y=e.hero)!=null?y:e.banner),W=b("eyebrow",(j=e.eyebrow)!=null?j:e.kicker),ge=b("title",e.title),B=b("subtitle",(X=e.subtitle)!=null?X:e.description),ne=b("header",e.header),he=b("aside",e.aside),q=b("body",(d=e.body)!=null?d:e.content),se=b("footer",e.footer),le=b("actions",e.actions),fe=U.length?_.div({class:Z(["cms-page-hero",e.heroClass])},...U):null,be=z.length||W.length||ge.length||B.length||ne.length||he.length,re=be?_.div({class:Z(["cms-page-header",e.headerClass])},_.div({class:"cms-page-head"},z.length?_.div({class:Z(["cms-page-icon",e.iconClass])},...z):null,_.div({class:"cms-page-head-main"},W.length?_.div({class:Z(["cms-page-eyebrow",e.eyebrowClass])},...W):null,ge.length?_.div({class:Z(["cms-page-title",e.titleClass])},...ge):null,B.length?_.div({class:Z(["cms-page-subtitle",e.subtitleClass])},...B):null,ne.length?_.div({class:Z(["cms-page-header-content",e.headerContentClass])},...ne):null),he.length?_.div({class:Z(["cms-page-aside",e.asideClass])},...he):null)):null,ue=[...q,...C],O=ue.length?_.div({class:Z(["cms-page-body",e.bodyClass])},...ue):null,Y=[...le,...N.actions],oe=se.length||Y.length?_.div({class:Z(["cms-page-footer",e.footerClass])},...se,Y.length?_.div({class:"cms-page-actions"},...Y):null):null,we=!!(U.length||N.hero.length),R=!!(be||N.header.length),h=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"]);h.class=Z(["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(we,"cms-page-has-hero"),ye(R,"cms-page-has-header"),i.class]),h.style={...i.style||{}},(e.gap!=null||Ke(e.gap))&&(h.style["--cms-page-gap"]=Ge(e.gap,gt)),(e.padding!=null||Ke(e.padding))&&(h.style["--cms-page-padding"]=Ge(e.padding,gt)),(e.maxWidth!=null||Ke(e.maxWidth))&&(h.style["--cms-page-max-width"]=Ge(e.maxWidth,gt)),(e.minHeight!=null||Ke(e.minHeight))&&(h.style["--cms-page-min-height"]=Ge(e.minHeight,gt)),(e.headerGap!=null||Ke(e.headerGap))&&(h.style["--cms-page-header-gap"]=Ge(e.headerGap,gt)),(e.heroPadding!=null||Ke(e.heroPadding))&&(h.style["--cms-page-hero-padding"]=Ge(e.heroPadding,gt));const m=_.div(h,fe,...N.hero,re,...N.header,O,...N.body,oe,...N.footer);return At(m,e),m},Ae.AppShell=(...t)=>{var k,g;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(P,K)=>!!P&&Object.prototype.hasOwnProperty.call(P,K),c=o(e.noDrawer)===!0||e.drawer===!1,S=o(e.reverse)===!0,u=o(e.stack)===!0,a=(g=(k=e.drawerStateKey)!=null?k:e.stateKey)!=null?g:Gn;a&&(Gn=a,_n=ns(a));const b={props:e,noDrawer:c,stateKey:a,isDrawerOpen:()=>ns(a),openDrawer:()=>Fn(!0,a),closeDrawer:()=>Fn(!1,a),toggleDrawer:()=>Fn(!ns(a),a)},M=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let N=e.header;!i(e,"header")&&(Object.keys(M).length||i(e,"title")||i(e,"subtitle")||i(e,"left")||i(e,"right"))&&(!i(M,"title")&&i(e,"title")&&(M.title=e.title),!i(M,"subtitle")&&i(e,"subtitle")&&(M.subtitle=e.subtitle),!i(M,"left")&&i(e,"left")&&(M.left=e.left),!i(M,"right")&&i(e,"right")&&(M.right=e.right),i(M,"drawerStateKey")||(M.drawerStateKey=a),c&&!i(M,"left")&&(M.left=!1),N=Ae.Header(M));const C=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},z=i(e,"drawerItems")?e.drawerItems:e.items,U=i(e,"drawerHeader")?e.drawerHeader:void 0;let W=e.drawer;!i(e,"drawer")&&!c&&(Object.keys(C).length||z!=null||U!=null)&&(!i(C,"items")&&z!=null&&(C.items=z),!i(C,"header")&&U!=null&&(C.header=U),i(C,"stateKey")||(C.stateKey=a),W=Ae.Drawer(C));const ge=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},B=i(e,"content")?e.content:n,ne=T(s,"default",b,B);let he=e.page;!i(e,"page")&&(Object.keys(ge).length||ne.length)&&(he=Ae.Page(ge,...ne));const q=e.footerProps&&typeof e.footerProps=="object"?{...e.footerProps}:{},se=i(e,"footerContent")?e.footerContent:void 0;let le=e.footer;!i(e,"footer")&&(Object.keys(q).length||se!=null)&&(le=Ae.Footer(q,...T(null,"default",b,se)));const fe=T(s,"header",b,N),be=c?[]:T(s,"drawer",b,W),re=T(s,"page",b,he),ue=T(s,"footer",b,le),O=Z(["cms-app","cms-app-shell",ye(c,"no-drawer"),ye(S,"is-reverse"),ye(u,"is-stack"),ye(e.flush,"is-flush"),ye(e.divider,"is-divider"),e.class]),Y=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"]);Y.class=O,Y.style={...e.style||{}};const oe=Ge(e.drawerWidth,gt);oe!=null&&(Y.style["--cms-app-shell-drawer-width"]=oe);const we=Ge(e.gap,gt);we!=null&&(Y.style["--cms-app-shell-gap"]=we);const R=Ge(e.padding,gt);R!=null&&(Y.style["--cms-app-shell-padding"]=R);const h=fe.length?_.div({class:"cms-app-shell-header-slot"},...fe):null,m=be.length?_.div({class:"cms-app-shell-drawer-slot"},...be):null,y=re.length?_.div({class:"cms-app-shell-page-slot"},...re):null,j=ue.length?_.div({class:"cms-app-shell-footer-slot"},...ue):null,X=S?[y,m]:[m,y],d=_.div(Y,...h?[h]:[],_.div({class:"cms-app-shell-body"},...X.filter(Boolean)),...j?[j]:[]);return d.openDrawer=b.openDrawer,d.closeDrawer=b.closeDrawer,d.toggleDrawer=b.toggleDrawer,d.isDrawerOpen=b.isDrawerOpen,d.header=h,d.drawer=m,d.page=y,d.footer=j,At(d,e),d},Ae.Parallax=function(...e){var P,K;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,vn(c);const S=xt(n.state,()=>{const ee=Bt(o(n.state));return ee?`cms-state-${ee}`:""}),u=ee=>{if(ee==null||ee===!1||ee==="")return"";const Ce=String(ee);return In(Ce)?`var(--cms-${Ce})`:Ce},a=()=>{const ee=o(n.background);if(ee)return String(ee);const Ce=o(n.image)||o(n.src)||"";if(!Ce)return"linear-gradient(120deg, #1b2c5a, #2f6d8f, #2a8f5c)";const E=String(Ce);return/^url\(/i.test(E)||/gradient\(/i.test(E)||/^var\(/i.test(E)?E:`url(${E})`},b=(ee,Ce)=>{const E=Number(o(ee));return Number.isFinite(E)?E:Ce},M={speed:()=>{var ee;return(ee=o(n.speed))!=null?ee:.18},state:()=>o(n.state)||"",disabled:()=>!!o(n.disabled)},N=T(i,"badge",M,n.badge),C=T(i,"background",M,n.backgroundContent),z=T(i,"eyebrow",M,(P=n.eyebrow)!=null?P:n.kicker),U=T(i,"title",M,n.title),W=T(i,"subtitle",M,n.subtitle),ge=T(i,"header",M,n.header),B=T(i,"aside",M,n.aside),ne=T(i,"media",M,n.media),he=T(i,"content",M,(K=n.content)!=null?K:n.body),q=T(i,"default",M,s!=null&&s.length?s:[]),se=T(i,"footer",M,n.footer),le=T(i,"actions",M,n.actions),fe=[...he,...q],be=N.length?_.div({class:Z(["cms-parallax-badge",n.badgeClass])},...N):null,re=z.length||U.length||W.length||ge.length||B.length,ue=re?_.div({class:Z(["cms-parallax-header",n.headerClass])},_.div({class:"cms-parallax-head"},_.div({class:"cms-parallax-head-main"},z.length?_.div({class:Z(["cms-parallax-eyebrow",n.eyebrowClass])},...z):null,U.length?_.div({class:Z(["cms-parallax-title",n.titleClass])},...U):null,W.length?_.div({class:Z(["cms-parallax-subtitle",n.subtitleClass])},...W):null,ge.length?_.div({class:Z(["cms-parallax-header-content",n.headerContentClass])},...ge):null),B.length?_.div({class:Z(["cms-parallax-aside",n.asideClass])},...B):null)):null,O=ne.length?_.div({class:Z(["cms-parallax-media",n.mediaClass])},...ne):null,Y=fe.length?_.div({class:Z(["cms-parallax-body",n.bodyClass])},...fe):null,oe=se.length||le.length?_.div({class:Z(["cms-parallax-footer",n.footerClass])},se.length?_.div({class:"cms-parallax-footer-content"},...se):null,le.length?_.div({class:"cms-parallax-actions"},...le):null):null,we=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"]);we.class=Z(["cms-parallax","cms-singularity",S,ye(n.disabled,"cms-parallax-static"),ye(be,"cms-parallax-has-badge"),ye(re,"cms-parallax-has-header"),c.class]),we.style={...c.style||{}},n.height!=null&&(we.style["--cms-parallax-height"]=Ge(n.height,gt)),n.minHeight!=null&&(we.style["--cms-parallax-min-height"]=Ge(n.minHeight,gt)),n.padding!=null&&(we.style["--cms-parallax-padding"]=Ge(n.padding,gt)),n.gap!=null&&(we.style["--cms-parallax-gap"]=Ge(n.gap,gt)),n.contentMaxWidth!=null&&(we.style["--cms-parallax-content-max-width"]=Ge(n.contentMaxWidth,gt)),n.justify!=null&&(we.style["--cms-parallax-justify"]=Ge(n.justify)),n.align!=null&&(we.style["--cms-parallax-align"]=Ge(n.align)),n.color!=null&&(we.style["--cms-parallax-color"]=Ge(n.color,u)),n.overlay!=null&&(we.style["--cms-parallax-overlay"]=Ge(n.overlay)),n.bgPosition!=null&&(we.style["--cms-parallax-position"]=Ge(n.bgPosition)),n.bgSize!=null&&(we.style["--cms-parallax-size"]=Ge(n.bgSize)),n.bgRepeat!=null&&(we.style["--cms-parallax-repeat"]=Ge(n.bgRepeat)),we.style["--cms-parallax-image"]=Ke(n.background)||Ke(n.image)||Ke(n.src)?()=>a():a();const R=_.div({class:Z(["cms-parallax-bg",n.bgClass])},C.length?_.div({class:Z(["cms-parallax-bg-content",n.backgroundContentClass])},...C):null),h=_.div({class:Z(["cms-parallax-content",n.contentClass,n.innerClass])},be,ue,O,Y,oe),m=_.div(we,R,h);let y=!1,j=!1,X=null;const d=()=>{var ee;y||(y=!0,typeof window!="undefined"&&(window.removeEventListener("scroll",g),window.removeEventListener("resize",g)),(ee=X==null?void 0:X.disconnect)==null||ee.call(X),X=null)},k=()=>{if(y)return;if(!m.isConnected){d();return}if(o(n.disabled)){R.style.transform="translate3d(0, 0, 0)",m.style.setProperty("--cms-parallax-offset","0px");return}const ee=m.getBoundingClientRect(),Ce=b(n.speed,.18),E=Math.abs(b(n.maxOffset,96)),p=o(n.startTop),A=p!=null&&p!==""?(ee.top-b(n.startTop,0))*Ce:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(ee.top+ee.height/2))*Ce,ae=`${(E>0?Math.max(-E,Math.min(E,A)):A).toFixed(2)}px`;R.style.transform=`translate3d(0, ${ae}, 0)`,m.style.setProperty("--cms-parallax-offset",ae)};function g(){y||j||(j=!0,requestAnimationFrame(()=>{j=!1,k()}))}return typeof window!="undefined"&&(window.addEventListener("scroll",g,{passive:!0}),window.addEventListener("resize",g),typeof ResizeObserver!="undefined"&&(X=new ResizeObserver(()=>{g()}),X.observe(m)),requestAnimationFrame(()=>{g()}),setTimeout(()=>{g()},90)),m.refresh=()=>(g(),m),m.update=m.refresh,m.destroy=()=>(d(),m.remove(),null),m._dispose=d,At(m,n),m};const[bo,wo]=bt.reactive.signal([]),vo=new Map;function Ro(t){const e=vo.get(t);e&&(clearTimeout(e),vo.delete(t))}function Mo(t){return t?(Ro(t),wo(bo().filter(e=>e.id!==t)),t):null}function qi(){for(const t of vo.keys())Ro(t);wo([])}function si(t){t!=null&&t.id&&(Ro(t.id),t.timeout>0&&vo.set(t.id,setTimeout(()=>{Mo(t.id)},t.timeout)))}function oi(t,e={}){if(!t)return null;let n=null;return wo(bo().map(s=>s.id!==t?s:(n=$n({...s,...e,id:s.id},e.type||e.state||e.color||s.type),n))),n&&si(n),(n==null?void 0:n.id)||null}function Yi(t){const e=()=>Mo(t.id),n=(ge={})=>oi(t.id,ge),s={toast:t,id:t.id,close:e,update:n},i=ge=>typeof ge=="function"?ge(s):ge,c=(()=>{if(t.icon===!1||t.icon===null)return null;if(t.icon!=null){const B=i(t.icon);return typeof B=="string"?Ae.Icon({name:B,size:"sm"}):JSswift.ui.slot(B,{as:"icon"})}const ge=Ui[t.type];return ge?Ae.Icon({name:ge,size:"sm"}):null})(),S=T(t.slots,"icon",s,c),u=T(t.slots,"title",s,i(t.title)),a=T(t.slots,"message",s,i(t.message)),b=T(t.slots,"description",s,i(t.description)),M=T(t.slots,"meta",s,i(t.meta)),N=T(t.slots,"actions",s,i(t.actions)),C=T(t.slots,"default",s,i(t.body)),z=T(t.slots,"dismiss",s,i(t.dismiss)),U=z.length?z:t.closable?[Ae.Btn({class:"cms-toast-close",outline:!0,size:"xs","aria-label":t.dismissLabel,onClick:e},Ae.Icon({name:"close",size:"xs"}))]:[],W=_.div({class:Z(["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"},u.length?_.div({class:"cms-toast-title"},...u):null,a.length?_.div({class:"cms-toast-message"},...a):null,b.length?_.div({class:"cms-toast-description"},...b):null,C.length?_.div({class:"cms-toast-body"},...C):null,M.length?_.div({class:"cms-toast-meta"},...M):null),N.length?_.div({class:"cms-toast-actions"},...N):null),U.length?_.div({class:"cms-toast-dismiss"},...U):null);return At(W,t),W}function Xi(){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=bo();t.innerHTML="";const n=new Map;for(const s of e){const i=ti(s.position);n.has(i)||n.set(i,[]),n.get(i).push(s)}for(const s of ei){const i=n.get(s);if(!(i!=null&&i.length))continue;const c=_.div({class:Z(["cms-toast-wrap",`is-${s}`])},...i.map(S=>Yi(S)));t.appendChild(c)}},"JSswiftUI:toasts"),t)}function Qi(t={}){Xi();const e=$n(t);return e.id=e.id||Math.random().toString(36).slice(2),wo([...bo().filter(n=>n.id!==e.id),e]),si(e),e.id}bt.services.notify.show=Qi,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=oi,bt.services.notify.remove=Mo,bt.services.notify.clear=qi,bt.services.notify.promise=Ae.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({}),u=_.rod(!1),a=_.rod(null),b=()=>e&&typeof e=="object"&&"value"in e?e.value||{}:e,M=fe=>{if(e&&typeof e=="object"&&"value"in e)e.value=fe;else{const be=e||{};for(const re in be)delete be[re];Object.assign(be,fe)}},N=fe=>{const be=b();return be?be[fe]:void 0},C=(fe,be)=>{const re={...b()||{}};re[fe]=be,M(re)},z=(fe,be)=>{const re={...c.value||{}};be?re[fe]=be:delete re[fe],c.value=re},U=fe=>(c.value||{})[fe]||null,W=fe=>{S.value={...S.value||{},[fe]:!0}},ge=fe=>!!(S.value||{})[fe],B=async fe=>{const be=n[fe]||[];if(!be.length)return z(fe,null),!0;const re=N(fe),ue={name:fe,value:re,model:b(),form:le};for(const O of be){if(!O)continue;const Y=await JSswift.form._runRule(O,re,ue);if(Y)return z(fe,Y),!1}return z(fe,null),!0},ne=async()=>{a.value=null;const fe=Object.keys(n);let be=!0;for(const re of fe)await B(re)||(be=!1);return be},le={model:e,errors:c,touched:S,submitting:u,submitError:a,getValue:N,setValue:C,getError:U,setError:z,touch:W,isTouched:ge,field:(fe,be={})=>{var j;const re=_.rod("");(j=re.action)==null||j.call(re,X=>{C(fe,X)});const ue=()=>s==="submit"||s==="input"||s==="blur"?!0:ge(fe);let O=null,Y=!1,oe=!1;const we=async()=>{Y||(Y=!0,W(fe),(s==="blur"||s==="input")&&await B(fe),setTimeout(()=>{Y=!1},0))},R=X=>{O&&(O===X.target||O.contains&&O.contains(X.target)||(we(),O=null,oe&&(oe=!1,document.removeEventListener("pointerdown",R,!0))))},h=()=>{oe||(oe=!0,document.addEventListener("pointerdown",R,!0))},m=async()=>{O=document.activeElement,Y=!1,h(),s==="input"&&await B(fe)},y=async()=>{await we(),O=null,oe&&(oe=!1,document.removeEventListener("pointerdown",R,!0))};return{name:fe,model:re,get value(){return re.value},set value(X){re.value=X},error:()=>ue()?U(fe):null,success:be.success||null,warning:be.warning||null,note:be.note||null,touch:()=>W(fe),validate:()=>B(fe),onInput:m,onBlur:y,hint:be.hint||null}},validateField:B,validate:ne,reset:()=>{a.value=null,c.value={},S.value={},i&&M({...i||{}})},submit:async fe=>{u.value=!0,a.value=null;try{return await ne()?{ok:!0,result:await(fe==null?void 0:fe(b(),le))}:{ok:!1,reason:"validation"}}catch(be){return console.error("[useForm] submit error:",be),a.value=be&&be.message?be.message:String(be),{ok:!1,reason:"exception",error:be}}finally{u.value=!1}}};return le},Ae.Form=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.form,i=e.onSubmit,c=Z(["cms-form",e.class]),S=JSswift.omit(e,["form","onSubmit"]);S.class=c;const u=_.form({...S,onSubmit:async b=>{b.preventDefault(),s&&await s.submit(i||(async()=>{}))}}),a=[];for(const b of n||[]){const M=typeof b=="function"?b(s):b,N=JSswift.ui.slot(M);N&&(Array.isArray(N)?a.push(...N):a.push(N))}return a.forEach(b=>u.appendChild(b)),s&&s.submitting&&JSswift.reactive.effect(()=>{u.classList.toggle("is-submitting",!!s.submitting.value)},"UI.Form:submitting"),u},bt.services=bt.services||{},bt.services.dialog=bt.services.dialog||{},bt.dialog=bt.services.dialog;let Ns=null;function ii(){return Ns||(Ns=document.createElement("div"),Ns.setAttribute("data-cms-modal-root","true"),document.body.appendChild(Ns),Ns)}Ae.cardHeader=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Z(["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||{}},u=Ge(e.align);u!=null&&!Qe(e,"align")&&(S.alignItems=u);const a=Ge(e.justify);a!=null&&!Qe(e,"justify")&&(S.justifyContent=a);const b=Ge(e.wrap,z=>z?"wrap":"nowrap");b!=null&&!Qe(e,"wrap")&&(S.flexWrap=b);const M=Ge(e.direction);M!=null&&!Qe(e,"direction")&&(S.flexDirection=M);const N=Ge(e.gap,gt);N!=null&&!Qe(e,"gap")&&(S.gap=N),Object.keys(S).length&&(c.style=S),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const C=_.div(c,...T(s,"default",{},n));return At(C,e),C},Ae.cardBody=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Z(["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,...T(s,"default",{},n));return At(S,e),S},Ae.cardFooter=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Z(["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||{}},u=Ge(e.align);u!=null&&!Qe(e,"align")&&(S.alignItems=u);const a=Ge(e.justify);a!=null&&!Qe(e,"justify")&&(S.justifyContent=a);const b=Ge(e.wrap,z=>z?"wrap":"nowrap");b!=null&&!Qe(e,"wrap")&&(S.flexWrap=b);const M=Ge(e.direction);M!=null&&!Qe(e,"direction")&&(S.flexDirection=M);const N=Ge(e.gap,gt);N!=null&&!Qe(e,"gap")&&(S.gap=N),Object.keys(S).length&&(c.style=S),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const C=_.div(c,...T(s,"default",{},n));return At(C,e),C},Ae.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},u=null,a=null;const b=(h,m)=>typeof h=="function"?h(m):h,M=h=>String(h||"").split(/\s+/).filter(Boolean),N=(h,m,y)=>{if(!h)return;const j=h[m]||[];j.length&&h.classList.remove(...j);const X=(y||[]).filter(Boolean);X.length&&h.classList.add(...X),h[m]=X},C=(h,m,y,j=X=>X)=>{if(h){if(y==null||y===""){h.style.removeProperty(m);return}h.style.setProperty(m,j(y))}},z=()=>{var d,k,g,P,K,ee;const h=window.visualViewport,m=Math.max(0,Math.round((d=h==null?void 0:h.offsetLeft)!=null?d:0)),y=Math.max(0,Math.round((k=h==null?void 0:h.offsetTop)!=null?k:0)),j=Math.max(0,Math.round((P=(g=h==null?void 0:h.width)!=null?g:window.innerWidth)!=null?P:0)),X=Math.max(0,Math.round((ee=(K=h==null?void 0:h.height)!=null?K:window.innerHeight)!=null?ee:0));return{left:m,top:y,width:j,height:X}},U=h=>{if(!(h!=null&&h.panel))return;const{left:m,top:y,width:j,height:X}=z();C(h.panel,"position","fixed"),C(h.panel,"inset",0,d=>`${d}px`),C(h.panel,"top",y,d=>`${d}px`),C(h.panel,"left",m,d=>`${d}px`),C(h.panel,"right","auto"),C(h.panel,"bottom","auto"),C(h.panel,"width",j,d=>`${d}px`),C(h.panel,"height",X,d=>`${d}px`),C(h.panel,"min-height",X,d=>`${d}px`),C(h.panel,"max-width",j,d=>`${d}px`),C(h.panel,"max-height",X,d=>`${d}px`),C(h.panel,"min-width",0,d=>`${d}px`),C(h.panel,"margin",0,d=>`${d}px`),C(h.panel,"box-sizing","border-box"),C(h.panel,"border-width",0,d=>`${d}px`),C(h.panel,"border-radius",0,d=>`${d}px`),C(h.panel,"transform","none"),C(h.panel,"overflow","hidden"),C(h.panel,"--cms-dialog-fullscreen-left",m,d=>`${d}px`),C(h.panel,"--cms-dialog-fullscreen-top",y,d=>`${d}px`),C(h.panel,"--cms-dialog-fullscreen-width",j,d=>`${d}px`),C(h.panel,"--cms-dialog-fullscreen-height",X,d=>`${d}px`)},W=h=>{h!=null&&h.panel&&(C(h.panel,"position",null),C(h.panel,"inset",null),C(h.panel,"top",null),C(h.panel,"left",null),C(h.panel,"right",null),C(h.panel,"bottom",null),C(h.panel,"width",null),C(h.panel,"height",null),C(h.panel,"min-height",null),C(h.panel,"max-width",null),C(h.panel,"max-height",null),C(h.panel,"min-width",null),C(h.panel,"margin",null),C(h.panel,"box-sizing",null),C(h.panel,"border-width",null),C(h.panel,"border-radius",null),C(h.panel,"transform",null),C(h.panel,"overflow",null),C(h.panel,"--cms-dialog-fullscreen-left",null),C(h.panel,"--cms-dialog-fullscreen-top",null),C(h.panel,"--cms-dialog-fullscreen-width",null),C(h.panel,"--cms-dialog-fullscreen-height",null))},ge=(h,m)=>{var g,P,K,ee,Ce;if(!h)return;if((g=h._dialogViewportCleanup)==null||g.call(h),h._dialogViewportCleanup=null,!m){W(h);return}let y=null;const j=globalThis.requestAnimationFrame||(E=>setTimeout(()=>E(Date.now()),0)),X=globalThis.cancelAnimationFrame||clearTimeout,d=()=>U(h),k=()=>{y!=null&&X(y),y=j(()=>{y=null,d()})};d(),k(),window.addEventListener("resize",d),window.addEventListener("orientationchange",k),(K=(P=window.visualViewport)==null?void 0:P.addEventListener)==null||K.call(P,"resize",d),(Ce=(ee=window.visualViewport)==null?void 0:ee.addEventListener)==null||Ce.call(ee,"scroll",k),h._dialogViewportCleanup=()=>{var E,p,A,L;y!=null&&(X(y),y=null),window.removeEventListener("resize",d),window.removeEventListener("orientationchange",k),(p=(E=window.visualViewport)==null?void 0:E.removeEventListener)==null||p.call(E,"resize",d),(L=(A=window.visualViewport)==null?void 0:A.removeEventListener)==null||L.call(A,"scroll",k)}},B=()=>S,ne=h=>{var y;const m=o((y=h.state)!=null?y:h.color);return m?i.includes(m)?m:String(m):""},he=h=>{const m=o(h.size);return typeof m=="string"&&c.includes(m)?m:""},q=h=>{var y,j,X;const m=String(o((X=(j=(y=h.actionsAlign)!=null?y:h.footerAlign)!=null?j:h.alignActions)!=null?X:"end")).toLowerCase();return["start","left"].includes(m)?"start":["center","middle"].includes(m)?"center":["between","space-between"].includes(m)?"between":["stretch","full"].includes(m)?"stretch":"end"},se=h=>{var y,j,X;const m=String(o((X=(j=(y=h.align)!=null?y:h.verticalAlign)!=null?j:h.position)!=null?X:"center")).toLowerCase();return["top","start","flex-start"].includes(m)?"cms-dialog-align-top":["bottom","end","flex-end"].includes(m)?"cms-dialog-align-bottom":""},le=h=>{var y,j;return((j=(y=h.closable)!=null?y:h.dismissible)!=null?j:h.closeButton)!==!1},fe=()=>{var ae,ke,Te,ze,V,H,te,De;const h=B(),m={close:Y,dismiss:Y,open:O,toggle:we,update:ue,isOpen:oe,entry:()=>u,props:h},y=h.icon!=null?typeof h.icon=="string"?Ae.Icon({name:h.icon,size:h.iconSize||"md"}):JSswift.ui.slot(h.icon,{as:"icon"}):null,j=T(s,"eyebrow",m,b(h.eyebrow,m)),X=T(s,"title",m,b((ke=(ae=h.title)!=null?ae:h.heading)!=null?ke:h.header,m)),d=T(s,"subtitle",m,b((Te=h.subtitle)!=null?Te:h.description,m)),k=T(s,"icon",m,y),g=T(s,"header",m,b((ze=h.headerContent)!=null?ze:h.head,m)),P=le(h)?T(s,"close",m,Ae.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":h.closeLabel||"Chiudi dialog","data-dialog-close":!0},Ae.Icon({name:h.closeIcon||"close",size:"sm"}))):[],K=(te=(H=(V=h.content)!=null?V:h.body)!=null?H:h.message)!=null?te:n&&n.length?n:null;let ee=T(s,"content",m,b(K,m));ee.length||(ee=T(s,"body",m,b(K,m))),ee.length||(ee=T(s,"default",m,b(K,m)));const Ce=b((De=h.footer)!=null?De:h.actions,m);let E=T(s,"footer",m,Ce);E.length||(E=T(s,"actions",m,Ce));let p=null;g.length?p=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...g):(j.length||X.length||d.length||k.length||P.length)&&(p=_.div({class:"cms-dialog-head"},k.length?_.div({class:"cms-dialog-icon"},...k):null,_.div({class:"cms-dialog-head-main"},j.length?_.div({class:"cms-dialog-eyebrow"},...j):null,X.length?_.div({class:"cms-dialog-title"},...X):null,d.length?_.div({class:"cms-dialog-subtitle"},...d):null),P.length?_.div({class:"cms-dialog-close-wrap"},...P):null));const A=_.div({class:Z(["cms-dialog-body",h.bodyClass])},...ee),L=E.length?_.div({class:Z(["cms-dialog-actions",`is-${q(h)}`,ye(h.stackActions,"is-stacked"),h.actionsClass,h.footerClass])},...E):null;return _.div({class:Z(["cms-dialog-shell",ye(!!p,"has-head"),ye(!!L,"has-footer"),ye(h.divider!==!1,"with-divider")])},...[p,A,L].filter(Boolean))},be=h=>{var X;if(!(h!=null&&h.panel))return;const m=B(),y=ne(m),j=he(m);N(h.panel,"_dialogClassTokens",["cms-dialog","cms-singularity","cms-clear-set",j?`cms-dialog-${j}`:"",y,y?`cms-state-${y}`:"",o(m.fullscreen)?"fullscreen":"",o(m.scrollable)?"scrollable":"",o(m.stickyHeader)?"sticky-head":"",o(m.stickyActions)?"sticky-actions":"",o(m.borderless)?"borderless":"",...M(m.class),...M(m.panelClass)]),N(h.overlay,"_dialogOverlayClassTokens",[se(m),o(m.backdropBlur)?"cms-dialog-overlay-blur":"",...M(m.overlayClass)]),C(h.panel,"--cms-dialog-width",o(m.width),gt),C(h.panel,"--cms-dialog-min-width",o(m.minWidth),gt),C(h.panel,"--cms-dialog-max-width",o(m.maxWidth),gt),C(h.panel,"--cms-dialog-max-height",o(m.maxHeight),gt),C(h.panel,"--cms-dialog-body-max-height",o((X=m.bodyMaxHeight)!=null?X:m.contentMaxHeight),gt),m.style&&Object.assign(h.panel.style,m.style),At(h.panel,m),ge(h,o(m.fullscreen)),h.panel.setAttribute("role",m.role||"dialog"),h.panel.setAttribute("aria-modal",m.modal===!1?"false":"true"),m.ariaLabel?h.panel.setAttribute("aria-label",m.ariaLabel):h.panel.removeAttribute("aria-label")},re=()=>{u!=null&&u.panel&&u.panel.replaceChildren(fe())},ue=(h={})=>(h&&typeof h=="object"&&(S={...S,...h}),u&&(be(u),re()),R),O=(h=null)=>{var X,d,k,g,P;if(h&&typeof h=="object"&&(S={...S,...h}),u)return be(u),re(),u;a=document.activeElement;const m=B(),y=m.persistent===!0;u=JSswift.overlay.open(()=>fe(),{type:"dialog",backdrop:m.backdrop!==!1,lockScroll:m.lockScroll!==!1,trapFocus:m.trapFocus!==!1,autoFocus:m.autoFocus!==!1,closeOnOutside:(X=m.closeOnOutside)!=null?X:!y,closeOnBackdrop:(d=m.closeOnBackdrop)!=null?d:!y,closeOnEsc:(k=m.closeOnEsc)!=null?k:!y,className:Kt(["cms-dialog"]),onClose:()=>{var K,ee,Ce,E;(K=u==null?void 0:u._dialogViewportCleanup)==null||K.call(u),(ee=u==null?void 0:u.panel)==null||ee.removeEventListener("click",j),u=null,(E=(Ce=B()).onClose)==null||E.call(Ce),a&&typeof a.focus=="function"&&setTimeout(()=>a.focus(),0)}});const j=K=>{const ee=K.target;ee&&ee.closest&&ee.closest("[data-dialog-close]")&&Y()};return u.panel.addEventListener("click",j),be(u),_s(u),(P=(g=B()).onOpen)==null||P.call(g,u),u},Y=()=>{if(!u)return;const h=u;ks(h,()=>JSswift.overlay.close(h.id))},oe=()=>!!u,we=(h=null)=>oe()?(Y(),null):O(h),R={open:O,close:Y,toggle:we,update:ue,isOpen:oe,entry:()=>u,props:()=>({...S})};return R},Ae.TabPanel=(...t)=>{var je,_e,Me,Ie,Ye,rt,Xe,We,w,ie,$e,F,f;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=an(e.model,"UI.TabPanel:model"),S=e.id||"cms-tabpanel-"+Math.random().toString(36).slice(2,9),u=r=>String(o(r)||"vertical").toLowerCase()==="horizontal"?"horizontal":"vertical",a=r=>String(o(r)||"before").toLowerCase()==="after"?"after":"before",b=r=>{const x=String(o(r)||"").toLowerCase();return x==="pills"||x==="pill"?"pills":x==="soft"||x==="card"?"soft":"line"},M=r=>{const x=o(r);return x==null||x===""?null:JSswift.uiColors.includes(x)?`var(--cms-${x})`:String(x)},N=u(e.orientation||e.orient||e.direction),C=a(e.navPosition||e.barPosition||e.position),z=b(e.variant||(e.pills?"pills":e.soft?"soft":"line")),U=!!e.wrap,W=!!e.swipeable,ge=!!e.infinite,B=!!e.animated,ne=!!((_e=(je=e.navFill)!=null?je:e.fill)!=null?_e:e.stretch),he=!!e.disabled,q=o((Me=e.transitionDuration)!=null?Me:e["transition-duration"]),se=(()=>{if(q==null)return 220;if(typeof q=="number")return q;const r=parseFloat(q);return Number.isFinite(r)?r:220})(),le=o((Ie=e.transitionEasing)!=null?Ie:e["transition-easing"])||"ease",fe=(rt=(Ye=e.transitionPrev)!=null?Ye:e["transition-prev"])!=null?rt:null,be=(We=(Xe=e.transitionNext)!=null?Xe:e["transition-next"])!=null?We:null,re=M((w=e.color)!=null?w:e.state),ue=i.map((r,x)=>{var Ze,wt,Nt,Et,Rt,Mt,vt,Dt,ft,Ht,qt,Xt,Ot,Qt,cn,un;if(r==null)return null;if(typeof r!="object")return{name:r,labelFallback:r,panelFallback:null,noteFallback:null,iconFallback:null,badgeFallback:null,hidden:!1,raw:r,index:x};const de=(Mt=(Rt=(Et=(Nt=(wt=(Ze=r.name)!=null?Ze:r.value)!=null?wt:r.id)!=null?Nt:r.key)!=null?Et:r.label)!=null?Rt:r.title)!=null?Mt:`tab-${x}`,Be=r.label!=null||r.title!=null,He=Be?(vt=r.label)!=null?vt:r.title:r.children!=null&&r.content==null&&r.panel==null?r.children:(ft=(Dt=r.name)!=null?Dt:r.value)!=null?ft:`Tab ${x+1}`,Se=(Xt=(qt=(Ht=r.content)!=null?Ht:r.panel)!=null?qt:r.body)!=null?Xt:Be?r.children:null,Oe=(cn=(Qt=(Ot=r.note)!=null?Ot:r.subtitle)!=null?Qt:r.description)!=null?cn:null,at=(un=r.icon)!=null?un:null,nt=Object.prototype.hasOwnProperty.call(r,"badge")?r.badge:Object.prototype.hasOwnProperty.call(r,"counter")?r.counter:null;return{...r,name:de,labelFallback:He,panelFallback:Se,noteFallback:Oe,iconFallback:at,badgeFallback:nt,index:x}}).filter(Boolean).filter(r=>r.hidden!==!0&&r.visible!==!1),O=Z(["cms-clear-set","cms-tabpanel","cms-singularity",N,`variant-${z}`,ye(U,"wrap"),ye(B,"animated"),ye(ne,"nav-fill"),ye(he,"disabled"),ye(C==="after","nav-after"),e.class]),Y=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"]);Y.class=O,Y.style=e.style;const oe=_.div(Y);B&&(oe.style.setProperty("--cms-tabpanel-duration",`${se}ms`),oe.style.setProperty("--cms-tabpanel-easing",le)),re&&oe.style.setProperty("--cms-tabpanel-accent",re);const we=_.div({class:Z(["cms-tabpanel-nav",e.navClass]),role:"tablist","aria-orientation":N}),R=_.div({class:Z(["cms-tabpanel-panels",e.panelsClass])}),h=[],m=[];let y=-1;const j=()=>N==="horizontal",X=(r,x,de)=>({tab:r,name:r.name,index:x,active:de,value:r.name,select:()=>Te(x),next:()=>V(),prev:()=>H()}),d=(r,x,de=!1)=>{var He;if(!ue.length)return-1;let Be=r;for(let Se=0;Se<ue.length;Se+=1){if(Be+=x,Be>=ue.length){if(!de)return-1;Be=0}else if(Be<0){if(!de)return-1;Be=ue.length-1}if(!((He=ue[Be])!=null&&He.disabled))return Be}return-1},k=r=>{var de;const x=(de=h[r])==null?void 0:de.btn;!x||typeof x.focus!="function"||requestAnimationFrame(()=>x.focus())},g=(r,x,de)=>{const Be=X(r,x,de),He=JSswift.ui.renderSlot(s,"label",Be,r.labelFallback);return T(null,"default",{},He)},P=(r,x)=>{var Dt,ft,Ht,qt,Xt;const de=x===y,Be=`${S}-tab-${x}`,He=`${S}-panel-${x}`,Se=X(r,x,de),Oe=g(r,x,de),at=r.iconFallback!=null?typeof r.iconFallback=="string"?Ae.Icon({name:r.iconFallback,size:(Ht=(ft=(Dt=r.iconSize)!=null?Dt:r.size)!=null?ft:e.size)!=null?Ht:null}):r.iconFallback:null,nt=T(s,"icon",Se,at),Ze=T(s,"note",Se,r.noteFallback),wt=T(s,"badge",Se,r.badgeFallback),Nt=_.span({class:"cms-tabpanel-tab-inner"},nt.length?_.span({class:"cms-tabpanel-tab-icon"},...nt):null,_.span({class:"cms-tabpanel-tab-copy"},_.span({class:"cms-tabpanel-tab-label"},...Oe.length?Oe:[""]),Ze.length?_.span({class:"cms-tabpanel-tab-note"},...Ze):null),wt.length?_.span({class:"cms-tabpanel-tab-badge"},...wt):null),Et=T(s,"tab",{...Se,label:Oe,icon:nt,note:Ze,badge:wt,tabId:Be,panelId:He},Nt),Rt=Ot=>{if(he||r.disabled)return;const Qt=Ot.key;if(Qt==="Enter"||Qt===" "){Ot.preventDefault(),Te(x);return}if(Qt==="Home"){Ot.preventDefault();const Zt=ue.findIndex(pn=>!pn.disabled);Zt>=0&&(Te(Zt),k(Zt));return}if(Qt==="End"){Ot.preventDefault();const Zt=(()=>{var pn;for(let en=ue.length-1;en>=0;en-=1)if(!((pn=ue[en])!=null&&pn.disabled))return en;return-1})();Zt>=0&&(Te(Zt),k(Zt));return}const cn=j()?["ArrowLeft"]:["ArrowUp"],un=j()?["ArrowRight"]:["ArrowDown"];if(cn.includes(Qt)){Ot.preventDefault();const Zt=d(x,-1,ge);Zt>=0&&(Te(Zt,{dir:"prev"}),k(Zt));return}if(un.includes(Qt)){Ot.preventDefault();const Zt=d(x,1,ge);Zt>=0&&(Te(Zt,{dir:"next"}),k(Zt))}},Mt=Ae.Btn({class:Z(["cms-tabpanel-tab",ye(de,"active"),ye(r.disabled||he,"disabled"),e.tabClass,r.tabClass||r.class]),type:"button",id:Be,role:"tab",disabled:!!(r.disabled||he),"aria-selected":de?"true":"false","aria-controls":He,tabindex:de?"0":"-1",outline:z==="pills"&&!de,color:z==="pills"&&de?r.color||e.color||e.state||"primary":null,size:(Xt=(qt=r.size)!=null?qt:e.size)!=null?Xt:null,style:{...e.tabStyle||{},...r.tabStyle||{}},onClick:()=>{r.disabled||he||Te(x)},onKeydown:Rt},...Et),vt=_.div({class:Z(["cms-tabpanel-nav-btn",ye(de,"active"),r.navClass]),"data-name":r.name},Mt,_.span({class:"tab-indicator"}));return h[x]={btn:Mt,wrap:vt,index:x},vt},K=(r,x)=>{const de=x===y,Be=`${S}-tab-${x}`,He=`${S}-panel-${x}`,Se=X(r,x,de),Oe=JSswift.ui.renderSlot(s,"panel",Se,r.panelFallback),at=_.div({class:Z(["cms-tabpanel-panel",ye(de,"active"),e.panelClass,r.panelClass]),style:{...e.panelStyle||{},...r.panelStyle||{}},"data-name":r.name,role:"tabpanel",id:He,tabindex:0,"aria-labelledby":Be,"aria-hidden":de?"false":"true"},...T(null,"default",{},Oe));return m[x]=at,at},ee=ue.map((r,x)=>P(r,x)),Ce=JSswift.ui.renderSlot(s,"nav",{tabs:ue,active:()=>{var r;return y>=0?(r=ue[y])==null?void 0:r.name:null},activeIndex:()=>y,activeTab:()=>y>=0?ue[y]:null,select:r=>{typeof r=="number"?Te(r):ze(r)},next:()=>V(),prev:()=>H(),nodes:ee,orientation:N,position:C,variant:z},ee);T(null,"default",{},Ce).forEach(r=>we.appendChild(r)),ue.length?ue.forEach((r,x)=>R.appendChild(K(r,x))):T(s,"empty",{tabs:ue},(ie=e.empty)!=null?ie:_.div({class:"cms-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(x=>R.appendChild(x));const E=r=>{if(!B)return;const x=r==="next"?"18px":"-18px",de=r==="next"?"-18px":"18px";oe.style.setProperty("--cms-tabpanel-enter",x),oe.style.setProperty("--cms-tabpanel-leave",de)},p=()=>{const r=[];fe&&r.push(...String(fe).split(/\s+/)),be&&r.push(...String(be).split(/\s+/)),r.length&&R.classList.remove(...r.filter(Boolean))},A=r=>{p();const x=r==="prev"?fe:be;if(!x)return;const de=String(x).split(/\s+/).filter(Boolean);de.length&&(R.classList.add(...de),setTimeout(()=>R.classList.remove(...de),se+40))},L=r=>{var Be;const x=h.find(({btn:He})=>He.classList.contains("active")),de=(Be=x==null?void 0:x.btn.parentNode)==null?void 0:Be.getBoundingClientRect();h.forEach(({btn:He,index:Se})=>{const Oe=Se===r,at=He.parentNode;if(!at)return;const nt=at.getBoundingClientRect();at.isConnected&&de&&(at.style.setProperty("--nav-pos-x",de.left-nt.left+"px"),at.style.setProperty("--nav-pos-y",de.top-nt.top+"px")),at.classList.toggle("active",Oe),He.classList.toggle("active",Oe),He.setAttribute("aria-selected",Oe?"true":"false"),He.setAttribute("tabindex",Oe?"0":"-1")})},ae=(r,x,de)=>{E(de),m.forEach((Be,He)=>{if(!Be)return;const Se=He===x,Oe=He===r;Se?(Be.classList.add("active"),Be.classList.remove("leaving"),Be.setAttribute("aria-hidden","false")):(Be.classList.remove("active"),Be.setAttribute("aria-hidden","true"),B&&Oe?(Be.classList.add("leaving"),setTimeout(()=>Be.classList.remove("leaving"),se+40)):Be.classList.remove("leaving"))})},ke=(r,x)=>r<0||r===x||ge&&r===ue.length-1&&x===0?"next":ge&&r===0&&x===ue.length-1?"prev":x>r?"next":"prev",Te=(r,x={})=>{var Se,Oe;if(r==null||r<0||r>=ue.length||(Se=ue[r])!=null&&Se.disabled)return;const de=y;if(de===r)return;y=r;const Be=ue[r],He=x.dir||ke(de,r);c&&!x.fromModel&&c.set(Be.name),L(r),ae(de,r,He),A(He),oe.dataset.active=String(Be.name),(Oe=e.onChange)==null||Oe.call(e,Be.name,Be,r)},ze=(r,x={})=>{if(!ue.length)return;const de=ue.findIndex(Be=>Be.name==r);de!==-1&&Te(de,x)},V=()=>{if(!ue.length)return;const r=y<0?ue.findIndex(x=>!x.disabled):d(y,1,ge);r<0||Te(r,{dir:"next"})},H=()=>{if(!ue.length)return;const r=y<0?(()=>{var x;for(let de=ue.length-1;de>=0;de-=1)if(!((x=ue[de])!=null&&x.disabled))return de;return-1})():d(y,-1,ge);r<0||Te(r,{dir:"prev"})};if(W){let r=0,x=0,de=!1;const Be=42;R.addEventListener("pointerdown",He=>{He.button!=null&&He.button!==0||(de=!0,r=He.clientX,x=He.clientY)}),R.addEventListener("pointerup",He=>{if(!de)return;de=!1;const Se=He.clientX-r,Oe=He.clientY-x;Math.abs(Se)<Be||Math.abs(Se)<Math.abs(Oe)||(Se<0?V():H())}),R.addEventListener("pointercancel",()=>{de=!1}),R.addEventListener("pointerleave",()=>{de=!1})}const te=c?c.get():(f=(F=($e=e.value)!=null?$e:e.defaultValue)!=null?F:e.default)!=null?f:null;if(ue.length){const r=ue.findIndex(x=>x.name==te);if(r>=0)Te(r,{fromModel:!0});else{const x=ue.findIndex(de=>!de.disabled);x>=0&&(Te(x,{fromModel:!0}),c&&c.set(ue[x].name))}}return c&&c.watch(r=>ze(r,{fromModel:!0}),"UI.TabPanel:watch"),C==="after"?(oe.appendChild(R),oe.appendChild(we)):(oe.appendChild(we),oe.appendChild(R)),T(s,"default",{},n).forEach(r=>oe.appendChild(r)),At(oe,e),oe._tabs=()=>ue.slice(),oe._active=()=>y>=0?ue[y]:null,oe._getValue=()=>{var r;return y>=0?(r=ue[y])==null?void 0:r.name:null},oe._setValue=r=>ze(r),oe._select=r=>{typeof r=="number"?Te(r):ze(r)},oe._next=V,oe._prev=H,oe};function Zi(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Oo({title:t,message:e,contentNode:n,okText:s,cancelText:i,showCancel:c,onOk:S,onCancel:u,persistent:a}){ii();const b=_.div({class:"cms-dialog-backdrop",onClick:W=>{W.target===b&&a!==!0&&(u==null||u())}}),M=T(null,"default",{},t),N=T(null,"default",{},e),C=T(null,"default",{},n),z=_.div({class:"cms-dialog cms-panel"},M.length?_.h3(...M):null,N.length?_.p(...N):null,...C,_.div({class:"cms-dialog-actions"},c?JSswift.ui.Btn({onClick:u},i||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:S},s||"OK")));b.appendChild(z),ii().appendChild(b);const U=W=>{W.key==="Escape"&&(u==null||u())};return document.addEventListener("keydown",U,{once:!0}),{backdrop:b,close:()=>Zi(b)}}bt.dialog.alert=function(t,e={}){return new Promise(n=>{const{backdrop:s,close:i}=Oo({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}=Oo({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}=Oo({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 fn=null,Bs=0;function li(){if(fn)return fn;fn=document.createElement("div"),fn.className="cms-loading-backdrop",fn.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),fn.appendChild(t),document.body.appendChild(fn);const
|
|
32
|
+
`,s.appendChild(i);const c=document.createElement("div");c.style.cssText="display:flex; gap: 12px; align-items:center; width: 100%;",c.appendChild(e),c.appendChild(n),t.appendChild(c),t.appendChild(s),fn.appendChild(t),document.body.appendChild(fn);const S=document.createElement("style");return S.textContent=`
|
|
33
33
|
@keyframes cmsSpin { to { transform: rotate(360deg); } }
|
|
34
|
-
`,document.head.appendChild(w),fn._textNode=n,fn._spinner=e,fn._progressWrap=s,fn._progressBar=i,fn._progressActive=!1,fn}function ri(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 ai(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=li(),s=ri(t,e);Bs++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",ai(n,"spinner"),s.spinner===!1&&(n._spinner.style.display="none"),n.style.display="flex"},bt.loading.hide=function(){fn&&(Bs=Math.max(0,Bs-1),Bs===0&&(fn.style.display="none",fn._progressActive=!1))},bt.loading.progress=function(t=0,e={}){var c;const n=li();typeof t=="object"&&t!==null&&(e=t,t=(c=t.value)!=null?c:0);const s=ri(null,e);n._progressActive||(Bs++,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+"%",ai(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 el(t){return typeof t=="function"?t():t||[]}function Fo(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 tl(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 nl(t){const e=el(t);return Array.isArray(e)?e:[]}function ci(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 Do(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 ui(t,e){return t.find((n,s)=>Do(n,s)===e||(n==null?void 0:n.key)===e)||null}function So(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"?Fo(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function Co(t,e){return typeof t=="function"?t(e)||{}:t||{}}function xo(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(xo).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 sl(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 ol(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 w=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var O;return(O=b==null?void 0:b.searchKey)!=null?O:b==null?void 0:b.key}).filter(Boolean),d=[];if(w.length)for(const b of w)if(typeof b=="function")d.push(xo(b(t)));else{const O=e.find(C=>(C==null?void 0:C.key)===b||(C==null?void 0:C.searchKey)===b);d.push(xo(O?So(O,t,-1):Fo(t,b)))}else d.push(xo(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=sl(e.pageSizeOptions,[5,10,20,50]),w=Number((ae=(He=e.pageSize)!=null?He:c[0])!=null?ae:10)||10,d=Array.from(new Set([...c,w])).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",O=en(e.searchModel||e.queryModel,"UI.Table:query"),[C,v]=bt.reactive.signal(Math.max(1,Number(e.page||1)||1)),[T,le]=bt.reactive.signal(w),[Z,he]=bt.reactive.signal(r),[H,W]=bt.reactive.signal(String((Ee=O?O.get():($e=e.search)!=null?$e:e.query)!=null?Ee:"")),se=De=>{const Ie=String(De!=null?De:"");W(Ie),O&&O.set(Ie),v(1)},X=De=>{const Ie=Number(De)||w;le(Ie),v(1)},de=(De,Ie)=>{const qe=Do(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),v(1)};let _e=null;O&&O.watch(De=>{const Ie=String(De!=null?De:"");W(Ie),_e&&_e.value!==Ie&&(_e.value=Ie),v(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","hideStatus","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"}),fe=J(s,"default",{},n);fe.length&&me.appendChild(_.div({class:"cms-table-lead"},...fe));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"}),F=_.div({class:"cms-table-toolbar-side"});ce.forEach(De=>Se.appendChild(De)),$.forEach(De=>Se.appendChild(De));const p=J(s,"search",{query:H(),getQuery:H,setQuery:se},null);if(p.length)p.forEach(De=>F.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");F.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),_e,De))}re.forEach(De=>F.appendChild(De)),(Se.childNodes.length||F.childNodes.length)&&(oe.appendChild(Se),oe.appendChild(F),me.appendChild(oe));const f=_.div({class:"cms-singularity cms-table-chip"},""),h=_.div({class:"cms-singularity cms-table-chip"},""),B=_.div({class:"cms-singularity cms-table-chip"},""),ie=J(s,"status",{},e.status),a=_.div({class:"cms-table-status"},f,h,B,...ie);e.hideStatus!==!0&&me.appendChild(a);const x=J(s,"caption",{},e.caption);x.length&&me.appendChild(_.div({class:"cms-table-caption"},...x));const g=_.thead(),P=_.tbody(),q=!!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 E=_.table({class:Q,style:ve},g,P),m=_.div({class:"cms-singularity cms-table-wrap"},E);me.appendChild(m);const N=_.div({class:"cms-singularity cms-table-chip"},""),I=_.div({class:"cms-singularity cms-table-chip"},""),K=Ne.Btn({outline:!0,onClick:()=>v(Math.max(1,C()-1))},"\u2039"),ke=Ne.Btn({outline:!0,onClick:()=>v(C()+1)},"\u203A"),Oe=_.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(T()),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"},N,I,_.label({class:"cms-table-size"},_.span("Righe"),Te)),_.div({class:"cms-table-foot-extra"},...U,_.div({class:"cms-table-pager"},K,Oe,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()},z={...Co(Ie==null?void 0:Ie.style,{...Be,header:!0}),...Co((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&&(z.width=yt(Ie.width)),(Ie==null?void 0:Ie.minWidth)!=null&&(z.minWidth=yt(Ie.minWidth)),(Ie==null?void 0:Ie.maxWidth)!=null&&(z.maxWidth=yt(Ie.maxWidth)),Ie!=null&&Ie.align&&(z.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:ci(Ie);Pe=J(s,"header",Be,et)}const M=Z(),k=Do(Ie,qe),S=(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=!!M&&(M.key===k||M.key===(Ie==null?void 0:Ie.key)),A=_.th({class:te(["cms-table-head-cell",ye(Ie==null?void 0:Ie.nowrap,"is-nowrap"),ye(S,"cms-table-sortable"),ye(u,"is-sorted"),Ie==null?void 0:Ie.headerClass]),style:z});S?A.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>de(Ie,qe)},_.span({class:"cms-table-head-label"},...Pe),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},u?M.dir==="asc"?"\u2191":"\u2193":"\u2195"))):Pe.forEach(et=>A.appendChild(et)),De.appendChild(A)}),q){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),z=String(i.length+(q?1:0));P.appendChild(_.tr(_.td({colSpan:z,class:"cms-table-state"},...Be)))};return bt.reactive.effect(()=>{const De=nl(e.rows),Ie=String(H()||"").trim(),qe=Z(),Be=typeof e.loading=="function"?!!e.loading():!!e.loading,z=e.pagination!==!1;if(ne(),P.innerHTML="",_e&&_e.value!==H()&&(_e.value=H()),Te.value!==String(T())&&(Te.value=String(T())),Be){f.textContent="Caricamento in corso",h.style.display="none",B.style.display="none",N.textContent="Loading\u2026",I.textContent="",Oe.textContent="Pagina 1",K.disabled=!0,ke.disabled=!0,Ve("loading",e.loadingText||"Loading...");return}let Pe=De.slice();const M=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=>ol(G,i,Ie,e))),qe){const G=ui(i,qe.key);G&&Pe.sort((Ge,lt)=>{const tt=So(G,Ge,-1),dt=So(G,lt,-1),St=typeof G.compare=="function"?G.compare(tt,dt,Ge,lt):tl(tt,dt);return qe.dir==="asc"?St:-St})}const k=Pe.length,S=Math.max(1,Number(T())||w),u=z?Math.max(1,Math.ceil(k/S)):1,A=z?Math.min(C(),u):1;A!==C()&&v(A);const xe=z?(A-1)*S:0,Ue=z?xe+S:k,et=Pe.slice(xe,Ue);if(f.textContent=k===M?`${k} righe`:`${k} di ${M} righe`,h.textContent=Ie?`Ricerca: ${Ie}`:"",h.style.display=Ie?"":"none",qe){const G=ui(i,qe.key);B.textContent=G?`Ordine: ${ci(G)} ${qe.dir==="asc"?"\u2191":"\u2193"}`:"",B.style.display=G?"":"none"}else B.style.display="none";if(N.textContent=k?`${xe+1}-${Math.min(Ue,k)} di ${k}`:"0 risultati",I.textContent=k!==M?`Dataset totale ${M}`:`Page size ${S}`,Oe.textContent=z?`Pagina ${A} / ${u}`:"Tutte le righe",K.disabled=!z||A<=1,ke.disabled=!z||A>=u,Te.disabled=!z,Te.parentNode.style.display=z?"":"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):Fo(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,an;const Ft=So(st,Ge,lt),Dt={...tt,col:st,colIndex:wt,value:Ft},Yt={...Co(st==null?void 0:st.style,Dt),...Co((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=yt(st.width)),(st==null?void 0:st.minWidth)!=null&&(Yt.minWidth=yt(st.minWidth)),(st==null?void 0:st.maxWidth)!=null&&(Yt.maxWidth=yt(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 mn=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=mn==null?(an=st==null?void 0:st.emptyText)!=null?an:"":mn;jt=J(s,"cell",Dt,Gt)}jt.length||(jt=[""]),jt.forEach(mn=>on.appendChild(mn)),Rt.appendChild(on)}),q){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)))}P.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 w={...e},d=null,r=null,b=null,O=null,C=null;const v=(m,N)=>Object.prototype.hasOwnProperty.call(m||{},N),T=(m,N)=>typeof m=="function"?m(N):m,le=m=>String(m||"").split(/\s+/).filter(Boolean),Z=m=>m&&typeof m=="object"&&!m.nodeType&&!Array.isArray(m)&&!(m instanceof Function),he=m=>!!m&&typeof m=="object"&&(m.nodeType===1||typeof m.getBoundingClientRect=="function"),H=()=>{clearTimeout(O),clearTimeout(C),O=null,C=null},W=(m,N,I)=>{if(!m)return;const K=m[N]||[];K.length&&m.classList.remove(...K);const ke=(I||[]).filter(Boolean);ke.length&&m.classList.add(...ke),m[N]=ke},se=(m,N,I,K=ke=>ke)=>{if(m){if(I==null||I===""){m.style.removeProperty(N);return}m.style.setProperty(N,K(I))}},X=()=>w||{},de=m=>{var I;const N=String(o((I=m.state)!=null?I:m.color)||"").toLowerCase();return i.includes(N)?N:""},_e=m=>{const N=String(o(m.size)||"").toLowerCase();return c.includes(N)?N:""},be=m=>{var N,I;return String(o((I=(N=m.placement)!=null?N:m.position)!=null?I:"bottom-start"))},me=()=>{var I;const m=o((I=X().delay)!=null?I:X().showDelay),N=Number(m);return Number.isFinite(N)?Math.max(0,N):0},fe=()=>{const m=o(X().hideDelay),N=Number(m);return Number.isFinite(N)?Math.max(0,N):80},ce=(m=null)=>{var I,K,ke;if(m)return m;const N=X();return r||o((ke=(K=(I=N.anchorEl)!=null?I:N.triggerEl)!=null?K:N.target)!=null?ke:N.anchor)||null},$=m=>{if(m==null||m===!0)return new Set(["click"]);if(m===!1)return new Set(["manual"]);const N=Array.isArray(m)?m:String(m).split(/[\s,|/]+/),I=new Set;return N.forEach(K=>{const ke=String(K||"").trim().toLowerCase();ke&&(ke==="mouseenter"||ke==="mouseover"?I.add("hover"):ke==="blur"||ke==="focusin"?I.add("focus"):ke==="tap"?I.add("click"):I.add(ke))}),I.size?I:new Set(["manual"])},re=(m,N)=>{var ke,Oe,Te;let I=null,K=null;if(he(m))I=m,Z(N)&&(K=N);else if(Z(m)){K=m;const U=(Te=(Oe=(ke=m.anchorEl)!=null?ke:m.triggerEl)!=null?Oe:m.target)!=null?Te:m.anchor;he(U)&&(I=U)}else m!=null&&(I=m);return{anchorEl:I,nextProps:K}},oe=(m=d==null?void 0:d.panel)=>{var N;return Array.from(((N=m==null?void 0:m.querySelectorAll)==null?void 0:N.call(m,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(I=>I.offsetParent!==null&&I.getAttribute("aria-hidden")!=="true")},Se=()=>{o(X().autoFocus)!==!1&&setTimeout(()=>{const m=oe();if(!m.length)return;(m.find(I=>I.classList.contains("is-active")||I.classList.contains("is-selected")||I.classList.contains("is-checked"))||m[0]).focus()},0)},F=(m,N,I="sm")=>{const K=T(m,N);return K==null?[]:typeof K=="string"?[Ne.Icon({name:K,size:I})]:Vs(K,{...N,as:"icon"})},p=(m,N)=>{var xe,Ue,et,G,Ge,lt,tt,dt,St,It,Rt,Pt,st;const I=T(m,N);if(I==null||I===!1)return[];if(Array.isArray(I))return I.flatMap((wt,Ft)=>p(wt,{...N,index:Ft}));if(typeof I=="function")return p(I(N),N);if(I!=null&&I.nodeType)return[I];if(typeof I=="string"||typeof I=="number")return p({label:I},N);if(!Z(I))return Vs(I,{...N,as:"item"});const K=String((Ue=(xe=I.type)!=null?xe:I.kind)!=null?Ue:"").toLowerCase();if(K==="separator"||K==="divider"||I.separator===!0||I.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ke=(et=I.items)!=null?et:I.children;if((K==="group"||K==="section"||Array.isArray(ke))&&ke!=null){const wt={...N,item:I},Ft=J(s,"groupLabel",wt,T((G=I.label)!=null?G:I.title,wt)),Dt=p(ke,wt);return Dt.length?[_.div({class:te(["cms-menu-group",I.class])},Ft.length?_.div({class:"cms-menu-group-label"},...Ft):null,_.div({class:"cms-menu-group-items"},...Dt))]:[]}const Oe={...N,item:I,close:ie,dismiss:ie,open:x,toggle:q,update:a,isOpen:Q,entry:()=>d,anchorEl:ce(),props:X()},Te=!!o(I.disabled),U=I.checked==null?null:!!o(I.checked),j=!!o((Ge=I.active)!=null?Ge:I.selected),ne=de(I),Ve=o(I.href),He=o(I.to),ae=v(I,"closeOnSelect")?!!o(I.closeOnSelect):I.keepOpen===!0?!1:X().closeOnSelect!==!1,$e=I.role||(U!=null?"menuitemcheckbox":"menuitem"),Ee=F(I.icon,Oe),De=F((lt=I.iconRight)!=null?lt:I.endIcon,Oe),Ie=J(s,"itemTitle",Oe,T((tt=I.title)!=null?tt:I.label,Oe)),qe=J(s,"itemSubtitle",Oe,T((dt=I.subtitle)!=null?dt:I.description,Oe)),Be=J(s,"itemShortcut",Oe,T(I.shortcut,Oe)),z=J(s,"itemBadge",Oe,T(I.badge,Oe)),Pe=J(s,"item",Oe,T((It=(St=I.content)!=null?St:I.body)!=null?It:I.render,Oe)),M=[...z,...Be,...U===!0&&!De.length&&!z.length?[_.span({class:"cms-menu-entry-check"},Ne.Icon({name:I.checkedIcon||"check",size:"sm"}))]:[],...De],S={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"),I.class]),role:$e,tabIndex:Te?-1:(Rt=I.tabIndex)!=null?Rt:-1,"data-menu-item":!0,"data-menu-select":ae?"true":"false","data-menu-close":I.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=I.titleAttr)!=null?Pt:I.tooltip)!=null?st:null,type:Ve?null:"button",href:Ve||null,target:I.target||null,rel:I.rel||(I.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,I,Oe,wt);const Ft=(Xt=I.onClick)==null?void 0:Xt.call(I,Oe,wt);wt.defaultPrevented||(He&&((on=JSswift.router)!=null&&on.navigate)&&(wt.preventDefault(),JSswift.router.navigate(He)),Ft!==!1&&ae&&ie())}};I.attrs&&typeof I.attrs=="object"&&Object.assign(S,I.attrs);const u=Ve?_.a:_.button,A=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(S,Ee.length?_.span({class:"cms-menu-entry-icon"},...Ee):null,_.span({class:"cms-menu-entry-main"},...A),M.length?_.span({class:"cms-menu-entry-aside"},...M):null)]},f=()=>{var Ie,qe,Be,z,Pe,M,k;const m=X(),N={close:ie,dismiss:ie,open:x,toggle:q,update:a,isOpen:Q,entry:()=>d,anchorEl:ce(),props:m},I=F(m.icon,N,m.iconSize||"md"),K=J(s,"eyebrow",N,T(m.eyebrow,N)),ke=J(s,"title",N,T((qe=(Ie=m.title)!=null?Ie:m.heading)!=null?qe:m.label,N)),Oe=J(s,"subtitle",N,T((Be=m.subtitle)!=null?Be:m.description,N)),Te=J(s,"before",N,T(m.before,N)),U=J(s,"header",N,T(m.header,N)),j=J(s,"after",N,T(m.after,N)),ne=J(s,"footer",N,T(m.footer,N)),Ve=J(s,"status",N,T(m.status,N));let He=(z=m.content)!=null?z:m.body;He==null&&n&&n.length&&(He=n);let ae=J(s,"content",N,T(He,N));ae.length||(ae=J(s,"body",N,T(He,N))),ae.length||(ae=J(s,"default",N,T(He,N)));const $e=p((M=(Pe=m.items)!=null?Pe:m.actionsList)!=null?M:m.entries,N),Ee=$e.length?[]:J(s,"empty",N,T((k=m.empty)!=null?k:m.emptyText,N));let De=null;return U.length?De=_.div({class:te(["cms-menu-head","cms-menu-head-custom",m.headerClass])},...U):(I.length||K.length||ke.length||Oe.length)&&(De=_.div({class:te(["cms-menu-head",m.headerClass])},I.length?_.div({class:"cms-menu-head-icon"},...I):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,Oe.length?_.div({class:"cms-menu-subtitle"},...Oe):null))),_.div({class:te(["cms-menu","cms-menu-shell",ye(m.dense,"dense"),ye($e.length>0,"has-items"),ye(ne.length>0||Ve.length>0,"has-footer"),m.class]),style:m.style||{},role:m.role||"menu","aria-label":m.ariaLabel||null},Te.length?_.div({class:"cms-menu-before"},...Te):null,De,ae.length?_.div({class:te(["cms-menu-content",m.contentClass])},...ae):null,$e.length?_.div({class:te(["cms-menu-items",m.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",m.footerClass])},Ve.length?_.div({class:"cms-menu-status"},...Ve):null,ne.length?_.div({class:"cms-menu-footer-actions"},...ne):null):null)},h=m=>{var ke;if(!(m!=null&&m.panel))return;const N=X(),I=de(N),K=_e(N);W(m.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",K?`cms-menu-${K}`:"",I?`cms-state-${I}`:"",o(N.outline)?"outline":"",...le(N.panelClass)]),W(m.overlay,"_menuOverlayClassTokens",[...le(N.overlayClass)]),m.panel.dataset.placement=be(N),se(m.panel,"--cms-menu-width",o(N.width),yt),se(m.panel,"--cms-menu-min-width",o(N.minWidth),yt),se(m.panel,"--cms-menu-max-width",o(N.maxWidth),yt),se(m.panel,"--cms-menu-max-height",o(N.maxHeight),yt),se(m.panel,"--cms-menu-body-max-height",o((ke=N.bodyMaxHeight)!=null?ke:N.contentMaxHeight),yt),N.panelStyle&&Object.assign(m.panel.style,N.panelStyle),Nt(m.panel,N)},B=()=>{d!=null&&d.panel&&d.panel.replaceChildren(f())},ie=()=>{if(H(),!d)return;const m=d;d=null,ks(m,()=>JSswift.overlay.close(m.id))},a=(m={})=>{var N,I,K,ke;if(m&&typeof m=="object"&&(w={...w,...m}),d){const Oe=X();h(d),B(),(ke=d.reposition)==null||ke.call(d,{anchorEl:d._anchorEl,placement:be(Oe),offsetX:(N=Oe.offsetX)!=null?N:0,offsetY:(K=(I=Oe.offsetY)!=null?I:Oe.offset)!=null?K:8}),Se()}return E},x=(m=null,N=null)=>{var De,Ie,qe,Be,z,Pe,M,k,S,u,A,xe,Ue,et,G,Ge;H();const{anchorEl:I,nextProps:K}=re(m,N);K&&(w={...w,...K});const ke=X(),Oe=ce(I);if(!Oe||o(ke.disabled))return null;if(d&&d._anchorEl===Oe){const lt=X();return h(d),B(),(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(()=>f(),{type:"menu",anchorEl:Oe,placement:be(ke),offsetX:(z=ke.offsetX)!=null?z:0,offsetY:(M=(Pe=ke.offsetY)!=null?Pe:ke.offset)!=null?M: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&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(d!=null&&d.panel))return d;const U=d;Te=U,U._anchorEl=Oe;const j=()=>{clearTimeout(C),C=null},ne=()=>{P()},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=(S=ke.trigger)!=null?S:ke.triggers)!=null?u:v(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)},h(U),(et=U.reposition)==null||et.call(U,{anchorEl:Oe,placement:be(ke),offsetX:(A=ke.offsetX)!=null?A: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=(m,N=null)=>{clearTimeout(C),C=null,clearTimeout(O),O=setTimeout(()=>x(m,N),me())},P=(m=!1)=>{if(clearTimeout(O),O=null,!!d){if(clearTimeout(C),m){ie();return}C=setTimeout(()=>ie(),fe())}},q=(m=null,N=null)=>Q()?(ie(),null):x(m,N),Q=()=>!!d,E={open:x,close:ie,show:g,hide:P,toggle:q,update:a,bind:m=>{var ne,Ve;if(!m)return()=>{};r=m;const N=X(),I=$((Ve=(ne=N.trigger)!=null?ne:N.triggers)!=null?Ve:v(N,"open")?"manual":null),K=I.has("hover"),ke=I.has("focus"),Oe=I.has("click"),Te=I.has("manual")||!K&&!ke&&!Oe,U=[],j=()=>{H(),U.forEach(He=>He()),r===m&&(r=null)};if(v(N,"open"))return Ye(N.open)?JSswift.reactive.effect(()=>{r&&(o(X().open)?x(r):P(!0))},"UI.Menu:open"):N.open===!0?x(m):N.open===!1&&P(!0),j;if(Te||o(N.disabled))return j;if(K){const He=()=>g(m),ae=()=>P();m.addEventListener("mouseenter",He),m.addEventListener("mouseleave",ae),U.push(()=>{m.removeEventListener("mouseenter",He),m.removeEventListener("mouseleave",ae)})}if(ke){const He=()=>g(m),ae=()=>P();m.addEventListener("focus",He),m.addEventListener("blur",ae),U.push(()=>{m.removeEventListener("focus",He),m.removeEventListener("blur",ae)})}if(Oe){const He=ae=>{var $e,Ee;(Ee=($e=X()).onTriggerClick)==null||Ee.call($e,ae),!ae.defaultPrevented&&q(m)};m.addEventListener("click",He),U.push(()=>m.removeEventListener("click",He))}return j},isOpen:Q,entry:()=>d,props:()=>({...w})};return E},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 w={...e},d=null,r=null,b=null,O=null,C=null;const v=(E,m)=>Object.prototype.hasOwnProperty.call(E||{},m),T=(E,m)=>typeof E=="function"?E(m):E,le=E=>String(E||"").split(/\s+/).filter(Boolean),Z=E=>E&&typeof E=="object"&&!E.nodeType&&!Array.isArray(E)&&!(E instanceof Function),he=E=>!!E&&typeof E=="object"&&(E.nodeType===1||typeof E.getBoundingClientRect=="function"),H=()=>{clearTimeout(O),clearTimeout(C),O=null,C=null},W=(E,m,N)=>{if(!E)return;const I=E[m]||[];I.length&&E.classList.remove(...I);const K=(N||[]).filter(Boolean);K.length&&E.classList.add(...K),E[m]=K},se=(E,m,N,I=K=>K)=>{if(E){if(N==null||N===""){E.style.removeProperty(m);return}E.style.setProperty(m,I(N))}},X=()=>w,de=E=>{var N;const m=o((N=E.state)!=null?N:E.color);return m?i.includes(m)?m:String(m):""},_e=E=>{const m=o(E.size);return typeof m=="string"&&c.includes(m)?m:""},be=E=>{var N,I,K;const m=String(o((K=(I=(N=E.actionsAlign)!=null?N:E.footerAlign)!=null?I:E.alignActions)!=null?K:"end")).toLowerCase();return["start","left"].includes(m)?"start":["center","middle"].includes(m)?"center":["between","space-between"].includes(m)?"between":["stretch","full"].includes(m)?"stretch":"end"},me=E=>{var m,N;return String(o((N=(m=E.placement)!=null?m:E.position)!=null?N:"bottom-start"))},fe=(E,m)=>{const N=o(E);if(N==null||N==="")return m;const I=Number(N);return Number.isFinite(I)?I:m},ce=()=>fe(X().delay,0),$=()=>fe(X().hideDelay,120),re=E=>{var N,I;return((I=(N=E.closable)!=null?N:E.dismissible)!=null?I:E.closeButton)===!0},oe=(E=null)=>{var N,I,K;if(E)return E;const m=X();return r||o((K=(I=(N=m.anchorEl)!=null?N:m.triggerEl)!=null?I:m.target)!=null?K:m.anchor)||null},Se=E=>{if(E==null||E===!0)return new Set(["click"]);if(E===!1)return new Set(["manual"]);const m=Array.isArray(E)?E:String(E).split(/[\s,|/]+/),N=new Set;return m.forEach(I=>{const K=String(I||"").trim().toLowerCase();K&&(K==="mouseenter"||K==="mouseover"?N.add("hover"):K==="blur"||K==="focusin"?N.add("focus"):K==="tap"?N.add("click"):N.add(K))}),N.size?N:new Set(["manual"])},F=(E,m)=>{var K,ke,Oe;let N=null,I=null;if(he(E))N=E,Z(m)&&(I=m);else if(Z(E)){I=E;const Te=(Oe=(ke=(K=E.anchorEl)!=null?K:E.triggerEl)!=null?ke:E.target)!=null?Oe:E.anchor;he(Te)&&(N=Te)}else E!=null&&(N=E);return{anchorEl:N,nextProps:I}},p=()=>{var Ee,De,Ie,qe,Be,z,Pe,M,k;const E=X(),m={close:B,dismiss:B,open:a,toggle:P,update:ie,isOpen:q,entry:()=>d,anchorEl:oe(),props:E},N=E.icon!=null?typeof E.icon=="string"?Ne.Icon({name:E.icon,size:E.iconSize||"md"}):JSswift.ui.slot(E.icon,{as:"icon"}):null,I=J(s,"eyebrow",m,T(E.eyebrow,m)),K=J(s,"title",m,T((De=(Ee=E.title)!=null?Ee:E.heading)!=null?De:E.label,m)),ke=J(s,"subtitle",m,T((Ie=E.subtitle)!=null?Ie:E.description,m)),Oe=J(s,"icon",m,N),Te=J(s,"header",m,T((Be=(qe=E.headerContent)!=null?qe:E.head)!=null?Be:E.header,m)),U=re(E)?J(s,"close",m,Ne.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":E.closeLabel||"Chiudi popover","data-popover-close":!0},Ne.Icon({name:E.closeIcon||"close",size:"sm"}))):[];let j=(M=(Pe=(z=E.content)!=null?z:E.body)!=null?Pe:E.message)!=null?M:E.text;j==null&&n&&n.length&&(j=n);let ne=J(s,"content",m,T(j,m));ne.length||(ne=J(s,"body",m,T(j,m))),ne.length||(ne=J(s,"default",m,T(j,m)));const Ve=T((k=E.footer)!=null?k:E.actions,m);let He=J(s,"footer",m,Ve);He.length||(He=J(s,"actions",m,Ve));let ae=null;Te.length?ae=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...Te):(I.length||K.length||ke.length||Oe.length||U.length)&&(ae=_.div({class:"cms-dialog-head"},Oe.length?_.div({class:"cms-dialog-icon"},...Oe):null,_.div({class:"cms-dialog-head-main"},I.length?_.div({class:"cms-dialog-eyebrow"},...I):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",E.bodyClass])},...ne)),He.length&&$e.push(_.div({class:te(["cms-dialog-actions",`is-${be(E)}`,ye(E.stackActions,"is-stacked"),E.actionsClass,E.footerClass])},...He)),$e.length||$e.push(_.div({class:te(["cms-dialog-body",E.bodyClass])})),_.div({class:te(["cms-dialog-shell","cms-popover-shell",ye(!!ae,"has-head"),ye(He.length>0,"has-footer"),ye(E.divider!==!1,"with-divider")])},...$e)},f=E=>{var K;if(!(E!=null&&E.panel))return;const m=X(),N=de(m),I=_e(m);W(E.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",I?`cms-dialog-${I}`:"",N,N?`cms-state-${N}`:"",o(m.scrollable)?"scrollable":"",o(m.stickyHeader)?"sticky-head":"",o(m.stickyActions)?"sticky-actions":"",o(m.borderless)?"borderless":"",...le(m.class),...le(m.panelClass)]),W(E.overlay,"_popoverOverlayClassTokens",[...le(m.overlayClass)]),E.panel.dataset.placement=me(m),se(E.panel,"--cms-dialog-width",o(m.width),yt),se(E.panel,"--cms-dialog-min-width",o(m.minWidth),yt),se(E.panel,"--cms-dialog-max-width",o(m.maxWidth),yt),se(E.panel,"--cms-dialog-max-height",o(m.maxHeight),yt),se(E.panel,"--cms-dialog-body-max-height",o((K=m.bodyMaxHeight)!=null?K:m.contentMaxHeight),yt),m.style&&Object.assign(E.panel.style,m.style),Nt(E.panel,m),E.panel.setAttribute("role",m.role||"dialog"),E.panel.setAttribute("aria-modal",m.modal===!0?"true":"false"),m.ariaLabel?E.panel.setAttribute("aria-label",m.ariaLabel):E.panel.removeAttribute("aria-label")},h=()=>{d!=null&&d.panel&&d.panel.replaceChildren(p())},B=()=>{if(H(),!d)return;const E=d;d=null,ks(E,()=>JSswift.overlay.close(E.id))},ie=(E={})=>(E&&typeof E=="object"&&(w={...w,...E}),d&&(f(d),h()),ve),a=(E=null,m=null)=>{var $e,Ee,De,Ie,qe,Be,z,Pe;H();const{anchorEl:N,nextProps:I}=F(E,m);I&&(w={...w,...I});const K=X(),ke=oe(N);if(!ke||o(K.disabled))return null;if(d&&d._anchorEl===ke)return f(d),h(),d;d&&B(),b=document.activeElement;const Oe=Se((Ee=($e=K.trigger)!=null?$e:K.triggers)!=null?Ee:v(K,"open")?"manual":null),Te=Oe.has("hover"),U=Oe.has("focus");let j=null;if(d=JSswift.overlay.open(()=>p(),{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 M,k,S;(M=j==null?void 0:j._popoverCleanup)==null||M.call(j),(S=(k=X()).onClose)==null||S.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=M=>{const k=M.target;if(!(!k||!k.closest)){if(k.closest("[data-popover-close]")||k.closest("[data-dialog-close]")){B();return}X().closeOnSelect===!0&&k.closest("[data-popover-select]")&&B()}};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 M,k,S,u,A;(M=ne.panel)==null||M.removeEventListener("click",ae),(k=ne.panel)==null||k.removeEventListener("mouseenter",Ve),(S=ne.panel)==null||S.removeEventListener("mouseleave",He),(u=ne.panel)==null||u.removeEventListener("focusin",Ve),(A=ne.panel)==null||A.removeEventListener("focusout",He)},f(ne),_s(ne),(Pe=(z=X()).onOpen)==null||Pe.call(z,ne),ne},x=(E,m=null)=>{clearTimeout(C),C=null,clearTimeout(O),O=setTimeout(()=>a(E,m),ce())},g=(E=!1)=>{if(clearTimeout(O),O=null,!!d){if(clearTimeout(C),E){B();return}C=setTimeout(()=>B(),$())}},P=(E=null,m=null)=>q()?(B(),null):a(E,m),q=()=>!!d,ve={open:a,close:B,show:x,hide:g,toggle:P,update:ie,bind:E=>{var j,ne;if(!E)return()=>{};r=E;const m=X(),N=Se((ne=(j=m.trigger)!=null?j:m.triggers)!=null?ne:v(m,"open")?"manual":null),I=N.has("hover"),K=N.has("focus"),ke=N.has("click"),Oe=N.has("manual")||!I&&!K&&!ke,Te=[],U=()=>{H(),Te.forEach(Ve=>Ve()),r===E&&(r=null)};if(v(m,"open"))return Ye(m.open)?JSswift.reactive.effect(()=>{r&&(o(X().open)?a(r):g(!0))},"UI.Popover:open"):m.open===!0?a(E):m.open===!1&&g(!0),U;if(Oe||o(m.disabled))return U;if(I){const Ve=()=>x(E),He=()=>g();E.addEventListener("mouseenter",Ve),E.addEventListener("mouseleave",He),Te.push(()=>{E.removeEventListener("mouseenter",Ve),E.removeEventListener("mouseleave",He)})}if(K){const Ve=()=>x(E),He=()=>g();E.addEventListener("focus",Ve),E.addEventListener("blur",He),Te.push(()=>{E.removeEventListener("focus",Ve),E.removeEventListener("blur",He)})}if(ke){const Ve=He=>{var ae,$e;($e=(ae=X()).onTriggerClick)==null||$e.call(ae,He),!He.defaultPrevented&&P(E)};E.addEventListener("click",Ve),Te.push(()=>E.removeEventListener("click",Ve))}return U},isOpen:q,entry:()=>d,props:()=>({...w})};return ve},Ne.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},i=null,c=null,w=null;const d=h=>h&&typeof h=="object"&&!h.nodeType&&!Array.isArray(h)&&!(h instanceof Function),r=h=>!!h&&typeof h=="object"&&(h.nodeType===1||typeof h.getBoundingClientRect=="function"),b=h=>!!h&&typeof h=="object"&&("clientX"in h||"type"in h||"target"in h||"currentTarget"in h),O=h=>!!h&&Number.isFinite(Number(h.x))&&Number.isFinite(Number(h.y)),C=()=>s,v=(h,B)=>{const ie=Number(h),a=Number(B);return!Number.isFinite(ie)||!Number.isFinite(a)?null:{x:ie,y:a}},T=h=>h?{_cmsContextPoint:h,getBoundingClientRect:()=>({top:h.y,bottom:h.y,left:h.x,right:h.x,width:0,height:0})}:null,le=h=>{if(!r(h))return null;const B=h.getBoundingClientRect();return v(B.left+Math.min(B.width/2,24),B.top+Math.min(B.height/2,24))},Z=h=>{var B,ie,a,x;return o((x=(a=(ie=(B=h==null?void 0:h.anchorEl)!=null?B:h==null?void 0:h.triggerEl)!=null?ie:h==null?void 0:h.target)!=null?a:h==null?void 0:h.anchor)!=null?x:null)},he=(h,B=null)=>{if(!h)return le(B||w);const ie=v(h.clientX,h.clientY);if(ie)return ie;const a=Z({anchorEl:B||h.currentTarget||h.target||w});return le(a)},H=(h={})=>{if(!d(h))return{};const B={...h};return delete B.event,delete B.point,delete B.x,delete B.y,B},W=()=>{var B,ie,a;const h=C();return{...h,trigger:"manual",placement:h.placement||"bottom-start",offsetX:(B=h.offsetX)!=null?B:0,offsetY:(a=(ie=h.offsetY)!=null?ie:h.offset)!=null?a:4,closeOnOutside:h.closeOnOutside!==!1,closeOnEsc:h.closeOnEsc!==!1,role:h.role||"menu",ariaLabel:h.ariaLabel||h.title||"Context menu",class:te(["cms-context-menu-shell",h.class]),panelClass:te(["cms-context-menu-panel",h.panelClass])}},se=Ne.Menu(W(),...n),X=(h=null,B=null,ie=null)=>{let a=null,x=null,g=null;if(b(h))a=he(h,w),g=d(B)?H(B):null;else if(typeof h=="number"||typeof B=="number")a=v(h,B),g=d(ie)?H(ie):null;else if(O(h))a=v(h.x,h.y),g=d(B)?H(B):null;else if(r(h))x=h,g=d(B)?H(B):null;else if(d(h)){const P=O(h.point)?h.point:O(h)?h:null,q=Z(h),Q=h.event;a=P?v(P.x,P.y):he(Q,q||w),x=q&&r(q)?q:null,g={...H(h),...d(B)?H(B):{}}}else i&&(a={...i});return{point:a,anchor:x,nextProps:g}},de=(h,B=null)=>{c=h||c,i=B||h&&h._cmsContextPoint||i},_e=(h=null)=>{d(h)&&Object.keys(h).length&&(s={...s,...h})},be=(h=null,B=null)=>{if(B)return T(B);if(h&&r(h))return h;const ie=Z(C());return r(ie)?ie:i?T(i):r(c)?c:r(w)?w:null},me=(h=null,B=null,ie=null)=>{const{point:a,anchor:x,nextProps:g}=X(h,B,ie);_e(g);const P=be(x,a);return P?(de(P,a),se.open(P,W())):null},fe=(h,B,ie=null)=>me(h,B,ie),ce=(h,B=null)=>me(h,B),$=()=>(se.close(),f),re=(h=!0)=>(h===!1?se.hide(!1):se.close(),f),oe=(h=null,B=null,ie=null)=>me(h,B,ie),Se=(h=null,B=null,ie=null)=>se.isOpen()?($(),null):me(h,B,ie),F=(h={})=>(_e(H(h)),se.update(W()),f),f={open:me,openAt:fe,openFromEvent:ce,show:oe,hide:re,close:$,toggle:Se,update:F,bind:(h,B=null)=>{if(!h)return()=>{};const ie=d(B)?H(B):null,a=g=>{var q,Q;w=h,g.preventDefault(),!(((Q=(q=C()).onTrigger)==null?void 0:Q.call(q,g,{element:h,open:me,close:$,update:F}))===!1||o(C().disabled))&&me({event:g,anchorEl:h},ie)},x=g=>{var q,Q;g.key!=="ContextMenu"&&!(g.shiftKey&&g.key==="F10")||(w=h,g.preventDefault(),((Q=(q=C()).onTrigger)==null?void 0:Q.call(q,g,{element:h,open:me,close:$,update:F}))===!1||o(C().disabled))||me({event:g,anchorEl:h},ie)};return h.addEventListener("contextmenu",a),h.addEventListener("keydown",x),()=>{h.removeEventListener("contextmenu",a),h.removeEventListener("keydown",x)}},isOpen:se.isOpen,entry:se.entry,props:()=>({...s})};return f}})(JSswift);
|
|
34
|
+
`,document.head.appendChild(S),fn._textNode=n,fn._spinner=e,fn._progressWrap=s,fn._progressBar=i,fn._progressActive=!1,fn}function ri(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 ai(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=li(),s=ri(t,e);Bs++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",ai(n,"spinner"),s.spinner===!1&&(n._spinner.style.display="none"),n.style.display="flex"},bt.loading.hide=function(){fn&&(Bs=Math.max(0,Bs-1),Bs===0&&(fn.style.display="none",fn._progressActive=!1))},bt.loading.progress=function(t=0,e={}){var c;const n=li();typeof t=="object"&&t!==null&&(e=t,t=(c=t.value)!=null?c:0);const s=ri(null,e);n._progressActive||(Bs++,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+"%",ai(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 el(t){return typeof t=="function"?t():t||[]}function Fo(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 tl(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 nl(t){const e=el(t);return Array.isArray(e)?e:[]}function ci(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 Do(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 ui(t,e){return t.find((n,s)=>Do(n,s)===e||(n==null?void 0:n.key)===e)||null}function So(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"?Fo(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function Co(t,e){return typeof t=="function"?t(e)||{}:t||{}}function xo(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(xo).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 sl(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 ol(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 M;return(M=b==null?void 0:b.searchKey)!=null?M:b==null?void 0:b.key}).filter(Boolean),u=[];if(S.length)for(const b of S)if(typeof b=="function")u.push(xo(b(t)));else{const M=e.find(N=>(N==null?void 0:N.key)===b||(N==null?void 0:N.searchKey)===b);u.push(xo(M?So(M,t,-1):Fo(t,b)))}else u.push(xo(t));const a=u.join(" ").toLowerCase();return c.every(b=>a.includes(b))}Ae.Table=(...t)=>{var Ie,Ye,rt,Xe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Array.isArray(e.columns)?e.columns:[],c=sl(e.pageSizeOptions,[5,10,20,50]),S=Number((Ye=(Ie=e.pageSize)!=null?Ie:c[0])!=null?Ye:10)||10,u=Array.from(new Set([...c,S])).sort((We,w)=>We-w),a=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",M=an(e.searchModel||e.queryModel,"UI.Table:query"),[N,C]=bt.reactive.signal(Math.max(1,Number(e.page||1)||1)),[z,U]=bt.reactive.signal(S),[W,ge]=bt.reactive.signal(a),[B,ne]=bt.reactive.signal(String((Xe=M?M.get():(rt=e.search)!=null?rt:e.query)!=null?Xe:"")),he=We=>{const w=String(We!=null?We:"");ne(w),M&&M.set(w),C(1)},q=We=>{const w=Number(We)||S;U(w),C(1)},se=(We,w)=>{const ie=Do(We,w),$e=W();!$e||$e.key!==ie&&$e.key!==(We==null?void 0:We.key)?ge({key:ie,dir:"asc"}):$e.dir==="asc"?ge({key:ie,dir:"desc"}):ge(null),C(1)};let le=null,fe;M&&(fe=M.watch(We=>{const w=String(We!=null?We:"");ne(w),le&&le.value!==w&&(le.value=w),C(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","hideStatus","slots","body"]);be.class=Z(["cms-table-card",e.class,e.cardClass]),e.dense!=null&&(be.dense=e.dense);const re=_.div({class:"cms-table-shell"}),ue=T(s,"default",{},n);ue.length&&re.appendChild(_.div({class:"cms-table-lead"},...ue));const O=T(s,"toolbarStart",{},e.toolbarStart),Y=T(s,"toolbar",{},e.toolbar),oe=T(s,"toolbarEnd",{},e.toolbarEnd),we=_.div({class:"cms-table-toolbar"}),R=_.div({class:"cms-table-toolbar-main"}),h=_.div({class:"cms-table-toolbar-side"});O.forEach(We=>R.appendChild(We)),Y.forEach(We=>R.appendChild(We));const m=T(s,"search",{query:B(),getQuery:B,setQuery:he},null);if(m.length)m.forEach(We=>h.appendChild(We));else if(b){le=_.input({type:"search",class:"cms-input",placeholder:typeof e.searchable=="string"?e.searchable:e.searchPlaceholder||"Cerca nella tabella",value:String(B()||"")}),le.addEventListener("input",()=>he(le.value));const We=Ae.Btn({class:"cms-table-search-clear",outline:!0,onClick:()=>{le&&(le.value=""),he("")}},"Reset");h.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),le,We))}oe.forEach(We=>h.appendChild(We)),(R.childNodes.length||h.childNodes.length)&&(we.appendChild(R),we.appendChild(h),re.appendChild(we));const y=_.div({class:"cms-singularity cms-table-chip"},""),j=_.div({class:"cms-singularity cms-table-chip"},""),X=_.div({class:"cms-singularity cms-table-chip"},""),d=T(s,"status",{},e.status),k=_.div({class:"cms-table-status"},y,j,X,...d);e.hideStatus!==!0&&re.appendChild(k);const g=T(s,"caption",{},e.caption);g.length&&re.appendChild(_.div({class:"cms-table-caption"},...g));const P=_.thead(),K=_.tbody(),ee=!!e.actions||!!s.actions,Ce=Z(["cms-table",ye(e.dense,"dense"),ye(e.striped,"striped"),ye(e.hover!==!1,"hover"),ye(e.stickyHeader!==!1,"sticky-head"),e.tableClass]),E={...e.tableStyle||{}};e.minTableWidth!=null&&(E["--cms-table-min-width"]=gt(e.minTableWidth));const p=_.table({class:Ce,style:E},P,K),A=_.div({class:"cms-singularity cms-table-wrap"},p);re.appendChild(A);const L=_.div({class:"cms-singularity cms-table-chip"},""),ae=_.div({class:"cms-singularity cms-table-chip"},""),ke=Ae.Btn({outline:!0,onClick:()=>C(Math.max(1,N()-1))},"\u2039"),Te=Ae.Btn({outline:!0,onClick:()=>C(N()+1)},"\u203A"),ze=_.div({class:"cms-singularity cms-table-chip"},""),V=_.select({class:"cms-input cms-table-size-select"},...u.map(We=>xs({value:String(We)},String(We))));V.value=String(z()),V.addEventListener("change",()=>q(V.value));const H=T(s,"footer",{},e.footer),te=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},L,ae,_.label({class:"cms-table-size"},_.span("Righe"),V)),_.div({class:"cms-table-foot-extra"},...H,_.div({class:"cms-table-pager"},ke,ze,Te)));e.hideFooter!==!0&&re.appendChild(te);const De=()=>{if(P.innerHTML="",e.hideHeader)return;const We=_.tr();if(i.forEach((w,ie)=>{var Se,Oe;const $e={col:w,colIndex:ie,sort:W()},F={...Co(w==null?void 0:w.style,{...$e,header:!0}),...Co((Se=w==null?void 0:w.headerStyle)!=null?Se:w==null?void 0:w.thStyle,{...$e,header:!0})};(w==null?void 0:w.width)!=null&&(F.width=gt(w.width)),(w==null?void 0:w.minWidth)!=null&&(F.minWidth=gt(w.minWidth)),(w==null?void 0:w.maxWidth)!=null&&(F.maxWidth=gt(w.maxWidth)),w!=null&&w.align&&(F.textAlign=w.align);let f=T(w==null?void 0:w.slots,"header",$e,null);if(!f.length){const at=typeof(w==null?void 0:w.header)=="function"?w.header($e):(Oe=w==null?void 0:w.header)!=null?Oe:ci(w);f=T(s,"header",$e,at)}const r=W(),x=Do(w,ie),de=(w==null?void 0:w.sortable)!==!1&&((w==null?void 0:w.key)!=null||typeof(w==null?void 0:w.get)=="function"||typeof(w==null?void 0:w.compare)=="function"),Be=!!r&&(r.key===x||r.key===(w==null?void 0:w.key)),He=_.th({class:Z(["cms-table-head-cell",ye(w==null?void 0:w.nowrap,"is-nowrap"),ye(de,"cms-table-sortable"),ye(Be,"is-sorted"),w==null?void 0:w.headerClass]),style:F});de?He.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>se(w,ie)},_.span({class:"cms-table-head-label"},...f),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},Be?r.dir==="asc"?"\u2191":"\u2193":"\u2195"))):f.forEach(at=>He.appendChild(at)),We.appendChild(He)}),ee){const w=T(s,"actionsHeader",{},e.actionsLabel||"Azioni");We.appendChild(_.th({class:"cms-table-head-cell cms-table-head-actions",style:{textAlign:"right"}},...w))}P.appendChild(We)},je=(We,w)=>{const ie={columns:i,count:i.length},$e=T(s,We,ie,w),F=String(i.length+(ee?1:0));K.appendChild(_.tr(_.td({colSpan:F,class:"cms-table-state"},...$e)))},_e=bt.reactive.effect(()=>{const We=nl(e.rows),w=String(B()||"").trim(),ie=W(),$e=typeof e.loading=="function"?!!e.loading():!!e.loading,F=e.pagination!==!1;if(De(),K.innerHTML="",le&&le.value!==B()&&(le.value=B()),V.value!==String(z())&&(V.value=String(z())),$e){y.textContent="Caricamento in corso",j.style.display="none",X.style.display="none",L.textContent="Loading\u2026",ae.textContent="",ze.textContent="Pagina 1",ke.disabled=!0,Te.disabled=!0,je("loading",e.loadingText||"Loading...");return}let f=We.slice();const r=f.length;if(typeof e.filter=="function"&&(f=f.filter((nt,Ze)=>e.filter(nt,{row:nt,index:Ze,query:w,rows:We,columns:i}))),w&&(f=f.filter(nt=>ol(nt,i,w,e))),ie){const nt=ui(i,ie.key);nt&&f.sort((Ze,wt)=>{const Nt=So(nt,Ze,-1),Et=So(nt,wt,-1),Rt=typeof nt.compare=="function"?nt.compare(Nt,Et,Ze,wt):tl(Nt,Et);return ie.dir==="asc"?Rt:-Rt})}const x=f.length,de=Math.max(1,Number(z())||S),Be=F?Math.max(1,Math.ceil(x/de)):1,He=F?Math.min(N(),Be):1;He!==N()&&C(He);const Se=F?(He-1)*de:0,Oe=F?Se+de:x,at=f.slice(Se,Oe);if(y.textContent=x===r?`${x} righe`:`${x} di ${r} righe`,j.textContent=w?`Ricerca: ${w}`:"",j.style.display=w?"":"none",ie){const nt=ui(i,ie.key);X.textContent=nt?`Ordine: ${ci(nt)} ${ie.dir==="asc"?"\u2191":"\u2193"}`:"",X.style.display=nt?"":"none"}else X.style.display="none";if(L.textContent=x?`${Se+1}-${Math.min(Oe,x)} di ${x}`:"0 risultati",ae.textContent=x!==r?`Dataset totale ${r}`:`Page size ${de}`,ze.textContent=F?`Pagina ${He} / ${Be}`:"Tutte le righe",ke.disabled=!F||He<=1,Te.disabled=!F||He>=Be,V.disabled=!F,V.parentNode.style.display=F?"":"none",at.length===0){je("empty",e.emptyText||"Nessun dato");return}for(let nt=0;nt<at.length;nt++){const Ze=at[nt],wt=Se+nt,Nt={row:Ze,rowIndex:wt,pageIndex:nt},Et=typeof e.rowAttrs=="function"?e.rowAttrs(Ze,Nt)||{}:e.rowAttrs||{},Rt=typeof e.rowClass=="function"?e.rowClass(Ze,Nt):e.rowClass,Mt=!!(e.onRowClick||e.onRowDblClick),vt=_.tr({...Et,class:Z(["cms-table-row",Rt,Et.class,ye(Mt,"is-clickable")])});if(e.rowKey){const ft=typeof e.rowKey=="function"?e.rowKey(Ze,Nt):Fo(Ze,e.rowKey);ft!=null&&(vt.dataset.key=String(ft))}const Dt=ft=>{const Ht=ft==null?void 0:ft.target;return!!(Ht&&Ht.closest&&Ht.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(e.onRowClick&&vt.addEventListener("click",ft=>{Dt(ft)||e.onRowClick(Ze,Nt,ft)}),e.onRowDblClick&&vt.addEventListener("dblclick",ft=>{Dt(ft)||e.onRowDblClick(Ze,Nt,ft)}),i.forEach((ft,Ht)=>{var Zt,pn;const qt=So(ft,Ze,wt),Xt={...Nt,col:ft,colIndex:Ht,value:qt},Ot={...Co(ft==null?void 0:ft.style,Xt),...Co((Zt=ft==null?void 0:ft.cellStyle)!=null?Zt:ft==null?void 0:ft.tdStyle,Xt)};ft!=null&&ft.align&&(Ot.textAlign=ft.align),(ft==null?void 0:ft.width)!=null&&(Ot.width=gt(ft.width)),(ft==null?void 0:ft.minWidth)!=null&&(Ot.minWidth=gt(ft.minWidth)),(ft==null?void 0:ft.maxWidth)!=null&&(Ot.maxWidth=gt(ft.maxWidth));const Qt=typeof(ft==null?void 0:ft.cellClass)=="function"?ft.cellClass(Ze,Xt):(ft==null?void 0:ft.cellClass)||(ft==null?void 0:ft.class),cn=_.td({class:Z(["cms-table-cell",Qt,ye(ft==null?void 0:ft.nowrap,"is-nowrap")]),style:Ot});let un=T(ft==null?void 0:ft.slots,"cell",Xt,null);if(!un.length){const en=typeof(ft==null?void 0:ft.render)=="function"?ft.render(Ze,Xt):typeof(ft==null?void 0:ft.format)=="function"?ft.format(qt,Ze,Xt):qt,rn=en==null?(pn=ft==null?void 0:ft.emptyText)!=null?pn:"":en;un=T(s,"cell",Xt,rn)}un.length||(un=[""]),un.forEach(en=>cn.appendChild(en)),vt.appendChild(cn)}),ee){const ft={...Nt},Ht=typeof e.actions=="function"?e.actions(Ze,Nt):e.actions;let qt=T(s,"actions",ft,Ht);qt.length||(qt=T(null,"default",ft,Ht)),vt.appendChild(_.td({class:"cms-table-cell cms-table-cell-actions",style:{textAlign:"right"}},_.div({class:"cms-table-actions"},...qt)))}K.appendChild(vt)}},"UI.Table:render");be.body=re;const Me=Ae.Card(be);return JSswift._registerCleanup(Me,_e),fe&&JSswift._registerCleanup(Me,fe),Me},Ae.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},u=null,a=null,b=null,M=null,N=null;const C=(p,A)=>Object.prototype.hasOwnProperty.call(p||{},A),z=(p,A)=>typeof p=="function"?p(A):p,U=p=>String(p||"").split(/\s+/).filter(Boolean),W=p=>p&&typeof p=="object"&&!p.nodeType&&!Array.isArray(p)&&!(p instanceof Function),ge=p=>!!p&&typeof p=="object"&&(p.nodeType===1||typeof p.getBoundingClientRect=="function"),B=()=>{clearTimeout(M),clearTimeout(N),M=null,N=null},ne=(p,A,L)=>{if(!p)return;const ae=p[A]||[];ae.length&&p.classList.remove(...ae);const ke=(L||[]).filter(Boolean);ke.length&&p.classList.add(...ke),p[A]=ke},he=(p,A,L,ae=ke=>ke)=>{if(p){if(L==null||L===""){p.style.removeProperty(A);return}p.style.setProperty(A,ae(L))}},q=()=>S||{},se=p=>{var L;const A=String(o((L=p.state)!=null?L:p.color)||"").toLowerCase();return i.includes(A)?A:""},le=p=>{const A=String(o(p.size)||"").toLowerCase();return c.includes(A)?A:""},fe=p=>{var A,L;return String(o((L=(A=p.placement)!=null?A:p.position)!=null?L:"bottom-start"))},be=()=>{var L;const p=o((L=q().delay)!=null?L:q().showDelay),A=Number(p);return Number.isFinite(A)?Math.max(0,A):0},re=()=>{const p=o(q().hideDelay),A=Number(p);return Number.isFinite(A)?Math.max(0,A):80},ue=(p=null)=>{var L,ae,ke;if(p)return p;const A=q();return a||o((ke=(ae=(L=A.anchorEl)!=null?L:A.triggerEl)!=null?ae:A.target)!=null?ke:A.anchor)||null},O=p=>{if(p==null||p===!0)return new Set(["click"]);if(p===!1)return new Set(["manual"]);const A=Array.isArray(p)?p:String(p).split(/[\s,|/]+/),L=new Set;return A.forEach(ae=>{const ke=String(ae||"").trim().toLowerCase();ke&&(ke==="mouseenter"||ke==="mouseover"?L.add("hover"):ke==="blur"||ke==="focusin"?L.add("focus"):ke==="tap"?L.add("click"):L.add(ke))}),L.size?L:new Set(["manual"])},Y=(p,A)=>{var ke,Te,ze;let L=null,ae=null;if(ge(p))L=p,W(A)&&(ae=A);else if(W(p)){ae=p;const V=(ze=(Te=(ke=p.anchorEl)!=null?ke:p.triggerEl)!=null?Te:p.target)!=null?ze:p.anchor;ge(V)&&(L=V)}else p!=null&&(L=p);return{anchorEl:L,nextProps:ae}},oe=(p=u==null?void 0:u.panel)=>{var A;return Array.from(((A=p==null?void 0:p.querySelectorAll)==null?void 0:A.call(p,"[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(L=>L.offsetParent!==null&&L.getAttribute("aria-hidden")!=="true")},we=()=>{o(q().autoFocus)!==!1&&setTimeout(()=>{const p=oe();if(!p.length)return;(p.find(L=>L.classList.contains("is-active")||L.classList.contains("is-selected")||L.classList.contains("is-checked"))||p[0]).focus()},0)},R=(p,A,L="sm")=>{const ae=z(p,A);return ae==null?[]:typeof ae=="string"?[Ae.Icon({name:ae,size:L})]:Vs(ae,{...A,as:"icon"})},h=(p,A)=>{var de,Be,He,Se,Oe,at,nt,Ze,wt,Nt,Et,Rt,Mt;const L=z(p,A);if(L==null||L===!1)return[];if(Array.isArray(L))return L.flatMap((vt,Dt)=>h(vt,{...A,index:Dt}));if(typeof L=="function")return h(L(A),A);if(L!=null&&L.nodeType)return[L];if(typeof L=="string"||typeof L=="number")return h({label:L},A);if(!W(L))return Vs(L,{...A,as:"item"});const ae=String((Be=(de=L.type)!=null?de:L.kind)!=null?Be:"").toLowerCase();if(ae==="separator"||ae==="divider"||L.separator===!0||L.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ke=(He=L.items)!=null?He:L.children;if((ae==="group"||ae==="section"||Array.isArray(ke))&&ke!=null){const vt={...A,item:L},Dt=T(s,"groupLabel",vt,z((Se=L.label)!=null?Se:L.title,vt)),ft=h(ke,vt);return ft.length?[_.div({class:Z(["cms-menu-group",L.class])},Dt.length?_.div({class:"cms-menu-group-label"},...Dt):null,_.div({class:"cms-menu-group-items"},...ft))]:[]}const Te={...A,item:L,close:X,dismiss:X,open:k,toggle:K,update:d,isOpen:ee,entry:()=>u,anchorEl:ue(),props:q()},ze=!!o(L.disabled),V=L.checked==null?null:!!o(L.checked),H=!!o((Oe=L.active)!=null?Oe:L.selected),te=se(L),De=o(L.href),je=o(L.to),_e=C(L,"closeOnSelect")?!!o(L.closeOnSelect):L.keepOpen===!0?!1:q().closeOnSelect!==!1,Me=L.role||(V!=null?"menuitemcheckbox":"menuitem"),Ie=R(L.icon,Te),Ye=R((at=L.iconRight)!=null?at:L.endIcon,Te),rt=T(s,"itemTitle",Te,z((nt=L.title)!=null?nt:L.label,Te)),Xe=T(s,"itemSubtitle",Te,z((Ze=L.subtitle)!=null?Ze:L.description,Te)),We=T(s,"itemShortcut",Te,z(L.shortcut,Te)),w=T(s,"itemBadge",Te,z(L.badge,Te)),ie=T(s,"item",Te,z((Nt=(wt=L.content)!=null?wt:L.body)!=null?Nt:L.render,Te)),$e=[...w,...We,...V===!0&&!Ye.length&&!w.length?[_.span({class:"cms-menu-entry-check"},Ae.Icon({name:L.checkedIcon||"check",size:"sm"}))]:[],...Ye],f={class:Z(["cms-menu-entry","cms-menu-item",te?`cms-state-${te}`:"",ye(H,"is-active"),ye(V===!0,"is-checked"),ye(ze,"is-disabled"),L.class]),role:Me,tabIndex:ze?-1:(Et=L.tabIndex)!=null?Et:-1,"data-menu-item":!0,"data-menu-select":_e?"true":"false","data-menu-close":L.close===!0?"true":null,"data-menu-keep-open":_e?null:"true","aria-disabled":ze?"true":null,"aria-checked":V==null?null:String(V),title:(Mt=(Rt=L.titleAttr)!=null?Rt:L.tooltip)!=null?Mt:null,type:De?null:"button",href:De||null,target:L.target||null,rel:L.rel||(L.target==="_blank"?"noopener noreferrer":null),onClick:vt=>{var ft,Ht,qt,Xt;if(ze){vt.preventDefault(),vt.stopPropagation();return}(Ht=(ft=q()).onItemClick)==null||Ht.call(ft,L,Te,vt);const Dt=(qt=L.onClick)==null?void 0:qt.call(L,Te,vt);vt.defaultPrevented||(je&&((Xt=JSswift.router)!=null&&Xt.navigate)&&(vt.preventDefault(),JSswift.router.navigate(je)),Dt!==!1&&_e&&X())}};L.attrs&&typeof L.attrs=="object"&&Object.assign(f,L.attrs);const r=De?_.a:_.button,x=ie.length?ie:[rt.length?_.div({class:"cms-menu-entry-title"},...rt):null,Xe.length?_.div({class:"cms-menu-entry-subtitle"},...Xe):null].filter(Boolean);return[r(f,Ie.length?_.span({class:"cms-menu-entry-icon"},...Ie):null,_.span({class:"cms-menu-entry-main"},...x),$e.length?_.span({class:"cms-menu-entry-aside"},...$e):null)]},m=()=>{var rt,Xe,We,w,ie,$e,F;const p=q(),A={close:X,dismiss:X,open:k,toggle:K,update:d,isOpen:ee,entry:()=>u,anchorEl:ue(),props:p},L=R(p.icon,A,p.iconSize||"md"),ae=T(s,"eyebrow",A,z(p.eyebrow,A)),ke=T(s,"title",A,z((Xe=(rt=p.title)!=null?rt:p.heading)!=null?Xe:p.label,A)),Te=T(s,"subtitle",A,z((We=p.subtitle)!=null?We:p.description,A)),ze=T(s,"before",A,z(p.before,A)),V=T(s,"header",A,z(p.header,A)),H=T(s,"after",A,z(p.after,A)),te=T(s,"footer",A,z(p.footer,A)),De=T(s,"status",A,z(p.status,A));let je=(w=p.content)!=null?w:p.body;je==null&&n&&n.length&&(je=n);let _e=T(s,"content",A,z(je,A));_e.length||(_e=T(s,"body",A,z(je,A))),_e.length||(_e=T(s,"default",A,z(je,A)));const Me=h(($e=(ie=p.items)!=null?ie:p.actionsList)!=null?$e:p.entries,A),Ie=Me.length?[]:T(s,"empty",A,z((F=p.empty)!=null?F:p.emptyText,A));let Ye=null;return V.length?Ye=_.div({class:Z(["cms-menu-head","cms-menu-head-custom",p.headerClass])},...V):(L.length||ae.length||ke.length||Te.length)&&(Ye=_.div({class:Z(["cms-menu-head",p.headerClass])},L.length?_.div({class:"cms-menu-head-icon"},...L):null,_.div({class:"cms-menu-head-main"},ae.length?_.div({class:"cms-menu-eyebrow"},...ae):null,ke.length?_.div({class:"cms-menu-title"},...ke):null,Te.length?_.div({class:"cms-menu-subtitle"},...Te):null))),_.div({class:Z(["cms-menu","cms-menu-shell",ye(p.dense,"dense"),ye(Me.length>0,"has-items"),ye(te.length>0||De.length>0,"has-footer"),p.class]),style:p.style||{},role:p.role||"menu","aria-label":p.ariaLabel||null},ze.length?_.div({class:"cms-menu-before"},...ze):null,Ye,_e.length?_.div({class:Z(["cms-menu-content",p.contentClass])},..._e):null,Me.length?_.div({class:Z(["cms-menu-items",p.itemsClass])},...Me):null,!Me.length&&Ie.length?_.div({class:"cms-menu-empty"},...Ie):null,H.length?_.div({class:"cms-menu-after"},...H):null,De.length||te.length?_.div({class:Z(["cms-menu-footer",p.footerClass])},De.length?_.div({class:"cms-menu-status"},...De):null,te.length?_.div({class:"cms-menu-footer-actions"},...te):null):null)},y=p=>{var ke;if(!(p!=null&&p.panel))return;const A=q(),L=se(A),ae=le(A);ne(p.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",ae?`cms-menu-${ae}`:"",L?`cms-state-${L}`:"",o(A.outline)?"outline":"",...U(A.panelClass)]),ne(p.overlay,"_menuOverlayClassTokens",[...U(A.overlayClass)]),p.panel.dataset.placement=fe(A),he(p.panel,"--cms-menu-width",o(A.width),gt),he(p.panel,"--cms-menu-min-width",o(A.minWidth),gt),he(p.panel,"--cms-menu-max-width",o(A.maxWidth),gt),he(p.panel,"--cms-menu-max-height",o(A.maxHeight),gt),he(p.panel,"--cms-menu-body-max-height",o((ke=A.bodyMaxHeight)!=null?ke:A.contentMaxHeight),gt),A.panelStyle&&Object.assign(p.panel.style,A.panelStyle),At(p.panel,A)},j=()=>{u!=null&&u.panel&&u.panel.replaceChildren(m())},X=()=>{if(B(),!u)return;const p=u;u=null,ks(p,()=>JSswift.overlay.close(p.id))},d=(p={})=>{var A,L,ae,ke;if(p&&typeof p=="object"&&(S={...S,...p}),u){const Te=q();y(u),j(),(ke=u.reposition)==null||ke.call(u,{anchorEl:u._anchorEl,placement:fe(Te),offsetX:(A=Te.offsetX)!=null?A:0,offsetY:(ae=(L=Te.offsetY)!=null?L:Te.offset)!=null?ae:8}),we()}return E},k=(p=null,A=null)=>{var Ye,rt,Xe,We,w,ie,$e,F,f,r,x,de,Be,He,Se,Oe;B();const{anchorEl:L,nextProps:ae}=Y(p,A);ae&&(S={...S,...ae});const ke=q(),Te=ue(L);if(!Te||o(ke.disabled))return null;if(u&&u._anchorEl===Te){const at=q();return y(u),j(),(We=u.reposition)==null||We.call(u,{anchorEl:u._anchorEl,placement:fe(at),offsetX:(Ye=at.offsetX)!=null?Ye:0,offsetY:(Xe=(rt=at.offsetY)!=null?rt:at.offset)!=null?Xe:8}),we(),u}u&&X(),b=document.activeElement;let ze=null;if(u=JSswift.overlay.open(()=>m(),{type:"menu",anchorEl:Te,placement:fe(ke),offsetX:(w=ke.offsetX)!=null?w:0,offsetY:($e=(ie=ke.offsetY)!=null?ie:ke.offset)!=null?$e:8,backdrop:ke.backdrop===!0,lockScroll:ke.lockScroll===!0,trapFocus:ke.trapFocus===!0,autoFocus:!1,closeOnOutside:ke.closeOnOutside!==!1,closeOnBackdrop:(F=ke.closeOnBackdrop)!=null?F:ke.backdrop===!0,closeOnEsc:ke.closeOnEsc!==!1,className:Kt(["cms-menu-panel"]),onClose:()=>{var at,nt,Ze;(at=ze==null?void 0:ze._menuCleanup)==null||at.call(ze),(Ze=(nt=q()).onClose)==null||Ze.call(nt,ze),q().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const V=u;ze=V,V._anchorEl=Te;const H=()=>{clearTimeout(N),N=null},te=()=>{P()},De=at=>{const nt=at.target;if(!nt||!nt.closest)return;if(nt.closest("[data-menu-close]")){X();return}if(q().closeOnSelect===!1)return;const Ze=nt.closest("[data-menu-item], [data-menu-select], .cms-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");Ze&&(Ze.closest("[data-menu-keep-open]")||Ze.getAttribute("data-menu-select")!=="false"&&X())},je=at=>{if(at.key==="Escape"){at.preventDefault(),X();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(at.key))return;const nt=oe(V.panel);if(!nt.length)return;at.preventDefault();const Ze=nt.indexOf(document.activeElement);if(at.key==="Home"){nt[0].focus();return}if(at.key==="End"){nt[nt.length-1].focus();return}const wt=at.key==="ArrowDown"?1:-1,Nt=Ze<0?wt>0?0:nt.length-1:(Ze+wt+nt.length)%nt.length;nt[Nt].focus()};V.panel.addEventListener("click",De),V.panel.addEventListener("keydown",je);const _e=O((r=(f=ke.trigger)!=null?f:ke.triggers)!=null?r:C(ke,"open")?"manual":null),Me=_e.has("hover"),Ie=_e.has("focus");return(Me||Ie)&&(V.panel.addEventListener("mouseenter",H),V.panel.addEventListener("mouseleave",te),V.panel.addEventListener("focusin",H),V.panel.addEventListener("focusout",te)),V._menuCleanup=()=>{var at,nt,Ze,wt,Nt,Et;(at=V.panel)==null||at.removeEventListener("click",De),(nt=V.panel)==null||nt.removeEventListener("keydown",je),(Ze=V.panel)==null||Ze.removeEventListener("mouseenter",H),(wt=V.panel)==null||wt.removeEventListener("mouseleave",te),(Nt=V.panel)==null||Nt.removeEventListener("focusin",H),(Et=V.panel)==null||Et.removeEventListener("focusout",te)},y(V),(He=V.reposition)==null||He.call(V,{anchorEl:Te,placement:fe(ke),offsetX:(x=ke.offsetX)!=null?x:0,offsetY:(Be=(de=ke.offsetY)!=null?de:ke.offset)!=null?Be:8}),_s(V),(Oe=(Se=q()).onOpen)==null||Oe.call(Se,V),we(),V},g=(p,A=null)=>{clearTimeout(N),N=null,clearTimeout(M),M=setTimeout(()=>k(p,A),be())},P=(p=!1)=>{if(clearTimeout(M),M=null,!!u){if(clearTimeout(N),p){X();return}N=setTimeout(()=>X(),re())}},K=(p=null,A=null)=>ee()?(X(),null):k(p,A),ee=()=>!!u,E={open:k,close:X,show:g,hide:P,toggle:K,update:d,bind:p=>{var te,De;if(!p)return()=>{};a=p;const A=q(),L=O((De=(te=A.trigger)!=null?te:A.triggers)!=null?De:C(A,"open")?"manual":null),ae=L.has("hover"),ke=L.has("focus"),Te=L.has("click"),ze=L.has("manual")||!ae&&!ke&&!Te,V=[],H=()=>{B(),V.forEach(je=>je()),a===p&&(a=null)};if(C(A,"open"))return Ke(A.open)?JSswift.reactive.effect(()=>{a&&(o(q().open)?k(a):P(!0))},"UI.Menu:open"):A.open===!0?k(p):A.open===!1&&P(!0),H;if(ze||o(A.disabled))return H;if(ae){const je=()=>g(p),_e=()=>P();p.addEventListener("mouseenter",je),p.addEventListener("mouseleave",_e),V.push(()=>{p.removeEventListener("mouseenter",je),p.removeEventListener("mouseleave",_e)})}if(ke){const je=()=>g(p),_e=()=>P();p.addEventListener("focus",je),p.addEventListener("blur",_e),V.push(()=>{p.removeEventListener("focus",je),p.removeEventListener("blur",_e)})}if(Te){const je=_e=>{var Me,Ie;(Ie=(Me=q()).onTriggerClick)==null||Ie.call(Me,_e),!_e.defaultPrevented&&K(p)};p.addEventListener("click",je),V.push(()=>p.removeEventListener("click",je))}return H},isOpen:ee,entry:()=>u,props:()=>({...S})};return E},Ae.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},u=null,a=null,b=null,M=null,N=null;const C=(E,p)=>Object.prototype.hasOwnProperty.call(E||{},p),z=(E,p)=>typeof E=="function"?E(p):E,U=E=>String(E||"").split(/\s+/).filter(Boolean),W=E=>E&&typeof E=="object"&&!E.nodeType&&!Array.isArray(E)&&!(E instanceof Function),ge=E=>!!E&&typeof E=="object"&&(E.nodeType===1||typeof E.getBoundingClientRect=="function"),B=()=>{clearTimeout(M),clearTimeout(N),M=null,N=null},ne=(E,p,A)=>{if(!E)return;const L=E[p]||[];L.length&&E.classList.remove(...L);const ae=(A||[]).filter(Boolean);ae.length&&E.classList.add(...ae),E[p]=ae},he=(E,p,A,L=ae=>ae)=>{if(E){if(A==null||A===""){E.style.removeProperty(p);return}E.style.setProperty(p,L(A))}},q=()=>S,se=E=>{var A;const p=o((A=E.state)!=null?A:E.color);return p?i.includes(p)?p:String(p):""},le=E=>{const p=o(E.size);return typeof p=="string"&&c.includes(p)?p:""},fe=E=>{var A,L,ae;const p=String(o((ae=(L=(A=E.actionsAlign)!=null?A:E.footerAlign)!=null?L:E.alignActions)!=null?ae:"end")).toLowerCase();return["start","left"].includes(p)?"start":["center","middle"].includes(p)?"center":["between","space-between"].includes(p)?"between":["stretch","full"].includes(p)?"stretch":"end"},be=E=>{var p,A;return String(o((A=(p=E.placement)!=null?p:E.position)!=null?A:"bottom-start"))},re=(E,p)=>{const A=o(E);if(A==null||A==="")return p;const L=Number(A);return Number.isFinite(L)?L:p},ue=()=>re(q().delay,0),O=()=>re(q().hideDelay,120),Y=E=>{var A,L;return((L=(A=E.closable)!=null?A:E.dismissible)!=null?L:E.closeButton)===!0},oe=(E=null)=>{var A,L,ae;if(E)return E;const p=q();return a||o((ae=(L=(A=p.anchorEl)!=null?A:p.triggerEl)!=null?L:p.target)!=null?ae:p.anchor)||null},we=E=>{if(E==null||E===!0)return new Set(["click"]);if(E===!1)return new Set(["manual"]);const p=Array.isArray(E)?E:String(E).split(/[\s,|/]+/),A=new Set;return p.forEach(L=>{const ae=String(L||"").trim().toLowerCase();ae&&(ae==="mouseenter"||ae==="mouseover"?A.add("hover"):ae==="blur"||ae==="focusin"?A.add("focus"):ae==="tap"?A.add("click"):A.add(ae))}),A.size?A:new Set(["manual"])},R=(E,p)=>{var ae,ke,Te;let A=null,L=null;if(ge(E))A=E,W(p)&&(L=p);else if(W(E)){L=E;const ze=(Te=(ke=(ae=E.anchorEl)!=null?ae:E.triggerEl)!=null?ke:E.target)!=null?Te:E.anchor;ge(ze)&&(A=ze)}else E!=null&&(A=E);return{anchorEl:A,nextProps:L}},h=()=>{var Ie,Ye,rt,Xe,We,w,ie,$e,F;const E=q(),p={close:j,dismiss:j,open:d,toggle:P,update:X,isOpen:K,entry:()=>u,anchorEl:oe(),props:E},A=E.icon!=null?typeof E.icon=="string"?Ae.Icon({name:E.icon,size:E.iconSize||"md"}):JSswift.ui.slot(E.icon,{as:"icon"}):null,L=T(s,"eyebrow",p,z(E.eyebrow,p)),ae=T(s,"title",p,z((Ye=(Ie=E.title)!=null?Ie:E.heading)!=null?Ye:E.label,p)),ke=T(s,"subtitle",p,z((rt=E.subtitle)!=null?rt:E.description,p)),Te=T(s,"icon",p,A),ze=T(s,"header",p,z((We=(Xe=E.headerContent)!=null?Xe:E.head)!=null?We:E.header,p)),V=Y(E)?T(s,"close",p,Ae.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":E.closeLabel||"Chiudi popover","data-popover-close":!0},Ae.Icon({name:E.closeIcon||"close",size:"sm"}))):[];let H=($e=(ie=(w=E.content)!=null?w:E.body)!=null?ie:E.message)!=null?$e:E.text;H==null&&n&&n.length&&(H=n);let te=T(s,"content",p,z(H,p));te.length||(te=T(s,"body",p,z(H,p))),te.length||(te=T(s,"default",p,z(H,p)));const De=z((F=E.footer)!=null?F:E.actions,p);let je=T(s,"footer",p,De);je.length||(je=T(s,"actions",p,De));let _e=null;ze.length?_e=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...ze):(L.length||ae.length||ke.length||Te.length||V.length)&&(_e=_.div({class:"cms-dialog-head"},Te.length?_.div({class:"cms-dialog-icon"},...Te):null,_.div({class:"cms-dialog-head-main"},L.length?_.div({class:"cms-dialog-eyebrow"},...L):null,ae.length?_.div({class:"cms-dialog-title"},...ae):null,ke.length?_.div({class:"cms-dialog-subtitle"},...ke):null),V.length?_.div({class:"cms-dialog-close-wrap"},...V):null));const Me=[];return _e&&Me.push(_e),te.length&&Me.push(_.div({class:Z(["cms-dialog-body",E.bodyClass])},...te)),je.length&&Me.push(_.div({class:Z(["cms-dialog-actions",`is-${fe(E)}`,ye(E.stackActions,"is-stacked"),E.actionsClass,E.footerClass])},...je)),Me.length||Me.push(_.div({class:Z(["cms-dialog-body",E.bodyClass])})),_.div({class:Z(["cms-dialog-shell","cms-popover-shell",ye(!!_e,"has-head"),ye(je.length>0,"has-footer"),ye(E.divider!==!1,"with-divider")])},...Me)},m=E=>{var ae;if(!(E!=null&&E.panel))return;const p=q(),A=se(p),L=le(p);ne(E.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",L?`cms-dialog-${L}`:"",A,A?`cms-state-${A}`:"",o(p.scrollable)?"scrollable":"",o(p.stickyHeader)?"sticky-head":"",o(p.stickyActions)?"sticky-actions":"",o(p.borderless)?"borderless":"",...U(p.class),...U(p.panelClass)]),ne(E.overlay,"_popoverOverlayClassTokens",[...U(p.overlayClass)]),E.panel.dataset.placement=be(p),he(E.panel,"--cms-dialog-width",o(p.width),gt),he(E.panel,"--cms-dialog-min-width",o(p.minWidth),gt),he(E.panel,"--cms-dialog-max-width",o(p.maxWidth),gt),he(E.panel,"--cms-dialog-max-height",o(p.maxHeight),gt),he(E.panel,"--cms-dialog-body-max-height",o((ae=p.bodyMaxHeight)!=null?ae:p.contentMaxHeight),gt),p.style&&Object.assign(E.panel.style,p.style),At(E.panel,p),E.panel.setAttribute("role",p.role||"dialog"),E.panel.setAttribute("aria-modal",p.modal===!0?"true":"false"),p.ariaLabel?E.panel.setAttribute("aria-label",p.ariaLabel):E.panel.removeAttribute("aria-label")},y=()=>{u!=null&&u.panel&&u.panel.replaceChildren(h())},j=()=>{if(B(),!u)return;const E=u;u=null,ks(E,()=>JSswift.overlay.close(E.id))},X=(E={})=>(E&&typeof E=="object"&&(S={...S,...E}),u&&(m(u),y()),Ce),d=(E=null,p=null)=>{var Me,Ie,Ye,rt,Xe,We,w,ie;B();const{anchorEl:A,nextProps:L}=R(E,p);L&&(S={...S,...L});const ae=q(),ke=oe(A);if(!ke||o(ae.disabled))return null;if(u&&u._anchorEl===ke)return m(u),y(),u;u&&j(),b=document.activeElement;const Te=we((Ie=(Me=ae.trigger)!=null?Me:ae.triggers)!=null?Ie:C(ae,"open")?"manual":null),ze=Te.has("hover"),V=Te.has("focus");let H=null;if(u=JSswift.overlay.open(()=>h(),{type:"popover",anchorEl:ke,placement:be(ae),offsetX:(Ye=ae.offsetX)!=null?Ye:0,offsetY:(Xe=(rt=ae.offsetY)!=null?rt:ae.offset)!=null?Xe:10,backdrop:ae.backdrop===!0,lockScroll:ae.lockScroll===!0,trapFocus:ae.trapFocus===!0,autoFocus:ae.autoFocus===!0,closeOnOutside:ae.closeOnOutside!==!1,closeOnBackdrop:(We=ae.closeOnBackdrop)!=null?We:ae.backdrop===!0,closeOnEsc:ae.closeOnEsc!==!1,className:Kt(["cms-dialog","cms-popover"]),onClose:()=>{var $e,F,f;($e=H==null?void 0:H._popoverCleanup)==null||$e.call(H),(f=(F=q()).onClose)==null||f.call(F,H),q().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const te=u;H=te,te._anchorEl=ke;const De=()=>{clearTimeout(N),N=null},je=()=>{!ze&&!V||g()},_e=$e=>{const F=$e.target;if(!(!F||!F.closest)){if(F.closest("[data-popover-close]")||F.closest("[data-dialog-close]")){j();return}q().closeOnSelect===!0&&F.closest("[data-popover-select]")&&j()}};return te.panel.addEventListener("click",_e),(ze||V)&&(te.panel.addEventListener("mouseenter",De),te.panel.addEventListener("mouseleave",je),te.panel.addEventListener("focusin",De),te.panel.addEventListener("focusout",je)),te._popoverCleanup=()=>{var $e,F,f,r,x;($e=te.panel)==null||$e.removeEventListener("click",_e),(F=te.panel)==null||F.removeEventListener("mouseenter",De),(f=te.panel)==null||f.removeEventListener("mouseleave",je),(r=te.panel)==null||r.removeEventListener("focusin",De),(x=te.panel)==null||x.removeEventListener("focusout",je)},m(te),_s(te),(ie=(w=q()).onOpen)==null||ie.call(w,te),te},k=(E,p=null)=>{clearTimeout(N),N=null,clearTimeout(M),M=setTimeout(()=>d(E,p),ue())},g=(E=!1)=>{if(clearTimeout(M),M=null,!!u){if(clearTimeout(N),E){j();return}N=setTimeout(()=>j(),O())}},P=(E=null,p=null)=>K()?(j(),null):d(E,p),K=()=>!!u,Ce={open:d,close:j,show:k,hide:g,toggle:P,update:X,bind:E=>{var H,te;if(!E)return()=>{};a=E;const p=q(),A=we((te=(H=p.trigger)!=null?H:p.triggers)!=null?te:C(p,"open")?"manual":null),L=A.has("hover"),ae=A.has("focus"),ke=A.has("click"),Te=A.has("manual")||!L&&!ae&&!ke,ze=[],V=()=>{B(),ze.forEach(De=>De()),a===E&&(a=null)};if(C(p,"open"))return Ke(p.open)?JSswift.reactive.effect(()=>{a&&(o(q().open)?d(a):g(!0))},"UI.Popover:open"):p.open===!0?d(E):p.open===!1&&g(!0),V;if(Te||o(p.disabled))return V;if(L){const De=()=>k(E),je=()=>g();E.addEventListener("mouseenter",De),E.addEventListener("mouseleave",je),ze.push(()=>{E.removeEventListener("mouseenter",De),E.removeEventListener("mouseleave",je)})}if(ae){const De=()=>k(E),je=()=>g();E.addEventListener("focus",De),E.addEventListener("blur",je),ze.push(()=>{E.removeEventListener("focus",De),E.removeEventListener("blur",je)})}if(ke){const De=je=>{var _e,Me;(Me=(_e=q()).onTriggerClick)==null||Me.call(_e,je),!je.defaultPrevented&&P(E)};E.addEventListener("click",De),ze.push(()=>E.removeEventListener("click",De))}return V},isOpen:K,entry:()=>u,props:()=>({...S})};return Ce},Ae.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},i=null,c=null,S=null;const u=y=>y&&typeof y=="object"&&!y.nodeType&&!Array.isArray(y)&&!(y instanceof Function),a=y=>!!y&&typeof y=="object"&&(y.nodeType===1||typeof y.getBoundingClientRect=="function"),b=y=>!!y&&typeof y=="object"&&("clientX"in y||"type"in y||"target"in y||"currentTarget"in y),M=y=>!!y&&Number.isFinite(Number(y.x))&&Number.isFinite(Number(y.y)),N=()=>s,C=(y,j)=>{const X=Number(y),d=Number(j);return!Number.isFinite(X)||!Number.isFinite(d)?null:{x:X,y:d}},z=y=>y?{_cmsContextPoint:y,getBoundingClientRect:()=>({top:y.y,bottom:y.y,left:y.x,right:y.x,width:0,height:0})}:null,U=y=>{if(!a(y))return null;const j=y.getBoundingClientRect();return C(j.left+Math.min(j.width/2,24),j.top+Math.min(j.height/2,24))},W=y=>{var j,X,d,k;return o((k=(d=(X=(j=y==null?void 0:y.anchorEl)!=null?j:y==null?void 0:y.triggerEl)!=null?X:y==null?void 0:y.target)!=null?d:y==null?void 0:y.anchor)!=null?k:null)},ge=(y,j=null)=>{if(!y)return U(j||S);const X=C(y.clientX,y.clientY);if(X)return X;const d=W({anchorEl:j||y.currentTarget||y.target||S});return U(d)},B=(y={})=>{if(!u(y))return{};const j={...y};return delete j.event,delete j.point,delete j.x,delete j.y,j},ne=()=>{var j,X,d;const y=N();return{...y,trigger:"manual",placement:y.placement||"bottom-start",offsetX:(j=y.offsetX)!=null?j:0,offsetY:(d=(X=y.offsetY)!=null?X:y.offset)!=null?d:4,closeOnOutside:y.closeOnOutside!==!1,closeOnEsc:y.closeOnEsc!==!1,role:y.role||"menu",ariaLabel:y.ariaLabel||y.title||"Context menu",class:Z(["cms-context-menu-shell",y.class]),panelClass:Z(["cms-context-menu-panel",y.panelClass])}},he=Ae.Menu(ne(),...n),q=(y=null,j=null,X=null)=>{let d=null,k=null,g=null;if(b(y))d=ge(y,S),g=u(j)?B(j):null;else if(typeof y=="number"||typeof j=="number")d=C(y,j),g=u(X)?B(X):null;else if(M(y))d=C(y.x,y.y),g=u(j)?B(j):null;else if(a(y))k=y,g=u(j)?B(j):null;else if(u(y)){const P=M(y.point)?y.point:M(y)?y:null,K=W(y),ee=y.event;d=P?C(P.x,P.y):ge(ee,K||S),k=K&&a(K)?K:null,g={...B(y),...u(j)?B(j):{}}}else i&&(d={...i});return{point:d,anchor:k,nextProps:g}},se=(y,j=null)=>{c=y||c,i=j||y&&y._cmsContextPoint||i},le=(y=null)=>{u(y)&&Object.keys(y).length&&(s={...s,...y})},fe=(y=null,j=null)=>{if(j)return z(j);if(y&&a(y))return y;const X=W(N());return a(X)?X:i?z(i):a(c)?c:a(S)?S:null},be=(y=null,j=null,X=null)=>{const{point:d,anchor:k,nextProps:g}=q(y,j,X);le(g);const P=fe(k,d);return P?(se(P,d),he.open(P,ne())):null},re=(y,j,X=null)=>be(y,j,X),ue=(y,j=null)=>be(y,j),O=()=>(he.close(),m),Y=(y=!0)=>(y===!1?he.hide(!1):he.close(),m),oe=(y=null,j=null,X=null)=>be(y,j,X),we=(y=null,j=null,X=null)=>he.isOpen()?(O(),null):be(y,j,X),R=(y={})=>(le(B(y)),he.update(ne()),m),m={open:be,openAt:re,openFromEvent:ue,show:oe,hide:Y,close:O,toggle:we,update:R,bind:(y,j=null)=>{if(!y)return()=>{};const X=u(j)?B(j):null,d=g=>{var K,ee;S=y,g.preventDefault(),!(((ee=(K=N()).onTrigger)==null?void 0:ee.call(K,g,{element:y,open:be,close:O,update:R}))===!1||o(N().disabled))&&be({event:g,anchorEl:y},X)},k=g=>{var K,ee;g.key!=="ContextMenu"&&!(g.shiftKey&&g.key==="F10")||(S=y,g.preventDefault(),((ee=(K=N()).onTrigger)==null?void 0:ee.call(K,g,{element:y,open:be,close:O,update:R}))===!1||o(N().disabled))||be({event:g,anchorEl:y},X)};return y.addEventListener("contextmenu",d),y.addEventListener("keydown",k),()=>{y.removeEventListener("contextmenu",d),y.removeEventListener("keydown",k)}},isOpen:he.isOpen,entry:he.entry,props:()=>({...s})};return m}})(JSswift);
|