@ixfx/components 0.14.0 → 0.14.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle/index.js +56 -56
- package/dist/index.js +36 -12
- package/docs-user/index.json +2 -2
- package/docs-user/multicol-list.md +1 -1
- package/package.json +1 -1
package/bundle/index.js
CHANGED
|
@@ -9947,7 +9947,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
9947
9947
|
}
|
|
9948
9948
|
|
|
9949
9949
|
|
|
9950
|
-
`]}};ew=E([T(`ixfx-miller-list`)],ew);var tw=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}}};const
|
|
9950
|
+
`]}};ew=E([T(`ixfx-miller-list`)],ew);var tw=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 nw(e){return e.children!==void 0&&e.children.length>0}function rw(e){return e.flatMap(e=>nw(e)?rw(e.children):[e])}function iw(e,n){for(let r of e){if(r.key===n)return r;let e=r.children?iw(r.children,n):void 0;if(e)return e}}function aw(e,n){return rw(e).find(e=>e.key===n)}const ow=`__all__`;function sw(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 cw(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 lw=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,width:220}}get state(){return this.getState()}get categoryKey(){return this.#e.key}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},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=ow,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=()=>Vb(uw,{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 dg(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=sw(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!==ow);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!==ow);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 uw(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}ge(`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"><path d="M4 12h16"/><path d="M4 18h16"/><path d="M4 6h16"/></svg>`);let dw=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,Yt,r`
|
|
9951
9951
|
:host {
|
|
9952
9952
|
--multicol-list-bg: var(--surface-3);
|
|
9953
9953
|
--multicol-list-header-bg: var(--surface-2);
|
|
@@ -10136,12 +10136,12 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10136
10136
|
margin-left: var(--space-s);
|
|
10137
10137
|
font-size: var(--text-s);
|
|
10138
10138
|
}
|
|
10139
|
-
`]}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=this.categories
|
|
10139
|
+
`]}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=aw(this.categories,i.categoryKey);n&&e.setCategory(n)}e.updateState(i),r.push(e),n.delete(i.id);continue}let a=aw(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=aw(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`
|
|
10140
10140
|
<div id="container">
|
|
10141
10141
|
${_(this._columns,e=>e.id,(e,n)=>this._renderColumn(e,n))}
|
|
10142
10142
|
${this._dropCaretX===void 0?a:i`<div class="drop-caret" style="left: ${this._dropCaretX}px"></div>`}
|
|
10143
10143
|
</div>
|
|
10144
|
-
`}updated(e){if(!this._autoSeeded&&this._columns.length===0&&
|
|
10144
|
+
`}updated(e){let n=rw(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,a=Number.isFinite(r)?r:220;return i`
|
|
10145
10145
|
<div
|
|
10146
10146
|
class="column"
|
|
10147
10147
|
data-col-id="${e.id}"
|
|
@@ -10178,7 +10178,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10178
10178
|
</div>
|
|
10179
10179
|
<div class="lister-host"></div>
|
|
10180
10180
|
</div>
|
|
10181
|
-
`}_getCategoryLabel(e){return this.categories
|
|
10181
|
+
`}_getCategoryLabel(e){return iw(this.categories,e)?.label??e}_getCategoryTooltip(e){return iw(this.categories,e)?.description??`Change category`}#e(e,n){return new lw({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=zg({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=cw(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=e_(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=rw(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=aw(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=rw(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})],dw.prototype,`categories`,void 0),E([d({attribute:!1})],dw.prototype,`dataProvider`,void 0),E([d({type:String,attribute:`selection-mode`})],dw.prototype,`selectionMode`,void 0),E([d({type:Number})],dw.prototype,`minColumns`,void 0),E([d({type:Number})],dw.prototype,`maxColumns`,void 0),E([m()],dw.prototype,`_columns`,void 0),E([m()],dw.prototype,`_colOffsets`,void 0),E([m()],dw.prototype,`_resizingColumnId`,void 0),E([m()],dw.prototype,`_draggingColumnId`,void 0),E([m()],dw.prototype,`_dropCaretX`,void 0),E([f(`#container`)],dw.prototype,`_containerEl`,void 0),dw=E([T(`ixfx-multicol-list`)],dw);let fw=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>`:be(this.icon)?i`<ixfx-icon class="pill-icon" name="${this.icon}"></ixfx-icon>`:a:a}render(){return i`
|
|
10182
10182
|
<button
|
|
10183
10183
|
type="button"
|
|
10184
10184
|
class="pill"
|
|
@@ -10261,7 +10261,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10261
10261
|
transform: none !important;
|
|
10262
10262
|
}
|
|
10263
10263
|
}
|
|
10264
|
-
`]}};E([d({type:String,attribute:`notification-type`})],
|
|
10264
|
+
`]}};E([d({type:String,attribute:`notification-type`})],fw.prototype,`notificationType`,void 0),E([d({type:String})],fw.prototype,`message`,void 0),E([d({type:String})],fw.prototype,`icon`,void 0),E([d({type:Boolean,reflect:!0})],fw.prototype,`dismissing`,void 0),E([d({type:String,attribute:`notification-id`})],fw.prototype,`notificationId`,void 0),fw=E([T(`ixfx-notification-pill`)],fw);function pw(e){return{vertical:e.startsWith(`top`)?`top`:`bottom`,horizontal:e.endsWith(`-left`)?`left`:e.endsWith(`-right`)?`right`:`middle`}}function mw(e,n){let{vertical:r,horizontal:i}=pw(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 hw(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 gw(e,n,r){return e.horizontal===`middle`?`translateX(-50%) translate(${n}px, ${r}px)`:`translate(${n}px, ${r}px)`}function _w(e={}){let n=e.position??`top-right`,r=e.queueDisplay??`list`,i=e.safeArea??{},a=pw(n),o=null,s=null,c=new Map,l=40,u=!1;function d(){return o||(o=document.createElement(`div`),o.className=`ixfx-notification-container`,o.setAttribute(`role`,`region`),o.setAttribute(`aria-label`,`Notifications`),document.body.appendChild(o),o)}function f(e,n){e.setAttribute(`notification-type`,n.type),e.setAttribute(`message`,n.message),n.icon?e.setAttribute(`icon`,n.icon):e.removeAttribute(`icon`)}function p(e){let r=document.createElement(`ixfx-notification-pill`);return r.setAttribute(`notification-id`,e.id),r.style.cssText=mw(n,i),f(r,e),r.style.opacity=`0`,r.style.transform=hw(a),r.addEventListener(`pill-tap`,e=>{let n=e;s?.onTap(n.detail.id)}),r}function m(e){u||requestAnimationFrame(()=>{let n=e.getBoundingClientRect().height;n>0&&(l=n,u=!0)})}function h(e){let n=e.length;e.forEach((e,i)=>{let o=c.get(e.id);if(!o)return;let s=o.element,u=0,d=0,f=1,p=`auto`,m=`none`;if(r===`list`){let e=i*(l+8);d=a.vertical===`top`?e:-e}else{let e=i*4;if(d=a.vertical===`top`?e:-e,u=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=gw(a,u,d)})}function g(e){let n=c.get(e);if(!n)return;let r=n.element;r.setAttribute(`dismissing`,`true`);let i=()=>{r.removeEventListener(`transitionend`,i),r.remove(),c.delete(e),o&&c.size===0&&(o.remove(),o=null,u=!1,l=40)};r.addEventListener(`transitionend`,i),setTimeout(i,300)}function _(e,n){let r=d(),i=new Set(e.map(e=>e.id));for(let n of e){let e=c.get(n.id);if(e){e.notification=n,f(e.element,n);continue}let i=p(n);c.set(n.id,{element:i,notification:n}),r.appendChild(i),m(i)}for(let[e]of c)i.has(e)||g(e);requestAnimationFrame(()=>h(e))}return{attach(e){s=e},detach(){for(let[e]of c)g(e);o&&=(o.remove(),null)},setNotifications:_}}const vw={renderer:void 0,timeout:4e3,timeoutError:8e3,queue:!0,queueSize:3,tapBehaviour:`dismiss`,tapHandlerDefault:void 0},yw=[];let bw=null,xw=null;function Sw(){return xw??=_w({position:`top-right`}),xw}function Cw(){return bw??Sw()}function ww(){Cw().setNotifications([...yw],vw.queueSize)}function Tw(e){e.timer!==null&&(clearTimeout(e.timer),e.timer=null)}function Ew(e){let n=e.type===`error`?vw.timeoutError:vw.timeout,r=e.wasQueued?n/vw.queueSize:n;e.timer=window.setTimeout(kw,r,e.id)}function Dw(){let e=yw[0];e&&e.timer===null&&Ew(e)}const Ow={configure(e){if(e.renderer!==void 0&&(bw?.detach?.(),bw=e.renderer,bw.attach({onTap(e){let n=yw.find(n=>n.id===e);n&&(n.onTap?n.onTap(e):vw.tapHandlerDefault?.(n),vw.tapBehaviour===`dismiss`&&kw(e))}}),ww()),e.timeout!==void 0&&(vw.timeout=e.timeout),e.timeoutError!==void 0&&(vw.timeoutError=e.timeoutError),e.queue!==void 0&&(vw.queue=e.queue),e.queueSize!==void 0){for(vw.queueSize=Math.max(1,e.queueSize);yw.length>vw.queueSize;)Tw(yw.shift());Dw(),ww()}e.tapBehaviour!==void 0&&(vw.tapBehaviour=e.tapBehaviour),e.tapHandlerDefault!==void 0&&(vw.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(vw.queue)yw.length>=vw.queueSize&&Tw(yw.shift()),a.wasQueued=yw.length>0,yw.push(a);else{for(;yw.length>0;)Tw(yw.pop());yw.push(a)}return Dw(),ww(),n},update(e,n){let r=yw.find(n=>n.id===e);r&&(Object.assign(r,n),r.updatedAt=Date.now(),yw[0]===r&&(Tw(r),Ew(r)),ww())},dismiss(e){kw(e)},dismissAll(){for(let e of yw)Tw(e);yw.length=0,ww()}};function kw(e){let n=yw.findIndex(n=>n.id===e);n!==-1&&(Tw(yw.splice(n,1)[0]),Dw(),ww())}function Aw(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 jw=!1;function Mw(){if(jw)return;jw=!0;let e=document.createElement(`style`);e.textContent=`
|
|
10265
10265
|
.ixfx-drag-ghost.ixfx-panel-group-ghost {
|
|
10266
10266
|
padding: var(--space-s, 8px) var(--space-m, 16px);
|
|
10267
10267
|
background: var(--surface-4);
|
|
@@ -10280,7 +10280,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10280
10280
|
height: 1.25em;
|
|
10281
10281
|
flex-shrink: 0;
|
|
10282
10282
|
}
|
|
10283
|
-
`,document.head.appendChild(e)}let
|
|
10283
|
+
`,document.head.appendChild(e)}let Nw=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._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`))&&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),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 Mw(),zg({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 Aw(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`
|
|
10284
10284
|
<slot
|
|
10285
10285
|
@toggle=${this._onPanelToggle}
|
|
10286
10286
|
@slotchange=${this._onSlotChange}
|
|
@@ -10344,7 +10344,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10344
10344
|
pointer-events: none;
|
|
10345
10345
|
z-index: 1;
|
|
10346
10346
|
}
|
|
10347
|
-
`}};E([d({type:String,reflect:!0})],
|
|
10347
|
+
`}};E([d({type:String,reflect:!0})],Nw.prototype,`orientation`,void 0),E([d({type:String})],Nw.prototype,`variant`,void 0),E([d({type:String,attribute:`toggle-interaction`})],Nw.prototype,`toggleInteraction`,void 0),E([d({type:Boolean})],Nw.prototype,`collapsible`,void 0),E([d({type:Boolean,attribute:`accordion`,reflect:!0})],Nw.prototype,`accordion`,void 0),E([d({type:Boolean,attribute:`allow-reorder`,reflect:!0})],Nw.prototype,`allowReorder`,void 0),E([d()],Nw.prototype,`gap`,void 0),E([p({slot:``})],Nw.prototype,`_panels`,void 0),Nw=E([T(`ixfx-panel-group`)],Nw);var Pw=Object.defineProperty,Fw=(e,n)=>{let r={};for(var i in e)Pw(r,i,{get:e[i],enumerable:!0});return n||Pw(r,Symbol.toStringTag,{value:`Module`}),r};const Iw=Math.pow,Lw=1/Math.sqrt(2*Math.PI),Rw=(e=.4)=>n=>{let r=Lw/e,i=-2.5,a=(n-.5)/e;a*=a,i*=a;let o=r*Iw(Math.E,i);return o>1?1:o<0?0:o};var zw=Fw({arch:()=>Jw,backIn:()=>pT,backInOut:()=>gT,backOut:()=>mT,bell:()=>bT,bounceIn:()=>yT,bounceInOut:()=>ST,bounceOut:()=>Gw,circIn:()=>dT,circInOut:()=>hT,circOut:()=>fT,cubicIn:()=>rT,cubicOut:()=>iT,elasticIn:()=>_T,elasticInOut:()=>xT,elasticOut:()=>vT,expoIn:()=>sT,expoInOut:()=>uT,expoOut:()=>cT,quadIn:()=>$w,quadInOut:()=>nT,quadOut:()=>eT,quartIn:()=>aT,quartOut:()=>oT,quintIn:()=>Kw,quintInOut:()=>lT,quintOut:()=>qw,sineIn:()=>Zw,sineInOut:()=>tT,sineOut:()=>Qw,smootherstep:()=>Xw,smoothstep:()=>Yw});const Bw=Math.sqrt,Vw=Math.pow,Hw=Math.cos,Uw=Math.PI,Ww=Math.sin,Gw=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},Kw=e=>e*e*e*e*e,qw=e=>1-Vw(1-e,5),Jw=e=>e*(1-e)*4,Yw=e=>e*e*(3-2*e),Xw=e=>(e*(e*6-15)+10)*e*e*e,Zw=e=>1-Hw(e*Uw/2),Qw=e=>Ww(e*Uw/2),$w=e=>e*e,eT=e=>1-(1-e)*(1-e),tT=e=>-(Hw(Uw*e)-1)/2,nT=e=>e<.5?2*e*e:1-Vw(-2*e+2,2)/2,rT=e=>e*e*e,iT=e=>1-Vw(1-e,3),aT=e=>e*e*e*e,oT=e=>1-Vw(1-e,4),sT=e=>e===0?0:Vw(2,10*e-10),cT=e=>e===1?1:1-Vw(2,-10*e),lT=e=>e<.5?16*e*e*e*e*e:1-Vw(-2*e+2,5)/2,uT=e=>e===0?0:e===1?1:e<.5?Vw(2,20*e-10)/2:(2-Vw(2,-20*e+10))/2,dT=e=>1-Bw(1-Vw(e,2)),fT=e=>Bw(1-Vw(e-1,2)),pT=e=>2.70158*e*e*e-1.70158*e*e,mT=e=>1+2.70158*Vw(e-1,3)+1.70158*Vw(e-1,2),hT=e=>e<.5?(1-Bw(1-Vw(2*e,2)))/2:(Bw(1-Vw(-2*e+2,2))+1)/2,gT=e=>{let n=2.5949095;return e<.5?Vw(2*e,2)*(7.189819*e-n)/2:(Vw(2*e-2,2)*(3.5949095*(e*2-2)+n)+2)/2},_T=e=>{let n=2*Uw/3;return e===0?0:e===1?1:-Vw(2,10*e-10)*Ww((e*10-10.75)*n)},vT=e=>{let n=2*Uw/3;return e===0?0:e===1?1:Vw(2,-10*e)*Ww((e*10-.75)*n)+1},yT=e=>1-Gw(1-e),bT=Rw(),xT=e=>{let n=2*Uw/4.5;return e===0?0:e===1?1:e<.5?-(Vw(2,20*e-10)*Ww((20*e-11.125)*n))/2:Vw(2,-20*e+10)*Ww((20*e-11.125)*n)/2+1},ST=e=>e<.5?(1-Gw(1-2*e))/2:(1+Gw(2*e-1))/2,CT=(e=0,n=0)=>{let r={x:oi(e,-1,1,0,1),y:oi(e,-1,1,1,0)},i=Nd.interpolate(Math.abs(e),Nd.Empty,r);e!==0&&n>0&&(i=e>0?Nd.interpolate(n,i,{x:0,y:r.x*2}):Nd.interpolate(n,i,{x:r.y*2,y:0}));let a=Ba.cubic(Nd.Empty,Nd.Unit,i,r),o=Ba.interpolator(a);return e=>o(e)},wT=(e,n)=>{O(Pr(e,`fn`));let r;return()=>(r===void 0&&(r=Tu(n,{clampValue:!0})),e(r()))},TT=(e,n)=>{O(Pr(e,`fn`));let r=Au(),i=Ao(n);if(i===void 0)throw Error(`Param 'duration' not provided`);let a=ku(i,{timer:r,clampValue:!0});return Mu(e,a)},ET=(e,n)=>{O(Pr(e,`fn`));let r;return()=>(r===void 0&&(r=Eu(n,{clampValue:!0})),e(r()))},DT=(e,n)=>{O(Pr(e,`fn`));let r=ju(),i=ku(n,{timer:r,clampValue:!0});return Mu(e,i)};var OT=Fw({Named:()=>zw,create:()=>kT,get:()=>IT,getEasingNames:()=>RT,line:()=>CT,tickEasing:()=>NT,ticks:()=>MT,time:()=>jT,timeEasing:()=>AT});const kT=e=>{let n=PT(e.name??`quintIn`)??e.fn;if(n===void 0)throw Error(`Either 'name' or 'fn' must be set`);if(`duration`in e)return jT(n,e.duration);if(`ticks`in e)return MT(n,e.ticks);throw Error(`Expected 'duration' or 'ticks' in options`)},AT=(e,n)=>TT(PT(e),n),jT=(e,n)=>wT(PT(e),n),MT=(e,n)=>ET(PT(e),n),NT=(e,n)=>DT(PT(e),n),PT=e=>{let n=typeof e==`function`?e:IT(e);if(n===void 0)throw Error(typeof e==`string`?`Easing function not found: '${e}'`:`Easing function not found`);return n};let FT;const IT=function(e){O(Fr(e,`non-empty`,`easingName`));let n=LT().get(e.toLowerCase());if(n===void 0)throw Error(`Easing not found: '${e}'`);return n};function LT(){if(FT===void 0){FT=new Map;for(let[e,n]of Object.entries(zw))FT.set(e.toLowerCase(),n);return FT}return FT}function*RT(){yield*LT().keys()}const zT=[`green`,`yellow`,`red`],BT=new Map;function VT(e){let n=e.join(`\0`);return BT.has(n)||BT.set(n,eg.scale(e,{stepsBetween:99})),BT.get(n)}function HT(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 UT(e){return HT(e,`--plot-color`)||`oklch(60% 0.15 140)`}function WT(e){if(!e.trim())return zT;let n=e.split(`,`).map(e=>e.trim()).filter(Boolean);return n.length>=2?n:zT}function GT(e){try{let n=eg.HslSpace.fromCss(e,{scalar:!0});return{h:n.h,s:n.s,l:n.l}}catch{return{h:.39,s:.5,l:.55}}}function KT(e,n){let r=Math.max(0,Math.min(1,e));if(n.easingName)try{return Math.max(0,Math.min(1,OT.get(n.easingName)(r)))}catch{}return n.valueMap?Math.max(0,Math.min(1,n.valueMap(r))):r}function qT(e,n,r){let i=KT(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=GT(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=GT(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=GT(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=VT(r.palette.length>=2?r.palette:zT);return{fill:e[Math.min(e.length-1,Math.floor(i*e.length))],opacity:1}}default:return{fill:n,opacity:1}}}function JT(e,n,r){if(r===`opacity`)return{...e,opacity:e.opacity*Math.max(.08,n**.6)};if(r===`desaturation`){let r=GT(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 YT=class{#e;#t;#n;#r;constructor(e={}){this.values=[],this.#e=ui(),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=ui());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 XT(e){if(typeof e==`number`)return!0;if(typeof e!=`string`)return!1;let n=e.trim();return n!==``&&!Number.isNaN(Number(n))}var ZT;let QT=!1;function $T(){if(QT)return;QT=!0;let e=document.createElement(`style`);e.textContent=`
|
|
10348
10348
|
ixfx-tooltip {
|
|
10349
10349
|
display: inline-block;
|
|
10350
10350
|
background: var(--surface-5);
|
|
@@ -10359,7 +10359,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10359
10359
|
ixfx-tooltip .tooltip-type-number {
|
|
10360
10360
|
font-family: var(--font-mono, ui-monospace, monospace);
|
|
10361
10361
|
}
|
|
10362
|
-
`,document.head.appendChild(e)}let
|
|
10362
|
+
`,document.head.appendChild(e)}let eE=class extends n{static{ZT=this}constructor(...e){super(...e),this.valueFormatTooltip=ZT.defaultFormatter,this.orientation=`top`,this.anchor=`--tooltip`}connectedCallback(){super.connectedCallback(),$T()}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>`:be(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`:XT(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})],eE.prototype,`orientation`,void 0),E([d({type:String})],eE.prototype,`anchor`,void 0),E([d()],eE.prototype,`value`,void 0),E([d({type:String})],eE.prototype,`icon`,void 0),eE=ZT=E([T(`ixfx-tooltip`)],eE);let tE=null,nE=null;function rE(){if(tE)return tE;let e=document.createElement(`div`);return e.style.cssText=`
|
|
10363
10363
|
position: fixed;
|
|
10364
10364
|
pointer-events: none;
|
|
10365
10365
|
z-index: 9999;
|
|
@@ -10373,13 +10373,13 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10373
10373
|
font-family: ui-monospace, monospace;
|
|
10374
10374
|
opacity: 0;
|
|
10375
10375
|
transition: opacity 0.1s ease;
|
|
10376
|
-
`,document.body.appendChild(e),
|
|
10376
|
+
`,document.body.appendChild(e),tE=e,e}function iE(e,n,r,i){let a=rE();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 aE(e,n,r,i){let a=rE();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 oE(e){if(nE!==e)return;let n=rE();n.style.opacity=`0`,nE=null}let sE=null,cE=null;function lE(){if(sE)return sE;let e=document.createElement(`ixfx-tooltip`);return e.style.cssText=`
|
|
10377
10377
|
position: fixed;
|
|
10378
10378
|
z-index: 9999;
|
|
10379
10379
|
pointer-events: none;
|
|
10380
10380
|
opacity: 0;
|
|
10381
10381
|
transition: opacity 0.12s ease;
|
|
10382
|
-
`,document.body.appendChild(e),
|
|
10382
|
+
`,document.body.appendChild(e),sE=e,e}function uE(e,n,r,i,a){let o=lE();cE=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 dE(e){if(cE!==e)return;let n=lE();n.style.opacity=`0`,cE=null}function fE(e,n){return Math.max(1,Math.min(e,n)/25)}function pE(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 mE(e,n,r){let i=r-n;return i===0?.5:(e-n)/i}const hE=[`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 gE=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%hE.length;n.style.setProperty(`--plot-color`,hE[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){oE(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){oE(this);return}aE(this,e,n,i.join(`<br>`))}#s(){oE(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`
|
|
10383
10383
|
<div
|
|
10384
10384
|
id="container"
|
|
10385
10385
|
class="layout layout-${this.layout}"
|
|
@@ -10435,7 +10435,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10435
10435
|
grid-template-columns: repeat(auto-fill, minmax(var(--grid-min-width, 200px), 1fr));
|
|
10436
10436
|
gap: var(--space-s, 4px);
|
|
10437
10437
|
}
|
|
10438
|
-
`}};E([d()],
|
|
10438
|
+
`}};E([d()],gE.prototype,`layout`,void 0),E([d({attribute:`grid-min-width`,type:Number})],gE.prototype,`gridMinWidth`,void 0),gE=E([T(`ixfx-plot-multi-axis`)],gE);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 YT({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 YT({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,dE(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);uE(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,dE(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){uE(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,uE(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`
|
|
10439
10439
|
<rect class="bar" x=${e.x} y=${e.y} width=${e.width} height=${e.height}
|
|
10440
10440
|
style="--value: ${e.relativeValue}; ${r}"
|
|
10441
10441
|
@click=${()=>this.#o(n,e.valueMin,e.valueMax,e.relativeValue)} />
|
|
@@ -10484,37 +10484,37 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10484
10484
|
dominant-baseline: hanging;
|
|
10485
10485
|
pointer-events: none;
|
|
10486
10486
|
}
|
|
10487
|
-
`}};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
|
|
10488
|
-
d=${
|
|
10487
|
+
`}};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 _E(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 vE(e,n,r,i){return s`<path
|
|
10488
|
+
d=${_E(e)}
|
|
10489
10489
|
fill="none"
|
|
10490
10490
|
stroke=${n.fill}
|
|
10491
10491
|
stroke-width=${r}
|
|
10492
10492
|
opacity=${n.opacity}
|
|
10493
10493
|
stroke-linecap=${i?`round`:`butt`}
|
|
10494
10494
|
stroke-linejoin=${i?`round`:`miter`}
|
|
10495
|
-
/>`}function
|
|
10495
|
+
/>`}function yE(e,n,r,i){if(e.length<2)return s``;let a=_E(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 bE(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 xE(e,n,r,i){return e.map((e,a)=>{let o=i===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10496
10496
|
x=${e.x-o/2} y=${e.y-o/2}
|
|
10497
10497
|
width=${o} height=${o}
|
|
10498
10498
|
fill=${n[a].fill} opacity=${n[a].opacity}
|
|
10499
|
-
/>`})}function
|
|
10499
|
+
/>`})}function SE(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<line
|
|
10500
10500
|
x1=${e.x} y1=${i} x2=${e.x} y2=${e.y}
|
|
10501
10501
|
stroke=${n[o].fill} stroke-width=${c} opacity=${n[o].opacity}
|
|
10502
|
-
/>`})}function
|
|
10502
|
+
/>`})}function CE(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?i*Math.max(.2,e.ageFraction):i;return s`<line
|
|
10503
10503
|
x1=${e.x-c/2} y1=${e.y} x2=${e.x+c/2} y2=${e.y}
|
|
10504
10504
|
stroke=${n[o].fill} stroke-width=${r} opacity=${n[o].opacity}
|
|
10505
|
-
/>`})}function
|
|
10505
|
+
/>`})}function wE(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10506
10506
|
x=${e.x-c/2} y=${e.y}
|
|
10507
10507
|
width=${c} height=${Math.max(1,i-e.y)}
|
|
10508
10508
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
10509
|
-
/>`})}function
|
|
10509
|
+
/>`})}function TE(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10510
10510
|
x=${e.x-c/2} y=${i}
|
|
10511
10511
|
width=${c} height=${Math.max(1,e.y-i)}
|
|
10512
10512
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
10513
|
-
/>`})}function
|
|
10513
|
+
/>`})}function EE(e,n,r,i,a){return e.map((e,o)=>{let c=a===`size`?r*Math.max(.2,e.ageFraction):r;return s`<rect
|
|
10514
10514
|
x=${e.x-c/2} y=${Math.min(e.y,i)}
|
|
10515
10515
|
width=${c} height=${Math.max(1,Math.abs(e.y-i))}
|
|
10516
10516
|
fill=${n[o].fill} opacity=${n[o].opacity}
|
|
10517
|
-
/>`})}let
|
|
10517
|
+
/>`})}let DE=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 YT,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,oE(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 YT({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){oE(this);return}iE(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=$r(mE(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[yE(e,l,o,d),this.drawStyle===`line-sharp`?vE(e,l,r,!1):vE(e,l,r,!0)];switch(this.drawStyle){case`line-sharp`:return[vE(e,l,r,!1)];case`line-round`:return[vE(e,l,r,!0)];case`circles`:return bE(e,n,i,this.ageStyle);case`squares`:return xE(e,n,i*2,this.ageStyle);case`vbar`:return SE(e,n,r,o,this.ageStyle);case`hbar`:return CE(e,n,r,a,this.ageStyle);case`hist-bottom`:return wE(e,n,a,o,this.ageStyle);case`hist-top`:return TE(e,n,a,s,this.ageStyle);case`hist-middle`:return EE(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=fE(r,a),m=pE(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?UT(this):``,y={mode:this.colorMode,palette:WT(this.colorScale),easingName:this.colorEasing,valueMap:this.colorValueMap},b=this.drawStyle!==`line-sharp`&&this.drawStyle!==`line-round`,x=_.map(e=>{let n=qT(e.scaledValue,v,y);return b?JT(n,e.ageFraction,this.ageStyle):n}),S=_.length>0?this.#f(_,x,p,m,h,u,d,f):[],ee=this.title?s`<text
|
|
10518
10518
|
x=${o+2} y=${d+Math.min(10,a*.6)}
|
|
10519
10519
|
class="overlay-text"
|
|
10520
10520
|
fill=${g}
|
|
@@ -10560,7 +10560,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10560
10560
|
dominant-baseline: hanging;
|
|
10561
10561
|
pointer-events: none;
|
|
10562
10562
|
}
|
|
10563
|
-
`}};E([d({attribute:`draw-style`})],
|
|
10563
|
+
`}};E([d({attribute:`draw-style`})],DE.prototype,`drawStyle`,void 0),E([d({attribute:`age-style`})],DE.prototype,`ageStyle`,void 0),E([d()],DE.prototype,`title`,void 0),E([d({type:Boolean})],DE.prototype,`precise`,void 0),E([d({type:Boolean})],DE.prototype,`tooltips`,void 0),E([d({type:Number})],DE.prototype,`capacity`,void 0),E([d({type:Number})],DE.prototype,`rangeMin`,void 0),E([d({type:Number})],DE.prototype,`rangeMax`,void 0),E([d({type:Boolean,attribute:`persistent-scale`})],DE.prototype,`persistentScale`,void 0),E([d({type:Boolean,reflect:!0})],DE.prototype,`paused`,void 0),E([d({type:Boolean,attribute:`click-pauses`})],DE.prototype,`clickPauses`,void 0),E([d({type:Boolean,attribute:`shaded`})],DE.prototype,`shaded`,void 0),E([d({attribute:`area-color`})],DE.prototype,`areaColor`,void 0),E([d({attribute:`color-mode`})],DE.prototype,`colorMode`,void 0),E([d({attribute:`color-easing`})],DE.prototype,`colorEasing`,void 0),E([d({attribute:`color-scale`})],DE.prototype,`colorScale`,void 0),E([m()],DE.prototype,`_width`,void 0),E([m()],DE.prototype,`_height`,void 0),DE=E([T(`ixfx-plot-single-axis`)],DE);let OE=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 YT({capacityLimit:100,persistentScaling:!0}),this.#t=new YT({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,oE(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 YT(e),this.#t=new YT(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+mE(i[f],s,c)*n,y:e+(1-mE(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:WT(this.colorScale),easingName:this.colorEasing,valueMap:this.colorValueMap};return e.map(e=>JT(qT(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){oE(this);return}iE(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?UT(this):``,u=this.#r(c,l),d=pE(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
|
|
10564
10564
|
x=${r+2} y=${r+2}
|
|
10565
10565
|
class="overlay-text"
|
|
10566
10566
|
fill=${f}
|
|
@@ -10605,7 +10605,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10605
10605
|
dominant-baseline: hanging;
|
|
10606
10606
|
pointer-events: none;
|
|
10607
10607
|
}
|
|
10608
|
-
`}};E([d({attribute:`draw-style`})],
|
|
10608
|
+
`}};E([d({attribute:`draw-style`})],OE.prototype,`drawStyle`,void 0),E([d({attribute:`age-style`})],OE.prototype,`ageStyle`,void 0),E([d()],OE.prototype,`title`,void 0),E([d({type:Boolean})],OE.prototype,`precise`,void 0),E([d({type:Boolean})],OE.prototype,`tooltips`,void 0),E([d({type:Number})],OE.prototype,`capacity`,void 0),E([d({type:Boolean,attribute:`persistent-scale`})],OE.prototype,`persistentScale`,void 0),E([d({type:Boolean,reflect:!0})],OE.prototype,`paused`,void 0),E([d({type:Boolean,attribute:`click-pauses`})],OE.prototype,`clickPauses`,void 0),E([d({attribute:`color-mode`})],OE.prototype,`colorMode`,void 0),E([d({attribute:`color-easing`})],OE.prototype,`colorEasing`,void 0),E([d({attribute:`color-scale`})],OE.prototype,`colorScale`,void 0),E([m()],OE.prototype,`_width`,void 0),E([m()],OE.prototype,`_height`,void 0),OE=E([T(`ixfx-plot-xy-axis`)],OE);const kE=Math.PI/180,AE=180/Math.PI;function jE(e,n){let r=n*50;return{x:50+Math.cos(e)*r,y:50+Math.sin(e)*r}}function ME(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 NE=e=>Math.max(0,Math.min(1,e));function PE(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 FE(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 IE(e,n){if(!n||n<=1)return e;let r=360/n,i=(e%360+360)%360;return Math.round(i/r)*r}function LE(e,n){if(!n||n<=1)return e;let r=1/n;return Math.round(e/r)*r}let RE=class extends Oy(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=Dy(360,n,this.stepAngle,e),a=Dy(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=PE(o,this._prevAngle,this.rays,this.snapValue),l=FE(s,this._prevRadius,this.rings,this.snapValue);c=IE(c,n),l=LE(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=[sn,w,r`
|
|
10609
10609
|
:host {
|
|
10610
10610
|
display: block;
|
|
10611
10611
|
width: 200px;
|
|
@@ -10738,7 +10738,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10738
10738
|
stroke: var(--accent);
|
|
10739
10739
|
stroke-width: 3;
|
|
10740
10740
|
}
|
|
10741
|
-
`]}_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}=
|
|
10741
|
+
`]}_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}=ME((e.clientX-r.left)/i*100,(e.clientY-r.top)/i*100),s=a*AE,c=NE(o);this._prevAngle=this.angle,this._prevRadius=this.radius;let l=PE(s,this._prevAngle,this.rays,this.snapValue),u=FE(c,this._prevRadius,this.rings,this.snapValue),d=this.stopsAngle??this.stops,f=this.stopsRadius??this.stops;this.angle=IE(l,d),this.radius=LE(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=Dy(1,r,this.stepRadius,n);this._prevRadius=this.radius;let a=LE(FE(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*kE}`),this.style.setProperty(`--radius-pct`,`${NE(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}=jE(this.angle*kE,NE(this.radius));return i`
|
|
10742
10742
|
<div class="polar-pad-area"
|
|
10743
10743
|
@pointerdown=${this._onPointerDown}
|
|
10744
10744
|
@keydown=${this._onKeyDown}
|
|
@@ -10777,7 +10777,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10777
10777
|
/>
|
|
10778
10778
|
</svg>
|
|
10779
10779
|
</div>
|
|
10780
|
-
`}};E([d({type:Number})],
|
|
10780
|
+
`}};E([d({type:Number})],RE.prototype,`angle`,void 0),E([d({type:Number})],RE.prototype,`radius`,void 0),E([d({type:Number})],RE.prototype,`rings`,void 0),E([d({type:Number})],RE.prototype,`rays`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-ray`})],RE.prototype,`showRay`,void 0),E([d({type:Boolean,reflect:!0,attribute:`show-origin`})],RE.prototype,`showOrigin`,void 0),E([d({type:Boolean,reflect:!0,attribute:`hide-cursor`})],RE.prototype,`hideCursor`,void 0),E([d({type:Boolean,attribute:`snap-value`,reflect:!0})],RE.prototype,`snapValue`,void 0),E([d({type:Boolean,reflect:!0})],RE.prototype,`disabled`,void 0),E([d({type:Number})],RE.prototype,`stops`,void 0),E([d({type:Number,attribute:`stops-angle`})],RE.prototype,`stopsAngle`,void 0),E([d({type:Number,attribute:`stops-radius`})],RE.prototype,`stopsRadius`,void 0),E([d({type:Number,attribute:`step-angle`})],RE.prototype,`stepAngle`,void 0),E([d({type:Number,attribute:`step-radius`})],RE.prototype,`stepRadius`,void 0),RE=E([T(`ixfx-polar-pad`)],RE);const zE=r`
|
|
10781
10781
|
|
|
10782
10782
|
output.tooltip {
|
|
10783
10783
|
user-select: none;
|
|
@@ -10874,7 +10874,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10874
10874
|
100% calc(50% + var(--b)/2));
|
|
10875
10875
|
}
|
|
10876
10876
|
}
|
|
10877
|
-
`;function
|
|
10877
|
+
`;function BE(e,n,r){return r===n?0:(e-n)/(r-n)}let VE=class extends Oy(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(BE(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(BE(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(BE(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,BE(n,this.min,this.max));let r=this.step>=1?0:this.step>=.1?1:2;return n.toFixed(r)})}_formatTooltipLabel(){let e=BE(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`
|
|
10878
10878
|
<ixfx-tooltip
|
|
10879
10879
|
style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)"
|
|
10880
10880
|
.orientation=${this.tooltipOrientation}
|
|
@@ -10894,7 +10894,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
10894
10894
|
@change=${this._handleChange}
|
|
10895
10895
|
>${e}
|
|
10896
10896
|
</div>
|
|
10897
|
-
`}static{this.styles=[w,
|
|
10897
|
+
`}static{this.styles=[w,zE,r`
|
|
10898
10898
|
:host {
|
|
10899
10899
|
display: block;
|
|
10900
10900
|
container-type: size;
|
|
@@ -11174,14 +11174,14 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11174
11174
|
:host([swipeable][orientation="vertical"]):hover .range-bg {
|
|
11175
11175
|
background: var(--background-track-hover-vertical, var(--_bg-track-hover));
|
|
11176
11176
|
}
|
|
11177
|
-
`]}};E([d({type:Number})],
|
|
11177
|
+
`]}};E([d({type:Number})],VE.prototype,`min`,void 0),E([d({type:Number})],VE.prototype,`max`,void 0),E([d({type:Number})],VE.prototype,`value`,void 0),E([d({type:Number})],VE.prototype,`step`,void 0),E([d({type:String,reflect:!0})],VE.prototype,`orientation`,void 0),E([d({type:Boolean,reflect:!0})],VE.prototype,`swipeable`,void 0),E([d({type:Boolean})],VE.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],VE.prototype,`tooltipOrientation`,void 0),E([d({attribute:!1})],VE.prototype,`labelFormatter`,void 0),E([f(`input`)],VE.prototype,`_inputEl`,void 0),E([f(`ixfx-tooltip`)],VE.prototype,`_tooltipEl`,void 0),VE=E([T(`ixfx-range-input`)],VE);function HE(e){return{client:{x:e.clientX,y:e.clientY},offset:{x:e.offsetX,y:e.offsetY}}}function UE(e,n){let r=HE(e),i=e=>{n.progress(HE(e),r)},a=e=>{document.removeEventListener(`pointermove`,i),document.removeEventListener(`pointerup`,a),n.complete(HE(e),r)};document.addEventListener(`pointermove`,i),document.addEventListener(`pointerup`,a)}function WE(e,n){let r=e-n,i=e+n;return e=>e>=r&&e<=i}let GE=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=si(this.#t,this.#e,0,100),this.#r=si(0,100,this.#t,this.#e),this.#i=ei(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=WE(d,10),m=WE(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;UE(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`
|
|
11178
11178
|
<div @pointerdown=${this._onPointerDown} @input=${this._onInput} style="--a: ${r}; --b: ${o}">
|
|
11179
11179
|
<input class="thumb-round" .value=${r} id="a" step=${this.step} type="range" style="${s}" anchor="--a-tooltip" />
|
|
11180
11180
|
${e}
|
|
11181
11181
|
|
|
11182
11182
|
<input class="thumb-round" .value=${o} id="b" step=${this.step} type="range" style="${s}" anchor="--b-tooltip" />
|
|
11183
11183
|
${n}
|
|
11184
|
-
</div>`}static{this.styles=[w,
|
|
11184
|
+
</div>`}static{this.styles=[w,zE,sn,r`
|
|
11185
11185
|
:host {
|
|
11186
11186
|
display: grid;
|
|
11187
11187
|
--value-label-color: unset;
|
|
@@ -11326,14 +11326,14 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11326
11326
|
[type=range]:focus, [type=range]:focus + ixfx-tooltip, [type=range]:hover, [type=range]:hover + ixfx-tooltip {
|
|
11327
11327
|
--sel: 1 ;
|
|
11328
11328
|
}
|
|
11329
|
-
`]}};E([d({type:Boolean})],
|
|
11329
|
+
`]}};E([d({type:Boolean})],GE.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],GE.prototype,`tooltipOrientation`,void 0),E([d({type:String})],GE.prototype,`crossover`,void 0),E([d({type:String,attribute:`resize-mode`})],GE.prototype,`resizeMode`,void 0),E([d({type:String,reflect:!0})],GE.prototype,`orientation`,void 0),E([d()],GE.prototype,`step`,void 0),E([d({type:Number})],GE.prototype,`a`,void 0),E([d({type:Number})],GE.prototype,`b`,void 0),E([d({type:Number})],GE.prototype,`max`,null),E([d({type:Number})],GE.prototype,`min`,null),E([u({capture:!0})],GE.prototype,`_onInput`,null),E([u({capture:!0})],GE.prototype,`_onPointerDown`,null),GE=E([T(`ixfx-range-multi`)],GE);let KE=class extends Oy(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
|
|
11330
11330
|
style="--tooltip-background: var(--surface-5); --tooltip-color: var(--surface-5-text)"
|
|
11331
11331
|
.orientation=${this.tooltipOrientation}
|
|
11332
11332
|
anchor="--thumb-tooltip"
|
|
11333
11333
|
.value=${this.value}></ixfx-tooltip>`:a,n=this.orientation===`vertical`?`writing-mode: vertical-lr; direction: rtl;`:a;return i`
|
|
11334
11334
|
<input ?disabled=${this.disabled} step=${this.step} min=${this.min} max=${this.max} value=${this.value} @input=${this.onRangeInput} type="range" style=${n}>
|
|
11335
11335
|
${e}
|
|
11336
|
-
`}static{this.styles=[w,sn,
|
|
11336
|
+
`}static{this.styles=[w,sn,zE,r`
|
|
11337
11337
|
:host {
|
|
11338
11338
|
display: inline-block;
|
|
11339
11339
|
--value-label-color: unset;
|
|
@@ -11392,7 +11392,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11392
11392
|
[type="range"]:focus {
|
|
11393
11393
|
outline: none;
|
|
11394
11394
|
}
|
|
11395
|
-
`]}};E([d({type:Boolean})],
|
|
11395
|
+
`]}};E([d({type:Boolean})],KE.prototype,`tooltip`,void 0),E([d({type:String,attribute:`tooltip-orientation`})],KE.prototype,`tooltipOrientation`,void 0),E([d({type:String,reflect:!0})],KE.prototype,`orientation`,void 0),E([d({type:Boolean,attribute:!0})],KE.prototype,`disabled`,void 0),E([d({type:Number})],KE.prototype,`min`,void 0),E([d({type:Number})],KE.prototype,`max`,void 0),E([d({type:Number})],KE.prototype,`value`,null),E([d({type:Number})],KE.prototype,`step`,void 0),KE=E([T(`ixfx-range`)],KE);let qE=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=[sn,r`
|
|
11396
11396
|
:host {
|
|
11397
11397
|
--ixfx-rating-size: 1.5rem;
|
|
11398
11398
|
--ixfx-rating-gap: 0.2rem;
|
|
@@ -11430,7 +11430,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11430
11430
|
@click=${e=>this._commit(this._calc(e,a))}>
|
|
11431
11431
|
<svg viewBox="0 0 24 24" class="bg" fill="currentColor"><path d=${d}></path></svg>
|
|
11432
11432
|
${s||c?i`<svg viewBox="0 0 24 24" class="fill" fill="currentColor"><path d=${d}></path></svg>`:``}
|
|
11433
|
-
</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})],
|
|
11433
|
+
</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})],qE.prototype,`value`,void 0),E([d({type:Number})],qE.prototype,`max`,void 0),E([d({type:Boolean,attribute:`allow-half`})],qE.prototype,`allowHalf`,void 0),E([d({type:Boolean,reflect:!0})],qE.prototype,`disabled`,void 0),E([d({type:Boolean,reflect:!0})],qE.prototype,`readonly`,void 0),E([d({type:String})],qE.prototype,`variant`,void 0),E([m()],qE.prototype,`_preview`,void 0),qE=E([T(`ixfx-rating`)],qE);let JE=class extends Oy(n){constructor(...e){super(...e),this._selectedIndex=-1,this._slottedItems=[],this.tickled=new ie(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,ae,oe,Og(`x`),r`
|
|
11434
11434
|
:host {
|
|
11435
11435
|
--select-horiz-item-width: 80%;
|
|
11436
11436
|
--select-horiz-gap: var(--space-s);
|
|
@@ -11526,7 +11526,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11526
11526
|
<slot @slotchange=${this._onSlotChange}></slot>
|
|
11527
11527
|
<div class="spacer"></div>
|
|
11528
11528
|
</div>
|
|
11529
|
-
`}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()],
|
|
11529
|
+
`}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()],JE.prototype,`_selectedIndex`,void 0),E([m()],JE.prototype,`_slottedItems`,void 0),E([d({type:Number,reflect:!0,attribute:`selected-index`})],JE.prototype,`selectedIndex`,null),E([d({type:String})],JE.prototype,`selectedValue`,null),JE=E([T(`ixfx-select-horiz`)],JE);function YE(e,n,r){return Math.min(Math.max(e,n),r)}function XE(e,n,r,i,a){return r===n?i:i+(e-n)/(r-n)*(a-i)}let ZE=class extends Oy(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=XE(this.#n+r,this.min,this.max,0,1);this.#c(YE(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=Dy(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 XE(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=XE(e,0,1,this.min,this.max),i=this.#s(YE(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(YE(this.#o()+e,0,1),n)}_applyWheelDelta(e,n){let r=this.max-this.min,i=Dy(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`
|
|
11530
11530
|
<circle class="fill" cx="${r}" cy="${50}" r="${n}" />
|
|
11531
11531
|
<circle class="outline" cx="${50}" cy="${50}" r="${45}" fill="none" />
|
|
11532
11532
|
`}#_(){let e=this.#o();if(this.fillMode===`left`||this.fillMode===`right`){let n=90*e,r=this.fillMode===`left`?5:95-n;return s`
|
|
@@ -11593,10 +11593,10 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11593
11593
|
fill: var(--shapefill-value-fill-color, var(--accent));
|
|
11594
11594
|
transition: var(--shapefill-value-fill-transition, none);
|
|
11595
11595
|
}
|
|
11596
|
-
`]}};E([d({type:String})],
|
|
11596
|
+
`]}};E([d({type:String})],ZE.prototype,`display`,void 0),E([d({type:String,attribute:`fill-mode`})],ZE.prototype,`fillMode`,void 0),E([d({type:Number})],ZE.prototype,`value`,void 0),E([d({type:Number})],ZE.prototype,`min`,void 0),E([d({type:Number})],ZE.prototype,`max`,void 0),E([d({type:Number})],ZE.prototype,`step`,void 0),E([d({type:Number})],ZE.prototype,`stops`,void 0),E([d({type:Boolean,reflect:!0})],ZE.prototype,`disabled`,void 0),ZE=E([T(`ixfx-shapefill-value`)],ZE);const QE=Array.from({length:30},(e,n)=>n%10),$E={lead:0,integer:1,decimal:2,fraction:3,trail:4};function eD(e,n){return(e%n+n)%n}function tD(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()?tD(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)=>$E[e.section]-$E[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+eD(r-n,10):i===`down`?o-eD(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`
|
|
11597
11597
|
<span class="cell digit" part="digit" data-key=${e.key} data-phase=${e.phase}>
|
|
11598
11598
|
<span class="reel" style=${`--o:${10+Number(e.char)}`}>
|
|
11599
|
-
${
|
|
11599
|
+
${QE.map(e=>i`<span>${e}</span>`)}
|
|
11600
11600
|
</span>
|
|
11601
11601
|
</span>
|
|
11602
11602
|
`:i`
|
|
@@ -11705,7 +11705,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11705
11705
|
:host([data-static]) .cell {
|
|
11706
11706
|
transition: none;
|
|
11707
11707
|
}
|
|
11708
|
-
`}};E([d({type:Number})],
|
|
11708
|
+
`}};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 rD=0,iD=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-${++rD}`,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,ue,r`
|
|
11709
11709
|
:host {
|
|
11710
11710
|
display: flex;
|
|
11711
11711
|
align-items: center;
|
|
@@ -11757,7 +11757,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11757
11757
|
position-area: inline-end;
|
|
11758
11758
|
margin-inline-start: var(--space-s);
|
|
11759
11759
|
}
|
|
11760
|
-
`]}render(){return i`<slot></slot>`}};E([d({type:String})],
|
|
11760
|
+
`]}render(){return i`<slot></slot>`}};E([d({type:String})],iD.prototype,`for`,void 0),E([d({type:String})],iD.prototype,`mode`,void 0),E([d({type:String,reflect:!0})],iD.prototype,`placement`,void 0),E([d({type:String})],iD.prototype,`dismiss`,void 0),E([d({type:Number,attribute:`show-delay`})],iD.prototype,`showDelay`,void 0),E([d({type:Number,attribute:`hide-delay`})],iD.prototype,`hideDelay`,void 0),E([m()],iD.prototype,`_isOpen`,void 0),iD=E([T(`ixfx-snackbar`)],iD);let aD=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`
|
|
11761
11761
|
:host {
|
|
11762
11762
|
display: block;
|
|
11763
11763
|
position: relative;
|
|
@@ -11821,7 +11821,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11821
11821
|
>
|
|
11822
11822
|
<slot></slot>
|
|
11823
11823
|
</div>
|
|
11824
|
-
`}};E([d({type:String,attribute:`orientation`})],
|
|
11824
|
+
`}};E([d({type:String,attribute:`orientation`})],aD.prototype,`orientation`,void 0),E([d({type:Number,attribute:`snap-positions`})],aD.prototype,`snapPositions`,void 0),E([d({type:String,attribute:`snap-logic`})],aD.prototype,`snapLogic`,void 0),E([d({type:String,attribute:`click-snap`})],aD.prototype,`clickSnap`,void 0),E([d({type:Number})],aD.prototype,`snap`,void 0),E([m()],aD.prototype,`_dragging`,void 0),aD=E([T(`ixfx-snap-container`)],aD);let oD=class extends Oy(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,sn,r`
|
|
11825
11825
|
:host {
|
|
11826
11826
|
display: block;
|
|
11827
11827
|
user-select: none;
|
|
@@ -11857,7 +11857,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11857
11857
|
>
|
|
11858
11858
|
<svg aria-hidden="true">${this.#s()}</svg>
|
|
11859
11859
|
</div>
|
|
11860
|
-
`}};E([d({type:Number})],
|
|
11860
|
+
`}};E([d({type:Number})],oD.prototype,`barSpacing`,void 0),E([d({type:Number})],oD.prototype,`barWidth`,void 0),E([d({type:Number})],oD.prototype,`debounceMs`,void 0),E([d({type:Number})],oD.prototype,`retractDurationMs`,void 0),oD=E([T(`ixfx-swipe`)],oD);let sD=class extends n{render(){return i`<slot></slot>`}static{this.styles=[w,r`
|
|
11861
11861
|
:host {
|
|
11862
11862
|
display:none;
|
|
11863
11863
|
height:100%;
|
|
@@ -11868,12 +11868,12 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11868
11868
|
background: var(--surface-3);
|
|
11869
11869
|
display:block;
|
|
11870
11870
|
}
|
|
11871
|
-
`]}};
|
|
11871
|
+
`]}};sD=E([T(`ixfx-tab-panel`)],sD);var cD=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 lD=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`
|
|
11872
11872
|
:host {
|
|
11873
11873
|
display: block;
|
|
11874
11874
|
}
|
|
11875
11875
|
|
|
11876
|
-
`}};E([p()],
|
|
11876
|
+
`}};E([p()],lD.prototype,`_listItems`,void 0),lD=E([T(`ixfx-tab-panels`)],lD);let uD=class extends n{constructor(...e){super(...e),this.text=``,this.paused=!1}render(){return i`<span class="shimmer" part="text"
|
|
11877
11877
|
>${this.text===``?i`<slot></slot>`:this.text}</span
|
|
11878
11878
|
>`}static{this.styles=r`
|
|
11879
11879
|
:host {
|
|
@@ -11929,7 +11929,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
11929
11929
|
-webkit-text-fill-color: var(--text-shimmer-color);
|
|
11930
11930
|
}
|
|
11931
11931
|
}
|
|
11932
|
-
`}};E([d({type:String})],oD.prototype,`text`,void 0),E([d({type:Boolean,reflect:!0})],oD.prototype,`paused`,void 0),oD=E([T(`ixfx-text-shimmer`)],oD);var sD=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 cD=[1,2,5,10];function lD(e,n,r,i=`adaptive`,a,o){return i===`fixed`&&a!==void 0&&o!==void 0?dD(a,o):uD(e,n,r)}function uD(e,n,r){let i=e.max-e.min;if(i<=0||r<=0)return{majorStep:100,minorDivisions:4,minorStep:25};let a=80*fD(n),o=i/Math.max(2,Math.floor(r/a)),s=10**Math.floor(Math.log10(o)),c=s;for(let e of cD){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 dD(e,n){let r=e;for(;r*n<5&&r<0xe8d4a51000;)r*=2;return{majorStep:r*4,minorDivisions:4,minorStep:r}}function fD(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 pD(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 mD(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 hD(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 gD(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(),vD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.fill(),g&&(e.strokeStyle=`#fff`,e.lineWidth=1.5,e.beginPath(),vD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),x&&!g&&(e.strokeStyle=d,e.lineWidth=1,e.beginPath(),vD(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 _D(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 vD(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 bD(e){let n=getComputedStyle(e),r={};for(let e of yD)r[e]=n.getPropertyValue(e).trim();return r}function xD(e,n,r){return e/n+r}function SD(e){return e>0?1/e:1}function CD(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*SD(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 wD(e,n){return n.find(n=>e>=n.y&&e<n.y+n.height)?.trackKey}function TD(e,n){return Math.abs(e)>n?e-Math.sign(e)*n:0}function ED(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 DD(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 OD(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=xD(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=CD(o,s,e._internalEvents,e._trackLayout,i);if(r.shiftKey&&l.kind===`event-move`){AD(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`){kD(e,n,r);return}let a=e.pxPerUnit,o=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),s=xD(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=TD(n,4),s=TD(a,4),c=ED(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=wD(c,e._trackLayout)??r.trackKey,p=e.pxPerUnit,m=lD(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,jD(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,jD(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 kD(e,n,r){let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=xD(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=CD(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 AD(e,n){let r=new Set(e._selectedIds);r.has(n)?r.delete(n):r.add(n),e._selectedIds=r,jD(e),e.getVCanvas()?.invalidateAll()}function jD(e){e.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...e._selectedIds]},bubbles:!0,composed:!0}))}const MD=r`
|
|
11932
|
+
`}};E([d({type:String})],uD.prototype,`text`,void 0),E([d({type:Boolean,reflect:!0})],uD.prototype,`paused`,void 0),uD=E([T(`ixfx-text-shimmer`)],uD);var dD=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 fD=[1,2,5,10];function pD(e,n,r,i=`adaptive`,a,o){return i===`fixed`&&a!==void 0&&o!==void 0?hD(a,o):mD(e,n,r)}function mD(e,n,r){let i=e.max-e.min;if(i<=0||r<=0)return{majorStep:100,minorDivisions:4,minorStep:25};let a=80*gD(n),o=i/Math.max(2,Math.floor(r/a)),s=10**Math.floor(Math.log10(o)),c=s;for(let e of fD){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 hD(e,n){let r=e;for(;r*n<5&&r<0xe8d4a51000;)r*=2;return{majorStep:r*4,minorDivisions:4,minorStep:r}}function gD(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 _D(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 vD(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 yD(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 bD(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(),SD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.fill(),g&&(e.strokeStyle=`#fff`,e.lineWidth=1.5,e.beginPath(),SD(e,_,y,v,b,Math.min(m,v/2,b/2)),e.stroke()),x&&!g&&(e.strokeStyle=d,e.lineWidth=1,e.beginPath(),SD(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 xD(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 SD(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 CD=[`--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 wD(e){let n=getComputedStyle(e),r={};for(let e of CD)r[e]=n.getPropertyValue(e).trim();return r}function TD(e,n,r){return e/n+r}function ED(e){return e>0?1/e:1}function DD(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*ED(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 OD(e,n){return n.find(n=>e>=n.y&&e<n.y+n.height)?.trackKey}function kD(e,n){return Math.abs(e)>n?e-Math.sign(e)*n:0}function AD(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 jD(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 MD(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=TD(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=DD(o,s,e._internalEvents,e._trackLayout,i);if(r.shiftKey&&l.kind===`event-move`){PD(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`){ND(e,n,r);return}let a=e.pxPerUnit,o=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),s=TD(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=kD(n,4),s=kD(a,4),c=AD(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=OD(c,e._trackLayout)??r.trackKey,p=e.pxPerUnit,m=pD(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,FD(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,FD(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 ND(e,n,r){let i=e.pxPerUnit,a=n.convertFromViewportToCanvas(r.offsetX,r.offsetY),o=TD(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=DD(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 PD(e,n){let r=new Set(e._selectedIds);r.has(n)?r.delete(n):r.add(n),e._selectedIds=r,FD(e),e.getVCanvas()?.invalidateAll()}function FD(e){e.dispatchEvent(new CustomEvent(`selection-change`,{detail:{selectedIds:[...e._selectedIds]},bubbles:!0,composed:!0}))}const ID=r`
|
|
11933
11933
|
:host {
|
|
11934
11934
|
/* Layout */
|
|
11935
11935
|
--timeline-axis-height: 24px;
|
|
@@ -12079,7 +12079,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12079
12079
|
.meta-area.visible {
|
|
12080
12080
|
display: block;
|
|
12081
12081
|
}
|
|
12082
|
-
`;let
|
|
12082
|
+
`;let LD=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,Yt,r`
|
|
12083
12083
|
:host {
|
|
12084
12084
|
display: flex;
|
|
12085
12085
|
align-items: center;
|
|
@@ -12124,7 +12124,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12124
12124
|
`]}#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`
|
|
12125
12125
|
<span class="handle ixfx-handle" data-handle="dotted" data-shape="spot" part="handle"></span>
|
|
12126
12126
|
<span class="label">${this.label}</span>
|
|
12127
|
-
`}#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})],
|
|
12127
|
+
`}#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})],LD.prototype,`label`,void 0),E([d({type:String,attribute:`track-key`})],LD.prototype,`trackKey`,void 0),E([d({type:Boolean,reflect:!0})],LD.prototype,`selected`,void 0),E([d({type:Boolean,reflect:!0})],LD.prototype,`reorderable`,void 0),E([d({type:Boolean,reflect:!0})],LD.prototype,`resizable`,void 0),LD=E([T(`ixfx-timeline-track-tab`)],LD);function RD(e,n,r,i,a=0,o=0){return{x:e+r-i,y:n+a-o}}function zD(e,n,r,i,a=0,o=0){return{x:e-r+i,y:n-a+o}}function BD(e,n,r){return Math.max(n,Math.min(e,r))}const VD=r`
|
|
12128
12128
|
:host {
|
|
12129
12129
|
display: block;
|
|
12130
12130
|
position: relative;
|
|
@@ -12213,7 +12213,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12213
12213
|
scroll-timeline: --scrollfade x;
|
|
12214
12214
|
}
|
|
12215
12215
|
|
|
12216
|
-
`;function RD(e,n){return e*n}function zD(e,n){return n===0||e<=n}function BD(e,n){return e<0||n===0?0:zD(e,n)?(n-e)/2:0}function VD(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:zD(r,i)?r:e+n>o?Math.max(0,o-e):n}function HD(e,n,r,i){if(r===0)return{firstTile:0,lastTile:0,tiles:[]};let a=RD(n,i.tileWidthMultiplier);if(zD(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 UD(e,n){return e*n}function WD(e,n){return n===0||e<=n}function GD(e,n){return e<0||n===0?0:WD(e,n)?(n-e)/2:0}function KD(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:WD(r,i)?r:e+n>o?Math.max(0,o-e):n}function qD(e,n,r,i){if(r===0)return{firstRow:0,lastRow:0,rows:[]};let a=UD(n,i.tileHeightMultiplier);if(WD(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 JD(e,n){let r=null,i=(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>{e(...i)},n)};return i.cancel=()=>{r&&=(clearTimeout(r),null)},i}const YD=[`#FF6B6B`,`#4ECDC4`,`#45B7D1`,`#96CEB4`,`#FFEAA7`,`#DDA0DD`,`#98D8C8`,`#F7DC6F`,`#BB8FCE`,`#85C1E9`];function XD(e){return YD[e%YD.length]}function ZD(e,n,r,i,a){i.fillStyle=`whitesmoke`,i.fillRect(a.x,a.y,a.width,a.height),i.fillStyle=XD(e),i.strokeStyle=XD(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 QD=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 $D=(e,n)=>`${e},${n}`;let eO=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=JD(()=>{this._requestRedrawAll(`scrollDebounce`)},this._renderingOptions.scrollDebounceMs),this._scrollEndDebounce=JD(()=>{this._emitScrollEndEvent(!0)},this._renderingOptions.scrollDebounceMs),this._resizeDebounce=JD(()=>{this._onResize()},this._renderingOptions.scrollDebounceMs)}static{this.styles=LD}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=zD(this.effectiveLogicalWidth,this._viewportWidth),n=WD(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 RD(this._viewportWidth,this._renderingOptions.tileWidthMultiplier)}_getTileHeight(){return UD(this._viewportHeight,this._renderingOptions.tileHeightMultiplier)}_getTileClippedWidth(e,n){return VD(e,n,this.effectiveLogicalWidth,this._viewportWidth,this._renderingOptions.overscrollPadMultiplier)}_getTileClippedHeight(e,n){return KD(e,n,this.effectiveLogicalHeight,this._viewportHeight,this._renderingOptions.overscrollPadMultiplier)}_calculateTileRange(){return HD(this._scrollLeft,this._viewportWidth,this.effectiveLogicalWidth,this._renderingOptions)}_calculateTileRowRange(){return qD(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($D(e,n)),this._tilePool.has($D(e,n))||this._tilePool.set($D(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=$D(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=zD(this.effectiveLogicalWidth,this._viewportWidth),d=WD(this.effectiveLogicalHeight,this._viewportHeight),f=BD(this.effectiveLogicalWidth,this._viewportWidth),p=GD(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=$D(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=zD(this.effectiveLogicalWidth,this._viewportWidth),l=WD(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&&ZD(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=ID(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=ID(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=$D(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=BD(this.effectiveLogicalWidth,this._viewportWidth),i=GD(this.effectiveLogicalHeight,this._viewportHeight);return PD(e,n,this._scrollLeft,r,this._scrollTop,i)}convertFromCanvasToViewport(e,n){let r=BD(this.effectiveLogicalWidth,this._viewportWidth),i=GD(this.effectiveLogicalHeight,this._viewportHeight);return FD(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`
|
|
12216
|
+
`;function HD(e,n){return e*n}function UD(e,n){return n===0||e<=n}function WD(e,n){return e<0||n===0?0:UD(e,n)?(n-e)/2:0}function GD(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:UD(r,i)?r:e+n>o?Math.max(0,o-e):n}function KD(e,n,r,i){if(r===0)return{firstTile:0,lastTile:0,tiles:[]};let a=HD(n,i.tileWidthMultiplier);if(UD(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 qD(e,n){return e*n}function JD(e,n){return n===0||e<=n}function YD(e,n){return e<0||n===0?0:JD(e,n)?(n-e)/2:0}function XD(e,n,r,i,a){if(n===0||e<0)return 0;let o=r+i*a;return e>=o?0:JD(r,i)?r:e+n>o?Math.max(0,o-e):n}function ZD(e,n,r,i){if(r===0)return{firstRow:0,lastRow:0,rows:[]};let a=qD(n,i.tileHeightMultiplier);if(JD(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 QD(e,n){let r=null,i=(...i)=>{r&&clearTimeout(r),r=setTimeout(()=>{e(...i)},n)};return i.cancel=()=>{r&&=(clearTimeout(r),null)},i}const $D=[`#FF6B6B`,`#4ECDC4`,`#45B7D1`,`#96CEB4`,`#FFEAA7`,`#DDA0DD`,`#98D8C8`,`#F7DC6F`,`#BB8FCE`,`#85C1E9`];function eO(e){return $D[e%$D.length]}function tO(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 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 rO=(e,n)=>`${e},${n}`;let iO=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=QD(()=>{this._requestRedrawAll(`scrollDebounce`)},this._renderingOptions.scrollDebounceMs),this._scrollEndDebounce=QD(()=>{this._emitScrollEndEvent(!0)},this._renderingOptions.scrollDebounceMs),this._resizeDebounce=QD(()=>{this._onResize()},this._renderingOptions.scrollDebounceMs)}static{this.styles=VD}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=UD(this.effectiveLogicalWidth,this._viewportWidth),n=JD(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 HD(this._viewportWidth,this._renderingOptions.tileWidthMultiplier)}_getTileHeight(){return qD(this._viewportHeight,this._renderingOptions.tileHeightMultiplier)}_getTileClippedWidth(e,n){return GD(e,n,this.effectiveLogicalWidth,this._viewportWidth,this._renderingOptions.overscrollPadMultiplier)}_getTileClippedHeight(e,n){return XD(e,n,this.effectiveLogicalHeight,this._viewportHeight,this._renderingOptions.overscrollPadMultiplier)}_calculateTileRange(){return KD(this._scrollLeft,this._viewportWidth,this.effectiveLogicalWidth,this._renderingOptions)}_calculateTileRowRange(){return ZD(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(rO(e,n)),this._tilePool.has(rO(e,n))||this._tilePool.set(rO(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=rO(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=UD(this.effectiveLogicalWidth,this._viewportWidth),d=JD(this.effectiveLogicalHeight,this._viewportHeight),f=WD(this.effectiveLogicalWidth,this._viewportWidth),p=YD(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=rO(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=UD(this.effectiveLogicalWidth,this._viewportWidth),l=JD(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&&tO(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=BD(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=BD(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=rO(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=WD(this.effectiveLogicalWidth,this._viewportWidth),i=YD(this.effectiveLogicalHeight,this._viewportHeight);return RD(e,n,this._scrollLeft,r,this._scrollTop,i)}convertFromCanvasToViewport(e,n){let r=WD(this.effectiveLogicalWidth,this._viewportWidth),i=YD(this.effectiveLogicalHeight,this._viewportHeight);return zD(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`
|
|
12217
12217
|
<div class=${e}>
|
|
12218
12218
|
<div class="spacer"></div>
|
|
12219
12219
|
<div class="tile-pool"></div>
|
|
@@ -12221,7 +12221,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12221
12221
|
<slot></slot>
|
|
12222
12222
|
</div>
|
|
12223
12223
|
</div>
|
|
12224
|
-
`}};
|
|
12224
|
+
`}};nO([d({type:Boolean})],iO.prototype,`hinting`,void 0),nO([d()],iO.prototype,`logicalWidth`,null),nO([d()],iO.prototype,`logicalHeight`,null),nO([d({type:Number})],iO.prototype,`logicalScrollLeft`,null),nO([d({type:Number})],iO.prototype,`logicalScrollTop`,null),iO=nO([l(`x-vcanvas`)],iO);const aO=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=wD(this);let o=pD(this._viewRange,this.userScale,this.#c(),this.gridMode,this.minorStep,i),s=this._internalTracks.map(e=>({key:e.key,color:e.color}));yD(e,a,this._trackLayout,s,this.#t,i),_D(e,a,o,this.altMajorBg,this.#t,i),bD(e,a,this._internalEvents,this._trackLayout,this._selectedIds,this._tickledId,this._drag,this.#t,i),xD(e,this._drag,i);let c=this.#e?.logicalScrollTop??0;vD(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,aO))),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=kD(r,4),o=kD(i,4),s=jD(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=[ID]}#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,aO)),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,aO))),this._viewRange=this.#_(e.min,this._ppu)}setZoomPan(e,n){this._ppu=Math.max(this.#l(),Math.min(n,aO)),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=MD(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`
|
|
12225
12225
|
<div class="content-wrapper">
|
|
12226
12226
|
<div class="content-area">
|
|
12227
12227
|
<div class="v-axis-zone"
|
|
@@ -12274,7 +12274,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12274
12274
|
|
|
12275
12275
|
<div class="meta-resizer ${this.metaEnabled?`visible`:``}"></div>
|
|
12276
12276
|
<div class="meta-area ${this.metaEnabled?`visible`:``}" style="height:${this._metaHeight}px"></div>
|
|
12277
|
-
`}#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
|
|
12277
|
+
`}#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 oO=class extends n{constructor(...e){super(...e),this.label=``,this.grow=!1,this.reorderable=!1}static{this.styles=[w,Yt,r`
|
|
12278
12278
|
:host {
|
|
12279
12279
|
display: flex;
|
|
12280
12280
|
flex-direction: column;
|
|
@@ -12350,7 +12350,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12350
12350
|
<slot></slot>
|
|
12351
12351
|
</div>
|
|
12352
12352
|
</div>
|
|
12353
|
-
`}};E([d({type:String})],
|
|
12353
|
+
`}};E([d({type:String})],oO.prototype,`label`,void 0),E([d({type:Boolean,reflect:!0})],oO.prototype,`grow`,void 0),E([d({type:Boolean,reflect:!0})],oO.prototype,`reorderable`,void 0),oO=E([T(`ixfx-toolbar-group`)],oO);var sO;function cO(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 lO=!1;function uO(){if(lO)return;lO=!0;let e=document.createElement(`style`);e.textContent=`
|
|
12354
12354
|
.ixfx-drag-ghost.ixfx-toolbar-group-ghost {
|
|
12355
12355
|
padding: var(--space-s, 8px) var(--space-m, 16px);
|
|
12356
12356
|
background: var(--surface-4);
|
|
@@ -12363,7 +12363,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12363
12363
|
user-select: none;
|
|
12364
12364
|
-webkit-user-select: none;
|
|
12365
12365
|
}
|
|
12366
|
-
`,document.head.appendChild(e)}let
|
|
12366
|
+
`,document.head.appendChild(e)}let dO=class extends n{static{sO=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-${sO._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,ue,r`
|
|
12367
12367
|
:host {
|
|
12368
12368
|
--toolbar-gap: var(--space-s);
|
|
12369
12369
|
--toolbar-group-gap: var(--space-m);
|
|
@@ -12461,7 +12461,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12461
12461
|
pointer-events: none;
|
|
12462
12462
|
z-index: 1;
|
|
12463
12463
|
}
|
|
12464
|
-
`]}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
|
|
12464
|
+
`]}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 uO(),zg({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 cO(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`
|
|
12465
12465
|
<div class="inner" role="toolbar" aria-orientation=${this.orientation}>
|
|
12466
12466
|
<slot @pointerdown=${this._onPointerDown} @keydown=${this._onKeyDown}></slot>
|
|
12467
12467
|
<ixfx-button class="overflow-btn" ?hidden=${!n} @click=${this._toggleOverflow} aria-label="More" aria-haspopup="true" aria-expanded=${this._popoverOpen}>⋯</ixfx-button>
|
|
@@ -12470,7 +12470,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12470
12470
|
<slot name="overflow"></slot>
|
|
12471
12471
|
</div>
|
|
12472
12472
|
${r?i`<div class="drop-caret" style=${r}></div>`:a}
|
|
12473
|
-
`}};E([d({type:String,reflect:!0})],
|
|
12473
|
+
`}};E([d({type:String,reflect:!0})],dO.prototype,`orientation`,void 0),E([d({type:String,reflect:!0})],dO.prototype,`layout`,void 0),E([d({type:String,attribute:`vertical-writing`,reflect:!0})],dO.prototype,`verticalWriting`,void 0),E([d({type:String,attribute:`toolbar-align`,reflect:!0})],dO.prototype,`toolbarAlign`,void 0),E([d({type:Boolean,attribute:`show-group-labels`,reflect:!0})],dO.prototype,`showGroupLabels`,void 0),E([d({type:Boolean,attribute:`invisible-groups`,reflect:!0})],dO.prototype,`invisibleGroups`,void 0),E([d({type:Boolean,attribute:`allow-reorder`,reflect:!0})],dO.prototype,`allowReorder`,void 0),E([m()],dO.prototype,`_overflowCount`,void 0),E([m()],dO.prototype,`_popoverOpen`,void 0),E([f(`.inner`)],dO.prototype,`_inner`,void 0),E([f(`.overflow-popover`)],dO.prototype,`_popover`,void 0),E([f(`slot`)],dO.prototype,`_slot`,void 0),dO=sO=E([T(`ixfx-toolbar`)],dO);let fO=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`
|
|
12474
12474
|
${S(`cc${this._transitionId}`,i`
|
|
12475
12475
|
<span class="layer current char-swap">
|
|
12476
12476
|
${r.map((e,n)=>i`<span class="char in" style=${c(n)}>${e}</span>`)}
|
|
@@ -12630,7 +12630,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12630
12630
|
from { opacity: 1; transform: translateY(0) scale(1); }
|
|
12631
12631
|
to { opacity: 0; transform: translateY(0.3em) scale(0.8); }
|
|
12632
12632
|
}
|
|
12633
|
-
`}};E([d({type:String})],cO.prototype,`text`,void 0),E([d({type:String})],cO.prototype,`effect`,void 0),E([d({type:Number})],cO.prototype,`duration`,void 0),E([d({type:String})],cO.prototype,`easing`,void 0),E([m()],cO.prototype,`_currentText`,void 0),E([m()],cO.prototype,`_outgoingText`,void 0),E([m()],cO.prototype,`_activeEffect`,void 0),E([m()],cO.prototype,`_transitionId`,void 0),cO=E([T(`ixfx-transitory-label`)],cO);var lO=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 uO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function dO(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=dO(r,n);if(e)return e}}}function fO(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=fO(r,n);if(i)return[e,...i]}}}function pO(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 mO(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=pO(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=pO(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 hO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.min(e,1):0}function gO(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=mO(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 _O(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?hO(l):0,p=d?hO(u):0,m=e=>{let n=e.children??[];return s?n.filter(e=>e.item.isLeaf!==!0):n},h=a===void 0?e:dO(e,a)??e,g=fO(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=gO(n,e.map(e=>uO(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 Bt(this,{adapter:Ut(this,{labelSelector:`.treemap-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new ie(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 dO(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 _O(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=Jt();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[...Rt];let n=new Set(e.split(/\s+/));return Rt.filter(e=>n.has(e))}#m(){this.#i&&(this.search.setModes(this.#p()),this.#a?.(),this.#a=Lt(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&&!dO(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 dg(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=fO(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:fO(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:fO(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`
|
|
12633
|
+
`}};E([d({type:String})],fO.prototype,`text`,void 0),E([d({type:String})],fO.prototype,`effect`,void 0),E([d({type:Number})],fO.prototype,`duration`,void 0),E([d({type:String})],fO.prototype,`easing`,void 0),E([m()],fO.prototype,`_currentText`,void 0),E([m()],fO.prototype,`_outgoingText`,void 0),E([m()],fO.prototype,`_activeEffect`,void 0),E([m()],fO.prototype,`_transitionId`,void 0),fO=E([T(`ixfx-transitory-label`)],fO);var pO=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 mO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?e:0}function hO(e,n){if(e){if(e.item.key===n)return e;for(let r of e.children??[]){let e=hO(r,n);if(e)return e}}}function gO(e,n){if(e){if(e.item.key===n)return[e];for(let r of e.children??[]){let i=gO(r,n);if(i)return[e,...i]}}}function _O(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 vO(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=_O(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=_O(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 yO(e){return typeof e==`number`&&Number.isFinite(e)&&e>0?Math.min(e,1):0}function bO(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=vO(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 xO(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?yO(l):0,p=d?yO(u):0,m=e=>{let n=e.children??[];return s?n.filter(e=>e.item.isLeaf!==!0):n},h=a===void 0?e:hO(e,a)??e,g=gO(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=bO(n,e.map(e=>mO(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 Bt(this,{adapter:Ut(this,{labelSelector:`.treemap-label`,highlightKey:`incr-search-highlight`})}),this.tickled=new ie(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 hO(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 xO(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=Jt();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[...Rt];let n=new Set(e.split(/\s+/));return Rt.filter(e=>n.has(e))}#m(){this.#i&&(this.search.setModes(this.#p()),this.#a?.(),this.#a=Lt(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&&!hO(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 dg(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=gO(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:gO(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:gO(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`
|
|
12634
12634
|
<nav class="breadcrumb" part="breadcrumb" aria-label="Treemap zoom path">
|
|
12635
12635
|
<ixfx-crumb-navigation
|
|
12636
12636
|
with-up
|
|
@@ -12852,7 +12852,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12852
12852
|
color: var(--surface-muted-text);
|
|
12853
12853
|
font-size: var(--text-s);
|
|
12854
12854
|
}
|
|
12855
|
-
`]}};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
|
|
12855
|
+
`]}};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 SO=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=$r((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=$r((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`
|
|
12856
12856
|
<div id="zone">
|
|
12857
12857
|
<slot style=${n} name="a"></slot>
|
|
12858
12858
|
${this._hasCorner?i`<div class="corner-zone" @pointerdown=${this.#k}></div>`:``}
|
|
@@ -12976,7 +12976,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
12976
12976
|
:host([data-collapsed-b]) slot[name="b"] {
|
|
12977
12977
|
display: none;
|
|
12978
12978
|
}
|
|
12979
|
-
`]}};E([d({type:String})],
|
|
12979
|
+
`]}};E([d({type:String})],SO.prototype,`layout`,void 0),E([d({type:String})],SO.prototype,`sizeA`,void 0),E([d({type:String})],SO.prototype,`sizeB`,void 0),E([d({type:Boolean})],SO.prototype,`fixedA`,void 0),E([d({type:Boolean})],SO.prototype,`fixedB`,void 0),E([d({type:Boolean})],SO.prototype,`collapsible`,void 0),E([d({type:Boolean,reflect:!0})],SO.prototype,`collapsedA`,void 0),E([d({type:Boolean,reflect:!0})],SO.prototype,`collapsedB`,void 0),E([d({type:String})],SO.prototype,`minSizeA`,void 0),E([d({type:String})],SO.prototype,`maxSizeA`,void 0),E([d({type:String})],SO.prototype,`minSizeB`,void 0),E([d({type:String})],SO.prototype,`maxSizeB`,void 0),E([m()],SO.prototype,`_hasCorner`,void 0),SO=E([T(`ixfx-twosplit-layout`)],SO);function CO(e){return e instanceof HTMLElement&&`checked`in e}function wO(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 TO(e,n){let r=wO(e);if(!CO(r))throw Error(`Target element is not a checkbox-like element`);let i=[];for(let e of n){let n=wO(e);CO(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 EO(e,n,r,i){return i===`linear`?(e-n)/(r-n):Math.log(e/n)/Math.log(r/n)}function DO(e,n,r,i){return i===`linear`?n+e*(r-n):n*(r/n)**e}function OO(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 Oy(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=Dy(n,i,this.stepX,e),s=Dy(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=OO(e,this.xMin,this.xMax,i),n=OO(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,sn,r`
|
|
12980
12980
|
:host {
|
|
12981
12981
|
display: block;
|
|
12982
12982
|
width: 200px;
|
|
@@ -13090,7 +13090,7 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
13090
13090
|
height:100%;
|
|
13091
13091
|
text-align:center;
|
|
13092
13092
|
}
|
|
13093
|
-
`]}_stepYByDelta(e,n){let r=this.yMax-this.yMin,i=this.stopsY??this.stops,a=Dy(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=
|
|
13093
|
+
`]}_stepYByDelta(e,n){let r=this.yMax-this.yMin,i=this.stopsY??this.stops,a=Dy(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=OO(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=DO(i,this.xMin,this.xMax,this.xScale),s=DO(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=OO(c,this.xMin,this.xMax,u),l=OO(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=EO(e,this.xMin,this.xMax,this.xScale)*100,i=EO(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 EO(Math.max(this.xMin,Math.min(this.xMax,this.x)),this.xMin,this.xMax,this.xScale)}getRelativeY(){return EO(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`
|
|
13094
13094
|
<div class="xy-pad-area"
|
|
13095
13095
|
tabindex=${this.disabled?-1:0}
|
|
13096
13096
|
@pointerdown=${this._onPointerDown}
|
|
@@ -13102,4 +13102,4 @@ const je={216:`O`,223:`s`,248:`o`,273:`d`,295:`h`,305:`i`,320:`l`,322:`l`,359:`t
|
|
|
13102
13102
|
<div class="xy-pad-label-x">${this.xLabel}</div>
|
|
13103
13103
|
<div class="xy-pad-label-y">${this.yLabel}</div>
|
|
13104
13104
|
</div>
|
|
13105
|
-
`}};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
|
|
13105
|
+
`}};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 kO(){console.log(`Init`)}export{Oe as AcTextElement,Kt as AcTokenElement,$t as BottomDrawerElement,ln as ButtonElement,ar as Checkbox,_r as CheckedSelect,R as ColourPicker,ug as ColourPickerPopup,z as CrumbNavigationElement,Mg as CrumbPathController,B as CrumbPathElement,bS as DEFAULT_SIBLING_SPACING,Ae as DataController,Pg as DataDisplayComponent,V as DataGridElement,l_ as DataTableElement,H as DetailListElement,dy as DockHostElement,ly as DockPanelElement,dn as EMPTY_GROUP_LABEL,wy as EditableLabel,ky as EditableNumber,G as FlatListElement,Uy as FormElement,Ry as FormGroupElement,By as FormPartElement,K as GridListElement,cb as GroupedItemListerElement,J as HyperbolicTreeListElement,tn as ICON_CARET_RIGHT,nn as ICON_CHECK,en as ICON_CHEVRON_DOWN,rn as ICON_CLOSE,bC as IcicleTreeListElement,Dt as IncrSearchMillerController,Dt as IncrSearchTreeController,gx as IxfxHexEditorElement,we as IxfxIconElement,Z as IxfxTimelineElement,kt as KeyedElementIndex,Rn as LIST_ITEM_MOTION_MS,Ft as LIST_SEARCH_COMMAND_IDS,Rt as LIST_SEARCH_MODES,RC as LabelledRadialInput,og as LabelledRangeInput,YC as LabelledSliderInput,XC as LedElement,Ln as ListDragSelectController,g_ as ListGroupHeaderElement,Yn as ListNativeDragController,Bt as ListSearchController,Zn as ListSelectionController,r_ as Menu,ZC as MillerBaseElement,ew as MillerListElement,tw as MillerTreeController,dw as MulticolListElement,Ag as NarrowedTextElement,Ow as NotificationManager,fw as NotificationPillElement,a_ as PanTextElement,ob as PanelElement,Nw as PanelGroupElement,YT as PlotDataSeries,X as PlotHistogram,gE as PlotMultiAxis,DE as PlotSingleAxis,OE as PlotXyAxis,RE as PolarPad,LC as RadialInputElement,un as RadioGroup,KE as RangeElement,VE as RangeInput,GE as RangeMultiElement,qE as RatingElement,JE as SelectHorizElement,ZE as ShapefillValueElement,JC as SliderInputElement,nD as SlidingNumberElement,iD as SnackbarElement,aD as SnapContainer,ir as SplitButton,ny as SplitLayoutElement,ty as SplitPanelElement,oD as SwipeElement,cD as TabController,ry as TabListElement,cy as TabListItemElement,sD as TabPanelElement,lD as TabPanelsElement,uD as TextShimmerElement,ie as TickledController,dD as TimelineController,LD as TimelineTrackTabElement,Xt as TitlebarElement,dO as ToolbarElement,oO as ToolbarGroupElement,eE as TooltipElement,fO as TransitoryLabelElement,q as TreeBaseElement,pO as TreeController,Dg as TreeDataModel,yb as TreeDropController,Qn as TreeKeyboardNavController,zb as TreeListElement,Q as TreemapListElement,SO as TwoSplitLayoutElement,W as VerticalListElement,$ as XyPad,uv as addPanelToStack,Gn as animateListItemIn,Jn as animateListItemOut,JT as applyAgeModification,C as applyHighlights,Bx as applyIsometry,qv as applySnapshot,bg as applyTreeDrop,MD as attachTimelineInteractions,Zt as bottomDrawerCommandId,ne as buildHighlightTargets,Iv as buildModel,bn as captionForEntry,jx as clampToDisk,te as clearHighlights,sv as collectContainerNames,dg as collectDataResult,iv as collectPanelIds,cv as collectStackPaths,Vx as composeIsometry,SS as computeCanonicalPositions,qT as computeColour,DS as computeHyperbolicLayout,yC as computeIcicleLayout,bv as computeLeafGeoms,xO as computeTreemapLayout,Ct as createAcCompletionProvider,Ot as createDataListSearchAdapter,Fn as createDefaultListDragPreview,Pt as createElementIncrSearch,jt as createElementListSearchAdapter,J_ as createEmptyLayout,q_ as createEmptyStack,St as createFuzzySearch,Tt as createIncrSearch,_w as createPillRenderer,X_ as createSplit,Y_ as createStack,Bb as createTreeListAdapter,Ut as createTreeListSearchAdapter,Vb as createVerticalListAdapter,Kx as decomposeViewIsometry,fn as defaultGroupLabel,Uv as distribute,xg as dropTargetFor,Fx as euclideanRadiusForHyperbolicDistance,gv as extractStack,pS as findHyperbolicIdOf,mS as findHyperbolicKeyPath,hS as findHyperbolicNode,gS as findHyperbolicPath,fS as findHyperbolicPathById,_C as findIcicleNode,vC as findIciclePath,ev as findNode,Qv as findPanelNode,tv as findParentOf,nv as findStackOf,av as findStackPathByName,hO as findTreemapNode,gO as findTreemapPath,Rx as geodesicInterpolate,Jx as geodesicPath,qx as geodesicSegment,G_ as getActiveDragPanelId,ve as getIcon,ye as getIconEntry,Se as getIconFont,Sv as getLeafNeighbours,be as hasIcon,uS as hyperbolicBranchId,cS as hyperbolicChildIds,Ix as hyperbolicDistanceForEuclideanRadius,lS as hyperbolicIdDepth,TS as hyperbolicRelativeFrame,he as iconBus,zx as identityIsometry,kO as init,pv as insertBeside,Hx as invertIsometry,W_ as isDragging,dS as isHyperbolicDescendantId,Xn as isMultiMode,K_ as isSplit,U as isStack,D as keyForElement,Bn as listItemFadeKeyframes,Vt as listSearchStyles,Px as mobiusAdd,Nx as mobiusFromOrigin,Mx as mobiusToOrigin,TO as monitorIndeterminate,Tv as moveLeafNodeToEdge,wv as moveLeafStep,Ax as norm,Hv as normalise,gC as normaliseValue,Z_ as normalize,Aw as panelGapIndex,WT as parseColourScaleAttr,Ov as parseLayout,hn as partitionByGroup,Lx as poincareDistance,B_ as pointerOverAnyHost,zn as prefersReducedMotion,Zv as preserveRestoreWeights,yg as pruneDraggedDescendants,UT as readBaseColour,_e as registerFontIcon,ge as registerIcon,Lt as registerListSearchCommands,dv as removePanelFromStack,wD as resolveCssVars,pD as resolveGrid,mn as resolveGroupKey,yv as resolveLeafPath,Wv as resolveTracks,Wx as rotationIsometry,Ev as serializeLayout,fv as setActive,xe as setIconFont,Xv as setPanelRestoreWeight,qn as startListItemOutAnimation,Ce as svgToDataUri,Cv as swapLeaves,oe as tickledItemStyles,ae as tickledStyles,ID as timelineStyles,pn as toGroupKey,Gv as toSnapshot,gn as toggleInSet,cO as toolbarGapIndex,Ux as translationFromOrigin,Gx as viewIsometry,$v as walk,mv as wrapRoot};
|