jsswift 2.1.0 → 2.1.1

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.
@@ -24,13 +24,33 @@ The map locates a contract; it does not replace it. Avoid reading all of `ui/com
24
24
 
25
25
  ## Import, create, mount
26
26
 
27
- For an existing app, preserve its loading method. With the configured Vite plugin, import `jss:runtime` instead of the two traditional imports below: it includes the configured JavaScript, CSS and extras. Read [configured-runtime.md](configured-runtime.md) for setup and package availability; older installed releases may not expose this tooling.
27
+ For **new Vite apps with JSswift 2.1+**, use a selective runtime by default. Create these two files before implementing the page; this setup is sufficient without another guide.
28
+
29
+ `jss.config.js` (list all components called by the application; dependencies are automatic):
30
+
31
+ ```mjs
32
+ export default {
33
+ ui: {components:['Button','Input','Select','Card','Table'], services:['Dialog'], responsive:false},
34
+ extras:[]
35
+ };
36
+ ```
37
+
38
+ `vite.config.js` (add the plugin to existing plugins if the file already exists):
39
+
40
+ ```mjs
41
+ import { defineConfig } from 'vite';
42
+ import { jssRuntime } from 'jsswift/vite';
43
+ export default defineConfig({plugins:[jssRuntime()]});
44
+ ```
45
+
46
+ Use `responsive:true` for breakpoint utilities/props and add `Kpi` for the CRUD example. Include dynamically called components explicitly. Use `ui:{all:true}` only when the full catalog is required. Selection happens at build time, not by detecting calls in application code. Do not combine `jss:runtime` with complete runtime or UI CSS imports. Inspect `dist/jss-build-report.json` after building to verify selected components and extras.
47
+
48
+ For existing apps preserve their loading method. Traditional `import 'jsswift'` plus `import 'jsswift/css/ui-light.css'` loads the complete JavaScript UI. Older versions may require this method; check installed version/export availability before migrating. Advanced configuration is in [configured-runtime.md](configured-runtime.md).
28
49
 
29
50
  With Vite, provide `<div id="app"></div>` and a module entrypoint:
30
51
 
31
52
  ```js
32
- import 'jsswift';
33
- import 'jsswift/css/ui-light.css';
53
+ import 'jss:runtime';
34
54
  const _ = window._;
35
55
  const name = _.rod('Prodotto 01'), category = _.rod('Casa');
36
56
  const input = _.Input({label:'Nome', required:true, model:name});
@@ -101,7 +121,7 @@ Use the map for the missing API, then read its focused contract. Button is `comp
101
121
 
102
122
  `_.Kpi({title:'Disponibili',value:9,note:'Con quantità maggiore di zero'})` supplies dashboard metrics. Update KPI when inventory changes, not on each filter; see CRUD. Read the Kpi contract only for additional options.
103
123
 
104
- Table returns a Card; use a structural container. Card props include `shadow:'none'`, `radius:'12px'`, and `padding`. For a fixed light surface: `style:{background:'#fff'}`, `tableStyle:{background:'#fff','--set-color-1':'#fff'}`. This does not provide automatic dark theming.
124
+ Table returns a Card; use a structural container. When an enclosing surface already has a frame, set `embedded:true` to remove Table’s outer and inner frames; `shadow:'none'` alone only removes elevation. Card props include `shadow:'none'`, `radius:'12px'`, and `padding`. For a fixed light surface: `style:{background:'#fff'}`, `tableStyle:{background:'#fff','--set-color-1':'#fff'}`. This does not provide automatic dark theming.
105
125
 
106
126
  For external pagination use `pagination:false`, `hideFooter:true`, `hideStatus:true`, `emptyText:'Nessun prodotto trovato'`, `minTableWidth:600`. Set each data column's `sortable:false`: built-in sorting sees only the supplied page. Sort the full filtered dataset before slicing if needed.
107
127
 
@@ -119,3 +139,5 @@ Input's native input is transparent; preserve that background to keep the outer
119
139
  base.css is already included. Use `_.setTheme('dark')` or `_.setTheme('light')`; persistence defaults to `jsswift:theme`. At startup restore with `_.setTheme(_.getTheme())`. Customize the existing `--jss-primary-600`/`--jss-primary-700` palette values after the UI import. See [base CSS and themes](ui/themes.md) only for additional theme requirements.
120
140
 
121
141
  Replace component subtrees with `_.mount(host, nextContent)` (default clear:true), which cleans up previous effects and subscriptions. Native `replaceChildren`/`innerHTML` alone do not run JSswift cleanup. Keep shared models owned by the application alive.
142
+
143
+ Dispose caller-owned temporary rods explicitly with `model.dispose()` after their editor closes; overlay cleanup removes subscriptions, not application ownership. Keep shared models alive until their owner is destroyed.
@@ -37,6 +37,7 @@ Exact JSswift UI contract. Shared definitions listed in `commonProps` are in [co
37
37
  "minTableWidth": {"type": "string|number", "description": "Component configuration for \"minTableWidth\". When not handled internally, it is forwarded to the root element.", "default": null, "values": null, "category": "general"},
38
38
  "stickyHeader": {"type": "boolean", "description": "Keeps the header region sticky during scroll.", "default": null, "values": null, "category": "general"},
39
39
  "hideHeader": {"type": "boolean", "description": "Component configuration for \"hideHeader\". When not handled internally, it is forwarded to the root element.", "default": null, "values": null, "category": "general"},
40
+ "embedded": {"type": "boolean", "description": "Removes the outer Card frame/shadow, body padding and inner scroll-frame border/radius for use inside an application-owned surface. Preserves table scrolling and row separators. Evaluated at creation.", "default": false, "values": null, "category": "layout"},
40
41
  "hideStatus": {"type": "boolean", "description": "Hides the entire status row, including row count, filter/sort indicators and custom status content. Independent of toolbar, column headings and footer. Evaluated at creation.", "default": false, "values": null, "category": "layout"},
41
42
  "hideFooter": {"type": "boolean", "description": "Component configuration for \"hideFooter\". When not handled internally, it is forwarded to the root element.", "default": null, "values": null, "category": "general"},
42
43
  "dense": {"type": "boolean", "description": "Uses compact spacing and sizing.", "default": false, "values": null, "category": "layout"},
@@ -129,3 +130,5 @@ _.Table({rows:products, columns:[{key:'name',label:'Nome'}],
129
130
  ```
130
131
 
131
132
  `radius`, `padding` and `shadow` act on the Card; `tableStyle` acts on the table, and `--set-color-1` supplies its header background. The inner scroll frame remains. This explicitly fixes a light surface; for theme switching use theme-dependent values instead. Do not remove focus outlines to change a surface.
133
+
134
+ Use `embedded:true` when an enclosing application surface owns the border and spacing. Default standalone Table appearance remains unchanged.
@@ -1,6 +1,6 @@
1
1
  # Compact verified CRUD
2
2
 
