@jsswift/ui 1.0.50 → 1.0.52
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 +1 -1
- package/dist/ui.js +2 -2
- package/dist/ui.min.js +1 -1
- package/package.json +2 -2
- package/src/80-data.js +2 -2
package/dist/min-ui.js
CHANGED
|
@@ -31,4 +31,4 @@ background: var(--cms-primary);
|
|
|
31
31
|
transition: width 200ms ease;
|
|
32
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 y=document.createElement("style");return y.textContent=`
|
|
33
33
|
@keyframes cmsSpin { to { transform: rotate(360deg); } }
|
|
34
|
-
`,document.head.appendChild(y),kt._textNode=n,kt._spinner=e,kt._progressWrap=s,kt._progressBar=o,kt._progressActive=!1,kt}function yl(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 wl(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=bl(),s=yl(t,e);In++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",wl(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=bl();typeof t=="object"&&t!==null&&(e=t,t=(r=t.value)!=null?r:0);const s=yl(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+"%",wl(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 qo(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 Xo(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=qo(t);return Array.isArray(e)?e:[]}function vl(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 Sl(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 Zo(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 ei(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 y=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var T;return(T=b==null?void 0:b.searchKey)!=null?T:b==null?void 0:b.key}).filter(Boolean),u=[];if(y.length)for(const b of y)if(typeof b=="function")u.push(Qn(b(t)));else{const T=e.find(S=>(S==null?void 0:S.key)===b||(S==null?void 0:S.searchKey)===b);u.push(Qn(T?qn(T,t,-1):Ss(t,b)))}else u.push(Qn(t));const i=u.join(" ").toLowerCase();return r.every(b=>i.includes(b))}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=Zo(e.pageSizeOptions,[5,10,20,50]),y=Number((ee=(Ne=e.pageSize)!=null?Ne:r[0])!=null?ee:10)||10,u=Array.from(new Set([...r,y])).sort((Ce,pe)=>Ce-pe),i=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",T=Nt(e.searchModel||e.queryModel,"UI.Table:query"),[S,w]=He.reactive.signal(Math.max(1,Number(e.page||1)||1)),[z,Q]=He.reactive.signal(y),[G,ie]=He.reactive.signal(i),[D,$]=He.reactive.signal(String((be=T?T.get():(xe=e.search)!=null?xe:e.query)!=null?be:"")),Y=Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),T&&T.set(pe),w(1)},W=Ce=>{const pe=Number(Ce)||y;Q(pe),w(1)},se=(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),w(1)};let me=null;T&&T.watch(Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),me&&me.value!==pe&&(me.value=pe),w(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"}),le=J(s,"default",{},n);le.length&&oe.appendChild(_.div({class:"cms-table-lead"},...le));const te=J(s,"toolbarStart",{},e.toolbarStart),M=J(s,"toolbar",{},e.toolbar),Z=J(s,"toolbarEnd",{},e.toolbarEnd),q=_.div({class:"cms-table-toolbar"}),ue=_.div({class:"cms-table-toolbar-main"}),R=_.div({class:"cms-table-toolbar-side"});te.forEach(Ce=>ue.appendChild(Ce)),M.forEach(Ce=>ue.appendChild(Ce));const g=J(s,"search",{query:D(),getQuery:D,setQuery:Y},null);if(g.length)g.forEach(Ce=>R.appendChild(Ce));else if(b){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");R.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),me,Ce))}Z.forEach(Ce=>R.appendChild(Ce)),(ue.childNodes.length||R.childNodes.length)&&(q.appendChild(ue),q.appendChild(R),oe.appendChild(q));const d=_.div({class:"cms-singularity cms-table-chip"},""),m=_.div({class:"cms-singularity cms-table-chip"},""),F=_.div({class:"cms-singularity cms-table-chip"},""),X=J(s,"status",{},e.status),a=_.div({class:"cms-table-status"},d,m,F,...X);oe.appendChild(a);const C=J(s,"caption",{},e.caption);C.length&&oe.appendChild(_.div({class:"cms-table-caption"},...C));const h=_.thead(),P=_.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 L=_.table({class:U,style:ce},h,P),f=_.div({class:"cms-singularity cms-table-wrap"},L);oe.appendChild(f);const k=_.div({class:"cms-singularity cms-table-chip"},""),A=_.div({class:"cms-singularity cms-table-chip"},""),H=he.Btn({outline:!0,onClick:()=>w(Math.max(1,S()-1))},"\u2039"),ge=he.Btn({outline:!0,onClick:()=>w(S()+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(z()),ye.addEventListener("change",()=>W(ye.value));const V=J(s,"footer",{},e.footer),O=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},k,A,_.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,Ae;const _e={col:pe,colIndex:Ie,sort:G()},I={...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&&(I.width=Be(pe.width)),(pe==null?void 0:pe.minWidth)!=null&&(I.minWidth=Be(pe.minWidth)),(pe==null?void 0:pe.maxWidth)!=null&&(I.maxWidth=Be(pe.maxWidth)),pe!=null&&pe.align&&(I.textAlign=pe.align);let we=J(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):(Ae=pe==null?void 0:pe.header)!=null?Ae:vl(pe);we=J(s,"header",_e,Je)}const E=G(),x=Cs(pe,Ie),v=(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=!!E&&(E.key===x||E.key===(pe==null?void 0:pe.key)),N=_.th({class:ae(["cms-table-head-cell",fe(pe==null?void 0:pe.nowrap,"is-nowrap"),fe(v,"cms-table-sortable"),fe(c,"is-sorted"),pe==null?void 0:pe.headerClass]),style:I});v?N.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>se(pe,Ie)},_.span({class:"cms-table-head-label"},...we),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},c?E.dir==="asc"?"\u2191":"\u2193":"\u2195"))):we.forEach(Je=>N.appendChild(Je)),Ce.appendChild(N)}),j){const pe=J(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=J(s,Ce,Ie,pe),I=String(o.length+(j?1:0));P.appendChild(_.tr(_.td({colSpan:I,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,I=e.pagination!==!1;if(K(),P.innerHTML="",me&&me.value!==D()&&(me.value=D()),ye.value!==String(z())&&(ye.value=String(z())),_e){d.textContent="Caricamento in corso",m.style.display="none",F.style.display="none",k.textContent="Loading\u2026",A.textContent="",Se.textContent="Pagina 1",H.disabled=!0,ge.disabled=!0,ke("loading",e.loadingText||"Loading...");return}let we=Ce.slice();const E=we.length;if(typeof e.filter=="function"&&(we=we.filter((B,Le)=>e.filter(B,{row:B,index:Le,query:pe,rows:Ce,columns:o}))),pe&&(we=we.filter(B=>ei(B,o,pe,e))),Ie){const B=Sl(o,Ie.key);B&&we.sort((Le,Me)=>{const Ee=qn(B,Le,-1),De=qn(B,Me,-1),Ue=typeof B.compare=="function"?B.compare(Ee,De,Le,Me):Xo(Ee,De);return Ie.dir==="asc"?Ue:-Ue})}const x=we.length,v=Math.max(1,Number(z())||y),c=I?Math.max(1,Math.ceil(x/v)):1,N=I?Math.min(S(),c):1;N!==S()&&w(N);const de=I?(N-1)*v:0,Ae=I?de+v:x,Je=we.slice(de,Ae);if(d.textContent=x===E?`${x} righe`:`${x} di ${E} righe`,m.textContent=pe?`Ricerca: ${pe}`:"",m.style.display=pe?"":"none",Ie){const B=Sl(o,Ie.key);F.textContent=B?`Ordine: ${vl(B)} ${Ie.dir==="asc"?"\u2191":"\u2193"}`:"",F.style.display=B?"":"none"}else F.style.display="none";if(k.textContent=x?`${de+1}-${Math.min(Ae,x)} di ${x}`:"0 risultati",A.textContent=x!==E?`Dataset totale ${E}`:`Page size ${v}`,Se.textContent=I?`Pagina ${N} / ${c}`:"Tutte le righe",H.disabled=!I||N<=1,ge.disabled=!I||N>=c,ye.disabled=!I,ye.parentNode.style.display=I?"":"none",Je.length===0){ke("empty",e.emptyText||"Nessun dato");return}for(let B=0;B<Je.length;B++){const Le=Je[B],Me=de+B,Ee={row:Le,rowIndex:Me,pageIndex:B},De=typeof e.rowAttrs=="function"?e.rowAttrs(Le,Ee)||{}:e.rowAttrs||{},Ue=typeof e.rowClass=="function"?e.rowClass(Le,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(Le,Ee):Ss(Le,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(Le,Ee,Te)}),e.onRowDblClick&&Ze.addEventListener("dblclick",Te=>{Qe(Te)||e.onRowDblClick(Le,Ee,Te)}),o.forEach((Te,je)=>{var ft,vt;const tt=qn(Te,Le,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(Le,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=J(Te==null?void 0:Te.slots,"cell",nt,null);if(!lt.length){const _t=typeof(Te==null?void 0:Te.render)=="function"?Te.render(Le,nt):typeof(Te==null?void 0:Te.format)=="function"?Te.format(tt,Le,nt):tt,rt=_t==null?(vt=Te==null?void 0:Te.emptyText)!=null?vt:"":_t;lt=J(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(Le,Ee):e.actions;let tt=J(s,"actions",Te,je);tt.length||(tt=J(null,"default",Te,je)),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"),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 y={...e},u=null,i=null,b=null,T=null,S=null;const w=(f,k)=>Object.prototype.hasOwnProperty.call(f||{},k),z=(f,k)=>typeof f=="function"?f(k):f,Q=f=>String(f||"").split(/\s+/).filter(Boolean),G=f=>f&&typeof f=="object"&&!f.nodeType&&!Array.isArray(f)&&!(f instanceof Function),ie=f=>!!f&&typeof f=="object"&&(f.nodeType===1||typeof f.getBoundingClientRect=="function"),D=()=>{clearTimeout(T),clearTimeout(S),T=null,S=null},$=(f,k,A)=>{if(!f)return;const H=f[k]||[];H.length&&f.classList.remove(...H);const ge=(A||[]).filter(Boolean);ge.length&&f.classList.add(...ge),f[k]=ge},Y=(f,k,A,H=ge=>ge)=>{if(f){if(A==null||A===""){f.style.removeProperty(k);return}f.style.setProperty(k,H(A))}},W=()=>y||{},se=f=>{var A;const k=String(l((A=f.state)!=null?A:f.color)||"").toLowerCase();return o.includes(k)?k:""},me=f=>{const k=String(l(f.size)||"").toLowerCase();return r.includes(k)?k:""},re=f=>{var k,A;return String(l((A=(k=f.placement)!=null?k:f.position)!=null?A:"bottom-start"))},oe=()=>{var A;const f=l((A=W().delay)!=null?A:W().showDelay),k=Number(f);return Number.isFinite(k)?Math.max(0,k):0},le=()=>{const f=l(W().hideDelay),k=Number(f);return Number.isFinite(k)?Math.max(0,k):80},te=(f=null)=>{var A,H,ge;if(f)return f;const k=W();return i||l((ge=(H=(A=k.anchorEl)!=null?A:k.triggerEl)!=null?H:k.target)!=null?ge:k.anchor)||null},M=f=>{if(f==null||f===!0)return new Set(["click"]);if(f===!1)return new Set(["manual"]);const k=Array.isArray(f)?f:String(f).split(/[\s,|/]+/),A=new Set;return k.forEach(H=>{const ge=String(H||"").trim().toLowerCase();ge&&(ge==="mouseenter"||ge==="mouseover"?A.add("hover"):ge==="blur"||ge==="focusin"?A.add("focus"):ge==="tap"?A.add("click"):A.add(ge))}),A.size?A:new Set(["manual"])},Z=(f,k)=>{var ge,Se,ye;let A=null,H=null;if(ie(f))A=f,G(k)&&(H=k);else if(G(f)){H=f;const V=(ye=(Se=(ge=f.anchorEl)!=null?ge:f.triggerEl)!=null?Se:f.target)!=null?ye:f.anchor;ie(V)&&(A=V)}else f!=null&&(A=f);return{anchorEl:A,nextProps:H}},q=(f=u==null?void 0:u.panel)=>{var k;return Array.from(((k=f==null?void 0:f.querySelectorAll)==null?void 0:k.call(f,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(A=>A.offsetParent!==null&&A.getAttribute("aria-hidden")!=="true")},ue=()=>{l(W().autoFocus)!==!1&&setTimeout(()=>{const f=q();if(!f.length)return;(f.find(A=>A.classList.contains("is-active")||A.classList.contains("is-selected")||A.classList.contains("is-checked"))||f[0]).focus()},0)},R=(f,k,A="sm")=>{const H=z(f,k);return H==null?[]:typeof H=="string"?[he.Icon({name:H,size:A})]:Ln(H,{...k,as:"icon"})},g=(f,k)=>{var de,Ae,Je,B,Le,Me,Ee,De,Ue,Ye,Ze,Qe,Te;const A=z(f,k);if(A==null||A===!1)return[];if(Array.isArray(A))return A.flatMap((je,tt)=>g(je,{...k,index:tt}));if(typeof A=="function")return g(A(k),k);if(A!=null&&A.nodeType)return[A];if(typeof A=="string"||typeof A=="number")return g({label:A},k);if(!G(A))return Ln(A,{...k,as:"item"});const H=String((Ae=(de=A.type)!=null?de:A.kind)!=null?Ae:"").toLowerCase();if(H==="separator"||H==="divider"||A.separator===!0||A.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ge=(Je=A.items)!=null?Je:A.children;if((H==="group"||H==="section"||Array.isArray(ge))&&ge!=null){const je={...k,item:A},tt=J(s,"groupLabel",je,z((B=A.label)!=null?B:A.title,je)),nt=g(ge,je);return nt.length?[_.div({class:ae(["cms-menu-group",A.class])},tt.length?_.div({class:"cms-menu-group-label"},...tt):null,_.div({class:"cms-menu-group-items"},...nt))]:[]}const Se={...k,item:A,close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:W()},ye=!!l(A.disabled),V=A.checked==null?null:!!l(A.checked),O=!!l((Le=A.active)!=null?Le:A.selected),K=se(A),ke=l(A.href),Ne=l(A.to),ee=w(A,"closeOnSelect")?!!l(A.closeOnSelect):A.keepOpen===!0?!1:W().closeOnSelect!==!1,xe=A.role||(V!=null?"menuitemcheckbox":"menuitem"),be=R(A.icon,Se),Ce=R((Me=A.iconRight)!=null?Me:A.endIcon,Se),pe=J(s,"itemTitle",Se,z((Ee=A.title)!=null?Ee:A.label,Se)),Ie=J(s,"itemSubtitle",Se,z((De=A.subtitle)!=null?De:A.description,Se)),_e=J(s,"itemShortcut",Se,z(A.shortcut,Se)),I=J(s,"itemBadge",Se,z(A.badge,Se)),we=J(s,"item",Se,z((Ye=(Ue=A.content)!=null?Ue:A.body)!=null?Ye:A.render,Se)),E=[...I,..._e,...V===!0&&!Ce.length&&!I.length?[_.span({class:"cms-menu-entry-check"},he.Icon({name:A.checkedIcon||"check",size:"sm"}))]:[],...Ce],v={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"),A.class]),role:xe,tabIndex:ye?-1:(Ze=A.tabIndex)!=null?Ze:-1,"data-menu-item":!0,"data-menu-select":ee?"true":"false","data-menu-close":A.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=A.titleAttr)!=null?Qe:A.tooltip)!=null?Te:null,type:ke?null:"button",href:ke||null,target:A.target||null,rel:A.rel||(A.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,A,Se,je);const tt=(dt=A.onClick)==null?void 0:dt.call(A,Se,je);je.defaultPrevented||(Ne&&((bt=JSswift.router)!=null&&bt.navigate)&&(je.preventDefault(),JSswift.router.navigate(Ne)),tt!==!1&&ee&&X())}};A.attrs&&typeof A.attrs=="object"&&Object.assign(v,A.attrs);const c=ke?_.a:_.button,N=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(v,be.length?_.span({class:"cms-menu-entry-icon"},...be):null,_.span({class:"cms-menu-entry-main"},...N),E.length?_.span({class:"cms-menu-entry-aside"},...E):null)]},d=()=>{var pe,Ie,_e,I,we,E,x;const f=W(),k={close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:f},A=R(f.icon,k,f.iconSize||"md"),H=J(s,"eyebrow",k,z(f.eyebrow,k)),ge=J(s,"title",k,z((Ie=(pe=f.title)!=null?pe:f.heading)!=null?Ie:f.label,k)),Se=J(s,"subtitle",k,z((_e=f.subtitle)!=null?_e:f.description,k)),ye=J(s,"before",k,z(f.before,k)),V=J(s,"header",k,z(f.header,k)),O=J(s,"after",k,z(f.after,k)),K=J(s,"footer",k,z(f.footer,k)),ke=J(s,"status",k,z(f.status,k));let Ne=(I=f.content)!=null?I:f.body;Ne==null&&n&&n.length&&(Ne=n);let ee=J(s,"content",k,z(Ne,k));ee.length||(ee=J(s,"body",k,z(Ne,k))),ee.length||(ee=J(s,"default",k,z(Ne,k)));const xe=g((E=(we=f.items)!=null?we:f.actionsList)!=null?E:f.entries,k),be=xe.length?[]:J(s,"empty",k,z((x=f.empty)!=null?x:f.emptyText,k));let Ce=null;return V.length?Ce=_.div({class:ae(["cms-menu-head","cms-menu-head-custom",f.headerClass])},...V):(A.length||H.length||ge.length||Se.length)&&(Ce=_.div({class:ae(["cms-menu-head",f.headerClass])},A.length?_.div({class:"cms-menu-head-icon"},...A):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(f.dense,"dense"),fe(xe.length>0,"has-items"),fe(K.length>0||ke.length>0,"has-footer"),f.class]),style:f.style||{},role:f.role||"menu","aria-label":f.ariaLabel||null},ye.length?_.div({class:"cms-menu-before"},...ye):null,Ce,ee.length?_.div({class:ae(["cms-menu-content",f.contentClass])},...ee):null,xe.length?_.div({class:ae(["cms-menu-items",f.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",f.footerClass])},ke.length?_.div({class:"cms-menu-status"},...ke):null,K.length?_.div({class:"cms-menu-footer-actions"},...K):null):null)},m=f=>{var ge;if(!(f!=null&&f.panel))return;const k=W(),A=se(k),H=me(k);$(f.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",H?`cms-menu-${H}`:"",A?`cms-state-${A}`:"",l(k.outline)?"outline":"",...Q(k.panelClass)]),$(f.overlay,"_menuOverlayClassTokens",[...Q(k.overlayClass)]),f.panel.dataset.placement=re(k),Y(f.panel,"--cms-menu-width",l(k.width),Be),Y(f.panel,"--cms-menu-min-width",l(k.minWidth),Be),Y(f.panel,"--cms-menu-max-width",l(k.maxWidth),Be),Y(f.panel,"--cms-menu-max-height",l(k.maxHeight),Be),Y(f.panel,"--cms-menu-body-max-height",l((ge=k.bodyMaxHeight)!=null?ge:k.contentMaxHeight),Be),k.panelStyle&&Object.assign(f.panel.style,k.panelStyle),Ke(f.panel,k)},F=()=>{u!=null&&u.panel&&u.panel.replaceChildren(d())},X=()=>{if(D(),!u)return;const f=u;u=null,yn(f,()=>JSswift.overlay.close(f.id))},a=(f={})=>{var k,A,H,ge;if(f&&typeof f=="object"&&(y={...y,...f}),u){const Se=W();m(u),F(),(ge=u.reposition)==null||ge.call(u,{anchorEl:u._anchorEl,placement:re(Se),offsetX:(k=Se.offsetX)!=null?k:0,offsetY:(H=(A=Se.offsetY)!=null?A:Se.offset)!=null?H:8}),ue()}return L},C=(f=null,k=null)=>{var Ce,pe,Ie,_e,I,we,E,x,v,c,N,de,Ae,Je,B,Le;D();const{anchorEl:A,nextProps:H}=Z(f,k);H&&(y={...y,...H});const ge=W(),Se=te(A);if(!Se||l(ge.disabled))return null;if(u&&u._anchorEl===Se){const Me=W();return m(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(),b=document.activeElement;let ye=null;if(u=JSswift.overlay.open(()=>d(),{type:"menu",anchorEl:Se,placement:re(ge),offsetX:(I=ge.offsetX)!=null?I:0,offsetY:(E=(we=ge.offsetY)!=null?we:ge.offset)!=null?E: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&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const V=u;ye=V,V._anchorEl=Se;const O=()=>{clearTimeout(S),S=null},K=()=>{P()},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=(v=ge.trigger)!=null?v:ge.triggers)!=null?c:w(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)},m(V),(Je=V.reposition)==null||Je.call(V,{anchorEl:Se,placement:re(ge),offsetX:(N=ge.offsetX)!=null?N:0,offsetY:(Ae=(de=ge.offsetY)!=null?de:ge.offset)!=null?Ae:8}),bn(V),(Le=(B=W()).onOpen)==null||Le.call(B,V),ue(),V},h=(f,k=null)=>{clearTimeout(S),S=null,clearTimeout(T),T=setTimeout(()=>C(f,k),oe())},P=(f=!1)=>{if(clearTimeout(T),T=null,!!u){if(clearTimeout(S),f){X();return}S=setTimeout(()=>X(),le())}},j=(f=null,k=null)=>U()?(X(),null):C(f,k),U=()=>!!u,L={open:C,close:X,show:h,hide:P,toggle:j,update:a,bind:f=>{var K,ke;if(!f)return()=>{};i=f;const k=W(),A=M((ke=(K=k.trigger)!=null?K:k.triggers)!=null?ke:w(k,"open")?"manual":null),H=A.has("hover"),ge=A.has("focus"),Se=A.has("click"),ye=A.has("manual")||!H&&!ge&&!Se,V=[],O=()=>{D(),V.forEach(Ne=>Ne()),i===f&&(i=null)};if(w(k,"open"))return at(k.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?C(i):P(!0))},"UI.Menu:open"):k.open===!0?C(f):k.open===!1&&P(!0),O;if(ye||l(k.disabled))return O;if(H){const Ne=()=>h(f),ee=()=>P();f.addEventListener("mouseenter",Ne),f.addEventListener("mouseleave",ee),V.push(()=>{f.removeEventListener("mouseenter",Ne),f.removeEventListener("mouseleave",ee)})}if(ge){const Ne=()=>h(f),ee=()=>P();f.addEventListener("focus",Ne),f.addEventListener("blur",ee),V.push(()=>{f.removeEventListener("focus",Ne),f.removeEventListener("blur",ee)})}if(Se){const Ne=ee=>{var xe,be;(be=(xe=W()).onTriggerClick)==null||be.call(xe,ee),!ee.defaultPrevented&&j(f)};f.addEventListener("click",Ne),V.push(()=>f.removeEventListener("click",Ne))}return O},isOpen:U,entry:()=>u,props:()=>({...y})};return L},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 y={...e},u=null,i=null,b=null,T=null,S=null;const w=(L,f)=>Object.prototype.hasOwnProperty.call(L||{},f),z=(L,f)=>typeof L=="function"?L(f):L,Q=L=>String(L||"").split(/\s+/).filter(Boolean),G=L=>L&&typeof L=="object"&&!L.nodeType&&!Array.isArray(L)&&!(L instanceof Function),ie=L=>!!L&&typeof L=="object"&&(L.nodeType===1||typeof L.getBoundingClientRect=="function"),D=()=>{clearTimeout(T),clearTimeout(S),T=null,S=null},$=(L,f,k)=>{if(!L)return;const A=L[f]||[];A.length&&L.classList.remove(...A);const H=(k||[]).filter(Boolean);H.length&&L.classList.add(...H),L[f]=H},Y=(L,f,k,A=H=>H)=>{if(L){if(k==null||k===""){L.style.removeProperty(f);return}L.style.setProperty(f,A(k))}},W=()=>y,se=L=>{var k;const f=l((k=L.state)!=null?k:L.color);return f?o.includes(f)?f:String(f):""},me=L=>{const f=l(L.size);return typeof f=="string"&&r.includes(f)?f:""},re=L=>{var k,A,H;const f=String(l((H=(A=(k=L.actionsAlign)!=null?k:L.footerAlign)!=null?A:L.alignActions)!=null?H:"end")).toLowerCase();return["start","left"].includes(f)?"start":["center","middle"].includes(f)?"center":["between","space-between"].includes(f)?"between":["stretch","full"].includes(f)?"stretch":"end"},oe=L=>{var f,k;return String(l((k=(f=L.placement)!=null?f:L.position)!=null?k:"bottom-start"))},le=(L,f)=>{const k=l(L);if(k==null||k==="")return f;const A=Number(k);return Number.isFinite(A)?A:f},te=()=>le(W().delay,0),M=()=>le(W().hideDelay,120),Z=L=>{var k,A;return((A=(k=L.closable)!=null?k:L.dismissible)!=null?A:L.closeButton)===!0},q=(L=null)=>{var k,A,H;if(L)return L;const f=W();return i||l((H=(A=(k=f.anchorEl)!=null?k:f.triggerEl)!=null?A:f.target)!=null?H:f.anchor)||null},ue=L=>{if(L==null||L===!0)return new Set(["click"]);if(L===!1)return new Set(["manual"]);const f=Array.isArray(L)?L:String(L).split(/[\s,|/]+/),k=new Set;return f.forEach(A=>{const H=String(A||"").trim().toLowerCase();H&&(H==="mouseenter"||H==="mouseover"?k.add("hover"):H==="blur"||H==="focusin"?k.add("focus"):H==="tap"?k.add("click"):k.add(H))}),k.size?k:new Set(["manual"])},R=(L,f)=>{var H,ge,Se;let k=null,A=null;if(ie(L))k=L,G(f)&&(A=f);else if(G(L)){A=L;const ye=(Se=(ge=(H=L.anchorEl)!=null?H:L.triggerEl)!=null?ge:L.target)!=null?Se:L.anchor;ie(ye)&&(k=ye)}else L!=null&&(k=L);return{anchorEl:k,nextProps:A}},g=()=>{var be,Ce,pe,Ie,_e,I,we,E,x;const L=W(),f={close:F,dismiss:F,open:a,toggle:P,update:X,isOpen:j,entry:()=>u,anchorEl:q(),props:L},k=L.icon!=null?typeof L.icon=="string"?he.Icon({name:L.icon,size:L.iconSize||"md"}):JSswift.ui.slot(L.icon,{as:"icon"}):null,A=J(s,"eyebrow",f,z(L.eyebrow,f)),H=J(s,"title",f,z((Ce=(be=L.title)!=null?be:L.heading)!=null?Ce:L.label,f)),ge=J(s,"subtitle",f,z((pe=L.subtitle)!=null?pe:L.description,f)),Se=J(s,"icon",f,k),ye=J(s,"header",f,z((_e=(Ie=L.headerContent)!=null?Ie:L.head)!=null?_e:L.header,f)),V=Z(L)?J(s,"close",f,he.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":L.closeLabel||"Chiudi popover","data-popover-close":!0},he.Icon({name:L.closeIcon||"close",size:"sm"}))):[];let O=(E=(we=(I=L.content)!=null?I:L.body)!=null?we:L.message)!=null?E:L.text;O==null&&n&&n.length&&(O=n);let K=J(s,"content",f,z(O,f));K.length||(K=J(s,"body",f,z(O,f))),K.length||(K=J(s,"default",f,z(O,f)));const ke=z((x=L.footer)!=null?x:L.actions,f);let Ne=J(s,"footer",f,ke);Ne.length||(Ne=J(s,"actions",f,ke));let ee=null;ye.length?ee=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...ye):(A.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"},A.length?_.div({class:"cms-dialog-eyebrow"},...A):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",L.bodyClass])},...K)),Ne.length&&xe.push(_.div({class:ae(["cms-dialog-actions",`is-${re(L)}`,fe(L.stackActions,"is-stacked"),L.actionsClass,L.footerClass])},...Ne)),xe.length||xe.push(_.div({class:ae(["cms-dialog-body",L.bodyClass])})),_.div({class:ae(["cms-dialog-shell","cms-popover-shell",fe(!!ee,"has-head"),fe(Ne.length>0,"has-footer"),fe(L.divider!==!1,"with-divider")])},...xe)},d=L=>{var H;if(!(L!=null&&L.panel))return;const f=W(),k=se(f),A=me(f);$(L.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",A?`cms-dialog-${A}`:"",k,k?`cms-state-${k}`:"",l(f.scrollable)?"scrollable":"",l(f.stickyHeader)?"sticky-head":"",l(f.stickyActions)?"sticky-actions":"",l(f.borderless)?"borderless":"",...Q(f.class),...Q(f.panelClass)]),$(L.overlay,"_popoverOverlayClassTokens",[...Q(f.overlayClass)]),L.panel.dataset.placement=oe(f),Y(L.panel,"--cms-dialog-width",l(f.width),Be),Y(L.panel,"--cms-dialog-min-width",l(f.minWidth),Be),Y(L.panel,"--cms-dialog-max-width",l(f.maxWidth),Be),Y(L.panel,"--cms-dialog-max-height",l(f.maxHeight),Be),Y(L.panel,"--cms-dialog-body-max-height",l((H=f.bodyMaxHeight)!=null?H:f.contentMaxHeight),Be),f.style&&Object.assign(L.panel.style,f.style),Ke(L.panel,f),L.panel.setAttribute("role",f.role||"dialog"),L.panel.setAttribute("aria-modal",f.modal===!0?"true":"false"),f.ariaLabel?L.panel.setAttribute("aria-label",f.ariaLabel):L.panel.removeAttribute("aria-label")},m=()=>{u!=null&&u.panel&&u.panel.replaceChildren(g())},F=()=>{if(D(),!u)return;const L=u;u=null,yn(L,()=>JSswift.overlay.close(L.id))},X=(L={})=>(L&&typeof L=="object"&&(y={...y,...L}),u&&(d(u),m()),ce),a=(L=null,f=null)=>{var xe,be,Ce,pe,Ie,_e,I,we;D();const{anchorEl:k,nextProps:A}=R(L,f);A&&(y={...y,...A});const H=W(),ge=q(k);if(!ge||l(H.disabled))return null;if(u&&u._anchorEl===ge)return d(u),m(),u;u&&F(),b=document.activeElement;const Se=ue((be=(xe=H.trigger)!=null?xe:H.triggers)!=null?be:w(H,"open")?"manual":null),ye=Se.has("hover"),V=Se.has("focus");let O=null;if(u=JSswift.overlay.open(()=>g(),{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 E,x,v;(E=O==null?void 0:O._popoverCleanup)==null||E.call(O),(v=(x=W()).onClose)==null||v.call(x,O),W().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const K=u;O=K,K._anchorEl=ge;const ke=()=>{clearTimeout(S),S=null},Ne=()=>{!ye&&!V||h()},ee=E=>{const x=E.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 E,x,v,c,N;(E=K.panel)==null||E.removeEventListener("click",ee),(x=K.panel)==null||x.removeEventListener("mouseenter",ke),(v=K.panel)==null||v.removeEventListener("mouseleave",Ne),(c=K.panel)==null||c.removeEventListener("focusin",ke),(N=K.panel)==null||N.removeEventListener("focusout",Ne)},d(K),bn(K),(we=(I=W()).onOpen)==null||we.call(I,K),K},C=(L,f=null)=>{clearTimeout(S),S=null,clearTimeout(T),T=setTimeout(()=>a(L,f),te())},h=(L=!1)=>{if(clearTimeout(T),T=null,!!u){if(clearTimeout(S),L){F();return}S=setTimeout(()=>F(),M())}},P=(L=null,f=null)=>j()?(F(),null):a(L,f),j=()=>!!u,ce={open:a,close:F,show:C,hide:h,toggle:P,update:X,bind:L=>{var O,K;if(!L)return()=>{};i=L;const f=W(),k=ue((K=(O=f.trigger)!=null?O:f.triggers)!=null?K:w(f,"open")?"manual":null),A=k.has("hover"),H=k.has("focus"),ge=k.has("click"),Se=k.has("manual")||!A&&!H&&!ge,ye=[],V=()=>{D(),ye.forEach(ke=>ke()),i===L&&(i=null)};if(w(f,"open"))return at(f.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?a(i):h(!0))},"UI.Popover:open"):f.open===!0?a(L):f.open===!1&&h(!0),V;if(Se||l(f.disabled))return V;if(A){const ke=()=>C(L),Ne=()=>h();L.addEventListener("mouseenter",ke),L.addEventListener("mouseleave",Ne),ye.push(()=>{L.removeEventListener("mouseenter",ke),L.removeEventListener("mouseleave",Ne)})}if(H){const ke=()=>C(L),Ne=()=>h();L.addEventListener("focus",ke),L.addEventListener("blur",Ne),ye.push(()=>{L.removeEventListener("focus",ke),L.removeEventListener("blur",Ne)})}if(ge){const ke=Ne=>{var ee,xe;(xe=(ee=W()).onTriggerClick)==null||xe.call(ee,Ne),!Ne.defaultPrevented&&P(L)};L.addEventListener("click",ke),ye.push(()=>L.removeEventListener("click",ke))}return V},isOpen:j,entry:()=>u,props:()=>({...y})};return ce},he.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},o=null,r=null,y=null;const u=m=>m&&typeof m=="object"&&!m.nodeType&&!Array.isArray(m)&&!(m instanceof Function),i=m=>!!m&&typeof m=="object"&&(m.nodeType===1||typeof m.getBoundingClientRect=="function"),b=m=>!!m&&typeof m=="object"&&("clientX"in m||"type"in m||"target"in m||"currentTarget"in m),T=m=>!!m&&Number.isFinite(Number(m.x))&&Number.isFinite(Number(m.y)),S=()=>s,w=(m,F)=>{const X=Number(m),a=Number(F);return!Number.isFinite(X)||!Number.isFinite(a)?null:{x:X,y:a}},z=m=>m?{_cmsContextPoint:m,getBoundingClientRect:()=>({top:m.y,bottom:m.y,left:m.x,right:m.x,width:0,height:0})}:null,Q=m=>{if(!i(m))return null;const F=m.getBoundingClientRect();return w(F.left+Math.min(F.width/2,24),F.top+Math.min(F.height/2,24))},G=m=>{var F,X,a,C;return l((C=(a=(X=(F=m==null?void 0:m.anchorEl)!=null?F:m==null?void 0:m.triggerEl)!=null?X:m==null?void 0:m.target)!=null?a:m==null?void 0:m.anchor)!=null?C:null)},ie=(m,F=null)=>{if(!m)return Q(F||y);const X=w(m.clientX,m.clientY);if(X)return X;const a=G({anchorEl:F||m.currentTarget||m.target||y});return Q(a)},D=(m={})=>{if(!u(m))return{};const F={...m};return delete F.event,delete F.point,delete F.x,delete F.y,F},$=()=>{var F,X,a;const m=S();return{...m,trigger:"manual",placement:m.placement||"bottom-start",offsetX:(F=m.offsetX)!=null?F:0,offsetY:(a=(X=m.offsetY)!=null?X:m.offset)!=null?a:4,closeOnOutside:m.closeOnOutside!==!1,closeOnEsc:m.closeOnEsc!==!1,role:m.role||"menu",ariaLabel:m.ariaLabel||m.title||"Context menu",class:ae(["cms-context-menu-shell",m.class]),panelClass:ae(["cms-context-menu-panel",m.panelClass])}},Y=he.Menu($(),...n),W=(m=null,F=null,X=null)=>{let a=null,C=null,h=null;if(b(m))a=ie(m,y),h=u(F)?D(F):null;else if(typeof m=="number"||typeof F=="number")a=w(m,F),h=u(X)?D(X):null;else if(T(m))a=w(m.x,m.y),h=u(F)?D(F):null;else if(i(m))C=m,h=u(F)?D(F):null;else if(u(m)){const P=T(m.point)?m.point:T(m)?m:null,j=G(m),U=m.event;a=P?w(P.x,P.y):ie(U,j||y),C=j&&i(j)?j:null,h={...D(m),...u(F)?D(F):{}}}else o&&(a={...o});return{point:a,anchor:C,nextProps:h}},se=(m,F=null)=>{r=m||r,o=F||m&&m._cmsContextPoint||o},me=(m=null)=>{u(m)&&Object.keys(m).length&&(s={...s,...m})},re=(m=null,F=null)=>{if(F)return z(F);if(m&&i(m))return m;const X=G(S());return i(X)?X:o?z(o):i(r)?r:i(y)?y:null},oe=(m=null,F=null,X=null)=>{const{point:a,anchor:C,nextProps:h}=W(m,F,X);me(h);const P=re(C,a);return P?(se(P,a),Y.open(P,$())):null},le=(m,F,X=null)=>oe(m,F,X),te=(m,F=null)=>oe(m,F),M=()=>(Y.close(),d),Z=(m=!0)=>(m===!1?Y.hide(!1):Y.close(),d),q=(m=null,F=null,X=null)=>oe(m,F,X),ue=(m=null,F=null,X=null)=>Y.isOpen()?(M(),null):oe(m,F,X),R=(m={})=>(me(D(m)),Y.update($()),d),d={open:oe,openAt:le,openFromEvent:te,show:q,hide:Z,close:M,toggle:ue,update:R,bind:(m,F=null)=>{if(!m)return()=>{};const X=u(F)?D(F):null,a=h=>{var j,U;y=m,h.preventDefault(),!(((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:m,open:oe,close:M,update:R}))===!1||l(S().disabled))&&oe({event:h,anchorEl:m},X)},C=h=>{var j,U;h.key!=="ContextMenu"&&!(h.shiftKey&&h.key==="F10")||(y=m,h.preventDefault(),((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:m,open:oe,close:M,update:R}))===!1||l(S().disabled))||oe({event:h,anchorEl:m},X)};return m.addEventListener("contextmenu",a),m.addEventListener("keydown",C),()=>{m.removeEventListener("contextmenu",a),m.removeEventListener("keydown",C)}},isOpen:Y.isOpen,entry:Y.entry,props:()=>({...s})};return d}})(JSswift);
|
|
34
|
+
`,document.head.appendChild(y),kt._textNode=n,kt._spinner=e,kt._progressWrap=s,kt._progressBar=o,kt._progressActive=!1,kt}function yl(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 wl(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=bl(),s=yl(t,e);In++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",wl(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=bl();typeof t=="object"&&t!==null&&(e=t,t=(r=t.value)!=null?r:0);const s=yl(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+"%",wl(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 qo(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 Xo(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=qo(t);return Array.isArray(e)?e:[]}function vl(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 Sl(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 Zo(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 ei(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 y=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var T;return(T=b==null?void 0:b.searchKey)!=null?T:b==null?void 0:b.key}).filter(Boolean),u=[];if(y.length)for(const b of y)if(typeof b=="function")u.push(Qn(b(t)));else{const T=e.find(S=>(S==null?void 0:S.key)===b||(S==null?void 0:S.searchKey)===b);u.push(Qn(T?qn(T,t,-1):Ss(t,b)))}else u.push(Qn(t));const i=u.join(" ").toLowerCase();return r.every(b=>i.includes(b))}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=Zo(e.pageSizeOptions,[5,10,20,50]),y=Number((ee=(Ne=e.pageSize)!=null?Ne:r[0])!=null?ee:10)||10,u=Array.from(new Set([...r,y])).sort((Ce,pe)=>Ce-pe),i=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",T=Nt(e.searchModel||e.queryModel,"UI.Table:query"),[S,w]=He.reactive.signal(Math.max(1,Number(e.page||1)||1)),[z,Q]=He.reactive.signal(y),[G,ie]=He.reactive.signal(i),[D,$]=He.reactive.signal(String((be=T?T.get():(xe=e.search)!=null?xe:e.query)!=null?be:"")),Y=Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),T&&T.set(pe),w(1)},W=Ce=>{const pe=Number(Ce)||y;Q(pe),w(1)},se=(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),w(1)};let me=null;T&&T.watch(Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),me&&me.value!==pe&&(me.value=pe),w(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","hideStatus","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"}),le=J(s,"default",{},n);le.length&&oe.appendChild(_.div({class:"cms-table-lead"},...le));const te=J(s,"toolbarStart",{},e.toolbarStart),M=J(s,"toolbar",{},e.toolbar),Z=J(s,"toolbarEnd",{},e.toolbarEnd),q=_.div({class:"cms-table-toolbar"}),ue=_.div({class:"cms-table-toolbar-main"}),R=_.div({class:"cms-table-toolbar-side"});te.forEach(Ce=>ue.appendChild(Ce)),M.forEach(Ce=>ue.appendChild(Ce));const g=J(s,"search",{query:D(),getQuery:D,setQuery:Y},null);if(g.length)g.forEach(Ce=>R.appendChild(Ce));else if(b){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");R.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),me,Ce))}Z.forEach(Ce=>R.appendChild(Ce)),(ue.childNodes.length||R.childNodes.length)&&(q.appendChild(ue),q.appendChild(R),oe.appendChild(q));const d=_.div({class:"cms-singularity cms-table-chip"},""),m=_.div({class:"cms-singularity cms-table-chip"},""),F=_.div({class:"cms-singularity cms-table-chip"},""),X=J(s,"status",{},e.status),a=_.div({class:"cms-table-status"},d,m,F,...X);e.hideStatus!==!0&&oe.appendChild(a);const C=J(s,"caption",{},e.caption);C.length&&oe.appendChild(_.div({class:"cms-table-caption"},...C));const h=_.thead(),P=_.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 L=_.table({class:U,style:ce},h,P),f=_.div({class:"cms-singularity cms-table-wrap"},L);oe.appendChild(f);const k=_.div({class:"cms-singularity cms-table-chip"},""),A=_.div({class:"cms-singularity cms-table-chip"},""),H=he.Btn({outline:!0,onClick:()=>w(Math.max(1,S()-1))},"\u2039"),ge=he.Btn({outline:!0,onClick:()=>w(S()+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(z()),ye.addEventListener("change",()=>W(ye.value));const V=J(s,"footer",{},e.footer),O=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},k,A,_.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,Ae;const _e={col:pe,colIndex:Ie,sort:G()},I={...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&&(I.width=Be(pe.width)),(pe==null?void 0:pe.minWidth)!=null&&(I.minWidth=Be(pe.minWidth)),(pe==null?void 0:pe.maxWidth)!=null&&(I.maxWidth=Be(pe.maxWidth)),pe!=null&&pe.align&&(I.textAlign=pe.align);let we=J(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):(Ae=pe==null?void 0:pe.header)!=null?Ae:vl(pe);we=J(s,"header",_e,Je)}const E=G(),x=Cs(pe,Ie),v=(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=!!E&&(E.key===x||E.key===(pe==null?void 0:pe.key)),N=_.th({class:ae(["cms-table-head-cell",fe(pe==null?void 0:pe.nowrap,"is-nowrap"),fe(v,"cms-table-sortable"),fe(c,"is-sorted"),pe==null?void 0:pe.headerClass]),style:I});v?N.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>se(pe,Ie)},_.span({class:"cms-table-head-label"},...we),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},c?E.dir==="asc"?"\u2191":"\u2193":"\u2195"))):we.forEach(Je=>N.appendChild(Je)),Ce.appendChild(N)}),j){const pe=J(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=J(s,Ce,Ie,pe),I=String(o.length+(j?1:0));P.appendChild(_.tr(_.td({colSpan:I,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,I=e.pagination!==!1;if(K(),P.innerHTML="",me&&me.value!==D()&&(me.value=D()),ye.value!==String(z())&&(ye.value=String(z())),_e){d.textContent="Caricamento in corso",m.style.display="none",F.style.display="none",k.textContent="Loading\u2026",A.textContent="",Se.textContent="Pagina 1",H.disabled=!0,ge.disabled=!0,ke("loading",e.loadingText||"Loading...");return}let we=Ce.slice();const E=we.length;if(typeof e.filter=="function"&&(we=we.filter((B,Le)=>e.filter(B,{row:B,index:Le,query:pe,rows:Ce,columns:o}))),pe&&(we=we.filter(B=>ei(B,o,pe,e))),Ie){const B=Sl(o,Ie.key);B&&we.sort((Le,Me)=>{const Ee=qn(B,Le,-1),De=qn(B,Me,-1),Ue=typeof B.compare=="function"?B.compare(Ee,De,Le,Me):Xo(Ee,De);return Ie.dir==="asc"?Ue:-Ue})}const x=we.length,v=Math.max(1,Number(z())||y),c=I?Math.max(1,Math.ceil(x/v)):1,N=I?Math.min(S(),c):1;N!==S()&&w(N);const de=I?(N-1)*v:0,Ae=I?de+v:x,Je=we.slice(de,Ae);if(d.textContent=x===E?`${x} righe`:`${x} di ${E} righe`,m.textContent=pe?`Ricerca: ${pe}`:"",m.style.display=pe?"":"none",Ie){const B=Sl(o,Ie.key);F.textContent=B?`Ordine: ${vl(B)} ${Ie.dir==="asc"?"\u2191":"\u2193"}`:"",F.style.display=B?"":"none"}else F.style.display="none";if(k.textContent=x?`${de+1}-${Math.min(Ae,x)} di ${x}`:"0 risultati",A.textContent=x!==E?`Dataset totale ${E}`:`Page size ${v}`,Se.textContent=I?`Pagina ${N} / ${c}`:"Tutte le righe",H.disabled=!I||N<=1,ge.disabled=!I||N>=c,ye.disabled=!I,ye.parentNode.style.display=I?"":"none",Je.length===0){ke("empty",e.emptyText||"Nessun dato");return}for(let B=0;B<Je.length;B++){const Le=Je[B],Me=de+B,Ee={row:Le,rowIndex:Me,pageIndex:B},De=typeof e.rowAttrs=="function"?e.rowAttrs(Le,Ee)||{}:e.rowAttrs||{},Ue=typeof e.rowClass=="function"?e.rowClass(Le,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(Le,Ee):Ss(Le,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(Le,Ee,Te)}),e.onRowDblClick&&Ze.addEventListener("dblclick",Te=>{Qe(Te)||e.onRowDblClick(Le,Ee,Te)}),o.forEach((Te,je)=>{var ft,vt;const tt=qn(Te,Le,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(Le,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=J(Te==null?void 0:Te.slots,"cell",nt,null);if(!lt.length){const _t=typeof(Te==null?void 0:Te.render)=="function"?Te.render(Le,nt):typeof(Te==null?void 0:Te.format)=="function"?Te.format(tt,Le,nt):tt,rt=_t==null?(vt=Te==null?void 0:Te.emptyText)!=null?vt:"":_t;lt=J(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(Le,Ee):e.actions;let tt=J(s,"actions",Te,je);tt.length||(tt=J(null,"default",Te,je)),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"),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 y={...e},u=null,i=null,b=null,T=null,S=null;const w=(f,k)=>Object.prototype.hasOwnProperty.call(f||{},k),z=(f,k)=>typeof f=="function"?f(k):f,Q=f=>String(f||"").split(/\s+/).filter(Boolean),G=f=>f&&typeof f=="object"&&!f.nodeType&&!Array.isArray(f)&&!(f instanceof Function),ie=f=>!!f&&typeof f=="object"&&(f.nodeType===1||typeof f.getBoundingClientRect=="function"),D=()=>{clearTimeout(T),clearTimeout(S),T=null,S=null},$=(f,k,A)=>{if(!f)return;const H=f[k]||[];H.length&&f.classList.remove(...H);const ge=(A||[]).filter(Boolean);ge.length&&f.classList.add(...ge),f[k]=ge},Y=(f,k,A,H=ge=>ge)=>{if(f){if(A==null||A===""){f.style.removeProperty(k);return}f.style.setProperty(k,H(A))}},W=()=>y||{},se=f=>{var A;const k=String(l((A=f.state)!=null?A:f.color)||"").toLowerCase();return o.includes(k)?k:""},me=f=>{const k=String(l(f.size)||"").toLowerCase();return r.includes(k)?k:""},re=f=>{var k,A;return String(l((A=(k=f.placement)!=null?k:f.position)!=null?A:"bottom-start"))},oe=()=>{var A;const f=l((A=W().delay)!=null?A:W().showDelay),k=Number(f);return Number.isFinite(k)?Math.max(0,k):0},le=()=>{const f=l(W().hideDelay),k=Number(f);return Number.isFinite(k)?Math.max(0,k):80},te=(f=null)=>{var A,H,ge;if(f)return f;const k=W();return i||l((ge=(H=(A=k.anchorEl)!=null?A:k.triggerEl)!=null?H:k.target)!=null?ge:k.anchor)||null},M=f=>{if(f==null||f===!0)return new Set(["click"]);if(f===!1)return new Set(["manual"]);const k=Array.isArray(f)?f:String(f).split(/[\s,|/]+/),A=new Set;return k.forEach(H=>{const ge=String(H||"").trim().toLowerCase();ge&&(ge==="mouseenter"||ge==="mouseover"?A.add("hover"):ge==="blur"||ge==="focusin"?A.add("focus"):ge==="tap"?A.add("click"):A.add(ge))}),A.size?A:new Set(["manual"])},Z=(f,k)=>{var ge,Se,ye;let A=null,H=null;if(ie(f))A=f,G(k)&&(H=k);else if(G(f)){H=f;const V=(ye=(Se=(ge=f.anchorEl)!=null?ge:f.triggerEl)!=null?Se:f.target)!=null?ye:f.anchor;ie(V)&&(A=V)}else f!=null&&(A=f);return{anchorEl:A,nextProps:H}},q=(f=u==null?void 0:u.panel)=>{var k;return Array.from(((k=f==null?void 0:f.querySelectorAll)==null?void 0:k.call(f,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(A=>A.offsetParent!==null&&A.getAttribute("aria-hidden")!=="true")},ue=()=>{l(W().autoFocus)!==!1&&setTimeout(()=>{const f=q();if(!f.length)return;(f.find(A=>A.classList.contains("is-active")||A.classList.contains("is-selected")||A.classList.contains("is-checked"))||f[0]).focus()},0)},R=(f,k,A="sm")=>{const H=z(f,k);return H==null?[]:typeof H=="string"?[he.Icon({name:H,size:A})]:Ln(H,{...k,as:"icon"})},g=(f,k)=>{var de,Ae,Je,B,Le,Me,Ee,De,Ue,Ye,Ze,Qe,Te;const A=z(f,k);if(A==null||A===!1)return[];if(Array.isArray(A))return A.flatMap((je,tt)=>g(je,{...k,index:tt}));if(typeof A=="function")return g(A(k),k);if(A!=null&&A.nodeType)return[A];if(typeof A=="string"||typeof A=="number")return g({label:A},k);if(!G(A))return Ln(A,{...k,as:"item"});const H=String((Ae=(de=A.type)!=null?de:A.kind)!=null?Ae:"").toLowerCase();if(H==="separator"||H==="divider"||A.separator===!0||A.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ge=(Je=A.items)!=null?Je:A.children;if((H==="group"||H==="section"||Array.isArray(ge))&&ge!=null){const je={...k,item:A},tt=J(s,"groupLabel",je,z((B=A.label)!=null?B:A.title,je)),nt=g(ge,je);return nt.length?[_.div({class:ae(["cms-menu-group",A.class])},tt.length?_.div({class:"cms-menu-group-label"},...tt):null,_.div({class:"cms-menu-group-items"},...nt))]:[]}const Se={...k,item:A,close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:W()},ye=!!l(A.disabled),V=A.checked==null?null:!!l(A.checked),O=!!l((Le=A.active)!=null?Le:A.selected),K=se(A),ke=l(A.href),Ne=l(A.to),ee=w(A,"closeOnSelect")?!!l(A.closeOnSelect):A.keepOpen===!0?!1:W().closeOnSelect!==!1,xe=A.role||(V!=null?"menuitemcheckbox":"menuitem"),be=R(A.icon,Se),Ce=R((Me=A.iconRight)!=null?Me:A.endIcon,Se),pe=J(s,"itemTitle",Se,z((Ee=A.title)!=null?Ee:A.label,Se)),Ie=J(s,"itemSubtitle",Se,z((De=A.subtitle)!=null?De:A.description,Se)),_e=J(s,"itemShortcut",Se,z(A.shortcut,Se)),I=J(s,"itemBadge",Se,z(A.badge,Se)),we=J(s,"item",Se,z((Ye=(Ue=A.content)!=null?Ue:A.body)!=null?Ye:A.render,Se)),E=[...I,..._e,...V===!0&&!Ce.length&&!I.length?[_.span({class:"cms-menu-entry-check"},he.Icon({name:A.checkedIcon||"check",size:"sm"}))]:[],...Ce],v={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"),A.class]),role:xe,tabIndex:ye?-1:(Ze=A.tabIndex)!=null?Ze:-1,"data-menu-item":!0,"data-menu-select":ee?"true":"false","data-menu-close":A.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=A.titleAttr)!=null?Qe:A.tooltip)!=null?Te:null,type:ke?null:"button",href:ke||null,target:A.target||null,rel:A.rel||(A.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,A,Se,je);const tt=(dt=A.onClick)==null?void 0:dt.call(A,Se,je);je.defaultPrevented||(Ne&&((bt=JSswift.router)!=null&&bt.navigate)&&(je.preventDefault(),JSswift.router.navigate(Ne)),tt!==!1&&ee&&X())}};A.attrs&&typeof A.attrs=="object"&&Object.assign(v,A.attrs);const c=ke?_.a:_.button,N=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(v,be.length?_.span({class:"cms-menu-entry-icon"},...be):null,_.span({class:"cms-menu-entry-main"},...N),E.length?_.span({class:"cms-menu-entry-aside"},...E):null)]},d=()=>{var pe,Ie,_e,I,we,E,x;const f=W(),k={close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:f},A=R(f.icon,k,f.iconSize||"md"),H=J(s,"eyebrow",k,z(f.eyebrow,k)),ge=J(s,"title",k,z((Ie=(pe=f.title)!=null?pe:f.heading)!=null?Ie:f.label,k)),Se=J(s,"subtitle",k,z((_e=f.subtitle)!=null?_e:f.description,k)),ye=J(s,"before",k,z(f.before,k)),V=J(s,"header",k,z(f.header,k)),O=J(s,"after",k,z(f.after,k)),K=J(s,"footer",k,z(f.footer,k)),ke=J(s,"status",k,z(f.status,k));let Ne=(I=f.content)!=null?I:f.body;Ne==null&&n&&n.length&&(Ne=n);let ee=J(s,"content",k,z(Ne,k));ee.length||(ee=J(s,"body",k,z(Ne,k))),ee.length||(ee=J(s,"default",k,z(Ne,k)));const xe=g((E=(we=f.items)!=null?we:f.actionsList)!=null?E:f.entries,k),be=xe.length?[]:J(s,"empty",k,z((x=f.empty)!=null?x:f.emptyText,k));let Ce=null;return V.length?Ce=_.div({class:ae(["cms-menu-head","cms-menu-head-custom",f.headerClass])},...V):(A.length||H.length||ge.length||Se.length)&&(Ce=_.div({class:ae(["cms-menu-head",f.headerClass])},A.length?_.div({class:"cms-menu-head-icon"},...A):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(f.dense,"dense"),fe(xe.length>0,"has-items"),fe(K.length>0||ke.length>0,"has-footer"),f.class]),style:f.style||{},role:f.role||"menu","aria-label":f.ariaLabel||null},ye.length?_.div({class:"cms-menu-before"},...ye):null,Ce,ee.length?_.div({class:ae(["cms-menu-content",f.contentClass])},...ee):null,xe.length?_.div({class:ae(["cms-menu-items",f.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",f.footerClass])},ke.length?_.div({class:"cms-menu-status"},...ke):null,K.length?_.div({class:"cms-menu-footer-actions"},...K):null):null)},m=f=>{var ge;if(!(f!=null&&f.panel))return;const k=W(),A=se(k),H=me(k);$(f.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",H?`cms-menu-${H}`:"",A?`cms-state-${A}`:"",l(k.outline)?"outline":"",...Q(k.panelClass)]),$(f.overlay,"_menuOverlayClassTokens",[...Q(k.overlayClass)]),f.panel.dataset.placement=re(k),Y(f.panel,"--cms-menu-width",l(k.width),Be),Y(f.panel,"--cms-menu-min-width",l(k.minWidth),Be),Y(f.panel,"--cms-menu-max-width",l(k.maxWidth),Be),Y(f.panel,"--cms-menu-max-height",l(k.maxHeight),Be),Y(f.panel,"--cms-menu-body-max-height",l((ge=k.bodyMaxHeight)!=null?ge:k.contentMaxHeight),Be),k.panelStyle&&Object.assign(f.panel.style,k.panelStyle),Ke(f.panel,k)},F=()=>{u!=null&&u.panel&&u.panel.replaceChildren(d())},X=()=>{if(D(),!u)return;const f=u;u=null,yn(f,()=>JSswift.overlay.close(f.id))},a=(f={})=>{var k,A,H,ge;if(f&&typeof f=="object"&&(y={...y,...f}),u){const Se=W();m(u),F(),(ge=u.reposition)==null||ge.call(u,{anchorEl:u._anchorEl,placement:re(Se),offsetX:(k=Se.offsetX)!=null?k:0,offsetY:(H=(A=Se.offsetY)!=null?A:Se.offset)!=null?H:8}),ue()}return L},C=(f=null,k=null)=>{var Ce,pe,Ie,_e,I,we,E,x,v,c,N,de,Ae,Je,B,Le;D();const{anchorEl:A,nextProps:H}=Z(f,k);H&&(y={...y,...H});const ge=W(),Se=te(A);if(!Se||l(ge.disabled))return null;if(u&&u._anchorEl===Se){const Me=W();return m(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(),b=document.activeElement;let ye=null;if(u=JSswift.overlay.open(()=>d(),{type:"menu",anchorEl:Se,placement:re(ge),offsetX:(I=ge.offsetX)!=null?I:0,offsetY:(E=(we=ge.offsetY)!=null?we:ge.offset)!=null?E: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&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const V=u;ye=V,V._anchorEl=Se;const O=()=>{clearTimeout(S),S=null},K=()=>{P()},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=(v=ge.trigger)!=null?v:ge.triggers)!=null?c:w(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)},m(V),(Je=V.reposition)==null||Je.call(V,{anchorEl:Se,placement:re(ge),offsetX:(N=ge.offsetX)!=null?N:0,offsetY:(Ae=(de=ge.offsetY)!=null?de:ge.offset)!=null?Ae:8}),bn(V),(Le=(B=W()).onOpen)==null||Le.call(B,V),ue(),V},h=(f,k=null)=>{clearTimeout(S),S=null,clearTimeout(T),T=setTimeout(()=>C(f,k),oe())},P=(f=!1)=>{if(clearTimeout(T),T=null,!!u){if(clearTimeout(S),f){X();return}S=setTimeout(()=>X(),le())}},j=(f=null,k=null)=>U()?(X(),null):C(f,k),U=()=>!!u,L={open:C,close:X,show:h,hide:P,toggle:j,update:a,bind:f=>{var K,ke;if(!f)return()=>{};i=f;const k=W(),A=M((ke=(K=k.trigger)!=null?K:k.triggers)!=null?ke:w(k,"open")?"manual":null),H=A.has("hover"),ge=A.has("focus"),Se=A.has("click"),ye=A.has("manual")||!H&&!ge&&!Se,V=[],O=()=>{D(),V.forEach(Ne=>Ne()),i===f&&(i=null)};if(w(k,"open"))return at(k.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?C(i):P(!0))},"UI.Menu:open"):k.open===!0?C(f):k.open===!1&&P(!0),O;if(ye||l(k.disabled))return O;if(H){const Ne=()=>h(f),ee=()=>P();f.addEventListener("mouseenter",Ne),f.addEventListener("mouseleave",ee),V.push(()=>{f.removeEventListener("mouseenter",Ne),f.removeEventListener("mouseleave",ee)})}if(ge){const Ne=()=>h(f),ee=()=>P();f.addEventListener("focus",Ne),f.addEventListener("blur",ee),V.push(()=>{f.removeEventListener("focus",Ne),f.removeEventListener("blur",ee)})}if(Se){const Ne=ee=>{var xe,be;(be=(xe=W()).onTriggerClick)==null||be.call(xe,ee),!ee.defaultPrevented&&j(f)};f.addEventListener("click",Ne),V.push(()=>f.removeEventListener("click",Ne))}return O},isOpen:U,entry:()=>u,props:()=>({...y})};return L},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 y={...e},u=null,i=null,b=null,T=null,S=null;const w=(L,f)=>Object.prototype.hasOwnProperty.call(L||{},f),z=(L,f)=>typeof L=="function"?L(f):L,Q=L=>String(L||"").split(/\s+/).filter(Boolean),G=L=>L&&typeof L=="object"&&!L.nodeType&&!Array.isArray(L)&&!(L instanceof Function),ie=L=>!!L&&typeof L=="object"&&(L.nodeType===1||typeof L.getBoundingClientRect=="function"),D=()=>{clearTimeout(T),clearTimeout(S),T=null,S=null},$=(L,f,k)=>{if(!L)return;const A=L[f]||[];A.length&&L.classList.remove(...A);const H=(k||[]).filter(Boolean);H.length&&L.classList.add(...H),L[f]=H},Y=(L,f,k,A=H=>H)=>{if(L){if(k==null||k===""){L.style.removeProperty(f);return}L.style.setProperty(f,A(k))}},W=()=>y,se=L=>{var k;const f=l((k=L.state)!=null?k:L.color);return f?o.includes(f)?f:String(f):""},me=L=>{const f=l(L.size);return typeof f=="string"&&r.includes(f)?f:""},re=L=>{var k,A,H;const f=String(l((H=(A=(k=L.actionsAlign)!=null?k:L.footerAlign)!=null?A:L.alignActions)!=null?H:"end")).toLowerCase();return["start","left"].includes(f)?"start":["center","middle"].includes(f)?"center":["between","space-between"].includes(f)?"between":["stretch","full"].includes(f)?"stretch":"end"},oe=L=>{var f,k;return String(l((k=(f=L.placement)!=null?f:L.position)!=null?k:"bottom-start"))},le=(L,f)=>{const k=l(L);if(k==null||k==="")return f;const A=Number(k);return Number.isFinite(A)?A:f},te=()=>le(W().delay,0),M=()=>le(W().hideDelay,120),Z=L=>{var k,A;return((A=(k=L.closable)!=null?k:L.dismissible)!=null?A:L.closeButton)===!0},q=(L=null)=>{var k,A,H;if(L)return L;const f=W();return i||l((H=(A=(k=f.anchorEl)!=null?k:f.triggerEl)!=null?A:f.target)!=null?H:f.anchor)||null},ue=L=>{if(L==null||L===!0)return new Set(["click"]);if(L===!1)return new Set(["manual"]);const f=Array.isArray(L)?L:String(L).split(/[\s,|/]+/),k=new Set;return f.forEach(A=>{const H=String(A||"").trim().toLowerCase();H&&(H==="mouseenter"||H==="mouseover"?k.add("hover"):H==="blur"||H==="focusin"?k.add("focus"):H==="tap"?k.add("click"):k.add(H))}),k.size?k:new Set(["manual"])},R=(L,f)=>{var H,ge,Se;let k=null,A=null;if(ie(L))k=L,G(f)&&(A=f);else if(G(L)){A=L;const ye=(Se=(ge=(H=L.anchorEl)!=null?H:L.triggerEl)!=null?ge:L.target)!=null?Se:L.anchor;ie(ye)&&(k=ye)}else L!=null&&(k=L);return{anchorEl:k,nextProps:A}},g=()=>{var be,Ce,pe,Ie,_e,I,we,E,x;const L=W(),f={close:F,dismiss:F,open:a,toggle:P,update:X,isOpen:j,entry:()=>u,anchorEl:q(),props:L},k=L.icon!=null?typeof L.icon=="string"?he.Icon({name:L.icon,size:L.iconSize||"md"}):JSswift.ui.slot(L.icon,{as:"icon"}):null,A=J(s,"eyebrow",f,z(L.eyebrow,f)),H=J(s,"title",f,z((Ce=(be=L.title)!=null?be:L.heading)!=null?Ce:L.label,f)),ge=J(s,"subtitle",f,z((pe=L.subtitle)!=null?pe:L.description,f)),Se=J(s,"icon",f,k),ye=J(s,"header",f,z((_e=(Ie=L.headerContent)!=null?Ie:L.head)!=null?_e:L.header,f)),V=Z(L)?J(s,"close",f,he.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":L.closeLabel||"Chiudi popover","data-popover-close":!0},he.Icon({name:L.closeIcon||"close",size:"sm"}))):[];let O=(E=(we=(I=L.content)!=null?I:L.body)!=null?we:L.message)!=null?E:L.text;O==null&&n&&n.length&&(O=n);let K=J(s,"content",f,z(O,f));K.length||(K=J(s,"body",f,z(O,f))),K.length||(K=J(s,"default",f,z(O,f)));const ke=z((x=L.footer)!=null?x:L.actions,f);let Ne=J(s,"footer",f,ke);Ne.length||(Ne=J(s,"actions",f,ke));let ee=null;ye.length?ee=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...ye):(A.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"},A.length?_.div({class:"cms-dialog-eyebrow"},...A):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",L.bodyClass])},...K)),Ne.length&&xe.push(_.div({class:ae(["cms-dialog-actions",`is-${re(L)}`,fe(L.stackActions,"is-stacked"),L.actionsClass,L.footerClass])},...Ne)),xe.length||xe.push(_.div({class:ae(["cms-dialog-body",L.bodyClass])})),_.div({class:ae(["cms-dialog-shell","cms-popover-shell",fe(!!ee,"has-head"),fe(Ne.length>0,"has-footer"),fe(L.divider!==!1,"with-divider")])},...xe)},d=L=>{var H;if(!(L!=null&&L.panel))return;const f=W(),k=se(f),A=me(f);$(L.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",A?`cms-dialog-${A}`:"",k,k?`cms-state-${k}`:"",l(f.scrollable)?"scrollable":"",l(f.stickyHeader)?"sticky-head":"",l(f.stickyActions)?"sticky-actions":"",l(f.borderless)?"borderless":"",...Q(f.class),...Q(f.panelClass)]),$(L.overlay,"_popoverOverlayClassTokens",[...Q(f.overlayClass)]),L.panel.dataset.placement=oe(f),Y(L.panel,"--cms-dialog-width",l(f.width),Be),Y(L.panel,"--cms-dialog-min-width",l(f.minWidth),Be),Y(L.panel,"--cms-dialog-max-width",l(f.maxWidth),Be),Y(L.panel,"--cms-dialog-max-height",l(f.maxHeight),Be),Y(L.panel,"--cms-dialog-body-max-height",l((H=f.bodyMaxHeight)!=null?H:f.contentMaxHeight),Be),f.style&&Object.assign(L.panel.style,f.style),Ke(L.panel,f),L.panel.setAttribute("role",f.role||"dialog"),L.panel.setAttribute("aria-modal",f.modal===!0?"true":"false"),f.ariaLabel?L.panel.setAttribute("aria-label",f.ariaLabel):L.panel.removeAttribute("aria-label")},m=()=>{u!=null&&u.panel&&u.panel.replaceChildren(g())},F=()=>{if(D(),!u)return;const L=u;u=null,yn(L,()=>JSswift.overlay.close(L.id))},X=(L={})=>(L&&typeof L=="object"&&(y={...y,...L}),u&&(d(u),m()),ce),a=(L=null,f=null)=>{var xe,be,Ce,pe,Ie,_e,I,we;D();const{anchorEl:k,nextProps:A}=R(L,f);A&&(y={...y,...A});const H=W(),ge=q(k);if(!ge||l(H.disabled))return null;if(u&&u._anchorEl===ge)return d(u),m(),u;u&&F(),b=document.activeElement;const Se=ue((be=(xe=H.trigger)!=null?xe:H.triggers)!=null?be:w(H,"open")?"manual":null),ye=Se.has("hover"),V=Se.has("focus");let O=null;if(u=JSswift.overlay.open(()=>g(),{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 E,x,v;(E=O==null?void 0:O._popoverCleanup)==null||E.call(O),(v=(x=W()).onClose)==null||v.call(x,O),W().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const K=u;O=K,K._anchorEl=ge;const ke=()=>{clearTimeout(S),S=null},Ne=()=>{!ye&&!V||h()},ee=E=>{const x=E.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 E,x,v,c,N;(E=K.panel)==null||E.removeEventListener("click",ee),(x=K.panel)==null||x.removeEventListener("mouseenter",ke),(v=K.panel)==null||v.removeEventListener("mouseleave",Ne),(c=K.panel)==null||c.removeEventListener("focusin",ke),(N=K.panel)==null||N.removeEventListener("focusout",Ne)},d(K),bn(K),(we=(I=W()).onOpen)==null||we.call(I,K),K},C=(L,f=null)=>{clearTimeout(S),S=null,clearTimeout(T),T=setTimeout(()=>a(L,f),te())},h=(L=!1)=>{if(clearTimeout(T),T=null,!!u){if(clearTimeout(S),L){F();return}S=setTimeout(()=>F(),M())}},P=(L=null,f=null)=>j()?(F(),null):a(L,f),j=()=>!!u,ce={open:a,close:F,show:C,hide:h,toggle:P,update:X,bind:L=>{var O,K;if(!L)return()=>{};i=L;const f=W(),k=ue((K=(O=f.trigger)!=null?O:f.triggers)!=null?K:w(f,"open")?"manual":null),A=k.has("hover"),H=k.has("focus"),ge=k.has("click"),Se=k.has("manual")||!A&&!H&&!ge,ye=[],V=()=>{D(),ye.forEach(ke=>ke()),i===L&&(i=null)};if(w(f,"open"))return at(f.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?a(i):h(!0))},"UI.Popover:open"):f.open===!0?a(L):f.open===!1&&h(!0),V;if(Se||l(f.disabled))return V;if(A){const ke=()=>C(L),Ne=()=>h();L.addEventListener("mouseenter",ke),L.addEventListener("mouseleave",Ne),ye.push(()=>{L.removeEventListener("mouseenter",ke),L.removeEventListener("mouseleave",Ne)})}if(H){const ke=()=>C(L),Ne=()=>h();L.addEventListener("focus",ke),L.addEventListener("blur",Ne),ye.push(()=>{L.removeEventListener("focus",ke),L.removeEventListener("blur",Ne)})}if(ge){const ke=Ne=>{var ee,xe;(xe=(ee=W()).onTriggerClick)==null||xe.call(ee,Ne),!Ne.defaultPrevented&&P(L)};L.addEventListener("click",ke),ye.push(()=>L.removeEventListener("click",ke))}return V},isOpen:j,entry:()=>u,props:()=>({...y})};return ce},he.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},o=null,r=null,y=null;const u=m=>m&&typeof m=="object"&&!m.nodeType&&!Array.isArray(m)&&!(m instanceof Function),i=m=>!!m&&typeof m=="object"&&(m.nodeType===1||typeof m.getBoundingClientRect=="function"),b=m=>!!m&&typeof m=="object"&&("clientX"in m||"type"in m||"target"in m||"currentTarget"in m),T=m=>!!m&&Number.isFinite(Number(m.x))&&Number.isFinite(Number(m.y)),S=()=>s,w=(m,F)=>{const X=Number(m),a=Number(F);return!Number.isFinite(X)||!Number.isFinite(a)?null:{x:X,y:a}},z=m=>m?{_cmsContextPoint:m,getBoundingClientRect:()=>({top:m.y,bottom:m.y,left:m.x,right:m.x,width:0,height:0})}:null,Q=m=>{if(!i(m))return null;const F=m.getBoundingClientRect();return w(F.left+Math.min(F.width/2,24),F.top+Math.min(F.height/2,24))},G=m=>{var F,X,a,C;return l((C=(a=(X=(F=m==null?void 0:m.anchorEl)!=null?F:m==null?void 0:m.triggerEl)!=null?X:m==null?void 0:m.target)!=null?a:m==null?void 0:m.anchor)!=null?C:null)},ie=(m,F=null)=>{if(!m)return Q(F||y);const X=w(m.clientX,m.clientY);if(X)return X;const a=G({anchorEl:F||m.currentTarget||m.target||y});return Q(a)},D=(m={})=>{if(!u(m))return{};const F={...m};return delete F.event,delete F.point,delete F.x,delete F.y,F},$=()=>{var F,X,a;const m=S();return{...m,trigger:"manual",placement:m.placement||"bottom-start",offsetX:(F=m.offsetX)!=null?F:0,offsetY:(a=(X=m.offsetY)!=null?X:m.offset)!=null?a:4,closeOnOutside:m.closeOnOutside!==!1,closeOnEsc:m.closeOnEsc!==!1,role:m.role||"menu",ariaLabel:m.ariaLabel||m.title||"Context menu",class:ae(["cms-context-menu-shell",m.class]),panelClass:ae(["cms-context-menu-panel",m.panelClass])}},Y=he.Menu($(),...n),W=(m=null,F=null,X=null)=>{let a=null,C=null,h=null;if(b(m))a=ie(m,y),h=u(F)?D(F):null;else if(typeof m=="number"||typeof F=="number")a=w(m,F),h=u(X)?D(X):null;else if(T(m))a=w(m.x,m.y),h=u(F)?D(F):null;else if(i(m))C=m,h=u(F)?D(F):null;else if(u(m)){const P=T(m.point)?m.point:T(m)?m:null,j=G(m),U=m.event;a=P?w(P.x,P.y):ie(U,j||y),C=j&&i(j)?j:null,h={...D(m),...u(F)?D(F):{}}}else o&&(a={...o});return{point:a,anchor:C,nextProps:h}},se=(m,F=null)=>{r=m||r,o=F||m&&m._cmsContextPoint||o},me=(m=null)=>{u(m)&&Object.keys(m).length&&(s={...s,...m})},re=(m=null,F=null)=>{if(F)return z(F);if(m&&i(m))return m;const X=G(S());return i(X)?X:o?z(o):i(r)?r:i(y)?y:null},oe=(m=null,F=null,X=null)=>{const{point:a,anchor:C,nextProps:h}=W(m,F,X);me(h);const P=re(C,a);return P?(se(P,a),Y.open(P,$())):null},le=(m,F,X=null)=>oe(m,F,X),te=(m,F=null)=>oe(m,F),M=()=>(Y.close(),d),Z=(m=!0)=>(m===!1?Y.hide(!1):Y.close(),d),q=(m=null,F=null,X=null)=>oe(m,F,X),ue=(m=null,F=null,X=null)=>Y.isOpen()?(M(),null):oe(m,F,X),R=(m={})=>(me(D(m)),Y.update($()),d),d={open:oe,openAt:le,openFromEvent:te,show:q,hide:Z,close:M,toggle:ue,update:R,bind:(m,F=null)=>{if(!m)return()=>{};const X=u(F)?D(F):null,a=h=>{var j,U;y=m,h.preventDefault(),!(((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:m,open:oe,close:M,update:R}))===!1||l(S().disabled))&&oe({event:h,anchorEl:m},X)},C=h=>{var j,U;h.key!=="ContextMenu"&&!(h.shiftKey&&h.key==="F10")||(y=m,h.preventDefault(),((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:m,open:oe,close:M,update:R}))===!1||l(S().disabled))||oe({event:h,anchorEl:m},X)};return m.addEventListener("contextmenu",a),m.addEventListener("keydown",C),()=>{m.removeEventListener("contextmenu",a),m.removeEventListener("keydown",C)}},isOpen:Y.isOpen,entry:Y.entry,props:()=>({...s})};return d}})(JSswift);
|
package/dist/ui.js
CHANGED
|
@@ -15914,7 +15914,7 @@ transition: width 200ms ease;
|
|
|
15914
15914
|
"actions", "actionsLabel", "emptyText", "loadingText", "onRowClick", "onRowDblClick",
|
|
15915
15915
|
"tableClass", "tableStyle", "cardClass", "dense", "striped", "hover", "stickyHeader",
|
|
15916
15916
|
"toolbar", "toolbarStart", "toolbarEnd", "caption", "footer", "status", "rowClass", "rowAttrs",
|
|
15917
|
-
"minTableWidth", "hideHeader", "hideFooter", "slots", "body"
|
|
15917
|
+
"minTableWidth", "hideHeader", "hideFooter", "hideStatus", "slots", "body"
|
|
15918
15918
|
]);
|
|
15919
15919
|
wrapProps.class = uiClass(["cms-table-card", props.class, props.cardClass]);
|
|
15920
15920
|
if (props.dense != null) wrapProps.dense = props.dense;
|
|
@@ -15977,7 +15977,7 @@ transition: width 200ms ease;
|
|
|
15977
15977
|
statusSort,
|
|
15978
15978
|
...statusExtraNodes
|
|
15979
15979
|
);
|
|
15980
|
-
shell.appendChild(status);
|
|
15980
|
+
if (props.hideStatus !== true) shell.appendChild(status);
|
|
15981
15981
|
|
|
15982
15982
|
const captionNodes = renderSlotToArray(slots, "caption", {}, props.caption);
|
|
15983
15983
|
if (captionNodes.length) shell.appendChild(_.div({ class: "cms-table-caption" }, ...captionNodes));
|
package/dist/ui.min.js
CHANGED
|
@@ -31,4 +31,4 @@ background: var(--cms-primary);
|
|
|
31
31
|
transition: width 200ms ease;
|
|
32
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 y=document.createElement("style");return y.textContent=`
|
|
33
33
|
@keyframes cmsSpin { to { transform: rotate(360deg); } }
|
|
34
|
-
`,document.head.appendChild(y),kt._textNode=n,kt._spinner=e,kt._progressWrap=s,kt._progressBar=o,kt._progressActive=!1,kt}function yl(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 wl(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=bl(),s=yl(t,e);In++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",wl(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=bl();typeof t=="object"&&t!==null&&(e=t,t=(r=t.value)!=null?r:0);const s=yl(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+"%",wl(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 qo(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 Xo(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=qo(t);return Array.isArray(e)?e:[]}function vl(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 Sl(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 Zo(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 ei(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 y=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var T;return(T=b==null?void 0:b.searchKey)!=null?T:b==null?void 0:b.key}).filter(Boolean),u=[];if(y.length)for(const b of y)if(typeof b=="function")u.push(Qn(b(t)));else{const T=e.find(S=>(S==null?void 0:S.key)===b||(S==null?void 0:S.searchKey)===b);u.push(Qn(T?qn(T,t,-1):Ss(t,b)))}else u.push(Qn(t));const i=u.join(" ").toLowerCase();return r.every(b=>i.includes(b))}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=Zo(e.pageSizeOptions,[5,10,20,50]),y=Number((ee=(Ne=e.pageSize)!=null?Ne:r[0])!=null?ee:10)||10,u=Array.from(new Set([...r,y])).sort((Ce,pe)=>Ce-pe),i=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",T=Nt(e.searchModel||e.queryModel,"UI.Table:query"),[S,w]=He.reactive.signal(Math.max(1,Number(e.page||1)||1)),[z,Q]=He.reactive.signal(y),[G,ie]=He.reactive.signal(i),[D,$]=He.reactive.signal(String((be=T?T.get():(xe=e.search)!=null?xe:e.query)!=null?be:"")),Y=Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),T&&T.set(pe),w(1)},W=Ce=>{const pe=Number(Ce)||y;Q(pe),w(1)},se=(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),w(1)};let me=null;T&&T.watch(Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),me&&me.value!==pe&&(me.value=pe),w(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"}),le=J(s,"default",{},n);le.length&&oe.appendChild(_.div({class:"cms-table-lead"},...le));const te=J(s,"toolbarStart",{},e.toolbarStart),M=J(s,"toolbar",{},e.toolbar),Z=J(s,"toolbarEnd",{},e.toolbarEnd),q=_.div({class:"cms-table-toolbar"}),ue=_.div({class:"cms-table-toolbar-main"}),R=_.div({class:"cms-table-toolbar-side"});te.forEach(Ce=>ue.appendChild(Ce)),M.forEach(Ce=>ue.appendChild(Ce));const g=J(s,"search",{query:D(),getQuery:D,setQuery:Y},null);if(g.length)g.forEach(Ce=>R.appendChild(Ce));else if(b){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");R.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),me,Ce))}Z.forEach(Ce=>R.appendChild(Ce)),(ue.childNodes.length||R.childNodes.length)&&(q.appendChild(ue),q.appendChild(R),oe.appendChild(q));const d=_.div({class:"cms-singularity cms-table-chip"},""),m=_.div({class:"cms-singularity cms-table-chip"},""),F=_.div({class:"cms-singularity cms-table-chip"},""),X=J(s,"status",{},e.status),a=_.div({class:"cms-table-status"},d,m,F,...X);oe.appendChild(a);const C=J(s,"caption",{},e.caption);C.length&&oe.appendChild(_.div({class:"cms-table-caption"},...C));const h=_.thead(),P=_.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 L=_.table({class:U,style:ce},h,P),f=_.div({class:"cms-singularity cms-table-wrap"},L);oe.appendChild(f);const k=_.div({class:"cms-singularity cms-table-chip"},""),A=_.div({class:"cms-singularity cms-table-chip"},""),H=he.Btn({outline:!0,onClick:()=>w(Math.max(1,S()-1))},"\u2039"),ge=he.Btn({outline:!0,onClick:()=>w(S()+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(z()),ye.addEventListener("change",()=>W(ye.value));const V=J(s,"footer",{},e.footer),O=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},k,A,_.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,Ae;const _e={col:pe,colIndex:Ie,sort:G()},I={...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&&(I.width=Be(pe.width)),(pe==null?void 0:pe.minWidth)!=null&&(I.minWidth=Be(pe.minWidth)),(pe==null?void 0:pe.maxWidth)!=null&&(I.maxWidth=Be(pe.maxWidth)),pe!=null&&pe.align&&(I.textAlign=pe.align);let we=J(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):(Ae=pe==null?void 0:pe.header)!=null?Ae:vl(pe);we=J(s,"header",_e,Je)}const E=G(),x=Cs(pe,Ie),v=(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=!!E&&(E.key===x||E.key===(pe==null?void 0:pe.key)),N=_.th({class:ae(["cms-table-head-cell",fe(pe==null?void 0:pe.nowrap,"is-nowrap"),fe(v,"cms-table-sortable"),fe(c,"is-sorted"),pe==null?void 0:pe.headerClass]),style:I});v?N.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>se(pe,Ie)},_.span({class:"cms-table-head-label"},...we),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},c?E.dir==="asc"?"\u2191":"\u2193":"\u2195"))):we.forEach(Je=>N.appendChild(Je)),Ce.appendChild(N)}),j){const pe=J(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=J(s,Ce,Ie,pe),I=String(o.length+(j?1:0));P.appendChild(_.tr(_.td({colSpan:I,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,I=e.pagination!==!1;if(K(),P.innerHTML="",me&&me.value!==D()&&(me.value=D()),ye.value!==String(z())&&(ye.value=String(z())),_e){d.textContent="Caricamento in corso",m.style.display="none",F.style.display="none",k.textContent="Loading\u2026",A.textContent="",Se.textContent="Pagina 1",H.disabled=!0,ge.disabled=!0,ke("loading",e.loadingText||"Loading...");return}let we=Ce.slice();const E=we.length;if(typeof e.filter=="function"&&(we=we.filter((B,Le)=>e.filter(B,{row:B,index:Le,query:pe,rows:Ce,columns:o}))),pe&&(we=we.filter(B=>ei(B,o,pe,e))),Ie){const B=Sl(o,Ie.key);B&&we.sort((Le,Me)=>{const Ee=qn(B,Le,-1),De=qn(B,Me,-1),Ue=typeof B.compare=="function"?B.compare(Ee,De,Le,Me):Xo(Ee,De);return Ie.dir==="asc"?Ue:-Ue})}const x=we.length,v=Math.max(1,Number(z())||y),c=I?Math.max(1,Math.ceil(x/v)):1,N=I?Math.min(S(),c):1;N!==S()&&w(N);const de=I?(N-1)*v:0,Ae=I?de+v:x,Je=we.slice(de,Ae);if(d.textContent=x===E?`${x} righe`:`${x} di ${E} righe`,m.textContent=pe?`Ricerca: ${pe}`:"",m.style.display=pe?"":"none",Ie){const B=Sl(o,Ie.key);F.textContent=B?`Ordine: ${vl(B)} ${Ie.dir==="asc"?"\u2191":"\u2193"}`:"",F.style.display=B?"":"none"}else F.style.display="none";if(k.textContent=x?`${de+1}-${Math.min(Ae,x)} di ${x}`:"0 risultati",A.textContent=x!==E?`Dataset totale ${E}`:`Page size ${v}`,Se.textContent=I?`Pagina ${N} / ${c}`:"Tutte le righe",H.disabled=!I||N<=1,ge.disabled=!I||N>=c,ye.disabled=!I,ye.parentNode.style.display=I?"":"none",Je.length===0){ke("empty",e.emptyText||"Nessun dato");return}for(let B=0;B<Je.length;B++){const Le=Je[B],Me=de+B,Ee={row:Le,rowIndex:Me,pageIndex:B},De=typeof e.rowAttrs=="function"?e.rowAttrs(Le,Ee)||{}:e.rowAttrs||{},Ue=typeof e.rowClass=="function"?e.rowClass(Le,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(Le,Ee):Ss(Le,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(Le,Ee,Te)}),e.onRowDblClick&&Ze.addEventListener("dblclick",Te=>{Qe(Te)||e.onRowDblClick(Le,Ee,Te)}),o.forEach((Te,je)=>{var ft,vt;const tt=qn(Te,Le,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(Le,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=J(Te==null?void 0:Te.slots,"cell",nt,null);if(!lt.length){const _t=typeof(Te==null?void 0:Te.render)=="function"?Te.render(Le,nt):typeof(Te==null?void 0:Te.format)=="function"?Te.format(tt,Le,nt):tt,rt=_t==null?(vt=Te==null?void 0:Te.emptyText)!=null?vt:"":_t;lt=J(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(Le,Ee):e.actions;let tt=J(s,"actions",Te,je);tt.length||(tt=J(null,"default",Te,je)),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"),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 y={...e},u=null,i=null,b=null,T=null,S=null;const w=(f,k)=>Object.prototype.hasOwnProperty.call(f||{},k),z=(f,k)=>typeof f=="function"?f(k):f,Q=f=>String(f||"").split(/\s+/).filter(Boolean),G=f=>f&&typeof f=="object"&&!f.nodeType&&!Array.isArray(f)&&!(f instanceof Function),ie=f=>!!f&&typeof f=="object"&&(f.nodeType===1||typeof f.getBoundingClientRect=="function"),D=()=>{clearTimeout(T),clearTimeout(S),T=null,S=null},$=(f,k,A)=>{if(!f)return;const H=f[k]||[];H.length&&f.classList.remove(...H);const ge=(A||[]).filter(Boolean);ge.length&&f.classList.add(...ge),f[k]=ge},Y=(f,k,A,H=ge=>ge)=>{if(f){if(A==null||A===""){f.style.removeProperty(k);return}f.style.setProperty(k,H(A))}},W=()=>y||{},se=f=>{var A;const k=String(l((A=f.state)!=null?A:f.color)||"").toLowerCase();return o.includes(k)?k:""},me=f=>{const k=String(l(f.size)||"").toLowerCase();return r.includes(k)?k:""},re=f=>{var k,A;return String(l((A=(k=f.placement)!=null?k:f.position)!=null?A:"bottom-start"))},oe=()=>{var A;const f=l((A=W().delay)!=null?A:W().showDelay),k=Number(f);return Number.isFinite(k)?Math.max(0,k):0},le=()=>{const f=l(W().hideDelay),k=Number(f);return Number.isFinite(k)?Math.max(0,k):80},te=(f=null)=>{var A,H,ge;if(f)return f;const k=W();return i||l((ge=(H=(A=k.anchorEl)!=null?A:k.triggerEl)!=null?H:k.target)!=null?ge:k.anchor)||null},M=f=>{if(f==null||f===!0)return new Set(["click"]);if(f===!1)return new Set(["manual"]);const k=Array.isArray(f)?f:String(f).split(/[\s,|/]+/),A=new Set;return k.forEach(H=>{const ge=String(H||"").trim().toLowerCase();ge&&(ge==="mouseenter"||ge==="mouseover"?A.add("hover"):ge==="blur"||ge==="focusin"?A.add("focus"):ge==="tap"?A.add("click"):A.add(ge))}),A.size?A:new Set(["manual"])},Z=(f,k)=>{var ge,Se,ye;let A=null,H=null;if(ie(f))A=f,G(k)&&(H=k);else if(G(f)){H=f;const V=(ye=(Se=(ge=f.anchorEl)!=null?ge:f.triggerEl)!=null?Se:f.target)!=null?ye:f.anchor;ie(V)&&(A=V)}else f!=null&&(A=f);return{anchorEl:A,nextProps:H}},q=(f=u==null?void 0:u.panel)=>{var k;return Array.from(((k=f==null?void 0:f.querySelectorAll)==null?void 0:k.call(f,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(A=>A.offsetParent!==null&&A.getAttribute("aria-hidden")!=="true")},ue=()=>{l(W().autoFocus)!==!1&&setTimeout(()=>{const f=q();if(!f.length)return;(f.find(A=>A.classList.contains("is-active")||A.classList.contains("is-selected")||A.classList.contains("is-checked"))||f[0]).focus()},0)},R=(f,k,A="sm")=>{const H=z(f,k);return H==null?[]:typeof H=="string"?[he.Icon({name:H,size:A})]:Ln(H,{...k,as:"icon"})},g=(f,k)=>{var de,Ae,Je,B,Le,Me,Ee,De,Ue,Ye,Ze,Qe,Te;const A=z(f,k);if(A==null||A===!1)return[];if(Array.isArray(A))return A.flatMap((je,tt)=>g(je,{...k,index:tt}));if(typeof A=="function")return g(A(k),k);if(A!=null&&A.nodeType)return[A];if(typeof A=="string"||typeof A=="number")return g({label:A},k);if(!G(A))return Ln(A,{...k,as:"item"});const H=String((Ae=(de=A.type)!=null?de:A.kind)!=null?Ae:"").toLowerCase();if(H==="separator"||H==="divider"||A.separator===!0||A.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ge=(Je=A.items)!=null?Je:A.children;if((H==="group"||H==="section"||Array.isArray(ge))&&ge!=null){const je={...k,item:A},tt=J(s,"groupLabel",je,z((B=A.label)!=null?B:A.title,je)),nt=g(ge,je);return nt.length?[_.div({class:ae(["cms-menu-group",A.class])},tt.length?_.div({class:"cms-menu-group-label"},...tt):null,_.div({class:"cms-menu-group-items"},...nt))]:[]}const Se={...k,item:A,close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:W()},ye=!!l(A.disabled),V=A.checked==null?null:!!l(A.checked),O=!!l((Le=A.active)!=null?Le:A.selected),K=se(A),ke=l(A.href),Ne=l(A.to),ee=w(A,"closeOnSelect")?!!l(A.closeOnSelect):A.keepOpen===!0?!1:W().closeOnSelect!==!1,xe=A.role||(V!=null?"menuitemcheckbox":"menuitem"),be=R(A.icon,Se),Ce=R((Me=A.iconRight)!=null?Me:A.endIcon,Se),pe=J(s,"itemTitle",Se,z((Ee=A.title)!=null?Ee:A.label,Se)),Ie=J(s,"itemSubtitle",Se,z((De=A.subtitle)!=null?De:A.description,Se)),_e=J(s,"itemShortcut",Se,z(A.shortcut,Se)),I=J(s,"itemBadge",Se,z(A.badge,Se)),we=J(s,"item",Se,z((Ye=(Ue=A.content)!=null?Ue:A.body)!=null?Ye:A.render,Se)),E=[...I,..._e,...V===!0&&!Ce.length&&!I.length?[_.span({class:"cms-menu-entry-check"},he.Icon({name:A.checkedIcon||"check",size:"sm"}))]:[],...Ce],v={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"),A.class]),role:xe,tabIndex:ye?-1:(Ze=A.tabIndex)!=null?Ze:-1,"data-menu-item":!0,"data-menu-select":ee?"true":"false","data-menu-close":A.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=A.titleAttr)!=null?Qe:A.tooltip)!=null?Te:null,type:ke?null:"button",href:ke||null,target:A.target||null,rel:A.rel||(A.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,A,Se,je);const tt=(dt=A.onClick)==null?void 0:dt.call(A,Se,je);je.defaultPrevented||(Ne&&((bt=JSswift.router)!=null&&bt.navigate)&&(je.preventDefault(),JSswift.router.navigate(Ne)),tt!==!1&&ee&&X())}};A.attrs&&typeof A.attrs=="object"&&Object.assign(v,A.attrs);const c=ke?_.a:_.button,N=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(v,be.length?_.span({class:"cms-menu-entry-icon"},...be):null,_.span({class:"cms-menu-entry-main"},...N),E.length?_.span({class:"cms-menu-entry-aside"},...E):null)]},d=()=>{var pe,Ie,_e,I,we,E,x;const f=W(),k={close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:f},A=R(f.icon,k,f.iconSize||"md"),H=J(s,"eyebrow",k,z(f.eyebrow,k)),ge=J(s,"title",k,z((Ie=(pe=f.title)!=null?pe:f.heading)!=null?Ie:f.label,k)),Se=J(s,"subtitle",k,z((_e=f.subtitle)!=null?_e:f.description,k)),ye=J(s,"before",k,z(f.before,k)),V=J(s,"header",k,z(f.header,k)),O=J(s,"after",k,z(f.after,k)),K=J(s,"footer",k,z(f.footer,k)),ke=J(s,"status",k,z(f.status,k));let Ne=(I=f.content)!=null?I:f.body;Ne==null&&n&&n.length&&(Ne=n);let ee=J(s,"content",k,z(Ne,k));ee.length||(ee=J(s,"body",k,z(Ne,k))),ee.length||(ee=J(s,"default",k,z(Ne,k)));const xe=g((E=(we=f.items)!=null?we:f.actionsList)!=null?E:f.entries,k),be=xe.length?[]:J(s,"empty",k,z((x=f.empty)!=null?x:f.emptyText,k));let Ce=null;return V.length?Ce=_.div({class:ae(["cms-menu-head","cms-menu-head-custom",f.headerClass])},...V):(A.length||H.length||ge.length||Se.length)&&(Ce=_.div({class:ae(["cms-menu-head",f.headerClass])},A.length?_.div({class:"cms-menu-head-icon"},...A):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(f.dense,"dense"),fe(xe.length>0,"has-items"),fe(K.length>0||ke.length>0,"has-footer"),f.class]),style:f.style||{},role:f.role||"menu","aria-label":f.ariaLabel||null},ye.length?_.div({class:"cms-menu-before"},...ye):null,Ce,ee.length?_.div({class:ae(["cms-menu-content",f.contentClass])},...ee):null,xe.length?_.div({class:ae(["cms-menu-items",f.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",f.footerClass])},ke.length?_.div({class:"cms-menu-status"},...ke):null,K.length?_.div({class:"cms-menu-footer-actions"},...K):null):null)},m=f=>{var ge;if(!(f!=null&&f.panel))return;const k=W(),A=se(k),H=me(k);$(f.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",H?`cms-menu-${H}`:"",A?`cms-state-${A}`:"",l(k.outline)?"outline":"",...Q(k.panelClass)]),$(f.overlay,"_menuOverlayClassTokens",[...Q(k.overlayClass)]),f.panel.dataset.placement=re(k),Y(f.panel,"--cms-menu-width",l(k.width),Be),Y(f.panel,"--cms-menu-min-width",l(k.minWidth),Be),Y(f.panel,"--cms-menu-max-width",l(k.maxWidth),Be),Y(f.panel,"--cms-menu-max-height",l(k.maxHeight),Be),Y(f.panel,"--cms-menu-body-max-height",l((ge=k.bodyMaxHeight)!=null?ge:k.contentMaxHeight),Be),k.panelStyle&&Object.assign(f.panel.style,k.panelStyle),Ke(f.panel,k)},F=()=>{u!=null&&u.panel&&u.panel.replaceChildren(d())},X=()=>{if(D(),!u)return;const f=u;u=null,yn(f,()=>JSswift.overlay.close(f.id))},a=(f={})=>{var k,A,H,ge;if(f&&typeof f=="object"&&(y={...y,...f}),u){const Se=W();m(u),F(),(ge=u.reposition)==null||ge.call(u,{anchorEl:u._anchorEl,placement:re(Se),offsetX:(k=Se.offsetX)!=null?k:0,offsetY:(H=(A=Se.offsetY)!=null?A:Se.offset)!=null?H:8}),ue()}return L},C=(f=null,k=null)=>{var Ce,pe,Ie,_e,I,we,E,x,v,c,N,de,Ae,Je,B,Le;D();const{anchorEl:A,nextProps:H}=Z(f,k);H&&(y={...y,...H});const ge=W(),Se=te(A);if(!Se||l(ge.disabled))return null;if(u&&u._anchorEl===Se){const Me=W();return m(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(),b=document.activeElement;let ye=null;if(u=JSswift.overlay.open(()=>d(),{type:"menu",anchorEl:Se,placement:re(ge),offsetX:(I=ge.offsetX)!=null?I:0,offsetY:(E=(we=ge.offsetY)!=null?we:ge.offset)!=null?E: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&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const V=u;ye=V,V._anchorEl=Se;const O=()=>{clearTimeout(S),S=null},K=()=>{P()},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=(v=ge.trigger)!=null?v:ge.triggers)!=null?c:w(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)},m(V),(Je=V.reposition)==null||Je.call(V,{anchorEl:Se,placement:re(ge),offsetX:(N=ge.offsetX)!=null?N:0,offsetY:(Ae=(de=ge.offsetY)!=null?de:ge.offset)!=null?Ae:8}),bn(V),(Le=(B=W()).onOpen)==null||Le.call(B,V),ue(),V},h=(f,k=null)=>{clearTimeout(S),S=null,clearTimeout(T),T=setTimeout(()=>C(f,k),oe())},P=(f=!1)=>{if(clearTimeout(T),T=null,!!u){if(clearTimeout(S),f){X();return}S=setTimeout(()=>X(),le())}},j=(f=null,k=null)=>U()?(X(),null):C(f,k),U=()=>!!u,L={open:C,close:X,show:h,hide:P,toggle:j,update:a,bind:f=>{var K,ke;if(!f)return()=>{};i=f;const k=W(),A=M((ke=(K=k.trigger)!=null?K:k.triggers)!=null?ke:w(k,"open")?"manual":null),H=A.has("hover"),ge=A.has("focus"),Se=A.has("click"),ye=A.has("manual")||!H&&!ge&&!Se,V=[],O=()=>{D(),V.forEach(Ne=>Ne()),i===f&&(i=null)};if(w(k,"open"))return at(k.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?C(i):P(!0))},"UI.Menu:open"):k.open===!0?C(f):k.open===!1&&P(!0),O;if(ye||l(k.disabled))return O;if(H){const Ne=()=>h(f),ee=()=>P();f.addEventListener("mouseenter",Ne),f.addEventListener("mouseleave",ee),V.push(()=>{f.removeEventListener("mouseenter",Ne),f.removeEventListener("mouseleave",ee)})}if(ge){const Ne=()=>h(f),ee=()=>P();f.addEventListener("focus",Ne),f.addEventListener("blur",ee),V.push(()=>{f.removeEventListener("focus",Ne),f.removeEventListener("blur",ee)})}if(Se){const Ne=ee=>{var xe,be;(be=(xe=W()).onTriggerClick)==null||be.call(xe,ee),!ee.defaultPrevented&&j(f)};f.addEventListener("click",Ne),V.push(()=>f.removeEventListener("click",Ne))}return O},isOpen:U,entry:()=>u,props:()=>({...y})};return L},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 y={...e},u=null,i=null,b=null,T=null,S=null;const w=(L,f)=>Object.prototype.hasOwnProperty.call(L||{},f),z=(L,f)=>typeof L=="function"?L(f):L,Q=L=>String(L||"").split(/\s+/).filter(Boolean),G=L=>L&&typeof L=="object"&&!L.nodeType&&!Array.isArray(L)&&!(L instanceof Function),ie=L=>!!L&&typeof L=="object"&&(L.nodeType===1||typeof L.getBoundingClientRect=="function"),D=()=>{clearTimeout(T),clearTimeout(S),T=null,S=null},$=(L,f,k)=>{if(!L)return;const A=L[f]||[];A.length&&L.classList.remove(...A);const H=(k||[]).filter(Boolean);H.length&&L.classList.add(...H),L[f]=H},Y=(L,f,k,A=H=>H)=>{if(L){if(k==null||k===""){L.style.removeProperty(f);return}L.style.setProperty(f,A(k))}},W=()=>y,se=L=>{var k;const f=l((k=L.state)!=null?k:L.color);return f?o.includes(f)?f:String(f):""},me=L=>{const f=l(L.size);return typeof f=="string"&&r.includes(f)?f:""},re=L=>{var k,A,H;const f=String(l((H=(A=(k=L.actionsAlign)!=null?k:L.footerAlign)!=null?A:L.alignActions)!=null?H:"end")).toLowerCase();return["start","left"].includes(f)?"start":["center","middle"].includes(f)?"center":["between","space-between"].includes(f)?"between":["stretch","full"].includes(f)?"stretch":"end"},oe=L=>{var f,k;return String(l((k=(f=L.placement)!=null?f:L.position)!=null?k:"bottom-start"))},le=(L,f)=>{const k=l(L);if(k==null||k==="")return f;const A=Number(k);return Number.isFinite(A)?A:f},te=()=>le(W().delay,0),M=()=>le(W().hideDelay,120),Z=L=>{var k,A;return((A=(k=L.closable)!=null?k:L.dismissible)!=null?A:L.closeButton)===!0},q=(L=null)=>{var k,A,H;if(L)return L;const f=W();return i||l((H=(A=(k=f.anchorEl)!=null?k:f.triggerEl)!=null?A:f.target)!=null?H:f.anchor)||null},ue=L=>{if(L==null||L===!0)return new Set(["click"]);if(L===!1)return new Set(["manual"]);const f=Array.isArray(L)?L:String(L).split(/[\s,|/]+/),k=new Set;return f.forEach(A=>{const H=String(A||"").trim().toLowerCase();H&&(H==="mouseenter"||H==="mouseover"?k.add("hover"):H==="blur"||H==="focusin"?k.add("focus"):H==="tap"?k.add("click"):k.add(H))}),k.size?k:new Set(["manual"])},R=(L,f)=>{var H,ge,Se;let k=null,A=null;if(ie(L))k=L,G(f)&&(A=f);else if(G(L)){A=L;const ye=(Se=(ge=(H=L.anchorEl)!=null?H:L.triggerEl)!=null?ge:L.target)!=null?Se:L.anchor;ie(ye)&&(k=ye)}else L!=null&&(k=L);return{anchorEl:k,nextProps:A}},g=()=>{var be,Ce,pe,Ie,_e,I,we,E,x;const L=W(),f={close:F,dismiss:F,open:a,toggle:P,update:X,isOpen:j,entry:()=>u,anchorEl:q(),props:L},k=L.icon!=null?typeof L.icon=="string"?he.Icon({name:L.icon,size:L.iconSize||"md"}):JSswift.ui.slot(L.icon,{as:"icon"}):null,A=J(s,"eyebrow",f,z(L.eyebrow,f)),H=J(s,"title",f,z((Ce=(be=L.title)!=null?be:L.heading)!=null?Ce:L.label,f)),ge=J(s,"subtitle",f,z((pe=L.subtitle)!=null?pe:L.description,f)),Se=J(s,"icon",f,k),ye=J(s,"header",f,z((_e=(Ie=L.headerContent)!=null?Ie:L.head)!=null?_e:L.header,f)),V=Z(L)?J(s,"close",f,he.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":L.closeLabel||"Chiudi popover","data-popover-close":!0},he.Icon({name:L.closeIcon||"close",size:"sm"}))):[];let O=(E=(we=(I=L.content)!=null?I:L.body)!=null?we:L.message)!=null?E:L.text;O==null&&n&&n.length&&(O=n);let K=J(s,"content",f,z(O,f));K.length||(K=J(s,"body",f,z(O,f))),K.length||(K=J(s,"default",f,z(O,f)));const ke=z((x=L.footer)!=null?x:L.actions,f);let Ne=J(s,"footer",f,ke);Ne.length||(Ne=J(s,"actions",f,ke));let ee=null;ye.length?ee=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...ye):(A.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"},A.length?_.div({class:"cms-dialog-eyebrow"},...A):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",L.bodyClass])},...K)),Ne.length&&xe.push(_.div({class:ae(["cms-dialog-actions",`is-${re(L)}`,fe(L.stackActions,"is-stacked"),L.actionsClass,L.footerClass])},...Ne)),xe.length||xe.push(_.div({class:ae(["cms-dialog-body",L.bodyClass])})),_.div({class:ae(["cms-dialog-shell","cms-popover-shell",fe(!!ee,"has-head"),fe(Ne.length>0,"has-footer"),fe(L.divider!==!1,"with-divider")])},...xe)},d=L=>{var H;if(!(L!=null&&L.panel))return;const f=W(),k=se(f),A=me(f);$(L.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",A?`cms-dialog-${A}`:"",k,k?`cms-state-${k}`:"",l(f.scrollable)?"scrollable":"",l(f.stickyHeader)?"sticky-head":"",l(f.stickyActions)?"sticky-actions":"",l(f.borderless)?"borderless":"",...Q(f.class),...Q(f.panelClass)]),$(L.overlay,"_popoverOverlayClassTokens",[...Q(f.overlayClass)]),L.panel.dataset.placement=oe(f),Y(L.panel,"--cms-dialog-width",l(f.width),Be),Y(L.panel,"--cms-dialog-min-width",l(f.minWidth),Be),Y(L.panel,"--cms-dialog-max-width",l(f.maxWidth),Be),Y(L.panel,"--cms-dialog-max-height",l(f.maxHeight),Be),Y(L.panel,"--cms-dialog-body-max-height",l((H=f.bodyMaxHeight)!=null?H:f.contentMaxHeight),Be),f.style&&Object.assign(L.panel.style,f.style),Ke(L.panel,f),L.panel.setAttribute("role",f.role||"dialog"),L.panel.setAttribute("aria-modal",f.modal===!0?"true":"false"),f.ariaLabel?L.panel.setAttribute("aria-label",f.ariaLabel):L.panel.removeAttribute("aria-label")},m=()=>{u!=null&&u.panel&&u.panel.replaceChildren(g())},F=()=>{if(D(),!u)return;const L=u;u=null,yn(L,()=>JSswift.overlay.close(L.id))},X=(L={})=>(L&&typeof L=="object"&&(y={...y,...L}),u&&(d(u),m()),ce),a=(L=null,f=null)=>{var xe,be,Ce,pe,Ie,_e,I,we;D();const{anchorEl:k,nextProps:A}=R(L,f);A&&(y={...y,...A});const H=W(),ge=q(k);if(!ge||l(H.disabled))return null;if(u&&u._anchorEl===ge)return d(u),m(),u;u&&F(),b=document.activeElement;const Se=ue((be=(xe=H.trigger)!=null?xe:H.triggers)!=null?be:w(H,"open")?"manual":null),ye=Se.has("hover"),V=Se.has("focus");let O=null;if(u=JSswift.overlay.open(()=>g(),{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 E,x,v;(E=O==null?void 0:O._popoverCleanup)==null||E.call(O),(v=(x=W()).onClose)==null||v.call(x,O),W().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const K=u;O=K,K._anchorEl=ge;const ke=()=>{clearTimeout(S),S=null},Ne=()=>{!ye&&!V||h()},ee=E=>{const x=E.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 E,x,v,c,N;(E=K.panel)==null||E.removeEventListener("click",ee),(x=K.panel)==null||x.removeEventListener("mouseenter",ke),(v=K.panel)==null||v.removeEventListener("mouseleave",Ne),(c=K.panel)==null||c.removeEventListener("focusin",ke),(N=K.panel)==null||N.removeEventListener("focusout",Ne)},d(K),bn(K),(we=(I=W()).onOpen)==null||we.call(I,K),K},C=(L,f=null)=>{clearTimeout(S),S=null,clearTimeout(T),T=setTimeout(()=>a(L,f),te())},h=(L=!1)=>{if(clearTimeout(T),T=null,!!u){if(clearTimeout(S),L){F();return}S=setTimeout(()=>F(),M())}},P=(L=null,f=null)=>j()?(F(),null):a(L,f),j=()=>!!u,ce={open:a,close:F,show:C,hide:h,toggle:P,update:X,bind:L=>{var O,K;if(!L)return()=>{};i=L;const f=W(),k=ue((K=(O=f.trigger)!=null?O:f.triggers)!=null?K:w(f,"open")?"manual":null),A=k.has("hover"),H=k.has("focus"),ge=k.has("click"),Se=k.has("manual")||!A&&!H&&!ge,ye=[],V=()=>{D(),ye.forEach(ke=>ke()),i===L&&(i=null)};if(w(f,"open"))return at(f.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?a(i):h(!0))},"UI.Popover:open"):f.open===!0?a(L):f.open===!1&&h(!0),V;if(Se||l(f.disabled))return V;if(A){const ke=()=>C(L),Ne=()=>h();L.addEventListener("mouseenter",ke),L.addEventListener("mouseleave",Ne),ye.push(()=>{L.removeEventListener("mouseenter",ke),L.removeEventListener("mouseleave",Ne)})}if(H){const ke=()=>C(L),Ne=()=>h();L.addEventListener("focus",ke),L.addEventListener("blur",Ne),ye.push(()=>{L.removeEventListener("focus",ke),L.removeEventListener("blur",Ne)})}if(ge){const ke=Ne=>{var ee,xe;(xe=(ee=W()).onTriggerClick)==null||xe.call(ee,Ne),!Ne.defaultPrevented&&P(L)};L.addEventListener("click",ke),ye.push(()=>L.removeEventListener("click",ke))}return V},isOpen:j,entry:()=>u,props:()=>({...y})};return ce},he.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},o=null,r=null,y=null;const u=m=>m&&typeof m=="object"&&!m.nodeType&&!Array.isArray(m)&&!(m instanceof Function),i=m=>!!m&&typeof m=="object"&&(m.nodeType===1||typeof m.getBoundingClientRect=="function"),b=m=>!!m&&typeof m=="object"&&("clientX"in m||"type"in m||"target"in m||"currentTarget"in m),T=m=>!!m&&Number.isFinite(Number(m.x))&&Number.isFinite(Number(m.y)),S=()=>s,w=(m,F)=>{const X=Number(m),a=Number(F);return!Number.isFinite(X)||!Number.isFinite(a)?null:{x:X,y:a}},z=m=>m?{_cmsContextPoint:m,getBoundingClientRect:()=>({top:m.y,bottom:m.y,left:m.x,right:m.x,width:0,height:0})}:null,Q=m=>{if(!i(m))return null;const F=m.getBoundingClientRect();return w(F.left+Math.min(F.width/2,24),F.top+Math.min(F.height/2,24))},G=m=>{var F,X,a,C;return l((C=(a=(X=(F=m==null?void 0:m.anchorEl)!=null?F:m==null?void 0:m.triggerEl)!=null?X:m==null?void 0:m.target)!=null?a:m==null?void 0:m.anchor)!=null?C:null)},ie=(m,F=null)=>{if(!m)return Q(F||y);const X=w(m.clientX,m.clientY);if(X)return X;const a=G({anchorEl:F||m.currentTarget||m.target||y});return Q(a)},D=(m={})=>{if(!u(m))return{};const F={...m};return delete F.event,delete F.point,delete F.x,delete F.y,F},$=()=>{var F,X,a;const m=S();return{...m,trigger:"manual",placement:m.placement||"bottom-start",offsetX:(F=m.offsetX)!=null?F:0,offsetY:(a=(X=m.offsetY)!=null?X:m.offset)!=null?a:4,closeOnOutside:m.closeOnOutside!==!1,closeOnEsc:m.closeOnEsc!==!1,role:m.role||"menu",ariaLabel:m.ariaLabel||m.title||"Context menu",class:ae(["cms-context-menu-shell",m.class]),panelClass:ae(["cms-context-menu-panel",m.panelClass])}},Y=he.Menu($(),...n),W=(m=null,F=null,X=null)=>{let a=null,C=null,h=null;if(b(m))a=ie(m,y),h=u(F)?D(F):null;else if(typeof m=="number"||typeof F=="number")a=w(m,F),h=u(X)?D(X):null;else if(T(m))a=w(m.x,m.y),h=u(F)?D(F):null;else if(i(m))C=m,h=u(F)?D(F):null;else if(u(m)){const P=T(m.point)?m.point:T(m)?m:null,j=G(m),U=m.event;a=P?w(P.x,P.y):ie(U,j||y),C=j&&i(j)?j:null,h={...D(m),...u(F)?D(F):{}}}else o&&(a={...o});return{point:a,anchor:C,nextProps:h}},se=(m,F=null)=>{r=m||r,o=F||m&&m._cmsContextPoint||o},me=(m=null)=>{u(m)&&Object.keys(m).length&&(s={...s,...m})},re=(m=null,F=null)=>{if(F)return z(F);if(m&&i(m))return m;const X=G(S());return i(X)?X:o?z(o):i(r)?r:i(y)?y:null},oe=(m=null,F=null,X=null)=>{const{point:a,anchor:C,nextProps:h}=W(m,F,X);me(h);const P=re(C,a);return P?(se(P,a),Y.open(P,$())):null},le=(m,F,X=null)=>oe(m,F,X),te=(m,F=null)=>oe(m,F),M=()=>(Y.close(),d),Z=(m=!0)=>(m===!1?Y.hide(!1):Y.close(),d),q=(m=null,F=null,X=null)=>oe(m,F,X),ue=(m=null,F=null,X=null)=>Y.isOpen()?(M(),null):oe(m,F,X),R=(m={})=>(me(D(m)),Y.update($()),d),d={open:oe,openAt:le,openFromEvent:te,show:q,hide:Z,close:M,toggle:ue,update:R,bind:(m,F=null)=>{if(!m)return()=>{};const X=u(F)?D(F):null,a=h=>{var j,U;y=m,h.preventDefault(),!(((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:m,open:oe,close:M,update:R}))===!1||l(S().disabled))&&oe({event:h,anchorEl:m},X)},C=h=>{var j,U;h.key!=="ContextMenu"&&!(h.shiftKey&&h.key==="F10")||(y=m,h.preventDefault(),((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:m,open:oe,close:M,update:R}))===!1||l(S().disabled))||oe({event:h,anchorEl:m},X)};return m.addEventListener("contextmenu",a),m.addEventListener("keydown",C),()=>{m.removeEventListener("contextmenu",a),m.removeEventListener("keydown",C)}},isOpen:Y.isOpen,entry:Y.entry,props:()=>({...s})};return d}})(JSswift);
|
|
34
|
+
`,document.head.appendChild(y),kt._textNode=n,kt._spinner=e,kt._progressWrap=s,kt._progressBar=o,kt._progressActive=!1,kt}function yl(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 wl(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=bl(),s=yl(t,e);In++,n._progressActive=!1,n._textNode.textContent=s.message||"Loading...",wl(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=bl();typeof t=="object"&&t!==null&&(e=t,t=(r=t.value)!=null?r:0);const s=yl(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+"%",wl(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 qo(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 Xo(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=qo(t);return Array.isArray(e)?e:[]}function vl(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 Sl(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 Zo(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 ei(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 y=Array.isArray(s.searchKeys)&&s.searchKeys.length?s.searchKeys:e.filter(b=>(b==null?void 0:b.searchable)!==!1).map(b=>{var T;return(T=b==null?void 0:b.searchKey)!=null?T:b==null?void 0:b.key}).filter(Boolean),u=[];if(y.length)for(const b of y)if(typeof b=="function")u.push(Qn(b(t)));else{const T=e.find(S=>(S==null?void 0:S.key)===b||(S==null?void 0:S.searchKey)===b);u.push(Qn(T?qn(T,t,-1):Ss(t,b)))}else u.push(Qn(t));const i=u.join(" ").toLowerCase();return r.every(b=>i.includes(b))}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=Zo(e.pageSizeOptions,[5,10,20,50]),y=Number((ee=(Ne=e.pageSize)!=null?Ne:r[0])!=null?ee:10)||10,u=Array.from(new Set([...r,y])).sort((Ce,pe)=>Ce-pe),i=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",T=Nt(e.searchModel||e.queryModel,"UI.Table:query"),[S,w]=He.reactive.signal(Math.max(1,Number(e.page||1)||1)),[z,Q]=He.reactive.signal(y),[G,ie]=He.reactive.signal(i),[D,$]=He.reactive.signal(String((be=T?T.get():(xe=e.search)!=null?xe:e.query)!=null?be:"")),Y=Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),T&&T.set(pe),w(1)},W=Ce=>{const pe=Number(Ce)||y;Q(pe),w(1)},se=(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),w(1)};let me=null;T&&T.watch(Ce=>{const pe=String(Ce!=null?Ce:"");$(pe),me&&me.value!==pe&&(me.value=pe),w(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","hideStatus","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"}),le=J(s,"default",{},n);le.length&&oe.appendChild(_.div({class:"cms-table-lead"},...le));const te=J(s,"toolbarStart",{},e.toolbarStart),M=J(s,"toolbar",{},e.toolbar),Z=J(s,"toolbarEnd",{},e.toolbarEnd),q=_.div({class:"cms-table-toolbar"}),ue=_.div({class:"cms-table-toolbar-main"}),R=_.div({class:"cms-table-toolbar-side"});te.forEach(Ce=>ue.appendChild(Ce)),M.forEach(Ce=>ue.appendChild(Ce));const g=J(s,"search",{query:D(),getQuery:D,setQuery:Y},null);if(g.length)g.forEach(Ce=>R.appendChild(Ce));else if(b){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");R.appendChild(_.div({class:"cms-singularity cms-table-search"},_.span({class:"cms-table-search-icon","aria-hidden":"true"},"\u2315"),me,Ce))}Z.forEach(Ce=>R.appendChild(Ce)),(ue.childNodes.length||R.childNodes.length)&&(q.appendChild(ue),q.appendChild(R),oe.appendChild(q));const d=_.div({class:"cms-singularity cms-table-chip"},""),m=_.div({class:"cms-singularity cms-table-chip"},""),F=_.div({class:"cms-singularity cms-table-chip"},""),X=J(s,"status",{},e.status),a=_.div({class:"cms-table-status"},d,m,F,...X);e.hideStatus!==!0&&oe.appendChild(a);const C=J(s,"caption",{},e.caption);C.length&&oe.appendChild(_.div({class:"cms-table-caption"},...C));const h=_.thead(),P=_.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 L=_.table({class:U,style:ce},h,P),f=_.div({class:"cms-singularity cms-table-wrap"},L);oe.appendChild(f);const k=_.div({class:"cms-singularity cms-table-chip"},""),A=_.div({class:"cms-singularity cms-table-chip"},""),H=he.Btn({outline:!0,onClick:()=>w(Math.max(1,S()-1))},"\u2039"),ge=he.Btn({outline:!0,onClick:()=>w(S()+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(z()),ye.addEventListener("change",()=>W(ye.value));const V=J(s,"footer",{},e.footer),O=_.div({class:"cms-table-foot"},_.div({class:"cms-table-foot-main"},k,A,_.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,Ae;const _e={col:pe,colIndex:Ie,sort:G()},I={...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&&(I.width=Be(pe.width)),(pe==null?void 0:pe.minWidth)!=null&&(I.minWidth=Be(pe.minWidth)),(pe==null?void 0:pe.maxWidth)!=null&&(I.maxWidth=Be(pe.maxWidth)),pe!=null&&pe.align&&(I.textAlign=pe.align);let we=J(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):(Ae=pe==null?void 0:pe.header)!=null?Ae:vl(pe);we=J(s,"header",_e,Je)}const E=G(),x=Cs(pe,Ie),v=(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=!!E&&(E.key===x||E.key===(pe==null?void 0:pe.key)),N=_.th({class:ae(["cms-table-head-cell",fe(pe==null?void 0:pe.nowrap,"is-nowrap"),fe(v,"cms-table-sortable"),fe(c,"is-sorted"),pe==null?void 0:pe.headerClass]),style:I});v?N.appendChild(_.button({type:"button",class:"cms-table-head-button",onClick:()=>se(pe,Ie)},_.span({class:"cms-table-head-label"},...we),_.span({class:"cms-table-head-arrow","aria-hidden":"true"},c?E.dir==="asc"?"\u2191":"\u2193":"\u2195"))):we.forEach(Je=>N.appendChild(Je)),Ce.appendChild(N)}),j){const pe=J(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=J(s,Ce,Ie,pe),I=String(o.length+(j?1:0));P.appendChild(_.tr(_.td({colSpan:I,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,I=e.pagination!==!1;if(K(),P.innerHTML="",me&&me.value!==D()&&(me.value=D()),ye.value!==String(z())&&(ye.value=String(z())),_e){d.textContent="Caricamento in corso",m.style.display="none",F.style.display="none",k.textContent="Loading\u2026",A.textContent="",Se.textContent="Pagina 1",H.disabled=!0,ge.disabled=!0,ke("loading",e.loadingText||"Loading...");return}let we=Ce.slice();const E=we.length;if(typeof e.filter=="function"&&(we=we.filter((B,Le)=>e.filter(B,{row:B,index:Le,query:pe,rows:Ce,columns:o}))),pe&&(we=we.filter(B=>ei(B,o,pe,e))),Ie){const B=Sl(o,Ie.key);B&&we.sort((Le,Me)=>{const Ee=qn(B,Le,-1),De=qn(B,Me,-1),Ue=typeof B.compare=="function"?B.compare(Ee,De,Le,Me):Xo(Ee,De);return Ie.dir==="asc"?Ue:-Ue})}const x=we.length,v=Math.max(1,Number(z())||y),c=I?Math.max(1,Math.ceil(x/v)):1,N=I?Math.min(S(),c):1;N!==S()&&w(N);const de=I?(N-1)*v:0,Ae=I?de+v:x,Je=we.slice(de,Ae);if(d.textContent=x===E?`${x} righe`:`${x} di ${E} righe`,m.textContent=pe?`Ricerca: ${pe}`:"",m.style.display=pe?"":"none",Ie){const B=Sl(o,Ie.key);F.textContent=B?`Ordine: ${vl(B)} ${Ie.dir==="asc"?"\u2191":"\u2193"}`:"",F.style.display=B?"":"none"}else F.style.display="none";if(k.textContent=x?`${de+1}-${Math.min(Ae,x)} di ${x}`:"0 risultati",A.textContent=x!==E?`Dataset totale ${E}`:`Page size ${v}`,Se.textContent=I?`Pagina ${N} / ${c}`:"Tutte le righe",H.disabled=!I||N<=1,ge.disabled=!I||N>=c,ye.disabled=!I,ye.parentNode.style.display=I?"":"none",Je.length===0){ke("empty",e.emptyText||"Nessun dato");return}for(let B=0;B<Je.length;B++){const Le=Je[B],Me=de+B,Ee={row:Le,rowIndex:Me,pageIndex:B},De=typeof e.rowAttrs=="function"?e.rowAttrs(Le,Ee)||{}:e.rowAttrs||{},Ue=typeof e.rowClass=="function"?e.rowClass(Le,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(Le,Ee):Ss(Le,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(Le,Ee,Te)}),e.onRowDblClick&&Ze.addEventListener("dblclick",Te=>{Qe(Te)||e.onRowDblClick(Le,Ee,Te)}),o.forEach((Te,je)=>{var ft,vt;const tt=qn(Te,Le,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(Le,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=J(Te==null?void 0:Te.slots,"cell",nt,null);if(!lt.length){const _t=typeof(Te==null?void 0:Te.render)=="function"?Te.render(Le,nt):typeof(Te==null?void 0:Te.format)=="function"?Te.format(tt,Le,nt):tt,rt=_t==null?(vt=Te==null?void 0:Te.emptyText)!=null?vt:"":_t;lt=J(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(Le,Ee):e.actions;let tt=J(s,"actions",Te,je);tt.length||(tt=J(null,"default",Te,je)),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"),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 y={...e},u=null,i=null,b=null,T=null,S=null;const w=(f,k)=>Object.prototype.hasOwnProperty.call(f||{},k),z=(f,k)=>typeof f=="function"?f(k):f,Q=f=>String(f||"").split(/\s+/).filter(Boolean),G=f=>f&&typeof f=="object"&&!f.nodeType&&!Array.isArray(f)&&!(f instanceof Function),ie=f=>!!f&&typeof f=="object"&&(f.nodeType===1||typeof f.getBoundingClientRect=="function"),D=()=>{clearTimeout(T),clearTimeout(S),T=null,S=null},$=(f,k,A)=>{if(!f)return;const H=f[k]||[];H.length&&f.classList.remove(...H);const ge=(A||[]).filter(Boolean);ge.length&&f.classList.add(...ge),f[k]=ge},Y=(f,k,A,H=ge=>ge)=>{if(f){if(A==null||A===""){f.style.removeProperty(k);return}f.style.setProperty(k,H(A))}},W=()=>y||{},se=f=>{var A;const k=String(l((A=f.state)!=null?A:f.color)||"").toLowerCase();return o.includes(k)?k:""},me=f=>{const k=String(l(f.size)||"").toLowerCase();return r.includes(k)?k:""},re=f=>{var k,A;return String(l((A=(k=f.placement)!=null?k:f.position)!=null?A:"bottom-start"))},oe=()=>{var A;const f=l((A=W().delay)!=null?A:W().showDelay),k=Number(f);return Number.isFinite(k)?Math.max(0,k):0},le=()=>{const f=l(W().hideDelay),k=Number(f);return Number.isFinite(k)?Math.max(0,k):80},te=(f=null)=>{var A,H,ge;if(f)return f;const k=W();return i||l((ge=(H=(A=k.anchorEl)!=null?A:k.triggerEl)!=null?H:k.target)!=null?ge:k.anchor)||null},M=f=>{if(f==null||f===!0)return new Set(["click"]);if(f===!1)return new Set(["manual"]);const k=Array.isArray(f)?f:String(f).split(/[\s,|/]+/),A=new Set;return k.forEach(H=>{const ge=String(H||"").trim().toLowerCase();ge&&(ge==="mouseenter"||ge==="mouseover"?A.add("hover"):ge==="blur"||ge==="focusin"?A.add("focus"):ge==="tap"?A.add("click"):A.add(ge))}),A.size?A:new Set(["manual"])},Z=(f,k)=>{var ge,Se,ye;let A=null,H=null;if(ie(f))A=f,G(k)&&(H=k);else if(G(f)){H=f;const V=(ye=(Se=(ge=f.anchorEl)!=null?ge:f.triggerEl)!=null?Se:f.target)!=null?ye:f.anchor;ie(V)&&(A=V)}else f!=null&&(A=f);return{anchorEl:A,nextProps:H}},q=(f=u==null?void 0:u.panel)=>{var k;return Array.from(((k=f==null?void 0:f.querySelectorAll)==null?void 0:k.call(f,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .cms-menu-item:not([disabled]):not([tabindex='-1']), [role='menuitem']:not([disabled]):not([tabindex='-1']), a[href]:not([tabindex='-1']), button:not([disabled]):not([tabindex='-1'])"))||[]).filter(A=>A.offsetParent!==null&&A.getAttribute("aria-hidden")!=="true")},ue=()=>{l(W().autoFocus)!==!1&&setTimeout(()=>{const f=q();if(!f.length)return;(f.find(A=>A.classList.contains("is-active")||A.classList.contains("is-selected")||A.classList.contains("is-checked"))||f[0]).focus()},0)},R=(f,k,A="sm")=>{const H=z(f,k);return H==null?[]:typeof H=="string"?[he.Icon({name:H,size:A})]:Ln(H,{...k,as:"icon"})},g=(f,k)=>{var de,Ae,Je,B,Le,Me,Ee,De,Ue,Ye,Ze,Qe,Te;const A=z(f,k);if(A==null||A===!1)return[];if(Array.isArray(A))return A.flatMap((je,tt)=>g(je,{...k,index:tt}));if(typeof A=="function")return g(A(k),k);if(A!=null&&A.nodeType)return[A];if(typeof A=="string"||typeof A=="number")return g({label:A},k);if(!G(A))return Ln(A,{...k,as:"item"});const H=String((Ae=(de=A.type)!=null?de:A.kind)!=null?Ae:"").toLowerCase();if(H==="separator"||H==="divider"||A.separator===!0||A.divider===!0)return[_.div({class:"cms-menu-divider",role:"separator"})];const ge=(Je=A.items)!=null?Je:A.children;if((H==="group"||H==="section"||Array.isArray(ge))&&ge!=null){const je={...k,item:A},tt=J(s,"groupLabel",je,z((B=A.label)!=null?B:A.title,je)),nt=g(ge,je);return nt.length?[_.div({class:ae(["cms-menu-group",A.class])},tt.length?_.div({class:"cms-menu-group-label"},...tt):null,_.div({class:"cms-menu-group-items"},...nt))]:[]}const Se={...k,item:A,close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:W()},ye=!!l(A.disabled),V=A.checked==null?null:!!l(A.checked),O=!!l((Le=A.active)!=null?Le:A.selected),K=se(A),ke=l(A.href),Ne=l(A.to),ee=w(A,"closeOnSelect")?!!l(A.closeOnSelect):A.keepOpen===!0?!1:W().closeOnSelect!==!1,xe=A.role||(V!=null?"menuitemcheckbox":"menuitem"),be=R(A.icon,Se),Ce=R((Me=A.iconRight)!=null?Me:A.endIcon,Se),pe=J(s,"itemTitle",Se,z((Ee=A.title)!=null?Ee:A.label,Se)),Ie=J(s,"itemSubtitle",Se,z((De=A.subtitle)!=null?De:A.description,Se)),_e=J(s,"itemShortcut",Se,z(A.shortcut,Se)),I=J(s,"itemBadge",Se,z(A.badge,Se)),we=J(s,"item",Se,z((Ye=(Ue=A.content)!=null?Ue:A.body)!=null?Ye:A.render,Se)),E=[...I,..._e,...V===!0&&!Ce.length&&!I.length?[_.span({class:"cms-menu-entry-check"},he.Icon({name:A.checkedIcon||"check",size:"sm"}))]:[],...Ce],v={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"),A.class]),role:xe,tabIndex:ye?-1:(Ze=A.tabIndex)!=null?Ze:-1,"data-menu-item":!0,"data-menu-select":ee?"true":"false","data-menu-close":A.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=A.titleAttr)!=null?Qe:A.tooltip)!=null?Te:null,type:ke?null:"button",href:ke||null,target:A.target||null,rel:A.rel||(A.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,A,Se,je);const tt=(dt=A.onClick)==null?void 0:dt.call(A,Se,je);je.defaultPrevented||(Ne&&((bt=JSswift.router)!=null&&bt.navigate)&&(je.preventDefault(),JSswift.router.navigate(Ne)),tt!==!1&&ee&&X())}};A.attrs&&typeof A.attrs=="object"&&Object.assign(v,A.attrs);const c=ke?_.a:_.button,N=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(v,be.length?_.span({class:"cms-menu-entry-icon"},...be):null,_.span({class:"cms-menu-entry-main"},...N),E.length?_.span({class:"cms-menu-entry-aside"},...E):null)]},d=()=>{var pe,Ie,_e,I,we,E,x;const f=W(),k={close:X,dismiss:X,open:C,toggle:j,update:a,isOpen:U,entry:()=>u,anchorEl:te(),props:f},A=R(f.icon,k,f.iconSize||"md"),H=J(s,"eyebrow",k,z(f.eyebrow,k)),ge=J(s,"title",k,z((Ie=(pe=f.title)!=null?pe:f.heading)!=null?Ie:f.label,k)),Se=J(s,"subtitle",k,z((_e=f.subtitle)!=null?_e:f.description,k)),ye=J(s,"before",k,z(f.before,k)),V=J(s,"header",k,z(f.header,k)),O=J(s,"after",k,z(f.after,k)),K=J(s,"footer",k,z(f.footer,k)),ke=J(s,"status",k,z(f.status,k));let Ne=(I=f.content)!=null?I:f.body;Ne==null&&n&&n.length&&(Ne=n);let ee=J(s,"content",k,z(Ne,k));ee.length||(ee=J(s,"body",k,z(Ne,k))),ee.length||(ee=J(s,"default",k,z(Ne,k)));const xe=g((E=(we=f.items)!=null?we:f.actionsList)!=null?E:f.entries,k),be=xe.length?[]:J(s,"empty",k,z((x=f.empty)!=null?x:f.emptyText,k));let Ce=null;return V.length?Ce=_.div({class:ae(["cms-menu-head","cms-menu-head-custom",f.headerClass])},...V):(A.length||H.length||ge.length||Se.length)&&(Ce=_.div({class:ae(["cms-menu-head",f.headerClass])},A.length?_.div({class:"cms-menu-head-icon"},...A):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(f.dense,"dense"),fe(xe.length>0,"has-items"),fe(K.length>0||ke.length>0,"has-footer"),f.class]),style:f.style||{},role:f.role||"menu","aria-label":f.ariaLabel||null},ye.length?_.div({class:"cms-menu-before"},...ye):null,Ce,ee.length?_.div({class:ae(["cms-menu-content",f.contentClass])},...ee):null,xe.length?_.div({class:ae(["cms-menu-items",f.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",f.footerClass])},ke.length?_.div({class:"cms-menu-status"},...ke):null,K.length?_.div({class:"cms-menu-footer-actions"},...K):null):null)},m=f=>{var ge;if(!(f!=null&&f.panel))return;const k=W(),A=se(k),H=me(k);$(f.panel,"_menuClassTokens",["cms-menu-panel","cms-clear-set","cms-singularity",H?`cms-menu-${H}`:"",A?`cms-state-${A}`:"",l(k.outline)?"outline":"",...Q(k.panelClass)]),$(f.overlay,"_menuOverlayClassTokens",[...Q(k.overlayClass)]),f.panel.dataset.placement=re(k),Y(f.panel,"--cms-menu-width",l(k.width),Be),Y(f.panel,"--cms-menu-min-width",l(k.minWidth),Be),Y(f.panel,"--cms-menu-max-width",l(k.maxWidth),Be),Y(f.panel,"--cms-menu-max-height",l(k.maxHeight),Be),Y(f.panel,"--cms-menu-body-max-height",l((ge=k.bodyMaxHeight)!=null?ge:k.contentMaxHeight),Be),k.panelStyle&&Object.assign(f.panel.style,k.panelStyle),Ke(f.panel,k)},F=()=>{u!=null&&u.panel&&u.panel.replaceChildren(d())},X=()=>{if(D(),!u)return;const f=u;u=null,yn(f,()=>JSswift.overlay.close(f.id))},a=(f={})=>{var k,A,H,ge;if(f&&typeof f=="object"&&(y={...y,...f}),u){const Se=W();m(u),F(),(ge=u.reposition)==null||ge.call(u,{anchorEl:u._anchorEl,placement:re(Se),offsetX:(k=Se.offsetX)!=null?k:0,offsetY:(H=(A=Se.offsetY)!=null?A:Se.offset)!=null?H:8}),ue()}return L},C=(f=null,k=null)=>{var Ce,pe,Ie,_e,I,we,E,x,v,c,N,de,Ae,Je,B,Le;D();const{anchorEl:A,nextProps:H}=Z(f,k);H&&(y={...y,...H});const ge=W(),Se=te(A);if(!Se||l(ge.disabled))return null;if(u&&u._anchorEl===Se){const Me=W();return m(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(),b=document.activeElement;let ye=null;if(u=JSswift.overlay.open(()=>d(),{type:"menu",anchorEl:Se,placement:re(ge),offsetX:(I=ge.offsetX)!=null?I:0,offsetY:(E=(we=ge.offsetY)!=null?we:ge.offset)!=null?E: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&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const V=u;ye=V,V._anchorEl=Se;const O=()=>{clearTimeout(S),S=null},K=()=>{P()},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=(v=ge.trigger)!=null?v:ge.triggers)!=null?c:w(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)},m(V),(Je=V.reposition)==null||Je.call(V,{anchorEl:Se,placement:re(ge),offsetX:(N=ge.offsetX)!=null?N:0,offsetY:(Ae=(de=ge.offsetY)!=null?de:ge.offset)!=null?Ae:8}),bn(V),(Le=(B=W()).onOpen)==null||Le.call(B,V),ue(),V},h=(f,k=null)=>{clearTimeout(S),S=null,clearTimeout(T),T=setTimeout(()=>C(f,k),oe())},P=(f=!1)=>{if(clearTimeout(T),T=null,!!u){if(clearTimeout(S),f){X();return}S=setTimeout(()=>X(),le())}},j=(f=null,k=null)=>U()?(X(),null):C(f,k),U=()=>!!u,L={open:C,close:X,show:h,hide:P,toggle:j,update:a,bind:f=>{var K,ke;if(!f)return()=>{};i=f;const k=W(),A=M((ke=(K=k.trigger)!=null?K:k.triggers)!=null?ke:w(k,"open")?"manual":null),H=A.has("hover"),ge=A.has("focus"),Se=A.has("click"),ye=A.has("manual")||!H&&!ge&&!Se,V=[],O=()=>{D(),V.forEach(Ne=>Ne()),i===f&&(i=null)};if(w(k,"open"))return at(k.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?C(i):P(!0))},"UI.Menu:open"):k.open===!0?C(f):k.open===!1&&P(!0),O;if(ye||l(k.disabled))return O;if(H){const Ne=()=>h(f),ee=()=>P();f.addEventListener("mouseenter",Ne),f.addEventListener("mouseleave",ee),V.push(()=>{f.removeEventListener("mouseenter",Ne),f.removeEventListener("mouseleave",ee)})}if(ge){const Ne=()=>h(f),ee=()=>P();f.addEventListener("focus",Ne),f.addEventListener("blur",ee),V.push(()=>{f.removeEventListener("focus",Ne),f.removeEventListener("blur",ee)})}if(Se){const Ne=ee=>{var xe,be;(be=(xe=W()).onTriggerClick)==null||be.call(xe,ee),!ee.defaultPrevented&&j(f)};f.addEventListener("click",Ne),V.push(()=>f.removeEventListener("click",Ne))}return O},isOpen:U,entry:()=>u,props:()=>({...y})};return L},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 y={...e},u=null,i=null,b=null,T=null,S=null;const w=(L,f)=>Object.prototype.hasOwnProperty.call(L||{},f),z=(L,f)=>typeof L=="function"?L(f):L,Q=L=>String(L||"").split(/\s+/).filter(Boolean),G=L=>L&&typeof L=="object"&&!L.nodeType&&!Array.isArray(L)&&!(L instanceof Function),ie=L=>!!L&&typeof L=="object"&&(L.nodeType===1||typeof L.getBoundingClientRect=="function"),D=()=>{clearTimeout(T),clearTimeout(S),T=null,S=null},$=(L,f,k)=>{if(!L)return;const A=L[f]||[];A.length&&L.classList.remove(...A);const H=(k||[]).filter(Boolean);H.length&&L.classList.add(...H),L[f]=H},Y=(L,f,k,A=H=>H)=>{if(L){if(k==null||k===""){L.style.removeProperty(f);return}L.style.setProperty(f,A(k))}},W=()=>y,se=L=>{var k;const f=l((k=L.state)!=null?k:L.color);return f?o.includes(f)?f:String(f):""},me=L=>{const f=l(L.size);return typeof f=="string"&&r.includes(f)?f:""},re=L=>{var k,A,H;const f=String(l((H=(A=(k=L.actionsAlign)!=null?k:L.footerAlign)!=null?A:L.alignActions)!=null?H:"end")).toLowerCase();return["start","left"].includes(f)?"start":["center","middle"].includes(f)?"center":["between","space-between"].includes(f)?"between":["stretch","full"].includes(f)?"stretch":"end"},oe=L=>{var f,k;return String(l((k=(f=L.placement)!=null?f:L.position)!=null?k:"bottom-start"))},le=(L,f)=>{const k=l(L);if(k==null||k==="")return f;const A=Number(k);return Number.isFinite(A)?A:f},te=()=>le(W().delay,0),M=()=>le(W().hideDelay,120),Z=L=>{var k,A;return((A=(k=L.closable)!=null?k:L.dismissible)!=null?A:L.closeButton)===!0},q=(L=null)=>{var k,A,H;if(L)return L;const f=W();return i||l((H=(A=(k=f.anchorEl)!=null?k:f.triggerEl)!=null?A:f.target)!=null?H:f.anchor)||null},ue=L=>{if(L==null||L===!0)return new Set(["click"]);if(L===!1)return new Set(["manual"]);const f=Array.isArray(L)?L:String(L).split(/[\s,|/]+/),k=new Set;return f.forEach(A=>{const H=String(A||"").trim().toLowerCase();H&&(H==="mouseenter"||H==="mouseover"?k.add("hover"):H==="blur"||H==="focusin"?k.add("focus"):H==="tap"?k.add("click"):k.add(H))}),k.size?k:new Set(["manual"])},R=(L,f)=>{var H,ge,Se;let k=null,A=null;if(ie(L))k=L,G(f)&&(A=f);else if(G(L)){A=L;const ye=(Se=(ge=(H=L.anchorEl)!=null?H:L.triggerEl)!=null?ge:L.target)!=null?Se:L.anchor;ie(ye)&&(k=ye)}else L!=null&&(k=L);return{anchorEl:k,nextProps:A}},g=()=>{var be,Ce,pe,Ie,_e,I,we,E,x;const L=W(),f={close:F,dismiss:F,open:a,toggle:P,update:X,isOpen:j,entry:()=>u,anchorEl:q(),props:L},k=L.icon!=null?typeof L.icon=="string"?he.Icon({name:L.icon,size:L.iconSize||"md"}):JSswift.ui.slot(L.icon,{as:"icon"}):null,A=J(s,"eyebrow",f,z(L.eyebrow,f)),H=J(s,"title",f,z((Ce=(be=L.title)!=null?be:L.heading)!=null?Ce:L.label,f)),ge=J(s,"subtitle",f,z((pe=L.subtitle)!=null?pe:L.description,f)),Se=J(s,"icon",f,k),ye=J(s,"header",f,z((_e=(Ie=L.headerContent)!=null?Ie:L.head)!=null?_e:L.header,f)),V=Z(L)?J(s,"close",f,he.Btn({class:"cms-dialog-close",size:"sm",outline:!0,"aria-label":L.closeLabel||"Chiudi popover","data-popover-close":!0},he.Icon({name:L.closeIcon||"close",size:"sm"}))):[];let O=(E=(we=(I=L.content)!=null?I:L.body)!=null?we:L.message)!=null?E:L.text;O==null&&n&&n.length&&(O=n);let K=J(s,"content",f,z(O,f));K.length||(K=J(s,"body",f,z(O,f))),K.length||(K=J(s,"default",f,z(O,f)));const ke=z((x=L.footer)!=null?x:L.actions,f);let Ne=J(s,"footer",f,ke);Ne.length||(Ne=J(s,"actions",f,ke));let ee=null;ye.length?ee=_.div({class:"cms-dialog-head cms-dialog-head-custom"},...ye):(A.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"},A.length?_.div({class:"cms-dialog-eyebrow"},...A):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",L.bodyClass])},...K)),Ne.length&&xe.push(_.div({class:ae(["cms-dialog-actions",`is-${re(L)}`,fe(L.stackActions,"is-stacked"),L.actionsClass,L.footerClass])},...Ne)),xe.length||xe.push(_.div({class:ae(["cms-dialog-body",L.bodyClass])})),_.div({class:ae(["cms-dialog-shell","cms-popover-shell",fe(!!ee,"has-head"),fe(Ne.length>0,"has-footer"),fe(L.divider!==!1,"with-divider")])},...xe)},d=L=>{var H;if(!(L!=null&&L.panel))return;const f=W(),k=se(f),A=me(f);$(L.panel,"_popoverClassTokens",["cms-dialog","cms-popover","cms-singularity","cms-clear-set",A?`cms-dialog-${A}`:"",k,k?`cms-state-${k}`:"",l(f.scrollable)?"scrollable":"",l(f.stickyHeader)?"sticky-head":"",l(f.stickyActions)?"sticky-actions":"",l(f.borderless)?"borderless":"",...Q(f.class),...Q(f.panelClass)]),$(L.overlay,"_popoverOverlayClassTokens",[...Q(f.overlayClass)]),L.panel.dataset.placement=oe(f),Y(L.panel,"--cms-dialog-width",l(f.width),Be),Y(L.panel,"--cms-dialog-min-width",l(f.minWidth),Be),Y(L.panel,"--cms-dialog-max-width",l(f.maxWidth),Be),Y(L.panel,"--cms-dialog-max-height",l(f.maxHeight),Be),Y(L.panel,"--cms-dialog-body-max-height",l((H=f.bodyMaxHeight)!=null?H:f.contentMaxHeight),Be),f.style&&Object.assign(L.panel.style,f.style),Ke(L.panel,f),L.panel.setAttribute("role",f.role||"dialog"),L.panel.setAttribute("aria-modal",f.modal===!0?"true":"false"),f.ariaLabel?L.panel.setAttribute("aria-label",f.ariaLabel):L.panel.removeAttribute("aria-label")},m=()=>{u!=null&&u.panel&&u.panel.replaceChildren(g())},F=()=>{if(D(),!u)return;const L=u;u=null,yn(L,()=>JSswift.overlay.close(L.id))},X=(L={})=>(L&&typeof L=="object"&&(y={...y,...L}),u&&(d(u),m()),ce),a=(L=null,f=null)=>{var xe,be,Ce,pe,Ie,_e,I,we;D();const{anchorEl:k,nextProps:A}=R(L,f);A&&(y={...y,...A});const H=W(),ge=q(k);if(!ge||l(H.disabled))return null;if(u&&u._anchorEl===ge)return d(u),m(),u;u&&F(),b=document.activeElement;const Se=ue((be=(xe=H.trigger)!=null?xe:H.triggers)!=null?be:w(H,"open")?"manual":null),ye=Se.has("hover"),V=Se.has("focus");let O=null;if(u=JSswift.overlay.open(()=>g(),{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 E,x,v;(E=O==null?void 0:O._popoverCleanup)==null||E.call(O),(v=(x=W()).onClose)==null||v.call(x,O),W().returnFocus!==!1&&b&&typeof b.focus=="function"&&setTimeout(()=>b.focus(),0)}}),!(u!=null&&u.panel))return u;const K=u;O=K,K._anchorEl=ge;const ke=()=>{clearTimeout(S),S=null},Ne=()=>{!ye&&!V||h()},ee=E=>{const x=E.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 E,x,v,c,N;(E=K.panel)==null||E.removeEventListener("click",ee),(x=K.panel)==null||x.removeEventListener("mouseenter",ke),(v=K.panel)==null||v.removeEventListener("mouseleave",Ne),(c=K.panel)==null||c.removeEventListener("focusin",ke),(N=K.panel)==null||N.removeEventListener("focusout",Ne)},d(K),bn(K),(we=(I=W()).onOpen)==null||we.call(I,K),K},C=(L,f=null)=>{clearTimeout(S),S=null,clearTimeout(T),T=setTimeout(()=>a(L,f),te())},h=(L=!1)=>{if(clearTimeout(T),T=null,!!u){if(clearTimeout(S),L){F();return}S=setTimeout(()=>F(),M())}},P=(L=null,f=null)=>j()?(F(),null):a(L,f),j=()=>!!u,ce={open:a,close:F,show:C,hide:h,toggle:P,update:X,bind:L=>{var O,K;if(!L)return()=>{};i=L;const f=W(),k=ue((K=(O=f.trigger)!=null?O:f.triggers)!=null?K:w(f,"open")?"manual":null),A=k.has("hover"),H=k.has("focus"),ge=k.has("click"),Se=k.has("manual")||!A&&!H&&!ge,ye=[],V=()=>{D(),ye.forEach(ke=>ke()),i===L&&(i=null)};if(w(f,"open"))return at(f.open)?JSswift.reactive.effect(()=>{i&&(l(W().open)?a(i):h(!0))},"UI.Popover:open"):f.open===!0?a(L):f.open===!1&&h(!0),V;if(Se||l(f.disabled))return V;if(A){const ke=()=>C(L),Ne=()=>h();L.addEventListener("mouseenter",ke),L.addEventListener("mouseleave",Ne),ye.push(()=>{L.removeEventListener("mouseenter",ke),L.removeEventListener("mouseleave",Ne)})}if(H){const ke=()=>C(L),Ne=()=>h();L.addEventListener("focus",ke),L.addEventListener("blur",Ne),ye.push(()=>{L.removeEventListener("focus",ke),L.removeEventListener("blur",Ne)})}if(ge){const ke=Ne=>{var ee,xe;(xe=(ee=W()).onTriggerClick)==null||xe.call(ee,Ne),!Ne.defaultPrevented&&P(L)};L.addEventListener("click",ke),ye.push(()=>L.removeEventListener("click",ke))}return V},isOpen:j,entry:()=>u,props:()=>({...y})};return ce},he.ContextMenu=(...t)=>{const{props:e,children:n}=JSswift.uiNormalizeArgs(t);let s={...e},o=null,r=null,y=null;const u=m=>m&&typeof m=="object"&&!m.nodeType&&!Array.isArray(m)&&!(m instanceof Function),i=m=>!!m&&typeof m=="object"&&(m.nodeType===1||typeof m.getBoundingClientRect=="function"),b=m=>!!m&&typeof m=="object"&&("clientX"in m||"type"in m||"target"in m||"currentTarget"in m),T=m=>!!m&&Number.isFinite(Number(m.x))&&Number.isFinite(Number(m.y)),S=()=>s,w=(m,F)=>{const X=Number(m),a=Number(F);return!Number.isFinite(X)||!Number.isFinite(a)?null:{x:X,y:a}},z=m=>m?{_cmsContextPoint:m,getBoundingClientRect:()=>({top:m.y,bottom:m.y,left:m.x,right:m.x,width:0,height:0})}:null,Q=m=>{if(!i(m))return null;const F=m.getBoundingClientRect();return w(F.left+Math.min(F.width/2,24),F.top+Math.min(F.height/2,24))},G=m=>{var F,X,a,C;return l((C=(a=(X=(F=m==null?void 0:m.anchorEl)!=null?F:m==null?void 0:m.triggerEl)!=null?X:m==null?void 0:m.target)!=null?a:m==null?void 0:m.anchor)!=null?C:null)},ie=(m,F=null)=>{if(!m)return Q(F||y);const X=w(m.clientX,m.clientY);if(X)return X;const a=G({anchorEl:F||m.currentTarget||m.target||y});return Q(a)},D=(m={})=>{if(!u(m))return{};const F={...m};return delete F.event,delete F.point,delete F.x,delete F.y,F},$=()=>{var F,X,a;const m=S();return{...m,trigger:"manual",placement:m.placement||"bottom-start",offsetX:(F=m.offsetX)!=null?F:0,offsetY:(a=(X=m.offsetY)!=null?X:m.offset)!=null?a:4,closeOnOutside:m.closeOnOutside!==!1,closeOnEsc:m.closeOnEsc!==!1,role:m.role||"menu",ariaLabel:m.ariaLabel||m.title||"Context menu",class:ae(["cms-context-menu-shell",m.class]),panelClass:ae(["cms-context-menu-panel",m.panelClass])}},Y=he.Menu($(),...n),W=(m=null,F=null,X=null)=>{let a=null,C=null,h=null;if(b(m))a=ie(m,y),h=u(F)?D(F):null;else if(typeof m=="number"||typeof F=="number")a=w(m,F),h=u(X)?D(X):null;else if(T(m))a=w(m.x,m.y),h=u(F)?D(F):null;else if(i(m))C=m,h=u(F)?D(F):null;else if(u(m)){const P=T(m.point)?m.point:T(m)?m:null,j=G(m),U=m.event;a=P?w(P.x,P.y):ie(U,j||y),C=j&&i(j)?j:null,h={...D(m),...u(F)?D(F):{}}}else o&&(a={...o});return{point:a,anchor:C,nextProps:h}},se=(m,F=null)=>{r=m||r,o=F||m&&m._cmsContextPoint||o},me=(m=null)=>{u(m)&&Object.keys(m).length&&(s={...s,...m})},re=(m=null,F=null)=>{if(F)return z(F);if(m&&i(m))return m;const X=G(S());return i(X)?X:o?z(o):i(r)?r:i(y)?y:null},oe=(m=null,F=null,X=null)=>{const{point:a,anchor:C,nextProps:h}=W(m,F,X);me(h);const P=re(C,a);return P?(se(P,a),Y.open(P,$())):null},le=(m,F,X=null)=>oe(m,F,X),te=(m,F=null)=>oe(m,F),M=()=>(Y.close(),d),Z=(m=!0)=>(m===!1?Y.hide(!1):Y.close(),d),q=(m=null,F=null,X=null)=>oe(m,F,X),ue=(m=null,F=null,X=null)=>Y.isOpen()?(M(),null):oe(m,F,X),R=(m={})=>(me(D(m)),Y.update($()),d),d={open:oe,openAt:le,openFromEvent:te,show:q,hide:Z,close:M,toggle:ue,update:R,bind:(m,F=null)=>{if(!m)return()=>{};const X=u(F)?D(F):null,a=h=>{var j,U;y=m,h.preventDefault(),!(((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:m,open:oe,close:M,update:R}))===!1||l(S().disabled))&&oe({event:h,anchorEl:m},X)},C=h=>{var j,U;h.key!=="ContextMenu"&&!(h.shiftKey&&h.key==="F10")||(y=m,h.preventDefault(),((U=(j=S()).onTrigger)==null?void 0:U.call(j,h,{element:m,open:oe,close:M,update:R}))===!1||l(S().disabled))||oe({event:h,anchorEl:m},X)};return m.addEventListener("contextmenu",a),m.addEventListener("keydown",C),()=>{m.removeEventListener("contextmenu",a),m.removeEventListener("keydown",C)}},isOpen:Y.isOpen,entry:Y.entry,props:()=>({...s})};return d}})(JSswift);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsswift/ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.52",
|
|
4
4
|
"description": "JSswift UI layer built on top of @jsswift/core",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,6 +38,6 @@
|
|
|
38
38
|
"src"
|
|
39
39
|
],
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@jsswift/core": "^1.0.
|
|
41
|
+
"@jsswift/core": "^1.0.52"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/src/80-data.js
CHANGED
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"actions", "actionsLabel", "emptyText", "loadingText", "onRowClick", "onRowDblClick",
|
|
61
61
|
"tableClass", "tableStyle", "cardClass", "dense", "striped", "hover", "stickyHeader",
|
|
62
62
|
"toolbar", "toolbarStart", "toolbarEnd", "caption", "footer", "status", "rowClass", "rowAttrs",
|
|
63
|
-
"minTableWidth", "hideHeader", "hideFooter", "slots", "body"
|
|
63
|
+
"minTableWidth", "hideHeader", "hideFooter", "hideStatus", "slots", "body"
|
|
64
64
|
]);
|
|
65
65
|
wrapProps.class = uiClass(["cms-table-card", props.class, props.cardClass]);
|
|
66
66
|
if (props.dense != null) wrapProps.dense = props.dense;
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
statusSort,
|
|
124
124
|
...statusExtraNodes
|
|
125
125
|
);
|
|
126
|
-
shell.appendChild(status);
|
|
126
|
+
if (props.hideStatus !== true) shell.appendChild(status);
|
|
127
127
|
|
|
128
128
|
const captionNodes = renderSlotToArray(slots, "caption", {}, props.caption);
|
|
129
129
|
if (captionNodes.length) shell.appendChild(_.div({ class: "cms-table-caption" }, ...captionNodes));
|