@ixfx/components 0.15.3 → 0.15.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.d.ts +167 -13
- package/bundle/index.js +202 -164
- package/dist/ac-text.d.ts +1 -1
- package/dist/{ac-token-qEs3FsQv.d.ts → ac-token-Cq7lsYf-.d.ts} +1 -1
- package/dist/ac-token.d.ts +1 -1
- package/dist/colour-picker.d.ts +1 -1
- package/dist/crumbs.d.ts +2 -2
- package/dist/{data-grid-DmkId8bu.d.ts → data-grid-CbiubdG2.d.ts} +4 -4
- package/dist/data-grid.d.ts +2 -2
- package/dist/{detail-list-CmQqeXvp.d.ts → detail-list-ClkMV0SN.d.ts} +4 -4
- package/dist/detail-list.d.ts +3 -3
- package/dist/{flat-list-BmQBB3ZC.d.ts → flat-list-0xTZdXzh.d.ts} +3 -3
- package/dist/flat-list.d.ts +1 -1
- package/dist/{grid-list-BVsUEvgd.d.ts → grid-list-BnWJUIBC.d.ts} +3 -3
- package/dist/grid-list.d.ts +2 -2
- package/dist/{grouped-item-lister-DETte0Dh.d.ts → grouped-item-lister-Bhyo-dkH.d.ts} +1 -1
- package/dist/grouped-item-lister.d.ts +1 -1
- package/dist/{icon-CDGprSdE.d.ts → icon-DR_3rSyZ.d.ts} +1 -1
- package/dist/icons.d.ts +2 -2
- package/dist/incr-search.d.ts +1 -1
- package/dist/{index-DuhzWWTr.d.ts → index-BAuqR9El.d.ts} +28 -8
- package/dist/{index-BvoXLnBf.d.ts → index-BPTuCRGb.d.ts} +2 -2
- package/dist/{index-CoqtMSd9.d.ts → index-BUB5SICW.d.ts} +1 -1
- package/dist/{index-DN2BWctP.d.ts → index-Bz3loIAf.d.ts} +1 -1
- package/dist/{index-UvnoZUAo.d.ts → index-CJ5fshD3.d.ts} +1 -1
- package/dist/{index-DxyyVqzA.d.ts → index-cnaRPQPp.d.ts} +2 -2
- package/dist/{index-CYndvTWH.d.ts → index-garxxqgV.d.ts} +1 -1
- package/dist/index.d.ts +152 -27
- package/dist/index.js +272 -63
- package/dist/{labelled-input-base-DiTme1JO.d.ts → labelled-input-base-Dp_9KP0G.d.ts} +1 -1
- package/dist/labelled-radial-input.d.ts +2 -2
- package/dist/labelled-range-input.d.ts +1 -1
- package/dist/labelled-slider-input.d.ts +1 -1
- package/dist/list-group-header.d.ts +1 -1
- package/dist/{list-native-drag-controller-NMspr0E1.d.ts → list-native-drag-controller-O2Nruqpi.d.ts} +1 -1
- package/dist/{menu-item-bF6narIz.d.ts → menu-item-B0zqw2xp.d.ts} +1 -1
- package/dist/menu.d.ts +2 -2
- package/dist/miller.d.ts +2 -2
- package/dist/panel.d.ts +1 -1
- package/dist/{split-layout-JK3xWVX2.d.ts → split-layout-C5SYbDrq.d.ts} +1 -1
- package/dist/split-layout.d.ts +1 -1
- package/dist/{tab-list-Df371rqw.d.ts → tab-list-wC0xNz1b.d.ts} +1 -1
- package/dist/tabs.d.ts +1 -1
- package/dist/{titlebar-Tqu-VvMU.d.ts → titlebar-B5zSTZnF.d.ts} +1 -1
- package/dist/titlebar.d.ts +1 -1
- package/dist/{tree-2_TRrLAV.js → tree-D8VxvR9u.js} +44 -5
- package/dist/{tree-component-CDsYTBDi.d.ts → tree-component-C6UHO-w9.d.ts} +12 -3
- package/dist/tree.d.ts +3 -3
- package/dist/tree.js +1 -1
- package/dist/{vertical-list-ztrdFvyT.d.ts → vertical-list-B8FoU-pU.d.ts} +2 -2
- package/dist/vertical-list.d.ts +2 -2
- package/docs-user/dock.md +62 -1
- package/docs-user/index.json +2 -2
- package/docs-user/tree.md +39 -0
- package/package.json +1 -1
package/bundle/index.js
CHANGED
|
@@ -4428,7 +4428,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
4428
4428
|
user-select: none;
|
|
4429
4429
|
scroll-snap-align: start;
|
|
4430
4430
|
}
|
|
4431
|
-
`]}};E([d({type:Object})],z.prototype,`root`,void 0),E([d({attribute:!1})],z.prototype,`model`,void 0),E([d({type:Object})],z.prototype,`selectedNode`,void 0),E([m()],z.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],z.prototype,`loadChildren`,void 0),E([d({attribute:!1})],z.prototype,`filterPredicate`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],z.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],z.prototype,`selectionFilter`,void 0),E([m()],z.prototype,`_openIdx`,void 0),E([m()],z.prototype,`_isFocused`,void 0),E([m()],z.prototype,`_menuOpen`,void 0),E([m()],z.prototype,`_focusOnNarrowedText`,void 0),E([d({reflect:!0,attribute:`input-mode`})],z.prototype,`inputMode`,void 0),E([d({type:Boolean,reflect:!0,attribute:`no-truncate`})],z.prototype,`noTruncate`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-suggestions`})],z.prototype,`showSuggestions`,void 0),E([d({type:Boolean,reflect:!0,attribute:`leading-caret`})],z.prototype,`leadingCaret`,void 0),E([d({type:Boolean,reflect:!0,attribute:`caret-embedded`})],z.prototype,`caretEmbedded`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-root`})],z.prototype,`hideRoot`,void 0),E([d({type:Boolean,reflect:!0,attribute:`pad-ending`})],z.prototype,`padEnding`,void 0),E([d({type:Boolean,reflect:!0,attribute:`with-up`})],z.prototype,`withUp`,void 0),z=E([T(`ixfx-crumb-navigation`)],z);var Lg=class{#e=null;#t;#n;#r;#i;constructor(e={}){this.#n=e.separator??`/`,this.#r=e.onQuery,this.#i=e.sortCompare,this.#t=new Eu.Pathed.Pathed({separator:this.#n}),e.paths&&this.addPaths(e.paths)}get separator(){return this.#n}addPath(e){let n=e.split(this.#n).filter(e=>e.length>0);for(let e=0;e<n.length;e++){let r=n.slice(0,e+1).join(this.#n),i={label:n[e]};this.#t.add(i,r)}}addPaths(e){for(let n of e)this.addPath(n)}addSegment(e,n){this.#t.add(e,n)}addSegments(e){for(let{path:n,segment:r}of e)this.addSegment(r,n)}getIcon(e){let n=this.#t.getValue(e);if(n!==void 0)return typeof n==`object`&&n&&`value`in n?n.value?.icon:n.icon}getPath(){return this.#e?.getPath()??``}setPath(e){this.#e?.setPath(e)}#a=e=>this.getIcon(e.join(this.#n));connect(e){this.#e=e,e.separator=this.#n,e.siblingLookup=this.#o.bind(this),e.segmentIconLookup||=this.#a}disconnect(){this.#e&&=(this.#e.siblingLookup=void 0,this.#e.segmentIconLookup===this.#a&&(this.#e.segmentIconLookup=void 0),null)}async#o(e,n,r){let i=e.join(this.#n),a=[...this.#t.children(i)];if(a.length>0){let e=a.map(e=>e.value).filter(e=>e!==void 0).map(e=>`value`in e?e.value??{label:e.label}:{label:e.label});return this.#i?[...e].sort(this.#i):e}if(this.#r){let n=await this.#r(e),a=this.#i?[...n].sort(this.#i):n;for(let e of a){let n=i.length>0?`${i}${this.#n}${e.label}`:e.label;this.#t.add(e,n)}return r.aborted?[]:a}return[]}};const Rg=/[^\w-]/g;let B=class extends n{constructor(...e){super(...e),this.path=``,this.separator=`/`,this.pathRoot=``,this.hintPrevious=!1,this._openIdx=null,this._editing=!1,this._cachedSiblings=new Map,this._leafSegmentIndex=null,this._confirmedLeafIndices=new Set,this._dropdownActiveIndex=-1,this._editingCancelled=!1,this._editStartIndex=null,this._openCumPath=null,this._dragCumPath=null,this._dropCumPath=null,this._hintSegments=null,this.#n=Math.random().toString(36).slice(2,8),this.#r=0,this.#o=e=>{e.newState===`closed`&&this._openIdx!==null&&(this._openIdx=null,this._dropdownActiveIndex=-1,this.#s())},this.#M=e=>{if(this._openIdx===null)return;let n=this._cachedSiblings.get(this._openCumPath??String(this._openIdx))??[];if(!n.length){e.key===`Escape`&&(e.preventDefault(),this.#a());return}switch(e.key){case`ArrowDown`:e.preventDefault(),this._dropdownActiveIndex=(this._dropdownActiveIndex+1)%n.length,this.#N();break;case`ArrowUp`:e.preventDefault(),this._dropdownActiveIndex=this._dropdownActiveIndex<=0?n.length-1:this._dropdownActiveIndex-1,this.#N();break;case`Enter`:this._dropdownActiveIndex>=0&&(e.preventDefault(),this.#A(this._openIdx,n[this._dropdownActiveIndex]));break;case`Escape`:e.preventDefault(),this.#a()}},this.#K=e=>{this._editing||[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Enter`].includes(e.key)||(this._editing=!0)}}#e;#t;#n;#r;#i(e){return`--cp-${this.#n}-${e.replaceAll(this.separator,`-`).replaceAll(` `,`-`).replace(Rg,`-`)}`}#a(){if(this._openIdx!==null){this._openIdx=null,this._openCumPath=null,this._dropdownActiveIndex=-1,this.#s();let e=this.shadowRoot?.querySelector(`.crumb-dropdown`);try{e?.hidePopover()}catch{}}}#o;updated(e){if(this._editing){let e=this.shadowRoot?.querySelector(`ixfx-ac-text`);if(e instanceof n){let n=this.path;if(this._editStartIndex!==null){let r=this.#c()[this._editStartIndex],i=this.path.indexOf(r);e.focusWithValue(n,i)}else e.focusWithValue(n)}}e.has(`_openIdx`)&&this._openIdx!==null&&this.updateComplete.then(()=>{let e=this.shadowRoot?.querySelector(`.crumb-dropdown`);if(e){e.style.setProperty(`position-anchor`,this.#i(this._openCumPath??String(this._openIdx)));try{e.showPopover()}catch{}e.focus()}})}#s(){this.#e&&(this.#e.abort(),this.#e=void 0,this.#t=void 0)}#c(){let e=this.path;return this.pathRoot.length>0&&e.startsWith(this.pathRoot)?e.slice(this.pathRoot.length).split(this.separator).filter(e=>e.length>0):this.path.split(this.separator).filter(e=>e.length>0)}#l(){return this.pathRoot.length===0?[]:this.pathRoot.split(this.separator).filter(e=>e.length>0)}#u(e,n){let r=this.#c(),i=this.#l();return n?i.slice(0,e+1).join(this.separator):[...i,...r.slice(0,e+1)].join(this.separator)}#d(e,n){let r=this.#l();return n?r.slice(0,e+1):[...r,...this.#c().slice(0,e+1)]}#f(e){try{let n=this.segmentDragLookup?.(e,e.length-1);return n==null?[]:Array.isArray(n)?[...n]:[n]}catch{return[]}}#p(){return Date.now()<this.#r||this._dragCumPath!==null}#m(e,n){return e.length<=n.length&&e.every((e,r)=>e===n[r])}#h(e,n){if(!this.hintPrevious)return;let r=this._hintSegments;r!==null&&this.#m(n,r)||(this._hintSegments=e)}#g(e,n){let r=this.segmentIconLookup?.(e,n);if(typeof r==`string`&&r.length>0)return r;let i=e[n];if(i===void 0)return;let a=e.slice(0,n).join(this.separator);return this._cachedSiblings.get(a)?.find(e=>e.label===i)?.icon}setPath(e){this.#s(),this.pathRoot.length>0&&!e.startsWith(this.pathRoot)&&(e=this.pathRoot),e!==this.path&&(this.path=e,this._cachedSiblings=new Map,this._openIdx=null,this._leafSegmentIndex=null,this._confirmedLeafIndices=new Set)}invalidateSiblings(){this._cachedSiblings=new Map,this._leafSegmentIndex=null,this._confirmedLeafIndices=new Set}getPath(){return this.path}#_(e,n){if(n.preventDefault(),n.stopPropagation(),this._openIdx===e){this.#a();return}let r=n.currentTarget.dataset.cumulative;this._openIdx=e,this._openCumPath=r??null,this._dropdownActiveIndex=-1;let i=this.#c(),a=this.#l(),o=r?r.split(this.separator).filter(e=>e.length>0):e===-1?a:i.slice(0,e+1),s=r??String(e);if(!this._cachedSiblings.has(s)&&this.siblingLookup){this.#s();let n=new AbortController;this.#e=n,this.#t=e,this.siblingLookup(o,e,n.signal).then(e=>{n.signal.aborted||(this._cachedSiblings.set(s,e),e.length===0&&this._confirmedLeafIndices.add(r??``),this.#e=void 0,this.#t=void 0,this.requestUpdate())}).catch(e=>{e.name!==`AbortError`&&console.error(`Sibling lookup failed:`,e),this.#e=void 0,this.#t=void 0}),this.dispatchEvent(new CustomEvent(`expand`,{detail:{index:e,segments:o,path:o.join(this.separator),signal:n.signal},bubbles:!0,composed:!0}))}this.requestUpdate()}#v(e,n,r){this.#a();let i=e.length-1,a=r.dataTransfer,o={index:i,label:e[i]??``,pathSegments:e,parentPath:e.slice(0,-1).join(this.separator),fullPath:e.join(this.separator),dataTransfer:a},s=new CustomEvent(`crumb-drag-start`,{detail:o,bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(s)){r.preventDefault();return}if(this._dragCumPath=n,this.toggleAttribute(`data-native-dragging`,!0),a){try{(a.effectAllowed===`none`||a.effectAllowed===`uninitialized`)&&(a.effectAllowed=`copyMove`)}catch{}try{for(let n of this.#f(e))a.setData(n.type,n.data);a.types.includes(`text/plain`)||a.setData(`text/plain`,o.fullPath)}catch{}}}#y(){this._dragCumPath=null,this._dropCumPath=null,this.toggleAttribute(`data-native-dragging`,!1),this.#r=Date.now()+150}#b(e,n){this.parseExternalDrop&&n.dataTransfer&&(n.preventDefault(),this._dropCumPath!==e&&(this._dropCumPath=e))}#x(e,n){this.parseExternalDrop&&this._dropCumPath===e&&(this._dropCumPath=null)}#S(e,n){if(!this.parseExternalDrop)return;n.preventDefault(),n.stopPropagation(),this._dropCumPath=null;let r=n.dataTransfer;if(!r)return;let i;try{i=this.parseExternalDrop(r)}catch(e){console.error(`parseExternalDrop failed:`,e);return}if(i===void 0)return;let a=e.length-1;this.dispatchEvent(new CustomEvent(`crumb-drop`,{detail:{index:a,label:e[a]??``,pathSegments:e,parentPath:e.slice(0,-1).join(this.separator),fullPath:e.join(this.separator),data:i,dataTransfer:r},bubbles:!0,composed:!0}))}#C(){let e=this.#c();if(e.length>0){let n=e.length-1;return{cumPath:this.#u(n,!1),fullPathSegments:this.#d(n,!1)}}let n=this.#l();if(n.length>0){let e=n.length-1;return{cumPath:this.#u(e,!0),fullPathSegments:this.#d(e,!0)}}}#w(e){return!!e.target?.closest?.(`.seg:not(.seg-virtual)`)}#T(e){if(!this.parseExternalDrop||!e.dataTransfer||this.#w(e))return;let n=this.#C();n&&(e.preventDefault(),this._dropCumPath!==n.cumPath&&(this._dropCumPath=n.cumPath))}#E(e){if(!this.parseExternalDrop||this.#w(e))return;let n=this.#C();n&&this._dropCumPath===n.cumPath&&(this._dropCumPath=null)}#D(e){if(!this.parseExternalDrop||this.#w(e))return;let n=this.#C();n&&this.#S(n.fullPathSegments,e)}#O(e,n){if(this.#p())return;n.preventDefault(),n.stopPropagation(),this.#a();let r=this.#c(),i=r.slice(0,e+1);this.#h(r,i);let a=this.path.startsWith(this.separator),o=i.join(this.separator);this.path=a?this.separator+o:o,this._cachedSiblings=new Map,this._leafSegmentIndex=null;let s=i.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:i[e],parentPath:s,fullPath:o},bubbles:!0,composed:!0}))}#k(e,n){if(this.#p())return;n.preventDefault(),n.stopPropagation(),this.#a();let r=this._hintSegments;if(!r)return;let i=r.slice(0,e+1),a=this.path.startsWith(this.separator),o=i.join(this.separator);this.path=a?this.separator+o:o,this._cachedSiblings=new Map,this._leafSegmentIndex=null;let s=i.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:i[e],parentPath:s,fullPath:o},bubbles:!0,composed:!0}))}#A(e,n){let r=this._openCumPath;this.#a();let i=this.#c(),a=this.#l(),o;o=r?[...r.split(this.separator).filter(e=>e.length>0),n.label]:this.pathRoot.length>0&&e<a.length?[...a.slice(0,e+1),n.label]:[...a,...i.slice(0,e+1-a.length),n.label];let s=this.path.startsWith(this.separator),c=o.join(this.separator);this.path=s?this.separator+c:c,this._cachedSiblings=new Map;let l=n.isLeaf?o.length-1:null;this._leafSegmentIndex=l,n.isLeaf&&this._confirmedLeafIndices.add(r??``);let u=o.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:n.label,parentPath:u,fullPath:c},bubbles:!0,composed:!0}))}#j(e,n,r){r.preventDefault(),r.stopPropagation(),this.#A(e,n)}#M;#N(){this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`.crumb-option.active`)?.scrollIntoView({block:`nearest`})})}#P(e){let n=this._cachedSiblings.get(this._openCumPath??String(e))??[],r=this.#t===e;return i`
|
|
4431
|
+
`]}};E([d({type:Object})],z.prototype,`root`,void 0),E([d({attribute:!1})],z.prototype,`model`,void 0),E([d({type:Object})],z.prototype,`selectedNode`,void 0),E([m()],z.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],z.prototype,`loadChildren`,void 0),E([d({attribute:!1})],z.prototype,`filterPredicate`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],z.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],z.prototype,`selectionFilter`,void 0),E([m()],z.prototype,`_openIdx`,void 0),E([m()],z.prototype,`_isFocused`,void 0),E([m()],z.prototype,`_menuOpen`,void 0),E([m()],z.prototype,`_focusOnNarrowedText`,void 0),E([d({reflect:!0,attribute:`input-mode`})],z.prototype,`inputMode`,void 0),E([d({type:Boolean,reflect:!0,attribute:`no-truncate`})],z.prototype,`noTruncate`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-suggestions`})],z.prototype,`showSuggestions`,void 0),E([d({type:Boolean,reflect:!0,attribute:`leading-caret`})],z.prototype,`leadingCaret`,void 0),E([d({type:Boolean,reflect:!0,attribute:`caret-embedded`})],z.prototype,`caretEmbedded`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-root`})],z.prototype,`hideRoot`,void 0),E([d({type:Boolean,reflect:!0,attribute:`pad-ending`})],z.prototype,`padEnding`,void 0),E([d({type:Boolean,reflect:!0,attribute:`with-up`})],z.prototype,`withUp`,void 0),z=E([T(`ixfx-crumb-navigation`)],z);var Lg=class{#e=null;#t;#n;#r;#i;constructor(e={}){this.#n=e.separator??`/`,this.#r=e.onQuery,this.#i=e.sortCompare,this.#t=new Eu.Pathed.Pathed({separator:this.#n}),e.paths&&this.addPaths(e.paths)}get separator(){return this.#n}addPath(e){let n=e.split(this.#n).filter(e=>e.length>0);for(let e=0;e<n.length;e++){let r=n.slice(0,e+1).join(this.#n),i={label:n[e]};this.#t.add(i,r)}}addPaths(e){for(let n of e)this.addPath(n)}addSegment(e,n){this.#t.add(e,n)}addSegments(e){for(let{path:n,segment:r}of e)this.addSegment(r,n)}getIcon(e){let n=this.#t.getValue(e);if(n!==void 0)return typeof n==`object`&&n&&`value`in n?n.value?.icon:n.icon}getPath(){return this.#e?.getPath()??``}setPath(e){this.#e?.setPath(e)}#a=e=>this.getIcon(e.join(this.#n));connect(e){this.#e=e,e.separator=this.#n,e.siblingLookup=this.#o.bind(this),e.segmentIconLookup||=this.#a}disconnect(){this.#e&&=(this.#e.siblingLookup=void 0,this.#e.segmentIconLookup===this.#a&&(this.#e.segmentIconLookup=void 0),null)}async#o(e,n,r){let i=e.join(this.#n),a=[...this.#t.children(i)];if(a.length>0){let e=a.map(e=>e.value).filter(e=>e!==void 0).map(e=>`value`in e?e.value??{label:e.label}:{label:e.label});return this.#i?[...e].sort(this.#i):e}if(this.#r){let n=await this.#r(e),a=this.#i?[...n].sort(this.#i):n;for(let e of a){let n=i.length>0?`${i}${this.#n}${e.label}`:e.label;this.#t.add(e,n)}return r.aborted?[]:a}return[]}};const Rg=/[^\w-]/g;let zg=class extends n{constructor(...e){super(...e),this.path=``,this.separator=`/`,this.pathRoot=``,this.hintPrevious=!1,this._openIdx=null,this._editing=!1,this._cachedSiblings=new Map,this._leafSegmentIndex=null,this._confirmedLeafIndices=new Set,this._dropdownActiveIndex=-1,this._editingCancelled=!1,this._editStartIndex=null,this._openCumPath=null,this._dragCumPath=null,this._dropCumPath=null,this._hintSegments=null,this.#n=Math.random().toString(36).slice(2,8),this.#r=0,this.#o=e=>{e.newState===`closed`&&this._openIdx!==null&&(this._openIdx=null,this._dropdownActiveIndex=-1,this.#s())},this.#M=e=>{if(this._openIdx===null)return;let n=this._cachedSiblings.get(this._openCumPath??String(this._openIdx))??[];if(!n.length){e.key===`Escape`&&(e.preventDefault(),this.#a());return}switch(e.key){case`ArrowDown`:e.preventDefault(),this._dropdownActiveIndex=(this._dropdownActiveIndex+1)%n.length,this.#N();break;case`ArrowUp`:e.preventDefault(),this._dropdownActiveIndex=this._dropdownActiveIndex<=0?n.length-1:this._dropdownActiveIndex-1,this.#N();break;case`Enter`:this._dropdownActiveIndex>=0&&(e.preventDefault(),this.#A(this._openIdx,n[this._dropdownActiveIndex]));break;case`Escape`:e.preventDefault(),this.#a()}},this.#K=e=>{this._editing||[`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`Enter`].includes(e.key)||(this._editing=!0)}}#e;#t;#n;#r;#i(e){return`--cp-${this.#n}-${e.replaceAll(this.separator,`-`).replaceAll(` `,`-`).replace(Rg,`-`)}`}#a(){if(this._openIdx!==null){this._openIdx=null,this._openCumPath=null,this._dropdownActiveIndex=-1,this.#s();let e=this.shadowRoot?.querySelector(`.crumb-dropdown`);try{e?.hidePopover()}catch{}}}#o;updated(e){if(this._editing){let e=this.shadowRoot?.querySelector(`ixfx-ac-text`);if(e instanceof n){let n=this.path;if(this._editStartIndex!==null){let r=this.#c()[this._editStartIndex],i=this.path.indexOf(r);e.focusWithValue(n,i)}else e.focusWithValue(n)}}e.has(`_openIdx`)&&this._openIdx!==null&&this.updateComplete.then(()=>{let e=this.shadowRoot?.querySelector(`.crumb-dropdown`);if(e){e.style.setProperty(`position-anchor`,this.#i(this._openCumPath??String(this._openIdx)));try{e.showPopover()}catch{}e.focus()}})}#s(){this.#e&&(this.#e.abort(),this.#e=void 0,this.#t=void 0)}#c(){let e=this.path;return this.pathRoot.length>0&&e.startsWith(this.pathRoot)?e.slice(this.pathRoot.length).split(this.separator).filter(e=>e.length>0):this.path.split(this.separator).filter(e=>e.length>0)}#l(){return this.pathRoot.length===0?[]:this.pathRoot.split(this.separator).filter(e=>e.length>0)}#u(e,n){let r=this.#c(),i=this.#l();return n?i.slice(0,e+1).join(this.separator):[...i,...r.slice(0,e+1)].join(this.separator)}#d(e,n){let r=this.#l();return n?r.slice(0,e+1):[...r,...this.#c().slice(0,e+1)]}#f(e){try{let n=this.segmentDragLookup?.(e,e.length-1);return n==null?[]:Array.isArray(n)?[...n]:[n]}catch{return[]}}#p(){return Date.now()<this.#r||this._dragCumPath!==null}#m(e,n){return e.length<=n.length&&e.every((e,r)=>e===n[r])}#h(e,n){if(!this.hintPrevious)return;let r=this._hintSegments;r!==null&&this.#m(n,r)||(this._hintSegments=e)}#g(e,n){let r=this.segmentIconLookup?.(e,n);if(typeof r==`string`&&r.length>0)return r;let i=e[n];if(i===void 0)return;let a=e.slice(0,n).join(this.separator);return this._cachedSiblings.get(a)?.find(e=>e.label===i)?.icon}setPath(e){this.#s(),this.pathRoot.length>0&&!e.startsWith(this.pathRoot)&&(e=this.pathRoot),e!==this.path&&(this.path=e,this._cachedSiblings=new Map,this._openIdx=null,this._leafSegmentIndex=null,this._confirmedLeafIndices=new Set)}invalidateSiblings(){this._cachedSiblings=new Map,this._leafSegmentIndex=null,this._confirmedLeafIndices=new Set}getPath(){return this.path}#_(e,n){if(n.preventDefault(),n.stopPropagation(),this._openIdx===e){this.#a();return}let r=n.currentTarget.dataset.cumulative;this._openIdx=e,this._openCumPath=r??null,this._dropdownActiveIndex=-1;let i=this.#c(),a=this.#l(),o=r?r.split(this.separator).filter(e=>e.length>0):e===-1?a:i.slice(0,e+1),s=r??String(e);if(!this._cachedSiblings.has(s)&&this.siblingLookup){this.#s();let n=new AbortController;this.#e=n,this.#t=e,this.siblingLookup(o,e,n.signal).then(e=>{n.signal.aborted||(this._cachedSiblings.set(s,e),e.length===0&&this._confirmedLeafIndices.add(r??``),this.#e=void 0,this.#t=void 0,this.requestUpdate())}).catch(e=>{e.name!==`AbortError`&&console.error(`Sibling lookup failed:`,e),this.#e=void 0,this.#t=void 0}),this.dispatchEvent(new CustomEvent(`expand`,{detail:{index:e,segments:o,path:o.join(this.separator),signal:n.signal},bubbles:!0,composed:!0}))}this.requestUpdate()}#v(e,n,r){this.#a();let i=e.length-1,a=r.dataTransfer,o={index:i,label:e[i]??``,pathSegments:e,parentPath:e.slice(0,-1).join(this.separator),fullPath:e.join(this.separator),dataTransfer:a},s=new CustomEvent(`crumb-drag-start`,{detail:o,bubbles:!0,composed:!0,cancelable:!0});if(!this.dispatchEvent(s)){r.preventDefault();return}if(this._dragCumPath=n,this.toggleAttribute(`data-native-dragging`,!0),a){try{(a.effectAllowed===`none`||a.effectAllowed===`uninitialized`)&&(a.effectAllowed=`copyMove`)}catch{}try{for(let n of this.#f(e))a.setData(n.type,n.data);a.types.includes(`text/plain`)||a.setData(`text/plain`,o.fullPath)}catch{}}}#y(){this._dragCumPath=null,this._dropCumPath=null,this.toggleAttribute(`data-native-dragging`,!1),this.#r=Date.now()+150}#b(e,n){this.parseExternalDrop&&n.dataTransfer&&(n.preventDefault(),this._dropCumPath!==e&&(this._dropCumPath=e))}#x(e,n){this.parseExternalDrop&&this._dropCumPath===e&&(this._dropCumPath=null)}#S(e,n){if(!this.parseExternalDrop)return;n.preventDefault(),n.stopPropagation(),this._dropCumPath=null;let r=n.dataTransfer;if(!r)return;let i;try{i=this.parseExternalDrop(r)}catch(e){console.error(`parseExternalDrop failed:`,e);return}if(i===void 0)return;let a=e.length-1;this.dispatchEvent(new CustomEvent(`crumb-drop`,{detail:{index:a,label:e[a]??``,pathSegments:e,parentPath:e.slice(0,-1).join(this.separator),fullPath:e.join(this.separator),data:i,dataTransfer:r},bubbles:!0,composed:!0}))}#C(){let e=this.#c();if(e.length>0){let n=e.length-1;return{cumPath:this.#u(n,!1),fullPathSegments:this.#d(n,!1)}}let n=this.#l();if(n.length>0){let e=n.length-1;return{cumPath:this.#u(e,!0),fullPathSegments:this.#d(e,!0)}}}#w(e){return!!e.target?.closest?.(`.seg:not(.seg-virtual)`)}#T(e){if(!this.parseExternalDrop||!e.dataTransfer||this.#w(e))return;let n=this.#C();n&&(e.preventDefault(),this._dropCumPath!==n.cumPath&&(this._dropCumPath=n.cumPath))}#E(e){if(!this.parseExternalDrop||this.#w(e))return;let n=this.#C();n&&this._dropCumPath===n.cumPath&&(this._dropCumPath=null)}#D(e){if(!this.parseExternalDrop||this.#w(e))return;let n=this.#C();n&&this.#S(n.fullPathSegments,e)}#O(e,n){if(this.#p())return;n.preventDefault(),n.stopPropagation(),this.#a();let r=this.#c(),i=r.slice(0,e+1);this.#h(r,i);let a=this.path.startsWith(this.separator),o=i.join(this.separator);this.path=a?this.separator+o:o,this._cachedSiblings=new Map,this._leafSegmentIndex=null;let s=i.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:i[e],parentPath:s,fullPath:o},bubbles:!0,composed:!0}))}#k(e,n){if(this.#p())return;n.preventDefault(),n.stopPropagation(),this.#a();let r=this._hintSegments;if(!r)return;let i=r.slice(0,e+1),a=this.path.startsWith(this.separator),o=i.join(this.separator);this.path=a?this.separator+o:o,this._cachedSiblings=new Map,this._leafSegmentIndex=null;let s=i.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:i[e],parentPath:s,fullPath:o},bubbles:!0,composed:!0}))}#A(e,n){let r=this._openCumPath;this.#a();let i=this.#c(),a=this.#l(),o;o=r?[...r.split(this.separator).filter(e=>e.length>0),n.label]:this.pathRoot.length>0&&e<a.length?[...a.slice(0,e+1),n.label]:[...a,...i.slice(0,e+1-a.length),n.label];let s=this.path.startsWith(this.separator),c=o.join(this.separator);this.path=s?this.separator+c:c,this._cachedSiblings=new Map;let l=n.isLeaf?o.length-1:null;this._leafSegmentIndex=l,n.isLeaf&&this._confirmedLeafIndices.add(r??``);let u=o.slice(0,-1).join(this.separator);this.dispatchEvent(new CustomEvent(`navigate`,{detail:{index:e,label:n.label,parentPath:u,fullPath:c},bubbles:!0,composed:!0}))}#j(e,n,r){r.preventDefault(),r.stopPropagation(),this.#A(e,n)}#M;#N(){this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`.crumb-option.active`)?.scrollIntoView({block:`nearest`})})}#P(e){let n=this._cachedSiblings.get(this._openCumPath??String(e))??[],r=this.#t===e;return i`
|
|
4432
4432
|
${r?i`<span class="loading-spinner"></span>`:a}
|
|
4433
4433
|
${n.length===0&&!r?i`<span class="crumb-option crumb-option-label">No items</span>`:n.map((n,r)=>i`
|
|
4434
4434
|
<div class="crumb-option ${r===this._dropdownActiveIndex?`active`:``}"
|
|
@@ -4731,7 +4731,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
4731
4731
|
@keyframes crumb-spin {
|
|
4732
4732
|
to { transform: rotate(360deg); }
|
|
4733
4733
|
}
|
|
4734
|
-
`]}};E([d({type:String})],
|
|
4734
|
+
`]}};E([d({type:String})],zg.prototype,`path`,void 0),E([d({type:String})],zg.prototype,`separator`,void 0),E([d({type:String,attribute:`path-root`})],zg.prototype,`pathRoot`,void 0),E([d({type:Object})],zg.prototype,`siblingLookup`,void 0),E([d({type:Object})],zg.prototype,`segmentIconLookup`,void 0),E([d({type:Object})],zg.prototype,`segmentDragLookup`,void 0),E([d({type:Object})],zg.prototype,`parseExternalDrop`,void 0),E([d({type:Boolean,attribute:`hint-previous`})],zg.prototype,`hintPrevious`,void 0),E([m()],zg.prototype,`_openIdx`,void 0),E([m()],zg.prototype,`_editing`,void 0),E([m()],zg.prototype,`_cachedSiblings`,void 0),E([m()],zg.prototype,`_leafSegmentIndex`,void 0),E([m()],zg.prototype,`_confirmedLeafIndices`,void 0),E([m()],zg.prototype,`_dropdownActiveIndex`,void 0),E([m()],zg.prototype,`_editingCancelled`,void 0),E([m()],zg.prototype,`_editStartIndex`,void 0),E([m()],zg.prototype,`_openCumPath`,void 0),E([m()],zg.prototype,`_dragCumPath`,void 0),E([m()],zg.prototype,`_dropCumPath`,void 0),E([m()],zg.prototype,`_hintSegments`,void 0),zg=E([T(`ixfx-crumb-path`)],zg);let Bg=class extends n{static{this.styles=[w,r`
|
|
4735
4735
|
:host {
|
|
4736
4736
|
display: block;
|
|
4737
4737
|
width: fit-content;
|
|
@@ -4765,7 +4765,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
4765
4765
|
font-variant-numeric: tabular-nums;
|
|
4766
4766
|
white-space: pre;
|
|
4767
4767
|
}
|
|
4768
|
-
`]}#e;#t;#n;#r;constructor(){super(),this.automap=!1,this.#e=new Map,this.#t=new Map,this.#n=new Map,this._container=document.createElement(`section`)}connectedCallback(){super.connectedCallback(),this.renderRoot.append(this._container)}configure(e){this.#e.clear();for(let[n,r,i]of e)this.#e.set(n,{style:r,options:i});this._container.innerHTML=``,this.#t.clear(),this.#n.clear(),this.#r!==void 0&&this.#i(this.#r)}formatValue(e,n={}){if(e===null)return`(null)`;if(e===void 0)return`(undefined)`;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`string`)return`"${e}"`;if(typeof e==`number`){let r=e;if(n.roundNumbers!==void 0&&(r=ci(n.roundNumbers,e)),n.precision!==void 0)return r.toFixed(n.precision);let i=r.toFixed(2);return r>=0?` ${i}`:i}return JSON.stringify(e)}displayData(e){if(e===null){this.innerHTML=``;return}this.#i(e)}updateData(e){this.#r=e,this.#i(e),this.previousValue=e}getOrCreate(e,n){let r=this.renderRoot.querySelector(`#${e}`);if(r!==null)return r;let i=document.createElement(`div`);return i.id=e,n&&n(i),this._container.append(i),i}#i(e){let n=new Set;this.#a(e,``,n),this.#y(n)}#a(e,n,r){for(let[i,a]of Object.entries(e)){let e=n?`${n}.${i}`:i;r.add(e);let o=this.#e.get(e);if(o!==void 0){if(o.style!==`hide`){let n=this.#c(e,i);this.#l(n,e,o.style,a,o.options)}continue}if(typeof a==`object`&&a&&!Array.isArray(a)){if(this.#o(e))this.#a(a,e,r);else if(this.automap){let n=this.#c(e,i);this.#v(n,a,!0)}else{let n=this.#c(e,i);this.#v(n,a)}}else{let n=this.#s(a);if(n!==void 0){let r=this.#c(e,i);this.#l(r,e,n,a,void 0)}else{let n=this.#c(e,i);this.#_(n,this.formatValue(a))}}}}#o(e){let n=e?`${e}.`:``;for(let e of this.#e.keys())if(e.startsWith(n))return!0;return!1}#s(e){if(this.automap){if(typeof e==`boolean`)return`led`;if(typeof e==`number`)return`plot`}}#c(e,n){let r=`path-${e}`,i=this.renderRoot.querySelector(`#${CSS.escape(r)}`);if(i!==null)return i;i=document.createElement(`div`),i.id=r,i.classList.add(`row`);let a=document.createElement(`label`);return a.textContent=n,i.append(a),this._container.append(i),i}#l(e,n,r,i,a){let o=this.#u(r,i);if(o===null)return;let s=this.#d(e,o);s!==null&&this.#f(s,o,r,n,i,a)}#u(e,n){switch(e){case`hide`:return null;case`led`:return`ixfx-led`;case`plot`:return typeof n==`number`?`ixfx-plot-single-axis`:typeof n==`object`&&n?`ixfx-plot-multi-axis`:`span`;case`plot-xy`:return`ixfx-plot-xy-axis`;case`plot-heat`:case`plot-histogram`:return`ixfx-plot-histogram`;case`time-elapsed`:return`span`}}#d(e,n){let r=e.querySelector(`:scope > [data-renderer]`);if(r!==null){if(r.tagName.toLowerCase()===n)return r;r.remove()}let i=document.createElement(n);return i.dataset.renderer=``,n.startsWith(`ixfx-plot`)&&(i.style.height=`1.4em`,n===`ixfx-plot-xy-axis`?i.style.width=`1.4em`:i.style.width=`5em`),e.append(i),i}#f(e,n,r,i,a,o){let s=this.#t.get(i)!==a;switch(r){case`led`:this.#p(e,i,a,o);break;case`plot`:if(typeof a==`number`)s&&e.add(a);else if(typeof a==`object`&&a&&s){if(Array.isArray(a)){let n={};a.forEach((e,r)=>{typeof e==`number`&&(n[String(r)]=e)}),Object.keys(n).length>0&&e.addData(n)}else e.addData(a)}this.#h(e,r,o);break;case`plot-xy`:s&&this.#m(e,a),this.#h(e,r,o);break;case`plot-heat`:e.style.setProperty(`--plot-histogram-bar-length`,`1`);case`plot-histogram`:typeof a==`number`&&s&&e.add(a),this.#h(e,r,o);break;case`time-elapsed`:e.textContent=this.#g(a)}this.#t.set(i,a)}#p(e,n,r,i){let a=e;if(typeof r==`boolean`)a.lit=r,a.value=+!!r;else if(typeof r==`number`){let e=this.#n.get(n);e===void 0&&(e=hi(),this.#n.set(n,e));let i=e.seen(r),o=i.max===i.min?.5:(r-i.min)/(i.max-i.min);a.value=o,a.lit=o>.3}i?.color!==void 0&&(a.color=i.color)}#m(e,n){let r=e;if(Array.isArray(n)&&n.length>=2)r.add(n[0],n[1]);else if(typeof n==`object`&&n){let e=n;if(`x`in e&&`y`in e)r.add(e.x,e.y);else{let n=Object.entries(e).filter(([e,n])=>typeof n==`number`);n.length>=2&&r.add(n[0][1],n[1][1])}}}#h(e,n,r){if(r===void 0)return;let i=e;typeof r.capacity==`number`&&(i.capacity=r.capacity),typeof r.resolution==`number`&&(i.resolution=r.resolution),typeof r.drawStyle==`string`&&(i.drawStyle=r.drawStyle),typeof r.orientation==`string`&&(i.orientation=r.orientation),typeof r.layout==`string`&&(i.layout=r.layout)}#g(e){let n;if(e instanceof Date)n=e.getTime();else if(typeof e==`number`)n=e>0xe8d4a51000?e:Date.now();else if(typeof e==`string`)n=new Date(e).getTime();else return String(e);if(Number.isNaN(n))return String(e);let r=Date.now()-n,i=Math.abs(r);return i<1e3?`${i}ms`:i<6e4?`${(i/1e3).toFixed(1)}s`:i<36e5?`${(i/6e4).toFixed(1)}mins`:i<864e5?`${(i/36e5).toFixed(1)}h`:`${(i/864e5).toFixed(1)}d`}#_(e,n){let r=e.querySelector(`:scope > .value`);r===null&&(r=document.createElement(`span`),r.classList.add(`value`),e.append(r)),r.textContent=n}#v(e,n,r=!1){let i=e.querySelector(`:scope > ixfx-data-display`);i===null&&(i=document.createElement(`ixfx-data-display`),e.append(i)),i.automap=r,i.updateData(n)}#y(e){let n=this._container.querySelectorAll(`[id^="path-"]`);for(let r of n){let n=r.id.slice(5);e.has(n)||(r.remove(),this.#n.delete(n),this.#t.delete(n))}}};E([d({type:Boolean})],
|
|
4768
|
+
`]}#e;#t;#n;#r;constructor(){super(),this.automap=!1,this.#e=new Map,this.#t=new Map,this.#n=new Map,this._container=document.createElement(`section`)}connectedCallback(){super.connectedCallback(),this.renderRoot.append(this._container)}configure(e){this.#e.clear();for(let[n,r,i]of e)this.#e.set(n,{style:r,options:i});this._container.innerHTML=``,this.#t.clear(),this.#n.clear(),this.#r!==void 0&&this.#i(this.#r)}formatValue(e,n={}){if(e===null)return`(null)`;if(e===void 0)return`(undefined)`;if(typeof e==`boolean`)return e?`true`:`false`;if(typeof e==`string`)return`"${e}"`;if(typeof e==`number`){let r=e;if(n.roundNumbers!==void 0&&(r=ci(n.roundNumbers,e)),n.precision!==void 0)return r.toFixed(n.precision);let i=r.toFixed(2);return r>=0?` ${i}`:i}return JSON.stringify(e)}displayData(e){if(e===null){this.innerHTML=``;return}this.#i(e)}updateData(e){this.#r=e,this.#i(e),this.previousValue=e}getOrCreate(e,n){let r=this.renderRoot.querySelector(`#${e}`);if(r!==null)return r;let i=document.createElement(`div`);return i.id=e,n&&n(i),this._container.append(i),i}#i(e){let n=new Set;this.#a(e,``,n),this.#y(n)}#a(e,n,r){for(let[i,a]of Object.entries(e)){let e=n?`${n}.${i}`:i;r.add(e);let o=this.#e.get(e);if(o!==void 0){if(o.style!==`hide`){let n=this.#c(e,i);this.#l(n,e,o.style,a,o.options)}continue}if(typeof a==`object`&&a&&!Array.isArray(a)){if(this.#o(e))this.#a(a,e,r);else if(this.automap){let n=this.#c(e,i);this.#v(n,a,!0)}else{let n=this.#c(e,i);this.#v(n,a)}}else{let n=this.#s(a);if(n!==void 0){let r=this.#c(e,i);this.#l(r,e,n,a,void 0)}else{let n=this.#c(e,i);this.#_(n,this.formatValue(a))}}}}#o(e){let n=e?`${e}.`:``;for(let e of this.#e.keys())if(e.startsWith(n))return!0;return!1}#s(e){if(this.automap){if(typeof e==`boolean`)return`led`;if(typeof e==`number`)return`plot`}}#c(e,n){let r=`path-${e}`,i=this.renderRoot.querySelector(`#${CSS.escape(r)}`);if(i!==null)return i;i=document.createElement(`div`),i.id=r,i.classList.add(`row`);let a=document.createElement(`label`);return a.textContent=n,i.append(a),this._container.append(i),i}#l(e,n,r,i,a){let o=this.#u(r,i);if(o===null)return;let s=this.#d(e,o);s!==null&&this.#f(s,o,r,n,i,a)}#u(e,n){switch(e){case`hide`:return null;case`led`:return`ixfx-led`;case`plot`:return typeof n==`number`?`ixfx-plot-single-axis`:typeof n==`object`&&n?`ixfx-plot-multi-axis`:`span`;case`plot-xy`:return`ixfx-plot-xy-axis`;case`plot-heat`:case`plot-histogram`:return`ixfx-plot-histogram`;case`time-elapsed`:return`span`}}#d(e,n){let r=e.querySelector(`:scope > [data-renderer]`);if(r!==null){if(r.tagName.toLowerCase()===n)return r;r.remove()}let i=document.createElement(n);return i.dataset.renderer=``,n.startsWith(`ixfx-plot`)&&(i.style.height=`1.4em`,n===`ixfx-plot-xy-axis`?i.style.width=`1.4em`:i.style.width=`5em`),e.append(i),i}#f(e,n,r,i,a,o){let s=this.#t.get(i)!==a;switch(r){case`led`:this.#p(e,i,a,o);break;case`plot`:if(typeof a==`number`)s&&e.add(a);else if(typeof a==`object`&&a&&s){if(Array.isArray(a)){let n={};a.forEach((e,r)=>{typeof e==`number`&&(n[String(r)]=e)}),Object.keys(n).length>0&&e.addData(n)}else e.addData(a)}this.#h(e,r,o);break;case`plot-xy`:s&&this.#m(e,a),this.#h(e,r,o);break;case`plot-heat`:e.style.setProperty(`--plot-histogram-bar-length`,`1`);case`plot-histogram`:typeof a==`number`&&s&&e.add(a),this.#h(e,r,o);break;case`time-elapsed`:e.textContent=this.#g(a)}this.#t.set(i,a)}#p(e,n,r,i){let a=e;if(typeof r==`boolean`)a.lit=r,a.value=+!!r;else if(typeof r==`number`){let e=this.#n.get(n);e===void 0&&(e=hi(),this.#n.set(n,e));let i=e.seen(r),o=i.max===i.min?.5:(r-i.min)/(i.max-i.min);a.value=o,a.lit=o>.3}i?.color!==void 0&&(a.color=i.color)}#m(e,n){let r=e;if(Array.isArray(n)&&n.length>=2)r.add(n[0],n[1]);else if(typeof n==`object`&&n){let e=n;if(`x`in e&&`y`in e)r.add(e.x,e.y);else{let n=Object.entries(e).filter(([e,n])=>typeof n==`number`);n.length>=2&&r.add(n[0][1],n[1][1])}}}#h(e,n,r){if(r===void 0)return;let i=e;typeof r.capacity==`number`&&(i.capacity=r.capacity),typeof r.resolution==`number`&&(i.resolution=r.resolution),typeof r.drawStyle==`string`&&(i.drawStyle=r.drawStyle),typeof r.orientation==`string`&&(i.orientation=r.orientation),typeof r.layout==`string`&&(i.layout=r.layout)}#g(e){let n;if(e instanceof Date)n=e.getTime();else if(typeof e==`number`)n=e>0xe8d4a51000?e:Date.now();else if(typeof e==`string`)n=new Date(e).getTime();else return String(e);if(Number.isNaN(n))return String(e);let r=Date.now()-n,i=Math.abs(r);return i<1e3?`${i}ms`:i<6e4?`${(i/1e3).toFixed(1)}s`:i<36e5?`${(i/6e4).toFixed(1)}mins`:i<864e5?`${(i/36e5).toFixed(1)}h`:`${(i/864e5).toFixed(1)}d`}#_(e,n){let r=e.querySelector(`:scope > .value`);r===null&&(r=document.createElement(`span`),r.classList.add(`value`),e.append(r)),r.textContent=n}#v(e,n,r=!1){let i=e.querySelector(`:scope > ixfx-data-display`);i===null&&(i=document.createElement(`ixfx-data-display`),e.append(i)),i.automap=r,i.updateData(n)}#y(e){let n=this._container.querySelectorAll(`[id^="path-"]`);for(let r of n){let n=r.id.slice(5);e.has(n)||(r.remove(),this.#n.delete(n),this.#t.delete(n))}}};E([d({type:Boolean})],Bg.prototype,`automap`,void 0),Bg=E([T(`ixfx-data-display`)],Bg);function Vg(e){return e==null||e===!1||e===``}function Hg(e){return typeof e==`string`&&e.length>0?e:void 0}let Ug=!1;function Wg(){if(Ug)return;Ug=!0;let e=document.createElement(`style`);e.textContent=`
|
|
4769
4769
|
.ixfx-drag-ghost {
|
|
4770
4770
|
position: fixed;
|
|
4771
4771
|
top: 0;
|
|
@@ -4794,7 +4794,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
4794
4794
|
.ixfx-drag-ghost ixfx-icon {
|
|
4795
4795
|
flex-shrink: 0;
|
|
4796
4796
|
}
|
|
4797
|
-
`,document.head.appendChild(e)}function
|
|
4797
|
+
`,document.head.appendChild(e)}function Gg(e){Wg();let n=document.createElement(`div`);n.className=`ixfx-drag-ghost`,e.className&&n.classList.add(e.className),n.appendChild(e.content),n.style.transform=`translate3d(-9999px, -9999px, 0)`;let r=e.anchor.ownerDocument,i=e.anchor.closest(`.theme-dark, .theme-light`);i?i.appendChild(n):r.body.appendChild(n);let a=e.anchor.getBoundingClientRect(),o=a.width/2,s=a.height/2;return{element:n,move(e,r){n.style.transform=`translate3d(${e-o}px, ${r-s}px, 0)`},destroy(){n.remove()}}}function Kg(e){let n,r=e=>{let n=e.currentTarget;if(!e.shiftKey||e.deltaX!==0||e.deltaY===0||n.scrollWidth<=n.clientWidth)return;let r=e.deltaMode===1?16:e.deltaMode===2?n.clientWidth:1;n.scrollLeft+=e.deltaY*r,e.preventDefault()},i=()=>{n?.removeEventListener(`wheel`,r),n=void 0},a=a=>{a.key===`Shift`&&(i(),a.type===`keydown`&&(n=e(),n?.addEventListener(`wheel`,r,{passive:!1})))};return window.addEventListener(`keydown`,a),window.addEventListener(`keyup`,a),window.addEventListener(`blur`,i),()=>{window.removeEventListener(`keydown`,a),window.removeEventListener(`keyup`,a),window.removeEventListener(`blur`,i),i()}}let qg=class extends n{constructor(...e){super(...e),this._openTrigger=null,this._inputMode=`mouse`,this._handlePointerMove=()=>{this._setInputMode(`mouse`)},this._handleTriggerOpen=e=>{this._openTrigger=e.target},this._handleTriggerClose=e=>{e.target===this._openTrigger&&(this._openTrigger=null)},this._handleFocusIn=e=>{let n=this._getTriggers().find(n=>n===e.target);!n||!this._openTrigger||n===this._openTrigger||(this._openTrigger.closeMenu(),n.openMenu())},this._handleKeydown=e=>{if(e.key!==`ArrowLeft`&&e.key!==`ArrowRight`)return;let n=this._getTriggers();if(n.length===0)return;let r=this._openTrigger??n.find(n=>n===e.target);if(!r)return;let i=n.indexOf(r);if(i===-1)return;e.preventDefault(),e.stopPropagation(),this._setInputMode(`keyboard`);let a=n[(i+(e.key===`ArrowRight`?1:-1)+n.length)%n.length];this._openTrigger?(this._openTrigger.closeMenu(),a.openMenu()):a.focusTrigger()}}connectedCallback(){super.connectedCallback(),this.addEventListener(`menu-trigger-open`,this._handleTriggerOpen),this.addEventListener(`menu-trigger-close`,this._handleTriggerClose),this.addEventListener(`focusin`,this._handleFocusIn),this.addEventListener(`keydown`,this._handleKeydown),this.addEventListener(`pointermove`,this._handlePointerMove)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`menu-trigger-open`,this._handleTriggerOpen),this.removeEventListener(`menu-trigger-close`,this._handleTriggerClose),this.removeEventListener(`focusin`,this._handleFocusIn),this.removeEventListener(`keydown`,this._handleKeydown),this.removeEventListener(`pointermove`,this._handlePointerMove)}_setInputMode(e){this._inputMode!==e&&(this._inputMode=e,this.setAttribute(`data-input-mode`,e))}_getTriggers(){return[...this.children].filter(e=>e.tagName===`IXFX-MENU-TRIGGER`)}static{this.styles=r`
|
|
4798
4798
|
:host {
|
|
4799
4799
|
display: flex;
|
|
4800
4800
|
align-items: center;
|
|
@@ -4805,7 +4805,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
4805
4805
|
--_trigger-hover-bg: transparent;
|
|
4806
4806
|
--_trigger-hover-opacity: 0.6;
|
|
4807
4807
|
}
|
|
4808
|
-
`}render(){return i`<slot role="menubar"></slot>`}};
|
|
4808
|
+
`}render(){return i`<slot role="menubar"></slot>`}};qg=E([T(`ixfx-menu-bar`)],qg);let Jg=class extends n{constructor(...e){super(...e),this.command=``,this.commandArgs=``,this.label=``,this.checked=!1,this.disabled=!1,this.iconName=``}handleClick(){this.disabled||(this.checked=!this.checked,this.dispatchEvent(new CustomEvent(`command`,{detail:{command:this.command,checked:this.checked,args:this.commandArgs},bubbles:!0,composed:!0})))}_resolvedLabel(){return this.label?this.label:this.registry&&this.command?this.registry.get(this.command)?.label??``:``}_resolvedIcon(){return this.iconName?this.iconName:this.registry&&this.command?this.registry.get(this.command)?.icon??null:null}willUpdate(e){super.willUpdate(e);let n=this._resolvedIcon();n&&!this.iconName?this.setAttribute(`data-icon-section`,``):!n&&!this.iconName&&this.removeAttribute(`data-icon-section`)}updated(e){super.updated(e)}_getShortcut(){if(!this.keyboardManager||!this.command)return null;let e=(this.keyboardManager.getBindings?.()??[]).find(e=>e.commandId===this.command);if(!e)return null;let n=Array.from(e.modifiers??[],e=>({ctrl:`⌃`,shift:`⇧`,alt:`⌥`,meta:`⌘`})[e]??e),r=e.key?.length===1?e.key.toUpperCase():e.key;return[...n,r].join(``)}static{this.styles=[w,C,r`
|
|
4809
4809
|
:host {
|
|
4810
4810
|
display: block;
|
|
4811
4811
|
}
|
|
@@ -4875,7 +4875,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
4875
4875
|
<span class="label">${this._resolvedLabel()}</span>
|
|
4876
4876
|
${e?i`<span class="shortcut">${e}</span>`:null}
|
|
4877
4877
|
</div>
|
|
4878
|
-
`}};E([d({type:String})],
|
|
4878
|
+
`}};E([d({type:String})],Jg.prototype,`command`,void 0),E([d({type:String,attribute:`command-args`})],Jg.prototype,`commandArgs`,void 0),E([d({type:String})],Jg.prototype,`label`,void 0),E([d({type:Boolean})],Jg.prototype,`checked`,void 0),E([d({type:Boolean})],Jg.prototype,`disabled`,void 0),E([d({type:String,attribute:`icon-name`})],Jg.prototype,`iconName`,void 0),E([d({attribute:!1})],Jg.prototype,`registry`,void 0),E([d({attribute:!1})],Jg.prototype,`keyboardManager`,void 0),Jg=E([T(`ixfx-menu-check-item`)],Jg);var Yg=class{constructor(e){this.registry=e.registry,this.target=e.target??document,this.boundHandler=this.handleCommand.bind(this)}start(){this.target.addEventListener(`command`,this.boundHandler)}stop(){this.target.removeEventListener(`command`,this.boundHandler)}handleCommand(e){let n=e.target,r=n?.command;if(!r)return;let i=n?.commandArgs??``;this.registry.invoke(r,{args:i})}},Xg;let Zg=class extends n{static{Xg=this}constructor(...e){super(...e),this.command=``,this.commandArgs=``,this.label=``,this.disabled=!1,this.iconName=``,this._hasSubmenu=!1,this._anchorName=`--mst-${Xg._count++}`,this._hoverTimeout=null,this._hideTimeout=null}static{this._count=0}connectedCallback(){super.connectedCallback(),this.addEventListener(`keydown`,this._handleKeydown)}firstUpdated(){this.style.setProperty(`--anchor-name`,this._anchorName)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`keydown`,this._handleKeydown),this._hoverTimeout&&clearTimeout(this._hoverTimeout),this._hideTimeout&&clearTimeout(this._hideTimeout)}_propagateContext(){let e=this._slot?.assignedElements({flatten:!0})??[];for(let n of e)`registry`in n&&(n.registry=this.registry),`keyboardManager`in n&&(n.keyboardManager=this.keyboardManager)}updated(e){(e.has(`registry`)||e.has(`keyboardManager`))&&this._propagateContext()}willUpdate(e){super.willUpdate(e);let n=this._resolvedIcon();n&&!this.iconName?this.setAttribute(`data-icon-section`,``):!n&&!this.iconName&&this.removeAttribute(`data-icon-section`)}_resolvedIcon(){return this.iconName?this.iconName:this.registry&&this.command?this.registry.get(this.command)?.icon??null:null}_handleSlotChange(){this._hasSubmenu=this._slot?.assignedElements().length>0,this._propagateContext()}_showSubmenu(){if(this._submenuPopover?.popover)try{this._submenuPopover.showPopover()}catch{}}_hideSubmenu(){if(this._submenuPopover?.popover)try{this._submenuPopover.hidePopover()}catch{}}_cancelHide(){this._hideTimeout&&=(clearTimeout(this._hideTimeout),null)}_scheduleHide(){this._cancelHide(),this._hideTimeout=window.setTimeout(()=>{this._hideSubmenu(),this._hideTimeout=null},100)}_handleMouseEnter(){this.disabled||!this._hasSubmenu||(this._cancelHide(),this._hoverTimeout&&clearTimeout(this._hoverTimeout),this._hoverTimeout=window.setTimeout(()=>{this._showSubmenu()},150))}_handleMouseLeave(){this._hoverTimeout&&=(clearTimeout(this._hoverTimeout),null),this._scheduleHide()}_handleSubmenuMouseEnter(){this._cancelHide()}_handleSubmenuMouseLeave(){this._scheduleHide()}_handleClick(){this.disabled||!this.command||this.dispatchEvent(new CustomEvent(`command`,{detail:{command:this.command,args:this.commandArgs},bubbles:!0,composed:!0}))}_handleKeydown(e){if(!this.disabled)switch(e.key){case`ArrowRight`:case`Enter`:case` `:e.preventDefault(),e.stopPropagation(),this._hasSubmenu&&(this._showSubmenu(),requestAnimationFrame(()=>{(this._slot?.assignedElements({flatten:!0}).find(e=>e.tagName===`IXFX-MENU-CONTAINER`))?.focusFirst()}));break;case`ArrowLeft`:e.preventDefault(),e.stopPropagation(),this._hideSubmenu(),this._itemEl?.focus();break;case`Escape`:e.preventDefault(),e.stopPropagation(),this._hideSubmenu()}}static{this.styles=[w,C,r`
|
|
4879
4879
|
:host {
|
|
4880
4880
|
display: block;
|
|
4881
4881
|
}
|
|
@@ -4961,7 +4961,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
4961
4961
|
>
|
|
4962
4962
|
<slot name="submenu" @slotchange=${this._handleSlotChange}></slot>
|
|
4963
4963
|
</div>
|
|
4964
|
-
`}};E([d({type:String})],
|
|
4964
|
+
`}};E([d({type:String})],Zg.prototype,`command`,void 0),E([d({type:String,attribute:`command-args`})],Zg.prototype,`commandArgs`,void 0),E([d({type:String})],Zg.prototype,`label`,void 0),E([d({type:Boolean})],Zg.prototype,`disabled`,void 0),E([d({type:String,attribute:`icon-name`})],Zg.prototype,`iconName`,void 0),E([d({attribute:!1})],Zg.prototype,`registry`,void 0),E([d({attribute:!1})],Zg.prototype,`keyboardManager`,void 0),E([m()],Zg.prototype,`_hasSubmenu`,void 0),E([f(`slot[name="submenu"]`)],Zg.prototype,`_slot`,void 0),E([f(`.submenu-popover`)],Zg.prototype,`_submenuPopover`,void 0),E([f(`.item`)],Zg.prototype,`_itemEl`,void 0),Zg=Xg=E([T(`ixfx-menu-sub-trigger`)],Zg);let Qg=class extends n{static{this.styles=[w,r`
|
|
4965
4965
|
:host {
|
|
4966
4966
|
display: block;
|
|
4967
4967
|
margin: var(--space-xs) 0;
|
|
@@ -4971,7 +4971,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
4971
4971
|
height: 1px;
|
|
4972
4972
|
background: var(--surface-4);
|
|
4973
4973
|
}
|
|
4974
|
-
`]}render(){return i`<div class="separator"></div>`}};
|
|
4974
|
+
`]}render(){return i`<div class="separator"></div>`}};Qg=E([T(`ixfx-menu-separator`)],Qg);let $g=class extends n{constructor(...e){super(...e),this.label=``}static{this.styles=[w,r`
|
|
4975
4975
|
:host {
|
|
4976
4976
|
display: block;
|
|
4977
4977
|
padding: 6px var(--space-m) var(--space-xs);
|
|
@@ -4981,7 +4981,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
4981
4981
|
color: var(--surface-muted-text);
|
|
4982
4982
|
letter-spacing: 0.5px;
|
|
4983
4983
|
}
|
|
4984
|
-
`]}render(){return i`<div>${this.label}</div>`}};E([d({type:String})]
|
|
4984
|
+
`]}render(){return i`<div>${this.label}</div>`}};E([d({type:String})],$g.prototype,`label`,void 0),$g=E([T(`ixfx-menu-header`)],$g);function e_(e){return e.children===void 0||e.children.length===0}function t_(e,n={}){let{onCommand:r,registry:o,keyboardManager:s}=n;return i`${e.map(e=>{let c=e.item.label;if(c===`-`)return i`<ixfx-menu-separator></ixfx-menu-separator>`;if(c.startsWith(`# `))return i`<ixfx-menu-header label="${c.slice(2)}"></ixfx-menu-header>`;if(!e_(e)){let r=t_(e.children,n);return i`
|
|
4985
4985
|
<ixfx-menu-sub-trigger label="${c}">
|
|
4986
4986
|
<ixfx-menu-container
|
|
4987
4987
|
slot="submenu"
|
|
@@ -4996,7 +4996,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
4996
4996
|
icon-name="${e.item.icon??a}"
|
|
4997
4997
|
@command=${r?e=>r(e.detail):a}
|
|
4998
4998
|
></ixfx-menu-item>
|
|
4999
|
-
`})}`}function
|
|
4999
|
+
`})}`}function n_(e,n){let{onCommand:r,registry:i}=n,a=e.item.label,o=document.createElement(`ixfx-menu-item`);return o.setAttribute(`command`,e.item.key),o.setAttribute(`label`,a),e.item.icon&&o.setAttribute(`icon-name`,e.item.icon),r&&o.addEventListener(`command`,e=>r(e.detail)),i&&(o.registry=i),o}function r_(){return document.createElement(`ixfx-menu-separator`)}function i_(e){let n=document.createElement(`ixfx-menu-header`);return n.setAttribute(`label`,e),n}function a_(e,n){let{registry:r,keyboardManager:i}=n,a=document.createElement(`ixfx-menu-sub-trigger`);a.setAttribute(`label`,e.item.label),r&&(a.registry=r),i&&(a.keyboardManager=i);let o=document.createElement(`ixfx-menu-container`);o.setAttribute(`slot`,`submenu`),r&&(o.registry=r),i&&(o.keyboardManager=i);let s=o_(e.children,n);for(let e of s)o.appendChild(e);return a.appendChild(o),a}function o_(e,n={}){return e.map(e=>{let r=e.item.label;return r===`-`?r_():r.startsWith(`# `)?i_(r.slice(2)):e_(e)?n_(e,n):a_(e,n)})}let s_=class extends n{constructor(...e){super(...e),this.value=``,this.label=``,this.disabled=!1,this.groupValue=``,this.iconName=``}handleClick(){this.disabled||this.dispatchEvent(new CustomEvent(`radio-select`,{detail:{value:this.value},bubbles:!0,composed:!0}))}static{this.styles=[w,C,r`
|
|
5000
5000
|
:host {
|
|
5001
5001
|
display: block;
|
|
5002
5002
|
}
|
|
@@ -5058,7 +5058,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5058
5058
|
<span class="icon-slot">${this.iconName?i`<ixfx-icon name="${this.iconName}"></ixfx-icon>`:null}</span>
|
|
5059
5059
|
<span class="label">${this.label}</span>
|
|
5060
5060
|
</div>
|
|
5061
|
-
`}};E([d({type:String})],
|
|
5061
|
+
`}};E([d({type:String})],s_.prototype,`value`,void 0),E([d({type:String})],s_.prototype,`label`,void 0),E([d({type:Boolean})],s_.prototype,`disabled`,void 0),E([d({type:String})],s_.prototype,`groupValue`,void 0),E([d({type:String,attribute:`icon-name`})],s_.prototype,`iconName`,void 0),s_=E([T(`ixfx-menu-radio-item`)],s_);let c_=class extends n{constructor(...e){super(...e),this.name=``,this.value=``,this.slottedElements=[]}handleSlotChange(e){let n=e.target;this.slottedElements=n.assignedElements(),this.updateSlottedValues()}updateSlottedValues(){for(let e of this.slottedElements)e.groupValue=this.value}handleRadioSelect(e){this.value=e.detail.value,this.dispatchEvent(new CustomEvent(`radio-change`,{detail:{name:this.name,value:this.value},bubbles:!0,composed:!0}))}updated(e){e.has(`value`)&&this.updateSlottedValues()}static{this.styles=r`
|
|
5062
5062
|
:host {
|
|
5063
5063
|
display: block;
|
|
5064
5064
|
}
|
|
@@ -5068,7 +5068,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5068
5068
|
}
|
|
5069
5069
|
`}render(){return i`
|
|
5070
5070
|
<slot @slotchange=${this.handleSlotChange} @radio-select=${this.handleRadioSelect}></slot>
|
|
5071
|
-
`}};E([d({type:String})],
|
|
5071
|
+
`}};E([d({type:String})],c_.prototype,`name`,void 0),E([d({type:String})],c_.prototype,`value`,void 0),E([m()],c_.prototype,`slottedElements`,void 0),c_=E([T(`ixfx-menu-radio-group`)],c_);var l_=e({MenuBar:()=>qg,MenuCheckItem:()=>Jg,MenuCommandController:()=>Yg,MenuContainer:()=>ir,MenuHeader:()=>$g,MenuItem:()=>cr,MenuRadioGroup:()=>c_,MenuRadioItem:()=>s_,MenuSeparator:()=>Qg,MenuSubTrigger:()=>Zg,MenuTrigger:()=>or,menuFromTree:()=>t_,menuFromTreeToElements:()=>o_});const u_=`cubic-bezier(0.25, 0.46, 0.45, 0.94)`;let d_=class extends n{constructor(...e){super(...e),this.direction=`end`,this.disabled=!1,this.mode=`hover`,this._isOverflowing=!1,this._isHovering=!1,this._loopActive=!1,this._loopAtEnd=!1,this._overflow=0,this._resizeObserver=null,this._loopTimer=0,this._onMouseEnter=()=>{this._isHovering=!0},this._onMouseLeave=()=>{this._isHovering=!1},this._measure=()=>{if(this._isHovering||this._loopAtEnd)return;let e=this._textEl;if(!e)return;this._overflow=Math.max(0,e.scrollWidth-e.clientWidth);let n=this._overflow>0;this.classList.toggle(`is-overflowing`,n),n!==this._isOverflowing&&(this._isOverflowing=n),this._loopActive&&this.mode===`loop`&&!this.disabled&&n&&this._loopTimer===0&&this._scheduleLoopPan(300),!n&&this._loopAtEnd&&(this._loopAtEnd=!1,this.requestUpdate())}}connectedCallback(){super.connectedCallback(),this._resizeObserver=new ResizeObserver(()=>this._measure()),this.addEventListener(`mouseenter`,this._onMouseEnter),this.addEventListener(`mouseleave`,this._onMouseLeave)}disconnectedCallback(){super.disconnectedCallback(),this._clearLoopTimer(),this._loopActive=!1,this._loopAtEnd=!1,this._resizeObserver?.disconnect(),this._resizeObserver=null,this.removeEventListener(`mouseenter`,this._onMouseEnter),this.removeEventListener(`mouseleave`,this._onMouseLeave)}firstUpdated(){this._measure(),this._resizeObserver?.observe(this),document.fonts?.ready.then(()=>this._measure()),this.mode===`loop`&&this.startLoop()}updated(e){e.has(`mode`)&&(this.mode===`loop`?this.startLoop():this.stopLoop()),e.has(`disabled`)&&this.disabled&&this.stopLoop(),this._measure()}get looping(){return this._loopActive}startLoop(){this.disabled||this._prefersReducedMotion()||(this._loopActive=!0,this._loopAtEnd=!1,this.requestUpdate(),this._isOverflowing&&this._loopTimer===0&&this._scheduleLoopPan(300))}stopLoop(){!this._loopActive&&!this._loopAtEnd&&this._loopTimer===0||(this._clearLoopTimer(),this._loopActive=!1,this._loopAtEnd=!1,this.requestUpdate())}_prefersReducedMotion(){return globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1}_panDuration(){return Math.max(1.5,(this._overflow+4)/45)}_clearLoopTimer(){this._loopTimer!==0&&(clearTimeout(this._loopTimer),this._loopTimer=0)}_scheduleLoopPan(e){this._clearLoopTimer(),this._loopTimer=window.setTimeout(()=>{if(this._loopTimer=0,!this._loopActive||this.disabled||!this._isOverflowing)return;this._loopAtEnd=!0,this.requestUpdate();let e=this._panDuration()*1e3+2e3;this._loopTimer=window.setTimeout(()=>{this._loopTimer=0,this._loopActive&&(this._loopAtEnd=!1,this.requestUpdate(),this._scheduleLoopPan(700))},e)},e)}_textStyle(){if(!this._isOverflowing)return``;let e=this._overflow+4,n=Math.max(1.5,e/45),r=this.direction===`end`,i=r?0:-e,a=r?-e:0;return this._loopActive&&this.mode===`loop`?this._loopAtEnd?[`transform: translateX(${a}px)`,`transition: transform ${n}s ${u_}`,`overflow: visible`,`text-overflow: clip`].join(`; `):[`transform: translateX(${i}px)`,`transition: transform 400ms ${u_}`,r?``:`overflow: visible; text-overflow: clip`].filter(Boolean).join(`; `):this._isHovering?[`transform: translateX(${a}px)`,`transition: transform ${n}s ${u_} 300ms`,`overflow: visible`,`text-overflow: clip`].join(`; `):[`transform: translateX(${i}px)`,`transition: transform 400ms ${u_}`,r?``:`overflow: visible; text-overflow: clip`].filter(Boolean).join(`; `)}render(){let e={"is-overflowing":this._isOverflowing,"is-hovering":this._isHovering};return i`
|
|
5072
5072
|
<span class="text ${v(e)}" part="text" style=${this._textStyle()}>
|
|
5073
5073
|
<slot @slotchange=${this._measure}></slot>
|
|
5074
5074
|
</span>
|
|
@@ -5104,7 +5104,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5104
5104
|
transform: none !important;
|
|
5105
5105
|
}
|
|
5106
5106
|
}
|
|
5107
|
-
`]}};E([d({type:String,attribute:`direction`})],
|
|
5107
|
+
`]}};E([d({type:String,attribute:`direction`})],d_.prototype,`direction`,void 0),E([d({type:Boolean,attribute:`disabled`})],d_.prototype,`disabled`,void 0),E([d({type:String,attribute:`mode`,reflect:!0})],d_.prototype,`mode`,void 0),E([m()],d_.prototype,`_isOverflowing`,void 0),E([m()],d_.prototype,`_isHovering`,void 0),E([m()],d_.prototype,`_loopActive`,void 0),E([m()],d_.prototype,`_loopAtEnd`,void 0),E([f(`.text`)],d_.prototype,`_textEl`,void 0),d_=E([T(`ixfx-pan-text`)],d_);const f_={textColor:void 0,icon:void 0,iconColor:void 0,badge:void 0};function p_(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}function m_(e,n){return e!==void 0&&e.length===n.length&&e.every((e,r)=>e===n[r])}let B=class extends n{constructor(...e){super(...e),this.columns=[],this.rows=[],this.selectionMode=`single`,this.interactionMode=`standard`,this.sortState=null,this.rowHeight=28,this.getRowKey=(e,n)=>e.key??e.id??String(n),this.editable=!1,this.editability=`user`,this.cellOverflow=`ellipsis`,this.zebraStripes=!1,this.groupBy=null,this.allowGrouping=!1,this.crossGroupSelection=!1,this.columnMenu=`none`,this.textColorColumn=``,this.iconColumn=``,this.badgeColumn=``,this.itemsDraggable=!1,this.columnButtonIcon=`ellipsis`,this._columnFormatters=new Map,this._resizingColKey=void 0,this._animatingColKeys=new Set,this._selectedKeys=new Set,this._scrollTop=0,this._scrollLeft=0,this._viewportH=300,this._viewportW=600,this._collapsedGroups=new Set,this._editing=null,this._editingRow=null,this._lastClick=null,this._lastClickedCell=null,this._editValue=``,this._tickled=new oe(this,{getItems:()=>this.#p??=this._flat.map(e=>({id:e.key,enabled:e.type===`row`})),onStateChange:()=>this.requestUpdate(),hoverDisabled:()=>this.#a.isDragging}),this.#t=!1,this.#r=0,this.#i=new WeakMap,this.#a=new er(this,{source:`data-grid`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this._flat.some(e=>e.type===`row`),resolveEventToKey:e=>{if(e instanceof Element&&!e.closest?.(`.header-cell`))return(e.closest?.(`.row`))?.dataset.key},prepareSelection:e=>this.#o(e),getMetrics:()=>({rowHeight:this.rowHeight}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this.dispatchEvent(new CustomEvent(`list-native-drag-start`,{detail:e,bubbles:!0,composed:!0,cancelable:!0})),onActiveChange:(e,n)=>{if(this.#t=e,this.#n=e?n:void 0,this.toggleAttribute(`data-native-dragging`,e),e){let e=this._selectedKeys.size;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#t=!1,this.#n=void 0,this.toggleAttribute(`data-native-dragging`,!1),this.removeAttribute(`aria-label`),this.#s()}}),this._sortedRows=[],this._flat=[],this._flatKeys=[],this.#c=new Map,this.#l=0,this.#u=-1,this.#g=new Map,this.search=new Vt(this,{adapter:this.#v()}),this.#x=[],this.#S=new Set,this.#C=0,this.#w=!1,this._visibleColumns=[],this._colOffsets=[],this._colWidthSum=0,this._raf=0,this.#T=0,this.#O=0,this._drag=null,this._onFocusOut=e=>{if(this._suppressBlurCommit||this.editability===`immediate`||!this._editing&&!this._editingRow)return;let n=e.relatedTarget;n&&this.contains(n)||(this._editing=null,this._editingRow=null,this.requestUpdate())},this._onScroll=e=>{let n=e.target;cancelAnimationFrame(this._raf),this._raf=requestAnimationFrame(()=>{let e=this.#R(2);this._scrollTop=n.scrollTop,this._scrollLeft=n.scrollLeft;let r=this.#R(2);(e.start!==r.start||e.end!==r.end)&&this.requestUpdate(),cancelAnimationFrame(this.#T),this.#T=0,this.#V()})},this._onKeyDown=e=>{if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`){if(this.selectionMode===`multiple`||this.interactionMode===`checked`||this.interactionMode===`sticky`||this.interactionMode===`vscode`||this.interactionMode===`standard`){e.preventDefault();let n=new Set(this._selectedKeys);if(this.groupBy&&!this.crossGroupSelection&&this._anchorKey){let e=this._getGroupKey(this._getRowForKey(this._anchorKey)??{key:this._anchorKey});this._selectedKeys=new Set(this._flat.filter(n=>n.type===`row`&&this._getGroupKey(n.row)===e).map(e=>e.key))}else this._selectedKeys=new Set(this._flat.filter(e=>e.type===`row`).map(e=>e.key));this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(this._selectedKeys),previous:n},bubbles:!0,composed:!0}))}return}if(this._editing&&(e.key===`ArrowDown`||e.key===`ArrowUp`)){if(this.shadowRoot?.activeElement?.tagName===`SELECT`)return;e.preventDefault();let n=this._editing,r=e.key===`ArrowDown`?1:-1,i=n.colKey;this._suppressBlurCommit=!0,this._commitEdit();let a=this._flat.filter(e=>e.type===`row`).map(e=>e.key),o=a.indexOf(n.rowKey),s=o+r;for(;s>=0&&s<a.length;){let e=a[s],n=this.#F(e)?.row,c=this._visibleColumns.find(e=>e.key===i);if(n&&c&&this._isEditable(n,c)){this._startEdit(e,i),this._tickled.handleKeyboardNavigation(s>o?`next`:`previous`),this._scrollRowIntoView(e);break}s+=r}(s<0||s>=a.length)&&(this._tickled.handleKeyboardNavigation(r>0?`next`:`previous`),this._tickled.tickledId&&this._scrollRowIntoView(this._tickled.tickledId)),requestAnimationFrame(()=>{this._suppressBlurCommit=!1});return}switch((e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`Home`||e.key===`End`)&&(e.preventDefault(),this._tickled.setInputMode(`keyboard`)),e.key){case`ArrowDown`:this._tickled.handleKeyboardNavigation(`next`),this._tickled.tickledId&&this._scrollRowIntoView(this._tickled.tickledId),this.interactionMode===`implicit`&&this._tickled.tickledId&&this._replaceSelection(this._tickled.tickledId),e.shiftKey&&(this.interactionMode===`standard`||this.interactionMode===`vscode`)&&this._tickled.tickledId&&this._rangeSelectTo(this._tickled.tickledId);break;case`ArrowUp`:this._tickled.handleKeyboardNavigation(`previous`),this._tickled.tickledId&&this._scrollRowIntoView(this._tickled.tickledId),this.interactionMode===`implicit`&&this._tickled.tickledId&&this._replaceSelection(this._tickled.tickledId),e.shiftKey&&(this.interactionMode===`standard`||this.interactionMode===`vscode`)&&this._tickled.tickledId&&this._rangeSelectTo(this._tickled.tickledId);break;case`Home`:this._tickled.handleKeyboardNavigation(`first`),this._tickled.tickledId&&this._scrollRowIntoView(this._tickled.tickledId);break;case`End`:this._tickled.handleKeyboardNavigation(`last`),this._tickled.tickledId&&this._scrollRowIntoView(this._tickled.tickledId);break;case`Enter`:{let n=this._tickled.tickledId;if(!n)break;if(e.preventDefault(),!this._editing&&this.editability===`user`){let e=this.#F(n);if(e){let r=e.row;if(this._lastClickedCell?.rowKey===n){let e=this._visibleColumns.find(e=>e.key===this._lastClickedCell.colKey);if(e&&this._isEditable(r,e)){this._startEdit(n,e.key);break}}let i=this._visibleColumns.find(e=>this._isEditable(r,e));if(i){this._startEdit(n,i.key);break}}}if(!this._editing){let e=this.#F(n),r=e?.idx??-1;if(this._selectedKeys.has(n)){this._activateRow(n,e?.row,r);break}this.interactionMode!==`manual`&&this.interactionMode!==`checked`&&this._replaceSelection(n),this.dispatchEvent(new CustomEvent(`datagrid-cell-click`,{detail:{rowKey:n,colKey:``,rowIndex:r,colIndex:-1},bubbles:!0,composed:!0}))}break}case` `:{if(this._editing){if((this.columns.find(e=>e.key===this._editing.colKey)?.dataType??`text`)===`boolean`){e.preventDefault();let n=this.editability===`immediate`,r=this._editing.rowKey,i=this._editing.colKey,a=this.shadowRoot?.activeElement,o;if(a?.type===`checkbox`)o=!a.checked,a.checked=o;else{let e=this.#F(r)?.row;o=!(this._editValue===``?e?.[i]:this._editValue)}n?this._commitImmediate(r,i,o):(this._editValue=o,this._commitEdit())}break}let n=this._tickled.tickledId;if(!n)break;e.preventDefault(),this.interactionMode===`checked`||this.interactionMode===`sticky`||this.interactionMode===`standard`||this.interactionMode===`vscode`||this.interactionMode===`manual`?this._toggleSelection(n):this._replaceSelection(n);break}case`Escape`:if(this._editing||this._editingRow)e.preventDefault(),this._editing=null,this._editingRow=null,this.requestUpdate();else if(this._selectedKeys.size){e.preventDefault();let n=new Set(this._selectedKeys);this._selectedKeys=new Set,this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set,previous:n},bubbles:!0,composed:!0}))}}},this._suppressBlurCommit=!1}static{this.styles=[w,Xt,se,C,Gn,Ht,Ng(`x`),Ng(`y`),r`
|
|
5108
5108
|
:host {
|
|
5109
5109
|
--data-grid-row-height: 28px;
|
|
5110
5110
|
--data-grid-header-height: 32px;
|
|
@@ -5312,7 +5312,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5312
5312
|
.group-row .divider { flex: 1; height: 1px; background: var(--border); margin-left: var(--space-s); }
|
|
5313
5313
|
.group-row .count { opacity: 0.6; font-weight: 400; font-size: 0.9em; }
|
|
5314
5314
|
|
|
5315
|
-
`]}#e;#t;#n;#r;#i;#a;#o(e){let n=this._flat.filter(e=>e.type===`row`);if(!n.some(n=>n.key===e))return;this._selectedKeys.has(e)||this._replaceSelection(e);let r=[],i=0;for(let e of n){if(!this._selectedKeys.has(e.key)){i++;continue}let n=this.renderRoot.querySelector(`.row[data-key="${CSS.escape(e.key)}"]`)??void 0;r.push({key:e.key,index:i,item:e.row,...n?{element:n}:{}}),i++}let a=r.find(n=>n.key===e);if(a)return{origin:a,selected:r}}#s(){this.#r&&clearTimeout(this.#r),this.#r=window.setTimeout(()=>{this.#r=0},0)}#c;#l;#u;#d;#f;#p;#m;#h;#g;get registry(){return this.#m}#_(e){if(this.rowSearchText)return this.rowSearchText(e);let n=e;return this._visibleColumns.map(e=>String(n[e.key]??``)).join(` `)}#v(){return{getItems:()=>(this.#g.clear(),this._sortedRows.forEach((e,n)=>this.#g.set(e,this.getRowKey(e,n))),this._sortedRows),getLabel:e=>this.#_(e),getKey:e=>this.#g.get(e)??String(this._sortedRows.indexOf(e)),focusItem:e=>{if(e===void 0)return;let n=this.#g.get(e);n!==void 0&&this.tickleRow(n)},selectItems:e=>{this.selectKeys(e.map(e=>this.#g.get(e)).filter(e=>e!==void 0))},applyFilter:e=>{this.filterPredicate=e===void 0?void 0:n=>{let r=this.#g.get(n);return r===void 0||e.has(r)}}}}#y(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#b(){this.#m&&(this.search.setModes(this.#y()),this.#h?.(),this.#h=Rt(this.#m,this.search))}#x;#S;#C;#w;#T;#E;#D;#O;#k;connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.#m??=Yt(),this.#b(),this.#k=Gg(()=>this._viewportEl??void 0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusout`,this._onFocusOut),cancelAnimationFrame(this._raf),cancelAnimationFrame(this.#T),this.#T=0,this.#h?.(),this.#h=void 0,this.#m=void 0,this.#C&&=(clearTimeout(this.#C),0),this.#r&&=(clearTimeout(this.#r),0),this.#e?.disconnect(),this.#e=void 0,this.#k?.(),this.#k=void 0}dispatch(e,n){this.#m?.invoke(e,n)}firstUpdated(){this.#e=new ResizeObserver(()=>this.#A()),this.#e.observe(this._viewportEl),this.#A()}#A(){if(!this._viewportEl)return;let e=this._viewportEl,n=e.clientWidth,r=this.#L();if(n<=0||r<=0)return;let i=e.parentElement;i.style.setProperty(`--data-grid-scrollbar-width`,`${e.offsetWidth-n}px`),i.style.setProperty(`--data-grid-viewport-width`,`${n}px`),(n!==this._viewportW||r!==this._viewportH)&&(this._viewportW=n,this._viewportH=r,this.#B())}refreshLayout(){this.#A(),this.requestUpdate()}updated(e){super.updated(e),(e.has(`rows`)||e.has(`sortState`)||e.has(`columns`)||e.has(`groupBy`)||e.has(`groupLabel`)||e.has(`filterPredicate`)||e.has(`rowHeight`))&&this.#B(),(e.has(`_editing`)||e.has(`_editingRow`))&&this.updateComplete.then(()=>{let e=null;if(this._editing?e=`.row[data-key="${this._editing.rowKey}"] .cell[data-col="${this._editing.colKey}"] input, .row[data-key="${this._editing.rowKey}"] .cell[data-col="${this._editing.colKey}"] select`:this._editingRow&&(e=`.row[data-key="${this._editingRow}"] .cell input, .row[data-key="${this._editingRow}"] .cell select`),!e)return;let n=this.renderRoot.querySelector(e);n?.focus(),n instanceof HTMLInputElement&&n.type===`text`&&n.select()})}willUpdate(e){super.willUpdate(e),this.setAttribute(`data-input-mode`,this._tickled.inputMode),e.has(`searchModes`)&&this.#b(),this.#j(),this._visibleColumns=this.columns.filter(e=>e.visible!==!1);let n=0;this._colOffsets=this._visibleColumns.map(e=>{let r=n;return n+=e.width??150,r}),this._colWidthSum=n,this.interactionMode===`checked`&&(this._colWidthSum+=28),this.#l!==this.#u&&(this.#u=this.#l,this.#N())}#j(){let e=[this.rows,this.sortState,this.columns],n=[this.filterPredicate,this.groupBy,this.groupLabel,this._collapsedGroups,this.getRowKey],r=!p_(this.#d,e);r&&(this.#d=e,this._sortedRows=this._applySort([...this.rows])),(r||!p_(this.#f,n))&&(this.#f=n,this._rebuildFlat())}#M(){this.#d=[this.rows,this.sortState,this.columns],this.#f=[this.filterPredicate,this.groupBy,this.groupLabel,this._collapsedGroups,this.getRowKey]}#N(){let e=this._flatKeys,n=this.#x;if(this.#x=e.slice(),!this.#w){this.#w=!0;return}if(n.length===0||e.length===0){this.#S.clear();return}let r=new Set(n),i=e.filter(e=>!r.has(e)),a=n.length-(e.length-i.length);i.length===e.length||i.length===0&&a===0||(this.#S=new Set(i),this.toggleAttribute(`reflowing`,!0),this.#C&&clearTimeout(this.#C),this.#C=window.setTimeout(()=>{this.#C=0,this.#S.clear(),this.toggleAttribute(`reflowing`,!1),this.requestUpdate()},320))}_getGroupKey(e){return this.groupBy?typeof this.groupBy==`string`?String(e[this.groupBy]??``):String(this.groupBy(e)):null}_rebuildFlat(){let e=this.filterPredicate,n=[];for(let r=0;r<this._sortedRows.length;r++)(!e||e(this._sortedRows[r]))&&n.push(r);let r=[],i=[],a=e=>{let n=this._sortedRows[e],a=this.getRowKey(n,e);r.push({type:`row`,key:a,row:n,idx:e}),i.push(a)};if(!this.groupBy)n.forEach(a);else{let e=new Map;for(let r of n){let n=this._getGroupKey(this._sortedRows[r])??``,i=e.get(n);i?i.push(r):e.set(n,[r])}for(let[n,o]of e){let e=this.groupLabel?this.groupLabel(n,o.map(e=>this._sortedRows[e])):n,s=`__group__${n}`;r.push({type:`group`,key:s,label:e,count:o.length}),i.push(s),this._collapsedGroups.has(n)||o.forEach(a)}}this._flat=r,this._flatKeys=i,this.#P()}#P(){this.#c.clear(),this._flat.forEach((e,n)=>this.#c.set(e.key,n)),this.#l++,this.#p=void 0}#F(e){let n=this.#c.get(e),r=n===void 0?void 0:this._flat[n];if(r?.type===`row`)return r;let i=this._sortedRows.findIndex((n,r)=>this.getRowKey(n,r)===e);return i<0?void 0:{row:this._sortedRows[i],idx:i}}_toggleGroup(e){let n=new Set(this._collapsedGroups);n.has(e)?n.delete(e):n.add(e),this._collapsedGroups=n}_applySort(e){if(!this.sortState)return e;let n=this.columns.find(e=>e.key===this.sortState.key);if(!n)return e;let r=this.sortState.direction===`asc`?1:-1;if(n.sortFn)return e.sort((e,i)=>r*n.sortFn(e,i));let i=n.dataType??`text`;return e.sort((e,a)=>{let o=e[n.key],s=a[n.key];return o===s?0:i===`number`?r*(o-s):i===`boolean`?r*(!!o==!!s?0:o?1:-1):r*String(o).localeCompare(String(s))})}_onHeaderClick(e,n){if(e.sortable===!1)return;if(n){let e=n.composedPath()[0];if(e&&this.#i.get(e)){this.#i.delete(e);return}}let r=this.sortState,i=null;i=!r||r.key!==e.key?{key:e.key,direction:`asc`}:r.direction===`asc`?{key:e.key,direction:`desc`}:null,this.sortState=i,this.dispatchEvent(new CustomEvent(`datagrid-sort`,{detail:{sort:i,previous:r},bubbles:!0,composed:!0}))}_onHeaderPointerUp(e,n){let r=!1,i=new CustomEvent(`datagrid-header-pointerup`,{detail:{key:e.key,column:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i),i.defaultPrevented&&(r=!0),r&&this.#i.set(n,!0)}_onColButtonClick(e,n){n.stopPropagation();let r=e.button===!1?this.columnButtonIcon:typeof e.button==`object`&&e.button.icon?e.button.icon:this.columnButtonIcon,i=n.currentTarget,a=new CustomEvent(`datagrid-header-button-click`,{detail:{key:e.key,column:e,icon:r,clientX:n.clientX,clientY:n.clientY,anchorElement:i},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(a),a.defaultPrevented&&this.#i.set(n,!0)}_onRowClick(e,n,r){if(!(this.#a.isDragging||this.#r!==0)&&!(n&&n.selectable===!1)&&(this.selectionMode!==`none`||this.interactionMode===`checked`||this.interactionMode===`sticky`)&&this.interactionMode!==`manual`){if(this.interactionMode===`implicit`){this._replaceSelection(e);return}if(this.interactionMode!==`checked`){if(this.interactionMode===`sticky`){this._toggleSelection(e);return}r.ctrlKey||r.metaKey?(this.selectionMode===`multiple`||this.interactionMode===`vscode`)&&this._toggleSelection(e):r.shiftKey&&(this.selectionMode===`multiple`||this.interactionMode===`vscode`)?this._rangeSelectTo(e):this._replaceSelection(e)}}}_onCheckboxClick(e,n){n.stopPropagation(),this._onRowClick(e,null,n)}_onVisibilityToggle(e,n){e.visible=n,this.columns=[...this.columns],this.dispatchEvent(new CustomEvent(`datagrid-column-visibility`,{detail:{key:e.key,visible:n},bubbles:!0,composed:!0}))}_beginHeaderDrag(e,n,r){e.stopPropagation();let i=e.currentTarget.closest(`.header-cell`)??e.currentTarget;this._drag={pointerId:e.pointerId,from:r,startX:e.clientX,startY:e.clientY,active:!1,ghost:null,gap:void 0,sourceCol:n};let a=e=>{if(!this._drag||e.pointerId!==this._drag.pointerId)return;let r=e.clientX-this._drag.startX,a=e.clientY-this._drag.startY;if(!this._drag.active){if(Math.hypot(r,a)<5)return;this._drag.active=!0;let o=document.createElement(`span`);o.textContent=n.label;try{this._drag.ghost=Wg({anchor:i,content:o}),this._drag.ghost.move(e.clientX,e.clientY)}catch{}try{this._headerRowEl?.setPointerCapture(e.pointerId)}catch{}}this._drag.ghost?.move(e.clientX,e.clientY);let o=e.clientX-(this._headerRowEl?.getBoundingClientRect().left??0),s=this._drag.from,c=1/0;for(let e=0;e<this._visibleColumns.length;e++){if(e===this._drag.from)continue;let n=this._colOffsets[e],r=n+(this._visibleColumns[e].width??150),i=(n+r)/2,a=o<i?n:r,l=o<i?e:e+1,u=Math.abs(o-a);u<c&&(c=u,s=l>this._drag.from?l-1:l)}if(this._visibleColumns.length>0){let e=this._colOffsets[this._colOffsets.length-1]+(this._visibleColumns[this._visibleColumns.length-1].width??150),n=Math.abs(o-e);n<c&&(c=n,s=this._visibleColumns.length-1,this._drag.from===this._visibleColumns.length-1?s=this._drag.from:s>=this._drag.from&&(s=this._visibleColumns.length-1))}let l=this._visibleColumns.length-1,u=s;u<0&&(u=0),u>l&&(u=l),this._drag.gap=u,this.requestUpdate()},o=e=>{if(!this._drag||e.pointerId!==this._drag.pointerId)return;let n=this._drag.active,r=this._drag.from,i=this._drag.gap;this._drag.ghost?.destroy();try{this._headerRowEl?.releasePointerCapture(e.pointerId)}catch{}window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),this._drag=null,this.requestUpdate(),n&&i!==void 0&&i!==r&&this._onReorderDrag(r,i)};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,o)}_onReorderDrag(e,n){if(e===n)return;let r=[...this.columns],i=r.filter(e=>e.visible!==!1),a=r.filter(e=>e.visible===!1),[o]=i.splice(e,1);i.splice(n,0,o),this.columns=[...i,...a],this.dispatchEvent(new CustomEvent(`datagrid-column-reorder`,{detail:{from:e,to:n,columns:[...this.columns]},bubbles:!0,composed:!0}))}_scrollRowIntoView(e){let n=this.#c.get(e);if(n===void 0||!this._viewportEl)return;let r=this.rowHeight,i=(n>0&&this._flat[n-1].type===`group`?n-1:n)*r,a=(n+1)*r,o=this._viewportEl.scrollTop,s=this.#L(),c=o;i<o?c=i:a>o+s&&(c=a-s),c!==o&&(this._viewportEl.scrollTop=c,this._scrollTop=c,this.requestUpdate())}_getRowForKey(e){let n=this.#c.get(e),r=n===void 0?void 0:this._flat[n];return r?.type===`row`?r.row:void 0}get selectedKeys(){return this._selectedKeys}set selectedKeys(e){this.selectKeys(e)}selectKeys(e){let n=new Set([...e].filter(e=>this._getRowForKey(e)!==void 0)),r=this.selectionMode===`multiple`||this.interactionMode===`checked`||this.interactionMode===`sticky`||this.interactionMode===`vscode`;if(this.selectionMode===`none`)n=new Set;else if(!r&&n.size>1){let e=[...n].at(-1);n=e===void 0?new Set:new Set([e])}let i=new Set(this._selectedKeys);i.size===n.size&&[...n].every(e=>i.has(e))||(this._selectedKeys=n,this._anchorKey=[...n].at(-1),this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(n),previous:i},bubbles:!0,composed:!0})))}get tickledKey(){return this._tickled.tickledId}tickleRow(e){!this.#c.has(e)||e.startsWith(`__group__`)||(this._tickled.focus(e),this._scrollRowIntoView(e))}appendRows(e){if(e.length===0)return;let n=this.rows.length,r=this._sortedRows.length===n&&p_(this.#d,[this.rows,this.sortState,this.columns]);if(this.rows=[...this.rows,...e],!r)return;let i=this.rows.slice(n);this._sortedRows=[...this._sortedRows,...i],this.#I(i,n),this.#M(),this.sortState!=null&&(cancelAnimationFrame(this.#O),this.#O=requestAnimationFrame(()=>{this.#d=void 0,this.requestUpdate()}))}#I(e,n){if(this.groupBy){this._rebuildFlat();return}for(let r=0;r<e.length;r++){let i=n+r;if(this.filterPredicate&&!this.filterPredicate(e[r]))continue;let a=this.getRowKey(e[r],i);this._flat.push({type:`row`,key:a,row:e[r],idx:i}),this._flatKeys.push(a),this.#c.set(a,this._flat.length-1)}this.#l++,this.#p=void 0}_replaceSelection(e){if(this.selectionMode===`none`)return;let n=new Set(this._selectedKeys);if(this.groupBy&&!this.crossGroupSelection){let r=this._getGroupKey(this._getRowForKey(e)??{key:e});[...n].filter(e=>this._getGroupKey(this._getRowForKey(e)??{key:e})===r),this._selectedKeys=new Set([e])}else this._selectedKeys=new Set([e]);this._anchorKey=e,this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(this._selectedKeys),previous:n},bubbles:!0,composed:!0}))}_toggleSelection(e){let n=new Set(this._selectedKeys),r=new Set(this._selectedKeys);if(r.has(e))r.delete(e);else{if(this.groupBy&&!this.crossGroupSelection){let n=this._getGroupKey(this._getRowForKey(e)??{key:e});for(let e of[...r])this._getGroupKey(this._getRowForKey(e)??{key:e})!==n&&r.delete(e)}this.selectionMode!==`multiple`&&this.interactionMode!==`checked`&&this.interactionMode!==`sticky`&&r.clear(),r.add(e)}this._selectedKeys=r,this._anchorKey=e,this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(this._selectedKeys),previous:n},bubbles:!0,composed:!0}))}_rangeSelectTo(e){if(!this._anchorKey){this._replaceSelection(e);return}let n=this._flat.filter(e=>e.type===`row`).map(e=>e.key),r=n.indexOf(this._anchorKey),i=n.indexOf(e);if(r<0||i<0){this._replaceSelection(e);return}if(this.groupBy&&!this.crossGroupSelection){let r=this._getGroupKey(this._getRowForKey(this._anchorKey)??{key:this._anchorKey});if(r!==this._getGroupKey(this._getRowForKey(e)??{key:e})){this._replaceSelection(e);return}let i=n.filter(e=>this._getGroupKey(this._getRowForKey(e)??{key:e})===r),a=i.indexOf(this._anchorKey),o=i.indexOf(e);if(a<0||o<0){this._replaceSelection(e);return}let s=Math.min(a,o),c=Math.max(a,o),l=new Set(this._selectedKeys);this._selectedKeys=new Set(i.slice(s,c+1)),this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(this._selectedKeys),previous:l},bubbles:!0,composed:!0}));return}let a=Math.min(r,i),o=Math.max(r,i),s=new Set(this._selectedKeys);this._selectedKeys=new Set(n.slice(a,o+1)),this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(this._selectedKeys),previous:s},bubbles:!0,composed:!0}))}_isEditable(e,n){return this.editability===`disabled`?!1:typeof this.editable==`function`?this.editable(e,n):this.editable===!0?n.editable!==!1:!!n.editable}_isTextEditor(e){let n=e.editor;return!n||n===`auto`}_isCellEditing(e,n){return this.editability===`immediate`&&this._isEditable(this.#F(e)?.row??{},this.columns.find(e=>e.key===n))?!0:this._editingRow===e?this._isEditable(this.#F(e)?.row??{},this.columns.find(e=>e.key===n)):this._editing?.rowKey===e&&this._editing?.colKey===n}_activateRow(e,n,r){this.dispatchEvent(new CustomEvent(`datagrid-row-activate`,{detail:{rowKey:e,row:n,rowIndex:r},bubbles:!0,composed:!0}))}_startEdit(e,n){if(this.editability===`disabled`)return;let r=this.#F(e)?.row;if(!r)return;let i=this.columns.find(e=>e.key===n);!i||!this._isEditable(r,i)||(this._editing={rowKey:e,colKey:n},this._editingRow=null,this._editValue=r[n])}startEdit(e,n){this._startEdit(e,n)}startRowEdit(e){this.editability!==`disabled`&&this.#F(e)?.row&&(this._editing=null,this._editingRow=e,this.requestUpdate())}stopEdit(){this._editing=null,this._editingRow=null}setColumnFormatter(e,n,r){if(!n){this._columnFormatters.delete(e),this.requestUpdate();return}if(typeof n==`string`){let i=r?.digits??(n===`integer`?0:2);n===`fixed`?this._columnFormatters.set(e,e=>typeof e==`number`&&Number.isFinite(e)?e.toFixed(i):String(e??``)):n===`percentage`?this._columnFormatters.set(e,e=>typeof e==`number`&&Number.isFinite(e)?`${e.toFixed(i)}%`:String(e??``)):n===`integer`&&this._columnFormatters.set(e,e=>typeof e==`number`&&Number.isFinite(e)?Math.round(e).toString():String(e??``))}else this._columnFormatters.set(e,n);this.requestUpdate()}_formatValue(e,n,r){let i=this._columnFormatters.get(n.key);return i?i(e):n.formatter?n.formatter(e,r,n):this.globalFormatter?this.globalFormatter(e,n.key,r):e}_cellLook(e,n){if(this.textColorColumn===``&&this.iconColumn===``&&this.badgeColumn===``)return d_;let r=typeof e==`object`&&e?e:{},i=n===this.textColorColumn?Vg(r.textColor):void 0,a=n===this.iconColumn&&!Bg(r.icon)?r.icon:void 0,o=a===void 0?void 0:Vg(r.iconColor),s=n===this.badgeColumn&&!Bg(r.badge)?r.badge:void 0;return i===void 0&&a===void 0&&s===void 0?d_:{textColor:i,icon:a,iconColor:o,badge:s}}_handleCellSecondClick(e,n){if(this.editability!==`user`)return;let r=Date.now();this._lastClick&&this._lastClick.key===e&&this._lastClick.col===n.key&&r-this._lastClick.time<700&&r-this._lastClick.time>150?(this._startEdit(e,n.key),this._lastClick=null):this._lastClick={key:e,col:n.key,time:r}}_commitEdit(e=!1){if(!this._editing&&!e)return;let n=this._editing;if(!n)return;let{rowKey:r,colKey:i}=n,a=this.#F(r)?.row;if(!a){this._editing=null;return}let o=a[i],s=this._editValue,c=this.columns.find(e=>e.key===i);c?.editor&&typeof c.editor==`function`||(a[i]=s,this.rows=[...this.rows]),this._editing=null,this.dispatchEvent(new CustomEvent(`datagrid-cell-edit`,{detail:{rowKey:r,colKey:i,oldValue:o,newValue:s},bubbles:!0,composed:!0}))}_tabToNext(e,n,r){let i=this.#F(e)?.row;if(!i)return;let a=this._visibleColumns,o=a.findIndex(e=>e.key===n)+r;for(;o>=0&&o<a.length;){if(this._isEditable(i,a[o])){this._editing&&this._commitEdit(),this._suppressBlurCommit=!0,this._startEdit(e,a[o].key),requestAnimationFrame(()=>{this._suppressBlurCommit=!1});return}o+=r}this._editing&&this._commitEdit(),this._editing=null,this.requestUpdate()}_commitImmediate(e,n,r){let i=this.#F(e)?.row;if(!i)return;let a=i[n];a!==r&&(i[n]=r,this.rows=[...this.rows],this.dispatchEvent(new CustomEvent(`datagrid-cell-edit`,{detail:{rowKey:e,colKey:n,oldValue:a,newValue:r},bubbles:!0,composed:!0})))}_measureAutoWidth(e){let n=getComputedStyle(this),r=`${n.fontSize} ${n.fontFamily}`,i=document.createElement(`canvas`).getContext(`2d`),a=e=>i?(i.font=r,Math.ceil(i.measureText(e).width)):e.length*8,o=a(e.label)+40;for(let n of this.rows){let r=n[e.key];if(r==null||r===``)continue;let i=a(String(this._formatValue(r,e,n)))+24;i>o&&(o=i)}let s=e.minWidth??40,c=e.maxWidth??600;return Math.max(s,Math.min(c,o))}_autoSizeColumn(e){let n=this._measureAutoWidth(e);e.width=n,this.requestUpdate(),this.dispatchEvent(new CustomEvent(`datagrid-column-resize`,{detail:{key:e.key,width:n},bubbles:!0,composed:!0}))}autoSizeColumn(e){let n=this.columns.find(n=>n.key===e);if(!n||n.resizable===!1||n.renderer)return!1;let r=this._measureAutoWidth(n);return(n.width??150)===r||(this._animatingColKeys=new Set(this._animatingColKeys).add(e),requestAnimationFrame(()=>{n.width=r,this.requestUpdate(),this.dispatchEvent(new CustomEvent(`datagrid-column-resize`,{detail:{key:e,width:r},bubbles:!0,composed:!0})),window.setTimeout(()=>{let n=new Set(this._animatingColKeys);n.delete(e),this._animatingColKeys=n},this._columnResizeAnimationMs())}),!0)}_columnResizeAnimationMs(){let e=getComputedStyle(this).getPropertyValue(`--data-grid-column-resize-duration`).trim(),n=e.endsWith(`ms`)?Number.parseFloat(e):e.endsWith(`s`)?Number.parseFloat(e)*1e3:Number.parseFloat(e);return(Number.isFinite(n)&&n>0?n:180)+30}_onResizePointerDown(e,n){e.preventDefault(),e.stopPropagation();let r=e.clientX,i=n.width??150;this._resizingColKey=n.key;let a=e=>{n.width=Math.max(n.minWidth??40,Math.min(n.maxWidth??600,i+e.clientX-r)),this.requestUpdate()},o=e=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),this._resizingColKey=void 0;let s=Math.max(n.minWidth??40,Math.min(n.maxWidth??600,i+e.clientX-r));this.dispatchEvent(new CustomEvent(`datagrid-column-resize`,{detail:{key:n.key,width:s},bubbles:!0,composed:!0}))};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o)}#L(){return this._viewportEl.clientHeight-(this._headerRowEl?.offsetHeight??0)}#R(e){let n=this.rowHeight;return{start:Math.max(0,Math.floor(this._scrollTop/n)-e),end:Math.min(this._flat.length,Math.ceil((this._scrollTop+this._viewportH)/n)+e)}}getVisibleRange(){let{start:e,end:n}=this.#R(2);return{startRow:e,endRow:n,startCol:this._findFirstVisibleCol(this._scrollLeft),endCol:this._findLastVisibleCol(this._scrollLeft+this._viewportW)}}renderedKeys(){let{startRow:e,endRow:n}=this.getVisibleRange();return this._flat.slice(e,n).filter(e=>e.type===`row`).map(e=>e.key)}#z(){let{start:e,end:n}=this.#R(0);return this._flat.slice(e,n).filter(e=>e.type===`row`).map(e=>e.key)}#B(){this.#T===0&&(this.#T=requestAnimationFrame(()=>{this.#T=0,this.#V()}))}#V(){let e=this.renderedKeys(),n=this.#z();f_(this.#E,e)&&f_(this.#D,n)||(this.#E=e,this.#D=n,this.dispatchEvent(new CustomEvent(`datagrid-viewport-change`,{detail:{renderedKeys:e,visibleKeys:n},bubbles:!0,composed:!0})))}_findFirstVisibleCol(e){let n=0,r=this._colOffsets.length-1,i=0;for(;n<=r;){let a=n+r>>1;this._colOffsets[a]<=e?(i=a,n=a+1):r=a-1}return i}_findLastVisibleCol(e){for(let n=0;n<this._colOffsets.length;n++)if(this._colOffsets[n]>e)return n;return this._colOffsets.length}render(){let e=this.rowHeight,{start:n,end:r}=this.#R(2),o=this._flat.slice(n,r).map((e,r)=>({entry:e,absIdx:n+r})),s=this._editing?.rowKey??this._editingRow,c=s?this.#c.get(s):void 0;c!==void 0&&(c>=n&&c<r&&o.splice(c-n,1),o.unshift({entry:this._flat[c],absIdx:c}));let l=this.interactionMode===`checked`;return i`
|
|
5315
|
+
`]}#e;#t;#n;#r;#i;#a;#o(e){let n=this._flat.filter(e=>e.type===`row`);if(!n.some(n=>n.key===e))return;this._selectedKeys.has(e)||this._replaceSelection(e);let r=[],i=0;for(let e of n){if(!this._selectedKeys.has(e.key)){i++;continue}let n=this.renderRoot.querySelector(`.row[data-key="${CSS.escape(e.key)}"]`)??void 0;r.push({key:e.key,index:i,item:e.row,...n?{element:n}:{}}),i++}let a=r.find(n=>n.key===e);if(a)return{origin:a,selected:r}}#s(){this.#r&&clearTimeout(this.#r),this.#r=window.setTimeout(()=>{this.#r=0},0)}#c;#l;#u;#d;#f;#p;#m;#h;#g;get registry(){return this.#m}#_(e){if(this.rowSearchText)return this.rowSearchText(e);let n=e;return this._visibleColumns.map(e=>String(n[e.key]??``)).join(` `)}#v(){return{getItems:()=>(this.#g.clear(),this._sortedRows.forEach((e,n)=>this.#g.set(e,this.getRowKey(e,n))),this._sortedRows),getLabel:e=>this.#_(e),getKey:e=>this.#g.get(e)??String(this._sortedRows.indexOf(e)),focusItem:e=>{if(e===void 0)return;let n=this.#g.get(e);n!==void 0&&this.tickleRow(n)},selectItems:e=>{this.selectKeys(e.map(e=>this.#g.get(e)).filter(e=>e!==void 0))},applyFilter:e=>{this.filterPredicate=e===void 0?void 0:n=>{let r=this.#g.get(n);return r===void 0||e.has(r)}}}}#y(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#b(){this.#m&&(this.search.setModes(this.#y()),this.#h?.(),this.#h=Rt(this.#m,this.search))}#x;#S;#C;#w;#T;#E;#D;#O;#k;connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`focusout`,this._onFocusOut),this.#m??=Yt(),this.#b(),this.#k=Kg(()=>this._viewportEl??void 0)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`focusout`,this._onFocusOut),cancelAnimationFrame(this._raf),cancelAnimationFrame(this.#T),this.#T=0,this.#h?.(),this.#h=void 0,this.#m=void 0,this.#C&&=(clearTimeout(this.#C),0),this.#r&&=(clearTimeout(this.#r),0),this.#e?.disconnect(),this.#e=void 0,this.#k?.(),this.#k=void 0}dispatch(e,n){this.#m?.invoke(e,n)}firstUpdated(){this.#e=new ResizeObserver(()=>this.#A()),this.#e.observe(this._viewportEl),this.#A()}#A(){if(!this._viewportEl)return;let e=this._viewportEl,n=e.clientWidth,r=this.#L();if(n<=0||r<=0)return;let i=e.parentElement;i.style.setProperty(`--data-grid-scrollbar-width`,`${e.offsetWidth-n}px`),i.style.setProperty(`--data-grid-viewport-width`,`${n}px`),(n!==this._viewportW||r!==this._viewportH)&&(this._viewportW=n,this._viewportH=r,this.#B())}refreshLayout(){this.#A(),this.requestUpdate()}updated(e){super.updated(e),(e.has(`rows`)||e.has(`sortState`)||e.has(`columns`)||e.has(`groupBy`)||e.has(`groupLabel`)||e.has(`filterPredicate`)||e.has(`rowHeight`))&&this.#B(),(e.has(`_editing`)||e.has(`_editingRow`))&&this.updateComplete.then(()=>{let e=null;if(this._editing?e=`.row[data-key="${this._editing.rowKey}"] .cell[data-col="${this._editing.colKey}"] input, .row[data-key="${this._editing.rowKey}"] .cell[data-col="${this._editing.colKey}"] select`:this._editingRow&&(e=`.row[data-key="${this._editingRow}"] .cell input, .row[data-key="${this._editingRow}"] .cell select`),!e)return;let n=this.renderRoot.querySelector(e);n?.focus(),n instanceof HTMLInputElement&&n.type===`text`&&n.select()})}willUpdate(e){super.willUpdate(e),this.setAttribute(`data-input-mode`,this._tickled.inputMode),e.has(`searchModes`)&&this.#b(),this.#j(),this._visibleColumns=this.columns.filter(e=>e.visible!==!1);let n=0;this._colOffsets=this._visibleColumns.map(e=>{let r=n;return n+=e.width??150,r}),this._colWidthSum=n,this.interactionMode===`checked`&&(this._colWidthSum+=28),this.#l!==this.#u&&(this.#u=this.#l,this.#N())}#j(){let e=[this.rows,this.sortState,this.columns],n=[this.filterPredicate,this.groupBy,this.groupLabel,this._collapsedGroups,this.getRowKey],r=!m_(this.#d,e);r&&(this.#d=e,this._sortedRows=this._applySort([...this.rows])),(r||!m_(this.#f,n))&&(this.#f=n,this._rebuildFlat())}#M(){this.#d=[this.rows,this.sortState,this.columns],this.#f=[this.filterPredicate,this.groupBy,this.groupLabel,this._collapsedGroups,this.getRowKey]}#N(){let e=this._flatKeys,n=this.#x;if(this.#x=e.slice(),!this.#w){this.#w=!0;return}if(n.length===0||e.length===0){this.#S.clear();return}let r=new Set(n),i=e.filter(e=>!r.has(e)),a=n.length-(e.length-i.length);i.length===e.length||i.length===0&&a===0||(this.#S=new Set(i),this.toggleAttribute(`reflowing`,!0),this.#C&&clearTimeout(this.#C),this.#C=window.setTimeout(()=>{this.#C=0,this.#S.clear(),this.toggleAttribute(`reflowing`,!1),this.requestUpdate()},320))}_getGroupKey(e){return this.groupBy?typeof this.groupBy==`string`?String(e[this.groupBy]??``):String(this.groupBy(e)):null}_rebuildFlat(){let e=this.filterPredicate,n=[];for(let r=0;r<this._sortedRows.length;r++)(!e||e(this._sortedRows[r]))&&n.push(r);let r=[],i=[],a=e=>{let n=this._sortedRows[e],a=this.getRowKey(n,e);r.push({type:`row`,key:a,row:n,idx:e}),i.push(a)};if(!this.groupBy)n.forEach(a);else{let e=new Map;for(let r of n){let n=this._getGroupKey(this._sortedRows[r])??``,i=e.get(n);i?i.push(r):e.set(n,[r])}for(let[n,o]of e){let e=this.groupLabel?this.groupLabel(n,o.map(e=>this._sortedRows[e])):n,s=`__group__${n}`;r.push({type:`group`,key:s,label:e,count:o.length}),i.push(s),this._collapsedGroups.has(n)||o.forEach(a)}}this._flat=r,this._flatKeys=i,this.#P()}#P(){this.#c.clear(),this._flat.forEach((e,n)=>this.#c.set(e.key,n)),this.#l++,this.#p=void 0}#F(e){let n=this.#c.get(e),r=n===void 0?void 0:this._flat[n];if(r?.type===`row`)return r;let i=this._sortedRows.findIndex((n,r)=>this.getRowKey(n,r)===e);return i<0?void 0:{row:this._sortedRows[i],idx:i}}_toggleGroup(e){let n=new Set(this._collapsedGroups);n.has(e)?n.delete(e):n.add(e),this._collapsedGroups=n}_applySort(e){if(!this.sortState)return e;let n=this.columns.find(e=>e.key===this.sortState.key);if(!n)return e;let r=this.sortState.direction===`asc`?1:-1;if(n.sortFn)return e.sort((e,i)=>r*n.sortFn(e,i));let i=n.dataType??`text`;return e.sort((e,a)=>{let o=e[n.key],s=a[n.key];return o===s?0:i===`number`?r*(o-s):i===`boolean`?r*(!!o==!!s?0:o?1:-1):r*String(o).localeCompare(String(s))})}_onHeaderClick(e,n){if(e.sortable===!1)return;if(n){let e=n.composedPath()[0];if(e&&this.#i.get(e)){this.#i.delete(e);return}}let r=this.sortState,i=null;i=!r||r.key!==e.key?{key:e.key,direction:`asc`}:r.direction===`asc`?{key:e.key,direction:`desc`}:null,this.sortState=i,this.dispatchEvent(new CustomEvent(`datagrid-sort`,{detail:{sort:i,previous:r},bubbles:!0,composed:!0}))}_onHeaderPointerUp(e,n){let r=!1,i=new CustomEvent(`datagrid-header-pointerup`,{detail:{key:e.key,column:e},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(i),i.defaultPrevented&&(r=!0),r&&this.#i.set(n,!0)}_onColButtonClick(e,n){n.stopPropagation();let r=e.button===!1?this.columnButtonIcon:typeof e.button==`object`&&e.button.icon?e.button.icon:this.columnButtonIcon,i=n.currentTarget,a=new CustomEvent(`datagrid-header-button-click`,{detail:{key:e.key,column:e,icon:r,clientX:n.clientX,clientY:n.clientY,anchorElement:i},bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(a),a.defaultPrevented&&this.#i.set(n,!0)}_onRowClick(e,n,r){if(!(this.#a.isDragging||this.#r!==0)&&!(n&&n.selectable===!1)&&(this.selectionMode!==`none`||this.interactionMode===`checked`||this.interactionMode===`sticky`)&&this.interactionMode!==`manual`){if(this.interactionMode===`implicit`){this._replaceSelection(e);return}if(this.interactionMode!==`checked`){if(this.interactionMode===`sticky`){this._toggleSelection(e);return}r.ctrlKey||r.metaKey?(this.selectionMode===`multiple`||this.interactionMode===`vscode`)&&this._toggleSelection(e):r.shiftKey&&(this.selectionMode===`multiple`||this.interactionMode===`vscode`)?this._rangeSelectTo(e):this._replaceSelection(e)}}}_onCheckboxClick(e,n){n.stopPropagation(),this._onRowClick(e,null,n)}_onVisibilityToggle(e,n){e.visible=n,this.columns=[...this.columns],this.dispatchEvent(new CustomEvent(`datagrid-column-visibility`,{detail:{key:e.key,visible:n},bubbles:!0,composed:!0}))}_beginHeaderDrag(e,n,r){e.stopPropagation();let i=e.currentTarget.closest(`.header-cell`)??e.currentTarget;this._drag={pointerId:e.pointerId,from:r,startX:e.clientX,startY:e.clientY,active:!1,ghost:null,gap:void 0,sourceCol:n};let a=e=>{if(!this._drag||e.pointerId!==this._drag.pointerId)return;let r=e.clientX-this._drag.startX,a=e.clientY-this._drag.startY;if(!this._drag.active){if(Math.hypot(r,a)<5)return;this._drag.active=!0;let o=document.createElement(`span`);o.textContent=n.label;try{this._drag.ghost=Gg({anchor:i,content:o}),this._drag.ghost.move(e.clientX,e.clientY)}catch{}try{this._headerRowEl?.setPointerCapture(e.pointerId)}catch{}}this._drag.ghost?.move(e.clientX,e.clientY);let o=e.clientX-(this._headerRowEl?.getBoundingClientRect().left??0),s=this._drag.from,c=1/0;for(let e=0;e<this._visibleColumns.length;e++){if(e===this._drag.from)continue;let n=this._colOffsets[e],r=n+(this._visibleColumns[e].width??150),i=(n+r)/2,a=o<i?n:r,l=o<i?e:e+1,u=Math.abs(o-a);u<c&&(c=u,s=l>this._drag.from?l-1:l)}if(this._visibleColumns.length>0){let e=this._colOffsets[this._colOffsets.length-1]+(this._visibleColumns[this._visibleColumns.length-1].width??150),n=Math.abs(o-e);n<c&&(c=n,s=this._visibleColumns.length-1,this._drag.from===this._visibleColumns.length-1?s=this._drag.from:s>=this._drag.from&&(s=this._visibleColumns.length-1))}let l=this._visibleColumns.length-1,u=s;u<0&&(u=0),u>l&&(u=l),this._drag.gap=u,this.requestUpdate()},o=e=>{if(!this._drag||e.pointerId!==this._drag.pointerId)return;let n=this._drag.active,r=this._drag.from,i=this._drag.gap;this._drag.ghost?.destroy();try{this._headerRowEl?.releasePointerCapture(e.pointerId)}catch{}window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),window.removeEventListener(`pointercancel`,o),this._drag=null,this.requestUpdate(),n&&i!==void 0&&i!==r&&this._onReorderDrag(r,i)};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o),window.addEventListener(`pointercancel`,o)}_onReorderDrag(e,n){if(e===n)return;let r=[...this.columns],i=r.filter(e=>e.visible!==!1),a=r.filter(e=>e.visible===!1),[o]=i.splice(e,1);i.splice(n,0,o),this.columns=[...i,...a],this.dispatchEvent(new CustomEvent(`datagrid-column-reorder`,{detail:{from:e,to:n,columns:[...this.columns]},bubbles:!0,composed:!0}))}_scrollRowIntoView(e){let n=this.#c.get(e);if(n===void 0||!this._viewportEl)return;let r=this.rowHeight,i=(n>0&&this._flat[n-1].type===`group`?n-1:n)*r,a=(n+1)*r,o=this._viewportEl.scrollTop,s=this.#L(),c=o;i<o?c=i:a>o+s&&(c=a-s),c!==o&&(this._viewportEl.scrollTop=c,this._scrollTop=c,this.requestUpdate())}_getRowForKey(e){let n=this.#c.get(e),r=n===void 0?void 0:this._flat[n];return r?.type===`row`?r.row:void 0}get selectedKeys(){return this._selectedKeys}set selectedKeys(e){this.selectKeys(e)}selectKeys(e){let n=new Set([...e].filter(e=>this._getRowForKey(e)!==void 0)),r=this.selectionMode===`multiple`||this.interactionMode===`checked`||this.interactionMode===`sticky`||this.interactionMode===`vscode`;if(this.selectionMode===`none`)n=new Set;else if(!r&&n.size>1){let e=[...n].at(-1);n=e===void 0?new Set:new Set([e])}let i=new Set(this._selectedKeys);i.size===n.size&&[...n].every(e=>i.has(e))||(this._selectedKeys=n,this._anchorKey=[...n].at(-1),this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(n),previous:i},bubbles:!0,composed:!0})))}get tickledKey(){return this._tickled.tickledId}tickleRow(e){!this.#c.has(e)||e.startsWith(`__group__`)||(this._tickled.focus(e),this._scrollRowIntoView(e))}appendRows(e){if(e.length===0)return;let n=this.rows.length,r=this._sortedRows.length===n&&m_(this.#d,[this.rows,this.sortState,this.columns]);if(this.rows=[...this.rows,...e],!r)return;let i=this.rows.slice(n);this._sortedRows=[...this._sortedRows,...i],this.#I(i,n),this.#M(),this.sortState!=null&&(cancelAnimationFrame(this.#O),this.#O=requestAnimationFrame(()=>{this.#d=void 0,this.requestUpdate()}))}#I(e,n){if(this.groupBy){this._rebuildFlat();return}for(let r=0;r<e.length;r++){let i=n+r;if(this.filterPredicate&&!this.filterPredicate(e[r]))continue;let a=this.getRowKey(e[r],i);this._flat.push({type:`row`,key:a,row:e[r],idx:i}),this._flatKeys.push(a),this.#c.set(a,this._flat.length-1)}this.#l++,this.#p=void 0}_replaceSelection(e){if(this.selectionMode===`none`)return;let n=new Set(this._selectedKeys);if(this.groupBy&&!this.crossGroupSelection){let r=this._getGroupKey(this._getRowForKey(e)??{key:e});[...n].filter(e=>this._getGroupKey(this._getRowForKey(e)??{key:e})===r),this._selectedKeys=new Set([e])}else this._selectedKeys=new Set([e]);this._anchorKey=e,this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(this._selectedKeys),previous:n},bubbles:!0,composed:!0}))}_toggleSelection(e){let n=new Set(this._selectedKeys),r=new Set(this._selectedKeys);if(r.has(e))r.delete(e);else{if(this.groupBy&&!this.crossGroupSelection){let n=this._getGroupKey(this._getRowForKey(e)??{key:e});for(let e of[...r])this._getGroupKey(this._getRowForKey(e)??{key:e})!==n&&r.delete(e)}this.selectionMode!==`multiple`&&this.interactionMode!==`checked`&&this.interactionMode!==`sticky`&&r.clear(),r.add(e)}this._selectedKeys=r,this._anchorKey=e,this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(this._selectedKeys),previous:n},bubbles:!0,composed:!0}))}_rangeSelectTo(e){if(!this._anchorKey){this._replaceSelection(e);return}let n=this._flat.filter(e=>e.type===`row`).map(e=>e.key),r=n.indexOf(this._anchorKey),i=n.indexOf(e);if(r<0||i<0){this._replaceSelection(e);return}if(this.groupBy&&!this.crossGroupSelection){let r=this._getGroupKey(this._getRowForKey(this._anchorKey)??{key:this._anchorKey});if(r!==this._getGroupKey(this._getRowForKey(e)??{key:e})){this._replaceSelection(e);return}let i=n.filter(e=>this._getGroupKey(this._getRowForKey(e)??{key:e})===r),a=i.indexOf(this._anchorKey),o=i.indexOf(e);if(a<0||o<0){this._replaceSelection(e);return}let s=Math.min(a,o),c=Math.max(a,o),l=new Set(this._selectedKeys);this._selectedKeys=new Set(i.slice(s,c+1)),this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(this._selectedKeys),previous:l},bubbles:!0,composed:!0}));return}let a=Math.min(r,i),o=Math.max(r,i),s=new Set(this._selectedKeys);this._selectedKeys=new Set(n.slice(a,o+1)),this.dispatchEvent(new CustomEvent(`datagrid-select`,{detail:{selectedKeys:new Set(this._selectedKeys),previous:s},bubbles:!0,composed:!0}))}_isEditable(e,n){return this.editability===`disabled`?!1:typeof this.editable==`function`?this.editable(e,n):this.editable===!0?n.editable!==!1:!!n.editable}_isTextEditor(e){let n=e.editor;return!n||n===`auto`}_isCellEditing(e,n){return this.editability===`immediate`&&this._isEditable(this.#F(e)?.row??{},this.columns.find(e=>e.key===n))?!0:this._editingRow===e?this._isEditable(this.#F(e)?.row??{},this.columns.find(e=>e.key===n)):this._editing?.rowKey===e&&this._editing?.colKey===n}_activateRow(e,n,r){this.dispatchEvent(new CustomEvent(`datagrid-row-activate`,{detail:{rowKey:e,row:n,rowIndex:r},bubbles:!0,composed:!0}))}_startEdit(e,n){if(this.editability===`disabled`)return;let r=this.#F(e)?.row;if(!r)return;let i=this.columns.find(e=>e.key===n);!i||!this._isEditable(r,i)||(this._editing={rowKey:e,colKey:n},this._editingRow=null,this._editValue=r[n])}startEdit(e,n){this._startEdit(e,n)}startRowEdit(e){this.editability!==`disabled`&&this.#F(e)?.row&&(this._editing=null,this._editingRow=e,this.requestUpdate())}stopEdit(){this._editing=null,this._editingRow=null}setColumnFormatter(e,n,r){if(!n){this._columnFormatters.delete(e),this.requestUpdate();return}if(typeof n==`string`){let i=r?.digits??(n===`integer`?0:2);n===`fixed`?this._columnFormatters.set(e,e=>typeof e==`number`&&Number.isFinite(e)?e.toFixed(i):String(e??``)):n===`percentage`?this._columnFormatters.set(e,e=>typeof e==`number`&&Number.isFinite(e)?`${e.toFixed(i)}%`:String(e??``)):n===`integer`&&this._columnFormatters.set(e,e=>typeof e==`number`&&Number.isFinite(e)?Math.round(e).toString():String(e??``))}else this._columnFormatters.set(e,n);this.requestUpdate()}_formatValue(e,n,r){let i=this._columnFormatters.get(n.key);return i?i(e):n.formatter?n.formatter(e,r,n):this.globalFormatter?this.globalFormatter(e,n.key,r):e}_cellLook(e,n){if(this.textColorColumn===``&&this.iconColumn===``&&this.badgeColumn===``)return f_;let r=typeof e==`object`&&e?e:{},i=n===this.textColorColumn?Hg(r.textColor):void 0,a=n===this.iconColumn&&!Vg(r.icon)?r.icon:void 0,o=a===void 0?void 0:Hg(r.iconColor),s=n===this.badgeColumn&&!Vg(r.badge)?r.badge:void 0;return i===void 0&&a===void 0&&s===void 0?f_:{textColor:i,icon:a,iconColor:o,badge:s}}_handleCellSecondClick(e,n){if(this.editability!==`user`)return;let r=Date.now();this._lastClick&&this._lastClick.key===e&&this._lastClick.col===n.key&&r-this._lastClick.time<700&&r-this._lastClick.time>150?(this._startEdit(e,n.key),this._lastClick=null):this._lastClick={key:e,col:n.key,time:r}}_commitEdit(e=!1){if(!this._editing&&!e)return;let n=this._editing;if(!n)return;let{rowKey:r,colKey:i}=n,a=this.#F(r)?.row;if(!a){this._editing=null;return}let o=a[i],s=this._editValue,c=this.columns.find(e=>e.key===i);c?.editor&&typeof c.editor==`function`||(a[i]=s,this.rows=[...this.rows]),this._editing=null,this.dispatchEvent(new CustomEvent(`datagrid-cell-edit`,{detail:{rowKey:r,colKey:i,oldValue:o,newValue:s},bubbles:!0,composed:!0}))}_tabToNext(e,n,r){let i=this.#F(e)?.row;if(!i)return;let a=this._visibleColumns,o=a.findIndex(e=>e.key===n)+r;for(;o>=0&&o<a.length;){if(this._isEditable(i,a[o])){this._editing&&this._commitEdit(),this._suppressBlurCommit=!0,this._startEdit(e,a[o].key),requestAnimationFrame(()=>{this._suppressBlurCommit=!1});return}o+=r}this._editing&&this._commitEdit(),this._editing=null,this.requestUpdate()}_commitImmediate(e,n,r){let i=this.#F(e)?.row;if(!i)return;let a=i[n];a!==r&&(i[n]=r,this.rows=[...this.rows],this.dispatchEvent(new CustomEvent(`datagrid-cell-edit`,{detail:{rowKey:e,colKey:n,oldValue:a,newValue:r},bubbles:!0,composed:!0})))}_measureAutoWidth(e){let n=getComputedStyle(this),r=`${n.fontSize} ${n.fontFamily}`,i=document.createElement(`canvas`).getContext(`2d`),a=e=>i?(i.font=r,Math.ceil(i.measureText(e).width)):e.length*8,o=a(e.label)+40;for(let n of this.rows){let r=n[e.key];if(r==null||r===``)continue;let i=a(String(this._formatValue(r,e,n)))+24;i>o&&(o=i)}let s=e.minWidth??40,c=e.maxWidth??600;return Math.max(s,Math.min(c,o))}_autoSizeColumn(e){let n=this._measureAutoWidth(e);e.width=n,this.requestUpdate(),this.dispatchEvent(new CustomEvent(`datagrid-column-resize`,{detail:{key:e.key,width:n},bubbles:!0,composed:!0}))}autoSizeColumn(e){let n=this.columns.find(n=>n.key===e);if(!n||n.resizable===!1||n.renderer)return!1;let r=this._measureAutoWidth(n);return(n.width??150)===r||(this._animatingColKeys=new Set(this._animatingColKeys).add(e),requestAnimationFrame(()=>{n.width=r,this.requestUpdate(),this.dispatchEvent(new CustomEvent(`datagrid-column-resize`,{detail:{key:e,width:r},bubbles:!0,composed:!0})),window.setTimeout(()=>{let n=new Set(this._animatingColKeys);n.delete(e),this._animatingColKeys=n},this._columnResizeAnimationMs())}),!0)}_columnResizeAnimationMs(){let e=getComputedStyle(this).getPropertyValue(`--data-grid-column-resize-duration`).trim(),n=e.endsWith(`ms`)?Number.parseFloat(e):e.endsWith(`s`)?Number.parseFloat(e)*1e3:Number.parseFloat(e);return(Number.isFinite(n)&&n>0?n:180)+30}_onResizePointerDown(e,n){e.preventDefault(),e.stopPropagation();let r=e.clientX,i=n.width??150;this._resizingColKey=n.key;let a=e=>{n.width=Math.max(n.minWidth??40,Math.min(n.maxWidth??600,i+e.clientX-r)),this.requestUpdate()},o=e=>{window.removeEventListener(`pointermove`,a),window.removeEventListener(`pointerup`,o),this._resizingColKey=void 0;let s=Math.max(n.minWidth??40,Math.min(n.maxWidth??600,i+e.clientX-r));this.dispatchEvent(new CustomEvent(`datagrid-column-resize`,{detail:{key:n.key,width:s},bubbles:!0,composed:!0}))};window.addEventListener(`pointermove`,a),window.addEventListener(`pointerup`,o)}#L(){return this._viewportEl.clientHeight-(this._headerRowEl?.offsetHeight??0)}#R(e){let n=this.rowHeight;return{start:Math.max(0,Math.floor(this._scrollTop/n)-e),end:Math.min(this._flat.length,Math.ceil((this._scrollTop+this._viewportH)/n)+e)}}getVisibleRange(){let{start:e,end:n}=this.#R(2);return{startRow:e,endRow:n,startCol:this._findFirstVisibleCol(this._scrollLeft),endCol:this._findLastVisibleCol(this._scrollLeft+this._viewportW)}}renderedKeys(){let{startRow:e,endRow:n}=this.getVisibleRange();return this._flat.slice(e,n).filter(e=>e.type===`row`).map(e=>e.key)}#z(){let{start:e,end:n}=this.#R(0);return this._flat.slice(e,n).filter(e=>e.type===`row`).map(e=>e.key)}#B(){this.#T===0&&(this.#T=requestAnimationFrame(()=>{this.#T=0,this.#V()}))}#V(){let e=this.renderedKeys(),n=this.#z();p_(this.#E,e)&&p_(this.#D,n)||(this.#E=e,this.#D=n,this.dispatchEvent(new CustomEvent(`datagrid-viewport-change`,{detail:{renderedKeys:e,visibleKeys:n},bubbles:!0,composed:!0})))}_findFirstVisibleCol(e){let n=0,r=this._colOffsets.length-1,i=0;for(;n<=r;){let a=n+r>>1;this._colOffsets[a]<=e?(i=a,n=a+1):r=a-1}return i}_findLastVisibleCol(e){for(let n=0;n<this._colOffsets.length;n++)if(this._colOffsets[n]>e)return n;return this._colOffsets.length}render(){let e=this.rowHeight,{start:n,end:r}=this.#R(2),o=this._flat.slice(n,r).map((e,r)=>({entry:e,absIdx:n+r})),s=this._editing?.rowKey??this._editingRow,c=s?this.#c.get(s):void 0;c!==void 0&&(c>=n&&c<r&&o.splice(c-n,1),o.unshift({entry:this._flat[c],absIdx:c}));let l=this.interactionMode===`checked`;return i`
|
|
5316
5316
|
<div class="grid ${this.columnMenu===`auto`?`has-actions`:``}" role="grid" aria-rowcount=${this._flat.length+1} aria-colcount=${this._visibleColumns.length} aria-multiselectable=${this.selectionMode===`multiple`?`true`:`false`}>
|
|
5317
5317
|
<div class="viewport scroll-fade-y" @scroll=${this._onScroll}>
|
|
5318
5318
|
<div class="header-row scroll-fade-x" role="row" aria-rowindex="1">
|
|
@@ -5372,7 +5372,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5372
5372
|
`:a}
|
|
5373
5373
|
</ixfx-menu-container>
|
|
5374
5374
|
</ixfx-menu-trigger>
|
|
5375
|
-
</div>`:a}};E([d({type:Array})],
|
|
5375
|
+
</div>`:a}};E([d({type:Array})],B.prototype,`columns`,void 0),E([d({type:Array})],B.prototype,`rows`,void 0),E([d({type:String,attribute:`selection-mode`})],B.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],B.prototype,`interactionMode`,void 0),E([d({attribute:!1})],B.prototype,`sortState`,void 0),E([d({type:Number,attribute:`row-height`})],B.prototype,`rowHeight`,void 0),E([d({attribute:!1})],B.prototype,`getRowKey`,void 0),E([d({attribute:!1})],B.prototype,`checkboxRenderer`,void 0),E([d({attribute:!1})],B.prototype,`editable`,void 0),E([d({type:String,reflect:!0})],B.prototype,`editability`,void 0),E([d({type:String,attribute:`cell-overflow`})],B.prototype,`cellOverflow`,void 0),E([d({type:Boolean,attribute:`zebra-stripes`,reflect:!0})],B.prototype,`zebraStripes`,void 0),E([d({attribute:!1})],B.prototype,`groupBy`,void 0),E([d({type:Boolean,attribute:`allow-grouping`})],B.prototype,`allowGrouping`,void 0),E([d({attribute:!1})],B.prototype,`groupLabel`,void 0),E([d({attribute:!1})],B.prototype,`groupableColumns`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],B.prototype,`crossGroupSelection`,void 0),E([d({type:String,attribute:`column-menu`})],B.prototype,`columnMenu`,void 0),E([d({attribute:!1})],B.prototype,`globalFormatter`,void 0),E([d({type:String,attribute:`text-color-column`})],B.prototype,`textColorColumn`,void 0),E([d({type:String,attribute:`icon-column`})],B.prototype,`iconColumn`,void 0),E([d({type:String,attribute:`badge-column`})],B.prototype,`badgeColumn`,void 0),E([d({attribute:!1})],B.prototype,`filterPredicate`,void 0),E([d({attribute:!1})],B.prototype,`rowSearchText`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],B.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],B.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],B.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],B.prototype,`dragPreviewSource`,void 0),E([d({type:String,attribute:`column-button-icon`})],B.prototype,`columnButtonIcon`,void 0),E([m()],B.prototype,`_resizingColKey`,void 0),E([m()],B.prototype,`_animatingColKeys`,void 0),E([m()],B.prototype,`_selectedKeys`,void 0),E([m()],B.prototype,`_viewportH`,void 0),E([m()],B.prototype,`_viewportW`,void 0),E([m()],B.prototype,`_collapsedGroups`,void 0),E([m()],B.prototype,`_editing`,void 0),E([m()],B.prototype,`_editingRow`,void 0),E([m()],B.prototype,`_lastClick`,void 0),E([m()],B.prototype,`_lastClickedCell`,void 0),E([m()],B.prototype,`_editValue`,void 0),E([f(`.viewport`)],B.prototype,`_viewportEl`,void 0),E([f(`.header-row`)],B.prototype,`_headerRowEl`,void 0),B=E([T(`ixfx-data-grid`)],B);let h_=class extends n{constructor(...e){super(...e),this.rows=[],this.tickleDelay=400,this.layout=`auto`,this.narrowBreakpoint=420,this._tickled=new oe(this,{getItems:()=>this.rows.map((e,n)=>({id:n,enabled:!0}))}),this._stacked=!1,this.#n=0}static{this.styles=[se,C,de,r`
|
|
5376
5376
|
:host {
|
|
5377
5377
|
display: block;
|
|
5378
5378
|
container-type: inline-size;
|
|
@@ -5531,7 +5531,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5531
5531
|
?data-full=${e.fullWidth}
|
|
5532
5532
|
@pointerenter=${()=>this.#i(n)}
|
|
5533
5533
|
@click=${()=>this.#o(n)}
|
|
5534
|
-
><div class="key">${e.label}</div><div class="value"><span class="value-text">${typeof e.value==`boolean`?e.value?`Yes`:`No`:e.value}</span>${e.detail===void 0?a:i`<div class="detail popup-surface" part="detail">${e.detail}</div>`}</div></div>`)}</div>`}};E([d({type:Array,attribute:!1})],
|
|
5534
|
+
><div class="key">${e.label}</div><div class="value"><span class="value-text">${typeof e.value==`boolean`?e.value?`Yes`:`No`:e.value}</span>${e.detail===void 0?a:i`<div class="detail popup-surface" part="detail">${e.detail}</div>`}</div></div>`)}</div>`}};E([d({type:Array,attribute:!1})],h_.prototype,`rows`,void 0),E([d({type:Number,attribute:!1})],h_.prototype,`selectedIndex`,void 0),E([d({type:Number,attribute:`tickle-delay`})],h_.prototype,`tickleDelay`,void 0),E([d({type:String,reflect:!0})],h_.prototype,`layout`,void 0),E([d({type:Number,attribute:`narrow-breakpoint`})],h_.prototype,`narrowBreakpoint`,void 0),E([m()],h_.prototype,`_tickled`,void 0),E([m()],h_.prototype,`_detailIndex`,void 0),E([m()],h_.prototype,`_stacked`,void 0),h_=E([T(`ixfx-data-table`)],h_);const g_={columns:[],positions:new Map,tops:new Map,lefts:new Map};function __(e){let n=e.getBoundingClientRect();return{left:n.left-e.scrollLeft,top:n.top-e.scrollTop}}function v_(e,n){let r=[];for(let i of e){let e=i.getBoundingClientRect();(e.width!==0||e.height!==0)&&r.push({el:i,left:e.left-n.left,top:e.top-n.top,width:e.width})}r.sort((e,n)=>e.left-n.left||e.top-n.top);let i=[],a=new Map,o=new Map,s=new Map;for(let e of r){let n=i.at(-1);(!n||e.left-n.left>1)&&(n={left:e.left,width:e.width,items:[]},i.push(n)),a.set(e.el,{col:i.length-1,row:n.items.length}),n.items.push(e.el),n.width=Math.max(n.width,e.width),o.set(e.el,e.top),s.set(e.el,e.left)}return{columns:i,positions:a,tops:o,lefts:s}}function y_(e,n,r){for(let i of n){if(!i)continue;let n=e.lefts.get(i),a=e.tops.get(i);if(n===void 0||a===void 0)return!1;let o=i.getBoundingClientRect();if(Math.abs(o.left-r.left-n)>.5||Math.abs(o.top-r.top-a)>.5)return!1}return!0}function b_(e,n,r){for(;e<n;){let i=e+n>>1;r(i)?n=i:e=i+1}return e}function x_(e,n,r,i){if(e.length===0)return[];let a=r=>{let i=e[r].getBoundingClientRect();return{left:i.left-n.left,right:i.right-n.left}},o=a(0),s=a(e.length-1);if(o.left===s.left)return o.right>r&&o.left<i?e:[];let c=e.length;if(s.left>o.left){let n=b_(0,c,e=>a(e).right>r),o=b_(n,c,e=>a(e).left>=i);return e.slice(n,o)}let l=b_(0,c,e=>a(e).left<i),u=b_(l,c,e=>a(e).right<=r);return e.slice(l,u)}let S_=class extends n{constructor(...e){super(...e),this.label=``,this.count=0,this.collapsed=!1,this.orientation=`horizontal`}static{this.styles=r`
|
|
5535
5535
|
:host {
|
|
5536
5536
|
--_height: var(--list-group-header-height, 28px);
|
|
5537
5537
|
--_border: var(--list-group-header-border, var(--border));
|
|
@@ -5604,7 +5604,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5604
5604
|
<span class="label" part="label">${this.label}</span>
|
|
5605
5605
|
<span class="count" part="count">(${this.count})</span>
|
|
5606
5606
|
<span class="divider" part="divider"></span>
|
|
5607
|
-
`}};E([d({type:String,reflect:!0})],x_.prototype,`label`,void 0),E([d({type:Number,reflect:!0})],x_.prototype,`count`,void 0),E([d({type:Boolean,reflect:!0})],x_.prototype,`collapsed`,void 0),E([d({type:String,reflect:!0})],x_.prototype,`orientation`,void 0),x_=E([T(`ixfx-list-group-header`)],x_);const S_=`:scope > li`,C_=`data-ixfx-group-header`,w_=`data-group-collapsed`,T_=new Set([`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function E_(e,n,r){return r.width>0&&r.height>0&&e>=r.left&&e<r.right&&n>=r.top&&n<r.bottom}function D_(e,n,r){if(e instanceof Text){if(!e.textContent?.trim())return!1;let i=document.createRange();return i.selectNodeContents(e),Array.from(i.getClientRects()).some(e=>E_(n,r,e))}return!(e instanceof Element)||e.hasAttribute(`data-drag-select-blank`)?!1:e.hasAttribute(`data-drag-select-content`)?E_(n,r,e.getBoundingClientRect()):Array.from(e.childNodes).some(e=>D_(e,n,r))?!0:e.childNodes.length===0&&E_(n,r,e.getBoundingClientRect())}function O_(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}function k_(e,n){if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;return!0}function A_(e,n,r){for(let i of e)n.has(i)||i.removeAttribute(r);for(let i of n)e.has(i)||i.setAttribute(r,``)}const j_=[`hidden`,w_,`not-checked`,`data-key`,`data-value`];function M_(e,n){return n.type===`childList`?n.target===e:n.target.parentElement===e}function N_(e,n,r){let i=e=>{let n=e;for(;n&&!r(n);)n=n.nextElementSibling;return n},a=i(e.firstElementChild);for(let r of n){if(r===a){a=i(a.nextElementSibling);continue}e.insertBefore(r,a)}}let H=class extends n{constructor(...e){super(...e),this.selectionMode=`single`,this.interactionMode=`standard`,this.sort=`none`,this.sortBy=``,this.items=[],this.displayProperty=``,this.iconProperty=``,this.iconColorProperty=``,this.textColorProperty=``,this.badgeProperty=``,this.keyProperty=``,this.itemWrap=`stop`,this.itemsDraggable=!1,this.groupBy=null,this.crossGroupSelection=!1,this._collapsedGroups=new Set,this.#e=new WeakMap,this.#t=new WeakMap,this.#n=h_,this.#r=!0,this.#i=!1,this.#p=new Set,this.#m=new Set,this.#h=!0,this.#g=!1,this.#_=!1,this.#v=0,this.#y=0,this.#w=new WeakSet,this.#T=[],this.#E=new Map,this.#D=[],this.#O=new Map,this.#k=new WeakMap,this.#A=0,this.#j=!1,this.#M=!1,this.#N=!1,this.#F=0,this.#I=new je(this),this.selection=new nr({getOrderedItems:()=>this._getVisibleItems(),isSelectable:e=>this._isCheckable(e),getModes:()=>({selectionMode:this.selectionMode,interactionMode:this.interactionMode}),getKey:D,getGroupKey:e=>this.#E.get(e)??null,crossGroupSelection:()=>this.crossGroupSelection,getFallbackGroupKey:()=>{let e=this.tickled.tickledId;return e?this.#E.get(e)??null:null},onChange:(e,n)=>{this._syncItemStates(),this._dispatch(`list-select`,{selected:e,previous:n,selectedKeys:this.selection.selectedKeys})}}),this.tickled=new oe(this,{getItems:()=>{let e=this._getVisibleItems();return this.#l??=e.map(e=>({id:e,enabled:!e.hasAttribute(`not-checked`)})),this.#l},onTickle:e=>{e!==void 0&&this._dispatch(`list-tickle`,{item:e})},onStateChange:()=>this._syncItemStates(),itemWrap:this.itemWrap,hoverDisabled:()=>this.#G.isDragging||this.#V.isDragging}),this.#L=!1,this.#R=0,this.#z=!1,this.#B=()=>{this.#z=!1},this.#V=new er(this,{source:`detail-list`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this._getVisibleItems().length>0,resolveEventToKey:e=>{if(!(e instanceof Element))return;let n=e.closest?.(`li`);if(!(!n||!this.contains(n)))return D(n)},prepareSelection:e=>this.#H(e),getMetrics:()=>({}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this._dispatchCancelable(`list-native-drag-start`,e),onActiveChange:(e,n)=>{this.#L=e,this.toggleAttribute(`data-native-dragging`,e);for(let r of this.querySelectorAll(`li`))r.toggleAttribute(`data-drag-origin`,e&&n!==void 0&&D(r)===n);if(e){let e=this.selection.selected.size;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#L=!1,this.toggleAttribute(`data-native-dragging`,!1),this.removeAttribute(`aria-label`);for(let e of this.querySelectorAll(`li`))e.removeAttribute(`data-drag-origin`);this.#U()},syncLightDomDraggable:()=>this._syncNativeDraggable(),shouldStart:()=>!this.#z}),this.#G=new Hn(this,{getSurface:()=>this.renderRoot.querySelector(`.container`),isEnabled:()=>this.selection.canDragSelect()&&this._getVisibleItems().length>0&&!this.hasAttribute(`disable-drag-select`),hitTest:e=>this.#q(e),getBaseSelection:()=>this.selection.selected,onPreview:(e,n)=>{this.#W=n;for(let n of this._getVisibleItems())n.toggleAttribute(`data-marquee`,e.has(n));this.requestUpdate()},onCommit:e=>{this.selection.applyDragSelection(e);for(let e of this._getVisibleItems())e.removeAttribute(`data-marquee`);this.#W=void 0,this.requestUpdate()},autoScroll:(e,n)=>{this._listEl&&(this._listEl.scrollLeft+=e)},shouldStart:e=>!this.#ve(e.composedPath())&&(this.#z=this.itemsDraggable&&this.#K(e),!this.itemsDraggable||this.#z)}),this.search=new Vt(this,{adapter:Mt(this,{itemSelector:S_,getLabel:e=>e.getAttribute(`data-search-label`)??e.textContent?.trim()??``,highlightKey:`detail-list-search`})}),this.#Ue=()=>{this.#y===0&&(this.#y=requestAnimationFrame(()=>{this.#y=0,this.#Ke()}))},this._onPointerOver=e=>{let n=this._findListItem(e.composedPath());n&&this.tickled.handlePointerEnter(n)},this._onPointerLeave=e=>{this.tickled.handlePointerLeave(e)},this._endKeyboardNav=()=>{this.removeAttribute(`data-keyboard-nav`)},this._onKeyDown=e=>{if(!this.search.isOpen){if((e.ctrlKey||e.metaKey)&&e.key===`a`){this.selection.canSelectAll()&&(e.preventDefault(),this.selection.selectAll());return}switch(T_.has(e.key)&&!this.hasAttribute(`data-keyboard-nav`)&&this.setAttribute(`data-keyboard-nav`,``),e.key){case`ArrowDown`:if(e.preventDefault(),this.#Ae(),e.shiftKey&&this.interactionMode===`vscode`){let e=this.tickled.tickledId;e&&this.selection.rangeTo(e)}break;case`ArrowUp`:if(e.preventDefault(),this.#je(),e.shiftKey&&this.interactionMode===`vscode`){let e=this.tickled.tickledId;e&&this.selection.rangeTo(e)}break;case`ArrowRight`:e.preventDefault(),this.#Ne();break;case`ArrowLeft`:e.preventDefault(),this.#Pe();break;case`Home`:e.preventDefault(),this.#Ee(this.#Oe());break;case`End`:e.preventDefault(),this.#Ee(this.#ke());break;case`Enter`:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this._dispatch(`list-item-click`,{item:n}),this._activateItem(n));break}case` `:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.selection.handleSpace(n));break}case`Escape`:this.selection.clear()}}},this._onClick=e=>{if(this.#G.isDragging||this.#V.isDragging||this.#R!==0)return;let n=e.composedPath(),r=this.#ve(n);if(r){this.toggleGroup(r.dataset.groupKey??``);return}let i=this._findListItem(n);i&&(this.focus(),this._dispatch(`list-item-click`,{item:i}),this.selection.handleClick(i,e))},this._onDblClick=e=>{let n=this._findListItem(e.composedPath());n&&this._activateItem(n)},this._onWheel=e=>{e.preventDefault();let n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;this._listEl.scrollLeft+=n}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;#k;#A;#j;#M;#N;#P;#F;#I;#L;#R;#z;#B;#V;#H(e){let n=this._getVisibleItems(),r=n.find(n=>D(n)===e);if(!r||!this._isCheckable(r))return;this.selection.selected.has(r)||this.selection.replace(r);let i=[];n.forEach((n,r)=>{if(!this.selection.selected.has(n))return;let a=D(n)??e;i.push({key:a,index:r,item:this.#e.get(n)??n,element:n})});let a=i.find(n=>n.key===e);if(a)return{origin:a,selected:i}}_syncNativeDraggable(){if(this.isConnected&&!(!this.itemsDraggable&&!this.#_)){this.#_=this.itemsDraggable;for(let e of this.querySelectorAll(`li`))e instanceof HTMLElement&&(e.draggable=this.itemsDraggable&&this._isCheckable(e))}}#U(){this.#R&&clearTimeout(this.#R),this.#R=window.setTimeout(()=>{this.#R=0},0)}#W;#G;#K(e){let n=e.composedPath(),r=this._findListItem(n);if(!r)return!1;for(let e of n){if(e===r)break;if(e instanceof Element){if(e.matches(`input, button, a, select, textarea, [contenteditable], .ixfx-list-checkbox, [role="checkbox"]`))return!1;if(e.hasAttribute(`data-drag-select-blank`))return!0;if(e.hasAttribute(`data-drag-select-content`))return!1}}return!Array.from(r.childNodes).some(n=>D_(n,e.clientX,e.clientY))}#q(e){let n=this.renderRoot.querySelector(`.container`);if(!n)return[];let r=n.getBoundingClientRect(),i=e.x,a=e.y,o=e.x+e.width,s=e.y+e.height,c=[];for(let e of this._getVisibleItems()){let n=e.getBoundingClientRect(),l=n.left-r.left,u=n.top-r.top;l<=o&&l+n.width>=i&&u<=s&&u+n.height>=a&&c.push(e)}return c}#J(e){return`left:${e.x}px;top:${e.y}px;width:${Math.max(0,e.width)}px;height:${Math.max(0,e.height)}px`}#Y;#X;get registry(){return this.#Y}#Z(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#Q(){this.#Y&&(this.search.setModes(this.#Z()),this.#X?.(),this.#X=Rt(this.#Y,this.search))}connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.addEventListener(`pointerover`,this._onPointerOver),this.addEventListener(`pointerleave`,this._onPointerLeave),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`pointermove`,this._endKeyboardNav),this.addEventListener(`pointerdown`,this._endKeyboardNav),this.addEventListener(`click`,this._onClick),this.addEventListener(`dblclick`,this._onDblClick),this.addEventListener(`wheel`,this._onWheel),window.addEventListener(`pointerup`,this.#B),window.addEventListener(`pointercancel`,this.#B),this.#S=new ResizeObserver(()=>this.#ye()),this.#S.observe(this),this.#C=new MutationObserver(e=>{this.#He(e),this.#$(e),this.#ye(),this.#de()}),this.#C.observe(this,{childList:!0,subtree:!1,attributeFilter:[`hidden`]});for(let e of this.querySelectorAll(S_))this.#w.add(e);this.#a=new MutationObserver(e=>{e.some(e=>M_(this,e))&&this.#Le()}),this.#a.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:j_}),this.#Le(),this.#Y??=Yt(),this.#Q(),this.#de()}#$(e){if(!this.isConnected)return;let n=[];for(let r of e)for(let e of r.addedNodes)!(e instanceof HTMLElement)||e.parentElement!==this||e.localName!==`li`||this.#w.has(e)||(this.#w.add(e),n.push(e));if(n.length===0)return;let r=this.#Fe().length;if(!(n.length>=r)){for(let e of n)Xn(e);window.setTimeout(()=>this.#ye(),230)}}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerover`,this._onPointerOver),this.removeEventListener(`pointerleave`,this._onPointerLeave),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`pointermove`,this._endKeyboardNav),this.removeEventListener(`pointerdown`,this._endKeyboardNav),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`dblclick`,this._onDblClick),this.removeEventListener(`wheel`,this._onWheel),window.removeEventListener(`pointerup`,this.#B),window.removeEventListener(`pointercancel`,this.#B),this.#z=!1,cancelAnimationFrame(this.#v),cancelAnimationFrame(this.#y),this.#y=0,this.#S?.disconnect(),this.#S=void 0,this.#C?.disconnect(),this.#C=void 0,this.#P?.disconnect(),this.#P=void 0,this.#a?.disconnect(),this.#a=void 0,this.#Le(),this.#X?.(),this.#X=void 0,this.#Y=void 0,this.#R&&=(clearTimeout(this.#R),0)}firstUpdated(){this.#Ve(),this.filterPredicate&&this.#se(),this.#be(),this.#We(),this._syncNativeDraggable()}willUpdate(e){super.willUpdate(e),e.has(`groupBy`)&&this.hasUpdated&&(this._collapsedGroups.size>0&&(this._collapsedGroups=new Set),this.#N=!0)}updated(e){if(super.updated(e),(e.has(`groupBy`)||e.has(`groupLabel`)||e.has(`_collapsedGroups`))&&(this.#de(),this.#N&&(this.#N=!1,this._dispatch(`list-group-change`,{groupBy:this.groupBy}))),e.has(`searchModes`)&&this.#Q(),e.has(`provider`)){this.#T=[],this.#F=0,this.#I.provider=this.provider,queueMicrotask(()=>{this.provider&&this.#I.request(void 0)});return}let n=e.has(`displayProperty`)||e.has(`formatter`)||e.has(`iconProperty`)||e.has(`iconColorProperty`)||e.has(`textColorProperty`)||e.has(`badgeProperty`)||e.has(`keyProperty`);(e.has(`items`)||n)&&this.provider===void 0&&this.items.length>0&&this.#te(this.items,!n),this.#oe(),(e.has(`sort`)||e.has(`sortBy`)||e.has(`sortComparator`))&&this.#ce(),e.has(`filterPredicate`)&&(this.#se(),this.#ye(),this.#de()),e.has(`interactionMode`)?(this.selection.clearAnchor(),this.#h=!0,this._syncItemStates(),this._syncNativeDraggable()):e.has(`checkboxRenderer`)&&this.interactionMode===`checked`&&this._syncCheckboxes(),e.has(`itemsDraggable`)&&(this._syncNativeDraggable(),this.#V.refreshDraggable())}get selectedItem(){return[...this.selection.selected].at(-1)}get selectedItems(){return this.selection.selected}refreshLayout(){this.#be(),this.#We()}addItem(e,n){let r;if(typeof e==`string`){let n=document.createElement(`li`);this._setLabel(n,e),r=n}else r=e;n?.notChecked&&r.setAttribute(`not-checked`,``),this.appendChild(r),this.#ze(r),this.sort!==`none`&&this.#ce(),this.interactionMode===`checked`&&this._syncCheckboxes(),this.#de()}removeItem(e){return this.selection.deselect(e),$n(e).then(()=>{e.remove(),this.#de(),this.interactionMode===`checked`&&this._syncCheckboxes(),this.#ye()})}removeItems(e){return Promise.all([...e].map(e=>this.removeItem(e))).then(()=>void 0)}clearItems(){this.replaceChildren(),this.#O.clear(),this.#de(),this.selection.reset(),this.#T=[],this.#F=0,this._syncItemStates()}setItems(e){this.clearItems();for(let n of e)this.appendChild(n),this.#ze(n);this.sort!==`none`&&this.#ce(),this.interactionMode===`checked`&&this._syncCheckboxes(),this.#de()}getItemData(e){return this.#e.get(e)}visibleKeys(){let e=this._listEl;if(!e)return[];let n=e.scrollLeft,r=n+e.getBoundingClientRect().width,i=[];for(let a of b_(this._getVisibleItems(),g_(e),n,r)){let e=D(a);e!==void 0&&i.push(e)}return i}dispatch(e,n){this.#Y?.invoke(e,n)}select(e){this.selection.replace(e)}selectMany(e){this.selection.selectMany(e)}deselect(e){this.selection.deselect(e)}clearSelection(){this.selection.clear()}selectAll(){this.selection.canSelectAll()&&this.selection.selectAll()}get selectedKeys(){return this.selection.selectedKeys}get tickledKey(){let e=this.tickled.tickledId;return e?D(e):void 0}selectKeys(e){this.selection.selectKeys(e,e=>this.#ee(e))}addSelectedKeys(e){this.selection.addKeys(e,e=>this.#ee(e))}removeSelectedKeys(e){this.selection.removeKeys(e,e=>this.#ee(e))}focusKey(e){let n=this.#ee(e);n&&(this.tickled.focus(n),n.scrollIntoView({block:`nearest`,inline:`nearest`}))}#ee(e){if(!this.#d){let e=new Map;for(let n of this.#Fe()){let r=D(n);r!==void 0&&!e.has(r)&&e.set(r,n)}this.#d=e}return this.#d.get(e)}*selectedFilter(e){let n=n=>{switch(e){case`selected`:return n.hasAttribute(`data-selected`);case`checked`:return n.hasAttribute(`data-checked`);case`either`:return n.hasAttribute(`data-selected`)||n.hasAttribute(`data-checked`)}};for(let e of this.querySelectorAll(S_))e.hidden||n(e)&&(yield e)}#te(e,n=!1){let r=e=>e.getAttribute(`data-key`)??e.getAttribute(`data-search-label`)??null,i=new Set([...this.selection.selected].map(r).filter(e=>e!==null)),a=this.selection.anchor?r(this.selection.anchor):null;if(n?this.#ne(e):this.replaceChildren(...e.map((e,n)=>this.#re(e,n))),i.size>0||a!==null){let e=[],n;for(let o of this.querySelectorAll(S_)){let s=r(o);s!==null&&i.has(s)&&e.push(o),s!==null&&s===a&&(n=o)}this.selection.seed(e,n)}this.sort!==`none`&&this.#ce(),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates(),this.#ye(),this.#de()}#ne(e){let n=new Map;for(let e of this.#Fe())this.#e.has(e)&&!n.has(this.#e.get(e))&&n.set(this.#e.get(e),e);let r=e.map((e,r)=>{let i=n.get(e);return i&&(!this.formatter||this.#t.get(i)===r)?(n.delete(e),i):this.#re(e,r)}),i=new Set(r);for(let e of this.#Fe())i.has(e)||e.remove();if(this.#ue()){for(let e of r)this.#k.set(e,this.#A++);this.append(...r.filter(e=>e.parentElement!==this)),this.#de();return}N_(this,r,e=>e.localName===`li`)}#re(e,n){let r=document.createElement(`li`);this.#e.set(r,e),this.#t.set(r,n);let i=this.formatter?this.formatter(e,n):this.displayProperty?this.#ie(e,this.displayProperty):e,a=this.#ae(e,this.textColorProperty),o=this.#ae(e,this.iconColorProperty);if(o!==void 0&&r.setAttribute(`data-icon-color`,o),typeof i==`string`){let n=this._setLabel(r,i);if(a!==void 0&&(n.style.color=a),this.iconProperty){let n=this.#ie(e,this.iconProperty);typeof n==`string`&&n.length>0&&r.setAttribute(`data-icon`,n)}}else i instanceof Node&&(r.appendChild(i),a!==void 0&&(r.style.color=a));if(this.keyProperty){let n=this.#ie(e,this.keyProperty);n!=null&&r.setAttribute(`data-key`,String(n))}return this.#ze(r),this.#Be(r,this.#ie(e,this.badgeProperty)),r}#ie(e,n){if(!(typeof e!=`object`||!e||!(n in e)))return e[n]}#ae(e,n){return n?Vg(this.#ie(e,n)):void 0}#oe(){if(this.provider===void 0)return;let e=this.#I.items;if(e===this.#T)return;let n=0;for(;n<this.#T.length&&n<e.length&&this.#T[n]===e[n];)n++;if(n===this.#T.length&&n<=e.length){let r=e.slice(n);for(let e of r)this.appendChild(this.#re(e,this.#F++));this.sort!==`none`&&(cancelAnimationFrame(this.#v),this.#v=requestAnimationFrame(()=>this.#ce())),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates(),this.#ye(),this.#de()}else this.#F=0,this.#te(e);this.#T=e}#se(){if(!this.filterPredicate){for(let e of this.querySelectorAll(S_))e.removeAttribute(`hidden`);return}for(let e of this.querySelectorAll(S_))this.filterPredicate(e)?e.removeAttribute(`hidden`):e.setAttribute(`hidden`,``)}#ce(){if(this.sort===`none`)return;let e=[...this.querySelectorAll(S_)];if(!(e.length<2)){if(this.#ue()){this.#de();return}N_(this,this.#le(e),e=>e.localName===`li`),this.#ye(),this.#de()}}#le(e){let n=this.sort===`descending`?-1:1,r=e.map(e=>({element:e,data:this.getItemData(e),label:e.getAttribute(`data-search-label`)??e.textContent?.trim()??``})),i=new Intl.Collator(void 0,{numeric:!0}),a;if(this.sortComparator){let e=this.sortComparator;a=(n,i)=>e(r[n],r[i])}else if(this.sortBy){let e=this.sortBy,n=r.map(n=>{let r=this.#ie(n.data,e);return typeof r==`number`?r:r==null?``:String(r)});a=(e,r)=>{let a=n[e],o=n[r];return typeof a==`number`&&typeof o==`number`?a-o:i.compare(String(a),String(o))}}else a=(e,n)=>i.compare(r[e].label,r[n].label);let o=e.map((e,n)=>n);return o.sort((e,r)=>a(e,r)*n||e-r),o.map(n=>e[n])}#ue(){return this.groupBy!==null&&this.groupBy!==void 0&&this.groupBy!==``}#de(){this.#M||!this.#ue()&&!this.#j||(this.#M=!0,queueMicrotask(()=>{this.#M=!1,this.#ge()}))}#fe(e,n){return this.#ie(this.getItemData(e),n)??e.getAttribute(`data-${n}`)}#pe(e){let n=this.groupBy;return mn(typeof n==`string`?this.#fe(e,n):n(this.getItemData(e),e))}#me(e){return!e.hidden&&(!this.filterPredicate||this.filterPredicate(e))}#he(e){let n=this.#O.get(e);return n||(n=document.createElement(`ixfx-list-group-header`),n.setAttribute(C_,``),n.dataset.groupKey=e,this.#O.set(e,n)),n}#ge(){let e=this.#ue();if(!e&&!this.#j)return;let n=this.#Fe();for(let e of n)this.#k.has(e)||this.#k.set(e,this.#A++);let r=n.toSorted((e,n)=>this.#k.get(e)-this.#k.get(n));this.sort!==`none`&&r.length>1&&(r=this.#le(r));let i=[],a=[],o=new Map,s=new Set;if(e){let e=this.groupLabel,n=gn(r,e=>this.#pe(e),e?(n,r)=>e(n,r.map(e=>this.getItemData(e)??e)):void 0);for(let e of n){let n=e.items.filter(e=>this.#me(e)).length,r=n>0&&this._collapsedGroups.has(e.key);if(n>0){let o=this.#he(e.key);o.label=e.label,o.count=n,o.collapsed=r,s.add(e.key),i.push(o),a.push({key:e.key,label:e.label,count:n,collapsed:this._collapsedGroups.has(e.key)})}for(let n of e.items)o.set(n,e.key),n.toggleAttribute(w_,r),i.push(n)}}else{for(let e of r)e.removeAttribute(w_);i.push(...r)}for(let[e,n]of this.#O)s.has(e)||(n.remove(),this.#O.delete(e));this.#E=o,this.#D=a,this.#j=e,N_(this,i,e=>e.localName===`li`||e.hasAttribute(C_)),this.tickled.tickledId?.hasAttribute(w_)&&this.tickled.focus(void 0),this.#_e(e),this.#ye()}#_e(e){if(!e){this.#P?.disconnect(),this.#P=void 0;return}this.#P||!this.isConnected||(this.#P=new MutationObserver(()=>this.#de()),this.#P.observe(this,{subtree:!0,attributes:!0,attributeFilter:[`hidden`]}))}get groups(){return this.#D}setGroupCollapsed(e,n){if(this._collapsedGroups.has(e)===n)return;let r=new Set(this._collapsedGroups);n?r.add(e):r.delete(e),this._collapsedGroups=r,this._dispatch(`list-group-toggle`,{groupKey:e,collapsed:n})}toggleGroup(e){this.setGroupCollapsed(e,!this._collapsedGroups.has(e))}collapseAllGroups(){for(let e of this.#D)this.setGroupCollapsed(e.key,!0)}expandAllGroups(){for(let e of[...this._collapsedGroups])this.setGroupCollapsed(e,!1)}#ve(e){for(let n of e){if(n===this)break;if(n instanceof HTMLElement&&n.parentElement===this&&n.hasAttribute(C_))return n}}#ye(){this.#r=!0,!this.#i&&(this.#i=!0,requestAnimationFrame(()=>{this.#i=!1,this.#Ke()}))}#be(){this.#r=!1,this.#n=this.isConnected&&this._listEl?__(this._getVisibleItems(),g_(this._listEl)):h_}#xe(){let e=this._getVisibleItems();if(this.#r||!this._listEl)return this.#be(),this.#n;let n=this.tickled.tickledId,r=[e[0],n&&this.#n.positions.has(n)?n:void 0,e.at(-1)];return v_(this.#n,r,g_(this._listEl))||this.#be(),this.#n}#Se(e){let n=this.#n.positions.get(e);return n===void 0&&(this.#be(),n=this.#n.positions.get(e)),n}#Ce(e){return this.#n.columns[e]?.items}#we(e,n){return this.#Ce(e)?.[n]}#Te(){let{columns:e}=this.#xe();return{cols:e.length,rows:Math.max(0,...e.map(e=>e.items.length))}}#Ee(e){e&&(this.tickled.handleKeyboardNavigation(e),this.tickled.tickledId?.scrollIntoView({block:`nearest`,inline:`nearest`}))}#De(e,n,r,i){let{cols:a}=this.#Te(),o=this._getVisibleItems().length+1,s=r===0?e:e+r,c=i===0?n:n+i,l=!1;for(let u=0;u<o;u++){let o=this.#Ce(s)?.length??0;if(c<0||c>=o){if(r!==0||l){if(this.itemWrap===`wrap`)r<0?s=a-1:r>0&&(s=0),l=!0;else return}if(i>0){if(s+1<a)s+=1,c=0,l=!0;else if(this.itemWrap===`wrap`)s=0,c=0,l=!0;else return}else if(i<0){if(s-1>=0)--s,c=(this.#Ce(s)?.length??1)-1,l=!0;else if(this.itemWrap===`wrap`)s=a-1,c=(this.#Ce(s)?.length??1)-1,l=!0;else return}else if(r!==0){let e=this.#Ce(s)?.length??0;c>=e&&e>0&&(c=e-1)}if(s===e&&c===n+i)return;continue}let u=this.#we(s,c);if(u&&this._isCheckable(u))return u;c+=i}}#Oe(){return this._getVisibleItems().find(e=>this._isCheckable(e))}#ke(){let e=this._getVisibleItems();for(let n=e.length-1;n>=0;n--)if(this._isCheckable(e[n]))return e[n]}#Ae(){this.#xe();let e=this.tickled.tickledId?this.#Se(this.tickled.tickledId):void 0;if(!e){this.#Ee(this.#Oe());return}let n=this.#De(e.col,e.row,0,1);n&&this.#Ee(n)}#je(){this.#xe();let e=this.tickled.tickledId?this.#Se(this.tickled.tickledId):void 0;if(!e){this.#Ee(this.#ke());return}let n=this.#De(e.col,e.row,0,-1);n&&this.#Ee(n)}#Me(e,n){if(this.#D.length===0)return this.#De(e.col,e.row,n,0);let r=this.#Ce(e.col+n),i=this.tickled.tickledId,a=i?this.#n.tops.get(i):void 0;if(!r||a===void 0)return;let o,s=1/0;for(let e of r){if(!this._isCheckable(e))continue;let n=Math.abs((this.#n.tops.get(e)??1/0)-a);n<s&&(o=e,s=n)}return o}#Ne(){this.#xe();let e=this.tickled.tickledId?this.#Se(this.tickled.tickledId):void 0;if(!e){this.#Ee(this.#Oe());return}let n=this.#Me(e,1);n?this.#Ee(n):this.itemWrap===`wrap`&&this.#Ee(this.#Oe())}#Pe(){this.#xe();let e=this.tickled.tickledId?this.#Se(this.tickled.tickledId):void 0;if(!e){this.#Ee(this.#Oe());return}let n=this.#Me(e,-1);n?this.#Ee(n):this.itemWrap===`wrap`&&this.#Ee(this.#ke())}_getVisibleItems(){return this.#Ie(),this.#c!==this.filterPredicate&&(this.#Re(),this.#c=this.filterPredicate),this.#s??=this.#Fe().filter(e=>!(e.hidden||e.hasAttribute(w_)||this.filterPredicate&&!this.filterPredicate(e))),this.#s}#Fe(){return this.#Ie(),this.#o??=[...this.querySelectorAll(S_)],this.#o}#Ie(){if(!this.#a){this.#Le();return}this.#a.takeRecords().some(e=>M_(this,e))&&this.#Le()}#Le(){this.#o=void 0,this.#d=void 0,this.#h=!0,this.#Re()}#Re(){this.#s=void 0,this.#l=void 0,this.#u=void 0,this.#r=!0}async fitColumnWidth(){await this.updateComplete;let e=this._getVisibleItems();if(e.length===0)return 0;let n=this.style.getPropertyValue(`--detail-list-column-width`),r=this.style.getPropertyPriority(`--detail-list-column-width`);this.style.setProperty(`--detail-list-column-width`,`max-content`);let i=Math.ceil(Math.max(...e.map(e=>e.getBoundingClientRect().width)));return n?this.style.setProperty(`--detail-list-column-width`,n,r):this.style.removeProperty(`--detail-list-column-width`),this.style.setProperty(`--detail-list-column-width`,`${i}px`),this.#ye(),i}_isCheckable(e){return this.interactionMode!==`checked`||!e.hasAttribute(`not-checked`)}_setLabel(e,n){let r=document.createElement(`span`);return r.style.cssText=`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0`,r.textContent=n,e.appendChild(r),e.setAttribute(`data-search-label`,n),r}#ze(e){let n=e.getAttribute(`data-icon`);if(!n||e.firstElementChild?.tagName===`IXFX-ICON`)return;let r=document.createElement(`ixfx-icon`);r.setAttribute(`name`,n),r.style.marginInlineEnd=`var(--detail-list-icon-gap, 6px)`,r.style.flexShrink=`0`;let i=e.getAttribute(`data-icon-color`);i&&(r.style.color=i),e.prepend(r)}#Be(e,n){if(Bg(n))return;let r=e.querySelector(`:scope > .item-badge`);r||(r=document.createElement(`span`),r.className=`item-badge`,r.style.cssText=`flex-shrink:0;display:inline-flex;align-items:center;margin-inline-start:auto;padding-inline-start:var(--detail-list-badge-gap,8px)`,e.appendChild(r)),r.replaceChildren(),n instanceof Node?r.appendChild(n):o(n,r)}#Ve(){for(let e of this.#Fe())this.#ze(e)}#He(e){for(let n of e)for(let e of n.addedNodes)e instanceof HTMLLIElement&&e.parentElement===this&&this.#ze(e)}_syncItemStates(){let e=this.selection.selected,n=this.interactionMode===`checked`?new Set([...e].filter(e=>!e.hasAttribute(`not-checked`))):new Set,r=this.tickled.tickledId,i=this.#h||!k_(this.#p,e)||!k_(this.#m,n);if(this.#h){for(let i of this.#Fe())i.toggleAttribute(`data-tickled`,i===r),i.toggleAttribute(`data-selected`,e.has(i)),i.toggleAttribute(`data-checked`,n.has(i));this.#h=!1}else r!==this.#f&&(this.#f?.removeAttribute(`data-tickled`),r?.setAttribute(`data-tickled`,``)),A_(this.#p,e,`data-selected`),A_(this.#m,n,`data-checked`);this.#f=r,this.#p=new Set(e),this.#m=n,this.dataset.inputMode!==this.tickled.inputMode&&(this.dataset.inputMode=this.tickled.inputMode),i&&this._syncCheckboxes()}_syncCheckboxes(){let e=this.interactionMode===`checked`,n=typeof this.checkboxRenderer==`function`;if(!(!e&&!this.#g)){this.#g=e;for(let r of this.querySelectorAll(`li`)){let i=r.querySelector(`.ixfx-list-checkbox`);if(!e){i&&i.remove();continue}if(r.hasAttribute(`not-checked`)){i&&i.remove();continue}let a=i?.classList.contains(`ixfx-list-checkbox-custom`)??!1;i&&a!==n&&i.remove();let s=r.querySelector(`.ixfx-list-checkbox`);if(!s){if(n){let e=this.checkboxRenderer,n=e.margin??`0`,i=e.width??`24px`;s=this._createCustomCheckbox(r,n,i)}else s=this._createNativeCheckboxCell(r);r.prepend(s)}let c=this.selection.selected.has(r);if(n){if(s.setAttribute(`aria-checked`,String(c)),s.toggleAttribute(`data-checked`,c),this.checkboxRenderer){let e=typeof this.checkboxRenderer==`function`?this.checkboxRenderer:this.checkboxRenderer.renderer;o(e(c),s)}}else{let e=s.querySelector(`input.ixfx-list-checkbox`);e&&(e.checked=c)}}}}_createNativeCheckboxCell(e){let n=document.createElement(`span`);n.className=`ixfx-list-checkbox ixfx-list-checkbox-native`,n.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:18px;margin:0 6px 0 0;cursor:pointer;pointer-events:auto`,n.tabIndex=-1,n.setAttribute(`role`,`checkbox`),n.setAttribute(`part`,`checkbox`),n.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.toggle(e)});let r=document.createElement(`input`);return r.type=`checkbox`,r.className=`ixfx-list-checkbox`,r.style.cssText=`pointer-events:none;cursor:pointer;margin:0`,n.appendChild(r),n}_createCustomCheckbox(e,n,r){let i=document.createElement(`span`);return i.className=`ixfx-list-checkbox ixfx-list-checkbox-custom`,i.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:${r};margin:${n};cursor:pointer;pointer-events:auto`,i.tabIndex=-1,i.setAttribute(`role`,`checkbox`),i.setAttribute(`part`,`checkbox`),i.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.toggle(e)}),i}_findListItem(e){for(let n of e)if(n instanceof Element){if(n===this)break;if(n.parentElement===this&&n.matches(`li`))return n}}_dispatch(e,n){this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0}))}_dispatchCancelable(e,n){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}#Ue;#We(){this.#y===0&&(this.#y=requestAnimationFrame(()=>{this.#y=0,this.#Ke()}))}#Ge(){let e=this._getVisibleItems();return this.#u??=e.flatMap(e=>{let n=D(e);return n===void 0?[]:[n]}),this.#u}#Ke(){let e=this.#Ge(),n=this.visibleKeys();O_(this.#b,e)&&O_(this.#x,n)||(this.#b=e,this.#x=n,this._dispatch(`detail-list-viewport-change`,{renderedKeys:e,visibleKeys:n}))}_activateItem(e){this.interactionMode!==`manual`&&this.selection.replace(e),this._dispatch(`list-activate`,{item:e})}static{this.styles=[w,Ng(`x`),Ht,r`
|
|
5607
|
+
`}};E([d({type:String,reflect:!0})],S_.prototype,`label`,void 0),E([d({type:Number,reflect:!0})],S_.prototype,`count`,void 0),E([d({type:Boolean,reflect:!0})],S_.prototype,`collapsed`,void 0),E([d({type:String,reflect:!0})],S_.prototype,`orientation`,void 0),S_=E([T(`ixfx-list-group-header`)],S_);const C_=`:scope > li`,w_=`data-ixfx-group-header`,T_=`data-group-collapsed`,E_=new Set([`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`Home`,`End`]);function D_(e,n,r){return r.width>0&&r.height>0&&e>=r.left&&e<r.right&&n>=r.top&&n<r.bottom}function O_(e,n,r){if(e instanceof Text){if(!e.textContent?.trim())return!1;let i=document.createRange();return i.selectNodeContents(e),Array.from(i.getClientRects()).some(e=>D_(n,r,e))}return!(e instanceof Element)||e.hasAttribute(`data-drag-select-blank`)?!1:e.hasAttribute(`data-drag-select-content`)?D_(n,r,e.getBoundingClientRect()):Array.from(e.childNodes).some(e=>O_(e,n,r))?!0:e.childNodes.length===0&&D_(n,r,e.getBoundingClientRect())}function k_(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}function A_(e,n){if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;return!0}function j_(e,n,r){for(let i of e)n.has(i)||i.removeAttribute(r);for(let i of n)e.has(i)||i.setAttribute(r,``)}const M_=[`hidden`,T_,`not-checked`,`data-key`,`data-value`];function N_(e,n){return n.type===`childList`?n.target===e:n.target.parentElement===e}function P_(e,n,r){let i=e=>{let n=e;for(;n&&!r(n);)n=n.nextElementSibling;return n},a=i(e.firstElementChild);for(let r of n){if(r===a){a=i(a.nextElementSibling);continue}e.insertBefore(r,a)}}let V=class extends n{constructor(...e){super(...e),this.selectionMode=`single`,this.interactionMode=`standard`,this.sort=`none`,this.sortBy=``,this.items=[],this.displayProperty=``,this.iconProperty=``,this.iconColorProperty=``,this.textColorProperty=``,this.badgeProperty=``,this.keyProperty=``,this.itemWrap=`stop`,this.itemsDraggable=!1,this.groupBy=null,this.crossGroupSelection=!1,this._collapsedGroups=new Set,this.#e=new WeakMap,this.#t=new WeakMap,this.#n=g_,this.#r=!0,this.#i=!1,this.#p=new Set,this.#m=new Set,this.#h=!0,this.#g=!1,this.#_=!1,this.#v=0,this.#y=0,this.#w=new WeakSet,this.#T=[],this.#E=new Map,this.#D=[],this.#O=new Map,this.#k=new WeakMap,this.#A=0,this.#j=!1,this.#M=!1,this.#N=!1,this.#F=0,this.#I=new je(this),this.selection=new nr({getOrderedItems:()=>this._getVisibleItems(),isSelectable:e=>this._isCheckable(e),getModes:()=>({selectionMode:this.selectionMode,interactionMode:this.interactionMode}),getKey:D,getGroupKey:e=>this.#E.get(e)??null,crossGroupSelection:()=>this.crossGroupSelection,getFallbackGroupKey:()=>{let e=this.tickled.tickledId;return e?this.#E.get(e)??null:null},onChange:(e,n)=>{this._syncItemStates(),this._dispatch(`list-select`,{selected:e,previous:n,selectedKeys:this.selection.selectedKeys})}}),this.tickled=new oe(this,{getItems:()=>{let e=this._getVisibleItems();return this.#l??=e.map(e=>({id:e,enabled:!e.hasAttribute(`not-checked`)})),this.#l},onTickle:e=>{e!==void 0&&this._dispatch(`list-tickle`,{item:e})},onStateChange:()=>this._syncItemStates(),itemWrap:this.itemWrap,hoverDisabled:()=>this.#G.isDragging||this.#V.isDragging}),this.#L=!1,this.#R=0,this.#z=!1,this.#B=()=>{this.#z=!1},this.#V=new er(this,{source:`detail-list`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this._getVisibleItems().length>0,resolveEventToKey:e=>{if(!(e instanceof Element))return;let n=e.closest?.(`li`);if(!(!n||!this.contains(n)))return D(n)},prepareSelection:e=>this.#H(e),getMetrics:()=>({}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this._dispatchCancelable(`list-native-drag-start`,e),onActiveChange:(e,n)=>{this.#L=e,this.toggleAttribute(`data-native-dragging`,e);for(let r of this.querySelectorAll(`li`))r.toggleAttribute(`data-drag-origin`,e&&n!==void 0&&D(r)===n);if(e){let e=this.selection.selected.size;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#L=!1,this.toggleAttribute(`data-native-dragging`,!1),this.removeAttribute(`aria-label`);for(let e of this.querySelectorAll(`li`))e.removeAttribute(`data-drag-origin`);this.#U()},syncLightDomDraggable:()=>this._syncNativeDraggable(),shouldStart:()=>!this.#z}),this.#G=new Hn(this,{getSurface:()=>this.renderRoot.querySelector(`.container`),isEnabled:()=>this.selection.canDragSelect()&&this._getVisibleItems().length>0&&!this.hasAttribute(`disable-drag-select`),hitTest:e=>this.#q(e),getBaseSelection:()=>this.selection.selected,onPreview:(e,n)=>{this.#W=n;for(let n of this._getVisibleItems())n.toggleAttribute(`data-marquee`,e.has(n));this.requestUpdate()},onCommit:e=>{this.selection.applyDragSelection(e);for(let e of this._getVisibleItems())e.removeAttribute(`data-marquee`);this.#W=void 0,this.requestUpdate()},autoScroll:(e,n)=>{this._listEl&&(this._listEl.scrollLeft+=e)},shouldStart:e=>!this.#ve(e.composedPath())&&(this.#z=this.itemsDraggable&&this.#K(e),!this.itemsDraggable||this.#z)}),this.search=new Vt(this,{adapter:Mt(this,{itemSelector:C_,getLabel:e=>e.getAttribute(`data-search-label`)??e.textContent?.trim()??``,highlightKey:`detail-list-search`})}),this.#Ue=()=>{this.#y===0&&(this.#y=requestAnimationFrame(()=>{this.#y=0,this.#Ke()}))},this._onPointerOver=e=>{let n=this._findListItem(e.composedPath());n&&this.tickled.handlePointerEnter(n)},this._onPointerLeave=e=>{this.tickled.handlePointerLeave(e)},this._endKeyboardNav=()=>{this.removeAttribute(`data-keyboard-nav`)},this._onKeyDown=e=>{if(!this.search.isOpen){if((e.ctrlKey||e.metaKey)&&e.key===`a`){this.selection.canSelectAll()&&(e.preventDefault(),this.selection.selectAll());return}switch(E_.has(e.key)&&!this.hasAttribute(`data-keyboard-nav`)&&this.setAttribute(`data-keyboard-nav`,``),e.key){case`ArrowDown`:if(e.preventDefault(),this.#Ae(),e.shiftKey&&this.interactionMode===`vscode`){let e=this.tickled.tickledId;e&&this.selection.rangeTo(e)}break;case`ArrowUp`:if(e.preventDefault(),this.#je(),e.shiftKey&&this.interactionMode===`vscode`){let e=this.tickled.tickledId;e&&this.selection.rangeTo(e)}break;case`ArrowRight`:e.preventDefault(),this.#Ne();break;case`ArrowLeft`:e.preventDefault(),this.#Pe();break;case`Home`:e.preventDefault(),this.#Ee(this.#Oe());break;case`End`:e.preventDefault(),this.#Ee(this.#ke());break;case`Enter`:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this._dispatch(`list-item-click`,{item:n}),this._activateItem(n));break}case` `:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.selection.handleSpace(n));break}case`Escape`:this.selection.clear()}}},this._onClick=e=>{if(this.#G.isDragging||this.#V.isDragging||this.#R!==0)return;let n=e.composedPath(),r=this.#ve(n);if(r){this.toggleGroup(r.dataset.groupKey??``);return}let i=this._findListItem(n);i&&(this.focus(),this._dispatch(`list-item-click`,{item:i}),this.selection.handleClick(i,e))},this._onDblClick=e=>{let n=this._findListItem(e.composedPath());n&&this._activateItem(n)},this._onWheel=e=>{e.preventDefault();let n=Math.abs(e.deltaX)>Math.abs(e.deltaY)?e.deltaX:e.deltaY;this._listEl.scrollLeft+=n}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;#k;#A;#j;#M;#N;#P;#F;#I;#L;#R;#z;#B;#V;#H(e){let n=this._getVisibleItems(),r=n.find(n=>D(n)===e);if(!r||!this._isCheckable(r))return;this.selection.selected.has(r)||this.selection.replace(r);let i=[];n.forEach((n,r)=>{if(!this.selection.selected.has(n))return;let a=D(n)??e;i.push({key:a,index:r,item:this.#e.get(n)??n,element:n})});let a=i.find(n=>n.key===e);if(a)return{origin:a,selected:i}}_syncNativeDraggable(){if(this.isConnected&&!(!this.itemsDraggable&&!this.#_)){this.#_=this.itemsDraggable;for(let e of this.querySelectorAll(`li`))e instanceof HTMLElement&&(e.draggable=this.itemsDraggable&&this._isCheckable(e))}}#U(){this.#R&&clearTimeout(this.#R),this.#R=window.setTimeout(()=>{this.#R=0},0)}#W;#G;#K(e){let n=e.composedPath(),r=this._findListItem(n);if(!r)return!1;for(let e of n){if(e===r)break;if(e instanceof Element){if(e.matches(`input, button, a, select, textarea, [contenteditable], .ixfx-list-checkbox, [role="checkbox"]`))return!1;if(e.hasAttribute(`data-drag-select-blank`))return!0;if(e.hasAttribute(`data-drag-select-content`))return!1}}return!Array.from(r.childNodes).some(n=>O_(n,e.clientX,e.clientY))}#q(e){let n=this.renderRoot.querySelector(`.container`);if(!n)return[];let r=n.getBoundingClientRect(),i=e.x,a=e.y,o=e.x+e.width,s=e.y+e.height,c=[];for(let e of this._getVisibleItems()){let n=e.getBoundingClientRect(),l=n.left-r.left,u=n.top-r.top;l<=o&&l+n.width>=i&&u<=s&&u+n.height>=a&&c.push(e)}return c}#J(e){return`left:${e.x}px;top:${e.y}px;width:${Math.max(0,e.width)}px;height:${Math.max(0,e.height)}px`}#Y;#X;get registry(){return this.#Y}#Z(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#Q(){this.#Y&&(this.search.setModes(this.#Z()),this.#X?.(),this.#X=Rt(this.#Y,this.search))}connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.addEventListener(`pointerover`,this._onPointerOver),this.addEventListener(`pointerleave`,this._onPointerLeave),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`pointermove`,this._endKeyboardNav),this.addEventListener(`pointerdown`,this._endKeyboardNav),this.addEventListener(`click`,this._onClick),this.addEventListener(`dblclick`,this._onDblClick),this.addEventListener(`wheel`,this._onWheel),window.addEventListener(`pointerup`,this.#B),window.addEventListener(`pointercancel`,this.#B),this.#S=new ResizeObserver(()=>this.#ye()),this.#S.observe(this),this.#C=new MutationObserver(e=>{this.#He(e),this.#$(e),this.#ye(),this.#de()}),this.#C.observe(this,{childList:!0,subtree:!1,attributeFilter:[`hidden`]});for(let e of this.querySelectorAll(C_))this.#w.add(e);this.#a=new MutationObserver(e=>{e.some(e=>N_(this,e))&&this.#Le()}),this.#a.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:M_}),this.#Le(),this.#Y??=Yt(),this.#Q(),this.#de()}#$(e){if(!this.isConnected)return;let n=[];for(let r of e)for(let e of r.addedNodes)!(e instanceof HTMLElement)||e.parentElement!==this||e.localName!==`li`||this.#w.has(e)||(this.#w.add(e),n.push(e));if(n.length===0)return;let r=this.#Fe().length;if(!(n.length>=r)){for(let e of n)Xn(e);window.setTimeout(()=>this.#ye(),230)}}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerover`,this._onPointerOver),this.removeEventListener(`pointerleave`,this._onPointerLeave),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`pointermove`,this._endKeyboardNav),this.removeEventListener(`pointerdown`,this._endKeyboardNav),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`dblclick`,this._onDblClick),this.removeEventListener(`wheel`,this._onWheel),window.removeEventListener(`pointerup`,this.#B),window.removeEventListener(`pointercancel`,this.#B),this.#z=!1,cancelAnimationFrame(this.#v),cancelAnimationFrame(this.#y),this.#y=0,this.#S?.disconnect(),this.#S=void 0,this.#C?.disconnect(),this.#C=void 0,this.#P?.disconnect(),this.#P=void 0,this.#a?.disconnect(),this.#a=void 0,this.#Le(),this.#X?.(),this.#X=void 0,this.#Y=void 0,this.#R&&=(clearTimeout(this.#R),0)}firstUpdated(){this.#Ve(),this.filterPredicate&&this.#se(),this.#be(),this.#We(),this._syncNativeDraggable()}willUpdate(e){super.willUpdate(e),e.has(`groupBy`)&&this.hasUpdated&&(this._collapsedGroups.size>0&&(this._collapsedGroups=new Set),this.#N=!0)}updated(e){if(super.updated(e),(e.has(`groupBy`)||e.has(`groupLabel`)||e.has(`_collapsedGroups`))&&(this.#de(),this.#N&&(this.#N=!1,this._dispatch(`list-group-change`,{groupBy:this.groupBy}))),e.has(`searchModes`)&&this.#Q(),e.has(`provider`)){this.#T=[],this.#F=0,this.#I.provider=this.provider,queueMicrotask(()=>{this.provider&&this.#I.request(void 0)});return}let n=e.has(`displayProperty`)||e.has(`formatter`)||e.has(`iconProperty`)||e.has(`iconColorProperty`)||e.has(`textColorProperty`)||e.has(`badgeProperty`)||e.has(`keyProperty`);(e.has(`items`)||n)&&this.provider===void 0&&this.items.length>0&&this.#te(this.items,!n),this.#oe(),(e.has(`sort`)||e.has(`sortBy`)||e.has(`sortComparator`))&&this.#ce(),e.has(`filterPredicate`)&&(this.#se(),this.#ye(),this.#de()),e.has(`interactionMode`)?(this.selection.clearAnchor(),this.#h=!0,this._syncItemStates(),this._syncNativeDraggable()):e.has(`checkboxRenderer`)&&this.interactionMode===`checked`&&this._syncCheckboxes(),e.has(`itemsDraggable`)&&(this._syncNativeDraggable(),this.#V.refreshDraggable())}get selectedItem(){return[...this.selection.selected].at(-1)}get selectedItems(){return this.selection.selected}refreshLayout(){this.#be(),this.#We()}addItem(e,n){let r;if(typeof e==`string`){let n=document.createElement(`li`);this._setLabel(n,e),r=n}else r=e;n?.notChecked&&r.setAttribute(`not-checked`,``),this.appendChild(r),this.#ze(r),this.sort!==`none`&&this.#ce(),this.interactionMode===`checked`&&this._syncCheckboxes(),this.#de()}removeItem(e){return this.selection.deselect(e),$n(e).then(()=>{e.remove(),this.#de(),this.interactionMode===`checked`&&this._syncCheckboxes(),this.#ye()})}removeItems(e){return Promise.all([...e].map(e=>this.removeItem(e))).then(()=>void 0)}clearItems(){this.replaceChildren(),this.#O.clear(),this.#de(),this.selection.reset(),this.#T=[],this.#F=0,this._syncItemStates()}setItems(e){this.clearItems();for(let n of e)this.appendChild(n),this.#ze(n);this.sort!==`none`&&this.#ce(),this.interactionMode===`checked`&&this._syncCheckboxes(),this.#de()}getItemData(e){return this.#e.get(e)}visibleKeys(){let e=this._listEl;if(!e)return[];let n=e.scrollLeft,r=n+e.getBoundingClientRect().width,i=[];for(let a of x_(this._getVisibleItems(),__(e),n,r)){let e=D(a);e!==void 0&&i.push(e)}return i}dispatch(e,n){this.#Y?.invoke(e,n)}select(e){this.selection.replace(e)}selectMany(e){this.selection.selectMany(e)}deselect(e){this.selection.deselect(e)}clearSelection(){this.selection.clear()}selectAll(){this.selection.canSelectAll()&&this.selection.selectAll()}get selectedKeys(){return this.selection.selectedKeys}get tickledKey(){let e=this.tickled.tickledId;return e?D(e):void 0}selectKeys(e){this.selection.selectKeys(e,e=>this.#ee(e))}addSelectedKeys(e){this.selection.addKeys(e,e=>this.#ee(e))}removeSelectedKeys(e){this.selection.removeKeys(e,e=>this.#ee(e))}focusKey(e){let n=this.#ee(e);n&&(this.tickled.focus(n),n.scrollIntoView({block:`nearest`,inline:`nearest`}))}#ee(e){if(!this.#d){let e=new Map;for(let n of this.#Fe()){let r=D(n);r!==void 0&&!e.has(r)&&e.set(r,n)}this.#d=e}return this.#d.get(e)}*selectedFilter(e){let n=n=>{switch(e){case`selected`:return n.hasAttribute(`data-selected`);case`checked`:return n.hasAttribute(`data-checked`);case`either`:return n.hasAttribute(`data-selected`)||n.hasAttribute(`data-checked`)}};for(let e of this.querySelectorAll(C_))e.hidden||n(e)&&(yield e)}#te(e,n=!1){let r=e=>e.getAttribute(`data-key`)??e.getAttribute(`data-search-label`)??null,i=new Set([...this.selection.selected].map(r).filter(e=>e!==null)),a=this.selection.anchor?r(this.selection.anchor):null;if(n?this.#ne(e):this.replaceChildren(...e.map((e,n)=>this.#re(e,n))),i.size>0||a!==null){let e=[],n;for(let o of this.querySelectorAll(C_)){let s=r(o);s!==null&&i.has(s)&&e.push(o),s!==null&&s===a&&(n=o)}this.selection.seed(e,n)}this.sort!==`none`&&this.#ce(),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates(),this.#ye(),this.#de()}#ne(e){let n=new Map;for(let e of this.#Fe())this.#e.has(e)&&!n.has(this.#e.get(e))&&n.set(this.#e.get(e),e);let r=e.map((e,r)=>{let i=n.get(e);return i&&(!this.formatter||this.#t.get(i)===r)?(n.delete(e),i):this.#re(e,r)}),i=new Set(r);for(let e of this.#Fe())i.has(e)||e.remove();if(this.#ue()){for(let e of r)this.#k.set(e,this.#A++);this.append(...r.filter(e=>e.parentElement!==this)),this.#de();return}P_(this,r,e=>e.localName===`li`)}#re(e,n){let r=document.createElement(`li`);this.#e.set(r,e),this.#t.set(r,n);let i=this.formatter?this.formatter(e,n):this.displayProperty?this.#ie(e,this.displayProperty):e,a=this.#ae(e,this.textColorProperty),o=this.#ae(e,this.iconColorProperty);if(o!==void 0&&r.setAttribute(`data-icon-color`,o),typeof i==`string`){let n=this._setLabel(r,i);if(a!==void 0&&(n.style.color=a),this.iconProperty){let n=this.#ie(e,this.iconProperty);typeof n==`string`&&n.length>0&&r.setAttribute(`data-icon`,n)}}else i instanceof Node&&(r.appendChild(i),a!==void 0&&(r.style.color=a));if(this.keyProperty){let n=this.#ie(e,this.keyProperty);n!=null&&r.setAttribute(`data-key`,String(n))}return this.#ze(r),this.#Be(r,this.#ie(e,this.badgeProperty)),r}#ie(e,n){if(!(typeof e!=`object`||!e||!(n in e)))return e[n]}#ae(e,n){return n?Hg(this.#ie(e,n)):void 0}#oe(){if(this.provider===void 0)return;let e=this.#I.items;if(e===this.#T)return;let n=0;for(;n<this.#T.length&&n<e.length&&this.#T[n]===e[n];)n++;if(n===this.#T.length&&n<=e.length){let r=e.slice(n);for(let e of r)this.appendChild(this.#re(e,this.#F++));this.sort!==`none`&&(cancelAnimationFrame(this.#v),this.#v=requestAnimationFrame(()=>this.#ce())),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates(),this.#ye(),this.#de()}else this.#F=0,this.#te(e);this.#T=e}#se(){if(!this.filterPredicate){for(let e of this.querySelectorAll(C_))e.removeAttribute(`hidden`);return}for(let e of this.querySelectorAll(C_))this.filterPredicate(e)?e.removeAttribute(`hidden`):e.setAttribute(`hidden`,``)}#ce(){if(this.sort===`none`)return;let e=[...this.querySelectorAll(C_)];if(!(e.length<2)){if(this.#ue()){this.#de();return}P_(this,this.#le(e),e=>e.localName===`li`),this.#ye(),this.#de()}}#le(e){let n=this.sort===`descending`?-1:1,r=e.map(e=>({element:e,data:this.getItemData(e),label:e.getAttribute(`data-search-label`)??e.textContent?.trim()??``})),i=new Intl.Collator(void 0,{numeric:!0}),a;if(this.sortComparator){let e=this.sortComparator;a=(n,i)=>e(r[n],r[i])}else if(this.sortBy){let e=this.sortBy,n=r.map(n=>{let r=this.#ie(n.data,e);return typeof r==`number`?r:r==null?``:String(r)});a=(e,r)=>{let a=n[e],o=n[r];return typeof a==`number`&&typeof o==`number`?a-o:i.compare(String(a),String(o))}}else a=(e,n)=>i.compare(r[e].label,r[n].label);let o=e.map((e,n)=>n);return o.sort((e,r)=>a(e,r)*n||e-r),o.map(n=>e[n])}#ue(){return this.groupBy!==null&&this.groupBy!==void 0&&this.groupBy!==``}#de(){this.#M||!this.#ue()&&!this.#j||(this.#M=!0,queueMicrotask(()=>{this.#M=!1,this.#ge()}))}#fe(e,n){return this.#ie(this.getItemData(e),n)??e.getAttribute(`data-${n}`)}#pe(e){let n=this.groupBy;return mn(typeof n==`string`?this.#fe(e,n):n(this.getItemData(e),e))}#me(e){return!e.hidden&&(!this.filterPredicate||this.filterPredicate(e))}#he(e){let n=this.#O.get(e);return n||(n=document.createElement(`ixfx-list-group-header`),n.setAttribute(w_,``),n.dataset.groupKey=e,this.#O.set(e,n)),n}#ge(){let e=this.#ue();if(!e&&!this.#j)return;let n=this.#Fe();for(let e of n)this.#k.has(e)||this.#k.set(e,this.#A++);let r=n.toSorted((e,n)=>this.#k.get(e)-this.#k.get(n));this.sort!==`none`&&r.length>1&&(r=this.#le(r));let i=[],a=[],o=new Map,s=new Set;if(e){let e=this.groupLabel,n=gn(r,e=>this.#pe(e),e?(n,r)=>e(n,r.map(e=>this.getItemData(e)??e)):void 0);for(let e of n){let n=e.items.filter(e=>this.#me(e)).length,r=n>0&&this._collapsedGroups.has(e.key);if(n>0){let o=this.#he(e.key);o.label=e.label,o.count=n,o.collapsed=r,s.add(e.key),i.push(o),a.push({key:e.key,label:e.label,count:n,collapsed:this._collapsedGroups.has(e.key)})}for(let n of e.items)o.set(n,e.key),n.toggleAttribute(T_,r),i.push(n)}}else{for(let e of r)e.removeAttribute(T_);i.push(...r)}for(let[e,n]of this.#O)s.has(e)||(n.remove(),this.#O.delete(e));this.#E=o,this.#D=a,this.#j=e,P_(this,i,e=>e.localName===`li`||e.hasAttribute(w_)),this.tickled.tickledId?.hasAttribute(T_)&&this.tickled.focus(void 0),this.#_e(e),this.#ye()}#_e(e){if(!e){this.#P?.disconnect(),this.#P=void 0;return}this.#P||!this.isConnected||(this.#P=new MutationObserver(()=>this.#de()),this.#P.observe(this,{subtree:!0,attributes:!0,attributeFilter:[`hidden`]}))}get groups(){return this.#D}setGroupCollapsed(e,n){if(this._collapsedGroups.has(e)===n)return;let r=new Set(this._collapsedGroups);n?r.add(e):r.delete(e),this._collapsedGroups=r,this._dispatch(`list-group-toggle`,{groupKey:e,collapsed:n})}toggleGroup(e){this.setGroupCollapsed(e,!this._collapsedGroups.has(e))}collapseAllGroups(){for(let e of this.#D)this.setGroupCollapsed(e.key,!0)}expandAllGroups(){for(let e of[...this._collapsedGroups])this.setGroupCollapsed(e,!1)}#ve(e){for(let n of e){if(n===this)break;if(n instanceof HTMLElement&&n.parentElement===this&&n.hasAttribute(w_))return n}}#ye(){this.#r=!0,!this.#i&&(this.#i=!0,requestAnimationFrame(()=>{this.#i=!1,this.#Ke()}))}#be(){this.#r=!1,this.#n=this.isConnected&&this._listEl?v_(this._getVisibleItems(),__(this._listEl)):g_}#xe(){let e=this._getVisibleItems();if(this.#r||!this._listEl)return this.#be(),this.#n;let n=this.tickled.tickledId,r=[e[0],n&&this.#n.positions.has(n)?n:void 0,e.at(-1)];return y_(this.#n,r,__(this._listEl))||this.#be(),this.#n}#Se(e){let n=this.#n.positions.get(e);return n===void 0&&(this.#be(),n=this.#n.positions.get(e)),n}#Ce(e){return this.#n.columns[e]?.items}#we(e,n){return this.#Ce(e)?.[n]}#Te(){let{columns:e}=this.#xe();return{cols:e.length,rows:Math.max(0,...e.map(e=>e.items.length))}}#Ee(e){e&&(this.tickled.handleKeyboardNavigation(e),this.tickled.tickledId?.scrollIntoView({block:`nearest`,inline:`nearest`}))}#De(e,n,r,i){let{cols:a}=this.#Te(),o=this._getVisibleItems().length+1,s=r===0?e:e+r,c=i===0?n:n+i,l=!1;for(let u=0;u<o;u++){let o=this.#Ce(s)?.length??0;if(c<0||c>=o){if(r!==0||l){if(this.itemWrap===`wrap`)r<0?s=a-1:r>0&&(s=0),l=!0;else return}if(i>0){if(s+1<a)s+=1,c=0,l=!0;else if(this.itemWrap===`wrap`)s=0,c=0,l=!0;else return}else if(i<0){if(s-1>=0)--s,c=(this.#Ce(s)?.length??1)-1,l=!0;else if(this.itemWrap===`wrap`)s=a-1,c=(this.#Ce(s)?.length??1)-1,l=!0;else return}else if(r!==0){let e=this.#Ce(s)?.length??0;c>=e&&e>0&&(c=e-1)}if(s===e&&c===n+i)return;continue}let u=this.#we(s,c);if(u&&this._isCheckable(u))return u;c+=i}}#Oe(){return this._getVisibleItems().find(e=>this._isCheckable(e))}#ke(){let e=this._getVisibleItems();for(let n=e.length-1;n>=0;n--)if(this._isCheckable(e[n]))return e[n]}#Ae(){this.#xe();let e=this.tickled.tickledId?this.#Se(this.tickled.tickledId):void 0;if(!e){this.#Ee(this.#Oe());return}let n=this.#De(e.col,e.row,0,1);n&&this.#Ee(n)}#je(){this.#xe();let e=this.tickled.tickledId?this.#Se(this.tickled.tickledId):void 0;if(!e){this.#Ee(this.#ke());return}let n=this.#De(e.col,e.row,0,-1);n&&this.#Ee(n)}#Me(e,n){if(this.#D.length===0)return this.#De(e.col,e.row,n,0);let r=this.#Ce(e.col+n),i=this.tickled.tickledId,a=i?this.#n.tops.get(i):void 0;if(!r||a===void 0)return;let o,s=1/0;for(let e of r){if(!this._isCheckable(e))continue;let n=Math.abs((this.#n.tops.get(e)??1/0)-a);n<s&&(o=e,s=n)}return o}#Ne(){this.#xe();let e=this.tickled.tickledId?this.#Se(this.tickled.tickledId):void 0;if(!e){this.#Ee(this.#Oe());return}let n=this.#Me(e,1);n?this.#Ee(n):this.itemWrap===`wrap`&&this.#Ee(this.#Oe())}#Pe(){this.#xe();let e=this.tickled.tickledId?this.#Se(this.tickled.tickledId):void 0;if(!e){this.#Ee(this.#Oe());return}let n=this.#Me(e,-1);n?this.#Ee(n):this.itemWrap===`wrap`&&this.#Ee(this.#ke())}_getVisibleItems(){return this.#Ie(),this.#c!==this.filterPredicate&&(this.#Re(),this.#c=this.filterPredicate),this.#s??=this.#Fe().filter(e=>!(e.hidden||e.hasAttribute(T_)||this.filterPredicate&&!this.filterPredicate(e))),this.#s}#Fe(){return this.#Ie(),this.#o??=[...this.querySelectorAll(C_)],this.#o}#Ie(){if(!this.#a){this.#Le();return}this.#a.takeRecords().some(e=>N_(this,e))&&this.#Le()}#Le(){this.#o=void 0,this.#d=void 0,this.#h=!0,this.#Re()}#Re(){this.#s=void 0,this.#l=void 0,this.#u=void 0,this.#r=!0}async fitColumnWidth(){await this.updateComplete;let e=this._getVisibleItems();if(e.length===0)return 0;let n=this.style.getPropertyValue(`--detail-list-column-width`),r=this.style.getPropertyPriority(`--detail-list-column-width`);this.style.setProperty(`--detail-list-column-width`,`max-content`);let i=Math.ceil(Math.max(...e.map(e=>e.getBoundingClientRect().width)));return n?this.style.setProperty(`--detail-list-column-width`,n,r):this.style.removeProperty(`--detail-list-column-width`),this.style.setProperty(`--detail-list-column-width`,`${i}px`),this.#ye(),i}_isCheckable(e){return this.interactionMode!==`checked`||!e.hasAttribute(`not-checked`)}_setLabel(e,n){let r=document.createElement(`span`);return r.style.cssText=`overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0`,r.textContent=n,e.appendChild(r),e.setAttribute(`data-search-label`,n),r}#ze(e){let n=e.getAttribute(`data-icon`);if(!n||e.firstElementChild?.tagName===`IXFX-ICON`)return;let r=document.createElement(`ixfx-icon`);r.setAttribute(`name`,n),r.style.marginInlineEnd=`var(--detail-list-icon-gap, 6px)`,r.style.flexShrink=`0`;let i=e.getAttribute(`data-icon-color`);i&&(r.style.color=i),e.prepend(r)}#Be(e,n){if(Vg(n))return;let r=e.querySelector(`:scope > .item-badge`);r||(r=document.createElement(`span`),r.className=`item-badge`,r.style.cssText=`flex-shrink:0;display:inline-flex;align-items:center;margin-inline-start:auto;padding-inline-start:var(--detail-list-badge-gap,8px)`,e.appendChild(r)),r.replaceChildren(),n instanceof Node?r.appendChild(n):o(n,r)}#Ve(){for(let e of this.#Fe())this.#ze(e)}#He(e){for(let n of e)for(let e of n.addedNodes)e instanceof HTMLLIElement&&e.parentElement===this&&this.#ze(e)}_syncItemStates(){let e=this.selection.selected,n=this.interactionMode===`checked`?new Set([...e].filter(e=>!e.hasAttribute(`not-checked`))):new Set,r=this.tickled.tickledId,i=this.#h||!A_(this.#p,e)||!A_(this.#m,n);if(this.#h){for(let i of this.#Fe())i.toggleAttribute(`data-tickled`,i===r),i.toggleAttribute(`data-selected`,e.has(i)),i.toggleAttribute(`data-checked`,n.has(i));this.#h=!1}else r!==this.#f&&(this.#f?.removeAttribute(`data-tickled`),r?.setAttribute(`data-tickled`,``)),j_(this.#p,e,`data-selected`),j_(this.#m,n,`data-checked`);this.#f=r,this.#p=new Set(e),this.#m=n,this.dataset.inputMode!==this.tickled.inputMode&&(this.dataset.inputMode=this.tickled.inputMode),i&&this._syncCheckboxes()}_syncCheckboxes(){let e=this.interactionMode===`checked`,n=typeof this.checkboxRenderer==`function`;if(!(!e&&!this.#g)){this.#g=e;for(let r of this.querySelectorAll(`li`)){let i=r.querySelector(`.ixfx-list-checkbox`);if(!e){i&&i.remove();continue}if(r.hasAttribute(`not-checked`)){i&&i.remove();continue}let a=i?.classList.contains(`ixfx-list-checkbox-custom`)??!1;i&&a!==n&&i.remove();let s=r.querySelector(`.ixfx-list-checkbox`);if(!s){if(n){let e=this.checkboxRenderer,n=e.margin??`0`,i=e.width??`24px`;s=this._createCustomCheckbox(r,n,i)}else s=this._createNativeCheckboxCell(r);r.prepend(s)}let c=this.selection.selected.has(r);if(n){if(s.setAttribute(`aria-checked`,String(c)),s.toggleAttribute(`data-checked`,c),this.checkboxRenderer){let e=typeof this.checkboxRenderer==`function`?this.checkboxRenderer:this.checkboxRenderer.renderer;o(e(c),s)}}else{let e=s.querySelector(`input.ixfx-list-checkbox`);e&&(e.checked=c)}}}}_createNativeCheckboxCell(e){let n=document.createElement(`span`);n.className=`ixfx-list-checkbox ixfx-list-checkbox-native`,n.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:18px;margin:0 6px 0 0;cursor:pointer;pointer-events:auto`,n.tabIndex=-1,n.setAttribute(`role`,`checkbox`),n.setAttribute(`part`,`checkbox`),n.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.toggle(e)});let r=document.createElement(`input`);return r.type=`checkbox`,r.className=`ixfx-list-checkbox`,r.style.cssText=`pointer-events:none;cursor:pointer;margin:0`,n.appendChild(r),n}_createCustomCheckbox(e,n,r){let i=document.createElement(`span`);return i.className=`ixfx-list-checkbox ixfx-list-checkbox-custom`,i.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:${r};margin:${n};cursor:pointer;pointer-events:auto`,i.tabIndex=-1,i.setAttribute(`role`,`checkbox`),i.setAttribute(`part`,`checkbox`),i.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.toggle(e)}),i}_findListItem(e){for(let n of e)if(n instanceof Element){if(n===this)break;if(n.parentElement===this&&n.matches(`li`))return n}}_dispatch(e,n){this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0}))}_dispatchCancelable(e,n){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}#Ue;#We(){this.#y===0&&(this.#y=requestAnimationFrame(()=>{this.#y=0,this.#Ke()}))}#Ge(){let e=this._getVisibleItems();return this.#u??=e.flatMap(e=>{let n=D(e);return n===void 0?[]:[n]}),this.#u}#Ke(){let e=this.#Ge(),n=this.visibleKeys();k_(this.#b,e)&&k_(this.#x,n)||(this.#b=e,this.#x=n,this._dispatch(`detail-list-viewport-change`,{renderedKeys:e,visibleKeys:n}))}_activateItem(e){this.interactionMode!==`manual`&&this.selection.replace(e),this._dispatch(`list-activate`,{item:e})}static{this.styles=[w,Ng(`x`),Ht,r`
|
|
5608
5608
|
:host {
|
|
5609
5609
|
display: block;
|
|
5610
5610
|
position: relative;
|
|
@@ -5786,7 +5786,8 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5786
5786
|
</div>
|
|
5787
5787
|
${this.search.renderField()}
|
|
5788
5788
|
</div>
|
|
5789
|
-
`}};E([d({type:String,attribute:`selection-mode`})],H.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],H.prototype,`interactionMode`,void 0),E([d({type:String})],H.prototype,`sort`,void 0),E([d({type:String,attribute:`sort-by`})],H.prototype,`sortBy`,void 0),E([d({attribute:!1})],H.prototype,`sortComparator`,void 0),E([d({attribute:!1})],H.prototype,`items`,void 0),E([d({attribute:!1})],H.prototype,`provider`,void 0),E([d({type:String,attribute:`display-property`})],H.prototype,`displayProperty`,void 0),E([d({attribute:!1})],H.prototype,`formatter`,void 0),E([d({type:String,attribute:`icon-property`})],H.prototype,`iconProperty`,void 0),E([d({type:String,attribute:`icon-color-property`})],H.prototype,`iconColorProperty`,void 0),E([d({type:String,attribute:`text-color-property`})],H.prototype,`textColorProperty`,void 0),E([d({type:String,attribute:`badge-property`})],H.prototype,`badgeProperty`,void 0),E([d({type:String,attribute:`key-property`})],H.prototype,`keyProperty`,void 0),E([d({attribute:!1})],H.prototype,`filterPredicate`,void 0),E([d({type:String,attribute:`item-wrap`})],H.prototype,`itemWrap`,void 0),E([d({attribute:!1})],H.prototype,`checkboxRenderer`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],H.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],H.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],H.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],H.prototype,`dragPreviewSource`,void 0),E([d({attribute:`group-by`})],H.prototype,`groupBy`,void 0),E([d({attribute:!1})],H.prototype,`groupLabel`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],H.prototype,`crossGroupSelection`,void 0),E([m()],H.prototype,`_collapsedGroups`,void 0),E([f(`ul`)],H.prototype,`_listEl`,void 0),H=E([T(`ixfx-detail-list`)],H);let P_=null;const F_=new Set;function I_(e){F_.add(e)}function L_(e){F_.delete(e),P_!==null&&P_.sourceHost}function R_(e,n,r,i,a,o){P_={panelId:e,kind:o,sourceHost:n,pointerId:r,ghost:z_(n,e),outside:!1};for(let e of F_)e.setDragActive(!0);P_.ghost?.move(i,a),window.addEventListener(`pointermove`,B_),window.addEventListener(`pointerup`,V_),window.addEventListener(`pointercancel`,H_),window.addEventListener(`keydown`,U_)}function z_(e,n){let r=Array.from(e.children).find(e=>e instanceof HTMLElement&&e.panelId===n);if(!r)return null;let i=document.createElement(`span`);if(i.style.display=`inline-flex`,i.style.alignItems=`center`,i.style.gap=`var(--space-xs, 4px)`,i.style.minWidth=`0`,r.iconName){let e=document.createElement(`ixfx-icon`);e.name=r.iconName,i.appendChild(e)}let a=document.createElement(`span`);a.textContent=r.title||n,a.style.overflow=`hidden`,a.style.textOverflow=`ellipsis`,a.style.whiteSpace=`nowrap`,i.appendChild(a);try{return Wg({anchor:r,content:i})}catch{return null}}function B_(e){let n=P_;if(n===null||e.pointerId!==n.pointerId)return;n.ghost?.move(e.clientX,e.clientY);let r=W_(n,e.clientX,e.clientY);for(let e of F_)e.setDropZone(r!==null&&r.host===e?r:null);let i=!G_(e.clientX,e.clientY);i!==n.outside&&(n.outside=i,K_(n,i?`dock-panel-drag-out`:`dock-panel-drag-in`,e))}function V_(e){let n=P_;if(n===null||e.pointerId!==n.pointerId)return;let r=W_(n,e.clientX,e.clientY);r===null?G_(e.clientX,e.clientY)||q_(n,e):r.host.handleDrop(n.panelId,r,n.sourceHost),J_()}function H_(e){let n=P_;n!==null&&e.pointerId===n.pointerId&&J_()}function U_(e){P_!==null&&e.key===`Escape`&&J_()}function W_(e,n,r){let i=e.sourceHost.isolated;for(let a of F_){if(i&&a!==e.sourceHost)continue;let o=a.computeDropZone(n,r,e.panelId,e.kind);if(o!==null)return o}return null}function G_(e,n){for(let r of F_){let i=r.getBoundingClientRect();if(e>=i.left&&e<=i.right&&n>=i.top&&n<=i.bottom)return!0}return!1}function K_(e,n,r){e.sourceHost.dispatchEvent(new CustomEvent(n,{detail:{panelId:e.panelId,clientX:r.clientX,clientY:r.clientY,screenX:r.screenX,screenY:r.screenY},bubbles:!0,composed:!0}))}function q_(e,n){let r=e.sourceHost.getPanelSnapshot(e.panelId);r!==null&&e.sourceHost.dispatchEvent(new CustomEvent(`dock-panel-tear-out`,{detail:{panelId:e.panelId,snapshot:r,clientX:n.clientX,clientY:n.clientY,screenX:n.screenX,screenY:n.screenY},bubbles:!0,composed:!0}))}function J_(){let e=P_;if(e!==null){for(let e of F_)e.setDropZone(null),e.setDragActive(!1);e.ghost?.destroy(),P_=null,window.removeEventListener(`pointermove`,B_),window.removeEventListener(`pointerup`,V_),window.removeEventListener(`pointercancel`,H_),window.removeEventListener(`keydown`,U_)}}function Y_(){return P_!==null}function X_(){return P_?.panelId??null}function Z_(e){return e.kind===`split`}function U(e){return e.kind===`stack`}function Q_(){return{kind:`stack`,panels:[],active:``}}function $_(){return{version:1,root:Q_()}}function ev(e,n,r){let i={kind:`stack`,panels:[...e],active:n??e[0]??``},a=r?.trim();return a&&(i.name=a),i}function tv(e,n,r){let i=n.length>0?1/n.length:1;return{kind:`split`,direction:e,children:[...n],sizes:r?[...r]:n.map(()=>i)}}function nv(e){if(U(e))return iv(e),e.panels.includes(e.active)||(e.active=e.panels[0]??``),e;for(let n=e.children.length-1;n>=0;n--){nv(e.children[n]);let r=e.children[n];if(U(r)&&r.panels.length===0&&!r.name){e.children.splice(n,1),e.sizes.splice(n,1);continue}Z_(r)&&r.children.length===1&&(e.children.splice(n,1,r.children[0]),e.sizes.splice(n,1,r.sizes[0]??e.sizes[n]??1))}for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];Z_(r)&&r.direction===e.direction&&(e.children.splice(n,1,...r.children),e.sizes.splice(n,1,...r.sizes))}if(e.children.length===0)return rv(e,Q_());if(e.children.length===1)return e.children[0];for(;e.sizes.length<e.children.length;)e.sizes.push(1/e.children.length);return e.sizes.length>e.children.length&&(e.sizes.length=e.children.length),e}function rv(e,n){if(U(n)){e.kind=`stack`;let r=e;r.panels=n.panels,r.active=n.active,n.name===void 0?delete r.name:r.name=n.name,n.hideLabels===void 0?delete r.hideLabels:r.hideLabels=n.hideLabels,delete r.collapsed,delete r.preCollapseSize,n.collapsed!==void 0&&(r.collapsed=n.collapsed),n.preCollapseSize!==void 0&&(r.preCollapseSize=n.preCollapseSize)}else{e.kind=`split`;let r=e;r.direction=n.direction,r.children=n.children,r.sizes=n.sizes;let i=r;delete i.panels,delete i.active,delete i.name,delete i.collapsed,delete i.preCollapseSize}return e}function iv(e){if(e.name===void 0)return;let n=typeof e.name==`string`?e.name.trim():``;n?e.name=n:delete e.name}function av(e,n){let r=e;for(let e of n){if(!Z_(r))return null;let n=r.children[e];if(!n)return null;r=n}return r}function ov(e,n){if(n.length===0)return null;let r=av(e,n.slice(0,-1));return r!==null&&Z_(r)?r:null}function sv(e,n){return cv(e,n,[])}function cv(e,n,r){if(U(e))return e.panels.includes(n)?r:null;for(let i=0;i<e.children.length;i++){let a=cv(e.children[i],n,[...r,i]);if(a!==null)return a}return null}function lv(e){return U(e)?[...e.panels]:e.children.flatMap(lv)}function uv(e,n){let r=n.trim();return r?dv(e,r,[]):null}function dv(e,n,r){if(U(e))return e.name===n?r:null;for(let i=0;i<e.children.length;i++){let a=dv(e.children[i],n,[...r,i]);if(a!==null)return a}return null}function fv(e){let n=[],r=e=>{if(U(e)){e.name&&n.push(e.name);return}e.children.forEach(r)};return r(e),n}function pv(e){let n=[];return mv(e,[],n),n}function mv(e,n,r){if(U(e)){r.push(n);return}e.children.forEach((e,i)=>mv(e,[...n,i],r))}function hv(e,n,r){let i=r===void 0?e.panels.length:Math.max(0,Math.min(r,e.panels.length));e.panels.splice(i,0,n),e.active=n}function gv(e,n){let r=e.panels.indexOf(n);r<0||(e.panels.splice(r,1),e.active===n&&(e.active=e.panels[Math.min(r,e.panels.length-1)]??``))}function _v(e,n){return!e.panels.includes(n)||e.active===n?!1:(e.active=n,!0)}function vv(e,n,r,i,a){let o=av(e,n);if(o===null)return null;if(n.length===0){if(Z_(e)&&e.direction===r){let n=a===`before`?0:e.children.length,r=a===`before`?0:e.children.length-1,o=e.sizes[r];return e.children.splice(n,0,i),e.sizes.splice(n,0,o===void 0?1:o/2),o!==void 0&&(e.sizes[a===`before`?r+1:r]=o/2),[n]}return yv(e,r,i,a),[a===`before`?0:1]}let s=ov(e,n);if(s===null)return null;let c=n[n.length-1];if(s.direction===r){let r=a===`before`?c:c+1,o=s.sizes[c]===void 0?1:s.sizes[c]/2;s.sizes[c]=o,s.children.splice(r,0,i),s.sizes.splice(r,0,o);let l=[...n.slice(0,-1),r];return nv(e),l}let l=tv(r,a===`before`?[i,o]:[o,i]);s.children[c]=l,nv(e);let u=a===`before`?0:1;return[...n.slice(0,-1),c,u]}function yv(e,n,r,i){let a=bv(e);return rv(e,tv(n,i===`before`?[r,a]:[a,r])),nv(e),!0}function bv(e){return U(e)?{...e,panels:[...e.panels]}:{...e,children:[...e.children],sizes:[...e.sizes]}}function xv(e,n,r){let i=av(e,n);if(i===null||!U(i))return null;let a=n.length===0;if(r&&r!==i){for(let e of i.panels)hv(r,e);a||(i.panels=[],i.active=``)}if(a)return rv(e,Q_()),i;let o=ov(e,n);if(o===null)return null;let s=n[n.length-1];return o.children.splice(s,1),o.sizes.splice(s,1),nv(e),i}const Sv=1e-9;function Cv(e,n){return e.length===n.length&&e.every((e,r)=>e===n[r])}function wv(e,n){if(typeof n==`string`)return uv(e,n);if(!Array.isArray(n))return null;let r=e;for(let e of n){if(!Number.isInteger(e)||e<0||!Z_(r))return null;let n=r.children[e];if(!n)return null;r=n}return U(r)?[...n]:null}function Tv(e){let n=[],r=(e,i,a)=>{if(U(e)){n.push({path:i,name:e.name??null,rect:a});return}let o=e.sizes.reduce((e,n)=>e+n,0),s=o>0?o:e.children.length||1,c=0;e.children.forEach((n,o)=>{let l=(e.sizes[o]??s/e.children.length)/s;if(e.direction===`row`){let e=a.w*l;r(n,[...i,o],{x:a.x+c,y:a.y,w:e,h:a.h}),c+=e}else{let e=a.h*l;r(n,[...i,o],{x:a.x,y:a.y+c,w:a.w,h:e}),c+=e}})};return r(e,[],{x:0,y:0,w:1,h:1}),n}function Ev(e,n,r,i){return Math.min(n,i)-Math.max(e,r)}function Dv(e,n){let r=wv(e,n);if(r===null)return null;let i=Tv(e),a=i.find(e=>Cv(e.path,r));if(!a)return null;let o=a.rect,s=[],c=[],l=[],u=[];i.forEach((e,n)=>{if(e===a)return;let r=e.rect,i={name:e.name,path:[...e.path]};if(Math.abs(r.y+r.h-o.y)<Sv){let e=Ev(r.x,r.x+r.w,o.x,o.x+o.w);e>Sv&&s.push({info:i,overlap:e,order:n})}if(Math.abs(o.y+o.h-r.y)<Sv){let e=Ev(r.x,r.x+r.w,o.x,o.x+o.w);e>Sv&&c.push({info:i,overlap:e,order:n})}if(Math.abs(r.x+r.w-o.x)<Sv){let e=Ev(r.y,r.y+r.h,o.y,o.y+o.h);e>Sv&&l.push({info:i,overlap:e,order:n})}if(Math.abs(o.x+o.w-r.x)<Sv){let e=Ev(r.y,r.y+r.h,o.y,o.y+o.h);e>Sv&&u.push({info:i,overlap:e,order:n})}});let d=e=>e.sort((e,n)=>n.overlap-e.overlap||e.order-n.order).map(e=>e.info);return{above:d(s),below:d(c),left:d(l),right:d(u)}}function Ov(e,n,r){if(Cv(n,r))return!1;let i=av(e,n),a=av(e,r);if(i===null||a===null||!U(i)||!U(a))return!1;let o=ov(e,n),s=ov(e,r);if(o===null||s===null)return!1;let c=n[n.length-1],l=r[r.length-1];if(o===s){let e=o;return[e.children[c],e.children[l]]=[e.children[l],e.children[c]],[e.sizes[c],e.sizes[l]]=[e.sizes[l]??1,e.sizes[c]??1],!0}let u=o.children[c],d=o.sizes[c]??1;return o.children[c]=s.children[l],o.sizes[c]=s.sizes[l]??1,s.children[l]=u,s.sizes[l]=d,!0}function kv(e,n,r){let i=wv(e,n);if(i===null)return!1;let a=Dv(e,n);if(a===null)return!1;let o=r===`up`?a.above:r===`down`?a.below:r===`left`?a.left:a.right;return o.length!==0&&Ov(e,i,o[0].path)}function Av(e,n,r){let i=wv(e,n);if(i===null||i.length===0)return!1;let a=Tv(e).find(e=>Cv(e.path,i));if(!a)return!1;let o=r===`left`||r===`right`,s=Math.min(Math.max(o?a.rect.w:a.rect.h,.05),.95);if(!(s>0)||s>=1)return!1;let c=ov(e,i);if(c===null)return!1;let[l]=c.children.splice(i[i.length-1],1);if(c.sizes.splice(i[i.length-1],1),!l)return!1;nv(e);let u=r===`left`||r===`top`,d=o?`row`:`column`;if(U(e)){let n=e,r={kind:`stack`,panels:[...n.panels],active:n.active};return n.name!==void 0&&(r.name=n.name),n.collapsed!==void 0&&(r.collapsed=n.collapsed),n.preCollapseSize!==void 0&&(r.preCollapseSize=n.preCollapseSize),rv(e,{kind:`split`,direction:d,children:u?[l,r]:[r,l],sizes:u?[s,1-s]:[1-s,s]}),!0}if(Z_(e)&&e.direction===d){let n=s*(e.sizes.reduce((e,n)=>e+n,0)||e.children.length||1)/(1-s),r=u?0:e.children.length;return e.children.splice(r,0,l),e.sizes.splice(r,0,n),!0}if(Z_(e)){let n={kind:`split`,direction:e.direction,children:e.children,sizes:e.sizes};return rv(e,{kind:`split`,direction:d,children:u?[l,n]:[n,l],sizes:u?[s,1-s]:[1-s,s]}),!0}return!1}function jv(e){return{version:1,root:Mv(e)}}function Mv(e){if(U(e)){let n={kind:`stack`,panels:[...e.panels],active:e.active};return e.name!==void 0&&(n.name=e.name),e.hideLabels!==void 0&&(n.hideLabels=e.hideLabels),e.collapsed!==void 0&&(n.collapsed=e.collapsed),e.preCollapseSize!==void 0&&(n.preCollapseSize=e.preCollapseSize),n}return{kind:`split`,direction:e.direction,sizes:[...e.sizes],children:e.children.map(Mv)}}function Nv(e){try{let n=JSON.parse(e);if(typeof n!=`object`||!n)return null;let r=n.root;return typeof r!=`object`||!r||!(`kind`in r)?null:{version:1,root:nv(r)}}catch{return null}}function Pv(e){let n=null,r=null,i=null;function a(r,i,a,o,s,c,l,u){n={isDragging:!0,groupId:r,gutterIndex:i,startPointerX:o,startPointerY:s,containerRect:c,trackSizes:l,minConstraints:u.map(e=>e.minPx),maxConstraints:u.map(e=>e.maxPx),fixedConstraints:u.map(e=>e.fixedPx),whenSmallConstraints:u.map(e=>e.whenSmall)},e.onDragStart(n)}function o(e){!n||!n.isDragging||(i={deltaX:e.clientX-n.startPointerX,deltaY:e.clientY-n.startPointerY},r===null&&(r=requestAnimationFrame(s)))}function s(){if(!n||!i){r=null;return}let{deltaX:a,deltaY:o}=i;i=null,r=null,e.onDragMove(n,a,o)}function c(a){!n||!n.isDragging||(r!==null&&(cancelAnimationFrame(r),r=null),i=null,e.onDragEnd(n),n=null)}return{startGutterDrag:a,move:o,end:c,getState:()=>n}}let Fv=0,Iv=0;function Lv(){return`p-${++Fv}`}function Rv(){return`g-${++Iv}`}function zv(){Fv=0,Iv=0}function Bv(e){let n=e.getAttribute(`size`)??e.getAttribute(`weight`);if(n===null)return;let r=Number.parseFloat(n);return Number.isNaN(r)?void 0:r}function Vv(e){return zv(),Hv(e,null)}function Hv(e,n){let r=e.tagName===`IXFX-SPLIT-LAYOUT`,i=e.getAttribute(`direction`)===`column`?`column`:`row`,a={kind:`group`,id:e.id||Rv(),el:r?e:null,axis:i,children:[],weight:Bv(e)??1,fixedPx:null},o=e.getAttribute(`sizes`),s=o?o.split(/\s+/).map(e=>Number.parseFloat(e)).filter(e=>!Number.isNaN(e)):[],c=Array.from(e.children),l=0;for(let e of c){let n=l<s.length?s[l]:void 0;if(l++,e.tagName===`IXFX-SPLIT-LAYOUT`)a.children.push(Hv(e,i));else if(e.tagName===`IXFX-SPLIT-PANEL`)a.children.push(Gv(e,n));else{let r=Uv(e,n);a.children.push(r)}}if(a.children.length===0){let e=Wv();a.children.push(e)}return a}function Uv(e,n){let r=e.getAttribute(`min`),i=e.getAttribute(`max`),a=e.getAttribute(`when-small`),o=e.getAttribute(`fixed`),s=e.hasAttribute(`collapsed`),c=0;r&&(c=Kv(r,0));let l=null;i&&(l=Kv(i,0));let u=null;o&&(u=o===``?100:Kv(o,100));let d=Bv(e)??n??1;return{kind:`panel`,id:e.id||Lv(),el:e,weight:d,fixedPx:u,minPx:c,maxPx:l,whenSmall:a||`prevent`,collapsed:s,restoreWeight:d}}function Wv(e){return{kind:`panel`,id:Lv(),el:document.createElement(`div`),weight:e??1,fixedPx:null,minPx:0,maxPx:null,whenSmall:`prevent`,collapsed:!1,restoreWeight:e??1}}function Gv(e,n){let r=e.getAttribute(`size`)||e.getAttribute(`weight`),i=e.getAttribute(`min`),a=e.getAttribute(`max`),o=e.getAttribute(`when-small`),s=e.getAttribute(`fixed`),c=e.hasAttribute(`collapsed`),l=n??1;r&&(l=Number.parseFloat(r));let u=0;i&&(u=Kv(i,0));let d=null;a&&(d=Kv(a,0));let f=null;return s&&(f=s===``?100:Kv(s,100)),{kind:`panel`,id:e.id||Lv(),el:e,weight:l,fixedPx:f,minPx:u,maxPx:d,whenSmall:o||`prevent`,collapsed:c,restoreWeight:l}}function Kv(e,n){if(e.endsWith(`px`))return Number.parseFloat(e.replace(`px`,``));if(e.endsWith(`%`))return n;let r=Number.parseFloat(e);return Number.isNaN(r)?n:r}function qv(e){let n=[],r=0;for(let i of e.children)i.kind===`panel`&&(i.fixedPx!==null||i.collapsed)||(n.push(i.weight),r+=i.weight);r===0&&(r=1);let i=[];for(let n=0;n<e.children.length;n++){let a=e.children[n];a.kind===`panel`?a.fixedPx===null&&!a.collapsed?i.push({...a,weight:a.weight/r}):i.push(a):i.push({...a,weight:a.weight/r})}return{...e,children:i}}function Jv(e,n,r,i){let a=[...e],o=[];if(r===0)return{sizesPx:a,belowMin:o};let s=r>0?n:n+1,c=r>0?n+1:n,l=Math.abs(r);for(let e=c;e>=0&&l>0;e--){let n=i[e];if(n.fixedPx!==null)continue;let r=a[e],s=r-n.minPx;if(s>0){let r=Math.min(s,l);if(a[e]-=r,l-=r,n.whenSmall!==`prevent`&&a[e]<=n.minPx&&a[e]>0){o.push(e);break}}else if(n.whenSmall!==`prevent`&&r>0){let i=Math.min(r,l);if(a[e]-=i,l-=i,a[e]<=n.minPx){o.push(e);break}}}let u=Math.abs(r)-l;if(u>0&&(a[s]+=u,l=0),l>0)for(let e=s;e<a.length&&l>0;e++){let n=i[e];if(n.fixedPx!==null)continue;let r=n.maxPx===null?1/0:n.maxPx-a[e];if(r<=0)continue;let o=Math.min(r,l);a[e]+=o,l-=o}return{sizesPx:a,belowMin:o}}function Yv(e,n){let r=[];for(let n=0;n<e.children.length;n++){let i=e.children[n],a;a=i.kind===`panel`?i.collapsed?`var(--split-collapsed-size, 0px)`:i.fixedPx===null?`minmax(${i.minPx>0?`${i.minPx}px`:`0px`}, var(--s${n}))`:`${i.fixedPx}px`:`minmax(0, var(--s${n}))`,r.push(a),n<e.children.length-1&&r.push(`var(--split-gutter-size, 6px)`)}return r.join(` `)}function Xv(e){return{version:1,root:Zv(e)}}function Zv(e){if(e.kind===`panel`)return{kind:`panel`,id:e.id,weight:e.weight,collapsed:e.collapsed};let n=e.children.map(e=>Zv(e));return{kind:`group`,id:e.id,weight:e.weight,children:n}}function Qv(e,n){return $v(e,n.root)}function $v(e,n){if(n.kind!==`group`)return e;let r=new Map,i=new Map;ey(n,r,i);let a=[];for(let o of e.children)if(o.kind===`panel`){let e=r.get(o.id),n=i.get(o.id);a.push({...o,weight:e===void 0?o.weight:e,collapsed:n===void 0?o.collapsed:n})}else{let e=n.children?.find(e=>e.id===o.id);e?a.push($v(o,e)):a.push(o)}return{...e,children:a}}function ey(e,n,r){if(e.kind===`panel`)n.set(e.id,e.weight??1),e.collapsed!==void 0&&r.set(e.id,e.collapsed);else if(e.children)for(let i of e.children)ey(i,n,r)}function ty(e,n,r){let i=e.children.map(e=>e.kind===`panel`?e.id===n?{...e,restoreWeight:r}:e:ty(e,n,r));return{...e,children:i}}function ny(e,n){if(!e)return n;let r=new Map(e.children.map(e=>[e.id,e])),i=n.children.map(e=>{let n=r.get(e.id);return!n||n.kind!==e.kind?e:e.kind===`panel`&&n.kind===`panel`?{...e,restoreWeight:n.restoreWeight}:ny(n,e)});return{...n,children:i}}function ry(e,n){for(let r of e.children)if(r.kind===`panel`){if(r.id===n)return r}else{let e=ry(r,n);if(e)return e}}function iy(e,n){ay(e,[],n)}function ay(e,n,r){if(r(e,n),e.kind===`group`)for(let i=0;i<e.children.length;i++)ay(e.children[i],[...n,i],r)}let oy=class extends n{constructor(...e){super(...e),this.id=``,this.size=``,this.weight=``,this.fixed=``,this.min=``,this.max=``,this.whenSmall=`prevent`,this.collapsed=!1,this.snap=``}render(){return i`<slot></slot>`}static{this.styles=[w,r`
|
|
5789
|
+
`}};E([d({type:String,attribute:`selection-mode`})],V.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],V.prototype,`interactionMode`,void 0),E([d({type:String})],V.prototype,`sort`,void 0),E([d({type:String,attribute:`sort-by`})],V.prototype,`sortBy`,void 0),E([d({attribute:!1})],V.prototype,`sortComparator`,void 0),E([d({attribute:!1})],V.prototype,`items`,void 0),E([d({attribute:!1})],V.prototype,`provider`,void 0),E([d({type:String,attribute:`display-property`})],V.prototype,`displayProperty`,void 0),E([d({attribute:!1})],V.prototype,`formatter`,void 0),E([d({type:String,attribute:`icon-property`})],V.prototype,`iconProperty`,void 0),E([d({type:String,attribute:`icon-color-property`})],V.prototype,`iconColorProperty`,void 0),E([d({type:String,attribute:`text-color-property`})],V.prototype,`textColorProperty`,void 0),E([d({type:String,attribute:`badge-property`})],V.prototype,`badgeProperty`,void 0),E([d({type:String,attribute:`key-property`})],V.prototype,`keyProperty`,void 0),E([d({attribute:!1})],V.prototype,`filterPredicate`,void 0),E([d({type:String,attribute:`item-wrap`})],V.prototype,`itemWrap`,void 0),E([d({attribute:!1})],V.prototype,`checkboxRenderer`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],V.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],V.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],V.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],V.prototype,`dragPreviewSource`,void 0),E([d({attribute:`group-by`})],V.prototype,`groupBy`,void 0),E([d({attribute:!1})],V.prototype,`groupLabel`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],V.prototype,`crossGroupSelection`,void 0),E([m()],V.prototype,`_collapsedGroups`,void 0),E([f(`ul`)],V.prototype,`_listEl`,void 0),V=E([T(`ixfx-detail-list`)],V);let F_=null;const I_=new Set;function L_(e){I_.add(e)}function R_(e){I_.delete(e),F_!==null&&F_.sourceHost}function z_(e,n,r,i,a,o){F_={panelId:e,kind:o,sourceHost:n,pointerId:r,ghost:B_(n,e),outside:!1};for(let r of I_)r.setDragActive(!0,G_(n,r)?{panelId:e,kind:o}:void 0);F_.ghost?.move(i,a),window.addEventListener(`pointermove`,V_),window.addEventListener(`pointerup`,H_),window.addEventListener(`pointercancel`,U_),window.addEventListener(`keydown`,W_)}function B_(e,n){let r=Array.from(e.children).find(e=>e instanceof HTMLElement&&e.panelId===n);if(!r)return null;let i=document.createElement(`span`);if(i.style.display=`inline-flex`,i.style.alignItems=`center`,i.style.gap=`var(--space-xs, 4px)`,i.style.minWidth=`0`,r.iconName){let e=document.createElement(`ixfx-icon`);e.name=r.iconName,i.appendChild(e)}let a=document.createElement(`span`);a.textContent=r.title||n,a.style.overflow=`hidden`,a.style.textOverflow=`ellipsis`,a.style.whiteSpace=`nowrap`,i.appendChild(a);try{return Gg({anchor:r,content:i})}catch{return null}}function V_(e){let n=F_;if(n===null||e.pointerId!==n.pointerId)return;n.ghost?.move(e.clientX,e.clientY);let r=K_(n,e.clientX,e.clientY);for(let e of I_)e.setDropZone(r!==null&&r.host===e?r:null);let i=!q_(e.clientX,e.clientY);i!==n.outside&&(n.outside=i,J_(n,i?`dock-panel-drag-out`:`dock-panel-drag-in`,e))}function H_(e){let n=F_;if(n===null||e.pointerId!==n.pointerId)return;let r=K_(n,e.clientX,e.clientY);r===null?q_(e.clientX,e.clientY)||Y_(n,e):r.host.handleDrop(n.panelId,r,n.sourceHost),X_()}function U_(e){let n=F_;n!==null&&e.pointerId===n.pointerId&&X_()}function W_(e){F_!==null&&e.key===`Escape`&&X_()}function G_(e,n){return e===n||!e.isolated&&e.family===n.family}function K_(e,n,r){for(let i of I_){if(!G_(e.sourceHost,i))continue;let a=i.computeDropZone(n,r,e.panelId,e.kind);if(a!==null)return a}return null}function q_(e,n){for(let r of I_){let i=r.getBoundingClientRect();if(e>=i.left&&e<=i.right&&n>=i.top&&n<=i.bottom)return!0}return!1}function J_(e,n,r){e.sourceHost.dispatchEvent(new CustomEvent(n,{detail:{panelId:e.panelId,clientX:r.clientX,clientY:r.clientY,screenX:r.screenX,screenY:r.screenY},bubbles:!0,composed:!0}))}function Y_(e,n){let r=e.sourceHost.getPanelSnapshot(e.panelId);r!==null&&e.sourceHost.dispatchEvent(new CustomEvent(`dock-panel-tear-out`,{detail:{panelId:e.panelId,snapshot:r,clientX:n.clientX,clientY:n.clientY,screenX:n.screenX,screenY:n.screenY},bubbles:!0,composed:!0}))}function X_(){let e=F_;if(e!==null){for(let e of I_)e.setDropZone(null),e.setDragActive(!1);e.ghost?.destroy(),F_=null,window.removeEventListener(`pointermove`,V_),window.removeEventListener(`pointerup`,H_),window.removeEventListener(`pointercancel`,U_),window.removeEventListener(`keydown`,W_)}}function Z_(){return F_!==null}function Q_(){return F_?.panelId??null}function $_(e){return e.kind===`split`}function H(e){return e.kind===`stack`}function ev(){return{kind:`stack`,panels:[],active:``}}function tv(){return{version:1,root:ev()}}function nv(e,n,r){let i={kind:`stack`,panels:[...e],active:n??e[0]??``},a=r?.trim();return a&&(i.name=a),i}function rv(e,n,r){let i=n.length>0?1/n.length:1;return{kind:`split`,direction:e,children:[...n],sizes:r?[...r]:n.map(()=>i)}}function iv(e){if(H(e))return ov(e),e.panels.includes(e.active)||(e.active=e.panels[0]??``),e;for(let n=e.children.length-1;n>=0;n--){iv(e.children[n]);let r=e.children[n];if(H(r)&&r.panels.length===0&&!r.name){e.children.splice(n,1),e.sizes.splice(n,1);continue}$_(r)&&r.children.length===1&&(e.children.splice(n,1,r.children[0]),e.sizes.splice(n,1,r.sizes[0]??e.sizes[n]??1))}for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];$_(r)&&r.direction===e.direction&&(e.children.splice(n,1,...r.children),e.sizes.splice(n,1,...r.sizes))}if(e.children.length===0)return av(e,ev());if(e.children.length===1)return e.children[0];for(;e.sizes.length<e.children.length;)e.sizes.push(1/e.children.length);return e.sizes.length>e.children.length&&(e.sizes.length=e.children.length),e}function av(e,n){if(H(n)){e.kind=`stack`;let r=e;r.panels=n.panels,r.active=n.active,n.name===void 0?delete r.name:r.name=n.name,n.hideLabels===void 0?delete r.hideLabels:r.hideLabels=n.hideLabels,n.hideSingleTabStrip===void 0?delete r.hideSingleTabStrip:r.hideSingleTabStrip=n.hideSingleTabStrip,delete r.collapsed,delete r.preCollapseSize,n.collapsed!==void 0&&(r.collapsed=n.collapsed),n.preCollapseSize!==void 0&&(r.preCollapseSize=n.preCollapseSize)}else{e.kind=`split`;let r=e;r.direction=n.direction,r.children=n.children,r.sizes=n.sizes;let i=r;delete i.panels,delete i.active,delete i.name,delete i.hideLabels,delete i.hideSingleTabStrip,delete i.collapsed,delete i.preCollapseSize}return e}function ov(e){if(e.name===void 0)return;let n=typeof e.name==`string`?e.name.trim():``;n?e.name=n:delete e.name}function U(e,n){let r=e;for(let e of n){if(!$_(r))return null;let n=r.children[e];if(!n)return null;r=n}return r}function sv(e,n){if(n.length===0)return null;let r=U(e,n.slice(0,-1));return r!==null&&$_(r)?r:null}function cv(e,n){return lv(e,n,[])}function lv(e,n,r){if(H(e))return e.panels.includes(n)?r:null;for(let i=0;i<e.children.length;i++){let a=lv(e.children[i],n,[...r,i]);if(a!==null)return a}return null}function uv(e){return H(e)?[...e.panels]:e.children.flatMap(uv)}function dv(e,n){let r=n.trim();return r?fv(e,r,[]):null}function fv(e,n,r){if(H(e))return e.name===n?r:null;for(let i=0;i<e.children.length;i++){let a=fv(e.children[i],n,[...r,i]);if(a!==null)return a}return null}function pv(e){let n=[],r=e=>{if(H(e)){e.name&&n.push(e.name);return}e.children.forEach(r)};return r(e),n}function mv(e){let n=[];return hv(e,[],n),n}function hv(e,n,r){if(H(e)){r.push(n);return}e.children.forEach((e,i)=>hv(e,[...n,i],r))}function gv(e,n,r){let i=r===void 0?e.panels.length:Math.max(0,Math.min(r,e.panels.length));e.panels.splice(i,0,n),e.active=n}function _v(e,n){let r=e.panels.indexOf(n);r<0||(e.panels.splice(r,1),e.active===n&&(e.active=e.panels[Math.min(r,e.panels.length-1)]??``))}function vv(e,n){return!e.panels.includes(n)||e.active===n?!1:(e.active=n,!0)}function yv(e,n,r,i,a){let o=U(e,n);if(o===null)return null;if(n.length===0){if($_(e)&&e.direction===r){let n=a===`before`?0:e.children.length,r=a===`before`?0:e.children.length-1,o=e.sizes[r];return e.children.splice(n,0,i),e.sizes.splice(n,0,o===void 0?1:o/2),o!==void 0&&(e.sizes[a===`before`?r+1:r]=o/2),[n]}return bv(e,r,i,a),[a===`before`?0:1]}let s=sv(e,n);if(s===null)return null;let c=n[n.length-1];if(s.direction===r){let r=a===`before`?c:c+1,o=s.sizes[c]===void 0?1:s.sizes[c]/2;s.sizes[c]=o,s.children.splice(r,0,i),s.sizes.splice(r,0,o);let l=[...n.slice(0,-1),r];return iv(e),l}let l=rv(r,a===`before`?[i,o]:[o,i]);s.children[c]=l,iv(e);let u=a===`before`?0:1;return[...n.slice(0,-1),c,u]}function bv(e,n,r,i){let a=xv(e);return av(e,rv(n,i===`before`?[r,a]:[a,r])),iv(e),!0}function xv(e){return H(e)?{...e,panels:[...e.panels]}:{...e,children:[...e.children],sizes:[...e.sizes]}}function Sv(e,n,r){let i=U(e,n);if(i===null||!H(i))return null;let a=n.length===0;if(r&&r!==i){for(let e of i.panels)gv(r,e);a||(i.panels=[],i.active=``)}if(a)return av(e,ev()),i;let o=sv(e,n);if(o===null)return null;let s=n[n.length-1];return o.children.splice(s,1),o.sizes.splice(s,1),iv(e),i}const Cv=1e-9;function wv(e,n){return e.length===n.length&&e.every((e,r)=>e===n[r])}function Tv(e,n){if(typeof n==`string`)return dv(e,n);if(!Array.isArray(n))return null;let r=e;for(let e of n){if(!Number.isInteger(e)||e<0||!$_(r))return null;let n=r.children[e];if(!n)return null;r=n}return H(r)?[...n]:null}function Ev(e){let n=[],r=(e,i,a)=>{if(H(e)){n.push({path:i,name:e.name??null,rect:a});return}let o=e.sizes.reduce((e,n)=>e+n,0),s=o>0?o:e.children.length||1,c=0;e.children.forEach((n,o)=>{let l=(e.sizes[o]??s/e.children.length)/s;if(e.direction===`row`){let e=a.w*l;r(n,[...i,o],{x:a.x+c,y:a.y,w:e,h:a.h}),c+=e}else{let e=a.h*l;r(n,[...i,o],{x:a.x,y:a.y+c,w:a.w,h:e}),c+=e}})};return r(e,[],{x:0,y:0,w:1,h:1}),n}function Dv(e,n,r,i){return Math.min(n,i)-Math.max(e,r)}function Ov(e,n){let r=Tv(e,n);if(r===null)return null;let i=Ev(e),a=i.find(e=>wv(e.path,r));if(!a)return null;let o=a.rect,s=[],c=[],l=[],u=[];i.forEach((e,n)=>{if(e===a)return;let r=e.rect,i={name:e.name,path:[...e.path]};if(Math.abs(r.y+r.h-o.y)<Cv){let e=Dv(r.x,r.x+r.w,o.x,o.x+o.w);e>Cv&&s.push({info:i,overlap:e,order:n})}if(Math.abs(o.y+o.h-r.y)<Cv){let e=Dv(r.x,r.x+r.w,o.x,o.x+o.w);e>Cv&&c.push({info:i,overlap:e,order:n})}if(Math.abs(r.x+r.w-o.x)<Cv){let e=Dv(r.y,r.y+r.h,o.y,o.y+o.h);e>Cv&&l.push({info:i,overlap:e,order:n})}if(Math.abs(o.x+o.w-r.x)<Cv){let e=Dv(r.y,r.y+r.h,o.y,o.y+o.h);e>Cv&&u.push({info:i,overlap:e,order:n})}});let d=e=>e.sort((e,n)=>n.overlap-e.overlap||e.order-n.order).map(e=>e.info);return{above:d(s),below:d(c),left:d(l),right:d(u)}}function kv(e,n,r){if(wv(n,r))return!1;let i=U(e,n),a=U(e,r);if(i===null||a===null||!H(i)||!H(a))return!1;let o=sv(e,n),s=sv(e,r);if(o===null||s===null)return!1;let c=n[n.length-1],l=r[r.length-1];if(o===s){let e=o;return[e.children[c],e.children[l]]=[e.children[l],e.children[c]],[e.sizes[c],e.sizes[l]]=[e.sizes[l]??1,e.sizes[c]??1],!0}let u=o.children[c],d=o.sizes[c]??1;return o.children[c]=s.children[l],o.sizes[c]=s.sizes[l]??1,s.children[l]=u,s.sizes[l]=d,!0}function Av(e,n,r){let i=Tv(e,n);if(i===null)return!1;let a=Ov(e,n);if(a===null)return!1;let o=r===`up`?a.above:r===`down`?a.below:r===`left`?a.left:a.right;return o.length!==0&&kv(e,i,o[0].path)}function jv(e,n,r){let i=Tv(e,n);if(i===null||i.length===0)return!1;let a=Ev(e).find(e=>wv(e.path,i));if(!a)return!1;let o=r===`left`||r===`right`,s=Math.min(Math.max(o?a.rect.w:a.rect.h,.05),.95);if(!(s>0)||s>=1)return!1;let c=sv(e,i);if(c===null)return!1;let[l]=c.children.splice(i[i.length-1],1);if(c.sizes.splice(i[i.length-1],1),!l)return!1;iv(e);let u=r===`left`||r===`top`,d=o?`row`:`column`;if(H(e)){let n=e,r={kind:`stack`,panels:[...n.panels],active:n.active};return n.name!==void 0&&(r.name=n.name),n.hideLabels!==void 0&&(r.hideLabels=n.hideLabels),n.hideSingleTabStrip!==void 0&&(r.hideSingleTabStrip=n.hideSingleTabStrip),n.collapsed!==void 0&&(r.collapsed=n.collapsed),n.preCollapseSize!==void 0&&(r.preCollapseSize=n.preCollapseSize),av(e,{kind:`split`,direction:d,children:u?[l,r]:[r,l],sizes:u?[s,1-s]:[1-s,s]}),!0}if($_(e)&&e.direction===d){let n=s*(e.sizes.reduce((e,n)=>e+n,0)||e.children.length||1)/(1-s),r=u?0:e.children.length;return e.children.splice(r,0,l),e.sizes.splice(r,0,n),!0}if($_(e)){let n={kind:`split`,direction:e.direction,children:e.children,sizes:e.sizes};return av(e,{kind:`split`,direction:d,children:u?[l,n]:[n,l],sizes:u?[s,1-s]:[1-s,s]}),!0}return!1}function Mv(e){return{version:1,root:Nv(e)}}function Nv(e){if(H(e)){let n={kind:`stack`,panels:[...e.panels],active:e.active};return e.name!==void 0&&(n.name=e.name),e.hideLabels!==void 0&&(n.hideLabels=e.hideLabels),e.hideSingleTabStrip!==void 0&&(n.hideSingleTabStrip=e.hideSingleTabStrip),e.collapsed!==void 0&&(n.collapsed=e.collapsed),e.preCollapseSize!==void 0&&(n.preCollapseSize=e.preCollapseSize),n}return{kind:`split`,direction:e.direction,sizes:[...e.sizes],children:e.children.map(Nv)}}function Pv(e){try{let n=JSON.parse(e);if(typeof n!=`object`||!n)return null;let r=n.root;return typeof r!=`object`||!r||!(`kind`in r)?null:{version:1,root:iv(r)}}catch{return null}}function Fv(e){let n=new Map,r=e=>{if(H(e)){e.panels.length>0&&n.set(e,{name:e.name,key:e.panels.join(`
|
|
5790
|
+
`)});return}e.children.forEach(r)};return r(e),n}function Iv(e,n){let r=new Set([...n.values()].map(e=>e.key)),i=[];for(let[a,o]of e)n.has(a)||r.has(o.key)||i.push(o);return i}function Lv(e){let n=null,r=null,i=null;function a(r,i,a,o,s,c,l,u){n={isDragging:!0,groupId:r,gutterIndex:i,startPointerX:o,startPointerY:s,containerRect:c,trackSizes:l,minConstraints:u.map(e=>e.minPx),maxConstraints:u.map(e=>e.maxPx),fixedConstraints:u.map(e=>e.fixedPx),whenSmallConstraints:u.map(e=>e.whenSmall)},e.onDragStart(n)}function o(e){!n||!n.isDragging||(i={deltaX:e.clientX-n.startPointerX,deltaY:e.clientY-n.startPointerY},r===null&&(r=requestAnimationFrame(s)))}function s(){if(!n||!i){r=null;return}let{deltaX:a,deltaY:o}=i;i=null,r=null,e.onDragMove(n,a,o)}function c(a){!n||!n.isDragging||(r!==null&&(cancelAnimationFrame(r),r=null),i=null,e.onDragEnd(n),n=null)}return{startGutterDrag:a,move:o,end:c,getState:()=>n}}let Rv=0,zv=0;function Bv(){return`p-${++Rv}`}function Vv(){return`g-${++zv}`}function Hv(){Rv=0,zv=0}function Uv(e){let n=e.getAttribute(`size`)??e.getAttribute(`weight`);if(n===null)return;let r=Number.parseFloat(n);return Number.isNaN(r)?void 0:r}function Wv(e){return Hv(),Gv(e,null)}function Gv(e,n){let r=e.tagName===`IXFX-SPLIT-LAYOUT`,i=e.getAttribute(`direction`)===`column`?`column`:`row`,a={kind:`group`,id:e.id||Vv(),el:r?e:null,axis:i,children:[],weight:Uv(e)??1,fixedPx:null},o=e.getAttribute(`sizes`),s=o?o.split(/\s+/).map(e=>Number.parseFloat(e)).filter(e=>!Number.isNaN(e)):[],c=Array.from(e.children),l=0;for(let e of c){let n=l<s.length?s[l]:void 0;if(l++,e.tagName===`IXFX-SPLIT-LAYOUT`)a.children.push(Gv(e,i));else if(e.tagName===`IXFX-SPLIT-PANEL`)a.children.push(Jv(e,n));else{let r=Kv(e,n);a.children.push(r)}}if(a.children.length===0){let e=qv();a.children.push(e)}return a}function Kv(e,n){let r=e.getAttribute(`min`),i=e.getAttribute(`max`),a=e.getAttribute(`when-small`),o=e.getAttribute(`fixed`),s=e.hasAttribute(`collapsed`),c=0;r&&(c=Yv(r,0));let l=null;i&&(l=Yv(i,0));let u=null;o&&(u=o===``?100:Yv(o,100));let d=Uv(e)??n??1;return{kind:`panel`,id:e.id||Bv(),el:e,weight:d,fixedPx:u,minPx:c,maxPx:l,whenSmall:a||`prevent`,collapsed:s,restoreWeight:d}}function qv(e){return{kind:`panel`,id:Bv(),el:document.createElement(`div`),weight:e??1,fixedPx:null,minPx:0,maxPx:null,whenSmall:`prevent`,collapsed:!1,restoreWeight:e??1}}function Jv(e,n){let r=e.getAttribute(`size`)||e.getAttribute(`weight`),i=e.getAttribute(`min`),a=e.getAttribute(`max`),o=e.getAttribute(`when-small`),s=e.getAttribute(`fixed`),c=e.hasAttribute(`collapsed`),l=n??1;r&&(l=Number.parseFloat(r));let u=0;i&&(u=Yv(i,0));let d=null;a&&(d=Yv(a,0));let f=null;return s&&(f=s===``?100:Yv(s,100)),{kind:`panel`,id:e.id||Bv(),el:e,weight:l,fixedPx:f,minPx:u,maxPx:d,whenSmall:o||`prevent`,collapsed:c,restoreWeight:l}}function Yv(e,n){if(e.endsWith(`px`))return Number.parseFloat(e.replace(`px`,``));if(e.endsWith(`%`))return n;let r=Number.parseFloat(e);return Number.isNaN(r)?n:r}function Xv(e){let n=[],r=0;for(let i of e.children)i.kind===`panel`&&(i.fixedPx!==null||i.collapsed)||(n.push(i.weight),r+=i.weight);r===0&&(r=1);let i=[];for(let n=0;n<e.children.length;n++){let a=e.children[n];a.kind===`panel`?a.fixedPx===null&&!a.collapsed?i.push({...a,weight:a.weight/r}):i.push(a):i.push({...a,weight:a.weight/r})}return{...e,children:i}}function Zv(e,n,r,i){let a=[...e],o=[];if(r===0)return{sizesPx:a,belowMin:o};let s=r>0?n:n+1,c=r>0?n+1:n,l=Math.abs(r);for(let e=c;e>=0&&l>0;e--){let n=i[e];if(n.fixedPx!==null)continue;let r=a[e],s=r-n.minPx;if(s>0){let r=Math.min(s,l);if(a[e]-=r,l-=r,n.whenSmall!==`prevent`&&a[e]<=n.minPx&&a[e]>0){o.push(e);break}}else if(n.whenSmall!==`prevent`&&r>0){let i=Math.min(r,l);if(a[e]-=i,l-=i,a[e]<=n.minPx){o.push(e);break}}}let u=Math.abs(r)-l;if(u>0&&(a[s]+=u,l=0),l>0)for(let e=s;e<a.length&&l>0;e++){let n=i[e];if(n.fixedPx!==null)continue;let r=n.maxPx===null?1/0:n.maxPx-a[e];if(r<=0)continue;let o=Math.min(r,l);a[e]+=o,l-=o}return{sizesPx:a,belowMin:o}}function Qv(e,n){let r=[];for(let n=0;n<e.children.length;n++){let i=e.children[n],a;a=i.kind===`panel`?i.collapsed?`var(--split-collapsed-size, 0px)`:i.fixedPx===null?`minmax(${i.minPx>0?`${i.minPx}px`:`0px`}, var(--s${n}))`:`${i.fixedPx}px`:`minmax(0, var(--s${n}))`,r.push(a),n<e.children.length-1&&r.push(`var(--split-gutter-size, 6px)`)}return r.join(` `)}function $v(e){return{version:1,root:ey(e)}}function ey(e){if(e.kind===`panel`)return{kind:`panel`,id:e.id,weight:e.weight,collapsed:e.collapsed};let n=e.children.map(e=>ey(e));return{kind:`group`,id:e.id,weight:e.weight,children:n}}function ty(e,n){return ny(e,n.root)}function ny(e,n){if(n.kind!==`group`)return e;let r=new Map,i=new Map;ry(n,r,i);let a=[];for(let o of e.children)if(o.kind===`panel`){let e=r.get(o.id),n=i.get(o.id);a.push({...o,weight:e===void 0?o.weight:e,collapsed:n===void 0?o.collapsed:n})}else{let e=n.children?.find(e=>e.id===o.id);e?a.push(ny(o,e)):a.push(o)}return{...e,children:a}}function ry(e,n,r){if(e.kind===`panel`)n.set(e.id,e.weight??1),e.collapsed!==void 0&&r.set(e.id,e.collapsed);else if(e.children)for(let i of e.children)ry(i,n,r)}function iy(e,n,r){let i=e.children.map(e=>e.kind===`panel`?e.id===n?{...e,restoreWeight:r}:e:iy(e,n,r));return{...e,children:i}}function ay(e,n){if(!e)return n;let r=new Map(e.children.map(e=>[e.id,e])),i=n.children.map(e=>{let n=r.get(e.id);return!n||n.kind!==e.kind?e:e.kind===`panel`&&n.kind===`panel`?{...e,restoreWeight:n.restoreWeight}:ay(n,e)});return{...n,children:i}}function oy(e,n){for(let r of e.children)if(r.kind===`panel`){if(r.id===n)return r}else{let e=oy(r,n);if(e)return e}}function sy(e,n){cy(e,[],n)}function cy(e,n,r){if(r(e,n),e.kind===`group`)for(let i=0;i<e.children.length;i++)cy(e.children[i],[...n,i],r)}let ly=class extends n{constructor(...e){super(...e),this.id=``,this.size=``,this.weight=``,this.fixed=``,this.min=``,this.max=``,this.whenSmall=`prevent`,this.collapsed=!1,this.snap=``}render(){return i`<slot></slot>`}static{this.styles=[w,r`
|
|
5790
5791
|
:host {
|
|
5791
5792
|
display: block;
|
|
5792
5793
|
width: 100%;
|
|
@@ -5797,7 +5798,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5797
5798
|
:host([collapsed]) {
|
|
5798
5799
|
visibility: hidden;
|
|
5799
5800
|
}
|
|
5800
|
-
`]}};E([d({type:String,reflect:!0})],
|
|
5801
|
+
`]}};E([d({type:String,reflect:!0})],ly.prototype,`id`,void 0),E([d({type:String})],ly.prototype,`size`,void 0),E([d({type:String})],ly.prototype,`weight`,void 0),E([d({type:String})],ly.prototype,`fixed`,void 0),E([d({type:String})],ly.prototype,`min`,void 0),E([d({type:String})],ly.prototype,`max`,void 0),E([d({type:String,attribute:`when-small`})],ly.prototype,`whenSmall`,void 0),E([d({type:Boolean,reflect:!0})],ly.prototype,`collapsed`,void 0),E([d({type:String})],ly.prototype,`snap`,void 0),ly=E([T(`ixfx-split-panel`)],ly);let uy=class extends n{constructor(...e){super(...e),this.direction=`row`,this.sizes=``,this.gutterSize=``,this.snap=``,this._model=null,this._resizing=!1,this._observer=null,this._applyingOwnMutation=!1,this._dragStructurallyChanged=!1,this._dragMachine=Lv({onDragStart:e=>this._handleDragStart(e),onDragMove:(e,n,r)=>this._handleDragMove(e,n,r),onDragEnd:e=>this._handleDragEnd(e),distribute:(e,n,r,i)=>Zv(e,n,r,i)}),this._onGutterPointerDown=(e,n,r)=>{if(e.preventDefault(),!this._groupEl||!this._model)return;let{rect:i,trackSizes:a,constraints:o}=this._snapshotTracks();this._dragMachine.startGutterDrag(n,r,e.pointerId,e.clientX,e.clientY,i,a,o),window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp)},this._onPointerMove=e=>{this._dragMachine.move(e)},this._onPointerUp=e=>{this._dragMachine.end(e),window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp)}}connectedCallback(){super.connectedCallback(),this._setupObserver()}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}firstUpdated(){this._rebuildModel()}_setupObserver(){this._observer=new MutationObserver(()=>{this._applyingOwnMutation||Promise.resolve().then(()=>this._rebuildModel())}),this._observer.observe(this,{childList:!0,subtree:!0,attributeFilter:[`size`,`weight`,`min`,`max`,`when-small`,`fixed`,`direction`,`collapsed`,`sizes`]})}_rebuildModel(){this._reindexSlots();let e=Xv(Wv(this));this._model=ay(this._model,e),this.requestUpdate()}get panels(){if(!this._model)return[];let e=[];return sy(this._model,(n,r)=>{n.kind===`panel`&&e.push({id:n.id,el:n.el,index:r[r.length-1],path:r.join(`-`),weight:n.weight,collapsed:n.collapsed,min:n.minPx,max:n.maxPx,whenSmall:n.whenSmall})}),e}getLayout(){return this._model?$v(this._model):null}setLayout(e){this._model&&(this._applyingOwnMutation=!0,this._model=ty(this._model,e),this.requestUpdate(),this._applyingOwnMutation=!1,this._emitChange())}getSizes(e){if(!this._model)return{};let n={};return this._model.children&&this._model.children.forEach(e=>{n[e.id]=e.weight}),n}setSizes(e,n){if(this._model){if(this._applyingOwnMutation=!0,Array.isArray(e))this._model.children.forEach((n,r)=>{r<e.length&&(n.weight=e[r])});else for(let[n,r]of Object.entries(e)){let e=this._model.children.find(e=>e.id===n);e&&(e.weight=r)}this._model=Xv(this._model),this.requestUpdate(),this._applyingOwnMutation=!1,this._emitResize(),this._emitChange()}}collapse(e){this._setCollapsedState(e,!0)}expand(e){this._setCollapsedState(e,!1)}toggle(e){let n=this._findPanel(e);n&&this._setCollapsedState(n.id,!n.collapsed)}closePanel(e){let n=this._findPanel(e);if(!n)return!1;let r=new CustomEvent(`ixfx-split-close`,{detail:{id:n.id,index:n.index},bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(r),!r.defaultPrevented&&(this._applyingOwnMutation=!0,n.el.remove(),this._rebuildModel(),this._observer?.takeRecords(),this._applyingOwnMutation=!1,this._emitResize(),this._emitChange(),!0)}getGutterRects(){let e=this.shadowRoot?.querySelectorAll(`.gutter`);return e==null?[]:Array.from(e,e=>e.getBoundingClientRect())}beginGutterDrag(e,n,r,i){if(!this._groupEl||!this._model||e<0||e>=this._model.children.length-1)return!1;let{rect:a,trackSizes:o,constraints:s}=this._snapshotTracks();return this._dragMachine.startGutterDrag(this._model.id,e,n,r,i,a,o,s),window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),!0}_setCollapsedState(e,n,r){let i=this._findPanel(e);if(!(!i||i.collapsed===n)){if(this._applyingOwnMutation=!0,n?(this._model&&=iy(this._model,i.id,i.weight),i.el.setAttribute(`collapsed`,``),i.el.setAttribute(`data-collapsed`,``)):(i.el.removeAttribute(`collapsed`),i.el.removeAttribute(`data-collapsed`)),this._rebuildModel(),!n){let e=r??(this._model?oy(this._model,i.id)?.restoreWeight:void 0);e!==void 0&&this._setFlexibleWeight(i.id,e)}this.requestUpdate(),this._observer?.takeRecords(),this._applyingOwnMutation=!1,n?this.dispatchEvent(new CustomEvent(`ixfx-split-collapse`,{detail:{id:i.id,index:i.index},bubbles:!0,composed:!0})):this.dispatchEvent(new CustomEvent(`ixfx-split-expand`,{detail:{id:i.id,index:i.index},bubbles:!0,composed:!0})),this._emitResize(),this._emitChange()}}_reindexSlots(){Array.from(this.children).forEach((e,n)=>{let r=`panel-${n}`;e.getAttribute(`slot`)!==r&&e.setAttribute(`slot`,r)})}_findPanel(e){let n=typeof e==`string`?e:e.id;return this.panels.find(e=>e.id===n)}_setFlexibleWeight(e,n){if(!this._model)return;let r=this._model.children.filter(e=>e.kind===`group`||e.fixedPx===null&&!e.collapsed),i=r.find(n=>n.id===e);if(!i)return;let a=Math.min(Math.max(n,0),.9),o=r.filter(e=>e!==i),s=o.reduce((e,n)=>e+n.weight,0)||1,c=(1-a)/s;for(let e of o)e.weight*=c;i.weight=a,this._model=Xv(this._model)}_snapPx(){let e=Number.parseFloat(this.snap);if(!Number.isNaN(e))return e;let n=Number.parseFloat(getComputedStyle(this).getPropertyValue(`--split-snap`));return Number.isNaN(n)?24:n}_collapsedPx(){let e=Number.parseFloat(getComputedStyle(this).getPropertyValue(`--split-collapsed-size`));return Number.isNaN(e)?0:e}_handleDragStart(e){this._resizing=!0,this._dragStructurallyChanged=!1,this.setAttribute(`data-dragging`,``)}_handleDragMove(e,n,r){if(!this._model||this._dragStructurallyChanged)return;let i=this.direction,a=i===`row`?n:r,o=e.gutterIndex,s=a>0?o:o+1,c=this._model.children[s];if(c?.kind===`panel`&&c.collapsed){let o=c.minPx>0?c.minPx:this._snapPx();if(Math.abs(a)>=o){let a=i===`row`?e.containerRect.width:e.containerRect.height;this._setCollapsedState(c.id,!1,a>0?o/a:void 0),this._reseedDragState(e,e.startPointerX+n,e.startPointerY+r)}return}let l=e.minConstraints.map((n,r)=>({minPx:n,maxPx:e.maxConstraints[r],fixedPx:e.fixedConstraints[r],whenSmall:e.whenSmallConstraints[r]})),u=Zv(e.trackSizes,o,a,l),d=e.trackSizes.reduce((e,n)=>e+n,0);if(u.sizesPx.forEach((e,n)=>{let r=this._model.children[n];r&&r.kind===`panel`&&(r.weight=e/d)}),u.belowMin.length>0){let e=!1;for(let n of u.belowMin){if(e)break;let r=this._model.children[n];if(r&&r.kind===`panel`){let n=r.whenSmall;n===`collapse`&&!r.collapsed?(this._setCollapsedState(r.id,!0),e=!0,this._dragStructurallyChanged=!0):n===`close`&&(this.closePanel(r.id),e=!0,this._dragStructurallyChanged=!0)}}}this._model=Xv(this._model),this.requestUpdate()}_handleDragEnd(e){this._resizing=!1,this.removeAttribute(`data-dragging`),this._emitResize(),this._emitChange()}_snapshotTracks(){let e=this._groupEl.getBoundingClientRect(),n=this.direction===`row`?e.width:e.height,r=this._collapsedPx(),i=this._model.children;return{rect:e,trackSizes:i.map(e=>e.kind===`panel`&&e.collapsed?r:e.kind===`panel`&&e.fixedPx!==null?e.fixedPx:e.weight*n),constraints:i.map(e=>e.kind===`panel`?{minPx:e.minPx,maxPx:e.maxPx,fixedPx:e.fixedPx,whenSmall:e.whenSmall}:{minPx:0,maxPx:null,fixedPx:null,whenSmall:`prevent`})}}_reseedDragState(e,n,r){if(!this._groupEl||!this._model)return;let{rect:i,trackSizes:a,constraints:o}=this._snapshotTracks();e.startPointerX=n,e.startPointerY=r,e.containerRect=i,e.trackSizes=a,e.minConstraints=o.map(e=>e.minPx),e.maxConstraints=o.map(e=>e.maxPx),e.fixedConstraints=o.map(e=>e.fixedPx),e.whenSmallConstraints=o.map(e=>e.whenSmall)}_emitResize(){if(!this._model)return;let e={sizes:this.getSizes(),groupId:this._model.id};this.dispatchEvent(new CustomEvent(`ixfx-split-resize`,{detail:e,bubbles:!0,composed:!0}))}_emitChange(){let e=this.getLayout();if(!e)return;let n={layout:e};this.dispatchEvent(new CustomEvent(`ixfx-split-change`,{detail:n,bubbles:!0,composed:!0}))}render(){if(!this._model)return a;let e=this._model.axis===`row`,n=this._resolveTracks(this._model),r=this._model.children.map((e,n)=>`--s${n}: ${e.weight*100}%`).join(`; `),o=e?`grid-template-columns: ${n}; grid-template-rows: 1fr; ${r}`:`grid-template-rows: ${n}; grid-template-columns: 1fr; ${r}`;return i`
|
|
5801
5802
|
<div class="grid" style="${o}">
|
|
5802
5803
|
${this._model.children.map((n,r)=>i`
|
|
5803
5804
|
<div part="panel" style="grid-column: ${e?r*2+1:1}; grid-row: ${e?1:r*2+1}; display: flex; flex-direction: ${e?`row`:`column`}; overflow: hidden;">
|
|
@@ -5932,8 +5933,8 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5932
5933
|
:host(:not([data-dragging])) .gutter:hover .ixfx-handle {
|
|
5933
5934
|
display: none;
|
|
5934
5935
|
}
|
|
5935
|
-
`]}};E([d({type:String,reflect:!0})],
|
|
5936
|
-
`))}function
|
|
5936
|
+
`]}};E([d({type:String,reflect:!0})],uy.prototype,`direction`,void 0),E([d({type:String})],uy.prototype,`sizes`,void 0),E([d({type:String,attribute:`gutter-size`})],uy.prototype,`gutterSize`,void 0),E([d({type:String})],uy.prototype,`snap`,void 0),E([m()],uy.prototype,`_model`,void 0),E([m()],uy.prototype,`_resizing`,void 0),E([f(`.grid`)],uy.prototype,`_groupEl`,void 0),uy=E([T(`ixfx-split-layout`)],uy);let dy=0;function fy(){return dy+=1,`ixfx-tab-indicator-${dy}`}function py(e){if(!(`startViewTransition`in document)||globalThis.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)return;let n=getComputedStyle(e),r=n.getPropertyValue(`--ixfx-tab-transition-duration`).trim();if(Number.parseFloat(r)>0)return{duration:r,easing:n.getPropertyValue(`--ixfx-tab-transition-easing`).trim()||`cubic-bezier(0.3333, 0, 0.6667, 1)`}}const my=new Map;let hy;function gy(){hy===void 0&&(hy=new CSSStyleSheet,document.adoptedStyleSheets=[...document.adoptedStyleSheets,hy]),hy.replaceSync([`ixfx-tab-list-item[selected]::after { view-transition-name: var(--ixfx-tab-indicator-name, none); }`,...my.values()].join(`
|
|
5937
|
+
`))}function _y(){hy===void 0&&gy()}function vy(e,n){my.set(e,`::view-transition-group(${e}) { animation-duration: ${n.duration}; animation-timing-function: ${n.easing}; }`),gy()}function yy(e,n,r){return vy(e,n),document.startViewTransition(r)}let by=class extends n{constructor(...e){super(...e),this.orientation=`horizontal`,this.flip=!1,this.scrollable=!1,this.hideLabels=!1,this.labelNogrow=!1,this.shrink=!1,this.dragMode=`off`,this.#e=[],this.#t=fy(),this.#n=null,this.#r=!1,this.#o=()=>{this.updateComplete.then(()=>{this.#s(),this.#p(),this.#u(),this.#d()})},this.#c=()=>{let e=(this.shadowRoot?.querySelector(`slot[name="toolbar"]`))?.assignedElements()??[],n=e.length>0;this.toggleAttribute(`has-toolbar`,n);let r=this.shadowRoot?.querySelector(`.list-toolbar`);if(r&&(r.hidden=!n),n){let n=e[0];n?.tagName===`IXFX-TOOLBAR`&&requestAnimationFrame(()=>{n?._scheduleMeasure?.()})}},this.#m=e=>{let n=e.key;this.#i?n===`ArrowUp`?this.#y():n===`ArrowDown`&&this.#v():n===`ArrowRight`?this.#v():n===`ArrowLeft`&&this.#y()},this.#h=e=>{let n=this.#n;if(e.key!==`Escape`||!n?.active)return;e.preventDefault();let r=n.pointerId;this.#j(),this.#M(r)},this.#g=e=>{if(!this.scrollable)return;let n=this.#L;if(n){if(this.#i){if(e.deltaX===0||n.scrollHeight<=n.clientHeight)return;n.scrollTop+=e.deltaX,e.preventDefault()}else{if(e.deltaY===0||n.scrollWidth<=n.clientWidth)return;n.scrollLeft+=e.deltaY,e.preventDefault()}}},this.#b=e=>{if(this.#r){this.#r=!1,e.preventDefault(),e.stopPropagation();return}this.focus();let n=e.target.closest(`ixfx-tab-list-item`);if(!n)return;let r=this.getSelectedElement(),i=n.getAttribute(`for`),a=r?.id,o=()=>{this.selectElement(n),this.dispatchEvent(new CustomEvent(`change`,{bubbles:!0,detail:{previous:a,selected:n.id,for:i??``}}))};r===n?o():this.#l(o)},this.#S=e=>{if(this.dragMode!==`reorder`||e.button!==0)return;let n=this.#x(e);if(!n)return;let r=this.#e.indexOf(n);r<0||(this.#n={pointerId:e.pointerId,source:n,fromIndex:r,startX:e.clientX,startY:e.clientY,active:!1,ghost:null,gapIndex:void 0},window.addEventListener(`pointermove`,this.#T),window.addEventListener(`pointerup`,this.#O),window.addEventListener(`pointercancel`,this.#k))},this.#C=null,this.#w=null,this.#T=e=>{let n=this.#n;!n||e.pointerId!==n.pointerId||(this.#C=e,this.#w??=requestAnimationFrame(this.#D))},this.#D=()=>{let e=this.#C;this.#C=null,this.#w=null;let n=this.#n;if(!n||!e)return;let r=e.clientX-n.startX,i=e.clientY-n.startY,a=Math.hypot(r,i);if(!n.active){if(a<5)return;this.#A(e)}n.ghost?.move(e.clientX,e.clientY);let o=this.#F(e.clientX,e.clientY);o!==n.gapIndex&&(n.gapIndex=o,this.requestUpdate())},this.#O=e=>{let n=this.#n;if(!(!n||e.pointerId!==n.pointerId)){if(n.active){let r=this.#F(e.clientX,e.clientY);this.#N(n.source,n.fromIndex,r)}this.#M(e.pointerId)}},this.#k=e=>{let n=this.#n;!n||e.pointerId!==n.pointerId||(this.#j(),this.#M(e.pointerId))}}#e;#t;#n;#r;get#i(){return this.orientation===`vertical-stack`||this.orientation===`vertical-side`}get#a(){return[this.scrollable?`${this.orientation} scrollable`:this.orientation,this.scrollable?this.#i?`scroll-fade-y`:`scroll-fade-x`:``,this.dragMode===`reorder`?`reorder`:``].filter(Boolean).join(` `)}render(){let e=this.#I();return i`
|
|
5937
5938
|
<div class="outer ${this.orientation}">
|
|
5938
5939
|
<div
|
|
5939
5940
|
tabindex=0
|
|
@@ -5951,7 +5952,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
5951
5952
|
<div class="list-toolbar ${this.orientation}" part="list-toolbar">
|
|
5952
5953
|
<slot name="toolbar" @slotchange=${this.#c}></slot>
|
|
5953
5954
|
</div>
|
|
5954
|
-
</div>`}#o;#s(){this.#e=(this.shadowRoot?.querySelector(`slot:not([name])`))?.assignedElements({flatten:!0})??[]}#c;firstUpdated(){this.updateComplete.then(()=>{this.#s(),this.#p(),this.#u(),this.#d(),this.#c()})}updated(e){if(super.updated(e),this.classList.toggle(`scrollable`,this.scrollable),e.has(`dragMode`)&&this.toggleAttribute(`drag-mode`,this.dragMode!==`off`),e.has(`hideLabels`)&&this.#u(),e.has(`labelNogrow`)&&this.#d(),e.has(`orientation`)||e.has(`flip`))for(let e of this.#e)e.setAttribute(`indicator-edge`,this.#f)}connectedCallback(){super.connectedCallback(),
|
|
5955
|
+
</div>`}#o;#s(){this.#e=(this.shadowRoot?.querySelector(`slot:not([name])`))?.assignedElements({flatten:!0})??[]}#c;firstUpdated(){this.updateComplete.then(()=>{this.#s(),this.#p(),this.#u(),this.#d(),this.#c()})}updated(e){if(super.updated(e),this.classList.toggle(`scrollable`,this.scrollable),e.has(`dragMode`)&&this.toggleAttribute(`drag-mode`,this.dragMode!==`off`),e.has(`hideLabels`)&&this.#u(),e.has(`labelNogrow`)&&this.#d(),e.has(`orientation`)||e.has(`flip`))for(let e of this.#e)e.setAttribute(`indicator-edge`,this.#f)}connectedCallback(){super.connectedCallback(),_y()}#l(e){let n=py(this);if(n===void 0){e();return}this.style.setProperty(`--ixfx-tab-indicator-name`,this.#t);let r=yy(this.#t,n,e),i=()=>this.style.removeProperty(`--ixfx-tab-indicator-name`);r.finished.then(i,i)}#u(){for(let e of this.#e)this.hideLabels?e.setAttribute(`hide-labels`,``):e.removeAttribute(`hide-labels`)}#d(){for(let e of this.#e)this.labelNogrow?e.setAttribute(`label-nogrow`,``):e.removeAttribute(`label-nogrow`)}get#f(){return this.#i?this.flip?`left`:`right`:this.flip?`top`:`bottom`}#p(){for(let e of this.#e)e.setAttribute(`indicator-edge`,this.#f),e.style.setProperty(`--indicator-color-bottom`,`transparent`),e.style.setProperty(`--indicator-color-top`,`transparent`),e.style.setProperty(`--indicator-color-left`,`transparent`),e.style.setProperty(`--indicator-color-right`,`transparent`),e.hasAttribute(`selected`)&&(this.orientation===`horizontal`&&!this.flip?e.style.setProperty(`--indicator-color-bottom`,`var(--accent)`):this.orientation===`horizontal`&&this.flip?e.style.setProperty(`--indicator-color-top`,`var(--accent)`):this.#i&&!this.flip?e.style.setProperty(`--indicator-color-right`,`var(--accent)`):this.#i&&this.flip&&e.style.setProperty(`--indicator-color-left`,`var(--accent)`))}#m;#h;#g;getSelectedElement(){for(let e of this.#e)if(this.#_(e))return e;let e=this.shadowRoot?.querySelector(`slot`);if(e){let n=e.assignedElements({flatten:!0});for(let e of n)if(this.#_(e))return e}}#_(e){return e.getAttribute(`selected`)!==null&&e.hasAttribute(`selected`)}selectElement(e){let n=this.getSelectedElement();n&&(n.removeAttribute(`selected`),n.style.setProperty(`--indicator-color-bottom`,`transparent`),n.style.setProperty(`--indicator-color-top`,`transparent`),n.style.setProperty(`--indicator-color-left`,`transparent`),n.style.setProperty(`--indicator-color-right`,`transparent`)),e.setAttribute(`selected`,``),this.orientation===`horizontal`&&!this.flip?e.style.setProperty(`--indicator-color-bottom`,`var(--accent)`):this.orientation===`horizontal`&&this.flip?e.style.setProperty(`--indicator-color-top`,`var(--accent)`):this.#i&&!this.flip?e.style.setProperty(`--indicator-color-right`,`var(--accent)`):this.#i&&this.flip&&e.style.setProperty(`--indicator-color-left`,`var(--accent)`)}#v(){let e=!1;for(let n of this.#e)if(this.#_(n)&&!e)e=!0;else if(e){this.#l(()=>this.selectElement(n));break}}#y(){let e;for(let n of this.#e)if(this.#_(n)&&e){let n=e;this.#l(()=>this.selectElement(n))}else e=n}#b;#x(e){if(this.dragMode===`off`)return null;let n=e.composedPath(),r=null;for(let e of n)if(e instanceof HTMLElement){if(e.classList.contains(`close-btn`)||e.classList.contains(`toolbar`))return null;!r&&e.tagName===`IXFX-TAB-LIST-ITEM`&&(r=e)}return r}#S;#C;#w;#T;#E(){this.#w!==null&&(cancelAnimationFrame(this.#w),this.#w=null),this.#C=null}#D;#O;#k;#A(e){let n=this.#n;if(!(!n||n.active)){try{this.#L?.setPointerCapture(e.pointerId)}catch{}n.active=!0,n.source.setAttribute(`drag-source`,``),n.ghost=this.#P(n.source),n.ghost&&n.ghost.move(e.clientX,e.clientY)}}#j(){let e=this.#n;e&&(e.source.removeAttribute(`drag-source`),e.gapIndex!==void 0&&(e.gapIndex=void 0,this.requestUpdate()))}#M(e){let n=this.#n;if(n){this.#E(),n.ghost?.destroy(),n.ghost=null,this.#n=null,window.removeEventListener(`pointermove`,this.#T),window.removeEventListener(`pointerup`,this.#O),window.removeEventListener(`pointercancel`,this.#k);try{this.#L?.releasePointerCapture(e)}catch{}this.requestUpdate()}}#N(e,n,r){e.removeAttribute(`drag-source`);let i=this.#e.filter(n=>n!==e),a=r===void 0?i.length:Math.max(0,Math.min(r,i.length)),o=e.parentNode;if(!o)return;let s=i[a]??null;o.insertBefore(e,s);let c=Array.prototype.indexOf.call(o.children,e);c!==n&&(this.#e=(this.shadowRoot?.querySelector(`slot`))?.assignedElements({flatten:!0})??[],this.#p(),this.#r=!0,this.dispatchEvent(new CustomEvent(`reorder`,{bubbles:!0,detail:{id:e.id,fromIndex:n,toIndex:c}})))}#P(e){let n=document.createElement(`span`);n.style.display=`inline-flex`,n.style.alignItems=`center`,n.style.gap=`var(--space-xs, 4px)`,n.style.minWidth=`0`;let r=e.iconName;if(r){let e=document.createElement(`ixfx-icon`);e.name=r,n.appendChild(e)}let i=document.createElement(`span`);i.textContent=(e.textContent??``).trim(),i.style.overflow=`hidden`,i.style.textOverflow=`ellipsis`,i.style.whiteSpace=`nowrap`,n.appendChild(i);try{return Gg({anchor:e,content:n})}catch{return null}}#F(e,n){let r=this.#n;if(!r)return;let i=this.#e.filter(e=>e!==r.source);if(i.length===0)return 0;let a=!this.#i,o=0,s=1/0;for(let r=0;r<i.length;r++){let c=i[r].getBoundingClientRect(),l=a?c.left:c.top,u=a?c.right:c.bottom,d=(l+u)/2,f=a?e:n,p=Math.abs(f-l);Math.abs(f-d);let m=Math.abs(f-u);f<d?p<s&&(s=p,o=r):m<s&&(s=m,o=r+1)}return o}#I(){let e=this.#n;if(!e?.active||e.gapIndex===void 0)return;let n=this.#e.filter(n=>n!==e.source);if(n.length===0)return;let r=!this.#i,i=this.#L?.getBoundingClientRect();if(!i)return;let a=Math.max(0,Math.min(e.gapIndex,n.length)),o=null;if(o=a<n.length?n[a].getBoundingClientRect():n[n.length-1].getBoundingClientRect(),r){let e=(a<n.length?o.left:o.right)-i.left,r=i.height;return`transform: translate(${e-1}px, 0px); width: 2px; height: ${r}px;`}{let e=(a<n.length?o.top:o.bottom)-i.top,r=i.width;return`transform: translate(0px, ${e-1}px); width: ${r}px; height: 2px;`}}get#L(){return this.shadowRoot?.getElementById(`container`)??null}static{this.styles=[w,Ng(`x`),Ng(`y`),r`
|
|
5955
5956
|
:host {
|
|
5956
5957
|
display: inline-block;
|
|
5957
5958
|
--activated-colour: var(--accent);
|
|
@@ -6117,7 +6118,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6117
6118
|
::slotted(.activated) {
|
|
6118
6119
|
--colour: var(--activated-colour);
|
|
6119
6120
|
}
|
|
6120
|
-
`]}};E([d({type:String})],
|
|
6121
|
+
`]}};E([d({type:String})],by.prototype,`orientation`,void 0),E([d({type:Boolean})],by.prototype,`flip`,void 0),E([d({type:Boolean})],by.prototype,`scrollable`,void 0),E([d({type:Boolean,attribute:`hide-labels`})],by.prototype,`hideLabels`,void 0),E([d({type:Boolean,attribute:`label-nogrow`})],by.prototype,`labelNogrow`,void 0),E([d({type:Boolean,reflect:!0})],by.prototype,`shrink`,void 0),E([d({type:String,attribute:`drag-mode`})],by.prototype,`dragMode`,void 0),by=E([T(`ixfx-tab-list`)],by);const xy=new WeakMap,Sy=new ResizeObserver(e=>{for(let n of e)xy.get(n.target)?.(n.contentRect.width)}),Cy=new Map,wy=new MutationObserver(e=>{let n=new Set;for(let r of e)for(let e=r.target;e;e=e.parentNode){let r=Cy.get(e);if(r){n.add(r);break}}for(let e of n)e()});let Ty=class extends n{constructor(...e){super(...e),this.closeable=!1,this.hideLabels=!1,this.labelNogrow=!1,this.iconName=void 0,this.description=void 0,this.commandActive=void 0,this.registry=void 0,this._compact=!1,this._hasToolbarContent=!1,this._hasStatusContent=!1,this._onLabelMutation=()=>{this._syncLabelSizer(),this._updateToolbarContent(),this._updateStatusContent()},this._onToolbarSlotChange=()=>{this._updateToolbarContent()},this._onStatusSlotChange=()=>{this._updateStatusContent()},this._onLabelSlotChange=()=>{this._syncLabelSizer()}}connectedCallback(){super.connectedCallback(),xy.set(this,e=>{this._compact=e<64}),Sy.observe(this),this._wireSlotListeners(),Cy.set(this,this._onLabelMutation),wy.observe(this,{childList:!0,characterData:!0,subtree:!0,attributes:!0,attributeFilter:[`slot`]})}disconnectedCallback(){super.disconnectedCallback(),Sy.unobserve(this),xy.delete(this),this._commandCleanup?.(),this._commandCleanup=void 0,Cy.delete(this),this._unwireSlotListeners()}updated(e){super.updated(e),this._syncTooltipAttrs(),(e.has(`registry`)||e.has(`commandActive`))&&this._syncCommandListener()}_syncTooltipAttrs(){this.description?(this.setAttribute(`data-tooltip`,this.description),this.setAttribute(`data-tooltip-anchor`,`top`)):(this.removeAttribute(`data-tooltip`),this.removeAttribute(`data-tooltip-anchor`))}_syncCommandListener(){this._commandCleanup?.(),this._commandCleanup=void 0,this.registry&&this.commandActive&&(this._commandCleanup=this.registry.addOnInvokeHandler(e=>{e===this.commandActive&&this.click()}))}_wireSlotListeners(){(this.shadowRoot?.querySelector(`slot[name="toolbar"]`))?.addEventListener(`slotchange`,this._onToolbarSlotChange),(this.shadowRoot?.querySelector(`slot[name="status"]`))?.addEventListener(`slotchange`,this._onStatusSlotChange),(this.shadowRoot?.querySelector(`slot:not([name])`))?.addEventListener(`slotchange`,this._onLabelSlotChange)}_unwireSlotListeners(){(this.shadowRoot?.querySelector(`slot[name="toolbar"]`))?.removeEventListener(`slotchange`,this._onToolbarSlotChange),(this.shadowRoot?.querySelector(`slot[name="status"]`))?.removeEventListener(`slotchange`,this._onStatusSlotChange),(this.shadowRoot?.querySelector(`slot:not([name])`))?.removeEventListener(`slotchange`,this._onLabelSlotChange)}_syncLabelSizer(){let e=this.shadowRoot?.querySelector(`slot:not([name])`),n=this.shadowRoot?.querySelector(`.label`);if(e==null||n==null)return;let r=e.assignedNodes().filter(e=>!(e instanceof HTMLElement&&e.hasAttribute(`slot`))).map(e=>e.textContent??``).join(``);r?n.setAttribute(`data-label`,r):n.removeAttribute(`data-label`)}_updateToolbarContent(){this._hasToolbarContent=Array.from(this.children).some(e=>e.getAttribute(`slot`)===`toolbar`)}_updateStatusContent(){this._hasStatusContent=Array.from(this.children).some(e=>e.getAttribute(`slot`)===`status`)}firstUpdated(){this._wireSlotListeners(),this._updateToolbarContent(),this._updateStatusContent(),this._syncLabelSizer()}render(){let e=!this.hideLabels||!this.iconName,n=this.closeable||this._hasToolbarContent;return i`
|
|
6121
6122
|
<div>
|
|
6122
6123
|
${this.iconName?i`<ixfx-icon name="${this.iconName}"></ixfx-icon>`:a}
|
|
6123
6124
|
${e?i`<span class="label"><slot></slot></span>`:a}
|
|
@@ -6358,7 +6359,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6358
6359
|
:host(:hover) .close-btn {
|
|
6359
6360
|
opacity: var(--prominence-tickled-opacity);
|
|
6360
6361
|
}
|
|
6361
|
-
`]}};E([d({type:Boolean})],
|
|
6362
|
+
`]}};E([d({type:Boolean})],Ty.prototype,`closeable`,void 0),E([d({type:Boolean,attribute:`hide-labels`})],Ty.prototype,`hideLabels`,void 0),E([d({type:Boolean,attribute:`label-nogrow`})],Ty.prototype,`labelNogrow`,void 0),E([d({type:String,attribute:`icon-name`})],Ty.prototype,`iconName`,void 0),E([d({type:String})],Ty.prototype,`description`,void 0),E([d({type:String,attribute:`command-active`})],Ty.prototype,`commandActive`,void 0),E([d({attribute:!1})],Ty.prototype,`registry`,void 0),E([m()],Ty.prototype,`_compact`,void 0),E([m()],Ty.prototype,`_hasToolbarContent`,void 0),E([m()],Ty.prototype,`_hasStatusContent`,void 0),Ty=E([T(`ixfx-tab-list-item`)],Ty);let Ey=class extends n{constructor(...e){super(...e),this.panelId=``,this.title=``,this.iconName=``,this.closable=!1,this.collapsible=!1,this.kind=`any`,this.accepts=``,this.presentation=`solo`,this._collapsed=!1,this._dragPointerId=null,this._dragStartX=0,this._dragStartY=0,this._dragStarted=!1,this._onPointerDown=e=>{e.button===0&&this.presentation!==`tabbed`&&this._isDragHandle(e)&&(this._dragPointerId=e.pointerId,this._dragStartX=e.clientX,this._dragStartY=e.clientY,this._dragStarted=!1,window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerUp))},this._onPointerMove=e=>{if(this._dragPointerId!==null&&e.pointerId===this._dragPointerId&&!this._dragStarted){if(Math.hypot(e.clientX-this._dragStartX,e.clientY-this._dragStartY)<5)return;this._dragStarted=!0;let n=this._dragPointerId;this._teardownDragListeners(),this._dispatchDragStart(n,e.clientX,e.clientY)}},this._onPointerUp=e=>{this._dragPointerId!==null&&e.pointerId===this._dragPointerId&&this._teardownDragListeners()},this._onTitlebarToggle=e=>{e.stopPropagation(),this._collapsed=e.detail.collapsed,this.dispatchEvent(new CustomEvent(`toggle`,{detail:e.detail,bubbles:!0,composed:!0}))},this._onTitlebarClose=e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0})),this.remove()}}connectedCallback(){super.connectedCallback(),this.hasAttribute(`title`)&&(this.hasAttribute(`label`)||(this.title=this.getAttribute(`title`)??``),this.removeAttribute(`title`)),this.addEventListener(`pointerdown`,this._onPointerDown)}disconnectedCallback(){super.disconnectedCallback(),this._teardownDragListeners(),this.removeEventListener(`pointerdown`,this._onPointerDown)}_teardownDragListeners(){this._dragPointerId=null,this._dragStarted=!1,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerUp)}_isDragHandle(e){for(let n of e.composedPath())if(n instanceof HTMLElement&&(n.classList.contains(`close-btn`)||n.classList.contains(`caret-btn`)||n.classList.contains(`toolbar`)))return!1;return!0}_dispatchDragStart(e,n,r){this.panelId&&this.dispatchEvent(new CustomEvent(`dock-panel-drag-start`,{detail:{panelId:this.panelId,pointerId:e,clientX:n,clientY:r},bubbles:!0,composed:!0}))}render(){let e=this.presentation===`tabbed`,n=!e&&this._collapsed;return i`
|
|
6362
6363
|
${e?a:i`
|
|
6363
6364
|
<ixfx-titlebar
|
|
6364
6365
|
.title=${this.title}
|
|
@@ -6400,14 +6401,14 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6400
6401
|
.content[collapsed] {
|
|
6401
6402
|
display: none;
|
|
6402
6403
|
}
|
|
6403
|
-
`]}};E([d({type:String,attribute:`panel-id`,reflect:!0})],Cy.prototype,`panelId`,void 0),E([d({type:String,attribute:`label`})],Cy.prototype,`title`,void 0),E([d({type:String,attribute:`icon-name`})],Cy.prototype,`iconName`,void 0),E([d({type:Boolean})],Cy.prototype,`closable`,void 0),E([d({type:Boolean})],Cy.prototype,`collapsible`,void 0),E([d({type:String,reflect:!0})],Cy.prototype,`kind`,void 0),E([d({type:String,attribute:`accepts`})],Cy.prototype,`accepts`,void 0),E([d({type:String,reflect:!0})],Cy.prototype,`presentation`,void 0),E([m()],Cy.prototype,`_collapsed`,void 0),Cy=E([T(`ixfx-dock-panel`)],Cy);const wy=.25;let Ty=class extends n{constructor(...e){super(...e),this.layout=null,this.accepts=`tabs horizontal vertical`,this.isolated=!1,this._model=ev([]),this._pool=[],this._dropZone=null,this._dragActive=!1,this._junctions=[],this._toolbarsOut=new Map,this._leafContentRules=new Map,this._tabDragPending=null,this._junctionsKey=``,this._junctionsRaf=null,this._hostResizeObserver=null,this._loadGeneration=0,this._toolbarSlots=new Set,this._toolbarObserver=null,this._panelObservers=new Map,this._onDragStart=e=>{let{panelId:n,pointerId:r,clientX:i,clientY:a}=e.detail;R_(n,this,r,i,a,this._findPanelEl(n)?.kind)},this._onPoolSlotChange=()=>{this._syncPool()},this._onJunctionPointerDown=(e,n)=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let r=!1;for(let i of n.targets)i.split.isConnected&&i.split.beginGutterDrag(i.gutterIndex,e.pointerId,e.clientX,e.clientY)&&(r=!0);if(!r)return;this._suppressNextClick();let i=()=>this._scheduleJunctions(),a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)},this._onSplitWeightsChanged=()=>{this._foldLiveWeights(),this._scheduleJunctions()},this._onSplitCollapsed=(e,n)=>{let r=e.detail;if(!r?.id)return;let i=this.shadowRoot?.getElementById(r.id)?.getAttribute(`data-dock-path`);if(i==null)return;let a=av(this._model,Fy(i));a===null||!U(a)||(n?a.collapsed=!0:delete a.collapsed)},this._onSplitClose=e=>{e.preventDefault();let n=e.detail;if(!n?.id)return;let r=this.shadowRoot?.getElementById(n.id)?.getAttribute(`data-dock-path`);if(r==null)return;let i=Fy(r),a=av(this._model,i);if(a===null||!U(a))return;let o=[...a.panels];this._returnAllToolbars(),xv(this._model,i);for(let e of o)hv(this._firstStackAllowing(this._panelKind(e)),e);this._commit()},this._onTabChange=(e,n)=>{let r=e.detail.selected,i=av(this._model,n);i===null||!U(i)||_v(i,r)&&(this.requestUpdate(),this.dispatchEvent(new CustomEvent(`dock-panel-activated`,{detail:{panelId:r},bubbles:!0,composed:!0})))},this._onStripPointerDown=e=>{if(e.button!==0)return;let n=e.composedPath();for(let e of n)if(e instanceof HTMLElement&&(e.classList.contains(`list-toolbar`)||e.classList.contains(`close-btn`)))return;let r=n.find(e=>e instanceof HTMLElement&&e.tagName===`IXFX-TAB-LIST-ITEM`)??null;r===null||!r.id||(this._tabDragPending={panelId:r.id,pointerId:e.pointerId,startX:e.clientX,startY:e.clientY},window.addEventListener(`pointermove`,this._onTabDragMove),window.addEventListener(`pointerup`,this._onTabDragUp),window.addEventListener(`pointercancel`,this._onTabDragUp))},this._onTabDragMove=e=>{let n=this._tabDragPending;n!==null&&e.pointerId===n.pointerId&&(Math.hypot(e.clientX-n.startX,e.clientY-n.startY)<5||(this._tabDragPending=null,this._teardownTabDragListeners(),this._suppressNextClick(),this.dispatchEvent(new CustomEvent(`dock-panel-drag-start`,{detail:{panelId:n.panelId,pointerId:n.pointerId,clientX:e.clientX,clientY:e.clientY},bubbles:!0,composed:!0}))))},this._onTabDragUp=e=>{this._tabDragPending!==null&&e.pointerId===this._tabDragPending.pointerId&&(this._tabDragPending=null,this._teardownTabDragListeners())}}connectedCallback(){super.connectedCallback(),this._buildInitialModel(),I_(this),this.addEventListener(`dock-panel-drag-start`,this._onDragStart),this._hostResizeObserver=new ResizeObserver(()=>this._scheduleJunctions()),this._hostResizeObserver.observe(this),this._scanToolbarSlots(),this._toolbarObserver=new MutationObserver(()=>this._scanToolbarSlots()),this._toolbarObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`slot`]})}disconnectedCallback(){super.disconnectedCallback(),L_(this),this.removeEventListener(`dock-panel-drag-start`,this._onDragStart),this._toolbarObserver?.disconnect(),this._toolbarObserver=null,this._hostResizeObserver?.disconnect(),this._hostResizeObserver=null;for(let e of this._panelObservers.values())e.disconnect();this._panelObservers.clear(),this._junctionsRaf!==null&&(cancelAnimationFrame(this._junctionsRaf),this._junctionsRaf=null),this._junctions=[],this._junctionsKey=``,this._returnAllToolbars()}willUpdate(e){if(super.willUpdate(e),e.has(`layout`)&&this.layout!==null){let e=Nv(this.layout);e&&(this._model=e.root,this._mergePoolIntoModel())}}updated(e){super.updated(e),this._syncSlots(),this._syncToolbars(),this._scheduleJunctions()}_buildInitialModel(){if(this.layout!==null){let e=Nv(this.layout);if(e){this._model=e.root,this._mergePoolIntoModel();return}}this._model=ev([]),this._mergePoolIntoModel()}_mergePoolIntoModel(){let e=new Set(lv(this._model)),n=!1;for(let r of this._scanPanels())e.has(r.panelId)||(this._appendPanelToFirstStack(r.panelId),e.add(r.panelId),n=!0);n&&nv(this._model)}_scanPanels(){return Array.from(this.children).filter(e=>e instanceof HTMLElement&&e.tagName===`IXFX-DOCK-PANEL`&&!!e.panelId)}_scanToolbarSlots(){let e=new Set;for(let n of this.children){if(!(n instanceof HTMLElement))continue;let r=n.getAttribute(`slot`)??``;r.startsWith(`toolbar-`)&&r.length>8&&e.add(r)}(e.size!==this._toolbarSlots.size||[...e].some(e=>!this._toolbarSlots.has(e)))&&(this._toolbarSlots=e,this.requestUpdate())}_findPanelEl(e){return this._pool.find(n=>n.panelId===e)??this._scanPanels().find(n=>n.panelId===e)}_firstStack(){let e=pv(this._model),n=e.length>0?av(this._model,e[0]):null;if(n!==null&&U(n))return n;let r=ev([]);return yv(this._model,`row`,r,`after`),nv(this._model),r}_appendPanelToFirstStack(e){let n=this._panelKind(e);if(this._model.kind===`stack`&&this._stackAllowsKind(this._model,n)){hv(this._model,e);return}hv(this._firstStackAllowing(n),e)}_panelKind(e){return Py(this._findPanelEl(e)?.kind)}_stackAllowsKind(e,n){if(e.name===void 0)return!0;let r=this._leafContentRules.get(e.name);return r===void 0?!0:r.deny.has(n)?!1:r.allow===null||r.allow.has(n)}_leafAllowsEdgeSplit(e){return e.name===void 0?!0:this._leafContentRules.get(e.name)?.allowEdgeSplit??!0}_firstStackAllowing(e){for(let n of pv(this._model)){let r=av(this._model,n);if(r!==null&&U(r)&&this._stackAllowsKind(r,e))return r}return console.warn(`[ixfx-dock-host] no leaf admits kind "${e}", using first stack`),this._firstStack()}_observePanel(e){if(this._panelObservers.has(e.panelId))return;let n=new MutationObserver(()=>this.requestUpdate());n.observe(e,{attributes:!0,attributeFilter:[`label`,`icon-name`,`closable`,`collapsible`,`kind`,`accepts`]}),this._panelObservers.set(e.panelId,n)}_unobservePanel(e){let n=this._panelObservers.get(e.panelId);n&&(n.disconnect(),this._panelObservers.delete(e.panelId))}_syncPool(){let e=this._scanPanels(),n=new Set(e.map(e=>e.panelId)),r=!1;for(let e of[...this._pool])n.has(e.panelId)||(this._unobservePanel(e),this._toolbarsOut.delete(e.panelId),this._removeFromModel(e.panelId),this.dispatchEvent(new CustomEvent(`dock-panel-removed`,{detail:{panelId:e.panelId},bubbles:!0,composed:!0})),r=!0);for(let n of e)this._observePanel(n),lv(this._model).includes(n.panelId)||(this._appendPanelToFirstStack(n.panelId),nv(this._model),this.dispatchEvent(new CustomEvent(`dock-panel-added`,{detail:{panelId:n.panelId},bubbles:!0,composed:!0})),r=!0);this._pool=e,this.requestUpdate(),r&&this._emitChange()}saveLayout(){return this._foldLiveWeights(),jv(this._model)}loadLayout(e){this._returnAllToolbars(),this._loadGeneration++,this._model=nv(Ny(e.root)),this._mergePoolIntoModel(),this.requestUpdate(),this._emitChange()}addPanel(e,n){let r=(e instanceof HTMLElement,Py(e.kind)),i=n?.op??`tabs`,a=null,o=null;if(n?.container!==void 0){let e=uv(this._model,n.container);if(e===null)console.warn(`[ixfx-dock-host] addPanel: unknown container "${n.container}", appending to first admitting stack`);else if(i===`tabs`&&!this._stackAllowsKindAt(e,r))return console.warn(`[ixfx-dock-host] addPanel: container "${n.container}" does not admit kind "${r}"`),!1;else if(i!==`tabs`&&!this._stackAllowsEdgeSplitAt(e))return console.warn(`[ixfx-dock-host] addPanel: container "${n.container}" forbids edge splits (allowEdgeSplit: false)`),!1;else a=e}else if(n?.stack){let e=sv(this._model,n.stack);if(e===null)console.warn(`[ixfx-dock-host] addPanel: unknown stack panel "${n.stack}", appending to first admitting stack`);else if(i===`tabs`&&!this._stackAllowsKindAt(e,r))return console.warn(`[ixfx-dock-host] addPanel: target stack does not admit kind "${r}"`),!1;else if(i!==`tabs`&&!this._stackAllowsEdgeSplitAt(e))return console.warn(`[ixfx-dock-host] addPanel: target stack forbids edge splits (allowEdgeSplit: false)`),!1;else a=e}a!==null&&i!==`tabs`&&(o=a,a=null);let s;if(e instanceof HTMLElement?s=e:(s=document.createElement(`ixfx-dock-panel`),s.panelId=e.panelId,e.title!==void 0&&(s.title=e.title),e.iconName!==void 0&&(s.iconName=e.iconName),e.closable!==void 0&&(s.closable=e.closable),e.collapsible!==void 0&&(s.collapsible=e.collapsible),e.kind!==void 0&&(s.kind=e.kind)),s.parentElement!==this&&this.appendChild(s),this._pool.some(e=>e.panelId===s.panelId)||(this._pool=[...this._pool,s]),this._returnAllToolbars(),lv(this._model).includes(s.panelId)&&this._removeFromModel(s.panelId),o!==null)vv(this._model,o,Ey(i),ev([s.panelId]),`after`);else if(a!==null){let e=av(this._model,a);e!==null&&U(e)&&hv(e,s.panelId,n?.index)}else this._appendPanelToFirstStack(s.panelId);return nv(this._model),this.requestUpdate(),this.dispatchEvent(new CustomEvent(`dock-panel-added`,{detail:{panelId:s.panelId},bubbles:!0,composed:!0})),this._emitChange(),!0}_stackAllowsKindAt(e,n){let r=av(this._model,e);return r!==null&&U(r)&&this._stackAllowsKind(r,n)}_stackAllowsEdgeSplitAt(e){let n=av(this._model,e);return n===null||!U(n)||this._leafAllowsEdgeSplit(n)}removePanel(e){return lv(this._model).includes(e)?(this._returnAllToolbars(),this._removeFromModel(e),this._pool=this._pool.filter(n=>n.panelId!==e),this._toolbarsOut.delete(e),this._scanPanels().find(n=>n.panelId===e)?.remove(),nv(this._model),this.requestUpdate(),this.dispatchEvent(new CustomEvent(`dock-panel-removed`,{detail:{panelId:e},bubbles:!0,composed:!0})),this._emitChange(),!0):!1}activatePanel(e){let n=sv(this._model,e);if(n===null)return!1;let r=av(this._model,n);return r===null||!U(r)||!_v(r,e)?!1:(this.requestUpdate(),this.dispatchEvent(new CustomEvent(`dock-panel-activated`,{detail:{panelId:e},bubbles:!0,composed:!0})),!0)}getPanelIds(){return lv(this._model)}getContainerNames(){return fv(this._model)}getContainer(e){let n=uv(this._model,e);if(n===null)return null;let r=av(this._model,n);return r===null||!U(r)||r.name===void 0?null:{name:r.name,panels:[...r.panels],active:r.active}}getContainerPanels(e){return this.getContainer(e)?.panels??[]}getContainerElements(e){return this.getContainerPanels(e).map(e=>this._findPanelEl(e)).filter(e=>e!==void 0)}_defaultLeafRule(){return{allow:null,deny:new Set,allowEdgeSplit:!0}}_isEmptyLeafRule(e){return e.allow===null&&e.deny.size===0&&e.allowEdgeSplit}_warnUnknownContainer(e,n){uv(this._model,n)===null&&console.warn(`[ixfx-dock-host] ${e}: no container named "${n}" yet; rule stored`)}setLeafExclusiveContents(e,n){let r=e.trim();if(!r){console.warn(`[ixfx-dock-host] setLeafExclusiveContents: empty container name`);return}let i=this._leafContentRules.get(r)??this._defaultLeafRule();i.allow=new Set(n.map(e=>e.trim()).filter(e=>e.length>0)),this._leafContentRules.set(r,i),this._warnUnknownContainer(`setLeafExclusiveContents`,r)}setLeafDenyContents(e,n){let r=e.trim();if(!r){console.warn(`[ixfx-dock-host] setLeafDenyContents: empty container name`);return}let i=this._leafContentRules.get(r)??this._defaultLeafRule();i.deny=new Set(n.map(e=>e.trim()).filter(e=>e.length>0)),this._isEmptyLeafRule(i)?this._leafContentRules.delete(r):this._leafContentRules.set(r,i),this._warnUnknownContainer(`setLeafDenyContents`,r)}setLeafPlacementPolicy(e,n){let r=e.trim();if(!r){console.warn(`[ixfx-dock-host] setLeafPlacementPolicy: empty container name`);return}let i=this._leafContentRules.get(r)??this._defaultLeafRule();n.allowKinds!==void 0&&(i.allow=new Set(n.allowKinds.map(e=>e.trim()).filter(e=>e.length>0))),n.denyKinds!==void 0&&(i.deny=new Set(n.denyKinds.map(e=>e.trim()).filter(e=>e.length>0))),n.allowEdgeSplit!==void 0&&(i.allowEdgeSplit=n.allowEdgeSplit),this._isEmptyLeafRule(i)?this._leafContentRules.delete(r):this._leafContentRules.set(r,i),this._warnUnknownContainer(`setLeafPlacementPolicy`,r)}clearLeafContentRestrictions(e){this._leafContentRules.delete(e.trim())}clearLeafPlacementPolicy(e){this._leafContentRules.delete(e.trim())}getLeafContentRestrictions(e){let n=this._leafContentRules.get(e.trim());return n===void 0?null:{allow:n.allow===null?null:[...n.allow],deny:[...n.deny]}}getLeafPlacementPolicy(e){let n=this._leafContentRules.get(e.trim());return n===void 0?null:{allowKinds:n.allow===null?null:[...n.allow],denyKinds:[...n.deny],allowEdgeSplit:n.allowEdgeSplit}}getNeighbours(e){return Dv(this._model,e)}moveLeaf(e,n){return kv(this._model,e,n)?(this._commit(),!0):!1}moveLeafToEdge(e,n){return Av(this._model,e,n)?(this._commit(),!0):!1}getPanelSnapshot(e){let n=this._findPanelEl(e);return n===void 0?null:{panelId:n.panelId,title:n.title,iconName:n.iconName,closable:n.closable,collapsible:n.collapsible,kind:Py(n.kind),accepts:n.accepts,contentHTML:n.innerHTML}}detachPanel(e){let n=this.getPanelSnapshot(e);return n===null?null:(this.removePanel(e),n)}queryDropTarget(e,n,r=`__external__`,i){let a=this.computeDropZone(e,n,r,i);return a===null?null:My(a)}previewExternalDrop(e,n,r=`__external__`,i){this.setDragActive(!0);let a=this.computeDropZone(e,n,r,i);return this.setDropZone(a),a===null?null:My(a)}endExternalDrop(){this.setDropZone(null),this.setDragActive(!1)}acceptExternalPanel(e,n){if(lv(this._model).includes(e.panelId))return null;let r=document.createElement(`ixfx-dock-panel`);r.panelId=e.panelId,e.title!==void 0&&(r.title=e.title),e.iconName!==void 0&&(r.iconName=e.iconName),e.closable!==void 0&&(r.closable=e.closable),e.collapsible!==void 0&&(r.collapsible=e.collapsible),`kind`in e&&e.kind!==void 0&&(r.kind=e.kind),`accepts`in e&&e.accepts&&r.setAttribute(`accepts`,e.accepts),`contentHTML`in e&&e.contentHTML&&(r.innerHTML=e.contentHTML),this._returnAllToolbars(),this.appendChild(r),this._pool=[...this._pool,r],this._appendPanelToFirstStack(r.panelId),nv(this._model),this.endExternalDrop();let i=n?this.computeDropZone(n.clientX,n.clientY,r.panelId):null;return i!==null&&this._applyZone(r.panelId,i),nv(this._model),this.requestUpdate(),this.dispatchEvent(new CustomEvent(`dock-panel-added`,{detail:{panelId:r.panelId},bubbles:!0,composed:!0})),this._emitChange(),r}computeDropZone(e,n,r,i){let a=this.getBoundingClientRect();if(e<a.left||e>a.right||n<a.top||n>a.bottom)return null;let o=i?.trim()?i.trim():this._panelKind(r),s=e=>({x:e.left-a.left,y:e.top-a.top,w:e.width,h:e.height});for(let i of pv(this._model)){let c=this.shadowRoot?.querySelector(`[data-dock-path="${i.join(`-`)}"]`);if(!c)continue;let l=c.getBoundingClientRect();if(e<l.left||e>l.right||n<l.top||n>l.bottom)continue;let u=av(this._model,i);if(u===null||!U(u))continue;let d=c.querySelector(`ixfx-tab-list`);if(d!==null){let c=d.getBoundingClientRect();if(e>=c.left&&e<=c.right&&n>=c.top&&n<=c.bottom){let c=Ly(d,e,n),u={host:this,operation:`tabs`,targetPath:i,side:`after`,gapIndex:c,rect:s(l),caretRect:this._stripCaretRect(d,c,a)};return this._zoneAllowed(r,u,o)?u:null}}let f=(e-l.left)/Math.max(l.width,1),p=(n-l.top)/Math.max(l.height,1);if(f>=wy&&f<=.75&&p>=wy&&p<=.75){let e={host:this,operation:`tabs`,targetPath:i,side:`after`,gapIndex:u.panels.length,rect:s(l)};return this._zoneAllowed(r,e,o)?e:null}let m=s(l),h,g,_;f<wy?(h=`split-vertical`,g=`before`,_={...m,w:m.w/2}):f>.75?(h=`split-vertical`,g=`after`,_={x:m.x+m.w/2,y:m.y,w:m.w/2,h:m.h}):p<wy?(h=`split-horizontal`,g=`before`,_={...m,h:m.h/2}):(h=`split-horizontal`,g=`after`,_={x:m.x,y:m.y+m.h/2,w:m.w,h:m.h/2});let v={host:this,operation:h,targetPath:i,side:g,rect:_};return this._zoneAllowed(r,v,o)?v:null}let c=e-a.left,l=a.right-e,u=n-a.top,d=a.bottom-n,f=Math.min(c,l,u,d),p={x:0,y:0,w:a.width,h:a.height},m,h,g;f===c?(m=`split-vertical`,h=`before`,g={...p,w:p.w/2}):f===l?(m=`split-vertical`,h=`after`,g={x:p.x+p.w/2,y:p.y,w:p.w/2,h:p.h}):f===u?(m=`split-horizontal`,h=`before`,g={...p,h:p.h/2}):(m=`split-horizontal`,h=`after`,g={x:p.x,y:p.y+p.h/2,w:p.w,h:p.h/2});let _={host:this,operation:m,targetPath:[],side:h,rect:g};return this._zoneAllowed(r,_,o)?_:null}_zoneAllowed(e,n,r){if(!Oy(this.accepts,Dy(n.operation)))return!1;let i=av(this._model,n.targetPath);if(i!==null&&U(i)&&i.panels.length===1){let e=this._findPanelEl(i.panels[0]);if(e&&!ky(e.accepts,Dy(n.operation)))return!1}return!(n.operation===`tabs`&&i!==null&&U(i)&&!this._stackAllowsKind(i,r?.trim()?r.trim():this._panelKind(e))||n.operation!==`tabs`&&i!==null&&U(i)&&!this._leafAllowsEdgeSplit(i)||this.canAccept&&!this.canAccept(e,n.operation))}handleDrop(e,n,r){if(r!==void 0&&r!==this&&r.releasePanel(e,this),!lv(this._model).includes(e)){if(!this._findPanelEl(e))return;this._appendPanelToFirstStack(e),nv(this._model)}this._applyZone(e,n,r===void 0||r===this),this._commit()}_applyZone(e,n,r=!1){let i=sv(this._model,e),a=null;if(i!==null){let n=av(this._model,i);n!==null&&U(n)&&(gv(n,e),n.panels.length===0&&(a=n))}if(n.operation===`tabs`){let i=av(this._model,n.targetPath);i!==null&&U(i)&&(hv(i,e,n.gapIndex),r&&a!==null&&a!==i&&a.name!==void 0&&i.name===void 0&&(i.name=a.name,delete a.name))}else vv(this._model,n.targetPath,Ey(n.operation),ev([e]),n.side)}releasePanel(e,n){this._returnAllToolbars();let r=this._pool.find(n=>n.panelId===e),i=sv(this._model,e);if(i!==null){let n=av(this._model,i);n!==null&&U(n)&&gv(n,e)}nv(this._model),this._pool=this._pool.filter(e=>e!==r),r!==void 0&&n.adoptPanelElement(r),this.requestUpdate()}adoptPanelElement(e){this.appendChild(e),this._pool.some(n=>n.panelId===e.panelId)||(this._pool=[...this._pool,e]),this._appendPanelToFirstStack(e.panelId),nv(this._model),this.dispatchEvent(new CustomEvent(`dock-panel-added`,{detail:{panelId:e.panelId},bubbles:!0,composed:!0}))}setDragActive(e){this._dragActive!==e&&(this._dragActive=e,this.requestUpdate())}setDropZone(e){this._dropZone!==e&&(this._dropZone=e,this.requestUpdate())}_scheduleJunctions(){this._junctionsRaf===null&&(this._junctionsRaf=requestAnimationFrame(()=>{this._junctionsRaf=null,this._computeJunctions()}))}_computeJunctions(){let e=this.shadowRoot;if(e===null)return;let n=this.getBoundingClientRect(),r=[];for(let i of e.querySelectorAll(`ixfx-split-layout`)){let e=i.parentElement?.closest(`ixfx-split-layout`)??null;if(e===null||typeof i.getGutterRects!=`function`||typeof e.getGutterRects!=`function`)continue;let a=i.getBoundingClientRect();for(let[o,s]of e.getGutterRects().entries())for(let[c,l]of i.getGutterRects().entries()){let u=s.width<=s.height;if(u===l.width<=l.height)continue;let d,f;if(u){if(d=s.left+s.width/2,f=l.top+l.height/2,Math.abs(d-a.left)>6&&Math.abs(d-a.right)>6||f<s.top||f>s.bottom)continue}else if(f=s.top+s.height/2,d=l.left+l.width/2,Math.abs(f-a.top)>6&&Math.abs(f-a.bottom)>6||d<s.left||d>s.right)continue;r.push({x:d-n.left,y:f-n.top,targets:[{split:e,gutterIndex:o},{split:i,gutterIndex:c}]})}}let i=[];for(let e of r){let n=i.find(n=>Math.abs(n.x-e.x)<=8&&Math.abs(n.y-e.y)<=8);if(n===void 0){i.push(e);continue}for(let r of e.targets)n.targets.some(e=>e.split===r.split&&e.gutterIndex===r.gutterIndex)||n.targets.push(r)}let a=i.map(e=>`${Math.round(e.x)},${Math.round(e.y)}:${e.targets.map(e=>`${e.split.getAttribute(`data-dock-path`)??``}#${e.gutterIndex}`).join(`|`)}`).join(`;`);a!==this._junctionsKey&&(this._junctionsKey=a,this._junctions=i)}_foldLiveWeights(){let e=this.shadowRoot?.querySelectorAll(`ixfx-split-layout[data-dock-path]`);if(e!==void 0)for(let n of e){if(n.getAttribute(`data-dock-gen`)!==String(this._loadGeneration))continue;let e=n.getAttribute(`data-dock-path`);if(e===null)continue;let r=av(this._model,Fy(e));if(r===null||!Z_(r))continue;let i=Object.values(n.getSizes());i.length===r.children.length&&!Ay(i,r.sizes)&&(r.sizes=i,Array.from(n.children).forEach((e,n)=>{e instanceof HTMLElement&&r.sizes[n]!==void 0&&e.setAttribute(`size`,String(r.sizes[n]))}))}}_teardownTabDragListeners(){window.removeEventListener(`pointermove`,this._onTabDragMove),window.removeEventListener(`pointerup`,this._onTabDragUp),window.removeEventListener(`pointercancel`,this._onTabDragUp)}_suppressNextClick(){let e=n=>{n.preventDefault(),n.stopPropagation(),window.removeEventListener(`click`,e,!0)};window.addEventListener(`click`,e,!0)}_removeFromModel(e){let n=sv(this._model,e);if(n===null)return;let r=av(this._model,n);r!==null&&U(r)&&gv(r,e),nv(this._model)}_commit(){nv(this._model),this.requestUpdate(),this._emitChange()}_syncSlots(){let e=new Set,n=r=>{if(U(r))for(let n of r.panels){e.add(n);let r=this._findPanelEl(n);r!==void 0&&(r.setAttribute(`slot`,`dock-panel-${n}`),r.presentation=`tabbed`)}else r.children.forEach(n)};n(this._model);for(let n of this._pool)e.has(n.panelId)||(n.setAttribute(`slot`,``),n.presentation=`solo`)}_syncToolbars(){let e=new Map,n=r=>{if(U(r)){if(r.panels.length>0&&r.active){let n=this._findPanelEl(r.active);n!==void 0&&e.set(r.active,Iy(n))}}else r.children.forEach(n)};n(this._model);for(let[n,r]of this._toolbarsOut)e.has(n)||this._returnToolbar(n,r);for(let[n,r]of e){if(this._toolbarsOut.has(n)||r.length===0)continue;let e=this.shadowRoot?.getElementById(n);if(e!=null){for(let n of r)e.appendChild(n);this._toolbarsOut.set(n,r)}}}_returnToolbar(e,n){let r=this._findPanelEl(e);if(r!==void 0)for(let e of n)e.isConnected&&r.appendChild(e);this._toolbarsOut.delete(e)}_returnAllToolbars(){for(let[e,n]of[...this._toolbarsOut])this._returnToolbar(e,n)}_emitChange(){this.dispatchEvent(new CustomEvent(`dock-change`,{detail:{layout:this.saveLayout()},bubbles:!0,composed:!0}))}render(){return i`
|
|
6404
|
+
`]}};E([d({type:String,attribute:`panel-id`,reflect:!0})],Ey.prototype,`panelId`,void 0),E([d({type:String,attribute:`label`})],Ey.prototype,`title`,void 0),E([d({type:String,attribute:`icon-name`})],Ey.prototype,`iconName`,void 0),E([d({type:Boolean})],Ey.prototype,`closable`,void 0),E([d({type:Boolean})],Ey.prototype,`collapsible`,void 0),E([d({type:String,reflect:!0})],Ey.prototype,`kind`,void 0),E([d({type:String,attribute:`accepts`})],Ey.prototype,`accepts`,void 0),E([d({type:String,reflect:!0})],Ey.prototype,`presentation`,void 0),E([m()],Ey.prototype,`_collapsed`,void 0),Ey=E([T(`ixfx-dock-panel`)],Ey);const Dy=.25,Oy=`ixfx-tab-list-item, .ghost-tab`;let ky=class extends n{constructor(...e){super(...e),this.layout=null,this.accepts=`tabs horizontal vertical`,this.isolated=!1,this.hideSingleTabStrip=!1,this.family=``,this.acceptsKinds=null,this._model=nv([]),this._pool=[],this._dropZone=null,this._dragActive=!1,this._dragPanel=null,this._liveStacks=new Map,this._junctions=[],this._toolbarsOut=new Map,this._leafContentRules=new Map,this._tabDragPending=null,this._junctionsKey=``,this._junctionsRaf=null,this._hostResizeObserver=null,this._loadGeneration=0,this._toolbarSlots=new Set,this._toolbarObserver=null,this._panelObservers=new Map,this._onDragStart=e=>{if(e.composedPath().find(e=>e instanceof HTMLElement&&e.tagName===`IXFX-DOCK-HOST`)!==this)return;let{panelId:n,pointerId:r,clientX:i,clientY:a}=e.detail;z_(n,this,r,i,a,this._findPanelEl(n)?.kind)},this._onPoolSlotChange=()=>{this._syncPool()},this._onJunctionPointerDown=(e,n)=>{if(e.button!==0)return;e.preventDefault(),e.stopPropagation();let r=!1;for(let i of n.targets)i.split.isConnected&&i.split.beginGutterDrag(i.gutterIndex,e.pointerId,e.clientX,e.clientY)&&(r=!0);if(!r)return;this._suppressNextClick();let i=()=>this._scheduleJunctions(),a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)},this._onSplitWeightsChanged=()=>{this._foldLiveWeights(),this._scheduleJunctions()},this._onSplitCollapsed=(e,n)=>{let r=e.detail;if(!r?.id)return;let i=this.shadowRoot?.getElementById(r.id)?.getAttribute(`data-dock-path`);if(i==null)return;let a=U(this._model,zy(i));a===null||!H(a)||(n?a.collapsed=!0:delete a.collapsed)},this._onSplitClose=e=>{e.preventDefault();let n=e.detail;if(!n?.id)return;let r=this.shadowRoot?.getElementById(n.id)?.getAttribute(`data-dock-path`);if(r==null)return;let i=zy(r),a=U(this._model,i);if(a===null||!H(a))return;let o=[...a.panels];this._returnAllToolbars(),Sv(this._model,i);for(let e of o)gv(this._firstStackAllowing(this._panelKind(e)),e);this._commit()},this._onTabChange=(e,n)=>{let r=e.detail.selected,i=U(this._model,n);i===null||!H(i)||vv(i,r)&&(this.requestUpdate(),this.dispatchEvent(new CustomEvent(`dock-panel-activated`,{detail:{panelId:r},bubbles:!0,composed:!0})))},this._onStripPointerDown=e=>{if(e.button!==0)return;let n=e.composedPath();for(let e of n)if(e instanceof HTMLElement&&(e.classList.contains(`list-toolbar`)||e.classList.contains(`close-btn`)))return;let r=By(n);r!==null&&this._armPanelDrag(r.id,e)},this._onStripContextMenu=e=>{let n=By(e.composedPath());n!==null&&(this._emit(`dock-tab-contextmenu`,{panelId:n.id,clientX:e.clientX,clientY:e.clientY},!0)||e.preventDefault())},this._onTabDragMove=e=>{let n=this._tabDragPending;n!==null&&e.pointerId===n.pointerId&&(Math.hypot(e.clientX-n.startX,e.clientY-n.startY)<5||(this._tabDragPending=null,this._teardownTabDragListeners(),this._suppressNextClick(),this.dispatchEvent(new CustomEvent(`dock-panel-drag-start`,{detail:{panelId:n.panelId,pointerId:n.pointerId,clientX:e.clientX,clientY:e.clientY},bubbles:!0,composed:!0}))))},this._onTabDragUp=e=>{this._tabDragPending!==null&&e.pointerId===this._tabDragPending.pointerId&&(this._tabDragPending=null,this._teardownTabDragListeners())}}connectedCallback(){super.connectedCallback(),this._buildInitialModel(),this._liveStacks=Fv(this._model),L_(this),this.addEventListener(`dock-panel-drag-start`,this._onDragStart),this._hostResizeObserver=new ResizeObserver(()=>this._scheduleJunctions()),this._hostResizeObserver.observe(this),this._scanToolbarSlots(),this._toolbarObserver=new MutationObserver(()=>this._scanToolbarSlots()),this._toolbarObserver.observe(this,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`slot`]})}disconnectedCallback(){super.disconnectedCallback(),R_(this),this.removeEventListener(`dock-panel-drag-start`,this._onDragStart),this._toolbarObserver?.disconnect(),this._toolbarObserver=null,this._hostResizeObserver?.disconnect(),this._hostResizeObserver=null;for(let e of this._panelObservers.values())e.disconnect();this._panelObservers.clear(),this._junctionsRaf!==null&&(cancelAnimationFrame(this._junctionsRaf),this._junctionsRaf=null),this._junctions=[],this._junctionsKey=``,this._returnAllToolbars()}willUpdate(e){if(super.willUpdate(e),e.has(`layout`)&&this.layout!==null){let e=Pv(this.layout);e&&(this._model=e.root,this._mergePoolIntoModel(),this._liveStacks=Fv(this._model))}this._returnToolbarsOfHiddenStrips()}_returnToolbarsOfHiddenStrips(){for(let[e,n]of[...this._toolbarsOut]){let r=cv(this._model,e),i=r===null?null:U(this._model,r);(i===null||!H(i)||this._stripHidden(i))&&this._returnToolbar(e,n)}}_stripHidden(e){return e.panels.length===1&&(e.hideSingleTabStrip??this.hideSingleTabStrip)}updated(e){super.updated(e),this._syncSlots(),this._syncToolbars(),this._scheduleJunctions()}_buildInitialModel(){if(this.layout!==null){let e=Pv(this.layout);if(e){this._model=e.root,this._mergePoolIntoModel();return}}this._model=nv([]),this._mergePoolIntoModel()}_mergePoolIntoModel(){let e=new Set(uv(this._model)),n=!1;for(let r of this._scanPanels())e.has(r.panelId)||(this._appendPanelToFirstStack(r.panelId),e.add(r.panelId),n=!0);n&&iv(this._model)}_scanPanels(){return Array.from(this.children).filter(e=>e instanceof HTMLElement&&e.tagName===`IXFX-DOCK-PANEL`&&!!e.panelId)}_scanToolbarSlots(){let e=new Set;for(let n of this.children){if(!(n instanceof HTMLElement))continue;let r=n.getAttribute(`slot`)??``;r.startsWith(`toolbar-`)&&r.length>8&&e.add(r)}(e.size!==this._toolbarSlots.size||[...e].some(e=>!this._toolbarSlots.has(e)))&&(this._toolbarSlots=e,this.requestUpdate())}_findPanelEl(e){return this._pool.find(n=>n.panelId===e)??this._scanPanels().find(n=>n.panelId===e)}_firstStack(){let e=mv(this._model),n=e.length>0?U(this._model,e[0]):null;if(n!==null&&H(n))return n;let r=nv([]);return bv(this._model,`row`,r,`after`),iv(this._model),r}_appendPanelToFirstStack(e){let n=this._panelKind(e);if(this._model.kind===`stack`&&this._stackAllowsKind(this._model,n)){gv(this._model,e);return}gv(this._firstStackAllowing(n),e)}_panelKind(e){return Ry(this._findPanelEl(e)?.kind)}_stackAllowsKind(e,n){if(e.name===void 0)return!0;let r=this._leafContentRules.get(e.name);return r===void 0?!0:r.deny.has(n)?!1:r.allow===null||r.allow.has(n)}_leafAllowsEdgeSplit(e){return e.name===void 0?!0:this._leafContentRules.get(e.name)?.allowEdgeSplit??!0}_firstStackAllowing(e){for(let n of mv(this._model)){let r=U(this._model,n);if(r!==null&&H(r)&&this._stackAllowsKind(r,e))return r}return console.warn(`[ixfx-dock-host] no leaf admits kind "${e}", using first stack`),this._firstStack()}_observePanel(e){if(this._panelObservers.has(e.panelId))return;let n=new MutationObserver(()=>this.requestUpdate());n.observe(e,{attributes:!0,attributeFilter:[`label`,`icon-name`,`closable`,`collapsible`,`kind`,`accepts`]}),this._panelObservers.set(e.panelId,n)}_unobservePanel(e){let n=this._panelObservers.get(e.panelId);n&&(n.disconnect(),this._panelObservers.delete(e.panelId))}_syncPool(){let e=this._scanPanels(),n=new Set(e.map(e=>e.panelId)),r=!1;for(let e of[...this._pool])n.has(e.panelId)||(this._unobservePanel(e),this._toolbarsOut.delete(e.panelId),this._removeFromModel(e.panelId),this._emitRemoved(e.panelId),r=!0);for(let n of e)this._observePanel(n),uv(this._model).includes(n.panelId)||(this._appendPanelToFirstStack(n.panelId),iv(this._model),this._emitAdded(n.panelId),r=!0);this._pool=e,this.requestUpdate(),r&&this._emitChange()}saveLayout(){return this._foldLiveWeights(),Mv(this._model)}loadLayout(e){this._returnAllToolbars(),this._loadGeneration++,this._model=iv(Ly(e.root)),this._mergePoolIntoModel(),this._liveStacks=Fv(this._model),this.requestUpdate(),this._emitChange()}addPanel(e,n){let r=(e instanceof HTMLElement,Ry(e.kind)),i=n?.op??`tabs`,a=null,o=null;if(n?.container!==void 0){let e=dv(this._model,n.container);if(e===null)console.warn(`[ixfx-dock-host] addPanel: unknown container "${n.container}", appending to first admitting stack`);else if(i===`tabs`&&!this._stackAllowsKindAt(e,r))return console.warn(`[ixfx-dock-host] addPanel: container "${n.container}" does not admit kind "${r}"`),!1;else if(i!==`tabs`&&!this._stackAllowsEdgeSplitAt(e))return console.warn(`[ixfx-dock-host] addPanel: container "${n.container}" forbids edge splits (allowEdgeSplit: false)`),!1;else a=e}else if(n?.stack){let e=cv(this._model,n.stack);if(e===null)console.warn(`[ixfx-dock-host] addPanel: unknown stack panel "${n.stack}", appending to first admitting stack`);else if(i===`tabs`&&!this._stackAllowsKindAt(e,r))return console.warn(`[ixfx-dock-host] addPanel: target stack does not admit kind "${r}"`),!1;else if(i!==`tabs`&&!this._stackAllowsEdgeSplitAt(e))return console.warn(`[ixfx-dock-host] addPanel: target stack forbids edge splits (allowEdgeSplit: false)`),!1;else a=e}a!==null&&i!==`tabs`&&(o=a,a=null);let s;if(e instanceof HTMLElement?s=e:(s=document.createElement(`ixfx-dock-panel`),s.panelId=e.panelId,e.title!==void 0&&(s.title=e.title),e.iconName!==void 0&&(s.iconName=e.iconName),e.closable!==void 0&&(s.closable=e.closable),e.collapsible!==void 0&&(s.collapsible=e.collapsible),e.kind!==void 0&&(s.kind=e.kind)),s.parentElement!==this&&this.appendChild(s),this._pool.some(e=>e.panelId===s.panelId)||(this._pool=[...this._pool,s]),this._returnAllToolbars(),uv(this._model).includes(s.panelId)&&this._removeFromModel(s.panelId),o!==null)yv(this._model,o,Ay(i),nv([s.panelId]),`after`);else if(a!==null){let e=U(this._model,a);e!==null&&H(e)&&gv(e,s.panelId,n?.index)}else this._appendPanelToFirstStack(s.panelId);return iv(this._model),this.requestUpdate(),this._emitAdded(s.panelId),this._emitChange(),!0}_stackAllowsKindAt(e,n){let r=U(this._model,e);return r!==null&&H(r)&&this._stackAllowsKind(r,n)}_stackAllowsEdgeSplitAt(e){let n=U(this._model,e);return n===null||!H(n)||this._leafAllowsEdgeSplit(n)}removePanel(e){return uv(this._model).includes(e)?(this._returnAllToolbars(),this._removeFromModel(e),this._pool=this._pool.filter(n=>n.panelId!==e),this._toolbarsOut.delete(e),this._scanPanels().find(n=>n.panelId===e)?.remove(),iv(this._model),this.requestUpdate(),this._emitRemoved(e),this._emitChange(),!0):!1}activatePanel(e){let n=cv(this._model,e);if(n===null)return!1;let r=U(this._model,n);return r===null||!H(r)||!vv(r,e)?!1:(this.requestUpdate(),this.dispatchEvent(new CustomEvent(`dock-panel-activated`,{detail:{panelId:e},bubbles:!0,composed:!0})),!0)}getPanelIds(){return uv(this._model)}getContainerNames(){return pv(this._model)}getContainer(e){let n=dv(this._model,e);if(n===null)return null;let r=U(this._model,n);return r===null||!H(r)||r.name===void 0?null:{name:r.name,panels:[...r.panels],active:r.active}}getContainerPanels(e){return this.getContainer(e)?.panels??[]}getContainerElements(e){return this.getContainerPanels(e).map(e=>this._findPanelEl(e)).filter(e=>e!==void 0)}_defaultLeafRule(){return{allow:null,deny:new Set,allowEdgeSplit:!0}}_isEmptyLeafRule(e){return e.allow===null&&e.deny.size===0&&e.allowEdgeSplit}_warnUnknownContainer(e,n){dv(this._model,n)===null&&console.warn(`[ixfx-dock-host] ${e}: no container named "${n}" yet; rule stored`)}setLeafExclusiveContents(e,n){let r=e.trim();if(!r){console.warn(`[ixfx-dock-host] setLeafExclusiveContents: empty container name`);return}let i=this._leafContentRules.get(r)??this._defaultLeafRule();i.allow=new Set(n.map(e=>e.trim()).filter(e=>e.length>0)),this._leafContentRules.set(r,i),this._warnUnknownContainer(`setLeafExclusiveContents`,r)}setLeafDenyContents(e,n){let r=e.trim();if(!r){console.warn(`[ixfx-dock-host] setLeafDenyContents: empty container name`);return}let i=this._leafContentRules.get(r)??this._defaultLeafRule();i.deny=new Set(n.map(e=>e.trim()).filter(e=>e.length>0)),this._isEmptyLeafRule(i)?this._leafContentRules.delete(r):this._leafContentRules.set(r,i),this._warnUnknownContainer(`setLeafDenyContents`,r)}setLeafPlacementPolicy(e,n){let r=e.trim();if(!r){console.warn(`[ixfx-dock-host] setLeafPlacementPolicy: empty container name`);return}let i=this._leafContentRules.get(r)??this._defaultLeafRule();n.allowKinds!==void 0&&(i.allow=new Set(n.allowKinds.map(e=>e.trim()).filter(e=>e.length>0))),n.denyKinds!==void 0&&(i.deny=new Set(n.denyKinds.map(e=>e.trim()).filter(e=>e.length>0))),n.allowEdgeSplit!==void 0&&(i.allowEdgeSplit=n.allowEdgeSplit),this._isEmptyLeafRule(i)?this._leafContentRules.delete(r):this._leafContentRules.set(r,i),this._warnUnknownContainer(`setLeafPlacementPolicy`,r)}clearLeafContentRestrictions(e){this._leafContentRules.delete(e.trim())}clearLeafPlacementPolicy(e){this._leafContentRules.delete(e.trim())}getLeafContentRestrictions(e){let n=this._leafContentRules.get(e.trim());return n===void 0?null:{allow:n.allow===null?null:[...n.allow],deny:[...n.deny]}}getLeafPlacementPolicy(e){let n=this._leafContentRules.get(e.trim());return n===void 0?null:{allowKinds:n.allow===null?null:[...n.allow],denyKinds:[...n.deny],allowEdgeSplit:n.allowEdgeSplit}}getNeighbours(e){return Ov(this._model,e)}moveLeaf(e,n){return Av(this._model,e,n)?(this._commit(),!0):!1}moveLeafToEdge(e,n){return jv(this._model,e,n)?(this._commit(),!0):!1}getPanelSnapshot(e){let n=this._findPanelEl(e);return n===void 0?null:{panelId:n.panelId,title:n.title,iconName:n.iconName,closable:n.closable,collapsible:n.collapsible,kind:Ry(n.kind),accepts:n.accepts,contentHTML:n.innerHTML}}detachPanel(e){let n=this.getPanelSnapshot(e);return n===null?null:(this.removePanel(e),n)}queryDropTarget(e,n,r=`__external__`,i){let a=this.computeDropZone(e,n,r,i);return a===null?null:Iy(a)}previewExternalDrop(e,n,r=`__external__`,i){this.setDragActive(!0,{panelId:r,kind:i});let a=this.computeDropZone(e,n,r,i);return this.setDropZone(a),a===null?null:Iy(a)}endExternalDrop(){this.setDropZone(null),this.setDragActive(!1)}acceptExternalPanel(e,n){if(uv(this._model).includes(e.panelId)||this.acceptsKinds!==null&&!this.acceptsKinds.includes(Ry(e.kind)))return null;let r=document.createElement(`ixfx-dock-panel`);r.panelId=e.panelId,e.title!==void 0&&(r.title=e.title),e.iconName!==void 0&&(r.iconName=e.iconName),e.closable!==void 0&&(r.closable=e.closable),e.collapsible!==void 0&&(r.collapsible=e.collapsible),`kind`in e&&e.kind!==void 0&&(r.kind=e.kind),`accepts`in e&&e.accepts&&r.setAttribute(`accepts`,e.accepts),`contentHTML`in e&&e.contentHTML&&(r.innerHTML=e.contentHTML),this._returnAllToolbars(),this._pool=[...this._pool,r],this._appendPanelToFirstStack(r.panelId),this.appendChild(r),iv(this._model),this.endExternalDrop();let i=n?this.computeDropZone(n.clientX,n.clientY,r.panelId):null;return i!==null&&this._applyZone(r.panelId,i),iv(this._model),this.requestUpdate(),this._emitAdded(r.panelId),this._emitChange(),r}computeDropZone(e,n,r,i){let a=this.getBoundingClientRect();if(e<a.left||e>a.right||n<a.top||n>a.bottom)return null;let o=i?.trim()?i.trim():this._panelKind(r),s=e=>({x:e.left-a.left,y:e.top-a.top,w:e.width,h:e.height}),c=My(this.accepts,`horizontal`)||My(this.accepts,`vertical`);for(let i of mv(this._model)){let l=this.shadowRoot?.querySelector(`[data-dock-path="${i.join(`-`)}"]`);if(!l)continue;let u=l.getBoundingClientRect();if(e<u.left||e>u.right||n<u.top||n>u.bottom)continue;let d=U(this._model,i);if(d===null||!H(d))continue;let f=l.querySelector(`ixfx-tab-list`)??l.querySelector(`.ghost-strip`);if(f!==null){let c=f.getBoundingClientRect();if(e>=c.left&&e<=c.right&&n>=c.top&&n<=c.bottom){let c=Hy(f,e,n),l={host:this,operation:`tabs`,targetPath:i,side:`after`,gapIndex:c,rect:s(u),caretRect:this._stripCaretRect(f,c,a)};return this._zoneAllowed(r,l,o)?l:null}}let p=(e-u.left)/Math.max(u.width,1),m=(n-u.top)/Math.max(u.height,1);if(!c||p>=Dy&&p<=.75&&m>=Dy&&m<=.75){let e={host:this,operation:`tabs`,targetPath:i,side:`after`,gapIndex:d.panels.length,rect:s(u)};return this._zoneAllowed(r,e,o)?e:null}let h=s(u),g,_,v;p<Dy?(g=`split-vertical`,_=`before`,v={...h,w:h.w/2}):p>.75?(g=`split-vertical`,_=`after`,v={x:h.x+h.w/2,y:h.y,w:h.w/2,h:h.h}):m<Dy?(g=`split-horizontal`,_=`before`,v={...h,h:h.h/2}):(g=`split-horizontal`,_=`after`,v={x:h.x,y:h.y+h.h/2,w:h.w,h:h.h/2});let y={host:this,operation:g,targetPath:i,side:_,rect:v};return this._zoneAllowed(r,y,o)?y:null}let l=e-a.left,u=a.right-e,d=n-a.top,f=a.bottom-n,p=Math.min(l,u,d,f),m={x:0,y:0,w:a.width,h:a.height},h,g,_;p===l?(h=`split-vertical`,g=`before`,_={...m,w:m.w/2}):p===u?(h=`split-vertical`,g=`after`,_={x:m.x+m.w/2,y:m.y,w:m.w/2,h:m.h}):p===d?(h=`split-horizontal`,g=`before`,_={...m,h:m.h/2}):(h=`split-horizontal`,g=`after`,_={x:m.x,y:m.y+m.h/2,w:m.w,h:m.h/2});let v={host:this,operation:h,targetPath:[],side:g,rect:_};return this._zoneAllowed(r,v,o)?v:null}_zoneAllowed(e,n,r){if(this.acceptsKinds!==null&&!uv(this._model).includes(e)&&!this.acceptsKinds.includes(Ry(r))||!My(this.accepts,jy(n.operation)))return!1;let i=U(this._model,n.targetPath);if(i!==null&&H(i)&&i.panels.length===1){let e=this._findPanelEl(i.panels[0]);if(e&&!Ny(e.accepts,jy(n.operation)))return!1}return!(n.operation===`tabs`&&i!==null&&H(i)&&!this._stackAllowsKind(i,r?.trim()?r.trim():this._panelKind(e))||n.operation!==`tabs`&&i!==null&&H(i)&&!this._leafAllowsEdgeSplit(i)||this.canAccept&&!this.canAccept(e,n.operation))}handleDrop(e,n,r){if(r!==void 0&&r!==this&&r.releasePanel(e,this),!uv(this._model).includes(e)){if(!this._findPanelEl(e))return;this._appendPanelToFirstStack(e),iv(this._model)}this._applyZone(e,n,r===void 0||r===this),this._commit(),r!==void 0&&r!==this&&this._emit(`dock-panel-moved`,{panelId:e,sourceHost:r,targetHost:this})}_applyZone(e,n,r=!1){let i=cv(this._model,e),a=null;if(i!==null){let n=U(this._model,i);n!==null&&H(n)&&(_v(n,e),n.panels.length===0&&(a=n))}if(n.operation===`tabs`){let i=U(this._model,n.targetPath);i!==null&&H(i)&&(gv(i,e,n.gapIndex),r&&a!==null&&a!==i&&a.name!==void 0&&i.name===void 0&&(i.name=a.name,delete a.name))}else yv(this._model,n.targetPath,Ay(n.operation),nv([e]),n.side)}releasePanel(e,n){this._returnAllToolbars();let r=this._pool.find(n=>n.panelId===e),i=cv(this._model,e);if(i!==null){let n=U(this._model,i);n!==null&&H(n)&&_v(n,e)}iv(this._model),this._pool=this._pool.filter(e=>e!==r),this._toolbarsOut.delete(e),this._emitRemoved(e,n),r!==void 0&&n.adoptPanelElement(r,this),this.requestUpdate(),this._emitChange()}adoptPanelElement(e,n=null){this._pool.some(n=>n.panelId===e.panelId)||(this._pool=[...this._pool,e]),uv(this._model).includes(e.panelId)||this._appendPanelToFirstStack(e.panelId),this.appendChild(e),iv(this._model),this._emitAdded(e.panelId,n)}setDragActive(e,n){let r=e&&n!==void 0?n:null;this._dragActive!==e&&(this._dragActive=e,this.requestUpdate()),(this._dragPanel?.panelId!==r?.panelId||this._dragPanel?.kind!==r?.kind)&&(this._dragPanel=r)}setDropZone(e){this._dropZone!==e&&(this._dropZone=e,this.requestUpdate())}_scheduleJunctions(){this._junctionsRaf===null&&(this._junctionsRaf=requestAnimationFrame(()=>{this._junctionsRaf=null,this._computeJunctions()}))}_computeJunctions(){let e=this.shadowRoot;if(e===null)return;let n=this.getBoundingClientRect(),r=[];for(let i of e.querySelectorAll(`ixfx-split-layout`)){let e=i.parentElement?.closest(`ixfx-split-layout`)??null;if(e===null||typeof i.getGutterRects!=`function`||typeof e.getGutterRects!=`function`)continue;let a=i.getBoundingClientRect();for(let[o,s]of e.getGutterRects().entries())for(let[c,l]of i.getGutterRects().entries()){let u=s.width<=s.height;if(u===l.width<=l.height)continue;let d,f;if(u){if(d=s.left+s.width/2,f=l.top+l.height/2,Math.abs(d-a.left)>6&&Math.abs(d-a.right)>6||f<s.top||f>s.bottom)continue}else if(f=s.top+s.height/2,d=l.left+l.width/2,Math.abs(f-a.top)>6&&Math.abs(f-a.bottom)>6||d<s.left||d>s.right)continue;r.push({x:d-n.left,y:f-n.top,targets:[{split:e,gutterIndex:o},{split:i,gutterIndex:c}]})}}let i=[];for(let e of r){let n=i.find(n=>Math.abs(n.x-e.x)<=8&&Math.abs(n.y-e.y)<=8);if(n===void 0){i.push(e);continue}for(let r of e.targets)n.targets.some(e=>e.split===r.split&&e.gutterIndex===r.gutterIndex)||n.targets.push(r)}let a=i.map(e=>`${Math.round(e.x)},${Math.round(e.y)}:${e.targets.map(e=>`${e.split.getAttribute(`data-dock-path`)??``}#${e.gutterIndex}`).join(`|`)}`).join(`;`);a!==this._junctionsKey&&(this._junctionsKey=a,this._junctions=i)}_foldLiveWeights(){let e=this.shadowRoot?.querySelectorAll(`ixfx-split-layout[data-dock-path]`);if(e!==void 0)for(let n of e){if(n.getAttribute(`data-dock-gen`)!==String(this._loadGeneration))continue;let e=n.getAttribute(`data-dock-path`);if(e===null)continue;let r=U(this._model,zy(e));if(r===null||!$_(r))continue;let i=Object.values(n.getSizes());i.length===r.children.length&&!Py(i,r.sizes)&&(r.sizes=i,Array.from(n.children).forEach((e,n)=>{e instanceof HTMLElement&&r.sizes[n]!==void 0&&e.setAttribute(`size`,String(r.sizes[n]))}))}}beginPanelDrag(e,n){return n.button!==0||!uv(this._model).includes(e)?!1:(this._armPanelDrag(e,n),!0)}_armPanelDrag(e,n){this._tabDragPending={panelId:e,pointerId:n.pointerId,startX:n.clientX,startY:n.clientY},window.addEventListener(`pointermove`,this._onTabDragMove),window.addEventListener(`pointerup`,this._onTabDragUp),window.addEventListener(`pointercancel`,this._onTabDragUp)}_teardownTabDragListeners(){window.removeEventListener(`pointermove`,this._onTabDragMove),window.removeEventListener(`pointerup`,this._onTabDragUp),window.removeEventListener(`pointercancel`,this._onTabDragUp)}_suppressNextClick(){let e=n=>{n.preventDefault(),n.stopPropagation(),window.removeEventListener(`click`,e,!0)};window.addEventListener(`click`,e,!0)}_removeFromModel(e){let n=cv(this._model,e);if(n===null)return;let r=U(this._model,n);r!==null&&H(r)&&_v(r,e),iv(this._model)}_commit(){iv(this._model),this.requestUpdate(),this._emitChange()}_syncSlots(){let e=new Set,n=r=>{if(H(r))for(let n of r.panels){e.add(n);let r=this._findPanelEl(n);r!==void 0&&(r.setAttribute(`slot`,`dock-panel-${n}`),r.presentation=`tabbed`)}else r.children.forEach(n)};n(this._model);for(let n of this._pool)e.has(n.panelId)||(n.setAttribute(`slot`,``),n.presentation=`solo`)}_syncToolbars(){let e=new Map,n=r=>{if(H(r)){if(r.panels.length>0&&r.active){let n=this._findPanelEl(r.active);n!==void 0&&e.set(r.active,Vy(n))}}else r.children.forEach(n)};n(this._model);for(let[n,r]of this._toolbarsOut)e.has(n)||this._returnToolbar(n,r);for(let[n,r]of e){if(this._toolbarsOut.has(n)||r.length===0)continue;let e=this.shadowRoot?.getElementById(n);if(e!=null){for(let n of r)e.appendChild(n);this._toolbarsOut.set(n,r)}}}_returnToolbar(e,n){let r=this._findPanelEl(e);if(r!==void 0)for(let e of n)e.isConnected&&r.appendChild(e);this._toolbarsOut.delete(e)}_returnAllToolbars(){for(let[e,n]of[...this._toolbarsOut])this._returnToolbar(e,n)}_emit(e,n,r=!1){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:r}))}_emitAdded(e,n=null){this._emit(`dock-panel-added`,{panelId:e,sourceHost:n,targetHost:this})}_emitRemoved(e,n=null){this._emit(`dock-panel-removed`,{panelId:e,sourceHost:this,targetHost:n})}_announceEmptiedStacks(){let e=Fv(this._model),n=Iv(this._liveStacks,e);this._liveStacks=e;for(let r of n)this._emit(`dock-stack-empty`,{name:r.name??null,hostEmpty:e.size===0})}_emitChange(){let e=this.saveLayout();this._announceEmptiedStacks(),this._emit(`dock-change`,{layout:e})}render(){return i`
|
|
6404
6405
|
<div class="root">
|
|
6405
6406
|
${this._renderNode(this._model,[])}
|
|
6406
6407
|
</div>
|
|
6407
6408
|
<div class="overlay" ?hidden=${!this._dragActive}>
|
|
6408
6409
|
${this._dropZone===null?a:i`
|
|
6409
|
-
<div class="zone-rect" style=${
|
|
6410
|
-
${this._dropZone.caretRect===void 0?a:i`<div class="zone-caret" style=${
|
|
6410
|
+
<div class="zone-rect" style=${Fy(this._dropZone.rect)}></div>
|
|
6411
|
+
${this._dropZone.caretRect===void 0?a:i`<div class="zone-caret" style=${Fy(this._dropZone.caretRect)}></div>`}
|
|
6411
6412
|
`}
|
|
6412
6413
|
</div>
|
|
6413
6414
|
<div class="junctions" ?hidden=${this._dragActive}>
|
|
@@ -6422,7 +6423,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6422
6423
|
`)}
|
|
6423
6424
|
</div>
|
|
6424
6425
|
<slot @slotchange=${this._onPoolSlotChange}></slot>
|
|
6425
|
-
`}_renderNode(e,n,r){return
|
|
6426
|
+
`}_renderNode(e,n,r){return H(e)?this._renderLeaf(e,n,r):this._renderSplit(e,n,r)}_renderSplit(e,n,r){let o=n.join(`-`);return i`
|
|
6426
6427
|
<ixfx-split-layout
|
|
6427
6428
|
class="split"
|
|
6428
6429
|
direction=${e.direction}
|
|
@@ -6453,7 +6454,12 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6453
6454
|
<div class="empty" part="empty">
|
|
6454
6455
|
<slot name="empty"><span>Drop panels here</span></slot>
|
|
6455
6456
|
</div>
|
|
6456
|
-
`);let l=e.name!==void 0&&this._toolbarSlots.has(`toolbar-${e.name}`)?i`<slot name="toolbar-${e.name}" slot="toolbar"></slot>`:a;return c(i`
|
|
6457
|
+
`);let l=e.name!==void 0&&this._toolbarSlots.has(`toolbar-${e.name}`)?i`<slot name="toolbar-${e.name}" slot="toolbar"></slot>`:a;return this._stripHidden(e)?c(i`
|
|
6458
|
+
${this._renderDropHint(e,n)}
|
|
6459
|
+
<div class="leaf-body">
|
|
6460
|
+
<slot name="dock-panel-${e.active}"></slot>
|
|
6461
|
+
</div>
|
|
6462
|
+
`):c(i`
|
|
6457
6463
|
<ixfx-tab-list
|
|
6458
6464
|
class="strip"
|
|
6459
6465
|
orientation="horizontal"
|
|
@@ -6462,6 +6468,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6462
6468
|
?hide-labels=${e.hideLabels===!0}
|
|
6463
6469
|
@change=${e=>this._onTabChange(e,n)}
|
|
6464
6470
|
@pointerdown=${this._onStripPointerDown}
|
|
6471
|
+
@contextmenu=${this._onStripContextMenu}
|
|
6465
6472
|
>
|
|
6466
6473
|
${_(e.panels,e=>e,n=>this._renderTabItem(e,n))}
|
|
6467
6474
|
${l}
|
|
@@ -6469,7 +6476,11 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6469
6476
|
<div class="leaf-body">
|
|
6470
6477
|
<slot name="dock-panel-${e.active}"></slot>
|
|
6471
6478
|
</div>
|
|
6472
|
-
`)}
|
|
6479
|
+
`)}_renderDropHint(e,n){let r=this._dragPanel;if(!this._dragActive||r===null||e.panels[0]===r.panelId)return a;let o={host:this,operation:`tabs`,targetPath:n,side:`after`,rect:{x:0,y:0,w:0,h:0}};if(!this._zoneAllowed(r.panelId,o,r.kind))return a;let s=e.panels[0];return i`
|
|
6480
|
+
<div class="ghost-strip" part="drop-hint">
|
|
6481
|
+
<span class="ghost-tab">${this._findPanelEl(s)?.title||s}</span>
|
|
6482
|
+
</div>
|
|
6483
|
+
`}_renderTabItem(e,n){let r=this._findPanelEl(n);return i`
|
|
6473
6484
|
<ixfx-tab-list-item
|
|
6474
6485
|
id=${n}
|
|
6475
6486
|
?selected=${n===e.active}
|
|
@@ -6477,7 +6488,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6477
6488
|
.closeable=${r?.closable??!1}
|
|
6478
6489
|
@close=${()=>this.removePanel(n)}
|
|
6479
6490
|
>${r?.title??n}</ixfx-tab-list-item>
|
|
6480
|
-
`}_stripCaretRect(e,n,r){let i=Array.from(e.querySelectorAll(
|
|
6491
|
+
`}_stripCaretRect(e,n,r){let i=Array.from(e.querySelectorAll(Oy));if(i.length===0)return;let a=Math.max(0,Math.min(n??i.length,i.length)),o=a<i.length?i[a].getBoundingClientRect().left:i[i.length-1].getBoundingClientRect().right,s=e.getBoundingClientRect();return{x:o-r.left-1,y:s.top-r.top,w:2,h:s.height}}static{this.styles=[w,Xt,r`
|
|
6481
6492
|
:host {
|
|
6482
6493
|
display: block;
|
|
6483
6494
|
width: 100%;
|
|
@@ -6508,6 +6519,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6508
6519
|
min-height: 0;
|
|
6509
6520
|
box-sizing: border-box;
|
|
6510
6521
|
overflow: hidden;
|
|
6522
|
+
position: relative;
|
|
6511
6523
|
border: 1px solid var(--surface-4);
|
|
6512
6524
|
border-radius: var(--radius-m);
|
|
6513
6525
|
}
|
|
@@ -6545,6 +6557,32 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6545
6557
|
padding-right: var(--space-xs);
|
|
6546
6558
|
}
|
|
6547
6559
|
|
|
6560
|
+
/* Drop hint over a hidden strip: overlaid, so it reserves no height. */
|
|
6561
|
+
.ghost-strip {
|
|
6562
|
+
position: absolute;
|
|
6563
|
+
inset: 0 0 auto 0;
|
|
6564
|
+
height: var(--dock-tab-height, 30px);
|
|
6565
|
+
z-index: 1;
|
|
6566
|
+
display: flex;
|
|
6567
|
+
align-items: center;
|
|
6568
|
+
box-sizing: border-box;
|
|
6569
|
+
padding: 0 var(--space-s);
|
|
6570
|
+
background: var(--surface-3);
|
|
6571
|
+
border-bottom: 1px solid var(--surface-4);
|
|
6572
|
+
color: var(--surface-3-text);
|
|
6573
|
+
font-size: var(--text-m);
|
|
6574
|
+
pointer-events: none;
|
|
6575
|
+
}
|
|
6576
|
+
|
|
6577
|
+
.ghost-tab {
|
|
6578
|
+
overflow: hidden;
|
|
6579
|
+
text-overflow: ellipsis;
|
|
6580
|
+
white-space: nowrap;
|
|
6581
|
+
text-decoration: underline;
|
|
6582
|
+
text-decoration-thickness: 2px;
|
|
6583
|
+
text-underline-offset: 4px;
|
|
6584
|
+
}
|
|
6585
|
+
|
|
6548
6586
|
.leaf-body {
|
|
6549
6587
|
flex: 1;
|
|
6550
6588
|
min-height: 0;
|
|
@@ -6620,7 +6658,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6620
6658
|
slot:not([name]) {
|
|
6621
6659
|
display: none;
|
|
6622
6660
|
}
|
|
6623
|
-
`]}};E([d({type:String,attribute:`layout`})],
|
|
6661
|
+
`]}};E([d({type:String,attribute:`layout`})],ky.prototype,`layout`,void 0),E([d({type:String,attribute:`accepts`})],ky.prototype,`accepts`,void 0),E([d({type:Boolean,attribute:`isolated`})],ky.prototype,`isolated`,void 0),E([d({type:Boolean,attribute:`hide-single-tab-strip`})],ky.prototype,`hideSingleTabStrip`,void 0),E([d({type:String,attribute:`family`})],ky.prototype,`family`,void 0),E([d({attribute:`accepts-kinds`,converter:{fromAttribute:e=>e===null?null:e.split(/\s+/).filter(e=>e.length>0)}})],ky.prototype,`acceptsKinds`,void 0),E([d({attribute:!1})],ky.prototype,`canAccept`,void 0),E([m()],ky.prototype,`_model`,void 0),E([m()],ky.prototype,`_pool`,void 0),E([m()],ky.prototype,`_dropZone`,void 0),E([m()],ky.prototype,`_dragActive`,void 0),E([m()],ky.prototype,`_dragPanel`,void 0),E([m()],ky.prototype,`_junctions`,void 0),ky=E([T(`ixfx-dock-host`)],ky);function Ay(e){return e===`split-horizontal`?`column`:`row`}function jy(e){return e===`tabs`?`tabs`:e===`split-horizontal`?`horizontal`:`vertical`}function My(e,n){let r=e.trim().split(/\s+/).filter(e=>e.length>0);return r.length===0||r.length===1&&r[0]===`none`?!1:r.includes(`all`)||r.includes(n)}function Ny(e,n){let r=e.trim().split(/\s+/).filter(e=>e.length>0);return r.length===0?!0:r.length===1&&r[0]===`none`?!1:r.includes(`all`)||r.includes(n)}function Py(e,n){return e.length===n.length&&e.every((e,r)=>Math.abs(e-n[r])<1e-4)}function Fy(e){return`left:${e.x}px; top:${e.y}px; width:${e.w}px; height:${e.h}px;`}function Iy(e){return{operation:e.operation,targetPath:[...e.targetPath],side:e.side,...e.gapIndex===void 0?{}:{gapIndex:e.gapIndex}}}function Ly(e){return JSON.parse(JSON.stringify(e))}function Ry(e){return(e?.trim()??``)||`any`}function zy(e){return e.length===0?[]:e.split(`-`).filter(e=>e.length>0).map(Number)}function By(e){let n=e.find(e=>e instanceof HTMLElement&&e.tagName===`IXFX-TAB-LIST-ITEM`);return n!==void 0&&n.id?n:null}function Vy(e){return Array.from(e.children).filter(e=>e instanceof HTMLElement&&e.getAttribute(`slot`)===`toolbar`)}function Hy(e,n,r){let i=Array.from(e.querySelectorAll(Oy));if(i.length===0)return 0;for(let e=0;e<i.length;e++){let r=i[e].getBoundingClientRect();if(n<(r.left+r.right)/2)return e}return i.length}let Uy=class extends n{constructor(...e){super(...e),this.mode=`label`,this.entryMode=`free`,this.value=``,this.disabled=!1,this.placeholder=``,this.displayTextLogic=`hidden`,this.appearDelay=50,this.disappearDelay=1e3,this._editing=!1,this._prevValue=``,this._hovering=!1,this._transientShowingValue=!1,this._transientTimer=void 0,this._showModeWaitingToHide=!1,this._onMouseEnter=()=>{this.displayTextLogic===`transient`&&(this._hovering=!0,this._clearTransientTimer(),this._transientTimer=window.setTimeout(()=>{this._transientShowingValue=!0,this._requestDisplayUpdate()},this.appearDelay))},this._onMouseLeave=()=>{this.displayTextLogic===`transient`&&(this._hovering=!1,this._startTransientRevertTimer())},this._handleClick=()=>{this.mode===`label`&&!this.disabled&&!this._editing&&this._beginEdit()},this._handleFocus=()=>{this.mode===`editor`&&!this.disabled&&!this._editing&&this._beginEdit()},this._handleBlur=()=>{this._editing&&this._tryCommit()},this._handleKeydown=e=>{this._editing&&(e.key===`Enter`?(e.preventDefault(),this._tryCommit(),this.mode===`editor`&&this._contentEl?.blur()):e.key===`Escape`&&(e.preventDefault(),this._cancelEdit(),this.mode===`editor`&&this._contentEl?.blur()))},this._handleBeforeInput=e=>{e.inputType!==`insertText`||!e.data||this._isAllowedInput(e.data)||e.preventDefault()},this._handleInput=()=>{if(!this._editing)return;let e=this._contentEl?.textContent?.trim()??``;this.dispatchEvent(new CustomEvent(`input`,{detail:{value:e},bubbles:!0,composed:!0}))}}get _contentEl(){return this.renderRoot?.querySelector(`.content`)??void 0}connectedCallback(){super.connectedCallback(),this.addEventListener(`mouseenter`,this._onMouseEnter),this.addEventListener(`mouseleave`,this._onMouseLeave)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`mouseenter`,this._onMouseEnter),this.removeEventListener(`mouseleave`,this._onMouseLeave),this._clearTransientTimer()}_clearTransientTimer(){this._transientTimer!==void 0&&(clearTimeout(this._transientTimer),this._transientTimer=void 0)}_startTransientRevertTimer(){this._clearTransientTimer(),this._transientTimer=window.setTimeout(()=>{!this._hovering&&this.displayTextLogic===`transient`&&(this._transientShowingValue=!1,this._requestDisplayUpdate())},this.disappearDelay)}_requestDisplayUpdate(){if(!this._editing){let e=this._contentEl;e&&(e.textContent=this._getDisplayText())}}_onUserInteraction(){this.displayTextLogic===`transient`&&(this._clearTransientTimer(),this._transientTimer=window.setTimeout(()=>{this._transientShowingValue=!0,this._startTransientRevertTimer(),this._requestDisplayUpdate()},this.appearDelay))}_beginEdit(){this._prevValue=this.value,this._editing=!0,this.removeAttribute(`invalid`)}_tryCommit(){let e=this._contentEl?.textContent?.trim()??``;if(this.entryMode===`percent`&&(e=e.replaceAll(`%`,``).trim()),(this.validator??this._defaultValidator.bind(this))(e)){this.removeAttribute(`invalid`);let n=this.value;this.value=e,this._editing=!1,e!==n&&this.dispatchEvent(new CustomEvent(`change`,{detail:{value:e},bubbles:!0,composed:!0}))}else this._cancelEdit()}_cancelEdit(){this.value=this._prevValue,this._editing=!1,this.removeAttribute(`invalid`)}_getDisplayText(){return this._shouldUseDisplayText()&&this.displayText!==void 0&&this.displayText!==``?this.displayText:this.value?this.formatter?this.formatter(this.value):this.entryMode===`percent`?`${this.value}%`:this.value:``}_shouldUseDisplayText(){return this.displayTextLogic===`hidden`?!1:this.displayTextLogic===`override`?!0:this.displayTextLogic===`show`?!this._editing&&this._showModeWaitingToHide:this.displayTextLogic===`transient`&&!(this._editing||this._transientShowingValue)}_isAllowedInput(e){switch(this.entryMode){case`text`:return/^[a-z\s]$/i.test(e);case`number`:return/^[\d.\-]$/.test(e);case`percent`:return/^[\d.%]$/.test(e);default:return!0}}_defaultValidator(e){switch(this.entryMode){case`text`:return/^[a-z\s]*$/i.test(e);case`number`:return e===``||/^-?\d*(?:\.\d*)?$/.test(e);case`percent`:return e===``||/^\d*(?:\.\d*)?$/.test(e);default:return!0}}render(){let e=this.mode===`editor`;return i`<div
|
|
6624
6662
|
class="content"
|
|
6625
6663
|
contenteditable=${this._editing?`plaintext-only`:`false`}
|
|
6626
6664
|
data-placeholder=${this.placeholder}
|
|
@@ -6631,7 +6669,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6631
6669
|
@keydown=${this._handleKeydown}
|
|
6632
6670
|
@beforeinput=${this._handleBeforeInput}
|
|
6633
6671
|
@input=${this._handleInput}
|
|
6634
|
-
></div>`}updated(e){if(super.updated(e),e.has(`_editing`)&&this._editing){let e=this._contentEl;e&&(e.textContent=this.value,e.focus(),
|
|
6672
|
+
></div>`}updated(e){if(super.updated(e),e.has(`_editing`)&&this._editing){let e=this._contentEl;e&&(e.textContent=this.value,e.focus(),Wy(e))}(e.has(`_editing`)&&!this._editing||e.has(`displayTextLogic`)||e.has(`displayText`)||e.has(`formatter`)||e.has(`value`))&&this._requestDisplayUpdate()}static{this.styles=[w,r`
|
|
6635
6673
|
:host {
|
|
6636
6674
|
display: inline-flex;
|
|
6637
6675
|
align-items: center;
|
|
@@ -6714,7 +6752,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6714
6752
|
cursor: not-allowed;
|
|
6715
6753
|
pointer-events: none;
|
|
6716
6754
|
}
|
|
6717
|
-
`]}};E([d({reflect:!0})],
|
|
6755
|
+
`]}};E([d({reflect:!0})],Uy.prototype,`mode`,void 0),E([d({attribute:`entry-mode`,reflect:!0})],Uy.prototype,`entryMode`,void 0),E([d({reflect:!0})],Uy.prototype,`value`,void 0),E([d({type:Boolean,reflect:!0})],Uy.prototype,`disabled`,void 0),E([d()],Uy.prototype,`placeholder`,void 0),E([d({attribute:`display-text`})],Uy.prototype,`displayText`,void 0),E([d({attribute:`display-text-logic`})],Uy.prototype,`displayTextLogic`,void 0),E([d({type:Number,attribute:`appear-delay`})],Uy.prototype,`appearDelay`,void 0),E([d({type:Number,attribute:`disappear-delay`})],Uy.prototype,`disappearDelay`,void 0),E([d({attribute:!1})],Uy.prototype,`validator`,void 0),E([d({attribute:!1})],Uy.prototype,`formatter`,void 0),E([m()],Uy.prototype,`_editing`,void 0),Uy=E([T(`ixfx-editable-label`)],Uy);function Wy(e){let n=document.createRange();n.selectNodeContents(e);let r=window.getSelection();r?.removeAllRanges(),r?.addRange(n)}function Gy(e,n,r,i=.1){return n!==void 0&&n>1?e/n:r===void 0?e*i:r}function Ky(e,n,r,i,a=.1){let o=i?10:1;return Gy(e,n,r,a)/o}function qy(e){class n extends e{constructor(...e){super(...e),this.lighttouch=!1,this._isHovering=!1,this._onPointerEnter=()=>{this._isHovering=!0},this._onPointerLeave=()=>{this._isHovering=!1},this._onWheel=e=>{if(!this._shouldHandleWheel())return;e.preventDefault();let n=(e.deltaY===0?e.deltaX:e.deltaY)<0?1:-1;this._applyWheelDelta(n,e)}}connectedCallback(){super.connectedCallback(),this.addEventListener(`pointerenter`,this._onPointerEnter),this.addEventListener(`pointerleave`,this._onPointerLeave),this.addEventListener(`wheel`,this._onWheel,{passive:!1})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerenter`,this._onPointerEnter),this.removeEventListener(`pointerleave`,this._onPointerLeave),this.removeEventListener(`wheel`,this._onWheel),this._isHovering=!1}_shouldHandleWheel(){if(this.disabled)return!1;if(this.lighttouch&&this._isHovering||this.matches?.(`:focus, :focus-within`))return!0;let e=this.renderRoot;return!!(e&&e.activeElement!==null)}_applyWheelDelta(e,n){}}return E([d({type:Boolean,reflect:!0})],n.prototype,`lighttouch`,void 0),n}let Jy=class extends qy(Uy){#e;#t;#n;#r;#i;#a;#o;constructor(){super(),this.dragSensitivity=1,this.noDrag=!1,this.precision=0,this.#e=0,this.#t=0,this.#n=!1,this.#r=!1,this.#i=0,this.#a=``,this.#o=!1,this._stopNativeInput=e=>{e.stopPropagation()},this._handleMouseEnter=()=>{this.displayTextLogic!==`transient`||this._editing||(this._hovering=!0,this._clearTransientTimer(),this._transientTimer=window.setTimeout(()=>{this._transientShowingValue=!0,this._requestDisplayUpdate()},this.appearDelay))},this._handleMouseLeave=()=>{this.displayTextLogic!==`transient`||this._editing||(this._hovering=!1,this._clearTransientTimer(),this._transientShowingValue&&(this._transientTimer=window.setTimeout(()=>{this._hovering||(this._transientShowingValue=!1,this._requestDisplayUpdate())},this.disappearDelay)))},this._handleClick=()=>{this.disabled||this.renderRoot?.querySelector(`.number`)?.focus()},this._handleFocus=()=>{},this._handleBeforeInput=e=>{if(e.inputType!==`insertText`||!e.data)return;if(!this._isAllowedInput(e.data)){e.preventDefault();return}let n=this._contentEl;if(!n)return;let r=n.textContent??``,i=n.selectionStart??r.length,a=r.slice(0,i)+e.data+r.slice(i);a!==this.#a&&(this.#a=a,this.dispatchEvent(new CustomEvent(`input`,{detail:{value:a},bubbles:!0,composed:!0})))},this._handleKeydown=e=>{this._editing&&(e.key===`Enter`?(e.preventDefault(),this._tryCommit(),this.mode===`editor`&&this._contentEl?.blur()):e.key===`Escape`&&(e.preventDefault(),this.dispatchEvent(new CustomEvent(`cancelled`,{detail:{value:this._prevValue},bubbles:!0,composed:!0})),this._cancelEdit(),this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this._prevValue},bubbles:!0,composed:!0})),this.mode===`editor`&&this._contentEl?.blur()))},this._onKeyDown=e=>{this._editing||this.disabled||this._handleArrowKey(e)||e.key.length===1&&(this._onUserInteraction(),this._beginEdit())},this._onPointerDown=e=>{e.button===0&&(this._editing||this.disabled||this.noDrag||(e.preventDefault(),this.renderRoot?.querySelector(`.number`)?.focus(),this.#e=e.clientY,this.#t=this._parseValue(),this.#i=this.#t,this.#n=!1,this.#r=!1,this.setPointerCapture(e.pointerId)))},this._onPointerMove=e=>{if(!(e.buttons&1)||this._editing||this.disabled||this.noDrag)return;let n=this.#e-e.clientY;if(!this.#n&&Math.abs(n)<3)return;this.#n=!0,this.#r=!0,this.toggleAttribute(`dragging`,!0),this._onUserInteraction();let r=this.#t+n*this.dragSensitivity*(this.step||1),i=this._clamp(this._snap(r));this.#i=this.step===void 0?Number.parseFloat(i.toFixed(this.precision)):i;let a=this.step===void 0?this.#i.toFixed(this.precision):this._formatNumber(this.#i);a!==this.#a&&(this.#a=a,this.dispatchEvent(new CustomEvent(`input`,{detail:{value:a},bubbles:!0,composed:!0}))),this._requestDisplayUpdate(),this._updateValueCss(this._normalizedValue(this.#i))},this._onPointerUp=e=>{if(this.hasPointerCapture(e.pointerId)&&this.releasePointerCapture(e.pointerId),!this.#n||this.disabled||this.noDrag)return;this.#n=!1,this.toggleAttribute(`dragging`,!1);let n=this.step===void 0?this.#i.toFixed(this.precision):this._formatNumber(this.#i),r=this.value;this.value=n,n!==r&&this.dispatchEvent(new CustomEvent(`change`,{detail:{value:n},bubbles:!0,composed:!0}))},this._interceptClick=e=>{this.#r&&=(e.stopImmediatePropagation(),!1)},this.mode=`editor`,this.entryMode=`number`,this.value=`0`}render(){return i`
|
|
6718
6756
|
${this.fillStyle?i`<div class="track"></div>`:``}
|
|
6719
6757
|
${this.fillStyle?i`<div class="value"><div class="bar"></div></div>`:``}
|
|
6720
6758
|
<div
|
|
@@ -6730,7 +6768,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6730
6768
|
@beforeinput=${this._handleBeforeInput}
|
|
6731
6769
|
@input=${this._stopNativeInput}
|
|
6732
6770
|
></div>
|
|
6733
|
-
`}connectedCallback(){super.connectedCallback(),this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`pointermove`,this._onPointerMove),this.addEventListener(`pointerup`,this._onPointerUp),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._interceptClick,{capture:!0}),this.addEventListener(`mouseenter`,this._handleMouseEnter),this.addEventListener(`mouseleave`,this._handleMouseLeave)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerdown`,this._onPointerDown),this.removeEventListener(`pointermove`,this._onPointerMove),this.removeEventListener(`pointerup`,this._onPointerUp),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._interceptClick),this.removeEventListener(`mouseenter`,this._handleMouseEnter),this.removeEventListener(`mouseleave`,this._handleMouseLeave)}get _contentEl(){return this.renderRoot?.querySelector(`.number`)??void 0}firstUpdated(e){super.firstUpdated(e),this.displayTextLogic===`show`&&(this._showModeWaitingToHide=!0),this._updateValueCss(this._normalizedValue()),this._requestDisplayUpdate()}_onUserInteraction(){if(this.displayTextLogic===`show`&&!this._editing){this._clearTransientTimer(),this._showModeWaitingToHide=!1,this._requestDisplayUpdate(),this._transientTimer=window.setTimeout(()=>{this._showModeWaitingToHide=!0,this._requestDisplayUpdate()},this.disappearDelay);return}if(this.displayTextLogic===`transient`&&!this._editing){this._clearTransientTimer(),this._transientShowingValue=!0,this._requestDisplayUpdate(),this._transientTimer=window.setTimeout(()=>{this._hovering||(this._transientShowingValue=!1,this._requestDisplayUpdate())},this.disappearDelay);return}super._onUserInteraction()}_onValueChange(){this.displayTextLogic!==`show`||this._editing||(this._clearTransientTimer(),this._showModeWaitingToHide=!1,this._requestDisplayUpdate(),this._transientTimer=window.setTimeout(()=>{this._showModeWaitingToHide=!0,this._requestDisplayUpdate()},this.disappearDelay))}updated(e){super.updated(e),this._editing||this._updateValueCss(this._normalizedValue())}_updateValueCss(e){this.style.setProperty(`--value`,String(e));let n=0,r=e;if(this.linearStyle===`bipolar`?e<=.5?(n=e,r=.5):(n=.5,r=e):this.linearStyle===`unipolar`&&(n=.5-e*.5,r=.5+e*.5),this.style.setProperty(`--value-start`,String(n)),this.style.setProperty(`--value-end`,String(r)),this.fillStyle===`circular`&&this.circularStyle===`offset`){let n=this.offsetHeight,r=this.offsetWidth,i=n/2-2,a=r-2,o=2+i+e*(a-2-2*i);this.style.setProperty(`--radius`,`${i}px`),this.style.setProperty(`--value-center-px`,`${o}px`),this.style.setProperty(`--component-width-px`,`${r}px`),this.style.setProperty(`--component-height-px`,`${n}px`)}}_getDisplayText(){if(this._shouldUseDisplayText())return this.displayText??``;if(this.#n){let e=this.step===void 0?this.#i.toFixed(this.precision):this._formatNumber(this.#i);return this.formatter?this.formatter(e):e}if(this.formatter){let e=Number.parseFloat(this.value);return this.formatter(Number.isNaN(e)?this.value:String(e))}return this._formatDisplay()}_tryCommit(){let e=this.renderRoot?.querySelector(`.number`);if(e){let n=Number.parseFloat(e.textContent?.trim()??``);Number.isNaN(n)||(e.textContent=this._formatNumber(this._clamp(this._snap(n))))}super._tryCommit()}_handleArrowKey(e){let n=(this.max??100)-(this.min??0);if(n===0)return!1;let r=
|
|
6771
|
+
`}connectedCallback(){super.connectedCallback(),this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`pointermove`,this._onPointerMove),this.addEventListener(`pointerup`,this._onPointerUp),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._interceptClick,{capture:!0}),this.addEventListener(`mouseenter`,this._handleMouseEnter),this.addEventListener(`mouseleave`,this._handleMouseLeave)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerdown`,this._onPointerDown),this.removeEventListener(`pointermove`,this._onPointerMove),this.removeEventListener(`pointerup`,this._onPointerUp),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._interceptClick),this.removeEventListener(`mouseenter`,this._handleMouseEnter),this.removeEventListener(`mouseleave`,this._handleMouseLeave)}get _contentEl(){return this.renderRoot?.querySelector(`.number`)??void 0}firstUpdated(e){super.firstUpdated(e),this.displayTextLogic===`show`&&(this._showModeWaitingToHide=!0),this._updateValueCss(this._normalizedValue()),this._requestDisplayUpdate()}_onUserInteraction(){if(this.displayTextLogic===`show`&&!this._editing){this._clearTransientTimer(),this._showModeWaitingToHide=!1,this._requestDisplayUpdate(),this._transientTimer=window.setTimeout(()=>{this._showModeWaitingToHide=!0,this._requestDisplayUpdate()},this.disappearDelay);return}if(this.displayTextLogic===`transient`&&!this._editing){this._clearTransientTimer(),this._transientShowingValue=!0,this._requestDisplayUpdate(),this._transientTimer=window.setTimeout(()=>{this._hovering||(this._transientShowingValue=!1,this._requestDisplayUpdate())},this.disappearDelay);return}super._onUserInteraction()}_onValueChange(){this.displayTextLogic!==`show`||this._editing||(this._clearTransientTimer(),this._showModeWaitingToHide=!1,this._requestDisplayUpdate(),this._transientTimer=window.setTimeout(()=>{this._showModeWaitingToHide=!0,this._requestDisplayUpdate()},this.disappearDelay))}updated(e){super.updated(e),this._editing||this._updateValueCss(this._normalizedValue())}_updateValueCss(e){this.style.setProperty(`--value`,String(e));let n=0,r=e;if(this.linearStyle===`bipolar`?e<=.5?(n=e,r=.5):(n=.5,r=e):this.linearStyle===`unipolar`&&(n=.5-e*.5,r=.5+e*.5),this.style.setProperty(`--value-start`,String(n)),this.style.setProperty(`--value-end`,String(r)),this.fillStyle===`circular`&&this.circularStyle===`offset`){let n=this.offsetHeight,r=this.offsetWidth,i=n/2-2,a=r-2,o=2+i+e*(a-2-2*i);this.style.setProperty(`--radius`,`${i}px`),this.style.setProperty(`--value-center-px`,`${o}px`),this.style.setProperty(`--component-width-px`,`${r}px`),this.style.setProperty(`--component-height-px`,`${n}px`)}}_getDisplayText(){if(this._shouldUseDisplayText())return this.displayText??``;if(this.#n){let e=this.step===void 0?this.#i.toFixed(this.precision):this._formatNumber(this.#i);return this.formatter?this.formatter(e):e}if(this.formatter){let e=Number.parseFloat(this.value);return this.formatter(Number.isNaN(e)?this.value:String(e))}return this._formatDisplay()}_tryCommit(){let e=this.renderRoot?.querySelector(`.number`);if(e){let n=Number.parseFloat(e.textContent?.trim()??``);Number.isNaN(n)||(e.textContent=this._formatNumber(this._clamp(this._snap(n))))}super._tryCommit()}_handleArrowKey(e){let n=(this.max??100)-(this.min??0);if(n===0)return!1;let r=Ky(n,this.stops,this.step,e.shiftKey),i=0,a=!1;switch(e.key){case`ArrowUp`:case`ArrowRight`:i=r,a=!0;break;case`ArrowDown`:case`ArrowLeft`:i=-r,a=!0;break;case`Home`:i=-(this._parseValue()-(this.min??0)),a=!0;break;case`End`:i=(this.max??0)-this._parseValue(),a=!0}return a?(e.preventDefault(),this._applyDelta(i),!0):!1}_applyDelta(e){let n=this.value,r=this._parseValue(),i=this._clamp(this._snap(r+e)),a=this.step===void 0?i.toFixed(this.precision):this._formatNumber(i);this.value=a,this._requestDisplayUpdate(),this._updateValueCss(this._normalizedValue(i)),a!==n&&this.dispatchEvent(new CustomEvent(`input`,{detail:{value:a},bubbles:!0,composed:!0})),requestAnimationFrame(()=>{this.value!==n&&this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value},bubbles:!0,composed:!0}))})}_shouldHandleWheel(){return!this._editing&&super._shouldHandleWheel()}_applyWheelDelta(e,n){let r=(this.max??100)-(this.min??0);if(r===0)return;let i=Ky(r,this.stops,this.step,n.shiftKey);this._applyDelta(e*i)}_parseValue(){return Number.parseFloat(this.value)||0}_formatDisplay(){let e=Number.parseFloat(this.value);if(Number.isNaN(e))return this.value;if(this.precision!==void 0)return e.toFixed(this.precision);let n=this.value.indexOf(`.`),r=n>=0?this.value.length-n-1:0;return e.toFixed(r)}_clamp(e){return this.min!==void 0&&(e=Math.max(this.min,e)),this.max!==void 0&&(e=Math.min(this.max,e)),e}_snap(e){if(this.stops&&this.stops>1){let n=this.min??0,r=((this.max??100)-n)/this.stops;return Math.round((e-n)/r)*r+n}return this.step?Math.round(e/this.step)*this.step:e}_inferDecimals(e){if(this.step!==void 0){let e=String(this.step),n=e.indexOf(`.`);return n>=0?e.length-n-1:0}let n=String(e??this._parseValue()),r=n.indexOf(`.`);return r>=0?n.length-r-1:0}_formatNumber(e){return e.toFixed(this._inferDecimals(e))}_normalizedValue(e=this._parseValue()){return this.min===void 0||this.max===void 0||this.max===this.min?0:Math.max(0,Math.min(1,(e-this.min)/(this.max-this.min)))}static{this.styles=[w,cn,...Uy.styles,r`
|
|
6734
6772
|
:host {
|
|
6735
6773
|
font-size: var(--text-s,11px);
|
|
6736
6774
|
--value: 0;
|
|
@@ -6886,7 +6924,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
6886
6924
|
:host([fill-style="circular"]:not([circular-style])) {
|
|
6887
6925
|
aspect-ratio: 1;
|
|
6888
6926
|
}
|
|
6889
|
-
`]}};E([d({type:Number})],Uy.prototype,`min`,void 0),E([d({type:Number})],Uy.prototype,`max`,void 0),E([d({type:Number})],Uy.prototype,`step`,void 0),E([d({type:Number})],Uy.prototype,`stops`,void 0),E([d({type:Number,attribute:`drag-sensitivity`})],Uy.prototype,`dragSensitivity`,void 0),E([d({attribute:`fill-style`})],Uy.prototype,`fillStyle`,void 0),E([d({attribute:`linear-style`})],Uy.prototype,`linearStyle`,void 0),E([d({attribute:`circular-style`})],Uy.prototype,`circularStyle`,void 0),E([d({type:Boolean,attribute:`no-drag`})],Uy.prototype,`noDrag`,void 0),E([d({type:Number})],Uy.prototype,`precision`,void 0),Uy=E([T(`ixfx-editable-number`)],Uy);const Wy=`li:not([data-virtual-spacer]), [data-list-item]:not([data-virtual-spacer])`;function Gy(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}let W=class extends n{constructor(...e){super(...e),this.selectionMode=`single`,this.interactionMode=`standard`,this.itemWrap=`stop`,this.itemsDraggable=!1,this.keyProperty=``,this.virtualize=!1,this.itemHeight=0,this.itemsDroppable=!1,this.#e=new Map,this.#t=new Set,this.#n=new WeakMap,this.#i=new WeakSet,this.#a=[],this.#o=document.createDocumentFragment(),this.#s=0,this.#c=0,this.#l=[],this.#u=!1,this.#d=0,this.#_=0,this.#v=!1,this.selection=new nr({getOrderedItems:()=>this.#J(),isSelectable:e=>this._isCheckable(e),getModes:()=>({selectionMode:this.selectionMode,interactionMode:this.interactionMode}),getKey:D,onChange:(e,n)=>{this._syncItemStates(),this._dispatch(`list-select`,{selected:e,previous:n,selectedKeys:this.selection.selectedKeys})}}),this.tickled=(e=>new oe(e,{getItems:()=>e.#J().map(e=>({id:e,enabled:!e.hasAttribute(`not-checked`)})),onTickle:e=>{e!==void 0&&this._dispatch(`list-tickle`,{item:e})},onStateChange:()=>this._syncItemStates(),get itemWrap(){return e.itemWrap},hoverDisabled:()=>this.#T.isDragging||this.#x.isDragging}))(this),this.#y=!1,this.#b=0,this.#x=new er(this,{source:`vertical-list`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this._getVisibleItems().length>0,resolveEventToKey:e=>{if(!(e instanceof Element))return;let n=e.closest?.(Wy);if(!(!n||!this.contains(n)||this.#t.has(n)))return D(n)},prepareSelection:e=>this.#S(e),getMetrics:()=>({}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this._dispatchCancelable(`list-native-drag-start`,e),onActiveChange:(e,n)=>{this.#y=e,this.toggleAttribute(`data-native-dragging`,e);for(let r of this._getVisibleItems())r.toggleAttribute(`data-drag-origin`,e&&n!==void 0&&D(r)===n);if(e){let e=this.selection.selected.size;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#y=!1,this.toggleAttribute(`data-native-dragging`,!1),this.removeAttribute(`aria-label`);for(let e of this._getVisibleItems())e.removeAttribute(`data-drag-origin`);if(this.#q())for(let e of this.#a)e.removeAttribute(`data-drag-origin`);this.#C()},syncLightDomDraggable:()=>this._syncNativeDraggable()}),this.#T=new Hn(this,{getSurface:()=>this.renderRoot.querySelector(`.container`),isEnabled:()=>!this.#q()&&this.selection.canDragSelect()&&this._getVisibleItems().length>0&&!this.hasAttribute(`disable-drag-select`),hitTest:e=>this.#E(e),getBaseSelection:()=>this.selection.selected,onPreview:(e,n)=>{this.#w=n;for(let n of this._getVisibleItems())n.toggleAttribute(`data-marquee`,e.has(n));this.requestUpdate()},onCommit:e=>{this.selection.applyDragSelection(e);for(let e of this._getVisibleItems())e.removeAttribute(`data-marquee`);this.#w=void 0,this.requestUpdate()},autoScroll:(e,n)=>{let r=this.renderRoot.querySelector(`ul`);r&&(r.scrollTop+=n)}}),this.search=new Vt(this,{adapter:Mt(this,{itemSelector:Wy,getLabel:e=>e.getAttribute(`data-search-label`)??e.textContent?.trim()??``,highlightKey:`vertical-list-search`,getAllItems:()=>this.#J(),observeContainer:!1})}),this.#ae=()=>{this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#oe(),this.#ue()}))},this._onPointerOver=e=>{let n=this._findListItem(e.composedPath());n&&this.tickled.handlePointerEnter(n)},this._onPointerLeave=e=>{this.tickled.handlePointerLeave(e)},this._onKeyDown=e=>{if(!(this.search.isOpen||this.#_e(e))){if(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`){let n=this.tickled.tickledId;if(n){e.preventDefault();let r=n.getBoundingClientRect();this.#he(n,r.left,r.bottom)}return}if((e.ctrlKey||e.metaKey)&&e.key===`a`){this.selection.canSelectAll()&&(e.preventDefault(),this.selection.selectAll());return}switch(e.key){case`ArrowDown`:if(e.preventDefault(),this.tickled.handleKeyboardNavigation(`next`),this.#P(),e.shiftKey&&this.interactionMode===`vscode`){let e=this.tickled.tickledId;e&&this.selection.rangeTo(e)}break;case`ArrowUp`:if(e.preventDefault(),this.tickled.handleKeyboardNavigation(`previous`),this.#P(),e.shiftKey&&this.interactionMode===`vscode`){let e=this.tickled.tickledId;e&&this.selection.rangeTo(e)}break;case`Home`:e.preventDefault(),this.tickled.handleKeyboardNavigation(`first`),this.#P();break;case`End`:e.preventDefault(),this.tickled.handleKeyboardNavigation(`last`),this.#P();break;case`PageDown`:e.preventDefault(),this.#I(1);break;case`PageUp`:e.preventDefault(),this.#I(-1);break;case`Enter`:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this._dispatch(`list-item-click`,{item:n}),this._activateItem(n));break}case` `:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.selection.handleSpace(n));break}case`Escape`:this.selection.clear()}}},this._onClick=e=>{if(this.#_e(e)||this.#T.isDragging||this.#x.isDragging||this.#b!==0)return;let n=this._findListItem(e.composedPath());n&&(this._dispatch(`list-item-click`,{item:n}),this.selection.handleClick(n,e))},this._onDblClick=e=>{if(this.#_e(e))return;let n=this._findListItem(e.composedPath());n&&this._activateItem(n)},this._onDragOver=e=>{let n=e.dataTransfer;if(!this.itemsDroppable||!n||this.#_e(e))return;let r=this._findListItem(e.composedPath());if(this.canDrop&&!this.canDrop(r,n)){this.#fe();return}if(this.#de&&this.#de.item!==r&&this.#fe(),this.#de={item:r},this._dispatchCancelable(`list-drag-over`,{key:r?D(r):void 0,item:r,dataTransfer:n})){this.#me(void 0,!1);return}e.preventDefault(),n.dropEffect===`none`&&(n.dropEffect=`copy`),this.#me(r,!0)},this._onDragLeave=e=>{let n=e.relatedTarget;n instanceof Node&&this.contains(n)||this.#fe()},this._onDrop=e=>{let n=e.dataTransfer;if(!this.itemsDroppable||!n||this.#_e(e))return;let r=this._findListItem(e.composedPath());if(this.canDrop&&!this.canDrop(r,n)){this.#fe();return}e.preventDefault(),this.#de=void 0,this.#me(void 0,!1),this._dispatch(`list-drop`,{key:r?D(r):void 0,item:r,dataTransfer:n})},this._onContextMenu=e=>{if(this.#_e(e))return;let n=this._findListItem(e.composedPath());n&&(this.#he(n,e.clientX,e.clientY)||e.preventDefault())}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S(e){let n=this.#L(e);if(!n||!this._isCheckable(n))return;this.selection.selected.has(n)||this.selection.replace(n);let r=this.#J(),i=[];r.forEach(n=>{if(!this.selection.selected.has(n))return;let r=this.#Y(n);i.push({key:D(n)??e,index:r,item:n,element:n})});let a=i.find(n=>n.key===e);if(a)return{origin:a,selected:i}}_syncNativeDraggable(){if(this.isConnected)for(let e of this.querySelectorAll(Wy))this.#t.has(e)||e instanceof HTMLElement&&(e.draggable=this.itemsDraggable&&this._isCheckable(e))}#C(){this.#b&&clearTimeout(this.#b),this.#b=window.setTimeout(()=>{this.#b=0},0)}#w;#T;#E(e){let n=this.renderRoot.querySelector(`.container`);if(!n)return[];let r=n.getBoundingClientRect(),i=e.x,a=e.y,o=e.x+e.width,s=e.y+e.height,c=[];for(let e of this._getVisibleItems()){let n=e.getBoundingClientRect(),l=n.left-r.left,u=n.top-r.top;l<=o&&l+n.width>=i&&u<=s&&u+n.height>=a&&c.push(e)}return c}#D(e){return`left:${e.x}px;top:${e.y}px;width:${Math.max(0,e.width)}px;height:${Math.max(0,e.height)}px`}#O;#k;get registry(){return this.#O}#A(){let e=this.searchModes?.trim(),n;if(e===void 0)n=[...zt];else{let r=new Set(e.split(/\s+/));n=zt.filter(e=>r.has(e))}return this.#q()?n.filter(e=>e!==`filter`):n}#j(){this.#O&&(this.search.setModes(this.#A()),this.#k?.(),this.#k=Rt(this.#O,this.search))}connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.addEventListener(`pointerover`,this._onPointerOver),this.addEventListener(`pointerleave`,this._onPointerLeave),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._onClick),this.addEventListener(`dblclick`,this._onDblClick),this.addEventListener(`dragover`,this._onDragOver),this.addEventListener(`dragleave`,this._onDragLeave),this.addEventListener(`drop`,this._onDrop),this.addEventListener(`contextmenu`,this._onContextMenu);for(let e of this.querySelectorAll(Wy))this.#i.add(e);this.#r??=new MutationObserver(e=>this.#M(e)),this.#r.observe(this,{childList:!0}),this.#O??=Yt(),this.#j(),this.#ie()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerover`,this._onPointerOver),this.removeEventListener(`pointerleave`,this._onPointerLeave),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`dblclick`,this._onDblClick),this.removeEventListener(`dragover`,this._onDragOver),this.removeEventListener(`dragleave`,this._onDragLeave),this.removeEventListener(`drop`,this._onDrop),this.removeEventListener(`contextmenu`,this._onContextMenu),this.#fe(),this.#ge=void 0,this.#r?.disconnect(),this.#f?.disconnect(),this.#f=void 0,this.#d!==0&&(cancelAnimationFrame(this.#d),this.#d=0),this.#k?.(),this.#k=void 0,this.#O=void 0,this.#b&&=(clearTimeout(this.#b),0)}firstUpdated(){this.#ie()}#M(e){if(!this.isConnected)return;if(this.#q()){this.#oe(this.#$(e)),this.#le();return}let n=[];for(let r of e)for(let e of r.addedNodes)!(e instanceof HTMLElement)||e.parentElement!==this||e.matches(Wy)&&(this.#i.has(e)||this.#e.has(e)||this.#t.has(e)||(this.#i.add(e),n.push(e)));if(this.#le(),n.length!==0&&!this.#N(n.length))for(let e of n)Xn(e)}#N(e){return e>=this.querySelectorAll(Wy).length}updated(e){if(super.updated(e),e.has(`searchModes`)&&this.#j(),e.has(`virtualize`)||e.has(`itemHeight`)){let n=(e.has(`virtualize`)?e.get(`virtualize`):this.virtualize)===!0&&((e.has(`itemHeight`)?e.get(`itemHeight`):this.itemHeight)??0)>0;if(this.#q()){if(!n){this.#o=document.createDocumentFragment(),this.#a=[...this.querySelectorAll(Wy)];for(let e of this.#a)this.#i.add(e);this.#l=[]}this.#oe(!0)}else n?this.#ce():this.virtualize&&!this.#v&&(this.#v=!0,console.warn(`ixfx-vertical-list: virtualize needs item-height > 0 — running non-virtualized.`));this.#j()}if((e.has(`items`)||e.has(`formatter`)||e.has(`keyProperty`)||e.has(`icon`)||e.has(`iconColor`)||e.has(`textColor`)||e.has(`badge`))&&this.items!==void 0&&(this.#u?this.#u=!1:this.#q()?this.#K():this.#R()),e.has(`interactionMode`)){this.selection.clearAnchor();let n=this.selection.selected,r=e.get(`interactionMode`)===`checked`?new Map(this.#e):null;if(this._syncCheckboxes(),n.size>0){if(r&&r.size>0)this.selection.remap(e=>r.get(e)??e);else if(this.#e.size>0){let e=new Map([...this.#e].map(([e,n])=>[n,e]));this.selection.remap(n=>e.get(n)??n)}}this._syncItemStates()}else e.has(`checkboxRenderer`)&&this.interactionMode===`checked`&&this._syncCheckboxes();(e.has(`itemsDraggable`)||e.has(`interactionMode`))&&(this._syncNativeDraggable(),this.#x.refreshDraggable())}get selectedItem(){return[...this.selection.selected].at(-1)}get selectedItems(){return this.selection.selected}addItem(e,n){let r;if(typeof e==`string`){let n=document.createElement(`li`);n.textContent=e,r=n}else r=e;if(n?.notChecked&&r.setAttribute(`not-checked`,``),this.appendChild(r),this.#q()){this.#oe(!0);return}this.interactionMode===`checked`&&this._syncCheckboxes(),this.search.refresh()}removeItem(e){return this.selection.deselect(e),this.#q()?(e.parentNode===this?$n(e):Object.assign(Promise.resolve(),{animation:void 0})).then(()=>{let n=this.#Y(e);n>=0&&this.#a.splice(n,1),this.#Z(e),e.remove(),this.interactionMode===`checked`&&this._syncCheckboxes(),this.#oe(!0)}):$n(e).then(()=>{e.remove(),this.interactionMode===`checked`&&this._syncCheckboxes()})}removeItems(e){return Promise.all([...e].map(e=>this.removeItem(e))).then(()=>void 0)}clearItems(){this.#e.clear(),this.#q()&&(this.#a=[],this.#o=document.createDocumentFragment(),this.#l=[]),this.replaceChildren(),this.selection.reset(),this._syncItemStates(),this.search.refresh(),this.#q()&&this.#oe(!0)}setItems(e){if(this.#q()){this.#e.clear(),this.#o=document.createDocumentFragment(),this.#l=[],this.#a=[...e];for(let e of this.#a)this.#i.add(e);this.selection.reset(),this.search.refresh(),this.#oe(!0);return}for(let n of e)this.appendChild(n);this.interactionMode===`checked`&&this._syncCheckboxes(),this.search.refresh()}dispatch(e,n){this.#O?.invoke(e,n)}select(e){this.selection.replace(e)}selectMany(e){this.selection.selectMany(e)}deselect(e){this.selection.deselect(e)}clearSelection(){this.selection.clear()}selectAll(){this.selection.canSelectAll()&&this.selection.selectAll()}get selectedKeys(){return this.selection.selectedKeys}get tickledKey(){let e=this.tickled.tickledId;return e?D(e):void 0}selectKeys(e){this.selection.selectKeys(e,e=>this.#L(e))}addSelectedKeys(e){this.selection.addKeys(e,e=>this.#L(e))}removeSelectedKeys(e){this.selection.removeKeys(e,e=>this.#L(e))}focusKey(e){if(this.#q()){let n=this.#a.findIndex(n=>D(n)===e);if(n<0)return;let r=this.renderRoot.querySelector(`ul`);if(r){let e=this.itemHeight,i=r.clientHeight,a=n*e,o=(n+1)*e,s=r.scrollTop,c=i,l=s;a<s?l=a:o>s+c&&(l=o-c),l!==s&&(r.scrollTop=l),this.#oe(!0)}}let n=this.#L(e);!n||n.parentNode!==this||(this.tickled.focus(n),n.scrollIntoView({block:`nearest`,inline:`nearest`}))}#P(){let e=this.tickled.tickledId,n=e?D(e):void 0;n!==void 0&&this.focusKey(n)}#F(){let e=this.#te();if(!e)return 1;let n=e.clientHeight;if(this.#q())return Math.max(1,Math.floor(n/this.itemHeight));let r=this.querySelector(`li[data-key]`);if(!r)return 1;let i=r.offsetHeight||this.itemHeight;return Math.max(1,Math.floor(n/i))}#I(e){let n=this.#F(),r=this.#J().filter(e=>!e.hasAttribute(`not-checked`));if(r.length===0)return;let i=this.tickled.tickledId?D(this.tickled.tickledId):void 0,a=i===void 0?-1:r.findIndex(e=>D(e)===i),o=e===1?n-1:0,s=a<0?o:a+e*n;this.tickled.handleKeyboardNavigation(r[Math.min(r.length-1,Math.max(0,s))]),this.#P()}#L(e){if(this.#q())return this.#a.find(n=>D(n)===e);for(let n of this.querySelectorAll(Wy))if(!this.#t.has(n)&&D(n)===e)return n}getItemByKey(e){return this.#L(e)}visibleKeys(){let e=this.renderRoot.querySelector(`ul`);if(!e)return[];let n=e.getBoundingClientRect(),r=[];for(let e of this._getVisibleItems()){let i=D(e);if(i===void 0)continue;let a=e.getBoundingClientRect();a.bottom>n.top&&a.top<n.bottom&&r.push(i)}return r}renderedKeys(){if(!this.#q()){let e=[];for(let n of this._getVisibleItems()){let r=D(n);r!==void 0&&e.push(r)}return e}let e=[];for(let n=this.#s;n<this.#c;n++){let r=this.#a[n];if(!r)continue;let i=D(r);i!==void 0&&e.push(i)}return e}*selectedFilter(e){let n=this.#q()?this.#a:this.querySelectorAll(Wy),r=e=>this.interactionMode===`checked`&&!(this.#e.get(e)??e).hasAttribute(`not-checked`)&&this.selection.selected.has(e);for(let i of n)if(!(!this.#q()&&this.#t.has(i))&&!i.hidden)switch(e){case`selected`:this.selection.selected.has(i)&&(yield i);break;case`checked`:r(i)&&(yield i);break;case`either`:(this.selection.selected.has(i)||r(i))&&(yield i)}}getItemData(e){return this.#n.get(e)}updateItem(e,n){if(this.items===void 0)return;let r=this.getItemByKey(e);if(!r||!this.#n.has(r))return;let i=this.#G(r),a=this.formatter?this.formatter(n,i):n;if(r instanceof HTMLLIElement){for(let e of[...r.childNodes])e.remove();this.#B(r,a,n,i),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates()}else a instanceof Element&&this.#H(a)&&(a.tagName!==`LI`&&!a.hasAttribute(`data-list-item`)&&a.setAttribute(`data-list-item`,``),this.#U(a,n),this.#n.set(a,n),this.#n.delete(r),this.selection.remap(e=>e===r?a:e),this.#q()&&this.#X(r,a),r.replaceWith(a),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates());if(this.keyProperty){let r=this.items.findIndex(n=>this.#W(n,this.keyProperty)!==void 0&&String(this.#W(n,this.keyProperty))===e);if(r>=0){let e=[...this.items];e[r]=n,this.#u=!0,this.items=e}}}#R(){let e=this.items??[],n=e=>e.getAttribute(`data-key`),r=new Set([...this.selection.selected].map(n).filter(e=>e!==null)),i=this.selection.anchor?n(this.selection.anchor):null;if(this.#e.clear(),this.replaceChildren(...e.map((e,n)=>this.#z(e,n))),r.size>0||i!==null){let e=[],a;for(let o of this.querySelectorAll(Wy)){let s=n(o);s!==null&&r.has(s)&&e.push(o),s!==null&&s===i&&(a=o)}this.selection.seed(e,a)}this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates(),this._syncNativeDraggable(),this.#x.refreshDraggable()}#z(e,n){let r=this.formatter?this.formatter(e,n):e;if(r instanceof Element&&this.#H(r))return r.tagName!==`LI`&&!r.hasAttribute(`data-list-item`)&&r.setAttribute(`data-list-item`,``),this.#U(r,e),this.#n.set(r,e),r;let i=document.createElement(`li`);return this.#B(i,r,e,n),i}#B(e,n,r,i){typeof n==`string`?e.textContent=n:n instanceof Node?e.appendChild(n):this.formatter&&n!=null&&o(n,e),this.#V(e,r,i),this.#U(e,r),this.#n.set(e,r)}#V(e,n,r){let i=Vg(this.textColor?.(n,r));i===void 0?e.style.removeProperty(`color`):e.style.color=i;let a=this.icon?.(n,r);if(!Bg(a)){let i=document.createElement(`span`);i.className=`item-icon`,i.style.cssText=`flex:none;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;margin-inline-end:var(--list-item-icon-gap,6px);width:var(--list-item-icon-size,1em);height:var(--list-item-icon-size,1em)`;let s=Vg(this.iconColor?.(n,r));s!==void 0&&(i.style.color=s),a instanceof Node?i.appendChild(a):o(a,i),e.prepend(i)}let s=this.badge?.(n,r);if(!Bg(s)){let n=document.createElement(`span`);n.className=`item-badge`,n.style.cssText=`flex:none;display:inline-flex;align-items:center;margin-inline-start:auto;padding-inline-start:var(--list-item-badge-gap,8px)`,s instanceof Node?n.appendChild(s):o(s,n),e.appendChild(n)}}#H(e){return e.tagName===`LI`||e.hasAttribute(`data-list-item`)||e.tagName.includes(`-`)}#U(e,n){if(!this.keyProperty)return;let r=this.#W(n,this.keyProperty);r!=null&&e.setAttribute(`data-key`,String(r))}#W(e,n){if(!(typeof e!=`object`||!e||!(n in e)))return e[n]}#G(e){if(this.#q())return this.#Y(e);let n=0;for(let r of this.querySelectorAll(Wy)){if(r===e)return n;this.#n.has(r)&&n++}return n}#K(){let e=this.items??[],n=e=>e.getAttribute(`data-key`),r=new Set([...this.selection.selected].map(n).filter(e=>e!==null)),i=this.selection.anchor?n(this.selection.anchor):null;this.#e.clear(),this.#o=document.createDocumentFragment(),this.#l=[],this.#a=e.map((e,n)=>this.#z(e,n));for(let e of this.#a)this.#i.add(e);if(r.size>0||i!==null){let e=[],a;for(let o of this.#a){let s=n(o);s!==null&&r.has(s)&&e.push(o),s!==null&&s===i&&(a=o)}this.selection.seed(e,a)}this.#oe(!0)}#q(){return this.virtualize&&this.itemHeight>0}#J(){return this.#q()?this.#a.filter(e=>!(e.hidden||this.filterPredicate&&!this.filterPredicate(e))):this._getVisibleItems()}#Y(e){let n=this.#a.indexOf(e);if(n>=0)return n;if(this.#t.has(e)){for(let[n,r]of this.#e)if(r===e)return this.#a.indexOf(n)}return-1}#X(e,n){let r=this.#a.indexOf(e);r>=0&&(this.#a[r]=n)}#Z(e){if(this.#e.has(e)){let n=this.#e.get(e);this.#e.delete(e),n&&this.#t.delete(n)}if(this.#t.has(e)){for(let[n,r]of this.#e)if(r===e){this.#e.delete(n);break}this.#t.delete(e)}}#Q(e){let n=0,r=e.previousElementSibling;for(;r;){if(r===this.#h)return this.#s+n;if(r===this.#g)return this.#a.length;r.matches(Wy)&&n++,r=r.previousElementSibling}return n}#$(e){let n=!1,r=[];for(let i of e){for(let e of i.addedNodes){if(!(e instanceof Element)||e.parentNode!==this||e.hasAttribute(`data-virtual-spacer`)||!e.matches(Wy))continue;let i=this.#Y(e);if(i<0){let i=Math.min(this.#Q(e),this.#a.length);this.#a.splice(i,0,e),r.push(e),n=!0}else if(this.#Q(e)!==i){let r=Math.min(this.#Q(e),this.#a.length-1);this.#a.splice(i,1),this.#a.splice(r,0,e),n=!0}}for(let e of i.removedNodes){if(!(e instanceof Element)||e.hasAttribute(`data-virtual-spacer`))continue;let r=this.#Y(e);r<0||e.parentNode!==this.#o&&e.parentNode!==this&&(this.#a.splice(r,1),n=!0)}}if(r.length>0){if(this.#N(r.length))for(let e of r)this.#i.add(e);else this.#l.push(...r)}return n&&this.interactionMode===`checked`&&this._syncCheckboxes(),n&&this.search.refresh(),n}#ee(){let e=this.#r?.takeRecords()??[];return e.length>0&&this.#$(e)}#te(){return this.renderRoot.querySelector(`ul`)}#ne(e){if(!e)return this.#_;let n=e.clientHeight||e.getBoundingClientRect().height||0;return n>0&&(this.#_=n),this.#_}#re(){if(this.#h&&this.#g)return;let e=()=>{let e=document.createElement(`li`);return e.setAttribute(`data-virtual-spacer`,``),e.setAttribute(`aria-hidden`,`true`),e};this.#h=e(),this.#g=e()}#ie(){let e=this.#te();e&&(this.#f??=new ResizeObserver(()=>{this.#oe(),this.#le()}),this.#f.observe(e))}#ae;#oe(e=!1){if(!this.#q()||!this.isConnected)return;let n=this.#ee()||e;this.#ie();let r=this.#a.length,i=this.#te(),a=this.itemHeight,o=this.#ne(i),s=Math.max(0,r*a-o),c=Math.min(Math.max(0,i?i.scrollTop:0),s);i&&Math.abs(i.scrollTop-c)>.5&&(i.scrollTop=c);let l=Math.floor(c/a),u=Math.ceil((c+o)/a),d=r===0?0:Math.max(0,l-3),f=Math.min(r,u+3);if(!n&&d===this.#s&&f===this.#c)return;if(r===0)this.#a.length>0&&this.#o.append(...this.#a),this.replaceChildren();else{this.#re();let e=this.#h,n=this.#g;if(!e||!n)return;e.style.height=`${d*a}px`,n.style.height=`${Math.max(0,(r-f)*a)}px`;let i=this.#a.slice(d,f),o=[...this.#a.slice(0,d),...this.#a.slice(f)];o.length>0&&this.#o.append(...o),this.replaceChildren(e,...i,n)}this.#s=d,this.#c=f,this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates();let p=this.#J().length;for(let e=d;e<f;e++){let n=this.#a[e];n&&this.#se(n,e+1,p)}let m=this.#l;this.#l=[];for(let e of m)this.#i.add(e),e.parentNode===this&&Xn(e);this.search.repaintHighlights()}#se(e,n,r){e instanceof HTMLElement&&(e.draggable=this.itemsDraggable&&this._isCheckable(e)&&!e.hasAttribute(`data-editing`),n!==void 0&&r!==void 0&&(e.setAttribute(`aria-setsize`,String(r)),e.setAttribute(`aria-posinset`,String(n)),(!e.hasAttribute(`role`)||e.hasAttribute(`data-aria-role`))&&(e.setAttribute(`role`,`option`),e.setAttribute(`data-aria-role`,``),e.setAttribute(`aria-selected`,String(this.selection.selected.has(e)))))),e.removeAttribute(`data-marquee`),e.removeAttribute(`data-drag-origin`),e.removeAttribute(`data-drop-target`)}#ce(){for(let e of this.#a)this.#i.add(e);this.#a.length>0?this.replaceChildren(...this.#a):this.replaceChildren(),this.#o=document.createDocumentFragment(),this.#h=void 0,this.#g=void 0,this.#s=0,this.#c=0,this.#l=[],this._syncCheckboxes(),this._syncItemStates(),this._syncNativeDraggable(),this.#x.refreshDraggable(),this.#le()}#le(){this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#oe(),this.#ue()}))}#ue(){let e=this.renderedKeys(),n=this.visibleKeys();Gy(this.#p,e)&&Gy(this.#m,n)||(this.#p=e,this.#m=n,this._dispatch(`vertical-list-viewport-change`,{renderedKeys:e,visibleKeys:n}))}_getVisibleItems(){return Array.from(this.querySelectorAll(Wy)).filter(e=>!(this.#t.has(e)||e.hidden||this.filterPredicate&&!this.filterPredicate(e)))}_isCheckable(e){return this.interactionMode!==`checked`||!(this.#e.get(e)??e).hasAttribute(`not-checked`)}_syncItemStates(){for(let e of this.querySelectorAll(Wy)){if(this.#t.has(e))continue;let n=this.#e.get(e)??e;e.toggleAttribute(`data-tickled`,this.tickled.isTickled(e)),e.toggleAttribute(`data-selected`,this.selection.selected.has(e)),e.hasAttribute(`data-aria-role`)&&e.setAttribute(`aria-selected`,String(this.selection.selected.has(e))),this.interactionMode===`checked`?e.toggleAttribute(`data-checked`,!n.hasAttribute(`not-checked`)&&this.selection.selected.has(e)):e.removeAttribute(`data-checked`)}this.dataset.inputMode=this.tickled.inputMode,this._syncCheckboxes()}_syncCheckboxes(){let e=this.interactionMode===`checked`,n=typeof this.checkboxRenderer==`function`,r=this.#q()?[this,this.#o]:[this];if(e)for(let e of r)for(let n of Array.from(e.children)){if(!n.hasAttribute(`data-list-item`)||n.parentNode!==e)continue;let r=document.createElement(`li`);r.className=`ixfx-custom-row`;let i=n.getAttribute(`data-key`),a=n.getAttribute(`data-search-label`);i!==null&&r.setAttribute(`data-key`,i),a!==null&&r.setAttribute(`data-search-label`,a),n.removeAttribute(`data-list-item`),e.insertBefore(r,n),r.appendChild(n),this.#e.set(r,n),this.#t.add(n),this.#n.has(n)&&this.#n.set(r,this.#n.get(n)),this.#q()&&this.#X(n,r)}else{for(let[e,n]of this.#e){if(e.parentNode!==this&&e.parentNode!==this.#o)continue;n.setAttribute(`data-list-item`,``);let r=e.parentNode;r&&r.insertBefore(n,e),e.remove(),this.#n.delete(e),this.#q()&&this.#X(e,n)}this.#e.clear(),this.#t.clear()}for(let r of this.querySelectorAll(`li`)){let i=r.querySelector(`.ixfx-list-checkbox`);if(!e){i&&i.remove();continue}if((this.#e.get(r)??r).hasAttribute(`not-checked`)){i&&i.remove();continue}let a=i?.classList.contains(`ixfx-list-checkbox-custom`)??!1;i&&a!==n&&i.remove();let s=r.querySelector(`.ixfx-list-checkbox`);if(!s){if(n){let e=this.checkboxRenderer,n=e.margin??`0`,i=e.width??`24px`;s=this._createCustomCheckbox(r,n,i)}else s=this._createNativeCheckboxCell(r);r.prepend(s)}let c=this.selection.selected.has(r);if(n){if(s.setAttribute(`aria-checked`,String(c)),s.toggleAttribute(`data-checked`,c),this.checkboxRenderer){let e=typeof this.checkboxRenderer==`function`?this.checkboxRenderer:this.checkboxRenderer.renderer;o(e(c),s)}}else{let e=s.querySelector(`input.ixfx-list-checkbox`);e&&(e.checked=c)}}}_createNativeCheckboxCell(e){let n=document.createElement(`span`);n.className=`ixfx-list-checkbox ixfx-list-checkbox-native`,n.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:18px;margin:0 6px 0 0;cursor:pointer;pointer-events:auto`,n.tabIndex=-1,n.setAttribute(`role`,`checkbox`),n.setAttribute(`part`,`checkbox`),n.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.toggle(e)});let r=document.createElement(`input`);return r.type=`checkbox`,r.className=`ixfx-list-checkbox`,r.style.cssText=`pointer-events:none;cursor:pointer;margin:0`,n.appendChild(r),n}_createCustomCheckbox(e,n,r){let i=document.createElement(`span`);return i.className=`ixfx-list-checkbox ixfx-list-checkbox-custom`,i.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:${r};margin:${n};cursor:pointer;pointer-events:auto`,i.tabIndex=-1,i.setAttribute(`role`,`checkbox`),i.setAttribute(`part`,`checkbox`),i.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.toggle(e)}),i}_findListItem(e){for(let n of e)if(n instanceof Element){if(n===this)break;if(n.parentElement===this&&n.matches(Wy))return n}}_dispatch(e,n){this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0}))}_dispatchCancelable(e,n){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}_activateItem(e){this.interactionMode!==`manual`&&this.selection.replace(e),this._dispatch(`list-activate`,{item:e})}activateKey(e){let n=this.#L(e);n&&this._activateItem(n)}#de;#fe(){let e=this.#de;this.#de=void 0,this.#me(void 0,!1),e&&this._dispatch(`list-drag-leave`,{key:e.item?D(e.item):void 0})}#pe;#me(e,n){this.#pe?.removeAttribute(`data-drop-target`),this.#pe=n?e:void 0,this.toggleAttribute(`data-drop-target`,n&&e===void 0),n&&e&&e.setAttribute(`data-drop-target`,``)}#he(e,n,r){return!this.selection.selected.has(e)&&this.interactionMode!==`manual`&&this._isCheckable(e)&&this.selection.replace(e),this._dispatchCancelable(`list-context-menu`,{key:D(e),item:e,x:n,y:r,selectedKeys:this.selection.selectedKeys})}#ge;get editingKey(){return this.#ge?.key}#_e(e){return this.#ge!==void 0&&e.composedPath().includes(this.#ge.label)}beginEdit(e){this.#ve();let n=this.editValidator;if(!n)return!1;let r=this.#L(e);if(!(r instanceof HTMLElement)||r.parentNode!==this)return!1;let i=r.querySelector(`[data-edit-label]`)??r,a=i.getAttribute(`data-edit-value`)??i.textContent?.trim()??``,o=document.createElement(`ixfx-editable-label`);o.mode=`label`,o.value=a,o.validator=r=>n(r,e),o.style.cssText=`flex:1;min-width:0;--label-align:left;--label-padding:0 var(--space-xs,3px)`;let s={key:e,row:r,container:i,saved:[...i.childNodes],label:o,committed:void 0,refocus:!1};this.#ge=s,o.addEventListener(`change`,e=>{e.stopPropagation(),s.committed=e.detail.value}),o.addEventListener(`input`,e=>e.stopPropagation()),o.addEventListener(`keydown`,e=>{s.refocus=e.key===`Enter`||e.key===`Escape`});for(let e of[`pointerdown`,`dragstart`])o.addEventListener(e,e=>e.stopPropagation());return o.addEventListener(`focusout`,()=>this.#ve()),i.replaceChildren(o),r.setAttribute(`data-editing`,``),r.draggable=!1,r.scrollIntoView({block:`nearest`,inline:`nearest`}),o.updateComplete.then(()=>{this.#ge===s&&o.shadowRoot?.querySelector(`.content`)?.click()}),!0}#ve(){let e=this.#ge;e&&(this.#ge=void 0,e.container.isConnected&&e.container.replaceChildren(...e.saved),e.row.removeAttribute(`data-editing`),this.#se(e.row),e.refocus&&this.focus(),e.committed===void 0?this._dispatch(`list-edit-cancel`,{key:e.key}):this._dispatch(`list-edit-commit`,{key:e.key,value:e.committed}))}static{this.styles=[w,Ng(`y`),Ht,r`
|
|
6927
|
+
`]}};E([d({type:Number})],Jy.prototype,`min`,void 0),E([d({type:Number})],Jy.prototype,`max`,void 0),E([d({type:Number})],Jy.prototype,`step`,void 0),E([d({type:Number})],Jy.prototype,`stops`,void 0),E([d({type:Number,attribute:`drag-sensitivity`})],Jy.prototype,`dragSensitivity`,void 0),E([d({attribute:`fill-style`})],Jy.prototype,`fillStyle`,void 0),E([d({attribute:`linear-style`})],Jy.prototype,`linearStyle`,void 0),E([d({attribute:`circular-style`})],Jy.prototype,`circularStyle`,void 0),E([d({type:Boolean,attribute:`no-drag`})],Jy.prototype,`noDrag`,void 0),E([d({type:Number})],Jy.prototype,`precision`,void 0),Jy=E([T(`ixfx-editable-number`)],Jy);const Yy=`li:not([data-virtual-spacer]), [data-list-item]:not([data-virtual-spacer])`;function Xy(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}let W=class extends n{constructor(...e){super(...e),this.selectionMode=`single`,this.interactionMode=`standard`,this.itemWrap=`stop`,this.itemsDraggable=!1,this.keyProperty=``,this.virtualize=!1,this.itemHeight=0,this.itemsDroppable=!1,this.#e=new Map,this.#t=new Set,this.#n=new WeakMap,this.#i=new WeakSet,this.#a=[],this.#o=document.createDocumentFragment(),this.#s=0,this.#c=0,this.#l=[],this.#u=!1,this.#d=0,this.#_=0,this.#v=!1,this.selection=new nr({getOrderedItems:()=>this.#J(),isSelectable:e=>this._isCheckable(e),getModes:()=>({selectionMode:this.selectionMode,interactionMode:this.interactionMode}),getKey:D,onChange:(e,n)=>{this._syncItemStates(),this._dispatch(`list-select`,{selected:e,previous:n,selectedKeys:this.selection.selectedKeys})}}),this.tickled=(e=>new oe(e,{getItems:()=>e.#J().map(e=>({id:e,enabled:!e.hasAttribute(`not-checked`)})),onTickle:e=>{e!==void 0&&this._dispatch(`list-tickle`,{item:e})},onStateChange:()=>this._syncItemStates(),get itemWrap(){return e.itemWrap},hoverDisabled:()=>this.#T.isDragging||this.#x.isDragging}))(this),this.#y=!1,this.#b=0,this.#x=new er(this,{source:`vertical-list`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this._getVisibleItems().length>0,resolveEventToKey:e=>{if(!(e instanceof Element))return;let n=e.closest?.(Yy);if(!(!n||!this.contains(n)||this.#t.has(n)))return D(n)},prepareSelection:e=>this.#S(e),getMetrics:()=>({}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this._dispatchCancelable(`list-native-drag-start`,e),onActiveChange:(e,n)=>{this.#y=e,this.toggleAttribute(`data-native-dragging`,e);for(let r of this._getVisibleItems())r.toggleAttribute(`data-drag-origin`,e&&n!==void 0&&D(r)===n);if(e){let e=this.selection.selected.size;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#y=!1,this.toggleAttribute(`data-native-dragging`,!1),this.removeAttribute(`aria-label`);for(let e of this._getVisibleItems())e.removeAttribute(`data-drag-origin`);if(this.#q())for(let e of this.#a)e.removeAttribute(`data-drag-origin`);this.#C()},syncLightDomDraggable:()=>this._syncNativeDraggable()}),this.#T=new Hn(this,{getSurface:()=>this.renderRoot.querySelector(`.container`),isEnabled:()=>!this.#q()&&this.selection.canDragSelect()&&this._getVisibleItems().length>0&&!this.hasAttribute(`disable-drag-select`),hitTest:e=>this.#E(e),getBaseSelection:()=>this.selection.selected,onPreview:(e,n)=>{this.#w=n;for(let n of this._getVisibleItems())n.toggleAttribute(`data-marquee`,e.has(n));this.requestUpdate()},onCommit:e=>{this.selection.applyDragSelection(e);for(let e of this._getVisibleItems())e.removeAttribute(`data-marquee`);this.#w=void 0,this.requestUpdate()},autoScroll:(e,n)=>{let r=this.renderRoot.querySelector(`ul`);r&&(r.scrollTop+=n)}}),this.search=new Vt(this,{adapter:Mt(this,{itemSelector:Yy,getLabel:e=>e.getAttribute(`data-search-label`)??e.textContent?.trim()??``,highlightKey:`vertical-list-search`,getAllItems:()=>this.#J(),observeContainer:!1})}),this.#ae=()=>{this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#oe(),this.#ue()}))},this._onPointerOver=e=>{let n=this._findListItem(e.composedPath());n&&this.tickled.handlePointerEnter(n)},this._onPointerLeave=e=>{this.tickled.handlePointerLeave(e)},this._onKeyDown=e=>{if(!(this.search.isOpen||this.#_e(e))){if(e.key===`ContextMenu`||e.shiftKey&&e.key===`F10`){let n=this.tickled.tickledId;if(n){e.preventDefault();let r=n.getBoundingClientRect();this.#he(n,r.left,r.bottom)}return}if((e.ctrlKey||e.metaKey)&&e.key===`a`){this.selection.canSelectAll()&&(e.preventDefault(),this.selection.selectAll());return}switch(e.key){case`ArrowDown`:if(e.preventDefault(),this.tickled.handleKeyboardNavigation(`next`),this.#P(),e.shiftKey&&this.interactionMode===`vscode`){let e=this.tickled.tickledId;e&&this.selection.rangeTo(e)}break;case`ArrowUp`:if(e.preventDefault(),this.tickled.handleKeyboardNavigation(`previous`),this.#P(),e.shiftKey&&this.interactionMode===`vscode`){let e=this.tickled.tickledId;e&&this.selection.rangeTo(e)}break;case`Home`:e.preventDefault(),this.tickled.handleKeyboardNavigation(`first`),this.#P();break;case`End`:e.preventDefault(),this.tickled.handleKeyboardNavigation(`last`),this.#P();break;case`PageDown`:e.preventDefault(),this.#I(1);break;case`PageUp`:e.preventDefault(),this.#I(-1);break;case`Enter`:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this._dispatch(`list-item-click`,{item:n}),this._activateItem(n));break}case` `:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.selection.handleSpace(n));break}case`Escape`:this.selection.clear()}}},this._onClick=e=>{if(this.#_e(e)||this.#T.isDragging||this.#x.isDragging||this.#b!==0)return;let n=this._findListItem(e.composedPath());n&&(this._dispatch(`list-item-click`,{item:n}),this.selection.handleClick(n,e))},this._onDblClick=e=>{if(this.#_e(e))return;let n=this._findListItem(e.composedPath());n&&this._activateItem(n)},this._onDragOver=e=>{let n=e.dataTransfer;if(!this.itemsDroppable||!n||this.#_e(e))return;let r=this._findListItem(e.composedPath());if(this.canDrop&&!this.canDrop(r,n)){this.#fe();return}if(this.#de&&this.#de.item!==r&&this.#fe(),this.#de={item:r},this._dispatchCancelable(`list-drag-over`,{key:r?D(r):void 0,item:r,dataTransfer:n})){this.#me(void 0,!1);return}e.preventDefault(),n.dropEffect===`none`&&(n.dropEffect=`copy`),this.#me(r,!0)},this._onDragLeave=e=>{let n=e.relatedTarget;n instanceof Node&&this.contains(n)||this.#fe()},this._onDrop=e=>{let n=e.dataTransfer;if(!this.itemsDroppable||!n||this.#_e(e))return;let r=this._findListItem(e.composedPath());if(this.canDrop&&!this.canDrop(r,n)){this.#fe();return}e.preventDefault(),this.#de=void 0,this.#me(void 0,!1),this._dispatch(`list-drop`,{key:r?D(r):void 0,item:r,dataTransfer:n})},this._onContextMenu=e=>{if(this.#_e(e))return;let n=this._findListItem(e.composedPath());n&&(this.#he(n,e.clientX,e.clientY)||e.preventDefault())}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S(e){let n=this.#L(e);if(!n||!this._isCheckable(n))return;this.selection.selected.has(n)||this.selection.replace(n);let r=this.#J(),i=[];r.forEach(n=>{if(!this.selection.selected.has(n))return;let r=this.#Y(n);i.push({key:D(n)??e,index:r,item:n,element:n})});let a=i.find(n=>n.key===e);if(a)return{origin:a,selected:i}}_syncNativeDraggable(){if(this.isConnected)for(let e of this.querySelectorAll(Yy))this.#t.has(e)||e instanceof HTMLElement&&(e.draggable=this.itemsDraggable&&this._isCheckable(e))}#C(){this.#b&&clearTimeout(this.#b),this.#b=window.setTimeout(()=>{this.#b=0},0)}#w;#T;#E(e){let n=this.renderRoot.querySelector(`.container`);if(!n)return[];let r=n.getBoundingClientRect(),i=e.x,a=e.y,o=e.x+e.width,s=e.y+e.height,c=[];for(let e of this._getVisibleItems()){let n=e.getBoundingClientRect(),l=n.left-r.left,u=n.top-r.top;l<=o&&l+n.width>=i&&u<=s&&u+n.height>=a&&c.push(e)}return c}#D(e){return`left:${e.x}px;top:${e.y}px;width:${Math.max(0,e.width)}px;height:${Math.max(0,e.height)}px`}#O;#k;get registry(){return this.#O}#A(){let e=this.searchModes?.trim(),n;if(e===void 0)n=[...zt];else{let r=new Set(e.split(/\s+/));n=zt.filter(e=>r.has(e))}return this.#q()?n.filter(e=>e!==`filter`):n}#j(){this.#O&&(this.search.setModes(this.#A()),this.#k?.(),this.#k=Rt(this.#O,this.search))}connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.addEventListener(`pointerover`,this._onPointerOver),this.addEventListener(`pointerleave`,this._onPointerLeave),this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`click`,this._onClick),this.addEventListener(`dblclick`,this._onDblClick),this.addEventListener(`dragover`,this._onDragOver),this.addEventListener(`dragleave`,this._onDragLeave),this.addEventListener(`drop`,this._onDrop),this.addEventListener(`contextmenu`,this._onContextMenu);for(let e of this.querySelectorAll(Yy))this.#i.add(e);this.#r??=new MutationObserver(e=>this.#M(e)),this.#r.observe(this,{childList:!0}),this.#O??=Yt(),this.#j(),this.#ie()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerover`,this._onPointerOver),this.removeEventListener(`pointerleave`,this._onPointerLeave),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`click`,this._onClick),this.removeEventListener(`dblclick`,this._onDblClick),this.removeEventListener(`dragover`,this._onDragOver),this.removeEventListener(`dragleave`,this._onDragLeave),this.removeEventListener(`drop`,this._onDrop),this.removeEventListener(`contextmenu`,this._onContextMenu),this.#fe(),this.#ge=void 0,this.#r?.disconnect(),this.#f?.disconnect(),this.#f=void 0,this.#d!==0&&(cancelAnimationFrame(this.#d),this.#d=0),this.#k?.(),this.#k=void 0,this.#O=void 0,this.#b&&=(clearTimeout(this.#b),0)}firstUpdated(){this.#ie()}#M(e){if(!this.isConnected)return;if(this.#q()){this.#oe(this.#$(e)),this.#le();return}let n=[];for(let r of e)for(let e of r.addedNodes)!(e instanceof HTMLElement)||e.parentElement!==this||e.matches(Yy)&&(this.#i.has(e)||this.#e.has(e)||this.#t.has(e)||(this.#i.add(e),n.push(e)));if(this.#le(),n.length!==0&&!this.#N(n.length))for(let e of n)Xn(e)}#N(e){return e>=this.querySelectorAll(Yy).length}updated(e){if(super.updated(e),e.has(`searchModes`)&&this.#j(),e.has(`virtualize`)||e.has(`itemHeight`)){let n=(e.has(`virtualize`)?e.get(`virtualize`):this.virtualize)===!0&&((e.has(`itemHeight`)?e.get(`itemHeight`):this.itemHeight)??0)>0;if(this.#q()){if(!n){this.#o=document.createDocumentFragment(),this.#a=[...this.querySelectorAll(Yy)];for(let e of this.#a)this.#i.add(e);this.#l=[]}this.#oe(!0)}else n?this.#ce():this.virtualize&&!this.#v&&(this.#v=!0,console.warn(`ixfx-vertical-list: virtualize needs item-height > 0 — running non-virtualized.`));this.#j()}if((e.has(`items`)||e.has(`formatter`)||e.has(`keyProperty`)||e.has(`icon`)||e.has(`iconColor`)||e.has(`textColor`)||e.has(`badge`))&&this.items!==void 0&&(this.#u?this.#u=!1:this.#q()?this.#K():this.#R()),e.has(`interactionMode`)){this.selection.clearAnchor();let n=this.selection.selected,r=e.get(`interactionMode`)===`checked`?new Map(this.#e):null;if(this._syncCheckboxes(),n.size>0){if(r&&r.size>0)this.selection.remap(e=>r.get(e)??e);else if(this.#e.size>0){let e=new Map([...this.#e].map(([e,n])=>[n,e]));this.selection.remap(n=>e.get(n)??n)}}this._syncItemStates()}else e.has(`checkboxRenderer`)&&this.interactionMode===`checked`&&this._syncCheckboxes();(e.has(`itemsDraggable`)||e.has(`interactionMode`))&&(this._syncNativeDraggable(),this.#x.refreshDraggable())}get selectedItem(){return[...this.selection.selected].at(-1)}get selectedItems(){return this.selection.selected}addItem(e,n){let r;if(typeof e==`string`){let n=document.createElement(`li`);n.textContent=e,r=n}else r=e;if(n?.notChecked&&r.setAttribute(`not-checked`,``),this.appendChild(r),this.#q()){this.#oe(!0);return}this.interactionMode===`checked`&&this._syncCheckboxes(),this.search.refresh()}removeItem(e){return this.selection.deselect(e),this.#q()?(e.parentNode===this?$n(e):Object.assign(Promise.resolve(),{animation:void 0})).then(()=>{let n=this.#Y(e);n>=0&&this.#a.splice(n,1),this.#Z(e),e.remove(),this.interactionMode===`checked`&&this._syncCheckboxes(),this.#oe(!0)}):$n(e).then(()=>{e.remove(),this.interactionMode===`checked`&&this._syncCheckboxes()})}removeItems(e){return Promise.all([...e].map(e=>this.removeItem(e))).then(()=>void 0)}clearItems(){this.#e.clear(),this.#q()&&(this.#a=[],this.#o=document.createDocumentFragment(),this.#l=[]),this.replaceChildren(),this.selection.reset(),this._syncItemStates(),this.search.refresh(),this.#q()&&this.#oe(!0)}setItems(e){if(this.#q()){this.#e.clear(),this.#o=document.createDocumentFragment(),this.#l=[],this.#a=[...e];for(let e of this.#a)this.#i.add(e);this.selection.reset(),this.search.refresh(),this.#oe(!0);return}for(let n of e)this.appendChild(n);this.interactionMode===`checked`&&this._syncCheckboxes(),this.search.refresh()}dispatch(e,n){this.#O?.invoke(e,n)}select(e){this.selection.replace(e)}selectMany(e){this.selection.selectMany(e)}deselect(e){this.selection.deselect(e)}clearSelection(){this.selection.clear()}selectAll(){this.selection.canSelectAll()&&this.selection.selectAll()}get selectedKeys(){return this.selection.selectedKeys}get tickledKey(){let e=this.tickled.tickledId;return e?D(e):void 0}selectKeys(e){this.selection.selectKeys(e,e=>this.#L(e))}addSelectedKeys(e){this.selection.addKeys(e,e=>this.#L(e))}removeSelectedKeys(e){this.selection.removeKeys(e,e=>this.#L(e))}focusKey(e){if(this.#q()){let n=this.#a.findIndex(n=>D(n)===e);if(n<0)return;let r=this.renderRoot.querySelector(`ul`);if(r){let e=this.itemHeight,i=r.clientHeight,a=n*e,o=(n+1)*e,s=r.scrollTop,c=i,l=s;a<s?l=a:o>s+c&&(l=o-c),l!==s&&(r.scrollTop=l),this.#oe(!0)}}let n=this.#L(e);!n||n.parentNode!==this||(this.tickled.focus(n),n.scrollIntoView({block:`nearest`,inline:`nearest`}))}#P(){let e=this.tickled.tickledId,n=e?D(e):void 0;n!==void 0&&this.focusKey(n)}#F(){let e=this.#te();if(!e)return 1;let n=e.clientHeight;if(this.#q())return Math.max(1,Math.floor(n/this.itemHeight));let r=this.querySelector(`li[data-key]`);if(!r)return 1;let i=r.offsetHeight||this.itemHeight;return Math.max(1,Math.floor(n/i))}#I(e){let n=this.#F(),r=this.#J().filter(e=>!e.hasAttribute(`not-checked`));if(r.length===0)return;let i=this.tickled.tickledId?D(this.tickled.tickledId):void 0,a=i===void 0?-1:r.findIndex(e=>D(e)===i),o=e===1?n-1:0,s=a<0?o:a+e*n;this.tickled.handleKeyboardNavigation(r[Math.min(r.length-1,Math.max(0,s))]),this.#P()}#L(e){if(this.#q())return this.#a.find(n=>D(n)===e);for(let n of this.querySelectorAll(Yy))if(!this.#t.has(n)&&D(n)===e)return n}getItemByKey(e){return this.#L(e)}visibleKeys(){let e=this.renderRoot.querySelector(`ul`);if(!e)return[];let n=e.getBoundingClientRect(),r=[];for(let e of this._getVisibleItems()){let i=D(e);if(i===void 0)continue;let a=e.getBoundingClientRect();a.bottom>n.top&&a.top<n.bottom&&r.push(i)}return r}renderedKeys(){if(!this.#q()){let e=[];for(let n of this._getVisibleItems()){let r=D(n);r!==void 0&&e.push(r)}return e}let e=[];for(let n=this.#s;n<this.#c;n++){let r=this.#a[n];if(!r)continue;let i=D(r);i!==void 0&&e.push(i)}return e}*selectedFilter(e){let n=this.#q()?this.#a:this.querySelectorAll(Yy),r=e=>this.interactionMode===`checked`&&!(this.#e.get(e)??e).hasAttribute(`not-checked`)&&this.selection.selected.has(e);for(let i of n)if(!(!this.#q()&&this.#t.has(i))&&!i.hidden)switch(e){case`selected`:this.selection.selected.has(i)&&(yield i);break;case`checked`:r(i)&&(yield i);break;case`either`:(this.selection.selected.has(i)||r(i))&&(yield i)}}getItemData(e){return this.#n.get(e)}updateItem(e,n){if(this.items===void 0)return;let r=this.getItemByKey(e);if(!r||!this.#n.has(r))return;let i=this.#G(r),a=this.formatter?this.formatter(n,i):n;if(r instanceof HTMLLIElement){for(let e of[...r.childNodes])e.remove();this.#B(r,a,n,i),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates()}else a instanceof Element&&this.#H(a)&&(a.tagName!==`LI`&&!a.hasAttribute(`data-list-item`)&&a.setAttribute(`data-list-item`,``),this.#U(a,n),this.#n.set(a,n),this.#n.delete(r),this.selection.remap(e=>e===r?a:e),this.#q()&&this.#X(r,a),r.replaceWith(a),this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates());if(this.keyProperty){let r=this.items.findIndex(n=>this.#W(n,this.keyProperty)!==void 0&&String(this.#W(n,this.keyProperty))===e);if(r>=0){let e=[...this.items];e[r]=n,this.#u=!0,this.items=e}}}#R(){let e=this.items??[],n=e=>e.getAttribute(`data-key`),r=new Set([...this.selection.selected].map(n).filter(e=>e!==null)),i=this.selection.anchor?n(this.selection.anchor):null;if(this.#e.clear(),this.replaceChildren(...e.map((e,n)=>this.#z(e,n))),r.size>0||i!==null){let e=[],a;for(let o of this.querySelectorAll(Yy)){let s=n(o);s!==null&&r.has(s)&&e.push(o),s!==null&&s===i&&(a=o)}this.selection.seed(e,a)}this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates(),this._syncNativeDraggable(),this.#x.refreshDraggable()}#z(e,n){let r=this.formatter?this.formatter(e,n):e;if(r instanceof Element&&this.#H(r))return r.tagName!==`LI`&&!r.hasAttribute(`data-list-item`)&&r.setAttribute(`data-list-item`,``),this.#U(r,e),this.#n.set(r,e),r;let i=document.createElement(`li`);return this.#B(i,r,e,n),i}#B(e,n,r,i){typeof n==`string`?e.textContent=n:n instanceof Node?e.appendChild(n):this.formatter&&n!=null&&o(n,e),this.#V(e,r,i),this.#U(e,r),this.#n.set(e,r)}#V(e,n,r){let i=Hg(this.textColor?.(n,r));i===void 0?e.style.removeProperty(`color`):e.style.color=i;let a=this.icon?.(n,r);if(!Vg(a)){let i=document.createElement(`span`);i.className=`item-icon`,i.style.cssText=`flex:none;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;margin-inline-end:var(--list-item-icon-gap,6px);width:var(--list-item-icon-size,1em);height:var(--list-item-icon-size,1em)`;let s=Hg(this.iconColor?.(n,r));s!==void 0&&(i.style.color=s),a instanceof Node?i.appendChild(a):o(a,i),e.prepend(i)}let s=this.badge?.(n,r);if(!Vg(s)){let n=document.createElement(`span`);n.className=`item-badge`,n.style.cssText=`flex:none;display:inline-flex;align-items:center;margin-inline-start:auto;padding-inline-start:var(--list-item-badge-gap,8px)`,s instanceof Node?n.appendChild(s):o(s,n),e.appendChild(n)}}#H(e){return e.tagName===`LI`||e.hasAttribute(`data-list-item`)||e.tagName.includes(`-`)}#U(e,n){if(!this.keyProperty)return;let r=this.#W(n,this.keyProperty);r!=null&&e.setAttribute(`data-key`,String(r))}#W(e,n){if(!(typeof e!=`object`||!e||!(n in e)))return e[n]}#G(e){if(this.#q())return this.#Y(e);let n=0;for(let r of this.querySelectorAll(Yy)){if(r===e)return n;this.#n.has(r)&&n++}return n}#K(){let e=this.items??[],n=e=>e.getAttribute(`data-key`),r=new Set([...this.selection.selected].map(n).filter(e=>e!==null)),i=this.selection.anchor?n(this.selection.anchor):null;this.#e.clear(),this.#o=document.createDocumentFragment(),this.#l=[],this.#a=e.map((e,n)=>this.#z(e,n));for(let e of this.#a)this.#i.add(e);if(r.size>0||i!==null){let e=[],a;for(let o of this.#a){let s=n(o);s!==null&&r.has(s)&&e.push(o),s!==null&&s===i&&(a=o)}this.selection.seed(e,a)}this.#oe(!0)}#q(){return this.virtualize&&this.itemHeight>0}#J(){return this.#q()?this.#a.filter(e=>!(e.hidden||this.filterPredicate&&!this.filterPredicate(e))):this._getVisibleItems()}#Y(e){let n=this.#a.indexOf(e);if(n>=0)return n;if(this.#t.has(e)){for(let[n,r]of this.#e)if(r===e)return this.#a.indexOf(n)}return-1}#X(e,n){let r=this.#a.indexOf(e);r>=0&&(this.#a[r]=n)}#Z(e){if(this.#e.has(e)){let n=this.#e.get(e);this.#e.delete(e),n&&this.#t.delete(n)}if(this.#t.has(e)){for(let[n,r]of this.#e)if(r===e){this.#e.delete(n);break}this.#t.delete(e)}}#Q(e){let n=0,r=e.previousElementSibling;for(;r;){if(r===this.#h)return this.#s+n;if(r===this.#g)return this.#a.length;r.matches(Yy)&&n++,r=r.previousElementSibling}return n}#$(e){let n=!1,r=[];for(let i of e){for(let e of i.addedNodes){if(!(e instanceof Element)||e.parentNode!==this||e.hasAttribute(`data-virtual-spacer`)||!e.matches(Yy))continue;let i=this.#Y(e);if(i<0){let i=Math.min(this.#Q(e),this.#a.length);this.#a.splice(i,0,e),r.push(e),n=!0}else if(this.#Q(e)!==i){let r=Math.min(this.#Q(e),this.#a.length-1);this.#a.splice(i,1),this.#a.splice(r,0,e),n=!0}}for(let e of i.removedNodes){if(!(e instanceof Element)||e.hasAttribute(`data-virtual-spacer`))continue;let r=this.#Y(e);r<0||e.parentNode!==this.#o&&e.parentNode!==this&&(this.#a.splice(r,1),n=!0)}}if(r.length>0){if(this.#N(r.length))for(let e of r)this.#i.add(e);else this.#l.push(...r)}return n&&this.interactionMode===`checked`&&this._syncCheckboxes(),n&&this.search.refresh(),n}#ee(){let e=this.#r?.takeRecords()??[];return e.length>0&&this.#$(e)}#te(){return this.renderRoot.querySelector(`ul`)}#ne(e){if(!e)return this.#_;let n=e.clientHeight||e.getBoundingClientRect().height||0;return n>0&&(this.#_=n),this.#_}#re(){if(this.#h&&this.#g)return;let e=()=>{let e=document.createElement(`li`);return e.setAttribute(`data-virtual-spacer`,``),e.setAttribute(`aria-hidden`,`true`),e};this.#h=e(),this.#g=e()}#ie(){let e=this.#te();e&&(this.#f??=new ResizeObserver(()=>{this.#oe(),this.#le()}),this.#f.observe(e))}#ae;#oe(e=!1){if(!this.#q()||!this.isConnected)return;let n=this.#ee()||e;this.#ie();let r=this.#a.length,i=this.#te(),a=this.itemHeight,o=this.#ne(i),s=Math.max(0,r*a-o),c=Math.min(Math.max(0,i?i.scrollTop:0),s);i&&Math.abs(i.scrollTop-c)>.5&&(i.scrollTop=c);let l=Math.floor(c/a),u=Math.ceil((c+o)/a),d=r===0?0:Math.max(0,l-3),f=Math.min(r,u+3);if(!n&&d===this.#s&&f===this.#c)return;if(r===0)this.#a.length>0&&this.#o.append(...this.#a),this.replaceChildren();else{this.#re();let e=this.#h,n=this.#g;if(!e||!n)return;e.style.height=`${d*a}px`,n.style.height=`${Math.max(0,(r-f)*a)}px`;let i=this.#a.slice(d,f),o=[...this.#a.slice(0,d),...this.#a.slice(f)];o.length>0&&this.#o.append(...o),this.replaceChildren(e,...i,n)}this.#s=d,this.#c=f,this.interactionMode===`checked`&&this._syncCheckboxes(),this._syncItemStates();let p=this.#J().length;for(let e=d;e<f;e++){let n=this.#a[e];n&&this.#se(n,e+1,p)}let m=this.#l;this.#l=[];for(let e of m)this.#i.add(e),e.parentNode===this&&Xn(e);this.search.repaintHighlights()}#se(e,n,r){e instanceof HTMLElement&&(e.draggable=this.itemsDraggable&&this._isCheckable(e)&&!e.hasAttribute(`data-editing`),n!==void 0&&r!==void 0&&(e.setAttribute(`aria-setsize`,String(r)),e.setAttribute(`aria-posinset`,String(n)),(!e.hasAttribute(`role`)||e.hasAttribute(`data-aria-role`))&&(e.setAttribute(`role`,`option`),e.setAttribute(`data-aria-role`,``),e.setAttribute(`aria-selected`,String(this.selection.selected.has(e)))))),e.removeAttribute(`data-marquee`),e.removeAttribute(`data-drag-origin`),e.removeAttribute(`data-drop-target`)}#ce(){for(let e of this.#a)this.#i.add(e);this.#a.length>0?this.replaceChildren(...this.#a):this.replaceChildren(),this.#o=document.createDocumentFragment(),this.#h=void 0,this.#g=void 0,this.#s=0,this.#c=0,this.#l=[],this._syncCheckboxes(),this._syncItemStates(),this._syncNativeDraggable(),this.#x.refreshDraggable(),this.#le()}#le(){this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#oe(),this.#ue()}))}#ue(){let e=this.renderedKeys(),n=this.visibleKeys();Xy(this.#p,e)&&Xy(this.#m,n)||(this.#p=e,this.#m=n,this._dispatch(`vertical-list-viewport-change`,{renderedKeys:e,visibleKeys:n}))}_getVisibleItems(){return Array.from(this.querySelectorAll(Yy)).filter(e=>!(this.#t.has(e)||e.hidden||this.filterPredicate&&!this.filterPredicate(e)))}_isCheckable(e){return this.interactionMode!==`checked`||!(this.#e.get(e)??e).hasAttribute(`not-checked`)}_syncItemStates(){for(let e of this.querySelectorAll(Yy)){if(this.#t.has(e))continue;let n=this.#e.get(e)??e;e.toggleAttribute(`data-tickled`,this.tickled.isTickled(e)),e.toggleAttribute(`data-selected`,this.selection.selected.has(e)),e.hasAttribute(`data-aria-role`)&&e.setAttribute(`aria-selected`,String(this.selection.selected.has(e))),this.interactionMode===`checked`?e.toggleAttribute(`data-checked`,!n.hasAttribute(`not-checked`)&&this.selection.selected.has(e)):e.removeAttribute(`data-checked`)}this.dataset.inputMode=this.tickled.inputMode,this._syncCheckboxes()}_syncCheckboxes(){let e=this.interactionMode===`checked`,n=typeof this.checkboxRenderer==`function`,r=this.#q()?[this,this.#o]:[this];if(e)for(let e of r)for(let n of Array.from(e.children)){if(!n.hasAttribute(`data-list-item`)||n.parentNode!==e)continue;let r=document.createElement(`li`);r.className=`ixfx-custom-row`;let i=n.getAttribute(`data-key`),a=n.getAttribute(`data-search-label`);i!==null&&r.setAttribute(`data-key`,i),a!==null&&r.setAttribute(`data-search-label`,a),n.removeAttribute(`data-list-item`),e.insertBefore(r,n),r.appendChild(n),this.#e.set(r,n),this.#t.add(n),this.#n.has(n)&&this.#n.set(r,this.#n.get(n)),this.#q()&&this.#X(n,r)}else{for(let[e,n]of this.#e){if(e.parentNode!==this&&e.parentNode!==this.#o)continue;n.setAttribute(`data-list-item`,``);let r=e.parentNode;r&&r.insertBefore(n,e),e.remove(),this.#n.delete(e),this.#q()&&this.#X(e,n)}this.#e.clear(),this.#t.clear()}for(let r of this.querySelectorAll(`li`)){let i=r.querySelector(`.ixfx-list-checkbox`);if(!e){i&&i.remove();continue}if((this.#e.get(r)??r).hasAttribute(`not-checked`)){i&&i.remove();continue}let a=i?.classList.contains(`ixfx-list-checkbox-custom`)??!1;i&&a!==n&&i.remove();let s=r.querySelector(`.ixfx-list-checkbox`);if(!s){if(n){let e=this.checkboxRenderer,n=e.margin??`0`,i=e.width??`24px`;s=this._createCustomCheckbox(r,n,i)}else s=this._createNativeCheckboxCell(r);r.prepend(s)}let c=this.selection.selected.has(r);if(n){if(s.setAttribute(`aria-checked`,String(c)),s.toggleAttribute(`data-checked`,c),this.checkboxRenderer){let e=typeof this.checkboxRenderer==`function`?this.checkboxRenderer:this.checkboxRenderer.renderer;o(e(c),s)}}else{let e=s.querySelector(`input.ixfx-list-checkbox`);e&&(e.checked=c)}}}_createNativeCheckboxCell(e){let n=document.createElement(`span`);n.className=`ixfx-list-checkbox ixfx-list-checkbox-native`,n.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:18px;margin:0 6px 0 0;cursor:pointer;pointer-events:auto`,n.tabIndex=-1,n.setAttribute(`role`,`checkbox`),n.setAttribute(`part`,`checkbox`),n.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.toggle(e)});let r=document.createElement(`input`);return r.type=`checkbox`,r.className=`ixfx-list-checkbox`,r.style.cssText=`pointer-events:none;cursor:pointer;margin:0`,n.appendChild(r),n}_createCustomCheckbox(e,n,r){let i=document.createElement(`span`);return i.className=`ixfx-list-checkbox ixfx-list-checkbox-custom`,i.style.cssText=`display:inline-flex;align-items:center;justify-content:center;flex-shrink:0;align-self:stretch;width:${r};margin:${n};cursor:pointer;pointer-events:auto`,i.tabIndex=-1,i.setAttribute(`role`,`checkbox`),i.setAttribute(`part`,`checkbox`),i.addEventListener(`click`,n=>{n.stopPropagation(),this.selection.toggle(e)}),i}_findListItem(e){for(let n of e)if(n instanceof Element){if(n===this)break;if(n.parentElement===this&&n.matches(Yy))return n}}_dispatch(e,n){this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0}))}_dispatchCancelable(e,n){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:!0}))}_activateItem(e){this.interactionMode!==`manual`&&this.selection.replace(e),this._dispatch(`list-activate`,{item:e})}activateKey(e){let n=this.#L(e);n&&this._activateItem(n)}#de;#fe(){let e=this.#de;this.#de=void 0,this.#me(void 0,!1),e&&this._dispatch(`list-drag-leave`,{key:e.item?D(e.item):void 0})}#pe;#me(e,n){this.#pe?.removeAttribute(`data-drop-target`),this.#pe=n?e:void 0,this.toggleAttribute(`data-drop-target`,n&&e===void 0),n&&e&&e.setAttribute(`data-drop-target`,``)}#he(e,n,r){return!this.selection.selected.has(e)&&this.interactionMode!==`manual`&&this._isCheckable(e)&&this.selection.replace(e),this._dispatchCancelable(`list-context-menu`,{key:D(e),item:e,x:n,y:r,selectedKeys:this.selection.selectedKeys})}#ge;get editingKey(){return this.#ge?.key}#_e(e){return this.#ge!==void 0&&e.composedPath().includes(this.#ge.label)}beginEdit(e){this.#ve();let n=this.editValidator;if(!n)return!1;let r=this.#L(e);if(!(r instanceof HTMLElement)||r.parentNode!==this)return!1;let i=r.querySelector(`[data-edit-label]`)??r,a=i.getAttribute(`data-edit-value`)??i.textContent?.trim()??``,o=document.createElement(`ixfx-editable-label`);o.mode=`label`,o.value=a,o.validator=r=>n(r,e),o.style.cssText=`flex:1;min-width:0;--label-align:left;--label-padding:0 var(--space-xs,3px)`;let s={key:e,row:r,container:i,saved:[...i.childNodes],label:o,committed:void 0,refocus:!1};this.#ge=s,o.addEventListener(`change`,e=>{e.stopPropagation(),s.committed=e.detail.value}),o.addEventListener(`input`,e=>e.stopPropagation()),o.addEventListener(`keydown`,e=>{s.refocus=e.key===`Enter`||e.key===`Escape`});for(let e of[`pointerdown`,`dragstart`])o.addEventListener(e,e=>e.stopPropagation());return o.addEventListener(`focusout`,()=>this.#ve()),i.replaceChildren(o),r.setAttribute(`data-editing`,``),r.draggable=!1,r.scrollIntoView({block:`nearest`,inline:`nearest`}),o.updateComplete.then(()=>{this.#ge===s&&o.shadowRoot?.querySelector(`.content`)?.click()}),!0}#ve(){let e=this.#ge;e&&(this.#ge=void 0,e.container.isConnected&&e.container.replaceChildren(...e.saved),e.row.removeAttribute(`data-editing`),this.#se(e.row),e.refocus&&this.focus(),e.committed===void 0?this._dispatch(`list-edit-cancel`,{key:e.key}):this._dispatch(`list-edit-commit`,{key:e.key,value:e.committed}))}static{this.styles=[w,Ng(`y`),Ht,r`
|
|
6890
6928
|
:host {
|
|
6891
6929
|
display: block;
|
|
6892
6930
|
position: relative;
|
|
@@ -7082,13 +7120,13 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
7082
7120
|
${this.#w?i`<div class="marquee" part="marquee" style=${this.#D(this.#w)}></div>`:``}
|
|
7083
7121
|
${this.search.renderField()}
|
|
7084
7122
|
</div>
|
|
7085
|
-
`}};E([d({type:String,attribute:`selection-mode`})],W.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],W.prototype,`interactionMode`,void 0),E([d({attribute:!1})],W.prototype,`filterPredicate`,void 0),E([d({type:String,attribute:`item-wrap`})],W.prototype,`itemWrap`,void 0),E([d({attribute:!1})],W.prototype,`checkboxRenderer`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],W.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],W.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],W.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],W.prototype,`dragPreviewSource`,void 0),E([d({attribute:!1})],W.prototype,`items`,void 0),E([d({type:String,attribute:`key-property`})],W.prototype,`keyProperty`,void 0),E([d({attribute:!1})],W.prototype,`formatter`,void 0),E([d({attribute:!1})],W.prototype,`icon`,void 0),E([d({attribute:!1})],W.prototype,`iconColor`,void 0),E([d({attribute:!1})],W.prototype,`textColor`,void 0),E([d({attribute:!1})],W.prototype,`badge`,void 0),E([d({type:Boolean,attribute:`virtualize`,reflect:!0})],W.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`item-height`})],W.prototype,`itemHeight`,void 0),E([d({type:Boolean,attribute:`items-droppable`,reflect:!0})],W.prototype,`itemsDroppable`,void 0),E([d({attribute:!1})],W.prototype,`editValidator`,void 0),E([d({attribute:!1})],W.prototype,`canDrop`,void 0),W=E([T(`ixfx-vertical-list`)],W);function
|
|
7123
|
+
`}};E([d({type:String,attribute:`selection-mode`})],W.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],W.prototype,`interactionMode`,void 0),E([d({attribute:!1})],W.prototype,`filterPredicate`,void 0),E([d({type:String,attribute:`item-wrap`})],W.prototype,`itemWrap`,void 0),E([d({attribute:!1})],W.prototype,`checkboxRenderer`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],W.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],W.prototype,`itemsDraggable`,void 0),E([d({attribute:!1})],W.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],W.prototype,`dragPreviewSource`,void 0),E([d({attribute:!1})],W.prototype,`items`,void 0),E([d({type:String,attribute:`key-property`})],W.prototype,`keyProperty`,void 0),E([d({attribute:!1})],W.prototype,`formatter`,void 0),E([d({attribute:!1})],W.prototype,`icon`,void 0),E([d({attribute:!1})],W.prototype,`iconColor`,void 0),E([d({attribute:!1})],W.prototype,`textColor`,void 0),E([d({attribute:!1})],W.prototype,`badge`,void 0),E([d({type:Boolean,attribute:`virtualize`,reflect:!0})],W.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`item-height`})],W.prototype,`itemHeight`,void 0),E([d({type:Boolean,attribute:`items-droppable`,reflect:!0})],W.prototype,`itemsDroppable`,void 0),E([d({attribute:!1})],W.prototype,`editValidator`,void 0),E([d({attribute:!1})],W.prototype,`canDrop`,void 0),W=E([T(`ixfx-vertical-list`)],W);function Zy(e){return e.item.isLeaf===!1||e.item.isLeaf!==!0&&e.children?.length!==0}function Qy(e,n){return e.length===n.length&&e.every((e,r)=>e===n[r])}function $y(e,n){return e.length===n.length&&e.every((e,r)=>e.node===n[r].node&&e.branch===n[r].branch)}function eb(e,n){if(!e)return[];let r=[e];for(let e of n){let n=r.at(-1).children?.find(n=>n.item.key===e);if(!n)break;r.push(n)}return r}function tb(e,n){if(e===n)return[];for(let r of e.children??[]){let e=tb(r,n);if(e)return[r.item.key,...e]}}function nb(e,n,r){let i=e.map(e=>({key:e.item.key,node:e,branch:Zy(e)})),a=r?[...i].sort((e,n)=>r(e.node,n.node)):i;return n===`mixed`?a:[...a.filter(e=>e.branch),...a.filter(e=>!e.branch)]}let G=class extends n{constructor(...e){super(...e),this.path=[],this.branchOrder=`first`,this.selectionMode=`single`,this.interactionMode=`standard`,this.itemWrap=`stop`,this.itemsDraggable=!1,this.itemsDroppable=!1,this.virtualize=!1,this.itemHeight=0,this.withUp=!0,this.hideRoot=!1,this.emptyText=`Empty`,this._focusVisible=!1,this._hasToolbar=!1,this._rows=[],this._loading=!1,this.#r=[],this.#a=new Set,this.#o=`jump`,this.#g=(e,n)=>{let r=this.#h(e);return!!r&&(this.canDrop?.(r,n)??!0)},this.#_=e=>{this.itemsDroppable&&e.preventDefault()},this.#v=e=>{let n=this.#p(e.detail.key)??this.currentNode;n&&this.dispatchEvent(new CustomEvent(`flat-list-drop`,{detail:{node:n,dataTransfer:e.detail.dataTransfer},bubbles:!0,composed:!0}))},this.#y=e=>{let n=this.#p(e.detail.key);if(!n)return;let r=[...e.detail.selectedKeys].map(e=>this.#p(e)).filter(e=>e!==void 0);this.dispatchEvent(new CustomEvent(`flat-list-context-menu`,{detail:{node:n,nodes:r,x:e.detail.x,y:e.detail.y},bubbles:!0,composed:!0,cancelable:!0}))||e.preventDefault()},this.#b=(e,n)=>{let r=this.#p(n);return!!r&&(this.validateEdit?.(e,r)??!1)},this.#x=e=>{let n=this.#p(e.detail.key);n&&this.dispatchEvent(new CustomEvent(`flat-list-edit-commit`,{detail:{node:n,value:e.detail.value},bubbles:!0,composed:!0}))},this.#S=e=>{let n=this.#p(e.detail.key);n&&this.dispatchEvent(new CustomEvent(`flat-list-edit-cancel`,{detail:{node:n},bubbles:!0,composed:!0}))},this.#C=e=>{let n=this.#a,r=[...e.detail.selectedKeys].map(e=>this.#p(e)).filter(e=>e!==void 0);this.#a=new Set(r),this.dispatchEvent(new CustomEvent(`flat-list-select`,{detail:{selected:this.#a,selectedKeys:e.detail.selectedKeys,previous:n},bubbles:!0,composed:!0}))},this.#w=e=>{let n=e.detail.item.getAttribute(`data-key`)??void 0,r=this.#p(n);if(r){if(Zy(r)){this.navigateInto(r.item.key);return}this.dispatchEvent(new CustomEvent(`flat-list-activate`,{detail:{node:r},bubbles:!0,composed:!0}))}},this.#T=e=>{this._hasToolbar=e.target.assignedNodes({flatten:!0}).some(e=>e.nodeType===Node.ELEMENT_NODE||!!e.textContent?.trim())},this.#E=()=>{this._focusVisible=this.list?.matches(`:focus-visible`)??!1},this.#D=e=>{if(e.defaultPrevented||e.ctrlKey||e.metaKey||e.altKey||e.shiftKey)return;let n=e.composedPath()[0];if(!(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement)){if((e.key===`ArrowRight`||e.key===`ArrowLeft`||e.key===`Backspace`)&&oe.ignoreHoverUntilPointerMoves(),e.key===`ArrowRight`){let n=this.#p(this.list?.tickledKey);n&&Zy(n)&&(e.preventDefault(),this.navigateInto(n.item.key))}else(e.key===`ArrowLeft`||e.key===`Backspace`)&&this.navigateUp()&&e.preventDefault()}},this.#O=e=>{e.stopPropagation();let n=[...e.detail.selected].at(-1),r=this.#c;if(!n||!r)return;let i=tb(r,n);if(i){if(Zy(n)){let e=i.length<this.path.length&&i.every((e,n)=>e===this.path[n])?`up`:`jump`;this.#l(i,e)}else{let e=i.slice(0,-1),r=Qy(e,this.path);this.#l(e,`jump`),this.#s=n.item.key,r&&this.#j()}}},this.#M=e=>this.#P(e,!1),this.#N=e=>this.#P(e,!0),this.#F=e=>{let{node:n}=e;return n.item.icon?i`<ixfx-icon name=${n.item.icon}></ixfx-icon>`:void 0},this.#I=e=>{let{node:n,branch:r}=e,o=Vg(n.item.badge)?a:n.item.badge,s=Hg(n.item.textColor);return i`${o}${r?i`<span
|
|
7086
7124
|
class="chevron"
|
|
7087
7125
|
aria-hidden="true"
|
|
7088
7126
|
style=${s?`color:${s}`:a}
|
|
7089
7127
|
@pointerdown=${e=>e.stopPropagation()}
|
|
7090
7128
|
@click=${e=>this.#m(e,n)}
|
|
7091
|
-
>›</span>`:a}`}}#e;#t;#n;#r;#i;#a;#o;#s;get list(){return this.renderRoot.querySelector(`ixfx-vertical-list`)??void 0}get registry(){return this.list?.registry}dispatch(e,n){this.list?.dispatch(e,n)}beginEdit(e){let n=this.#p(e);return!this.validateEdit||!n?.item.editable?!1:this.list?.beginEdit(e)??!1}get currentNode(){return
|
|
7129
|
+
>›</span>`:a}`}}#e;#t;#n;#r;#i;#a;#o;#s;get list(){return this.renderRoot.querySelector(`ixfx-vertical-list`)??void 0}get registry(){return this.list?.registry}dispatch(e,n){this.list?.dispatch(e,n)}beginEdit(e){let n=this.#p(e);return!this.validateEdit||!n?.item.editable?!1:this.list?.beginEdit(e)??!1}get currentNode(){return eb(this.#c,this.path).at(-1)}get selectedNodes(){return this.#a}get#c(){return this.model?.root??this.root}navigateTo(e){return eb(this.#c,e).length===e.length+1&&(this.#l(e,`jump`),!0)}navigateInto(e){let n=this.currentNode?.children?.find(n=>n.item.key===e);return!n||!Zy(n)?!1:(this.#l([...this.path,e],`into`),!0)}navigateUp(){return this.path.length!==0&&(this.#i=this.path.at(-1),this.#l(this.path.slice(0,-1),`up`),!0)}#l(e,n){Qy(e,this.path)||(this.#r=this.path,this.#o=n,this.list?.search.close(),this.list?.clearSelection(),this.path=e)}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=void 0,this.#t?.abort(),this.#n=void 0}willUpdate(e){e.has(`model`)&&(this.#e?.(),this.#e=this.model?._subscribe(e=>{if(e.type===`invalidate`&&e.key===this.currentNode?.item.key){let e=this.currentNode;e&&(e.children=void 0)}this.requestUpdate(),this.#u(!0)}));let n=eb(this.#c,this.path).length-1;this.#c&&n<this.path.length&&(this.path=this.path.slice(0,n)),[`root`,`model`,`path`,`branchOrder`,`sort`,`filterPredicate`,`loadChildren`].some(n=>e.has(n))&&this.#u(e.has(`root`)||e.has(`model`)||e.has(`loadChildren`))}updated(e){if(e.has(`path`)&&!Qy(this.path,this.#r)&&this.#c){let e=this.currentNode;if(e){let n=this.#r;this.#r=this.path,this.dispatchEvent(new CustomEvent(`flat-list-navigate`,{detail:{path:this.path,previousPath:n,node:e,direction:this.#o},bubbles:!0,composed:!0})),this.#o=`jump`}}e.has(`_rows`)&&this.#j(),(e.has(`_rows`)||e.has(`markedKey`))&&this.#A()}#u(e){let n=this.currentNode;if(!n){this._rows=[];return}if(n.children===void 0&&(this.model||this.loadChildren)&&(e||this.#n!==n)){this.#f(n);return}this.#d(n)}#d(e){let n=this.filterPredicate,r=this.path.length,i=nb((e.children??[]).filter(e=>!n||n(e,r)),this.branchOrder,this.sort);$y(i,this._rows)||(this._rows=i)}async#f(e){this.#t?.abort();let n=new AbortController;this.#t=n,this.#n=e,this._loading=!0,this._rows=[];try{let r=this.path.length,i=this.model?await this.model.getChildren(e,r,n.signal):[...await gg(this.loadChildren({node:e,depth:r},n.signal),n.signal)];if(n.signal.aborted)return;e.children=[...i]}catch{if(n.signal.aborted)return;e.children=[]}this.#n=void 0,this._loading=!1,e===this.currentNode&&this.#d(e)}#p(e){return e===void 0?void 0:this._rows.find(n=>n.key===e)?.node}#m(e,n){e.stopPropagation(),this.navigateInto(n.item.key)}#h(e){return e?this.#p(e.getAttribute(`data-key`)??void 0):this.currentNode}#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;#D;#O;#k;async#A(){let e=this.list;if(!e)return;await e.updateComplete,this.#k?.removeAttribute(`data-marked`);let n=this.markedKey;this.#k=n===void 0?void 0:e.getItemByKey(n),this.#k?.setAttribute(`data-marked`,``)}async#j(){let e=this.list;if(!e)return;let n=this.matches(`:focus-within`);await e.updateComplete;let r=this.#s,i=this.#i??r??this._rows[0]?.key;this.#s=void 0,this.#i=void 0,r&&e.selectKeys([r]),i!==void 0&&e.focusKey(i),n&&e.focus()}#M;#N;#P(e,n){let{node:r}=e,o=Hg(r.item.textColor),s=n&&r.item.editable===!0;return i`<span class="label" data-edit-label=${s?``:a} data-edit-value=${s?r.item.label:a} style=${o?`color:${o}`:a}>${r.item.label}</span>`}#F;#I;render(){let e=this.#c;return i`
|
|
7092
7130
|
<div class="crumbs" part="crumbs">
|
|
7093
7131
|
<ixfx-crumb-navigation
|
|
7094
7132
|
.root=${e}
|
|
@@ -7110,7 +7148,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
7110
7148
|
.items=${this._rows}
|
|
7111
7149
|
.formatter=${this.validateEdit?this.#N:this.#M}
|
|
7112
7150
|
.icon=${this.#F}
|
|
7113
|
-
.iconColor=${e=>
|
|
7151
|
+
.iconColor=${e=>Hg(e.node.item.iconColor)}
|
|
7114
7152
|
.badge=${this.#I}
|
|
7115
7153
|
key-property="key"
|
|
7116
7154
|
.selectionMode=${this.selectionMode}
|
|
@@ -7234,7 +7272,7 @@ const Me={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
7234
7272
|
/* Inherit the row's text colour, so it follows selected / tickled states. */
|
|
7235
7273
|
color: inherit;
|
|
7236
7274
|
}
|
|
7237
|
-
`]}};E([d({attribute:!1})],G.prototype,`root`,void 0),E([d({attribute:!1})],G.prototype,`model`,void 0),E([d({attribute:!1})],G.prototype,`path`,void 0),E([d({attribute:!1})],G.prototype,`loadChildren`,void 0),E([d({attribute:!1})],G.prototype,`filterPredicate`,void 0),E([d({attribute:!1})],G.prototype,`sort`,void 0),E([d({type:String,attribute:`branch-order`,reflect:!0})],G.prototype,`branchOrder`,void 0),E([d({type:String,attribute:`selection-mode`})],G.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],G.prototype,`interactionMode`,void 0),E([d({type:String,attribute:`item-wrap`})],G.prototype,`itemWrap`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],G.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],G.prototype,`itemsDraggable`,void 0),E([d({type:Boolean,attribute:`items-droppable`,reflect:!0})],G.prototype,`itemsDroppable`,void 0),E([d({attribute:!1})],G.prototype,`canDrop`,void 0),E([d({attribute:!1})],G.prototype,`validateEdit`,void 0),E([d({type:String,attribute:`marked-key`,reflect:!0})],G.prototype,`markedKey`,void 0),E([d({type:Boolean,reflect:!0})],G.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`item-height`})],G.prototype,`itemHeight`,void 0),E([d({type:Boolean,attribute:`with-up`,reflect:!0})],G.prototype,`withUp`,void 0),E([d({type:Boolean,attribute:`hide-root`,reflect:!0})],G.prototype,`hideRoot`,void 0),E([d({type:String,attribute:`empty-text`})],G.prototype,`emptyText`,void 0),E([d({type:Boolean,reflect:!0,attribute:`data-focus-visible`})],G.prototype,`_focusVisible`,void 0),E([m()],G.prototype,`_hasToolbar`,void 0),E([m()],G.prototype,`_rows`,void 0),E([m()],G.prototype,`_loading`,void 0),G=E([T(`ixfx-flat-list`)],G);const
|
|
7275
|
+
`]}};E([d({attribute:!1})],G.prototype,`root`,void 0),E([d({attribute:!1})],G.prototype,`model`,void 0),E([d({attribute:!1})],G.prototype,`path`,void 0),E([d({attribute:!1})],G.prototype,`loadChildren`,void 0),E([d({attribute:!1})],G.prototype,`filterPredicate`,void 0),E([d({attribute:!1})],G.prototype,`sort`,void 0),E([d({type:String,attribute:`branch-order`,reflect:!0})],G.prototype,`branchOrder`,void 0),E([d({type:String,attribute:`selection-mode`})],G.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],G.prototype,`interactionMode`,void 0),E([d({type:String,attribute:`item-wrap`})],G.prototype,`itemWrap`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],G.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],G.prototype,`itemsDraggable`,void 0),E([d({type:Boolean,attribute:`items-droppable`,reflect:!0})],G.prototype,`itemsDroppable`,void 0),E([d({attribute:!1})],G.prototype,`canDrop`,void 0),E([d({attribute:!1})],G.prototype,`validateEdit`,void 0),E([d({type:String,attribute:`marked-key`,reflect:!0})],G.prototype,`markedKey`,void 0),E([d({type:Boolean,reflect:!0})],G.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`item-height`})],G.prototype,`itemHeight`,void 0),E([d({type:Boolean,attribute:`with-up`,reflect:!0})],G.prototype,`withUp`,void 0),E([d({type:Boolean,attribute:`hide-root`,reflect:!0})],G.prototype,`hideRoot`,void 0),E([d({type:String,attribute:`empty-text`})],G.prototype,`emptyText`,void 0),E([d({type:Boolean,reflect:!0,attribute:`data-focus-visible`})],G.prototype,`_focusVisible`,void 0),E([m()],G.prototype,`_hasToolbar`,void 0),E([m()],G.prototype,`_rows`,void 0),E([m()],G.prototype,`_loading`,void 0),G=E([T(`ixfx-flat-list`)],G);const rb=new WeakMap;function ib(e,n){let r=e.getRootNode();if(!(r instanceof ShadowRoot)&&!(r instanceof Document))return;let i=rb.get(r)??new Set;if(i.has(n))return;if(i.add(n),rb.set(r,i),r instanceof Document){let e=document.createElement(`style`);e.textContent=n.cssText,document.head.prepend(e);return}let a=n.styleSheet;if(a&&`adoptedStyleSheets`in r)r.adoptedStyleSheets=[a,...r.adoptedStyleSheets];else{let e=document.createElement(`style`);e.textContent=n.cssText,r.prepend(e)}}const ab=r`
|
|
7238
7276
|
ixfx-form > form {
|
|
7239
7277
|
display: block;
|
|
7240
7278
|
margin: 0;
|
|
@@ -7464,7 +7502,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
7464
7502
|
grid-column: 2 / -1;
|
|
7465
7503
|
}
|
|
7466
7504
|
}
|
|
7467
|
-
`;let tb=class extends n{constructor(...e){super(...e),this.label=``}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),$y(this,eb),this._observer=new MutationObserver(()=>this._sync())}firstUpdated(){this._fieldset=this.querySelector(`fieldset`)??void 0,this._fieldset&&(this._observer?.observe(this,{childList:!0,subtree:!0}),this._sync())}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_sync(){this._moveChildren(),this._updatePairs()}_updatePairs(){if(!this._fieldset)return;let e=Array.from(this._fieldset.querySelectorAll(`:scope > ixfx-form-row`)).map(e=>e.querySelectorAll(`:scope > ixfx-form-part`).length),n=Math.max(1,...e);this._fieldset.style.setProperty(`--ixfx-form-pairs`,String(n))}_moveChildren(){this._fieldset&&Array.from(this.children).filter(e=>e.tagName!==`FIELDSET`).forEach(e=>{this._fieldset.appendChild(e)})}render(){return i`<fieldset><legend>${this.label}</legend></fieldset>`}};E([d({type:String})],tb.prototype,`label`,void 0),E([d({type:String,attribute:`label-align`,reflect:!0})],tb.prototype,`labelAlign`,void 0),tb=E([T(`ixfx-form-group`)],tb);let nb=0,rb=class extends n{constructor(...e){super(...e),this.label=``,this.orientation=`horizontal`,this._labelId=`ixfx-form-options-${++nb}`}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),$y(this,eb),this.setAttribute(`role`,`group`),this.setAttribute(`aria-labelledby`,this._labelId),this._observer=new MutationObserver(()=>this._moveChildren())}firstUpdated(){this._observer?.observe(this,{childList:!0}),this._moveChildren()}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_moveChildren(){let e=this.querySelector(`:scope > .ixfx-form-options-items`);e&&Array.from(this.children).filter(e=>!e.classList.contains(`ixfx-form-options-items`)&&!e.classList.contains(`ixfx-form-options-label`)).forEach(n=>e.appendChild(n))}render(){return i`<span class="ixfx-form-options-label" id=${this._labelId}>${this.label}</span><div class="ixfx-form-options-items"></div>`}};E([d({type:String})],rb.prototype,`label`,void 0),E([d({type:String,reflect:!0})],rb.prototype,`orientation`,void 0),rb=E([T(`ixfx-form-options`)],rb);let ib=0,ab=class extends n{constructor(...e){super(...e),this.label=``}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),$y(this,eb),this._ensureId()}_ensureId(){let e=this.querySelector(`input, select, textarea, [name]`);e&&(e.id?this._id=e.id:(this._id=`ixfx-form-part-${++ib}`,e.id=this._id))}render(){return this._id||this._ensureId(),i`<label for=${this._id??``}>${this.label}</label>`}};E([d({type:String})],ab.prototype,`label`,void 0),ab=E([T(`ixfx-form-part`)],ab);let ob=class extends n{createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),$y(this,eb),this._observer=new MutationObserver(()=>this._indexParts()),this._observer.observe(this,{childList:!0}),this._indexParts()}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_indexParts(){Array.from(this.children).filter(e=>e.tagName===`IXFX-FORM-PART`).forEach((e,n)=>{e.style.setProperty(`--ixfx-form-part-index`,String(n+1))})}};ob=E([T(`ixfx-form-row`)],ob);function sb(e,n={}){let r={};return e.querySelectorAll(`[name]`).forEach(e=>{let i=e.getAttribute(`name`);i&&(e instanceof HTMLInputElement?e.type===`radio`?e.checked&&(r[i]=e.value):e.type===`checkbox`?r[i]=e.checked:n.typed&&(e.type===`number`||e.type===`range`)?r[i]=Number.isNaN(e.valueAsNumber)?null:e.valueAsNumber:r[i]=e.value:e instanceof HTMLSelectElement?e.multiple?r[i]=Array.from(e.selectedOptions).map(e=>e.value):r[i]=e.value:(e instanceof HTMLTextAreaElement||`value`in e)&&(r[i]=e.value))}),r}function cb(e,n){e.querySelectorAll(`[name]`).forEach(e=>{let r=e.getAttribute(`name`);if(!r||!(r in n))return;let i=n[r];e instanceof HTMLInputElement?(e.type===`radio`?e.checked=e.value===i:e.type===`checkbox`?e.checked=!!i:e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):e instanceof HTMLSelectElement?(e.multiple&&Array.isArray(i)?Array.from(e.options).forEach(e=>{e.selected=i.includes(e.value)}):e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):e instanceof HTMLTextAreaElement?(e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):`value`in e&&(e.value=i)})}const lb=new Set([`button`,`submit`,`reset`,`image`,`file`,`color`]);let ub=class extends n{constructor(...e){super(...e),this.labelAlign=`right`,this.noValidate=!1,this._onKeydown=e=>{if(e.key!==`Enter`||e.defaultPrevented||e.isComposing||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;let n=e.target;!(n instanceof HTMLInputElement)||lb.has(n.type)||this.form.querySelector(`button:not([type]), button[type=submit], input[type=submit], input[type=image]`)||(e.preventDefault(),this.requestSubmit())}}createRenderRoot(){return this}get form(){return this._form||(this._form=document.createElement(`form`),this._form.addEventListener(`submit`,e=>e.preventDefault()),this._form.addEventListener(`keydown`,this._onKeydown)),this._form}get elements(){return this.form.elements}connectedCallback(){super.connectedCallback(),$y(this,eb),this._adoptChildren(),this._observer=new MutationObserver(()=>this._adoptChildren()),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}updated(){this.form.noValidate=this.noValidate}_adoptChildren(){let e=this.form;e.parentNode!==this&&this.append(e);let n=Array.from(this.childNodes).filter(n=>n!==e);n.length>0&&e.append(...n)}requestSubmit(){this.form.requestSubmit()}reset(){this.form.reset()}checkValidity(){return this.form.checkValidity()}reportValidity(){return this.form.reportValidity()}getValues(e){return sb(this,e)}setValues(e){cb(this,e)}};E([d({type:String,attribute:`label-align`,reflect:!0})],ub.prototype,`labelAlign`,void 0),E([d({type:Boolean,attribute:`novalidate`,reflect:!0})],ub.prototype,`noValidate`,void 0),ub=E([T(`ixfx-form`)],ub);function db(e,n,r,i,a,o,s,c,l=2){let u=Math.max(1,n),d=Math.max(1,r),f=Math.max(0,i),p=u+f,m=d+f,h=Math.max(0,s);if(c===`row`){let n=e===0?0:1,r=e===0?0:(e-1)*p+u;if(e===0||a<=0)return{cols:e,rows:n,totalHeight:0,totalWidth:r,startIndex:0,endIndex:0,colStride:p,rowStride:m,horizontal:!0};let i=Math.max(0,Math.floor(h/p)),o=Math.ceil((h+a)/p);return{cols:e,rows:n,totalHeight:0,totalWidth:r,startIndex:Math.max(0,i-l),endIndex:Math.min(e,o+l),colStride:p,rowStride:m,horizontal:!0}}let g=c===`column`?1:Math.max(1,Math.floor((Math.max(0,a)+f)/p)),_=e===0?0:Math.ceil(e/g),v=_===0?0:(_-1)*m+d;if(e===0||o<=0)return{cols:g,rows:_,totalHeight:v,totalWidth:0,startIndex:0,endIndex:0,colStride:p,rowStride:m,horizontal:!1};let y=Math.max(0,Math.floor(h/m)),b=Math.ceil((h+o)/m),x=Math.max(0,y-l),S=Math.min(_,b+l);return{cols:g,rows:_,totalHeight:v,totalWidth:0,startIndex:x*g,endIndex:Math.min(e,S*g),colStride:p,rowStride:m,horizontal:!1}}function fb(e,n,r,i){let a=Math.max(0,e.gap),o=e.orientation===`row`,s=e=>o?e:Math.ceil(e/n),c=e=>e===0?0:(s(e)-1)*r+i;if(!e.groups){let n=c(e.count);return{sections:[{group:void 0,first:0,count:e.count,headerOffset:0,itemsOffset:0,end:n}],total:n,count:e.count}}let l=o?e.headerWidth:e.headerHeight,u=[],d=0,f=0;for(let n of e.groups){let e=n.collapsed?0:n.count,r=d+l+a,i=e===0?d+l:r+c(e);u.push({group:n,first:f,count:e,headerOffset:d,itemsOffset:r,end:i}),f+=e,d=i+a}return{sections:u,total:u.length===0?0:u[u.length-1].end,count:f}}function pb(e,n){let r=0,i=e.length-1;for(;r<i;){let a=r+i+1>>1;e[a].headerOffset<=n?r=a:i=a-1}return r}function mb(e,n){let r=0,i=e.length-1;for(;r<i;){let a=r+i+1>>1;e[a].first<=n?r=a:i=a-1}let a=r;for(;a<e.length-1&&e[a].count===0;)a++;return a}function hb(e){let n=e.orientation===`row`,r=Math.max(1,e.itemWidth),i=Math.max(1,e.rowHeight),a=Math.max(0,e.gap),o=r+a,s=i+a,c=n||e.orientation===`column`?1:Math.max(1,Math.floor((Math.max(0,e.viewportWidth)+a)/o)),l=n?o:s,u=n?r:i,{sections:d,total:f,count:p}=fb(e,c,l,u),m=e.groups!==void 0,h=n?e.headerWidth:e.headerHeight,g=n?e.viewportWidth:e.viewportHeight,_=s-a,v=Math.max(0,(e.viewportHeight-_)/2),y=e=>{let r=mb(d,e),i=d[r],a=Math.max(0,e-i.first);if(n)return{x:i.itemsOffset+a*o,y:v,col:0,line:a,section:r};let l=c<=1?0:a%c,u=c<=1?a:Math.floor(a/c);return{x:l*o,y:i.itemsOffset+u*s,col:l,line:u,section:r}};return{horizontal:n,cols:c,colStride:o,rowStride:s,grouped:m,count:p,totalExtent:f,window:(u,m=2)=>{let _=Math.max(0,u),v=[],y=[],b=_-m*l,x=_+g+m*l,S=0;if(d.length>1){let e=0,n=d.length-1;for(;e<n;){let r=e+n>>1;d[r].end>=b?n=r:e=r+1}S=e}if(g>0)for(let o=S;o<d.length;o++){let s=d[o];if(s.headerOffset>x)break;if(s.group&&s.headerOffset+h>=b&&v.push({key:s.group.key,label:s.group.label,count:s.group.count,collapsed:s.group.collapsed,offset:s.headerOffset,size:h}),s.count===0)continue;let c=_-s.itemsOffset,l=c<0?g+c:g;if(l<=0)continue;let u=db(s.count,r,i,a,n?l:e.viewportWidth,n?e.viewportHeight:l,Math.max(0,c),e.orientation,m);u.endIndex>u.startIndex&&y.push([s.first+u.startIndex,s.first+u.endIndex])}return{cols:n?p:c,rows:0,totalHeight:n?0:f,totalWidth:n?f:0,startIndex:y.length>0?y[0][0]:0,endIndex:y.length>0?y[y.length-1][1]:0,colStride:o,rowStride:s,horizontal:n,headers:v,ranges:y}},positionOf:y,extentOf:e=>{let{line:n,section:r}=y(e),i=d[r],a=i.itemsOffset+n*l;return[n===0&&i.group?i.headerOffset:a,a+u]},neighbour:(e,n)=>{if(p===0)return e;let r=mb(d,e),i=d[r],a=e-i.first,o=a%c;if(n>0){let e=a+c;if(e<=i.count-1)return i.first+e;let n=Math.floor((i.count-1)/c);if(Math.floor(a/c)<n)return i.first+i.count-1;for(let e=r+1;e<d.length;e++)if(d[e].count>0)return d[e].first+Math.min(o,d[e].count-1);return i.first+i.count-1}let s=a-c;if(s>=0)return i.first+s;for(let e=r-1;e>=0;e--){let n=d[e];if(n.count>0){let e=Math.floor((n.count-1)/c);return n.first+Math.min(e*c+o,n.count-1)}}return i.first},hitTest:(e,r,i,a)=>{let u=[];if(p===0)return u;let f=n?e:i,m=n?r:a,h=pb(d,f-l);for(let l=Math.max(0,h);l<d.length;l++){let p=d[l];if(p.itemsOffset>m)break;if(!(p.count===0||p.end<f)){if(n){let n=Math.max(0,Math.floor((e-p.itemsOffset)/o)),i=Math.min(p.count-1,Math.floor((r-p.itemsOffset)/o));for(let e=n;e<=i;e++)u.push(p.first+e)}else{let n=Math.max(0,Math.floor(e/o)),l=Math.min(c-1,Math.floor(r/o)),d=Math.max(0,Math.floor((i-p.itemsOffset)/s)),f=Math.floor((a-p.itemsOffset)/s);for(let e=d;e<=f;e++)for(let r=n;r<=l;r++){let n=e*c+r;n>=0&&n<p.count&&u.push(p.first+n)}}}}return u},anchorAt:e=>{if(p===0)return{index:0,lineFrac:0};let r=pb(d,e);for(;r<d.length-1&&d[r].count===0;)r++;let i=d[r];if(i.count===0)return{index:0,lineFrac:0};let a=Math.max(0,e-i.itemsOffset)/l,o=Math.max(0,Math.floor(a)),s=n?Math.min(i.count-1,o):Math.min(i.count-1,o*c+Math.max(0,Math.floor((c-1)/2)));return{index:i.first+s,lineFrac:a-o}},offsetOfAnchor:(e,n)=>{let{line:r,section:i}=y(e);return d[i].itemsOffset+(r+n)*l},snapTarget:e=>{let r=pb(d,e),i=d[r],a=Math.round((e-i.itemsOffset)/l);if(m){let e=i.count===0?0:n?i.count:Math.ceil(i.count/c);a=Math.max(0,Math.min(Math.max(0,e-1),a))}let o=[i.itemsOffset+a*l];return m&&(o.push(i.headerOffset),r+1<d.length&&o.push(d[r+1].headerOffset)),o.reduce((n,r)=>Math.abs(r-e)<Math.abs(n-e)?r:n)}}}function gb(e,n,r){let i=gn(e,e=>n.groupKeyOf(e),n.labelOf?(e,r)=>n.labelOf(e,r.map(e=>n.itemAt(e))):void 0),a=[],o=[],s=new Map;for(let e of i){let i=n.collapsed.has(e.key);o.push({key:e.key,label:e.label,count:e.items.length,collapsed:i});for(let n of e.items)s.set(r(n),e.key),i||a.push(n)}return{order:a,groups:o,groupByKey:s}}const _b=`gl-auto-`;function vb(e){return e.startsWith(_b)}function yb(e){let n=new Set,r=new Set;for(let i of e)vb(i)||(n.has(i)?r.add(i):n.add(i));r.size>0&&console.warn(`ixfx-grid-list: duplicate item key(s) ${[...r].map(e=>`"${e}"`).join(`, `)} — the first occurrence wins for key-based operations.`)}function bb(e){let n=new Map;return e.forEach((e,r)=>{n.has(e)||n.set(e,r)}),n}var xb=class{#e;#t=[];#n=new WeakMap;#r=0;#i;#a;#o=[];#s;#c;#l;#u=[];#d=new Map;constructor(e){this.#e=e,this.refresh()}get count(){return this.#o.length}get rawCount(){return this.#t.length}keyAt(e){let n=this.#o[e];return n===void 0?``:this.#m(this.#t[n])}indexOfKey(e){return this.#c??=bb(this.keys()),this.#c.get(e)??-1}keys(){return this.#s??=this.#o.map(e=>this.#m(this.#t[e])),this.#s}labelAt(e){let n=this.#o[e];return n===void 0?``:this.#h(this.#t[n])}rawKeyAt(e){let n=this.#t[e];return n===void 0?``:this.#m(n)}rawSearchTextAt(e){let n=this.#t[e];return n===void 0?``:n.getAttribute(`data-search-label`)??n.getAttribute(`data-label`)??n.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??n.textContent?.trim()??``}isSelectable(e){let n=this.#o[e];return n!==void 0&&!this.#t[n].hasAttribute(`not-checked`)}renderCellContent(e){}iconAt(e){}iconColorAt(e){}textColorAt(e){}badgeAt(e){}setFilters(e){`predicate`in e&&(this.#i=e.predicate),`searchKeys`in e&&(this.#a=e.searchKeys),this.#f()}setGrouping(e){this.#l=e,this.#f()}groups(){return this.#u}groupKeyOfKey(e){return this.#d.get(e)??null}refresh(){this.#t=Array.from(this.#e.querySelectorAll(`:scope > *`)).filter(e=>!e.hidden),yb(this.#t.map(e=>this.#m(e))),this.#f()}effectiveElements(){return this.#o.map(e=>this.#t[e])}rawElementAt(e){return this.#t[e]}resolveKeyToElement(e){return vb(e)?this.#t.find(n=>this.#n.get(n)===e):this.#t.find(n=>D(n)===e)}resolveKeyToData(e){}#f(){let e=[];for(let n=0;n<this.#t.length;n++)if(!(this.#i!==void 0&&!this.#i(n))){if(this.#a!==void 0){let e=this.#m(this.#t[n]);if(!vb(e)&&!this.#a.has(e))continue}e.push(n)}this.#p(e),this.#s=void 0,this.#c=void 0}#p(e){if(this.#l===void 0){this.#o=e,this.#u=[],this.#d=new Map;return}let n=gb(e,this.#l,e=>this.#m(this.#t[e]));this.#o=n.order,this.#u=n.groups,this.#d=n.groupByKey}#m(e){let n=D(e);if(n!==void 0)return n;let r=this.#n.get(e);return r===void 0&&(this.#r+=1,r=`${_b}${this.#r}`,this.#n.set(e,r)),r}#h(e){return e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??``}},Sb=class{#e;#t;#n;#r;#i=[];#a;#o;#s;#c=[];#l=new Map;constructor(e,n){this.#e=e,this.#t=n,yb(e.map((e,r)=>n.key(e,r))),this.#u()}get count(){return this.#i.length}get rawCount(){return this.#e.length}keyAt(e){let n=this.#i[e];return n===void 0?``:this.#t.key(this.#e[n],n)}indexOfKey(e){return this.#o??=bb(this.keys()),this.#o.get(e)??-1}keys(){return this.#a??=this.#i.map(e=>this.#t.key(this.#e[e],e)),this.#a}labelAt(e){let n=this.#i[e];return n===void 0?``:this.#t.label?.(this.#e[n],n)??this.#t.key(this.#e[n],n)}rawKeyAt(e){return e<0||e>=this.#e.length?``:this.#t.key(this.#e[e],e)}rawSearchTextAt(e){if(e<0||e>=this.#e.length)return``;let n=this.#e[e];return this.#t.searchableText?.(n,e)??this.#t.label?.(n,e)??``}isSelectable(e){let n=this.#i[e];return n!==void 0&&!this.#t.disabled?.(this.#e[n],n)}renderCellContent(e){let n=this.#i[e];return n===void 0?void 0:this.#t.render(this.#e[n],n)}iconAt(e){let n=this.#i[e];return n===void 0||this.#t.icon===void 0?void 0:this.#t.icon(this.#e[n],n)}iconColorAt(e){let n=this.#i[e];return n===void 0?void 0:this.#t.iconColor?.(this.#e[n],n)}textColorAt(e){let n=this.#i[e];return n===void 0?void 0:this.#t.textColor?.(this.#e[n],n)}badgeAt(e){let n=this.#i[e];return n===void 0||this.#t.badge===void 0?void 0:this.#t.badge(this.#e[n],n)}setFilters(e){`predicate`in e&&(this.#n=e.predicate),`searchKeys`in e&&(this.#r=e.searchKeys),this.#u()}setGrouping(e){this.#s=e,this.#u()}groups(){return this.#c}groupKeyOfKey(e){return this.#l.get(e)??null}refresh(){this.#u()}rawItemAt(e){return this.#e[e]}getItemAt(e){let n=this.#i[e];return n===void 0?void 0:this.#e[n]}resolveKeyToElement(e){}resolveKeyToData(e){let n=this.#e.findIndex((n,r)=>this.#t.key(n,r)===e);return n>=0?this.#e[n]:void 0}#u(){let e=[];for(let n=0;n<this.#e.length;n++)this.#n!==void 0&&!this.#n(n)||this.#r!==void 0&&!this.#r.has(this.#t.key(this.#e[n],n))||e.push(n);if(this.#s===void 0)this.#i=e,this.#c=[],this.#l=new Map;else{let n=gb(e,this.#s,e=>this.#t.key(this.#e[e],e));this.#i=n.order,this.#c=n.groups,this.#l=n.groupByKey}this.#a=void 0,this.#o=void 0}};function Cb(e,n){return typeof e==`object`&&e?e[n]:void 0}function wb(e,n){return e.getAttribute(`data-${n}`)}function Tb(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}function Eb(e,n,r){for(let i of n)r.has(i)||i.removeAttribute(e);for(let n of r)n.hasAttribute(e)||n.setAttribute(e,``);return r}let K=class extends n{constructor(...e){super(...e),this.selectionMode=`single`,this.interactionMode=`standard`,this.disableHoverTickle=!1,this.disableScrollHoverTickle=!1,this.itemSize=160,this.gap=8,this.orientation=`grid`,this.captionStyle=`under`,this.captionAlign=`middle`,this.captionPosition=`bottom`,this.captionBackdrop=`scrim`,this.captionHeight=24,this.itemWrap=`stop`,this.itemsDraggable=!1,this.marqueeFromCellBlank=!1,this.snapToItem=!1,this.items=[],this.groupBy=null,this.crossGroupSelection=!1,this.groupHeaderHeight=28,this.groupHeaderWidth=120,this._collapsedGroups=new Set,this._scrollTop=0,this._scrollLeft=0,this._viewportHeight=0,this._viewportWidth=0,this.#e=x(),this.#i=0,this.#a=0,this.#o=[],this.#s=`stop`,this.#c=new Map,this.#l=0,this.#u=new Set,this.#d=[],this.#f=new Map,this.#p=new Set,this.#m=0,this.#g=new xb(this),this.#_=this.#g,this.selection=new nr({getOrderedItems:()=>this.#_.keys(),isSelectable:e=>{let n=this.#_.indexOfKey(e);return n>=0&&this.#_.isSelectable(n)},getModes:()=>({selectionMode:this.selectionMode,interactionMode:this.interactionMode}),getKey:e=>e,getGroupKey:e=>this.groupBy===null?null:this.#_.groupKeyOfKey(e),crossGroupSelection:()=>this.crossGroupSelection,getFallbackGroupKey:()=>{let e=this.tickled.tickledId;return e!==void 0&&this.groupBy!==null?this.#_.groupKeyOfKey(e):null},onChange:(e,n)=>{this._syncItemStates(),this.requestUpdate(),this.#ge(e,n)}}),this.tickled=new oe(this,{getItems:()=>this.#_.keys().map((e,n)=>({id:e,enabled:this.#_.isSelectable(n)})),onTickle:e=>{this.#Oe(),e!==void 0&&this.#_e(`list-tickle`,e)},onStateChange:()=>this._syncItemStates(),itemWrap:this.#s,hoverDisabled:()=>this.disableHoverTickle||this.#A.isDragging||this.#E.isDragging}),this.#v=!1,this.#y=NaN,this.#b=NaN,this.#x=new Set,this.#C=!1,this.#w=void 0,this.#T=0,this.#E=new er(this,{source:`grid-list`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this.#_.count>0,resolveEventToKey:e=>{if(e instanceof Element){let n=(e.closest?.(`.cell`))?.dataset.key;if(n)return n;let r=(e.closest?.(`[data-key]`))?.dataset.key??e.dataset?.key??D(e);if(r)return r}},prepareSelection:e=>this.#O(e),getMetrics:()=>({itemSize:this.itemSize,captionStyle:this.captionStyle,captionHeight:this.captionHeight,rowHeight:this.#ee()}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this._dispatch(`list-native-drag-start`,e,!0),onActiveChange:(e,n)=>{if(this.#C=e,this.#w=e?n:void 0,this.toggleAttribute(`data-native-dragging`,e),e){let e=[...this.selection.selectedKeys].filter(e=>!vb(e)).length;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#qe(),this.#Ke()},syncLightDomDraggable:()=>{for(let e of this.children)e instanceof HTMLElement&&(e.draggable=this.itemsDraggable)},shouldStart:e=>!(this.marqueeFromCellBlank&&this.#j(e))}),this.#k=null,this.#A=new Hn(this,{getSurface:()=>this.#e.value,isEnabled:()=>this.selection.canDragSelect()&&this.#_.count>0&&!this.hasAttribute(`disable-drag-select`),hitTest:e=>this.#M(e),getBaseSelection:()=>this.selection.selected,onPreview:(e,n)=>{this.#x=e,this.#S=n,this.requestUpdate()},onCommit:e=>{this.selection.applyDragSelection(e),this.#x=new Set,this.#S=void 0,this.requestUpdate()},autoScroll:(e,n)=>{let r=this.#e.value;r&&(e!==0&&(r.scrollLeft+=e,this._scrollLeft=r.scrollLeft),n!==0&&(r.scrollTop+=n,this._scrollTop=r.scrollTop))},shouldStart:e=>{if(this.marqueeFromCellBlank&&this.#j(e))return!0;for(let n of e.composedPath())if(n instanceof Element&&(n.classList.contains(`cell`)||n.classList.contains(`group-header`)))return!1;return!0}}),this.#Y=!1,this.#me=new Set,this.#he=new Set,this.#ve=new Set,this.#Ne=e=>{let n=e.target;this.#Ie(),this.#Be(),this.#i=requestAnimationFrame(()=>{this.#i=0,this._scrollTop=n.scrollTop,this._scrollLeft=n.scrollLeft,this.#K()}),this.#He()},this.#Pe=e=>{if(this.orientation!==`row`||e.ctrlKey||e.metaKey||e.deltaY===0)return;let n=this.#e.value??e.currentTarget;n&&(n.scrollWidth<=n.clientWidth+1||(this.#Ie(),n.scrollLeft+=e.deltaX+e.deltaY,e.preventDefault()))},this.#Re=e=>{let n=!Number.isNaN(this.#y)&&(e.clientX!==this.#y||e.clientY!==this.#b);if(this.#y=e.clientX,this.#b=e.clientY,!n||!this.#v||(this.#Le(),this.disableHoverTickle))return;let r=this.shadowRoot?.elementFromPoint?.(e.clientX,e.clientY)?.closest(`.cell`)?.getAttribute(`data-key`);r&&this.tickled.handlePointerEnter(r)},this.#ze=()=>{this.#Le()},this._onKeyDown=e=>{if((e.ctrlKey||e.metaKey)&&e.key===`f`)return;if((e.ctrlKey||e.metaKey)&&e.key===`a`){this.selection.canSelectAll()&&(e.preventDefault(),this.selection.selectAll());return}let n=this.#_.count;if(n===0)return;let r=this.#fe(),i=this.#de(),a=()=>this.tickled.tickledId?this.#_.indexOfKey(this.tickled.tickledId):-1,o=e=>{let n=this.#_.keyAt(e);n&&(this.tickled.handleKeyboardNavigation(n),this.#pe(n))},s=e=>o(Math.max(0,Math.min(n-1,a()+e))),c=(e,n=1)=>{let c=a();if(c<0){s(e*n*r.cols);return}for(let r=0;r<n;r++)c=i.neighbour(c,e);o(c)},l=this.orientation===`grid`?r.cols:1;switch(e.key){case`ArrowLeft`:s(-1);break;case`ArrowRight`:s(1);break;case`ArrowUp`:this.orientation===`grid`?c(-1):s(-l);break;case`ArrowDown`:this.orientation===`grid`?c(1):s(l);break;case`Home`:this.tickled.handleKeyboardNavigation(`first`),this.tickled.tickledId&&this.#pe(this.tickled.tickledId);break;case`End`:this.tickled.handleKeyboardNavigation(`last`),this.tickled.tickledId&&this.#pe(this.tickled.tickledId);break;case`PageUp`:case`PageDown`:{let n=r.horizontal?this._viewportWidth:this._viewportHeight,i=r.horizontal?r.colStride:r.rowStride,a=Math.max(1,Math.floor(n/i));this.orientation===`grid`?c(e.key===`PageDown`?1:-1,a):s((e.key===`PageDown`?1:-1)*a*l);break}case`Enter`:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.#_e(`list-item-click`,n),this.#Je(n));break}case` `:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.selection.handleSpace(n));break}case`Escape`:this.#C&&this.#qe(),this.selection.clear();break;default:return}e.preventDefault()}}static{this.styles=[w,se,C,Ng(`x`),Ng(`y`),Gn,Ht,r`
|
|
7505
|
+
`;let ob=class extends n{constructor(...e){super(...e),this.label=``}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),ib(this,ab),this._observer=new MutationObserver(()=>this._sync())}firstUpdated(){this._fieldset=this.querySelector(`fieldset`)??void 0,this._fieldset&&(this._observer?.observe(this,{childList:!0,subtree:!0}),this._sync())}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_sync(){this._moveChildren(),this._updatePairs()}_updatePairs(){if(!this._fieldset)return;let e=Array.from(this._fieldset.querySelectorAll(`:scope > ixfx-form-row`)).map(e=>e.querySelectorAll(`:scope > ixfx-form-part`).length),n=Math.max(1,...e);this._fieldset.style.setProperty(`--ixfx-form-pairs`,String(n))}_moveChildren(){this._fieldset&&Array.from(this.children).filter(e=>e.tagName!==`FIELDSET`).forEach(e=>{this._fieldset.appendChild(e)})}render(){return i`<fieldset><legend>${this.label}</legend></fieldset>`}};E([d({type:String})],ob.prototype,`label`,void 0),E([d({type:String,attribute:`label-align`,reflect:!0})],ob.prototype,`labelAlign`,void 0),ob=E([T(`ixfx-form-group`)],ob);let sb=0,cb=class extends n{constructor(...e){super(...e),this.label=``,this.orientation=`horizontal`,this._labelId=`ixfx-form-options-${++sb}`}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),ib(this,ab),this.setAttribute(`role`,`group`),this.setAttribute(`aria-labelledby`,this._labelId),this._observer=new MutationObserver(()=>this._moveChildren())}firstUpdated(){this._observer?.observe(this,{childList:!0}),this._moveChildren()}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_moveChildren(){let e=this.querySelector(`:scope > .ixfx-form-options-items`);e&&Array.from(this.children).filter(e=>!e.classList.contains(`ixfx-form-options-items`)&&!e.classList.contains(`ixfx-form-options-label`)).forEach(n=>e.appendChild(n))}render(){return i`<span class="ixfx-form-options-label" id=${this._labelId}>${this.label}</span><div class="ixfx-form-options-items"></div>`}};E([d({type:String})],cb.prototype,`label`,void 0),E([d({type:String,reflect:!0})],cb.prototype,`orientation`,void 0),cb=E([T(`ixfx-form-options`)],cb);let lb=0,ub=class extends n{constructor(...e){super(...e),this.label=``}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),ib(this,ab),this._ensureId()}_ensureId(){let e=this.querySelector(`input, select, textarea, [name]`);e&&(e.id?this._id=e.id:(this._id=`ixfx-form-part-${++lb}`,e.id=this._id))}render(){return this._id||this._ensureId(),i`<label for=${this._id??``}>${this.label}</label>`}};E([d({type:String})],ub.prototype,`label`,void 0),ub=E([T(`ixfx-form-part`)],ub);let db=class extends n{createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),ib(this,ab),this._observer=new MutationObserver(()=>this._indexParts()),this._observer.observe(this,{childList:!0}),this._indexParts()}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}_indexParts(){Array.from(this.children).filter(e=>e.tagName===`IXFX-FORM-PART`).forEach((e,n)=>{e.style.setProperty(`--ixfx-form-part-index`,String(n+1))})}};db=E([T(`ixfx-form-row`)],db);function fb(e,n={}){let r={};return e.querySelectorAll(`[name]`).forEach(e=>{let i=e.getAttribute(`name`);i&&(e instanceof HTMLInputElement?e.type===`radio`?e.checked&&(r[i]=e.value):e.type===`checkbox`?r[i]=e.checked:n.typed&&(e.type===`number`||e.type===`range`)?r[i]=Number.isNaN(e.valueAsNumber)?null:e.valueAsNumber:r[i]=e.value:e instanceof HTMLSelectElement?e.multiple?r[i]=Array.from(e.selectedOptions).map(e=>e.value):r[i]=e.value:(e instanceof HTMLTextAreaElement||`value`in e)&&(r[i]=e.value))}),r}function pb(e,n){e.querySelectorAll(`[name]`).forEach(e=>{let r=e.getAttribute(`name`);if(!r||!(r in n))return;let i=n[r];e instanceof HTMLInputElement?(e.type===`radio`?e.checked=e.value===i:e.type===`checkbox`?e.checked=!!i:e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):e instanceof HTMLSelectElement?(e.multiple&&Array.isArray(i)?Array.from(e.options).forEach(e=>{e.selected=i.includes(e.value)}):e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):e instanceof HTMLTextAreaElement?(e.value=String(i??``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.dispatchEvent(new Event(`change`,{bubbles:!0}))):`value`in e&&(e.value=i)})}const mb=new Set([`button`,`submit`,`reset`,`image`,`file`,`color`]);let hb=class extends n{constructor(...e){super(...e),this.labelAlign=`right`,this.noValidate=!1,this._onKeydown=e=>{if(e.key!==`Enter`||e.defaultPrevented||e.isComposing||e.shiftKey||e.ctrlKey||e.altKey||e.metaKey)return;let n=e.target;!(n instanceof HTMLInputElement)||mb.has(n.type)||this.form.querySelector(`button:not([type]), button[type=submit], input[type=submit], input[type=image]`)||(e.preventDefault(),this.requestSubmit())}}createRenderRoot(){return this}get form(){return this._form||(this._form=document.createElement(`form`),this._form.addEventListener(`submit`,e=>e.preventDefault()),this._form.addEventListener(`keydown`,this._onKeydown)),this._form}get elements(){return this.form.elements}connectedCallback(){super.connectedCallback(),ib(this,ab),this._adoptChildren(),this._observer=new MutationObserver(()=>this._adoptChildren()),this._observer.observe(this,{childList:!0})}disconnectedCallback(){super.disconnectedCallback(),this._observer?.disconnect()}updated(){this.form.noValidate=this.noValidate}_adoptChildren(){let e=this.form;e.parentNode!==this&&this.append(e);let n=Array.from(this.childNodes).filter(n=>n!==e);n.length>0&&e.append(...n)}requestSubmit(){this.form.requestSubmit()}reset(){this.form.reset()}checkValidity(){return this.form.checkValidity()}reportValidity(){return this.form.reportValidity()}getValues(e){return fb(this,e)}setValues(e){pb(this,e)}};E([d({type:String,attribute:`label-align`,reflect:!0})],hb.prototype,`labelAlign`,void 0),E([d({type:Boolean,attribute:`novalidate`,reflect:!0})],hb.prototype,`noValidate`,void 0),hb=E([T(`ixfx-form`)],hb);function gb(e,n,r,i,a,o,s,c,l=2){let u=Math.max(1,n),d=Math.max(1,r),f=Math.max(0,i),p=u+f,m=d+f,h=Math.max(0,s);if(c===`row`){let n=e===0?0:1,r=e===0?0:(e-1)*p+u;if(e===0||a<=0)return{cols:e,rows:n,totalHeight:0,totalWidth:r,startIndex:0,endIndex:0,colStride:p,rowStride:m,horizontal:!0};let i=Math.max(0,Math.floor(h/p)),o=Math.ceil((h+a)/p);return{cols:e,rows:n,totalHeight:0,totalWidth:r,startIndex:Math.max(0,i-l),endIndex:Math.min(e,o+l),colStride:p,rowStride:m,horizontal:!0}}let g=c===`column`?1:Math.max(1,Math.floor((Math.max(0,a)+f)/p)),_=e===0?0:Math.ceil(e/g),v=_===0?0:(_-1)*m+d;if(e===0||o<=0)return{cols:g,rows:_,totalHeight:v,totalWidth:0,startIndex:0,endIndex:0,colStride:p,rowStride:m,horizontal:!1};let y=Math.max(0,Math.floor(h/m)),b=Math.ceil((h+o)/m),x=Math.max(0,y-l),S=Math.min(_,b+l);return{cols:g,rows:_,totalHeight:v,totalWidth:0,startIndex:x*g,endIndex:Math.min(e,S*g),colStride:p,rowStride:m,horizontal:!1}}function _b(e,n,r,i){let a=Math.max(0,e.gap),o=e.orientation===`row`,s=e=>o?e:Math.ceil(e/n),c=e=>e===0?0:(s(e)-1)*r+i;if(!e.groups){let n=c(e.count);return{sections:[{group:void 0,first:0,count:e.count,headerOffset:0,itemsOffset:0,end:n}],total:n,count:e.count}}let l=o?e.headerWidth:e.headerHeight,u=[],d=0,f=0;for(let n of e.groups){let e=n.collapsed?0:n.count,r=d+l+a,i=e===0?d+l:r+c(e);u.push({group:n,first:f,count:e,headerOffset:d,itemsOffset:r,end:i}),f+=e,d=i+a}return{sections:u,total:u.length===0?0:u[u.length-1].end,count:f}}function vb(e,n){let r=0,i=e.length-1;for(;r<i;){let a=r+i+1>>1;e[a].headerOffset<=n?r=a:i=a-1}return r}function yb(e,n){let r=0,i=e.length-1;for(;r<i;){let a=r+i+1>>1;e[a].first<=n?r=a:i=a-1}let a=r;for(;a<e.length-1&&e[a].count===0;)a++;return a}function bb(e){let n=e.orientation===`row`,r=Math.max(1,e.itemWidth),i=Math.max(1,e.rowHeight),a=Math.max(0,e.gap),o=r+a,s=i+a,c=n||e.orientation===`column`?1:Math.max(1,Math.floor((Math.max(0,e.viewportWidth)+a)/o)),l=n?o:s,u=n?r:i,{sections:d,total:f,count:p}=_b(e,c,l,u),m=e.groups!==void 0,h=n?e.headerWidth:e.headerHeight,g=n?e.viewportWidth:e.viewportHeight,_=s-a,v=Math.max(0,(e.viewportHeight-_)/2),y=e=>{let r=yb(d,e),i=d[r],a=Math.max(0,e-i.first);if(n)return{x:i.itemsOffset+a*o,y:v,col:0,line:a,section:r};let l=c<=1?0:a%c,u=c<=1?a:Math.floor(a/c);return{x:l*o,y:i.itemsOffset+u*s,col:l,line:u,section:r}};return{horizontal:n,cols:c,colStride:o,rowStride:s,grouped:m,count:p,totalExtent:f,window:(u,m=2)=>{let _=Math.max(0,u),v=[],y=[],b=_-m*l,x=_+g+m*l,S=0;if(d.length>1){let e=0,n=d.length-1;for(;e<n;){let r=e+n>>1;d[r].end>=b?n=r:e=r+1}S=e}if(g>0)for(let o=S;o<d.length;o++){let s=d[o];if(s.headerOffset>x)break;if(s.group&&s.headerOffset+h>=b&&v.push({key:s.group.key,label:s.group.label,count:s.group.count,collapsed:s.group.collapsed,offset:s.headerOffset,size:h}),s.count===0)continue;let c=_-s.itemsOffset,l=c<0?g+c:g;if(l<=0)continue;let u=gb(s.count,r,i,a,n?l:e.viewportWidth,n?e.viewportHeight:l,Math.max(0,c),e.orientation,m);u.endIndex>u.startIndex&&y.push([s.first+u.startIndex,s.first+u.endIndex])}return{cols:n?p:c,rows:0,totalHeight:n?0:f,totalWidth:n?f:0,startIndex:y.length>0?y[0][0]:0,endIndex:y.length>0?y[y.length-1][1]:0,colStride:o,rowStride:s,horizontal:n,headers:v,ranges:y}},positionOf:y,extentOf:e=>{let{line:n,section:r}=y(e),i=d[r],a=i.itemsOffset+n*l;return[n===0&&i.group?i.headerOffset:a,a+u]},neighbour:(e,n)=>{if(p===0)return e;let r=yb(d,e),i=d[r],a=e-i.first,o=a%c;if(n>0){let e=a+c;if(e<=i.count-1)return i.first+e;let n=Math.floor((i.count-1)/c);if(Math.floor(a/c)<n)return i.first+i.count-1;for(let e=r+1;e<d.length;e++)if(d[e].count>0)return d[e].first+Math.min(o,d[e].count-1);return i.first+i.count-1}let s=a-c;if(s>=0)return i.first+s;for(let e=r-1;e>=0;e--){let n=d[e];if(n.count>0){let e=Math.floor((n.count-1)/c);return n.first+Math.min(e*c+o,n.count-1)}}return i.first},hitTest:(e,r,i,a)=>{let u=[];if(p===0)return u;let f=n?e:i,m=n?r:a,h=vb(d,f-l);for(let l=Math.max(0,h);l<d.length;l++){let p=d[l];if(p.itemsOffset>m)break;if(!(p.count===0||p.end<f)){if(n){let n=Math.max(0,Math.floor((e-p.itemsOffset)/o)),i=Math.min(p.count-1,Math.floor((r-p.itemsOffset)/o));for(let e=n;e<=i;e++)u.push(p.first+e)}else{let n=Math.max(0,Math.floor(e/o)),l=Math.min(c-1,Math.floor(r/o)),d=Math.max(0,Math.floor((i-p.itemsOffset)/s)),f=Math.floor((a-p.itemsOffset)/s);for(let e=d;e<=f;e++)for(let r=n;r<=l;r++){let n=e*c+r;n>=0&&n<p.count&&u.push(p.first+n)}}}}return u},anchorAt:e=>{if(p===0)return{index:0,lineFrac:0};let r=vb(d,e);for(;r<d.length-1&&d[r].count===0;)r++;let i=d[r];if(i.count===0)return{index:0,lineFrac:0};let a=Math.max(0,e-i.itemsOffset)/l,o=Math.max(0,Math.floor(a)),s=n?Math.min(i.count-1,o):Math.min(i.count-1,o*c+Math.max(0,Math.floor((c-1)/2)));return{index:i.first+s,lineFrac:a-o}},offsetOfAnchor:(e,n)=>{let{line:r,section:i}=y(e);return d[i].itemsOffset+(r+n)*l},snapTarget:e=>{let r=vb(d,e),i=d[r],a=Math.round((e-i.itemsOffset)/l);if(m){let e=i.count===0?0:n?i.count:Math.ceil(i.count/c);a=Math.max(0,Math.min(Math.max(0,e-1),a))}let o=[i.itemsOffset+a*l];return m&&(o.push(i.headerOffset),r+1<d.length&&o.push(d[r+1].headerOffset)),o.reduce((n,r)=>Math.abs(r-e)<Math.abs(n-e)?r:n)}}}function xb(e,n,r){let i=gn(e,e=>n.groupKeyOf(e),n.labelOf?(e,r)=>n.labelOf(e,r.map(e=>n.itemAt(e))):void 0),a=[],o=[],s=new Map;for(let e of i){let i=n.collapsed.has(e.key);o.push({key:e.key,label:e.label,count:e.items.length,collapsed:i});for(let n of e.items)s.set(r(n),e.key),i||a.push(n)}return{order:a,groups:o,groupByKey:s}}const Sb=`gl-auto-`;function Cb(e){return e.startsWith(Sb)}function wb(e){let n=new Set,r=new Set;for(let i of e)Cb(i)||(n.has(i)?r.add(i):n.add(i));r.size>0&&console.warn(`ixfx-grid-list: duplicate item key(s) ${[...r].map(e=>`"${e}"`).join(`, `)} — the first occurrence wins for key-based operations.`)}function Tb(e){let n=new Map;return e.forEach((e,r)=>{n.has(e)||n.set(e,r)}),n}var Eb=class{#e;#t=[];#n=new WeakMap;#r=0;#i;#a;#o=[];#s;#c;#l;#u=[];#d=new Map;constructor(e){this.#e=e,this.refresh()}get count(){return this.#o.length}get rawCount(){return this.#t.length}keyAt(e){let n=this.#o[e];return n===void 0?``:this.#m(this.#t[n])}indexOfKey(e){return this.#c??=Tb(this.keys()),this.#c.get(e)??-1}keys(){return this.#s??=this.#o.map(e=>this.#m(this.#t[e])),this.#s}labelAt(e){let n=this.#o[e];return n===void 0?``:this.#h(this.#t[n])}rawKeyAt(e){let n=this.#t[e];return n===void 0?``:this.#m(n)}rawSearchTextAt(e){let n=this.#t[e];return n===void 0?``:n.getAttribute(`data-search-label`)??n.getAttribute(`data-label`)??n.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??n.textContent?.trim()??``}isSelectable(e){let n=this.#o[e];return n!==void 0&&!this.#t[n].hasAttribute(`not-checked`)}renderCellContent(e){}iconAt(e){}iconColorAt(e){}textColorAt(e){}badgeAt(e){}setFilters(e){`predicate`in e&&(this.#i=e.predicate),`searchKeys`in e&&(this.#a=e.searchKeys),this.#f()}setGrouping(e){this.#l=e,this.#f()}groups(){return this.#u}groupKeyOfKey(e){return this.#d.get(e)??null}refresh(){this.#t=Array.from(this.#e.querySelectorAll(`:scope > *`)).filter(e=>!e.hidden),wb(this.#t.map(e=>this.#m(e))),this.#f()}effectiveElements(){return this.#o.map(e=>this.#t[e])}rawElementAt(e){return this.#t[e]}resolveKeyToElement(e){return Cb(e)?this.#t.find(n=>this.#n.get(n)===e):this.#t.find(n=>D(n)===e)}resolveKeyToData(e){}#f(){let e=[];for(let n=0;n<this.#t.length;n++)if(!(this.#i!==void 0&&!this.#i(n))){if(this.#a!==void 0){let e=this.#m(this.#t[n]);if(!Cb(e)&&!this.#a.has(e))continue}e.push(n)}this.#p(e),this.#s=void 0,this.#c=void 0}#p(e){if(this.#l===void 0){this.#o=e,this.#u=[],this.#d=new Map;return}let n=xb(e,this.#l,e=>this.#m(this.#t[e]));this.#o=n.order,this.#u=n.groups,this.#d=n.groupByKey}#m(e){let n=D(e);if(n!==void 0)return n;let r=this.#n.get(e);return r===void 0&&(this.#r+=1,r=`${Sb}${this.#r}`,this.#n.set(e,r)),r}#h(e){return e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??``}},Db=class{#e;#t;#n;#r;#i=[];#a;#o;#s;#c=[];#l=new Map;constructor(e,n){this.#e=e,this.#t=n,wb(e.map((e,r)=>n.key(e,r))),this.#u()}get count(){return this.#i.length}get rawCount(){return this.#e.length}keyAt(e){let n=this.#i[e];return n===void 0?``:this.#t.key(this.#e[n],n)}indexOfKey(e){return this.#o??=Tb(this.keys()),this.#o.get(e)??-1}keys(){return this.#a??=this.#i.map(e=>this.#t.key(this.#e[e],e)),this.#a}labelAt(e){let n=this.#i[e];return n===void 0?``:this.#t.label?.(this.#e[n],n)??this.#t.key(this.#e[n],n)}rawKeyAt(e){return e<0||e>=this.#e.length?``:this.#t.key(this.#e[e],e)}rawSearchTextAt(e){if(e<0||e>=this.#e.length)return``;let n=this.#e[e];return this.#t.searchableText?.(n,e)??this.#t.label?.(n,e)??``}isSelectable(e){let n=this.#i[e];return n!==void 0&&!this.#t.disabled?.(this.#e[n],n)}renderCellContent(e){let n=this.#i[e];return n===void 0?void 0:this.#t.render(this.#e[n],n)}iconAt(e){let n=this.#i[e];return n===void 0||this.#t.icon===void 0?void 0:this.#t.icon(this.#e[n],n)}iconColorAt(e){let n=this.#i[e];return n===void 0?void 0:this.#t.iconColor?.(this.#e[n],n)}textColorAt(e){let n=this.#i[e];return n===void 0?void 0:this.#t.textColor?.(this.#e[n],n)}badgeAt(e){let n=this.#i[e];return n===void 0||this.#t.badge===void 0?void 0:this.#t.badge(this.#e[n],n)}setFilters(e){`predicate`in e&&(this.#n=e.predicate),`searchKeys`in e&&(this.#r=e.searchKeys),this.#u()}setGrouping(e){this.#s=e,this.#u()}groups(){return this.#c}groupKeyOfKey(e){return this.#l.get(e)??null}refresh(){this.#u()}rawItemAt(e){return this.#e[e]}getItemAt(e){let n=this.#i[e];return n===void 0?void 0:this.#e[n]}resolveKeyToElement(e){}resolveKeyToData(e){let n=this.#e.findIndex((n,r)=>this.#t.key(n,r)===e);return n>=0?this.#e[n]:void 0}#u(){let e=[];for(let n=0;n<this.#e.length;n++)this.#n!==void 0&&!this.#n(n)||this.#r!==void 0&&!this.#r.has(this.#t.key(this.#e[n],n))||e.push(n);if(this.#s===void 0)this.#i=e,this.#c=[],this.#l=new Map;else{let n=xb(e,this.#s,e=>this.#t.key(this.#e[e],e));this.#i=n.order,this.#c=n.groups,this.#l=n.groupByKey}this.#a=void 0,this.#o=void 0}};function Ob(e,n){return typeof e==`object`&&e?e[n]:void 0}function kb(e,n){return e.getAttribute(`data-${n}`)}function Ab(e,n){if(e===void 0||e.length!==n.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==n[r])return!1;return!0}function jb(e,n,r){for(let i of n)r.has(i)||i.removeAttribute(e);for(let n of r)n.hasAttribute(e)||n.setAttribute(e,``);return r}let K=class extends n{constructor(...e){super(...e),this.selectionMode=`single`,this.interactionMode=`standard`,this.disableHoverTickle=!1,this.disableScrollHoverTickle=!1,this.itemSize=160,this.gap=8,this.orientation=`grid`,this.captionStyle=`under`,this.captionAlign=`middle`,this.captionPosition=`bottom`,this.captionBackdrop=`scrim`,this.captionHeight=24,this.itemWrap=`stop`,this.itemsDraggable=!1,this.marqueeFromCellBlank=!1,this.snapToItem=!1,this.items=[],this.groupBy=null,this.crossGroupSelection=!1,this.groupHeaderHeight=28,this.groupHeaderWidth=120,this._collapsedGroups=new Set,this._scrollTop=0,this._scrollLeft=0,this._viewportHeight=0,this._viewportWidth=0,this.#e=x(),this.#i=0,this.#a=0,this.#o=[],this.#s=`stop`,this.#c=new Map,this.#l=0,this.#u=new Set,this.#d=[],this.#f=new Map,this.#p=new Set,this.#m=0,this.#g=new Eb(this),this.#_=this.#g,this.selection=new nr({getOrderedItems:()=>this.#_.keys(),isSelectable:e=>{let n=this.#_.indexOfKey(e);return n>=0&&this.#_.isSelectable(n)},getModes:()=>({selectionMode:this.selectionMode,interactionMode:this.interactionMode}),getKey:e=>e,getGroupKey:e=>this.groupBy===null?null:this.#_.groupKeyOfKey(e),crossGroupSelection:()=>this.crossGroupSelection,getFallbackGroupKey:()=>{let e=this.tickled.tickledId;return e!==void 0&&this.groupBy!==null?this.#_.groupKeyOfKey(e):null},onChange:(e,n)=>{this._syncItemStates(),this.requestUpdate(),this.#ge(e,n)}}),this.tickled=new oe(this,{getItems:()=>this.#_.keys().map((e,n)=>({id:e,enabled:this.#_.isSelectable(n)})),onTickle:e=>{this.#Oe(),e!==void 0&&this.#_e(`list-tickle`,e)},onStateChange:()=>this._syncItemStates(),itemWrap:this.#s,hoverDisabled:()=>this.disableHoverTickle||this.#A.isDragging||this.#E.isDragging}),this.#v=!1,this.#y=NaN,this.#b=NaN,this.#x=new Set,this.#C=!1,this.#w=void 0,this.#T=0,this.#E=new er(this,{source:`grid-list`,isEnabled:()=>this.itemsDraggable&&this.selectionMode!==`none`&&this.#_.count>0,resolveEventToKey:e=>{if(e instanceof Element){let n=(e.closest?.(`.cell`))?.dataset.key;if(n)return n;let r=(e.closest?.(`[data-key]`))?.dataset.key??e.dataset?.key??D(e);if(r)return r}},prepareSelection:e=>this.#O(e),getMetrics:()=>({itemSize:this.itemSize,captionStyle:this.captionStyle,captionHeight:this.captionHeight,rowHeight:this.#ee()}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>this._dispatch(`list-native-drag-start`,e,!0),onActiveChange:(e,n)=>{if(this.#C=e,this.#w=e?n:void 0,this.toggleAttribute(`data-native-dragging`,e),e){let e=[...this.selection.selectedKeys].filter(e=>!Cb(e)).length;this.setAttribute(`aria-label`,e<=1?`Dragging 1 item`:`Dragging ${e} items`)}else this.removeAttribute(`aria-label`);this.requestUpdate()},onEnd:()=>{this.#qe(),this.#Ke()},syncLightDomDraggable:()=>{for(let e of this.children)e instanceof HTMLElement&&(e.draggable=this.itemsDraggable)},shouldStart:e=>!(this.marqueeFromCellBlank&&this.#j(e))}),this.#k=null,this.#A=new Hn(this,{getSurface:()=>this.#e.value,isEnabled:()=>this.selection.canDragSelect()&&this.#_.count>0&&!this.hasAttribute(`disable-drag-select`),hitTest:e=>this.#M(e),getBaseSelection:()=>this.selection.selected,onPreview:(e,n)=>{this.#x=e,this.#S=n,this.requestUpdate()},onCommit:e=>{this.selection.applyDragSelection(e),this.#x=new Set,this.#S=void 0,this.requestUpdate()},autoScroll:(e,n)=>{let r=this.#e.value;r&&(e!==0&&(r.scrollLeft+=e,this._scrollLeft=r.scrollLeft),n!==0&&(r.scrollTop+=n,this._scrollTop=r.scrollTop))},shouldStart:e=>{if(this.marqueeFromCellBlank&&this.#j(e))return!0;for(let n of e.composedPath())if(n instanceof Element&&(n.classList.contains(`cell`)||n.classList.contains(`group-header`)))return!1;return!0}}),this.#Y=!1,this.#me=new Set,this.#he=new Set,this.#ve=new Set,this.#Ne=e=>{let n=e.target;this.#Ie(),this.#Be(),this.#i=requestAnimationFrame(()=>{this.#i=0,this._scrollTop=n.scrollTop,this._scrollLeft=n.scrollLeft,this.#K()}),this.#He()},this.#Pe=e=>{if(this.orientation!==`row`||e.ctrlKey||e.metaKey||e.deltaY===0)return;let n=this.#e.value??e.currentTarget;n&&(n.scrollWidth<=n.clientWidth+1||(this.#Ie(),n.scrollLeft+=e.deltaX+e.deltaY,e.preventDefault()))},this.#Re=e=>{let n=!Number.isNaN(this.#y)&&(e.clientX!==this.#y||e.clientY!==this.#b);if(this.#y=e.clientX,this.#b=e.clientY,!n||!this.#v||(this.#Le(),this.disableHoverTickle))return;let r=this.shadowRoot?.elementFromPoint?.(e.clientX,e.clientY)?.closest(`.cell`)?.getAttribute(`data-key`);r&&this.tickled.handlePointerEnter(r)},this.#ze=()=>{this.#Le()},this._onKeyDown=e=>{if((e.ctrlKey||e.metaKey)&&e.key===`f`)return;if((e.ctrlKey||e.metaKey)&&e.key===`a`){this.selection.canSelectAll()&&(e.preventDefault(),this.selection.selectAll());return}let n=this.#_.count;if(n===0)return;let r=this.#fe(),i=this.#de(),a=()=>this.tickled.tickledId?this.#_.indexOfKey(this.tickled.tickledId):-1,o=e=>{let n=this.#_.keyAt(e);n&&(this.tickled.handleKeyboardNavigation(n),this.#pe(n))},s=e=>o(Math.max(0,Math.min(n-1,a()+e))),c=(e,n=1)=>{let c=a();if(c<0){s(e*n*r.cols);return}for(let r=0;r<n;r++)c=i.neighbour(c,e);o(c)},l=this.orientation===`grid`?r.cols:1;switch(e.key){case`ArrowLeft`:s(-1);break;case`ArrowRight`:s(1);break;case`ArrowUp`:this.orientation===`grid`?c(-1):s(-l);break;case`ArrowDown`:this.orientation===`grid`?c(1):s(l);break;case`Home`:this.tickled.handleKeyboardNavigation(`first`),this.tickled.tickledId&&this.#pe(this.tickled.tickledId);break;case`End`:this.tickled.handleKeyboardNavigation(`last`),this.tickled.tickledId&&this.#pe(this.tickled.tickledId);break;case`PageUp`:case`PageDown`:{let n=r.horizontal?this._viewportWidth:this._viewportHeight,i=r.horizontal?r.colStride:r.rowStride,a=Math.max(1,Math.floor(n/i));this.orientation===`grid`?c(e.key===`PageDown`?1:-1,a):s((e.key===`PageDown`?1:-1)*a*l);break}case`Enter`:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.#_e(`list-item-click`,n),this.#Je(n));break}case` `:{let n=this.tickled.tickledId;n&&(e.preventDefault(),this.selection.handleSpace(n));break}case`Escape`:this.#C&&this.#qe(),this.selection.clear();break;default:return}e.preventDefault()}}static{this.styles=[w,se,C,Ng(`x`),Ng(`y`),Gn,Ht,r`
|
|
7468
7506
|
:host {
|
|
7469
7507
|
--grid-list-item-bg: var(--item-bg);
|
|
7470
7508
|
--grid-list-radius: var(--radius-m);
|
|
@@ -7850,7 +7888,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
7850
7888
|
.cell.dragging-origin {
|
|
7851
7889
|
opacity: 0.6;
|
|
7852
7890
|
}
|
|
7853
|
-
`]}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;#D(e){let n=`.cell[data-key="${CSS.escape(e)}"]`;return this.renderRoot.querySelector(n)??void 0}#O(e){let n=this.#_.indexOfKey(e);if(n<0||!this.#_.isSelectable(n))return;this.selection.selectedKeys.has(e)||this.selection.replace(e);let r=this.#_.keys().filter(e=>!vb(e)&&this.selection.selectedKeys.has(e)),i=[];for(let e of r){let n=this.#_.indexOfKey(e);if(n<0)continue;let r=this.#_.resolveKeyToData(e),a=this.#_.resolveKeyToElement(e),o=a??(this.#_ instanceof Sb?this.#D(e):void 0),s=r??a;s!==void 0&&i.push({key:e,index:n,item:s,...o?{element:o}:{}})}let a=i.find(n=>n.key===e);if(a)return{origin:a,selected:i}}#k;#A;#j(e){for(let n of e.composedPath())if(n instanceof Element)return n.classList.contains(`caption`)||n.matches?.(`input,button,a,select,textarea,[contenteditable]`)?!1:n.classList.contains(`content`)||n.classList.contains(`thumb`)?!0:(n.classList.contains(`cell`),!1);return!1}#M(e){if(this.#_.count===0)return[];let n=this.orientation===`row`,r=e.x+this._scrollLeft,i=r+e.width,a=n?0:e.y+this._scrollTop,o=n?0:a+e.height,s=this.#de().hitTest(r,i,a,o),c=[];for(let e of s){let n=this.#_.keyAt(e);!n||vb(n)||this.#_.isSelectable(e)&&c.push(n)}return c}#N;#P;#F(){let e=this.itemAdapter===void 0?`element`:`data`;if(this.#N===e&&this.search!==void 0)return;let n=this.search;n&&(n.hostDisconnected(),this.removeController(n)),this.search=e===`data`?new Vt(this,{adapter:kt(this,{rawCount:()=>this.#_?.rawCount??0,rawKeyAt:e=>this.#_?.rawKeyAt(e)??``,rawSearchTextAt:e=>this.#_?.rawSearchTextAt(e)??``,onFilterChange:e=>{this.#P=e,this.#_?.setFilters({searchKeys:e}),this.requestUpdate(),this.updateComplete.then(()=>this.#K())},onActivate:e=>this.#Je(e),getHighlightRoot:()=>this.renderRoot})}):new Vt(this,{adapter:Mt(this,{itemSelector:`:scope > *`,getLabel:e=>e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??e.getAttribute(`data-search-label`)??e.textContent?.trim()??``,highlightKey:`grid-list-search`})}),this.#N=e}#I;#L;get registry(){return this.#I}#R(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#z(){!this.#I||!this.search||(this.search.setModes(this.#R()),this.#L?.(),this.#L=Rt(this.#I,this.search))}connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.hasAttribute(`role`)||this.setAttribute(`role`,`listbox`),this.#$();for(let[e,n]of[[`caption-style`,this.captionStyle],[`caption-align`,this.captionAlign],[`caption-position`,this.captionPosition],[`caption-backdrop`,this.captionBackdrop]])this.hasAttribute(e)||this.setAttribute(e,n);this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`pointermove`,this.#Re,{passive:!0}),this.addEventListener(`pointerleave`,this.#ze),this.#n??=new MutationObserver(e=>this.#V(e)),this.#n.observe(this,{childList:!0}),this.#r??=new MutationObserver(e=>this.#B(e)),this.#r.observe(this,{subtree:!0,attributeFilter:[`hidden`,`data-key`,`data-value`]}),this.#I??=Yt(),this.#F(),this.#z()}disconnectedCallback(){super.disconnectedCallback(),this.#Oe(),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`pointermove`,this.#Re),this.removeEventListener(`pointerleave`,this.#ze),this.#Le(),this.#t?.disconnect(),this.#t=void 0,this.#n?.disconnect(),this.#r?.disconnect(),this.#Be(),this.#Ve(),this.#L?.(),this.#L=void 0,this.#I=void 0,this.#m&&=(clearTimeout(this.#m),0),(this.#C||this.#E.isDragging)&&this.#qe()}#B(e){e.some(e=>e.target.parentNode===this)&&this.#V([])}#V(e){let n=this.#o.length;this.#ae();let r=[];for(let n of e??[])for(let e of n.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let n=D(e);n!==void 0&&r.push(n)}if(r.length>0){let e=new Set(this.#_.keys()),n=r.filter(n=>!e.has(n));n.length>0&&this.selection.removeKeys(n,e=>e);let i=this.tickled.tickledId;i&&n.includes(i)&&this.tickled.focus(void 0)}this._syncItemStates(!0),this.#H(n,e),this.requestUpdate(),this.updateComplete.then(()=>this.#K())}#H(e,n){if(!this.hasUpdated||!n||n.length===0)return;let r=new Set(this.#o),i=[],a=0;for(let e of n){for(let n of e.addedNodes)n.nodeType===Node.ELEMENT_NODE&&r.has(n)&&i.push(n);for(let n of e.removedNodes)n.nodeType===Node.ELEMENT_NODE&&a++}if((i.length!==0||a!==0)&&(e!==0||a!==0)&&!(i.length>0&&i.length===this.#o.length)){for(let e of i)this.#p.add(e);this.#U()}}#U(){this.toggleAttribute(`reflowing`,!0),this.#m&&clearTimeout(this.#m),this.#m=window.setTimeout(()=>{this.#m=0,this.#p.clear(),this.toggleAttribute(`reflowing`,!1),this.requestUpdate()},320)}#W;#G;#K(){let e=this.renderedKeys(),n=this.visibleKeys();Tb(this.#W,e)&&Tb(this.#G,n)||(this.#W=e,this.#G=n,this._dispatch(`grid-list-viewport-change`,{renderedKeys:e,visibleKeys:n}))}firstUpdated(){this.#_||this.#q();let e=this.#e.value;e&&(this.#t=new ResizeObserver(e=>{for(let n of e){let e=n.contentRect.width,r=n.contentRect.height;if(e<=0||r<=0)return;if(e===this._viewportWidth&&r===this._viewportHeight)continue;let i=this.orientation===`row`,a=i?this._scrollLeft:this._scrollTop,o=i?this._viewportWidth:this._viewportHeight;o>0&&a>1&&this.#re(a,o,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this._viewportWidth=e,this._viewportHeight=r}}),this.#t.observe(e),this.#ie(!1),this.#ae(),this.requestUpdate(),this.#E.refreshDraggable())}#q(){this.itemAdapter===void 0?(this.#g=new xb(this),this.#_=this.#g):(this.#_=new Sb(this.items,this.itemAdapter),this.#g=void 0),this.#_.setGrouping(this.#X()),this.#J(),this.#P&&this.#_.setFilters({searchKeys:this.#P})}#J(){if(this.#_ instanceof xb){let e=this.filterPredicate,n=this.#_;n.setFilters({predicate:e?r=>e(n.rawElementAt(r)):void 0}),this.#o=n.effectiveElements()}else if(this.#_ instanceof Sb){let e=this.itemFilterPredicate,n=this.#_;n.setFilters({predicate:e?r=>e(n.rawItemAt(r),r):void 0})}}willUpdate(e){if(e.has(`searchModes`)&&this.#z(),(e.has(`filterPredicate`)||e.has(`itemFilterPredicate`))&&(this.#J(),this.updateComplete.then(()=>this.#K())),e.has(`items`)||e.has(`itemAdapter`)){this.#h=void 0;let e=this.#_?.keys()??[],n=this.itemAdapter!==void 0!=this.#_ instanceof Sb;this.#q();let r=this.#_.keys(),i=new Set(r),a=e.filter(e=>!i.has(e));a.length>0&&this.selection.removeKeys(a,e=>e);let o=this.tickled.tickledId;o&&!i.has(o)&&this.tickled.focus(void 0),this._syncItemStates(),this.updateComplete.then(()=>this.#K()),n&&(this.#F(),this.#z()),this.search?.refresh()}let n=e.has(`groupBy`)||e.has(`groupLabel`)||e.has(`_collapsedGroups`);if(n&&this.hasUpdated?(e.has(`groupBy`)&&(this._collapsedGroups.size>0&&(this._collapsedGroups=new Set),this.#Y=!0),this.#Z(),this.#Q(),this.#U(),this.updateComplete.then(()=>this.#K())):n&&this.#Z(),(e.has(`itemSize`)||e.has(`gap`))&&(this.itemSize=Math.max(16,Math.round(this.itemSize)),this.gap=Math.max(0,Math.round(this.gap))),e.has(`captionHeight`)&&(this.captionHeight=Math.max(0,Math.round(this.captionHeight))),e.has(`itemWrap`)&&(this.#s=this.itemWrap),(e.has(`itemSize`)||e.has(`gap`)||e.has(`captionStyle`)||e.has(`captionHeight`)||e.has(`orientation`))&&this.hasUpdated&&this.#_.count>0){let n=e.get(`orientation`)??this.orientation,r=n===`row`,i=r?this._scrollLeft:this._scrollTop,a=r?this._viewportWidth:this._viewportHeight;if(a>0&&i>1){let r=e.get(`itemSize`)??this.itemSize,o=e.get(`gap`)??this.gap,s=e.get(`captionStyle`)??this.captionStyle,c=e.get(`captionHeight`)??this.captionHeight;this.#re(i,a,r,o,s,c,n)}}}#Y;#X(){let e=this.groupBy;if(e==null||e===``)return;let n=this._collapsedGroups,r=this.#_;if(r instanceof Sb)return{groupKeyOf:n=>hn(e,r.rawItemAt(n),n,Cb),itemAt:e=>r.rawItemAt(e),labelOf:this.groupLabel,collapsed:n};let i=r;return{groupKeyOf:n=>hn(e,i.rawElementAt(n),n,wb),itemAt:e=>i.rawElementAt(e),labelOf:this.groupLabel,collapsed:n}}#Z(){this.#_.setGrouping(this.#X()),this.#_ instanceof xb&&(this.#o=this.#_.effectiveElements())}#Q(){let e=this.tickled.tickledId;e!==void 0&&this.#_.indexOfKey(e)<0&&this.tickled.focus(void 0)}get groups(){return this.groupBy===null?[]:this.#_.groups()}setGroupCollapsed(e,n){if(this._collapsedGroups.has(e)===n)return;let r=new Set(this._collapsedGroups);n?r.add(e):r.delete(e),this._collapsedGroups=r,this._dispatch(`list-group-toggle`,{groupKey:e,collapsed:n})}toggleGroup(e){this.setGroupCollapsed(e,!this._collapsedGroups.has(e))}collapseAllGroups(){for(let e of this.groups)this.setGroupCollapsed(e.key,!0)}expandAllGroups(){for(let e of[...this._collapsedGroups])this.setGroupCollapsed(e,!1)}#$(){this.setAttribute(`aria-multiselectable`,this.selection.canSelectMultiple()?`true`:`false`)}#ee(){let e=this.captionStyle===`separate`||this.captionStyle===`under`;return this.itemSize+(e?this.captionHeight:0)}#te(e){return e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??``}updated(e){super.updated(e);let n=this.#n?.takeRecords(),r=this.#r?.takeRecords();if(n!==void 0&&n.length>0?this.#V(n):r!==void 0&&r.length>0&&this.#B(r),this.#_ instanceof xb&&this.#Se(),(e.has(`selectionMode`)||e.has(`interactionMode`))&&(this.selection.clearAnchor(),this.#$()),e.has(`disableScrollHoverTickle`)&&!this.disableScrollHoverTickle&&this.#Le(),e.has(`itemsDraggable`)&&this.#E.refreshDraggable(),e.has(`orientation`)){let e=this.#e.value;e&&(this.orientation===`row`?(e.scrollTop=0,this._scrollTop=0):(e.scrollLeft=0,this._scrollLeft=0))}let i=this.#e.value;i&&(Math.abs(i.scrollTop-this._scrollTop)>.5&&(i.scrollTop=this._scrollTop),Math.abs(i.scrollLeft-this._scrollLeft)>.5&&(i.scrollLeft=this._scrollLeft)),this.#ne(),this.#ke(),this.#Y&&(this.#Y=!1,this._dispatch(`list-group-change`,{groupBy:this.groupBy}))}#ne(){if(!this.#h)return;let{index:e,lineFrac:n}=this.#h;this.#h=void 0;let r=this.#e.value;if(!r)return;let i=this.#de(),a=i.horizontal,o=a?this._viewportWidth:this._viewportHeight;if(o<=0)return;let s=i.offsetOfAnchor(e,n),c=Math.max(0,i.totalExtent-o),l=Math.min(c,Math.max(0,s-o/2));a?Math.abs(r.scrollLeft-l)>.5&&(r.scrollLeft=l,this._scrollLeft=l):Math.abs(r.scrollTop-l)>.5&&(r.scrollTop=l,this._scrollTop=l)}#re(e,n,r,i,a,o,s){if((this.#_?.count??0)===0)return;let c=r+(a===`separate`||a===`under`?o:0),l=this.#le({itemWidth:r,rowHeight:c,gap:i,orientation:s});this.#h=l.anchorAt(e+n/2)}refreshLayout(){this.#ie(!0)}remeasure(){this.#ie(!0)}#ie(e=!1){let n=this.#e.value;if(!n)return;let r=n.clientWidth,i=n.clientHeight;if(r<=0||i<=0)return;let a=this.orientation===`row`,o=r!==this._viewportWidth||i!==this._viewportHeight;if(o){let e=a?this._scrollLeft:this._scrollTop,n=a?r:i;this.#re(e,n,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this._viewportWidth=r,this._viewportHeight=i}e&&!o&&(this.#re(a?this._scrollLeft:this._scrollTop,a?r:i,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this.requestUpdate()),(o||e)&&this.updateComplete.then(()=>this.#K())}#ae(){this.#_ instanceof xb&&(this.#_.refresh(),this.#J())}get count(){return this.#_.count}get renderedCount(){return this.renderRoot.querySelectorAll(`.cell`).length}get selectedItems(){let e=new Set;for(let n of this.selection.selectedKeys){let r=this.#_.resolveKeyToElement(n);r&&e.add(r)}return e}get selectedKeys(){let e=new Set;for(let n of this.selection.selectedKeys)vb(n)||e.add(n);return e}select(e){let n=D(e);n&&this.selection.replace(n)}selectMany(e){let n=[];for(let r of e){let e=D(r);e&&n.push(e)}this.selection.selectMany(n)}deselect(e){let n=D(e);n&&this.selection.deselect(n)}clearSelection(){this.selection.clear()}selectAll(){this.selection.canSelectAll()&&this.selection.selectAll()}selectKeys(e){this.selection.selectKeys(e,e=>e)}addSelectedKeys(e){this.selection.addKeys(e,e=>e)}removeSelectedKeys(e){this.selection.removeKeys(e,e=>e)}#oe(e){let n=this.itemAdapter;return n?this.items.findIndex((r,i)=>n.key(r,i)===e):-1}setItems(e){this.itemAdapter&&(this.items=e)}appendItems(e){this.itemAdapter&&e.length>0&&(this.items=[...this.items,...e])}updateItem(e,n){if(!this.itemAdapter)return;let r=this.#oe(e);if(r<0)return;let i=[...this.items];i[r]=n,this.items=i}removeItems(e){if(!this.itemAdapter)return;let n=this.itemAdapter,r=new Set(e);this.items=this.items.filter((e,i)=>!r.has(n.key(e,i)))}clearItems(){this.itemAdapter&&(this.selection.reset(),this.tickled.focus(void 0),this.items=[],this.#ge(new Set,new Set))}focusKey(e){this.#_.indexOfKey(e)<0||(this.tickled.focus(e),this.#pe(e))}get tickledKey(){return this.tickled.tickledId}getItem(e){return this.#_.resolveKeyToElement(e)}getItemByIndex(e){return this.#o[e]}getData(e){return this.#_.resolveKeyToData(e)}getKey(e){return D(e)}renderedKeys(){return this.#se(this.#fe())}visibleKeys(){return this.#se(this.#fe(!0))}#se(e){let n=this.#_.keys(),r=[];for(let[i,a]of e.ranges)for(let e=i;e<a;e++)vb(n[e])||r.push(n[e]);return r}#ce(e={}){return{count:this.#_.count,groups:this.groupBy===null?void 0:this.#_.groups(),itemWidth:this.itemSize,rowHeight:this.#ee(),gap:this.gap,viewportWidth:this._viewportWidth,viewportHeight:this._viewportHeight,orientation:this.orientation,headerHeight:this.groupHeaderHeight,headerWidth:this.groupHeaderWidth,...e}}#le(e={}){return hb(this.#ce(e))}#ue;#de(){let e=this.#ce(),n=this.#ue;if(n){let r=n.params,i=r.groups===e.groups;for(let n of Object.keys(e)){if(!i)break;i=r[n]===e[n]}if(i)return n.layout}let r=hb(e);return this.#ue={params:e,layout:r},r}#fe(e=!1){return this.#de().window(this.orientation===`row`?this._scrollLeft:this._scrollTop,e?0:2)}#pe(e){let n=this.#_.indexOfKey(e),r=this.#e.value;if(n<0||!r)return;let[i,a]=this.#de().extentOf(n);if(this.orientation===`row`){let e=r.scrollLeft,n=e;i<e?n=i:a>e+this._viewportWidth&&(n=a-this._viewportWidth),n!==e&&(r.scrollLeft=n,this._scrollLeft=n);return}let o=r.scrollTop,s=o;i<o?s=i:a>o+this._viewportHeight&&(s=a-this._viewportHeight),s!==o&&(r.scrollTop=s,this._scrollTop=s)}#me;#he;_syncItemStates(e=!1){let n=this.selection.selectedKeys,r=this.tickled.tickledId,i=e=>{if(vb(e))return;let n=this.#_.indexOfKey(e);return n<0?void 0:this.#o[n]},a=r===void 0?void 0:i(r),o=new Set;for(let e of n){let n=i(e);n&&o.add(n)}if(e)for(let e of this.#o)this.#me.add(e),this.#he.add(e);this.#me=Eb(`data-tickled`,this.#me,a?new Set([a]):new Set),this.#he=Eb(`data-selected`,this.#he,o),this.setAttribute(`data-input-mode`,this.tickled.inputMode)}#ge(e,n){let r=new Set,i=new Set;for(let n of e){let e=this.#_.resolveKeyToElement(n);e&&r.add(e)}for(let e of n){let n=this.#_.resolveKeyToElement(e);n&&i.add(n)}this._dispatch(`list-select`,{selected:r,previous:i,selectedKeys:this.selectedKeys,previousKeys:new Set([...n].filter(e=>!vb(e)))})}#_e(e,n){let r=this.#_.indexOfKey(n),i=this.#_.resolveKeyToElement(n),a=i??this.#_.resolveKeyToData(n);this._dispatch(e,{item:a,key:n,index:r,element:i})}_dispatch(e,n,r=!1){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:r}))}#ve;#ye(e){return`left:${e.x}px;top:${e.y}px;width:${Math.max(0,e.width)}px;height:${Math.max(0,e.height)}px`}render(){let e=this.#fe();this.#ve=this.selection.selectedKeys;let n=e.horizontal?`width:${e.totalWidth}px;height:100%`:`height:${e.totalHeight}px`,r=e.horizontal?`scroll-fade-x`:`scroll-fade-y`;return i`
|
|
7891
|
+
`]}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;#C;#w;#T;#E;#D(e){let n=`.cell[data-key="${CSS.escape(e)}"]`;return this.renderRoot.querySelector(n)??void 0}#O(e){let n=this.#_.indexOfKey(e);if(n<0||!this.#_.isSelectable(n))return;this.selection.selectedKeys.has(e)||this.selection.replace(e);let r=this.#_.keys().filter(e=>!Cb(e)&&this.selection.selectedKeys.has(e)),i=[];for(let e of r){let n=this.#_.indexOfKey(e);if(n<0)continue;let r=this.#_.resolveKeyToData(e),a=this.#_.resolveKeyToElement(e),o=a??(this.#_ instanceof Db?this.#D(e):void 0),s=r??a;s!==void 0&&i.push({key:e,index:n,item:s,...o?{element:o}:{}})}let a=i.find(n=>n.key===e);if(a)return{origin:a,selected:i}}#k;#A;#j(e){for(let n of e.composedPath())if(n instanceof Element)return n.classList.contains(`caption`)||n.matches?.(`input,button,a,select,textarea,[contenteditable]`)?!1:n.classList.contains(`content`)||n.classList.contains(`thumb`)?!0:(n.classList.contains(`cell`),!1);return!1}#M(e){if(this.#_.count===0)return[];let n=this.orientation===`row`,r=e.x+this._scrollLeft,i=r+e.width,a=n?0:e.y+this._scrollTop,o=n?0:a+e.height,s=this.#de().hitTest(r,i,a,o),c=[];for(let e of s){let n=this.#_.keyAt(e);!n||Cb(n)||this.#_.isSelectable(e)&&c.push(n)}return c}#N;#P;#F(){let e=this.itemAdapter===void 0?`element`:`data`;if(this.#N===e&&this.search!==void 0)return;let n=this.search;n&&(n.hostDisconnected(),this.removeController(n)),this.search=e===`data`?new Vt(this,{adapter:kt(this,{rawCount:()=>this.#_?.rawCount??0,rawKeyAt:e=>this.#_?.rawKeyAt(e)??``,rawSearchTextAt:e=>this.#_?.rawSearchTextAt(e)??``,onFilterChange:e=>{this.#P=e,this.#_?.setFilters({searchKeys:e}),this.requestUpdate(),this.updateComplete.then(()=>this.#K())},onActivate:e=>this.#Je(e),getHighlightRoot:()=>this.renderRoot})}):new Vt(this,{adapter:Mt(this,{itemSelector:`:scope > *`,getLabel:e=>e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??e.getAttribute(`data-search-label`)??e.textContent?.trim()??``,highlightKey:`grid-list-search`})}),this.#N=e}#I;#L;get registry(){return this.#I}#R(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#z(){!this.#I||!this.search||(this.search.setModes(this.#R()),this.#L?.(),this.#L=Rt(this.#I,this.search))}connectedCallback(){super.connectedCallback(),this.hasAttribute(`tabindex`)||(this.tabIndex=0),this.hasAttribute(`role`)||this.setAttribute(`role`,`listbox`),this.#$();for(let[e,n]of[[`caption-style`,this.captionStyle],[`caption-align`,this.captionAlign],[`caption-position`,this.captionPosition],[`caption-backdrop`,this.captionBackdrop]])this.hasAttribute(e)||this.setAttribute(e,n);this.addEventListener(`keydown`,this._onKeyDown),this.addEventListener(`pointermove`,this.#Re,{passive:!0}),this.addEventListener(`pointerleave`,this.#ze),this.#n??=new MutationObserver(e=>this.#V(e)),this.#n.observe(this,{childList:!0}),this.#r??=new MutationObserver(e=>this.#B(e)),this.#r.observe(this,{subtree:!0,attributeFilter:[`hidden`,`data-key`,`data-value`]}),this.#I??=Yt(),this.#F(),this.#z()}disconnectedCallback(){super.disconnectedCallback(),this.#Oe(),this.removeEventListener(`keydown`,this._onKeyDown),this.removeEventListener(`pointermove`,this.#Re),this.removeEventListener(`pointerleave`,this.#ze),this.#Le(),this.#t?.disconnect(),this.#t=void 0,this.#n?.disconnect(),this.#r?.disconnect(),this.#Be(),this.#Ve(),this.#L?.(),this.#L=void 0,this.#I=void 0,this.#m&&=(clearTimeout(this.#m),0),(this.#C||this.#E.isDragging)&&this.#qe()}#B(e){e.some(e=>e.target.parentNode===this)&&this.#V([])}#V(e){let n=this.#o.length;this.#ae();let r=[];for(let n of e??[])for(let e of n.removedNodes){if(e.nodeType!==Node.ELEMENT_NODE)continue;let n=D(e);n!==void 0&&r.push(n)}if(r.length>0){let e=new Set(this.#_.keys()),n=r.filter(n=>!e.has(n));n.length>0&&this.selection.removeKeys(n,e=>e);let i=this.tickled.tickledId;i&&n.includes(i)&&this.tickled.focus(void 0)}this._syncItemStates(!0),this.#H(n,e),this.requestUpdate(),this.updateComplete.then(()=>this.#K())}#H(e,n){if(!this.hasUpdated||!n||n.length===0)return;let r=new Set(this.#o),i=[],a=0;for(let e of n){for(let n of e.addedNodes)n.nodeType===Node.ELEMENT_NODE&&r.has(n)&&i.push(n);for(let n of e.removedNodes)n.nodeType===Node.ELEMENT_NODE&&a++}if((i.length!==0||a!==0)&&(e!==0||a!==0)&&!(i.length>0&&i.length===this.#o.length)){for(let e of i)this.#p.add(e);this.#U()}}#U(){this.toggleAttribute(`reflowing`,!0),this.#m&&clearTimeout(this.#m),this.#m=window.setTimeout(()=>{this.#m=0,this.#p.clear(),this.toggleAttribute(`reflowing`,!1),this.requestUpdate()},320)}#W;#G;#K(){let e=this.renderedKeys(),n=this.visibleKeys();Ab(this.#W,e)&&Ab(this.#G,n)||(this.#W=e,this.#G=n,this._dispatch(`grid-list-viewport-change`,{renderedKeys:e,visibleKeys:n}))}firstUpdated(){this.#_||this.#q();let e=this.#e.value;e&&(this.#t=new ResizeObserver(e=>{for(let n of e){let e=n.contentRect.width,r=n.contentRect.height;if(e<=0||r<=0)return;if(e===this._viewportWidth&&r===this._viewportHeight)continue;let i=this.orientation===`row`,a=i?this._scrollLeft:this._scrollTop,o=i?this._viewportWidth:this._viewportHeight;o>0&&a>1&&this.#re(a,o,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this._viewportWidth=e,this._viewportHeight=r}}),this.#t.observe(e),this.#ie(!1),this.#ae(),this.requestUpdate(),this.#E.refreshDraggable())}#q(){this.itemAdapter===void 0?(this.#g=new Eb(this),this.#_=this.#g):(this.#_=new Db(this.items,this.itemAdapter),this.#g=void 0),this.#_.setGrouping(this.#X()),this.#J(),this.#P&&this.#_.setFilters({searchKeys:this.#P})}#J(){if(this.#_ instanceof Eb){let e=this.filterPredicate,n=this.#_;n.setFilters({predicate:e?r=>e(n.rawElementAt(r)):void 0}),this.#o=n.effectiveElements()}else if(this.#_ instanceof Db){let e=this.itemFilterPredicate,n=this.#_;n.setFilters({predicate:e?r=>e(n.rawItemAt(r),r):void 0})}}willUpdate(e){if(e.has(`searchModes`)&&this.#z(),(e.has(`filterPredicate`)||e.has(`itemFilterPredicate`))&&(this.#J(),this.updateComplete.then(()=>this.#K())),e.has(`items`)||e.has(`itemAdapter`)){this.#h=void 0;let e=this.#_?.keys()??[],n=this.itemAdapter!==void 0!=this.#_ instanceof Db;this.#q();let r=this.#_.keys(),i=new Set(r),a=e.filter(e=>!i.has(e));a.length>0&&this.selection.removeKeys(a,e=>e);let o=this.tickled.tickledId;o&&!i.has(o)&&this.tickled.focus(void 0),this._syncItemStates(),this.updateComplete.then(()=>this.#K()),n&&(this.#F(),this.#z()),this.search?.refresh()}let n=e.has(`groupBy`)||e.has(`groupLabel`)||e.has(`_collapsedGroups`);if(n&&this.hasUpdated?(e.has(`groupBy`)&&(this._collapsedGroups.size>0&&(this._collapsedGroups=new Set),this.#Y=!0),this.#Z(),this.#Q(),this.#U(),this.updateComplete.then(()=>this.#K())):n&&this.#Z(),(e.has(`itemSize`)||e.has(`gap`))&&(this.itemSize=Math.max(16,Math.round(this.itemSize)),this.gap=Math.max(0,Math.round(this.gap))),e.has(`captionHeight`)&&(this.captionHeight=Math.max(0,Math.round(this.captionHeight))),e.has(`itemWrap`)&&(this.#s=this.itemWrap),(e.has(`itemSize`)||e.has(`gap`)||e.has(`captionStyle`)||e.has(`captionHeight`)||e.has(`orientation`))&&this.hasUpdated&&this.#_.count>0){let n=e.get(`orientation`)??this.orientation,r=n===`row`,i=r?this._scrollLeft:this._scrollTop,a=r?this._viewportWidth:this._viewportHeight;if(a>0&&i>1){let r=e.get(`itemSize`)??this.itemSize,o=e.get(`gap`)??this.gap,s=e.get(`captionStyle`)??this.captionStyle,c=e.get(`captionHeight`)??this.captionHeight;this.#re(i,a,r,o,s,c,n)}}}#Y;#X(){let e=this.groupBy;if(e==null||e===``)return;let n=this._collapsedGroups,r=this.#_;if(r instanceof Db)return{groupKeyOf:n=>hn(e,r.rawItemAt(n),n,Ob),itemAt:e=>r.rawItemAt(e),labelOf:this.groupLabel,collapsed:n};let i=r;return{groupKeyOf:n=>hn(e,i.rawElementAt(n),n,kb),itemAt:e=>i.rawElementAt(e),labelOf:this.groupLabel,collapsed:n}}#Z(){this.#_.setGrouping(this.#X()),this.#_ instanceof Eb&&(this.#o=this.#_.effectiveElements())}#Q(){let e=this.tickled.tickledId;e!==void 0&&this.#_.indexOfKey(e)<0&&this.tickled.focus(void 0)}get groups(){return this.groupBy===null?[]:this.#_.groups()}setGroupCollapsed(e,n){if(this._collapsedGroups.has(e)===n)return;let r=new Set(this._collapsedGroups);n?r.add(e):r.delete(e),this._collapsedGroups=r,this._dispatch(`list-group-toggle`,{groupKey:e,collapsed:n})}toggleGroup(e){this.setGroupCollapsed(e,!this._collapsedGroups.has(e))}collapseAllGroups(){for(let e of this.groups)this.setGroupCollapsed(e.key,!0)}expandAllGroups(){for(let e of[...this._collapsedGroups])this.setGroupCollapsed(e,!1)}#$(){this.setAttribute(`aria-multiselectable`,this.selection.canSelectMultiple()?`true`:`false`)}#ee(){let e=this.captionStyle===`separate`||this.captionStyle===`under`;return this.itemSize+(e?this.captionHeight:0)}#te(e){return e.getAttribute(`data-label`)??e.querySelector(`[data-grid-list-caption]`)?.textContent?.trim()??``}updated(e){super.updated(e);let n=this.#n?.takeRecords(),r=this.#r?.takeRecords();if(n!==void 0&&n.length>0?this.#V(n):r!==void 0&&r.length>0&&this.#B(r),this.#_ instanceof Eb&&this.#Se(),(e.has(`selectionMode`)||e.has(`interactionMode`))&&(this.selection.clearAnchor(),this.#$()),e.has(`disableScrollHoverTickle`)&&!this.disableScrollHoverTickle&&this.#Le(),e.has(`itemsDraggable`)&&this.#E.refreshDraggable(),e.has(`orientation`)){let e=this.#e.value;e&&(this.orientation===`row`?(e.scrollTop=0,this._scrollTop=0):(e.scrollLeft=0,this._scrollLeft=0))}let i=this.#e.value;i&&(Math.abs(i.scrollTop-this._scrollTop)>.5&&(i.scrollTop=this._scrollTop),Math.abs(i.scrollLeft-this._scrollLeft)>.5&&(i.scrollLeft=this._scrollLeft)),this.#ne(),this.#ke(),this.#Y&&(this.#Y=!1,this._dispatch(`list-group-change`,{groupBy:this.groupBy}))}#ne(){if(!this.#h)return;let{index:e,lineFrac:n}=this.#h;this.#h=void 0;let r=this.#e.value;if(!r)return;let i=this.#de(),a=i.horizontal,o=a?this._viewportWidth:this._viewportHeight;if(o<=0)return;let s=i.offsetOfAnchor(e,n),c=Math.max(0,i.totalExtent-o),l=Math.min(c,Math.max(0,s-o/2));a?Math.abs(r.scrollLeft-l)>.5&&(r.scrollLeft=l,this._scrollLeft=l):Math.abs(r.scrollTop-l)>.5&&(r.scrollTop=l,this._scrollTop=l)}#re(e,n,r,i,a,o,s){if((this.#_?.count??0)===0)return;let c=r+(a===`separate`||a===`under`?o:0),l=this.#le({itemWidth:r,rowHeight:c,gap:i,orientation:s});this.#h=l.anchorAt(e+n/2)}refreshLayout(){this.#ie(!0)}remeasure(){this.#ie(!0)}#ie(e=!1){let n=this.#e.value;if(!n)return;let r=n.clientWidth,i=n.clientHeight;if(r<=0||i<=0)return;let a=this.orientation===`row`,o=r!==this._viewportWidth||i!==this._viewportHeight;if(o){let e=a?this._scrollLeft:this._scrollTop,n=a?r:i;this.#re(e,n,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this._viewportWidth=r,this._viewportHeight=i}e&&!o&&(this.#re(a?this._scrollLeft:this._scrollTop,a?r:i,this.itemSize,this.gap,this.captionStyle,this.captionHeight,this.orientation),this.requestUpdate()),(o||e)&&this.updateComplete.then(()=>this.#K())}#ae(){this.#_ instanceof Eb&&(this.#_.refresh(),this.#J())}get count(){return this.#_.count}get renderedCount(){return this.renderRoot.querySelectorAll(`.cell`).length}get selectedItems(){let e=new Set;for(let n of this.selection.selectedKeys){let r=this.#_.resolveKeyToElement(n);r&&e.add(r)}return e}get selectedKeys(){let e=new Set;for(let n of this.selection.selectedKeys)Cb(n)||e.add(n);return e}select(e){let n=D(e);n&&this.selection.replace(n)}selectMany(e){let n=[];for(let r of e){let e=D(r);e&&n.push(e)}this.selection.selectMany(n)}deselect(e){let n=D(e);n&&this.selection.deselect(n)}clearSelection(){this.selection.clear()}selectAll(){this.selection.canSelectAll()&&this.selection.selectAll()}selectKeys(e){this.selection.selectKeys(e,e=>e)}addSelectedKeys(e){this.selection.addKeys(e,e=>e)}removeSelectedKeys(e){this.selection.removeKeys(e,e=>e)}#oe(e){let n=this.itemAdapter;return n?this.items.findIndex((r,i)=>n.key(r,i)===e):-1}setItems(e){this.itemAdapter&&(this.items=e)}appendItems(e){this.itemAdapter&&e.length>0&&(this.items=[...this.items,...e])}updateItem(e,n){if(!this.itemAdapter)return;let r=this.#oe(e);if(r<0)return;let i=[...this.items];i[r]=n,this.items=i}removeItems(e){if(!this.itemAdapter)return;let n=this.itemAdapter,r=new Set(e);this.items=this.items.filter((e,i)=>!r.has(n.key(e,i)))}clearItems(){this.itemAdapter&&(this.selection.reset(),this.tickled.focus(void 0),this.items=[],this.#ge(new Set,new Set))}focusKey(e){this.#_.indexOfKey(e)<0||(this.tickled.focus(e),this.#pe(e))}get tickledKey(){return this.tickled.tickledId}getItem(e){return this.#_.resolveKeyToElement(e)}getItemByIndex(e){return this.#o[e]}getData(e){return this.#_.resolveKeyToData(e)}getKey(e){return D(e)}renderedKeys(){return this.#se(this.#fe())}visibleKeys(){return this.#se(this.#fe(!0))}#se(e){let n=this.#_.keys(),r=[];for(let[i,a]of e.ranges)for(let e=i;e<a;e++)Cb(n[e])||r.push(n[e]);return r}#ce(e={}){return{count:this.#_.count,groups:this.groupBy===null?void 0:this.#_.groups(),itemWidth:this.itemSize,rowHeight:this.#ee(),gap:this.gap,viewportWidth:this._viewportWidth,viewportHeight:this._viewportHeight,orientation:this.orientation,headerHeight:this.groupHeaderHeight,headerWidth:this.groupHeaderWidth,...e}}#le(e={}){return bb(this.#ce(e))}#ue;#de(){let e=this.#ce(),n=this.#ue;if(n){let r=n.params,i=r.groups===e.groups;for(let n of Object.keys(e)){if(!i)break;i=r[n]===e[n]}if(i)return n.layout}let r=bb(e);return this.#ue={params:e,layout:r},r}#fe(e=!1){return this.#de().window(this.orientation===`row`?this._scrollLeft:this._scrollTop,e?0:2)}#pe(e){let n=this.#_.indexOfKey(e),r=this.#e.value;if(n<0||!r)return;let[i,a]=this.#de().extentOf(n);if(this.orientation===`row`){let e=r.scrollLeft,n=e;i<e?n=i:a>e+this._viewportWidth&&(n=a-this._viewportWidth),n!==e&&(r.scrollLeft=n,this._scrollLeft=n);return}let o=r.scrollTop,s=o;i<o?s=i:a>o+this._viewportHeight&&(s=a-this._viewportHeight),s!==o&&(r.scrollTop=s,this._scrollTop=s)}#me;#he;_syncItemStates(e=!1){let n=this.selection.selectedKeys,r=this.tickled.tickledId,i=e=>{if(Cb(e))return;let n=this.#_.indexOfKey(e);return n<0?void 0:this.#o[n]},a=r===void 0?void 0:i(r),o=new Set;for(let e of n){let n=i(e);n&&o.add(n)}if(e)for(let e of this.#o)this.#me.add(e),this.#he.add(e);this.#me=jb(`data-tickled`,this.#me,a?new Set([a]):new Set),this.#he=jb(`data-selected`,this.#he,o),this.setAttribute(`data-input-mode`,this.tickled.inputMode)}#ge(e,n){let r=new Set,i=new Set;for(let n of e){let e=this.#_.resolveKeyToElement(n);e&&r.add(e)}for(let e of n){let n=this.#_.resolveKeyToElement(e);n&&i.add(n)}this._dispatch(`list-select`,{selected:r,previous:i,selectedKeys:this.selectedKeys,previousKeys:new Set([...n].filter(e=>!Cb(e)))})}#_e(e,n){let r=this.#_.indexOfKey(n),i=this.#_.resolveKeyToElement(n),a=i??this.#_.resolveKeyToData(n);this._dispatch(e,{item:a,key:n,index:r,element:i})}_dispatch(e,n,r=!1){return this.dispatchEvent(new CustomEvent(e,{detail:n,bubbles:!0,composed:!0,cancelable:r}))}#ve;#ye(e){return`left:${e.x}px;top:${e.y}px;width:${Math.max(0,e.width)}px;height:${Math.max(0,e.height)}px`}render(){let e=this.#fe();this.#ve=this.selection.selectedKeys;let n=e.horizontal?`width:${e.totalWidth}px;height:100%`:`height:${e.totalHeight}px`,r=e.horizontal?`scroll-fade-x`:`scroll-fade-y`;return i`
|
|
7854
7892
|
<div
|
|
7855
7893
|
class="viewport ${r}"
|
|
7856
7894
|
part="viewport"
|
|
@@ -7861,13 +7899,13 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
7861
7899
|
@click=${this.#Ge}
|
|
7862
7900
|
>
|
|
7863
7901
|
<div class="spacer" style=${n}>
|
|
7864
|
-
${this.#_ instanceof
|
|
7902
|
+
${this.#_ instanceof Db?this.#be(e):this.#Ae(e)}
|
|
7865
7903
|
${this.#je(e)}
|
|
7866
7904
|
</div>
|
|
7867
7905
|
${this.#S?i`<div class="marquee" part="marquee" style=${this.#ye(this.#S)}></div>`:``}
|
|
7868
7906
|
</div>
|
|
7869
7907
|
${this.search?.renderField()}
|
|
7870
|
-
`}#be(e){let n=this.#Ce(e);return _(n,e=>this.#c.get(this.#_.keyAt(e)),n=>this.#Te(n,e))}#xe(e){return`gl-cell-${this.#c.get(e)}`}#Se(){let e=new Map;for(let[n,r]of this.#d)e.set(n,r),n.getAttribute(`slot`)!==r&&n.setAttribute(`slot`,r);for(let n of this.#f.keys())e.has(n)||n.removeAttribute(`slot`);this.#f=e}#Ce(e){let n=e.ranges.flatMap(([e,n])=>Array.from({length:n-e},(n,r)=>e+r));return this.#we(n.map(e=>this.#_.keyAt(e))),n}#we(e){let n=new Set(e),r=[];for(let[e,i]of this.#c)n.has(e)||r.push(i);let i=new Map;for(let n of e){let e=this.#c.get(n);e!==void 0&&i.set(n,e)}let a=new Set;for(let n of e){if(i.has(n))continue;let e=r.pop();e===void 0?i.set(n,this.#l++):(i.set(n,e),a.add(n))}this.#c=i,this.#u=a}#Te(e,n){let r=this.#_.keyAt(e),o=this.#ve.has(r),s=this.#x.has(r),c=this.tickled.isTickled(r),l=this.#_.isSelectable(e),u=this.itemsDraggable&&l,d=this.captionStyle,f=d===`separate`,p=d===`hidden`?``:this.#_.labelAt(e),m=p!==``,h=n.rowStride-this.gap,{x:g,y:_}=this.#de().positionOf(e),v=f?`height:${Math.max(0,this.captionHeight-4)}px`:d===`under`?`height:${this.captionHeight}px`:``,y=this.#_.iconAt(e),b=
|
|
7908
|
+
`}#be(e){let n=this.#Ce(e);return _(n,e=>this.#c.get(this.#_.keyAt(e)),n=>this.#Te(n,e))}#xe(e){return`gl-cell-${this.#c.get(e)}`}#Se(){let e=new Map;for(let[n,r]of this.#d)e.set(n,r),n.getAttribute(`slot`)!==r&&n.setAttribute(`slot`,r);for(let n of this.#f.keys())e.has(n)||n.removeAttribute(`slot`);this.#f=e}#Ce(e){let n=e.ranges.flatMap(([e,n])=>Array.from({length:n-e},(n,r)=>e+r));return this.#we(n.map(e=>this.#_.keyAt(e))),n}#we(e){let n=new Set(e),r=[];for(let[e,i]of this.#c)n.has(e)||r.push(i);let i=new Map;for(let n of e){let e=this.#c.get(n);e!==void 0&&i.set(n,e)}let a=new Set;for(let n of e){if(i.has(n))continue;let e=r.pop();e===void 0?i.set(n,this.#l++):(i.set(n,e),a.add(n))}this.#c=i,this.#u=a}#Te(e,n){let r=this.#_.keyAt(e),o=this.#ve.has(r),s=this.#x.has(r),c=this.tickled.isTickled(r),l=this.#_.isSelectable(e),u=this.itemsDraggable&&l,d=this.captionStyle,f=d===`separate`,p=d===`hidden`?``:this.#_.labelAt(e),m=p!==``,h=n.rowStride-this.gap,{x:g,y:_}=this.#de().positionOf(e),v=f?`height:${Math.max(0,this.captionHeight-4)}px`:d===`under`?`height:${this.captionHeight}px`:``,y=this.#_.iconAt(e),b=Vg(y)?void 0:y;return i`
|
|
7871
7909
|
<div
|
|
7872
7910
|
class="cell${o?` selected`:``}${c?` tickled`:``}${s?` marquee`:``}${this.#u.has(r)?` recycled`:``}${this.#C&&r===this.#w?` dragging-origin`:``}"
|
|
7873
7911
|
part="item${o?` selected`:``}${c?` tickled`:``}"
|
|
@@ -7892,7 +7930,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
7892
7930
|
</div>
|
|
7893
7931
|
${m?this.#Ee(p,v,c,this.#_.badgeAt(e),this.#_.textColorAt(e)):``}
|
|
7894
7932
|
</div>
|
|
7895
|
-
`}#Ee(e,n,r,a,o){let s=
|
|
7933
|
+
`}#Ee(e,n,r,a,o){let s=Hg(o),c=s===void 0?n:`${n}${n.length>0?`;`:``}color:${s};`;if(Vg(a))return r?i`<div class="caption" part="caption" style=${c} title=${e}><ixfx-pan-text mode="loop">${e}</ixfx-pan-text></div>`:i`<div class="caption" part="caption" style=${c} title=${e}>${e}</div>`;let l=r?i`<ixfx-pan-text mode="loop">${e}</ixfx-pan-text>`:i`<span class="caption-text">${e}</span>`;return i`<div class="caption has-badge" part="caption" style=${c} title=${e}><span class="badge" part="badge">${a}</span>${l}</div>`}#De(e){let n=Hg(e);return n===void 0?a:`color:${n};`}#Oe(){let e=this.#k;this.#k=null;try{e?.stopLoop?.()}catch{}}#ke(){let e=this.renderRoot.querySelector(`.cell[data-tickled]`),n=[...this.renderRoot.querySelectorAll(`ixfx-pan-text[mode="loop"]`)],r=e?.querySelector(`ixfx-pan-text[mode="loop"]`)??null;for(let e of n)if(e!==r)try{e.stopLoop?.()}catch{}let i=this.#k;if(i&&i!==r)try{i.stopLoop?.()}catch{}if(!r){this.#k=null;return}this.#k=r,r.startLoop?.()}#Ae(e){let n=this.#Ce(e);return this.#d=n.map(e=>[this.#o[e],this.#xe(this.#_.keyAt(e))]),_(n,e=>this.#c.get(this.#_.keyAt(e)),n=>this.#Me(this.#o[n],n,e))}#je(e){if(e.headers.length===0)return a;let n=e.horizontal;return _(e.headers,e=>`__group__${e.key}`,e=>i`
|
|
7896
7934
|
<ixfx-list-group-header
|
|
7897
7935
|
class="group-header"
|
|
7898
7936
|
part="group-header"
|
|
@@ -7929,7 +7967,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
7929
7967
|
</div>
|
|
7930
7968
|
${h?this.#Ee(m,b,c):``}
|
|
7931
7969
|
</div>
|
|
7932
|
-
`}#Ne;#Pe;#Fe(e){this.#v||this.tickled.handlePointerEnter(e)}#Ie(){!this.disableScrollHoverTickle||this.#v||(this.#v=!0,this.toggleAttribute(`data-scroll-hover-suppress`,!0))}#Le(){this.#v&&(this.#v=!1,this.toggleAttribute(`data-scroll-hover-suppress`,!1))}#Re;#ze;#Be(){this.#i!==0&&(cancelAnimationFrame(this.#i),this.#i=0)}#Ve(){this.#a!==0&&(clearTimeout(this.#a),this.#a=0)}#He(){!this.snapToItem||this.orientation!==`row`&&this.orientation!==`column`||(this.#Ve(),this.#a=window.setTimeout(()=>{this.#a=0,this.#Ue()},120))}#Ue(){let e=this.#e.value;if(!e)return;let n=this.#de(),r=n.horizontal,i=r?e.scrollLeft:e.scrollTop,a=r?this._viewportWidth:this._viewportHeight,o=Math.max(0,n.totalExtent-a),s=Math.min(o,Math.max(0,n.snapTarget(i)));Math.abs(s-i)<.5||e.scrollTo(r?{left:s,behavior:`smooth`}:{top:s,behavior:`smooth`})}#We(e,n){this.#A.isDragging||this.#C||this.#E.isDragging||this.#T!==0||(this.selection.handleClick(n,e),this.#_e(`list-item-click`,n))}#Ge(e){let n=this.interactionMode;if(n!==`manual`&&(this.selectionMode!==`none`||n===`checked`||n===`sticky`)&&!(this.#A.isDragging||this.#C||this.#E.isDragging||this.#T!==0)){for(let n of e.composedPath())if(n instanceof Element&&(n.classList.contains(`cell`)||n.classList.contains(`group-header`)))return;this.selection.clear()}}#Ke(){this.#T&&clearTimeout(this.#T),this.#T=window.setTimeout(()=>{this.#T=0},0)}#qe(){this.#C=!1,this.#w=void 0,this.toggleAttribute(`data-native-dragging`,!1),this.removeAttribute(`aria-label`)}#Je(e){this.interactionMode!==`manual`&&this.selection.replace(e),this.#_e(`list-activate`,e)}};E([d({type:String,attribute:`selection-mode`})],K.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],K.prototype,`interactionMode`,void 0),E([d({type:Boolean,attribute:`disable-hover-tickle`,reflect:!0})],K.prototype,`disableHoverTickle`,void 0),E([d({type:Boolean,attribute:`disable-scroll-hover-tickle`,reflect:!0})],K.prototype,`disableScrollHoverTickle`,void 0),E([d({type:Number,attribute:`item-size`})],K.prototype,`itemSize`,void 0),E([d({type:Number})],K.prototype,`gap`,void 0),E([d({type:String,reflect:!0})],K.prototype,`orientation`,void 0),E([d({type:String,attribute:`caption-style`,reflect:!0})],K.prototype,`captionStyle`,void 0),E([d({type:String,attribute:`caption-align`,reflect:!0})],K.prototype,`captionAlign`,void 0),E([d({type:String,attribute:`caption-position`,reflect:!0})],K.prototype,`captionPosition`,void 0),E([d({type:String,attribute:`caption-backdrop`,reflect:!0})],K.prototype,`captionBackdrop`,void 0),E([d({type:Number,attribute:`caption-height`})],K.prototype,`captionHeight`,void 0),E([d({type:String,attribute:`item-wrap`})],K.prototype,`itemWrap`,void 0),E([d({attribute:!1})],K.prototype,`filterPredicate`,void 0),E([d({attribute:!1})],K.prototype,`itemFilterPredicate`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],K.prototype,`itemsDraggable`,void 0),E([d({type:Boolean,attribute:`marquee-from-cell-blank`,reflect:!0})],K.prototype,`marqueeFromCellBlank`,void 0),E([d({attribute:!1})],K.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],K.prototype,`dragPreviewSource`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],K.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`snap-to-item`,reflect:!0})],K.prototype,`snapToItem`,void 0),E([d({attribute:!1})],K.prototype,`items`,void 0),E([d({attribute:!1})],K.prototype,`itemAdapter`,void 0),E([d({attribute:`group-by`})],K.prototype,`groupBy`,void 0),E([d({attribute:!1})],K.prototype,`groupLabel`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],K.prototype,`crossGroupSelection`,void 0),E([d({type:Number,attribute:`group-header-height`})],K.prototype,`groupHeaderHeight`,void 0),E([d({type:Number,attribute:`group-header-width`})],K.prototype,`groupHeaderWidth`,void 0),E([m()],K.prototype,`_collapsedGroups`,void 0),E([m()],K.prototype,`_scrollTop`,void 0),E([m()],K.prototype,`_scrollLeft`,void 0),E([m()],K.prototype,`_viewportHeight`,void 0),E([m()],K.prototype,`_viewportWidth`,void 0),K=E([T(`ixfx-grid-list`)],K);let
|
|
7970
|
+
`}#Ne;#Pe;#Fe(e){this.#v||this.tickled.handlePointerEnter(e)}#Ie(){!this.disableScrollHoverTickle||this.#v||(this.#v=!0,this.toggleAttribute(`data-scroll-hover-suppress`,!0))}#Le(){this.#v&&(this.#v=!1,this.toggleAttribute(`data-scroll-hover-suppress`,!1))}#Re;#ze;#Be(){this.#i!==0&&(cancelAnimationFrame(this.#i),this.#i=0)}#Ve(){this.#a!==0&&(clearTimeout(this.#a),this.#a=0)}#He(){!this.snapToItem||this.orientation!==`row`&&this.orientation!==`column`||(this.#Ve(),this.#a=window.setTimeout(()=>{this.#a=0,this.#Ue()},120))}#Ue(){let e=this.#e.value;if(!e)return;let n=this.#de(),r=n.horizontal,i=r?e.scrollLeft:e.scrollTop,a=r?this._viewportWidth:this._viewportHeight,o=Math.max(0,n.totalExtent-a),s=Math.min(o,Math.max(0,n.snapTarget(i)));Math.abs(s-i)<.5||e.scrollTo(r?{left:s,behavior:`smooth`}:{top:s,behavior:`smooth`})}#We(e,n){this.#A.isDragging||this.#C||this.#E.isDragging||this.#T!==0||(this.selection.handleClick(n,e),this.#_e(`list-item-click`,n))}#Ge(e){let n=this.interactionMode;if(n!==`manual`&&(this.selectionMode!==`none`||n===`checked`||n===`sticky`)&&!(this.#A.isDragging||this.#C||this.#E.isDragging||this.#T!==0)){for(let n of e.composedPath())if(n instanceof Element&&(n.classList.contains(`cell`)||n.classList.contains(`group-header`)))return;this.selection.clear()}}#Ke(){this.#T&&clearTimeout(this.#T),this.#T=window.setTimeout(()=>{this.#T=0},0)}#qe(){this.#C=!1,this.#w=void 0,this.toggleAttribute(`data-native-dragging`,!1),this.removeAttribute(`aria-label`)}#Je(e){this.interactionMode!==`manual`&&this.selection.replace(e),this.#_e(`list-activate`,e)}};E([d({type:String,attribute:`selection-mode`})],K.prototype,`selectionMode`,void 0),E([d({type:String,attribute:`interaction-mode`})],K.prototype,`interactionMode`,void 0),E([d({type:Boolean,attribute:`disable-hover-tickle`,reflect:!0})],K.prototype,`disableHoverTickle`,void 0),E([d({type:Boolean,attribute:`disable-scroll-hover-tickle`,reflect:!0})],K.prototype,`disableScrollHoverTickle`,void 0),E([d({type:Number,attribute:`item-size`})],K.prototype,`itemSize`,void 0),E([d({type:Number})],K.prototype,`gap`,void 0),E([d({type:String,reflect:!0})],K.prototype,`orientation`,void 0),E([d({type:String,attribute:`caption-style`,reflect:!0})],K.prototype,`captionStyle`,void 0),E([d({type:String,attribute:`caption-align`,reflect:!0})],K.prototype,`captionAlign`,void 0),E([d({type:String,attribute:`caption-position`,reflect:!0})],K.prototype,`captionPosition`,void 0),E([d({type:String,attribute:`caption-backdrop`,reflect:!0})],K.prototype,`captionBackdrop`,void 0),E([d({type:Number,attribute:`caption-height`})],K.prototype,`captionHeight`,void 0),E([d({type:String,attribute:`item-wrap`})],K.prototype,`itemWrap`,void 0),E([d({attribute:!1})],K.prototype,`filterPredicate`,void 0),E([d({attribute:!1})],K.prototype,`itemFilterPredicate`,void 0),E([d({type:Boolean,attribute:`items-draggable`,reflect:!0})],K.prototype,`itemsDraggable`,void 0),E([d({type:Boolean,attribute:`marquee-from-cell-blank`,reflect:!0})],K.prototype,`marqueeFromCellBlank`,void 0),E([d({attribute:!1})],K.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],K.prototype,`dragPreviewSource`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],K.prototype,`searchModes`,void 0),E([d({type:Boolean,attribute:`snap-to-item`,reflect:!0})],K.prototype,`snapToItem`,void 0),E([d({attribute:!1})],K.prototype,`items`,void 0),E([d({attribute:!1})],K.prototype,`itemAdapter`,void 0),E([d({attribute:`group-by`})],K.prototype,`groupBy`,void 0),E([d({attribute:!1})],K.prototype,`groupLabel`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],K.prototype,`crossGroupSelection`,void 0),E([d({type:Number,attribute:`group-header-height`})],K.prototype,`groupHeaderHeight`,void 0),E([d({type:Number,attribute:`group-header-width`})],K.prototype,`groupHeaderWidth`,void 0),E([m()],K.prototype,`_collapsedGroups`,void 0),E([m()],K.prototype,`_scrollTop`,void 0),E([m()],K.prototype,`_scrollLeft`,void 0),E([m()],K.prototype,`_viewportHeight`,void 0),E([m()],K.prototype,`_viewportWidth`,void 0),K=E([T(`ixfx-grid-list`)],K);let Mb=class extends n{constructor(...e){super(...e),this.collapsed=!1,this.orientation=`horizontal`,this.closable=!1,this.collapsible=!0,this.title=``,this.iconName=``,this.toggleInteraction=`implicit`,this.variant=`titlebar`,this.hideTitlebar=!1,this.keepToolbar=!1,this.stickyHeader=!1}_onTitlebarToggle(e){e.stopPropagation(),this.collapsed=e.detail.collapsed,this.dispatchEvent(new CustomEvent(`toggle`,{detail:{collapsed:this.collapsed},bubbles:!0,composed:!0}))}_onCloseClick(e){e.stopPropagation(),this.dispatchEvent(new CustomEvent(`close`,{bubbles:!0,composed:!0})),this.remove()}render(){let e=this.keepToolbar||!this.collapsed;return i`
|
|
7933
7971
|
${this.hideTitlebar?a:i`
|
|
7934
7972
|
<ixfx-titlebar
|
|
7935
7973
|
.title=${this.title}
|
|
@@ -8082,13 +8120,13 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8082
8120
|
height: 100%;
|
|
8083
8121
|
transform: none;
|
|
8084
8122
|
}
|
|
8085
|
-
`]}};E([d({type:Boolean,reflect:!0})],Db.prototype,`collapsed`,void 0),E([d({type:String,attribute:`orientation`,reflect:!0})],Db.prototype,`orientation`,void 0),E([d({type:Boolean})],Db.prototype,`closable`,void 0),E([d({type:Boolean,reflect:!0})],Db.prototype,`collapsible`,void 0),E([d({type:String})],Db.prototype,`title`,void 0),E([d({type:String,attribute:`icon-name`})],Db.prototype,`iconName`,void 0),E([d({type:String,attribute:`toggle-interaction`})],Db.prototype,`toggleInteraction`,void 0),E([d({type:String,attribute:`variant`,reflect:!0})],Db.prototype,`variant`,void 0),E([d({type:Boolean,attribute:`hide-titlebar`})],Db.prototype,`hideTitlebar`,void 0),E([d({type:Boolean,attribute:`keep-toolbar`})],Db.prototype,`keepToolbar`,void 0),E([d({type:Boolean,attribute:`sticky-header`,reflect:!0})],Db.prototype,`stickyHeader`,void 0),Db=E([T(`ixfx-panel`)],Db);const Ob=`__ungrouped__`;let kb=class extends n{constructor(...e){super(...e),this.grouped=!1,this.crossGroupSelection=!1,this.#n=new Map,this.#i=!1,this.#a=new je(this),this.#d=e=>{if(this.#i)return;let n=e.target,r;for(let[e,i]of this.#n)if(i===n){r=e;break}if(r!==void 0){if(this.grouped&&!this.crossGroupSelection){this.#i=!0;for(let[e,n]of this.#n)e!==r&&n.clearSelection();this.#i=!1}this.dispatchEvent(new CustomEvent(`grouped-select`,{detail:{selected:this.selectedItems,groupKey:r===Ob?void 0:r},bubbles:!0,composed:!0}))}}}#e;#t;#n;#r;#i;#a;get groupBy(){return this.#e}set groupBy(e){this.#e=e,this.requestUpdate()}get factory(){return this.#t}set factory(e){e!==this.#t&&(this.#s(),this.#t=e,this.requestUpdate())}get provider(){return this.#a.provider}set provider(e){this.#a.provider=e,e&&this.#a.request(void 0)}get selectedItems(){let e=new Set;for(let n of this.#n.values())for(let r of n.selectedItems)e.add(r);return e}dispatch(e,n){for(let r of this.#n.values())r.dispatch(e,n)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener(`select`,this.#d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`select`,this.#d)}updated(e){super.updated(e),e.has(`grouped`)&&this.#s(),this.#c()}render(){return this.#t?this.grouped?this.#e?(this.#r=this.#o(),i`${_(this.#r.keys(),e=>e,e=>i`<ixfx-panel data-group-key=${e} .title=${e}></ixfx-panel>`)}`):a:i`<div class="ungrouped-host"></div>`:a}#o(){let e=new Map;if(!this.#e)return e;for(let n of this.#a.items){let r=this.#e(n),i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return e}#s(){for(let e of this.#n.values())e.remove();this.#n.clear()}#c(){if(this.#t){if(!this.grouped){this.#l();return}this.#e&&this.#u()}}#l(){let e=this.querySelector(`.ungrouped-host`);if(!e)return;let n=this.#n.get(Ob);n||(n=this.#t(void 0),e.appendChild(n),this.#n.set(Ob,n)),n.setItems(this.#a.items)}#u(){let e=this.#r??this.#o();for(let n of[...this.#n.keys()])e.has(n)||(this.#n.get(n)?.remove(),this.#n.delete(n));for(let[n,r]of e){let e=[...this.children].find(e=>e instanceof HTMLElement&&e.dataset.groupKey===n);if(!e)continue;let i=this.#n.get(n);i||(i=this.#t(n),e.appendChild(i),this.#n.set(n,i)),i.setItems(r)}}#d};E([d({type:Boolean,reflect:!0})],kb.prototype,`grouped`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],kb.prototype,`crossGroupSelection`,void 0),kb=E([T(`ixfx-grouped-item-lister`)],kb);const Ab=`application/x-ixfx-tree`,jb=new Map,Mb=new Map;let Nb,Pb=0;function Fb(){return`tree-drag-${++Pb}-${Date.now()}`}function Ib(e,n,r,i){jb.set(e,{sourceId:e,nodes:r,keys:i}),Mb.set(e,new WeakRef(n)),Nb=e}function Lb(e){jb.delete(e),Mb.delete(e),Nb===e&&(Nb=void 0)}function Rb(){if(Nb===void 0)return;let e=jb.get(Nb);if(e)return{sourceId:Nb,keys:e.keys,nodes:e.nodes,element:Mb.get(Nb)?.deref()}}const zb={direction:0,depth:0};function Bb(e){return Math.min(e/2,Math.max(24,Math.min(64,e*.2)))}function Vb(e,n){if(n<=0)return zb;let r=Bb(n);return e<r?{direction:-1,depth:Math.min(1,(r-e)/r)}:e>n-r?{direction:1,depth:Math.min(1,(e-(n-r))/r)}:zb}function Hb(e,n){let r=Math.min(1,Math.max(0,n)/2500);return(120+3080*r*r)*(.35+.65*Math.min(1,Math.max(0,e)))}function Ub(e,n,r){return Math.max(n,Math.min(r,e))}var Wb=class{#e;#t;#n=!1;#r;#i=`internal`;#a=[];#o=[];#s;#c;#l=0;#u=0;#d=0;#f=0;#p=0;#m=0;#h=0;#g;#_=!1;#v;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get isDragging(){return this.#n}get isRejected(){return this.#n&&this.#r===void 0}get dropState(){return this.#r}hostConnected(){this.#y()}hostUpdated(){this.#y()}#y(){let e=this.#t.getScrollContainer();!e||e===this.#v||(this.#b(),this.#v=e,e.addEventListener(`dragenter`,this.#x),e.addEventListener(`dragover`,this.#S),e.addEventListener(`dragleave`,this.#w),e.addEventListener(`drop`,this.#T))}#b(){let e=this.#v;e&&(e.removeEventListener(`dragenter`,this.#x),e.removeEventListener(`dragover`,this.#S),e.removeEventListener(`dragleave`,this.#w),e.removeEventListener(`drop`,this.#T),this.#v=void 0)}hostDisconnected(){this.#b(),this.#A(),this.#N(),this.#n=!1,this.#r=void 0}#x=e=>{this.#t.getDndMode()===`none`||!e.dataTransfer||this.#t.resolveDrag(e.dataTransfer,`hover`)!==void 0&&(e.preventDefault(),this.#n||(this.#n=!0,this.#t.onActiveChange(!0)))};#S=e=>{if(this.#t.getDndMode()===`none`||!e.dataTransfer)return;this.#u=e.clientX,this.#d=e.clientY,this.#g=e;let n=this.#t.resolveDrag(e.dataTransfer,`hover`);if(!n){this.#C(e);return}this.#n||(this.#n=!0,this.#t.onActiveChange(!0)),this.#i=n.source,this.#a=n.keys,this.#o=n.nodes;let r=this.#t.getVisibleRows();this.#k(this.#D(r,e.clientY)),this.#j();let i=this.#O(e,r,n.source);if(!i){this.#C(e,!1);return}let a={source:n.source,dragged:n.nodes.length>0?n.nodes:void 0,draggedKeys:n.keys,target:i,dataTransfer:e.dataTransfer};if(!this.#t.vet(a)){this.#C(e,!1);return}e.preventDefault(),e.dataTransfer.dropEffect=n.source===`internal`?`move`:`copy`,this.#P(i)};#C(e,n=!0){e.dataTransfer&&(e.dataTransfer.dropEffect=`none`),this.#P(void 0),n&&this.#A()}#w=e=>{let n=this.#t.getScrollContainer(),r=e.relatedTarget;n&&r&&n.contains(r)||this.#E()};#T=e=>{if(!e.dataTransfer){this.#E();return}e.preventDefault(),this.#N(),this.#A();let n=e=>{this.#r=void 0,this.#n=!1,this.#t.onDropStateChange(void 0),this.#t.onActiveChange(!1),this.#t.onDragEnd(e)};if(this.#t.getDndMode()===`none`){n(!1);return}let r=this.#t.resolveDrag(e.dataTransfer,`drop`);if(!r){n(!1);return}this.#a=r.keys,this.#o=r.nodes;let i=this.#O(e,this.#t.getVisibleRows(),r.source);if(!i){n(!1);return}let a={source:r.source,dragged:r.nodes.length>0?r.nodes:void 0,draggedKeys:r.keys,target:i,dataTransfer:e.dataTransfer};if(!this.#t.vet(a)){n(!1);return}let o={...a,external:r.source===`external`?r.nodes:void 0};n(this.#t.commitDrop(o))};#E(){this.#A(),this.#N(),this.#r!==void 0&&(this.#r=void 0,this.#t.onDropStateChange(void 0)),this.#n&&(this.#n=!1,this.#t.onActiveChange(!1))}#D(e,n){if(e.length!==0)return n<e[0].rect.top?e[0]:n>e[e.length-1].rect.bottom?e[e.length-1]:e.find(e=>n>=e.rect.top&&n<=e.rect.bottom)??e[e.length-1]}#O(e,n,r){if(n.length===0)return;let i=this.#D(n,e.clientY);if(!i)return;let a=Ub((e.clientY-i.rect.top)/i.rect.height,0,1),o=a<.25?`before`:a>.75?`after`:`inside`,s=i.node.item.isLeaf===!0;o===`inside`&&s&&(o=`after`);let c=!1;o===`after`&&!s&&this.#t.isExpanded(i.key)&&(o=`inside`,c=!0);let l,u,d,f;if(o===`inside`)l=i.key,u=i.key,d=i.depth+1,f=c?0:i.node.children?.length??0;else{let r=this.#t.getIndentPx()||1,a=n[0].rect.left,s=Ub(Math.round((e.clientX-a)/r),0,i.depth),c={node:i.node,depth:i.depth,parentKey:this.#t.getRowInfo(i.key)?.parentKey};u=i.key;for(let e=i.depth-s;e>0&&c.parentKey!==void 0;e--){let e=this.#t.getRowInfo(c.parentKey);if(!e)break;u=c.parentKey,c=e}d=c.depth,l=c.parentKey;let p=this.#t.getChildren(l).findIndex(e=>e.item.key===u);f=(p<0?0:p)+ +(o===`after`)}if(r===`internal`){for(let e of this.#a)if(e===l||e===u||l!==void 0&&this.#t.isSelfOrDescendant(e,l)||o!==`inside`&&this.#t.isSelfOrDescendant(e,u))return;if(this.#a.length>0&&!this.#t.isReorderAllowed()&&!this.#a.some(e=>this.#t.getParentKey(e)!==l))return}return{parentKey:l,index:f,referenceKey:u,position:o,depth:d}}#k(e){if(!e||e.node.item.isLeaf===!0||this.#t.isExpanded(e.key)){this.#A();return}if(e.key===this.#c)return;this.#A();let n=this.#c=e.key;this.#s=setTimeout(()=>{this.#s=void 0,this.#c===n&&(this.#c=void 0,this.#t.expandKey(n))},Math.max(0,this.#t.getExpandHoverMs()))}#A(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0),this.#c=void 0}#j(){this.#l===0&&(this.#l=requestAnimationFrame(this.#M))}#M=e=>{if(this.#l=0,!this.#n)return;let n=this.#t.getScrollContainer();if(!n||this.#_&&this.#g&&(this.#_=!1,this.#S(this.#g),!this.#n))return;let r=n.getBoundingClientRect(),i=this.#u>=r.left&&this.#u<=r.right?Vb(this.#d-r.top,r.height):{direction:0,depth:0};if(i.direction!==this.#f&&(this.#f=i.direction,this.#p=e,this.#m=e,this.#h=0),i.direction===0)return;let a=Math.min(50,Math.max(0,e-this.#m));this.#m=e;let o=Hb(i.depth,e-this.#p),s=i.direction*o*a/1e3+this.#h,c=Math.trunc(s);if(this.#h=s-c,c!==0){let e=n.scrollTop;n.scrollTop=e+c,n.scrollTop!==e&&(this.#_=!0)}this.#j()};#N(){this.#l!==0&&(cancelAnimationFrame(this.#l),this.#l=0),this.#f=0,this.#h=0,this.#_=!1,this.#g=void 0}#P(e){let n=e===void 0?this.#r===void 0:e.referenceKey===this.#r?.referenceKey&&e.position===this.#r?.position&&e.depth===this.#r?.depth&&e.index===this.#r?.index;this.#r=e,(!n||this.#n)&&this.#t.onDropStateChange(e)}};function Gb(e,n){let r=[],i=new Map,a=[],o=(e,r,i)=>{if(!e||e.length===0)return;let o=e.filter(e=>n.isShown(e,r));for(let e=o.length-1;e>=0;e--)a.push({node:o[e],depth:r,parentKey:i,posInSet:e+1,setSize:o.length})};for(o(e.children,0,void 0);a.length>0;){let{node:e,depth:s,parentKey:c,posInSet:l,setSize:u}=a.pop();i.set(e.item.key,r.length),r.push({node:e,depth:s,parentKey:c,posInSet:l,setSize:u}),e.children&&e.children.length>0&&n.isExpanded(e,s)&&o(e.children,s+1,e.item.key)}return{rows:r,indexByKey:i}}function Kb(e){let n=new Map,r=new Set,i=new Set([e.item.key]),a=new Set,o=[];if(e.children)for(let r of e.children)n.set(r.item.key,e.item.key),o.push({node:r,depth:0,parentKey:e.item.key});for(;o.length>0;){let{node:e,depth:s,parentKey:c}=o.pop();if(i.has(e.item.key)&&a.add(e.item.key),i.add(e.item.key),n.set(e.item.key,c),e.item.icon&&r.add(s),e.children)for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];o.push({node:r,depth:s+1,parentKey:e.item.key})}}if(a.size>0){let e=[...a].slice(0,5).map(e=>`"${e}"`).join(`, `);console.warn(`[ixfx-tree] ${a.size} duplicate item key(s) in tree (e.g. ${e}). Keys must be unique across the whole tree; duplicates break checkbox state, expansion and selection.`)}return{parentByKey:n,depthsWithIcons:r}}function qb(e,n){let r=new Set;if(!e.children)return r;let i=[],a=(e,r)=>{i.push({node:e,depth:r,next:0,matched:n(e,r)})};for(let n of e.children)for(a(n,0);i.length>0;){let e=i[i.length-1],n=e.node.children;if(n&&e.next<n.length){a(n[e.next++],e.depth+1);continue}i.pop(),e.matched&&(r.add(e.node.item.key),i.length>0&&(i[i.length-1].matched=!0))}return r}function Jb(e,n,r){if(r.size===0)return[...e];let i=new Set;for(let n of e)i.add(n.node.item.key);let a=Symbol(`end`),o=new Map,s=a;for(let e=n.length-1;e>=0;e--){let a=n[e];if(i.has(a)){s=a;continue}let c=r.get(a);if(!c)continue;let l=o.get(s);l?l.push(c):o.set(s,[c])}let c=[];for(let n of e){let e=o.get(n.node.item.key);if(e)for(let n=e.length-1;n>=0;n--)c.push(e[n]);c.push(n)}let l=o.get(a);if(l)for(let e=l.length-1;e>=0;e--)c.push(l[e]);return c}function Yb(e,n){let r=new Map;if(!e.children)return r;let i=[];for(let a of e.children)for(i.push({node:a,next:0,checked:0,unchecked:0,counted:0});i.length>0;){let e=i[i.length-1],{node:a}=e,o=a.children,s=a.item.isLeaf||!o?.length;if(!s&&e.next<o.length){i.push({node:o[e.next++],next:0,checked:0,unchecked:0,counted:0});continue}i.pop();let c;c=s?n.has(a)?`checked`:`unchecked`:e.counted===0?`unchecked`:e.checked===e.counted?`checked`:e.unchecked===e.counted?`unchecked`:`indeterminate`,r.set(a.item.key,c);let l=s&&a.item.selectable===!1;if(i.length>0&&!l){let e=i[i.length-1];e.counted++,c===`checked`?e.checked++:c===`unchecked`&&e.unchecked++}}return r}function Xb(e,n){if(e.has(n))return e;let r=new Set(e);return r.add(n),r}function Zb(e,n){if(!e.has(n))return e;let r=new Set(e);return r.delete(n),r}function Qb(e,n){let r;for(let i of e)n(i)&&(r??=new Set(e),r.delete(i));return r??e}function $b(e){return Math.max(1,e.rowHeight+e.gap)}function ex(e,n){return e.listOffset+n*$b(e)+e.gap}function tx(e,n){return ex(e,n)+e.rowHeight}function nx(e,n,r=5){let{count:i}=e;if(i<=0)return{start:0,end:0};let a=$b(e),o=Math.max(0,n-e.listOffset),s=Math.floor(o/a),c=Math.ceil((o+e.viewportHeight)/a),l=Math.min(i,Math.max(0,s-r));return{start:l,end:Math.min(i,Math.max(l,c+r))}}function rx(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=ex(e,n),o=a+e.rowHeight;return a<r+i?n===0?0:Math.max(0,a-i):o>r+e.viewportHeight?Math.max(0,o-e.viewportHeight):r}function ix(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=ex(e,n),o=a+e.rowHeight;if(a>=r+i&&o<=r+e.viewportHeight)return r;let s=a+e.rowHeight/2-(e.viewportHeight+i)/2;return Math.max(0,s)}function ax(e){return Math.max(1,Math.floor(e.viewportHeight/$b(e))-1)}function ox(e){return{count:e.count,topOf:n=>ex(e,n),bottomOf:n=>tx(e,n)}}function sx(e,n){let r=0,i=e.count;for(;r<i;){let a=r+i>>>1;e.bottomOf(a)>n?i=a:r=a+1}return r}function cx(e,n,r,i=0){if(e.count===0)return;let a=Math.min(sx(e,n),e.count-1),o=a,s=e.count;for(;o<s;){let n=o+s>>>1;e.topOf(n)>=r?s=n:o=n+1}let c=Math.max(a,o-1);return{first:Math.max(0,a-i),last:Math.min(e.count-1,c+i)}}const lx={rows:[],indexByKey:new Map};let q=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this.itemDnd=`none`,this.dndExpandHoverMs=500,this.reorderable=!0,this.stickyHeaders=!0,this.virtualize=`auto`,this.virtualizeThreshold=200,this.applyInternalDrop=!0,this._expandedKeys=new Set,this.#i=0,this._selectionVersion=0,this._scrollTop=0,this.#l={rowHeight:30,gap:1,listOffset:0},this.#u=0,this.#d=0,this.#m=0,this.#h=0,this.#g=!1,this.#S=()=>{this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#C()}))},this.tickled=new oe(this,{getItems:()=>this.#s().rows.map(({node:e})=>({id:e.item.key,enabled:!0})),hoverDisabled:()=>this.#J?.isDragging===!0||this.#Y?.isDragging===!0,onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)}}),this._focusedDepth=0,this.search=new Vt(this,{adapter:Wt(this,{labelSelector:`.tree-label`,highlightKey:`incr-search-highlight`})}),this.#I={indent:20},this.#L=[],this.#R=[],this.#z=new Map,this.#B=new Map,this.#V=new Set,this.#H=new Map,this.#U=new Map,this.#W=!1,this.#G=``,this.#X=new Set,this.#Z=!1,this.#$=()=>{this.#Q=void 0},this.#te=()=>{this.#de===0&&(this.#de=requestAnimationFrame(()=>{this.#de=0,this.#re()}))},this._stickyKeys=[],this.#le=new Map,this.#ue=!0,this.#de=0,this.#pe=!1,this.#Ie=`user`,this.#Le=!1,this.#$e=0,this.#dt=e=>{if(this.search.isOpen)return;let n=this.#s().rows;if(n.length===0)return;if((e.ctrlKey||e.metaKey)&&e.key===`a`){e.preventDefault(),this.selectAll();return}[`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`,`Enter`,` `].includes(e.key)&&this.tickled.setInputMode(`keyboard`);let r=this.#ot();switch(e.key){case`ArrowDown`:e.preventDefault(),this.#ut(n,r,Math.min(r+1,n.length-1),e.shiftKey);break;case`ArrowUp`:e.preventDefault(),this.#ut(n,r,Math.max(r-1,0),e.shiftKey);break;case`Home`:e.preventDefault(),this.#ut(n,r,0,e.shiftKey);break;case`End`:e.preventDefault(),this.#ut(n,r,n.length-1,e.shiftKey);break;case`PageDown`:{e.preventDefault();let i=this.#lt();this.#ut(n,r,Math.min(r+i,n.length-1),e.shiftKey);break}case`PageUp`:{e.preventDefault();let i=this.#lt();this.#ut(n,r,Math.max(r-i,0),e.shiftKey);break}case`ArrowRight`:{e.preventDefault();let i=n[r];i&&i.node.item.isLeaf!==!0&&(this._expandedKeys.has(i.node.item.key)?r+1<n.length&&this.#st(r+1):this.#Ke(i.node,i.depth)),this.requestUpdate();break}case`ArrowLeft`:{e.preventDefault();let i=n[r];if(i&&this._expandedKeys.has(i.node.item.key))this.#e(Zb(this._expandedKeys,i.node.item.key)),this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0}));else if(i.depth>0){let e=i.depth-1;for(let i=r-1;i>=0;i--)if(n[i].depth===e){this.#st(i);break}}this.requestUpdate();break}case`Enter`:{e.preventDefault();let i=n[r];i&&(this.interactionMode!==`manual`&&this.interactionMode!==`checked`&&this.select(i.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0})),this.requestUpdate());break}case` `:{e.preventDefault();let i=n[r];if(!i)break;this.interactionMode===`checked`?this._handleCheckboxClick(new MouseEvent(`click`),i.node,i.depth):(this.interactionMode===`standard`||this.interactionMode===`vscode`||this.interactionMode===`manual`)&&this.#Ge(i.node,i.depth);break}case`Escape`:e.preventDefault(),this.#tt()}},this.#ft=e=>{let n=e.target.closest(`ul.tree-list li`);if(!n)return;let r=n.dataset.key;if(!r)return;let i=this.#s(),a=i.indexByKey.get(r),o=a===void 0?void 0:i.rows[a];if(!o)return;let s={node:o.node,depth:o.depth};this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:s,bubbles:!0,composed:!0}))}}get selectedNodes(){return this._selectedNodes}#e(e){e!==this._expandedKeys&&(this._expandedKeys=e,this.#t=void 0,this.#ue=!0)}#t;#n;#r;#i;#a;#o;invalidateStructure(){this.#i++,this.#t=void 0,this.requestUpdate()}#s(){if(!this.root)return lx;if(this.#t&&this.#n===this.root&&this.#r===this.filterPredicate)return this.#t;let e=this.#D();return this.#t=Gb(this.root,{isExpanded:(e,n)=>this._isExpanded(e,n),isShown:e?n=>e.matches.has(n.item.key):()=>!0}),this.#n=this.root,this.#r=this.filterPredicate,this.#t}#c(){let e=this.root;if(!e)return{parentByKey:new Map,depthsWithIcons:new Set};let n=this.#a;if(n&&n.root===e&&n.version===this.#i)return n.index;let r=Kb(e);return this.#a={root:e,version:this.#i,index:r},r}#l;#u;#d;#f;#p;#m;#h;#g;#_(){return this.virtualize===`off`?!1:this.virtualize===`on`||this.#s().rows.length>this.virtualizeThreshold}#v(e){return{count:e,rowHeight:this.#l.rowHeight,gap:this.#l.gap,listOffset:this.#l.listOffset,viewportHeight:this.#u>0?this.#u:600}}#y(){let e=this.renderRoot.querySelector(`ul.tree-list`),n=e?.querySelector(`li.item:not(.leaving)`),r=n?.getBoundingClientRect().height??0,i=r>0?r:this.#Se(),a=n?Number.parseFloat(getComputedStyle(n).marginTop):NaN,o=Number.isNaN(a)?Number.parseFloat(getComputedStyle(this).getPropertyValue(`--tree-item-gap`)):a,s=Number.isNaN(o)?1:o,c=this.#l.listOffset;if(e){let n=Number.parseFloat(getComputedStyle(e).paddingTop);c=e.offsetTop+(Number.isNaN(n)?0:n)}let l=this.#be()?.clientHeight??0,u=l>0&&l!==this.#u;l>0&&(this.#u=l);let d=this.#l,f=d.rowHeight!==i||d.gap!==s||d.listOffset!==c;return this.#l={rowHeight:i,gap:s,listOffset:c},f||u}#b(e){return nx(this.#v(e),this._scrollTop)}#x(){let e=this.#be()?.scrollTop;e!==void 0&&e!==this._scrollTop&&(this._scrollTop=e)}#S;#C(){let e=this.#be();if(!e||!this.root||!this.#_())return;let n=e.scrollTop;if(n===this._scrollTop)return;let r=nx(this.#v(this.#s().rows.length),n);(r.start!==this.#m||r.end!==this.#h)&&(this._scrollTop=n)}#w(){let e=this.#be();e!==this.#f&&(this.#f?.removeEventListener(`scroll`,this.#S),this.#p?.disconnect(),this.#p=void 0,this.#f=e,e&&(e.addEventListener(`scroll`,this.#S,{passive:!0}),typeof ResizeObserver<`u`&&(this.#p=new ResizeObserver(e=>{let n=e.at(-1)?.contentRect.height??0;n>0&&n!==this.#u&&this.#_()&&this.requestUpdate()}),this.#p.observe(e))))}#T(){this.#f?.removeEventListener(`scroll`,this.#S),this.#f=void 0,this.#p?.disconnect(),this.#p=void 0,this.#d!==0&&(cancelAnimationFrame(this.#d),this.#d=0)}#E(e,n=`edge`){let r=this.#be();if(!r)return;let i=this.#v(this.#s().rows.length),a=this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0,o=(n===`center-if-hidden`?ix:rx)(i,e,r.scrollTop,a);(o!==r.scrollTop||o!==this._scrollTop)&&(r.scrollTop=o,this._scrollTop=o)}#D(){let e=this.filterPredicate,n=this.root;if(!e||!n)return;let r=this.#o;if(r&&r.predicate===e&&r.root===n&&r.version===this.#i)return r;let i=qb(n,e),{parentByKey:a}=this.#c(),o=new Set;for(let e of i){let n=a.get(e);n!==void 0&&o.add(n)}let s={predicate:e,root:n,version:this.#i,matches:i,autoExpanded:o};return this.#o=s,s}get _structureVersion(){return this.#i}get _depthsWithIcons(){return this.#c().depthsWithIcons}#O;#k(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#A(){this.#F&&(this.search.setModes(this.#k()),this.#O?.(),this.#O=Rt(this.#F,this.search))}#j;#M;#N;#P;#F;#I;#L;#R;#z;#B;#V;#H;#U;#W;#G;#K;#q;#J;#Y;#X;#Z;#Q;#$;#ee(){let e=this.#be();this.stickyHeaders&&e?(!this.#pe||this.#fe!==e)&&(this.#fe?.removeEventListener(`scroll`,this.#te),e.addEventListener(`scroll`,this.#te,{passive:!0}),this.#fe=e,this.#pe=!0):this.#pe&&=(this.#fe?.removeEventListener(`scroll`,this.#te),this.#fe=void 0,!1)}#te;#ne(e){return{count:e.length,topOf:n=>e[n].offsetTop,bottomOf:n=>e[n].offsetTop+e[n].offsetHeight}}#re(){this.#ue=!1;let e=new Map,n=()=>this.#ie([],e);if(!this.stickyHeaders||!this.root)return n();let r=this.#be(),i=this.renderRoot.querySelector(`ul.tree-list`);if(!r||!i)return n();let a=this.#s(),o=this.#_(),s=i.children,c=this.#R;if(a.rows.length===0||!o&&(s.length===0||s.length!==c.length))return n();let l=o?ox(this.#v(a.rows.length)):this.#ne(s),u=r.scrollTop,d=u+(this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0),f=sx(l,u);if(!o)for(;f<s.length&&s[f].classList.contains(`leaving`);)f++;if(f>=l.count)return n();let p=o?f:a.indexByKey.get(c[f]);if(p===void 0)return n();let m=[],h=a.rows[p].parentKey;for(;h!==void 0;){let e=a.indexByKey.get(h);if(e===void 0)break;m.unshift(a.rows[e]),h=a.rows[e].parentKey}let g=new Map,_=[];for(let e of m){let n=e.node.item.key,r=o?a.indexByKey.get(n):this.#z.get(n);r===void 0||l.bottomOf(r)>d||(_.push(n),g.set(n,{node:e.node,depth:e.depth}))}this.#ie(_,g)}#ie(e,n){let r=this._stickyKeys;r.length===e.length&&r.every((n,r)=>n===e[r])||(this.#le=n,this._stickyKeys=e)}#ae(){return!this.stickyHeaders||this._stickyKeys.length===0?a:i`
|
|
8123
|
+
`]}};E([d({type:Boolean,reflect:!0})],Mb.prototype,`collapsed`,void 0),E([d({type:String,attribute:`orientation`,reflect:!0})],Mb.prototype,`orientation`,void 0),E([d({type:Boolean})],Mb.prototype,`closable`,void 0),E([d({type:Boolean,reflect:!0})],Mb.prototype,`collapsible`,void 0),E([d({type:String})],Mb.prototype,`title`,void 0),E([d({type:String,attribute:`icon-name`})],Mb.prototype,`iconName`,void 0),E([d({type:String,attribute:`toggle-interaction`})],Mb.prototype,`toggleInteraction`,void 0),E([d({type:String,attribute:`variant`,reflect:!0})],Mb.prototype,`variant`,void 0),E([d({type:Boolean,attribute:`hide-titlebar`})],Mb.prototype,`hideTitlebar`,void 0),E([d({type:Boolean,attribute:`keep-toolbar`})],Mb.prototype,`keepToolbar`,void 0),E([d({type:Boolean,attribute:`sticky-header`,reflect:!0})],Mb.prototype,`stickyHeader`,void 0),Mb=E([T(`ixfx-panel`)],Mb);const Nb=`__ungrouped__`;let Pb=class extends n{constructor(...e){super(...e),this.grouped=!1,this.crossGroupSelection=!1,this.#n=new Map,this.#i=!1,this.#a=new je(this),this.#d=e=>{if(this.#i)return;let n=e.target,r;for(let[e,i]of this.#n)if(i===n){r=e;break}if(r!==void 0){if(this.grouped&&!this.crossGroupSelection){this.#i=!0;for(let[e,n]of this.#n)e!==r&&n.clearSelection();this.#i=!1}this.dispatchEvent(new CustomEvent(`grouped-select`,{detail:{selected:this.selectedItems,groupKey:r===Nb?void 0:r},bubbles:!0,composed:!0}))}}}#e;#t;#n;#r;#i;#a;get groupBy(){return this.#e}set groupBy(e){this.#e=e,this.requestUpdate()}get factory(){return this.#t}set factory(e){e!==this.#t&&(this.#s(),this.#t=e,this.requestUpdate())}get provider(){return this.#a.provider}set provider(e){this.#a.provider=e,e&&this.#a.request(void 0)}get selectedItems(){let e=new Set;for(let n of this.#n.values())for(let r of n.selectedItems)e.add(r);return e}dispatch(e,n){for(let r of this.#n.values())r.dispatch(e,n)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener(`select`,this.#d)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`select`,this.#d)}updated(e){super.updated(e),e.has(`grouped`)&&this.#s(),this.#c()}render(){return this.#t?this.grouped?this.#e?(this.#r=this.#o(),i`${_(this.#r.keys(),e=>e,e=>i`<ixfx-panel data-group-key=${e} .title=${e}></ixfx-panel>`)}`):a:i`<div class="ungrouped-host"></div>`:a}#o(){let e=new Map;if(!this.#e)return e;for(let n of this.#a.items){let r=this.#e(n),i=e.get(r);i||(i=[],e.set(r,i)),i.push(n)}return e}#s(){for(let e of this.#n.values())e.remove();this.#n.clear()}#c(){if(this.#t){if(!this.grouped){this.#l();return}this.#e&&this.#u()}}#l(){let e=this.querySelector(`.ungrouped-host`);if(!e)return;let n=this.#n.get(Nb);n||(n=this.#t(void 0),e.appendChild(n),this.#n.set(Nb,n)),n.setItems(this.#a.items)}#u(){let e=this.#r??this.#o();for(let n of[...this.#n.keys()])e.has(n)||(this.#n.get(n)?.remove(),this.#n.delete(n));for(let[n,r]of e){let e=[...this.children].find(e=>e instanceof HTMLElement&&e.dataset.groupKey===n);if(!e)continue;let i=this.#n.get(n);i||(i=this.#t(n),e.appendChild(i),this.#n.set(n,i)),i.setItems(r)}}#d};E([d({type:Boolean,reflect:!0})],Pb.prototype,`grouped`,void 0),E([d({type:Boolean,attribute:`cross-group-selection`,reflect:!0})],Pb.prototype,`crossGroupSelection`,void 0),Pb=E([T(`ixfx-grouped-item-lister`)],Pb);const Fb=`application/x-ixfx-tree`,Ib=new Map,Lb=new Map;let Rb,zb=0;function Bb(){return`tree-drag-${++zb}-${Date.now()}`}function Vb(e,n,r,i){Ib.set(e,{sourceId:e,nodes:r,keys:i}),Lb.set(e,new WeakRef(n)),Rb=e}function Hb(e){Ib.delete(e),Lb.delete(e),Rb===e&&(Rb=void 0)}function Ub(){if(Rb===void 0)return;let e=Ib.get(Rb);if(e)return{sourceId:Rb,keys:e.keys,nodes:e.nodes,element:Lb.get(Rb)?.deref()}}const Wb={direction:0,depth:0};function Gb(e){return Math.min(e/2,Math.max(24,Math.min(64,e*.2)))}function Kb(e,n){if(n<=0)return Wb;let r=Gb(n);return e<r?{direction:-1,depth:Math.min(1,(r-e)/r)}:e>n-r?{direction:1,depth:Math.min(1,(e-(n-r))/r)}:Wb}function qb(e,n){let r=Math.min(1,Math.max(0,n)/2500);return(120+3080*r*r)*(.35+.65*Math.min(1,Math.max(0,e)))}function Jb(e,n,r){return Math.max(n,Math.min(r,e))}var Yb=class{#e;#t;#n=!1;#r;#i=`internal`;#a=[];#o=[];#s;#c;#l=0;#u=0;#d=0;#f=0;#p=0;#m=0;#h=0;#g;#_=!1;#v;constructor(e,n){this.#e=e,this.#t=n,e.addController(this)}get isDragging(){return this.#n}get isRejected(){return this.#n&&this.#r===void 0}get dropState(){return this.#r}hostConnected(){this.#y()}hostUpdated(){this.#y()}#y(){let e=this.#t.getScrollContainer();!e||e===this.#v||(this.#b(),this.#v=e,e.addEventListener(`dragenter`,this.#x),e.addEventListener(`dragover`,this.#S),e.addEventListener(`dragleave`,this.#w),e.addEventListener(`drop`,this.#T))}#b(){let e=this.#v;e&&(e.removeEventListener(`dragenter`,this.#x),e.removeEventListener(`dragover`,this.#S),e.removeEventListener(`dragleave`,this.#w),e.removeEventListener(`drop`,this.#T),this.#v=void 0)}hostDisconnected(){this.#b(),this.#A(),this.#N(),this.#n=!1,this.#r=void 0}#x=e=>{this.#t.getDndMode()===`none`||!e.dataTransfer||this.#t.resolveDrag(e.dataTransfer,`hover`)!==void 0&&(e.preventDefault(),this.#n||(this.#n=!0,this.#t.onActiveChange(!0)))};#S=e=>{if(this.#t.getDndMode()===`none`||!e.dataTransfer)return;this.#u=e.clientX,this.#d=e.clientY,this.#g=e;let n=this.#t.resolveDrag(e.dataTransfer,`hover`);if(!n){this.#C(e);return}this.#n||(this.#n=!0,this.#t.onActiveChange(!0)),this.#i=n.source,this.#a=n.keys,this.#o=n.nodes;let r=this.#t.getVisibleRows();this.#k(this.#D(r,e.clientY)),this.#j();let i=this.#O(e,r,n.source);if(!i){this.#C(e,!1);return}let a={source:n.source,dragged:n.nodes.length>0?n.nodes:void 0,draggedKeys:n.keys,target:i,dataTransfer:e.dataTransfer};if(!this.#t.vet(a)){this.#C(e,!1);return}e.preventDefault(),e.dataTransfer.dropEffect=n.source===`internal`?`move`:`copy`,this.#P(i)};#C(e,n=!0){e.dataTransfer&&(e.dataTransfer.dropEffect=`none`),this.#P(void 0),n&&this.#A()}#w=e=>{let n=this.#t.getScrollContainer(),r=e.relatedTarget;n&&r&&n.contains(r)||this.#E()};#T=e=>{if(!e.dataTransfer){this.#E();return}e.preventDefault(),this.#N(),this.#A();let n=e=>{this.#r=void 0,this.#n=!1,this.#t.onDropStateChange(void 0),this.#t.onActiveChange(!1),this.#t.onDragEnd(e)};if(this.#t.getDndMode()===`none`){n(!1);return}let r=this.#t.resolveDrag(e.dataTransfer,`drop`);if(!r){n(!1);return}this.#a=r.keys,this.#o=r.nodes;let i=this.#O(e,this.#t.getVisibleRows(),r.source);if(!i){n(!1);return}let a={source:r.source,dragged:r.nodes.length>0?r.nodes:void 0,draggedKeys:r.keys,target:i,dataTransfer:e.dataTransfer};if(!this.#t.vet(a)){n(!1);return}let o={...a,external:r.source===`external`?r.nodes:void 0};n(this.#t.commitDrop(o))};#E(){this.#A(),this.#N(),this.#r!==void 0&&(this.#r=void 0,this.#t.onDropStateChange(void 0)),this.#n&&(this.#n=!1,this.#t.onActiveChange(!1))}#D(e,n){if(e.length!==0)return n<e[0].rect.top?e[0]:n>e[e.length-1].rect.bottom?e[e.length-1]:e.find(e=>n>=e.rect.top&&n<=e.rect.bottom)??e[e.length-1]}#O(e,n,r){if(n.length===0)return;let i=this.#D(n,e.clientY);if(!i)return;let a=Jb((e.clientY-i.rect.top)/i.rect.height,0,1),o=a<.25?`before`:a>.75?`after`:`inside`,s=i.node.item.isLeaf===!0;o===`inside`&&s&&(o=`after`);let c=!1;o===`after`&&!s&&this.#t.isExpanded(i.key)&&(o=`inside`,c=!0);let l,u,d,f;if(o===`inside`)l=i.key,u=i.key,d=i.depth+1,f=c?0:i.node.children?.length??0;else{let r=this.#t.getIndentPx()||1,a=n[0].rect.left,s=Jb(Math.round((e.clientX-a)/r),0,i.depth),c={node:i.node,depth:i.depth,parentKey:this.#t.getRowInfo(i.key)?.parentKey};u=i.key;for(let e=i.depth-s;e>0&&c.parentKey!==void 0;e--){let e=this.#t.getRowInfo(c.parentKey);if(!e)break;u=c.parentKey,c=e}d=c.depth,l=c.parentKey;let p=this.#t.getChildren(l).findIndex(e=>e.item.key===u);f=(p<0?0:p)+ +(o===`after`)}if(r===`internal`){for(let e of this.#a)if(e===l||e===u||l!==void 0&&this.#t.isSelfOrDescendant(e,l)||o!==`inside`&&this.#t.isSelfOrDescendant(e,u))return;if(this.#a.length>0&&!this.#t.isReorderAllowed()&&!this.#a.some(e=>this.#t.getParentKey(e)!==l))return}return{parentKey:l,index:f,referenceKey:u,position:o,depth:d}}#k(e){if(!e||e.node.item.isLeaf===!0||this.#t.isExpanded(e.key)){this.#A();return}if(e.key===this.#c)return;this.#A();let n=this.#c=e.key;this.#s=setTimeout(()=>{this.#s=void 0,this.#c===n&&(this.#c=void 0,this.#t.expandKey(n))},Math.max(0,this.#t.getExpandHoverMs()))}#A(){this.#s!==void 0&&(clearTimeout(this.#s),this.#s=void 0),this.#c=void 0}#j(){this.#l===0&&(this.#l=requestAnimationFrame(this.#M))}#M=e=>{if(this.#l=0,!this.#n)return;let n=this.#t.getScrollContainer();if(!n||this.#_&&this.#g&&(this.#_=!1,this.#S(this.#g),!this.#n))return;let r=n.getBoundingClientRect(),i=this.#u>=r.left&&this.#u<=r.right?Kb(this.#d-r.top,r.height):{direction:0,depth:0};if(i.direction!==this.#f&&(this.#f=i.direction,this.#p=e,this.#m=e,this.#h=0),i.direction===0)return;let a=Math.min(50,Math.max(0,e-this.#m));this.#m=e;let o=qb(i.depth,e-this.#p),s=i.direction*o*a/1e3+this.#h,c=Math.trunc(s);if(this.#h=s-c,c!==0){let e=n.scrollTop;n.scrollTop=e+c,n.scrollTop!==e&&(this.#_=!0)}this.#j()};#N(){this.#l!==0&&(cancelAnimationFrame(this.#l),this.#l=0),this.#f=0,this.#h=0,this.#_=!1,this.#g=void 0}#P(e){let n=e===void 0?this.#r===void 0:e.referenceKey===this.#r?.referenceKey&&e.position===this.#r?.position&&e.depth===this.#r?.depth&&e.index===this.#r?.index;this.#r=e,(!n||this.#n)&&this.#t.onDropStateChange(e)}};function Xb(e,n){let r=[],i=new Map,a=[],o=(e,r,i)=>{if(!e||e.length===0)return;let o=e.filter(e=>n.isShown(e,r));for(let e=o.length-1;e>=0;e--)a.push({node:o[e],depth:r,parentKey:i,posInSet:e+1,setSize:o.length})};for(o(e.children,0,void 0);a.length>0;){let{node:e,depth:s,parentKey:c,posInSet:l,setSize:u}=a.pop();i.set(e.item.key,r.length),r.push({node:e,depth:s,parentKey:c,posInSet:l,setSize:u}),e.children&&e.children.length>0&&n.isExpanded(e,s)&&o(e.children,s+1,e.item.key)}return{rows:r,indexByKey:i}}function Zb(e){let n=new Map,r=new Set,i=new Set([e.item.key]),a=new Set,o=[];if(e.children)for(let r of e.children)n.set(r.item.key,e.item.key),o.push({node:r,depth:0,parentKey:e.item.key});for(;o.length>0;){let{node:e,depth:s,parentKey:c}=o.pop();if(i.has(e.item.key)&&a.add(e.item.key),i.add(e.item.key),n.set(e.item.key,c),e.item.icon&&r.add(s),e.children)for(let n=e.children.length-1;n>=0;n--){let r=e.children[n];o.push({node:r,depth:s+1,parentKey:e.item.key})}}if(a.size>0){let e=[...a].slice(0,5).map(e=>`"${e}"`).join(`, `);console.warn(`[ixfx-tree] ${a.size} duplicate item key(s) in tree (e.g. ${e}). Keys must be unique across the whole tree; duplicates break checkbox state, expansion and selection.`)}return{parentByKey:n,depthsWithIcons:r}}function Qb(e,n){let r=new Set;if(!e.children)return r;let i=[],a=(e,r)=>{i.push({node:e,depth:r,next:0,matched:n(e,r)})};for(let n of e.children)for(a(n,0);i.length>0;){let e=i[i.length-1],n=e.node.children;if(n&&e.next<n.length){a(n[e.next++],e.depth+1);continue}i.pop(),e.matched&&(r.add(e.node.item.key),i.length>0&&(i[i.length-1].matched=!0))}return r}function $b(e,n,r){if(r.size===0)return[...e];let i=new Set;for(let n of e)i.add(n.node.item.key);let a=Symbol(`end`),o=new Map,s=a;for(let e=n.length-1;e>=0;e--){let a=n[e];if(i.has(a)){s=a;continue}let c=r.get(a);if(!c)continue;let l=o.get(s);l?l.push(c):o.set(s,[c])}let c=[];for(let n of e){let e=o.get(n.node.item.key);if(e)for(let n=e.length-1;n>=0;n--)c.push(e[n]);c.push(n)}let l=o.get(a);if(l)for(let e=l.length-1;e>=0;e--)c.push(l[e]);return c}function ex(e,n){let r=new Map;if(!e.children)return r;let i=[];for(let a of e.children)for(i.push({node:a,next:0,checked:0,unchecked:0,counted:0});i.length>0;){let e=i[i.length-1],{node:a}=e,o=a.children,s=a.item.isLeaf||!o?.length;if(!s&&e.next<o.length){i.push({node:o[e.next++],next:0,checked:0,unchecked:0,counted:0});continue}i.pop();let c;c=s?n.has(a)?`checked`:`unchecked`:e.counted===0?`unchecked`:e.checked===e.counted?`checked`:e.unchecked===e.counted?`unchecked`:`indeterminate`,r.set(a.item.key,c);let l=s&&a.item.selectable===!1;if(i.length>0&&!l){let e=i[i.length-1];e.counted++,c===`checked`?e.checked++:c===`unchecked`&&e.unchecked++}}return r}function tx(e,n){if(e.has(n))return e;let r=new Set(e);return r.add(n),r}function nx(e,n){if(!e.has(n))return e;let r=new Set(e);return r.delete(n),r}function rx(e,n){let r;for(let i of e)n(i)&&(r??=new Set(e),r.delete(i));return r??e}function ix(e){return Math.max(1,e.rowHeight+e.gap)}function ax(e,n){return e.listOffset+n*ix(e)+e.gap}function ox(e,n){return ax(e,n)+e.rowHeight}function sx(e,n,r=5){let{count:i}=e;if(i<=0)return{start:0,end:0};let a=ix(e),o=Math.max(0,n-e.listOffset),s=Math.floor(o/a),c=Math.ceil((o+e.viewportHeight)/a),l=Math.min(i,Math.max(0,s-r));return{start:l,end:Math.min(i,Math.max(l,c+r))}}function cx(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=ax(e,n),o=a+e.rowHeight;return a<r+i?n===0?0:Math.max(0,a-i):o>r+e.viewportHeight?Math.max(0,o-e.viewportHeight):r}function lx(e,n,r,i=0){if(n<0||n>=e.count)return r;let a=ax(e,n),o=a+e.rowHeight;if(a>=r+i&&o<=r+e.viewportHeight)return r;let s=a+e.rowHeight/2-(e.viewportHeight+i)/2;return Math.max(0,s)}function ux(e){return Math.max(1,Math.floor(e.viewportHeight/ix(e))-1)}function dx(e){return{count:e.count,topOf:n=>ax(e,n),bottomOf:n=>ox(e,n)}}function fx(e,n){let r=0,i=e.count;for(;r<i;){let a=r+i>>>1;e.bottomOf(a)>n?i=a:r=a+1}return r}function px(e,n,r,i=0){if(e.count===0)return;let a=Math.min(fx(e,n),e.count-1),o=a,s=e.count;for(;o<s;){let n=o+s>>>1;e.topOf(n)>=r?s=n:o=n+1}let c=Math.max(a,o-1);return{first:Math.max(0,a-i),last:Math.min(e.count-1,c+i)}}const mx={rows:[],indexByKey:new Map};let q=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this.itemDnd=`none`,this.dndExpandHoverMs=500,this.reorderable=!0,this.stickyHeaders=!0,this.virtualize=`auto`,this.virtualizeThreshold=200,this.animation=`auto`,this.applyInternalDrop=!0,this._expandedKeys=new Set,this.#i=0,this._selectionVersion=0,this._scrollTop=0,this.#l={rowHeight:30,gap:1,listOffset:0},this.#u=0,this.#d=0,this.#m=0,this.#h=0,this.#g=!1,this.#S=()=>{this.#d===0&&(this.#d=requestAnimationFrame(()=>{this.#d=0,this.#C()}))},this.tickled=new oe(this,{getItems:()=>this.#s().rows.map(({node:e})=>({id:e.item.key,enabled:!0})),hoverDisabled:()=>this.#Y?.isDragging===!0||this.#X?.isDragging===!0,onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)}}),this._focusedDepth=0,this.search=new Vt(this,{adapter:Wt(this,{labelSelector:`.tree-label`,highlightKey:`incr-search-highlight`})}),this.#I={indent:20},this.#L=[],this.#R=[],this.#z=new Map,this.#B=new Map,this.#V=new Set,this.#H=new Map,this.#U=new Map,this.#W=!1,this.#K=``,this.#Z=new Set,this.#Q=!1,this.#ee=()=>{this.#$=void 0},this.#ne=()=>{this.#fe===0&&(this.#fe=requestAnimationFrame(()=>{this.#fe=0,this.#ie()}))},this._stickyKeys=[],this.#ue=new Map,this.#de=!0,this.#fe=0,this.#me=!1,this.#Re=`user`,this.#ze=!1,this.#tt=0,this.#pt=e=>{if(this.search.isOpen)return;let n=this.#s().rows;if(n.length===0)return;if((e.ctrlKey||e.metaKey)&&e.key===`a`){e.preventDefault(),this.selectAll();return}[`ArrowDown`,`ArrowUp`,`ArrowLeft`,`ArrowRight`,`Home`,`End`,`PageUp`,`PageDown`,`Enter`,` `].includes(e.key)&&this.tickled.setInputMode(`keyboard`);let r=this.#ct();switch(e.key){case`ArrowDown`:e.preventDefault(),this.#ft(n,r,Math.min(r+1,n.length-1),e.shiftKey);break;case`ArrowUp`:e.preventDefault(),this.#ft(n,r,Math.max(r-1,0),e.shiftKey);break;case`Home`:e.preventDefault(),this.#ft(n,r,0,e.shiftKey);break;case`End`:e.preventDefault(),this.#ft(n,r,n.length-1,e.shiftKey);break;case`PageDown`:{e.preventDefault();let i=this.#dt();this.#ft(n,r,Math.min(r+i,n.length-1),e.shiftKey);break}case`PageUp`:{e.preventDefault();let i=this.#dt();this.#ft(n,r,Math.max(r-i,0),e.shiftKey);break}case`ArrowRight`:{e.preventDefault();let i=n[r];i&&i.node.item.isLeaf!==!0&&(this._expandedKeys.has(i.node.item.key)?r+1<n.length&&this.#lt(r+1):this.#Je(i.node,i.depth)),this.requestUpdate();break}case`ArrowLeft`:{e.preventDefault();let i=n[r];if(i&&this._expandedKeys.has(i.node.item.key))this.#e(nx(this._expandedKeys,i.node.item.key)),this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0}));else if(i.depth>0){let e=i.depth-1;for(let i=r-1;i>=0;i--)if(n[i].depth===e){this.#lt(i);break}}this.requestUpdate();break}case`Enter`:{e.preventDefault();let i=n[r];i&&(this.interactionMode!==`manual`&&this.interactionMode!==`checked`&&this.select(i.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:i.node,depth:i.depth},bubbles:!0,composed:!0})),this.requestUpdate());break}case` `:{e.preventDefault();let i=n[r];if(!i)break;this.interactionMode===`checked`?this._handleCheckboxClick(new MouseEvent(`click`),i.node,i.depth):(this.interactionMode===`standard`||this.interactionMode===`vscode`||this.interactionMode===`manual`)&&this.#qe(i.node,i.depth);break}case`Escape`:e.preventDefault(),this.#rt()}},this.#mt=e=>{let n=e.target.closest(`ul.tree-list li`);if(!n)return;let r=n.dataset.key;if(!r)return;let i=this.#s(),a=i.indexByKey.get(r),o=a===void 0?void 0:i.rows[a];if(!o)return;let s={node:o.node,depth:o.depth};this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:s,bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:s,bubbles:!0,composed:!0}))}}get selectedNodes(){return this._selectedNodes}#e(e){e!==this._expandedKeys&&(this._expandedKeys=e,this.#t=void 0,this.#de=!0)}#t;#n;#r;#i;#a;#o;invalidateStructure(){this.#i++,this.#t=void 0,this.requestUpdate()}#s(){if(!this.root)return mx;if(this.#t&&this.#n===this.root&&this.#r===this.filterPredicate)return this.#t;let e=this.#D();return this.#t=Xb(this.root,{isExpanded:(e,n)=>this._isExpanded(e,n),isShown:e?n=>e.matches.has(n.item.key):()=>!0}),this.#n=this.root,this.#r=this.filterPredicate,this.#t}#c(){let e=this.root;if(!e)return{parentByKey:new Map,depthsWithIcons:new Set};let n=this.#a;if(n&&n.root===e&&n.version===this.#i)return n.index;let r=Zb(e);return this.#a={root:e,version:this.#i,index:r},r}#l;#u;#d;#f;#p;#m;#h;#g;#_(){return this.virtualize===`off`?!1:this.virtualize===`on`||this.#s().rows.length>this.virtualizeThreshold}#v(e){return{count:e,rowHeight:this.#l.rowHeight,gap:this.#l.gap,listOffset:this.#l.listOffset,viewportHeight:this.#u>0?this.#u:600}}#y(){let e=this.renderRoot.querySelector(`ul.tree-list`),n=e?.querySelector(`li.item:not(.leaving)`),r=n?.getBoundingClientRect().height??0,i=r>0?r:this.#we(),a=n?Number.parseFloat(getComputedStyle(n).marginTop):NaN,o=Number.isNaN(a)?Number.parseFloat(getComputedStyle(this).getPropertyValue(`--tree-item-gap`)):a,s=Number.isNaN(o)?1:o,c=this.#l.listOffset;if(e){let n=Number.parseFloat(getComputedStyle(e).paddingTop);c=e.offsetTop+(Number.isNaN(n)?0:n)}let l=this.#Se()?.clientHeight??0,u=l>0&&l!==this.#u;l>0&&(this.#u=l);let d=this.#l,f=d.rowHeight!==i||d.gap!==s||d.listOffset!==c;return this.#l={rowHeight:i,gap:s,listOffset:c},f||u}#b(e){return sx(this.#v(e),this._scrollTop)}#x(){let e=this.#Se()?.scrollTop;e!==void 0&&e!==this._scrollTop&&(this._scrollTop=e)}#S;#C(){let e=this.#Se();if(!e||!this.root||!this.#_())return;let n=e.scrollTop;if(n===this._scrollTop)return;let r=sx(this.#v(this.#s().rows.length),n);(r.start!==this.#m||r.end!==this.#h)&&(this._scrollTop=n)}#w(){let e=this.#Se();e!==this.#f&&(this.#f?.removeEventListener(`scroll`,this.#S),this.#p?.disconnect(),this.#p=void 0,this.#f=e,e&&(e.addEventListener(`scroll`,this.#S,{passive:!0}),typeof ResizeObserver<`u`&&(this.#p=new ResizeObserver(e=>{let n=e.at(-1)?.contentRect.height??0;n>0&&n!==this.#u&&this.#_()&&this.requestUpdate()}),this.#p.observe(e))))}#T(){this.#f?.removeEventListener(`scroll`,this.#S),this.#f=void 0,this.#p?.disconnect(),this.#p=void 0,this.#d!==0&&(cancelAnimationFrame(this.#d),this.#d=0)}#E(e,n=`edge`){let r=this.#Se();if(!r)return;let i=this.#v(this.#s().rows.length),a=this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0,o=(n===`center-if-hidden`?lx:cx)(i,e,r.scrollTop,a);(o!==r.scrollTop||o!==this._scrollTop)&&(r.scrollTop=o,this._scrollTop=o)}#D(){let e=this.filterPredicate,n=this.root;if(!e||!n)return;let r=this.#o;if(r&&r.predicate===e&&r.root===n&&r.version===this.#i)return r;let i=Qb(n,e),{parentByKey:a}=this.#c(),o=new Set;for(let e of i){let n=a.get(e);n!==void 0&&o.add(n)}let s={predicate:e,root:n,version:this.#i,matches:i,autoExpanded:o};return this.#o=s,s}get _structureVersion(){return this.#i}get _depthsWithIcons(){return this.#c().depthsWithIcons}#O;#k(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#A(){this.#F&&(this.search.setModes(this.#k()),this.#O?.(),this.#O=Rt(this.#F,this.search))}#j;#M;#N;#P;#F;#I;#L;#R;#z;#B;#V;#H;#U;#W;#G;#K;#q;#J;#Y;#X;#Z;#Q;#$;#ee;#te(){let e=this.#Se();this.stickyHeaders&&e?(!this.#me||this.#pe!==e)&&(this.#pe?.removeEventListener(`scroll`,this.#ne),e.addEventListener(`scroll`,this.#ne,{passive:!0}),this.#pe=e,this.#me=!0):this.#me&&=(this.#pe?.removeEventListener(`scroll`,this.#ne),this.#pe=void 0,!1)}#ne;#re(e){return{count:e.length,topOf:n=>e[n].offsetTop,bottomOf:n=>e[n].offsetTop+e[n].offsetHeight}}#ie(){this.#de=!1;let e=new Map,n=()=>this.#ae([],e);if(!this.stickyHeaders||!this.root)return n();let r=this.#Se(),i=this.renderRoot.querySelector(`ul.tree-list`);if(!r||!i)return n();let a=this.#s(),o=this.#_(),s=i.children,c=this.#R;if(a.rows.length===0||!o&&(s.length===0||s.length!==c.length))return n();let l=o?dx(this.#v(a.rows.length)):this.#re(s),u=r.scrollTop,d=u+(this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0),f=fx(l,u);if(!o)for(;f<s.length&&s[f].classList.contains(`leaving`);)f++;if(f>=l.count)return n();let p=o?f:a.indexByKey.get(c[f]);if(p===void 0)return n();let m=[],h=a.rows[p].parentKey;for(;h!==void 0;){let e=a.indexByKey.get(h);if(e===void 0)break;m.unshift(a.rows[e]),h=a.rows[e].parentKey}let g=new Map,_=[];for(let e of m){let n=e.node.item.key,r=o?a.indexByKey.get(n):this.#z.get(n);r===void 0||l.bottomOf(r)>d||(_.push(n),g.set(n,{node:e.node,depth:e.depth}))}this.#ae(_,g)}#ae(e,n){let r=this._stickyKeys;r.length===e.length&&r.every((n,r)=>n===e[r])||(this.#ue=n,this._stickyKeys=e)}#oe(){return!this.stickyHeaders||this._stickyKeys.length===0?a:i`
|
|
8086
8124
|
<div class="sticky-anchor">
|
|
8087
8125
|
<div class="sticky-headers" part="sticky-headers">
|
|
8088
|
-
${this._stickyKeys.map(e=>{let n=this.#
|
|
8126
|
+
${this._stickyKeys.map(e=>{let n=this.#ue.get(e);return n?this.#se(n.node,n.depth):a})}
|
|
8089
8127
|
</div>
|
|
8090
8128
|
</div>
|
|
8091
|
-
`}#
|
|
8129
|
+
`}#se(e,n){let r=this._isSelected(e),a=e.item.isLeaf!==!0;return i`
|
|
8092
8130
|
<div
|
|
8093
8131
|
class="item ${a?`branch`:`leaf`} sticky-header${r?` selected`:``}"
|
|
8094
8132
|
part="sticky-header"
|
|
@@ -8097,43 +8135,43 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8097
8135
|
aria-label="Go to ${e.item.label}"
|
|
8098
8136
|
data-key=${e.item.key}
|
|
8099
8137
|
style=${`--depth: ${n}`}
|
|
8100
|
-
@click=${n=>this.#
|
|
8101
|
-
@keydown=${n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),this.#
|
|
8138
|
+
@click=${n=>this.#ce(n,e)}
|
|
8139
|
+
@keydown=${n=>{(n.key===`Enter`||n.key===` `)&&(n.preventDefault(),this.#le(e))}}
|
|
8102
8140
|
>${this.renderNodeContent(e,n)}</div>
|
|
8103
|
-
`}#
|
|
8104
|
-
`))}catch{}},onActiveChange:e=>{this.toggleAttribute(`data-native-dragging`,e),e||(this.#
|
|
8141
|
+
`}#ce(e,n){if(!(this.#Y?.isDragging||this.#X?.isDragging)){if(n.item.isLeaf!==!0&&e.target instanceof Element&&e.target.closest(`.tree-caret`)){let e=this.#ue.get(n.item.key)?.depth??0;this.#Je(n,e),this.#de=!0,this.requestUpdate();return}this.#le(n)}}#le(e){this.#Ie(e)&&this.select(e),this.#et(e.item.key),this.#de=!0,this.requestUpdate()}#ue;#de;#fe;#pe;#me;get nativeDrag(){return this.#X}get dropState(){return this.#J}get nativeDragKeys(){return this.#Z}#he(e){this.#U.get(e)?.cancel(),this.#U.delete(e)}#ge(){for(let e of this.#U.values())try{e.cancel()}catch{}this.#U.clear()}willUpdate(e){super.willUpdate(e);let n=this.#t!==void 0&&e.size===1&&e.has(`_scrollTop`)&&this.#_();if(this.#g=n,n){this.#x();return}if(this.#t=void 0,(e.has(`root`)||e.has(`model`))&&this.#i++,e.has(`root`)&&this.root&&this._expandedKeys.size>0){let{parentByKey:e}=this.#c();this.#e(rx(this._expandedKeys,n=>!e.has(n)))}this.#_e(e.has(`filterPredicate`));let r=this.#_();this.toggleAttribute(`data-virtual`,r),r&&(this.#y(),this.#x()),(e.has(`root`)||e.has(`model`)||e.has(`filterPredicate`)||e.has(`stickyHeaders`))&&(this.#de=!0),this.#de&&this.#ie()}#_e(e){let n=this.#s().rows;if(this.#_()){this.#V.clear(),this.#ge(),this.#H.clear(),this.#L=[];return}let r=new Set(n.map(e=>e.node.item.key));if(this.#V.clear(),e)this.#ge(),this.#H.clear();else if(this.#W&&this.#L.length>0){let e=new Set(this.#L);for(let{node:r}of n)e.has(r.item.key)||this.#V.add(r.item.key);this.#V.size>50&&this.#V.clear();for(let e of this.#L)if(!r.has(e)&&!this.#H.has(e)){let n=this.#B.get(e);n&&this.#H.set(e,n)}}for(let e of[...this.#H.keys()])r.has(e)&&(this.#he(e),this.#H.delete(e));this.#H.size>50&&(this.#ge(),this.#H.clear())}_isLeaving(e){return this.#H.has(e.item.key)}_isFilteredOut(e,n){return!1}#ve(){if(this.#ye()||(this.#V.clear(),this.#ge(),this.#H.clear()),this.#V.size>0){for(let e of this.renderRoot.querySelectorAll(`.item`)){let n=e.dataset.key;if(!(n===void 0||!this.#V.has(n))){if(this.#U.has(n))this.#he(n);else for(let n of e.getAnimations())n.cancel();Xn(e)}}this.#V.clear()}if(this.#H.size>0)for(let e of this.renderRoot.querySelectorAll(`.item.leaving`)){let n=e.dataset.key;if(n===void 0||this.#U.has(n))continue;let r=$n(e),i=r.animation;if(!i){r.then(()=>{this.#H.has(n)&&(this.#H.delete(n),this.requestUpdate())});continue}this.#he(n),this.#U.set(n,i),r.then(()=>{this.#U.get(n)===i&&(this.#U.delete(n),this.#H.delete(n),this.requestUpdate(),this.updateComplete.then(()=>{try{i.cancel()}catch{}}))})}let e=this.#s().rows;this.#L=e.map(e=>e.node.item.key),this.#B.clear();for(let n of e)this.#B.set(n.node.item.key,n);this.#W=!0}#ye(){return this.#G===void 0?this.animation===`never`?!1:this.animation===`always`||!Wn():this.#G}updated(e){if(this.#$=void 0,this.#w(),this.#g){this.#g=!1,this.#be();return}if(this.#te(),e.has(`root`)&&this.root&&(this.#rt(),this.#Le(),this.tickled.clearTickled(),this._focusedDepth=0,this.#ge(),this.#H.clear(),this.#V.clear()),e.has(`model`)){this.#N?.(),this.#N=void 0;let e=this.model;e&&(this.root=e.root,this.#N=e._subscribe(e=>{e.type===`root`?(this.root=e.root,this.requestUpdate()):e.type===`invalidate`&&this._expandedKeys.has(e.key)&&(this.#e(nx(this._expandedKeys,e.key)),this.requestUpdate())}))}e.has(`interactionMode`)&&(this.#P=void 0,this.clearSelection()),e.has(`selectedNode`)&&this.selectedNode&&e.get(`selectedNode`)!==this.selectedNode&&this.tickled.setTickled(this.selectedNode.item.key),this.#_()?(this.#L=[],this.#B.clear(),this.#y()&&queueMicrotask(()=>this.requestUpdate()),this.#be()):this.#ve(),this.#G=void 0}#be(){this.search.isOpen&&this.search.repaintHighlights()}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#F=Yt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#A(),this.#xe()}#xe(){this.#K=Bb(),this.#X=new er(this,{source:`tree-list`,isEnabled:()=>this.itemDnd!==`none`&&this.#Ne(),resolveEventToKey:e=>{if(e instanceof Element)return e.closest(`ul.tree-list li[data-key]`)?.getAttribute(`data-key`)??void 0},prepareSelection:e=>{let n=this.#s(),r=n.rows,i=n.indexByKey.get(e),a=i===void 0?void 0:r[i];if(!a)return;let o=new Set(this._selectedNodes);o.has(a.node)||o.clear(),o.add(a.node);let s=r.filter(e=>o.has(e.node)).map(e=>e.node.item.key),c=new Set(this.root?wg(this.root,s):s),l=r.filter(e=>c.has(e.node.item.key)).map((e,n)=>({key:e.node.item.key,index:n,item:e.node,element:this.shadowRoot?.querySelector(`ul.tree-list li[data-key="${CSS.escape(e.node.item.key)}"]`)??void 0})),u=l.find(n=>n.key===e)??{key:e,index:0,item:a.node,element:void 0};return l.some(e=>e.key===u.key)||l.unshift(u),{origin:u,selected:l}},getMetrics:()=>({rowHeight:this.#we()}),getRenderer:()=>this.dragPreviewRenderer,getDragPreviewSourceResolver:()=>this.dragPreviewSource,dispatch:e=>{let n=e.selected.map(e=>e.key),r=e.selected.map(e=>e.item),i=new CustomEvent(`list-native-drag-start`,{detail:e,bubbles:!0,composed:!0,cancelable:!0}),a=this.dispatchEvent(i);return a&&(this.#Z=new Set(n),this.#Q=!1,(this.itemDnd===`internal`||this.itemDnd===`both`)&&Vb(this.#K,this,r,n),this.dispatchEvent(new CustomEvent(`tree-drag-start`,{detail:{nodes:r,keys:n},bubbles:!0,composed:!0}))),a},writeDataTransfer:(e,n)=>{if(this.itemDnd!==`internal`&&this.itemDnd!==`both`)return;let r=n.selected.map(e=>e.key),i=n.selected.map(e=>e.item);try{e.setData(Fb,JSON.stringify({sourceId:this.#K,keys:r,nodes:i})),e.setData(`text/plain`,i.map(e=>e.item.label).join(`
|
|
8142
|
+
`))}catch{}},onActiveChange:e=>{this.toggleAttribute(`data-native-dragging`,e),e||(this.#Z=new Set),this.requestUpdate()},onEnd:()=>{Hb(this.#K),this.#Z=new Set,this.#q=setTimeout(()=>{this.#q=void 0},150),this.#Q||this.dispatchEvent(new CustomEvent(`tree-drag-end`,{detail:{dropped:!1},bubbles:!0,composed:!0})),this.#Q=!1}}),this.#Y=new Yb(this,{getDndMode:()=>this.itemDnd,getExpandHoverMs:()=>this.dndExpandHoverMs,getVisibleRows:()=>this.#De(),getRowInfo:e=>{let n=this.#s(),r=n.indexByKey.get(e);if(r===void 0)return;let{node:i,depth:a,parentKey:o}=n.rows[r];return{node:i,depth:a,parentKey:o}},getChildren:e=>this.#Te(e),getIndentPx:()=>this.#Ce(),getScrollContainer:()=>this.#Se(),isSelfOrDescendant:(e,n)=>this.#ke(e,n),isExpanded:e=>this._expandedKeys.has(e),isReorderAllowed:()=>this.reorderable,getParentKey:e=>this.#Ae(e)?.item.key,resolveDrag:(e,n)=>this.#Me(e,n),vet:e=>{if(this.canDrop&&!this.canDrop(e))return!1;let n=new CustomEvent(`tree-drag-over`,{detail:e,bubbles:!0,composed:!0,cancelable:!0});return this.dispatchEvent(n)},expandKey:e=>this.#Oe(e),onDropStateChange:e=>{this.#J=e,this.toggleAttribute(`data-drop-rejected`,this.#Y.isDragging&&e===void 0),this.requestUpdate()},onActiveChange:e=>{e?(this.#$=void 0,this.#Se()?.addEventListener(`scroll`,this.#ee,{passive:!0})):(this.#Se()?.removeEventListener(`scroll`,this.#ee),this.#$=void 0,this.toggleAttribute(`data-drop-rejected`,!1)),this.requestUpdate()},commitDrop:e=>this.dispatchEvent(new CustomEvent(`tree-drop`,{detail:e,bubbles:!0,composed:!0,cancelable:!0}))?(this.applyInternalDrop&&e.source===`internal`&&this.model&&this.model.applyDrop({source:`internal`,draggedKeys:e.draggedKeys,target:e.target}),this.#Q=!0,!0):!1,onDragEnd:e=>{this.#J=void 0,this.toggleAttribute(`data-drop-rejected`,!1),this.requestUpdate(),this.dispatchEvent(new CustomEvent(`tree-drag-end`,{detail:{dropped:e},bubbles:!0,composed:!0}))}})}#Se(){return this.shadowRoot?.querySelector(`#container`)??void 0}#Ce(){let e=Number.parseInt(getComputedStyle(this).getPropertyValue(`--tree-indent`),10);return Number.isNaN(e)?20:e}#we(){let e=Number.parseInt(getComputedStyle(this).getPropertyValue(`--tree-item-height`),10);return Number.isNaN(e)?30:e}#Te(e){if(e===void 0)return this.root?.children??[];let n=this.#s(),r=n.indexByKey.get(e);return r===void 0?[]:n.rows[r].node.children??[]}#Ee(e,n,r){let i=this.#s(),a=this.#v(i.rows.length),o=px(dx(a),e.scrollTop,e.scrollTop+e.clientHeight,1);if(!o)return;let s=e.getBoundingClientRect(),c=n.querySelector(`li.item`)?.getBoundingClientRect()??s;for(let n=o.first;n<=o.last;n++){let{node:o,depth:l}=i.rows[n],u=s.top-e.scrollTop+ax(a,n),d={x:c.left,y:u,left:c.left,right:c.left+c.width,top:u,bottom:u+a.rowHeight,width:c.width,height:a.rowHeight,toJSON:()=>({})};r.push({key:o.item.key,node:o,depth:l,index:n,rect:d})}}#De(){if(this.#$)return this.#$;let e=[],n=this.#Se(),r=this.renderRoot.querySelector(`ul.tree-list`),i=this.#R;if(n&&r&&this.#_())this.#Ee(n,r,e);else if(n&&r&&r.children.length===i.length){let a=this.#s(),o=r.children,s=px(this.#re(o),n.scrollTop,n.scrollTop+n.clientHeight,1);if(s)for(let n=s.first;n<=s.last;n++){let r=o[n];if(r.classList.contains(`leaving`))continue;let s=a.indexByKey.get(i[n]);if(s===void 0)continue;let{node:c,depth:l}=a.rows[s];e.push({key:c.item.key,node:c,depth:l,index:s,rect:r.getBoundingClientRect()})}}return this.#$=e,e}#Oe(e){if(this._expandedKeys.has(e))return;let n=this.#s(),r=n.indexByKey.get(e),i=r===void 0?void 0:n.rows[r];!i||i.node.item.isLeaf===!0||(this.#Je(i.node,i.depth),this.#$=void 0,this.requestUpdate())}#ke(e,n){if(e===n)return!0;let{parentByKey:r}=this.#c(),i=r.get(n);for(;i!==void 0;){if(i===e)return!0;i=r.get(i)}return!1}#Ae(e){let n=this.#c().parentByKey.get(e);if(n!==void 0&&n!==this.root?.item.key)return this.#je(n)}#je(e){let n=this.#s(),r=n.indexByKey.get(e);if(r!==void 0)return n.rows[r].node;let{parentByKey:i}=this.#c(),a=[];for(let n=e;n!==void 0&&n!==this.root?.item.key;n=i.get(n))a.unshift(n);let o=this.root;for(let e of a)o=o?.children?.find(n=>n.item.key===e);return o}#Me(e,n){let r=this.itemDnd;if(r===`none`)return;let i=r===`internal`||r===`both`,a=r===`external`||r===`both`,o=[];try{o=Array.from(e.types)}catch{}let s=Ub(),c=o.includes(Fb)||s!==void 0;if(i&&c){if(s&&s.keys.length>0){let e=this.root?wg(this.root,s.keys):s.keys;return{source:`internal`,keys:e,nodes:e.map(e=>this.#je(e)).filter(e=>e!==void 0)}}if(n===`drop`)try{let n=e.getData(Fb);if(n){let e=JSON.parse(n);return{source:`internal`,keys:e.keys??[],nodes:e.nodes??[]}}}catch{}return{source:`internal`,keys:[],nodes:[]}}if(a&&!c){if(this.acceptDropTypes!==void 0){let n=this.acceptDropTypes.trim().split(/\s+/).filter(Boolean),r=Array.from(e.types);if(n.length>0&&!n.some(e=>r.includes(e)))return}if(n===`drop`){let n=this.parseExternalDrop?.(e);return!n||n.length===0?void 0:{source:`external`,keys:n.map(e=>e.item.key),nodes:n}}return this.parseExternalDrop?{source:`external`,keys:[],nodes:[]}:void 0}}#Ne(){if(this.itemDnd===`none`)return!1;let e=this.#s().rows;return e.length===0?!1:!this.canDrag||e.some(({node:e})=>this.canDrag({nodes:[e],keys:[e.item.key]}))}disconnectedCallback(){super.disconnectedCallback(),this.#ge(),this.#H.clear(),this.#V.clear(),this.#N?.(),this.#N=void 0,this.#O?.(),this.#O=void 0,this.#q!==void 0&&(clearTimeout(this.#q),this.#q=void 0),this.#Se()?.removeEventListener(`scroll`,this.#ee),this.#T(),this.#me&&=(this.#pe?.removeEventListener(`scroll`,this.#ne),this.#pe=void 0,!1),this.#fe!==0&&(cancelAnimationFrame(this.#fe),this.#fe=0),Hb(this.#K),this.#F&&(this.#F.unregister(`select-all`),this.#F.unregister(`deselect-all`),this.#F=void 0,this.registry=void 0)}getConfig(){return{...this.#I}}setConfig(e){this.#I={...this.#I,...e},this.requestUpdate()}select(e){if(!this.#Ie(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#Be(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#Be(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#Le(),this.#Be(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);if(this.interactionMode===`checked`)for(let{node:e}of this.#s().rows)this.#Ie(e)&&this.#Xe(e,!0);else{for(let{node:e}of this.#s().rows)this.#Ie(e)&&this._selectedNodes.add(e);this.selectedNode=[...this._selectedNodes].at(-1)}this.#Be(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);if(this.interactionMode===`checked`)for(let{node:e}of this.#s().rows)this.#Ie(e)&&this.#Xe(e,!1);else this.#Le();this.#Be(e),this.requestUpdate()}expandAll(e,n){this.#G=n,this.#Pe(!0,e)}collapseAll(e,n){this.#G=n,this.#Pe(!1,e)}#Pe(e,n){let r=this.root;if(!r)return;let i=r=>e?r<(n??1/0):r>=(n??0),a=[],o=this._expandedKeys,s=(n,r)=>{let c=n.children;if(n.item.isLeaf!==!0&&c!==void 0&&c.length>0&&i(r)){let i=o.has(n.item.key);e&&!i?(o=tx(o,n.item.key),this._isExpanded(n,r)||a.push({node:n,depth:r})):!e&&i&&(o=nx(o,n.item.key),a.push({node:n,depth:r}))}for(let e of c??[])s(e,r+1)};for(let e of r.children??[])s(e,0);if(o===this._expandedKeys)return;this.#e(o);let c=e?`expand`:`collapse`;for(let{node:e,depth:n}of a)this.dispatchEvent(new CustomEvent(c,{detail:{node:e,depth:n},bubbles:!0,composed:!0}));this.requestUpdate()}navigateTo(e,n={}){if(!this.root?.children)return!1;let r=this.#Re,i=this.#ze;this.#Re=`programmatic`,this.#ze=n.silent===!0,n.animate!==void 0&&(this.#G=n.animate);try{return this.#Fe(e,n.reveal??`edge`)}finally{this.#Re=r,this.#ze=i}}#Fe(e,n){this.#rt(),this.#Le(),this.tickled.clearTickled(),this._focusedDepth=0;let r=this.root;for(let n of e){let i=r?.children;if(!i)return!1;let a=i.find(e=>e.item.key===n);if(!a)return!1;this.#it(a.item.key),this.#e(tx(this._expandedKeys,a.item.key)),n===e.at(-1)&&(this.select(a),this.tickled.setTickled(a.item.key)),r=a}return this.#de=!0,this.requestUpdate(),this.#et(e.at(-1),n),!0}navigateToNode(e,n){if(!this.root?.children)return!1;n!==void 0&&(this.#G=n);let r=this.#Ve(this.root.children,e);return r?this.navigateTo(r):!1}revealKey(e,n){if(!this.root?.children)return!1;n!==void 0&&(this.#G=n);let r=this.#Ve(this.root.children,n=>n.item.key===e);if(!r)return!1;for(let e=0;e<r.length-1;e++)this.#it(r[e]),this.#e(tx(this._expandedKeys,r[e]));return this.tickled.setTickled(e),this.#de=!0,this.requestUpdate(),this.updateComplete.then(()=>this.#et(e)),!0}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#Ie(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#Be(n),this.requestUpdate()}getNodes(){if(!this.root?.children)return[];let e=[],n=(r,i)=>{if(e.push({node:r,depth:i}),r.children)for(let e of r.children)n(e,i+1)};for(let e of this.root.children)n(e,0);return e}#Ie(e){return e.item.selectable===!1||this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0||e.item.isLeaf!==!1&&e.children?.length===0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#Le(){this._selectionVersion++,this._selectedNodes.clear(),this.selectedNode=void 0}#Re;#ze;#Be(e){if(this._selectionVersion++,this.#ze)return;let n={selected:new Set(this._selectedNodes),previous:e,origin:this.#Re};this.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}#Ve(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#Ve(i.children,n,e);if(r)return r}}}renderNodeContent(e,n){let r=e.item.isLeaf!==!0,o=this._isExpanded(e,n);return i`
|
|
8105
8143
|
<span class="tree-caret">
|
|
8106
8144
|
${r?i`<ixfx-icon class="caret-icon" name="chevron-down" .rotate=${o?a:`-90deg`}></ixfx-icon>`:``}
|
|
8107
8145
|
</span>
|
|
8108
8146
|
<span class="tree-label">${e.item.label}</span>
|
|
8109
|
-
`}_handleItemClick(e,n,r){if(!(this.#
|
|
8147
|
+
`}_handleItemClick(e,n,r){if(!(this.#Y?.isDragging||this.#X?.isDragging||this.#q!==void 0)&&!(r&&r.detail>=2)){switch(this.#j&&this._expandedKeys.has(this.#j.item.key)&&this.#rt(),this.tickled.handlePointerEnter(e.item.key),this._focusedDepth=n,this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e,depth:n},bubbles:!0,composed:!0})),this.interactionMode){case`implicit`:this.#Ue(e,n,r);break;case`standard`:this.#We(e,n,r);break;case`vscode`:this.#We(e,n,r);break;case`manual`:this.#Ke(e,n,r);break;case`checked`:this.#Ge(e,n)}this.requestUpdate()}}#He(e,n){if(e.item.isLeaf===!0)return!1;let r=n?.target;return r instanceof Element&&r.closest(`.tree-caret`)!==null}#Ue(e,n,r){if(!this.#He(e,r)&&this.#Ie(e)){let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,(!n.has(e)||n.size!==1)&&this.#Be(n)}this.#Je(e,n)}#We(e,n,r){let i=r?r.metaKey||r.ctrlKey:!1,a=r?r.shiftKey:!1;if(i){if(this.#Ie(e)){let n=new Set(this._selectedNodes);this._selectedNodes.has(e)?(this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1))):(this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ze(e)}),this.#Be(n)}return}if(a&&this.#P){let n=this.#s(),r=n.rows,i=n.indexByKey.get(this.#P.node.item.key)??-1,a=n.indexByKey.get(e.item.key)??-1;if(i>=0&&a>=0){let n=new Set(this._selectedNodes),o=Math.min(i,a),s=Math.max(i,a),c=r.slice(o,s+1).map(e=>e.node).filter(e=>this.#Ie(e));this._selectedNodes=new Set(c),this.selectedNode=e,this.#Be(n)}return}if(!this.#He(e,r)&&this.#Ie(e)){let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ze(e)},(!n.has(e)||n.size!==1)&&this.#Be(n)}this.#Je(e,n)}#Ge(e,n){this.#Je(e,n)}#Ke(e,n,r){let i=r?r.metaKey||r.ctrlKey:!1,a=r?r.shiftKey:!1;if(i){if(this.#Ie(e)){let n=new Set(this._selectedNodes);this._selectedNodes.has(e)?(this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1))):(this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ze(e)}),this.#Be(n)}return}if(a&&this.#P){let n=this.#s(),r=n.rows,i=n.indexByKey.get(this.#P.node.item.key)??-1,a=n.indexByKey.get(e.item.key)??-1;if(i>=0&&a>=0){let n=new Set(this._selectedNodes),o=Math.min(i,a),s=Math.max(i,a),c=r.slice(o,s+1).map(e=>e.node).filter(e=>this.#Ie(e));this._selectedNodes=new Set(c),this.selectedNode=e,this.#Be(n)}return}this.#Je(e,n)}#qe(e,n){if(!this.#Ie(e))return;let r=new Set(this._selectedNodes);this._selectedNodes.has(e)?(this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1))):(this._selectedNodes.add(e),this.selectedNode=e,this.#P={node:e,flatIndex:this.#Ze(e)}),this.#Be(r)}_handleCheckboxClick(e,n,r){e.stopPropagation();let i=new Set(this._selectedNodes),a=this.#Ye(n);this.#Xe(n,!a),(this.selectedNode===void 0||!this._selectedNodes.has(this.selectedNode))&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#Be(i),this.requestUpdate()}#Je(e,n){let r=this._expandedKeys.has(e.item.key);if(this.#de=!0,r)this.#e(nx(this._expandedKeys,e.item.key)),this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}));else if(e.children===void 0){if(e.item.isLeaf!==!1)return;if(this.model??(this.loadChildren?this:void 0)){this.#j=e;let r=new AbortController;this.#M=r,this.#$e(e,n,r).catch(()=>{})}}else this.#it(e.item.key),this.#e(tx(this._expandedKeys,e.item.key)),this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}#Ye(e){let n=[],r=e=>{this.#Ie(e)&&n.push(e),e.children?.forEach(r)};return r(e),n.length>0&&n.every(e=>this._selectedNodes.has(e))}#Xe(e,n){if(this.#Ie(e)&&(n?this._selectedNodes.add(e):this._selectedNodes.delete(e)),e.children)for(let r of e.children)this.#Xe(r,n)}#Ze(e){return this.#s().indexByKey.get(e.item.key)??-1}#Qe(e,n,r){if(!this.#P){let r=e[n]?.node;r&&(this.#P={node:r,flatIndex:n})}if(!this.#P)return;let i=this.#s().indexByKey.get(this.#P.node.item.key)??-1;if(i<0)return;let a=Math.min(i,r),o=Math.max(i,r);if(this.interactionMode===`vscode`){this.#P.selectionSnapshot||(this.#P={...this.#P,selectionSnapshot:new Set(this._selectedNodes)});let n=this.#P.selectionSnapshot,i=e.slice(a,o+1).map(e=>e.node).filter(e=>this.#Ie(e)),s=new Set(n);for(let e of i)n.has(e)?s.delete(e):s.add(e);let c=new Set(this._selectedNodes);this._selectedNodes=s,this.selectedNode=e[r]?.node??this.selectedNode,this.#Be(c)}else{let n=new Set(this._selectedNodes),i=e.slice(a,o+1).map(e=>e.node).filter(e=>this.#Ie(e));this._selectedNodes=new Set(i),this.selectedNode=e[r]?.node??this.selectedNode,this.#Be(n)}}async#$e(e,n,r){try{let i;if(i=this.model?await this.model.getChildren(e,n,r.signal):[...await gg(this.loadChildren({node:e,depth:n},r.signal),r.signal)],r.signal.aborted)return;e.children=i,this.#i++,this.#it(e.item.key),this.#e(tx(this._expandedKeys,e.item.key)),this.#t=void 0,this.#de=!0,this.#j=void 0,this.#M=void 0,this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:n},bubbles:!0,composed:!0})),this.requestUpdate()}catch{if(r.signal.aborted)return;e.children=[],this.#i++,this.#t=void 0,this.#j=void 0,this.#M=void 0,this.requestUpdate()}}_isSelected(e){return this._selectedNodes.has(e)}_isFocused(e){return this.tickled.isTickled(e.item.key)}_isExpanded(e,n=0){return this._expandedKeys.has(e.item.key)?!0:this.#D()?.autoExpanded.has(e.item.key)??!1}get _pendingNode(){return this.#j}#et(e,n=`edge`){if(n===`center-if-hidden`){this.updateComplete.then(()=>{this.#y();let r=this.#s().indexByKey.get(e);r!==void 0&&this.#E(r,n)});return}if(this.#_()){this.updateComplete.then(()=>{let n=this.#s().indexByKey.get(e);n!==void 0&&this.#E(n)});return}let r=++this.#tt;requestAnimationFrame(()=>{this.#nt(e);let n=this.#Se()?.getAnimations?.({subtree:!0})??[];n.length>0&&Promise.allSettled(n.map(e=>e.finished)).then(()=>{r===this.#tt&&this.#nt(e)})})}#tt;#nt(e){let n=this.#Se(),r=this.shadowRoot?.querySelector(`ul.tree-list [data-key="${CSS.escape(e)}"]`);if(!r||!n)return;let i=r.getBoundingClientRect(),a=n.getBoundingClientRect(),o=i.top-a.top,s=o+i.height,c=this.renderRoot.querySelector(`.sticky-headers`)?.getBoundingClientRect().height??0;o<c?n.scrollTop+=o-c:s>n.clientHeight&&(n.scrollTop+=s-n.clientHeight)}#rt(){this.#M&&(this.#M.abort(),this.#M=void 0,this.#j=void 0)}#it(e){if(this.exclusivity!==`none`){if(this.exclusivity===`depth`)this.#at(e);else if(this.exclusivity===`global`){let n=this.#ot(e);this.#e(rx(this._expandedKeys,r=>!n.has(r)&&r!==e))}}}#at(e){if(!this.root)return;let n=this.#st(this.root,e);if(!n?.children)return;let r=new Set(n.children.map(e=>e.item.key));this.#e(rx(this._expandedKeys,n=>n!==e&&r.has(n)))}#ot(e){let n=new Set,r=i=>{if(i.item.key===e)return!0;if(!i.children)return!1;for(let e of i.children)if(r(e))return n.add(i.item.key),!0;return!1};return this.root&&r(this.root),n}#st(e,n,r=void 0){if(e.children)for(let i of e.children){if(i.item.key===n)return r??e;let a=this.#st(i,n,i);if(a)return a}}#ct(){let e=this.tickled.tickledId;return e?this.#s().indexByKey.get(e)??0:0}#lt(e){let n=this.#s().rows;if(e<0||e>=n.length)return;let{node:r,depth:i}=n[e];if(this.tickled.setTickled(r.item.key),this._focusedDepth=i,this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:r,depth:i},bubbles:!0,composed:!0})),this.requestUpdate(),this.#_()){this.#E(e);return}this.updateComplete.then(()=>this.#ut())}#ut(){let e=this.tickled.tickledId;e!==void 0&&(this.shadowRoot?.querySelector(`ul.tree-list [data-key="${CSS.escape(e)}"]`))?.scrollIntoView({block:`nearest`,behavior:`smooth`})}#dt(){return this.#y(),ux(this.#v(this.#s().rows.length))}#ft(e,n,r,i){this.interactionMode===`implicit`&&this.select(e[r].node),this.#lt(r),i&&(this.interactionMode===`standard`||this.interactionMode===`vscode`)?this.#Qe(e,n,r):this.interactionMode===`vscode`&&(this.#P=void 0),this.requestUpdate()}#pt;renderLoadingIndicator(){return i`<span class="loading-spinner"></span>`}render(){let e=this.#s().rows;return i`
|
|
8110
8148
|
<div
|
|
8111
8149
|
id="container"
|
|
8112
8150
|
data-input-mode=${this.tickled.inputMode}
|
|
8113
|
-
@keydown=${this.#
|
|
8114
|
-
@dblclick=${this.#
|
|
8151
|
+
@keydown=${this.#pt}
|
|
8152
|
+
@dblclick=${this.#mt}
|
|
8115
8153
|
@pointerleave=${e=>this.tickled.handlePointerLeave(e)}
|
|
8116
8154
|
tabindex="0"
|
|
8117
8155
|
>
|
|
8118
|
-
${this.#
|
|
8119
|
-
${this.root?this.#
|
|
8156
|
+
${this.#oe()}
|
|
8157
|
+
${this.root?this.#ht(e):a}
|
|
8120
8158
|
</div>
|
|
8121
8159
|
${this.search.renderField()}
|
|
8122
|
-
`}#
|
|
8160
|
+
`}#mt;#ht(e){if(e.length===0&&this.#j&&this.#H.size===0)return i`
|
|
8123
8161
|
<div class="tree-loading">
|
|
8124
8162
|
${this.renderLoadingIndicator()}
|
|
8125
8163
|
</div>
|
|
8126
|
-
`;if(this.#_())return this.#
|
|
8164
|
+
`;if(this.#_())return this.#gt(e);let n=$b(e,this.#R,this.#H);return this.#R=n.map(e=>e.node.item.key),this.#z=new Map(this.#R.map((e,n)=>[e,n])),i`
|
|
8127
8165
|
<ul class="tree-list" role="tree">
|
|
8128
8166
|
${_(n,({node:e})=>e.item.key,({node:e,depth:n})=>this._renderNode(e,n))}
|
|
8129
8167
|
</ul>
|
|
8130
|
-
`}#
|
|
8168
|
+
`}#gt(e){let n=this.#v(e.length),{start:r,end:a}=this.#b(e.length);this.#m=r,this.#h=a,this.#R=[],this.#z=new Map;let o=ix(n);return i`
|
|
8131
8169
|
<ul class="tree-list virtual" role="tree" aria-rowcount=${e.length}>
|
|
8132
8170
|
<li class="virtual-spacer" role="presentation" aria-hidden="true" style=${`height: ${r*o}px`}></li>
|
|
8133
8171
|
${_(e.slice(r,a),({node:e})=>e.item.key,({node:e,depth:n})=>this._renderNode(e,n))}
|
|
8134
8172
|
<li class="virtual-spacer" role="presentation" aria-hidden="true" style=${`height: ${(e.length-a)*o}px`}></li>
|
|
8135
8173
|
</ul>
|
|
8136
|
-
`}_ariaSetInfo(e){let n=this.#s(),r=n.indexByKey.get(e.item.key);if(r===void 0)return;let{posInSet:i,setSize:a}=n.rows[r];return{posInSet:i,setSize:a}}_dndRowState(e){let n=this.itemDnd!==`none`&&(this.root?.children?.length??0)>0&&(this.itemDnd===`internal`||this.itemDnd===`both`||this.itemDnd===`external`)&&(this.canDrag?.({nodes:[e],keys:[e.item.key]})??!0),r=this.#
|
|
8174
|
+
`}_ariaSetInfo(e){let n=this.#s(),r=n.indexByKey.get(e.item.key);if(r===void 0)return;let{posInSet:i,setSize:a}=n.rows[r];return{posInSet:i,setSize:a}}_dndRowState(e){let n=this.itemDnd!==`none`&&(this.root?.children?.length??0)>0&&(this.itemDnd===`internal`||this.itemDnd===`both`||this.itemDnd===`external`)&&(this.canDrag?.({nodes:[e],keys:[e.item.key]})??!0),r=this.#Z.has(e.item.key),i=this.#J,a=i!==void 0&&i.referenceKey===e.item.key;return{draggable:n,dragging:r,dropTarget:a,dropPosition:a?i.position:void 0,dropDepth:a?i.depth:void 0}}_renderNode(e,n){let r=this._isSelected(e),o=this._isFocused(e),s=e.item.isLeaf!==!0,c=this._isExpanded(e,n),l=this.#j===e,u=this._isLeaving(e),d=this._dndRowState(e);return i`
|
|
8137
8175
|
<li
|
|
8138
8176
|
class="item ${r?`selected`:``} ${o?`tickled`:``} ${s?`branch`:`leaf`} ${u?`leaving`:``} ${d.dragging?`dragging`:``} ${d.dropTarget&&d.dropPosition===`inside`?`drop-into`:``}"
|
|
8139
8177
|
role="treeitem"
|
|
@@ -8376,7 +8414,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8376
8414
|
:host([data-drop-rejected]) {
|
|
8377
8415
|
cursor: not-allowed;
|
|
8378
8416
|
}
|
|
8379
|
-
`]}};E([d({type:Object})],q.prototype,`root`,void 0),E([d({attribute:!1})],q.prototype,`model`,void 0),E([d({attribute:!1})],q.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],q.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],q.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],q.prototype,`interactionMode`,void 0),E([d({attribute:!1})],q.prototype,`selectedNode`,void 0),E([m()],q.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],q.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],q.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],q.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],q.prototype,`searchModes`,void 0),E([d({reflect:!0,attribute:`item-dnd`})],q.prototype,`itemDnd`,void 0),E([d({type:String,attribute:`accept-drop-types`})],q.prototype,`acceptDropTypes`,void 0),E([d({type:Number,attribute:`dnd-expand-hover-ms`})],q.prototype,`dndExpandHoverMs`,void 0),E([d({reflect:!0,attribute:`reorderable`,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?null:`false`}})],q.prototype,`reorderable`,void 0),E([d({reflect:!0,attribute:`sticky-headers`,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?null:`false`}})],q.prototype,`stickyHeaders`,void 0),E([d({reflect:!0,attribute:`virtualize`})],q.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`virtualize-threshold`})],q.prototype,`virtualizeThreshold`,void 0),E([d({attribute:!1})],q.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],q.prototype,`dragPreviewSource`,void 0),E([d({attribute:!1})],q.prototype,`canDrag`,void 0),E([d({attribute:!1})],q.prototype,`canDrop`,void 0),E([d({attribute:!1})],q.prototype,`parseExternalDrop`,void 0),E([d({attribute:!1})],q.prototype,`applyInternalDrop`,void 0),E([m()],q.prototype,`_expandedKeys`,void 0),E([m()],q.prototype,`_scrollTop`,void 0),E([m()],q.prototype,`_focusedDepth`,void 0),E([m()],q.prototype,`_stickyKeys`,void 0),q=E([T(`ixfx-tree-base`)],q);let
|
|
8417
|
+
`]}};E([d({type:Object})],q.prototype,`root`,void 0),E([d({attribute:!1})],q.prototype,`model`,void 0),E([d({attribute:!1})],q.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],q.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],q.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],q.prototype,`interactionMode`,void 0),E([d({attribute:!1})],q.prototype,`selectedNode`,void 0),E([m()],q.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],q.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],q.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],q.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],q.prototype,`searchModes`,void 0),E([d({reflect:!0,attribute:`item-dnd`})],q.prototype,`itemDnd`,void 0),E([d({type:String,attribute:`accept-drop-types`})],q.prototype,`acceptDropTypes`,void 0),E([d({type:Number,attribute:`dnd-expand-hover-ms`})],q.prototype,`dndExpandHoverMs`,void 0),E([d({reflect:!0,attribute:`reorderable`,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?null:`false`}})],q.prototype,`reorderable`,void 0),E([d({reflect:!0,attribute:`sticky-headers`,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?null:`false`}})],q.prototype,`stickyHeaders`,void 0),E([d({reflect:!0,attribute:`virtualize`})],q.prototype,`virtualize`,void 0),E([d({type:Number,attribute:`virtualize-threshold`})],q.prototype,`virtualizeThreshold`,void 0),E([d({reflect:!0,attribute:`animation`})],q.prototype,`animation`,void 0),E([d({attribute:!1})],q.prototype,`dragPreviewRenderer`,void 0),E([d({attribute:!1})],q.prototype,`dragPreviewSource`,void 0),E([d({attribute:!1})],q.prototype,`canDrag`,void 0),E([d({attribute:!1})],q.prototype,`canDrop`,void 0),E([d({attribute:!1})],q.prototype,`parseExternalDrop`,void 0),E([d({attribute:!1})],q.prototype,`applyInternalDrop`,void 0),E([m()],q.prototype,`_expandedKeys`,void 0),E([m()],q.prototype,`_scrollTop`,void 0),E([m()],q.prototype,`_focusedDepth`,void 0),E([m()],q.prototype,`_stickyKeys`,void 0),q=E([T(`ixfx-tree-base`)],q);let hx=class extends q{constructor(...e){super(...e),this.alignCheckboxes=!1}#e;willUpdate(e){super.willUpdate(e),this.#t()}#t(){let e=this.root;if(this.interactionMode!==`checked`||!e){this.#e=void 0;return}let n=this.#e;n&&n.root===e&&n.structureVersion===this._structureVersion&&n.selectionVersion===this._selectionVersion||(this.#e={root:e,structureVersion:this._structureVersion,selectionVersion:this._selectionVersion,states:ex(e,this._selectedNodes)})}renderNodeContent(e,n){let r=e.item.isLeaf!==!0,o=this._isExpanded(e,n),s=e.item.icon,c=e.item.tooltip,l=i`
|
|
8380
8418
|
<span class="tree-caret">
|
|
8381
8419
|
${r?i`<ixfx-icon class="caret-icon" name="chevron-down" .rotate=${o?a:`-90deg`}></ixfx-icon>`:``}
|
|
8382
8420
|
</span>
|
|
@@ -8517,7 +8555,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8517
8555
|
white-space: nowrap;
|
|
8518
8556
|
position: relative;
|
|
8519
8557
|
}
|
|
8520
|
-
`]}};E([d({attribute:!1})],ux.prototype,`checkboxRenderer`,void 0),E([d({type:Boolean,reflect:!0,attribute:`align-checkboxes`})],ux.prototype,`alignCheckboxes`,void 0),ux=E([T(`ixfx-tree-list`)],ux);function dx(e,n){let r=document.createElement(`div`);r.style.cssText=`display:contents;`;let i;function a(r){let i={...e(r),data:r},o=n?.getChildren?.(r);return{item:i,children:o?o.map(a):i.isLeaf?[]:void 0}}function o(){return i||(i=document.createElement(`ixfx-tree-list`),i.interactionMode=n?.interactionMode??`standard`,i.selectionFilter=n?.selectionFilter??`all`,i.exclusivity=n?.exclusivity??`none`,i.style.cssText=`display:block;width:100%;`,r.appendChild(i),c(),i)}function s(e){let n=new Set;for(let r of e)r.item.data!==void 0&&n.add(r.item.data);return n}function c(){i.addEventListener(`select`,e=>{e.stopPropagation();let n={selected:s(e.detail.selected),previous:s(e.detail.previous)};r.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}),i.addEventListener(`activate`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`activate`,{detail:i,bubbles:!0,composed:!0}))}),i.addEventListener(`item-click`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`item-click`,{detail:i,bubbles:!0,composed:!0}))}),i.addEventListener(`tickle`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`tickle`,{detail:i,bubbles:!0,composed:!0}))})}let l=`single`,u=Object.assign(r,{setItems(e){let n=o();n.root={item:{key:`__adapter_root__`,label:``,isLeaf:!1},children:e.map(a)}},clearSelection(){i?.clearSelection()},dispatch(e,r){n?.onDispatch?.(e,r,i)}});return Object.defineProperties(u,{selectedItems:{get(){return i?s(i.selectedNodes):new Set},enumerable:!0,configurable:!0},selectionMode:{get(){return l},set(e){l=e,i&&(e===`none`?i.selectionFilter=`none`:e===`single`?(i.selectionFilter=n?.selectionFilter??`all`,i.interactionMode=`implicit`):(i.selectionFilter=n?.selectionFilter??`all`,i.interactionMode=n?.interactionMode??`standard`))},enumerable:!0,configurable:!0}}),u}function fx(e,n){let r=document.createElement(`div`);r.style.cssText=`display:contents;`;let i,a=n?.selectionMode??`single`,o=new WeakMap;function s(){return i||(i=document.createElement(`ixfx-vertical-list`),i.style.cssText=`height:auto;width:100%;`,i.selectionMode=a,n?.interactionMode&&(i.interactionMode=n.interactionMode),r.appendChild(i),c(),i)}function c(){i.addEventListener(`list-select`,e=>{let n={selected:u(e.detail.selected),previous:u(e.detail.previous)};r.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}),i.addEventListener(`list-activate`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`activate`,{detail:{item:n},bubbles:!0,composed:!0}))}),i.addEventListener(`list-item-click`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`item-click`,{detail:{item:n},bubbles:!0,composed:!0}))}),i.addEventListener(`list-tickle`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`tickle`,{detail:{item:n},bubbles:!0,composed:!0}))})}function l(n){let r=s();r.clearItems(),o=new WeakMap;for(let i of n){let n=e(i);o.set(n,i),r.addItem(n)}}function u(e){let n=new Set;for(let r of e){let e=o.get(r);e!==void 0&&n.add(e)}return n}let d=Object.assign(r,{setItems(e){l(e)},clearSelection(){i?.clearSelection()},dispatch(e,r){n?.onDispatch?.(e,r,i)}});return Object.defineProperties(d,{selectedItems:{get(){return i?u(i.selectedItems):new Set},enumerable:!0,configurable:!0},selectionMode:{get(){return i?.selectionMode??a},set(e){a=e,i&&(i.selectionMode=e)},enumerable:!0,configurable:!0}}),d}const px=new Set([9,10,11,12,13,32]);function mx(e){return e<32&&e!==9&&e!==10&&e!==11&&e!==12&&e!==13}function hx(e){return e>=32&&e<=126}function gx(e){return e===0?`byte-null`:px.has(e)?`byte-whitespace`:mx(e)?`byte-control`:hx(e)?`byte-printable`:`byte-other`}function _x(e,n,r,i){let a=ag.createSteps(r,i,{steps:16}).map(ag.toCssColour);return{forByte:r=>r===0?e:r===255?n:a[r>>4]}}function vx(e){return{data:new Uint8Array(e),changeset:new Set}}function yx(e,n){return e.data[n]??0}function bx(e){return e.data.length}function xx(e){return Math.max(0,Math.min(255,e))}function Sx(e,n,r){let i=xx(r),a=e.data[n],o=new Map([[n,{before:a,after:i}]]);return e.data[n]=i,e.changeset.add(n),o}function Cx(e,n){let r=new Map;return n.forEach((n,i)=>{let a=xx(n),o=e.data[i];r.set(i,{before:o,after:a}),e.data[i]=a,e.changeset.add(i)}),r}function wx(e,n){let r=new Map;return n.forEach((n,i)=>{let a=e.data[i];r.set(i,{before:n.after,after:a}),e.data[i]=n.after,e.changeset.add(i)}),r}function Tx(e){let n=new Map;return e.forEach((e,r)=>{n.set(r,{before:e.after,after:e.before})}),n}function Ex(e){return e.changeset}function Dx(){return{undos:[],redos:[]}}function Ox(e,n){e.undos.push(n),e.redos=[]}function kx(e){let n=e.undos.pop();return n&&e.redos.push(n),n}function Ax(e){let n=e.redos.pop();return n&&e.undos.push(n),n}const jx=e=>e*4,Mx=(e,n)=>e<n?e:n,Nx=(e,n)=>e>n?e:n;function Px(e,n){return Math.max(0,Math.min(e,n-1))}function Fx(e,n){if(!e)return[];let r=jx(n);if(e.kind===`single`)return[e.pos];if(e.kind===`contiguous`){let n=Mx(e.start,e.end),r=Nx(e.start,e.end),i=[];for(let e=n;e<=r;e++)i.push(e);return i}if(e.kind===`rectangular`){let n=[];for(let i=0;i<e.height;i++)for(let a=0;a<e.width;a++){let o=e.y+i,s=e.x+a,c=o*r+s;n.push(c)}return n}return[]}function Ix(e,n,r){if(!e)return!1;let i=jx(r);if(e.kind===`single`)return n===e.pos;if(e.kind===`contiguous`){let r=Mx(e.start,e.end),i=Nx(e.start,e.end);return n>=r&&n<=i}if(e.kind===`rectangular`){let r=Math.floor(n/i),a=n%i,o=e.x,s=e.y,c=e.width,l=e.height;return r>=s&&r<s+l&&a>=o&&a<o+c}return!1}function Lx(e,n,r,i){let a;a=e?e.kind===`single`?e.pos:e.kind===`contiguous`?Nx(e.start,e.end):e.kind===`rectangular`?e.y*jx(r)+e.x+e.width-1:0:0;let o=jx(r),s;switch(n){case`left`:s=a-1;break;case`right`:s=a+1;break;case`up`:s=a-o;break;case`down`:s=a+o;break;default:s=a}return Px(s,i)}function Rx(e,n,r,i){return{kind:`single`,pos:Lx(e,n,r,i)}}function zx(e,n,r,i,a=0,o=0){let s=jx(r),c,l,u,d;if(!e||e.kind===`single`){let n=e?.kind===`single`?e.pos:0;c=n%s,l=Math.floor(n/s),u=1,d=1}else if(e.kind===`contiguous`){let n=Mx(e.start,e.end),r=Nx(e.start,e.end);c=n%s,l=Math.floor(n/s),u=r-n+1,d=1}else e.kind===`rectangular`?(c=e.x,l=e.y,u=e.width,d=e.height):(c=0,l=0,u=1,d=1);let f=a>0||e?.kind===`rectangular`?a:c,p=o>0||e?.kind===`rectangular`?o:l;switch(n){case`left`:c>f?--u:(c===f&&u>1||c>0)&&(--c,u+=1);break;case`right`:c+u<s&&(u+=1);break;case`up`:l>p?--d:(l===p&&d>1||l>0)&&(--l,d+=1);break;case`down`:d+=1}return{kind:`rectangular`,x:c,y:l,width:u,height:d}}function Bx(e,n,r,i){let a=jx(i);if(r===`contiguous`)return{kind:`contiguous`,start:Mx(e,n),end:Nx(e,n)};let o=e%a,s=Math.floor(e/a),c=n%a,l=Math.floor(n/a);return{kind:`rectangular`,x:Mx(o,c),y:Mx(s,l),width:Math.abs(c-o)+1,height:Math.abs(l-s)+1}}let Vx=class extends n{constructor(...e){super(...e),this.columns=4,this.colourScheme=`ascii`,this.showChangeset=!0,this.hideOffsetCol=!1,this.hideHexCol=!1,this.hideTextCol=!1,this._selection=null,this._scrollTop=0,this._editState=null,this._containerH=0,this._shadeMap=null,this._focusSide=null,this._store=vx(new Uint8Array),this._undoStack=Dx(),this._copyBuffer=null,this._rowHeight=24,this._dragStart=null,this._dragAnchor=null,this._rectAnchorX=0,this._rectAnchorY=0,this._rectAnchorXFromKeyboard=0,this._rectAnchorYFromKeyboard=0,this._initialSelectionPoint=0,this._currentCursorPoint=0,this._pointerMode=null,this._currentDragDiff=null,this._shiftClickTarget=null,this._onScroll=e=>{let n=e.target;this._scrollTop=n.scrollTop,this.requestUpdate()},this._onKeyDown=e=>{if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key)){e.preventDefault(),e.stopPropagation(),this._editState&&=null;let n=e.key.replace(`Arrow`,``).toLowerCase(),r=bx(this._store),i=jx(this.columns);if(e.metaKey||e.ctrlKey){if(!this._selection||this._selection.kind!==`rectangular`){let e=0;this._selection?.kind===`single`?e=this._selection.pos:this._selection?.kind===`contiguous`&&(e=Math.min(this._selection.start,this._selection.end)),this._rectAnchorXFromKeyboard=e%i,this._rectAnchorYFromKeyboard=Math.floor(e/i),this._selection={kind:`rectangular`,x:this._rectAnchorXFromKeyboard,y:this._rectAnchorYFromKeyboard,width:1,height:1}}this._selection=zx(this._selection,n,this.columns,r,this._rectAnchorXFromKeyboard,this._rectAnchorYFromKeyboard)}else if(e.shiftKey){if(!this._selection)this._initialSelectionPoint=0,this._currentCursorPoint=0;else if(this._selection.kind===`single`)this._initialSelectionPoint=this._selection.pos,this._currentCursorPoint=this._selection.pos;else if(this._selection.kind===`rectangular`){let e=this._selection.y*i+this._selection.x;this._initialSelectionPoint=e,this._currentCursorPoint=e}let e=Lx(this._selection,n,this.columns,r),a=Math.min(this._initialSelectionPoint,e),o=Math.max(this._initialSelectionPoint,e);this._currentCursorPoint=e,this._selection={kind:`contiguous`,start:a,end:o}}else{this._selection=Rx(this._selection,n,this.columns,r);let e=Lx(this._selection,n,this.columns,r);this._initialSelectionPoint=e,this._currentCursorPoint=e}this._dispatchSelectEvent(),this.requestUpdate();return}if(e.key===`Tab`){if(e.preventDefault(),e.stopPropagation(),this._editState)this._advanceCursor();else{let e=bx(this._store);this._selection=Rx(this._selection,`right`,this.columns,e),this._dispatchSelectEvent()}this.requestUpdate();return}if(e.key===`Escape`){if(e.preventDefault(),e.stopPropagation(),this._editState)this._editState=null;else if(this._selection&&this._selection.kind!==`single`){let e=this._selection,n=0;if(e.kind===`contiguous`){let r=e;n=Math.min(r.start,r.end)}if(e.kind===`rectangular`){let r=e;n=r.y*jx(this.columns)+r.x}this._selection={kind:`single`,pos:n},this._dispatchSelectEvent()}this.requestUpdate();return}if(this._editState){if(e.stopPropagation(),e.key===`Backspace`){this._handleBackspace();return}if(e.key===`Enter`){this._editState.side===`hex`&&this._editState.partial.startsWith(`.`)&&this._commitDecimalValue();return}e.key.length===1&&this._handleValueEntry(e.key);return}if(this._selection&&this._selection.kind===`single`&&e.key.length===1){e.preventDefault(),e.stopPropagation();let n=this._selection.pos,r=this._focusSide??`hex`;this._editState={pos:n,side:r,partial:``},this._handleValueEntry(e.key)}}}static{this.styles=r`
|
|
8558
|
+
`]}};E([d({attribute:!1})],hx.prototype,`checkboxRenderer`,void 0),E([d({type:Boolean,reflect:!0,attribute:`align-checkboxes`})],hx.prototype,`alignCheckboxes`,void 0),hx=E([T(`ixfx-tree-list`)],hx);function gx(e,n){let r=document.createElement(`div`);r.style.cssText=`display:contents;`;let i;function a(r){let i={...e(r),data:r},o=n?.getChildren?.(r);return{item:i,children:o?o.map(a):i.isLeaf?[]:void 0}}function o(){return i||(i=document.createElement(`ixfx-tree-list`),i.interactionMode=n?.interactionMode??`standard`,i.selectionFilter=n?.selectionFilter??`all`,i.exclusivity=n?.exclusivity??`none`,i.style.cssText=`display:block;width:100%;`,r.appendChild(i),c(),i)}function s(e){let n=new Set;for(let r of e)r.item.data!==void 0&&n.add(r.item.data);return n}function c(){i.addEventListener(`select`,e=>{e.stopPropagation();let n={selected:s(e.detail.selected),previous:s(e.detail.previous)};r.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}),i.addEventListener(`activate`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`activate`,{detail:i,bubbles:!0,composed:!0}))}),i.addEventListener(`item-click`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`item-click`,{detail:i,bubbles:!0,composed:!0}))}),i.addEventListener(`tickle`,e=>{e.stopPropagation();let n=e.detail.node.item.data;if(n===void 0)return;let i={item:n};r.dispatchEvent(new CustomEvent(`tickle`,{detail:i,bubbles:!0,composed:!0}))})}let l=`single`,u=Object.assign(r,{setItems(e){let n=o();n.root={item:{key:`__adapter_root__`,label:``,isLeaf:!1},children:e.map(a)}},clearSelection(){i?.clearSelection()},dispatch(e,r){n?.onDispatch?.(e,r,i)}});return Object.defineProperties(u,{selectedItems:{get(){return i?s(i.selectedNodes):new Set},enumerable:!0,configurable:!0},selectionMode:{get(){return l},set(e){l=e,i&&(e===`none`?i.selectionFilter=`none`:e===`single`?(i.selectionFilter=n?.selectionFilter??`all`,i.interactionMode=`implicit`):(i.selectionFilter=n?.selectionFilter??`all`,i.interactionMode=n?.interactionMode??`standard`))},enumerable:!0,configurable:!0}}),u}function _x(e,n){let r=document.createElement(`div`);r.style.cssText=`display:contents;`;let i,a=n?.selectionMode??`single`,o=new WeakMap;function s(){return i||(i=document.createElement(`ixfx-vertical-list`),i.style.cssText=`height:auto;width:100%;`,i.selectionMode=a,n?.interactionMode&&(i.interactionMode=n.interactionMode),r.appendChild(i),c(),i)}function c(){i.addEventListener(`list-select`,e=>{let n={selected:u(e.detail.selected),previous:u(e.detail.previous)};r.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}),i.addEventListener(`list-activate`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`activate`,{detail:{item:n},bubbles:!0,composed:!0}))}),i.addEventListener(`list-item-click`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`item-click`,{detail:{item:n},bubbles:!0,composed:!0}))}),i.addEventListener(`list-tickle`,e=>{let n=o.get(e.detail.item);n!==void 0&&r.dispatchEvent(new CustomEvent(`tickle`,{detail:{item:n},bubbles:!0,composed:!0}))})}function l(n){let r=s();r.clearItems(),o=new WeakMap;for(let i of n){let n=e(i);o.set(n,i),r.addItem(n)}}function u(e){let n=new Set;for(let r of e){let e=o.get(r);e!==void 0&&n.add(e)}return n}let d=Object.assign(r,{setItems(e){l(e)},clearSelection(){i?.clearSelection()},dispatch(e,r){n?.onDispatch?.(e,r,i)}});return Object.defineProperties(d,{selectedItems:{get(){return i?u(i.selectedItems):new Set},enumerable:!0,configurable:!0},selectionMode:{get(){return i?.selectionMode??a},set(e){a=e,i&&(i.selectionMode=e)},enumerable:!0,configurable:!0}}),d}const vx=new Set([9,10,11,12,13,32]);function yx(e){return e<32&&e!==9&&e!==10&&e!==11&&e!==12&&e!==13}function bx(e){return e>=32&&e<=126}function xx(e){return e===0?`byte-null`:vx.has(e)?`byte-whitespace`:yx(e)?`byte-control`:bx(e)?`byte-printable`:`byte-other`}function Sx(e,n,r,i){let a=ag.createSteps(r,i,{steps:16}).map(ag.toCssColour);return{forByte:r=>r===0?e:r===255?n:a[r>>4]}}function Cx(e){return{data:new Uint8Array(e),changeset:new Set}}function wx(e,n){return e.data[n]??0}function Tx(e){return e.data.length}function Ex(e){return Math.max(0,Math.min(255,e))}function Dx(e,n,r){let i=Ex(r),a=e.data[n],o=new Map([[n,{before:a,after:i}]]);return e.data[n]=i,e.changeset.add(n),o}function Ox(e,n){let r=new Map;return n.forEach((n,i)=>{let a=Ex(n),o=e.data[i];r.set(i,{before:o,after:a}),e.data[i]=a,e.changeset.add(i)}),r}function kx(e,n){let r=new Map;return n.forEach((n,i)=>{let a=e.data[i];r.set(i,{before:n.after,after:a}),e.data[i]=n.after,e.changeset.add(i)}),r}function Ax(e){let n=new Map;return e.forEach((e,r)=>{n.set(r,{before:e.after,after:e.before})}),n}function jx(e){return e.changeset}function Mx(){return{undos:[],redos:[]}}function Nx(e,n){e.undos.push(n),e.redos=[]}function Px(e){let n=e.undos.pop();return n&&e.redos.push(n),n}function Fx(e){let n=e.redos.pop();return n&&e.undos.push(n),n}const Ix=e=>e*4,Lx=(e,n)=>e<n?e:n,Rx=(e,n)=>e>n?e:n;function zx(e,n){return Math.max(0,Math.min(e,n-1))}function Bx(e,n){if(!e)return[];let r=Ix(n);if(e.kind===`single`)return[e.pos];if(e.kind===`contiguous`){let n=Lx(e.start,e.end),r=Rx(e.start,e.end),i=[];for(let e=n;e<=r;e++)i.push(e);return i}if(e.kind===`rectangular`){let n=[];for(let i=0;i<e.height;i++)for(let a=0;a<e.width;a++){let o=e.y+i,s=e.x+a,c=o*r+s;n.push(c)}return n}return[]}function Vx(e,n,r){if(!e)return!1;let i=Ix(r);if(e.kind===`single`)return n===e.pos;if(e.kind===`contiguous`){let r=Lx(e.start,e.end),i=Rx(e.start,e.end);return n>=r&&n<=i}if(e.kind===`rectangular`){let r=Math.floor(n/i),a=n%i,o=e.x,s=e.y,c=e.width,l=e.height;return r>=s&&r<s+l&&a>=o&&a<o+c}return!1}function Hx(e,n,r,i){let a;a=e?e.kind===`single`?e.pos:e.kind===`contiguous`?Rx(e.start,e.end):e.kind===`rectangular`?e.y*Ix(r)+e.x+e.width-1:0:0;let o=Ix(r),s;switch(n){case`left`:s=a-1;break;case`right`:s=a+1;break;case`up`:s=a-o;break;case`down`:s=a+o;break;default:s=a}return zx(s,i)}function Ux(e,n,r,i){return{kind:`single`,pos:Hx(e,n,r,i)}}function Wx(e,n,r,i,a=0,o=0){let s=Ix(r),c,l,u,d;if(!e||e.kind===`single`){let n=e?.kind===`single`?e.pos:0;c=n%s,l=Math.floor(n/s),u=1,d=1}else if(e.kind===`contiguous`){let n=Lx(e.start,e.end),r=Rx(e.start,e.end);c=n%s,l=Math.floor(n/s),u=r-n+1,d=1}else e.kind===`rectangular`?(c=e.x,l=e.y,u=e.width,d=e.height):(c=0,l=0,u=1,d=1);let f=a>0||e?.kind===`rectangular`?a:c,p=o>0||e?.kind===`rectangular`?o:l;switch(n){case`left`:c>f?--u:(c===f&&u>1||c>0)&&(--c,u+=1);break;case`right`:c+u<s&&(u+=1);break;case`up`:l>p?--d:(l===p&&d>1||l>0)&&(--l,d+=1);break;case`down`:d+=1}return{kind:`rectangular`,x:c,y:l,width:u,height:d}}function Gx(e,n,r,i){let a=Ix(i);if(r===`contiguous`)return{kind:`contiguous`,start:Lx(e,n),end:Rx(e,n)};let o=e%a,s=Math.floor(e/a),c=n%a,l=Math.floor(n/a);return{kind:`rectangular`,x:Lx(o,c),y:Lx(s,l),width:Math.abs(c-o)+1,height:Math.abs(l-s)+1}}let Kx=class extends n{constructor(...e){super(...e),this.columns=4,this.colourScheme=`ascii`,this.showChangeset=!0,this.hideOffsetCol=!1,this.hideHexCol=!1,this.hideTextCol=!1,this._selection=null,this._scrollTop=0,this._editState=null,this._containerH=0,this._shadeMap=null,this._focusSide=null,this._store=Cx(new Uint8Array),this._undoStack=Mx(),this._copyBuffer=null,this._rowHeight=24,this._dragStart=null,this._dragAnchor=null,this._rectAnchorX=0,this._rectAnchorY=0,this._rectAnchorXFromKeyboard=0,this._rectAnchorYFromKeyboard=0,this._initialSelectionPoint=0,this._currentCursorPoint=0,this._pointerMode=null,this._currentDragDiff=null,this._shiftClickTarget=null,this._onScroll=e=>{let n=e.target;this._scrollTop=n.scrollTop,this.requestUpdate()},this._onKeyDown=e=>{if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key)){e.preventDefault(),e.stopPropagation(),this._editState&&=null;let n=e.key.replace(`Arrow`,``).toLowerCase(),r=Tx(this._store),i=Ix(this.columns);if(e.metaKey||e.ctrlKey){if(!this._selection||this._selection.kind!==`rectangular`){let e=0;this._selection?.kind===`single`?e=this._selection.pos:this._selection?.kind===`contiguous`&&(e=Math.min(this._selection.start,this._selection.end)),this._rectAnchorXFromKeyboard=e%i,this._rectAnchorYFromKeyboard=Math.floor(e/i),this._selection={kind:`rectangular`,x:this._rectAnchorXFromKeyboard,y:this._rectAnchorYFromKeyboard,width:1,height:1}}this._selection=Wx(this._selection,n,this.columns,r,this._rectAnchorXFromKeyboard,this._rectAnchorYFromKeyboard)}else if(e.shiftKey){if(!this._selection)this._initialSelectionPoint=0,this._currentCursorPoint=0;else if(this._selection.kind===`single`)this._initialSelectionPoint=this._selection.pos,this._currentCursorPoint=this._selection.pos;else if(this._selection.kind===`rectangular`){let e=this._selection.y*i+this._selection.x;this._initialSelectionPoint=e,this._currentCursorPoint=e}let e=Hx(this._selection,n,this.columns,r),a=Math.min(this._initialSelectionPoint,e),o=Math.max(this._initialSelectionPoint,e);this._currentCursorPoint=e,this._selection={kind:`contiguous`,start:a,end:o}}else{this._selection=Ux(this._selection,n,this.columns,r);let e=Hx(this._selection,n,this.columns,r);this._initialSelectionPoint=e,this._currentCursorPoint=e}this._dispatchSelectEvent(),this.requestUpdate();return}if(e.key===`Tab`){if(e.preventDefault(),e.stopPropagation(),this._editState)this._advanceCursor();else{let e=Tx(this._store);this._selection=Ux(this._selection,`right`,this.columns,e),this._dispatchSelectEvent()}this.requestUpdate();return}if(e.key===`Escape`){if(e.preventDefault(),e.stopPropagation(),this._editState)this._editState=null;else if(this._selection&&this._selection.kind!==`single`){let e=this._selection,n=0;if(e.kind===`contiguous`){let r=e;n=Math.min(r.start,r.end)}if(e.kind===`rectangular`){let r=e;n=r.y*Ix(this.columns)+r.x}this._selection={kind:`single`,pos:n},this._dispatchSelectEvent()}this.requestUpdate();return}if(this._editState){if(e.stopPropagation(),e.key===`Backspace`){this._handleBackspace();return}if(e.key===`Enter`){this._editState.side===`hex`&&this._editState.partial.startsWith(`.`)&&this._commitDecimalValue();return}e.key.length===1&&this._handleValueEntry(e.key);return}if(this._selection&&this._selection.kind===`single`&&e.key.length===1){e.preventDefault(),e.stopPropagation();let n=this._selection.pos,r=this._focusSide??`hex`;this._editState={pos:n,side:r,partial:``},this._handleValueEntry(e.key)}}}static{this.styles=r`
|
|
8521
8559
|
:host {
|
|
8522
8560
|
--hex-row-height: 24px;
|
|
8523
8561
|
--hex-offset-width: 8ch;
|
|
@@ -8655,7 +8693,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8655
8693
|
.byte-whitespace { color: var(--ascii-whitespace); }
|
|
8656
8694
|
.byte-control { color: var(--ascii-control); }
|
|
8657
8695
|
.byte-other { color: var(--ascii-other); }
|
|
8658
|
-
`}setData(e){this._store=
|
|
8696
|
+
`}setData(e){this._store=Cx(e),this._undoStack=Mx(),this._selection=null,this._editState=null,this._scrollTop=0,this.requestUpdate()}undo(){let e=Px(this._undoStack);if(!e)return;let n=Ax(e);kx(this._store,n),this.requestUpdate()}redo(){let e=Fx(this._undoStack);e&&(kx(this._store,e),this.requestUpdate())}recomputeColours(){let e=getComputedStyle(this),n=e.getPropertyValue(`--shade-null`).trim()||`#808080`,r=e.getPropertyValue(`--shade-max`).trim()||`#ffffff`,i=e.getPropertyValue(`--shade-step-start`).trim()||`#ff0000`,a=e.getPropertyValue(`--shade-step-end`).trim()||`#0000ff`;this._shadeMap=Sx(n,r,i,a),this.requestUpdate()}*selectedBytes(){let e=Bx(this._selection,this.columns);for(let n=0;n<e.length;n++){let r=e[n];yield{selection_index:n,array_index:r,value:wx(this._store,r)}}}containsPosition(e){return Vx(this._selection,e,this.columns)}selectSingle(e){this._selection={kind:`single`,pos:e},this._dispatchSelectEvent(),this.requestUpdate()}selectContiguous(e,n){this._selection={kind:`contiguous`,start:e,end:n},this._dispatchSelectEvent(),this.requestUpdate()}selectRectangular(e,n,r,i){this._selection={kind:`rectangular`,x:e,y:n,width:r,height:i},this._dispatchSelectEvent(),this.requestUpdate()}clearSelection(){this._selection=null,this._dispatchSelectEvent(),this.requestUpdate()}getSelection(){return this._selection}firstUpdated(){let e=this.shadowRoot?.querySelector(`.scroll-container`);e&&(new ResizeObserver(e=>{this._containerH=e[0].contentRect.height,this.requestUpdate()}).observe(e),this._containerH=e.clientHeight),this.recomputeColours()}_onPointerDown(e,n,r){if(r.preventDefault(),r.button!==0)return;(this.shadowRoot?.querySelector(`.hex-editor`))?.focus(),this._focusSide=n,r.target.setPointerCapture(r.pointerId);let i=Ix(this.columns),a=e%i,o=Math.floor(e/i);r.metaKey||r.ctrlKey?(this._pointerMode=`select-rect`,this._dragAnchor=e,this._rectAnchorX=a,this._rectAnchorY=o):r.shiftKey?(this._pointerMode=`select-cont`,!this._selection||this._selection.kind!==`single`?this._dragAnchor=e:(this._dragAnchor=this._selection.pos,this._shiftClickTarget=e)):(this._pointerMode=`pending`,this._dragStart={pos:e,startValue:wx(this._store,e),startY:r.clientY,startX:r.clientX},this._dragAnchor=e,this._currentDragDiff=null)}_onPointerMove(e,n,r){if(!this._dragStart)return;let i=Math.abs(r.clientY-this._dragStart.startY),a=Math.abs(r.clientX-this._dragStart.startX);if(this._pointerMode===`pending`&&i>4&&i>a&&(this._pointerMode=`drag-value`,this._editState=null),this._pointerMode===`drag-value`){let n=Math.round((r.clientY-this._dragStart.startY)/4),i=Math.max(0,Math.min(255,this._dragStart.startValue-n));this._currentDragDiff=Dx(this._store,e,i),this.requestUpdate()}if(this._pointerMode===`select-cont`&&this._dragAnchor!==null&&(this._selection=Gx(this._dragAnchor,e,`contiguous`,this.columns),this._dispatchSelectEvent()),this._pointerMode===`select-rect`){let n=Ix(this.columns),r=e%n,i=Math.floor(e/n),a=Math.min(this._rectAnchorX,r),o=Math.min(this._rectAnchorY,i),s=Math.abs(r-this._rectAnchorX)+1,c=Math.abs(i-this._rectAnchorY)+1;this._selection={kind:`rectangular`,x:a,y:o,width:s,height:c},this._dispatchSelectEvent()}}_onPointerUp(e,n,r){if(r.target.releasePointerCapture(r.pointerId),this._pointerMode===`pending`&&(this._selection={kind:`single`,pos:e},this._initialSelectionPoint=e,this._currentCursorPoint=e,this._editState={pos:e,side:n,partial:``},this._dispatchSelectEvent()),this._pointerMode===`select-cont`&&(this._dragAnchor!==null&&this._shiftClickTarget!==null?(this._selection={kind:`contiguous`,start:this._dragAnchor,end:this._shiftClickTarget},this._initialSelectionPoint=Math.min(this._dragAnchor,this._shiftClickTarget),this._currentCursorPoint=Math.max(this._dragAnchor,this._shiftClickTarget),this._dispatchSelectEvent()):this._dragAnchor!==null&&(this._selection=Gx(this._dragAnchor,e,`contiguous`,this.columns),this._initialSelectionPoint=this._dragAnchor,this._currentCursorPoint=e,this._dispatchSelectEvent())),this._pointerMode===`select-rect`){let n=Ix(this.columns),r=e%n,i=Math.floor(e/n),a=Math.min(this._rectAnchorX,r),o=Math.min(this._rectAnchorY,i),s=Math.abs(r-this._rectAnchorX)+1,c=Math.abs(i-this._rectAnchorY)+1;this._selection={kind:`rectangular`,x:a,y:o,width:s,height:c},this._dispatchSelectEvent()}this._pointerMode===`drag-value`&&this._currentDragDiff&&(Nx(this._undoStack,this._currentDragDiff),this._dispatchChangeEvent(this._currentDragDiff)),this._pointerMode=null,this._dragStart=null,this._dragAnchor=null,this._currentDragDiff=null,this._shiftClickTarget=null}_handleBackspace(){this._editState&&(this._editState={...this._editState,partial:``},this.requestUpdate())}_handleValueEntry(e){if(!this._editState)return;let{pos:n,side:r,partial:i}=this._editState;if(r===`text`){if(e.length===1&&e.charCodeAt(0)>=32&&e.charCodeAt(0)<=126){let r=e.charCodeAt(0),i=Dx(this._store,n,r);Nx(this._undoStack,i),this._dispatchChangeEvent(i),this._advanceCursor()}return}if(i===``&&e===`.`){this._editState={...this._editState,partial:`.`},this.requestUpdate();return}if(i.startsWith(`.`)){if(/\d/.test(e)){let n=i+e;Number(n.slice(1))>255&&(n=`.255`),this._editState={...this._editState,partial:n},this.requestUpdate()}return}if(`0123456789ABCDEFabcdef`.includes(e)){let r=(i+e.toUpperCase()).slice(-2);if(this._editState={...this._editState,partial:r},this.requestUpdate(),r.length===2){let e=Number.parseInt(r,16),i=Dx(this._store,n,e);Nx(this._undoStack,i),this._dispatchChangeEvent(i),this._advanceCursor()}}else i!==``&&(this._editState={...this._editState,partial:``},this.requestUpdate())}_commitDecimalValue(){if(!this._editState)return;let e=Number.parseInt(this._editState.partial.slice(1),10);if(!Number.isNaN(e)){let n=Dx(this._store,this._editState.pos,e);Nx(this._undoStack,n),this._dispatchChangeEvent(n),this._advanceCursor()}}_advanceCursor(){if(!this._editState)return;let e=Tx(this._store),n=zx(this._editState.pos+1,e);this._editState={pos:n,side:this._editState.side,partial:``},this._selection={kind:`single`,pos:n},this.requestUpdate()}_dispatchChangeEvent(e){this.dispatchEvent(new CustomEvent(`hex-change`,{detail:{diff:e},bubbles:!0,composed:!0}))}_dispatchSelectEvent(){let e=this._selection,n;n=e?e.kind===`single`?{type:`single`,position:e.pos}:e.kind===`contiguous`?{type:`contiguous`,start:e.start,end:e.end}:e.kind===`rectangular`?{type:`rectangular`,x:e.x,y:e.y,width:e.width,height:e.height}:{type:`none`}:{type:`none`},this.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}_copy(){let e=Bx(this._selection,this.columns);if(e.length===0)return;let n=e.map(e=>wx(this._store,e));this._copyBuffer=new Uint8Array(n);let r=n.map(e=>e.toString(16).padStart(2,`0`)).join(` `);navigator.clipboard?.writeText(r).catch(()=>{})}async _paste(){let e=null;try{let n=await navigator.clipboard?.readText();n&&(e=this._parseHexString(n))}catch{}if(!e&&this._copyBuffer&&(e=Array.from(this._copyBuffer)),!e||e.length===0||!this._selection)return;let n=new Map;if(this._selection.kind===`single`){let r=this._selection.pos,i=Tx(this._store);for(let a=0;a<e.length&&r+a<i;a++)n.set(r+a,e[a])}else if(this._selection.kind===`contiguous`){let r=Math.min(this._selection.start,this._selection.end),i=Math.max(this._selection.start,this._selection.end)-r+1;for(let a=0;a<Math.min(e.length,i);a++)n.set(r+a,e[a])}else if(this._selection.kind===`rectangular`){let{x:r,y:i,width:a,height:o}=this._selection,s=Ix(this.columns),c=0;for(let l=0;l<o&&c<e.length;l++)for(let o=0;o<a&&c<e.length;o++){let a=(i+l)*s+r+o;n.set(a,e[c++])}}if(n.size>0){let e=Ox(this._store,n);Nx(this._undoStack,e),this._dispatchChangeEvent(e),this.requestUpdate()}}_parseHexString(e){let n=[],r=e.replace(/[^0-9A-F]/gi,` `).trim();if(!r)return n;let i=r.split(/\s+/);for(let e of i)e.length===1?n.push(Number.parseInt(e+e,16)):e.length===2&&n.push(Number.parseInt(e,16));return n}_getColHeaders(){let e=[];for(let n=0;n<this.columns;n++){let r=n*4;e.push(`+${r.toString(16).toUpperCase()}`)}return e}_isRowShaded(e){let n=this._selection;if(!n||n.kind!==`single`)return!0;let r=Ix(this.columns);return Math.floor(e/r)===Math.floor(n.pos/r)}_isHexShaded(e){return this._isRowShaded(e)}_isTextShaded(e){return this._isRowShaded(e)}render(){let e=Tx(this._store),n=Ix(this.columns),r=Math.ceil(e/n),a=this._containerH>0?this._containerH:280,o=Math.floor(this._scrollTop/this._rowHeight),s=Math.min(o+Math.ceil(a/this._rowHeight)+2,r),c=o*this._rowHeight,l=(r-s)*this._rowHeight,u=jx(this._store),d=this._getColHeaders(),f=this._focusSide===`hex`||this._focusSide===null,p=this._focusSide===`text`;return i`
|
|
8659
8697
|
<div class="hex-editor" tabindex="0" @keydown=${this._onKeyDown} @pointerleave=${()=>{}}>
|
|
8660
8698
|
<div class="header">
|
|
8661
8699
|
${this.hideOffsetCol?null:i`<span class="offset-cell">Offset</span>`}
|
|
@@ -8668,7 +8706,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8668
8706
|
<div style="height: ${l}px"></div>
|
|
8669
8707
|
</div>
|
|
8670
8708
|
</div>
|
|
8671
|
-
`}_renderRow(e,n){let r=
|
|
8709
|
+
`}_renderRow(e,n){let r=Ix(this.columns),a=e*r;return i`
|
|
8672
8710
|
<div class="row" data-row=${e}>
|
|
8673
8711
|
${this.hideOffsetCol?null:i`<span class="offset-cell">${a.toString(16).toUpperCase().padStart(6,`0`)}</span>`}
|
|
8674
8712
|
${this.hideHexCol?null:_(Array.from({length:this.columns},(e,n)=>n),e=>e,r=>this._renderColumn(e,r,n))}
|
|
@@ -8678,11 +8716,11 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8678
8716
|
</span>
|
|
8679
8717
|
`}
|
|
8680
8718
|
</div>
|
|
8681
|
-
`}_renderColumn(e,n,r){let a=e*
|
|
8719
|
+
`}_renderColumn(e,n,r){let a=e*Ix(this.columns)+n*4;return i`
|
|
8682
8720
|
<span class="col-group">
|
|
8683
8721
|
${[0,1,2,3].map(e=>this._renderHexCell(a+e,r))}
|
|
8684
8722
|
</span>
|
|
8685
|
-
`}_renderHexCell(e,n){if(e>=
|
|
8723
|
+
`}_renderHexCell(e,n){if(e>=Tx(this._store))return i`<span class="hex-cell"></span>`;let r=wx(this._store,e),a=r.toString(16).toUpperCase().padStart(2,`0`),o=Vx(this._selection,e,this.columns),s=this.showChangeset&&n.has(e),c=this._editState?.pos===e,l=[`hex-cell`];o&&l.push(`selected`),s&&l.push(`changed`),c&&l.push(`editing`),this._isHexShaded(e)&&l.push(`shaded`);let u=a,d;return c&&this._editState&&(u=this._editState.partial===``?a:`${this._editState.partial}_`),this.colourScheme===`shade`&&this._shadeMap?d={color:this._shadeMap.forByte(r)}:this.colourScheme===`ascii`&&l.push(xx(r)),i`
|
|
8686
8724
|
<span
|
|
8687
8725
|
class=${l.join(` `)}
|
|
8688
8726
|
style=${h(d||{})}
|
|
@@ -8690,7 +8728,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8690
8728
|
@pointerup=${n=>this._onPointerUp(e,`hex`,n)}
|
|
8691
8729
|
@pointermove=${n=>this._onPointerMove(e,`hex`,n)}
|
|
8692
8730
|
>${u}</span>
|
|
8693
|
-
`}_renderTextChar(e,n){if(e>=
|
|
8731
|
+
`}_renderTextChar(e,n){if(e>=Tx(this._store))return i`<span class="text-char"></span>`;let r=wx(this._store,e),a=r>=32&&r<=126?String.fromCharCode(r):`.`,o=Vx(this._selection,e,this.columns),s=this.showChangeset&&n.has(e),c=[`text-char`];o&&c.push(`selected`),s&&c.push(`changed`),this._isTextShaded(e)&&c.push(`shaded`);let l;return this.colourScheme===`shade`&&this._shadeMap?l={color:this._shadeMap.forByte(r)}:this.colourScheme===`ascii`&&c.push(xx(r)),i`
|
|
8694
8732
|
<span
|
|
8695
8733
|
class=${c.join(` `)}
|
|
8696
8734
|
style=${h(l||{})}
|
|
@@ -8698,7 +8736,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8698
8736
|
@pointerup=${n=>this._onPointerUp(e,`text`,n)}
|
|
8699
8737
|
@pointermove=${n=>this._onPointerMove(e,`text`,n)}
|
|
8700
8738
|
>${a}</span>
|
|
8701
|
-
`}};E([d({type:Number})],
|
|
8739
|
+
`}};E([d({type:Number})],Kx.prototype,`columns`,void 0),E([d({type:String})],Kx.prototype,`colourScheme`,void 0),E([d({type:Boolean})],Kx.prototype,`showChangeset`,void 0),E([d({type:Boolean,attribute:`hide-offset-col`})],Kx.prototype,`hideOffsetCol`,void 0),E([d({type:Boolean,attribute:`hide-hex-col`})],Kx.prototype,`hideHexCol`,void 0),E([d({type:Boolean,attribute:`hide-text-col`})],Kx.prototype,`hideTextCol`,void 0),E([m()],Kx.prototype,`_selection`,void 0),E([m()],Kx.prototype,`_scrollTop`,void 0),E([m()],Kx.prototype,`_editState`,void 0),E([m()],Kx.prototype,`_containerH`,void 0),E([m()],Kx.prototype,`_shadeMap`,void 0),E([m()],Kx.prototype,`_focusSide`,void 0),Kx=E([T(`ixfx-hex-editor`)],Kx);const qx=s`<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m5 12 7-7 7 7"/><path d="M12 19V5"/></svg>`;function Jx(e,n,r){return e.y<r*.25?`below`:e.y>r*.75?`above`:e.x>n/2?`left`:`right`}function Yx(e,n,r){let i=e.node.children??[];if(i.length===0)return!1;let a=n.filter(n=>n.parentId===e.id);return a.length<i.length||a.some(e=>!r.has(e.id))}function Xx(e,n,r,i){let a=Math.min(r,i)/2.1;return{x:r/2+(n.offset.x+n.zoom*e.x)*a,y:i/2+(n.offset.y+n.zoom*e.y)*a}}function Zx(e,n){if(!e)return a;let r=e.node.children??[],o=r.slice(0,12),s=r.length-o.length;return i`
|
|
8702
8740
|
<div
|
|
8703
8741
|
class="child-preview ${e.side}"
|
|
8704
8742
|
part="child-preview"
|
|
@@ -8717,7 +8755,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8717
8755
|
title=${`Up to ${e.parent.item.label}`}
|
|
8718
8756
|
aria-label=${`Up to ${e.parent.item.label}`}
|
|
8719
8757
|
@click=${()=>n.onPick(e.parent)}
|
|
8720
|
-
>${
|
|
8758
|
+
>${qx}</button>`:a}
|
|
8721
8759
|
<span>${e.node.item.label}</span>
|
|
8722
8760
|
</div>
|
|
8723
8761
|
<ul>
|
|
@@ -8727,7 +8765,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8727
8765
|
</ul>
|
|
8728
8766
|
${s>0?i`<div class="child-preview-more">+${s} more</div>`:a}
|
|
8729
8767
|
</div>
|
|
8730
|
-
`}function
|
|
8768
|
+
`}function Qx(e){let n=!1,r,i=i=>{clearTimeout(r);let a=e.candidate(i);if(a!==void 0){if(a===e.currentId())return;r=setTimeout(()=>{let n=e.candidate(i);n!==void 0&&e.setPreviewId(n)},600);return}r=setTimeout(()=>{n||e.setPreviewId(void 0)},250)};return{update:i,pointerEnter(){n=!0,clearTimeout(r)},pointerLeave(e){n=!1,i(e)},hide(){n=!1,clearTimeout(r),e.setPreviewId(void 0)},dispose(){clearTimeout(r)}}}const $x=1e-9;function eS(e,n){return{x:e.x*n.x-e.y*n.y,y:e.x*n.y+e.y*n.x}}function tS(e){return{x:e.x,y:-e.y}}function nS(e,n){return{x:e.x+n.x,y:e.y+n.y}}function rS(e,n){return{x:e.x-n.x,y:e.y-n.y}}function iS(e,n){return{x:e.x*n,y:e.y*n}}function aS(e,n){let r=n.x*n.x+n.y*n.y;return r<$x?{x:0,y:0}:iS(eS(e,tS(n)),1/r)}function oS(e){return Math.hypot(e.x,e.y)}function sS(e,n=.999999){let r=oS(e);return r<=n?e:iS(e,n/r)}function cS(e,n){return sS(aS(rS(e,n),rS({x:1,y:0},eS(tS(n),e))))}function lS(e,n){return sS(aS(nS(e,n),nS({x:1,y:0},eS(tS(n),e))))}function uS(e,n){return lS(n,e)}function dS(e){return Math.tanh(e/2)}function fS(e){return 2*Math.atanh(Math.min(Math.max(e,0),.999999))}function pS(e,n){return fS(oS(cS(n,e)))}function mS(e,n,r){if(r<=0)return e;if(r>=1)return n;let i=cS(n,e),a=oS(i);return a<$x?e:lS(iS(iS(i,1/a),dS(fS(a)*r)),e)}const hS={a:{x:1,y:0},b:{x:0,y:0}};function gS(e,n){return sS(aS(nS(eS(e.a,n),e.b),nS(eS(tS(e.b),n),tS(e.a))))}function _S(e,n){let r=nS(eS(e.a,n.a),eS(e.b,tS(n.b))),i=nS(eS(e.a,n.b),eS(e.b,tS(n.a))),a=Math.sqrt(Math.max($x,r.x*r.x+r.y*r.y-i.x*i.x-i.y*i.y));return{a:iS(r,1/a),b:iS(i,1/a)}}function vS(e){return{a:tS(e.a),b:iS(e.b,-1)}}function yS(e){let n=1/Math.sqrt(Math.max($x,1-e.x*e.x-e.y*e.y));return{a:{x:n,y:0},b:iS(e,n)}}function bS(e){return{a:{x:Math.cos(e/2),y:Math.sin(e/2)},b:{x:0,y:0}}}function xS(e,n=0){return _S(bS(n),vS(yS(e)))}function SS(e){return{center:gS(vS(e),{x:0,y:0}),rotation:2*Math.atan2(e.a.y,e.a.x)}}function CS(e,n){let r=e.x*n.y-e.y*n.x,i=Math.hypot(n.x-e.x,n.y-e.y);if(Math.abs(r)<1e-6*Math.max(i,$x))return{kind:`line`};let a=(e.x*e.x+e.y*e.y+1)/2,o=(n.x*n.x+n.y*n.y+1)/2,s={x:(a*n.y-o*e.y)/r,y:(e.x*o-n.x*a)/r};return{kind:`arc`,center:s,radius:Math.sqrt(Math.max(0,s.x*s.x+s.y*s.y-1)),sweep:+((e.x-s.x)*(n.y-s.y)-(e.y-s.y)*(n.x-s.x)>0)}}function wS(e,n,r=1){let i=e=>(e*r).toFixed(2),a=CS(e,n),o=`M${i(e.x)},${i(e.y)}`;return a.kind===`line`||a.radius*r>1e6?`${o} L${i(n.x)},${i(n.y)}`:`${o} A${i(a.radius)},${i(a.radius)} 0 0 ${a.sweep} ${i(n.x)},${i(n.y)}`}function TS(e){return Math.atan2(Math.sin(e),Math.cos(e))}function ES(e){return e<.5?4*e*e*e:1-(-2*e+2)**3/2}function DS(){return typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches}function OS(e,n,r){let i=yS(n);return _S(_S(i,_S(yS(cS(r,n)),vS(i))),e)}function kS(e){let{center:n,rotation:r}=SS(e),i=TS(r),a={x:0,y:0};return{settledRotation:i,viewAt:e=>{let r=ES(Math.min(1,Math.max(0,e)));return xS(mS(n,a,r),i)}}}const AS=.5;function jS(e){let n=Math.min(8,Math.max(AS,e.zoom));if(n<=1)return{zoom:n,offset:{x:0,y:0}};let r=n-1,i=Math.hypot(e.offset.x,e.offset.y);return{zoom:n,offset:i>r?{x:e.offset.x*r/i,y:e.offset.y*r/i}:e.offset}}function MS(e,n,r){let i=Math.min(8,Math.max(AS,e.zoom*r)),a=PS(n,e);return jS({zoom:i,offset:{x:n.x-i*a.x,y:n.y-i*a.y}})}function NS(e,n,r){let i=2.1/(Math.min(e.width,e.height)||1);return{x:(n-(e.left+e.width/2))*i,y:(r-(e.top+e.height/2))*i}}function PS(e,n){let r=n.zoom||1;return{x:(e.x-n.offset.x)/r,y:(e.y-n.offset.y)/r}}function FS(e){let n=e.target;return n===e.currentTarget||n?.classList.contains(`disk-boundary`)===!0}function IS(e){let n=new Map,r,i=!1,a,o=n=>{let r=e.svgRect();return r?NS(r,n.clientX,n.clientY):void 0},s=n=>sS(PS(n,e.zoomState()),.98),c=(e,n)=>({x:(e.x+n.x)/2,y:(e.y+n.y)/2}),l=(n,i,a,o)=>{r={pointerId:n,start:s(i),baseView:e.takeView(),downClient:a,armed:o}},u=()=>{let[[i,o],[s,l]]=[...n.entries()];r=void 0;let{zoom:u}=e.zoomState();a={ids:[i,s],startDistance:Math.max(1e-6,Math.hypot(o.x-l.x,o.y-l.y)),startZoom:u,anchor:PS(c(o,l),e.zoomState())}};return{onPointerDown(r){i=!1;let a=FS(r);e.focusTree();let s=o(r);s&&(a&&(r.currentTarget.setPointerCapture?.(r.pointerId),e.onDragStart?.()),n.set(r.pointerId,s),n.size===2&&e.zoomGesturesEnabled()?u():n.size===1&&l(r.pointerId,s,{x:r.clientX,y:r.clientY},a))},onPointerMove(l){if(!n.has(l.pointerId))return;let u=o(l);if(u){if(n.set(l.pointerId,u),a){let r=n.get(a.ids[0]),i=n.get(a.ids[1]);if(!r||!i)return;let o=a.startZoom*Math.hypot(r.x-i.x,r.y-i.y)/a.startDistance,s=c(r,i),l=Math.min(8,Math.max(AS,o));e.setZoomState(jS({zoom:l,offset:{x:s.x-l*a.anchor.x,y:s.y-l*a.anchor.y}}))}else if(r&&r.pointerId===l.pointerId){if(!r.armed){if(Math.hypot(l.clientX-r.downClient.x,l.clientY-r.downClient.y)<4)return;r.armed=!0,i=!0,l.currentTarget.setPointerCapture?.(l.pointerId),e.onDragStart?.()}e.setView(OS(r.baseView,r.start,s(u)))}}},onPointerUp(e){if(n.delete(e.pointerId)){if(a){a=void 0;let[e]=[...n.entries()];e&&l(e[0],e[1],{x:0,y:0},!0)}else r?.pointerId===e.pointerId&&(r=void 0)}},onWheel(n){let r=n.ctrlKey||n.metaKey;if(!e.zoomGesturesEnabled()||!r&&!e.hasFocus())return;let i=o(n);if(!i)return;n.preventDefault();let a=n.deltaMode===1?n.deltaY*16:n.deltaY,s=Math.exp(-a*(r?.01:.002));e.setZoomState(MS(e.zoomState(),i,s))},isDragging(){return r?.armed===!0},wasDragged(){return i},cancel(){r=void 0,a=void 0,n.clear()}}}const LS=r`
|
|
8731
8769
|
:host {
|
|
8732
8770
|
--hyperbolictree-node-color: var(--surface-4);
|
|
8733
8771
|
--hyperbolictree-node-text: var(--surface-3-text);
|
|
@@ -8986,7 +9024,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8986
9024
|
padding: 2px 6px;
|
|
8987
9025
|
color: var(--surface-muted-text);
|
|
8988
9026
|
}
|
|
8989
|
-
`;function NS(e,n){let r=new Map;return n.map(n=>{let i=n.item.key,a=r.get(i)??0;return r.set(i,a+1),`${e}${a===0?i:`${i}#${a}`}`})}function PS(e){return e.split(``).length-1}function FS(e){let n=e.split(``);return n.length<2?void 0:`${n[0]}${n[1]}`}function IS(e,n){return e.startsWith(`${n}`)}function LS(e,n){if(!e)return;let r=(e,i)=>{if(i===n)return[e];if(!IS(n,i))return;let a=e.children??[],o=NS(i,a);for(let n=0;n<a.length;n++){let i=r(a[n],o[n]);if(i)return[e,...i]}};return r(e,e.item.key)}function RS(e,n){if(!e)return;let r=(e,i)=>{if(e===n)return i;let a=e.children??[],o=NS(i,a);for(let e=0;e<a.length;e++){let n=r(a[e],o[e]);if(n!==void 0)return n}};return r(e,e.item.key)}function zS(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;let a=i.children?.length?zS(i.children,n,e):void 0;if(a)return a}}function BS(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=BS(r,n);if(e)return e}}}function VS(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=VS(r,n);if(i)return[e,...i]}}}function HS(e,n){if(n<=0)return 1;let r=e.children??[];if(r.length===0)return 1;let i=1;for(let e of r)i+=HS(e,n-1);return i}function US(e,n){let r=rS({x:Math.cos(e),y:Math.sin(e)},n);return Math.atan2(r.y,r.x)}function WS(e){let n=0;for(let r=0;r<e.length;r++)n=Math.imul(n,31)+e.charCodeAt(r)|0;return(n>>>0)%1e3/1e3*2-1}const GS=.5;function KS(e,n,r){if(n<=0)return r;let i=Math.min(e,Math.PI)/2,a=Math.asinh(Math.sinh(n/2)/Math.max(Math.sin(i),1e-6));return Math.min(Math.max(r,a),r+6)}function qS(e,n=24,r=1,i=GS){let a=new Map;if(!e)return a;let o={x:0,y:0};a.set(e.item.key,{node:e,id:e.item.key,depth:0,parentKey:void 0,parentId:void 0,position:o,toParent:uS,angularShare:2*Math.PI});let s=(e,c,l,u,d,f)=>{if(f>=n)return;let p=e.children??[],m=p.length;if(m===0)return;let h=d-u,g=p.map(e=>Math.sqrt(HS(e,n-f-1))),_=g.reduce((e,n)=>e+n,0),v=NS(c,p),y=u;p.forEach((n,u)=>{let d=m===1?h:h*g[u]/_,p=y+d/2;y+=d;let b=p+(m===1?WS(n.item.key)*Math.min(.22,d*.4):0),x=oS(m===1?r:KS(d,i,r)),S={x:x*Math.cos(b),y:x*Math.sin(b)},ee=mS(S),te=fS(l,ee);a.set(v[u],{node:n,id:v[u],depth:f+1,parentKey:e.item.key,parentId:c,position:dS(te,o),toParent:ee,angularShare:d});let ne=Math.min(d,Math.PI)/2,re=US(p-ne,S),ie=US(p+ne,S)-re;ie<=0&&(ie+=2*Math.PI),s(n,v[u],te,re,re+ie,f+1)})};return s(e,e.item.key,uS,-Math.PI,Math.PI,0),a}function JS(e,n,r){let i=new Map;if(!e.has(n))return i;i.set(n,{ring:0,frame:uS});let a=[n];for(let n=1;n<=r&&a.length>0;n++){let r=[];for(let o of a){let a=e.get(o),{frame:s}=i.get(o),c=(a,o)=>{i.has(a)||!e.has(a)||(i.set(a,{ring:n,frame:o()}),r.push(a))};for(let n of NS(o,a.node.children??[]))c(n,()=>fS(s,e.get(n).toParent));a.parentId!==void 0&&c(a.parentId,()=>fS(s,pS(a.toParent)))}a=r}return i}function YS(e,n,r){let i=uS;for(let a=n;a!==void 0&&a!==r;a=e.get(a)?.parentId)i=fS(e.get(a).toParent,i);return i}function XS(e,n,r){if(!e.has(n)||!e.has(r))return;let i=new Set;for(let r=n;r!==void 0;r=e.get(r)?.parentId)i.add(r);let a=r;for(;a!==void 0&&!i.has(a);)a=e.get(a)?.parentId;if(a!==void 0)return fS(pS(YS(e,n,a)),YS(e,r,a))}function ZS(e,n){if(n!==void 0){if(e.has(n))return n;for(let r of e.values())if(r.node.item.key===n)return r.id}}function QS(e,n={}){if(!e)return{nodes:[],edges:[]};let{maxRadius:r=1/0,maxDepth:i=24,curvature:a=1,siblingSpacing:o=GS}=n,s=qS(e,i,a,o),c=ZS(s,n.focusedKey)??e.item.key;if(!s.has(c))return{nodes:[],edges:[]};let l=n.view??gS(n.centerOverride??{x:0,y:0}),u=JS(s,c,r),d=[...u.keys()].map(e=>s.get(e).node.item.weight).filter(e=>typeof e==`number`),f=d.length>0?Math.min(...d):void 0,p=d.length>0?Math.max(...d):void 0,m=e=>e===void 0||f===void 0||p===void 0||p===f?.5:(e-f)/(p-f),h=[...u.entries()].map(([e,{ring:n,frame:r}])=>{let i=s.get(e),a=i.node.item.weight;return{node:i.node,key:i.node.item.key,id:e,depth:i.depth,ring:n,parentKey:i.parentKey,parentId:i.parentId,position:dS(fS(l,r),{x:0,y:0}),angularShare:i.angularShare,weight:a,weightNormalized:m(a)}}).sort((e,n)=>e.ring-n.ring),g=new Map(h.map(e=>[e.id,e])),_=[];for(let e of h){if(e.parentId===void 0)continue;let n=g.get(e.parentId);n&&_.push({fromKey:n.key,toKey:e.key,fromId:n.id,toId:e.id,from:n.position,to:e.position,weightNormalized:(n.weightNormalized+e.weightNormalized)/2})}return{nodes:h,edges:_}}const $S={action:{kind:`none`},handled:!1};function eC(e){let n=Math.atan2(e.position.y,e.position.x),r=Math.abs(n- -Math.PI/2);return r>Math.PI&&(r=2*Math.PI-r),r}function tC(e,n,r,i){let a=LS(n,r),o=a?.at(-1);if(!a||!o)return $S;let s=a.length>=2?a[a.length-2]:void 0,c={action:{kind:`none`},handled:!0},l=e=>e?{action:{kind:`focus`,node:e},handled:!0}:c;switch(e){case`ArrowUp`:{let e=i.filter(e=>e.parentId===r);return e.length===0?c:l(e.reduce((e,n)=>eC(e)<eC(n)?e:n).node)}case`ArrowDown`:return l(s);case`ArrowLeft`:case`ArrowRight`:{let n=s?.children??[],r=n.indexOf(o);return r===-1||n.length<=1?c:l(n[(r+(e===`ArrowRight`?1:-1)+n.length)%n.length])}case`Enter`:return{action:{kind:`activate`,node:o,depth:a.length-1},handled:!0};case`Escape`:return o===n?$S:l(n);default:return $S}}function nC(e,n){let r=new Set,i=new Map,a=async(n,r,i)=>{let{model:a,loadChildren:o}=e();return a?a.getChildren(n,r,i):[...await gg(o({node:n,depth:r},i),i)]},o=async(e,o)=>{r.add(e);let s=new AbortController;i.set(e,s),n();try{let n=await a(e,o,s.signal);s.signal.aborted||(e.children=n)}catch{s.signal.aborted||(e.children=[])}finally{r.delete(e),i.delete(e),s.signal.aborted||n()}};return{ensure(n){let{model:i,loadChildren:a}=e();if(!(!i&&!a))for(let{node:e,depth:i}of n)e.children===void 0&&!r.has(e)&&o(e,i)},isPending:e=>r.has(e),abortAll(){for(let e of i.values())e.abort();i.clear(),r.clear()}}}function rC(e){return Math.max(0,1-(e.x*e.x+e.y*e.y))}function iC(e){let n=new Map;for(let r of e)n.set(r.id,1/0);for(let r=0;r<e.length;r++){let i=e[r].position;for(let a=r+1;a<e.length;a++){let o=e[a].position,s=Math.hypot(i.x-o.x,i.y-o.y);s<n.get(e[r].id)&&n.set(e[r].id,s),s<n.get(e[a].id)&&n.set(e[a].id,s)}}return n}function aC(e,n){return n.minWeightScale+(n.maxWeightScale-n.minWeightScale)*e.weightNormalized}function oC(e,n,r){let i=r.nodeRadius*rC(e.position)*aC(e,r);return Math.max(Math.min(i,n*.45),.003)}function sC(e,n,r,i,a=0){let o=Math.cos(a),s=Math.sin(a),c=(e,r)=>({x:n.x+e*o-r*s,y:n.y+e*s+r*o});return{id:e,corners:[c(-r,-i),c(r,-i),c(r,i),c(-r,i)]}}function cC(e){let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[(r+1)%e.length];n+=i.x*a.y-a.x*i.y}return Math.abs(n)/2}function lC(e,n){let r=Math.sign((n[1].x-n[0].x)*(n[2].y-n[0].y)-(n[1].y-n[0].y)*(n[2].x-n[0].x))||1,i=[...e];for(let e=0;e<n.length&&i.length>0;e++){let a=n[e],o=n[(e+1)%n.length],s=e=>r*((o.x-a.x)*(e.y-a.y)-(o.y-a.y)*(e.x-a.x)),c=i;i=[];for(let e=0;e<c.length;e++){let n=c[e],r=c[(e+c.length-1)%c.length],a=s(n),o=s(r);if(a>=0!=o>=0){let e=o/(o-a);i.push({x:r.x+(n.x-r.x)*e,y:r.y+(n.y-r.y)*e})}a>=0&&i.push(n)}}return i}function uC(e){let n=e.map(e=>e.x),r=e.map(e=>e.y);return{x0:Math.min(...n),y0:Math.min(...r),x1:Math.max(...n),y1:Math.max(...r)}}function dC(e,n){let r=uC(e.corners),i=uC(n.corners);if(r.x1<=i.x0||i.x1<=r.x0||r.y1<=i.y0||i.y1<=r.y0)return 0;let a=cC(e.corners);return a<=0?1:cC(lC(e.corners,n.corners))/a}function fC(e,n=.03){let r=[];for(let i of e)r.every(e=>dC(i,e)<=n)&&r.push(i);return new Set(r.map(e=>e.id))}function pC(e,n){return n<=0||e.length<=n?e:`${e.slice(0,Math.max(1,n-1)).trimEnd()}…`}let mC;const hC=new Map;function gC(e,n,r){let i=`${r}\u0000${e}`,a=hC.get(i);if(a===void 0){if(mC===void 0)try{mC=typeof document>`u`?null:document.createElement(`canvas`).getContext(`2d`)}catch{mC=null}let n;if(mC){mC.font=`100px ${r||`sans-serif`}`;let i=mC.measureText(e).width;Number.isFinite(i)&&i>0&&(n=i/100)}a=n??e.length*.6,hC.set(i,a)}return a*n}function _C(e,n){let r=.45+.55*rC(e.position),i=Math.min(1,r*(n.zoom??1))*Math.sqrt(aC(e,n)),a=pC(e.node.item.label,n.maxChars),o=n.fontSize*.5,s=n.fontSize*1.55;return{scale:i,width:gC(a,n.fontSize,n.fontFamily)+o*2,height:s,markerSize:n.fontSize*.55,text:a}}function vC(e,n,r,i=0){return sC(e,n,r.width*r.scale/2,r.height*r.scale/2,i)}const yC={direction:0,textAngle:0,flipped:!1};function bC(e,n,r){let i=typeof getComputedStyle==`function`?getComputedStyle(e):void 0,a=Number.parseFloat(i?.getPropertyValue(`--hyperbolictree-font-size`)??``),o=Number.isFinite(a)&&a>0?a:13;return{px:o,units:o*(1050/(n>0?n:420)/(r||1)),family:i?.fontFamily??``}}function xC(e){return e?new Map(NS(e.item.key,e.children??[]).map((e,n)=>[e,n])):new Map}function SC(e,n){let r=FS(e),i=r===void 0?void 0:n.get(r);return i===void 0?``:` --branch-index: ${i}; --branch-count: ${n.size};`}function CC(e){let n=new Map;for(let r of e){let e=n.get(r.parentId)??[];e.push(r),n.set(r.parentId,e)}return n}function wC(e,n,r){let i=e=>e.ring===0?0:r(e.node)?1:2;return[...e].sort((e,r)=>i(e)-i(r)||n(r)-n(e)||e.ring-r.ring)}function TC(e,n){let r=new Map;if(!n){for(let n of e)r.set(n.id,yC);return r}let i=new Map(e.map(e=>[e.id,e])),a=new Map;for(let n of e){let e=n.parentId===void 0?void 0:i.get(n.parentId);e&&(e.ring<n.ring?a.set(n.id,e):n.ring<e.ring&&a.set(e.id,n))}for(let n of e){let e=a.get(n.id);if(!e||n.ring===0){r.set(n.id,yC);continue}let i=Math.atan2(n.position.y-e.position.y,n.position.x-e.position.x),o=Math.cos(i)<0;r.set(n.id,{direction:i,textAngle:o?i+Math.PI:i,flipped:o})}return r}const EC=e=>({x:e.position.x*500,y:e.position.y*500});function DC(e,n,r){let{font:i}=n,a=new Map(e.map(e=>[e.id,_C(e,{fontSize:i.units,fontFamily:i.family,maxChars:n.boxMaxChars,minWeightScale:n.minWeightScale,maxWeightScale:n.maxWeightScale,zoom:n.zoom})]));return{boxes:a,labelIds:fC(wC(e.filter(e=>!n.isTickled(e.id)&&i.px*a.get(e.id).scale>=n.minLabelSize),e=>a.get(e.id).scale,n.isSelected).map(e=>vC(e.id,EC(e),a.get(e.id),r.get(e.id).textAngle)))}}function OC(e,n,r){let{font:i}=n,a=iC(e),o=new Map(e.map(e=>[e.id,oC(e,a.get(e.id),n)]));return{radii:o,labelIds:fC(wC(e.filter(e=>!n.isTickled(e.id)&&o.get(e.id)*n.zoom>=n.minNodeRadius),e=>o.get(e.id),n.isSelected).map(e=>{let{direction:n}=r.get(e.id),a=gC(e.node.item.label,i.units,i.family)/2,s=(o.get(e.id)+.01)*500+a,c=EC(e),l={x:c.x+Math.cos(n)*s,y:c.y+Math.sin(n)*s};return sC(e.id,l,a+i.units*.6,i.units*.6,n)}))}}function kC(e,n){let r=TC(e,n.radialLabels),i=n.nodeShape===`box`?{...DC(e,n,r),radii:new Map}:{...OC(e,n,r),boxes:new Map},a=new Set(i.labelIds);for(let r of e)n.isTickled(r.id)&&a.add(r.id);return{siblingGroups:CC(e),font:n.font,branches:n.branches,boxes:i.boxes,radii:i.radii,labelIds:a,orientations:r}}function AC(e,n,r){let i=e=>r(e.id)?2:+!!n.labelIds.has(e.id),a=e=>e.position.x**2+e.position.y**2;return[...e].sort((e,n)=>i(e)-i(n)||a(n)-a(e))}function jC(e){return e.replace(/[^\w-]/g,`-`)}const MC=e=>e.preventDefault();function NC(e,n,r,i){let{node:o,key:c,id:l}=e,{ctx:u,state:d,handlers:f}=n,p=d.isSelected(o),m=[`node`,p?`selected`:``,d.isTickled(l)?`tickled`:``,d.isFiltered(e)?`filtered`:``,d.isPending(o)?`loading`:``,e.ring===0?`focused`:``].filter(Boolean).join(` `),h=u.siblingGroups.get(e.parentId)??[e],g=`--node-weight: ${e.weightNormalized};${e.weight===void 0?``:` --node-weight-raw: ${e.weight};`}`;return s`
|
|
9027
|
+
`;function RS(e,n){let r=new Map;return n.map(n=>{let i=n.item.key,a=r.get(i)??0;return r.set(i,a+1),`${e}${a===0?i:`${i}#${a}`}`})}function zS(e){return e.split(``).length-1}function BS(e){let n=e.split(``);return n.length<2?void 0:`${n[0]}${n[1]}`}function VS(e,n){return e.startsWith(`${n}`)}function HS(e,n){if(!e)return;let r=(e,i)=>{if(i===n)return[e];if(!VS(n,i))return;let a=e.children??[],o=RS(i,a);for(let n=0;n<a.length;n++){let i=r(a[n],o[n]);if(i)return[e,...i]}};return r(e,e.item.key)}function US(e,n){if(!e)return;let r=(e,i)=>{if(e===n)return i;let a=e.children??[],o=RS(i,a);for(let e=0;e<a.length;e++){let n=r(a[e],o[e]);if(n!==void 0)return n}};return r(e,e.item.key)}function WS(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;let a=i.children?.length?WS(i.children,n,e):void 0;if(a)return a}}function GS(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=GS(r,n);if(e)return e}}}function KS(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=KS(r,n);if(i)return[e,...i]}}}function qS(e,n){if(n<=0)return 1;let r=e.children??[];if(r.length===0)return 1;let i=1;for(let e of r)i+=qS(e,n-1);return i}function JS(e,n){let r=cS({x:Math.cos(e),y:Math.sin(e)},n);return Math.atan2(r.y,r.x)}function YS(e){let n=0;for(let r=0;r<e.length;r++)n=Math.imul(n,31)+e.charCodeAt(r)|0;return(n>>>0)%1e3/1e3*2-1}const XS=.5;function ZS(e,n,r){if(n<=0)return r;let i=Math.min(e,Math.PI)/2,a=Math.asinh(Math.sinh(n/2)/Math.max(Math.sin(i),1e-6));return Math.min(Math.max(r,a),r+6)}function QS(e,n=24,r=1,i=XS){let a=new Map;if(!e)return a;let o={x:0,y:0};a.set(e.item.key,{node:e,id:e.item.key,depth:0,parentKey:void 0,parentId:void 0,position:o,toParent:hS,angularShare:2*Math.PI});let s=(e,c,l,u,d,f)=>{if(f>=n)return;let p=e.children??[],m=p.length;if(m===0)return;let h=d-u,g=p.map(e=>Math.sqrt(qS(e,n-f-1))),_=g.reduce((e,n)=>e+n,0),v=RS(c,p),y=u;p.forEach((n,u)=>{let d=m===1?h:h*g[u]/_,p=y+d/2;y+=d;let b=p+(m===1?YS(n.item.key)*Math.min(.22,d*.4):0),x=dS(m===1?r:ZS(d,i,r)),S={x:x*Math.cos(b),y:x*Math.sin(b)},ee=yS(S),te=_S(l,ee);a.set(v[u],{node:n,id:v[u],depth:f+1,parentKey:e.item.key,parentId:c,position:gS(te,o),toParent:ee,angularShare:d});let ne=Math.min(d,Math.PI)/2,re=JS(p-ne,S),ie=JS(p+ne,S)-re;ie<=0&&(ie+=2*Math.PI),s(n,v[u],te,re,re+ie,f+1)})};return s(e,e.item.key,hS,-Math.PI,Math.PI,0),a}function $S(e,n,r){let i=new Map;if(!e.has(n))return i;i.set(n,{ring:0,frame:hS});let a=[n];for(let n=1;n<=r&&a.length>0;n++){let r=[];for(let o of a){let a=e.get(o),{frame:s}=i.get(o),c=(a,o)=>{i.has(a)||!e.has(a)||(i.set(a,{ring:n,frame:o()}),r.push(a))};for(let n of RS(o,a.node.children??[]))c(n,()=>_S(s,e.get(n).toParent));a.parentId!==void 0&&c(a.parentId,()=>_S(s,vS(a.toParent)))}a=r}return i}function eC(e,n,r){let i=hS;for(let a=n;a!==void 0&&a!==r;a=e.get(a)?.parentId)i=_S(e.get(a).toParent,i);return i}function tC(e,n,r){if(!e.has(n)||!e.has(r))return;let i=new Set;for(let r=n;r!==void 0;r=e.get(r)?.parentId)i.add(r);let a=r;for(;a!==void 0&&!i.has(a);)a=e.get(a)?.parentId;if(a!==void 0)return _S(vS(eC(e,n,a)),eC(e,r,a))}function nC(e,n){if(n!==void 0){if(e.has(n))return n;for(let r of e.values())if(r.node.item.key===n)return r.id}}function rC(e,n={}){if(!e)return{nodes:[],edges:[]};let{maxRadius:r=1/0,maxDepth:i=24,curvature:a=1,siblingSpacing:o=XS}=n,s=QS(e,i,a,o),c=nC(s,n.focusedKey)??e.item.key;if(!s.has(c))return{nodes:[],edges:[]};let l=n.view??xS(n.centerOverride??{x:0,y:0}),u=$S(s,c,r),d=[...u.keys()].map(e=>s.get(e).node.item.weight).filter(e=>typeof e==`number`),f=d.length>0?Math.min(...d):void 0,p=d.length>0?Math.max(...d):void 0,m=e=>e===void 0||f===void 0||p===void 0||p===f?.5:(e-f)/(p-f),h=[...u.entries()].map(([e,{ring:n,frame:r}])=>{let i=s.get(e),a=i.node.item.weight;return{node:i.node,key:i.node.item.key,id:e,depth:i.depth,ring:n,parentKey:i.parentKey,parentId:i.parentId,position:gS(_S(l,r),{x:0,y:0}),angularShare:i.angularShare,weight:a,weightNormalized:m(a)}}).sort((e,n)=>e.ring-n.ring),g=new Map(h.map(e=>[e.id,e])),_=[];for(let e of h){if(e.parentId===void 0)continue;let n=g.get(e.parentId);n&&_.push({fromKey:n.key,toKey:e.key,fromId:n.id,toId:e.id,from:n.position,to:e.position,weightNormalized:(n.weightNormalized+e.weightNormalized)/2})}return{nodes:h,edges:_}}const iC={action:{kind:`none`},handled:!1};function aC(e){let n=Math.atan2(e.position.y,e.position.x),r=Math.abs(n- -Math.PI/2);return r>Math.PI&&(r=2*Math.PI-r),r}function oC(e,n,r,i){let a=HS(n,r),o=a?.at(-1);if(!a||!o)return iC;let s=a.length>=2?a[a.length-2]:void 0,c={action:{kind:`none`},handled:!0},l=e=>e?{action:{kind:`focus`,node:e},handled:!0}:c;switch(e){case`ArrowUp`:{let e=i.filter(e=>e.parentId===r);return e.length===0?c:l(e.reduce((e,n)=>aC(e)<aC(n)?e:n).node)}case`ArrowDown`:return l(s);case`ArrowLeft`:case`ArrowRight`:{let n=s?.children??[],r=n.indexOf(o);return r===-1||n.length<=1?c:l(n[(r+(e===`ArrowRight`?1:-1)+n.length)%n.length])}case`Enter`:return{action:{kind:`activate`,node:o,depth:a.length-1},handled:!0};case`Escape`:return o===n?iC:l(n);default:return iC}}function sC(e,n){let r=new Set,i=new Map,a=async(n,r,i)=>{let{model:a,loadChildren:o}=e();return a?a.getChildren(n,r,i):[...await gg(o({node:n,depth:r},i),i)]},o=async(e,o)=>{r.add(e);let s=new AbortController;i.set(e,s),n();try{let n=await a(e,o,s.signal);s.signal.aborted||(e.children=n)}catch{s.signal.aborted||(e.children=[])}finally{r.delete(e),i.delete(e),s.signal.aborted||n()}};return{ensure(n){let{model:i,loadChildren:a}=e();if(!(!i&&!a))for(let{node:e,depth:i}of n)e.children===void 0&&!r.has(e)&&o(e,i)},isPending:e=>r.has(e),abortAll(){for(let e of i.values())e.abort();i.clear(),r.clear()}}}function cC(e){return Math.max(0,1-(e.x*e.x+e.y*e.y))}function lC(e){let n=new Map;for(let r of e)n.set(r.id,1/0);for(let r=0;r<e.length;r++){let i=e[r].position;for(let a=r+1;a<e.length;a++){let o=e[a].position,s=Math.hypot(i.x-o.x,i.y-o.y);s<n.get(e[r].id)&&n.set(e[r].id,s),s<n.get(e[a].id)&&n.set(e[a].id,s)}}return n}function uC(e,n){return n.minWeightScale+(n.maxWeightScale-n.minWeightScale)*e.weightNormalized}function dC(e,n,r){let i=r.nodeRadius*cC(e.position)*uC(e,r);return Math.max(Math.min(i,n*.45),.003)}function fC(e,n,r,i,a=0){let o=Math.cos(a),s=Math.sin(a),c=(e,r)=>({x:n.x+e*o-r*s,y:n.y+e*s+r*o});return{id:e,corners:[c(-r,-i),c(r,-i),c(r,i),c(-r,i)]}}function pC(e){let n=0;for(let r=0;r<e.length;r++){let i=e[r],a=e[(r+1)%e.length];n+=i.x*a.y-a.x*i.y}return Math.abs(n)/2}function mC(e,n){let r=Math.sign((n[1].x-n[0].x)*(n[2].y-n[0].y)-(n[1].y-n[0].y)*(n[2].x-n[0].x))||1,i=[...e];for(let e=0;e<n.length&&i.length>0;e++){let a=n[e],o=n[(e+1)%n.length],s=e=>r*((o.x-a.x)*(e.y-a.y)-(o.y-a.y)*(e.x-a.x)),c=i;i=[];for(let e=0;e<c.length;e++){let n=c[e],r=c[(e+c.length-1)%c.length],a=s(n),o=s(r);if(a>=0!=o>=0){let e=o/(o-a);i.push({x:r.x+(n.x-r.x)*e,y:r.y+(n.y-r.y)*e})}a>=0&&i.push(n)}}return i}function hC(e){let n=e.map(e=>e.x),r=e.map(e=>e.y);return{x0:Math.min(...n),y0:Math.min(...r),x1:Math.max(...n),y1:Math.max(...r)}}function gC(e,n){let r=hC(e.corners),i=hC(n.corners);if(r.x1<=i.x0||i.x1<=r.x0||r.y1<=i.y0||i.y1<=r.y0)return 0;let a=pC(e.corners);return a<=0?1:pC(mC(e.corners,n.corners))/a}function _C(e,n=.03){let r=[];for(let i of e)r.every(e=>gC(i,e)<=n)&&r.push(i);return new Set(r.map(e=>e.id))}function vC(e,n){return n<=0||e.length<=n?e:`${e.slice(0,Math.max(1,n-1)).trimEnd()}…`}let yC;const bC=new Map;function xC(e,n,r){let i=`${r}\u0000${e}`,a=bC.get(i);if(a===void 0){if(yC===void 0)try{yC=typeof document>`u`?null:document.createElement(`canvas`).getContext(`2d`)}catch{yC=null}let n;if(yC){yC.font=`100px ${r||`sans-serif`}`;let i=yC.measureText(e).width;Number.isFinite(i)&&i>0&&(n=i/100)}a=n??e.length*.6,bC.set(i,a)}return a*n}function SC(e,n){let r=.45+.55*cC(e.position),i=Math.min(1,r*(n.zoom??1))*Math.sqrt(uC(e,n)),a=vC(e.node.item.label,n.maxChars),o=n.fontSize*.5,s=n.fontSize*1.55;return{scale:i,width:xC(a,n.fontSize,n.fontFamily)+o*2,height:s,markerSize:n.fontSize*.55,text:a}}function CC(e,n,r,i=0){return fC(e,n,r.width*r.scale/2,r.height*r.scale/2,i)}const wC={direction:0,textAngle:0,flipped:!1};function TC(e,n,r){let i=typeof getComputedStyle==`function`?getComputedStyle(e):void 0,a=Number.parseFloat(i?.getPropertyValue(`--hyperbolictree-font-size`)??``),o=Number.isFinite(a)&&a>0?a:13;return{px:o,units:o*(1050/(n>0?n:420)/(r||1)),family:i?.fontFamily??``}}function EC(e){return e?new Map(RS(e.item.key,e.children??[]).map((e,n)=>[e,n])):new Map}function DC(e,n){let r=BS(e),i=r===void 0?void 0:n.get(r);return i===void 0?``:` --branch-index: ${i}; --branch-count: ${n.size};`}function OC(e){let n=new Map;for(let r of e){let e=n.get(r.parentId)??[];e.push(r),n.set(r.parentId,e)}return n}function kC(e,n,r){let i=e=>e.ring===0?0:r(e.node)?1:2;return[...e].sort((e,r)=>i(e)-i(r)||n(r)-n(e)||e.ring-r.ring)}function AC(e,n){let r=new Map;if(!n){for(let n of e)r.set(n.id,wC);return r}let i=new Map(e.map(e=>[e.id,e])),a=new Map;for(let n of e){let e=n.parentId===void 0?void 0:i.get(n.parentId);e&&(e.ring<n.ring?a.set(n.id,e):n.ring<e.ring&&a.set(e.id,n))}for(let n of e){let e=a.get(n.id);if(!e||n.ring===0){r.set(n.id,wC);continue}let i=Math.atan2(n.position.y-e.position.y,n.position.x-e.position.x),o=Math.cos(i)<0;r.set(n.id,{direction:i,textAngle:o?i+Math.PI:i,flipped:o})}return r}const jC=e=>({x:e.position.x*500,y:e.position.y*500});function MC(e,n,r){let{font:i}=n,a=new Map(e.map(e=>[e.id,SC(e,{fontSize:i.units,fontFamily:i.family,maxChars:n.boxMaxChars,minWeightScale:n.minWeightScale,maxWeightScale:n.maxWeightScale,zoom:n.zoom})]));return{boxes:a,labelIds:_C(kC(e.filter(e=>!n.isTickled(e.id)&&i.px*a.get(e.id).scale>=n.minLabelSize),e=>a.get(e.id).scale,n.isSelected).map(e=>CC(e.id,jC(e),a.get(e.id),r.get(e.id).textAngle)))}}function NC(e,n,r){let{font:i}=n,a=lC(e),o=new Map(e.map(e=>[e.id,dC(e,a.get(e.id),n)]));return{radii:o,labelIds:_C(kC(e.filter(e=>!n.isTickled(e.id)&&o.get(e.id)*n.zoom>=n.minNodeRadius),e=>o.get(e.id),n.isSelected).map(e=>{let{direction:n}=r.get(e.id),a=xC(e.node.item.label,i.units,i.family)/2,s=(o.get(e.id)+.01)*500+a,c=jC(e),l={x:c.x+Math.cos(n)*s,y:c.y+Math.sin(n)*s};return fC(e.id,l,a+i.units*.6,i.units*.6,n)}))}}function PC(e,n){let r=AC(e,n.radialLabels),i=n.nodeShape===`box`?{...MC(e,n,r),radii:new Map}:{...NC(e,n,r),boxes:new Map},a=new Set(i.labelIds);for(let r of e)n.isTickled(r.id)&&a.add(r.id);return{siblingGroups:OC(e),font:n.font,branches:n.branches,boxes:i.boxes,radii:i.radii,labelIds:a,orientations:r}}function FC(e,n,r){let i=e=>r(e.id)?2:+!!n.labelIds.has(e.id),a=e=>e.position.x**2+e.position.y**2;return[...e].sort((e,n)=>i(e)-i(n)||a(n)-a(e))}function IC(e){return e.replace(/[^\w-]/g,`-`)}const LC=e=>e.preventDefault();function RC(e,n,r,i){let{node:o,key:c,id:l}=e,{ctx:u,state:d,handlers:f}=n,p=d.isSelected(o),m=[`node`,p?`selected`:``,d.isTickled(l)?`tickled`:``,d.isFiltered(e)?`filtered`:``,d.isPending(o)?`loading`:``,e.ring===0?`focused`:``].filter(Boolean).join(` `),h=u.siblingGroups.get(e.parentId)??[e],g=`--node-weight: ${e.weightNormalized};${e.weight===void 0?``:` --node-weight-raw: ${e.weight};`}`;return s`
|
|
8990
9028
|
<g
|
|
8991
9029
|
class=${m}
|
|
8992
9030
|
data-key=${c}
|
|
@@ -8997,28 +9035,28 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
8997
9035
|
aria-setsize=${h.length}
|
|
8998
9036
|
aria-posinset=${h.findIndex(e=>e.id===l)+1}
|
|
8999
9037
|
aria-label=${o.item.label}
|
|
9000
|
-
part="node node-${
|
|
9001
|
-
style=${g+
|
|
9038
|
+
part="node node-${IC(c)}"
|
|
9039
|
+
style=${g+DC(l,u.branches)}
|
|
9002
9040
|
transform=${r}
|
|
9003
|
-
@mousedown=${
|
|
9041
|
+
@mousedown=${LC}
|
|
9004
9042
|
@click=${n=>f.onClick(e,n)}
|
|
9005
9043
|
@dblclick=${n=>f.onDblClick(e,n)}
|
|
9006
9044
|
@pointerenter=${()=>f.onPointerEnter(l)}
|
|
9007
9045
|
>${d.showTitle(e)?s`<title>${o.item.label}</title>`:a}${i}</g>
|
|
9008
|
-
`}const
|
|
9046
|
+
`}const zC=e=>e*180/Math.PI;function BC(e,n,r){let{textAngle:i,flipped:o}=n.orientations.get(e.id),c=r+5;return s`<text
|
|
9009
9047
|
class="hyperbolictree-label"
|
|
9010
9048
|
part="label"
|
|
9011
9049
|
x=${o?-c:c}
|
|
9012
9050
|
y="0"
|
|
9013
|
-
transform=${i===0?a:`rotate(${
|
|
9051
|
+
transform=${i===0?a:`rotate(${zC(i)})`}
|
|
9014
9052
|
text-anchor=${o?`end`:`start`}
|
|
9015
9053
|
font-size=${n.font.units}
|
|
9016
9054
|
dominant-baseline="middle"
|
|
9017
|
-
>${e.node.item.label}</text>`}function
|
|
9055
|
+
>${e.node.item.label}</text>`}function VC(e,n){let{ctx:r}=n,i=r.radii.get(e.id)*500;return RC(e,n,`translate(${e.position.x*500} ${e.position.y*500})`,s`
|
|
9018
9056
|
<circle class="node-hit" r=${Math.max(i,17.5)} part="hit" />
|
|
9019
9057
|
<circle class="node-dot" r=${i} part="dot" />
|
|
9020
|
-
${r.labelIds.has(e.id)?
|
|
9021
|
-
`)}function
|
|
9058
|
+
${r.labelIds.has(e.id)?BC(e,r,i):a}
|
|
9059
|
+
`)}function HC(e,n){let{ctx:r}=n,i=r.boxes.get(e.id),o=r.labelIds.has(e.id),c=o?i.width:i.markerSize,l=o?i.height:i.markerSize,{textAngle:u}=r.orientations.get(e.id),d=o&&u!==0?` rotate(${zC(u)})`:``;return RC(e,n,`translate(${e.position.x*500} ${e.position.y*500})${d} scale(${i.scale})`,s`
|
|
9022
9060
|
<rect
|
|
9023
9061
|
class="node-box ${o?``:`marker`}"
|
|
9024
9062
|
part="box"
|
|
@@ -9029,14 +9067,14 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9029
9067
|
rx=${r.font.units*.2}
|
|
9030
9068
|
/>
|
|
9031
9069
|
${o?s`<text class="hyperbolictree-label box-label" part="label" x="0" y="0" font-size=${r.font.units} text-anchor="middle" dominant-baseline="central">${i.text}</text>`:a}
|
|
9032
|
-
`)}function
|
|
9070
|
+
`)}function UC(e,n,r){let i=FC(e,r.ctx,r.state.isTickled),a=n===`box`?HC:VC;return _(i,e=>e.id,e=>a(e,r))}function WC(e,n){return s`<path
|
|
9033
9071
|
class="edge"
|
|
9034
|
-
d=${
|
|
9035
|
-
part="edge edge-to-${
|
|
9072
|
+
d=${wS(e.from,e.to,500)}
|
|
9073
|
+
part="edge edge-to-${IC(e.toKey)} edge-from-${IC(e.fromKey)}"
|
|
9036
9074
|
data-from=${e.fromKey}
|
|
9037
9075
|
data-to=${e.toKey}
|
|
9038
|
-
style="--edge-weight: ${e.weightNormalized};${
|
|
9039
|
-
/>`}function BC(e,n,r,i){return _(e,e=>`${e.fromId}->${e.toId}`,e=>{let a=n.get(e.fromId)?.node,o=n.get(e.toId)?.node;return i&&a&&o?s`<g transform="scale(${500})">${i({edge:e,fromNode:a,toNode:o})}</g>`:zC(e,r)})}let J=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.maxRadius=4,this.nodeShape=`dot`,this.boxMaxChars=24,this.minLabelSize=9,this.colorByBranch=!1,this.nodeRadius=.05,this.minNodeRadius=.015,this.minWeightScale=.6,this.maxWeightScale=1.6,this.zoom=1,this.disableZoomGestures=!1,this.disableRadialLabels=!1,this.disableChildPreview=!1,this.curvature=1,this.siblingSpacing=GS,this.focusAnimationDuration=400,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._focusId=void 0,this._viewOverride=void 0,this._focusRotation=0,this._zoomOffset={x:0,y:0},this._previewId=void 0,this.#e=qx({candidate:e=>{let n=this.#u().nodes,r=e===void 0||this.disableChildPreview?void 0:n.find(n=>n.id===e);return r&&!this.#c.isDragging()&&Wx(r,n,this.#n)?r.id:void 0},currentId:()=>this._previewId,setPreviewId:e=>{this._previewId=e}}),this.#t=nC(()=>({model:this.model,loadChildren:this.loadChildren}),()=>this.requestUpdate()),this.#n=new Set,this.search=new Vt(this,{adapter:Wt(this,{labelSelector:`.hyperbolictree-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#u().nodes.map(e=>({id:e.id,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{if(this.#e.update(e),e===void 0)return;let n=this.#u().nodes.find(n=>n.id===e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth},bubbles:!0,composed:!0}))}}),this._hostSize={width:0,height:0},this.#c=jS({svgRect:()=>this.renderRoot.querySelector(`svg.hyperbolictree`)?.getBoundingClientRect(),onDragStart:()=>this.#e.hide(),takeView:()=>{let e=this.#f();return this.#x(),this._viewOverride=e,e},setView:e=>{this._viewOverride=e},zoomState:()=>this.#O(),setZoomState:e=>{this.zoom=e.zoom,this._zoomOffset=e.offset},zoomGesturesEnabled:()=>!this.disableZoomGestures,hasFocus:()=>this.renderRoot.activeElement!==null,focusTree:()=>this.#k()})}static{this.shadowRootOptions={...n.shadowRootOptions,delegatesFocus:!0}}get selectedNodes(){return this._selectedNodes}get focusedNode(){return this._focusId===void 0?this.#l:LS(this.#l,this._focusId)?.at(-1)??this.#l}#e;#t;#n;#r;#i;#a;#o;#s;#c;get#l(){return this.model?.root??this.root}#u(){return QS(this.#l,{focusedKey:this._focusId,maxRadius:this.maxRadius,curvature:this.curvature,siblingSpacing:this.siblingSpacing,view:this.#f()})}get#d(){return this.#l?.item.key}#f(){return this._viewOverride??hS(this._focusRotation)}#p(e,n){let r=qS(this.#l,24,this.curvature,this.siblingSpacing),i=n===void 0?void 0:XS(r,n,e);return i?fS(this.#f(),i):hS(this._focusRotation)}#m(e){let n=this.#l,r=RS(n,e);if(r!==void 0)return r;let i=BS(n,e.item.key);return i?RS(n,i):void 0}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#i=Yt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#g(),typeof ResizeObserver==`function`&&(this.#s=new ResizeObserver(([e])=>{let{width:n,height:r}=e.contentRect;this._hostSize={width:n,height:r}}),this.#s.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#s?.disconnect(),this.#s=void 0,this.#r?.(),this.#r=void 0,this.#e.dispose(),this.#t.abortAll(),this.#o!==void 0&&(cancelAnimationFrame(this.#o),this.#o=void 0),this.#i&&(this.#i.unregister(`select-all`),this.#i.unregister(`deselect-all`),this.#i=void 0,this.registry=void 0)}#h(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#g(){this.#i&&(this.search.setModes(this.#h()),this.#a?.(),this.#a=Rt(this.#i,this.search))}updated(e){e.has(`root`)&&this.root&&this.#_(),e.has(`model`)&&(this.#r?.(),this.#r=void 0,this.model&&(this.#r=this.model._subscribe(e=>{e.type===`root`?(this.#_(),this.requestUpdate()):e.type===`invalidate`&&this.requestUpdate()}),this.#_())),e.has(`interactionMode`)&&this.clearSelection(),e.has(`searchModes`)&&this.#g(),this._focusId!==void 0&&!LS(this.#l,this._focusId)&&(this._focusId=void 0,this._viewOverride=void 0,this._focusRotation=0),this.#t.ensure(this.#u().nodes)}#_(){this.#y(),this.tickled.clearTickled(),this._focusId=void 0,this._viewOverride=void 0,this._focusRotation=0,this._zoomOffset={x:0,y:0},this._previewId=void 0,this.#c.cancel(),this.#o!==void 0&&(cancelAnimationFrame(this.#o),this.#o=void 0)}#v(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#y(){this._selectedNodes.clear(),this.selectedNode=void 0}#b(e){this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#v(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#b(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#b(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#u().nodes)this.#v(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#b(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#v(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#b(n),this.requestUpdate()}focusOn(e){let n=this.#l,r=this.#m(e),i=this._focusId??this.#d;if(r===void 0||i===r)return;let a=LS(n,r)?.at(-1)??e,o=i===void 0?void 0:LS(n,i)?.at(-1),s=this.#p(r,i);this._focusId=r,this.#c.cancel(),this._previewId=void 0,this.#S(s),this.dispatchEvent(new CustomEvent(`focus`,{detail:{node:a,previous:o},bubbles:!0,composed:!0})),o&&i!==void 0&&(IS(r,i)?this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:a,depth:PS(r)},bubbles:!0,composed:!0})):IS(i,r)&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:o,depth:PS(i)},bubbles:!0,composed:!0}))),this.requestUpdate()}#x(){this.#o!==void 0&&(cancelAnimationFrame(this.#o),this.#o=void 0)}#S(e){this.#x();let{viewAt:n,settledRotation:r}=wS(e);this._focusRotation=r;let i=this._zoomOffset;if(this.focusAnimationDuration<=0||SS()||typeof requestAnimationFrame!=`function`){this._viewOverride=void 0,this._zoomOffset={x:0,y:0};return}let a=performance.now(),o=this.focusAnimationDuration,s=e=>{let r=Math.min(1,(e-a)/o),c=1-xS(r);this._zoomOffset={x:i.x*c,y:i.y*c},this._viewOverride=r>=1?void 0:n(r),this.#o=r<1?requestAnimationFrame(s):void 0};this.#o=requestAnimationFrame(s)}#C(e){this.focusOn(e);let n=this.#m(e);n!==void 0&&this.tickled.setTickled(n),this.interactionMode===`implicit`&&this.select(e)}navigateTo(e){let n=this.#l;if(!n?.children)return!1;let r=n;for(let n of e){let e=r.children?.find(e=>e.item.key===n);if(!e)return!1;r=e}this.focusOn(r),this.select(r);let i=this.#m(r);return i!==void 0&&this.tickled.setTickled(i),this.requestUpdate(),!0}navigateToNode(e){let n=this.#l;if(!n?.children)return!1;let r=zS(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=BS(this.#l,e),r=n?this.#m(n):void 0;return!n||r===void 0?!1:(this.#u().nodes.some(e=>e.id===r)||this.focusOn(n),this.tickled.setTickled(r),this.requestUpdate(),!0)}getNodes(){return this.#u().nodes.map(e=>({node:e.node,depth:e.depth}))}#w(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#w(e,n+1))??!1}#T(e,n){if(this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.interactionMode===`standard`&&(n.ctrlKey||n.metaKey)){if(this._selectedNodes.has(e.node))this.deselect(e.node);else if(this.#v(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#b(n),this.requestUpdate()}}else this.interactionMode!==`manual`&&this.select(e.node);this.tickled.setTickled(e.id),this.focusOn(e.node)}#E(e){this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0}))}#D(e){let n=this.#l;if(this.disableKeyboardNavigation||!n)return;if(e.key===`Escape`&&this._previewId!==void 0){e.preventDefault(),this._previewId=void 0;return}let{action:r,handled:i}=tC(e.key,n,this._focusId??n.item.key,this.#u().nodes);i&&e.preventDefault(),r.kind===`focus`?this.#C(r.node):r.kind===`activate`&&(this.interactionMode!==`manual`&&this.select(r.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:r.node,depth:r.depth},bubbles:!0,composed:!0})))}#O(){return ES({zoom:this.zoom,offset:this._zoomOffset})}#k(){this.renderRoot.querySelector(`svg.hyperbolictree`)?.focus({preventScroll:!0})}#A(e){this.#e.hide(),this.interactionMode!==`manual`&&this.select(e);let n=this.#m(e);n!==void 0&&this.tickled.setTickled(n),this.focusOn(e),this.#k()}#j(e){let n=this._previewId===void 0||this.disableChildPreview?void 0:e.find(e=>e.id===this._previewId);if(!n)return;let{width:r,height:i}=this._hostSize,a=Gx(n.position,this.#O(),r||420,i||420),o=n.parentId===void 0?void 0:e.find(e=>e.id===n.parentId)?.node;return{node:n.node,anchor:a,side:Ux(a,r||420,i||420),parent:o}}#M(e,n){return kC(e,{nodeShape:this.nodeShape,radialLabels:!this.disableRadialLabels,zoom:this.#O().zoom,font:bC(this,Math.min(this._hostSize.width,this._hostSize.height),this.zoom),branches:n,boxMaxChars:this.boxMaxChars,minLabelSize:this.minLabelSize,nodeRadius:this.nodeRadius,minNodeRadius:this.minNodeRadius,minWeightScale:this.minWeightScale,maxWeightScale:this.maxWeightScale,isSelected:e=>this._selectedNodes.has(e),isTickled:e=>this.tickled.isTickled(e)})}#N(e,n){return RC(e,this.nodeShape,{ctx:n,state:{isSelected:e=>this._selectedNodes.has(e),isTickled:e=>this.tickled.isTickled(e),showTitle:e=>this.disableChildPreview||!e.node.children?.length,isFiltered:e=>!this.#w(e.node,e.depth),isPending:e=>this.#t.isPending(e)},handlers:{onClick:(e,n)=>{n.stopPropagation(),this.#c.wasDragged()||this.#T(e,n)},onDblClick:(e,n)=>{n.stopPropagation(),this.#c.wasDragged()||this.#E(e)},onPointerEnter:e=>this.tickled.handlePointerEnter(e)}})}render(){let{nodes:e,edges:n}=this.#u(),r=new Map(e.map(e=>[e.id,e])),a=xC(this.#l),o=this.#M(e,a);this.#n=o.labelIds;let{zoom:s,offset:c}=this.#O(),l=c.x===0&&c.y===0?``:`translate(${c.x*500} ${c.y*500}) `;return i`
|
|
9076
|
+
style="--edge-weight: ${e.weightNormalized};${DC(e.toId,n)}"
|
|
9077
|
+
/>`}function GC(e,n,r,i){return _(e,e=>`${e.fromId}->${e.toId}`,e=>{let a=n.get(e.fromId)?.node,o=n.get(e.toId)?.node;return i&&a&&o?s`<g transform="scale(${500})">${i({edge:e,fromNode:a,toNode:o})}</g>`:WC(e,r)})}let J=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.maxRadius=4,this.nodeShape=`dot`,this.boxMaxChars=24,this.minLabelSize=9,this.colorByBranch=!1,this.nodeRadius=.05,this.minNodeRadius=.015,this.minWeightScale=.6,this.maxWeightScale=1.6,this.zoom=1,this.disableZoomGestures=!1,this.disableRadialLabels=!1,this.disableChildPreview=!1,this.curvature=1,this.siblingSpacing=XS,this.focusAnimationDuration=400,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._focusId=void 0,this._viewOverride=void 0,this._focusRotation=0,this._zoomOffset={x:0,y:0},this._previewId=void 0,this.#e=Qx({candidate:e=>{let n=this.#u().nodes,r=e===void 0||this.disableChildPreview?void 0:n.find(n=>n.id===e);return r&&!this.#c.isDragging()&&Yx(r,n,this.#n)?r.id:void 0},currentId:()=>this._previewId,setPreviewId:e=>{this._previewId=e}}),this.#t=sC(()=>({model:this.model,loadChildren:this.loadChildren}),()=>this.requestUpdate()),this.#n=new Set,this.search=new Vt(this,{adapter:Wt(this,{labelSelector:`.hyperbolictree-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#u().nodes.map(e=>({id:e.id,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{if(this.#e.update(e),e===void 0)return;let n=this.#u().nodes.find(n=>n.id===e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth},bubbles:!0,composed:!0}))}}),this._hostSize={width:0,height:0},this.#c=IS({svgRect:()=>this.renderRoot.querySelector(`svg.hyperbolictree`)?.getBoundingClientRect(),onDragStart:()=>this.#e.hide(),takeView:()=>{let e=this.#f();return this.#x(),this._viewOverride=e,e},setView:e=>{this._viewOverride=e},zoomState:()=>this.#O(),setZoomState:e=>{this.zoom=e.zoom,this._zoomOffset=e.offset},zoomGesturesEnabled:()=>!this.disableZoomGestures,hasFocus:()=>this.renderRoot.activeElement!==null,focusTree:()=>this.#k()})}static{this.shadowRootOptions={...n.shadowRootOptions,delegatesFocus:!0}}get selectedNodes(){return this._selectedNodes}get focusedNode(){return this._focusId===void 0?this.#l:HS(this.#l,this._focusId)?.at(-1)??this.#l}#e;#t;#n;#r;#i;#a;#o;#s;#c;get#l(){return this.model?.root??this.root}#u(){return rC(this.#l,{focusedKey:this._focusId,maxRadius:this.maxRadius,curvature:this.curvature,siblingSpacing:this.siblingSpacing,view:this.#f()})}get#d(){return this.#l?.item.key}#f(){return this._viewOverride??bS(this._focusRotation)}#p(e,n){let r=QS(this.#l,24,this.curvature,this.siblingSpacing),i=n===void 0?void 0:tC(r,n,e);return i?_S(this.#f(),i):bS(this._focusRotation)}#m(e){let n=this.#l,r=US(n,e);if(r!==void 0)return r;let i=GS(n,e.item.key);return i?US(n,i):void 0}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#i=Yt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#g(),typeof ResizeObserver==`function`&&(this.#s=new ResizeObserver(([e])=>{let{width:n,height:r}=e.contentRect;this._hostSize={width:n,height:r}}),this.#s.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#s?.disconnect(),this.#s=void 0,this.#r?.(),this.#r=void 0,this.#e.dispose(),this.#t.abortAll(),this.#o!==void 0&&(cancelAnimationFrame(this.#o),this.#o=void 0),this.#i&&(this.#i.unregister(`select-all`),this.#i.unregister(`deselect-all`),this.#i=void 0,this.registry=void 0)}#h(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#g(){this.#i&&(this.search.setModes(this.#h()),this.#a?.(),this.#a=Rt(this.#i,this.search))}updated(e){e.has(`root`)&&this.root&&this.#_(),e.has(`model`)&&(this.#r?.(),this.#r=void 0,this.model&&(this.#r=this.model._subscribe(e=>{e.type===`root`?(this.#_(),this.requestUpdate()):e.type===`invalidate`&&this.requestUpdate()}),this.#_())),e.has(`interactionMode`)&&this.clearSelection(),e.has(`searchModes`)&&this.#g(),this._focusId!==void 0&&!HS(this.#l,this._focusId)&&(this._focusId=void 0,this._viewOverride=void 0,this._focusRotation=0),this.#t.ensure(this.#u().nodes)}#_(){this.#y(),this.tickled.clearTickled(),this._focusId=void 0,this._viewOverride=void 0,this._focusRotation=0,this._zoomOffset={x:0,y:0},this._previewId=void 0,this.#c.cancel(),this.#o!==void 0&&(cancelAnimationFrame(this.#o),this.#o=void 0)}#v(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#y(){this._selectedNodes.clear(),this.selectedNode=void 0}#b(e){this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#v(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#b(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#b(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#u().nodes)this.#v(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#b(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#v(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#b(n),this.requestUpdate()}focusOn(e){let n=this.#l,r=this.#m(e),i=this._focusId??this.#d;if(r===void 0||i===r)return;let a=HS(n,r)?.at(-1)??e,o=i===void 0?void 0:HS(n,i)?.at(-1),s=this.#p(r,i);this._focusId=r,this.#c.cancel(),this._previewId=void 0,this.#S(s),this.dispatchEvent(new CustomEvent(`focus`,{detail:{node:a,previous:o},bubbles:!0,composed:!0})),o&&i!==void 0&&(VS(r,i)?this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:a,depth:zS(r)},bubbles:!0,composed:!0})):VS(i,r)&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:o,depth:zS(i)},bubbles:!0,composed:!0}))),this.requestUpdate()}#x(){this.#o!==void 0&&(cancelAnimationFrame(this.#o),this.#o=void 0)}#S(e){this.#x();let{viewAt:n,settledRotation:r}=kS(e);this._focusRotation=r;let i=this._zoomOffset;if(this.focusAnimationDuration<=0||DS()||typeof requestAnimationFrame!=`function`){this._viewOverride=void 0,this._zoomOffset={x:0,y:0};return}let a=performance.now(),o=this.focusAnimationDuration,s=e=>{let r=Math.min(1,(e-a)/o),c=1-ES(r);this._zoomOffset={x:i.x*c,y:i.y*c},this._viewOverride=r>=1?void 0:n(r),this.#o=r<1?requestAnimationFrame(s):void 0};this.#o=requestAnimationFrame(s)}#C(e){this.focusOn(e);let n=this.#m(e);n!==void 0&&this.tickled.setTickled(n),this.interactionMode===`implicit`&&this.select(e)}navigateTo(e){let n=this.#l;if(!n?.children)return!1;let r=n;for(let n of e){let e=r.children?.find(e=>e.item.key===n);if(!e)return!1;r=e}this.focusOn(r),this.select(r);let i=this.#m(r);return i!==void 0&&this.tickled.setTickled(i),this.requestUpdate(),!0}navigateToNode(e){let n=this.#l;if(!n?.children)return!1;let r=WS(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=GS(this.#l,e),r=n?this.#m(n):void 0;return!n||r===void 0?!1:(this.#u().nodes.some(e=>e.id===r)||this.focusOn(n),this.tickled.setTickled(r),this.requestUpdate(),!0)}getNodes(){return this.#u().nodes.map(e=>({node:e.node,depth:e.depth}))}#w(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#w(e,n+1))??!1}#T(e,n){if(this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.interactionMode===`standard`&&(n.ctrlKey||n.metaKey)){if(this._selectedNodes.has(e.node))this.deselect(e.node);else if(this.#v(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#b(n),this.requestUpdate()}}else this.interactionMode!==`manual`&&this.select(e.node);this.tickled.setTickled(e.id),this.focusOn(e.node)}#E(e){this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0}))}#D(e){let n=this.#l;if(this.disableKeyboardNavigation||!n)return;if(e.key===`Escape`&&this._previewId!==void 0){e.preventDefault(),this._previewId=void 0;return}let{action:r,handled:i}=oC(e.key,n,this._focusId??n.item.key,this.#u().nodes);i&&e.preventDefault(),r.kind===`focus`?this.#C(r.node):r.kind===`activate`&&(this.interactionMode!==`manual`&&this.select(r.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:r.node,depth:r.depth},bubbles:!0,composed:!0})))}#O(){return jS({zoom:this.zoom,offset:this._zoomOffset})}#k(){this.renderRoot.querySelector(`svg.hyperbolictree`)?.focus({preventScroll:!0})}#A(e){this.#e.hide(),this.interactionMode!==`manual`&&this.select(e);let n=this.#m(e);n!==void 0&&this.tickled.setTickled(n),this.focusOn(e),this.#k()}#j(e){let n=this._previewId===void 0||this.disableChildPreview?void 0:e.find(e=>e.id===this._previewId);if(!n)return;let{width:r,height:i}=this._hostSize,a=Xx(n.position,this.#O(),r||420,i||420),o=n.parentId===void 0?void 0:e.find(e=>e.id===n.parentId)?.node;return{node:n.node,anchor:a,side:Jx(a,r||420,i||420),parent:o}}#M(e,n){return PC(e,{nodeShape:this.nodeShape,radialLabels:!this.disableRadialLabels,zoom:this.#O().zoom,font:TC(this,Math.min(this._hostSize.width,this._hostSize.height),this.zoom),branches:n,boxMaxChars:this.boxMaxChars,minLabelSize:this.minLabelSize,nodeRadius:this.nodeRadius,minNodeRadius:this.minNodeRadius,minWeightScale:this.minWeightScale,maxWeightScale:this.maxWeightScale,isSelected:e=>this._selectedNodes.has(e),isTickled:e=>this.tickled.isTickled(e)})}#N(e,n){return UC(e,this.nodeShape,{ctx:n,state:{isSelected:e=>this._selectedNodes.has(e),isTickled:e=>this.tickled.isTickled(e),showTitle:e=>this.disableChildPreview||!e.node.children?.length,isFiltered:e=>!this.#w(e.node,e.depth),isPending:e=>this.#t.isPending(e)},handlers:{onClick:(e,n)=>{n.stopPropagation(),this.#c.wasDragged()||this.#T(e,n)},onDblClick:(e,n)=>{n.stopPropagation(),this.#c.wasDragged()||this.#E(e)},onPointerEnter:e=>this.tickled.handlePointerEnter(e)}})}render(){let{nodes:e,edges:n}=this.#u(),r=new Map(e.map(e=>[e.id,e])),a=EC(this.#l),o=this.#M(e,a);this.#n=o.labelIds;let{zoom:s,offset:c}=this.#O(),l=c.x===0&&c.y===0?``:`translate(${c.x*500} ${c.y*500}) `;return i`
|
|
9040
9078
|
<svg
|
|
9041
9079
|
class="hyperbolictree"
|
|
9042
9080
|
viewBox="${-525} ${-525} ${1050} ${1050}"
|
|
@@ -9056,16 +9094,16 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9056
9094
|
<g class="zoom" transform="${l}scale(${s})">
|
|
9057
9095
|
<circle class="disk-boundary" part="boundary" cx="0" cy="0" r=${500} />
|
|
9058
9096
|
<g class="edges" part="edges">
|
|
9059
|
-
${
|
|
9097
|
+
${GC(n,r,a,this.edgeRenderer)}
|
|
9060
9098
|
</g>
|
|
9061
9099
|
<g class="nodes" part="nodes">
|
|
9062
9100
|
${this.#N(e,o)}
|
|
9063
9101
|
</g>
|
|
9064
9102
|
</g>
|
|
9065
9103
|
</svg>
|
|
9066
|
-
${
|
|
9104
|
+
${Zx(this.#j(e),{onPointerEnter:()=>this.#e.pointerEnter(),onPointerLeave:()=>this.#e.pointerLeave(this.tickled.tickledId),onPick:e=>this.#A(e)})}
|
|
9067
9105
|
${this.search.renderField()}
|
|
9068
|
-
`}static{this.styles=[w,Ht,MS]}};E([d({type:Object})],J.prototype,`root`,void 0),E([d({attribute:!1})],J.prototype,`model`,void 0),E([d({attribute:!1})],J.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],J.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],J.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],J.prototype,`interactionMode`,void 0),E([d({type:Number,attribute:`max-radius`})],J.prototype,`maxRadius`,void 0),E([d({type:String,attribute:`node-shape`,reflect:!0})],J.prototype,`nodeShape`,void 0),E([d({type:Number,attribute:`box-max-chars`})],J.prototype,`boxMaxChars`,void 0),E([d({type:Number,attribute:`min-label-size`})],J.prototype,`minLabelSize`,void 0),E([d({type:Boolean,attribute:`color-by-branch`,reflect:!0})],J.prototype,`colorByBranch`,void 0),E([d({type:Number,attribute:`node-radius`})],J.prototype,`nodeRadius`,void 0),E([d({type:Number,attribute:`min-node-radius`})],J.prototype,`minNodeRadius`,void 0),E([d({type:Number,attribute:`min-weight-scale`})],J.prototype,`minWeightScale`,void 0),E([d({type:Number,attribute:`max-weight-scale`})],J.prototype,`maxWeightScale`,void 0),E([d({type:Number})],J.prototype,`zoom`,void 0),E([d({type:Boolean,attribute:`disable-zoom-gestures`})],J.prototype,`disableZoomGestures`,void 0),E([d({type:Boolean,attribute:`disable-radial-labels`})],J.prototype,`disableRadialLabels`,void 0),E([d({type:Boolean,attribute:`disable-child-preview`})],J.prototype,`disableChildPreview`,void 0),E([d({type:Number})],J.prototype,`curvature`,void 0),E([d({type:Number,attribute:`sibling-spacing`})],J.prototype,`siblingSpacing`,void 0),E([d({type:Number,attribute:`focus-animation-duration`})],J.prototype,`focusAnimationDuration`,void 0),E([d({attribute:!1})],J.prototype,`edgeRenderer`,void 0),E([d({attribute:!1})],J.prototype,`selectedNode`,void 0),E([m()],J.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],J.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],J.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],J.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],J.prototype,`searchModes`,void 0),E([m()],J.prototype,`_focusId`,void 0),E([m()],J.prototype,`_viewOverride`,void 0),E([m()],J.prototype,`_focusRotation`,void 0),E([m()],J.prototype,`_zoomOffset`,void 0),E([m()],J.prototype,`_previewId`,void 0),E([m()],J.prototype,`_hostSize`,void 0),J=E([T(`ixfx-hyperbolictree-list`)],J);function VC(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function HC(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=HC(r,n);if(e)return e}}}function UC(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=UC(r,n);if(i)return[e,...i]}}}function WC(e,n={}){if(!e?.children?.length)return[];let{maxDepth:r=1/0,valueAccessor:i=()=>1,zoomKey:a,hideLeaves:o=!1}=n;if(r<=0)return[];let s=a===void 0?e:HC(e,a)??e,c=UC(e,s.item.key),l=c?c.length-2:-1,u=s.children??[];if(u.length===0)return[];let d=e=>e.item.isLeaf===!0||e.children!==void 0&&e.children.length===0,f=[],p=(e,n,a,s,c,l)=>{let u=o?e.filter(e=>!d(e)):e;if(u.length===0||a>=r)return;let m=u.map(e=>VC(i(e.item))),h=m.reduce((e,n)=>e+n,0),g=u.length,_=s;u.forEach((e,r)=>{let i=c*(h>0?m[r]/h:1/g),o=e.children??[];f.push({node:e,depth:n,relativeDepth:a,x:_,width:i,parentKey:l,index:r,setSize:g,hasChildren:o.length>0||e.children===void 0&&e.item.isLeaf!==!0}),o.length>0&&p(o,n+1,a+1,_,i,e.item.key),_+=i})};return p(u,l+1,0,0,1,s.item.key),f}let GC=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.orientation=`horizontal`,this.maxDepth=4,this.minLabelWidth=40,this.minVerticalLabelWidth=16,this.hideLeaves=!1,this.valueAccessor=()=>1,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._zoomKey=void 0,this.search=new Vt(this,{adapter:Wt(this,{labelSelector:`.icicle-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#c().map(e=>({id:e.node.item.key,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{if(e===void 0)return;let n=this.#c().find(n=>n.node.item.key===e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth},bubbles:!0,composed:!0}))}}),this.#t=new Set,this.#n=new Map}static{this.shadowRootOptions={...n.shadowRootOptions,delegatesFocus:!0}}get selectedNodes(){return this._selectedNodes}get focusedNode(){if(this._zoomKey!==void 0)return HC(this.#s,this._zoomKey)}#e;#t;#n;#r;#i;#a;#o;get#s(){return this.model?.root??this.root}#c(){return WC(this.#s,{valueAccessor:this.valueAccessor,maxDepth:this.maxDepth,zoomKey:this._zoomKey,hideLeaves:this.hideLeaves})}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#i=Yt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#u(),typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(()=>this.requestUpdate()),this.#o.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=void 0;for(let e of this.#n.values())e.abort();this.#n.clear(),this.#t.clear(),this.#o?.disconnect(),this.#o=void 0,this.#i&&(this.#i.unregister(`select-all`),this.#i.unregister(`deselect-all`),this.#i=void 0,this.registry=void 0)}#l(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#u(){this.#i&&(this.search.setModes(this.#l()),this.#a?.(),this.#a=Rt(this.#i,this.search))}updated(e){e.has(`root`)&&this.root&&this.#m(),e.has(`model`)&&(this.#e?.(),this.#e=void 0,this.model&&(this.#e=this.model._subscribe(e=>{e.type===`root`?(this.#m(),this.requestUpdate()):e.type===`invalidate`&&this.requestUpdate()}),this.#m())),e.has(`interactionMode`)&&(this.#r=void 0,this.clearSelection()),e.has(`searchModes`)&&this.#u(),this._zoomKey!==void 0&&!HC(this.#s,this._zoomKey)&&(this._zoomKey=void 0),this.#h(),this.#p()}#d(){return(this.orientation===`vertical`?this.clientHeight:this.clientWidth)||0}#f(e){let n=this.#d();if(n===0)return{hidden:!1,rotated:!1};let r=this.orientation===`vertical`,i=e.width*n;return r?{hidden:i<this.minLabelWidth,rotated:!1}:i<this.minVerticalLabelWidth?{hidden:!0,rotated:!1}:{hidden:!1,rotated:i<this.minLabelWidth}}#p(){let e=this._tooltipEl;if(!e?.popover)return;let n=this.tickled.tickledId,r=n===void 0?void 0:this.#c().find(e=>e.node.item.key===n),i=r?this.#f(r):void 0,a=e.matches(`:popover-open`);if(r&&i&&(i.hidden||i.rotated)){if(e.textContent=r.node.item.label,!a)try{e.showPopover()}catch{}}else if(a)try{e.hidePopover()}catch{}}#m(){this.#v(),this.tickled.clearTickled(),this._zoomKey=void 0,this.#r=void 0}#h(){if(!(!this.model&&!this.loadChildren))for(let e of this.#c()){let{node:n}=e;n.children!==void 0||this.#t.has(n.item.key)||this.#g(n,e.depth)}}async#g(e,n){let r=e.item.key;this.#t.add(r);let i=new AbortController;this.#n.set(r,i),this.requestUpdate();try{let r;if(r=this.model?await this.model.getChildren(e,n,i.signal):[...await gg(this.loadChildren({node:e,depth:n},i.signal),i.signal)],i.signal.aborted)return;e.children=r}catch{if(i.signal.aborted)return;e.children=[]}finally{this.#t.delete(r),this.#n.delete(r),i.signal.aborted||this.requestUpdate()}}#_(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#v(){this._selectedNodes.clear(),this.selectedNode=void 0}#y(e){this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#_(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#y(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#y(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#v(),this.#y(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#c())this.#_(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#y(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#v(),this.#y(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#_(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#y(n),this.requestUpdate()}zoomTo(e){if(this._zoomKey===e.item.key)return;this._zoomKey=e.item.key,this.tickled.clearTickled();let n=UC(this.#s,e.item.key)?.length,r=n===void 0?-1:n-2;this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}zoomOut(){if(this._zoomKey===void 0)return;let e=this.focusedNode,n=this._zoomKey===void 0?void 0:UC(this.#s,this._zoomKey),r=n===void 0?-1:n.length-2;this._zoomKey=void 0,this.tickled.clearTickled(),this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:void 0,depth:-1},bubbles:!0,composed:!0})),e&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}#b(e){return e.item.isLeaf===!0?!1:e.children===void 0?this.model!==void 0||this.loadChildren!==void 0:e.children.length>0}navigateTo(e){let n=this.#s;if(!n?.children)return!1;let r=n,i=[];for(let n of e){let e=r.children?.find(e=>e.item.key===n);if(!e)return!1;i.push(e),r=e}let a=i.at(-1);return i.length>this.maxDepth?this.zoomTo(i[i.length-this.maxDepth-1]):this._zoomKey!==void 0&&this.zoomOut(),this.select(a),this.tickled.setTickled(a.item.key),this.requestUpdate(),!0}navigateToNode(e){let n=this.#s;if(!n?.children)return!1;let r=this.#S(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=this.#s;if(!n?.children)return!1;let r=this.#S(n.children,n=>n.item.key===e);if(!r)return!1;if(r.length>this.maxDepth){let e=this.#x(r.slice(0,r.length-this.maxDepth));e&&this.zoomTo(e)}return this.tickled.setTickled(e),this.requestUpdate(),!0}#x(e){let n=this.#s;for(let r of e){let e=r===n?.item.key?n:n?.children?.find(e=>e.item.key===r);if(!e)return;n=e}return n}#S(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#S(i.children,n,e);if(r)return r}}}getNodes(){return this.#c().map(e=>({node:e.node,depth:e.depth}))}#C(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#C(e,n+1))??!1}#w(e,n,r){if(this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.interactionMode===`standard`&&(r.ctrlKey||r.metaKey)){if(this._selectedNodes.has(e.node))this.deselect(e.node);else if(this.#_(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#y(n),this.requestUpdate()}this.#r=n}else if(this.interactionMode===`standard`&&r.shiftKey&&this.#r!==void 0){let e=this.#c(),r=Math.min(this.#r,n),i=Math.max(this.#r,n),a=new Set(this._selectedNodes);this._selectedNodes=new Set(e.slice(r,i+1).map(e=>e.node).filter(e=>this.#_(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#y(a),this.requestUpdate()}else this.interactionMode!==`manual`&&(this.select(e.node),this.#r=n);this.tickled.setTickled(e.node.item.key),this.#b(e.node)&&this.zoomTo(e.node)}#T(e){this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0}))}#E(e){if(this.disableKeyboardNavigation)return;let n=this.#c();if(n.length===0)return;let r=this.tickled.tickledId,i=r===void 0?-1:n.findIndex(e=>e.node.item.key===r),a=i>=0?n[i]:void 0,o=n=>{n&&(e.preventDefault(),this.tickled.setTickled(n.node.item.key),this.interactionMode===`implicit`&&this.select(n.node))};switch(e.key){case`ArrowLeft`:case`ArrowRight`:{e.preventDefault();let r=e.key===`ArrowRight`?1:-1;if(!a){o(n[0]);return}let i=n.filter(e=>e.relativeDepth===a.relativeDepth&&e.parentKey===a.parentKey);o(i[i.findIndex(e=>e.node.item.key===a.node.item.key)+r]??(r>0?i[0]:i.at(-1)));return}case`ArrowUp`:if(!a){o(n[0]);return}o((a.parentKey===void 0?void 0:n.find(e=>e.node.item.key===a.parentKey))??n[0]);return;case`ArrowDown`:if(!a){o(n[0]);return}o(n.find(e=>e.parentKey===a.node.item.key));return;case`Home`:o(n[0]);return;case`End`:o(n.at(-1));return;case`Enter`:if(!a)return;e.preventDefault(),this.interactionMode!==`manual`&&this.select(a.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:a.node,depth:a.depth},bubbles:!0,composed:!0})),this.#b(a.node)&&this.zoomTo(a.node);return;case`Escape`:this._zoomKey!==void 0&&(e.preventDefault(),this.zoomOut())}}#D(){let e=this.focusedNode;return e===void 0?a:i`
|
|
9106
|
+
`}static{this.styles=[w,Ht,LS]}};E([d({type:Object})],J.prototype,`root`,void 0),E([d({attribute:!1})],J.prototype,`model`,void 0),E([d({attribute:!1})],J.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],J.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],J.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],J.prototype,`interactionMode`,void 0),E([d({type:Number,attribute:`max-radius`})],J.prototype,`maxRadius`,void 0),E([d({type:String,attribute:`node-shape`,reflect:!0})],J.prototype,`nodeShape`,void 0),E([d({type:Number,attribute:`box-max-chars`})],J.prototype,`boxMaxChars`,void 0),E([d({type:Number,attribute:`min-label-size`})],J.prototype,`minLabelSize`,void 0),E([d({type:Boolean,attribute:`color-by-branch`,reflect:!0})],J.prototype,`colorByBranch`,void 0),E([d({type:Number,attribute:`node-radius`})],J.prototype,`nodeRadius`,void 0),E([d({type:Number,attribute:`min-node-radius`})],J.prototype,`minNodeRadius`,void 0),E([d({type:Number,attribute:`min-weight-scale`})],J.prototype,`minWeightScale`,void 0),E([d({type:Number,attribute:`max-weight-scale`})],J.prototype,`maxWeightScale`,void 0),E([d({type:Number})],J.prototype,`zoom`,void 0),E([d({type:Boolean,attribute:`disable-zoom-gestures`})],J.prototype,`disableZoomGestures`,void 0),E([d({type:Boolean,attribute:`disable-radial-labels`})],J.prototype,`disableRadialLabels`,void 0),E([d({type:Boolean,attribute:`disable-child-preview`})],J.prototype,`disableChildPreview`,void 0),E([d({type:Number})],J.prototype,`curvature`,void 0),E([d({type:Number,attribute:`sibling-spacing`})],J.prototype,`siblingSpacing`,void 0),E([d({type:Number,attribute:`focus-animation-duration`})],J.prototype,`focusAnimationDuration`,void 0),E([d({attribute:!1})],J.prototype,`edgeRenderer`,void 0),E([d({attribute:!1})],J.prototype,`selectedNode`,void 0),E([m()],J.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],J.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],J.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],J.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],J.prototype,`searchModes`,void 0),E([m()],J.prototype,`_focusId`,void 0),E([m()],J.prototype,`_viewOverride`,void 0),E([m()],J.prototype,`_focusRotation`,void 0),E([m()],J.prototype,`_zoomOffset`,void 0),E([m()],J.prototype,`_previewId`,void 0),E([m()],J.prototype,`_hostSize`,void 0),J=E([T(`ixfx-hyperbolictree-list`)],J);function KC(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function qC(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=qC(r,n);if(e)return e}}}function JC(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=JC(r,n);if(i)return[e,...i]}}}function YC(e,n={}){if(!e?.children?.length)return[];let{maxDepth:r=1/0,valueAccessor:i=()=>1,zoomKey:a,hideLeaves:o=!1}=n;if(r<=0)return[];let s=a===void 0?e:qC(e,a)??e,c=JC(e,s.item.key),l=c?c.length-2:-1,u=s.children??[];if(u.length===0)return[];let d=e=>e.item.isLeaf===!0||e.children!==void 0&&e.children.length===0,f=[],p=(e,n,a,s,c,l)=>{let u=o?e.filter(e=>!d(e)):e;if(u.length===0||a>=r)return;let m=u.map(e=>KC(i(e.item))),h=m.reduce((e,n)=>e+n,0),g=u.length,_=s;u.forEach((e,r)=>{let i=c*(h>0?m[r]/h:1/g),o=e.children??[];f.push({node:e,depth:n,relativeDepth:a,x:_,width:i,parentKey:l,index:r,setSize:g,hasChildren:o.length>0||e.children===void 0&&e.item.isLeaf!==!0}),o.length>0&&p(o,n+1,a+1,_,i,e.item.key),_+=i})};return p(u,l+1,0,0,1,s.item.key),f}let XC=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.orientation=`horizontal`,this.maxDepth=4,this.minLabelWidth=40,this.minVerticalLabelWidth=16,this.hideLeaves=!1,this.valueAccessor=()=>1,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._zoomKey=void 0,this.search=new Vt(this,{adapter:Wt(this,{labelSelector:`.icicle-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#c().map(e=>({id:e.node.item.key,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{if(e===void 0)return;let n=this.#c().find(n=>n.node.item.key===e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth},bubbles:!0,composed:!0}))}}),this.#t=new Set,this.#n=new Map}static{this.shadowRootOptions={...n.shadowRootOptions,delegatesFocus:!0}}get selectedNodes(){return this._selectedNodes}get focusedNode(){if(this._zoomKey!==void 0)return qC(this.#s,this._zoomKey)}#e;#t;#n;#r;#i;#a;#o;get#s(){return this.model?.root??this.root}#c(){return YC(this.#s,{valueAccessor:this.valueAccessor,maxDepth:this.maxDepth,zoomKey:this._zoomKey,hideLeaves:this.hideLeaves})}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#i=Yt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#u(),typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(()=>this.requestUpdate()),this.#o.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=void 0;for(let e of this.#n.values())e.abort();this.#n.clear(),this.#t.clear(),this.#o?.disconnect(),this.#o=void 0,this.#i&&(this.#i.unregister(`select-all`),this.#i.unregister(`deselect-all`),this.#i=void 0,this.registry=void 0)}#l(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#u(){this.#i&&(this.search.setModes(this.#l()),this.#a?.(),this.#a=Rt(this.#i,this.search))}updated(e){e.has(`root`)&&this.root&&this.#m(),e.has(`model`)&&(this.#e?.(),this.#e=void 0,this.model&&(this.#e=this.model._subscribe(e=>{e.type===`root`?(this.#m(),this.requestUpdate()):e.type===`invalidate`&&this.requestUpdate()}),this.#m())),e.has(`interactionMode`)&&(this.#r=void 0,this.clearSelection()),e.has(`searchModes`)&&this.#u(),this._zoomKey!==void 0&&!qC(this.#s,this._zoomKey)&&(this._zoomKey=void 0),this.#h(),this.#p()}#d(){return(this.orientation===`vertical`?this.clientHeight:this.clientWidth)||0}#f(e){let n=this.#d();if(n===0)return{hidden:!1,rotated:!1};let r=this.orientation===`vertical`,i=e.width*n;return r?{hidden:i<this.minLabelWidth,rotated:!1}:i<this.minVerticalLabelWidth?{hidden:!0,rotated:!1}:{hidden:!1,rotated:i<this.minLabelWidth}}#p(){let e=this._tooltipEl;if(!e?.popover)return;let n=this.tickled.tickledId,r=n===void 0?void 0:this.#c().find(e=>e.node.item.key===n),i=r?this.#f(r):void 0,a=e.matches(`:popover-open`);if(r&&i&&(i.hidden||i.rotated)){if(e.textContent=r.node.item.label,!a)try{e.showPopover()}catch{}}else if(a)try{e.hidePopover()}catch{}}#m(){this.#v(),this.tickled.clearTickled(),this._zoomKey=void 0,this.#r=void 0}#h(){if(!(!this.model&&!this.loadChildren))for(let e of this.#c()){let{node:n}=e;n.children!==void 0||this.#t.has(n.item.key)||this.#g(n,e.depth)}}async#g(e,n){let r=e.item.key;this.#t.add(r);let i=new AbortController;this.#n.set(r,i),this.requestUpdate();try{let r;if(r=this.model?await this.model.getChildren(e,n,i.signal):[...await gg(this.loadChildren({node:e,depth:n},i.signal),i.signal)],i.signal.aborted)return;e.children=r}catch{if(i.signal.aborted)return;e.children=[]}finally{this.#t.delete(r),this.#n.delete(r),i.signal.aborted||this.requestUpdate()}}#_(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#v(){this._selectedNodes.clear(),this.selectedNode=void 0}#y(e){this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#_(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#y(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#y(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#v(),this.#y(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#c())this.#_(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#y(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#v(),this.#y(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#_(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#y(n),this.requestUpdate()}zoomTo(e){if(this._zoomKey===e.item.key)return;this._zoomKey=e.item.key,this.tickled.clearTickled();let n=JC(this.#s,e.item.key)?.length,r=n===void 0?-1:n-2;this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}zoomOut(){if(this._zoomKey===void 0)return;let e=this.focusedNode,n=this._zoomKey===void 0?void 0:JC(this.#s,this._zoomKey),r=n===void 0?-1:n.length-2;this._zoomKey=void 0,this.tickled.clearTickled(),this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:void 0,depth:-1},bubbles:!0,composed:!0})),e&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}#b(e){return e.item.isLeaf===!0?!1:e.children===void 0?this.model!==void 0||this.loadChildren!==void 0:e.children.length>0}navigateTo(e){let n=this.#s;if(!n?.children)return!1;let r=n,i=[];for(let n of e){let e=r.children?.find(e=>e.item.key===n);if(!e)return!1;i.push(e),r=e}let a=i.at(-1);return i.length>this.maxDepth?this.zoomTo(i[i.length-this.maxDepth-1]):this._zoomKey!==void 0&&this.zoomOut(),this.select(a),this.tickled.setTickled(a.item.key),this.requestUpdate(),!0}navigateToNode(e){let n=this.#s;if(!n?.children)return!1;let r=this.#S(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=this.#s;if(!n?.children)return!1;let r=this.#S(n.children,n=>n.item.key===e);if(!r)return!1;if(r.length>this.maxDepth){let e=this.#x(r.slice(0,r.length-this.maxDepth));e&&this.zoomTo(e)}return this.tickled.setTickled(e),this.requestUpdate(),!0}#x(e){let n=this.#s;for(let r of e){let e=r===n?.item.key?n:n?.children?.find(e=>e.item.key===r);if(!e)return;n=e}return n}#S(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#S(i.children,n,e);if(r)return r}}}getNodes(){return this.#c().map(e=>({node:e.node,depth:e.depth}))}#C(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#C(e,n+1))??!1}#w(e,n,r){if(this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.interactionMode===`standard`&&(r.ctrlKey||r.metaKey)){if(this._selectedNodes.has(e.node))this.deselect(e.node);else if(this.#_(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#y(n),this.requestUpdate()}this.#r=n}else if(this.interactionMode===`standard`&&r.shiftKey&&this.#r!==void 0){let e=this.#c(),r=Math.min(this.#r,n),i=Math.max(this.#r,n),a=new Set(this._selectedNodes);this._selectedNodes=new Set(e.slice(r,i+1).map(e=>e.node).filter(e=>this.#_(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#y(a),this.requestUpdate()}else this.interactionMode!==`manual`&&(this.select(e.node),this.#r=n);this.tickled.setTickled(e.node.item.key),this.#b(e.node)&&this.zoomTo(e.node)}#T(e){this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0}))}#E(e){if(this.disableKeyboardNavigation)return;let n=this.#c();if(n.length===0)return;let r=this.tickled.tickledId,i=r===void 0?-1:n.findIndex(e=>e.node.item.key===r),a=i>=0?n[i]:void 0,o=n=>{n&&(e.preventDefault(),this.tickled.setTickled(n.node.item.key),this.interactionMode===`implicit`&&this.select(n.node))};switch(e.key){case`ArrowLeft`:case`ArrowRight`:{e.preventDefault();let r=e.key===`ArrowRight`?1:-1;if(!a){o(n[0]);return}let i=n.filter(e=>e.relativeDepth===a.relativeDepth&&e.parentKey===a.parentKey);o(i[i.findIndex(e=>e.node.item.key===a.node.item.key)+r]??(r>0?i[0]:i.at(-1)));return}case`ArrowUp`:if(!a){o(n[0]);return}o((a.parentKey===void 0?void 0:n.find(e=>e.node.item.key===a.parentKey))??n[0]);return;case`ArrowDown`:if(!a){o(n[0]);return}o(n.find(e=>e.parentKey===a.node.item.key));return;case`Home`:o(n[0]);return;case`End`:o(n.at(-1));return;case`Enter`:if(!a)return;e.preventDefault(),this.interactionMode!==`manual`&&this.select(a.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:a.node,depth:a.depth},bubbles:!0,composed:!0})),this.#b(a.node)&&this.zoomTo(a.node);return;case`Escape`:this._zoomKey!==void 0&&(e.preventDefault(),this.zoomOut())}}#D(){let e=this.focusedNode;return e===void 0?a:i`
|
|
9069
9107
|
<nav class="breadcrumb" part="breadcrumb" aria-label="Icicle zoom path">
|
|
9070
9108
|
<ixfx-crumb-navigation
|
|
9071
9109
|
with-up
|
|
@@ -9296,7 +9334,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9296
9334
|
color: var(--surface-muted-text);
|
|
9297
9335
|
font-size: var(--text-s);
|
|
9298
9336
|
}
|
|
9299
|
-
`]}};E([d({type:Object})],
|
|
9337
|
+
`]}};E([d({type:Object})],XC.prototype,`root`,void 0),E([d({attribute:!1})],XC.prototype,`model`,void 0),E([d({attribute:!1})],XC.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],XC.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],XC.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],XC.prototype,`interactionMode`,void 0),E([d({type:String,reflect:!0})],XC.prototype,`orientation`,void 0),E([d({type:Number,attribute:`max-depth`})],XC.prototype,`maxDepth`,void 0),E([d({type:Number,attribute:`min-label-width`})],XC.prototype,`minLabelWidth`,void 0),E([d({type:Number,attribute:`min-vertical-label-width`})],XC.prototype,`minVerticalLabelWidth`,void 0),E([d({type:Boolean,attribute:`hide-leaves`,reflect:!0})],XC.prototype,`hideLeaves`,void 0),E([d({attribute:!1})],XC.prototype,`valueAccessor`,void 0),E([d({attribute:!1})],XC.prototype,`selectedNode`,void 0),E([m()],XC.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],XC.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],XC.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],XC.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],XC.prototype,`searchModes`,void 0),E([m()],XC.prototype,`_zoomKey`,void 0),E([f(`#icicle-tooltip`)],XC.prototype,`_tooltipEl`,void 0),XC=E([T(`ixfx-icicletree-list`)],XC);const ZC=Math.PI*2,QC=-Math.PI/2;function $C(e,n,r={x:50,y:50}){return{x:r.x+Math.cos(e)*n,y:r.y+Math.sin(e)*n}}function ew(e){let n=ZC*(1-e)/2,r=-Math.PI/2,i=r-n,a=r+n;return{startAngle:i,endAngle:a,totalArc:a-i}}function tw(e,n,r){let{startAngle:i,endAngle:a,totalArc:o}=ew(r);switch(n){case`range`:return i+e*o;case`bipolar`:if(e<=.5)return i+e/.5*(QC-i);{let n=(e-.5)/.5;return QC+n*(a-QC)}case`unipolar`:return QC;default:return i}}function nw(e,n,r){let{startAngle:i,endAngle:a,totalArc:o}=ew(r);switch(n){case`range`:return{startAngle:i,endAngle:i+e*o};case`bipolar`:if(e<.5)return{startAngle:i+e/.5*(QC-i),endAngle:QC};if(e>.5){let n=(e-.5)/.5,r=QC+n*(a-QC);return{startAngle:QC,endAngle:r}}return{startAngle:QC,endAngle:QC};case`unipolar`:{let n=e*o/2;return{startAngle:QC-n,endAngle:QC+n}}default:return{startAngle:i,endAngle:i}}}function rw(e,n,r,i){let{startAngle:a,endAngle:o,totalArc:s}=ew(i),c=tw(e,r,i),l=n*s/2,u=c-l,d=c+l;return u<a&&(u=a),d>o&&(d=o),u>=d?{startAngle:c,endAngle:c}:{startAngle:u,endAngle:d}}function iw(e,n,r,i={x:50,y:50}){if(e===n)return``;let a=n-e;if(a<0&&(a+=ZC),a>=ZC-.001){let n=e+ZC-.001,a=$C(e,r,i),o=$C(n,r,i);return`M ${a.x},${a.y} A ${r},${r} 0 1 1 ${o.x},${o.y}`}let o=$C(e,r,i),s=$C(n,r,i),c=+(a>Math.PI);return`M ${o.x},${o.y} A ${r},${r} 0 ${c} 1 ${s.x},${s.y}`}function aw(e,n,r={x:50,y:50}){let{startAngle:i,endAngle:a}=ew(n);return iw(i,a,e,r)}function ow(e,n,r,i={x:50,y:50},a=!0){if(e===n)return``;let o=n-e;if(o<0&&(o+=ZC),o>=ZC-.001){let n=$C(e,r,i),o=$C(e+ZC-.001,r,i),s=+!!a;return`M ${i.x},${i.y} L ${n.x},${n.y} A ${r},${r} 0 1 ${s} ${o.x},${o.y} Z`}let s=e,c=n,l=a;!a&&o>Math.PI&&(s=n,c=e,l=!0,o=ZC-o);let u=$C(s,r,i),d=$C(c,r,i),f=+(o>Math.PI),p=+!!l;return`M ${i.x},${i.y} L ${u.x},${u.y} A ${r},${r} 0 ${f} ${p} ${d.x},${d.y} Z`}function sw(e,n,r){let{startAngle:i,totalArc:a}=ew(r),o=tw(e,n,r);switch(n){case`range`:return{startAngle:i,endAngle:o,clockwise:!0};case`bipolar`:return e<.5?{startAngle:QC,endAngle:o,clockwise:!1}:{startAngle:QC,endAngle:o,clockwise:!0};case`unipolar`:{let n=e*a/2;return{startAngle:QC-n,endAngle:QC+n,clockwise:!0}}default:return{startAngle:i,endAngle:i,clockwise:!0}}}function cw(e,n,r,i,a={x:50,y:50}){let o=tw(e,n,r);return{angle:o,position:$C(o,i,a)}}function lw(e,n={x:50,y:50}){let r=$C(QC,e,n);return{angle:QC,position:r}}function uw(e,n,r){return Math.min(Math.max(e,n),r)}function dw(e,n,r,i,a){return i+(e-n)/(r-n)*(a-i)}const fw={x:50,y:50};let pw=class extends qy(n){#e;get radius(){return this.#e}set radius(e){this.#e=uw(e,10,50)}#t;#n;#r;#i;#a;#o;constructor(){super(),this.#e=45,this.value=0,this.min=0,this.max=100,this.step=void 0,this.valueMode=`range`,this.flatten=.3,this.markerStyle=`needle`,this.wedge=!1,this.disabled=!1,this.#t=new Map,this.#n=!1,this.#r=0,this.#i=0,this.#o=!1,this.#p=e=>{if(this.disabled)return;e.preventDefault();let n=this.renderRoot.querySelector(`svg`);n?.focus(),this.#n=!0,this.#r=e.clientY,this.#i=this.value,this.toggleAttribute(`dragging`,!0),n&&n.setPointerCapture(e.pointerId),window.addEventListener(`pointermove`,this.#m),window.addEventListener(`pointerup`,this.#h),window.addEventListener(`pointercancel`,this.#h)},this.#m=e=>{if(!this.#n)return;e.preventDefault();let n=this.clientHeight*2*(e.shiftKey?10:1),r=(this.#r-e.clientY)/n*(this.max-this.min),i=dw(this.#i+r,this.min,this.max,0,1);this.#u(uw(i,0,1),!0)},this.#h=()=>{this.#n=!1,this.toggleAttribute(`dragging`,!1);let e=this.renderRoot.querySelector(`svg`);e&&`hasPointerCapture`in e&&typeof e.hasPointerCapture==`function`&&e.hasPointerCapture(1)&&e.releasePointerCapture(1),window.removeEventListener(`pointermove`,this.#m),window.removeEventListener(`pointerup`,this.#h),window.removeEventListener(`pointercancel`,this.#h)},this.#g=e=>{if(this.disabled)return;let n=this.max-this.min,r=Ky(n,this.stops,this.step,e.shiftKey),i=!1;switch(e.key){case`ArrowUp`:case`ArrowRight`:this.#_(r/n,!0),i=!0;break;case`ArrowDown`:case`ArrowLeft`:this.#_(-r/n,!0),i=!0;break;case`Home`:this.#u(0,!0),i=!0;break;case`End`:this.#u(1,!0),i=!0}i&&e.preventDefault()},this.#t.set(`track`,{key:`track`,value:1,type:`fixed`,offset:0,width:.16}),this.#t.set(`value`,{key:`value`,value:0,type:`value`,offset:0,width:.24})}addLane(e,n){let r=this.#s();this.#t.set(e,{key:e,value:n?.value??r,type:n?.type??`value`,offset:n?.offset??0,width:n?.width??.1}),this.requestUpdate()}setLaneValue(e,n){let r=this.#t.get(e);r&&(r.value=uw(n,0,1),this.requestUpdate())}removeLane(e){this.#t.delete(e),this.requestUpdate()}getLanes(){return new Map(this.#t)}getLane(e){return this.#t.get(e)}#s(){return dw(this.value,this.min,this.max,0,1)}#c(){return this.valueMode===`unipolar`&&this.markerStyle===`needle`?`none`:this.markerStyle}#l(e){if(this.stops&&this.stops>1){let n=(this.max-this.min)/this.stops;return Math.round((e-this.min)/n)*n+this.min}return e}#u(e,n=!1){let r=dw(e,0,1,this.min,this.max),i=this.#l(uw(r,this.min,this.max));if(i===this.value)return;let a=this.value;this.value=i,this.#o=n;let o=this.#t.get(`value`);if(o&&o.type===`value`&&(o.value=this.#s()),this.hasAttribute(`data-tooltip-live`)){let e=Math.round(this.#s()*100);this.setAttribute(`data-tooltip`,`${e}%`)}n?(this.dispatchEvent(new CustomEvent(`input`,{detail:{value:this.value,valueRelative:this.#s()},bubbles:!0,composed:!0})),this.#d(a)):this.#f(a)}#d(e){this.#a!==void 0&&clearTimeout(this.#a),this.#a=window.setTimeout(()=>{this.#f(e),this.#a=void 0},150)}#f(e){this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value,valueRelative:this.#s(),previousValue:e},bubbles:!0,composed:!0}))}#p;#m;#h;#g;#_(e,n){this.#u(uw(this.#s()+e,0,1),n)}_applyWheelDelta(e,n){let r=this.max-this.min,i=Ky(r,this.stops,this.step,n.shiftKey);this.#_(-e*i/r,!0)}#v(){let e=aw(this.radius,this.flatten,fw),n=this.#T(`--dial-border-width`,2),r=getComputedStyle(this).getPropertyValue(`--dial-border-color`).trim()||`var(--surface-4)`;return s`<path class="dial-border" d="${e}" fill="none" stroke="${r}" stroke-width="${n}" stroke-linecap="round" vector-effect="non-scaling-stroke" />`}#y(){let e=aw(this.radius,this.flatten,fw),n=getComputedStyle(this).getPropertyValue(`--dial-fill`).trim()||`transparent`;return s`<path class="dial-fill" d="${e}" fill="${n}" />`}#b(){let{startAngle:e,endAngle:n,clockwise:r}=sw(this.#s(),this.valueMode,this.flatten),i=ow(e,n,this.radius,fw,r);return i?s`<path class="wedge" d="${i}" />`:s``}#x(e){let n=``;if(e.type===`fixed`)n=aw(this.radius-e.offset*this.radius,this.flatten,fw);else if(e.type===`anchored`){let{startAngle:r,endAngle:i}=rw(this.#s(),e.value,this.valueMode,this.flatten);n=iw(r,i,this.radius-e.offset*this.radius,fw)}else{let{startAngle:r,endAngle:i}=nw(e.value,this.valueMode,this.flatten);n=iw(r,i,this.radius-e.offset*this.radius,fw)}return n?s`
|
|
9300
9338
|
<path
|
|
9301
9339
|
class="lane"
|
|
9302
9340
|
data-lane-key="${e.key}"
|
|
@@ -9307,7 +9345,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9307
9345
|
stroke-linecap: round;
|
|
9308
9346
|
"
|
|
9309
9347
|
/>
|
|
9310
|
-
`:s``}#S(e,n,r){let i=r*this.radius,a=n*this.radius,o={x:
|
|
9348
|
+
`:s``}#S(e,n,r){let i=r*this.radius,a=n*this.radius,o={x:fw.x+Math.cos(e)*i,y:fw.y+Math.sin(e)*i},s={x:fw.x+Math.cos(e)*a,y:fw.y+Math.sin(e)*a};return`M ${o.x} ${o.y} L ${s.x} ${s.y}`}#C(e){let{angle:n,position:r}=cw(this.#s(),this.valueMode,this.flatten,this.radius,fw),i=this.#T(`--marker-offset`,1),a=this.#T(`--marker-border-width`,0),o=this.#c();if(o===`dot`){let e=this.#T(`--marker-thickness`,.15)*this.radius,n=fw.x+(r.x-fw.x)*i,o=fw.y+(r.y-fw.y)*i;return a>0?s`
|
|
9311
9349
|
<g class="value-marker" part="value-marker">
|
|
9312
9350
|
<use href="#dot-path" class="marker-border" />
|
|
9313
9351
|
<use href="#dot-path" class="marker-fill" />
|
|
@@ -9325,7 +9363,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9325
9363
|
<g class="value-marker" part="value-marker">
|
|
9326
9364
|
<path d="${o}" />
|
|
9327
9365
|
</g>
|
|
9328
|
-
`}}#w(){if(this.valueMode!==`bipolar`&&this.valueMode!==`unipolar`)return s``;let{position:e}=
|
|
9366
|
+
`}}#w(){if(this.valueMode!==`bipolar`&&this.valueMode!==`unipolar`)return s``;let{position:e}=lw(this.radius,fw);if(this.markerStyle===`dot`){let n=this.#T(`--midpoint-thickness`,.08);return s`
|
|
9329
9367
|
<g class="midpoint-marker" part="midpoint-marker">
|
|
9330
9368
|
<circle
|
|
9331
9369
|
cx="${e.x}"
|
|
@@ -9333,7 +9371,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9333
9371
|
r="${n*this.radius}"
|
|
9334
9372
|
/>
|
|
9335
9373
|
</g>
|
|
9336
|
-
`}{let e=this.#T(`--midpoint-length`,.15),n=this.#T(`--midpoint-offset`,.85),r=-Math.PI/2,i=n*this.radius,a=(n+e)*this.radius,o={x:
|
|
9374
|
+
`}{let e=this.#T(`--midpoint-length`,.15),n=this.#T(`--midpoint-offset`,.85),r=-Math.PI/2,i=n*this.radius,a=(n+e)*this.radius,o={x:fw.x+Math.cos(r)*i,y:fw.y+Math.sin(r)*i},c={x:fw.x+Math.cos(r)*a,y:fw.y+Math.sin(r)*a};return s`
|
|
9337
9375
|
<g class="midpoint-marker" part="midpoint-marker">
|
|
9338
9376
|
<line
|
|
9339
9377
|
x1="${o.x}"
|
|
@@ -9342,7 +9380,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9342
9380
|
y2="${c.y}"
|
|
9343
9381
|
/>
|
|
9344
9382
|
</g>
|
|
9345
|
-
`}}#T(e,n){let r=getComputedStyle(this),i=r.getPropertyValue(e).trim();if(!i)return n;if(i.includes(`calc(`)){let e=r.getPropertyValue(`--value-relative`).trim();if(!e){let e=Number.parseFloat(i.replace(/[^0-9.-]/g,``));return Number.isNaN(e)?n:e}let a=i.replace(/var\(--value-relative\)/g,e);try{let e=Function(`return ${a.replace(/calc\s*\(([^)]+)\)/g,`$1`)}`)();return typeof e==`number`&&!Number.isNaN(e)?e:n}catch{let e=Number.parseFloat(i.replace(/[^0-9.-]/g,``));return Number.isNaN(e)?n:e}}let a=Number.parseFloat(i);return Number.isNaN(a)?n:a}willUpdate(e){if(super.willUpdate(e),e.has(`value`)||!this.hasUpdated){let e=this.#t.get(`value`);e&&e.type===`value`&&(e.value=this.#s())}}render(){let e=Array.from(this.#t.values()),{angle:n,position:r}=
|
|
9383
|
+
`}}#T(e,n){let r=getComputedStyle(this),i=r.getPropertyValue(e).trim();if(!i)return n;if(i.includes(`calc(`)){let e=r.getPropertyValue(`--value-relative`).trim();if(!e){let e=Number.parseFloat(i.replace(/[^0-9.-]/g,``));return Number.isNaN(e)?n:e}let a=i.replace(/var\(--value-relative\)/g,e);try{let e=Function(`return ${a.replace(/calc\s*\(([^)]+)\)/g,`$1`)}`)();return typeof e==`number`&&!Number.isNaN(e)?e:n}catch{let e=Number.parseFloat(i.replace(/[^0-9.-]/g,``));return Number.isNaN(e)?n:e}}let a=Number.parseFloat(i);return Number.isNaN(a)?n:a}willUpdate(e){if(super.willUpdate(e),e.has(`value`)||!this.hasUpdated){let e=this.#t.get(`value`);e&&e.type===`value`&&(e.value=this.#s())}}render(){let e=Array.from(this.#t.values()),{angle:n,position:r}=cw(this.#s(),this.valueMode,this.flatten,this.radius,fw),a=this.#T(`--marker-length`,.8),o=this.#T(`--marker-offset`,.2),c=this.#T(`--marker-border-width`,0),l=c>0?this.#S(n,a,o):void 0,u=this.#T(`--marker-thickness`,.15)*this.radius,d=[];return l&&d.push(s`<path id="needle-path" d="${l}" />`),c>0&&d.push(s`<circle id="dot-path" cx="${r.x}" cy="${r.y}" r="${u}" />`),i`
|
|
9346
9384
|
<svg
|
|
9347
9385
|
viewBox="0 0 100 100"
|
|
9348
9386
|
preserveAspectRatio="xMidYMid meet"
|
|
@@ -9476,7 +9514,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9476
9514
|
stroke-width: var(--midpoint-border-width, 0);
|
|
9477
9515
|
vector-effect: non-scaling-stroke;
|
|
9478
9516
|
}
|
|
9479
|
-
`]}};E([d({type:Number})],
|
|
9517
|
+
`]}};E([d({type:Number})],pw.prototype,`radius`,null),E([d({type:Number})],pw.prototype,`value`,void 0),E([d({type:Number})],pw.prototype,`min`,void 0),E([d({type:Number})],pw.prototype,`max`,void 0),E([d({type:Number})],pw.prototype,`step`,void 0),E([d({type:Number})],pw.prototype,`stops`,void 0),E([d({type:String,attribute:`value-mode`})],pw.prototype,`valueMode`,void 0),E([d({type:Number})],pw.prototype,`flatten`,void 0),E([d({type:String,attribute:`marker-style`})],pw.prototype,`markerStyle`,void 0),E([d({type:Boolean})],pw.prototype,`wedge`,void 0),E([d({type:Boolean,reflect:!0})],pw.prototype,`disabled`,void 0),pw=E([T(`ixfx-radial-input`)],pw);let mw=class extends ug{constructor(...e){super(...e),this.inputSelector=`ixfx-radial-input`,this.max=100,this.step=1,this.radius=45,this.flatten=.3,this.markerStyle=`needle`,this.wedge=!1,this.valueMode=`range`,this.tooltip=!1,this.flip=!1,this.aspectRatioThreshold=1.5,this.lighttouch=!1,this._isWide=!1}_getEffectivePrecision(){if(this.hasAttribute(`precision`))return this.precision;if(this.step!==void 0){let e=String(this.step).split(`.`)[1];return e?e.length:0}return this.max-this.min>10?0:2}_handleResize(e){super._handleResize(e);let{width:n,height:r}=e[0].contentRect;this._isWide=r>0&&n/r>=this.aspectRatioThreshold}_renderEditableNumber(){if(this._isMini)return a;let e=Math.max(this.label?.length??0,3)+1;return i`
|
|
9480
9518
|
<ixfx-editable-number
|
|
9481
9519
|
class="number"
|
|
9482
9520
|
mode="label"
|
|
@@ -9587,8 +9625,8 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9587
9625
|
width: 100%;
|
|
9588
9626
|
height: 100%;
|
|
9589
9627
|
}
|
|
9590
|
-
`]}};E([d({type:Number})],
|
|
9591
|
-
`&&r!==`\r`)break;n++}};function i(){r();let i=/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/i.exec(e.slice(n));if(i)return n+=i[0].length,Number.parseFloat(i[0])}function a(){r();let o=e[n];if(o===`+`||o===`-`){n++;let e=a();return e===void 0?void 0:o===`-`?-e:e}if(o===`(`){n++;let i=s();return i===void 0||(r(),e[n]!==`)`)?void 0:(n++,i)}return i()}function o(){let i=a();if(i!==void 0)for(;;){r();let o=e[n];if(o!==`*`&&o!==`/`)return i;n++;let s=a();if(s===void 0)return;i=o===`*`?i*s:i/s}}function s(){let i=o();if(i!==void 0)for(;;){r();let a=e[n];if(a!==`+`&&a!==`-`)return i;n++;let s=o();if(s===void 0)return;i=a===`+`?i+s:i-s}}let c=s();if(c!==void 0)return r(),n===e.length?c:void 0}let yw=class extends Hy(n){#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;constructor(){super(),this.valueA=50,this.valueB=0,this.valueC=void 0,this.min=0,this.max=100,this.step=void 0,this.stops=void 0,this.valueMode=`single`,this.singleStyle=`range`,this.orientation=`horizontal`,this.markerStyle=`needle`,this.markerStyleC=void 0,this.crossover=`allow`,this.valueDrag=`none`,this.valueCFollow=`none`,this.valueMin=1,this.disabled=!1,this.swipeable=!1,this.#e=new Map,this.#t=50,this.#n=0,this.#r=void 0,this.#i=!1,this.#a=void 0,this.#o=0,this.#s=0,this.#c=void 0,this.#l=void 0,this.#u=void 0,this.#d=void 0,this.#f=0,this.#p=0,this.#m=0,this.#h=`a`,this.#g={x:0,y:0},this.#_=void 0,this.#v=!1,this.#y=!1,this.#C=()=>{let e=this.getBoundingClientRect(),n=this.orientation===`vertical`?e.width:e.height,r=this.orientation===`vertical`?e.height:e.width;(n!==this.#$||r!==this.#ee)&&this.requestUpdate()},this.#w=e=>{this.#be(e)},this.#E=()=>{let e=this.querySelectorAll(`linearGradient, radialGradient`);if(e.length===0)return;let n=this.#T();for(let r of e)n.append(r)},this.#q=24,this.#J=5,this.#Y=5,this.#Q=0,this.#$=0,this.#ee=0,this.#pe=e=>{!this.swipeable||this.disabled||(e.preventDefault(),this.#fe(e))},this.#me=e=>{!this.swipeable||this.disabled||e.buttons===0||this.#fe(e)},this.#he=e=>{!this.swipeable||this.disabled||e.buttons===0||this.#fe(e)},this.#ge=e=>{if(this.disabled||this.swipeable)return;let n=this.renderRoot.querySelector(`svg.slider-svg`);if(!n)return;e.preventDefault(),this.focus(),n.style.cursor=`grabbing`;let r=this.orientation===`vertical`?e.clientY:e.clientX,i=this.#le(r);if(this.valueMode===`single`&&this.singleStyle===`unipolar`&&(i=Math.abs(2*i-1)),this.valueMode===`single`){this.#h=`a`,this.#c=`a`,this.#I(i,!0),this.#i=!0,this.toggleAttribute(`dragging`,!0),this.#a=e.pointerId;try{n.setPointerCapture(e.pointerId)}catch{}this.#o=r,this.#s=this.valueA,window.addEventListener(`pointermove`,this.#_e),window.addEventListener(`pointerup`,this.#ye),window.addEventListener(`pointercancel`,this.#ye);return}let a=this.#D(),o=this.#O(),s=Math.min(a,o),c=Math.max(a,o),l=this.#t<=this.#n?`a`:`b`,u=this.#t>this.#n?`a`:`b`,d=a,f=o,p=this.valueMode===`triple`,m=p?this.#k():0,h=Math.abs(i-d)<_w,g=Math.abs(i-f)<_w,_=p&&Math.abs(i-m)<_w,v,y=e=>e.find(e=>e!==this.#h)??e[0];v=h&&g&&_?y([l,u,`c`]):h&&g?y([l,u]):h&&_?y([l,`c`]):g&&_?y([u,`c`]):h?l:g?u:_?`c`:this.valueDrag!==`none`&&i>s&&i<c?`length`:this.valueDrag===`none`&&i<=s?this.#M():this.valueDrag===`none`&&i>=c?this.#N():void 0,this.#i=!0,this.toggleAttribute(`dragging`,!0),this.#a=e.pointerId;try{n.setPointerCapture(e.pointerId)}catch{}if(this.#o=r,v===void 0){window.addEventListener(`pointermove`,this.#_e),window.addEventListener(`pointerup`,this.#ye),window.addEventListener(`pointercancel`,this.#ye);return}this.#c=v,v===`length`?(this.#l={poleA:this.#t,poleB:this.#n},this.#u=this.#M(),this.#d=this.#N(),this.#f=this.#n-this.#t<0?this.#t-this.#n:this.#n-this.#t,this.#p=Math.min(this.#t,this.#n),this.#m=i):(this.#h=v,this.#s=v===`a`?this.#t:this.#n,this.#L(i,v,!0)),window.addEventListener(`pointermove`,this.#_e),window.addEventListener(`pointerup`,this.#ye),window.addEventListener(`pointercancel`,this.#ye)},this.#_e=e=>{if(!this.#i)return;e.preventDefault();let n=this.orientation===`vertical`?e.clientY:e.clientX,r=this.#le(n);if(this.valueMode===`single`&&this.singleStyle===`unipolar`&&(r=Math.abs(2*r-1)),this.valueMode===`single`){this.#I(r,!0);return}this.#c===`length`?this.#ve(r):this.#c&&this.#L(r,this.#c,!0)},this.#ye=()=>{this.#i=!1,this.#c=void 0,this.#l=void 0,this.#u=void 0,this.#d=void 0,this.toggleAttribute(`dragging`,!1),this.#Ne(new PointerEvent(`pointermove`,{clientX:this.#g.x,clientY:this.#g.y}));let e=this.renderRoot.querySelector(`svg.slider-svg`);if(e&&this.#a!==void 0&&`hasPointerCapture`in e&&typeof e.hasPointerCapture==`function`&&e.hasPointerCapture.call(e,this.#a))try{e.releasePointerCapture(this.#a)}catch{}this.#a=void 0,window.removeEventListener(`pointermove`,this.#_e),window.removeEventListener(`pointerup`,this.#ye),window.removeEventListener(`pointercancel`,this.#ye)},this.#be=e=>{if(this.disabled)return;let n=this.max-this.min,r=Vy(n,this.stops,this.step,e.shiftKey),i=`a`,a=e.target;if(a&&typeof a.closest==`function`){let e=a.closest(`[data-handle]`);if(e){let n=e.dataset?.handle;(n===`a`||n===`b`||n===`c`)&&(i=n)}}this.valueMode===`single`&&(i=`a`),this.#h=i;let o=!1;switch(e.key){case`ArrowUp`:case`ArrowRight`:if(this.valueMode===`single`){let e=this.#D()+r/n;this.#I(Y(e,0,1),!0)}else{let e=gw(i===`a`?this.#t:i===`b`?this.#n:this.#r??this.#A(),this.min,this.max)+r/n;this.#xe(i,e)}o=!0;break;case`ArrowDown`:case`ArrowLeft`:if(this.valueMode===`single`){let e=this.#D()-r/n;this.#I(Y(e,0,1),!0)}else{let e=gw(i===`a`?this.#t:i===`b`?this.#n:this.#r??this.#A(),this.min,this.max)-r/n;this.#xe(i,e)}o=!0;break;case`Home`:this.valueMode===`single`?this.#I(0,!0):this.#xe(i,0),o=!0;break;case`End`:this.valueMode===`single`?this.#I(1,!0):this.#xe(i,1),o=!0}o&&e.preventDefault()},this.#Se=e=>{let n=e.target;if(n&&typeof n.closest==`function`){let e=n.closest(`[data-handle]`);if(e){let n=e.dataset?.handle;(n===`a`||n===`b`||n===`c`)&&(this.#h=n)}}},this.#Ne=e=>{let n=this.renderRoot.querySelector(`svg.slider-svg`);if(!n)return;this.#g={x:e.clientX,y:e.clientY};let r=this.orientation===`vertical`?e.clientY:e.clientX,i=this.#le(r),a=this.#Me(i);n.style.cursor!==a&&(n.style.cursor=a)},this.#Pe=()=>{let e=this.renderRoot.querySelector(`svg.slider-svg`);if(!e)return;let n=this.disabled?`not-allowed`:`default`;e.style.cursor!==n&&(e.style.cursor=n)},this.disabled||this.setAttribute(`tabindex`,`0`),this.#e.set(`track`,{key:`track`,value:1,type:`fixed`,offset:0,width:.16}),this.#e.set(`value`,{key:`value`,valueMin:0,valueMax:0,type:`value`,offset:0,width:.24})}connectedCallback(){super.connectedCallback(),this.setAttribute(`tabindex`,this.disabled?`-1`:`0`),this.addEventListener(`keydown`,this.#w),this.addEventListener(`pointerdown`,this.#pe),this.addEventListener(`pointermove`,this.#me),this.addEventListener(`pointerenter`,this.#he),this.#E(),this.#x=new MutationObserver(this.#E),this.#x.observe(this,{childList:!0,subtree:!0}),this.#S=new ResizeObserver(this.#C),this.#S.observe(this)}#C;#w;#T(){if(this.#b)return this.#b;let e=`http://www.w3.org/2000/svg`,n=document.createElementNS(e,`svg`);n.setAttribute(`width`,`0`),n.setAttribute(`height`,`0`),n.setAttribute(`aria-hidden`,`true`),n.style.cssText=`position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none;`;let r=document.createElementNS(e,`defs`);return n.append(r),this.renderRoot.append(n),this.#b=r,r}#E;addLane(e,n){let r=this.#D();this.#e.set(e,{key:e,value:n?.value??r,valueMin:n?.valueMin??0,valueMax:n?.valueMax??r,type:n?.type??`value`,offset:n?.offset??0,width:n?.width??.1}),this.requestUpdate()}setLaneValue(e,n){let r=this.#e.get(e);r&&(r.value=Y(n,0,1),this.requestUpdate())}setLaneRange(e,n,r){let i=this.#e.get(e);if(!i)return;let a=Y(Math.min(n,r),0,1),o=Y(Math.max(n,r),0,1);i.valueMin=a,i.valueMax=o,this.requestUpdate()}removeLane(e){this.#e.delete(e),this.requestUpdate()}getLanes(){return new Map(this.#e)}getLane(e){return this.#e.get(e)}#D(){return gw(this.valueA,this.min,this.max)}#O(){return gw(this.valueB,this.min,this.max)}#k(){return gw(this.valueC??(this.#t+this.#n)/2,this.min,this.max)}#A(){return Math.min(this.#t,this.#n)}#j(){return Math.max(this.#t,this.#n)}#M(){return this.#t<=this.#n?`a`:`b`}#N(){return this.#t>this.#n?`a`:`b`}#P(){let e=this.max-this.min;return this.valueMin&&this.valueMin>0?this.valueMin:e*.01}#F(e){if(this.stops&&this.stops>1){let n=(this.max-this.min)/this.stops;return Y(Math.round((e-this.min)/n)*n+this.min,this.min,this.max)}return this.step!==void 0&&this.step>0?Y(Math.round((e-this.min)/this.step)*this.step+this.min,this.min,this.max):e}#I(e,n=!1){let r=hw(e,0,1,this.min,this.max),i=this.#F(Y(r,this.min,this.max));if(i===this.valueA)return;let a=this.valueA;this.valueA=i,this.#t=i,this.#v=n;let o=this.#e.get(`value`);if(o&&o.type===`value`&&this.#je(o,this.#D()),this.hasAttribute(`data-tooltip-live`)){let e=Math.round(this.#D()*100);this.setAttribute(`data-tooltip`,`${e}%`)}this.#H({previousValue:a},n)}#L(e,n,r=!1){let i=Y(hw(e,0,1,this.min,this.max),this.min,this.max),a=this.#B(n,i,this.#h);if(!a)return;let o={...this.#R()};this.#t=a.poleA,this.#n=a.poleB,a.poleC!==void 0&&(this.#r=a.poleC),this.#z();let s=this.#V(o,this.#R());this.#v=r;let c=this.#e.get(`value`);if(c&&c.type===`value`&&(c.valueMin=gw(this.#A(),this.min,this.max),c.valueMax=gw(this.#j(),this.min,this.max)),this.hasAttribute(`data-tooltip-live`)){let e=Math.round(gw(this.#j(),this.min,this.max)*100);this.setAttribute(`data-tooltip`,`${e}%`)}this.#H({previousValue:Math.max(o.poleA,o.poleB),previousValueMin:Math.min(o.poleA,o.poleB),previousValueMax:Math.max(o.poleA,o.poleB),previousValueC:o.poleC},r,s)}#R(){return{poleA:this.#t,poleB:this.#n,poleC:this.#r}}#z(){this.valueA=this.#t,this.valueB=this.#n,this.valueMode===`triple`&&this.#r!==void 0&&(this.valueC=this.#r,this.#y=!0)}#B(e,n,r){let i=this.#t,a=this.#n,o=this.#r;if(this.valueMode===`triple`&&e===`c`){let e=Y(n,this.#A(),this.#j()),r=this.#F(e);return r===this.#r?null:{poleA:i,poleB:a,poleC:r}}let s=this.#P(),c=e===`a`?a:i,l=this.#F(Y(n,this.min,this.max));if(this.crossover===`none`?l=(e===`a`?i:a)<=c?Math.min(l,c-s):Math.max(l,c+s):l>c-s&&l<c+s&&(l=Math.abs(l-(c-s))<=Math.abs(l-(c+s))?c-s:c+s),l=Y(l,this.min,this.max),e===`a`){if(l===i)return null;i=l}else{if(l===a)return null;a=l}if(this.valueMode===`triple`&&o!==void 0){let e=Math.min(this.#t,this.#n),n=Math.max(this.#t,this.#n),r=Math.min(i,a),s=Math.max(i,a);this.valueCFollow===`proportional`&&n>e?o=r+Y((o-e)/(n-e),0,1)*(s-r):(o<r&&(o=r),o>s&&(o=s))}return{poleA:i,poleB:a,poleC:o}}#V(e,n){let r=e.poleA!==n.poleA,i=e.poleB!==n.poleB,a=e.poleC!==n.poleC;return this.valueMode===`triple`?r&&i&&!a||r&&i?`both`:r?`min`:i?`max`:a?`c`:`min`:r&&i?`both`:r?`min`:i?`max`:`min`}#H(e,n,r){let i=this.#U(r),a=this.#W(e,r);n?(this.dispatchEvent(new CustomEvent(`input`,{detail:i,bubbles:!0,composed:!0})),this.#G(a)):this.#K(a)}#U(e){if(this.valueMode===`single`)return{value:this.valueA,valueRelative:this.#D()};let n=this.#A(),r=this.#j(),i=gw(n,this.min,this.max),a=gw(r,this.min,this.max);return this.valueMode===`triple`&&this.#r!==void 0?{value:r,valueRelative:a,valueMin:n,valueMax:r,valueMinRelative:i,valueMaxRelative:a,valueC:this.#r,valueCRelative:gw(this.#r,this.min,this.max),changed:e}:{value:r,valueRelative:a,valueMin:n,valueMax:r,valueMinRelative:i,valueMaxRelative:a,changed:e}}#W(e,n){if(this.valueMode===`single`)return{value:this.valueA,valueRelative:this.#D(),previousValue:e.previousValue};let r=this.#A(),i=this.#j(),a=gw(i,this.min,this.max);return this.valueMode===`triple`&&this.#r!==void 0?{value:i,valueRelative:a,previousValue:e.previousValue,valueMin:r,valueMax:i,previousValueMin:e.previousValueMin??r,previousValueMax:e.previousValueMax??i,valueC:this.#r,previousValueC:e.previousValueC??this.#r,changed:n}:{value:i,valueRelative:a,previousValue:e.previousValue,valueMin:r,valueMax:i,previousValueMin:e.previousValueMin??r,previousValueMax:e.previousValueMax??i,changed:n}}#G(e){this.#_!==void 0&&clearTimeout(this.#_),this.#_=window.setTimeout(()=>{this.#K(e),this.#_=void 0},150)}#K(e){this.dispatchEvent(new CustomEvent(`change`,{detail:e,bubbles:!0,composed:!0}))}#q;#J;#Y;#X(e,n){let r=getComputedStyle(this),i=e=>{let n=e.trim();if(!n)return;let r=Number.parseFloat(n);return Number.isNaN(r)?void 0:r},a=i(r.getPropertyValue(`--lane-${e}-width`));if(a!==void 0)return a;if(e===`value`){let e=i(r.getPropertyValue(`--lane-track-width`));return e===void 0?n:e}if(e!==`track`){let e=i(r.getPropertyValue(`--lane-width`));if(e!==void 0)return e}return n}#Z(e){let n=e===`track`?.08:e===`value`?.12:.16;return this.#X(e,n)*this.#$}#Q;#$;#ee;#te(){let e=this.getBoundingClientRect(),n=this.orientation===`vertical`?e.width:e.height;if(this.#$=n,this.#ee=this.orientation===`vertical`?e.height:e.width,e.width<=0||e.height<=0){this.#Q=0;return}let r=0;for(let e of this.#e.values()){let i=e.key===`track`?.08:e.key===`value`?.12:.16;r=Math.max(r,Math.abs(this.#X(e.key,i))*n)}this.#Q=r}#ne(){return this.#$<=0?Math.abs(this.#ue(`--marker-thickness`,.15))/2:this.#re()/this.#$}#re(){let e=Math.abs(this.#ue(`--marker-thickness`,.15));return this.#$<=0?0:Math.max(e*this.#$/2,this.#Q/2+1)}#ie(e,n){let r=this.#ee,i=this.#$;if(r<=0||i<=0||n<=0)return{rx:e,ry:e};let a=r/100,o=i/n;return this.orientation===`vertical`?{rx:e/o,ry:e/a}:{rx:e/a,ry:e/o}}#ae(){return this.valueMode===`single`?[this.markerStyle]:this.valueMode===`triple`&&this.markerStyleC?[...new Set([this.markerStyle,this.markerStyleC])]:[this.markerStyle]}#oe(){let e=0;for(let n of this.#e.values()){let r=n.key===`track`?.08:n.key===`value`?.12:.16,i=this.#X(n.key,r);e=Math.max(e,Math.abs(i)/2+Math.abs(n.offset)/2)}let n=Math.abs(this.#ue(`--marker-offset`,0)),r=Math.abs(this.#ue(`--marker-length`,.8)),i=e=>e===`none`?0:e===`dot`?this.#ne()+n/2:r/4+n/2;for(let n of this.#ae())e=Math.max(e,i(n));if(this.valueMode===`single`&&(this.singleStyle===`bipolar`||this.singleStyle===`unipolar`)){let n=Math.abs(this.#ue(`--midpoint-length`,.15));e=Math.max(e,n/4)}let a=Math.abs(this.#ue(`--track-width`,2));return e=Math.max(e,a/2/24),Math.min(e,.45)}#se(){return Y(2/(.5-this.#oe()),4,40)}#ce(e){let n=Math.abs(this.#ue(`--marker-thickness`,.15)),r=this.#ee>0?this.#re()*100/this.#ee:this.#ne()*e,i=0;for(let a of this.#ae())a===`dot`?i=Math.max(i,r):a===`triangle`&&(i=Math.max(i,n*e/4));let a=Y(i+1.5,1,5),o=Math.max(0,this.#ue(`--track-margin`,0)),s=Math.max(0,this.#ue(`--track-margin-start`,o)),c=Math.max(0,this.#ue(`--track-margin-end`,o)),l=a+s,u=a+c;if(l+u>90&&l+u>0){let e=90/(l+u);l*=e,u*=e}return{start:l,end:u}}#le(e){let n=this.getBoundingClientRect(),r=this.orientation===`vertical`,i=r?n.top:n.left,a=r?n.height:n.width;if(a<=0)return 0;let o=i+a*this.#J/100,s=a*(100-this.#J-this.#Y)/100;if(s<=0)return 0;let c=Y((e-o)/s,0,1);return r?1-c:c}#ue(e,n){let r=getComputedStyle(this),i=r.getPropertyValue(e).trim();if(!i)return n;if(i.includes(`calc(`)){let e=r.getPropertyValue(`--value-relative`).trim();if(!e){let e=Number.parseFloat(i.replace(/[^0-9.-]/g,``));return Number.isNaN(e)?n:e}let a=vw(i.replace(/var\(--value-relative\)/g,e).replace(/calc\s*\(([^)]+)\)/g,`$1`));if(a!==void 0)return Number.isNaN(a)?n:a;let o=Number.parseFloat(i.replace(/[^0-9.-]/g,``));return Number.isNaN(o)?n:o}let a=Number.parseFloat(i);return Number.isNaN(a)?n:a}#de(e){let n=this.orientation===`vertical`?e.clientY:e.clientX,r=this.#le(n);return this.valueMode===`single`&&this.singleStyle===`unipolar`?Math.abs(2*r-1):r}#fe(e){this.focus();let n=this.#de(e);if(this.valueMode===`single`){this.#h=`a`,this.#I(n,!0);return}let r=this.#D(),i=this.#O(),a=Math.abs(n-r)<=Math.abs(n-i)?`a`:`b`;if(this.valueMode===`triple`){let e=this.#k(),o=Math.abs(n-r),s=Math.abs(n-i),c=Math.abs(n-e);a=o<=s&&o<=c?`a`:s<=c?`b`:`c`}this.#h=a===`a`||a===`b`?a:`c`,this.#L(n,a,!0)}#pe;#me;#he;#ge;#_e;#ve(e){if(!this.#l)return;let n=this.max-this.min,r=(e-this.#m)*n,i=this.#p+r,a=i+this.#f;if(this.valueDrag===`stop`){let e=this.#f,n=i,r=i+e;if(n<this.min){let i=this.min-this.#p;n=this.#p+i,r=n+e}if(r>this.max){let e=this.max-r;n+=e,r+=e}i=n,a=r}else this.valueDrag===`flex`&&(i=Y(i,this.min,this.max),a=Y(a,this.min,this.max));let o=this.#u??this.#M(),s=this.#d??this.#N(),c=this.#R(),l=o===`a`?i:a,u=s===`b`?a:i;if(this.#t=l,this.#n=u,this.valueMode===`triple`&&this.#r!==void 0){let e=Math.min(c.poleA,c.poleB),n=Math.max(c.poleA,c.poleB),r=Math.min(l,u),i=Math.max(l,u);if(this.valueCFollow===`proportional`&&n>e){let a=Y((this.#r-e)/(n-e),0,1);this.#r=r+a*(i-r)}else this.#r<r&&(this.#r=r),this.#r>i&&(this.#r=i)}this.#z(),this.#v=!0;let d=this.#e.get(`value`);d&&d.type===`value`&&(d.valueMin=gw(this.#A(),this.min,this.max),d.valueMax=gw(this.#j(),this.min,this.max)),this.#H({previousValue:c.poleA,previousValueMin:Math.min(c.poleA,c.poleB),previousValueMax:Math.max(c.poleA,c.poleB),previousValueC:c.poleC},!0,`both`)}#ye;#be;#xe(e,n){if(this.valueMode===`single`){this.#I(Y(n,0,1),!0);return}if(e===`c`){let e=this.#A(),r=this.#j(),i=Y(hw(Y(n,0,1),0,1,this.min,this.max),e,r),a=this.#F(i);if(a===this.#r)return;let o=this.#R();this.#r=a,this.#z(),this.#v=!0,this.#H({previousValue:o.poleA,previousValueMin:Math.min(o.poleA,o.poleB),previousValueMax:Math.max(o.poleA,o.poleB),previousValueC:o.poleC},!0,`c`);return}this.#L(Y(n,0,1),e,!0)}_applyWheelDelta(e,n){let r=this.#h,i=n.target;if(i&&typeof i.closest==`function`){let e=i.closest(`[data-handle]`);if(e){let n=e.dataset?.handle;(n===`a`||n===`b`||n===`c`)&&(r=n)}}this.valueMode===`single`&&(r=`a`),this.#h=r;let a=this.max-this.min,o=Vy(a,this.stops,this.step,n.shiftKey),s=Y(gw(r===`a`?this.#t:r===`b`?this.#n:this.#r??this.#A(),this.min,this.max)-e*o/a,0,1);this.#xe(r,s)}#Se;#Ce(){let e=this.#q;return this.orientation===`horizontal`?`0 0 100 ${e}`:`0 0 ${e} 100`}#we(){let e=this.orientation===`vertical`,n=this.#q,r=this.#J,i=this.#Y,a=this.#ue(`--track-width`,2),o=this.#Te(`--track-color`,`var(--surface-4)`),c=this.#Te(`--track-fill`,`transparent`);return e?s`
|
|
9628
|
+
`]}};E([d({type:Number})],mw.prototype,`radius`,void 0),E([d({type:Number})],mw.prototype,`flatten`,void 0),E([d({type:String,attribute:`marker-style`})],mw.prototype,`markerStyle`,void 0),E([d({type:Boolean})],mw.prototype,`wedge`,void 0),E([d({type:String,attribute:`value-mode`})],mw.prototype,`valueMode`,void 0),E([d({type:Boolean})],mw.prototype,`tooltip`,void 0),E([d({type:Boolean})],mw.prototype,`flip`,void 0),E([d({type:Number,attribute:`aspect-ratio-threshold`})],mw.prototype,`aspectRatioThreshold`,void 0),E([d({type:Boolean})],mw.prototype,`lighttouch`,void 0),E([m()],mw.prototype,`_isWide`,void 0),mw=E([T(`ixfx-labelled-radial-input`)],mw);function hw(e,n=24,r=5,i=5){let a=r,o=100-i;return{trackStart:a,trackEnd:o,centre:(a+o)/2,cross:n,crossCentre:n/2}}function gw(e,n,r,i){let a=r.trackEnd-r.trackStart,o=r.centre,s=r.crossCentre,c;if(n===`range`)c=r.trackStart+e*a;else if(n===`bipolar`){if(e<=.5){let n=e/.5;c=r.trackStart+n*(o-r.trackStart)}else c=o+(e-.5)/.5*(r.trackEnd-o)}else c=o+e*a/2;return i===`horizontal`?{x:c,y:s}:{x:s,y:100-c}}function _w(e,n,r,i,a){if(r===`unipolar`){let e=i.trackEnd-i.trackStart,r=i.centre,o=i.crossCentre,s=n*e/2;return a===`horizontal`?{start:{x:r-s,y:o},end:{x:r+s,y:o}}:{start:{x:o,y:r-s},end:{x:o,y:r+s}}}return{start:gw(e,r,i,a),end:gw(n,r,i,a)}}function vw(e,n,r,i,a){let o=n*(i.trackEnd-i.trackStart)/2,s=r===`unipolar`?a===`horizontal`?{x:i.centre,y:i.crossCentre}:{x:i.crossCentre,y:i.centre}:gw(e,r,i,a),c,l;return a===`horizontal`?(c=s.x-o,l=s.x+o):(c=s.y-o,l=s.y+o),{start:a===`horizontal`?{x:c,y:s.y}:{x:s.x,y:c},end:a===`horizontal`?{x:l,y:s.y}:{x:s.x,y:l}}}function yw(e,n){return Math.abs(e.x-n.x)<.001&&Math.abs(e.y-n.y)<.001?``:`M ${e.x} ${e.y} L ${n.x} ${n.y}`}function Y(e,n,r){return Math.min(Math.max(e,n),r)}function bw(e,n,r,i,a){return r===n?i:i+(e-n)/(r-n)*(a-i)}function xw(e,n,r){return bw(e,n,r,0,1)}const Sw=.06;function Cw(e){let n=0,r=()=>{for(;n<e.length;){let r=e[n];if(r!==` `&&r!==` `&&r!==`
|
|
9629
|
+
`&&r!==`\r`)break;n++}};function i(){r();let i=/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/i.exec(e.slice(n));if(i)return n+=i[0].length,Number.parseFloat(i[0])}function a(){r();let o=e[n];if(o===`+`||o===`-`){n++;let e=a();return e===void 0?void 0:o===`-`?-e:e}if(o===`(`){n++;let i=s();return i===void 0||(r(),e[n]!==`)`)?void 0:(n++,i)}return i()}function o(){let i=a();if(i!==void 0)for(;;){r();let o=e[n];if(o!==`*`&&o!==`/`)return i;n++;let s=a();if(s===void 0)return;i=o===`*`?i*s:i/s}}function s(){let i=o();if(i!==void 0)for(;;){r();let a=e[n];if(a!==`+`&&a!==`-`)return i;n++;let s=o();if(s===void 0)return;i=a===`+`?i+s:i-s}}let c=s();if(c!==void 0)return r(),n===e.length?c:void 0}let ww=class extends qy(n){#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y;#b;#x;#S;constructor(){super(),this.valueA=50,this.valueB=0,this.valueC=void 0,this.min=0,this.max=100,this.step=void 0,this.stops=void 0,this.valueMode=`single`,this.singleStyle=`range`,this.orientation=`horizontal`,this.markerStyle=`needle`,this.markerStyleC=void 0,this.crossover=`allow`,this.valueDrag=`none`,this.valueCFollow=`none`,this.valueMin=1,this.disabled=!1,this.swipeable=!1,this.#e=new Map,this.#t=50,this.#n=0,this.#r=void 0,this.#i=!1,this.#a=void 0,this.#o=0,this.#s=0,this.#c=void 0,this.#l=void 0,this.#u=void 0,this.#d=void 0,this.#f=0,this.#p=0,this.#m=0,this.#h=`a`,this.#g={x:0,y:0},this.#_=void 0,this.#v=!1,this.#y=!1,this.#C=()=>{let e=this.getBoundingClientRect(),n=this.orientation===`vertical`?e.width:e.height,r=this.orientation===`vertical`?e.height:e.width;(n!==this.#$||r!==this.#ee)&&this.requestUpdate()},this.#w=e=>{this.#be(e)},this.#E=()=>{let e=this.querySelectorAll(`linearGradient, radialGradient`);if(e.length===0)return;let n=this.#T();for(let r of e)n.append(r)},this.#q=24,this.#J=5,this.#Y=5,this.#Q=0,this.#$=0,this.#ee=0,this.#pe=e=>{!this.swipeable||this.disabled||(e.preventDefault(),this.#fe(e))},this.#me=e=>{!this.swipeable||this.disabled||e.buttons===0||this.#fe(e)},this.#he=e=>{!this.swipeable||this.disabled||e.buttons===0||this.#fe(e)},this.#ge=e=>{if(this.disabled||this.swipeable)return;let n=this.renderRoot.querySelector(`svg.slider-svg`);if(!n)return;e.preventDefault(),this.focus(),n.style.cursor=`grabbing`;let r=this.orientation===`vertical`?e.clientY:e.clientX,i=this.#le(r);if(this.valueMode===`single`&&this.singleStyle===`unipolar`&&(i=Math.abs(2*i-1)),this.valueMode===`single`){this.#h=`a`,this.#c=`a`,this.#I(i,!0),this.#i=!0,this.toggleAttribute(`dragging`,!0),this.#a=e.pointerId;try{n.setPointerCapture(e.pointerId)}catch{}this.#o=r,this.#s=this.valueA,window.addEventListener(`pointermove`,this.#_e),window.addEventListener(`pointerup`,this.#ye),window.addEventListener(`pointercancel`,this.#ye);return}let a=this.#D(),o=this.#O(),s=Math.min(a,o),c=Math.max(a,o),l=this.#t<=this.#n?`a`:`b`,u=this.#t>this.#n?`a`:`b`,d=a,f=o,p=this.valueMode===`triple`,m=p?this.#k():0,h=Math.abs(i-d)<Sw,g=Math.abs(i-f)<Sw,_=p&&Math.abs(i-m)<Sw,v,y=e=>e.find(e=>e!==this.#h)??e[0];v=h&&g&&_?y([l,u,`c`]):h&&g?y([l,u]):h&&_?y([l,`c`]):g&&_?y([u,`c`]):h?l:g?u:_?`c`:this.valueDrag!==`none`&&i>s&&i<c?`length`:this.valueDrag===`none`&&i<=s?this.#M():this.valueDrag===`none`&&i>=c?this.#N():void 0,this.#i=!0,this.toggleAttribute(`dragging`,!0),this.#a=e.pointerId;try{n.setPointerCapture(e.pointerId)}catch{}if(this.#o=r,v===void 0){window.addEventListener(`pointermove`,this.#_e),window.addEventListener(`pointerup`,this.#ye),window.addEventListener(`pointercancel`,this.#ye);return}this.#c=v,v===`length`?(this.#l={poleA:this.#t,poleB:this.#n},this.#u=this.#M(),this.#d=this.#N(),this.#f=this.#n-this.#t<0?this.#t-this.#n:this.#n-this.#t,this.#p=Math.min(this.#t,this.#n),this.#m=i):(this.#h=v,this.#s=v===`a`?this.#t:this.#n,this.#L(i,v,!0)),window.addEventListener(`pointermove`,this.#_e),window.addEventListener(`pointerup`,this.#ye),window.addEventListener(`pointercancel`,this.#ye)},this.#_e=e=>{if(!this.#i)return;e.preventDefault();let n=this.orientation===`vertical`?e.clientY:e.clientX,r=this.#le(n);if(this.valueMode===`single`&&this.singleStyle===`unipolar`&&(r=Math.abs(2*r-1)),this.valueMode===`single`){this.#I(r,!0);return}this.#c===`length`?this.#ve(r):this.#c&&this.#L(r,this.#c,!0)},this.#ye=()=>{this.#i=!1,this.#c=void 0,this.#l=void 0,this.#u=void 0,this.#d=void 0,this.toggleAttribute(`dragging`,!1),this.#Ne(new PointerEvent(`pointermove`,{clientX:this.#g.x,clientY:this.#g.y}));let e=this.renderRoot.querySelector(`svg.slider-svg`);if(e&&this.#a!==void 0&&`hasPointerCapture`in e&&typeof e.hasPointerCapture==`function`&&e.hasPointerCapture.call(e,this.#a))try{e.releasePointerCapture(this.#a)}catch{}this.#a=void 0,window.removeEventListener(`pointermove`,this.#_e),window.removeEventListener(`pointerup`,this.#ye),window.removeEventListener(`pointercancel`,this.#ye)},this.#be=e=>{if(this.disabled)return;let n=this.max-this.min,r=Ky(n,this.stops,this.step,e.shiftKey),i=`a`,a=e.target;if(a&&typeof a.closest==`function`){let e=a.closest(`[data-handle]`);if(e){let n=e.dataset?.handle;(n===`a`||n===`b`||n===`c`)&&(i=n)}}this.valueMode===`single`&&(i=`a`),this.#h=i;let o=!1;switch(e.key){case`ArrowUp`:case`ArrowRight`:if(this.valueMode===`single`){let e=this.#D()+r/n;this.#I(Y(e,0,1),!0)}else{let e=xw(i===`a`?this.#t:i===`b`?this.#n:this.#r??this.#A(),this.min,this.max)+r/n;this.#xe(i,e)}o=!0;break;case`ArrowDown`:case`ArrowLeft`:if(this.valueMode===`single`){let e=this.#D()-r/n;this.#I(Y(e,0,1),!0)}else{let e=xw(i===`a`?this.#t:i===`b`?this.#n:this.#r??this.#A(),this.min,this.max)-r/n;this.#xe(i,e)}o=!0;break;case`Home`:this.valueMode===`single`?this.#I(0,!0):this.#xe(i,0),o=!0;break;case`End`:this.valueMode===`single`?this.#I(1,!0):this.#xe(i,1),o=!0}o&&e.preventDefault()},this.#Se=e=>{let n=e.target;if(n&&typeof n.closest==`function`){let e=n.closest(`[data-handle]`);if(e){let n=e.dataset?.handle;(n===`a`||n===`b`||n===`c`)&&(this.#h=n)}}},this.#Ne=e=>{let n=this.renderRoot.querySelector(`svg.slider-svg`);if(!n)return;this.#g={x:e.clientX,y:e.clientY};let r=this.orientation===`vertical`?e.clientY:e.clientX,i=this.#le(r),a=this.#Me(i);n.style.cursor!==a&&(n.style.cursor=a)},this.#Pe=()=>{let e=this.renderRoot.querySelector(`svg.slider-svg`);if(!e)return;let n=this.disabled?`not-allowed`:`default`;e.style.cursor!==n&&(e.style.cursor=n)},this.disabled||this.setAttribute(`tabindex`,`0`),this.#e.set(`track`,{key:`track`,value:1,type:`fixed`,offset:0,width:.16}),this.#e.set(`value`,{key:`value`,valueMin:0,valueMax:0,type:`value`,offset:0,width:.24})}connectedCallback(){super.connectedCallback(),this.setAttribute(`tabindex`,this.disabled?`-1`:`0`),this.addEventListener(`keydown`,this.#w),this.addEventListener(`pointerdown`,this.#pe),this.addEventListener(`pointermove`,this.#me),this.addEventListener(`pointerenter`,this.#he),this.#E(),this.#x=new MutationObserver(this.#E),this.#x.observe(this,{childList:!0,subtree:!0}),this.#S=new ResizeObserver(this.#C),this.#S.observe(this)}#C;#w;#T(){if(this.#b)return this.#b;let e=`http://www.w3.org/2000/svg`,n=document.createElementNS(e,`svg`);n.setAttribute(`width`,`0`),n.setAttribute(`height`,`0`),n.setAttribute(`aria-hidden`,`true`),n.style.cssText=`position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none;`;let r=document.createElementNS(e,`defs`);return n.append(r),this.renderRoot.append(n),this.#b=r,r}#E;addLane(e,n){let r=this.#D();this.#e.set(e,{key:e,value:n?.value??r,valueMin:n?.valueMin??0,valueMax:n?.valueMax??r,type:n?.type??`value`,offset:n?.offset??0,width:n?.width??.1}),this.requestUpdate()}setLaneValue(e,n){let r=this.#e.get(e);r&&(r.value=Y(n,0,1),this.requestUpdate())}setLaneRange(e,n,r){let i=this.#e.get(e);if(!i)return;let a=Y(Math.min(n,r),0,1),o=Y(Math.max(n,r),0,1);i.valueMin=a,i.valueMax=o,this.requestUpdate()}removeLane(e){this.#e.delete(e),this.requestUpdate()}getLanes(){return new Map(this.#e)}getLane(e){return this.#e.get(e)}#D(){return xw(this.valueA,this.min,this.max)}#O(){return xw(this.valueB,this.min,this.max)}#k(){return xw(this.valueC??(this.#t+this.#n)/2,this.min,this.max)}#A(){return Math.min(this.#t,this.#n)}#j(){return Math.max(this.#t,this.#n)}#M(){return this.#t<=this.#n?`a`:`b`}#N(){return this.#t>this.#n?`a`:`b`}#P(){let e=this.max-this.min;return this.valueMin&&this.valueMin>0?this.valueMin:e*.01}#F(e){if(this.stops&&this.stops>1){let n=(this.max-this.min)/this.stops;return Y(Math.round((e-this.min)/n)*n+this.min,this.min,this.max)}return this.step!==void 0&&this.step>0?Y(Math.round((e-this.min)/this.step)*this.step+this.min,this.min,this.max):e}#I(e,n=!1){let r=bw(e,0,1,this.min,this.max),i=this.#F(Y(r,this.min,this.max));if(i===this.valueA)return;let a=this.valueA;this.valueA=i,this.#t=i,this.#v=n;let o=this.#e.get(`value`);if(o&&o.type===`value`&&this.#je(o,this.#D()),this.hasAttribute(`data-tooltip-live`)){let e=Math.round(this.#D()*100);this.setAttribute(`data-tooltip`,`${e}%`)}this.#H({previousValue:a},n)}#L(e,n,r=!1){let i=Y(bw(e,0,1,this.min,this.max),this.min,this.max),a=this.#B(n,i,this.#h);if(!a)return;let o={...this.#R()};this.#t=a.poleA,this.#n=a.poleB,a.poleC!==void 0&&(this.#r=a.poleC),this.#z();let s=this.#V(o,this.#R());this.#v=r;let c=this.#e.get(`value`);if(c&&c.type===`value`&&(c.valueMin=xw(this.#A(),this.min,this.max),c.valueMax=xw(this.#j(),this.min,this.max)),this.hasAttribute(`data-tooltip-live`)){let e=Math.round(xw(this.#j(),this.min,this.max)*100);this.setAttribute(`data-tooltip`,`${e}%`)}this.#H({previousValue:Math.max(o.poleA,o.poleB),previousValueMin:Math.min(o.poleA,o.poleB),previousValueMax:Math.max(o.poleA,o.poleB),previousValueC:o.poleC},r,s)}#R(){return{poleA:this.#t,poleB:this.#n,poleC:this.#r}}#z(){this.valueA=this.#t,this.valueB=this.#n,this.valueMode===`triple`&&this.#r!==void 0&&(this.valueC=this.#r,this.#y=!0)}#B(e,n,r){let i=this.#t,a=this.#n,o=this.#r;if(this.valueMode===`triple`&&e===`c`){let e=Y(n,this.#A(),this.#j()),r=this.#F(e);return r===this.#r?null:{poleA:i,poleB:a,poleC:r}}let s=this.#P(),c=e===`a`?a:i,l=this.#F(Y(n,this.min,this.max));if(this.crossover===`none`?l=(e===`a`?i:a)<=c?Math.min(l,c-s):Math.max(l,c+s):l>c-s&&l<c+s&&(l=Math.abs(l-(c-s))<=Math.abs(l-(c+s))?c-s:c+s),l=Y(l,this.min,this.max),e===`a`){if(l===i)return null;i=l}else{if(l===a)return null;a=l}if(this.valueMode===`triple`&&o!==void 0){let e=Math.min(this.#t,this.#n),n=Math.max(this.#t,this.#n),r=Math.min(i,a),s=Math.max(i,a);this.valueCFollow===`proportional`&&n>e?o=r+Y((o-e)/(n-e),0,1)*(s-r):(o<r&&(o=r),o>s&&(o=s))}return{poleA:i,poleB:a,poleC:o}}#V(e,n){let r=e.poleA!==n.poleA,i=e.poleB!==n.poleB,a=e.poleC!==n.poleC;return this.valueMode===`triple`?r&&i&&!a||r&&i?`both`:r?`min`:i?`max`:a?`c`:`min`:r&&i?`both`:r?`min`:i?`max`:`min`}#H(e,n,r){let i=this.#U(r),a=this.#W(e,r);n?(this.dispatchEvent(new CustomEvent(`input`,{detail:i,bubbles:!0,composed:!0})),this.#G(a)):this.#K(a)}#U(e){if(this.valueMode===`single`)return{value:this.valueA,valueRelative:this.#D()};let n=this.#A(),r=this.#j(),i=xw(n,this.min,this.max),a=xw(r,this.min,this.max);return this.valueMode===`triple`&&this.#r!==void 0?{value:r,valueRelative:a,valueMin:n,valueMax:r,valueMinRelative:i,valueMaxRelative:a,valueC:this.#r,valueCRelative:xw(this.#r,this.min,this.max),changed:e}:{value:r,valueRelative:a,valueMin:n,valueMax:r,valueMinRelative:i,valueMaxRelative:a,changed:e}}#W(e,n){if(this.valueMode===`single`)return{value:this.valueA,valueRelative:this.#D(),previousValue:e.previousValue};let r=this.#A(),i=this.#j(),a=xw(i,this.min,this.max);return this.valueMode===`triple`&&this.#r!==void 0?{value:i,valueRelative:a,previousValue:e.previousValue,valueMin:r,valueMax:i,previousValueMin:e.previousValueMin??r,previousValueMax:e.previousValueMax??i,valueC:this.#r,previousValueC:e.previousValueC??this.#r,changed:n}:{value:i,valueRelative:a,previousValue:e.previousValue,valueMin:r,valueMax:i,previousValueMin:e.previousValueMin??r,previousValueMax:e.previousValueMax??i,changed:n}}#G(e){this.#_!==void 0&&clearTimeout(this.#_),this.#_=window.setTimeout(()=>{this.#K(e),this.#_=void 0},150)}#K(e){this.dispatchEvent(new CustomEvent(`change`,{detail:e,bubbles:!0,composed:!0}))}#q;#J;#Y;#X(e,n){let r=getComputedStyle(this),i=e=>{let n=e.trim();if(!n)return;let r=Number.parseFloat(n);return Number.isNaN(r)?void 0:r},a=i(r.getPropertyValue(`--lane-${e}-width`));if(a!==void 0)return a;if(e===`value`){let e=i(r.getPropertyValue(`--lane-track-width`));return e===void 0?n:e}if(e!==`track`){let e=i(r.getPropertyValue(`--lane-width`));if(e!==void 0)return e}return n}#Z(e){let n=e===`track`?.08:e===`value`?.12:.16;return this.#X(e,n)*this.#$}#Q;#$;#ee;#te(){let e=this.getBoundingClientRect(),n=this.orientation===`vertical`?e.width:e.height;if(this.#$=n,this.#ee=this.orientation===`vertical`?e.height:e.width,e.width<=0||e.height<=0){this.#Q=0;return}let r=0;for(let e of this.#e.values()){let i=e.key===`track`?.08:e.key===`value`?.12:.16;r=Math.max(r,Math.abs(this.#X(e.key,i))*n)}this.#Q=r}#ne(){return this.#$<=0?Math.abs(this.#ue(`--marker-thickness`,.15))/2:this.#re()/this.#$}#re(){let e=Math.abs(this.#ue(`--marker-thickness`,.15));return this.#$<=0?0:Math.max(e*this.#$/2,this.#Q/2+1)}#ie(e,n){let r=this.#ee,i=this.#$;if(r<=0||i<=0||n<=0)return{rx:e,ry:e};let a=r/100,o=i/n;return this.orientation===`vertical`?{rx:e/o,ry:e/a}:{rx:e/a,ry:e/o}}#ae(){return this.valueMode===`single`?[this.markerStyle]:this.valueMode===`triple`&&this.markerStyleC?[...new Set([this.markerStyle,this.markerStyleC])]:[this.markerStyle]}#oe(){let e=0;for(let n of this.#e.values()){let r=n.key===`track`?.08:n.key===`value`?.12:.16,i=this.#X(n.key,r);e=Math.max(e,Math.abs(i)/2+Math.abs(n.offset)/2)}let n=Math.abs(this.#ue(`--marker-offset`,0)),r=Math.abs(this.#ue(`--marker-length`,.8)),i=e=>e===`none`?0:e===`dot`?this.#ne()+n/2:r/4+n/2;for(let n of this.#ae())e=Math.max(e,i(n));if(this.valueMode===`single`&&(this.singleStyle===`bipolar`||this.singleStyle===`unipolar`)){let n=Math.abs(this.#ue(`--midpoint-length`,.15));e=Math.max(e,n/4)}let a=Math.abs(this.#ue(`--track-width`,2));return e=Math.max(e,a/2/24),Math.min(e,.45)}#se(){return Y(2/(.5-this.#oe()),4,40)}#ce(e){let n=Math.abs(this.#ue(`--marker-thickness`,.15)),r=this.#ee>0?this.#re()*100/this.#ee:this.#ne()*e,i=0;for(let a of this.#ae())a===`dot`?i=Math.max(i,r):a===`triangle`&&(i=Math.max(i,n*e/4));let a=Y(i+1.5,1,5),o=Math.max(0,this.#ue(`--track-margin`,0)),s=Math.max(0,this.#ue(`--track-margin-start`,o)),c=Math.max(0,this.#ue(`--track-margin-end`,o)),l=a+s,u=a+c;if(l+u>90&&l+u>0){let e=90/(l+u);l*=e,u*=e}return{start:l,end:u}}#le(e){let n=this.getBoundingClientRect(),r=this.orientation===`vertical`,i=r?n.top:n.left,a=r?n.height:n.width;if(a<=0)return 0;let o=i+a*this.#J/100,s=a*(100-this.#J-this.#Y)/100;if(s<=0)return 0;let c=Y((e-o)/s,0,1);return r?1-c:c}#ue(e,n){let r=getComputedStyle(this),i=r.getPropertyValue(e).trim();if(!i)return n;if(i.includes(`calc(`)){let e=r.getPropertyValue(`--value-relative`).trim();if(!e){let e=Number.parseFloat(i.replace(/[^0-9.-]/g,``));return Number.isNaN(e)?n:e}let a=Cw(i.replace(/var\(--value-relative\)/g,e).replace(/calc\s*\(([^)]+)\)/g,`$1`));if(a!==void 0)return Number.isNaN(a)?n:a;let o=Number.parseFloat(i.replace(/[^0-9.-]/g,``));return Number.isNaN(o)?n:o}let a=Number.parseFloat(i);return Number.isNaN(a)?n:a}#de(e){let n=this.orientation===`vertical`?e.clientY:e.clientX,r=this.#le(n);return this.valueMode===`single`&&this.singleStyle===`unipolar`?Math.abs(2*r-1):r}#fe(e){this.focus();let n=this.#de(e);if(this.valueMode===`single`){this.#h=`a`,this.#I(n,!0);return}let r=this.#D(),i=this.#O(),a=Math.abs(n-r)<=Math.abs(n-i)?`a`:`b`;if(this.valueMode===`triple`){let e=this.#k(),o=Math.abs(n-r),s=Math.abs(n-i),c=Math.abs(n-e);a=o<=s&&o<=c?`a`:s<=c?`b`:`c`}this.#h=a===`a`||a===`b`?a:`c`,this.#L(n,a,!0)}#pe;#me;#he;#ge;#_e;#ve(e){if(!this.#l)return;let n=this.max-this.min,r=(e-this.#m)*n,i=this.#p+r,a=i+this.#f;if(this.valueDrag===`stop`){let e=this.#f,n=i,r=i+e;if(n<this.min){let i=this.min-this.#p;n=this.#p+i,r=n+e}if(r>this.max){let e=this.max-r;n+=e,r+=e}i=n,a=r}else this.valueDrag===`flex`&&(i=Y(i,this.min,this.max),a=Y(a,this.min,this.max));let o=this.#u??this.#M(),s=this.#d??this.#N(),c=this.#R(),l=o===`a`?i:a,u=s===`b`?a:i;if(this.#t=l,this.#n=u,this.valueMode===`triple`&&this.#r!==void 0){let e=Math.min(c.poleA,c.poleB),n=Math.max(c.poleA,c.poleB),r=Math.min(l,u),i=Math.max(l,u);if(this.valueCFollow===`proportional`&&n>e){let a=Y((this.#r-e)/(n-e),0,1);this.#r=r+a*(i-r)}else this.#r<r&&(this.#r=r),this.#r>i&&(this.#r=i)}this.#z(),this.#v=!0;let d=this.#e.get(`value`);d&&d.type===`value`&&(d.valueMin=xw(this.#A(),this.min,this.max),d.valueMax=xw(this.#j(),this.min,this.max)),this.#H({previousValue:c.poleA,previousValueMin:Math.min(c.poleA,c.poleB),previousValueMax:Math.max(c.poleA,c.poleB),previousValueC:c.poleC},!0,`both`)}#ye;#be;#xe(e,n){if(this.valueMode===`single`){this.#I(Y(n,0,1),!0);return}if(e===`c`){let e=this.#A(),r=this.#j(),i=Y(bw(Y(n,0,1),0,1,this.min,this.max),e,r),a=this.#F(i);if(a===this.#r)return;let o=this.#R();this.#r=a,this.#z(),this.#v=!0,this.#H({previousValue:o.poleA,previousValueMin:Math.min(o.poleA,o.poleB),previousValueMax:Math.max(o.poleA,o.poleB),previousValueC:o.poleC},!0,`c`);return}this.#L(Y(n,0,1),e,!0)}_applyWheelDelta(e,n){let r=this.#h,i=n.target;if(i&&typeof i.closest==`function`){let e=i.closest(`[data-handle]`);if(e){let n=e.dataset?.handle;(n===`a`||n===`b`||n===`c`)&&(r=n)}}this.valueMode===`single`&&(r=`a`),this.#h=r;let a=this.max-this.min,o=Ky(a,this.stops,this.step,n.shiftKey),s=Y(xw(r===`a`?this.#t:r===`b`?this.#n:this.#r??this.#A(),this.min,this.max)-e*o/a,0,1);this.#xe(r,s)}#Se;#Ce(){let e=this.#q;return this.orientation===`horizontal`?`0 0 100 ${e}`:`0 0 ${e} 100`}#we(){let e=this.orientation===`vertical`,n=this.#q,r=this.#J,i=this.#Y,a=this.#ue(`--track-width`,2),o=this.#Te(`--track-color`,`var(--surface-4)`),c=this.#Te(`--track-fill`,`transparent`);return e?s`
|
|
9592
9630
|
<rect
|
|
9593
9631
|
class="track"
|
|
9594
9632
|
x="${n/2-a/2}"
|
|
@@ -9610,7 +9648,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9610
9648
|
stroke="${o}"
|
|
9611
9649
|
stroke-width="0"
|
|
9612
9650
|
/>
|
|
9613
|
-
`}#Te(e,n){return getComputedStyle(this).getPropertyValue(e).trim()||n}#Ee(e){let n=
|
|
9651
|
+
`}#Te(e,n){return getComputedStyle(this).getPropertyValue(e).trim()||n}#Ee(e){let n=hw(this.orientation,this.#q,this.#J,this.#Y),r=``;if(e.type===`fixed`)r=yw(this.orientation===`horizontal`?{x:n.trackStart,y:n.crossCentre}:{x:n.crossCentre,y:n.trackStart},this.orientation===`horizontal`?{x:n.trackEnd,y:n.crossCentre}:{x:n.crossCentre,y:n.trackEnd});else if(e.type===`anchored`){let i=vw(this.#D(),e.value??.1,this.singleStyle,n,this.orientation);r=yw(i.start,i.end)}else{let i=_w(e.valueMin??0,e.valueMax??0,this.singleStyle,n,this.orientation);r=yw(i.start,i.end)}if(!r)return s``;let i=`${this.#Z(e.key)}px`,a=e.offset*this.#$/2,o=this.orientation===`horizontal`?`translateY(${a}px)`:`translateX(${a}px)`;return s`
|
|
9614
9652
|
<path
|
|
9615
9653
|
class="lane"
|
|
9616
9654
|
data-lane-key="${e.key}"
|
|
@@ -9622,7 +9660,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9622
9660
|
transform: ${o};
|
|
9623
9661
|
"
|
|
9624
9662
|
/>
|
|
9625
|
-
`}#De(e,n){let r=
|
|
9663
|
+
`}#De(e,n){let r=hw(this.orientation,this.#q,this.#J,this.#Y),i=r.cross,a=this.orientation===`horizontal`,o;o=this.valueMode===`single`||e===`a`?this.#D():e===`b`?this.#O():this.#k();let c=gw(o,this.singleStyle,r,this.orientation),l=this.#ue(`--marker-offset`,0),u=this.#ue(`--marker-length`,.8),d=this.#ue(`--marker-thickness`,.15),f=this.#ue(`--marker-border-width`,0),p=a?{x:c.x,y:r.crossCentre+i/2*l}:{x:r.crossCentre+i/2*l,y:c.y},m=this.valueMode===`single`&&this.singleStyle===`unipolar`?a?{x:2*r.centre-p.x,y:p.y}:{x:p.x,y:2*r.centre-p.y}:void 0,h=e??`s`,g=e===`c`&&this.markerStyleC?this.markerStyleC:this.markerStyle;if(g===`dot`){let{rx:e,ry:r}=this.#ie(this.#re(),i),a=(i,a,o)=>f>0?(n.push(s`<ellipse id="dot-${o}-path" cx="${i}" cy="${a}" rx="${e}" ry="${r}" />`),s`
|
|
9626
9664
|
<use href="#dot-${o}-path" class="marker-border" />
|
|
9627
9665
|
<use href="#dot-${o}-path" class="marker-fill" />
|
|
9628
9666
|
`):s`<ellipse cx="${i}" cy="${a}" rx="${e}" ry="${r}" />`,o=a(p.x,p.y,h);return m?s`${o}${a(m.x,m.y,`${h}-low`)}`:o}if(g===`needle`){let e=u*i/4,r=(r,i,o)=>{let c,l;a?(c={x:r,y:i-e},l={x:r,y:i+e}):(c={x:r-e,y:i},l={x:r+e,y:i});let u=`M ${c.x} ${c.y} L ${l.x} ${l.y}`;return f>0?(n.push(s`<path id="needle-${o}-path" d="${u}" />`),s`
|
|
@@ -9631,7 +9669,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9631
9669
|
`):s`<path d="${u}" stroke-linecap="round" />`},o=r(p.x,p.y,h);return m?s`${o}${r(m.x,m.y,`${h}-low`)}`:o}if(g===`triangle`){let e=u*i/4,r=d*i/4,o=(i,o,c)=>{let l,u,d;a?(l={x:i,y:o},u={x:i-r,y:o+e},d={x:i+r,y:o+e}):(l={x:i,y:o},u={x:i+e,y:o-r},d={x:i+e,y:o+r});let p=`${l.x},${l.y} ${u.x},${u.y} ${d.x},${d.y}`;return f>0?(n.push(s`<polygon id="triangle-${c}-path" points="${p}" />`),s`
|
|
9632
9670
|
<use href="#triangle-${c}-path" class="marker-border" />
|
|
9633
9671
|
<use href="#triangle-${c}-path" class="marker-fill" />
|
|
9634
|
-
`):s`<polygon points="${p}" />`},c=o(p.x,p.y,h);return m?s`${c}${o(m.x,m.y,`${h}-low`)}`:c}return s``}#Oe(){if(this.valueMode!==`single`||this.singleStyle!==`bipolar`&&this.singleStyle!==`unipolar`)return s``;let e=
|
|
9672
|
+
`):s`<polygon points="${p}" />`},c=o(p.x,p.y,h);return m?s`${c}${o(m.x,m.y,`${h}-low`)}`:c}return s``}#Oe(){if(this.valueMode!==`single`||this.singleStyle!==`bipolar`&&this.singleStyle!==`unipolar`)return s``;let e=hw(this.orientation,this.#q,this.#J,this.#Y),n=e.cross,r=this.orientation===`horizontal`,i=this.#ue(`--midpoint-length`,.15)*n/4,a=r?{x:e.centre,y:e.crossCentre}:{x:e.crossCentre,y:e.centre};if(this.markerStyle===`dot`){let e=this.#ue(`--midpoint-thickness`,.08),r=this.#$>0?e*this.#$/2:n/2*e,{rx:i,ry:o}=this.#ie(r,n);return s`
|
|
9635
9673
|
<g class="midpoint-marker" part="midpoint-marker">
|
|
9636
9674
|
<ellipse cx="${a.x}" cy="${a.y}" rx="${i}" ry="${o}" />
|
|
9637
9675
|
</g>
|
|
@@ -9651,7 +9689,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9651
9689
|
aria-orientation="${this.orientation}"
|
|
9652
9690
|
aria-valuemin="${this.min}" aria-valuemax="${this.max}"
|
|
9653
9691
|
aria-valuenow="${i}"
|
|
9654
|
-
part="${r}">${n}</g>`}#Ae(){return this.valueMode!==`single`}willUpdate(e){if(super.willUpdate(e),(e.has(`valueA`)||e.has(`valueB`)||!this.hasUpdated)&&(this.#t=this.valueA,this.#n=this.valueB),this.valueMode===`triple`){this.valueC===void 0||!this.#y||e.has(`valueMode`)?(this.#r=(this.#t+this.#n)/2,this.valueC=this.#r,this.#y=!0):this.#r=this.valueC;let n=Math.min(this.#t,this.#n),r=Math.max(this.#t,this.#n);this.#r<n&&(this.#r=n),this.#r>r&&(this.#r=r),this.valueC=this.#r}else this.#r=void 0;if(e.has(`valueA`)||e.has(`valueB`)||e.has(`valueMode`)||e.has(`singleStyle`)||!this.hasUpdated){let e=this.#e.get(`value`);e&&e.type===`value`&&(this.valueMode===`single`?this.#je(e,this.#D()):(e.valueMin=
|
|
9692
|
+
part="${r}">${n}</g>`}#Ae(){return this.valueMode!==`single`}willUpdate(e){if(super.willUpdate(e),(e.has(`valueA`)||e.has(`valueB`)||!this.hasUpdated)&&(this.#t=this.valueA,this.#n=this.valueB),this.valueMode===`triple`){this.valueC===void 0||!this.#y||e.has(`valueMode`)?(this.#r=(this.#t+this.#n)/2,this.valueC=this.#r,this.#y=!0):this.#r=this.valueC;let n=Math.min(this.#t,this.#n),r=Math.max(this.#t,this.#n);this.#r<n&&(this.#r=n),this.#r>r&&(this.#r=r),this.valueC=this.#r}else this.#r=void 0;if(e.has(`valueA`)||e.has(`valueB`)||e.has(`valueMode`)||e.has(`singleStyle`)||!this.hasUpdated){let e=this.#e.get(`value`);e&&e.type===`value`&&(this.valueMode===`single`?this.#je(e,this.#D()):(e.valueMin=xw(this.#A(),this.min,this.max),e.valueMax=xw(this.#j(),this.min,this.max)))}}#je(e,n){this.singleStyle===`bipolar`?(e.valueMin=Math.min(.5,n),e.valueMax=Math.max(.5,n)):(e.valueMin=0,e.valueMax=n)}render(){this.#te(),this.#q=this.#se();let e=this.#ce(this.#q);this.#J=e.start,this.#Y=e.end;let n=Array.from(this.#e.values()),r=this.disabled?`not-allowed`:this.valueMode===`single`?`pointer`:`default`,a=this.#Ae()?this.valueMode===`triple`?[`a`,`b`,`c`]:[`a`,`b`]:[],o=[],c=this.#Ae()?a.map(e=>this.#ke(e,this.#De(e,o))):this.#ke(void 0,this.#De(void 0,o));return i`
|
|
9655
9693
|
<svg
|
|
9656
9694
|
class="slider-svg"
|
|
9657
9695
|
viewBox="${this.#Ce()}"
|
|
@@ -9670,7 +9708,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9670
9708
|
${this.#Oe()}
|
|
9671
9709
|
${c}
|
|
9672
9710
|
</svg>
|
|
9673
|
-
`}#Me(e){if(this.disabled)return`not-allowed`;if(this.#i)return`grabbing`;let n=.06;if(this.valueMode===`single`){if(this.singleStyle===`unipolar`){let r=this.#D()/2,i=.5-r,a=.5+r;return Math.abs(e-i)<n||Math.abs(e-a)<n?`grab`:`pointer`}let r=this.#D();return Math.abs(e-r)<n?`grab`:`pointer`}let r=this.#D(),i=this.#O(),a=Math.min(r,i),o=Math.max(r,i);if(Math.abs(e-r)<n||Math.abs(e-i)<n)return`grab`;if(this.valueMode===`triple`){let r=this.#k();if(Math.abs(e-r)<n)return`grab`}return e>a&&e<o?this.valueDrag===`none`?`default`:`move`:`pointer`}#Ne;#Pe;updated(e){if(super.updated(e),this.valueMode===`single`)this.style.setProperty(`--value-relative`,this.#D().toString());else{let e=
|
|
9711
|
+
`}#Me(e){if(this.disabled)return`not-allowed`;if(this.#i)return`grabbing`;let n=.06;if(this.valueMode===`single`){if(this.singleStyle===`unipolar`){let r=this.#D()/2,i=.5-r,a=.5+r;return Math.abs(e-i)<n||Math.abs(e-a)<n?`grab`:`pointer`}let r=this.#D();return Math.abs(e-r)<n?`grab`:`pointer`}let r=this.#D(),i=this.#O(),a=Math.min(r,i),o=Math.max(r,i);if(Math.abs(e-r)<n||Math.abs(e-i)<n)return`grab`;if(this.valueMode===`triple`){let r=this.#k();if(Math.abs(e-r)<n)return`grab`}return e>a&&e<o?this.valueDrag===`none`?`default`:`move`:`pointer`}#Ne;#Pe;updated(e){if(super.updated(e),this.valueMode===`single`)this.style.setProperty(`--value-relative`,this.#D().toString());else{let e=xw(this.#A(),this.min,this.max),n=xw(this.#j(),this.min,this.max);this.style.setProperty(`--value-min-relative`,e.toString()),this.style.setProperty(`--value-max-relative`,n.toString()),this.style.setProperty(`--value-relative`,n.toString()),this.valueMode===`triple`&&this.#r!==void 0&&this.style.setProperty(`--value-c-relative`,xw(this.#r,this.min,this.max).toString())}}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`keydown`,this.#w),this.removeEventListener(`pointerdown`,this.#pe),this.removeEventListener(`pointermove`,this.#me),this.removeEventListener(`pointerenter`,this.#he),this.#x?.disconnect(),this.#x=void 0,this.#S?.disconnect(),this.#S=void 0,this.#_!==void 0&&(clearTimeout(this.#_),this.#_=void 0),this.#ye()}static{this.styles=[w,cn,r`
|
|
9674
9712
|
:host {
|
|
9675
9713
|
display: inline-block;
|
|
9676
9714
|
width: 200px;
|
|
@@ -9815,7 +9853,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9815
9853
|
stroke-width: var(--midpoint-border-width, 0);
|
|
9816
9854
|
vector-effect: non-scaling-stroke;
|
|
9817
9855
|
}
|
|
9818
|
-
`]}};E([d({type:Number,attribute:`value-a`})],
|
|
9856
|
+
`]}};E([d({type:Number,attribute:`value-a`})],ww.prototype,`valueA`,void 0),E([d({type:Number,attribute:`value-b`})],ww.prototype,`valueB`,void 0),E([d({type:Number,attribute:`value-c`})],ww.prototype,`valueC`,void 0),E([d({type:Number})],ww.prototype,`min`,void 0),E([d({type:Number})],ww.prototype,`max`,void 0),E([d({type:Number})],ww.prototype,`step`,void 0),E([d({type:Number})],ww.prototype,`stops`,void 0),E([d({type:String,attribute:`value-mode`})],ww.prototype,`valueMode`,void 0),E([d({type:String,attribute:`single-style`})],ww.prototype,`singleStyle`,void 0),E([d({type:String})],ww.prototype,`orientation`,void 0),E([d({type:String,attribute:`marker-style`})],ww.prototype,`markerStyle`,void 0),E([d({type:String,attribute:`marker-style-c`})],ww.prototype,`markerStyleC`,void 0),E([d({type:String})],ww.prototype,`crossover`,void 0),E([d({type:String,attribute:`value-drag`})],ww.prototype,`valueDrag`,void 0),E([d({type:String,attribute:`value-c-follow`})],ww.prototype,`valueCFollow`,void 0),E([d({type:Number,attribute:`value-min`})],ww.prototype,`valueMin`,void 0),E([d({type:Boolean,reflect:!0})],ww.prototype,`disabled`,void 0),E([d({type:Boolean,reflect:!0})],ww.prototype,`swipeable`,void 0),ww=E([T(`ixfx-slider-input`)],ww);let Tw=class extends ug{constructor(...e){super(...e),this.inputSelector=`ixfx-slider-input`,this.orientation=`horizontal`,this.singleStyle=`range`,this.markerStyle=`needle`,this.stops=void 0,this.disabled=!1,this.swipeable=!1,this.lighttouch=!1,this.switchHeight=80}_renderEditableNumber(){return this._isMini?i``:i`
|
|
9819
9857
|
<ixfx-editable-number
|
|
9820
9858
|
class="number"
|
|
9821
9859
|
mode="label"
|
|
@@ -9954,7 +9992,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
9954
9992
|
width: 100%;
|
|
9955
9993
|
height: 100%;
|
|
9956
9994
|
}
|
|
9957
|
-
`}};E([d({type:String})],
|
|
9995
|
+
`}};E([d({type:String})],Tw.prototype,`orientation`,void 0),E([d({type:String,attribute:`single-style`})],Tw.prototype,`singleStyle`,void 0),E([d({type:String,attribute:`marker-style`})],Tw.prototype,`markerStyle`,void 0),E([d({type:Number})],Tw.prototype,`stops`,void 0),E([d({type:Boolean,reflect:!0})],Tw.prototype,`disabled`,void 0),E([d({type:Boolean,reflect:!0})],Tw.prototype,`swipeable`,void 0),E([d({type:Boolean})],Tw.prototype,`lighttouch`,void 0),E([d({type:Number,attribute:`switch-height`})],Tw.prototype,`switchHeight`,void 0),Tw=E([T(`ixfx-labelled-slider-input`)],Tw);let Ew=class extends n{constructor(...e){super(...e),this.value=0,this.lit=!1,this.color=`oklch(50% 0.15 25)`,this.glow=!1,this.mode=`brightness`,this.blinking=!1,this.rate=500,this.attackTime=40,this.releaseTime=400,this.pulseRetrigger=!1,this.#t=`brightness`,this.#r=0,this.#i=0,this.#a=0,this.#o=0,this.#c=e=>{let n=Math.max(0,this.attackTime),r=Math.max(0,this.releaseTime),i=this.#a,a=this.#i,o=e-this.#r,s;s=n>0&&o<n?i+(a-i)*(o/n):o<n+r&&r>0?a*(1-(o-n)/r):0,s=Math.max(0,Math.min(Math.max(i,a),s)),this.#o=s,this.style.setProperty(`--value`,String(s)),o<n+r?this.#n=requestAnimationFrame(this.#c):(this.#n=void 0,this.#o=0)}}#e;#t;#n;#r;#i;#a;#o;willUpdate(e){if(e.has(`blinking`)&&(this.blinking?this.mode=`blink`:this.mode===`blink`&&(this.mode=`brightness`)),this.mode!==this.#t&&(this.#t=this.mode,this.#s()),e.has(`lit`)&&(this.lit?this.value=1:e.get(`lit`)!==void 0&&(this.value=0)),e.has(`color`)&&this.style.setProperty(`--_color-attr`,this.color),this.mode!==`pulse`&&(e.has(`value`)||e.has(`lit`))&&this.style.setProperty(`--value`,String(this.value)),e.has(`rate`)){this.#u();let e=this.rate<300?this.rate*.5:150;this.style.setProperty(`--transition-duration`,`${e}ms`)}}disconnectedCallback(){super.disconnectedCallback(),this.#d(),this.#l()}pulse(){this.mode===`pulse`&&(this.#i=this.value,this.#a=this.pulseRetrigger?0:this.#o,this.#r=performance.now(),this.#n===void 0&&(this.#n=requestAnimationFrame(this.#c)))}#s(){this.#l(),this.#o=0,this.blinking=this.mode===`blink`,this.#u(),this.style.setProperty(`--value`,this.mode===`pulse`?`0`:String(this.value))}#c;#l(){this.#n!==void 0&&(cancelAnimationFrame(this.#n),this.#n=void 0)}#u(){let e=this.#e!==void 0;this.#d(),this.mode===`blink`&&this.rate>0?this.#e=window.setInterval(()=>{this.value=+(this.value===0)},this.rate):(e||this.mode===`blink`)&&(this.value=0)}#d(){this.#e!==void 0&&(clearInterval(this.#e),this.#e=void 0)}render(){return i`<div part="circle"></div>`}static{this.styles=r`
|
|
9958
9996
|
:host {
|
|
9959
9997
|
--_size: var(--size, 1ex);
|
|
9960
9998
|
/* Resolved colour: explicit --colour wins, then the \`color\` attribute, then a default. */
|
|
@@ -10023,7 +10061,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10023
10061
|
:host([mode="pulse"]) div {
|
|
10024
10062
|
transition: none;
|
|
10025
10063
|
}
|
|
10026
|
-
`}};E([d({type:Number})],xw.prototype,`value`,void 0),E([d({type:Boolean,attribute:`lit`,reflect:!0})],xw.prototype,`lit`,void 0),E([d({type:String})],xw.prototype,`color`,void 0),E([d({type:Boolean,attribute:`glow`,reflect:!0})],xw.prototype,`glow`,void 0),E([d({type:String,reflect:!0})],xw.prototype,`mode`,void 0),E([d({type:Boolean,attribute:`blinking`,reflect:!0})],xw.prototype,`blinking`,void 0),E([d({type:Number,attribute:`rate`})],xw.prototype,`rate`,void 0),E([d({type:Number,attribute:`attack-time`})],xw.prototype,`attackTime`,void 0),E([d({type:Number,attribute:`release-time`})],xw.prototype,`releaseTime`,void 0),E([d({type:Boolean,attribute:`pulse-retrigger`})],xw.prototype,`pulseRetrigger`,void 0),xw=E([T(`ixfx-led`)],xw);let Sw=class extends n{constructor(...e){super(...e),this.headers=!1,this.stretchLastColumn=!1,this.interactionMode=`standard`,this.selectionFilter=`leaf`,this.exclusivity=`none`,this._columns=[],this._selectedByDepth=new Map,this._selectedKeys=new Set,this._selectedNodes=new Set,this.#n=new Map,this.#o=-1,this.#s=0,this.#c=0,this.search=new Vt(this,{adapter:Wt(this,{labelSelector:`.label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>{let e=[];for(let n=0;n<this._columns.length;n++){let r=this._columns[n];if(r)for(let i of r)e.push({id:this.#m(i,n)})}return e}}),this.#_=`user`,this.#v=!1,this.#Y=e=>{if(this.search.isOpen)return;let n=this.#U(),r=this._columns[n];if(!r||r.length===0){let e=this._columns[0];e&&e.length>0&&(this.tickled.setTickled(this.#m(e[0],0)),this.requestUpdate());return}switch(e.key){case`ArrowDown`:e.preventDefault(),this.#J(r,n,e,e=>Math.min(e+1,r.length-1));break;case`ArrowUp`:e.preventDefault(),this.#J(r,n,e,e=>Math.max(e-1,0));break;case`Home`:e.preventDefault(),this.#J(r,n,e,()=>0,!0);break;case`End`:e.preventDefault(),this.#J(r,n,e,()=>r.length-1,!0);break;case`PageUp`:e.preventDefault(),this.#J(r,n,e,e=>Math.max(e-this.#q(n),0),!0);break;case`PageDown`:e.preventDefault(),this.#J(r,n,e,e=>Math.min(e+this.#q(n),r.length-1),!0);break;case`ArrowRight`:{e.preventDefault();let i=this.#W();if(!i){r.length>0&&(this.#K(r[0],n),this.requestUpdate());return}let{node:a,depth:o}=i;if(this.interactionMode===`vscode`||this.interactionMode===`standard`?(this._selectedByDepth.set(o,a),this.#R(a,o)):this.#F(a,o),this._columns.length>o+1){let e=this._columns[o+1];e&&e.length>0&&this.#K(e[0],o+1)}this.requestUpdate();break}case`ArrowLeft`:if(e.preventDefault(),n>0){this.#M(),this._columns=this._columns.slice(0,n);let e=this._columns[n-1];if(e&&e.length>0){let r=this._selectedByDepth.get(n-1),i=r&&e.includes(r)?r:e[0];this.#K(i,n-1)}this.requestUpdate()}break;case`Enter`:{e.preventDefault();let n=this.#W();if(!n)return;let{node:i,depth:a,index:o}=n;if(this.interactionMode===`standard`||this.interactionMode===`vscode`){if(e.shiftKey&&this.#t?.depth===a){let e=Math.min(this.#t.index,o),n=Math.max(this.#t.index,o);this._selectedKeys=new Set(r.slice(e,n+1).map(e=>e.item.key))}else this._selectedKeys.add(i.item.key),this.#t={key:i.item.key,depth:a,index:o}}else this._selectedByDepth.set(a,i);this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:i,depth:a},bubbles:!0,composed:!0})),this.requestUpdate();break}case`Escape`:if(e.preventDefault(),this.#M(),this._columns.length>1){this._columns=this._columns.slice(0,-1);let e=Math.max(0,n-1),r=this._columns[e];if(r&&r.length>0){let n=this._selectedByDepth.get(e),i=n&&r.includes(n)?n:r[0];this.#K(i,e)}this.requestUpdate()}}},this.#X=(e,n)=>{e.preventDefault(),e.stopPropagation(),this.#o=n,this.#s=e.clientX;let r=this.shadowRoot?.querySelectorAll(`.column`)[n];this.#c=r?r.getBoundingClientRect().width:200,window.addEventListener(`pointermove`,this.#$),window.addEventListener(`pointerup`,this.#te)},this.#Z=null,this.#Q=0,this.#$=e=>{this.#o<0||(this.#Q=Math.max(32,this.#c+(e.clientX-this.#s)),this.#Z??=requestAnimationFrame(this.#ee))},this.#ee=()=>{this.#Z=null,!(this.#o<0)&&(this.shadowRoot?.querySelectorAll(`.column`)[this.#o])?.setAttribute(`style`,this.#re(this.#Q))},this.#te=()=>{this.#Z!==null&&(cancelAnimationFrame(this.#Z),this.#Z=null),this.#o>=0&&this.#Q>0&&(this.#n.set(this.#o,this.#Q),this.requestUpdate()),this.#Q=0,this.#o=-1,window.removeEventListener(`pointermove`,this.#$),window.removeEventListener(`pointerup`,this.#te)}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;get registry(){return this.#u}#f(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#p(){this.#u&&(this.search.setModes(this.#f()),this.#d?.(),this.#d=Rt(this.#u,this.search))}#m(e,n){return`${n}:${e.item.key}`}get#h(){return this.viewRoot??this.root}#g(){let e=this.tickled.tickledId;if(!e)return;let n=e.indexOf(`:`);if(!(n<0))return Number(e.substring(0,n))}updated(e){if(e.has(`searchModes`)&&this.#p(),e.has(`root`)&&this.root){this.#M(),this.viewRoot!==void 0&&(this.viewRoot=void 0),this._selectedByDepth.clear(),this._selectedKeys=new Set,this._selectedNodes.clear(),this.#e=void 0,this.#t=void 0,this.tickled.clearTickled();let e=this.#h;this._columns=e?.children?[e.children]:[]}if(e.has(`viewRoot`)&&this.#x(),e.has(`model`)){this.#l?.(),this.#l=void 0;let e=this.model;e&&(this.root=e.root,this.#l=e._subscribe(e=>{if(e.type===`root`)this.root=e.root,this.requestUpdate();else if(e.type===`invalidate`){for(let n=0;n<this._columns.length-1;n++)if(this._columns[n]?.some(n=>n.item.key===e.key)){this._columns=this._columns.slice(0,n+1),this.requestUpdate();break}}}))}if(this.#r?.children!==void 0&&this._loadingDepth!==void 0){let e=this._loadingDepth,n=this.#r.children;this.#r=void 0,this.#i=void 0,this._loadingDepth=void 0;let r=this._columns.slice(0,e);n.length>0&&r.push(n),this._columns=r}let n=e.get(`_columns`),r=e.has(`_columns`)&&(n?.length??0)<this._columns.length,i=e.has(`_loadingDepth`)&&this._loadingDepth!==void 0;if(r||i){let e=this.shadowRoot?.querySelector(`#container`);e?.scrollTo({left:e.scrollWidth,behavior:`smooth`})}}connectedCallback(){super.connectedCallback(),this.#u??=Yt(),this.#p()}disconnectedCallback(){super.disconnectedCallback(),this.#l?.(),this.#l=void 0,this.#d?.(),this.#d=void 0,this.#u=void 0}getConfig(){let e={};for(let[n,r]of this.#n)e[n]=r;return{columnWidths:e}}setConfig(e){this.#n.clear();for(let[n,r]of Object.entries(e.columnWidths))this.#n.set(Number(n),r);this.requestUpdate()}get selectedKeys(){return this._selectedKeys}set selectedKeys(e){this._selectedKeys=new Set(e),this.requestUpdate()}get selectedNode(){return this.#e}set selectedNode(e){this.#e=e,e&&(this.interactionMode===`implicit`||this.interactionMode===`standard`)&&(this._selectedKeys=new Set([e.item.key])),this.requestUpdate()}get selectedNodes(){return this._selectedNodes}select(e){if(!this.#A(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.add(e),this._selectedKeys.add(e.item.key),this.#e=e,this.#j(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this._selectedKeys.delete(e.item.key),this.#e===e&&(this.#e=[...this._selectedNodes].at(-1)),this.#j(n),this.requestUpdate()}clearSelection(){let e=new Set(this._selectedNodes);this._selectedKeys=new Set,this._selectedNodes.clear(),this.#e=void 0,e.size>0&&this.#j(e),this.requestUpdate()}selectAll(){}deselectAll(){}setSelected(e,n){this.interactionMode===`checked`?this.#H(e,n):n?(this._selectedKeys.add(e.item.key),this._selectedNodes.add(e)):(this._selectedKeys.delete(e.item.key),this._selectedNodes.delete(e)),this.requestUpdate()}getSelected(){let e=[];for(let n of this._columns)for(let r of n)this._selectedKeys.has(r.item.key)&&e.push(r);return e}navigateTo(e,n={}){let r=this.#h;if(!r?.children)return!1;let i=this.#_,a=this.#v;this.#_=`programmatic`,this.#v=n.silent===!0;try{return this.#y(r.children,e,n.reveal??`edge`)}finally{this.#_=i,this.#v=a}}invalidateStructure(){let e=new Set;for(let n of this._columns)for(let r of n)e.add(r);for(let e=0;e<this._columns.length;e++){let n=this._selectedByDepth.get(e);if(n&&!this._columns[e].includes(n)){this._columns=this._columns.slice(0,e+1);for(let n of[...this._selectedByDepth.keys()])n>=e&&this._selectedByDepth.delete(n);break}}for(let n of[...this._selectedNodes])e.has(n)||this._selectedNodes.delete(n);this.requestUpdate()}#_;#v;#y(e,n,r){this.#M(),this._selectedByDepth.clear(),this.tickled.clearTickled();let i=[e],a=e,o=!0,s,c=0;for(let e=0;e<n.length;e++){let r=a.findIndex(r=>r.item.key===n[e]);if(r<0){o=!1;break}let l=a[r];if(this._selectedByDepth.set(e,l),s=l,c=e,l.item.isLeaf||!l.children||l.children.length===0){e<n.length-1&&(o=!1);break}i.push(l.children),a=l.children}if(this._columns=i,s&&this.tickled.setTickled(this.#m(s,c)),this.interactionMode!==`implicit`&&this.interactionMode!==`manual`){let e=n.at(-1);e&&(this._selectedKeys=new Set([e]))}return this.requestUpdate(),this.#G(r===`center-if-hidden`?`auto`:`smooth`,r),o}navigateToNode(e){let n=this.#h;if(!n?.children)return!1;let r=this.#b(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=this.#h;if(!n?.children)return!1;let r=this.#b(n.children,n=>n.item.key===e);if(!r)return!1;let i=[n.children],a=n.children,o,s=0;for(let e=0;e<r.length;e++){let n=a.find(n=>n.item.key===r[e]);if(!n)return!1;if(o=n,s=e,n.children&&n.children.length>0)i.push(n.children),a=n.children;else break}return this._columns=i,o&&this.tickled.setTickled(this.#m(o,s)),this.requestUpdate(),this.#G(),!0}selectMany(e){let n=this.selectionFilter===`none`?[]:[...e],r=new Set(this._selectedNodes);this._selectedNodes=new Set(n),this._selectedKeys=new Set(n.map(e=>e.item.key)),this.#e=n.at(-1),this.#j(r),this.requestUpdate()}getNodes(){let e=this.#h;if(!e?.children)return[];let n=[],r=(e,i)=>{if(n.push({node:e,depth:i}),e.children)for(let n of e.children)r(n,i+1)};for(let n of e.children)r(n,0);return n}#b(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#b(i.children,n,e);if(r)return r}}}#x(){this.#M();let e=new Set(this._selectedNodes);this._selectedByDepth.clear(),this._selectedKeys=new Set,this._selectedNodes.clear(),this.#e=void 0,this.#t=void 0,this.tickled.clearTickled();let n=this.#h;n?.children===void 0?n?(this._columns=[],this.#z(n,-1,!1)):(this._columns=[],this._loadingDepth=void 0):(this._columns=n.children?[n.children]:[],this._loadingDepth=void 0),e.size>0&&this.#j(e)}rebaseTo(e){if(e===void 0)return this.#S();let n=typeof e==`string`?this.#w(e):e;return!n||n.item.isLeaf===!0||n===this.viewRoot||n.item.key===this.viewRoot?.item.key?!1:n===this.root||!this.viewRoot&&n.item.key===this.root?.item.key?this.#S():(this.viewRoot=n,this.#C(),!0)}rebaseUp(){if(!this.viewRoot)return!1;let e=this.#E(this.viewRoot);return e?e===this.root?this.#S():(this.viewRoot=e,this.#C(),!0):!1}#S(){return this.viewRoot!==void 0&&(this.viewRoot=void 0,this.#C(),!0)}#C(){let e=this.viewRoot,n={viewRoot:e,path:e?this.#O(e):[]};this.dispatchEvent(new CustomEvent(`rebase`,{detail:n,bubbles:!0,composed:!0}))}#w(e){if(this.root)return this.root.item.key===e?this.root:this.#T(this.root.children??[],e)}#T(e,n){for(let r of e){if(r.item.key===n)return r;if(r.children){let e=this.#T(r.children,n);if(e)return e}}}#E(e){if(!(!this.root||e===this.root))return this.#D(this.root,e)}#D(e,n){if(e.children)for(let r of e.children){if(r===n||r.item.key===n.item.key)return e;let i=this.#D(r,n);if(i)return i}}#O(e){let n=[e],r=this.#E(e);for(;r&&(n.unshift(r),r!==this.root);)r=this.#E(r);return n}renderColumnContent(e,n){return console.warn(`ixfx-miller-base: renderColumnContent not overridden. depth=${n}, nodes=${e.length}`),a}_handleItemClick(e,n,r){this.#F(e,n,r)}_handleCheckboxClick(e,n,r){e.stopPropagation(),this.#B(n)}_handleItemDblClick(e,n,r){this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}_handleItemRightClick(e,n,r){this.dispatchEvent(new CustomEvent(`item-rightclick`,{detail:{node:e,depth:n,mouseEvent:r},bubbles:!0,composed:!0}))}_handleHeaderRightClick(e,n){let r=this.#ne(n),i=this.#N(n);this.dispatchEvent(new CustomEvent(`header-rightclick`,{detail:{depth:n,label:r,path:i,mouseEvent:e},bubbles:!0,composed:!0}))}_isSelected(e,n){return this.interactionMode===`implicit`?this._selectedByDepth.get(n)===e:this._selectedKeys.has(e.item.key)}#k(e,n){let r=this._columns[n+1];return r!==void 0&&e.children===r}_isOpen(e,n){return this.#k(e,n)}getItemState(e,n){let r=this._columns[n]?.find(n=>n.item.key===e);if(r)return{selected:this._isSelected(r,n),open:this.#k(r,n),focused:this._isFocused(r,n),isLeaf:r.item.isLeaf??!1}}#A(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf!==!1:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#j(e){if(this.#v)return;let n={selected:new Set(this._selectedNodes),previous:e,origin:this.#_};this.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}#M(){if(this.#a!==void 0&&(clearTimeout(this.#a),this.#a=void 0),this.#i){let e=this.#r,n=this._loadingDepth;this.#i.abort(),this.#i=void 0,this.#r=void 0,this._loadingDepth=void 0,e&&n!==void 0&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}}#N(e){let n=[];this.#h&&n.push(this.#h);for(let r=0;r<e;r++){let e=this._selectedByDepth.get(r);e&&n.push(e)}return n}#P(e){let n={depth:e,label:this.#ne(e),path:this.#N(e)};this.dispatchEvent(new CustomEvent(`header-click`,{detail:n,bubbles:!0,composed:!0}))}#F(e,n,r){switch(this._loadingDepth!==void 0&&this._loadingDepth>n&&this.#M(),this.tickled.setTickled(this.#m(e,n)),this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e,depth:n},bubbles:!0,composed:!0})),this.interactionMode){case`implicit`:this.#I(e,n);break;case`standard`:this.#L(e,n,r);break;case`vscode`:this.#L(e,n,r);break;case`manual`:break;case`checked`:this.#R(e,n,!0)}}#I(e,n){let r=new Set(this._selectedNodes);this._selectedByDepth.set(n,e),this.#e=e,this._selectedKeys=new Set([e.item.key]),this._selectedNodes.clear(),this._selectedNodes.add(e),this.#R(e,n,!0),r.has(e)||this.#j(r)}#L(e,n,r){let i=this._columns[n],a=i?i.indexOf(e):-1,o=r?r.metaKey||r.ctrlKey:!1,s=r?r.shiftKey:!1;if(o){this._selectedKeys.has(e.item.key)?(this._selectedKeys.delete(e.item.key),this._selectedNodes.delete(e)):(this._selectedKeys.add(e.item.key),this._selectedNodes.add(e)),this.#t=a>=0?{key:e.item.key,depth:n,index:a}:this.#t,this.requestUpdate();return}if(s&&this.#t&&this.#t.depth===n&&i){let e=Math.min(this.#t.index,a),n=Math.max(this.#t.index,a),r=i.slice(e,n+1);this._selectedKeys=new Set(r.map(e=>e.item.key)),this._selectedNodes=new Set(r),this.requestUpdate();return}let c=new Set(this._selectedNodes);this._selectedKeys=new Set([e.item.key]),this._selectedNodes=new Set([e]),this.#t=a>=0?{key:e.item.key,depth:n,index:a}:void 0,this._selectedByDepth.set(n,e),this.#e=e,this.#R(e,n,!0),(!c.has(e)||c.size!==1)&&this.#j(c)}#R(e,n,r=!1){if(e.item.isLeaf){this._columns=this._columns.slice(0,n+1),this.requestUpdate();return}if(e.children===void 0)this.#z(e,n,!0,r);else{let r=this._columns.slice(0,n+1);r.push(e.children),this._columns=r,this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}}#z(e,n,r,i=!1){let a=n+1;this._columns=this._columns.slice(0,a),this._loadingDepth=a,this.#i?.abort(),this.#r=e;let o=new AbortController;this.#i=o,r&&this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}));let s=n=>{if(o.signal.aborted)return;e.children=n,this.#r=void 0,this.#i=void 0,this._loadingDepth=void 0;let r=this._columns.slice(0,a);n.length>0&&r.push(n),this._columns=r},c=n=>{n.name!==`AbortError`&&console.error(n),e.children=[],this.#r=void 0,this.#i=void 0,this._loadingDepth=void 0,this.requestUpdate()};if(this.model||this.loadChildren){this.#a!==void 0&&(clearTimeout(this.#a),this.#a=void 0);let n=()=>{this.#a=void 0,this.#r===e&&(this.model?this.model.getChildren(e,a-1,o.signal):gg(this.loadChildren({node:e,depth:a-1},o.signal),o.signal)).then(e=>s([...e])).catch(c)};i?n():this.#a=setTimeout(n,150)}else{this._loadingDepth=void 0,this.#r=void 0,this.#i=void 0;let e=this._columns.slice(0,a);e.push([]),this._columns=e}}#B(e){let n=new Set(this._selectedNodes),r=this._selectedKeys.has(e.item.key);(e.children?.length?this.#V(e):r)?this.#H(e,!1):this.#H(e,!0),this.requestUpdate(),this.#j(n)}#V(e){return this._selectedKeys.has(e.item.key)?!e.children?.length||e.children.every(e=>this.#V(e)):!1}#H(e,n){if(n?(this._selectedKeys.add(e.item.key),this._selectedNodes.add(e)):(this._selectedKeys.delete(e.item.key),this._selectedNodes.delete(e)),e.children)for(let r of e.children)this.#H(r,n)}#U(){return this.#g()??0}#W(){let e=this.tickled.tickledId;if(!e)return;let n=e.indexOf(`:`);if(n<0)return;let r=Number(e.substring(0,n)),i=e.substring(n+1),a=this._columns[r];if(!a)return;let o=a.findIndex(e=>e.item.key===i);if(!(o<0))return{node:a[o],depth:r,index:o}}#G(e=`smooth`,n=`edge`){requestAnimationFrame(()=>{let r=this.#W();if(!r)return;let i=this.shadowRoot?.querySelectorAll(`.column`)[r.depth]?.querySelector(`.column-content`);if(!i)return;let a=i.querySelectorAll(`.item`)[r.index];if(a){if(n===`center-if-hidden`){let n=a.getBoundingClientRect(),r=i.getBoundingClientRect(),o=n.top<r.top||n.bottom>r.bottom;a.scrollIntoView({block:o?`center`:`nearest`,inline:`nearest`,behavior:e});return}a.scrollIntoView({block:`nearest`,behavior:e})}})}#K(e,n){this.tickled.setTickled(this.#m(e,n)),this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}#q(e){let n=this.shadowRoot?.querySelectorAll(`.column`)[e]?.querySelector(`.column-content`),r=n?.querySelector(`.item`);return!n||!r||r.offsetHeight===0?10:Math.max(1,Math.floor(n.clientHeight/r.offsetHeight)-1)}#J(e,n,r,i,a=!1){let o=this.#W(),s=i(o!==void 0&&o.depth===n?o.index:-1),c=e[s];if(c){if(this.#K(c,n),this.interactionMode===`standard`||this.interactionMode===`vscode`){let i=o?.index??0;if(r.shiftKey){if(!this.#t||this.#t.depth!==n){let r=e[i];r&&(this.#t={key:r.item.key,depth:n,index:i,selectionSnapshot:this.interactionMode===`vscode`?new Set(this._selectedKeys):void 0})}if(this.#t){let n=Math.min(this.#t.index,s),r=Math.max(this.#t.index,s),i=e.slice(n,r+1).map(e=>e.item.key);if(this.interactionMode===`vscode`){let e=this.#t.selectionSnapshot;for(let n of i)e.has(n)?this._selectedKeys.delete(n):this._selectedKeys.add(n)}else this._selectedKeys=new Set(i)}}else this.#t=this.interactionMode===`standard`?{key:c.item.key,depth:n,index:s}:void 0}this.requestUpdate(),a&&this.#G(`auto`)}}#Y;#X;#Z;#Q;#$;#ee;#te;#ne(e){if(e===0)return this.#h?.item.label??``;let n=this._selectedByDepth.get(e-1);if(n)return n.item.label;let r=this._columns[e-1],i=this._columns[e];if(r&&i){let e=r.find(e=>e.children===i);if(e)return e.item.label}return``}#re(e){return`width:${e}px;flex-grow:0;flex-shrink:0;flex-basis:auto;max-width:none`}#ie(e,n){let r=this.#n.get(e);return r===void 0?this.stretchLastColumn&&n?`width:max-content;flex-grow:1;flex-shrink:0;flex-basis:auto;min-width:0`:`width:max-content;flex-grow:0;flex-shrink:0;flex-basis:auto`:this.#re(r)}#ae(e,n){return this.tickled.isTickled(this.#m(e,n))}renderLoadingIndicator(){return i`<div class="loading-spinner"></div>`}#oe(){let e=this._loadingDepth,n=this.stretchLastColumn&&this.#n.get(e)===void 0;return i`
|
|
10064
|
+
`}};E([d({type:Number})],Ew.prototype,`value`,void 0),E([d({type:Boolean,attribute:`lit`,reflect:!0})],Ew.prototype,`lit`,void 0),E([d({type:String})],Ew.prototype,`color`,void 0),E([d({type:Boolean,attribute:`glow`,reflect:!0})],Ew.prototype,`glow`,void 0),E([d({type:String,reflect:!0})],Ew.prototype,`mode`,void 0),E([d({type:Boolean,attribute:`blinking`,reflect:!0})],Ew.prototype,`blinking`,void 0),E([d({type:Number,attribute:`rate`})],Ew.prototype,`rate`,void 0),E([d({type:Number,attribute:`attack-time`})],Ew.prototype,`attackTime`,void 0),E([d({type:Number,attribute:`release-time`})],Ew.prototype,`releaseTime`,void 0),E([d({type:Boolean,attribute:`pulse-retrigger`})],Ew.prototype,`pulseRetrigger`,void 0),Ew=E([T(`ixfx-led`)],Ew);let Dw=class extends n{constructor(...e){super(...e),this.headers=!1,this.stretchLastColumn=!1,this.interactionMode=`standard`,this.selectionFilter=`leaf`,this.exclusivity=`none`,this._columns=[],this._selectedByDepth=new Map,this._selectedKeys=new Set,this._selectedNodes=new Set,this.#n=new Map,this.#o=-1,this.#s=0,this.#c=0,this.search=new Vt(this,{adapter:Wt(this,{labelSelector:`.label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>{let e=[];for(let n=0;n<this._columns.length;n++){let r=this._columns[n];if(r)for(let i of r)e.push({id:this.#m(i,n)})}return e}}),this.#_=`user`,this.#v=!1,this.#Y=e=>{if(this.search.isOpen)return;let n=this.#U(),r=this._columns[n];if(!r||r.length===0){let e=this._columns[0];e&&e.length>0&&(this.tickled.setTickled(this.#m(e[0],0)),this.requestUpdate());return}switch(e.key){case`ArrowDown`:e.preventDefault(),this.#J(r,n,e,e=>Math.min(e+1,r.length-1));break;case`ArrowUp`:e.preventDefault(),this.#J(r,n,e,e=>Math.max(e-1,0));break;case`Home`:e.preventDefault(),this.#J(r,n,e,()=>0,!0);break;case`End`:e.preventDefault(),this.#J(r,n,e,()=>r.length-1,!0);break;case`PageUp`:e.preventDefault(),this.#J(r,n,e,e=>Math.max(e-this.#q(n),0),!0);break;case`PageDown`:e.preventDefault(),this.#J(r,n,e,e=>Math.min(e+this.#q(n),r.length-1),!0);break;case`ArrowRight`:{e.preventDefault();let i=this.#W();if(!i){r.length>0&&(this.#K(r[0],n),this.requestUpdate());return}let{node:a,depth:o}=i;if(this.interactionMode===`vscode`||this.interactionMode===`standard`?(this._selectedByDepth.set(o,a),this.#R(a,o)):this.#F(a,o),this._columns.length>o+1){let e=this._columns[o+1];e&&e.length>0&&this.#K(e[0],o+1)}this.requestUpdate();break}case`ArrowLeft`:if(e.preventDefault(),n>0){this.#M(),this._columns=this._columns.slice(0,n);let e=this._columns[n-1];if(e&&e.length>0){let r=this._selectedByDepth.get(n-1),i=r&&e.includes(r)?r:e[0];this.#K(i,n-1)}this.requestUpdate()}break;case`Enter`:{e.preventDefault();let n=this.#W();if(!n)return;let{node:i,depth:a,index:o}=n;if(this.interactionMode===`standard`||this.interactionMode===`vscode`){if(e.shiftKey&&this.#t?.depth===a){let e=Math.min(this.#t.index,o),n=Math.max(this.#t.index,o);this._selectedKeys=new Set(r.slice(e,n+1).map(e=>e.item.key))}else this._selectedKeys.add(i.item.key),this.#t={key:i.item.key,depth:a,index:o}}else this._selectedByDepth.set(a,i);this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:i,depth:a},bubbles:!0,composed:!0})),this.requestUpdate();break}case`Escape`:if(e.preventDefault(),this.#M(),this._columns.length>1){this._columns=this._columns.slice(0,-1);let e=Math.max(0,n-1),r=this._columns[e];if(r&&r.length>0){let n=this._selectedByDepth.get(e),i=n&&r.includes(n)?n:r[0];this.#K(i,e)}this.requestUpdate()}}},this.#X=(e,n)=>{e.preventDefault(),e.stopPropagation(),this.#o=n,this.#s=e.clientX;let r=this.shadowRoot?.querySelectorAll(`.column`)[n];this.#c=r?r.getBoundingClientRect().width:200,window.addEventListener(`pointermove`,this.#$),window.addEventListener(`pointerup`,this.#te)},this.#Z=null,this.#Q=0,this.#$=e=>{this.#o<0||(this.#Q=Math.max(32,this.#c+(e.clientX-this.#s)),this.#Z??=requestAnimationFrame(this.#ee))},this.#ee=()=>{this.#Z=null,!(this.#o<0)&&(this.shadowRoot?.querySelectorAll(`.column`)[this.#o])?.setAttribute(`style`,this.#re(this.#Q))},this.#te=()=>{this.#Z!==null&&(cancelAnimationFrame(this.#Z),this.#Z=null),this.#o>=0&&this.#Q>0&&(this.#n.set(this.#o,this.#Q),this.requestUpdate()),this.#Q=0,this.#o=-1,window.removeEventListener(`pointermove`,this.#$),window.removeEventListener(`pointerup`,this.#te)}}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;get registry(){return this.#u}#f(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#p(){this.#u&&(this.search.setModes(this.#f()),this.#d?.(),this.#d=Rt(this.#u,this.search))}#m(e,n){return`${n}:${e.item.key}`}get#h(){return this.viewRoot??this.root}#g(){let e=this.tickled.tickledId;if(!e)return;let n=e.indexOf(`:`);if(!(n<0))return Number(e.substring(0,n))}updated(e){if(e.has(`searchModes`)&&this.#p(),e.has(`root`)&&this.root){this.#M(),this.viewRoot!==void 0&&(this.viewRoot=void 0),this._selectedByDepth.clear(),this._selectedKeys=new Set,this._selectedNodes.clear(),this.#e=void 0,this.#t=void 0,this.tickled.clearTickled();let e=this.#h;this._columns=e?.children?[e.children]:[]}if(e.has(`viewRoot`)&&this.#x(),e.has(`model`)){this.#l?.(),this.#l=void 0;let e=this.model;e&&(this.root=e.root,this.#l=e._subscribe(e=>{if(e.type===`root`)this.root=e.root,this.requestUpdate();else if(e.type===`invalidate`){for(let n=0;n<this._columns.length-1;n++)if(this._columns[n]?.some(n=>n.item.key===e.key)){this._columns=this._columns.slice(0,n+1),this.requestUpdate();break}}}))}if(this.#r?.children!==void 0&&this._loadingDepth!==void 0){let e=this._loadingDepth,n=this.#r.children;this.#r=void 0,this.#i=void 0,this._loadingDepth=void 0;let r=this._columns.slice(0,e);n.length>0&&r.push(n),this._columns=r}let n=e.get(`_columns`),r=e.has(`_columns`)&&(n?.length??0)<this._columns.length,i=e.has(`_loadingDepth`)&&this._loadingDepth!==void 0;if(r||i){let e=this.shadowRoot?.querySelector(`#container`);e?.scrollTo({left:e.scrollWidth,behavior:`smooth`})}}connectedCallback(){super.connectedCallback(),this.#u??=Yt(),this.#p()}disconnectedCallback(){super.disconnectedCallback(),this.#l?.(),this.#l=void 0,this.#d?.(),this.#d=void 0,this.#u=void 0}getConfig(){let e={};for(let[n,r]of this.#n)e[n]=r;return{columnWidths:e}}setConfig(e){this.#n.clear();for(let[n,r]of Object.entries(e.columnWidths))this.#n.set(Number(n),r);this.requestUpdate()}get selectedKeys(){return this._selectedKeys}set selectedKeys(e){this._selectedKeys=new Set(e),this.requestUpdate()}get selectedNode(){return this.#e}set selectedNode(e){this.#e=e,e&&(this.interactionMode===`implicit`||this.interactionMode===`standard`)&&(this._selectedKeys=new Set([e.item.key])),this.requestUpdate()}get selectedNodes(){return this._selectedNodes}select(e){if(!this.#A(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.add(e),this._selectedKeys.add(e.item.key),this.#e=e,this.#j(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this._selectedKeys.delete(e.item.key),this.#e===e&&(this.#e=[...this._selectedNodes].at(-1)),this.#j(n),this.requestUpdate()}clearSelection(){let e=new Set(this._selectedNodes);this._selectedKeys=new Set,this._selectedNodes.clear(),this.#e=void 0,e.size>0&&this.#j(e),this.requestUpdate()}selectAll(){}deselectAll(){}setSelected(e,n){this.interactionMode===`checked`?this.#H(e,n):n?(this._selectedKeys.add(e.item.key),this._selectedNodes.add(e)):(this._selectedKeys.delete(e.item.key),this._selectedNodes.delete(e)),this.requestUpdate()}getSelected(){let e=[];for(let n of this._columns)for(let r of n)this._selectedKeys.has(r.item.key)&&e.push(r);return e}navigateTo(e,n={}){let r=this.#h;if(!r?.children)return!1;let i=this.#_,a=this.#v;this.#_=`programmatic`,this.#v=n.silent===!0;try{return this.#y(r.children,e,n.reveal??`edge`)}finally{this.#_=i,this.#v=a}}invalidateStructure(){let e=new Set;for(let n of this._columns)for(let r of n)e.add(r);for(let e=0;e<this._columns.length;e++){let n=this._selectedByDepth.get(e);if(n&&!this._columns[e].includes(n)){this._columns=this._columns.slice(0,e+1);for(let n of[...this._selectedByDepth.keys()])n>=e&&this._selectedByDepth.delete(n);break}}for(let n of[...this._selectedNodes])e.has(n)||this._selectedNodes.delete(n);this.requestUpdate()}#_;#v;#y(e,n,r){this.#M(),this._selectedByDepth.clear(),this.tickled.clearTickled();let i=[e],a=e,o=!0,s,c=0;for(let e=0;e<n.length;e++){let r=a.findIndex(r=>r.item.key===n[e]);if(r<0){o=!1;break}let l=a[r];if(this._selectedByDepth.set(e,l),s=l,c=e,l.item.isLeaf||!l.children||l.children.length===0){e<n.length-1&&(o=!1);break}i.push(l.children),a=l.children}if(this._columns=i,s&&this.tickled.setTickled(this.#m(s,c)),this.interactionMode!==`implicit`&&this.interactionMode!==`manual`){let e=n.at(-1);e&&(this._selectedKeys=new Set([e]))}return this.requestUpdate(),this.#G(r===`center-if-hidden`?`auto`:`smooth`,r),o}navigateToNode(e){let n=this.#h;if(!n?.children)return!1;let r=this.#b(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=this.#h;if(!n?.children)return!1;let r=this.#b(n.children,n=>n.item.key===e);if(!r)return!1;let i=[n.children],a=n.children,o,s=0;for(let e=0;e<r.length;e++){let n=a.find(n=>n.item.key===r[e]);if(!n)return!1;if(o=n,s=e,n.children&&n.children.length>0)i.push(n.children),a=n.children;else break}return this._columns=i,o&&this.tickled.setTickled(this.#m(o,s)),this.requestUpdate(),this.#G(),!0}selectMany(e){let n=this.selectionFilter===`none`?[]:[...e],r=new Set(this._selectedNodes);this._selectedNodes=new Set(n),this._selectedKeys=new Set(n.map(e=>e.item.key)),this.#e=n.at(-1),this.#j(r),this.requestUpdate()}getNodes(){let e=this.#h;if(!e?.children)return[];let n=[],r=(e,i)=>{if(n.push({node:e,depth:i}),e.children)for(let n of e.children)r(n,i+1)};for(let n of e.children)r(n,0);return n}#b(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#b(i.children,n,e);if(r)return r}}}#x(){this.#M();let e=new Set(this._selectedNodes);this._selectedByDepth.clear(),this._selectedKeys=new Set,this._selectedNodes.clear(),this.#e=void 0,this.#t=void 0,this.tickled.clearTickled();let n=this.#h;n?.children===void 0?n?(this._columns=[],this.#z(n,-1,!1)):(this._columns=[],this._loadingDepth=void 0):(this._columns=n.children?[n.children]:[],this._loadingDepth=void 0),e.size>0&&this.#j(e)}rebaseTo(e){if(e===void 0)return this.#S();let n=typeof e==`string`?this.#w(e):e;return!n||n.item.isLeaf===!0||n===this.viewRoot||n.item.key===this.viewRoot?.item.key?!1:n===this.root||!this.viewRoot&&n.item.key===this.root?.item.key?this.#S():(this.viewRoot=n,this.#C(),!0)}rebaseUp(){if(!this.viewRoot)return!1;let e=this.#E(this.viewRoot);return e?e===this.root?this.#S():(this.viewRoot=e,this.#C(),!0):!1}#S(){return this.viewRoot!==void 0&&(this.viewRoot=void 0,this.#C(),!0)}#C(){let e=this.viewRoot,n={viewRoot:e,path:e?this.#O(e):[]};this.dispatchEvent(new CustomEvent(`rebase`,{detail:n,bubbles:!0,composed:!0}))}#w(e){if(this.root)return this.root.item.key===e?this.root:this.#T(this.root.children??[],e)}#T(e,n){for(let r of e){if(r.item.key===n)return r;if(r.children){let e=this.#T(r.children,n);if(e)return e}}}#E(e){if(!(!this.root||e===this.root))return this.#D(this.root,e)}#D(e,n){if(e.children)for(let r of e.children){if(r===n||r.item.key===n.item.key)return e;let i=this.#D(r,n);if(i)return i}}#O(e){let n=[e],r=this.#E(e);for(;r&&(n.unshift(r),r!==this.root);)r=this.#E(r);return n}renderColumnContent(e,n){return console.warn(`ixfx-miller-base: renderColumnContent not overridden. depth=${n}, nodes=${e.length}`),a}_handleItemClick(e,n,r){this.#F(e,n,r)}_handleCheckboxClick(e,n,r){e.stopPropagation(),this.#B(n)}_handleItemDblClick(e,n,r){this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}_handleItemRightClick(e,n,r){this.dispatchEvent(new CustomEvent(`item-rightclick`,{detail:{node:e,depth:n,mouseEvent:r},bubbles:!0,composed:!0}))}_handleHeaderRightClick(e,n){let r=this.#ne(n),i=this.#N(n);this.dispatchEvent(new CustomEvent(`header-rightclick`,{detail:{depth:n,label:r,path:i,mouseEvent:e},bubbles:!0,composed:!0}))}_isSelected(e,n){return this.interactionMode===`implicit`?this._selectedByDepth.get(n)===e:this._selectedKeys.has(e.item.key)}#k(e,n){let r=this._columns[n+1];return r!==void 0&&e.children===r}_isOpen(e,n){return this.#k(e,n)}getItemState(e,n){let r=this._columns[n]?.find(n=>n.item.key===e);if(r)return{selected:this._isSelected(r,n),open:this.#k(r,n),focused:this._isFocused(r,n),isLeaf:r.item.isLeaf??!1}}#A(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf!==!1:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#j(e){if(this.#v)return;let n={selected:new Set(this._selectedNodes),previous:e,origin:this.#_};this.dispatchEvent(new CustomEvent(`select`,{detail:n,bubbles:!0,composed:!0}))}#M(){if(this.#a!==void 0&&(clearTimeout(this.#a),this.#a=void 0),this.#i){let e=this.#r,n=this._loadingDepth;this.#i.abort(),this.#i=void 0,this.#r=void 0,this._loadingDepth=void 0,e&&n!==void 0&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}}#N(e){let n=[];this.#h&&n.push(this.#h);for(let r=0;r<e;r++){let e=this._selectedByDepth.get(r);e&&n.push(e)}return n}#P(e){let n={depth:e,label:this.#ne(e),path:this.#N(e)};this.dispatchEvent(new CustomEvent(`header-click`,{detail:n,bubbles:!0,composed:!0}))}#F(e,n,r){switch(this._loadingDepth!==void 0&&this._loadingDepth>n&&this.#M(),this.tickled.setTickled(this.#m(e,n)),this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e,depth:n},bubbles:!0,composed:!0})),this.interactionMode){case`implicit`:this.#I(e,n);break;case`standard`:this.#L(e,n,r);break;case`vscode`:this.#L(e,n,r);break;case`manual`:break;case`checked`:this.#R(e,n,!0)}}#I(e,n){let r=new Set(this._selectedNodes);this._selectedByDepth.set(n,e),this.#e=e,this._selectedKeys=new Set([e.item.key]),this._selectedNodes.clear(),this._selectedNodes.add(e),this.#R(e,n,!0),r.has(e)||this.#j(r)}#L(e,n,r){let i=this._columns[n],a=i?i.indexOf(e):-1,o=r?r.metaKey||r.ctrlKey:!1,s=r?r.shiftKey:!1;if(o){this._selectedKeys.has(e.item.key)?(this._selectedKeys.delete(e.item.key),this._selectedNodes.delete(e)):(this._selectedKeys.add(e.item.key),this._selectedNodes.add(e)),this.#t=a>=0?{key:e.item.key,depth:n,index:a}:this.#t,this.requestUpdate();return}if(s&&this.#t&&this.#t.depth===n&&i){let e=Math.min(this.#t.index,a),n=Math.max(this.#t.index,a),r=i.slice(e,n+1);this._selectedKeys=new Set(r.map(e=>e.item.key)),this._selectedNodes=new Set(r),this.requestUpdate();return}let c=new Set(this._selectedNodes);this._selectedKeys=new Set([e.item.key]),this._selectedNodes=new Set([e]),this.#t=a>=0?{key:e.item.key,depth:n,index:a}:void 0,this._selectedByDepth.set(n,e),this.#e=e,this.#R(e,n,!0),(!c.has(e)||c.size!==1)&&this.#j(c)}#R(e,n,r=!1){if(e.item.isLeaf){this._columns=this._columns.slice(0,n+1),this.requestUpdate();return}if(e.children===void 0)this.#z(e,n,!0,r);else{let r=this._columns.slice(0,n+1);r.push(e.children),this._columns=r,this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}}#z(e,n,r,i=!1){let a=n+1;this._columns=this._columns.slice(0,a),this._loadingDepth=a,this.#i?.abort(),this.#r=e;let o=new AbortController;this.#i=o,r&&this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}));let s=n=>{if(o.signal.aborted)return;e.children=n,this.#r=void 0,this.#i=void 0,this._loadingDepth=void 0;let r=this._columns.slice(0,a);n.length>0&&r.push(n),this._columns=r},c=n=>{n.name!==`AbortError`&&console.error(n),e.children=[],this.#r=void 0,this.#i=void 0,this._loadingDepth=void 0,this.requestUpdate()};if(this.model||this.loadChildren){this.#a!==void 0&&(clearTimeout(this.#a),this.#a=void 0);let n=()=>{this.#a=void 0,this.#r===e&&(this.model?this.model.getChildren(e,a-1,o.signal):gg(this.loadChildren({node:e,depth:a-1},o.signal),o.signal)).then(e=>s([...e])).catch(c)};i?n():this.#a=setTimeout(n,150)}else{this._loadingDepth=void 0,this.#r=void 0,this.#i=void 0;let e=this._columns.slice(0,a);e.push([]),this._columns=e}}#B(e){let n=new Set(this._selectedNodes),r=this._selectedKeys.has(e.item.key);(e.children?.length?this.#V(e):r)?this.#H(e,!1):this.#H(e,!0),this.requestUpdate(),this.#j(n)}#V(e){return this._selectedKeys.has(e.item.key)?!e.children?.length||e.children.every(e=>this.#V(e)):!1}#H(e,n){if(n?(this._selectedKeys.add(e.item.key),this._selectedNodes.add(e)):(this._selectedKeys.delete(e.item.key),this._selectedNodes.delete(e)),e.children)for(let r of e.children)this.#H(r,n)}#U(){return this.#g()??0}#W(){let e=this.tickled.tickledId;if(!e)return;let n=e.indexOf(`:`);if(n<0)return;let r=Number(e.substring(0,n)),i=e.substring(n+1),a=this._columns[r];if(!a)return;let o=a.findIndex(e=>e.item.key===i);if(!(o<0))return{node:a[o],depth:r,index:o}}#G(e=`smooth`,n=`edge`){requestAnimationFrame(()=>{let r=this.#W();if(!r)return;let i=this.shadowRoot?.querySelectorAll(`.column`)[r.depth]?.querySelector(`.column-content`);if(!i)return;let a=i.querySelectorAll(`.item`)[r.index];if(a){if(n===`center-if-hidden`){let n=a.getBoundingClientRect(),r=i.getBoundingClientRect(),o=n.top<r.top||n.bottom>r.bottom;a.scrollIntoView({block:o?`center`:`nearest`,inline:`nearest`,behavior:e});return}a.scrollIntoView({block:`nearest`,behavior:e})}})}#K(e,n){this.tickled.setTickled(this.#m(e,n)),this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:e,depth:n},bubbles:!0,composed:!0}))}#q(e){let n=this.shadowRoot?.querySelectorAll(`.column`)[e]?.querySelector(`.column-content`),r=n?.querySelector(`.item`);return!n||!r||r.offsetHeight===0?10:Math.max(1,Math.floor(n.clientHeight/r.offsetHeight)-1)}#J(e,n,r,i,a=!1){let o=this.#W(),s=i(o!==void 0&&o.depth===n?o.index:-1),c=e[s];if(c){if(this.#K(c,n),this.interactionMode===`standard`||this.interactionMode===`vscode`){let i=o?.index??0;if(r.shiftKey){if(!this.#t||this.#t.depth!==n){let r=e[i];r&&(this.#t={key:r.item.key,depth:n,index:i,selectionSnapshot:this.interactionMode===`vscode`?new Set(this._selectedKeys):void 0})}if(this.#t){let n=Math.min(this.#t.index,s),r=Math.max(this.#t.index,s),i=e.slice(n,r+1).map(e=>e.item.key);if(this.interactionMode===`vscode`){let e=this.#t.selectionSnapshot;for(let n of i)e.has(n)?this._selectedKeys.delete(n):this._selectedKeys.add(n)}else this._selectedKeys=new Set(i)}}else this.#t=this.interactionMode===`standard`?{key:c.item.key,depth:n,index:s}:void 0}this.requestUpdate(),a&&this.#G(`auto`)}}#Y;#X;#Z;#Q;#$;#ee;#te;#ne(e){if(e===0)return this.#h?.item.label??``;let n=this._selectedByDepth.get(e-1);if(n)return n.item.label;let r=this._columns[e-1],i=this._columns[e];if(r&&i){let e=r.find(e=>e.children===i);if(e)return e.item.label}return``}#re(e){return`width:${e}px;flex-grow:0;flex-shrink:0;flex-basis:auto;max-width:none`}#ie(e,n){let r=this.#n.get(e);return r===void 0?this.stretchLastColumn&&n?`width:max-content;flex-grow:1;flex-shrink:0;flex-basis:auto;min-width:0`:`width:max-content;flex-grow:0;flex-shrink:0;flex-basis:auto`:this.#re(r)}#ae(e,n){return this.tickled.isTickled(this.#m(e,n))}renderLoadingIndicator(){return i`<div class="loading-spinner"></div>`}#oe(){let e=this._loadingDepth,n=this.stretchLastColumn&&this.#n.get(e)===void 0;return i`
|
|
10027
10065
|
<div class="column loading-column ${n?`stretch-last`:``}" style=${this.#ie(e,!0)}>
|
|
10028
10066
|
${this.headers?i`
|
|
10029
10067
|
<div class="column-header">${this.#ne(e)}</div>
|
|
@@ -10178,7 +10216,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10178
10216
|
border-radius: 2px;
|
|
10179
10217
|
padding: 0 1px;
|
|
10180
10218
|
}
|
|
10181
|
-
`]}};E([d({type:Object})],
|
|
10219
|
+
`]}};E([d({type:Object})],Dw.prototype,`root`,void 0),E([d({attribute:!1})],Dw.prototype,`model`,void 0),E([d({type:Boolean})],Dw.prototype,`headers`,void 0),E([d({type:Boolean,attribute:`stretch-last-column`,reflect:!0})],Dw.prototype,`stretchLastColumn`,void 0),E([d({attribute:!1})],Dw.prototype,`viewRoot`,void 0),E([d({type:String})],Dw.prototype,`interactionMode`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],Dw.prototype,`selectionFilter`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],Dw.prototype,`exclusivity`,void 0),E([d({type:Object})],Dw.prototype,`loadChildren`,void 0),E([d({attribute:!1})],Dw.prototype,`filterPredicate`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],Dw.prototype,`searchModes`,void 0),E([m()],Dw.prototype,`_columns`,void 0),E([m()],Dw.prototype,`_loadingDepth`,void 0),E([m()],Dw.prototype,`_selectedNodes`,void 0),Dw=E([T(`ixfx-miller-base`)],Dw);function Ow(e,n){if(e.item.isLeaf||!e.children?.length)return n.has(e.item.key)?1:2;let r=0;for(let i of e.children)if(r|=Ow(i,n),r===3)break;return r}function kw(e,n){let r=Ow(e,n);return r===1?`checked`:r===2?`unchecked`:`indeterminate`}let Aw=class extends Dw{renderColumnContent(e,n){let r=e.some(e=>!!e.item.icon),a=this.interactionMode===`checked`;return i`
|
|
10182
10220
|
<ul
|
|
10183
10221
|
class="item-list ${r?`has-icons`:``} ${a?`checked-mode`:``}"
|
|
10184
10222
|
role="listbox"
|
|
@@ -10187,7 +10225,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10187
10225
|
>
|
|
10188
10226
|
${e.map(e=>this.#e(e,n))}
|
|
10189
10227
|
</ul>
|
|
10190
|
-
`}#e(e,n){let r=this._isSelected(e,n),o=this._isFocused(e,n),s=this._isOpen(e,n),c=e.item.isLeaf!==!0,l=e.item.icon,u=
|
|
10228
|
+
`}#e(e,n){let r=this._isSelected(e,n),o=this._isFocused(e,n),s=this._isOpen(e,n),c=e.item.isLeaf!==!0,l=e.item.icon,u=Hg(e.item.iconColor),d=Hg(e.item.textColor),f=Vg(e.item.badge)?void 0:e.item.badge,p=e.item.tooltip,m=this.interactionMode===`checked`,h=a;if(m){let r=kw(e,this._selectedKeys);h=i`
|
|
10191
10229
|
<input
|
|
10192
10230
|
type="checkbox"
|
|
10193
10231
|
class="item-checkbox"
|
|
@@ -10213,7 +10251,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10213
10251
|
${p?i`<ixfx-tooltip class="item-tooltip" anchor="--tooltip-miller-${n}-${e.item.key}" .value=${p}></ixfx-tooltip>`:a}
|
|
10214
10252
|
${c?i`<span class="caret" aria-hidden="true">›</span>`:a}
|
|
10215
10253
|
</li>
|
|
10216
|
-
`}static{this.styles=[w,...
|
|
10254
|
+
`}static{this.styles=[w,...Dw.styles,C,r`
|
|
10217
10255
|
.item-list {
|
|
10218
10256
|
list-style: none;
|
|
10219
10257
|
margin: 0;
|
|
@@ -10301,7 +10339,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10301
10339
|
}
|
|
10302
10340
|
|
|
10303
10341
|
|
|
10304
|
-
`]}};
|
|
10342
|
+
`]}};Aw=E([T(`ixfx-miller-list`)],Aw);var jw=class{#e;#t;#n;#r=new WeakMap;#i=new Map;#a=new Map;#o=new Map;#s=new WeakMap;#c;constructor(e,n,r){this.#e=e,this.#t=n,this.#n=r}connect(){this.disconnect(),this.#c=new AbortController,this.#s=new WeakMap,this.#i.clear(),this.#o.clear(),this.#a.clear();let e={item:this.#f(this.#e)};this.#r.set(e,this.#e),e.children=this.#p(this.#e),this.#t.root=e,this.#t.loadChildren=this.#n.loadChildren??(({node:e})=>{let n=this.#r.get(e);return n?this.#p(n):[]})}disconnect(){this.#c?.abort(),this.#c=void 0,this.#t.loadChildren=void 0}navigateToValue(e,n){let r=this.#_(this.#e,e);return r?this.#l(r,n):!1}navigateToKeyPath(e,n){let r=this.#t.viewRoot??this.#t.root;if(!r||e.length===0)return!1;this.#u(r);let i=r.children??[];for(let n=0;n<e.length-1;n++){let r=i.find(r=>r.item.key===e[n]);if(!r)return!1;this.#u(r),i=r.children??[]}return this.#t.navigateTo(e,n)}navigateToIdentity(e,n){let r=this.#d(e);if(!r)return!1;let i=[],a=this.#e.getIdentity();for(let e=r;e;e=e.getParent())if(i.unshift(e),e.getIdentity()===a)return this.#l(i,n);return!1}lookupByKey(e){return this.#a.get(e)}sync(){let e=this.#t.root;if(!e)return;this.#s=new WeakMap,this.#i.clear(),this.#o.clear(),this.#a.clear(),this.#r.set(e,this.#e),e.item=this.#f(this.#e);let n=new Set([e]);e.children&&this.#g(this.#e,e.children,n);let r=this.#t.viewRoot;r&&!n.has(r)&&(this.#t.viewRoot=void 0),this.#t.invalidateStructure()}#l(e,n){let r=this.#t.viewRoot??this.#t.root;if(!r)return!1;let i=1;if(this.#t.viewRoot){let n=this.#r.get(r);if(!n)return!1;let a=n.getIdentity(),o=e.findIndex(e=>e.getIdentity()===a);if(o<0)return!1;i=o+1}return i>=e.length?!1:this.navigateToKeyPath(e.slice(i).map(e=>this.#f(e).key),n)}#u(e){if(e.children!==void 0)return;let n=this.#r.get(e);n&&(e.children=this.#p(n))}#d(e){return this.#o.get(e)}#f(e){let n=e.getIdentity(),r=this.#s.get(n);return r||(r=this.#n.valueToItem(e.getValue(),e),this.#s.set(n,r)),r}#p(e){return Array.from(e.children(),e=>this.#m(e))}#m(e){let n=[...e.children()];for(let e of n)this.#o.set(e.getIdentity(),e);let r=this.#f(e),i=r.isLeaf??n.length===0,a={item:{...r,isLeaf:i},children:i?[]:void 0};return this.#h(a,e),a}#h(e,n){this.#r.set(e,n),this.#i.set(n.getIdentity(),e),this.#o.set(n.getIdentity(),n),this.#a.set(e.item.key,n)}#g(e,n,r){let i=new Map(n.map(e=>[e.item.key,e])),a=Array.from(e.children(),e=>{let n=this.#m(e),a=i.get(n.item.key);return a?(a.item=n.item,this.#h(a,e),r.add(a),n.item.isLeaf?a.children=[]:a.children===void 0?a.children=void 0:this.#g(e,a.children,r),a):(r.add(n),n)});n.splice(0,n.length,...a)}#_(e,n,r=[]){let i=[...r,e];if(n(e.getValue()))return i;for(let r of e.children()){let e=this.#_(r,n,i);if(e)return e}}};function Mw(e){return e.children!==void 0&&e.children.length>0}function Nw(e){return e.flatMap(e=>Mw(e)?Nw(e.children):[e])}function Pw(e,n){for(let r of e){if(r.key===n)return r;let e=r.children?Pw(r.children,n):void 0;if(e)return e}}function Fw(e,n){return Nw(e).find(e=>e.key===n)}const Iw=`__all__`;function Lw(e,n){let r=n===`desc`?-1:1;return[...e].sort((e,n)=>r*e.label.localeCompare(n.label,void 0,{sensitivity:`base`,numeric:!0}))}function Rw(e,n,r,i){if(r===0)return{insert:0,caretOffset:0};let a=2**53-1,o=i;for(let s=0;s<r;s++){if(s===i)continue;let r=e[s],c=e[s+1]??e[e.length-1],l=(r+c)/2,u=Math.abs(n-(n<l?r:c));u<a&&(a=u,o=n<l?s:s+1)}let s=o>i?o-1:o;return{insert:Math.max(0,Math.min(r-1,s)),caretOffset:e[o]??e[e.length-1]}}var zw=class{#e;#t;#n;#r;#i;#a;#o=void 0;#s;#c;#l;#u=[];#d=!0;#f=[];#p=!1;#m;constructor(e){this.id=e.id,this.#e=e.category,this.#t=e.categoryDefaults,this.#n=e.selectionMode,this.#r=e.dataProvider,this.#i=e.onSelectionChange,this.#a=e.onRequestData,this.#m={id:e.id,categoryKey:e.category.key,sort:e.categoryDefaults?.sort??`asc`,grouped:e.categoryDefaults?.grouped??!1,menu:e.categoryDefaults?.menu??!0,width:220}}get state(){return this.getState()}get categoryKey(){return this.#e.key}get menu(){return this.#m.menu}getState(){return{...this.#m}}updateState(e){let n=e;if(e.width!==void 0&&!Number.isFinite(e.width)){let{width:r,...i}=e;n=i}let r=n.sort!==void 0&&n.sort!==this.#m.sort,i=n.grouped!==void 0&&n.grouped!==this.#m.grouped;this.#m={...this.#m,...n},r&&this.#_(),i&&this.#v()}setWidth(e){Number.isFinite(e)&&(this.#m={...this.#m,width:Math.max(80,Math.min(480,Math.round(e)))})}setSort(e){e!==this.#m.sort&&(this.#m={...this.#m,sort:e},this.#_())}setGrouped(e){e!==this.#m.grouped&&(this.#m={...this.#m,grouped:e},this.#v())}setSelectionMode(e){if(e!==this.#n){this.#n=e;for(let n of this.#y())n.selectionMode=e}}setCategory(e){this.#e=e,this.#t=e.defaults,this.#m={...this.#m,categoryKey:e.key,sort:e.defaults?.sort??`asc`,grouped:e.defaults?.grouped??!1,menu:e.defaults?.menu??!0},this.clearSelection(),this.#v()}get listerHost(){return this.#s}get isMounted(){return this.#s!==void 0}setDataProvider(e){this.#r=e}mount(e){if(this.#s)return;this.#s=e;let n=document.createElement(`div`);n.className=`all-row`,n.dataset.key=Iw,n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`);let r=document.createElement(`span`);r.className=`all-label`,n.appendChild(r);let i=()=>{this.#d||this.#x()};n.addEventListener(`click`,i),n.addEventListener(`keydown`,e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),i())}),this.#c=n;let a=document.createElement(`ixfx-grouped-item-lister`);a.crossGroupSelection=!0,a.factory=()=>_x(Bw,{selectionMode:this.#n,interactionMode:`standard`}),a.addEventListener(`select`,this.#b),this.#l=a,this.#v(),this.#C(),e.append(n,a),this.#f.length>0&&(this.#g(),this.#S())}unmount(){this.#w(),this.#c?.remove(),this.#l?.remove(),this.#c=void 0,this.#l=void 0,this.#s=void 0}requestData(e){if(!this.#r)return;this.#w();let n=new AbortController;this.#o=n;let{signal:r}=n;this.#a(this.id,e,r),Promise.resolve().then(async()=>{let n=await gg(this.#r(e,r),r);r.aborted||this.#h(n)}).catch(()=>{})}#h(e){this.#f=e;let n=this.#u.filter(n=>e.some(e=>e.key===n)),r=n.length!==this.#u.length;if(this.#u=n,n.length===0&&(this.#d=!0),!this.#l){r&&this.#i(this.id,n);return}this.#g(),this.#S(),r&&this.#i(this.id,n)}#g(){if(!this.#l)return;let e=Lw(this.#f,this.#m.sort);this.#l.provider=()=>e}#_(){!this.#l||this.#f.length===0||(this.#g(),this.#S())}#v(){if(!this.#l)return;let e=this.#t?.groupBy;this.#l.groupBy=e,this.#l.grouped=this.#m.grouped&&e!==void 0,this.#f.length>0&&this.#S()}#y(){return this.#l?this.#l.querySelectorAll(`:scope > .ungrouped-host > *, :scope > ixfx-panel > *`):[]}#b=()=>{if(this.#p)return;let e=[...this.#l?.selectedItems??[]].map(e=>e.key).filter(e=>e!==Iw);if(e.length===this.#u.length&&e.every(e=>this.#u.includes(e))){this.#C();return}this.#u=e,this.#d=e.length===0,this.#C(),this.#i(this.id,e)};#x(){let e=this.#u;this.#p=!0;try{this.#u=[],this.#d=!0;for(let e of this.#y())e.clearSelection()}finally{this.#p=!1}this.#C(),e.length>0&&this.#i(this.id,[])}clearSelection(){this.#x()}get selectedValues(){return this.#u}#S(){this.#l&&this.#l.updateComplete.then(()=>{if(!(!this.#l||!this.#s)){this.#p=!0;try{let e=this.#u;for(let n of this.#l.querySelectorAll(`ixfx-vertical-list`))n.selectKeys(e);let n=[...this.#l.selectedItems].map(e=>e.key).filter(e=>e!==Iw);this.#u=n,this.#d=n.length===0}finally{this.#p=!1}this.#C()}})}#C(){if(!this.#c)return;let e=this.#t?.allLabel??`All`,n=this.#c.querySelector(`.all-label`);n&&(n.textContent=e),this.#c.toggleAttribute(`data-selected`,this.#d)}#w(){this.#o&&=(this.#o.abort(),void 0)}};function Bw(e){let n=document.createElement(`li`);n.dataset.key=e.key;let r=document.createElement(`span`);if(r.className=`item-label`,r.textContent=e.label,n.appendChild(r),e.count!==void 0){let r=document.createElement(`span`);r.className=`count`,r.textContent=String(e.count),n.appendChild(r)}return n}_e(`menu`,`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>`);let Vw=class extends n{constructor(...e){super(...e),this.categories=[],this.selectionMode=`multiple`,this.minColumns=1,this.maxColumns=5,this._columns=[],this._colOffsets=[0],this._resizingColumnId=void 0,this._draggingColumnId=void 0,this._dropCaretX=void 0,this._idCounter=0,this._autoSeeded=!1,this._drag={pointerId:-1,from:-1,startX:0,startY:0,active:!1,ghost:null,insert:-1}}static{this.styles=[w,Xt,r`
|
|
10305
10343
|
:host {
|
|
10306
10344
|
--multicol-list-bg: var(--surface-3);
|
|
10307
10345
|
--multicol-list-header-bg: var(--surface-2);
|
|
@@ -10491,12 +10529,12 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10491
10529
|
margin-left: var(--space-s);
|
|
10492
10530
|
font-size: var(--text-s);
|
|
10493
10531
|
}
|
|
10494
|
-
`]}get columns(){return this._columns.map(e=>e.getState())}setColumns(e){let n=new Map(this._columns.map(e=>[e.id,e])),r=[];for(let i of e){let e=n.get(i.id);if(e){if(e.categoryKey!==i.categoryKey){let n=
|
|
10532
|
+
`]}get columns(){return this._columns.map(e=>e.getState())}setColumns(e){let n=new Map(this._columns.map(e=>[e.id,e])),r=[];for(let i of e){let e=n.get(i.id);if(e){if(e.categoryKey!==i.categoryKey){let n=Fw(this.categories,i.categoryKey);n&&e.setCategory(n)}e.updateState(i),r.push(e),n.delete(i.id);continue}let a=Fw(this.categories,i.categoryKey);if(!a)continue;let o=this.#e(i.id,a);o.updateState(i),r.push(o)}for(let e of n.values())e.unmount();this._columns=r,this._updateColOffsets(),this._emitColumnsChange(`add`),this._requeryAllColumns(),this.requestUpdate()}addColumn(e,n){if(this.maxColumns>0&&this._columns.length>=this.maxColumns)return;let r=Fw(this.categories,e);if(!r)return;let i=`col-${++this._idCounter}`,a=this.#e(i,r);n!==void 0&&n>=0&&n<this._columns.length?this._columns.splice(n,0,a):this._columns.push(a),this._updateColOffsets(),this._emitColumnsChange(`add`),this._requeryAllColumns(),this.requestUpdate()}removeColumn(e){if(this._columns.length<=this.minColumns)return;let n=this._columns.findIndex(n=>n.id===e);n<0||(this._columns[n].unmount(),this._columns.splice(n,1),this._updateColOffsets(),this._emitColumnsChange(`remove`),this._requeryAllColumns(),this.requestUpdate())}getSelection(){return this._columns.map(e=>({columnId:e.id,categoryKey:e.categoryKey,values:e.selectedValues}))}clearSelection(){for(let e of this._columns)e.clearSelection();this.requestUpdate()}render(){return i`
|
|
10495
10533
|
<div id="container">
|
|
10496
10534
|
${_(this._columns,e=>e.id,(e,n)=>this._renderColumn(e,n))}
|
|
10497
10535
|
${this._dropCaretX===void 0?a:i`<div class="drop-caret" style="left: ${this._dropCaretX}px"></div>`}
|
|
10498
10536
|
</div>
|
|
10499
|
-
`}updated(e){let n=
|
|
10537
|
+
`}updated(e){let n=Nw(this.categories)[0];if(!this._autoSeeded&&this._columns.length===0&&n&&(this._autoSeeded=!0,this.addColumn(n.key)),e.has(`selectionMode`))for(let e of this._columns)e.setSelectionMode(this.selectionMode);if(e.has(`dataProvider`))for(let e of this._columns)e.setDataProvider(this.dataProvider);for(let e of this._columns)if(!e.isMounted){let n=this.shadowRoot?.querySelector(`[data-col-id="${e.id}"] .lister-host`);n&&e.mount(n)}e.has(`categories`)&&this._syncColumnsWithCategories(),(e.has(`categories`)||e.has(`dataProvider`))&&this._requeryAllColumns(),this._updateColOffsets()}_renderColumn(e,n){let r=e.getState().width??220,o=Number.isFinite(r)?r:220;return i`
|
|
10500
10538
|
<div
|
|
10501
10539
|
class="column"
|
|
10502
10540
|
data-col-id="${e.id}"
|
|
@@ -10534,7 +10572,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10534
10572
|
</div>
|
|
10535
10573
|
<div class="lister-host"></div>
|
|
10536
10574
|
</div>
|
|
10537
|
-
`}_getCategoryLabel(e){return
|
|
10575
|
+
`}_getCategoryLabel(e){return Pw(this.categories,e)?.label??e}_getCategoryTooltip(e){return Pw(this.categories,e)?.description??`Change category`}#e(e,n){return new zw({id:e,category:n,categoryDefaults:n.defaults,selectionMode:this.selectionMode,dataProvider:this.dataProvider,onSelectionChange:this._onColumnSelectionChange.bind(this),onRequestData:this._onColumnRequestData.bind(this)})}_onHeaderPointerDown(e,n,r){e.stopPropagation(),this._drag={pointerId:e.pointerId,from:r,startX:e.clientX,startY:e.clientY,active:!1,ghost:null,insert:r};let i=e=>{if(e.pointerId!==this._drag.pointerId)return;let r=e.clientX-this._drag.startX,i=e.clientY-this._drag.startY;if(!this._drag.active){if(Math.hypot(r,i)<5)return;this._drag.active=!0,this._draggingColumnId=n.id;let a=this.shadowRoot?.querySelector(`[data-col-id="${n.id}"] .column-header`),o=document.createElement(`span`);o.textContent=this._getCategoryLabel(n.categoryKey);try{a&&(this._drag.ghost=Gg({anchor:a,content:o}),this._drag.ghost.move(e.clientX,e.clientY))}catch{}try{this._containerEl?.setPointerCapture(e.pointerId)}catch{}}this._drag.ghost?.move(e.clientX,e.clientY);let a=this._containerEl;if(!a)return;let o=a.getBoundingClientRect(),s=e.clientX-o.left+a.scrollLeft,c=Rw(this._colOffsets,s,this._columns.length,this._drag.from);this._drag.insert=c.insert,this._dropCaretX=c.caretOffset,this.requestUpdate()},a=e=>{if(e.pointerId!==this._drag.pointerId)return;let n=this._drag.active,r=this._drag.from,o=this._drag.insert;this._drag.ghost?.destroy(),this._drag.ghost=null,this._draggingColumnId=void 0,this._dropCaretX=void 0;try{this._containerEl?.releasePointerCapture(e.pointerId)}catch{}if(window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a),n&&o!==r){let[e]=this._columns.splice(r,1);this._columns.splice(o,0,e),this._updateColOffsets(),this._emitColumnsChange(`reorder`),this.requestUpdate()}};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)}_onResizePointerDown(e,n){e.preventDefault(),e.stopPropagation();let r=e.clientX,i=n.getState().width??220,a=Number.isFinite(i)?i:220;this._resizingColumnId=n.id;let o=e=>{let i=Math.max(80,Math.min(480,a+e-r));return n.setWidth(i),i},s=n=>{n.pointerId===e.pointerId&&(o(n.clientX),this._updateColOffsets(),this.requestUpdate())},c=e=>{window.removeEventListener(`pointermove`,s),window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),o(e.type===`pointercancel`?r:e.clientX),this._resizingColumnId=void 0,this._updateColOffsets(),this._emitColumnsChange(`resize`),this.requestUpdate()};window.addEventListener(`pointermove`,s),window.addEventListener(`pointerup`,c),window.addEventListener(`pointercancel`,c)}#t(e,n,r){let i=e.getBoundingClientRect(),a=document.createElement(`ixfx-menu-trigger`);a.mode=`dropdown`,a.tabStop=!1,a.placement=n,a.style.position=`fixed`,a.style.left=`${i.left}px`,a.style.top=`${i.bottom}px`;let o=document.createElement(`ixfx-menu-container`);o.setAttribute(`slot`,`menu`),r(o),a.appendChild(o),a.addEventListener(`menu-trigger-close`,()=>a.remove(),{once:!0}),document.body.appendChild(a),a.updateComplete.then(()=>a.openMenu())}#n(e){return{item:{key:e.key,label:e.label},children:e.children&&e.children.length>0?e.children.map(e=>this.#n(e)):void 0}}_openCategoryPicker(e,n){this.#t(n,`bottom-start`,n=>{let r=o_(this.categories.map(e=>this.#n(e)),{onCommand:n=>{n.command!==void 0&&this._changeColumnCategory(e,n.command)}});for(let e of r)n.appendChild(e);for(let r of n.querySelectorAll(`ixfx-menu-item`))r.getAttribute(`command`)===e.categoryKey&&r.setAttribute(`disabled`,``)})}#r(e,n,r,i){let a=document.createElement(`ixfx-menu-item`);return a.setAttribute(`command`,n),a.setAttribute(`label`,e),i&&a.setAttribute(`icon-name`,i),r&&a.addEventListener(`command`,()=>r()),a}_openBurgerMenu(e,n){this.#t(n,`bottom-end`,n=>{let r=this.#r(`Remove this column`,`remove`,()=>this.removeColumn(e.id));r.toggleAttribute(`disabled`,this._columns.length<=this.minColumns),n.appendChild(r);let i=document.createElement(`ixfx-menu-separator`);n.appendChild(i);let a=this.maxColumns>0&&this._columns.length>=this.maxColumns,o=new Set(this._columns.map(e=>e.categoryKey)),s=Nw(this.categories).filter(e=>!o.has(e.key)),c=!a&&s.length>0,l=document.createElement(`ixfx-menu-sub-trigger`);l.setAttribute(`label`,`Add column`);let u=document.createElement(`ixfx-menu-container`);u.setAttribute(`slot`,`submenu`);let d=this._columns.findIndex(n=>n.id===e.id);for(let[e,n]of[[`Left`,-1],[`Right`,1]]){let r=this.#r(e,`add-${e.toLowerCase()}`,()=>{this.#i(s[0].key,Math.max(0,d+Math.max(0,n)))});r.toggleAttribute(`disabled`,!c),u.appendChild(r)}l.appendChild(u),n.appendChild(l);let f=document.createElement(`ixfx-menu-sub-trigger`);f.setAttribute(`label`,`Sort`);let p=document.createElement(`ixfx-menu-container`);p.setAttribute(`slot`,`submenu`),p.appendChild(this.#r(`Ascending`,`sort-asc`,()=>{e.setSort(`asc`),this._emitColumnsChange(`sort`),this.requestUpdate()},e.getState().sort===`asc`?`check`:void 0)),p.appendChild(this.#r(`Descending`,`sort-desc`,()=>{e.setSort(`desc`),this._emitColumnsChange(`sort`),this.requestUpdate()},e.getState().sort===`desc`?`check`:void 0)),f.appendChild(p),n.appendChild(f);let m=e.getState().grouped;n.appendChild(this.#r(m?`Ungroup`:`Group`,`toggle-group`,()=>{e.setGrouped(!m),this._emitColumnsChange(`grouping`),this.requestUpdate()},m?`check`:void 0))})}#i(e,n){this.addColumn(e,n)}_changeColumnCategory(e,n){let r=Fw(this.categories,n);r&&(e.setCategory(r),this._emitColumnsChange(`category`),this._requeryAllColumns(),this.requestUpdate())}_onColumnSelectionChange(e,n){if(!this._columns.find(n=>n.id===e))return;for(let n of this._columns)n.id!==e&&n.requestData(this._buildQuery(n));let r={columnId:e,columns:this.getSelection()};this.dispatchEvent(new CustomEvent(`multicol-select`,{detail:r,bubbles:!0,composed:!0})),this.requestUpdate()}_onColumnRequestData(e,n,r){}_buildQuery(e){let n=new Map;for(let r of this._columns)r.id!==e.id&&n.set(r.id,r.selectedValues);return{columnId:e.id,categoryKey:e.categoryKey,otherSelections:n}}_requeryAllColumns(){for(let e of this._columns)e.requestData(this._buildQuery(e))}_syncColumnsWithCategories(){let e=!1,n=Nw(this.categories);for(let r of this._columns)n.some(e=>e.key===r.categoryKey)||n.length!==0&&(r.setCategory(n[0]),e=!0);e&&this._emitColumnsChange(`category`)}_updateColOffsets(){let e=[0],n=0;for(let r of this._columns){let i=r.getState().width??220;n+=Number.isFinite(i)?i:220,e.push(n)}e.length===this._colOffsets.length&&e.every((e,n)=>e===this._colOffsets[n]||Number.isNaN(e)&&Number.isNaN(this._colOffsets[n]))||(this._colOffsets=e)}_emitColumnsChange(e){this.dispatchEvent(new CustomEvent(`multicol-columns-change`,{detail:{columns:this.columns,reason:e},bubbles:!0,composed:!0}))}async autoSizeColumns(e){return new Promise(n=>{setTimeout(()=>{let r=e?.minWidth??80,i=e?.maxWidth??480,a=e=>{let n=document.createElement(`span`);n.style.position=`absolute`,n.style.visibility=`hidden`,n.style.whiteSpace=`nowrap`,n.style.font=getComputedStyle(this).font,n.textContent=e,document.body.appendChild(n);let r=n.getBoundingClientRect().width;return document.body.removeChild(n),Number.isFinite(r)?r:0};for(let e of this._columns){let n=this.shadowRoot?.querySelector(`[data-col-id="${e.id}"]`);if(!n)continue;let o=n.querySelector(`.column-header`),s=n.querySelector(`.lister-host`),c=0;if(s){let e=s.querySelector(`.all-label`);e&&(c=Math.max(c,a(e.textContent??``)));let n=s.querySelector(`ixfx-grouped-item-lister`);if(n){let e=n.querySelectorAll(`ixfx-vertical-list`);for(let n of e){let e=n.querySelectorAll(`li`);for(let n of e){let e=n.querySelector(`.item-label`),r=n.querySelector(`.count`),i=(e?.textContent??``)+(r?.textContent??``);c=Math.max(c,a(i))}}}}let l=0;if(o){let e=o.querySelector(`.column-label`);if(e){let n=a(e.textContent??``),r=getComputedStyle(e),i=(Number.parseFloat(r.paddingLeft)||0)+(Number.parseFloat(r.paddingRight)||0),s=o.querySelector(`.burger-btn`),c=s&&Number.parseFloat(getComputedStyle(s).width)||0,u=getComputedStyle(o),d=Number.parseFloat(u.gap)||0;l=n+i+c+d}}let u=Math.max(l,c+24+16),d=Math.max(r,Math.min(i,Math.ceil(u)));Number.isFinite(d)&&e.setWidth(d)}this._updateColOffsets(),this._emitColumnsChange(`resize`),this.requestUpdate(),n()},0)})}};E([d({attribute:!1})],Vw.prototype,`categories`,void 0),E([d({attribute:!1})],Vw.prototype,`dataProvider`,void 0),E([d({type:String,attribute:`selection-mode`})],Vw.prototype,`selectionMode`,void 0),E([d({type:Number})],Vw.prototype,`minColumns`,void 0),E([d({type:Number})],Vw.prototype,`maxColumns`,void 0),E([m()],Vw.prototype,`_columns`,void 0),E([m()],Vw.prototype,`_colOffsets`,void 0),E([m()],Vw.prototype,`_resizingColumnId`,void 0),E([m()],Vw.prototype,`_draggingColumnId`,void 0),E([m()],Vw.prototype,`_dropCaretX`,void 0),E([f(`#container`)],Vw.prototype,`_containerEl`,void 0),Vw=E([T(`ixfx-multicol-list`)],Vw);let Hw=class extends n{constructor(...e){super(...e),this.notificationType=`info`,this.message=``,this.dismissing=!1,this.notificationId=``}#e(){this.#n()}#t(e){(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.#n())}#n(){this.dispatchEvent(new CustomEvent(`pill-tap`,{detail:{id:this.notificationId},bubbles:!0,composed:!0}))}#r(){return this.icon?this.icon.startsWith(`<svg`)?i`<span class="pill-icon">${g(this.icon)}</span>`:xe(this.icon)?i`<ixfx-icon class="pill-icon" name="${this.icon}"></ixfx-icon>`:a:a}render(){return i`
|
|
10538
10576
|
<button
|
|
10539
10577
|
type="button"
|
|
10540
10578
|
class="pill"
|
|
@@ -10617,7 +10655,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10617
10655
|
transform: none !important;
|
|
10618
10656
|
}
|
|
10619
10657
|
}
|
|
10620
|
-
`]}};E([d({type:String,attribute:`notification-type`})],
|
|
10658
|
+
`]}};E([d({type:String,attribute:`notification-type`})],Hw.prototype,`notificationType`,void 0),E([d({type:String})],Hw.prototype,`message`,void 0),E([d({type:String})],Hw.prototype,`icon`,void 0),E([d({type:Boolean,reflect:!0})],Hw.prototype,`dismissing`,void 0),E([d({type:String,attribute:`notification-id`})],Hw.prototype,`notificationId`,void 0),Hw=E([T(`ixfx-notification-pill`)],Hw);function Uw(e){return{vertical:e.startsWith(`top`)?`top`:`bottom`,horizontal:e.endsWith(`-left`)?`left`:e.endsWith(`-right`)?`right`:`middle`}}function Ww(e,n){let{vertical:r,horizontal:i}=Uw(e),a=`calc(var(--space-l, 12px) + ${(r===`top`?n.top:n.bottom)??0}px)`,o=`position: fixed; `;if(o+=r===`top`?`top: ${a}; bottom: auto; `:`bottom: ${a}; top: auto; `,i===`left`){let e=`calc(var(--space-l, 12px) + ${n.left??0}px)`;o+=`left: ${e}; right: auto;`}else if(i===`right`){let e=`calc(var(--space-l, 12px) + ${n.right??0}px)`;o+=`right: ${e}; left: auto;`}else o+=`left: 50%; right: auto;`;return o}function Gw(e){let n=e.vertical===`top`?-20:20;return e.horizontal===`middle`?`translateX(-50%) translate(0, ${n}px)`:`translate(${e.horizontal===`left`?-20:20}px, ${n}px)`}function Kw(e,n,r){return e.horizontal===`middle`?`translateX(-50%) translate(${n}px, ${r}px)`:`translate(${n}px, ${r}px)`}function qw(e){return typeof e.showPopover==`function`&&typeof e.hidePopover==`function`}function Jw(e={}){let n=e.position??`top-right`,r=e.queueDisplay??`list`,i=e.safeArea??{},a=Uw(n),o=e.topLayer??!0,s=null,c=null,l=new Map,u=40,d=!1;function f(){return s||(s=document.createElement(`div`),s.className=`ixfx-notification-container`,s.setAttribute(`role`,`region`),s.setAttribute(`aria-label`,`Notifications`),s.style.cssText=`pointer-events: none;`,o&&qw(s)?(s.setAttribute(`popover`,`manual`),s.style.cssText+=`position: fixed; inset: 0 auto auto 0; width: 0; height: 0; margin: 0; padding: 0; border: 0; overflow: visible; background: transparent; color: inherit;`):!o&&e.zIndex!==void 0&&(s.style.cssText+=`position: fixed; inset: 0 auto auto 0; width: 0; height: 0; z-index: ${e.zIndex};`),document.body.appendChild(s),s)}function p(e){e.hasAttribute(`popover`)&&(e.matches(`:popover-open`)&&e.hidePopover(),e.showPopover())}function m(e,n){e.setAttribute(`notification-type`,n.type),e.setAttribute(`message`,n.message),n.icon?e.setAttribute(`icon`,n.icon):e.removeAttribute(`icon`)}function h(e){let r=document.createElement(`ixfx-notification-pill`);return r.setAttribute(`notification-id`,e.id),r.style.cssText=Ww(n,i),m(r,e),r.style.opacity=`0`,r.style.transform=Gw(a),r.addEventListener(`pill-tap`,e=>{let n=e;c?.onTap(n.detail.id)}),r}function g(e){d||requestAnimationFrame(()=>{let n=e.getBoundingClientRect().height;n>0&&(u=n,d=!0)})}function _(e){let n=e.length;e.forEach((e,i)=>{let o=l.get(e.id);if(!o)return;let s=o.element,c=0,d=0,f=1,p=`auto`,m=`none`;if(r===`list`){let e=i*(u+8);d=a.vertical===`top`?e:-e}else{let e=i*4;if(d=a.vertical===`top`?e:-e,c=a.horizontal===`left`?e:a.horizontal===`right`?-e:0,i>0){let e=i-1;f=Math.max(.2,.7-e*.15),p=`none`,m=`saturate(0.6)`}}s.style.transition=`opacity 0.2s ease-out, transform 0.2s ease-out`,s.style.opacity=`${f}`,s.style.zIndex=`${n-i}`,s.style.pointerEvents=p,s.style.filter=m,s.style.transform=Kw(a,c,d)})}function v(e){let n=l.get(e);if(!n)return;let r=n.element;r.setAttribute(`dismissing`,`true`);let i=()=>{r.removeEventListener(`transitionend`,i),r.remove(),l.delete(e),s&&l.size===0&&(s.remove(),s=null,d=!1,u=40)};r.addEventListener(`transitionend`,i),setTimeout(i,300)}function y(e,n){let r=f(),i=!1,a=new Set(e.map(e=>e.id));for(let n of e){let e=l.get(n.id);if(e){e.notification=n,m(e.element,n);continue}let a=h(n);l.set(n.id,{element:a,notification:n}),r.appendChild(a),i=!0,g(a)}i&&p(r);for(let[e]of l)a.has(e)||v(e);requestAnimationFrame(()=>_(e))}return{attach(e){c=e},detach(){for(let[e]of l)v(e);s&&=(s.remove(),null)},setNotifications:y}}const Yw={renderer:void 0,timeout:4e3,timeoutError:8e3,queue:!0,queueSize:3,tapBehaviour:`dismiss`,tapHandlerDefault:void 0},Xw=[];let Zw=null,Qw=null;function $w(){return Qw??=Jw({position:`top-right`}),Qw}function eT(){return Zw??$w()}function tT(){eT().setNotifications([...Xw],Yw.queueSize)}function nT(e){e.timer!==null&&(clearTimeout(e.timer),e.timer=null)}function rT(e){let n=e.type===`error`?Yw.timeoutError:Yw.timeout,r=e.wasQueued?n/Yw.queueSize:n;e.timer=window.setTimeout(oT,r,e.id)}function iT(){let e=Xw[0];e&&e.timer===null&&rT(e)}const aT={configure(e){if(e.renderer!==void 0&&(Zw?.detach?.(),Zw=e.renderer,Zw.attach({onTap(e){let n=Xw.find(n=>n.id===e);n&&(n.onTap?n.onTap(e):Yw.tapHandlerDefault?.(n),Yw.tapBehaviour===`dismiss`&&oT(e))}}),tT()),e.timeout!==void 0&&(Yw.timeout=e.timeout),e.timeoutError!==void 0&&(Yw.timeoutError=e.timeoutError),e.queue!==void 0&&(Yw.queue=e.queue),e.queueSize!==void 0){for(Yw.queueSize=Math.max(1,e.queueSize);Xw.length>Yw.queueSize;)nT(Xw.shift());iT(),tT()}e.tapBehaviour!==void 0&&(Yw.tapBehaviour=e.tapBehaviour),e.tapHandlerDefault!==void 0&&(Yw.tapHandlerDefault=e.tapHandlerDefault)},notify(e){let n=crypto.randomUUID(),r=Date.now(),i=e.icon??(e.type===`error`?`error`:void 0),a={...e,icon:i,id:n,createdAt:r,updatedAt:r,timer:null,wasQueued:!1};if(Yw.queue)Xw.length>=Yw.queueSize&&nT(Xw.shift()),a.wasQueued=Xw.length>0,Xw.push(a);else{for(;Xw.length>0;)nT(Xw.pop());Xw.push(a)}return iT(),tT(),n},update(e,n){let r=Xw.find(n=>n.id===e);r&&(Object.assign(r,n),r.updatedAt=Date.now(),Xw[0]===r&&(nT(r),rT(r)),tT())},dismiss(e){oT(e)},dismissAll(){for(let e of Xw)nT(e);Xw.length=0,tT()}};function oT(e){let n=Xw.findIndex(n=>n.id===e);n!==-1&&(nT(Xw.splice(n,1)[0]),iT(),tT())}function sT(e,n){let r=0,i=1/0;for(let a=0;a<e.length;a++){let[o,s]=e[a];if(n<(o+s)/2){let e=Math.abs(n-o);e<i&&(i=e,r=a)}else{let e=Math.abs(n-s);e<i&&(i=e,r=a+1)}}return r}let cT=!1;function lT(){if(cT)return;cT=!0;let e=document.createElement(`style`);e.textContent=`
|
|
10621
10659
|
.ixfx-drag-ghost.ixfx-panel-group-ghost {
|
|
10622
10660
|
padding: var(--space-s, 8px) var(--space-m, 16px);
|
|
10623
10661
|
background: var(--surface-4);
|
|
@@ -10636,7 +10674,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10636
10674
|
height: 1.25em;
|
|
10637
10675
|
flex-shrink: 0;
|
|
10638
10676
|
}
|
|
10639
|
-
`,document.head.appendChild(e)}let
|
|
10677
|
+
`,document.head.appendChild(e)}let uT=class extends n{constructor(...e){super(...e),this.orientation=`horizontal`,this.variant=`titlebar`,this.toggleInteraction=`implicit`,this.collapsible=!0,this.accordion=!1,this.allowReorder=!1,this.stickyHeaders=!0,this._dragState=null,this._suppressNextClick=!1,this._onClickCapture=e=>{this._suppressNextClick&&(this._suppressNextClick=!1,e.preventDefault(),e.stopPropagation())},this._onKeyDown=e=>{let n=this._dragState;if(e.key!==`Escape`||!n?.active)return;e.preventDefault();let r=n.pointerId;this._abortDrag(),this._endDrag(r)},this._onPointerDown=e=>{if(!this.allowReorder||e.button!==0)return;let n=this._findDragTarget(e);if(!n?.parentNode)return;let r=Array.prototype.indexOf.call(n.parentNode.children,n);r<0||(this._dragState={pointerId:e.pointerId,source:n,fromIndex:r,startX:e.clientX,startY:e.clientY,active:!1,ghost:null,gapIndex:void 0},window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerCancel))},this._onPointerMove=e=>{let n=this._dragState;if(!n||e.pointerId!==n.pointerId)return;let r=Math.hypot(e.clientX-n.startX,e.clientY-n.startY);if(!n.active){if(r<5)return;this._beginDrag(e)}n.ghost?.move(e.clientX,e.clientY);let i=this._computeGapIndex(e.clientX,e.clientY);i!==n.gapIndex&&(n.gapIndex=i,this.requestUpdate())},this._onPointerUp=e=>{let n=this._dragState;if(!(!n||e.pointerId!==n.pointerId)){if(n.active){let r=this._computeGapIndex(e.clientX,e.clientY);this._commitDrag(n.source,n.fromIndex,r)}this._endDrag(e.pointerId)}},this._onPointerCancel=e=>{let n=this._dragState;!n||e.pointerId!==n.pointerId||(this._abortDrag(),this._endDrag(e.pointerId))}}_onPanelToggle(e){let n=e.target;if(!n.collapsed&&this.accordion)for(let e of this._panels)e!==n&&(e.collapsed=!0)}connectedCallback(){super.connectedCallback(),this.addEventListener(`click`,this._onClickCapture,!0)}disconnectedCallback(){this.removeEventListener(`click`,this._onClickCapture,!0),this._dragState&&(this._abortDrag(),this._endDrag(this._dragState.pointerId)),super.disconnectedCallback()}firstUpdated(){this.gap!==void 0&&this.style.setProperty(`--group-gap`,this.gap),this.updateComplete.then(()=>{this._propagateAll()})}updated(e){super.updated(e),e.has(`gap`)&&(this.gap===void 0?this.style.removeProperty(`--group-gap`):this.style.setProperty(`--group-gap`,this.gap)),(e.has(`variant`)||e.has(`toggleInteraction`)||e.has(`orientation`)||e.has(`collapsible`)||e.has(`stickyHeaders`))&&this.updateComplete.then(()=>{this._propagateAll()})}_propagateAll(){let e=this.orientation===`horizontal`?`vertical`:`horizontal`;for(let n of this._panels)n.setAttribute(`variant`,this.variant),n.setAttribute(`toggle-interaction`,this.toggleInteraction),n.setAttribute(`orientation`,e),n.toggleAttribute(`sticky-header`,this.stickyHeaders),this.collapsible?n.setAttribute(`collapsible`,``):n.removeAttribute(`collapsible`)}_onSlotChange(){this.updateComplete.then(()=>{this._propagateAll()})}_findDragTarget(e){if(!this.allowReorder)return null;let n=e.composedPath(),r=null,i=!1;for(let e of n){if(!(e instanceof HTMLElement))continue;let n=e.tagName;if(n===`BUTTON`||n===`A`||n===`INPUT`||n===`SELECT`||n===`TEXTAREA`||e.classList.contains(`toolbar`)||e.classList.contains(`close-btn`)||e.classList.contains(`caret-btn`)||e.hasAttribute?.(`slot`)&&e.getAttribute(`slot`)===`toolbar`)return null;n===`IXFX-TITLEBAR`&&(i=!0),!r&&n===`IXFX-PANEL`&&(r=e)}return!r||!i?null:r}_beginDrag(e){let n=this._dragState;if(!(!n||n.active)){try{this.setPointerCapture(e.pointerId)}catch{}n.active=!0,this.setAttribute(`dragging`,``),n.source.setAttribute(`drag-source`,``),n.ghost=this._createGhost(n.source),n.ghost?.move(e.clientX,e.clientY)}}_abortDrag(){let e=this._dragState;e&&(e.source.removeAttribute(`drag-source`),e.gapIndex!==void 0&&(e.gapIndex=void 0,this.requestUpdate()))}_endDrag(e){let n=this._dragState;if(n){n.ghost?.destroy(),n.ghost=null,this.removeAttribute(`dragging`),this._dragState=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel);try{this.releasePointerCapture(e)}catch{}this.requestUpdate()}}_commitDrag(e,n,r){e.removeAttribute(`drag-source`);let i=(this._panels??[]).filter(n=>n!==e),a=r===void 0?i.length:Math.max(0,Math.min(r,i.length)),o=e.parentNode;if(!o)return;let s=i[a]??null;o.insertBefore(e,s);let c=Array.prototype.indexOf.call(o.children,e);c!==n&&(this._suppressNextClick=!0,this.dispatchEvent(new CustomEvent(`reorder`,{bubbles:!0,composed:!0,detail:{fromIndex:n,toIndex:c,panel:e}})))}_createGhost(e){let n=document.createElement(`span`);if(n.style.display=`inline-flex`,n.style.alignItems=`center`,n.style.padding=`0 var(--space-s, 8px)`,n.style.minWidth=`0`,e.iconName){let r=document.createElement(`ixfx-icon`);r.name=e.iconName,n.appendChild(r)}let r=document.createElement(`span`);r.textContent=(e.title||(e.textContent??``).trim()).slice(0,60),r.style.paddingLeft=`1ch`,r.style.overflow=`hidden`,r.style.textOverflow=`ellipsis`,r.style.whiteSpace=`nowrap`,n.appendChild(r);try{return lT(),Gg({anchor:e,content:n,className:`ixfx-panel-group-ghost`})}catch{return null}}_computeGapIndex(e,n){let r=this._dragState;if(!r)return;let i=(this._panels??[]).filter(e=>e!==r.source);if(i.length===0)return 0;let a=this.orientation===`horizontal`,o=a?e:n;return sT(i.map(e=>{let n=e.getBoundingClientRect();return[a?n.left:n.top,a?n.right:n.bottom]}),o)}_computeCaretStyle(){let e=this._dragState;if(!e?.active||e.gapIndex===void 0)return;let n=(this._panels??[]).filter(n=>n!==e.source);if(n.length===0)return;let r=this.getBoundingClientRect();if(!r)return;let i=Math.max(0,Math.min(e.gapIndex,n.length)),a=i<n.length?n[i].getBoundingClientRect():n[n.length-1].getBoundingClientRect();return this.orientation===`horizontal`?`transform: translate(${(i<n.length?a.left:a.right)-r.left-1}px, 0); width: 2px; height: ${r.height}px;`:`transform: translate(0, ${(i<n.length?a.top:a.bottom)-r.top-1}px); width: ${r.width}px; height: 2px;`}render(){let e=this._computeCaretStyle();return i`
|
|
10640
10678
|
<slot
|
|
10641
10679
|
@toggle=${this._onPanelToggle}
|
|
10642
10680
|
@slotchange=${this._onSlotChange}
|
|
@@ -10700,7 +10738,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10700
10738
|
pointer-events: none;
|
|
10701
10739
|
z-index: 1;
|
|
10702
10740
|
}
|
|
10703
|
-
`}};E([d({type:String,reflect:!0})],
|
|
10741
|
+
`}};E([d({type:String,reflect:!0})],uT.prototype,`orientation`,void 0),E([d({type:String})],uT.prototype,`variant`,void 0),E([d({type:String,attribute:`toggle-interaction`})],uT.prototype,`toggleInteraction`,void 0),E([d({type:Boolean})],uT.prototype,`collapsible`,void 0),E([d({type:Boolean,attribute:`accordion`,reflect:!0})],uT.prototype,`accordion`,void 0),E([d({type:Boolean,attribute:`allow-reorder`,reflect:!0})],uT.prototype,`allowReorder`,void 0),E([d({attribute:`sticky-headers`,reflect:!0,converter:{fromAttribute:e=>e!==`false`,toAttribute:e=>e?`true`:`false`}})],uT.prototype,`stickyHeaders`,void 0),E([d()],uT.prototype,`gap`,void 0),E([p({slot:``})],uT.prototype,`_panels`,void 0),uT=E([T(`ixfx-panel-group`)],uT);var dT=Object.defineProperty,fT=(e,n)=>{let r={};for(var i in e)dT(r,i,{get:e[i],enumerable:!0});return n||dT(r,Symbol.toStringTag,{value:`Module`}),r};const pT=Math.pow,mT=1/Math.sqrt(2*Math.PI),hT=(e=.4)=>n=>{let r=mT/e,i=-2.5,a=(n-.5)/e;a*=a,i*=a;let o=r*pT(Math.E,i);return o>1?1:o<0?0:o};var gT=fT({arch:()=>TT,backIn:()=>WT,backInOut:()=>qT,backOut:()=>GT,bell:()=>ZT,bounceIn:()=>XT,bounceInOut:()=>$T,bounceOut:()=>ST,circIn:()=>HT,circInOut:()=>KT,circOut:()=>UT,cubicIn:()=>PT,cubicOut:()=>FT,elasticIn:()=>JT,elasticInOut:()=>QT,elasticOut:()=>YT,expoIn:()=>RT,expoInOut:()=>VT,expoOut:()=>zT,quadIn:()=>AT,quadInOut:()=>NT,quadOut:()=>jT,quartIn:()=>IT,quartOut:()=>LT,quintIn:()=>CT,quintInOut:()=>BT,quintOut:()=>wT,sineIn:()=>OT,sineInOut:()=>MT,sineOut:()=>kT,smootherstep:()=>DT,smoothstep:()=>ET});const _T=Math.sqrt,vT=Math.pow,yT=Math.cos,bT=Math.PI,xT=Math.sin,ST=e=>{let n=7.5625,r=2.75;return e<1/r?n*e*e:e<2/r?n*(e-=1.5/r)*e+.75:e<2.5/r?n*(e-=2.25/r)*e+.9375:n*(e-=2.625/r)*e+.984375},CT=e=>e*e*e*e*e,wT=e=>1-vT(1-e,5),TT=e=>e*(1-e)*4,ET=e=>e*e*(3-2*e),DT=e=>(e*(e*6-15)+10)*e*e*e,OT=e=>1-yT(e*bT/2),kT=e=>xT(e*bT/2),AT=e=>e*e,jT=e=>1-(1-e)*(1-e),MT=e=>-(yT(bT*e)-1)/2,NT=e=>e<.5?2*e*e:1-vT(-2*e+2,2)/2,PT=e=>e*e*e,FT=e=>1-vT(1-e,3),IT=e=>e*e*e*e,LT=e=>1-vT(1-e,4),RT=e=>e===0?0:vT(2,10*e-10),zT=e=>e===1?1:1-vT(2,-10*e),BT=e=>e<.5?16*e*e*e*e*e:1-vT(-2*e+2,5)/2,VT=e=>e===0?0:e===1?1:e<.5?vT(2,20*e-10)/2:(2-vT(2,-20*e+10))/2,HT=e=>1-_T(1-vT(e,2)),UT=e=>_T(1-vT(e-1,2)),WT=e=>2.70158*e*e*e-1.70158*e*e,GT=e=>1+2.70158*vT(e-1,3)+1.70158*vT(e-1,2),KT=e=>e<.5?(1-_T(1-vT(2*e,2)))/2:(_T(1-vT(-2*e+2,2))+1)/2,qT=e=>{let n=2.5949095;return e<.5?vT(2*e,2)*(7.189819*e-n)/2:(vT(2*e-2,2)*(3.5949095*(e*2-2)+n)+2)/2},JT=e=>{let n=2*bT/3;return e===0?0:e===1?1:-vT(2,10*e-10)*xT((e*10-10.75)*n)},YT=e=>{let n=2*bT/3;return e===0?0:e===1?1:vT(2,-10*e)*xT((e*10-.75)*n)+1},XT=e=>1-ST(1-e),ZT=hT(),QT=e=>{let n=2*bT/4.5;return e===0?0:e===1?1:e<.5?-(vT(2,20*e-10)*xT((20*e-11.125)*n))/2:vT(2,-20*e+10)*xT((20*e-11.125)*n)/2+1},$T=e=>e<.5?(1-ST(1-2*e))/2:(1+ST(2*e-1))/2,eE=(e=0,n=0)=>{let r={x:di(e,-1,1,0,1),y:di(e,-1,1,1,0)},i=Rd.interpolate(Math.abs(e),Rd.Empty,r);e!==0&&n>0&&(i=e>0?Rd.interpolate(n,i,{x:0,y:r.x*2}):Rd.interpolate(n,i,{x:r.y*2,y:0}));let a=Ga.cubic(Rd.Empty,Rd.Unit,i,r),o=Ga.interpolator(a);return e=>o(e)},tE=(e,n)=>{O(zr(e,`fn`));let r;return()=>(r===void 0&&(r=Au(n,{clampValue:!0})),e(r()))},nE=(e,n)=>{O(zr(e,`fn`));let r=Fu(),i=Fo(n);if(i===void 0)throw Error(`Param 'duration' not provided`);let a=Pu(i,{timer:r,clampValue:!0});return Lu(e,a)},rE=(e,n)=>{O(zr(e,`fn`));let r;return()=>(r===void 0&&(r=ju(n,{clampValue:!0})),e(r()))},iE=(e,n)=>{O(zr(e,`fn`));let r=Iu(),i=Pu(n,{timer:r,clampValue:!0});return Lu(e,i)};var aE=fT({Named:()=>gT,create:()=>oE,get:()=>pE,getEasingNames:()=>hE,line:()=>eE,tickEasing:()=>uE,ticks:()=>lE,time:()=>cE,timeEasing:()=>sE});const oE=e=>{let n=dE(e.name??`quintIn`)??e.fn;if(n===void 0)throw Error(`Either 'name' or 'fn' must be set`);if(`duration`in e)return cE(n,e.duration);if(`ticks`in e)return lE(n,e.ticks);throw Error(`Expected 'duration' or 'ticks' in options`)},sE=(e,n)=>nE(dE(e),n),cE=(e,n)=>tE(dE(e),n),lE=(e,n)=>rE(dE(e),n),uE=(e,n)=>iE(dE(e),n),dE=e=>{let n=typeof e==`function`?e:pE(e);if(n===void 0)throw Error(typeof e==`string`?`Easing function not found: '${e}'`:`Easing function not found`);return n};let fE;const pE=function(e){O(Br(e,`non-empty`,`easingName`));let n=mE().get(e.toLowerCase());if(n===void 0)throw Error(`Easing not found: '${e}'`);return n};function mE(){if(fE===void 0){fE=new Map;for(let[e,n]of Object.entries(gT))fE.set(e.toLowerCase(),n);return fE}return fE}function*hE(){yield*mE().keys()}const gE=[`green`,`yellow`,`red`],_E=new Map;function vE(e){let n=e.join(`\0`);return _E.has(n)||_E.set(n,ag.scale(e,{stepsBetween:99})),_E.get(n)}function yE(e,n){let r=getComputedStyle(e),i=r.getPropertyValue(n).trim(),a=/var\((--[\w-]+)(?:,(.*))?\)/g;for(let e=0;e<5&&i.includes(`var(`);e++)i=i.replace(a,(e,n,i)=>r.getPropertyValue(n).trim()||(i?i.trim():``));return i}function bE(e){return yE(e,`--plot-color`)||`oklch(60% 0.15 140)`}function xE(e){if(!e.trim())return gE;let n=e.split(`,`).map(e=>e.trim()).filter(Boolean);return n.length>=2?n:gE}function SE(e){try{let n=ag.HslSpace.fromCss(e,{scalar:!0});return{h:n.h,s:n.s,l:n.l}}catch{return{h:.39,s:.5,l:.55}}}function CE(e,n){let r=Math.max(0,Math.min(1,e));if(n.easingName)try{return Math.max(0,Math.min(1,aE.get(n.easingName)(r)))}catch{}return n.valueMap?Math.max(0,Math.min(1,n.valueMap(r))):r}function wE(e,n,r){let i=CE(e,r);switch(r.mode){case`fixed`:return{fill:n,opacity:1};case`opacity`:return{fill:n,opacity:Math.max(.04,i)};case`hue`:{let e=SE(n);return{fill:`hsl(${Math.round(i*360)}deg ${Math.round(e.s*100)}% ${Math.round(e.l*100)}%)`,opacity:1}}case`saturation`:{let e=SE(n);return{fill:`hsl(${Math.round(e.h*360)}deg ${Math.round(i*100)}% ${Math.round(e.l*100)}%)`,opacity:1}}case`lightness`:{let e=SE(n);return{fill:`hsl(${Math.round(e.h*360)}deg ${Math.round(e.s*100)}% ${Math.round(i*100)}%)`,opacity:1}}case`scale`:{let e=vE(r.palette.length>=2?r.palette:gE);return{fill:e[Math.min(e.length-1,Math.floor(i*e.length))],opacity:1}}default:return{fill:n,opacity:1}}}function TE(e,n,r){if(r===`opacity`)return{...e,opacity:e.opacity*Math.max(.08,n**.6)};if(r===`desaturation`){let r=SE(e.fill),i=r.s*n;return{fill:`hsl(${Math.round(r.h*360)}deg ${Math.round(i*100)}% ${Math.round(r.l*100)}%)`,opacity:e.opacity}}return e}var EE=class{#e;#t;#n;#r;constructor(e={}){this.values=[],this.#e=hi(),this.#t={min:0,max:0},this.#n=null,this.#r={capacityLimit:100,persistentScaling:!0,fixedRange:null,...e},this.#r.fixedRange!==null&&(this.#n=this.#r.fixedRange)}setRange(e,n){this.#n={min:e,max:n}}unsetRange(){this.#n=null,this.#i()}get isAutoRange(){return this.#n===null}add(e){if(typeof e==`number`)this.values.push(e),this.isAutoRange&&(this.#t=this.#e.seen(e));else if(this.values.push(...e),this.isAutoRange)for(let n of e)this.#t=this.#e.seen(n);this.values.length>this.#r.capacityLimit&&(this.values=this.values.slice(this.values.length-this.#r.capacityLimit),!this.#r.persistentScaling&&this.isAutoRange&&this.#i())}#i(){this.#r.persistentScaling||(this.#e=hi());for(let e=0;e<this.values.length;e++)this.#t=this.#e.seen(this.values[e])}set(e){e.length>this.#r.capacityLimit&&(e=e.slice(e.length-this.#r.capacityLimit)),this.values=e,this.#i()}get range(){return this.#n?this.#n:this.#t}clear(){let e=this.values.length===0;return this.values=[],this.#r.persistentScaling||this.#i(),!e}};function DE(e){if(typeof e==`number`)return!0;if(typeof e!=`string`)return!1;let n=e.trim();return n!==``&&!Number.isNaN(Number(n))}var OE;let kE=!1;function AE(){if(kE)return;kE=!0;let e=document.createElement(`style`);e.textContent=`
|
|
10704
10742
|
ixfx-tooltip {
|
|
10705
10743
|
display: inline-block;
|
|
10706
10744
|
background: var(--surface-5);
|
|
@@ -10715,7 +10753,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10715
10753
|
ixfx-tooltip .tooltip-type-number {
|
|
10716
10754
|
font-family: var(--font-mono, ui-monospace, monospace);
|
|
10717
10755
|
}
|
|
10718
|
-
`,document.head.appendChild(e)}let
|
|
10756
|
+
`,document.head.appendChild(e)}let jE=class extends n{static{OE=this}constructor(...e){super(...e),this.valueFormatTooltip=OE.defaultFormatter,this.orientation=`top`,this.anchor=`--tooltip`}connectedCallback(){super.connectedCallback(),AE()}static{this.numberFormatter=e=>Math.floor(e).toString()}static{this.defaultFormatter=e=>typeof e==`number`?Number.isInteger(e)?e.toString():e.toFixed(2):typeof e==`string`?e:JSON.stringify(e)}#e(){return this.icon?this.icon.startsWith(`<svg`)?i`<span class="tooltip-icon" style="display:inline-flex;align-items:center;margin-right:0.25em">${g(this.icon)}</span>`:xe(this.icon)?i`<ixfx-icon class="tooltip-icon" style="margin-right:0.25em" name="${this.icon}"></ixfx-icon>`:a:a}render(){let e={tooltip:!0,"tooltip-orientation-top":this.orientation===`top`,"tooltip-orientation-bottom":this.orientation===`bottom`,"tooltip-orientation-right":this.orientation===`right`,"tooltip-orientation-left":this.orientation===`left`,"tooltip-type-text":!0,"tooltip-type-number":!1,"tooltip-style-bubble":!0},n=``;switch(typeof this.value){case`number`:e[`tooltip-type-number`]=!0,n=this.valueFormatTooltip(this.value);break;case`string`:DE(this.value)?(e[`tooltip-type-number`]=!0,n=this.valueFormatTooltip(Number.parseFloat(this.value))):n=this.value;break;default:n=JSON.stringify(this.value)}return i`<output style="--anchor-id: ${this.anchor}" class=${v(e)}>${this.#e()}${n}</output>`}createRenderRoot(){return this}};E([d({type:String})],jE.prototype,`orientation`,void 0),E([d({type:String})],jE.prototype,`anchor`,void 0),E([d()],jE.prototype,`value`,void 0),E([d({type:String})],jE.prototype,`icon`,void 0),jE=OE=E([T(`ixfx-tooltip`)],jE);let ME=null,NE=null;function PE(){if(ME)return ME;let e=document.createElement(`div`);return e.style.cssText=`
|
|
10719
10757
|
position: fixed;
|
|
10720
10758
|
pointer-events: none;
|
|
10721
10759
|
z-index: 9999;
|
|
@@ -10729,13 +10767,13 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10729
10767
|
font-family: ui-monospace, monospace;
|
|
10730
10768
|
opacity: 0;
|
|
10731
10769
|
transition: opacity 0.1s ease;
|
|
10732
|
-
`,document.body.appendChild(e),
|
|
10770
|
+
`,document.body.appendChild(e),ME=e,e}function FE(e,n,r,i){let a=PE();NE=e,a.textContent=i,a.style.whiteSpace=`nowrap`,a.style.left=`${n+14}px`,a.style.top=`${r+14}px`,a.style.opacity=`1`}function IE(e,n,r,i){let a=PE();NE=e,a.innerHTML=i,a.style.whiteSpace=`normal`,a.style.left=`${n+14}px`,a.style.top=`${r+14}px`,a.style.opacity=`1`}function LE(e){if(NE!==e)return;let n=PE();n.style.opacity=`0`,NE=null}let RE=null,zE=null;function BE(){if(RE)return RE;let e=document.createElement(`ixfx-tooltip`);return e.style.cssText=`
|
|
10733
10771
|
position: fixed;
|
|
10734
10772
|
z-index: 9999;
|
|
10735
10773
|
pointer-events: none;
|
|
10736
10774
|
opacity: 0;
|
|
10737
10775
|
transition: opacity 0.12s ease;
|
|
10738
|
-
`,document.body.appendChild(e),
|
|
10776
|
+
`,document.body.appendChild(e),RE=e,e}function VE(e,n,r,i,a){let o=BE();zE=e,o.value=n,a===`horizontal`?(o.style.left=`${r}px`,o.style.top=`${i}px`,o.style.transform=`translate(-50%, -100%)`):(o.style.left=`${i}px`,o.style.top=`${r}px`,o.style.transform=`translate(0, -50%)`),o.style.opacity=`1`}function HE(e){if(zE!==e)return;let n=BE();n.style.opacity=`0`,zE=null}function UE(e,n){return Math.max(1,Math.min(e,n)/25)}function WE(e,n,r){if(r===0)return 3;let i=e/r;return Math.max(1.5,Math.min(i*.45,n*.2,8))}function GE(e,n,r){let i=r-n;return i===0?.5:(e-n)/i}const KE=[`oklch(60% 0.15 30)`,`oklch(60% 0.15 90)`,`oklch(60% 0.15 150)`,`oklch(60% 0.15 210)`,`oklch(60% 0.15 270)`,`oklch(60% 0.15 330)`,`oklch(60% 0.15 60)`,`oklch(60% 0.15 180)`];let qE=class extends n{constructor(...e){super(...e),this.layout=`overlap`,this.gridMinWidth=200,this.valueFormat=e=>e?e.toFixed(2):``,this.#e=new Map,this.#t=[],this.#n=new Set,this.#r=new Map}#e;#t;#n;#r;addData(e,n,r=!1){return this.#i(e,n,r)}setData(e,n,r=!1){let[i,a]=this.#a(e);return this.#n.has(e)||(this.#n.add(e),this.#t.push(e)),i.set(n,r),a&&this.requestUpdate(),i}setObjects(e,n=!1){let r=Object.entries(e);for(let[e,n]of r)this.setData(e,n,!0);n||this.redraw()}redraw(){for(let e of this.#e.values())e.redraw()}addObject(e,n=!1){let r=Object.entries(e);for(let[e,n]of r)this.#i(e,n,!0);n||this.redraw()}styleSeries(e,n){let r={};for(let[e,i]of Object.entries(n))r[e.startsWith(`--`)?e:`--${e}`]=i;let i=this.#e.get(e);if(!i){this.#r.set(e,r);return}for(let[e,n]of Object.entries(r))i.style.setProperty(e,n)}clear(){let e=!1;for(let n of this.#e.values())e||=n.clear();return e}clearSeries(e){let n=this.#e.get(e);return n?(n.clear(),!0):!1}get series(){return[...this.#t]}#i(e,n,r=!1){let[i,a]=this.#a(e);return this.#n.has(e)||(this.#n.add(e),this.#t.push(e)),i.add(n,r),a&&this.requestUpdate(),i}#a(e){let n=this.#e.get(e);if(n)return[n,!1];n=document.createElement(`ixfx-plot-single-axis`),n.tooltips=!1,this.#e.set(e,n);let r=this.#e.size%KE.length;n.style.setProperty(`--plot-color`,KE[r]);let i=this.#r.get(e);if(i){for(let[e,r]of Object.entries(i))n.style.setProperty(e,r);this.#r.delete(e)}return n.addEventListener(`plot-datapoint-click`,n=>{let r=n;this.dispatchEvent(new CustomEvent(`plot-datapoint-click`,{detail:{...r.detail,series:e},bubbles:!0,composed:!0}))}),n.addEventListener(`plot-pointer-move`,e=>{let n=e;this.#o(n.detail.clientX,n.detail.clientY,n.detail.index)}),n.addEventListener(`plot-pointer-leave`,()=>{this.#s()}),[n,!0]}#o(e,n,r){if(r<0){LE(this);return}let i=[];for(let[e,n]of this.#e){let a=n.getValueAt(r);if(a===void 0)continue;let o=getComputedStyle(n).getPropertyValue(`--plot-color`).trim();i.push(`<span style="color:${o}">${this.#c(e)}</span> ${this.valueFormat(a)}`)}if(i.length===0){LE(this);return}IE(this,e,n,i.join(`<br>`))}#s(){LE(this)}#c(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`)}render(){let e=this.layout===`grid`?`--grid-min-width: ${this.gridMinWidth}px`:``;return i`
|
|
10739
10777
|
<div
|
|
10740
10778
|
id="container"
|
|
10741
10779
|
class="layout layout-${this.layout}"
|
|
@@ -10791,7 +10829,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10791
10829
|
grid-template-columns: repeat(auto-fill, minmax(var(--grid-min-width, 200px), 1fr));
|
|
10792
10830
|
gap: var(--space-s, 4px);
|
|
10793
10831
|
}
|
|
10794
|
-
`}};E([d()],
|
|
10832
|
+
`}};E([d()],qE.prototype,`layout`,void 0),E([d({attribute:`grid-min-width`,type:Number})],qE.prototype,`gridMinWidth`,void 0),qE=E([T(`ixfx-plot-multi-axis`)],qE);let X=class extends n{constructor(...e){super(...e),this.orientation=`horizontal`,this.resolution=.1,this.capacity=100,this.title=``,this.paused=!1,this.valueTooltips=`hover`,this.tooltipDelay=400,this.valueUpdateInterval=500,this.interactionMode=`inspect`,this.valueFormat=(e,n,r)=>`${e.toFixed(2)} - ${n.toFixed(2)}: ${r}`,this._width=100,this._height=40,this._hoveredIndex=null,this._inlineOverlayText=null,this._coloredRangeMin=null,this._coloredRangeMax=null,this._selectionStart=null,this._selectionEnd=null,this._isDragging=!1,this._selectionOverlayText=null,this.#e=new EE({capacityLimit:100,persistentScaling:!0}),this.#t=!1,this.#p=null,this.#m=!1,this.#h=null,this.#g=null,this.#_=null,this.#v=null,this.#O=e=>{if(this.interactionMode===`select`&&this._isDragging){let n=this.#f(e.clientX,e.clientY);if(n===this._selectionEnd)return;this._selectionEnd=n;let r=Math.min(this._selectionStart,this._selectionEnd),i=Math.max(this._selectionStart,this._selectionEnd),a=this.#l();if(r<=i){let e=a[r],n=a[i];this.setColoredRange(e.valueMin,n.valueMax),this._selectionOverlayText=`Select: ${e.valueMin.toFixed(2)} – ${n.valueMax.toFixed(2)}`}this.requestUpdate(),this.#s(!1);return}if(this.interactionMode===`select`||this.valueTooltips===`none`)return;let n=this.#d(e.clientX,e.clientY),r=n>=0?n:null;this.valueTooltips===`inline`?this.#D(r):this.#T(r,e.clientX,e.clientY)},this.#k=()=>{if(this.interactionMode===`select`){this._isDragging&&(this._isDragging=!1,this._selectionOverlayText=null,this.requestUpdate(),this.#s(!0));return}this.valueTooltips!==`none`&&(this.valueTooltips===`inline`?this.#D(null):this.#T(null,0,0))},this.#A=e=>{if(this.interactionMode!==`select`)return;let n=this.#f(e.clientX,e.clientY);this._isDragging=!0,this._selectionStart=n,this._selectionEnd=n;let r=this.#l(),i=r[n],a=r[n];this.setColoredRange(i.valueMin,a.valueMax),this._selectionOverlayText=`Select: ${i.valueMin.toFixed(2)} – ${a.valueMax.toFixed(2)}`,this.requestUpdate(),this.#s(!1)},this.#j=()=>{this.interactionMode===`select`&&this._isDragging&&(this._isDragging=!1,this.#s(!0))}}#e;#t;#n(e){return e?e.trim().split(/[,\s;]+/).map(e=>Number.parseFloat(e)).filter(e=>!Number.isNaN(e)):[]}add(e){this.#t=!0,this.#e.add(e),!this.paused&&this.requestUpdate()}set(e){this.#t=!0,this.#e.set(e),!this.paused&&this.requestUpdate()}clear(){this.#e.clear(),this.requestUpdate()}setColoredRange(e,n){this._coloredRangeMin=e,this._coloredRangeMax=n,this.requestUpdate()}clearColoredRange(){this._coloredRangeMin=null,this._coloredRangeMax=null,this.requestUpdate()}setSelection(e,n){let r=this.#l(),i=Math.min(e,n),a=Math.max(e,n),o=Math.max(0,Math.min(i,r.length-1)),s=Math.max(0,Math.min(a,r.length-1));if(this._selectionStart=o,this._selectionEnd=s,o<=s){let e=r[o],n=r[s];this.setColoredRange(e.valueMin,n.valueMax)}this.requestUpdate(),this.#s(!0)}clearSelection(){let e=this._selectionStart!==null||this._selectionEnd!==null;this._selectionStart=null,this._selectionEnd=null,this.requestUpdate(),e&&this.#s(!0)}getSelectedRange(){if(this._selectionStart===null||this._selectionEnd===null)return{barIndices:null,dataValues:null};let e=this.#l(),n=Math.min(this._selectionStart,this._selectionEnd),r=Math.max(this._selectionStart,this._selectionEnd),i=Math.max(0,Math.min(n,e.length-1)),a=Math.max(0,Math.min(r,e.length-1)),o=e[i],s=e[a];return{barIndices:{start:i,end:a},dataValues:{min:o.valueMin,max:s.valueMax}}}firstUpdated(e){if(this._width=this.clientWidth||100,this._height=this.clientHeight||40,new ResizeObserver(e=>{let n=e[0];this._width=n.contentRect.width,this._height=n.contentRect.height}).observe(this),!this.#t){let e=this.#n(this.textContent??``);e.length>0&&this.#e.set(e)}let n=this.getAttribute(`title`);n!==null&&(this.title=n,this.removeAttribute(`title`))}updated(e){if(e.has(`capacity`)){let e=[...this.#e.values];this.#e=new EE({capacityLimit:this.capacity,persistentScaling:!0}),e.length>0&&this.#e.set(e)}e.has(`valueTooltips`)&&this.#S()}disconnectedCallback(){super.disconnectedCallback(),this.#S()}#r(e){return getComputedStyle(this).getPropertyValue(e).trim()}#i(){let e=this.#r(`--plot-histogram-gap`);if(e===``)return 1;let n=Number.parseFloat(e);return Number.isFinite(n)?Math.max(0,n):1}#a(){let e=this.#r(`--plot-histogram-bar-length`);if(e===``||e===`auto`)return null;let n=Number.parseFloat(e);return Number.isFinite(n)?Math.max(0,Math.min(1,n)):null}#o(e,n,r,i){this.dispatchEvent(new CustomEvent(`plot-bucket-click`,{detail:{bucketIndex:e,valueMin:n,valueMax:r,relativeValue:i},bubbles:!0,composed:!0}))}#s(e){this.dispatchEvent(new CustomEvent(`plot-selection-change`,{detail:{...this.getSelectedRange(),committed:e},bubbles:!0,composed:!0}))}#c(){let{values:e,range:n}=this.#e,r=this._width,i=this._height,a=this.orientation===`horizontal`,o=Math.min(4,(a?i:r)*.05),s=this.min??n.min,c=this.max??n.max,l=c-s||1,u=Math.max(1,Math.floor(1/this.resolution)),d=(a?r:i)-o*2,f=(a?i:r)-o*2,p=Array.from({length:u}).fill(0);for(let n of e){let e=(n-s)/l,r=Math.min(u-1,Math.max(0,Math.floor(e*u)));p[r]++}return{w:r,h:i,isHorizontal:a,padding:o,dataMin:s,dataMax:c,dataSpan:l,bucketCount:u,availableMain:d,availableCross:f,buckets:p}}#l(){let{isHorizontal:e,padding:n,dataMin:r,dataSpan:i,bucketCount:a,availableMain:o,availableCross:s,buckets:c}=this.#c(),l=o/a,u=this.#i(),d=this.#a(),f=Math.max(1,...c);return c.map((c,p)=>{let m=c/f,h=d===null?m*s:d*s,g=r+p/a*i,_=r+(p+1)/a*i;if(e){let e=n+p*l,r=p===a-1?Math.max(0,n+o-e):Math.max(0,l-u);return{count:c,valueMin:g,valueMax:_,relativeValue:m,x:e,y:n+s-h,width:r,height:h}}{let e=n+p*l,r=p===a-1?Math.max(0,n+o-e):Math.max(0,l-u);return{count:c,valueMin:g,valueMax:_,relativeValue:m,x:n,y:e,width:h,height:r}}})}#u(e){return this._coloredRangeMin===null||this._coloredRangeMax===null||e.valueMin<this._coloredRangeMax&&e.valueMax>this._coloredRangeMin}#d(e,n){let r=this.getBoundingClientRect(),i=e-r.left,a=n-r.top;return this.#l().findIndex(e=>i>=e.x&&i<=e.x+e.width&&a>=e.y&&a<=e.y+e.height)}#f(e,n){let{isHorizontal:r,padding:i,bucketCount:a,availableMain:o}=this.#c(),s=this.getBoundingClientRect(),c=e-s.left,l=n-s.top,u;return u=r?(c-i)/o:(l-i)/o,u=Math.max(0,Math.min(1,u)),Math.floor(u*a)}#p;#m;#h;#g;#_;#v;#y(){this.#v!==null&&(clearTimeout(this.#v),this.#v=null)}#b(e){this.#y(),this.#v=window.setTimeout(()=>{this.#v=null,e(),this.#b(e)},this.valueUpdateInterval)}#x(){this.#h!==null&&(clearTimeout(this.#h),this.#h=null),this.#g!==null&&(clearTimeout(this.#g),this.#g=null),this.#m&&(this.#m=!1,HE(this)),this.#p=null,this.#_=null}#S(){this.#y(),this.#x(),this._hoveredIndex=null,this._inlineOverlayText=null}#C(e,n,r){let i=this.getBoundingClientRect();return this.orientation===`horizontal`?{mainClient:i.left+e.x+e.width/2,crossClient:r-14}:{mainClient:i.top+e.y+e.height/2,crossClient:n+14}}#w(){if(this.#p===null||!this.#m||!this.#_)return;let e=this.#l()[this.#p];if(!e)return;let n=this.valueFormat(e.valueMin,e.valueMax,e.count);VE(this,n,this.#_.mainClient,this.#_.crossClient,this.orientation)}#T(e,n,r){if(e===this.#p)return;if(this.#p=e,this.#y(),e===null){this.#h!==null&&(clearTimeout(this.#h),this.#h=null),this.#m&&(this.#g=window.setTimeout(()=>{this.#g=null,this.#m=!1,this.#_=null,HE(this)},this.tooltipDelay));return}this.#g!==null&&(clearTimeout(this.#g),this.#g=null);let i=this.#l()[e];if(!i)return;let a=this.valueFormat(i.valueMin,i.valueMax,i.count),o=this.#C(i,n,r);if(this.#_=o,this.#m){VE(this,a,o.mainClient,o.crossClient,this.orientation),this.#b(()=>this.#w());return}this.#h!==null&&clearTimeout(this.#h),this.#h=window.setTimeout(()=>{this.#h=null,this.#m=!0,VE(this,a,o.mainClient,o.crossClient,this.orientation),this.#b(()=>this.#w())},this.tooltipDelay)}#E(e){let n=this.#l()[e];return n?this.valueFormat(n.valueMin,n.valueMax,n.count):null}#D(e){if(e!==this._hoveredIndex){if(this._hoveredIndex=e,this.#y(),e===null){this._inlineOverlayText=null;return}this._inlineOverlayText=this.#E(e),this.#b(()=>{this._hoveredIndex!==null&&(this._inlineOverlayText=this.#E(this._hoveredIndex))})}}#O;#k;#A;#j;render(){let{w:e,h:n,padding:r}=this.#c(),a=this.#l().map((e,n)=>{let r=this.#u(e)?``:`filter: grayscale(1)`;return s`
|
|
10795
10833
|
<rect class="bar" x=${e.x} y=${e.y} width=${e.width} height=${e.height}
|
|
10796
10834
|
style="--value: ${e.relativeValue}; ${r}"
|
|
10797
10835
|
@click=${()=>this.#o(n,e.valueMin,e.valueMax,e.relativeValue)} />
|
|
@@ -10840,37 +10878,37 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10840
10878
|
dominant-baseline: hanging;
|
|
10841
10879
|
pointer-events: none;
|
|
10842
10880
|
}
|
|
10843
|
-
`}};E([d({attribute:`orientation`})],X.prototype,`orientation`,void 0),E([d({type:Number})],X.prototype,`resolution`,void 0),E([d({type:Number})],X.prototype,`min`,void 0),E([d({type:Number})],X.prototype,`max`,void 0),E([d({type:Number})],X.prototype,`capacity`,void 0),E([d({attribute:!1})],X.prototype,`title`,void 0),E([d({type:Boolean,reflect:!0})],X.prototype,`paused`,void 0),E([d({attribute:`value-tooltips`})],X.prototype,`valueTooltips`,void 0),E([d({type:Number,attribute:`tooltip-delay`})],X.prototype,`tooltipDelay`,void 0),E([d({type:Number,attribute:`value-update-interval`})],X.prototype,`valueUpdateInterval`,void 0),E([d({attribute:`interaction-mode`})],X.prototype,`interactionMode`,void 0),E([m()],X.prototype,`_width`,void 0),E([m()],X.prototype,`_height`,void 0),E([m()],X.prototype,`_hoveredIndex`,void 0),E([m()],X.prototype,`_inlineOverlayText`,void 0),E([m()],X.prototype,`_coloredRangeMin`,void 0),E([m()],X.prototype,`_coloredRangeMax`,void 0),E([m()],X.prototype,`_selectionStart`,void 0),E([m()],X.prototype,`_selectionEnd`,void 0),E([m()],X.prototype,`_isDragging`,void 0),E([m()],X.prototype,`_selectionOverlayText`,void 0),X=E([T(`ixfx-plot-histogram`)],X);function
|
|
10844
|
-
d=${
|
|
10881
|
+
`}};E([d({attribute:`orientation`})],X.prototype,`orientation`,void 0),E([d({type:Number})],X.prototype,`resolution`,void 0),E([d({type:Number})],X.prototype,`min`,void 0),E([d({type:Number})],X.prototype,`max`,void 0),E([d({type:Number})],X.prototype,`capacity`,void 0),E([d({attribute:!1})],X.prototype,`title`,void 0),E([d({type:Boolean,reflect:!0})],X.prototype,`paused`,void 0),E([d({attribute:`value-tooltips`})],X.prototype,`valueTooltips`,void 0),E([d({type:Number,attribute:`tooltip-delay`})],X.prototype,`tooltipDelay`,void 0),E([d({type:Number,attribute:`value-update-interval`})],X.prototype,`valueUpdateInterval`,void 0),E([d({attribute:`interaction-mode`})],X.prototype,`interactionMode`,void 0),E([m()],X.prototype,`_width`,void 0),E([m()],X.prototype,`_height`,void 0),E([m()],X.prototype,`_hoveredIndex`,void 0),E([m()],X.prototype,`_inlineOverlayText`,void 0),E([m()],X.prototype,`_coloredRangeMin`,void 0),E([m()],X.prototype,`_coloredRangeMax`,void 0),E([m()],X.prototype,`_selectionStart`,void 0),E([m()],X.prototype,`_selectionEnd`,void 0),E([m()],X.prototype,`_isDragging`,void 0),E([m()],X.prototype,`_selectionOverlayText`,void 0),X=E([T(`ixfx-plot-histogram`)],X);function JE(e){if(e.length===0)return``;let n=`M ${e[0].x},${e[0].y}`;for(let r=1;r<e.length;r++)n+=` L ${e[r].x},${e[r].y}`;return n}function YE(e,n,r,i){return s`<path
|
|
10882
|
+
d=${JE(e)}
|
|
10845
10883
|
fill="none"
|
|
10846
10884
|
stroke=${n.fill}
|
|
10847
10885
|
stroke-width=${r}
|
|
10848
10886
|
opacity=${n.opacity}
|
|
10849
10887
|
stroke-linecap=${i?`round`:`butt`}
|
|
10850
10888
|
stroke-linejoin=${i?`round`:`miter`}
|
|
10851
|
-
/>`}function
|
|
10889
|
+
/>`}function XE(e,n,r,i){if(e.length<2)return s``;let a=JE(e),o=i||n.fill,c=`${a} L ${e[e.length-1].x},${r} L ${e[0].x},${r} Z`;return s`<path d=${c} fill=${o} opacity=${n.opacity*.2} />`}function ZE(e,n,r,i){return e.map((e,a)=>{let o=i===`size`?r*Math.max(.2,e.ageFraction):r;return s`<circle cx=${e.x} cy=${e.y} r=${o} fill=${n[a].fill} opacity=${n[a].opacity} />`})}function QE(e,n,r,i){return e.map((e,a)=>{let o=i===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10852
10890
|
x=${e.x-o/2} y=${e.y-o/2}
|
|
10853
10891
|
width=${o} height=${o}
|
|
10854
10892
|
fill=${n[a].fill} opacity=${n[a].opacity}
|
|
10855
|
-
/>`})}function
|
|
10893
|
+
/>`})}function $E(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<line
|
|
10856
10894
|
x1=${e.x} y1=${i} x2=${e.x} y2=${e.y}
|
|
10857
10895
|
stroke=${n[o].fill} stroke-width=${c} opacity=${n[o].opacity}
|
|
10858
|
-
/>`})}function
|
|
10896
|
+
/>`})}function eD(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?i*Math.max(.2,e.ageFraction):i;return s`<line
|
|
10859
10897
|
x1=${e.x-c/2} y1=${e.y} x2=${e.x+c/2} y2=${e.y}
|
|
10860
10898
|
stroke=${n[o].fill} stroke-width=${r} opacity=${n[o].opacity}
|
|
10861
|
-
/>`})}function
|
|
10899
|
+
/>`})}function tD(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10862
10900
|
x=${e.x-c/2} y=${e.y}
|
|
10863
10901
|
width=${c} height=${Math.max(1,i-e.y)}
|
|
10864
10902
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
10865
|
-
/>`})}function
|
|
10903
|
+
/>`})}function nD(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10866
10904
|
x=${e.x-c/2} y=${i}
|
|
10867
10905
|
width=${c} height=${Math.max(1,e.y-i)}
|
|
10868
10906
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
10869
|
-
/>`})}function
|
|
10907
|
+
/>`})}function rD(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10870
10908
|
x=${e.x-c/2} y=${Math.min(e.y,i)}
|
|
10871
10909
|
width=${c} height=${Math.max(1,Math.abs(e.y-i))}
|
|
10872
10910
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
10873
|
-
/>`})}let
|
|
10911
|
+
/>`})}let iD=class extends n{constructor(...e){super(...e),this.drawStyle=`line-sharp`,this.ageStyle=`none`,this.title=``,this.precise=!1,this.tooltips=!0,this.capacity=100,this.rangeMin=NaN,this.rangeMax=NaN,this.persistentScale=!0,this.paused=!1,this.clickPauses=!1,this.shaded=!1,this.areaColor=``,this.colorMode=`fixed`,this.colorEasing=``,this.colorScale=``,this.colorValueMap=null,this._width=100,this._height=40,this.#e=new EE,this.#t=!1,this.#n=null,this.#r=null,this.valueFormat=e=>e?e.toFixed(2):``,this.#c=e=>{this.#n=e.clientX,this.#r=e.clientY,this.#o(e.clientX,e.clientY);let n=this.#a(e.clientX,this.getBoundingClientRect());this.dispatchEvent(new CustomEvent(`plot-pointer-move`,{detail:{clientX:e.clientX,clientY:e.clientY,index:n},bubbles:!0,composed:!0}))},this.#l=()=>{this.#n=null,this.#r=null,LE(this),this.dispatchEvent(new CustomEvent(`plot-pointer-leave`,{bubbles:!0,composed:!0}))},this.#u=e=>{this.clickPauses&&(this.paused=!this.paused);let n=this.#a(e.clientX,this.getBoundingClientRect());n<0||this.dispatchEvent(new CustomEvent(`plot-datapoint-click`,{detail:{value:this.#e.values[n],index:n},bubbles:!0,composed:!0}))}}#e;#t;#n;#r;#i(e){return e?e.trim().split(/[,\s;]+/).map(e=>Number.parseFloat(e)).filter(e=>!Number.isNaN(e)):[]}add(e,n=!1){this.#t=!0,this.#e.add(e),!this.paused&&(n||this.redraw())}redraw(){this.requestUpdate(),this.#s()}set(e,n=!1){this.#t=!0,this.#e.set(e),!this.paused&&(n||this.redraw())}clear(){let e=this.#e.clear();return this.requestUpdate(),e}firstUpdated(e){if(this._width=this.clientWidth||100,this._height=this.clientHeight||40,new ResizeObserver(e=>{let n=e[0];this._width=n.contentRect.width,this._height=n.contentRect.height}).observe(this),!this.#t){let e=this.#i(this.textContent??``);e.length>0&&this.#e.set(e)}}updated(e){if(e.has(`capacity`)||e.has(`persistentScale`)||e.has(`rangeMin`)||e.has(`rangeMax`)){let e=[...this.#e.values],n=!Number.isNaN(this.rangeMin)&&!Number.isNaN(this.rangeMax)?{min:this.rangeMin,max:this.rangeMax}:null;this.#e=new EE({capacityLimit:this.capacity,persistentScaling:this.persistentScale,fixedRange:n}),e.length>0&&this.#e.set(e)}}#a(e,n){let r=this.#e.values.length;if(r===0)return-1;let i=e-n.left;if(i<0||i>n.width)return-1;let a=n.height<20?0:Math.min(4,n.height*.05),o=n.width-a*2,s=Math.floor((i-a)/(o/r));return s>=0&&s<r?s:-1}#o(e,n){if(!this.tooltips)return;let r=this.getBoundingClientRect(),i=this.#a(e,r);if(i<0){LE(this);return}FE(this,e,n,this.valueFormat(this.#e.values[i]))}#s(){this.#n!==null&&this.#r!==null&&this.#o(this.#n,this.#r)}#c;#l;#u;#d(e,n,r,i,a,o){let s=e.length,c=s>0?a/s:a,l=e=>i+(e+.5)*c;return e.map((e,a)=>{let c=ii(GE(e,n,r)),u=s>1?a/(s-1):1;return{x:l(a),y:i+(1-c)*o,value:e,scaledValue:c,index:a,ageFraction:u}})}get series(){return this.#e}get values(){return this.#e.values}get dataLength(){return this.#e.values.length}getValueAt(e){return this.#e.values[e]}getIndexFromClientX(e){return this.#a(e,this.getBoundingClientRect())}#f(e,n,r,i,a,o,s,c){let l=n.at(-1)??{fill:`currentColor`,opacity:1},u=(this.drawStyle===`line-sharp`||this.drawStyle===`line-round`)&&this.shaded,d=this.areaColor||void 0;if(u)return[XE(e,l,o,d),this.drawStyle===`line-sharp`?YE(e,l,r,!1):YE(e,l,r,!0)];switch(this.drawStyle){case`line-sharp`:return[YE(e,l,r,!1)];case`line-round`:return[YE(e,l,r,!0)];case`circles`:return ZE(e,n,i,this.ageStyle);case`squares`:return QE(e,n,i*2,this.ageStyle);case`vbar`:return $E(e,n,r,o,this.ageStyle);case`hbar`:return eD(e,n,r,a,this.ageStyle);case`hist-bottom`:return tD(e,n,a,o,this.ageStyle);case`hist-top`:return nD(e,n,a,s,this.ageStyle);case`hist-middle`:return rD(e,n,a,c,this.ageStyle);default:return[]}}render(){let{values:e,range:n}=this.#e,r=this._width,a=this._height,o=a<20?0:Math.min(4,a*.05),c=Math.max(1,r-o*2),l=Math.max(1,a-o*2),u=o+l,d=o,f=o+l/2,p=UE(r,a),m=WE(r,a,e.length),h=e.length>0?Math.max(1,c/e.length*.85):c,g=`var(--plot-text, var(--surface-2-text, #fff))`,_=e.length>0?this.#d(e,n.min,n.max,o,c,l):[],v=_.length>0?bE(this):``,y={mode:this.colorMode,palette:xE(this.colorScale),easingName:this.colorEasing,valueMap:this.colorValueMap},b=this.drawStyle!==`line-sharp`&&this.drawStyle!==`line-round`,x=_.map(e=>{let n=wE(e.scaledValue,v,y);return b?TE(n,e.ageFraction,this.ageStyle):n}),S=_.length>0?this.#f(_,x,p,m,h,u,d,f):[],ee=this.title?s`<text
|
|
10874
10912
|
x=${o+2} y=${d+Math.min(10,a*.6)}
|
|
10875
10913
|
class="overlay-text"
|
|
10876
10914
|
fill=${g}
|
|
@@ -10916,7 +10954,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10916
10954
|
dominant-baseline: hanging;
|
|
10917
10955
|
pointer-events: none;
|
|
10918
10956
|
}
|
|
10919
|
-
`}};E([d({attribute:`draw-style`})]
|
|
10957
|
+
`}};E([d({attribute:`draw-style`})],iD.prototype,`drawStyle`,void 0),E([d({attribute:`age-style`})],iD.prototype,`ageStyle`,void 0),E([d()],iD.prototype,`title`,void 0),E([d({type:Boolean})],iD.prototype,`precise`,void 0),E([d({type:Boolean})],iD.prototype,`tooltips`,void 0),E([d({type:Number})],iD.prototype,`capacity`,void 0),E([d({type:Number})],iD.prototype,`rangeMin`,void 0),E([d({type:Number})],iD.prototype,`rangeMax`,void 0),E([d({type:Boolean,attribute:`persistent-scale`})],iD.prototype,`persistentScale`,void 0),E([d({type:Boolean,reflect:!0})],iD.prototype,`paused`,void 0),E([d({type:Boolean,attribute:`click-pauses`})],iD.prototype,`clickPauses`,void 0),E([d({type:Boolean,attribute:`shaded`})],iD.prototype,`shaded`,void 0),E([d({attribute:`area-color`})],iD.prototype,`areaColor`,void 0),E([d({attribute:`color-mode`})],iD.prototype,`colorMode`,void 0),E([d({attribute:`color-easing`})],iD.prototype,`colorEasing`,void 0),E([d({attribute:`color-scale`})],iD.prototype,`colorScale`,void 0),E([m()],iD.prototype,`_width`,void 0),E([m()],iD.prototype,`_height`,void 0),iD=E([T(`ixfx-plot-single-axis`)],iD);let aD=class extends n{constructor(...e){super(...e),this.drawStyle=`circles`,this.ageStyle=`none`,this.title=``,this.precise=!1,this.tooltips=!0,this.capacity=100,this.persistentScale=!0,this.paused=!1,this.clickPauses=!1,this.colorMode=`fixed`,this.colorEasing=``,this.colorScale=``,this.colorValueMap=null,this._width=100,this._height=100,this.#e=new EE({capacityLimit:100,persistentScaling:!0}),this.#t=new EE({capacityLimit:100,persistentScaling:!0}),this.valueFormat=(e,n)=>`${e.toFixed(2)}, ${n.toFixed(2)}`,this.#a=[],this.#o=null,this.#s=null,this.#u=e=>{this.#o=e.clientX,this.#s=e.clientY,this.#c(e.clientX,e.clientY)},this.#d=()=>{this.#o=null,this.#s=null,LE(this)},this.#f=e=>{this.clickPauses&&(this.paused=!this.paused);let n=e.currentTarget.getBoundingClientRect(),r=this.#i(e.clientX,e.clientY,this.#a,n);r&&this.dispatchEvent(new CustomEvent(`plot-datapoint-click`,{detail:{x:r.xVal,y:r.yVal,index:r.index},bubbles:!0,composed:!0}))}}#e;#t;add(e,n){this.#e.add(e),this.#t.add(n),!this.paused&&(this.requestUpdate(),this.#l())}setXY(e,n){this.#e.set(e),this.#t.set(n),!this.paused&&(this.requestUpdate(),this.#l())}clear(){this.#e.clear(),this.#t.clear(),this.requestUpdate()}firstUpdated(e){this._width=this.clientWidth||100,this._height=this.clientHeight||100,new ResizeObserver(e=>{let n=e[0];this._width=n.contentRect.width,this._height=n.contentRect.height}).observe(this)}updated(e){if(e.has(`capacity`)||e.has(`persistentScale`)){let e={capacityLimit:this.capacity,persistentScaling:this.persistentScale},n=[...this.#e.values],r=[...this.#t.values];this.#e=new EE(e),this.#t=new EE(e),n.length>0&&(this.#e.set(n),this.#t.set(r))}}#n(e,n,r){let i=this.#e.values,a=this.#t.values,o=Math.min(i.length,a.length);if(o===0)return[];let{min:s,max:c}=this.#e.range,{min:l,max:u}=this.#t.range;return Array.from({length:o},(d,f)=>({x:e+GE(i[f],s,c)*n,y:e+(1-GE(a[f],l,u))*r,xVal:i[f],yVal:a[f],index:f,ageFraction:o>1?f/(o-1):1}))}#r(e,n){let r={mode:this.colorMode,palette:xE(this.colorScale),easingName:this.colorEasing,valueMap:this.colorValueMap};return e.map(e=>TE(wE(e.ageFraction,n,r),e.ageFraction,this.ageStyle))}#i(e,n,r,i){let a=e-i.left,o=n-i.top,s=null,c=1/0;for(let e of r){let n=e.x-a,r=e.y-o,i=n*n+r*r;i<c&&(c=i,s=e)}return s&&Math.sqrt(c)<30?s:null}#a;#o;#s;#c(e,n){if(!this.tooltips)return;let r=this.getBoundingClientRect(),i=this.#i(e,n,this.#a,r);if(!i){LE(this);return}FE(this,e,n,this.valueFormat(i.xVal,i.yVal))}#l(){this.#o!==null&&this.#s!==null&&this.#c(this.#o,this.#s)}#u;#d;#f;render(){let e=this._width,n=this._height,r=Math.min(6,Math.min(e,n)*.06),a=Math.max(1,e-r*2),o=Math.max(1,n-r*2),c=this.#n(r,a,o);this.#a=c;let l=c.length>0?bE(this):``,u=this.#r(c,l),d=WE(e,n,c.length),f=`var(--plot-text, var(--surface-2-text, #fff))`,p=c.map((e,n)=>{let r=u[n],i=this.ageStyle===`size`?Math.max(.2,e.ageFraction):1;if(this.drawStyle===`circles`){let n=d*i;return s`<circle cx=${e.x} cy=${e.y} r=${n} fill=${r.fill} opacity=${r.opacity} />`}let a=d*2*i;return s`<rect x=${e.x-a/2} y=${e.y-a/2} width=${a} height=${a} fill=${r.fill} opacity=${r.opacity} />`}),m=this.title?s`<text
|
|
10920
10958
|
x=${r+2} y=${r+2}
|
|
10921
10959
|
class="overlay-text"
|
|
10922
10960
|
fill=${f}
|
|
@@ -10961,7 +10999,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
10961
10999
|
dominant-baseline: hanging;
|
|
10962
11000
|
pointer-events: none;
|
|
10963
11001
|
}
|
|
10964
|
-
`}};E([d({attribute:`draw-style`})],
|
|
11002
|
+
`}};E([d({attribute:`draw-style`})],aD.prototype,`drawStyle`,void 0),E([d({attribute:`age-style`})],aD.prototype,`ageStyle`,void 0),E([d()],aD.prototype,`title`,void 0),E([d({type:Boolean})],aD.prototype,`precise`,void 0),E([d({type:Boolean})],aD.prototype,`tooltips`,void 0),E([d({type:Number})],aD.prototype,`capacity`,void 0),E([d({type:Boolean,attribute:`persistent-scale`})],aD.prototype,`persistentScale`,void 0),E([d({type:Boolean,reflect:!0})],aD.prototype,`paused`,void 0),E([d({type:Boolean,attribute:`click-pauses`})],aD.prototype,`clickPauses`,void 0),E([d({attribute:`color-mode`})],aD.prototype,`colorMode`,void 0),E([d({attribute:`color-easing`})],aD.prototype,`colorEasing`,void 0),E([d({attribute:`color-scale`})],aD.prototype,`colorScale`,void 0),E([m()],aD.prototype,`_width`,void 0),E([m()],aD.prototype,`_height`,void 0),aD=E([T(`ixfx-plot-xy-axis`)],aD);const oD=Math.PI/180,sD=180/Math.PI;function cD(e,n){let r=n*50;return{x:50+Math.cos(e)*r,y:50+Math.sin(e)*r}}function lD(e,n){let r=e-50,i=n-50,a=Math.sqrt(r*r+i*i),o=Math.min(1,a/50);return{angleRad:(Math.atan2(i,r)%(2*Math.PI)+2*Math.PI)%(2*Math.PI),radius:o}}const uD=e=>Math.max(0,Math.min(1,e));function dD(e,n,r,i){if(r<=0||!i)return e;let a=360/r,o=(e%360+360)%360,s=Math.round(o/a)*a,c=o%a;if(Math.abs(c)<1e-4||Math.abs(a-c)<1e-4){let r=e-n;return r>180&&(r-=360),r<-180&&(r+=360),(s+(r>=0?1:-1)*a+360)%360}return s}function fD(e,n,r,i){if(r<=0||!i)return e;let a=1/r,o=Math.round(e/a)*a,s=e%a;return Math.abs(s)<1e-4||Math.abs(a-s)<1e-4?Math.max(0,Math.min(1,o+(e>=n?1:-1)*a)):o}function pD(e,n){if(!n||n<=1)return e;let r=360/n,i=(e%360+360)%360;return Math.round(i/r)*r}function mD(e,n){if(!n||n<=1)return e;let r=1/n;return Math.round(e/r)*r}let hD=class extends qy(n){constructor(...e){super(...e),this.angle=0,this.radius=.5,this.rings=0,this.rays=0,this.showRay=!1,this.showOrigin=!1,this.hideCursor=!1,this.snapValue=!1,this.disabled=!1,this._dragging=!1,this._dragStartAngle=0,this._dragStartRadius=0,this._pressedKeys=new Set,this._prevAngle=0,this._prevRadius=0,this._onPointerDown=e=>{e.preventDefault(),this.renderRoot.querySelector(`svg`)?.focus();let n=this.renderRoot.querySelector(`.polar-pad-area`);n&&n.setPointerCapture(e.pointerId),this._dragging=!0,this._dragStartAngle=this.angle,this._dragStartRadius=this.radius,this.setAttribute(`dragging`,``),this._updateFromPointer(e),globalThis.addEventListener(`pointermove`,this._onPointerMove),globalThis.addEventListener(`pointerup`,this._onPointerUp)},this._onPointerMove=e=>{this._dragging&&(e.preventDefault(),this._updateFromPointer(e))},this._onPointerUp=()=>{let e=this.angle!==this._dragStartAngle||this.radius!==this._dragStartRadius;this._dragging=!1,this.removeAttribute(`dragging`),globalThis.removeEventListener(`pointermove`,this._onPointerMove),globalThis.removeEventListener(`pointerup`,this._onPointerUp),e&&this.dispatchEvent(new CustomEvent(`change`,{detail:{angle:this.angle,radius:this.radius},bubbles:!0,composed:!0}))},this._onKeyDown=e=>{if(!this.disabled){if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key))e.preventDefault(),this._pressedKeys.add(e.key),this._handleKeyboardMove(e.shiftKey);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let n=e.key===`Home`?0:1;n!==this.radius&&(this._prevRadius=this.radius,this.radius=n,this.dispatchEvent(new CustomEvent(`input`,{detail:{angle:this.angle,radius:this.radius},bubbles:!0,composed:!0})))}}},this._onKeyUp=e=>{this._pressedKeys.delete(e.key)},this._handleKeyboardMove=e=>{let n=this.stopsAngle??this.stops,r=this.stopsRadius??this.stops,i=Ky(360,n,this.stepAngle,e),a=Ky(1,r,this.stepRadius,e);this._prevAngle=this.angle,this._prevRadius=this.radius;let o=this.angle,s=this.radius;this._pressedKeys.has(`ArrowLeft`)&&(o-=i),this._pressedKeys.has(`ArrowRight`)&&(o+=i),this._pressedKeys.has(`ArrowUp`)&&(s=Math.min(1,s+a)),this._pressedKeys.has(`ArrowDown`)&&(s=Math.max(0,s-a)),o=(o%360+360)%360;let c=dD(o,this._prevAngle,this.rays,this.snapValue),l=fD(s,this._prevRadius,this.rings,this.snapValue);c=pD(c,n),l=mD(l,r),(c!==this.angle||l!==this.radius)&&(this.angle=c,this.radius=l,this.dispatchEvent(new CustomEvent(`input`,{detail:{angle:this.angle,radius:this.radius},bubbles:!0,composed:!0})))},this._uid=Math.random().toString(36).slice(2,8)}static{this.styles=[cn,w,r`
|
|
10965
11003
|
:host {
|
|
10966
11004
|
display: block;
|
|
10967
11005
|
width: 200px;
|
|
@@ -11094,7 +11132,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11094
11132
|
stroke: var(--accent);
|
|
11095
11133
|
stroke-width: 3;
|
|
11096
11134
|
}
|
|
11097
|
-
`]}_updateFromPointer(e){let n=this.renderRoot.querySelector(`.polar-pad-area`);if(!n)return;let r=n.getBoundingClientRect(),i=Math.min(r.width,r.height),{angleRad:a,radius:o}=
|
|
11135
|
+
`]}_updateFromPointer(e){let n=this.renderRoot.querySelector(`.polar-pad-area`);if(!n)return;let r=n.getBoundingClientRect(),i=Math.min(r.width,r.height),{angleRad:a,radius:o}=lD((e.clientX-r.left)/i*100,(e.clientY-r.top)/i*100),s=a*sD,c=uD(o);this._prevAngle=this.angle,this._prevRadius=this.radius;let l=dD(s,this._prevAngle,this.rays,this.snapValue),u=fD(c,this._prevRadius,this.rings,this.snapValue),d=this.stopsAngle??this.stops,f=this.stopsRadius??this.stops;this.angle=pD(l,d),this.radius=mD(u,f),this._prevAngle=s,this._prevRadius=c,this.dispatchEvent(new CustomEvent(`input`,{detail:{angle:this.angle,radius:this.radius},bubbles:!0,composed:!0}))}_stepRadiusByDelta(e,n){let r=this.stopsRadius??this.stops,i=Ky(1,r,this.stepRadius,n);this._prevRadius=this.radius;let a=mD(fD(e===1?Math.min(1,this.radius+i):Math.max(0,this.radius-i),this._prevRadius,this.rings,this.snapValue),r);a!==this.radius&&(this.radius=a,this.dispatchEvent(new CustomEvent(`input`,{detail:{angle:this.angle,radius:this.radius},bubbles:!0,composed:!0})))}_applyWheelDelta(e,n){this._stepRadiusByDelta(e,n.shiftKey)}_setCssVars(){this.style.setProperty(`--angle-deg`,`${this.angle}`),this.style.setProperty(`--angle-rad`,`${this.angle*oD}`),this.style.setProperty(`--radius-pct`,`${uD(this.radius)*100}`)}updated(e){super.updated(e),this._setCssVars()}disconnectedCallback(){super.disconnectedCallback(),this._onPointerUp(),this._pressedKeys.clear()}_renderRings(){if(this.rings<=0)return``;let e=[];for(let n=1;n<=this.rings;n++){let r=n/this.rings*50;e.push(s`<circle class="ring" cx="50" cy="50" r="${r}" />`)}return e}_renderSpokes(){if(this.rays<=0)return``;let e=[];for(let n=0;n<this.rays;n++){let r=n/this.rays*2*Math.PI,i=Math.cos(r),a=Math.sin(r),o=50+i*50,c=50+a*50,l=50-i*50,u=50-a*50;e.push(s`<line class="spoke" x1="${o}" y1="${c}" x2="${l}" y2="${u}" />`)}return e}_renderRay(e,n){return this.showRay?s`<line class="ray" x1="50" y1="50" x2="${e}" y2="${n}" />`:``}_renderOrigin(){return this.showOrigin?s`<circle class="origin-dot" cx="50" cy="50" r="3" style="r: calc(var(--origin-size) / 2)" />`:``}render(){let{x:e,y:n}=cD(this.angle*oD,uD(this.radius));return i`
|
|
11098
11136
|
<div class="polar-pad-area"
|
|
11099
11137
|
@pointerdown=${this._onPointerDown}
|
|
11100
11138
|
@keydown=${this._onKeyDown}
|
|
@@ -11133,7 +11171,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11133
11171
|
/>
|
|
11134
11172
|
</svg>
|
|
11135
11173
|
</div>
|
|
11136
|
-
`}};E([d({type:Number})],
|
|
11174
|
+
`}};E([d({type:Number})],hD.prototype,`angle`,void 0),E([d({type:Number})],hD.prototype,`radius`,void 0),E([d({type:Number})],hD.prototype,`rings`,void 0),E([d({type:Number})],hD.prototype,`rays`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-ray`})],hD.prototype,`showRay`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-origin`})],hD.prototype,`showOrigin`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-cursor`})],hD.prototype,`hideCursor`,void 0),E([d({type:Boolean,attribute:`snap-value`,reflect:!0})],hD.prototype,`snapValue`,void 0),E([d({type:Boolean,reflect:!0})],hD.prototype,`disabled`,void 0),E([d({type:Number})],hD.prototype,`stops`,void 0),E([d({type:Number,attribute:`stops-angle`})],hD.prototype,`stopsAngle`,void 0),E([d({type:Number,attribute:`stops-radius`})],hD.prototype,`stopsRadius`,void 0),E([d({type:Number,attribute:`step-angle`})],hD.prototype,`stepAngle`,void 0),E([d({type:Number,attribute:`step-radius`})],hD.prototype,`stepRadius`,void 0),hD=E([T(`ixfx-polar-pad`)],hD);const gD=r`
|
|
11137
11175
|
|
|
11138
11176
|
output.tooltip {
|
|
11139
11177
|
user-select: none;
|
|
@@ -11230,7 +11268,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11230
11268
|
100% calc(50% + var(--b)/2));
|
|
11231
11269
|
}
|
|
11232
11270
|
}
|
|
11233
|
-
`;function
|
|
11271
|
+
`;function _D(e,n,r){return r===n?0:(e-n)/(r-n)}let vD=class extends qy(n){constructor(...e){super(...e),this.min=0,this.max=1,this.value=0,this.step=.01,this.orientation=`horizontal`,this.swipeable=!1,this.tooltip=!1,this.tooltipOrientation=`top`,this._swipeModified=!1,this._onPointerDown=e=>{this.swipeable&&(e.preventDefault(),this._swipeModified=!1,this._applySwipeValue(this._valueFromPointer(e)),window.addEventListener(`pointerup`,this._onWindowPointerUp,{once:!0}))},this._onPointerMove=e=>{!this.swipeable||e.buttons===0||this._applySwipeValue(this._valueFromPointer(e))},this._onPointerEnter=e=>{!this.swipeable||e.buttons===0||(this._swipeModified=!1,this._applySwipeValue(this._valueFromPointer(e)),window.addEventListener(`pointerup`,this._onWindowPointerUp,{once:!0}))},this._onPointerLeave=e=>{!this.swipeable||!this._swipeModified||(this._swipeModified=!1,this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value},bubbles:!0,composed:!0})))},this._onWindowPointerUp=()=>{this._swipeModified&&(this._swipeModified=!1,this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value},bubbles:!0,composed:!0})))},this._handleInput=e=>{e.preventDefault(),e.stopImmediatePropagation();let n=e.target,r=Number.parseFloat(n.value);this.value=r,this.style.setProperty(`--value`,String(_D(r,this.min,this.max))),this.dispatchEvent(new CustomEvent(`input`,{detail:{value:r},bubbles:!0,composed:!0}))},this._handleChange=()=>{let e=Number.parseFloat(this._inputEl.value);this.dispatchEvent(new CustomEvent(`change`,{detail:{value:e},bubbles:!0,composed:!0}))}}connectedCallback(){super.connectedCallback(),this.addEventListener(`pointerdown`,this._onPointerDown),this.addEventListener(`pointermove`,this._onPointerMove),this.addEventListener(`pointerenter`,this._onPointerEnter),this.addEventListener(`pointerleave`,this._onPointerLeave)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointerdown`,this._onPointerDown),this.removeEventListener(`pointermove`,this._onPointerMove),this.removeEventListener(`pointerenter`,this._onPointerEnter),this.removeEventListener(`pointerleave`,this._onPointerLeave),window.removeEventListener(`pointerup`,this._onWindowPointerUp)}_valueFromPointer(e){let n=this.getBoundingClientRect(),r=this.orientation===`vertical`?Math.max(0,Math.min(1,1-(e.clientY-n.top)/n.height)):Math.max(0,Math.min(1,(e.clientX-n.left)/n.width)),i=this.min+r*(this.max-this.min),a=Math.round((i-this.min)/this.step)*this.step+this.min;return Math.max(this.min,Math.min(this.max,a))}_applySwipeValue(e){this.value=e,this._inputEl&&(this._inputEl.value=String(e)),this.style.setProperty(`--value`,String(_D(e,this.min,this.max))),this.dispatchEvent(new CustomEvent(`input`,{detail:{value:e},bubbles:!0,composed:!0})),this._swipeModified=!0}updated(e){super.updated(e),(e.has(`value`)||e.has(`min`)||e.has(`max`))&&this.style.setProperty(`--value`,String(_D(this.value,this.min,this.max))),this._tooltipEl&&(this._tooltipEl.valueFormatTooltip=e=>{let n=typeof e==`number`?e:Number(e);if(this.labelFormatter)return this.labelFormatter(n,_D(n,this.min,this.max));let r=this.step>=1?0:this.step>=.1?1:2;return n.toFixed(r)})}_formatTooltipLabel(){let e=_D(this.value,this.min,this.max);if(this.labelFormatter)return this.labelFormatter(this.value,e);let n=this.step>=1?0:this.step>=.1?1:2;return this.value.toFixed(n)}_applyWheelDelta(e,n){let r=this._inputEl;if(!r)return;let i=this.step>0?this.step:Math.max((this.max-this.min)/100,.01),a=this.value+e*i,o=Math.min(this.max,Math.max(this.min,a));o!==this.value&&(r.value=String(o),r.dispatchEvent(new CustomEvent(`input`,{detail:{value:o},bubbles:!0})),r.dispatchEvent(new CustomEvent(`change`,{detail:{value:o},bubbles:!0})))}render(){let e=this.tooltip?i`
|
|
11234
11272
|
<ixfx-tooltip
|
|
11235
11273
|
style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)"
|
|
11236
11274
|
.orientation=${this.tooltipOrientation}
|
|
@@ -11250,7 +11288,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11250
11288
|
@change=${this._handleChange}
|
|
11251
11289
|
>${e}
|
|
11252
11290
|
</div>
|
|
11253
|
-
`}static{this.styles=[w,
|
|
11291
|
+
`}static{this.styles=[w,gD,r`
|
|
11254
11292
|
:host {
|
|
11255
11293
|
display: block;
|
|
11256
11294
|
container-type: size;
|
|
@@ -11530,14 +11568,14 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11530
11568
|
:host([swipeable][orientation="vertical"]):hover .range-bg {
|
|
11531
11569
|
background: var(--background-track-hover-vertical, var(--_bg-track-hover));
|
|
11532
11570
|
}
|
|
11533
|
-
`]}};E([d({type:Number})],
|
|
11571
|
+
`]}};E([d({type:Number})],vD.prototype,`min`,void 0),E([d({type:Number})],vD.prototype,`max`,void 0),E([d({type:Number})],vD.prototype,`value`,void 0),E([d({type:Number})],vD.prototype,`step`,void 0),E([d({type:String,reflect:!0})],vD.prototype,`orientation`,void 0),E([d({type:Boolean,reflect:!0})],vD.prototype,`swipeable`,void 0),E([d({type:Boolean})],vD.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],vD.prototype,`tooltipOrientation`,void 0),E([d({attribute:!1})],vD.prototype,`labelFormatter`,void 0),E([f(`input`)],vD.prototype,`_inputEl`,void 0),E([f(`ixfx-tooltip`)],vD.prototype,`_tooltipEl`,void 0),vD=E([T(`ixfx-range-input`)],vD);function yD(e){return{client:{x:e.clientX,y:e.clientY},offset:{x:e.offsetX,y:e.offsetY}}}function bD(e,n){let r=yD(e),i=e=>{n.progress(yD(e),r)},a=e=>{document.removeEventListener(`pointermove`,i),document.removeEventListener(`pointerup`,a),n.complete(yD(e),r)};document.addEventListener(`pointermove`,i),document.addEventListener(`pointerup`,a)}function xD(e,n){let r=e-n,i=e+n;return e=>e>=r&&e<=i}let SD=class extends n{constructor(...e){super(...e),this.tooltip=!0,this.tooltipOrientation=`top`,this.crossover=`allow`,this.resizeMode=`dual`,this.orientation=`horizontal`,this.step=1,this.a=0,this.b=50,this.#e=100,this.#t=0,this.#n=e=>e,this.#r=e=>e,this.#i=e=>e,this.draggingThumb=`none`}#e;#t;#n;#r;#i;#a(){this.#n=fi(this.#t,this.#e,0,100),this.#r=fi(0,100,this.#t,this.#e),this.#i=ai(this.#t,this.#e),this.a=this.#i(this.a),this.b=this.#i(this.b)}set max(e){this.#e=e,this.#a()}get max(){return this.#e}set min(e){this.#t=e,this.#a()}get min(){return this.#t}_onInput(e){e.stopPropagation();let n=e.target,r=this.#r(n.valueAsNumber),i=n.id,a=this.a,o=this.b;if(this.resizeMode===`none`){let e=r-(i===`a`?this.a:this.b),s=this.a+e,c=this.b+e;if(s<this.min&&(e=this.min-this.a),c>this.max&&(e=this.max-this.b),e===0){n.valueAsNumber=this.#n(i===`a`?this.a:this.b);return}a=this.a+e,o=this.b+e}else if(this.resizeMode===`bipolar`){let e,s;if(i===`a`){let n=r-this.a;e=r,s=this.b-n}else{let n=r-this.b;e=this.a-n,s=r}if(e<this.min||s>this.max||e>this.max||s<this.min){n.valueAsNumber=this.#n(i===`a`?this.a:this.b);return}a=e,o=s}else if(this.resizeMode===`bipolar-flex`){let e,s;if(i===`a`){if(e=r,this.b<=this.min)s=this.min;else if(this.b>=this.max)s=this.max;else{let e=r-this.a;s=this.b-e}}else if(s=r,this.a<=this.min)e=this.min;else if(this.a>=this.max)e=this.max;else{let n=r-this.b;e=this.a-n}if(e<this.min&&(e=this.min),e>this.max&&(e=this.max),s<this.min&&(s=this.min),s>this.max&&(s=this.max),e>s){n.valueAsNumber=this.#n(i===`a`?this.a:this.b);return}a=e,o=s}else if(i===`a`)r>this.b&&this.crossover===`stop`?n.valueAsNumber=this.#n(this.a):a=r;else if(i===`b`)r<a&&this.crossover===`stop`?n.valueAsNumber=this.#n(this.b):o=r;else throw Error(`Expected 'a' or 'b', got: '${n.id}'`);this.setPoles(a,o)}setPoles(e,n){let r=e!==this.a,i=n!==this.b;this.a=this.#i(e),this.b=this.#i(n),this.dispatchEvent(new CustomEvent(`input`,{detail:{a:this.a,b:this.b,changed:r&&i?`both`:r?`a`:`b`}}))}_onPointerDown(e){let n=this.a,r=this.b;this.valuesAtPointerDown={a:n,b:r};let i=e.target.getBoundingClientRect(),a=this.orientation===`vertical`,o=a?i.height:i.width,s=o/(this.max-this.min),c=a?e.offsetY:e.offsetX,l=e=>a?this.max-e*s:e*s,u=e=>a?o-e*s:e*s,d=u(n),f=u(r);if(a?(this.b<this.a?c>f:c<f)||(this.b<this.a?c<d:c>d):this.b<this.a&&c<f||this.b>this.a&&c>f||this.a<this.b&&c<d||this.a>this.b&&c>d){if(this.resizeMode===`none`||this.resizeMode===`bipolar`||this.resizeMode===`bipolar-flex`){let e=l(c)-this.b;this.a+e<this.min&&(e=this.min-this.a),this.b+e>this.max&&(e=this.max-this.b);let n=this.a+e,r=this.b+e;n>=this.min&&r<=this.max&&this.setPoles(n,r)}else this.b=l(c);return}let p=xD(d,10),m=xD(f,10),h=i=>{let o=this.setPoles.bind(this),c=this.resizeMode,u=this.min,p=this.max,m=a?e.offsetY:e.offsetX,h=!1;bD(e,{progress(e,l){let d=a?e.offset.y:e.offset.x,f=(a?m-d:d-m)/s;if(h=!0,i===`a`){if(c===`bipolar`){let e=n+f,i=r-f;if(e<u||i>p||e>p||i<u)return;o(e,i)}else if(c===`bipolar-flex`){let e=n+f,i=r;if(r<=u?i=u:r>=p?i=p:(e=n+f,i=r-f),e<u&&(e=u),e>p&&(e=p),i<u&&(i=u),i>p&&(i=p),e>i)return;o(e,i)}else{let e=f;n+f<u&&(e=u-n),r+e>p&&(e=p-r);let i=n+e,a=r+e;i>=u&&a<=p&&o(i,a)}}else if(i===`b`){if(c===`bipolar`){let e=n-f,i=r+f;if(e<u||i>p||e>p||i<u)return;o(e,i)}else if(c===`bipolar-flex`){let e=n,i=r+f;if(n<=u?e=u:n>=p?e=p:(e=n-f,i=r+f),e<u&&(e=u),e>p&&(e=p),i<u&&(i=u),i>p&&(i=p),e>i)return;o(e,i)}else{let e=f;n+f<u&&(e=u-n),r+e>p&&(e=p-r);let i=n+e,a=r+e;i>=u&&a<=p&&o(i,a)}}else if(c===`bipolar`){let e=n+f,i=r+f;if(e<u||i>p)return;o(e,i)}else if(c===`bipolar-flex`){let e=n+f,i=r+f;if(e<u?(e=u,i=u+(r-n)):i>p&&(i=p,e=p-(r-n)),e<u||i>p||e>i)return;o(e,i)}else{let e=f;n+f<u&&(e=u-n),r+e>p&&(e=p-r);let i=n+e,a=r+e;i>=u&&a<=p&&o(i,a)}},complete(i,s){if(!h){let i=a?e.offsetY:e.offsetX;Math.abs(i-d)<Math.abs(i-f)?o(l(i),r):o(n,l(i))}}})};if(p(c)){if(this.draggingThumb=`a`,this.resizeMode===`dual`)return!1;e.preventDefault(),e.target.setPointerCapture(e.pointerId),h(`a`);return}if(m(c)){if(this.draggingThumb=`b`,this.resizeMode===`dual`)return!1;e.preventDefault(),e.target.setPointerCapture(e.pointerId),h(`b`);return}this.draggingThumb=`none`,e.preventDefault(),e.target.setPointerCapture(e.pointerId),h(`none`)}firstUpdated(e){this.#a()}render(){let e=this.tooltip?i`<ixfx-tooltip style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)" anchor="--a-tooltip" .orientation=${this.tooltipOrientation} .value=${this.a}></ixfx-tooltip>`:a,n=this.tooltip?i`<ixfx-tooltip style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)" anchor="--b-tooltip" .orientation=${this.tooltipOrientation} .value=${this.b}></ixfx-tooltip>`:a,r=this.#n(this.a),o=this.#n(this.b),s=this.orientation===`vertical`?`writing-mode: vertical-lr; direction: rtl;`:a;return i`
|
|
11534
11572
|
<div @pointerdown=${this._onPointerDown} @input=${this._onInput} style="--a: ${r}; --b: ${o}">
|
|
11535
11573
|
<input class="thumb-round" .value=${r} id="a" step=${this.step} type="range" style="${s}" anchor="--a-tooltip" />
|
|
11536
11574
|
${e}
|
|
11537
11575
|
|
|
11538
11576
|
<input class="thumb-round" .value=${o} id="b" step=${this.step} type="range" style="${s}" anchor="--b-tooltip" />
|
|
11539
11577
|
${n}
|
|
11540
|
-
</div>`}static{this.styles=[w,
|
|
11578
|
+
</div>`}static{this.styles=[w,gD,cn,r`
|
|
11541
11579
|
:host {
|
|
11542
11580
|
display: grid;
|
|
11543
11581
|
--value-label-color: unset;
|
|
@@ -11682,14 +11720,14 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11682
11720
|
[type=range]:focus, [type=range]:focus + ixfx-tooltip, [type=range]:hover, [type=range]:hover + ixfx-tooltip {
|
|
11683
11721
|
--sel: 1 ;
|
|
11684
11722
|
}
|
|
11685
|
-
`]}};E([d({type:Boolean})],
|
|
11723
|
+
`]}};E([d({type:Boolean})],SD.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],SD.prototype,`tooltipOrientation`,void 0),E([d({type:String})],SD.prototype,`crossover`,void 0),E([d({type:String,attribute:`resize-mode`})],SD.prototype,`resizeMode`,void 0),E([d({type:String,reflect:!0})],SD.prototype,`orientation`,void 0),E([d()],SD.prototype,`step`,void 0),E([d({type:Number})],SD.prototype,`a`,void 0),E([d({type:Number})],SD.prototype,`b`,void 0),E([d({type:Number})],SD.prototype,`max`,null),E([d({type:Number})],SD.prototype,`min`,null),E([u({capture:!0})],SD.prototype,`_onInput`,null),E([u({capture:!0})],SD.prototype,`_onPointerDown`,null),SD=E([T(`ixfx-range-multi`)],SD);let CD=class extends qy(n){constructor(...e){super(...e),this.tooltip=!0,this.tooltipOrientation=`top`,this.orientation=`horizontal`,this.disabled=!1,this.min=0,this.max=100,this.#e=0,this.step=0}set value(e){this.#e=e}get value(){return this.#e}#e;onRangeInput(e){let n=e.target.valueAsNumber,r=e.target.value;if(this.#e=n,this.tooltip){let e=this.shadowRoot?.querySelector(`output`);e?e.value=r:console.warn(`Output element not found`)}}_applyWheelDelta(e,n){let r=this.renderRoot?.querySelector(`input[type=range]`);if(!r)return;let i=this.step>0?this.step:Math.max((this.max-this.min)/100,.01),a=this.#e+e*i,o=Math.min(this.max,Math.max(this.min,a));o!==this.#e&&(r.value=String(o),r.dispatchEvent(new Event(`input`,{bubbles:!0})),r.dispatchEvent(new Event(`change`,{bubbles:!0})))}render(){let e=this.tooltip?i`<ixfx-tooltip
|
|
11686
11724
|
style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)"
|
|
11687
11725
|
.orientation=${this.tooltipOrientation}
|
|
11688
11726
|
anchor="--thumb-tooltip"
|
|
11689
11727
|
.value=${this.value}></ixfx-tooltip>`:a,n=this.orientation===`vertical`?`writing-mode: vertical-lr; direction: rtl;`:a;return i`
|
|
11690
11728
|
<input ?disabled=${this.disabled} step=${this.step} min=${this.min} max=${this.max} value=${this.value} @input=${this.onRangeInput} type="range" style=${n}>
|
|
11691
11729
|
${e}
|
|
11692
|
-
`}static{this.styles=[w,cn,
|
|
11730
|
+
`}static{this.styles=[w,cn,gD,r`
|
|
11693
11731
|
:host {
|
|
11694
11732
|
display: inline-block;
|
|
11695
11733
|
--value-label-color: unset;
|
|
@@ -11748,7 +11786,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11748
11786
|
[type="range"]:focus {
|
|
11749
11787
|
outline: none;
|
|
11750
11788
|
}
|
|
11751
|
-
`]}};E([d({type:Boolean})],
|
|
11789
|
+
`]}};E([d({type:Boolean})],CD.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],CD.prototype,`tooltipOrientation`,void 0),E([d({type:String,reflect:!0})],CD.prototype,`orientation`,void 0),E([d({type:Boolean,attribute:!0})],CD.prototype,`disabled`,void 0),E([d({type:Number})],CD.prototype,`min`,void 0),E([d({type:Number})],CD.prototype,`max`,void 0),E([d({type:Number})],CD.prototype,`value`,null),E([d({type:Number})],CD.prototype,`step`,void 0),CD=E([T(`ixfx-range`)],CD);let wD=class extends n{constructor(...e){super(...e),this.value=0,this.max=5,this.allowHalf=!1,this.disabled=!1,this.readonly=!1,this.variant=`star`,this._preview=null}static{this.styles=[cn,r`
|
|
11752
11790
|
:host {
|
|
11753
11791
|
--ixfx-rating-size: 1.5rem;
|
|
11754
11792
|
--ixfx-rating-gap: 0.2rem;
|
|
@@ -11786,7 +11824,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11786
11824
|
@click=${e=>this._commit(this._calc(e,a))}>
|
|
11787
11825
|
<svg viewBox="0 0 24 24" class="bg" fill="currentColor"><path d=${d}></path></svg>
|
|
11788
11826
|
${s||c?i`<svg viewBox="0 0 24 24" class="fill" fill="currentColor"><path d=${d}></path></svg>`:``}
|
|
11789
|
-
</span>`})}`}firstUpdated(){this.addEventListener(`pointerleave`,()=>this._preview=null),this.addEventListener(`keydown`,e=>{if(this.disabled||this.readonly)return;let n=this.allowHalf?.5:1;if(e.key===`ArrowRight`||e.key===`ArrowUp`)e.preventDefault(),this._commit(Math.min(this.max,this.value+n));else if(e.key===`ArrowLeft`||e.key===`ArrowDown`)e.preventDefault(),this._commit(Math.max(0,this.value-n));else if(e.key===`Home`)e.preventDefault(),this._commit(0);else if(e.key===`End`)e.preventDefault(),this._commit(this.max);else if(/^\d$/.test(e.key)){e.preventDefault();let n=parseInt(e.key,10);this._commit(Math.min(n,this.max))}})}};E([d({type:Number})],
|
|
11827
|
+
</span>`})}`}firstUpdated(){this.addEventListener(`pointerleave`,()=>this._preview=null),this.addEventListener(`keydown`,e=>{if(this.disabled||this.readonly)return;let n=this.allowHalf?.5:1;if(e.key===`ArrowRight`||e.key===`ArrowUp`)e.preventDefault(),this._commit(Math.min(this.max,this.value+n));else if(e.key===`ArrowLeft`||e.key===`ArrowDown`)e.preventDefault(),this._commit(Math.max(0,this.value-n));else if(e.key===`Home`)e.preventDefault(),this._commit(0);else if(e.key===`End`)e.preventDefault(),this._commit(this.max);else if(/^\d$/.test(e.key)){e.preventDefault();let n=parseInt(e.key,10);this._commit(Math.min(n,this.max))}})}};E([d({type:Number})],wD.prototype,`value`,void 0),E([d({type:Number})],wD.prototype,`max`,void 0),E([d({type:Boolean,attribute:`allow-half`})],wD.prototype,`allowHalf`,void 0),E([d({type:Boolean,reflect:!0})],wD.prototype,`disabled`,void 0),E([d({type:Boolean,reflect:!0})],wD.prototype,`readonly`,void 0),E([d({type:String})],wD.prototype,`variant`,void 0),E([m()],wD.prototype,`_preview`,void 0),wD=E([T(`ixfx-rating`)],wD);let TD=class extends qy(n){constructor(...e){super(...e),this._selectedIndex=-1,this._slottedItems=[],this.tickled=new oe(this,{getItems:()=>this._slottedItems.map((e,n)=>({id:n,enabled:!0})),onStateChange:()=>this._syncTickled()}),this._onSlotChange=()=>{this._slottedItems=Array.from(this.shadowRoot?.querySelector(`slot`)?.assignedElements()??[]);let e=this._slottedItems.findIndex(e=>e.hasAttribute(`selected`)),n=e>=0?e:this._selectedIndex;n>=this._slottedItems.length&&(n=this._slottedItems.length-1),n<0&&this._slottedItems.length>0&&(n=0),this.selectedIndex=n},this._syncTickled=()=>{this._slottedItems.forEach((e,n)=>{let r=this.tickled.isTickled(n);e.classList.toggle(`tickled`,r),e.tabIndex=r&&this.tickled.inputMode===`keyboard`?0:-1})},this._findSlottedItem=e=>{let n=e instanceof Element?e:null;for(;n;){if(this._slottedItems.includes(n))return n;n=n.parentElement}},this._handlePointerOver=e=>{let n=this._findSlottedItem(e.target);n&&this.tickled.handlePointerEnter(this._slottedItems.indexOf(n))},this._handleKeyDown=e=>{e.key===`ArrowLeft`?(e.preventDefault(),this.tickled.handleKeyboardNavigation(`previous`),this._applyTickledSelection()):e.key===`ArrowRight`?(e.preventDefault(),this.tickled.handleKeyboardNavigation(`next`),this._applyTickledSelection()):e.key===`Home`?(e.preventDefault(),this.tickled.handleKeyboardNavigation(`first`),this._applyTickledSelection()):e.key===`End`&&(e.preventDefault(),this.tickled.handleKeyboardNavigation(`last`),this._applyTickledSelection())},this._applyTickledSelection=()=>{let e=this.tickled.tickledId;e!==void 0&&e!==this._selectedIndex&&(this.selectedIndex=e)},this._wheelCooldown=!1,this._handleClick=e=>{e.currentTarget.focus();let n=this._findSlottedItem(e.target),r=n?this._slottedItems.indexOf(n):-1;r>=0&&r!==this._selectedIndex&&(this.selectedIndex=r)},this._updateSelectedAttribute=()=>{this._slottedItems.forEach((e,n)=>{n===this._selectedIndex?e.setAttribute(`selected`,``):e.removeAttribute(`selected`)})},this._scrollSelectedIntoView=()=>{let e=this._slottedItems[this._selectedIndex];e&&e.scrollIntoView({inline:`center`,behavior:`smooth`})},this._emitChange=()=>{this.dispatchEvent(new CustomEvent(`change`,{detail:{selectedIndex:this._selectedIndex,selectedItem:this.selectedItem,selectedValue:this.selectedValue},bubbles:!0,composed:!0}))}}static{this.styles=[w,se,C,Ng(`x`),r`
|
|
11790
11828
|
:host {
|
|
11791
11829
|
--select-horiz-item-width: 80%;
|
|
11792
11830
|
--select-horiz-gap: var(--space-s);
|
|
@@ -11882,7 +11920,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11882
11920
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
11883
11921
|
<div class="spacer"></div>
|
|
11884
11922
|
</div>
|
|
11885
|
-
`}willUpdate(e){super.willUpdate(e),this.setAttribute(`data-input-mode`,this.tickled.inputMode)}_applyWheelDelta(e,n){this._wheelCooldown||(this._wheelCooldown=!0,this.tickled.handleKeyboardNavigation(e===1?`next`:`previous`),this._applyTickledSelection(),setTimeout(()=>{this._wheelCooldown=!1},250))}};E([m()],
|
|
11923
|
+
`}willUpdate(e){super.willUpdate(e),this.setAttribute(`data-input-mode`,this.tickled.inputMode)}_applyWheelDelta(e,n){this._wheelCooldown||(this._wheelCooldown=!0,this.tickled.handleKeyboardNavigation(e===1?`next`:`previous`),this._applyTickledSelection(),setTimeout(()=>{this._wheelCooldown=!1},250))}};E([m()],TD.prototype,`_selectedIndex`,void 0),E([m()],TD.prototype,`_slottedItems`,void 0),E([d({type:Number,reflect:!0,attribute:`selected-index`})],TD.prototype,`selectedIndex`,null),E([d({type:String})],TD.prototype,`selectedValue`,null),TD=E([T(`ixfx-select-horiz`)],TD);function ED(e,n,r){return Math.min(Math.max(e,n),r)}function DD(e,n,r,i,a){return r===n?i:i+(e-n)/(r-n)*(a-i)}let OD=class extends qy(n){constructor(...e){super(...e),this.display=`circle`,this.fillMode=`centre`,this.value=0,this.min=0,this.max=100,this.step=void 0,this.disabled=!1,this.#e=!1,this.#t=0,this.#n=0,this.#r=0,this.#d=e=>{if(this.disabled)return;e.preventDefault();let n=this.renderRoot.querySelector(`svg`);n?.focus(),this.#e=!0,this.#t=e.clientY,this.#r=e.clientY,this.#n=this.value,this.#i=this.value,this.toggleAttribute(`dragging`,!0),n&&n.setPointerCapture(e.pointerId),window.addEventListener(`pointermove`,this.#f),window.addEventListener(`pointerup`,this.#p),window.addEventListener(`pointercancel`,this.#p)},this.#f=e=>{if(!this.#e)return;e.preventDefault(),this.value!==this.#i&&(this.#n=this.value,this.#t=this.#r,this.#i=this.value);let n=this.clientHeight*2*(e.shiftKey?10:1),r=(this.#t-e.clientY)/n*(this.max-this.min),i=DD(this.#n+r,this.min,this.max,0,1);this.#c(ED(i,0,1),!0),this.#r=e.clientY},this.#p=()=>{this.#e=!1,this.toggleAttribute(`dragging`,!1);let e=this.renderRoot.querySelector(`svg`);e&&`hasPointerCapture`in e&&typeof e.hasPointerCapture==`function`&&e.hasPointerCapture(1)&&e.releasePointerCapture(1),window.removeEventListener(`pointermove`,this.#f),window.removeEventListener(`pointerup`,this.#p),window.removeEventListener(`pointercancel`,this.#p)},this.#m=e=>{if(this.disabled)return;let n=this.max-this.min,r=Ky(n,this.stops,this.step,e.shiftKey),i=!1;switch(e.key){case`ArrowUp`:case`ArrowRight`:this.#h(r/n,!0),i=!0;break;case`ArrowDown`:case`ArrowLeft`:this.#h(-r/n,!0),i=!0;break;case`Home`:this.#c(0,!0),i=!0;break;case`End`:this.#c(1,!0),i=!0}i&&e.preventDefault()}}#e;#t;#n;#r;#i;#a;#o(){return DD(this.value,this.min,this.max,0,1)}#s(e){if(this.stops&&this.stops>1){let n=(this.max-this.min)/this.stops;return Math.round((e-this.min)/n)*n+this.min}return e}#c(e,n=!1){let r=DD(e,0,1,this.min,this.max),i=this.#s(ED(r,this.min,this.max));if(i===this.value)return;let a=this.value;if(this.value=i,this.#i=i,this.hasAttribute(`data-tooltip-live`)){let e=Math.round(this.#o()*100);this.setAttribute(`data-tooltip`,`${e}%`)}n?(this.dispatchEvent(new CustomEvent(`input`,{detail:{value:this.value,valueRelative:this.#o()},bubbles:!0,composed:!0})),this.#l(a)):this.#u(a)}#l(e){this.#a!==void 0&&clearTimeout(this.#a),this.#a=window.setTimeout(()=>{this.#u(e),this.#a=void 0},150)}#u(e){this.dispatchEvent(new CustomEvent(`change`,{detail:{value:this.value,valueRelative:this.#o(),previousValue:e},bubbles:!0,composed:!0}))}#d;#f;#p;#m;#h(e,n){this.#c(ED(this.#o()+e,0,1),n)}_applyWheelDelta(e,n){let r=this.max-this.min,i=Ky(r,this.stops,this.step,n.shiftKey);this.#h(e*i/r,!0)}#g(){let e=this.#o(),n=45*e,r=50;return this.fillMode===`left`?r=5+45*e:this.fillMode===`right`&&(r=95-45*e),s`
|
|
11886
11924
|
<circle class="fill" cx="${r}" cy="${50}" r="${n}" />
|
|
11887
11925
|
<circle class="outline" cx="${50}" cy="${50}" r="${45}" fill="none" />
|
|
11888
11926
|
`}#_(){let e=this.#o();if(this.fillMode===`left`||this.fillMode===`right`){let n=90*e,r=this.fillMode===`left`?5:95-n;return s`
|
|
@@ -11949,10 +11987,10 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
11949
11987
|
fill: var(--shapefill-value-fill-color, var(--accent));
|
|
11950
11988
|
transition: var(--shapefill-value-fill-transition, none);
|
|
11951
11989
|
}
|
|
11952
|
-
`]}};E([d({type:String})],
|
|
11990
|
+
`]}};E([d({type:String})],OD.prototype,`display`,void 0),E([d({type:String,attribute:`fill-mode`})],OD.prototype,`fillMode`,void 0),E([d({type:Number})],OD.prototype,`value`,void 0),E([d({type:Number})],OD.prototype,`min`,void 0),E([d({type:Number})],OD.prototype,`max`,void 0),E([d({type:Number})],OD.prototype,`step`,void 0),E([d({type:Number})],OD.prototype,`stops`,void 0),E([d({type:Boolean,reflect:!0})],OD.prototype,`disabled`,void 0),OD=E([T(`ixfx-shapefill-value`)],OD);const kD=Array.from({length:30},(e,n)=>n%10),AD={lead:0,integer:1,decimal:2,fraction:3,trail:4};function jD(e,n){return(e%n+n)%n}function MD(e){let n=e.trim();return n===``?0:n.endsWith(`ms`)?Number.parseFloat(n)||0:n.endsWith(`s`)?(Number.parseFloat(n)||0)*1e3:Number.parseFloat(n)||0}let ND=class extends n{constructor(...e){super(...e),this.value=0,this.prefix=``,this.suffix=``,this.trend=`auto`,this.noAnimate=!1,this.respectMotionPreference=!0,this._cells=[],this._formatted=``,this._ready=!1,this._pendingSpins=[],this._pendingDir=`none`,this._reelAnims=new Map,this._reapTimer=0}connectedCallback(){super.connectedCallback(),this.hasAttribute(`role`)||this.setAttribute(`role`,`img`)}disconnectedCallback(){super.disconnectedCallback();for(let e of this._reelAnims.values())e.cancel();this._reelAnims.clear(),this._reapTimer&&clearTimeout(this._reapTimer)}_motionOK(){return!(this.noAnimate||this.respectMotionPreference&&typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches)}_timing(e){let n=getComputedStyle(this);return{duration:this._motionOK()?MD(n.getPropertyValue(`--sliding-number-${e}-duration`)):0,easing:n.getPropertyValue(`--sliding-number-${e}-easing`).trim()||`ease`}}_numberFormat(){try{return new Intl.NumberFormat(this.locales||void 0,this.format||void 0)}catch{return new Intl.NumberFormat(this.locales||void 0)}}_resolveDir(e){switch(this.trend){case`up`:case`increasing`:return`up`;case`down`:case`decreasing`:return`down`;case`none`:return`none`;default:return e||this._prevValue===void 0||this.value===this._prevValue?`none`:this.value>this._prevValue?`up`:`down`}}_buildCells(e){let n=[],r=[],i=[],a=[],o=``,s=!1,c=!1;for(let l of e)switch(l.type){case`integer`:s=!0;for(let e of l.value)n.push({digit:!0,char:e});break;case`group`:n.push({digit:!1,char:l.value});break;case`decimal`:c=!0,o=l.value;break;case`fraction`:for(let e of l.value)r.push(e);break;default:(s||c?a:i).push(l.value)}let l=[],u=n.filter(e=>e.digit).length;i.forEach((e,n)=>{l.push({key:`lead:${n}`,kind:`symbol`,section:`lead`,char:e,pos:n-100,phase:`active`})});let d=0;for(let e of n)if(e.digit){let n=u-1-d;d++,l.push({key:`int:${n}`,kind:`digit`,section:`integer`,char:e.char,pos:-n,phase:`active`})}else{let n=u-d;l.push({key:`grp:${n}`,kind:`symbol`,section:`integer`,char:e.char,pos:-n+.5,phase:`active`})}return c&&l.push({key:`decimal`,kind:`symbol`,section:`decimal`,char:o,pos:0,phase:`active`}),r.forEach((e,n)=>{l.push({key:`frac:${n}`,kind:`digit`,section:`fraction`,char:e,pos:n+1,phase:`active`})}),a.forEach((e,n)=>{l.push({key:`trail:${n}`,kind:`symbol`,section:`trail`,char:e,pos:n+100,phase:`active`})}),l}willUpdate(e){if(![`value`,`format`,`locales`,`prefix`,`suffix`,`noAnimate`].some(n=>e.has(n))&&this._ready)return;let n=this._numberFormat();this._formatted=`${this.prefix}${n.format(this.value)}${this.suffix}`,this.setAttribute(`aria-label`,this._formatted),this.toggleAttribute(`data-static`,!this._motionOK());let r=!this._ready,i=this._motionOK()&&!r,a=this._buildCells(n.formatToParts(this.value)),o=new Set(a.map(e=>e.key)),s=this._cells.filter(e=>e.phase!==`leave`),c=new Map(s.map(e=>[e.key,e])),l=this._resolveDir(r),u=[],d=[];for(let e of a){let n=c.get(e.key);n?(i&&e.kind===`digit`&&n.char!==e.char&&u.push({key:e.key,from:Number(n.char),to:Number(e.char)}),d.push({...e,phase:`active`})):d.push({...e,phase:i?`enter`:`active`})}if(i)for(let e of s)o.has(e.key)||d.push({...e,phase:`leave`});d.sort((e,n)=>AD[e.section]-AD[n.section]||e.pos-n.pos),this._cells=d,this._pendingSpins=u,this._pendingDir=l}updated(){for(let e of this._pendingSpins)this._spin(e.key,e.from,e.to,this._pendingDir);this._pendingSpins=[],this._cells.some(e=>e.phase===`enter`)&&requestAnimationFrame(()=>requestAnimationFrame(()=>{let e=!1;for(let n of this._cells)n.phase===`enter`&&(n.phase=`active`,e=!0);e&&(this._cells=[...this._cells],this.requestUpdate())})),this._cells.some(e=>e.phase===`leave`)&&(this._reapTimer&&clearTimeout(this._reapTimer),this._reapTimer=window.setTimeout(()=>{this._reapTimer=0;let e=this._cells.filter(e=>e.phase!==`leave`);e.length!==this._cells.length&&(this._cells=e,this.requestUpdate())},this._timing(`transform`).duration+120)),this._prevValue=this.value,this._ready=!0}_spin(e,n,r,i){let a=this.renderRoot.querySelector(`[data-key="${e}"] .reel`);if(!a)return;let o=10+n,s;s=i===`up`?o+jD(r-n,10):i===`down`?o-jD(n-r,10):[r,10+r,20+r].reduce((e,n)=>Math.abs(n-o)<Math.abs(e-o)?n:e);let{duration:c,easing:l}=this._timing(`spin`);if(this._reelAnims.get(e)?.cancel(),c===0){a.style.setProperty(`--o`,String(10+r));return}let u=a.animate([{transform:`translateY(calc(-1em * ${o}))`},{transform:`translateY(calc(-1em * ${s}))`}],{duration:c,easing:l,fill:`both`});this._reelAnims.set(e,u),u.finished.then(()=>{a.style.setProperty(`--o`,String(10+r)),u.cancel(),this._reelAnims.delete(e)}).catch(()=>{})}_renderCell(e){return e.kind===`digit`?i`
|
|
11953
11991
|
<span class="cell digit" part="digit" data-key=${e.key} data-phase=${e.phase}>
|
|
11954
11992
|
<span class="reel" style=${`--o:${10+Number(e.char)}`}>
|
|
11955
|
-
${
|
|
11993
|
+
${kD.map(e=>i`<span>${e}</span>`)}
|
|
11956
11994
|
</span>
|
|
11957
11995
|
</span>
|
|
11958
11996
|
`:i`
|
|
@@ -12061,7 +12099,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12061
12099
|
:host([data-static]) .cell {
|
|
12062
12100
|
transition: none;
|
|
12063
12101
|
}
|
|
12064
|
-
`}};E([d({type:Number})],
|
|
12102
|
+
`}};E([d({type:Number})],ND.prototype,`value`,void 0),E([d({type:String})],ND.prototype,`locales`,void 0),E([d({type:Object})],ND.prototype,`format`,void 0),E([d({type:String})],ND.prototype,`prefix`,void 0),E([d({type:String})],ND.prototype,`suffix`,void 0),E([d({type:String})],ND.prototype,`trend`,void 0),E([d({type:Boolean,attribute:`no-animate`})],ND.prototype,`noAnimate`,void 0),E([d({type:Boolean,attribute:!1})],ND.prototype,`respectMotionPreference`,void 0),E([m()],ND.prototype,`_cells`,void 0),ND=E([T(`ixfx-sliding-number`)],ND);let PD=0,FD=class extends n{constructor(...e){super(...e),this.for=``,this.mode=`explicit`,this.placement=`top`,this.dismiss=`auto`,this.showDelay=150,this.hideDelay=500,this._isOpen=!1,this._anchorName=`--ixfx-snackbar-anchor-${++PD}`,this._addedTabindex=!1,this._addedRole=!1,this._onTargetClick=()=>this.toggle(),this._onTargetKeydown=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.toggle())},this._onTickleIn=()=>this._scheduleShow(),this._onTickleOut=()=>this._scheduleHide(),this._onPanelClick=()=>{this.dismiss===`auto`&&this.hide()},this._onToggle=e=>{let{newState:n}=e;this._isOpen=n===`open`,n===`closed`&&this.contains(document.activeElement)&&this._target?.focus()},this._onBeforeToggle=e=>{let{newState:n}=e;this._recentCloseAt=n===`closed`?performance.now():void 0}}get isOpen(){return this._isOpen}show(){if(this.popover)try{this.showPopover()}catch{}}hide(){if(this.popover)try{this.hidePopover()}catch{}}toggle(){if(this.popover){if(this._recentCloseAt!==void 0&&performance.now()-this._recentCloseAt<50){this._recentCloseAt=void 0;return}try{this.togglePopover()}catch{}}}connectedCallback(){super.connectedCallback(),this.hasAttribute(`popover`)||(this.popover=`auto`),this.classList.add(`popup-surface`),this.addEventListener(`toggle`,this._onToggle),this.addEventListener(`beforetoggle`,this._onBeforeToggle),this.addEventListener(`click`,this._onPanelClick),this.style.setProperty(`position-anchor`,this._anchorName),this._attachToTarget()}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`toggle`,this._onToggle),this.removeEventListener(`beforetoggle`,this._onBeforeToggle),this.removeEventListener(`click`,this._onPanelClick),this._detachFromTarget(),this._cancelShow(),this._cancelHide()}updated(e){super.updated(e),(e.has(`for`)||e.has(`mode`))&&this._attachToTarget()}_resolveTarget(){if(this.for)return this.getRootNode().getElementById(this.for)??void 0}_attachToTarget(){this._detachFromTarget();let e=this._resolveTarget();if(!e){this.for&&console.warn(`ixfx-snackbar: no element found with id "${this.for}"`);return}if(this._target=e,e.style.setProperty(`anchor-name`,this._anchorName),this.mode===`explicit`){let n=e.tabIndex>=0;n||(e.setAttribute(`tabindex`,`0`),this._addedTabindex=!0),!e.hasAttribute(`role`)&&!n&&(e.setAttribute(`role`,`button`),this._addedRole=!0),e.setAttribute(`aria-haspopup`,`true`),e.addEventListener(`click`,this._onTargetClick),n||e.addEventListener(`keydown`,this._onTargetKeydown)}else this.mode===`implicit`&&(e.addEventListener(`pointerenter`,this._onTickleIn),e.addEventListener(`focus`,this._onTickleIn),e.addEventListener(`pointerleave`,this._onTickleOut),e.addEventListener(`blur`,this._onTickleOut),this.addEventListener(`pointerenter`,this._onTickleIn),this.addEventListener(`focusin`,this._onTickleIn),this.addEventListener(`pointerleave`,this._onTickleOut),this.addEventListener(`focusout`,this._onTickleOut))}_detachFromTarget(){let e=this._target;e&&(e.style.removeProperty(`anchor-name`),this._addedTabindex&&=(e.removeAttribute(`tabindex`),!1),this._addedRole&&=(e.removeAttribute(`role`),!1),e.removeAttribute(`aria-haspopup`),e.removeEventListener(`click`,this._onTargetClick),e.removeEventListener(`keydown`,this._onTargetKeydown),e.removeEventListener(`pointerenter`,this._onTickleIn),e.removeEventListener(`focus`,this._onTickleIn),e.removeEventListener(`pointerleave`,this._onTickleOut),e.removeEventListener(`blur`,this._onTickleOut),this.removeEventListener(`pointerenter`,this._onTickleIn),this.removeEventListener(`focusin`,this._onTickleIn),this.removeEventListener(`pointerleave`,this._onTickleOut),this.removeEventListener(`focusout`,this._onTickleOut),this._target=void 0)}_scheduleShow(){if(this._cancelHide(),this._cancelShow(),this.showDelay<=0){this.show();return}this._showTimeout=window.setTimeout(()=>this.show(),this.showDelay)}_scheduleHide(){if(this._cancelShow(),this._cancelHide(),this.hideDelay<=0){this.hide();return}this._hideTimeout=window.setTimeout(()=>this.hide(),this.hideDelay)}_cancelShow(){this._showTimeout!==void 0&&(window.clearTimeout(this._showTimeout),this._showTimeout=void 0)}_cancelHide(){this._hideTimeout!==void 0&&(window.clearTimeout(this._hideTimeout),this._hideTimeout=void 0)}static{this.styles=[w,de,r`
|
|
12065
12103
|
:host {
|
|
12066
12104
|
display: flex;
|
|
12067
12105
|
align-items: center;
|
|
@@ -12113,7 +12151,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12113
12151
|
position-area: inline-end;
|
|
12114
12152
|
margin-inline-start: var(--space-s);
|
|
12115
12153
|
}
|
|
12116
|
-
`]}render(){return i`<slot></slot>`}};E([d({type:String})],
|
|
12154
|
+
`]}render(){return i`<slot></slot>`}};E([d({type:String})],FD.prototype,`for`,void 0),E([d({type:String})],FD.prototype,`mode`,void 0),E([d({type:String,reflect:!0})],FD.prototype,`placement`,void 0),E([d({type:String})],FD.prototype,`dismiss`,void 0),E([d({type:Number,attribute:`show-delay`})],FD.prototype,`showDelay`,void 0),E([d({type:Number,attribute:`hide-delay`})],FD.prototype,`hideDelay`,void 0),E([m()],FD.prototype,`_isOpen`,void 0),FD=E([T(`ixfx-snackbar`)],FD);let ID=class extends n{constructor(...e){super(...e),this.orientation=`horizontal`,this.snapPositions=3,this.snapLogic=`balanced`,this.clickSnap=`closest`,this.snap=0,this._dragging=!1,this._dragStart=0,this._dragThreshold=10,this._thresholdReached=!1,this._currentDragIndex=0,this._child=null,this._onPointerDown=e=>{let n=this._getChild();if(!n)return;let r=this.getBoundingClientRect(),i=this._getSnapIndex(this._isHorizontal?e.clientX:e.clientY,r);if(n.contains(e.target))e.preventDefault(),e.stopPropagation(),this._dragging=!0,this._thresholdReached=!1,this._dragStart=this._isHorizontal?e.clientX:e.clientY,this._currentDragIndex=i,n.classList.add(`dragging`),document.addEventListener(`pointermove`,this._onPointerMove),document.addEventListener(`pointerup`,this._onPointerUp);else{let r;if(this.clickSnap===`step`){r=this.snap;let i=n.getBoundingClientRect(),a=this._isHorizontal?i.left+i.width/2:i.top+i.height/2,o=this._isHorizontal?e.clientX:e.clientY;o>a?r=Math.min(this.snapPositions-1,this.snap+1):o<a&&(r=Math.max(0,this.snap-1))}else r=i;if(r!==this.snap){let e=this.snap;this.snap=r,this._updateChildPosition(this.snap),this.dispatchEvent(new CustomEvent(`snap-change`,{detail:{previousSnap:e,newSnap:this.snap},bubbles:!0,composed:!0}))}else this._updateChildPosition(this.snap)}},this._onPointerMove=e=>{if(!this._dragging)return;let n=this._isHorizontal?e.clientX:e.clientY,r=n-this._dragStart,i=this.getBoundingClientRect();if(!this._thresholdReached&&Math.abs(r)<this._dragThreshold)return;this._thresholdReached=!0;let a=this._getSnapIndex(n,i);this._currentDragIndex=a,this._updateChildPosition(a),this.dispatchEvent(new CustomEvent(`snap-input`,{detail:{index:a},bubbles:!0,composed:!0}))},this._onPointerUp=()=>{if(!this._dragging)return;this._dragging=!1;let e=this._getChild();if(e&&e.classList.remove(`dragging`),document.removeEventListener(`pointermove`,this._onPointerMove),document.removeEventListener(`pointerup`,this._onPointerUp),this._thresholdReached&&this._currentDragIndex!==this.snap){let e=this.snap;this.snap=this._currentDragIndex,this._updateChildPosition(this.snap),this.dispatchEvent(new CustomEvent(`snap-change`,{detail:{previousSnap:e,newSnap:this.snap},bubbles:!0,composed:!0}))}else this._updateChildPosition(this.snap)},this._onKeyDown=e=>{let n=this.snap;if(this._isHorizontal){if(e.key===`ArrowLeft`)n=Math.max(0,this.snap-1);else if(e.key===`ArrowRight`)n=Math.min(this.snapPositions-1,this.snap+1);else return}else if(e.key===`ArrowUp`)n=Math.max(0,this.snap-1);else if(e.key===`ArrowDown`)n=Math.min(this.snapPositions-1,this.snap+1);else return;if(e.preventDefault(),n!==this.snap){let e=this.snap;this.snap=n,this._updateChildPosition(this.snap),this.dispatchEvent(new CustomEvent(`snap-change`,{detail:{previousSnap:e,newSnap:this.snap},bubbles:!0,composed:!0}))}}}static{this.styles=r`
|
|
12117
12155
|
:host {
|
|
12118
12156
|
display: block;
|
|
12119
12157
|
position: relative;
|
|
@@ -12177,7 +12215,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12177
12215
|
>
|
|
12178
12216
|
<slot></slot>
|
|
12179
12217
|
</div>
|
|
12180
|
-
`}};E([d({type:String,attribute:`orientation`})],
|
|
12218
|
+
`}};E([d({type:String,attribute:`orientation`})],ID.prototype,`orientation`,void 0),E([d({type:Number,attribute:`snap-positions`})],ID.prototype,`snapPositions`,void 0),E([d({type:String,attribute:`snap-logic`})],ID.prototype,`snapLogic`,void 0),E([d({type:String,attribute:`click-snap`})],ID.prototype,`clickSnap`,void 0),E([d({type:Number})],ID.prototype,`snap`,void 0),E([m()],ID.prototype,`_dragging`,void 0),ID=E([T(`ixfx-snap-container`)],ID);let LD=class extends qy(n){constructor(...e){super(...e),this.barSpacing=20,this.barWidth=14,this.debounceMs=200,this.retractDurationMs=400,this._startX=0,this._currentX=0,this._pointerId=null,this._componentWidth=0,this._isDragging=!1,this._offset=0,this._width=0,this._height=0,this._animRafId=null,this._debounceTimer=null,this._animStartOffset=0,this._animStartTime=null,this._resizeObserver=null,this.#e=e=>{if(e.pointerId!==this._pointerId)return;this.#r();let n=this.getBoundingClientRect();if(e.clientX>=n.left&&e.clientX<=n.right&&e.clientY>=n.top&&e.clientY<=n.bottom){let e=this._currentX-this._startX,n=Math.max(-1,Math.min(1,e/this._componentWidth));this.#n(n)}this._isDragging=!1,this._pointerId=null,this.#i()},this.#t=e=>{e.pointerId===this._pointerId&&(this.#r(),this._isDragging=!1,this._pointerId=null,this.#i())},this._onPointerDown=e=>{e.preventDefault(),this.#o(),e.target.setPointerCapture(e.pointerId),this._pointerId=e.pointerId,this._startX=e.clientX,this._currentX=e.clientX,this._componentWidth=this.getBoundingClientRect().width,this._isDragging=!0,window.addEventListener(`pointerup`,this.#e),window.addEventListener(`pointercancel`,this.#t)},this._onPointerMove=e=>{if(!this._isDragging||e.pointerId!==this._pointerId)return;this._currentX=e.clientX;let n=this._currentX-this._startX,r=Math.max(-1,Math.min(1,n/this._componentWidth));this._offset=r*this._height*.5,this.requestUpdate()}}#e;#t;#n(e){this.dispatchEvent(new CustomEvent(`input`,{detail:{value:e},bubbles:!0,composed:!0}))}_applyWheelDelta(e,n){this.#o();let r=n.shiftKey?.05:.1,i=Math.max(-1,Math.min(1,e*r));this.#n(i),this._offset=i*this._height*.5,this.requestUpdate(),this.#i()}connectedCallback(){super.connectedCallback(),this._resizeObserver=new ResizeObserver(e=>{let n=e[0];n&&(this._width=n.contentRect.width,this._height=n.contentRect.height,this.requestUpdate())}),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._resizeObserver=null,this.#o(),this.#r(),this._isDragging=!1,this._pointerId=null}#r(){window.removeEventListener(`pointerup`,this.#e),window.removeEventListener(`pointercancel`,this.#t)}#i(){this._debounceTimer!==null&&clearTimeout(this._debounceTimer),this._debounceTimer=setTimeout(()=>{this._debounceTimer=null,this.#a()},this.debounceMs)}#a(){this._animStartOffset=this._offset,this._animStartTime=null;let e=n=>{this._animStartTime===null&&(this._animStartTime=n);let r=n-this._animStartTime,i=Math.min(r/this.retractDurationMs,1),a=1-(1-i)**3;this._offset=this._animStartOffset*(1-a),this.requestUpdate(),i<1?this._animRafId=requestAnimationFrame(e):(this._offset=0,this._animRafId=null,this.requestUpdate())};this._animRafId=requestAnimationFrame(e)}#o(){this._animRafId!==null&&(cancelAnimationFrame(this._animRafId),this._animRafId=null),this._debounceTimer!==null&&(clearTimeout(this._debounceTimer),this._debounceTimer=null)}#s(){let e=this._width,n=this._height,r=this._offset,{barSpacing:i,barWidth:a}=this;if(e===0||n===0)return s``;let o=a/2,c=n/2,l=Math.ceil(e/i)+1;return s`${Array.from({length:l},(e,a)=>{let l=a*i,u=l-o,d=l+o,f=a%2==0?`var(--swipe-color-a, var(--surface-4))`:`var(--swipe-color-b, var(--surface-5))`,p=`M${u},0 L${d},0 L${d+r},${c} L${d},${n} L${u},${n} L${u+r},${c}Z`;return s`<path d=${p} style="fill:${f}"></path>`})}`}static{this.styles=[w,cn,r`
|
|
12181
12219
|
:host {
|
|
12182
12220
|
display: block;
|
|
12183
12221
|
user-select: none;
|
|
@@ -12213,7 +12251,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12213
12251
|
>
|
|
12214
12252
|
<svg aria-hidden="true">${this.#s()}</svg>
|
|
12215
12253
|
</div>
|
|
12216
|
-
`}};E([d({type:Number})],
|
|
12254
|
+
`}};E([d({type:Number})],LD.prototype,`barSpacing`,void 0),E([d({type:Number})],LD.prototype,`barWidth`,void 0),E([d({type:Number})],LD.prototype,`debounceMs`,void 0),E([d({type:Number})],LD.prototype,`retractDurationMs`,void 0),LD=E([T(`ixfx-swipe`)],LD);let RD=class extends n{render(){return i`<slot></slot>`}static{this.styles=[w,r`
|
|
12217
12255
|
:host {
|
|
12218
12256
|
display:none;
|
|
12219
12257
|
height:100%;
|
|
@@ -12224,12 +12262,12 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12224
12262
|
background: var(--surface-3);
|
|
12225
12263
|
display:block;
|
|
12226
12264
|
}
|
|
12227
|
-
`]}};
|
|
12265
|
+
`]}};RD=E([T(`ixfx-tab-panel`)],RD);var zD=class{#e;#t;#n;#r=[];#i;#a;#o;#s=new Set;constructor(e,n,r={}){this.#e=e,this.#t=n,this.#n=r,this.#o=r.commands}connect(){this.disconnect(),this.#i=new AbortController;let{signal:e}=this.#i;this.#e.addEventListener(`change`,this.#c,{signal:e}),this.#e.addEventListener(`reorder`,this.#l,{signal:e}),this.#e.addEventListener(`close`,this.#u,{signal:e}),this.#a=new MutationObserver(()=>this.#x()),this.#a.observe(this.#e,{childList:!0}),this.#a.observe(this.#t,{childList:!0}),this.#x(),this.#t.syncWithList(this.#e);for(let e of this.#r)this.#C(e)}disconnect(){this.#i?.abort(),this.#i=void 0,this.#a?.disconnect(),this.#a=void 0;for(let e of this.#r)this.#w(e);this.#s.clear(),this.#r=[]}selectTab(e){let n=this.#f(e);if(!n)return!1;let r=this.getSelected();return r?.id===n.id?(this.#t.selectPanel(n.forId),!0):(this.#e.selectElement(n.item),this.#t.selectPanel(n.forId),this.#n.onSelect?.(n,r),!0)}selectNext(){return this.#d(1)}selectPrevious(){return this.#d(-1)}getSelected(){return this.#r.find(e=>e.item.hasAttribute(`selected`))}getTabs(){return[...this.#r]}getTab(e){return this.#r.find(n=>n.id===e)}addTab(e){let{id:n,forId:r}=this.#g(e),i=document.createElement(`ixfx-tab-list-item`);i.id=n,i.setAttribute(`for`,r),i.closeable=e.closeable??!0,i.append(e.label),e.iconName&&(i.iconName=e.iconName),e.description&&(i.description=e.description);for(let n of e.toolbar??[])n.slot=`toolbar`,i.append(n);let a=document.createElement(`ixfx-tab-panel`);a.id=r,e.content!==void 0&&this.#y(a,e.content);let o=Math.max(0,Math.min(e.index??this.#r.length,this.#r.length));this.#b(this.#e,i,o),this.#b(this.#t,a,o);let s={id:n,forId:r,item:i,panel:a,label:e.label,iconName:e.iconName};return this.#r.splice(o,0,s),this.#C(s),this.#n.onAdd?.(s),(e.select??!0)&&this.selectTab(n),s}removeTab(e){let n=this.#f(e);if(!n)return!1;let r=this.#r.indexOf(n),i=n.item.hasAttribute(`selected`)?this.#m(r):void 0;return n.item.remove(),n.panel.remove(),this.#h(n),this.#w(n),this.#n.onRemove?.(n),i&&this.selectTab(i.id),!0}renameTab(e,n){let r=this.#f(e);if(!r)return!1;for(let e of[...r.item.childNodes])(e.nodeType!==Node.ELEMENT_NODE||e.slot!==`toolbar`)&&r.item.removeChild(e);return r.item.prepend(n),r.label=n,this.#T(r),!0}setTabIcon(e,n){let r=this.#f(e);return r?(n?(r.item.iconName=n,r.iconName=n):(r.item.iconName=void 0,r.item.removeAttribute(`icon-name`),r.iconName=void 0),!0):!1}#c=e=>{let n=e.detail;this.#t.selectPanel(n.for);let r=this.#r.find(e=>e.forId===n.for);if(!r)return;let i=n.previous?this.#r.find(e=>e.id===n.previous):void 0;this.#n.onSelect?.(r,i)};#l=()=>{this.#x(),this.#n.onReorder?.(this.#r)};#u=e=>{let n=e.target?.closest(`ixfx-tab-list-item`),r=n?this.#p(n):void 0;if(!r)return;let i=this.#r.indexOf(r),a=r.item.hasAttribute(`selected`)?this.#m(i):void 0;r.panel.remove(),this.#h(r),this.#w(r),this.#n.onRemove?.(r),a&&this.selectTab(a.id)};#d(e){let n=this.#r;if(n.length===0)return!1;let r=this.getSelected(),i=((r?n.indexOf(r):e===1?-1:0)+e+n.length)%n.length;return this.selectTab(n[i].id)}#f(e){if(typeof e!=`string`)return this.#r.find(n=>n.item===e);let n=e.trim().toLowerCase();return this.#r.find(n=>n.id===e)??this.#r.find(n=>n.forId===e)??this.#r.find(e=>e.label.toLowerCase()===n)}#p(e){return this.#r.find(n=>n.item===e)}#m(e){let n=this.#r;if(!(n.length<=1))return n[e+1]??n[e-1]}#h(e){let n=this.#r.indexOf(e);n>=0&&this.#r.splice(n,1)}#g(e){let n=this.#_(e.label)||`tab`;return{id:e.id??this.#v(`tab-${n}`),forId:e.forId??this.#v(`panel-${n}`)}}#_(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-+|-+$/g,``)}#v(e){let n=e,r=2;for(;document.getElementById(n);)n=`${e}-${r++}`;return n}#y(e,n){if(typeof n==`function`){n(e);return}if(typeof n==`string`){e.append(document.createTextNode(n));return}e.append(n)}#b(e,n,r){let i=Array.from(e.children);e.insertBefore(n,i[r]??null)}#x(){let e=new Map;for(let n of this.#t.querySelectorAll(`ixfx-tab-panel`))e.set(n.id,n);let n=[];for(let r of this.#e.querySelectorAll(`ixfx-tab-list-item`)){let i=r.getAttribute(`for`)??``,a=e.get(i);a&&n.push({id:r.id||i,forId:i,item:r,panel:a,label:this.#S(r),iconName:r.iconName})}this.#r=n}#S(e){let n=``;for(let r of e.childNodes)r instanceof Element&&r.getAttribute(`slot`)===`toolbar`||(n+=r.textContent??``);return n.trim()}#C(e){this.#o&&(e.item.commandActive||this.#o.has(e.id)||(this.#o.register({id:e.id,label:e.label,description:e.item.description??e.label,icon:e.iconName,execute:()=>{this.selectTab(e.id)}}),this.#s.add(e.id)))}#w(e){this.#o&&this.#s.has(e.id)&&(this.#o.unregister(e.id),this.#s.delete(e.id))}#T(e){if(!this.#o||!this.#s.has(e.id))return;let n=this.#o.get(e.id);n&&(this.#o.unregister(e.id),this.#o.register({...n,label:e.label}))}};let BD=class extends n{#e;render(){return i`<slot></slot>`}getSelectedElement(){for(let e of this._listItems)if(this.#t(e))return e}#t(e){return e.hasAttribute(`selected`)}#n(e){e.removeAttribute(`selected`),this.onUnselectedPanel&&this.onUnselectedPanel(e.id,e)}#r(e){this.onSelectingPanel&&this.onSelectingPanel(e.id,e),e.setAttribute(`selected`,``),this.onSelectedPanel&&this.onSelectedPanel(e.id,e)}syncWithList(e){this.#e=e,Promise.all([e.updateComplete,this.updateComplete]).then(()=>{let n=e.getSelectedElement();if(!n)return;let r=n.getAttribute(`for`);r&&this.selectPanel(r)})}selectPanel(e){let n=this.getSelectedElement();if(n){if(n.id===e)return;this.#n(n)}let r=!1;for(let n of this._listItems)n.id===e&&(this.#r(n),r=!0);return r}selectTab(e){let n=this.#i(e);return n?(this.#e?.selectElement(n),this.selectPanel(n.getAttribute(`for`)??``)===!0):this.selectPanel(e)===!0}#i(e){let n=this.#e;if(!n)return;let r=Array.from(n.querySelectorAll(`ixfx-tab-list-item`));for(let n of r)if(n.getAttribute(`for`)===e)return n;let i=e.trim().toLowerCase();for(let e of r)if(this.#a(e).toLowerCase()===i)return e}#a(e){let n=``;for(let r of e.childNodes)r instanceof Element&&r.getAttribute(`slot`)===`toolbar`||(n+=r.textContent??``);return n.trim()}static{this.styles=r`
|
|
12228
12266
|
:host {
|
|
12229
12267
|
display: block;
|
|
12230
12268
|
}
|
|
12231
12269
|
|
|
12232
|
-
`}};E([p()],
|
|
12270
|
+
`}};E([p()],BD.prototype,`_listItems`,void 0),BD=E([T(`ixfx-tab-panels`)],BD);let VD=class extends n{constructor(...e){super(...e),this.text=``,this.paused=!1}render(){return i`<span class="shimmer" part="text"
|
|
12233
12271
|
>${this.text===``?i`<slot></slot>`:this.text}</span
|
|
12234
12272
|
>`}static{this.styles=r`
|
|
12235
12273
|
:host {
|
|
@@ -12285,7 +12323,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12285
12323
|
-webkit-text-fill-color: var(--text-shimmer-color);
|
|
12286
12324
|
}
|
|
12287
12325
|
}
|
|
12288
|
-
`}};E([d({type:String})],ID.prototype,`text`,void 0),E([d({type:Boolean,reflect:!0})],ID.prototype,`paused`,void 0),ID=E([T(`ixfx-text-shimmer`)],ID);var LD=class{#e;#t;#n=120;#r=4;#i=4;constructor(e,n){this.#e=e,this.#t=n,e.min=n.logicalMin,e.max=n.logicalMax,n.labelFormatter&&(e.formatLabel=n.labelFormatter),e.addEventListener(`track-select`,this.#a)}setTempo(e){this.#n=e,this.#o()}setTimeSignature(e,n){this.#r=e,this.#i=n,this.#o()}setViewRange(e){this.#e.setViewRange(e)}dispose(){this.#e.removeEventListener(`track-select`,this.#a)}#a=e=>{let n=e.detail,r=this.#e.getTrackEvents(n.trackKey).map(e=>e.id);if(n.shiftKey){let e=new Set(this.#e.selectedIds);for(let n of r)e.has(n)?e.delete(n):e.add(n);this.#e.selectedIds=[...e]}else this.#e.selectedIds=r};#o(){if(this.#t.labelFormatter)return;this.#n;let e=this.#r;this.#e.formatLabel=n=>{let r=e,i=n;return`${Math.floor(i/r)+1}.${Math.floor(i%r)+1}`}}};const RD=[1,2,5,10];function zD(e,n,r,i=`adaptive`,a,o){return i===`fixed`&&a!==void 0&&o!==void 0?VD(a,o):BD(e,n,r)}function BD(e,n,r){let i=e.max-e.min;if(i<=0||r<=0)return{majorStep:100,minorDivisions:4,minorStep:25};let a=80*HD(n),o=i/Math.max(2,Math.floor(r/a)),s=10**Math.floor(Math.log10(o)),c=s;for(let e of RD){let n=e*s;if(n>=o*.8){c=n;break}}let l=c/s,u=l===5||l===10?5:4,d=c/u;return{majorStep:c,minorDivisions:u,minorStep:d}}function VD(e,n){let r=e;for(;r*n<5&&r<0xe8d4a51000;)r*=2;return{majorStep:r*4,minorDivisions:4,minorStep:r}}function HD(e){switch(e){case`x-wide`:return 2;case`wide`:return 1.5;case`normal`:return 1;case`slim`:return .7;case`x-slim`:return .5;default:return 1}}function UD(e,n,r,i,a,o){let{majorStep:s,minorStep:c}=r;if(s<=0)return;let l=n.x+n.width;if(i){e.fillStyle=a[`--timeline-alt-major-bg`]??`rgba(255,255,255,0.03)`;let r=Math.floor(n.x/s);for(let i=r;i*s<l;i++)if(i%2!=0){let r=i*s*o;e.fillRect(r,n.y,s*o,n.height)}}if(c>0){e.strokeStyle=a[`--timeline-grid-minor-color`]??`rgba(255,255,255,0.05)`,e.lineWidth=Number.parseFloat(a[`--timeline-grid-minor-width`]??`0.5`),e.beginPath();let r=Math.floor(n.x/c)*c;for(let i=r;i<l;i+=c){if(Math.abs(i%s)<c*.01)continue;let r=i*o;e.moveTo(r,n.y),e.lineTo(r,n.y+n.height)}e.stroke()}e.strokeStyle=a[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=Number.parseFloat(a[`--timeline-grid-major-width`]??`1`),e.beginPath();let u=Math.floor(n.x/s)*s;for(let r=u;r<l;r+=s){let i=r*o;e.moveTo(i,n.y),e.lineTo(i,n.y+n.height)}e.stroke()}function WD(e,n,r,i,a,o,s,c=0){let{majorStep:l}=r;if(l<=0||i<=0)return;let u=c,d=c+i;if(n.y+n.height<u||n.y>d)return;let f=n.x+n.width,p=i-6;e.fillStyle=o[`--timeline-bg`]??`#111`;let m=n.x*s;e.fillRect(m,u,n.width*s,p),e.strokeStyle=o[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=Number.parseFloat(o[`--timeline-grid-major-width`]??`1`),e.beginPath();let h=Math.ceil(n.x/l)*l;for(let n=h;n<f;n+=l){let r=n*s;e.moveTo(r,u+p),e.lineTo(r,d)}e.stroke(),e.strokeStyle=o[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=1,e.beginPath(),e.moveTo(m,d),e.lineTo(m+n.width*s,d),e.stroke(),e.fillStyle=o[`--timeline-axis-label-color`]??`rgba(255,255,255,0.5)`,e.font=`11px system-ui, sans-serif`,e.textBaseline=`middle`,e.textAlign=`left`;for(let n=h;n<f;n+=l){let r=n*s;e.fillText(a(n),r+4,u+p/2)}e.textAlign=`start`}function GD(e,n,r,i,a,o){let s=a[`--timeline-track-bg`]??`#1a1a1a`,c=a[`--timeline-track-bg-alt`]??`#1e1e1e`;for(let l=0;l<r.length;l++){let u=r[l];if(u.y+u.height<n.y)continue;if(u.y>n.y+n.height)break;let d=i.find(e=>e.key===u.trackKey);e.fillStyle=d?.color?`${d.color}22`:l%2==0?s:c,e.fillRect(n.x*o,u.y,n.width*o,u.height),e.strokeStyle=a[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=.5,e.beginPath(),e.moveTo(n.x*o,u.y+u.height),e.lineTo((n.x+n.width)*o,u.y+u.height),e.stroke()}}function KD(e,n,r,i,a,o,s,c,l){let u=c[`--timeline-event-bg`]??`#3498db`,d=c[`--timeline-event-selected-bg`]??`#5dade2`,f=c[`--timeline-event-tickled-bg`]??`#444`,p=c[`--timeline-event-label-color`]??`#fff`,m=Number.parseFloat(c[`--timeline-event-radius`]??`4`),h=n.x+n.width;for(let c of r){if(c.end<n.x||c.start>h)continue;let r=i.find(e=>e.trackKey===c.trackKey);if(!r||r.y+r.height<n.y||r.y>n.y+n.height)continue;let g=!1;(s.kind===`event-move`&&s.eventId===c.id||s.kind===`event-start`&&s.eventId===c.id||s.kind===`event-end`&&s.eventId===c.id)&&(g=!0);let _=c.start*l,v=(c.end-c.start)*l,y=r.y+3,b=r.height-6;if(v<1)continue;let x=a.has(c.id),S=o===c.id,ee;ee=x?d:S?f:c.color??u,e.fillStyle=ee,e.beginPath(),JD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.fill(),g&&(e.strokeStyle=`#fff`,e.lineWidth=1.5,e.beginPath(),JD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),x&&!g&&(e.strokeStyle=d,e.lineWidth=1,e.beginPath(),JD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),v>=40&&c.label&&(e.fillStyle=p,e.font=`11px system-ui, sans-serif`,e.textBaseline=`middle`,e.save(),e.beginPath(),e.rect(_+4,y,v-8,b),e.clip(),e.fillText(c.label,_+6,y+b/2),e.restore())}}function qD(e,n,r){if(n.kind!==`marquee`)return;let i=Math.min(n.startLogicalX,n.currentLogicalX)*r,a=Math.max(n.startLogicalX,n.currentLogicalX)*r,o=Math.min(n.startY,n.currentY),s=Math.max(n.startY,n.currentY);e.fillStyle=`rgba(100, 150, 255, 0.15)`,e.fillRect(i,o,a-i,s-o),e.strokeStyle=`rgba(100, 150, 255, 0.6)`,e.lineWidth=1,e.strokeRect(i,o,a-i,s-o)}function JD(e,n,r,i,a,o){o=Math.max(0,o),e.moveTo(n+o,r),e.arcTo(n+i,r,n+i,r+a,o),e.arcTo(n+i,r+a,n,r+a,o),e.arcTo(n,r+a,n,r,o),e.arcTo(n,r,n+i,r,o),e.closePath()}const YD=[`--timeline-bg`,`--timeline-track-bg`,`--timeline-track-bg-alt`,`--timeline-alt-major-bg`,`--timeline-grid-major-color`,`--timeline-grid-minor-color`,`--timeline-grid-major-width`,`--timeline-grid-minor-width`,`--timeline-event-bg`,`--timeline-event-selected-bg`,`--timeline-event-tickled-bg`,`--timeline-event-label-color`,`--timeline-event-radius`,`--timeline-axis-label-color`];function XD(e){let n=getComputedStyle(e),r={};for(let e of YD)r[e]=n.getPropertyValue(e).trim();return r}function ZD(e,n,r){return e/n+r}function QD(e){return e>0?1/e:1}function $D(e,n,r,i,a){let o=i.find(e=>n>=e.y&&n<e.y+e.height);if(!o)return{kind:`empty`,logicalX:e,y:n,trackKey:void 0};let s=8*QD(a),c=r.filter(e=>e.trackKey===o.trackKey);for(let n of c)if(!(e<n.start||e>n.end))return e<=n.start+s?{kind:`event-start`,eventId:n.id}:e>=n.end-s?{kind:`event-end`,eventId:n.id}:{kind:`event-move`,eventId:n.id,trackKey:o.trackKey,offsetX:e-n.start};return{kind:`empty`,logicalX:e,y:n,trackKey:o.trackKey}}function eO(e,n){return n.find(n=>e>=n.y&&e<n.y+n.height)?.trackKey}function tO(e,n){return Math.abs(e)>n?e-Math.sign(e)*n:0}function nO(e,n,r,i,a){let o=n*Math.exp(-a/100),s=r-(r-e)*n/o;return o>0&&(s+=-i/o),{ppu:o,viewMin:s}}function rO(e,n,r,i,a,o){let s=n-e,c=s*Math.exp(-a/100),l=i-(s>0?(i-e)/s:.5)*c;return r>0&&(l+=o/r),{vMin:l,vMax:l+c}}function iO(e,n){let r=new AbortController,i=r.signal;return n.addEventListener(`pointerdown`,r=>{let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=ZD(a.x,i,e.min),s=a.y,c=n.logicalScrollTop;if(s>=c&&s<c+e.axisHeight){n.setPointerCapture(r.pointerId),e._drag={kind:`axis-zoom`,anchorUnit:o,startScreenX:r.screenX,startScreenY:r.screenY,startViewMin:e._viewRange.min,startPpu:i};return}let l=$D(o,s,e._internalEvents,e._trackLayout,i);if(r.shiftKey&&l.kind===`event-move`){oO(e,l.eventId);return}if(l.kind===`event-move`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-move`,eventId:l.eventId,originTrackKey:l.trackKey,offsetX:l.offsetX};return}if(l.kind===`event-start`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-start`,eventId:l.eventId};return}if(l.kind===`event-end`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-end`,eventId:l.eventId};return}l.kind===`empty`&&(n.setPointerCapture(r.pointerId),e._drag={kind:`marquee`,startLogicalX:o,startY:s,currentLogicalX:o,currentY:s})},{signal:i}),n.addEventListener(`pointermove`,r=>{let i=e._drag;if(i.kind===`none`){aO(e,n,r);return}let a=e.pxPerUnit,o=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),s=ZD(o.x,a,e.min),c=o.y;if(i.kind===`axis-zoom`){let n=r.screenX-i.startScreenX,a=r.screenY-i.startScreenY;if(Math.abs(n)+Math.abs(a)<5)return;let o=tO(n,4),s=tO(a,4),c=nO(i.startViewMin,i.startPpu,i.anchorUnit,o,s);e.setZoomPan(c.viewMin,c.ppu);return}if(i.kind===`marquee`){e._drag={...i,currentLogicalX:s,currentY:c},n.invalidateAll();return}if(i.kind===`event-move`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=r.end-r.start,o=s,l=c,u=s-i.offsetX,d=u+a,f=eO(c,e._trackLayout)??r.trackKey,p=e.pxPerUnit,m=zD(e._viewRange,e.userScale,n.viewportWidth,e.gridMode,e.minorStep,p),h=e.processDrag(i.eventId,o,l,u,d,f,i.originTrackKey,m);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,start:h.start,end:h.end,trackKey:h.trackKey}:e),n.invalidateAll();return}if(i.kind===`event-start`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=Math.min(s,r.end-1);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,start:a}:e),n.invalidateAll();return}if(i.kind===`event-end`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=Math.max(s,r.start+1);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,end:a}:e),n.invalidateAll()}},{signal:i}),n.addEventListener(`pointerup`,r=>{let i=e._drag;if(n.releasePointerCapture(r.pointerId),i.kind===`axis-zoom`){e._drag={kind:`none`};return}if(i.kind===`marquee`){let r=Math.min(i.startLogicalX,i.currentLogicalX),a=Math.max(i.startLogicalX,i.currentLogicalX),o=Math.min(i.startY,i.currentY),s=Math.max(i.startY,i.currentY);if(Math.abs(a-r)<2&&Math.abs(s-o)<2)e._selectedIds=new Set,sO(e);else{let n=new Set;for(let i of e._internalEvents){let c=e._trackLayout.find(e=>e.trackKey===i.trackKey);if(!c)continue;let l=c.y+3,u=c.y+c.height-3;i.end>=r&&i.start<=a&&u>=o&&l<=s&&n.add(i.id)}e._selectedIds=n,sO(e)}e._drag={kind:`none`},n.invalidateAll();return}if(i.kind===`event-move`){let n=e._internalEvents.find(e=>e.id===i.eventId);n&&e.dispatchEvent(new CustomEvent(`event-move`,{detail:{eventId:n.id,fromTrackKey:i.originTrackKey,toTrackKey:n.trackKey,start:n.start,end:n.end},bubbles:!0,composed:!0})),e._drag={kind:`none`};return}if(i.kind===`event-start`||i.kind===`event-end`){let n=e._internalEvents.find(e=>e.id===i.eventId);n&&e.dispatchEvent(new CustomEvent(`event-resize`,{detail:{eventId:n.id,start:n.start,end:n.end},bubbles:!0,composed:!0})),e._drag={kind:`none`};return}e._drag={kind:`none`}},{signal:i}),n.addEventListener(`pointerleave`,()=>{e._tickledId!==void 0&&(e._tickledId=void 0,n.invalidateAll())},{signal:i}),()=>r.abort()}function aO(e,n,r){let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=ZD(a.x,i,e.min),s=a.y,c=n.logicalScrollTop;if(s>=c&&s<c+e.axisHeight){n.style.cursor=`col-resize`,e._tickledId!==void 0&&(e._tickledId=void 0,n.invalidateAll());return}let l=$D(o,s,e._internalEvents,e._trackLayout,i),u;(l.kind===`event-move`||l.kind===`event-start`||l.kind===`event-end`)&&(u=l.eventId),l.kind===`event-start`||l.kind===`event-end`?n.style.cursor=`ew-resize`:l.kind===`event-move`?n.style.cursor=`grab`:n.style.cursor=`crosshair`,u!==e._tickledId&&(e._tickledId=u,n.invalidateAll())}function oO(e,n){let r=new Set(e._selectedIds);r.has(n)?r.delete(n):r.add(n),e._selectedIds=r,sO(e),e.getVCanvas()?.invalidateAll()}function sO(e){e.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...e._selectedIds]},bubbles:!0,composed:!0}))}const cO=r`
|
|
12326
|
+
`}};E([d({type:String})],VD.prototype,`text`,void 0),E([d({type:Boolean,reflect:!0})],VD.prototype,`paused`,void 0),VD=E([T(`ixfx-text-shimmer`)],VD);var HD=class{#e;#t;#n=120;#r=4;#i=4;constructor(e,n){this.#e=e,this.#t=n,e.min=n.logicalMin,e.max=n.logicalMax,n.labelFormatter&&(e.formatLabel=n.labelFormatter),e.addEventListener(`track-select`,this.#a)}setTempo(e){this.#n=e,this.#o()}setTimeSignature(e,n){this.#r=e,this.#i=n,this.#o()}setViewRange(e){this.#e.setViewRange(e)}dispose(){this.#e.removeEventListener(`track-select`,this.#a)}#a=e=>{let n=e.detail,r=this.#e.getTrackEvents(n.trackKey).map(e=>e.id);if(n.shiftKey){let e=new Set(this.#e.selectedIds);for(let n of r)e.has(n)?e.delete(n):e.add(n);this.#e.selectedIds=[...e]}else this.#e.selectedIds=r};#o(){if(this.#t.labelFormatter)return;this.#n;let e=this.#r;this.#e.formatLabel=n=>{let r=e,i=n;return`${Math.floor(i/r)+1}.${Math.floor(i%r)+1}`}}};const UD=[1,2,5,10];function WD(e,n,r,i=`adaptive`,a,o){return i===`fixed`&&a!==void 0&&o!==void 0?KD(a,o):GD(e,n,r)}function GD(e,n,r){let i=e.max-e.min;if(i<=0||r<=0)return{majorStep:100,minorDivisions:4,minorStep:25};let a=80*qD(n),o=i/Math.max(2,Math.floor(r/a)),s=10**Math.floor(Math.log10(o)),c=s;for(let e of UD){let n=e*s;if(n>=o*.8){c=n;break}}let l=c/s,u=l===5||l===10?5:4,d=c/u;return{majorStep:c,minorDivisions:u,minorStep:d}}function KD(e,n){let r=e;for(;r*n<5&&r<0xe8d4a51000;)r*=2;return{majorStep:r*4,minorDivisions:4,minorStep:r}}function qD(e){switch(e){case`x-wide`:return 2;case`wide`:return 1.5;case`normal`:return 1;case`slim`:return .7;case`x-slim`:return .5;default:return 1}}function JD(e,n,r,i,a,o){let{majorStep:s,minorStep:c}=r;if(s<=0)return;let l=n.x+n.width;if(i){e.fillStyle=a[`--timeline-alt-major-bg`]??`rgba(255,255,255,0.03)`;let r=Math.floor(n.x/s);for(let i=r;i*s<l;i++)if(i%2!=0){let r=i*s*o;e.fillRect(r,n.y,s*o,n.height)}}if(c>0){e.strokeStyle=a[`--timeline-grid-minor-color`]??`rgba(255,255,255,0.05)`,e.lineWidth=Number.parseFloat(a[`--timeline-grid-minor-width`]??`0.5`),e.beginPath();let r=Math.floor(n.x/c)*c;for(let i=r;i<l;i+=c){if(Math.abs(i%s)<c*.01)continue;let r=i*o;e.moveTo(r,n.y),e.lineTo(r,n.y+n.height)}e.stroke()}e.strokeStyle=a[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=Number.parseFloat(a[`--timeline-grid-major-width`]??`1`),e.beginPath();let u=Math.floor(n.x/s)*s;for(let r=u;r<l;r+=s){let i=r*o;e.moveTo(i,n.y),e.lineTo(i,n.y+n.height)}e.stroke()}function YD(e,n,r,i,a,o,s,c=0){let{majorStep:l}=r;if(l<=0||i<=0)return;let u=c,d=c+i;if(n.y+n.height<u||n.y>d)return;let f=n.x+n.width,p=i-6;e.fillStyle=o[`--timeline-bg`]??`#111`;let m=n.x*s;e.fillRect(m,u,n.width*s,p),e.strokeStyle=o[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=Number.parseFloat(o[`--timeline-grid-major-width`]??`1`),e.beginPath();let h=Math.ceil(n.x/l)*l;for(let n=h;n<f;n+=l){let r=n*s;e.moveTo(r,u+p),e.lineTo(r,d)}e.stroke(),e.strokeStyle=o[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=1,e.beginPath(),e.moveTo(m,d),e.lineTo(m+n.width*s,d),e.stroke(),e.fillStyle=o[`--timeline-axis-label-color`]??`rgba(255,255,255,0.5)`,e.font=`11px system-ui, sans-serif`,e.textBaseline=`middle`,e.textAlign=`left`;for(let n=h;n<f;n+=l){let r=n*s;e.fillText(a(n),r+4,u+p/2)}e.textAlign=`start`}function XD(e,n,r,i,a,o){let s=a[`--timeline-track-bg`]??`#1a1a1a`,c=a[`--timeline-track-bg-alt`]??`#1e1e1e`;for(let l=0;l<r.length;l++){let u=r[l];if(u.y+u.height<n.y)continue;if(u.y>n.y+n.height)break;let d=i.find(e=>e.key===u.trackKey);e.fillStyle=d?.color?`${d.color}22`:l%2==0?s:c,e.fillRect(n.x*o,u.y,n.width*o,u.height),e.strokeStyle=a[`--timeline-grid-major-color`]??`rgba(255,255,255,0.12)`,e.lineWidth=.5,e.beginPath(),e.moveTo(n.x*o,u.y+u.height),e.lineTo((n.x+n.width)*o,u.y+u.height),e.stroke()}}function ZD(e,n,r,i,a,o,s,c,l){let u=c[`--timeline-event-bg`]??`#3498db`,d=c[`--timeline-event-selected-bg`]??`#5dade2`,f=c[`--timeline-event-tickled-bg`]??`#444`,p=c[`--timeline-event-label-color`]??`#fff`,m=Number.parseFloat(c[`--timeline-event-radius`]??`4`),h=n.x+n.width;for(let c of r){if(c.end<n.x||c.start>h)continue;let r=i.find(e=>e.trackKey===c.trackKey);if(!r||r.y+r.height<n.y||r.y>n.y+n.height)continue;let g=!1;(s.kind===`event-move`&&s.eventId===c.id||s.kind===`event-start`&&s.eventId===c.id||s.kind===`event-end`&&s.eventId===c.id)&&(g=!0);let _=c.start*l,v=(c.end-c.start)*l,y=r.y+3,b=r.height-6;if(v<1)continue;let x=a.has(c.id),S=o===c.id,ee;ee=x?d:S?f:c.color??u,e.fillStyle=ee,e.beginPath(),$D(e,_,y,v,b,Math.min(m,v/2,b/2)),e.fill(),g&&(e.strokeStyle=`#fff`,e.lineWidth=1.5,e.beginPath(),$D(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),x&&!g&&(e.strokeStyle=d,e.lineWidth=1,e.beginPath(),$D(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),v>=40&&c.label&&(e.fillStyle=p,e.font=`11px system-ui, sans-serif`,e.textBaseline=`middle`,e.save(),e.beginPath(),e.rect(_+4,y,v-8,b),e.clip(),e.fillText(c.label,_+6,y+b/2),e.restore())}}function QD(e,n,r){if(n.kind!==`marquee`)return;let i=Math.min(n.startLogicalX,n.currentLogicalX)*r,a=Math.max(n.startLogicalX,n.currentLogicalX)*r,o=Math.min(n.startY,n.currentY),s=Math.max(n.startY,n.currentY);e.fillStyle=`rgba(100, 150, 255, 0.15)`,e.fillRect(i,o,a-i,s-o),e.strokeStyle=`rgba(100, 150, 255, 0.6)`,e.lineWidth=1,e.strokeRect(i,o,a-i,s-o)}function $D(e,n,r,i,a,o){o=Math.max(0,o),e.moveTo(n+o,r),e.arcTo(n+i,r,n+i,r+a,o),e.arcTo(n+i,r+a,n,r+a,o),e.arcTo(n,r+a,n,r,o),e.arcTo(n,r,n+i,r,o),e.closePath()}const eO=[`--timeline-bg`,`--timeline-track-bg`,`--timeline-track-bg-alt`,`--timeline-alt-major-bg`,`--timeline-grid-major-color`,`--timeline-grid-minor-color`,`--timeline-grid-major-width`,`--timeline-grid-minor-width`,`--timeline-event-bg`,`--timeline-event-selected-bg`,`--timeline-event-tickled-bg`,`--timeline-event-label-color`,`--timeline-event-radius`,`--timeline-axis-label-color`];function tO(e){let n=getComputedStyle(e),r={};for(let e of eO)r[e]=n.getPropertyValue(e).trim();return r}function nO(e,n,r){return e/n+r}function rO(e){return e>0?1/e:1}function iO(e,n,r,i,a){let o=i.find(e=>n>=e.y&&n<e.y+e.height);if(!o)return{kind:`empty`,logicalX:e,y:n,trackKey:void 0};let s=8*rO(a),c=r.filter(e=>e.trackKey===o.trackKey);for(let n of c)if(!(e<n.start||e>n.end))return e<=n.start+s?{kind:`event-start`,eventId:n.id}:e>=n.end-s?{kind:`event-end`,eventId:n.id}:{kind:`event-move`,eventId:n.id,trackKey:o.trackKey,offsetX:e-n.start};return{kind:`empty`,logicalX:e,y:n,trackKey:o.trackKey}}function aO(e,n){return n.find(n=>e>=n.y&&e<n.y+n.height)?.trackKey}function oO(e,n){return Math.abs(e)>n?e-Math.sign(e)*n:0}function sO(e,n,r,i,a){let o=n*Math.exp(-a/100),s=r-(r-e)*n/o;return o>0&&(s+=-i/o),{ppu:o,viewMin:s}}function cO(e,n,r,i,a,o){let s=n-e,c=s*Math.exp(-a/100),l=i-(s>0?(i-e)/s:.5)*c;return r>0&&(l+=o/r),{vMin:l,vMax:l+c}}function lO(e,n){let r=new AbortController,i=r.signal;return n.addEventListener(`pointerdown`,r=>{let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=nO(a.x,i,e.min),s=a.y,c=n.logicalScrollTop;if(s>=c&&s<c+e.axisHeight){n.setPointerCapture(r.pointerId),e._drag={kind:`axis-zoom`,anchorUnit:o,startScreenX:r.screenX,startScreenY:r.screenY,startViewMin:e._viewRange.min,startPpu:i};return}let l=iO(o,s,e._internalEvents,e._trackLayout,i);if(r.shiftKey&&l.kind===`event-move`){dO(e,l.eventId);return}if(l.kind===`event-move`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-move`,eventId:l.eventId,originTrackKey:l.trackKey,offsetX:l.offsetX};return}if(l.kind===`event-start`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-start`,eventId:l.eventId};return}if(l.kind===`event-end`){n.setPointerCapture(r.pointerId),e._drag={kind:`event-end`,eventId:l.eventId};return}l.kind===`empty`&&(n.setPointerCapture(r.pointerId),e._drag={kind:`marquee`,startLogicalX:o,startY:s,currentLogicalX:o,currentY:s})},{signal:i}),n.addEventListener(`pointermove`,r=>{let i=e._drag;if(i.kind===`none`){uO(e,n,r);return}let a=e.pxPerUnit,o=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),s=nO(o.x,a,e.min),c=o.y;if(i.kind===`axis-zoom`){let n=r.screenX-i.startScreenX,a=r.screenY-i.startScreenY;if(Math.abs(n)+Math.abs(a)<5)return;let o=oO(n,4),s=oO(a,4),c=sO(i.startViewMin,i.startPpu,i.anchorUnit,o,s);e.setZoomPan(c.viewMin,c.ppu);return}if(i.kind===`marquee`){e._drag={...i,currentLogicalX:s,currentY:c},n.invalidateAll();return}if(i.kind===`event-move`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=r.end-r.start,o=s,l=c,u=s-i.offsetX,d=u+a,f=aO(c,e._trackLayout)??r.trackKey,p=e.pxPerUnit,m=WD(e._viewRange,e.userScale,n.viewportWidth,e.gridMode,e.minorStep,p),h=e.processDrag(i.eventId,o,l,u,d,f,i.originTrackKey,m);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,start:h.start,end:h.end,trackKey:h.trackKey}:e),n.invalidateAll();return}if(i.kind===`event-start`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=Math.min(s,r.end-1);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,start:a}:e),n.invalidateAll();return}if(i.kind===`event-end`){let r=e._internalEvents.find(e=>e.id===i.eventId);if(!r)return;let a=Math.max(s,r.start+1);e._internalEvents=e._internalEvents.map(e=>e.id===i.eventId?{...e,end:a}:e),n.invalidateAll()}},{signal:i}),n.addEventListener(`pointerup`,r=>{let i=e._drag;if(n.releasePointerCapture(r.pointerId),i.kind===`axis-zoom`){e._drag={kind:`none`};return}if(i.kind===`marquee`){let r=Math.min(i.startLogicalX,i.currentLogicalX),a=Math.max(i.startLogicalX,i.currentLogicalX),o=Math.min(i.startY,i.currentY),s=Math.max(i.startY,i.currentY);if(Math.abs(a-r)<2&&Math.abs(s-o)<2)e._selectedIds=new Set,fO(e);else{let n=new Set;for(let i of e._internalEvents){let c=e._trackLayout.find(e=>e.trackKey===i.trackKey);if(!c)continue;let l=c.y+3,u=c.y+c.height-3;i.end>=r&&i.start<=a&&u>=o&&l<=s&&n.add(i.id)}e._selectedIds=n,fO(e)}e._drag={kind:`none`},n.invalidateAll();return}if(i.kind===`event-move`){let n=e._internalEvents.find(e=>e.id===i.eventId);n&&e.dispatchEvent(new CustomEvent(`event-move`,{detail:{eventId:n.id,fromTrackKey:i.originTrackKey,toTrackKey:n.trackKey,start:n.start,end:n.end},bubbles:!0,composed:!0})),e._drag={kind:`none`};return}if(i.kind===`event-start`||i.kind===`event-end`){let n=e._internalEvents.find(e=>e.id===i.eventId);n&&e.dispatchEvent(new CustomEvent(`event-resize`,{detail:{eventId:n.id,start:n.start,end:n.end},bubbles:!0,composed:!0})),e._drag={kind:`none`};return}e._drag={kind:`none`}},{signal:i}),n.addEventListener(`pointerleave`,()=>{e._tickledId!==void 0&&(e._tickledId=void 0,n.invalidateAll())},{signal:i}),()=>r.abort()}function uO(e,n,r){let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=nO(a.x,i,e.min),s=a.y,c=n.logicalScrollTop;if(s>=c&&s<c+e.axisHeight){n.style.cursor=`col-resize`,e._tickledId!==void 0&&(e._tickledId=void 0,n.invalidateAll());return}let l=iO(o,s,e._internalEvents,e._trackLayout,i),u;(l.kind===`event-move`||l.kind===`event-start`||l.kind===`event-end`)&&(u=l.eventId),l.kind===`event-start`||l.kind===`event-end`?n.style.cursor=`ew-resize`:l.kind===`event-move`?n.style.cursor=`grab`:n.style.cursor=`crosshair`,u!==e._tickledId&&(e._tickledId=u,n.invalidateAll())}function dO(e,n){let r=new Set(e._selectedIds);r.has(n)?r.delete(n):r.add(n),e._selectedIds=r,fO(e),e.getVCanvas()?.invalidateAll()}function fO(e){e.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...e._selectedIds]},bubbles:!0,composed:!0}))}const pO=r`
|
|
12289
12327
|
:host {
|
|
12290
12328
|
/* Layout */
|
|
12291
12329
|
--timeline-axis-height: 24px;
|
|
@@ -12435,7 +12473,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12435
12473
|
.meta-area.visible {
|
|
12436
12474
|
display: block;
|
|
12437
12475
|
}
|
|
12438
|
-
`;let
|
|
12476
|
+
`;let mO=class extends n{constructor(...e){super(...e),this.label=``,this.trackKey=``,this.selected=!1,this.reorderable=!1,this.resizable=!1,this.#e=!1,this.#t=0,this.#n=0,this.#r=void 0,this.#o=e=>{if(this.#e){let n=e.screenY-this.#t,r=Math.max(24,this.#n+n);this.#a(`track-resize-move`,r);return}this.#i(e)?this.style.cursor=`ns-resize`:this.style.cursor=``},this.#s=e=>{this.#i(e)&&(e.stopPropagation(),e.preventDefault(),this.#e=!0,this.#t=e.screenY,this.#n=this.offsetHeight,this.#r=e.pointerId,this.setPointerCapture(e.pointerId))},this.#c=e=>{if(!this.#e)return;let n=e.screenY-this.#t,r=Math.max(24,this.#n+n);this.#a(`track-resize`,r),this.#u(e.pointerId)},this.#l=e=>{this.#e&&this.#u(this.#r)}}static{this.styles=[w,Xt,r`
|
|
12439
12477
|
:host {
|
|
12440
12478
|
display: flex;
|
|
12441
12479
|
align-items: center;
|
|
@@ -12480,7 +12518,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12480
12518
|
`]}#e;#t;#n;#r;connectedCallback(){super.connectedCallback(),this.addEventListener(`pointermove`,this.#o),this.addEventListener(`pointerdown`,this.#s),this.addEventListener(`pointerup`,this.#c),this.addEventListener(`pointercancel`,this.#l),this.addEventListener(`lostpointercapture`,this.#l)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`pointermove`,this.#o),this.removeEventListener(`pointerdown`,this.#s),this.removeEventListener(`pointerup`,this.#c),this.removeEventListener(`pointercancel`,this.#l),this.removeEventListener(`lostpointercapture`,this.#l),this.#e=!1}render(){return i`
|
|
12481
12519
|
<span class="handle ixfx-handle" data-handle="dotted" data-shape="spot" part="handle"></span>
|
|
12482
12520
|
<span class="label">${this.label}</span>
|
|
12483
|
-
`}#i(e){if(!this.resizable)return!1;let n=this.getBoundingClientRect();return e.clientY>=n.bottom-6}#a(e,n){this.dispatchEvent(new CustomEvent(e,{detail:{trackKey:this.trackKey,height:n},bubbles:!0,composed:!0}))}#o;#s;#c;#l;#u(e){if(this.#e=!1,this.#t=0,this.#n=0,e!==void 0)try{this.releasePointerCapture(e)}catch{}this.#r=void 0,this.style.cursor=``}};E([d({type:String})],
|
|
12521
|
+
`}#i(e){if(!this.resizable)return!1;let n=this.getBoundingClientRect();return e.clientY>=n.bottom-6}#a(e,n){this.dispatchEvent(new CustomEvent(e,{detail:{trackKey:this.trackKey,height:n},bubbles:!0,composed:!0}))}#o;#s;#c;#l;#u(e){if(this.#e=!1,this.#t=0,this.#n=0,e!==void 0)try{this.releasePointerCapture(e)}catch{}this.#r=void 0,this.style.cursor=``}};E([d({type:String})],mO.prototype,`label`,void 0),E([d({type:String,attribute:`track-key`})],mO.prototype,`trackKey`,void 0),E([d({type:Boolean,reflect:!0})],mO.prototype,`selected`,void 0),E([d({type:Boolean,reflect:!0})],mO.prototype,`reorderable`,void 0),E([d({type:Boolean,reflect:!0})],mO.prototype,`resizable`,void 0),mO=E([T(`ixfx-timeline-track-tab`)],mO);function hO(e,n,r,i,a=0,o=0){return{x:e+r-i,y:n+a-o}}function gO(e,n,r,i,a=0,o=0){return{x:e-r+i,y:n-a+o}}function _O(e,n,r){return Math.max(n,Math.min(e,r))}const vO=r`
|
|
12484
12522
|
:host {
|
|
12485
12523
|
display: block;
|
|
12486
12524
|
position: relative;
|
|
@@ -12569,7 +12607,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12569
12607
|
scroll-timeline: --scrollfade x;
|
|
12570
12608
|
}
|
|
12571
12609
|
|
|
12572
|
-
`;function mO(e,n){return e*n}function hO(e,n){return n===0||e<=n}function gO(e,n){return e<0||n===0?0:hO(e,n)?(n-e)/2:0}function _O(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:hO(r,i)?r:e+n>o?Math.max(0,o-e):n}function vO(e,n,r,i){if(r===0)return{firstTile:0,lastTile:0,tiles:[]};let a=mO(n,i.tileWidthMultiplier);if(hO(r,n))return{firstTile:0,lastTile:0,tiles:[{index:0,logicalX:0}]};let o=Math.floor(e/a),s=Math.floor((e+n-1)/a),c=Math.max(0,Math.ceil(r/a)-1),l=[],u=o,d=Math.min(s+i.tilesBuffer,c);for(let e=u;e<=d;e++){let n=e*a;if(!(n>=r)&&(l.push({index:e,logicalX:n}),l.length>=i.maxPoolSize))break}return{firstTile:Math.max(0,o),lastTile:l.length>0?l[l.length-1].index:0,tiles:l}}function yO(e,n){return e*n}function bO(e,n){return n===0||e<=n}function xO(e,n){return e<0||n===0?0:bO(e,n)?(n-e)/2:0}function SO(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:bO(r,i)?r:e+n>o?Math.max(0,o-e):n}function CO(e,n,r,i){if(r===0)return{firstRow:0,lastRow:0,rows:[]};let a=yO(n,i.tileHeightMultiplier);if(bO(r,n))return{firstRow:0,lastRow:0,rows:[{row:0,logicalY:0}]};let o=Math.floor(e/a),s=Math.floor((e+n-1)/a),c=Math.max(0,Math.ceil(r/a)-1),l=[],u=Math.min(s+i.tilesBuffer,c);for(let e=o;e<=u;e++){let n=e*a;if(!(n>=r)&&(l.push({row:e,logicalY:n}),l.length>=i.maxPoolSize))break}return{firstRow:Math.max(0,o),lastRow:l.length>0?l[l.length-1].row:0,rows:l}}function wO(e,n){let r=null,i=(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>{e(...i)},n)};return i.cancel=()=>{r&&=(clearTimeout(r),null)},i}const TO=[`#FF6B6B`,`#4ECDC4`,`#45B7D1`,`#96CEB4`,`#FFEAA7`,`#DDA0DD`,`#98D8C8`,`#F7DC6F`,`#BB8FCE`,`#85C1E9`];function EO(e){return TO[e%TO.length]}function DO(e,n,r,i,a){i.fillStyle=`whitesmoke`,i.fillRect(a.x,a.y,a.width,a.height),i.fillStyle=EO(e),i.strokeStyle=EO(e),i.lineWidth=2,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(a.x+a.width,a.y+a.height),i.moveTo(a.x+a.width,a.y),i.lineTo(a.x,a.y+a.height),i.stroke(),i.font=`24pt system-ui`,i.textBaseline=`top`,i.fillText(`#${e}/${n}`,a.x+20,a.y+20),i.font=`18pt system-ui`,i.fillText(`Pos: ${Math.round(a.x)},${Math.round(a.y)}`,a.x+20,a.y+60),i.fillText(`Size: ${Math.round(a.width)}x${Math.round(a.height)}`,a.x+20,a.y+90),i.fillText(`VCanvas width: ${Math.round(r)}`,a.x+20,a.y+120);let o=a.x+a.width/2,s=a.y+a.height/2;i.beginPath(),i.moveTo(a.x,s),i.lineTo(a.x+a.width,s),i.moveTo(o,a.y),i.lineTo(o,a.y+a.height),i.stroke(),i.strokeRect(a.x,a.y,a.width,a.height)}var OO=function(e,n,r,i){var a=arguments.length,o=a<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,r):i,s;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,n,r,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(o=(a<3?s(o):a>3?s(n,r,o):s(n,r))||o);return a>3&&o&&Object.defineProperty(n,r,o),o};const kO=(e,n)=>`${e},${n}`;let AO=class extends n{_emitScrollEndEvent(e){let n=new CustomEvent(`scrollend-virtual`,{detail:{logicalScrollLeft:this._scrollLeft,logicalScrollTop:this._scrollTop,userGesture:e,containerScrollLeft:this._scrollContainer?.scrollLeft??0,containerScrollTop:this._scrollContainer?.scrollTop??0},bubbles:!0,composed:!0});this.dispatchEvent(n)}constructor(){super(),this.debugTrace=!1,this.debugDraw=!1,this.hinting=!1,this._viewportWidth=0,this._viewportHeight=0,this._scrollLeft=0,this._scrollTop=0,this._logicalHeight=0,this._tilePool=new Map,this._visibleTiles=new Set,this._pendingDraws=new Map,this._scrollContainer=null,this._spacer=null,this._tilePoolEl=null,this._childrenContainerEl=null,this._resizeObserver=null,this._positionedChildren=new Map,this._boundOnScroll=this._onScroll.bind(this),this._renderingOptions={tileWidthMultiplier:.5,tileHeightMultiplier:.5,tilesBuffer:2,overlapPercent:.01,overscrollPadMultiplier:1,maxPoolSize:3,scrollDebounceMs:100},this._dpr=window.devicePixelRatio||1,this._logicalWidth=0,this.logicalWidth=0,this.logicalHeight=0,this.drawCallback=null,this._scrollDebounce=wO(()=>{this._requestRedrawAll(`scrollDebounce`)},this._renderingOptions.scrollDebounceMs),this._scrollEndDebounce=wO(()=>{this._emitScrollEndEvent(!0)},this._renderingOptions.scrollDebounceMs),this._resizeDebounce=wO(()=>{this._onResize()},this._renderingOptions.scrollDebounceMs)}static{this.styles=pO}connectedCallback(){super.connectedCallback(),this._setupResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._scrollEndDebounce.cancel(),this._pendingDraws.forEach(e=>e.abort()),this._tilePool.clear(),this._scrollContainer?.removeEventListener(`scroll`,this._boundOnScroll)}firstUpdated(){let e=this.shadowRoot?.querySelector(`.scroll-container`);this._scrollContainer=e,this._spacer=this.shadowRoot?.querySelector(`.spacer`),this._tilePoolEl=this.shadowRoot?.querySelector(`.tile-pool`),this._childrenContainerEl=this.shadowRoot?.querySelector(`.children-container`),this._scrollContainer&&this._scrollContainer.addEventListener(`scroll`,this._boundOnScroll),requestAnimationFrame(()=>{this._updateViewportDimensions(),this._updateSpacer(),this._updateScrollContainerClass(),this._recalculateTiles(`firstUpdated cb`),this._positionChildren(`firstUpdated cb`)})}set logicalWidth(e){this._logicalWidth=e,this._updateSpacer(),this._updateScrollContainerClass(),this.hasUpdated&&(this._updateTileWidths(`set logicalWidth`),this._recalculateTiles(`set logicalWidth`))}get logicalWidth(){return this._logicalWidth}set logicalHeight(e){this._logicalHeight=e,this._updateSpacer(),this._updateScrollContainerClass(),this.hasUpdated&&this._recalculateTiles(`set logicalHeight`)}get logicalHeight(){return this._logicalHeight}get effectiveLogicalWidth(){return this._logicalWidth||this._viewportWidth}get effectiveLogicalHeight(){return this._logicalHeight||this._viewportHeight}_setupResizeObserver(){this._resizeObserver=new ResizeObserver(()=>{this._resizeDebounce()}),this._resizeObserver.observe(this)}_onResize(){let e=this._viewportWidth,n=this._viewportHeight;this._updateViewportDimensions();let r=e!==this._viewportWidth,i=n!==this._viewportHeight;(r||i)&&(this._updateSpacer(),this._updateScrollContainerClass(),this._recalculateTiles(`onResize`))}_updateTileWidths(e){let n=this._getTileWidth();for(let e of this._tilePool.values()){let r=this._getTileClippedWidth(e.logicalX,n);e.canvas.width=r*this._dpr,e.canvas.style.width=`${r}px`,e.ctx.scale(this._dpr,this._dpr)}this._requestRedrawAll(`updateTileWidths (${e})`)}_updateViewportDimensions(){let e=this.getBoundingClientRect();this._viewportWidth=e.width,this._viewportHeight=e.height}_onScroll(){if(!this._scrollContainer)return;let e=this._scrollContainer.scrollLeft,n=this._scrollContainer.scrollTop;(e!==this._scrollLeft||n!==this._scrollTop)&&(this._scrollLeft=e,this._scrollTop=n,this._recalculateTiles(`onScroll`),this._emitScrollEvent(!0),this._scrollDebounce(),this._scrollEndDebounce())}_updateSpacer(){if(!this._spacer)return;let e=hO(this.effectiveLogicalWidth,this._viewportWidth),n=bO(this.effectiveLogicalHeight,this._viewportHeight);e&&n?this._spacer.style.display=`none`:(this._spacer.style.display=`block`,this._spacer.style.width=`${this.effectiveLogicalWidth}px`,this._spacer.style.height=`${this.effectiveLogicalHeight}px`),this._childrenContainerEl&&(this._childrenContainerEl.style.width=`${this.effectiveLogicalWidth}px`,this._childrenContainerEl.style.height=`${this.effectiveLogicalHeight}px`)}_updateScrollContainerClass(){if(!this._scrollContainer)return;let e=this.effectiveLogicalHeight>this._viewportHeight;this._scrollContainer.classList.toggle(`vertical`,e)}_getTileWidth(){return mO(this._viewportWidth,this._renderingOptions.tileWidthMultiplier)}_getTileHeight(){return yO(this._viewportHeight,this._renderingOptions.tileHeightMultiplier)}_getTileClippedWidth(e,n){return _O(e,n,this.effectiveLogicalWidth,this._viewportWidth,this._renderingOptions.overscrollPadMultiplier)}_getTileClippedHeight(e,n){return SO(e,n,this.effectiveLogicalHeight,this._viewportHeight,this._renderingOptions.overscrollPadMultiplier)}_calculateTileRange(){return vO(this._scrollLeft,this._viewportWidth,this.effectiveLogicalWidth,this._renderingOptions)}_calculateTileRowRange(){return CO(this._scrollTop,this._viewportHeight,this.effectiveLogicalHeight,this._renderingOptions)}_recalculateTiles(e){this._updateViewportDimensions();let{tiles:n}=this._calculateTileRange(),{rows:r}=this._calculateTileRowRange(),i=new Set;for(let{index:e,logicalX:a}of n)for(let{row:n,logicalY:o}of r)i.add(kO(e,n)),this._tilePool.has(kO(e,n))||this._tilePool.set(kO(e,n),this._createTile(e,n,a,o));let a=this._renderingOptions.maxPoolSize*Math.max(1,r.length),o=[...this._tilePool.keys()].filter(e=>!i.has(e)),s=[...i].filter(e=>!this._tilePool.has(e)),c=Math.min(o.length,s.length);for(let e=0;e<c;e++){let n=o[e],r=s[e],i=this._tilePool.get(n);if(i&&r){let[e,a]=r.split(`,`),o=Number(e),s=Number(a);this._tilePool.delete(n),i.col=o,i.row=s,i.logicalX=o*this._getTileWidth(),i.logicalY=s*this._getTileHeight(),i.visible=!1,i.canvas.dataset.tileKey=r,this._tilePool.set(r,i)}}let l=[...this._tilePool.keys()];if(l.length>a){let e=l.length-a;l.filter(e=>!i.has(e)).slice(0,e).forEach(e=>{let n=this._tilePool.get(e);n&&(this._tilePool.delete(e),n.canvas.remove())})}this._updateTiles(`recalculateTiles (${e})`)}_createTile(e,n,r,i){let a=document.createElement(`canvas`),o=kO(e,n);a.dataset.tileKey=o;let s=this._getTileWidth(),c=this._getTileHeight(),l=this._getTileClippedWidth(r,s),u=this._getTileClippedHeight(i,c),d=a.getContext(`2d`);if(!d)throw Error(`Could not get canvas context`);return this._viewportHeight===0&&this.#e(`Warning: Creating tile ${o} with viewport height 0. The VCanvas component may not be properly sized or visible.`),a.width=l*this._dpr,a.height=u*this._dpr,a.style.width=`${l}px`,a.style.height=`${u}px`,d.scale(this._dpr,this._dpr),this.#e(`Created tile ${o} at logicalX ${r} logicalY ${i}`),{canvas:a,ctx:d,logicalX:r,logicalY:i,col:e,row:n,visible:!1,isInDOM:!1}}_updateTiles(e){let{tiles:n,firstTile:r,lastTile:i}=this._calculateTileRange(),{rows:a,firstRow:o,lastRow:s}=this._calculateTileRowRange(),c=this._getTileWidth(),l=this._getTileHeight(),u=hO(this.effectiveLogicalWidth,this._viewportWidth),d=bO(this.effectiveLogicalHeight,this._viewportHeight),f=gO(this.effectiveLogicalWidth,this._viewportWidth),p=xO(this.effectiveLogicalHeight,this._viewportHeight),m=this._renderingOptions.tilesBuffer,h=[];for(let e of this._tilePool.values())e.visible=!1;this._visibleTiles.clear();for(let[n,a]of this._tilePool){let g=u?a.col===0:a.col>=r-m&&a.col<=i+m,_=d?a.row===0:a.row>=o-m&&a.row<=s+m;if(g&&_){this._visibleTiles.add(n);let r=a.col*c,i=a.row*l,o=u?f:r,s=d?p:i,m=this._getTileClippedWidth(r,c),g=this._getTileClippedHeight(i,l);(!a.visible||a.logicalX!==r||a.logicalY!==i||a.canvas.style.left!==`${o}px`||a.canvas.style.top!==`${s}px`||a.canvas.width!==m*this._dpr||a.canvas.height!==g*this._dpr)&&(a.logicalX=r,a.logicalY=i,a.canvas.width=m*this._dpr,a.canvas.style.width=`${m}px`,a.canvas.height=g*this._dpr,a.canvas.style.height=`${g}px`,a.canvas.style.left=`${o}px`,a.canvas.style.top=`${s}px`,a.ctx.scale(this._dpr,this._dpr),!a.isInDOM&&this._tilePoolEl&&(this._tilePoolEl.appendChild(a.canvas),a.isInDOM=!0),a.visible||(h.push(n),this._requestTileDraw(`updateTiles(${e})`,n))),a.visible=!0}else a.visible&&(a.visible=!1,a.isInDOM=!1,a.canvas.remove())}for(let{index:r,logicalX:i}of n)for(let{row:n,logicalY:o}of a){let a=kO(r,n);if(!this._tilePool.has(a)&&this._tilePoolEl){let s=this._createTile(r,n,i,o),c=u?f:i,l=d?p:o;s.canvas.style.left=`${c}px`,s.canvas.style.top=`${l}px`,s.visible=!0,s.isInDOM=!0,this._tilePoolEl.appendChild(s.canvas),this._tilePool.set(a,s),this._visibleTiles.add(a),h.push(a),this._requestTileDraw(`updateTiles(${e})`,a)}}return h}_requestRedrawAll(e){this.#e(`Requesting _requestRedrawAll: ${e} visible tiles: ${this._visibleTiles.size} pending draws: ${this._pendingDraws.size}`),this._pendingDraws.forEach(e=>e.abort()),this._pendingDraws.clear();for(let n of this._visibleTiles)this._requestTileDraw(`requestRedrawAll(${e})`,n)}#e(e){this.debugTrace&&console.log(`[VCanvas]`,e)}_requestTileDraw(e,n,r){let i=this._tilePool.get(n);if(!i||!this.drawCallback)return;let a=new AbortController;this._pendingDraws.set(n,a);let o=this._getTileWidth(),s=this._getTileHeight(),c=hO(this.effectiveLogicalWidth,this._viewportWidth),l=bO(this.effectiveLogicalHeight,this._viewportHeight),u;if(r)u=r;else{let e=o*this._renderingOptions.overlapPercent,n=s*this._renderingOptions.overlapPercent;u={x:c?0:i.logicalX-e,y:l?0:i.logicalY-n,width:c?this.effectiveLogicalWidth:o+e*2,height:l?this.effectiveLogicalHeight:s+n*2}}i.ctx.save(),i.ctx.translate(-i.logicalX,-i.logicalY);let d=u.x-i.logicalX,f=u.y-i.logicalY;r?(i.ctx.beginPath(),i.ctx.rect(d,f,u.width,u.height),i.ctx.clip(),i.ctx.clearRect(d,f,u.width,u.height)):i.ctx.clearRect(0,0,i.canvas.width,i.canvas.height),this.debugDraw&&DO(i.col,this._tilePool.size,this.effectiveLogicalWidth,i.ctx,u);try{this.drawCallback(i.ctx,u,a.signal)}finally{i&&i.ctx.restore(),this._pendingDraws.delete(n)}}_emitScrollEvent(e){let n=new CustomEvent(`scroll-virtual`,{detail:{logicalScrollLeft:this._scrollLeft,logicalScrollTop:this._scrollTop,userGesture:e,containerScrollLeft:this._scrollContainer?.scrollLeft??0,containerScrollTop:this._scrollContainer?.scrollTop??0,viewportStartLogical:this._scrollLeft,viewportEndLogical:this._scrollLeft+this._viewportWidth,viewportStartLogicalY:this._scrollTop,viewportEndLogicalY:this._scrollTop+this._viewportHeight},bubbles:!0,composed:!0});this.dispatchEvent(n)}isRegionVisible(e){let n=this._scrollLeft,r=this._scrollLeft+this._viewportWidth,i=e.x+e.width>n&&e.x<r,a=this._scrollTop,o=this._scrollTop+this._viewportHeight,s=e.y+e.height>a&&e.y<o;return i&&s}_updateScrollPosition(e){this._scrollContainer&&(this._scrollContainer.scrollLeft=this._scrollLeft,this._scrollContainer.scrollTop=this._scrollTop),this._recalculateTiles(`updateScrollPosition`),this._emitScrollEvent(e),this._scrollDebounce()}get logicalScrollLeft(){return this._scrollLeft}set logicalScrollLeft(e){let n=this._scrollLeft,r=fO(e,0,Math.max(0,this.effectiveLogicalWidth-this._viewportWidth));r!==this._scrollLeft&&(this._scrollLeft=r,this.requestUpdate(`logicalScrollLeft`,n),this._updateScrollPosition(!1))}get logicalScrollTop(){return this._scrollTop}set logicalScrollTop(e){let n=this._scrollTop,r=fO(e,0,Math.max(0,this.effectiveLogicalHeight-this._viewportHeight));r!==this._scrollTop&&(this._scrollTop=r,this.requestUpdate(`logicalScrollTop`,n),this._updateScrollPosition(!1))}get containerScrollLeft(){return this._scrollContainer?.scrollLeft??0}get containerScrollTop(){return this._scrollContainer?.scrollTop??0}get viewportWidth(){return this._viewportWidth}get viewportHeight(){return this._viewportHeight}setRenderingOptions(e){this._renderingOptions={...this._renderingOptions,...e},this._recalculateTiles(`setRenderingOptions`)}getRenderingOptions(){return this._renderingOptions}invalidateAll(){this._requestRedrawAll(`invalidateAll`)}invalidateRegion(e,n,r,i){this.#e(`invalidateRegion: ${e},${n},${r},${i}`);let a=this._getTileWidth(),o=this._getTileHeight(),{firstTile:s,lastTile:c}=this._calculateTileRange(),{firstRow:l,lastRow:u}=this._calculateTileRowRange(),d=this._renderingOptions.overlapPercent,f=Math.floor(e/a),p=Math.ceil((e+r)/a),m=Math.floor(n/o),h=Math.ceil((n+i)/o);for(let g=Math.max(s,f);g<=Math.min(c,p);g++)for(let s=Math.max(l,m);s<=Math.min(u,h);s++){let c=kO(g,s);if(this._visibleTiles.has(c)){let s=this._tilePool.get(c);if(s){let l=a*d,u=o*d,f=s.logicalX-l,p=s.logicalX+a+l,m=s.logicalY-u,h=s.logicalY+o+u,g=Math.max(e,f),_=Math.min(e+r,p)-g,v=Math.max(n,m),y=Math.min(n+i,h)-v;if(_>0&&y>0){let e={x:g,y:v,width:_,height:y};this._requestTileDraw(`invalidateRegion`,c,e)}}}}}convertFromViewportToCanvas(e,n){let r=gO(this.effectiveLogicalWidth,this._viewportWidth),i=xO(this.effectiveLogicalHeight,this._viewportHeight);return uO(e,n,this._scrollLeft,r,this._scrollTop,i)}convertFromCanvasToViewport(e,n){let r=gO(this.effectiveLogicalWidth,this._viewportWidth),i=xO(this.effectiveLogicalHeight,this._viewportHeight);return dO(e,n,this._scrollLeft,r,this._scrollTop,i)}positionChildRange(e,n,r,i,a){if(Number.isNaN(n)||Number.isNaN(r)){console.warn(`positionChildRange: Invalid startX or endX values: ${n}, ${r}`);return}let o=Array.from(this.children).filter(n=>n.matches?.(e)),s=i??0,c=a??this.effectiveLogicalHeight;for(let e of o)this._positionedChildren.set(e,{startX:n,endX:r,startY:s,endY:c});this._positionChildren(`positionChildRange`)}manualChildPositioningUpdate(){this._positionChildren(`manualChildPositioningUpdate`)}positionChildClear(e){for(let[n]of this._positionedChildren)n.matches?.(e)&&(this._positionedChildren.delete(n),n.removeAttribute(`style`))}_positionChildren(e){if(this.#e(`_positionChildren: ${e} positionedChildren: ${this._positionedChildren.size}`),this.hasUpdated&&this._childrenContainerEl)for(let[e,n]of this._positionedChildren){let r=n.endX-n.startX,i=n.endY-n.startY;e.setAttribute(`style`,`position: absolute; left: ${n.startX}px; top: ${n.startY}px; width: ${r}px; height: ${i}px;`)}}render(){let e=v({"scroll-container":!0,scrollable:this.hinting});return i`
|
|
12610
|
+
`;function yO(e,n){return e*n}function bO(e,n){return n===0||e<=n}function xO(e,n){return e<0||n===0?0:bO(e,n)?(n-e)/2:0}function SO(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:bO(r,i)?r:e+n>o?Math.max(0,o-e):n}function CO(e,n,r,i){if(r===0)return{firstTile:0,lastTile:0,tiles:[]};let a=yO(n,i.tileWidthMultiplier);if(bO(r,n))return{firstTile:0,lastTile:0,tiles:[{index:0,logicalX:0}]};let o=Math.floor(e/a),s=Math.floor((e+n-1)/a),c=Math.max(0,Math.ceil(r/a)-1),l=[],u=o,d=Math.min(s+i.tilesBuffer,c);for(let e=u;e<=d;e++){let n=e*a;if(!(n>=r)&&(l.push({index:e,logicalX:n}),l.length>=i.maxPoolSize))break}return{firstTile:Math.max(0,o),lastTile:l.length>0?l[l.length-1].index:0,tiles:l}}function wO(e,n){return e*n}function TO(e,n){return n===0||e<=n}function EO(e,n){return e<0||n===0?0:TO(e,n)?(n-e)/2:0}function DO(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:TO(r,i)?r:e+n>o?Math.max(0,o-e):n}function OO(e,n,r,i){if(r===0)return{firstRow:0,lastRow:0,rows:[]};let a=wO(n,i.tileHeightMultiplier);if(TO(r,n))return{firstRow:0,lastRow:0,rows:[{row:0,logicalY:0}]};let o=Math.floor(e/a),s=Math.floor((e+n-1)/a),c=Math.max(0,Math.ceil(r/a)-1),l=[],u=Math.min(s+i.tilesBuffer,c);for(let e=o;e<=u;e++){let n=e*a;if(!(n>=r)&&(l.push({row:e,logicalY:n}),l.length>=i.maxPoolSize))break}return{firstRow:Math.max(0,o),lastRow:l.length>0?l[l.length-1].row:0,rows:l}}function kO(e,n){let r=null,i=(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>{e(...i)},n)};return i.cancel=()=>{r&&=(clearTimeout(r),null)},i}const AO=[`#FF6B6B`,`#4ECDC4`,`#45B7D1`,`#96CEB4`,`#FFEAA7`,`#DDA0DD`,`#98D8C8`,`#F7DC6F`,`#BB8FCE`,`#85C1E9`];function jO(e){return AO[e%AO.length]}function MO(e,n,r,i,a){i.fillStyle=`whitesmoke`,i.fillRect(a.x,a.y,a.width,a.height),i.fillStyle=jO(e),i.strokeStyle=jO(e),i.lineWidth=2,i.beginPath(),i.moveTo(a.x,a.y),i.lineTo(a.x+a.width,a.y+a.height),i.moveTo(a.x+a.width,a.y),i.lineTo(a.x,a.y+a.height),i.stroke(),i.font=`24pt system-ui`,i.textBaseline=`top`,i.fillText(`#${e}/${n}`,a.x+20,a.y+20),i.font=`18pt system-ui`,i.fillText(`Pos: ${Math.round(a.x)},${Math.round(a.y)}`,a.x+20,a.y+60),i.fillText(`Size: ${Math.round(a.width)}x${Math.round(a.height)}`,a.x+20,a.y+90),i.fillText(`VCanvas width: ${Math.round(r)}`,a.x+20,a.y+120);let o=a.x+a.width/2,s=a.y+a.height/2;i.beginPath(),i.moveTo(a.x,s),i.lineTo(a.x+a.width,s),i.moveTo(o,a.y),i.lineTo(o,a.y+a.height),i.stroke(),i.strokeRect(a.x,a.y,a.width,a.height)}var NO=function(e,n,r,i){var a=arguments.length,o=a<3?n:i===null?i=Object.getOwnPropertyDescriptor(n,r):i,s;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)o=Reflect.decorate(e,n,r,i);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(o=(a<3?s(o):a>3?s(n,r,o):s(n,r))||o);return a>3&&o&&Object.defineProperty(n,r,o),o};const PO=(e,n)=>`${e},${n}`;let FO=class extends n{_emitScrollEndEvent(e){let n=new CustomEvent(`scrollend-virtual`,{detail:{logicalScrollLeft:this._scrollLeft,logicalScrollTop:this._scrollTop,userGesture:e,containerScrollLeft:this._scrollContainer?.scrollLeft??0,containerScrollTop:this._scrollContainer?.scrollTop??0},bubbles:!0,composed:!0});this.dispatchEvent(n)}constructor(){super(),this.debugTrace=!1,this.debugDraw=!1,this.hinting=!1,this._viewportWidth=0,this._viewportHeight=0,this._scrollLeft=0,this._scrollTop=0,this._logicalHeight=0,this._tilePool=new Map,this._visibleTiles=new Set,this._pendingDraws=new Map,this._scrollContainer=null,this._spacer=null,this._tilePoolEl=null,this._childrenContainerEl=null,this._resizeObserver=null,this._positionedChildren=new Map,this._boundOnScroll=this._onScroll.bind(this),this._renderingOptions={tileWidthMultiplier:.5,tileHeightMultiplier:.5,tilesBuffer:2,overlapPercent:.01,overscrollPadMultiplier:1,maxPoolSize:3,scrollDebounceMs:100},this._dpr=window.devicePixelRatio||1,this._logicalWidth=0,this.logicalWidth=0,this.logicalHeight=0,this.drawCallback=null,this._scrollDebounce=kO(()=>{this._requestRedrawAll(`scrollDebounce`)},this._renderingOptions.scrollDebounceMs),this._scrollEndDebounce=kO(()=>{this._emitScrollEndEvent(!0)},this._renderingOptions.scrollDebounceMs),this._resizeDebounce=kO(()=>{this._onResize()},this._renderingOptions.scrollDebounceMs)}static{this.styles=vO}connectedCallback(){super.connectedCallback(),this._setupResizeObserver()}disconnectedCallback(){super.disconnectedCallback(),this._resizeObserver?.disconnect(),this._resizeObserver=null,this._scrollEndDebounce.cancel(),this._pendingDraws.forEach(e=>e.abort()),this._tilePool.clear(),this._scrollContainer?.removeEventListener(`scroll`,this._boundOnScroll)}firstUpdated(){let e=this.shadowRoot?.querySelector(`.scroll-container`);this._scrollContainer=e,this._spacer=this.shadowRoot?.querySelector(`.spacer`),this._tilePoolEl=this.shadowRoot?.querySelector(`.tile-pool`),this._childrenContainerEl=this.shadowRoot?.querySelector(`.children-container`),this._scrollContainer&&this._scrollContainer.addEventListener(`scroll`,this._boundOnScroll),requestAnimationFrame(()=>{this._updateViewportDimensions(),this._updateSpacer(),this._updateScrollContainerClass(),this._recalculateTiles(`firstUpdated cb`),this._positionChildren(`firstUpdated cb`)})}set logicalWidth(e){this._logicalWidth=e,this._updateSpacer(),this._updateScrollContainerClass(),this.hasUpdated&&(this._updateTileWidths(`set logicalWidth`),this._recalculateTiles(`set logicalWidth`))}get logicalWidth(){return this._logicalWidth}set logicalHeight(e){this._logicalHeight=e,this._updateSpacer(),this._updateScrollContainerClass(),this.hasUpdated&&this._recalculateTiles(`set logicalHeight`)}get logicalHeight(){return this._logicalHeight}get effectiveLogicalWidth(){return this._logicalWidth||this._viewportWidth}get effectiveLogicalHeight(){return this._logicalHeight||this._viewportHeight}_setupResizeObserver(){this._resizeObserver=new ResizeObserver(()=>{this._resizeDebounce()}),this._resizeObserver.observe(this)}_onResize(){let e=this._viewportWidth,n=this._viewportHeight;this._updateViewportDimensions();let r=e!==this._viewportWidth,i=n!==this._viewportHeight;(r||i)&&(this._updateSpacer(),this._updateScrollContainerClass(),this._recalculateTiles(`onResize`))}_updateTileWidths(e){let n=this._getTileWidth();for(let e of this._tilePool.values()){let r=this._getTileClippedWidth(e.logicalX,n);e.canvas.width=r*this._dpr,e.canvas.style.width=`${r}px`,e.ctx.scale(this._dpr,this._dpr)}this._requestRedrawAll(`updateTileWidths (${e})`)}_updateViewportDimensions(){let e=this.getBoundingClientRect();this._viewportWidth=e.width,this._viewportHeight=e.height}_onScroll(){if(!this._scrollContainer)return;let e=this._scrollContainer.scrollLeft,n=this._scrollContainer.scrollTop;(e!==this._scrollLeft||n!==this._scrollTop)&&(this._scrollLeft=e,this._scrollTop=n,this._recalculateTiles(`onScroll`),this._emitScrollEvent(!0),this._scrollDebounce(),this._scrollEndDebounce())}_updateSpacer(){if(!this._spacer)return;let e=bO(this.effectiveLogicalWidth,this._viewportWidth),n=TO(this.effectiveLogicalHeight,this._viewportHeight);e&&n?this._spacer.style.display=`none`:(this._spacer.style.display=`block`,this._spacer.style.width=`${this.effectiveLogicalWidth}px`,this._spacer.style.height=`${this.effectiveLogicalHeight}px`),this._childrenContainerEl&&(this._childrenContainerEl.style.width=`${this.effectiveLogicalWidth}px`,this._childrenContainerEl.style.height=`${this.effectiveLogicalHeight}px`)}_updateScrollContainerClass(){if(!this._scrollContainer)return;let e=this.effectiveLogicalHeight>this._viewportHeight;this._scrollContainer.classList.toggle(`vertical`,e)}_getTileWidth(){return yO(this._viewportWidth,this._renderingOptions.tileWidthMultiplier)}_getTileHeight(){return wO(this._viewportHeight,this._renderingOptions.tileHeightMultiplier)}_getTileClippedWidth(e,n){return SO(e,n,this.effectiveLogicalWidth,this._viewportWidth,this._renderingOptions.overscrollPadMultiplier)}_getTileClippedHeight(e,n){return DO(e,n,this.effectiveLogicalHeight,this._viewportHeight,this._renderingOptions.overscrollPadMultiplier)}_calculateTileRange(){return CO(this._scrollLeft,this._viewportWidth,this.effectiveLogicalWidth,this._renderingOptions)}_calculateTileRowRange(){return OO(this._scrollTop,this._viewportHeight,this.effectiveLogicalHeight,this._renderingOptions)}_recalculateTiles(e){this._updateViewportDimensions();let{tiles:n}=this._calculateTileRange(),{rows:r}=this._calculateTileRowRange(),i=new Set;for(let{index:e,logicalX:a}of n)for(let{row:n,logicalY:o}of r)i.add(PO(e,n)),this._tilePool.has(PO(e,n))||this._tilePool.set(PO(e,n),this._createTile(e,n,a,o));let a=this._renderingOptions.maxPoolSize*Math.max(1,r.length),o=[...this._tilePool.keys()].filter(e=>!i.has(e)),s=[...i].filter(e=>!this._tilePool.has(e)),c=Math.min(o.length,s.length);for(let e=0;e<c;e++){let n=o[e],r=s[e],i=this._tilePool.get(n);if(i&&r){let[e,a]=r.split(`,`),o=Number(e),s=Number(a);this._tilePool.delete(n),i.col=o,i.row=s,i.logicalX=o*this._getTileWidth(),i.logicalY=s*this._getTileHeight(),i.visible=!1,i.canvas.dataset.tileKey=r,this._tilePool.set(r,i)}}let l=[...this._tilePool.keys()];if(l.length>a){let e=l.length-a;l.filter(e=>!i.has(e)).slice(0,e).forEach(e=>{let n=this._tilePool.get(e);n&&(this._tilePool.delete(e),n.canvas.remove())})}this._updateTiles(`recalculateTiles (${e})`)}_createTile(e,n,r,i){let a=document.createElement(`canvas`),o=PO(e,n);a.dataset.tileKey=o;let s=this._getTileWidth(),c=this._getTileHeight(),l=this._getTileClippedWidth(r,s),u=this._getTileClippedHeight(i,c),d=a.getContext(`2d`);if(!d)throw Error(`Could not get canvas context`);return this._viewportHeight===0&&this.#e(`Warning: Creating tile ${o} with viewport height 0. The VCanvas component may not be properly sized or visible.`),a.width=l*this._dpr,a.height=u*this._dpr,a.style.width=`${l}px`,a.style.height=`${u}px`,d.scale(this._dpr,this._dpr),this.#e(`Created tile ${o} at logicalX ${r} logicalY ${i}`),{canvas:a,ctx:d,logicalX:r,logicalY:i,col:e,row:n,visible:!1,isInDOM:!1}}_updateTiles(e){let{tiles:n,firstTile:r,lastTile:i}=this._calculateTileRange(),{rows:a,firstRow:o,lastRow:s}=this._calculateTileRowRange(),c=this._getTileWidth(),l=this._getTileHeight(),u=bO(this.effectiveLogicalWidth,this._viewportWidth),d=TO(this.effectiveLogicalHeight,this._viewportHeight),f=xO(this.effectiveLogicalWidth,this._viewportWidth),p=EO(this.effectiveLogicalHeight,this._viewportHeight),m=this._renderingOptions.tilesBuffer,h=[];for(let e of this._tilePool.values())e.visible=!1;this._visibleTiles.clear();for(let[n,a]of this._tilePool){let g=u?a.col===0:a.col>=r-m&&a.col<=i+m,_=d?a.row===0:a.row>=o-m&&a.row<=s+m;if(g&&_){this._visibleTiles.add(n);let r=a.col*c,i=a.row*l,o=u?f:r,s=d?p:i,m=this._getTileClippedWidth(r,c),g=this._getTileClippedHeight(i,l);(!a.visible||a.logicalX!==r||a.logicalY!==i||a.canvas.style.left!==`${o}px`||a.canvas.style.top!==`${s}px`||a.canvas.width!==m*this._dpr||a.canvas.height!==g*this._dpr)&&(a.logicalX=r,a.logicalY=i,a.canvas.width=m*this._dpr,a.canvas.style.width=`${m}px`,a.canvas.height=g*this._dpr,a.canvas.style.height=`${g}px`,a.canvas.style.left=`${o}px`,a.canvas.style.top=`${s}px`,a.ctx.scale(this._dpr,this._dpr),!a.isInDOM&&this._tilePoolEl&&(this._tilePoolEl.appendChild(a.canvas),a.isInDOM=!0),a.visible||(h.push(n),this._requestTileDraw(`updateTiles(${e})`,n))),a.visible=!0}else a.visible&&(a.visible=!1,a.isInDOM=!1,a.canvas.remove())}for(let{index:r,logicalX:i}of n)for(let{row:n,logicalY:o}of a){let a=PO(r,n);if(!this._tilePool.has(a)&&this._tilePoolEl){let s=this._createTile(r,n,i,o),c=u?f:i,l=d?p:o;s.canvas.style.left=`${c}px`,s.canvas.style.top=`${l}px`,s.visible=!0,s.isInDOM=!0,this._tilePoolEl.appendChild(s.canvas),this._tilePool.set(a,s),this._visibleTiles.add(a),h.push(a),this._requestTileDraw(`updateTiles(${e})`,a)}}return h}_requestRedrawAll(e){this.#e(`Requesting _requestRedrawAll: ${e} visible tiles: ${this._visibleTiles.size} pending draws: ${this._pendingDraws.size}`),this._pendingDraws.forEach(e=>e.abort()),this._pendingDraws.clear();for(let n of this._visibleTiles)this._requestTileDraw(`requestRedrawAll(${e})`,n)}#e(e){this.debugTrace&&console.log(`[VCanvas]`,e)}_requestTileDraw(e,n,r){let i=this._tilePool.get(n);if(!i||!this.drawCallback)return;let a=new AbortController;this._pendingDraws.set(n,a);let o=this._getTileWidth(),s=this._getTileHeight(),c=bO(this.effectiveLogicalWidth,this._viewportWidth),l=TO(this.effectiveLogicalHeight,this._viewportHeight),u;if(r)u=r;else{let e=o*this._renderingOptions.overlapPercent,n=s*this._renderingOptions.overlapPercent;u={x:c?0:i.logicalX-e,y:l?0:i.logicalY-n,width:c?this.effectiveLogicalWidth:o+e*2,height:l?this.effectiveLogicalHeight:s+n*2}}i.ctx.save(),i.ctx.translate(-i.logicalX,-i.logicalY);let d=u.x-i.logicalX,f=u.y-i.logicalY;r?(i.ctx.beginPath(),i.ctx.rect(d,f,u.width,u.height),i.ctx.clip(),i.ctx.clearRect(d,f,u.width,u.height)):i.ctx.clearRect(0,0,i.canvas.width,i.canvas.height),this.debugDraw&&MO(i.col,this._tilePool.size,this.effectiveLogicalWidth,i.ctx,u);try{this.drawCallback(i.ctx,u,a.signal)}finally{i&&i.ctx.restore(),this._pendingDraws.delete(n)}}_emitScrollEvent(e){let n=new CustomEvent(`scroll-virtual`,{detail:{logicalScrollLeft:this._scrollLeft,logicalScrollTop:this._scrollTop,userGesture:e,containerScrollLeft:this._scrollContainer?.scrollLeft??0,containerScrollTop:this._scrollContainer?.scrollTop??0,viewportStartLogical:this._scrollLeft,viewportEndLogical:this._scrollLeft+this._viewportWidth,viewportStartLogicalY:this._scrollTop,viewportEndLogicalY:this._scrollTop+this._viewportHeight},bubbles:!0,composed:!0});this.dispatchEvent(n)}isRegionVisible(e){let n=this._scrollLeft,r=this._scrollLeft+this._viewportWidth,i=e.x+e.width>n&&e.x<r,a=this._scrollTop,o=this._scrollTop+this._viewportHeight,s=e.y+e.height>a&&e.y<o;return i&&s}_updateScrollPosition(e){this._scrollContainer&&(this._scrollContainer.scrollLeft=this._scrollLeft,this._scrollContainer.scrollTop=this._scrollTop),this._recalculateTiles(`updateScrollPosition`),this._emitScrollEvent(e),this._scrollDebounce()}get logicalScrollLeft(){return this._scrollLeft}set logicalScrollLeft(e){let n=this._scrollLeft,r=_O(e,0,Math.max(0,this.effectiveLogicalWidth-this._viewportWidth));r!==this._scrollLeft&&(this._scrollLeft=r,this.requestUpdate(`logicalScrollLeft`,n),this._updateScrollPosition(!1))}get logicalScrollTop(){return this._scrollTop}set logicalScrollTop(e){let n=this._scrollTop,r=_O(e,0,Math.max(0,this.effectiveLogicalHeight-this._viewportHeight));r!==this._scrollTop&&(this._scrollTop=r,this.requestUpdate(`logicalScrollTop`,n),this._updateScrollPosition(!1))}get containerScrollLeft(){return this._scrollContainer?.scrollLeft??0}get containerScrollTop(){return this._scrollContainer?.scrollTop??0}get viewportWidth(){return this._viewportWidth}get viewportHeight(){return this._viewportHeight}setRenderingOptions(e){this._renderingOptions={...this._renderingOptions,...e},this._recalculateTiles(`setRenderingOptions`)}getRenderingOptions(){return this._renderingOptions}invalidateAll(){this._requestRedrawAll(`invalidateAll`)}invalidateRegion(e,n,r,i){this.#e(`invalidateRegion: ${e},${n},${r},${i}`);let a=this._getTileWidth(),o=this._getTileHeight(),{firstTile:s,lastTile:c}=this._calculateTileRange(),{firstRow:l,lastRow:u}=this._calculateTileRowRange(),d=this._renderingOptions.overlapPercent,f=Math.floor(e/a),p=Math.ceil((e+r)/a),m=Math.floor(n/o),h=Math.ceil((n+i)/o);for(let g=Math.max(s,f);g<=Math.min(c,p);g++)for(let s=Math.max(l,m);s<=Math.min(u,h);s++){let c=PO(g,s);if(this._visibleTiles.has(c)){let s=this._tilePool.get(c);if(s){let l=a*d,u=o*d,f=s.logicalX-l,p=s.logicalX+a+l,m=s.logicalY-u,h=s.logicalY+o+u,g=Math.max(e,f),_=Math.min(e+r,p)-g,v=Math.max(n,m),y=Math.min(n+i,h)-v;if(_>0&&y>0){let e={x:g,y:v,width:_,height:y};this._requestTileDraw(`invalidateRegion`,c,e)}}}}}convertFromViewportToCanvas(e,n){let r=xO(this.effectiveLogicalWidth,this._viewportWidth),i=EO(this.effectiveLogicalHeight,this._viewportHeight);return hO(e,n,this._scrollLeft,r,this._scrollTop,i)}convertFromCanvasToViewport(e,n){let r=xO(this.effectiveLogicalWidth,this._viewportWidth),i=EO(this.effectiveLogicalHeight,this._viewportHeight);return gO(e,n,this._scrollLeft,r,this._scrollTop,i)}positionChildRange(e,n,r,i,a){if(Number.isNaN(n)||Number.isNaN(r)){console.warn(`positionChildRange: Invalid startX or endX values: ${n}, ${r}`);return}let o=Array.from(this.children).filter(n=>n.matches?.(e)),s=i??0,c=a??this.effectiveLogicalHeight;for(let e of o)this._positionedChildren.set(e,{startX:n,endX:r,startY:s,endY:c});this._positionChildren(`positionChildRange`)}manualChildPositioningUpdate(){this._positionChildren(`manualChildPositioningUpdate`)}positionChildClear(e){for(let[n]of this._positionedChildren)n.matches?.(e)&&(this._positionedChildren.delete(n),n.removeAttribute(`style`))}_positionChildren(e){if(this.#e(`_positionChildren: ${e} positionedChildren: ${this._positionedChildren.size}`),this.hasUpdated&&this._childrenContainerEl)for(let[e,n]of this._positionedChildren){let r=n.endX-n.startX,i=n.endY-n.startY;e.setAttribute(`style`,`position: absolute; left: ${n.startX}px; top: ${n.startY}px; width: ${r}px; height: ${i}px;`)}}render(){let e=v({"scroll-container":!0,scrollable:this.hinting});return i`
|
|
12573
12611
|
<div class=${e}>
|
|
12574
12612
|
<div class="spacer"></div>
|
|
12575
12613
|
<div class="tile-pool"></div>
|
|
@@ -12577,7 +12615,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12577
12615
|
<slot></slot>
|
|
12578
12616
|
</div>
|
|
12579
12617
|
</div>
|
|
12580
|
-
`}};
|
|
12618
|
+
`}};NO([d({type:Boolean})],FO.prototype,`hinting`,void 0),NO([d()],FO.prototype,`logicalWidth`,null),NO([d()],FO.prototype,`logicalHeight`,null),NO([d({type:Number})],FO.prototype,`logicalScrollLeft`,null),NO([d({type:Number})],FO.prototype,`logicalScrollTop`,null),FO=NO([l(`x-vcanvas`)],FO);const IO=1e4;let Z=class extends n{constructor(...e){super(...e),this.tracks=[],this.events=[],this.min=0,this.max=1e3,this.trackHeight=`fixed`,this.userScale=`normal`,this.reorderable=!1,this.metaEnabled=!1,this.altMajorBg=!1,this.defaultTrackHeight=48,this.gridMode=`adaptive`,this.minorStep=10,this.onDragging=null,this.formatLabel=String,this._ppu=1,this._viewRange={min:0,max:4e3},this._vViewRange={min:0,max:1},this._vScale=1,this._selectedIds=new Set,this._tickledId=void 0,this._drag={kind:`none`},this._metaHeight=120,this._trackHeightOverrides=new Map,this._trackLayout=[],this._internalEvents=[],this._internalTracks=[],this.#e=null,this.#t={},this.#n=null,this.#r=24,this.#i=void 0,this.#a=null,this.#o=!1,this.#s=!1,this.#C=e=>{this.#s?(this._viewRange=this.#_(this._viewRange.min,this._ppu),this.#m(this._vViewRange.min,this._vViewRange.max)):(this.#s=!0,this.#v(),this.#h(),this.#E()),this.#y(),this.#S()},this.#w=(e,n,r)=>{let i=this._ppu,a={x:n.x/i+this.min,y:n.y,width:n.width/i,height:n.height};this.#t=tO(this);let o=WD(this._viewRange,this.userScale,this.#c(),this.gridMode,this.minorStep,i),s=this._internalTracks.map(e=>({key:e.key,color:e.color}));XD(e,a,this._trackLayout,s,this.#t,i),JD(e,a,o,this.altMajorBg,this.#t,i),ZD(e,a,this._internalEvents,this._trackLayout,this._selectedIds,this._tickledId,this._drag,this.#t,i),QD(e,this._drag,i);let c=this.#e?.logicalScrollTop??0;YD(e,a,o,this.#r,this.formatLabel,this.#t,i,c)},this.#T=e=>{let n=e.detail;if(n.userGesture===!1)return;let r=this._ppu;if(r<=0)return;let i=n.logicalScrollLeft/r+this.min;if(this._viewRange=this.#_(i,r),this._vScale>0){let e=this._vViewRange.max-this._vViewRange.min,r=n.logicalScrollTop/this._vScale;this.#m(r,r+e)}},this.#D=e=>{let n=e.detail,r=n.b-n.a,i=this.#c();r>0&&(this._ppu=Math.max(this.#l(),Math.min(i/r,IO))),this._viewRange=this.#_(n.a,this._ppu),this.#y()},this.#O=e=>{let n=e.detail;this.#m(n.a,n.b)},this.#k=e=>{let n=e.currentTarget;n.setPointerCapture(e.pointerId),e.stopPropagation(),e.preventDefault();let r=n.getBoundingClientRect(),i=r.height>0?(e.clientY-r.top)/r.height:.5,a=this._vViewRange.max-this._vViewRange.min,o=this._vViewRange.min+i*a;this._drag={kind:`v-axis-zoom`,anchorBaseY:o,startScreenX:e.screenX,startScreenY:e.screenY,startVMin:this._vViewRange.min,startVMax:this._vViewRange.max,startVScale:this._vScale}},this.#A=e=>{if(this._drag.kind!==`v-axis-zoom`)return;let n=this._drag,r=e.screenX-n.startScreenX,i=e.screenY-n.startScreenY;if(Math.abs(r)+Math.abs(i)<5)return;let a=oO(r,4),o=oO(i,4),s=cO(n.startVMin,n.startVMax,n.startVScale,n.anchorBaseY,a,o);this.setVerticalZoomPan(s.vMin,s.vMax)},this.#j=e=>{this._drag.kind===`v-axis-zoom`&&(e.currentTarget.releasePointerCapture(e.pointerId),this._drag={kind:`none`})},this.#F=e=>{let{trackKey:n,height:r}=e.detail;this.#L(n,r)},this.#I=e=>{let{trackKey:n,height:r}=e.detail;this.#L(n,r),this.dispatchEvent(new CustomEvent(`track-resize`,{detail:{trackKey:n,height:r},bubbles:!0,composed:!0}))}}static{this.styles=[pO]}#e;#t;#n;#r;#i;#a;#o;#s;get pxPerUnit(){return this._ppu}get axisHeight(){return this.#r}get tabWidth(){return this.#P}#c(){return this.#e?.viewportWidth??this.#e?.clientWidth??800}#l(){let e=this.max-this.min;return e<=0?1:this.#c()/e}#u(){return this.#e?.viewportHeight??this.#e?.clientHeight??300}#d(){let e=0;for(let n of this._internalTracks){if(n.hidden)continue;let r=this._trackHeightOverrides.get(n.key);e+=r??n.height??this.defaultTrackHeight}return e||1}#f(){let e=1/0;for(let n of this._internalTracks){if(n.hidden)continue;let r=this._trackHeightOverrides.get(n.key)??n.height??this.defaultTrackHeight;r<e&&(e=r)}return e===1/0?this.defaultTrackHeight:e}#p(){let e=0;for(let n of this._internalTracks){if(n.hidden)continue;let r=this._trackHeightOverrides.get(n.key)??n.height??this.defaultTrackHeight;r>e&&(e=r)}return e||this.defaultTrackHeight}#m(e,n){let r=this.#d(),i=this.#u()-this.#r,a=e,o=n,s=this.#p(),c=Math.max(s,r*.05),l=this.#f(),u=i>0?i*l/24:r,d=Math.min(r,u),f=o-a;if(f<c){let e=(a+o)/2;a=e-c/2,o=e+c/2,f=c}if(f>d){let e=(a+o)/2;a=e-d/2,o=e+d/2,f=d}o>r&&(o=r,a=Math.max(0,o-f)),a<0&&(a=0,o=Math.min(r,a+f)),this._vViewRange={min:a,max:o},this._vScale=i>0?i/(o-a):1}#h(){let e=this.#d();this.#m(0,e)}get#g(){return this._vViewRange.min*this._vScale}#_(e,n){let r=this.#c(),i=n>0?r/n:this.max-this.min,a=e,o=a+i;return o>this.max&&(o=this.max,a=Math.max(this.min,o-i)),a<this.min&&(a=this.min,o=Math.min(this.max,a+i)),{min:a,max:o}}setPpu(e){this._ppu=Math.max(this.#l(),Math.min(e,IO)),this._viewRange=this.#_(this._viewRange.min,this._ppu)}setViewRange(e){let n=this.#c(),r=e.max-e.min;r>0&&(this._ppu=Math.max(this.#l(),Math.min(n/r,IO))),this._viewRange=this.#_(e.min,this._ppu)}setZoomPan(e,n){this._ppu=Math.max(this.#l(),Math.min(n,IO)),this._viewRange=this.#_(e,this._ppu)}setVerticalZoomPan(e,n){this.#m(e,n)}selectAll(){this._selectedIds=new Set(this._internalEvents.map(e=>e.id)),this.#R(),this.#S()}deselectAll(){this._selectedIds=new Set,this.#R(),this.#S()}getTrackEvents(e){return this._internalEvents.filter(n=>n.trackKey===e)}get selectedIds(){return[...this._selectedIds]}set selectedIds(e){this._selectedIds=new Set(e),this.#R(),this.#S()}selectTrack(e,n=!1){this.dispatchEvent(new CustomEvent(`track-select`,{detail:{trackKey:e,shiftKey:n},bubbles:!0,composed:!0}))}resetTrackHeights(){this._trackHeightOverrides=new Map,this.#o=!0}static{this.defaultDragSnapping=()=>({})}static{this.gridSnapping=e=>{let{gridResolution:n,currentStart:r,currentEnd:i}=e,{minorStep:a}=n;return{start:Math.round(r/a)*a,end:Math.round(i/a)*a}}}processDrag(e,n,r,i,a,o,s,c){let l=i,u=a,d=o;if(this.onDragging){let f=this.onDragging({eventId:e,rawLogicalX:n,rawY:r,currentStart:i,currentEnd:a,currentTrackKey:o,gridResolution:c,originTrackKey:s});l=f.start??i,u=f.end??a,d=f.trackKey??o}return this.dispatchEvent(new CustomEvent(`dragging`,{detail:{eventId:e,start:l,end:u,trackKey:d,rawLogicalX:n,rawY:r,originTrackKey:s},bubbles:!0,composed:!0})),{start:l,end:u,trackKey:d}}getVCanvas(){return this.#e}get tickledEvent(){return this._tickledId===void 0?null:this._internalEvents.find(e=>e.id===this._tickledId)??null}firstUpdated(){this.#e=this.shadowRoot?.querySelector(`x-vcanvas`),this.#e&&(this.#e.drawCallback=this.#w,this.#e.addEventListener(`scroll-virtual`,this.#T),this.#n=lO(this,this.#e),this.#a=new ResizeObserver(this.#C),this.#a.observe(this.#e))}disconnectedCallback(){super.disconnectedCallback(),this.#n?.(),this.#n=null,this.#a?.disconnect(),this.#a=null}willUpdate(e){let n=!1,r=!1,i=!1;e.has(`tracks`)&&(this._internalTracks=[...this.tracks],n=!0,r=!0),e.has(`events`)&&(this._internalEvents=[...this.events]),e.has(`trackHeight`)&&(this.trackHeight!==`free`&&this._trackHeightOverrides.size>0&&(this._trackHeightOverrides=new Map),n=!0,r=!0),(e.has(`_vScale`)||e.has(`defaultTrackHeight`)||e.has(`_trackHeightOverrides`))&&(n=!0),(e.has(`min`)||e.has(`max`))&&(i=!0),this.#o&&(this.#o=!1,r=!0),i&&this.#v(),r&&this.#h(),n&&this.#E()}updated(e){(e.has(`_ppu`)||e.has(`_viewRange`)||e.has(`min`)||e.has(`max`))&&(this.#y(),this.#S()),(e.has(`events`)||e.has(`userScale`)||e.has(`altMajorBg`)||e.has(`gridMode`)||e.has(`minorStep`))&&this.#S(),e.has(`_trackLayout`)&&(this.#b(),this.#N(),this.#S()),(e.has(`_vViewRange`)||e.has(`_vScale`))&&(this.#M(),this.#S()),this._tickledId!==this.#i&&(this.#i=this._tickledId,this.dispatchEvent(new CustomEvent(`tickle-change`,{detail:{event:this.tickledEvent},bubbles:!0,composed:!0})))}render(){let e=this.#d();return i`
|
|
12581
12619
|
<div class="content-wrapper">
|
|
12582
12620
|
<div class="content-area">
|
|
12583
12621
|
<div class="v-axis-zone"
|
|
@@ -12630,7 +12668,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12630
12668
|
|
|
12631
12669
|
<div class="meta-resizer ${this.metaEnabled?`visible`:``}"></div>
|
|
12632
12670
|
<div class="meta-area ${this.metaEnabled?`visible`:``}" style="height:${this._metaHeight}px"></div>
|
|
12633
|
-
`}#v(){let e=this.#c(),n=this.max-this.min,r=.8;this._ppu=n>0?e/(n*r):1,this._viewRange={min:this.min,max:this.min+n*r},this.#y()}#y(){if(!this.#e)return;let e=this.max-this.min;this.#e.logicalWidth=e*this._ppu,this.#b(),this.#x()}#b(){if(!this.#e)return;let e=this._trackLayout.reduce((e,n)=>e+n.height,0),n=Math.max(e,40)+this.#r;this.#e.logicalHeight=n,this.#e.logicalScrollTop=this.#g}#x(){this.#e&&(this.#e.logicalScrollLeft=(this._viewRange.min-this.min)*this._ppu)}#S(){this.#e?.invalidateAll()}#C;#w;#T;#E(){let e=[],n=this.#r;for(let r of this._internalTracks){if(r.hidden)continue;let i=this._trackHeightOverrides.get(r.key)??r.height??this.defaultTrackHeight,a=Math.round(i*this._vScale);e.push({trackKey:r.key,y:n,height:a}),n+=a}this._trackLayout=e}#D;#O;#k;#A;#j;#M(){this.#b(),this.#N()}#N(){let e=this.shadowRoot?.querySelector(`.tab-column`);if(!e)return;let n=this.#e?.logicalScrollTop??0;e.style.transform=`translateY(${-n}px)`;for(let n of this._trackLayout){let r=e.querySelector(`ixfx-timeline-track-tab[track-key="${n.trackKey}"]`);r&&(r.style.top=`${n.y}px`,r.style.height=`${n.height}px`)}}get#P(){let e=getComputedStyle(this).getPropertyValue(`--timeline-tab-width`).trim();return Number.parseInt(e,10)||120}#F;#I;#L(e,n){if(this.trackHeight===`fixed`)this.defaultTrackHeight=n;else if(this.trackHeight===`free`){let r=new Map(this._trackHeightOverrides);r.set(e,n),this._trackHeightOverrides=r}}#R(){this.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...this._selectedIds]},bubbles:!0,composed:!0}))}};E([d({type:Array})],Z.prototype,`tracks`,void 0),E([d({type:Array})],Z.prototype,`events`,void 0),E([d({type:Number})],Z.prototype,`min`,void 0),E([d({type:Number})],Z.prototype,`max`,void 0),E([d({type:String,attribute:`track-height`})],Z.prototype,`trackHeight`,void 0),E([d({type:String,attribute:`user-scale`})],Z.prototype,`userScale`,void 0),E([d({type:Boolean})],Z.prototype,`reorderable`,void 0),E([d({type:Boolean,attribute:`meta`})],Z.prototype,`metaEnabled`,void 0),E([d({type:Boolean,attribute:`alt-major-bg`})],Z.prototype,`altMajorBg`,void 0),E([d({type:Number,attribute:`default-track-height`})],Z.prototype,`defaultTrackHeight`,void 0),E([d({type:String,attribute:`grid-mode`})],Z.prototype,`gridMode`,void 0),E([d({type:Number,attribute:`minor-step`})],Z.prototype,`minorStep`,void 0),E([d({type:Object})],Z.prototype,`onDragging`,void 0),E([m()],Z.prototype,`_ppu`,void 0),E([m()],Z.prototype,`_viewRange`,void 0),E([m()],Z.prototype,`_vViewRange`,void 0),E([m()],Z.prototype,`_vScale`,void 0),E([m()],Z.prototype,`_selectedIds`,void 0),E([m()],Z.prototype,`_tickledId`,void 0),E([m()],Z.prototype,`_drag`,void 0),E([m()],Z.prototype,`_metaHeight`,void 0),E([m()],Z.prototype,`_trackHeightOverrides`,void 0),E([m()],Z.prototype,`_trackLayout`,void 0),E([m()],Z.prototype,`_internalEvents`,void 0),E([m()],Z.prototype,`_internalTracks`,void 0),Z=E([T(`ixfx-timeline`)],Z);let
|
|
12671
|
+
`}#v(){let e=this.#c(),n=this.max-this.min,r=.8;this._ppu=n>0?e/(n*r):1,this._viewRange={min:this.min,max:this.min+n*r},this.#y()}#y(){if(!this.#e)return;let e=this.max-this.min;this.#e.logicalWidth=e*this._ppu,this.#b(),this.#x()}#b(){if(!this.#e)return;let e=this._trackLayout.reduce((e,n)=>e+n.height,0),n=Math.max(e,40)+this.#r;this.#e.logicalHeight=n,this.#e.logicalScrollTop=this.#g}#x(){this.#e&&(this.#e.logicalScrollLeft=(this._viewRange.min-this.min)*this._ppu)}#S(){this.#e?.invalidateAll()}#C;#w;#T;#E(){let e=[],n=this.#r;for(let r of this._internalTracks){if(r.hidden)continue;let i=this._trackHeightOverrides.get(r.key)??r.height??this.defaultTrackHeight,a=Math.round(i*this._vScale);e.push({trackKey:r.key,y:n,height:a}),n+=a}this._trackLayout=e}#D;#O;#k;#A;#j;#M(){this.#b(),this.#N()}#N(){let e=this.shadowRoot?.querySelector(`.tab-column`);if(!e)return;let n=this.#e?.logicalScrollTop??0;e.style.transform=`translateY(${-n}px)`;for(let n of this._trackLayout){let r=e.querySelector(`ixfx-timeline-track-tab[track-key="${n.trackKey}"]`);r&&(r.style.top=`${n.y}px`,r.style.height=`${n.height}px`)}}get#P(){let e=getComputedStyle(this).getPropertyValue(`--timeline-tab-width`).trim();return Number.parseInt(e,10)||120}#F;#I;#L(e,n){if(this.trackHeight===`fixed`)this.defaultTrackHeight=n;else if(this.trackHeight===`free`){let r=new Map(this._trackHeightOverrides);r.set(e,n),this._trackHeightOverrides=r}}#R(){this.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...this._selectedIds]},bubbles:!0,composed:!0}))}};E([d({type:Array})],Z.prototype,`tracks`,void 0),E([d({type:Array})],Z.prototype,`events`,void 0),E([d({type:Number})],Z.prototype,`min`,void 0),E([d({type:Number})],Z.prototype,`max`,void 0),E([d({type:String,attribute:`track-height`})],Z.prototype,`trackHeight`,void 0),E([d({type:String,attribute:`user-scale`})],Z.prototype,`userScale`,void 0),E([d({type:Boolean})],Z.prototype,`reorderable`,void 0),E([d({type:Boolean,attribute:`meta`})],Z.prototype,`metaEnabled`,void 0),E([d({type:Boolean,attribute:`alt-major-bg`})],Z.prototype,`altMajorBg`,void 0),E([d({type:Number,attribute:`default-track-height`})],Z.prototype,`defaultTrackHeight`,void 0),E([d({type:String,attribute:`grid-mode`})],Z.prototype,`gridMode`,void 0),E([d({type:Number,attribute:`minor-step`})],Z.prototype,`minorStep`,void 0),E([d({type:Object})],Z.prototype,`onDragging`,void 0),E([m()],Z.prototype,`_ppu`,void 0),E([m()],Z.prototype,`_viewRange`,void 0),E([m()],Z.prototype,`_vViewRange`,void 0),E([m()],Z.prototype,`_vScale`,void 0),E([m()],Z.prototype,`_selectedIds`,void 0),E([m()],Z.prototype,`_tickledId`,void 0),E([m()],Z.prototype,`_drag`,void 0),E([m()],Z.prototype,`_metaHeight`,void 0),E([m()],Z.prototype,`_trackHeightOverrides`,void 0),E([m()],Z.prototype,`_trackLayout`,void 0),E([m()],Z.prototype,`_internalEvents`,void 0),E([m()],Z.prototype,`_internalTracks`,void 0),Z=E([T(`ixfx-timeline`)],Z);let LO=class extends n{constructor(...e){super(...e),this.label=``,this.grow=!1,this.reorderable=!1}static{this.styles=[w,Xt,r`
|
|
12634
12672
|
:host {
|
|
12635
12673
|
display: flex;
|
|
12636
12674
|
flex-direction: column;
|
|
@@ -12706,7 +12744,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12706
12744
|
<slot></slot>
|
|
12707
12745
|
</div>
|
|
12708
12746
|
</div>
|
|
12709
|
-
`}};E([d({type:String})],
|
|
12747
|
+
`}};E([d({type:String})],LO.prototype,`label`,void 0),E([d({type:Boolean,reflect:!0})],LO.prototype,`grow`,void 0),E([d({type:Boolean,reflect:!0})],LO.prototype,`reorderable`,void 0),LO=E([T(`ixfx-toolbar-group`)],LO);var RO;function zO(e,n){let r=0,i=1/0;for(let a=0;a<e.length;a++){let[o,s]=e[a];if(n<(o+s)/2){let e=Math.abs(n-o);e<i&&(i=e,r=a)}else{let e=Math.abs(n-s);e<i&&(i=e,r=a+1)}}return r}let BO=!1;function VO(){if(BO)return;BO=!0;let e=document.createElement(`style`);e.textContent=`
|
|
12710
12748
|
.ixfx-drag-ghost.ixfx-toolbar-group-ghost {
|
|
12711
12749
|
padding: var(--space-s, 8px) var(--space-m, 16px);
|
|
12712
12750
|
background: var(--surface-4);
|
|
@@ -12719,7 +12757,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12719
12757
|
user-select: none;
|
|
12720
12758
|
-webkit-user-select: none;
|
|
12721
12759
|
}
|
|
12722
|
-
`,document.head.appendChild(e)}let
|
|
12760
|
+
`,document.head.appendChild(e)}let HO=class extends n{static{RO=this}constructor(...e){super(...e),this.orientation=`horizontal`,this.layout=`one-line`,this.verticalWriting=`auto`,this.toolbarAlign=`near`,this.showGroupLabels=!1,this.invisibleGroups=!1,this.allowReorder=!1,this._overflowCount=0,this._popoverOpen=!1,this._ro=null,this._anchor=`--toolbar-${RO._cnt++}`,this._sizes=new WeakMap,this._measureQueued=!1,this._dragState=null,this._suppressNextClick=!1,this._onClickCapture=e=>{this._suppressNextClick&&(this._suppressNextClick=!1,e.preventDefault(),e.stopPropagation())},this._onKeyDown=e=>{let n=this._dragState;if(e.key!==`Escape`||!n?.active)return;e.preventDefault();let r=n.pointerId;this._abortDrag(),this._endDrag(r)},this._onPointerDown=e=>{if(!this.allowReorder||e.button!==0)return;let n=this._findDragTarget(e);n?.parentNode&&(Array.prototype.indexOf.call(n.parentNode.children,n)<0||(this._dragState={pointerId:e.pointerId,source:n,startX:e.clientX,startY:e.clientY,active:!1,ghost:null,gapIndex:void 0},window.addEventListener(`pointermove`,this._onPointerMove),window.addEventListener(`pointerup`,this._onPointerUp),window.addEventListener(`pointercancel`,this._onPointerCancel)))},this._onPointerMove=e=>{let n=this._dragState;if(!n||e.pointerId!==n.pointerId)return;let r=Math.hypot(e.clientX-n.startX,e.clientY-n.startY);if(!n.active){if(r<5)return;this._beginDrag(e)}n.ghost?.move(e.clientX,e.clientY);let i=this._computeGapIndex(e.clientX,e.clientY);i!==n.gapIndex&&(n.gapIndex=i,this.requestUpdate())},this._onPointerUp=e=>{let n=this._dragState;if(!(!n||e.pointerId!==n.pointerId)){if(n.active){let r=this._computeGapIndex(e.clientX,e.clientY);this._commitDrag(n.source,r)}this._endDrag(e.pointerId)}},this._onPointerCancel=e=>{let n=this._dragState;!n||e.pointerId!==n.pointerId||(this._abortDrag(),this._endDrag(e.pointerId))}}static{this._cnt=0}static{this.styles=[w,de,r`
|
|
12723
12761
|
:host {
|
|
12724
12762
|
--toolbar-gap: var(--space-s);
|
|
12725
12763
|
--toolbar-group-gap: var(--space-m);
|
|
@@ -12817,7 +12855,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12817
12855
|
pointer-events: none;
|
|
12818
12856
|
z-index: 1;
|
|
12819
12857
|
}
|
|
12820
|
-
`]}connectedCallback(){super.connectedCallback(),this.style.setProperty(`--anchor-name`,this._anchor),this.addEventListener(`click`,this._onClickCapture,!0)}firstUpdated(){this._slot.addEventListener(`slotchange`,()=>{this._updateGroups(),this._scheduleMeasure()}),this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(this._inner),this._popover.addEventListener(`toggle`,()=>{this._popoverOpen=this._popover.matches(`:popover-open`)}),this._scheduleMeasure(),this._updateGroups()}updated(e){(e.has(`showGroupLabels`)||e.has(`allowReorder`))&&this._updateGroups()}_mainGroups(){return Array.from(this.children).filter(e=>e.tagName===`IXFX-TOOLBAR-GROUP`&&e.getAttribute(`slot`)!==`overflow`)}_groupKey(e){return e.id||e.label||``}getGroupOrder(){return this._mainGroups().map(e=>this._groupKey(e))}setGroupOrder(e){let n=this._mainGroups();if(n.length===0)return;let r=new Set,i=[];for(let a of e){let e=n.find(e=>!r.has(e)&&e.id===a&&a!==``)??n.find(e=>!r.has(e)&&this._groupKey(e)===a);e&&(r.add(e),i.push(e))}let a=[...i,...n.filter(e=>!r.has(e))],o=a.length*a.length+1,s=!0;for(;s&&o-->0;){s=!1;for(let e=0;e+1<a.length;e++){let n=a[e],r=a[e+1];n.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING||this._insertAndEmit(n,r)&&(s=!0)}}}getLayoutSnapshot(){return{version:1,order:this.getGroupOrder()}}applyLayoutSnapshot(e){if(typeof e!=`object`||!e)return!1;let{version:n,order:r}=e;return n!==1||!Array.isArray(r)||!r.every(e=>typeof e==`string`)?!1:(this.setGroupOrder(r),!0)}_insertAndEmit(e,n){let r=e.parentNode;if(!r)return!1;let i=Array.prototype.indexOf.call(r.children,e);r.insertBefore(e,n);let a=Array.prototype.indexOf.call(r.children,e);return a!==i&&(this.dispatchEvent(new CustomEvent(`reorder`,{bubbles:!0,composed:!0,detail:{fromIndex:i,toIndex:a,group:e}})),this._updateGroups(),this._scheduleMeasure(),!0)}_updateGroups(){for(let e of Array.from(this.children))e.tagName===`IXFX-TOOLBAR-GROUP`&&(this.showGroupLabels?e.setAttribute(`show-label`,``):e.removeAttribute(`show-label`),this.allowReorder&&e.getAttribute(`slot`)!==`overflow`?e.setAttribute(`reorderable`,``):e.removeAttribute(`reorderable`))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this._onClickCapture,!0),this._ro?.disconnect(),this._dragState&&(this._abortDrag(),this._endDrag(this._dragState.pointerId))}_findDragTarget(e){if(!this.allowReorder)return null;let n=e.composedPath(),r=null,i=!1;for(let e of n)e instanceof HTMLElement&&(e.classList.contains(`grab-handle`)&&(i=!0),!r&&e.tagName===`IXFX-TOOLBAR-GROUP`&&(r=e));return!r||!i||r.getAttribute(`slot`)===`overflow`?null:r}_beginDrag(e){let n=this._dragState;if(!(!n||n.active)){try{this.setPointerCapture(e.pointerId)}catch{}n.active=!0,this.setAttribute(`dragging`,``),n.source.setAttribute(`drag-source`,``),n.ghost=this._createGhost(n.source),n.ghost?.move(e.clientX,e.clientY)}}_abortDrag(){let e=this._dragState;e&&(e.source.removeAttribute(`drag-source`),e.gapIndex!==void 0&&(e.gapIndex=void 0,this.requestUpdate()))}_endDrag(e){let n=this._dragState;if(n){n.ghost?.destroy(),n.ghost=null,this.removeAttribute(`dragging`),this._dragState=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel);try{this.releasePointerCapture(e)}catch{}this.requestUpdate()}}_commitDrag(e,n){e.removeAttribute(`drag-source`);let r=this._mainGroups().filter(n=>n!==e),i=r.length,a=n===void 0?i:Math.max(0,Math.min(n,i)),o=this.orientation===`vertical-left`?i-a:a;if(!e.parentNode)return;let s=r[o]??null;this._insertAndEmit(e,s)&&(this._suppressNextClick=!0)}_createGhost(e){let n=document.createElement(`span`);n.textContent=(`label`in e&&typeof e.label==`string`&&e.label||(e.textContent??``).trim()).slice(0,60),n.style.overflow=`hidden`,n.style.textOverflow=`ellipsis`,n.style.whiteSpace=`nowrap`;try{return
|
|
12858
|
+
`]}connectedCallback(){super.connectedCallback(),this.style.setProperty(`--anchor-name`,this._anchor),this.addEventListener(`click`,this._onClickCapture,!0)}firstUpdated(){this._slot.addEventListener(`slotchange`,()=>{this._updateGroups(),this._scheduleMeasure()}),this._ro=new ResizeObserver(()=>this._scheduleMeasure()),this._ro.observe(this._inner),this._popover.addEventListener(`toggle`,()=>{this._popoverOpen=this._popover.matches(`:popover-open`)}),this._scheduleMeasure(),this._updateGroups()}updated(e){(e.has(`showGroupLabels`)||e.has(`allowReorder`))&&this._updateGroups()}_mainGroups(){return Array.from(this.children).filter(e=>e.tagName===`IXFX-TOOLBAR-GROUP`&&e.getAttribute(`slot`)!==`overflow`)}_groupKey(e){return e.id||e.label||``}getGroupOrder(){return this._mainGroups().map(e=>this._groupKey(e))}setGroupOrder(e){let n=this._mainGroups();if(n.length===0)return;let r=new Set,i=[];for(let a of e){let e=n.find(e=>!r.has(e)&&e.id===a&&a!==``)??n.find(e=>!r.has(e)&&this._groupKey(e)===a);e&&(r.add(e),i.push(e))}let a=[...i,...n.filter(e=>!r.has(e))],o=a.length*a.length+1,s=!0;for(;s&&o-->0;){s=!1;for(let e=0;e+1<a.length;e++){let n=a[e],r=a[e+1];n.compareDocumentPosition(r)&Node.DOCUMENT_POSITION_FOLLOWING||this._insertAndEmit(n,r)&&(s=!0)}}}getLayoutSnapshot(){return{version:1,order:this.getGroupOrder()}}applyLayoutSnapshot(e){if(typeof e!=`object`||!e)return!1;let{version:n,order:r}=e;return n!==1||!Array.isArray(r)||!r.every(e=>typeof e==`string`)?!1:(this.setGroupOrder(r),!0)}_insertAndEmit(e,n){let r=e.parentNode;if(!r)return!1;let i=Array.prototype.indexOf.call(r.children,e);r.insertBefore(e,n);let a=Array.prototype.indexOf.call(r.children,e);return a!==i&&(this.dispatchEvent(new CustomEvent(`reorder`,{bubbles:!0,composed:!0,detail:{fromIndex:i,toIndex:a,group:e}})),this._updateGroups(),this._scheduleMeasure(),!0)}_updateGroups(){for(let e of Array.from(this.children))e.tagName===`IXFX-TOOLBAR-GROUP`&&(this.showGroupLabels?e.setAttribute(`show-label`,``):e.removeAttribute(`show-label`),this.allowReorder&&e.getAttribute(`slot`)!==`overflow`?e.setAttribute(`reorderable`,``):e.removeAttribute(`reorderable`))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(`click`,this._onClickCapture,!0),this._ro?.disconnect(),this._dragState&&(this._abortDrag(),this._endDrag(this._dragState.pointerId))}_findDragTarget(e){if(!this.allowReorder)return null;let n=e.composedPath(),r=null,i=!1;for(let e of n)e instanceof HTMLElement&&(e.classList.contains(`grab-handle`)&&(i=!0),!r&&e.tagName===`IXFX-TOOLBAR-GROUP`&&(r=e));return!r||!i||r.getAttribute(`slot`)===`overflow`?null:r}_beginDrag(e){let n=this._dragState;if(!(!n||n.active)){try{this.setPointerCapture(e.pointerId)}catch{}n.active=!0,this.setAttribute(`dragging`,``),n.source.setAttribute(`drag-source`,``),n.ghost=this._createGhost(n.source),n.ghost?.move(e.clientX,e.clientY)}}_abortDrag(){let e=this._dragState;e&&(e.source.removeAttribute(`drag-source`),e.gapIndex!==void 0&&(e.gapIndex=void 0,this.requestUpdate()))}_endDrag(e){let n=this._dragState;if(n){n.ghost?.destroy(),n.ghost=null,this.removeAttribute(`dragging`),this._dragState=null,window.removeEventListener(`pointermove`,this._onPointerMove),window.removeEventListener(`pointerup`,this._onPointerUp),window.removeEventListener(`pointercancel`,this._onPointerCancel);try{this.releasePointerCapture(e)}catch{}this.requestUpdate()}}_commitDrag(e,n){e.removeAttribute(`drag-source`);let r=this._mainGroups().filter(n=>n!==e),i=r.length,a=n===void 0?i:Math.max(0,Math.min(n,i)),o=this.orientation===`vertical-left`?i-a:a;if(!e.parentNode)return;let s=r[o]??null;this._insertAndEmit(e,s)&&(this._suppressNextClick=!0)}_createGhost(e){let n=document.createElement(`span`);n.textContent=(`label`in e&&typeof e.label==`string`&&e.label||(e.textContent??``).trim()).slice(0,60),n.style.overflow=`hidden`,n.style.textOverflow=`ellipsis`,n.style.whiteSpace=`nowrap`;try{return VO(),Gg({anchor:e,content:n,className:`ixfx-toolbar-group-ghost`})}catch{return null}}_computeGapIndex(e,n){let r=this._dragState;if(!r)return;let i=this._mainGroups().filter(e=>e!==r.source);if(i.length===0)return 0;let a=this.orientation===`vertical-left`?[...i].reverse():i,o=this.orientation===`horizontal`,s=o?e:n;return zO(a.map(e=>{let n=e.getBoundingClientRect();return[o?n.left:n.top,o?n.right:n.bottom]}),s)}_computeCaretStyle(){let e=this._dragState;if(!e?.active||e.gapIndex===void 0)return;let n=this._mainGroups().filter(n=>n!==e.source);if(n.length===0)return;let r=this.getBoundingClientRect();if(!r)return;let i=this.orientation===`vertical-left`?[...n].reverse():n,a=Math.max(0,Math.min(e.gapIndex,i.length)),o=a<i.length?i[a].getBoundingClientRect():i[i.length-1].getBoundingClientRect();return this.orientation===`horizontal`?`transform: translate(${(a<i.length?o.left:o.right)-r.left-1}px, 0); width: 2px; height: ${r.height}px;`:`transform: translate(0, ${(a<i.length?o.top:o.bottom)-r.top-1}px); width: ${r.width}px; height: 2px;`}_scheduleMeasure(){this._measureQueued||(this._measureQueued=!0,requestAnimationFrame(()=>{this._measureQueued=!1,this._measure()}))}_measure(){let e=Array.from(this.children),n=e=>e.hasAttribute(`grow`)||e.matches(`[grow]`),r=e.filter(e=>!n(e)),i=this.orientation===`horizontal`,a=getComputedStyle(this).getPropertyValue(`--toolbar-overflow`).trim();if(this.layout!==`one-line`||a===`disabled`){let n=!1;for(let r of e)r.getAttribute(`slot`)===`overflow`&&(r.removeAttribute(`slot`),n=!0),r.hasAttribute(`hidden`)&&(r.removeAttribute(`hidden`),n=!0);this._overflowCount!==0&&(this._overflowCount=0,n=!0),n&&this.requestUpdate();return}if(!this._inner)return;let o=getComputedStyle(this._inner),s=(i?Number.parseFloat(o.columnGap):Number.parseFloat(o.rowGap))||0,c=i?this._inner.clientWidth:this._inner.clientHeight,l=r.filter(e=>e.getAttribute(`slot`)!==`overflow`),u=r.filter(e=>e.getAttribute(`slot`)===`overflow`),d=0;l.forEach((e,n)=>{let r=i?e.offsetWidth:e.offsetHeight;r>0&&this._sizes.set(e,r),d+=(n?s:0)+(this._sizes.get(e)??r)});let f=!1;if(a===`collapsed`){if(l.length>0){for(let e of l)e.setAttribute(`slot`,`overflow`);u.push(...l),l.length=0,f=!0}let e=u.length;e!==this._overflowCount&&(this._overflowCount=e,f=!0),f&&this.requestUpdate();return}let p=u.length>0?s+36:0;for(;l.length>0&&d+p>c;){let e=l[l.length-1],n=this._sizes.get(e)??0;e.setAttribute(`slot`,`overflow`),l.pop(),u.unshift(e),d-=(l.length?s:0)+n,f=!0}for(;u.length>0;){let e=u[0],n=this._sizes.get(e);if(n===void 0)break;let r=l.length?s:0,i=u.length>1?s+36:0;if(d+r+n+i>c)break;e.removeAttribute(`slot`),u.shift(),l.push(e),d+=r+n,f=!0}let m=u.length;m!==this._overflowCount&&(this._overflowCount=m,f=!0),f&&this.requestUpdate()}_toggleOverflow(){try{this._popover.togglePopover()}catch{this._popover.showPopover()}}render(){let e=getComputedStyle(this).getPropertyValue(`--toolbar-overflow`).trim(),n=this._overflowCount>0||e===`collapsed`,r=this._computeCaretStyle();return i`
|
|
12821
12859
|
<div class="inner" role="toolbar" aria-orientation=${this.orientation}>
|
|
12822
12860
|
<slot @pointerdown=${this._onPointerDown} @keydown=${this._onKeyDown}></slot>
|
|
12823
12861
|
<ixfx-button class="overflow-btn" ?hidden=${!n} @click=${this._toggleOverflow} aria-label="More" aria-haspopup="true" aria-expanded=${this._popoverOpen}>⋯</ixfx-button>
|
|
@@ -12826,7 +12864,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12826
12864
|
<slot name="overflow"></slot>
|
|
12827
12865
|
</div>
|
|
12828
12866
|
${r?i`<div class="drop-caret" style=${r}></div>`:a}
|
|
12829
|
-
`}};E([d({type:String,reflect:!0})],
|
|
12867
|
+
`}};E([d({type:String,reflect:!0})],HO.prototype,`orientation`,void 0),E([d({type:String,reflect:!0})],HO.prototype,`layout`,void 0),E([d({type:String,attribute:`vertical-writing`,reflect:!0})],HO.prototype,`verticalWriting`,void 0),E([d({type:String,attribute:`toolbar-align`,reflect:!0})],HO.prototype,`toolbarAlign`,void 0),E([d({type:Boolean,attribute:`show-group-labels`,reflect:!0})],HO.prototype,`showGroupLabels`,void 0),E([d({type:Boolean,attribute:`invisible-groups`,reflect:!0})],HO.prototype,`invisibleGroups`,void 0),E([d({type:Boolean,attribute:`allow-reorder`,reflect:!0})],HO.prototype,`allowReorder`,void 0),E([m()],HO.prototype,`_overflowCount`,void 0),E([m()],HO.prototype,`_popoverOpen`,void 0),E([f(`.inner`)],HO.prototype,`_inner`,void 0),E([f(`.overflow-popover`)],HO.prototype,`_popover`,void 0),E([f(`slot`)],HO.prototype,`_slot`,void 0),HO=RO=E([T(`ixfx-toolbar`)],HO);let UO=class extends n{constructor(...e){super(...e),this.text=``,this.effect=`fade`,this.duration=300,this.easing=`ease`,this._currentText=``,this._outgoingText=``,this._transitionId=0,this._queue=[],this.#e=()=>{this._onTransitionEnd()},this.#t=()=>{this._onTransitionEnd()}}setText(e,n){this._pendingEffect=n,this.text=e}updated(e){if(e.has(`text`)&&this.text!==this._currentText){let e=this._pendingEffect??this.effect;this._pendingEffect=void 0,this._activeEffect===void 0?this._startTransition(this.text,e):this._queue.push({text:this.text,effect:e})}}_startTransition(e,n){let r=this._currentText;this._currentText=e,this._outgoingText=r,r!==``&&(this._transitionId++,this._activeEffect=n)}_onTransitionEnd(){if(this._outgoingText=``,this._activeEffect=void 0,this._queue.length>0){let e=this._queue.shift();this._startTransition(e.text,e.effect)}}#e;#t;#n(){let e=Math.round(this.duration*.3),n=Math.round(this.duration*.1),r=this._currentText.split(``),o=this._outgoingText.split(``),s=o.length-1,c=r=>`animation-duration:${e}ms;animation-delay:${r*n}ms;animation-timing-function:${this.easing}`;return i`
|
|
12830
12868
|
${ee(`cc${this._transitionId}`,i`
|
|
12831
12869
|
<span class="layer current char-swap">
|
|
12832
12870
|
${r.map((e,n)=>i`<span class="char in" style=${c(n)}>${e}</span>`)}
|
|
@@ -12986,7 +13024,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
12986
13024
|
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
12987
13025
|
to { opacity: 0; transform: translateY(0.3em) scale(0.8); }
|
|
12988
13026
|
}
|
|
12989
|
-
`}};E([d({type:String})],RO.prototype,`text`,void 0),E([d({type:String})],RO.prototype,`effect`,void 0),E([d({type:Number})],RO.prototype,`duration`,void 0),E([d({type:String})],RO.prototype,`easing`,void 0),E([m()],RO.prototype,`_currentText`,void 0),E([m()],RO.prototype,`_outgoingText`,void 0),E([m()],RO.prototype,`_activeEffect`,void 0),E([m()],RO.prototype,`_transitionId`,void 0),RO=E([T(`ixfx-transitory-label`)],RO);var zO=class{#e;#t;#n;#r=new WeakMap;#i=new Map;#a=new Map;#o=new WeakMap;#s;constructor(e,n,r){this.#e=e,this.#t=n,this.#n=r}connect(){this.disconnect(),this.#s=new AbortController;let{signal:e}=this.#s;this.#o=new WeakMap,this.#i.clear(),this.#a.clear();let n={item:this.#c(this.#e)};this.#r.set(n,this.#e),n.children=this.#l(this.#e),this.#t.root=n,this.#t.addEventListener(`expand`,e=>{let{node:n}=e.detail,r=this.#r.get(n);r&&(n.children=this.#l(r),this.#t.invalidateStructure())},{signal:e}),this.#t.addEventListener(`collapse`,e=>{},{signal:e})}disconnect(){this.#s?.abort(),this.#s=void 0}sync(){let e=this.#t.root;e&&(this.#o=new WeakMap,this.#i.clear(),this.#a.clear(),this.#r.set(e,this.#e),e.item=this.#c(this.#e),e.children=this.#f(this.#e,e.children??[]),this.#t.invalidateStructure())}lookupByKey(e){return this.#a.get(e)}navigateToKeyPath(e,n){if(e.length===0)return!1;let r=this.#t.root?.children??[];for(let n=0;n<e.length-1;n++){let i=r.find(r=>r.item.key===e[n]);if(!i)return!1;if(i.children===void 0){let e=this.#r.get(i);e&&(i.children=this.#l(e),this.#t.invalidateStructure())}r=i.children??[]}return this.#t.navigateTo(e,n)}navigateToIdentity(e,n){let r=this.#i.get(e);if(!r)return!1;let i=[],a=this.#e.getIdentity();for(;r&&r.getIdentity()!==a;)i.unshift(this.#c(r).key),r=r.getParent();return r!==void 0&&this.navigateToKeyPath(i,n)}navigateToValue(e,n){let r=this.#p(this.#e,e);return r?this.navigateToKeyPath(r.slice(1).map(e=>this.#c(e).key),n):!1}#c(e,n){let r=e.getIdentity(),i=this.#o.get(r);return i||(i=this.#n.valueToItem(e.getValue(),e),this.#o.set(r,i)),n===void 0?i:{...i,isLeaf:i.isLeaf??n}}#l(e){return Array.from(e.children(),e=>this.#d(e))}#u(e,n){this.#r.set(e,n),this.#i.set(n.getIdentity(),n),this.#a.set(e.item.key,n)}#d(e){let n=[...e.children()];for(let e of n)this.#i.set(e.getIdentity(),e);let r={item:this.#c(e,n.length===0)};return this.#u(r,e),r}#f(e,n){let r=new Map(n.map(e=>[e.item.key,e]));return Array.from(e.children(),e=>{let n=this.#d(e),i=r.get(n.item.key);return i?(i.item=n.item,this.#u(i,e),i.children!==void 0&&(i.children=this.#f(e,i.children)),i):n})}#p(e,n,r=[]){let i=[...r,e];if(n(e.getValue()))return i;for(let r of e.children()){let e=this.#p(r,n,i);if(e)return e}}};function BO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function VO(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=VO(r,n);if(e)return e}}}function HO(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=HO(r,n);if(i)return[e,...i]}}}function UO(e,n,r){if(e.length===0||n<=0||r<=0)return 1/0;let i=0;for(let a of e){if(a<=0)return 1/0;let e=r*r*a/(n*n);i=Math.max(i,e,1/e)}return i}function WO(e,n){let r=Array.from({length:e.length}),i=n.x,a=n.y,o=n.width,s=n.height,c=0;for(;c<e.length;){let n=Math.min(o,s),l=c+1,u=e.slice(c,l).map(e=>e.area),d=u.reduce((e,n)=>e+n,0),f=UO(u,d,n);for(;l<e.length;){let r=e.slice(c,l+1).map(e=>e.area),i=r.reduce((e,n)=>e+n,0),a=UO(r,i,n);if(a<=f)l++,u=r,d=i,f=a;else break}if(o<=s){let e=d/o,n=i;for(let i=c;i<l;i++){let o=u[i-c]/e;r[i]={x:n,y:a,width:o,height:e},n+=o}a+=e,s-=e}else{let e=d/s,n=a;for(let a=c;a<l;a++){let o=u[a-c]/e;r[a]={x:i,y:n,width:e,height:o},n+=o}i+=e,o-=e}c=l}return r}function GO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.min(e,1):0}function KO(e,n,r,i){if(e.width<=0||e.height<=0)return n.map(()=>({x:e.x,y:e.y,width:0,height:0}));let a=n.reduce((e,n)=>e+n,0),o=a>0?n.map(e=>e/a):n.map(()=>1/n.length),s=r===`dice`||r===`slice-dice`&&i%2==0,c=r===`slice`||r===`slice-dice`&&i%2==1;if(r===`squarify`){let r=o.map((e,n)=>({share:e,i:n})).filter(e=>e.share>0),i=n.map(()=>({x:e.x,y:e.y,width:0,height:0}));if(r.length>0){let n=e.width*e.height,a=WO(r.map(e=>({area:e.share*n})),e);r.forEach((e,n)=>{i[e.i]=a[n]})}return i}let l=[];if(s){let n=e.x;o.forEach(r=>{let i=e.width*r;l.push({x:n,y:e.y,width:i,height:e.height}),n+=i})}else if(c){let n=e.y;o.forEach(r=>{let i=e.height*r;l.push({x:e.x,y:n,width:e.width,height:i}),n+=i})}return l}function qO(e,n={}){if(!e?.children?.length)return[];let{maxDepth:r=1/0,valueAccessor:i=()=>1,zoomKey:a,tilingMethod:o=`squarify`,hideLeaves:s=!1,presentation:c=`nested`,cascadeOffsetX:l,cascadeOffsetY:u}=n;if(r<=0)return[];let d=c===`cascaded`,f=d?GO(l):0,p=d?GO(u):0,m=e=>{let n=e.children??[];return s?n.filter(e=>e.item.isLeaf!==!0):n},h=a===void 0?e:VO(e,a)??e,g=HO(e,h.item.key),_=g?g.length-2:-1,v=m(h);if(v.length===0)return[];let y=[],b=(e,n,a,s,c)=>{if(e.length===0||s>=r)return;let l=KO(n,e.map(e=>BO(i(e.item))),o,s),u=e.length;e.forEach((e,n)=>{let r=l[n],i=m(e);if(y.push({node:e,depth:a,relativeDepth:s,x:r.x,y:r.y,width:r.width,height:r.height,parentKey:c,index:n,setSize:u,hasChildren:i.length>0||e.children===void 0&&e.item.isLeaf!==!0}),i.length>0){let n=f<=0&&p<=0?r:{x:r.x+f,y:r.y+p,width:Math.max(0,r.width-f),height:Math.max(0,r.height-p)};b(i,n,a+1,s+1,e.item.key)}})};return b(v,{x:0,y:0,width:1,height:1},_+1,0,h.item.key),y}let Q=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.tilingMethod=`squarify`,this.presentation=`nested`,this.cascadeOffset=6,this.maxDepth=4,this.hideLeaves=!1,this.minLabelArea=1600,this.minTileWidth=24,this.padding=4,this.minChildArea=400,this.valueAccessor=()=>1,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._zoomKey=void 0,this.search=new Vt(this,{adapter:Wt(this,{labelSelector:`.treemap-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#u().map(e=>({id:e.node.item.key,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{if(e===void 0)return;let n=this.#u().find(n=>n.node.item.key===e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth},bubbles:!0,composed:!0}))}}),this.#t=new Set,this.#n=new Map,this.#c=0}get selectedNodes(){return this._selectedNodes}get focusedNode(){if(this._zoomKey!==void 0)return VO(this.#l,this._zoomKey)}#e;#t;#n;#r;#i;#a;#o;#s;#c;get#l(){return this.model?.root??this.root}#u(){return this.#d(this._zoomKey)}#d(e){return qO(this.#l,{valueAccessor:this.valueAccessor,maxDepth:this.maxDepth,zoomKey:e,tilingMethod:this.tilingMethod,hideLeaves:this.hideLeaves,presentation:this.presentation,...this.#f()})}#f(){if(this.presentation!==`cascaded`||!Number.isFinite(this.cascadeOffset)||this.cascadeOffset<=0)return{};let e=this.clientWidth||0,n=this.clientHeight||0;return e<=0||n<=0?{}:{cascadeOffsetX:this.cascadeOffset/e,cascadeOffsetY:this.cascadeOffset/n}}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#i=Yt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#m(),typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(()=>this.requestUpdate()),this.#o.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=void 0;for(let e of this.#n.values())e.abort();this.#n.clear(),this.#t.clear(),this.#o?.disconnect(),this.#o=void 0,this.#i&&(this.#i.unregister(`select-all`),this.#i.unregister(`deselect-all`),this.#i=void 0,this.registry=void 0)}#p(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#m(){this.#i&&(this.search.setModes(this.#p()),this.#a?.(),this.#a=Rt(this.#i,this.search))}updated(e){if(e.has(`root`)&&this.root&&this.#h(),e.has(`model`)&&(this.#e?.(),this.#e=void 0,this.model&&(this.#e=this.model._subscribe(e=>{e.type===`root`?(this.#h(),this.requestUpdate()):e.type===`invalidate`&&this.requestUpdate()}),this.#h())),e.has(`interactionMode`)&&(this.#r=void 0,this.clearSelection()),e.has(`searchModes`)&&this.#m(),this._zoomKey!==void 0&&!VO(this.#l,this._zoomKey)&&(this._zoomKey=void 0),this.#g(),this.#s){let e=this.#s;this.#s=void 0,this.#S(e)}}#h(){this.#s=void 0,this.#y(),this.tickled.clearTickled(),this._zoomKey=void 0,this.#r=void 0}#g(){if(!(!this.model&&!this.loadChildren))for(let e of this.#u()){let{node:n}=e;n.children!==void 0||this.#t.has(n.item.key)||this.#_(n,e.depth)}}async#_(e,n){let r=e.item.key;this.#t.add(r);let i=new AbortController;this.#n.set(r,i),this.requestUpdate();try{let r;if(r=this.model?await this.model.getChildren(e,n,i.signal):[...await gg(this.loadChildren({node:e,depth:n},i.signal),i.signal)],i.signal.aborted)return;e.children=r}catch{if(i.signal.aborted)return;e.children=[]}finally{this.#t.delete(r),this.#n.delete(r),i.signal.aborted||this.requestUpdate()}}#v(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#y(){this._selectedNodes.clear(),this.selectedNode=void 0}#b(e){this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#v(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#b(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#b(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#u())this.#v(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#b(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#v(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#b(n),this.requestUpdate()}zoomTo(e){if(this._zoomKey===e.item.key)return;this.#s=this.#x(e.item.key),this._zoomKey=e.item.key,this.tickled.clearTickled();let n=HO(this.#l,e.item.key)?.length,r=n===void 0?-1:n-2;this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}zoomOut(){if(this._zoomKey===void 0)return;this.#s=this.#x(void 0);let e=this.focusedNode,n=this._zoomKey===void 0?void 0:HO(this.#l,this._zoomKey),r=n===void 0?-1:n.length-2;this._zoomKey=void 0,this.tickled.clearTickled(),this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:void 0,depth:-1},bubbles:!0,composed:!0})),e&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}#x(e){if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;if(e!==void 0){let n=this.#u().find(n=>n.node.item.key===e);if(n)return{direction:`in`,rect:{x:n.x,y:n.y,width:n.width,height:n.height}}}let n=this._zoomKey;if(n===void 0)return;let r=this.#d(e).find(e=>e.node.item.key===n);if(r)return{direction:`out`,rect:{x:r.x,y:r.y,width:r.width,height:r.height}}}#S(e){let n=this.renderRoot.querySelector(`.viewport-inner`),r=this.renderRoot.querySelector(`.viewport`);if(!(n instanceof HTMLElement)||!(r instanceof HTMLElement))return;let i=r.clientWidth,a=r.clientHeight;if(i<=0||a<=0)return;let{rect:o,direction:s}=e,c=s===`in`?`translate(${o.x*i}px, ${o.y*a}px) scale(${Math.max(o.width,1e-4)}, ${Math.max(o.height,1e-4)})`:(()=>{let e=o.width>0?1/o.width:1,n=o.height>0?1/o.height:1;return`translate(${-o.x*e*i}px, ${-o.y*n*a}px) scale(${e}, ${n})`})();n.classList.remove(`flipping`),n.style.transform=c,n.offsetWidth,requestAnimationFrame(()=>{n.classList.add(`flipping`),n.style.transform=`none`}),n.addEventListener(`transitionend`,()=>n.classList.remove(`flipping`),{once:!0})}#C(e){return e.item.isLeaf===!0?!1:e.children===void 0?this.model!==void 0||this.loadChildren!==void 0:this.hideLeaves?e.children.some(e=>e.item.isLeaf!==!0):e.children.length>0}navigateTo(e){let n=this.#l;if(!n?.children)return!1;let r=n,i=[];for(let n of e){let e=r.children?.find(e=>e.item.key===n);if(!e)return!1;i.push(e),r=e}let a=i.at(-1);return i.length>this.maxDepth?this.zoomTo(i[i.length-this.maxDepth-1]):this._zoomKey!==void 0&&this.zoomOut(),this.select(a),this.tickled.setTickled(a.item.key),this.requestUpdate(),!0}navigateToNode(e){let n=this.#l;if(!n?.children)return!1;let r=this.#T(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=this.#l;if(!n?.children)return!1;let r=this.#T(n.children,n=>n.item.key===e);if(!r)return!1;if(r.length>this.maxDepth){let e=this.#w(r.slice(0,r.length-this.maxDepth));e&&this.zoomTo(e)}return this.tickled.setTickled(e),this.requestUpdate(),!0}#w(e){let n=this.#l;for(let r of e){let e=r===n?.item.key?n:n?.children?.find(e=>e.item.key===r);if(!e)return;n=e}return n}#T(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#T(i.children,n,e);if(r)return r}}}getNodes(){return this.#u().map(e=>({node:e.node,depth:e.depth}))}#E(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#E(e,n+1))??!1}#D(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}#O(e,n){let r=this.#u(),i=this.#D(e),a=r.filter(n=>n!==e&&n.relativeDepth===e.relativeDepth&&n.parentKey===e.parentKey),o,s=1/0;for(let e of a){let r=this.#D(e),a=r.x-i.x,c=r.y-i.y;if(!(n===`left`?a<0:n===`right`?a>0:n===`up`?c<0:c>0))continue;let l=Math.hypot(a,c);l<s&&(s=l,o=e)}return o||(n===`up`||n===`left`?e.parentKey===void 0?void 0:r.find(n=>n.node.item.key===e.parentKey):r.find(n=>n.parentKey===e.node.item.key))}#k(e,n,r){if(this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.interactionMode===`standard`&&(r.ctrlKey||r.metaKey)){if(this._selectedNodes.has(e.node))this.deselect(e.node);else if(this.#v(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#b(n),this.requestUpdate()}this.#r=n}else if(this.interactionMode===`standard`&&r.shiftKey&&this.#r!==void 0){let e=this.#u(),r=Math.min(this.#r,n),i=Math.max(this.#r,n),a=new Set(this._selectedNodes);this._selectedNodes=new Set(e.slice(r,i+1).map(e=>e.node).filter(e=>this.#v(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#b(a),this.requestUpdate()}else this.interactionMode!==`manual`&&(this.select(e.node),this.#r=n);this.tickled.setTickled(e.node.item.key),this.#C(e.node)&&this.zoomTo(e.node)}#A(e){this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0}))}#j(e){if(this.disableKeyboardNavigation)return;let n=this.#u();if(n.length===0)return;let r=this.tickled.tickledId,i=r===void 0?-1:n.findIndex(e=>e.node.item.key===r),a=i>=0?n[i]:void 0,o=n=>{n&&(e.preventDefault(),this.tickled.setTickled(n.node.item.key),this.interactionMode===`implicit`&&this.select(n.node))};switch(e.key){case`ArrowLeft`:o(a?this.#O(a,`left`):n[0]);return;case`ArrowRight`:o(a?this.#O(a,`right`):n[0]);return;case`ArrowUp`:o(a?this.#O(a,`up`):n[0]);return;case`ArrowDown`:o(a?this.#O(a,`down`):n[0]);return;case`Home`:o(n[0]);return;case`End`:o(n.at(-1));return;case`Enter`:if(!a)return;e.preventDefault(),this.interactionMode!==`manual`&&this.select(a.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:a.node,depth:a.depth},bubbles:!0,composed:!0})),this.#C(a.node)&&this.zoomTo(a.node);return;case`Backspace`:case`Escape`:this._zoomKey!==void 0&&(e.preventDefault(),this.zoomOut())}}#M(e){if(!e.metaKey||e.deltaY===0||(e.preventDefault(),performance.now()<this.#c))return;if(e.deltaY>0){if(this._zoomKey===void 0)return;this.#c=performance.now()+260,this.#N();return}let n=(e.target?.closest(`.tile`))?.getAttribute(`data-key`)??void 0;if(n===void 0)return;let r=this.#u().find(e=>e.node.item.key===n);!r||!this.#C(r.node)||(this.#c=performance.now()+260,this.zoomTo(r.node))}#N(){let e=this._zoomKey===void 0?void 0:HO(this.#l,this._zoomKey),n=e&&e.length>2?e[e.length-2]:void 0;n?this.zoomTo(n):this.zoomOut()}#P(){let e=this.focusedNode;return e===void 0?a:i`
|
|
13027
|
+
`}};E([d({type:String})],UO.prototype,`text`,void 0),E([d({type:String})],UO.prototype,`effect`,void 0),E([d({type:Number})],UO.prototype,`duration`,void 0),E([d({type:String})],UO.prototype,`easing`,void 0),E([m()],UO.prototype,`_currentText`,void 0),E([m()],UO.prototype,`_outgoingText`,void 0),E([m()],UO.prototype,`_activeEffect`,void 0),E([m()],UO.prototype,`_transitionId`,void 0),UO=E([T(`ixfx-transitory-label`)],UO);var WO=class{#e;#t;#n;#r=new WeakMap;#i=new Map;#a=new Map;#o=new WeakMap;#s;constructor(e,n,r){this.#e=e,this.#t=n,this.#n=r}connect(){this.disconnect(),this.#s=new AbortController;let{signal:e}=this.#s;this.#o=new WeakMap,this.#i.clear(),this.#a.clear();let n={item:this.#c(this.#e)};this.#r.set(n,this.#e),n.children=this.#l(this.#e),this.#t.root=n,this.#t.addEventListener(`expand`,e=>{let{node:n}=e.detail,r=this.#r.get(n);r&&(n.children=this.#l(r),this.#t.invalidateStructure())},{signal:e}),this.#t.addEventListener(`collapse`,e=>{},{signal:e})}disconnect(){this.#s?.abort(),this.#s=void 0}sync(){let e=this.#t.root;e&&(this.#o=new WeakMap,this.#i.clear(),this.#a.clear(),this.#r.set(e,this.#e),e.item=this.#c(this.#e),e.children=this.#f(this.#e,e.children??[]),this.#t.invalidateStructure())}lookupByKey(e){return this.#a.get(e)}navigateToKeyPath(e,n){if(e.length===0)return!1;let r=this.#t.root?.children??[];for(let n=0;n<e.length-1;n++){let i=r.find(r=>r.item.key===e[n]);if(!i)return!1;if(i.children===void 0){let e=this.#r.get(i);e&&(i.children=this.#l(e),this.#t.invalidateStructure())}r=i.children??[]}return this.#t.navigateTo(e,n)}navigateToIdentity(e,n){let r=this.#i.get(e);if(!r)return!1;let i=[],a=this.#e.getIdentity();for(;r&&r.getIdentity()!==a;)i.unshift(this.#c(r).key),r=r.getParent();return r!==void 0&&this.navigateToKeyPath(i,n)}navigateToValue(e,n){let r=this.#p(this.#e,e);return r?this.navigateToKeyPath(r.slice(1).map(e=>this.#c(e).key),n):!1}#c(e,n){let r=e.getIdentity(),i=this.#o.get(r);return i||(i=this.#n.valueToItem(e.getValue(),e),this.#o.set(r,i)),n===void 0?i:{...i,isLeaf:i.isLeaf??n}}#l(e){return Array.from(e.children(),e=>this.#d(e))}#u(e,n){this.#r.set(e,n),this.#i.set(n.getIdentity(),n),this.#a.set(e.item.key,n)}#d(e){let n=[...e.children()];for(let e of n)this.#i.set(e.getIdentity(),e);let r={item:this.#c(e,n.length===0)};return this.#u(r,e),r}#f(e,n){let r=new Map(n.map(e=>[e.item.key,e]));return Array.from(e.children(),e=>{let n=this.#d(e),i=r.get(n.item.key);return i?(i.item=n.item,this.#u(i,e),i.children!==void 0&&(i.children=this.#f(e,i.children)),i):n})}#p(e,n,r=[]){let i=[...r,e];if(n(e.getValue()))return i;for(let r of e.children()){let e=this.#p(r,n,i);if(e)return e}}};function GO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function KO(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=KO(r,n);if(e)return e}}}function qO(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=qO(r,n);if(i)return[e,...i]}}}function JO(e,n,r){if(e.length===0||n<=0||r<=0)return 1/0;let i=0;for(let a of e){if(a<=0)return 1/0;let e=r*r*a/(n*n);i=Math.max(i,e,1/e)}return i}function YO(e,n){let r=Array.from({length:e.length}),i=n.x,a=n.y,o=n.width,s=n.height,c=0;for(;c<e.length;){let n=Math.min(o,s),l=c+1,u=e.slice(c,l).map(e=>e.area),d=u.reduce((e,n)=>e+n,0),f=JO(u,d,n);for(;l<e.length;){let r=e.slice(c,l+1).map(e=>e.area),i=r.reduce((e,n)=>e+n,0),a=JO(r,i,n);if(a<=f)l++,u=r,d=i,f=a;else break}if(o<=s){let e=d/o,n=i;for(let i=c;i<l;i++){let o=u[i-c]/e;r[i]={x:n,y:a,width:o,height:e},n+=o}a+=e,s-=e}else{let e=d/s,n=a;for(let a=c;a<l;a++){let o=u[a-c]/e;r[a]={x:i,y:n,width:e,height:o},n+=o}i+=e,o-=e}c=l}return r}function XO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.min(e,1):0}function ZO(e,n,r,i){if(e.width<=0||e.height<=0)return n.map(()=>({x:e.x,y:e.y,width:0,height:0}));let a=n.reduce((e,n)=>e+n,0),o=a>0?n.map(e=>e/a):n.map(()=>1/n.length),s=r===`dice`||r===`slice-dice`&&i%2==0,c=r===`slice`||r===`slice-dice`&&i%2==1;if(r===`squarify`){let r=o.map((e,n)=>({share:e,i:n})).filter(e=>e.share>0),i=n.map(()=>({x:e.x,y:e.y,width:0,height:0}));if(r.length>0){let n=e.width*e.height,a=YO(r.map(e=>({area:e.share*n})),e);r.forEach((e,n)=>{i[e.i]=a[n]})}return i}let l=[];if(s){let n=e.x;o.forEach(r=>{let i=e.width*r;l.push({x:n,y:e.y,width:i,height:e.height}),n+=i})}else if(c){let n=e.y;o.forEach(r=>{let i=e.height*r;l.push({x:e.x,y:n,width:e.width,height:i}),n+=i})}return l}function QO(e,n={}){if(!e?.children?.length)return[];let{maxDepth:r=1/0,valueAccessor:i=()=>1,zoomKey:a,tilingMethod:o=`squarify`,hideLeaves:s=!1,presentation:c=`nested`,cascadeOffsetX:l,cascadeOffsetY:u}=n;if(r<=0)return[];let d=c===`cascaded`,f=d?XO(l):0,p=d?XO(u):0,m=e=>{let n=e.children??[];return s?n.filter(e=>e.item.isLeaf!==!0):n},h=a===void 0?e:KO(e,a)??e,g=qO(e,h.item.key),_=g?g.length-2:-1,v=m(h);if(v.length===0)return[];let y=[],b=(e,n,a,s,c)=>{if(e.length===0||s>=r)return;let l=ZO(n,e.map(e=>GO(i(e.item))),o,s),u=e.length;e.forEach((e,n)=>{let r=l[n],i=m(e);if(y.push({node:e,depth:a,relativeDepth:s,x:r.x,y:r.y,width:r.width,height:r.height,parentKey:c,index:n,setSize:u,hasChildren:i.length>0||e.children===void 0&&e.item.isLeaf!==!0}),i.length>0){let n=f<=0&&p<=0?r:{x:r.x+f,y:r.y+p,width:Math.max(0,r.width-f),height:Math.max(0,r.height-p)};b(i,n,a+1,s+1,e.item.key)}})};return b(v,{x:0,y:0,width:1,height:1},_+1,0,h.item.key),y}let Q=class extends n{constructor(...e){super(...e),this.exclusivity=`none`,this.selectionFilter=`all`,this.interactionMode=`standard`,this.tilingMethod=`squarify`,this.presentation=`nested`,this.cascadeOffset=6,this.maxDepth=4,this.hideLeaves=!1,this.minLabelArea=1600,this.minTileWidth=24,this.padding=4,this.minChildArea=400,this.valueAccessor=()=>1,this._selectedNodes=new Set,this.disableKeyboardNavigation=!1,this.registry=void 0,this._zoomKey=void 0,this.search=new Vt(this,{adapter:Wt(this,{labelSelector:`.treemap-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new oe(this,{getItems:()=>this.#u().map(e=>({id:e.node.item.key,enabled:!0})),onStateChange:()=>{this.setAttribute(`data-input-mode`,this.tickled.inputMode)},onTickle:e=>{if(e===void 0)return;let n=this.#u().find(n=>n.node.item.key===e);n&&this.dispatchEvent(new CustomEvent(`tickle`,{detail:{node:n.node,depth:n.depth},bubbles:!0,composed:!0}))}}),this.#t=new Set,this.#n=new Map,this.#c=0}get selectedNodes(){return this._selectedNodes}get focusedNode(){if(this._zoomKey!==void 0)return KO(this.#l,this._zoomKey)}#e;#t;#n;#r;#i;#a;#o;#s;#c;get#l(){return this.model?.root??this.root}#u(){return this.#d(this._zoomKey)}#d(e){return QO(this.#l,{valueAccessor:this.valueAccessor,maxDepth:this.maxDepth,zoomKey:e,tilingMethod:this.tilingMethod,hideLeaves:this.hideLeaves,presentation:this.presentation,...this.#f()})}#f(){if(this.presentation!==`cascaded`||!Number.isFinite(this.cascadeOffset)||this.cascadeOffset<=0)return{};let e=this.clientWidth||0,n=this.clientHeight||0;return e<=0||n<=0?{}:{cascadeOffsetX:this.cascadeOffset/e,cascadeOffsetY:this.cascadeOffset/n}}connectedCallback(){super.connectedCallback(),this.setAttribute(`data-input-mode`,`mouse`);let e=this.#i=Yt();e.register({id:`select-all`,label:`Select All`,description:`Select all visible items`,execute:()=>this.selectAll()}),e.register({id:`deselect-all`,label:`Deselect All`,description:`Clear all selection`,execute:()=>this.deselectAll()}),this.registry=e,this.#m(),typeof ResizeObserver<`u`&&(this.#o=new ResizeObserver(()=>this.requestUpdate()),this.#o.observe(this))}disconnectedCallback(){super.disconnectedCallback(),this.#e?.(),this.#e=void 0;for(let e of this.#n.values())e.abort();this.#n.clear(),this.#t.clear(),this.#o?.disconnect(),this.#o=void 0,this.#i&&(this.#i.unregister(`select-all`),this.#i.unregister(`deselect-all`),this.#i=void 0,this.registry=void 0)}#p(){let e=this.searchModes?.trim();if(e===void 0)return[...zt];let n=new Set(e.split(/\s+/));return zt.filter(e=>n.has(e))}#m(){this.#i&&(this.search.setModes(this.#p()),this.#a?.(),this.#a=Rt(this.#i,this.search))}updated(e){if(e.has(`root`)&&this.root&&this.#h(),e.has(`model`)&&(this.#e?.(),this.#e=void 0,this.model&&(this.#e=this.model._subscribe(e=>{e.type===`root`?(this.#h(),this.requestUpdate()):e.type===`invalidate`&&this.requestUpdate()}),this.#h())),e.has(`interactionMode`)&&(this.#r=void 0,this.clearSelection()),e.has(`searchModes`)&&this.#m(),this._zoomKey!==void 0&&!KO(this.#l,this._zoomKey)&&(this._zoomKey=void 0),this.#g(),this.#s){let e=this.#s;this.#s=void 0,this.#S(e)}}#h(){this.#s=void 0,this.#y(),this.tickled.clearTickled(),this._zoomKey=void 0,this.#r=void 0}#g(){if(!(!this.model&&!this.loadChildren))for(let e of this.#u()){let{node:n}=e;n.children!==void 0||this.#t.has(n.item.key)||this.#_(n,e.depth)}}async#_(e,n){let r=e.item.key;this.#t.add(r);let i=new AbortController;this.#n.set(r,i),this.requestUpdate();try{let r;if(r=this.model?await this.model.getChildren(e,n,i.signal):[...await gg(this.loadChildren({node:e,depth:n},i.signal),i.signal)],i.signal.aborted)return;e.children=r}catch{if(i.signal.aborted)return;e.children=[]}finally{this.#t.delete(r),this.#n.delete(r),i.signal.aborted||this.requestUpdate()}}#v(e){return this.selectionFilter===`none`?!1:this.selectionFilter===`leaf`?e.item.isLeaf===!0:this.selectionFilter!==`branch`||e.item.isLeaf===!1||e.children!==void 0&&e.children.length>0}#y(){this._selectedNodes.clear(),this.selectedNode=void 0}#b(e){this.dispatchEvent(new CustomEvent(`select`,{detail:{selected:new Set(this._selectedNodes),previous:e},bubbles:!0,composed:!0}))}select(e){if(!this.#v(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.clear(),this._selectedNodes.add(e),this.selectedNode=e,this.#b(n),this.requestUpdate()}deselect(e){if(!this._selectedNodes.has(e))return;let n=new Set(this._selectedNodes);this._selectedNodes.delete(e),this.selectedNode===e&&(this.selectedNode=[...this._selectedNodes].at(-1)),this.#b(n),this.requestUpdate()}clearSelection(){if(this._selectedNodes.size===0)return;let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectAll(){let e=new Set(this._selectedNodes);for(let e of this.#u())this.#v(e.node)&&this._selectedNodes.add(e.node);this.selectedNode=[...this._selectedNodes].at(-1),this.#b(e),this.requestUpdate()}deselectAll(){let e=new Set(this._selectedNodes);this.#y(),this.#b(e),this.requestUpdate()}selectMany(e){let n=new Set(this._selectedNodes);this._selectedNodes=new Set([...e].filter(e=>this.#v(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#b(n),this.requestUpdate()}zoomTo(e){if(this._zoomKey===e.item.key)return;this.#s=this.#x(e.item.key),this._zoomKey=e.item.key,this.tickled.clearTickled();let n=qO(this.#l,e.item.key)?.length,r=n===void 0?-1:n-2;this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`expand`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}zoomOut(){if(this._zoomKey===void 0)return;this.#s=this.#x(void 0);let e=this.focusedNode,n=this._zoomKey===void 0?void 0:qO(this.#l,this._zoomKey),r=n===void 0?-1:n.length-2;this._zoomKey=void 0,this.tickled.clearTickled(),this.dispatchEvent(new CustomEvent(`zoom`,{detail:{node:void 0,depth:-1},bubbles:!0,composed:!0})),e&&this.dispatchEvent(new CustomEvent(`collapse`,{detail:{node:e,depth:r},bubbles:!0,composed:!0})),this.requestUpdate()}#x(e){if(typeof matchMedia==`function`&&matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;if(e!==void 0){let n=this.#u().find(n=>n.node.item.key===e);if(n)return{direction:`in`,rect:{x:n.x,y:n.y,width:n.width,height:n.height}}}let n=this._zoomKey;if(n===void 0)return;let r=this.#d(e).find(e=>e.node.item.key===n);if(r)return{direction:`out`,rect:{x:r.x,y:r.y,width:r.width,height:r.height}}}#S(e){let n=this.renderRoot.querySelector(`.viewport-inner`),r=this.renderRoot.querySelector(`.viewport`);if(!(n instanceof HTMLElement)||!(r instanceof HTMLElement))return;let i=r.clientWidth,a=r.clientHeight;if(i<=0||a<=0)return;let{rect:o,direction:s}=e,c=s===`in`?`translate(${o.x*i}px, ${o.y*a}px) scale(${Math.max(o.width,1e-4)}, ${Math.max(o.height,1e-4)})`:(()=>{let e=o.width>0?1/o.width:1,n=o.height>0?1/o.height:1;return`translate(${-o.x*e*i}px, ${-o.y*n*a}px) scale(${e}, ${n})`})();n.classList.remove(`flipping`),n.style.transform=c,n.offsetWidth,requestAnimationFrame(()=>{n.classList.add(`flipping`),n.style.transform=`none`}),n.addEventListener(`transitionend`,()=>n.classList.remove(`flipping`),{once:!0})}#C(e){return e.item.isLeaf===!0?!1:e.children===void 0?this.model!==void 0||this.loadChildren!==void 0:this.hideLeaves?e.children.some(e=>e.item.isLeaf!==!0):e.children.length>0}navigateTo(e){let n=this.#l;if(!n?.children)return!1;let r=n,i=[];for(let n of e){let e=r.children?.find(e=>e.item.key===n);if(!e)return!1;i.push(e),r=e}let a=i.at(-1);return i.length>this.maxDepth?this.zoomTo(i[i.length-this.maxDepth-1]):this._zoomKey!==void 0&&this.zoomOut(),this.select(a),this.tickled.setTickled(a.item.key),this.requestUpdate(),!0}navigateToNode(e){let n=this.#l;if(!n?.children)return!1;let r=this.#T(n.children,e);return r?this.navigateTo(r):!1}revealKey(e){let n=this.#l;if(!n?.children)return!1;let r=this.#T(n.children,n=>n.item.key===e);if(!r)return!1;if(r.length>this.maxDepth){let e=this.#w(r.slice(0,r.length-this.maxDepth));e&&this.zoomTo(e)}return this.tickled.setTickled(e),this.requestUpdate(),!0}#w(e){let n=this.#l;for(let r of e){let e=r===n?.item.key?n:n?.children?.find(e=>e.item.key===r);if(!e)return;n=e}return n}#T(e,n,r=[]){for(let i of e){let e=[...r,i.item.key];if(n(i))return e;if(i.children?.length){let r=this.#T(i.children,n,e);if(r)return r}}}getNodes(){return this.#u().map(e=>({node:e.node,depth:e.depth}))}#E(e,n){return!this.filterPredicate||this.filterPredicate(e,n)?!0:e.children?.some(e=>this.#E(e,n+1))??!1}#D(e){return{x:e.x+e.width/2,y:e.y+e.height/2}}#O(e,n){let r=this.#u(),i=this.#D(e),a=r.filter(n=>n!==e&&n.relativeDepth===e.relativeDepth&&n.parentKey===e.parentKey),o,s=1/0;for(let e of a){let r=this.#D(e),a=r.x-i.x,c=r.y-i.y;if(!(n===`left`?a<0:n===`right`?a>0:n===`up`?c<0:c>0))continue;let l=Math.hypot(a,c);l<s&&(s=l,o=e)}return o||(n===`up`||n===`left`?e.parentKey===void 0?void 0:r.find(n=>n.node.item.key===e.parentKey):r.find(n=>n.parentKey===e.node.item.key))}#k(e,n,r){if(this.dispatchEvent(new CustomEvent(`item-click`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.interactionMode===`standard`&&(r.ctrlKey||r.metaKey)){if(this._selectedNodes.has(e.node))this.deselect(e.node);else if(this.#v(e.node)){let n=new Set(this._selectedNodes);this._selectedNodes.add(e.node),this.selectedNode=e.node,this.#b(n),this.requestUpdate()}this.#r=n}else if(this.interactionMode===`standard`&&r.shiftKey&&this.#r!==void 0){let e=this.#u(),r=Math.min(this.#r,n),i=Math.max(this.#r,n),a=new Set(this._selectedNodes);this._selectedNodes=new Set(e.slice(r,i+1).map(e=>e.node).filter(e=>this.#v(e))),this.selectedNode=[...this._selectedNodes].at(-1),this.#b(a),this.requestUpdate()}else this.interactionMode!==`manual`&&(this.select(e.node),this.#r=n);this.tickled.setTickled(e.node.item.key),this.#C(e.node)&&this.zoomTo(e.node)}#A(e){this.dispatchEvent(new CustomEvent(`item-dblclick`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:e.node,depth:e.depth},bubbles:!0,composed:!0}))}#j(e){if(this.disableKeyboardNavigation)return;let n=this.#u();if(n.length===0)return;let r=this.tickled.tickledId,i=r===void 0?-1:n.findIndex(e=>e.node.item.key===r),a=i>=0?n[i]:void 0,o=n=>{n&&(e.preventDefault(),this.tickled.setTickled(n.node.item.key),this.interactionMode===`implicit`&&this.select(n.node))};switch(e.key){case`ArrowLeft`:o(a?this.#O(a,`left`):n[0]);return;case`ArrowRight`:o(a?this.#O(a,`right`):n[0]);return;case`ArrowUp`:o(a?this.#O(a,`up`):n[0]);return;case`ArrowDown`:o(a?this.#O(a,`down`):n[0]);return;case`Home`:o(n[0]);return;case`End`:o(n.at(-1));return;case`Enter`:if(!a)return;e.preventDefault(),this.interactionMode!==`manual`&&this.select(a.node),this.dispatchEvent(new CustomEvent(`activate`,{detail:{node:a.node,depth:a.depth},bubbles:!0,composed:!0})),this.#C(a.node)&&this.zoomTo(a.node);return;case`Backspace`:case`Escape`:this._zoomKey!==void 0&&(e.preventDefault(),this.zoomOut())}}#M(e){if(!e.metaKey||e.deltaY===0||(e.preventDefault(),performance.now()<this.#c))return;if(e.deltaY>0){if(this._zoomKey===void 0)return;this.#c=performance.now()+260,this.#N();return}let n=(e.target?.closest(`.tile`))?.getAttribute(`data-key`)??void 0;if(n===void 0)return;let r=this.#u().find(e=>e.node.item.key===n);!r||!this.#C(r.node)||(this.#c=performance.now()+260,this.zoomTo(r.node))}#N(){let e=this._zoomKey===void 0?void 0:qO(this.#l,this._zoomKey),n=e&&e.length>2?e[e.length-2]:void 0;n?this.zoomTo(n):this.zoomOut()}#P(){let e=this.focusedNode;return e===void 0?a:i`
|
|
12990
13028
|
<nav class="breadcrumb" part="breadcrumb" aria-label="Treemap zoom path">
|
|
12991
13029
|
<ixfx-crumb-navigation
|
|
12992
13030
|
with-up
|
|
@@ -13208,7 +13246,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13208
13246
|
color: var(--surface-muted-text);
|
|
13209
13247
|
font-size: var(--text-s);
|
|
13210
13248
|
}
|
|
13211
|
-
`]}};E([d({type:Object})],Q.prototype,`root`,void 0),E([d({attribute:!1})],Q.prototype,`model`,void 0),E([d({attribute:!1})],Q.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],Q.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],Q.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],Q.prototype,`interactionMode`,void 0),E([d({type:String,attribute:`tiling-method`})],Q.prototype,`tilingMethod`,void 0),E([d({type:String,attribute:`presentation`})],Q.prototype,`presentation`,void 0),E([d({type:Number,attribute:`cascade-offset`})],Q.prototype,`cascadeOffset`,void 0),E([d({type:Number,attribute:`max-depth`})],Q.prototype,`maxDepth`,void 0),E([d({type:Boolean,attribute:`hide-leaves`})],Q.prototype,`hideLeaves`,void 0),E([d({type:Number,attribute:`min-label-area`})],Q.prototype,`minLabelArea`,void 0),E([d({type:Number,attribute:`min-tile-width`})],Q.prototype,`minTileWidth`,void 0),E([d({type:Number})],Q.prototype,`padding`,void 0),E([d({type:Number,attribute:`min-child-area`})],Q.prototype,`minChildArea`,void 0),E([d({attribute:!1})],Q.prototype,`valueAccessor`,void 0),E([d({attribute:!1})],Q.prototype,`categoryAccessor`,void 0),E([d({attribute:!1})],Q.prototype,`selectedNode`,void 0),E([m()],Q.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],Q.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],Q.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],Q.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],Q.prototype,`searchModes`,void 0),E([m()],Q.prototype,`_zoomKey`,void 0),Q=E([T(`ixfx-treemap-list`)],Q);let
|
|
13249
|
+
`]}};E([d({type:Object})],Q.prototype,`root`,void 0),E([d({attribute:!1})],Q.prototype,`model`,void 0),E([d({attribute:!1})],Q.prototype,`loadChildren`,void 0),E([d({reflect:!0,attribute:`exclusivity`})],Q.prototype,`exclusivity`,void 0),E([d({reflect:!0,attribute:`selection-filter`})],Q.prototype,`selectionFilter`,void 0),E([d({type:String,attribute:`interaction-mode`})],Q.prototype,`interactionMode`,void 0),E([d({type:String,attribute:`tiling-method`})],Q.prototype,`tilingMethod`,void 0),E([d({type:String,attribute:`presentation`})],Q.prototype,`presentation`,void 0),E([d({type:Number,attribute:`cascade-offset`})],Q.prototype,`cascadeOffset`,void 0),E([d({type:Number,attribute:`max-depth`})],Q.prototype,`maxDepth`,void 0),E([d({type:Boolean,attribute:`hide-leaves`})],Q.prototype,`hideLeaves`,void 0),E([d({type:Number,attribute:`min-label-area`})],Q.prototype,`minLabelArea`,void 0),E([d({type:Number,attribute:`min-tile-width`})],Q.prototype,`minTileWidth`,void 0),E([d({type:Number})],Q.prototype,`padding`,void 0),E([d({type:Number,attribute:`min-child-area`})],Q.prototype,`minChildArea`,void 0),E([d({attribute:!1})],Q.prototype,`valueAccessor`,void 0),E([d({attribute:!1})],Q.prototype,`categoryAccessor`,void 0),E([d({attribute:!1})],Q.prototype,`selectedNode`,void 0),E([m()],Q.prototype,`_selectedNodes`,void 0),E([d({attribute:!1})],Q.prototype,`filterPredicate`,void 0),E([d({type:Boolean,attribute:`disable-keyboard-navigation`})],Q.prototype,`disableKeyboardNavigation`,void 0),E([d({attribute:!1})],Q.prototype,`registry`,void 0),E([d({type:String,attribute:`search-modes`,reflect:!0})],Q.prototype,`searchModes`,void 0),E([m()],Q.prototype,`_zoomKey`,void 0),Q=E([T(`ixfx-treemap-list`)],Q);let $O=class extends n{constructor(...e){super(...e),this.layout=`vertical`,this.sizeA=``,this.sizeB=``,this.fixedA=!1,this.fixedB=!1,this.collapsible=!1,this.collapsedA=!1,this.collapsedB=!1,this.minSizeA=``,this.maxSizeA=``,this.minSizeB=``,this.maxSizeB=``,this._hasCorner=!1,this.#t=``,this.#n=``,this.#r=0,this.#i=0,this.#a=``,this.#u=null,this.#p=.1,this.#E=e=>{e.preventDefault();let n=this.getZone();n&&n.classList.add(`user-resizing`),this.#e=this.getBoundingClientRect(),this.#t=this.sizeA,this.#n=this.sizeB,window.addEventListener(`pointerup`,this.#D),window.addEventListener(`pointermove`,this.#O)},this.#D=e=>{e.preventDefault();let n=this.getZone();n&&n.classList.remove(`user-resizing`),window.removeEventListener(`pointerup`,this.#D),window.removeEventListener(`pointermove`,this.#O)},this.#O=e=>{let n=this.#e;if(n){if(this.layout===`horizontal`){let r=ii((e.y-n.y)/n.height);if(this.collapsible&&this.collapsedA){if(r>(this.#d??.05)+this.#p){this.collapsedA=!1,this.#h(`A`,!1),this.#d=void 0;let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.height);this.sizeA=e,this.sizeB=i}}else if(this.collapsible&&!this.collapsedA&&r<5/n.height)this.collapsedA=!0,this.#h(`A`,!0),this.sizeA=`0px`,this.sizeB=`100%`,this.#d=r;else if(!this.collapsedA){let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.height);this.sizeA=e,this.sizeB=i}if(this.collapsible&&this.collapsedB){if(r<(this.#f??.95)-this.#p){this.collapsedB=!1,this.#h(`B`,!1),this.#f=void 0;let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.height);this.sizeA=e,this.sizeB=i}}else this.collapsible&&!this.collapsedB&&r>1-5/n.height&&(this.collapsedB=!0,this.#h(`B`,!0),this.sizeA=`100%`,this.sizeB=`0px`,this.#f=r)}else{let r=ii((e.x-n.x)/n.width);if(this.collapsible&&this.collapsedA){if(r>(this.#d??.05)+this.#p){this.collapsedA=!1,this.#h(`A`,!1),this.#d=void 0;let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.width);this.sizeA=e,this.sizeB=i}}else if(this.collapsible&&!this.collapsedA&&r<5/n.width)this.collapsedA=!0,this.#h(`A`,!0),this.sizeA=`0px`,this.sizeB=`100%`,this.#d=r;else if(!this.collapsedA){let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.width);this.sizeA=e,this.sizeB=i}if(this.collapsible&&this.collapsedB){if(r<(this.#f??.95)-this.#p){this.collapsedB=!1,this.#h(`B`,!1),this.#f=void 0;let{sizeA:e,sizeB:i}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.width);this.sizeA=e,this.sizeB=i}}else this.collapsible&&!this.collapsedB&&r>1-5/n.width&&(this.collapsedB=!0,this.#h(`B`,!0),this.sizeA=`100%`,this.sizeB=`0px`,this.#f=r)}e.preventDefault()}},this.#k=e=>{e.preventDefault(),e.stopPropagation();let n=this.getZone();n&&n.classList.add(`user-resizing`),this.#e=this.getBoundingClientRect(),this.#r=e.clientX,this.#i=e.clientY,this.#t=this.sizeA,this.#n=this.sizeB;let r=this.#v();if(r){this.#a=r.sizeA;let e=r.getBoundingClientRect(),n=r.shadowRoot?.querySelector(`.split-bar`);n&&(this.#s=e,this.#c=n.getBoundingClientRect());let i=r.getZone();i&&i.classList.add(`user-resizing`)}window.addEventListener(`pointerup`,this.#A),window.addEventListener(`pointermove`,this.#M)},this.#A=e=>{e.preventDefault();let n=this.getZone();n&&n.classList.remove(`user-resizing`);let r=this.#v();if(r){let e=r.getZone();e&&e.classList.remove(`user-resizing`)}window.removeEventListener(`pointerup`,this.#A),window.removeEventListener(`pointermove`,this.#M)},this.#M=e=>{let n=this.#e,r=this.getZone(),i=this.#v();if(!n||!r||!i)return;let a=r.getBoundingClientRect(),o=e.clientX-a.left,s=e.clientY-a.top;if(this.layout===`vertical`&&i.layout===`horizontal`){let e=o/n.width,r=s/n.height,{sizeA:i,sizeB:a}=this.#x(`${e*100}%`,`${(1-e)*100}%`,n.width);e=this.#y(i,n.width),this.sizeA=i,this.sizeB=a,this.#u={sizeA:r,sizeB:1-r},requestAnimationFrame(()=>this.#j());let c=this.shadowRoot?.querySelector(`.corner-zone`);c&&(c.style.left=`${o-6}px`,c.style.top=`${s-6}px`)}else if(this.layout===`horizontal`&&i.layout===`vertical`){let e=o/n.width,r=s/n.height,{sizeA:i,sizeB:a}=this.#x(`${r*100}%`,`${(1-r)*100}%`,n.height);r=this.#y(i,n.height),this.sizeA=i,this.sizeB=a,this.#u={sizeA:e,sizeB:1-e},requestAnimationFrame(()=>this.#j());let c=this.shadowRoot?.querySelector(`.corner-zone`);c&&(c.style.left=`${o-6}px`,c.style.top=`${s-6}px`)}e.preventDefault()}}get showGrabHandle(){let e=getComputedStyle(this).getPropertyValue(`--handle-size`).trim(),n=Number.parseFloat(e);return!Number.isNaN(n)&&n>3}#e;#t;#n;#r;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;disconnectedCallback(){super.disconnectedCallback(),this.#l?.disconnect()}firstUpdated(){this.#g()}updated(e){(e.has(`sizeA`)||e.has(`sizeB`)||e.has(`collapsedA`)||e.has(`collapsedB`))&&this.#T(),(e.has(`sizeA`)||e.has(`sizeB`))&&this.#m()}#m(){this.collapsedA?this.setAttribute(`data-collapsed-a`,``):this.removeAttribute(`data-collapsed-a`),this.collapsedB?this.setAttribute(`data-collapsed-b`,``):this.removeAttribute(`data-collapsed-b`)}#h(e,n){this.dispatchEvent(new CustomEvent(`ixfx-split-collapsed`,{detail:{panel:e,collapsed:n},bubbles:!0,composed:!0}))}#g(){let e=this.shadowRoot?.querySelector(`slot[name="a"]`);e&&(this.#l=new MutationObserver(()=>{this.#_()}),this.#l.observe(e,{characterData:!0,childList:!0,subtree:!0}),this.#_())}#_(){let e=this.shadowRoot?.querySelector(`slot[name="a"]`);if(!e)return;let n=e.assignedElements(),r=e=>{for(let n of e){if(n.tagName===`IXFX-SPLIT-LAYOUT`)return n;let e=r(Array.from(n.children));if(e)return e}},i=r(n);i?(this.#o=i,this._hasCorner=!0,requestAnimationFrame(()=>this.#T())):(this.#o=void 0,this._hasCorner=!1)}#v(){if(this.#o)return this.#o;let e=this.shadowRoot?.querySelector(`slot[name="a"]`);if(e)return e.assignedElements().find(e=>e.tagName===`IXFX-SPLIT-LAYOUT`)}#y(e,n){return e.endsWith(`px`)?Number.parseFloat(e.replace(`px`,``))/n:e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:.5}#b(e,n){return e.endsWith(`px`)?Number.parseFloat(e.replace(`px`,``)):e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100*n:null}#x(e,n,r){let i=this.#y(e,r),a=this.#y(n,r),o=this.#S(this.minSizeA,r),s=this.#S(this.minSizeB,r),c=this.#C(this.maxSizeA,r),l=this.#C(this.maxSizeB,r);if(o!==null||s!==null){let e=(o??0)+(s??0);if(e>1){let n=1/e;o!==null&&(i=o===null?0:o*n),s!==null&&(a=s===null?0:s*n)}i<(o??0)&&(i=o??0),a<(s??0)&&(a=s??0)}c!==null&&i>c&&(i=c),l!==null&&a>l&&(a=l),a=1-i;let u=!this.sizeA.endsWith(`px`);return this.sizeB.endsWith(`px`),u?{sizeA:`${i*100}%`,sizeB:`${a*100}%`}:{sizeA:`${i*r}px`,sizeB:`${a*r}px`}}#S(e,n){if(e.length===0)return null;let r=this.#b(e,n);return r===null?e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:null:r/n}#C(e,n){if(e.length===0)return null;let r=this.#b(e,n);return r===null?e.endsWith(`%`)?Number.parseFloat(e.replace(`%`,``))/100:null:r/n}#w(){let e=this.getBoundingClientRect(),n=this.getZone();if(!n)return null;let r=this.#v();if(!r)return null;n.getBoundingClientRect();let i=this.#y(this.sizeA||`50%`,e.width),a,o;if(this.layout===`vertical`&&r.layout===`horizontal`)a=i*e.width,o=this.#y(r.sizeA||`50%`,e.height)*e.height;else if(this.layout===`horizontal`&&r.layout===`vertical`)a=this.#y(r.sizeA||`50%`,e.width)*e.width,o=i*e.height;else return null;return{x:a,y:o}}#T(){if(!this._hasCorner)return;let e=this.shadowRoot?.querySelector(`.corner-zone`);if(!e||!this.getZone())return;let n=this.#w();if(!n){e.style.display=`none`;return}let r=n.x-6,i=n.y-6;e.style.left=`${r}px`,e.style.top=`${i}px`,e.style.display=`block`;let a=this.#v();a&&(this.layout===`vertical`&&a.layout===`horizontal`?e.style.cursor=`nwse-resize`:this.layout===`horizontal`&&a.layout===`vertical`&&(e.style.cursor=`nesw-resize`))}getZone(){if(!this.shadowRoot)return;let e=this.shadowRoot.querySelector(`#zone`);if(e)return e}#E;#D;#O;#k;#A;#j(){if(!this.#u)return;let{sizeA:e,sizeB:n}=this.#u,r=this.#v();r&&(r.sizeA=`${e*100}%`,r.sizeB=`${n*100}%`),this.#u=null}#M;render(){let e=this.layout===`vertical`?`width`:`height`,n=this.sizeA,r=this.sizeB;return this.collapsedA?n=`0px`:n.length===0&&r.length===0?r=n=`50%`:n.length===0?n=`auto`:r.length===0&&(r=`auto`),this.collapsedB&&(r=`0px`),n=`${e}:${n}`,r=`${e}:${r}`,i`
|
|
13212
13250
|
<div id="zone">
|
|
13213
13251
|
<slot style=${n} name="a"></slot>
|
|
13214
13252
|
${this._hasCorner?i`<div class="corner-zone" @pointerdown=${this.#k}></div>`:``}
|
|
@@ -13332,7 +13370,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13332
13370
|
:host([data-collapsed-b]) slot[name="b"] {
|
|
13333
13371
|
display: none;
|
|
13334
13372
|
}
|
|
13335
|
-
`]}};E([d({type:String})]
|
|
13373
|
+
`]}};E([d({type:String})],$O.prototype,`layout`,void 0),E([d({type:String})],$O.prototype,`sizeA`,void 0),E([d({type:String})],$O.prototype,`sizeB`,void 0),E([d({type:Boolean})],$O.prototype,`fixedA`,void 0),E([d({type:Boolean})],$O.prototype,`fixedB`,void 0),E([d({type:Boolean})],$O.prototype,`collapsible`,void 0),E([d({type:Boolean,reflect:!0})],$O.prototype,`collapsedA`,void 0),E([d({type:Boolean,reflect:!0})],$O.prototype,`collapsedB`,void 0),E([d({type:String})],$O.prototype,`minSizeA`,void 0),E([d({type:String})],$O.prototype,`maxSizeA`,void 0),E([d({type:String})],$O.prototype,`minSizeB`,void 0),E([d({type:String})],$O.prototype,`maxSizeB`,void 0),E([m()],$O.prototype,`_hasCorner`,void 0),$O=E([T(`ixfx-twosplit-layout`)],$O);function ek(e){return e instanceof HTMLElement&&`checked`in e}function tk(e){if(typeof e==`string`){let n=document.querySelector(e);if(!(n instanceof HTMLElement))throw Error(`Element not found or not HTMLElement: ${e}`);return n}return e}function nk(e,n){let r=tk(e);if(!ek(r))throw Error(`Target element is not a checkbox-like element`);let i=[];for(let e of n){let n=tk(e);ek(n)&&i.push(n)}let a=()=>{if(i.length===0){r.checked=!1,r.indeterminate=!1;return}let e=0,n=0;for(let r of i)r.checked?e++:n++;e>0&&n>0?(r.checked=!1,r.indeterminate=!0):e===i.length?(r.checked=!0,r.indeterminate=!1):(r.checked=!1,r.indeterminate=!1)},o=()=>{a()};for(let e of i)e.addEventListener(`change`,o);return a(),()=>{for(let e of i)e.removeEventListener(`change`,o)}}function rk(e,n,r,i){return i===`linear`?(e-n)/(r-n):Math.log(e/n)/Math.log(r/n)}function ik(e,n,r,i){return i===`linear`?n+e*(r-n):n*(r/n)**e}function ak(e,n,r,i){if(!i||i<=1)return e;let a=(r-n)/i;return Math.round((e-n)/a)*a+n}let $=class extends qy(n){constructor(...e){super(...e),this.xMin=1,this.xMax=100,this.x=50,this.yMin=1,this.yMax=100,this.y=50,this.xScale=`linear`,this.yScale=`linear`,this.xLabel=`X`,this.yLabel=`Y`,this.showCrosshairs=!1,this.showGrid=!1,this.hideCursor=!1,this.disabled=!1,this._dragging=!1,this._dragStartX=0,this._dragStartY=0,this._pressedKeys=new Set,this._onKeyDown=e=>{if(!this.disabled){if([`ArrowLeft`,`ArrowRight`,`ArrowUp`,`ArrowDown`].includes(e.key))e.preventDefault(),this._pressedKeys.add(e.key),this._handleKeyboardMove(e.shiftKey);else if(e.key===`Home`||e.key===`End`){e.preventDefault();let n=e.key===`Home`?this.xMin:this.xMax,r=e.key===`Home`?this.yMin:this.yMax;(n!==this.x||r!==this.y)&&(this.x=n,this.y=r,this.dispatchEvent(new CustomEvent(`input`,{detail:{x:this.x,y:this.y},bubbles:!0,composed:!0})))}}},this._onKeyUp=e=>{this._pressedKeys.delete(e.key)},this._handleKeyboardMove=e=>{let n=this.xMax-this.xMin,r=this.yMax-this.yMin,i=this.stopsX??this.stops,a=this.stopsY??this.stops,o=Ky(n,i,this.stepX,e),s=Ky(r,a,this.stepY,e),c=this.x,l=this.y;if(this._pressedKeys.has(`ArrowLeft`)&&(c=Math.max(this.xMin,this.x-o)),this._pressedKeys.has(`ArrowRight`)&&(c=Math.min(this.xMax,this.x+o)),this._pressedKeys.has(`ArrowUp`)&&(l=Math.min(this.yMax,this.y+s)),this._pressedKeys.has(`ArrowDown`)&&(l=Math.max(this.yMin,this.y-s)),c!==this.x||l!==this.y){let e=this.xSnapStep&&this.xSnapStep>0?Math.round(c/this.xSnapStep)*this.xSnapStep:c,n=this.ySnapStep&&this.ySnapStep>0?Math.round(l/this.ySnapStep)*this.ySnapStep:l;e=ak(e,this.xMin,this.xMax,i),n=ak(n,this.yMin,this.yMax,a),this.x=e,this.y=n,this.dispatchEvent(new CustomEvent(`input`,{detail:{x:this.x,y:this.y},bubbles:!0,composed:!0}))}},this._onPointerDown=e=>{e.preventDefault();let n=this.renderRoot.querySelector(`.xy-pad-area`);n?.focus(),n&&n.setPointerCapture(e.pointerId),this._dragging=!0,this._dragStartX=this.x,this._dragStartY=this.y,this.setAttribute(`dragging`,``),this._updateFromPointer(e),globalThis.addEventListener(`pointermove`,this._onPointerMove),globalThis.addEventListener(`pointerup`,this._onPointerUp)},this._onPointerMove=e=>{this._dragging&&(e.preventDefault(),this._updateFromPointer(e))},this._onPointerUp=()=>{let e=this.x!==this._dragStartX||this.y!==this._dragStartY;this._dragging=!1,this.removeAttribute(`dragging`),globalThis.removeEventListener(`pointermove`,this._onPointerMove),globalThis.removeEventListener(`pointerup`,this._onPointerUp),e&&this.dispatchEvent(new CustomEvent(`change`,{detail:{x:this.x,y:this.y},bubbles:!0,composed:!0}))}}static{this.styles=[w,cn,r`
|
|
13336
13374
|
:host {
|
|
13337
13375
|
display: block;
|
|
13338
13376
|
width: 200px;
|
|
@@ -13446,7 +13484,7 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13446
13484
|
height:100%;
|
|
13447
13485
|
text-align:center;
|
|
13448
13486
|
}
|
|
13449
|
-
`]}_stepYByDelta(e,n){let r=this.yMax-this.yMin,i=this.stopsY??this.stops,a=
|
|
13487
|
+
`]}_stepYByDelta(e,n){let r=this.yMax-this.yMin,i=this.stopsY??this.stops,a=Ky(r,i,this.stepY,n),o=e===1?Math.min(this.yMax,this.y+a):Math.max(this.yMin,this.y-a);if(o===this.y)return;let s=this.ySnapStep&&this.ySnapStep>0?Math.round(o/this.ySnapStep)*this.ySnapStep:o;s=ak(s,this.yMin,this.yMax,i),s!==this.y&&(this.y=s,this.dispatchEvent(new CustomEvent(`input`,{detail:{x:this.x,y:this.y},bubbles:!0,composed:!0})))}_applyWheelDelta(e,n){this._stepYByDelta(e,n.shiftKey)}_updateFromPointer(e){let n=this.renderRoot.querySelector(`.xy-pad-area`);if(!n)return;let r=n.getBoundingClientRect(),i=Math.max(0,Math.min(1,(e.clientX-r.left)/r.width)),a=Math.max(0,Math.min(1,1-(e.clientY-r.top)/r.height)),o=ik(i,this.xMin,this.xMax,this.xScale),s=ik(a,this.yMin,this.yMax,this.yScale),c=this.xSnapStep&&this.xSnapStep>0?Math.round(o/this.xSnapStep)*this.xSnapStep:o,l=this.ySnapStep&&this.ySnapStep>0?Math.round(s/this.ySnapStep)*this.ySnapStep:s,u=this.stopsX??this.stops,d=this.stopsY??this.stops;c=ak(c,this.xMin,this.xMax,u),l=ak(l,this.yMin,this.yMax,d),this.x=c,this.y=l,this.dispatchEvent(new CustomEvent(`input`,{detail:{x:this.x,y:this.y},bubbles:!0,composed:!0}))}_setPctVars(){let e=Math.max(this.xMin,Math.min(this.xMax,this.x)),n=Math.max(this.yMin,Math.min(this.yMax,this.y)),r=rk(e,this.xMin,this.xMax,this.xScale)*100,i=rk(n,this.yMin,this.yMax,this.yScale)*100;this.style.setProperty(`--x-pct`,`${r}`),this.style.setProperty(`--y-pct`,`${i}`);let a=r-50,o=i-50,s=Math.sqrt(a*a+o*o);this.style.setProperty(`--radius-pct`,`${s}`)}getRelativeX(){return rk(Math.max(this.xMin,Math.min(this.xMax,this.x)),this.xMin,this.xMax,this.xScale)}getRelativeY(){return rk(Math.max(this.yMin,Math.min(this.yMax,this.y)),this.yMin,this.yMax,this.yScale)}getPolar(){let e=this.getRelativeX()-.5,n=this.getRelativeY()-.5,r=Math.sqrt(e*e+n*n)*2,i=Math.atan2(n,e);return i<0&&(i+=2*Math.PI),{radius:r,angle:i}}updated(e){super.updated(e),this._setPctVars()}disconnectedCallback(){super.disconnectedCallback(),this._onPointerUp(),this._pressedKeys.clear()}render(){return i`
|
|
13450
13488
|
<div class="xy-pad-area"
|
|
13451
13489
|
tabindex=${this.disabled?-1:0}
|
|
13452
13490
|
@pointerdown=${this._onPointerDown}
|
|
@@ -13458,4 +13496,4 @@ ixfx-form-options[orientation="vertical"] ixfx-form-part > label {
|
|
|
13458
13496
|
<div class="xy-pad-label-x">${this.xLabel}</div>
|
|
13459
13497
|
<div class="xy-pad-label-y">${this.yLabel}</div>
|
|
13460
13498
|
</div>
|
|
13461
|
-
`}};E([d({type:Number})],$.prototype,`xMin`,void 0),E([d({type:Number})],$.prototype,`xMax`,void 0),E([d({type:Number})],$.prototype,`x`,void 0),E([d({type:Number})],$.prototype,`yMin`,void 0),E([d({type:Number})],$.prototype,`yMax`,void 0),E([d({type:Number})],$.prototype,`y`,void 0),E([d({type:String})],$.prototype,`xScale`,void 0),E([d({type:String})],$.prototype,`yScale`,void 0),E([d({type:Number,attribute:`x-snap-step`})],$.prototype,`xSnapStep`,void 0),E([d({type:Number,attribute:`y-snap-step`})],$.prototype,`ySnapStep`,void 0),E([d({type:Number,attribute:`step-x`})],$.prototype,`stepX`,void 0),E([d({type:Number,attribute:`step-y`})],$.prototype,`stepY`,void 0),E([d({type:String})],$.prototype,`xLabel`,void 0),E([d({type:String})],$.prototype,`yLabel`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-crosshairs`})],$.prototype,`showCrosshairs`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-grid`})],$.prototype,`showGrid`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-cursor`})],$.prototype,`hideCursor`,void 0),E([d({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),E([d({type:Number})],$.prototype,`stops`,void 0),E([d({type:Number,attribute:`stops-x`})],$.prototype,`stopsX`,void 0),E([d({type:Number,attribute:`stops-y`})],$.prototype,`stopsY`,void 0),$=E([T(`ixfx-xy-pad`)],$);function
|
|
13499
|
+
`}};E([d({type:Number})],$.prototype,`xMin`,void 0),E([d({type:Number})],$.prototype,`xMax`,void 0),E([d({type:Number})],$.prototype,`x`,void 0),E([d({type:Number})],$.prototype,`yMin`,void 0),E([d({type:Number})],$.prototype,`yMax`,void 0),E([d({type:Number})],$.prototype,`y`,void 0),E([d({type:String})],$.prototype,`xScale`,void 0),E([d({type:String})],$.prototype,`yScale`,void 0),E([d({type:Number,attribute:`x-snap-step`})],$.prototype,`xSnapStep`,void 0),E([d({type:Number,attribute:`y-snap-step`})],$.prototype,`ySnapStep`,void 0),E([d({type:Number,attribute:`step-x`})],$.prototype,`stepX`,void 0),E([d({type:Number,attribute:`step-y`})],$.prototype,`stepY`,void 0),E([d({type:String})],$.prototype,`xLabel`,void 0),E([d({type:String})],$.prototype,`yLabel`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-crosshairs`})],$.prototype,`showCrosshairs`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-grid`})],$.prototype,`showGrid`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-cursor`})],$.prototype,`hideCursor`,void 0),E([d({type:Boolean,reflect:!0})],$.prototype,`disabled`,void 0),E([d({type:Number})],$.prototype,`stops`,void 0),E([d({type:Number,attribute:`stops-x`})],$.prototype,`stopsX`,void 0),E([d({type:Number,attribute:`stops-y`})],$.prototype,`stopsY`,void 0),$=E([T(`ixfx-xy-pad`)],$);function ok(){console.log(`Init`)}export{ke as AcTextElement,qt as AcTokenElement,en as BottomDrawerElement,un as ButtonElement,ur as Checkbox,Sr as CheckedSelect,R as ColourPicker,hg as ColourPickerPopup,z as CrumbNavigationElement,Lg as CrumbPathController,zg as CrumbPathElement,XS as DEFAULT_SIBLING_SPACING,je as DataController,Bg as DataDisplayComponent,B as DataGridElement,h_ as DataTableElement,V as DetailListElement,ky as DockHostElement,Ey as DockPanelElement,fn as EMPTY_GROUP_LABEL,Uy as EditableLabel,Jy as EditableNumber,G as FlatListElement,hb as FormElement,ob as FormGroupElement,cb as FormOptionsElement,ub as FormPartElement,db as FormRowElement,K as GridListElement,Pb as GroupedItemListerElement,J as HyperbolicTreeListElement,nn as ICON_CARET_RIGHT,rn as ICON_CHECK,tn as ICON_CHEVRON_DOWN,an as ICON_CLOSE,XC as IcicleTreeListElement,Ot as IncrSearchMillerController,Ot as IncrSearchTreeController,Kx as IxfxHexEditorElement,Te as IxfxIconElement,Z as IxfxTimelineElement,At as KeyedElementIndex,Un as LIST_ITEM_MOTION_MS,It as LIST_SEARCH_COMMAND_IDS,zt as LIST_SEARCH_MODES,mw as LabelledRadialInput,dg as LabelledRangeInput,Tw as LabelledSliderInput,Ew as LedElement,Hn as ListDragSelectController,S_ as ListGroupHeaderElement,er as ListNativeDragController,Vt as ListSearchController,nr as ListSelectionController,l_ as Menu,Dw as MillerBaseElement,Aw as MillerListElement,jw as MillerTreeController,Vw as MulticolListElement,Fg as NarrowedTextElement,aT as NotificationManager,Hw as NotificationPillElement,d_ as PanTextElement,Mb as PanelElement,uT as PanelGroupElement,EE as PlotDataSeries,X as PlotHistogram,qE as PlotMultiAxis,iD as PlotSingleAxis,aD as PlotXyAxis,hD as PolarPad,pw as RadialInputElement,dn as RadioGroup,CD as RangeElement,vD as RangeInput,SD as RangeMultiElement,wD as RatingElement,TD as SelectHorizElement,OD as ShapefillValueElement,ww as SliderInputElement,ND as SlidingNumberElement,FD as SnackbarElement,ID as SnapContainer,lr as SplitButton,uy as SplitLayoutElement,ly as SplitPanelElement,LD as SwipeElement,zD as TabController,by as TabListElement,Ty as TabListItemElement,RD as TabPanelElement,BD as TabPanelsElement,VD as TextShimmerElement,oe as TickledController,HD as TimelineController,mO as TimelineTrackTabElement,Zt as TitlebarElement,HO as ToolbarElement,LO as ToolbarGroupElement,jE as TooltipElement,UO as TransitoryLabelElement,q as TreeBaseElement,WO as TreeController,Mg as TreeDataModel,Yb as TreeDropController,rr as TreeKeyboardNavController,hx as TreeListElement,Q as TreemapListElement,$O as TwoSplitLayoutElement,W as VerticalListElement,$ as XyPad,gv as addPanelToStack,Xn as animateListItemIn,$n as animateListItemOut,TE as applyAgeModification,ne as applyHighlights,gS as applyIsometry,ty as applySnapshot,Tg as applyTreeDrop,lO as attachTimelineInteractions,Qt as bottomDrawerCommandId,ie as buildHighlightTargets,Wv as buildModel,Tn as captionForEntry,sS as clampToDisk,re as clearHighlights,pv as collectContainerNames,gg as collectDataResult,uv as collectPanelIds,mv as collectStackPaths,_S as composeIsometry,QS as computeCanonicalPositions,wE as computeColour,rC as computeHyperbolicLayout,YC as computeIcicleLayout,Ev as computeLeafGeoms,QO as computeTreemapLayout,wt as createAcCompletionProvider,kt as createDataListSearchAdapter,Bn as createDefaultListDragPreview,Ft as createElementIncrSearch,Mt as createElementListSearchAdapter,tv as createEmptyLayout,ev as createEmptyStack,Ct as createFuzzySearch,Et as createIncrSearch,Jw as createPillRenderer,rv as createSplit,nv as createStack,gx as createTreeListAdapter,Wt as createTreeListSearchAdapter,_x as createVerticalListAdapter,SS as decomposeViewIsometry,pn as defaultGroupLabel,Zv as distribute,Eg as dropTargetFor,dS as euclideanRadiusForHyperbolicDistance,Sv as extractStack,Iv as findEmptiedStacks,US as findHyperbolicIdOf,WS as findHyperbolicKeyPath,GS as findHyperbolicNode,KS as findHyperbolicPath,HS as findHyperbolicPathById,qC as findIcicleNode,JC as findIciclePath,U as findNode,oy as findPanelNode,sv as findParentOf,cv as findStackOf,dv as findStackPathByName,KO as findTreemapNode,qO as findTreemapPath,mS as geodesicInterpolate,wS as geodesicPath,CS as geodesicSegment,Q_ as getActiveDragPanelId,ye as getIcon,be as getIconEntry,Ce as getIconFont,Ov as getLeafNeighbours,xe as hasIcon,BS as hyperbolicBranchId,RS as hyperbolicChildIds,fS as hyperbolicDistanceForEuclideanRadius,zS as hyperbolicIdDepth,tC as hyperbolicRelativeFrame,ge as iconBus,hS as identityIsometry,ok as init,yv as insertBeside,vS as invertIsometry,Z_ as isDragging,VS as isHyperbolicDescendantId,tr as isMultiMode,$_ as isSplit,H as isStack,D as keyForElement,Gn as listItemFadeKeyframes,Ht as listSearchStyles,uS as mobiusAdd,lS as mobiusFromOrigin,cS as mobiusToOrigin,nk as monitorIndeterminate,jv as moveLeafNodeToEdge,Av as moveLeafStep,oS as norm,Xv as normalise,KC as normaliseValue,iv as normalize,sT as panelGapIndex,xE as parseColourScaleAttr,Pv as parseLayout,gn as partitionByGroup,pS as poincareDistance,q_ as pointerOverAnyHost,Wn as prefersReducedMotion,ay as preserveRestoreWeights,wg as pruneDraggedDescendants,bE as readBaseColour,ve as registerFontIcon,_e as registerIcon,Rt as registerListSearchCommands,_v as removePanelFromStack,tO as resolveCssVars,WD as resolveGrid,hn as resolveGroupKey,Tv as resolveLeafPath,Qv as resolveTracks,bS as rotationIsometry,Mv as serializeLayout,vv as setActive,Se as setIconFont,iy as setPanelRestoreWeight,Fv as snapshotNonEmptyStacks,Qn as startListItemOutAnimation,we as svgToDataUri,kv as swapLeaves,C as tickledItemStyles,se as tickledStyles,pO as timelineStyles,mn as toGroupKey,$v as toSnapshot,_n as toggleInSet,zO as toolbarGapIndex,yS as translationFromOrigin,xS as viewIsometry,sy as walk,bv as wrapRoot};
|