3
- Load JSswift and its UI CSS, then run the following code with an `#app` element. Uses public field APIs; selectors below identify application-owned buttons only. Persistence failures keep the editor open. Filtering applies to names and category; five rows per page. Create fresh fields for each opening; closing an overlay cleans up its mounted content.
3
+ For a new Vite app follow the selective setup in [AI.md](../AI.md#import-create-mount), use `components:['Button','Input','Select','Table','Kpi']`, `services:['Dialog']`, and import `jss:runtime` in the entrypoint. For an existing app preserve its loading method. Then run the following code with an `#app` element. Uses public field APIs; selectors below identify application-owned buttons only. Persistence failures keep the editor open. Filtering applies to names and category; five rows per page. Create fresh fields for each opening; closing an overlay cleans up its mounted content and explicitly disposes the eight caller-owned field/error rods.
4
4
 
5
5
  ```js
6
6
  const _ = window._;
@@ -17,6 +17,7 @@ function edit(record) {
17
17
  editing = record?.id ?? null; origin = record ? `edit-${record.id}` : 'add-product';
18
18
  models = Object.fromEntries(['name','category','price','quantity'].map(k => [k, _.rod('')]));
19
19
  errors = Object.fromEntries(Object.keys(models).map(k => [k, _.rod('')]));
20
+ const ownedModels = [...Object.values(models), ...Object.values(errors)], returnFocus = origin;
20
21
  fields = {
21
22
  name: _.Input({label:'Nome', required:true, model:models.name, error:errors.name}),
22
23
  category: _.Select({label:'Categoria', required:true, model:models.category, error:errors.category, options:categories.map(value => ({value,label:value}))}),
@@ -25,7 +26,8 @@ fields = {
25
26
  };
26
27
  dialog = _.Dialog({title:'Prodotto', ariaLabel:'Prodotto', trapFocus:true, autoFocus:true, closeOnEsc:true,
27
28
  content:_.div({}, ...Object.values(fields)), onOpen:() => fields.name.focus(),
28
- onClose:() => requestAnimationFrame(() => (document.getElementById(origin) ?? add).focus())});
29
+ onClose:() => { ownedModels.forEach(model => model.dispose());
30
+ requestAnimationFrame(() => (document.getElementById(returnFocus) ?? add).focus()); }});
29
31
  save = _.Button({id:'save-product', onClick:() => {
30
32
  const value = {name:models.name.value.trim(),category:models.category.value,price:Number(models.price.value),quantity:Number(models.quantity.value)};
31
33
  errors.name.value = value.name ? '' : 'Nome obbligatorio';
@@ -34,7 +36,9 @@ save = _.Button({id:'save-product', onClick:() => {
34
36
  errors.quantity.value = String(models.quantity.value).trim() && Number.isSafeInteger(value.quantity) && value.quantity >= 0 ? '' : 'Quantità non valida';
35
37
  const invalid = Object.keys(errors).find(k => errors[k].value);
36
38
  if (invalid) { fields[invalid].focus(); return; }
37
- const record = {id:editing ?? Math.max(0,...rows.map(r => r.id))+1,...value};
39
+ const usedIds = new Set(rows.map(r => r.id));
40
+ let freeId = 1; while (usedIds.has(freeId)) freeId++;
41
+ const record = {id:editing ?? freeId,...value};
38
42
  const next = editing == null ? [...rows,record] : rows.map(r => r.id === editing ? record : r);
39
43
  try { localStorage.setItem(key, JSON.stringify(next)); } catch { notice.textContent = 'Salvataggio non riuscito'; return; }
40
44
  rows = next; renderStats(); render(); dialog.close(); notice.textContent = 'Salvato';
@@ -88,6 +92,6 @@ Build success alone does not verify this flow. In a browser, record these result
88
92
 
89
93
  The example uses public field APIs and rod values. If a browser is unavailable, report these interactions as unverified rather than deriving them from pure-logic assertions.
90
94
 
91
- Table supplies its own Card and empty state. This example disables column sorting because it supplies a page slice; sort the complete filtered data before slicing if global sorting is required. For dashboard counters prefer `_.Kpi({title, value, note})`. Preserve field input transparency and use the container height variable described in [AI guide](../AI.md#catalogue-surfaces-and-field-styling).
95
+ Table supplies its own Card and empty state. If an application adds a surrounding panel with its own border, use `embedded:true` on Table to avoid nested frames. This example disables column sorting because it supplies a page slice; sort the complete filtered data before slicing if global sorting is required. For dashboard counters prefer `_.Kpi({title, value, note})`. Preserve field input transparency and use the container height variable described in [AI guide](../AI.md#catalogue-surfaces-and-field-styling).
92
96
 
93
- Lifecycle: `_.mount(host, nextContent)` clears the previous subtree through JSswift cleanup (default `clear:true`). Its returned function unmounts the new content. Use this for replacing component subtrees; native `replaceChildren`, `innerHTML` or `remove` alone do not invoke registered JSswift cleanup. Keep shared models alive until their application owner disposes them.
97
+ Lifecycle: `_.mount(host, nextContent)` clears the previous subtree through JSswift cleanup (default `clear:true`). Its returned function unmounts the new content. Use this for replacing component subtrees; native `replaceChildren`, `innerHTML` or `remove` alone do not invoke registered JSswift cleanup. Keep shared models alive until their application owner disposes them. Temporary editor models are owned by each opening and disposed in `onClose`; capture them there rather than disposing models from a later opening. New records use the first free positive ID, so a stored `Number.MAX_SAFE_INTEGER` does not cause unsafe IDs.
@@ -1023,5 +1023,5 @@
1023
1023
  "documentAliases": {
1024
1024
  "components/button.md": "components/btn.md"
1025
1025
  },
1026
- "packageVersion": "2.1.0"
1026
+ "packageVersion": "2.1.1"
1027
1027
  }
package/dist/jsswift.js CHANGED
@@ -14909,8 +14909,8 @@ transition: width 200ms ease;
14909
14909
  setPage(1);
14910
14910
  }, "UI.Table:queryWatch");
14911
14911
  }
14912
- const wrapProps = JSswift.omit(props, ["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"]);
14913
- wrapProps.class = uiClass(["jss-table-card", props.class, props.cardClass]);
14912
+ const wrapProps = JSswift.omit(props, ["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", "embedded", "minTableWidth", "hideHeader", "hideFooter", "hideStatus", "slots", "body"]);
14913
+ wrapProps.class = uiClass(["jss-table-card", props.embedded === true && "jss-table-embedded", props.class, props.cardClass]);
14914
14914
  if (props.dense != null) wrapProps.dense = props.dense;
14915
14915
  const shell = _.div({ class: "jss-table-shell" });
14916
14916
  const leadNodes = renderSlotToArray(slots, "default", {}, children);
@@ -31,4 +31,4 @@ background: var(--jss-primary);
31
31
  transition: width 200ms ease;
32
32
  `,l.appendChild(n);const i=document.createElement("div");i.style.cssText="display:flex; gap: 12px; align-items:center; width: 100%;",i.appendChild(t),i.appendChild(s),e.appendChild(i),e.appendChild(l),hn.appendChild(e),document.body.appendChild(hn);const c=document.createElement("style");return c.textContent=`
33
33
  @keyframes jssSpin { to { transform: rotate(360deg); } }
34
- `,document.head.appendChild(c),hn._textNode=s,hn._spinner=t,hn._progressWrap=l,hn._progressBar=n,hn._progressActive=!1,hn}function uo(e,t){if(typeof e=="object"&&e!==null)return{...e};const s=t&&typeof t=="object"?t:{};return typeof t=="string"&&(e==null||typeof e=="number")?{...s,message:t}:{...s,message:e}}function fo(e,t){const s=t==="progress";e._spinner.style.display=s?"none":"",e._progressWrap.style.display=s?"block":"none",e._mode=t}wt.loading.show=function(e="Loading...",t={}){const s=co(),l=uo(e,t);Hs++,s._progressActive=!1,s._textNode.textContent=l.message||"Loading...",fo(s,"spinner"),l.spinner===!1&&(s._spinner.style.display="none"),s.style.display="flex"},wt.loading.hide=function(){hn&&(Hs=Math.max(0,Hs-1),Hs===0&&(hn.style.display="none",hn._progressActive=!1))},wt.loading.progress=function(e=0,t={}){var s;const l=co();typeof e=="object"&&e!==null&&(t=e,e=(s=e.value)!=null?s:0);const n=uo(null,t);l._progressActive||(Hs++,l._progressActive=!0);const i=Math.max(0,Math.min(100,Number(e!=null?e:0)));l._textNode.textContent=n.message||"Loading...",l._progressBar.style.width=i+"%",fo(l,"progress"),l.style.display="flex"},wt.loading.wrap=async function(e,t){wt.loading.show(e);try{return await t()}finally{wt.loading.hide()}};function Wo(e){return typeof e=="function"?e():e||[]}function Fl(e,t){if(!(e==null||t==null))return typeof t!="string"||t.indexOf(".")<0?e==null?void 0:e[t]:t.split(".").reduce((s,l)=>s==null?s:s[l],e)}function Uo(e,t){return e==null&&t==null?0:e==null?-1:t==null?1:typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}function Go(e){const t=Wo(e);return Array.isArray(t)?t:[]}function po(e){var t,s,l,n;return(n=(l=(s=(t=e==null?void 0:e.label)!=null?t:e==null?void 0:e.title)!=null?s:e==null?void 0:e.header)!=null?l:e==null?void 0:e.key)!=null?n:""}function Dl(e,t){var s,l;return(l=(s=e==null?void 0:e.sortKey)!=null?s:e==null?void 0:e.key)!=null?l:`__col_${t}`}function ho(e,t){return e.find((s,l)=>Dl(s,l)===t||(s==null?void 0:s.key)===t)||null}function yl(e,t,s){return e?typeof e.get=="function"?e.get(t,{row:t,rowIndex:s,col:e}):typeof e.value=="function"?e.value(t,{row:t,rowIndex:s,col:e}):typeof e.key=="string"?Fl(t,e.key):e.key!=null?t==null?void 0:t[e.key]:t:t}function bl(e,t){return typeof e=="function"?e(t)||{}:e||{}}function vl(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.map(vl).filter(Boolean).join(" ");if(typeof Node!="undefined"&&e instanceof Node)return e.textContent||"";if(typeof e=="object"){if(typeof e.textContent=="string")return e.textContent;try{return JSON.stringify(e)}catch(t){return""}}return String(e)}function Ko(e,t){const l=(Array.isArray(e)?e:t).map(n=>Number(n)).filter(n=>Number.isFinite(n)&&n>0);return l.length?Array.from(new Set(l)):t}function qo(e,t,s,l){const n=l.searchBy||l.searchPredicate;if(typeof n=="function")return!!n(e,{query:s,columns:t});const i=String(s||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(!i.length)return!0;const c=Array.isArray(l.searchKeys)&&l.searchKeys.length?l.searchKeys:t.filter(r=>(r==null?void 0:r.searchable)!==!1).map(r=>{var z;return(z=r==null?void 0:r.searchKey)!=null?z:r==null?void 0:r.key}).filter(Boolean),a=[];if(c.length)for(const r of c)if(typeof r=="function")a.push(vl(r(e)));else{const z=t.find(d=>(d==null?void 0:d.key)===r||(d==null?void 0:d.searchKey)===r);a.push(vl(z?yl(z,e,-1):Fl(e,r)))}else a.push(vl(e));const v=a.join(" ").toLowerCase();return i.every(r=>v.includes(r))}xe.Table=(...e)=>{var t,s,l,n;const{props:i,children:c}=JSswift.uiNormalizeArgs(e),a=i.slots||{},v=Array.isArray(i.columns)?i.columns:[],r=Ko(i.pageSizeOptions,[5,10,20,50]),z=Number((s=(t=i.pageSize)!=null?t:r[0])!=null?s:10)||10,d=Array.from(new Set([...r,z])).sort((Re,C)=>Re-C),k=i.initialSort||(i.sortBy?{key:i.sortBy,dir:i.sortDir==="desc"?"desc":"asc"}:null),N=i.searchable===!0||typeof i.searchable=="string"||i.searchPlaceholder!=null||i.search!=null||i.query!=null||!!i.searchModel||!!i.queryModel||Array.isArray(i.searchKeys)||typeof i.searchBy=="function"||typeof i.searchPredicate=="function",p=en(i.searchModel||i.queryModel,"UI.Table:query"),[U,w]=wt.reactive.signal(Math.max(1,Number(i.page||1)||1)),[$,B]=wt.reactive.signal(z),[te,E]=wt.reactive.signal(k),[ve,le]=wt.reactive.signal(String((n=p?p.get():(l=i.search)!=null?l:i.query)!=null?n:"")),ie=Re=>{const C=String(Re!=null?Re:"");le(C),p&&p.set(C),w(1)},ge=Re=>{const C=Number(Re)||z;B(C),w(1)},ue=(Re,C)=>{const Se=Dl(Re,C),Fe=te();!Fe||Fe.key!==Se&&Fe.key!==(Re==null?void 0:Re.key)?E({key:Se,dir:"asc"}):Fe.dir==="asc"?E({key:Se,dir:"desc"}):E(null),w(1)};let fe=null,M;p&&(M=p.watch(Re=>{const C=String(Re!=null?Re:"");le(C),fe&&fe.value!==C&&(fe.value=C),w(1)},"UI.Table:queryWatch"));const me=JSswift.omit(i,["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"]);me.class=re(["jss-table-card",i.class,i.cardClass]),i.dense!=null&&(me.dense=i.dense);const be=_.div({class:"jss-table-shell"}),de=D(a,"default",{},c);de.length&&be.appendChild(_.div({class:"jss-table-lead"},...de));const Z=D(a,"toolbarStart",{},i.toolbarStart),j=D(a,"toolbar",{},i.toolbar),I=D(a,"toolbarEnd",{},i.toolbarEnd),y=_.div({class:"jss-table-toolbar"}),P=_.div({class:"jss-table-toolbar-main"}),Q=_.div({class:"jss-table-toolbar-side"});Z.forEach(Re=>P.appendChild(Re)),j.forEach(Re=>P.appendChild(Re));const m=D(a,"search",{query:ve(),getQuery:ve,setQuery:ie},null);if(m.length)m.forEach(Re=>Q.appendChild(Re));else if(N){fe=_.input({type:"search",class:"jss-input",placeholder:typeof i.searchable=="string"?i.searchable:i.searchPlaceholder||"Cerca nella tabella",value:String(ve()||"")}),fe.addEventListener("input",()=>ie(fe.value));const Re=xe.Btn({class:"jss-table-search-clear",outline:!0,onClick:()=>{fe&&(fe.value=""),ie("")}},"Reset");Q.appendChild(_.div({class:"jss-singularity jss-table-search"},_.span({class:"jss-table-search-icon","aria-hidden":"true"},"\u2315"),fe,Re))}I.forEach(Re=>Q.appendChild(Re)),(P.childNodes.length||Q.childNodes.length)&&(y.appendChild(P),y.appendChild(Q),be.appendChild(y));const b=_.div({class:"jss-singularity jss-table-chip"},""),g=_.div({class:"jss-singularity jss-table-chip"},""),T=_.div({class:"jss-singularity jss-table-chip"},""),Y=D(a,"status",{},i.status),K=_.div({class:"jss-table-status"},b,g,T,...Y);i.hideStatus!==!0&&be.appendChild(K);const _e=D(a,"caption",{},i.caption);_e.length&&be.appendChild(_.div({class:"jss-table-caption"},..._e));const J=_.thead(),A=_.tbody(),L=!!i.actions||!!a.actions,O=re(["jss-table",pe(i.dense,"dense"),pe(i.striped,"striped"),pe(i.hover!==!1,"hover"),pe(i.stickyHeader!==!1,"sticky-head"),i.tableClass]),X={...i.tableStyle||{}};i.minTableWidth!=null&&(X["--jss-table-min-width"]=vt(i.minTableWidth));const we=_.table({class:O,style:X},J,A),Be=_.div({class:"jss-singularity jss-table-wrap"},we);be.appendChild(Be);const Ue=_.div({class:"jss-singularity jss-table-chip"},""),H=_.div({class:"jss-singularity jss-table-chip"},""),W=xe.Btn({outline:!0,onClick:()=>w(Math.max(1,U()-1))},"\u2039"),ee=xe.Btn({outline:!0,onClick:()=>w(U()+1)},"\u203A"),Ne=_.div({class:"jss-singularity jss-table-chip"},""),Te=_.select({class:"jss-input jss-table-size-select"},...d.map(Re=>Vs({value:String(Re)},String(Re))));Te.value=String($()),Te.addEventListener("change",()=>ge(Te.value));const oe=D(a,"footer",{},i.footer),Pe=_.div({class:"jss-table-foot"},_.div({class:"jss-table-foot-main"},Ue,H,_.label({class:"jss-table-size"},_.span("Righe"),Te)),_.div({class:"jss-table-foot-extra"},...oe,_.div({class:"jss-table-pager"},W,Ne,ee)));i.hideFooter!==!0&&be.appendChild(Pe);const Ie=()=>{if(J.innerHTML="",i.hideHeader)return;const Re=_.tr();if(v.forEach((C,Se)=>{var Fe,F;const f={col:C,colIndex:Se,sort:te()},h={...bl(C==null?void 0:C.style,{...f,header:!0}),...bl((Fe=C==null?void 0:C.headerStyle)!=null?Fe:C==null?void 0:C.thStyle,{...f,header:!0})};(C==null?void 0:C.width)!=null&&(h.width=vt(C.width)),(C==null?void 0:C.minWidth)!=null&&(h.minWidth=vt(C.minWidth)),(C==null?void 0:C.maxWidth)!=null&&(h.maxWidth=vt(C.maxWidth)),C!=null&&C.align&&(h.textAlign=C.align);let x=D(C==null?void 0:C.slots,"header",f,null);if(!x.length){const We=typeof(C==null?void 0:C.header)=="function"?C.header(f):(F=C==null?void 0:C.header)!=null?F:po(C);x=D(a,"header",f,We)}const ae=te(),Oe=Dl(C,Se),De=(C==null?void 0:C.sortable)!==!1&&((C==null?void 0:C.key)!=null||typeof(C==null?void 0:C.get)=="function"||typeof(C==null?void 0:C.compare)=="function"),Ge=!!ae&&(ae.key===Oe||ae.key===(C==null?void 0:C.key)),Ke=_.th({class:re(["jss-table-head-cell",pe(C==null?void 0:C.nowrap,"is-nowrap"),pe(De,"jss-table-sortable"),pe(Ge,"is-sorted"),C==null?void 0:C.headerClass]),style:h});De?Ke.appendChild(_.button({type:"button",class:"jss-table-head-button",onClick:()=>ue(C,Se)},_.span({class:"jss-table-head-label"},...x),_.span({class:"jss-table-head-arrow","aria-hidden":"true"},Ge?ae.dir==="asc"?"\u2191":"\u2193":"\u2195"))):x.forEach(We=>Ke.appendChild(We)),Re.appendChild(Ke)}),L){const C=D(a,"actionsHeader",{},i.actionsLabel||"Azioni");Re.appendChild(_.th({class:"jss-table-head-cell jss-table-head-actions",style:{textAlign:"right"}},...C))}J.appendChild(Re)},Le=(Re,C)=>{const Se={columns:v,count:v.length},Fe=D(a,Re,Se,C),F=String(v.length+(L?1:0));A.appendChild(_.tr(_.td({colSpan:F,class:"jss-table-state"},...Fe)))},Ye=wt.reactive.effect(()=>{const Re=Go(i.rows),C=String(ve()||"").trim(),Se=te(),Fe=typeof i.loading=="function"?!!i.loading():!!i.loading,F=i.pagination!==!1;if(Ie(),A.innerHTML="",fe&&fe.value!==ve()&&(fe.value=ve()),Te.value!==String($())&&(Te.value=String($())),Fe){b.textContent="Caricamento in corso",g.style.display="none",T.style.display="none",Ue.textContent="Loading\u2026",H.textContent="",Ne.textContent="Pagina 1",W.disabled=!0,ee.disabled=!0,Le("loading",i.loadingText||"Loading...");return}let f=Re.slice();const h=f.length;if(typeof i.filter=="function"&&(f=f.filter((et,tt)=>i.filter(et,{row:et,index:tt,query:C,rows:Re,columns:v}))),C&&(f=f.filter(et=>qo(et,v,C,i))),Se){const et=ho(v,Se.key);et&&f.sort((tt,dt)=>{const gt=yl(et,tt,-1),At=yl(et,dt,-1),It=typeof et.compare=="function"?et.compare(gt,At,tt,dt):Uo(gt,At);return Se.dir==="asc"?It:-It})}const x=f.length,ae=Math.max(1,Number($())||z),Oe=F?Math.max(1,Math.ceil(x/ae)):1,De=F?Math.min(U(),Oe):1;De!==U()&&w(De);const Ge=F?(De-1)*ae:0,Ke=F?Ge+ae:x,We=f.slice(Ge,Ke);if(b.textContent=x===h?`${x} righe`:`${x} di ${h} righe`,g.textContent=C?`Ricerca: ${C}`:"",g.style.display=C?"":"none",Se){const et=ho(v,Se.key);T.textContent=et?`Ordine: ${po(et)} ${Se.dir==="asc"?"\u2191":"\u2193"}`:"",T.style.display=et?"":"none"}else T.style.display="none";if(Ue.textContent=x?`${Ge+1}-${Math.min(Ke,x)} di ${x}`:"0 risultati",H.textContent=x!==h?`Dataset totale ${h}`:`Page size ${ae}`,Ne.textContent=F?`Pagina ${De} / ${Oe}`:"Tutte le righe",W.disabled=!F||De<=1,ee.disabled=!F||De>=Oe,Te.disabled=!F,Te.parentNode.style.display=F?"":"none",We.length===0){Le("empty",i.emptyText||"Nessun dato");return}for(let et=0;et<We.length;et++){const tt=We[et],dt=Ge+et,gt={row:tt,rowIndex:dt,pageIndex:et},At=typeof i.rowAttrs=="function"?i.rowAttrs(tt,gt)||{}:i.rowAttrs||{},It=typeof i.rowClass=="function"?i.rowClass(tt,gt):i.rowClass,$t=!!(i.onRowClick||i.onRowDblClick),zt=_.tr({...At,class:re(["jss-table-row",It,At.class,pe($t,"is-clickable")])});if(i.rowKey){const mt=typeof i.rowKey=="function"?i.rowKey(tt,gt):Fl(tt,i.rowKey);mt!=null&&(zt.dataset.key=String(mt))}const Xe=mt=>{const Nt=mt==null?void 0:mt.target;return!!(Nt&&Nt.closest&&Nt.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(i.onRowClick&&zt.addEventListener("click",mt=>{Xe(mt)||i.onRowClick(tt,gt,mt)}),i.onRowDblClick&&zt.addEventListener("dblclick",mt=>{Xe(mt)||i.onRowDblClick(tt,gt,mt)}),v.forEach((mt,Nt)=>{var Zt,rn;const qt=yl(mt,tt,dt),Yt={...gt,col:mt,colIndex:Nt,value:qt},cn={...bl(mt==null?void 0:mt.style,Yt),...bl((Zt=mt==null?void 0:mt.cellStyle)!=null?Zt:mt==null?void 0:mt.tdStyle,Yt)};mt!=null&&mt.align&&(cn.textAlign=mt.align),(mt==null?void 0:mt.width)!=null&&(cn.width=vt(mt.width)),(mt==null?void 0:mt.minWidth)!=null&&(cn.minWidth=vt(mt.minWidth)),(mt==null?void 0:mt.maxWidth)!=null&&(cn.maxWidth=vt(mt.maxWidth));const Xt=typeof(mt==null?void 0:mt.cellClass)=="function"?mt.cellClass(tt,Yt):(mt==null?void 0:mt.cellClass)||(mt==null?void 0:mt.class),Ut=_.td({class:re(["jss-table-cell",Xt,pe(mt==null?void 0:mt.nowrap,"is-nowrap")]),style:cn});let tn=D(mt==null?void 0:mt.slots,"cell",Yt,null);if(!tn.length){const ln=typeof(mt==null?void 0:mt.render)=="function"?mt.render(tt,Yt):typeof(mt==null?void 0:mt.format)=="function"?mt.format(qt,tt,Yt):qt,Xn=ln==null?(rn=mt==null?void 0:mt.emptyText)!=null?rn:"":ln;tn=D(a,"cell",Yt,Xn)}tn.length||(tn=[""]),tn.forEach(ln=>Ut.appendChild(ln)),zt.appendChild(Ut)}),L){const mt={...gt},Nt=typeof i.actions=="function"?i.actions(tt,gt):i.actions;let Zt=D(a,"actions",mt,Nt);Zt.length||(Zt=D(null,"default",mt,Nt)),zt.appendChild(_.td({class:"jss-table-cell jss-table-cell-actions",style:{textAlign:"right"}},_.div({class:"jss-table-actions"},...Zt)))}A.appendChild(zt)}},"UI.Table:render");me.body=be;const ct=xe.Card(me);return JSswift._registerCleanup(ct,Ye),M&&JSswift._registerCleanup(ct,M),ct},xe.Menu=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=["primary","secondary","warning","danger","success","info","light","dark"],i=["xs","sm","md","lg","xl"];let c={...t},a=null,v=null,r=null,z=null,d=null;const k=(A,L)=>Object.prototype.hasOwnProperty.call(A||{},L),N=(A,L)=>typeof A=="function"?A(L):A,p=A=>String(A||"").split(/\s+/).filter(Boolean),U=A=>A&&typeof A=="object"&&!A.nodeType&&!Array.isArray(A)&&!(A instanceof Function),w=A=>!!A&&typeof A=="object"&&(A.nodeType===1||typeof A.getBoundingClientRect=="function"),$=()=>{clearTimeout(z),clearTimeout(d),z=null,d=null},B=(A,L,O)=>{if(!A)return;const X=A[L]||[];X.length&&A.classList.remove(...X);const we=(O||[]).filter(Boolean);we.length&&A.classList.add(...we),A[L]=we},te=(A,L,O,X=we=>we)=>{if(A){if(O==null||O===""){A.style.removeProperty(L);return}A.style.setProperty(L,X(O))}},E=()=>c||{},ve=A=>{var L;const O=String(o((L=A.state)!=null?L:A.color)||"").toLowerCase();return n.includes(O)?O:""},le=A=>{const L=String(o(A.size)||"").toLowerCase();return i.includes(L)?L:""},ie=A=>{var L,O;return String(o((O=(L=A.placement)!=null?L:A.position)!=null?O:"bottom-start"))},ge=()=>{var A;const L=o((A=E().delay)!=null?A:E().showDelay),O=Number(L);return Number.isFinite(O)?Math.max(0,O):0},ue=()=>{const A=o(E().hideDelay),L=Number(A);return Number.isFinite(L)?Math.max(0,L):80},fe=(A=null)=>{var L,O,X;if(A)return A;const we=E();return v||o((X=(O=(L=we.anchorEl)!=null?L:we.triggerEl)!=null?O:we.target)!=null?X:we.anchor)||null},M=A=>{if(A==null||A===!0)return new Set(["click"]);if(A===!1)return new Set(["manual"]);const L=Array.isArray(A)?A:String(A).split(/[\s,|/]+/),O=new Set;return L.forEach(X=>{const we=String(X||"").trim().toLowerCase();we&&(we==="mouseenter"||we==="mouseover"?O.add("hover"):we==="blur"||we==="focusin"?O.add("focus"):we==="tap"?O.add("click"):O.add(we))}),O.size?O:new Set(["manual"])},me=(A,L)=>{var O,X,we;let Be=null,Ue=null;if(w(A))Be=A,U(L)&&(Ue=L);else if(U(A)){Ue=A;const H=(we=(X=(O=A.anchorEl)!=null?O:A.triggerEl)!=null?X:A.target)!=null?we:A.anchor;w(H)&&(Be=H)}else A!=null&&(Be=A);return{anchorEl:Be,nextProps:Ue}},be=(A=a==null?void 0:a.panel)=>{var L;return Array.from(((L=A==null?void 0:A.querySelectorAll)==null?void 0:L.call(A,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .jss-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(O=>O.offsetParent!==null&&O.getAttribute("aria-hidden")!=="true")},de=()=>{o(E().autoFocus)!==!1&&setTimeout(()=>{const A=be();if(!A.length)return;(A.find(O=>O.classList.contains("is-active")||O.classList.contains("is-selected")||O.classList.contains("is-checked"))||A[0]).focus()},0)},Z=(A,L,O="sm")=>{const X=N(A,L);return X==null?[]:typeof X=="string"?[xe.Icon({name:X,size:O})]:Bs(X,{...L,as:"icon"})},j=(A,L)=>{var O,X,we,Be,Ue,H,W,ee,Ne,Te,oe,Pe,Ie;const Le=N(A,L);if(Le==null||Le===!1)return[];if(Array.isArray(Le))return Le.flatMap((zt,Xe)=>j(zt,{...L,index:Xe}));if(typeof Le=="function")return j(Le(L),L);if(Le!=null&&Le.nodeType)return[Le];if(typeof Le=="string"||typeof Le=="number")return j({label:Le},L);if(!U(Le))return Bs(Le,{...L,as:"item"});const Ye=String((X=(O=Le.type)!=null?O:Le.kind)!=null?X:"").toLowerCase();if(Ye==="separator"||Ye==="divider"||Le.separator===!0||Le.divider===!0)return[_.div({class:"jss-menu-divider",role:"separator"})];const ct=(we=Le.items)!=null?we:Le.children;if((Ye==="group"||Ye==="section"||Array.isArray(ct))&&ct!=null){const zt={...L,item:Le},Xe=D(l,"groupLabel",zt,N((Be=Le.label)!=null?Be:Le.title,zt)),mt=j(ct,zt);return mt.length?[_.div({class:re(["jss-menu-group",Le.class])},Xe.length?_.div({class:"jss-menu-group-label"},...Xe):null,_.div({class:"jss-menu-group-items"},...mt))]:[]}const Re={...L,item:Le,close:Q,dismiss:Q,open:b,toggle:Y,update:m,isOpen:K,entry:()=>a,anchorEl:fe(),props:E()},C=!!o(Le.disabled),Se=Le.checked==null?null:!!o(Le.checked),Fe=!!o((Ue=Le.active)!=null?Ue:Le.selected),F=ve(Le),f=o(Le.href),h=o(Le.to),x=k(Le,"closeOnSelect")?!!o(Le.closeOnSelect):Le.keepOpen===!0?!1:E().closeOnSelect!==!1,ae=Le.role||(Se!=null?"menuitemcheckbox":"menuitem"),Oe=Z(Le.icon,Re),De=Z((H=Le.iconRight)!=null?H:Le.endIcon,Re),Ge=D(l,"itemTitle",Re,N((W=Le.title)!=null?W:Le.label,Re)),Ke=D(l,"itemSubtitle",Re,N((ee=Le.subtitle)!=null?ee:Le.description,Re)),We=D(l,"itemShortcut",Re,N(Le.shortcut,Re)),et=D(l,"itemBadge",Re,N(Le.badge,Re)),tt=D(l,"item",Re,N((Te=(Ne=Le.content)!=null?Ne:Le.body)!=null?Te:Le.render,Re)),dt=[...et,...We,...Se===!0&&!De.length&&!et.length?[_.span({class:"jss-menu-entry-check"},xe.Icon({name:Le.checkedIcon||"check",size:"sm"}))]:[],...De],At={class:re(["jss-menu-entry","jss-menu-item",F?`jss-state-${F}`:"",pe(Fe,"is-active"),pe(Se===!0,"is-checked"),pe(C,"is-disabled"),Le.class]),role:ae,tabIndex:C?-1:(oe=Le.tabIndex)!=null?oe:-1,"data-menu-item":!0,"data-menu-select":x?"true":"false","data-menu-close":Le.close===!0?"true":null,"data-menu-keep-open":x?null:"true","aria-disabled":C?"true":null,"aria-checked":Se==null?null:String(Se),title:(Ie=(Pe=Le.titleAttr)!=null?Pe:Le.tooltip)!=null?Ie:null,type:f?null:"button",href:f||null,target:Le.target||null,rel:Le.rel||(Le.target==="_blank"?"noopener noreferrer":null),onClick:zt=>{var Xe,mt,Nt,Zt;if(C){zt.preventDefault(),zt.stopPropagation();return}(mt=(Xe=E()).onItemClick)==null||mt.call(Xe,Le,Re,zt);const rn=(Nt=Le.onClick)==null?void 0:Nt.call(Le,Re,zt);zt.defaultPrevented||(h&&((Zt=JSswift.router)!=null&&Zt.navigate)&&(zt.preventDefault(),JSswift.router.navigate(h)),rn!==!1&&x&&Q())}};Le.attrs&&typeof Le.attrs=="object"&&Object.assign(At,Le.attrs);const It=f?_.a:_.button,$t=tt.length?tt:[Ge.length?_.div({class:"jss-menu-entry-title"},...Ge):null,Ke.length?_.div({class:"jss-menu-entry-subtitle"},...Ke):null].filter(Boolean);return[It(At,Oe.length?_.span({class:"jss-menu-entry-icon"},...Oe):null,_.span({class:"jss-menu-entry-main"},...$t),dt.length?_.span({class:"jss-menu-entry-aside"},...dt):null)]},I=()=>{var A,L,O,X,we,Be,Ue;const H=E(),W={close:Q,dismiss:Q,open:b,toggle:Y,update:m,isOpen:K,entry:()=>a,anchorEl:fe(),props:H},ee=Z(H.icon,W,H.iconSize||"md"),Ne=D(l,"eyebrow",W,N(H.eyebrow,W)),Te=D(l,"title",W,N((L=(A=H.title)!=null?A:H.heading)!=null?L:H.label,W)),oe=D(l,"subtitle",W,N((O=H.subtitle)!=null?O:H.description,W)),Pe=D(l,"before",W,N(H.before,W)),Ie=D(l,"header",W,N(H.header,W)),Le=D(l,"after",W,N(H.after,W)),Ye=D(l,"footer",W,N(H.footer,W)),ct=D(l,"status",W,N(H.status,W));let Re=(X=H.content)!=null?X:H.body;Re==null&&s&&s.length&&(Re=s);let C=D(l,"content",W,N(Re,W));C.length||(C=D(l,"body",W,N(Re,W))),C.length||(C=D(l,"default",W,N(Re,W)));const Se=j((Be=(we=H.items)!=null?we:H.actionsList)!=null?Be:H.entries,W),Fe=Se.length?[]:D(l,"empty",W,N((Ue=H.empty)!=null?Ue:H.emptyText,W));let F=null;return Ie.length?F=_.div({class:re(["jss-menu-head","jss-menu-head-custom",H.headerClass])},...Ie):(ee.length||Ne.length||Te.length||oe.length)&&(F=_.div({class:re(["jss-menu-head",H.headerClass])},ee.length?_.div({class:"jss-menu-head-icon"},...ee):null,_.div({class:"jss-menu-head-main"},Ne.length?_.div({class:"jss-menu-eyebrow"},...Ne):null,Te.length?_.div({class:"jss-menu-title"},...Te):null,oe.length?_.div({class:"jss-menu-subtitle"},...oe):null))),_.div({class:re(["jss-menu","jss-menu-shell",pe(H.dense,"dense"),pe(Se.length>0,"has-items"),pe(Ye.length>0||ct.length>0,"has-footer"),H.class]),style:H.style||{},role:H.role||"menu","aria-label":H.ariaLabel||null},Pe.length?_.div({class:"jss-menu-before"},...Pe):null,F,C.length?_.div({class:re(["jss-menu-content",H.contentClass])},...C):null,Se.length?_.div({class:re(["jss-menu-items",H.itemsClass])},...Se):null,!Se.length&&Fe.length?_.div({class:"jss-menu-empty"},...Fe):null,Le.length?_.div({class:"jss-menu-after"},...Le):null,ct.length||Ye.length?_.div({class:re(["jss-menu-footer",H.footerClass])},ct.length?_.div({class:"jss-menu-status"},...ct):null,Ye.length?_.div({class:"jss-menu-footer-actions"},...Ye):null):null)},y=A=>{var L;if(!(A!=null&&A.panel))return;const O=E(),X=ve(O),we=le(O);B(A.panel,"_menuClassTokens",["jss-menu-panel","jss-clear-set","jss-singularity",we?`jss-menu-${we}`:"",X?`jss-state-${X}`:"",o(O.outline)?"outline":"",...p(O.panelClass)]),B(A.overlay,"_menuOverlayClassTokens",[...p(O.overlayClass)]),A.panel.dataset.placement=ie(O),te(A.panel,"--jss-menu-width",o(O.width),vt),te(A.panel,"--jss-menu-min-width",o(O.minWidth),vt),te(A.panel,"--jss-menu-max-width",o(O.maxWidth),vt),te(A.panel,"--jss-menu-max-height",o(O.maxHeight),vt),te(A.panel,"--jss-menu-body-max-height",o((L=O.bodyMaxHeight)!=null?L:O.contentMaxHeight),vt),O.panelStyle&&Object.assign(A.panel.style,O.panelStyle),Et(A.panel,O)},P=()=>{a!=null&&a.panel&&a.panel.replaceChildren(I())},Q=()=>{if($(),!a)return;const A=a;a=null,Ns(A,()=>JSswift.overlay.close(A.id))},m=(A={})=>{var L,O,X,we;if(A&&typeof A=="object"&&(c={...c,...A}),a){const Be=E();y(a),P(),(we=a.reposition)==null||we.call(a,{anchorEl:a._anchorEl,placement:ie(Be),offsetX:(L=Be.offsetX)!=null?L:0,offsetY:(X=(O=Be.offsetY)!=null?O:Be.offset)!=null?X:8}),de()}return J},b=(A=null,L=null)=>{var O,X,we,Be,Ue,H,W,ee,Ne,Te,oe,Pe,Ie,Le,Ye,ct;$();const{anchorEl:Re,nextProps:C}=me(A,L);C&&(c={...c,...C});const Se=E(),Fe=fe(Re);if(!Fe||o(Se.disabled))return null;if(a&&a._anchorEl===Fe){const We=E();return y(a),P(),(Be=a.reposition)==null||Be.call(a,{anchorEl:a._anchorEl,placement:ie(We),offsetX:(O=We.offsetX)!=null?O:0,offsetY:(we=(X=We.offsetY)!=null?X:We.offset)!=null?we:8}),de(),a}a&&Q(),r=document.activeElement;let F=null;if(a=JSswift.overlay.open(()=>I(),{type:"menu",anchorEl:Fe,placement:ie(Se),offsetX:(Ue=Se.offsetX)!=null?Ue:0,offsetY:(W=(H=Se.offsetY)!=null?H:Se.offset)!=null?W:8,backdrop:Se.backdrop===!0,lockScroll:Se.lockScroll===!0,trapFocus:Se.trapFocus===!0,autoFocus:!1,closeOnOutside:Se.closeOnOutside!==!1,closeOnBackdrop:(ee=Se.closeOnBackdrop)!=null?ee:Se.backdrop===!0,closeOnEsc:Se.closeOnEsc!==!1,className:Bt(["jss-menu-panel"]),onClose:()=>{var We,et,tt;(We=F==null?void 0:F._menuCleanup)==null||We.call(F),(tt=(et=E()).onClose)==null||tt.call(et,F),E().returnFocus!==!1&&r&&typeof r.focus=="function"&&setTimeout(()=>r.focus(),0)}}),!(a!=null&&a.panel))return a;const f=a;F=f,f._anchorEl=Fe;const h=()=>{clearTimeout(d),d=null},x=()=>{T()},ae=We=>{const et=We.target;if(!et||!et.closest)return;if(et.closest("[data-menu-close]")){Q();return}if(E().closeOnSelect===!1)return;const tt=et.closest("[data-menu-item], [data-menu-select], .jss-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");tt&&(tt.closest("[data-menu-keep-open]")||tt.getAttribute("data-menu-select")!=="false"&&Q())},Oe=We=>{if(We.key==="Escape"){We.preventDefault(),Q();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(We.key))return;const et=be(f.panel);if(!et.length)return;We.preventDefault();const tt=et.indexOf(document.activeElement);if(We.key==="Home"){et[0].focus();return}if(We.key==="End"){et[et.length-1].focus();return}const dt=We.key==="ArrowDown"?1:-1,gt=tt<0?dt>0?0:et.length-1:(tt+dt+et.length)%et.length;et[gt].focus()};f.panel.addEventListener("click",ae),f.panel.addEventListener("keydown",Oe);const De=M((Te=(Ne=Se.trigger)!=null?Ne:Se.triggers)!=null?Te:k(Se,"open")?"manual":null),Ge=De.has("hover"),Ke=De.has("focus");return(Ge||Ke)&&(f.panel.addEventListener("mouseenter",h),f.panel.addEventListener("mouseleave",x),f.panel.addEventListener("focusin",h),f.panel.addEventListener("focusout",x)),f._menuCleanup=()=>{var We,et,tt,dt,gt,At;(We=f.panel)==null||We.removeEventListener("click",ae),(et=f.panel)==null||et.removeEventListener("keydown",Oe),(tt=f.panel)==null||tt.removeEventListener("mouseenter",h),(dt=f.panel)==null||dt.removeEventListener("mouseleave",x),(gt=f.panel)==null||gt.removeEventListener("focusin",h),(At=f.panel)==null||At.removeEventListener("focusout",x)},y(f),(Le=f.reposition)==null||Le.call(f,{anchorEl:Fe,placement:ie(Se),offsetX:(oe=Se.offsetX)!=null?oe:0,offsetY:(Ie=(Pe=Se.offsetY)!=null?Pe:Se.offset)!=null?Ie:8}),ks(f),(ct=(Ye=E()).onOpen)==null||ct.call(Ye,f),de(),f},g=(A,L=null)=>{clearTimeout(d),d=null,clearTimeout(z),z=setTimeout(()=>b(A,L),ge())},T=(A=!1)=>{if(clearTimeout(z),z=null,!!a){if(clearTimeout(d),A){Q();return}d=setTimeout(()=>Q(),ue())}},Y=(A=null,L=null)=>K()?(Q(),null):b(A,L),K=()=>!!a,J={open:b,close:Q,show:g,hide:T,toggle:Y,update:m,bind:A=>{var L,O;if(!A)return()=>{};v=A;const X=E(),we=M((O=(L=X.trigger)!=null?L:X.triggers)!=null?O:k(X,"open")?"manual":null),Be=we.has("hover"),Ue=we.has("focus"),H=we.has("click"),W=we.has("manual")||!Be&&!Ue&&!H,ee=[],Ne=()=>{$(),ee.forEach(Te=>Te()),v===A&&(v=null)};if(k(X,"open"))return ht(X.open)?JSswift.reactive.effect(()=>{v&&(o(E().open)?b(v):T(!0))},"UI.Menu:open"):X.open===!0?b(A):X.open===!1&&T(!0),Ne;if(W||o(X.disabled))return Ne;if(Be){const Te=()=>g(A),oe=()=>T();A.addEventListener("mouseenter",Te),A.addEventListener("mouseleave",oe),ee.push(()=>{A.removeEventListener("mouseenter",Te),A.removeEventListener("mouseleave",oe)})}if(Ue){const Te=()=>g(A),oe=()=>T();A.addEventListener("focus",Te),A.addEventListener("blur",oe),ee.push(()=>{A.removeEventListener("focus",Te),A.removeEventListener("blur",oe)})}if(H){const Te=oe=>{var Pe,Ie;(Ie=(Pe=E()).onTriggerClick)==null||Ie.call(Pe,oe),!oe.defaultPrevented&&Y(A)};A.addEventListener("click",Te),ee.push(()=>A.removeEventListener("click",Te))}return Ne},isOpen:K,entry:()=>a,props:()=>({...c})};return J},xe.Popover=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=["primary","secondary","warning","danger","success","info","light","dark"],i=["xs","sm","md","lg","xl"];let c={...t},a=null,v=null,r=null,z=null,d=null;const k=(J,A)=>Object.prototype.hasOwnProperty.call(J||{},A),N=(J,A)=>typeof J=="function"?J(A):J,p=J=>String(J||"").split(/\s+/).filter(Boolean),U=J=>J&&typeof J=="object"&&!J.nodeType&&!Array.isArray(J)&&!(J instanceof Function),w=J=>!!J&&typeof J=="object"&&(J.nodeType===1||typeof J.getBoundingClientRect=="function"),$=()=>{clearTimeout(z),clearTimeout(d),z=null,d=null},B=(J,A,L)=>{if(!J)return;const O=J[A]||[];O.length&&J.classList.remove(...O);const X=(L||[]).filter(Boolean);X.length&&J.classList.add(...X),J[A]=X},te=(J,A,L,O=X=>X)=>{if(J){if(L==null||L===""){J.style.removeProperty(A);return}J.style.setProperty(A,O(L))}},E=()=>c,ve=J=>{var A;const L=o((A=J.state)!=null?A:J.color);return L?n.includes(L)?L:String(L):""},le=J=>{const A=o(J.size);return typeof A=="string"&&i.includes(A)?A:""},ie=J=>{var A,L,O;const X=String(o((O=(L=(A=J.actionsAlign)!=null?A:J.footerAlign)!=null?L:J.alignActions)!=null?O:"end")).toLowerCase();return["start","left"].includes(X)?"start":["center","middle"].includes(X)?"center":["between","space-between"].includes(X)?"between":["stretch","full"].includes(X)?"stretch":"end"},ge=J=>{var A,L;return String(o((L=(A=J.placement)!=null?A:J.position)!=null?L:"bottom-start"))},ue=(J,A)=>{const L=o(J);if(L==null||L==="")return A;const O=Number(L);return Number.isFinite(O)?O:A},fe=()=>ue(E().delay,0),M=()=>ue(E().hideDelay,120),me=J=>{var A,L;return((L=(A=J.closable)!=null?A:J.dismissible)!=null?L:J.closeButton)===!0},be=(J=null)=>{var A,L,O;if(J)return J;const X=E();return v||o((O=(L=(A=X.anchorEl)!=null?A:X.triggerEl)!=null?L:X.target)!=null?O:X.anchor)||null},de=J=>{if(J==null||J===!0)return new Set(["click"]);if(J===!1)return new Set(["manual"]);const A=Array.isArray(J)?J:String(J).split(/[\s,|/]+/),L=new Set;return A.forEach(O=>{const X=String(O||"").trim().toLowerCase();X&&(X==="mouseenter"||X==="mouseover"?L.add("hover"):X==="blur"||X==="focusin"?L.add("focus"):X==="tap"?L.add("click"):L.add(X))}),L.size?L:new Set(["manual"])},Z=(J,A)=>{var L,O,X;let we=null,Be=null;if(w(J))we=J,U(A)&&(Be=A);else if(U(J)){Be=J;const Ue=(X=(O=(L=J.anchorEl)!=null?L:J.triggerEl)!=null?O:J.target)!=null?X:J.anchor;w(Ue)&&(we=Ue)}else J!=null&&(we=J);return{anchorEl:we,nextProps:Be}},j=()=>{var J,A,L,O,X,we,Be,Ue,H;const W=E(),ee={close:P,dismiss:P,open:m,toggle:T,update:Q,isOpen:Y,entry:()=>a,anchorEl:be(),props:W},Ne=W.icon!=null?typeof W.icon=="string"?xe.Icon({name:W.icon,size:W.iconSize||"md"}):JSswift.ui.slot(W.icon,{as:"icon"}):null,Te=D(l,"eyebrow",ee,N(W.eyebrow,ee)),oe=D(l,"title",ee,N((A=(J=W.title)!=null?J:W.heading)!=null?A:W.label,ee)),Pe=D(l,"subtitle",ee,N((L=W.subtitle)!=null?L:W.description,ee)),Ie=D(l,"icon",ee,Ne),Le=D(l,"header",ee,N((X=(O=W.headerContent)!=null?O:W.head)!=null?X:W.header,ee)),Ye=me(W)?D(l,"close",ee,xe.Btn({class:"jss-dialog-close",size:"sm",outline:!0,"aria-label":W.closeLabel||"Chiudi popover","data-popover-close":!0},xe.Icon({name:W.closeIcon||"close",size:"sm"}))):[];let ct=(Ue=(Be=(we=W.content)!=null?we:W.body)!=null?Be:W.message)!=null?Ue:W.text;ct==null&&s&&s.length&&(ct=s);let Re=D(l,"content",ee,N(ct,ee));Re.length||(Re=D(l,"body",ee,N(ct,ee))),Re.length||(Re=D(l,"default",ee,N(ct,ee)));const C=N((H=W.footer)!=null?H:W.actions,ee);let Se=D(l,"footer",ee,C);Se.length||(Se=D(l,"actions",ee,C));let Fe=null;Le.length?Fe=_.div({class:"jss-dialog-head jss-dialog-head-custom"},...Le):(Te.length||oe.length||Pe.length||Ie.length||Ye.length)&&(Fe=_.div({class:"jss-dialog-head"},Ie.length?_.div({class:"jss-dialog-icon"},...Ie):null,_.div({class:"jss-dialog-head-main"},Te.length?_.div({class:"jss-dialog-eyebrow"},...Te):null,oe.length?_.div({class:"jss-dialog-title"},...oe):null,Pe.length?_.div({class:"jss-dialog-subtitle"},...Pe):null),Ye.length?_.div({class:"jss-dialog-close-wrap"},...Ye):null));const F=[];return Fe&&F.push(Fe),Re.length&&F.push(_.div({class:re(["jss-dialog-body",W.bodyClass])},...Re)),Se.length&&F.push(_.div({class:re(["jss-dialog-actions",`is-${ie(W)}`,pe(W.stackActions,"is-stacked"),W.actionsClass,W.footerClass])},...Se)),F.length||F.push(_.div({class:re(["jss-dialog-body",W.bodyClass])})),_.div({class:re(["jss-dialog-shell","jss-popover-shell",pe(!!Fe,"has-head"),pe(Se.length>0,"has-footer"),pe(W.divider!==!1,"with-divider")])},...F)},I=J=>{var A;if(!(J!=null&&J.panel))return;const L=E(),O=ve(L),X=le(L);B(J.panel,"_popoverClassTokens",["jss-dialog","jss-popover","jss-singularity","jss-clear-set",X?`jss-dialog-${X}`:"",O,O?`jss-state-${O}`:"",o(L.scrollable)?"scrollable":"",o(L.stickyHeader)?"sticky-head":"",o(L.stickyActions)?"sticky-actions":"",o(L.borderless)?"borderless":"",...p(L.class),...p(L.panelClass)]),B(J.overlay,"_popoverOverlayClassTokens",[...p(L.overlayClass)]),J.panel.dataset.placement=ge(L),te(J.panel,"--jss-dialog-width",o(L.width),vt),te(J.panel,"--jss-dialog-min-width",o(L.minWidth),vt),te(J.panel,"--jss-dialog-max-width",o(L.maxWidth),vt),te(J.panel,"--jss-dialog-max-height",o(L.maxHeight),vt),te(J.panel,"--jss-dialog-body-max-height",o((A=L.bodyMaxHeight)!=null?A:L.contentMaxHeight),vt),L.style&&Object.assign(J.panel.style,L.style),Et(J.panel,L),J.panel.setAttribute("role",L.role||"dialog"),J.panel.setAttribute("aria-modal",L.modal===!0?"true":"false"),L.ariaLabel?J.panel.setAttribute("aria-label",L.ariaLabel):J.panel.removeAttribute("aria-label")},y=()=>{a!=null&&a.panel&&a.panel.replaceChildren(j())},P=()=>{if($(),!a)return;const J=a;a=null,Ns(J,()=>JSswift.overlay.close(J.id))},Q=(J={})=>(J&&typeof J=="object"&&(c={...c,...J}),a&&(I(a),y()),_e),m=(J=null,A=null)=>{var L,O,X,we,Be,Ue,H,W;$();const{anchorEl:ee,nextProps:Ne}=Z(J,A);Ne&&(c={...c,...Ne});const Te=E(),oe=be(ee);if(!oe||o(Te.disabled))return null;if(a&&a._anchorEl===oe)return I(a),y(),a;a&&P(),r=document.activeElement;const Pe=de((O=(L=Te.trigger)!=null?L:Te.triggers)!=null?O:k(Te,"open")?"manual":null),Ie=Pe.has("hover"),Le=Pe.has("focus");let Ye=null;if(a=JSswift.overlay.open(()=>j(),{type:"popover",anchorEl:oe,placement:ge(Te),offsetX:(X=Te.offsetX)!=null?X:0,offsetY:(Be=(we=Te.offsetY)!=null?we:Te.offset)!=null?Be:10,backdrop:Te.backdrop===!0,lockScroll:Te.lockScroll===!0,trapFocus:Te.trapFocus===!0,autoFocus:Te.autoFocus===!0,closeOnOutside:Te.closeOnOutside!==!1,closeOnBackdrop:(Ue=Te.closeOnBackdrop)!=null?Ue:Te.backdrop===!0,closeOnEsc:Te.closeOnEsc!==!1,className:Bt(["jss-dialog","jss-popover"]),onClose:()=>{var Fe,F,f;(Fe=Ye==null?void 0:Ye._popoverCleanup)==null||Fe.call(Ye),(f=(F=E()).onClose)==null||f.call(F,Ye),E().returnFocus!==!1&&r&&typeof r.focus=="function"&&setTimeout(()=>r.focus(),0)}}),!(a!=null&&a.panel))return a;const ct=a;Ye=ct,ct._anchorEl=oe;const Re=()=>{clearTimeout(d),d=null},C=()=>{!Ie&&!Le||g()},Se=Fe=>{const F=Fe.target;if(!(!F||!F.closest)){if(F.closest("[data-popover-close]")||F.closest("[data-dialog-close]")){P();return}E().closeOnSelect===!0&&F.closest("[data-popover-select]")&&P()}};return ct.panel.addEventListener("click",Se),(Ie||Le)&&(ct.panel.addEventListener("mouseenter",Re),ct.panel.addEventListener("mouseleave",C),ct.panel.addEventListener("focusin",Re),ct.panel.addEventListener("focusout",C)),ct._popoverCleanup=()=>{var Fe,F,f,h,x;(Fe=ct.panel)==null||Fe.removeEventListener("click",Se),(F=ct.panel)==null||F.removeEventListener("mouseenter",Re),(f=ct.panel)==null||f.removeEventListener("mouseleave",C),(h=ct.panel)==null||h.removeEventListener("focusin",Re),(x=ct.panel)==null||x.removeEventListener("focusout",C)},I(ct),ks(ct),(W=(H=E()).onOpen)==null||W.call(H,ct),ct},b=(J,A=null)=>{clearTimeout(d),d=null,clearTimeout(z),z=setTimeout(()=>m(J,A),fe())},g=(J=!1)=>{if(clearTimeout(z),z=null,!!a){if(clearTimeout(d),J){P();return}d=setTimeout(()=>P(),M())}},T=(J=null,A=null)=>Y()?(P(),null):m(J,A),Y=()=>!!a,_e={open:m,close:P,show:b,hide:g,toggle:T,update:Q,bind:J=>{var A,L;if(!J)return()=>{};v=J;const O=E(),X=de((L=(A=O.trigger)!=null?A:O.triggers)!=null?L:k(O,"open")?"manual":null),we=X.has("hover"),Be=X.has("focus"),Ue=X.has("click"),H=X.has("manual")||!we&&!Be&&!Ue,W=[],ee=()=>{$(),W.forEach(Ne=>Ne()),v===J&&(v=null)};if(k(O,"open"))return ht(O.open)?JSswift.reactive.effect(()=>{v&&(o(E().open)?m(v):g(!0))},"UI.Popover:open"):O.open===!0?m(J):O.open===!1&&g(!0),ee;if(H||o(O.disabled))return ee;if(we){const Ne=()=>b(J),Te=()=>g();J.addEventListener("mouseenter",Ne),J.addEventListener("mouseleave",Te),W.push(()=>{J.removeEventListener("mouseenter",Ne),J.removeEventListener("mouseleave",Te)})}if(Be){const Ne=()=>b(J),Te=()=>g();J.addEventListener("focus",Ne),J.addEventListener("blur",Te),W.push(()=>{J.removeEventListener("focus",Ne),J.removeEventListener("blur",Te)})}if(Ue){const Ne=Te=>{var oe,Pe;(Pe=(oe=E()).onTriggerClick)==null||Pe.call(oe,Te),!Te.defaultPrevented&&T(J)};J.addEventListener("click",Ne),W.push(()=>J.removeEventListener("click",Ne))}return ee},isOpen:Y,entry:()=>a,props:()=>({...c})};return _e},xe.ContextMenu=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e);let l={...t},n=null,i=null,c=null;const a=y=>y&&typeof y=="object"&&!y.nodeType&&!Array.isArray(y)&&!(y instanceof Function),v=y=>!!y&&typeof y=="object"&&(y.nodeType===1||typeof y.getBoundingClientRect=="function"),r=y=>!!y&&typeof y=="object"&&("clientX"in y||"type"in y||"target"in y||"currentTarget"in y),z=y=>!!y&&Number.isFinite(Number(y.x))&&Number.isFinite(Number(y.y)),d=()=>l,k=(y,P)=>{const Q=Number(y),m=Number(P);return!Number.isFinite(Q)||!Number.isFinite(m)?null:{x:Q,y:m}},N=y=>y?{_jssContextPoint:y,getBoundingClientRect:()=>({top:y.y,bottom:y.y,left:y.x,right:y.x,width:0,height:0})}:null,p=y=>{if(!v(y))return null;const P=y.getBoundingClientRect();return k(P.left+Math.min(P.width/2,24),P.top+Math.min(P.height/2,24))},U=y=>{var P,Q,m,b;return o((b=(m=(Q=(P=y==null?void 0:y.anchorEl)!=null?P:y==null?void 0:y.triggerEl)!=null?Q:y==null?void 0:y.target)!=null?m:y==null?void 0:y.anchor)!=null?b:null)},w=(y,P=null)=>{if(!y)return p(P||c);const Q=k(y.clientX,y.clientY);if(Q)return Q;const m=U({anchorEl:P||y.currentTarget||y.target||c});return p(m)},$=(y={})=>{if(!a(y))return{};const P={...y};return delete P.event,delete P.point,delete P.x,delete P.y,P},B=()=>{var y,P,Q;const m=d();return{...m,trigger:"manual",placement:m.placement||"bottom-start",offsetX:(y=m.offsetX)!=null?y:0,offsetY:(Q=(P=m.offsetY)!=null?P:m.offset)!=null?Q:4,closeOnOutside:m.closeOnOutside!==!1,closeOnEsc:m.closeOnEsc!==!1,role:m.role||"menu",ariaLabel:m.ariaLabel||m.title||"Context menu",class:re(["jss-context-menu-shell",m.class]),panelClass:re(["jss-context-menu-panel",m.panelClass])}},te=xe.Menu(B(),...s),E=(y=null,P=null,Q=null)=>{let m=null,b=null,g=null;if(r(y))m=w(y,c),g=a(P)?$(P):null;else if(typeof y=="number"||typeof P=="number")m=k(y,P),g=a(Q)?$(Q):null;else if(z(y))m=k(y.x,y.y),g=a(P)?$(P):null;else if(v(y))b=y,g=a(P)?$(P):null;else if(a(y)){const T=z(y.point)?y.point:z(y)?y:null,Y=U(y),K=y.event;m=T?k(T.x,T.y):w(K,Y||c),b=Y&&v(Y)?Y:null,g={...$(y),...a(P)?$(P):{}}}else n&&(m={...n});return{point:m,anchor:b,nextProps:g}},ve=(y,P=null)=>{i=y||i,n=P||y&&y._jssContextPoint||n},le=(y=null)=>{a(y)&&Object.keys(y).length&&(l={...l,...y})},ie=(y=null,P=null)=>{if(P)return N(P);if(y&&v(y))return y;const Q=U(d());return v(Q)?Q:n?N(n):v(i)?i:v(c)?c:null},ge=(y=null,P=null,Q=null)=>{const{point:m,anchor:b,nextProps:g}=E(y,P,Q);le(g);const T=ie(b,m);return T?(ve(T,m),te.open(T,B())):null},ue=(y,P,Q=null)=>ge(y,P,Q),fe=(y,P=null)=>ge(y,P),M=()=>(te.close(),I),me=(y=!0)=>(y===!1?te.hide(!1):te.close(),I),be=(y=null,P=null,Q=null)=>ge(y,P,Q),de=(y=null,P=null,Q=null)=>te.isOpen()?(M(),null):ge(y,P,Q),Z=(y={})=>(le($(y)),te.update(B()),I),I={open:ge,openAt:ue,openFromEvent:fe,show:be,hide:me,close:M,toggle:de,update:Z,bind:(y,P=null)=>{if(!y)return()=>{};const Q=a(P)?$(P):null,m=g=>{var T,Y;c=y,g.preventDefault(),!(((Y=(T=d()).onTrigger)==null?void 0:Y.call(T,g,{element:y,open:ge,close:M,update:Z}))===!1||o(d().disabled))&&ge({event:g,anchorEl:y},Q)},b=g=>{var T,Y;g.key!=="ContextMenu"&&!(g.shiftKey&&g.key==="F10")||(c=y,g.preventDefault(),((Y=(T=d()).onTrigger)==null?void 0:Y.call(T,g,{element:y,open:ge,close:M,update:Z}))===!1||o(d().disabled))||ge({event:g,anchorEl:y},Q)};return y.addEventListener("contextmenu",m),y.addEventListener("keydown",b),()=>{y.removeEventListener("contextmenu",m),y.removeEventListener("keydown",b)}},isOpen:te.isOpen,entry:te.entry,props:()=>({...l})};return I}})(JSswift);
34
+ `,document.head.appendChild(c),hn._textNode=s,hn._spinner=t,hn._progressWrap=l,hn._progressBar=n,hn._progressActive=!1,hn}function uo(e,t){if(typeof e=="object"&&e!==null)return{...e};const s=t&&typeof t=="object"?t:{};return typeof t=="string"&&(e==null||typeof e=="number")?{...s,message:t}:{...s,message:e}}function fo(e,t){const s=t==="progress";e._spinner.style.display=s?"none":"",e._progressWrap.style.display=s?"block":"none",e._mode=t}wt.loading.show=function(e="Loading...",t={}){const s=co(),l=uo(e,t);Hs++,s._progressActive=!1,s._textNode.textContent=l.message||"Loading...",fo(s,"spinner"),l.spinner===!1&&(s._spinner.style.display="none"),s.style.display="flex"},wt.loading.hide=function(){hn&&(Hs=Math.max(0,Hs-1),Hs===0&&(hn.style.display="none",hn._progressActive=!1))},wt.loading.progress=function(e=0,t={}){var s;const l=co();typeof e=="object"&&e!==null&&(t=e,e=(s=e.value)!=null?s:0);const n=uo(null,t);l._progressActive||(Hs++,l._progressActive=!0);const i=Math.max(0,Math.min(100,Number(e!=null?e:0)));l._textNode.textContent=n.message||"Loading...",l._progressBar.style.width=i+"%",fo(l,"progress"),l.style.display="flex"},wt.loading.wrap=async function(e,t){wt.loading.show(e);try{return await t()}finally{wt.loading.hide()}};function Wo(e){return typeof e=="function"?e():e||[]}function Fl(e,t){if(!(e==null||t==null))return typeof t!="string"||t.indexOf(".")<0?e==null?void 0:e[t]:t.split(".").reduce((s,l)=>s==null?s:s[l],e)}function Uo(e,t){return e==null&&t==null?0:e==null?-1:t==null?1:typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t),void 0,{numeric:!0,sensitivity:"base"})}function Go(e){const t=Wo(e);return Array.isArray(t)?t:[]}function po(e){var t,s,l,n;return(n=(l=(s=(t=e==null?void 0:e.label)!=null?t:e==null?void 0:e.title)!=null?s:e==null?void 0:e.header)!=null?l:e==null?void 0:e.key)!=null?n:""}function Dl(e,t){var s,l;return(l=(s=e==null?void 0:e.sortKey)!=null?s:e==null?void 0:e.key)!=null?l:`__col_${t}`}function ho(e,t){return e.find((s,l)=>Dl(s,l)===t||(s==null?void 0:s.key)===t)||null}function yl(e,t,s){return e?typeof e.get=="function"?e.get(t,{row:t,rowIndex:s,col:e}):typeof e.value=="function"?e.value(t,{row:t,rowIndex:s,col:e}):typeof e.key=="string"?Fl(t,e.key):e.key!=null?t==null?void 0:t[e.key]:t:t}function bl(e,t){return typeof e=="function"?e(t)||{}:e||{}}function vl(e){if(e==null)return"";if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(Array.isArray(e))return e.map(vl).filter(Boolean).join(" ");if(typeof Node!="undefined"&&e instanceof Node)return e.textContent||"";if(typeof e=="object"){if(typeof e.textContent=="string")return e.textContent;try{return JSON.stringify(e)}catch(t){return""}}return String(e)}function Ko(e,t){const l=(Array.isArray(e)?e:t).map(n=>Number(n)).filter(n=>Number.isFinite(n)&&n>0);return l.length?Array.from(new Set(l)):t}function qo(e,t,s,l){const n=l.searchBy||l.searchPredicate;if(typeof n=="function")return!!n(e,{query:s,columns:t});const i=String(s||"").trim().toLowerCase().split(/\s+/).filter(Boolean);if(!i.length)return!0;const c=Array.isArray(l.searchKeys)&&l.searchKeys.length?l.searchKeys:t.filter(r=>(r==null?void 0:r.searchable)!==!1).map(r=>{var z;return(z=r==null?void 0:r.searchKey)!=null?z:r==null?void 0:r.key}).filter(Boolean),a=[];if(c.length)for(const r of c)if(typeof r=="function")a.push(vl(r(e)));else{const z=t.find(d=>(d==null?void 0:d.key)===r||(d==null?void 0:d.searchKey)===r);a.push(vl(z?yl(z,e,-1):Fl(e,r)))}else a.push(vl(e));const v=a.join(" ").toLowerCase();return i.every(r=>v.includes(r))}xe.Table=(...e)=>{var t,s,l,n;const{props:i,children:c}=JSswift.uiNormalizeArgs(e),a=i.slots||{},v=Array.isArray(i.columns)?i.columns:[],r=Ko(i.pageSizeOptions,[5,10,20,50]),z=Number((s=(t=i.pageSize)!=null?t:r[0])!=null?s:10)||10,d=Array.from(new Set([...r,z])).sort((Re,C)=>Re-C),k=i.initialSort||(i.sortBy?{key:i.sortBy,dir:i.sortDir==="desc"?"desc":"asc"}:null),N=i.searchable===!0||typeof i.searchable=="string"||i.searchPlaceholder!=null||i.search!=null||i.query!=null||!!i.searchModel||!!i.queryModel||Array.isArray(i.searchKeys)||typeof i.searchBy=="function"||typeof i.searchPredicate=="function",p=en(i.searchModel||i.queryModel,"UI.Table:query"),[U,w]=wt.reactive.signal(Math.max(1,Number(i.page||1)||1)),[$,B]=wt.reactive.signal(z),[te,E]=wt.reactive.signal(k),[ve,le]=wt.reactive.signal(String((n=p?p.get():(l=i.search)!=null?l:i.query)!=null?n:"")),ie=Re=>{const C=String(Re!=null?Re:"");le(C),p&&p.set(C),w(1)},ge=Re=>{const C=Number(Re)||z;B(C),w(1)},ue=(Re,C)=>{const Se=Dl(Re,C),Fe=te();!Fe||Fe.key!==Se&&Fe.key!==(Re==null?void 0:Re.key)?E({key:Se,dir:"asc"}):Fe.dir==="asc"?E({key:Se,dir:"desc"}):E(null),w(1)};let fe=null,M;p&&(M=p.watch(Re=>{const C=String(Re!=null?Re:"");le(C),fe&&fe.value!==C&&(fe.value=C),w(1)},"UI.Table:queryWatch"));const me=JSswift.omit(i,["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","embedded","minTableWidth","hideHeader","hideFooter","hideStatus","slots","body"]);me.class=re(["jss-table-card",i.embedded===!0&&"jss-table-embedded",i.class,i.cardClass]),i.dense!=null&&(me.dense=i.dense);const be=_.div({class:"jss-table-shell"}),de=D(a,"default",{},c);de.length&&be.appendChild(_.div({class:"jss-table-lead"},...de));const Z=D(a,"toolbarStart",{},i.toolbarStart),j=D(a,"toolbar",{},i.toolbar),I=D(a,"toolbarEnd",{},i.toolbarEnd),y=_.div({class:"jss-table-toolbar"}),P=_.div({class:"jss-table-toolbar-main"}),Q=_.div({class:"jss-table-toolbar-side"});Z.forEach(Re=>P.appendChild(Re)),j.forEach(Re=>P.appendChild(Re));const m=D(a,"search",{query:ve(),getQuery:ve,setQuery:ie},null);if(m.length)m.forEach(Re=>Q.appendChild(Re));else if(N){fe=_.input({type:"search",class:"jss-input",placeholder:typeof i.searchable=="string"?i.searchable:i.searchPlaceholder||"Cerca nella tabella",value:String(ve()||"")}),fe.addEventListener("input",()=>ie(fe.value));const Re=xe.Btn({class:"jss-table-search-clear",outline:!0,onClick:()=>{fe&&(fe.value=""),ie("")}},"Reset");Q.appendChild(_.div({class:"jss-singularity jss-table-search"},_.span({class:"jss-table-search-icon","aria-hidden":"true"},"\u2315"),fe,Re))}I.forEach(Re=>Q.appendChild(Re)),(P.childNodes.length||Q.childNodes.length)&&(y.appendChild(P),y.appendChild(Q),be.appendChild(y));const b=_.div({class:"jss-singularity jss-table-chip"},""),g=_.div({class:"jss-singularity jss-table-chip"},""),T=_.div({class:"jss-singularity jss-table-chip"},""),Y=D(a,"status",{},i.status),K=_.div({class:"jss-table-status"},b,g,T,...Y);i.hideStatus!==!0&&be.appendChild(K);const _e=D(a,"caption",{},i.caption);_e.length&&be.appendChild(_.div({class:"jss-table-caption"},..._e));const J=_.thead(),A=_.tbody(),L=!!i.actions||!!a.actions,O=re(["jss-table",pe(i.dense,"dense"),pe(i.striped,"striped"),pe(i.hover!==!1,"hover"),pe(i.stickyHeader!==!1,"sticky-head"),i.tableClass]),X={...i.tableStyle||{}};i.minTableWidth!=null&&(X["--jss-table-min-width"]=vt(i.minTableWidth));const we=_.table({class:O,style:X},J,A),Be=_.div({class:"jss-singularity jss-table-wrap"},we);be.appendChild(Be);const Ue=_.div({class:"jss-singularity jss-table-chip"},""),H=_.div({class:"jss-singularity jss-table-chip"},""),W=xe.Btn({outline:!0,onClick:()=>w(Math.max(1,U()-1))},"\u2039"),ee=xe.Btn({outline:!0,onClick:()=>w(U()+1)},"\u203A"),Ne=_.div({class:"jss-singularity jss-table-chip"},""),Te=_.select({class:"jss-input jss-table-size-select"},...d.map(Re=>Vs({value:String(Re)},String(Re))));Te.value=String($()),Te.addEventListener("change",()=>ge(Te.value));const oe=D(a,"footer",{},i.footer),Pe=_.div({class:"jss-table-foot"},_.div({class:"jss-table-foot-main"},Ue,H,_.label({class:"jss-table-size"},_.span("Righe"),Te)),_.div({class:"jss-table-foot-extra"},...oe,_.div({class:"jss-table-pager"},W,Ne,ee)));i.hideFooter!==!0&&be.appendChild(Pe);const Ie=()=>{if(J.innerHTML="",i.hideHeader)return;const Re=_.tr();if(v.forEach((C,Se)=>{var Fe,F;const f={col:C,colIndex:Se,sort:te()},h={...bl(C==null?void 0:C.style,{...f,header:!0}),...bl((Fe=C==null?void 0:C.headerStyle)!=null?Fe:C==null?void 0:C.thStyle,{...f,header:!0})};(C==null?void 0:C.width)!=null&&(h.width=vt(C.width)),(C==null?void 0:C.minWidth)!=null&&(h.minWidth=vt(C.minWidth)),(C==null?void 0:C.maxWidth)!=null&&(h.maxWidth=vt(C.maxWidth)),C!=null&&C.align&&(h.textAlign=C.align);let x=D(C==null?void 0:C.slots,"header",f,null);if(!x.length){const We=typeof(C==null?void 0:C.header)=="function"?C.header(f):(F=C==null?void 0:C.header)!=null?F:po(C);x=D(a,"header",f,We)}const ae=te(),Oe=Dl(C,Se),De=(C==null?void 0:C.sortable)!==!1&&((C==null?void 0:C.key)!=null||typeof(C==null?void 0:C.get)=="function"||typeof(C==null?void 0:C.compare)=="function"),Ge=!!ae&&(ae.key===Oe||ae.key===(C==null?void 0:C.key)),Ke=_.th({class:re(["jss-table-head-cell",pe(C==null?void 0:C.nowrap,"is-nowrap"),pe(De,"jss-table-sortable"),pe(Ge,"is-sorted"),C==null?void 0:C.headerClass]),style:h});De?Ke.appendChild(_.button({type:"button",class:"jss-table-head-button",onClick:()=>ue(C,Se)},_.span({class:"jss-table-head-label"},...x),_.span({class:"jss-table-head-arrow","aria-hidden":"true"},Ge?ae.dir==="asc"?"\u2191":"\u2193":"\u2195"))):x.forEach(We=>Ke.appendChild(We)),Re.appendChild(Ke)}),L){const C=D(a,"actionsHeader",{},i.actionsLabel||"Azioni");Re.appendChild(_.th({class:"jss-table-head-cell jss-table-head-actions",style:{textAlign:"right"}},...C))}J.appendChild(Re)},Le=(Re,C)=>{const Se={columns:v,count:v.length},Fe=D(a,Re,Se,C),F=String(v.length+(L?1:0));A.appendChild(_.tr(_.td({colSpan:F,class:"jss-table-state"},...Fe)))},Ye=wt.reactive.effect(()=>{const Re=Go(i.rows),C=String(ve()||"").trim(),Se=te(),Fe=typeof i.loading=="function"?!!i.loading():!!i.loading,F=i.pagination!==!1;if(Ie(),A.innerHTML="",fe&&fe.value!==ve()&&(fe.value=ve()),Te.value!==String($())&&(Te.value=String($())),Fe){b.textContent="Caricamento in corso",g.style.display="none",T.style.display="none",Ue.textContent="Loading\u2026",H.textContent="",Ne.textContent="Pagina 1",W.disabled=!0,ee.disabled=!0,Le("loading",i.loadingText||"Loading...");return}let f=Re.slice();const h=f.length;if(typeof i.filter=="function"&&(f=f.filter((et,tt)=>i.filter(et,{row:et,index:tt,query:C,rows:Re,columns:v}))),C&&(f=f.filter(et=>qo(et,v,C,i))),Se){const et=ho(v,Se.key);et&&f.sort((tt,dt)=>{const gt=yl(et,tt,-1),At=yl(et,dt,-1),It=typeof et.compare=="function"?et.compare(gt,At,tt,dt):Uo(gt,At);return Se.dir==="asc"?It:-It})}const x=f.length,ae=Math.max(1,Number($())||z),Oe=F?Math.max(1,Math.ceil(x/ae)):1,De=F?Math.min(U(),Oe):1;De!==U()&&w(De);const Ge=F?(De-1)*ae:0,Ke=F?Ge+ae:x,We=f.slice(Ge,Ke);if(b.textContent=x===h?`${x} righe`:`${x} di ${h} righe`,g.textContent=C?`Ricerca: ${C}`:"",g.style.display=C?"":"none",Se){const et=ho(v,Se.key);T.textContent=et?`Ordine: ${po(et)} ${Se.dir==="asc"?"\u2191":"\u2193"}`:"",T.style.display=et?"":"none"}else T.style.display="none";if(Ue.textContent=x?`${Ge+1}-${Math.min(Ke,x)} di ${x}`:"0 risultati",H.textContent=x!==h?`Dataset totale ${h}`:`Page size ${ae}`,Ne.textContent=F?`Pagina ${De} / ${Oe}`:"Tutte le righe",W.disabled=!F||De<=1,ee.disabled=!F||De>=Oe,Te.disabled=!F,Te.parentNode.style.display=F?"":"none",We.length===0){Le("empty",i.emptyText||"Nessun dato");return}for(let et=0;et<We.length;et++){const tt=We[et],dt=Ge+et,gt={row:tt,rowIndex:dt,pageIndex:et},At=typeof i.rowAttrs=="function"?i.rowAttrs(tt,gt)||{}:i.rowAttrs||{},It=typeof i.rowClass=="function"?i.rowClass(tt,gt):i.rowClass,$t=!!(i.onRowClick||i.onRowDblClick),zt=_.tr({...At,class:re(["jss-table-row",It,At.class,pe($t,"is-clickable")])});if(i.rowKey){const mt=typeof i.rowKey=="function"?i.rowKey(tt,gt):Fl(tt,i.rowKey);mt!=null&&(zt.dataset.key=String(mt))}const Xe=mt=>{const Nt=mt==null?void 0:mt.target;return!!(Nt&&Nt.closest&&Nt.closest("button, a, input, select, textarea, label, [data-table-action]"))};if(i.onRowClick&&zt.addEventListener("click",mt=>{Xe(mt)||i.onRowClick(tt,gt,mt)}),i.onRowDblClick&&zt.addEventListener("dblclick",mt=>{Xe(mt)||i.onRowDblClick(tt,gt,mt)}),v.forEach((mt,Nt)=>{var Zt,rn;const qt=yl(mt,tt,dt),Yt={...gt,col:mt,colIndex:Nt,value:qt},cn={...bl(mt==null?void 0:mt.style,Yt),...bl((Zt=mt==null?void 0:mt.cellStyle)!=null?Zt:mt==null?void 0:mt.tdStyle,Yt)};mt!=null&&mt.align&&(cn.textAlign=mt.align),(mt==null?void 0:mt.width)!=null&&(cn.width=vt(mt.width)),(mt==null?void 0:mt.minWidth)!=null&&(cn.minWidth=vt(mt.minWidth)),(mt==null?void 0:mt.maxWidth)!=null&&(cn.maxWidth=vt(mt.maxWidth));const Xt=typeof(mt==null?void 0:mt.cellClass)=="function"?mt.cellClass(tt,Yt):(mt==null?void 0:mt.cellClass)||(mt==null?void 0:mt.class),Ut=_.td({class:re(["jss-table-cell",Xt,pe(mt==null?void 0:mt.nowrap,"is-nowrap")]),style:cn});let tn=D(mt==null?void 0:mt.slots,"cell",Yt,null);if(!tn.length){const ln=typeof(mt==null?void 0:mt.render)=="function"?mt.render(tt,Yt):typeof(mt==null?void 0:mt.format)=="function"?mt.format(qt,tt,Yt):qt,Xn=ln==null?(rn=mt==null?void 0:mt.emptyText)!=null?rn:"":ln;tn=D(a,"cell",Yt,Xn)}tn.length||(tn=[""]),tn.forEach(ln=>Ut.appendChild(ln)),zt.appendChild(Ut)}),L){const mt={...gt},Nt=typeof i.actions=="function"?i.actions(tt,gt):i.actions;let Zt=D(a,"actions",mt,Nt);Zt.length||(Zt=D(null,"default",mt,Nt)),zt.appendChild(_.td({class:"jss-table-cell jss-table-cell-actions",style:{textAlign:"right"}},_.div({class:"jss-table-actions"},...Zt)))}A.appendChild(zt)}},"UI.Table:render");me.body=be;const ct=xe.Card(me);return JSswift._registerCleanup(ct,Ye),M&&JSswift._registerCleanup(ct,M),ct},xe.Menu=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=["primary","secondary","warning","danger","success","info","light","dark"],i=["xs","sm","md","lg","xl"];let c={...t},a=null,v=null,r=null,z=null,d=null;const k=(A,L)=>Object.prototype.hasOwnProperty.call(A||{},L),N=(A,L)=>typeof A=="function"?A(L):A,p=A=>String(A||"").split(/\s+/).filter(Boolean),U=A=>A&&typeof A=="object"&&!A.nodeType&&!Array.isArray(A)&&!(A instanceof Function),w=A=>!!A&&typeof A=="object"&&(A.nodeType===1||typeof A.getBoundingClientRect=="function"),$=()=>{clearTimeout(z),clearTimeout(d),z=null,d=null},B=(A,L,O)=>{if(!A)return;const X=A[L]||[];X.length&&A.classList.remove(...X);const we=(O||[]).filter(Boolean);we.length&&A.classList.add(...we),A[L]=we},te=(A,L,O,X=we=>we)=>{if(A){if(O==null||O===""){A.style.removeProperty(L);return}A.style.setProperty(L,X(O))}},E=()=>c||{},ve=A=>{var L;const O=String(o((L=A.state)!=null?L:A.color)||"").toLowerCase();return n.includes(O)?O:""},le=A=>{const L=String(o(A.size)||"").toLowerCase();return i.includes(L)?L:""},ie=A=>{var L,O;return String(o((O=(L=A.placement)!=null?L:A.position)!=null?O:"bottom-start"))},ge=()=>{var A;const L=o((A=E().delay)!=null?A:E().showDelay),O=Number(L);return Number.isFinite(O)?Math.max(0,O):0},ue=()=>{const A=o(E().hideDelay),L=Number(A);return Number.isFinite(L)?Math.max(0,L):80},fe=(A=null)=>{var L,O,X;if(A)return A;const we=E();return v||o((X=(O=(L=we.anchorEl)!=null?L:we.triggerEl)!=null?O:we.target)!=null?X:we.anchor)||null},M=A=>{if(A==null||A===!0)return new Set(["click"]);if(A===!1)return new Set(["manual"]);const L=Array.isArray(A)?A:String(A).split(/[\s,|/]+/),O=new Set;return L.forEach(X=>{const we=String(X||"").trim().toLowerCase();we&&(we==="mouseenter"||we==="mouseover"?O.add("hover"):we==="blur"||we==="focusin"?O.add("focus"):we==="tap"?O.add("click"):O.add(we))}),O.size?O:new Set(["manual"])},me=(A,L)=>{var O,X,we;let Be=null,Ue=null;if(w(A))Be=A,U(L)&&(Ue=L);else if(U(A)){Ue=A;const H=(we=(X=(O=A.anchorEl)!=null?O:A.triggerEl)!=null?X:A.target)!=null?we:A.anchor;w(H)&&(Be=H)}else A!=null&&(Be=A);return{anchorEl:Be,nextProps:Ue}},be=(A=a==null?void 0:a.panel)=>{var L;return Array.from(((L=A==null?void 0:A.querySelectorAll)==null?void 0:L.call(A,"[data-menu-item]:not([disabled]):not([tabindex='-1']), .jss-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(O=>O.offsetParent!==null&&O.getAttribute("aria-hidden")!=="true")},de=()=>{o(E().autoFocus)!==!1&&setTimeout(()=>{const A=be();if(!A.length)return;(A.find(O=>O.classList.contains("is-active")||O.classList.contains("is-selected")||O.classList.contains("is-checked"))||A[0]).focus()},0)},Z=(A,L,O="sm")=>{const X=N(A,L);return X==null?[]:typeof X=="string"?[xe.Icon({name:X,size:O})]:Bs(X,{...L,as:"icon"})},j=(A,L)=>{var O,X,we,Be,Ue,H,W,ee,Ne,Te,oe,Pe,Ie;const Le=N(A,L);if(Le==null||Le===!1)return[];if(Array.isArray(Le))return Le.flatMap((zt,Xe)=>j(zt,{...L,index:Xe}));if(typeof Le=="function")return j(Le(L),L);if(Le!=null&&Le.nodeType)return[Le];if(typeof Le=="string"||typeof Le=="number")return j({label:Le},L);if(!U(Le))return Bs(Le,{...L,as:"item"});const Ye=String((X=(O=Le.type)!=null?O:Le.kind)!=null?X:"").toLowerCase();if(Ye==="separator"||Ye==="divider"||Le.separator===!0||Le.divider===!0)return[_.div({class:"jss-menu-divider",role:"separator"})];const ct=(we=Le.items)!=null?we:Le.children;if((Ye==="group"||Ye==="section"||Array.isArray(ct))&&ct!=null){const zt={...L,item:Le},Xe=D(l,"groupLabel",zt,N((Be=Le.label)!=null?Be:Le.title,zt)),mt=j(ct,zt);return mt.length?[_.div({class:re(["jss-menu-group",Le.class])},Xe.length?_.div({class:"jss-menu-group-label"},...Xe):null,_.div({class:"jss-menu-group-items"},...mt))]:[]}const Re={...L,item:Le,close:Q,dismiss:Q,open:b,toggle:Y,update:m,isOpen:K,entry:()=>a,anchorEl:fe(),props:E()},C=!!o(Le.disabled),Se=Le.checked==null?null:!!o(Le.checked),Fe=!!o((Ue=Le.active)!=null?Ue:Le.selected),F=ve(Le),f=o(Le.href),h=o(Le.to),x=k(Le,"closeOnSelect")?!!o(Le.closeOnSelect):Le.keepOpen===!0?!1:E().closeOnSelect!==!1,ae=Le.role||(Se!=null?"menuitemcheckbox":"menuitem"),Oe=Z(Le.icon,Re),De=Z((H=Le.iconRight)!=null?H:Le.endIcon,Re),Ge=D(l,"itemTitle",Re,N((W=Le.title)!=null?W:Le.label,Re)),Ke=D(l,"itemSubtitle",Re,N((ee=Le.subtitle)!=null?ee:Le.description,Re)),We=D(l,"itemShortcut",Re,N(Le.shortcut,Re)),et=D(l,"itemBadge",Re,N(Le.badge,Re)),tt=D(l,"item",Re,N((Te=(Ne=Le.content)!=null?Ne:Le.body)!=null?Te:Le.render,Re)),dt=[...et,...We,...Se===!0&&!De.length&&!et.length?[_.span({class:"jss-menu-entry-check"},xe.Icon({name:Le.checkedIcon||"check",size:"sm"}))]:[],...De],At={class:re(["jss-menu-entry","jss-menu-item",F?`jss-state-${F}`:"",pe(Fe,"is-active"),pe(Se===!0,"is-checked"),pe(C,"is-disabled"),Le.class]),role:ae,tabIndex:C?-1:(oe=Le.tabIndex)!=null?oe:-1,"data-menu-item":!0,"data-menu-select":x?"true":"false","data-menu-close":Le.close===!0?"true":null,"data-menu-keep-open":x?null:"true","aria-disabled":C?"true":null,"aria-checked":Se==null?null:String(Se),title:(Ie=(Pe=Le.titleAttr)!=null?Pe:Le.tooltip)!=null?Ie:null,type:f?null:"button",href:f||null,target:Le.target||null,rel:Le.rel||(Le.target==="_blank"?"noopener noreferrer":null),onClick:zt=>{var Xe,mt,Nt,Zt;if(C){zt.preventDefault(),zt.stopPropagation();return}(mt=(Xe=E()).onItemClick)==null||mt.call(Xe,Le,Re,zt);const rn=(Nt=Le.onClick)==null?void 0:Nt.call(Le,Re,zt);zt.defaultPrevented||(h&&((Zt=JSswift.router)!=null&&Zt.navigate)&&(zt.preventDefault(),JSswift.router.navigate(h)),rn!==!1&&x&&Q())}};Le.attrs&&typeof Le.attrs=="object"&&Object.assign(At,Le.attrs);const It=f?_.a:_.button,$t=tt.length?tt:[Ge.length?_.div({class:"jss-menu-entry-title"},...Ge):null,Ke.length?_.div({class:"jss-menu-entry-subtitle"},...Ke):null].filter(Boolean);return[It(At,Oe.length?_.span({class:"jss-menu-entry-icon"},...Oe):null,_.span({class:"jss-menu-entry-main"},...$t),dt.length?_.span({class:"jss-menu-entry-aside"},...dt):null)]},I=()=>{var A,L,O,X,we,Be,Ue;const H=E(),W={close:Q,dismiss:Q,open:b,toggle:Y,update:m,isOpen:K,entry:()=>a,anchorEl:fe(),props:H},ee=Z(H.icon,W,H.iconSize||"md"),Ne=D(l,"eyebrow",W,N(H.eyebrow,W)),Te=D(l,"title",W,N((L=(A=H.title)!=null?A:H.heading)!=null?L:H.label,W)),oe=D(l,"subtitle",W,N((O=H.subtitle)!=null?O:H.description,W)),Pe=D(l,"before",W,N(H.before,W)),Ie=D(l,"header",W,N(H.header,W)),Le=D(l,"after",W,N(H.after,W)),Ye=D(l,"footer",W,N(H.footer,W)),ct=D(l,"status",W,N(H.status,W));let Re=(X=H.content)!=null?X:H.body;Re==null&&s&&s.length&&(Re=s);let C=D(l,"content",W,N(Re,W));C.length||(C=D(l,"body",W,N(Re,W))),C.length||(C=D(l,"default",W,N(Re,W)));const Se=j((Be=(we=H.items)!=null?we:H.actionsList)!=null?Be:H.entries,W),Fe=Se.length?[]:D(l,"empty",W,N((Ue=H.empty)!=null?Ue:H.emptyText,W));let F=null;return Ie.length?F=_.div({class:re(["jss-menu-head","jss-menu-head-custom",H.headerClass])},...Ie):(ee.length||Ne.length||Te.length||oe.length)&&(F=_.div({class:re(["jss-menu-head",H.headerClass])},ee.length?_.div({class:"jss-menu-head-icon"},...ee):null,_.div({class:"jss-menu-head-main"},Ne.length?_.div({class:"jss-menu-eyebrow"},...Ne):null,Te.length?_.div({class:"jss-menu-title"},...Te):null,oe.length?_.div({class:"jss-menu-subtitle"},...oe):null))),_.div({class:re(["jss-menu","jss-menu-shell",pe(H.dense,"dense"),pe(Se.length>0,"has-items"),pe(Ye.length>0||ct.length>0,"has-footer"),H.class]),style:H.style||{},role:H.role||"menu","aria-label":H.ariaLabel||null},Pe.length?_.div({class:"jss-menu-before"},...Pe):null,F,C.length?_.div({class:re(["jss-menu-content",H.contentClass])},...C):null,Se.length?_.div({class:re(["jss-menu-items",H.itemsClass])},...Se):null,!Se.length&&Fe.length?_.div({class:"jss-menu-empty"},...Fe):null,Le.length?_.div({class:"jss-menu-after"},...Le):null,ct.length||Ye.length?_.div({class:re(["jss-menu-footer",H.footerClass])},ct.length?_.div({class:"jss-menu-status"},...ct):null,Ye.length?_.div({class:"jss-menu-footer-actions"},...Ye):null):null)},y=A=>{var L;if(!(A!=null&&A.panel))return;const O=E(),X=ve(O),we=le(O);B(A.panel,"_menuClassTokens",["jss-menu-panel","jss-clear-set","jss-singularity",we?`jss-menu-${we}`:"",X?`jss-state-${X}`:"",o(O.outline)?"outline":"",...p(O.panelClass)]),B(A.overlay,"_menuOverlayClassTokens",[...p(O.overlayClass)]),A.panel.dataset.placement=ie(O),te(A.panel,"--jss-menu-width",o(O.width),vt),te(A.panel,"--jss-menu-min-width",o(O.minWidth),vt),te(A.panel,"--jss-menu-max-width",o(O.maxWidth),vt),te(A.panel,"--jss-menu-max-height",o(O.maxHeight),vt),te(A.panel,"--jss-menu-body-max-height",o((L=O.bodyMaxHeight)!=null?L:O.contentMaxHeight),vt),O.panelStyle&&Object.assign(A.panel.style,O.panelStyle),Et(A.panel,O)},P=()=>{a!=null&&a.panel&&a.panel.replaceChildren(I())},Q=()=>{if($(),!a)return;const A=a;a=null,Ns(A,()=>JSswift.overlay.close(A.id))},m=(A={})=>{var L,O,X,we;if(A&&typeof A=="object"&&(c={...c,...A}),a){const Be=E();y(a),P(),(we=a.reposition)==null||we.call(a,{anchorEl:a._anchorEl,placement:ie(Be),offsetX:(L=Be.offsetX)!=null?L:0,offsetY:(X=(O=Be.offsetY)!=null?O:Be.offset)!=null?X:8}),de()}return J},b=(A=null,L=null)=>{var O,X,we,Be,Ue,H,W,ee,Ne,Te,oe,Pe,Ie,Le,Ye,ct;$();const{anchorEl:Re,nextProps:C}=me(A,L);C&&(c={...c,...C});const Se=E(),Fe=fe(Re);if(!Fe||o(Se.disabled))return null;if(a&&a._anchorEl===Fe){const We=E();return y(a),P(),(Be=a.reposition)==null||Be.call(a,{anchorEl:a._anchorEl,placement:ie(We),offsetX:(O=We.offsetX)!=null?O:0,offsetY:(we=(X=We.offsetY)!=null?X:We.offset)!=null?we:8}),de(),a}a&&Q(),r=document.activeElement;let F=null;if(a=JSswift.overlay.open(()=>I(),{type:"menu",anchorEl:Fe,placement:ie(Se),offsetX:(Ue=Se.offsetX)!=null?Ue:0,offsetY:(W=(H=Se.offsetY)!=null?H:Se.offset)!=null?W:8,backdrop:Se.backdrop===!0,lockScroll:Se.lockScroll===!0,trapFocus:Se.trapFocus===!0,autoFocus:!1,closeOnOutside:Se.closeOnOutside!==!1,closeOnBackdrop:(ee=Se.closeOnBackdrop)!=null?ee:Se.backdrop===!0,closeOnEsc:Se.closeOnEsc!==!1,className:Bt(["jss-menu-panel"]),onClose:()=>{var We,et,tt;(We=F==null?void 0:F._menuCleanup)==null||We.call(F),(tt=(et=E()).onClose)==null||tt.call(et,F),E().returnFocus!==!1&&r&&typeof r.focus=="function"&&setTimeout(()=>r.focus(),0)}}),!(a!=null&&a.panel))return a;const f=a;F=f,f._anchorEl=Fe;const h=()=>{clearTimeout(d),d=null},x=()=>{T()},ae=We=>{const et=We.target;if(!et||!et.closest)return;if(et.closest("[data-menu-close]")){Q();return}if(E().closeOnSelect===!1)return;const tt=et.closest("[data-menu-item], [data-menu-select], .jss-menu-item, [role='menuitem'], [role='menuitemcheckbox'], [role='menuitemradio'], a[href], button:not([disabled])");tt&&(tt.closest("[data-menu-keep-open]")||tt.getAttribute("data-menu-select")!=="false"&&Q())},Oe=We=>{if(We.key==="Escape"){We.preventDefault(),Q();return}if(!["ArrowDown","ArrowUp","Home","End"].includes(We.key))return;const et=be(f.panel);if(!et.length)return;We.preventDefault();const tt=et.indexOf(document.activeElement);if(We.key==="Home"){et[0].focus();return}if(We.key==="End"){et[et.length-1].focus();return}const dt=We.key==="ArrowDown"?1:-1,gt=tt<0?dt>0?0:et.length-1:(tt+dt+et.length)%et.length;et[gt].focus()};f.panel.addEventListener("click",ae),f.panel.addEventListener("keydown",Oe);const De=M((Te=(Ne=Se.trigger)!=null?Ne:Se.triggers)!=null?Te:k(Se,"open")?"manual":null),Ge=De.has("hover"),Ke=De.has("focus");return(Ge||Ke)&&(f.panel.addEventListener("mouseenter",h),f.panel.addEventListener("mouseleave",x),f.panel.addEventListener("focusin",h),f.panel.addEventListener("focusout",x)),f._menuCleanup=()=>{var We,et,tt,dt,gt,At;(We=f.panel)==null||We.removeEventListener("click",ae),(et=f.panel)==null||et.removeEventListener("keydown",Oe),(tt=f.panel)==null||tt.removeEventListener("mouseenter",h),(dt=f.panel)==null||dt.removeEventListener("mouseleave",x),(gt=f.panel)==null||gt.removeEventListener("focusin",h),(At=f.panel)==null||At.removeEventListener("focusout",x)},y(f),(Le=f.reposition)==null||Le.call(f,{anchorEl:Fe,placement:ie(Se),offsetX:(oe=Se.offsetX)!=null?oe:0,offsetY:(Ie=(Pe=Se.offsetY)!=null?Pe:Se.offset)!=null?Ie:8}),ks(f),(ct=(Ye=E()).onOpen)==null||ct.call(Ye,f),de(),f},g=(A,L=null)=>{clearTimeout(d),d=null,clearTimeout(z),z=setTimeout(()=>b(A,L),ge())},T=(A=!1)=>{if(clearTimeout(z),z=null,!!a){if(clearTimeout(d),A){Q();return}d=setTimeout(()=>Q(),ue())}},Y=(A=null,L=null)=>K()?(Q(),null):b(A,L),K=()=>!!a,J={open:b,close:Q,show:g,hide:T,toggle:Y,update:m,bind:A=>{var L,O;if(!A)return()=>{};v=A;const X=E(),we=M((O=(L=X.trigger)!=null?L:X.triggers)!=null?O:k(X,"open")?"manual":null),Be=we.has("hover"),Ue=we.has("focus"),H=we.has("click"),W=we.has("manual")||!Be&&!Ue&&!H,ee=[],Ne=()=>{$(),ee.forEach(Te=>Te()),v===A&&(v=null)};if(k(X,"open"))return ht(X.open)?JSswift.reactive.effect(()=>{v&&(o(E().open)?b(v):T(!0))},"UI.Menu:open"):X.open===!0?b(A):X.open===!1&&T(!0),Ne;if(W||o(X.disabled))return Ne;if(Be){const Te=()=>g(A),oe=()=>T();A.addEventListener("mouseenter",Te),A.addEventListener("mouseleave",oe),ee.push(()=>{A.removeEventListener("mouseenter",Te),A.removeEventListener("mouseleave",oe)})}if(Ue){const Te=()=>g(A),oe=()=>T();A.addEventListener("focus",Te),A.addEventListener("blur",oe),ee.push(()=>{A.removeEventListener("focus",Te),A.removeEventListener("blur",oe)})}if(H){const Te=oe=>{var Pe,Ie;(Ie=(Pe=E()).onTriggerClick)==null||Ie.call(Pe,oe),!oe.defaultPrevented&&Y(A)};A.addEventListener("click",Te),ee.push(()=>A.removeEventListener("click",Te))}return Ne},isOpen:K,entry:()=>a,props:()=>({...c})};return J},xe.Popover=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e),l=t.slots||{},n=["primary","secondary","warning","danger","success","info","light","dark"],i=["xs","sm","md","lg","xl"];let c={...t},a=null,v=null,r=null,z=null,d=null;const k=(J,A)=>Object.prototype.hasOwnProperty.call(J||{},A),N=(J,A)=>typeof J=="function"?J(A):J,p=J=>String(J||"").split(/\s+/).filter(Boolean),U=J=>J&&typeof J=="object"&&!J.nodeType&&!Array.isArray(J)&&!(J instanceof Function),w=J=>!!J&&typeof J=="object"&&(J.nodeType===1||typeof J.getBoundingClientRect=="function"),$=()=>{clearTimeout(z),clearTimeout(d),z=null,d=null},B=(J,A,L)=>{if(!J)return;const O=J[A]||[];O.length&&J.classList.remove(...O);const X=(L||[]).filter(Boolean);X.length&&J.classList.add(...X),J[A]=X},te=(J,A,L,O=X=>X)=>{if(J){if(L==null||L===""){J.style.removeProperty(A);return}J.style.setProperty(A,O(L))}},E=()=>c,ve=J=>{var A;const L=o((A=J.state)!=null?A:J.color);return L?n.includes(L)?L:String(L):""},le=J=>{const A=o(J.size);return typeof A=="string"&&i.includes(A)?A:""},ie=J=>{var A,L,O;const X=String(o((O=(L=(A=J.actionsAlign)!=null?A:J.footerAlign)!=null?L:J.alignActions)!=null?O:"end")).toLowerCase();return["start","left"].includes(X)?"start":["center","middle"].includes(X)?"center":["between","space-between"].includes(X)?"between":["stretch","full"].includes(X)?"stretch":"end"},ge=J=>{var A,L;return String(o((L=(A=J.placement)!=null?A:J.position)!=null?L:"bottom-start"))},ue=(J,A)=>{const L=o(J);if(L==null||L==="")return A;const O=Number(L);return Number.isFinite(O)?O:A},fe=()=>ue(E().delay,0),M=()=>ue(E().hideDelay,120),me=J=>{var A,L;return((L=(A=J.closable)!=null?A:J.dismissible)!=null?L:J.closeButton)===!0},be=(J=null)=>{var A,L,O;if(J)return J;const X=E();return v||o((O=(L=(A=X.anchorEl)!=null?A:X.triggerEl)!=null?L:X.target)!=null?O:X.anchor)||null},de=J=>{if(J==null||J===!0)return new Set(["click"]);if(J===!1)return new Set(["manual"]);const A=Array.isArray(J)?J:String(J).split(/[\s,|/]+/),L=new Set;return A.forEach(O=>{const X=String(O||"").trim().toLowerCase();X&&(X==="mouseenter"||X==="mouseover"?L.add("hover"):X==="blur"||X==="focusin"?L.add("focus"):X==="tap"?L.add("click"):L.add(X))}),L.size?L:new Set(["manual"])},Z=(J,A)=>{var L,O,X;let we=null,Be=null;if(w(J))we=J,U(A)&&(Be=A);else if(U(J)){Be=J;const Ue=(X=(O=(L=J.anchorEl)!=null?L:J.triggerEl)!=null?O:J.target)!=null?X:J.anchor;w(Ue)&&(we=Ue)}else J!=null&&(we=J);return{anchorEl:we,nextProps:Be}},j=()=>{var J,A,L,O,X,we,Be,Ue,H;const W=E(),ee={close:P,dismiss:P,open:m,toggle:T,update:Q,isOpen:Y,entry:()=>a,anchorEl:be(),props:W},Ne=W.icon!=null?typeof W.icon=="string"?xe.Icon({name:W.icon,size:W.iconSize||"md"}):JSswift.ui.slot(W.icon,{as:"icon"}):null,Te=D(l,"eyebrow",ee,N(W.eyebrow,ee)),oe=D(l,"title",ee,N((A=(J=W.title)!=null?J:W.heading)!=null?A:W.label,ee)),Pe=D(l,"subtitle",ee,N((L=W.subtitle)!=null?L:W.description,ee)),Ie=D(l,"icon",ee,Ne),Le=D(l,"header",ee,N((X=(O=W.headerContent)!=null?O:W.head)!=null?X:W.header,ee)),Ye=me(W)?D(l,"close",ee,xe.Btn({class:"jss-dialog-close",size:"sm",outline:!0,"aria-label":W.closeLabel||"Chiudi popover","data-popover-close":!0},xe.Icon({name:W.closeIcon||"close",size:"sm"}))):[];let ct=(Ue=(Be=(we=W.content)!=null?we:W.body)!=null?Be:W.message)!=null?Ue:W.text;ct==null&&s&&s.length&&(ct=s);let Re=D(l,"content",ee,N(ct,ee));Re.length||(Re=D(l,"body",ee,N(ct,ee))),Re.length||(Re=D(l,"default",ee,N(ct,ee)));const C=N((H=W.footer)!=null?H:W.actions,ee);let Se=D(l,"footer",ee,C);Se.length||(Se=D(l,"actions",ee,C));let Fe=null;Le.length?Fe=_.div({class:"jss-dialog-head jss-dialog-head-custom"},...Le):(Te.length||oe.length||Pe.length||Ie.length||Ye.length)&&(Fe=_.div({class:"jss-dialog-head"},Ie.length?_.div({class:"jss-dialog-icon"},...Ie):null,_.div({class:"jss-dialog-head-main"},Te.length?_.div({class:"jss-dialog-eyebrow"},...Te):null,oe.length?_.div({class:"jss-dialog-title"},...oe):null,Pe.length?_.div({class:"jss-dialog-subtitle"},...Pe):null),Ye.length?_.div({class:"jss-dialog-close-wrap"},...Ye):null));const F=[];return Fe&&F.push(Fe),Re.length&&F.push(_.div({class:re(["jss-dialog-body",W.bodyClass])},...Re)),Se.length&&F.push(_.div({class:re(["jss-dialog-actions",`is-${ie(W)}`,pe(W.stackActions,"is-stacked"),W.actionsClass,W.footerClass])},...Se)),F.length||F.push(_.div({class:re(["jss-dialog-body",W.bodyClass])})),_.div({class:re(["jss-dialog-shell","jss-popover-shell",pe(!!Fe,"has-head"),pe(Se.length>0,"has-footer"),pe(W.divider!==!1,"with-divider")])},...F)},I=J=>{var A;if(!(J!=null&&J.panel))return;const L=E(),O=ve(L),X=le(L);B(J.panel,"_popoverClassTokens",["jss-dialog","jss-popover","jss-singularity","jss-clear-set",X?`jss-dialog-${X}`:"",O,O?`jss-state-${O}`:"",o(L.scrollable)?"scrollable":"",o(L.stickyHeader)?"sticky-head":"",o(L.stickyActions)?"sticky-actions":"",o(L.borderless)?"borderless":"",...p(L.class),...p(L.panelClass)]),B(J.overlay,"_popoverOverlayClassTokens",[...p(L.overlayClass)]),J.panel.dataset.placement=ge(L),te(J.panel,"--jss-dialog-width",o(L.width),vt),te(J.panel,"--jss-dialog-min-width",o(L.minWidth),vt),te(J.panel,"--jss-dialog-max-width",o(L.maxWidth),vt),te(J.panel,"--jss-dialog-max-height",o(L.maxHeight),vt),te(J.panel,"--jss-dialog-body-max-height",o((A=L.bodyMaxHeight)!=null?A:L.contentMaxHeight),vt),L.style&&Object.assign(J.panel.style,L.style),Et(J.panel,L),J.panel.setAttribute("role",L.role||"dialog"),J.panel.setAttribute("aria-modal",L.modal===!0?"true":"false"),L.ariaLabel?J.panel.setAttribute("aria-label",L.ariaLabel):J.panel.removeAttribute("aria-label")},y=()=>{a!=null&&a.panel&&a.panel.replaceChildren(j())},P=()=>{if($(),!a)return;const J=a;a=null,Ns(J,()=>JSswift.overlay.close(J.id))},Q=(J={})=>(J&&typeof J=="object"&&(c={...c,...J}),a&&(I(a),y()),_e),m=(J=null,A=null)=>{var L,O,X,we,Be,Ue,H,W;$();const{anchorEl:ee,nextProps:Ne}=Z(J,A);Ne&&(c={...c,...Ne});const Te=E(),oe=be(ee);if(!oe||o(Te.disabled))return null;if(a&&a._anchorEl===oe)return I(a),y(),a;a&&P(),r=document.activeElement;const Pe=de((O=(L=Te.trigger)!=null?L:Te.triggers)!=null?O:k(Te,"open")?"manual":null),Ie=Pe.has("hover"),Le=Pe.has("focus");let Ye=null;if(a=JSswift.overlay.open(()=>j(),{type:"popover",anchorEl:oe,placement:ge(Te),offsetX:(X=Te.offsetX)!=null?X:0,offsetY:(Be=(we=Te.offsetY)!=null?we:Te.offset)!=null?Be:10,backdrop:Te.backdrop===!0,lockScroll:Te.lockScroll===!0,trapFocus:Te.trapFocus===!0,autoFocus:Te.autoFocus===!0,closeOnOutside:Te.closeOnOutside!==!1,closeOnBackdrop:(Ue=Te.closeOnBackdrop)!=null?Ue:Te.backdrop===!0,closeOnEsc:Te.closeOnEsc!==!1,className:Bt(["jss-dialog","jss-popover"]),onClose:()=>{var Fe,F,f;(Fe=Ye==null?void 0:Ye._popoverCleanup)==null||Fe.call(Ye),(f=(F=E()).onClose)==null||f.call(F,Ye),E().returnFocus!==!1&&r&&typeof r.focus=="function"&&setTimeout(()=>r.focus(),0)}}),!(a!=null&&a.panel))return a;const ct=a;Ye=ct,ct._anchorEl=oe;const Re=()=>{clearTimeout(d),d=null},C=()=>{!Ie&&!Le||g()},Se=Fe=>{const F=Fe.target;if(!(!F||!F.closest)){if(F.closest("[data-popover-close]")||F.closest("[data-dialog-close]")){P();return}E().closeOnSelect===!0&&F.closest("[data-popover-select]")&&P()}};return ct.panel.addEventListener("click",Se),(Ie||Le)&&(ct.panel.addEventListener("mouseenter",Re),ct.panel.addEventListener("mouseleave",C),ct.panel.addEventListener("focusin",Re),ct.panel.addEventListener("focusout",C)),ct._popoverCleanup=()=>{var Fe,F,f,h,x;(Fe=ct.panel)==null||Fe.removeEventListener("click",Se),(F=ct.panel)==null||F.removeEventListener("mouseenter",Re),(f=ct.panel)==null||f.removeEventListener("mouseleave",C),(h=ct.panel)==null||h.removeEventListener("focusin",Re),(x=ct.panel)==null||x.removeEventListener("focusout",C)},I(ct),ks(ct),(W=(H=E()).onOpen)==null||W.call(H,ct),ct},b=(J,A=null)=>{clearTimeout(d),d=null,clearTimeout(z),z=setTimeout(()=>m(J,A),fe())},g=(J=!1)=>{if(clearTimeout(z),z=null,!!a){if(clearTimeout(d),J){P();return}d=setTimeout(()=>P(),M())}},T=(J=null,A=null)=>Y()?(P(),null):m(J,A),Y=()=>!!a,_e={open:m,close:P,show:b,hide:g,toggle:T,update:Q,bind:J=>{var A,L;if(!J)return()=>{};v=J;const O=E(),X=de((L=(A=O.trigger)!=null?A:O.triggers)!=null?L:k(O,"open")?"manual":null),we=X.has("hover"),Be=X.has("focus"),Ue=X.has("click"),H=X.has("manual")||!we&&!Be&&!Ue,W=[],ee=()=>{$(),W.forEach(Ne=>Ne()),v===J&&(v=null)};if(k(O,"open"))return ht(O.open)?JSswift.reactive.effect(()=>{v&&(o(E().open)?m(v):g(!0))},"UI.Popover:open"):O.open===!0?m(J):O.open===!1&&g(!0),ee;if(H||o(O.disabled))return ee;if(we){const Ne=()=>b(J),Te=()=>g();J.addEventListener("mouseenter",Ne),J.addEventListener("mouseleave",Te),W.push(()=>{J.removeEventListener("mouseenter",Ne),J.removeEventListener("mouseleave",Te)})}if(Be){const Ne=()=>b(J),Te=()=>g();J.addEventListener("focus",Ne),J.addEventListener("blur",Te),W.push(()=>{J.removeEventListener("focus",Ne),J.removeEventListener("blur",Te)})}if(Ue){const Ne=Te=>{var oe,Pe;(Pe=(oe=E()).onTriggerClick)==null||Pe.call(oe,Te),!Te.defaultPrevented&&T(J)};J.addEventListener("click",Ne),W.push(()=>J.removeEventListener("click",Ne))}return ee},isOpen:Y,entry:()=>a,props:()=>({...c})};return _e},xe.ContextMenu=(...e)=>{const{props:t,children:s}=JSswift.uiNormalizeArgs(e);let l={...t},n=null,i=null,c=null;const a=y=>y&&typeof y=="object"&&!y.nodeType&&!Array.isArray(y)&&!(y instanceof Function),v=y=>!!y&&typeof y=="object"&&(y.nodeType===1||typeof y.getBoundingClientRect=="function"),r=y=>!!y&&typeof y=="object"&&("clientX"in y||"type"in y||"target"in y||"currentTarget"in y),z=y=>!!y&&Number.isFinite(Number(y.x))&&Number.isFinite(Number(y.y)),d=()=>l,k=(y,P)=>{const Q=Number(y),m=Number(P);return!Number.isFinite(Q)||!Number.isFinite(m)?null:{x:Q,y:m}},N=y=>y?{_jssContextPoint:y,getBoundingClientRect:()=>({top:y.y,bottom:y.y,left:y.x,right:y.x,width:0,height:0})}:null,p=y=>{if(!v(y))return null;const P=y.getBoundingClientRect();return k(P.left+Math.min(P.width/2,24),P.top+Math.min(P.height/2,24))},U=y=>{var P,Q,m,b;return o((b=(m=(Q=(P=y==null?void 0:y.anchorEl)!=null?P:y==null?void 0:y.triggerEl)!=null?Q:y==null?void 0:y.target)!=null?m:y==null?void 0:y.anchor)!=null?b:null)},w=(y,P=null)=>{if(!y)return p(P||c);const Q=k(y.clientX,y.clientY);if(Q)return Q;const m=U({anchorEl:P||y.currentTarget||y.target||c});return p(m)},$=(y={})=>{if(!a(y))return{};const P={...y};return delete P.event,delete P.point,delete P.x,delete P.y,P},B=()=>{var y,P,Q;const m=d();return{...m,trigger:"manual",placement:m.placement||"bottom-start",offsetX:(y=m.offsetX)!=null?y:0,offsetY:(Q=(P=m.offsetY)!=null?P:m.offset)!=null?Q:4,closeOnOutside:m.closeOnOutside!==!1,closeOnEsc:m.closeOnEsc!==!1,role:m.role||"menu",ariaLabel:m.ariaLabel||m.title||"Context menu",class:re(["jss-context-menu-shell",m.class]),panelClass:re(["jss-context-menu-panel",m.panelClass])}},te=xe.Menu(B(),...s),E=(y=null,P=null,Q=null)=>{let m=null,b=null,g=null;if(r(y))m=w(y,c),g=a(P)?$(P):null;else if(typeof y=="number"||typeof P=="number")m=k(y,P),g=a(Q)?$(Q):null;else if(z(y))m=k(y.x,y.y),g=a(P)?$(P):null;else if(v(y))b=y,g=a(P)?$(P):null;else if(a(y)){const T=z(y.point)?y.point:z(y)?y:null,Y=U(y),K=y.event;m=T?k(T.x,T.y):w(K,Y||c),b=Y&&v(Y)?Y:null,g={...$(y),...a(P)?$(P):{}}}else n&&(m={...n});return{point:m,anchor:b,nextProps:g}},ve=(y,P=null)=>{i=y||i,n=P||y&&y._jssContextPoint||n},le=(y=null)=>{a(y)&&Object.keys(y).length&&(l={...l,...y})},ie=(y=null,P=null)=>{if(P)return N(P);if(y&&v(y))return y;const Q=U(d());return v(Q)?Q:n?N(n):v(i)?i:v(c)?c:null},ge=(y=null,P=null,Q=null)=>{const{point:m,anchor:b,nextProps:g}=E(y,P,Q);le(g);const T=ie(b,m);return T?(ve(T,m),te.open(T,B())):null},ue=(y,P,Q=null)=>ge(y,P,Q),fe=(y,P=null)=>ge(y,P),M=()=>(te.close(),I),me=(y=!0)=>(y===!1?te.hide(!1):te.close(),I),be=(y=null,P=null,Q=null)=>ge(y,P,Q),de=(y=null,P=null,Q=null)=>te.isOpen()?(M(),null):ge(y,P,Q),Z=(y={})=>(le($(y)),te.update(B()),I),I={open:ge,openAt:ue,openFromEvent:fe,show:be,hide:me,close:M,toggle:de,update:Z,bind:(y,P=null)=>{if(!y)return()=>{};const Q=a(P)?$(P):null,m=g=>{var T,Y;c=y,g.preventDefault(),!(((Y=(T=d()).onTrigger)==null?void 0:Y.call(T,g,{element:y,open:ge,close:M,update:Z}))===!1||o(d().disabled))&&ge({event:g,anchorEl:y},Q)},b=g=>{var T,Y;g.key!=="ContextMenu"&&!(g.shiftKey&&g.key==="F10")||(c=y,g.preventDefault(),((Y=(T=d()).onTrigger)==null?void 0:Y.call(T,g,{element:y,open:ge,close:M,update:Z}))===!1||o(d().disabled))||ge({event:g,anchorEl:y},Q)};return y.addEventListener("contextmenu",m),y.addEventListener("keydown",b),()=>{y.removeEventListener("contextmenu",m),y.removeEventListener("keydown",b)}},isOpen:te.isOpen,entry:te.entry,props:()=>({...l})};return I}})(JSswift);