@jsswift/ui 1.0.45 → 1.0.47

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/min-ui.js CHANGED
@@ -1,4 +1,4 @@
1
- (function(je){var Io,zo,To,Po,Eo,Mo,Ro,Jo,Oo,Do,Ho,jo,Vo,$o,Bo,Uo,Wo,Go,Ko,qo,Yo,Xo,Qo,Zo,ei,ti,ni,si,oi,ii,li,ri,ai,ci,di,ui,fi,mi,gi,pi,hi,bi,yi,wi,vi,Si,Ci,xi,Ni,Ai,ki,Fi,_i,Li,Ii,zi,Ti,Pi,Ei,Mi;je.ui=je.ui||{},je.services=je.services||{},je.services.notify=je.services.notify||{};const ns=Symbol("cms.ui.rodPathRaw"),On=Symbol("cms.ui.rodPathEnhanced"),Ls=Symbol("cms.ui.rodPathPatchedH"),Dn=Symbol("cms.ui.rodPathWrappedUI"),Nn=new WeakMap,Is=new WeakMap,zs=new WeakMap,Bt=[],Ts=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},ss=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"},ln=t=>{if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};let os=!1;const al=()=>{os||(os=!0,queueMicrotask(()=>{os=!1,Bt.length=0}))},cl=t=>{Bt.push(t),Bt.length>128&&Bt.splice(0,Bt.length-128),al()},Ps=()=>{if(!Bt.length)return null;const t=Bt.slice();return Bt.length=0,{items:t,index:0}},Es=(t,e)=>{if(!t)return null;const n=t.items[t.index];return!n||!Object.is(n.value,e)?null:(t.index+=1,n)},is=t=>t&&typeof t=="object"&&t[ns]?t[ns]:t,ls=(t,e)=>{const n=Nn.get(t);if(!n)return;let s=n.rawGet();for(const i of e){if(s==null)return;s=s[i]}return s},dl=(t,e,n)=>{const s=Nn.get(t);if(!s)return;const i=is(n);if(!e.length){if(Object.is(s.rawGet(),i))return;s.rawSet(i);return}let c=s.rawGet();(!c||typeof c!="object")&&(c=Ts(e[0])?[]:{});let y=c;for(let a=0;a<e.length-1;a++){const l=e[a];let b=y[l];if(!b||typeof b!="object"){const R=e[a+1];b=Ts(R)?[]:{},y[l]=b}y=b}Object.is(y[e[e.length-1]],i)||(y[e[e.length-1]]=i,s.rawSet(c))},Ms=(t,e)=>[()=>ls(t,e),n=>dl(t,e,n)],Rs=(t,e,n=[])=>{if(!e||typeof e!="object")return e;let s=Is.get(t);s||(s=new WeakMap,Is.set(t,s));const i=s.get(e);if(i)return i;const c=new Proxy(e,{get(y,a,l){if(a===ns)return y;const b=Reflect.get(y,a,l);if(typeof a=="symbol")return b;const R=n.concat(a);return b&&typeof b=="object"?Rs(t,b,R):typeof b=="function"?b.bind(l):(ss(b)&&cl({rod:t,path:R,value:b}),b)},set(y,a,l,b){const R=is(l),C=Reflect.get(y,a,b);if(Object.is(C,R))return!0;const w=Reflect.set(y,a,R,b);if(w){const T=Nn.get(t);T==null||T.rawSet(T.rawGet())}return w},deleteProperty(y,a){const l=Reflect.has(y,a),b=Reflect.deleteProperty(y,a);if(b&&l){const R=Nn.get(t);R==null||R.rawSet(R.rawGet())}return b}});return s.set(e,c),c},Js=t=>{if(!t||typeof t!="object"||t.type!=="rod"||t[On])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,is(i));return Nn.set(t,{rawGet:n,rawSet:s}),Object.defineProperty(t,"value",{get(){const i=n();return!i||typeof i!="object"?i:Rs(t,i,[])},set(i){s(i)},configurable:!0}),Object.defineProperty(t,On,{value:!0,configurable:!1}),t},ul=()=>{if(typeof window._.rod!="function"||window._.rod[On])return;const t=window._.rod,e=function(...s){return Js(t(...s))};Object.defineProperty(e,On,{value:!0,configurable:!1}),window._.rod=e};je.ui.withoutRodPathCapture=t=>{const e=Bt.length;try{return t()}finally{Bt.length=e}};const rs=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const y=t.map(a=>{const l=rs(a,e,"");return l!==a&&(c=!0),l});return c?y:t}if(ss(t)){const c=Es(e,t);return c?n==="model"?Ms(c.rod,c.path):()=>ls(c.rod,c.path):t}if(!ln(t))return t;let s=!1;const i={};for(const c of Object.keys(t)){const y=rs(t[c],e,c);i[c]=y,y!==t[c]&&(s=!0)}return s?i:t},as=(t,e,n="")=>{if(Array.isArray(t)){let c=!1;const y=t.map(a=>{const l=as(a,e,"");return l!==a&&(c=!0),l});return c?y:t}if(ss(t)){const c=Es(e,t);return c?n==="model"?Ms(c.rod,c.path):()=>ls(c.rod,c.path):t}if(!ln(t))return t;let s=!1;const i={};for(const c of Object.keys(t)){const a=c==="model"||c==="children"?as(t[c],e,c):t[c];i[c]=a,a!==t[c]&&(s=!0)}return s?i:t},Os=t=>{if(typeof t!="function"||t[Dn])return t;const e=zs.get(t);if(e)return e;const n=function(...i){const c=Ps();if(!c)return t.apply(this,i);let y=!1;const a=i.map(l=>{const b=as(l,c,"");return b!==l&&(y=!0),b});return t.apply(this,y?a:i)};return Object.defineProperty(n,Dn,{value:!0,configurable:!1}),zs.set(t,n),n},fl=()=>{const t=je.ui;if(!(!t||t[Dn])){Object.defineProperty(t,Dn,{value:!0,configurable:!1});for(const e of Object.keys(t))typeof t[e]=="function"&&(t[e]=Os(t[e]));je.ui=new Proxy(t,{get(e,n,s){return Reflect.get(e,n,s)},set(e,n,s,i){const c=typeof s=="function"?Os(s):s;return Reflect.set(e,n,c,i)}})}},ml=()=>{if(!window._||window._[Ls])return;Object.defineProperty(window._,Ls,{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=Ps();if(!c)return n.apply(this,i);let y=!1;const a=i.map(l=>{const b=rs(l,c,"");return b!==l&&(y=!0),b});return n.apply(this,y?a:i)})}};ul(),((Io=JSswift.rod)==null?void 0:Io._all)instanceof Set&&JSswift.rod._all.forEach(t=>Js(t)),ml(),fl();const Ds={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},kr=new Set(Object.values(Ds)),gl=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),pl=new Set(["none","sm","md","lg"]),An={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"}},Zt=t=>{if(t.indexOf("-")>-1)return!0},mt=t=>{if(!t)return"";const e=String(t).toLowerCase();return Ds[e]||""},hl=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":gl.has(e)?e:null},Hn=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return pl.has(e)?e:null},kn=t=>t&&typeof t=="object"&&!t.nodeType&&!Array.isArray(t)&&!(t instanceof Function),cs=t=>t&&t.nodeType===1&&String(t.tagName||"").toLowerCase()==="li",en=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];JSswift.isUIPlainObject=kn,JSswift.isListItemNode=cs,JSswift.asNodeArray=en;const gn=[{key:"mobile",aliases:["mobile","mobil"],prefix:"cms-"},{key:"tablet",aliases:["tablet"],prefix:"cms-tablet-"},{key:"pc",aliases:["pc","desktop"],prefix:"cms-pc-"}],ds=gn.flatMap(t=>t.aliases),jn=(t,e)=>Object.prototype.hasOwnProperty.call(t||{},e),Fn=(t={},e)=>{if(!e)return null;for(const n of e.aliases){if(!jn(t,n))continue;const s=o(t[n]);if(kn(s))return s}return null},Hs=(t={},e)=>{const n=Array.isArray(e)?e:[e];return gn.some(s=>{const i=Fn(t,s);return!!i&&n.some(c=>jn(i,c))})},bl=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),yl=(t={},e=[])=>{const n=[];for(const s of gn){const i=Fn(t,s);if(i)for(const c of e){const y=Array.isArray(c.prop)?c.prop:[c.prop];let a=!1,l,b="";for(const w of y)if(jn(i,w)){l=o(i[w]),b=w,a=!0;break}if(!a||l==null||l===""||l===!1&&!c.allowFalse)continue;const R=typeof c.map=="function"?c.map(l,{propName:b,props:i,device:s,rule:c}):`${c.class}-${bl(l)}`,C=Array.isArray(R)?R:[R];for(const w of C)w&&n.push(String(w).startsWith("cms-")?w:`${s.prefix}${w}`)}}return n},js=(t={})=>gn.some(e=>!!Fn(t,e)),wl=(t={},e=[])=>{for(const n of e){if(!jn(t,n))continue;const s=o(t[n]);if(!(s==null||s===""))return s}},vl=(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)},Sl=(t,e,n)=>{!t||n==null||n===""||(typeof t.setProperty=="function"?t.setProperty(e,n):t[e]=n)},Cl=(t,e)=>t==="mobile"?`cms-rsp-${e}`:`cms-rsp-${t}-${e}`,Vs=(t,e)=>{var n;if(!(!t||!e)){if((n=t.classList)!=null&&n.add){t.classList.add(e);return}t.class=ae([t.class,e])}},$s=(t,e={},n=[])=>{if(!t||!e||!js(e))return t;const s=t.style||{};let i=!1;for(const c of n){const y=Array.isArray(c.prop)?c.prop:[c.prop],a=(l,b)=>{const R=wl(b,y),C=vl(R,c);if(!C)return;const w=c.var||c.css,T=l==="mobile"?"--cms-rsp-":`--cms-rsp-${l}-`;Sl(s,`${T}${w}`,C),Vs(t,Cl(l,w)),i=!0};a("mobile",e);for(const l of gn){const b=Fn(e,l);b&&a(l.key,b)}}return i&&(t.nodeType||(t.style=s),Vs(t,"cms-rsp")),t};JSswift.uiResponsiveDevices=gn,JSswift.uiResponsiveOmitProps=ds,JSswift.uiResponsivePropsFor=Fn,JSswift.uiResponsiveHasConfig=js,JSswift.uiResponsiveHasProp=Hs,JSswift.uiResponsiveClasses=yl,JSswift.uiApplyResponsiveProps=$s;const xl=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(ds):ds;return xl(t,n)};const Yt=(t={})=>{var s;const e=[],n={};if(e.push(me(t.clickable,"cms-clickable"),me(t.dense,"cms-dense"),me(t.flat,"cms-flat"),me(t.border,"cms-border"),me(t.glossy,"cms-glossy"),me(t.glow,"cms-glow"),me(t.glass,"cms-glass"),me(t.shadow,"cms-shadow"),me(t.outline,"cms-outline"),me(t.rounded,"cms-rounded"),me(t.gradient,"cms-gradient"),me(t.textGradient,"cms-text-gradient"),me(t.lightShadow,"cms-light-shadow")),rt(t.color))e.push(()=>{const i=o(t.color),c=mt(i);return c?`cms-state-${c}`:""}),n.backgroundColor=()=>{const i=o(t.color);return mt(i)?"":i&&Zt(String(i))?`var(--cms-${i})`:i||""};else{const i=mt(t.color);i?e.push(`cms-state-${i}`):t.color&&Zt(t.color)?n.backgroundColor=`var(--cms-${t.color})`:t.color&&(n.backgroundColor=t.color)}if(rt(t.textColor)?n.color=()=>{const i=o(t.textColor);return i&&Zt(String(i))?`var(--cms-${i})`:i||""}:t.textColor&&Zt(t.textColor)?n.color=`var(--cms-${t.textColor})`:t.textColor&&(n.color=t.textColor),rt(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(rt(t.shadow))e.push(()=>{const i=o(t.shadow),c=Hn(i);return c?`cms-shadow-${c}`:""}),n.boxShadow=()=>{const i=o(t.shadow);return Hn(i)||i==null||i===!1?"":typeof i=="string"?i:""};else{const i=Hn(t.shadow);i?e.push(`cms-shadow-${i}`):t.shadow&&typeof t.shadow=="string"&&(n.boxShadow=t.shadow)}e.length&&(t.class=ae([t.class,...e])),Object.keys(n).length&&(t.style={...n,...t.style||{}})},Nl=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=Nl(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 Yt(n),e};const v=window._,Al={actions:"Content rendered in the action area, typically in a footer or trailing region.",active:"Marks the item as active/selected and applies active styling/ARIA when relevant.",align:"Alignment of content along the cross axis (e.g. left/center/right).",allowCustom:"Allows values not present in the options list.",allowCustomValue:"Accepts free-form values in addition to predefined options.",aside:"Content or configuration for the aside/secondary region.",auto:"Enables automatic sizing or layout behavior instead of fixed sizing.",autocomplete:"Native autocomplete attribute for input elements.",backdrop:"Whether to render a backdrop overlay behind the component.",bgClass:"Additional CSS classes applied to the background layer.",bgPosition:"CSS background-position value for the background image/layer.",bgSize:"CSS background-size value for the background image/layer.",cardClass:"Additional CSS classes applied to the card container.",checked:"Checked state for toggleable controls (controlled).",class:"Additional CSS classes applied to the component root element.",clearable:"Shows a clear action to reset the current value.",clickable:"Enables pointer/hover styles and click handling on the component.",closeOnEsc:"Closes the component when the Escape key is pressed.",closeOnOutside:"Closes the component when clicking outside its bounds.",closeOnSelect:"Closes the menu/popover after selecting an item.",color:"Semantic color name used to style the component.",cols:"Number of columns for grid layouts.",columns:"Column definitions for table-like components.",content:"Main content node(s) or render function for the component body.",contentClass:"Additional CSS classes applied to the content container.",control:"Custom control element or render function for the input area.",children:"Default child content (nodes, arrays, or render function).",delay:"Delay in milliseconds before showing or hiding.",dense:"Uses compact spacing and sizing.",disabled:"Disables interaction and applies disabled styling/ARIA.",divider:"Shows dividers between items or sections.",drawer:"Content or configuration for the drawer region.",drawerBreakpoint:"Viewport width where the drawer switches behavior (overlay vs persistent).",drawerCloseIcon:"Icon used for the drawer close control.",drawerOpen:"Controls whether the drawer is open (controlled).",drawerOpenIcon:"Icon used for the drawer open control.",drawerStateKey:"Storage key used to persist drawer open state.",drawerWidth:"Drawer width (number interpreted as px or CSS length).",elevated:"Applies elevated shadow/raised styling.",emptyText:"Text shown when there is no data to display.",error:"Error state or message displayed with the component.",escClose:"Alias for close-on-escape behavior.",filterPlaceholder:"Placeholder text for the filter/search input.",filterable:"Enables filtering UI for option lists.",flat:"Removes elevation/border for a flat look.",footer:"Footer content node(s) or render function.",form:"HTML form attribute to associate controls with a form.",gap:"Gap/spacing between child elements.",getValue:"Function to extract a value from an item object.",groupCloseIcon:"Icon used to collapse grouped items.",groupOpenIcon:"Icon used to expand grouped items.",header:"Header content node(s) or render function.",height:"Explicit height (number interpreted as px or CSS length).",hint:"Helper text shown near the control.",icon:"Icon name or node rendered with the component.",iconRight:"Icon name or node rendered on the right side of the component.",iconAlign:"Position of the icon relative to the label.",initialSort:"Initial sort configuration for table data.",inputmode:"Native inputmode attribute hint for virtual keyboards.",items:"Array of items or nodes to render.",justify:"Justification of items along the main axis.",label:"Label text or node for the component.",left:"Content or configuration for the left region.",lg:"Column span at large breakpoint.",loading:"Shows loading state and disables interactions where appropriate.",loadingText:"Text displayed while loading.",lockScroll:"Prevents body scroll while an overlay is open.",max:"Maximum value for range-based controls.",md:"Column span at medium breakpoint.",message:"Message text shown in banners/alerts.",min:"Minimum value for range-based controls.",mobile:"Responsive overrides applied at the base/mobile viewport.",model:"Two-way bound value (alias to value in some components).",multi:"Enables multi-selection behavior.",multiple:"Allows selecting multiple values.",name:"HTML name attribute for form submission.",noDrawer:"Disables rendering of the drawer region.",note:"Secondary note text.",number:"Forces numeric input/formatting where supported.",offset:"General offset for positioning.",offsetX:"Horizontal offset for overlay placement in pixels.",offsetY:"Vertical offset for overlay placement in pixels.",onBlur:"Callback fired when the control loses focus.",onChange:"Callback fired when the value or selection changes.",onClear:"Callback fired when the clear action is used.",onClose:"Callback fired when the component closes.",onFocus:"Callback fired when the control gains focus.",onInput:"Callback fired on input events or while typing.",onOpen:"Callback fired when the component opens.",onRemove:"Callback fired when an item is removed.",onSubmit:"Callback fired when a form is submitted.",open:"Controls open/visible state (controlled).",options:"Array of selectable options or option groups.",outline:"Uses outlined visual style.",overlay:"Renders content in an overlay layer or portal.",overlayClose:"Closes the overlay when the backdrop is clicked.",page:"Current page index (1-based unless documented otherwise).",pageSize:"Number of items per page.",padding:"Padding applied to the component root element.",persistent:"Prevents closing via outside click or Escape.",pc:"Responsive overrides applied from the desktop breakpoint upward.",placeholder:"Placeholder text for inputs.",placement:"Overlay placement relative to the target/anchor.",prefix:"Content rendered before the main control.",readonly:"Prevents editing while keeping focus and selection.",removable:"Shows a remove affordance for chips/items.",right:"Content or configuration for the right region.",rowKey:"Key or function used to derive unique row IDs.",rows:"Row data array for table-like components.",margin:"Margin applied to the component root element.",maxHeight:"Maximum height constraint (number interpreted as px or CSS length).",maxWidth:"Maximum width constraint (number interpreted as px or CSS length).",minHeight:"Minimum height constraint (number interpreted as px or CSS length).",minWidth:"Minimum width constraint (number interpreted as px or CSS length).",radius:"Border radius token or CSS length applied to the component.",borderRadius:"Border radius token or CSS length applied to the component.",separator:"Separator string/node between items.",shortcode:"Keyboard shortcut string, object, or array bound to the component action.",showShortcode:"Displays the configured keyboard shortcut badge when the component supports it.",showLabel:"Whether to render the label text.",size:"Size token, number, or CSS length for sizing.",slots:"Named slots map for render overrides.",sm:"Column span at small breakpoint.",span:"Column span within a grid.",speed:"Animation speed or duration in milliseconds.",square:"Use square corners instead of rounded.",src:"Image source URL.",startTop:"Starting scroll offset for parallax effects.",stateKey:"Storage key used to persist component state.",step:"Step increment for numeric controls.",sticky:"Makes the component sticky within its container.",stickyAside:"Keeps the aside region sticky during scroll.",stickyFooter:"Keeps the footer region sticky during scroll.",stickyHeader:"Keeps the header region sticky during scroll.",striped:"Applies striped row styling.",style:"Inline styles applied to the component root element.",subtitle:"Subtitle text or node.",success:"Marks the component with success state styling.",suffix:"Content rendered after the main control.",tableClass:"Additional CSS classes applied to the table element.",tablet:"Responsive overrides applied from the tablet breakpoint upward.",tabs:"Tab definitions array.",tagPage:"Query parameter name used to read/write the current page.",target:"Target element or anchor used for positioning.",text:"Text content for simple components.",thickness:"Stroke/line thickness for progress indicators.",title:"Title text or node.",to:"Navigation target/route to open on click.",topLabel:"Label displayed above the control.",trapFocus:"Keeps focus trapped inside the dialog/popover.",type:"Variant or native input type.",value:"Current value (controlled).",vertical:"Vertical orientation instead of horizontal.",warning:"Marks the component with warning state styling.",width:"Explicit width (number interpreted as px or CSS length).",wrap:"Allows children to wrap to new lines.",wrapClass:"Additional CSS classes applied to the outer wrapper.",zIndex:"z-index for overlay stacking.",shadow:"Shadow token or CSS box-shadow string applied to the component."},kl={actions:"Slot for action buttons or links.",arrow:"Slot for the tooltip/popover arrow element.",aside:"Slot for aside/secondary content.",center:"Slot for centered content within a toolbar/row.",clear:"Slot for the clear control/content.",content:"Slot for the main body content.",control:"Slot for custom control/input rendering.",default:"Primary content for the component.",drawer:"Slot for drawer content.",empty:"Slot for empty-state content.",errorMessage:"Slot for custom error message rendering.",filter:"Slot for custom filter/search UI.",footer:"Slot for footer content.",group:"Slot for grouped content container.",groupLabel:"Slot for group label content.",header:"Slot for header content.",hint:"Slot for helper/hint text.",icon:"Slot for icon content.",iconRight:"Slot for right-aligned icon content.",input:"Slot for custom input element/content.",item:"Slot for custom item rendering.",itemLabel:"Slot for item label rendering.",label:"Slot for label content.",left:"Slot for left-aligned content.",loading:"Slot for loading state content.",message:"Slot for message/alert content.",next:"Slot for the next-page control.",note:"Slot for note/secondary text.",option:"Slot for custom option rendering.",page:"Slot for page indicator/content.",prefix:"Slot for prefix content.",prev:"Slot for the previous-page control.",right:"Slot for right-aligned content.",separator:"Slot for separator rendering between items.",star:"Slot for custom star icon/content in rating.",subtitle:"Slot for subtitle content.",success:"Slot for success message/content.",suffix:"Slot for suffix content.",tab:"Slot for custom tab label/content.",target:"Slot for custom target/anchor element.",title:"Slot for title content.",topLabel:"Slot for top label content.",warning:"Slot for warning message/content."},Bs={dense:!1,disabled:!1,readonly:!1,outline:!1,clickable:!1,flat:!1,elevated:!1},It=[...JSswift.uiSizes],Us=[...JSswift.uiColors],Ws={size:["number","CSS units",...It],color:Us,padding:["number","CSS units",...It],margin:["number","CSS units",...It],width:["number","CSS units",...It],minWidth:["number","CSS units",...It],maxWidth:["number","CSS units",...It],height:["number","CSS units",...It],minHeight:["number","CSS units",...It],maxHeight:["number","CSS units",...It],iconAlign:["left","right","before","after"],align:["left","center","right"],justify:["start","center","end","space-between","space-around","space-evenly"],placement:["top","bottom","left","right","top-start","top-end","bottom-start","bottom-end"],type:Us,shadow:["none",...It],outline:["number","CSS units",...It],borderRadius:["number","CSS units",...It],radius:["number","CSS units",...It],icon:["#name_tabler","name_material","class"],iconRight:["#name_tabler","name_material","class"]},Gs={class:"style",style:"style",size:"style",color:"style",outline:"style",shadow:"style",borderRadius:"style",radius:"style",padding:"layout",margin:"layout",width:"layout",minWidth:"layout",maxWidth:"layout",height:"layout",minHeight:"layout",maxHeight:"layout",mobile:"layout",tablet:"layout",pc:"layout",dense:"layout",flat:"style",elevated:"style",clickable:"behavior",disabled:"state",readonly:"state",loading:"state",active:"state",error:"state",success:"state",warning:"state",note:"state",hint:"state",value:"data",model:"data",items:"data",options:"data",rows:"data",columns:"data",onClick:"events",onChange:"events",onInput:"events",onFocus:"events",onBlur:"events",onSubmit:"events"},Ks=t=>typeof t=="string"?t:!t||typeof t!="object"||Array.isArray(t)?"unknown":t.type||t.signature||t.value||"unknown",Fl=(t,e)=>e==="slot"?`Slot content for "${t}". Accepts nodes, arrays, or render functions.`:`Component configuration for "${t}". When not handled internally, it is forwarded to the root element.`,qs=(t,e,n)=>{var i,c;if(!t||typeof t!="object")return t;const s={};for(const[y,a]of Object.entries(t)){const l=e[y]||Fl(y,n);if(a&&typeof a=="object"&&!Array.isArray(a)){const b=Ks(a);s[y]={...a,type:b,description:a.description||l,default:Object.prototype.hasOwnProperty.call(a,"default")?a.default:(i=Bs[y])!=null?i:null,values:a.values||Ws[y]||null,category:a.category||Gs[y]||(n==="slot"?"slot":"general")}}else{const b=Ks(a);s[y]={type:b,description:l,default:(c=Bs[y])!=null?c:null,values:Ws[y]||null,category:Gs[y]||(n==="slot"?"slot":"general")}}}return s},Ys=(t,e)=>{var s;if(!e||typeof e!="object")return e;(!e.props||typeof e.props!="object"||Array.isArray(e.props))&&(e.props=e.props&&typeof e.props=="object"&&!Array.isArray(e.props)?e.props:{}),Object.prototype.hasOwnProperty.call(e.props,"children")||(e.props.children="Node|Array|Function");const n={size:e.props.size||"string|number",color:e.props.color||"string",outline:e.props.outline||"boolean",clickable:e.props.clickable||"boolean",padding:e.props.padding||"string|number",margin:e.props.margin||"string|number",width:e.props.width||"string|number",minWidth:e.props.minWidth||"string|number",maxWidth:e.props.maxWidth||"string|number",height:e.props.height||"string|number",minHeight:e.props.minHeight||"string|number",maxHeight:e.props.maxHeight||"string|number",radius:e.props.radius||"string|number",borderRadius:e.props.borderRadius||"string|number",shadow:e.props.shadow||"string|boolean",mobile:e.props.mobile||"object",tablet:e.props.tablet||"object",pc:e.props.pc||"object",class:e.props.class||"string",style:e.props.style||"object"};return e.props={...n,...e.props},e.props.icon&&!e.props.iconRight&&(e.props.iconRight=e.props.icon),e.props&&(e.props=qs(e.props,Al,"prop")),e.slots&&(e.slots=qs(e.slots,kl,"slot")),e.slots&&e.slots.icon&&!e.slots.iconRight&&(e.slots.iconRight={type:((s=e.slots.icon)==null?void 0:s.type)||"Node|Array|Function",description:"Slot for right-aligned icon content."}),e.description||(e.description=`${t} component meta definition.`),e},_l=()=>{if(je.ui._metaProxyInstalled)return;je.ui._metaProxyInstalled=!0;const t=je.ui.meta||{};for(const n of Object.keys(t))Ys(n,t[n]);const e=new Proxy(t,{set(n,s,i){return typeof s=="symbol"?(n[s]=i,!0):(n[s]=Ys(s,i),!0)}});je.ui.meta=e,v.meta=e};(zo=je.isDev)!=null&&zo.call(je)&&_l();function rn(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 Xs={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"},Ll=t=>t===!0?"wrap":t===!1?"nowrap":String(t),Qs=t=>typeof t=="number"?`repeat(${Math.max(1,Math.round(t))}, minmax(0, 1fr))`:String(t),Zs=[{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:Ll},{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:Qs},{prop:"rows",css:"grid-template-rows",var:"grid-template-rows",mapValue:Qs},{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"}],eo=Zs.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return e.some(n=>Object.prototype.hasOwnProperty.call(Xs,n))||e.includes("fontSize")||e.includes("fontWeight")||e.includes("lineHeight")||e.includes("letterSpacing")||e.includes("borderRadius")||e.includes("radius")});JSswift.uiResponsiveStyleRules=Zs,JSswift.uiResponsiveCommonStyleRules=eo;const Il=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),zl=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(Il(n),gs(e,s))};function Ke(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(Xs).forEach(([n,s])=>{Hs(e,n)||zl(t,e[n],n,s)}),$s(t,e,eo),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 us(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),y=i!=null?typeof i=="function"?i(n||{}):i:s;return y==null?null:rn(JSswift.ui.slot(y))};const E=(t,e,n,s)=>{const i=JSswift.ui.renderSlot(t,e,n,s);return i?Array.isArray(i)?i:[i]:[]},pn=new Set;let Vn=!1;const Tl=new Set(["ctrl","alt","shift","meta"]),Pl={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"},El={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"},to=()=>{if(typeof navigator=="undefined")return!1;const t=String(navigator.platform||navigator.userAgent||"");return/(mac|iphone|ipad|ipod)/i.test(t)},fs=t=>{if(t==null)return"";const e=String(t).trim().toLowerCase();return e?Pl[e]||e:""},no=t=>{if(t==null||t===!1)return null;const e=String(t).trim();if(!e)return null;const n=e.split("+").map(fs).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"){to()?s.meta=!0:s.ctrl=!0;return}if(Tl.has(i)){s[i]=!0;return}s.key=i}),s.key?s:null},Ml=t=>t==null||t===!1?[]:(Array.isArray(t)?t:[t]).map(n=>{var i,c,y;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const a=no((y=(c=(i=n.shortcode)!=null?i:n.shortcut)!=null?c:n.keys)!=null?y:n.key);return a?{...n,...a}:null}const s=no(n);return s?{...s}:null}).filter(Boolean),so=(t={})=>{var e,n,s;return Ml((s=(n=(e=t.shortcode)!=null?e:t.shortcut)!=null?n:t.hotkey)!=null?s:t.keys)},Rl=(t={})=>t.showShortcode===!0||t.showShortcut===!0,_n=t=>{const e=fs(t);if(!e)return"";const n={...El};return to()&&(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()}`)},Jl=t=>{if(!t)return"";const e=[];return t.ctrl&&e.push(_n("ctrl")),t.alt&&e.push(_n("alt")),t.shift&&e.push(_n("shift")),t.meta&&e.push(_n("meta")),e.push(_n(t.key)),e.filter(Boolean).join("+")},Ol=t=>(Array.isArray(t)?t:[]).map(Jl).filter(Boolean).join(" / "),ms=(t={},e={})=>{const n=so(t);if(!Rl(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=Ol(n),s},Dl=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)},Hl=(t,e)=>!t||!e||!!t.ctrlKey!=!!e.ctrl||!!t.altKey!=!!e.alt||!!t.shiftKey!=!!e.shift||!!t.metaKey!=!!e.meta?!1:fs(t.key)===e.key,oo=()=>{pn.size||!Vn||typeof document=="undefined"||(document.removeEventListener("keydown",io,!0),Vn=!1)};function io(t){var s,i,c,y,a,l;if(!pn.size||!t||t.defaultPrevented||t.isComposing)return;const e=Dl(t.target),n=Array.from(pn);for(let b=n.length-1;b>=0;b-=1){const R=n[b],C=R==null?void 0:R.anchor;if(!C||!C.isConnected){pn.delete(R);continue}if(((s=R.isEnabled)==null?void 0:s.call(R))===!1)continue;const w=R.specs.find(re=>{var j,Y;const H=(Y=(j=re.allowInEditable)!=null?j:R.allowInEditable)!=null?Y:!1;return e&&!H?!1:Hl(t,re)});if(!w)continue;const T=(c=(i=w.preventDefault)!=null?i:R.preventDefault)!=null?c:!0,ee=(a=(y=w.stopPropagation)!=null?y:R.stopPropagation)!=null?a:!0;if(T&&t.preventDefault(),ee&&t.stopPropagation(),((l=R.action)==null?void 0:l.call(R,t,w,C))!==!1)break}oo()}const an=(t,e={},n={})=>{var y,a;const s=so(e);if(!t||!s.length||typeof document=="undefined")return null;const i={anchor:t,specs:s,action:typeof n.action=="function"?n.action:()=>{var l;return(l=t.click)==null?void 0:l.call(t)},isEnabled:typeof n.isEnabled=="function"?n.isEnabled:null,allowInEditable:!!n.allowInEditable,preventDefault:(y=n.preventDefault)!=null?y:!0,stopPropagation:(a=n.stopPropagation)!=null?a:!0};pn.add(i),Vn||(document.addEventListener("keydown",io,!0),Vn=!0);const c=()=>{pn.delete(i),oo()};return JSswift._registerCleanup(t,c),c},hn=(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},gs=(t,e="size")=>typeof t=="number"?t+"px":JSswift.uiSizes.includes(t)?`var(--cms-${e}-${t})`:t,Dt=(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,"-")}`,jl=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}`},ps=(t,e,n)=>t?e:n,Vl=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""},$l=t=>{const e=Number(t);return Number.isFinite(e)&&e>0?`grid-cols-${Math.max(1,Math.min(24,Math.round(e)))}`:""},Ue=(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))})},bn=t=>JSswift.uiResponsiveDevices.find(e=>e.key===t),cn=[{prop:"gap",class:"gap",map:Dt("gap")},{prop:"rowGap",class:"gap-y",map:Dt("gap-y")},{prop:["columnGap","colGap"],class:"gap-x",map:Dt("gap-x")},{prop:"direction",class:"dir",map:Ut("dir")},{prop:"wrap",class:"wrap",allowFalse:!0,map:jl},{prop:"align",class:"align",map:Ut("align")},{prop:"justify",class:"justify",map:Ut("justify")},{prop:"width",class:"w",map:Dt("w")},{prop:"minWidth",class:"min-w",map:Dt("min-w")},{prop:"maxWidth",class:"max-w",map:Dt("max-w")},{prop:"height",class:"h",map:Dt("h")},{prop:"minHeight",class:"min-h",map:Dt("min-h")},{prop:"maxHeight",class:"max-h",map:Dt("max-h")},{prop:"padding",class:"p",map:Dt("p")},{prop:"margin",class:"m",map:Dt("m")}],Bl=cn.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("align")&&!e.includes("justify")}),lo=[{prop:["col","span"],class:"col",map:Vl},{prop:"auto",class:"col",map:t=>t?"col-auto":""},{prop:"inline",class:"display",allowFalse:!0,map:t=>ps(t,"display-inline-flex","display-flex")},{prop:"self",class:"self",map:Ut("self")},...cn],ro=[{prop:["cols","columns"],class:"grid-cols",map:$l},{prop:"inline",class:"display",allowFalse:!0,map:t=>ps(t,"display-inline-grid","display-grid")},{prop:"flow",class:"grid-flow",map:t=>`grid-flow-${String(t).trim().toLowerCase().replace(/\s+/g,"-")}`},...cn],ao=[{prop:"inline",class:"display",allowFalse:!0,map:t=>ps(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")},...Bl],Ul=(JSswift.uiResponsiveStyleRules||[]).filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("span")&&!e.includes("gridColumn")});v.Row=(...t)=>{var f,m,g,O,Q;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(r,x,p={})=>{const P=Array.isArray(r)?r:[r];for(const U of P)if(JSswift.ui.getSlot(s,U)!=null)return E(s,U,p,x);return x==null?[]:E(null,"default",p,x)},c=r=>{var x;return r==null||r===!1||r===""?"":typeof r=="number"?`${r}px`:typeof r=="string"&&((x=JSswift.uiSizes)!=null&&x.includes(r))?`var(--cms-s-${r})`:String(r)},y=r=>{var x;return r==null||r===!1||r===""?"":typeof r=="number"?`${r}px`:typeof r=="string"&&((x=JSswift.uiSizes)!=null&&x.includes(r))?`var(--cms-w-${r})`:String(r)},a=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]);a.class=ae(["cms-row",JSswift.uiResponsiveClasses({mobile:e},cn),JSswift.uiResponsiveClasses(e,cn),e.class]);const l={...e.style||{}},b=Ye([e.direction,e.reverse],()=>{const r=o(e.direction);return r!=null&&r!==""?String(r):o(e.reverse)?"row-reverse":""}),R=Ie(e.align),C=Ie(e.justify),w=Ie(e.wrap,r=>typeof r=="boolean"?r?"wrap":"nowrap":String(r)),T=Ie(e.gap,c),ee=Ie(e.rowGap,c),K=Ie(e.columnGap,c),re=Ie(e.inline,r=>r?"inline-flex":"flex"),H=Ie(e.width,y),j=Ie(e.minWidth,y),Y=Ie(e.maxWidth,y),W=Ie(e.full,r=>r?"100%":"",""),ie=Ye([e.inline,e.full,e.width],()=>{const r=!!o(e.inline),x=!!o(e.full),p=o(e.width)!=null&&o(e.width)!==!1&&o(e.width)!=="";return!r||x||p?"":"max-content"});b!=null&&!Ue(e,"direction")&&(l.flexDirection=b),R!=null&&!Ue(e,"align")&&(l.alignItems=R),C!=null&&!Ue(e,"justify")&&(l.justifyContent=C),w!=null&&!Ue(e,"wrap")&&(l.flexWrap=w),T!=null&&!Ue(e,"gap")&&(l.gap=T),ee!=null&&!Ue(e,"rowGap")&&(l.rowGap=ee),K!=null&&!Ue(e,"columnGap")&&(l.columnGap=K),re!=null&&(l.display=re),ie!=null&&(l.width=ie),H!=null&&!Ue(e,"width")&&(l.width=H),j!=null&&!Ue(e,"minWidth")&&(l.minWidth=j),Y!=null&&!Ue(e,"maxWidth")&&(l.maxWidth=Y),W!=null&&(l.width=W),Object.keys(l).length&&(a.style=l),JSswift.uiApplyResponsiveProps(a,e,JSswift.uiResponsiveStyleRules);const ge={props:e},ce=i(["start","left"],(f=e.start)!=null?f:e.left,ge),le=i(["body","center","default"],(g=(m=e.body)!=null?m:e.center)!=null?g:n,ge),oe=i(["end","right"],(O=e.end)!=null?O:e.right,ge);if(!(ce.length||oe.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 r=E(s,"default",ge,n),x=_.div(a,...r);return Ke(x,e),x}const J={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},Z=(Q=e.bodyClass)!=null?Q:e.centerClass,X=Ye([e.direction,e.reverse],()=>(o(e.direction)||(o(e.reverse)?"row-reverse":"row"))==="row"?"auto":""),ue=[ce.length?_.div({class:ae(["cms-row-start",e.startClass]),style:{...J}},...ce):null,le.length?_.div({class:ae(["cms-row-body",Z]),style:{...J,flex:"1 1 auto"}},...le):null,oe.length?_.div({class:ae(["cms-row-end",e.endClass]),style:{...J,justifyContent:"flex-end",marginInlineStart:X}},...oe):null].filter(Boolean),F=_.div(a,...ue);return Ke(F,e),F},(To=JSswift.isDev)!=null&&To.call(JSswift)&&(v.meta=v.meta||{},v.meta.Row={signature:"UI.Row(...children) | UI.Row(props, ...children)",props:{start:"Node|Function|Array",left:"Alias of start",body:"Node|Function|Array",center:"Alias of body",end:"Node|Function|Array",right:"Alias of end",align:"stretch|flex-start|center|flex-end|baseline",justify:"flex-start|center|flex-end|space-between|space-around|space-evenly",wrap:"boolean|string",direction:"row|row-reverse|column|column-reverse",reverse:"boolean",gap:"string|number",rowGap:"string|number",columnGap:"string|number",inline:"boolean",full:"boolean",width:"string|number",minWidth:"string|number",maxWidth:"string|number",mobile:"{ gap?, direction?, wrap?, align?, justify?, width?, minWidth?, maxWidth? }",tablet:"{ gap?, direction?, wrap?, align?, justify?, width?, minWidth?, maxWidth? }",pc:"{ gap?, direction?, wrap?, align?, justify?, width?, minWidth?, maxWidth? }",startClass:"string",bodyClass:"string",centerClass:"Alias of bodyClass",endClass:"string",slots:"{ start?, left?, body?, center?, end?, right?, default? }",class:"string",style:"object"},slots:{start:"Leading content area",left:"Alias of start",body:"Main content area",center:"Alias of body",end:"Trailing content area",right:"Alias of end",default:"Fallback content / children"},returns:"HTMLDivElement",description:"Wrapper flex in riga con children, slot strutturati e props di layout per gap, allineamento, wrap e direction."});function _t(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="function"&&typeof t[1]=="function"}function Pt(t){return!!t&&t.type==="rod"}function rt(t){return typeof t=="function"||Pt(t)||_t(t)}function o(t){return typeof t=="function"?t():Pt(t)?t.value:_t(t)?t[0]():t}function Wl(t){const e=Array.isArray(t)?[...t]:[t];for(;e.length;){const n=e.pop();if(rt(n))return!0;Array.isArray(n)&&e.push(...n)}return!1}function ae(t){const e=Wl(t),n=()=>{const s=[],i=Array.isArray(t)?[...t]:[t];for(;i.length;){const c=i.shift();if(c==null||c===!1)continue;const y=o(c);if(!(y==null||y===!1||y==="")){if(Array.isArray(y)){i.unshift(...y);continue}s.push(y)}}return s.join(" ")};return e?n:n()}function Ht(t){const e=ae(t);return typeof e=="function"?e():e}function me(t,e,n=""){return rt(t)?()=>o(t)?e:n:t?e:n}function co(t,e,n=""){return rt(t)?()=>{const s=o(t);return s==null||s===""?"":`${e}${s}${n}`}:t==null||t===""?"":`${e}${t}${n}`}function Ye(t,e){return(Array.isArray(t)?t:[t]).some(rt)?()=>e():e()}function Ie(t,e,n=""){return rt(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=rt,JSswift.uiUnwrap=o,JSswift.uiClass=ae,JSswift.uiClassStatic=Ht,JSswift.uiWhen=me,JSswift.uiClassValue=co,JSswift.uiComputed=Ye,JSswift.uiStyleValue=Ie,v.Col=(...t)=>{var P,U,G,de,A,u;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=k=>Object.prototype.hasOwnProperty.call(e,k),c=(k,I,B={})=>{const pe=Array.isArray(k)?k:[k];for(const Se of pe)if(JSswift.ui.getSlot(s,Se)!=null)return E(s,Se,B,I);return I==null?[]:E(null,"default",B,I)},y=k=>{var I;return k==null||k===!1||k===""?"":typeof k=="number"?`${k}px`:typeof k=="string"&&((I=JSswift.uiSizes)!=null&&I.includes(k))?`var(--cms-s-${k})`:String(k)},a=k=>{var I;return k==null||k===!1||k===""?"":typeof k=="string"&&((I=JSswift.uiSizes)!=null&&I.includes(k))?gs(k,"size"):$e(k)},l=(k,I)=>{const B=o(k);if(B==null||B===!1||B==="")return"";if(B==="auto")return I==="cms-col-"?"cms-col-auto":"";if(B===!0)return`${I}24`;const pe=Number(B);if(Number.isFinite(pe)&&pe>0)return`${I}${Math.max(1,Math.min(24,Math.round(pe)))}`;if(typeof B=="string"){const Se=B.trim();if(!Se)return"";if(Se.startsWith(I))return Se;if(/^\d+$/.test(Se))return`${I}${Math.max(1,Math.min(24,Number(Se)))}`}return""},b=()=>{const k=o(e.flex);if(k!=null&&k!==!1&&k!=="")return String(k);if(o(e.fill))return"1 1 auto";const I=i("grow"),B=i("shrink"),pe=i("basis");if(!I&&!B&&!pe)return"";const Se=I?o(e.grow):0,ye=B?o(e.shrink):1,V=pe?a(o(e.basis)):"auto";return`${Se} ${ye} ${V||"auto"}`},R=Ye([e.auto,e.col,e.span],()=>{if(o(e.auto))return"cms-col-auto";const k=i("span")?e.span:e.col;return l(k,"cms-col-")||"cms-col"}),C=JSswift.omit(e,["slots","col","span","sm","md","lg","auto","size","width","minWidth","maxWidth","height","minHeight","maxHeight","gap","rowGap","columnGap","align","justify","inline","center","stack","flex","fill","grow","shrink","basis","self","order","scroll","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass",...JSswift.uiResponsiveOmitProps]),w={...e.style||{}};!Ue(e,"minWidth")&&w.minWidth==null&&(w.minWidth=0);const T=Ie(e.gap,y),ee=Ie(e.rowGap,y),K=Ie(e.columnGap,y),re=Ie(e.align),H=Ie(e.justify),j=i("width")?e.width:e.size,Y=Ie(j,a),W=Ie(e.minWidth,a),ie=Ie(e.maxWidth,a),ge=Ie(e.height,a),ce=Ie(e.minHeight,a),le=Ie(e.maxHeight,a),oe=Ie(e.self),ne=Ie(e.order,k=>String(k)),J=Ie(e.scroll,k=>k?"auto":"",""),Z=Ye([e.flex,e.fill,e.grow,e.shrink,e.basis],b),X=Ye([e.center,e.align,e.justify],()=>!!o(e.center)&&(o(e.align)==null||o(e.align)==="")&&(o(e.justify)==null||o(e.justify)===""));Z!=null&&Z!==""&&(w.flex=Z),oe!=null&&!Ue(e,"self")&&(w.alignSelf=oe),ne!=null&&(w.order=ne),J!=null&&J!==""&&(w.overflow=J),Y!=null&&Y!==""&&!Ue(e,["width","size"])&&(w.width=Y,!i("flex")&&!i("fill")&&!i("grow")&&!i("shrink")&&!i("basis")&&(w.flex="0 0 auto")),W!=null&&!Ue(e,"minWidth")&&(w.minWidth=W),ie!=null&&!Ue(e,"maxWidth")&&(w.maxWidth=ie),ge!=null&&!Ue(e,"height")&&(w.height=ge),ce!=null&&!Ue(e,"minHeight")&&(w.minHeight=ce),le!=null&&!Ue(e,"maxHeight")&&(w.maxHeight=le),Object.keys(w).length&&(C.style=w);const ue={props:e},F=c(["start","top","header","before"],(G=(U=(P=e.start)!=null?P:e.top)!=null?U:e.header)!=null?G:e.before,ue),f=i("body")?e.body:i("content")?e.content:n,m=c(["body","content","default"],f,ue),g=c(["end","bottom","footer","after"],(u=(A=(de=e.end)!=null?de:e.bottom)!=null?A:e.footer)!=null?u:e.after,ue),O=F.length||g.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,Q=Ye([e.stack,e.gap,e.rowGap,e.columnGap,e.align,e.justify,e.center],()=>o(e.stack)||O||[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=ae(["cms-col",R,Ye(e.sm,()=>l(e.sm,"cms-sm-col-")),Ye(e.md,()=>l(e.md,"cms-md-col-")),Ye(e.lg,()=>l(e.lg,"cms-lg-col-")),JSswift.uiResponsiveClasses({mobile:e},lo),JSswift.uiResponsiveClasses(e,lo),me(Q,"cms-col-flex"),me(e.inline,"cms-col-inline"),e.class]),T!=null&&!Ue(e,"gap")&&(w.gap=T),ee!=null&&!Ue(e,"rowGap")&&(w.rowGap=ee),K!=null&&!Ue(e,"columnGap")&&(w.columnGap=K),re!=null&&!Ue(e,"align")?w.alignItems=re:X!=null&&X!==""&&(w.alignItems=X?"center":""),H!=null&&!Ue(e,"justify")?w.justifyContent=H:X!=null&&X!==""&&(w.justifyContent=X?"center":""),Object.keys(w).length&&(C.style=w),JSswift.uiApplyResponsiveProps(C,e,JSswift.uiResponsiveStyleRules),!O){const k=_.div(C,...E(s,"default",ue,n));return Ke(k,e),k}const r={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},x=[F.length?_.div({class:ae(["cms-col-start",e.startClass,e.topClass,e.headerClass]),style:{...r}},...F):null,m.length?_.div({class:ae(["cms-col-body",e.bodyClass,e.contentClass]),style:{...r,flex:"1 1 auto"}},...m):null,g.length?_.div({class:ae(["cms-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...r}},...g):null].filter(Boolean),p=_.div(C,...x);return Ke(p,e),p},(Po=JSswift.isDev)!=null&&Po.call(JSswift)&&(v.meta=v.meta||{},v.meta.Col={signature:"UI.Col(...children) | UI.Col(props, ...children)",props:{col:"number|string",span:"Alias of col",sm:"number|string",md:"number|string",lg:"number|string",auto:"boolean",gap:"number|string",rowGap:"number|string",columnGap:"number|string",align:"string",justify:"string",inline:"boolean",stack:"boolean",center:"boolean",width:"number|string",size:"Alias of width",minWidth:"number|string",maxWidth:"number|string",height:"number|string",minHeight:"number|string",maxHeight:"number|string",flex:"string",fill:"boolean",grow:"number",shrink:"number",basis:"number|string",self:"string",order:"number|string",scroll:"boolean",mobile:"{ col?, span?, gap?, direction?, align?, justify?, width?, height? }",tablet:"{ col?, span?, gap?, direction?, align?, justify?, width?, height? }",pc:"{ col?, span?, gap?, direction?, align?, justify?, width?, height? }",start:"Node|Function|Array",top:"Alias of start",header:"Alias of start",body:"Node|Function|Array",content:"Alias of body",end:"Node|Function|Array",bottom:"Alias of end",footer:"Alias of end",startClass:"string",bodyClass:"string",endClass:"string",slots:"{ start?, top?, header?, body?, content?, end?, bottom?, footer?, default? }",class:"string",style:"object"},slots:{start:"Column leading area",top:"Alias of start",header:"Alias of start",body:"Column main area",content:"Alias of body",end:"Column trailing area",bottom:"Alias of end",footer:"Alias of end",default:"Column fallback content"},returns:"HTMLDivElement",description:"Responsive 24-column wrapper. By default it behaves like a regular container and enables vertical flex layout when using gap/alignment, structured regions, or `stack`."}),v.Spacer=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.omit(e,["slots"]);i.class=ae(["cms-spacer",e.class]);const c=E(s,"default",{},n);return _.div(i,...c)},(Eo=JSswift.isDev)!=null&&Eo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Spacer={signature:"UI.Spacer() | UI.Spacer(props)",props:{slots:"{ default?: Slot }",class:"string",style:"object"},slots:{default:"Optional spacer content"},returns:"HTMLDivElement",description:"Flex spacer."}),v.Container=(...t)=>{var g,O,Q,r;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=x=>Object.prototype.hasOwnProperty.call(e,x),y={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},a=x=>{if(x==null||x===!1||x==="")return"";if(typeof x=="number")return`${x}px`;const p=String(x).trim().toLowerCase();return p?p==="full"||p==="fluid"?"100%":y[p]||String(x):""},l=x=>{var p;return x==null||x===!1||x===""?"":typeof x=="number"?`${x}px`:typeof x=="string"&&((p=JSswift.uiSizes)!=null&&p.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 p=String(x).trim();return p?/^\d+$/.test(p)?`repeat(${Math.max(1,Number(p))}, minmax(0, 1fr))`:p:""},R=x=>x==null||x===""?"":x===!0?"wrap":x===!1?"nowrap":String(x),C={props:e},w=(x,p)=>{if(!(p==null||p===!1)){if(Array.isArray(p)){p.forEach(P=>w(x,P));return}if(p!=null&&p.nodeType){x.appendChild(p);return}x.appendChild(document.createTextNode(String(p)))}},T=(x,p)=>{const P=JSswift.ui.getSlot(s,x);if(P!=null)return E(s,x,C,null);if(typeof p=="function"){const U=_.div({class:`cms-container-slot-${x}`});return JSswift.reactive.effect(()=>{const G=rn(JSswift.ui.slot(p(C)));U.replaceChildren(),Array.isArray(G)?G.forEach(de=>w(U,de)):w(U,G)},`UI.Container:${x}`),[U]}return E(s,x,C,p)},ee=c("content")?e.content:n!=null&&n.length?n:null,K=T("before",(g=e.before)!=null?g:e.top),re=T("header",e.header),H=[...T("left",e.left),...T("start",e.start)],j=T("body",c("body")?e.body:null),Y=(()=>{const x=T("content",c("content")?e.content:null);return x.length?x:T("default",ee)})(),W=[...T("right",e.right),...T("end",e.end)],ie=T("footer",e.footer),ge=T("after",(O=e.after)!=null?O:e.bottom),ce=K.length||re.length||H.length||W.length||ie.length||ge.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,le=!!ce||j.length>0&&(JSswift.ui.getSlot(s,"body")!=null||ce),oe=()=>{var p;const x=String(o((p=e.layout)!=null?p: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||W.length?"flex":"block"},ne=Ye([e.layout,e.display,e.inline,e.grid,e.cols,e.direction,e.wrap,e.align,e.justify,e.gap],()=>{const x=oe();return x==="block"?"":`is-${x}`}),J={...i.style||{}},Z=(x,p)=>{p!=null&&(J[x]=p)};Z("maxWidth",Ye([e.maxWidth,e.fluid],()=>o(e.fluid)?"none":a(o(e.maxWidth))||"")),Z("width",Ie(e.width,a)),Z("minWidth",Ie(e.minWidth,a)),Z("--cms-container-padding",Ie(e.padding,l)),Z("--cms-container-padding-x",Ie((Q=e.paddingX)!=null?Q:e.gutter,l)),Z("--cms-container-padding-y",Ie(e.paddingY,l)),Z("--cms-container-gap",Ie(e.gap,l)),Z("--cms-container-section-gap",Ie((r=e.sectionGap)!=null?r:e.gap,l)),Z("--cms-container-cols",Ie(e.cols,b)),Z("--cms-container-align",Ie(e.align,x=>String(x))),Z("--cms-container-justify",Ie(e.justify,x=>String(x))),Z("--cms-container-direction",Ie(e.direction,x=>String(x))),Z("--cms-container-wrap",Ie(e.wrap,R));const X=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"]);X.class=ae(["cms-container",me(e.fluid,"is-fluid"),me(le,"has-structure"),le?"":ne,i.class]),X.style=J,JSswift.uiApplyResponsiveProps(X,e,JSswift.uiResponsiveStyleRules);const ue=(x,p,P)=>p.length?_.div({class:ae(["cms-container-section",`cms-container-${x}`,P])},...p):null,F=j.length?_.div({class:ae(["cms-container-body",le?ne:"",e.bodyClass])},...j):H.length||Y.length||W.length?_.div({class:ae(["cms-container-body",le?ne:"",e.bodyClass])},ue("start",H,e.startClass),Y.length?_.div({class:ae(["cms-container-main",e.mainClass,e.contentClass])},...Y):null,ue("end",W,e.endClass)):null,f=(()=>{var p;const x=String(o((p=e.tag)!=null?p:e.as)||"div").toLowerCase();return typeof _[x]=="function"?_[x]:_.div})(),m=le?f(X,ue("before",K,e.beforeClass),ue("header",re,e.headerClass),F,ue("footer",ie,e.footerClass),ue("after",ge,e.afterClass)):f(X,...j.length?j:Y);return Ke(m,e),m},(Mo=JSswift.isDev)!=null&&Mo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Container={signature:"UI.Container(...children) | UI.Container(props, ...children)",props:{tag:"string",fluid:"boolean",maxWidth:"number|string",minWidth:"number|string",width:"number|string",padding:"number|string",paddingX:"number|string",paddingY:"number|string",gap:"number|string",sectionGap:"number|string",layout:'"block|flex|grid|stack|inline"',direction:'"row|column"',wrap:"boolean|string",align:"string",justify:"string",cols:"number|string",before:"String|Node|Function|Array",header:"String|Node|Function|Array",start:"String|Node|Function|Array",body:"String|Node|Function|Array",content:"String|Node|Function|Array",end:"String|Node|Function|Array",footer:"String|Node|Function|Array",after:"String|Node|Function|Array",slots:"{ before?, header?, left?, start?, body?, content?, default?, right?, end?, footer?, after? }",class:"string",style:"object"},slots:{before:"Top content before the main container body",header:"Structured header area",left:"Alias for start",start:"Leading area inside the main body",body:"Custom body renderer overriding start/content/end wrappers",content:"Explicit main content",default:"Fallback content from children",right:"Alias for end",end:"Trailing area inside the main body",footer:"Structured footer area",after:"Bottom content after the main container body"},returns:"HTMLDivElement",description:"Composable container with max-width, spacing, layout props, and optional sections."}),v.Card=(...t)=>{var de,A;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};Yt(i);const c=(u,k)=>{var I;return!!(u&&u.nodeType===1&&((I=u.classList)!=null&&I.contains(`cms-card-${k}`)))},a=(u=>u==null?null:typeof u=="string"?v.Icon({name:u,size:e.iconSize||e.size||"lg"}):JSswift.ui.slot(u,{as:"icon"}))(e.icon),l=e.image?_.img({src:e.image,alt:e.imageAlt||"",class:ae(["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},R=E(s,"default",b,n!=null&&n.length?n:[]),C={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},w=[];R.forEach(u=>{c(u,"identifier")?C.identifier.push(u):c(u,"cover")?C.cover.push(u):c(u,"media")?C.media.push(u):c(u,"header")?C.header.push(u):c(u,"body")?C.body.push(u):c(u,"footer")?C.footer.push(u):c(u,"actions")?C.actions.push(u):w.push(u)});const T=E(s,"identifier",b,e.identifier),ee=E(s,"cover",b,l),K=E(s,"media",b,e.media),re=E(s,"eyebrow",b,(de=e.eyebrow)!=null?de:e.kicker),H=E(s,"title",b,e.title),j=E(s,"subtitle",b,e.subtitle),Y=E(s,"header",b,e.header),W=E(s,"icon",b,a),ie=E(s,"aside",b,(A=e.aside)!=null?A:e.headerAside),ge=E(s,"body",b,e.body),ce=E(s,"footer",b,e.footer),le=E(s,"actions",b,e.actions),oe=T.length?_.div({class:ae(["cms-card-identifier",e.identifierClass])},...T):null,ne=ee.length?_.div({class:ae(["cms-card-cover",e.coverClass])},...ee):null,J=K.length?_.div({class:ae(["cms-card-media",e.mediaClass])},...K):null,X=W.length||re.length||H.length||j.length||Y.length||ie.length?_.div({class:ae(["cms-card-header",e.headerClass])},_.div({class:"cms-card-head"},W.length?_.div({class:"cms-card-icon"},...W):null,_.div({class:"cms-card-head-main"},re.length?_.div({class:ae(["cms-card-eyebrow",e.eyebrowClass])},...re):null,H.length?_.div({class:ae(["cms-card-title",e.titleClass])},...H):null,j.length?_.div({class:ae(["cms-card-subtitle",e.subtitleClass])},...j):null,Y.length?_.div({class:ae(["cms-card-header-content",e.headerContentClass])},...Y):null),ie.length?_.div({class:ae(["cms-card-aside",e.asideClass])},...ie):null)):null,ue=[...ge,...w],F=ue.length?_.div({class:ae(["cms-card-body",e.bodyClass])},...ue):null,f=[...le,...C.actions],m=ce.length||f.length?_.div({class:ae(["cms-card-footer",e.footerClass])},...ce,f.length?_.div({class:"cms-card-actions"},...f):null):null,g=Ye([e.clickable,e.to],()=>o(e.clickable)||o(e.to)?"cms-card-clickable":""),O=T.length||C.identifier.length,Q=ee.length||C.cover.length||K.length||C.media.length,r=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"]);r.class=ae(["cms-panel","cms-card","cms-clear-set","cms-singularity",me(e.flat,"cms-card-flat"),me(e.dense,"cms-card-dense"),me(O,"cms-card-has-identifier"),me(Q,"cms-card-has-top-visual"),g,i.class]),r.style={...i.style||{}},e.coverHeight!=null&&(r.style["--cms-card-cover-height"]=$e(o(e.coverHeight))),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const x=e.onClick,p=e.onKeydown,P=u=>{var I;if(x==null||x(u),u.defaultPrevented)return;const k=o(e.to);k&&((I=JSswift.router)!=null&&I.navigate)&&(u.preventDefault(),JSswift.router.navigate(k))},U=u=>{p==null||p(u),!u.defaultPrevented&&(u.key==="Enter"||u.key===" ")&&(u.preventDefault(),P(u))};(o(e.clickable)||o(e.to))&&(r.onClick=P,r.onKeydown=U,r.tabIndex==null&&(r.tabIndex=0),r.role==null&&(r.role="button"));const G=_.div(r,oe,...C.identifier,ne,...C.cover,J,...C.media,X,...C.header,F,...C.body,m,...C.footer);return Ke(G,e),G},(Ro=JSswift.isDev)!=null&&Ro.call(JSswift)&&(v.meta=v.meta||{},v.meta.Card={signature:"UI.Card(...children) | UI.Card(props, ...children)",description:"Sectioned card with structured header, cover/media, body, and footer/actions.",props:{title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",eyebrow:"String|Node|Function|Array",header:"String|Node|Function|Array",body:"String|Node|Function|Array",footer:"String|Node|Function|Array",actions:"Node|Function|Array",icon:"String|Node|Function|Array",aside:"Node|Function|Array",identifier:"String|Node|Function|Array",media:"Node|Function|Array",cover:"Node|Function|Array",image:"string",imageAlt:"string",coverHeight:"string|number",clickable:"boolean",to:"string",dense:"boolean",flat:"boolean",display:"string",direction:"row|column|string",gap:"string|number",cols:"number|string",mobile:"{ display?, direction?, gap?, cols? }",tablet:"{ display?, direction?, gap?, cols? }",pc:"{ display?, direction?, gap?, cols? }",headerClass:"string",bodyClass:"string",footerClass:"string",slots:"{ identifier?, cover?, media?, icon?, eyebrow?, title?, subtitle?, header?, aside?, body?, footer?, actions?, default? }",class:"string",style:"object"},slots:{identifier:"Badge/top identifier content",cover:"Top visual/cover content",media:"Media section above header/body",icon:"Header icon content",eyebrow:"Eyebrow/kicker content",title:"Card title content",subtitle:"Card subtitle content",header:"Header support content",aside:"Right side header content",body:"Body content",footer:"Footer content",actions:"Footer actions slot",default:"Fallback body content or raw card sections"},returns:"HTMLDivElement"}),v.Btn=(...t)=>{var ne;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Ye([e.color,e.state],()=>{const J=o(e.color)||o(e.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(J)?J:o(e.state)||""}),c=ae(["cms-clear-set","cms-btn","cms-singularity","cms-clickable",i,me(e.outline,"outline"),e.class]),y=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);y.class=c;const a=()=>!!o(e.loading),l=()=>!!o(e.disabled)||a(),b=e.icon!=null?typeof e.icon=="string"?v.Icon({name:e.icon}):e.icon:null,R=e.iconRight!=null?typeof e.iconRight=="string"?v.Icon({name:e.iconRight}):e.iconRight:null,C=JSswift.ui.renderSlot(s,"icon",{},b),w=JSswift.ui.renderSlot(s,"iconRight",{},R),T=JSswift.ui.renderSlot(s,"label",{},e.label),ee=E(s,"default",{},n),K=[],re=J=>{J&&(Array.isArray(J)?K.push(...J):K.push(J))},H=e.iconAlign;(H==="after"||H==="right")&&!R?(re(T),ee.length&&K.push(...ee),re(C)):(re(C),re(T),ee.length&&K.push(...ee)),re(w),re(ms(e,{className:"cms-shortcode cms-btn-shortcode"})),K.length===0&&K.push(_.span("Button"));const Y=_.span({class:"cms-btn-loading",hidden:!0}),W=_.span({class:"cms-btn-content"},...K);let ie=!1;const ge=()=>{const J=v.Spinner?v.Spinner({size:e.loadingSize||e.spinnerSize||16,thickness:e.loadingThickness||2,color:e.loadingColor||"currentColor",label:e.loadingText||null,"aria-label":e.loadingText?null:"Loading"}):_.span({class:"cms-muted",style:{marginRight:"8px"}},e.loadingText||"Loading");return E(null,"default",{},JSswift.ui.renderSlot(s,"loading",{},J))},ce=J=>{var f;if((f=e.onPointerDown)==null||f.call(e,J),l()||!(J!=null&&J.currentTarget))return;const Z=J.currentTarget,X=Z.getBoundingClientRect(),ue=typeof J.clientX=="number"?J.clientX-X.left:X.width/2,F=typeof J.clientY=="number"?J.clientY-X.top:X.height/2;Z.style.setProperty("--cms-burst-x",`${ue}px`),Z.style.setProperty("--cms-burst-y",`${F}px`),Z.classList.remove("cms-btn-burst"),Z.offsetWidth,Z.classList.add("cms-btn-burst")},le=_.button({...y,disabled:l(),onClick:J=>{var Z,X;return l()?((Z=J==null?void 0:J.preventDefault)==null||Z.call(J),!1):(X=e.onClick)==null?void 0:X.call(e,J)},onPointerDown:ce,"aria-disabled":l()?"true":null,"aria-busy":a()?"true":null},Y,W),oe=JSswift.reactive.effect(()=>{const J=a(),Z=l();le.disabled=Z,le.classList.toggle("is-loading",J),le.setAttribute("aria-disabled",Z?"true":"false"),J?le.setAttribute("aria-busy","true"):le.removeAttribute("aria-busy"),Y.hidden=!J,J!==ie&&(Y.replaceChildren(...J?ge():[]),ie=J)},"UI.Btn:state");return(ne=JSswift._registerCleanup)==null||ne.call(JSswift,le,oe),Ke(le,e),an(le,e,{isEnabled:()=>!l(),action:()=>{if(l())return!1;le.click()}}),le},v.Button=v.Btn,JSswift.ui.Btn=v.Btn,JSswift.ui.Button=v.Button,(Jo=JSswift.isDev)!=null&&Jo.call(JSswift)&&(v.meta.Btn={signature:"UI.Btn(...children) | UI.Btn(props, ...children)",props:{label:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",iconAlign:"before|after|left|right",color:"primary|secondary|warning|danger|success|info|light|dark",outline:"boolean",loading:"boolean",loadingText:"string|Node|Function|Array",loadingSize:"number|string",loadingColor:"string",loadingThickness:"number|string",disabled:"boolean",shortcode:"string|Array<string>|object",showShortcode:"boolean",slots:"{ icon?, iconRight?, label?, loading?, default? }",class:"string",style:"object"},slots:{icon:"Icon slot",iconRight:"Right icon slot",label:"Label slot",default:"Button content"},events:["click","pointerdown","focus","blur"],returns:"HTMLButtonElement"},v.meta.Button=v.meta.Btn),v.FormField=(t={})=>{var le,oe,ne,J,Z,X,ue;Yt(t);const e=t.slots||{},n=Ye([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:ae(["cms-clear-field-set","cms-field","cms-singularity-field",n,me(t.fill,"cms-field-fill"),me(t.outline,"outline"),t.wrapClass,t.class])}),i=E(e,"topLabel",{},t.topLabel);i.length&&s.appendChild(_.div({class:"cms-field-label"},...i));const c=t.multi||t.multiple,y=typeof t.control=="function"?t.control():t.control,a=()=>{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==="")},l=()=>JSswift.reactive.untracked(a),b=()=>{var F,f;t.disabled||t.readonly||((F=t.onClear)==null||F.call(t),(f=t.onFocus)==null||f.call(t))},R=JSswift.ui.renderSlot(e,"control",{control:y,clear:b,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:l()},null);let C=null,w=null;if(R)C=Array.isArray(R)?_.div({class:"cms-control"},...R):R;else{C=_.div({class:"cms-control"});const F=_.div({class:"cms-addon cms-addon-left"}),f=t.icon!=null?typeof t.icon=="string"?v.Icon({name:t.icon}):t.icon:null,m=JSswift.ui.renderSlot(e,"icon",{},f),g=JSswift.ui.renderSlot(e,"prefix",{},t.prefix);E(null,"default",{},m).forEach(A=>F.appendChild(A)),E(null,"default",{},g).forEach(A=>F.appendChild(A)),F.childNodes.length&&C.appendChild(F);const O=_.div({class:"cms-mid"+(F.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});y&&O.appendChild(y);const Q=E(e,"label",{},t.label);if(Q.length){const A=_.div({class:ae(["cms-float-label",me(c,"cms-multiselect")])},...Q);O.appendChild(A)}C.appendChild(O);const r=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:b},v.Icon({name:"close"})):null,x=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:l()},r);x&&(x.onclick=A=>{A.stopPropagation(),b()},E(null,"default",{},x).forEach(A=>C.appendChild(A))),w=r,w&&((le=t.clearable)!=null&&le.action)&&t.clearable.action(A=>A?w.classList.remove("cms-d-none"):w.classList.add("cms-d-none"));const p=_.div({class:"cms-addon cms-addon-right"}),P=t.iconRight!=null?typeof t.iconRight=="string"?v.Icon({name:t.iconRight}):t.iconRight:null,U=JSswift.ui.renderSlot(e,"iconRight",{},P),G=JSswift.ui.renderSlot(e,"suffix",{},t.suffix),de=JSswift.ui.renderSlot(e,"shortcode",{props:t},ms(t,{className:"cms-shortcode cms-field-shortcode"}));E(null,"default",{},G).forEach(A=>p.appendChild(A)),E(null,"default",{},U).forEach(A=>p.appendChild(A)),E(null,"default",{},de).forEach(A=>p.appendChild(A)),p.childNodes.length&&(C.appendChild(p),O.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),ee=F=>F==null||F===!1||F===""?!1:Array.isArray(F)?F.length>0:!0;let K=null;const re=()=>{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 f=null;for(const r of F)if(ee(r.value)){f=r;break}const m={error:F[0].value,warning:F[1].value,success:F[2].value,note:F[3].value,hint:F[4].value,props:t},g=f?E(e,f.slot,m,f.value):[],O=g.length?_.div({class:f==null?void 0:f.className},...g):null;["error","warning","success","note"].forEach(r=>{var x;return(x=C==null?void 0:C.classList)==null?void 0:x.toggle(r,(f==null?void 0:f.key)===r)}),K?O?K.replaceWith(O):K.remove():O&&s.appendChild(O),K=O},H=()=>{var f;const F=a();(f=C==null?void 0:C.classList)==null||f.toggle("has-value",F),w&&(w.style.display=F?"":"none")};JSswift.reactive.untracked(H),(oe=C==null?void 0:C.classList)==null||oe.toggle("disabled",!!t.disabled),s.appendChild(C);const j=JSswift.ui.getSlot(e,"errorMessage"),Y=JSswift.ui.getSlot(e,"warning"),W=JSswift.ui.getSlot(e,"success"),ie=JSswift.ui.getSlot(e,"note"),ge=JSswift.ui.getSlot(e,"hint");return!!((ne=t.error)!=null&&ne.action||(J=t.warning)!=null&&J.action||(Z=t.success)!=null&&Z.action||(X=t.note)!=null&&X.action||(ue=t.hint)!=null&&ue.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 j=="function"||typeof Y=="function"||typeof W=="function"||typeof ie=="function"||typeof ge=="function"?JSswift.reactive.effect(()=>{re()},"UI.FormField:message"):re(),s._refresh=H,s._control=C,s._el=y,s},(Oo=JSswift.isDev)!=null&&Oo.call(JSswift)&&(v.meta=v.meta||{},v.meta.FormField={signature:"UI.FormField(props)",description:"Wrapper field con label floating, hint/error/success/warning/note, clear e addons slot-based.",props:{label:"String|Node|Function",topLabel:"String|Node|Function",hint:"String|Node|Function",error:"String|Node|Function",success:"String|Node|Function",warning:"String|Node|Function",note:"String|Node|Function",icon:"String|Node|Function",iconRight:"String|Node|Function",prefix:"String|Node|Function",suffix:"String|Node|Function",clearable:"boolean",shortcode:"string|Array<string>|object",showShortcode:"boolean",disabled:"boolean",readonly:"boolean",control:"Node|Function",getValue:"() => any",onClear:"() => void",onFocus:"() => void",wrapClass:"string",slots:"{ label?, topLabel?, prefix?, suffix?, shortcode?, icon?, iconRight?, clear?, hint?, error?, control? }"},slots:{label:"Floating label content",topLabel:"Top label content",prefix:"Left addon content",suffix:"Right addon content",icon:"Left icon content",iconRight:"Right icon content",shortcode:"Shortcut badge content",clear:"Clear button slot (ctx: { clear, disabled, readonly, hasValue })",hint:"Hint content",errorMessage:"Error content",success:"Success content",warning:"Warning content",note:"Note content",control:"Override control wrapper (ctx: { control, clear, disabled, readonly, hasValue })"},returns:"HTMLDivElement (wrapper) con ._refresh()"}),v.InputRaw=(t={})=>{var R;const e=_.input({class:ae(["cms-input-raw",t.class]),type:t.type||"text",name:t.name,placeholder:t.placeholder,autocomplete:t.autocomplete,value:t.value});let n=(R=e.value)!=null?R:"";const s=()=>{var w;const C=(w=e.value)!=null?w:"";C!==n&&(n=C,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let i=null,c=!1;const y=()=>{if(c)return;c=!0;let C=0;const w=()=>{if(s(),C+=1,C>=10){c=!1;return}setTimeout(w,120)};setTimeout(w,40)},a=()=>{i||(i=setInterval(()=>{if(document.activeElement!==e){clearInterval(i),i=null;return}s()},250))},l=()=>{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(),a(),y())}),e.addEventListener("focus",()=>{a(),y(),setTimeout(s,50)}),e.addEventListener("blur",()=>{l(),setTimeout(s,0)}),setTimeout(s,0),y();const b=t.model;if(b){if(typeof b=="object"&&typeof b._bind=="function")je.rodModel(e,b);else if(Array.isArray(b)&&typeof b[0]=="function"&&typeof b[1]=="function"){const C=je.rodFromSignal(b[0],b[1]);je.rodModel(e,C)}}return an(e,t,{isEnabled:()=>!e.disabled,action:()=>hn(e,{selectText:!!t.selectOnShortcode})}),e},v.Input=(t={})=>{var K,re,H;const e=t.slots||{},n={...t,label:(K=t.label)!=null?K:t.placeholder},s=_.input({class:ae(["cms-input",t.class]),type:t.type||"text",name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,value:(re=t.value)!=null?re:"",disabled:!!t.disabled,readOnly:!!t.readonly});let i=(H=s.value)!=null?H:"";const c=()=>{var Y;const j=(Y=s.value)!=null?Y:"";j!==i&&(i=j,s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})))};let y=null,a=!1;const l=()=>{if(a)return;a=!0;let j=0;const Y=()=>{if(c(),j+=1,j>=10){a=!1;return}setTimeout(Y,120)};setTimeout(Y,40)},b=()=>{y||(y=setInterval(()=>{if(document.activeElement!==s){clearInterval(y),y=null;return}c()},250))},R=()=>{y&&(clearInterval(y),y=null)};s.addEventListener("input",()=>{var j,Y;i=(j=s.value)!=null?j:"",(Y=t.onInput)==null||Y.call(t,s.value)}),s.addEventListener("change",()=>{var j,Y;i=(j=s.value)!=null?j:"",(Y=t.onChange)==null||Y.call(t,s.value)}),s.addEventListener("focus",j=>{var Y;(Y=t.onFocus)==null||Y.call(t,j),b(),l(),setTimeout(c,50)}),s.addEventListener("blur",j=>{var Y;(Y=t.onBlur)==null||Y.call(t,j),R(),setTimeout(c,0)}),s.addEventListener("animationstart",j=>{j.animationName==="cms-autofill"&&(c(),b(),l())}),setTimeout(c,0),l();const C=t.model;if(C){const j=Y=>{let W=!1;const ie=ce=>{const le=ce!=null?ce:"";s.value!==le&&(s.value=le,i=le)};Y.action(ce=>{if(!W){W=!0;try{ie(ce)}finally{W=!1}}}),JSswift.reactive.untracked(()=>ie(Y.value));const ge=ce=>{if(W||ce!=null&&ce.isComposing)return;const le=s.value;if(Y.value!==le){W=!0;try{Y.value=le}finally{W=!1}}};s.addEventListener("input",ge),s.addEventListener("compositionend",ge),typeof Y.onDispose=="function"&&Y.onDispose(()=>{s.removeEventListener("input",ge),s.removeEventListener("compositionend",ge)})};if(typeof C=="object"&&typeof C._bind=="function")j(C);else if(Array.isArray(C)&&typeof C[0]=="function"&&typeof C[1]=="function"){const Y=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(C[0],C[1]));j(Y)}}const w=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),T=Array.isArray(w)?_.div({style:{display:"contents"}},...w):w,ee=v.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 j;return(j=ee._refresh)==null?void 0:j.call(ee)}),s.addEventListener("change",()=>{var j;return(j=ee._refresh)==null?void 0:j.call(ee)}),ee._input=s,an(s,t,{isEnabled:()=>!s.disabled,action:()=>hn(s,{selectText:!!t.selectOnShortcode})}),ee},(Do=JSswift.isDev)!=null&&Do.call(JSswift)&&(v.meta=v.meta||{},v.meta.Input={signature:"UI.Input(props)",description:"Input field with floating label, hint/error/success/warning/note, clearable control, icon, prefix/suffix, and reactive support (rod/signal).",props:{model:"rod | [get,set] signal",value:"string",type:"string (default: 'text')",name:"string",autocomplete:"string",inputmode:"string",disabled:"boolean",readonly:"boolean",shortcode:"string|Array<string>|object",showShortcode:"boolean",label:"String|Node|Function (floating label)",topLabel:"String|Node|Function (label above, not floating)",placeholder:"String|Node|Function (alias of label when label is not set)",hint:"String|Node|Function",error:"String|Node|Function",success:"String|Node|Function",warning:"String|Node|Function",note:"String|Node|Function",clearable:"boolean",icon:"String|Node|Function",iconRight:"String|Node|Function",prefix:"String|Node|Function",suffix:"String|Node|Function",class:"string (applicata all'input)",wrapClass:"string (applicata al field wrapper)",style:"object",onInput:"(value:string) => void",onChange:"(value:string) => void",onFocus:"(event) => void",onBlur:"(event) => void"},slots:{label:"Floating label (via FormField slots.label)",topLabel:"Top label (via FormField slots.topLabel)",prefix:"Left addon (via FormField slots.prefix)",suffix:"Right addon (via FormField slots.suffix)",shortcode:"Shortcut badge (via FormField slots.shortcode)",icon:"Left icon (via FormField slots.icon)",iconRight:"Right icon (via FormField slots.iconRight)",clear:"Clear button (via FormField slots.clear)",hint:"Hint content (via FormField slots.hint)",errorMessage:"Error content (via FormField slots.errorMessage)",success:"Success content (via FormField slots.success)",warning:"Warning content (via FormField slots.warning)",note:"Note content (via FormField slots.note)",input:"Custom input node (ctx: { input, props })"},returns:"HTMLDivElement (field wrapper) con ._input = HTMLInputElement"}),v.Textarea=(t={})=>{var b,R,C,w;const e=t.slots||{},n={...t,label:(b=t.label)!=null?b:t.placeholder,wrapClass:ae(["cms-textarea-field",t.wrapClass])},s=_.textarea({class:ae(["cms-input","cms-textarea",t.class]),name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,rows:t.rows,cols:t.cols,maxLength:(R=t.maxLength)!=null?R:t.maxlength,minLength:(C=t.minLength)!=null?C:t.minlength,wrap:t.wrap,value:(w=t.value)!=null?w:"",disabled:!!t.disabled,readOnly:!!t.readonly});s.addEventListener("input",()=>{var 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 ee;(ee=t.onFocus)==null||ee.call(t,T)}),s.addEventListener("blur",T=>{var ee;(ee=t.onBlur)==null||ee.call(t,T)});const i=t.model;if(i){const T=ee=>{let K=!1;const re=j=>{const Y=j!=null?j:"";s.value!==Y&&(s.value=Y)};ee.action(j=>{if(!K){K=!0;try{re(j)}finally{K=!1}}}),JSswift.reactive.untracked(()=>re(ee.value));const H=j=>{if(K||j!=null&&j.isComposing)return;const Y=s.value;if(ee.value!==Y){K=!0;try{ee.value=Y}finally{K=!1}}};s.addEventListener("input",H),s.addEventListener("compositionend",H),typeof ee.onDispose=="function"&&ee.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 ee=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(i[0],i[1]));T(ee)}}const c=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",y=JSswift.ui.renderSlot(e,c,{textarea:s,input:s,props:t},s),a=Array.isArray(y)?_.div({style:{display:"contents"}},...y):y,l=v.FormField({...n,control:a,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=l._refresh)==null?void 0:T.call(l)}),s.addEventListener("change",()=>{var T;return(T=l._refresh)==null?void 0:T.call(l)}),l._input=s,l._textarea=s,an(s,t,{isEnabled:()=>!s.disabled,action:()=>hn(s,{selectText:!!t.selectOnShortcode})}),l},(Ho=JSswift.isDev)!=null&&Ho.call(JSswift)&&(v.meta=v.meta||{},v.meta.Textarea={signature:"UI.Textarea(props)",description:"Textarea field with floating label, hint/error/success/warning/note, clearable control, icon, prefix/suffix, and reactive support (rod/signal).",props:{model:"rod | [get,set] signal",value:"string",name:"string",autocomplete:"string",inputmode:"string",rows:"number|string",cols:"number|string",maxLength:"number|string",minLength:"number|string",wrap:"string",disabled:"boolean",readonly:"boolean",shortcode:"string|Array<string>|object",showShortcode:"boolean",label:"String|Node|Function (floating label)",topLabel:"String|Node|Function (label above, not floating)",placeholder:"String|Node|Function (alias of label when label is not set)",hint:"String|Node|Function",error:"String|Node|Function",success:"String|Node|Function",warning:"String|Node|Function",note:"String|Node|Function",clearable:"boolean",icon:"String|Node|Function",iconRight:"String|Node|Function",prefix:"String|Node|Function",suffix:"String|Node|Function",class:"string (applicata alla textarea)",wrapClass:"string (applicata al field wrapper)",style:"object",onInput:"(value:string) => void",onChange:"(value:string) => void",onFocus:"(event) => void",onBlur:"(event) => void"},slots:{label:"Floating label (via FormField slots.label)",topLabel:"Top label (via FormField slots.topLabel)",prefix:"Left addon (via FormField slots.prefix)",suffix:"Right addon (via FormField slots.suffix)",shortcode:"Shortcut badge (via FormField slots.shortcode)",icon:"Left icon (via FormField slots.icon)",iconRight:"Right icon (via FormField slots.iconRight)",clear:"Clear button (via FormField slots.clear)",hint:"Hint content (via FormField slots.hint)",errorMessage:"Error content (via FormField slots.errorMessage)",success:"Success content (via FormField slots.success)",warning:"Warning content (via FormField slots.warning)",note:"Note content (via FormField slots.note)",textarea:"Custom textarea node (ctx: { textarea, input, props })",input:"Alias slot for custom textarea node (ctx: { textarea, input, props })"},returns:"HTMLDivElement (field wrapper) con ._textarea = HTMLTextAreaElement"}),v.Search=(t={})=>{var z,we;const e=t.slots||{},n=M=>!!M&&(typeof M=="object"&&typeof M._bind=="function"||_t(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,y]=JSswift.reactive.signal(i==null?"":String(i)),[a,l]=JSswift.reactive.signal(!1),[b,R]=JSswift.reactive.signal(!1),[C,w]=JSswift.reactive.signal(null),[T,ee]=JSswift.reactive.signal([]),[K,re]=JSswift.reactive.signal(-1),H=`cms-search-${Math.random().toString(36).slice(2,10)}`,j=new Map;let Y=null,W=null,ie=null,ge=0,ce=0,le=!1,oe=-1,ne=[];const J=(M,N)=>{const S=Number(o(M));return Number.isFinite(S)?S:N},Z=(M,N=!1)=>{const S=o(M);return S==null?N:!!S},X=()=>Z(t.disabled,!1),ue=()=>Z(t.readonly,!1),F=()=>Math.max(0,J(t.minLength,t.endpoint?1:0)),f=()=>Math.max(0,J(t.debounce,250)),m=M=>{var S,d,L,fe,Fe;const N=t.getLabel||t.labelOf;return typeof N=="function"?N(M):M==null?"":typeof M=="string"||typeof M=="number"?String(M):(Fe=(fe=(L=(d=(S=M.label)!=null?S:M.title)!=null?d:M.name)!=null?L:M.text)!=null?fe:M.value)!=null?Fe:""},g=M=>{var S,d,L;const N=t.getValue||t.valueOf;return typeof N=="function"?N(M):M==null?"":typeof M=="string"||typeof M=="number"?M:(L=(d=(S=M.value)!=null?S:M.id)!=null?d:M.key)!=null?L:m(M)},O=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:[],Q=async(M,N)=>{const S=typeof M=="function"?M(N,{props:t}):o(M);return S&&typeof S.then=="function"?await S:S},r=(M,N)=>{const S=typeof M=="function"?M(N,{props:t}):o(M);if(!S)return"";const d=String(S),L=new URL(d,window.location.href),fe=o(t.queryParam)||"q";fe&&L.searchParams.set(fe,N);const Fe=typeof t.params=="function"?t.params(N,{props:t}):o(t.params);return Fe&&typeof Fe=="object"&&Object.keys(Fe).forEach(Te=>{const $=o(Fe[Te]);$==null||$===!1||L.searchParams.set(Te,String($))}),L.toString()},x=(M,N={})=>{var d,L;const S=M==null?"":String(M);c()!==S&&y(S),te.value!==S&&(te.value=S),Y&&!N.fromModel&&Y(S),N.fromModel||(d=t.onInput)==null||d.call(t,S,N.event),(L=he==null?void 0:he._refresh)==null||L.call(he)},p=()=>{l(!1),re(-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),U=()=>{X()||P()&&(l(!0),Se())},G=()=>{ee([]),w(null),re(-1)},de=async(M,N={})=>{var $,_e,Re,Pe,De,We;const S=M==null?"":String(M).trim(),d=++ge,L=o(($=t.endpoint)!=null?$:t.url),fe=(Re=(_e=t.items)!=null?_e:t.options)!=null?Re:t.suggestions;if(ie&&(ie.abort(),ie=null),S.length<F()){R(!1),G(),N.open&&P()?U():P()||p();return}const Fe=t.cache!==!1,Te=`${L||"local"}::${S}`;if(Fe&&j.has(Te)){ee(j.get(Te)),w(null),R(!1),re(j.get(Te).length?0:-1),N.open!==!1&&U();return}R(!0),w(null),N.open!==!1&&U(),(Pe=t.onSearch)==null||Pe.call(t,S);try{let qe;if(L){ie=new AbortController;const Ee=r(L,S),Be=await fetch(Ee,{method:"GET",headers:t.headers,credentials:t.credentials,signal:ie.signal});if(!Be.ok)throw new Error(`Search request failed (${Be.status})`);qe=await(t.parseResponse||(nt=>nt.json()))(Be)}else if(fe!=null){const Ee=O(await Q(fe,S)),Be=t.filter||((tt,nt)=>String(m(tt)).toLowerCase().includes(nt.toLowerCase()));qe=Ee.filter(tt=>Be(tt,S))}else qe=[];if(d!==ge)return;const Ze=typeof t.mapResponse=="function"?t.mapResponse(qe,S):O(qe),Qe=O(Ze);Fe&&j.set(Te,Qe),ee(Qe),re(Qe.length?0:-1),(De=t.onResults)==null||De.call(t,Qe,S)}catch(qe){if((qe==null?void 0:qe.name)==="AbortError"||d!==ge)return;w(qe),ee([]),re(-1),(We=t.onError)==null||We.call(t,qe,S)}finally{d===ge&&(R(!1),ie=null,Se())}},A=(M,N={})=>{W&&clearTimeout(W);const S=N.immediate?0:f();W=setTimeout(()=>{W=null,de(M,N)},S)},u=M=>{var S;const N=c();(S=t.onSubmit)==null||S.call(t,N,M),t.submitOnEnter!==!1&&A(N,{immediate:!0,open:!0})},k=(M,N)=>{var L;if(!M)return;const S=g(M),d=m(M);t.commitValue==="value"?x(S,{event:N}):t.commitValue!==!1&&x(d,{event:N}),(L=t.onSelect)==null||L.call(t,M,{value:S,label:d,query:c(),event:N}),t.closeOnSelect!==!1&&p()},I=M=>{const N=T();if(!N.length)return;const S=K(),d=S<0?M>0?0:N.length-1:Math.max(0,Math.min(N.length-1,S+M));re(d)},B=M=>{const N=M==null?"":String(M),S=c().trim();if(!S||t.highlight===!1)return[document.createTextNode(N)];const d=N.toLowerCase().indexOf(S.toLowerCase());return d<0?[document.createTextNode(N)]:[document.createTextNode(N.slice(0,d)),_.mark({class:"cms-search-highlight"},N.slice(d,d+S.length)),document.createTextNode(N.slice(d+S.length))]},pe=M=>{var d,L;const N=m(M),S=M&&typeof M=="object"?(L=(d=M.description)!=null?d:M.subtitle)!=null?L:M.note:null;return _.div({class:"cms-search-result-content"},_.div({class:"cms-search-result-label"},...B(N)),S?_.div({class:"cms-search-result-description"},String(S)):null)},Se=()=>{!a()||be.parentNode!==document.body||ce||(ce=requestAnimationFrame(()=>{if(ce=0,!a()||!Ce.isConnected||be.parentNode!==document.body)return;const M=Ce.getBoundingClientRect(),N=6,S=8,d=Math.max(180,window.innerWidth-S*2),L=Math.min(Math.max(M.width,J(t.minMenuWidth,260)),d),fe=Math.max(S,Math.min(M.left,window.innerWidth-L-S));be.style.width=`${L}px`,be.style.left=`${fe}px`,be.style.right="auto";const Fe=be.getBoundingClientRect().height||0,Te=window.innerHeight-M.bottom-N-S,$=M.top-N-S;let Re=Te<180&&$>Te?M.top-N-Fe:M.bottom+N;Re=Math.max(S,Math.min(Re,window.innerHeight-Fe-S)),be.style.top=`${Re}px`}))},ye=()=>{le||(le=!0,window.addEventListener("resize",Se),window.addEventListener("scroll",Se,!0))},V=()=>{le&&(le=!1,window.removeEventListener("resize",Se),window.removeEventListener("scroll",Se,!0))},D=()=>{be.parentNode!==document.body&&(ce&&(cancelAnimationFrame(ce),ce=0),be.classList.add("portal"),be.style.display="block",document.body.appendChild(be),ye(),Se())},q=()=>{ce&&(cancelAnimationFrame(ce),ce=0),V(),be.parentNode!==Ce&&Ce.appendChild(be),be.classList.remove("portal"),be.style.display="",be.style.position="",be.style.top="",be.style.left="",be.style.right="",be.style.width=""},Ne=t.label!=null||JSswift.ui.getSlot(e,"label")!=null,ke=()=>{if(!Ne){te.placeholder=o(t.placeholder)||"";return}te.placeholder=document.activeElement===te&&o(t.placeholder)||""},te=_.input({id:t.id,class:ae(["cms-input","cms-search-input",t.inputClass]),type:"search",name:t.name,placeholder:Ne?"":t.placeholder,autocomplete:t.autocomplete||"off",inputmode:t.inputmode,value:c(),disabled:X(),readOnly:ue(),role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-controls":`${H}-list`}),xe=_.div({id:`${H}-list`,class:"cms-search-results",role:"listbox"}),be=_.div({class:ae(["cms-search-menu","cms-singularity-menu-select",t.menuClass,me(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:M=>M.stopPropagation()},xe),Ce=_.div({class:ae(["cms-search",t.class]),role:"presentation"},te,be);let he=null;if(s){if(typeof s=="object"&&typeof s._bind=="function")s.action(M=>x(M,{fromModel:!0})),Y=M=>{s.value!==M&&(s.value=M)};else if(Array.isArray(s)&&typeof s[0]=="function"&&typeof s[1]=="function"){const M=s[0],N=s[1];JSswift.reactive.effect(()=>{x(M(),{fromModel:!0})},"UI.Search:model"),Y=S=>N(S)}}else rt(t.value)&&JSswift.reactive.effect(()=>{x(o(t.value),{fromModel:!0})},"UI.Search:value");te.addEventListener("input",M=>{x(te.value,{event:M}),t.searchOnInput!==!1&&A(te.value,{open:!0})}),te.addEventListener("change",M=>{var N;return(N=t.onChange)==null?void 0:N.call(t,te.value,M)}),te.addEventListener("focus",M=>{var N;ke(),(N=t.onFocus)==null||N.call(t,M),t.openOnFocus!==!1&&(t.searchOnFocus&&!T().length?A(te.value,{immediate:!0,open:!0}):U())}),te.addEventListener("blur",M=>{var N;ke(),(N=t.onBlur)==null||N.call(t,M)}),te.addEventListener("keydown",M=>{if(X()||ue())return;const N=a(),S=T(),d=K();if(M.key==="Escape"){N&&(M.preventDefault(),p());return}if(M.key==="ArrowDown"){M.preventDefault(),N?I(1):(U(),S.length||A(te.value,{immediate:!0,open:!0}));return}if(M.key==="ArrowUp"){M.preventDefault(),N?I(-1):U();return}if(M.key==="Home"&&N&&S.length&&(M.metaKey||M.ctrlKey)){M.preventDefault(),re(0);return}if(M.key==="End"&&N&&S.length&&(M.metaKey||M.ctrlKey)){M.preventDefault(),re(S.length-1);return}M.key==="Enter"&&(N&&d>=0&&S[d]?(M.preventDefault(),k(S[d],M)):u(M))});const Le=M=>{if(!Ce.isConnected)return;const N=M.target;Ce.contains(N)||be.contains(N)||p()};document.addEventListener("click",Le,!0),JSswift.reactive.effect(()=>{const M=a();Ce.classList.toggle("open",M),te.setAttribute("aria-expanded",M?"true":"false"),M?D():q()},"UI.Search:open"),JSswift.reactive.effect(()=>{const M=X(),N=ue();Ce.classList.toggle("disabled",M),Ce.classList.toggle("readonly",N),te.disabled=M,te.readOnly=N},"UI.Search:disabled"),JSswift.reactive.effect(()=>{const M=b(),N=C(),S=T(),d=c();if(xe.innerHTML="",ne=[],oe=-1,M){const L=JSswift.ui.renderSlot(e,"loading",{query:d},t.loadingText||"Caricamento...");xe.appendChild(_.div({class:"cms-search-empty is-loading"},...E(null,"default",{},L)))}else if(N){const L=JSswift.ui.renderSlot(e,"error",{error:N,query:d},t.errorText||"Errore ricerca");xe.appendChild(_.div({class:"cms-search-empty is-error"},...E(null,"default",{},L)))}else if(S.length)S.forEach((L,fe)=>{const Te=m(L),$=g(L),_e=De=>k(L,De),Re=JSswift.ui.renderSlot(e,"result",{item:L,index:fe,active:!1,label:Te,value:$,query:d,select:_e},pe(L)),Pe=_.div({id:`${H}-result-${fe}`,class:ae(["cms-search-result",""]),role:"option","aria-selected":"false",onMouseEnter:()=>re(fe),onMouseDown:De=>De.preventDefault(),onClick:_e},...E(null,"default",{},Re));xe.appendChild(Pe),ne[fe]=Pe});else{const fe=d.trim().length>=F()?t.emptyText||"Nessun risultato":t.startText||"",Fe=JSswift.ui.renderSlot(e,"empty",{query:d},fe);(fe||JSswift.ui.getSlot(e,"empty")!=null)&&xe.appendChild(_.div({class:"cms-search-empty"},...E(null,"default",{},Fe)))}P()||p(),Se()},"UI.Search:render"),JSswift.reactive.effect(()=>{const M=K();M!==oe&&(ne[oe]&&(ne[oe].classList.remove("active"),ne[oe].setAttribute("aria-selected","false")),ne[M]?(ne[M].classList.add("active"),ne[M].setAttribute("aria-selected","true"),ne[M].scrollIntoView({block:"nearest"}),te.setAttribute("aria-activedescendant",`${H}-result-${M}`)):te.removeAttribute("aria-activedescendant"),oe=M)},"UI.Search:active"),he=v.FormField({...t,icon:(z=t.icon)!=null?z:"search",wrapClass:ae(["cms-search-field",t.wrapClass]),control:Ce,getValue:()=>c(),onClear:()=>{var M;X()||ue()||(x("",{}),G(),(M=t.onClear)==null||M.call(t))},onFocus:()=>te.focus()}),te.addEventListener("input",()=>{var M;return(M=he._refresh)==null?void 0:M.call(he)}),te.addEventListener("change",()=>{var M;return(M=he._refresh)==null?void 0:M.call(he)}),he._input=te,he._search=Ce,he._open=U,he._close=p,he._searchNow=()=>de(c(),{immediate:!0,open:!0}),he._getResults=T,he._setValue=M=>x(M,{});let Ae=!1;return he._dispose=()=>{Ae||(Ae=!0,document.removeEventListener("click",Le,!0),W&&clearTimeout(W),ie&&ie.abort(),q())},(we=JSswift._registerCleanup)==null||we.call(JSswift,he,he._dispose),an(te,t,{isEnabled:()=>!te.disabled,action:()=>hn(te,{selectText:!!t.selectOnShortcode})}),(t.autoSearch||t.searchOnMount)&&A(c(),{immediate:!0,open:!1}),he},(jo=JSswift.isDev)!=null&&jo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Search={signature:"UI.Search(props)",description:"Professional search with FormField, GET fetch, debounce, AbortController, overlay results, optional cache, reactive binding, and keyboard navigation.",props:{model:"rod | [get,set] signal",value:"string | rod | [get,set] signal",endpoint:"string | (query, ctx) => string",url:"Alias of endpoint",method:"'GET' (internal)",queryParam:"string (default: 'q')",params:"object | (query, ctx) => object",headers:"object",credentials:"RequestCredentials",parseResponse:"(Response) => Promise<any>",mapResponse:"(payload, query) => Array",items:"Array | (query, ctx) => Array|Promise<Array>",options:"Local alias of items",suggestions:"Local alias of items",filter:"(item, query) => boolean",getLabel:"(item) => string",getValue:"(item) => any",minLength:"number (default: endpoint ? 1 : 0)",debounce:"number ms (default: 250)",cache:"boolean (default: true)",highlight:"boolean (default: true)",clearable:"boolean",label:"String|Node|Function",topLabel:"String|Node|Function",placeholder:"string",icon:"String|Node|Function (default: 'search')",iconRight:"String|Node|Function",shortcode:"string|Array<string>|object",showShortcode:"boolean",openOnFocus:"boolean",searchOnFocus:"boolean",searchOnInput:"boolean",searchOnMount:"boolean",autoSearch:"Alias of searchOnMount",closeOnSelect:"boolean",commitValue:"'label'|'value'|false",disabled:"boolean|Function|rod",readonly:"boolean|Function|rod",loadingText:"string",emptyText:"string",errorText:"string",startText:"string",class:"string",inputClass:"string",menuClass:"string",wrapClass:"string",style:"object"},slots:{result:"Result renderer ({ item, index, active, label, value, query, select })",empty:"Empty state ({ query })",loading:"Loading state ({ query })",error:"Error state ({ error, query })",label:"Floating label",topLabel:"Top label",prefix:"Left addon",suffix:"Right addon",icon:"Left icon",iconRight:"Right icon",shortcode:"Shortcut badge",clear:"Clear button"},events:{onInput:"(query, event)",onChange:"(query, event)",onSearch:"(query)",onResults:"(results, query)",onSelect:"(item, { value, label, query, event })",onSubmit:"(query, event)",onClear:"()",onError:"(error, query)",onFocus:"(event)",onBlur:"(event)"},keyboard:{ArrowDown:"Opens/moves to the next result",ArrowUp:"Moves to the previous result",Enter:"Selects the active result or submits the query",Escape:"Closes the overlay","Cmd/Ctrl+Home":"First result","Cmd/Ctrl+End":"Last result"},returns:"HTMLDivElement (field wrapper) with ._input, ._open(), ._close(), ._searchNow(), ._getResults(), ._setValue(value), ._dispose()"}),v.Select=(t={})=>{var we,M;const e={...t,label:(we=t.label)!=null?we:t.placeholder},n=t.filterable,s=!!t.multiple||!!t.multi,i=!!t.allowCustom||!!t.allowCustomValue,c=t.slots||{},y=N=>!!N&&(typeof N=="object"&&typeof N._bind=="function"||_t(N)),a=y(t.model)?t.model:y(t.value)?t.value:null,l=N=>Array.isArray(N)?N.slice():N==null||N===""?[]:[N],b=N=>s?l(N):N,R=a?JSswift.reactive.untracked(()=>typeof a=="object"&&typeof a._bind=="function"?a.value:a[0]()):t.value,[C,w]=JSswift.reactive.signal(!1),[T,ee]=JSswift.reactive.signal(""),[K,re]=JSswift.reactive.signal(s?l(R):R!=null?R:""),[H,j]=JSswift.reactive.signal(!1),[Y,W]=JSswift.reactive.signal([]),[ie,ge]=JSswift.reactive.signal([]),[ce,le]=JSswift.reactive.signal(-1);let oe=null;if(a){if(typeof a=="object"&&typeof a._bind=="function")JSswift.reactive.untracked(()=>re(b(a.value))),a.action(N=>re(b(N))),oe=N=>{const S=b(N);a.value!==S&&(a.value=S)};else if(Array.isArray(a)&&typeof a[0]=="function"&&typeof a[1]=="function"){const N=a[0],S=a[1];JSswift.reactive.untracked(()=>{JSswift.reactive.effect(()=>{re(b(N()))},"UI.Select:model")}),oe=d=>S(b(d))}}function ne(){var N;return typeof t.disabled=="function"?t.disabled():typeof t.disabled=="boolean"?t.disabled:(N=t==null?void 0:t.disabled)!=null&&N.action?t.disabled.value:!1}function J(N){var S,d,L,fe;if(N==null)return null;if(typeof N=="string"||typeof N=="number")return{type:"option",label:String(N),value:N,disabled:!1};if(typeof N=="object"){if(Array.isArray(N.options))return{type:"group",label:String((S=N.label)!=null?S:""),options:N.options};const Fe=(d=N.label)!=null?d:N.value!=null?String(N.value):"";return{type:"option",label:String(Fe),value:(fe=(L=N.value)!=null?L:N.label)!=null?fe:"",disabled:!!N.disabled}}return{type:"option",label:String(N),value:N,disabled:!1}}function Z(N){const d=(Array.isArray(N)?N:[]).map(J).filter(Boolean),L=[],fe=[];for(const Fe of d)if(Fe.type==="group"){L.push({type:"group",label:Fe.label});const Te=(Fe.options||[]).map(J).filter(Boolean).filter($=>$.type==="option");for(const $ of Te)L.push($),fe.push($)}else L.push(Fe),fe.push(Fe);W(L),ge(fe)}async function X(){const N=t.options;let S;try{const d=typeof N=="function"?JSswift.ui.withoutRodPathCapture(()=>N()):N;d&&typeof d.then=="function"?(j(!0),S=await d):S=d,Z(S)}catch(d){console.error("[UI.Select] options load error:",d),Z([])}finally{j(!1)}}function ue(N){var d;const S=b(N);re(S),oe&&oe(S),(d=t.onChange)==null||d.call(t,S)}function F(N){const S=l(K()),L=S.some(fe=>fe==N)?S.filter(fe=>fe!=N):[...S,N];ue(L)}function f(N,S=!1){s?(F(N),S&&m()):(ue(N),g())}function m(){ee(""),de&&(de.value="")}function g(){w(!1),m(),le(-1)}async function O(){if(ne())return;w(!0),await X();const N=K(),S=ie();let d=-1;if(s){const L=l(N);for(const fe of L)if(d=S.findIndex(Fe=>Fe.value==fe&&!Fe.disabled),d>=0)break}else d=S.findIndex(L=>L.value==N&&!L.disabled);d<0&&(d=S.findIndex(L=>!L.disabled)),le(d),de&&setTimeout(()=>de.focus(),0)}function Q(){C()?g():O()}const r=_.div({class:ae(["cms-select",s?"multiple":"",t.class]),tabIndex:ne()?-1:0,role:"combobox","aria-expanded":"false","aria-disabled":ne()?"true":"false"}),x=_.div({class:ae(["cms-select-value",s?"cms-select-value-multi":""])});JSswift.reactive.effect(()=>{const N=ie();if(x.innerHTML="",s){const S=l(K());for(const d of S){const L=N.find($=>$.value==d),fe=L?L.label:d==null?"":String(d);let Fe=!1;const Te=v.Chip({label:fe,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:$=>{var _e,Re,Pe;(_e=$==null?void 0:$.preventDefault)==null||_e.call($),(Re=$==null?void 0:$.stopPropagation)==null||Re.call($),(Pe=$==null?void 0:$.stopImmediatePropagation)==null||Pe.call($),!Fe&&(Fe=!0,F(d))}});x.appendChild(Te)}}else{const S=K(),d=N.find(L=>L.value==S);x.textContent=d?d.label:S==null||S===""?"":String(S)}},"UI.Select:value");const p=_.div({class:"cms-select-arrow"});JSswift.reactive.effect(()=>{const N=JSswift.ui.renderSlot(c,"arrow",{open:C()},v.Icon("#chevron-down"));p.innerHTML="",E(null,"default",{},N).forEach(S=>p.appendChild(S))},"UI.Select:arrow");const P=_.div({class:"cms-select-control",onClick:Q},x,p),U=_.div({class:"cms-select-options",role:"listbox","aria-multiselectable":s?"true":"false"}),G=_.div({class:"cms-select-filter cms-d-none"});let de=null;const A=_.input({class:"cms-input",type:"text",placeholder:t.filterPlaceholder||"Cerca...",onInput:N=>ee(N.target.value||"")}),u=()=>{const N=JSswift.ui.renderSlot(c,"filter",{value:T(),setValue:d=>{const L=d==null?"":String(d);ee(L),de&&"value"in de&&(de.value=L)},close:g},A);G.innerHTML="";const S=E(null,"default",{},N);S.forEach(d=>G.appendChild(d)),de=S.length===1&&S[0]&&S[0].tagName==="INPUT"?S[0]:null,de&&(de.value=T()||"")};JSswift.reactive.untracked(u),JSswift.reactive.effect(()=>{const N=T()||"";de&&"value"in de&&de.value!==N&&(de.value=N)},"UI.Select:filterValue"),typeof n=="boolean"?n?G.classList.remove("cms-d-none"):G.classList.add("cms-d-none"):n!=null&&n.action&&(n.action(N=>{N?G.classList.remove("cms-d-none"):G.classList.add("cms-d-none")}),n.value?G.classList.remove("cms-d-none"):G.classList.add("cms-d-none"));const k={...t};Yt(k);const I=Ye([k.color,k.state],()=>{const N=o(k.color)||o(k.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(N)?N:o(k.state)||""}),B=_.div({class:ae(["cms-select-menu","cms-singularity-menu-select",I,k.class,me(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:N=>N.stopPropagation()},G,U);let pe=0,Se=!1;const ye=()=>{!C()||B.parentNode!==document.body||pe||(pe=requestAnimationFrame(()=>{if(pe=0,!C()||!r.isConnected||B.parentNode!==document.body)return;const N=r.getBoundingClientRect(),S=6,d=8,L=Math.max(160,window.innerWidth-d*2),fe=Math.min(Math.max(N.width,180),L),Fe=Math.max(d,Math.min(N.left,window.innerWidth-fe-d));B.style.width=`${fe}px`,B.style.left=`${Fe}px`,B.style.right="auto",B.style.marginTop="0";const Te=B.getBoundingClientRect().height||0,$=window.innerHeight-N.bottom-S-d,_e=N.top-S-d;let Pe=$<180&&_e>$?N.top-S-Te:N.bottom+S;Pe=Math.max(d,Math.min(Pe,window.innerHeight-Te-d)),B.style.top=`${Pe}px`}))},V=()=>{Se||(Se=!0,window.addEventListener("resize",ye),window.addEventListener("scroll",ye,!0))},D=()=>{Se&&(Se=!1,window.removeEventListener("resize",ye),window.removeEventListener("scroll",ye,!0))},q=()=>{B.parentNode!==document.body&&(pe&&(cancelAnimationFrame(pe),pe=0),B.classList.add("portal"),B.style.display="block",document.body.appendChild(B),V(),ye())},Ne=()=>{pe&&(cancelAnimationFrame(pe),pe=0),D(),B.parentNode!==r&&r.appendChild(B),B.classList.remove("portal"),B.style.display="",B.style.position="",B.style.top="",B.style.left="",B.style.right="",B.style.width="",B.style.marginTop=""};r.appendChild(P),r.appendChild(B),JSswift.reactive.effect(()=>{const N=C();r.classList.toggle("open",N),r.setAttribute("aria-expanded",N?"true":"false"),N?q():Ne()},"UI.Select:open"),JSswift.reactive.effect(()=>{const N=ne();r.classList.toggle("disabled",N),r.tabIndex=N?-1:0,r.setAttribute("aria-disabled",N?"true":"false")},"UI.Select:disabled");let ke=[],te=-1,xe=-1;function be(){var S;const N=ce();xe=N,N!==te&&(ke[te]&&ke[te].classList.remove("active"),ke[N]&&ke[N].classList.add("active"),te=N,N>=0&&((S=ke[N])==null||S.scrollIntoView({block:"nearest"})))}JSswift.reactive.effect(()=>{const N=Y(),S=ie(),d=(T()||"").toLowerCase().trim(),L=K(),fe=s?l(L):[L],Fe=H(),Te=xe;U.innerHTML="",ke=[],te=-1;const $=[];let _e=0;const Re=Pe=>{const De=fe.some(tt=>tt==Pe.value),We=!!Pe.disabled,qe=["cms-select-option",De?"selected":"",We?"disabled":""].filter(Boolean).join(" "),Ze=()=>{s?F(Pe.value):(ue(Pe.value),g())},Qe=JSswift.ui.renderSlot(c,"option",{opt:Pe,selected:De,active:_e===Te,disabled:We,select:Ze},Pe.label),Ee=E(null,"default",{},Qe),Be=_.div({class:qe,"data-flat-index":String(_e),onClick:We?null:Ze},...Ee);$.push(Be),ke[_e]=Be,_e++};if(d){const Pe=S.filter(De=>De.label.toLowerCase().includes(d));if(Pe.length===0){const De=JSswift.ui.renderSlot(c,"empty",{filter:d},t.emptyText||"Nessuna opzione");U.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},De))),C()&&ye();return}for(const De of Pe)Re(De)}else{let Pe=!1;for(const De of N)if(De.type==="group"){const We=JSswift.ui.renderSlot(c,"group",{label:De.label},De.label);$.push(_.div({class:"cms-select-group"},...E(null,"default",{},We)))}else Pe=!0,Re(De);if(!Pe){const De=JSswift.ui.renderSlot(c,"empty",{filter:d},t.emptyText||"Nessuna opzione");U.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},De))),C()&&ye();return}}if(Fe){const Pe=JSswift.ui.renderSlot(c,"loading",{},"Caricamento...");U.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},Pe))),C()&&ye();return}for(const Pe of $)U.appendChild(Pe);be(),C()&&ye()},"UI.Select:render"),JSswift.reactive.effect(()=>{be()},"UI.Select:paintActive");const Ce=N=>{if(!r.isConnected)return;const S=N.target;r.contains(S)||B.contains(S)||g()};document.addEventListener("click",Ce,!0);const he=N=>{if(ne())return;const S=C(),d=ie(),L=ce(),fe=de&&N.target===de,Fe=($,_e)=>{let Re=$;for(;Re>=0&&Re<d.length;){if(!d[Re].disabled)return Re;Re+=_e}return-1},Te=$=>{if(!$)return null;const _e=$.toLowerCase();let Re=d.find(Pe=>String(Pe.label).toLowerCase()===_e||String(Pe.value).toLowerCase()===_e);return Re||(Re=d.find(Pe=>String(Pe.label).toLowerCase().includes(_e))),Re&&!Re.disabled?Re:null};if(N.key==="Escape"){S&&(N.preventDefault(),g());return}if(fe&&(N.key==="Enter"||N.key===" ")){const $=(T()||"").trim();if($){const _e=Te($);if(_e){N.preventDefault(),f(_e.value,!0);return}if(i&&N.key==="Enter"){N.preventDefault(),f($,!0);return}if(N.key==="Enter"){N.preventDefault();return}}if(N.key===" ")return}if(N.key==="Enter"||N.key===" "){if(N.preventDefault(),!S){O();return}L>=0&&d[L]&&!d[L].disabled&&(s?F(d[L].value):(ue(d[L].value),g()));return}if(N.key==="ArrowDown"){if(N.preventDefault(),!S){O();return}const $=Fe(L<0?0:L+1,1);$>=0&&le($);return}if(N.key==="ArrowUp"){if(N.preventDefault(),!S){O();return}const $=Fe(L<0?d.length-1:L-1,-1);$>=0&&le($);return}if(N.key==="Home"){if(!S)return;N.preventDefault();const $=Fe(0,1);$>=0&&le($);return}if(N.key==="End"){if(!S)return;N.preventDefault();const $=Fe(d.length-1,-1);$>=0&&le($);return}};r.addEventListener("keydown",he),G.addEventListener("keydown",he);let Le=!1;r._dispose=()=>{Le||(Le=!0,document.removeEventListener("click",Ce,!0),r.removeEventListener("keydown",he),G.removeEventListener("keydown",he),Ne())};const Ae=()=>{const N=K();return s?Array.isArray(N)&&N.length>0:N==null?!1:N!==""?!0:ie().some(S=>S.value==="")},z=v.FormField({...e,control:r,clearable:t.clearable,disabled:ne(),readonly:!1,hasValue:Ae,getValue:()=>{const N=K();return s?Array.isArray(N)&&N.length?N:"":N},onClear:()=>{ne()||(ue(s?[]:null),g())},onFocus:()=>{O()}});return JSswift.reactive.effect(()=>{var N;(N=z._refresh)==null||N.call(z)},"UI.Select:fieldRefresh"),z._select=r,z._dispose=r._dispose,(M=JSswift._registerCleanup)==null||M.call(JSswift,z,z._dispose),an(z,t,{isEnabled:()=>!ne(),action:()=>{if(ne())return!1;hn(r),O()}}),X(),z},(Vo=JSswift.isDev)!=null&&Vo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Select={signature:"UI.Select(props)",description:"Select premium: keyboard nav, option groups, async options, filter, clearable, multi select, valori custom da filtro. Wrappato in UI.FormField.",props:{options:"Array<option|group> | () => Array<option|group> | async () => Promise<Array<option|group>>",value:"any",model:"rod | [get,set] signal",label:"String|Node|Function (floating)",placeholder:"String|Node|Function (alias of label when label is not set)",topLabel:"String|Node|Function",hint:"String|Node|Function",error:"String|Node|Function",success:"String|Node|Function",warning:"String|Node|Function",note:"String|Node|Function",clearable:"boolean",filterable:"boolean",multiple:"boolean",multi:"boolean (alias multiple)",allowCustom:"boolean (consenti valori custom dal filtro)",allowCustomValue:"boolean (alias allowCustom)",filterPlaceholder:"string",emptyText:"string",shortcode:"string|Array<string>|object",showShortcode:"boolean",icon:"String|Node|Function",iconRight:"String|Node|Function",prefix:"String|Node|Function",suffix:"String|Node|Function",disabled:"boolean | () => boolean",dense:"boolean",class:"string",wrapClass:"string",slots:"{ clear?, arrow?, filter?, option?, group?, empty?, loading? }",onChange:"(value:any) => void"},slots:{clear:"Clear button (via FormField slots.clear)",arrow:"Arrow slot (ctx: { open })",filter:"Filter input slot (ctx: { value, setValue, close })",option:"Option renderer (ctx: { opt, selected, active, disabled, select })",group:"Group header (ctx: { label })",empty:"Empty state (ctx: { filter })",loading:"Loading state (ctx: {})",label:"Floating label (via FormField slots.label)",topLabel:"Top label (via FormField slots.topLabel)",prefix:"Left addon (via FormField slots.prefix)",suffix:"Right addon (via FormField slots.suffix)",shortcode:"Shortcut badge (via FormField slots.shortcode)",icon:"Left icon (via FormField slots.icon)",iconRight:"Right icon (via FormField slots.iconRight)",hint:"Hint content (via FormField slots.hint)",errorMessage:"Error content (via FormField slots.errorMessage)",success:"Success content (via FormField slots.success)",warning:"Warning content (via FormField slots.warning)",note:"Note content (via FormField slots.note)"},keyboard:["Enter/Space","ArrowUp","ArrowDown","Home","End","Escape"],returns:"HTMLDivElement (wrapper field) con ._select, ._dispose()"}),v.Upload=(t={})=>{var Ae;Yt(t);const e=t.slots||{},[n,s]=JSswift.reactive.signal([]),[i,c]=JSswift.reactive.signal(!1),[y,a]=JSswift.reactive.signal(!1),[l,b]=JSswift.reactive.signal(null);let R=0,C=!1;const w=()=>!!o(t.disabled)||!!o(t.readonly),T=()=>t.multiple!==!1&&t.single!==!0,ee=()=>{var z,we;return["form","native","submit","external"].includes(String(o((we=(z=t.submitMode)!=null?z:t.modeSubmit)!=null?we:t.uploadMode)||"").toLowerCase())},K=()=>{var z;return o((z=t.showBrowse)!=null?z:t.browseButton)!==!1},re=()=>{var z;return!ee()&&o((z=t.showUpload)!=null?z:t.uploadButton)!==!1},H=()=>{var z;return o((z=t.showClear)!=null?z:t.clearButton)!==!1},j=()=>{var z;return o((z=t.showFiles)!=null?z:t.files)!==!1},Y=()=>{const z=mt(o(t.state)||o(t.status));return z?`cms-state-${z}`:""},W=()=>t.fieldName||t.paramName||t.name||"file",ie=()=>{var z;return Math.max(1,Number(o((z=t.parallelUploads)!=null?z:t.parallel)||1))},ge=()=>{var we,M,N,S;const z=o(t.retry);return z===!0?{attempts:2,delay:350,factor:2}:z?{attempts:Math.max(0,Number((M=(we=z.attempts)!=null?we:z.retries)!=null?M:0)),delay:Math.max(0,Number((N=z.delay)!=null?N:350)),factor:Math.max(1,Number((S=z.factor)!=null?S:2))}:{attempts:0,delay:350,factor:2}},ce=z=>z?Array.isArray(z)?z:Array.from(z):[],le=z=>{const we=Number(z||0);return we<1024?`${we} B`:we<1024*1024?`${(we/1024).toFixed(1)} KB`:we<1024*1024*1024?`${(we/1024/1024).toFixed(1)} MB`:`${(we/1024/1024/1024).toFixed(1)} GB`},oe=()=>{var z;return String(o((z=t.acceptedFiles)!=null?z:t.accept)||"").trim()},ne=z=>{const we=oe();if(!we)return!0;const M=String(z.name||"").toLowerCase(),N=String(z.type||"").toLowerCase();return we.split(",").map(S=>S.trim().toLowerCase()).filter(Boolean).some(S=>S.startsWith(".")?M.endsWith(S):S.endsWith("/*")?N.startsWith(S.slice(0,-1)):N===S)},J=()=>n().filter(z=>z.status!=="rejected"&&z.status!=="removed"),Z=(z=0)=>J().reduce((we,M)=>we+Number(M.size||0),z),X=()=>{var z;s(n().slice()),D.classList.toggle("is-busy",n().some(we=>we.status==="uploading")),D.classList.toggle("has-files",n().some(we=>we.status!=="removed")),(z=t.onChange)==null||z.call(t,n().slice(),q)},ue=(z,we,M=null)=>{var S;const N={id:`upload_${Date.now()}_${++R}`,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:we,detail:M,attempts:0,response:null,xhr:null};return n().push(N),(S=t.onRejected)==null||S.call(t,N,{reason:we,detail:M,api:q}),N},F=async(z,we)=>{const M=t.maxFiles==null?null:Number(o(t.maxFiles)),N=t.maxFileSize==null?null:Number(o(t.maxFileSize)),S=t.minFileSize==null?null:Number(o(t.minFileSize)),d=t.maxTotalSize==null?null:Number(o(t.maxTotalSize));if(M!=null&&we>M)return"max-files";if(N!=null&&Number(z.size||0)>N)return"max-file-size";if(S!=null&&Number(z.size||0)<S)return"min-file-size";if(d!=null&&Z(Number(z.size||0))>d)return"max-total-size";if(!ne(z))return"accept";const L=t.filter||t.acceptFile||t.validate;if(typeof L=="function"){const fe=await L(z,{files:n().slice(),api:q});if(fe===!1)return"filter";if(typeof fe=="string")return fe}return null},f=async()=>{for(const z of n()){if(z.status!=="rejected"||z.error!=="max-files")continue;const we=await F(z.file,J().length+1);if(we){z.error=we;continue}z.status="queued",z.progress=0,z.error=null,z.detail=null}},m=z=>({id:`upload_${Date.now()}_${++R}`,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}),g=async(z,we={})=>{var S;if(w())return[];b(null);const M=ce(z),N=[];!T()&&M.length&&O({silent:!0});for(const d of M){const L=await F(d,J().length+1);if(L){ue(d,L);continue}const fe=m(d);if(n().push(fe),N.push(fe),(S=t.onAdded)==null||S.call(t,fe,{file:d,meta:we,api:q}),!T())break}return X(),N.length&&t.autoUpload&&!ee()&&u(),N},O=(z={})=>{var we;for(const M of n())M.status==="uploading"&&r(M),M.status="removed";s([]),b(null),X(),z.silent||(we=t.onClear)==null||we.call(t,q)},Q=async z=>{var N;const we=typeof z=="string"?n().find(S=>S.id===z):z;if(!we)return;we.status==="uploading"&&r(we);const M=n().filter(S=>S!==we);s(M),await f(),X(),(N=t.onRemove)==null||N.call(t,we,{api:q})},r=z=>{var M,N,S;const we=typeof z=="string"?n().find(d=>d.id===z):z;!we||we.status!=="uploading"||(we.status="canceled",we.error="canceled",(N=(M=we.xhr)==null?void 0:M.abort)==null||N.call(M),(S=t.onCancel)==null||S.call(t,we,{api:q}),X())},x=()=>n().filter(z=>z.status==="uploading").forEach(r),p=async z=>{var M,N;const we={url:o(t.url),method:o(t.method||"POST"),headers:t.headers,formFields:t.formFields||t.fields,fieldName:W(),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:q});if(S&&typeof S=="object")Object.assign(we,S);else if(S!=null)throw new Error("factory must return an object")}catch(S){throw(N=t.onFactoryFailed)==null||N.call(t,S,{item:z,api:q}),S}return we},P=(z,we,M)=>{const N=typeof we=="function"?we(M.file,{item:M,api:q}):we;N&&(N instanceof Headers?N.forEach((S,d)=>z.setRequestHeader(d,S)):Array.isArray(N)?N.forEach(S=>{Array.isArray(S)?z.setRequestHeader(S[0],S[1]):S!=null&&S.name&&z.setRequestHeader(S.name,S.value)}):typeof N=="object"&&Object.keys(N).forEach(S=>z.setRequestHeader(S,N[S])))},U=(z,we,M)=>{const N=typeof we=="function"?we(M.file,{item:M,api:q}):we;N&&(Array.isArray(N)?N.forEach(S=>{Array.isArray(S)?z.append(S[0],S[1]):S!=null&&S.name&&z.append(S.name,S.value)}):typeof N=="object"&&Object.keys(N).forEach(S=>z.append(S,N[S])))},G=(z,we)=>new Promise((M,N)=>{if(!we.url){N(new Error("UI.Upload: url is required"));return}if(typeof XMLHttpRequest!="function"){N(new Error("UI.Upload: XMLHttpRequest is not available"));return}const S=new XMLHttpRequest;z.xhr=S,S.open(String(we.method||"POST").toUpperCase(),we.url,!0),S.withCredentials=!!we.withCredentials,P(S,we.headers,z),S.upload.onprogress=L=>{var fe;L.lengthComputable&&(z.bytesUploaded=L.loaded,z.progress=Math.max(0,Math.min(100,Math.round(L.loaded/L.total*100))),(fe=t.onProgress)==null||fe.call(t,z,{event:L,api:q}),X())},S.onload=()=>{const L=S.status>=200&&S.status<300,fe={status:S.status,text:S.responseText,xhr:S};L?M(fe):N(Object.assign(new Error(`HTTP error ${S.status}`),{response:fe}))},S.onerror=()=>N(new Error("network-error")),S.onabort=()=>N(new Error("canceled"));const d=we.sendRaw?z.file:(()=>{const L=new FormData;return U(L,we.formFields,z),L.append(we.fieldName||"file",z.file,z.name),L})();S.send(d)}),de=async z=>{var N,S,d,L,fe,Fe;const we=ge();let M=we.delay;z.status="uploading",z.error=null,z.progress=Math.max(0,z.progress||0),(N=t.onStart)==null||N.call(t,z,{api:q}),X();for(let Te=0;Te<=we.attempts;Te++){z.attempts=Te+1;try{const $=await p(z),_e=typeof t.upload=="function"||typeof t.uploader=="function"?await(t.upload||t.uploader)(z.file,{item:z,options:$,progress:Re=>{var Pe;z.progress=Math.max(0,Math.min(100,Number(Re)||0)),(Pe=t.onProgress)==null||Pe.call(t,z,{api:q}),X()},api:q}):await G(z,$);return z.status="done",z.progress=100,z.response=_e,z.xhr=null,(S=t.onSuccess)==null||S.call(t,z,{response:_e,api:q}),(d=t.onComplete)==null||d.call(t,z,{response:_e,api:q}),X(),z}catch($){if(String(($==null?void 0:$.message)||$)==="canceled"||z.status==="canceled")return z.status="canceled",z.error="canceled",z.xhr=null,(L=t.onComplete)==null||L.call(t,z,{error:$,api:q}),X(),z;if(Te<we.attempts){await new Promise(_e=>setTimeout(_e,M)),M=Math.round(M*we.factor);continue}return z.status="error",z.error=$,z.xhr=null,b($),(fe=t.onError)==null||fe.call(t,z,{error:$,api:q}),(Fe=t.onComplete)==null||Fe.call(t,z,{error:$,api:q}),X(),z}}return z},A=()=>{var N;if(C||w())return;const z=n().filter(S=>S.status==="uploading").length,we=Math.max(0,ie()-z),M=n().filter(S=>S.status==="queued").slice(0,we);if(!M.length){const S=n().some(d=>d.status==="uploading");a(S),S||(N=t.onFinish)==null||N.call(t,n().slice(),{api:q});return}a(!0),M.forEach(S=>{de(S).finally(()=>A())})},u=(z=null)=>{(z?ce(z):n().filter(M=>["queued","error","canceled"].includes(M.status))).forEach(M=>{const N=typeof M=="string"?n().find(S=>S.id===M):M;N&&N.status!=="uploading"&&N.status!=="done"&&N.status!=="rejected"&&(N.status="queued",N.progress=0,N.error=null)}),X(),A()},k=z=>u([z]),I=()=>{w()||B.click()},B=_.input({type:"file",class:"cms-upload-input",name:W(),accept:oe()||null,multiple:T(),capture:t.capture||null,disabled:w(),onChange:z=>{g(z.target.files,{event:z,source:"browse"}),z.target.value=""}}),pe=_.div({class:"cms-upload-list"}),Se=_.div({class:"cms-upload-summary"}),ye=_.div({class:"cms-upload-actions"});let V=Y();const D=_.div({class:ae(["cms-upload","cms-singularity",V,me(t.box||t.variant==="box","cms-upload-box"),me(t.compact,"is-compact"),me(ee(),"is-form-mode"),me(!j(),"is-files-hidden"),t.class]),tabindex:w()?"-1":"0",role:"group","aria-disabled":w()?"true":"false"}),q={addFiles:g,browse:I,upload:u,retry:k,retryAll:()=>u(n().filter(z=>z.status==="error"||z.status==="canceled")),remove:Q,clear:O,abort:r,abortAll:x,files:()=>n().slice(),state:()=>({files:n().slice(),busy:y(),dragging:i(),error:l()}),reset:O},Ne=()=>{const z={api:q,files:n().slice(),busy:y(),disabled:w(),submitMode:ee()?"form":"upload"},we=[];return K()&&we.push(JSswift.ui.renderSlot(e,"browse",z,v.Btn({size:"sm",icon:"folder_open",label:t.browseText||"Browse",onClick:I}))),re()&&we.push(JSswift.ui.renderSlot(e,"upload",z,v.Btn({size:"sm",color:"primary",icon:"upload",label:t.uploadText||"Upload",loading:y(),disabled:w()||!n().some(M=>["queued","error","canceled"].includes(M.status)),onClick:()=>u()}))),H()&&we.push(JSswift.ui.renderSlot(e,"clear",z,v.Btn({size:"sm",color:"secondary",outline:!0,icon:"delete",label:t.clearText||"Clear",disabled:w()||!n().length,onClick:()=>O()}))),E(e,"actions",z,we)},ke=(z,we)=>{var d;const M={item:z,file:z.file,index:we,api:q,remove:()=>Q(z),retry:()=>k(z),abort:()=>r(z)},N=_.div({class:ae(["cms-upload-file",`is-${z.status}`])},_.div({class:"cms-upload-file-icon"},v.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"},...E(e,"fileName",M,z.name)),_.div({class:"cms-upload-file-meta"},...E(e,"fileMeta",M,z.error?String(((d=z.error)==null?void 0:d.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"},le(z.size)),_.div({class:"cms-upload-file-actions"},...E(e,"fileActions",M,[z.status==="uploading"?v.Btn({size:"sm",outline:!0,icon:"close","aria-label":"Cancel",onClick:()=>r(z)}):null,z.status==="error"||z.status==="canceled"?v.Btn({size:"sm",outline:!0,icon:"refresh","aria-label":"Retry",onClick:()=>k(z)}):null,v.Btn({size:"sm",dense:!0,outline:!0,icon:"delete","aria-label":"Remove",onClick:()=>Q(z)})])))),S=JSswift.ui.renderSlot(e,"file",M,N);return _.div({class:"cms-upload-file-wrap","data-status":z.status,"data-id":z.id},...E(null,"default",{},S))},te=()=>{const z=n();if(ye.replaceChildren(...Ne()),pe.replaceChildren(),Se.hidden=!j(),pe.hidden=!j(),z.length)z.forEach((M,N)=>pe.appendChild(ke(M,N)));else{const M=JSswift.ui.renderSlot(e,"empty",{api:q},t.emptyText||"No files selected");pe.appendChild(_.div({class:"cms-upload-empty"},...E(null,"default",{},M)))}const we=z.filter(M=>M.status!=="rejected"&&M.status!=="removed");Se.textContent=`${we.length} file \u2022 ${le(we.reduce((M,N)=>M+Number(N.size||0),0))}`},xe=JSswift.ui.renderSlot(e,"icon",{api:q},v.Icon({name:t.icon||"cloud_upload"})),be=JSswift.ui.renderSlot(e,"title",{api:q},t.title||"Upload files"),Ce=JSswift.ui.renderSlot(e,"subtitle",{api:q},t.subtitle||(oe()?`Accepted: ${oe()}`:"Drag files here or browse from your device")),he=_.div({class:"cms-upload-dropzone",onClick:z=>{var we,M;(M=(we=z.target)==null?void 0:we.closest)!=null&&M.call(we,".cms-upload-actions, .cms-upload-list")||t.clickable!==!1&&I()},onDragenter:z=>{t.drag===!1||w()||(z.preventDefault(),c(!0),D.classList.add("is-dragging"))},onDragover:z=>{t.drag===!1||w()||z.preventDefault()},onDragleave:z=>{z.currentTarget===z.target&&(c(!1),D.classList.remove("is-dragging"))},onDrop:z=>{var we,M;t.drag===!1||w()||(z.preventDefault(),c(!1),D.classList.remove("is-dragging"),(we=t.onDrop)==null||we.call(t,z,{api:q}),g(((M=z.dataTransfer)==null?void 0:M.files)||[],{event:z,source:"drop"}))}},_.div({class:"cms-upload-head"},_.div({class:"cms-upload-icon"},...E(null,"default",{},xe)),_.div({class:"cms-upload-copy"},_.div({class:"cms-upload-title"},...E(null,"default",{},be)),_.div({class:"cms-upload-subtitle"},...E(null,"default",{},Ce))),ye),Se,pe),Le=JSswift.ui.renderSlot(e,"header",{api:q},null);return E(null,"default",{},Le).forEach(z=>D.appendChild(z)),D.appendChild(B),E(e,"default",{api:q,dropzone:he},he).forEach(z=>D.appendChild(z)),JSswift.reactive.effect(()=>{te()},"UI.Upload:render"),JSswift.reactive.effect(()=>{D.classList.toggle("is-disabled",w()),D.classList.toggle("is-form-mode",ee()),D.classList.toggle("is-files-hidden",!j());const z=Y();z!==V&&(V&&D.classList.remove(V),z&&D.classList.add(z),V=z),D.setAttribute("aria-disabled",w()?"true":"false"),B.disabled=w(),B.multiple=T(),B.name=W()},"UI.Upload:disabled"),D._upload=q,D._addFiles=g,D._browse=I,D._uploadFiles=u,D._input=B,D._dispose=()=>{C||(C=!0,x())},(Ae=JSswift._registerCleanup)==null||Ae.call(JSswift,D,D._dispose),D},v.BoxUpload=(t={})=>v.Upload({...t,box:!0}),v.boxUpload=(t={})=>v.BoxUpload(t),JSswift.ui.Upload=v.Upload,JSswift.ui.BoxUpload=v.BoxUpload,JSswift.ui.boxUpload=v.boxUpload,($o=JSswift.isDev)!=null&&$o.call(JSswift)&&(v.meta=v.meta||{},v.meta.Upload={signature:"UI.Upload(props)",description:"Professional uploader with drag/drop, validation, queue, retry, factory options, XHR progress, custom upload and slot-based rendering.",props:{url:"string",method:"POST|PUT|PATCH|string",fieldName:"string",paramName:"Alias of fieldName",headers:"object|Array|Headers|(file, ctx)=>headers",formFields:"object|Array|(file, ctx)=>fields",factory:"(file, ctx)=>object|Promise<object>",upload:"(file, ctx)=>Promise<any> custom uploader",multiple:"boolean",accept:"string",acceptedFiles:"Alias of accept",maxFiles:"number",maxFileSize:"number bytes",maxTotalSize:"number bytes",autoUpload:"boolean",parallelUploads:"number",retry:"boolean|{ attempts, delay, factor }",withCredentials:"boolean",sendRaw:"boolean",submitMode:'"upload"|"form"',uploadMode:"Alias of submitMode",showBrowse:"boolean",showUpload:"boolean",showClear:"boolean",showFiles:"boolean",browseButton:"Alias of showBrowse",uploadButton:"Alias of showUpload",clearButton:"Alias of showClear",drag:"boolean",clickable:"boolean",box:"boolean",compact:"boolean",color:"semantic state or CSS color",status:"semantic state alias",state:"semantic state alias",title:"String|Node|Function",subtitle:"String|Node|Function",emptyText:"string",slots:"{ header?, default?, icon?, title?, subtitle?, actions?, browse?, upload?, clear?, file?, fileName?, fileMeta?, fileActions?, empty? }"},slots:{header:"Content before the uploader",default:"Dropzone override (ctx: { api, dropzone })",icon:"Main icon",title:"Title content",subtitle:"Subtitle content",actions:"Actions area",browse:"Browse button",upload:"Upload button",clear:"Clear button",file:"Full file row renderer",fileName:"File name slot",fileMeta:"Status/error slot",fileActions:"Per-file actions",empty:"Empty list state"},events:["change","added","rejected","remove","start","progress","success","error","complete","finish","cancel","drop","factoryFailed"],returns:"HTMLDivElement with ._upload API, ._addFiles(files), ._uploadFiles(), ._browse(), ._dispose()"},v.meta.BoxUpload={...v.meta.Upload,signature:"UI.BoxUpload(props)",description:"Box-styled variant of UI.Upload."},v.meta.boxUpload=v.meta.BoxUpload);function kt(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=>je.reactive.effect(()=>{i(n())},e||"UI:model")}}return null}const uo={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"]}},Gl=t=>{const e=o(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},Kl=(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,l=[c&&s==="left"?"nav":i&&n==="left"?"aside":".","main",c&&s==="right"?"nav":i&&n==="right"?"aside":"."],b=[],R=[...t.rows||[]];if(c&&s==="top"&&!R.includes("nav")){const C=R.indexOf("body");R.splice(C>=0?C:R.length,0,"nav")}for(const C of R)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(l):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};v.Layout=(...t)=>{var un,nn,sn;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(ze,Ve)=>!!ze&&Object.prototype.hasOwnProperty.call(ze,Ve),c=()=>typeof window=="undefined"?1024:window.innerWidth,y=()=>{const ze=c(),Ve=JSswift.uiResponsivePropsFor(e,bn("mobile"))||{},et=ze>=768?JSswift.uiResponsivePropsFor(e,bn("tablet"))||{}:{},ct=ze>=1024?JSswift.uiResponsivePropsFor(e,bn("pc"))||{}:{};return{...Ve,...et,...ct}},a=(...ze)=>{for(const Ve of ze)if(i(e,Ve))return e[Ve]},l=(...ze)=>{const Ve=y();for(const et of ze)if(i(Ve,et))return Ve[et];return a(...ze)},b=(...ze)=>{const Ve=JSswift.uiResponsivePropsFor(e,bn(V()))||{};for(const et of ze)if(i(Ve,et))return Ve[et];return a(...ze)},R=()=>Gl(b("disposition","layoutDisposition","layout")),C=()=>{const ze=o(l("mode","layoutMode"));if(ze==null||ze===!1||ze==="")return"";const Ve=String(ze).trim().toLowerCase();return Ve==="global"||Ve==="local"?Ve:""},w=(ze,Ve=null)=>ze==null||ze===!1||ze===""?Ve:typeof ze=="number"?`${ze}px`:String(ze),T=(ze,Ve=null)=>{if(ze==null||ze===!1||ze==="")return Ve;if(typeof ze=="number"&&Number.isFinite(ze))return ze;const et=Number.parseFloat(String(ze));return Number.isFinite(et)?et:Ve},ee=ze=>{const Ve=o(ze);return Ve==null||Ve===!1||Ve===""?null:Array.isArray(Ve)?Ve.map(et=>`"${Array.isArray(et)?et.join(" "):String(et)}"`).join(" "):String(Ve)},K=(ze,Ve=null,et=null)=>{let ct=Number.isFinite(ze)?ze:0;return Number.isFinite(Ve)&&(ct=Math.max(Ve,ct)),Number.isFinite(et)&&(ct=Math.min(et,ct)),ct},re=a("header","headerContent"),H=a("aside","drawer"),j=a("nav","asideRight","drawerRight"),Y=a("page","main","content","body"),W=a("footer","footerContent"),ie=()=>o(l("drawerEnabled","asideEnabled")),ge=()=>o(l("navEnabled","asideRightEnabled","rightAsideEnabled")),ce=()=>ie()!==!1,le=()=>ge()===!0||o(l("noNav"))===!1,oe=()=>o(l("noDrawer"))===!0||ie()===!1||H===!1,ne=()=>o(l("noNav"))===!0||ge()===!1||j===!1,J=()=>o(l("drawerFloating"))===!0,Z=()=>o(l("navFloating"))===!0,X=()=>o(l("drawerResizable"))===!0,ue=()=>o(l("navResizable"))===!0,F=()=>T(o(l("drawerMinWidth")),180),f=()=>T(o(l("drawerMaxWidth")),null),m=()=>T(o(l("navMinWidth")),180),g=()=>T(o(l("navMaxWidth")),null),O=T(o(l("drawerWidth")),280),Q=T((un=o(l("navWidth")))!=null?un:o(l("asideRightWidth")),280),[r,x]=JSswift.reactive.signal(K(O,F(),f())),[p,P]=JSswift.reactive.signal(K(Q,m(),g())),U=kt(e.drawerOpen,"UI.Layout:drawerOpen"),G=U?!!U.get():typeof e.drawerOpen=="boolean"?!!e.drawerOpen:!0,[de,A]=JSswift.reactive.signal(G),u=ze=>{const Ve=!!ze;de()!==Ve&&A(Ve),U==null||U.set(Ve)};(nn=U==null?void 0:U.watch)==null||nn.call(U,()=>{const ze=!!U.get();de()!==ze&&A(ze)});const k=kt(e.navOpen,"UI.Layout:navOpen"),I=k?!!k.get():typeof e.navOpen=="boolean"?!!e.navOpen:!0,[B,pe]=JSswift.reactive.signal(I),Se=ze=>{const Ve=!!ze;B()!==Ve&&pe(Ve),k==null||k.set(Ve)};(sn=k==null?void 0:k.watch)==null||sn.call(k,()=>{const ze=!!k.get();B()!==ze&&pe(ze)});const ye=()=>{var ct,gt,pt;const ze=Number((ct=o(l("layoutBreakpoint")))!=null?ct:0),Ve=Number((gt=o(l("drawerBreakpoint")))!=null?gt:ze||1024),et=Number((pt=o(l("navBreakpoint")))!=null?pt:ze||Ve);return Math.max(Ve,et,0)},V=()=>{const ze=c();return ze>=1024?"pc":ze>=768?"tablet":"mobile"},[D,q]=JSswift.reactive.signal(!1),[Ne,ke]=JSswift.reactive.signal(V()),te=()=>{typeof window!="undefined"&&(ke(V()),q(window.innerWidth<ye()))};typeof window!="undefined"&&(te(),window.addEventListener("resize",te));const xe=()=>({props:e,openAside:()=>u(!0),closeAside:()=>u(!1),toggleAside:()=>u(!de()),openNav:()=>Se(!0),closeNav:()=>Se(!1),toggleNav:()=>Se(!B()),isDrawerOpen:()=>!!de(),isNavOpen:()=>!!B(),isMobile:()=>!!D(),isDrawerFloating:()=>J(),isNavFloating:()=>Z()}),be=(ze,Ve)=>{const et=xe();for(const gt of ze){if(!i(s,gt))continue;const pt=typeof s[gt]=="function"?s[gt](et):s[gt];return E(null,"default",et,pt)}const ct=typeof Ve=="function"?Ve(et):Ve;return E(null,"default",et,ct)},Ce=Y!==void 0?Y:n,he=ae(["cms-app","cms-layout",JSswift.uiResponsiveClasses({mobile:e},cn),JSswift.uiResponsiveClasses(e,cn),e.class]),Le=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"]);Le.class=he,Le.style={...e.style||{}},JSswift.uiApplyResponsiveProps(Le,e,JSswift.uiResponsiveStyleRules);const Ae=_.div(Le),we=o(l("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:ae(["cms-layout-shell-grid",e.shellClass])}),N=_[we.header]({class:ae(["cms-layout-section","cms-layout-header","header",me(e.stickyHeader,"sticky"),e.headerClass])}),S=_[we.aside]({class:ae(["cms-layout-section","cms-layout-aside","aside",me(e.stickyAside!==!1,"sticky"),e.asideClass]),role:"navigation","aria-hidden":"true"}),d=_.div({class:"cms-layout-panel-body cms-layout-aside-body"}),L=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-drawer","aria-hidden":"true"});S.appendChild(d),S.appendChild(L);const fe=_[we.nav]({class:ae(["cms-layout-section","cms-layout-nav","nav",me(e.stickyNav,"sticky"),e.navClass]),role:we.nav==="nav"?null:"complementary","aria-hidden":"true"}),Fe=_.div({class:"cms-layout-panel-body cms-layout-nav-body"}),Te=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-nav","aria-hidden":"true"});fe.appendChild(Fe),fe.appendChild(Te);const $=_[we.page]({class:ae(["cms-layout-section","cms-layout-main","main",e.pageClass]),role:we.page==="main"?null:"main"}),_e=_[we.footer]({class:ae(["cms-layout-section","cms-layout-footer","footer",me(e.stickyFooter,"sticky"),e.footerClass])});M.appendChild(N),M.appendChild(S),M.appendChild($),M.appendChild(fe),M.appendChild(_e),Ae.appendChild(M);const Re=_.div({class:ae(["cms-aside-overlay",e.overlayClass]),onClick:()=>{o(l("overlayClose"))!==!1&&(de()&&u(!1),B()&&Se(!1))}});Ae.appendChild(Re);let Pe=!1,De=!1,We=!1,qe=!1,Ze=!1,Qe=null,Ee=null;const Be=ze=>{!ze||typeof ze!="object"||(typeof ze._dispose=="function"&&ze._dispose(),!(!ze.childNodes||!ze.childNodes.length)&&Array.from(ze.childNodes).forEach(Be))},tt=ze=>{ze&&Array.from(ze.childNodes).forEach(Ve=>{Be(Ve),Ve.remove()})},nt=ze=>{const Ve=xe(),et=typeof ze=="function"?ze(Ve):ze;return E(null,"default",Ve,et)},dt=()=>{const ze=Pe?N.getBoundingClientRect().height:0;Ae.style.setProperty("--layout-header-height",`${ze}px`)},ut=(ze,Ve)=>(tt(ze),Ve.forEach(et=>ze.appendChild(et)),Ve.length>0),bt=()=>{var ct,gt,pt,Ct,yt,h;Ae.style.setProperty("--cms-layout-drawer-width",w((ct=o(l("drawerWidth")))!=null?ct:280,"280px")),Ae.style.setProperty("--cms-layout-nav-width",w((pt=(gt=o(l("navWidth")))!=null?gt:o(l("asideRightWidth")))!=null?pt:280,"280px")),Ae.style.setProperty("--cms-layout-drawer-peek",w((Ct=o(l("drawerPeek")))!=null?Ct:20,"20px")),Ae.style.setProperty("--cms-layout-nav-peek",w((h=(yt=o(l("navPeek")))!=null?yt:o(l("asideRightPeek")))!=null?h:20,"20px"));const ze=w(o(l("gap")),null);ze!=null?Ae.style.setProperty("--cms-layout-gap",ze):Ae.style.removeProperty("--cms-layout-gap");const Ve=w(o(l("headerOffset")),null);Ve!=null&&Ae.style.setProperty("--layout-header-height",Ve);const et=w(o(l("minHeight")),null);et!=null?Ae.style.setProperty("--cms-layout-min-height",et):Ae.style.removeProperty("--cms-layout-min-height")},ot=()=>{if(X()){const ze=K(r(),F(),f());ze!==r()&&x(ze),Ae.style.setProperty("--cms-layout-drawer-width",`${ze}px`)}if(ue()){const ze=K(p(),m(),g());ze!==p()&&P(ze),Ae.style.setProperty("--cms-layout-nav-width",`${ze}px`)}},ft=(ze,Ve)=>{if(Ve.button!==0)return;const et=ze==="drawer"?S:fe;if(et.hidden)return;const ct=ze==="drawer"?r:p,gt=ze==="drawer"?x:P,pt=ze==="drawer"?F:m,Ct=ze==="drawer"?f:g,yt=et.getBoundingClientRect(),h=yt.width||ct(),se=Me=>{const Je=ze==="drawer"?Me.clientX-yt.left:yt.right-Me.clientX;gt(K(Je||h,pt(),Ct())),ot(),at()},ve=()=>{Ae.classList.remove("is-resizing-layout"),document.removeEventListener("pointermove",se,!0),document.removeEventListener("pointerup",ve,!0),Ee=null};Ae.classList.add("is-resizing-layout"),document.addEventListener("pointermove",se,!0),document.addEventListener("pointerup",ve,!0),Ee=ve,Ve.preventDefault()},vt=ze=>ft("drawer",ze),At=ze=>ft("nav",ze);L.addEventListener("pointerdown",vt),Te.addEventListener("pointerdown",At);const at=()=>{const ze=!!D(),Ve=!!de(),et=!!B(),ct=!oe()&&ce()&&De,gt=!ne()&&le()&&We,pt=ct&&(ze||J()),Ct=gt&&(ze||Z()),yt=ct&&Ve,h=gt&&et,se=yt&&!pt,ve=h&&!Ct,Me=se&&X(),Je=ve&&ue(),Oe=yt&&pt||h&&Ct;bt(),ot(),Ae.classList.toggle("is-mobile",ze),Ae.classList.toggle("drawer-open",yt),Ae.classList.toggle("nav-open",h),Ae.classList.toggle("no-drawer",!ct),Ae.classList.toggle("no-nav",!gt),Ae.classList.toggle("has-header",Pe),Ae.classList.toggle("has-drawer",ct),Ae.classList.toggle("has-nav",gt),Ae.classList.toggle("has-footer",Ze),Ae.classList.toggle("drawer-floating",pt),Ae.classList.toggle("nav-floating",Ct);const He=R(),Xe=He?C():"";Ae.dataset.disposition=He||"",Ae.dataset.layoutMode=Xe||"",Ae.classList.toggle("has-disposition",!!He),Ae.classList.toggle("mode-local",Xe==="local"),Ae.classList.toggle("mode-global",Xe==="global"),N.classList.toggle("sticky",o(l("stickyHeader"))===!0),_e.classList.toggle("sticky",o(l("stickyFooter"))===!0),S.classList.toggle("sticky",o(l("stickyAside"))!==!1),fe.classList.toggle("sticky",o(l("stickyNav"))===!0),N.hidden=!Pe,_e.hidden=!Ze,$.hidden=!qe,Re.hidden=!(pt||Ct),Re.classList.toggle("show",Oe),S.hidden=!ct||!yt&&!pt,S.classList.toggle("open",yt),S.classList.toggle("is-floating",pt),S.classList.toggle("is-resizable",Me),S.setAttribute("aria-hidden",yt?"false":"true"),L.hidden=!Me,fe.hidden=!gt||!h&&!Ct,fe.classList.toggle("open",h),fe.classList.toggle("is-floating",Ct),fe.classList.toggle("is-resizable",Je),fe.setAttribute("aria-hidden",h?"false":"true"),Te.hidden=!Je;const it=uo[He]||null,ht=(it==null?void 0:it.side)||(se&&it?"left":null),xt=(it==null?void 0:it.nav)||(ve&&it?"top":null),$t=se?it?ht:"left":"",zt=ve?it?xt==="left"||xt==="right"?xt:"":"right":"";Ae.classList.toggle("drawer-left",ct&&ht==="left"),Ae.classList.toggle("drawer-right",ct&&ht==="right"),Ae.classList.toggle("nav-top",ve&&xt==="top"),Ae.classList.toggle("nav-side",ve&&(zt==="left"||zt==="right")),M.style.gridTemplateColumns=[$t==="left"?"minmax(0, var(--cms-layout-drawer-width))":zt==="left"?"minmax(0, var(--cms-layout-nav-width))":"0px","minmax(0, 1fr)",$t==="right"?"minmax(0, var(--cms-layout-drawer-width))":zt==="right"?"minmax(0, var(--cms-layout-nav-width))":"0px"].join(" ");const Ft=['"header header header"',`"${se?"aside":"."} main ${ve?"nav":"."}"`,'"footer footer footer"'].join(" "),on=Kl(uo[He],{header:Pe,aside:se,nav:ve,main:qe,footer:Ze});M.style.gridTemplateAreas=ee(b("areas","gridTemplateAreas","templateAreas"))||on||Ft},Vt=(ze,Ve)=>(Pe=ut(N,nt(ze)),dt(),at(),Ve&&JSswift.router.setURLOnly(Ve),N),Jt=(ze,Ve)=>(De=ut(d,nt(ze)),De||u(!1),at(),Ve&&JSswift.router.setURLOnly(Ve),S),wt=(ze,Ve)=>(We=ut(Fe,nt(ze)),We||Se(!1),at(),Ve&&JSswift.router.setURLOnly(Ve),fe),qt=(ze,Ve)=>(qe=ut($,nt(ze)),at(),Ve&&JSswift.router.setURLOnly(Ve),$),St=(ze,Ve)=>(Ze=ut(_e,nt(ze)),at(),Ve&&JSswift.router.setURLOnly(Ve),_e);Pe=ut(N,be(["header"],re)),De=ut(d,H===!1?[]:be(["aside","drawer"],H)),We=ut(Fe,j===!1?[]:be(["nav","asideRight","drawerRight"],j)),qe=ut($,be(["page","main","default"],Ce)),Ze=ut(_e,be(["footer"],W)),typeof ResizeObserver!="undefined"&&(Qe=new ResizeObserver(()=>dt()),Qe.observe(N)),dt(),JSswift.reactive.effect(()=>{Ne(),D(),de(),B(),at()},"UI.Layout:state");const dn=ze=>{o(l("escClose"))!==!1&&(!D()&&!J()&&!Z()||!de()&&!B()||ze.key==="Escape"&&(ze.preventDefault(),de()&&u(!1),B()&&Se(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",dn,!0),Ae.openAside=()=>u(!0),Ae.closeAside=()=>u(!1),Ae.toggleAside=()=>u(!de()),Ae.openNav=()=>Se(!0),Ae.closeNav=()=>Se(!1),Ae.toggleNav=()=>Se(!B()),Ae.isDrawerOpen=()=>!!de(),Ae.isNavOpen=()=>!!B(),Ae.isMobile=()=>!!D(),Ae.header=()=>N,Ae.aside=()=>S,Ae.drawer=()=>S,Ae.nav=()=>fe,Ae.page=()=>$,Ae.main=()=>$,Ae.footer=()=>_e,Ae.headerUpdate=Vt,Ae.asideUpdate=Jt,Ae.drawerUpdate=Jt,Ae.navUpdate=wt,Ae.pageUpdate=qt,Ae.mainUpdate=qt,Ae.footerUpdate=St,Ae.reflow=at,Ae._dispose=()=>{var ze;typeof window!="undefined"&&window.removeEventListener("resize",te),typeof document!="undefined"&&document.removeEventListener("keydown",dn,!0),L.removeEventListener("pointerdown",vt),Te.removeEventListener("pointerdown",At),Ee==null||Ee(),(ze=Qe==null?void 0:Qe.disconnect)==null||ze.call(Qe)},Ke(Ae,e),at(),Ae},(Bo=JSswift.isDev)!=null&&Bo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Layout={signature:"UI.Layout(...children) | UI.Layout(props, ...children)",props:{header:"Node|Function|Array",headerContent:"Node|Function|Array",aside:"Node|Function|Array|false",drawer:"Node|Function|Array|false",nav:"Node|Function|Array|false",asideRight:"Node|Function|Array|false",drawerRight:"Node|Function|Array|false",page:"Node|Function|Array",main:"Node|Function|Array",content:"Node|Function|Array",body:"Node|Function|Array",footer:"Node|Function|Array",footerContent:"Node|Function|Array",noDrawer:"boolean",drawerEnabled:"boolean",asideEnabled:"boolean",noNav:"boolean",navEnabled:"boolean",asideRightEnabled:"boolean",drawerOpen:"rod | [get,set] signal | boolean",navOpen:"rod | [get,set] signal | boolean",layoutBreakpoint:"number(px)",drawerBreakpoint:"number(px)",navBreakpoint:"number(px)",drawerWidth:"number|string",drawerResizable:"boolean",drawerMinWidth:"number|string",drawerMaxWidth:"number|string",navWidth:"number|string",navResizable:"boolean",navMinWidth:"number|string",navMaxWidth:"number|string",asideRightWidth:"number|string",drawerPeek:"number|string",navPeek:"number|string",asideRightPeek:"number|string",drawerFloating:"boolean",navFloating:"boolean",overlayClose:"boolean",escClose:"boolean",stickyHeader:"boolean",stickyFooter:"boolean",stickyAside:"boolean",stickyNav:"boolean",tagPage:"boolean",mode:"local|global",layoutMode:"alias di mode",disposition:"classic|classicRight|sidebarFullLeft|sidebarFullRight|appShell|dashboard|website|documentation|landing",layoutDisposition:"alias di disposition",layout:"alias di disposition",gap:"number|string",headerOffset:"number|string",minHeight:"number|string",areas:"string|array",gridTemplateAreas:"string|array",templateAreas:"string|array",mobile:"{ disposition?, mode?, gap?, minHeight?, areas?, gridTemplateAreas?, drawerWidth?, navWidth?, drawerFloating?, navFloating?, noDrawer?, noNav? }",tablet:"{ disposition?, mode?, gap?, minHeight?, areas?, gridTemplateAreas?, drawerWidth?, navWidth?, drawerFloating?, navFloating?, noDrawer?, noNav? }",pc:"{ disposition?, mode?, gap?, minHeight?, areas?, gridTemplateAreas?, drawerWidth?, navWidth?, drawerFloating?, navFloating?, noDrawer?, noNav? }",shellClass:"string",headerClass:"string",asideClass:"string",navClass:"string",pageClass:"string",footerClass:"string",overlayClass:"string",slots:"{ header?, aside?, drawer?, nav?, asideRight?, drawerRight?, page?, main?, footer?, default? }",class:"string",style:"object"},slots:{header:"Header content",aside:"Aside / drawer content",drawer:"Alias of aside",nav:"Right-side panel content",asideRight:"Alias of nav",drawerRight:"Alias of nav",page:"Page content",main:"Alias of page",footer:"Footer content",default:"Fallback page content"},returns:"HTMLDivElement with openAside/closeAside/toggleAside/openNav/closeNav/toggleNav methods, isDrawerOpen/isNavOpen/isMobile/reflow, header()/aside()/nav()/page()/footer(), headerUpdate/asideUpdate/navUpdate/pageUpdate/mainUpdate/footerUpdate and _dispose()",description:"Composable shell layout with independent left drawer and right nav, configurable widths, optional resize with min/max, optional floating mode, and runtime section updates."}),v.Footer=(...t)=>{var ue,F,f;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=m=>Object.prototype.hasOwnProperty.call(e,m),c={props:e},y=(m,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(O=>y(m,O));return}if(g!=null&&g.nodeType){m.appendChild(g);return}m.appendChild(document.createTextNode(String(g)))}},a=(m,g,O=Q=>Q)=>{const Q=JSswift.ui.getSlot(s,m);if(Q!=null)return E(s,m,c,null);if(typeof g=="function"){const r=new Set(["eyebrow","title","subtitle"]),x=_[r.has(m)?"span":"div"]({class:`cms-footer-slot-${m}`});return JSswift.reactive.effect(()=>{const p=O(g(c)),P=rn(JSswift.ui.slot(p));x.replaceChildren(),Array.isArray(P)?P.forEach(U=>y(x,U)):y(x,P)},`UI.Footer:${m}`),[x]}return E(s,m,c,O(g))},l=(m,g="icon",O=e.iconSize||e.size||"md")=>m==null||m===!1?null:typeof m=="string"?v.Icon({name:m,size:O}):JSswift.ui.slot(m,{as:g}),b=i("left")?e.left:e.start,R=i("right")?e.right:e.end,C=i("title")?e.title:e.label,w=(F=(ue=e.subtitle)!=null?ue:e.description)!=null?F:e.note,T=i("content")?e.content:i("body")?e.body:n!=null&&n.length?n:null,ee=[...a("left",b),...a("start",null)],K=a("icon",e.icon,l),re=a("eyebrow",(f=e.eyebrow)!=null?f:e.kicker),H=a("title",C),j=a("subtitle",w),Y=a("meta",e.meta),W=(()=>{const m=a("content",null);return m.length?m:a("default",T)})(),ie=[...a("center",null),...a("body",null)],ge=[...a("right",R),...a("end",null)],ce=a("actions",e.actions),le=_.div({class:ae(["cms-footer-body",e.bodyClass,e.centerClass])},_.div({class:"cms-footer-heading"},K.length?_.div({class:"cms-footer-icon"},...K):null,_.div({class:"cms-footer-copy"},re.length?_.div({class:ae(["cms-footer-eyebrow",e.eyebrowClass])},...re):null,H.length?_.div({class:ae(["cms-footer-title",e.titleClass])},...H):null,j.length?_.div({class:ae(["cms-footer-subtitle",e.subtitleClass])},...j):null,W.length?_.div({class:ae(["cms-footer-content",e.contentClass])},...W):null),Y.length?_.div({class:ae(["cms-footer-meta",e.metaClass])},...Y):null)),oe=[];ie.length?oe.push(_.div({class:ae(["cms-footer-body",e.bodyClass,e.centerClass])},...ie)):(K.length||re.length||H.length||j.length||W.length||Y.length)&&oe.push(le),(ge.length||ce.length)&&oe.push(_.div({class:ae(["cms-footer-end",e.endClass])},...ge,...ce.length?[_.div({class:ae(["cms-footer-actions",e.actionsClass])},...ce)]:[]));const ne=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"]);ne.class=ae(["cms-panel","cms-footer","cms-singularity",me(e.sticky,"sticky"),me(e.dense,"dense"),me(e.elevated,"elevated"),me(e.divider!==!1,"divider"),me(e.stack,"stack"),co(e.align,"align-"),e.class]),ne.style={...e.style||{}};const J=Ie(e.justify);J!=null&&(ne.style.justifyContent=J);const Z=Ie(e.wrap,m=>m?"wrap":"nowrap");Z!=null&&(ne.style.flexWrap=Z),e.gap!=null&&(ne.style["--cms-footer-gap"]=$e(o(e.gap))),e.minHeight!=null&&(ne.style.minHeight=$e(o(e.minHeight))),JSswift.uiApplyResponsiveProps(ne,e,JSswift.uiResponsiveStyleRules);const X=_.footer(ne,...ee.length?[_.div({class:ae(["cms-footer-start",e.startClass])},...ee)]:[],...oe.length?[_.div({class:"cms-footer-main"},...oe)]:[]);return Ke(X,e),X},(Uo=JSswift.isDev)!=null&&Uo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Footer={signature:"UI.Footer(...children) | UI.Footer(props, ...children)",props:{title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",eyebrow:"String|Node|Function|Array",content:"Node|Function|Array",meta:"Node|Function|Array",icon:"String|Node|Function|Array",left:"Node|Function|Array",start:"Alias of left",right:"Node|Function|Array",end:"Alias of right",body:"Alias of content",actions:"Node|Function|Array",sticky:"boolean",dense:"boolean",elevated:"boolean",divider:"boolean",align:"left|center|right",justify:"flex-start|center|flex-end|space-between|space-around|space-evenly",wrap:"boolean",stack:"boolean",gap:"string|number",minHeight:"string|number",slots:"{ left?, start?, right?, end?, center?, body?, icon?, eyebrow?, title?, subtitle?, meta?, content?, actions?, default? }",class:"string",style:"object"},slots:{left:"Footer leading area",start:"Alias/addon for the leading area",right:"Footer trailing area",end:"Alias/addon for the trailing area",center:"Full override for the central body",body:"Alias of center",icon:"Leading icon",eyebrow:"Eyebrow / kicker",title:"Main title",subtitle:"Subtitle or note",meta:"Meta info next to the central content",content:"Extra content or children fallback",actions:"Actions grouped in the trailing area",default:"Fallback content for the body area"},returns:"HTMLElement <footer>",description:"Structured footer with start/body/end regions, optional copy, actions, and composable slots."});const _r=t=>{const e=[];for(const n of t||[]){const s=rn(JSswift.ui.slot(n));s&&(Array.isArray(s)?e.push(...s):e.push(s))}return e},Ln=(t,e)=>{const n=rn(JSswift.ui.slot(t,e));return n?Array.isArray(n)?n:[n]:[]},$e=t=>{var e;return typeof t=="number"?`${t}px`:typeof t=="string"&&((e=JSswift.uiSizes)!=null&&e.includes(t))?`var(--cms-size-${t})`:String(t)};v.Toolbar=(...t)=>{var g,O,Q,r,x,p,P,U;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(G,de,A={})=>{const u=Array.isArray(G)?G:[G];for(const k of u)if(JSswift.ui.getSlot(s,k)!=null)return E(s,k,A,de);return de==null?[]:E(null,"default",A,de)},c=G=>(Array.isArray(G)?G:[G]).some(A=>JSswift.ui.getSlot(s,A)!=null),y={props:e},a=i(["before"],e.before,y),l=i(["start","left"],(g=e.start)!=null?g:e.left,y),b=i(["center","body","content","default"],(r=(Q=(O=e.center)!=null?O:e.body)!=null?Q:e.content)!=null?r:n,y),R=i(["end","right","actions"],(p=(x=e.end)!=null?x:e.right)!=null?p:e.actions,y),C=i(["after"],e.after,y),w=i(["title"],e.title,y),T=i(["subtitle"],e.subtitle,y),ee=i(["meta"],e.meta,y),K=!!(a.length||l.length||R.length||C.length||w.length||T.length||ee.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"])),re=ae(["cms-toolbar",me(K,"structured"),me(e.dense,"dense"),me(e.divider,"divider"),me(e.elevated,"elevated"),me(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=re;const j={...e.style||{}};j.display=j.display||"flex";const Y=Ie(e.align),W=Ie(e.justify),ie=Ie(e.wrap,G=>typeof G=="boolean"?G?"wrap":"nowrap":String(G),"wrap"),ge=Ie(e.gap,$e,"var(--cms-s-md)"),ce=Ue(e,"gap");j["--cms-toolbar-gap"]=ge!=null?ge:"var(--cms-s-md)",ce||(j.gap=j.gap||"var(--cms-toolbar-gap)");const le={xxs:"4px 6px",xs:"6px 8px",sm:"6px 10px",md:"10px 12px",lg:"12px 16px",xl:"14px 18px",xxl:"16px 20px"},oe=Ie(e.size,G=>le[G]||"");if(oe!=null&&(j.padding=oe),K?(j.flexDirection=j.flexDirection||"column",j.alignItems=j.alignItems||"stretch"):(Y!=null&&(j.alignItems=Y),W!=null&&(j.justifyContent=W),ie!=null&&(j.flexWrap=ie)),Object.keys(j).length&&(H.style=j),JSswift.uiApplyResponsiveProps(H,e,JSswift.uiResponsiveStyleRules),!K){const G=E(s,"default",y,n),de=_.div(H,...G);return Ke(de,e),de}const ne=(U=(P=e.bodyClass)!=null?P:e.centerClass)!=null?U:e.contentClass,J=Ye([e.justify],()=>{const G=o(e.justify);return!G||G==="flex-start"?"auto":""}),Z={display:"flex",alignItems:"inherit",gap:"var(--cms-toolbar-gap)",flexWrap:"inherit",minWidth:0},X={};Y!=null&&(X.alignItems=Y),W!=null&&(X.justifyContent=W),ie!=null&&(X.flexWrap=ie);const ue=ee.length||w.length||T.length?_.div({class:ae(["cms-toolbar-copy",e.copyClass])},ee.length?_.div({class:ae(["cms-toolbar-meta",e.metaClass])},...ee):null,w.length?_.div({class:ae(["cms-toolbar-title",e.titleClass])},...w):null,T.length?_.div({class:ae(["cms-toolbar-subtitle",e.subtitleClass])},...T):null):null,F=!!(l.length||ue||b.length||R.length),f=[a.length?_.div({class:ae(["cms-toolbar-before",e.beforeClass]),style:{...Z}},...a):null,F?_.div({class:"cms-toolbar-main",style:X},l.length?_.div({class:ae(["cms-toolbar-start",e.startClass]),style:{...Z}},...l):null,ue||b.length?_.div({class:ae(["cms-toolbar-center",ne]),style:{...Z,flex:"1 1 240px"}},ue,...b):null,R.length?_.div({class:ae(["cms-toolbar-end",e.endClass]),style:{...Z,justifyContent:"flex-end",marginInlineStart:J}},...R):null):null,C.length?_.div({class:ae(["cms-toolbar-after",e.afterClass]),style:{...Z}},...C):null].filter(Boolean),m=_.div(H,...f);return Ke(m,e),m},(Wo=JSswift.isDev)!=null&&Wo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Toolbar={signature:"UI.Toolbar(...children) | UI.Toolbar(props, ...children)",props:{before:"Node|Function|Array",start:"Node|Function|Array",left:"Alias of start",center:"Node|Function|Array",body:"Alias of center",content:"Alias of center",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",meta:"String|Node|Function|Array",end:"Node|Function|Array",right:"Alias of end",actions:"Alias of end",after:"Node|Function|Array",dense:"boolean",divider:"boolean",elevated:"boolean",sticky:"boolean",wrap:"boolean|string",align:"stretch|flex-start|center|flex-end|baseline",justify:"flex-start|center|flex-end|space-between|space-around|space-evenly",gap:"string|number (e.g. '8px' or 'var(--cms-s-md)')",size:"xxs|xs|sm|md|lg|xl|xxl",beforeClass:"string",startClass:"string",bodyClass:"string",centerClass:"Alias of bodyClass",contentClass:"Alias of bodyClass",copyClass:"string",titleClass:"string",subtitleClass:"string",metaClass:"string",endClass:"string",afterClass:"string",slots:"{ before?, start?, left?, center?, body?, content?, title?, subtitle?, meta?, end?, right?, actions?, after?, default? }",class:"string",style:"object"},slots:{before:"Optional top row",start:"Leading content area",left:"Alias of start",center:"Main content area",body:"Alias of center",content:"Alias of center",title:"Toolbar main title",subtitle:"Subtitle or operational note",meta:"Meta info/chips above or next to the title",end:"Trailing actions area",right:"Alias of end",actions:"Alias of end",after:"Optional bottom row",default:"Fallback content / children"},events:{onClick:"MouseEvent"},description:"Composable toolbar with before/start/center/end/after regions, optional copy, and fallback compatible with simple flex usage.",returns:"HTMLDivElement"});const ql=t=>{var e;return t&&t.nodeType===1&&((e=t.classList)==null?void 0:e.contains("cms-grid-col"))};v.Grid=(...t)=>{var m,g,O,Q;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=o(e.items),c=Array.isArray(i)?i:i==null?[]:[i],y=(r={})=>{const x=e.itemProps||{},p={...x,...r};return p.class=ae([x.class,e.itemClass,r.class]),p.style={...x.style||{},...e.itemStyle||{},...r.style||{}},p},a=(r,x={})=>{if(r==null||r===!1)return[];if(ql(r))return[r];if(kn(r)){const p=r.children!=null?en(r.children):r.content!=null?en(r.content):r.node!=null?en(r.node):r.label!=null?en(r.label):[];return[v.GridCol(y(r),...p)]}return Array.isArray(r)?[v.GridCol(y(x),...r)]:[v.GridCol(y(x),r)]},l=(r,x,p,P=!0)=>{if(r==null||r===!1)return[];const U=kn(r)?r:{};if(P){const G={item:r,index:x,count:p,first:x===0,last:x===p-1},de=E(s,"item",G,null);if(de.length)return de.flatMap(A=>a(A,U))}return a(r,U)},b=[];c.forEach((r,x)=>{b.push(...l(r,x,c.length))}),E(s,"default",{items:c,count:c.length},n).forEach(r=>{b.push(...a(r))}),b.length||E(s,"empty",{items:c,count:0},e.empty).forEach(x=>{const p=a(x,{style:{gridColumn:"1 / -1"}});b.push(...p)});const C=ae(["cms-grid",JSswift.uiResponsiveClasses({mobile:e},ro),JSswift.uiResponsiveClasses(e,ro),me(e.dense,"dense"),me(e.inline,"cms-grid-inline"),me(e.debug,"cms-grid-debug"),e.class]),w=JSswift.omit(e,["gap","rowGap","columnGap","colGap","cols","columns","rows","areas","align","justify","alignItems","justifyItems","placeItems","placeContent","dense","flow","inline","debug","autoFit","autoFill","min","max","autoRows","items","itemClass","itemStyle","itemProps","empty","slots","full","width","minWidth","maxWidth","padding",...JSswift.uiResponsiveOmitProps]);w.class=C;const T={...e.style||{}};(m=JSswift.uiResponsiveHasConfig)!=null&&m.call(JSswift,e)&&e.display==null&&!Ue(e,"display")&&T.display==null&&(T.display=e.inline?"inline-grid":"grid");const ee=Ie(e.gap,$e);ee!=null&&!Ue(e,"gap")&&(T["--cms-grid-gap"]=ee,T.gap=ee);const K=Ie(e.rowGap,$e);K!=null&&!Ue(e,"rowGap")&&(T.rowGap=K);const re=Ie((g=e.columnGap)!=null?g:e.colGap,$e);re!=null&&!Ue(e,["columnGap","colGap"])&&(T.columnGap=re);const H=Ie(e.max,$e,"1fr"),j=Ie(e.min,$e);if(j!=null){const r=o(e.autoFill)?"auto-fill":"auto-fit";T.gridTemplateColumns=`repeat(${r}, minmax(${j}, ${H||"1fr"}))`}else{const r=Ie((O=e.columns)!=null?O:e.cols,x=>typeof x=="number"?`repeat(${x}, minmax(0, 1fr))`:String(x));r!=null&&!Ue(e,["cols","columns"])&&(T.gridTemplateColumns=r)}const Y=Ie(e.rows,r=>typeof r=="number"?`repeat(${r}, minmax(0, auto))`:String(r));Y!=null&&(T.gridTemplateRows=Y);const W=Ie(e.autoRows,$e);W!=null&&(T.gridAutoRows=W);const ie=Ie(e.flow,r=>{const x=String(r);return e.dense&&!x.includes("dense")?`${x} dense`:x});ie!=null&&!Ue(e,"flow")&&(T.gridAutoFlow=ie);const ge=Ie(e.areas,r=>Array.isArray(r)?r.map(x=>`"${Array.isArray(x)?x.join(" "):String(x)}"`).join(" "):String(r));ge!=null&&(T.gridTemplateAreas=ge);const ce=Ie((Q=e.align)!=null?Q:e.alignItems);ce!=null&&!Ue(e,["align","alignItems"])&&(T.alignItems=ce);const le=Ie(e.justify);le!=null&&!Ue(e,"justify")&&(T.justifyContent=le);const oe=Ie(e.justifyItems);oe!=null&&(T.justifyItems=oe);const ne=Ie(e.placeItems);ne!=null&&(T.placeItems=ne);const J=Ie(e.placeContent);J!=null&&(T.placeContent=J);const Z=Ie(e.width,$e);Z!=null&&!Ue(e,"width")&&(T.width=Z),o(e.full)===!0&&(T.width="100%");const X=Ie(e.minWidth,$e);X!=null&&!Ue(e,"minWidth")&&(T.minWidth=X);const ue=Ie(e.maxWidth,$e);ue!=null&&!Ue(e,"maxWidth")&&(T.maxWidth=ue);const F=Ie(e.padding,$e);F!=null&&!Ue(e,"padding")&&(T.padding=F),Object.keys(T).length&&(w.style=T),JSswift.uiApplyResponsiveProps(w,e,JSswift.uiResponsiveStyleRules);const f=_.div(w,...b);return Ke(f,e),f},(Go=JSswift.isDev)!=null&&Go.call(JSswift)&&(v.meta=v.meta||{},v.meta.Grid={signature:"UI.Grid(...children) | UI.Grid(props, ...children)",props:{cols:"number|string",columns:"alias di cols",min:"string|number (auto-fit/auto-fill min width)",max:"string|number (max track size, default 1fr)",gap:"string|number",rowGap:"string|number",columnGap:"string|number",colGap:"alias di columnGap",rows:"number|string",autoRows:"string|number",areas:"string|array",flow:"row|column|dense|row dense|column dense",align:"stretch|start|center|end",alignItems:"alias di align",justify:"start|center|end|space-between|space-around|space-evenly",justifyItems:"stretch|start|center|end",placeItems:"string",placeContent:"string",dense:"boolean",inline:"boolean",debug:"boolean",autoFit:"boolean",autoFill:"boolean",full:"boolean",width:"string|number",minWidth:"string|number",maxWidth:"string|number",padding:"string|number",mobile:"{ cols?, gap?, flow?, width?, padding? }",tablet:"{ cols?, gap?, flow?, width?, padding? }",pc:"{ cols?, gap?, flow?, width?, padding? }",items:"Array<Node|Object|string>",itemClass:"string",itemStyle:"object",itemProps:"object",empty:"String|Node|Function|Array",slots:"{ default?, item?, empty? }",class:"string",style:"object"},slots:{default:"Grid content fallback",item:"Render custom di ogni item ({ item, index, count, first, last })",empty:"Empty state della griglia"},returns:"HTMLDivElement",description:"Griglia dichiarativa per layout responsive: supporta children, items/slot item, auto-fit, template custom e empty state."}),v.GridCol=(...t)=>{var Ce,he,Le,Ae,z,we,M,N;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=S=>Object.prototype.hasOwnProperty.call(e,S),c=(S,d,L={})=>{const fe=Array.isArray(S)?S:[S];for(const Fe of fe)if(JSswift.ui.getSlot(s,Fe)!=null)return E(s,Fe,L,d);return d==null?[]:E(null,"default",L,d)},y=S=>{var d;return S==null||S===!1||S===""?"":typeof S=="string"&&((d=JSswift.uiSizes)!=null&&d.includes(S))?`var(--cms-s-${S})`:$e(S)},a=S=>{var d;return S==null||S===!1||S===""?"":typeof S=="string"&&((d=JSswift.uiSizes)!=null&&d.includes(S))?gs(S,"size"):$e(S)},l={...e.style||{}},b=S=>{if(S==null||S==="")return null;if(S==="auto")return"auto";if(S==="full"||S===!0)return"1 / -1";const d=Number(S);if(Number.isFinite(d)&&d>0){const L=Math.max(1,Math.round(d));return`span ${L} / span ${L}`}return String(S)},R=S=>{if(S==null||S==="")return null;if(S==="full"||S===!0)return"1 / -1";const d=Number(S);if(Number.isFinite(d)&&d>0){const L=Math.max(1,Math.round(d));return`span ${L} / span ${L}`}return String(S)},C=i("span")?e.span:e.col,w=Ie(C,b),T=Ie(e.sm,b),ee=Ie(e.md,b),K=Ie(e.lg,b),re=JSswift.uiResponsivePropsFor(e,bn("tablet"))||{},H=JSswift.uiResponsivePropsFor(e,bn("pc"))||{},j=(Ce=re.span)!=null?Ce:re.col,Y=(he=H.span)!=null?he:H.col,W=Ie(j,b),ie=Ie(Y,b),ge=Ie(e.rowSpan,R),ce=Ie(e.row,R),le=Ie(e.area),oe=Ie(e.align),ne=Ie(e.justify),J=Ie(e.place),Z=Ie(e.gap,y),X=Ie(e.rowGap,y),ue=Ie(e.columnGap,y),F=Ie(e.padding,y),f=Ie(e.width,a),m=Ie(e.minHeight,a),g=Ie(e.height,a),O=Ie(e.maxHeight,a),Q=Ie(e.contentAlign),r=Ie(e.contentJustify),x=Ie(e.direction),p=Ie(e.scroll,S=>S===!0?"auto":String(S),""),P=Ie(e.fullHeight,S=>S?"100%":"",""),U=Ye([e.center,e.contentAlign,e.contentJustify],()=>!!o(e.center)&&(o(e.contentAlign)==null||o(e.contentAlign)==="")&&(o(e.contentJustify)==null||o(e.contentJustify)==="")),G={props:e},de=c(["start","top","header","before"],(z=(Ae=(Le=e.start)!=null?Le:e.top)!=null?Ae:e.header)!=null?z:e.before,G),A=i("body")?e.body:i("content")?e.content:n,u=c(["body","content","default"],A,G),k=c(["end","bottom","footer","after"],(N=(M=(we=e.end)!=null?we:e.bottom)!=null?M:e.footer)!=null?N:e.after,G),I=de.length||k.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,B=Ye([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(d=>d!=null&&d!==!1&&d!=="")?!0:!!o(e.center)),pe=Ye([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"]:[]),Se=ae(["cms-grid-col",pe,JSswift.uiResponsiveClasses({mobile:e},ao),JSswift.uiResponsiveClasses(e,ao),me(e.panel,"cms-grid-col-panel"),me(e.auto,"is-auto"),me(B,"cms-grid-col-stack"),me(e.inline,"cms-grid-col-inline"),me(U,"cms-grid-col-center"),e.class]),ye=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]);ye.class=Se,l["--cms-grid-col-base"]==null&&(l["--cms-grid-col-base"]="auto"),l["--cms-grid-col-tablet"]==null&&(l["--cms-grid-col-tablet"]="var(--cms-grid-col-base, auto)"),l["--cms-grid-col-pc"]==null&&(l["--cms-grid-col-pc"]="var(--cms-grid-col-tablet, var(--cms-grid-col-base, auto))"),o(e.auto)===!0?l["--cms-grid-col-base"]="auto":w!=null&&(l["--cms-grid-col-base"]=w),T!=null&&(l["--cms-grid-col-sm"]=T),ee!=null&&(l["--cms-grid-col-md"]=ee),K!=null&&(l["--cms-grid-col-lg"]=K),W!=null&&(l["--cms-grid-col-tablet"]=W),ie!=null&&(l["--cms-grid-col-pc"]=ie),ge!=null?l.gridRow=ge:ce!=null&&(l.gridRow=ce),le!=null&&(l.gridArea=le),oe!=null&&!Ue(e,"align")&&(l.alignSelf=oe),ne!=null&&!Ue(e,"justify")&&(l.justifySelf=ne),J!=null&&!Ue(e,"place")&&(l.placeSelf=J),Z!=null&&!Ue(e,"gap")&&(l.gap=Z),X!=null&&!Ue(e,"rowGap")&&(l.rowGap=X),ue!=null&&!Ue(e,"columnGap")&&(l.columnGap=ue),F!=null&&!Ue(e,"padding")&&(l.padding=F),f!=null&&!Ue(e,"width")&&(l.width=f),P!=null&&P!==""?l.height=P:g!=null&&!Ue(e,"height")&&(l.height=g),m!=null&&!Ue(e,"minHeight")&&(l.minHeight=m),O!=null&&!Ue(e,"maxHeight")&&(l.maxHeight=O),x!=null&&!Ue(e,"direction")&&(l.flexDirection=x),Q!=null&&!Ue(e,"contentAlign")?l.alignItems=Q:U!=null&&U!==""&&(l.alignItems=U?"center":""),r!=null&&!Ue(e,"contentJustify")?l.justifyContent=r:U!=null&&U!==""&&(l.justifyContent=U?"center":""),p!=null&&p!==""&&(l.overflow=p),Object.keys(l).length&&(ye.style=l),JSswift.uiApplyResponsiveProps(ye,e,Ul);const V=e.onClick,D=e.onKeydown,q=!!(o(e.clickable)||o(e.to)),Ne=S=>{var L;if(V==null||V(S),S.defaultPrevented)return;const d=o(e.to);d&&((L=JSswift.router)!=null&&L.navigate)&&(S.preventDefault(),JSswift.router.navigate(d))},ke=S=>{D==null||D(S),!S.defaultPrevented&&(S.key==="Enter"||S.key===" ")&&(S.preventDefault(),Ne(S))};if(q&&(ye.onClick=Ne,ye.onKeydown=ke,ye.tabIndex==null&&(ye.tabIndex=0),ye.role==null&&(ye.role="button")),!I){const S=_.div(ye,...E(s,"default",G,n));return Ke(S,e),S}const te={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},xe=[de.length?_.div({class:ae(["cms-grid-col-start",e.startClass,e.topClass,e.headerClass]),style:{...te}},...de):null,u.length?_.div({class:ae(["cms-grid-col-body",e.bodyClass,e.contentClass]),style:{...te,flex:"1 1 auto"}},...u):null,k.length?_.div({class:ae(["cms-grid-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...te}},...k):null].filter(Boolean),be=_.div(ye,...xe);return Ke(be,e),be},(Ko=JSswift.isDev)!=null&&Ko.call(JSswift)&&(v.meta=v.meta||{},v.meta.GridCol={signature:"UI.GridCol(...children) | UI.GridCol(props, ...children)",props:{span:"number|string",col:"alias di span",sm:"number|string",md:"number|string",lg:"number|string",auto:"boolean",row:"number|string",rowSpan:"number|string",area:"string",align:"string (align-self)",justify:"string (justify-self)",place:"string (place-self)",gap:"string|number",rowGap:"string|number",columnGap:"string|number",padding:"string|number",width:"string|number",height:"string|number",minHeight:"string|number",maxHeight:"string|number",fullHeight:"boolean",stack:"boolean",inline:"boolean",direction:"column|row|string",contentAlign:"string",contentJustify:"string",center:"boolean",scroll:"boolean|string",panel:"boolean",clickable:"boolean",to:"string",mobile:"{ span?, col?, gap?, direction?, contentAlign?, contentJustify? }",tablet:"{ span?, col?, gap?, direction?, contentAlign?, contentJustify? }",pc:"{ span?, col?, gap?, direction?, contentAlign?, contentJustify? }",start:"Node|Function|Array",body:"Node|Function|Array",end:"Node|Function|Array",color:"string",outline:"boolean",shadow:"boolean|string",radius:"number|string",slots:"{ start?, body?, end?, default? }",class:"string",style:"object"},slots:{start:"Top/header region",body:"Main body region",end:"Bottom/footer region",default:"Fallback content"},events:{onClick:"MouseEvent",onKeydown:"KeyboardEvent"},returns:"HTMLDivElement",description:"CSS Grid item with responsive spans, optional internal stack layout, start/body/end regions, and lightweight visual variants."}),v.Icon=(...t)=>{var ce,le;let e={},n=[],s="home",i=!1;const c=t[0],y=t[1],a=oe=>oe&&typeof oe=="object"&&!oe.nodeType&&!Array.isArray(oe)&&!(oe instanceof Function);typeof c=="string"?(s=c,i=!0,a(y)?(e=y,t.length>2&&(n=t.slice(2))):t.length>1&&(n=t.slice(1))):a(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),Yt(e);const l=e.slots||{},b=o(e.size),R=o(e.color),C=String(s).endsWith("-fill"),w={...e.style||{}},T=Ye(e.size,()=>{const oe=o(e.size);return typeof oe=="string"&&An[oe]?oe:""}),ee=!!(e.color||e.clickable||e.border||e.glossy||e.glow||e.glass||e.shadow||e.outline||e.gradient||e.textGradient||e.lightShadow||e.radius),K={"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"}]}},re=oe=>{const ne=K[oe];return ne?_.svg({width:"100%",height:"100%",viewBox:ne.viewBox,fill:"none","aria-hidden":"true",focusable:"false"},...ne.paths.map(J=>_.path(J))):null},H=oe=>{const ne=o(e.tooltip);if(ne==null||ne===!1||!v.Tooltip)return oe;const J=a(ne)?{...ne}:{text:ne};return a(e.tooltipProps)&&Object.assign(J,e.tooltipProps),v.Tooltip({...J,target:oe})},j=ae(["cms-icon","material-icons",...ee?["cms-clear-set","cms-singularity"]:[],T,e.class]),Y=JSswift.omit(e,["name","size","class","style","label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots","spriteUrl","tooltip","tooltipProps"]);if(Y.class=j,Object.keys(w).length&&(Y.style=w),typeof s=="function"||s&&typeof s=="object"){const oe=JSswift.ui.renderSlot(l,"default",{},s),ne=E(null,"default",{},oe),J=_.span({...Y,"data-icon":"custom"},...ne);return Ke(J,e),H(J)}const W=String(s),ie=W.includes("#")?W:"";let ge=null;if(ie){const oe=e.spriteUrl||((ce=JSswift.config)==null?void 0:ce.iconSpriteUrl)||(typeof globalThis!="undefined"?(le=globalThis.JSswift_setting)==null?void 0:le.iconSpriteUrl:null),ne=ie.slice(ie.indexOf("#")+1),J=oe?_.svg({width:"100%",height:"100%"},_.use({href:oe+ie})):re(ne)||_.svg({width:"100%",height:"100%"},_.use({href:ie}));C&&(J.style.fill="currentColor"),ge=_.span({...Y,"data-icon":W},J,...n)}else ge=_.span({...Y,"data-icon":W},W,...n);if(b!=null){let oe=b;JSswift.uiSizes.includes(b)&&(oe=`var(--cms-icon-size-${b})`),oe=typeof oe=="number"?oe+"px":String(oe),ge.style.setProperty("--set-icon-size",oe)}return Ke(ge,e),H(ge)},(qo=JSswift.isDev)!=null&&qo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Icon={signature:"UI.Icon(name) | UI.Icon(props) | UI.Icon(props, ...children)",props:{name:"string|Node|Function",size:"number|string",color:"string",shadow:"boolean|string",lightShadow:"boolean",clickable:"boolean",border:"boolean",glossy:"boolean",glow:"boolean",glass:"boolean",gradient:"boolean|number",outline:"boolean",textGradient:"boolean",radius:"number|string",spriteUrl:"string",tooltip:"String|Node|Function|Object",tooltipProps:"object",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Custom icon content"},returns:"HTMLSpanElement",description:"Sprite- or text-based icon with configurable size/color."}),v.Badge=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Ye(e.size,()=>{const K=o(e.size);return typeof K=="string"&&An[K]?`cms-size-${K}`:""}),c=ae(["cms-clear-set","cms-badge","cms-singularity",i,me(e.outline,"outline"),e.class]),y=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);y.class=c;const a={...e.style||{}};if(e.size){const K=o(e.size);typeof K=="string"&&An[K]||(a.fontSize=$e(e.size))}y.style=a;const l=(K,re,H)=>{const j=Array.isArray(K)?K:[K];for(const Y of j)if(JSswift.ui.getSlot(s,Y)!=null)return E(s,Y,re,H);return H==null||H===!1||H===""?[]:E(null,"default",re,H)},b=()=>{var re;const K=o((re=e.iconSize)!=null?re:e.size);return typeof K=="number"?Math.max(10,Math.round(K*.85)):typeof K=="string"&&{xxs:10,xs:11,sm:12,md:13,lg:14,xl:16,xxl:18,xxxl:20}[K]||14},R=(K,re)=>{const H=o(K);return H==null||H===!1||H===""?null:typeof H=="string"?v.Icon({name:H,size:b()}):JSswift.ui.slot(H,{as:re})},C=(K,re,H)=>_.dynamic(()=>{const j=R(e[re],H),Y=l(K,{position:H},j);return Y.length?_.span({class:`cms-badge-anchor cms-badge-anchor-${H}`,"data-badge-slot":H},...Y):null}),w=_.dynamic(()=>{const K=o(e.label);let re=l(["label"],{},K);return re.length||(re=l(["default"],{},n)),_.span({class:"cms-badge-content"},_.span({class:"cms-badge-label"},...re.length?re:[""]))}),T=_.dynamic(()=>{const K=o(e.notification),re=K==null||K===!1||K===""?null:K,H=l(["notification"],{notification:K},re);return H.length?_.span({class:"cms-badge-notification","data-badge-slot":"notification","aria-label":typeof K=="number"?`${K} notifications`:null},...H):null}),ee=_.span(C(["left"],"left","left"),C(["centerLeft","center-left"],"centerLeft","center-left"),y,w,C(["topLeft","top-left"],"topLeft","top-left"),C(["topRight","top-right"],"topRight","top-right"),C(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),C(["bottomRight","bottom-right"],"bottomRight","bottom-right"),C(["centerRight","center-right"],"centerRight","center-right"),C(["right"],"right","right"),T);return(e.topLeft||e.centerLeft||e.bottomLeft)&&ee.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&ee.style.setProperty("padding-right","15px"),Ke(ee,e),ee},(Yo=JSswift.isDev)!=null&&Yo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Badge={signature:"UI.Badge(...children) | UI.Badge(props, ...children)",props:{label:"String|Node|Function|Array",color:"string",size:"string|number",outline:"boolean",notification:"string|number|Node|Function|[get,set] signal",iconSize:"string|number",topLeft:"String|Node|Function|Array",topRight:"String|Node|Function|Array",bottomLeft:"String|Node|Function|Array",bottomRight:"String|Node|Function|Array",centerLeft:"String|Node|Function|Array",centerRight:"String|Node|Function|Array",left:"String|Node|Function|Array",right:"String|Node|Function|Array",slots:"{ label?, default?, notification?, topLeft?, topRight?, bottomLeft?, bottomRight?, left?, right? }",class:"string",style:"object"},slots:{label:"Badge label content",default:"Fallback content",notification:"Notification badge content",topLeft:"Icon anchored top-left",topRight:"Icon anchored top-right",bottomLeft:"Icon anchored bottom-left",bottomRight:"Icon anchored bottom-right",centerLeft:"Icon anchored center-left",centerRight:"Icon anchored center-right",left:"Icon anchored left",right:"Icon anchored right"},returns:"HTMLSpanElement",description:"Inline badge with reactive notification and 6 positionable icon slots."});const Yl=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(""):""},fo=(t,e)=>{const n=t==null||t===!0?e:t;if(n==null||n===!1)return mt(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":mt(s)||mt(e)},mo=(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)),Xl=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=fo(null,e);return _.span({class:ae(["cms-avatar-status",s?`cms-state-${s}`:""])})}if(t instanceof Node||Array.isArray(t)||typeof t=="function")return t;const n=fo(t,e);return t===!0||n?_.span({class:ae(["cms-avatar-status",n?`cms-state-${n}`:""])}):mo(t,"cms-avatar-badge")},$n=(t,e)=>!e||!e.length?null:_.span({class:ae(["cms-avatar-anchor",t])},...e);v.Avatar=(...t)=>{var g,O,Q;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Ye(e.size,()=>{var x;const r=o(e.size);return typeof r=="string"&&((x=JSswift.uiSizes)!=null&&x.includes(r))?`cms-size-${r}`:""}),c=Ye([e.color,e.state],()=>{const r=o(e.color)||o(e.state)||"",x=mt(r);return x?`cms-state-${x}`:""}),y=ae(["cms-clear-set","cms-avatar","cms-singularity",i,c,me(e.square,"cms-avatar-square"),me(e.elevated,"elevated"),e.class]),a=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"]);a.class=y;const l={...e.style||{}},b=Ie(e.size,r=>{var x;return typeof r=="string"&&((x=JSswift.uiSizes)!=null&&x.includes(r))?"":$e(r)},"");b!=null&&(l.width=b,l.height=b);const R=(g=e.fontSize)!=null?g:e.textSize,C=R!=null?Ie(R,$e):Ie(e.size,r=>{var x;return typeof r=="string"&&((x=JSswift.uiSizes)!=null&&x.includes(r))?"":`clamp(11px, calc(${$e(r)} * 0.34), 28px)`},"");C!=null&&(l.fontSize=C);const w=Ie(e.radius,r=>{const x=hl(r);return x==="xxxl"?"999px":x?`var(--cms-r-${x})`:typeof r=="number"?`${r}px`:String(r)});w!=null&&(l["--set-border-radius"]=w),a.style=l;const T={props:e},ee=Ye([e.alt,e.label,e.name,e.text],()=>{const r=o(e.alt)||o(e.label)||o(e.name)||o(e.text)||"avatar";return String(r)}),K=e.icon!=null?typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,re=Ye([e.initials,e.text,e.label,e.name],()=>{var p,P;const r=(p=o(e.initials))!=null?p:o(e.text);if(r!=null)return r;const x=(P=o(e.label))!=null?P:o(e.name);return typeof x=="string"?Yl(x):x}),H=mo(o((O=e.badge)!=null?O:e.notification)),j=Xl(o((Q=e.status)!=null?Q:e.presence),o(e.statusColor));let Y=E(s,"media",T,e.media);if(!Y.length&&e.src){const r={class:"cms-avatar-img",src:e.src,alt:ee,sizes:e.sizes,style:{}};e.srcset!=null&&(r.srcset=e.srcset),e.srcSet!=null&&(r.srcset=e.srcSet);const x=Ie(e.fit);x!=null&&(r.style.objectFit=x),Y=[_.img(r)]}const W=E(s,"default",T,n),ie=E(s,"fallback",T,null),ge=E(s,"label",T,re),ce=E(s,"icon",T,K),le=Y.length?Y:W.length?W:ie.length?ie:ge.length?ge:ce.length?ce:["?"],oe=Y.length?"cms-avatar-media":"cms-avatar-fallback",ne=_.span({class:"cms-avatar-body"},_.span({class:oe},...le));let J=E(s,"topLeft",T,e.topLeft),Z=E(s,"topRight",T,e.topRight),X=E(s,"bottomLeft",T,e.bottomLeft),ue=E(s,"bottomRight",T,e.bottomRight);const F=E(s,"badge",T,H),f=E(s,"status",T,j);!Z.length&&F.length&&(Z=F),!ue.length&&f.length&&(ue=f);const m=_.div(a,ne,$n("cms-avatar-anchor-top-left",J),$n("cms-avatar-anchor-top-right",Z),$n("cms-avatar-anchor-bottom-left",X),$n("cms-avatar-anchor-bottom-right",ue));return Ke(m,e),m},(Xo=JSswift.isDev)!=null&&Xo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Avatar={signature:"UI.Avatar(...children) | UI.Avatar(props, ...children)",props:{src:"string",srcset:"string",sizes:"string",alt:"string",label:"String|Node|Function|Array",name:"string",initials:"string|Node|Function|Array",text:"string|Node|Function|Array",size:"number|string",fontSize:"number|string",radius:"number|string",square:"boolean",elevated:"boolean",color:"string",state:"string",icon:"string|Node|Function|Array",iconSize:"number|string",media:"Node|Function|Array",fit:"cover|contain|fill|scale-down|none",badge:"string|number|Node|Function|Array",notification:"string|number|Node|Function|Array",status:"boolean|string|number|Node|Function|Array",statusColor:"success|warning|danger|info|primary|secondary|dark|light|string",topLeft:"Node|Function|Array",topRight:"Node|Function|Array",bottomLeft:"Node|Function|Array",bottomRight:"Node|Function|Array",slots:"{ media?, default?, fallback?, label?, icon?, badge?, status?, topLeft?, topRight?, bottomLeft?, bottomRight? }",mobile:"{ width?, height?, minWidth?, maxWidth?, padding?, margin?, radius? }",tablet:"{ width?, height?, minWidth?, maxWidth?, padding?, margin?, radius? }",pc:"{ width?, height?, minWidth?, maxWidth?, padding?, margin?, radius? }",class:"string",style:"object"},slots:{media:"Custom main media",default:"Custom main content instead of image or fallback",fallback:"Fallback custom quando non c'e immagine",label:"Fallback testuale / initials",icon:"Fallback icon",badge:"Badge overlay, di default top-right",status:"Presence dot or overlay content, bottom-right by default",topLeft:"Top-left overlay content",topRight:"Top-right overlay content",bottomLeft:"Bottom-left overlay content",bottomRight:"Bottom-right overlay content"},returns:"HTMLDivElement",description:"Flexible avatar with image, smart fallbacks, states, badge, and overlay slots."}),v.Chip=(...t)=>{var re,H,j,Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Ye(e.size,()=>{const W=o(e.size);return typeof W=="string"&&An[W]?W:""}),c=ae(["cms-clear-set","cms-chip","cms-singularity",i,e.class]),y=JSswift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);y.class=c,y.style={...e.style||{}};const a=e.icon?typeof e.icon=="string"?v.Icon({name:e.icon,size:(re=e==null?void 0:e.size)!=null?re:null}):JSswift.ui.slot(e.icon,{as:"icon"}):null,l=e.iconRight?typeof e.iconRight=="string"?v.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",{},a),R=JSswift.ui.renderSlot(s,"iconRight",{},l),C=E(s,"label",{},e.label),w=C.length?C:E(s,"default",{},n),T=E(null,"default",{},b),ee=E(null,"default",{},R),K=_.span(y,...T,...w.length?w:[""],...ee);if(e.removable){const W=v.Btn({class:"cms-chip-remove",onClick:e.onRemove,size:(j=e==null?void 0:e.size)!=null?j:null},v.Icon({size:(Y=e==null?void 0:e.size)!=null?Y:null,name:"close"}));K.appendChild(W),W.onclick=()=>{e.onRemove&&e.onRemove(),K.remove()}}return Ke(K,e),K},(Qo=JSswift.isDev)!=null&&Qo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Chip={signature:"UI.Chip(...children) | UI.Chip(props, ...children)",props:{label:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",removable:"boolean",onRemove:"function",dense:"boolean",outline:"boolean|string|number",slots:"{ icon?, label?, default? }",class:"string",style:"object"},slots:{icon:"Chip icon content",iconRight:"Chip right icon content",label:"Chip label content",default:"Fallback content"},events:{onRemove:"MouseEvent"},returns:"HTMLSpanElement",description:"Chip with optional icon and removal."}),v.Stat=(...t)=>{var ce,le;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>mt(o(e.state)||o(e.color)||""),c=Ye([e.state,e.color],()=>{const oe=i();return oe?`cms-state-${oe}`:""}),y=Ye(e.trend,()=>{const oe=String(o(e.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(oe)?"is-positive":["down","negative","danger","loss","decrease"].includes(oe)?"is-negative":["flat","neutral","steady","stable"].includes(oe)?"is-neutral":""}),a={...e},l=JSswift.omit(a,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","meta","note","slots","state","subtitle","title","trend","value"]);l.class=ae(["cms-clear-set","cms-stat","cms-singularity",c,y,a.class]),l.style={...a.style||{}};const b=(oe,ne,J={})=>E(s,oe,J,ne),R=e.icon==null?null:typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||"md"}):JSswift.ui.slot(e.icon,{as:"icon"}),C=b("eyebrow",e.eyebrow),w=b("label",(ce=e.label)!=null?ce:e.title),T=b("value",e.value),ee=b("note",(le=e.note)!=null?le:e.subtitle),K=b("meta",e.meta),re=b("delta",e.delta,{trend:e.trend}),H=b("icon",R),j=b("aside",e.aside),Y=b("footer",e.footer),W=b("actions",e.actions),ie=b("default",n),ge=_.article(l,_.div({class:"cms-stat-head"},_.div({class:"cms-stat-lead"},H.length?_.div({class:"cms-stat-icon"},...H):null,_.div({class:"cms-stat-copy"},C.length?_.div({class:"cms-stat-eyebrow"},...C):null,w.length?_.div({class:"cms-stat-label"},...w):null)),j.length?_.div({class:"cms-stat-aside"},...j):null),_.div({class:"cms-stat-body"},T.length?_.div({class:"cms-stat-value"},...T):null,re.length?_.div({class:"cms-stat-delta"},...re):null,ee.length?_.div({class:"cms-stat-note"},...ee):null,K.length?_.div({class:"cms-stat-meta"},...K):null,ie.length?_.div({class:"cms-stat-extra"},...ie):null),Y.length||W.length?_.div({class:"cms-stat-footer"},Y.length?_.div({class:"cms-stat-footer-copy"},...Y):null,W.length?_.div({class:"cms-stat-actions"},...W):null):null);return Ke(ge,e),ge},(Zo=JSswift.isDev)!=null&&Zo.call(JSswift)&&(v.meta=v.meta||{},v.meta.Stat={signature:"UI.Stat(...children) | UI.Stat(props, ...children)",props:{eyebrow:"String|Node|Function|Array",label:"String|Node|Function|Array",title:"Alias of label",value:"String|Number|Node|Function|Array",delta:"String|Node|Function|Array",trend:"up|down|flat|positive|negative|neutral",note:"String|Node|Function|Array",subtitle:"Alias of note",meta:"Node|Function|Array",icon:"String|Node|Function|Array",aside:"Node|Function|Array",footer:"Node|Function|Array",actions:"Node|Function|Array",state:"primary|secondary|success|warning|danger|info|light|dark",slots:"{ eyebrow?, label?, value?, delta?, note?, meta?, icon?, aside?, footer?, actions?, default? }",class:"string",style:"object"},slots:{eyebrow:"Small kicker above the stat label",label:"Main stat label",value:"Primary metric value",delta:"Trend / delta content",note:"Supporting note",meta:"Extra meta badges or info",icon:"Leading icon or avatar",aside:"Right-side support content",footer:"Footer/supporting bottom content",actions:"Footer actions cluster",default:"Extra body content"},returns:"HTMLElement",description:"Compact surface for single metrics, trends, and operational metadata."}),v.Kpi=(...t)=>{var ce,le;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>mt(o(e.state)||o(e.color)||""),c=Ye([e.state,e.color],()=>{const oe=i();return oe?`cms-state-${oe}`:""}),y={...e},a=JSswift.omit(y,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","media","meta","note","slots","state","subtitle","title","trend","value"]);a.class=ae(["cms-clear-set","cms-kpi","cms-singularity",c,y.class]),a.style={...y.style||{}};const l=(oe,ne,J={})=>E(s,oe,J,ne),b=e.icon==null?null:typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||"lg"}):JSswift.ui.slot(e.icon,{as:"icon"}),R=l("eyebrow",e.eyebrow),C=l("title",(ce=e.title)!=null?ce:e.label),w=l("value",e.value),T=l("delta",e.delta,{trend:e.trend}),ee=l("note",(le=e.note)!=null?le:e.subtitle),K=l("meta",e.meta),re=l("icon",b),H=l("aside",e.aside),j=l("media",e.media),Y=l("footer",e.footer),W=l("actions",e.actions),ie=l("default",n),ge=_.section(a,_.div({class:"cms-kpi-head"},_.div({class:"cms-kpi-title-wrap"},re.length?_.div({class:"cms-kpi-icon"},...re):null,_.div({class:"cms-kpi-copy"},R.length?_.div({class:"cms-kpi-eyebrow"},...R):null,C.length?_.div({class:"cms-kpi-title"},...C):null)),H.length?_.div({class:"cms-kpi-aside"},...H):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},w.length?_.div({class:"cms-kpi-value"},...w):null,T.length?_.div({class:"cms-kpi-delta"},...T):null),ee.length?_.div({class:"cms-kpi-note"},...ee):null,K.length?_.div({class:"cms-kpi-meta"},...K):null,j.length?_.div({class:"cms-kpi-media"},...j):null,ie.length?_.div({class:"cms-kpi-extra"},...ie):null),Y.length||W.length?_.div({class:"cms-kpi-footer"},Y.length?_.div({class:"cms-kpi-footer-copy"},...Y):null,W.length?_.div({class:"cms-kpi-actions"},...W):null):null);return Ke(ge,e),ge},(ei=JSswift.isDev)!=null&&ei.call(JSswift)&&(v.meta=v.meta||{},v.meta.Kpi={signature:"UI.Kpi(...children) | UI.Kpi(props, ...children)",props:{eyebrow:"String|Node|Function|Array",title:"String|Node|Function|Array",label:"Alias of title",value:"String|Number|Node|Function|Array",delta:"String|Node|Function|Array",trend:"up|down|flat|positive|negative|neutral",note:"String|Node|Function|Array",subtitle:"Alias of note",meta:"Node|Function|Array",media:"Node|Function|Array",icon:"String|Node|Function|Array",aside:"Node|Function|Array",footer:"Node|Function|Array",actions:"Node|Function|Array",state:"primary|secondary|success|warning|danger|info|light|dark",slots:"{ eyebrow?, title?, value?, delta?, note?, meta?, media?, icon?, aside?, footer?, actions?, default? }",class:"string",style:"object"},slots:{eyebrow:"Kicker content",title:"KPI title content",value:"Primary KPI value",delta:"Delta/trend content",note:"Supporting note",meta:"Extra meta badges or inline info",media:"Secondary data view or mini-visual content",icon:"Leading icon or avatar",aside:"Top-right support content",footer:"Bottom support content",actions:"Footer actions cluster",default:"Extra body content"},returns:"HTMLElement",description:"Richer surface for KPIs, headline metrics, and mini dashboard summaries."});const Ql=(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},yn=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"))}))},wn=(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=Ql(t.panel,180);setTimeout(n,i+40)};v.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),y=o(e.items),a=Array.isArray(y)?y:y==null?[]:[y],l=(j={})=>{const Y=e.itemProps||{},W={...Y,...j};return e.divider!=null&&W.divider==null&&(W.divider=e.divider),W.class=ae([Y.class,e.itemClass,j.class]),W.style={...Y.style||{},...e.itemStyle||{},...j.style||{}},W},b=j=>{if(j==null||j===!1)return[];if(cs(j))return[j];if(kn(j)){const Y=j.children!=null?en(j.children):j.content!=null?en(j.content):en(j.node);return[v.Item(l(j),...Y)]}return Array.isArray(j)?[v.Item(l(),...j)]:j!=null&&j.nodeType?[v.Item(l(),j)]:[v.Item(l(),j)]},R=(j,Y,W,ie=!0)=>{if(j==null||j===!1)return[];if(ie){const ge={item:j,index:Y,count:W,first:Y===0,last:Y===W-1},ce=E(s,"item",ge,null);if(ce.length)return ce.flatMap(le=>b(le))}return b(j)},C=[];a.forEach((j,Y)=>{C.push(...R(j,Y,a.length))});const w=E(s,"default",{items:a,count:a.length},n);if(w.forEach((j,Y)=>{C.push(...R(j,a.length+Y,a.length+w.length,!1))}),!C.length){const j=E(s,"empty",{items:a,count:0},e.empty);j.length&&(j.length===1&&cs(j[0])?C.push(j[0]):C.push(v.Item({class:"cms-item-empty",flat:!0},...j)))}const T=ae(["cms-list",me(e.dense,"dense"),me(e.divider,"divider"),me(c===!1||c==="none","cms-list-no-marker"),e.class]),ee=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);ee.class=T,ee.style={...e.style||{}};const K=Ie(e.gap,$e);return K!=null&&(ee.style["--cms-list-gap"]=K),c!=null&&c!==!1&&c!==!0&&c!=="none"&&(ee.style.listStyleType=String(c)),_[i?"ol":"ul"](ee,...C)},(ti=JSswift.isDev)!=null&&ti.call(JSswift)&&(v.meta=v.meta||{},v.meta.List={signature:"UI.List(...children) | UI.List(props, ...children)",props:{items:"Array<Node|Object|string>",ordered:"boolean",number:"boolean",marker:"boolean|string",dense:"boolean",divider:"boolean",gap:"string|number",empty:"String|Node|Function|Array",itemClass:"string",itemStyle:"object",itemProps:"object",slots:"{ default?, item?, empty? }",class:"string",style:"object"},slots:{default:"List content fallback",item:"Render custom di ogni item ({ item, index, count, first, last })",empty:"Empty state content"},returns:"HTMLUListElement|HTMLOListElement",description:"Lista dichiarativa con supporto items, slot item, ordered/marker ed empty state."}),v.Item=(...t)=>{var F,f,m,g,O,Q,r,x;const{props:e,children:n}=JSswift.uiNormalizeArgs(t);e.state!=null&&e.color==null&&(e.color=e.state),Yt(e);const s=e.slots||{},i=Ye([e.clickable,e.to],()=>!!(o(e.clickable)||o(e.to))),c=Ye([e.active,e.selected],()=>!!(o(e.active)||o(e.selected))),y=!!(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),a=(p,P,U)=>{const G=o(p);return G==null||G===!1||G===""?null:typeof G=="string"?v.Icon({name:G,size:P||"sm"}):JSswift.ui.slot(G,{as:U})},l=E(s,"icon",{},a(e.icon,e.iconSize||e.size,"icon")),b=E(s,"title",{},(F=e.title)!=null?F:e.label),R=E(s,"subtitle",{},(m=(f=e.subtitle)!=null?f:e.caption)!=null?m:e.description),C=E(s,"meta",{},(g=e.meta)!=null?g:e.eyebrow),w=E(s,"body",{},(O=e.body)!=null?O:e.content),T=E(s,"default",{},n),ee=E(s,"actions",{},(Q=e.actions)!=null?Q:e.footer),K=(x=(r=e.aside)!=null?r:e.trailing)!=null?x:a(e.iconRight,e.iconSize||e.size,"iconRight"),re=E(s,"aside",{},K),H=[...w,...T],j=!(y||e.clickable||e.to||l.length||b.length||R.length||C.length||ee.length||re.length||w.length),Y=ae(["cms-item",me(e.divider,"divider"),me(y,"cms-clear-set"),me(y,"cms-singularity"),me(y,"cms-item-surface"),me(j,"cms-item-inline"),me(i,"cms-item-clickable"),me(c,"is-active"),me(e.disabled,"is-disabled"),e.class]),W=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"]);W.class=Y,W.style={...e.style||{}};const ie=e.onClick,ge=e.onKeydown,ce=p=>{var U;if(ie==null||ie(p),p.defaultPrevented||o(e.disabled))return;const P=o(e.to);P&&((U=JSswift.router)!=null&&U.navigate)&&(p.preventDefault(),JSswift.router.navigate(P))},le=p=>{ge==null||ge(p),!(p.defaultPrevented||o(e.disabled))&&(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),ce(p))};o(e.disabled)&&(W["aria-disabled"]="true"),(o(e.clickable)||o(e.to))&&(W.onClick=ce,W.onKeydown=le,W.tabIndex==null&&(W.tabIndex=o(e.disabled)?-1:0),W.role==null&&(W.role="button"));const oe=b.length?_.div({class:"cms-item-title"},...b):null,ne=R.length?_.div({class:"cms-item-subtitle"},...R):null,J=C.length?_.div({class:"cms-item-meta"},...C):null,Z=H.length?_.div({class:ae(["cms-item-body",me(!(b.length||R.length||C.length),"is-standalone")])},...H):null,X=ee.length?_.div({class:"cms-item-actions"},...ee):null,ue=_.li(W,_.div({class:"cms-item-row"},l.length?_.div({class:"cms-item-icon"},...l):null,_.div({class:"cms-item-main"},J,oe,ne,Z,X),re.length?_.div({class:"cms-item-aside"},...re):null));return Ke(ue,e),ue},(ni=JSswift.isDev)!=null&&ni.call(JSswift)&&(v.meta=v.meta||{},v.meta.Item={signature:"UI.Item(...children) | UI.Item(props, ...children)",props:{label:"String|Node|Function|Array",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",meta:"String|Node|Function|Array",body:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",aside:"Node|Function|Array",actions:"Node|Function|Array",clickable:"boolean",to:"string",active:"boolean",selected:"boolean",disabled:"boolean",color:"string",state:"Alias of color",size:"string|number",outline:"boolean",shadow:"boolean|string",lightShadow:"boolean",border:"boolean",glossy:"boolean",glow:"boolean",glass:"boolean",gradient:"boolean|number",textGradient:"boolean",radius:"string|number",divider:"boolean",slots:"{ icon?, title?, subtitle?, meta?, body?, aside?, actions?, default? }",class:"string",style:"object"},slots:{icon:"Leading visual/icon",title:"Main title content",subtitle:"Secondary text",meta:"Top meta content",body:"Body content",aside:"Trailing content",actions:"Actions row",default:"Fallback body content"},returns:"HTMLLIElement",description:"Structured item for simple lists, feeds, task lists, and clickable rows."}),v.Separator=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=ae(["cms-separator",me(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),y=o(e.vertical);if(c!=null){const a=$e(c);y?i.width=a:i.height=a}return s.style=i,_.hr(s)},(si=JSswift.isDev)!=null&&si.call(JSswift)&&(v.meta=v.meta||{},v.meta.Separator={signature:"UI.Separator() | UI.Separator(props)",props:{vertical:"boolean",size:"string|number",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Unused (separator has no content)"},returns:"HTMLHRElement",description:"Separatore orizzontale o verticale."}),v.Banner=(...t)=>{var ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>mt(o(e.type)||o(e.state)||""),c={state:i,dismissible:()=>!!o(e.dismissible)},y=Ye([e.type,e.state],()=>i()),a=Ye(e.variant,()=>{const F=String(o(e.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(F)?`cms-banner-${F}`:""}),l=Ye([e.actionsPlacement,e.stack],()=>String(o(e.actionsPlacement)||"").toLowerCase()==="bottom"||o(e.stack)?"cms-banner-actions-bottom":""),b=Ye(e.stack,()=>o(e.stack)?"cms-banner-stack":""),R={...e},C=JSswift.omit(R,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);C.class=ae(["cms-clear-set","cms-banner","cms-singularity",y,a,l,b,R.class]),C.style={...R.style||{}};const w=F=>{if(F==null||F==="")return"";const f=o(F);if(f==null||f==="")return"";const m=String(f);return Zt(m)?`var(--cms-${m})`:m};(e.accent!=null||rt(e.accent))&&(C.style["--cms-banner-accent"]=()=>w(e.accent),C.style["--cms-banner-border"]=()=>{const F=w(e.accent);return F?`color-mix(in srgb, ${F} 38%, var(--cms-border-color))`:""},C.style["--cms-banner-bg"]=()=>{const F=w(e.accent);return F?`color-mix(in srgb, ${F} 14%, var(--cms-panel))`:""},C.style["--cms-banner-color"]=()=>{const F=w(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"},ee=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||e.size||"md"}):JSswift.ui.slot(e.icon,{as:"icon"});const F=i(),f=F?T[F]:null;return f?v.Icon({name:f,size:e.iconSize||e.size||"md"}):null})(),K=E(s,"title",c,e.title),re=E(s,"message",c,e.message!=null?e.message:n),H=E(s,"description",c,(ue=e.description)!=null?ue:e.subtitle),j=E(s,"meta",c,e.meta),Y=E(s,"default",c,e.body!=null?[e.body,...n||[]]:e.message!=null?n:null),W=E(s,"icon",c,ee),ie=E(s,"aside",c,e.aside),ge=E(s,"actions",c,e.actions),ce=E(s,"dismiss",c,e.dismiss),le=String(o(e.actionsPlacement)||"").toLowerCase()==="bottom"||!!o(e.stack),oe=!!o(e.dismissible)||!!e.onDismiss;let ne=null;const J=oe?v.Btn({class:"cms-banner-close",outline:!0,size:e.size||"sm","aria-label":e.closeLabel||"Chiudi banner",onClick:F=>{var f;(f=e.onDismiss)==null||f.call(e,F),!F.defaultPrevented&&(ne==null||ne.remove())}},v.Icon({name:"close",size:e.size||"sm"})):null,Z=[...ie,...le?[]:ge,...ce.length?ce:J?[J]:[]];ne=_.div(C,W.length?_.div({class:"cms-banner-icon"},...W):null,_.div({class:"cms-banner-body"},_.div({class:"cms-banner-copy"},K.length?_.div({class:"cms-banner-title"},...K):null,re.length?_.div({class:"cms-banner-message"},...re):null,H.length?_.div({class:"cms-banner-description"},...H):null,Y.length?_.div({class:"cms-banner-extra"},...Y):null,j.length?_.div({class:"cms-banner-meta"},...j):null),le&&ge.length?_.div({class:"cms-banner-actions"},...ge):null),Z.length?_.div({class:"cms-banner-side"},...Z):null);const X=C.role||(()=>{const F=i();return F==="danger"||F==="warning"?"alert":"status"})();return ne.setAttribute("role",X),Ke(ne,e),ne},(oi=JSswift.isDev)!=null&&oi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Banner={signature:"UI.Banner(...children) | UI.Banner(props, ...children)",props:{title:"String|Node|Function|Array",message:"String|Node|Function|Array",description:"String|Node|Function|Array",meta:"String|Node|Function|Array",icon:"String|Node|Function|Array|false",actions:"Node|Function|Array",aside:"Node|Function|Array",body:"Node|Function|Array",dismissible:"boolean",dismiss:"Node|Function|Array",onDismiss:"function",closeLabel:"string",type:"success|warning|danger|error|info|primary|secondary|light|dark",state:"success|warning|danger|error|info|primary|secondary|light|dark",accent:"string",variant:"soft|solid|outline|ghost",actionsPlacement:"end|bottom",dense:"boolean",stack:"boolean",slots:"{ icon?, title?, message?, description?, meta?, actions?, aside?, dismiss?, default? }",class:"string",style:"object"},slots:{icon:"Leading visual/icon content",title:"Banner title content",message:"Primary message content",description:"Secondary/supporting text",meta:"Meta information content",actions:"Actions area content",aside:"Right side support content",dismiss:"Custom dismiss control",default:"Extra banner body content"},returns:"HTMLDivElement",description:"Structured banner with tone, actions, dismiss, and composable slots."}),v.Alert=(...t)=>{var W;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>mt(o(e.type)||o(e.state)||o(e.color)||"warning"),c=Ye([e.type,e.state,e.color],()=>{const ie=i();return ie?`cms-state-${ie}`:""}),y={...e},a=JSswift.omit(y,["actions","aside","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","state","subtitle","title","type","variant"]);a.class=ae(["cms-clear-set","cms-alert","cms-singularity",c,me(e.dismissible,"is-dismissible"),y.class]),a.style={...y.style||{}};const l={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"?v.Icon({name:e.icon,size:e.iconSize||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"});const ie=l[i()]||l.warning;return v.Icon({name:ie,size:e.iconSize||"sm"})})(),R=E(s,"title",{},e.title),C=E(s,"message",{},e.message!=null?e.message:n),w=E(s,"description",{},(W=e.description)!=null?W:e.subtitle),T=E(s,"meta",{},e.meta),ee=E(s,"actions",{},e.actions),K=E(s,"aside",{},e.aside),re=E(s,"icon",{},b),H=E(s,"dismiss",{},e.dismiss);let j=null;const Y=e.dismissible||e.onDismiss?v.Btn({class:"cms-alert-close",outline:!0,size:"sm","aria-label":e.closeLabel||"Chiudi alert",onClick:ie=>{var ge;(ge=e.onDismiss)==null||ge.call(e,ie),!ie.defaultPrevented&&(j==null||j.remove())}},v.Icon({name:"close",size:"sm"})):null;return j=_.div(a,re.length?_.div({class:"cms-alert-icon"},...re):null,_.div({class:"cms-alert-body"},R.length?_.div({class:"cms-alert-title"},...R):null,C.length?_.div({class:"cms-alert-message"},...C):null,w.length?_.div({class:"cms-alert-description"},...w):null,T.length?_.div({class:"cms-alert-meta"},...T):null,ee.length?_.div({class:"cms-alert-actions"},...ee):null),K.length||H.length||Y?_.div({class:"cms-alert-side"},...K,...H.length?H:Y?[Y]:[]):null),j.setAttribute("role",i()==="danger"||i()==="warning"?"alert":"status"),Ke(j,e),j},(ii=JSswift.isDev)!=null&&ii.call(JSswift)&&(v.meta=v.meta||{},v.meta.Alert={signature:"UI.Alert(...children) | UI.Alert(props, ...children)",props:{title:"String|Node|Function|Array",message:"String|Node|Function|Array",description:"String|Node|Function|Array",meta:"Node|Function|Array",icon:"String|Node|Function|Array|false",actions:"Node|Function|Array",aside:"Node|Function|Array",dismissible:"boolean",dismiss:"Node|Function|Array",onDismiss:"function",closeLabel:"string",type:"success|warning|danger|error|info|primary|secondary|light|dark",state:"success|warning|danger|error|info|primary|secondary|light|dark",slots:"{ icon?, title?, message?, description?, meta?, actions?, aside?, dismiss?, default? }",class:"string",style:"object"},slots:{icon:"Leading alert icon content",title:"Alert title content",message:"Primary alert copy",description:"Secondary/supporting text",meta:"Inline meta content",actions:"Alert actions cluster",aside:"Right side support content",dismiss:"Custom dismiss control",default:"Fallback alert message content"},returns:"HTMLDivElement",description:"Alert compatto per warning inline, policy note e feedback persistente dentro page o card."}),v.EmptyState=(...t)=>{var Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=()=>mt(o(e.state)||o(e.color)||""),c=Ye([e.state,e.color],()=>{const W=i();return W?`cms-state-${W}`:""}),y={...e},a=JSswift.omit(y,["actions","description","eyebrow","icon","iconSize","illustration","media","message","meta","slots","state","title"]);a.class=ae(["cms-clear-set","cms-empty-state","cms-singularity",c,me(e.compact,"compact"),me(e.inline,"inline"),y.class]),a.style={...y.style||{}};const l=e.icon===!1?null:e.icon!=null?typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||"xl"}):JSswift.ui.slot(e.icon,{as:"icon"}):v.Icon({name:"inbox",size:e.iconSize||"xl"}),b=E(s,"illustration",{},(Y=e.illustration)!=null?Y:e.media),R=E(s,"icon",{},l),C=E(s,"eyebrow",{},e.eyebrow),w=E(s,"title",{},e.title),T=E(s,"message",{},e.message!=null?e.message:n),ee=E(s,"description",{},e.description),K=E(s,"meta",{},e.meta),re=E(s,"actions",{},e.actions),H=E(s,"default",{},e.message!=null?n:null),j=_.section(a,b.length?_.div({class:"cms-empty-state-illustration"},...b):null,R.length?_.div({class:"cms-empty-state-icon"},...R):null,C.length?_.div({class:"cms-empty-state-eyebrow"},...C):null,w.length?_.div({class:"cms-empty-state-title"},...w):null,T.length?_.div({class:"cms-empty-state-message"},...T):null,ee.length?_.div({class:"cms-empty-state-description"},...ee):null,K.length?_.div({class:"cms-empty-state-meta"},...K):null,H.length?_.div({class:"cms-empty-state-extra"},...H):null,re.length?_.div({class:"cms-empty-state-actions"},...re):null);return Ke(j,e),j},(li=JSswift.isDev)!=null&&li.call(JSswift)&&(v.meta=v.meta||{},v.meta.EmptyState={signature:"UI.EmptyState(...children) | UI.EmptyState(props, ...children)",props:{eyebrow:"String|Node|Function|Array",title:"String|Node|Function|Array",message:"String|Node|Function|Array",description:"String|Node|Function|Array",meta:"Node|Function|Array",icon:"String|Node|Function|Array|false",illustration:"Node|Function|Array",media:"Alias of illustration",actions:"Node|Function|Array",compact:"boolean",inline:"boolean",state:"primary|secondary|success|warning|danger|info|light|dark",slots:"{ illustration?, icon?, eyebrow?, title?, message?, description?, meta?, actions?, default? }",class:"string",style:"object"},slots:{illustration:"Top visual / illustration content",icon:"Leading empty-state icon",eyebrow:"Small kicker content",title:"Primary empty-state heading",message:"Primary message content",description:"Secondary supporting text",meta:"Meta badges or summary content",actions:"Actions cluster",default:"Extra empty-state body content"},returns:"HTMLElement",description:"Surface per zero-results, onboarding vuoti e pannelli senza dati con CTA di recupero."});let Xt="jsswift:drawer-open";const go=new Set,hs=new Map,tn=(t=Xt)=>{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}},Zl=(t,e=Xt)=>{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 Et=tn();const Wt=(t,e=Xt)=>{Et=!!t;const n=hs.get(e);if(n&&n.size)n.forEach(s=>s==null?void 0:s.classList.toggle("open",Et));else{const s=document.querySelector(".cms-drawer");s&&s.classList.toggle("open",Et)}return go.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(Et);return}const{el:i,openIcon:c,closeIcon:y}=s;i&&(i.textContent=Et?c:y)}),Zl(Et,e),Et};v.Tooltip=(...t)=>{var X,ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{};let i=null,c=null,y=null,a=null;const l=F=>Object.prototype.hasOwnProperty.call(e,F),b=l("target")||l("anchorEl")||l("triggerEl"),R=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),C=(F,f)=>{const m=o(F);if(m==null||m==="")return f;const g=Number(m);return Number.isFinite(g)?g:f},w=()=>{clearTimeout(c),clearTimeout(y),c=null,y=null},T=()=>C(e.delay,350),ee=()=>C(e.hideDelay,o(e.interactive)?120:0),K=()=>{if(w(),!i)return;const F=i;i=null,wn(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 f=Array.isArray(F)?F:String(F).split(/[\s,|/]+/),m=new Set;return f.forEach(g=>{const O=String(g||"").trim().toLowerCase();O&&(O==="mouseenter"||O==="mouseover"?m.add("hover"):O==="blur"||O==="focusin"?m.add("focus"):O==="tap"?m.add("click"):m.add(O))}),m.size?m:new Set(["manual"])})((ue=(X=e.trigger)!=null?X:e.triggers)!=null?ue:l("open")?"manual":null),j=H.has("hover"),Y=H.has("focus"),W=H.has("click"),ie=H.has("manual")||!j&&!Y&&!W,ge=()=>{var U,G,de,A,u,k;const F={anchorEl:a||R||null,close:()=>K(),hide:()=>K(),isOpen:()=>!!i},f=e.icon?typeof e.icon=="string"?v.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,m=E(s,"title",F,(U=e.title)!=null?U:e.heading),g=E(s,"icon",F,f),O=E(s,"footer",F,(G=e.footer)!=null?G:e.actions);let Q=(k=(u=(A=(de=e.content)!=null?de:e.text)!=null?A:e.body)!=null?u:e.description)!=null?k:e.label;Q==null&&(b?Q=n:R&&n&&n.length>1?Q=n.slice(1):R||(Q=n));let r=E(s,"content",F,Q);r.length||(r=E(s,"default",F,Q));const x=r.length?_.div({class:"cms-tooltip-body"},...r):null,p=g.length||m.length?_.div({class:"cms-tooltip-head"},g.length?_.div({class:"cms-tooltip-icon"},...g):null,_.div({class:"cms-tooltip-head-main"},m.length?_.div({class:"cms-tooltip-title"},...m):null,x)):x,P=O.length?_.div({class:"cms-tooltip-footer"},...O):null;return _.div({class:"cms-tooltip-content"},...[p,P].filter(Boolean))},ce=F=>{var r,x,p,P,U,G;const f=F||a;if(!f||o(e.disabled))return null;if(i&&i._anchorEl===f)return i;i&&K();const m=(r=e.closeOnOutside)!=null?r:W||o(e.interactive),g=(x=e.closeOnEsc)!=null?x:W||o(e.interactive);let O=null;if(i=JSswift.overlay.open(()=>ge(),{type:"tooltip",anchorEl:f,placement:e.placement||"top",offsetX:(p=e.offsetX)!=null?p:0,offsetY:(U=(P=e.offsetY)!=null?P:e.offset)!=null?U:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:m,closeOnBackdrop:!1,closeOnEsc:g,autoFocus:!1,className:Ht(["cms-tooltip",me(e.interactive,"interactive"),e.class,e.panelClass]),onClose:()=>{var de,A;(de=O==null?void 0:O._tooltipCleanup)==null||de.call(O),i===O&&(i=null),(A=e.onClose)==null||A.call(e)}}),!(i!=null&&i.panel))return i;const Q=i;if(O=Q,Q._anchorEl=f,Q.panel.dataset.placement=String(o(e.placement||"top")),e.maxWidth!=null&&(Q.panel.style.maxWidth=$e(o(e.maxWidth))),e.minWidth!=null&&(Q.panel.style.minWidth=$e(o(e.minWidth))),e.width!=null&&(Q.panel.style.width=$e(o(e.width))),e.style&&Object.assign(Q.panel.style,e.style),Ke(Q.panel,e),o(e.interactive)){const de=()=>{clearTimeout(y),y=null},A=()=>oe(),u=k=>{const I=k.target;I&&I.closest&&I.closest("[data-tooltip-close]")&&K()};Q.panel.addEventListener("mouseenter",de),Q.panel.addEventListener("mouseleave",A),Q.panel.addEventListener("focusin",de),Q.panel.addEventListener("focusout",A),Q.panel.addEventListener("click",u),Q._tooltipCleanup=()=>{var k,I,B,pe,Se;(k=Q.panel)==null||k.removeEventListener("mouseenter",de),(I=Q.panel)==null||I.removeEventListener("mouseleave",A),(B=Q.panel)==null||B.removeEventListener("focusin",de),(pe=Q.panel)==null||pe.removeEventListener("focusout",A),(Se=Q.panel)==null||Se.removeEventListener("click",u)}}return yn(Q),(G=e.onOpen)==null||G.call(e,Q),Q},le=F=>{clearTimeout(y),y=null,clearTimeout(c),c=setTimeout(()=>ce(F),T())},oe=(F=!1)=>{if(clearTimeout(c),c=null,!!i){if(clearTimeout(y),F){K();return}y=setTimeout(()=>K(),ee())}},ne=F=>{i?oe(!0):ce(F)},J=()=>!!i,Z=F=>{if(!F)return()=>{};a=F;const f=[],m=()=>{w(),f.forEach(g=>g())};if(l("open"))return rt(e.open)?JSswift.reactive.effect(()=>{a&&(o(e.open)?ce(a):oe(!0))},"UI.Tooltip:open"):e.open===!0?ce(F):e.open===!1&&oe(!0),m;if(ie||o(e.disabled))return m;if(j){const g=()=>le(F),O=()=>oe();F.addEventListener("mouseenter",g),F.addEventListener("mouseleave",O),f.push(()=>{F.removeEventListener("mouseenter",g),F.removeEventListener("mouseleave",O)})}if(Y){const g=()=>le(F),O=()=>oe();F.addEventListener("focus",g),F.addEventListener("blur",O),f.push(()=>{F.removeEventListener("focus",g),F.removeEventListener("blur",O)})}if(W){const g=O=>{var Q;(Q=e.onTriggerClick)==null||Q.call(e,O),!O.defaultPrevented&&ne(F)};F.addEventListener("click",g),f.push(()=>F.removeEventListener("click",g))}return m};if(R){const F=ae(["cms-tooltip-wrap",e.wrapClass,e.targetClass]),f=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"]);f.class=F,f.style={display:"inline-flex",alignItems:"center",...e.wrapStyle||e.targetStyle||{}};const m=JSswift.ui.renderSlot(s,"target",{open:()=>ce(a),show:()=>le(a),hide:()=>oe(!0),toggle:()=>ne(a),isOpen:J},R),g=_.span(f,...E(null,"default",{},m));return Z(g),g._tooltip={bind:Z,open:ce,show:le,hide:oe,close:K,toggle:ne,isOpen:J},g}return{bind:Z,open:ce,show:le,hide:oe,close:K,toggle:ne,isOpen:J}},(ri=JSswift.isDev)!=null&&ri.call(JSswift)&&(v.meta=v.meta||{},v.meta.Tooltip={signature:"UI.Tooltip(props, target?) | UI.Tooltip(target, content)",props:{title:"String|Node|Function|Array",content:"String|Node|Function|Array",text:"String|Node|Function|Array",body:"String|Node|Function|Array",footer:"String|Node|Function|Array",icon:"String|Node|Function|Array",target:"Node|Function|Array",trigger:'"hover focus" | "click" | "manual" | Array',interactive:"boolean",disabled:"boolean",open:"boolean | reactive",placement:"string",delay:"number",hideDelay:"number",offset:"number (legacy)",offsetX:"number",offsetY:"number",closeOnOutside:"boolean",closeOnEsc:"boolean",maxWidth:"string|number",minWidth:"string|number",width:"string|number",slots:"{ target?, icon?, title?, content?, footer?, default? }",class:"string",panelClass:"string",wrapClass:"string",style:"object",targetStyle:"object"},slots:{target:"Tooltip trigger content ({ open, show, hide, toggle, isOpen })",icon:"Tooltip icon content",title:"Tooltip title content",content:"Tooltip body content ({ close, hide, isOpen, anchorEl })",footer:"Tooltip footer content ({ close, hide, isOpen, anchorEl })",default:"Fallback tooltip body content"},events:{onOpen:"(entry) => void",onClose:"() => void",onTriggerClick:"(event) => void"},returns:"Object { bind(), open(), show(), hide(), close(), toggle(), isOpen() } | HTMLSpanElement",description:"Anchored tooltip with hover/focus/click triggers, rich content, and imperative API."});const bs=(t,e,n={})=>{var F;const{props:s,children:i}=JSswift.uiNormalizeArgs(e),c=s.slots||{},y=t==="radio",a=n.appearance==="toggle",l=!y,b=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),R=kt(s.model,n.modelName||(y?"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,y&&s.name!=null&&(C.name=s.name),C.class=ae([`cms-${t}`,"cms-choice-input",s.inputClass]);const w=_.input(C),T=E(c,"label",{},s.label),ee=T.length?T:E(c,"default",{},i),K=ms(s,{className:"cms-shortcode cms-choice-shortcode"}),re=K?[...ee,K]:ee,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=ae(["cms-clear-set","cms-singularity-check","cms-choice-wrap",`cms-${t}-wrap`,me(a,"cms-toggle-wrap"),me(a&&y,"cms-toggle-radio-wrap"),me(a&&!y,"cms-toggle-checkbox-wrap"),me(s.dense,"dense"),s.class]),H.style={...s.style||{}};const j=o(s.size);j!=null&&!(typeof j=="string"&&((F=JSswift.uiSizes)!=null&&F.includes(j)))&&(H.style["--cms-choice-size"]=$e(j));const Y=_.span({class:ae(["cms-choice-mark",y?"cms-choice-radio-mark":"cms-choice-checkbox-mark",me(a,"cms-toggle-mark")])}),W=a?_.span({class:"cms-toggle-thumb"}):Y;a&&Y.appendChild(W);const ie=re.length?_.span({class:"cms-choice-label"},...re):null,ge=_.label(H,w,Y,ie);Ke(ge,s);const ce=s.iconSize?s.iconSize:s.size,le=a?null:y?"radio_button_checked":"check",oe=a?null:y?"radio_button_unchecked":null,ne=a||y?null:"indeterminate_check_box",J=f=>{if(y)return w.checked=f==s.value,w.checked;const m=f==null?null:!!f;return w.checked=m===!0,w.indeterminate=l&&m==null,m},Z=()=>!y&&l&&w.indeterminate?null:!!w.checked,X=f=>f===!0?s.checkedIcon!=null?s.checkedIcon:s.icon!=null?s.icon:le:f===!1?s.uncheckedIcon!=null?s.uncheckedIcon:oe:s.indeterminateIcon!=null?s.indeterminateIcon:s.standbyIcon!=null?s.standbyIcon:s.iconStandby!=null?s.iconStandby:ne,ue=()=>{const f=Z(),m=f===!0;for(;W.firstChild;)W.removeChild(W.firstChild);ge.classList.toggle("is-checked",m),ge.classList.toggle("is-indeterminate",f==null),ge.classList.toggle("is-disabled",!!w.disabled),m&&(s.checkedIcon||s.icon)?ge.classList.toggle("toggle-default",!1):m&&!s.checkedIcon||f==null&&!s.standbyIcon?ge.classList.toggle("toggle-default",!0):f==null&&s.standbyIcon?ge.classList.toggle("toggle-default",!1):w.disabled===!1&&!s.uncheckedIcon?ge.classList.toggle("toggle-default",!0):ge.classList.toggle("toggle-default",!1),a&&(f==null?W.style.transform="translateX(calc((var(--cms-toggle-width) - var(--cms-toggle-thumb-size) - 1px) / 2))":W.style.removeProperty("transform"));const g={checked:m,state:f,indeterminate:f==null,value:s.value,id:b,type:t};let O=null;if(f===!0?(O=JSswift.ui.renderSlot(c,"checkedIcon",g,null),O==null&&(O=JSswift.ui.renderSlot(c,"iconOn",g,null))):f===!1?(O=JSswift.ui.renderSlot(c,"uncheckedIcon",g,null),O==null&&(O=JSswift.ui.renderSlot(c,"iconOff",g,null))):(O=JSswift.ui.renderSlot(c,"indeterminateIcon",g,null),O==null&&(O=JSswift.ui.renderSlot(c,"standbyIcon",g,null)),O==null&&(O=JSswift.ui.renderSlot(c,"iconStandby",g,null))),O==null&&(O=JSswift.ui.renderSlot(c,"icon",g,null)),O==null){const Q=X(f);typeof Q=="string"?O=v.Icon({name:Q,size:ce,...a?{textColor:s.color,outline:!0}:{}}):Q!=null&&(O=JSswift.ui.slot(Q,{checked:m,state:f,indeterminate:f==null,as:f===!0?"checkedIcon":f===!1?"uncheckedIcon":"indeterminateIcon"}))}E(null,"default",{},O).forEach(Q=>W.appendChild(Q))};return R?(J(R.get()),R.watch(f=>{J(f),ue()},y?"UI.Radio:watch":"UI.Checkbox:watch"),w.addEventListener("change",f=>{var m,g;if(y)w.checked&&(R.set(s.value),(m=s.onChange)==null||m.call(s,s.value,f));else{const O=Z();R.set(O),(g=s.onChange)==null||g.call(s,O,f)}ue()})):(J(y?s.checked===!0?s.value:void 0:s.checked),w.addEventListener("change",f=>{var m,g;y?(m=s.onChange)==null||m.call(s,s.value,f):(g=s.onChange)==null||g.call(s,Z(),f),ue()})),s.onInput&&w.addEventListener("input",f=>{var m,g;y?(m=s.onInput)==null||m.call(s,s.value,f):(g=s.onInput)==null||g.call(s,Z(),f)}),ue(),an(ge,s,{isEnabled:()=>!w.disabled,action:()=>{if(w.disabled)return!1;hn(w),w.click()}}),ge};v.Checkbox=(...t)=>bs("checkbox",t),(ai=JSswift.isDev)!=null&&ai.call(JSswift)&&(v.meta=v.meta||{},v.meta.Checkbox={signature:"UI.Checkbox(...children) | UI.Checkbox(props, ...children)",props:{label:"String|Node|Function|Array",checked:"boolean|null",model:"[get,set] signal",icon:"String|Node|Function|Array",iconOn:"Alias of icon/checkedIcon",iconOff:"Alias of uncheckedIcon",iconStandby:"Icon for null/indeterminate state",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",color:"string",size:"string|number",outline:"boolean",dense:"boolean",shortcode:"string|Array<string>|object",showShortcode:"boolean",slots:"{ label?, default? }",class:"string",style:"object"},slots:{label:"Checkbox label",icon:"Base icon content",iconStandby:"Slot for null/indeterminate icon",checkedIcon:"Icon when checked",uncheckedIcon:"Icon when unchecked",default:"Fallback label content"},events:{onChange:"(checked|null, event)",onInput:"(checked|null, event)"},returns:"HTMLLabelElement",description:"Checkbox con label e supporto model."}),v.Radio=(...t)=>bs("radio",t),(ci=JSswift.isDev)!=null&&ci.call(JSswift)&&(v.meta=v.meta||{},v.meta.Radio={signature:"UI.Radio(...children) | UI.Radio(props, ...children)",props:{label:"String|Node|Function|Array",value:"any",name:"string",checked:"boolean|null",model:"[get,set] signal",icon:"String|Node|Function|Array",iconOn:"Alias of icon/checkedIcon",iconOff:"Alias of uncheckedIcon",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",color:"string",size:"string|number",outline:"boolean",dense:"boolean",shortcode:"string|Array<string>|object",showShortcode:"boolean",slots:"{ label?, default? }",class:"string",style:"object"},slots:{label:"Radio label",icon:"Base icon content",iconOn:"Alias slot for checked icon",iconOff:"Alias slot for unchecked icon",checkedIcon:"Icon when checked",uncheckedIcon:"Icon when unchecked",default:"Fallback label content"},events:{onChange:"(value, event)",onInput:"(value, event)"},returns:"HTMLLabelElement",description:"Radio con label e supporto model."}),v.Toggle=(...t)=>{var s,i,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 bs(n,t,{appearance:"toggle",modelName:"UI.Toggle:model"})},(di=JSswift.isDev)!=null&&di.call(JSswift)&&(v.meta=v.meta||{},v.meta.Toggle={signature:"UI.Toggle(...children) | UI.Toggle(props, ...children)",props:{label:"String|Node|Function|Array",behavior:'"checkbox"|"radio"',mode:"Alias of behavior",value:"any",name:"string",checked:"boolean",model:"[get,set] signal",icon:"String|Node|Function|Array",iconOn:"Alias of icon/checkedIcon",iconOff:"Alias of uncheckedIcon",iconStandby:"Icon for null/indeterminate state",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",color:"string",size:"string|number",dense:"boolean",shortcode:"string|Array<string>|object",showShortcode:"boolean",slots:"{ label?, default? }",class:"string",style:"object"},slots:{label:"Toggle label",icon:"Base icon content",iconOn:"Alias slot for checked icon",iconOff:"Alias slot for unchecked icon",iconStandby:"Slot for null/indeterminate icon",checkedIcon:"Icon when checked",uncheckedIcon:"Icon when unchecked",default:"Fallback label content"},events:{onChange:"(checked|value, event)",onInput:"(checked|value, event)"},returns:"HTMLLabelElement",description:"Toggle switch con supporto model e comportamento checkbox/radio."}),v.Slider=(...t)=>{var B,pe,Se,ye,V;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(_t(e.value)||Pt(e.value)?e.value:null),c=kt(i,"UI.Slider:model"),y=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"]);y.type="range",y.class=ae(["cms-slider-input",e.inputClass]);const a=_.input(y),l={...e.style||{}},b=o(e.size);if(b!=null){const D=typeof b=="string"&&((B=JSswift.uiSizes)!=null&&B.includes(b))?`var(--cms-size-${b})`:$e(b);l["--cms-slider-size"]=D,l["--cms-slider-track-size"]=`max(4px, calc(${D} / 4))`,l["--cms-slider-box-height"]=`calc(${D} * 1.5)`,l["--cms-slider-marker-size"]=`max(6px, calc(${D} / 3))`}const R=_.label({class:ae(["cms-clear-set","cms-singularity-check","cms-slider-wrap",me(e.dense,"dense"),e.class]),style:l});Ke(R,e);const C=_.div({class:"cms-slider-header"}),w=_.span({class:"cms-slider-label"}),T=_.span({class:"cms-slider-value"});C.append(w,T);const ee=_.div({class:"cms-slider-body"}),K=_.span({class:"cms-slider-icon cms-slider-icon-left"}),re=_.span({class:"cms-slider-edge-label cms-slider-edge-label-left"}),H=_.div({class:"cms-slider-main"}),j=_.div({class:"cms-slider-box",style:{minHeight:"var(--cms-slider-box-height, 36px)"}}),Y=_.span({class:"cms-slider-rail",style:{height:"var(--cms-slider-track-size, 6px)"}}),W=_.span({class:"cms-slider-selection",style:{height:"var(--cms-slider-track-size, 6px)"}}),ie=_.span({class:"cms-slider-thumb",style:{width:"var(--cms-slider-size, 24px)",height:"var(--cms-slider-size, 24px)"}}),ge=_.span({class:"cms-slider-thumb-icon"}),ce=_.span({class:"cms-slider-thumb-label"});ie.append(ce,ge);const le=_.div({class:"cms-slider-markers"}),oe=_.span({class:"cms-slider-edge-label cms-slider-edge-label-right"}),ne=_.span({class:"cms-slider-icon cms-slider-icon-right"});j.append(Y,W,ie,a),H.append(j,le),ee.append(K,re,H,oe,ne),R.append(C,ee);const J=D=>{for(;D.firstChild;)D.removeChild(D.firstChild)},Z=(D,q,Ne="")=>{J(D),(q||[]).forEach(ke=>D.appendChild(ke)),D.style.display=D.childNodes.length?Ne:"none"},X=D=>_t(D)||Pt(D)?o(D):D,ue=(D,q={})=>Ln(X(D),q),F=(D,q,Ne={})=>{var te,xe;const ke=X(D);return ke==null?[]:typeof ke=="string"?[v.Icon({name:ke,size:(xe=(te=e.iconSize)!=null?te:e.size)!=null?xe:16})]:ue(ke,{...Ne,as:q})},f=(D,q)=>{const Ne=Number(D);return Number.isFinite(Ne)?Ne:q},m=()=>f(o(e.min),0),g=()=>{const D=m(),q=f(o(e.max),100);return q<D?D:q},O=()=>{const D=o(e.step);if(D==="any")return"any";const q=f(D,1);return q>0?q:1},Q=D=>{if(D==="any")return 0;const q=String(D);if(q.includes("e-"))return Number(q.split("e-")[1]||0);const Ne=q.indexOf(".");return Ne===-1?0:q.length-Ne-1},r=D=>{const q=m(),Ne=g(),ke=O();let te=f(D,q);if(ke!=="any"){te=q+Math.round((te-q)/ke)*ke;const xe=Q(ke);xe>0&&(te=Number(te.toFixed(xe)))}return Math.min(Ne,Math.max(q,te))},x=D=>{const q=m(),ke=g()-q;if(!ke)return 0;const te=(r(D)-q)/ke,xe=o(e.reverse)?1-te:te;return Math.max(0,Math.min(1,xe))},[p,P]=JSswift.reactive.signal(r(c?c.get():(Se=(pe=o(e.value))!=null?pe:o(e.min))!=null?Se:0)),U=(D,q={})=>{const Ne=r(D);return p()!==Ne&&P(Ne),String(a.value)!==String(Ne)&&(a.value=String(Ne)),c&&q.fromModel!==!0&&c.set(Ne),Ne},G=()=>{var xe;const D=o(e.markers),q=!!o((xe=e.markerLabels)!=null?xe:e.labelMarks);if(!D)return[];const Ne=m(),ke=g(),te=(be,Ce)=>{var Le,Ae,z,we,M,N,S,d;if(be==null)return null;if(typeof be=="object"&&!Array.isArray(be)){const L=r((z=(Ae=(Le=be.value)!=null?Le:be.position)!=null?Ae:be.at)!=null?z:Ne);return{key:(we=be.key)!=null?we:`marker-${Ce}-${L}`,value:L,label:(M=be.label)!=null?M:q?String(L):null,icon:(N=be.icon)!=null?N:null,className:(d=(S=be.class)!=null?S:be.className)!=null?d:""}}const he=r(be);return{key:`marker-${Ce}-${he}`,value:he,label:q?String(be):null,icon:null,className:""}};if(Array.isArray(D))return D.map((be,Ce)=>te(be,Ce)).filter(Boolean);if(typeof D=="number"&&D>1){const be=Math.floor(D),Ce=be>1?(ke-Ne)/(be-1):0;return Array.from({length:be},(he,Le)=>te(Ne+Ce*Le,Le)).filter(Boolean)}if(D===!0){const be=O();if(be==="any")return[te(Ne,0),te(ke,1)].filter(Boolean);const Ce=Math.floor((ke-Ne)/be)+1;return Ce>24?[te(Ne,0),te((Ne+ke)/2,1),te(ke,2)].filter(Boolean):Array.from({length:Ce},(he,Le)=>te(Ne+be*Le,Le)).filter(Boolean)}return typeof D=="object"?Object.keys(D).map((be,Ce)=>te({value:Number(be),label:D[be]},Ce)).filter(Boolean):[]},de=()=>{J(le);const D=G();le.style.display=D.length?"block":"none",le.style.minHeight=D.some(q=>q.label!=null&&q.label!=="")?"30px":"10px",D.forEach(q=>{const Ne=x(q.value),ke=o(e.reverse)?p()<=q.value:p()>=q.value,te=_.button({type:"button",class:ae(["cms-slider-marker",q.className,me(()=>ke,"active")]),style:{left:`${Ne*100}%`,color:ke?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,we;if(o(e.disabled)||o(e.readonly))return;const Ae=U(q.value);(z=e.onInput)==null||z.call(e,Ae),(we=e.onChange)==null||we.call(e,Ae)}}),xe={marker:q,active:ke,value:q.value,current:p(),input:a};let be=JSswift.ui.renderSlot(s,"marker",xe,null);be==null&&q.icon!=null&&(be=typeof q.icon=="string"?v.Icon({name:q.icon,size:12}):JSswift.ui.slot(q.icon,{...xe,as:"marker"}));const Ce=_.span({class:"cms-slider-marker-tick",style:{width:"var(--cms-slider-marker-size, 8px)",height:"var(--cms-slider-marker-size, 8px)",background:ke?o(e.color)||"var(--cms-primary)":"var(--cms-border-color)"}}),he=be==null?[Ce]:E(null,"default",xe,be),Le=q.label==null?E(s,"markerLabel",xe,null):E(s,"markerLabel",xe,q.label);he.forEach(Ae=>te.appendChild(Ae)),Le.length&&te.appendChild(_.span({class:"cms-slider-marker-label"},...Le)),le.appendChild(te)})},A=()=>{var xe;const D={value:p(),input:a,props:e};let q=E(s,"label",D,X(e.label));q.length||(q=E(s,"default",D,n)),Z(w,q,"inline-flex");const Ne=o(e.showValue),ke=Ne===!1?null:(xe=X(e.labelValue))!=null?xe:p(),te=Ne||X(e.labelValue)!=null?E(s,"value",D,ke):[];Z(T,te,"inline-flex"),C.style.display=w.childNodes.length||T.childNodes.length?"flex":"none"},u=()=>{var Ce,he,Le,Ae;const D={value:p(),input:a,props:e},q=E(s,"icon",D,null),Ne=q.length?q:F(e.icon,"icon",D);Z(K,Ne,"inline-flex");const ke=E(s,"iconRight",D,null),te=ke.length?ke:F(e.iconRight,"iconRight",D);Z(ne,te,"inline-flex");const xe=X((he=(Ce=e.startLabel)!=null?Ce:e.leftLabel)!=null?he:e.minLabel),be=X((Ae=(Le=e.endLabel)!=null?Le:e.rightLabel)!=null?Ae:e.maxLabel);Z(re,E(s,"startLabel",D,xe),"inline-flex"),Z(oe,E(s,"endLabel",D,be),"inline-flex")},k=()=>{var xe,be,Ce,he;const D={value:p(),input:a,props:e},q=E(s,"thumbIcon",D,null),Ne=(be=(xe=e.thumbIcon)!=null?xe:e.iconThumb)!=null?be:e.pointIcon;Z(ge,q.length?q:F(Ne,"thumbIcon",D),"inline-flex");const ke=(he=(Ce=X(e.thumbLabel))!=null?Ce:X(e.labelValue))!=null?he:o(e.showValue)?String(p()):null,te=E(s,"thumbLabel",D,ke);Z(ce,te,"inline-flex")},I=()=>{const D=r(p()),q=m(),Ne=g(),ke=O(),xe=`${x(D)*100}%`,be=o(e.color)||o(e.selectionColor)||"var(--cms-primary)",Ce=o(e.trackColor)||"var(--cms-border-color)",he=o(e.thumbColor)||be,Le=!!o(e.readonly),Ae=!!o(e.disabled);a.min=String(q),a.max=String(Ne),a.step=ke==="any"?"any":String(ke),a.disabled=Ae,a.value=String(D),Y.style.background=Ce,W.style.background=be,W.style.width=xe,ie.style.left=xe,ie.style.borderColor=he,ie.style.color=he,ce.style.background=be,R.classList.toggle("is-disabled",Ae),R.classList.toggle("is-readonly",Le),R.classList.toggle("has-markers",le.childNodes.length>0)};if(c?(U(c.get(),{fromModel:!0}),c.watch(D=>{U(D,{fromModel:!0})},"UI.Slider:watch")):rt(e.value)?JSswift.reactive.effect(()=>{U(o(e.value),{fromModel:!0})},"UI.Slider:value"):U((V=(ye=e.value)!=null?ye:e.min)!=null?V:0,{fromModel:!0}),a.addEventListener("input",D=>{var Ne;if(o(e.disabled)||o(e.readonly)){a.value=String(p());return}const q=U(a.value);(Ne=e.onInput)==null||Ne.call(e,q,D)}),a.addEventListener("change",D=>{var Ne;if(o(e.disabled)||o(e.readonly)){a.value=String(p());return}const q=U(a.value);(Ne=e.onChange)==null||Ne.call(e,q,D)}),JSswift.reactive.effect(()=>{A(),u(),k(),de(),I()},"UI.Slider:render"),R._input=a,R._getValue=p,R._setValue=D=>U(D),e.withQItem||e.qitem||e.item===!0){const D=v.Item({class:ae(["cms-slider-item",e.itemClass]),style:e.itemStyle},R);return D._input=a,D._slider=R,D._getValue=p,D._setValue=R._setValue,D}return R},(ui=JSswift.isDev)!=null&&ui.call(JSswift)&&(v.meta=v.meta||{},v.meta.Slider={signature:"UI.Slider(...children) | UI.Slider(props, ...children)",props:{min:"number",max:"number",step:'number|"any"',value:"number | rod | [get,set] signal",model:"rod | [get,set] signal",label:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",thumbIcon:"String|Node|Function|Array",iconThumb:"Alias of thumbIcon",pointIcon:"Alias of thumbIcon",thumbLabel:"String|Node|Function|Array",showValue:"boolean",labelValue:"String|Node|Function|Array",markers:"boolean|number|Array|Object",markerLabels:"boolean",labelMarks:"Alias of markerLabels",startLabel:"String|Node|Function|Array",endLabel:"String|Node|Function|Array",leftLabel:"Alias of startLabel",rightLabel:"Alias of endLabel",minLabel:"Alias of startLabel",maxLabel:"Alias of endLabel",withQItem:"boolean",qitem:"Alias of withQItem",item:"boolean",itemClass:"string",itemStyle:"object",selectionColor:"string",trackColor:"string",thumbColor:"string",size:"string|number",readonly:"boolean",inputClass:"string",slots:"{ label?, default?, value?, icon?, iconRight?, thumbIcon?, thumbLabel?, marker?, markerLabel?, startLabel?, endLabel? }",class:"string",style:"object"},slots:{label:"Label content",default:"Fallback label content",value:"Header value content",icon:"Left icon content",iconRight:"Right icon content",thumbIcon:"Thumb icon content",thumbLabel:"Thumb label content",marker:"Marker content",markerLabel:"Marker label content",startLabel:"Label on the left/start of the track",endLabel:"Label on the right/end of the track"},events:{onChange:"(value, event)",onInput:"(value, event)"},returns:"HTMLLabelElement | HTMLLIElement (with ._input = HTMLInputElement)",description:"Reactive slider with label, icons, custom thumb, markers, and model/QItem support."}),v.Rating=(...t)=>{var p;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(_t(e.value)||Pt(e.value)?e.value:null),c=kt(i,"UI.Rating:model"),y=e.id||"cms-rating-"+Math.random().toString(36).slice(2),a=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"]);a.type="hidden",a.id=y,e.name!=null&&(a.name=e.name),a.class=ae(["cms-rating-input","cms-choice-input",e.inputClass]);const l=_.input(a),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=ae(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",me(e.dense,"dense"),e.class]),b.style={...e.style||{}};const R=o(e.size);R!=null&&!(typeof R=="string"&&((p=JSswift.uiSizes)!=null&&p.includes(R)))&&(b.style["--cms-rating-size"]=$e(R));const C=o(e.gap);C!=null&&(b.style["--cms-rating-gap"]=$e(C));const w=_.span({class:"cms-rating-control",onMouseleave:P=>{var U;X!=null&&(X=null,r(),(U=e.onHover)==null||U.call(e,ne(),P))},onKeydown:P=>{if(!oe())return;const U=ie()?.5:1,G=ne();let de=G;switch(P.key){case"ArrowRight":case"ArrowUp":de=G+U;break;case"ArrowLeft":case"ArrowDown":de=G-U;break;case"Home":de=o(e.clearable)?0:U;break;case"End":de=W();break;case"Delete":case"Backspace":case"0":if(!o(e.clearable))return;de=0;break;case" ":case"Enter":de=G||(o(e.clearable)?U:Math.max(U,1));break;default:return}P.preventDefault(),x(de,P,{emit:!0})}}),T=_.span({class:"cms-choice-label cms-rating-label"}),ee=_.label(b,l,w,T);Ke(ee,e);const K=P=>{for(;P.firstChild;)P.removeChild(P.firstChild)},re=(P,U,G="")=>{K(P),(U||[]).forEach(de=>P.appendChild(de)),P.style.display=P.childNodes.length?G:"none"},H=P=>_t(P)||Pt(P)?o(P):P,j=(P,U={})=>Ln(H(P),U),Y=(P,U,G={})=>{var A,u;const de=H(P);return de==null?[]:typeof de=="string"?[v.Icon({name:de,color:e.color,size:(u=(A=e.iconSize)!=null?A:e.size)!=null?u:16})]:j(de,{...G,as:U})},W=()=>{var U;const P=Number((U=o(e.max))!=null?U:5);return Number.isFinite(P)&&P>0?Math.max(1,Math.round(P)):5},ie=()=>{var P;return!!o((P=e.half)!=null?P:e.allowHalf)},ge=(P,U=W())=>{let G=Number(o(P));Number.isFinite(G)||(G=0),G=Math.min(U,Math.max(0,G));const de=ie()?.5:1;return Math.round(G/de)*de},ce=()=>!!o(e.disabled),le=()=>!!o(e.readonly),oe=()=>!ce()&&!le(),ne=()=>ge(c?c.get():Z),J=P=>{const U=P>0?String(P):"";l.value=U,l.setAttribute("value",U),l.disabled=ce()};let Z=ge(c?c.get():o(e.value)),X=null,ue=0,F=[];const f=(P,U)=>{if(!ie())return ge(P);const G=U.currentTarget.getBoundingClientRect(),de=U.clientX-G.left<=G.width/2;return ge(de?P-.5:P)},m=(P,U)=>P>=U?"full":ie()&&P>=U-.5?"half":"empty",g=(P,U)=>{var k,I,B,pe,Se,ye,V,D,q,Ne,ke,te,xe,be,Ce;const G=o((B=(I=(k=e.colorSelected)!=null?k:e.activeColor)!=null?I:e.color)!=null?B:e.textColor)||"var(--cms-warning, #f0b429)",de=o((D=(V=(ye=(Se=(pe=e.colorHalf)!=null?pe:e.halfColor)!=null?Se:e.colorSelected)!=null?ye:e.activeColor)!=null?V:e.color)!=null?D:e.textColor)||G,A=o((xe=(te=(ke=(Ne=(q=e.colorHovered)!=null?q:e.hoverColor)!=null?Ne:e.colorSelected)!=null?ke:e.activeColor)!=null?te:e.color)!=null?xe:e.textColor)||G,u=o((Ce=(be=e.colorInactive)!=null?be:e.colorOff)!=null?Ce:e.color)||"var(--cms-muted)";return U?A:P==="full"?G:P==="half"?de:u},O=P=>{var A,u,k,I,B,pe,Se,ye,V,D,q,Ne,ke,te,xe;const U=[];P.hovered&&P.state!=="empty"&&U.push("hoveredIcon","iconHovered"),P.state==="full"?U.push("checkedIcon","selectedIcon","iconSelected","iconOn"):P.state==="half"?U.push("halfIcon","iconHalf"):U.push("uncheckedIcon","iconOff"),U.push("icon","item","star");for(const be of U){const Ce=E(s,be,P,null);if(Ce.length)return Ce}let G=null,de="icon";return P.hovered&&P.state!=="empty"&&(G=(A=e.hoveredIcon)!=null?A:e.iconHovered,de="hoveredIcon"),G==null&&P.state==="full"?(G=(B=(I=(k=(u=e.checkedIcon)!=null?u:e.iconSelected)!=null?k:e.iconOn)!=null?I:e.icon)!=null?B:"star",de="checkedIcon"):G==null&&P.state==="half"?(G=(D=(V=(ye=(Se=(pe=e.halfIcon)!=null?pe:e.iconHalf)!=null?Se:e.checkedIcon)!=null?ye:e.iconSelected)!=null?V:e.icon)!=null?D:"star_half",de="halfIcon"):G==null&&(G=(xe=(q=e.uncheckedIcon)!=null?q:e.iconOff)!=null?xe:o(e.noDimming)?(te=(ke=(Ne=e.icon)!=null?Ne:e.checkedIcon)!=null?ke:e.iconSelected)!=null?te:"star":"star_border",de="uncheckedIcon"),Y(G,de,P)},Q=()=>{const P=W();if(ue!==P){ue=P,F=[],K(w);for(let U=1;U<=P;U++){const G=_.span({class:"cms-rating-item-icon"}),de=_.span({class:"cms-rating-item",role:"radio",tabIndex:-1,onMousemove:A=>{var k;if(!oe())return;const u=f(U,A);X!==u&&(X=u,r(),(k=e.onHover)==null||k.call(e,u,A))},onClick:A=>{if(!oe())return;let u=f(U,A);o(e.clearable)&&u===ne()&&(u=0),x(u,A,{emit:!0})}},G);F.push({item:de,iconHost:G,index:U}),w.appendChild(de)}}},r=()=>{var pe,Se;Q();const P=W(),U=ne(),G=X==null?U:ge(X,P),de=ce(),A=le(),u=!!o(e.clearable),k=!!o(e.noDimming);ee.classList.toggle("is-disabled",de),ee.classList.toggle("is-readonly",A),ee.classList.toggle("is-hovering",X!=null),ee.classList.toggle("is-clearable",u),ee.classList.toggle("is-half",ie()),ee.classList.toggle("no-dimming",k);const I=Number((Se=o((pe=e.tabindex)!=null?pe:e.tabIndex))!=null?Se:0);w.tabIndex=de?-1:I,w.setAttribute("role","slider"),w.setAttribute("aria-valuemin","0"),w.setAttribute("aria-valuemax",String(P)),w.setAttribute("aria-valuenow",String(U)),w.setAttribute("aria-disabled",de?"true":"false"),w.setAttribute("aria-readonly",A?"true":"false"),J(U);const B=E(s,"label",{value:U,max:P,disabled:de,readonly:A,clearable:u},e.label!=null?H(e.label):n);re(T,B,"inline-flex"),F.forEach(({item:ye,iconHost:V,index:D})=>{const q=m(G,D),Ne=X!=null&&q!=="empty",ke={index:D,max:P,value:U,displayValue:G,state:q,active:q!=="empty",checked:q==="full",half:q==="half",hovered:Ne,disabled:de,readonly:A,clearable:u,setValue:te=>x(te,null,{emit:!1})};ye.className=Ht(["cms-rating-item",`is-${q}`,me(Ne,"is-hovered")]),ye.style.color=g(q,Ne),ye.style.opacity=q==="empty"&&!k?"0.48":"1",ye.setAttribute("aria-checked",String(U===D)),re(V,O(ke),"inline-flex")})},x=(P,U,G={})=>{var u,k;const de=ge(P),A=ne();return Z=de,X=null,c&&G.fromModel!==!0&&c.set(de),J(de),r(),G.emit!==!1&&de!==A&&((u=e.onInput)==null||u.call(e,de,U),(k=e.onChange)==null||k.call(e,de,U)),de};return ee._input=l,ee._rating=w,ee._getValue=ne,ee._setValue=P=>x(P,null,{emit:!1}),c&&c.watch(P=>{const U=ge(P);serializeValue(U)!==serializeValue(Z)&&(Z=U,X=null,J(Z),r())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!c&&e.value!=null&&(Z=ge(o(e.value))),r()},"UI.Rating:render"),ee},(fi=JSswift.isDev)!=null&&fi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Rating={signature:"UI.Rating(...children) | UI.Rating(props, ...children)",props:{max:"number",value:"number | rod | [get,set] signal",model:"rod | [get,set] signal",name:"string",label:"String|Node|Function|Array",clearable:"boolean",half:"boolean",allowHalf:"Alias of half",noDimming:"boolean",readonly:"boolean",disabled:"boolean",icon:"String|Node|Function|Array",iconSelected:"Alias of checkedIcon",checkedIcon:"String|Node|Function|Array",uncheckedIcon:"String|Node|Function|Array",iconHalf:"Alias of halfIcon",halfIcon:"String|Node|Function|Array",iconHovered:"Alias of hoveredIcon",hoveredIcon:"String|Node|Function|Array",color:"string",colorSelected:"string",colorHalf:"string",colorHovered:"string",colorInactive:"string",iconSize:"string|number",size:"string|number",gap:"string|number",slots:"{ label?, icon?, checkedIcon?, uncheckedIcon?, halfIcon?, hoveredIcon?, item?, star? }",class:"string",style:"object"},slots:{label:"Label content",icon:"Base icon content per item",checkedIcon:"Icon when item is selected",uncheckedIcon:"Icon when item is empty",halfIcon:"Icon when item is half-selected",hoveredIcon:"Icon while hovering selected items",item:"Custom item renderer",star:"Alias of item/icon"},events:{onChange:"(value, event)",onInput:"(value, event)",onHover:"(value, event)"},keyboard:["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End","Enter","Space","Delete","Backspace","0"],returns:"HTMLLabelElement (with ._input, ._rating, ._getValue(), ._setValue(value))",description:"Reactive rating with label, custom icons, half rating, clearable behavior, and model support."});const lt=t=>t?{hour:Number(t.hour)||0,minute:Number(t.minute)||0,second:Number(t.second)||0}:null,Gt=t=>String(Math.max(0,Number(t)||0)).padStart(2,"0"),jt=(t,e={})=>{var a,l,b,R,C,w,T,ee,K,re,H,j,Y,W,ie;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 ge=Math.max(0,Math.floor(t));n=Math.floor(ge/3600)%24,s=Math.floor(ge/60)%60,i=ge%60}else if(typeof t=="object"){if(t.time!=null||t.value!=null)return jt((a=t.time)!=null?a:t.value,e);n=Number((R=(b=(l=t.hour)!=null?l:t.hours)!=null?b:t.h)!=null?R:t.hh),s=Number((ee=(T=(w=(C=t.minute)!=null?C:t.minutes)!=null?w:t.min)!=null?T:t.mm)!=null?ee:0),i=Number((j=(H=(re=(K=t.second)!=null?K:t.seconds)!=null?re:t.sec)!=null?H:t.ss)!=null?j:0),c=(ie=(W=(Y=t.meridiem)!=null?Y:t.ampm)!=null?W:t.period)!=null?ie:null}else if(typeof t=="string"){const ge=t.trim();if(!ge)return null;const ce=ge.match(/^(\d{1,2})(\d{2})(\d{2})?$/),le=ge.match(/(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?\s*([ap]m)?/i);if(le)n=Number(le[1]),s=Number(le[2]),i=le[3]!=null?Number(le[3]):0,c=le[4]||null;else if(ce)n=Number(ce[1]),s=Number(ce[2]),i=ce[3]!=null?Number(ce[3]):0;else return null}else return null;if(!Number.isFinite(n)||!Number.isFinite(s)||!Number.isFinite(i))return null;if(c){const ge=String(c).toLowerCase();ge==="pm"&&n<12&&(n+=12),ge==="am"&&n===12&&(n=0)}if(n<0||n>23||s<0||s>59||i<0||i>59)return null;const y={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(i)};return po(y,e)},Qt=(t,e={})=>{const n=t&&typeof t=="object"&&t.hour!=null?lt(t):jt(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;return`${Gt(n.hour)}:${Gt(n.minute)}${s?`:${Gt(n.second)}`:""}`},Bn=(t,e)=>{const n=Qt(t,{withSeconds:!0}),s=Qt(e,{withSeconds:!0});return!n&&!s?0:n?s?n<s?-1:n>s?1:0:1:-1};function po(t,e={}){if(!t)return null;const n=lt(t),s=e.min!=null?jt(e.min,{withSeconds:!0}):null,i=e.max!=null?jt(e.max,{withSeconds:!0}):null;return s&&Bn(n,s)<0?lt(s):i&&Bn(n,i)>0?lt(i):n}const Mt=(t,e={})=>t==null||t===""?null:t instanceof Date?jt(t,e):typeof t=="object"?jt(t.time!=null?t.time:t,e):typeof t=="string"||typeof t=="number"?jt(t,e):null,Un=(t,e={})=>{var a;const n=jt(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;if(!!!o((a=e.use12h)!=null?a:e.ampm))return`${Gt(n.hour)}:${Gt(n.minute)}${s?`:${Gt(n.second)}`:""}`;const c=n.hour>=12?"PM":"AM",y=n.hour%12||12;return`${Gt(y)}:${Gt(n.minute)}${s?`:${Gt(n.second)}`:""} ${c}`},er=(t,e,n={})=>{if(!t)return"";const s=Qt(e,n);return s?`${t}T${s}`:t},ys=(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},ho=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:i=!1,minuteStep:c=5,secondStep:y=5,disabled:a=!1,readonly:l=!1,embedded:b=!1,className:R="",slotPrefix:C="",shortcuts:w=null,onSelect:T=null}=t,ee=jt(s,{withSeconds:i,min:e.min,max:e.max}),K=ee||jt(new Date,{withSeconds:i,min:e.min,max:e.max})||{hour:0,minute:0,second:0},re=ee?lt(ee):null,H=oe=>C?`${C}${oe[0].toUpperCase()}${oe.slice(1)}`:null,j=(oe,ne,J)=>{const Z=[H(oe),oe].filter(Boolean);for(const X of Z){if(JSswift.ui.getSlot(n,X)==null)continue;const F=JSswift.ui.renderSlot(n,X,ne,J);if(F!=null)return F}return JSswift.ui.slot(J,ne)},Y=oe=>{let ne=j("point",oe,null);return ne==null&&t.pointIcon!=null&&oe.selected&&(ne=typeof t.pointIcon=="string"?v.Icon({name:t.pointIcon,size:b?10:12}):JSswift.ui.slot(t.pointIcon,oe)),E(null,"default",oe,ne)},W=(oe,ne)=>{const J={hour:K.hour,minute:K.minute,second:i?K.second:0};return J[oe]=ne,J},ie=_.div({class:ae(["cms-time-section",me(b,"is-embedded"),me(i,"has-seconds"),R])}),ge=o(w)||[];if(Array.isArray(ge)&&ge.length){const oe=_.div({class:"cms-time-shortcuts"});ge.forEach((ne,J)=>{var f,m,g;if(!ne)return;const Z=typeof ne.value=="function"?ne.value({now:Qt(new Date,{withSeconds:i})}):ne.value,X=jt(Z,{withSeconds:i,min:e.min,max:e.max});if(!X)return;const ue={item:ne,index:J,value:Qt(X,{withSeconds:i}),displayValue:Un(X,{withSeconds:i,use12h:(f=e.use12h)!=null?f:e.ampm})},F=j("shortcut",ue,(g=(m=ne.label)!=null?m:ne.text)!=null?g:ue.displayValue);oe.appendChild(_.button({type:"button",class:ae(["cms-time-shortcut",me(!!re&&Bn(X,re)===0,"is-selected")]),disabled:a||l,onClick:()=>T==null?void 0:T(X,{shortcut:ne,index:J})},...E(null,"default",ue,F)))}),oe.childNodes.length&&ie.appendChild(oe)}const ce=_.div({class:"cms-time-columns"}),le=(oe,ne,J)=>{const Z=_.div({class:"cms-time-column","data-time-part":ne}),X=_.div({class:"cms-time-options"});return J.forEach(ue=>{var x;const F=W(ne,ue),f=po(F,{withSeconds:i,min:e.min,max:e.max}),m=a||l||Bn(f,F)!==0,g=!!re&&re[ne]===ue,O={part:ne,selected:g,disabled:m,value:ue,label:Gt(ue),timeValue:Qt(f,{withSeconds:i}),displayValue:Un(f,{withSeconds:i,use12h:(x=e.use12h)!=null?x:e.ampm})},Q=j("option",O,O.label),r=g?Y(O):[];X.appendChild(_.button({type:"button",class:ae(["cms-time-option",me(g,"is-selected"),me(m,"is-disabled")]),disabled:m,onClick:()=>T==null?void 0:T(f,{part:ne,optionValue:ue})},_.span({class:"cms-time-option-label"},...E(null,"default",O,Q)),r.length?_.span({class:"cms-time-option-point"},...r):null))}),Z.appendChild(X),Z};return ce.appendChild(le(o(e.hoursLabel)||"Ore","hour",ys(1,23))),ce.appendChild(le(o(e.minutesLabel)||"Min","minute",ys(c,59))),i&&ce.appendChild(le(o(e.secondsLabel)||"Sec","second",ys(y,59))),ie.appendChild(ce),ie},Wn=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},bo=(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,y)=>{const a=c.getAttribute("data-time-part")||String(y),l=n&&Number.isFinite(n[a])?n[a]:null;l!=null&&(c.scrollTop=l);const b=c.querySelector(".cms-time-option.is-selected");if(!b)return;const R=Math.max(0,c.scrollHeight-c.clientHeight),C=b.offsetTop-(c.clientHeight-b.offsetHeight)/2,w=Math.max(0,Math.min(R,C));if(Math.abs(c.scrollTop-w)<1){c.scrollTop=w;return}if(s&&typeof c.scrollTo=="function"){c.scrollTo({top:w,behavior:s});return}c.scrollTop=w})},yo=(t,e={})=>{var dn,un,nn,sn,ze,Ve,et,ct,gt,pt,Ct,yt;const{props:n,children:s}=JSswift.uiNormalizeArgs(t),i=e.calendar===!0,c=n.slots||{},y=Ye(n.size,()=>{const h=String(o(n.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(h)?`cms-size-${h}`:""}),a=String(o((sn=(nn=n.mode)!=null?nn:o((un=(dn=n.rangeMultiple)!=null?dn:n.multipleRange)!=null?un:n.multiRange)?"range-multiple":null)!=null?sn:n.range&&n.multiple?"range-multiple":n.range?"range":n.multiple?"multiple":"single")).toLowerCase(),l=["range-multiple","multiple-range","rangemultiple","multiplerange","range_multiple","multiple_range","multi-range","multi_range","ranges"].includes(a)?"range-multiple":a==="range"?"range":a==="multiple"?"multiple":"single",b=n.model||(_t(n.value)||Pt(n.value)?n.value:null),R=kt(b,i?"UI.Calendar:model":"UI.Datepicker:model"),C=R?R.get():o(n.value),w=o((ze=n.rangeAs)!=null?ze:n.rangeModel)==="array"||Array.isArray(C),T=o((Ve=n.rangeMultipleAs)!=null?Ve:n.multipleRangeAs)==="array"||Array.isArray(C)&&Array.isArray(C[0]),ee=()=>{var h,se,ve;return l==="single"&&!!o((ve=(se=(h=n.withTime)!=null?h:n.time)!=null?se:n.timePicker)!=null?ve:n.enableTime)},K=()=>{var se,ve,Me,Je,Oe,He,Xe,it;const h=Qt(Mt((ve=(se=o(n.timeValue))!=null?se:R?R.get():o(n.value))!=null?ve:C,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((Je=(Me=n.timeWithSeconds)!=null?Me:n.withSeconds)!=null?Je:n.showSeconds)||/:\d{2}:\d{2}$/.test(h)||/:\d{2}:\d{2}$/.test(o(n.timeFormat)||""),min:o((Oe=n.timeMin)!=null?Oe:n.minTime),max:o((He=n.timeMax)!=null?He:n.maxTime),use12h:o((it=(Xe=n.time12h)!=null?Xe:n.use12h)!=null?it:n.ampm)}},re=()=>{var se,ve;const h=Number(o((ve=(se=n.timeMinuteStep)!=null?se:n.minuteStep)!=null?ve:5));return Math.max(1,Math.min(30,Number.isFinite(h)?h:5))},H=()=>{var se,ve;const h=Number(o((ve=(se=n.timeSecondStep)!=null?se:n.secondStep)!=null?ve:5));return Math.max(1,Math.min(30,Number.isFinite(h)?h:5))},j=h=>String(h).padStart(2,"0"),Y=(h,se,ve)=>{const Me=new Date(h,se,ve);return Me.getFullYear()!==h||Me.getMonth()!==se||Me.getDate()!==ve?null:Me},W=h=>!(h instanceof Date)||Number.isNaN(h.getTime())?null:`${h.getFullYear()}-${j(h.getMonth()+1)}-${j(h.getDate())}`,ie=h=>{if(typeof h!="string")return null;const se=h.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!se)return null;const ve=Number(se[1]),Me=Number(se[2])-1,Je=Number(se[3]),Oe=new Date(ve,Me,Je);return Oe.getFullYear()!==ve||Oe.getMonth()!==Me||Oe.getDate()!==Je?null:Oe},ge=(h,se)=>{const ve=ie(h);return ve?(ve.setDate(ve.getDate()+se),W(ve)):null},ce=(h,se)=>new Date(h.getFullYear(),h.getMonth()+se,1),le=h=>{if(h instanceof Date&&!Number.isNaN(h.getTime()))return new Date(h.getFullYear(),h.getMonth(),1);const se=r(h),ve=ie(se);return ve?new Date(ve.getFullYear(),ve.getMonth(),1):new Date},oe=()=>W(new Date),ne=(h,se)=>!!h&&!!se&&h===se,J=(h,se)=>h==null&&se==null?0:h==null?-1:se==null?1:h<se?-1:h>se?1:0,Z=(h,se)=>{const ve=ie(h),Me=ie(se);return!ve||!Me?0:Math.round((Me.getTime()-ve.getTime())/864e5)},X=h=>Array.isArray(h)?h.slice():h==null||h===""?[]:[h],ue=h=>({from:(h==null?void 0:h.from)||null,to:(h==null?void 0:h.to)||null}),F=h=>Array.isArray(h)?h.map(ue):[],f=h=>{const se=ue(h);return w?[se.from,se.to]:se},m=h=>F(h).map(se=>T?[se.from,se.to]:se),g=h=>l==="multiple"?Array.isArray(h)?h.slice():[]:l==="range"?ue(h):l==="range-multiple"?F(h):h||null,O=h=>l==="multiple"?Array.isArray(h)?h.slice():[]:l==="range"?f(h):l==="range-multiple"?m(h):h||"",Q=h=>JSON.stringify(O(h)),r=h=>{if(h==null||h==="")return null;if(h instanceof Date)return W(h);if(typeof h=="number")return W(new Date(h));if(typeof h!="string")return typeof h=="object"&&h.date!=null?r(h.date):null;const se=h.trim();if(!se)return null;const ve=se.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:$|[T\s])/);if(ve){const He=Y(Number(ve[1]),Number(ve[2])-1,Number(ve[3]));return W(He)}const Me=se.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(Me){const He=Me[3].length===2?2e3+Number(Me[3]):Number(Me[3]),Xe=Y(He,Number(Me[2])-1,Number(Me[1]));return W(Xe)}if(/^\d{1,4}$/.test(se))return null;const Je=new Date(se);if(Number.isNaN(Je.getTime()))return null;const Oe=se.match(/(?:^|[^\d])(\d{4})(?!\d)/);return Oe&&Je.getFullYear()!==Number(Oe[1])?null:W(Je)},x=h=>{var Me,Je,Oe,He,Xe,it;if(h==null||h==="")return{from:null,to:null};let se=null,ve=null;if(Array.isArray(h))se=r(h[0]),ve=r(h[1]);else if(typeof h=="object")se=r((Oe=(Je=(Me=h.from)!=null?Me:h.start)!=null?Je:h.dateFrom)!=null?Oe:h.departure),ve=r((it=(Xe=(He=h.to)!=null?He:h.end)!=null?Xe:h.dateTo)!=null?it:h.return);else{const ht=String(h).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];se=r(ht[0]),ve=r(ht[1])}return se&&ve&&se>ve&&([se,ve]=[ve,se]),{from:se,to:ve}},p=h=>{const se=[],ve=new Set,Me=Je=>{const Oe=x(Je);if(!Oe.from)return;const He=`${Oe.from||""}|${Oe.to||""}`;ve.has(He)||(ve.add(He),se.push(Oe))};if(h==null||h==="")return se;if(Array.isArray(h))if(h.every(Oe=>Oe==null||typeof Oe=="string"||typeof Oe=="number"||Oe instanceof Date)){const Oe=h.map(r).filter(Boolean);for(let He=0;He<Oe.length;He+=2)Me({from:Oe[He],to:Oe[He+1]||null})}else h.forEach(Oe=>Me(Oe));else if(typeof h=="object"&&Array.isArray(h.ranges))h.ranges.forEach(Je=>Me(Je));else if(typeof h=="object")Me(h);else{const Oe=(String(h).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(r).filter(Boolean);for(let He=0;He<Oe.length;He+=2)Me({from:Oe[He],to:Oe[He+1]||null})}return se.sort((Je,Oe)=>J(Je.from,Oe.from)||J(Je.to,Oe.to))},P=h=>{const se=[];return X(h).forEach(ve=>{const Me=r(ve);Me&&!se.includes(Me)&&se.push(Me)}),se.sort()},U=h=>l==="range"?x(h):l==="range-multiple"?p(h):l==="multiple"?P(h):r(h),G=()=>{var h;return r(o((h=n.min)!=null?h:n.minDate))},de=()=>{var h;return r(o((h=n.max)!=null?h:n.maxDate))},A=()=>o(n.locale)||void 0,u=()=>{var se,ve;const h=Number(o((ve=(se=n.firstDayOfWeek)!=null?se:n.weekStart)!=null?ve:1));return Number.isFinite(h)?(h%7+7)%7:1},k=()=>{var ve;const h=l==="range"||l==="range-multiple"?2:1,se=Number((ve=o(n.monthsToShow))!=null?ve:h);return Math.max(1,Math.min(4,Number.isFinite(se)?se:h))},I=()=>{const h=G(),se=de();let ve=r(o(n.defaultMonth))||oe();return h&&ve<h&&(ve=h),se&&ve>se&&(ve=se),ve||h||se||oe()},B=()=>o(n.confirm)?Ae:Le,pe=h=>{const se=ie(h);return se?{date:h,value:h,year:se.getFullYear(),month:se.getMonth()+1,day:se.getDate(),weekday:se.getDay(),today:ne(h,oe())}:{date:h,value:h}},Se=(h,se)=>h==null?!1:Array.isArray(h)?h.some(ve=>r(ve)===se):h instanceof Set?h.has(se):typeof h=="function"?!!h(se,pe(se)):typeof h=="string"||h instanceof Date||typeof h=="number"?r(h)===se:!1,ye=h=>{var it,ht,xt,$t,zt,Ft,on,fn,mn,Sn,zn,Tn,Pn;if(!h)return!1;const se=G(),ve=de();if(se&&h<se||ve&&h>ve)return!1;const Me=o((ht=(it=n.options)!=null?it:n.enableDates)!=null?ht:n.allowedDates);if(Me!=null&&!Se(Me,h))return!1;const Je=o(($t=(xt=n.disableDates)!=null?xt:n.disabledDates)!=null?$t:n.notAllowedDates);if(Je!=null&&Se(Je,h))return!1;const Oe=(zt=ie(h))==null?void 0:zt.getDay();if(Array.isArray(o((Ft=n.allowedWeekdays)!=null?Ft:n.weekdays))&&Oe!=null&&!o((on=n.allowedWeekdays)!=null?on:n.weekdays).map(xn=>Number(xn)).includes(Oe)||o(n.weekdaysOnly)&&(Oe===0||Oe===6)||o(n.weekendsOnly)&&Oe!=null&&Oe!==0&&Oe!==6)return!1;const He=B(),Xe=l==="range"?He!=null&&He.from&&!(He!=null&&He.to)?He:null:l==="range-multiple"&&Array.isArray(He)&&He.length&&(fn=He[He.length-1])!=null&&fn.from&&!((mn=He[He.length-1])!=null&&mn.to)?He[He.length-1]:null;if(Xe!=null&&Xe.from){const Cn=Math.abs(Z(Xe.from,h)),xn=Number(o((zn=(Sn=n.minRange)!=null?Sn:n.minDays)!=null?zn:n.minNights)),En=Number(o((Pn=(Tn=n.maxRange)!=null?Tn:n.maxDays)!=null?Pn:n.maxNights));if(Number.isFinite(xn)&&Cn<xn||Number.isFinite(En)&&Cn>En)return!1}return!0},V=h=>{var Me,Je;if(!h)return"";const se=ie(h);return!se||String(o((Je=(Me=n.displayMask)!=null?Me:n.mask)!=null?Je:"")||"").toLowerCase()==="iso"||o(n.isoDisplay)===!0?h:new Intl.DateTimeFormat(A(),{year:"numeric",month:"short",day:"2-digit"}).format(se)},D=(h,se=z)=>{if(l==="range-multiple")return!Array.isArray(h)||!h.length?"":h.length>2&&o(n.compactMultiple)!==!1?`${h.length} ${o(n.multipleRangeLabel)||"intervalli selezionati"}`:h.map(Je=>{const Oe=Je!=null&&Je.from?V(Je.from):"",He=Je!=null&&Je.to?V(Je.to):"";return Oe&&He?`${Oe} -> ${He}`:Oe||He||""}).filter(Boolean).join("; ");if(l==="multiple")return!Array.isArray(h)||!h.length?"":h.length>3&&o(n.compactMultiple)!==!1?`${h.length} ${o(n.multipleLabel)||"date selezionate"}`:h.map(V).join(", ");if(l==="range"){const Je=h!=null&&h.from?V(h.from):"",Oe=h!=null&&h.to?V(h.to):"";return Je&&Oe?`${Je} -> ${Oe}`:Je||Oe||""}const ve=V(h);if(!ee())return ve;const Me=he(se);return[ve,Me].filter(Boolean).join(" \u2022 ")},q=h=>(String(h||"").match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(r).filter(Boolean),Ne=h=>{if(h==null||h==="")return l==="multiple"||l==="range-multiple"?[]:l==="range"?{from:null,to:null}:null;const se=q(h);if(l==="range-multiple"){const ve=[];for(let Me=0;Me<se.length;Me+=2)se[Me]&&ve.push({from:se[Me],to:se[Me+1]||null});return ve}return l==="multiple"?se:l==="range"?{from:se[0]||null,to:se[1]||null}:se[0]||r(h)},ke=()=>l==="multiple"||l==="range-multiple"?[]:l==="range"?{from:null,to:null}:null,te=(h,se=null)=>{var He;if(!ee())return null;const ve=K(),Me=o(n.timeValue),Je=h!=null?h:Me,Oe=Mt(Je,ve);return lt((He=Oe!=null?Oe:se)!=null?He:null)},xe=()=>o(n.confirm)?we:z,be=(h=Le,se=z)=>l==="single"&&ee()?er(h||null,se,K()):O(h),Ce=(h=Le,se=z)=>JSON.stringify(be(h,se)),he=h=>Un(h,K());let Le=U(C),Ae=g(Le),z=te(C,Mt(o(n.timeValue),K())),we=lt(z),M=null,N=null,S=le(l==="range"?(Le==null?void 0:Le.from)||(Le==null?void 0:Le.to)||I():l==="range-multiple"?((et=Le==null?void 0:Le[Le.length-1])==null?void 0:et.from)||((ct=Le==null?void 0:Le[Le.length-1])==null?void 0:ct.to)||I():l==="multiple"?Le[0]||I():Le||I()),d=null,L=null;const fe=h=>{const se=h instanceof Date?h:ie(r(h));if(!se)return-1;const ve=se.getFullYear(),Me=se.getMonth();for(let Je=0;Je<k();Je+=1){const Oe=ce(S,Je);if(Oe.getFullYear()===ve&&Oe.getMonth()===Me)return Je}return-1},Fe={...n,label:(gt=n.label)!=null?gt:n.placeholder},Te=Fe.label!=null||JSswift.ui.getSlot(c,"label")!=null,$=l==="range"?"Seleziona andata e ritorno":l==="range-multiple"?"Seleziona intervalli":l==="multiple"?"Seleziona date":"Seleziona data",_e=i?null:_.input({class:ae(["cms-input","cms-date-display",y,me(n.manualInput,"is-manual"),n.inputClass]),type:"text",autocomplete:"off",placeholder:Te?"":(pt=n.placeholder)!=null?pt:$,readOnly:!o(n.manualInput),disabled:!!o(n.disabled),value:D(Le,z)}),Re=_.div({style:{display:"contents"}}),Pe=i?null:_.div({class:"cms-date-control",style:{display:"contents"}},_e,Re),De=i?null:v.FormField({...Fe,iconRight:(Ct=n.iconRight)!=null?Ct:"calendar_month",control:Pe,getValue:()=>_e.value,onClear:()=>{o(n.disabled)||o(n.readonly)||(Qe(ke(),null),d&&St())},onFocus:()=>_e.focus()}),We=(h,se={})=>{var Je,Oe;const ve=se.focusIso||(l==="range"?(h==null?void 0:h.from)||(h==null?void 0:h.to)||I():l==="range-multiple"?((Je=h==null?void 0:h[h.length-1])==null?void 0:Je.from)||((Oe=h==null?void 0:h[h.length-1])==null?void 0:Oe.to)||I():l==="multiple"?(h==null?void 0:h[0])||I():h||I());let Me=le(ve);if(se.preserveMonthOffset){const He=Number.isInteger(se.visibleMonthOffset)?se.visibleMonthOffset:fe(se.anchorIso||se.focusIso||ve);He>0&&(Me=ce(Me,-He))}S=Me},qe=()=>{Re.replaceChildren();const h=o(n.name);if(!h)return;const se=(Je,Oe)=>{Re.appendChild(_.input({type:"hidden",name:Je,value:Oe!=null?Oe:""}))},ve=Le;if(l==="single"){se(h,be(ve,z));return}if(l==="range"){se(o(n.nameFrom)||`${h}_from`,(ve==null?void 0:ve.from)||""),se(o(n.nameTo)||`${h}_to`,(ve==null?void 0:ve.to)||"");return}if(l==="range-multiple"){const Je=Array.isArray(ve)?ve:[],Oe=/\[\]$/.test(o(n.nameFrom)||"")?o(n.nameFrom):`${o(n.nameFrom)||`${h}_from`}[]`,He=/\[\]$/.test(o(n.nameTo)||"")?o(n.nameTo):`${o(n.nameTo)||`${h}_to`}[]`;Je.forEach(Xe=>{se(Oe,(Xe==null?void 0:Xe.from)||""),se(He,(Xe==null?void 0:Xe.to)||"")});return}const Me=/\[\]$/.test(h)?h:`${h}[]`;(Array.isArray(ve)?ve:[]).forEach(Je=>se(Me,Je))},Ze=()=>{var h;i||(_e.readOnly=!o(n.manualInput),_e.disabled=!!o(n.disabled),_e.setAttribute("aria-expanded",d?"true":"false"),_e.value=D(Le,z),qe(),(h=De==null?void 0:De._refresh)==null||h.call(De))},Qe=(h,se,ve={})=>{var Xe,it,ht;const Me=U(h),Je=ee()?lt((Xe=Mt(ve.timeValue!=null?ve.timeValue:ve.preserveTime?xe():h,K()))!=null?Xe:ve.preserveTime?xe():null):null,Oe=Ce(Le,z);Le=g(Me),Ae=g(Me),ee()&&(z=lt(Je),we=lt(Je)),M=null,We(Me,ve),Ze(),wt(),R&&ve.fromModel!==!0&&R.set(be(Me,Je));const He=Ce(Me,Je);if(ve.emit!==!1&&He!==Oe){const xt=be(Me,Je);(it=n.onInput)==null||it.call(n,xt,se),(ht=n.onChange)==null||ht.call(n,xt,se)}return Me},Ee=(h,se,ve={})=>{var He,Xe;if(!ee())return null;const Me=lt(Mt(h,K()));if(o(n.confirm)&&ve.commit!==!0)return we=Me,wt(),Me;const Je=Ce(Le,z);z=lt(Me),we=lt(Me),Ze(),wt(),R&&ve.fromModel!==!0&&R.set(be(Le,Me));const Oe=Ce(Le,Me);if(ve.emit!==!1&&Oe!==Je){const it=be(Le,Me);(He=n.onInput)==null||He.call(n,it,se),(Xe=n.onChange)==null||Xe.call(n,it,se)}return Me},Be=(h,se,ve={})=>{if(o(n.confirm)){Ae=g(U(h)),ee()&&(ve.timeValue!=null||ve.preserveTime)&&(we=lt(Mt(ve.timeValue!=null?ve.timeValue:xe(),K()))),M=null,We(Ae,ve),wt();return}Qe(h,se,ve)},tt=()=>{const h=B();if(l==="range")return!(h!=null&&h.from)||h!=null&&h.to||!M?h:J(h.from,M)<=0?{from:h.from,to:M}:{from:M,to:h.from};if(l==="range-multiple"){const se=Array.isArray(h)&&h.length?h[h.length-1]:null;return!(se!=null&&se.from)||se!=null&&se.to||!M?se:J(se.from,M)<=0?{from:se.from,to:M}:{from:M,to:se.from}}return h},nt=()=>{if(l==="range"){const h=tt();return h!=null&&h.from?[h]:[]}if(l==="range-multiple"){const h=Array.isArray(B())?B():[];if(!h.length)return[];const se=tt();return se!=null&&se.from?[...h.slice(0,-1),se]:h}return[]},dt=h=>{const se=B();return l==="multiple"?se.includes(h):l==="range-multiple"?Array.isArray(se)&&se.some(ve=>ne(ve==null?void 0:ve.from,h)||ne(ve==null?void 0:ve.to,h)):l==="range"?ne(se==null?void 0:se.from,h)||ne(se==null?void 0:se.to,h):ne(se,h)},ut=h=>l!=="range"&&l!=="range-multiple"?!1:nt().some(se=>(se==null?void 0:se.from)&&(se==null?void 0:se.to)&&h>=se.from&&h<=se.to),bt=(h,se={})=>{const ve=B(),Me=l==="range"?ve:l==="range-multiple"&&Array.isArray(ve)&&ve.length?ve[ve.length-1]:null;!(Me!=null&&Me.from)||Me!=null&&Me.to||M===h||(M=h,se.render!==!1&&wt())},ot=()=>i||o(n.confirm)||n.closeOnSelect===!1?!1:l==="multiple"||l==="range-multiple"?!!n.closeOnSelect:!0,ft=(h,se,ve={})=>{var Je;if(!ye(h)||o(n.disabled)||o(n.readonly))return;const Me={focusIso:h,anchorIso:h,preserveTime:ee(),timeValue:xe(),preserveMonthOffset:!!d&&k()>1,visibleMonthOffset:Number.isInteger(ve.visibleMonthOffset)?ve.visibleMonthOffset:null};if(l==="multiple"){const Oe=P(B()),He=Oe.includes(h)?Oe.filter(Xe=>Xe!==h):[...Oe,h];Be(He.sort(),se,Me),ot()&&St();return}if(l==="range"){const Oe=g(B());let He;!Oe.from||Oe.from&&Oe.to?He={from:h,to:null}:J(h,Oe.from)<0?He={from:h,to:Oe.from}:He={from:Oe.from,to:h},Be(He,se,Me),He.to&&ot()&&St();return}if(l==="range-multiple"){const Oe=p(B()),He=Oe.length?Oe[Oe.length-1]:null;let Xe;!(He!=null&&He.from)||He!=null&&He.to?Xe=[...Oe,{from:h,to:null}]:J(h,He.from)<0?Xe=[...Oe.slice(0,-1),{from:h,to:He.from}]:Xe=[...Oe.slice(0,-1),{from:He.from,to:h}],Be(Xe,se,Me),(Je=Xe[Xe.length-1])!=null&&Je.to&&ot()&&St();return}Be(h,se,Me),ot()&&St()},vt=()=>{N=null,Qe(ke(),null,{timeValue:null})},At=()=>{const h=oe();if(!ye(h)){We(h),wt();return}if(l==="range"){const se=ge(h,1),ve=se&&ye(se)?{from:h,to:se}:{from:h,to:null};Be(ve,null);return}if(l==="range-multiple"){const se=ge(h,1),ve=se&&ye(se)?[{from:h,to:se}]:[{from:h,to:null}];Be(ve,null);return}if(l==="multiple"){Be([h],null);return}Be(h,null,{preserveTime:ee(),timeValue:xe()})},at=(h={})=>{bo(L,h)},Vt=()=>{if(!ee())return;const h=Wn(L);Ee(new Date,null,{commit:!o(n.confirm)}),at({scrollState:h}),!o(n.confirm)&&n.closeOnSelect===!0&&St()},Jt=()=>{o(n.confirm)&&(Qe(Ae,null,{timeValue:we,preserveTime:!0}),n.closeOnSelect!==!1&&St())},wt=()=>{var Ri,Ji,Oi,Di,Hi,ji,Vi,$i,Bi,Ui,Wi,Gi,Ki,qi,Yi,Xi,Qi,Zi,el;if(!L)return;const h=A(),se=new Intl.DateTimeFormat(h,{month:"long",year:"numeric"}),ve=new Intl.DateTimeFormat(h,{weekday:"short"}),Me=Array.from({length:7},(Ge,st)=>{const Ot=(u()+st)%7;return ve.format(new Date(2024,0,7+Ot))}),Je=B(),Oe=Ge=>{let st=JSswift.ui.renderSlot(c,"point",Ge,null);return st==null&&(st=JSswift.ui.renderSlot(c,"dayPoint",Ge,null)),st==null&&n.pointIcon!=null&&(Ge.selected||Ge.inRange||Ge.today)&&(st=typeof n.pointIcon=="string"?v.Icon({name:n.pointIcon,size:10}):JSswift.ui.slot(n.pointIcon,Ge)),E(null,"default",Ge,st)},He=(Ge,st)=>{const Ot=Ge.getFullYear(),Mn=Ge.getMonth(),Rn=new Date(Ot,Mn,1),es=(Rn.getDay()-u()+7)%7,Ns=new Date(Ot,Mn,1-es),ts=_.div({class:"cms-date-month"});ts.appendChild(_.div({class:"cms-date-month-title"},se.format(Rn)));const tl=_.div({class:"cms-date-weekdays"});Me.forEach(Jn=>tl.appendChild(_.div({class:"cms-date-weekday"},Jn))),ts.appendChild(tl);const nl=_.div({class:"cms-date-grid"});for(let Jn=0;Jn<42;Jn+=1){const As=new Date(Ns.getFullYear(),Ns.getMonth(),Ns.getDate()+Jn),Tt=W(As),sl=As.getMonth()===Mn,ol=dt(Tt),il=ut(Tt),ll=(l==="range"||l==="range-multiple")&&nt().some(Lt=>ne(Lt==null?void 0:Lt.from,Tt)),rl=(l==="range"||l==="range-multiple")&&nt().some(Lt=>ne(Lt==null?void 0:Lt.to,Tt)),ks=!ye(Tt),Fs={...pe(Tt),selected:ol,inRange:il,rangeStart:ll,rangeEnd:rl,disabled:ks,outside:!sl,value:Je,select:()=>ft(Tt,null,{visibleMonthOffset:st})},_s=Oe(Fs),Cr=JSswift.ui.renderSlot(c,"day",Fs,String(As.getDate())),xr=E(null,"default",Fs,Cr),Nr=_.button({type:"button",class:ae(["cms-date-day",me(!sl,"is-outside"),me(ol,"is-selected"),me(il,"is-in-range"),me(ll,"is-range-start"),me(rl,"is-range-end"),me(ks,"is-disabled"),me(ne(Tt,oe()),"is-today"),me(_s.length,"has-point")]),disabled:ks,onMouseDown:Lt=>{Lt.button===0&&(N=Tt,Lt.preventDefault(),ft(Tt,Lt,{visibleMonthOffset:st}))},onClick:Lt=>{if(N!=null&&Lt.detail!==0){N=null;return}N=null,ft(Tt,Lt,{visibleMonthOffset:st})},onMouseEnter:()=>bt(Tt),onFocus:()=>bt(Tt,{render:!1})},_.span({class:"cms-date-day-label"},...xr),_s.length?_.span({class:"cms-date-day-point"},..._s):null);nl.appendChild(Nr)}return ts.appendChild(nl),ts},Xe=G(),it=de(),ht=[S.getFullYear(),(Ri=ie(oe()))==null?void 0:Ri.getFullYear(),(Ji=ie(Xe))==null?void 0:Ji.getFullYear(),(Oi=ie(it))==null?void 0:Oi.getFullYear(),(Di=ie(o(n.defaultMonth)))==null?void 0:Di.getFullYear()];l==="range"?ht.push((Hi=ie(Je==null?void 0:Je.from))==null?void 0:Hi.getFullYear(),(ji=ie(Je==null?void 0:Je.to))==null?void 0:ji.getFullYear()):l==="range-multiple"?Je.forEach(Ge=>{var st,Ot;ht.push((st=ie(Ge==null?void 0:Ge.from))==null?void 0:st.getFullYear(),(Ot=ie(Ge==null?void 0:Ge.to))==null?void 0:Ot.getFullYear())}):l==="multiple"?Je.forEach(Ge=>{var st;return ht.push((st=ie(Ge))==null?void 0:st.getFullYear())}):ht.push((Vi=ie(Je))==null?void 0:Vi.getFullYear());const xt=ht.filter(Ge=>Number.isFinite(Ge)),$t=(xt.length?Math.min(...xt):S.getFullYear())-100,zt=(xt.length?Math.max(...xt):S.getFullYear())+50,Ft=Number(o((Ui=(Bi=n.yearStart)!=null?Bi:Xe?($i=ie(Xe))==null?void 0:$i.getFullYear():null)!=null?Ui:$t)),on=Number(o((Ki=(Gi=n.yearEnd)!=null?Gi:it?(Wi=ie(it))==null?void 0:Wi.getFullYear():null)!=null?Ki:zt)),fn=_.select({class:"cms-date-select",value:String(S.getMonth()),onChange:Ge=>{var st;S=new Date(S.getFullYear(),Number(Ge.currentTarget.value),1),(st=n.onNavigate)==null||st.call(n,{month:S.getMonth()+1,year:S.getFullYear()}),wt()}},...Array.from({length:12},(Ge,st)=>us({value:String(st)},new Intl.DateTimeFormat(h,{month:"long"}).format(new Date(2024,st,1))))),mn=_.select({class:"cms-date-select cms-date-select-year",value:String(S.getFullYear()),onChange:Ge=>{var st;S=new Date(Number(Ge.currentTarget.value),S.getMonth(),1),(st=n.onNavigate)==null||st.call(n,{month:S.getMonth()+1,year:S.getFullYear()}),wt()}},...Array.from({length:Math.max(1,on-Ft+1)},(Ge,st)=>{const Ot=Ft+st;return us({value:String(Ot)},String(Ot))})),Sn=_.div({class:"cms-date-header"},_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Ge;S=ce(S,-1),(Ge=n.onNavigate)==null||Ge.call(n,{month:S.getMonth()+1,year:S.getFullYear()}),wt()}},v.Icon({name:"chevron_left",size:16})),_.div({class:"cms-date-header-center"},fn,mn),_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Ge;S=ce(S,1),(Ge=n.onNavigate)==null||Ge.call(n,{month:S.getMonth()+1,year:S.getFullYear()}),wt()}},v.Icon({name:"chevron_right",size:16}))),zn=_.div({class:"cms-date-shortcuts"}),Tn=o((qi=n.shortcuts)!=null?qi:n.presets)||[];Tn.forEach((Ge,st)=>{var Rn,es;if(!Ge)return;const Ot=typeof Ge.value=="function"?Ge.value({today:oe()}):Ge.value,Mn=(es=(Rn=Ge.label)!=null?Rn:Ge.text)!=null?es:`Preset ${st+1}`;zn.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>Be(Ot,null,{preserveTime:ee(),timeValue:xe()})},Mn))});const Pn=_.div({class:"cms-date-months"});for(let Ge=0;Ge<k();Ge+=1)Pn.appendChild(He(ce(S,Ge),Ge));const Cn=D(Je,xe()),xn=_.div({class:"cms-date-value"},...E(c,"value",{value:Je,displayValue:Cn,mode:l,timeValue:xe()},Cn||E(c,"default",{},s))),En=_.div({class:"cms-time-header"}),hr=_.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"));En.appendChild(hr);const br=ee()?ho({props:{min:o((Yi=n.timeMin)!=null?Yi:n.minTime),max:o((Xi=n.timeMax)!=null?Xi:n.maxTime),use12h:o((Zi=(Qi=n.time12h)!=null?Qi:n.use12h)!=null?Zi:n.ampm),hoursLabel:o(n.timeHoursLabel)||"Ore",minutesLabel:o(n.timeMinutesLabel)||"Min",secondsLabel:o(n.timeSecondsLabel)||"Sec"},slots:c,slotPrefix:"time",value:xe(),withSeconds:!1,minuteStep:1,secondStep:H(),disabled:!!o(n.disabled),readonly:!!o(n.readonly),embedded:!0,pointIcon:o(n.timePointIcon),shortcuts:o((el=n.timeShortcuts)!=null?el:n.timePresets),onSelect:Ge=>{const st=Wn(L);Ee(Ge,null),at({scrollState:st})}}):null,yr=_.div({class:"cms-date-footer-info"},xn),wr=_.div({class:ae(["cms-date-footer",me(ee(),"has-time")])},yr,_.div({class:"cms-date-actions"},_.button({type:"button",class:"cms-date-action",onClick:At},o(n.todayLabel)||"Oggi"),o(n.clearable)!==!1?_.button({type:"button",class:"cms-date-action",onClick:vt},o(n.clearLabel)||"Reset"):null,o(n.confirm)?_.button({type:"button",class:"cms-date-action is-primary",onClick:Jt},o(n.applyLabel)||"Applica"):null)),vr=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:Vt},o(n.nowLabel)||"Ora")),Sr=ee()?_.div({class:"cms-date-time"},En,br,vr):null;L.replaceChildren(_.div({class:"cms-date-panel-root",onKeydown:Ge=>{var st;Ge.key==="Escape"&&(Ge.preventDefault(),i?(st=n.onEscape)==null||st.call(n,Ge):St())}},Sn,Tn.length?zn:null,_.div({class:"cms-data-time"},Pn,Sr),wr))};function qt(){var h,se,ve,Me;return d||o(n.disabled)||o(n.readonly)||(Ae=g(Le),we=lt(z),M=null,N=null,We(Ae),d=JSswift.overlay.open(({close:Je})=>{var Xe;const Oe=l==="range"||l==="range-multiple"?2:1,He=Number((Xe=o(n.monthsToShow))!=null?Xe:Oe);return L=_.div({class:Ht(["cms-date-panel",o(y),me(He>1,"multi-month"),n.panelClass])}),wt(),L},{type:"date",anchorEl:De._control||_e,placement:n.placement||"bottom-start",offsetX:(h=n.offsetX)!=null?h:0,offsetY:(ve=(se=n.offsetY)!=null?se:n.offset)!=null?ve:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:n.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Ht(["cms-date-overlay",n.panelClass,me(ee(),"has-time")]),onClose:()=>{var Je;d=null,L=null,M=null,Ze(),(Je=n.onClose)==null||Je.call(n)}}),n.panelStyle&&Object.assign(d.panel.style,n.panelStyle),yn(d),Ze(),(Me=n.onOpen)==null||Me.call(n)),d}function St(){if(!d)return;N=null;const h=d;wn(h,()=>JSswift.overlay.close(h.id))}if(i){const h=l==="range"||l==="range-multiple"?2:1,se=Number((yt=o(n.monthsToShow))!=null?yt:h);L=_.div({class:Ht(["cms-date-panel","cms-date-calendar",o(y),me(se>1,"multi-month"),n.panelClass,n.class]),style:n.style})}return i||_e.addEventListener("focus",h=>{var se;(se=n.onFocus)==null||se.call(n,h),n.openOnFocus!==!1&&qt()}),i||_e.addEventListener("click",h=>{var se;(se=n.onClick)==null||se.call(n,h),qt()}),i||_e.addEventListener("keydown",h=>{if(h.key==="Escape"){d&&(h.preventDefault(),St());return}(h.key==="ArrowDown"||h.key==="Enter"||h.key===" ")&&(h.preventDefault(),qt()),(h.key==="Backspace"||h.key==="Delete")&&!o(n.manualInput)&&o(n.clearable)!==!1&&(h.preventDefault(),vt())}),!i&&o(n.manualInput)?(_e.addEventListener("input",h=>{var se;(se=n.onTyping)==null||se.call(n,_e.value,h)}),_e.addEventListener("change",h=>{const se=Ne(_e.value);Qe(se,h,{timeValue:Mt(_e.value,K()),preserveTime:!Mt(_e.value,K())})}),_e.addEventListener("blur",h=>{var ve;(ve=n.onBlur)==null||ve.call(n,h);const se=Ne(_e.value);_e.value===""?vt():Qe(se,h,{timeValue:Mt(_e.value,K()),preserveTime:!Mt(_e.value,K())})})):i||_e.addEventListener("blur",h=>{var se;return(se=n.onBlur)==null?void 0:se.call(n,h)}),R&&R.watch(h=>{const se=U(h),ve=te(h);Ce(se,ve)!==Ce(Le,z)&&(Le=se,Ae=g(Le),z=lt(ve),we=lt(ve),M=null,We(Le),Ze(),wt())},i?"UI.Calendar:watch":"UI.Datepicker:watch"),JSswift.reactive.effect(()=>{!R&&n.value!=null?(Le=U(o(n.value)),Ae=g(Le),z=te(o(n.value)),we=lt(z)):ee()&&n.timeValue!=null&&(z=te(o(n.timeValue)),we=lt(z)),Ze(),wt(),d&&o(n.disabled)&&St()},i?"UI.Calendar:render":"UI.Datepicker:render"),i?(L._calendar=L,L._date=L,L._getValue=()=>be(Le,z),L._setValue=h=>Qe(h,null,{emit:!1,timeValue:te(h)}),L._clear=vt,L._select=h=>{const se=r(h);se&&ft(se,null)},L._time=()=>lt(z),L):(De._input=_e,De._date=_e,De._open=qt,De._close=St,De._getValue=()=>be(Le,z),De._setValue=h=>Qe(h,null,{emit:!1,timeValue:te(h)}),De._time=()=>lt(z),De._panel=()=>(d==null?void 0:d.panel)||null,De)};v.Datepicker=(...t)=>yo(t),v.Calendar=(...t)=>yo(t,{calendar:!0}),v.Date=v.Datepicker,JSswift.ui.Datepicker=v.Datepicker,JSswift.ui.Calendar=v.Calendar,JSswift.ui.Date=v.Date,(mi=JSswift.isDev)!=null&&mi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Datepicker={signature:"UI.Datepicker(props)",props:{value:"string | { from, to } | string[] | Array<{ from, to }> | Array<[from, to]>",model:"rod | [get,set] signal",mode:'"single"|"range"|"multiple"|"range-multiple"',range:"boolean",multiple:"boolean",rangeMultiple:"boolean",multipleRange:"Alias of rangeMultiple",min:"string",max:"string",minDate:"Alias of min",maxDate:"Alias of max",minRange:"number",maxRange:"number",manualInput:"boolean",firstDayOfWeek:"number",monthsToShow:"number",locale:"string",shortcuts:"Array<{ label, value }>",options:"Array|string|Function",enableDates:"Alias of options",disableDates:"Array|string|Function",label:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",pointIcon:"String|Node|Function|Array",withTime:"boolean",timeValue:"string|Date",timeMin:"string",timeMax:"string",timeMinuteStep:"number",timeSecondStep:"number",timeWithSeconds:"boolean",timeShortcuts:"Array<{ label, value }>",timePointIcon:"String|Node|Function|Array",clearable:"boolean",confirm:"boolean",name:"string",nameFrom:"string",nameTo:"string",size:'"xs"|"sm"|"md"|"lg"|"xl"',class:"string",style:"object"},slots:{day:"Day content ({ date, selected, inRange, disabled, outside })",point:"Point/icon in the day",dayPoint:"Alias of point",value:"Footer value renderer ({ value, displayValue, mode })",timeOption:"Renderer for a time option in the integrated footer",timePoint:"Point/icon in the footer time option",timeShortcut:"Integrated time shortcut renderer",label:"Floating label",topLabel:"Top label",icon:"Left icon",iconRight:"Right icon",default:"Fallback value content"},events:{onChange:"(value, event)",onInput:"(value, event)",onOpen:"void",onClose:"void",onNavigate:"({ month, year })"},returns:"HTMLDivElement (field wrapper) con ._input, ._open(), ._close(), ._getValue(), ._setValue(value)",description:"Reactive datepicker input with fixed overlay, single/range/multiple/multi-range modes, model, min/max, presets, xs-xl sizes, and optional time support in a unified interface."},v.meta.Calendar={...v.meta.Datepicker,signature:"UI.Calendar(props)",returns:"HTMLDivElement calendar panel con ._getValue(), ._setValue(value), ._clear(), ._select(value)",description:"Standalone interactive calendar panel using the same engine and styling as UI.Datepicker, with direct model persistence."},v.meta.Date=v.meta.Datepicker),v.Time=(...t)=>{var Q,r,x;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Ye(e.size,()=>{const p=String(o(e.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(p)?`cms-size-${p}`:""}),c=()=>{var P,U,G,de,A;const p=Qt(Mt(b?b.get():(P=o(e.value))!=null?P:R,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!o((U=e.withSeconds)!=null?U:e.showSeconds)||/:\d{2}:\d{2}$/.test(p),min:o((G=e.min)!=null?G:e.minTime),max:o((de=e.max)!=null?de:e.maxTime),use12h:o((A=e.use12h)!=null?A:e.ampm)}},y=()=>{var P;const p=Number(o((P=e.minuteStep)!=null?P:1));return Math.max(1,Math.min(30,Number.isFinite(p)?p:5))},a=()=>{var P;const p=Number(o((P=e.secondStep)!=null?P:1));return Math.max(1,Math.min(30,Number.isFinite(p)?p:5))},l=e.model||(_t(e.value)||Pt(e.value)?e.value:null),b=kt(l,"UI.Time:model"),R=b?b.get():o(e.value),C=p=>Mt(p,c()),w=p=>Un(p,c()),T=p=>Qt(p,c()),ee=p=>JSON.stringify(T(p));let K=lt(C(R)),re=lt(K),H=null,j=null;const Y={...e,label:(Q=e.label)!=null?Q:e.placeholder},W=Y.label!=null||JSswift.ui.getSlot(s,"label")!=null,ie=_.input({class:ae(["cms-input","cms-time-display",i,me(e.manualInput,"is-manual"),e.inputClass]),type:"text",autocomplete:"off",placeholder:W?"":(r=e.placeholder)!=null?r:"Seleziona orario",readOnly:!o(e.manualInput),disabled:!!o(e.disabled),value:w(K)});ie.setAttribute("aria-haspopup","dialog");const ge=_.div({style:{display:"contents"}}),ce=_.div({class:"cms-time-control",style:{display:"contents"}},ie,ge),le=v.FormField({...Y,iconRight:(x=e.iconRight)!=null?x:"schedule",control:ce,getValue:()=>ie.value,onClear:()=>{o(e.disabled)||o(e.readonly)||(Z(null,null,{commit:!0}),H&&O())},onFocus:()=>ie.focus()}),oe=()=>o(e.confirm)?re:K,ne=()=>{ge.replaceChildren();const p=o(e.name);p&&ge.appendChild(_.input({type:"hidden",name:p,value:T(K)}))},J=()=>{var p;ie.readOnly=!o(e.manualInput),ie.disabled=!!o(e.disabled),ie.setAttribute("aria-expanded",H?"true":"false"),ie.value=w(K),ne(),(p=le._refresh)==null||p.call(le)},Z=(p,P,U={})=>{var u,k;const G=lt(C(p));if(o(e.confirm)&&U.commit!==!0)return re=lt(G),m(),G;const de=ee(K);K=lt(G),re=lt(G),J(),m(),b&&U.fromModel!==!0&&b.set(T(G));const A=ee(G);if(U.emit!==!1&&A!==de){const I=T(G);(u=e.onInput)==null||u.call(e,I,P),(k=e.onChange)==null||k.call(e,I,P)}return G},X=p=>o(e.confirm)||e.closeOnSelect!==!0?!1:c().withSeconds?(p==null?void 0:p.part)==="second":(p==null?void 0:p.part)==="minute",ue=(p={})=>{bo(j,p)},F=()=>{const p=Wn(j);Z(new Date,null,{commit:!o(e.confirm)}),ue({scrollState:p}),!o(e.confirm)&&e.closeOnSelect===!0&&O()},f=()=>{o(e.confirm)&&(Z(re,null,{commit:!0}),e.closeOnSelect!==!1&&O())},m=()=>{var k,I,B,pe;if(!j)return;const p=oe(),P=w(p),U=_.div({class:"cms-time-header"}),G=_.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")),de=c().withSeconds;de&&G.appendChild(_.div({class:"cms-time-column-title"},o(e.secondsLabel)||"Sec")),U.appendChild(G);const A=ho({props:{min:o((k=e.min)!=null?k:e.minTime),max:o((I=e.max)!=null?I:e.maxTime),use12h:o((B=e.use12h)!=null?B:e.ampm),hoursLabel:o(e.hoursLabel)||"Ore",minutesLabel:o(e.minutesLabel)||"Min",secondsLabel:o(e.secondsLabel)||"Sec"},slots:s,value:p,withSeconds:de,minuteStep:y(),secondStep:a(),disabled:!!o(e.disabled),readonly:!!o(e.readonly),pointIcon:o(e.pointIcon),shortcuts:o((pe=e.shortcuts)!=null?pe:e.presets),onSelect:(Se,ye)=>{const V=Wn(j);Z(Se,null),ue({scrollState:V}),X(ye)&&O()}}),u=_.div({class:"cms-time-footer"},_.div({class:"cms-time-value"},...E(s,"value",{value:p,displayValue:P},P||E(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:()=>Z(null,null,{commit:!o(e.confirm)})},o(e.clearLabel)||"Reset"):null,o(e.confirm)?_.button({type:"button",class:"cms-time-action is-primary",onClick:f},o(e.applyLabel)||"Applica"):null));j.replaceChildren(_.div({class:"cms-time-panel-root",onKeydown:Se=>{Se.key==="Escape"&&(Se.preventDefault(),O())}},U,A,u))};function g(){var p,P,U,G;return H||o(e.disabled)||o(e.readonly)||(re=lt(K),H=JSswift.overlay.open(()=>(j=_.div({class:Ht(["cms-time-panel",o(i),e.panelClass])}),m(),j),{type:"time",anchorEl:le._control||ie,placement:e.placement||"bottom-start",offsetX:(p=e.offsetX)!=null?p:0,offsetY:(U=(P=e.offsetY)!=null?P:e.offset)!=null?U:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:e.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Ht(["cms-time-overlay",e.panelClass]),onClose:()=>{var de;H=null,j=null,J(),(de=e.onClose)==null||de.call(e)}}),e.panelStyle&&Object.assign(H.panel.style,e.panelStyle),yn(H),ue(),J(),(G=e.onOpen)==null||G.call(e)),H}function O(){if(!H)return;const p=H;wn(p,()=>JSswift.overlay.close(p.id))}return ie.addEventListener("focus",p=>{var P;(P=e.onFocus)==null||P.call(e,p),e.openOnFocus!==!1&&g()}),ie.addEventListener("click",p=>{var P;(P=e.onClick)==null||P.call(e,p),g()}),ie.addEventListener("keydown",p=>{if(p.key==="Escape"){H&&(p.preventDefault(),O());return}(p.key==="ArrowDown"||p.key==="Enter"||p.key===" ")&&(p.preventDefault(),g()),(p.key==="Backspace"||p.key==="Delete")&&!o(e.manualInput)&&o(e.clearable)!==!1&&(p.preventDefault(),Z(null,p,{commit:!0}))}),o(e.manualInput)?(ie.addEventListener("input",p=>{var P;return(P=e.onTyping)==null?void 0:P.call(e,ie.value,p)}),ie.addEventListener("change",p=>Z(ie.value,p)),ie.addEventListener("blur",p=>{var P;(P=e.onBlur)==null||P.call(e,p),ie.value===""?Z(null,p):Z(ie.value,p)})):ie.addEventListener("blur",p=>{var P;return(P=e.onBlur)==null?void 0:P.call(e,p)}),b&&b.watch(p=>{const P=lt(C(p));ee(P)!==ee(K)&&(K=lt(P),re=lt(P),J(),m())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!b&&e.value!=null&&(K=lt(C(o(e.value))),re=lt(K)),J(),m(),H&&o(e.disabled)&&O()},"UI.Time:render"),le._input=ie,le._time=ie,le._open=g,le._close=O,le._getValue=()=>T(K),le._setValue=p=>Z(p,null,{emit:!1,commit:!0}),le._panel=()=>(H==null?void 0:H.panel)||null,le},(gi=JSswift.isDev)!=null&&gi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Time={signature:"UI.Time(props)",props:{value:"string|Date",model:"rod | [get,set] signal",min:"string",max:"string",minuteStep:"number",secondStep:"number",withSeconds:"boolean",manualInput:"boolean",clearable:"boolean",confirm:"boolean",label:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",pointIcon:"String|Node|Function|Array",shortcuts:"Array<{ label, value }>",name:"string",class:"string",style:"object"},slots:{option:"Renderer for a time option ({ part, value, label, selected, timeValue })",point:"Point/icon in the selected time option",shortcut:"Shortcut renderer",value:"Footer value renderer ({ value, displayValue })",label:"Floating label",topLabel:"Top label",icon:"Left icon",iconRight:"Right icon",default:"Fallback value content"},events:{onChange:"(value, event)",onInput:"(value, event)",onOpen:"void",onClose:"void"},returns:"HTMLDivElement (field wrapper) con ._input, ._open(), ._close(), ._getValue(), ._setValue(value)",description:"Reactive time picker with fixed overlay, label/icon slots, point icon, shortcuts, confirm, and model."}),v.Tabs=(...t)=>{var k,I,B,pe,Se,ye;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(V,D)=>!!V&&Object.prototype.hasOwnProperty.call(V,D),c=V=>String(o(V)||"horizontal").toLowerCase()==="vertical"?"vertical":"horizontal",y=V=>{const D=String(o(V)||"").toLowerCase();return D==="pills"||D==="pill"?"pills":D==="soft"||D==="card"?"soft":"line"},a=V=>{var q;const D=o(V);return D==null||D===""?null:(q=JSswift.uiColors)!=null&&q.includes(D)?`var(--cms-${D})`:String(D)},l=(V,D)=>Object.is(V,D)||V!=null&&D!=null&&V==D,b=kt(e.model,"UI.Tabs:model"),R=c(e.orientation||e.orient||e.direction),C=y(e.variant||(e.pills?"pills":e.soft?"soft":"line")),w=!!o((I=(k=e.fill)!=null?k:e.navFill)!=null?I:e.stretch),T=!!o(e.wrap),ee=!!o(e.disabled),K=e.id||"cms-tabs-"+Math.random().toString(36).slice(2,9),re=o((B=e.tabs)!=null?B:e.items)||[],H=(Array.isArray(re)?re:[re]).map((V,D)=>{var te,xe,be,Ce,he,Le,Ae,z,we,M,N,S,d,L;if(V==null)return null;if(typeof V!="object")return{raw:V,index:D,value:V,labelFallback:V,noteFallback:null,iconFallback:null,badgeFallback:null,disabled:!1,hidden:!1};const q=(Le=(he=(Ce=(be=(xe=(te=V.value)!=null?te:V.name)!=null?xe:V.id)!=null?be:V.key)!=null?Ce:V.label)!=null?he:V.title)!=null?Le:`tab-${D}`,Ne=(M=(we=(z=(Ae=V.label)!=null?Ae:V.title)!=null?z:V.name)!=null?we:V.value)!=null?M:`Tab ${D+1}`,ke=i(V,"badge")?V.badge:i(V,"counter")?V.counter:null;return{...V,raw:V,index:D,value:q,labelFallback:Ne,noteFallback:(d=(S=(N=V.note)!=null?N:V.subtitle)!=null?S:V.description)!=null?d:null,iconFallback:(L=V.icon)!=null?L:null,badgeFallback:ke}}).filter(Boolean).filter(V=>V.hidden!==!0&&V.visible!==!1),j=H.find(V=>!V.disabled)||null,Y=V=>H.findIndex(D=>l(D.value,V)),W=(V,D)=>{var Ne;if(!H.length)return-1;let q=V;for(let ke=0;ke<H.length;ke+=1)if(q+=D,q<0?q=H.length-1:q>=H.length&&(q=0),!((Ne=H[q])!=null&&Ne.disabled))return q;return-1},ie=(V,D=!1)=>{var Ne,ke;const q=Y(V);return q>=0&&!((Ne=H[q])!=null&&Ne.disabled)?H[q].value:D?(ke=j==null?void 0:j.value)!=null?ke:null:V!=null?V:null},ge=ie(b?b.get():i(e,"value")?o(e.value):(pe=e.defaultValue)!=null?pe:e.default,!0),[ce,le]=JSswift.reactive.signal(ge),oe=ae(["cms-clear-set","cms-tabs","cms-singularity",R,`variant-${C}`,me(e.dense,"dense"),me(w,"fill"),me(T,"wrap"),me(ee,"disabled"),e.class]),ne=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"]);ne.class=oe,ne.style={...e.style||{}},e.gap!=null&&(ne.style["--cms-tabs-gap"]=$e(e.gap)),e.tabGap!=null&&(ne.style["--cms-tabs-tab-gap"]=$e(e.tabGap));const J=a((Se=e.color)!=null?Se:e.state);J&&(ne.style["--cms-tabs-accent"]=J);const Z=_.div(ne),X=_.div({class:ae(["cms-tabs-bar",e.barClass]),style:{alignItems:e.align||(R==="vertical"?"stretch":"center"),justifyContent:e.justify||"flex-start",...e.barStyle||{}}}),ue=_.div({class:ae(["cms-tabs-nav",e.navClass]),style:e.navStyle||null,role:"tablist","aria-orientation":R}),F=[],f=()=>Y(ce()),m=()=>{const V=f();return V>=0?H[V]:null},g=()=>({tabs:H,value:ce(),active:ce(),activeIndex:f(),activeTab:m(),orientation:R,variant:C,select:(V,D)=>p(V,{event:D,emit:!0}),next:()=>U(),prev:()=>G()}),O=(V,D,q)=>({...g(),tab:V,index:D,active:q,disabled:!!V.disabled,select:Ne=>P(D,{event:Ne,emit:!0})}),Q=V=>{var q;const D=(q=F[V])==null?void 0:q.btn;!D||typeof D.focus!="function"||requestAnimationFrame(()=>D.focus())},r=V=>{const D=Y(V);Z.dataset.value=V==null?"":String(V),Z.dataset.activeIndex=D>=0?String(D):"",F.forEach(({btn:q,item:Ne,tab:ke,index:te})=>{const xe=te===D;Ne.classList.toggle("active",xe),Ne.classList.toggle("disabled",!!(ke.disabled||ee)),q.classList.toggle("active",xe),q.setAttribute("aria-selected",xe?"true":"false"),q.setAttribute("tabindex",xe?"0":"-1")})},x=V=>{le(V),r(V)},p=(V,D={})=>{if(ee)return null;const q=Y(V);return q<0?null:P(q,D)},P=(V,D={})=>{var xe,be;const q=H[V];if(!q||q.disabled||ee)return null;const Ne=q.value,ke=ce(),te=!l(ke,Ne);return x(Ne),b&&!l(b.get(),Ne)&&b.set(Ne),D.focus&&Q(V),D.event&&((xe=q.onClick)==null||xe.call(q,Ne,D.event,q,V)),te&&D.emit!==!1&&((be=e.onChange)==null||be.call(e,Ne,q,D.event||null,V)),q},U=()=>{const V=W(f()<0?-1:f(),1);V>=0&&P(V,{emit:!0,focus:!0})},G=()=>{const V=f()<0?0:f(),D=W(V,-1);D>=0&&P(D,{emit:!0,focus:!0})},de=(V,D)=>{var S,d,L,fe,Fe,Te;const q=D===f(),Ne=O(V,D,q),ke=`${K}-tab-${D}`,te=V.iconFallback!=null?typeof V.iconFallback=="string"?v.Icon({name:V.iconFallback,size:(L=(d=(S=V.iconSize)!=null?S:V.size)!=null?d:e.size)!=null?L:null}):V.iconFallback:null,xe=E(s,"icon",Ne,te),be=E(null,"default",{},JSswift.ui.renderSlot(s,"label",Ne,V.labelFallback)),Ce=E(s,"note",Ne,V.noteFallback),he=E(s,"badge",Ne,V.badgeFallback),Le=_.span({class:"cms-tabs-tab-inner"},xe.length?_.span({class:"cms-tabs-tab-icon"},...xe):null,_.span({class:"cms-tabs-tab-copy"},_.span({class:"cms-tabs-tab-label"},...be.length?be:[""]),Ce.length?_.span({class:"cms-tabs-tab-note"},...Ce):null),he.length?_.span({class:"cms-tabs-tab-badge"},...he):null),Ae=E(s,"tab",{...Ne,tabId:ke,label:be,icon:xe,note:Ce,badge:he},Le),z=$=>{var De;if(V.disabled||ee)return;const _e=$.key;if(_e==="Enter"||_e===" "){$.preventDefault(),P(D,{event:$,emit:!0});return}if(_e==="Home"){$.preventDefault();const We=H.findIndex(qe=>!qe.disabled);We>=0&&P(We,{event:$,emit:!0,focus:!0});return}if(_e==="End"){$.preventDefault();let We=-1;for(let qe=H.length-1;qe>=0;qe-=1)if(!((De=H[qe])!=null&&De.disabled)){We=qe;break}We>=0&&P(We,{event:$,emit:!0,focus:!0});return}const Re=R==="vertical"?["ArrowUp"]:["ArrowLeft"],Pe=R==="vertical"?["ArrowDown"]:["ArrowRight"];if(Re.includes(_e)){$.preventDefault();const We=W(D,-1);We>=0&&P(We,{event:$,emit:!0,focus:!0});return}if(Pe.includes(_e)){$.preventDefault();const We=W(D,1);We>=0&&P(We,{event:$,emit:!0,focus:!0})}},we=a((fe=V.color)!=null?fe:V.state),M=_.div({class:ae(["cms-tabs-item",me(q,"active"),me(V.disabled||ee,"disabled"),e.itemClass,V.itemClass]),style:{...we?{"--cms-tabs-item-accent":we}:{},...e.itemStyle||{},...V.itemStyle||{}},"data-name":String(V.value)}),N=v.Btn({class:ae(["cms-tabs-tab",me(q,"active"),me(V.disabled||ee,"disabled"),e.tabClass,V.tabClass||V.class]),type:"button",id:ke,role:"tab",disabled:!!(V.disabled||ee),"aria-selected":q?"true":"false",tabindex:q?"0":"-1",size:(Te=(Fe=V.size)!=null?Fe:e.size)!=null?Te:null,style:{...e.tabStyle||{},...V.tabStyle||{}},onClick:$=>{P(D,{event:$,emit:!0})},onKeydown:z},...Ae);return M.appendChild(N),M.appendChild(_.span({class:"tab-indicator"})),F[D]={tab:V,index:D,item:M,btn:N},M};if(H.length){const V=H.map((q,Ne)=>de(q,Ne)),D=JSswift.ui.renderSlot(s,"nav",{...g(),nodes:V},V);E(null,"default",{},D).forEach(q=>ue.appendChild(q))}else E(s,"empty",g(),(ye=e.empty)!=null?ye:_.div({class:"cms-tabs-empty"},"Nessuna tab disponibile.")).forEach(V=>ue.appendChild(V));const A=g(),u=[...E(null,"default",{},JSswift.ui.renderSlot(s,"extra",A,null)),...E(s,"default",A,n)];return X.appendChild(ue),u.length&&X.appendChild(_.div({class:"cms-tabs-extra"},...u)),Z.appendChild(X),x(ge),b?b.watch(V=>{x(ie(V,!0))},"UI.Tabs:watch"):rt(e.value)&&je.reactive.effect(()=>{x(ie(o(e.value),!0))},"UI.Tabs:value"),Z._getValue=()=>ce(),Z._setValue=V=>p(V,{emit:!0}),Z._select=V=>p(V,{emit:!0}),Z._next=()=>U(),Z._prev=()=>G(),Z._getTabs=()=>H.slice(),Ke(Z,e),Z},(pi=JSswift.isDev)!=null&&pi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Tabs={signature:"UI.Tabs(props) | UI.Tabs(props, ...children)",props:{tabs:"Array<{ value|name|id|key, label|title, note|subtitle|description, icon, badge|counter, disabled, hidden, onClick }>",items:"Alias of tabs",value:"any",defaultValue:"any",default:"Alias of defaultValue",model:"[get,set] signal",orientation:"horizontal|vertical",variant:"line|pills|soft",fill:"boolean",wrap:"boolean",disabled:"boolean",color:"string",state:"string",gap:"string|number",tabGap:"string|number",align:"string",justify:"string",size:"string|number",dense:"boolean",navClass:"string",tabClass:"string",itemClass:"string",slots:"{ nav?, tab?, label?, icon?, note?, badge?, extra?, empty?, default? }",class:"string",style:"object"},slots:{nav:"Full nav renderer",tab:"Single tab renderer",label:"Label renderer",icon:"Icon renderer",note:"Note renderer",badge:"Badge/counter renderer",extra:"Extra area next to the nav",empty:"Fallback when tabs/items are empty",default:"Children / extra content fallback"},events:{onChange:"(value, tab, event, index)"},keyboard:["Enter/Space","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"],returns:"HTMLDivElement con ._getValue(), ._setValue(value), ._select(value), ._next(), ._prev(), ._getTabs()",description:"Standardized tab bar with controlled/uncontrolled support, structured slots, badge/note/icon, and keyboard navigation."}),v.RouteTab=(...t)=>{var Q,r,x,p,P,U,G,de,A,u,k,I,B,pe,Se;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.router||(je==null?void 0:je.router)||null,c=ye=>Object.prototype.hasOwnProperty.call(e,ye),y=c("active")||c("selected"),a=ye=>{const V=String(o(ye)||"").toLowerCase();return V==="pill"||V==="pills"?"pills":V==="soft"||V==="card"?"soft":"line"},l=ye=>{var D;const V=o(ye);return V==null||V===""?null:(D=JSswift.uiColors)!=null&&D.includes(V)?`var(--cms-${V})`:String(V)},b=ye=>{if(ye==null||ye==="")return"";try{return new URL(String(ye),window.location.origin).pathname||""}catch(V){return String(ye).split(/[?#]/)[0]||""}},R=ye=>o(e.external)===!0?!0:ye?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(ye)):!1,C=()=>{var ye;return o((ye=e.href)!=null?ye:e.to)||"#"},w=()=>{var ye;return o((ye=e.to)!=null?ye:e.href)||""},T=()=>{try{if(i!=null&&i.current)return i.current().pathname||window.location.pathname||""}catch(ye){}return window.location.pathname||""},ee=()=>{var te,xe,be;const ye=w();if(!ye)return!1;const V=o((xe=(te=e.match)!=null?te:e.activeMatch)!=null?xe:e.routeMatch),D=String(o((be=e.matchMode)!=null?be:e.startsWith?"startsWith":e.exact?"exact":"")||"").toLowerCase(),q=T();if(typeof V=="function")return!!V({currentPath:q,to:ye,href:C(),router:i,props:e});if(V instanceof RegExp)return V.test(q);const Ne=b(typeof V=="string"&&!["exact","startsWith","prefix","section"].includes(V.toLowerCase())?V:ye);if(!Ne)return!1;const ke=D||(typeof V=="string"&&["startsWith","prefix","section"].includes(V.toLowerCase())?"startsWith":"exact");return ke==="startswith"||ke==="prefix"||ke==="section"?q===Ne||q.startsWith(`${Ne}/`):i!=null&&i.isActive?!!i.isActive(ye):q===Ne},K=()=>!!o(e.disabled);let re=null;const H=()=>{var ye;return re!=null?!!re:y?!!o((ye=e.active)!=null?ye:e.selected):ee()},j=a(e.variant||(e.pills?"pills":e.soft?"soft":"line")),Y=!o(e.color)&&o(e.state)?mt(o(e.state)):"",W=Y?`cms-state-${Y}`:"",ie=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"]);ie.href=C(),ie.class=ae(["cms-route-tab","cms-clear-set","cms-singularity",`variant-${j}`,me((Q=e.block)!=null?Q:e.fill,"block"),me(e.dense,"dense"),W,e.class]),ie.style={...e.style||{}};const ge=l((r=e.color)!=null?r:e.state);ge&&(ie.style["--cms-route-tab-accent"]=ge);const ce=(p=(x=e.iconSize)!=null?x:e.size)!=null?p:null,le=(ye,V)=>{const D=o(ye);return D==null||D===!1||D===""?null:typeof D=="string"?v.Icon({name:D,size:ce}):JSswift.ui.slot(D,{as:V})},oe=()=>({active:H(),disabled:K(),href:C(),to:w(),external:R(C()),navigate:ye=>{var q,Ne;if(K())return!1;const V=w();return!R(C())&&V&&(i!=null&&i.navigate)?(ye!=null&&ye.preventDefault&&ye.preventDefault(),i.navigate(V),(q=e.onNavigate)==null||q.call(e,V,ye||null),!0):((Ne=e.onNavigate)==null||Ne.call(e,V||C(),ye||null),!1)}}),ne=E(s,"icon",oe(),le(e.icon,"icon")),J=E(s,"label",oe(),(G=(U=(P=e.label)!=null?P:e.title)!=null?U:e.text)!=null?G:n),Z=E(s,"note",oe(),(u=(A=(de=e.note)!=null?de:e.subtitle)!=null?A:e.caption)!=null?u:e.description),X=E(s,"badge",oe(),(I=(k=e.badge)!=null?k:e.counter)!=null?I:e.count),ue=E(s,"aside",oe(),(pe=(B=e.aside)!=null?B:e.trailing)!=null?pe:le(e.iconRight,"iconRight")),F=E(s,"default",oe(),(Se=e.content)!=null?Se:e.body),f=_.span({class:"cms-route-tab-inner"},ne.length?_.span({class:"cms-route-tab-icon"},...ne):null,_.span({class:"cms-route-tab-copy"},_.span({class:"cms-route-tab-label"},...J.length?J:[w()||C()||""]),Z.length?_.span({class:"cms-route-tab-note"},...Z):null,F.length?_.span({class:"cms-route-tab-extra"},...F):null),X.length?_.span({class:"cms-route-tab-badge"},...X):null,ue.length?_.span({class:"cms-route-tab-aside"},...ue):null),m=_.a(ie,f);Ke(m,e);const g=()=>{const ye=H(),V=K(),D=C(),q=R(D);m.classList.toggle("active",ye),m.classList.toggle("is-disabled",V),m.classList.toggle("is-external",q),ye?m.setAttribute("aria-current",String(o(e.ariaCurrent)||"page")):m.removeAttribute("aria-current"),m.setAttribute("href",D||"#"),V?(m.setAttribute("aria-disabled","true"),m.tabIndex=-1):(m.removeAttribute("aria-disabled"),!c("tabIndex")&&!c("tabindex")&&m.removeAttribute("tabindex")),w()?m.dataset.to=String(w()):delete m.dataset.to,q&&m.target==="_blank"&&!m.rel&&(m.rel="noopener noreferrer")},O=e.onClick;return m.onclick=ye=>{if(O==null||O(ye),!ye.defaultPrevented){if(K()){ye.preventDefault();return}oe().navigate(ye)}},!y&&w()&&(i!=null&&i.subscribe)&&i.subscribe(()=>g()),JSswift.reactive.effect(()=>{g()},"UI.RouteTab:render"),m._isActive=()=>H(),m._setActive=ye=>(re=ye==null?null:!!ye,g(),m),m._navigate=ye=>oe().navigate(ye),m},(hi=JSswift.isDev)!=null&&hi.call(JSswift)&&(v.meta=v.meta||{},v.meta.RouteTab={signature:"UI.RouteTab(...children) | UI.RouteTab(props, ...children)",props:{label:"String|Node|Function|Array",to:"string",href:"string",active:"boolean",selected:"Alias of active",match:'"exact"|"startsWith"|RegExp|Function|string',matchMode:'"exact"|"startsWith"',exact:"boolean",startsWith:"boolean",note:"String|Node|Function|Array",badge:"String|Node|Function|Array",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",aside:"Node|Function|Array",variant:'"line"|"pills"|"soft"',disabled:"boolean",block:"boolean",state:"string",color:"string",slots:"{ icon?, label?, note?, badge?, aside?, default? }",class:"string",style:"object"},slots:{icon:"Leading icon content",label:"Main label content",note:"Secondary note/caption",badge:"Badge / counter area",aside:"Trailing visual/action area",default:"Extra content under the note"},events:{onClick:"MouseEvent",onNavigate:"(to, event)"},returns:"HTMLAnchorElement con ._isActive(), ._setActive(boolean|null), ._navigate(event?)",description:"Standardized tab/link for router or href navigation, with structured slots, states, and badges."}),v.Breadcrumbs=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=JSswift.router||(je==null?void 0:je.router)||null,c=kt(e.model,"UI.Breadcrumbs:model"),y=Ye(e.size,()=>{var Z;const J=o(e.size);return typeof J=="string"&&((Z=JSswift.uiSizes)!=null&&Z.includes(J))?`cms-size-${J}`:""}),a=Ye(e.variant,()=>{const J=String(o(e.variant||(e.pills?"pills":e.soft?"soft":"line"))||"").toLowerCase();return J==="pill"||J==="pills"?"variant-pills":J==="soft"||J==="card"?"variant-soft":"variant-line"}),l=Ye([e.wrap,e.nowrap],()=>o(e.wrap)===!1||o(e.nowrap)?"no-wrap":""),b=_.nav({class:ae(["cms-breadcrumbs","cms-clear-set",y,a,l,me(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),R=_.div({class:"cms-breadcrumbs-before"}),C=_.ol({class:"cms-breadcrumbs-list"}),w=_.div({class:"cms-breadcrumbs-after"});b.appendChild(R),b.appendChild(C),b.appendChild(w);const T=J=>{var X;const Z=o(J);return Z==null||Z===""?null:(X=JSswift.uiColors)!=null&&X.includes(Z)?`var(--cms-${Z})`:String(Z)},ee=J=>{var X;if(!J)return!1;if(o(J.external)===!0)return!0;const Z=o((X=J.href)!=null?X:J.to);return Z?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Z)):!1},K=J=>J!=null&&J.nodeType&&J.cloneNode?J.cloneNode(!0):J,re=(J,Z)=>{J.innerHTML="",Z.forEach(X=>J.appendChild(X))},H=(J,Z,X,ue,F=null)=>{const f=JSswift.ui.getSlot(J,Z)!=null?E(J,Z,X,ue):[];return f.length?f:F&&JSswift.ui.getSlot(J,F)!=null?E(J,F,X,ue):E(null,"default",X,ue)},j=(J,Z,X)=>{const ue=o(J);return ue==null||ue===!1||ue===""?null:typeof ue=="string"?v.Icon({name:ue,size:Z}):JSswift.ui.slot(ue,{as:X})},Y=()=>{var F,f;const J=c?c.get():o((f=(F=e.items)!=null?F:e.value)!=null?f:e.breadcrumbs),Z=[],X=m=>{if(!(m==null||m===!1)){if(Array.isArray(m)){m.forEach(X);return}if(typeof m=="string"||typeof m=="number"){Z.push({label:String(m)});return}if(m!=null&&m.nodeType||typeof m=="function"){Z.push({label:m});return}Z.push(m)}},ue=o(e.home);return ue&&X(ue===!0?{label:"Home",to:"/",icon:"home"}:ue),X(J),!Z.length&&(n!=null&&n.length)&&n.forEach(m=>X(m)),Z.filter(m=>!o(m==null?void 0:m.hidden))},W=J=>{const Z=J.findIndex(X=>{var ue,F;return!!o((F=(ue=X==null?void 0:X.current)!=null?ue:X==null?void 0:X.active)!=null?F:X==null?void 0:X.selected)});return Z>-1?Z:o(e.autoCurrent)===!1?-1:J.length?J.length-1:-1},ie=J=>{var g,O,Q,r,x,p,P;const Z=Number(o((Q=(O=(g=e.max)!=null?g:e.maxItems)!=null?O:e.collapseAfter)!=null?Q:e.collapse)),X=Number.isFinite(Z)?Math.max(0,Math.trunc(Z)):0;if(!X||X<3||J.length<=X)return J.map((U,G)=>({type:"item",item:U,index:G,key:`item-${G}`}));let ue=Number(o((x=(r=e.leadingCount)!=null?r:e.keepStart)!=null?x:1)),F=Number(o((P=(p=e.trailingCount)!=null?p:e.keepEnd)!=null?P:Math.max(1,X-2)));if(ue=Number.isFinite(ue)?Math.max(1,Math.trunc(ue)):1,F=Number.isFinite(F)?Math.max(1,Math.trunc(F)):Math.max(1,X-2),ue+F+1>X&&(F=Math.max(1,X-ue-1),ue+F+1>X&&(ue=Math.max(1,X-F-1))),ue+F>=J.length)return J.map((U,G)=>({type:"item",item:U,index:G,key:`item-${G}`}));const f=[];for(let U=0;U<ue;U++)f.push({type:"item",item:J[U],index:U,key:`item-${U}`});const m=J.slice(ue,J.length-F);f.push({type:"collapsed",key:`collapsed-${ue}-${J.length-F}`,items:m,from:ue,to:J.length-F-1});for(let U=J.length-F;U<J.length;U++)f.push({type:"item",item:J[U],index:U,key:`item-${U}`});return f},ge=(J,Z=null)=>{var F,f,m,g,O;if(!J)return!1;const X=o((F=J.href)!=null?F:J.to)||"",ue=o(J.to)||"";return!ee(J)&&ue&&(i!=null&&i.navigate)?(Z!=null&&Z.preventDefault&&Z.preventDefault(),i.navigate(ue),(f=J.onNavigate)==null||f.call(J,ue,Z||null),(m=e.onNavigate)==null||m.call(e,ue,J,Z||null),!0):((g=J.onNavigate)==null||g.call(J,ue||X,Z||null),(O=e.onNavigate)==null||O.call(e,ue||X,J,Z||null),!1)},ce=(J,Z,X)=>{var O,Q,r;const ue=J,F=X[Z+1]||null,f={index:Z,entry:J,previous:ue,next:F},m=K(o((r=(Q=(J==null?void 0:J.type)==="item"?(O=J.item)==null?void 0:O.separator:null)!=null?Q:e.separator)!=null?r:"/")),g=H(s,"separator",f,m);return _.li({class:"cms-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"cms-breadcrumbs-separator"},...g))},le=(J,Z,X)=>{const ue={type:"collapsed",collapsed:!0,items:Z,hiddenItems:J.items,currentIndex:X,from:J.from,to:J.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"))))),f=H(s,"collapsed",ue,F,"item");return _.li({class:"cms-breadcrumbs-entry is-collapsed"},...f)},oe=(J,Z,X,ue)=>{var te,xe,be,Ce,he,Le,Ae,z,we,M,N,S,d,L,fe,Fe,Te,$,_e,Re,Pe,De,We,qe,Ze,Qe;const F=J.item||{},f=F.slots?{...s,...F.slots}:s,m=o((te=F.href)!=null?te:F.to)||"",g=!!o(F.disabled),O=J.index===X,Q=(Ce=(be=(xe=F.iconSize)!=null?xe:e.itemSize)!=null?be:e.size)!=null?Ce:null,r=T((Ae=(Le=(he=F.color)!=null?he:F.state)!=null?Le:e.color)!=null?Ae:e.state),x=!o(F.color)&&o(F.state)?mt(o(F.state)):"",p=(S=(N=(M=(we=(z=F.label)!=null?z:F.title)!=null?we:F.text)!=null?M:F.to)!=null?N:F.href)!=null?S:"",P=(fe=(L=(d=F.note)!=null?d:F.subtitle)!=null?L:F.caption)!=null?fe:F.description,U=(Te=(Fe=F.badge)!=null?Fe:F.counter)!=null?Te:F.count,G=(_e=($=F.aside)!=null?$:F.trailing)!=null?_e:j(F.iconRight,Q,"iconRight"),de=(Re=F.content)!=null?Re:F.body,A={item:F,index:J.index,visibleIndex:ue,total:Z.length,current:O,active:O,disabled:g,href:m,to:o(F.to)||"",external:ee(F),isFirst:J.index===0,isLast:J.index===Z.length-1,navigate:Ee=>ge(F,Ee)},u=H(f,"icon",A,j(F.icon,Q,"icon")),k=H(f,"label",A,p),I=H(f,"note",A,P),B=H(f,"badge",A,U),pe=H(f,"aside",A,G),Se=H(f,"default",A,de),ye=_.span({class:"cms-breadcrumb-inner"},u.length?_.span({class:"cms-breadcrumb-icon"},...u):null,_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},...k.length?k:[m||""]),I.length?_.span({class:"cms-breadcrumb-note"},...I):null,Se.length?_.span({class:"cms-breadcrumb-extra"},...Se):null),B.length?_.span({class:"cms-breadcrumb-badge"},...B):null,pe.length?_.span({class:"cms-breadcrumb-aside"},...pe):null),V=!g&&(!O||!!o((Pe=F.linkCurrent)!=null?Pe:e.linkCurrent)),D={class:ae(["cms-breadcrumb","cms-clear-set","cms-singularity",me(O,"is-current"),me(O,"active"),me(g,"is-disabled"),x?`cms-state-${x}`:"",F.class]),style:{...F.style||{}},"aria-current":O?String(o((De=F.ariaCurrent)!=null?De:e.ariaCurrent)||"page"):null};r&&(D.style["--cms-breadcrumb-accent"]=r);let q=null;V&&m?(q=_.a({...D,href:m,target:F.target,rel:F.rel,onClick:Ee=>{var Be,tt;(Be=F.onClick)==null||Be.call(F,Ee,A),(tt=e.onItemClick)==null||tt.call(e,F,A,Ee),!Ee.defaultPrevented&&A.navigate(Ee)}},ye),A.external&&q.target==="_blank"&&!q.rel&&(q.rel="noopener noreferrer")):V&&typeof F.onClick=="function"?q=_.button({...D,type:F.type||"button",onClick:Ee=>{var Be,tt;(Be=F.onClick)==null||Be.call(F,Ee,A),(tt=e.onItemClick)==null||tt.call(e,F,A,Ee)}},ye):q=_.span({...D,"aria-disabled":g?"true":null},ye),Ke(q,{size:(qe=(We=F.size)!=null?We:e.itemSize)!=null?qe:e.size,radius:(Ze=F.radius)!=null?Ze:e.radius,gradient:(Qe=F.gradient)!=null?Qe:e.gradient});const ke=H(f,"item",A,q);return _.li({class:ae(["cms-breadcrumbs-entry",me(O,"is-current"),me(g,"is-disabled")])},...ke)},ne=()=>{var f;const J=Y(),Z=W(J),X=ie(J),ue=T((f=e.color)!=null?f:e.state);b.classList.toggle("is-empty",J.length===0),ue?b.style.setProperty("--cms-breadcrumb-accent",ue):b.style.removeProperty("--cms-breadcrumb-accent");const F={items:J,visibleItems:X,currentIndex:Z,count:J.length,collapsed:X.some(m=>m.type==="collapsed")};if(re(R,H(s,"before",F,e.before)),re(w,H(s,"after",F,e.after)),C.innerHTML="",!J.length){const m=H(s,"empty",F,e.empty);m.length&&C.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...m));return}X.forEach((m,g)=>{g>0&&C.appendChild(ce(X[g-1],g-1,X)),C.appendChild(m.type==="collapsed"?le(m,J,Z):oe(m,J,Z,g))})};return je.reactive.effect(()=>{ne()},"UI.Breadcrumbs:render"),b.getItems=()=>Y(),b.getVisibleItems=()=>ie(Y()),b.refresh=()=>(ne(),b),b.setItems=J=>(c?c.set(J):e.items=J,ne(),b),Ke(b,e),b},(bi=JSswift.isDev)!=null&&bi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Breadcrumbs={signature:"UI.Breadcrumbs(props)",props:{items:"Array<string|number|Node|Function|{ label?, to?, href?, icon?, note?, badge?, current?, disabled?, hidden?, slots? }>",model:"[get,set] signal|Array",home:"boolean|Object",separator:"string|Node|Function",before:"Node|Function|Array",after:"Node|Function|Array",empty:"Node|Function|Array",variant:'"line"|"pills"|"soft"',max:"number",leadingCount:"number",trailingCount:"number",dense:"boolean",wrap:"boolean",nowrap:"boolean",linkCurrent:"boolean",color:"string",state:"string",itemSize:"string|number",ariaLabel:"string",class:"string",style:"object"},slots:{before:"Content before breadcrumb list",after:"Content after breadcrumb list",item:"Full renderer for a breadcrumb entry",icon:"Leading icon for each breadcrumb",label:"Main breadcrumb label",note:"Secondary line for the breadcrumb",badge:"Badge/counter area",aside:"Trailing area",default:"Extra content under note",separator:"Separator renderer",collapsed:"Renderer for collapsed middle items",empty:"Renderer for empty state"},events:{onItemClick:"(item, ctx, event)",onNavigate:"(toOrHref, item, event)"},returns:"HTMLElement <nav> con .getItems(), .getVisibleItems(), .refresh(), .setItems(items)",description:"Breadcrumbs standardizzati con item strutturati, slot completi, collapse automatico e supporto a link/router."}),v.Pagination=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=e.slots||{},s=kt(e.model,"UI.Pagination:model"),i=Ye(e.size,()=>{const r=o(e.size);return typeof r=="string"&&An[r]?`cms-size-${r}`:""}),c=_.nav({class:ae(["cms-pagination","cms-clear-set",i,me(e.dense,"dense"),me(e.simple,"is-simple"),me(e.disabled,"is-disabled"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Pagination"}),y=_.div({class:"cms-pagination-controls"}),a=_.div({class:"cms-pagination-start"}),l=_.div({class:"cms-pagination-pages"}),b=_.div({class:"cms-pagination-end"}),R=_.div({class:"cms-pagination-summary"});y.appendChild(a),y.appendChild(l),y.appendChild(b),c.appendChild(y),c.appendChild(R);let C=1,w=1;const T=(r,x=0)=>{const p=o(r);if(p==null||p==="")return x;const P=Number(p);return Number.isFinite(P)?Math.trunc(P):x},ee=(r,x=K())=>{const p=Number(r),P=Number.isFinite(p)?Math.trunc(p):1;return Math.min(Math.max(P||1,1),Math.max(1,x||1))},K=()=>{var P,U,G,de,A,u,k;const r=T((G=(U=(P=e.max)!=null?P:e.pages)!=null?U:e.pageCount)!=null?G:e.totalPages,0);if(r>0)return r;const x=T((A=(de=e.total)!=null?de:e.totalItems)!=null?A:e.count,0),p=T((k=(u=e.pageSize)!=null?u:e.perPage)!=null?k:e.limit,0);return x>=0&&p>0?Math.max(1,Math.ceil(x/p)):1},re=()=>{var r,x,p;return T(s?s.get():(p=(x=(r=e.page)!=null?r:e.value)!=null?x:e.current)!=null?p:e.currentPage,1)},H=()=>{var r,x;return Math.max(0,T((x=(r=e.siblings)!=null?r:e.siblingCount)!=null?x:e.window,1))},j=()=>{var r,x;return Math.max(0,T((x=(r=e.boundaryCount)!=null?r:e.boundaries)!=null?x:e.edges,1))},Y=()=>!!o(e.disabled),W=()=>{var r;return o((r=e.showSummary)!=null?r:e.showLabel)!==!1},ie=()=>o(e.showPages)!==!1&&!o(e.simple),ge=()=>o(e.showPrev)!==!1,ce=()=>o(e.showNext)!==!1,le=()=>!!o(e.showEdges),oe=()=>{const r=o(e.showFirst);return r==null?le():!!r},ne=()=>{const r=o(e.showLast);return r==null?le():!!r},J=()=>!!o(e.hideOnSinglePage),Z=()=>{var p,P;const r=o((P=(p=e.total)!=null?p:e.totalItems)!=null?P:e.count);if(r==null||r==="")return null;const x=Number(r);return Number.isFinite(x)?Math.max(0,Math.trunc(x)):null},X=()=>{var p,P;const r=o((P=(p=e.pageSize)!=null?p:e.perPage)!=null?P:e.limit);if(r==null||r==="")return null;const x=Number(r);return Number.isFinite(x)&&x>0?Math.trunc(x):null},ue=(r=C,x=w)=>{const p=Z(),P=X(),U=p!=null&&P?p===0?0:(r-1)*P+1:null,G=p!=null&&P?Math.min(p,r*P):null;return{page:r,value:r,current:r,currentPage:r,pages:x,max:x,total:p,pageSize:P,from:U,to:G,disabled:Y(),isFirst:r<=1,isLast:r>=x,canPrev:r>1,canNext:r<x,setPage:(de,A)=>Q(de,A),prev:de=>Q(r-1,de),next:de=>Q(r+1,de),first:de=>Q(1,de),last:de=>Q(x,de)}},F=(r,x)=>{if(x<=0)return[];const p=[],P=new Set,U=j(),G=H();for(let A=1;A<=Math.min(U,x);A++)P.add(A);for(let A=Math.max(1,r-G);A<=Math.min(x,r+G);A++)P.add(A);for(let A=Math.max(1,x-U+1);A<=x;A++)P.add(A);let de=0;for(let A=1;A<=x;A++)P.has(A)&&(de&&A-de>1&&p.push({type:"ellipsis",key:`ellipsis-${de}-${A}`}),p.push({type:"page",page:A,key:`page-${A}`}),de=A);return p.length||p.push({type:"page",page:1,key:"page-1"}),p},f=(r,x,p,P=null)=>{const U=JSswift.ui.getSlot(n,r)!=null?E(n,r,p,x):[];return U.length?U:P&&JSswift.ui.getSlot(n,P)!=null?E(n,P,p,x):E(null,"default",p,x)},m=(r,x)=>{r.innerHTML="",x.forEach(p=>r.appendChild(p))},g=(r,x,p,P={})=>{var G;const U={...ue(),kind:r,active:!!P.active};return v.Btn({class:ae(["cms-pagination-btn",`cms-pagination-${r}`,me(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:(G=P.outline)!=null?G:!0,disabled:Y()||!!P.disabled,"aria-current":P.active?"page":null,onClick:de=>{Y()||P.disabled||p==null||p(de)}},...f(r,x,U,r==="summary"?"label":r==="page"?"item":null))},O=(r,x)=>{C=ee(r,x),w=Math.max(1,x||1);const p=ue(C,w);c.style.display=J()&&w<=1?"none":"",R.style.display=W()?"":"none",l.style.display=ie()?"":"none",a.innerHTML="",l.innerHTML="",b.innerHTML="";const P=f("start",e.start,p);P.length&&a.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-start"},...P)),oe()&&a.appendChild(g("first","\xAB",de=>Q(1,de),{disabled:C<=1})),ge()&&a.appendChild(g("prev","Prev",de=>Q(C-1,de),{disabled:C<=1})),ie()&&F(C,w).forEach(de=>{if(de.type==="ellipsis"){const k={...p,kind:"ellipsis"},I=f("ellipsis","\u2026",k);l.appendChild(_.span({class:"cms-pagination-ellipsis","aria-hidden":"true"},...I));return}const A=de.page,u={...p,page:A,value:A,item:de,active:A===C};l.appendChild(v.Btn({class:ae(["cms-pagination-btn","cms-pagination-page-btn",me(A===C,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:A===C?e.color||e.state||"primary":null,outline:A!==C,disabled:Y(),"aria-current":A===C?"page":null,onClick:k=>Q(A,k)},...f("page",String(A),u,"item")))}),ce()&&b.appendChild(g("next","Next",de=>Q(C+1,de),{disabled:C>=w})),ne()&&b.appendChild(g("last","\xBB",de=>Q(w,de),{disabled:C>=w}));const U=f("end",e.end,p);U.length&&b.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...U));let G=`Pagina ${C} di ${w}`;p.total!=null&&p.pageSize&&(G=p.total===0?"0 risultati":`${p.from}-${p.to} di ${p.total}`),m(R,f("summary",G,p,"label"))},Q=(r,x=null)=>{var U,G;const p=K(),P=ee(r,p);return P===C&&p===w||(O(P,p),s&&s.get()!==P&&s.set(P),(U=e.onChange)==null||U.call(e,P,ue(P,p),x),(G=e.onPageChange)==null||G.call(e,P,ue(P,p),x)),P};return je.reactive.effect(()=>{const r=K(),x=re(),p=ee(x,r);O(p,r),s&&x!==p&&s.set(p)},"UI.Pagination:sync"),c.getPage=()=>C,c.getPages=()=>w,c.setPage=r=>Q(r),c.prev=()=>Q(C-1),c.next=()=>Q(C+1),c.first=()=>Q(1),c.last=()=>Q(w),Ke(c,e),c},(yi=JSswift.isDev)!=null&&yi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Pagination={signature:"UI.Pagination(props)",props:{max:"number",pages:"number",total:"number",pageSize:"number",value:"number",page:"number",model:"[get,set] signal",showPages:"boolean",showSummary:"boolean",showLabel:"boolean",showPrev:"boolean",showNext:"boolean",showFirst:"boolean",showLast:"boolean",showEdges:"boolean",siblings:"number",boundaryCount:"number",hideOnSinglePage:"boolean",size:"xxs|xs|sm|md|lg|xl|xxl|xxxl",dense:"boolean",simple:"boolean",color:"primary|secondary|warning|danger|success|info|light|dark",state:"primary|secondary|warning|danger|success|info|light|dark",slots:"{ start?, end?, first?, prev?, page?, item?, ellipsis?, next?, last?, summary?, label? }",class:"string",style:"object"},slots:{start:"Content before the controls",end:"Content after the controls",first:"First button content",prev:"Prev button content",page:"Page item content (ctx: { page, active, pages })",item:"Alias of page",ellipsis:"Ellipsis content",next:"Next button content",last:"Last button content",summary:"Summary content",label:"Alias legacy di summary"},events:{onChange:"(page, ctx, event)",onPageChange:"(page, ctx, event)"},returns:"HTMLElement <nav>",description:"Paginazione standard con controlli edge, numeri, ellissi, summary e supporto total/pageSize."}),v.Spinner=(...t)=>{var Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(W,ie,ge)=>{if(rt(W))return()=>{const le=o(W);if(le==null||le===!1||le==="")return ge;const oe=ie?ie(le):le;return oe==null||oe===""?ge:oe};if(W==null||W===!1||W==="")return ge;const ce=ie?ie(W):W;return ce==null||ce===""?ge:ce},c=W=>{if(W==null||W===!1||W===""||mt(W))return"";const ge=String(W).trim();return ge?ge.startsWith("#")||ge.startsWith("rgb(")||ge.startsWith("rgba(")||ge.startsWith("hsl(")||ge.startsWith("hsla(")||ge.startsWith("var(")?ge:Zt(ge)?`var(--cms-${ge})`:ge:""},y=Ye(e.state,()=>{const W=mt(o(e.state));return W?`cms-state-${W}`:""}),a=ae(["cms-spinner",y,me(e.vertical,"vertical"),me(e.reverse,"reverse"),me(e.center,"center"),me(e.block,"block"),me(e.pause||e.paused,"paused"),e.class]),l=JSswift.omit(e,["ariaLabel","block","center","color","indicatorClass","indicatorStyle","label","note","pause","paused","reverse","size","slots","speed","state","thickness","trackColor","vertical"]);l.class=a;const b={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(b,"backgroundColor")&&delete b.backgroundColor,l.style=b,l.role==null&&(l.role="status"),l["aria-live"]==null&&(l["aria-live"]="polite"),l["aria-busy"]==null&&(l["aria-busy"]="true");const R={props:e},C=E(s,"label",R,e.label),w=E(s,"default",R,n),T=E(s,"note",R,e.note),ee=C.length||w.length||T.length;if(!ee){const W=o((Y=e.ariaLabel)!=null?Y:e["aria-label"]);W?l["aria-label"]=W:l["aria-label"]==null&&(l["aria-label"]="Loading")}const K=_.span({class:ae(["cms-spinner-indicator",e.indicatorClass]),style:{"--cms-spinner-size":i(e.size,$e,"18px"),"--cms-spinner-thickness":i(e.thickness,$e,"2px"),"--cms-spinner-speed":i(e.speed,W=>typeof W=="number"?`${W}ms`:String(W),"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"}),re=E(s,"indicator",R,K),H=[];re.length&&H.push(...re),ee&&H.push(_.div({class:"cms-spinner-content"},C.length?_.div({class:"cms-spinner-label"},...C):null,w.length?_.div({class:"cms-spinner-copy"},...w):null,T.length?_.div({class:"cms-spinner-note"},...T):null));const j=_.div(l,...H);return Ke(j,e),j},(wi=JSswift.isDev)!=null&&wi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Spinner={signature:"UI.Spinner(...children) | UI.Spinner(props, ...children)",props:{size:"number|string",color:"string",thickness:"number|string",trackColor:"string",speed:"number|string",state:"primary|secondary|success|warning|danger|info|light|dark",label:"String|Node|Function|Array",note:"String|Node|Function|Array",vertical:"boolean",reverse:"boolean",center:"boolean",block:"boolean",pause:"boolean",paused:"boolean",ariaLabel:"string",indicatorClass:"string",indicatorStyle:"object",slots:"{ indicator?, label?, note?, default? }",class:"string",style:"object"},slots:{indicator:"Custom spinner indicator",label:"Primary label/content near the spinner",note:"Secondary supporting text",default:"Extra content rendered near the spinner"},returns:"HTMLDivElement",description:"Animated spinner with flexible layout, optional content, and controls for size, speed, and track."}),v.Progress=(...t)=>{var I,B,pe,Se,ye,V,D,q,Ne,ke;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=e.model||(_t(e.value)||Pt(e.value)?e.value:null),c=kt(i,"UI.Progress:model"),y=Ye([e.state,e.color],()=>{const te=mt(o(e.state)||o(e.color));return te?`cms-state-${te}`:""}),a=(te,xe)=>{const be=Number(te);return Number.isFinite(be)?be:xe},l=()=>a(o(e.min),0),b=()=>{const te=l(),xe=a(o(e.max),100);return xe<te?te:xe},R=()=>{var xe,be;const te=o((be=(xe=e.height)!=null?xe:e.thickness)!=null?be:e.size);return te==null||te===""?"8px":typeof te=="number"?`${te}px`:typeof te=="string"?{xxs:"4px",xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px",xxl:"16px",xxxl:"18px"}[te]||te:"8px"},C=(te,xe="")=>{const be=o(te);if(be==null||be===!1||be==="")return xe;const Ce=mt(be);return Ce?`var(--cms-${Ce})`:typeof be=="string"&&Zt(be)?`var(--cms-${be})`:String(be)},w=te=>{const xe=l(),be=b(),Ce=a(te,xe);return Math.min(be,Math.max(xe,Ce))},T=te=>{const xe=l(),Ce=b()-xe;if(!Ce)return 0;const he=(w(te)-xe)/Ce,Le=o(e.reverse)?1-he:he;return Math.max(0,Math.min(1,Le))},ee=te=>{const xe=w(te);return xe<ie()?ie():xe},K=(te,xe,be)=>{const Ce=e.formatValue;if(typeof Ce=="function"){const he=Ce(te,xe,be);if(he!=null)return he}return`${Math.round(xe)}%`},re=te=>{for(;te.firstChild;)te.removeChild(te.firstChild)},H=(te,xe,be="flex")=>{re(te),(xe||[]).forEach(Ce=>{if(!(Ce==null||Ce===!1)){if(Ce instanceof Node){te.appendChild(Ce);return}te.appendChild(document.createTextNode(String(Ce)))}}),te.style.display=te.childNodes.length?be:"none"},j=(te,xe={})=>Ln(o(te),xe),Y=(te,xe,be={})=>{var he;const Ce=o(te);return Ce==null||Ce===!1||Ce===""?[]:typeof Ce=="string"?[v.Icon({name:Ce,size:(he=e.iconSize)!=null?he:16})]:j(Ce,{...be,as:xe})},W=te=>Pt(te)||_t(te)?o(te):typeof te=="function"&&te.length===0?te():te,[ie,ge]=JSswift.reactive.signal(w(c?c.get():(B=(I=o(e.value))!=null?I:o(e.min))!=null?B:0)),[ce,le]=JSswift.reactive.signal(ee((ye=o(e.buffer))!=null?ye:c?c.get():(Se=(pe=o(e.value))!=null?pe:o(e.min))!=null?Se:0)),oe=(te,xe={})=>{const be=w(te);return ie()!==be&&ge(be),ce()<be&&le(be),c&&xe.fromModel!==!0&&c.set(be),be},ne=te=>{const xe=ee(te);return ce()!==xe&&le(xe),xe},J=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"]),Z={width:o(e.width)||"100%",...e.style||{}},X=o(e.color);(X!=null||rt(e.color))&&!mt(X||"")&&delete Z.backgroundColor,J.class=ae(["cms-progress-wrap",me(e.dense,"dense"),me(e.reverse,"is-reverse"),me(e.indeterminate,"is-indeterminate"),y,e.class]),J.style=Z;const ue=_.div({class:"cms-progress-header"}),F=_.div({class:"cms-progress-heading"}),f=_.div({class:"cms-progress-label"}),m=_.div({class:"cms-progress-note"}),g=_.div({class:"cms-progress-value"});F.append(f,m),ue.append(F,g);const O=_.div({class:"cms-progress-body"}),Q=_.span({class:"cms-progress-edge-label cms-progress-edge-label-left"}),r=_.div({class:"cms-progress",role:"progressbar"}),x=_.span({class:"cms-progress-buffer"}),p=_.span({class:ae(["cms-progress-bar","cms-singularity",y,me(e.outline,"cms-outline"),me(e.flat,"cms-flat"),me(e.border,"cms-border"),me(e.glossy,"cms-glossy"),me(e.glow,"cms-glow"),me(e.glass,"cms-glass"),me(e.shadow,"cms-shadow"),Ye(e.shadow,()=>{const te=Hn(o(e.shadow));return te?`cms-shadow-${te}`:""}),me(e.gradient,"cms-gradient"),me(e.textGradient,"cms-text-gradient"),me(e.lightShadow,"cms-light-shadow"),me(e.striped,"is-striped"),me(e.animated||e.indeterminate,"is-animated")])}),P=_.span({class:"cms-progress-bar-label"});p.appendChild(P),r.append(x,p);const U=_.span({class:"cms-progress-edge-label cms-progress-edge-label-right"});O.append(Q,r,U);const G=_.div(J,ue,O);Ke(p,e);const de=()=>{const te=ie(),xe=T(te)*100,be={value:te,percent:xe,min:l(),max:b(),buffer:ce(),progress:G,track:r,bar:p,props:e},Ce=E(s,"icon",be,null),he=Ce.length?[]:Y(e.icon,"icon",be),Le=E(s,"label",be,W(e.label)),Ae=Le.length?Le:E(s,"default",be,n),z=E(s,"iconRight",be,null),we=z.length?[]:Y(e.iconRight,"iconRight",be),M=E(s,"note",be,W(e.note)),N=e.valueLabel!=null?W(e.valueLabel):K(te,xe,be),S=o(e.showValue),d=S===!0||e.valueLabel!=null||JSswift.ui.getSlot(s,"value")!=null?E(s,"value",be,N):[];H(f,[...he,...Ce,...Ae,...we,...z],"inline-flex"),H(m,M,"block"),H(g,S==="inside"?[]:d,"inline-flex"),ue.style.display=f.childNodes.length||m.childNodes.length||g.childNodes.length?"flex":"none"},A=()=>{var Le,Ae;const te=ie(),xe=T(te)*100,be={value:te,percent:xe,min:l(),max:b(),buffer:ce(),progress:G,track:r,bar:p,props:e},Ce=W((Le=e.startLabel)!=null?Le:e.leftLabel),he=W((Ae=e.endLabel)!=null?Ae:e.rightLabel);H(Q,E(s,"startLabel",be,Ce),"inline-flex"),H(U,E(s,"endLabel",be,he),"inline-flex")},u=()=>{const te=ie(),xe=T(te)*100,be={value:te,percent:xe,min:l(),max:b(),buffer:ce(),progress:G,track:r,bar:p,props:e},Ce=o(e.showValue),he=e.insideLabel!=null?W(e.insideLabel):K(te,xe,be),Le=Ce==="inside"||e.insideLabel!=null||JSswift.ui.getSlot(s,"inside")!=null?E(s,"inside",be,he):[];H(P,Le,"inline-flex")},k=()=>{const te=ie(),xe=ce(),be=l(),Ce=b(),he=T(te)*100,Le=T(xe)*100,Ae=C(e.color,""),z=C(e.trackColor,Ae?`color-mix(in srgb, ${Ae} 14%, transparent)`:"rgba(255,255,255,0.08)"),we=C(e.bufferColor,Ae?`color-mix(in srgb, ${Ae} 30%, transparent)`:"rgba(255,255,255,0.16)"),M=o(e.ariaLabel),N=o(e.ariaValueText),S=!!o(e.indeterminate),d=o(e.radius);G.style.width=o(e.width)||"100%",G.style.setProperty("--cms-progress-height",R()),d!=null?typeof d=="number"?G.style.setProperty("--cms-progress-radius",`${d}px`):typeof d=="string"&&JSswift.uiSizes.includes(d)?G.style.setProperty("--cms-progress-radius",`var(--cms-r-${d})`):G.style.setProperty("--cms-progress-radius",String(d)):G.style.removeProperty("--cms-progress-radius"),r.style.background=z,x.style.background=we,x.style.width=`${Le}%`,Ae&&!mt(o(e.state)||o(e.color))?(p.style.setProperty("--set-background-color",Ae),p.style.setProperty("--set-border-color",Ae),p.style.setProperty("--set-color",o(e.textColor)||"var(--cms-on-primary, #fff)")):mt(o(e.state)||o(e.color))?(p.style.removeProperty("--set-background-color"),p.style.removeProperty("--set-border-color"),p.style.removeProperty("--set-color")):(p.style.setProperty("--set-background-color","var(--cms-primary)"),p.style.setProperty("--set-border-color","var(--cms-primary)"),p.style.setProperty("--set-color",o(e.textColor)||"var(--cms-on-primary, #fff)")),S?(p.style.width="",r.removeAttribute("aria-valuenow"),r.removeAttribute("aria-valuemin"),r.removeAttribute("aria-valuemax")):(p.style.width=`${he}%`,r.setAttribute("aria-valuemin",String(be)),r.setAttribute("aria-valuemax",String(Ce)),r.setAttribute("aria-valuenow",String(te))),M!=null?r.setAttribute("aria-label",String(M)):typeof o(e.label)=="string"?r.setAttribute("aria-label",String(o(e.label))):r.removeAttribute("aria-label"),N!=null?r.setAttribute("aria-valuetext",String(N)):S?r.removeAttribute("aria-valuetext"):r.setAttribute("aria-valuetext",K(te,he,{value:te,percent:he,min:be,max:Ce,buffer:xe,progress:G,track:r,bar:p,props:e})),G.classList.toggle("has-start-label",Q.childNodes.length>0),G.classList.toggle("has-end-label",U.childNodes.length>0),G.classList.toggle("has-inside-label",P.childNodes.length>0)};return c?(oe(c.get(),{fromModel:!0}),c.watch(te=>{oe(te,{fromModel:!0})},"UI.Progress:watch")):rt(e.value)?JSswift.reactive.effect(()=>{oe(o(e.value),{fromModel:!0})},"UI.Progress:value"):oe((D=(V=e.value)!=null?V:e.min)!=null?D:0,{fromModel:!0}),rt(e.buffer)?JSswift.reactive.effect(()=>{ne(o(e.buffer))},"UI.Progress:buffer"):ne((ke=(Ne=(q=e.buffer)!=null?q:e.value)!=null?Ne:e.min)!=null?ke:0),JSswift.reactive.effect(()=>{de(),A(),u(),k()},"UI.Progress:render"),G._track=r,G._bar=p,G._buffer=x,G._getValue=ie,G._getBuffer=ce,G._setValue=te=>oe(te),G._setBuffer=te=>ne(te),G},(vi=JSswift.isDev)!=null&&vi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Progress={signature:"UI.Progress(...children) | UI.Progress(props, ...children)",props:{value:"number|rod|[get,set] signal",model:"rod|[get,set] signal",min:"number",max:"number",buffer:"number|rod|[get,set] signal",label:"String|Node|Function|Array",note:"String|Node|Function|Array",showValue:'boolean|"inside"',valueLabel:"String|Node|Function|Array",insideLabel:"String|Node|Function|Array",formatValue:"function(value, percent, ctx)",icon:"String|Node|Function|Array",iconRight:"String|Node|Function|Array",startLabel:"String|Node|Function|Array",endLabel:"String|Node|Function|Array",leftLabel:"Alias of startLabel",rightLabel:"Alias of endLabel",width:"string|number",size:"string|number",height:"string|number",thickness:"Alias of height",color:"string",state:"primary|secondary|success|warning|danger|info|light|dark",trackColor:"string",bufferColor:"string",striped:"boolean",animated:"boolean",indeterminate:"boolean",reverse:"boolean",slots:"{ icon?, label?, note?, value?, inside?, startLabel?, endLabel?, default? }",class:"string",style:"object"},slots:{icon:"Icon before the label",label:"Main progress content",note:"Secondary content below the label",value:"External value on the right",inside:"Content inside the bar",startLabel:"Label on the left of the bar",endLabel:"Label on the right of the bar",default:"Fallback label content"},returns:"HTMLDivElement",description:"Standardized progress bar with optional header, buffer, semantic state, and reactive support."}),v.LoadingBar=function(...e){var u,k;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),i=(I,B)=>{const pe=Number(I);return Number.isFinite(pe)?pe:B},c=()=>i(o(n.min),0),y=()=>{const I=c(),B=i(o(n.max),100);return B<I?I:B},a=I=>{const B=c(),pe=y(),Se=i(I,B);return Math.min(pe,Math.max(B,Se))},l=(I,B="")=>I==null||I===!1||I===""?B:typeof I=="number"?`${I}px`:String(I),b=I=>{const B=o(I);return!B||B===document?document.body:typeof B=="string"?document.querySelector(B)||document.body:B&&B.body instanceof HTMLElement?B.body:B instanceof HTMLElement?B:document.body},R=n.model||(_t(n.value)||Pt(n.value)?n.value:null),C=kt(R,"UI.LoadingBar:model"),w=_t(n.buffer)||Pt(n.buffer)?n.buffer:null,T=kt(w,"UI.LoadingBar:buffer"),ee=C?C.get():(u=o(n.value))!=null?u:c(),K=T?T.get():(k=o(n.buffer))!=null?k:ee,[re,H]=JSswift.reactive.signal(a(ee)),[j,Y]=JSswift.reactive.signal(Math.max(a(K),a(ee))),[W,ie]=JSswift.reactive.signal(n.visible!=null?!!o(n.visible):a(ee)>c()||!!o(n.indeterminate));let ge=null,ce=null;const le=()=>{ge&&(clearInterval(ge),ge=null)},oe=()=>{ce&&(clearTimeout(ce),ce=null)},ne=(I,B={})=>{const pe=!!I;return W()!==pe&&ie(pe),B.fromExternal!==!0&&typeof n.onVisibleChange=="function"&&n.onVisibleChange(pe),pe},J=(I,B={})=>{const pe=a(I);return re()!==pe&&H(pe),j()<pe&&(Y(pe),T&&B.fromExternal!==!0&&T.set(pe)),C&&B.fromExternal!==!0&&C.set(pe),pe},Z=(I,B={})=>{const pe=Math.max(J(re(),{fromExternal:!0}),a(I));return j()!==pe&&Y(pe),T&&B.fromExternal!==!0&&T.set(pe),pe},X=(I=re())=>{n.visible==null&&(o(n.indeterminate)||I>c()?ne(!0):o(n.hideOnZero)!==!1&&ne(!1))},ue=()=>{if(le(),o(n.trickle)===!1||o(n.indeterminate))return;const I=i(o(n.trickleInterval),280);I<=0||(ge=setInterval(()=>{var ye,V;const B=re(),pe=a((V=(ye=o(n.trickleTo))!=null?ye:o(n.trickleMax))!=null?V:92);if(B>=pe)return;const Se=i(o(n.trickleStep),B<45?12:B<75?7:3);J(Math.min(pe,B+Se))},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=ae(["cms-loading-bar",n.class]),F.style={...n.style||{}};const f=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"]);f.class=ae(["cms-loading-bar-progress",n.progressClass,f.class]),f.style={...n.progressStyle||{}},f.value=[re,H],f.buffer=[j,Y],f.dense==null&&(f.dense=!0),f.height==null&&f.thickness==null&&f.size==null&&(f.height=3),f.width==null&&(f.width="100%");const m=_.div(F),g=v.Progress(f,...s);m.appendChild(g);const O=I=>{oe();const B=J(I);return X(B),m},Q=I=>{oe();const B=Z(I);return X(B),m},r=(I=(B=>(B=o(n.step))!=null?B:8)())=>{oe();const pe=re(),Se=J(pe+i(I,0));return X(Se),m},x=(I=(B=>(B=o(n.startValue))!=null?B:12)())=>{oe();const pe=Math.max(re(),a(I));return J(pe),Z(Math.max(j(),pe)),X(pe),ue(),m},p=(I=(B=>(B=o(n.resetValue))!=null?B:c())())=>{oe(),le();const pe=a(I);return Z(pe),J(pe),X(pe),m},P=(I=(B=>(B=o(n.doneValue))!=null?B:y())())=>{var ye;oe(),le();const pe=a(I);Z(pe),J(pe),X(pe);const Se=Math.max(0,i((ye=o(n.hideDelay))!=null?ye:o(n.doneDelay),220));return ce=setTimeout(()=>{p()},Se),m},U=(...I)=>P(...I),G=()=>(ne(!0),m),de=()=>(oe(),le(),ne(!1),m),A=()=>(oe(),le(),m.remove(),null);return m.el=m,m._progress=g,m.get=()=>re(),m.getBuffer=()=>j(),m.set=O,m.setBuffer=Q,m.inc=r,m.start=x,m.done=P,m.complete=P,m.stop=U,m.reset=p,m.show=G,m.hide=de,m.destroy=A,m._dispose=A,C?C.watch(I=>{J(I,{fromExternal:!0}),X(a(I))},"UI.LoadingBar:watch"):rt(n.value)&&JSswift.reactive.effect(()=>{const I=a(o(n.value));J(I,{fromExternal:!0}),X(I)},"UI.LoadingBar:value"),T?T.watch(I=>{Z(I,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):rt(n.buffer)&&JSswift.reactive.effect(()=>{Z(o(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const I=c(),B=y(),pe=Math.min(B,Math.max(I,re())),Se=Math.max(pe,Math.min(B,Math.max(I,j())));pe!==re()&&H(pe),Se!==j()&&Y(Se)},"UI.LoadingBar:range"),JSswift.reactive.effect(()=>{n.visible!=null&&ne(o(n.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),JSswift.reactive.effect(()=>{var ke;const I=o(n.position)||"fixed",B=o(n.inset),pe=o(n.top),Se=o(n.right),ye=o(n.bottom),V=o(n.left),D=o(n.width),q=n.visible!=null?!!o(n.visible):W(),Ne=I==="static"||I==="relative";m.classList.toggle("is-visible",q),m.classList.toggle("is-inline",Ne),m.classList.toggle("has-track",!!o(n.trackColor)),m.style.position=I,m.style.zIndex=String((ke=o(n.zIndex))!=null?ke:10002),m.style.width=l(D,Ne?"100%":""),B!=null&&B!==""?(m.style.inset=l(B),m.style.removeProperty("top"),m.style.removeProperty("right"),m.style.removeProperty("bottom"),m.style.removeProperty("left")):(m.style.removeProperty("inset"),!Ne&&I!=="sticky"?(m.style.top=l(pe,"0px"),m.style.right=l(Se,D==null||D===""?"0px":""),m.style.bottom=l(ye,""),m.style.left=l(V,"0px")):(m.style.top=l(pe,""),m.style.right=l(Se,""),m.style.bottom=l(ye,""),m.style.left=l(V,"")))},"UI.LoadingBar:layout"),Ke(m,n),o(n.mount)!==!1&&b(n.target).appendChild(m),o(n.autoStart)&&x(),m},(Si=JSswift.isDev)!=null&&Si.call(JSswift)&&(v.meta=v.meta||{},v.meta.LoadingBar={signature:"UI.LoadingBar(...children) | UI.LoadingBar(props, ...children)",props:{value:"number|rod|[get,set] signal",model:"rod|[get,set] signal",buffer:"number|rod|[get,set] signal",min:"number",max:"number",height:"string|number",thickness:"Alias of height",size:"string|number",color:"string",state:"primary|secondary|success|warning|danger|info|light|dark",trackColor:"string",bufferColor:"string",striped:"boolean",animated:"boolean",indeterminate:"boolean",reverse:"boolean",width:"string|number",target:"HTMLElement|string",mount:"boolean",position:"fixed|absolute|relative|static|sticky",inset:"string|number",top:"string|number",right:"string|number",bottom:"string|number",left:"string|number",zIndex:"number",visible:"boolean",autoStart:"boolean",startValue:"number",step:"number",trickle:"boolean",trickleStep:"number",trickleInterval:"number",trickleMax:"number",trickleTo:"Alias of trickleMax",doneValue:"number",doneDelay:"Alias of hideDelay",hideDelay:"number",resetValue:"number",label:"String|Node|Function|Array",note:"String|Node|Function|Array",showValue:'boolean|"inside"',valueLabel:"String|Node|Function|Array",insideLabel:"String|Node|Function|Array",startLabel:"String|Node|Function|Array",endLabel:"String|Node|Function|Array",progressClass:"string",progressStyle:"object",slots:"{ icon?, label?, note?, value?, inside?, startLabel?, endLabel?, default? }",class:"string",style:"object"},slots:{icon:"Icon before the label",label:"Main content",note:"Secondary content",value:"External value on the right",inside:"Content inside the bar",startLabel:"Label on the left of the bar",endLabel:"Label on the right of the bar",default:"Fallback content"},returns:"HTMLDivElement with imperative API: .set(), .setBuffer(), .inc(), .start(), .done(), .stop(), .reset(), .show(), .hide(), .destroy()",description:"Loading bar based on UI.Progress, mountable on body or a custom container, controllable via model or imperative API."});const wo=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),tr=new Set(["soft","solid","outline"]),nr={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},sr={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},vo=t=>{const e=String(o(t)||"").trim().toLowerCase();return e?wo.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"},or=t=>{const e=String(o(t)||"").trim().toLowerCase();return tr.has(e)?e:"soft"},ir=(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},Kt=(t={},e="")=>{var a,l,b,R,C,w,T,ee,K,re,H,j,Y,W;const n=ln(t)?{...t}:{message:t},s=mt(o(e)||o(n.type)||o(n.state)||o(n.color)||"info")||"info",i=ir((l=(a=n.timeout)!=null?a:n.duration)!=null?l:n.delay,s),c=(C=(R=(b=n.closable)!=null?b:n.dismissible)!=null?R:n.dismiss!=null)!=null?C:i===0,y=n.title===void 0?n.label===void 0?nr[s]:n.label:n.title;return{...n,type:s,state:s,title:y,message:(ee=(T=(w=n.message)!=null?w:n.content)!=null?T:n.text)!=null?ee:null,description:(H=(re=(K=n.description)!=null?K:n.subtitle)!=null?re:n.note)!=null?H:null,meta:(Y=(j=n.meta)!=null?j:n.caption)!=null?Y:null,body:(W=n.body)!=null?W:null,timeout:i,closable:!!c,dismissLabel:n.dismissLabel||n.closeLabel||"Chiudi notifica",position:vo(n.position),variant:or(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},So=(t,e="",n="")=>{if(!t.length)return Kt(n?{type:e,title:n}:{type:e});if(ln(t[0])){const{props:a,children:l}=JSswift.uiNormalizeArgs(t),b={...a};return!b.type&&!b.state&&!b.color&&e&&(b.type=e),b.title==null&&n&&(b.title=n),l.length&&(b.message==null&&b.description==null&&b.body==null&&l.length===1?b.message=l[0]:b.body==null&&(b.body=l.length===1?l[0]:l)),Kt(b,e)}const[s,i,c]=t;let y={};return ln(i)?y={...i,message:s}:ln(c)?y={...c,message:s,title:i}:y={message:s,title:i},e&&!y.type&&!y.state&&!y.color&&(y.type=e),y.title==null&&n&&(y.title=n),Kt(y,e)},Rt=(t,e)=>(...n)=>{var s,i;return(i=(s=je.services.notify)==null?void 0:s.show)==null?void 0:i.call(s,So(n,t,e))},Gn=(t,e,n)=>{if(t===!1)return!1;if(typeof t=="function"){const s=t();return Gn(s,e,n)}return ln(t)?t:t!=null?{message:t,title:n}:{message:e,title:n}};v.Notify=(...t)=>{var e,n;return(n=(e=je.services.notify)==null?void 0:e.show)==null?void 0:n.call(e,So(t))},v.Notify.show=v.Notify,v.Notify.success=Rt("success","Success"),v.Notify.error=Rt("danger","Error"),v.Notify.warning=Rt("warning","Warning"),v.Notify.info=Rt("info","Info"),v.Notify.primary=Rt("primary","Notice"),v.Notify.secondary=Rt("secondary","Notice"),v.Notify.remove=t=>{var e,n;return(n=(e=je.services.notify)==null?void 0:e.remove)==null?void 0:n.call(e,t)},v.Notify.clear=()=>{var t,e;return(e=(t=je.services.notify)==null?void 0:t.clear)==null?void 0:e.call(t)},v.Notify.update=(t,e={})=>{var n,s;return(s=(n=je.services.notify)==null?void 0:n.update)==null?void 0:s.call(n,t,e)},v.Notify.promise=async(t,e={})=>{var i,c,y,a,l,b,R,C,w,T,ee,K,re,H;const n=e.loading===!1?!1:Gn(typeof e.loading=="function"?()=>e.loading():e.loading,"Operazione in corso...","In corso"),s=n===!1?null:(c=(i=je.services.notify)==null?void 0:i.show)==null?void 0:c.call(i,Kt({type:"info",timeout:0,closable:!1,...n},"info"));try{const Y=await(typeof t=="function"?t():t),W=Gn(typeof e.success=="function"?()=>e.success(Y):e.success,"Operazione completata con successo.","Completato");return W!==!1?s!=null?(a=(y=je.services.notify)==null?void 0:y.update)==null||a.call(y,s,Kt(W,"success")):(b=(l=je.services.notify)==null?void 0:l.show)==null||b.call(l,Kt(W,"success")):s!=null&&((C=(R=je.services.notify)==null?void 0:R.remove)==null||C.call(R,s)),Y}catch(j){const Y=Gn(typeof e.error=="function"?()=>e.error(j):e.error,(j==null?void 0:j.message)||"Operazione fallita.","Errore");throw Y!==!1?s!=null?(T=(w=je.services.notify)==null?void 0:w.update)==null||T.call(w,s,Kt(Y,"danger")):(K=(ee=je.services.notify)==null?void 0:ee.show)==null||K.call(ee,Kt(Y,"danger")):s!=null&&((H=(re=je.services.notify)==null?void 0:re.remove)==null||H.call(re,s)),j}},(Ci=JSswift.isDev)!=null&&Ci.call(JSswift)&&(v.meta=v.meta||{},v.meta.Notify={signature:"UI.Notify(message, title?, opts?) | UI.Notify(opts, ...children)",props:{id:"string",type:"success|warning|danger|error|info|primary|secondary|light|dark",state:"Alias of type",color:"Alias of type",title:"String|Node|Function|Array|false",message:"String|Node|Function|Array",description:"String|Node|Function|Array",meta:"String|Node|Function|Array",body:"Node|Function|Array",icon:"String|Node|Function|Array|false",actions:"Node|Function|Array",dismiss:"Node|Function|Array",timeout:"number|false",duration:"Alias of timeout",closable:"boolean",dismissLabel:"string",position:"top-left|top-center|top-right|bottom-left|bottom-center|bottom-right",variant:"soft|solid|outline",slots:"{ icon?, title?, message?, description?, meta?, actions?, dismiss?, default? }",class:"string",style:"object"},slots:{icon:"Leading visual/icon content",title:"Toast title content",message:"Primary message content",description:"Secondary/supporting text",meta:"Meta info or badges",actions:"Actions area content",dismiss:"Custom dismiss control",default:"Extra body content under the message"},methods:{show:"Alias of UI.Notify(...)",success:"UI.Notify.success(message|opts, title?)",error:"UI.Notify.error(message|opts, title?)",warning:"UI.Notify.warning(message|opts, title?)",info:"UI.Notify.info(message|opts, title?)",update:"UI.Notify.update(id, patch)",remove:"UI.Notify.remove(id)",clear:"UI.Notify.clear()",promise:"UI.Notify.promise(promise|fn, { loading?, success?, error? })"},returns:"string|null (toast id)",description:"Standardized notify service with structured payloads, semantic shortcuts, update/remove/clear, and promise support."}),v.Header=(...t)=>{var x,p,P,U,G,de,A;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e};Yt(i);const c=u=>Object.prototype.hasOwnProperty.call(e,u),y=(x=e.drawerStateKey)!=null?x:Xt;y&&(Xt=y,Et=tn(y));const a=()=>tn(y),l=()=>Wt(!0,y),b=()=>Wt(!1,y),R=()=>Wt(!a(),y),C={props:e,stateKey:y,isDrawerOpen:a,openDrawer:l,closeDrawer:b,toggleDrawer:R,toggleAside:R},w=(u,k)=>{if(!(k==null||k===!1)){if(Array.isArray(k)){k.forEach(I=>w(u,I));return}if(k!=null&&k.nodeType){u.appendChild(k);return}u.appendChild(document.createTextNode(String(k)))}},T=(u,k,I=B=>B)=>{const B=JSswift.ui.getSlot(s,u);if(B!=null)return E(s,u,C,null);if(typeof k=="function"){const pe=new Set(["eyebrow","title","subtitle"]),Se=_[pe.has(u)?"span":"div"]({class:`cms-header-slot-${u}`});return JSswift.reactive.effect(()=>{const ye=I(k(C)),V=rn(JSswift.ui.slot(ye));Se.replaceChildren(),Array.isArray(V)?V.forEach(D=>w(Se,D)):w(Se,V)},`UI.Header:${u}`),[Se]}return E(s,u,C,I(k))},ee=(u,k="icon",I=e.iconSize||e.size||"md")=>u==null||u===!1?null:typeof u=="string"?v.Icon({name:u,size:I}):JSswift.ui.slot(u,{as:k}),K=u=>{var I,B;const k=u?(I=e.drawerOpenIcon)!=null?I:"\u2715":(B=e.drawerCloseIcon)!=null?B:"\u2630";return k==null||k===!1?null:typeof k=="string"?k:JSswift.ui.slot(k,{as:u?"drawerOpenIcon":"drawerCloseIcon"})},re=_.span({class:"cms-header-toggle-icon"}),H=u=>{const k=E(null,"default",C,K(u));re.replaceChildren(...k.length?k:[""])};H(a());const j=v.Btn({class:"cms-header-toggle",outline:!0,size:(P=(p=e.toggleSize)!=null?p:e.size)!=null?P:"sm",onClick:R,"aria-label":e.toggleLabel||"Toggle navigation"},re);e.left==null&&e.left!==!1&&!JSswift.ui.getSlot(s,"left")&&go.add({update:H});const Y=e.left===!1?null:e.left!=null?e.left:j,W=c("title")?e.title:(U=e.label)!=null?U:"App",ie=(de=(G=e.subtitle)!=null?G:e.description)!=null?de:"",ge=c("right")?e.right:e.end,ce=c("content")?e.content:c("body")?e.body:n!=null&&n.length?n:null,le=[...T("left",Y),...T("start",null)],oe=T("icon",e.icon,ee),ne=T("eyebrow",(A=e.eyebrow)!=null?A:e.kicker),J=T("title",W),Z=T("subtitle",ie),X=T("meta",e.meta),ue=(()=>{const u=T("content",null);return u.length?u:T("default",ce)})(),F=[...T("center",null),...T("body",null)],f=[...T("right",ge),...T("end",null)],m=T("actions",e.actions),g=_.div({class:ae(["cms-header-body",e.bodyClass,e.centerClass])},_.div({class:"cms-header-heading"},oe.length?_.div({class:"cms-header-icon"},...oe):null,_.div({class:"cms-header-copy"},ne.length?_.div({class:ae(["cms-header-eyebrow",e.eyebrowClass])},...ne):null,J.length?_.div({class:ae(["cms-header-title",e.titleClass])},...J):null,Z.length?_.div({class:ae(["cms-header-subtitle",e.subtitleClass])},...Z):null,ue.length?_.div({class:ae(["cms-header-content",e.contentClass])},...ue):null),X.length?_.div({class:ae(["cms-header-meta",e.metaClass])},...X):null)),O=[...f,...m.length?[_.div({class:ae(["cms-header-actions",e.actionsClass])},...m)]:[]],Q=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"]);Q.class=ae(["cms-panel","cms-header","cms-singularity",me(e.sticky!==!1,"sticky"),me(e.stack,"stack"),me(e.elevated,"elevated"),me(e.divider!==!1,"divider"),i.class]),Q.style={...i.style||{}},e.gap!=null&&(Q.style["--cms-header-gap"]=$e(o(e.gap))),e.minHeight!=null&&(Q.style.minHeight=$e(o(e.minHeight)));const r=_.div(Q,...le.length?[_.div({class:ae(["cms-header-start",e.startClass])},...le)]:[],_.div({class:"cms-header-main"},...F.length?[_.div({class:ae(["cms-header-body",e.bodyClass,e.centerClass])},...F)]:[g],...O.length?[_.div({class:ae(["cms-header-end",e.endClass])},...O)]:[]));return Ke(r,e),r},(xi=JSswift.isDev)!=null&&xi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Header={signature:"UI.Header(...children) | UI.Header(props, ...children)",props:{title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",eyebrow:"String|Node|Function|Array",content:"Node|Function|Array",meta:"Node|Function|Array",icon:"String|Node|Function|Array",left:"Node|Function|Array|false",right:"Node|Function|Array",actions:"Node|Function|Array",drawerOpenIcon:"string|Node",drawerCloseIcon:"string|Node",drawerStateKey:"string",sticky:"boolean",stack:"boolean",dense:"boolean",elevated:"boolean",divider:"boolean",gap:"string|number",minHeight:"string|number",slots:"{ left?, start?, right?, end?, center?, body?, icon?, eyebrow?, title?, subtitle?, meta?, content?, actions? }",class:"string",style:"object"},slots:{left:"Left area, falls back to the drawer toggle",start:"Alias/addon for the left area",right:"Main right area",end:"Alias/addon for the right area",center:"Full override for the central body",body:"Alias of center",icon:"Leading icon",eyebrow:"Eyebrow / kicker",title:"Title",subtitle:"Subtitle",meta:"Meta info next to the central content",content:"Extra content below the subtitle",actions:"Actions grouped in the right area"},returns:"HTMLDivElement",description:"Structured header with start/body/end regions, integrated drawer toggle, metadata, and composable slots."}),v.Drawer=(...t)=>{var be,Ce,he,Le,Ae,z,we,M,N,S;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=d=>Object.prototype.hasOwnProperty.call(e,d),y=(be=e.stateKey)!=null?be:Xt;y&&(Xt=y,Et=tn(y));const a=()=>tn(y),l=()=>Wt(!0,y),b=()=>Wt(!1,y),R=()=>Wt(!a(),y),C={props:e,stateKey:y,isDrawerOpen:a,openDrawer:l,closeDrawer:b,toggleDrawer:R,toggleAside:R},w=JSswift==null?void 0:JSswift.store,T=!!(w!=null&&w.get&&(w!=null&&w.set)),ee=`${y}:groups`,K=`${y}:active`;let re=T?w.get(ee,{})||{}:{},H=T&&(Ce=w.get(K,null))!=null?Ce:null;const j=new Map,Y=new Map,W=d=>{const L=o(d);return L==null||L===!1?[]:Array.isArray(L)?L.flat(1/0):[L]},ie=(d,L,fe=C)=>{const Fe=Array.isArray(d)?d:[d];for(const Te of Fe)if(JSswift.ui.getSlot(s,Te)!=null)return E(s,Te,fe,L);return L==null?[]:E(null,"default",fe,o(L))},ge=d=>(Array.isArray(d)?d:[d]).some(fe=>JSswift.ui.getSlot(s,fe)!=null),ce=d=>{if(typeof o(d.external)=="boolean")return!!o(d.external);const L=o(d.href||d.to||d.link||"");return/^(https?:)?\/\//.test(L)},le=(he=e.closeOnSelect)!=null?he:!0,oe=d=>!!le&&o(d.keepOpen)!==!0,ne=(Ae=(Le=e.itemIconSize)!=null?Le:e.size)!=null?Ae:"md",J=(z=e.groupOpenIcon)!=null?z:"arrow_drop_up",Z=(we=e.groupCloseIcon)!=null?we:"arrow_drop_down",X=d=>!!d&&H===d,ue=d=>!!d&&!!H&&(H===d||H.startsWith(`${d}::`)),F=()=>{j.forEach(({el:d,baseActive:L},fe)=>{const Fe=!!L||X(fe);d.classList.toggle("active",Fe),Fe?d.setAttribute("aria-current","page"):d.removeAttribute("aria-current")}),Y.forEach(({wrap:d,toggle:L,baseActive:fe},Fe)=>{const Te=!!fe||ue(Fe);d.classList.toggle("active",Te),L.classList.toggle("active",Te)})},f=d=>{H=d||null,T&&w.set(K,H),F()},m=(d,L)=>{if(o(d.active)!=null)return!!o(d.active);if(o(d.current)!=null)return!!o(d.current);if(!L||ce(d))return!1;try{if(L.startsWith("#"))return window.location.hash===L;const fe=`${window.location.pathname}${window.location.search}${window.location.hash}`;return L===fe||L===window.location.pathname}catch(fe){return!1}},g=(d,L,fe)=>m(d,L)||X(fe),O=(d=[],L=0,fe=[])=>W(d).some((Fe,Te)=>{var qe,Ze,Qe,Ee,Be;const $=o(Fe);if(!$||typeof $!="object"||$.nodeType)return!1;const _e=o($.href||$.to||$.link||""),Re=(Be=o((Ee=(Qe=(Ze=(qe=$.label)!=null?qe:$.title)!=null?Ze:$.text)!=null?Qe:_e)!=null?Ee:null))!=null?Be:`item-${L}-${Te}`,Pe=p($,Re,L,Te),De=fe.concat(Pe).join("::");if(g($,_e,De))return!0;const We=$.items||$.children||$.sub;return O(We,L+1,fe.concat(Pe))}),Q=(d,L={})=>{var Te;const fe=o(d);if(fe==null||fe===!1)return[];const Fe=typeof fe=="string"?v.Icon({name:fe,size:(Te=L.iconSize)!=null?Te:ne}):JSswift.ui.slot(fe,{...L,as:"icon"});return E(null,"default",L,Fe)},r=(d,L,fe={})=>{const Fe=Q(d,fe);return Fe.length?[_.span({class:ae(["cms-drawer-item-icon",L])},...Fe)]:[]},x=d=>{const L=o(d.iconPosition)||"left",fe=Object.prototype.hasOwnProperty.call(d,"iconLeft")?d.iconLeft:L!=="right"?d.icon:null,Fe=Object.prototype.hasOwnProperty.call(d,"iconRight")?d.iconRight:L==="right"?d.icon:null;return{left:fe,right:Fe}},p=(d,L,fe,Fe)=>o(d.key||d.id||d.to||d.href||L||`item-${fe}-${Fe}`),P=(d,L)=>T&&Object.prototype.hasOwnProperty.call(re,d)?!!re[d]:L,U=(d,L)=>{T&&(re={...re,[d]:!!L},w.set(ee,re))},G=()=>{const d={...C,area:"header"},L=ie(["headerIcon","icon"],e.icon,d),fe=ie(["eyebrow"],e.eyebrow,d),Fe=ie(["title"],e.title,d),Te=ie(["subtitle"],e.subtitle,d),$=ie(["meta"],e.meta,d),_e=ie(["content"],e.content,d),Re=ie(["actions"],e.actions,d),Pe=c("header")?E(null,"default",d,o(e.header)):[],De=L.length||fe.length||Fe.length||Te.length||$.length||_e.length||Re.length;return!De&&!Pe.length?[]:De?[_.div({class:ae(["cms-drawer-header",e.headerClass])},...L.length?[_.div({class:"cms-drawer-header-icon"},...L)]:[],_.div({class:"cms-drawer-header-body"},...fe.length?[_.div({class:"cms-drawer-header-eyebrow"},...fe)]:[],...Fe.length?[_.div({class:"cms-drawer-header-title"},...Fe)]:[],...Te.length?[_.div({class:"cms-drawer-header-subtitle"},...Te)]:[],...$.length?[_.div({class:"cms-drawer-header-meta"},...$)]:[],..._e.length?[_.div({class:"cms-drawer-header-content"},..._e)]:[],...Pe.length?[_.div({class:"cms-drawer-header-extra"},...Pe)]:[]),...Re.length?[_.div({class:"cms-drawer-header-actions"},...Re)]:[])]:Pe},de=(d,L,fe)=>{var $,_e;return!((($=d.onClick)==null?void 0:$.call(d,fe,L))===!1||fe!=null&&fe.defaultPrevented||((_e=e.onSelect)==null?void 0:_e.call(e,d,L,fe))===!1||fe!=null&&fe.defaultPrevented)},A=(d,L,fe={})=>{const Fe=L.hasChildren?"group":"item",Te=E(s,`${Fe}Label`,L,L.label),$=E(s,`${Fe}Note`,L,L.note),_e=E(s,`${Fe}Badge`,L,L.badge),Re=E(s,`${Fe}Aside`,L,L.aside),Pe=E(s,`${Fe}Content`,L,L.content),De=[];return(Te.length||$.length||_e.length||Re.length)&&De.push(_.div({class:"cms-drawer-item-top"},_.div({class:"cms-drawer-item-copy"},...Te.length?[_.div({class:"cms-drawer-item-label"},...Te)]:[],...$.length?[_.div({class:"cms-drawer-item-note"},...$)]:[]),..._e.length||Re.length?[_.div({class:"cms-drawer-item-meta"},..._e.length?[_.div({class:"cms-drawer-item-badge"},..._e)]:[],...Re.length?[_.div({class:"cms-drawer-item-aside"},...Re)]:[])]:[])),Pe.length&&De.push(_.div({class:"cms-drawer-item-content"},...Pe)),[...fe.start||[],...r(L.iconLeft,"left",L),...De.length?[_.div({class:"cms-drawer-item-main"},...De)]:[],...r(L.iconRight,"right",L),...fe.end||[]]},u=(d=[],L=0,fe=[])=>W(d).map((Fe,Te)=>{var sn,ze,Ve,et,ct,gt,pt,Ct,yt,h,se;const $=o(Fe);if($==null||$===!1)return null;if($.nodeType||typeof $!="object"||Array.isArray($))return _.div({class:"cms-drawer-custom","data-level":String(L)},...E(null,"default",{...C,item:$,level:L,index:Te,path:fe},$));if(o($.hidden)===!0||o($.visible)===!1)return null;const _e=W($.items||$.children||$.sub),Re=o($.href||$.to||$.link||null),Pe=o((et=(Ve=(ze=(sn=$.label)!=null?sn:$.title)!=null?ze:$.text)!=null?Ve:Re)!=null?et:null),De=Pe!=null?Pe:`item-${L}-${Te}`,We=o((pt=(gt=(ct=$.note)!=null?ct:$.subtitle)!=null?gt:$.description)!=null?pt:null),qe=o((Ct=$.badge)!=null?Ct:null),Ze=o((h=(yt=$.aside)!=null?yt:$.meta)!=null?h:null),Qe=o((se=$.content)!=null?se:null),Ee=p($,De,L,Te),Be=fe.concat(Ee).join("::"),{left:tt,right:nt}=x($),dt=mt(o($.state)||o($.color)||""),ut=m($,Re),bt=ut||X(Be),ot=!!o($.disabled),ft={...C,item:$,index:Te,level:L,path:fe,label:De,note:We,badge:qe,aside:Ze,content:Qe,itemStateKey:Be,iconLeft:tt,iconRight:nt,iconSize:o($.iconSize)||ne,active:bt,disabled:ot,hasChildren:!1},vt=o($.divider)===!0||$.type==="divider"||$.type==="separator",At=o($.section)===!0||$.type==="section"||$.type==="heading"||$.type==="label",at=$.type==="content"||$.type==="custom"||!Re&&!_e.length&&!o($.button)&&$.type!=="button"&&Pe==null&&Qe!=null;if(vt)return _.div({class:ae(["cms-drawer-separator",$.class]),"data-level":String(L)});if(At){const ve=E(s,"sectionLabel",ft,De||Qe);return _.div({class:ae(["cms-drawer-section-label",$.class]),"data-level":String(L)},...ve)}if(at){const ve=E(s,"item",ft,Qe!=null?Qe:De);return _.div({class:ae(["cms-drawer-custom",dt?`cms-drawer-tone-${dt}`:"",$.class]),style:$.style,"data-level":String(L)},...ve)}if(_e.length){const ve=ut||O(_e,L+1,fe.concat(Ee)),Me=ve||ue(Be);let Je=P(Be,!!o($.expanded)||!!o($.open)||Me);const Oe=_.span({class:"cms-drawer-group-icon"}),He={...ft,active:Me,hasChildren:!0,isOpen:()=>Je,setOpen:Ft=>zt(Ft),toggle:()=>zt(!Je)},Xe=()=>{var fn,mn;const Ft=Je?(fn=$.openIcon)!=null?fn:J:(mn=$.closeIcon)!=null?mn:Z,on=o(Je?$.iconSidePosition||$.openIconSide||$.openIconPosition||"right":$.iconSidePosition||$.closeIconSide||$.closeIconPosition||"right")==="left"?"left":"right";Oe.innerHTML="",Oe.className=`cms-drawer-group-icon ${on}`,Q(Ft,{...He,as:"toggleIcon"}).forEach(Sn=>Oe.appendChild(Sn))},it=_.button({type:"button",class:ae(["cms-drawer-group-toggle","cms-drawer-entry",Je?"open":"",Me?"active":"",ot?"is-disabled":"",dt?`cms-drawer-tone-${dt}`:"",$.class]),style:$.style,"data-level":String(L),"aria-expanded":String(Je),"aria-disabled":ot?"true":null,onClick:Ft=>{if(ot){Ft.preventDefault();return}f(Be),zt(!Je)}},...A($,He,{start:o($.iconSidePosition||$.openIconSide||$.closeIconSide||$.openIconPosition||$.closeIconPosition||"right")==="left"?[Oe]:[],end:o($.iconSidePosition||$.openIconSide||$.closeIconSide||$.openIconPosition||$.closeIconPosition||"right")==="right"?[Oe]:[]})),ht=E(s,"group",He,null),xt=_.div({class:"cms-drawer-group-items"},...u(_e,L+1,fe.concat(Ee))),$t=_.div({class:ae(["cms-drawer-group",Je?"open":"",Me?"active":"",dt?`cms-drawer-tone-${dt}`:""]),"data-level":String(L)},...ht.length?ht:[it],xt),zt=Ft=>{Je=!!Ft,$t.classList.toggle("open",Je),it.classList.toggle("open",Je),it.setAttribute("aria-expanded",String(Je)),Xe(),U(Be,Je)};return Y.set(Be,{wrap:$t,toggle:it,baseActive:ve}),Xe(),$t}const Vt=E(s,"item",ft,null),Jt=o($.button)===!0||$.type==="button"||!Re&&typeof $.onClick=="function",wt={class:ae(["cms-drawer-entry",Jt?"cms-drawer-btn":"cms-drawer-link",bt?"active":"",ot?"is-disabled":"",dt?`cms-drawer-tone-${dt}`:"",$.class]),style:$.style,"data-level":String(L),"aria-current":bt?"page":null,"aria-disabled":ot?"true":null},qt=Vt.length?Vt:A($,ft);if(Jt){const ve=_.button({...wt,type:$.buttonType||"button",disabled:ot,onClick:Me=>{if(ot){Me.preventDefault();return}de($,ft,Me)&&(f(Be),oe($)&&b())}},...qt);return j.set(Be,{el:ve,baseActive:ut}),ve}const St=ce($),dn=St?o($.target)||"_blank":o($.target),un=St?o($.rel)||"noopener noreferrer":o($.rel),nn=_.a({...wt,href:Re||"#",target:dn||null,rel:un||null,tabIndex:ot?-1:null,onClick:ve=>{var Me;if(ot){ve.preventDefault();return}de($,ft,ve)&&(!St&&$.to&&((Me=je.router)!=null&&Me.navigate)&&(ve.preventDefault(),je.router.navigate($.to)),oe($)&&b())}},...qt);return j.set(Be,{el:nn,baseActive:ut}),nn}).filter(Boolean),k=ie(["before","beforeItems"],(M=e.before)!=null?M:e.beforeItems),I=ge(["body"])?ie(["body"],null):[],B=u(e.items||[]),pe=ie(["default"],n),Se=ie(["after","afterItems"],(N=e.after)!=null?N:e.afterItems),ye=I.length?I:[...k,...B,...pe,...Se],V=c("empty")||c("emptyText")?(S=e.empty)!=null?S:_.div({class:ae(["cms-drawer-empty",e.emptyClass])},e.emptyText||"Nessun contenuto"):_.div({class:ae(["cms-drawer-empty",e.emptyClass])},"Nessun contenuto"),D=ie(["header"],G()),q=ie(["footer"],e.footer),Ne=ye.length?ye:ie(["empty"],V),ke=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"]);ke.class=ae(["cms-panel","cms-drawer",Et?"open":"",me(e.sticky,"sticky"),i.class]),ke.style={...i.style||{}},e.gap!=null&&(ke.style["--cms-drawer-gap"]=$e(o(e.gap))),e.indent!=null&&(ke.style["--cms-drawer-indent"]=$e(o(e.indent))),e.padding!=null&&(ke.style["--cms-drawer-padding"]=$e(o(e.padding))),e.width!=null&&(ke.style.width=$e(o(e.width))),e.minHeight!=null&&(ke.style.minHeight=$e(o(e.minHeight))),e.maxHeight!=null&&(ke.style.maxHeight=$e(o(e.maxHeight)));const te=_.div(ke,...D.length?D:[],_.div({class:ae(["cms-drawer-body",e.bodyClass])},...Ne),...q.length?[_.div({class:ae(["cms-drawer-footer",e.footerClass])},...q)]:[]),xe=hs.get(y)||new Set;return xe.add(te),hs.set(y,xe),Wt(Et,y),te.isDrawerOpen=a,te.openDrawer=l,te.closeDrawer=b,te.toggleDrawer=R,te.setActiveItem=f,Ke(te,e),F(),te},(Ni=JSswift.isDev)!=null&&Ni.call(JSswift)&&(v.meta=v.meta||{},v.meta.Drawer={signature:"UI.Drawer(props)",props:{items:"Array",header:"Node|Function|Array",footer:"Node|Function|Array",before:"Node|Function|Array",after:"Node|Function|Array",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",eyebrow:"String|Node|Function|Array",icon:"String|Node|Function|Array",content:"Node|Function|Array",meta:"Node|Function|Array",actions:"Node|Function|Array",empty:"Node|Function|Array",emptyText:"string",stateKey:"string",closeOnSelect:"boolean",groupOpenIcon:"String|Node|Function|Array",groupCloseIcon:"String|Node|Function|Array",itemIconSize:"string|number",gap:"string|number",indent:"string|number",padding:"string|number",width:"string|number",minHeight:"string|number",maxHeight:"string|number",onSelect:"function(item, ctx, event)",sticky:"boolean",slots:"{ header?, body?, footer?, before?, after?, empty?, item?, itemLabel?, itemNote?, itemBadge?, itemAside?, itemContent?, group?, groupLabel?, groupNote?, groupBadge?, groupAside?, groupContent?, sectionLabel? }",class:"string",style:"object"},slots:{header:"Drawer header, full override",body:"Full body override",footer:"Drawer footer",before:"Content before the item list",after:"Content after the item list",empty:"Empty state when there is no content",item:"Full override for a simple item",itemLabel:"Item label (ctx: { item, label, note, badge, aside, content })",itemNote:"Item note/subtitle",itemBadge:"Item badge",itemAside:"Item aside/meta",itemContent:"Extra item content",group:"Full override for a group header (ctx includes toggle/isOpen)",groupLabel:"Group label",groupNote:"Group note",groupBadge:"Group badge",groupAside:"Group aside/meta",groupContent:"Extra group content",sectionLabel:"Label for section/heading items"},returns:"HTMLDivElement with openDrawer/closeDrawer/toggleDrawer/isDrawerOpen methods",description:"Structured, backward-compatible drawer with header/footer, groups, extended slots, empty state, and persistent state."}),v.Page=(...t)=>{var g,O,Q,r;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i={...e},c=(x,p)=>{var P;return!!(x&&x.nodeType===1&&((P=x.classList)!=null&&P.contains(`cms-page-${p}`)))},y=x=>x==null?null:typeof x=="string"?v.Icon({name:x,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(x,{as:"icon"}),a={dense:!!o(e.dense),flat:!!o(e.flat),centered:!!o(e.centered),narrow:!!o(e.narrow)},l=(x,p)=>{if(!(p==null||p===!1)){if(Array.isArray(p)){p.forEach(P=>l(x,P));return}if(p!=null&&p.nodeType){x.appendChild(p);return}x.appendChild(document.createTextNode(String(p)))}},b=(x,p,P=U=>U)=>{const U=JSswift.ui.getSlot(s,x);if(U!=null)return E(s,x,a,null);if(typeof p=="function"){const G=new Set(["eyebrow","title","subtitle"]),de=_[G.has(x)?"span":"div"]({class:`cms-page-slot-${x}`});return JSswift.reactive.effect(()=>{const A=P(p(a)),u=rn(JSswift.ui.slot(A));de.replaceChildren(),Array.isArray(u)?u.forEach(k=>l(de,k)):l(de,u)},`UI.Page:${x}`),[de]}return E(s,x,a,P(p))},R=E(s,"default",a,n!=null&&n.length?n:[]),C={hero:[],header:[],body:[],footer:[],actions:[]},w=[];R.forEach(x=>{c(x,"hero")?C.hero.push(x):c(x,"header")?C.header.push(x):c(x,"body")?C.body.push(x):c(x,"footer")?C.footer.push(x):c(x,"actions")?C.actions.push(x):w.push(x)});const T=b("icon",e.icon,y),ee=b("hero",(g=e.hero)!=null?g:e.banner),K=b("eyebrow",(O=e.eyebrow)!=null?O:e.kicker),re=b("title",e.title),H=b("subtitle",(Q=e.subtitle)!=null?Q:e.description),j=b("header",e.header),Y=b("aside",e.aside),W=b("body",(r=e.body)!=null?r:e.content),ie=b("footer",e.footer),ge=b("actions",e.actions),ce=ee.length?_.div({class:ae(["cms-page-hero",e.heroClass])},...ee):null,le=T.length||K.length||re.length||H.length||j.length||Y.length,oe=le?_.div({class:ae(["cms-page-header",e.headerClass])},_.div({class:"cms-page-head"},T.length?_.div({class:ae(["cms-page-icon",e.iconClass])},...T):null,_.div({class:"cms-page-head-main"},K.length?_.div({class:ae(["cms-page-eyebrow",e.eyebrowClass])},...K):null,re.length?_.div({class:ae(["cms-page-title",e.titleClass])},...re):null,H.length?_.div({class:ae(["cms-page-subtitle",e.subtitleClass])},...H):null,j.length?_.div({class:ae(["cms-page-header-content",e.headerContentClass])},...j):null),Y.length?_.div({class:ae(["cms-page-aside",e.asideClass])},...Y):null)):null,ne=[...W,...w],J=ne.length?_.div({class:ae(["cms-page-body",e.bodyClass])},...ne):null,Z=[...ge,...C.actions],X=ie.length||Z.length?_.div({class:ae(["cms-page-footer",e.footerClass])},...ie,Z.length?_.div({class:"cms-page-actions"},...Z):null):null,ue=!!(ee.length||C.hero.length),F=!!(le||C.header.length),f=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"]);f.class=ae(["cms-panel","cms-page",me(e.dense,"dense"),me(e.flat,"cms-page-flat"),me(e.centered,"cms-page-centered"),me(e.narrow,"cms-page-narrow"),me(ue,"cms-page-has-hero"),me(F,"cms-page-has-header"),i.class]),f.style={...i.style||{}},(e.gap!=null||rt(e.gap))&&(f.style["--cms-page-gap"]=Ie(e.gap,$e)),(e.padding!=null||rt(e.padding))&&(f.style["--cms-page-padding"]=Ie(e.padding,$e)),(e.maxWidth!=null||rt(e.maxWidth))&&(f.style["--cms-page-max-width"]=Ie(e.maxWidth,$e)),(e.minHeight!=null||rt(e.minHeight))&&(f.style["--cms-page-min-height"]=Ie(e.minHeight,$e)),(e.headerGap!=null||rt(e.headerGap))&&(f.style["--cms-page-header-gap"]=Ie(e.headerGap,$e)),(e.heroPadding!=null||rt(e.heroPadding))&&(f.style["--cms-page-hero-padding"]=Ie(e.heroPadding,$e));const m=_.div(f,ce,...C.hero,oe,...C.header,J,...C.body,X,...C.footer);return Ke(m,e),m},(Ai=JSswift.isDev)!=null&&Ai.call(JSswift)&&(v.meta=v.meta||{},v.meta.Page={signature:"UI.Page(...children) | UI.Page(props, ...children)",props:{hero:"Node|Function|Array",icon:"String|Node|Function|Array",eyebrow:"String|Node|Function|Array",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",header:"String|Node|Function|Array",aside:"Node|Function|Array",body:"Node|Function|Array",footer:"Node|Function|Array",actions:"Node|Function|Array",dense:"boolean",flat:"boolean",centered:"boolean",narrow:"boolean",gap:"string|number",padding:"string|number",maxWidth:"string|number",minHeight:"string|number",heroPadding:"string|number",headerGap:"string|number",slots:"{ hero?, icon?, eyebrow?, title?, subtitle?, header?, aside?, body?, footer?, actions?, default? }",class:"string",style:"object"},slots:{hero:"Top hero/banner area",icon:"Page icon/visual",eyebrow:"Eyebrow/kicker content",title:"Page title content",subtitle:"Page subtitle/description content",header:"Header support content under title",aside:"Top-right header content",body:"Structured body content",footer:"Footer meta/content",actions:"Footer actions content",default:"Fallback body content"},returns:"HTMLDivElement",description:"Structured page container with hero, header, body, footer, and configurable layout."}),v.AppShell=(...t)=>{var x,p;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=(P,U)=>!!P&&Object.prototype.hasOwnProperty.call(P,U),c=o(e.noDrawer)===!0||e.drawer===!1,y=o(e.reverse)===!0,a=o(e.stack)===!0,l=(p=(x=e.drawerStateKey)!=null?x:e.stateKey)!=null?p:Xt;l&&(Xt=l,Et=tn(l));const b={props:e,noDrawer:c,stateKey:l,isDrawerOpen:()=>tn(l),openDrawer:()=>Wt(!0,l),closeDrawer:()=>Wt(!1,l),toggleDrawer:()=>Wt(!tn(l),l)},R=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let C=e.header;!i(e,"header")&&(Object.keys(R).length||i(e,"title")||i(e,"subtitle")||i(e,"left")||i(e,"right"))&&(!i(R,"title")&&i(e,"title")&&(R.title=e.title),!i(R,"subtitle")&&i(e,"subtitle")&&(R.subtitle=e.subtitle),!i(R,"left")&&i(e,"left")&&(R.left=e.left),!i(R,"right")&&i(e,"right")&&(R.right=e.right),i(R,"drawerStateKey")||(R.drawerStateKey=l),c&&!i(R,"left")&&(R.left=!1),C=v.Header(R));const w=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},T=i(e,"drawerItems")?e.drawerItems:e.items,ee=i(e,"drawerHeader")?e.drawerHeader:void 0;let K=e.drawer;!i(e,"drawer")&&!c&&(Object.keys(w).length||T!=null||ee!=null)&&(!i(w,"items")&&T!=null&&(w.items=T),!i(w,"header")&&ee!=null&&(w.header=ee),i(w,"stateKey")||(w.stateKey=l),K=v.Drawer(w));const re=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},H=i(e,"content")?e.content:n,j=E(s,"default",b,H);let Y=e.page;!i(e,"page")&&(Object.keys(re).length||j.length)&&(Y=v.Page(re,...j));const W=e.footerProps&&typeof e.footerProps=="object"?{...e.footerProps}:{},ie=i(e,"footerContent")?e.footerContent:void 0;let ge=e.footer;!i(e,"footer")&&(Object.keys(W).length||ie!=null)&&(ge=v.Footer(W,...E(null,"default",b,ie)));const ce=E(s,"header",b,C),le=c?[]:E(s,"drawer",b,K),oe=E(s,"page",b,Y),ne=E(s,"footer",b,ge),J=ae(["cms-app","cms-app-shell",me(c,"no-drawer"),me(y,"is-reverse"),me(a,"is-stack"),me(e.flush,"is-flush"),me(e.divider,"is-divider"),e.class]),Z=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"]);Z.class=J,Z.style={...e.style||{}};const X=Ie(e.drawerWidth,$e);X!=null&&(Z.style["--cms-app-shell-drawer-width"]=X);const ue=Ie(e.gap,$e);ue!=null&&(Z.style["--cms-app-shell-gap"]=ue);const F=Ie(e.padding,$e);F!=null&&(Z.style["--cms-app-shell-padding"]=F);const f=ce.length?_.div({class:"cms-app-shell-header-slot"},...ce):null,m=le.length?_.div({class:"cms-app-shell-drawer-slot"},...le):null,g=oe.length?_.div({class:"cms-app-shell-page-slot"},...oe):null,O=ne.length?_.div({class:"cms-app-shell-footer-slot"},...ne):null,Q=y?[g,m]:[m,g],r=_.div(Z,...f?[f]:[],_.div({class:"cms-app-shell-body"},...Q.filter(Boolean)),...O?[O]:[]);return r.openDrawer=b.openDrawer,r.closeDrawer=b.closeDrawer,r.toggleDrawer=b.toggleDrawer,r.isDrawerOpen=b.isDrawerOpen,r.header=f,r.drawer=m,r.page=g,r.footer=O,Ke(r,e),r},(ki=JSswift.isDev)!=null&&ki.call(JSswift)&&(v.meta=v.meta||{},v.meta.AppShell={signature:"UI.AppShell(...children) | UI.AppShell(props, ...children)",props:{header:"Node|Function|Array|false",drawer:"Node|Function|Array|false",page:"Node|Function|Array|false",footer:"Node|Function|Array|false",title:"string|Node|Function|Array",subtitle:"string|Node|Function|Array",left:"Node|Function|Array|false",right:"Node|Function|Array",items:"Array",drawerItems:"Array",drawerHeader:"Node|Function|Array",content:"Node|Function|Array",headerProps:"object",drawerProps:"object",pageProps:"object",footerProps:"object",footerContent:"Node|Function|Array",noDrawer:"boolean",reverse:"boolean",stack:"boolean",flush:"boolean",divider:"boolean",drawerStateKey:"string",stateKey:"string",drawerWidth:"number|string",gap:"number|string",padding:"number|string",slots:"{ header?, drawer?, page?, footer?, default? }",class:"string",style:"object"},slots:{header:"Header content",drawer:"Drawer content",page:"Page content",footer:"Footer content",default:"Fallback page content"},returns:"HTMLDivElement con methods openDrawer/closeDrawer/toggleDrawer/isDrawerOpen",description:"Shell applicazione composabile con shortcut per Header/Drawer/Page/Footer e gestione drawer."}),v.Parallax=function(...e){var P,U;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,Yt(c);const y=Ye(n.state,()=>{const G=mt(o(n.state));return G?`cms-state-${G}`:""}),a=G=>{if(G==null||G===!1||G==="")return"";const de=String(G);return Zt(de)?`var(--cms-${de})`:de},l=()=>{const G=o(n.background);if(G)return String(G);const de=o(n.image)||o(n.src)||"";if(!de)return"linear-gradient(120deg, #1b2c5a, #2f6d8f, #2a8f5c)";const A=String(de);return/^url\(/i.test(A)||/gradient\(/i.test(A)||/^var\(/i.test(A)?A:`url(${A})`},b=(G,de)=>{const A=Number(o(G));return Number.isFinite(A)?A:de},R={speed:()=>{var G;return(G=o(n.speed))!=null?G:.18},state:()=>o(n.state)||"",disabled:()=>!!o(n.disabled)},C=E(i,"badge",R,n.badge),w=E(i,"background",R,n.backgroundContent),T=E(i,"eyebrow",R,(P=n.eyebrow)!=null?P:n.kicker),ee=E(i,"title",R,n.title),K=E(i,"subtitle",R,n.subtitle),re=E(i,"header",R,n.header),H=E(i,"aside",R,n.aside),j=E(i,"media",R,n.media),Y=E(i,"content",R,(U=n.content)!=null?U:n.body),W=E(i,"default",R,s!=null&&s.length?s:[]),ie=E(i,"footer",R,n.footer),ge=E(i,"actions",R,n.actions),ce=[...Y,...W],le=C.length?_.div({class:ae(["cms-parallax-badge",n.badgeClass])},...C):null,oe=T.length||ee.length||K.length||re.length||H.length,ne=oe?_.div({class:ae(["cms-parallax-header",n.headerClass])},_.div({class:"cms-parallax-head"},_.div({class:"cms-parallax-head-main"},T.length?_.div({class:ae(["cms-parallax-eyebrow",n.eyebrowClass])},...T):null,ee.length?_.div({class:ae(["cms-parallax-title",n.titleClass])},...ee):null,K.length?_.div({class:ae(["cms-parallax-subtitle",n.subtitleClass])},...K):null,re.length?_.div({class:ae(["cms-parallax-header-content",n.headerContentClass])},...re):null),H.length?_.div({class:ae(["cms-parallax-aside",n.asideClass])},...H):null)):null,J=j.length?_.div({class:ae(["cms-parallax-media",n.mediaClass])},...j):null,Z=ce.length?_.div({class:ae(["cms-parallax-body",n.bodyClass])},...ce):null,X=ie.length||ge.length?_.div({class:ae(["cms-parallax-footer",n.footerClass])},ie.length?_.div({class:"cms-parallax-footer-content"},...ie):null,ge.length?_.div({class:"cms-parallax-actions"},...ge):null):null,ue=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"]);ue.class=ae(["cms-parallax","cms-singularity",y,me(n.disabled,"cms-parallax-static"),me(le,"cms-parallax-has-badge"),me(oe,"cms-parallax-has-header"),c.class]),ue.style={...c.style||{}},n.height!=null&&(ue.style["--cms-parallax-height"]=Ie(n.height,$e)),n.minHeight!=null&&(ue.style["--cms-parallax-min-height"]=Ie(n.minHeight,$e)),n.padding!=null&&(ue.style["--cms-parallax-padding"]=Ie(n.padding,$e)),n.gap!=null&&(ue.style["--cms-parallax-gap"]=Ie(n.gap,$e)),n.contentMaxWidth!=null&&(ue.style["--cms-parallax-content-max-width"]=Ie(n.contentMaxWidth,$e)),n.justify!=null&&(ue.style["--cms-parallax-justify"]=Ie(n.justify)),n.align!=null&&(ue.style["--cms-parallax-align"]=Ie(n.align)),n.color!=null&&(ue.style["--cms-parallax-color"]=Ie(n.color,a)),n.overlay!=null&&(ue.style["--cms-parallax-overlay"]=Ie(n.overlay)),n.bgPosition!=null&&(ue.style["--cms-parallax-position"]=Ie(n.bgPosition)),n.bgSize!=null&&(ue.style["--cms-parallax-size"]=Ie(n.bgSize)),n.bgRepeat!=null&&(ue.style["--cms-parallax-repeat"]=Ie(n.bgRepeat)),ue.style["--cms-parallax-image"]=rt(n.background)||rt(n.image)||rt(n.src)?()=>l():l();const F=_.div({class:ae(["cms-parallax-bg",n.bgClass])},w.length?_.div({class:ae(["cms-parallax-bg-content",n.backgroundContentClass])},...w):null),f=_.div({class:ae(["cms-parallax-content",n.contentClass,n.innerClass])},le,ne,J,Z,X),m=_.div(ue,F,f);let g=!1,O=!1,Q=null;const r=()=>{var G;g||(g=!0,typeof window!="undefined"&&(window.removeEventListener("scroll",p),window.removeEventListener("resize",p)),(G=Q==null?void 0:Q.disconnect)==null||G.call(Q),Q=null)},x=()=>{if(g)return;if(!m.isConnected){r();return}if(o(n.disabled)){F.style.transform="translate3d(0, 0, 0)",m.style.setProperty("--cms-parallax-offset","0px");return}const G=m.getBoundingClientRect(),de=b(n.speed,.18),A=Math.abs(b(n.maxOffset,96)),u=o(n.startTop),k=u!=null&&u!==""?(G.top-b(n.startTop,0))*de:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(G.top+G.height/2))*de,B=`${(A>0?Math.max(-A,Math.min(A,k)):k).toFixed(2)}px`;F.style.transform=`translate3d(0, ${B}, 0)`,m.style.setProperty("--cms-parallax-offset",B)};function p(){g||O||(O=!0,requestAnimationFrame(()=>{O=!1,x()}))}return typeof window!="undefined"&&(window.addEventListener("scroll",p,{passive:!0}),window.addEventListener("resize",p),typeof ResizeObserver!="undefined"&&(Q=new ResizeObserver(()=>{p()}),Q.observe(m)),requestAnimationFrame(()=>{p()}),setTimeout(()=>{p()},90)),m.refresh=()=>(p(),m),m.update=m.refresh,m.destroy=()=>(r(),m.remove(),null),m._dispose=r,Ke(m,n),m},(Fi=JSswift.isDev)!=null&&Fi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Parallax={signature:"UI.Parallax(...children) | UI.Parallax(props, ...children)",props:{src:"string",image:"string",background:"string",backgroundContent:"Node|Function|Array",height:"string|number",minHeight:"string|number",speed:"number",maxOffset:"number",startTop:"number",state:"success|warning|danger|info|primary|secondary|dark|light|string",overlay:"string",color:"string",bgPosition:"string",bgSize:"string",bgRepeat:"string",padding:"string|number",gap:"string|number",justify:"string",align:"string",contentMaxWidth:"string|number",disabled:"boolean",badge:"Node|Function|Array",eyebrow:"String|Node|Function|Array",title:"String|Node|Function|Array",subtitle:"String|Node|Function|Array",header:"Node|Function|Array",aside:"Node|Function|Array",media:"Node|Function|Array",content:"Node|Function|Array",footer:"Node|Function|Array",actions:"Node|Function|Array",bgClass:"string",badgeClass:"string",headerClass:"string",bodyClass:"string",footerClass:"string",contentClass:"string",slots:"{ background?, badge?, eyebrow?, title?, subtitle?, header?, aside?, media?, content?, footer?, actions?, default? }",class:"string",style:"object"},slots:{background:"Decorative content inside the background layer",badge:"Meta badge/chip above the main content",eyebrow:"Eyebrow/kicker",title:"Main title",subtitle:"Subtitle or supporting text",header:"Additional header content",aside:"Header side area",media:"Media content or foreground card",content:"Main body",footer:"Informational footer",actions:"Actions area",default:"Fallback body content"},returns:"HTMLDivElement with refresh/update/destroy methods",description:"Standardized parallax hero/section with structured header, body, actions, slots, and minimal refresh API."});const[Kn,qn]=je.reactive.signal([]),Yn=new Map;function ws(t){const e=Yn.get(t);e&&(clearTimeout(e),Yn.delete(t))}function vs(t){return t?(ws(t),qn(Kn().filter(e=>e.id!==t)),t):null}function lr(){for(const t of Yn.keys())ws(t);qn([])}function Co(t){t!=null&&t.id&&(ws(t.id),t.timeout>0&&Yn.set(t.id,setTimeout(()=>{vs(t.id)},t.timeout)))}function xo(t,e={}){if(!t)return null;let n=null;return qn(Kn().map(s=>s.id!==t?s:(n=Kt({...s,...e,id:s.id},e.type||e.state||e.color||s.type),n))),n&&Co(n),(n==null?void 0:n.id)||null}function rr(t){const e=()=>vs(t.id),n=(re={})=>xo(t.id,re),s={toast:t,id:t.id,close:e,update:n},i=re=>typeof re=="function"?re(s):re,c=(()=>{if(t.icon===!1||t.icon===null)return null;if(t.icon!=null){const H=i(t.icon);return typeof H=="string"?v.Icon({name:H,size:"sm"}):JSswift.ui.slot(H,{as:"icon"})}const re=sr[t.type];return re?v.Icon({name:re,size:"sm"}):null})(),y=E(t.slots,"icon",s,c),a=E(t.slots,"title",s,i(t.title)),l=E(t.slots,"message",s,i(t.message)),b=E(t.slots,"description",s,i(t.description)),R=E(t.slots,"meta",s,i(t.meta)),C=E(t.slots,"actions",s,i(t.actions)),w=E(t.slots,"default",s,i(t.body)),T=E(t.slots,"dismiss",s,i(t.dismiss)),ee=T.length?T:t.closable?[v.Btn({class:"cms-toast-close",outline:!0,size:"xs","aria-label":t.dismissLabel,onClick:e},v.Icon({name:"close",size:"xs"}))]:[],K=_.div({class:ae(["cms-toast",`cms-toast-${t.type}`,`cms-toast-${t.variant}`,me(t.closable,"is-closable"),t.class]),style:t.style||{},role:t.role},y.length?_.div({class:"cms-toast-icon"},...y):null,_.div({class:"cms-toast-main"},_.div({class:"cms-toast-copy"},a.length?_.div({class:"cms-toast-title"},...a):null,l.length?_.div({class:"cms-toast-message"},...l):null,b.length?_.div({class:"cms-toast-description"},...b):null,w.length?_.div({class:"cms-toast-body"},...w):null,R.length?_.div({class:"cms-toast-meta"},...R):null),C.length?_.div({class:"cms-toast-actions"},...C):null),ee.length?_.div({class:"cms-toast-dismiss"},...ee):null);return Ke(K,t),K}function ar(){let t=document.querySelector(".cms-toast-layer");return t||(t=document.createElement("div"),t.className="cms-toast-layer",document.body.appendChild(t),je.reactive.effect(()=>{const e=Kn();t.innerHTML="";const n=new Map;for(const s of e){const i=vo(s.position);n.has(i)||n.set(i,[]),n.get(i).push(s)}for(const s of wo){const i=n.get(s);if(!(i!=null&&i.length))continue;const c=_.div({class:ae(["cms-toast-wrap",`is-${s}`])},...i.map(y=>rr(y)));t.appendChild(c)}},"JSswiftUI:toasts"),t)}function cr(t={}){ar();const e=Kt(t);return e.id=e.id||Math.random().toString(36).slice(2),qn([...Kn().filter(n=>n.id!==e.id),e]),Co(e),e.id}je.services.notify.show=cr,je.services.notify.success=Rt("success","Success"),je.services.notify.error=Rt("danger","Error"),je.services.notify.warning=Rt("warning","Warning"),je.services.notify.info=Rt("info","Info"),je.services.notify.primary=Rt("primary","Notice"),je.services.notify.secondary=Rt("secondary","Notice"),je.services.notify.update=xo,je.services.notify.remove=vs,je.services.notify.clear=lr,je.services.notify.promise=v.Notify.promise,je.notify=je.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,y=JSswift.form._isPromise(c)?await c:c;return y===!0?null:typeof y=="string"?y:y===!1?i||"Valore non valido":y?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({}),y=_.rod({}),a=_.rod(!1),l=_.rod(null),b=()=>e&&typeof e=="object"&&"value"in e?e.value||{}:e,R=ce=>{if(e&&typeof e=="object"&&"value"in e)e.value=ce;else{const le=e||{};for(const oe in le)delete le[oe];Object.assign(le,ce)}},C=ce=>{const le=b();return le?le[ce]:void 0},w=(ce,le)=>{const oe={...b()||{}};oe[ce]=le,R(oe)},T=(ce,le)=>{const oe={...c.value||{}};le?oe[ce]=le:delete oe[ce],c.value=oe},ee=ce=>(c.value||{})[ce]||null,K=ce=>{y.value={...y.value||{},[ce]:!0}},re=ce=>!!(y.value||{})[ce],H=async ce=>{const le=n[ce]||[];if(!le.length)return T(ce,null),!0;const oe=C(ce),ne={name:ce,value:oe,model:b(),form:ge};for(const J of le){if(!J)continue;const Z=await JSswift.form._runRule(J,oe,ne);if(Z)return T(ce,Z),!1}return T(ce,null),!0},j=async()=>{l.value=null;const ce=Object.keys(n);let le=!0;for(const oe of ce)await H(oe)||(le=!1);return le},ge={model:e,errors:c,touched:y,submitting:a,submitError:l,getValue:C,setValue:w,getError:ee,setError:T,touch:K,isTouched:re,field:(ce,le={})=>{var O;const oe=_.rod("");(O=oe.action)==null||O.call(oe,Q=>{w(ce,Q)});const ne=()=>s==="submit"||s==="input"||s==="blur"?!0:re(ce);let J=null,Z=!1,X=!1;const ue=async()=>{Z||(Z=!0,K(ce),(s==="blur"||s==="input")&&await H(ce),setTimeout(()=>{Z=!1},0))},F=Q=>{J&&(J===Q.target||J.contains&&J.contains(Q.target)||(ue(),J=null,X&&(X=!1,document.removeEventListener("pointerdown",F,!0))))},f=()=>{X||(X=!0,document.addEventListener("pointerdown",F,!0))},m=async()=>{J=document.activeElement,Z=!1,f(),s==="input"&&await H(ce)},g=async()=>{await ue(),J=null,X&&(X=!1,document.removeEventListener("pointerdown",F,!0))};return{name:ce,model:oe,get value(){return oe.value},set value(Q){oe.value=Q},error:()=>ne()?ee(ce):null,success:le.success||null,warning:le.warning||null,note:le.note||null,touch:()=>K(ce),validate:()=>H(ce),onInput:m,onBlur:g,hint:le.hint||null}},validateField:H,validate:j,reset:()=>{l.value=null,c.value={},y.value={},i&&R({...i||{}})},submit:async ce=>{a.value=!0,l.value=null;try{return await j()?{ok:!0,result:await(ce==null?void 0:ce(b(),ge))}:{ok:!1,reason:"validation"}}catch(le){return console.error("[useForm] submit error:",le),l.value=le&&le.message?le.message:String(le),{ok:!1,reason:"exception",error:le}}finally{a.value=!1}}};return ge},v.Form=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.form,i=e.onSubmit,c=ae(["cms-form",e.class]),y=JSswift.omit(e,["form","onSubmit"]);y.class=c;const a=_.form({...y,onSubmit:async b=>{b.preventDefault(),s&&await s.submit(i||(async()=>{}))}}),l=[];for(const b of n||[]){const R=typeof b=="function"?b(s):b,C=JSswift.ui.slot(R);C&&(Array.isArray(C)?l.push(...C):l.push(C))}return l.forEach(b=>a.appendChild(b)),s&&s.submitting&&JSswift.reactive.effect(()=>{a.classList.toggle("is-submitting",!!s.submitting.value)},"UI.Form:submitting"),a},(_i=JSswift.isDev)!=null&&_i.call(JSswift)&&(v.meta=v.meta||{},v.meta.Form={signature:"UI.Form({ form, onSubmit, ...props }, ...children)",props:{form:"useForm() instance",onSubmit:"async (model, form) => any",class:"string",style:"object"},slots:{default:"(form) => Node|Array|Node"},returns:"HTMLFormElement"}),je.services=je.services||{},je.services.dialog=je.services.dialog||{},je.dialog=je.services.dialog;let vn=null;function No(){return vn||(vn=document.createElement("div"),vn.setAttribute("data-cms-modal-root","true"),document.body.appendChild(vn),vn)}v.cardHeader=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=ae(["cms-card-header",me(e.divider,"divider"),e.class]),c=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);c.class=i;const y={...e.style||{}},a=Ie(e.align);a!=null&&!Ue(e,"align")&&(y.alignItems=a);const l=Ie(e.justify);l!=null&&!Ue(e,"justify")&&(y.justifyContent=l);const b=Ie(e.wrap,T=>T?"wrap":"nowrap");b!=null&&!Ue(e,"wrap")&&(y.flexWrap=b);const R=Ie(e.direction);R!=null&&!Ue(e,"direction")&&(y.flexDirection=R);const C=Ie(e.gap,$e);C!=null&&!Ue(e,"gap")&&(y.gap=C),Object.keys(y).length&&(c.style=y),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const w=_.div(c,...E(s,"default",{},n));return Ke(w,e),w},v.cardBody=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=ae(["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 y=_.div(c,...E(s,"default",{},n));return Ke(y,e),y},v.cardFooter=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=ae(["cms-card-footer",me(e.divider,"divider"),e.class]),c=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);c.class=i;const y={...e.style||{}},a=Ie(e.align);a!=null&&!Ue(e,"align")&&(y.alignItems=a);const l=Ie(e.justify);l!=null&&!Ue(e,"justify")&&(y.justifyContent=l);const b=Ie(e.wrap,T=>T?"wrap":"nowrap");b!=null&&!Ue(e,"wrap")&&(y.flexWrap=b);const R=Ie(e.direction);R!=null&&!Ue(e,"direction")&&(y.flexDirection=R);const C=Ie(e.gap,$e);C!=null&&!Ue(e,"gap")&&(y.gap=C),Object.keys(y).length&&(c.style=y),JSswift.uiApplyResponsiveProps(c,e,JSswift.uiResponsiveStyleRules);const w=_.div(c,...E(s,"default",{},n));return Ke(w,e),w},(Li=JSswift.isDev)!=null&&Li.call(JSswift)&&(v.meta=v.meta||{},v.meta.cardHeader={signature:"UI.cardHeader(...children) | UI.cardHeader(props, ...children)",props:{divider:"boolean",align:"stretch|flex-start|center|flex-end|baseline",justify:"flex-start|center|flex-end|space-between|space-around|space-evenly",wrap:"boolean",direction:"row|column|string",gap:"string|number",mobile:"{ gap?, align?, justify?, wrap?, direction? }",tablet:"{ gap?, align?, justify?, wrap?, direction? }",pc:"{ gap?, align?, justify?, wrap?, direction? }",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Card header content"},returns:"HTMLDivElement",description:"Header della card con supporto layout flex."},v.meta.cardBody={signature:"UI.cardBody(...children) | UI.cardBody(props, ...children)",props:{padding:"string|number",gap:"string|number",direction:"row|column|string",mobile:"{ padding?, gap?, direction?, width? }",tablet:"{ padding?, gap?, direction?, width? }",pc:"{ padding?, gap?, direction?, width? }",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Card body content"},returns:"HTMLDivElement",description:"Body della card."},v.meta.cardFooter={signature:"UI.cardFooter(...children) | UI.cardFooter(props, ...children)",props:{divider:"boolean",align:"stretch|flex-start|center|flex-end|baseline",justify:"flex-start|center|flex-end|space-between|space-around|space-evenly",wrap:"boolean",direction:"row|column|string",gap:"string|number",mobile:"{ gap?, align?, justify?, wrap?, direction? }",tablet:"{ gap?, align?, justify?, wrap?, direction? }",pc:"{ gap?, align?, justify?, wrap?, direction? }",slots:"{ default? }",class:"string",style:"object"},slots:{default:"Card footer content"},returns:"HTMLDivElement",description:"Footer della card con supporto layout flex."}),v.Dialog=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],c=["xs","sm","md","lg","xl","full"];let y={...e},a=null,l=null;const b=(f,m)=>typeof f=="function"?f(m):f,R=f=>String(f||"").split(/\s+/).filter(Boolean),C=(f,m,g)=>{if(!f)return;const O=f[m]||[];O.length&&f.classList.remove(...O);const Q=(g||[]).filter(Boolean);Q.length&&f.classList.add(...Q),f[m]=Q},w=(f,m,g,O=Q=>Q)=>{if(f){if(g==null||g===""){f.style.removeProperty(m);return}f.style.setProperty(m,O(g))}},T=()=>{var r,x,p,P,U,G;const f=window.visualViewport,m=Math.max(0,Math.round((r=f==null?void 0:f.offsetLeft)!=null?r:0)),g=Math.max(0,Math.round((x=f==null?void 0:f.offsetTop)!=null?x:0)),O=Math.max(0,Math.round((P=(p=f==null?void 0:f.width)!=null?p:window.innerWidth)!=null?P:0)),Q=Math.max(0,Math.round((G=(U=f==null?void 0:f.height)!=null?U:window.innerHeight)!=null?G:0));return{left:m,top:g,width:O,height:Q}},ee=f=>{if(!(f!=null&&f.panel))return;const{left:m,top:g,width:O,height:Q}=T();w(f.panel,"position","fixed"),w(f.panel,"inset",0,r=>`${r}px`),w(f.panel,"top",g,r=>`${r}px`),w(f.panel,"left",m,r=>`${r}px`),w(f.panel,"right","auto"),w(f.panel,"bottom","auto"),w(f.panel,"width",O,r=>`${r}px`),w(f.panel,"height",Q,r=>`${r}px`),w(f.panel,"min-height",Q,r=>`${r}px`),w(f.panel,"max-width",O,r=>`${r}px`),w(f.panel,"max-height",Q,r=>`${r}px`),w(f.panel,"min-width",0,r=>`${r}px`),w(f.panel,"margin",0,r=>`${r}px`),w(f.panel,"box-sizing","border-box"),w(f.panel,"border-width",0,r=>`${r}px`),w(f.panel,"border-radius",0,r=>`${r}px`),w(f.panel,"transform","none"),w(f.panel,"overflow","hidden"),w(f.panel,"--cms-dialog-fullscreen-left",m,r=>`${r}px`),w(f.panel,"--cms-dialog-fullscreen-top",g,r=>`${r}px`),w(f.panel,"--cms-dialog-fullscreen-width",O,r=>`${r}px`),w(f.panel,"--cms-dialog-fullscreen-height",Q,r=>`${r}px`)},K=f=>{f!=null&&f.panel&&(w(f.panel,"position",null),w(f.panel,"inset",null),w(f.panel,"top",null),w(f.panel,"left",null),w(f.panel,"right",null),w(f.panel,"bottom",null),w(f.panel,"width",null),w(f.panel,"height",null),w(f.panel,"min-height",null),w(f.panel,"max-width",null),w(f.panel,"max-height",null),w(f.panel,"min-width",null),w(f.panel,"margin",null),w(f.panel,"box-sizing",null),w(f.panel,"border-width",null),w(f.panel,"border-radius",null),w(f.panel,"transform",null),w(f.panel,"overflow",null),w(f.panel,"--cms-dialog-fullscreen-left",null),w(f.panel,"--cms-dialog-fullscreen-top",null),w(f.panel,"--cms-dialog-fullscreen-width",null),w(f.panel,"--cms-dialog-fullscreen-height",null))},re=(f,m)=>{var p,P,U,G,de;if(!f)return;if((p=f._dialogViewportCleanup)==null||p.call(f),f._dialogViewportCleanup=null,!m){K(f);return}let g=null;const O=globalThis.requestAnimationFrame||(A=>setTimeout(()=>A(Date.now()),0)),Q=globalThis.cancelAnimationFrame||clearTimeout,r=()=>ee(f),x=()=>{g!=null&&Q(g),g=O(()=>{g=null,r()})};r(),x(),window.addEventListener("resize",r),window.addEventListener("orientationchange",x),(U=(P=window.visualViewport)==null?void 0:P.addEventListener)==null||U.call(P,"resize",r),(de=(G=window.visualViewport)==null?void 0:G.addEventListener)==null||de.call(G,"scroll",x),f._dialogViewportCleanup=()=>{var A,u,k,I;g!=null&&(Q(g),g=null),window.removeEventListener("resize",r),window.removeEventListener("orientationchange",x),(u=(A=window.visualViewport)==null?void 0:A.removeEventListener)==null||u.call(A,"resize",r),(I=(k=window.visualViewport)==null?void 0:k.removeEventListener)==null||I.call(k,"scroll",x)}},H=()=>y,j=f=>{var g;const m=o((g=f.state)!=null?g:f.color);return m?i.includes(m)?m:String(m):""},Y=f=>{const m=o(f.size);return typeof m=="string"&&c.includes(m)?m:""},W=f=>{var g,O,Q;const m=String(o((Q=(O=(g=f.actionsAlign)!=null?g:f.footerAlign)!=null?O:f.alignActions)!=null?Q:"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"},ie=f=>{var g,O,Q;const m=String(o((Q=(O=(g=f.align)!=null?g:f.verticalAlign)!=null?O:f.position)!=null?Q:"center")).toLowerCase();return["top","start","flex-start"].includes(m)?"cms-dialog-align-top":["bottom","end","flex-end"].includes(m)?"cms-dialog-align-bottom":""},ge=f=>{var g,O;return((O=(g=f.closable)!=null?g:f.dismissible)!=null?O:f.closeButton)!==!1},ce=()=>{var B,pe,Se,ye,V,D,q,Ne;const f=H(),m={close:Z,dismiss:Z,open:J,toggle:ue,update:ne,isOpen:X,entry:()=>a,props:f},g=f.icon!=null?typeof f.icon=="string"?v.Icon({name:f.icon,size:f.iconSize||"md"}):JSswift.ui.slot(f.icon,{as:"icon"}):null,O=E(s,"eyebrow",m,b(f.eyebrow,m)),Q=E(s,"title",m,b((pe=(B=f.title)!=null?B:f.heading)!=null?pe:f.header,m)),r=E(s,"subtitle",m,b((Se=f.subtitle)!=null?Se:f.description,m)),x=E(s,"icon",m,g),p=E(s,"header",m,b((ye=f.headerContent)!=null?ye:f.head,m)),P=ge(f)?E(s,"close",m,v.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":f.closeLabel||"Chiudi dialog","data-dialog-close":!0},v.Icon({name:f.closeIcon||"close",size:"sm"}))):[],U=(q=(D=(V=f.content)!=null?V:f.body)!=null?D:f.message)!=null?q:n&&n.length?n:null;let G=E(s,"content",m,b(U,m));G.length||(G=E(s,"body",m,b(U,m))),G.length||(G=E(s,"default",m,b(U,m)));const de=b((Ne=f.footer)!=null?Ne:f.actions,m);let A=E(s,"footer",m,de);A.length||(A=E(s,"actions",m,de));let u=null;p.length?u=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...p):(O.length||Q.length||r.length||x.length||P.length)&&(u=_.div({class:"cms-dialog-head"},x.length?_.div({class:"cms-dialog-icon"},...x):null,_.div({class:"cms-dialog-head-main"},O.length?_.div({class:"cms-dialog-eyebrow"},...O):null,Q.length?_.div({class:"cms-dialog-title"},...Q):null,r.length?_.div({class:"cms-dialog-subtitle"},...r):null),P.length?_.div({class:"cms-dialog-close-wrap"},...P):null));const k=_.div({class:ae(["cms-dialog-body",f.bodyClass])},...G),I=A.length?_.div({class:ae(["cms-dialog-actions",`is-${W(f)}`,me(f.stackActions,"is-stacked"),f.actionsClass,f.footerClass])},...A):null;return _.div({class:ae(["cms-dialog-shell",me(!!u,"has-head"),me(!!I,"has-footer"),me(f.divider!==!1,"with-divider")])},...[u,k,I].filter(Boolean))},le=f=>{var Q;if(!(f!=null&&f.panel))return;const m=H(),g=j(m),O=Y(m);C(f.panel,"_dialogClassTokens",["cms-dialog","cms-singularity","cms-clear-set",O?`cms-dialog-${O}`:"",g,g?`cms-state-${g}`:"",o(m.fullscreen)?"fullscreen":"",o(m.scrollable)?"scrollable":"",o(m.stickyHeader)?"sticky-head":"",o(m.stickyActions)?"sticky-actions":"",o(m.borderless)?"borderless":"",...R(m.class),...R(m.panelClass)]),C(f.overlay,"_dialogOverlayClassTokens",[ie(m),o(m.backdropBlur)?"cms-dialog-overlay-blur":"",...R(m.overlayClass)]),w(f.panel,"--cms-dialog-width",o(m.width),$e),w(f.panel,"--cms-dialog-min-width",o(m.minWidth),$e),w(f.panel,"--cms-dialog-max-width",o(m.maxWidth),$e),w(f.panel,"--cms-dialog-max-height",o(m.maxHeight),$e),w(f.panel,"--cms-dialog-body-max-height",o((Q=m.bodyMaxHeight)!=null?Q:m.contentMaxHeight),$e),m.style&&Object.assign(f.panel.style,m.style),Ke(f.panel,m),re(f,o(m.fullscreen)),f.panel.setAttribute("role",m.role||"dialog"),f.panel.setAttribute("aria-modal",m.modal===!1?"false":"true"),m.ariaLabel?f.panel.setAttribute("aria-label",m.ariaLabel):f.panel.removeAttribute("aria-label")},oe=()=>{a!=null&&a.panel&&a.panel.replaceChildren(ce())},ne=(f={})=>(f&&typeof f=="object"&&(y={...y,...f}),a&&(le(a),oe()),F),J=(f=null)=>{var Q,r,x,p,P;if(f&&typeof f=="object"&&(y={...y,...f}),a)return le(a),oe(),a;l=document.activeElement;const m=H(),g=m.persistent===!0;a=JSswift.overlay.open(()=>ce(),{type:"dialog",backdrop:m.backdrop!==!1,lockScroll:m.lockScroll!==!1,trapFocus:m.trapFocus!==!1,autoFocus:m.autoFocus!==!1,closeOnOutside:(Q=m.closeOnOutside)!=null?Q:!g,closeOnBackdrop:(r=m.closeOnBackdrop)!=null?r:!g,closeOnEsc:(x=m.closeOnEsc)!=null?x:!g,className:Ht(["cms-dialog"]),onClose:()=>{var U,G,de,A;(U=a==null?void 0:a._dialogViewportCleanup)==null||U.call(a),(G=a==null?void 0:a.panel)==null||G.removeEventListener("click",O),a=null,(A=(de=H()).onClose)==null||A.call(de),l&&typeof l.focus=="function"&&setTimeout(()=>l.focus(),0)}});const O=U=>{const G=U.target;G&&G.closest&&G.closest("[data-dialog-close]")&&Z()};return a.panel.addEventListener("click",O),le(a),yn(a),(P=(p=H()).onOpen)==null||P.call(p,a),a},Z=()=>{if(!a)return;const f=a;wn(f,()=>JSswift.overlay.close(f.id))},X=()=>!!a,ue=(f=null)=>X()?(Z(),null):J(f),F={open:J,close:Z,toggle:ue,update:ne,isOpen:X,entry:()=>a,props:()=>({...y})};return F},(Ii=JSswift.isDev)!=null&&Ii.call(JSswift)&&(v.meta=v.meta||{},v.meta.Dialog={signature:"UI.Dialog(props) | UI.Dialog(props, ...children) -> { open, close, toggle, update, isOpen }",props:{title:"String|Node|Function|Array|({ close })=>Node",subtitle:"String|Node|Function|Array|({ close })=>Node",eyebrow:"String|Node|Function|Array|({ close })=>Node",icon:"String|Node|Function|Array",content:"Node|Function|Array|({ close })=>Node",body:"Alias of content",actions:"Node|Function|Array|({ close })=>Node",footer:"Alias of actions",size:"xs|sm|md|lg|xl|full",state:"primary|secondary|warning|danger|success|info|light|dark",color:"Alias of state",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",persistent:"boolean",closable:"boolean",closeButton:"boolean",closeIcon:"string",align:"top|center|bottom",actionsAlign:"start|center|end|between|stretch",stickyHeader:"boolean",stickyActions:"boolean",scrollable:"boolean",stackActions:"boolean",fullscreen:"boolean",backdrop:"boolean",backdropBlur:"boolean",lockScroll:"boolean",trapFocus:"boolean",autoFocus:"boolean",closeOnOutside:"boolean",closeOnBackdrop:"boolean",closeOnEsc:"boolean",slots:"{ icon?, eyebrow?, title?, subtitle?, header?, content?, body?, footer?, actions?, close?, default? }",class:"string",panelClass:"string",overlayClass:"string",style:"object"},events:{onOpen:"(entry)",onClose:"void"},slots:{icon:"Dialog icon ({ close })",eyebrow:"Eyebrow above the title ({ close })",title:"Dialog title ({ close })",subtitle:"Dialog subtitle ({ close })",header:"Custom header ({ close })",content:"Dialog body ({ close })",body:"Alias of content ({ close })",footer:"Custom footer ({ close })",actions:"Dialog actions ({ close })",close:"Close action ({ close })",default:"Fallback body content ({ close })"},description:"Standardized dialog overlay with variants, animations, structured slots, and imperative API.",returns:"Object { open(overrides?), close(), toggle(overrides?), update(props), isOpen(), entry(), props() }"}),v.TabPanel=(...t)=>{var ke,te,xe,be,Ce,he,Le,Ae,z,we,M,N,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=kt(e.model,"UI.TabPanel:model"),y=e.id||"cms-tabpanel-"+Math.random().toString(36).slice(2,9),a=d=>String(o(d)||"vertical").toLowerCase()==="horizontal"?"horizontal":"vertical",l=d=>String(o(d)||"before").toLowerCase()==="after"?"after":"before",b=d=>{const L=String(o(d)||"").toLowerCase();return L==="pills"||L==="pill"?"pills":L==="soft"||L==="card"?"soft":"line"},R=d=>{const L=o(d);return L==null||L===""?null:JSswift.uiColors.includes(L)?`var(--cms-${L})`:String(L)},C=a(e.orientation||e.orient||e.direction),w=l(e.navPosition||e.barPosition||e.position),T=b(e.variant||(e.pills?"pills":e.soft?"soft":"line")),ee=!!e.wrap,K=!!e.swipeable,re=!!e.infinite,H=!!e.animated,j=!!((te=(ke=e.navFill)!=null?ke:e.fill)!=null?te:e.stretch),Y=!!e.disabled,W=o((xe=e.transitionDuration)!=null?xe:e["transition-duration"]),ie=(()=>{if(W==null)return 220;if(typeof W=="number")return W;const d=parseFloat(W);return Number.isFinite(d)?d:220})(),ge=o((be=e.transitionEasing)!=null?be:e["transition-easing"])||"ease",ce=(he=(Ce=e.transitionPrev)!=null?Ce:e["transition-prev"])!=null?he:null,le=(Ae=(Le=e.transitionNext)!=null?Le:e["transition-next"])!=null?Ae:null,oe=R((z=e.color)!=null?z:e.state),ne=i.map((d,L)=>{var De,We,qe,Ze,Qe,Ee,Be,tt,nt,dt,ut,bt,ot,ft,vt,At;if(d==null)return null;if(typeof d!="object")return{name:d,labelFallback:d,panelFallback:null,noteFallback:null,iconFallback:null,badgeFallback:null,hidden:!1,raw:d,index:L};const fe=(Ee=(Qe=(Ze=(qe=(We=(De=d.name)!=null?De:d.value)!=null?We:d.id)!=null?qe:d.key)!=null?Ze:d.label)!=null?Qe:d.title)!=null?Ee:`tab-${L}`,Fe=d.label!=null||d.title!=null,Te=Fe?(Be=d.label)!=null?Be:d.title:d.children!=null&&d.content==null&&d.panel==null?d.children:(nt=(tt=d.name)!=null?tt:d.value)!=null?nt:`Tab ${L+1}`,$=(bt=(ut=(dt=d.content)!=null?dt:d.panel)!=null?ut:d.body)!=null?bt:Fe?d.children:null,_e=(vt=(ft=(ot=d.note)!=null?ot:d.subtitle)!=null?ft:d.description)!=null?vt:null,Re=(At=d.icon)!=null?At:null,Pe=Object.prototype.hasOwnProperty.call(d,"badge")?d.badge:Object.prototype.hasOwnProperty.call(d,"counter")?d.counter:null;return{...d,name:fe,labelFallback:Te,panelFallback:$,noteFallback:_e,iconFallback:Re,badgeFallback:Pe,index:L}}).filter(Boolean).filter(d=>d.hidden!==!0&&d.visible!==!1),J=ae(["cms-clear-set","cms-tabpanel","cms-singularity",C,`variant-${T}`,me(ee,"wrap"),me(H,"animated"),me(j,"nav-fill"),me(Y,"disabled"),me(w==="after","nav-after"),e.class]),Z=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"]);Z.class=J,Z.style=e.style;const X=_.div(Z);H&&(X.style.setProperty("--cms-tabpanel-duration",`${ie}ms`),X.style.setProperty("--cms-tabpanel-easing",ge)),oe&&X.style.setProperty("--cms-tabpanel-accent",oe);const ue=_.div({class:ae(["cms-tabpanel-nav",e.navClass]),role:"tablist","aria-orientation":C}),F=_.div({class:ae(["cms-tabpanel-panels",e.panelsClass])}),f=[],m=[];let g=-1;const O=()=>C==="horizontal",Q=(d,L,fe)=>({tab:d,name:d.name,index:L,active:fe,value:d.name,select:()=>Se(L),next:()=>V(),prev:()=>D()}),r=(d,L,fe=!1)=>{var Te;if(!ne.length)return-1;let Fe=d;for(let $=0;$<ne.length;$+=1){if(Fe+=L,Fe>=ne.length){if(!fe)return-1;Fe=0}else if(Fe<0){if(!fe)return-1;Fe=ne.length-1}if(!((Te=ne[Fe])!=null&&Te.disabled))return Fe}return-1},x=d=>{var fe;const L=(fe=f[d])==null?void 0:fe.btn;!L||typeof L.focus!="function"||requestAnimationFrame(()=>L.focus())},p=(d,L,fe)=>{const Fe=Q(d,L,fe),Te=JSswift.ui.renderSlot(s,"label",Fe,d.labelFallback);return E(null,"default",{},Te)},P=(d,L)=>{var tt,nt,dt,ut,bt;const fe=L===g,Fe=`${y}-tab-${L}`,Te=`${y}-panel-${L}`,$=Q(d,L,fe),_e=p(d,L,fe),Re=d.iconFallback!=null?typeof d.iconFallback=="string"?v.Icon({name:d.iconFallback,size:(dt=(nt=(tt=d.iconSize)!=null?tt:d.size)!=null?nt:e.size)!=null?dt:null}):d.iconFallback:null,Pe=E(s,"icon",$,Re),De=E(s,"note",$,d.noteFallback),We=E(s,"badge",$,d.badgeFallback),qe=_.span({class:"cms-tabpanel-tab-inner"},Pe.length?_.span({class:"cms-tabpanel-tab-icon"},...Pe):null,_.span({class:"cms-tabpanel-tab-copy"},_.span({class:"cms-tabpanel-tab-label"},..._e.length?_e:[""]),De.length?_.span({class:"cms-tabpanel-tab-note"},...De):null),We.length?_.span({class:"cms-tabpanel-tab-badge"},...We):null),Ze=E(s,"tab",{...$,label:_e,icon:Pe,note:De,badge:We,tabId:Fe,panelId:Te},qe),Qe=ot=>{if(Y||d.disabled)return;const ft=ot.key;if(ft==="Enter"||ft===" "){ot.preventDefault(),Se(L);return}if(ft==="Home"){ot.preventDefault();const at=ne.findIndex(Vt=>!Vt.disabled);at>=0&&(Se(at),x(at));return}if(ft==="End"){ot.preventDefault();const at=(()=>{var Vt;for(let Jt=ne.length-1;Jt>=0;Jt-=1)if(!((Vt=ne[Jt])!=null&&Vt.disabled))return Jt;return-1})();at>=0&&(Se(at),x(at));return}const vt=O()?["ArrowLeft"]:["ArrowUp"],At=O()?["ArrowRight"]:["ArrowDown"];if(vt.includes(ft)){ot.preventDefault();const at=r(L,-1,re);at>=0&&(Se(at,{dir:"prev"}),x(at));return}if(At.includes(ft)){ot.preventDefault();const at=r(L,1,re);at>=0&&(Se(at,{dir:"next"}),x(at))}},Ee=v.Btn({class:ae(["cms-tabpanel-tab",me(fe,"active"),me(d.disabled||Y,"disabled"),e.tabClass,d.tabClass||d.class]),type:"button",id:Fe,role:"tab",disabled:!!(d.disabled||Y),"aria-selected":fe?"true":"false","aria-controls":Te,tabindex:fe?"0":"-1",outline:T==="pills"&&!fe,color:T==="pills"&&fe?d.color||e.color||e.state||"primary":null,size:(bt=(ut=d.size)!=null?ut:e.size)!=null?bt:null,style:{...e.tabStyle||{},...d.tabStyle||{}},onClick:()=>{d.disabled||Y||Se(L)},onKeydown:Qe},...Ze),Be=_.div({class:ae(["cms-tabpanel-nav-btn",me(fe,"active"),d.navClass]),"data-name":d.name},Ee,_.span({class:"tab-indicator"}));return f[L]={btn:Ee,wrap:Be,index:L},Be},U=(d,L)=>{const fe=L===g,Fe=`${y}-tab-${L}`,Te=`${y}-panel-${L}`,$=Q(d,L,fe),_e=JSswift.ui.renderSlot(s,"panel",$,d.panelFallback),Re=_.div({class:ae(["cms-tabpanel-panel",me(fe,"active"),e.panelClass,d.panelClass]),style:{...e.panelStyle||{},...d.panelStyle||{}},"data-name":d.name,role:"tabpanel",id:Te,tabindex:0,"aria-labelledby":Fe,"aria-hidden":fe?"false":"true"},...E(null,"default",{},_e));return m[L]=Re,Re},G=ne.map((d,L)=>P(d,L)),de=JSswift.ui.renderSlot(s,"nav",{tabs:ne,active:()=>{var d;return g>=0?(d=ne[g])==null?void 0:d.name:null},activeIndex:()=>g,activeTab:()=>g>=0?ne[g]:null,select:d=>{typeof d=="number"?Se(d):ye(d)},next:()=>V(),prev:()=>D(),nodes:G,orientation:C,position:w,variant:T},G);E(null,"default",{},de).forEach(d=>ue.appendChild(d)),ne.length?ne.forEach((d,L)=>F.appendChild(U(d,L))):E(s,"empty",{tabs:ne},(we=e.empty)!=null?we:_.div({class:"cms-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(L=>F.appendChild(L));const A=d=>{if(!H)return;const L=d==="next"?"18px":"-18px",fe=d==="next"?"-18px":"18px";X.style.setProperty("--cms-tabpanel-enter",L),X.style.setProperty("--cms-tabpanel-leave",fe)},u=()=>{const d=[];ce&&d.push(...String(ce).split(/\s+/)),le&&d.push(...String(le).split(/\s+/)),d.length&&F.classList.remove(...d.filter(Boolean))},k=d=>{u();const L=d==="prev"?ce:le;if(!L)return;const fe=String(L).split(/\s+/).filter(Boolean);fe.length&&(F.classList.add(...fe),setTimeout(()=>F.classList.remove(...fe),ie+40))},I=d=>{var Fe;const L=f.find(({btn:Te})=>Te.classList.contains("active")),fe=(Fe=L==null?void 0:L.btn.parentNode)==null?void 0:Fe.getBoundingClientRect();f.forEach(({btn:Te,index:$})=>{const _e=$===d,Re=Te.parentNode;if(!Re)return;const Pe=Re.getBoundingClientRect();Re.isConnected&&fe&&(Re.style.setProperty("--nav-pos-x",fe.left-Pe.left+"px"),Re.style.setProperty("--nav-pos-y",fe.top-Pe.top+"px")),Re.classList.toggle("active",_e),Te.classList.toggle("active",_e),Te.setAttribute("aria-selected",_e?"true":"false"),Te.setAttribute("tabindex",_e?"0":"-1")})},B=(d,L,fe)=>{A(fe),m.forEach((Fe,Te)=>{if(!Fe)return;const $=Te===L,_e=Te===d;$?(Fe.classList.add("active"),Fe.classList.remove("leaving"),Fe.setAttribute("aria-hidden","false")):(Fe.classList.remove("active"),Fe.setAttribute("aria-hidden","true"),H&&_e?(Fe.classList.add("leaving"),setTimeout(()=>Fe.classList.remove("leaving"),ie+40)):Fe.classList.remove("leaving"))})},pe=(d,L)=>d<0||d===L||re&&d===ne.length-1&&L===0?"next":re&&d===0&&L===ne.length-1?"prev":L>d?"next":"prev",Se=(d,L={})=>{var $,_e;if(d==null||d<0||d>=ne.length||($=ne[d])!=null&&$.disabled)return;const fe=g;if(fe===d)return;g=d;const Fe=ne[d],Te=L.dir||pe(fe,d);c&&!L.fromModel&&c.set(Fe.name),I(d),B(fe,d,Te),k(Te),X.dataset.active=String(Fe.name),(_e=e.onChange)==null||_e.call(e,Fe.name,Fe,d)},ye=(d,L={})=>{if(!ne.length)return;const fe=ne.findIndex(Fe=>Fe.name==d);fe!==-1&&Se(fe,L)},V=()=>{if(!ne.length)return;const d=g<0?ne.findIndex(L=>!L.disabled):r(g,1,re);d<0||Se(d,{dir:"next"})},D=()=>{if(!ne.length)return;const d=g<0?(()=>{var L;for(let fe=ne.length-1;fe>=0;fe-=1)if(!((L=ne[fe])!=null&&L.disabled))return fe;return-1})():r(g,-1,re);d<0||Se(d,{dir:"prev"})};if(K){let d=0,L=0,fe=!1;const Fe=42;F.addEventListener("pointerdown",Te=>{Te.button!=null&&Te.button!==0||(fe=!0,d=Te.clientX,L=Te.clientY)}),F.addEventListener("pointerup",Te=>{if(!fe)return;fe=!1;const $=Te.clientX-d,_e=Te.clientY-L;Math.abs($)<Fe||Math.abs($)<Math.abs(_e)||($<0?V():D())}),F.addEventListener("pointercancel",()=>{fe=!1}),F.addEventListener("pointerleave",()=>{fe=!1})}const q=c?c.get():(S=(N=(M=e.value)!=null?M:e.defaultValue)!=null?N:e.default)!=null?S:null;if(ne.length){const d=ne.findIndex(L=>L.name==q);if(d>=0)Se(d,{fromModel:!0});else{const L=ne.findIndex(fe=>!fe.disabled);L>=0&&(Se(L,{fromModel:!0}),c&&c.set(ne[L].name))}}return c&&c.watch(d=>ye(d,{fromModel:!0}),"UI.TabPanel:watch"),w==="after"?(X.appendChild(F),X.appendChild(ue)):(X.appendChild(ue),X.appendChild(F)),E(s,"default",{},n).forEach(d=>X.appendChild(d)),Ke(X,e),X._tabs=()=>ne.slice(),X._active=()=>g>=0?ne[g]:null,X._getValue=()=>{var d;return g>=0?(d=ne[g])==null?void 0:d.name:null},X._setValue=d=>ye(d),X._select=d=>{typeof d=="number"?Se(d):ye(d)},X._next=V,X._prev=D,X},(zi=JSswift.isDev)!=null&&zi.call(JSswift)&&(v.meta=v.meta||{},v.meta.TabPanel={signature:"UI.TabPanel(props) | UI.TabPanel(props, ...children)",props:{tabs:{type:"Array<{ name?, value?, label?, title?, note?, subtitle?, icon?, badge?, content?, panel?, body?, children?, disabled?, hidden?, tabClass?, panelClass? }>",description:"Tab definition. Supports multiple aliases for label and content.",category:"data"},items:{type:"Array",description:"Alias of `tabs`.",category:"data"},value:{type:"any",description:"Initial or controlled value of the active tab.",category:"data"},defaultValue:{type:"any",description:"Explicit alias for the initial tab when `model` is not used.",category:"data"},model:{type:"[get,set] signal",description:"Reactive binding for the active tab.",category:"data"},orientation:{type:"vertical|horizontal",description:"Navigation orientation.",values:["vertical","horizontal"],default:"vertical",category:"layout"},navPosition:{type:"before|after",description:"Tab bar position relative to the panels.",values:["before","after"],default:"before",category:"layout"},variant:{type:"line|pills|soft",description:"Visual style of the tab navigation.",values:["line","pills","soft"],default:"line",category:"style"},wrap:{type:"boolean",description:"Allows the nav to wrap when space is limited.",default:!1,category:"layout"},navFill:{type:"boolean",description:"Distributes tabs across the available width.",default:!1,category:"layout"},swipeable:{type:"boolean",description:"Enables swipe gestures on panels.",default:!1,category:"behavior"},infinite:{type:"boolean",description:"When enabled, next/prev cycles from the first to the last tab.",default:!1,category:"behavior"},animated:{type:"boolean",description:"Enables the transition between panels.",default:!1,category:"behavior"},transitionDuration:{type:"number",description:"Animation duration in milliseconds.",default:220,category:"behavior"},transitionEasing:{type:"string",description:"CSS timing function for the animation.",default:"ease",category:"behavior"},transitionPrev:{type:"string",description:"Custom classes applied during the transition to the previous tab.",category:"behavior"},transitionNext:{type:"string",description:"Custom classes applied during the transition to the next tab.",category:"behavior"},tabClass:{type:"string",description:"Additional classes for all tab buttons.",category:"style"},tabStyle:{type:"object",description:"Inline style applied to all tab buttons.",category:"style"},navClass:{type:"string",description:"Additional classes for the nav wrapper.",category:"style"},panelsClass:{type:"string",description:"Additional classes for the panels wrapper.",category:"style"},panelClass:{type:"string",description:"Common additional classes for each panel.",category:"style"},panelStyle:{type:"object",description:"Common inline style for each panel.",category:"style"},empty:{type:"Node|Function|Array",description:"Visual fallback when `tabs` and `items` are empty.",category:"state"},disabled:{type:"boolean",description:"Disables the entire component.",default:!1,category:"state"},slots:{type:"{ nav?, tab?, label?, icon?, note?, badge?, panel?, empty?, default? }",description:"Structured slots for customizing nav, label, badge, and content.",category:"general"}},slots:{nav:{type:"Function|Node|Array",description:"Full navigation renderer. Receives `tabs`, `active()`, `activeTab()`, `select()`, `next()`, `prev()`, `nodes`, `orientation`, `position`, `variant`."},tab:{type:"Function|Node|Array",description:"Inner content of the tab button. Receives `tab`, `name`, `index`, `active`, `label`, `icon`, `note`, `badge`, `select()`."},label:{type:"Function|Node|Array",description:"Tab label."},icon:{type:"Function|Node|Array",description:"Tab icon."},note:{type:"Function|Node|Array",description:"Note, subtitle, or short description below the label."},badge:{type:"Function|Node|Array",description:"Badge or counter aligned to the right of the tab."},panel:{type:"Function|Node|Array",description:"Active/inactive panel renderer. Receives `tab`, `name`, `index`, `active`, `select()`, `next()`, `prev()`."},empty:{type:"Function|Node|Array",description:"Fallback when there are no tabs."},default:{type:"Node|Array|Function",description:"Extra content appended after the component."}},events:{onChange:"(name, tab, index)"},returns:"HTMLDivElement with API `_getValue()`, `_setValue(value)`, `_select(value)`, `_next()`, `_prev()`, `_active()`, `_tabs()`",description:"Standardized tab panel with accessible nav, structured slots, reactive model, swipe, and animations."});function dr(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ss({title:t,message:e,contentNode:n,okText:s,cancelText:i,showCancel:c,onOk:y,onCancel:a,persistent:l}){No();const b=_.div({class:"cms-dialog-backdrop",onClick:K=>{K.target===b&&l!==!0&&(a==null||a())}}),R=E(null,"default",{},t),C=E(null,"default",{},e),w=E(null,"default",{},n),T=_.div({class:"cms-dialog cms-panel"},R.length?_.h3(...R):null,C.length?_.p(...C):null,...w,_.div({class:"cms-dialog-actions"},c?JSswift.ui.Btn({onClick:a},i||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:y},s||"OK")));b.appendChild(T),No().appendChild(b);const ee=K=>{K.key==="Escape"&&(a==null||a())};return document.addEventListener("keydown",ee,{once:!0}),{backdrop:b,close:()=>dr(b)}}je.dialog.alert=function(t,e={}){return new Promise(n=>{const{backdrop:s,close:i}=Ss({title:e.title||"Info",message:t,okText:e.okText||"OK",showCancel:!1,persistent:e.persistent,onOk:()=>{i(),n(!0)},onCancel:()=>{i(),n(!0)}})})},je.dialog.confirm=function(t={}){return new Promise(e=>{const{close:n}=Ss({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)}})})},je.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}=Ss({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)})},je.services=je.services||{},je.services.loading=je.services.loading||{},je.loading=je.services.loading;let Nt=null,In=0;function Ao(){if(Nt)return Nt;Nt=document.createElement("div"),Nt.className="cms-loading-backdrop",Nt.style.cssText=`
1
+ (function(He){var Sl;He.ui=He.ui||{},He.services=He.services||{},He.services.notify=He.services.notify||{};const ts=Symbol("cms.ui.rodPathRaw"),Fn=Symbol("cms.ui.rodPathEnhanced"),As=Symbol("cms.ui.rodPathPatchedH"),On=Symbol("cms.ui.rodPathWrappedUI"),xn=new WeakMap,Is=new WeakMap,zs=new WeakMap,Ht=[],Ps=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},ns=t=>{const e=typeof t;return e==="string"||e==="number"||e==="boolean"||e==="bigint"},ln=t=>{if(!t||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e===Object.prototype||e===null};let ss=!1;const Kl=()=>{ss||(ss=!0,queueMicrotask(()=>{ss=!1,Ht.length=0}))},Yl=t=>{Ht.push(t),Ht.length>128&&Ht.splice(0,Ht.length-128),Kl()},Js=()=>{if(!Ht.length)return null;const t=Ht.slice();return Ht.length=0,{items:t,index:0}},Es=(t,e)=>{if(!t)return null;const n=t.items[t.index];return!n||!Object.is(n.value,e)?null:(t.index+=1,n)},ls=t=>t&&typeof t=="object"&&t[ts]?t[ts]:t,os=(t,e)=>{const n=xn.get(t);if(!n)return;let s=n.rawGet();for(const o of e){if(s==null)return;s=s[o]}return s},ql=(t,e,n)=>{const s=xn.get(t);if(!s)return;const o=ls(n);if(!e.length){if(Object.is(s.rawGet(),o))return;s.rawSet(o);return}let r=s.rawGet();(!r||typeof r!="object")&&(r=Ps(e[0])?[]:{});let C=r;for(let u=0;u<e.length-1;u++){const i=e[u];let y=C[i];if(!y||typeof y!="object"){const R=e[u+1];y=Ps(R)?[]:{},C[i]=y}C=y}Object.is(C[e[e.length-1]],o)||(C[e[e.length-1]]=o,s.rawSet(r))},Ts=(t,e)=>[()=>os(t,e),n=>ql(t,e,n)],Rs=(t,e,n=[])=>{if(!e||typeof e!="object")return e;let s=Is.get(t);s||(s=new WeakMap,Is.set(t,s));const o=s.get(e);if(o)return o;const r=new Proxy(e,{get(C,u,i){if(u===ts)return C;const y=Reflect.get(C,u,i);if(typeof u=="symbol")return y;const R=n.concat(u);return y&&typeof y=="object"?Rs(t,y,R):typeof y=="function"?y.bind(i):(ns(y)&&Yl({rod:t,path:R,value:y}),y)},set(C,u,i,y){const R=ls(i),v=Reflect.get(C,u,y);if(Object.is(v,R))return!0;const b=Reflect.set(C,u,R,y);if(b){const P=xn.get(t);P==null||P.rawSet(P.rawGet())}return b},deleteProperty(C,u){const i=Reflect.has(C,u),y=Reflect.deleteProperty(C,u);if(y&&i){const R=xn.get(t);R==null||R.rawSet(R.rawGet())}return y}});return s.set(e,r),r},Ms=t=>{if(!t||typeof t!="object"||t.type!=="rod"||t[Fn])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=o=>e.set.call(t,ls(o));return xn.set(t,{rawGet:n,rawSet:s}),Object.defineProperty(t,"value",{get(){const o=n();return!o||typeof o!="object"?o:Rs(t,o,[])},set(o){s(o)},configurable:!0}),Object.defineProperty(t,Fn,{value:!0,configurable:!1}),t},Xl=()=>{if(typeof window._.rod!="function"||window._.rod[Fn])return;const t=window._.rod,e=function(...s){return Ms(t(...s))};Object.defineProperty(e,Fn,{value:!0,configurable:!1}),window._.rod=e};He.ui.withoutRodPathCapture=t=>{const e=Ht.length;try{return t()}finally{Ht.length=e}};const is=(t,e,n="")=>{if(Array.isArray(t)){let r=!1;const C=t.map(u=>{const i=is(u,e,"");return i!==u&&(r=!0),i});return r?C:t}if(ns(t)){const r=Es(e,t);return r?n==="model"?Ts(r.rod,r.path):()=>os(r.rod,r.path):t}if(!ln(t))return t;let s=!1;const o={};for(const r of Object.keys(t)){const C=is(t[r],e,r);o[r]=C,C!==t[r]&&(s=!0)}return s?o:t},as=(t,e,n="")=>{if(Array.isArray(t)){let r=!1;const C=t.map(u=>{const i=as(u,e,"");return i!==u&&(r=!0),i});return r?C:t}if(ns(t)){const r=Es(e,t);return r?n==="model"?Ts(r.rod,r.path):()=>os(r.rod,r.path):t}if(!ln(t))return t;let s=!1;const o={};for(const r of Object.keys(t)){const u=r==="model"||r==="children"?as(t[r],e,r):t[r];o[r]=u,u!==t[r]&&(s=!0)}return s?o:t},Fs=t=>{if(typeof t!="function"||t[On])return t;const e=zs.get(t);if(e)return e;const n=function(...o){const r=Js();if(!r)return t.apply(this,o);let C=!1;const u=o.map(i=>{const y=as(i,r,"");return y!==i&&(C=!0),y});return t.apply(this,C?u:o)};return Object.defineProperty(n,On,{value:!0,configurable:!1}),zs.set(t,n),n},Ql=()=>{const t=He.ui;if(!(!t||t[On])){Object.defineProperty(t,On,{value:!0,configurable:!1});for(const e of Object.keys(t))typeof t[e]=="function"&&(t[e]=Fs(t[e]));He.ui=new Proxy(t,{get(e,n,s){return Reflect.get(e,n,s)},set(e,n,s,o){const r=typeof s=="function"?Fs(s):s;return Reflect.set(e,n,r,o)}})}},Zl=()=>{if(!window._||window._[As])return;Object.defineProperty(window._,As,{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(...o){const r=Js();if(!r)return n.apply(this,o);let C=!1;const u=o.map(i=>{const y=is(i,r,"");return y!==i&&(C=!0),y});return n.apply(this,C?u:o)})}};Xl(),((Sl=JSswift.rod)==null?void 0:Sl._all)instanceof Set&&JSswift.rod._all.forEach(t=>Ms(t)),Zl(),Ql();const Os={error:"danger",danger:"danger",warn:"warning",warning:"warning",success:"success",info:"info",primary:"primary",secondary:"secondary",light:"light",dark:"dark"},ci=new Set(Object.values(Os)),eo=new Set(["none","xxs","xs","sm","md","lg","xl","xxl","xxxl","full"]),to=new Set(["none","sm","md","lg"]),kn={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"}},Qt=t=>{if(t.indexOf("-")>-1)return!0},mt=t=>{if(!t)return"";const e=String(t).toLowerCase();return Os[e]||""},no=t=>{if(t==null)return null;const e=String(t).toLowerCase();return e==="full"?"xxxl":eo.has(e)?e:null},Dn=t=>{if(t===!0)return"sm";if(t==null||t===!1)return null;const e=String(t).toLowerCase();return to.has(e)?e:null},_n=t=>t&&typeof t=="object"&&!t.nodeType&&!Array.isArray(t)&&!(t instanceof Function),rs=t=>t&&t.nodeType===1&&String(t.tagName||"").toLowerCase()==="li",Zt=t=>t==null||t===!1||t===""?[]:Array.isArray(t)?t:[t];JSswift.isUIPlainObject=_n,JSswift.isListItemNode=rs,JSswift.asNodeArray=Zt;const mn=[{key:"mobile",aliases:["mobile","mobil"],prefix:"cms-"},{key:"tablet",aliases:["tablet"],prefix:"cms-tablet-"},{key:"pc",aliases:["pc","desktop"],prefix:"cms-pc-"}],cs=mn.flatMap(t=>t.aliases),$n=(t,e)=>Object.prototype.hasOwnProperty.call(t||{},e),Nn=(t={},e)=>{if(!e)return null;for(const n of e.aliases){if(!$n(t,n))continue;const s=l(t[n]);if(_n(s))return s}return null},Ds=(t={},e)=>{const n=Array.isArray(e)?e:[e];return mn.some(s=>{const o=Nn(t,s);return!!o&&n.some(r=>$n(o,r))})},so=t=>String(t).trim().toLowerCase().replace(/\s+/g,"-"),lo=(t={},e=[])=>{const n=[];for(const s of mn){const o=Nn(t,s);if(o)for(const r of e){const C=Array.isArray(r.prop)?r.prop:[r.prop];let u=!1,i,y="";for(const b of C)if($n(o,b)){i=l(o[b]),y=b,u=!0;break}if(!u||i==null||i===""||i===!1&&!r.allowFalse)continue;const R=typeof r.map=="function"?r.map(i,{propName:y,props:o,device:s,rule:r}):`${r.class}-${so(i)}`,v=Array.isArray(R)?R:[R];for(const b of v)b&&n.push(String(b).startsWith("cms-")?b:`${s.prefix}${b}`)}}return n},$s=(t={})=>mn.some(e=>!!Nn(t,e)),oo=(t={},e=[])=>{for(const n of e){if(!$n(t,n))continue;const s=l(t[n]);if(!(s==null||s===""))return s}},io=(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)},ao=(t,e,n)=>{!t||n==null||n===""||(typeof t.setProperty=="function"?t.setProperty(e,n):t[e]=n)},ro=(t,e)=>t==="mobile"?`cms-rsp-${e}`:`cms-rsp-${t}-${e}`,Vs=(t,e)=>{var n;if(!(!t||!e)){if((n=t.classList)!=null&&n.add){t.classList.add(e);return}t.class=ae([t.class,e])}},Bs=(t,e={},n=[])=>{if(!t||!e||!$s(e))return t;const s=t.style||{};let o=!1;for(const r of n){const C=Array.isArray(r.prop)?r.prop:[r.prop],u=(i,y)=>{const R=oo(y,C),v=io(R,r);if(!v)return;const b=r.var||r.css,P=i==="mobile"?"--cms-rsp-":`--cms-rsp-${i}-`;ao(s,`${P}${b}`,v),Vs(t,ro(i,b)),o=!0};u("mobile",e);for(const i of mn){const y=Nn(e,i);y&&u(i.key,y)}}return o&&(t.nodeType||(t.style=s),Vs(t,"cms-rsp")),t};JSswift.uiResponsiveDevices=mn,JSswift.uiResponsiveOmitProps=cs,JSswift.uiResponsivePropsFor=Nn,JSswift.uiResponsiveHasConfig=$s,JSswift.uiResponsiveHasProp=Ds,JSswift.uiResponsiveClasses=lo,JSswift.uiApplyResponsiveProps=Bs;const co=JSswift.omit;JSswift.omit=(t,e=[])=>{const n=Array.isArray(e)?e.concat(cs):cs;return co(t,n)};const Yt=(t={})=>{var s;const e=[],n={};if(e.push(fe(t.clickable,"cms-clickable"),fe(t.dense,"cms-dense"),fe(t.flat,"cms-flat"),fe(t.border,"cms-border"),fe(t.glossy,"cms-glossy"),fe(t.glow,"cms-glow"),fe(t.glass,"cms-glass"),fe(t.shadow,"cms-shadow"),fe(t.outline,"cms-outline"),fe(t.rounded,"cms-rounded"),fe(t.gradient,"cms-gradient"),fe(t.textGradient,"cms-text-gradient"),fe(t.lightShadow,"cms-light-shadow")),at(t.color))e.push(()=>{const o=l(t.color),r=mt(o);return r?`cms-state-${r}`:""}),n.backgroundColor=()=>{const o=l(t.color);return mt(o)?"":o&&Qt(String(o))?`var(--cms-${o})`:o||""};else{const o=mt(t.color);o?e.push(`cms-state-${o}`):t.color&&Qt(t.color)?n.backgroundColor=`var(--cms-${t.color})`:t.color&&(n.backgroundColor=t.color)}if(at(t.textColor)?n.color=()=>{const o=l(t.textColor);return o&&Qt(String(o))?`var(--cms-${o})`:o||""}:t.textColor&&Qt(t.textColor)?n.color=`var(--cms-${t.textColor})`:t.textColor&&(n.color=t.textColor),at(t.size))e.push(()=>{var r;const o=l(t.size);return typeof o=="string"&&((r=JSswift.uiSizes)!=null&&r.includes(o))?`cms-size-${o}`:""});else{const o=t.size;typeof o=="string"&&((s=JSswift.uiSizes)!=null&&s.includes(o))&&e.push(`cms-size-${o}`)}if(at(t.shadow))e.push(()=>{const o=l(t.shadow),r=Dn(o);return r?`cms-shadow-${r}`:""}),n.boxShadow=()=>{const o=l(t.shadow);return Dn(o)||o==null||o===!1?"":typeof o=="string"?o:""};else{const o=Dn(t.shadow);o?e.push(`cms-shadow-${o}`):t.shadow&&typeof t.shadow=="string"&&(n.boxShadow=t.shadow)}e.length&&(t.class=ae([t.class,...e])),Object.keys(n).length&&(t.style={...n,...t.style||{}})},uo=JSswift.uiNormalizeArgs;JSswift.uiNormalizeArgs=function(t){const e=uo(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 Yt(n),e};const he=window._;function on(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 Hs={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"},fo=t=>t===!0?"wrap":t===!1?"nowrap":String(t),js=t=>typeof t=="number"?`repeat(${Math.max(1,Math.round(t))}, minmax(0, 1fr))`:String(t),Ws=[{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:fo},{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:js},{prop:"rows",css:"grid-template-rows",var:"grid-template-rows",mapValue:js},{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"}],Us=Ws.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return e.some(n=>Object.prototype.hasOwnProperty.call(Hs,n))||e.includes("fontSize")||e.includes("fontWeight")||e.includes("lineHeight")||e.includes("letterSpacing")||e.includes("borderRadius")||e.includes("radius")});JSswift.uiResponsiveStyleRules=Ws,JSswift.uiResponsiveCommonStyleRules=Us;const mo=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),go=(t,e,n,s)=>{e==null||e===!1||e===""||t.style.setProperty(mo(n),ms(e,s))};function Ke(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(Hs).forEach(([n,s])=>{Ds(e,n)||go(t,e[n],n,s)}),Bs(t,e,Us),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 us(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(o=>{o==null||o===!1||(o instanceof Node?n.appendChild(o):n.appendChild(document.createTextNode(String(o))))}):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 o=JSswift.ui.getSlot(t,e),C=o!=null?typeof o=="function"?o(n||{}):o:s;return C==null?null:on(JSswift.ui.slot(C))};const E=(t,e,n,s)=>{const o=JSswift.ui.renderSlot(t,e,n,s);return o?Array.isArray(o)?o:[o]:[]},gn=new Set;let Vn=!1;const ho=new Set(["ctrl","alt","shift","meta"]),po={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"},bo={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"},Gs=()=>{if(typeof navigator=="undefined")return!1;const t=String(navigator.platform||navigator.userAgent||"");return/(mac|iphone|ipad|ipod)/i.test(t)},ds=t=>{if(t==null)return"";const e=String(t).trim().toLowerCase();return e?po[e]||e:""},Ks=t=>{if(t==null||t===!1)return null;const e=String(t).trim();if(!e)return null;const n=e.split("+").map(ds).filter(Boolean);if(!n.length)return null;const s={raw:e,key:"",ctrl:!1,alt:!1,shift:!1,meta:!1};return n.forEach(o=>{if(o==="mod"){Gs()?s.meta=!0:s.ctrl=!0;return}if(ho.has(o)){s[o]=!0;return}s.key=o}),s.key?s:null},yo=t=>t==null||t===!1?[]:(Array.isArray(t)?t:[t]).map(n=>{var o,r,C;if(n==null||n===!1)return null;if(typeof n=="object"&&!Array.isArray(n)){const u=Ks((C=(r=(o=n.shortcode)!=null?o:n.shortcut)!=null?r:n.keys)!=null?C:n.key);return u?{...n,...u}:null}const s=Ks(n);return s?{...s}:null}).filter(Boolean),Ys=(t={})=>{var e,n,s;return yo((s=(n=(e=t.shortcode)!=null?e:t.shortcut)!=null?n:t.hotkey)!=null?s:t.keys)},wo=(t={})=>t.showShortcode===!0||t.showShortcut===!0,Ln=t=>{const e=ds(t);if(!e)return"";const n={...bo};return Gs()&&(n.alt="Option",n.meta="Cmd"),n[e]?n[e]:e.length===1?e.toUpperCase():e.replace(/(^|[-_ ])(\w)/g,(s,o,r)=>`${o}${r.toUpperCase()}`)},vo=t=>{if(!t)return"";const e=[];return t.ctrl&&e.push(Ln("ctrl")),t.alt&&e.push(Ln("alt")),t.shift&&e.push(Ln("shift")),t.meta&&e.push(Ln("meta")),e.push(Ln(t.key)),e.filter(Boolean).join("+")},So=t=>(Array.isArray(t)?t:[]).map(vo).filter(Boolean).join(" / "),fs=(t={},e={})=>{const n=Ys(t);if(!wo(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=So(n),s},Co=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)},xo=(t,e)=>!t||!e||!!t.ctrlKey!=!!e.ctrl||!!t.altKey!=!!e.alt||!!t.shiftKey!=!!e.shift||!!t.metaKey!=!!e.meta?!1:ds(t.key)===e.key,qs=()=>{gn.size||!Vn||typeof document=="undefined"||(document.removeEventListener("keydown",Xs,!0),Vn=!1)};function Xs(t){var s,o,r,C,u,i;if(!gn.size||!t||t.defaultPrevented||t.isComposing)return;const e=Co(t.target),n=Array.from(gn);for(let y=n.length-1;y>=0;y-=1){const R=n[y],v=R==null?void 0:R.anchor;if(!v||!v.isConnected){gn.delete(R);continue}if(((s=R.isEnabled)==null?void 0:s.call(R))===!1)continue;const b=R.specs.find(ie=>{var $,Y;const D=(Y=($=ie.allowInEditable)!=null?$:R.allowInEditable)!=null?Y:!1;return e&&!D?!1:xo(t,ie)});if(!b)continue;const P=(r=(o=b.preventDefault)!=null?o:R.preventDefault)!=null?r:!0,Z=(u=(C=b.stopPropagation)!=null?C:R.stopPropagation)!=null?u:!0;if(P&&t.preventDefault(),Z&&t.stopPropagation(),((i=R.action)==null?void 0:i.call(R,t,b,v))!==!1)break}qs()}const an=(t,e={},n={})=>{var C,u;const s=Ys(e);if(!t||!s.length||typeof document=="undefined")return null;const o={anchor:t,specs:s,action:typeof n.action=="function"?n.action:()=>{var i;return(i=t.click)==null?void 0:i.call(t)},isEnabled:typeof n.isEnabled=="function"?n.isEnabled:null,allowInEditable:!!n.allowInEditable,preventDefault:(C=n.preventDefault)!=null?C:!0,stopPropagation:(u=n.stopPropagation)!=null?u:!0};gn.add(o),Vn||(document.addEventListener("keydown",Xs,!0),Vn=!0);const r=()=>{gn.delete(o),qs()};return JSswift._registerCleanup(t,r),r},hn=(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},ms=(t,e="size")=>typeof t=="number"?t+"px":JSswift.uiSizes.includes(t)?`var(--cms-${e}-${t})`:t,Ot=(t,e=JSswift.uiSizes)=>n=>{const s=String(n).trim();return e!=null&&e.includes(s)?`${t}-${s}`:""},jt=t=>e=>`${t}-${String(e).trim().toLowerCase().replace(/\s+/g,"-")}`,ko=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}`},gs=(t,e,n)=>t?e:n,_o=t=>{const e=l(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""},No=t=>{const e=Number(t);return Number.isFinite(e)&&e>0?`grid-cols-${Math.max(1,Math.min(24,Math.round(e)))}`:""},We=(t,e)=>{const n=Array.isArray(e)?e:[e];return JSswift.uiResponsiveDevices.some(s=>{const o=JSswift.uiResponsivePropsFor(t,s);return!!o&&n.some(r=>Object.prototype.hasOwnProperty.call(o,r))})},pn=t=>JSswift.uiResponsiveDevices.find(e=>e.key===t),rn=[{prop:"gap",class:"gap",map:Ot("gap")},{prop:"rowGap",class:"gap-y",map:Ot("gap-y")},{prop:["columnGap","colGap"],class:"gap-x",map:Ot("gap-x")},{prop:"direction",class:"dir",map:jt("dir")},{prop:"wrap",class:"wrap",allowFalse:!0,map:ko},{prop:"align",class:"align",map:jt("align")},{prop:"justify",class:"justify",map:jt("justify")},{prop:"width",class:"w",map:Ot("w")},{prop:"minWidth",class:"min-w",map:Ot("min-w")},{prop:"maxWidth",class:"max-w",map:Ot("max-w")},{prop:"height",class:"h",map:Ot("h")},{prop:"minHeight",class:"min-h",map:Ot("min-h")},{prop:"maxHeight",class:"max-h",map:Ot("max-h")},{prop:"padding",class:"p",map:Ot("p")},{prop:"margin",class:"m",map:Ot("m")}],Lo=rn.filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("align")&&!e.includes("justify")}),Qs=[{prop:["col","span"],class:"col",map:_o},{prop:"auto",class:"col",map:t=>t?"col-auto":""},{prop:"inline",class:"display",allowFalse:!0,map:t=>gs(t,"display-inline-flex","display-flex")},{prop:"self",class:"self",map:jt("self")},...rn],Zs=[{prop:["cols","columns"],class:"grid-cols",map:No},{prop:"inline",class:"display",allowFalse:!0,map:t=>gs(t,"display-inline-grid","display-grid")},{prop:"flow",class:"grid-flow",map:t=>`grid-flow-${String(t).trim().toLowerCase().replace(/\s+/g,"-")}`},...rn],el=[{prop:"inline",class:"display",allowFalse:!0,map:t=>gs(t,"display-inline-flex","display-flex")},{prop:"direction",class:"dir",map:jt("dir")},{prop:"contentAlign",class:"align",map:jt("align")},{prop:"contentJustify",class:"justify",map:jt("justify")},{prop:"align",class:"self",map:jt("self")},{prop:"justify",class:"justify-self",map:jt("justify-self")},{prop:"place",class:"place-self",map:jt("place-self")},...Lo],Ao=(JSswift.uiResponsiveStyleRules||[]).filter(t=>{const e=Array.isArray(t.prop)?t.prop:[t.prop];return!e.includes("span")&&!e.includes("gridColumn")});he.Row=(...t)=>{var f,m,g,F,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(a,S,h={})=>{const J=Array.isArray(a)?a:[a];for(const j of J)if(JSswift.ui.getSlot(s,j)!=null)return E(s,j,h,S);return S==null?[]:E(null,"default",h,S)},r=a=>{var S;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?`var(--cms-s-${a})`:String(a)},C=a=>{var S;return a==null||a===!1||a===""?"":typeof a=="number"?`${a}px`:typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?`var(--cms-w-${a})`:String(a)},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=ae(["cms-row",JSswift.uiResponsiveClasses({mobile:e},rn),JSswift.uiResponsiveClasses(e,rn),e.class]);const i={...e.style||{}},y=qe([e.direction,e.reverse],()=>{const a=l(e.direction);return a!=null&&a!==""?String(a):l(e.reverse)?"row-reverse":""}),R=ze(e.align),v=ze(e.justify),b=ze(e.wrap,a=>typeof a=="boolean"?a?"wrap":"nowrap":String(a)),P=ze(e.gap,r),Z=ze(e.rowGap,r),G=ze(e.columnGap,r),ie=ze(e.inline,a=>a?"inline-flex":"flex"),D=ze(e.width,C),$=ze(e.minWidth,C),Y=ze(e.maxWidth,C),W=ze(e.full,a=>a?"100%":"",""),le=qe([e.inline,e.full,e.width],()=>{const a=!!l(e.inline),S=!!l(e.full),h=l(e.width)!=null&&l(e.width)!==!1&&l(e.width)!=="";return!a||S||h?"":"max-content"});y!=null&&!We(e,"direction")&&(i.flexDirection=y),R!=null&&!We(e,"align")&&(i.alignItems=R),v!=null&&!We(e,"justify")&&(i.justifyContent=v),b!=null&&!We(e,"wrap")&&(i.flexWrap=b),P!=null&&!We(e,"gap")&&(i.gap=P),Z!=null&&!We(e,"rowGap")&&(i.rowGap=Z),G!=null&&!We(e,"columnGap")&&(i.columnGap=G),ie!=null&&(i.display=ie),le!=null&&(i.width=le),D!=null&&!We(e,"width")&&(i.width=D),$!=null&&!We(e,"minWidth")&&(i.minWidth=$),Y!=null&&!We(e,"maxWidth")&&(i.maxWidth=Y),W!=null&&(i.width=W),Object.keys(i).length&&(u.style=i),JSswift.uiApplyResponsiveProps(u,e,JSswift.uiResponsiveStyleRules);const me={props:e},re=o(["start","left"],(f=e.start)!=null?f:e.left,me),oe=o(["body","center","default"],(g=(m=e.body)!=null?m:e.center)!=null?g:n,me),se=o(["end","right"],(F=e.end)!=null?F:e.right,me);if(!(re.length||se.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=E(s,"default",me,n),S=_.div(u,...a);return Ke(S,e),S}const M={display:"flex",alignItems:"inherit",gap:"inherit",flexWrap:"inherit",minWidth:0},Q=(X=e.bodyClass)!=null?X:e.centerClass,q=qe([e.direction,e.reverse],()=>(l(e.direction)||(l(e.reverse)?"row-reverse":"row"))==="row"?"auto":""),ue=[re.length?_.div({class:ae(["cms-row-start",e.startClass]),style:{...M}},...re):null,oe.length?_.div({class:ae(["cms-row-body",Q]),style:{...M,flex:"1 1 auto"}},...oe):null,se.length?_.div({class:ae(["cms-row-end",e.endClass]),style:{...M,justifyContent:"flex-end",marginInlineStart:q}},...se):null].filter(Boolean),L=_.div(u,...ue);return Ke(L,e),L};function At(t){return Array.isArray(t)&&(t.length===2||t.length===3&&typeof t[2]=="function")&&typeof t[0]=="function"&&typeof t[1]=="function"}function Jt(t){return!!t&&t.type==="rod"}function at(t){return typeof t=="function"||Jt(t)||At(t)}function l(t){return typeof t=="function"?t():Jt(t)?t.value:At(t)?t[0]():t}function Io(t){const e=Array.isArray(t)?[...t]:[t];for(;e.length;){const n=e.pop();if(at(n))return!0;Array.isArray(n)&&e.push(...n)}return!1}function ae(t){const e=Io(t),n=()=>{const s=[],o=Array.isArray(t)?[...t]:[t];for(;o.length;){const r=o.shift();if(r==null||r===!1)continue;const C=l(r);if(!(C==null||C===!1||C==="")){if(Array.isArray(C)){o.unshift(...C);continue}s.push(C)}}return s.join(" ")};return e?n:n()}function Dt(t){const e=ae(t);return typeof e=="function"?e():e}function fe(t,e,n=""){return at(t)?()=>l(t)?e:n:t?e:n}function tl(t,e,n=""){return at(t)?()=>{const s=l(t);return s==null||s===""?"":`${e}${s}${n}`}:t==null||t===""?"":`${e}${t}${n}`}function qe(t,e){return(Array.isArray(t)?t:[t]).some(at)?()=>e():e()}function ze(t,e,n=""){return at(t)?()=>{const s=l(t);return s==null||s===!1?n:e?e(s):s}:t==null||t===!1?null:e?e(t):t}JSswift.uiIsReactive=at,JSswift.uiUnwrap=l,JSswift.uiClass=ae,JSswift.uiClassStatic=Dt,JSswift.uiWhen=fe,JSswift.uiClassValue=tl,JSswift.uiComputed=qe,JSswift.uiStyleValue=ze,he.Col=(...t)=>{var J,j,U,ce,k,d;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=N=>Object.prototype.hasOwnProperty.call(e,N),r=(N,I,H={})=>{const ge=Array.isArray(N)?N:[N];for(const Se of ge)if(JSswift.ui.getSlot(s,Se)!=null)return E(s,Se,H,I);return I==null?[]:E(null,"default",H,I)},C=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)},u=N=>{var I;return N==null||N===!1||N===""?"":typeof N=="string"&&((I=JSswift.uiSizes)!=null&&I.includes(N))?ms(N,"size"):Be(N)},i=(N,I)=>{const H=l(N);if(H==null||H===!1||H==="")return"";if(H==="auto")return I==="cms-col-"?"cms-col-auto":"";if(H===!0)return`${I}24`;const ge=Number(H);if(Number.isFinite(ge)&&ge>0)return`${I}${Math.max(1,Math.min(24,Math.round(ge)))}`;if(typeof H=="string"){const Se=H.trim();if(!Se)return"";if(Se.startsWith(I))return Se;if(/^\d+$/.test(Se))return`${I}${Math.max(1,Math.min(24,Number(Se)))}`}return""},y=()=>{const N=l(e.flex);if(N!=null&&N!==!1&&N!=="")return String(N);if(l(e.fill))return"1 1 auto";const I=o("grow"),H=o("shrink"),ge=o("basis");if(!I&&!H&&!ge)return"";const Se=I?l(e.grow):0,ye=H?l(e.shrink):1,V=ge?u(l(e.basis)):"auto";return`${Se} ${ye} ${V||"auto"}`},R=qe([e.auto,e.col,e.span],()=>{if(l(e.auto))return"cms-col-auto";const N=o("span")?e.span:e.col;return i(N,"cms-col-")||"cms-col"}),v=JSswift.omit(e,["slots","col","span","sm","md","lg","auto","size","width","minWidth","maxWidth","height","minHeight","maxHeight","gap","rowGap","columnGap","align","justify","inline","center","stack","flex","fill","grow","shrink","basis","self","order","scroll","start","top","header","before","startClass","topClass","headerClass","body","content","bodyClass","contentClass","end","bottom","footer","after","endClass","bottomClass","footerClass",...JSswift.uiResponsiveOmitProps]),b={...e.style||{}};!We(e,"minWidth")&&b.minWidth==null&&(b.minWidth=0);const P=ze(e.gap,C),Z=ze(e.rowGap,C),G=ze(e.columnGap,C),ie=ze(e.align),D=ze(e.justify),$=o("width")?e.width:e.size,Y=ze($,u),W=ze(e.minWidth,u),le=ze(e.maxWidth,u),me=ze(e.height,u),re=ze(e.minHeight,u),oe=ze(e.maxHeight,u),se=ze(e.self),te=ze(e.order,N=>String(N)),M=ze(e.scroll,N=>N?"auto":"",""),Q=qe([e.flex,e.fill,e.grow,e.shrink,e.basis],y),q=qe([e.center,e.align,e.justify],()=>!!l(e.center)&&(l(e.align)==null||l(e.align)==="")&&(l(e.justify)==null||l(e.justify)===""));Q!=null&&Q!==""&&(b.flex=Q),se!=null&&!We(e,"self")&&(b.alignSelf=se),te!=null&&(b.order=te),M!=null&&M!==""&&(b.overflow=M),Y!=null&&Y!==""&&!We(e,["width","size"])&&(b.width=Y,!o("flex")&&!o("fill")&&!o("grow")&&!o("shrink")&&!o("basis")&&(b.flex="0 0 auto")),W!=null&&!We(e,"minWidth")&&(b.minWidth=W),le!=null&&!We(e,"maxWidth")&&(b.maxWidth=le),me!=null&&!We(e,"height")&&(b.height=me),re!=null&&!We(e,"minHeight")&&(b.minHeight=re),oe!=null&&!We(e,"maxHeight")&&(b.maxHeight=oe),Object.keys(b).length&&(v.style=b);const ue={props:e},L=r(["start","top","header","before"],(U=(j=(J=e.start)!=null?J:e.top)!=null?j:e.header)!=null?U:e.before,ue),f=o("body")?e.body:o("content")?e.content:n,m=r(["body","content","default"],f,ue),g=r(["end","bottom","footer","after"],(d=(k=(ce=e.end)!=null?ce:e.bottom)!=null?k:e.footer)!=null?d:e.after,ue),F=L.length||g.length||o("start")||o("top")||o("header")||o("before")||o("body")||o("content")||o("end")||o("bottom")||o("footer")||o("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=qe([e.stack,e.gap,e.rowGap,e.columnGap,e.align,e.justify,e.center],()=>l(e.stack)||F||[l(e.gap),l(e.rowGap),l(e.columnGap),l(e.align),l(e.justify)].some(I=>I!=null&&I!==!1&&I!=="")?!0:!!l(e.center));if(v.class=ae(["cms-col",R,qe(e.sm,()=>i(e.sm,"cms-sm-col-")),qe(e.md,()=>i(e.md,"cms-md-col-")),qe(e.lg,()=>i(e.lg,"cms-lg-col-")),JSswift.uiResponsiveClasses({mobile:e},Qs),JSswift.uiResponsiveClasses(e,Qs),fe(X,"cms-col-flex"),fe(e.inline,"cms-col-inline"),e.class]),P!=null&&!We(e,"gap")&&(b.gap=P),Z!=null&&!We(e,"rowGap")&&(b.rowGap=Z),G!=null&&!We(e,"columnGap")&&(b.columnGap=G),ie!=null&&!We(e,"align")?b.alignItems=ie:q!=null&&q!==""&&(b.alignItems=q?"center":""),D!=null&&!We(e,"justify")?b.justifyContent=D:q!=null&&q!==""&&(b.justifyContent=q?"center":""),Object.keys(b).length&&(v.style=b),JSswift.uiApplyResponsiveProps(v,e,JSswift.uiResponsiveStyleRules),!F){const N=_.div(v,...E(s,"default",ue,n));return Ke(N,e),N}const a={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},S=[L.length?_.div({class:ae(["cms-col-start",e.startClass,e.topClass,e.headerClass]),style:{...a}},...L):null,m.length?_.div({class:ae(["cms-col-body",e.bodyClass,e.contentClass]),style:{...a,flex:"1 1 auto"}},...m):null,g.length?_.div({class:ae(["cms-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...a}},...g):null].filter(Boolean),h=_.div(v,...S);return Ke(h,e),h},he.Spacer=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=JSswift.omit(e,["slots"]);o.class=ae(["cms-spacer",e.class]);const r=E(s,"default",{},n);return _.div(o,...r)},he.Container=(...t)=>{var g,F,X,a;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e},r=S=>Object.prototype.hasOwnProperty.call(e,S),C={xxs:"360px",xs:"480px",sm:"640px",md:"820px",lg:"1100px",xl:"1280px",xxl:"1440px",narrow:"760px",prose:"760px",wide:"1360px"},u=S=>{if(S==null||S===!1||S==="")return"";if(typeof S=="number")return`${S}px`;const h=String(S).trim().toLowerCase();return h?h==="full"||h==="fluid"?"100%":C[h]||String(S):""},i=S=>{var h;return S==null||S===!1||S===""?"":typeof S=="number"?`${S}px`:typeof S=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(S))?`var(--cms-s-${S})`:String(S)},y=S=>{if(S==null||S===!1||S==="")return"";if(typeof S=="number"&&Number.isFinite(S))return`repeat(${Math.max(1,Math.floor(S))}, minmax(0, 1fr))`;const h=String(S).trim();return h?/^\d+$/.test(h)?`repeat(${Math.max(1,Number(h))}, minmax(0, 1fr))`:h:""},R=S=>S==null||S===""?"":S===!0?"wrap":S===!1?"nowrap":String(S),v={props:e},b=(S,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(J=>b(S,J));return}if(h!=null&&h.nodeType){S.appendChild(h);return}S.appendChild(document.createTextNode(String(h)))}},P=(S,h)=>{const J=JSswift.ui.getSlot(s,S);if(J!=null)return E(s,S,v,null);if(typeof h=="function"){const j=_.div({class:`cms-container-slot-${S}`});return JSswift.reactive.effect(()=>{const U=on(JSswift.ui.slot(h(v)));j.replaceChildren(),Array.isArray(U)?U.forEach(ce=>b(j,ce)):b(j,U)},`UI.Container:${S}`),[j]}return E(s,S,v,h)},Z=r("content")?e.content:n!=null&&n.length?n:null,G=P("before",(g=e.before)!=null?g:e.top),ie=P("header",e.header),D=[...P("left",e.left),...P("start",e.start)],$=P("body",r("body")?e.body:null),Y=(()=>{const S=P("content",r("content")?e.content:null);return S.length?S:P("default",Z)})(),W=[...P("right",e.right),...P("end",e.end)],le=P("footer",e.footer),me=P("after",(F=e.after)!=null?F:e.bottom),re=G.length||ie.length||D.length||W.length||le.length||me.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,oe=!!re||$.length>0&&(JSswift.ui.getSlot(s,"body")!=null||re),se=()=>{var h;const S=String(l((h=e.layout)!=null?h:e.display)||"").trim().toLowerCase();return["flex","grid","stack"].includes(S)?S:["inline","inline-flex","inlineflex"].includes(S)||l(e.inline)?"inline":l(e.grid)||l(e.cols)!=null?"grid":S==="block"?"block":l(e.direction)!=null||l(e.wrap)!=null||l(e.align)!=null||l(e.justify)!=null||l(e.gap)!=null||D.length||W.length?"flex":"block"},te=qe([e.layout,e.display,e.inline,e.grid,e.cols,e.direction,e.wrap,e.align,e.justify,e.gap],()=>{const S=se();return S==="block"?"":`is-${S}`}),M={...o.style||{}},Q=(S,h)=>{h!=null&&(M[S]=h)};Q("maxWidth",qe([e.maxWidth,e.fluid],()=>l(e.fluid)?"none":u(l(e.maxWidth))||"")),Q("width",ze(e.width,u)),Q("minWidth",ze(e.minWidth,u)),Q("--cms-container-padding",ze(e.padding,i)),Q("--cms-container-padding-x",ze((X=e.paddingX)!=null?X:e.gutter,i)),Q("--cms-container-padding-y",ze(e.paddingY,i)),Q("--cms-container-gap",ze(e.gap,i)),Q("--cms-container-section-gap",ze((a=e.sectionGap)!=null?a:e.gap,i)),Q("--cms-container-cols",ze(e.cols,y)),Q("--cms-container-align",ze(e.align,S=>String(S))),Q("--cms-container-justify",ze(e.justify,S=>String(S))),Q("--cms-container-direction",ze(e.direction,S=>String(S))),Q("--cms-container-wrap",ze(e.wrap,R));const q=JSswift.omit(o,["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"]);q.class=ae(["cms-container",fe(e.fluid,"is-fluid"),fe(oe,"has-structure"),oe?"":te,o.class]),q.style=M,JSswift.uiApplyResponsiveProps(q,e,JSswift.uiResponsiveStyleRules);const ue=(S,h,J)=>h.length?_.div({class:ae(["cms-container-section",`cms-container-${S}`,J])},...h):null,L=$.length?_.div({class:ae(["cms-container-body",oe?te:"",e.bodyClass])},...$):D.length||Y.length||W.length?_.div({class:ae(["cms-container-body",oe?te:"",e.bodyClass])},ue("start",D,e.startClass),Y.length?_.div({class:ae(["cms-container-main",e.mainClass,e.contentClass])},...Y):null,ue("end",W,e.endClass)):null,f=(()=>{var h;const S=String(l((h=e.tag)!=null?h:e.as)||"div").toLowerCase();return typeof _[S]=="function"?_[S]:_.div})(),m=oe?f(q,ue("before",G,e.beforeClass),ue("header",ie,e.headerClass),L,ue("footer",le,e.footerClass),ue("after",me,e.afterClass)):f(q,...$.length?$:Y);return Ke(m,e),m},he.Card=(...t)=>{var ce,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e};Yt(o);const r=(d,N)=>{var I;return!!(d&&d.nodeType===1&&((I=d.classList)!=null&&I.contains(`cms-card-${N}`)))},u=(d=>d==null?null:typeof d=="string"?he.Icon({name:d,size:e.iconSize||e.size||"lg"}):JSswift.ui.slot(d,{as:"icon"}))(e.icon),i=e.image?_.img({src:e.image,alt:e.imageAlt||"",class:ae(["cms-card-cover-media",e.imageClass]),style:e.imageStyle}):e.cover,y={dense:!!l(e.dense),flat:!!l(e.flat),clickable:!!l(e.clickable),to:l(e.to)||null},R=E(s,"default",y,n!=null&&n.length?n:[]),v={identifier:[],cover:[],media:[],header:[],body:[],footer:[],actions:[]},b=[];R.forEach(d=>{r(d,"identifier")?v.identifier.push(d):r(d,"cover")?v.cover.push(d):r(d,"media")?v.media.push(d):r(d,"header")?v.header.push(d):r(d,"body")?v.body.push(d):r(d,"footer")?v.footer.push(d):r(d,"actions")?v.actions.push(d):b.push(d)});const P=E(s,"identifier",y,e.identifier),Z=E(s,"cover",y,i),G=E(s,"media",y,e.media),ie=E(s,"eyebrow",y,(ce=e.eyebrow)!=null?ce:e.kicker),D=E(s,"title",y,e.title),$=E(s,"subtitle",y,e.subtitle),Y=E(s,"header",y,e.header),W=E(s,"icon",y,u),le=E(s,"aside",y,(k=e.aside)!=null?k:e.headerAside),me=E(s,"body",y,e.body),re=E(s,"footer",y,e.footer),oe=E(s,"actions",y,e.actions),se=P.length?_.div({class:ae(["cms-card-identifier",e.identifierClass])},...P):null,te=Z.length?_.div({class:ae(["cms-card-cover",e.coverClass])},...Z):null,M=G.length?_.div({class:ae(["cms-card-media",e.mediaClass])},...G):null,q=W.length||ie.length||D.length||$.length||Y.length||le.length?_.div({class:ae(["cms-card-header",e.headerClass])},_.div({class:"cms-card-head"},W.length?_.div({class:"cms-card-icon"},...W):null,_.div({class:"cms-card-head-main"},ie.length?_.div({class:ae(["cms-card-eyebrow",e.eyebrowClass])},...ie):null,D.length?_.div({class:ae(["cms-card-title",e.titleClass])},...D):null,$.length?_.div({class:ae(["cms-card-subtitle",e.subtitleClass])},...$):null,Y.length?_.div({class:ae(["cms-card-header-content",e.headerContentClass])},...Y):null),le.length?_.div({class:ae(["cms-card-aside",e.asideClass])},...le):null)):null,ue=[...me,...b],L=ue.length?_.div({class:ae(["cms-card-body",e.bodyClass])},...ue):null,f=[...oe,...v.actions],m=re.length||f.length?_.div({class:ae(["cms-card-footer",e.footerClass])},...re,f.length?_.div({class:"cms-card-actions"},...f):null):null,g=qe([e.clickable,e.to],()=>l(e.clickable)||l(e.to)?"cms-card-clickable":""),F=P.length||v.identifier.length,X=Z.length||v.cover.length||G.length||v.media.length,a=JSswift.omit(o,["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=ae(["cms-panel","cms-card","cms-clear-set","cms-singularity",fe(e.flat,"cms-card-flat"),fe(e.dense,"cms-card-dense"),fe(F,"cms-card-has-identifier"),fe(X,"cms-card-has-top-visual"),g,o.class]),a.style={...o.style||{}},e.coverHeight!=null&&(a.style["--cms-card-cover-height"]=Be(l(e.coverHeight))),JSswift.uiApplyResponsiveProps(a,e,JSswift.uiResponsiveStyleRules);const S=e.onClick,h=e.onKeydown,J=d=>{var I;if(S==null||S(d),d.defaultPrevented)return;const N=l(e.to);N&&((I=JSswift.router)!=null&&I.navigate)&&(d.preventDefault(),JSswift.router.navigate(N))},j=d=>{h==null||h(d),!d.defaultPrevented&&(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),J(d))};(l(e.clickable)||l(e.to))&&(a.onClick=J,a.onKeydown=j,a.tabIndex==null&&(a.tabIndex=0),a.role==null&&(a.role="button"));const U=_.div(a,se,...v.identifier,te,...v.cover,M,...v.media,q,...v.header,L,...v.body,m,...v.footer);return Ke(U,e),U},he.Btn=(...t)=>{var te;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe([e.color,e.state],()=>{const M=l(e.color)||l(e.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(M)?M:l(e.state)||""}),r=ae(["cms-clear-set","cms-btn","cms-singularity","cms-clickable",o,fe(e.outline,"outline"),e.class]),C=JSswift.omit(e,["icon","iconRight","label","loading","loadingText","disabled","outline","iconAlign","slots","shortcode","shortcut","hotkey","showShortcode","showShortcut"]);C.class=r;const u=()=>!!l(e.loading),i=()=>!!l(e.disabled)||u(),y=e.icon!=null?typeof e.icon=="string"?he.Icon({name:e.icon}):e.icon:null,R=e.iconRight!=null?typeof e.iconRight=="string"?he.Icon({name:e.iconRight}):e.iconRight:null,v=JSswift.ui.renderSlot(s,"icon",{},y),b=JSswift.ui.renderSlot(s,"iconRight",{},R),P=JSswift.ui.renderSlot(s,"label",{},e.label),Z=E(s,"default",{},n),G=[],ie=M=>{M&&(Array.isArray(M)?G.push(...M):G.push(M))},D=e.iconAlign;(D==="after"||D==="right")&&!R?(ie(P),Z.length&&G.push(...Z),ie(v)):(ie(v),ie(P),Z.length&&G.push(...Z)),ie(b),ie(fs(e,{className:"cms-shortcode cms-btn-shortcode"})),G.length===0&&G.push(_.span("Button"));const Y=_.span({class:"cms-btn-loading",hidden:!0}),W=_.span({class:"cms-btn-content"},...G);let le=!1;const me=()=>{const M=he.Spinner?he.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 E(null,"default",{},JSswift.ui.renderSlot(s,"loading",{},M))},re=M=>{var f;if((f=e.onPointerDown)==null||f.call(e,M),i()||!(M!=null&&M.currentTarget))return;const Q=M.currentTarget,q=Q.getBoundingClientRect(),ue=typeof M.clientX=="number"?M.clientX-q.left:q.width/2,L=typeof M.clientY=="number"?M.clientY-q.top:q.height/2;Q.style.setProperty("--cms-burst-x",`${ue}px`),Q.style.setProperty("--cms-burst-y",`${L}px`),Q.classList.remove("cms-btn-burst"),Q.offsetWidth,Q.classList.add("cms-btn-burst")},oe=_.button({...C,disabled:i(),onClick:M=>{var Q,q;return i()?((Q=M==null?void 0:M.preventDefault)==null||Q.call(M),!1):(q=e.onClick)==null?void 0:q.call(e,M)},onPointerDown:re,"aria-disabled":i()?"true":null,"aria-busy":u()?"true":null},Y,W),se=JSswift.reactive.effect(()=>{const M=u(),Q=i();oe.disabled=Q,oe.classList.toggle("is-loading",M),oe.setAttribute("aria-disabled",Q?"true":"false"),M?oe.setAttribute("aria-busy","true"):oe.removeAttribute("aria-busy"),Y.hidden=!M,M!==le&&(Y.replaceChildren(...M?me():[]),le=M)},"UI.Btn:state");return(te=JSswift._registerCleanup)==null||te.call(JSswift,oe,se),Ke(oe,e),an(oe,e,{isEnabled:()=>!i(),action:()=>{if(i())return!1;oe.click()}}),oe},he.Button=he.Btn,JSswift.ui.Btn=he.Btn,JSswift.ui.Button=he.Button,he.FormField=(t={})=>{var oe,se,te,M,Q,q,ue;Yt(t);const e=t.slots||{},n=qe([t.color,t.state],()=>{const L=l(t.color)||l(t.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(L)?L:l(t.state)||""}),s=_.div({class:ae(["cms-clear-field-set","cms-field","cms-singularity-field",n,fe(t.fill,"cms-field-fill"),fe(t.outline,"outline"),t.wrapClass,t.class])}),o=E(e,"topLabel",{},t.topLabel);o.length&&s.appendChild(_.div({class:"cms-field-label"},...o));const r=t.multi||t.multiple,C=typeof t.control=="function"?t.control():t.control,u=()=>{if(typeof t.hasValue=="function")return!!t.hasValue();if(t.hasValue!=null)return!!l(t.hasValue);const L=t.getValue?t.getValue():null;return!(L==null||L==="")},i=()=>JSswift.reactive.untracked(u),y=()=>{var L,f;t.disabled||t.readonly||((L=t.onClear)==null||L.call(t),(f=t.onFocus)==null||f.call(t))},R=JSswift.ui.renderSlot(e,"control",{control:C,clear:y,disabled:!!t.disabled,readonly:!!t.readonly,hasValue:i()},null);let v=null,b=null;if(R)v=Array.isArray(R)?_.div({class:"cms-control"},...R):R;else{v=_.div({class:"cms-control"});const L=_.div({class:"cms-addon cms-addon-left"}),f=t.icon!=null?typeof t.icon=="string"?he.Icon({name:t.icon}):t.icon:null,m=JSswift.ui.renderSlot(e,"icon",{},f),g=JSswift.ui.renderSlot(e,"prefix",{},t.prefix);E(null,"default",{},m).forEach(k=>L.appendChild(k)),E(null,"default",{},g).forEach(k=>L.appendChild(k)),L.childNodes.length&&v.appendChild(L);const F=_.div({class:"cms-mid"+(L.childNodes.length>0?" cms-with-left":""),style:{position:"relative",flex:"1",minWidth:"0"}});C&&F.appendChild(C);const X=E(e,"label",{},t.label);if(X.length){const k=_.div({class:ae(["cms-float-label",fe(r,"cms-multiselect")])},...X);F.appendChild(k)}v.appendChild(F);const a=t.clearable?_.div({class:"cms-clear",title:"Clear",onClick:y},he.Icon({name:"close"})):null,S=JSswift.ui.renderSlot(e,"clear",{disabled:!!t.disabled,readonly:!!t.readonly,hasValue:i()},a);S&&(S.onclick=k=>{k.stopPropagation(),y()},E(null,"default",{},S).forEach(k=>v.appendChild(k))),b=a,b&&((oe=t.clearable)!=null&&oe.action)&&t.clearable.action(k=>k?b.classList.remove("cms-d-none"):b.classList.add("cms-d-none"));const h=_.div({class:"cms-addon cms-addon-right"}),J=t.iconRight!=null?typeof t.iconRight=="string"?he.Icon({name:t.iconRight}):t.iconRight:null,j=JSswift.ui.renderSlot(e,"iconRight",{},J),U=JSswift.ui.renderSlot(e,"suffix",{},t.suffix),ce=JSswift.ui.renderSlot(e,"shortcode",{props:t},fs(t,{className:"cms-shortcode cms-field-shortcode"}));E(null,"default",{},U).forEach(k=>h.appendChild(k)),E(null,"default",{},j).forEach(k=>h.appendChild(k)),E(null,"default",{},ce).forEach(k=>h.appendChild(k)),h.childNodes.length&&(v.appendChild(h),F.classList.add("cms-with-right"))}const P=L=>L&&(L&&typeof L.action=="function"?L.value:Array.isArray(L)&&typeof L[0]=="function"?L[0]():typeof L=="function"?L():L),Z=L=>L==null||L===!1||L===""?!1:Array.isArray(L)?L.length>0:!0;let G=null;const ie=()=>{const L=[{key:"error",value:P(t.error),slot:"errorMessage",className:"cms-error"},{key:"warning",value:P(t.warning),slot:"warning",className:"cms-warning"},{key:"success",value:P(t.success),slot:"success",className:"cms-success"},{key:"note",value:P(t.note),slot:"note",className:"cms-note"},{key:"hint",value:P(t.hint),slot:"hint",className:"cms-hint"}];let f=null;for(const a of L)if(Z(a.value)){f=a;break}const m={error:L[0].value,warning:L[1].value,success:L[2].value,note:L[3].value,hint:L[4].value,props:t},g=f?E(e,f.slot,m,f.value):[],F=g.length?_.div({class:f==null?void 0:f.className},...g):null;["error","warning","success","note"].forEach(a=>{var S;return(S=v==null?void 0:v.classList)==null?void 0:S.toggle(a,(f==null?void 0:f.key)===a)}),G?F?G.replaceWith(F):G.remove():F&&s.appendChild(F),G=F},D=()=>{var f;const L=u();(f=v==null?void 0:v.classList)==null||f.toggle("has-value",L),b&&(b.style.display=L?"":"none")};JSswift.reactive.untracked(D),(se=v==null?void 0:v.classList)==null||se.toggle("disabled",!!t.disabled),s.appendChild(v);const $=JSswift.ui.getSlot(e,"errorMessage"),Y=JSswift.ui.getSlot(e,"warning"),W=JSswift.ui.getSlot(e,"success"),le=JSswift.ui.getSlot(e,"note"),me=JSswift.ui.getSlot(e,"hint");return!!((te=t.error)!=null&&te.action||(M=t.warning)!=null&&M.action||(Q=t.success)!=null&&Q.action||(q=t.note)!=null&&q.action||(ue=t.hint)!=null&&ue.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 $=="function"||typeof Y=="function"||typeof W=="function"||typeof le=="function"||typeof me=="function"?JSswift.reactive.effect(()=>{ie()},"UI.FormField:message"):ie(),s._refresh=D,s._control=v,s._el=C,s},he.InputRaw=(t={})=>{var R;const e=_.input({class:ae(["cms-input-raw",t.class]),type:t.type||"text",name:t.name,placeholder:t.placeholder,autocomplete:t.autocomplete,value:t.value});let n=(R=e.value)!=null?R:"";const s=()=>{var b;const v=(b=e.value)!=null?b:"";v!==n&&(n=v,e.dispatchEvent(new Event("input",{bubbles:!0})),e.dispatchEvent(new Event("change",{bubbles:!0})))};let o=null,r=!1;const C=()=>{if(r)return;r=!0;let v=0;const b=()=>{if(s(),v+=1,v>=10){r=!1;return}setTimeout(b,120)};setTimeout(b,40)},u=()=>{o||(o=setInterval(()=>{if(document.activeElement!==e){clearInterval(o),o=null;return}s()},250))},i=()=>{o&&(clearInterval(o),o=null)};e.addEventListener("input",()=>{var v;n=(v=e.value)!=null?v:""}),e.addEventListener("change",()=>{var v;n=(v=e.value)!=null?v:""}),e.addEventListener("animationstart",v=>{v.animationName==="cms-autofill"&&(s(),u(),C())}),e.addEventListener("focus",()=>{u(),C(),setTimeout(s,50)}),e.addEventListener("blur",()=>{i(),setTimeout(s,0)}),setTimeout(s,0),C();const y=t.model;if(y){if(typeof y=="object"&&typeof y._bind=="function")He.rodModel(e,y);else if(Array.isArray(y)&&typeof y[0]=="function"&&typeof y[1]=="function"){const v=He.rodFromSignal(y[0],y[1]);He.rodModel(e,v)}}return an(e,t,{isEnabled:()=>!e.disabled,action:()=>hn(e,{selectText:!!t.selectOnShortcode})}),e},he.Input=(t={})=>{var G,ie,D;const e=t.slots||{},n={...t,label:(G=t.label)!=null?G:t.placeholder},s=_.input({class:ae(["cms-input",t.class]),type:t.type||"text",name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,value:(ie=t.value)!=null?ie:"",disabled:!!t.disabled,readOnly:!!t.readonly});let o=(D=s.value)!=null?D:"";const r=()=>{var Y;const $=(Y=s.value)!=null?Y:"";$!==o&&(o=$,s.dispatchEvent(new Event("input",{bubbles:!0})),s.dispatchEvent(new Event("change",{bubbles:!0})))};let C=null,u=!1;const i=()=>{if(u)return;u=!0;let $=0;const Y=()=>{if(r(),$+=1,$>=10){u=!1;return}setTimeout(Y,120)};setTimeout(Y,40)},y=()=>{C||(C=setInterval(()=>{if(document.activeElement!==s){clearInterval(C),C=null;return}r()},250))},R=()=>{C&&(clearInterval(C),C=null)};s.addEventListener("input",()=>{var $,Y;o=($=s.value)!=null?$:"",(Y=t.onInput)==null||Y.call(t,s.value)}),s.addEventListener("change",()=>{var $,Y;o=($=s.value)!=null?$:"",(Y=t.onChange)==null||Y.call(t,s.value)}),s.addEventListener("focus",$=>{var Y;(Y=t.onFocus)==null||Y.call(t,$),y(),i(),setTimeout(r,50)}),s.addEventListener("blur",$=>{var Y;(Y=t.onBlur)==null||Y.call(t,$),R(),setTimeout(r,0)}),s.addEventListener("animationstart",$=>{$.animationName==="cms-autofill"&&(r(),y(),i())}),setTimeout(r,0),i();const v=t.model;if(v){const $=Y=>{let W=!1;const le=re=>{const oe=re!=null?re:"";s.value!==oe&&(s.value=oe,o=oe)};Y.action(re=>{if(!W){W=!0;try{le(re)}finally{W=!1}}}),JSswift.reactive.untracked(()=>le(Y.value));const me=re=>{if(W||re!=null&&re.isComposing)return;const oe=s.value;if(Y.value!==oe){W=!0;try{Y.value=oe}finally{W=!1}}};s.addEventListener("input",me),s.addEventListener("compositionend",me),typeof Y.onDispose=="function"&&Y.onDispose(()=>{s.removeEventListener("input",me),s.removeEventListener("compositionend",me)})};if(typeof v=="object"&&typeof v._bind=="function")$(v);else if(Array.isArray(v)&&typeof v[0]=="function"&&typeof v[1]=="function"){const Y=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(v[0],v[1]));$(Y)}}const b=JSswift.ui.renderSlot(e,"input",{input:s,props:t},s),P=Array.isArray(b)?_.div({style:{display:"contents"}},...b):b,Z=he.FormField({...n,control:P,getValue:()=>s.value,onClear:()=>{s.disabled||s.readOnly||(s.value="",s.dispatchEvent(new Event("input",{bubbles:!0})))},onFocus:()=>s.focus()});return s.addEventListener("input",()=>{var $;return($=Z._refresh)==null?void 0:$.call(Z)}),s.addEventListener("change",()=>{var $;return($=Z._refresh)==null?void 0:$.call(Z)}),Z._input=s,an(s,t,{isEnabled:()=>!s.disabled,action:()=>hn(s,{selectText:!!t.selectOnShortcode})}),Z},he.Textarea=(t={})=>{var y,R,v,b;const e=t.slots||{},n={...t,label:(y=t.label)!=null?y:t.placeholder,wrapClass:ae(["cms-textarea-field",t.wrapClass])},s=_.textarea({class:ae(["cms-input","cms-textarea",t.class]),name:t.name,autocomplete:t.autocomplete,inputmode:t.inputmode,rows:t.rows,cols:t.cols,maxLength:(R=t.maxLength)!=null?R:t.maxlength,minLength:(v=t.minLength)!=null?v:t.minlength,wrap:t.wrap,value:(b=t.value)!=null?b:"",disabled:!!t.disabled,readOnly:!!t.readonly});s.addEventListener("input",()=>{var P;(P=t.onInput)==null||P.call(t,s.value)}),s.addEventListener("change",()=>{var P;(P=t.onChange)==null||P.call(t,s.value)}),s.addEventListener("focus",P=>{var Z;(Z=t.onFocus)==null||Z.call(t,P)}),s.addEventListener("blur",P=>{var Z;(Z=t.onBlur)==null||Z.call(t,P)});const o=t.model;if(o){const P=Z=>{let G=!1;const ie=$=>{const Y=$!=null?$:"";s.value!==Y&&(s.value=Y)};Z.action($=>{if(!G){G=!0;try{ie($)}finally{G=!1}}}),JSswift.reactive.untracked(()=>ie(Z.value));const D=$=>{if(G||$!=null&&$.isComposing)return;const Y=s.value;if(Z.value!==Y){G=!0;try{Z.value=Y}finally{G=!1}}};s.addEventListener("input",D),s.addEventListener("compositionend",D),typeof Z.onDispose=="function"&&Z.onDispose(()=>{s.removeEventListener("input",D),s.removeEventListener("compositionend",D)})};if(typeof o=="object"&&typeof o._bind=="function")P(o);else if(Array.isArray(o)&&typeof o[0]=="function"&&typeof o[1]=="function"){const Z=JSswift.reactive.untracked(()=>JSswift.rodFromSignal(o[0],o[1]));P(Z)}}const r=JSswift.ui.getSlot(e,"textarea")!=null?"textarea":"input",C=JSswift.ui.renderSlot(e,r,{textarea:s,input:s,props:t},s),u=Array.isArray(C)?_.div({style:{display:"contents"}},...C):C,i=he.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 P;return(P=i._refresh)==null?void 0:P.call(i)}),s.addEventListener("change",()=>{var P;return(P=i._refresh)==null?void 0:P.call(i)}),i._input=s,i._textarea=s,an(s,t,{isEnabled:()=>!s.disabled,action:()=>hn(s,{selectText:!!t.selectOnShortcode})}),i},he.Search=(t={})=>{var z,we;const e=t.slots||{},n=T=>!!T&&(typeof T=="object"&&typeof T._bind=="function"||At(T)),s=n(t.model)?t.model:n(t.value)?t.value:null,o=s?typeof s=="object"&&typeof s._bind=="function"?s.value:s[0]():l(t.value),[r,C]=JSswift.reactive.signal(o==null?"":String(o)),[u,i]=JSswift.reactive.signal(!1),[y,R]=JSswift.reactive.signal(!1),[v,b]=JSswift.reactive.signal(null),[P,Z]=JSswift.reactive.signal([]),[G,ie]=JSswift.reactive.signal(-1),D=`cms-search-${Math.random().toString(36).slice(2,10)}`,$=new Map;let Y=null,W=null,le=null,me=0,re=0,oe=!1,se=-1,te=[];const M=(T,x)=>{const w=Number(l(T));return Number.isFinite(w)?w:x},Q=(T,x=!1)=>{const w=l(T);return w==null?x:!!w},q=()=>Q(t.disabled,!1),ue=()=>Q(t.readonly,!1),L=()=>Math.max(0,M(t.minLength,t.endpoint?1:0)),f=()=>Math.max(0,M(t.debounce,250)),m=T=>{var w,c,A,de,Le;const x=t.getLabel||t.labelOf;return typeof x=="function"?x(T):T==null?"":typeof T=="string"||typeof T=="number"?String(T):(Le=(de=(A=(c=(w=T.label)!=null?w:T.title)!=null?c:T.name)!=null?A:T.text)!=null?de:T.value)!=null?Le:""},g=T=>{var w,c,A;const x=t.getValue||t.valueOf;return typeof x=="function"?x(T):T==null?"":typeof T=="string"||typeof T=="number"?T:(A=(c=(w=T.value)!=null?w:T.id)!=null?c:T.key)!=null?A:m(T)},F=T=>Array.isArray(T)?T:!T||typeof T!="object"?[]:Array.isArray(T.items)?T.items:Array.isArray(T.results)?T.results:Array.isArray(T.data)?T.data:[],X=async(T,x)=>{const w=typeof T=="function"?T(x,{props:t}):l(T);return w&&typeof w.then=="function"?await w:w},a=(T,x)=>{const w=typeof T=="function"?T(x,{props:t}):l(T);if(!w)return"";const c=String(w),A=new URL(c,window.location.href),de=l(t.queryParam)||"q";de&&A.searchParams.set(de,x);const Le=typeof t.params=="function"?t.params(x,{props:t}):l(t.params);return Le&&typeof Le=="object"&&Object.keys(Le).forEach(Je=>{const B=l(Le[Je]);B==null||B===!1||A.searchParams.set(Je,String(B))}),A.toString()},S=(T,x={})=>{var c,A;const w=T==null?"":String(T);r()!==w&&C(w),ee.value!==w&&(ee.value=w),Y&&!x.fromModel&&Y(w),x.fromModel||(c=t.onInput)==null||c.call(t,w,x.event),(A=pe==null?void 0:pe._refresh)==null||A.call(pe)},h=()=>{i(!1),ie(-1)},J=()=>y()||v()||P().length?!0:r().trim().length>=L()?!!(t.emptyText||JSswift.ui.getSlot(e,"empty")!=null):!!(t.startText||JSswift.ui.getSlot(e,"empty")!=null),j=()=>{q()||J()&&(i(!0),Se())},U=()=>{Z([]),b(null),ie(-1)},ce=async(T,x={})=>{var B,Ae,Me,Ee,De,Ue;const w=T==null?"":String(T).trim(),c=++me,A=l((B=t.endpoint)!=null?B:t.url),de=(Me=(Ae=t.items)!=null?Ae:t.options)!=null?Me:t.suggestions;if(le&&(le.abort(),le=null),w.length<L()){R(!1),U(),x.open&&J()?j():J()||h();return}const Le=t.cache!==!1,Je=`${A||"local"}::${w}`;if(Le&&$.has(Je)){Z($.get(Je)),b(null),R(!1),ie($.get(Je).length?0:-1),x.open!==!1&&j();return}R(!0),b(null),x.open!==!1&&j(),(Ee=t.onSearch)==null||Ee.call(t,w);try{let Ye;if(A){le=new AbortController;const Te=a(A,w),je=await fetch(Te,{method:"GET",headers:t.headers,credentials:t.credentials,signal:le.signal});if(!je.ok)throw new Error(`Search request failed (${je.status})`);Ye=await(t.parseResponse||(nt=>nt.json()))(je)}else if(de!=null){const Te=F(await X(de,w)),je=t.filter||((tt,nt)=>String(m(tt)).toLowerCase().includes(nt.toLowerCase()));Ye=Te.filter(tt=>je(tt,w))}else Ye=[];if(c!==me)return;const Ze=typeof t.mapResponse=="function"?t.mapResponse(Ye,w):F(Ye),Qe=F(Ze);Le&&$.set(Je,Qe),Z(Qe),ie(Qe.length?0:-1),(De=t.onResults)==null||De.call(t,Qe,w)}catch(Ye){if((Ye==null?void 0:Ye.name)==="AbortError"||c!==me)return;b(Ye),Z([]),ie(-1),(Ue=t.onError)==null||Ue.call(t,Ye,w)}finally{c===me&&(R(!1),le=null,Se())}},k=(T,x={})=>{W&&clearTimeout(W);const w=x.immediate?0:f();W=setTimeout(()=>{W=null,ce(T,x)},w)},d=T=>{var w;const x=r();(w=t.onSubmit)==null||w.call(t,x,T),t.submitOnEnter!==!1&&k(x,{immediate:!0,open:!0})},N=(T,x)=>{var A;if(!T)return;const w=g(T),c=m(T);t.commitValue==="value"?S(w,{event:x}):t.commitValue!==!1&&S(c,{event:x}),(A=t.onSelect)==null||A.call(t,T,{value:w,label:c,query:r(),event:x}),t.closeOnSelect!==!1&&h()},I=T=>{const x=P();if(!x.length)return;const w=G(),c=w<0?T>0?0:x.length-1:Math.max(0,Math.min(x.length-1,w+T));ie(c)},H=T=>{const x=T==null?"":String(T),w=r().trim();if(!w||t.highlight===!1)return[document.createTextNode(x)];const c=x.toLowerCase().indexOf(w.toLowerCase());return c<0?[document.createTextNode(x)]:[document.createTextNode(x.slice(0,c)),_.mark({class:"cms-search-highlight"},x.slice(c,c+w.length)),document.createTextNode(x.slice(c+w.length))]},ge=T=>{var c,A;const x=m(T),w=T&&typeof T=="object"?(A=(c=T.description)!=null?c:T.subtitle)!=null?A:T.note:null;return _.div({class:"cms-search-result-content"},_.div({class:"cms-search-result-label"},...H(x)),w?_.div({class:"cms-search-result-description"},String(w)):null)},Se=()=>{!u()||be.parentNode!==document.body||re||(re=requestAnimationFrame(()=>{if(re=0,!u()||!Ce.isConnected||be.parentNode!==document.body)return;const T=Ce.getBoundingClientRect(),x=6,w=8,c=Math.max(180,window.innerWidth-w*2),A=Math.min(Math.max(T.width,M(t.minMenuWidth,260)),c),de=Math.max(w,Math.min(T.left,window.innerWidth-A-w));be.style.width=`${A}px`,be.style.left=`${de}px`,be.style.right="auto";const Le=be.getBoundingClientRect().height||0,Je=window.innerHeight-T.bottom-x-w,B=T.top-x-w;let Me=Je<180&&B>Je?T.top-x-Le:T.bottom+x;Me=Math.max(w,Math.min(Me,window.innerHeight-Le-w)),be.style.top=`${Me}px`}))},ye=()=>{oe||(oe=!0,window.addEventListener("resize",Se),window.addEventListener("scroll",Se,!0))},V=()=>{oe&&(oe=!1,window.removeEventListener("resize",Se),window.removeEventListener("scroll",Se,!0))},O=()=>{be.parentNode!==document.body&&(re&&(cancelAnimationFrame(re),re=0),be.classList.add("portal"),be.style.display="block",document.body.appendChild(be),ye(),Se())},K=()=>{re&&(cancelAnimationFrame(re),re=0),V(),be.parentNode!==Ce&&Ce.appendChild(be),be.classList.remove("portal"),be.style.display="",be.style.position="",be.style.top="",be.style.left="",be.style.right="",be.style.width=""},ke=t.label!=null||JSswift.ui.getSlot(e,"label")!=null,Ne=()=>{if(!ke){ee.placeholder=l(t.placeholder)||"";return}ee.placeholder=document.activeElement===ee&&l(t.placeholder)||""},ee=_.input({id:t.id,class:ae(["cms-input","cms-search-input",t.inputClass]),type:"search",name:t.name,placeholder:ke?"":t.placeholder,autocomplete:t.autocomplete||"off",inputmode:t.inputmode,value:r(),disabled:q(),readOnly:ue(),role:"combobox","aria-autocomplete":"list","aria-expanded":"false","aria-controls":`${D}-list`}),xe=_.div({id:`${D}-list`,class:"cms-search-results",role:"listbox"}),be=_.div({class:ae(["cms-search-menu","cms-singularity-menu-select",t.menuClass,fe(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:T=>T.stopPropagation()},xe),Ce=_.div({class:ae(["cms-search",t.class]),role:"presentation"},ee,be);let pe=null;if(s){if(typeof s=="object"&&typeof s._bind=="function")s.action(T=>S(T,{fromModel:!0})),Y=T=>{s.value!==T&&(s.value=T)};else if(Array.isArray(s)&&typeof s[0]=="function"&&typeof s[1]=="function"){const T=s[0],x=s[1];JSswift.reactive.effect(()=>{S(T(),{fromModel:!0})},"UI.Search:model"),Y=w=>x(w)}}else at(t.value)&&JSswift.reactive.effect(()=>{S(l(t.value),{fromModel:!0})},"UI.Search:value");ee.addEventListener("input",T=>{S(ee.value,{event:T}),t.searchOnInput!==!1&&k(ee.value,{open:!0})}),ee.addEventListener("change",T=>{var x;return(x=t.onChange)==null?void 0:x.call(t,ee.value,T)}),ee.addEventListener("focus",T=>{var x;Ne(),(x=t.onFocus)==null||x.call(t,T),t.openOnFocus!==!1&&(t.searchOnFocus&&!P().length?k(ee.value,{immediate:!0,open:!0}):j())}),ee.addEventListener("blur",T=>{var x;Ne(),(x=t.onBlur)==null||x.call(t,T)}),ee.addEventListener("keydown",T=>{if(q()||ue())return;const x=u(),w=P(),c=G();if(T.key==="Escape"){x&&(T.preventDefault(),h());return}if(T.key==="ArrowDown"){T.preventDefault(),x?I(1):(j(),w.length||k(ee.value,{immediate:!0,open:!0}));return}if(T.key==="ArrowUp"){T.preventDefault(),x?I(-1):j();return}if(T.key==="Home"&&x&&w.length&&(T.metaKey||T.ctrlKey)){T.preventDefault(),ie(0);return}if(T.key==="End"&&x&&w.length&&(T.metaKey||T.ctrlKey)){T.preventDefault(),ie(w.length-1);return}T.key==="Enter"&&(x&&c>=0&&w[c]?(T.preventDefault(),N(w[c],T)):d(T))});const Ie=T=>{if(!Ce.isConnected)return;const x=T.target;Ce.contains(x)||be.contains(x)||h()};document.addEventListener("click",Ie,!0),JSswift.reactive.effect(()=>{const T=u();Ce.classList.toggle("open",T),ee.setAttribute("aria-expanded",T?"true":"false"),T?O():K()},"UI.Search:open"),JSswift.reactive.effect(()=>{const T=q(),x=ue();Ce.classList.toggle("disabled",T),Ce.classList.toggle("readonly",x),ee.disabled=T,ee.readOnly=x},"UI.Search:disabled"),JSswift.reactive.effect(()=>{const T=y(),x=v(),w=P(),c=r();if(xe.innerHTML="",te=[],se=-1,T){const A=JSswift.ui.renderSlot(e,"loading",{query:c},t.loadingText||"Caricamento...");xe.appendChild(_.div({class:"cms-search-empty is-loading"},...E(null,"default",{},A)))}else if(x){const A=JSswift.ui.renderSlot(e,"error",{error:x,query:c},t.errorText||"Errore ricerca");xe.appendChild(_.div({class:"cms-search-empty is-error"},...E(null,"default",{},A)))}else if(w.length)w.forEach((A,de)=>{const Je=m(A),B=g(A),Ae=De=>N(A,De),Me=JSswift.ui.renderSlot(e,"result",{item:A,index:de,active:!1,label:Je,value:B,query:c,select:Ae},ge(A)),Ee=_.div({id:`${D}-result-${de}`,class:ae(["cms-search-result",""]),role:"option","aria-selected":"false",onMouseEnter:()=>ie(de),onMouseDown:De=>De.preventDefault(),onClick:Ae},...E(null,"default",{},Me));xe.appendChild(Ee),te[de]=Ee});else{const de=c.trim().length>=L()?t.emptyText||"Nessun risultato":t.startText||"",Le=JSswift.ui.renderSlot(e,"empty",{query:c},de);(de||JSswift.ui.getSlot(e,"empty")!=null)&&xe.appendChild(_.div({class:"cms-search-empty"},...E(null,"default",{},Le)))}J()||h(),Se()},"UI.Search:render"),JSswift.reactive.effect(()=>{const T=G();T!==se&&(te[se]&&(te[se].classList.remove("active"),te[se].setAttribute("aria-selected","false")),te[T]?(te[T].classList.add("active"),te[T].setAttribute("aria-selected","true"),te[T].scrollIntoView({block:"nearest"}),ee.setAttribute("aria-activedescendant",`${D}-result-${T}`)):ee.removeAttribute("aria-activedescendant"),se=T)},"UI.Search:active"),pe=he.FormField({...t,icon:(z=t.icon)!=null?z:"search",wrapClass:ae(["cms-search-field",t.wrapClass]),control:Ce,getValue:()=>r(),onClear:()=>{var T;q()||ue()||(S("",{}),U(),(T=t.onClear)==null||T.call(t))},onFocus:()=>ee.focus()}),ee.addEventListener("input",()=>{var T;return(T=pe._refresh)==null?void 0:T.call(pe)}),ee.addEventListener("change",()=>{var T;return(T=pe._refresh)==null?void 0:T.call(pe)}),pe._input=ee,pe._search=Ce,pe._open=j,pe._close=h,pe._searchNow=()=>ce(r(),{immediate:!0,open:!0}),pe._getResults=P,pe._setValue=T=>S(T,{});let _e=!1;return pe._dispose=()=>{_e||(_e=!0,document.removeEventListener("click",Ie,!0),W&&clearTimeout(W),le&&le.abort(),K())},(we=JSswift._registerCleanup)==null||we.call(JSswift,pe,pe._dispose),an(ee,t,{isEnabled:()=>!ee.disabled,action:()=>hn(ee,{selectText:!!t.selectOnShortcode})}),(t.autoSearch||t.searchOnMount)&&k(r(),{immediate:!0,open:!1}),pe},he.Select=(t={})=>{var we,T;const e={...t,label:(we=t.label)!=null?we:t.placeholder},n=t.filterable,s=!!t.multiple||!!t.multi,o=!!t.allowCustom||!!t.allowCustomValue,r=t.slots||{},C=x=>!!x&&(typeof x=="object"&&typeof x._bind=="function"||At(x)),u=C(t.model)?t.model:C(t.value)?t.value:null,i=x=>Array.isArray(x)?x.slice():x==null||x===""?[]:[x],y=x=>s?i(x):x,R=u?JSswift.reactive.untracked(()=>typeof u=="object"&&typeof u._bind=="function"?u.value:u[0]()):t.value,[v,b]=JSswift.reactive.signal(!1),[P,Z]=JSswift.reactive.signal(""),[G,ie]=JSswift.reactive.signal(s?i(R):R!=null?R:""),[D,$]=JSswift.reactive.signal(!1),[Y,W]=JSswift.reactive.signal([]),[le,me]=JSswift.reactive.signal([]),[re,oe]=JSswift.reactive.signal(-1);let se=null;if(u){if(typeof u=="object"&&typeof u._bind=="function")JSswift.reactive.untracked(()=>ie(y(u.value))),u.action(x=>ie(y(x))),se=x=>{const w=y(x);u.value!==w&&(u.value=w)};else if(Array.isArray(u)&&typeof u[0]=="function"&&typeof u[1]=="function"){const x=u[0],w=u[1];JSswift.reactive.untracked(()=>{JSswift.reactive.effect(()=>{ie(y(x()))},"UI.Select:model")}),se=c=>w(y(c))}}function te(){var x;return typeof t.disabled=="function"?t.disabled():typeof t.disabled=="boolean"?t.disabled:(x=t==null?void 0:t.disabled)!=null&&x.action?t.disabled.value:!1}function M(x){var w,c,A,de;if(x==null)return null;if(typeof x=="string"||typeof x=="number")return{type:"option",label:String(x),value:x,disabled:!1};if(typeof x=="object"){if(Array.isArray(x.options))return{type:"group",label:String((w=x.label)!=null?w:""),options:x.options};const Le=(c=x.label)!=null?c:x.value!=null?String(x.value):"";return{type:"option",label:String(Le),value:(de=(A=x.value)!=null?A:x.label)!=null?de:"",disabled:!!x.disabled}}return{type:"option",label:String(x),value:x,disabled:!1}}function Q(x){const c=(Array.isArray(x)?x:[]).map(M).filter(Boolean),A=[],de=[];for(const Le of c)if(Le.type==="group"){A.push({type:"group",label:Le.label});const Je=(Le.options||[]).map(M).filter(Boolean).filter(B=>B.type==="option");for(const B of Je)A.push(B),de.push(B)}else A.push(Le),de.push(Le);W(A),me(de)}async function q(){const x=t.options;let w;try{const c=typeof x=="function"?JSswift.ui.withoutRodPathCapture(()=>x()):x;c&&typeof c.then=="function"?($(!0),w=await c):w=c,Q(w)}catch(c){console.error("[UI.Select] options load error:",c),Q([])}finally{$(!1)}}function ue(x){var c;const w=y(x);ie(w),se&&se(w),(c=t.onChange)==null||c.call(t,w)}function L(x){const w=i(G()),A=w.some(de=>de==x)?w.filter(de=>de!=x):[...w,x];ue(A)}function f(x,w=!1){s?(L(x),w&&m()):(ue(x),g())}function m(){Z(""),ce&&(ce.value="")}function g(){b(!1),m(),oe(-1)}async function F(){if(te())return;b(!0),await q();const x=G(),w=le();let c=-1;if(s){const A=i(x);for(const de of A)if(c=w.findIndex(Le=>Le.value==de&&!Le.disabled),c>=0)break}else c=w.findIndex(A=>A.value==x&&!A.disabled);c<0&&(c=w.findIndex(A=>!A.disabled)),oe(c),ce&&setTimeout(()=>ce.focus(),0)}function X(){v()?g():F()}const a=_.div({class:ae(["cms-select",s?"multiple":"",t.class]),tabIndex:te()?-1:0,role:"combobox","aria-expanded":"false","aria-disabled":te()?"true":"false"}),S=_.div({class:ae(["cms-select-value",s?"cms-select-value-multi":""])});JSswift.reactive.effect(()=>{const x=le();if(S.innerHTML="",s){const w=i(G());for(const c of w){const A=x.find(B=>B.value==c),de=A?A.label:c==null?"":String(c);let Le=!1;const Je=he.Chip({label:de,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:B=>{var Ae,Me,Ee;(Ae=B==null?void 0:B.preventDefault)==null||Ae.call(B),(Me=B==null?void 0:B.stopPropagation)==null||Me.call(B),(Ee=B==null?void 0:B.stopImmediatePropagation)==null||Ee.call(B),!Le&&(Le=!0,L(c))}});S.appendChild(Je)}}else{const w=G(),c=x.find(A=>A.value==w);S.textContent=c?c.label:w==null||w===""?"":String(w)}},"UI.Select:value");const h=_.div({class:"cms-select-arrow"});JSswift.reactive.effect(()=>{const x=JSswift.ui.renderSlot(r,"arrow",{open:v()},he.Icon("#chevron-down"));h.innerHTML="",E(null,"default",{},x).forEach(w=>h.appendChild(w))},"UI.Select:arrow");const J=_.div({class:"cms-select-control",onClick:X},S,h),j=_.div({class:"cms-select-options",role:"listbox","aria-multiselectable":s?"true":"false"}),U=_.div({class:"cms-select-filter cms-d-none"});let ce=null;const k=_.input({class:"cms-input",type:"text",placeholder:t.filterPlaceholder||"Cerca...",onInput:x=>Z(x.target.value||"")}),d=()=>{const x=JSswift.ui.renderSlot(r,"filter",{value:P(),setValue:c=>{const A=c==null?"":String(c);Z(A),ce&&"value"in ce&&(ce.value=A)},close:g},k);U.innerHTML="";const w=E(null,"default",{},x);w.forEach(c=>U.appendChild(c)),ce=w.length===1&&w[0]&&w[0].tagName==="INPUT"?w[0]:null,ce&&(ce.value=P()||"")};JSswift.reactive.untracked(d),JSswift.reactive.effect(()=>{const x=P()||"";ce&&"value"in ce&&ce.value!==x&&(ce.value=x)},"UI.Select:filterValue"),typeof n=="boolean"?n?U.classList.remove("cms-d-none"):U.classList.add("cms-d-none"):n!=null&&n.action&&(n.action(x=>{x?U.classList.remove("cms-d-none"):U.classList.add("cms-d-none")}),n.value?U.classList.remove("cms-d-none"):U.classList.add("cms-d-none"));const N={...t};Yt(N);const I=qe([N.color,N.state],()=>{const x=l(N.color)||l(N.state)||"";return["primary","secondary","warning","danger","success","info","light","dark"].includes(x)?x:l(N.state)||""}),H=_.div({class:ae(["cms-select-menu","cms-singularity-menu-select",I,N.class,fe(t.fill,"cms-select-menu-fill")]),"data-cms-overlay-portal":"true",onClick:x=>x.stopPropagation()},U,j);let ge=0,Se=!1;const ye=()=>{!v()||H.parentNode!==document.body||ge||(ge=requestAnimationFrame(()=>{if(ge=0,!v()||!a.isConnected||H.parentNode!==document.body)return;const x=a.getBoundingClientRect(),w=6,c=8,A=Math.max(160,window.innerWidth-c*2),de=Math.min(Math.max(x.width,180),A),Le=Math.max(c,Math.min(x.left,window.innerWidth-de-c));H.style.width=`${de}px`,H.style.left=`${Le}px`,H.style.right="auto",H.style.marginTop="0";const Je=H.getBoundingClientRect().height||0,B=window.innerHeight-x.bottom-w-c,Ae=x.top-w-c;let Ee=B<180&&Ae>B?x.top-w-Je:x.bottom+w;Ee=Math.max(c,Math.min(Ee,window.innerHeight-Je-c)),H.style.top=`${Ee}px`}))},V=()=>{Se||(Se=!0,window.addEventListener("resize",ye),window.addEventListener("scroll",ye,!0))},O=()=>{Se&&(Se=!1,window.removeEventListener("resize",ye),window.removeEventListener("scroll",ye,!0))},K=()=>{H.parentNode!==document.body&&(ge&&(cancelAnimationFrame(ge),ge=0),H.classList.add("portal"),H.style.display="block",document.body.appendChild(H),V(),ye())},ke=()=>{ge&&(cancelAnimationFrame(ge),ge=0),O(),H.parentNode!==a&&a.appendChild(H),H.classList.remove("portal"),H.style.display="",H.style.position="",H.style.top="",H.style.left="",H.style.right="",H.style.width="",H.style.marginTop=""};a.appendChild(J),a.appendChild(H),JSswift.reactive.effect(()=>{const x=v();a.classList.toggle("open",x),a.setAttribute("aria-expanded",x?"true":"false"),x?K():ke()},"UI.Select:open"),JSswift.reactive.effect(()=>{const x=te();a.classList.toggle("disabled",x),a.tabIndex=x?-1:0,a.setAttribute("aria-disabled",x?"true":"false")},"UI.Select:disabled");let Ne=[],ee=-1,xe=-1;function be(){var w;const x=re();xe=x,x!==ee&&(Ne[ee]&&Ne[ee].classList.remove("active"),Ne[x]&&Ne[x].classList.add("active"),ee=x,x>=0&&((w=Ne[x])==null||w.scrollIntoView({block:"nearest"})))}JSswift.reactive.effect(()=>{const x=Y(),w=le(),c=(P()||"").toLowerCase().trim(),A=G(),de=s?i(A):[A],Le=D(),Je=xe;j.innerHTML="",Ne=[],ee=-1;const B=[];let Ae=0;const Me=Ee=>{const De=de.some(tt=>tt==Ee.value),Ue=!!Ee.disabled,Ye=["cms-select-option",De?"selected":"",Ue?"disabled":""].filter(Boolean).join(" "),Ze=()=>{s?L(Ee.value):(ue(Ee.value),g())},Qe=JSswift.ui.renderSlot(r,"option",{opt:Ee,selected:De,active:Ae===Je,disabled:Ue,select:Ze},Ee.label),Te=E(null,"default",{},Qe),je=_.div({class:Ye,"data-flat-index":String(Ae),onClick:Ue?null:Ze},...Te);B.push(je),Ne[Ae]=je,Ae++};if(c){const Ee=w.filter(De=>De.label.toLowerCase().includes(c));if(Ee.length===0){const De=JSswift.ui.renderSlot(r,"empty",{filter:c},t.emptyText||"Nessuna opzione");j.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},De))),v()&&ye();return}for(const De of Ee)Me(De)}else{let Ee=!1;for(const De of x)if(De.type==="group"){const Ue=JSswift.ui.renderSlot(r,"group",{label:De.label},De.label);B.push(_.div({class:"cms-select-group"},...E(null,"default",{},Ue)))}else Ee=!0,Me(De);if(!Ee){const De=JSswift.ui.renderSlot(r,"empty",{filter:c},t.emptyText||"Nessuna opzione");j.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},De))),v()&&ye();return}}if(Le){const Ee=JSswift.ui.renderSlot(r,"loading",{},"Caricamento...");j.appendChild(_.div({class:"cms-select-empty"},...E(null,"default",{},Ee))),v()&&ye();return}for(const Ee of B)j.appendChild(Ee);be(),v()&&ye()},"UI.Select:render"),JSswift.reactive.effect(()=>{be()},"UI.Select:paintActive");const Ce=x=>{if(!a.isConnected)return;const w=x.target;a.contains(w)||H.contains(w)||g()};document.addEventListener("click",Ce,!0);const pe=x=>{if(te())return;const w=v(),c=le(),A=re(),de=ce&&x.target===ce,Le=(B,Ae)=>{let Me=B;for(;Me>=0&&Me<c.length;){if(!c[Me].disabled)return Me;Me+=Ae}return-1},Je=B=>{if(!B)return null;const Ae=B.toLowerCase();let Me=c.find(Ee=>String(Ee.label).toLowerCase()===Ae||String(Ee.value).toLowerCase()===Ae);return Me||(Me=c.find(Ee=>String(Ee.label).toLowerCase().includes(Ae))),Me&&!Me.disabled?Me:null};if(x.key==="Escape"){w&&(x.preventDefault(),g());return}if(de&&(x.key==="Enter"||x.key===" ")){const B=(P()||"").trim();if(B){const Ae=Je(B);if(Ae){x.preventDefault(),f(Ae.value,!0);return}if(o&&x.key==="Enter"){x.preventDefault(),f(B,!0);return}if(x.key==="Enter"){x.preventDefault();return}}if(x.key===" ")return}if(x.key==="Enter"||x.key===" "){if(x.preventDefault(),!w){F();return}A>=0&&c[A]&&!c[A].disabled&&(s?L(c[A].value):(ue(c[A].value),g()));return}if(x.key==="ArrowDown"){if(x.preventDefault(),!w){F();return}const B=Le(A<0?0:A+1,1);B>=0&&oe(B);return}if(x.key==="ArrowUp"){if(x.preventDefault(),!w){F();return}const B=Le(A<0?c.length-1:A-1,-1);B>=0&&oe(B);return}if(x.key==="Home"){if(!w)return;x.preventDefault();const B=Le(0,1);B>=0&&oe(B);return}if(x.key==="End"){if(!w)return;x.preventDefault();const B=Le(c.length-1,-1);B>=0&&oe(B);return}};a.addEventListener("keydown",pe),U.addEventListener("keydown",pe);let Ie=!1;a._dispose=()=>{Ie||(Ie=!0,document.removeEventListener("click",Ce,!0),a.removeEventListener("keydown",pe),U.removeEventListener("keydown",pe),ke())};const _e=()=>{const x=G();return s?Array.isArray(x)&&x.length>0:x==null?!1:x!==""?!0:le().some(w=>w.value==="")},z=he.FormField({...e,control:a,clearable:t.clearable,disabled:te(),readonly:!1,hasValue:_e,getValue:()=>{const x=G();return s?Array.isArray(x)&&x.length?x:"":x},onClear:()=>{te()||(ue(s?[]:null),g())},onFocus:()=>{F()}});return JSswift.reactive.effect(()=>{var x;(x=z._refresh)==null||x.call(z)},"UI.Select:fieldRefresh"),z._select=a,z._dispose=a._dispose,(T=JSswift._registerCleanup)==null||T.call(JSswift,z,z._dispose),an(z,t,{isEnabled:()=>!te(),action:()=>{if(te())return!1;hn(a),F()}}),q(),z},he.Upload=(t={})=>{var _e;Yt(t);const e=t.slots||{},[n,s]=JSswift.reactive.signal([]),[o,r]=JSswift.reactive.signal(!1),[C,u]=JSswift.reactive.signal(!1),[i,y]=JSswift.reactive.signal(null);let R=0,v=!1;const b=()=>!!l(t.disabled)||!!l(t.readonly),P=()=>t.multiple!==!1&&t.single!==!0,Z=()=>{var z,we;return["form","native","submit","external"].includes(String(l((we=(z=t.submitMode)!=null?z:t.modeSubmit)!=null?we:t.uploadMode)||"").toLowerCase())},G=()=>{var z;return l((z=t.showBrowse)!=null?z:t.browseButton)!==!1},ie=()=>{var z;return!Z()&&l((z=t.showUpload)!=null?z:t.uploadButton)!==!1},D=()=>{var z;return l((z=t.showClear)!=null?z:t.clearButton)!==!1},$=()=>{var z;return l((z=t.showFiles)!=null?z:t.files)!==!1},Y=()=>{const z=mt(l(t.state)||l(t.status));return z?`cms-state-${z}`:""},W=()=>t.fieldName||t.paramName||t.name||"file",le=()=>{var z;return Math.max(1,Number(l((z=t.parallelUploads)!=null?z:t.parallel)||1))},me=()=>{var we,T,x,w;const z=l(t.retry);return z===!0?{attempts:2,delay:350,factor:2}:z?{attempts:Math.max(0,Number((T=(we=z.attempts)!=null?we:z.retries)!=null?T:0)),delay:Math.max(0,Number((x=z.delay)!=null?x:350)),factor:Math.max(1,Number((w=z.factor)!=null?w:2))}:{attempts:0,delay:350,factor:2}},re=z=>z?Array.isArray(z)?z:Array.from(z):[],oe=z=>{const we=Number(z||0);return we<1024?`${we} B`:we<1024*1024?`${(we/1024).toFixed(1)} KB`:we<1024*1024*1024?`${(we/1024/1024).toFixed(1)} MB`:`${(we/1024/1024/1024).toFixed(1)} GB`},se=()=>{var z;return String(l((z=t.acceptedFiles)!=null?z:t.accept)||"").trim()},te=z=>{const we=se();if(!we)return!0;const T=String(z.name||"").toLowerCase(),x=String(z.type||"").toLowerCase();return we.split(",").map(w=>w.trim().toLowerCase()).filter(Boolean).some(w=>w.startsWith(".")?T.endsWith(w):w.endsWith("/*")?x.startsWith(w.slice(0,-1)):x===w)},M=()=>n().filter(z=>z.status!=="rejected"&&z.status!=="removed"),Q=(z=0)=>M().reduce((we,T)=>we+Number(T.size||0),z),q=()=>{var z;s(n().slice()),O.classList.toggle("is-busy",n().some(we=>we.status==="uploading")),O.classList.toggle("has-files",n().some(we=>we.status!=="removed")),(z=t.onChange)==null||z.call(t,n().slice(),K)},ue=(z,we,T=null)=>{var w;const x={id:`upload_${Date.now()}_${++R}`,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:we,detail:T,attempts:0,response:null,xhr:null};return n().push(x),(w=t.onRejected)==null||w.call(t,x,{reason:we,detail:T,api:K}),x},L=async(z,we)=>{const T=t.maxFiles==null?null:Number(l(t.maxFiles)),x=t.maxFileSize==null?null:Number(l(t.maxFileSize)),w=t.minFileSize==null?null:Number(l(t.minFileSize)),c=t.maxTotalSize==null?null:Number(l(t.maxTotalSize));if(T!=null&&we>T)return"max-files";if(x!=null&&Number(z.size||0)>x)return"max-file-size";if(w!=null&&Number(z.size||0)<w)return"min-file-size";if(c!=null&&Q(Number(z.size||0))>c)return"max-total-size";if(!te(z))return"accept";const A=t.filter||t.acceptFile||t.validate;if(typeof A=="function"){const de=await A(z,{files:n().slice(),api:K});if(de===!1)return"filter";if(typeof de=="string")return de}return null},f=async()=>{for(const z of n()){if(z.status!=="rejected"||z.error!=="max-files")continue;const we=await L(z.file,M().length+1);if(we){z.error=we;continue}z.status="queued",z.progress=0,z.error=null,z.detail=null}},m=z=>({id:`upload_${Date.now()}_${++R}`,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}),g=async(z,we={})=>{var w;if(b())return[];y(null);const T=re(z),x=[];!P()&&T.length&&F({silent:!0});for(const c of T){const A=await L(c,M().length+1);if(A){ue(c,A);continue}const de=m(c);if(n().push(de),x.push(de),(w=t.onAdded)==null||w.call(t,de,{file:c,meta:we,api:K}),!P())break}return q(),x.length&&t.autoUpload&&!Z()&&d(),x},F=(z={})=>{var we;for(const T of n())T.status==="uploading"&&a(T),T.status="removed";s([]),y(null),q(),z.silent||(we=t.onClear)==null||we.call(t,K)},X=async z=>{var x;const we=typeof z=="string"?n().find(w=>w.id===z):z;if(!we)return;we.status==="uploading"&&a(we);const T=n().filter(w=>w!==we);s(T),await f(),q(),(x=t.onRemove)==null||x.call(t,we,{api:K})},a=z=>{var T,x,w;const we=typeof z=="string"?n().find(c=>c.id===z):z;!we||we.status!=="uploading"||(we.status="canceled",we.error="canceled",(x=(T=we.xhr)==null?void 0:T.abort)==null||x.call(T),(w=t.onCancel)==null||w.call(t,we,{api:K}),q())},S=()=>n().filter(z=>z.status==="uploading").forEach(a),h=async z=>{var T,x;const we={url:l(t.url),method:l(t.method||"POST"),headers:t.headers,formFields:t.formFields||t.fields,fieldName:W(),withCredentials:!!l((T=t.withCredentials)!=null?T:t.credentials),sendRaw:!!l(t.sendRaw)};if(typeof t.factory=="function")try{const w=await t.factory(z.file,{item:z,files:n().slice(),api:K});if(w&&typeof w=="object")Object.assign(we,w);else if(w!=null)throw new Error("factory must return an object")}catch(w){throw(x=t.onFactoryFailed)==null||x.call(t,w,{item:z,api:K}),w}return we},J=(z,we,T)=>{const x=typeof we=="function"?we(T.file,{item:T,api:K}):we;x&&(x instanceof Headers?x.forEach((w,c)=>z.setRequestHeader(c,w)):Array.isArray(x)?x.forEach(w=>{Array.isArray(w)?z.setRequestHeader(w[0],w[1]):w!=null&&w.name&&z.setRequestHeader(w.name,w.value)}):typeof x=="object"&&Object.keys(x).forEach(w=>z.setRequestHeader(w,x[w])))},j=(z,we,T)=>{const x=typeof we=="function"?we(T.file,{item:T,api:K}):we;x&&(Array.isArray(x)?x.forEach(w=>{Array.isArray(w)?z.append(w[0],w[1]):w!=null&&w.name&&z.append(w.name,w.value)}):typeof x=="object"&&Object.keys(x).forEach(w=>z.append(w,x[w])))},U=(z,we)=>new Promise((T,x)=>{if(!we.url){x(new Error("UI.Upload: url is required"));return}if(typeof XMLHttpRequest!="function"){x(new Error("UI.Upload: XMLHttpRequest is not available"));return}const w=new XMLHttpRequest;z.xhr=w,w.open(String(we.method||"POST").toUpperCase(),we.url,!0),w.withCredentials=!!we.withCredentials,J(w,we.headers,z),w.upload.onprogress=A=>{var de;A.lengthComputable&&(z.bytesUploaded=A.loaded,z.progress=Math.max(0,Math.min(100,Math.round(A.loaded/A.total*100))),(de=t.onProgress)==null||de.call(t,z,{event:A,api:K}),q())},w.onload=()=>{const A=w.status>=200&&w.status<300,de={status:w.status,text:w.responseText,xhr:w};A?T(de):x(Object.assign(new Error(`HTTP error ${w.status}`),{response:de}))},w.onerror=()=>x(new Error("network-error")),w.onabort=()=>x(new Error("canceled"));const c=we.sendRaw?z.file:(()=>{const A=new FormData;return j(A,we.formFields,z),A.append(we.fieldName||"file",z.file,z.name),A})();w.send(c)}),ce=async z=>{var x,w,c,A,de,Le;const we=me();let T=we.delay;z.status="uploading",z.error=null,z.progress=Math.max(0,z.progress||0),(x=t.onStart)==null||x.call(t,z,{api:K}),q();for(let Je=0;Je<=we.attempts;Je++){z.attempts=Je+1;try{const B=await h(z),Ae=typeof t.upload=="function"||typeof t.uploader=="function"?await(t.upload||t.uploader)(z.file,{item:z,options:B,progress:Me=>{var Ee;z.progress=Math.max(0,Math.min(100,Number(Me)||0)),(Ee=t.onProgress)==null||Ee.call(t,z,{api:K}),q()},api:K}):await U(z,B);return z.status="done",z.progress=100,z.response=Ae,z.xhr=null,(w=t.onSuccess)==null||w.call(t,z,{response:Ae,api:K}),(c=t.onComplete)==null||c.call(t,z,{response:Ae,api:K}),q(),z}catch(B){if(String((B==null?void 0:B.message)||B)==="canceled"||z.status==="canceled")return z.status="canceled",z.error="canceled",z.xhr=null,(A=t.onComplete)==null||A.call(t,z,{error:B,api:K}),q(),z;if(Je<we.attempts){await new Promise(Ae=>setTimeout(Ae,T)),T=Math.round(T*we.factor);continue}return z.status="error",z.error=B,z.xhr=null,y(B),(de=t.onError)==null||de.call(t,z,{error:B,api:K}),(Le=t.onComplete)==null||Le.call(t,z,{error:B,api:K}),q(),z}}return z},k=()=>{var x;if(v||b())return;const z=n().filter(w=>w.status==="uploading").length,we=Math.max(0,le()-z),T=n().filter(w=>w.status==="queued").slice(0,we);if(!T.length){const w=n().some(c=>c.status==="uploading");u(w),w||(x=t.onFinish)==null||x.call(t,n().slice(),{api:K});return}u(!0),T.forEach(w=>{ce(w).finally(()=>k())})},d=(z=null)=>{(z?re(z):n().filter(T=>["queued","error","canceled"].includes(T.status))).forEach(T=>{const x=typeof T=="string"?n().find(w=>w.id===T):T;x&&x.status!=="uploading"&&x.status!=="done"&&x.status!=="rejected"&&(x.status="queued",x.progress=0,x.error=null)}),q(),k()},N=z=>d([z]),I=()=>{b()||H.click()},H=_.input({type:"file",class:"cms-upload-input",name:W(),accept:se()||null,multiple:P(),capture:t.capture||null,disabled:b(),onChange:z=>{g(z.target.files,{event:z,source:"browse"}),z.target.value=""}}),ge=_.div({class:"cms-upload-list"}),Se=_.div({class:"cms-upload-summary"}),ye=_.div({class:"cms-upload-actions"});let V=Y();const O=_.div({class:ae(["cms-upload","cms-singularity",V,fe(t.box||t.variant==="box","cms-upload-box"),fe(t.compact,"is-compact"),fe(Z(),"is-form-mode"),fe(!$(),"is-files-hidden"),t.class]),tabindex:b()?"-1":"0",role:"group","aria-disabled":b()?"true":"false"}),K={addFiles:g,browse:I,upload:d,retry:N,retryAll:()=>d(n().filter(z=>z.status==="error"||z.status==="canceled")),remove:X,clear:F,abort:a,abortAll:S,files:()=>n().slice(),state:()=>({files:n().slice(),busy:C(),dragging:o(),error:i()}),reset:F},ke=()=>{const z={api:K,files:n().slice(),busy:C(),disabled:b(),submitMode:Z()?"form":"upload"},we=[];return G()&&we.push(JSswift.ui.renderSlot(e,"browse",z,he.Btn({size:"sm",icon:"folder_open",label:t.browseText||"Browse",onClick:I}))),ie()&&we.push(JSswift.ui.renderSlot(e,"upload",z,he.Btn({size:"sm",color:"primary",icon:"upload",label:t.uploadText||"Upload",loading:C(),disabled:b()||!n().some(T=>["queued","error","canceled"].includes(T.status)),onClick:()=>d()}))),D()&&we.push(JSswift.ui.renderSlot(e,"clear",z,he.Btn({size:"sm",color:"secondary",outline:!0,icon:"delete",label:t.clearText||"Clear",disabled:b()||!n().length,onClick:()=>F()}))),E(e,"actions",z,we)},Ne=(z,we)=>{var c;const T={item:z,file:z.file,index:we,api:K,remove:()=>X(z),retry:()=>N(z),abort:()=>a(z)},x=_.div({class:ae(["cms-upload-file",`is-${z.status}`])},_.div({class:"cms-upload-file-icon"},he.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"},...E(e,"fileName",T,z.name)),_.div({class:"cms-upload-file-meta"},...E(e,"fileMeta",T,z.error?String(((c=z.error)==null?void 0:c.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"},oe(z.size)),_.div({class:"cms-upload-file-actions"},...E(e,"fileActions",T,[z.status==="uploading"?he.Btn({size:"sm",outline:!0,icon:"close","aria-label":"Cancel",onClick:()=>a(z)}):null,z.status==="error"||z.status==="canceled"?he.Btn({size:"sm",outline:!0,icon:"refresh","aria-label":"Retry",onClick:()=>N(z)}):null,he.Btn({size:"sm",dense:!0,outline:!0,icon:"delete","aria-label":"Remove",onClick:()=>X(z)})])))),w=JSswift.ui.renderSlot(e,"file",T,x);return _.div({class:"cms-upload-file-wrap","data-status":z.status,"data-id":z.id},...E(null,"default",{},w))},ee=()=>{const z=n();if(ye.replaceChildren(...ke()),ge.replaceChildren(),Se.hidden=!$(),ge.hidden=!$(),z.length)z.forEach((T,x)=>ge.appendChild(Ne(T,x)));else{const T=JSswift.ui.renderSlot(e,"empty",{api:K},t.emptyText||"No files selected");ge.appendChild(_.div({class:"cms-upload-empty"},...E(null,"default",{},T)))}const we=z.filter(T=>T.status!=="rejected"&&T.status!=="removed");Se.textContent=`${we.length} file \u2022 ${oe(we.reduce((T,x)=>T+Number(x.size||0),0))}`},xe=JSswift.ui.renderSlot(e,"icon",{api:K},he.Icon({name:t.icon||"cloud_upload"})),be=JSswift.ui.renderSlot(e,"title",{api:K},t.title||"Upload files"),Ce=JSswift.ui.renderSlot(e,"subtitle",{api:K},t.subtitle||(se()?`Accepted: ${se()}`:"Drag files here or browse from your device")),pe=_.div({class:"cms-upload-dropzone",onClick:z=>{var we,T;(T=(we=z.target)==null?void 0:we.closest)!=null&&T.call(we,".cms-upload-actions, .cms-upload-list")||t.clickable!==!1&&I()},onDragenter:z=>{t.drag===!1||b()||(z.preventDefault(),r(!0),O.classList.add("is-dragging"))},onDragover:z=>{t.drag===!1||b()||z.preventDefault()},onDragleave:z=>{z.currentTarget===z.target&&(r(!1),O.classList.remove("is-dragging"))},onDrop:z=>{var we,T;t.drag===!1||b()||(z.preventDefault(),r(!1),O.classList.remove("is-dragging"),(we=t.onDrop)==null||we.call(t,z,{api:K}),g(((T=z.dataTransfer)==null?void 0:T.files)||[],{event:z,source:"drop"}))}},_.div({class:"cms-upload-head"},_.div({class:"cms-upload-icon"},...E(null,"default",{},xe)),_.div({class:"cms-upload-copy"},_.div({class:"cms-upload-title"},...E(null,"default",{},be)),_.div({class:"cms-upload-subtitle"},...E(null,"default",{},Ce))),ye),Se,ge),Ie=JSswift.ui.renderSlot(e,"header",{api:K},null);return E(null,"default",{},Ie).forEach(z=>O.appendChild(z)),O.appendChild(H),E(e,"default",{api:K,dropzone:pe},pe).forEach(z=>O.appendChild(z)),JSswift.reactive.effect(()=>{ee()},"UI.Upload:render"),JSswift.reactive.effect(()=>{O.classList.toggle("is-disabled",b()),O.classList.toggle("is-form-mode",Z()),O.classList.toggle("is-files-hidden",!$());const z=Y();z!==V&&(V&&O.classList.remove(V),z&&O.classList.add(z),V=z),O.setAttribute("aria-disabled",b()?"true":"false"),H.disabled=b(),H.multiple=P(),H.name=W()},"UI.Upload:disabled"),O._upload=K,O._addFiles=g,O._browse=I,O._uploadFiles=d,O._input=H,O._dispose=()=>{v||(v=!0,S())},(_e=JSswift._registerCleanup)==null||_e.call(JSswift,O,O._dispose),O},he.BoxUpload=(t={})=>he.Upload({...t,box:!0}),he.boxUpload=(t={})=>he.BoxUpload(t),JSswift.ui.Upload=he.Upload,JSswift.ui.BoxUpload=he.BoxUpload,JSswift.ui.boxUpload=he.boxUpload;function Nt(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:o=>He.reactive.effect(()=>{o(n())},e||"UI:model")}}return null}const nl={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"]}},zo=t=>{const e=l(t);return e==null||e===!1||e===""?"":String(e).trim().toLowerCase().replace(/[\s_-]+/g,"")},Po=(t,e)=>{if(!t||!e.main)return null;const n=t.side||(e.aside?"left":null),s=t.nav||(e.nav?"top":null),o=!!e.aside&&!!n,r=!!e.nav&&!!s,i=[r&&s==="left"?"nav":o&&n==="left"?"aside":".","main",r&&s==="right"?"nav":o&&n==="right"?"aside":"."],y=[],R=[...t.rows||[]];if(r&&s==="top"&&!R.includes("nav")){const v=R.indexOf("body");R.splice(v>=0?v:R.length,0,"nav")}for(const v of R)v==="header"&&e.header?y.push(t.fullSide&&o&&n==="left"?["aside","header","header"]:t.fullSide&&o&&n==="right"?["header","header","aside"]:["header","header","header"]):v==="nav"&&r&&s==="top"?y.push(t.fullSide&&o&&n==="left"?["aside","nav","nav"]:t.fullSide&&o&&n==="right"?["nav","nav","aside"]:["nav","nav","nav"]):v==="body"?y.push(i):v==="footer"&&e.footer&&y.push(t.fullSide&&o&&n==="left"?["aside","footer","footer"]:t.fullSide&&o&&n==="right"?["footer","footer","aside"]:["footer","footer","footer"]);return y.length?y.map(v=>`"${v.join(" ")}"`).join(" "):null};he.Layout=(...t)=>{var un,tn,nn;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(Pe,Ve)=>!!Pe&&Object.prototype.hasOwnProperty.call(Pe,Ve),r=()=>typeof window=="undefined"?1024:window.innerWidth,C=()=>{const Pe=r(),Ve=JSswift.uiResponsivePropsFor(e,pn("mobile"))||{},et=Pe>=768?JSswift.uiResponsivePropsFor(e,pn("tablet"))||{}:{},ct=Pe>=1024?JSswift.uiResponsivePropsFor(e,pn("pc"))||{}:{};return{...Ve,...et,...ct}},u=(...Pe)=>{for(const Ve of Pe)if(o(e,Ve))return e[Ve]},i=(...Pe)=>{const Ve=C();for(const et of Pe)if(o(Ve,et))return Ve[et];return u(...Pe)},y=(...Pe)=>{const Ve=JSswift.uiResponsivePropsFor(e,pn(V()))||{};for(const et of Pe)if(o(Ve,et))return Ve[et];return u(...Pe)},R=()=>zo(y("disposition","layoutDisposition","layout")),v=()=>{const Pe=l(i("mode","layoutMode"));if(Pe==null||Pe===!1||Pe==="")return"";const Ve=String(Pe).trim().toLowerCase();return Ve==="global"||Ve==="local"?Ve:""},b=(Pe,Ve=null)=>Pe==null||Pe===!1||Pe===""?Ve:typeof Pe=="number"?`${Pe}px`:String(Pe),P=(Pe,Ve=null)=>{if(Pe==null||Pe===!1||Pe==="")return Ve;if(typeof Pe=="number"&&Number.isFinite(Pe))return Pe;const et=Number.parseFloat(String(Pe));return Number.isFinite(et)?et:Ve},Z=Pe=>{const Ve=l(Pe);return Ve==null||Ve===!1||Ve===""?null:Array.isArray(Ve)?Ve.map(et=>`"${Array.isArray(et)?et.join(" "):String(et)}"`).join(" "):String(Ve)},G=(Pe,Ve=null,et=null)=>{let ct=Number.isFinite(Pe)?Pe:0;return Number.isFinite(Ve)&&(ct=Math.max(Ve,ct)),Number.isFinite(et)&&(ct=Math.min(et,ct)),ct},ie=u("header","headerContent"),D=u("aside","drawer"),$=u("nav","asideRight","drawerRight"),Y=u("page","main","content","body"),W=u("footer","footerContent"),le=()=>l(i("drawerEnabled","asideEnabled")),me=()=>l(i("navEnabled","asideRightEnabled","rightAsideEnabled")),re=()=>le()!==!1,oe=()=>me()===!0||l(i("noNav"))===!1,se=()=>l(i("noDrawer"))===!0||le()===!1||D===!1,te=()=>l(i("noNav"))===!0||me()===!1||$===!1,M=()=>l(i("drawerFloating"))===!0,Q=()=>l(i("navFloating"))===!0,q=()=>l(i("drawerResizable"))===!0,ue=()=>l(i("navResizable"))===!0,L=()=>P(l(i("drawerMinWidth")),180),f=()=>P(l(i("drawerMaxWidth")),null),m=()=>P(l(i("navMinWidth")),180),g=()=>P(l(i("navMaxWidth")),null),F=P(l(i("drawerWidth")),280),X=P((un=l(i("navWidth")))!=null?un:l(i("asideRightWidth")),280),[a,S]=JSswift.reactive.signal(G(F,L(),f())),[h,J]=JSswift.reactive.signal(G(X,m(),g())),j=Nt(e.drawerOpen,"UI.Layout:drawerOpen"),U=j?!!j.get():typeof e.drawerOpen=="boolean"?!!e.drawerOpen:!0,[ce,k]=JSswift.reactive.signal(U),d=Pe=>{const Ve=!!Pe;ce()!==Ve&&k(Ve),j==null||j.set(Ve)};(tn=j==null?void 0:j.watch)==null||tn.call(j,()=>{const Pe=!!j.get();ce()!==Pe&&k(Pe)});const N=Nt(e.navOpen,"UI.Layout:navOpen"),I=N?!!N.get():typeof e.navOpen=="boolean"?!!e.navOpen:!0,[H,ge]=JSswift.reactive.signal(I),Se=Pe=>{const Ve=!!Pe;H()!==Ve&&ge(Ve),N==null||N.set(Ve)};(nn=N==null?void 0:N.watch)==null||nn.call(N,()=>{const Pe=!!N.get();H()!==Pe&&ge(Pe)});const ye=()=>{var ct,gt,ht;const Pe=Number((ct=l(i("layoutBreakpoint")))!=null?ct:0),Ve=Number((gt=l(i("drawerBreakpoint")))!=null?gt:Pe||1024),et=Number((ht=l(i("navBreakpoint")))!=null?ht:Pe||Ve);return Math.max(Ve,et,0)},V=()=>{const Pe=r();return Pe>=1024?"pc":Pe>=768?"tablet":"mobile"},[O,K]=JSswift.reactive.signal(!1),[ke,Ne]=JSswift.reactive.signal(V()),ee=()=>{typeof window!="undefined"&&(Ne(V()),K(window.innerWidth<ye()))};typeof window!="undefined"&&(ee(),window.addEventListener("resize",ee));const xe=()=>({props:e,openAside:()=>d(!0),closeAside:()=>d(!1),toggleAside:()=>d(!ce()),openNav:()=>Se(!0),closeNav:()=>Se(!1),toggleNav:()=>Se(!H()),isDrawerOpen:()=>!!ce(),isNavOpen:()=>!!H(),isMobile:()=>!!O(),isDrawerFloating:()=>M(),isNavFloating:()=>Q()}),be=(Pe,Ve)=>{const et=xe();for(const gt of Pe){if(!o(s,gt))continue;const ht=typeof s[gt]=="function"?s[gt](et):s[gt];return E(null,"default",et,ht)}const ct=typeof Ve=="function"?Ve(et):Ve;return E(null,"default",et,ct)},Ce=Y!==void 0?Y:n,pe=ae(["cms-app","cms-layout",JSswift.uiResponsiveClasses({mobile:e},rn),JSswift.uiResponsiveClasses(e,rn),e.class]),Ie=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"]);Ie.class=pe,Ie.style={...e.style||{}},JSswift.uiApplyResponsiveProps(Ie,e,JSswift.uiResponsiveStyleRules);const _e=_.div(Ie),we=l(i("tagPage"))===!0?{header:"header",aside:"aside",nav:"nav",page:"main",footer:"footer"}:{header:"div",aside:"div",nav:"div",page:"div",footer:"div"},T=_.div({class:ae(["cms-layout-shell-grid",e.shellClass])}),x=_[we.header]({class:ae(["cms-layout-section","cms-layout-header","header",fe(e.stickyHeader,"sticky"),e.headerClass])}),w=_[we.aside]({class:ae(["cms-layout-section","cms-layout-aside","aside",fe(e.stickyAside!==!1,"sticky"),e.asideClass]),role:"navigation","aria-hidden":"true"}),c=_.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"});w.appendChild(c),w.appendChild(A);const de=_[we.nav]({class:ae(["cms-layout-section","cms-layout-nav","nav",fe(e.stickyNav,"sticky"),e.navClass]),role:we.nav==="nav"?null:"complementary","aria-hidden":"true"}),Le=_.div({class:"cms-layout-panel-body cms-layout-nav-body"}),Je=_.div({class:"cms-layout-resize-handle cms-layout-resize-handle-nav","aria-hidden":"true"});de.appendChild(Le),de.appendChild(Je);const B=_[we.page]({class:ae(["cms-layout-section","cms-layout-main","main",e.pageClass]),role:we.page==="main"?null:"main"}),Ae=_[we.footer]({class:ae(["cms-layout-section","cms-layout-footer","footer",fe(e.stickyFooter,"sticky"),e.footerClass])});T.appendChild(x),T.appendChild(w),T.appendChild(B),T.appendChild(de),T.appendChild(Ae),_e.appendChild(T);const Me=_.div({class:ae(["cms-aside-overlay",e.overlayClass]),onClick:()=>{l(i("overlayClose"))!==!1&&(ce()&&d(!1),H()&&Se(!1))}});_e.appendChild(Me);let Ee=!1,De=!1,Ue=!1,Ye=!1,Ze=!1,Qe=null,Te=null;const je=Pe=>{!Pe||typeof Pe!="object"||(typeof Pe._dispose=="function"&&Pe._dispose(),!(!Pe.childNodes||!Pe.childNodes.length)&&Array.from(Pe.childNodes).forEach(je))},tt=Pe=>{Pe&&Array.from(Pe.childNodes).forEach(Ve=>{je(Ve),Ve.remove()})},nt=Pe=>{const Ve=xe(),et=typeof Pe=="function"?Pe(Ve):Pe;return E(null,"default",Ve,et)},ut=()=>{const Pe=Ee?x.getBoundingClientRect().height:0;_e.style.setProperty("--layout-header-height",`${Pe}px`)},dt=(Pe,Ve)=>(tt(Pe),Ve.forEach(et=>Pe.appendChild(et)),Ve.length>0),bt=()=>{var ct,gt,ht,Ct,yt,p;_e.style.setProperty("--cms-layout-drawer-width",b((ct=l(i("drawerWidth")))!=null?ct:280,"280px")),_e.style.setProperty("--cms-layout-nav-width",b((ht=(gt=l(i("navWidth")))!=null?gt:l(i("asideRightWidth")))!=null?ht:280,"280px")),_e.style.setProperty("--cms-layout-drawer-peek",b((Ct=l(i("drawerPeek")))!=null?Ct:20,"20px")),_e.style.setProperty("--cms-layout-nav-peek",b((p=(yt=l(i("navPeek")))!=null?yt:l(i("asideRightPeek")))!=null?p:20,"20px"));const Pe=b(l(i("gap")),null);Pe!=null?_e.style.setProperty("--cms-layout-gap",Pe):_e.style.removeProperty("--cms-layout-gap");const Ve=b(l(i("headerOffset")),null);Ve!=null&&_e.style.setProperty("--layout-header-height",Ve);const et=b(l(i("minHeight")),null);et!=null?_e.style.setProperty("--cms-layout-min-height",et):_e.style.removeProperty("--cms-layout-min-height")},lt=()=>{if(q()){const Pe=G(a(),L(),f());Pe!==a()&&S(Pe),_e.style.setProperty("--cms-layout-drawer-width",`${Pe}px`)}if(ue()){const Pe=G(h(),m(),g());Pe!==h()&&J(Pe),_e.style.setProperty("--cms-layout-nav-width",`${Pe}px`)}},ft=(Pe,Ve)=>{if(Ve.button!==0)return;const et=Pe==="drawer"?w:de;if(et.hidden)return;const ct=Pe==="drawer"?a:h,gt=Pe==="drawer"?S:J,ht=Pe==="drawer"?L:m,Ct=Pe==="drawer"?f:g,yt=et.getBoundingClientRect(),p=yt.width||ct(),ne=Re=>{const Fe=Pe==="drawer"?Re.clientX-yt.left:yt.right-Re.clientX;gt(G(Fe||p,ht(),Ct())),lt(),rt()},ve=()=>{_e.classList.remove("is-resizing-layout"),document.removeEventListener("pointermove",ne,!0),document.removeEventListener("pointerup",ve,!0),Te=null};_e.classList.add("is-resizing-layout"),document.addEventListener("pointermove",ne,!0),document.addEventListener("pointerup",ve,!0),Te=ve,Ve.preventDefault()},vt=Pe=>ft("drawer",Pe),_t=Pe=>ft("nav",Pe);A.addEventListener("pointerdown",vt),Je.addEventListener("pointerdown",_t);const rt=()=>{const Pe=!!O(),Ve=!!ce(),et=!!H(),ct=!se()&&re()&&De,gt=!te()&&oe()&&Ue,ht=ct&&(Pe||M()),Ct=gt&&(Pe||Q()),yt=ct&&Ve,p=gt&&et,ne=yt&&!ht,ve=p&&!Ct,Re=ne&&q(),Fe=ve&&ue(),Oe=yt&&ht||p&&Ct;bt(),lt(),_e.classList.toggle("is-mobile",Pe),_e.classList.toggle("drawer-open",yt),_e.classList.toggle("nav-open",p),_e.classList.toggle("no-drawer",!ct),_e.classList.toggle("no-nav",!gt),_e.classList.toggle("has-header",Ee),_e.classList.toggle("has-drawer",ct),_e.classList.toggle("has-nav",gt),_e.classList.toggle("has-footer",Ze),_e.classList.toggle("drawer-floating",ht),_e.classList.toggle("nav-floating",Ct);const $e=R(),Xe=$e?v():"";_e.dataset.disposition=$e||"",_e.dataset.layoutMode=Xe||"",_e.classList.toggle("has-disposition",!!$e),_e.classList.toggle("mode-local",Xe==="local"),_e.classList.toggle("mode-global",Xe==="global"),x.classList.toggle("sticky",l(i("stickyHeader"))===!0),Ae.classList.toggle("sticky",l(i("stickyFooter"))===!0),w.classList.toggle("sticky",l(i("stickyAside"))!==!1),de.classList.toggle("sticky",l(i("stickyNav"))===!0),x.hidden=!Ee,Ae.hidden=!Ze,B.hidden=!Ye,Me.hidden=!(ht||Ct),Me.classList.toggle("show",Oe),w.hidden=!ct||!yt&&!ht,w.classList.toggle("open",yt),w.classList.toggle("is-floating",ht),w.classList.toggle("is-resizable",Re),w.setAttribute("aria-hidden",yt?"false":"true"),A.hidden=!Re,de.hidden=!gt||!p&&!Ct,de.classList.toggle("open",p),de.classList.toggle("is-floating",Ct),de.classList.toggle("is-resizable",Fe),de.setAttribute("aria-hidden",p?"false":"true"),Je.hidden=!Fe;const ot=nl[$e]||null,pt=(ot==null?void 0:ot.side)||(ne&&ot?"left":null),xt=(ot==null?void 0:ot.nav)||(ve&&ot?"top":null),Bt=ne?ot?pt:"left":"",zt=ve?ot?xt==="left"||xt==="right"?xt:"":"right":"";_e.classList.toggle("drawer-left",ct&&pt==="left"),_e.classList.toggle("drawer-right",ct&&pt==="right"),_e.classList.toggle("nav-top",ve&&xt==="top"),_e.classList.toggle("nav-side",ve&&(zt==="left"||zt==="right")),T.style.gridTemplateColumns=[Bt==="left"?"minmax(0, var(--cms-layout-drawer-width))":zt==="left"?"minmax(0, var(--cms-layout-nav-width))":"0px","minmax(0, 1fr)",Bt==="right"?"minmax(0, var(--cms-layout-drawer-width))":zt==="right"?"minmax(0, var(--cms-layout-nav-width))":"0px"].join(" ");const Lt=['"header header header"',`"${ne?"aside":"."} main ${ve?"nav":"."}"`,'"footer footer footer"'].join(" "),sn=Po(nl[$e],{header:Ee,aside:ne,nav:ve,main:Ye,footer:Ze});T.style.gridTemplateAreas=Z(y("areas","gridTemplateAreas","templateAreas"))||sn||Lt},Vt=(Pe,Ve)=>(Ee=dt(x,nt(Pe)),ut(),rt(),Ve&&JSswift.router.setURLOnly(Ve),x),Mt=(Pe,Ve)=>(De=dt(c,nt(Pe)),De||d(!1),rt(),Ve&&JSswift.router.setURLOnly(Ve),w),wt=(Pe,Ve)=>(Ue=dt(Le,nt(Pe)),Ue||Se(!1),rt(),Ve&&JSswift.router.setURLOnly(Ve),de),Kt=(Pe,Ve)=>(Ye=dt(B,nt(Pe)),rt(),Ve&&JSswift.router.setURLOnly(Ve),B),St=(Pe,Ve)=>(Ze=dt(Ae,nt(Pe)),rt(),Ve&&JSswift.router.setURLOnly(Ve),Ae);Ee=dt(x,be(["header"],ie)),De=dt(c,D===!1?[]:be(["aside","drawer"],D)),Ue=dt(Le,$===!1?[]:be(["nav","asideRight","drawerRight"],$)),Ye=dt(B,be(["page","main","default"],Ce)),Ze=dt(Ae,be(["footer"],W)),typeof ResizeObserver!="undefined"&&(Qe=new ResizeObserver(()=>ut()),Qe.observe(x)),ut(),JSswift.reactive.effect(()=>{ke(),O(),ce(),H(),rt()},"UI.Layout:state");const cn=Pe=>{l(i("escClose"))!==!1&&(!O()&&!M()&&!Q()||!ce()&&!H()||Pe.key==="Escape"&&(Pe.preventDefault(),ce()&&d(!1),H()&&Se(!1)))};return typeof document!="undefined"&&document.addEventListener("keydown",cn,!0),_e.openAside=()=>d(!0),_e.closeAside=()=>d(!1),_e.toggleAside=()=>d(!ce()),_e.openNav=()=>Se(!0),_e.closeNav=()=>Se(!1),_e.toggleNav=()=>Se(!H()),_e.isDrawerOpen=()=>!!ce(),_e.isNavOpen=()=>!!H(),_e.isMobile=()=>!!O(),_e.header=()=>x,_e.aside=()=>w,_e.drawer=()=>w,_e.nav=()=>de,_e.page=()=>B,_e.main=()=>B,_e.footer=()=>Ae,_e.headerUpdate=Vt,_e.asideUpdate=Mt,_e.drawerUpdate=Mt,_e.navUpdate=wt,_e.pageUpdate=Kt,_e.mainUpdate=Kt,_e.footerUpdate=St,_e.reflow=rt,_e._dispose=()=>{var Pe;typeof window!="undefined"&&window.removeEventListener("resize",ee),typeof document!="undefined"&&document.removeEventListener("keydown",cn,!0),A.removeEventListener("pointerdown",vt),Je.removeEventListener("pointerdown",_t),Te==null||Te(),(Pe=Qe==null?void 0:Qe.disconnect)==null||Pe.call(Qe)},Ke(_e,e),rt(),_e},he.Footer=(...t)=>{var ue,L,f;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=m=>Object.prototype.hasOwnProperty.call(e,m),r={props:e},C=(m,g)=>{if(!(g==null||g===!1)){if(Array.isArray(g)){g.forEach(F=>C(m,F));return}if(g!=null&&g.nodeType){m.appendChild(g);return}m.appendChild(document.createTextNode(String(g)))}},u=(m,g,F=X=>X)=>{const X=JSswift.ui.getSlot(s,m);if(X!=null)return E(s,m,r,null);if(typeof g=="function"){const a=new Set(["eyebrow","title","subtitle"]),S=_[a.has(m)?"span":"div"]({class:`cms-footer-slot-${m}`});return JSswift.reactive.effect(()=>{const h=F(g(r)),J=on(JSswift.ui.slot(h));S.replaceChildren(),Array.isArray(J)?J.forEach(j=>C(S,j)):C(S,J)},`UI.Footer:${m}`),[S]}return E(s,m,r,F(g))},i=(m,g="icon",F=e.iconSize||e.size||"md")=>m==null||m===!1?null:typeof m=="string"?he.Icon({name:m,size:F}):JSswift.ui.slot(m,{as:g}),y=o("left")?e.left:e.start,R=o("right")?e.right:e.end,v=o("title")?e.title:e.label,b=(L=(ue=e.subtitle)!=null?ue:e.description)!=null?L:e.note,P=o("content")?e.content:o("body")?e.body:n!=null&&n.length?n:null,Z=[...u("left",y),...u("start",null)],G=u("icon",e.icon,i),ie=u("eyebrow",(f=e.eyebrow)!=null?f:e.kicker),D=u("title",v),$=u("subtitle",b),Y=u("meta",e.meta),W=(()=>{const m=u("content",null);return m.length?m:u("default",P)})(),le=[...u("center",null),...u("body",null)],me=[...u("right",R),...u("end",null)],re=u("actions",e.actions),oe=_.div({class:ae(["cms-footer-body",e.bodyClass,e.centerClass])},_.div({class:"cms-footer-heading"},G.length?_.div({class:"cms-footer-icon"},...G):null,_.div({class:"cms-footer-copy"},ie.length?_.div({class:ae(["cms-footer-eyebrow",e.eyebrowClass])},...ie):null,D.length?_.div({class:ae(["cms-footer-title",e.titleClass])},...D):null,$.length?_.div({class:ae(["cms-footer-subtitle",e.subtitleClass])},...$):null,W.length?_.div({class:ae(["cms-footer-content",e.contentClass])},...W):null),Y.length?_.div({class:ae(["cms-footer-meta",e.metaClass])},...Y):null)),se=[];le.length?se.push(_.div({class:ae(["cms-footer-body",e.bodyClass,e.centerClass])},...le)):(G.length||ie.length||D.length||$.length||W.length||Y.length)&&se.push(oe),(me.length||re.length)&&se.push(_.div({class:ae(["cms-footer-end",e.endClass])},...me,...re.length?[_.div({class:ae(["cms-footer-actions",e.actionsClass])},...re)]:[]));const te=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"]);te.class=ae(["cms-panel","cms-footer","cms-singularity",fe(e.sticky,"sticky"),fe(e.dense,"dense"),fe(e.elevated,"elevated"),fe(e.divider!==!1,"divider"),fe(e.stack,"stack"),tl(e.align,"align-"),e.class]),te.style={...e.style||{}};const M=ze(e.justify);M!=null&&(te.style.justifyContent=M);const Q=ze(e.wrap,m=>m?"wrap":"nowrap");Q!=null&&(te.style.flexWrap=Q),e.gap!=null&&(te.style["--cms-footer-gap"]=Be(l(e.gap))),e.minHeight!=null&&(te.style.minHeight=Be(l(e.minHeight))),JSswift.uiApplyResponsiveProps(te,e,JSswift.uiResponsiveStyleRules);const q=_.footer(te,...Z.length?[_.div({class:ae(["cms-footer-start",e.startClass])},...Z)]:[],...se.length?[_.div({class:"cms-footer-main"},...se)]:[]);return Ke(q,e),q};const di=t=>{const e=[];for(const n of t||[]){const s=on(JSswift.ui.slot(n));s&&(Array.isArray(s)?e.push(...s):e.push(s))}return e},An=(t,e)=>{const n=on(JSswift.ui.slot(t,e));return n?Array.isArray(n)?n:[n]:[]},Be=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)};he.Toolbar=(...t)=>{var g,F,X,a,S,h,J,j;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(U,ce,k={})=>{const d=Array.isArray(U)?U:[U];for(const N of d)if(JSswift.ui.getSlot(s,N)!=null)return E(s,N,k,ce);return ce==null?[]:E(null,"default",k,ce)},r=U=>(Array.isArray(U)?U:[U]).some(k=>JSswift.ui.getSlot(s,k)!=null),C={props:e},u=o(["before"],e.before,C),i=o(["start","left"],(g=e.start)!=null?g:e.left,C),y=o(["center","body","content","default"],(a=(X=(F=e.center)!=null?F:e.body)!=null?X:e.content)!=null?a:n,C),R=o(["end","right","actions"],(h=(S=e.end)!=null?S:e.right)!=null?h:e.actions,C),v=o(["after"],e.after,C),b=o(["title"],e.title,C),P=o(["subtitle"],e.subtitle,C),Z=o(["meta"],e.meta,C),G=!!(u.length||i.length||R.length||v.length||b.length||P.length||Z.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||r(["before","start","left","center","body","content","end","right","actions","after","title","subtitle","meta"])),ie=ae(["cms-toolbar",fe(G,"structured"),fe(e.dense,"dense"),fe(e.divider,"divider"),fe(e.elevated,"elevated"),fe(e.sticky,"sticky"),e.class]),D=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"]);D.class=ie;const $={...e.style||{}};$.display=$.display||"flex";const Y=ze(e.align),W=ze(e.justify),le=ze(e.wrap,U=>typeof U=="boolean"?U?"wrap":"nowrap":String(U),"wrap"),me=ze(e.gap,Be,"var(--cms-s-md)"),re=We(e,"gap");$["--cms-toolbar-gap"]=me!=null?me:"var(--cms-s-md)",re||($.gap=$.gap||"var(--cms-toolbar-gap)");const oe={xxs:"4px 6px",xs:"6px 8px",sm:"6px 10px",md:"10px 12px",lg:"12px 16px",xl:"14px 18px",xxl:"16px 20px"},se=ze(e.size,U=>oe[U]||"");if(se!=null&&($.padding=se),G?($.flexDirection=$.flexDirection||"column",$.alignItems=$.alignItems||"stretch"):(Y!=null&&($.alignItems=Y),W!=null&&($.justifyContent=W),le!=null&&($.flexWrap=le)),Object.keys($).length&&(D.style=$),JSswift.uiApplyResponsiveProps(D,e,JSswift.uiResponsiveStyleRules),!G){const U=E(s,"default",C,n),ce=_.div(D,...U);return Ke(ce,e),ce}const te=(j=(J=e.bodyClass)!=null?J:e.centerClass)!=null?j:e.contentClass,M=qe([e.justify],()=>{const U=l(e.justify);return!U||U==="flex-start"?"auto":""}),Q={display:"flex",alignItems:"inherit",gap:"var(--cms-toolbar-gap)",flexWrap:"inherit",minWidth:0},q={};Y!=null&&(q.alignItems=Y),W!=null&&(q.justifyContent=W),le!=null&&(q.flexWrap=le);const ue=Z.length||b.length||P.length?_.div({class:ae(["cms-toolbar-copy",e.copyClass])},Z.length?_.div({class:ae(["cms-toolbar-meta",e.metaClass])},...Z):null,b.length?_.div({class:ae(["cms-toolbar-title",e.titleClass])},...b):null,P.length?_.div({class:ae(["cms-toolbar-subtitle",e.subtitleClass])},...P):null):null,L=!!(i.length||ue||y.length||R.length),f=[u.length?_.div({class:ae(["cms-toolbar-before",e.beforeClass]),style:{...Q}},...u):null,L?_.div({class:"cms-toolbar-main",style:q},i.length?_.div({class:ae(["cms-toolbar-start",e.startClass]),style:{...Q}},...i):null,ue||y.length?_.div({class:ae(["cms-toolbar-center",te]),style:{...Q,flex:"1 1 240px"}},ue,...y):null,R.length?_.div({class:ae(["cms-toolbar-end",e.endClass]),style:{...Q,justifyContent:"flex-end",marginInlineStart:M}},...R):null):null,v.length?_.div({class:ae(["cms-toolbar-after",e.afterClass]),style:{...Q}},...v):null].filter(Boolean),m=_.div(D,...f);return Ke(m,e),m};const Jo=t=>{var e;return t&&t.nodeType===1&&((e=t.classList)==null?void 0:e.contains("cms-grid-col"))};he.Grid=(...t)=>{var m,g,F,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=l(e.items),r=Array.isArray(o)?o:o==null?[]:[o],C=(a={})=>{const S=e.itemProps||{},h={...S,...a};return h.class=ae([S.class,e.itemClass,a.class]),h.style={...S.style||{},...e.itemStyle||{},...a.style||{}},h},u=(a,S={})=>{if(a==null||a===!1)return[];if(Jo(a))return[a];if(_n(a)){const h=a.children!=null?Zt(a.children):a.content!=null?Zt(a.content):a.node!=null?Zt(a.node):a.label!=null?Zt(a.label):[];return[he.GridCol(C(a),...h)]}return Array.isArray(a)?[he.GridCol(C(S),...a)]:[he.GridCol(C(S),a)]},i=(a,S,h,J=!0)=>{if(a==null||a===!1)return[];const j=_n(a)?a:{};if(J){const U={item:a,index:S,count:h,first:S===0,last:S===h-1},ce=E(s,"item",U,null);if(ce.length)return ce.flatMap(k=>u(k,j))}return u(a,j)},y=[];r.forEach((a,S)=>{y.push(...i(a,S,r.length))}),E(s,"default",{items:r,count:r.length},n).forEach(a=>{y.push(...u(a))}),y.length||E(s,"empty",{items:r,count:0},e.empty).forEach(S=>{const h=u(S,{style:{gridColumn:"1 / -1"}});y.push(...h)});const v=ae(["cms-grid",JSswift.uiResponsiveClasses({mobile:e},Zs),JSswift.uiResponsiveClasses(e,Zs),fe(e.dense,"dense"),fe(e.inline,"cms-grid-inline"),fe(e.debug,"cms-grid-debug"),e.class]),b=JSswift.omit(e,["gap","rowGap","columnGap","colGap","cols","columns","rows","areas","align","justify","alignItems","justifyItems","placeItems","placeContent","dense","flow","inline","debug","autoFit","autoFill","min","max","autoRows","items","itemClass","itemStyle","itemProps","empty","slots","full","width","minWidth","maxWidth","padding",...JSswift.uiResponsiveOmitProps]);b.class=v;const P={...e.style||{}};(m=JSswift.uiResponsiveHasConfig)!=null&&m.call(JSswift,e)&&e.display==null&&!We(e,"display")&&P.display==null&&(P.display=e.inline?"inline-grid":"grid");const Z=ze(e.gap,Be);Z!=null&&!We(e,"gap")&&(P["--cms-grid-gap"]=Z,P.gap=Z);const G=ze(e.rowGap,Be);G!=null&&!We(e,"rowGap")&&(P.rowGap=G);const ie=ze((g=e.columnGap)!=null?g:e.colGap,Be);ie!=null&&!We(e,["columnGap","colGap"])&&(P.columnGap=ie);const D=ze(e.max,Be,"1fr"),$=ze(e.min,Be);if($!=null){const a=l(e.autoFill)?"auto-fill":"auto-fit";P.gridTemplateColumns=`repeat(${a}, minmax(${$}, ${D||"1fr"}))`}else{const a=ze((F=e.columns)!=null?F:e.cols,S=>typeof S=="number"?`repeat(${S}, minmax(0, 1fr))`:String(S));a!=null&&!We(e,["cols","columns"])&&(P.gridTemplateColumns=a)}const Y=ze(e.rows,a=>typeof a=="number"?`repeat(${a}, minmax(0, auto))`:String(a));Y!=null&&(P.gridTemplateRows=Y);const W=ze(e.autoRows,Be);W!=null&&(P.gridAutoRows=W);const le=ze(e.flow,a=>{const S=String(a);return e.dense&&!S.includes("dense")?`${S} dense`:S});le!=null&&!We(e,"flow")&&(P.gridAutoFlow=le);const me=ze(e.areas,a=>Array.isArray(a)?a.map(S=>`"${Array.isArray(S)?S.join(" "):String(S)}"`).join(" "):String(a));me!=null&&(P.gridTemplateAreas=me);const re=ze((X=e.align)!=null?X:e.alignItems);re!=null&&!We(e,["align","alignItems"])&&(P.alignItems=re);const oe=ze(e.justify);oe!=null&&!We(e,"justify")&&(P.justifyContent=oe);const se=ze(e.justifyItems);se!=null&&(P.justifyItems=se);const te=ze(e.placeItems);te!=null&&(P.placeItems=te);const M=ze(e.placeContent);M!=null&&(P.placeContent=M);const Q=ze(e.width,Be);Q!=null&&!We(e,"width")&&(P.width=Q),l(e.full)===!0&&(P.width="100%");const q=ze(e.minWidth,Be);q!=null&&!We(e,"minWidth")&&(P.minWidth=q);const ue=ze(e.maxWidth,Be);ue!=null&&!We(e,"maxWidth")&&(P.maxWidth=ue);const L=ze(e.padding,Be);L!=null&&!We(e,"padding")&&(P.padding=L),Object.keys(P).length&&(b.style=P),JSswift.uiApplyResponsiveProps(b,e,JSswift.uiResponsiveStyleRules);const f=_.div(b,...y);return Ke(f,e),f},he.GridCol=(...t)=>{var Ce,pe,Ie,_e,z,we,T,x;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=w=>Object.prototype.hasOwnProperty.call(e,w),r=(w,c,A={})=>{const de=Array.isArray(w)?w:[w];for(const Le of de)if(JSswift.ui.getSlot(s,Le)!=null)return E(s,Le,A,c);return c==null?[]:E(null,"default",A,c)},C=w=>{var c;return w==null||w===!1||w===""?"":typeof w=="string"&&((c=JSswift.uiSizes)!=null&&c.includes(w))?`var(--cms-s-${w})`:Be(w)},u=w=>{var c;return w==null||w===!1||w===""?"":typeof w=="string"&&((c=JSswift.uiSizes)!=null&&c.includes(w))?ms(w,"size"):Be(w)},i={...e.style||{}},y=w=>{if(w==null||w==="")return null;if(w==="auto")return"auto";if(w==="full"||w===!0)return"1 / -1";const c=Number(w);if(Number.isFinite(c)&&c>0){const A=Math.max(1,Math.round(c));return`span ${A} / span ${A}`}return String(w)},R=w=>{if(w==null||w==="")return null;if(w==="full"||w===!0)return"1 / -1";const c=Number(w);if(Number.isFinite(c)&&c>0){const A=Math.max(1,Math.round(c));return`span ${A} / span ${A}`}return String(w)},v=o("span")?e.span:e.col,b=ze(v,y),P=ze(e.sm,y),Z=ze(e.md,y),G=ze(e.lg,y),ie=JSswift.uiResponsivePropsFor(e,pn("tablet"))||{},D=JSswift.uiResponsivePropsFor(e,pn("pc"))||{},$=(Ce=ie.span)!=null?Ce:ie.col,Y=(pe=D.span)!=null?pe:D.col,W=ze($,y),le=ze(Y,y),me=ze(e.rowSpan,R),re=ze(e.row,R),oe=ze(e.area),se=ze(e.align),te=ze(e.justify),M=ze(e.place),Q=ze(e.gap,C),q=ze(e.rowGap,C),ue=ze(e.columnGap,C),L=ze(e.padding,C),f=ze(e.width,u),m=ze(e.minHeight,u),g=ze(e.height,u),F=ze(e.maxHeight,u),X=ze(e.contentAlign),a=ze(e.contentJustify),S=ze(e.direction),h=ze(e.scroll,w=>w===!0?"auto":String(w),""),J=ze(e.fullHeight,w=>w?"100%":"",""),j=qe([e.center,e.contentAlign,e.contentJustify],()=>!!l(e.center)&&(l(e.contentAlign)==null||l(e.contentAlign)==="")&&(l(e.contentJustify)==null||l(e.contentJustify)==="")),U={props:e},ce=r(["start","top","header","before"],(z=(_e=(Ie=e.start)!=null?Ie:e.top)!=null?_e:e.header)!=null?z:e.before,U),k=o("body")?e.body:o("content")?e.content:n,d=r(["body","content","default"],k,U),N=r(["end","bottom","footer","after"],(x=(T=(we=e.end)!=null?we:e.bottom)!=null?T:e.footer)!=null?x:e.after,U),I=ce.length||N.length||o("start")||o("top")||o("header")||o("before")||o("body")||o("content")||o("end")||o("bottom")||o("footer")||o("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,H=qe([e.stack,e.gap,e.rowGap,e.columnGap,e.contentAlign,e.contentJustify,e.direction,e.center],()=>I||l(e.stack)||[l(e.gap),l(e.rowGap),l(e.columnGap),l(e.contentAlign),l(e.contentJustify),l(e.direction)].some(c=>c!=null&&c!==!1&&c!=="")?!0:!!l(e.center)),ge=qe([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],()=>!!(l(e.panel)||l(e.color)||l(e.clickable)||l(e.border)||l(e.glossy)||l(e.glow)||l(e.glass)||l(e.shadow)||l(e.outline)||l(e.gradient)||l(e.textGradient)||l(e.lightShadow)||l(e.radius))?["cms-clear-set","cms-singularity","cms-grid-col-surface"]:[]),Se=ae(["cms-grid-col",ge,JSswift.uiResponsiveClasses({mobile:e},el),JSswift.uiResponsiveClasses(e,el),fe(e.panel,"cms-grid-col-panel"),fe(e.auto,"is-auto"),fe(H,"cms-grid-col-stack"),fe(e.inline,"cms-grid-col-inline"),fe(j,"cms-grid-col-center"),e.class]),ye=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]);ye.class=Se,i["--cms-grid-col-base"]==null&&(i["--cms-grid-col-base"]="auto"),i["--cms-grid-col-tablet"]==null&&(i["--cms-grid-col-tablet"]="var(--cms-grid-col-base, auto)"),i["--cms-grid-col-pc"]==null&&(i["--cms-grid-col-pc"]="var(--cms-grid-col-tablet, var(--cms-grid-col-base, auto))"),l(e.auto)===!0?i["--cms-grid-col-base"]="auto":b!=null&&(i["--cms-grid-col-base"]=b),P!=null&&(i["--cms-grid-col-sm"]=P),Z!=null&&(i["--cms-grid-col-md"]=Z),G!=null&&(i["--cms-grid-col-lg"]=G),W!=null&&(i["--cms-grid-col-tablet"]=W),le!=null&&(i["--cms-grid-col-pc"]=le),me!=null?i.gridRow=me:re!=null&&(i.gridRow=re),oe!=null&&(i.gridArea=oe),se!=null&&!We(e,"align")&&(i.alignSelf=se),te!=null&&!We(e,"justify")&&(i.justifySelf=te),M!=null&&!We(e,"place")&&(i.placeSelf=M),Q!=null&&!We(e,"gap")&&(i.gap=Q),q!=null&&!We(e,"rowGap")&&(i.rowGap=q),ue!=null&&!We(e,"columnGap")&&(i.columnGap=ue),L!=null&&!We(e,"padding")&&(i.padding=L),f!=null&&!We(e,"width")&&(i.width=f),J!=null&&J!==""?i.height=J:g!=null&&!We(e,"height")&&(i.height=g),m!=null&&!We(e,"minHeight")&&(i.minHeight=m),F!=null&&!We(e,"maxHeight")&&(i.maxHeight=F),S!=null&&!We(e,"direction")&&(i.flexDirection=S),X!=null&&!We(e,"contentAlign")?i.alignItems=X:j!=null&&j!==""&&(i.alignItems=j?"center":""),a!=null&&!We(e,"contentJustify")?i.justifyContent=a:j!=null&&j!==""&&(i.justifyContent=j?"center":""),h!=null&&h!==""&&(i.overflow=h),Object.keys(i).length&&(ye.style=i),JSswift.uiApplyResponsiveProps(ye,e,Ao);const V=e.onClick,O=e.onKeydown,K=!!(l(e.clickable)||l(e.to)),ke=w=>{var A;if(V==null||V(w),w.defaultPrevented)return;const c=l(e.to);c&&((A=JSswift.router)!=null&&A.navigate)&&(w.preventDefault(),JSswift.router.navigate(c))},Ne=w=>{O==null||O(w),!w.defaultPrevented&&(w.key==="Enter"||w.key===" ")&&(w.preventDefault(),ke(w))};if(K&&(ye.onClick=ke,ye.onKeydown=Ne,ye.tabIndex==null&&(ye.tabIndex=0),ye.role==null&&(ye.role="button")),!I){const w=_.div(ye,...E(s,"default",U,n));return Ke(w,e),w}const ee={display:"flex",flexDirection:"column",gap:"inherit",minWidth:0},xe=[ce.length?_.div({class:ae(["cms-grid-col-start",e.startClass,e.topClass,e.headerClass]),style:{...ee}},...ce):null,d.length?_.div({class:ae(["cms-grid-col-body",e.bodyClass,e.contentClass]),style:{...ee,flex:"1 1 auto"}},...d):null,N.length?_.div({class:ae(["cms-grid-col-end",e.endClass,e.bottomClass,e.footerClass]),style:{...ee}},...N):null].filter(Boolean),be=_.div(ye,...xe);return Ke(be,e),be},he.Icon=(...t)=>{var re,oe;let e={},n=[],s="home",o=!1;const r=t[0],C=t[1],u=se=>se&&typeof se=="object"&&!se.nodeType&&!Array.isArray(se)&&!(se instanceof Function);typeof r=="string"?(s=r,o=!0,u(C)?(e=C,t.length>2&&(n=t.slice(2))):t.length>1&&(n=t.slice(1))):u(r)?(e=r,r.name!=null&&(s=r.name,o=!0),t.length>1&&(n=t.slice(1))):t.length&&(n=t),!o&&n.length&&(s=n.length===1?n[0]:n),Yt(e);const i=e.slots||{},y=l(e.size),R=l(e.color),v=String(s).endsWith("-fill"),b={...e.style||{}},P=qe(e.size,()=>{const se=l(e.size);return typeof se=="string"&&kn[se]?se:""}),Z=!!(e.color||e.clickable||e.border||e.glossy||e.glow||e.glass||e.shadow||e.outline||e.gradient||e.textGradient||e.lightShadow||e.radius),G={"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"}]}},ie=se=>{const te=G[se];return te?_.svg({width:"100%",height:"100%",viewBox:te.viewBox,fill:"none","aria-hidden":"true",focusable:"false"},...te.paths.map(M=>_.path(M))):null},D=se=>{const te=l(e.tooltip);if(te==null||te===!1||!he.Tooltip)return se;const M=u(te)?{...te}:{text:te};return u(e.tooltipProps)&&Object.assign(M,e.tooltipProps),he.Tooltip({...M,target:se})},$=ae(["cms-icon","material-icons",...Z?["cms-clear-set","cms-singularity"]:[],P,e.class]),Y=JSswift.omit(e,["name","size","class","style","label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots","spriteUrl","tooltip","tooltipProps"]);if(Y.class=$,Object.keys(b).length&&(Y.style=b),typeof s=="function"||s&&typeof s=="object"){const se=JSswift.ui.renderSlot(i,"default",{},s),te=E(null,"default",{},se),M=_.span({...Y,"data-icon":"custom"},...te);return Ke(M,e),D(M)}const W=String(s),le=W.includes("#")?W:"";let me=null;if(le){const se=e.spriteUrl||((re=JSswift.config)==null?void 0:re.iconSpriteUrl)||(typeof globalThis!="undefined"?(oe=globalThis.JSswift_setting)==null?void 0:oe.iconSpriteUrl:null),te=le.slice(le.indexOf("#")+1),M=se?_.svg({width:"100%",height:"100%"},_.use({href:se+le})):ie(te)||_.svg({width:"100%",height:"100%"},_.use({href:le}));v&&(M.style.fill="currentColor"),me=_.span({...Y,"data-icon":W},M,...n)}else me=_.span({...Y,"data-icon":W},W,...n);if(y!=null){let se=y;JSswift.uiSizes.includes(y)&&(se=`var(--cms-icon-size-${y})`),se=typeof se=="number"?se+"px":String(se),me.style.setProperty("--set-icon-size",se)}return Ke(me,e),D(me)},he.Badge=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{const G=l(e.size);return typeof G=="string"&&kn[G]?`cms-size-${G}`:""}),r=ae(["cms-clear-set","cms-badge","cms-singularity",o,fe(e.outline,"outline"),e.class]),C=JSswift.omit(e,["label","color","outline","size","slots","notification","iconSize","topLeft","topRight","bottomLeft","bottomRight","left","right"]);C.class=r;const u={...e.style||{}};if(e.size){const G=l(e.size);typeof G=="string"&&kn[G]||(u.fontSize=Be(e.size))}C.style=u;const i=(G,ie,D)=>{const $=Array.isArray(G)?G:[G];for(const Y of $)if(JSswift.ui.getSlot(s,Y)!=null)return E(s,Y,ie,D);return D==null||D===!1||D===""?[]:E(null,"default",ie,D)},y=()=>{var ie;const G=l((ie=e.iconSize)!=null?ie:e.size);return typeof G=="number"?Math.max(10,Math.round(G*.85)):typeof G=="string"&&{xxs:10,xs:11,sm:12,md:13,lg:14,xl:16,xxl:18,xxxl:20}[G]||14},R=(G,ie)=>{const D=l(G);return D==null||D===!1||D===""?null:typeof D=="string"?he.Icon({name:D,size:y()}):JSswift.ui.slot(D,{as:ie})},v=(G,ie,D)=>_.dynamic(()=>{const $=R(e[ie],D),Y=i(G,{position:D},$);return Y.length?_.span({class:`cms-badge-anchor cms-badge-anchor-${D}`,"data-badge-slot":D},...Y):null}),b=_.dynamic(()=>{const G=l(e.label);let ie=i(["label"],{},G);return ie.length||(ie=i(["default"],{},n)),_.span({class:"cms-badge-content"},_.span({class:"cms-badge-label"},...ie.length?ie:[""]))}),P=_.dynamic(()=>{const G=l(e.notification),ie=G==null||G===!1||G===""?null:G,D=i(["notification"],{notification:G},ie);return D.length?_.span({class:"cms-badge-notification","data-badge-slot":"notification","aria-label":typeof G=="number"?`${G} notifications`:null},...D):null}),Z=_.span(v(["left"],"left","left"),v(["centerLeft","center-left"],"centerLeft","center-left"),C,b,v(["topLeft","top-left"],"topLeft","top-left"),v(["topRight","top-right"],"topRight","top-right"),v(["bottomLeft","bottom-left"],"bottomLeft","bottom-left"),v(["bottomRight","bottom-right"],"bottomRight","bottom-right"),v(["centerRight","center-right"],"centerRight","center-right"),v(["right"],"right","right"),P);return(e.topLeft||e.centerLeft||e.bottomLeft)&&Z.style.setProperty("padding-left","15px"),(e.topRight||e.centerRight||e.bottomRight)&&Z.style.setProperty("padding-right","15px"),Ke(Z,e),Z};const Eo=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(""):""},sl=(t,e)=>{const n=t==null||t===!0?e:t;if(n==null||n===!1)return mt(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":mt(s)||mt(e)},ll=(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)),To=(t,e)=>{if(t==null||t===!1){if(!e)return null;const s=sl(null,e);return _.span({class:ae(["cms-avatar-status",s?`cms-state-${s}`:""])})}if(t instanceof Node||Array.isArray(t)||typeof t=="function")return t;const n=sl(t,e);return t===!0||n?_.span({class:ae(["cms-avatar-status",n?`cms-state-${n}`:""])}):ll(t,"cms-avatar-badge")},Bn=(t,e)=>!e||!e.length?null:_.span({class:ae(["cms-avatar-anchor",t])},...e);he.Avatar=(...t)=>{var g,F,X;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{var S;const a=l(e.size);return typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?`cms-size-${a}`:""}),r=qe([e.color,e.state],()=>{const a=l(e.color)||l(e.state)||"",S=mt(a);return S?`cms-state-${S}`:""}),C=ae(["cms-clear-set","cms-avatar","cms-singularity",o,r,fe(e.square,"cms-avatar-square"),fe(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=C;const i={...e.style||{}},y=ze(e.size,a=>{var S;return typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?"":Be(a)},"");y!=null&&(i.width=y,i.height=y);const R=(g=e.fontSize)!=null?g:e.textSize,v=R!=null?ze(R,Be):ze(e.size,a=>{var S;return typeof a=="string"&&((S=JSswift.uiSizes)!=null&&S.includes(a))?"":`clamp(11px, calc(${Be(a)} * 0.34), 28px)`},"");v!=null&&(i.fontSize=v);const b=ze(e.radius,a=>{const S=no(a);return S==="xxxl"?"999px":S?`var(--cms-r-${S})`:typeof a=="number"?`${a}px`:String(a)});b!=null&&(i["--set-border-radius"]=b),u.style=i;const P={props:e},Z=qe([e.alt,e.label,e.name,e.text],()=>{const a=l(e.alt)||l(e.label)||l(e.name)||l(e.text)||"avatar";return String(a)}),G=e.icon!=null?typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,ie=qe([e.initials,e.text,e.label,e.name],()=>{var h,J;const a=(h=l(e.initials))!=null?h:l(e.text);if(a!=null)return a;const S=(J=l(e.label))!=null?J:l(e.name);return typeof S=="string"?Eo(S):S}),D=ll(l((F=e.badge)!=null?F:e.notification)),$=To(l((X=e.status)!=null?X:e.presence),l(e.statusColor));let Y=E(s,"media",P,e.media);if(!Y.length&&e.src){const a={class:"cms-avatar-img",src:e.src,alt:Z,sizes:e.sizes,style:{}};e.srcset!=null&&(a.srcset=e.srcset),e.srcSet!=null&&(a.srcset=e.srcSet);const S=ze(e.fit);S!=null&&(a.style.objectFit=S),Y=[_.img(a)]}const W=E(s,"default",P,n),le=E(s,"fallback",P,null),me=E(s,"label",P,ie),re=E(s,"icon",P,G),oe=Y.length?Y:W.length?W:le.length?le:me.length?me:re.length?re:["?"],se=Y.length?"cms-avatar-media":"cms-avatar-fallback",te=_.span({class:"cms-avatar-body"},_.span({class:se},...oe));let M=E(s,"topLeft",P,e.topLeft),Q=E(s,"topRight",P,e.topRight),q=E(s,"bottomLeft",P,e.bottomLeft),ue=E(s,"bottomRight",P,e.bottomRight);const L=E(s,"badge",P,D),f=E(s,"status",P,$);!Q.length&&L.length&&(Q=L),!ue.length&&f.length&&(ue=f);const m=_.div(u,te,Bn("cms-avatar-anchor-top-left",M),Bn("cms-avatar-anchor-top-right",Q),Bn("cms-avatar-anchor-bottom-left",q),Bn("cms-avatar-anchor-bottom-right",ue));return Ke(m,e),m},he.Chip=(...t)=>{var ie,D,$,Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{const W=l(e.size);return typeof W=="string"&&kn[W]?W:""}),r=ae(["cms-clear-set","cms-chip","cms-singularity",o,e.class]),C=JSswift.omit(e,["label","border","color","icon","iconRight","removable","onRemove","dense","flat","glossy","outline","slots"]);C.class=r,C.style={...e.style||{}};const u=e.icon?typeof e.icon=="string"?he.Icon({name:e.icon,size:(ie=e==null?void 0:e.size)!=null?ie:null}):JSswift.ui.slot(e.icon,{as:"icon"}):null,i=e.iconRight?typeof e.iconRight=="string"?he.Icon({name:e.iconRight,size:(D=e==null?void 0:e.size)!=null?D:null}):JSswift.ui.slot(e.iconRight,{as:"iconRight"}):null,y=JSswift.ui.renderSlot(s,"icon",{},u),R=JSswift.ui.renderSlot(s,"iconRight",{},i),v=E(s,"label",{},e.label),b=v.length?v:E(s,"default",{},n),P=E(null,"default",{},y),Z=E(null,"default",{},R),G=_.span(C,...P,...b.length?b:[""],...Z);if(e.removable){const W=he.Btn({class:"cms-chip-remove",onClick:e.onRemove,size:($=e==null?void 0:e.size)!=null?$:null},he.Icon({size:(Y=e==null?void 0:e.size)!=null?Y:null,name:"close"}));G.appendChild(W),W.onclick=()=>{e.onRemove&&e.onRemove(),G.remove()}}return Ke(G,e),G},he.Stat=(...t)=>{var re,oe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.state)||l(e.color)||""),r=qe([e.state,e.color],()=>{const se=o();return se?`cms-state-${se}`:""}),C=qe(e.trend,()=>{const se=String(l(e.trend)||"").toLowerCase();return["up","positive","success","gain","increase"].includes(se)?"is-positive":["down","negative","danger","loss","decrease"].includes(se)?"is-negative":["flat","neutral","steady","stable"].includes(se)?"is-neutral":""}),u={...e},i=JSswift.omit(u,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","meta","note","slots","state","subtitle","title","trend","value"]);i.class=ae(["cms-clear-set","cms-stat","cms-singularity",r,C,u.class]),i.style={...u.style||{}};const y=(se,te,M={})=>E(s,se,M,te),R=e.icon==null?null:typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"md"}):JSswift.ui.slot(e.icon,{as:"icon"}),v=y("eyebrow",e.eyebrow),b=y("label",(re=e.label)!=null?re:e.title),P=y("value",e.value),Z=y("note",(oe=e.note)!=null?oe:e.subtitle),G=y("meta",e.meta),ie=y("delta",e.delta,{trend:e.trend}),D=y("icon",R),$=y("aside",e.aside),Y=y("footer",e.footer),W=y("actions",e.actions),le=y("default",n),me=_.article(i,_.div({class:"cms-stat-head"},_.div({class:"cms-stat-lead"},D.length?_.div({class:"cms-stat-icon"},...D):null,_.div({class:"cms-stat-copy"},v.length?_.div({class:"cms-stat-eyebrow"},...v):null,b.length?_.div({class:"cms-stat-label"},...b):null)),$.length?_.div({class:"cms-stat-aside"},...$):null),_.div({class:"cms-stat-body"},P.length?_.div({class:"cms-stat-value"},...P):null,ie.length?_.div({class:"cms-stat-delta"},...ie):null,Z.length?_.div({class:"cms-stat-note"},...Z):null,G.length?_.div({class:"cms-stat-meta"},...G):null,le.length?_.div({class:"cms-stat-extra"},...le):null),Y.length||W.length?_.div({class:"cms-stat-footer"},Y.length?_.div({class:"cms-stat-footer-copy"},...Y):null,W.length?_.div({class:"cms-stat-actions"},...W):null):null);return Ke(me,e),me},he.Kpi=(...t)=>{var re,oe;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.state)||l(e.color)||""),r=qe([e.state,e.color],()=>{const se=o();return se?`cms-state-${se}`:""}),C={...e},u=JSswift.omit(C,["actions","aside","delta","eyebrow","footer","icon","iconSize","label","media","meta","note","slots","state","subtitle","title","trend","value"]);u.class=ae(["cms-clear-set","cms-kpi","cms-singularity",r,C.class]),u.style={...C.style||{}};const i=(se,te,M={})=>E(s,se,M,te),y=e.icon==null?null:typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"lg"}):JSswift.ui.slot(e.icon,{as:"icon"}),R=i("eyebrow",e.eyebrow),v=i("title",(re=e.title)!=null?re:e.label),b=i("value",e.value),P=i("delta",e.delta,{trend:e.trend}),Z=i("note",(oe=e.note)!=null?oe:e.subtitle),G=i("meta",e.meta),ie=i("icon",y),D=i("aside",e.aside),$=i("media",e.media),Y=i("footer",e.footer),W=i("actions",e.actions),le=i("default",n),me=_.section(u,_.div({class:"cms-kpi-head"},_.div({class:"cms-kpi-title-wrap"},ie.length?_.div({class:"cms-kpi-icon"},...ie):null,_.div({class:"cms-kpi-copy"},R.length?_.div({class:"cms-kpi-eyebrow"},...R):null,v.length?_.div({class:"cms-kpi-title"},...v):null)),D.length?_.div({class:"cms-kpi-aside"},...D):null),_.div({class:"cms-kpi-core"},_.div({class:"cms-kpi-value-wrap"},b.length?_.div({class:"cms-kpi-value"},...b):null,P.length?_.div({class:"cms-kpi-delta"},...P):null),Z.length?_.div({class:"cms-kpi-note"},...Z):null,G.length?_.div({class:"cms-kpi-meta"},...G):null,$.length?_.div({class:"cms-kpi-media"},...$):null,le.length?_.div({class:"cms-kpi-extra"},...le):null),Y.length||W.length?_.div({class:"cms-kpi-footer"},Y.length?_.div({class:"cms-kpi-footer-copy"},...Y):null,W.length?_.div({class:"cms-kpi-actions"},...W):null):null);return Ke(me,e),me};const Ro=(t,e=180)=>{const n=getComputedStyle(t).transitionDuration;if(!n)return e;const s=n.split(",")[0].trim();if(!s)return e;const o=s.includes("ms")?parseFloat(s):parseFloat(s)*1e3;return Number.isFinite(o)?o:e},bn=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"))}))},yn=(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=r=>{r.target===t.panel&&(t.panel.removeEventListener("transitionend",s),n())};t.panel.addEventListener("transitionend",s);const o=Ro(t.panel,180);setTimeout(n,o+40)};he.List=(...t)=>{var D;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=!!l((D=e.number)!=null?D:e.ordered),r=l(e.marker),C=l(e.items),u=Array.isArray(C)?C:C==null?[]:[C],i=($={})=>{const Y=e.itemProps||{},W={...Y,...$};return e.divider!=null&&W.divider==null&&(W.divider=e.divider),W.class=ae([Y.class,e.itemClass,$.class]),W.style={...Y.style||{},...e.itemStyle||{},...$.style||{}},W},y=$=>{if($==null||$===!1)return[];if(rs($))return[$];if(_n($)){const Y=$.children!=null?Zt($.children):$.content!=null?Zt($.content):Zt($.node);return[he.Item(i($),...Y)]}return Array.isArray($)?[he.Item(i(),...$)]:$!=null&&$.nodeType?[he.Item(i(),$)]:[he.Item(i(),$)]},R=($,Y,W,le=!0)=>{if($==null||$===!1)return[];if(le){const me={item:$,index:Y,count:W,first:Y===0,last:Y===W-1},re=E(s,"item",me,null);if(re.length)return re.flatMap(oe=>y(oe))}return y($)},v=[];u.forEach(($,Y)=>{v.push(...R($,Y,u.length))});const b=E(s,"default",{items:u,count:u.length},n);if(b.forEach(($,Y)=>{v.push(...R($,u.length+Y,u.length+b.length,!1))}),!v.length){const $=E(s,"empty",{items:u,count:0},e.empty);$.length&&($.length===1&&rs($[0])?v.push($[0]):v.push(he.Item({class:"cms-item-empty",flat:!0},...$)))}const P=ae(["cms-list",fe(e.dense,"dense"),fe(e.divider,"divider"),fe(r===!1||r==="none","cms-list-no-marker"),e.class]),Z=JSswift.omit(e,["dense","divider","slots","number","ordered","items","itemClass","itemStyle","itemProps","empty","marker","gap"]);Z.class=P,Z.style={...e.style||{}};const G=ze(e.gap,Be);return G!=null&&(Z.style["--cms-list-gap"]=G),r!=null&&r!==!1&&r!==!0&&r!=="none"&&(Z.style.listStyleType=String(r)),_[o?"ol":"ul"](Z,...v)},he.Item=(...t)=>{var L,f,m,g,F,X,a,S;const{props:e,children:n}=JSswift.uiNormalizeArgs(t);e.state!=null&&e.color==null&&(e.color=e.state),Yt(e);const s=e.slots||{},o=qe([e.clickable,e.to],()=>!!(l(e.clickable)||l(e.to))),r=qe([e.active,e.selected],()=>!!(l(e.active)||l(e.selected))),C=!!(e.color!=null||e.outline||e.border||e.glossy||e.glow||e.glass||e.shadow||e.gradient||e.textGradient||e.lightShadow||e.radius||e.rounded||e.flat),u=(h,J,j)=>{const U=l(h);return U==null||U===!1||U===""?null:typeof U=="string"?he.Icon({name:U,size:J||"sm"}):JSswift.ui.slot(U,{as:j})},i=E(s,"icon",{},u(e.icon,e.iconSize||e.size,"icon")),y=E(s,"title",{},(L=e.title)!=null?L:e.label),R=E(s,"subtitle",{},(m=(f=e.subtitle)!=null?f:e.caption)!=null?m:e.description),v=E(s,"meta",{},(g=e.meta)!=null?g:e.eyebrow),b=E(s,"body",{},(F=e.body)!=null?F:e.content),P=E(s,"default",{},n),Z=E(s,"actions",{},(X=e.actions)!=null?X:e.footer),G=(S=(a=e.aside)!=null?a:e.trailing)!=null?S:u(e.iconRight,e.iconSize||e.size,"iconRight"),ie=E(s,"aside",{},G),D=[...b,...P],$=!(C||e.clickable||e.to||i.length||y.length||R.length||v.length||Z.length||ie.length||b.length),Y=ae(["cms-item",fe(e.divider,"divider"),fe(C,"cms-clear-set"),fe(C,"cms-singularity"),fe(C,"cms-item-surface"),fe($,"cms-item-inline"),fe(o,"cms-item-clickable"),fe(r,"is-active"),fe(e.disabled,"is-disabled"),e.class]),W=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"]);W.class=Y,W.style={...e.style||{}};const le=e.onClick,me=e.onKeydown,re=h=>{var j;if(le==null||le(h),h.defaultPrevented||l(e.disabled))return;const J=l(e.to);J&&((j=JSswift.router)!=null&&j.navigate)&&(h.preventDefault(),JSswift.router.navigate(J))},oe=h=>{me==null||me(h),!(h.defaultPrevented||l(e.disabled))&&(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),re(h))};l(e.disabled)&&(W["aria-disabled"]="true"),(l(e.clickable)||l(e.to))&&(W.onClick=re,W.onKeydown=oe,W.tabIndex==null&&(W.tabIndex=l(e.disabled)?-1:0),W.role==null&&(W.role="button"));const se=y.length?_.div({class:"cms-item-title"},...y):null,te=R.length?_.div({class:"cms-item-subtitle"},...R):null,M=v.length?_.div({class:"cms-item-meta"},...v):null,Q=D.length?_.div({class:ae(["cms-item-body",fe(!(y.length||R.length||v.length),"is-standalone")])},...D):null,q=Z.length?_.div({class:"cms-item-actions"},...Z):null,ue=_.li(W,_.div({class:"cms-item-row"},i.length?_.div({class:"cms-item-icon"},...i):null,_.div({class:"cms-item-main"},M,se,te,Q,q),ie.length?_.div({class:"cms-item-aside"},...ie):null));return Ke(ue,e),ue},he.Separator=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=ae(["cms-separator",fe(e.vertical,"vertical"),e.class]),s=JSswift.omit(e,["vertical","size","slots"]);s.class=n;const o={borderColor:"var(--cms-border)",...e.style||{}},r=l(e.size),C=l(e.vertical);if(r!=null){const u=Be(r);C?o.width=u:o.height=u}return s.style=o,_.hr(s)},he.Banner=(...t)=>{var ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.type)||l(e.state)||""),r={state:o,dismissible:()=>!!l(e.dismissible)},C=qe([e.type,e.state],()=>o()),u=qe(e.variant,()=>{const L=String(l(e.variant)||"").toLowerCase();return["solid","outline","ghost"].includes(L)?`cms-banner-${L}`:""}),i=qe([e.actionsPlacement,e.stack],()=>String(l(e.actionsPlacement)||"").toLowerCase()==="bottom"||l(e.stack)?"cms-banner-actions-bottom":""),y=qe(e.stack,()=>l(e.stack)?"cms-banner-stack":""),R={...e},v=JSswift.omit(R,["actions","actionsPlacement","accent","aside","body","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","stack","state","subtitle","title","type","variant"]);v.class=ae(["cms-clear-set","cms-banner","cms-singularity",C,u,i,y,R.class]),v.style={...R.style||{}};const b=L=>{if(L==null||L==="")return"";const f=l(L);if(f==null||f==="")return"";const m=String(f);return Qt(m)?`var(--cms-${m})`:m};(e.accent!=null||at(e.accent))&&(v.style["--cms-banner-accent"]=()=>b(e.accent),v.style["--cms-banner-border"]=()=>{const L=b(e.accent);return L?`color-mix(in srgb, ${L} 38%, var(--cms-border-color))`:""},v.style["--cms-banner-bg"]=()=>{const L=b(e.accent);return L?`color-mix(in srgb, ${L} 14%, var(--cms-panel))`:""},v.style["--cms-banner-color"]=()=>{const L=b(e.accent);return L?`color-mix(in srgb, ${L} 78%, white)`:""});const P={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},Z=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||e.size||"md"}):JSswift.ui.slot(e.icon,{as:"icon"});const L=o(),f=L?P[L]:null;return f?he.Icon({name:f,size:e.iconSize||e.size||"md"}):null})(),G=E(s,"title",r,e.title),ie=E(s,"message",r,e.message!=null?e.message:n),D=E(s,"description",r,(ue=e.description)!=null?ue:e.subtitle),$=E(s,"meta",r,e.meta),Y=E(s,"default",r,e.body!=null?[e.body,...n||[]]:e.message!=null?n:null),W=E(s,"icon",r,Z),le=E(s,"aside",r,e.aside),me=E(s,"actions",r,e.actions),re=E(s,"dismiss",r,e.dismiss),oe=String(l(e.actionsPlacement)||"").toLowerCase()==="bottom"||!!l(e.stack),se=!!l(e.dismissible)||!!e.onDismiss;let te=null;const M=se?he.Btn({class:"cms-banner-close",outline:!0,size:e.size||"sm","aria-label":e.closeLabel||"Chiudi banner",onClick:L=>{var f;(f=e.onDismiss)==null||f.call(e,L),!L.defaultPrevented&&(te==null||te.remove())}},he.Icon({name:"close",size:e.size||"sm"})):null,Q=[...le,...oe?[]:me,...re.length?re:M?[M]:[]];te=_.div(v,W.length?_.div({class:"cms-banner-icon"},...W):null,_.div({class:"cms-banner-body"},_.div({class:"cms-banner-copy"},G.length?_.div({class:"cms-banner-title"},...G):null,ie.length?_.div({class:"cms-banner-message"},...ie):null,D.length?_.div({class:"cms-banner-description"},...D):null,Y.length?_.div({class:"cms-banner-extra"},...Y):null,$.length?_.div({class:"cms-banner-meta"},...$):null),oe&&me.length?_.div({class:"cms-banner-actions"},...me):null),Q.length?_.div({class:"cms-banner-side"},...Q):null);const q=v.role||(()=>{const L=o();return L==="danger"||L==="warning"?"alert":"status"})();return te.setAttribute("role",q),Ke(te,e),te},he.Alert=(...t)=>{var W;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.type)||l(e.state)||l(e.color)||"warning"),r=qe([e.type,e.state,e.color],()=>{const le=o();return le?`cms-state-${le}`:""}),C={...e},u=JSswift.omit(C,["actions","aside","closeLabel","description","dismiss","dismissible","icon","iconSize","message","meta","onDismiss","slots","state","subtitle","title","type","variant"]);u.class=ae(["cms-clear-set","cms-alert","cms-singularity",r,fe(e.dismissible,"is-dismissible"),C.class]),u.style={...C.style||{}};const i={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"campaign",dark:"shield",light:"notifications"},y=(()=>{if(e.icon===!1||e.icon===null)return null;if(e.icon!=null)return typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"});const le=i[o()]||i.warning;return he.Icon({name:le,size:e.iconSize||"sm"})})(),R=E(s,"title",{},e.title),v=E(s,"message",{},e.message!=null?e.message:n),b=E(s,"description",{},(W=e.description)!=null?W:e.subtitle),P=E(s,"meta",{},e.meta),Z=E(s,"actions",{},e.actions),G=E(s,"aside",{},e.aside),ie=E(s,"icon",{},y),D=E(s,"dismiss",{},e.dismiss);let $=null;const Y=e.dismissible||e.onDismiss?he.Btn({class:"cms-alert-close",outline:!0,size:"sm","aria-label":e.closeLabel||"Chiudi alert",onClick:le=>{var me;(me=e.onDismiss)==null||me.call(e,le),!le.defaultPrevented&&($==null||$.remove())}},he.Icon({name:"close",size:"sm"})):null;return $=_.div(u,ie.length?_.div({class:"cms-alert-icon"},...ie):null,_.div({class:"cms-alert-body"},R.length?_.div({class:"cms-alert-title"},...R):null,v.length?_.div({class:"cms-alert-message"},...v):null,b.length?_.div({class:"cms-alert-description"},...b):null,P.length?_.div({class:"cms-alert-meta"},...P):null,Z.length?_.div({class:"cms-alert-actions"},...Z):null),G.length||D.length||Y?_.div({class:"cms-alert-side"},...G,...D.length?D:Y?[Y]:[]):null),$.setAttribute("role",o()==="danger"||o()==="warning"?"alert":"status"),Ke($,e),$},he.EmptyState=(...t)=>{var Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=()=>mt(l(e.state)||l(e.color)||""),r=qe([e.state,e.color],()=>{const W=o();return W?`cms-state-${W}`:""}),C={...e},u=JSswift.omit(C,["actions","description","eyebrow","icon","iconSize","illustration","media","message","meta","slots","state","title"]);u.class=ae(["cms-clear-set","cms-empty-state","cms-singularity",r,fe(e.compact,"compact"),fe(e.inline,"inline"),C.class]),u.style={...C.style||{}};const i=e.icon===!1?null:e.icon!=null?typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||"xl"}):JSswift.ui.slot(e.icon,{as:"icon"}):he.Icon({name:"inbox",size:e.iconSize||"xl"}),y=E(s,"illustration",{},(Y=e.illustration)!=null?Y:e.media),R=E(s,"icon",{},i),v=E(s,"eyebrow",{},e.eyebrow),b=E(s,"title",{},e.title),P=E(s,"message",{},e.message!=null?e.message:n),Z=E(s,"description",{},e.description),G=E(s,"meta",{},e.meta),ie=E(s,"actions",{},e.actions),D=E(s,"default",{},e.message!=null?n:null),$=_.section(u,y.length?_.div({class:"cms-empty-state-illustration"},...y):null,R.length?_.div({class:"cms-empty-state-icon"},...R):null,v.length?_.div({class:"cms-empty-state-eyebrow"},...v):null,b.length?_.div({class:"cms-empty-state-title"},...b):null,P.length?_.div({class:"cms-empty-state-message"},...P):null,Z.length?_.div({class:"cms-empty-state-description"},...Z):null,G.length?_.div({class:"cms-empty-state-meta"},...G):null,D.length?_.div({class:"cms-empty-state-extra"},...D):null,ie.length?_.div({class:"cms-empty-state-actions"},...ie):null);return Ke($,e),$};let qt="jsswift:drawer-open";const ol=new Set,hs=new Map,en=(t=qt)=>{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}},Mo=(t,e=qt)=>{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 Et=en();const Wt=(t,e=qt)=>{Et=!!t;const n=hs.get(e);if(n&&n.size)n.forEach(s=>s==null?void 0:s.classList.toggle("open",Et));else{const s=document.querySelector(".cms-drawer");s&&s.classList.toggle("open",Et)}return ol.forEach(s=>{if(!s)return;if(typeof s.update=="function"){s.update(Et);return}const{el:o,openIcon:r,closeIcon:C}=s;o&&(o.textContent=Et?r:C)}),Mo(Et,e),Et};he.Tooltip=(...t)=>{var q,ue;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{};let o=null,r=null,C=null,u=null;const i=L=>Object.prototype.hasOwnProperty.call(e,L),y=i("target")||i("anchorEl")||i("triggerEl"),R=e.target||e.anchorEl||e.triggerEl||(n&&n.length?n[0]:null),v=(L,f)=>{const m=l(L);if(m==null||m==="")return f;const g=Number(m);return Number.isFinite(g)?g:f},b=()=>{clearTimeout(r),clearTimeout(C),r=null,C=null},P=()=>v(e.delay,350),Z=()=>v(e.hideDelay,l(e.interactive)?120:0),G=()=>{if(b(),!o)return;const L=o;o=null,yn(L,()=>JSswift.overlay.close(L.id))},D=(L=>{if(L==null||L===!0)return new Set(["hover","focus"]);if(L===!1)return new Set(["manual"]);const f=Array.isArray(L)?L:String(L).split(/[\s,|/]+/),m=new Set;return f.forEach(g=>{const F=String(g||"").trim().toLowerCase();F&&(F==="mouseenter"||F==="mouseover"?m.add("hover"):F==="blur"||F==="focusin"?m.add("focus"):F==="tap"?m.add("click"):m.add(F))}),m.size?m:new Set(["manual"])})((ue=(q=e.trigger)!=null?q:e.triggers)!=null?ue:i("open")?"manual":null),$=D.has("hover"),Y=D.has("focus"),W=D.has("click"),le=D.has("manual")||!$&&!Y&&!W,me=()=>{var j,U,ce,k,d,N;const L={anchorEl:u||R||null,close:()=>G(),hide:()=>G(),isOpen:()=>!!o},f=e.icon?typeof e.icon=="string"?he.Icon({name:e.icon,size:e.iconSize||e.size||"sm"}):JSswift.ui.slot(e.icon,{as:"icon"}):null,m=E(s,"title",L,(j=e.title)!=null?j:e.heading),g=E(s,"icon",L,f),F=E(s,"footer",L,(U=e.footer)!=null?U:e.actions);let X=(N=(d=(k=(ce=e.content)!=null?ce:e.text)!=null?k:e.body)!=null?d:e.description)!=null?N:e.label;X==null&&(y?X=n:R&&n&&n.length>1?X=n.slice(1):R||(X=n));let a=E(s,"content",L,X);a.length||(a=E(s,"default",L,X));const S=a.length?_.div({class:"cms-tooltip-body"},...a):null,h=g.length||m.length?_.div({class:"cms-tooltip-head"},g.length?_.div({class:"cms-tooltip-icon"},...g):null,_.div({class:"cms-tooltip-head-main"},m.length?_.div({class:"cms-tooltip-title"},...m):null,S)):S,J=F.length?_.div({class:"cms-tooltip-footer"},...F):null;return _.div({class:"cms-tooltip-content"},...[h,J].filter(Boolean))},re=L=>{var a,S,h,J,j,U;const f=L||u;if(!f||l(e.disabled))return null;if(o&&o._anchorEl===f)return o;o&&G();const m=(a=e.closeOnOutside)!=null?a:W||l(e.interactive),g=(S=e.closeOnEsc)!=null?S:W||l(e.interactive);let F=null;if(o=JSswift.overlay.open(()=>me(),{type:"tooltip",anchorEl:f,placement:e.placement||"top",offsetX:(h=e.offsetX)!=null?h:0,offsetY:(j=(J=e.offsetY)!=null?J:e.offset)!=null?j:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:m,closeOnBackdrop:!1,closeOnEsc:g,autoFocus:!1,className:Dt(["cms-tooltip",fe(e.interactive,"interactive"),e.class,e.panelClass]),onClose:()=>{var ce,k;(ce=F==null?void 0:F._tooltipCleanup)==null||ce.call(F),o===F&&(o=null),(k=e.onClose)==null||k.call(e)}}),!(o!=null&&o.panel))return o;const X=o;if(F=X,X._anchorEl=f,X.panel.dataset.placement=String(l(e.placement||"top")),e.maxWidth!=null&&(X.panel.style.maxWidth=Be(l(e.maxWidth))),e.minWidth!=null&&(X.panel.style.minWidth=Be(l(e.minWidth))),e.width!=null&&(X.panel.style.width=Be(l(e.width))),e.style&&Object.assign(X.panel.style,e.style),Ke(X.panel,e),l(e.interactive)){const ce=()=>{clearTimeout(C),C=null},k=()=>se(),d=N=>{const I=N.target;I&&I.closest&&I.closest("[data-tooltip-close]")&&G()};X.panel.addEventListener("mouseenter",ce),X.panel.addEventListener("mouseleave",k),X.panel.addEventListener("focusin",ce),X.panel.addEventListener("focusout",k),X.panel.addEventListener("click",d),X._tooltipCleanup=()=>{var N,I,H,ge,Se;(N=X.panel)==null||N.removeEventListener("mouseenter",ce),(I=X.panel)==null||I.removeEventListener("mouseleave",k),(H=X.panel)==null||H.removeEventListener("focusin",ce),(ge=X.panel)==null||ge.removeEventListener("focusout",k),(Se=X.panel)==null||Se.removeEventListener("click",d)}}return bn(X),(U=e.onOpen)==null||U.call(e,X),X},oe=L=>{clearTimeout(C),C=null,clearTimeout(r),r=setTimeout(()=>re(L),P())},se=(L=!1)=>{if(clearTimeout(r),r=null,!!o){if(clearTimeout(C),L){G();return}C=setTimeout(()=>G(),Z())}},te=L=>{o?se(!0):re(L)},M=()=>!!o,Q=L=>{if(!L)return()=>{};u=L;const f=[],m=()=>{b(),f.forEach(g=>g())};if(i("open"))return at(e.open)?JSswift.reactive.effect(()=>{u&&(l(e.open)?re(u):se(!0))},"UI.Tooltip:open"):e.open===!0?re(L):e.open===!1&&se(!0),m;if(le||l(e.disabled))return m;if($){const g=()=>oe(L),F=()=>se();L.addEventListener("mouseenter",g),L.addEventListener("mouseleave",F),f.push(()=>{L.removeEventListener("mouseenter",g),L.removeEventListener("mouseleave",F)})}if(Y){const g=()=>oe(L),F=()=>se();L.addEventListener("focus",g),L.addEventListener("blur",F),f.push(()=>{L.removeEventListener("focus",g),L.removeEventListener("blur",F)})}if(W){const g=F=>{var X;(X=e.onTriggerClick)==null||X.call(e,F),!F.defaultPrevented&&te(L)};L.addEventListener("click",g),f.push(()=>L.removeEventListener("click",g))}return m};if(R){const L=ae(["cms-tooltip-wrap",e.wrapClass,e.targetClass]),f=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"]);f.class=L,f.style={display:"inline-flex",alignItems:"center",...e.wrapStyle||e.targetStyle||{}};const m=JSswift.ui.renderSlot(s,"target",{open:()=>re(u),show:()=>oe(u),hide:()=>se(!0),toggle:()=>te(u),isOpen:M},R),g=_.span(f,...E(null,"default",{},m));return Q(g),g._tooltip={bind:Q,open:re,show:oe,hide:se,close:G,toggle:te,isOpen:M},g}return{bind:Q,open:re,show:oe,hide:se,close:G,toggle:te,isOpen:M}};const ps=(t,e,n={})=>{var L;const{props:s,children:o}=JSswift.uiNormalizeArgs(e),r=s.slots||{},C=t==="radio",u=n.appearance==="toggle",i=!C,y=s.id||`cms-${t}-`+Math.random().toString(36).slice(2),R=Nt(s.model,n.modelName||(C?"UI.Radio:model":"UI.Checkbox:model")),v=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"]);v.type=t,v.id=y,C&&s.name!=null&&(v.name=s.name),v.class=ae([`cms-${t}`,"cms-choice-input",s.inputClass]);const b=_.input(v),P=E(r,"label",{},s.label),Z=P.length?P:E(r,"default",{},o),G=fs(s,{className:"cms-shortcode cms-choice-shortcode"}),ie=G?[...Z,G]:Z,D=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"]);D.class=ae(["cms-clear-set","cms-singularity-check","cms-choice-wrap",`cms-${t}-wrap`,fe(u,"cms-toggle-wrap"),fe(u&&C,"cms-toggle-radio-wrap"),fe(u&&!C,"cms-toggle-checkbox-wrap"),fe(s.dense,"dense"),s.class]),D.style={...s.style||{}};const $=l(s.size);$!=null&&!(typeof $=="string"&&((L=JSswift.uiSizes)!=null&&L.includes($)))&&(D.style["--cms-choice-size"]=Be($));const Y=_.span({class:ae(["cms-choice-mark",C?"cms-choice-radio-mark":"cms-choice-checkbox-mark",fe(u,"cms-toggle-mark")])}),W=u?_.span({class:"cms-toggle-thumb"}):Y;u&&Y.appendChild(W);const le=ie.length?_.span({class:"cms-choice-label"},...ie):null,me=_.label(D,b,Y,le);Ke(me,s);const re=s.iconSize?s.iconSize:s.size,oe=u?null:C?"radio_button_checked":"check",se=u?null:C?"radio_button_unchecked":null,te=u||C?null:"indeterminate_check_box",M=f=>{if(C)return b.checked=f==s.value,b.checked;const m=f==null?null:!!f;return b.checked=m===!0,b.indeterminate=i&&m==null,m},Q=()=>!C&&i&&b.indeterminate?null:!!b.checked,q=f=>f===!0?s.checkedIcon!=null?s.checkedIcon:s.icon!=null?s.icon:oe:f===!1?s.uncheckedIcon!=null?s.uncheckedIcon:se:s.indeterminateIcon!=null?s.indeterminateIcon:s.standbyIcon!=null?s.standbyIcon:s.iconStandby!=null?s.iconStandby:te,ue=()=>{const f=Q(),m=f===!0;for(;W.firstChild;)W.removeChild(W.firstChild);me.classList.toggle("is-checked",m),me.classList.toggle("is-indeterminate",f==null),me.classList.toggle("is-disabled",!!b.disabled),m&&(s.checkedIcon||s.icon)?me.classList.toggle("toggle-default",!1):m&&!s.checkedIcon||f==null&&!s.standbyIcon?me.classList.toggle("toggle-default",!0):f==null&&s.standbyIcon?me.classList.toggle("toggle-default",!1):b.disabled===!1&&!s.uncheckedIcon?me.classList.toggle("toggle-default",!0):me.classList.toggle("toggle-default",!1),u&&(f==null?W.style.transform="translateX(calc((var(--cms-toggle-width) - var(--cms-toggle-thumb-size) - 1px) / 2))":W.style.removeProperty("transform"));const g={checked:m,state:f,indeterminate:f==null,value:s.value,id:y,type:t};let F=null;if(f===!0?(F=JSswift.ui.renderSlot(r,"checkedIcon",g,null),F==null&&(F=JSswift.ui.renderSlot(r,"iconOn",g,null))):f===!1?(F=JSswift.ui.renderSlot(r,"uncheckedIcon",g,null),F==null&&(F=JSswift.ui.renderSlot(r,"iconOff",g,null))):(F=JSswift.ui.renderSlot(r,"indeterminateIcon",g,null),F==null&&(F=JSswift.ui.renderSlot(r,"standbyIcon",g,null)),F==null&&(F=JSswift.ui.renderSlot(r,"iconStandby",g,null))),F==null&&(F=JSswift.ui.renderSlot(r,"icon",g,null)),F==null){const X=q(f);typeof X=="string"?F=he.Icon({name:X,size:re,...u?{textColor:s.color,outline:!0}:{}}):X!=null&&(F=JSswift.ui.slot(X,{checked:m,state:f,indeterminate:f==null,as:f===!0?"checkedIcon":f===!1?"uncheckedIcon":"indeterminateIcon"}))}E(null,"default",{},F).forEach(X=>W.appendChild(X))};return R?(M(R.get()),R.watch(f=>{M(f),ue()},C?"UI.Radio:watch":"UI.Checkbox:watch"),b.addEventListener("change",f=>{var m,g;if(C)b.checked&&(R.set(s.value),(m=s.onChange)==null||m.call(s,s.value,f));else{const F=Q();R.set(F),(g=s.onChange)==null||g.call(s,F,f)}ue()})):(M(C?s.checked===!0?s.value:void 0:s.checked),b.addEventListener("change",f=>{var m,g;C?(m=s.onChange)==null||m.call(s,s.value,f):(g=s.onChange)==null||g.call(s,Q(),f),ue()})),s.onInput&&b.addEventListener("input",f=>{var m,g;C?(m=s.onInput)==null||m.call(s,s.value,f):(g=s.onInput)==null||g.call(s,Q(),f)}),ue(),an(me,s,{isEnabled:()=>!b.disabled,action:()=>{if(b.disabled)return!1;hn(b),b.click()}}),me};he.Checkbox=(...t)=>ps("checkbox",t),he.Radio=(...t)=>ps("radio",t),he.Toggle=(...t)=>{var s,o,r;const{props:e}=JSswift.uiNormalizeArgs(t),n=String((r=(o=(s=e.behavior)!=null?s:e.mode)!=null?o:e.type)!=null?r:"checkbox").toLowerCase()==="radio"?"radio":"checkbox";return ps(n,t,{appearance:"toggle",modelName:"UI.Toggle:model"})},he.Slider=(...t)=>{var H,ge,Se,ye,V;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=e.model||(At(e.value)||Jt(e.value)?e.value:null),r=Nt(o,"UI.Slider:model"),C=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"]);C.type="range",C.class=ae(["cms-slider-input",e.inputClass]);const u=_.input(C),i={...e.style||{}},y=l(e.size);if(y!=null){const O=typeof y=="string"&&((H=JSswift.uiSizes)!=null&&H.includes(y))?`var(--cms-size-${y})`:Be(y);i["--cms-slider-size"]=O,i["--cms-slider-track-size"]=`max(4px, calc(${O} / 4))`,i["--cms-slider-box-height"]=`calc(${O} * 1.5)`,i["--cms-slider-marker-size"]=`max(6px, calc(${O} / 3))`}const R=_.label({class:ae(["cms-clear-set","cms-singularity-check","cms-slider-wrap",fe(e.dense,"dense"),e.class]),style:i});Ke(R,e);const v=_.div({class:"cms-slider-header"}),b=_.span({class:"cms-slider-label"}),P=_.span({class:"cms-slider-value"});v.append(b,P);const Z=_.div({class:"cms-slider-body"}),G=_.span({class:"cms-slider-icon cms-slider-icon-left"}),ie=_.span({class:"cms-slider-edge-label cms-slider-edge-label-left"}),D=_.div({class:"cms-slider-main"}),$=_.div({class:"cms-slider-box",style:{minHeight:"var(--cms-slider-box-height, 36px)"}}),Y=_.span({class:"cms-slider-rail",style:{height:"var(--cms-slider-track-size, 6px)"}}),W=_.span({class:"cms-slider-selection",style:{height:"var(--cms-slider-track-size, 6px)"}}),le=_.span({class:"cms-slider-thumb",style:{width:"var(--cms-slider-size, 24px)",height:"var(--cms-slider-size, 24px)"}}),me=_.span({class:"cms-slider-thumb-icon"}),re=_.span({class:"cms-slider-thumb-label"});le.append(re,me);const oe=_.div({class:"cms-slider-markers"}),se=_.span({class:"cms-slider-edge-label cms-slider-edge-label-right"}),te=_.span({class:"cms-slider-icon cms-slider-icon-right"});$.append(Y,W,le,u),D.append($,oe),Z.append(G,ie,D,se,te),R.append(v,Z);const M=O=>{for(;O.firstChild;)O.removeChild(O.firstChild)},Q=(O,K,ke="")=>{M(O),(K||[]).forEach(Ne=>O.appendChild(Ne)),O.style.display=O.childNodes.length?ke:"none"},q=O=>At(O)||Jt(O)?l(O):O,ue=(O,K={})=>An(q(O),K),L=(O,K,ke={})=>{var ee,xe;const Ne=q(O);return Ne==null?[]:typeof Ne=="string"?[he.Icon({name:Ne,size:(xe=(ee=e.iconSize)!=null?ee:e.size)!=null?xe:16})]:ue(Ne,{...ke,as:K})},f=(O,K)=>{const ke=Number(O);return Number.isFinite(ke)?ke:K},m=()=>f(l(e.min),0),g=()=>{const O=m(),K=f(l(e.max),100);return K<O?O:K},F=()=>{const O=l(e.step);if(O==="any")return"any";const K=f(O,1);return K>0?K:1},X=O=>{if(O==="any")return 0;const K=String(O);if(K.includes("e-"))return Number(K.split("e-")[1]||0);const ke=K.indexOf(".");return ke===-1?0:K.length-ke-1},a=O=>{const K=m(),ke=g(),Ne=F();let ee=f(O,K);if(Ne!=="any"){ee=K+Math.round((ee-K)/Ne)*Ne;const xe=X(Ne);xe>0&&(ee=Number(ee.toFixed(xe)))}return Math.min(ke,Math.max(K,ee))},S=O=>{const K=m(),Ne=g()-K;if(!Ne)return 0;const ee=(a(O)-K)/Ne,xe=l(e.reverse)?1-ee:ee;return Math.max(0,Math.min(1,xe))},[h,J]=JSswift.reactive.signal(a(r?r.get():(Se=(ge=l(e.value))!=null?ge:l(e.min))!=null?Se:0)),j=(O,K={})=>{const ke=a(O);return h()!==ke&&J(ke),String(u.value)!==String(ke)&&(u.value=String(ke)),r&&K.fromModel!==!0&&r.set(ke),ke},U=()=>{var xe;const O=l(e.markers),K=!!l((xe=e.markerLabels)!=null?xe:e.labelMarks);if(!O)return[];const ke=m(),Ne=g(),ee=(be,Ce)=>{var Ie,_e,z,we,T,x,w,c;if(be==null)return null;if(typeof be=="object"&&!Array.isArray(be)){const A=a((z=(_e=(Ie=be.value)!=null?Ie:be.position)!=null?_e:be.at)!=null?z:ke);return{key:(we=be.key)!=null?we:`marker-${Ce}-${A}`,value:A,label:(T=be.label)!=null?T:K?String(A):null,icon:(x=be.icon)!=null?x:null,className:(c=(w=be.class)!=null?w:be.className)!=null?c:""}}const pe=a(be);return{key:`marker-${Ce}-${pe}`,value:pe,label:K?String(be):null,icon:null,className:""}};if(Array.isArray(O))return O.map((be,Ce)=>ee(be,Ce)).filter(Boolean);if(typeof O=="number"&&O>1){const be=Math.floor(O),Ce=be>1?(Ne-ke)/(be-1):0;return Array.from({length:be},(pe,Ie)=>ee(ke+Ce*Ie,Ie)).filter(Boolean)}if(O===!0){const be=F();if(be==="any")return[ee(ke,0),ee(Ne,1)].filter(Boolean);const Ce=Math.floor((Ne-ke)/be)+1;return Ce>24?[ee(ke,0),ee((ke+Ne)/2,1),ee(Ne,2)].filter(Boolean):Array.from({length:Ce},(pe,Ie)=>ee(ke+be*Ie,Ie)).filter(Boolean)}return typeof O=="object"?Object.keys(O).map((be,Ce)=>ee({value:Number(be),label:O[be]},Ce)).filter(Boolean):[]},ce=()=>{M(oe);const O=U();oe.style.display=O.length?"block":"none",oe.style.minHeight=O.some(K=>K.label!=null&&K.label!=="")?"30px":"10px",O.forEach(K=>{const ke=S(K.value),Ne=l(e.reverse)?h()<=K.value:h()>=K.value,ee=_.button({type:"button",class:ae(["cms-slider-marker",K.className,fe(()=>Ne,"active")]),style:{left:`${ke*100}%`,color:Ne?l(e.color)||"var(--cms-primary)":"var(--cms-muted)",cursor:l(e.disabled)||l(e.readonly)?"default":"pointer"},disabled:!!l(e.disabled)||!!l(e.readonly),onClick:()=>{var z,we;if(l(e.disabled)||l(e.readonly))return;const _e=j(K.value);(z=e.onInput)==null||z.call(e,_e),(we=e.onChange)==null||we.call(e,_e)}}),xe={marker:K,active:Ne,value:K.value,current:h(),input:u};let be=JSswift.ui.renderSlot(s,"marker",xe,null);be==null&&K.icon!=null&&(be=typeof K.icon=="string"?he.Icon({name:K.icon,size:12}):JSswift.ui.slot(K.icon,{...xe,as:"marker"}));const Ce=_.span({class:"cms-slider-marker-tick",style:{width:"var(--cms-slider-marker-size, 8px)",height:"var(--cms-slider-marker-size, 8px)",background:Ne?l(e.color)||"var(--cms-primary)":"var(--cms-border-color)"}}),pe=be==null?[Ce]:E(null,"default",xe,be),Ie=K.label==null?E(s,"markerLabel",xe,null):E(s,"markerLabel",xe,K.label);pe.forEach(_e=>ee.appendChild(_e)),Ie.length&&ee.appendChild(_.span({class:"cms-slider-marker-label"},...Ie)),oe.appendChild(ee)})},k=()=>{var xe;const O={value:h(),input:u,props:e};let K=E(s,"label",O,q(e.label));K.length||(K=E(s,"default",O,n)),Q(b,K,"inline-flex");const ke=l(e.showValue),Ne=ke===!1?null:(xe=q(e.labelValue))!=null?xe:h(),ee=ke||q(e.labelValue)!=null?E(s,"value",O,Ne):[];Q(P,ee,"inline-flex"),v.style.display=b.childNodes.length||P.childNodes.length?"flex":"none"},d=()=>{var Ce,pe,Ie,_e;const O={value:h(),input:u,props:e},K=E(s,"icon",O,null),ke=K.length?K:L(e.icon,"icon",O);Q(G,ke,"inline-flex");const Ne=E(s,"iconRight",O,null),ee=Ne.length?Ne:L(e.iconRight,"iconRight",O);Q(te,ee,"inline-flex");const xe=q((pe=(Ce=e.startLabel)!=null?Ce:e.leftLabel)!=null?pe:e.minLabel),be=q((_e=(Ie=e.endLabel)!=null?Ie:e.rightLabel)!=null?_e:e.maxLabel);Q(ie,E(s,"startLabel",O,xe),"inline-flex"),Q(se,E(s,"endLabel",O,be),"inline-flex")},N=()=>{var xe,be,Ce,pe;const O={value:h(),input:u,props:e},K=E(s,"thumbIcon",O,null),ke=(be=(xe=e.thumbIcon)!=null?xe:e.iconThumb)!=null?be:e.pointIcon;Q(me,K.length?K:L(ke,"thumbIcon",O),"inline-flex");const Ne=(pe=(Ce=q(e.thumbLabel))!=null?Ce:q(e.labelValue))!=null?pe:l(e.showValue)?String(h()):null,ee=E(s,"thumbLabel",O,Ne);Q(re,ee,"inline-flex")},I=()=>{const O=a(h()),K=m(),ke=g(),Ne=F(),xe=`${S(O)*100}%`,be=l(e.color)||l(e.selectionColor)||"var(--cms-primary)",Ce=l(e.trackColor)||"var(--cms-border-color)",pe=l(e.thumbColor)||be,Ie=!!l(e.readonly),_e=!!l(e.disabled);u.min=String(K),u.max=String(ke),u.step=Ne==="any"?"any":String(Ne),u.disabled=_e,u.value=String(O),Y.style.background=Ce,W.style.background=be,W.style.width=xe,le.style.left=xe,le.style.borderColor=pe,le.style.color=pe,re.style.background=be,R.classList.toggle("is-disabled",_e),R.classList.toggle("is-readonly",Ie),R.classList.toggle("has-markers",oe.childNodes.length>0)};if(r?(j(r.get(),{fromModel:!0}),r.watch(O=>{j(O,{fromModel:!0})},"UI.Slider:watch")):at(e.value)?JSswift.reactive.effect(()=>{j(l(e.value),{fromModel:!0})},"UI.Slider:value"):j((V=(ye=e.value)!=null?ye:e.min)!=null?V:0,{fromModel:!0}),u.addEventListener("input",O=>{var ke;if(l(e.disabled)||l(e.readonly)){u.value=String(h());return}const K=j(u.value);(ke=e.onInput)==null||ke.call(e,K,O)}),u.addEventListener("change",O=>{var ke;if(l(e.disabled)||l(e.readonly)){u.value=String(h());return}const K=j(u.value);(ke=e.onChange)==null||ke.call(e,K,O)}),JSswift.reactive.effect(()=>{k(),d(),N(),ce(),I()},"UI.Slider:render"),R._input=u,R._getValue=h,R._setValue=O=>j(O),e.withQItem||e.qitem||e.item===!0){const O=he.Item({class:ae(["cms-slider-item",e.itemClass]),style:e.itemStyle},R);return O._input=u,O._slider=R,O._getValue=h,O._setValue=R._setValue,O}return R},he.Rating=(...t)=>{var h;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=e.model||(At(e.value)||Jt(e.value)?e.value:null),r=Nt(o,"UI.Rating:model"),C=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=C,e.name!=null&&(u.name=e.name),u.class=ae(["cms-rating-input","cms-choice-input",e.inputClass]);const i=_.input(u),y=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"]);y.class=ae(["cms-clear-set","cms-singularity-check","cms-choice-wrap","cms-rating","cms-rating-wrap",fe(e.dense,"dense"),e.class]),y.style={...e.style||{}};const R=l(e.size);R!=null&&!(typeof R=="string"&&((h=JSswift.uiSizes)!=null&&h.includes(R)))&&(y.style["--cms-rating-size"]=Be(R));const v=l(e.gap);v!=null&&(y.style["--cms-rating-gap"]=Be(v));const b=_.span({class:"cms-rating-control",onMouseleave:J=>{var j;q!=null&&(q=null,a(),(j=e.onHover)==null||j.call(e,te(),J))},onKeydown:J=>{if(!se())return;const j=le()?.5:1,U=te();let ce=U;switch(J.key){case"ArrowRight":case"ArrowUp":ce=U+j;break;case"ArrowLeft":case"ArrowDown":ce=U-j;break;case"Home":ce=l(e.clearable)?0:j;break;case"End":ce=W();break;case"Delete":case"Backspace":case"0":if(!l(e.clearable))return;ce=0;break;case" ":case"Enter":ce=U||(l(e.clearable)?j:Math.max(j,1));break;default:return}J.preventDefault(),S(ce,J,{emit:!0})}}),P=_.span({class:"cms-choice-label cms-rating-label"}),Z=_.label(y,i,b,P);Ke(Z,e);const G=J=>{for(;J.firstChild;)J.removeChild(J.firstChild)},ie=(J,j,U="")=>{G(J),(j||[]).forEach(ce=>J.appendChild(ce)),J.style.display=J.childNodes.length?U:"none"},D=J=>At(J)||Jt(J)?l(J):J,$=(J,j={})=>An(D(J),j),Y=(J,j,U={})=>{var k,d;const ce=D(J);return ce==null?[]:typeof ce=="string"?[he.Icon({name:ce,color:e.color,size:(d=(k=e.iconSize)!=null?k:e.size)!=null?d:16})]:$(ce,{...U,as:j})},W=()=>{var j;const J=Number((j=l(e.max))!=null?j:5);return Number.isFinite(J)&&J>0?Math.max(1,Math.round(J)):5},le=()=>{var J;return!!l((J=e.half)!=null?J:e.allowHalf)},me=(J,j=W())=>{let U=Number(l(J));Number.isFinite(U)||(U=0),U=Math.min(j,Math.max(0,U));const ce=le()?.5:1;return Math.round(U/ce)*ce},re=()=>!!l(e.disabled),oe=()=>!!l(e.readonly),se=()=>!re()&&!oe(),te=()=>me(r?r.get():Q),M=J=>{const j=J>0?String(J):"";i.value=j,i.setAttribute("value",j),i.disabled=re()};let Q=me(r?r.get():l(e.value)),q=null,ue=0,L=[];const f=(J,j)=>{if(!le())return me(J);const U=j.currentTarget.getBoundingClientRect(),ce=j.clientX-U.left<=U.width/2;return me(ce?J-.5:J)},m=(J,j)=>J>=j?"full":le()&&J>=j-.5?"half":"empty",g=(J,j)=>{var N,I,H,ge,Se,ye,V,O,K,ke,Ne,ee,xe,be,Ce;const U=l((H=(I=(N=e.colorSelected)!=null?N:e.activeColor)!=null?I:e.color)!=null?H:e.textColor)||"var(--cms-warning, #f0b429)",ce=l((O=(V=(ye=(Se=(ge=e.colorHalf)!=null?ge:e.halfColor)!=null?Se:e.colorSelected)!=null?ye:e.activeColor)!=null?V:e.color)!=null?O:e.textColor)||U,k=l((xe=(ee=(Ne=(ke=(K=e.colorHovered)!=null?K:e.hoverColor)!=null?ke:e.colorSelected)!=null?Ne:e.activeColor)!=null?ee:e.color)!=null?xe:e.textColor)||U,d=l((Ce=(be=e.colorInactive)!=null?be:e.colorOff)!=null?Ce:e.color)||"var(--cms-muted)";return j?k:J==="full"?U:J==="half"?ce:d},F=J=>{var k,d,N,I,H,ge,Se,ye,V,O,K,ke,Ne,ee,xe;const j=[];J.hovered&&J.state!=="empty"&&j.push("hoveredIcon","iconHovered"),J.state==="full"?j.push("checkedIcon","selectedIcon","iconSelected","iconOn"):J.state==="half"?j.push("halfIcon","iconHalf"):j.push("uncheckedIcon","iconOff"),j.push("icon","item","star");for(const be of j){const Ce=E(s,be,J,null);if(Ce.length)return Ce}let U=null,ce="icon";return J.hovered&&J.state!=="empty"&&(U=(k=e.hoveredIcon)!=null?k:e.iconHovered,ce="hoveredIcon"),U==null&&J.state==="full"?(U=(H=(I=(N=(d=e.checkedIcon)!=null?d:e.iconSelected)!=null?N:e.iconOn)!=null?I:e.icon)!=null?H:"star",ce="checkedIcon"):U==null&&J.state==="half"?(U=(O=(V=(ye=(Se=(ge=e.halfIcon)!=null?ge:e.iconHalf)!=null?Se:e.checkedIcon)!=null?ye:e.iconSelected)!=null?V:e.icon)!=null?O:"star_half",ce="halfIcon"):U==null&&(U=(xe=(K=e.uncheckedIcon)!=null?K:e.iconOff)!=null?xe:l(e.noDimming)?(ee=(Ne=(ke=e.icon)!=null?ke:e.checkedIcon)!=null?Ne:e.iconSelected)!=null?ee:"star":"star_border",ce="uncheckedIcon"),Y(U,ce,J)},X=()=>{const J=W();if(ue!==J){ue=J,L=[],G(b);for(let j=1;j<=J;j++){const U=_.span({class:"cms-rating-item-icon"}),ce=_.span({class:"cms-rating-item",role:"radio",tabIndex:-1,onMousemove:k=>{var N;if(!se())return;const d=f(j,k);q!==d&&(q=d,a(),(N=e.onHover)==null||N.call(e,d,k))},onClick:k=>{if(!se())return;let d=f(j,k);l(e.clearable)&&d===te()&&(d=0),S(d,k,{emit:!0})}},U);L.push({item:ce,iconHost:U,index:j}),b.appendChild(ce)}}},a=()=>{var ge,Se;X();const J=W(),j=te(),U=q==null?j:me(q,J),ce=re(),k=oe(),d=!!l(e.clearable),N=!!l(e.noDimming);Z.classList.toggle("is-disabled",ce),Z.classList.toggle("is-readonly",k),Z.classList.toggle("is-hovering",q!=null),Z.classList.toggle("is-clearable",d),Z.classList.toggle("is-half",le()),Z.classList.toggle("no-dimming",N);const I=Number((Se=l((ge=e.tabindex)!=null?ge:e.tabIndex))!=null?Se:0);b.tabIndex=ce?-1:I,b.setAttribute("role","slider"),b.setAttribute("aria-valuemin","0"),b.setAttribute("aria-valuemax",String(J)),b.setAttribute("aria-valuenow",String(j)),b.setAttribute("aria-disabled",ce?"true":"false"),b.setAttribute("aria-readonly",k?"true":"false"),M(j);const H=E(s,"label",{value:j,max:J,disabled:ce,readonly:k,clearable:d},e.label!=null?D(e.label):n);ie(P,H,"inline-flex"),L.forEach(({item:ye,iconHost:V,index:O})=>{const K=m(U,O),ke=q!=null&&K!=="empty",Ne={index:O,max:J,value:j,displayValue:U,state:K,active:K!=="empty",checked:K==="full",half:K==="half",hovered:ke,disabled:ce,readonly:k,clearable:d,setValue:ee=>S(ee,null,{emit:!1})};ye.className=Dt(["cms-rating-item",`is-${K}`,fe(ke,"is-hovered")]),ye.style.color=g(K,ke),ye.style.opacity=K==="empty"&&!N?"0.48":"1",ye.setAttribute("aria-checked",String(j===O)),ie(V,F(Ne),"inline-flex")})},S=(J,j,U={})=>{var d,N;const ce=me(J),k=te();return Q=ce,q=null,r&&U.fromModel!==!0&&r.set(ce),M(ce),a(),U.emit!==!1&&ce!==k&&((d=e.onInput)==null||d.call(e,ce,j),(N=e.onChange)==null||N.call(e,ce,j)),ce};return Z._input=i,Z._rating=b,Z._getValue=te,Z._setValue=J=>S(J,null,{emit:!1}),r&&r.watch(J=>{const j=me(J);serializeValue(j)!==serializeValue(Q)&&(Q=j,q=null,M(Q),a())},"UI.Rating:watch"),JSswift.reactive.effect(()=>{!r&&e.value!=null&&(Q=me(l(e.value))),a()},"UI.Rating:render"),Z};const it=t=>t?{hour:Number(t.hour)||0,minute:Number(t.minute)||0,second:Number(t.second)||0}:null,Ut=t=>String(Math.max(0,Number(t)||0)).padStart(2,"0"),$t=(t,e={})=>{var u,i,y,R,v,b,P,Z,G,ie,D,$,Y,W,le;if(t==null||t==="")return null;let n=null,s=null,o=0,r=null;if(t instanceof Date&&!Number.isNaN(t.getTime()))n=t.getHours(),s=t.getMinutes(),o=t.getSeconds();else if(typeof t=="number"&&Number.isFinite(t)){const me=Math.max(0,Math.floor(t));n=Math.floor(me/3600)%24,s=Math.floor(me/60)%60,o=me%60}else if(typeof t=="object"){if(t.time!=null||t.value!=null)return $t((u=t.time)!=null?u:t.value,e);n=Number((R=(y=(i=t.hour)!=null?i:t.hours)!=null?y:t.h)!=null?R:t.hh),s=Number((Z=(P=(b=(v=t.minute)!=null?v:t.minutes)!=null?b:t.min)!=null?P:t.mm)!=null?Z:0),o=Number(($=(D=(ie=(G=t.second)!=null?G:t.seconds)!=null?ie:t.sec)!=null?D:t.ss)!=null?$:0),r=(le=(W=(Y=t.meridiem)!=null?Y:t.ampm)!=null?W:t.period)!=null?le:null}else if(typeof t=="string"){const me=t.trim();if(!me)return null;const re=me.match(/^(\d{1,2})(\d{2})(\d{2})?$/),oe=me.match(/(\d{1,2}):(\d{1,2})(?::(\d{1,2}))?\s*([ap]m)?/i);if(oe)n=Number(oe[1]),s=Number(oe[2]),o=oe[3]!=null?Number(oe[3]):0,r=oe[4]||null;else if(re)n=Number(re[1]),s=Number(re[2]),o=re[3]!=null?Number(re[3]):0;else return null}else return null;if(!Number.isFinite(n)||!Number.isFinite(s)||!Number.isFinite(o))return null;if(r){const me=String(r).toLowerCase();me==="pm"&&n<12&&(n+=12),me==="am"&&n===12&&(n=0)}if(n<0||n>23||s<0||s>59||o<0||o>59)return null;const C={hour:Math.floor(n),minute:Math.floor(s),second:Math.floor(o)};return il(C,e)},Xt=(t,e={})=>{const n=t&&typeof t=="object"&&t.hour!=null?it(t):$t(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;return`${Ut(n.hour)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""}`},Hn=(t,e)=>{const n=Xt(t,{withSeconds:!0}),s=Xt(e,{withSeconds:!0});return!n&&!s?0:n?s?n<s?-1:n>s?1:0:1:-1};function il(t,e={}){if(!t)return null;const n=it(t),s=e.min!=null?$t(e.min,{withSeconds:!0}):null,o=e.max!=null?$t(e.max,{withSeconds:!0}):null;return s&&Hn(n,s)<0?it(s):o&&Hn(n,o)>0?it(o):n}const Tt=(t,e={})=>t==null||t===""?null:t instanceof Date?$t(t,e):typeof t=="object"?$t(t.time!=null?t.time:t,e):typeof t=="string"||typeof t=="number"?$t(t,e):null,jn=(t,e={})=>{var u;const n=$t(t,e);if(!n)return"";const s=e.withSeconds===!0||Number(n.second||0)>0;if(!!!l((u=e.use12h)!=null?u:e.ampm))return`${Ut(n.hour)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""}`;const r=n.hour>=12?"PM":"AM",C=n.hour%12||12;return`${Ut(C)}:${Ut(n.minute)}${s?`:${Ut(n.second)}`:""} ${r}`},Fo=(t,e,n={})=>{if(!t)return"";const s=Xt(e,n);return s?`${t}T${s}`:t},bs=(t,e)=>{const n=Math.max(1,Math.min(e+1,Math.round(Number(t)||1))),s=[];for(let o=0;o<=e;o+=n)s.push(o);return s},al=(t={})=>{const{props:e={},slots:n={},value:s=null,withSeconds:o=!1,minuteStep:r=5,secondStep:C=5,disabled:u=!1,readonly:i=!1,embedded:y=!1,className:R="",slotPrefix:v="",shortcuts:b=null,onSelect:P=null}=t,Z=$t(s,{withSeconds:o,min:e.min,max:e.max}),G=Z||$t(new Date,{withSeconds:o,min:e.min,max:e.max})||{hour:0,minute:0,second:0},ie=Z?it(Z):null,D=se=>v?`${v}${se[0].toUpperCase()}${se.slice(1)}`:null,$=(se,te,M)=>{const Q=[D(se),se].filter(Boolean);for(const q of Q){if(JSswift.ui.getSlot(n,q)==null)continue;const L=JSswift.ui.renderSlot(n,q,te,M);if(L!=null)return L}return JSswift.ui.slot(M,te)},Y=se=>{let te=$("point",se,null);return te==null&&t.pointIcon!=null&&se.selected&&(te=typeof t.pointIcon=="string"?he.Icon({name:t.pointIcon,size:y?10:12}):JSswift.ui.slot(t.pointIcon,se)),E(null,"default",se,te)},W=(se,te)=>{const M={hour:G.hour,minute:G.minute,second:o?G.second:0};return M[se]=te,M},le=_.div({class:ae(["cms-time-section",fe(y,"is-embedded"),fe(o,"has-seconds"),R])}),me=l(b)||[];if(Array.isArray(me)&&me.length){const se=_.div({class:"cms-time-shortcuts"});me.forEach((te,M)=>{var f,m,g;if(!te)return;const Q=typeof te.value=="function"?te.value({now:Xt(new Date,{withSeconds:o})}):te.value,q=$t(Q,{withSeconds:o,min:e.min,max:e.max});if(!q)return;const ue={item:te,index:M,value:Xt(q,{withSeconds:o}),displayValue:jn(q,{withSeconds:o,use12h:(f=e.use12h)!=null?f:e.ampm})},L=$("shortcut",ue,(g=(m=te.label)!=null?m:te.text)!=null?g:ue.displayValue);se.appendChild(_.button({type:"button",class:ae(["cms-time-shortcut",fe(!!ie&&Hn(q,ie)===0,"is-selected")]),disabled:u||i,onClick:()=>P==null?void 0:P(q,{shortcut:te,index:M})},...E(null,"default",ue,L)))}),se.childNodes.length&&le.appendChild(se)}const re=_.div({class:"cms-time-columns"}),oe=(se,te,M)=>{const Q=_.div({class:"cms-time-column","data-time-part":te}),q=_.div({class:"cms-time-options"});return M.forEach(ue=>{var S;const L=W(te,ue),f=il(L,{withSeconds:o,min:e.min,max:e.max}),m=u||i||Hn(f,L)!==0,g=!!ie&&ie[te]===ue,F={part:te,selected:g,disabled:m,value:ue,label:Ut(ue),timeValue:Xt(f,{withSeconds:o}),displayValue:jn(f,{withSeconds:o,use12h:(S=e.use12h)!=null?S:e.ampm})},X=$("option",F,F.label),a=g?Y(F):[];q.appendChild(_.button({type:"button",class:ae(["cms-time-option",fe(g,"is-selected"),fe(m,"is-disabled")]),disabled:m,onClick:()=>P==null?void 0:P(f,{part:te,optionValue:ue})},_.span({class:"cms-time-option-label"},...E(null,"default",F,X)),a.length?_.span({class:"cms-time-option-point"},...a):null))}),Q.appendChild(q),Q};return re.appendChild(oe(l(e.hoursLabel)||"Ore","hour",bs(1,23))),re.appendChild(oe(l(e.minutesLabel)||"Min","minute",bs(r,59))),o&&re.appendChild(oe(l(e.secondsLabel)||"Sec","second",bs(C,59))),le.appendChild(re),le},Wn=t=>{if(!t)return null;const e={};return t.querySelectorAll(".cms-time-column").forEach((n,s)=>{const o=n.getAttribute("data-time-part")||String(s);e[o]=n.scrollTop}),e},rl=(t,e={})=>{var o;if(!t)return;const n=e.scrollState||null,s=(o=e.behavior)!=null?o:"smooth";t.querySelectorAll(".cms-time-column").forEach((r,C)=>{const u=r.getAttribute("data-time-part")||String(C),i=n&&Number.isFinite(n[u])?n[u]:null;i!=null&&(r.scrollTop=i);const y=r.querySelector(".cms-time-option.is-selected");if(!y)return;const R=Math.max(0,r.scrollHeight-r.clientHeight),v=y.offsetTop-(r.clientHeight-y.offsetHeight)/2,b=Math.max(0,Math.min(R,v));if(Math.abs(r.scrollTop-b)<1){r.scrollTop=b;return}if(s&&typeof r.scrollTo=="function"){r.scrollTo({top:b,behavior:s});return}r.scrollTop=b})},cl=(t,e={})=>{var cn,un,tn,nn,Pe,Ve,et,ct,gt,ht,Ct,yt;const{props:n,children:s}=JSswift.uiNormalizeArgs(t),o=e.calendar===!0,r=n.slots||{},C=qe(n.size,()=>{const p=String(l(n.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(p)?`cms-size-${p}`:""}),u=String(l((nn=(tn=n.mode)!=null?tn:l((un=(cn=n.rangeMultiple)!=null?cn:n.multipleRange)!=null?un:n.multiRange)?"range-multiple":null)!=null?nn:n.range&&n.multiple?"range-multiple":n.range?"range":n.multiple?"multiple":"single")).toLowerCase(),i=["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",y=n.model||(At(n.value)||Jt(n.value)?n.value:null),R=Nt(y,o?"UI.Calendar:model":"UI.Datepicker:model"),v=R?R.get():l(n.value),b=l((Pe=n.rangeAs)!=null?Pe:n.rangeModel)==="array"||Array.isArray(v),P=l((Ve=n.rangeMultipleAs)!=null?Ve:n.multipleRangeAs)==="array"||Array.isArray(v)&&Array.isArray(v[0]),Z=()=>{var p,ne,ve;return i==="single"&&!!l((ve=(ne=(p=n.withTime)!=null?p:n.time)!=null?ne:n.timePicker)!=null?ve:n.enableTime)},G=()=>{var ne,ve,Re,Fe,Oe,$e,Xe,ot;const p=Xt(Tt((ve=(ne=l(n.timeValue))!=null?ne:R?R.get():l(n.value))!=null?ve:v,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!l((Fe=(Re=n.timeWithSeconds)!=null?Re:n.withSeconds)!=null?Fe:n.showSeconds)||/:\d{2}:\d{2}$/.test(p)||/:\d{2}:\d{2}$/.test(l(n.timeFormat)||""),min:l((Oe=n.timeMin)!=null?Oe:n.minTime),max:l(($e=n.timeMax)!=null?$e:n.maxTime),use12h:l((ot=(Xe=n.time12h)!=null?Xe:n.use12h)!=null?ot:n.ampm)}},ie=()=>{var ne,ve;const p=Number(l((ve=(ne=n.timeMinuteStep)!=null?ne:n.minuteStep)!=null?ve:5));return Math.max(1,Math.min(30,Number.isFinite(p)?p:5))},D=()=>{var ne,ve;const p=Number(l((ve=(ne=n.timeSecondStep)!=null?ne:n.secondStep)!=null?ve:5));return Math.max(1,Math.min(30,Number.isFinite(p)?p:5))},$=p=>String(p).padStart(2,"0"),Y=(p,ne,ve)=>{const Re=new Date(p,ne,ve);return Re.getFullYear()!==p||Re.getMonth()!==ne||Re.getDate()!==ve?null:Re},W=p=>!(p instanceof Date)||Number.isNaN(p.getTime())?null:`${p.getFullYear()}-${$(p.getMonth()+1)}-${$(p.getDate())}`,le=p=>{if(typeof p!="string")return null;const ne=p.match(/^(\d{4})-(\d{2})-(\d{2})$/);if(!ne)return null;const ve=Number(ne[1]),Re=Number(ne[2])-1,Fe=Number(ne[3]),Oe=new Date(ve,Re,Fe);return Oe.getFullYear()!==ve||Oe.getMonth()!==Re||Oe.getDate()!==Fe?null:Oe},me=(p,ne)=>{const ve=le(p);return ve?(ve.setDate(ve.getDate()+ne),W(ve)):null},re=(p,ne)=>new Date(p.getFullYear(),p.getMonth()+ne,1),oe=p=>{if(p instanceof Date&&!Number.isNaN(p.getTime()))return new Date(p.getFullYear(),p.getMonth(),1);const ne=a(p),ve=le(ne);return ve?new Date(ve.getFullYear(),ve.getMonth(),1):new Date},se=()=>W(new Date),te=(p,ne)=>!!p&&!!ne&&p===ne,M=(p,ne)=>p==null&&ne==null?0:p==null?-1:ne==null?1:p<ne?-1:p>ne?1:0,Q=(p,ne)=>{const ve=le(p),Re=le(ne);return!ve||!Re?0:Math.round((Re.getTime()-ve.getTime())/864e5)},q=p=>Array.isArray(p)?p.slice():p==null||p===""?[]:[p],ue=p=>({from:(p==null?void 0:p.from)||null,to:(p==null?void 0:p.to)||null}),L=p=>Array.isArray(p)?p.map(ue):[],f=p=>{const ne=ue(p);return b?[ne.from,ne.to]:ne},m=p=>L(p).map(ne=>P?[ne.from,ne.to]:ne),g=p=>i==="multiple"?Array.isArray(p)?p.slice():[]:i==="range"?ue(p):i==="range-multiple"?L(p):p||null,F=p=>i==="multiple"?Array.isArray(p)?p.slice():[]:i==="range"?f(p):i==="range-multiple"?m(p):p||"",X=p=>JSON.stringify(F(p)),a=p=>{if(p==null||p==="")return null;if(p instanceof Date)return W(p);if(typeof p=="number")return W(new Date(p));if(typeof p!="string")return typeof p=="object"&&p.date!=null?a(p.date):null;const ne=p.trim();if(!ne)return null;const ve=ne.match(/^(\d{4})-(\d{1,2})-(\d{1,2})(?:$|[T\s])/);if(ve){const $e=Y(Number(ve[1]),Number(ve[2])-1,Number(ve[3]));return W($e)}const Re=ne.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{2,4})$/);if(Re){const $e=Re[3].length===2?2e3+Number(Re[3]):Number(Re[3]),Xe=Y($e,Number(Re[2])-1,Number(Re[1]));return W(Xe)}if(/^\d{1,4}$/.test(ne))return null;const Fe=new Date(ne);if(Number.isNaN(Fe.getTime()))return null;const Oe=ne.match(/(?:^|[^\d])(\d{4})(?!\d)/);return Oe&&Fe.getFullYear()!==Number(Oe[1])?null:W(Fe)},S=p=>{var Re,Fe,Oe,$e,Xe,ot;if(p==null||p==="")return{from:null,to:null};let ne=null,ve=null;if(Array.isArray(p))ne=a(p[0]),ve=a(p[1]);else if(typeof p=="object")ne=a((Oe=(Fe=(Re=p.from)!=null?Re:p.start)!=null?Fe:p.dateFrom)!=null?Oe:p.departure),ve=a((ot=(Xe=($e=p.to)!=null?$e:p.end)!=null?Xe:p.dateTo)!=null?ot:p.return);else{const pt=String(p).match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[];ne=a(pt[0]),ve=a(pt[1])}return ne&&ve&&ne>ve&&([ne,ve]=[ve,ne]),{from:ne,to:ve}},h=p=>{const ne=[],ve=new Set,Re=Fe=>{const Oe=S(Fe);if(!Oe.from)return;const $e=`${Oe.from||""}|${Oe.to||""}`;ve.has($e)||(ve.add($e),ne.push(Oe))};if(p==null||p==="")return ne;if(Array.isArray(p))if(p.every(Oe=>Oe==null||typeof Oe=="string"||typeof Oe=="number"||Oe instanceof Date)){const Oe=p.map(a).filter(Boolean);for(let $e=0;$e<Oe.length;$e+=2)Re({from:Oe[$e],to:Oe[$e+1]||null})}else p.forEach(Oe=>Re(Oe));else if(typeof p=="object"&&Array.isArray(p.ranges))p.ranges.forEach(Fe=>Re(Fe));else if(typeof p=="object")Re(p);else{const Oe=(String(p).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 $e=0;$e<Oe.length;$e+=2)Re({from:Oe[$e],to:Oe[$e+1]||null})}return ne.sort((Fe,Oe)=>M(Fe.from,Oe.from)||M(Fe.to,Oe.to))},J=p=>{const ne=[];return q(p).forEach(ve=>{const Re=a(ve);Re&&!ne.includes(Re)&&ne.push(Re)}),ne.sort()},j=p=>i==="range"?S(p):i==="range-multiple"?h(p):i==="multiple"?J(p):a(p),U=()=>{var p;return a(l((p=n.min)!=null?p:n.minDate))},ce=()=>{var p;return a(l((p=n.max)!=null?p:n.maxDate))},k=()=>l(n.locale)||void 0,d=()=>{var ne,ve;const p=Number(l((ve=(ne=n.firstDayOfWeek)!=null?ne:n.weekStart)!=null?ve:1));return Number.isFinite(p)?(p%7+7)%7:1},N=()=>{var ve;const p=i==="range"||i==="range-multiple"?2:1,ne=Number((ve=l(n.monthsToShow))!=null?ve:p);return Math.max(1,Math.min(4,Number.isFinite(ne)?ne:p))},I=()=>{const p=U(),ne=ce();let ve=a(l(n.defaultMonth))||se();return p&&ve<p&&(ve=p),ne&&ve>ne&&(ve=ne),ve||p||ne||se()},H=()=>l(n.confirm)?_e:Ie,ge=p=>{const ne=le(p);return ne?{date:p,value:p,year:ne.getFullYear(),month:ne.getMonth()+1,day:ne.getDate(),weekday:ne.getDay(),today:te(p,se())}:{date:p,value:p}},Se=(p,ne)=>p==null?!1:Array.isArray(p)?p.some(ve=>a(ve)===ne):p instanceof Set?p.has(ne):typeof p=="function"?!!p(ne,ge(ne)):typeof p=="string"||p instanceof Date||typeof p=="number"?a(p)===ne:!1,ye=p=>{var ot,pt,xt,Bt,zt,Lt,sn,dn,fn,vn,zn,Pn,Jn;if(!p)return!1;const ne=U(),ve=ce();if(ne&&p<ne||ve&&p>ve)return!1;const Re=l((pt=(ot=n.options)!=null?ot:n.enableDates)!=null?pt:n.allowedDates);if(Re!=null&&!Se(Re,p))return!1;const Fe=l((Bt=(xt=n.disableDates)!=null?xt:n.disabledDates)!=null?Bt:n.notAllowedDates);if(Fe!=null&&Se(Fe,p))return!1;const Oe=(zt=le(p))==null?void 0:zt.getDay();if(Array.isArray(l((Lt=n.allowedWeekdays)!=null?Lt:n.weekdays))&&Oe!=null&&!l((sn=n.allowedWeekdays)!=null?sn:n.weekdays).map(Cn=>Number(Cn)).includes(Oe)||l(n.weekdaysOnly)&&(Oe===0||Oe===6)||l(n.weekendsOnly)&&Oe!=null&&Oe!==0&&Oe!==6)return!1;const $e=H(),Xe=i==="range"?$e!=null&&$e.from&&!($e!=null&&$e.to)?$e:null:i==="range-multiple"&&Array.isArray($e)&&$e.length&&(dn=$e[$e.length-1])!=null&&dn.from&&!((fn=$e[$e.length-1])!=null&&fn.to)?$e[$e.length-1]:null;if(Xe!=null&&Xe.from){const Sn=Math.abs(Q(Xe.from,p)),Cn=Number(l((zn=(vn=n.minRange)!=null?vn:n.minDays)!=null?zn:n.minNights)),En=Number(l((Jn=(Pn=n.maxRange)!=null?Pn:n.maxDays)!=null?Jn:n.maxNights));if(Number.isFinite(Cn)&&Sn<Cn||Number.isFinite(En)&&Sn>En)return!1}return!0},V=p=>{var Re,Fe;if(!p)return"";const ne=le(p);return!ne||String(l((Fe=(Re=n.displayMask)!=null?Re:n.mask)!=null?Fe:"")||"").toLowerCase()==="iso"||l(n.isoDisplay)===!0?p:new Intl.DateTimeFormat(k(),{year:"numeric",month:"short",day:"2-digit"}).format(ne)},O=(p,ne=z)=>{if(i==="range-multiple")return!Array.isArray(p)||!p.length?"":p.length>2&&l(n.compactMultiple)!==!1?`${p.length} ${l(n.multipleRangeLabel)||"intervalli selezionati"}`:p.map(Fe=>{const Oe=Fe!=null&&Fe.from?V(Fe.from):"",$e=Fe!=null&&Fe.to?V(Fe.to):"";return Oe&&$e?`${Oe} -> ${$e}`:Oe||$e||""}).filter(Boolean).join("; ");if(i==="multiple")return!Array.isArray(p)||!p.length?"":p.length>3&&l(n.compactMultiple)!==!1?`${p.length} ${l(n.multipleLabel)||"date selezionate"}`:p.map(V).join(", ");if(i==="range"){const Fe=p!=null&&p.from?V(p.from):"",Oe=p!=null&&p.to?V(p.to):"";return Fe&&Oe?`${Fe} -> ${Oe}`:Fe||Oe||""}const ve=V(p);if(!Z())return ve;const Re=pe(ne);return[ve,Re].filter(Boolean).join(" \u2022 ")},K=p=>(String(p||"").match(/\d{4}-\d{1,2}-\d{1,2}|\d{1,2}[\/.\-]\d{1,2}[\/.\-]\d{2,4}/g)||[]).map(a).filter(Boolean),ke=p=>{if(p==null||p==="")return i==="multiple"||i==="range-multiple"?[]:i==="range"?{from:null,to:null}:null;const ne=K(p);if(i==="range-multiple"){const ve=[];for(let Re=0;Re<ne.length;Re+=2)ne[Re]&&ve.push({from:ne[Re],to:ne[Re+1]||null});return ve}return i==="multiple"?ne:i==="range"?{from:ne[0]||null,to:ne[1]||null}:ne[0]||a(p)},Ne=()=>i==="multiple"||i==="range-multiple"?[]:i==="range"?{from:null,to:null}:null,ee=(p,ne=null)=>{var $e;if(!Z())return null;const ve=G(),Re=l(n.timeValue),Fe=p!=null?p:Re,Oe=Tt(Fe,ve);return it(($e=Oe!=null?Oe:ne)!=null?$e:null)},xe=()=>l(n.confirm)?we:z,be=(p=Ie,ne=z)=>i==="single"&&Z()?Fo(p||null,ne,G()):F(p),Ce=(p=Ie,ne=z)=>JSON.stringify(be(p,ne)),pe=p=>jn(p,G());let Ie=j(v),_e=g(Ie),z=ee(v,Tt(l(n.timeValue),G())),we=it(z),T=null,x=null,w=oe(i==="range"?(Ie==null?void 0:Ie.from)||(Ie==null?void 0:Ie.to)||I():i==="range-multiple"?((et=Ie==null?void 0:Ie[Ie.length-1])==null?void 0:et.from)||((ct=Ie==null?void 0:Ie[Ie.length-1])==null?void 0:ct.to)||I():i==="multiple"?Ie[0]||I():Ie||I()),c=null,A=null;const de=p=>{const ne=p instanceof Date?p:le(a(p));if(!ne)return-1;const ve=ne.getFullYear(),Re=ne.getMonth();for(let Fe=0;Fe<N();Fe+=1){const Oe=re(w,Fe);if(Oe.getFullYear()===ve&&Oe.getMonth()===Re)return Fe}return-1},Le={...n,label:(gt=n.label)!=null?gt:n.placeholder},Je=Le.label!=null||JSswift.ui.getSlot(r,"label")!=null,B=i==="range"?"Seleziona andata e ritorno":i==="range-multiple"?"Seleziona intervalli":i==="multiple"?"Seleziona date":"Seleziona data",Ae=o?null:_.input({class:ae(["cms-input","cms-date-display",C,fe(n.manualInput,"is-manual"),n.inputClass]),type:"text",autocomplete:"off",placeholder:Je?"":(ht=n.placeholder)!=null?ht:B,readOnly:!l(n.manualInput),disabled:!!l(n.disabled),value:O(Ie,z)}),Me=_.div({style:{display:"contents"}}),Ee=o?null:_.div({class:"cms-date-control",style:{display:"contents"}},Ae,Me),De=o?null:he.FormField({...Le,iconRight:(Ct=n.iconRight)!=null?Ct:"calendar_month",control:Ee,getValue:()=>Ae.value,onClear:()=>{l(n.disabled)||l(n.readonly)||(Qe(Ne(),null),c&&St())},onFocus:()=>Ae.focus()}),Ue=(p,ne={})=>{var Fe,Oe;const ve=ne.focusIso||(i==="range"?(p==null?void 0:p.from)||(p==null?void 0:p.to)||I():i==="range-multiple"?((Fe=p==null?void 0:p[p.length-1])==null?void 0:Fe.from)||((Oe=p==null?void 0:p[p.length-1])==null?void 0:Oe.to)||I():i==="multiple"?(p==null?void 0:p[0])||I():p||I());let Re=oe(ve);if(ne.preserveMonthOffset){const $e=Number.isInteger(ne.visibleMonthOffset)?ne.visibleMonthOffset:de(ne.anchorIso||ne.focusIso||ve);$e>0&&(Re=re(Re,-$e))}w=Re},Ye=()=>{Me.replaceChildren();const p=l(n.name);if(!p)return;const ne=(Fe,Oe)=>{Me.appendChild(_.input({type:"hidden",name:Fe,value:Oe!=null?Oe:""}))},ve=Ie;if(i==="single"){ne(p,be(ve,z));return}if(i==="range"){ne(l(n.nameFrom)||`${p}_from`,(ve==null?void 0:ve.from)||""),ne(l(n.nameTo)||`${p}_to`,(ve==null?void 0:ve.to)||"");return}if(i==="range-multiple"){const Fe=Array.isArray(ve)?ve:[],Oe=/\[\]$/.test(l(n.nameFrom)||"")?l(n.nameFrom):`${l(n.nameFrom)||`${p}_from`}[]`,$e=/\[\]$/.test(l(n.nameTo)||"")?l(n.nameTo):`${l(n.nameTo)||`${p}_to`}[]`;Fe.forEach(Xe=>{ne(Oe,(Xe==null?void 0:Xe.from)||""),ne($e,(Xe==null?void 0:Xe.to)||"")});return}const Re=/\[\]$/.test(p)?p:`${p}[]`;(Array.isArray(ve)?ve:[]).forEach(Fe=>ne(Re,Fe))},Ze=()=>{var p;o||(Ae.readOnly=!l(n.manualInput),Ae.disabled=!!l(n.disabled),Ae.setAttribute("aria-expanded",c?"true":"false"),Ae.value=O(Ie,z),Ye(),(p=De==null?void 0:De._refresh)==null||p.call(De))},Qe=(p,ne,ve={})=>{var Xe,ot,pt;const Re=j(p),Fe=Z()?it((Xe=Tt(ve.timeValue!=null?ve.timeValue:ve.preserveTime?xe():p,G()))!=null?Xe:ve.preserveTime?xe():null):null,Oe=Ce(Ie,z);Ie=g(Re),_e=g(Re),Z()&&(z=it(Fe),we=it(Fe)),T=null,Ue(Re,ve),Ze(),wt(),R&&ve.fromModel!==!0&&R.set(be(Re,Fe));const $e=Ce(Re,Fe);if(ve.emit!==!1&&$e!==Oe){const xt=be(Re,Fe);(ot=n.onInput)==null||ot.call(n,xt,ne),(pt=n.onChange)==null||pt.call(n,xt,ne)}return Re},Te=(p,ne,ve={})=>{var $e,Xe;if(!Z())return null;const Re=it(Tt(p,G()));if(l(n.confirm)&&ve.commit!==!0)return we=Re,wt(),Re;const Fe=Ce(Ie,z);z=it(Re),we=it(Re),Ze(),wt(),R&&ve.fromModel!==!0&&R.set(be(Ie,Re));const Oe=Ce(Ie,Re);if(ve.emit!==!1&&Oe!==Fe){const ot=be(Ie,Re);($e=n.onInput)==null||$e.call(n,ot,ne),(Xe=n.onChange)==null||Xe.call(n,ot,ne)}return Re},je=(p,ne,ve={})=>{if(l(n.confirm)){_e=g(j(p)),Z()&&(ve.timeValue!=null||ve.preserveTime)&&(we=it(Tt(ve.timeValue!=null?ve.timeValue:xe(),G()))),T=null,Ue(_e,ve),wt();return}Qe(p,ne,ve)},tt=()=>{const p=H();if(i==="range")return!(p!=null&&p.from)||p!=null&&p.to||!T?p:M(p.from,T)<=0?{from:p.from,to:T}:{from:T,to:p.from};if(i==="range-multiple"){const ne=Array.isArray(p)&&p.length?p[p.length-1]:null;return!(ne!=null&&ne.from)||ne!=null&&ne.to||!T?ne:M(ne.from,T)<=0?{from:ne.from,to:T}:{from:T,to:ne.from}}return p},nt=()=>{if(i==="range"){const p=tt();return p!=null&&p.from?[p]:[]}if(i==="range-multiple"){const p=Array.isArray(H())?H():[];if(!p.length)return[];const ne=tt();return ne!=null&&ne.from?[...p.slice(0,-1),ne]:p}return[]},ut=p=>{const ne=H();return i==="multiple"?ne.includes(p):i==="range-multiple"?Array.isArray(ne)&&ne.some(ve=>te(ve==null?void 0:ve.from,p)||te(ve==null?void 0:ve.to,p)):i==="range"?te(ne==null?void 0:ne.from,p)||te(ne==null?void 0:ne.to,p):te(ne,p)},dt=p=>i!=="range"&&i!=="range-multiple"?!1:nt().some(ne=>(ne==null?void 0:ne.from)&&(ne==null?void 0:ne.to)&&p>=ne.from&&p<=ne.to),bt=(p,ne={})=>{const ve=H(),Re=i==="range"?ve:i==="range-multiple"&&Array.isArray(ve)&&ve.length?ve[ve.length-1]:null;!(Re!=null&&Re.from)||Re!=null&&Re.to||T===p||(T=p,ne.render!==!1&&wt())},lt=()=>o||l(n.confirm)||n.closeOnSelect===!1?!1:i==="multiple"||i==="range-multiple"?!!n.closeOnSelect:!0,ft=(p,ne,ve={})=>{var Fe;if(!ye(p)||l(n.disabled)||l(n.readonly))return;const Re={focusIso:p,anchorIso:p,preserveTime:Z(),timeValue:xe(),preserveMonthOffset:!!c&&N()>1,visibleMonthOffset:Number.isInteger(ve.visibleMonthOffset)?ve.visibleMonthOffset:null};if(i==="multiple"){const Oe=J(H()),$e=Oe.includes(p)?Oe.filter(Xe=>Xe!==p):[...Oe,p];je($e.sort(),ne,Re),lt()&&St();return}if(i==="range"){const Oe=g(H());let $e;!Oe.from||Oe.from&&Oe.to?$e={from:p,to:null}:M(p,Oe.from)<0?$e={from:p,to:Oe.from}:$e={from:Oe.from,to:p},je($e,ne,Re),$e.to&&lt()&&St();return}if(i==="range-multiple"){const Oe=h(H()),$e=Oe.length?Oe[Oe.length-1]:null;let Xe;!($e!=null&&$e.from)||$e!=null&&$e.to?Xe=[...Oe,{from:p,to:null}]:M(p,$e.from)<0?Xe=[...Oe.slice(0,-1),{from:p,to:$e.from}]:Xe=[...Oe.slice(0,-1),{from:$e.from,to:p}],je(Xe,ne,Re),(Fe=Xe[Xe.length-1])!=null&&Fe.to&&lt()&&St();return}je(p,ne,Re),lt()&&St()},vt=()=>{x=null,Qe(Ne(),null,{timeValue:null})},_t=()=>{const p=se();if(!ye(p)){Ue(p),wt();return}if(i==="range"){const ne=me(p,1),ve=ne&&ye(ne)?{from:p,to:ne}:{from:p,to:null};je(ve,null);return}if(i==="range-multiple"){const ne=me(p,1),ve=ne&&ye(ne)?[{from:p,to:ne}]:[{from:p,to:null}];je(ve,null);return}if(i==="multiple"){je([p],null);return}je(p,null,{preserveTime:Z(),timeValue:xe()})},rt=(p={})=>{rl(A,p)},Vt=()=>{if(!Z())return;const p=Wn(A);Te(new Date,null,{commit:!l(n.confirm)}),rt({scrollState:p}),!l(n.confirm)&&n.closeOnSelect===!0&&St()},Mt=()=>{l(n.confirm)&&(Qe(_e,null,{timeValue:we,preserveTime:!0}),n.closeOnSelect!==!1&&St())},wt=()=>{var Cl,xl,kl,_l,Nl,Ll,Al,Il,zl,Pl,Jl,El,Tl,Rl,Ml,Fl,Ol,Dl,$l;if(!A)return;const p=k(),ne=new Intl.DateTimeFormat(p,{month:"long",year:"numeric"}),ve=new Intl.DateTimeFormat(p,{weekday:"short"}),Re=Array.from({length:7},(Ge,st)=>{const Ft=(d()+st)%7;return ve.format(new Date(2024,0,7+Ft))}),Fe=H(),Oe=Ge=>{let st=JSswift.ui.renderSlot(r,"point",Ge,null);return st==null&&(st=JSswift.ui.renderSlot(r,"dayPoint",Ge,null)),st==null&&n.pointIcon!=null&&(Ge.selected||Ge.inRange||Ge.today)&&(st=typeof n.pointIcon=="string"?he.Icon({name:n.pointIcon,size:10}):JSswift.ui.slot(n.pointIcon,Ge)),E(null,"default",Ge,st)},$e=(Ge,st)=>{const Ft=Ge.getFullYear(),Tn=Ge.getMonth(),Rn=new Date(Ft,Tn,1),Zn=(Rn.getDay()-d()+7)%7,xs=new Date(Ft,Tn,1-Zn),es=_.div({class:"cms-date-month"});es.appendChild(_.div({class:"cms-date-month-title"},ne.format(Rn)));const Vl=_.div({class:"cms-date-weekdays"});Re.forEach(Mn=>Vl.appendChild(_.div({class:"cms-date-weekday"},Mn))),es.appendChild(Vl);const Bl=_.div({class:"cms-date-grid"});for(let Mn=0;Mn<42;Mn+=1){const ks=new Date(xs.getFullYear(),xs.getMonth(),xs.getDate()+Mn),Pt=W(ks),Hl=ks.getMonth()===Tn,jl=ut(Pt),Wl=dt(Pt),Ul=(i==="range"||i==="range-multiple")&&nt().some(It=>te(It==null?void 0:It.from,Pt)),Gl=(i==="range"||i==="range-multiple")&&nt().some(It=>te(It==null?void 0:It.to,Pt)),_s=!ye(Pt),Ns={...ge(Pt),selected:jl,inRange:Wl,rangeStart:Ul,rangeEnd:Gl,disabled:_s,outside:!Hl,value:Fe,select:()=>ft(Pt,null,{visibleMonthOffset:st})},Ls=Oe(Ns),oi=JSswift.ui.renderSlot(r,"day",Ns,String(ks.getDate())),ii=E(null,"default",Ns,oi),ai=_.button({type:"button",class:ae(["cms-date-day",fe(!Hl,"is-outside"),fe(jl,"is-selected"),fe(Wl,"is-in-range"),fe(Ul,"is-range-start"),fe(Gl,"is-range-end"),fe(_s,"is-disabled"),fe(te(Pt,se()),"is-today"),fe(Ls.length,"has-point")]),disabled:_s,onMouseDown:It=>{It.button===0&&(x=Pt,It.preventDefault(),ft(Pt,It,{visibleMonthOffset:st}))},onClick:It=>{if(x!=null&&It.detail!==0){x=null;return}x=null,ft(Pt,It,{visibleMonthOffset:st})},onMouseEnter:()=>bt(Pt),onFocus:()=>bt(Pt,{render:!1})},_.span({class:"cms-date-day-label"},...ii),Ls.length?_.span({class:"cms-date-day-point"},...Ls):null);Bl.appendChild(ai)}return es.appendChild(Bl),es},Xe=U(),ot=ce(),pt=[w.getFullYear(),(Cl=le(se()))==null?void 0:Cl.getFullYear(),(xl=le(Xe))==null?void 0:xl.getFullYear(),(kl=le(ot))==null?void 0:kl.getFullYear(),(_l=le(l(n.defaultMonth)))==null?void 0:_l.getFullYear()];i==="range"?pt.push((Nl=le(Fe==null?void 0:Fe.from))==null?void 0:Nl.getFullYear(),(Ll=le(Fe==null?void 0:Fe.to))==null?void 0:Ll.getFullYear()):i==="range-multiple"?Fe.forEach(Ge=>{var st,Ft;pt.push((st=le(Ge==null?void 0:Ge.from))==null?void 0:st.getFullYear(),(Ft=le(Ge==null?void 0:Ge.to))==null?void 0:Ft.getFullYear())}):i==="multiple"?Fe.forEach(Ge=>{var st;return pt.push((st=le(Ge))==null?void 0:st.getFullYear())}):pt.push((Al=le(Fe))==null?void 0:Al.getFullYear());const xt=pt.filter(Ge=>Number.isFinite(Ge)),Bt=(xt.length?Math.min(...xt):w.getFullYear())-100,zt=(xt.length?Math.max(...xt):w.getFullYear())+50,Lt=Number(l((Pl=(zl=n.yearStart)!=null?zl:Xe?(Il=le(Xe))==null?void 0:Il.getFullYear():null)!=null?Pl:Bt)),sn=Number(l((Tl=(El=n.yearEnd)!=null?El:ot?(Jl=le(ot))==null?void 0:Jl.getFullYear():null)!=null?Tl:zt)),dn=_.select({class:"cms-date-select",value:String(w.getMonth()),onChange:Ge=>{var st;w=new Date(w.getFullYear(),Number(Ge.currentTarget.value),1),(st=n.onNavigate)==null||st.call(n,{month:w.getMonth()+1,year:w.getFullYear()}),wt()}},...Array.from({length:12},(Ge,st)=>us({value:String(st)},new Intl.DateTimeFormat(p,{month:"long"}).format(new Date(2024,st,1))))),fn=_.select({class:"cms-date-select cms-date-select-year",value:String(w.getFullYear()),onChange:Ge=>{var st;w=new Date(Number(Ge.currentTarget.value),w.getMonth(),1),(st=n.onNavigate)==null||st.call(n,{month:w.getMonth()+1,year:w.getFullYear()}),wt()}},...Array.from({length:Math.max(1,sn-Lt+1)},(Ge,st)=>{const Ft=Lt+st;return us({value:String(Ft)},String(Ft))})),vn=_.div({class:"cms-date-header"},_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Ge;w=re(w,-1),(Ge=n.onNavigate)==null||Ge.call(n,{month:w.getMonth()+1,year:w.getFullYear()}),wt()}},he.Icon({name:"chevron_left",size:16})),_.div({class:"cms-date-header-center"},dn,fn),_.button({type:"button",class:"cms-date-nav",onClick:()=>{var Ge;w=re(w,1),(Ge=n.onNavigate)==null||Ge.call(n,{month:w.getMonth()+1,year:w.getFullYear()}),wt()}},he.Icon({name:"chevron_right",size:16}))),zn=_.div({class:"cms-date-shortcuts"}),Pn=l((Rl=n.shortcuts)!=null?Rl:n.presets)||[];Pn.forEach((Ge,st)=>{var Rn,Zn;if(!Ge)return;const Ft=typeof Ge.value=="function"?Ge.value({today:se()}):Ge.value,Tn=(Zn=(Rn=Ge.label)!=null?Rn:Ge.text)!=null?Zn:`Preset ${st+1}`;zn.appendChild(_.button({type:"button",class:"cms-date-shortcut",onClick:()=>je(Ft,null,{preserveTime:Z(),timeValue:xe()})},Tn))});const Jn=_.div({class:"cms-date-months"});for(let Ge=0;Ge<N();Ge+=1)Jn.appendChild($e(re(w,Ge),Ge));const Sn=O(Fe,xe()),Cn=_.div({class:"cms-date-value"},...E(r,"value",{value:Fe,displayValue:Sn,mode:i,timeValue:xe()},Sn||E(r,"default",{},s))),En=_.div({class:"cms-time-header"}),Zo=_.div({class:"cms-time-columns-2"},_.div({class:"cms-time-column-title"},l(n.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},l(n.minutesLabel)||"Min"));En.appendChild(Zo);const ei=Z()?al({props:{min:l((Ml=n.timeMin)!=null?Ml:n.minTime),max:l((Fl=n.timeMax)!=null?Fl:n.maxTime),use12h:l((Dl=(Ol=n.time12h)!=null?Ol:n.use12h)!=null?Dl:n.ampm),hoursLabel:l(n.timeHoursLabel)||"Ore",minutesLabel:l(n.timeMinutesLabel)||"Min",secondsLabel:l(n.timeSecondsLabel)||"Sec"},slots:r,slotPrefix:"time",value:xe(),withSeconds:!1,minuteStep:1,secondStep:D(),disabled:!!l(n.disabled),readonly:!!l(n.readonly),embedded:!0,pointIcon:l(n.timePointIcon),shortcuts:l(($l=n.timeShortcuts)!=null?$l:n.timePresets),onSelect:Ge=>{const st=Wn(A);Te(Ge,null),rt({scrollState:st})}}):null,ti=_.div({class:"cms-date-footer-info"},Cn),ni=_.div({class:ae(["cms-date-footer",fe(Z(),"has-time")])},ti,_.div({class:"cms-date-actions"},_.button({type:"button",class:"cms-date-action",onClick:_t},l(n.todayLabel)||"Oggi"),l(n.clearable)!==!1?_.button({type:"button",class:"cms-date-action",onClick:vt},l(n.clearLabel)||"Reset"):null,l(n.confirm)?_.button({type:"button",class:"cms-date-action is-primary",onClick:Mt},l(n.applyLabel)||"Applica"):null)),si=_.div(_.button({type:"button",class:"cms-date-action cms-w-lg",onClick:Vt},l(n.nowLabel)||"Ora")),li=Z()?_.div({class:"cms-date-time"},En,ei,si):null;A.replaceChildren(_.div({class:"cms-date-panel-root",onKeydown:Ge=>{var st;Ge.key==="Escape"&&(Ge.preventDefault(),o?(st=n.onEscape)==null||st.call(n,Ge):St())}},vn,Pn.length?zn:null,_.div({class:"cms-data-time"},Jn,li),ni))};function Kt(){var p,ne,ve,Re;return c||l(n.disabled)||l(n.readonly)||(_e=g(Ie),we=it(z),T=null,x=null,Ue(_e),c=JSswift.overlay.open(({close:Fe})=>{var Xe;const Oe=i==="range"||i==="range-multiple"?2:1,$e=Number((Xe=l(n.monthsToShow))!=null?Xe:Oe);return A=_.div({class:Dt(["cms-date-panel",l(C),fe($e>1,"multi-month"),n.panelClass])}),wt(),A},{type:"date",anchorEl:De._control||Ae,placement:n.placement||"bottom-start",offsetX:(p=n.offsetX)!=null?p:0,offsetY:(ve=(ne=n.offsetY)!=null?ne:n.offset)!=null?ve:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:n.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Dt(["cms-date-overlay",n.panelClass,fe(Z(),"has-time")]),onClose:()=>{var Fe;c=null,A=null,T=null,Ze(),(Fe=n.onClose)==null||Fe.call(n)}}),n.panelStyle&&Object.assign(c.panel.style,n.panelStyle),bn(c),Ze(),(Re=n.onOpen)==null||Re.call(n)),c}function St(){if(!c)return;x=null;const p=c;yn(p,()=>JSswift.overlay.close(p.id))}if(o){const p=i==="range"||i==="range-multiple"?2:1,ne=Number((yt=l(n.monthsToShow))!=null?yt:p);A=_.div({class:Dt(["cms-date-panel","cms-date-calendar",l(C),fe(ne>1,"multi-month"),n.panelClass,n.class]),style:n.style})}return o||Ae.addEventListener("focus",p=>{var ne;(ne=n.onFocus)==null||ne.call(n,p),n.openOnFocus!==!1&&Kt()}),o||Ae.addEventListener("click",p=>{var ne;(ne=n.onClick)==null||ne.call(n,p),Kt()}),o||Ae.addEventListener("keydown",p=>{if(p.key==="Escape"){c&&(p.preventDefault(),St());return}(p.key==="ArrowDown"||p.key==="Enter"||p.key===" ")&&(p.preventDefault(),Kt()),(p.key==="Backspace"||p.key==="Delete")&&!l(n.manualInput)&&l(n.clearable)!==!1&&(p.preventDefault(),vt())}),!o&&l(n.manualInput)?(Ae.addEventListener("input",p=>{var ne;(ne=n.onTyping)==null||ne.call(n,Ae.value,p)}),Ae.addEventListener("change",p=>{const ne=ke(Ae.value);Qe(ne,p,{timeValue:Tt(Ae.value,G()),preserveTime:!Tt(Ae.value,G())})}),Ae.addEventListener("blur",p=>{var ve;(ve=n.onBlur)==null||ve.call(n,p);const ne=ke(Ae.value);Ae.value===""?vt():Qe(ne,p,{timeValue:Tt(Ae.value,G()),preserveTime:!Tt(Ae.value,G())})})):o||Ae.addEventListener("blur",p=>{var ne;return(ne=n.onBlur)==null?void 0:ne.call(n,p)}),R&&R.watch(p=>{const ne=j(p),ve=ee(p);Ce(ne,ve)!==Ce(Ie,z)&&(Ie=ne,_e=g(Ie),z=it(ve),we=it(ve),T=null,Ue(Ie),Ze(),wt())},o?"UI.Calendar:watch":"UI.Datepicker:watch"),JSswift.reactive.effect(()=>{!R&&n.value!=null?(Ie=j(l(n.value)),_e=g(Ie),z=ee(l(n.value)),we=it(z)):Z()&&n.timeValue!=null&&(z=ee(l(n.timeValue)),we=it(z)),Ze(),wt(),c&&l(n.disabled)&&St()},o?"UI.Calendar:render":"UI.Datepicker:render"),o?(A._calendar=A,A._date=A,A._getValue=()=>be(Ie,z),A._setValue=p=>Qe(p,null,{emit:!1,timeValue:ee(p)}),A._clear=vt,A._select=p=>{const ne=a(p);ne&&ft(ne,null)},A._time=()=>it(z),A):(De._input=Ae,De._date=Ae,De._open=Kt,De._close=St,De._getValue=()=>be(Ie,z),De._setValue=p=>Qe(p,null,{emit:!1,timeValue:ee(p)}),De._time=()=>it(z),De._panel=()=>(c==null?void 0:c.panel)||null,De)};he.Datepicker=(...t)=>cl(t),he.Calendar=(...t)=>cl(t,{calendar:!0}),he.Date=he.Datepicker,JSswift.ui.Datepicker=he.Datepicker,JSswift.ui.Calendar=he.Calendar,JSswift.ui.Date=he.Date,he.Time=(...t)=>{var X,a,S;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=qe(e.size,()=>{const h=String(l(e.size)||"").toLowerCase();return["xs","sm","md","lg","xl"].includes(h)?`cms-size-${h}`:""}),r=()=>{var J,j,U,ce,k;const h=Xt(Tt(y?y.get():(J=l(e.value))!=null?J:R,{withSeconds:!0}),{withSeconds:!0});return{withSeconds:!!l((j=e.withSeconds)!=null?j:e.showSeconds)||/:\d{2}:\d{2}$/.test(h),min:l((U=e.min)!=null?U:e.minTime),max:l((ce=e.max)!=null?ce:e.maxTime),use12h:l((k=e.use12h)!=null?k:e.ampm)}},C=()=>{var J;const h=Number(l((J=e.minuteStep)!=null?J:1));return Math.max(1,Math.min(30,Number.isFinite(h)?h:5))},u=()=>{var J;const h=Number(l((J=e.secondStep)!=null?J:1));return Math.max(1,Math.min(30,Number.isFinite(h)?h:5))},i=e.model||(At(e.value)||Jt(e.value)?e.value:null),y=Nt(i,"UI.Time:model"),R=y?y.get():l(e.value),v=h=>Tt(h,r()),b=h=>jn(h,r()),P=h=>Xt(h,r()),Z=h=>JSON.stringify(P(h));let G=it(v(R)),ie=it(G),D=null,$=null;const Y={...e,label:(X=e.label)!=null?X:e.placeholder},W=Y.label!=null||JSswift.ui.getSlot(s,"label")!=null,le=_.input({class:ae(["cms-input","cms-time-display",o,fe(e.manualInput,"is-manual"),e.inputClass]),type:"text",autocomplete:"off",placeholder:W?"":(a=e.placeholder)!=null?a:"Seleziona orario",readOnly:!l(e.manualInput),disabled:!!l(e.disabled),value:b(G)});le.setAttribute("aria-haspopup","dialog");const me=_.div({style:{display:"contents"}}),re=_.div({class:"cms-time-control",style:{display:"contents"}},le,me),oe=he.FormField({...Y,iconRight:(S=e.iconRight)!=null?S:"schedule",control:re,getValue:()=>le.value,onClear:()=>{l(e.disabled)||l(e.readonly)||(Q(null,null,{commit:!0}),D&&F())},onFocus:()=>le.focus()}),se=()=>l(e.confirm)?ie:G,te=()=>{me.replaceChildren();const h=l(e.name);h&&me.appendChild(_.input({type:"hidden",name:h,value:P(G)}))},M=()=>{var h;le.readOnly=!l(e.manualInput),le.disabled=!!l(e.disabled),le.setAttribute("aria-expanded",D?"true":"false"),le.value=b(G),te(),(h=oe._refresh)==null||h.call(oe)},Q=(h,J,j={})=>{var d,N;const U=it(v(h));if(l(e.confirm)&&j.commit!==!0)return ie=it(U),m(),U;const ce=Z(G);G=it(U),ie=it(U),M(),m(),y&&j.fromModel!==!0&&y.set(P(U));const k=Z(U);if(j.emit!==!1&&k!==ce){const I=P(U);(d=e.onInput)==null||d.call(e,I,J),(N=e.onChange)==null||N.call(e,I,J)}return U},q=h=>l(e.confirm)||e.closeOnSelect!==!0?!1:r().withSeconds?(h==null?void 0:h.part)==="second":(h==null?void 0:h.part)==="minute",ue=(h={})=>{rl($,h)},L=()=>{const h=Wn($);Q(new Date,null,{commit:!l(e.confirm)}),ue({scrollState:h}),!l(e.confirm)&&e.closeOnSelect===!0&&F()},f=()=>{l(e.confirm)&&(Q(ie,null,{commit:!0}),e.closeOnSelect!==!1&&F())},m=()=>{var N,I,H,ge;if(!$)return;const h=se(),J=b(h),j=_.div({class:"cms-time-header"}),U=_.div({class:"cms-time-columns"},_.div({class:"cms-time-column-title"},l(e.hoursLabel)||"Ore"),_.div({class:"cms-time-column-title"},l(e.minutesLabel)||"Min")),ce=r().withSeconds;ce&&U.appendChild(_.div({class:"cms-time-column-title"},l(e.secondsLabel)||"Sec")),j.appendChild(U);const k=al({props:{min:l((N=e.min)!=null?N:e.minTime),max:l((I=e.max)!=null?I:e.maxTime),use12h:l((H=e.use12h)!=null?H:e.ampm),hoursLabel:l(e.hoursLabel)||"Ore",minutesLabel:l(e.minutesLabel)||"Min",secondsLabel:l(e.secondsLabel)||"Sec"},slots:s,value:h,withSeconds:ce,minuteStep:C(),secondStep:u(),disabled:!!l(e.disabled),readonly:!!l(e.readonly),pointIcon:l(e.pointIcon),shortcuts:l((ge=e.shortcuts)!=null?ge:e.presets),onSelect:(Se,ye)=>{const V=Wn($);Q(Se,null),ue({scrollState:V}),q(ye)&&F()}}),d=_.div({class:"cms-time-footer"},_.div({class:"cms-time-value"},...E(s,"value",{value:h,displayValue:J},J||E(s,"default",{},n))),_.div({class:"cms-time-actions"},_.button({type:"button",class:"cms-time-action",onClick:L},l(e.nowLabel)||"Ora"),l(e.clearable)!==!1?_.button({type:"button",class:"cms-time-action",onClick:()=>Q(null,null,{commit:!l(e.confirm)})},l(e.clearLabel)||"Reset"):null,l(e.confirm)?_.button({type:"button",class:"cms-time-action is-primary",onClick:f},l(e.applyLabel)||"Applica"):null));$.replaceChildren(_.div({class:"cms-time-panel-root",onKeydown:Se=>{Se.key==="Escape"&&(Se.preventDefault(),F())}},j,k,d))};function g(){var h,J,j,U;return D||l(e.disabled)||l(e.readonly)||(ie=it(G),D=JSswift.overlay.open(()=>($=_.div({class:Dt(["cms-time-panel",l(o),e.panelClass])}),m(),$),{type:"time",anchorEl:oe._control||le,placement:e.placement||"bottom-start",offsetX:(h=e.offsetX)!=null?h:0,offsetY:(j=(J=e.offsetY)!=null?J:e.offset)!=null?j:8,backdrop:!1,lockScroll:!1,trapFocus:!1,closeOnOutside:e.closeOnOutside!==!1,closeOnBackdrop:!1,closeOnEsc:!0,autoFocus:!1,className:Dt(["cms-time-overlay",e.panelClass]),onClose:()=>{var ce;D=null,$=null,M(),(ce=e.onClose)==null||ce.call(e)}}),e.panelStyle&&Object.assign(D.panel.style,e.panelStyle),bn(D),ue(),M(),(U=e.onOpen)==null||U.call(e)),D}function F(){if(!D)return;const h=D;yn(h,()=>JSswift.overlay.close(h.id))}return le.addEventListener("focus",h=>{var J;(J=e.onFocus)==null||J.call(e,h),e.openOnFocus!==!1&&g()}),le.addEventListener("click",h=>{var J;(J=e.onClick)==null||J.call(e,h),g()}),le.addEventListener("keydown",h=>{if(h.key==="Escape"){D&&(h.preventDefault(),F());return}(h.key==="ArrowDown"||h.key==="Enter"||h.key===" ")&&(h.preventDefault(),g()),(h.key==="Backspace"||h.key==="Delete")&&!l(e.manualInput)&&l(e.clearable)!==!1&&(h.preventDefault(),Q(null,h,{commit:!0}))}),l(e.manualInput)?(le.addEventListener("input",h=>{var J;return(J=e.onTyping)==null?void 0:J.call(e,le.value,h)}),le.addEventListener("change",h=>Q(le.value,h)),le.addEventListener("blur",h=>{var J;(J=e.onBlur)==null||J.call(e,h),le.value===""?Q(null,h):Q(le.value,h)})):le.addEventListener("blur",h=>{var J;return(J=e.onBlur)==null?void 0:J.call(e,h)}),y&&y.watch(h=>{const J=it(v(h));Z(J)!==Z(G)&&(G=it(J),ie=it(J),M(),m())},"UI.Time:watch"),JSswift.reactive.effect(()=>{!y&&e.value!=null&&(G=it(v(l(e.value))),ie=it(G)),M(),m(),D&&l(e.disabled)&&F()},"UI.Time:render"),oe._input=le,oe._time=le,oe._open=g,oe._close=F,oe._getValue=()=>P(G),oe._setValue=h=>Q(h,null,{emit:!1,commit:!0}),oe._panel=()=>(D==null?void 0:D.panel)||null,oe},he.Tabs=(...t)=>{var N,I,H,ge,Se,ye;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(V,O)=>!!V&&Object.prototype.hasOwnProperty.call(V,O),r=V=>String(l(V)||"horizontal").toLowerCase()==="vertical"?"vertical":"horizontal",C=V=>{const O=String(l(V)||"").toLowerCase();return O==="pills"||O==="pill"?"pills":O==="soft"||O==="card"?"soft":"line"},u=V=>{var K;const O=l(V);return O==null||O===""?null:(K=JSswift.uiColors)!=null&&K.includes(O)?`var(--cms-${O})`:String(O)},i=(V,O)=>Object.is(V,O)||V!=null&&O!=null&&V==O,y=Nt(e.model,"UI.Tabs:model"),R=r(e.orientation||e.orient||e.direction),v=C(e.variant||(e.pills?"pills":e.soft?"soft":"line")),b=!!l((I=(N=e.fill)!=null?N:e.navFill)!=null?I:e.stretch),P=!!l(e.wrap),Z=!!l(e.disabled),G=e.id||"cms-tabs-"+Math.random().toString(36).slice(2,9),ie=l((H=e.tabs)!=null?H:e.items)||[],D=(Array.isArray(ie)?ie:[ie]).map((V,O)=>{var ee,xe,be,Ce,pe,Ie,_e,z,we,T,x,w,c,A;if(V==null)return null;if(typeof V!="object")return{raw:V,index:O,value:V,labelFallback:V,noteFallback:null,iconFallback:null,badgeFallback:null,disabled:!1,hidden:!1};const K=(Ie=(pe=(Ce=(be=(xe=(ee=V.value)!=null?ee:V.name)!=null?xe:V.id)!=null?be:V.key)!=null?Ce:V.label)!=null?pe:V.title)!=null?Ie:`tab-${O}`,ke=(T=(we=(z=(_e=V.label)!=null?_e:V.title)!=null?z:V.name)!=null?we:V.value)!=null?T:`Tab ${O+1}`,Ne=o(V,"badge")?V.badge:o(V,"counter")?V.counter:null;return{...V,raw:V,index:O,value:K,labelFallback:ke,noteFallback:(c=(w=(x=V.note)!=null?x:V.subtitle)!=null?w:V.description)!=null?c:null,iconFallback:(A=V.icon)!=null?A:null,badgeFallback:Ne}}).filter(Boolean).filter(V=>V.hidden!==!0&&V.visible!==!1),$=D.find(V=>!V.disabled)||null,Y=V=>D.findIndex(O=>i(O.value,V)),W=(V,O)=>{var ke;if(!D.length)return-1;let K=V;for(let Ne=0;Ne<D.length;Ne+=1)if(K+=O,K<0?K=D.length-1:K>=D.length&&(K=0),!((ke=D[K])!=null&&ke.disabled))return K;return-1},le=(V,O=!1)=>{var ke,Ne;const K=Y(V);return K>=0&&!((ke=D[K])!=null&&ke.disabled)?D[K].value:O?(Ne=$==null?void 0:$.value)!=null?Ne:null:V!=null?V:null},me=le(y?y.get():o(e,"value")?l(e.value):(ge=e.defaultValue)!=null?ge:e.default,!0),[re,oe]=JSswift.reactive.signal(me),se=ae(["cms-clear-set","cms-tabs","cms-singularity",R,`variant-${v}`,fe(e.dense,"dense"),fe(b,"fill"),fe(P,"wrap"),fe(Z,"disabled"),e.class]),te=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"]);te.class=se,te.style={...e.style||{}},e.gap!=null&&(te.style["--cms-tabs-gap"]=Be(e.gap)),e.tabGap!=null&&(te.style["--cms-tabs-tab-gap"]=Be(e.tabGap));const M=u((Se=e.color)!=null?Se:e.state);M&&(te.style["--cms-tabs-accent"]=M);const Q=_.div(te),q=_.div({class:ae(["cms-tabs-bar",e.barClass]),style:{alignItems:e.align||(R==="vertical"?"stretch":"center"),justifyContent:e.justify||"flex-start",...e.barStyle||{}}}),ue=_.div({class:ae(["cms-tabs-nav",e.navClass]),style:e.navStyle||null,role:"tablist","aria-orientation":R}),L=[],f=()=>Y(re()),m=()=>{const V=f();return V>=0?D[V]:null},g=()=>({tabs:D,value:re(),active:re(),activeIndex:f(),activeTab:m(),orientation:R,variant:v,select:(V,O)=>h(V,{event:O,emit:!0}),next:()=>j(),prev:()=>U()}),F=(V,O,K)=>({...g(),tab:V,index:O,active:K,disabled:!!V.disabled,select:ke=>J(O,{event:ke,emit:!0})}),X=V=>{var K;const O=(K=L[V])==null?void 0:K.btn;!O||typeof O.focus!="function"||requestAnimationFrame(()=>O.focus())},a=V=>{const O=Y(V);Q.dataset.value=V==null?"":String(V),Q.dataset.activeIndex=O>=0?String(O):"",L.forEach(({btn:K,item:ke,tab:Ne,index:ee})=>{const xe=ee===O;ke.classList.toggle("active",xe),ke.classList.toggle("disabled",!!(Ne.disabled||Z)),K.classList.toggle("active",xe),K.setAttribute("aria-selected",xe?"true":"false"),K.setAttribute("tabindex",xe?"0":"-1")})},S=V=>{oe(V),a(V)},h=(V,O={})=>{if(Z)return null;const K=Y(V);return K<0?null:J(K,O)},J=(V,O={})=>{var xe,be;const K=D[V];if(!K||K.disabled||Z)return null;const ke=K.value,Ne=re(),ee=!i(Ne,ke);return S(ke),y&&!i(y.get(),ke)&&y.set(ke),O.focus&&X(V),O.event&&((xe=K.onClick)==null||xe.call(K,ke,O.event,K,V)),ee&&O.emit!==!1&&((be=e.onChange)==null||be.call(e,ke,K,O.event||null,V)),K},j=()=>{const V=W(f()<0?-1:f(),1);V>=0&&J(V,{emit:!0,focus:!0})},U=()=>{const V=f()<0?0:f(),O=W(V,-1);O>=0&&J(O,{emit:!0,focus:!0})},ce=(V,O)=>{var w,c,A,de,Le,Je;const K=O===f(),ke=F(V,O,K),Ne=`${G}-tab-${O}`,ee=V.iconFallback!=null?typeof V.iconFallback=="string"?he.Icon({name:V.iconFallback,size:(A=(c=(w=V.iconSize)!=null?w:V.size)!=null?c:e.size)!=null?A:null}):V.iconFallback:null,xe=E(s,"icon",ke,ee),be=E(null,"default",{},JSswift.ui.renderSlot(s,"label",ke,V.labelFallback)),Ce=E(s,"note",ke,V.noteFallback),pe=E(s,"badge",ke,V.badgeFallback),Ie=_.span({class:"cms-tabs-tab-inner"},xe.length?_.span({class:"cms-tabs-tab-icon"},...xe):null,_.span({class:"cms-tabs-tab-copy"},_.span({class:"cms-tabs-tab-label"},...be.length?be:[""]),Ce.length?_.span({class:"cms-tabs-tab-note"},...Ce):null),pe.length?_.span({class:"cms-tabs-tab-badge"},...pe):null),_e=E(s,"tab",{...ke,tabId:Ne,label:be,icon:xe,note:Ce,badge:pe},Ie),z=B=>{var De;if(V.disabled||Z)return;const Ae=B.key;if(Ae==="Enter"||Ae===" "){B.preventDefault(),J(O,{event:B,emit:!0});return}if(Ae==="Home"){B.preventDefault();const Ue=D.findIndex(Ye=>!Ye.disabled);Ue>=0&&J(Ue,{event:B,emit:!0,focus:!0});return}if(Ae==="End"){B.preventDefault();let Ue=-1;for(let Ye=D.length-1;Ye>=0;Ye-=1)if(!((De=D[Ye])!=null&&De.disabled)){Ue=Ye;break}Ue>=0&&J(Ue,{event:B,emit:!0,focus:!0});return}const Me=R==="vertical"?["ArrowUp"]:["ArrowLeft"],Ee=R==="vertical"?["ArrowDown"]:["ArrowRight"];if(Me.includes(Ae)){B.preventDefault();const Ue=W(O,-1);Ue>=0&&J(Ue,{event:B,emit:!0,focus:!0});return}if(Ee.includes(Ae)){B.preventDefault();const Ue=W(O,1);Ue>=0&&J(Ue,{event:B,emit:!0,focus:!0})}},we=u((de=V.color)!=null?de:V.state),T=_.div({class:ae(["cms-tabs-item",fe(K,"active"),fe(V.disabled||Z,"disabled"),e.itemClass,V.itemClass]),style:{...we?{"--cms-tabs-item-accent":we}:{},...e.itemStyle||{},...V.itemStyle||{}},"data-name":String(V.value)}),x=he.Btn({class:ae(["cms-tabs-tab",fe(K,"active"),fe(V.disabled||Z,"disabled"),e.tabClass,V.tabClass||V.class]),type:"button",id:Ne,role:"tab",disabled:!!(V.disabled||Z),"aria-selected":K?"true":"false",tabindex:K?"0":"-1",size:(Je=(Le=V.size)!=null?Le:e.size)!=null?Je:null,style:{...e.tabStyle||{},...V.tabStyle||{}},onClick:B=>{J(O,{event:B,emit:!0})},onKeydown:z},..._e);return T.appendChild(x),T.appendChild(_.span({class:"tab-indicator"})),L[O]={tab:V,index:O,item:T,btn:x},T};if(D.length){const V=D.map((K,ke)=>ce(K,ke)),O=JSswift.ui.renderSlot(s,"nav",{...g(),nodes:V},V);E(null,"default",{},O).forEach(K=>ue.appendChild(K))}else E(s,"empty",g(),(ye=e.empty)!=null?ye:_.div({class:"cms-tabs-empty"},"Nessuna tab disponibile.")).forEach(V=>ue.appendChild(V));const k=g(),d=[...E(null,"default",{},JSswift.ui.renderSlot(s,"extra",k,null)),...E(s,"default",k,n)];return q.appendChild(ue),d.length&&q.appendChild(_.div({class:"cms-tabs-extra"},...d)),Q.appendChild(q),S(me),y?y.watch(V=>{S(le(V,!0))},"UI.Tabs:watch"):at(e.value)&&He.reactive.effect(()=>{S(le(l(e.value),!0))},"UI.Tabs:value"),Q._getValue=()=>re(),Q._setValue=V=>h(V,{emit:!0}),Q._select=V=>h(V,{emit:!0}),Q._next=()=>j(),Q._prev=()=>U(),Q._getTabs=()=>D.slice(),Ke(Q,e),Q},he.RouteTab=(...t)=>{var X,a,S,h,J,j,U,ce,k,d,N,I,H,ge,Se;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=JSswift.router||(He==null?void 0:He.router)||null,r=ye=>Object.prototype.hasOwnProperty.call(e,ye),C=r("active")||r("selected"),u=ye=>{const V=String(l(ye)||"").toLowerCase();return V==="pill"||V==="pills"?"pills":V==="soft"||V==="card"?"soft":"line"},i=ye=>{var O;const V=l(ye);return V==null||V===""?null:(O=JSswift.uiColors)!=null&&O.includes(V)?`var(--cms-${V})`:String(V)},y=ye=>{if(ye==null||ye==="")return"";try{return new URL(String(ye),window.location.origin).pathname||""}catch(V){return String(ye).split(/[?#]/)[0]||""}},R=ye=>l(e.external)===!0?!0:ye?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(ye)):!1,v=()=>{var ye;return l((ye=e.href)!=null?ye:e.to)||"#"},b=()=>{var ye;return l((ye=e.to)!=null?ye:e.href)||""},P=()=>{try{if(o!=null&&o.current)return o.current().pathname||window.location.pathname||""}catch(ye){}return window.location.pathname||""},Z=()=>{var ee,xe,be;const ye=b();if(!ye)return!1;const V=l((xe=(ee=e.match)!=null?ee:e.activeMatch)!=null?xe:e.routeMatch),O=String(l((be=e.matchMode)!=null?be:e.startsWith?"startsWith":e.exact?"exact":"")||"").toLowerCase(),K=P();if(typeof V=="function")return!!V({currentPath:K,to:ye,href:v(),router:o,props:e});if(V instanceof RegExp)return V.test(K);const ke=y(typeof V=="string"&&!["exact","startsWith","prefix","section"].includes(V.toLowerCase())?V:ye);if(!ke)return!1;const Ne=O||(typeof V=="string"&&["startsWith","prefix","section"].includes(V.toLowerCase())?"startsWith":"exact");return Ne==="startswith"||Ne==="prefix"||Ne==="section"?K===ke||K.startsWith(`${ke}/`):o!=null&&o.isActive?!!o.isActive(ye):K===ke},G=()=>!!l(e.disabled);let ie=null;const D=()=>{var ye;return ie!=null?!!ie:C?!!l((ye=e.active)!=null?ye:e.selected):Z()},$=u(e.variant||(e.pills?"pills":e.soft?"soft":"line")),Y=!l(e.color)&&l(e.state)?mt(l(e.state)):"",W=Y?`cms-state-${Y}`:"",le=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"]);le.href=v(),le.class=ae(["cms-route-tab","cms-clear-set","cms-singularity",`variant-${$}`,fe((X=e.block)!=null?X:e.fill,"block"),fe(e.dense,"dense"),W,e.class]),le.style={...e.style||{}};const me=i((a=e.color)!=null?a:e.state);me&&(le.style["--cms-route-tab-accent"]=me);const re=(h=(S=e.iconSize)!=null?S:e.size)!=null?h:null,oe=(ye,V)=>{const O=l(ye);return O==null||O===!1||O===""?null:typeof O=="string"?he.Icon({name:O,size:re}):JSswift.ui.slot(O,{as:V})},se=()=>({active:D(),disabled:G(),href:v(),to:b(),external:R(v()),navigate:ye=>{var K,ke;if(G())return!1;const V=b();return!R(v())&&V&&(o!=null&&o.navigate)?(ye!=null&&ye.preventDefault&&ye.preventDefault(),o.navigate(V),(K=e.onNavigate)==null||K.call(e,V,ye||null),!0):((ke=e.onNavigate)==null||ke.call(e,V||v(),ye||null),!1)}}),te=E(s,"icon",se(),oe(e.icon,"icon")),M=E(s,"label",se(),(U=(j=(J=e.label)!=null?J:e.title)!=null?j:e.text)!=null?U:n),Q=E(s,"note",se(),(d=(k=(ce=e.note)!=null?ce:e.subtitle)!=null?k:e.caption)!=null?d:e.description),q=E(s,"badge",se(),(I=(N=e.badge)!=null?N:e.counter)!=null?I:e.count),ue=E(s,"aside",se(),(ge=(H=e.aside)!=null?H:e.trailing)!=null?ge:oe(e.iconRight,"iconRight")),L=E(s,"default",se(),(Se=e.content)!=null?Se:e.body),f=_.span({class:"cms-route-tab-inner"},te.length?_.span({class:"cms-route-tab-icon"},...te):null,_.span({class:"cms-route-tab-copy"},_.span({class:"cms-route-tab-label"},...M.length?M:[b()||v()||""]),Q.length?_.span({class:"cms-route-tab-note"},...Q):null,L.length?_.span({class:"cms-route-tab-extra"},...L):null),q.length?_.span({class:"cms-route-tab-badge"},...q):null,ue.length?_.span({class:"cms-route-tab-aside"},...ue):null),m=_.a(le,f);Ke(m,e);const g=()=>{const ye=D(),V=G(),O=v(),K=R(O);m.classList.toggle("active",ye),m.classList.toggle("is-disabled",V),m.classList.toggle("is-external",K),ye?m.setAttribute("aria-current",String(l(e.ariaCurrent)||"page")):m.removeAttribute("aria-current"),m.setAttribute("href",O||"#"),V?(m.setAttribute("aria-disabled","true"),m.tabIndex=-1):(m.removeAttribute("aria-disabled"),!r("tabIndex")&&!r("tabindex")&&m.removeAttribute("tabindex")),b()?m.dataset.to=String(b()):delete m.dataset.to,K&&m.target==="_blank"&&!m.rel&&(m.rel="noopener noreferrer")},F=e.onClick;return m.onclick=ye=>{if(F==null||F(ye),!ye.defaultPrevented){if(G()){ye.preventDefault();return}se().navigate(ye)}},!C&&b()&&(o!=null&&o.subscribe)&&o.subscribe(()=>g()),JSswift.reactive.effect(()=>{g()},"UI.RouteTab:render"),m._isActive=()=>D(),m._setActive=ye=>(ie=ye==null?null:!!ye,g(),m),m._navigate=ye=>se().navigate(ye),m},he.Breadcrumbs=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=JSswift.router||(He==null?void 0:He.router)||null,r=Nt(e.model,"UI.Breadcrumbs:model"),C=qe(e.size,()=>{var Q;const M=l(e.size);return typeof M=="string"&&((Q=JSswift.uiSizes)!=null&&Q.includes(M))?`cms-size-${M}`:""}),u=qe(e.variant,()=>{const M=String(l(e.variant||(e.pills?"pills":e.soft?"soft":"line"))||"").toLowerCase();return M==="pill"||M==="pills"?"variant-pills":M==="soft"||M==="card"?"variant-soft":"variant-line"}),i=qe([e.wrap,e.nowrap],()=>l(e.wrap)===!1||l(e.nowrap)?"no-wrap":""),y=_.nav({class:ae(["cms-breadcrumbs","cms-clear-set",C,u,i,fe(e.dense,"dense"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Breadcrumb"}),R=_.div({class:"cms-breadcrumbs-before"}),v=_.ol({class:"cms-breadcrumbs-list"}),b=_.div({class:"cms-breadcrumbs-after"});y.appendChild(R),y.appendChild(v),y.appendChild(b);const P=M=>{var q;const Q=l(M);return Q==null||Q===""?null:(q=JSswift.uiColors)!=null&&q.includes(Q)?`var(--cms-${Q})`:String(Q)},Z=M=>{var q;if(!M)return!1;if(l(M.external)===!0)return!0;const Q=l((q=M.href)!=null?q:M.to);return Q?/^(mailto:|tel:|https?:\/\/|\/\/)/i.test(String(Q)):!1},G=M=>M!=null&&M.nodeType&&M.cloneNode?M.cloneNode(!0):M,ie=(M,Q)=>{M.innerHTML="",Q.forEach(q=>M.appendChild(q))},D=(M,Q,q,ue,L=null)=>{const f=JSswift.ui.getSlot(M,Q)!=null?E(M,Q,q,ue):[];return f.length?f:L&&JSswift.ui.getSlot(M,L)!=null?E(M,L,q,ue):E(null,"default",q,ue)},$=(M,Q,q)=>{const ue=l(M);return ue==null||ue===!1||ue===""?null:typeof ue=="string"?he.Icon({name:ue,size:Q}):JSswift.ui.slot(ue,{as:q})},Y=()=>{var L,f;const M=r?r.get():l((f=(L=e.items)!=null?L:e.value)!=null?f:e.breadcrumbs),Q=[],q=m=>{if(!(m==null||m===!1)){if(Array.isArray(m)){m.forEach(q);return}if(typeof m=="string"||typeof m=="number"){Q.push({label:String(m)});return}if(m!=null&&m.nodeType||typeof m=="function"){Q.push({label:m});return}Q.push(m)}},ue=l(e.home);return ue&&q(ue===!0?{label:"Home",to:"/",icon:"home"}:ue),q(M),!Q.length&&(n!=null&&n.length)&&n.forEach(m=>q(m)),Q.filter(m=>!l(m==null?void 0:m.hidden))},W=M=>{const Q=M.findIndex(q=>{var ue,L;return!!l((L=(ue=q==null?void 0:q.current)!=null?ue:q==null?void 0:q.active)!=null?L:q==null?void 0:q.selected)});return Q>-1?Q:l(e.autoCurrent)===!1?-1:M.length?M.length-1:-1},le=M=>{var g,F,X,a,S,h,J;const Q=Number(l((X=(F=(g=e.max)!=null?g:e.maxItems)!=null?F:e.collapseAfter)!=null?X:e.collapse)),q=Number.isFinite(Q)?Math.max(0,Math.trunc(Q)):0;if(!q||q<3||M.length<=q)return M.map((j,U)=>({type:"item",item:j,index:U,key:`item-${U}`}));let ue=Number(l((S=(a=e.leadingCount)!=null?a:e.keepStart)!=null?S:1)),L=Number(l((J=(h=e.trailingCount)!=null?h:e.keepEnd)!=null?J:Math.max(1,q-2)));if(ue=Number.isFinite(ue)?Math.max(1,Math.trunc(ue)):1,L=Number.isFinite(L)?Math.max(1,Math.trunc(L)):Math.max(1,q-2),ue+L+1>q&&(L=Math.max(1,q-ue-1),ue+L+1>q&&(ue=Math.max(1,q-L-1))),ue+L>=M.length)return M.map((j,U)=>({type:"item",item:j,index:U,key:`item-${U}`}));const f=[];for(let j=0;j<ue;j++)f.push({type:"item",item:M[j],index:j,key:`item-${j}`});const m=M.slice(ue,M.length-L);f.push({type:"collapsed",key:`collapsed-${ue}-${M.length-L}`,items:m,from:ue,to:M.length-L-1});for(let j=M.length-L;j<M.length;j++)f.push({type:"item",item:M[j],index:j,key:`item-${j}`});return f},me=(M,Q=null)=>{var L,f,m,g,F;if(!M)return!1;const q=l((L=M.href)!=null?L:M.to)||"",ue=l(M.to)||"";return!Z(M)&&ue&&(o!=null&&o.navigate)?(Q!=null&&Q.preventDefault&&Q.preventDefault(),o.navigate(ue),(f=M.onNavigate)==null||f.call(M,ue,Q||null),(m=e.onNavigate)==null||m.call(e,ue,M,Q||null),!0):((g=M.onNavigate)==null||g.call(M,ue||q,Q||null),(F=e.onNavigate)==null||F.call(e,ue||q,M,Q||null),!1)},re=(M,Q,q)=>{var F,X,a;const ue=M,L=q[Q+1]||null,f={index:Q,entry:M,previous:ue,next:L},m=G(l((a=(X=(M==null?void 0:M.type)==="item"?(F=M.item)==null?void 0:F.separator:null)!=null?X:e.separator)!=null?a:"/")),g=D(s,"separator",f,m);return _.li({class:"cms-breadcrumbs-separator-item","aria-hidden":"true"},_.span({class:"cms-breadcrumbs-separator"},...g))},oe=(M,Q,q)=>{const ue={type:"collapsed",collapsed:!0,items:Q,hiddenItems:M.items,currentIndex:q,from:M.from,to:M.to},L=_.span({class:"cms-breadcrumb cms-breadcrumb-collapsed"},_.span({class:"cms-breadcrumb-inner"},_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},String(l(e.collapsedLabel)||"\u2026"))))),f=D(s,"collapsed",ue,L,"item");return _.li({class:"cms-breadcrumbs-entry is-collapsed"},...f)},se=(M,Q,q,ue)=>{var ee,xe,be,Ce,pe,Ie,_e,z,we,T,x,w,c,A,de,Le,Je,B,Ae,Me,Ee,De,Ue,Ye,Ze,Qe;const L=M.item||{},f=L.slots?{...s,...L.slots}:s,m=l((ee=L.href)!=null?ee:L.to)||"",g=!!l(L.disabled),F=M.index===q,X=(Ce=(be=(xe=L.iconSize)!=null?xe:e.itemSize)!=null?be:e.size)!=null?Ce:null,a=P((_e=(Ie=(pe=L.color)!=null?pe:L.state)!=null?Ie:e.color)!=null?_e:e.state),S=!l(L.color)&&l(L.state)?mt(l(L.state)):"",h=(w=(x=(T=(we=(z=L.label)!=null?z:L.title)!=null?we:L.text)!=null?T:L.to)!=null?x:L.href)!=null?w:"",J=(de=(A=(c=L.note)!=null?c:L.subtitle)!=null?A:L.caption)!=null?de:L.description,j=(Je=(Le=L.badge)!=null?Le:L.counter)!=null?Je:L.count,U=(Ae=(B=L.aside)!=null?B:L.trailing)!=null?Ae:$(L.iconRight,X,"iconRight"),ce=(Me=L.content)!=null?Me:L.body,k={item:L,index:M.index,visibleIndex:ue,total:Q.length,current:F,active:F,disabled:g,href:m,to:l(L.to)||"",external:Z(L),isFirst:M.index===0,isLast:M.index===Q.length-1,navigate:Te=>me(L,Te)},d=D(f,"icon",k,$(L.icon,X,"icon")),N=D(f,"label",k,h),I=D(f,"note",k,J),H=D(f,"badge",k,j),ge=D(f,"aside",k,U),Se=D(f,"default",k,ce),ye=_.span({class:"cms-breadcrumb-inner"},d.length?_.span({class:"cms-breadcrumb-icon"},...d):null,_.span({class:"cms-breadcrumb-copy"},_.span({class:"cms-breadcrumb-label"},...N.length?N:[m||""]),I.length?_.span({class:"cms-breadcrumb-note"},...I):null,Se.length?_.span({class:"cms-breadcrumb-extra"},...Se):null),H.length?_.span({class:"cms-breadcrumb-badge"},...H):null,ge.length?_.span({class:"cms-breadcrumb-aside"},...ge):null),V=!g&&(!F||!!l((Ee=L.linkCurrent)!=null?Ee:e.linkCurrent)),O={class:ae(["cms-breadcrumb","cms-clear-set","cms-singularity",fe(F,"is-current"),fe(F,"active"),fe(g,"is-disabled"),S?`cms-state-${S}`:"",L.class]),style:{...L.style||{}},"aria-current":F?String(l((De=L.ariaCurrent)!=null?De:e.ariaCurrent)||"page"):null};a&&(O.style["--cms-breadcrumb-accent"]=a);let K=null;V&&m?(K=_.a({...O,href:m,target:L.target,rel:L.rel,onClick:Te=>{var je,tt;(je=L.onClick)==null||je.call(L,Te,k),(tt=e.onItemClick)==null||tt.call(e,L,k,Te),!Te.defaultPrevented&&k.navigate(Te)}},ye),k.external&&K.target==="_blank"&&!K.rel&&(K.rel="noopener noreferrer")):V&&typeof L.onClick=="function"?K=_.button({...O,type:L.type||"button",onClick:Te=>{var je,tt;(je=L.onClick)==null||je.call(L,Te,k),(tt=e.onItemClick)==null||tt.call(e,L,k,Te)}},ye):K=_.span({...O,"aria-disabled":g?"true":null},ye),Ke(K,{size:(Ye=(Ue=L.size)!=null?Ue:e.itemSize)!=null?Ye:e.size,radius:(Ze=L.radius)!=null?Ze:e.radius,gradient:(Qe=L.gradient)!=null?Qe:e.gradient});const Ne=D(f,"item",k,K);return _.li({class:ae(["cms-breadcrumbs-entry",fe(F,"is-current"),fe(g,"is-disabled")])},...Ne)},te=()=>{var f;const M=Y(),Q=W(M),q=le(M),ue=P((f=e.color)!=null?f:e.state);y.classList.toggle("is-empty",M.length===0),ue?y.style.setProperty("--cms-breadcrumb-accent",ue):y.style.removeProperty("--cms-breadcrumb-accent");const L={items:M,visibleItems:q,currentIndex:Q,count:M.length,collapsed:q.some(m=>m.type==="collapsed")};if(ie(R,D(s,"before",L,e.before)),ie(b,D(s,"after",L,e.after)),v.innerHTML="",!M.length){const m=D(s,"empty",L,e.empty);m.length&&v.appendChild(_.li({class:"cms-breadcrumbs-entry is-empty"},...m));return}q.forEach((m,g)=>{g>0&&v.appendChild(re(q[g-1],g-1,q)),v.appendChild(m.type==="collapsed"?oe(m,M,Q):se(m,M,Q,g))})};return He.reactive.effect(()=>{te()},"UI.Breadcrumbs:render"),y.getItems=()=>Y(),y.getVisibleItems=()=>le(Y()),y.refresh=()=>(te(),y),y.setItems=M=>(r?r.set(M):e.items=M,te(),y),Ke(y,e),y},he.Pagination=(...t)=>{const{props:e}=JSswift.uiNormalizeArgs(t),n=e.slots||{},s=Nt(e.model,"UI.Pagination:model"),o=qe(e.size,()=>{const a=l(e.size);return typeof a=="string"&&kn[a]?`cms-size-${a}`:""}),r=_.nav({class:ae(["cms-pagination","cms-clear-set",o,fe(e.dense,"dense"),fe(e.simple,"is-simple"),fe(e.disabled,"is-disabled"),e.class]),style:{...e.style||{}},role:"navigation","aria-label":e.ariaLabel||"Pagination"}),C=_.div({class:"cms-pagination-controls"}),u=_.div({class:"cms-pagination-start"}),i=_.div({class:"cms-pagination-pages"}),y=_.div({class:"cms-pagination-end"}),R=_.div({class:"cms-pagination-summary"});C.appendChild(u),C.appendChild(i),C.appendChild(y),r.appendChild(C),r.appendChild(R);let v=1,b=1;const P=(a,S=0)=>{const h=l(a);if(h==null||h==="")return S;const J=Number(h);return Number.isFinite(J)?Math.trunc(J):S},Z=(a,S=G())=>{const h=Number(a),J=Number.isFinite(h)?Math.trunc(h):1;return Math.min(Math.max(J||1,1),Math.max(1,S||1))},G=()=>{var J,j,U,ce,k,d,N;const a=P((U=(j=(J=e.max)!=null?J:e.pages)!=null?j:e.pageCount)!=null?U:e.totalPages,0);if(a>0)return a;const S=P((k=(ce=e.total)!=null?ce:e.totalItems)!=null?k:e.count,0),h=P((N=(d=e.pageSize)!=null?d:e.perPage)!=null?N:e.limit,0);return S>=0&&h>0?Math.max(1,Math.ceil(S/h)):1},ie=()=>{var a,S,h;return P(s?s.get():(h=(S=(a=e.page)!=null?a:e.value)!=null?S:e.current)!=null?h:e.currentPage,1)},D=()=>{var a,S;return Math.max(0,P((S=(a=e.siblings)!=null?a:e.siblingCount)!=null?S:e.window,1))},$=()=>{var a,S;return Math.max(0,P((S=(a=e.boundaryCount)!=null?a:e.boundaries)!=null?S:e.edges,1))},Y=()=>!!l(e.disabled),W=()=>{var a;return l((a=e.showSummary)!=null?a:e.showLabel)!==!1},le=()=>l(e.showPages)!==!1&&!l(e.simple),me=()=>l(e.showPrev)!==!1,re=()=>l(e.showNext)!==!1,oe=()=>!!l(e.showEdges),se=()=>{const a=l(e.showFirst);return a==null?oe():!!a},te=()=>{const a=l(e.showLast);return a==null?oe():!!a},M=()=>!!l(e.hideOnSinglePage),Q=()=>{var h,J;const a=l((J=(h=e.total)!=null?h:e.totalItems)!=null?J:e.count);if(a==null||a==="")return null;const S=Number(a);return Number.isFinite(S)?Math.max(0,Math.trunc(S)):null},q=()=>{var h,J;const a=l((J=(h=e.pageSize)!=null?h:e.perPage)!=null?J:e.limit);if(a==null||a==="")return null;const S=Number(a);return Number.isFinite(S)&&S>0?Math.trunc(S):null},ue=(a=v,S=b)=>{const h=Q(),J=q(),j=h!=null&&J?h===0?0:(a-1)*J+1:null,U=h!=null&&J?Math.min(h,a*J):null;return{page:a,value:a,current:a,currentPage:a,pages:S,max:S,total:h,pageSize:J,from:j,to:U,disabled:Y(),isFirst:a<=1,isLast:a>=S,canPrev:a>1,canNext:a<S,setPage:(ce,k)=>X(ce,k),prev:ce=>X(a-1,ce),next:ce=>X(a+1,ce),first:ce=>X(1,ce),last:ce=>X(S,ce)}},L=(a,S)=>{if(S<=0)return[];const h=[],J=new Set,j=$(),U=D();for(let k=1;k<=Math.min(j,S);k++)J.add(k);for(let k=Math.max(1,a-U);k<=Math.min(S,a+U);k++)J.add(k);for(let k=Math.max(1,S-j+1);k<=S;k++)J.add(k);let ce=0;for(let k=1;k<=S;k++)J.has(k)&&(ce&&k-ce>1&&h.push({type:"ellipsis",key:`ellipsis-${ce}-${k}`}),h.push({type:"page",page:k,key:`page-${k}`}),ce=k);return h.length||h.push({type:"page",page:1,key:"page-1"}),h},f=(a,S,h,J=null)=>{const j=JSswift.ui.getSlot(n,a)!=null?E(n,a,h,S):[];return j.length?j:J&&JSswift.ui.getSlot(n,J)!=null?E(n,J,h,S):E(null,"default",h,S)},m=(a,S)=>{a.innerHTML="",S.forEach(h=>a.appendChild(h))},g=(a,S,h,J={})=>{var U;const j={...ue(),kind:a,active:!!J.active};return he.Btn({class:ae(["cms-pagination-btn",`cms-pagination-${a}`,fe(J.active,"active"),J.class]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:J.active?e.color||e.state||"primary":J.color||null,outline:J.active?!1:(U=J.outline)!=null?U:!0,disabled:Y()||!!J.disabled,"aria-current":J.active?"page":null,onClick:ce=>{Y()||J.disabled||h==null||h(ce)}},...f(a,S,j,a==="summary"?"label":a==="page"?"item":null))},F=(a,S)=>{v=Z(a,S),b=Math.max(1,S||1);const h=ue(v,b);r.style.display=M()&&b<=1?"none":"",R.style.display=W()?"":"none",i.style.display=le()?"":"none",u.innerHTML="",i.innerHTML="",y.innerHTML="";const J=f("start",e.start,h);J.length&&u.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-start"},...J)),se()&&u.appendChild(g("first","\xAB",ce=>X(1,ce),{disabled:v<=1})),me()&&u.appendChild(g("prev","Prev",ce=>X(v-1,ce),{disabled:v<=1})),le()&&L(v,b).forEach(ce=>{if(ce.type==="ellipsis"){const N={...h,kind:"ellipsis"},I=f("ellipsis","\u2026",N);i.appendChild(_.span({class:"cms-pagination-ellipsis","aria-hidden":"true"},...I));return}const k=ce.page,d={...h,page:k,value:k,item:ce,active:k===v};i.appendChild(he.Btn({class:ae(["cms-pagination-btn","cms-pagination-page-btn",fe(k===v,"active")]),size:e.itemSize||e.size||(e.dense?"sm":"md"),color:k===v?e.color||e.state||"primary":null,outline:k!==v,disabled:Y(),"aria-current":k===v?"page":null,onClick:N=>X(k,N)},...f("page",String(k),d,"item")))}),re()&&y.appendChild(g("next","Next",ce=>X(v+1,ce),{disabled:v>=b})),te()&&y.appendChild(g("last","\xBB",ce=>X(b,ce),{disabled:v>=b}));const j=f("end",e.end,h);j.length&&y.appendChild(_.div({class:"cms-pagination-extra cms-pagination-extra-end"},...j));let U=`Pagina ${v} di ${b}`;h.total!=null&&h.pageSize&&(U=h.total===0?"0 risultati":`${h.from}-${h.to} di ${h.total}`),m(R,f("summary",U,h,"label"))},X=(a,S=null)=>{var j,U;const h=G(),J=Z(a,h);return J===v&&h===b||(F(J,h),s&&s.get()!==J&&s.set(J),(j=e.onChange)==null||j.call(e,J,ue(J,h),S),(U=e.onPageChange)==null||U.call(e,J,ue(J,h),S)),J};return He.reactive.effect(()=>{const a=G(),S=ie(),h=Z(S,a);F(h,a),s&&S!==h&&s.set(h)},"UI.Pagination:sync"),r.getPage=()=>v,r.getPages=()=>b,r.setPage=a=>X(a),r.prev=()=>X(v-1),r.next=()=>X(v+1),r.first=()=>X(1),r.last=()=>X(b),Ke(r,e),r},he.Spinner=(...t)=>{var Y;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(W,le,me)=>{if(at(W))return()=>{const oe=l(W);if(oe==null||oe===!1||oe==="")return me;const se=le?le(oe):oe;return se==null||se===""?me:se};if(W==null||W===!1||W==="")return me;const re=le?le(W):W;return re==null||re===""?me:re},r=W=>{if(W==null||W===!1||W===""||mt(W))return"";const me=String(W).trim();return me?me.startsWith("#")||me.startsWith("rgb(")||me.startsWith("rgba(")||me.startsWith("hsl(")||me.startsWith("hsla(")||me.startsWith("var(")?me:Qt(me)?`var(--cms-${me})`:me:""},C=qe(e.state,()=>{const W=mt(l(e.state));return W?`cms-state-${W}`:""}),u=ae(["cms-spinner",C,fe(e.vertical,"vertical"),fe(e.reverse,"reverse"),fe(e.center,"center"),fe(e.block,"block"),fe(e.pause||e.paused,"paused"),e.class]),i=JSswift.omit(e,["ariaLabel","block","center","color","indicatorClass","indicatorStyle","label","note","pause","paused","reverse","size","slots","speed","state","thickness","trackColor","vertical"]);i.class=u;const y={...e.style||{}};e.color!=null&&Object.prototype.hasOwnProperty.call(y,"backgroundColor")&&delete y.backgroundColor,i.style=y,i.role==null&&(i.role="status"),i["aria-live"]==null&&(i["aria-live"]="polite"),i["aria-busy"]==null&&(i["aria-busy"]="true");const R={props:e},v=E(s,"label",R,e.label),b=E(s,"default",R,n),P=E(s,"note",R,e.note),Z=v.length||b.length||P.length;if(!Z){const W=l((Y=e.ariaLabel)!=null?Y:e["aria-label"]);W?i["aria-label"]=W:i["aria-label"]==null&&(i["aria-label"]="Loading")}const G=_.span({class:ae(["cms-spinner-indicator",e.indicatorClass]),style:{"--cms-spinner-size":o(e.size,Be,"18px"),"--cms-spinner-thickness":o(e.thickness,Be,"2px"),"--cms-spinner-speed":o(e.speed,W=>typeof W=="number"?`${W}ms`:String(W),"900ms"),"--cms-spinner-color":o(e.color,r,"var(--set-border-color, var(--cms-primary))"),"--cms-spinner-track":o(e.trackColor,r,"color-mix(in srgb, var(--cms-spinner-color) 18%, transparent)"),...e.indicatorStyle||{}},"aria-hidden":"true"}),ie=E(s,"indicator",R,G),D=[];ie.length&&D.push(...ie),Z&&D.push(_.div({class:"cms-spinner-content"},v.length?_.div({class:"cms-spinner-label"},...v):null,b.length?_.div({class:"cms-spinner-copy"},...b):null,P.length?_.div({class:"cms-spinner-note"},...P):null));const $=_.div(i,...D);return Ke($,e),$},he.Progress=(...t)=>{var I,H,ge,Se,ye,V,O,K,ke,Ne;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=e.model||(At(e.value)||Jt(e.value)?e.value:null),r=Nt(o,"UI.Progress:model"),C=qe([e.state,e.color],()=>{const ee=mt(l(e.state)||l(e.color));return ee?`cms-state-${ee}`:""}),u=(ee,xe)=>{const be=Number(ee);return Number.isFinite(be)?be:xe},i=()=>u(l(e.min),0),y=()=>{const ee=i(),xe=u(l(e.max),100);return xe<ee?ee:xe},R=()=>{var xe,be;const ee=l((be=(xe=e.height)!=null?xe:e.thickness)!=null?be:e.size);return ee==null||ee===""?"8px":typeof ee=="number"?`${ee}px`:typeof ee=="string"?{xxs:"4px",xs:"6px",sm:"8px",md:"10px",lg:"12px",xl:"14px",xxl:"16px",xxxl:"18px"}[ee]||ee:"8px"},v=(ee,xe="")=>{const be=l(ee);if(be==null||be===!1||be==="")return xe;const Ce=mt(be);return Ce?`var(--cms-${Ce})`:typeof be=="string"&&Qt(be)?`var(--cms-${be})`:String(be)},b=ee=>{const xe=i(),be=y(),Ce=u(ee,xe);return Math.min(be,Math.max(xe,Ce))},P=ee=>{const xe=i(),Ce=y()-xe;if(!Ce)return 0;const pe=(b(ee)-xe)/Ce,Ie=l(e.reverse)?1-pe:pe;return Math.max(0,Math.min(1,Ie))},Z=ee=>{const xe=b(ee);return xe<le()?le():xe},G=(ee,xe,be)=>{const Ce=e.formatValue;if(typeof Ce=="function"){const pe=Ce(ee,xe,be);if(pe!=null)return pe}return`${Math.round(xe)}%`},ie=ee=>{for(;ee.firstChild;)ee.removeChild(ee.firstChild)},D=(ee,xe,be="flex")=>{ie(ee),(xe||[]).forEach(Ce=>{if(!(Ce==null||Ce===!1)){if(Ce instanceof Node){ee.appendChild(Ce);return}ee.appendChild(document.createTextNode(String(Ce)))}}),ee.style.display=ee.childNodes.length?be:"none"},$=(ee,xe={})=>An(l(ee),xe),Y=(ee,xe,be={})=>{var pe;const Ce=l(ee);return Ce==null||Ce===!1||Ce===""?[]:typeof Ce=="string"?[he.Icon({name:Ce,size:(pe=e.iconSize)!=null?pe:16})]:$(Ce,{...be,as:xe})},W=ee=>Jt(ee)||At(ee)?l(ee):typeof ee=="function"&&ee.length===0?ee():ee,[le,me]=JSswift.reactive.signal(b(r?r.get():(H=(I=l(e.value))!=null?I:l(e.min))!=null?H:0)),[re,oe]=JSswift.reactive.signal(Z((ye=l(e.buffer))!=null?ye:r?r.get():(Se=(ge=l(e.value))!=null?ge:l(e.min))!=null?Se:0)),se=(ee,xe={})=>{const be=b(ee);return le()!==be&&me(be),re()<be&&oe(be),r&&xe.fromModel!==!0&&r.set(be),be},te=ee=>{const xe=Z(ee);return re()!==xe&&oe(xe),xe},M=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"]),Q={width:l(e.width)||"100%",...e.style||{}},q=l(e.color);(q!=null||at(e.color))&&!mt(q||"")&&delete Q.backgroundColor,M.class=ae(["cms-progress-wrap",fe(e.dense,"dense"),fe(e.reverse,"is-reverse"),fe(e.indeterminate,"is-indeterminate"),C,e.class]),M.style=Q;const ue=_.div({class:"cms-progress-header"}),L=_.div({class:"cms-progress-heading"}),f=_.div({class:"cms-progress-label"}),m=_.div({class:"cms-progress-note"}),g=_.div({class:"cms-progress-value"});L.append(f,m),ue.append(L,g);const F=_.div({class:"cms-progress-body"}),X=_.span({class:"cms-progress-edge-label cms-progress-edge-label-left"}),a=_.div({class:"cms-progress",role:"progressbar"}),S=_.span({class:"cms-progress-buffer"}),h=_.span({class:ae(["cms-progress-bar","cms-singularity",C,fe(e.outline,"cms-outline"),fe(e.flat,"cms-flat"),fe(e.border,"cms-border"),fe(e.glossy,"cms-glossy"),fe(e.glow,"cms-glow"),fe(e.glass,"cms-glass"),fe(e.shadow,"cms-shadow"),qe(e.shadow,()=>{const ee=Dn(l(e.shadow));return ee?`cms-shadow-${ee}`:""}),fe(e.gradient,"cms-gradient"),fe(e.textGradient,"cms-text-gradient"),fe(e.lightShadow,"cms-light-shadow"),fe(e.striped,"is-striped"),fe(e.animated||e.indeterminate,"is-animated")])}),J=_.span({class:"cms-progress-bar-label"});h.appendChild(J),a.append(S,h);const j=_.span({class:"cms-progress-edge-label cms-progress-edge-label-right"});F.append(X,a,j);const U=_.div(M,ue,F);Ke(h,e);const ce=()=>{const ee=le(),xe=P(ee)*100,be={value:ee,percent:xe,min:i(),max:y(),buffer:re(),progress:U,track:a,bar:h,props:e},Ce=E(s,"icon",be,null),pe=Ce.length?[]:Y(e.icon,"icon",be),Ie=E(s,"label",be,W(e.label)),_e=Ie.length?Ie:E(s,"default",be,n),z=E(s,"iconRight",be,null),we=z.length?[]:Y(e.iconRight,"iconRight",be),T=E(s,"note",be,W(e.note)),x=e.valueLabel!=null?W(e.valueLabel):G(ee,xe,be),w=l(e.showValue),c=w===!0||e.valueLabel!=null||JSswift.ui.getSlot(s,"value")!=null?E(s,"value",be,x):[];D(f,[...pe,...Ce,..._e,...we,...z],"inline-flex"),D(m,T,"block"),D(g,w==="inside"?[]:c,"inline-flex"),ue.style.display=f.childNodes.length||m.childNodes.length||g.childNodes.length?"flex":"none"},k=()=>{var Ie,_e;const ee=le(),xe=P(ee)*100,be={value:ee,percent:xe,min:i(),max:y(),buffer:re(),progress:U,track:a,bar:h,props:e},Ce=W((Ie=e.startLabel)!=null?Ie:e.leftLabel),pe=W((_e=e.endLabel)!=null?_e:e.rightLabel);D(X,E(s,"startLabel",be,Ce),"inline-flex"),D(j,E(s,"endLabel",be,pe),"inline-flex")},d=()=>{const ee=le(),xe=P(ee)*100,be={value:ee,percent:xe,min:i(),max:y(),buffer:re(),progress:U,track:a,bar:h,props:e},Ce=l(e.showValue),pe=e.insideLabel!=null?W(e.insideLabel):G(ee,xe,be),Ie=Ce==="inside"||e.insideLabel!=null||JSswift.ui.getSlot(s,"inside")!=null?E(s,"inside",be,pe):[];D(J,Ie,"inline-flex")},N=()=>{const ee=le(),xe=re(),be=i(),Ce=y(),pe=P(ee)*100,Ie=P(xe)*100,_e=v(e.color,""),z=v(e.trackColor,_e?`color-mix(in srgb, ${_e} 14%, transparent)`:"rgba(255,255,255,0.08)"),we=v(e.bufferColor,_e?`color-mix(in srgb, ${_e} 30%, transparent)`:"rgba(255,255,255,0.16)"),T=l(e.ariaLabel),x=l(e.ariaValueText),w=!!l(e.indeterminate),c=l(e.radius);U.style.width=l(e.width)||"100%",U.style.setProperty("--cms-progress-height",R()),c!=null?typeof c=="number"?U.style.setProperty("--cms-progress-radius",`${c}px`):typeof c=="string"&&JSswift.uiSizes.includes(c)?U.style.setProperty("--cms-progress-radius",`var(--cms-r-${c})`):U.style.setProperty("--cms-progress-radius",String(c)):U.style.removeProperty("--cms-progress-radius"),a.style.background=z,S.style.background=we,S.style.width=`${Ie}%`,_e&&!mt(l(e.state)||l(e.color))?(h.style.setProperty("--set-background-color",_e),h.style.setProperty("--set-border-color",_e),h.style.setProperty("--set-color",l(e.textColor)||"var(--cms-on-primary, #fff)")):mt(l(e.state)||l(e.color))?(h.style.removeProperty("--set-background-color"),h.style.removeProperty("--set-border-color"),h.style.removeProperty("--set-color")):(h.style.setProperty("--set-background-color","var(--cms-primary)"),h.style.setProperty("--set-border-color","var(--cms-primary)"),h.style.setProperty("--set-color",l(e.textColor)||"var(--cms-on-primary, #fff)")),w?(h.style.width="",a.removeAttribute("aria-valuenow"),a.removeAttribute("aria-valuemin"),a.removeAttribute("aria-valuemax")):(h.style.width=`${pe}%`,a.setAttribute("aria-valuemin",String(be)),a.setAttribute("aria-valuemax",String(Ce)),a.setAttribute("aria-valuenow",String(ee))),T!=null?a.setAttribute("aria-label",String(T)):typeof l(e.label)=="string"?a.setAttribute("aria-label",String(l(e.label))):a.removeAttribute("aria-label"),x!=null?a.setAttribute("aria-valuetext",String(x)):w?a.removeAttribute("aria-valuetext"):a.setAttribute("aria-valuetext",G(ee,pe,{value:ee,percent:pe,min:be,max:Ce,buffer:xe,progress:U,track:a,bar:h,props:e})),U.classList.toggle("has-start-label",X.childNodes.length>0),U.classList.toggle("has-end-label",j.childNodes.length>0),U.classList.toggle("has-inside-label",J.childNodes.length>0)};return r?(se(r.get(),{fromModel:!0}),r.watch(ee=>{se(ee,{fromModel:!0})},"UI.Progress:watch")):at(e.value)?JSswift.reactive.effect(()=>{se(l(e.value),{fromModel:!0})},"UI.Progress:value"):se((O=(V=e.value)!=null?V:e.min)!=null?O:0,{fromModel:!0}),at(e.buffer)?JSswift.reactive.effect(()=>{te(l(e.buffer))},"UI.Progress:buffer"):te((Ne=(ke=(K=e.buffer)!=null?K:e.value)!=null?ke:e.min)!=null?Ne:0),JSswift.reactive.effect(()=>{ce(),k(),d(),N()},"UI.Progress:render"),U._track=a,U._bar=h,U._buffer=S,U._getValue=le,U._getBuffer=re,U._setValue=ee=>se(ee),U._setBuffer=ee=>te(ee),U},he.LoadingBar=function(...e){var d,N;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),o=(I,H)=>{const ge=Number(I);return Number.isFinite(ge)?ge:H},r=()=>o(l(n.min),0),C=()=>{const I=r(),H=o(l(n.max),100);return H<I?I:H},u=I=>{const H=r(),ge=C(),Se=o(I,H);return Math.min(ge,Math.max(H,Se))},i=(I,H="")=>I==null||I===!1||I===""?H:typeof I=="number"?`${I}px`:String(I),y=I=>{const H=l(I);return!H||H===document?document.body:typeof H=="string"?document.querySelector(H)||document.body:H&&H.body instanceof HTMLElement?H.body:H instanceof HTMLElement?H:document.body},R=n.model||(At(n.value)||Jt(n.value)?n.value:null),v=Nt(R,"UI.LoadingBar:model"),b=At(n.buffer)||Jt(n.buffer)?n.buffer:null,P=Nt(b,"UI.LoadingBar:buffer"),Z=v?v.get():(d=l(n.value))!=null?d:r(),G=P?P.get():(N=l(n.buffer))!=null?N:Z,[ie,D]=JSswift.reactive.signal(u(Z)),[$,Y]=JSswift.reactive.signal(Math.max(u(G),u(Z))),[W,le]=JSswift.reactive.signal(n.visible!=null?!!l(n.visible):u(Z)>r()||!!l(n.indeterminate));let me=null,re=null;const oe=()=>{me&&(clearInterval(me),me=null)},se=()=>{re&&(clearTimeout(re),re=null)},te=(I,H={})=>{const ge=!!I;return W()!==ge&&le(ge),H.fromExternal!==!0&&typeof n.onVisibleChange=="function"&&n.onVisibleChange(ge),ge},M=(I,H={})=>{const ge=u(I);return ie()!==ge&&D(ge),$()<ge&&(Y(ge),P&&H.fromExternal!==!0&&P.set(ge)),v&&H.fromExternal!==!0&&v.set(ge),ge},Q=(I,H={})=>{const ge=Math.max(M(ie(),{fromExternal:!0}),u(I));return $()!==ge&&Y(ge),P&&H.fromExternal!==!0&&P.set(ge),ge},q=(I=ie())=>{n.visible==null&&(l(n.indeterminate)||I>r()?te(!0):l(n.hideOnZero)!==!1&&te(!1))},ue=()=>{if(oe(),l(n.trickle)===!1||l(n.indeterminate))return;const I=o(l(n.trickleInterval),280);I<=0||(me=setInterval(()=>{var ye,V;const H=ie(),ge=u((V=(ye=l(n.trickleTo))!=null?ye:l(n.trickleMax))!=null?V:92);if(H>=ge)return;const Se=o(l(n.trickleStep),H<45?12:H<75?7:3);M(Math.min(ge,H+Se))},I))},L=JSswift.omit(n,["model","value","min","max","buffer","class","style","slots","label","note","showValue","valueLabel","insideLabel","formatValue","icon","iconRight","iconSize","startLabel","endLabel","leftLabel","rightLabel","trackColor","bufferColor","height","thickness","size","state","color","reverse","striped","animated","indeterminate","ariaLabel","ariaValueText","width","dense","outline","flat","border","glossy","glow","glass","shadow","gradient","textGradient","lightShadow","radius","rounded","textColor","target","mount","position","top","right","bottom","left","inset","zIndex","visible","autoStart","hideOnZero","startValue","step","trickle","trickleStep","trickleInterval","trickleMax","trickleTo","doneValue","doneDelay","hideDelay","resetValue","progressClass","progressStyle","onVisibleChange"]);L.class=ae(["cms-loading-bar",n.class]),L.style={...n.style||{}};const f=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"]);f.class=ae(["cms-loading-bar-progress",n.progressClass,f.class]),f.style={...n.progressStyle||{}},f.value=[ie,D],f.buffer=[$,Y],f.dense==null&&(f.dense=!0),f.height==null&&f.thickness==null&&f.size==null&&(f.height=3),f.width==null&&(f.width="100%");const m=_.div(L),g=he.Progress(f,...s);m.appendChild(g);const F=I=>{se();const H=M(I);return q(H),m},X=I=>{se();const H=Q(I);return q(H),m},a=(I=(H=>(H=l(n.step))!=null?H:8)())=>{se();const ge=ie(),Se=M(ge+o(I,0));return q(Se),m},S=(I=(H=>(H=l(n.startValue))!=null?H:12)())=>{se();const ge=Math.max(ie(),u(I));return M(ge),Q(Math.max($(),ge)),q(ge),ue(),m},h=(I=(H=>(H=l(n.resetValue))!=null?H:r())())=>{se(),oe();const ge=u(I);return Q(ge),M(ge),q(ge),m},J=(I=(H=>(H=l(n.doneValue))!=null?H:C())())=>{var ye;se(),oe();const ge=u(I);Q(ge),M(ge),q(ge);const Se=Math.max(0,o((ye=l(n.hideDelay))!=null?ye:l(n.doneDelay),220));return re=setTimeout(()=>{h()},Se),m},j=(...I)=>J(...I),U=()=>(te(!0),m),ce=()=>(se(),oe(),te(!1),m),k=()=>(se(),oe(),m.remove(),null);return m.el=m,m._progress=g,m.get=()=>ie(),m.getBuffer=()=>$(),m.set=F,m.setBuffer=X,m.inc=a,m.start=S,m.done=J,m.complete=J,m.stop=j,m.reset=h,m.show=U,m.hide=ce,m.destroy=k,m._dispose=k,v?v.watch(I=>{M(I,{fromExternal:!0}),q(u(I))},"UI.LoadingBar:watch"):at(n.value)&&JSswift.reactive.effect(()=>{const I=u(l(n.value));M(I,{fromExternal:!0}),q(I)},"UI.LoadingBar:value"),P?P.watch(I=>{Q(I,{fromExternal:!0})},"UI.LoadingBar:bufferWatch"):at(n.buffer)&&JSswift.reactive.effect(()=>{Q(l(n.buffer),{fromExternal:!0})},"UI.LoadingBar:buffer"),JSswift.reactive.effect(()=>{const I=r(),H=C(),ge=Math.min(H,Math.max(I,ie())),Se=Math.max(ge,Math.min(H,Math.max(I,$())));ge!==ie()&&D(ge),Se!==$()&&Y(Se)},"UI.LoadingBar:range"),JSswift.reactive.effect(()=>{n.visible!=null&&te(l(n.visible),{fromExternal:!0})},"UI.LoadingBar:visible"),JSswift.reactive.effect(()=>{var Ne;const I=l(n.position)||"fixed",H=l(n.inset),ge=l(n.top),Se=l(n.right),ye=l(n.bottom),V=l(n.left),O=l(n.width),K=n.visible!=null?!!l(n.visible):W(),ke=I==="static"||I==="relative";m.classList.toggle("is-visible",K),m.classList.toggle("is-inline",ke),m.classList.toggle("has-track",!!l(n.trackColor)),m.style.position=I,m.style.zIndex=String((Ne=l(n.zIndex))!=null?Ne:10002),m.style.width=i(O,ke?"100%":""),H!=null&&H!==""?(m.style.inset=i(H),m.style.removeProperty("top"),m.style.removeProperty("right"),m.style.removeProperty("bottom"),m.style.removeProperty("left")):(m.style.removeProperty("inset"),!ke&&I!=="sticky"?(m.style.top=i(ge,"0px"),m.style.right=i(Se,O==null||O===""?"0px":""),m.style.bottom=i(ye,""),m.style.left=i(V,"0px")):(m.style.top=i(ge,""),m.style.right=i(Se,""),m.style.bottom=i(ye,""),m.style.left=i(V,"")))},"UI.LoadingBar:layout"),Ke(m,n),l(n.mount)!==!1&&y(n.target).appendChild(m),l(n.autoStart)&&S(),m};const ul=new Set(["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"]),Oo=new Set(["soft","solid","outline"]),Do={success:"Success",warning:"Warning",danger:"Error",info:"Info",primary:"Notice",secondary:"Notice",light:"Notice",dark:"Notice"},$o={success:"check_circle",warning:"warning",danger:"error",info:"info",primary:"bolt",secondary:"notifications",light:"notifications",dark:"shield"},dl=t=>{const e=String(l(t)||"").trim().toLowerCase();return e?ul.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"},Vo=t=>{const e=String(l(t)||"").trim().toLowerCase();return Oo.has(e)?e:"soft"},Bo=(t,e)=>{const n=l(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},Gt=(t={},e="")=>{var u,i,y,R,v,b,P,Z,G,ie,D,$,Y,W;const n=ln(t)?{...t}:{message:t},s=mt(l(e)||l(n.type)||l(n.state)||l(n.color)||"info")||"info",o=Bo((i=(u=n.timeout)!=null?u:n.duration)!=null?i:n.delay,s),r=(v=(R=(y=n.closable)!=null?y:n.dismissible)!=null?R:n.dismiss!=null)!=null?v:o===0,C=n.title===void 0?n.label===void 0?Do[s]:n.label:n.title;return{...n,type:s,state:s,title:C,message:(Z=(P=(b=n.message)!=null?b:n.content)!=null?P:n.text)!=null?Z:null,description:(D=(ie=(G=n.description)!=null?G:n.subtitle)!=null?ie:n.note)!=null?D:null,meta:(Y=($=n.meta)!=null?$:n.caption)!=null?Y:null,body:(W=n.body)!=null?W:null,timeout:o,closable:!!r,dismissLabel:n.dismissLabel||n.closeLabel||"Chiudi notifica",position:dl(n.position),variant:Vo(n.variant),slots:n.slots||{},role:n.role||(s==="danger"||s==="warning"?"alert":"status")}},fl=(t,e="",n="")=>{if(!t.length)return Gt(n?{type:e,title:n}:{type:e});if(ln(t[0])){const{props:u,children:i}=JSswift.uiNormalizeArgs(t),y={...u};return!y.type&&!y.state&&!y.color&&e&&(y.type=e),y.title==null&&n&&(y.title=n),i.length&&(y.message==null&&y.description==null&&y.body==null&&i.length===1?y.message=i[0]:y.body==null&&(y.body=i.length===1?i[0]:i)),Gt(y,e)}const[s,o,r]=t;let C={};return ln(o)?C={...o,message:s}:ln(r)?C={...r,message:s,title:o}:C={message:s,title:o},e&&!C.type&&!C.state&&!C.color&&(C.type=e),C.title==null&&n&&(C.title=n),Gt(C,e)},Rt=(t,e)=>(...n)=>{var s,o;return(o=(s=He.services.notify)==null?void 0:s.show)==null?void 0:o.call(s,fl(n,t,e))},Un=(t,e,n)=>{if(t===!1)return!1;if(typeof t=="function"){const s=t();return Un(s,e,n)}return ln(t)?t:t!=null?{message:t,title:n}:{message:e,title:n}};he.Notify=(...t)=>{var e,n;return(n=(e=He.services.notify)==null?void 0:e.show)==null?void 0:n.call(e,fl(t))},he.Notify.show=he.Notify,he.Notify.success=Rt("success","Success"),he.Notify.error=Rt("danger","Error"),he.Notify.warning=Rt("warning","Warning"),he.Notify.info=Rt("info","Info"),he.Notify.primary=Rt("primary","Notice"),he.Notify.secondary=Rt("secondary","Notice"),he.Notify.remove=t=>{var e,n;return(n=(e=He.services.notify)==null?void 0:e.remove)==null?void 0:n.call(e,t)},he.Notify.clear=()=>{var t,e;return(e=(t=He.services.notify)==null?void 0:t.clear)==null?void 0:e.call(t)},he.Notify.update=(t,e={})=>{var n,s;return(s=(n=He.services.notify)==null?void 0:n.update)==null?void 0:s.call(n,t,e)},he.Notify.promise=async(t,e={})=>{var o,r,C,u,i,y,R,v,b,P,Z,G,ie,D;const n=e.loading===!1?!1:Un(typeof e.loading=="function"?()=>e.loading():e.loading,"Operazione in corso...","In corso"),s=n===!1?null:(r=(o=He.services.notify)==null?void 0:o.show)==null?void 0:r.call(o,Gt({type:"info",timeout:0,closable:!1,...n},"info"));try{const Y=await(typeof t=="function"?t():t),W=Un(typeof e.success=="function"?()=>e.success(Y):e.success,"Operazione completata con successo.","Completato");return W!==!1?s!=null?(u=(C=He.services.notify)==null?void 0:C.update)==null||u.call(C,s,Gt(W,"success")):(y=(i=He.services.notify)==null?void 0:i.show)==null||y.call(i,Gt(W,"success")):s!=null&&((v=(R=He.services.notify)==null?void 0:R.remove)==null||v.call(R,s)),Y}catch($){const Y=Un(typeof e.error=="function"?()=>e.error($):e.error,($==null?void 0:$.message)||"Operazione fallita.","Errore");throw Y!==!1?s!=null?(P=(b=He.services.notify)==null?void 0:b.update)==null||P.call(b,s,Gt(Y,"danger")):(G=(Z=He.services.notify)==null?void 0:Z.show)==null||G.call(Z,Gt(Y,"danger")):s!=null&&((D=(ie=He.services.notify)==null?void 0:ie.remove)==null||D.call(ie,s)),$}},he.Header=(...t)=>{var S,h,J,j,U,ce,k;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e};Yt(o);const r=d=>Object.prototype.hasOwnProperty.call(e,d),C=(S=e.drawerStateKey)!=null?S:qt;C&&(qt=C,Et=en(C));const u=()=>en(C),i=()=>Wt(!0,C),y=()=>Wt(!1,C),R=()=>Wt(!u(),C),v={props:e,stateKey:C,isDrawerOpen:u,openDrawer:i,closeDrawer:y,toggleDrawer:R,toggleAside:R},b=(d,N)=>{if(!(N==null||N===!1)){if(Array.isArray(N)){N.forEach(I=>b(d,I));return}if(N!=null&&N.nodeType){d.appendChild(N);return}d.appendChild(document.createTextNode(String(N)))}},P=(d,N,I=H=>H)=>{const H=JSswift.ui.getSlot(s,d);if(H!=null)return E(s,d,v,null);if(typeof N=="function"){const ge=new Set(["eyebrow","title","subtitle"]),Se=_[ge.has(d)?"span":"div"]({class:`cms-header-slot-${d}`});return JSswift.reactive.effect(()=>{const ye=I(N(v)),V=on(JSswift.ui.slot(ye));Se.replaceChildren(),Array.isArray(V)?V.forEach(O=>b(Se,O)):b(Se,V)},`UI.Header:${d}`),[Se]}return E(s,d,v,I(N))},Z=(d,N="icon",I=e.iconSize||e.size||"md")=>d==null||d===!1?null:typeof d=="string"?he.Icon({name:d,size:I}):JSswift.ui.slot(d,{as:N}),G=d=>{var I,H;const N=d?(I=e.drawerOpenIcon)!=null?I:"\u2715":(H=e.drawerCloseIcon)!=null?H:"\u2630";return N==null||N===!1?null:typeof N=="string"?N:JSswift.ui.slot(N,{as:d?"drawerOpenIcon":"drawerCloseIcon"})},ie=_.span({class:"cms-header-toggle-icon"}),D=d=>{const N=E(null,"default",v,G(d));ie.replaceChildren(...N.length?N:[""])};D(u());const $=he.Btn({class:"cms-header-toggle",outline:!0,size:(J=(h=e.toggleSize)!=null?h:e.size)!=null?J:"sm",onClick:R,"aria-label":e.toggleLabel||"Toggle navigation"},ie);e.left==null&&e.left!==!1&&!JSswift.ui.getSlot(s,"left")&&ol.add({update:D});const Y=e.left===!1?null:e.left!=null?e.left:$,W=r("title")?e.title:(j=e.label)!=null?j:"App",le=(ce=(U=e.subtitle)!=null?U:e.description)!=null?ce:"",me=r("right")?e.right:e.end,re=r("content")?e.content:r("body")?e.body:n!=null&&n.length?n:null,oe=[...P("left",Y),...P("start",null)],se=P("icon",e.icon,Z),te=P("eyebrow",(k=e.eyebrow)!=null?k:e.kicker),M=P("title",W),Q=P("subtitle",le),q=P("meta",e.meta),ue=(()=>{const d=P("content",null);return d.length?d:P("default",re)})(),L=[...P("center",null),...P("body",null)],f=[...P("right",me),...P("end",null)],m=P("actions",e.actions),g=_.div({class:ae(["cms-header-body",e.bodyClass,e.centerClass])},_.div({class:"cms-header-heading"},se.length?_.div({class:"cms-header-icon"},...se):null,_.div({class:"cms-header-copy"},te.length?_.div({class:ae(["cms-header-eyebrow",e.eyebrowClass])},...te):null,M.length?_.div({class:ae(["cms-header-title",e.titleClass])},...M):null,Q.length?_.div({class:ae(["cms-header-subtitle",e.subtitleClass])},...Q):null,ue.length?_.div({class:ae(["cms-header-content",e.contentClass])},...ue):null),q.length?_.div({class:ae(["cms-header-meta",e.metaClass])},...q):null)),F=[...f,...m.length?[_.div({class:ae(["cms-header-actions",e.actionsClass])},...m)]:[]],X=JSswift.omit(o,["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=ae(["cms-panel","cms-header","cms-singularity",fe(e.sticky!==!1,"sticky"),fe(e.stack,"stack"),fe(e.elevated,"elevated"),fe(e.divider!==!1,"divider"),o.class]),X.style={...o.style||{}},e.gap!=null&&(X.style["--cms-header-gap"]=Be(l(e.gap))),e.minHeight!=null&&(X.style.minHeight=Be(l(e.minHeight)));const a=_.div(X,...oe.length?[_.div({class:ae(["cms-header-start",e.startClass])},...oe)]:[],_.div({class:"cms-header-main"},...L.length?[_.div({class:ae(["cms-header-body",e.bodyClass,e.centerClass])},...L)]:[g],...F.length?[_.div({class:ae(["cms-header-end",e.endClass])},...F)]:[]));return Ke(a,e),a},he.Drawer=(...t)=>{var be,Ce,pe,Ie,_e,z,we,T,x,w;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e},r=c=>Object.prototype.hasOwnProperty.call(e,c),C=(be=e.stateKey)!=null?be:qt;C&&(qt=C,Et=en(C));const u=()=>en(C),i=()=>Wt(!0,C),y=()=>Wt(!1,C),R=()=>Wt(!u(),C),v={props:e,stateKey:C,isDrawerOpen:u,openDrawer:i,closeDrawer:y,toggleDrawer:R,toggleAside:R},b=JSswift==null?void 0:JSswift.store,P=!!(b!=null&&b.get&&(b!=null&&b.set)),Z=`${C}:groups`,G=`${C}:active`;let ie=P?b.get(Z,{})||{}:{},D=P&&(Ce=b.get(G,null))!=null?Ce:null;const $=new Map,Y=new Map,W=c=>{const A=l(c);return A==null||A===!1?[]:Array.isArray(A)?A.flat(1/0):[A]},le=(c,A,de=v)=>{const Le=Array.isArray(c)?c:[c];for(const Je of Le)if(JSswift.ui.getSlot(s,Je)!=null)return E(s,Je,de,A);return A==null?[]:E(null,"default",de,l(A))},me=c=>(Array.isArray(c)?c:[c]).some(de=>JSswift.ui.getSlot(s,de)!=null),re=c=>{if(typeof l(c.external)=="boolean")return!!l(c.external);const A=l(c.href||c.to||c.link||"");return/^(https?:)?\/\//.test(A)},oe=(pe=e.closeOnSelect)!=null?pe:!0,se=c=>!!oe&&l(c.keepOpen)!==!0,te=(_e=(Ie=e.itemIconSize)!=null?Ie:e.size)!=null?_e:"md",M=(z=e.groupOpenIcon)!=null?z:"arrow_drop_up",Q=(we=e.groupCloseIcon)!=null?we:"arrow_drop_down",q=c=>!!c&&D===c,ue=c=>!!c&&!!D&&(D===c||D.startsWith(`${c}::`)),L=()=>{$.forEach(({el:c,baseActive:A},de)=>{const Le=!!A||q(de);c.classList.toggle("active",Le),Le?c.setAttribute("aria-current","page"):c.removeAttribute("aria-current")}),Y.forEach(({wrap:c,toggle:A,baseActive:de},Le)=>{const Je=!!de||ue(Le);c.classList.toggle("active",Je),A.classList.toggle("active",Je)})},f=c=>{D=c||null,P&&b.set(G,D),L()},m=(c,A)=>{if(l(c.active)!=null)return!!l(c.active);if(l(c.current)!=null)return!!l(c.current);if(!A||re(c))return!1;try{if(A.startsWith("#"))return window.location.hash===A;const de=`${window.location.pathname}${window.location.search}${window.location.hash}`;return A===de||A===window.location.pathname}catch(de){return!1}},g=(c,A,de)=>m(c,A)||q(de),F=(c=[],A=0,de=[])=>W(c).some((Le,Je)=>{var Ye,Ze,Qe,Te,je;const B=l(Le);if(!B||typeof B!="object"||B.nodeType)return!1;const Ae=l(B.href||B.to||B.link||""),Me=(je=l((Te=(Qe=(Ze=(Ye=B.label)!=null?Ye:B.title)!=null?Ze:B.text)!=null?Qe:Ae)!=null?Te:null))!=null?je:`item-${A}-${Je}`,Ee=h(B,Me,A,Je),De=de.concat(Ee).join("::");if(g(B,Ae,De))return!0;const Ue=B.items||B.children||B.sub;return F(Ue,A+1,de.concat(Ee))}),X=(c,A={})=>{var Je;const de=l(c);if(de==null||de===!1)return[];const Le=typeof de=="string"?he.Icon({name:de,size:(Je=A.iconSize)!=null?Je:te}):JSswift.ui.slot(de,{...A,as:"icon"});return E(null,"default",A,Le)},a=(c,A,de={})=>{const Le=X(c,de);return Le.length?[_.span({class:ae(["cms-drawer-item-icon",A])},...Le)]:[]},S=c=>{const A=l(c.iconPosition)||"left",de=Object.prototype.hasOwnProperty.call(c,"iconLeft")?c.iconLeft:A!=="right"?c.icon:null,Le=Object.prototype.hasOwnProperty.call(c,"iconRight")?c.iconRight:A==="right"?c.icon:null;return{left:de,right:Le}},h=(c,A,de,Le)=>l(c.key||c.id||c.to||c.href||A||`item-${de}-${Le}`),J=(c,A)=>P&&Object.prototype.hasOwnProperty.call(ie,c)?!!ie[c]:A,j=(c,A)=>{P&&(ie={...ie,[c]:!!A},b.set(Z,ie))},U=()=>{const c={...v,area:"header"},A=le(["headerIcon","icon"],e.icon,c),de=le(["eyebrow"],e.eyebrow,c),Le=le(["title"],e.title,c),Je=le(["subtitle"],e.subtitle,c),B=le(["meta"],e.meta,c),Ae=le(["content"],e.content,c),Me=le(["actions"],e.actions,c),Ee=r("header")?E(null,"default",c,l(e.header)):[],De=A.length||de.length||Le.length||Je.length||B.length||Ae.length||Me.length;return!De&&!Ee.length?[]:De?[_.div({class:ae(["cms-drawer-header",e.headerClass])},...A.length?[_.div({class:"cms-drawer-header-icon"},...A)]:[],_.div({class:"cms-drawer-header-body"},...de.length?[_.div({class:"cms-drawer-header-eyebrow"},...de)]:[],...Le.length?[_.div({class:"cms-drawer-header-title"},...Le)]:[],...Je.length?[_.div({class:"cms-drawer-header-subtitle"},...Je)]:[],...B.length?[_.div({class:"cms-drawer-header-meta"},...B)]:[],...Ae.length?[_.div({class:"cms-drawer-header-content"},...Ae)]:[],...Ee.length?[_.div({class:"cms-drawer-header-extra"},...Ee)]:[]),...Me.length?[_.div({class:"cms-drawer-header-actions"},...Me)]:[])]:Ee},ce=(c,A,de)=>{var B,Ae;return!(((B=c.onClick)==null?void 0:B.call(c,de,A))===!1||de!=null&&de.defaultPrevented||((Ae=e.onSelect)==null?void 0:Ae.call(e,c,A,de))===!1||de!=null&&de.defaultPrevented)},k=(c,A,de={})=>{const Le=A.hasChildren?"group":"item",Je=E(s,`${Le}Label`,A,A.label),B=E(s,`${Le}Note`,A,A.note),Ae=E(s,`${Le}Badge`,A,A.badge),Me=E(s,`${Le}Aside`,A,A.aside),Ee=E(s,`${Le}Content`,A,A.content),De=[];return(Je.length||B.length||Ae.length||Me.length)&&De.push(_.div({class:"cms-drawer-item-top"},_.div({class:"cms-drawer-item-copy"},...Je.length?[_.div({class:"cms-drawer-item-label"},...Je)]:[],...B.length?[_.div({class:"cms-drawer-item-note"},...B)]:[]),...Ae.length||Me.length?[_.div({class:"cms-drawer-item-meta"},...Ae.length?[_.div({class:"cms-drawer-item-badge"},...Ae)]:[],...Me.length?[_.div({class:"cms-drawer-item-aside"},...Me)]:[])]:[])),Ee.length&&De.push(_.div({class:"cms-drawer-item-content"},...Ee)),[...de.start||[],...a(A.iconLeft,"left",A),...De.length?[_.div({class:"cms-drawer-item-main"},...De)]:[],...a(A.iconRight,"right",A),...de.end||[]]},d=(c=[],A=0,de=[])=>W(c).map((Le,Je)=>{var nn,Pe,Ve,et,ct,gt,ht,Ct,yt,p,ne;const B=l(Le);if(B==null||B===!1)return null;if(B.nodeType||typeof B!="object"||Array.isArray(B))return _.div({class:"cms-drawer-custom","data-level":String(A)},...E(null,"default",{...v,item:B,level:A,index:Je,path:de},B));if(l(B.hidden)===!0||l(B.visible)===!1)return null;const Ae=W(B.items||B.children||B.sub),Me=l(B.href||B.to||B.link||null),Ee=l((et=(Ve=(Pe=(nn=B.label)!=null?nn:B.title)!=null?Pe:B.text)!=null?Ve:Me)!=null?et:null),De=Ee!=null?Ee:`item-${A}-${Je}`,Ue=l((ht=(gt=(ct=B.note)!=null?ct:B.subtitle)!=null?gt:B.description)!=null?ht:null),Ye=l((Ct=B.badge)!=null?Ct:null),Ze=l((p=(yt=B.aside)!=null?yt:B.meta)!=null?p:null),Qe=l((ne=B.content)!=null?ne:null),Te=h(B,De,A,Je),je=de.concat(Te).join("::"),{left:tt,right:nt}=S(B),ut=mt(l(B.state)||l(B.color)||""),dt=m(B,Me),bt=dt||q(je),lt=!!l(B.disabled),ft={...v,item:B,index:Je,level:A,path:de,label:De,note:Ue,badge:Ye,aside:Ze,content:Qe,itemStateKey:je,iconLeft:tt,iconRight:nt,iconSize:l(B.iconSize)||te,active:bt,disabled:lt,hasChildren:!1},vt=l(B.divider)===!0||B.type==="divider"||B.type==="separator",_t=l(B.section)===!0||B.type==="section"||B.type==="heading"||B.type==="label",rt=B.type==="content"||B.type==="custom"||!Me&&!Ae.length&&!l(B.button)&&B.type!=="button"&&Ee==null&&Qe!=null;if(vt)return _.div({class:ae(["cms-drawer-separator",B.class]),"data-level":String(A)});if(_t){const ve=E(s,"sectionLabel",ft,De||Qe);return _.div({class:ae(["cms-drawer-section-label",B.class]),"data-level":String(A)},...ve)}if(rt){const ve=E(s,"item",ft,Qe!=null?Qe:De);return _.div({class:ae(["cms-drawer-custom",ut?`cms-drawer-tone-${ut}`:"",B.class]),style:B.style,"data-level":String(A)},...ve)}if(Ae.length){const ve=dt||F(Ae,A+1,de.concat(Te)),Re=ve||ue(je);let Fe=J(je,!!l(B.expanded)||!!l(B.open)||Re);const Oe=_.span({class:"cms-drawer-group-icon"}),$e={...ft,active:Re,hasChildren:!0,isOpen:()=>Fe,setOpen:Lt=>zt(Lt),toggle:()=>zt(!Fe)},Xe=()=>{var dn,fn;const Lt=Fe?(dn=B.openIcon)!=null?dn:M:(fn=B.closeIcon)!=null?fn:Q,sn=l(Fe?B.iconSidePosition||B.openIconSide||B.openIconPosition||"right":B.iconSidePosition||B.closeIconSide||B.closeIconPosition||"right")==="left"?"left":"right";Oe.innerHTML="",Oe.className=`cms-drawer-group-icon ${sn}`,X(Lt,{...$e,as:"toggleIcon"}).forEach(vn=>Oe.appendChild(vn))},ot=_.button({type:"button",class:ae(["cms-drawer-group-toggle","cms-drawer-entry",Fe?"open":"",Re?"active":"",lt?"is-disabled":"",ut?`cms-drawer-tone-${ut}`:"",B.class]),style:B.style,"data-level":String(A),"aria-expanded":String(Fe),"aria-disabled":lt?"true":null,onClick:Lt=>{if(lt){Lt.preventDefault();return}f(je),zt(!Fe)}},...k(B,$e,{start:l(B.iconSidePosition||B.openIconSide||B.closeIconSide||B.openIconPosition||B.closeIconPosition||"right")==="left"?[Oe]:[],end:l(B.iconSidePosition||B.openIconSide||B.closeIconSide||B.openIconPosition||B.closeIconPosition||"right")==="right"?[Oe]:[]})),pt=E(s,"group",$e,null),xt=_.div({class:"cms-drawer-group-items"},...d(Ae,A+1,de.concat(Te))),Bt=_.div({class:ae(["cms-drawer-group",Fe?"open":"",Re?"active":"",ut?`cms-drawer-tone-${ut}`:""]),"data-level":String(A)},...pt.length?pt:[ot],xt),zt=Lt=>{Fe=!!Lt,Bt.classList.toggle("open",Fe),ot.classList.toggle("open",Fe),ot.setAttribute("aria-expanded",String(Fe)),Xe(),j(je,Fe)};return Y.set(je,{wrap:Bt,toggle:ot,baseActive:ve}),Xe(),Bt}const Vt=E(s,"item",ft,null),Mt=l(B.button)===!0||B.type==="button"||!Me&&typeof B.onClick=="function",wt={class:ae(["cms-drawer-entry",Mt?"cms-drawer-btn":"cms-drawer-link",bt?"active":"",lt?"is-disabled":"",ut?`cms-drawer-tone-${ut}`:"",B.class]),style:B.style,"data-level":String(A),"aria-current":bt?"page":null,"aria-disabled":lt?"true":null},Kt=Vt.length?Vt:k(B,ft);if(Mt){const ve=_.button({...wt,type:B.buttonType||"button",disabled:lt,onClick:Re=>{if(lt){Re.preventDefault();return}ce(B,ft,Re)&&(f(je),se(B)&&y())}},...Kt);return $.set(je,{el:ve,baseActive:dt}),ve}const St=re(B),cn=St?l(B.target)||"_blank":l(B.target),un=St?l(B.rel)||"noopener noreferrer":l(B.rel),tn=_.a({...wt,href:Me||"#",target:cn||null,rel:un||null,tabIndex:lt?-1:null,onClick:ve=>{var Re;if(lt){ve.preventDefault();return}ce(B,ft,ve)&&(!St&&B.to&&((Re=He.router)!=null&&Re.navigate)&&(ve.preventDefault(),He.router.navigate(B.to)),se(B)&&y())}},...Kt);return $.set(je,{el:tn,baseActive:dt}),tn}).filter(Boolean),N=le(["before","beforeItems"],(T=e.before)!=null?T:e.beforeItems),I=me(["body"])?le(["body"],null):[],H=d(e.items||[]),ge=le(["default"],n),Se=le(["after","afterItems"],(x=e.after)!=null?x:e.afterItems),ye=I.length?I:[...N,...H,...ge,...Se],V=r("empty")||r("emptyText")?(w=e.empty)!=null?w:_.div({class:ae(["cms-drawer-empty",e.emptyClass])},e.emptyText||"Nessun contenuto"):_.div({class:ae(["cms-drawer-empty",e.emptyClass])},"Nessun contenuto"),O=le(["header"],U()),K=le(["footer"],e.footer),ke=ye.length?ye:le(["empty"],V),Ne=JSswift.omit(o,["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"]);Ne.class=ae(["cms-panel","cms-drawer",Et?"open":"",fe(e.sticky,"sticky"),o.class]),Ne.style={...o.style||{}},e.gap!=null&&(Ne.style["--cms-drawer-gap"]=Be(l(e.gap))),e.indent!=null&&(Ne.style["--cms-drawer-indent"]=Be(l(e.indent))),e.padding!=null&&(Ne.style["--cms-drawer-padding"]=Be(l(e.padding))),e.width!=null&&(Ne.style.width=Be(l(e.width))),e.minHeight!=null&&(Ne.style.minHeight=Be(l(e.minHeight))),e.maxHeight!=null&&(Ne.style.maxHeight=Be(l(e.maxHeight)));const ee=_.div(Ne,...O.length?O:[],_.div({class:ae(["cms-drawer-body",e.bodyClass])},...ke),...K.length?[_.div({class:ae(["cms-drawer-footer",e.footerClass])},...K)]:[]),xe=hs.get(C)||new Set;return xe.add(ee),hs.set(C,xe),Wt(Et,C),ee.isDrawerOpen=u,ee.openDrawer=i,ee.closeDrawer=y,ee.toggleDrawer=R,ee.setActiveItem=f,Ke(ee,e),L(),ee},he.Page=(...t)=>{var g,F,X,a;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o={...e},r=(S,h)=>{var J;return!!(S&&S.nodeType===1&&((J=S.classList)!=null&&J.contains(`cms-page-${h}`)))},C=S=>S==null?null:typeof S=="string"?he.Icon({name:S,size:e.iconSize||e.size||"xl"}):JSswift.ui.slot(S,{as:"icon"}),u={dense:!!l(e.dense),flat:!!l(e.flat),centered:!!l(e.centered),narrow:!!l(e.narrow)},i=(S,h)=>{if(!(h==null||h===!1)){if(Array.isArray(h)){h.forEach(J=>i(S,J));return}if(h!=null&&h.nodeType){S.appendChild(h);return}S.appendChild(document.createTextNode(String(h)))}},y=(S,h,J=j=>j)=>{const j=JSswift.ui.getSlot(s,S);if(j!=null)return E(s,S,u,null);if(typeof h=="function"){const U=new Set(["eyebrow","title","subtitle"]),ce=_[U.has(S)?"span":"div"]({class:`cms-page-slot-${S}`});return JSswift.reactive.effect(()=>{const k=J(h(u)),d=on(JSswift.ui.slot(k));ce.replaceChildren(),Array.isArray(d)?d.forEach(N=>i(ce,N)):i(ce,d)},`UI.Page:${S}`),[ce]}return E(s,S,u,J(h))},R=E(s,"default",u,n!=null&&n.length?n:[]),v={hero:[],header:[],body:[],footer:[],actions:[]},b=[];R.forEach(S=>{r(S,"hero")?v.hero.push(S):r(S,"header")?v.header.push(S):r(S,"body")?v.body.push(S):r(S,"footer")?v.footer.push(S):r(S,"actions")?v.actions.push(S):b.push(S)});const P=y("icon",e.icon,C),Z=y("hero",(g=e.hero)!=null?g:e.banner),G=y("eyebrow",(F=e.eyebrow)!=null?F:e.kicker),ie=y("title",e.title),D=y("subtitle",(X=e.subtitle)!=null?X:e.description),$=y("header",e.header),Y=y("aside",e.aside),W=y("body",(a=e.body)!=null?a:e.content),le=y("footer",e.footer),me=y("actions",e.actions),re=Z.length?_.div({class:ae(["cms-page-hero",e.heroClass])},...Z):null,oe=P.length||G.length||ie.length||D.length||$.length||Y.length,se=oe?_.div({class:ae(["cms-page-header",e.headerClass])},_.div({class:"cms-page-head"},P.length?_.div({class:ae(["cms-page-icon",e.iconClass])},...P):null,_.div({class:"cms-page-head-main"},G.length?_.div({class:ae(["cms-page-eyebrow",e.eyebrowClass])},...G):null,ie.length?_.div({class:ae(["cms-page-title",e.titleClass])},...ie):null,D.length?_.div({class:ae(["cms-page-subtitle",e.subtitleClass])},...D):null,$.length?_.div({class:ae(["cms-page-header-content",e.headerContentClass])},...$):null),Y.length?_.div({class:ae(["cms-page-aside",e.asideClass])},...Y):null)):null,te=[...W,...b],M=te.length?_.div({class:ae(["cms-page-body",e.bodyClass])},...te):null,Q=[...me,...v.actions],q=le.length||Q.length?_.div({class:ae(["cms-page-footer",e.footerClass])},...le,Q.length?_.div({class:"cms-page-actions"},...Q):null):null,ue=!!(Z.length||v.hero.length),L=!!(oe||v.header.length),f=JSswift.omit(o,["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"]);f.class=ae(["cms-panel","cms-page",fe(e.dense,"dense"),fe(e.flat,"cms-page-flat"),fe(e.centered,"cms-page-centered"),fe(e.narrow,"cms-page-narrow"),fe(ue,"cms-page-has-hero"),fe(L,"cms-page-has-header"),o.class]),f.style={...o.style||{}},(e.gap!=null||at(e.gap))&&(f.style["--cms-page-gap"]=ze(e.gap,Be)),(e.padding!=null||at(e.padding))&&(f.style["--cms-page-padding"]=ze(e.padding,Be)),(e.maxWidth!=null||at(e.maxWidth))&&(f.style["--cms-page-max-width"]=ze(e.maxWidth,Be)),(e.minHeight!=null||at(e.minHeight))&&(f.style["--cms-page-min-height"]=ze(e.minHeight,Be)),(e.headerGap!=null||at(e.headerGap))&&(f.style["--cms-page-header-gap"]=ze(e.headerGap,Be)),(e.heroPadding!=null||at(e.heroPadding))&&(f.style["--cms-page-hero-padding"]=ze(e.heroPadding,Be));const m=_.div(f,re,...v.hero,se,...v.header,M,...v.body,q,...v.footer);return Ke(m,e),m},he.AppShell=(...t)=>{var S,h;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=(J,j)=>!!J&&Object.prototype.hasOwnProperty.call(J,j),r=l(e.noDrawer)===!0||e.drawer===!1,C=l(e.reverse)===!0,u=l(e.stack)===!0,i=(h=(S=e.drawerStateKey)!=null?S:e.stateKey)!=null?h:qt;i&&(qt=i,Et=en(i));const y={props:e,noDrawer:r,stateKey:i,isDrawerOpen:()=>en(i),openDrawer:()=>Wt(!0,i),closeDrawer:()=>Wt(!1,i),toggleDrawer:()=>Wt(!en(i),i)},R=e.headerProps&&typeof e.headerProps=="object"?{...e.headerProps}:{};let v=e.header;!o(e,"header")&&(Object.keys(R).length||o(e,"title")||o(e,"subtitle")||o(e,"left")||o(e,"right"))&&(!o(R,"title")&&o(e,"title")&&(R.title=e.title),!o(R,"subtitle")&&o(e,"subtitle")&&(R.subtitle=e.subtitle),!o(R,"left")&&o(e,"left")&&(R.left=e.left),!o(R,"right")&&o(e,"right")&&(R.right=e.right),o(R,"drawerStateKey")||(R.drawerStateKey=i),r&&!o(R,"left")&&(R.left=!1),v=he.Header(R));const b=e.drawerProps&&typeof e.drawerProps=="object"?{...e.drawerProps}:{},P=o(e,"drawerItems")?e.drawerItems:e.items,Z=o(e,"drawerHeader")?e.drawerHeader:void 0;let G=e.drawer;!o(e,"drawer")&&!r&&(Object.keys(b).length||P!=null||Z!=null)&&(!o(b,"items")&&P!=null&&(b.items=P),!o(b,"header")&&Z!=null&&(b.header=Z),o(b,"stateKey")||(b.stateKey=i),G=he.Drawer(b));const ie=e.pageProps&&typeof e.pageProps=="object"?{...e.pageProps}:{},D=o(e,"content")?e.content:n,$=E(s,"default",y,D);let Y=e.page;!o(e,"page")&&(Object.keys(ie).length||$.length)&&(Y=he.Page(ie,...$));const W=e.footerProps&&typeof e.footerProps=="object"?{...e.footerProps}:{},le=o(e,"footerContent")?e.footerContent:void 0;let me=e.footer;!o(e,"footer")&&(Object.keys(W).length||le!=null)&&(me=he.Footer(W,...E(null,"default",y,le)));const re=E(s,"header",y,v),oe=r?[]:E(s,"drawer",y,G),se=E(s,"page",y,Y),te=E(s,"footer",y,me),M=ae(["cms-app","cms-app-shell",fe(r,"no-drawer"),fe(C,"is-reverse"),fe(u,"is-stack"),fe(e.flush,"is-flush"),fe(e.divider,"is-divider"),e.class]),Q=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"]);Q.class=M,Q.style={...e.style||{}};const q=ze(e.drawerWidth,Be);q!=null&&(Q.style["--cms-app-shell-drawer-width"]=q);const ue=ze(e.gap,Be);ue!=null&&(Q.style["--cms-app-shell-gap"]=ue);const L=ze(e.padding,Be);L!=null&&(Q.style["--cms-app-shell-padding"]=L);const f=re.length?_.div({class:"cms-app-shell-header-slot"},...re):null,m=oe.length?_.div({class:"cms-app-shell-drawer-slot"},...oe):null,g=se.length?_.div({class:"cms-app-shell-page-slot"},...se):null,F=te.length?_.div({class:"cms-app-shell-footer-slot"},...te):null,X=C?[g,m]:[m,g],a=_.div(Q,...f?[f]:[],_.div({class:"cms-app-shell-body"},...X.filter(Boolean)),...F?[F]:[]);return a.openDrawer=y.openDrawer,a.closeDrawer=y.closeDrawer,a.toggleDrawer=y.toggleDrawer,a.isDrawerOpen=y.isDrawerOpen,a.header=f,a.drawer=m,a.page=g,a.footer=F,Ke(a,e),a},he.Parallax=function(...e){var J,j;const{props:n,children:s}=JSswift.uiNormalizeArgs(e),o=n.slots||{},r={...n};r.color!=null&&r.textColor==null&&(r.textColor=r.color),delete r.color,Yt(r);const C=qe(n.state,()=>{const U=mt(l(n.state));return U?`cms-state-${U}`:""}),u=U=>{if(U==null||U===!1||U==="")return"";const ce=String(U);return Qt(ce)?`var(--cms-${ce})`:ce},i=()=>{const U=l(n.background);if(U)return String(U);const ce=l(n.image)||l(n.src)||"";if(!ce)return"linear-gradient(120deg, #1b2c5a, #2f6d8f, #2a8f5c)";const k=String(ce);return/^url\(/i.test(k)||/gradient\(/i.test(k)||/^var\(/i.test(k)?k:`url(${k})`},y=(U,ce)=>{const k=Number(l(U));return Number.isFinite(k)?k:ce},R={speed:()=>{var U;return(U=l(n.speed))!=null?U:.18},state:()=>l(n.state)||"",disabled:()=>!!l(n.disabled)},v=E(o,"badge",R,n.badge),b=E(o,"background",R,n.backgroundContent),P=E(o,"eyebrow",R,(J=n.eyebrow)!=null?J:n.kicker),Z=E(o,"title",R,n.title),G=E(o,"subtitle",R,n.subtitle),ie=E(o,"header",R,n.header),D=E(o,"aside",R,n.aside),$=E(o,"media",R,n.media),Y=E(o,"content",R,(j=n.content)!=null?j:n.body),W=E(o,"default",R,s!=null&&s.length?s:[]),le=E(o,"footer",R,n.footer),me=E(o,"actions",R,n.actions),re=[...Y,...W],oe=v.length?_.div({class:ae(["cms-parallax-badge",n.badgeClass])},...v):null,se=P.length||Z.length||G.length||ie.length||D.length,te=se?_.div({class:ae(["cms-parallax-header",n.headerClass])},_.div({class:"cms-parallax-head"},_.div({class:"cms-parallax-head-main"},P.length?_.div({class:ae(["cms-parallax-eyebrow",n.eyebrowClass])},...P):null,Z.length?_.div({class:ae(["cms-parallax-title",n.titleClass])},...Z):null,G.length?_.div({class:ae(["cms-parallax-subtitle",n.subtitleClass])},...G):null,ie.length?_.div({class:ae(["cms-parallax-header-content",n.headerContentClass])},...ie):null),D.length?_.div({class:ae(["cms-parallax-aside",n.asideClass])},...D):null)):null,M=$.length?_.div({class:ae(["cms-parallax-media",n.mediaClass])},...$):null,Q=re.length?_.div({class:ae(["cms-parallax-body",n.bodyClass])},...re):null,q=le.length||me.length?_.div({class:ae(["cms-parallax-footer",n.footerClass])},le.length?_.div({class:"cms-parallax-footer-content"},...le):null,me.length?_.div({class:"cms-parallax-actions"},...me):null):null,ue=JSswift.omit(r,["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"]);ue.class=ae(["cms-parallax","cms-singularity",C,fe(n.disabled,"cms-parallax-static"),fe(oe,"cms-parallax-has-badge"),fe(se,"cms-parallax-has-header"),r.class]),ue.style={...r.style||{}},n.height!=null&&(ue.style["--cms-parallax-height"]=ze(n.height,Be)),n.minHeight!=null&&(ue.style["--cms-parallax-min-height"]=ze(n.minHeight,Be)),n.padding!=null&&(ue.style["--cms-parallax-padding"]=ze(n.padding,Be)),n.gap!=null&&(ue.style["--cms-parallax-gap"]=ze(n.gap,Be)),n.contentMaxWidth!=null&&(ue.style["--cms-parallax-content-max-width"]=ze(n.contentMaxWidth,Be)),n.justify!=null&&(ue.style["--cms-parallax-justify"]=ze(n.justify)),n.align!=null&&(ue.style["--cms-parallax-align"]=ze(n.align)),n.color!=null&&(ue.style["--cms-parallax-color"]=ze(n.color,u)),n.overlay!=null&&(ue.style["--cms-parallax-overlay"]=ze(n.overlay)),n.bgPosition!=null&&(ue.style["--cms-parallax-position"]=ze(n.bgPosition)),n.bgSize!=null&&(ue.style["--cms-parallax-size"]=ze(n.bgSize)),n.bgRepeat!=null&&(ue.style["--cms-parallax-repeat"]=ze(n.bgRepeat)),ue.style["--cms-parallax-image"]=at(n.background)||at(n.image)||at(n.src)?()=>i():i();const L=_.div({class:ae(["cms-parallax-bg",n.bgClass])},b.length?_.div({class:ae(["cms-parallax-bg-content",n.backgroundContentClass])},...b):null),f=_.div({class:ae(["cms-parallax-content",n.contentClass,n.innerClass])},oe,te,M,Q,q),m=_.div(ue,L,f);let g=!1,F=!1,X=null;const a=()=>{var U;g||(g=!0,typeof window!="undefined"&&(window.removeEventListener("scroll",h),window.removeEventListener("resize",h)),(U=X==null?void 0:X.disconnect)==null||U.call(X),X=null)},S=()=>{if(g)return;if(!m.isConnected){a();return}if(l(n.disabled)){L.style.transform="translate3d(0, 0, 0)",m.style.setProperty("--cms-parallax-offset","0px");return}const U=m.getBoundingClientRect(),ce=y(n.speed,.18),k=Math.abs(y(n.maxOffset,96)),d=l(n.startTop),N=d!=null&&d!==""?(U.top-y(n.startTop,0))*ce:((typeof window!="undefined"&&(window.innerHeight||document.documentElement.clientHeight)||0)/2-(U.top+U.height/2))*ce,H=`${(k>0?Math.max(-k,Math.min(k,N)):N).toFixed(2)}px`;L.style.transform=`translate3d(0, ${H}, 0)`,m.style.setProperty("--cms-parallax-offset",H)};function h(){g||F||(F=!0,requestAnimationFrame(()=>{F=!1,S()}))}return typeof window!="undefined"&&(window.addEventListener("scroll",h,{passive:!0}),window.addEventListener("resize",h),typeof ResizeObserver!="undefined"&&(X=new ResizeObserver(()=>{h()}),X.observe(m)),requestAnimationFrame(()=>{h()}),setTimeout(()=>{h()},90)),m.refresh=()=>(h(),m),m.update=m.refresh,m.destroy=()=>(a(),m.remove(),null),m._dispose=a,Ke(m,n),m};const[Gn,Kn]=He.reactive.signal([]),Yn=new Map;function ys(t){const e=Yn.get(t);e&&(clearTimeout(e),Yn.delete(t))}function ws(t){return t?(ys(t),Kn(Gn().filter(e=>e.id!==t)),t):null}function Ho(){for(const t of Yn.keys())ys(t);Kn([])}function ml(t){t!=null&&t.id&&(ys(t.id),t.timeout>0&&Yn.set(t.id,setTimeout(()=>{ws(t.id)},t.timeout)))}function gl(t,e={}){if(!t)return null;let n=null;return Kn(Gn().map(s=>s.id!==t?s:(n=Gt({...s,...e,id:s.id},e.type||e.state||e.color||s.type),n))),n&&ml(n),(n==null?void 0:n.id)||null}function jo(t){const e=()=>ws(t.id),n=(ie={})=>gl(t.id,ie),s={toast:t,id:t.id,close:e,update:n},o=ie=>typeof ie=="function"?ie(s):ie,r=(()=>{if(t.icon===!1||t.icon===null)return null;if(t.icon!=null){const D=o(t.icon);return typeof D=="string"?he.Icon({name:D,size:"sm"}):JSswift.ui.slot(D,{as:"icon"})}const ie=$o[t.type];return ie?he.Icon({name:ie,size:"sm"}):null})(),C=E(t.slots,"icon",s,r),u=E(t.slots,"title",s,o(t.title)),i=E(t.slots,"message",s,o(t.message)),y=E(t.slots,"description",s,o(t.description)),R=E(t.slots,"meta",s,o(t.meta)),v=E(t.slots,"actions",s,o(t.actions)),b=E(t.slots,"default",s,o(t.body)),P=E(t.slots,"dismiss",s,o(t.dismiss)),Z=P.length?P:t.closable?[he.Btn({class:"cms-toast-close",outline:!0,size:"xs","aria-label":t.dismissLabel,onClick:e},he.Icon({name:"close",size:"xs"}))]:[],G=_.div({class:ae(["cms-toast",`cms-toast-${t.type}`,`cms-toast-${t.variant}`,fe(t.closable,"is-closable"),t.class]),style:t.style||{},role:t.role},C.length?_.div({class:"cms-toast-icon"},...C):null,_.div({class:"cms-toast-main"},_.div({class:"cms-toast-copy"},u.length?_.div({class:"cms-toast-title"},...u):null,i.length?_.div({class:"cms-toast-message"},...i):null,y.length?_.div({class:"cms-toast-description"},...y):null,b.length?_.div({class:"cms-toast-body"},...b):null,R.length?_.div({class:"cms-toast-meta"},...R):null),v.length?_.div({class:"cms-toast-actions"},...v):null),Z.length?_.div({class:"cms-toast-dismiss"},...Z):null);return Ke(G,t),G}function Wo(){let t=document.querySelector(".cms-toast-layer");return t||(t=document.createElement("div"),t.className="cms-toast-layer",document.body.appendChild(t),He.reactive.effect(()=>{const e=Gn();t.innerHTML="";const n=new Map;for(const s of e){const o=dl(s.position);n.has(o)||n.set(o,[]),n.get(o).push(s)}for(const s of ul){const o=n.get(s);if(!(o!=null&&o.length))continue;const r=_.div({class:ae(["cms-toast-wrap",`is-${s}`])},...o.map(C=>jo(C)));t.appendChild(r)}},"JSswiftUI:toasts"),t)}function Uo(t={}){Wo();const e=Gt(t);return e.id=e.id||Math.random().toString(36).slice(2),Kn([...Gn().filter(n=>n.id!==e.id),e]),ml(e),e.id}He.services.notify.show=Uo,He.services.notify.success=Rt("success","Success"),He.services.notify.error=Rt("danger","Error"),He.services.notify.warning=Rt("warning","Warning"),He.services.notify.info=Rt("info","Info"),He.services.notify.primary=Rt("primary","Notice"),He.services.notify.secondary=Rt("secondary","Notice"),He.services.notify.update=gl,He.services.notify.remove=ws,He.services.notify.clear=Ho,He.services.notify.promise=he.Notify.promise,He.notify=He.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,o=null;t&&typeof t=="object"&&typeof t.rule=="function"&&(s=t.rule,o=t.message||null);const r=s?s(e,n):!0,C=JSswift.form._isPromise(r)?await r:r;return C===!0?null:typeof C=="string"?C:C===!1?o||"Valore non valido":C?null:o||"Valore non valido"},JSswift.useForm=(t={})=>{const e=t.model||{},n=JSswift.form._normalizeRules(t.rules||{}),s=t.validateOn||"submit",o=t.initial||null,r=_.rod({}),C=_.rod({}),u=_.rod(!1),i=_.rod(null),y=()=>e&&typeof e=="object"&&"value"in e?e.value||{}:e,R=re=>{if(e&&typeof e=="object"&&"value"in e)e.value=re;else{const oe=e||{};for(const se in oe)delete oe[se];Object.assign(oe,re)}},v=re=>{const oe=y();return oe?oe[re]:void 0},b=(re,oe)=>{const se={...y()||{}};se[re]=oe,R(se)},P=(re,oe)=>{const se={...r.value||{}};oe?se[re]=oe:delete se[re],r.value=se},Z=re=>(r.value||{})[re]||null,G=re=>{C.value={...C.value||{},[re]:!0}},ie=re=>!!(C.value||{})[re],D=async re=>{const oe=n[re]||[];if(!oe.length)return P(re,null),!0;const se=v(re),te={name:re,value:se,model:y(),form:me};for(const M of oe){if(!M)continue;const Q=await JSswift.form._runRule(M,se,te);if(Q)return P(re,Q),!1}return P(re,null),!0},$=async()=>{i.value=null;const re=Object.keys(n);let oe=!0;for(const se of re)await D(se)||(oe=!1);return oe},me={model:e,errors:r,touched:C,submitting:u,submitError:i,getValue:v,setValue:b,getError:Z,setError:P,touch:G,isTouched:ie,field:(re,oe={})=>{var F;const se=_.rod("");(F=se.action)==null||F.call(se,X=>{b(re,X)});const te=()=>s==="submit"||s==="input"||s==="blur"?!0:ie(re);let M=null,Q=!1,q=!1;const ue=async()=>{Q||(Q=!0,G(re),(s==="blur"||s==="input")&&await D(re),setTimeout(()=>{Q=!1},0))},L=X=>{M&&(M===X.target||M.contains&&M.contains(X.target)||(ue(),M=null,q&&(q=!1,document.removeEventListener("pointerdown",L,!0))))},f=()=>{q||(q=!0,document.addEventListener("pointerdown",L,!0))},m=async()=>{M=document.activeElement,Q=!1,f(),s==="input"&&await D(re)},g=async()=>{await ue(),M=null,q&&(q=!1,document.removeEventListener("pointerdown",L,!0))};return{name:re,model:se,get value(){return se.value},set value(X){se.value=X},error:()=>te()?Z(re):null,success:oe.success||null,warning:oe.warning||null,note:oe.note||null,touch:()=>G(re),validate:()=>D(re),onInput:m,onBlur:g,hint:oe.hint||null}},validateField:D,validate:$,reset:()=>{i.value=null,r.value={},C.value={},o&&R({...o||{}})},submit:async re=>{u.value=!0,i.value=null;try{return await $()?{ok:!0,result:await(re==null?void 0:re(y(),me))}:{ok:!1,reason:"validation"}}catch(oe){return console.error("[useForm] submit error:",oe),i.value=oe&&oe.message?oe.message:String(oe),{ok:!1,reason:"exception",error:oe}}finally{u.value=!1}}};return me},he.Form=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.form,o=e.onSubmit,r=ae(["cms-form",e.class]),C=JSswift.omit(e,["form","onSubmit"]);C.class=r;const u=_.form({...C,onSubmit:async y=>{y.preventDefault(),s&&await s.submit(o||(async()=>{}))}}),i=[];for(const y of n||[]){const R=typeof y=="function"?y(s):y,v=JSswift.ui.slot(R);v&&(Array.isArray(v)?i.push(...v):i.push(v))}return i.forEach(y=>u.appendChild(y)),s&&s.submitting&&JSswift.reactive.effect(()=>{u.classList.toggle("is-submitting",!!s.submitting.value)},"UI.Form:submitting"),u},He.services=He.services||{},He.services.dialog=He.services.dialog||{},He.dialog=He.services.dialog;let wn=null;function hl(){return wn||(wn=document.createElement("div"),wn.setAttribute("data-cms-modal-root","true"),document.body.appendChild(wn),wn)}he.cardHeader=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=ae(["cms-card-header",fe(e.divider,"divider"),e.class]),r=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);r.class=o;const C={...e.style||{}},u=ze(e.align);u!=null&&!We(e,"align")&&(C.alignItems=u);const i=ze(e.justify);i!=null&&!We(e,"justify")&&(C.justifyContent=i);const y=ze(e.wrap,P=>P?"wrap":"nowrap");y!=null&&!We(e,"wrap")&&(C.flexWrap=y);const R=ze(e.direction);R!=null&&!We(e,"direction")&&(C.flexDirection=R);const v=ze(e.gap,Be);v!=null&&!We(e,"gap")&&(C.gap=v),Object.keys(C).length&&(r.style=C),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const b=_.div(r,...E(s,"default",{},n));return Ke(b,e),b},he.cardBody=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=ae(["cms-card-body",e.class]),r=JSswift.omit(e,["slots","display","direction","wrap","align","justify","gap","rowGap","columnGap","padding","width"]);r.class=o,JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const C=_.div(r,...E(s,"default",{},n));return Ke(C,e),C},he.cardFooter=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=ae(["cms-card-footer",fe(e.divider,"divider"),e.class]),r=JSswift.omit(e,["divider","align","justify","gap","wrap","direction","slots"]);r.class=o;const C={...e.style||{}},u=ze(e.align);u!=null&&!We(e,"align")&&(C.alignItems=u);const i=ze(e.justify);i!=null&&!We(e,"justify")&&(C.justifyContent=i);const y=ze(e.wrap,P=>P?"wrap":"nowrap");y!=null&&!We(e,"wrap")&&(C.flexWrap=y);const R=ze(e.direction);R!=null&&!We(e,"direction")&&(C.flexDirection=R);const v=ze(e.gap,Be);v!=null&&!We(e,"gap")&&(C.gap=v),Object.keys(C).length&&(r.style=C),JSswift.uiApplyResponsiveProps(r,e,JSswift.uiResponsiveStyleRules);const b=_.div(r,...E(s,"default",{},n));return Ke(b,e),b},he.Dialog=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=["primary","secondary","warning","danger","success","info","light","dark"],r=["xs","sm","md","lg","xl","full"];let C={...e},u=null,i=null;const y=(f,m)=>typeof f=="function"?f(m):f,R=f=>String(f||"").split(/\s+/).filter(Boolean),v=(f,m,g)=>{if(!f)return;const F=f[m]||[];F.length&&f.classList.remove(...F);const X=(g||[]).filter(Boolean);X.length&&f.classList.add(...X),f[m]=X},b=(f,m,g,F=X=>X)=>{if(f){if(g==null||g===""){f.style.removeProperty(m);return}f.style.setProperty(m,F(g))}},P=()=>{var a,S,h,J,j,U;const f=window.visualViewport,m=Math.max(0,Math.round((a=f==null?void 0:f.offsetLeft)!=null?a:0)),g=Math.max(0,Math.round((S=f==null?void 0:f.offsetTop)!=null?S:0)),F=Math.max(0,Math.round((J=(h=f==null?void 0:f.width)!=null?h:window.innerWidth)!=null?J:0)),X=Math.max(0,Math.round((U=(j=f==null?void 0:f.height)!=null?j:window.innerHeight)!=null?U:0));return{left:m,top:g,width:F,height:X}},Z=f=>{if(!(f!=null&&f.panel))return;const{left:m,top:g,width:F,height:X}=P();b(f.panel,"position","fixed"),b(f.panel,"inset",0,a=>`${a}px`),b(f.panel,"top",g,a=>`${a}px`),b(f.panel,"left",m,a=>`${a}px`),b(f.panel,"right","auto"),b(f.panel,"bottom","auto"),b(f.panel,"width",F,a=>`${a}px`),b(f.panel,"height",X,a=>`${a}px`),b(f.panel,"min-height",X,a=>`${a}px`),b(f.panel,"max-width",F,a=>`${a}px`),b(f.panel,"max-height",X,a=>`${a}px`),b(f.panel,"min-width",0,a=>`${a}px`),b(f.panel,"margin",0,a=>`${a}px`),b(f.panel,"box-sizing","border-box"),b(f.panel,"border-width",0,a=>`${a}px`),b(f.panel,"border-radius",0,a=>`${a}px`),b(f.panel,"transform","none"),b(f.panel,"overflow","hidden"),b(f.panel,"--cms-dialog-fullscreen-left",m,a=>`${a}px`),b(f.panel,"--cms-dialog-fullscreen-top",g,a=>`${a}px`),b(f.panel,"--cms-dialog-fullscreen-width",F,a=>`${a}px`),b(f.panel,"--cms-dialog-fullscreen-height",X,a=>`${a}px`)},G=f=>{f!=null&&f.panel&&(b(f.panel,"position",null),b(f.panel,"inset",null),b(f.panel,"top",null),b(f.panel,"left",null),b(f.panel,"right",null),b(f.panel,"bottom",null),b(f.panel,"width",null),b(f.panel,"height",null),b(f.panel,"min-height",null),b(f.panel,"max-width",null),b(f.panel,"max-height",null),b(f.panel,"min-width",null),b(f.panel,"margin",null),b(f.panel,"box-sizing",null),b(f.panel,"border-width",null),b(f.panel,"border-radius",null),b(f.panel,"transform",null),b(f.panel,"overflow",null),b(f.panel,"--cms-dialog-fullscreen-left",null),b(f.panel,"--cms-dialog-fullscreen-top",null),b(f.panel,"--cms-dialog-fullscreen-width",null),b(f.panel,"--cms-dialog-fullscreen-height",null))},ie=(f,m)=>{var h,J,j,U,ce;if(!f)return;if((h=f._dialogViewportCleanup)==null||h.call(f),f._dialogViewportCleanup=null,!m){G(f);return}let g=null;const F=globalThis.requestAnimationFrame||(k=>setTimeout(()=>k(Date.now()),0)),X=globalThis.cancelAnimationFrame||clearTimeout,a=()=>Z(f),S=()=>{g!=null&&X(g),g=F(()=>{g=null,a()})};a(),S(),window.addEventListener("resize",a),window.addEventListener("orientationchange",S),(j=(J=window.visualViewport)==null?void 0:J.addEventListener)==null||j.call(J,"resize",a),(ce=(U=window.visualViewport)==null?void 0:U.addEventListener)==null||ce.call(U,"scroll",S),f._dialogViewportCleanup=()=>{var k,d,N,I;g!=null&&(X(g),g=null),window.removeEventListener("resize",a),window.removeEventListener("orientationchange",S),(d=(k=window.visualViewport)==null?void 0:k.removeEventListener)==null||d.call(k,"resize",a),(I=(N=window.visualViewport)==null?void 0:N.removeEventListener)==null||I.call(N,"scroll",S)}},D=()=>C,$=f=>{var g;const m=l((g=f.state)!=null?g:f.color);return m?o.includes(m)?m:String(m):""},Y=f=>{const m=l(f.size);return typeof m=="string"&&r.includes(m)?m:""},W=f=>{var g,F,X;const m=String(l((X=(F=(g=f.actionsAlign)!=null?g:f.footerAlign)!=null?F:f.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"},le=f=>{var g,F,X;const m=String(l((X=(F=(g=f.align)!=null?g:f.verticalAlign)!=null?F:f.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":""},me=f=>{var g,F;return((F=(g=f.closable)!=null?g:f.dismissible)!=null?F:f.closeButton)!==!1},re=()=>{var H,ge,Se,ye,V,O,K,ke;const f=D(),m={close:Q,dismiss:Q,open:M,toggle:ue,update:te,isOpen:q,entry:()=>u,props:f},g=f.icon!=null?typeof f.icon=="string"?he.Icon({name:f.icon,size:f.iconSize||"md"}):JSswift.ui.slot(f.icon,{as:"icon"}):null,F=E(s,"eyebrow",m,y(f.eyebrow,m)),X=E(s,"title",m,y((ge=(H=f.title)!=null?H:f.heading)!=null?ge:f.header,m)),a=E(s,"subtitle",m,y((Se=f.subtitle)!=null?Se:f.description,m)),S=E(s,"icon",m,g),h=E(s,"header",m,y((ye=f.headerContent)!=null?ye:f.head,m)),J=me(f)?E(s,"close",m,he.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":f.closeLabel||"Chiudi dialog","data-dialog-close":!0},he.Icon({name:f.closeIcon||"close",size:"sm"}))):[],j=(K=(O=(V=f.content)!=null?V:f.body)!=null?O:f.message)!=null?K:n&&n.length?n:null;let U=E(s,"content",m,y(j,m));U.length||(U=E(s,"body",m,y(j,m))),U.length||(U=E(s,"default",m,y(j,m)));const ce=y((ke=f.footer)!=null?ke:f.actions,m);let k=E(s,"footer",m,ce);k.length||(k=E(s,"actions",m,ce));let d=null;h.length?d=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...h):(F.length||X.length||a.length||S.length||J.length)&&(d=_.div({class:"cms-dialog-head"},S.length?_.div({class:"cms-dialog-icon"},...S):null,_.div({class:"cms-dialog-head-main"},F.length?_.div({class:"cms-dialog-eyebrow"},...F):null,X.length?_.div({class:"cms-dialog-title"},...X):null,a.length?_.div({class:"cms-dialog-subtitle"},...a):null),J.length?_.div({class:"cms-dialog-close-wrap"},...J):null));const N=_.div({class:ae(["cms-dialog-body",f.bodyClass])},...U),I=k.length?_.div({class:ae(["cms-dialog-actions",`is-${W(f)}`,fe(f.stackActions,"is-stacked"),f.actionsClass,f.footerClass])},...k):null;return _.div({class:ae(["cms-dialog-shell",fe(!!d,"has-head"),fe(!!I,"has-footer"),fe(f.divider!==!1,"with-divider")])},...[d,N,I].filter(Boolean))},oe=f=>{var X;if(!(f!=null&&f.panel))return;const m=D(),g=$(m),F=Y(m);v(f.panel,"_dialogClassTokens",["cms-dialog","cms-singularity","cms-clear-set",F?`cms-dialog-${F}`:"",g,g?`cms-state-${g}`:"",l(m.fullscreen)?"fullscreen":"",l(m.scrollable)?"scrollable":"",l(m.stickyHeader)?"sticky-head":"",l(m.stickyActions)?"sticky-actions":"",l(m.borderless)?"borderless":"",...R(m.class),...R(m.panelClass)]),v(f.overlay,"_dialogOverlayClassTokens",[le(m),l(m.backdropBlur)?"cms-dialog-overlay-blur":"",...R(m.overlayClass)]),b(f.panel,"--cms-dialog-width",l(m.width),Be),b(f.panel,"--cms-dialog-min-width",l(m.minWidth),Be),b(f.panel,"--cms-dialog-max-width",l(m.maxWidth),Be),b(f.panel,"--cms-dialog-max-height",l(m.maxHeight),Be),b(f.panel,"--cms-dialog-body-max-height",l((X=m.bodyMaxHeight)!=null?X:m.contentMaxHeight),Be),m.style&&Object.assign(f.panel.style,m.style),Ke(f.panel,m),ie(f,l(m.fullscreen)),f.panel.setAttribute("role",m.role||"dialog"),f.panel.setAttribute("aria-modal",m.modal===!1?"false":"true"),m.ariaLabel?f.panel.setAttribute("aria-label",m.ariaLabel):f.panel.removeAttribute("aria-label")},se=()=>{u!=null&&u.panel&&u.panel.replaceChildren(re())},te=(f={})=>(f&&typeof f=="object"&&(C={...C,...f}),u&&(oe(u),se()),L),M=(f=null)=>{var X,a,S,h,J;if(f&&typeof f=="object"&&(C={...C,...f}),u)return oe(u),se(),u;i=document.activeElement;const m=D(),g=m.persistent===!0;u=JSswift.overlay.open(()=>re(),{type:"dialog",backdrop:m.backdrop!==!1,lockScroll:m.lockScroll!==!1,trapFocus:m.trapFocus!==!1,autoFocus:m.autoFocus!==!1,closeOnOutside:(X=m.closeOnOutside)!=null?X:!g,closeOnBackdrop:(a=m.closeOnBackdrop)!=null?a:!g,closeOnEsc:(S=m.closeOnEsc)!=null?S:!g,className:Dt(["cms-dialog"]),onClose:()=>{var j,U,ce,k;(j=u==null?void 0:u._dialogViewportCleanup)==null||j.call(u),(U=u==null?void 0:u.panel)==null||U.removeEventListener("click",F),u=null,(k=(ce=D()).onClose)==null||k.call(ce),i&&typeof i.focus=="function"&&setTimeout(()=>i.focus(),0)}});const F=j=>{const U=j.target;U&&U.closest&&U.closest("[data-dialog-close]")&&Q()};return u.panel.addEventListener("click",F),oe(u),bn(u),(J=(h=D()).onOpen)==null||J.call(h,u),u},Q=()=>{if(!u)return;const f=u;yn(f,()=>JSswift.overlay.close(f.id))},q=()=>!!u,ue=(f=null)=>q()?(Q(),null):M(f),L={open:M,close:Q,toggle:ue,update:te,isOpen:q,entry:()=>u,props:()=>({...C})};return L},he.TabPanel=(...t)=>{var Ne,ee,xe,be,Ce,pe,Ie,_e,z,we,T,x,w;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=Array.isArray(e.tabs)?e.tabs:Array.isArray(e.items)?e.items:[],r=Nt(e.model,"UI.TabPanel:model"),C=e.id||"cms-tabpanel-"+Math.random().toString(36).slice(2,9),u=c=>String(l(c)||"vertical").toLowerCase()==="horizontal"?"horizontal":"vertical",i=c=>String(l(c)||"before").toLowerCase()==="after"?"after":"before",y=c=>{const A=String(l(c)||"").toLowerCase();return A==="pills"||A==="pill"?"pills":A==="soft"||A==="card"?"soft":"line"},R=c=>{const A=l(c);return A==null||A===""?null:JSswift.uiColors.includes(A)?`var(--cms-${A})`:String(A)},v=u(e.orientation||e.orient||e.direction),b=i(e.navPosition||e.barPosition||e.position),P=y(e.variant||(e.pills?"pills":e.soft?"soft":"line")),Z=!!e.wrap,G=!!e.swipeable,ie=!!e.infinite,D=!!e.animated,$=!!((ee=(Ne=e.navFill)!=null?Ne:e.fill)!=null?ee:e.stretch),Y=!!e.disabled,W=l((xe=e.transitionDuration)!=null?xe:e["transition-duration"]),le=(()=>{if(W==null)return 220;if(typeof W=="number")return W;const c=parseFloat(W);return Number.isFinite(c)?c:220})(),me=l((be=e.transitionEasing)!=null?be:e["transition-easing"])||"ease",re=(pe=(Ce=e.transitionPrev)!=null?Ce:e["transition-prev"])!=null?pe:null,oe=(_e=(Ie=e.transitionNext)!=null?Ie:e["transition-next"])!=null?_e:null,se=R((z=e.color)!=null?z:e.state),te=o.map((c,A)=>{var De,Ue,Ye,Ze,Qe,Te,je,tt,nt,ut,dt,bt,lt,ft,vt,_t;if(c==null)return null;if(typeof c!="object")return{name:c,labelFallback:c,panelFallback:null,noteFallback:null,iconFallback:null,badgeFallback:null,hidden:!1,raw:c,index:A};const de=(Te=(Qe=(Ze=(Ye=(Ue=(De=c.name)!=null?De:c.value)!=null?Ue:c.id)!=null?Ye:c.key)!=null?Ze:c.label)!=null?Qe:c.title)!=null?Te:`tab-${A}`,Le=c.label!=null||c.title!=null,Je=Le?(je=c.label)!=null?je:c.title:c.children!=null&&c.content==null&&c.panel==null?c.children:(nt=(tt=c.name)!=null?tt:c.value)!=null?nt:`Tab ${A+1}`,B=(bt=(dt=(ut=c.content)!=null?ut:c.panel)!=null?dt:c.body)!=null?bt:Le?c.children:null,Ae=(vt=(ft=(lt=c.note)!=null?lt:c.subtitle)!=null?ft:c.description)!=null?vt:null,Me=(_t=c.icon)!=null?_t:null,Ee=Object.prototype.hasOwnProperty.call(c,"badge")?c.badge:Object.prototype.hasOwnProperty.call(c,"counter")?c.counter:null;return{...c,name:de,labelFallback:Je,panelFallback:B,noteFallback:Ae,iconFallback:Me,badgeFallback:Ee,index:A}}).filter(Boolean).filter(c=>c.hidden!==!0&&c.visible!==!1),M=ae(["cms-clear-set","cms-tabpanel","cms-singularity",v,`variant-${P}`,fe(Z,"wrap"),fe(D,"animated"),fe($,"nav-fill"),fe(Y,"disabled"),fe(b==="after","nav-after"),e.class]),Q=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"]);Q.class=M,Q.style=e.style;const q=_.div(Q);D&&(q.style.setProperty("--cms-tabpanel-duration",`${le}ms`),q.style.setProperty("--cms-tabpanel-easing",me)),se&&q.style.setProperty("--cms-tabpanel-accent",se);const ue=_.div({class:ae(["cms-tabpanel-nav",e.navClass]),role:"tablist","aria-orientation":v}),L=_.div({class:ae(["cms-tabpanel-panels",e.panelsClass])}),f=[],m=[];let g=-1;const F=()=>v==="horizontal",X=(c,A,de)=>({tab:c,name:c.name,index:A,active:de,value:c.name,select:()=>Se(A),next:()=>V(),prev:()=>O()}),a=(c,A,de=!1)=>{var Je;if(!te.length)return-1;let Le=c;for(let B=0;B<te.length;B+=1){if(Le+=A,Le>=te.length){if(!de)return-1;Le=0}else if(Le<0){if(!de)return-1;Le=te.length-1}if(!((Je=te[Le])!=null&&Je.disabled))return Le}return-1},S=c=>{var de;const A=(de=f[c])==null?void 0:de.btn;!A||typeof A.focus!="function"||requestAnimationFrame(()=>A.focus())},h=(c,A,de)=>{const Le=X(c,A,de),Je=JSswift.ui.renderSlot(s,"label",Le,c.labelFallback);return E(null,"default",{},Je)},J=(c,A)=>{var tt,nt,ut,dt,bt;const de=A===g,Le=`${C}-tab-${A}`,Je=`${C}-panel-${A}`,B=X(c,A,de),Ae=h(c,A,de),Me=c.iconFallback!=null?typeof c.iconFallback=="string"?he.Icon({name:c.iconFallback,size:(ut=(nt=(tt=c.iconSize)!=null?tt:c.size)!=null?nt:e.size)!=null?ut:null}):c.iconFallback:null,Ee=E(s,"icon",B,Me),De=E(s,"note",B,c.noteFallback),Ue=E(s,"badge",B,c.badgeFallback),Ye=_.span({class:"cms-tabpanel-tab-inner"},Ee.length?_.span({class:"cms-tabpanel-tab-icon"},...Ee):null,_.span({class:"cms-tabpanel-tab-copy"},_.span({class:"cms-tabpanel-tab-label"},...Ae.length?Ae:[""]),De.length?_.span({class:"cms-tabpanel-tab-note"},...De):null),Ue.length?_.span({class:"cms-tabpanel-tab-badge"},...Ue):null),Ze=E(s,"tab",{...B,label:Ae,icon:Ee,note:De,badge:Ue,tabId:Le,panelId:Je},Ye),Qe=lt=>{if(Y||c.disabled)return;const ft=lt.key;if(ft==="Enter"||ft===" "){lt.preventDefault(),Se(A);return}if(ft==="Home"){lt.preventDefault();const rt=te.findIndex(Vt=>!Vt.disabled);rt>=0&&(Se(rt),S(rt));return}if(ft==="End"){lt.preventDefault();const rt=(()=>{var Vt;for(let Mt=te.length-1;Mt>=0;Mt-=1)if(!((Vt=te[Mt])!=null&&Vt.disabled))return Mt;return-1})();rt>=0&&(Se(rt),S(rt));return}const vt=F()?["ArrowLeft"]:["ArrowUp"],_t=F()?["ArrowRight"]:["ArrowDown"];if(vt.includes(ft)){lt.preventDefault();const rt=a(A,-1,ie);rt>=0&&(Se(rt,{dir:"prev"}),S(rt));return}if(_t.includes(ft)){lt.preventDefault();const rt=a(A,1,ie);rt>=0&&(Se(rt,{dir:"next"}),S(rt))}},Te=he.Btn({class:ae(["cms-tabpanel-tab",fe(de,"active"),fe(c.disabled||Y,"disabled"),e.tabClass,c.tabClass||c.class]),type:"button",id:Le,role:"tab",disabled:!!(c.disabled||Y),"aria-selected":de?"true":"false","aria-controls":Je,tabindex:de?"0":"-1",outline:P==="pills"&&!de,color:P==="pills"&&de?c.color||e.color||e.state||"primary":null,size:(bt=(dt=c.size)!=null?dt:e.size)!=null?bt:null,style:{...e.tabStyle||{},...c.tabStyle||{}},onClick:()=>{c.disabled||Y||Se(A)},onKeydown:Qe},...Ze),je=_.div({class:ae(["cms-tabpanel-nav-btn",fe(de,"active"),c.navClass]),"data-name":c.name},Te,_.span({class:"tab-indicator"}));return f[A]={btn:Te,wrap:je,index:A},je},j=(c,A)=>{const de=A===g,Le=`${C}-tab-${A}`,Je=`${C}-panel-${A}`,B=X(c,A,de),Ae=JSswift.ui.renderSlot(s,"panel",B,c.panelFallback),Me=_.div({class:ae(["cms-tabpanel-panel",fe(de,"active"),e.panelClass,c.panelClass]),style:{...e.panelStyle||{},...c.panelStyle||{}},"data-name":c.name,role:"tabpanel",id:Je,tabindex:0,"aria-labelledby":Le,"aria-hidden":de?"false":"true"},...E(null,"default",{},Ae));return m[A]=Me,Me},U=te.map((c,A)=>J(c,A)),ce=JSswift.ui.renderSlot(s,"nav",{tabs:te,active:()=>{var c;return g>=0?(c=te[g])==null?void 0:c.name:null},activeIndex:()=>g,activeTab:()=>g>=0?te[g]:null,select:c=>{typeof c=="number"?Se(c):ye(c)},next:()=>V(),prev:()=>O(),nodes:U,orientation:v,position:b,variant:P},U);E(null,"default",{},ce).forEach(c=>ue.appendChild(c)),te.length?te.forEach((c,A)=>L.appendChild(j(c,A))):E(s,"empty",{tabs:te},(we=e.empty)!=null?we:_.div({class:"cms-tabpanel-empty"},"Nessun contenuto disponibile.")).forEach(A=>L.appendChild(A));const k=c=>{if(!D)return;const A=c==="next"?"18px":"-18px",de=c==="next"?"-18px":"18px";q.style.setProperty("--cms-tabpanel-enter",A),q.style.setProperty("--cms-tabpanel-leave",de)},d=()=>{const c=[];re&&c.push(...String(re).split(/\s+/)),oe&&c.push(...String(oe).split(/\s+/)),c.length&&L.classList.remove(...c.filter(Boolean))},N=c=>{d();const A=c==="prev"?re:oe;if(!A)return;const de=String(A).split(/\s+/).filter(Boolean);de.length&&(L.classList.add(...de),setTimeout(()=>L.classList.remove(...de),le+40))},I=c=>{var Le;const A=f.find(({btn:Je})=>Je.classList.contains("active")),de=(Le=A==null?void 0:A.btn.parentNode)==null?void 0:Le.getBoundingClientRect();f.forEach(({btn:Je,index:B})=>{const Ae=B===c,Me=Je.parentNode;if(!Me)return;const Ee=Me.getBoundingClientRect();Me.isConnected&&de&&(Me.style.setProperty("--nav-pos-x",de.left-Ee.left+"px"),Me.style.setProperty("--nav-pos-y",de.top-Ee.top+"px")),Me.classList.toggle("active",Ae),Je.classList.toggle("active",Ae),Je.setAttribute("aria-selected",Ae?"true":"false"),Je.setAttribute("tabindex",Ae?"0":"-1")})},H=(c,A,de)=>{k(de),m.forEach((Le,Je)=>{if(!Le)return;const B=Je===A,Ae=Je===c;B?(Le.classList.add("active"),Le.classList.remove("leaving"),Le.setAttribute("aria-hidden","false")):(Le.classList.remove("active"),Le.setAttribute("aria-hidden","true"),D&&Ae?(Le.classList.add("leaving"),setTimeout(()=>Le.classList.remove("leaving"),le+40)):Le.classList.remove("leaving"))})},ge=(c,A)=>c<0||c===A||ie&&c===te.length-1&&A===0?"next":ie&&c===0&&A===te.length-1?"prev":A>c?"next":"prev",Se=(c,A={})=>{var B,Ae;if(c==null||c<0||c>=te.length||(B=te[c])!=null&&B.disabled)return;const de=g;if(de===c)return;g=c;const Le=te[c],Je=A.dir||ge(de,c);r&&!A.fromModel&&r.set(Le.name),I(c),H(de,c,Je),N(Je),q.dataset.active=String(Le.name),(Ae=e.onChange)==null||Ae.call(e,Le.name,Le,c)},ye=(c,A={})=>{if(!te.length)return;const de=te.findIndex(Le=>Le.name==c);de!==-1&&Se(de,A)},V=()=>{if(!te.length)return;const c=g<0?te.findIndex(A=>!A.disabled):a(g,1,ie);c<0||Se(c,{dir:"next"})},O=()=>{if(!te.length)return;const c=g<0?(()=>{var A;for(let de=te.length-1;de>=0;de-=1)if(!((A=te[de])!=null&&A.disabled))return de;return-1})():a(g,-1,ie);c<0||Se(c,{dir:"prev"})};if(G){let c=0,A=0,de=!1;const Le=42;L.addEventListener("pointerdown",Je=>{Je.button!=null&&Je.button!==0||(de=!0,c=Je.clientX,A=Je.clientY)}),L.addEventListener("pointerup",Je=>{if(!de)return;de=!1;const B=Je.clientX-c,Ae=Je.clientY-A;Math.abs(B)<Le||Math.abs(B)<Math.abs(Ae)||(B<0?V():O())}),L.addEventListener("pointercancel",()=>{de=!1}),L.addEventListener("pointerleave",()=>{de=!1})}const K=r?r.get():(w=(x=(T=e.value)!=null?T:e.defaultValue)!=null?x:e.default)!=null?w:null;if(te.length){const c=te.findIndex(A=>A.name==K);if(c>=0)Se(c,{fromModel:!0});else{const A=te.findIndex(de=>!de.disabled);A>=0&&(Se(A,{fromModel:!0}),r&&r.set(te[A].name))}}return r&&r.watch(c=>ye(c,{fromModel:!0}),"UI.TabPanel:watch"),b==="after"?(q.appendChild(L),q.appendChild(ue)):(q.appendChild(ue),q.appendChild(L)),E(s,"default",{},n).forEach(c=>q.appendChild(c)),Ke(q,e),q._tabs=()=>te.slice(),q._active=()=>g>=0?te[g]:null,q._getValue=()=>{var c;return g>=0?(c=te[g])==null?void 0:c.name:null},q._setValue=c=>ye(c),q._select=c=>{typeof c=="number"?Se(c):ye(c)},q._next=V,q._prev=O,q};function Go(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function vs({title:t,message:e,contentNode:n,okText:s,cancelText:o,showCancel:r,onOk:C,onCancel:u,persistent:i}){hl();const y=_.div({class:"cms-dialog-backdrop",onClick:G=>{G.target===y&&i!==!0&&(u==null||u())}}),R=E(null,"default",{},t),v=E(null,"default",{},e),b=E(null,"default",{},n),P=_.div({class:"cms-dialog cms-panel"},R.length?_.h3(...R):null,v.length?_.p(...v):null,...b,_.div({class:"cms-dialog-actions"},r?JSswift.ui.Btn({onClick:u},o||"Annulla"):null,JSswift.ui.Btn({color:"primary",onClick:C},s||"OK")));y.appendChild(P),hl().appendChild(y);const Z=G=>{G.key==="Escape"&&(u==null||u())};return document.addEventListener("keydown",Z,{once:!0}),{backdrop:y,close:()=>Go(y)}}He.dialog.alert=function(t,e={}){return new Promise(n=>{const{backdrop:s,close:o}=vs({title:e.title||"Info",message:t,okText:e.okText||"OK",showCancel:!1,persistent:e.persistent,onOk:()=>{o(),n(!0)},onCancel:()=>{o(),n(!0)}})})},He.dialog.confirm=function(t={}){return new Promise(e=>{const{close:n}=vs({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)}})})},He.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}=vs({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 o=n.value;s(),e(o)},onCancel:()=>{s(),e(null)}});setTimeout(()=>n.focus(),0)})},He.services=He.services||{},He.services.loading=He.services.loading||{},He.loading=He.services.loading;let kt=null,In=0;function pl(){if(kt)return kt;kt=document.createElement("div"),kt.className="cms-loading-backdrop",kt.style.cssText=`
2
2
  position: fixed; inset: 0;
3
3
  background: rgba(0,0,0,0.45);
4
4
  display: none;
@@ -24,11 +24,11 @@ border-radius: 999px;
24
24
  overflow: hidden;
25
25
  background: rgba(255,255,255,0.08);
26
26
  display: none;
27
- `;const i=document.createElement("div");i.className="cms-loading-progress-bar",i.style.cssText=`
27
+ `;const o=document.createElement("div");o.className="cms-loading-progress-bar",o.style.cssText=`
28
28
  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),Nt.appendChild(t),document.body.appendChild(Nt);const y=document.createElement("style");return y.textContent=`
32
+ `,s.appendChild(o);const r=document.createElement("div");r.style.cssText="display:flex; gap: 12px; align-items:center; width: 100%;",r.appendChild(e),r.appendChild(n),t.appendChild(r),t.appendChild(s),kt.appendChild(t),document.body.appendChild(kt);const C=document.createElement("style");return C.textContent=`
33
33
  @keyframes cmsSpin { to { transform: rotate(360deg); } }
34
- `,document.head.appendChild(y),Nt._textNode=n,Nt._spinner=e,Nt._progressWrap=s,Nt._progressBar=i,Nt._progressActive=!1,Nt}function ko(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 Fo(t,e){const n=e==="progress";t._spinner.style.display=n?"none":"",t._progressWrap.style.display=n?"block":"none",t._mode=e}je.loading.show=function(t="Loading...",e={}){const n=Ao(),s=ko(t,e);In++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",Fo(n,"spinner"),s.spinner===!1&&(n._spinner.style.display="none"),n.style.display="flex"},je.loading.hide=function(){Nt&&(In=Math.max(0,In-1),In===0&&(Nt.style.display="none",Nt._progressActive=!1))},je.loading.progress=function(t=0,e={}){var c;const n=Ao();typeof t=="object"&&t!==null&&(e=t,t=(c=t.value)!=null?c:0);const s=ko(null,e);n._progressActive||(In++,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+"%",Fo(n,"progress"),n.style.display="flex"},je.loading.wrap=async function(t,e){je.loading.show(t);try{return await e()}finally{je.loading.hide()}};function ur(t){return typeof t=="function"?t():t||[]}function Cs(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 fr(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 mr(t){const e=ur(t);return Array.isArray(e)?e:[]}function _o(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 xs(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 Lo(t,e){return t.find((n,s)=>xs(n,s)===e||(n==null?void 0:n.key)===e)||null}function Xn(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"?Cs(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function Qn(t,e){return typeof t=="function"?t(e)||{}:t||{}}function Zn(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(Zn).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 gr(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 pr(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 y=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var R;return(R=b==null?void 0:b.searchKey)!=null?R:b==null?void 0:b.key}).filter(Boolean),a=[];if(y.length)for(const b of y)if(typeof b=="function")a.push(Zn(b(t)));else{const R=e.find(C=>(C==null?void 0:C.key)===b||(C==null?void 0:C.searchKey)===b);a.push(Zn(R?Xn(R,t,-1):Cs(t,b)))}else a.push(Zn(t));const l=a.join(" ").toLowerCase();return c.every(b=>l.includes(b))}v.Table=(...t)=>{var ke,te,xe,be;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=Array.isArray(e.columns)?e.columns:[],c=gr(e.pageSizeOptions,[5,10,20,50]),y=Number((te=(ke=e.pageSize)!=null?ke:c[0])!=null?te:10)||10,a=Array.from(new Set([...c,y])).sort((Ce,he)=>Ce-he),l=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",R=kt(e.searchModel||e.queryModel,"UI.Table:query"),[C,w]=je.reactive.signal(Math.max(1,Number(e.page||1)||1)),[T,ee]=je.reactive.signal(y),[K,re]=je.reactive.signal(l),[H,j]=je.reactive.signal(String((be=R?R.get():(xe=e.search)!=null?xe:e.query)!=null?be:"")),Y=Ce=>{const he=String(Ce!=null?Ce:"");j(he),R&&R.set(he),w(1)},W=Ce=>{const he=Number(Ce)||y;ee(he),w(1)},ie=(Ce,he)=>{const Le=xs(Ce,he),Ae=K();!Ae||Ae.key!==Le&&Ae.key!==(Ce==null?void 0:Ce.key)?re({key:Le,dir:"asc"}):Ae.dir==="asc"?re({key:Le,dir:"desc"}):re(null),w(1)};let ge=null;R&&R.watch(Ce=>{const he=String(Ce!=null?Ce:"");j(he),ge&&ge.value!==he&&(ge.value=he),w(1)},"UI.Table:queryWatch");const ce=JSswift.omit(e,["columns","rows","rowKey","loading","page","pageSize","pageSizeOptions","pagination","initialSort","sortBy","sortDir","search","query","searchable","searchPlaceholder","searchKeys","searchBy","searchPredicate","searchModel","queryModel","filter","actions","actionsLabel","emptyText","loadingText","onRowClick","onRowDblClick","tableClass","tableStyle","cardClass","dense","striped","hover","stickyHeader","toolbar","toolbarStart","toolbarEnd","caption","footer","status","rowClass","rowAttrs","minTableWidth","hideHeader","hideFooter","slots","body"]);ce.class=ae(["cms-table-card",e.class,e.cardClass]),e.dense!=null&&(ce.dense=e.dense);const le=_.div({class:"cms-table-shell"}),oe=E(s,"default",{},n);oe.length&&le.appendChild(_.div({class:"cms-table-lead"},...oe));const ne=E(s,"toolbarStart",{},e.toolbarStart),J=E(s,"toolbar",{},e.toolbar),Z=E(s,"toolbarEnd",{},e.toolbarEnd),X=_.div({class:"cms-table-toolbar"}),ue=_.div({class:"cms-table-toolbar-main"}),F=_.div({class:"cms-table-toolbar-side"});ne.forEach(Ce=>ue.appendChild(Ce)),J.forEach(Ce=>ue.appendChild(Ce));const f=E(s,"search",{query:H(),getQuery:H,setQuery:Y},null);if(f.length)f.forEach(Ce=>F.appendChild(Ce));else if(b){ge=_.input({type:"search",class:"cms-input",placeholder:typeof e.searchable=="string"?e.searchable:e.searchPlaceholder||"Cerca nella tabella",value:String(H()||"")}),ge.addEventListener("input",()=>Y(ge.value));const Ce=v.Btn({class:"cms-table-search-clear",outline:!0,onClick:()=>{ge&&(ge.value=""),Y("")}},"Reset");F.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),ge,Ce))}Z.forEach(Ce=>F.appendChild(Ce)),(ue.childNodes.length||F.childNodes.length)&&(X.appendChild(ue),X.appendChild(F),le.appendChild(X));const m=_.div({class:"cms-singularity cms-table-chip"},""),g=_.div({class:"cms-singularity cms-table-chip"},""),O=_.div({class:"cms-singularity cms-table-chip"},""),Q=E(s,"status",{},e.status),r=_.div({class:"cms-table-status"},m,g,O,...Q);le.appendChild(r);const x=E(s,"caption",{},e.caption);x.length&&le.appendChild(_.div({class:"cms-table-caption"},...x));const p=_.thead(),P=_.tbody(),U=!!e.actions||!!s.actions,G=ae(["cms-table",me(e.dense,"dense"),me(e.striped,"striped"),me(e.hover!==!1,"hover"),me(e.stickyHeader!==!1,"sticky-head"),e.tableClass]),de={...e.tableStyle||{}};e.minTableWidth!=null&&(de["--cms-table-min-width"]=$e(e.minTableWidth));const A=_.table({class:G,style:de},p,P),u=_.div({class:"cms-singularity cms-table-wrap"},A);le.appendChild(u);const k=_.div({class:"cms-singularity cms-table-chip"},""),I=_.div({class:"cms-singularity cms-table-chip"},""),B=v.Btn({outline:!0,onClick:()=>w(Math.max(1,C()-1))},"\u2039"),pe=v.Btn({outline:!0,onClick:()=>w(C()+1)},"\u203A"),Se=_.div({class:"cms-singularity cms-table-chip"},""),ye=_.select({class:"cms-input cms-table-size-select"},...a.map(Ce=>us({value:String(Ce)},String(Ce))));ye.value=String(T()),ye.addEventListener("change",()=>W(ye.value));const V=E(s,"footer",{},e.footer),D=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},k,I,_.label({class:"cms-table-size"},_.span("Righe"),ye)),_.div({class:"cms-table-foot-extra"},...V,_.div({class:"cms-table-pager"},B,Se,pe)));e.hideFooter!==!0&&le.appendChild(D);const q=()=>{if(p.innerHTML="",e.hideHeader)return;const Ce=_.tr();if(i.forEach((he,Le)=>{var fe,Fe;const Ae={col:he,colIndex:Le,sort:K()},z={...Qn(he==null?void 0:he.style,{...Ae,header:!0}),...Qn((fe=he==null?void 0:he.headerStyle)!=null?fe:he==null?void 0:he.thStyle,{...Ae,header:!0})};(he==null?void 0:he.width)!=null&&(z.width=$e(he.width)),(he==null?void 0:he.minWidth)!=null&&(z.minWidth=$e(he.minWidth)),(he==null?void 0:he.maxWidth)!=null&&(z.maxWidth=$e(he.maxWidth)),he!=null&&he.align&&(z.textAlign=he.align);let we=E(he==null?void 0:he.slots,"header",Ae,null);if(!we.length){const Te=typeof(he==null?void 0:he.header)=="function"?he.header(Ae):(Fe=he==null?void 0:he.header)!=null?Fe:_o(he);we=E(s,"header",Ae,Te)}const M=K(),N=xs(he,Le),S=(he==null?void 0:he.sortable)!==!1&&((he==null?void 0:he.key)!=null||typeof(he==null?void 0:he.get)=="function"||typeof(he==null?void 0:he.compare)=="function"),d=!!M&&(M.key===N||M.key===(he==null?void 0:he.key)),L=_.th({class:ae(["cms-table-head-cell",me(he==null?void 0:he.nowrap,"is-nowrap"),me(S,"cms-table-sortable"),me(d,"is-sorted"),he==null?void 0:he.headerClass]),style:z});S?L.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>ie(he,Le)},_.span({class:"cms-table-head-label"},...we),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},d?M.dir==="asc"?"\u2191":"\u2193":"\u2195"))):we.forEach(Te=>L.appendChild(Te)),Ce.appendChild(L)}),U){const he=E(s,"actionsHeader",{},e.actionsLabel||"Azioni");Ce.appendChild(_.th({class:"cms-table-head-cell cms-table-head-actions",style:{textAlign:"right"}},...he))}p.appendChild(Ce)},Ne=(Ce,he)=>{const Le={columns:i,count:i.length},Ae=E(s,Ce,Le,he),z=String(i.length+(U?1:0));P.appendChild(_.tr(_.td({colSpan:z,class:"cms-table-state"},...Ae)))};return je.reactive.effect(()=>{const Ce=mr(e.rows),he=String(H()||"").trim(),Le=K(),Ae=typeof e.loading=="function"?!!e.loading():!!e.loading,z=e.pagination!==!1;if(q(),P.innerHTML="",ge&&ge.value!==H()&&(ge.value=H()),ye.value!==String(T())&&(ye.value=String(T())),Ae){m.textContent="Caricamento in corso",g.style.display="none",O.style.display="none",k.textContent="Loading\u2026",I.textContent="",Se.textContent="Pagina 1",B.disabled=!0,pe.disabled=!0,Ne("loading",e.loadingText||"Loading...");return}let we=Ce.slice();const M=we.length;if(typeof e.filter=="function"&&(we=we.filter(($,_e)=>e.filter($,{row:$,index:_e,query:he,rows:Ce,columns:i}))),he&&(we=we.filter($=>pr($,i,he,e))),Le){const $=Lo(i,Le.key);$&&we.sort((_e,Re)=>{const Pe=Xn($,_e,-1),De=Xn($,Re,-1),We=typeof $.compare=="function"?$.compare(Pe,De,_e,Re):fr(Pe,De);return Le.dir==="asc"?We:-We})}const N=we.length,S=Math.max(1,Number(T())||y),d=z?Math.max(1,Math.ceil(N/S)):1,L=z?Math.min(C(),d):1;L!==C()&&w(L);const fe=z?(L-1)*S:0,Fe=z?fe+S:N,Te=we.slice(fe,Fe);if(m.textContent=N===M?`${N} righe`:`${N} di ${M} righe`,g.textContent=he?`Ricerca: ${he}`:"",g.style.display=he?"":"none",Le){const $=Lo(i,Le.key);O.textContent=$?`Ordine: ${_o($)} ${Le.dir==="asc"?"\u2191":"\u2193"}`:"",O.style.display=$?"":"none"}else O.style.display="none";if(k.textContent=N?`${fe+1}-${Math.min(Fe,N)} di ${N}`:"0 risultati",I.textContent=N!==M?`Dataset totale ${M}`:`Page size ${S}`,Se.textContent=z?`Pagina ${L} / ${d}`:"Tutte le righe",B.disabled=!z||L<=1,pe.disabled=!z||L>=d,ye.disabled=!z,ye.parentNode.style.display=z?"":"none",Te.length===0){Ne("empty",e.emptyText||"Nessun dato");return}for(let $=0;$<Te.length;$++){const _e=Te[$],Re=fe+$,Pe={row:_e,rowIndex:Re,pageIndex:$},De=typeof e.rowAttrs=="function"?e.rowAttrs(_e,Pe)||{}:e.rowAttrs||{},We=typeof e.rowClass=="function"?e.rowClass(_e,Pe):e.rowClass,qe=!!(e.onRowClick||e.onRowDblClick),Ze=_.tr({...De,class:ae(["cms-table-row",We,De.class,me(qe,"is-clickable")])});if(e.rowKey){const Ee=typeof e.rowKey=="function"?e.rowKey(_e,Pe):Cs(_e,e.rowKey);Ee!=null&&(Ze.dataset.key=String(Ee))}const Qe=Ee=>{const Be=Ee==null?void 0:Ee.target;return!!(Be&&Be.closest&&Be.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(e.onRowClick&&Ze.addEventListener("click",Ee=>{Qe(Ee)||e.onRowClick(_e,Pe,Ee)}),e.onRowDblClick&&Ze.addEventListener("dblclick",Ee=>{Qe(Ee)||e.onRowDblClick(_e,Pe,Ee)}),i.forEach((Ee,Be)=>{var ft,vt;const tt=Xn(Ee,_e,Re),nt={...Pe,col:Ee,colIndex:Be,value:tt},dt={...Qn(Ee==null?void 0:Ee.style,nt),...Qn((ft=Ee==null?void 0:Ee.cellStyle)!=null?ft:Ee==null?void 0:Ee.tdStyle,nt)};Ee!=null&&Ee.align&&(dt.textAlign=Ee.align),(Ee==null?void 0:Ee.width)!=null&&(dt.width=$e(Ee.width)),(Ee==null?void 0:Ee.minWidth)!=null&&(dt.minWidth=$e(Ee.minWidth)),(Ee==null?void 0:Ee.maxWidth)!=null&&(dt.maxWidth=$e(Ee.maxWidth));const ut=typeof(Ee==null?void 0:Ee.cellClass)=="function"?Ee.cellClass(_e,nt):(Ee==null?void 0:Ee.cellClass)||(Ee==null?void 0:Ee.class),bt=_.td({class:ae(["cms-table-cell",ut,me(Ee==null?void 0:Ee.nowrap,"is-nowrap")]),style:dt});let ot=E(Ee==null?void 0:Ee.slots,"cell",nt,null);if(!ot.length){const At=typeof(Ee==null?void 0:Ee.render)=="function"?Ee.render(_e,nt):typeof(Ee==null?void 0:Ee.format)=="function"?Ee.format(tt,_e,nt):tt,at=At==null?(vt=Ee==null?void 0:Ee.emptyText)!=null?vt:"":At;ot=E(s,"cell",nt,at)}ot.length||(ot=[""]),ot.forEach(At=>bt.appendChild(At)),Ze.appendChild(bt)}),U){const Ee={...Pe},Be=typeof e.actions=="function"?e.actions(_e,Pe):e.actions;let tt=E(s,"actions",Ee,Be);tt.length||(tt=E(null,"default",Ee,Be)),Ze.appendChild(_.td({class:"cms-table-cell cms-table-cell-actions",style:{textAlign:"right"}},_.div({class:"cms-table-actions"},...tt)))}P.appendChild(Ze)}},"UI.Table:render"),ce.body=le,v.Card(ce)},(Ti=JSswift.isDev)!=null&&Ti.call(JSswift)&&(v.meta=v.meta||{},v.meta.Table={signature:"UI.Table(props)",props:{columns:"Array<{ key, label?, sortable?, get?, value?, render?, format?, width?, minWidth?, maxWidth?, align?, compare?, style?, headerStyle?, thStyle?, cellStyle?, tdStyle?, cellClass?, headerClass?, nowrap?, searchable? }>",rows:"Array|() => Array",rowKey:"string|((row)=>string)",loading:"boolean|() => boolean",page:"number",pageSize:"number",pageSizeOptions:"number[]",pagination:"boolean",initialSort:"{ key, dir: 'asc'|'desc' }",search:"string",query:"string",searchable:"boolean|string",searchPlaceholder:"string",searchKeys:"Array<string|function>",searchModel:"[get,set] signal",filter:"(row, ctx)=>boolean",actions:"(row, ctx)=>Node|Array",actionsLabel:"string|Node|Function|Array",emptyText:"string|Node|Function|Array",loadingText:"string|Node|Function|Array",toolbar:"Node|Function|Array",toolbarStart:"Node|Function|Array",toolbarEnd:"Node|Function|Array",caption:"string|Node|Function|Array",footer:"Node|Function|Array",status:"string|Node|Function|Array",rowClass:"string|((row,ctx)=>string)",rowAttrs:"object|((row,ctx)=>object)",minTableWidth:"string|number",stickyHeader:"boolean",hideHeader:"boolean",hideFooter:"boolean",dense:"boolean",striped:"boolean",hover:"boolean",tableClass:"string",cardClass:"string",class:"string",style:"object"},slots:{default:"Introductory content above the table",toolbarStart:"Toolbar left area",toolbar:"Central/custom toolbar",toolbarEnd:"Toolbar right area",search:"Replaces the built-in search box",header:"Custom column header",cell:"Global cell renderer",actions:"Global row actions renderer",actionsHeader:"Actions column header",caption:"Caption above the table",status:"Extra content in the status row",loading:"Loading state",empty:"Empty state",footer:"Extra content in the footer"},events:{onRowClick:"(row, ctx, event) => void",onRowDblClick:"(row, ctx, event) => void"},returns:"HTMLDivElement",description:"Standardized table with toolbar, search, sorting, pagination, states, and flexible rendering."}),v.Menu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],c=["xs","sm","md","lg","xl"];let y={...e},a=null,l=null,b=null,R=null,C=null;const w=(u,k)=>Object.prototype.hasOwnProperty.call(u||{},k),T=(u,k)=>typeof u=="function"?u(k):u,ee=u=>String(u||"").split(/\s+/).filter(Boolean),K=u=>u&&typeof u=="object"&&!u.nodeType&&!Array.isArray(u)&&!(u instanceof Function),re=u=>!!u&&typeof u=="object"&&(u.nodeType===1||typeof u.getBoundingClientRect=="function"),H=()=>{clearTimeout(R),clearTimeout(C),R=null,C=null},j=(u,k,I)=>{if(!u)return;const B=u[k]||[];B.length&&u.classList.remove(...B);const pe=(I||[]).filter(Boolean);pe.length&&u.classList.add(...pe),u[k]=pe},Y=(u,k,I,B=pe=>pe)=>{if(u){if(I==null||I===""){u.style.removeProperty(k);return}u.style.setProperty(k,B(I))}},W=()=>y||{},ie=u=>{var I;const k=String(o((I=u.state)!=null?I:u.color)||"").toLowerCase();return i.includes(k)?k:""},ge=u=>{const k=String(o(u.size)||"").toLowerCase();return c.includes(k)?k:""},ce=u=>{var k,I;return String(o((I=(k=u.placement)!=null?k:u.position)!=null?I:"bottom-start"))},le=()=>{var I;const u=o((I=W().delay)!=null?I:W().showDelay),k=Number(u);return Number.isFinite(k)?Math.max(0,k):0},oe=()=>{const u=o(W().hideDelay),k=Number(u);return Number.isFinite(k)?Math.max(0,k):80},ne=(u=null)=>{var I,B,pe;if(u)return u;const k=W();return l||o((pe=(B=(I=k.anchorEl)!=null?I:k.triggerEl)!=null?B:k.target)!=null?pe:k.anchor)||null},J=u=>{if(u==null||u===!0)return new Set(["click"]);if(u===!1)return new Set(["manual"]);const k=Array.isArray(u)?u:String(u).split(/[\s,|/]+/),I=new Set;return k.forEach(B=>{const pe=String(B||"").trim().toLowerCase();pe&&(pe==="mouseenter"||pe==="mouseover"?I.add("hover"):pe==="blur"||pe==="focusin"?I.add("focus"):pe==="tap"?I.add("click"):I.add(pe))}),I.size?I:new Set(["manual"])},Z=(u,k)=>{var pe,Se,ye;let I=null,B=null;if(re(u))I=u,K(k)&&(B=k);else if(K(u)){B=u;const V=(ye=(Se=(pe=u.anchorEl)!=null?pe:u.triggerEl)!=null?Se:u.target)!=null?ye:u.anchor;re(V)&&(I=V)}else u!=null&&(I=u);return{anchorEl:I,nextProps:B}},X=(u=a==null?void 0:a.panel)=>{var k;return Array.from(((k=u==null?void 0:u.querySelectorAll)==null?void 0:k.call(u,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(I=>I.offsetParent!==null&&I.getAttribute("aria-hidden")!=="true")},ue=()=>{o(W().autoFocus)!==!1&&setTimeout(()=>{const u=X();if(!u.length)return;(u.find(I=>I.classList.contains("is-active")||I.classList.contains("is-selected")||I.classList.contains("is-checked"))||u[0]).focus()},0)},F=(u,k,I="sm")=>{const B=T(u,k);return B==null?[]:typeof B=="string"?[v.Icon({name:B,size:I})]:Ln(B,{...k,as:"icon"})},f=(u,k)=>{var fe,Fe,Te,$,_e,Re,Pe,De,We,qe,Ze,Qe,Ee;const I=T(u,k);if(I==null||I===!1)return[];if(Array.isArray(I))return I.flatMap((Be,tt)=>f(Be,{...k,index:tt}));if(typeof I=="function")return f(I(k),k);if(I!=null&&I.nodeType)return[I];if(typeof I=="string"||typeof I=="number")return f({label:I},k);if(!K(I))return Ln(I,{...k,as:"item"});const B=String((Fe=(fe=I.type)!=null?fe:I.kind)!=null?Fe:"").toLowerCase();if(B==="separator"||B==="divider"||I.separator===!0||I.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const pe=(Te=I.items)!=null?Te:I.children;if((B==="group"||B==="section"||Array.isArray(pe))&&pe!=null){const Be={...k,item:I},tt=E(s,"groupLabel",Be,T(($=I.label)!=null?$:I.title,Be)),nt=f(pe,Be);return nt.length?[_.div({class:ae(["cms-menu-group",I.class])},tt.length?_.div({class:"cms-menu-group-label"},...tt):null,_.div({class:"cms-menu-group-items"},...nt))]:[]}const Se={...k,item:I,close:Q,dismiss:Q,open:x,toggle:U,update:r,isOpen:G,entry:()=>a,anchorEl:ne(),props:W()},ye=!!o(I.disabled),V=I.checked==null?null:!!o(I.checked),D=!!o((_e=I.active)!=null?_e:I.selected),q=ie(I),Ne=o(I.href),ke=o(I.to),te=w(I,"closeOnSelect")?!!o(I.closeOnSelect):I.keepOpen===!0?!1:W().closeOnSelect!==!1,xe=I.role||(V!=null?"menuitemcheckbox":"menuitem"),be=F(I.icon,Se),Ce=F((Re=I.iconRight)!=null?Re:I.endIcon,Se),he=E(s,"itemTitle",Se,T((Pe=I.title)!=null?Pe:I.label,Se)),Le=E(s,"itemSubtitle",Se,T((De=I.subtitle)!=null?De:I.description,Se)),Ae=E(s,"itemShortcut",Se,T(I.shortcut,Se)),z=E(s,"itemBadge",Se,T(I.badge,Se)),we=E(s,"item",Se,T((qe=(We=I.content)!=null?We:I.body)!=null?qe:I.render,Se)),M=[...z,...Ae,...V===!0&&!Ce.length&&!z.length?[_.span({class:"cms-menu-entry-check"},v.Icon({name:I.checkedIcon||"check",size:"sm"}))]:[],...Ce],S={class:ae(["cms-menu-entry","cms-menu-item",q?`cms-state-${q}`:"",me(D,"is-active"),me(V===!0,"is-checked"),me(ye,"is-disabled"),I.class]),role:xe,tabIndex:ye?-1:(Ze=I.tabIndex)!=null?Ze:-1,"data-menu-item":!0,"data-menu-select":te?"true":"false","data-menu-close":I.close===!0?"true":null,"data-menu-keep-open":te?null:"true","aria-disabled":ye?"true":null,"aria-checked":V==null?null:String(V),title:(Ee=(Qe=I.titleAttr)!=null?Qe:I.tooltip)!=null?Ee:null,type:Ne?null:"button",href:Ne||null,target:I.target||null,rel:I.rel||(I.target==="_blank"?"noopener noreferrer":null),onClick:Be=>{var nt,dt,ut,bt;if(ye){Be.preventDefault(),Be.stopPropagation();return}(dt=(nt=W()).onItemClick)==null||dt.call(nt,I,Se,Be);const tt=(ut=I.onClick)==null?void 0:ut.call(I,Se,Be);Be.defaultPrevented||(ke&&((bt=JSswift.router)!=null&&bt.navigate)&&(Be.preventDefault(),JSswift.router.navigate(ke)),tt!==!1&&te&&Q())}};I.attrs&&typeof I.attrs=="object"&&Object.assign(S,I.attrs);const d=Ne?_.a:_.button,L=we.length?we:[he.length?_.div({class:"cms-menu-entry-title"},...he):null,Le.length?_.div({class:"cms-menu-entry-subtitle"},...Le):null].filter(Boolean);return[d(S,be.length?_.span({class:"cms-menu-entry-icon"},...be):null,_.span({class:"cms-menu-entry-main"},...L),M.length?_.span({class:"cms-menu-entry-aside"},...M):null)]},m=()=>{var he,Le,Ae,z,we,M,N;const u=W(),k={close:Q,dismiss:Q,open:x,toggle:U,update:r,isOpen:G,entry:()=>a,anchorEl:ne(),props:u},I=F(u.icon,k,u.iconSize||"md"),B=E(s,"eyebrow",k,T(u.eyebrow,k)),pe=E(s,"title",k,T((Le=(he=u.title)!=null?he:u.heading)!=null?Le:u.label,k)),Se=E(s,"subtitle",k,T((Ae=u.subtitle)!=null?Ae:u.description,k)),ye=E(s,"before",k,T(u.before,k)),V=E(s,"header",k,T(u.header,k)),D=E(s,"after",k,T(u.after,k)),q=E(s,"footer",k,T(u.footer,k)),Ne=E(s,"status",k,T(u.status,k));let ke=(z=u.content)!=null?z:u.body;ke==null&&n&&n.length&&(ke=n);let te=E(s,"content",k,T(ke,k));te.length||(te=E(s,"body",k,T(ke,k))),te.length||(te=E(s,"default",k,T(ke,k)));const xe=f((M=(we=u.items)!=null?we:u.actionsList)!=null?M:u.entries,k),be=xe.length?[]:E(s,"empty",k,T((N=u.empty)!=null?N:u.emptyText,k));let Ce=null;return V.length?Ce=_.div({class:ae(["cms-menu-head","cms-menu-head-custom",u.headerClass])},...V):(I.length||B.length||pe.length||Se.length)&&(Ce=_.div({class:ae(["cms-menu-head",u.headerClass])},I.length?_.div({class:"cms-menu-head-icon"},...I):null,_.div({class:"cms-menu-head-main"},B.length?_.div({class:"cms-menu-eyebrow"},...B):null,pe.length?_.div({class:"cms-menu-title"},...pe):null,Se.length?_.div({class:"cms-menu-subtitle"},...Se):null))),_.div({class:ae(["cms-menu","cms-menu-shell",me(u.dense,"dense"),me(xe.length>0,"has-items"),me(q.length>0||Ne.length>0,"has-footer"),u.class]),style:u.style||{},role:u.role||"menu","aria-label":u.ariaLabel||null},ye.length?_.div({class:"cms-menu-before"},...ye):null,Ce,te.length?_.div({class:ae(["cms-menu-content",u.contentClass])},...te):null,xe.length?_.div({class:ae(["cms-menu-items",u.itemsClass])},...xe):null,!xe.length&&be.length?_.div({class:"cms-menu-empty"},...be):null,D.length?_.div({class:"cms-menu-after"},...D):null,Ne.length||q.length?_.div({class:ae(["cms-menu-footer",u.footerClass])},Ne.length?_.div({class:"cms-menu-status"},...Ne):null,q.length?_.div({class:"cms-menu-footer-actions"},...q):null):null)},g=u=>{var pe;if(!(u!=null&&u.panel))return;const k=W(),I=ie(k),B=ge(k);j(u.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",B?`cms-menu-${B}`:"",I?`cms-state-${I}`:"",o(k.outline)?"outline":"",...ee(k.panelClass)]),j(u.overlay,"_menuOverlayClassTokens",[...ee(k.overlayClass)]),u.panel.dataset.placement=ce(k),Y(u.panel,"--cms-menu-width",o(k.width),$e),Y(u.panel,"--cms-menu-min-width",o(k.minWidth),$e),Y(u.panel,"--cms-menu-max-width",o(k.maxWidth),$e),Y(u.panel,"--cms-menu-max-height",o(k.maxHeight),$e),Y(u.panel,"--cms-menu-body-max-height",o((pe=k.bodyMaxHeight)!=null?pe:k.contentMaxHeight),$e),k.panelStyle&&Object.assign(u.panel.style,k.panelStyle),Ke(u.panel,k)},O=()=>{a!=null&&a.panel&&a.panel.replaceChildren(m())},Q=()=>{if(H(),!a)return;const u=a;a=null,wn(u,()=>JSswift.overlay.close(u.id))},r=(u={})=>{var k,I,B,pe;if(u&&typeof u=="object"&&(y={...y,...u}),a){const Se=W();g(a),O(),(pe=a.reposition)==null||pe.call(a,{anchorEl:a._anchorEl,placement:ce(Se),offsetX:(k=Se.offsetX)!=null?k:0,offsetY:(B=(I=Se.offsetY)!=null?I:Se.offset)!=null?B:8}),ue()}return A},x=(u=null,k=null)=>{var Ce,he,Le,Ae,z,we,M,N,S,d,L,fe,Fe,Te,$,_e;H();const{anchorEl:I,nextProps:B}=Z(u,k);B&&(y={...y,...B});const pe=W(),Se=ne(I);if(!Se||o(pe.disabled))return null;if(a&&a._anchorEl===Se){const Re=W();return g(a),O(),(Ae=a.reposition)==null||Ae.call(a,{anchorEl:a._anchorEl,placement:ce(Re),offsetX:(Ce=Re.offsetX)!=null?Ce:0,offsetY:(Le=(he=Re.offsetY)!=null?he:Re.offset)!=null?Le:8}),ue(),a}a&&Q(),b=document.activeElement;let ye=null;if(a=JSswift.overlay.open(()=>m(),{type:"menu",anchorEl:Se,placement:ce(pe),offsetX:(z=pe.offsetX)!=null?z:0,offsetY:(M=(we=pe.offsetY)!=null?we:pe.offset)!=null?M:8,backdrop:pe.backdrop===!0,lockScroll:pe.lockScroll===!0,trapFocus:pe.trapFocus===!0,autoFocus:!1,closeOnOutside:pe.closeOnOutside!==!1,closeOnBackdrop:(N=pe.closeOnBackdrop)!=null?N:pe.backdrop===!0,closeOnEsc:pe.closeOnEsc!==!1,className:Ht(["cms-menu-panel"]),onClose:()=>{var Re,Pe,De;(Re=ye==null?void 0:ye._menuCleanup)==null||Re.call(ye),(De=(Pe=W()).onClose)==null||De.call(Pe,ye),W().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(a!=null&&a.panel))return a;const V=a;ye=V,V._anchorEl=Se;const D=()=>{clearTimeout(C),C=null},q=()=>{P()},Ne=Re=>{const Pe=Re.target;if(!Pe||!Pe.closest)return;if(Pe.closest("[data-menu-close]")){Q();return}if(W().closeOnSelect===!1)return;const De=Pe.closest("[data-menu-item], [data-menu-select], .cms-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");De&&(De.closest("[data-menu-keep-open]")||De.getAttribute("data-menu-select")!=="false"&&Q())},ke=Re=>{if(Re.key==="Escape"){Re.preventDefault(),Q();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(Re.key))return;const Pe=X(V.panel);if(!Pe.length)return;Re.preventDefault();const De=Pe.indexOf(document.activeElement);if(Re.key==="Home"){Pe[0].focus();return}if(Re.key==="End"){Pe[Pe.length-1].focus();return}const We=Re.key==="ArrowDown"?1:-1,qe=De<0?We>0?0:Pe.length-1:(De+We+Pe.length)%Pe.length;Pe[qe].focus()};V.panel.addEventListener("click",Ne),V.panel.addEventListener("keydown",ke);const te=J((d=(S=pe.trigger)!=null?S:pe.triggers)!=null?d:w(pe,"open")?"manual":null),xe=te.has("hover"),be=te.has("focus");return(xe||be)&&(V.panel.addEventListener("mouseenter",D),V.panel.addEventListener("mouseleave",q),V.panel.addEventListener("focusin",D),V.panel.addEventListener("focusout",q)),V._menuCleanup=()=>{var Re,Pe,De,We,qe,Ze;(Re=V.panel)==null||Re.removeEventListener("click",Ne),(Pe=V.panel)==null||Pe.removeEventListener("keydown",ke),(De=V.panel)==null||De.removeEventListener("mouseenter",D),(We=V.panel)==null||We.removeEventListener("mouseleave",q),(qe=V.panel)==null||qe.removeEventListener("focusin",D),(Ze=V.panel)==null||Ze.removeEventListener("focusout",q)},g(V),(Te=V.reposition)==null||Te.call(V,{anchorEl:Se,placement:ce(pe),offsetX:(L=pe.offsetX)!=null?L:0,offsetY:(Fe=(fe=pe.offsetY)!=null?fe:pe.offset)!=null?Fe:8}),yn(V),(_e=($=W()).onOpen)==null||_e.call($,V),ue(),V},p=(u,k=null)=>{clearTimeout(C),C=null,clearTimeout(R),R=setTimeout(()=>x(u,k),le())},P=(u=!1)=>{if(clearTimeout(R),R=null,!!a){if(clearTimeout(C),u){Q();return}C=setTimeout(()=>Q(),oe())}},U=(u=null,k=null)=>G()?(Q(),null):x(u,k),G=()=>!!a,A={open:x,close:Q,show:p,hide:P,toggle:U,update:r,bind:u=>{var q,Ne;if(!u)return()=>{};l=u;const k=W(),I=J((Ne=(q=k.trigger)!=null?q:k.triggers)!=null?Ne:w(k,"open")?"manual":null),B=I.has("hover"),pe=I.has("focus"),Se=I.has("click"),ye=I.has("manual")||!B&&!pe&&!Se,V=[],D=()=>{H(),V.forEach(ke=>ke()),l===u&&(l=null)};if(w(k,"open"))return rt(k.open)?JSswift.reactive.effect(()=>{l&&(o(W().open)?x(l):P(!0))},"UI.Menu:open"):k.open===!0?x(u):k.open===!1&&P(!0),D;if(ye||o(k.disabled))return D;if(B){const ke=()=>p(u),te=()=>P();u.addEventListener("mouseenter",ke),u.addEventListener("mouseleave",te),V.push(()=>{u.removeEventListener("mouseenter",ke),u.removeEventListener("mouseleave",te)})}if(pe){const ke=()=>p(u),te=()=>P();u.addEventListener("focus",ke),u.addEventListener("blur",te),V.push(()=>{u.removeEventListener("focus",ke),u.removeEventListener("blur",te)})}if(Se){const ke=te=>{var xe,be;(be=(xe=W()).onTriggerClick)==null||be.call(xe,te),!te.defaultPrevented&&U(u)};u.addEventListener("click",ke),V.push(()=>u.removeEventListener("click",ke))}return D},isOpen:G,entry:()=>a,props:()=>({...y})};return A},(Pi=JSswift.isDev)!=null&&Pi.call(JSswift)&&(v.meta=v.meta||{},v.meta.Menu={signature:"UI.Menu(props) | UI.Menu(props, ...children) -> { open, close, show, hide, toggle, update, bind, isOpen }",props:{title:"String|Node|Function|Array|({ close })=>Node",subtitle:"String|Node|Function|Array|({ close })=>Node",eyebrow:"String|Node|Function|Array|({ close })=>Node",icon:"String|Node|Function|Array",content:"Node|Function|Array|({ close })=>Node",body:"Alias of content",items:"Array<string|object>|Function|Array",before:"Node|Function|Array",after:"Node|Function|Array",footer:"Node|Function|Array",status:"Node|Function|Array",empty:"Node|Function|Array",size:"xs|sm|md|lg|xl",state:"primary|secondary|warning|danger|success|info|light|dark",color:"Alias of state",trigger:"click|hover|focus|manual|Array",placement:"string",offsetX:"number",offsetY:"number",offset:"Alias of offsetY",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",contentMaxHeight:"Alias of bodyMaxHeight",closeOnSelect:"boolean",closeOnOutside:"boolean",closeOnEsc:"boolean",autoFocus:"boolean",anchorEl:"HTMLElement|VirtualAnchor",triggerEl:"Alias of anchorEl",target:"Alias of anchorEl",slots:"{ before?, icon?, eyebrow?, title?, subtitle?, header?, content?, body?, item?, itemTitle?, itemSubtitle?, itemBadge?, itemShortcut?, groupLabel?, empty?, status?, footer?, after?, default? }",class:"string",panelClass:"string",overlayClass:"string",style:"object",panelStyle:"object",onOpen:"function",onClose:"function",onItemClick:"(item, ctx, event) => void",onTriggerClick:"function"},slots:{before:"Region above header/body ({ close })",icon:"Menu icon",eyebrow:"Menu eyebrow ({ close })",title:"Menu title ({ close })",subtitle:"Menu subtitle ({ close })",header:"Header custom ({ close })",content:"Custom content ({ close })",body:"Alias of content ({ close })",item:"Custom item body ({ item, close })",itemTitle:"Item title ({ item, close })",itemSubtitle:"Item subtitle ({ item, close })",itemBadge:"Item badge ({ item, close })",itemShortcut:"Item shortcut ({ item, close })",groupLabel:"Group label ({ item, close })",empty:"Empty state ({ close })",status:"Status row ({ close })",footer:"Footer actions ({ close })",after:"Region below body/footer ({ close })",default:"Fallback content ({ close })"},events:{onOpen:"void",onClose:"void",onItemClick:"item click"},returns:"Object { open(), close(), show(), hide(), toggle(), update(), bind(), isOpen() }",description:"Standardized menu overlay with item model, rich slots, bindable triggers, header/footer, and imperative API."}),v.Popover=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},i=["primary","secondary","warning","danger","success","info","light","dark"],c=["xs","sm","md","lg","xl"];let y={...e},a=null,l=null,b=null,R=null,C=null;const w=(A,u)=>Object.prototype.hasOwnProperty.call(A||{},u),T=(A,u)=>typeof A=="function"?A(u):A,ee=A=>String(A||"").split(/\s+/).filter(Boolean),K=A=>A&&typeof A=="object"&&!A.nodeType&&!Array.isArray(A)&&!(A instanceof Function),re=A=>!!A&&typeof A=="object"&&(A.nodeType===1||typeof A.getBoundingClientRect=="function"),H=()=>{clearTimeout(R),clearTimeout(C),R=null,C=null},j=(A,u,k)=>{if(!A)return;const I=A[u]||[];I.length&&A.classList.remove(...I);const B=(k||[]).filter(Boolean);B.length&&A.classList.add(...B),A[u]=B},Y=(A,u,k,I=B=>B)=>{if(A){if(k==null||k===""){A.style.removeProperty(u);return}A.style.setProperty(u,I(k))}},W=()=>y,ie=A=>{var k;const u=o((k=A.state)!=null?k:A.color);return u?i.includes(u)?u:String(u):""},ge=A=>{const u=o(A.size);return typeof u=="string"&&c.includes(u)?u:""},ce=A=>{var k,I,B;const u=String(o((B=(I=(k=A.actionsAlign)!=null?k:A.footerAlign)!=null?I:A.alignActions)!=null?B:"end")).toLowerCase();return["start","left"].includes(u)?"start":["center","middle"].includes(u)?"center":["between","space-between"].includes(u)?"between":["stretch","full"].includes(u)?"stretch":"end"},le=A=>{var u,k;return String(o((k=(u=A.placement)!=null?u:A.position)!=null?k:"bottom-start"))},oe=(A,u)=>{const k=o(A);if(k==null||k==="")return u;const I=Number(k);return Number.isFinite(I)?I:u},ne=()=>oe(W().delay,0),J=()=>oe(W().hideDelay,120),Z=A=>{var k,I;return((I=(k=A.closable)!=null?k:A.dismissible)!=null?I:A.closeButton)===!0},X=(A=null)=>{var k,I,B;if(A)return A;const u=W();return l||o((B=(I=(k=u.anchorEl)!=null?k:u.triggerEl)!=null?I:u.target)!=null?B:u.anchor)||null},ue=A=>{if(A==null||A===!0)return new Set(["click"]);if(A===!1)return new Set(["manual"]);const u=Array.isArray(A)?A:String(A).split(/[\s,|/]+/),k=new Set;return u.forEach(I=>{const B=String(I||"").trim().toLowerCase();B&&(B==="mouseenter"||B==="mouseover"?k.add("hover"):B==="blur"||B==="focusin"?k.add("focus"):B==="tap"?k.add("click"):k.add(B))}),k.size?k:new Set(["manual"])},F=(A,u)=>{var B,pe,Se;let k=null,I=null;if(re(A))k=A,K(u)&&(I=u);else if(K(A)){I=A;const ye=(Se=(pe=(B=A.anchorEl)!=null?B:A.triggerEl)!=null?pe:A.target)!=null?Se:A.anchor;re(ye)&&(k=ye)}else A!=null&&(k=A);return{anchorEl:k,nextProps:I}},f=()=>{var be,Ce,he,Le,Ae,z,we,M,N;const A=W(),u={close:O,dismiss:O,open:r,toggle:P,update:Q,isOpen:U,entry:()=>a,anchorEl:X(),props:A},k=A.icon!=null?typeof A.icon=="string"?v.Icon({name:A.icon,size:A.iconSize||"md"}):JSswift.ui.slot(A.icon,{as:"icon"}):null,I=E(s,"eyebrow",u,T(A.eyebrow,u)),B=E(s,"title",u,T((Ce=(be=A.title)!=null?be:A.heading)!=null?Ce:A.label,u)),pe=E(s,"subtitle",u,T((he=A.subtitle)!=null?he:A.description,u)),Se=E(s,"icon",u,k),ye=E(s,"header",u,T((Ae=(Le=A.headerContent)!=null?Le:A.head)!=null?Ae:A.header,u)),V=Z(A)?E(s,"close",u,v.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":A.closeLabel||"Chiudi popover","data-popover-close":!0},v.Icon({name:A.closeIcon||"close",size:"sm"}))):[];let D=(M=(we=(z=A.content)!=null?z:A.body)!=null?we:A.message)!=null?M:A.text;D==null&&n&&n.length&&(D=n);let q=E(s,"content",u,T(D,u));q.length||(q=E(s,"body",u,T(D,u))),q.length||(q=E(s,"default",u,T(D,u)));const Ne=T((N=A.footer)!=null?N:A.actions,u);let ke=E(s,"footer",u,Ne);ke.length||(ke=E(s,"actions",u,Ne));let te=null;ye.length?te=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...ye):(I.length||B.length||pe.length||Se.length||V.length)&&(te=_.div({class:"cms-dialog-head"},Se.length?_.div({class:"cms-dialog-icon"},...Se):null,_.div({class:"cms-dialog-head-main"},I.length?_.div({class:"cms-dialog-eyebrow"},...I):null,B.length?_.div({class:"cms-dialog-title"},...B):null,pe.length?_.div({class:"cms-dialog-subtitle"},...pe):null),V.length?_.div({class:"cms-dialog-close-wrap"},...V):null));const xe=[];return te&&xe.push(te),q.length&&xe.push(_.div({class:ae(["cms-dialog-body",A.bodyClass])},...q)),ke.length&&xe.push(_.div({class:ae(["cms-dialog-actions",`is-${ce(A)}`,me(A.stackActions,"is-stacked"),A.actionsClass,A.footerClass])},...ke)),xe.length||xe.push(_.div({class:ae(["cms-dialog-body",A.bodyClass])})),_.div({class:ae(["cms-dialog-shell","cms-popover-shell",me(!!te,"has-head"),me(ke.length>0,"has-footer"),me(A.divider!==!1,"with-divider")])},...xe)},m=A=>{var B;if(!(A!=null&&A.panel))return;const u=W(),k=ie(u),I=ge(u);j(A.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",I?`cms-dialog-${I}`:"",k,k?`cms-state-${k}`:"",o(u.scrollable)?"scrollable":"",o(u.stickyHeader)?"sticky-head":"",o(u.stickyActions)?"sticky-actions":"",o(u.borderless)?"borderless":"",...ee(u.class),...ee(u.panelClass)]),j(A.overlay,"_popoverOverlayClassTokens",[...ee(u.overlayClass)]),A.panel.dataset.placement=le(u),Y(A.panel,"--cms-dialog-width",o(u.width),$e),Y(A.panel,"--cms-dialog-min-width",o(u.minWidth),$e),Y(A.panel,"--cms-dialog-max-width",o(u.maxWidth),$e),Y(A.panel,"--cms-dialog-max-height",o(u.maxHeight),$e),Y(A.panel,"--cms-dialog-body-max-height",o((B=u.bodyMaxHeight)!=null?B:u.contentMaxHeight),$e),u.style&&Object.assign(A.panel.style,u.style),Ke(A.panel,u),A.panel.setAttribute("role",u.role||"dialog"),A.panel.setAttribute("aria-modal",u.modal===!0?"true":"false"),u.ariaLabel?A.panel.setAttribute("aria-label",u.ariaLabel):A.panel.removeAttribute("aria-label")},g=()=>{a!=null&&a.panel&&a.panel.replaceChildren(f())},O=()=>{if(H(),!a)return;const A=a;a=null,wn(A,()=>JSswift.overlay.close(A.id))},Q=(A={})=>(A&&typeof A=="object"&&(y={...y,...A}),a&&(m(a),g()),de),r=(A=null,u=null)=>{var xe,be,Ce,he,Le,Ae,z,we;H();const{anchorEl:k,nextProps:I}=F(A,u);I&&(y={...y,...I});const B=W(),pe=X(k);if(!pe||o(B.disabled))return null;if(a&&a._anchorEl===pe)return m(a),g(),a;a&&O(),b=document.activeElement;const Se=ue((be=(xe=B.trigger)!=null?xe:B.triggers)!=null?be:w(B,"open")?"manual":null),ye=Se.has("hover"),V=Se.has("focus");let D=null;if(a=JSswift.overlay.open(()=>f(),{type:"popover",anchorEl:pe,placement:le(B),offsetX:(Ce=B.offsetX)!=null?Ce:0,offsetY:(Le=(he=B.offsetY)!=null?he:B.offset)!=null?Le:10,backdrop:B.backdrop===!0,lockScroll:B.lockScroll===!0,trapFocus:B.trapFocus===!0,autoFocus:B.autoFocus===!0,closeOnOutside:B.closeOnOutside!==!1,closeOnBackdrop:(Ae=B.closeOnBackdrop)!=null?Ae:B.backdrop===!0,closeOnEsc:B.closeOnEsc!==!1,className:Ht(["cms-dialog","cms-popover"]),onClose:()=>{var M,N,S;(M=D==null?void 0:D._popoverCleanup)==null||M.call(D),(S=(N=W()).onClose)==null||S.call(N,D),W().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(a!=null&&a.panel))return a;const q=a;D=q,q._anchorEl=pe;const Ne=()=>{clearTimeout(C),C=null},ke=()=>{!ye&&!V||p()},te=M=>{const N=M.target;if(!(!N||!N.closest)){if(N.closest("[data-popover-close]")||N.closest("[data-dialog-close]")){O();return}W().closeOnSelect===!0&&N.closest("[data-popover-select]")&&O()}};return q.panel.addEventListener("click",te),(ye||V)&&(q.panel.addEventListener("mouseenter",Ne),q.panel.addEventListener("mouseleave",ke),q.panel.addEventListener("focusin",Ne),q.panel.addEventListener("focusout",ke)),q._popoverCleanup=()=>{var M,N,S,d,L;(M=q.panel)==null||M.removeEventListener("click",te),(N=q.panel)==null||N.removeEventListener("mouseenter",Ne),(S=q.panel)==null||S.removeEventListener("mouseleave",ke),(d=q.panel)==null||d.removeEventListener("focusin",Ne),(L=q.panel)==null||L.removeEventListener("focusout",ke)},m(q),yn(q),(we=(z=W()).onOpen)==null||we.call(z,q),q},x=(A,u=null)=>{clearTimeout(C),C=null,clearTimeout(R),R=setTimeout(()=>r(A,u),ne())},p=(A=!1)=>{if(clearTimeout(R),R=null,!!a){if(clearTimeout(C),A){O();return}C=setTimeout(()=>O(),J())}},P=(A=null,u=null)=>U()?(O(),null):r(A,u),U=()=>!!a,de={open:r,close:O,show:x,hide:p,toggle:P,update:Q,bind:A=>{var D,q;if(!A)return()=>{};l=A;const u=W(),k=ue((q=(D=u.trigger)!=null?D:u.triggers)!=null?q:w(u,"open")?"manual":null),I=k.has("hover"),B=k.has("focus"),pe=k.has("click"),Se=k.has("manual")||!I&&!B&&!pe,ye=[],V=()=>{H(),ye.forEach(Ne=>Ne()),l===A&&(l=null)};if(w(u,"open"))return rt(u.open)?JSswift.reactive.effect(()=>{l&&(o(W().open)?r(l):p(!0))},"UI.Popover:open"):u.open===!0?r(A):u.open===!1&&p(!0),V;if(Se||o(u.disabled))return V;if(I){const Ne=()=>x(A),ke=()=>p();A.addEventListener("mouseenter",Ne),A.addEventListener("mouseleave",ke),ye.push(()=>{A.removeEventListener("mouseenter",Ne),A.removeEventListener("mouseleave",ke)})}if(B){const Ne=()=>x(A),ke=()=>p();A.addEventListener("focus",Ne),A.addEventListener("blur",ke),ye.push(()=>{A.removeEventListener("focus",Ne),A.removeEventListener("blur",ke)})}if(pe){const Ne=ke=>{var te,xe;(xe=(te=W()).onTriggerClick)==null||xe.call(te,ke),!ke.defaultPrevented&&P(A)};A.addEventListener("click",Ne),ye.push(()=>A.removeEventListener("click",Ne))}return V},isOpen:U,entry:()=>a,props:()=>({...y})};return de},(Ei=JSswift.isDev)!=null&&Ei.call(JSswift)&&(v.meta=v.meta||{},v.meta.Popover={signature:"UI.Popover(props) | UI.Popover(props, ...children) -> { open, close, show, hide, toggle, update, bind, isOpen }",props:{title:"String|Node|Function|Array|({ close })=>Node",subtitle:"String|Node|Function|Array|({ close })=>Node",eyebrow:"String|Node|Function|Array|({ close })=>Node",icon:"String|Node|Function|Array",content:"Node|Function|Array|({ close })=>Node",body:"Alias of content",actions:"Node|Function|Array|({ close })=>Node",footer:"Alias of actions",size:"xs|sm|md|lg|xl",state:"primary|secondary|warning|danger|success|info|light|dark",color:"Alias of state",trigger:"click|hover|focus|manual|Array",placement:"string",offsetX:"number",offsetY:"number",offset:"Alias of offsetY",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",contentMaxHeight:"Alias of bodyMaxHeight",backdrop:"boolean",lockScroll:"boolean",trapFocus:"boolean",autoFocus:"boolean",closeButton:"boolean",closable:"boolean",closeOnSelect:"boolean",closeOnOutside:"boolean",closeOnBackdrop:"boolean",closeOnEsc:"boolean",open:"boolean|rod|signal",anchorEl:"HTMLElement|VirtualAnchor",triggerEl:"Alias of anchorEl",target:"Alias of anchorEl",slots:"{ icon?, eyebrow?, title?, subtitle?, header?, content?, body?, footer?, actions?, close?, default? }",class:"string",panelClass:"string",overlayClass:"string",style:"object",onOpen:"function",onClose:"function",onTriggerClick:"function"},slots:{icon:"Popover icon",eyebrow:"Popover eyebrow ({ close })",title:"Popover title ({ close })",subtitle:"Popover subtitle ({ close })",header:"Header custom ({ close })",content:"Popover body ({ close })",body:"Alias of content ({ close })",footer:"Popover footer ({ close })",actions:"Alias of footer ({ close })",close:"Close button slot ({ close })",default:"Fallback body ({ close })"},events:{onOpen:"void",onClose:"void"},returns:"Object { open(), close(), show(), hide(), toggle(), update(), bind(), isOpen() }",description:"Standardized anchored popover with rich layout, complete slots, bindable triggers, and imperative API."}),v.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},i=null,c=null,y=null;const a=g=>g&&typeof g=="object"&&!g.nodeType&&!Array.isArray(g)&&!(g instanceof Function),l=g=>!!g&&typeof g=="object"&&(g.nodeType===1||typeof g.getBoundingClientRect=="function"),b=g=>!!g&&typeof g=="object"&&("clientX"in g||"type"in g||"target"in g||"currentTarget"in g),R=g=>!!g&&Number.isFinite(Number(g.x))&&Number.isFinite(Number(g.y)),C=()=>s,w=(g,O)=>{const Q=Number(g),r=Number(O);return!Number.isFinite(Q)||!Number.isFinite(r)?null:{x:Q,y:r}},T=g=>g?{_cmsContextPoint:g,getBoundingClientRect:()=>({top:g.y,bottom:g.y,left:g.x,right:g.x,width:0,height:0})}:null,ee=g=>{if(!l(g))return null;const O=g.getBoundingClientRect();return w(O.left+Math.min(O.width/2,24),O.top+Math.min(O.height/2,24))},K=g=>{var O,Q,r,x;return o((x=(r=(Q=(O=g==null?void 0:g.anchorEl)!=null?O:g==null?void 0:g.triggerEl)!=null?Q:g==null?void 0:g.target)!=null?r:g==null?void 0:g.anchor)!=null?x:null)},re=(g,O=null)=>{if(!g)return ee(O||y);const Q=w(g.clientX,g.clientY);if(Q)return Q;const r=K({anchorEl:O||g.currentTarget||g.target||y});return ee(r)},H=(g={})=>{if(!a(g))return{};const O={...g};return delete O.event,delete O.point,delete O.x,delete O.y,O},j=()=>{var O,Q,r;const g=C();return{...g,trigger:"manual",placement:g.placement||"bottom-start",offsetX:(O=g.offsetX)!=null?O:0,offsetY:(r=(Q=g.offsetY)!=null?Q:g.offset)!=null?r:4,closeOnOutside:g.closeOnOutside!==!1,closeOnEsc:g.closeOnEsc!==!1,role:g.role||"menu",ariaLabel:g.ariaLabel||g.title||"Context menu",class:ae(["cms-context-menu-shell",g.class]),panelClass:ae(["cms-context-menu-panel",g.panelClass])}},Y=v.Menu(j(),...n),W=(g=null,O=null,Q=null)=>{let r=null,x=null,p=null;if(b(g))r=re(g,y),p=a(O)?H(O):null;else if(typeof g=="number"||typeof O=="number")r=w(g,O),p=a(Q)?H(Q):null;else if(R(g))r=w(g.x,g.y),p=a(O)?H(O):null;else if(l(g))x=g,p=a(O)?H(O):null;else if(a(g)){const P=R(g.point)?g.point:R(g)?g:null,U=K(g),G=g.event;r=P?w(P.x,P.y):re(G,U||y),x=U&&l(U)?U:null,p={...H(g),...a(O)?H(O):{}}}else i&&(r={...i});return{point:r,anchor:x,nextProps:p}},ie=(g,O=null)=>{c=g||c,i=O||g&&g._cmsContextPoint||i},ge=(g=null)=>{a(g)&&Object.keys(g).length&&(s={...s,...g})},ce=(g=null,O=null)=>{if(O)return T(O);if(g&&l(g))return g;const Q=K(C());return l(Q)?Q:i?T(i):l(c)?c:l(y)?y:null},le=(g=null,O=null,Q=null)=>{const{point:r,anchor:x,nextProps:p}=W(g,O,Q);ge(p);const P=ce(x,r);return P?(ie(P,r),Y.open(P,j())):null},oe=(g,O,Q=null)=>le(g,O,Q),ne=(g,O=null)=>le(g,O),J=()=>(Y.close(),m),Z=(g=!0)=>(g===!1?Y.hide(!1):Y.close(),m),X=(g=null,O=null,Q=null)=>le(g,O,Q),ue=(g=null,O=null,Q=null)=>Y.isOpen()?(J(),null):le(g,O,Q),F=(g={})=>(ge(H(g)),Y.update(j()),m),m={open:le,openAt:oe,openFromEvent:ne,show:X,hide:Z,close:J,toggle:ue,update:F,bind:(g,O=null)=>{if(!g)return()=>{};const Q=a(O)?H(O):null,r=p=>{var U,G;y=g,p.preventDefault(),!(((G=(U=C()).onTrigger)==null?void 0:G.call(U,p,{element:g,open:le,close:J,update:F}))===!1||o(C().disabled))&&le({event:p,anchorEl:g},Q)},x=p=>{var U,G;p.key!=="ContextMenu"&&!(p.shiftKey&&p.key==="F10")||(y=g,p.preventDefault(),((G=(U=C()).onTrigger)==null?void 0:G.call(U,p,{element:g,open:le,close:J,update:F}))===!1||o(C().disabled))||le({event:p,anchorEl:g},Q)};return g.addEventListener("contextmenu",r),g.addEventListener("keydown",x),()=>{g.removeEventListener("contextmenu",r),g.removeEventListener("keydown",x)}},isOpen:Y.isOpen,entry:Y.entry,props:()=>({...s})};return m},(Mi=JSswift.isDev)!=null&&Mi.call(JSswift)&&(v.meta=v.meta||{},v.meta.ContextMenu={signature:"UI.ContextMenu(props) | UI.ContextMenu(props, ...children) -> { open, openAt, openFromEvent, show, hide, close, toggle, update, bind, isOpen }",props:{title:"String|Node|Function|Array|({ close })=>Node",subtitle:"String|Node|Function|Array|({ close })=>Node",eyebrow:"String|Node|Function|Array|({ close })=>Node",icon:"String|Node|Function|Array",content:"Node|Function|Array|({ close })=>Node",body:"Alias of content",items:"Array<string|object>|Function|Array",before:"Node|Function|Array",after:"Node|Function|Array",footer:"Node|Function|Array",status:"Node|Function|Array",empty:"Node|Function|Array",size:"xs|sm|md|lg|xl",state:"primary|secondary|warning|danger|success|info|light|dark",color:"Alias of state",placement:"string",offsetX:"number",offsetY:"number",offset:"Alias of offsetY",width:"string|number",minWidth:"string|number",maxWidth:"string|number",maxHeight:"string|number",bodyMaxHeight:"string|number",contentMaxHeight:"Alias of bodyMaxHeight",closeOnSelect:"boolean",closeOnOutside:"boolean",closeOnEsc:"boolean",anchorEl:"HTMLElement|VirtualAnchor",triggerEl:"Alias of anchorEl",target:"Alias of anchorEl",slots:"{ before?, icon?, eyebrow?, title?, subtitle?, header?, content?, body?, item?, itemTitle?, itemSubtitle?, itemBadge?, itemShortcut?, groupLabel?, empty?, status?, footer?, after?, default? }",class:"string",panelClass:"string",overlayClass:"string",style:"object",panelStyle:"object",onOpen:"function",onClose:"function",onItemClick:"(item, ctx, event) => void",onTrigger:"(event, ctx) => boolean|void"},slots:{before:"Region above header/body ({ close })",icon:"Context icon",eyebrow:"Context eyebrow ({ close })",title:"Context title ({ close })",subtitle:"Context subtitle ({ close })",header:"Header custom ({ close })",content:"Context menu content ({ close })",body:"Alias of content ({ close })",item:"Custom item body ({ item, close })",itemTitle:"Item title ({ item, close })",itemSubtitle:"Item subtitle ({ item, close })",itemBadge:"Item badge ({ item, close })",itemShortcut:"Item shortcut ({ item, close })",groupLabel:"Group label ({ item, close })",empty:"Empty state ({ close })",status:"Status row ({ close })",footer:"Footer actions ({ close })",after:"Region below body/footer ({ close })",default:"Fallback content ({ close })"},events:{onOpen:"void",onClose:"void",onItemClick:"item click",onTrigger:"contextmenu / keyboard trigger"},returns:"Object { open(), openAt(), openFromEvent(), show(), hide(), close(), toggle(), update(), bind(), isOpen() }",description:"Menu specialization for right-click and context-menu key interactions, with items, rich slots, runtime overrides, and coordinate-based positioning."})})(JSswift);
34
+ `,document.head.appendChild(C),kt._textNode=n,kt._spinner=e,kt._progressWrap=s,kt._progressBar=o,kt._progressActive=!1,kt}function bl(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 yl(t,e){const n=e==="progress";t._spinner.style.display=n?"none":"",t._progressWrap.style.display=n?"block":"none",t._mode=e}He.loading.show=function(t="Loading...",e={}){const n=pl(),s=bl(t,e);In++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",yl(n,"spinner"),s.spinner===!1&&(n._spinner.style.display="none"),n.style.display="flex"},He.loading.hide=function(){kt&&(In=Math.max(0,In-1),In===0&&(kt.style.display="none",kt._progressActive=!1))},He.loading.progress=function(t=0,e={}){var r;const n=pl();typeof t=="object"&&t!==null&&(e=t,t=(r=t.value)!=null?r:0);const s=bl(null,e);n._progressActive||(In++,n._progressActive=!0);const o=Math.max(0,Math.min(100,Number(t!=null?t:0)));n._textNode.textContent=s.message||"Loading...",n._progressBar.style.width=o+"%",yl(n,"progress"),n.style.display="flex"},He.loading.wrap=async function(t,e){He.loading.show(t);try{return await e()}finally{He.loading.hide()}};function Ko(t){return typeof t=="function"?t():t||[]}function Ss(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 Yo(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 qo(t){const e=Ko(t);return Array.isArray(e)?e:[]}function wl(t){var e,n,s,o;return(o=(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?o:""}function Cs(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 vl(t,e){return t.find((n,s)=>Cs(n,s)===e||(n==null?void 0:n.key)===e)||null}function qn(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"?Ss(e,t.key):t.key!=null?e==null?void 0:e[t.key]:e:e}function Xn(t,e){return typeof t=="function"?t(e)||{}:t||{}}function Qn(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(Qn).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 Xo(t,e){const s=(Array.isArray(t)?t:e).map(o=>Number(o)).filter(o=>Number.isFinite(o)&&o>0);return s.length?Array.from(new Set(s)):e}function Qo(t,e,n,s){const o=s.searchBy||s.searchPredicate;if(typeof o=="function")return!!o(t,{query:n,columns:e});const r=String(n||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(!r.length)return!0;const C=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(y=>(y==null?void 0:y.searchable)!==!1).map(y=>{var R;return(R=y==null?void 0:y.searchKey)!=null?R:y==null?void 0:y.key}).filter(Boolean),u=[];if(C.length)for(const y of C)if(typeof y=="function")u.push(Qn(y(t)));else{const R=e.find(v=>(v==null?void 0:v.key)===y||(v==null?void 0:v.searchKey)===y);u.push(Qn(R?qn(R,t,-1):Ss(t,y)))}else u.push(Qn(t));const i=u.join(" ").toLowerCase();return r.every(y=>i.includes(y))}he.Table=(...t)=>{var Ne,ee,xe,be;const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=Array.isArray(e.columns)?e.columns:[],r=Xo(e.pageSizeOptions,[5,10,20,50]),C=Number((ee=(Ne=e.pageSize)!=null?Ne:r[0])!=null?ee:10)||10,u=Array.from(new Set([...r,C])).sort((Ce,pe)=>Ce-pe),i=e.initialSort||(e.sortBy?{key:e.sortBy,dir:e.sortDir==="desc"?"desc":"asc"}:null),y=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",R=Nt(e.searchModel||e.queryModel,"UI.Table:query"),[v,b]=He.reactive.signal(Math.max(1,Number(e.page||1)||1)),[P,Z]=He.reactive.signal(C),[G,ie]=He.reactive.signal(i),[D,$]=He.reactive.signal(String((be=R?R.get():(xe=e.search)!=null?xe:e.query)!=null?be:"")),Y=Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),R&&R.set(pe),b(1)},W=Ce=>{const pe=Number(Ce)||C;Z(pe),b(1)},le=(Ce,pe)=>{const Ie=Cs(Ce,pe),_e=G();!_e||_e.key!==Ie&&_e.key!==(Ce==null?void 0:Ce.key)?ie({key:Ie,dir:"asc"}):_e.dir==="asc"?ie({key:Ie,dir:"desc"}):ie(null),b(1)};let me=null;R&&R.watch(Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),me&&me.value!==pe&&(me.value=pe),b(1)},"UI.Table:queryWatch");const re=JSswift.omit(e,["columns","rows","rowKey","loading","page","pageSize","pageSizeOptions","pagination","initialSort","sortBy","sortDir","search","query","searchable","searchPlaceholder","searchKeys","searchBy","searchPredicate","searchModel","queryModel","filter","actions","actionsLabel","emptyText","loadingText","onRowClick","onRowDblClick","tableClass","tableStyle","cardClass","dense","striped","hover","stickyHeader","toolbar","toolbarStart","toolbarEnd","caption","footer","status","rowClass","rowAttrs","minTableWidth","hideHeader","hideFooter","slots","body"]);re.class=ae(["cms-table-card",e.class,e.cardClass]),e.dense!=null&&(re.dense=e.dense);const oe=_.div({class:"cms-table-shell"}),se=E(s,"default",{},n);se.length&&oe.appendChild(_.div({class:"cms-table-lead"},...se));const te=E(s,"toolbarStart",{},e.toolbarStart),M=E(s,"toolbar",{},e.toolbar),Q=E(s,"toolbarEnd",{},e.toolbarEnd),q=_.div({class:"cms-table-toolbar"}),ue=_.div({class:"cms-table-toolbar-main"}),L=_.div({class:"cms-table-toolbar-side"});te.forEach(Ce=>ue.appendChild(Ce)),M.forEach(Ce=>ue.appendChild(Ce));const f=E(s,"search",{query:D(),getQuery:D,setQuery:Y},null);if(f.length)f.forEach(Ce=>L.appendChild(Ce));else if(y){me=_.input({type:"search",class:"cms-input",placeholder:typeof e.searchable=="string"?e.searchable:e.searchPlaceholder||"Cerca nella tabella",value:String(D()||"")}),me.addEventListener("input",()=>Y(me.value));const Ce=he.Btn({class:"cms-table-search-clear",outline:!0,onClick:()=>{me&&(me.value=""),Y("")}},"Reset");L.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),me,Ce))}Q.forEach(Ce=>L.appendChild(Ce)),(ue.childNodes.length||L.childNodes.length)&&(q.appendChild(ue),q.appendChild(L),oe.appendChild(q));const m=_.div({class:"cms-singularity cms-table-chip"},""),g=_.div({class:"cms-singularity cms-table-chip"},""),F=_.div({class:"cms-singularity cms-table-chip"},""),X=E(s,"status",{},e.status),a=_.div({class:"cms-table-status"},m,g,F,...X);oe.appendChild(a);const S=E(s,"caption",{},e.caption);S.length&&oe.appendChild(_.div({class:"cms-table-caption"},...S));const h=_.thead(),J=_.tbody(),j=!!e.actions||!!s.actions,U=ae(["cms-table",fe(e.dense,"dense"),fe(e.striped,"striped"),fe(e.hover!==!1,"hover"),fe(e.stickyHeader!==!1,"sticky-head"),e.tableClass]),ce={...e.tableStyle||{}};e.minTableWidth!=null&&(ce["--cms-table-min-width"]=Be(e.minTableWidth));const k=_.table({class:U,style:ce},h,J),d=_.div({class:"cms-singularity cms-table-wrap"},k);oe.appendChild(d);const N=_.div({class:"cms-singularity cms-table-chip"},""),I=_.div({class:"cms-singularity cms-table-chip"},""),H=he.Btn({outline:!0,onClick:()=>b(Math.max(1,v()-1))},"\u2039"),ge=he.Btn({outline:!0,onClick:()=>b(v()+1)},"\u203A"),Se=_.div({class:"cms-singularity cms-table-chip"},""),ye=_.select({class:"cms-input cms-table-size-select"},...u.map(Ce=>us({value:String(Ce)},String(Ce))));ye.value=String(P()),ye.addEventListener("change",()=>W(ye.value));const V=E(s,"footer",{},e.footer),O=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},N,I,_.label({class:"cms-table-size"},_.span("Righe"),ye)),_.div({class:"cms-table-foot-extra"},...V,_.div({class:"cms-table-pager"},H,Se,ge)));e.hideFooter!==!0&&oe.appendChild(O);const K=()=>{if(h.innerHTML="",e.hideHeader)return;const Ce=_.tr();if(o.forEach((pe,Ie)=>{var de,Le;const _e={col:pe,colIndex:Ie,sort:G()},z={...Xn(pe==null?void 0:pe.style,{..._e,header:!0}),...Xn((de=pe==null?void 0:pe.headerStyle)!=null?de:pe==null?void 0:pe.thStyle,{..._e,header:!0})};(pe==null?void 0:pe.width)!=null&&(z.width=Be(pe.width)),(pe==null?void 0:pe.minWidth)!=null&&(z.minWidth=Be(pe.minWidth)),(pe==null?void 0:pe.maxWidth)!=null&&(z.maxWidth=Be(pe.maxWidth)),pe!=null&&pe.align&&(z.textAlign=pe.align);let we=E(pe==null?void 0:pe.slots,"header",_e,null);if(!we.length){const Je=typeof(pe==null?void 0:pe.header)=="function"?pe.header(_e):(Le=pe==null?void 0:pe.header)!=null?Le:wl(pe);we=E(s,"header",_e,Je)}const T=G(),x=Cs(pe,Ie),w=(pe==null?void 0:pe.sortable)!==!1&&((pe==null?void 0:pe.key)!=null||typeof(pe==null?void 0:pe.get)=="function"||typeof(pe==null?void 0:pe.compare)=="function"),c=!!T&&(T.key===x||T.key===(pe==null?void 0:pe.key)),A=_.th({class:ae(["cms-table-head-cell",fe(pe==null?void 0:pe.nowrap,"is-nowrap"),fe(w,"cms-table-sortable"),fe(c,"is-sorted"),pe==null?void 0:pe.headerClass]),style:z});w?A.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>le(pe,Ie)},_.span({class:"cms-table-head-label"},...we),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},c?T.dir==="asc"?"\u2191":"\u2193":"\u2195"))):we.forEach(Je=>A.appendChild(Je)),Ce.appendChild(A)}),j){const pe=E(s,"actionsHeader",{},e.actionsLabel||"Azioni");Ce.appendChild(_.th({class:"cms-table-head-cell cms-table-head-actions",style:{textAlign:"right"}},...pe))}h.appendChild(Ce)},ke=(Ce,pe)=>{const Ie={columns:o,count:o.length},_e=E(s,Ce,Ie,pe),z=String(o.length+(j?1:0));J.appendChild(_.tr(_.td({colSpan:z,class:"cms-table-state"},..._e)))};return He.reactive.effect(()=>{const Ce=qo(e.rows),pe=String(D()||"").trim(),Ie=G(),_e=typeof e.loading=="function"?!!e.loading():!!e.loading,z=e.pagination!==!1;if(K(),J.innerHTML="",me&&me.value!==D()&&(me.value=D()),ye.value!==String(P())&&(ye.value=String(P())),_e){m.textContent="Caricamento in corso",g.style.display="none",F.style.display="none",N.textContent="Loading\u2026",I.textContent="",Se.textContent="Pagina 1",H.disabled=!0,ge.disabled=!0,ke("loading",e.loadingText||"Loading...");return}let we=Ce.slice();const T=we.length;if(typeof e.filter=="function"&&(we=we.filter((B,Ae)=>e.filter(B,{row:B,index:Ae,query:pe,rows:Ce,columns:o}))),pe&&(we=we.filter(B=>Qo(B,o,pe,e))),Ie){const B=vl(o,Ie.key);B&&we.sort((Ae,Me)=>{const Ee=qn(B,Ae,-1),De=qn(B,Me,-1),Ue=typeof B.compare=="function"?B.compare(Ee,De,Ae,Me):Yo(Ee,De);return Ie.dir==="asc"?Ue:-Ue})}const x=we.length,w=Math.max(1,Number(P())||C),c=z?Math.max(1,Math.ceil(x/w)):1,A=z?Math.min(v(),c):1;A!==v()&&b(A);const de=z?(A-1)*w:0,Le=z?de+w:x,Je=we.slice(de,Le);if(m.textContent=x===T?`${x} righe`:`${x} di ${T} righe`,g.textContent=pe?`Ricerca: ${pe}`:"",g.style.display=pe?"":"none",Ie){const B=vl(o,Ie.key);F.textContent=B?`Ordine: ${wl(B)} ${Ie.dir==="asc"?"\u2191":"\u2193"}`:"",F.style.display=B?"":"none"}else F.style.display="none";if(N.textContent=x?`${de+1}-${Math.min(Le,x)} di ${x}`:"0 risultati",I.textContent=x!==T?`Dataset totale ${T}`:`Page size ${w}`,Se.textContent=z?`Pagina ${A} / ${c}`:"Tutte le righe",H.disabled=!z||A<=1,ge.disabled=!z||A>=c,ye.disabled=!z,ye.parentNode.style.display=z?"":"none",Je.length===0){ke("empty",e.emptyText||"Nessun dato");return}for(let B=0;B<Je.length;B++){const Ae=Je[B],Me=de+B,Ee={row:Ae,rowIndex:Me,pageIndex:B},De=typeof e.rowAttrs=="function"?e.rowAttrs(Ae,Ee)||{}:e.rowAttrs||{},Ue=typeof e.rowClass=="function"?e.rowClass(Ae,Ee):e.rowClass,Ye=!!(e.onRowClick||e.onRowDblClick),Ze=_.tr({...De,class:ae(["cms-table-row",Ue,De.class,fe(Ye,"is-clickable")])});if(e.rowKey){const Te=typeof e.rowKey=="function"?e.rowKey(Ae,Ee):Ss(Ae,e.rowKey);Te!=null&&(Ze.dataset.key=String(Te))}const Qe=Te=>{const je=Te==null?void 0:Te.target;return!!(je&&je.closest&&je.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(e.onRowClick&&Ze.addEventListener("click",Te=>{Qe(Te)||e.onRowClick(Ae,Ee,Te)}),e.onRowDblClick&&Ze.addEventListener("dblclick",Te=>{Qe(Te)||e.onRowDblClick(Ae,Ee,Te)}),o.forEach((Te,je)=>{var ft,vt;const tt=qn(Te,Ae,Me),nt={...Ee,col:Te,colIndex:je,value:tt},ut={...Xn(Te==null?void 0:Te.style,nt),...Xn((ft=Te==null?void 0:Te.cellStyle)!=null?ft:Te==null?void 0:Te.tdStyle,nt)};Te!=null&&Te.align&&(ut.textAlign=Te.align),(Te==null?void 0:Te.width)!=null&&(ut.width=Be(Te.width)),(Te==null?void 0:Te.minWidth)!=null&&(ut.minWidth=Be(Te.minWidth)),(Te==null?void 0:Te.maxWidth)!=null&&(ut.maxWidth=Be(Te.maxWidth));const dt=typeof(Te==null?void 0:Te.cellClass)=="function"?Te.cellClass(Ae,nt):(Te==null?void 0:Te.cellClass)||(Te==null?void 0:Te.class),bt=_.td({class:ae(["cms-table-cell",dt,fe(Te==null?void 0:Te.nowrap,"is-nowrap")]),style:ut});let lt=E(Te==null?void 0:Te.slots,"cell",nt,null);if(!lt.length){const _t=typeof(Te==null?void 0:Te.render)=="function"?Te.render(Ae,nt):typeof(Te==null?void 0:Te.format)=="function"?Te.format(tt,Ae,nt):tt,rt=_t==null?(vt=Te==null?void 0:Te.emptyText)!=null?vt:"":_t;lt=E(s,"cell",nt,rt)}lt.length||(lt=[""]),lt.forEach(_t=>bt.appendChild(_t)),Ze.appendChild(bt)}),j){const Te={...Ee},je=typeof e.actions=="function"?e.actions(Ae,Ee):e.actions;let tt=E(s,"actions",Te,je);tt.length||(tt=E(null,"default",Te,je)),Ze.appendChild(_.td({class:"cms-table-cell cms-table-cell-actions",style:{textAlign:"right"}},_.div({class:"cms-table-actions"},...tt)))}J.appendChild(Ze)}},"UI.Table:render"),re.body=oe,he.Card(re)},he.Menu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=["primary","secondary","warning","danger","success","info","light","dark"],r=["xs","sm","md","lg","xl"];let C={...e},u=null,i=null,y=null,R=null,v=null;const b=(d,N)=>Object.prototype.hasOwnProperty.call(d||{},N),P=(d,N)=>typeof d=="function"?d(N):d,Z=d=>String(d||"").split(/\s+/).filter(Boolean),G=d=>d&&typeof d=="object"&&!d.nodeType&&!Array.isArray(d)&&!(d instanceof Function),ie=d=>!!d&&typeof d=="object"&&(d.nodeType===1||typeof d.getBoundingClientRect=="function"),D=()=>{clearTimeout(R),clearTimeout(v),R=null,v=null},$=(d,N,I)=>{if(!d)return;const H=d[N]||[];H.length&&d.classList.remove(...H);const ge=(I||[]).filter(Boolean);ge.length&&d.classList.add(...ge),d[N]=ge},Y=(d,N,I,H=ge=>ge)=>{if(d){if(I==null||I===""){d.style.removeProperty(N);return}d.style.setProperty(N,H(I))}},W=()=>C||{},le=d=>{var I;const N=String(l((I=d.state)!=null?I:d.color)||"").toLowerCase();return o.includes(N)?N:""},me=d=>{const N=String(l(d.size)||"").toLowerCase();return r.includes(N)?N:""},re=d=>{var N,I;return String(l((I=(N=d.placement)!=null?N:d.position)!=null?I:"bottom-start"))},oe=()=>{var I;const d=l((I=W().delay)!=null?I:W().showDelay),N=Number(d);return Number.isFinite(N)?Math.max(0,N):0},se=()=>{const d=l(W().hideDelay),N=Number(d);return Number.isFinite(N)?Math.max(0,N):80},te=(d=null)=>{var I,H,ge;if(d)return d;const N=W();return i||l((ge=(H=(I=N.anchorEl)!=null?I:N.triggerEl)!=null?H:N.target)!=null?ge:N.anchor)||null},M=d=>{if(d==null||d===!0)return new Set(["click"]);if(d===!1)return new Set(["manual"]);const N=Array.isArray(d)?d:String(d).split(/[\s,|/]+/),I=new Set;return N.forEach(H=>{const ge=String(H||"").trim().toLowerCase();ge&&(ge==="mouseenter"||ge==="mouseover"?I.add("hover"):ge==="blur"||ge==="focusin"?I.add("focus"):ge==="tap"?I.add("click"):I.add(ge))}),I.size?I:new Set(["manual"])},Q=(d,N)=>{var ge,Se,ye;let I=null,H=null;if(ie(d))I=d,G(N)&&(H=N);else if(G(d)){H=d;const V=(ye=(Se=(ge=d.anchorEl)!=null?ge:d.triggerEl)!=null?Se:d.target)!=null?ye:d.anchor;ie(V)&&(I=V)}else d!=null&&(I=d);return{anchorEl:I,nextProps:H}},q=(d=u==null?void 0:u.panel)=>{var N;return Array.from(((N=d==null?void 0:d.querySelectorAll)==null?void 0:N.call(d,"[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")},ue=()=>{l(W().autoFocus)!==!1&&setTimeout(()=>{const d=q();if(!d.length)return;(d.find(I=>I.classList.contains("is-active")||I.classList.contains("is-selected")||I.classList.contains("is-checked"))||d[0]).focus()},0)},L=(d,N,I="sm")=>{const H=P(d,N);return H==null?[]:typeof H=="string"?[he.Icon({name:H,size:I})]:An(H,{...N,as:"icon"})},f=(d,N)=>{var de,Le,Je,B,Ae,Me,Ee,De,Ue,Ye,Ze,Qe,Te;const I=P(d,N);if(I==null||I===!1)return[];if(Array.isArray(I))return I.flatMap((je,tt)=>f(je,{...N,index:tt}));if(typeof I=="function")return f(I(N),N);if(I!=null&&I.nodeType)return[I];if(typeof I=="string"||typeof I=="number")return f({label:I},N);if(!G(I))return An(I,{...N,as:"item"});const H=String((Le=(de=I.type)!=null?de:I.kind)!=null?Le:"").toLowerCase();if(H==="separator"||H==="divider"||I.separator===!0||I.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ge=(Je=I.items)!=null?Je:I.children;if((H==="group"||H==="section"||Array.isArray(ge))&&ge!=null){const je={...N,item:I},tt=E(s,"groupLabel",je,P((B=I.label)!=null?B:I.title,je)),nt=f(ge,je);return nt.length?[_.div({class:ae(["cms-menu-group",I.class])},tt.length?_.div({class:"cms-menu-group-label"},...tt):null,_.div({class:"cms-menu-group-items"},...nt))]:[]}const Se={...N,item:I,close:X,dismiss:X,open:S,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:W()},ye=!!l(I.disabled),V=I.checked==null?null:!!l(I.checked),O=!!l((Ae=I.active)!=null?Ae:I.selected),K=le(I),ke=l(I.href),Ne=l(I.to),ee=b(I,"closeOnSelect")?!!l(I.closeOnSelect):I.keepOpen===!0?!1:W().closeOnSelect!==!1,xe=I.role||(V!=null?"menuitemcheckbox":"menuitem"),be=L(I.icon,Se),Ce=L((Me=I.iconRight)!=null?Me:I.endIcon,Se),pe=E(s,"itemTitle",Se,P((Ee=I.title)!=null?Ee:I.label,Se)),Ie=E(s,"itemSubtitle",Se,P((De=I.subtitle)!=null?De:I.description,Se)),_e=E(s,"itemShortcut",Se,P(I.shortcut,Se)),z=E(s,"itemBadge",Se,P(I.badge,Se)),we=E(s,"item",Se,P((Ye=(Ue=I.content)!=null?Ue:I.body)!=null?Ye:I.render,Se)),T=[...z,..._e,...V===!0&&!Ce.length&&!z.length?[_.span({class:"cms-menu-entry-check"},he.Icon({name:I.checkedIcon||"check",size:"sm"}))]:[],...Ce],w={class:ae(["cms-menu-entry","cms-menu-item",K?`cms-state-${K}`:"",fe(O,"is-active"),fe(V===!0,"is-checked"),fe(ye,"is-disabled"),I.class]),role:xe,tabIndex:ye?-1:(Ze=I.tabIndex)!=null?Ze:-1,"data-menu-item":!0,"data-menu-select":ee?"true":"false","data-menu-close":I.close===!0?"true":null,"data-menu-keep-open":ee?null:"true","aria-disabled":ye?"true":null,"aria-checked":V==null?null:String(V),title:(Te=(Qe=I.titleAttr)!=null?Qe:I.tooltip)!=null?Te:null,type:ke?null:"button",href:ke||null,target:I.target||null,rel:I.rel||(I.target==="_blank"?"noopener noreferrer":null),onClick:je=>{var nt,ut,dt,bt;if(ye){je.preventDefault(),je.stopPropagation();return}(ut=(nt=W()).onItemClick)==null||ut.call(nt,I,Se,je);const tt=(dt=I.onClick)==null?void 0:dt.call(I,Se,je);je.defaultPrevented||(Ne&&((bt=JSswift.router)!=null&&bt.navigate)&&(je.preventDefault(),JSswift.router.navigate(Ne)),tt!==!1&&ee&&X())}};I.attrs&&typeof I.attrs=="object"&&Object.assign(w,I.attrs);const c=ke?_.a:_.button,A=we.length?we:[pe.length?_.div({class:"cms-menu-entry-title"},...pe):null,Ie.length?_.div({class:"cms-menu-entry-subtitle"},...Ie):null].filter(Boolean);return[c(w,be.length?_.span({class:"cms-menu-entry-icon"},...be):null,_.span({class:"cms-menu-entry-main"},...A),T.length?_.span({class:"cms-menu-entry-aside"},...T):null)]},m=()=>{var pe,Ie,_e,z,we,T,x;const d=W(),N={close:X,dismiss:X,open:S,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:d},I=L(d.icon,N,d.iconSize||"md"),H=E(s,"eyebrow",N,P(d.eyebrow,N)),ge=E(s,"title",N,P((Ie=(pe=d.title)!=null?pe:d.heading)!=null?Ie:d.label,N)),Se=E(s,"subtitle",N,P((_e=d.subtitle)!=null?_e:d.description,N)),ye=E(s,"before",N,P(d.before,N)),V=E(s,"header",N,P(d.header,N)),O=E(s,"after",N,P(d.after,N)),K=E(s,"footer",N,P(d.footer,N)),ke=E(s,"status",N,P(d.status,N));let Ne=(z=d.content)!=null?z:d.body;Ne==null&&n&&n.length&&(Ne=n);let ee=E(s,"content",N,P(Ne,N));ee.length||(ee=E(s,"body",N,P(Ne,N))),ee.length||(ee=E(s,"default",N,P(Ne,N)));const xe=f((T=(we=d.items)!=null?we:d.actionsList)!=null?T:d.entries,N),be=xe.length?[]:E(s,"empty",N,P((x=d.empty)!=null?x:d.emptyText,N));let Ce=null;return V.length?Ce=_.div({class:ae(["cms-menu-head","cms-menu-head-custom",d.headerClass])},...V):(I.length||H.length||ge.length||Se.length)&&(Ce=_.div({class:ae(["cms-menu-head",d.headerClass])},I.length?_.div({class:"cms-menu-head-icon"},...I):null,_.div({class:"cms-menu-head-main"},H.length?_.div({class:"cms-menu-eyebrow"},...H):null,ge.length?_.div({class:"cms-menu-title"},...ge):null,Se.length?_.div({class:"cms-menu-subtitle"},...Se):null))),_.div({class:ae(["cms-menu","cms-menu-shell",fe(d.dense,"dense"),fe(xe.length>0,"has-items"),fe(K.length>0||ke.length>0,"has-footer"),d.class]),style:d.style||{},role:d.role||"menu","aria-label":d.ariaLabel||null},ye.length?_.div({class:"cms-menu-before"},...ye):null,Ce,ee.length?_.div({class:ae(["cms-menu-content",d.contentClass])},...ee):null,xe.length?_.div({class:ae(["cms-menu-items",d.itemsClass])},...xe):null,!xe.length&&be.length?_.div({class:"cms-menu-empty"},...be):null,O.length?_.div({class:"cms-menu-after"},...O):null,ke.length||K.length?_.div({class:ae(["cms-menu-footer",d.footerClass])},ke.length?_.div({class:"cms-menu-status"},...ke):null,K.length?_.div({class:"cms-menu-footer-actions"},...K):null):null)},g=d=>{var ge;if(!(d!=null&&d.panel))return;const N=W(),I=le(N),H=me(N);$(d.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",H?`cms-menu-${H}`:"",I?`cms-state-${I}`:"",l(N.outline)?"outline":"",...Z(N.panelClass)]),$(d.overlay,"_menuOverlayClassTokens",[...Z(N.overlayClass)]),d.panel.dataset.placement=re(N),Y(d.panel,"--cms-menu-width",l(N.width),Be),Y(d.panel,"--cms-menu-min-width",l(N.minWidth),Be),Y(d.panel,"--cms-menu-max-width",l(N.maxWidth),Be),Y(d.panel,"--cms-menu-max-height",l(N.maxHeight),Be),Y(d.panel,"--cms-menu-body-max-height",l((ge=N.bodyMaxHeight)!=null?ge:N.contentMaxHeight),Be),N.panelStyle&&Object.assign(d.panel.style,N.panelStyle),Ke(d.panel,N)},F=()=>{u!=null&&u.panel&&u.panel.replaceChildren(m())},X=()=>{if(D(),!u)return;const d=u;u=null,yn(d,()=>JSswift.overlay.close(d.id))},a=(d={})=>{var N,I,H,ge;if(d&&typeof d=="object"&&(C={...C,...d}),u){const Se=W();g(u),F(),(ge=u.reposition)==null||ge.call(u,{anchorEl:u._anchorEl,placement:re(Se),offsetX:(N=Se.offsetX)!=null?N:0,offsetY:(H=(I=Se.offsetY)!=null?I:Se.offset)!=null?H:8}),ue()}return k},S=(d=null,N=null)=>{var Ce,pe,Ie,_e,z,we,T,x,w,c,A,de,Le,Je,B,Ae;D();const{anchorEl:I,nextProps:H}=Q(d,N);H&&(C={...C,...H});const ge=W(),Se=te(I);if(!Se||l(ge.disabled))return null;if(u&&u._anchorEl===Se){const Me=W();return g(u),F(),(_e=u.reposition)==null||_e.call(u,{anchorEl:u._anchorEl,placement:re(Me),offsetX:(Ce=Me.offsetX)!=null?Ce:0,offsetY:(Ie=(pe=Me.offsetY)!=null?pe:Me.offset)!=null?Ie:8}),ue(),u}u&&X(),y=document.activeElement;let ye=null;if(u=JSswift.overlay.open(()=>m(),{type:"menu",anchorEl:Se,placement:re(ge),offsetX:(z=ge.offsetX)!=null?z:0,offsetY:(T=(we=ge.offsetY)!=null?we:ge.offset)!=null?T:8,backdrop:ge.backdrop===!0,lockScroll:ge.lockScroll===!0,trapFocus:ge.trapFocus===!0,autoFocus:!1,closeOnOutside:ge.closeOnOutside!==!1,closeOnBackdrop:(x=ge.closeOnBackdrop)!=null?x:ge.backdrop===!0,closeOnEsc:ge.closeOnEsc!==!1,className:Dt(["cms-menu-panel"]),onClose:()=>{var Me,Ee,De;(Me=ye==null?void 0:ye._menuCleanup)==null||Me.call(ye),(De=(Ee=W()).onClose)==null||De.call(Ee,ye),W().returnFocus!==!1&&y&&typeof y.focus=="function"&&setTimeout(()=>y.focus(),0)}}),!(u!=null&&u.panel))return u;const V=u;ye=V,V._anchorEl=Se;const O=()=>{clearTimeout(v),v=null},K=()=>{J()},ke=Me=>{const Ee=Me.target;if(!Ee||!Ee.closest)return;if(Ee.closest("[data-menu-close]")){X();return}if(W().closeOnSelect===!1)return;const De=Ee.closest("[data-menu-item], [data-menu-select], .cms-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");De&&(De.closest("[data-menu-keep-open]")||De.getAttribute("data-menu-select")!=="false"&&X())},Ne=Me=>{if(Me.key==="Escape"){Me.preventDefault(),X();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(Me.key))return;const Ee=q(V.panel);if(!Ee.length)return;Me.preventDefault();const De=Ee.indexOf(document.activeElement);if(Me.key==="Home"){Ee[0].focus();return}if(Me.key==="End"){Ee[Ee.length-1].focus();return}const Ue=Me.key==="ArrowDown"?1:-1,Ye=De<0?Ue>0?0:Ee.length-1:(De+Ue+Ee.length)%Ee.length;Ee[Ye].focus()};V.panel.addEventListener("click",ke),V.panel.addEventListener("keydown",Ne);const ee=M((c=(w=ge.trigger)!=null?w:ge.triggers)!=null?c:b(ge,"open")?"manual":null),xe=ee.has("hover"),be=ee.has("focus");return(xe||be)&&(V.panel.addEventListener("mouseenter",O),V.panel.addEventListener("mouseleave",K),V.panel.addEventListener("focusin",O),V.panel.addEventListener("focusout",K)),V._menuCleanup=()=>{var Me,Ee,De,Ue,Ye,Ze;(Me=V.panel)==null||Me.removeEventListener("click",ke),(Ee=V.panel)==null||Ee.removeEventListener("keydown",Ne),(De=V.panel)==null||De.removeEventListener("mouseenter",O),(Ue=V.panel)==null||Ue.removeEventListener("mouseleave",K),(Ye=V.panel)==null||Ye.removeEventListener("focusin",O),(Ze=V.panel)==null||Ze.removeEventListener("focusout",K)},g(V),(Je=V.reposition)==null||Je.call(V,{anchorEl:Se,placement:re(ge),offsetX:(A=ge.offsetX)!=null?A:0,offsetY:(Le=(de=ge.offsetY)!=null?de:ge.offset)!=null?Le:8}),bn(V),(Ae=(B=W()).onOpen)==null||Ae.call(B,V),ue(),V},h=(d,N=null)=>{clearTimeout(v),v=null,clearTimeout(R),R=setTimeout(()=>S(d,N),oe())},J=(d=!1)=>{if(clearTimeout(R),R=null,!!u){if(clearTimeout(v),d){X();return}v=setTimeout(()=>X(),se())}},j=(d=null,N=null)=>U()?(X(),null):S(d,N),U=()=>!!u,k={open:S,close:X,show:h,hide:J,toggle:j,update:a,bind:d=>{var K,ke;if(!d)return()=>{};i=d;const N=W(),I=M((ke=(K=N.trigger)!=null?K:N.triggers)!=null?ke:b(N,"open")?"manual":null),H=I.has("hover"),ge=I.has("focus"),Se=I.has("click"),ye=I.has("manual")||!H&&!ge&&!Se,V=[],O=()=>{D(),V.forEach(Ne=>Ne()),i===d&&(i=null)};if(b(N,"open"))return at(N.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?S(i):J(!0))},"UI.Menu:open"):N.open===!0?S(d):N.open===!1&&J(!0),O;if(ye||l(N.disabled))return O;if(H){const Ne=()=>h(d),ee=()=>J();d.addEventListener("mouseenter",Ne),d.addEventListener("mouseleave",ee),V.push(()=>{d.removeEventListener("mouseenter",Ne),d.removeEventListener("mouseleave",ee)})}if(ge){const Ne=()=>h(d),ee=()=>J();d.addEventListener("focus",Ne),d.addEventListener("blur",ee),V.push(()=>{d.removeEventListener("focus",Ne),d.removeEventListener("blur",ee)})}if(Se){const Ne=ee=>{var xe,be;(be=(xe=W()).onTriggerClick)==null||be.call(xe,ee),!ee.defaultPrevented&&j(d)};d.addEventListener("click",Ne),V.push(()=>d.removeEventListener("click",Ne))}return O},isOpen:U,entry:()=>u,props:()=>({...C})};return k},he.Popover=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t),s=e.slots||{},o=["primary","secondary","warning","danger","success","info","light","dark"],r=["xs","sm","md","lg","xl"];let C={...e},u=null,i=null,y=null,R=null,v=null;const b=(k,d)=>Object.prototype.hasOwnProperty.call(k||{},d),P=(k,d)=>typeof k=="function"?k(d):k,Z=k=>String(k||"").split(/\s+/).filter(Boolean),G=k=>k&&typeof k=="object"&&!k.nodeType&&!Array.isArray(k)&&!(k instanceof Function),ie=k=>!!k&&typeof k=="object"&&(k.nodeType===1||typeof k.getBoundingClientRect=="function"),D=()=>{clearTimeout(R),clearTimeout(v),R=null,v=null},$=(k,d,N)=>{if(!k)return;const I=k[d]||[];I.length&&k.classList.remove(...I);const H=(N||[]).filter(Boolean);H.length&&k.classList.add(...H),k[d]=H},Y=(k,d,N,I=H=>H)=>{if(k){if(N==null||N===""){k.style.removeProperty(d);return}k.style.setProperty(d,I(N))}},W=()=>C,le=k=>{var N;const d=l((N=k.state)!=null?N:k.color);return d?o.includes(d)?d:String(d):""},me=k=>{const d=l(k.size);return typeof d=="string"&&r.includes(d)?d:""},re=k=>{var N,I,H;const d=String(l((H=(I=(N=k.actionsAlign)!=null?N:k.footerAlign)!=null?I:k.alignActions)!=null?H:"end")).toLowerCase();return["start","left"].includes(d)?"start":["center","middle"].includes(d)?"center":["between","space-between"].includes(d)?"between":["stretch","full"].includes(d)?"stretch":"end"},oe=k=>{var d,N;return String(l((N=(d=k.placement)!=null?d:k.position)!=null?N:"bottom-start"))},se=(k,d)=>{const N=l(k);if(N==null||N==="")return d;const I=Number(N);return Number.isFinite(I)?I:d},te=()=>se(W().delay,0),M=()=>se(W().hideDelay,120),Q=k=>{var N,I;return((I=(N=k.closable)!=null?N:k.dismissible)!=null?I:k.closeButton)===!0},q=(k=null)=>{var N,I,H;if(k)return k;const d=W();return i||l((H=(I=(N=d.anchorEl)!=null?N:d.triggerEl)!=null?I:d.target)!=null?H:d.anchor)||null},ue=k=>{if(k==null||k===!0)return new Set(["click"]);if(k===!1)return new Set(["manual"]);const d=Array.isArray(k)?k:String(k).split(/[\s,|/]+/),N=new Set;return d.forEach(I=>{const H=String(I||"").trim().toLowerCase();H&&(H==="mouseenter"||H==="mouseover"?N.add("hover"):H==="blur"||H==="focusin"?N.add("focus"):H==="tap"?N.add("click"):N.add(H))}),N.size?N:new Set(["manual"])},L=(k,d)=>{var H,ge,Se;let N=null,I=null;if(ie(k))N=k,G(d)&&(I=d);else if(G(k)){I=k;const ye=(Se=(ge=(H=k.anchorEl)!=null?H:k.triggerEl)!=null?ge:k.target)!=null?Se:k.anchor;ie(ye)&&(N=ye)}else k!=null&&(N=k);return{anchorEl:N,nextProps:I}},f=()=>{var be,Ce,pe,Ie,_e,z,we,T,x;const k=W(),d={close:F,dismiss:F,open:a,toggle:J,update:X,isOpen:j,entry:()=>u,anchorEl:q(),props:k},N=k.icon!=null?typeof k.icon=="string"?he.Icon({name:k.icon,size:k.iconSize||"md"}):JSswift.ui.slot(k.icon,{as:"icon"}):null,I=E(s,"eyebrow",d,P(k.eyebrow,d)),H=E(s,"title",d,P((Ce=(be=k.title)!=null?be:k.heading)!=null?Ce:k.label,d)),ge=E(s,"subtitle",d,P((pe=k.subtitle)!=null?pe:k.description,d)),Se=E(s,"icon",d,N),ye=E(s,"header",d,P((_e=(Ie=k.headerContent)!=null?Ie:k.head)!=null?_e:k.header,d)),V=Q(k)?E(s,"close",d,he.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":k.closeLabel||"Chiudi popover","data-popover-close":!0},he.Icon({name:k.closeIcon||"close",size:"sm"}))):[];let O=(T=(we=(z=k.content)!=null?z:k.body)!=null?we:k.message)!=null?T:k.text;O==null&&n&&n.length&&(O=n);let K=E(s,"content",d,P(O,d));K.length||(K=E(s,"body",d,P(O,d))),K.length||(K=E(s,"default",d,P(O,d)));const ke=P((x=k.footer)!=null?x:k.actions,d);let Ne=E(s,"footer",d,ke);Ne.length||(Ne=E(s,"actions",d,ke));let ee=null;ye.length?ee=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...ye):(I.length||H.length||ge.length||Se.length||V.length)&&(ee=_.div({class:"cms-dialog-head"},Se.length?_.div({class:"cms-dialog-icon"},...Se):null,_.div({class:"cms-dialog-head-main"},I.length?_.div({class:"cms-dialog-eyebrow"},...I):null,H.length?_.div({class:"cms-dialog-title"},...H):null,ge.length?_.div({class:"cms-dialog-subtitle"},...ge):null),V.length?_.div({class:"cms-dialog-close-wrap"},...V):null));const xe=[];return ee&&xe.push(ee),K.length&&xe.push(_.div({class:ae(["cms-dialog-body",k.bodyClass])},...K)),Ne.length&&xe.push(_.div({class:ae(["cms-dialog-actions",`is-${re(k)}`,fe(k.stackActions,"is-stacked"),k.actionsClass,k.footerClass])},...Ne)),xe.length||xe.push(_.div({class:ae(["cms-dialog-body",k.bodyClass])})),_.div({class:ae(["cms-dialog-shell","cms-popover-shell",fe(!!ee,"has-head"),fe(Ne.length>0,"has-footer"),fe(k.divider!==!1,"with-divider")])},...xe)},m=k=>{var H;if(!(k!=null&&k.panel))return;const d=W(),N=le(d),I=me(d);$(k.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",I?`cms-dialog-${I}`:"",N,N?`cms-state-${N}`:"",l(d.scrollable)?"scrollable":"",l(d.stickyHeader)?"sticky-head":"",l(d.stickyActions)?"sticky-actions":"",l(d.borderless)?"borderless":"",...Z(d.class),...Z(d.panelClass)]),$(k.overlay,"_popoverOverlayClassTokens",[...Z(d.overlayClass)]),k.panel.dataset.placement=oe(d),Y(k.panel,"--cms-dialog-width",l(d.width),Be),Y(k.panel,"--cms-dialog-min-width",l(d.minWidth),Be),Y(k.panel,"--cms-dialog-max-width",l(d.maxWidth),Be),Y(k.panel,"--cms-dialog-max-height",l(d.maxHeight),Be),Y(k.panel,"--cms-dialog-body-max-height",l((H=d.bodyMaxHeight)!=null?H:d.contentMaxHeight),Be),d.style&&Object.assign(k.panel.style,d.style),Ke(k.panel,d),k.panel.setAttribute("role",d.role||"dialog"),k.panel.setAttribute("aria-modal",d.modal===!0?"true":"false"),d.ariaLabel?k.panel.setAttribute("aria-label",d.ariaLabel):k.panel.removeAttribute("aria-label")},g=()=>{u!=null&&u.panel&&u.panel.replaceChildren(f())},F=()=>{if(D(),!u)return;const k=u;u=null,yn(k,()=>JSswift.overlay.close(k.id))},X=(k={})=>(k&&typeof k=="object"&&(C={...C,...k}),u&&(m(u),g()),ce),a=(k=null,d=null)=>{var xe,be,Ce,pe,Ie,_e,z,we;D();const{anchorEl:N,nextProps:I}=L(k,d);I&&(C={...C,...I});const H=W(),ge=q(N);if(!ge||l(H.disabled))return null;if(u&&u._anchorEl===ge)return m(u),g(),u;u&&F(),y=document.activeElement;const Se=ue((be=(xe=H.trigger)!=null?xe:H.triggers)!=null?be:b(H,"open")?"manual":null),ye=Se.has("hover"),V=Se.has("focus");let O=null;if(u=JSswift.overlay.open(()=>f(),{type:"popover",anchorEl:ge,placement:oe(H),offsetX:(Ce=H.offsetX)!=null?Ce:0,offsetY:(Ie=(pe=H.offsetY)!=null?pe:H.offset)!=null?Ie:10,backdrop:H.backdrop===!0,lockScroll:H.lockScroll===!0,trapFocus:H.trapFocus===!0,autoFocus:H.autoFocus===!0,closeOnOutside:H.closeOnOutside!==!1,closeOnBackdrop:(_e=H.closeOnBackdrop)!=null?_e:H.backdrop===!0,closeOnEsc:H.closeOnEsc!==!1,className:Dt(["cms-dialog","cms-popover"]),onClose:()=>{var T,x,w;(T=O==null?void 0:O._popoverCleanup)==null||T.call(O),(w=(x=W()).onClose)==null||w.call(x,O),W().returnFocus!==!1&&y&&typeof y.focus=="function"&&setTimeout(()=>y.focus(),0)}}),!(u!=null&&u.panel))return u;const K=u;O=K,K._anchorEl=ge;const ke=()=>{clearTimeout(v),v=null},Ne=()=>{!ye&&!V||h()},ee=T=>{const x=T.target;if(!(!x||!x.closest)){if(x.closest("[data-popover-close]")||x.closest("[data-dialog-close]")){F();return}W().closeOnSelect===!0&&x.closest("[data-popover-select]")&&F()}};return K.panel.addEventListener("click",ee),(ye||V)&&(K.panel.addEventListener("mouseenter",ke),K.panel.addEventListener("mouseleave",Ne),K.panel.addEventListener("focusin",ke),K.panel.addEventListener("focusout",Ne)),K._popoverCleanup=()=>{var T,x,w,c,A;(T=K.panel)==null||T.removeEventListener("click",ee),(x=K.panel)==null||x.removeEventListener("mouseenter",ke),(w=K.panel)==null||w.removeEventListener("mouseleave",Ne),(c=K.panel)==null||c.removeEventListener("focusin",ke),(A=K.panel)==null||A.removeEventListener("focusout",Ne)},m(K),bn(K),(we=(z=W()).onOpen)==null||we.call(z,K),K},S=(k,d=null)=>{clearTimeout(v),v=null,clearTimeout(R),R=setTimeout(()=>a(k,d),te())},h=(k=!1)=>{if(clearTimeout(R),R=null,!!u){if(clearTimeout(v),k){F();return}v=setTimeout(()=>F(),M())}},J=(k=null,d=null)=>j()?(F(),null):a(k,d),j=()=>!!u,ce={open:a,close:F,show:S,hide:h,toggle:J,update:X,bind:k=>{var O,K;if(!k)return()=>{};i=k;const d=W(),N=ue((K=(O=d.trigger)!=null?O:d.triggers)!=null?K:b(d,"open")?"manual":null),I=N.has("hover"),H=N.has("focus"),ge=N.has("click"),Se=N.has("manual")||!I&&!H&&!ge,ye=[],V=()=>{D(),ye.forEach(ke=>ke()),i===k&&(i=null)};if(b(d,"open"))return at(d.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?a(i):h(!0))},"UI.Popover:open"):d.open===!0?a(k):d.open===!1&&h(!0),V;if(Se||l(d.disabled))return V;if(I){const ke=()=>S(k),Ne=()=>h();k.addEventListener("mouseenter",ke),k.addEventListener("mouseleave",Ne),ye.push(()=>{k.removeEventListener("mouseenter",ke),k.removeEventListener("mouseleave",Ne)})}if(H){const ke=()=>S(k),Ne=()=>h();k.addEventListener("focus",ke),k.addEventListener("blur",Ne),ye.push(()=>{k.removeEventListener("focus",ke),k.removeEventListener("blur",Ne)})}if(ge){const ke=Ne=>{var ee,xe;(xe=(ee=W()).onTriggerClick)==null||xe.call(ee,Ne),!Ne.defaultPrevented&&J(k)};k.addEventListener("click",ke),ye.push(()=>k.removeEventListener("click",ke))}return V},isOpen:j,entry:()=>u,props:()=>({...C})};return ce},he.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},o=null,r=null,C=null;const u=g=>g&&typeof g=="object"&&!g.nodeType&&!Array.isArray(g)&&!(g instanceof Function),i=g=>!!g&&typeof g=="object"&&(g.nodeType===1||typeof g.getBoundingClientRect=="function"),y=g=>!!g&&typeof g=="object"&&("clientX"in g||"type"in g||"target"in g||"currentTarget"in g),R=g=>!!g&&Number.isFinite(Number(g.x))&&Number.isFinite(Number(g.y)),v=()=>s,b=(g,F)=>{const X=Number(g),a=Number(F);return!Number.isFinite(X)||!Number.isFinite(a)?null:{x:X,y:a}},P=g=>g?{_cmsContextPoint:g,getBoundingClientRect:()=>({top:g.y,bottom:g.y,left:g.x,right:g.x,width:0,height:0})}:null,Z=g=>{if(!i(g))return null;const F=g.getBoundingClientRect();return b(F.left+Math.min(F.width/2,24),F.top+Math.min(F.height/2,24))},G=g=>{var F,X,a,S;return l((S=(a=(X=(F=g==null?void 0:g.anchorEl)!=null?F:g==null?void 0:g.triggerEl)!=null?X:g==null?void 0:g.target)!=null?a:g==null?void 0:g.anchor)!=null?S:null)},ie=(g,F=null)=>{if(!g)return Z(F||C);const X=b(g.clientX,g.clientY);if(X)return X;const a=G({anchorEl:F||g.currentTarget||g.target||C});return Z(a)},D=(g={})=>{if(!u(g))return{};const F={...g};return delete F.event,delete F.point,delete F.x,delete F.y,F},$=()=>{var F,X,a;const g=v();return{...g,trigger:"manual",placement:g.placement||"bottom-start",offsetX:(F=g.offsetX)!=null?F:0,offsetY:(a=(X=g.offsetY)!=null?X:g.offset)!=null?a:4,closeOnOutside:g.closeOnOutside!==!1,closeOnEsc:g.closeOnEsc!==!1,role:g.role||"menu",ariaLabel:g.ariaLabel||g.title||"Context menu",class:ae(["cms-context-menu-shell",g.class]),panelClass:ae(["cms-context-menu-panel",g.panelClass])}},Y=he.Menu($(),...n),W=(g=null,F=null,X=null)=>{let a=null,S=null,h=null;if(y(g))a=ie(g,C),h=u(F)?D(F):null;else if(typeof g=="number"||typeof F=="number")a=b(g,F),h=u(X)?D(X):null;else if(R(g))a=b(g.x,g.y),h=u(F)?D(F):null;else if(i(g))S=g,h=u(F)?D(F):null;else if(u(g)){const J=R(g.point)?g.point:R(g)?g:null,j=G(g),U=g.event;a=J?b(J.x,J.y):ie(U,j||C),S=j&&i(j)?j:null,h={...D(g),...u(F)?D(F):{}}}else o&&(a={...o});return{point:a,anchor:S,nextProps:h}},le=(g,F=null)=>{r=g||r,o=F||g&&g._cmsContextPoint||o},me=(g=null)=>{u(g)&&Object.keys(g).length&&(s={...s,...g})},re=(g=null,F=null)=>{if(F)return P(F);if(g&&i(g))return g;const X=G(v());return i(X)?X:o?P(o):i(r)?r:i(C)?C:null},oe=(g=null,F=null,X=null)=>{const{point:a,anchor:S,nextProps:h}=W(g,F,X);me(h);const J=re(S,a);return J?(le(J,a),Y.open(J,$())):null},se=(g,F,X=null)=>oe(g,F,X),te=(g,F=null)=>oe(g,F),M=()=>(Y.close(),m),Q=(g=!0)=>(g===!1?Y.hide(!1):Y.close(),m),q=(g=null,F=null,X=null)=>oe(g,F,X),ue=(g=null,F=null,X=null)=>Y.isOpen()?(M(),null):oe(g,F,X),L=(g={})=>(me(D(g)),Y.update($()),m),m={open:oe,openAt:se,openFromEvent:te,show:q,hide:Q,close:M,toggle:ue,update:L,bind:(g,F=null)=>{if(!g)return()=>{};const X=u(F)?D(F):null,a=h=>{var j,U;C=g,h.preventDefault(),!(((U=(j=v()).onTrigger)==null?void 0:U.call(j,h,{element:g,open:oe,close:M,update:L}))===!1||l(v().disabled))&&oe({event:h,anchorEl:g},X)},S=h=>{var j,U;h.key!=="ContextMenu"&&!(h.shiftKey&&h.key==="F10")||(C=g,h.preventDefault(),((U=(j=v()).onTrigger)==null?void 0:U.call(j,h,{element:g,open:oe,close:M,update:L}))===!1||l(v().disabled))||oe({event:h,anchorEl:g},X)};return g.addEventListener("contextmenu",a),g.addEventListener("keydown",S),()=>{g.removeEventListener("contextmenu",a),g.removeEventListener("keydown",S)}},isOpen:Y.isOpen,entry:Y.entry,props:()=>({...s})};return m}})(JSswift);